unifyedx-storybook-new 0.1.90 → 0.1.91

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,21 +1,21 @@
1
1
  import { jsxs as l, jsx as e, Fragment as ee } from "react/jsx-runtime";
2
2
  import re, { useState as L, useMemo as ne, useId as Qe, Fragment as J, useEffect as Q, useCallback as K, useRef as ue } from "react";
3
- import { a as W, U as lt, X as ge, P as _, L as ot, C as Le, 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 Nt, q as ba, r as xt, 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 Na, G as xa, H as At, J as Et, K as Rt, N as Oe, O as Xe, Q as Ze, R as It, V as zt, W as ka, Y as Bt, Z as ea, _ as Pt, $ as Ot, a0 as wa, a1 as Lt, a2 as Mt, a3 as Vt, a4 as Ut, a5 as qt, a6 as jt, a7 as Gt, a8 as _t, a9 as Yt, aa as Wt, ab as Jt, ac as Qt, ad as Xt, ae as Zt, af as Ht } from "./vendor-C8vzJvk7.js";
4
- import { Popover as Kt, PopoverButton as er, PopoverPanel as ar, Transition as oe, Dialog as me, TransitionChild as pe, DialogPanel as ke, DialogTitle as Ve, TabGroup as tr, TabList as rr, Tab as ae, TabPanels as nr, RadioGroup as Te, Listbox as X, ListboxButton as sr, ListboxOptions as lr, ListboxOption as or, SwitchGroup as ir, Switch as Ye, Menu as cr, MenuButton as dr, Portal as ur, MenuItems as mr, MenuItem as hr, DialogBackdrop as pr } from "@headlessui/react";
3
+ import { a as W, U as lt, X as ge, P as _, L as ot, C as Le, b as Me, f as Be, d as pa, D as ga, F as ct, e as it, 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 Nt, q as ba, r as xt, A as kt, s as wt, E as Ct, t as St, v as Dt, w as $t, x as Ft, y as va, z as Tt, B as Na, G as xa, H as At, J as Et, K as Rt, N as Oe, O as Xe, Q as Ze, R as It, V as zt, W as ka, Y as Bt, Z as ea, _ as Pt, $ as Ot, a0 as wa, a1 as Lt, a2 as Mt, a3 as Vt, a4 as Ut, a5 as qt, a6 as jt, a7 as Gt, a8 as _t, a9 as Yt, aa as Wt, ab as Jt, ac as Qt, ad as Xt, ae as Zt, af as Ht } from "./vendor-C8vzJvk7.js";
4
+ import { Popover as Kt, PopoverButton as er, PopoverPanel as ar, Transition as oe, Dialog as me, TransitionChild as pe, DialogPanel as ke, DialogTitle as Ve, TabGroup as tr, TabList as rr, Tab as ae, TabPanels as nr, RadioGroup as Te, Listbox as X, ListboxButton as sr, ListboxOptions as lr, ListboxOption as or, SwitchGroup as cr, Switch as Ye, Menu as ir, MenuButton as dr, Portal as ur, MenuItems as mr, MenuItem as hr, DialogBackdrop as pr } from "@headlessui/react";
5
5
  import { motion as te, AnimatePresence as fe } from "framer-motion";
6
6
  import { d as gr } from "./vendor-lodash-CvM7_34d.js";
7
- import { useFloating as Ca, offset as Sa, flip as Da, shift as Fa, autoUpdate as $a, useClick as yr, useDismiss as fr, useInteractions as br, FloatingPortal as vr } from "@floating-ui/react";
7
+ import { useFloating as Ca, offset as Sa, flip as Da, shift as $a, autoUpdate as Fa, useClick as yr, useDismiss as fr, useInteractions as br, FloatingPortal as vr } from "@floating-ui/react";
8
8
  import We, { debounce as Nr } from "lodash";
9
9
  import { toast as le, ToastContainer as xr, Slide as kr } from "react-toastify";
10
10
  import "react-toastify/dist/ReactToastify.css";
11
- 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";
11
+ import { P as wr, S as Cr, F as Sr, G as Dr, a as $r, E as Fr, 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";
12
12
  const Or = (t) => {
13
13
  let r = 2166136261;
14
14
  for (let s = 0; s < t.length; s++)
15
15
  r ^= t.charCodeAt(s), r += (r << 1) + (r << 4) + (r << 7) + (r << 8) + (r << 24);
16
16
  return r >>> 0;
17
17
  }, Lr = (t) => {
18
- const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Or(r), n = (o % 360 + 37 * s) % 360, u = 55 + (o >>> 8) % 20, i = 30 + (o >>> 16) % 10, c = 86 + (o >>> 24) % 8, y = `hsl(${n}, ${u}%, ${c}%)`, b = `hsl(${n}, ${u}%, ${i}%)`;
18
+ const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Or(r), n = (o % 360 + 37 * s) % 360, u = 55 + (o >>> 8) % 20, c = 30 + (o >>> 16) % 10, i = 86 + (o >>> 24) % 8, y = `hsl(${n}, ${u}%, ${i}%)`, b = `hsl(${n}, ${u}%, ${c}%)`;
19
19
  return { bg: y, text: b };
20
20
  }, Mr = (t = "") => t.split(" ").map((r) => r[0]).slice(0, 2).join("").toUpperCase(), Ta = ({
21
21
  src: t,
@@ -27,9 +27,9 @@ const Or = (t) => {
27
27
  textColor: n,
28
28
  // ✅ New prop for text/icon color
29
29
  className: u,
30
- ...i
30
+ ...c
31
31
  }) => {
32
- const [c, y] = L(!1), b = ne(() => Lr(r), []), N = t && !c, a = !N && r, w = !N && !r, m = W(
32
+ const [i, y] = L(!1), b = ne(() => Lr(r), []), N = t && !i, a = !N && r, w = !N && !r, m = W(
33
33
  "avatar-container",
34
34
  `avatar--size-${s}`,
35
35
  u
@@ -37,7 +37,7 @@ const Or = (t) => {
37
37
  return /* @__PURE__ */ l("div", { className: m, style: {
38
38
  backgroundColor: g,
39
39
  color: $
40
- }, ...i, children: [
40
+ }, ...c, children: [
41
41
  N && /* @__PURE__ */ e(
42
42
  "img",
43
43
  {
@@ -51,12 +51,12 @@ const Or = (t) => {
51
51
  w && /* @__PURE__ */ e("span", { className: "avatar-icon", children: /* @__PURE__ */ e(lt, {}) })
52
52
  ] });
53
53
  }, Wn = ({ children: t, max: r = 4, truncatedMessage: s = "Members", ...o }) => {
54
- const n = re.Children.toArray(t), u = n.slice(0, r), i = n.length - r;
54
+ const n = re.Children.toArray(t), u = n.slice(0, r), c = n.length - r;
55
55
  return /* @__PURE__ */ l("div", { className: "avatar-group-container", ...o, children: [
56
56
  u,
57
- i > 0 && /* @__PURE__ */ l("div", { className: "avatar-container avatar--size-medium avatar-excess", children: [
57
+ c > 0 && /* @__PURE__ */ l("div", { className: "avatar-container avatar--size-medium avatar-excess", children: [
58
58
  "+",
59
- i,
59
+ c,
60
60
  " ",
61
61
  s
62
62
  ] })
@@ -70,8 +70,8 @@ const Or = (t) => {
70
70
  icon: o,
71
71
  onRemove: n,
72
72
  bgColor: u,
73
- textColor: i,
74
- className: c,
73
+ textColor: c,
74
+ className: i,
75
75
  ...y
76
76
  }) => {
77
77
  const b = W(
@@ -79,11 +79,11 @@ const Or = (t) => {
79
79
  `badge--variant-${r}`,
80
80
  `badge--size-${s}`,
81
81
  { "badge--with-remove": !!n },
82
- c
82
+ i
83
83
  );
84
- return /* @__PURE__ */ l("span", { className: b, style: u && i ? {
84
+ return /* @__PURE__ */ l("span", { className: b, style: u && c ? {
85
85
  backgroundColor: u,
86
- color: i,
86
+ color: c,
87
87
  borderColor: "#ff0000"
88
88
  } : {}, ...y, children: [
89
89
  o && /* @__PURE__ */ e(o, { className: "badge-icon" }),
@@ -145,8 +145,8 @@ const Ur = {
145
145
  className: n = "",
146
146
  // ✅ Default is now empty
147
147
  loader: u = !1,
148
- category: i = "primary",
149
- icon: c,
148
+ category: c = "primary",
149
+ icon: i,
150
150
  // Renamed for clarity, expecting a component type e.g., CheckCircle
151
151
  disabled: y = !1,
152
152
  size: b = "medium",
@@ -156,10 +156,10 @@ const Ur = {
156
156
  onClick: w,
157
157
  ...m
158
158
  }) => {
159
- const g = y || u, $ = c && !N, P = W(
159
+ const g = y || u, $ = i && !N, O = W(
160
160
  "btn-base",
161
161
  Ur[b],
162
- qr[i],
162
+ qr[c],
163
163
  {
164
164
  "is-loading": u,
165
165
  "btn-icon-only": $
@@ -171,14 +171,14 @@ const Ur = {
171
171
  {
172
172
  "data-testid": t,
173
173
  type: s,
174
- className: P,
174
+ className: O,
175
175
  disabled: g,
176
176
  onClick: w,
177
177
  title: r || $ && o || (typeof N == "string" ? N : void 0),
178
178
  "aria-label": o || $ && r || (typeof N == "string" ? N : void 0),
179
179
  ...m,
180
180
  children: u ? /* @__PURE__ */ e(ot, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ l(ee, { children: [
181
- c && /* @__PURE__ */ e(c, { size: b === "large" ? 20 : 16 }),
181
+ i && /* @__PURE__ */ e(i, { size: b === "large" ? 20 : 16 }),
182
182
  N,
183
183
  a,
184
184
  " "
@@ -215,8 +215,8 @@ const Ur = {
215
215
  className: o,
216
216
  ref: n,
217
217
  checked: u,
218
- onChange: i,
219
- ...c
218
+ onChange: c,
219
+ ...i
220
220
  }) => {
221
221
  const y = Qe(), b = r || y;
222
222
  return /* @__PURE__ */ l("div", { className: `checkbox-container ${o || ""}`, children: [
@@ -229,8 +229,8 @@ const Ur = {
229
229
  ref: n,
230
230
  className: "checkbox-input",
231
231
  checked: u,
232
- onChange: i,
233
- ...c
232
+ onChange: c,
233
+ ...i
234
234
  }
235
235
  ),
236
236
  /* @__PURE__ */ e(
@@ -255,14 +255,14 @@ const Ur = {
255
255
  placeholder: o = "Select a date",
256
256
  label: n,
257
257
  error: u,
258
- disabled: i = !1,
259
- className: c,
258
+ disabled: c = !1,
259
+ className: i,
260
260
  ...y
261
261
  }) => {
262
262
  const b = (N) => {
263
263
  N.stopPropagation(), N.preventDefault(), s?.();
264
264
  };
265
- return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper", c), children: [
265
+ return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper", i), children: [
266
266
  n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "datepicker-input", children: n }),
267
267
  /* @__PURE__ */ l(Ea, { children: [
268
268
  /* @__PURE__ */ e(Ra, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
@@ -273,9 +273,9 @@ const Ur = {
273
273
  type: "button",
274
274
  className: W("datepicker-trigger", {
275
275
  "datepicker-trigger--error": !!u,
276
- "datepicker-trigger--disabled": i
276
+ "datepicker-trigger--disabled": c
277
277
  }),
278
- disabled: i,
278
+ disabled: c,
279
279
  "aria-label": t ? `Selected date is ${Be(t, "PPP")}` : o,
280
280
  children: [
281
281
  /* @__PURE__ */ e(pa, { className: "datepicker-icon" }),
@@ -283,7 +283,7 @@ const Ur = {
283
283
  ]
284
284
  }
285
285
  ),
286
- t && s && !i && /* @__PURE__ */ e(
286
+ t && s && !c && /* @__PURE__ */ e(
287
287
  "button",
288
288
  {
289
289
  type: "button",
@@ -301,7 +301,7 @@ const Ur = {
301
301
  selected: t,
302
302
  onSelect: r,
303
303
  initialFocus: !0,
304
- disabled: i,
304
+ disabled: c,
305
305
  ...y
306
306
  }
307
307
  ) })
@@ -315,8 +315,8 @@ const Ur = {
315
315
  placeholder: o = "Select a date range",
316
316
  label: n,
317
317
  error: u,
318
- disabled: i = !1,
319
- className: c,
318
+ disabled: c = !1,
319
+ className: i,
320
320
  ...y
321
321
  }) => {
322
322
  const b = t?.from, N = t?.to, a = (m) => {
@@ -326,7 +326,7 @@ const Ur = {
326
326
  " - ",
327
327
  Be(N, "MMM d, y")
328
328
  ] }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o });
329
- return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper", c), children: [
329
+ return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper", i), children: [
330
330
  n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "daterangepicker-input", children: n }),
331
331
  /* @__PURE__ */ l(Ea, { children: [
332
332
  /* @__PURE__ */ e(Ra, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
@@ -337,9 +337,9 @@ const Ur = {
337
337
  type: "button",
338
338
  className: W("datepicker-trigger", {
339
339
  "datepicker-trigger--error": !!u,
340
- "datepicker-trigger--disabled": i
340
+ "datepicker-trigger--disabled": c
341
341
  }),
342
- disabled: i,
342
+ disabled: c,
343
343
  "aria-label": b && N ? `Selected range is ${w}` : o,
344
344
  children: [
345
345
  /* @__PURE__ */ e(pa, { className: "datepicker-icon" }),
@@ -347,7 +347,7 @@ const Ur = {
347
347
  ]
348
348
  }
349
349
  ),
350
- b && s && !i && /* @__PURE__ */ e(
350
+ b && s && !c && /* @__PURE__ */ e(
351
351
  "button",
352
352
  {
353
353
  type: "button",
@@ -366,7 +366,7 @@ const Ur = {
366
366
  onSelect: r,
367
367
  numberOfMonths: 2,
368
368
  initialFocus: !0,
369
- disabled: i,
369
+ disabled: c,
370
370
  ...y
371
371
  }
372
372
  ) })
@@ -591,7 +591,7 @@ const Ur = {
591
591
  }, sa = ({ extension: t, size: r = 36 }) => {
592
592
  const s = (t || "").toLowerCase(), o = _r[s];
593
593
  return o ? /* @__PURE__ */ e("div", { style: { width: r }, className: "flex-shrink-0", children: /* @__PURE__ */ e(
594
- it,
594
+ ct,
595
595
  {
596
596
  extension: s,
597
597
  ...o,
@@ -607,7 +607,7 @@ const Ur = {
607
607
  {
608
608
  style: { width: r, height: r },
609
609
  className: "flex items-center justify-center bg-gray-100 rounded-sm border border-gray-300",
610
- children: /* @__PURE__ */ e(ct, { className: "text-gray-400", size: r * 0.75 })
610
+ children: /* @__PURE__ */ e(it, { className: "text-gray-400", size: r * 0.75 })
611
611
  }
612
612
  );
613
613
  }, la = (t, r = 2) => {
@@ -624,8 +624,8 @@ const Ur = {
624
624
  isDragActive: n,
625
625
  open: u,
626
626
  // --- Form and File State ---
627
- validFiles: i = [],
628
- rejectedFiles: c = [],
627
+ validFiles: c = [],
628
+ rejectedFiles: i = [],
629
629
  handleRemoveValidFile: y,
630
630
  handleRemoveRejectedFile: b,
631
631
  handleSubmit: N,
@@ -635,7 +635,7 @@ const Ur = {
635
635
  title: m = "Upload Files",
636
636
  subHeading: g = "Supports PNG, JPG, PDF. Max size: 50MB."
637
637
  }) => {
638
- const $ = i.length > 0 || c.length > 0;
638
+ const $ = c.length > 0 || i.length > 0;
639
639
  return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(
640
640
  me,
641
641
  {
@@ -671,7 +671,7 @@ const Ur = {
671
671
  ke,
672
672
  {
673
673
  className: "dialog-panel",
674
- onClick: (P) => P.stopPropagation(),
674
+ onClick: (O) => O.stopPropagation(),
675
675
  children: [
676
676
  /* @__PURE__ */ e("input", { ...o() }),
677
677
  /* @__PURE__ */ l("form", { onSubmit: N, className: "form-wrapper", children: [
@@ -714,7 +714,7 @@ const Ur = {
714
714
  $ && /* @__PURE__ */ l("div", { className: "file-list-container", children: [
715
715
  /* @__PURE__ */ e("h3", { children: "Upload Queue" }),
716
716
  /* @__PURE__ */ l("ul", { className: "file-list", children: [
717
- i.map((P, E) => /* @__PURE__ */ l(
717
+ c.map((O, R) => /* @__PURE__ */ l(
718
718
  "li",
719
719
  {
720
720
  className: "file-item",
@@ -723,28 +723,28 @@ const Ur = {
723
723
  /* @__PURE__ */ e(
724
724
  sa,
725
725
  {
726
- extension: P.name.split(".").pop()
726
+ extension: O.name.split(".").pop()
727
727
  }
728
728
  ),
729
729
  /* @__PURE__ */ l("div", { children: [
730
- /* @__PURE__ */ e("p", { className: "file-item-name", children: P.name }),
731
- /* @__PURE__ */ e("p", { className: "file-item-size", children: la(P.size) })
730
+ /* @__PURE__ */ e("p", { className: "file-item-name", children: O.name }),
731
+ /* @__PURE__ */ e("p", { className: "file-item-size", children: la(O.size) })
732
732
  ] })
733
733
  ] }),
734
734
  /* @__PURE__ */ e(
735
735
  "button",
736
736
  {
737
737
  type: "button",
738
- onClick: () => y(E),
738
+ onClick: () => y(R),
739
739
  className: "remove-file-button",
740
740
  children: /* @__PURE__ */ e(Pe, { size: 16 })
741
741
  }
742
742
  )
743
743
  ]
744
744
  },
745
- `${P.name}-${E}`
745
+ `${O.name}-${R}`
746
746
  )),
747
- c.map(({ file: P, message: E }, S) => /* @__PURE__ */ l(
747
+ i.map(({ file: O, message: R }, S) => /* @__PURE__ */ l(
748
748
  "li",
749
749
  {
750
750
  className: "file-item file-item--rejected",
@@ -753,13 +753,13 @@ const Ur = {
753
753
  /* @__PURE__ */ e(
754
754
  sa,
755
755
  {
756
- extension: P.name.split(".").pop()
756
+ extension: O.name.split(".").pop()
757
757
  }
758
758
  ),
759
759
  /* @__PURE__ */ l("div", { children: [
760
- /* @__PURE__ */ e("p", { className: "file-item-name", children: P.name }),
761
- /* @__PURE__ */ e("p", { className: "file-item-size", children: la(P.size) }),
762
- /* @__PURE__ */ e("p", { className: "rejection-reason", children: E })
760
+ /* @__PURE__ */ e("p", { className: "file-item-name", children: O.name }),
761
+ /* @__PURE__ */ e("p", { className: "file-item-size", children: la(O.size) }),
762
+ /* @__PURE__ */ e("p", { className: "rejection-reason", children: R })
763
763
  ] })
764
764
  ] }),
765
765
  /* @__PURE__ */ e(
@@ -773,7 +773,7 @@ const Ur = {
773
773
  )
774
774
  ]
775
775
  },
776
- `${P.name}-${S}`
776
+ `${O.name}-${S}`
777
777
  ))
778
778
  ] })
779
779
  ] })
@@ -794,7 +794,7 @@ const Ur = {
794
794
  type: "submit",
795
795
  label: a ? "Uploading..." : "Upload Files",
796
796
  loader: a,
797
- disabled: i.length === 0 || a
797
+ disabled: c.length === 0 || a
798
798
  }
799
799
  )
800
800
  ] })
@@ -814,10 +814,10 @@ const Ur = {
814
814
  resetFilters: o,
815
815
  filterConfig: n = [],
816
816
  initialFormikValues: u,
817
- fetchCreatedOrUpdatedByUsers: i = async () => []
817
+ fetchCreatedOrUpdatedByUsers: c = async () => []
818
818
  // Mockable fetcher
819
819
  }) => {
820
- const [c, y] = L({
820
+ const [i, y] = L({
821
821
  createdBy: [],
822
822
  updatedBy: []
823
823
  }), [b, N] = L({
@@ -827,53 +827,53 @@ const Ur = {
827
827
  initialValues: JSON.parse(JSON.stringify(u)),
828
828
  // Deep copy
829
829
  onSubmit: (S) => {
830
- const I = {};
831
- Object.keys(S).forEach((z) => {
832
- I[z] = {
833
- operator: S[z].operator || "in",
834
- values: Array.isArray(S[z].values) ? S[z].values : [],
835
- range: S[z].range || null
830
+ const B = {};
831
+ Object.keys(S).forEach((P) => {
832
+ B[P] = {
833
+ operator: S[P].operator || "in",
834
+ values: Array.isArray(S[P].values) ? S[P].values : [],
835
+ range: S[P].range || null
836
836
  };
837
- }), console.log("[storybook filter] Applied Filters:", I), typeof s == "function" && s({
838
- filters: I,
837
+ }), console.log("[storybook filter] Applied Filters:", B), typeof s == "function" && s({
838
+ filters: B,
839
839
  activeCount: m
840
840
  }), r();
841
841
  },
842
842
  enableReinitialize: !0
843
- }), w = ne(() => n.reduce((S, I) => {
844
- const z = I.key, A = a.values[z];
845
- let M = !1;
846
- if (A)
847
- switch (I.type) {
843
+ }), w = ne(() => n.reduce((S, B) => {
844
+ const P = B.key, E = a.values[P];
845
+ let V = !1;
846
+ if (E)
847
+ switch (B.type) {
848
848
  case "multiselect":
849
849
  case "multiselect-users":
850
- M = Array.isArray(A.values) && A.values.length > 0;
850
+ V = Array.isArray(E.values) && E.values.length > 0;
851
851
  break;
852
852
  case "date":
853
- (A.range && A.range !== "" || Array.isArray(A.values) && A.values.length > 0) && (M = !0);
853
+ (E.range && E.range !== "" || Array.isArray(E.values) && E.values.length > 0) && (V = !0);
854
854
  break;
855
855
  }
856
- return S[z] = M, S;
857
- }, {}), [n, a.values]), m = Object.values(w).filter(Boolean).length, g = async (S, I) => {
856
+ return S[P] = V, S;
857
+ }, {}), [n, a.values]), m = Object.values(w).filter(Boolean).length, g = async (S, B) => {
858
858
  try {
859
- N((A) => ({ ...A, [S]: !0 }));
860
- const z = await i(S, I);
861
- y((A) => ({ ...A, [S]: z }));
862
- } catch (z) {
863
- console.error(`Error fetching ${S} users:`, z);
859
+ N((E) => ({ ...E, [S]: !0 }));
860
+ const P = await c(S, B);
861
+ y((E) => ({ ...E, [S]: P }));
862
+ } catch (P) {
863
+ console.error(`Error fetching ${S} users:`, P);
864
864
  } finally {
865
- N((z) => ({ ...z, [S]: !1 }));
865
+ N((P) => ({ ...P, [S]: !1 }));
866
866
  }
867
867
  }, $ = (S) => {
868
- const I = n[S].key, z = n[S].url;
869
- n[S].type === "multiselect-users" && c[I].length === 0 && !b[I] && g(I, z);
870
- }, P = () => {
868
+ const B = n[S].key, P = n[S].url;
869
+ n[S].type === "multiselect-users" && i[B].length === 0 && !b[B] && g(B, P);
870
+ }, O = () => {
871
871
  a.resetForm(), y({ createdBy: [], updatedBy: [] }), o();
872
- }, E = (S) => {
873
- const I = n.find((M) => M.key === S);
874
- if (!I) return null;
875
- const z = a.values[S] || u[S], A = Array.isArray(z.values) ? z.values : [];
876
- switch (I.type) {
872
+ }, R = (S) => {
873
+ const B = n.find((V) => V.key === S);
874
+ if (!B) return null;
875
+ const P = a.values[S] || u[S], E = Array.isArray(P.values) ? P.values : [];
876
+ switch (B.type) {
877
877
  case "multiselect":
878
878
  return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
879
879
  /* @__PURE__ */ l("div", { className: "filter-operator-group", children: [
@@ -881,10 +881,10 @@ const Ur = {
881
881
  /* @__PURE__ */ e(
882
882
  "select",
883
883
  {
884
- value: z.operator || "in",
884
+ value: P.operator || "in",
885
885
  onChange: (d) => a.setFieldValue(`${S}.operator`, d.target.value),
886
886
  className: "filter-select",
887
- children: I.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Includes" : "Excludes" }, d))
887
+ children: B.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Includes" : "Excludes" }, d))
888
888
  }
889
889
  )
890
890
  ] }),
@@ -896,9 +896,9 @@ const Ur = {
896
896
  type: "checkbox",
897
897
  id: `select-all-${S}`,
898
898
  className: "filter-checkbox-input",
899
- checked: I.options.length > 0 && A.length === I.options.length,
899
+ checked: B.options.length > 0 && E.length === B.options.length,
900
900
  onChange: (d) => {
901
- const h = d.target.checked ? I.options.map((x) => x.value) : [];
901
+ const h = d.target.checked ? B.options.map((x) => x.value) : [];
902
902
  a.setFieldValue(`${S}.values`, h);
903
903
  }
904
904
  }
@@ -912,16 +912,16 @@ const Ur = {
912
912
  }
913
913
  )
914
914
  ] }),
915
- I.options.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
915
+ B.options.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
916
916
  /* @__PURE__ */ e(
917
917
  "input",
918
918
  {
919
919
  type: "checkbox",
920
920
  id: `${S}-${d.value}`,
921
921
  className: "filter-checkbox-input",
922
- checked: A.includes(d.value),
922
+ checked: E.includes(d.value),
923
923
  onChange: (h) => {
924
- const x = h.target.checked ? [...A, d.value] : A.filter((D) => D !== d.value);
924
+ const x = h.target.checked ? [...E, d.value] : E.filter((F) => F !== d.value);
925
925
  a.setFieldValue(`${S}.values`, x);
926
926
  }
927
927
  }
@@ -938,21 +938,21 @@ const Ur = {
938
938
  ] })
939
939
  ] });
940
940
  case "multiselect-users":
941
- const M = c[S] || [], U = b[S];
941
+ const V = i[S] || [], U = b[S];
942
942
  return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
943
943
  /* @__PURE__ */ l("div", { className: "filter-operator-group", children: [
944
944
  /* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
945
945
  /* @__PURE__ */ e(
946
946
  "select",
947
947
  {
948
- value: z.operator || "in",
948
+ value: P.operator || "in",
949
949
  onChange: (d) => a.setFieldValue(`${S}.operator`, d.target.value),
950
950
  className: "filter-select",
951
- children: I.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Includes" : "Excludes" }, d))
951
+ children: B.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Includes" : "Excludes" }, d))
952
952
  }
953
953
  )
954
954
  ] }),
955
- U ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: M.length > 0 ? /* @__PURE__ */ l(ee, { children: [
955
+ U ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: V.length > 0 ? /* @__PURE__ */ l(ee, { children: [
956
956
  /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
957
957
  /* @__PURE__ */ e(
958
958
  "input",
@@ -960,9 +960,9 @@ const Ur = {
960
960
  type: "checkbox",
961
961
  id: `select-all-users-${S}`,
962
962
  className: "filter-checkbox-input",
963
- checked: M.length > 0 && A.length === M.length,
963
+ checked: V.length > 0 && E.length === V.length,
964
964
  onChange: (d) => {
965
- const h = d.target.checked ? M.map((x) => x.email) : [];
965
+ const h = d.target.checked ? V.map((x) => x.email) : [];
966
966
  a.setFieldValue(
967
967
  `${S}.values`,
968
968
  h
@@ -979,16 +979,16 @@ const Ur = {
979
979
  }
980
980
  )
981
981
  ] }),
982
- M.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
982
+ V.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
983
983
  /* @__PURE__ */ e(
984
984
  "input",
985
985
  {
986
986
  type: "checkbox",
987
987
  id: `${S}-${d.email}`,
988
988
  className: "filter-checkbox-input",
989
- checked: A.includes(d.email),
989
+ checked: E.includes(d.email),
990
990
  onChange: (h) => {
991
- const x = h.target.checked ? [...A, d.email] : A.filter((D) => D !== d.email);
991
+ const x = h.target.checked ? [...E, d.email] : E.filter((F) => F !== d.email);
992
992
  a.setFieldValue(
993
993
  `${S}.values`,
994
994
  x
@@ -1011,7 +1011,7 @@ const Ur = {
1011
1011
  ] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
1012
1012
  ] });
1013
1013
  case "date":
1014
- const q = z.values || [], [v, p] = q, f = v && p, k = {
1014
+ const j = P.values || [], [v, p] = j, f = v && p, k = {
1015
1015
  startDate: v instanceof Date ? v : /* @__PURE__ */ new Date(),
1016
1016
  // Fallback to today
1017
1017
  endDate: p instanceof Date ? p : /* @__PURE__ */ new Date(),
@@ -1024,10 +1024,10 @@ const Ur = {
1024
1024
  /* @__PURE__ */ e(
1025
1025
  "select",
1026
1026
  {
1027
- value: z.operator,
1027
+ value: P.operator,
1028
1028
  onChange: (d) => a.setFieldValue(`${S}.operator`, d.target.value),
1029
1029
  className: "filter-select",
1030
- children: I.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Is" : "Is not" }, d))
1030
+ children: B.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Is" : "Is not" }, d))
1031
1031
  }
1032
1032
  ),
1033
1033
  f && /* @__PURE__ */ e(
@@ -1099,7 +1099,7 @@ const Ur = {
1099
1099
  "button",
1100
1100
  {
1101
1101
  type: "button",
1102
- onClick: P,
1102
+ onClick: O,
1103
1103
  className: "filter-clear-button",
1104
1104
  children: "Clear All Filters"
1105
1105
  }
@@ -1137,7 +1137,7 @@ const Ur = {
1137
1137
  animate: { opacity: 1, x: 0 },
1138
1138
  transition: { duration: 0.3 },
1139
1139
  className: "h-full",
1140
- children: E(S.key)
1140
+ children: R(S.key)
1141
1141
  },
1142
1142
  S.key
1143
1143
  )
@@ -1183,11 +1183,11 @@ const Ur = {
1183
1183
  icon: o,
1184
1184
  error: n,
1185
1185
  className: u,
1186
- ref: i,
1186
+ ref: c,
1187
1187
  // ✅ 'ref' is now received directly as a prop
1188
- ...c
1188
+ ...i
1189
1189
  }) => {
1190
- const y = r || c.name;
1190
+ const y = r || i.name;
1191
1191
  return /* @__PURE__ */ l("div", { className: `input-wrapper ${u || ""}`, children: [
1192
1192
  t && /* @__PURE__ */ e("label", { htmlFor: y, className: "input-label", children: t }),
1193
1193
  /* @__PURE__ */ l("div", { className: "input-field-container", children: [
@@ -1197,12 +1197,12 @@ const Ur = {
1197
1197
  {
1198
1198
  id: y,
1199
1199
  type: s,
1200
- ref: i,
1200
+ ref: c,
1201
1201
  className: W("input-field", {
1202
1202
  "input-field--error": !!n,
1203
1203
  "input-field--with-icon": !!o
1204
1204
  }),
1205
- ...c
1205
+ ...i
1206
1206
  }
1207
1207
  )
1208
1208
  ] }),
@@ -1234,12 +1234,12 @@ const Ur = {
1234
1234
  // For the description/body content
1235
1235
  primaryButtonText: n = "Confirm",
1236
1236
  secondaryButtonText: u = "Cancel",
1237
- variant: i = "info",
1237
+ variant: c = "info",
1238
1238
  // 'info', 'warning', 'delete'
1239
- loading: c = !1,
1239
+ loading: i = !1,
1240
1240
  buttonProps: y = {}
1241
1241
  }) => {
1242
- const b = oa[i] || oa.info, N = b.icon, a = () => {
1242
+ const b = oa[c] || oa.info, N = b.icon, a = () => {
1243
1243
  r({ primary: !0, secondary: !1 });
1244
1244
  }, w = () => {
1245
1245
  r({ primary: !1, secondary: !0 });
@@ -1306,14 +1306,14 @@ const Ur = {
1306
1306
  onItemsPerPageChange: n,
1307
1307
  itemsPerPageOptions: u = [10, 15, 20]
1308
1308
  }) => {
1309
- const i = Math.ceil(r / s), [c, y] = L(t);
1309
+ const c = Math.ceil(r / s), [i, y] = L(t);
1310
1310
  Q(() => {
1311
1311
  y(t);
1312
1312
  }, [t]);
1313
1313
  const b = Math.min((t - 1) * s + 1, r), N = Math.min(t * s, r), a = (w) => {
1314
1314
  w.preventDefault();
1315
- let m = parseInt(c, 10);
1316
- isNaN(m) || m < 1 ? m = 1 : m > i && (m = i), y(m), m !== t && o(m);
1315
+ let m = parseInt(i, 10);
1316
+ isNaN(m) || m < 1 ? m = 1 : m > c && (m = c), y(m), m !== t && o(m);
1317
1317
  };
1318
1318
  return /* @__PURE__ */ l("div", { className: "pagination-container", children: [
1319
1319
  /* @__PURE__ */ l("div", { className: "pagination-left", children: [
@@ -1363,7 +1363,7 @@ const Ur = {
1363
1363
  {
1364
1364
  type: "number",
1365
1365
  className: "page-input",
1366
- value: c,
1366
+ value: i,
1367
1367
  onChange: (w) => y(w.target.value),
1368
1368
  onBlur: a,
1369
1369
  "aria-label": `Current page, Page ${t}`
@@ -1371,7 +1371,7 @@ const Ur = {
1371
1371
  ),
1372
1372
  /* @__PURE__ */ l("span", { className: "page-input-total", children: [
1373
1373
  "of ",
1374
- i
1374
+ c
1375
1375
  ] })
1376
1376
  ] }),
1377
1377
  /* @__PURE__ */ e(
@@ -1379,7 +1379,7 @@ const Ur = {
1379
1379
  {
1380
1380
  className: "pagination-button",
1381
1381
  onClick: () => o(t + 1),
1382
- disabled: t === i,
1382
+ disabled: t === c,
1383
1383
  children: /* @__PURE__ */ e(Le, { size: 16 })
1384
1384
  }
1385
1385
  ),
@@ -1387,8 +1387,8 @@ const Ur = {
1387
1387
  "button",
1388
1388
  {
1389
1389
  className: "pagination-button",
1390
- onClick: () => o(i),
1391
- disabled: t === i,
1390
+ onClick: () => o(c),
1391
+ disabled: t === c,
1392
1392
  children: /* @__PURE__ */ e(ft, { size: 16 })
1393
1393
  }
1394
1394
  )
@@ -1411,31 +1411,31 @@ const Ur = {
1411
1411
  onChange: s,
1412
1412
  className: "radiogroup-container",
1413
1413
  ...u,
1414
- children: o.map((i) => /* @__PURE__ */ e(
1414
+ children: o.map((c) => /* @__PURE__ */ e(
1415
1415
  Te.Option,
1416
1416
  {
1417
- value: i.value,
1418
- className: ({ active: c, checked: y }) => W("radiogroup-option", {
1419
- "radiogroup-option--active": c,
1417
+ value: c.value,
1418
+ className: ({ active: i, checked: y }) => W("radiogroup-option", {
1419
+ "radiogroup-option--active": i,
1420
1420
  "radiogroup-option--checked": y,
1421
1421
  "radiogroup-option--error": !!n
1422
1422
  }),
1423
- children: ({ checked: c }) => /* @__PURE__ */ l(ee, { children: [
1423
+ children: ({ checked: i }) => /* @__PURE__ */ l(ee, { children: [
1424
1424
  /* @__PURE__ */ l("div", { className: "radiogroup-option-content", children: [
1425
- /* @__PURE__ */ e(Te.Label, { as: "p", className: "option-label", children: i.label }),
1426
- i.description && /* @__PURE__ */ e(
1425
+ /* @__PURE__ */ e(Te.Label, { as: "p", className: "option-label", children: c.label }),
1426
+ c.description && /* @__PURE__ */ e(
1427
1427
  Te.Description,
1428
1428
  {
1429
1429
  as: "span",
1430
1430
  className: "option-description",
1431
- children: i.description
1431
+ children: c.description
1432
1432
  }
1433
1433
  )
1434
1434
  ] }),
1435
- c && /* @__PURE__ */ e("div", { className: "option-checkmark", children: /* @__PURE__ */ e(bt, { size: 20 }) })
1435
+ i && /* @__PURE__ */ e("div", { className: "option-checkmark", children: /* @__PURE__ */ e(bt, { size: 20 }) })
1436
1436
  ] })
1437
1437
  },
1438
- i.value
1438
+ c.value
1439
1439
  ))
1440
1440
  }
1441
1441
  ),
@@ -1448,9 +1448,9 @@ const Ur = {
1448
1448
  label: n = "Search",
1449
1449
  // Added a default label for accessibility
1450
1450
  customClass: u = "",
1451
- ...i
1451
+ ...c
1452
1452
  }) => {
1453
- const [c, y] = L(t);
1453
+ const [i, y] = L(t);
1454
1454
  Q(() => {
1455
1455
  y(t);
1456
1456
  }, [t]);
@@ -1460,9 +1460,9 @@ const Ur = {
1460
1460
  }, s),
1461
1461
  [s, r]
1462
1462
  );
1463
- Q(() => (c !== t && b(c), () => {
1463
+ Q(() => (i !== t && b(i), () => {
1464
1464
  b.cancel();
1465
- }), [c, b, t]);
1465
+ }), [i, b, t]);
1466
1466
  const N = (a) => {
1467
1467
  y(a.target.value);
1468
1468
  };
@@ -1477,9 +1477,9 @@ const Ur = {
1477
1477
  placeholder: o,
1478
1478
  type: "search",
1479
1479
  name: "search",
1480
- value: c,
1480
+ value: i,
1481
1481
  onChange: N,
1482
- ...i
1482
+ ...c
1483
1483
  }
1484
1484
  )
1485
1485
  ] });
@@ -1492,22 +1492,22 @@ const Ur = {
1492
1492
  options: o = [],
1493
1493
  placeholder: n = "Select an option...",
1494
1494
  disabled: u = !1,
1495
- error: i,
1496
- ref: c,
1495
+ error: c,
1496
+ ref: i,
1497
1497
  // From RHF's <Controller>
1498
1498
  showSearch: y = !0
1499
1499
  }) => {
1500
1500
  const [b, N] = L(""), a = b === "" ? o : o.filter(
1501
1501
  (m) => m.label.toLowerCase().includes(b.toLowerCase())
1502
1502
  ), w = o.find((m) => r?.id ? m.id === r.id : m.id === r || m.value === r);
1503
- return /* @__PURE__ */ e(X, { value: r, onChange: s, disabled: u, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref: c, children: [
1503
+ return /* @__PURE__ */ e(X, { value: r, onChange: s, disabled: u, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref: i, children: [
1504
1504
  t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
1505
1505
  /* @__PURE__ */ l("div", { className: "select-button-container", children: [
1506
1506
  /* @__PURE__ */ l(
1507
1507
  sr,
1508
1508
  {
1509
1509
  className: W("select-button", {
1510
- "select-button--error": !!i
1510
+ "select-button--error": !!c
1511
1511
  }),
1512
1512
  children: [
1513
1513
  /* @__PURE__ */ e("span", { className: "select-value-display", children: w ? w.label : /* @__PURE__ */ e("span", { className: "placeholder", children: n }) }),
@@ -1561,7 +1561,7 @@ const Ur = {
1561
1561
  }
1562
1562
  )
1563
1563
  ] }),
1564
- i && /* @__PURE__ */ e("p", { className: "select-error-message", children: i })
1564
+ c && /* @__PURE__ */ e("p", { className: "select-error-message", children: c })
1565
1565
  ] }) });
1566
1566
  }, Wr = () => {
1567
1567
  const [t, r] = L(window.location.pathname);
@@ -1579,12 +1579,12 @@ const Ur = {
1579
1579
  return s;
1580
1580
  return null;
1581
1581
  }, Pa = ({ item: t, isCollapsed: r, level: s = 0 }) => {
1582
- const { pathname: o } = Wr(), n = t.href || t.url || t.path, [u, i] = L(!1), c = t.icon;
1582
+ const { pathname: o } = Wr(), n = t.href || t.url || t.path, [u, c] = L(!1), i = t.icon;
1583
1583
  Q(() => {
1584
- Ke([t], o) && i(!0);
1584
+ Ke([t], o) && c(!0);
1585
1585
  }, [t, o]);
1586
1586
  const y = o === n, b = !y && !!Ke([t], o), N = (a) => {
1587
- a.preventDefault(), i(!u);
1587
+ a.preventDefault(), c(!u);
1588
1588
  };
1589
1589
  return /* @__PURE__ */ l(
1590
1590
  "div",
@@ -1606,7 +1606,7 @@ const Ur = {
1606
1606
  }),
1607
1607
  "aria-current": y ? "page" : void 0,
1608
1608
  children: [
1609
- c && /* @__PURE__ */ e(c, { className: "nav-icon", "aria-hidden": "true" }),
1609
+ i && /* @__PURE__ */ e(i, { className: "nav-icon", "aria-hidden": "true" }),
1610
1610
  /* @__PURE__ */ e("span", { className: "nav-label", children: t.label || t.name }),
1611
1611
  t.children && /* @__PURE__ */ e(
1612
1612
  "button",
@@ -1657,8 +1657,8 @@ const Ur = {
1657
1657
  isMobileOpen: o = !1,
1658
1658
  onToggleMobile: n,
1659
1659
  logoSmall: u,
1660
- logoLarge: i,
1661
- user: c = { name: "", email: "" }
1660
+ logoLarge: c,
1661
+ user: i = { name: "", email: "" }
1662
1662
  }) => /* @__PURE__ */ l(ee, { children: [
1663
1663
  o && /* @__PURE__ */ e(
1664
1664
  "div",
@@ -1678,7 +1678,7 @@ const Ur = {
1678
1678
  "aria-label": "Main navigation",
1679
1679
  children: [
1680
1680
  /* @__PURE__ */ l("div", { className: "sidebar-header", children: [
1681
- /* @__PURE__ */ e("div", { className: "sidebar-logo", children: r ? u : i }),
1681
+ /* @__PURE__ */ e("div", { className: "sidebar-logo", children: r ? u : c }),
1682
1682
  !r && /* @__PURE__ */ l("div", { className: "sidebar-search-container", children: [
1683
1683
  /* @__PURE__ */ e(ya, { className: "sidebar-search-icon" }),
1684
1684
  /* @__PURE__ */ e(
@@ -1703,10 +1703,10 @@ const Ur = {
1703
1703
  ] }),
1704
1704
  /* @__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)) }) }),
1705
1705
  /* @__PURE__ */ l("div", { className: "sidebar-footer", children: [
1706
- /* @__PURE__ */ e(Ta, { src: c.avatar, name: c.name, size: "medium" }),
1706
+ /* @__PURE__ */ e(Ta, { src: i.avatar, name: i.name, size: "medium" }),
1707
1707
  /* @__PURE__ */ l("div", { className: "user-info", children: [
1708
- /* @__PURE__ */ e("span", { className: "user-name", children: c.name }),
1709
- /* @__PURE__ */ e("span", { className: "user-email", children: c.email })
1708
+ /* @__PURE__ */ e("span", { className: "user-name", children: i.name }),
1709
+ /* @__PURE__ */ e("span", { className: "user-email", children: i.email })
1710
1710
  ] }),
1711
1711
  /* @__PURE__ */ e(
1712
1712
  "button",
@@ -1765,19 +1765,19 @@ const Ur = {
1765
1765
  ref: n,
1766
1766
  maxLength: u,
1767
1767
  // ✅ New prop for max length
1768
- showCharCount: i = !1,
1768
+ showCharCount: c = !1,
1769
1769
  // ✅ New prop to control visibility
1770
- ...c
1770
+ ...i
1771
1771
  }) => {
1772
- const y = r || c.name, [b, N] = L(
1773
- c.value?.length || c.defaultValue?.length || 0
1772
+ const y = r || i.name, [b, N] = L(
1773
+ i.value?.length || i.defaultValue?.length || 0
1774
1774
  ), a = (m) => {
1775
- N(m.target.value.length), c.onChange && c.onChange(m);
1775
+ N(m.target.value.length), i.onChange && i.onChange(m);
1776
1776
  }, w = u - b;
1777
1777
  return /* @__PURE__ */ l("div", { className: `textarea-wrapper ${o || ""}`, children: [
1778
1778
  /* @__PURE__ */ l("div", { className: "textarea-header", children: [
1779
1779
  t && /* @__PURE__ */ e("label", { htmlFor: y, className: "textarea-label", children: t }),
1780
- i && u && /* @__PURE__ */ l("span", { className: "char-counter", children: [
1780
+ c && u && /* @__PURE__ */ l("span", { className: "char-counter", children: [
1781
1781
  w,
1782
1782
  " characters remaining"
1783
1783
  ] })
@@ -1792,7 +1792,7 @@ const Ur = {
1792
1792
  }),
1793
1793
  maxLength: u,
1794
1794
  onChange: a,
1795
- ...c
1795
+ ...i
1796
1796
  }
1797
1797
  ),
1798
1798
  s && /* @__PURE__ */ e("p", { className: "textarea-error-message", children: s })
@@ -1805,7 +1805,7 @@ const Ur = {
1805
1805
  error: n,
1806
1806
  ...u
1807
1807
  }) => /* @__PURE__ */ l("div", { className: "switch-container", children: [
1808
- /* @__PURE__ */ l(ir, { as: "div", className: "switch-group", children: [
1808
+ /* @__PURE__ */ l(cr, { as: "div", className: "switch-group", children: [
1809
1809
  t && o === "left" && /* @__PURE__ */ e(Ye.Label, { className: "switch-label", passive: !0, children: t }),
1810
1810
  /* @__PURE__ */ e(
1811
1811
  Ye,
@@ -1834,20 +1834,20 @@ const Ur = {
1834
1834
  // 'top', 'bottom', 'left', 'right'
1835
1835
  className: u,
1836
1836
  // For external styling of the tooltip itself
1837
- ...i
1837
+ ...c
1838
1838
  }) => {
1839
- const c = re.useId();
1839
+ const i = re.useId();
1840
1840
  return /* @__PURE__ */ l(ee, { children: [
1841
- re.cloneElement(t, { "data-tooltip-id": c }),
1841
+ re.cloneElement(t, { "data-tooltip-id": i }),
1842
1842
  /* @__PURE__ */ e(
1843
1843
  xt,
1844
1844
  {
1845
- id: c,
1845
+ id: i,
1846
1846
  content: r,
1847
1847
  place: n,
1848
1848
  variant: s,
1849
1849
  className: `custom-tooltip custom-tooltip--size-${o} ${u || ""}`,
1850
- ...i
1850
+ ...c
1851
1851
  }
1852
1852
  )
1853
1853
  ] });
@@ -1871,8 +1871,8 @@ const Ur = {
1871
1871
  currentStep: o,
1872
1872
  direction: n = 1,
1873
1873
  stepProps: u = {},
1874
- title: i,
1875
- description: c,
1874
+ title: c,
1875
+ description: i,
1876
1876
  showProgress: y = !0,
1877
1877
  closeOnOverlayClick: b = !0
1878
1878
  }) => {
@@ -1921,8 +1921,8 @@ const Ur = {
1921
1921
  }
1922
1922
  ),
1923
1923
  /* @__PURE__ */ l("div", { className: "wizard-header-text", children: [
1924
- /* @__PURE__ */ e(me.Title, { as: "h3", className: "wizard-title", children: i }),
1925
- c && /* @__PURE__ */ e(me.Description, { className: "wizard-description", children: c })
1924
+ /* @__PURE__ */ e(me.Title, { as: "h3", className: "wizard-title", children: c }),
1925
+ i && /* @__PURE__ */ e(me.Description, { className: "wizard-description", children: i })
1926
1926
  ] })
1927
1927
  ] }),
1928
1928
  /* @__PURE__ */ e(
@@ -1982,19 +1982,19 @@ const Ur = {
1982
1982
  save: o,
1983
1983
  cancel: n,
1984
1984
  tertiary: u,
1985
- fullHeight: i = !1,
1985
+ fullHeight: c = !1,
1986
1986
  // A clearer prop name
1987
- ...c
1987
+ ...i
1988
1988
  }) => {
1989
1989
  const y = W(
1990
1990
  "page-layout",
1991
1991
  {
1992
1992
  "page-layout--with-footer": r,
1993
- "page-layout--full-height": i
1993
+ "page-layout--full-height": c
1994
1994
  },
1995
- c.className
1995
+ i.className
1996
1996
  );
1997
- return /* @__PURE__ */ l("div", { className: y, ...c, children: [
1997
+ return /* @__PURE__ */ l("div", { className: y, ...i, children: [
1998
1998
  /* @__PURE__ */ e("div", { className: "page-layout-content", children: t }),
1999
1999
  r && /* @__PURE__ */ e("footer", { className: "page-layout-footer", children: s || /* @__PURE__ */ l("div", { className: "footer-actions", children: [
2000
2000
  u?.show && /* @__PURE__ */ e(
@@ -2052,10 +2052,10 @@ const Ur = {
2052
2052
  triggerIcon: s = Ct
2053
2053
  }) => {
2054
2054
  const { refs: o, floatingStyles: n } = Ca({
2055
- whileElementsMounted: $a,
2056
- middleware: [Sa(5), Da(), Fa({ padding: 5 })]
2055
+ whileElementsMounted: Fa,
2056
+ middleware: [Sa(5), Da(), $a({ padding: 5 })]
2057
2057
  });
2058
- return /* @__PURE__ */ l(cr, { as: "div", className: "options-menu-wrapper", children: [
2058
+ return /* @__PURE__ */ l(ir, { as: "div", className: "options-menu-wrapper", children: [
2059
2059
  /* @__PURE__ */ e(dr, { ref: o.setReference, className: "options-menu-trigger", children: /* @__PURE__ */ e(s, { size: 20 }) }),
2060
2060
  /* @__PURE__ */ e(ur, { children: /* @__PURE__ */ e(
2061
2061
  oe,
@@ -2075,11 +2075,11 @@ const Ur = {
2075
2075
  className: "options-menu-panel",
2076
2076
  children: t.map((u) => /* @__PURE__ */ l("div", { className: "options-menu-item-wrapper", children: [
2077
2077
  u.dividerBefore && /* @__PURE__ */ e("div", { className: "menu-divider" }),
2078
- /* @__PURE__ */ e(hr, { children: ({ active: i }) => /* @__PURE__ */ l(
2078
+ /* @__PURE__ */ e(hr, { children: ({ active: c }) => /* @__PURE__ */ l(
2079
2079
  "button",
2080
2080
  {
2081
2081
  onClick: () => r(u),
2082
- className: `options-menu-item ${i ? "active bg-gray-200 text-gray-900" : ""}`,
2082
+ className: `options-menu-item ${c ? "active bg-gray-200 text-gray-900" : ""}`,
2083
2083
  disabled: u.disabled,
2084
2084
  children: [
2085
2085
  u.icon && /* @__PURE__ */ e("span", { className: "item-icon", children: u.icon }),
@@ -2235,8 +2235,8 @@ function tn(t) {
2235
2235
  return console.log("Error reading JSON from localStorage"), null;
2236
2236
  }
2237
2237
  }
2238
- function ia() {
2239
- const t = tn("userProfile") || {}, r = localStorage.getItem("access_token") || t.accessToken || "", s = localStorage.getItem("siteId") || t.siteId || "", o = t.tenant || "", n = t.tenantdomain || "", u = t.username || t.displayName || "", i = t.email || "";
2238
+ function ca() {
2239
+ const t = tn("userProfile") || {}, r = localStorage.getItem("access_token") || t.accessToken || "", s = localStorage.getItem("siteId") || t.siteId || "", o = t.tenant || "", n = t.tenantdomain || "", u = t.username || t.displayName || "", c = t.email || "";
2240
2240
  return {
2241
2241
  Authorization: r ? `Bearer ${r}` : void 0,
2242
2242
  "x-tenant-id": o || void 0,
@@ -2244,19 +2244,19 @@ function ia() {
2244
2244
  "site-id": s || void 0,
2245
2245
  "Content-Type": "application/json",
2246
2246
  "principal-user": u || void 0,
2247
- "x-user-email": i || void 0
2247
+ "x-user-email": c || void 0
2248
2248
  };
2249
2249
  }
2250
2250
  function rn(t) {
2251
2251
  if (t && t.isAxiosError) {
2252
- const { response: r, config: s, message: o } = t, n = r?.status ?? null, u = r?.statusText ?? null, i = r?.data ?? null, c = typeof i == "string" && i || i?.message || i?.msg || i?.error || i?.errors?.[0]?.message || null;
2252
+ const { response: r, config: s, message: o } = t, n = r?.status ?? null, u = r?.statusText ?? null, c = r?.data ?? null, i = typeof c == "string" && c || c?.message || c?.msg || c?.error || c?.errors?.[0]?.message || null;
2253
2253
  return {
2254
2254
  ok: !1,
2255
2255
  status: n,
2256
2256
  statusText: u,
2257
- code: i?.code || null,
2258
- message: c || o || "Request failed",
2259
- details: i || null,
2257
+ code: c?.code || null,
2258
+ message: i || o || "Request failed",
2259
+ details: c || null,
2260
2260
  request: {
2261
2261
  url: s?.url || null,
2262
2262
  method: s?.method || null,
@@ -2296,12 +2296,12 @@ function nn({
2296
2296
  );
2297
2297
  function o({ open: b = !1, customHeader: N = {} } = {}) {
2298
2298
  if (b) {
2299
- const { Authorization: a, ...w } = ia();
2299
+ const { Authorization: a, ...w } = ca();
2300
2300
  return {
2301
2301
  headers: { ...w, ...r, ...N }
2302
2302
  };
2303
2303
  }
2304
- return { headers: { ...ia(), ...N } };
2304
+ return { headers: { ...ca(), ...N } };
2305
2305
  }
2306
2306
  async function n(b, N, a = !1, w = {}) {
2307
2307
  return s.get(b, {
@@ -2313,10 +2313,10 @@ function nn({
2313
2313
  const m = { ...o({ open: a, customHeader: w }) };
2314
2314
  return N !== void 0 && (m.data = N), s.delete(b, m);
2315
2315
  }
2316
- async function i(b, N = {}, a = !1, w = {}) {
2316
+ async function c(b, N = {}, a = !1, w = {}) {
2317
2317
  return s.post(b, N, o({ open: a, customHeader: w }));
2318
2318
  }
2319
- async function c(b, N = {}, a = !1, w = {}) {
2319
+ async function i(b, N = {}, a = !1, w = {}) {
2320
2320
  return s.put(b, N, o({ open: a, customHeader: w }));
2321
2321
  }
2322
2322
  async function y(b, N = {}, a = !1, w = {}) {
@@ -2327,12 +2327,12 @@ function nn({
2327
2327
  // exported in case you want advanced usage
2328
2328
  axiosGet: n,
2329
2329
  axiosDelete: u,
2330
- axiosPost: i,
2331
- axiosPut: c,
2330
+ axiosPost: c,
2331
+ axiosPut: i,
2332
2332
  axiosPatch: y
2333
2333
  };
2334
2334
  }
2335
- const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln = we.axiosPut, ls = we.axiosPatch, os = we.instance, on = async (t, r) => {
2335
+ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln = we.axiosPut, ls = we.axiosPatch, os = we.instance, on = async (t, r) => {
2336
2336
  try {
2337
2337
  switch (t) {
2338
2338
  case Ne.USER: {
@@ -2359,7 +2359,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2359
2359
  type: "User",
2360
2360
  avatarUrl: r?.profileImage || Re(n)
2361
2361
  };
2362
- }), ca = (t) => {
2362
+ }), ia = (t) => {
2363
2363
  try {
2364
2364
  const r = JSON.parse(t);
2365
2365
  return Array.isArray(r) ? r : [];
@@ -2368,7 +2368,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2368
2368
  }
2369
2369
  }, Ie = {
2370
2370
  userSearch: async (t) => {
2371
- const { data: r } = await Fe(`${ja()}`, t);
2371
+ const { data: r } = await $e(`${ja()}`, t);
2372
2372
  return console.log("User search response:", r), r.length ? r.map((s) => ({
2373
2373
  id: s.email,
2374
2374
  name: `${s?.firstName} ${s?.lastName}`.trim(),
@@ -2377,7 +2377,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2377
2377
  })) : [];
2378
2378
  },
2379
2379
  getAdGroups: async (t) => {
2380
- const { data: r } = await $e(`${Ga()}`, {
2380
+ const { data: r } = await Fe(`${Ga()}`, {
2381
2381
  q: t
2382
2382
  });
2383
2383
  if (r.length)
@@ -2389,7 +2389,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2389
2389
  }));
2390
2390
  },
2391
2391
  searchRoles: async (t) => {
2392
- const { data: r } = await $e(`${Wa()}`, {
2392
+ const { data: r } = await Fe(`${Wa()}`, {
2393
2393
  page: 0,
2394
2394
  size: 20,
2395
2395
  q: t ?? "",
@@ -2405,15 +2405,15 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2405
2405
  }));
2406
2406
  },
2407
2407
  getMembersForGroup: async (t) => {
2408
- const r = `${be()}/unifydidentity/open/usersforgroup?groupName=${encodeURIComponent(t)}&isGroupWithSpecChar=true&isPaging=true&page=0&size=999&deepSearch=`, { data: s } = await Fe(r);
2408
+ const r = `${be()}/unifydidentity/open/usersforgroup?groupName=${encodeURIComponent(t)}&isGroupWithSpecChar=true&isPaging=true&page=0&size=999&deepSearch=`, { data: s } = await $e(r);
2409
2409
  let o = [];
2410
2410
  if (Array.isArray(s))
2411
2411
  o = s;
2412
2412
  else if (typeof s == "string")
2413
- o = ca(s.trim());
2413
+ o = ia(s.trim());
2414
2414
  else if (s && typeof s == "object") {
2415
2415
  const n = s.data;
2416
- Array.isArray(n) ? o = n : typeof n == "string" && (o = ca(n.trim()));
2416
+ Array.isArray(n) ? o = n : typeof n == "string" && (o = ia(n.trim()));
2417
2417
  }
2418
2418
  return cn(o);
2419
2419
  }
@@ -2439,9 +2439,9 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2439
2439
  }) => {
2440
2440
  const n = t.slice(0, 2), u = [];
2441
2441
  t.length > 0 && u.push(t[0].name), r.length > 0 && u.push(r[0].name), s.length > 0 && u.length < 2 && u.push(s[0].name);
2442
- const i = t.length + r.length + s.length, c = i - u.length;
2442
+ const c = t.length + r.length + s.length, i = c - u.length;
2443
2443
  let y = u.join(", ");
2444
- return c > 0 && (y += ` and ${c} others`), i === 0 ? /* @__PURE__ */ e(
2444
+ return i > 0 && (y += ` and ${i} others`), c === 0 ? /* @__PURE__ */ e(
2445
2445
  "div",
2446
2446
  {
2447
2447
  className: "flex items-center justify-between p-3 border border-dashed border-gray-400 rounded-lg hover:bg-gray-50",
@@ -2471,14 +2471,14 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2471
2471
  }
2472
2472
  );
2473
2473
  }, da = [
2474
- { id: 1, name: Ne.USER, icon: $t, code: "users" },
2474
+ { id: 1, name: Ne.USER, icon: Ft, code: "users" },
2475
2475
  { id: 2, name: Ne.GROUP, icon: va, code: "groups" },
2476
2476
  { id: 3, name: Ne.ROLE, icon: Tt, code: "roles" }
2477
2477
  ], ua = [
2478
2478
  { id: 1, name: na.View, icon: Na },
2479
2479
  { id: 2, name: na.Manage, icon: xa }
2480
2480
  ], un = Dt().shape({
2481
- pendingInvites: Ft().min(1, "You must add at least one person to invite.")
2481
+ pendingInvites: $t().min(1, "You must add at least one person to invite.")
2482
2482
  }), mn = ({
2483
2483
  entity: t,
2484
2484
  onManage: r,
@@ -2486,85 +2486,85 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2486
2486
  existingShares: o = { users: [], groups: [], roles: [] },
2487
2487
  calledBy: n,
2488
2488
  showExistingShares: u = !1,
2489
- onFinalSubmit: i = () => {
2489
+ onFinalSubmit: c = () => {
2490
2490
  },
2491
- isChanged: c = !1
2491
+ isChanged: i = !1
2492
2492
  }) => {
2493
- const [y, b] = L(da[0]), [N, a] = L(""), w = ta(N, 400), [m, g] = L([]), [$, P] = L(/* @__PURE__ */ new Set()), [E, S] = L(!1), [I, z] = L(ua[0]), {
2494
- control: A,
2495
- handleSubmit: M,
2493
+ const [y, b] = L(da[0]), [N, a] = L(""), w = ta(N, 400), [m, g] = L([]), [$, O] = L(/* @__PURE__ */ new Set()), [R, S] = L(!1), [B, P] = L(ua[0]), {
2494
+ control: E,
2495
+ handleSubmit: V,
2496
2496
  watch: U,
2497
- formState: { errors: q, isSubmitting: v }
2497
+ formState: { errors: j, isSubmitting: v }
2498
2498
  } = At({
2499
2499
  defaultValues: { pendingInvites: [] },
2500
2500
  resolver: It(un)
2501
2501
  }), { fields: p, append: f, remove: k, update: d } = Et({
2502
- control: A,
2502
+ control: E,
2503
2503
  name: "pendingInvites"
2504
2504
  }), h = U("pendingInvites");
2505
2505
  Q(() => {
2506
2506
  w.length > 1 ? (S(!0), on(y.name, w).then((T) => {
2507
2507
  g(T);
2508
- }).catch((T) => console.error("Search failed:", T)).finally(() => S(!1))) : (g([]), P(/* @__PURE__ */ new Set()));
2508
+ }).catch((T) => console.error("Search failed:", T)).finally(() => S(!1))) : (g([]), O(/* @__PURE__ */ new Set()));
2509
2509
  }, [w, y]);
2510
2510
  const x = (T) => {
2511
- P((C) => {
2512
- const R = new Set(C);
2513
- return R.has(T) ? R.delete(T) : R.add(T), R;
2511
+ O((C) => {
2512
+ const I = new Set(C);
2513
+ return I.has(T) ? I.delete(T) : I.add(T), I;
2514
2514
  });
2515
- }, D = () => {
2515
+ }, F = () => {
2516
2516
  m.filter((T) => $.has(T.id)).forEach((T) => {
2517
- p.find((C) => C.id === T.id) || f({ ...T, permission: I.name });
2518
- }), P(/* @__PURE__ */ new Set()), a("");
2519
- }, B = (T) => {
2520
- z(T), p.forEach(
2521
- (C, R) => d(R, { ...p[R], permission: T.name })
2517
+ p.find((C) => C.id === T.id) || f({ ...T, permission: B.name });
2518
+ }), O(/* @__PURE__ */ new Set()), a("");
2519
+ }, z = (T) => {
2520
+ P(T), p.forEach(
2521
+ (C, I) => d(I, { ...p[I], permission: T.name })
2522
2522
  );
2523
- }, G = async (T) => {
2523
+ }, q = async (T) => {
2524
2524
  try {
2525
2525
  if (n === se.DRIVE) {
2526
2526
  const C = {
2527
2527
  entity: t,
2528
- userGroupRolesObj: T.pendingInvites.map((R) => ({
2529
- id: R.id,
2530
- permission: R.permission,
2531
- type: R.type.toLowerCase()
2528
+ userGroupRolesObj: T.pendingInvites.map((I) => ({
2529
+ id: I.id,
2530
+ permission: I.permission,
2531
+ type: I.type.toLowerCase()
2532
2532
  }))
2533
2533
  };
2534
- i(C, o);
2534
+ c(C, o);
2535
2535
  } else if (n === se.INTEREST) {
2536
- const C = T.pendingInvites.map((R) => ({
2537
- identity: R.id,
2538
- type: R.type.toLowerCase(),
2536
+ const C = T.pendingInvites.map((I) => ({
2537
+ identity: I.id,
2538
+ type: I.type.toLowerCase(),
2539
2539
  opt: !0,
2540
2540
  lock: !1,
2541
2541
  moderator: !1,
2542
- userName: R.name,
2542
+ userName: I.name,
2543
2543
  interestId: t?.data?.id
2544
2544
  }));
2545
- i(C, o);
2545
+ c(C, o);
2546
2546
  } else if (n === se.ARTICLE) {
2547
2547
  const C = {
2548
2548
  entity: t,
2549
- userGroupRolesObj: T.pendingInvites.map((R) => ({
2550
- id: R.id,
2551
- permission: R.permission,
2552
- type: R.type.toLowerCase()
2549
+ userGroupRolesObj: T.pendingInvites.map((I) => ({
2550
+ id: I.id,
2551
+ permission: I.permission,
2552
+ type: I.type.toLowerCase()
2553
2553
  }))
2554
2554
  };
2555
- i(C, o);
2555
+ c(C, o);
2556
2556
  } else
2557
- i(T, o);
2557
+ c(T, o);
2558
2558
  setTimeout(() => {
2559
2559
  s();
2560
2560
  }, 1e3);
2561
2561
  } catch (C) {
2562
2562
  throw console.error("Failed to submit invites:", C), C;
2563
2563
  }
2564
- }, F = (T) => {
2565
- const C = o[y.code].find((R) => R.name === T.name) || h.find((R) => R.name === T.name);
2564
+ }, D = (T) => {
2565
+ const C = o[y.code].find((I) => I.name === T.name) || h.find((I) => I.name === T.name);
2566
2566
  return C ? `${C.permission}` : "";
2567
- }, O = () => {
2567
+ }, A = () => {
2568
2568
  switch (n) {
2569
2569
  case se.DRIVE:
2570
2570
  return "Share with others";
@@ -2575,10 +2575,10 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2575
2575
  default:
2576
2576
  return "Add User, Groups or Roles test";
2577
2577
  }
2578
- }, V = ne(() => $.size === 0 && !c, [$, c]);
2578
+ }, M = ne(() => $.size === 0 && !i, [$, i]);
2579
2579
  return /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-white", children: [
2580
2580
  /* @__PURE__ */ l("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
2581
- /* @__PURE__ */ e(me.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: O() }),
2581
+ /* @__PURE__ */ e(me.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: A() }),
2582
2582
  /* @__PURE__ */ l("div", { className: "flex items-center gap-4", children: [
2583
2583
  n === se.DRIVE && /* @__PURE__ */ l("button", { className: "flex items-center gap-2 text-sm text-blue-600 hover:text-blue-800 font-semibold hover:cursor-pointer", children: [
2584
2584
  /* @__PURE__ */ e(Rt, { className: "h-5 w-5" }),
@@ -2657,7 +2657,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2657
2657
  value: N
2658
2658
  }
2659
2659
  ) }),
2660
- /* @__PURE__ */ e(fe, { children: (m?.length > 0 || E) && /* @__PURE__ */ e(
2660
+ /* @__PURE__ */ e(fe, { children: (m?.length > 0 || R) && /* @__PURE__ */ e(
2661
2661
  te.div,
2662
2662
  {
2663
2663
  initial: { opacity: 0, y: -10 },
@@ -2665,9 +2665,9 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2665
2665
  exit: { opacity: 0, y: -10 },
2666
2666
  transition: { duration: 0.2 },
2667
2667
  className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
2668
- children: E ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ l(ee, { children: [
2668
+ children: R ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ l(ee, { children: [
2669
2669
  /* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: m.map((T) => {
2670
- const C = F(T);
2670
+ const C = D(T);
2671
2671
  return /* @__PURE__ */ l(
2672
2672
  "div",
2673
2673
  {
@@ -2714,7 +2714,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2714
2714
  /* @__PURE__ */ e(
2715
2715
  "button",
2716
2716
  {
2717
- onClick: D,
2717
+ onClick: F,
2718
2718
  disabled: $.size === 0,
2719
2719
  className: "px-3 py-1 text-sm text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed hover:cursor-pointer",
2720
2720
  children: "Add"
@@ -2741,15 +2741,15 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2741
2741
  n === se.DRIVE && /* @__PURE__ */ e(
2742
2742
  X,
2743
2743
  {
2744
- value: I,
2745
- onChange: B,
2744
+ value: B,
2745
+ onChange: z,
2746
2746
  children: /* @__PURE__ */ l("div", { className: "relative", children: [
2747
2747
  /* @__PURE__ */ l(X.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
2748
2748
  /* @__PURE__ */ l("span", { className: "flex items-center", children: [
2749
- /* @__PURE__ */ e(I.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
2749
+ /* @__PURE__ */ e(B.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
2750
2750
  /* @__PURE__ */ l("span", { className: "truncate", children: [
2751
2751
  "Can ",
2752
- I.name
2752
+ B.name
2753
2753
  ] })
2754
2754
  ] }),
2755
2755
  /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(Xe, { className: "h-5 w-5 text-gray-400" }) })
@@ -2766,7 +2766,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2766
2766
  {
2767
2767
  value: T,
2768
2768
  className: ({ active: C }) => `${C ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
2769
- children: ({ selected: C, active: R }) => /* @__PURE__ */ l(ee, { children: [
2769
+ children: ({ selected: C, active: I }) => /* @__PURE__ */ l(ee, { children: [
2770
2770
  /* @__PURE__ */ l(
2771
2771
  "span",
2772
2772
  {
@@ -2775,7 +2775,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2775
2775
  /* @__PURE__ */ e(
2776
2776
  T.icon,
2777
2777
  {
2778
- className: `h-5 w-5 mr-2 ${R ? "text-white" : "text-gray-400"}`
2778
+ className: `h-5 w-5 mr-2 ${I ? "text-white" : "text-gray-400"}`
2779
2779
  }
2780
2780
  ),
2781
2781
  "Can ",
@@ -2861,8 +2861,8 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2861
2861
  /* @__PURE__ */ e(
2862
2862
  "button",
2863
2863
  {
2864
- onClick: M(G),
2865
- disabled: v || h.length === 0 && V,
2864
+ onClick: V(q),
2865
+ disabled: v || h.length === 0 && M,
2866
2866
  className: "px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md shadow-sm hover:bg-blue-700 hover:cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-blue-300 disabled:cursor-not-allowed",
2867
2867
  children: v ? "Inviting..." : n === se.DRIVE ? "Send Invites" : "Add"
2868
2868
  }
@@ -2875,13 +2875,13 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2875
2875
  { name: "Can manage", icon: xa, value: "edit" },
2876
2876
  { name: "Remove", icon: zt, isDestructive: !0, value: "remove" }
2877
2877
  ], hn = ({ item: t, allowedPermissions: r, onPermissionChange: s }) => {
2878
- const [o, n] = L(!1), { refs: u, floatingStyles: i, context: c } = Ca({
2878
+ const [o, n] = L(!1), { refs: u, floatingStyles: c, context: i } = Ca({
2879
2879
  open: o,
2880
2880
  onOpenChange: n,
2881
- middleware: [Sa(8), Da(), Fa({ padding: 8 })],
2882
- whileElementsMounted: $a,
2881
+ middleware: [Sa(8), Da(), $a({ padding: 8 })],
2882
+ whileElementsMounted: Fa,
2883
2883
  placement: "bottom-end"
2884
- }), y = yr(c), b = fr(c), { getReferenceProps: N, getFloatingProps: a } = br([
2884
+ }), y = yr(i), b = fr(i), { getReferenceProps: N, getFloatingProps: a } = br([
2885
2885
  y,
2886
2886
  b
2887
2887
  ]), w = Je.find((g) => g.name === t.permission || g.value === t.permission) || Je[0];
@@ -2918,7 +2918,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2918
2918
  X.Options,
2919
2919
  {
2920
2920
  ref: u.setFloating,
2921
- style: i,
2921
+ style: c,
2922
2922
  ...a(),
2923
2923
  static: !0,
2924
2924
  className: "z-50 w-48 bg-white shadow-lg rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm",
@@ -2963,28 +2963,28 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2963
2963
  existingShares: n,
2964
2964
  allowedPermissions: u
2965
2965
  }) => {
2966
- const [i, c] = L(n), [y, b] = L(0), [N, a] = L(""), w = ta(N, 300), m = {
2967
- users: i.users.filter(
2968
- (E) => E.name.toLowerCase().includes(w.toLowerCase())
2966
+ const [c, i] = L(n), [y, b] = L(0), [N, a] = L(""), w = ta(N, 300), m = {
2967
+ users: c.users.filter(
2968
+ (R) => R.name.toLowerCase().includes(w.toLowerCase())
2969
2969
  ),
2970
- groups: i.groups.filter(
2971
- (E) => E.name.toLowerCase().includes(w.toLowerCase())
2970
+ groups: c.groups.filter(
2971
+ (R) => R.name.toLowerCase().includes(w.toLowerCase())
2972
2972
  ),
2973
- roles: i.roles.filter(
2974
- (E) => E.name.toLowerCase().includes(w.toLowerCase())
2973
+ roles: c.roles.filter(
2974
+ (R) => R.name.toLowerCase().includes(w.toLowerCase())
2975
2975
  )
2976
- }, g = async (E, S, I, z) => {
2977
- const A = S.value;
2978
- c(A === "Remove" ? (M) => ({
2979
- ...M,
2980
- [I]: M[I].filter((U) => U.id !== E.id)
2981
- }) : (M) => ({
2982
- ...M,
2983
- [I]: M[I].map(
2984
- (U) => U.id === E.id ? { ...U, permission: A } : U
2976
+ }, g = async (R, S, B, P) => {
2977
+ const E = S.value;
2978
+ i(E === "Remove" ? (V) => ({
2979
+ ...V,
2980
+ [B]: V[B].filter((U) => U.id !== R.id)
2981
+ }) : (V) => ({
2982
+ ...V,
2983
+ [B]: V[B].map(
2984
+ (U) => U.id === R.id ? { ...U, permission: E } : U
2985
2985
  )
2986
2986
  }));
2987
- }, $ = ["users", "groups", "roles"], P = ["Users", "Groups", "Roles"];
2987
+ }, $ = ["users", "groups", "roles"], O = ["Users", "Groups", "Roles"];
2988
2988
  return (
2989
2989
  // The main structure remains the same...
2990
2990
  /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-gray-50", children: [
@@ -2992,7 +2992,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
2992
2992
  /* @__PURE__ */ l(
2993
2993
  "button",
2994
2994
  {
2995
- onClick: () => r(i),
2995
+ onClick: () => r(c),
2996
2996
  className: "flex items-center gap-1 text-sm font-medium text-gray-600 hover:text-gray-900 hover:cursor-pointer p-2 rounded-md hover:bg-gray-100",
2997
2997
  children: [
2998
2998
  /* @__PURE__ */ e(ka, { className: "h-5 w-5" }),
@@ -3012,7 +3012,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
3012
3012
  ] }),
3013
3013
  /* @__PURE__ */ e("div", { className: "flex flex-col flex-grow", children: /* @__PURE__ */ l(ae.Group, { selectedIndex: y, onChange: b, children: [
3014
3014
  /* @__PURE__ */ l("div", { className: "p-4 bg-white border-b border-gray-300", children: [
3015
- /* @__PURE__ */ e(ae.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: P.map((E) => /* @__PURE__ */ e(
3015
+ /* @__PURE__ */ e(ae.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: O.map((R) => /* @__PURE__ */ e(
3016
3016
  ae,
3017
3017
  {
3018
3018
  className: ({
@@ -3020,16 +3020,16 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
3020
3020
  }) => `w-full py-2 text-sm font-medium leading-5 rounded-md
3021
3021
  focus:outline-none focus:ring-2 ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60
3022
3022
  ${S ? "bg-white shadow text-blue-700" : "text-gray-600 hover:bg-white/[0.6]"}`,
3023
- children: E
3023
+ children: R
3024
3024
  },
3025
- E
3025
+ R
3026
3026
  )) }),
3027
3027
  /* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
3028
3028
  he,
3029
3029
  {
3030
3030
  onDebouncedChange: a,
3031
3031
  value: N,
3032
- placeholder: `Search in ${P[y]}...`
3032
+ placeholder: `Search in ${O[y]}...`
3033
3033
  }
3034
3034
  ) })
3035
3035
  ] }),
@@ -3040,11 +3040,11 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
3040
3040
  animate: { y: 0, opacity: 1 },
3041
3041
  exit: { y: -10, opacity: 0 },
3042
3042
  transition: { duration: 0.2 },
3043
- children: /* @__PURE__ */ e(ae.Panels, { as: J, children: $.map((E) => /* @__PURE__ */ e(
3043
+ children: /* @__PURE__ */ e(ae.Panels, { as: J, children: $.map((R) => /* @__PURE__ */ e(
3044
3044
  ae.Panel,
3045
3045
  {
3046
3046
  className: "space-y-3 focus:outline-none",
3047
- children: /* @__PURE__ */ e(fe, { children: m[E].length > 0 ? m[E].map((S) => /* @__PURE__ */ l(
3047
+ children: /* @__PURE__ */ e(fe, { children: m[R].length > 0 ? m[R].map((S) => /* @__PURE__ */ l(
3048
3048
  te.div,
3049
3049
  {
3050
3050
  layout: !0,
@@ -3068,12 +3068,12 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
3068
3068
  ),
3069
3069
  /* @__PURE__ */ l("div", { className: "overflow-hidden", children: [
3070
3070
  /* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: S.name }),
3071
- E !== "users" && /* @__PURE__ */ e(
3071
+ R !== "users" && /* @__PURE__ */ e(
3072
3072
  "button",
3073
3073
  {
3074
3074
  onClick: () => o({
3075
3075
  id: S.id,
3076
- type: E,
3076
+ type: R,
3077
3077
  name: S.name
3078
3078
  }),
3079
3079
  className: "text-sm text-blue-600 hover:underline hover:cursor-pointer",
@@ -3087,10 +3087,10 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
3087
3087
  {
3088
3088
  item: S,
3089
3089
  allowedPermissions: u,
3090
- onPermissionChange: (I) => g(
3090
+ onPermissionChange: (B) => g(
3091
3091
  S,
3092
- I,
3093
- E
3092
+ B,
3093
+ R
3094
3094
  )
3095
3095
  }
3096
3096
  )
@@ -3109,16 +3109,16 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
3109
3109
  /* @__PURE__ */ e(va, { className: "h-12 w-12 text-gray-400" }),
3110
3110
  /* @__PURE__ */ l("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
3111
3111
  "No ",
3112
- P[y],
3112
+ O[y],
3113
3113
  " Found"
3114
3114
  ] }),
3115
- /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: N ? `No results for "${N}"` : `There are no ${P[y].toLowerCase()} with access.` })
3115
+ /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: N ? `No results for "${N}"` : `There are no ${O[y].toLowerCase()} with access.` })
3116
3116
  ]
3117
3117
  }
3118
3118
  )
3119
3119
  ) })
3120
3120
  },
3121
- E
3121
+ R
3122
3122
  )) })
3123
3123
  },
3124
3124
  y
@@ -3139,7 +3139,7 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
3139
3139
  onClose: s,
3140
3140
  members: o
3141
3141
  }) => {
3142
- const [n, u] = L(!0), [i, c] = L(""), y = ta(i, 300), b = o.filter(
3142
+ const [n, u] = L(!0), [c, i] = L(""), y = ta(c, 300), b = o.filter(
3143
3143
  (m) => m.name.toLowerCase().includes(y.toLowerCase())
3144
3144
  ), N = {
3145
3145
  hidden: { opacity: 0 },
@@ -3232,8 +3232,8 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
3232
3232
  /* @__PURE__ */ e("div", { className: "p-4 border-b border-gray-200 flex-shrink-0", children: /* @__PURE__ */ e(
3233
3233
  he,
3234
3234
  {
3235
- onDebouncedChange: c,
3236
- value: i,
3235
+ onDebouncedChange: i,
3236
+ value: c,
3237
3237
  placeholder: "Search members..."
3238
3238
  }
3239
3239
  ) }),
@@ -3256,33 +3256,33 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
3256
3256
  calledBy: n,
3257
3257
  onClose: u = () => {
3258
3258
  },
3259
- showExistingShares: i = !0,
3260
- allowedPermissions: c = [],
3259
+ showExistingShares: c = !0,
3260
+ allowedPermissions: i = [],
3261
3261
  ...y
3262
3262
  }) => {
3263
- const [b, N] = L(de.INVITE), [a, w] = L(t), [m, g] = L(null), [$, P] = L(!1), [E, S] = L([]), [I, z] = L(de.MANAGE), A = () => {
3263
+ const [b, N] = L(de.INVITE), [a, w] = L(t), [m, g] = L(null), [$, O] = L(!1), [R, S] = L([]), [B, P] = L(de.MANAGE), E = () => {
3264
3264
  N(de.INVITE), g(null), u();
3265
- }, M = () => {
3265
+ }, V = () => {
3266
3266
  N(de.MANAGE);
3267
3267
  }, U = async ({ id: p, name: f, type: k }) => {
3268
3268
  if (console.log("handleToMembers", { id: p, name: f, type: k }), k === "groups") {
3269
3269
  try {
3270
- const d = await Fe(`${Ie.getMembersForGroup(f)}`);
3270
+ const d = await $e(`${Ie.getMembersForGroup(f)}`);
3271
3271
  } catch (d) {
3272
3272
  console.log("Error searching entities:", d);
3273
3273
  }
3274
3274
  S(resp);
3275
3275
  }
3276
- g({ id: p, type: k, name: f }), z(b), N(de.MEMBERS);
3277
- }, q = (p) => {
3276
+ g({ id: p, type: k, name: f }), P(b), N(de.MEMBERS);
3277
+ }, j = (p) => {
3278
3278
  console.log("changedExistingShares", p), w(p);
3279
3279
  const f = !We.isEqual(
3280
3280
  We.mapValues(t, (k) => k.map((d) => ({ id: d.id, permission: d.permission }))),
3281
3281
  We.mapValues(p, (k) => k.map((d) => ({ id: d.id, permission: d.permission })))
3282
3282
  );
3283
- P(f), N(b === de.MEMBERS ? I : de.INVITE);
3283
+ O(f), N(b === de.MEMBERS ? B : de.INVITE);
3284
3284
  };
3285
- return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: A, children: [
3285
+ return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: J, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: E, children: [
3286
3286
  /* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
3287
3287
  /* @__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: (() => {
3288
3288
  switch (b) {
@@ -3299,12 +3299,12 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
3299
3299
  pn,
3300
3300
  {
3301
3301
  entity: o,
3302
- onBack: q,
3303
- onClose: A,
3302
+ onBack: j,
3303
+ onClose: E,
3304
3304
  onOpenMembers: U,
3305
3305
  existingShares: a,
3306
3306
  calledBy: n,
3307
- allowedPermissions: c
3307
+ allowedPermissions: i
3308
3308
  }
3309
3309
  )
3310
3310
  },
@@ -3323,11 +3323,11 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
3323
3323
  yn,
3324
3324
  {
3325
3325
  entity: m,
3326
- onBack: q,
3327
- onClose: A,
3326
+ onBack: j,
3327
+ onClose: E,
3328
3328
  calledBy: n,
3329
3329
  existingShares: a,
3330
- members: E
3330
+ members: R
3331
3331
  }
3332
3332
  )
3333
3333
  },
@@ -3346,11 +3346,11 @@ const we = nn(), Fe = we.axiosGet, sn = we.axiosDelete, $e = we.axiosPost, ln =
3346
3346
  mn,
3347
3347
  {
3348
3348
  entity: o,
3349
- onManage: M,
3350
- onClose: A,
3349
+ onManage: V,
3350
+ onClose: E,
3351
3351
  existingShares: a,
3352
3352
  calledBy: n,
3353
- showExistingShares: i,
3353
+ showExistingShares: c,
3354
3354
  onFinalSubmit: (p) => {
3355
3355
  s(p, a);
3356
3356
  },
@@ -3376,8 +3376,8 @@ function qe({
3376
3376
  onBlur: n = () => {
3377
3377
  },
3378
3378
  placeholder: u = "Select options",
3379
- error: i = null,
3380
- displayLimit: c = 3,
3379
+ error: c = null,
3380
+ displayLimit: i = 3,
3381
3381
  selectionLimit: y = -1,
3382
3382
  // NEW: search behavior
3383
3383
  searchMode: b = "client",
@@ -3390,22 +3390,22 @@ function qe({
3390
3390
  getOptionId: m = ($) => String($.id),
3391
3391
  getOptionLabel: g = ($) => $.name
3392
3392
  }) {
3393
- const $ = Qe(), P = Qe(), [E, S] = L(""), I = ue(""), z = ne(() => {
3393
+ const $ = Qe(), O = Qe(), [R, S] = L(""), B = ue(""), P = ne(() => {
3394
3394
  const p = /* @__PURE__ */ new Map();
3395
3395
  for (const f of r) p.set(m(f), f);
3396
3396
  return p;
3397
- }, [r, m]), A = ne(() => Array.isArray(s) ? s.map((p) => p && typeof p == "object" ? z.get(m(p)) || null : z.get(String(p))).filter(Boolean) : [], [s, z, m]), M = ne(() => {
3398
- if (!E) return r;
3399
- const p = E.toLowerCase();
3397
+ }, [r, m]), E = ne(() => Array.isArray(s) ? s.map((p) => p && typeof p == "object" ? P.get(m(p)) || null : P.get(String(p))).filter(Boolean) : [], [s, P, m]), V = ne(() => {
3398
+ if (!R) return r;
3399
+ const p = R.toLowerCase();
3400
3400
  return r.filter((f) => g(f).toLowerCase().includes(p));
3401
- }, [r, E, g]);
3401
+ }, [r, R, g]);
3402
3402
  Q(() => {
3403
- b === "server" && E.length >= w && E !== I.current && (I.current = E, N && N(E));
3404
- }, [E, b, w, N]);
3405
- const U = b === "client" ? M : r, q = () => {
3406
- if (!A.length)
3403
+ b === "server" && R.length >= w && R !== B.current && (B.current = R, N && N(R));
3404
+ }, [R, b, w, N]);
3405
+ const U = b === "client" ? V : r, j = () => {
3406
+ if (!E.length)
3407
3407
  return /* @__PURE__ */ e("span", { className: "text-gray-500", children: u });
3408
- const p = A.slice(0, c), f = A.length - c;
3408
+ const p = E.slice(0, i), f = E.length - i;
3409
3409
  return /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2", children: [
3410
3410
  p.map((k) => /* @__PURE__ */ e(
3411
3411
  "span",
@@ -3422,7 +3422,7 @@ function qe({
3422
3422
  ] })
3423
3423
  ] });
3424
3424
  };
3425
- return /* @__PURE__ */ e(X, { value: A, onChange: (p) => {
3425
+ return /* @__PURE__ */ e(X, { value: E, onChange: (p) => {
3426
3426
  const f = Array.from(new Set(p.map((k) => m(k))));
3427
3427
  y !== -1 && f.length > y || o(f);
3428
3428
  }, multiple: !0, by: "id", children: ({ open: p }) => /* @__PURE__ */ l("div", { children: [
@@ -3439,15 +3439,15 @@ function qe({
3439
3439
  X.Button,
3440
3440
  {
3441
3441
  "aria-labelledby": $,
3442
- "aria-invalid": !!i,
3443
- "aria-describedby": i ? P : void 0,
3442
+ "aria-invalid": !!c,
3443
+ "aria-describedby": c ? O : void 0,
3444
3444
  onBlur: n,
3445
3445
  className: Ae(
3446
3446
  "relative w-full min-h-[38px] cursor-default rounded-md bg-white py-1.5 pl-3 pr-10 text-left text-gray-900 shadow-sm ring-1 ring-inset focus:outline-none focus:ring-2 focus:ring-gray-600 sm:text-sm sm:leading-6",
3447
- i ? "ring-red-500" : "ring-gray-300"
3447
+ c ? "ring-red-500" : "ring-gray-300"
3448
3448
  ),
3449
3449
  children: [
3450
- /* @__PURE__ */ e("span", { className: "block truncate", children: q() }),
3450
+ /* @__PURE__ */ e("span", { className: "block truncate", children: j() }),
3451
3451
  /* @__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" }) })
3452
3452
  ]
3453
3453
  }
@@ -3464,39 +3464,39 @@ function qe({
3464
3464
  /* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
3465
3465
  he,
3466
3466
  {
3467
- value: E,
3467
+ value: R,
3468
3468
  onDebouncedChange: S,
3469
3469
  placeholder: b === "server" ? `Search (min ${w})…` : "Search options…"
3470
3470
  }
3471
3471
  ) }),
3472
3472
  b === "server" && a && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
3473
- U.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: b === "server" ? E.length < w ? `Type at least ${w} characters to search.` : "No results." : "No options found." }) : U.map((f) => {
3474
- const k = m(f), d = g(f), h = A.some((D) => m(D) === k), x = y !== -1 && A.length >= y && !h;
3473
+ U.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: b === "server" ? R.length < w ? `Type at least ${w} characters to search.` : "No results." : "No options found." }) : U.map((f) => {
3474
+ const k = m(f), d = g(f), h = E.some((F) => m(F) === k), x = y !== -1 && E.length >= y && !h;
3475
3475
  return /* @__PURE__ */ e(
3476
3476
  X.Option,
3477
3477
  {
3478
3478
  value: f,
3479
3479
  disabled: x,
3480
- className: ({ active: D }) => Ae(
3481
- x ? " text-gray-400 bg-white cursor-not-allowed" : D ? " bg-gray-200 text-gray-900" : " text-gray-900",
3480
+ className: ({ active: F }) => Ae(
3481
+ x ? " text-gray-400 bg-white cursor-not-allowed" : F ? " bg-gray-200 text-gray-900" : " text-gray-900",
3482
3482
  " relative cursor-default select-none py-2 pl-3 pr-9"
3483
3483
  ),
3484
- children: ({ selected: D, active: B }) => /* @__PURE__ */ l(ee, { children: [
3484
+ children: ({ selected: F, active: z }) => /* @__PURE__ */ l(ee, { children: [
3485
3485
  /* @__PURE__ */ e(
3486
3486
  "span",
3487
3487
  {
3488
3488
  className: Ae(
3489
- D ? "font-semibold" : "font-normal",
3489
+ F ? "font-semibold" : "font-normal",
3490
3490
  "block truncate"
3491
3491
  ),
3492
3492
  children: d
3493
3493
  }
3494
3494
  ),
3495
- D && /* @__PURE__ */ e(
3495
+ F && /* @__PURE__ */ e(
3496
3496
  "span",
3497
3497
  {
3498
3498
  className: Ae(
3499
- B ? " text-gray-900" : " text-gray-600",
3499
+ z ? " text-gray-900" : " text-gray-600",
3500
3500
  " absolute inset-y-0 right-0 flex items-center pr-4"
3501
3501
  ),
3502
3502
  children: /* @__PURE__ */ e(Me, { className: "w-5 h-5", "aria-hidden": "true" })
@@ -3510,7 +3510,7 @@ function qe({
3510
3510
  ] })
3511
3511
  }
3512
3512
  ),
3513
- i && /* @__PURE__ */ e("p", { id: P, className: "mt-1 text-sm text-red-600", children: i })
3513
+ c && /* @__PURE__ */ e("p", { id: O, className: "mt-1 text-sm text-red-600", children: c })
3514
3514
  ] })
3515
3515
  ] }) });
3516
3516
  }
@@ -3556,15 +3556,15 @@ qe.defaultProps = {
3556
3556
  getOptionId: (t) => String(t.id),
3557
3557
  getOptionLabel: (t) => t.name
3558
3558
  };
3559
- const is = ({
3559
+ const cs = ({
3560
3560
  isOpen: t = !1,
3561
3561
  setIsOpen: r,
3562
3562
  content: s,
3563
3563
  header: o = { title: "", customHeader: null, isCrossShow: !0 },
3564
3564
  footer: n = { show: !0, customFooter: null },
3565
3565
  primaryAction: u = { onSubmit: null, label: "Save", loader: !1, disabled: !1 },
3566
- secondaryAction: i = { onCancel: null, label: "Cancel" },
3567
- dialogPanelClass: c = ""
3566
+ secondaryAction: c = { onCancel: null, label: "Cancel" },
3567
+ dialogPanelClass: i = ""
3568
3568
  }) => {
3569
3569
  const y = (N) => {
3570
3570
  N.target === N.currentTarget && r(!1);
@@ -3588,7 +3588,7 @@ const is = ({
3588
3588
  /* @__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(
3589
3589
  ke,
3590
3590
  {
3591
- className: `${c} relative bg-white align-middle w-full lg:w-[36rem] mx-5 lg:mx-0 transform overflow-hidden rounded-2xl text-left shadow-xl lg:min-w-[36rem] md:min-w-96 transition-all`,
3591
+ className: `${i} 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`,
3592
3592
  onClick: b,
3593
3593
  children: [
3594
3594
  /* @__PURE__ */ l("div", { className: "flex justify-between items-center border-b border-gray-200 p-6 flex-shrink-0", children: [
@@ -3605,15 +3605,15 @@ const is = ({
3605
3605
  }
3606
3606
  ),
3607
3607
  n?.show && !n?.customFooter && /* @__PURE__ */ l("div", { className: "border-t flex justify-end border-gray-200 p-6 flex-shrink-0", children: [
3608
- i?.onCancel && /* @__PURE__ */ e(
3608
+ c?.onCancel && /* @__PURE__ */ e(
3609
3609
  Z,
3610
3610
  {
3611
3611
  "data-testid": "cancel-button",
3612
- label: i?.label,
3612
+ label: c?.label,
3613
3613
  loader: !1,
3614
3614
  ariaLabel: "Cancel Button",
3615
3615
  className: "p-3 mr-3 secondaryButton !w-[70px]",
3616
- onClick: () => i?.onCancel(),
3616
+ onClick: () => c?.onCancel(),
3617
3617
  category: "secondary"
3618
3618
  }
3619
3619
  ),
@@ -3660,17 +3660,17 @@ function vn({
3660
3660
  onToggle: o,
3661
3661
  onSelect: n,
3662
3662
  onCreateChild: u,
3663
- onRename: i,
3664
- onDelete: c,
3663
+ onRename: c,
3664
+ onDelete: i,
3665
3665
  renderActions: y,
3666
3666
  // optional override
3667
3667
  dragId: b,
3668
3668
  dropId: N,
3669
3669
  indent: a = 24
3670
3670
  }) {
3671
- const { setNodeRef: w, isOver: m } = Pt({ id: N }), { attributes: g, listeners: $, setNodeRef: P, transform: E, isDragging: S } = Ot({ id: b }), I = E ? { transform: `translate3d(${Math.round(E.x)}px, ${Math.round(E.y)}px, 0)` } : void 0, [z, A] = L(!1), [M, U] = L(t.name), q = () => {
3672
- const p = M.trim();
3673
- A(!1), p && p !== t.name ? i?.(t, p) : U(t.name);
3671
+ const { setNodeRef: w, isOver: m } = Pt({ id: N }), { attributes: g, listeners: $, setNodeRef: O, transform: R, isDragging: S } = Ot({ id: b }), B = R ? { transform: `translate3d(${Math.round(R.x)}px, ${Math.round(R.y)}px, 0)` } : void 0, [P, E] = L(!1), [V, U] = L(t.name), j = () => {
3672
+ const p = V.trim();
3673
+ E(!1), p && p !== t.name ? c?.(t, p) : U(t.name);
3674
3674
  }, v = ne(() => /* @__PURE__ */ e(
3675
3675
  Xr,
3676
3676
  {
@@ -3680,40 +3680,40 @@ function vn({
3680
3680
  { action: "delete", label: "Delete" }
3681
3681
  ],
3682
3682
  onSelect: (f) => {
3683
- f.action === "create" ? u?.(t) : f.action === "rename" ? A(!0) : f.action === "delete" && c?.(t);
3683
+ f.action === "create" ? u?.(t) : f.action === "rename" ? E(!0) : f.action === "delete" && i?.(t);
3684
3684
  }
3685
3685
  }
3686
- ), [t, u, c]);
3686
+ ), [t, u, i]);
3687
3687
  return /* @__PURE__ */ l(
3688
3688
  "div",
3689
3689
  {
3690
3690
  ref: w,
3691
3691
  className: `tv-row ${m ? "tv-drop-over" : ""} ${S ? "dragging" : ""}`,
3692
- style: { ...I, paddingLeft: 8 + r * a },
3692
+ style: { ...B, paddingLeft: 8 + r * a },
3693
3693
  onClick: (p) => {
3694
3694
  p.target.closest(".tv-toggle") || p.target.tagName === "INPUT" || n?.(t);
3695
3695
  },
3696
3696
  children: [
3697
3697
  /* @__PURE__ */ e("button", { className: "tv-toggle", onClick: o, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(ba, { size: 16 }) : /* @__PURE__ */ e(Le, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
3698
3698
  /* @__PURE__ */ e(wa, { size: 16, className: "tv-folder-ic" }),
3699
- /* @__PURE__ */ e("div", { className: "tv-name", ref: P, children: z ? /* @__PURE__ */ e(
3699
+ /* @__PURE__ */ e("div", { className: "tv-name", ref: O, children: P ? /* @__PURE__ */ e(
3700
3700
  "input",
3701
3701
  {
3702
3702
  className: "tv-input",
3703
- value: M,
3703
+ value: V,
3704
3704
  onChange: (p) => U(p.target.value),
3705
- onBlur: q,
3705
+ onBlur: j,
3706
3706
  onKeyDown: (p) => {
3707
- p.key === "Enter" && q(), p.key === "Escape" && (A(!1), U(t.name));
3707
+ p.key === "Enter" && j(), p.key === "Escape" && (E(!1), U(t.name));
3708
3708
  },
3709
3709
  autoFocus: !0
3710
3710
  }
3711
- ) : /* @__PURE__ */ e("span", { onDoubleClick: () => A(!0), children: t.name }) }),
3711
+ ) : /* @__PURE__ */ e("span", { onDoubleClick: () => E(!0), children: t.name }) }),
3712
3712
  /* @__PURE__ */ e(bn, { listeners: $, attributes: g }),
3713
3713
  /* @__PURE__ */ e("div", { className: "tv-actions", children: y ? y(t, {
3714
3714
  onCreateChild: () => u?.(t),
3715
- onRename: () => A(!0),
3716
- onDelete: () => c?.(t)
3715
+ onRename: () => E(!0),
3716
+ onDelete: () => i?.(t)
3717
3717
  }) : v })
3718
3718
  ]
3719
3719
  }
@@ -3722,60 +3722,60 @@ function vn({
3722
3722
  const Nn = (t) => String(t.id ?? t._id), xn = (t) => t.parent !== void 0 ? String(t.parent) : t.parentId != null ? String(t.parentId) : "root", kn = (t) => t.name ?? t.label ?? "", wn = (t) => Array.isArray(t) && t.some((r) => Array.isArray(r.children));
3723
3723
  function Cn(t, { rootId: r, getId: s, getParent: o, getName: n }) {
3724
3724
  const u = /* @__PURE__ */ new Map();
3725
- t.forEach((c) => {
3726
- const y = s(c);
3725
+ t.forEach((i) => {
3726
+ const y = s(i);
3727
3727
  u.set(y, {
3728
- ...c,
3728
+ ...i,
3729
3729
  id: y,
3730
- name: n(c),
3731
- parentId: o(c) || r,
3730
+ name: n(i),
3731
+ parentId: o(i) || r,
3732
3732
  children: []
3733
3733
  });
3734
3734
  });
3735
- const i = [];
3736
- return u.forEach((c) => {
3737
- const y = c.parentId || r;
3738
- y !== r && u.has(y) ? u.get(y).children.push(c) : i.push(c);
3739
- }), { roots: i, byId: u };
3735
+ const c = [];
3736
+ return u.forEach((i) => {
3737
+ const y = i.parentId || r;
3738
+ y !== r && u.has(y) ? u.get(y).children.push(i) : c.push(i);
3739
+ }), { roots: c, byId: u };
3740
3740
  }
3741
3741
  function Sn(t, { rootId: r, getId: s, getName: o }) {
3742
3742
  const n = /* @__PURE__ */ new Map();
3743
- function u(c, y) {
3744
- const b = s(c), N = {
3745
- ...c,
3743
+ function u(i, y) {
3744
+ const b = s(i), N = {
3745
+ ...i,
3746
3746
  id: b,
3747
- name: o(c),
3747
+ name: o(i),
3748
3748
  parentId: y || r,
3749
- children: (c.children || []).map((a) => u(a, b))
3749
+ children: (i.children || []).map((a) => u(a, b))
3750
3750
  };
3751
3751
  return n.set(b, N), N;
3752
3752
  }
3753
- return { roots: t.map((c) => u(c, null)), byId: n };
3753
+ return { roots: t.map((i) => u(i, null)), byId: n };
3754
3754
  }
3755
3755
  const De = (t) => t.map((r) => ({ ...r, children: De(r.children || []) }));
3756
3756
  function Dn(t, r) {
3757
3757
  let s = null;
3758
3758
  function o(u) {
3759
- return u.map((i) => {
3760
- if (i.id === r)
3761
- return s = i, null;
3762
- if (i.children?.length) {
3763
- const c = o(i.children);
3764
- if (c !== i.children) return { ...i, children: c };
3759
+ return u.map((c) => {
3760
+ if (c.id === r)
3761
+ return s = c, null;
3762
+ if (c.children?.length) {
3763
+ const i = o(c.children);
3764
+ if (i !== c.children) return { ...c, children: i };
3765
3765
  }
3766
- return i;
3766
+ return c;
3767
3767
  }).filter(Boolean);
3768
3768
  }
3769
3769
  return { newRoots: o(t), removed: s };
3770
3770
  }
3771
- function Fn(t, r, s) {
3771
+ function $n(t, r, s) {
3772
3772
  function o(n) {
3773
3773
  return n.map((u) => {
3774
3774
  if (u.id === r)
3775
3775
  return { ...u, children: [...u.children || [], { ...s, parentId: r }] };
3776
3776
  if (u.children?.length) {
3777
- const i = o(u.children);
3778
- if (i !== u.children) return { ...u, children: i };
3777
+ const c = o(u.children);
3778
+ if (c !== u.children) return { ...u, children: c };
3779
3779
  }
3780
3780
  return u;
3781
3781
  });
@@ -3792,15 +3792,15 @@ function Ja(t, r, s = null) {
3792
3792
  }
3793
3793
  return null;
3794
3794
  }
3795
- function cs({
3795
+ function is({
3796
3796
  data: t = [],
3797
3797
  rootId: r = "root",
3798
3798
  title: s = "Folders",
3799
3799
  getId: o = Nn,
3800
3800
  getParent: n = xn,
3801
3801
  getName: u = kn,
3802
- onSelect: i,
3803
- onCreateRoot: c,
3802
+ onSelect: c,
3803
+ onCreateRoot: i,
3804
3804
  onCreateChild: y,
3805
3805
  onRename: b,
3806
3806
  onDelete: N,
@@ -3813,112 +3813,112 @@ function cs({
3813
3813
  const { roots: $ } = ne(() => wn(t) ? Sn(t, { rootId: r, getId: o, getName: u }) : Cn(
3814
3814
  t.map((x) => ({ ...x })),
3815
3815
  { rootId: r, getId: o, getParent: n, getName: u }
3816
- ), [t, r, o, n, u]), [P, E] = L({}), S = K((x) => {
3817
- const D = {};
3818
- return (function B(G) {
3819
- G.forEach((F) => {
3820
- D[F.id] = !0, F.children?.length && B(F.children);
3816
+ ), [t, r, o, n, u]), [O, R] = L({}), S = K((x) => {
3817
+ const F = {};
3818
+ return (function z(q) {
3819
+ q.forEach((D) => {
3820
+ F[D.id] = !0, D.children?.length && z(D.children);
3821
3821
  });
3822
- })(x), D;
3822
+ })(x), F;
3823
3823
  }, []);
3824
3824
  re.useEffect(() => {
3825
- E(S($));
3825
+ R(S($));
3826
3826
  }, [$, S]);
3827
- const I = K(
3828
- (x) => E((D) => ({ ...D, [x]: !D[x] })),
3827
+ const B = K(
3828
+ (x) => R((F) => ({ ...F, [x]: !F[x] })),
3829
3829
  []
3830
- ), [z, A] = L(() => De($));
3831
- re.useEffect(() => A(De($)), [$]);
3832
- const M = Lt(
3830
+ ), [P, E] = L(() => De($));
3831
+ re.useEffect(() => E(De($)), [$]);
3832
+ const V = Lt(
3833
3833
  Mt(jt, { activationConstraint: { delay: 250, tolerance: 5 } })
3834
- ), U = ue(null), [q, v] = L(null), p = ue(0), f = () => {
3834
+ ), U = ue(null), [j, v] = L(null), p = ue(0), f = () => {
3835
3835
  }, k = ({ delta: x }) => {
3836
3836
  p.current = x?.x ?? 0;
3837
3837
  }, d = K(
3838
- ({ active: x, over: D }) => {
3839
- const B = p.current;
3840
- if (p.current = 0, v(null), !x || !D) return;
3841
- const G = String(x.id).replace(/^drag-/, ""), F = String(D.id).replace(/^drop-/, "");
3842
- if (!G || !F || G === F) return;
3843
- let O = F;
3844
- const V = Math.max(0, Math.floor(-B / g));
3845
- if (V > 0) {
3846
- let H = F;
3847
- for (let ie = 0; ie < V; ie++) {
3848
- const ce = Ja(z, H, null);
3849
- if (!ce) break;
3850
- if (!ce.parentId) {
3851
- O = r;
3838
+ ({ active: x, over: F }) => {
3839
+ const z = p.current;
3840
+ if (p.current = 0, v(null), !x || !F) return;
3841
+ const q = String(x.id).replace(/^drag-/, ""), D = String(F.id).replace(/^drop-/, "");
3842
+ if (!q || !D || q === D) return;
3843
+ let A = D;
3844
+ const M = Math.max(0, Math.floor(-z / g));
3845
+ if (M > 0) {
3846
+ let H = D;
3847
+ for (let ce = 0; ce < M; ce++) {
3848
+ const ie = Ja(P, H, null);
3849
+ if (!ie) break;
3850
+ if (!ie.parentId) {
3851
+ A = r;
3852
3852
  break;
3853
3853
  }
3854
- O = ce.parentId, H = ce.parentId;
3854
+ A = ie.parentId, H = ie.parentId;
3855
3855
  }
3856
3856
  }
3857
- if (m && O === r) {
3858
- A(De($));
3857
+ if (m && A === r) {
3858
+ E(De($));
3859
3859
  return;
3860
3860
  }
3861
- const T = De(z), { newRoots: C, removed: R } = Dn(T, G);
3862
- if (!R) return;
3863
- const j = Fn(C, O, R);
3864
- A(j), a?.({ sourceId: G, destParentId: O, newTree: j });
3861
+ const T = De(P), { newRoots: C, removed: I } = Dn(T, q);
3862
+ if (!I) return;
3863
+ const G = $n(C, A, I);
3864
+ E(G), a?.({ sourceId: q, destParentId: A, newTree: G });
3865
3865
  },
3866
- [z, $, r, m, g, a]
3866
+ [P, $, r, m, g, a]
3867
3867
  ), h = K(
3868
- (x, D = 0) => x.map((B) => /* @__PURE__ */ l(re.Fragment, { children: [
3868
+ (x, F = 0) => x.map((z) => /* @__PURE__ */ l(re.Fragment, { children: [
3869
3869
  /* @__PURE__ */ e(
3870
3870
  vn,
3871
3871
  {
3872
- node: B,
3873
- depth: D,
3874
- expanded: !!P[B.id],
3875
- onToggle: () => I(B.id),
3876
- onSelect: i,
3872
+ node: z,
3873
+ depth: F,
3874
+ expanded: !!O[z.id],
3875
+ onToggle: () => B(z.id),
3876
+ onSelect: c,
3877
3877
  onCreateChild: y,
3878
3878
  onRename: b,
3879
3879
  onDelete: N,
3880
3880
  renderActions: w,
3881
- dragId: `drag-${B.id}`,
3882
- dropId: `drop-${B.id}`,
3881
+ dragId: `drag-${z.id}`,
3882
+ dropId: `drop-${z.id}`,
3883
3883
  indent: g
3884
3884
  }
3885
3885
  ),
3886
- P[B.id] && B.children?.length > 0 ? h(B.children, D + 1) : null
3887
- ] }, B.id)),
3888
- [P, g, y, N, b, i, w, I]
3886
+ O[z.id] && z.children?.length > 0 ? h(z.children, F + 1) : null
3887
+ ] }, z.id)),
3888
+ [O, g, y, N, b, c, w, B]
3889
3889
  );
3890
3890
  return re.useMemo(() => {
3891
- if (!q) return null;
3892
- const x = String(q).replace(/^drag-/, "");
3893
- function D(B) {
3894
- for (const G of B) {
3895
- if (G.id === x) return G;
3896
- const F = G.children?.length ? D(G.children) : null;
3897
- if (F) return F;
3891
+ if (!j) return null;
3892
+ const x = String(j).replace(/^drag-/, "");
3893
+ function F(z) {
3894
+ for (const q of z) {
3895
+ if (q.id === x) return q;
3896
+ const D = q.children?.length ? F(q.children) : null;
3897
+ if (D) return D;
3898
3898
  }
3899
3899
  return null;
3900
3900
  }
3901
- return D(z);
3902
- }, [q, z]), /* @__PURE__ */ l("div", { className: "tv", children: [
3901
+ return F(P);
3902
+ }, [j, P]), /* @__PURE__ */ l("div", { className: "tv", children: [
3903
3903
  s !== !1 && /* @__PURE__ */ l("div", { className: "tv-header", children: [
3904
3904
  /* @__PURE__ */ e("div", { className: "tv-title", children: s }),
3905
- /* @__PURE__ */ e("button", { className: "tv-btn", onClick: c, children: "+ New folder" })
3905
+ /* @__PURE__ */ e("button", { className: "tv-btn", onClick: i, children: "+ New folder" })
3906
3906
  ] }),
3907
3907
  /* @__PURE__ */ l("div", { className: "tv-root-row", children: [
3908
3908
  /* @__PURE__ */ e(wa, { size: 16, className: "tv-folder-ic" }),
3909
3909
  /* @__PURE__ */ e("strong", { children: "ROOT" }),
3910
- /* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick: c, children: "+" })
3910
+ /* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick: i, children: "+" })
3911
3911
  ] }),
3912
3912
  /* @__PURE__ */ e(
3913
3913
  Vt,
3914
3914
  {
3915
3915
  collisionDetection: qt,
3916
- sensors: M,
3916
+ sensors: V,
3917
3917
  onDragStart: f,
3918
3918
  onDragMove: k,
3919
3919
  onDragEnd: d,
3920
3920
  modifiers: [Ut],
3921
- children: /* @__PURE__ */ e("div", { ref: U, className: "tv-list", children: h(z, 0) })
3921
+ children: /* @__PURE__ */ e("div", { ref: U, className: "tv-list", children: h(P, 0) })
3922
3922
  }
3923
3923
  )
3924
3924
  ] });
@@ -3933,8 +3933,8 @@ const ds = ({
3933
3933
  containerClassName: o = "",
3934
3934
  listClassName: n = "",
3935
3935
  panelClassName: u = "",
3936
- tabClassName: i,
3937
- ...c
3936
+ tabClassName: c,
3937
+ ...i
3938
3938
  // Pass remaining props to Tab.Group
3939
3939
  }) => {
3940
3940
  const y = s === "vertical", b = (w) => ye(
@@ -3943,8 +3943,8 @@ const ds = ({
3943
3943
  ), N = (w) => ye(
3944
3944
  "py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
3945
3945
  w ? "border-indigo-600 text-indigo-700" : "border-transparent text-slate-600 hover:text-indigo-700"
3946
- ), a = ({ selected: w }) => i ? typeof i == "function" ? i(w) : i : y ? b(w) : N(w);
3947
- return /* @__PURE__ */ e(ae.Group, { vertical: y, ...c, children: y ? /* @__PURE__ */ l("div", { className: ye("flex gap-4", o), children: [
3946
+ ), a = ({ selected: w }) => c ? typeof c == "function" ? c(w) : c : y ? b(w) : N(w);
3947
+ return /* @__PURE__ */ e(ae.Group, { vertical: y, ...i, children: y ? /* @__PURE__ */ l("div", { className: ye("flex gap-4", o), children: [
3948
3948
  /* @__PURE__ */ e(ae.List, { className: ye("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", n), children: t.map((w) => /* @__PURE__ */ e(ae, { className: a, children: w.label }, w.key)) }),
3949
3949
  /* @__PURE__ */ e(ae.Panels, { unmount: !r, className: ye("flex-1", u), children: t.map((w) => /* @__PURE__ */ e(ae.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: w.content }) }, w.key)) })
3950
3950
  ] }) : /* @__PURE__ */ l(ee, { children: [
@@ -3952,9 +3952,9 @@ const ds = ({
3952
3952
  /* @__PURE__ */ e(ae.Panels, { unmount: !r, className: ye("mt-2", u), children: t.map((w) => /* @__PURE__ */ e(ae.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: w.content }) }, w.key)) })
3953
3953
  ] }) });
3954
3954
  };
3955
- function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
3955
+ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
3956
3956
  console.log(t);
3957
- const [n, u] = re.useState(t), [i, c] = re.useState(() => {
3957
+ const [n, u] = re.useState(t), [c, i] = re.useState(() => {
3958
3958
  const a = r && r[t.key] || {};
3959
3959
  return console.log("Initial Section data for", t.key, a), a;
3960
3960
  }), y = ue(r);
@@ -3962,16 +3962,16 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
3962
3962
  if (y.current !== r) {
3963
3963
  y.current = r;
3964
3964
  const a = r && r[t.key] || {};
3965
- console.log("Updated Section data for", t.key, a), c(a);
3965
+ console.log("Updated Section data for", t.key, a), i(a);
3966
3966
  }
3967
- }, [r, t.key]), console.log("Section data", i);
3968
- const b = ue(i);
3967
+ }, [r, t.key]), console.log("Section data", c);
3968
+ const b = ue(c);
3969
3969
  Q(() => {
3970
- b.current !== i && s && typeof s == "function" && (b.current = i, s(n.key, i));
3971
- }, [n.key, i, s]);
3970
+ b.current !== c && s && typeof s == "function" && (b.current = c, s(n.key, c));
3971
+ }, [n.key, c, s]);
3972
3972
  const N = (a) => {
3973
3973
  if (!a.dependsOn) return !0;
3974
- const { field: w, value: m, operator: g = "equals" } = a.dependsOn, $ = i[w];
3974
+ const { field: w, value: m, operator: g = "equals" } = a.dependsOn, $ = c[w];
3975
3975
  switch (g) {
3976
3976
  case "equals":
3977
3977
  return $ === m;
@@ -4030,10 +4030,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4030
4030
  name: a.key,
4031
4031
  defaultValue: a.default,
4032
4032
  placeholder: a.placeholder,
4033
- value: i[a.key] || "",
4033
+ value: c[a.key] || "",
4034
4034
  onChange: (m) => {
4035
- const g = { ...i, [a.key]: m.target.value };
4036
- c(g), s && s(n.key, g);
4035
+ const g = { ...c, [a.key]: m.target.value };
4036
+ i(g), s && s(n.key, g);
4037
4037
  },
4038
4038
  required: a.required,
4039
4039
  disabled: a.disabled ? a.disabled : !1,
@@ -4049,10 +4049,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4049
4049
  name: a.key,
4050
4050
  defaultValue: a.default,
4051
4051
  placeholder: a.placeholder,
4052
- value: i[a.key] || "",
4052
+ value: c[a.key] || "",
4053
4053
  onChange: (m) => {
4054
- const g = { ...i, [a.key]: m.target.value };
4055
- c(g), s && s(n.key, g);
4054
+ const g = { ...c, [a.key]: m.target.value };
4055
+ i(g), s && s(n.key, g);
4056
4056
  },
4057
4057
  rows: 3,
4058
4058
  required: a.required,
@@ -4070,10 +4070,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4070
4070
  name: a.key,
4071
4071
  defaultValue: a.default,
4072
4072
  placeholder: a.placeholder,
4073
- value: i[a.key] || "",
4073
+ value: c[a.key] || "",
4074
4074
  onChange: (m) => {
4075
- const g = { ...i, [a.key]: m.target.value };
4076
- c(g), s && s(n.key, g);
4075
+ const g = { ...c, [a.key]: m.target.value };
4076
+ i(g), s && s(n.key, g);
4077
4077
  },
4078
4078
  required: a.required,
4079
4079
  disabled: a.disabled ? a.disabled : !1,
@@ -4087,10 +4087,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4087
4087
  Aa,
4088
4088
  {
4089
4089
  name: a.key,
4090
- checked: !!(i[a.key] || a.default),
4090
+ checked: !!(c[a.key] || a.default),
4091
4091
  onChange: (m) => {
4092
- const g = { ...i, [a.key]: m };
4093
- c(g), s && s(n.key, g);
4092
+ const g = { ...c, [a.key]: m };
4093
+ i(g), s && s(n.key, g);
4094
4094
  },
4095
4095
  label: a.placeholder || a.label,
4096
4096
  disabled: a.disabled ? a.disabled : !1,
@@ -4105,10 +4105,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4105
4105
  {
4106
4106
  name: a.key,
4107
4107
  defaultValue: a.default,
4108
- value: i[a.key] || "",
4108
+ value: c[a.key] || "",
4109
4109
  onChange: (m) => {
4110
- const g = { ...i, [a.key]: m };
4111
- c(g);
4110
+ const g = { ...c, [a.key]: m };
4111
+ i(g);
4112
4112
  },
4113
4113
  options: a.options || [],
4114
4114
  placeholder: a.placeholder || `Select ${a.label}`,
@@ -4127,10 +4127,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4127
4127
  name: a.key,
4128
4128
  defaultValue: a.default,
4129
4129
  placeholder: a.placeholder || "Enter email address",
4130
- value: i[a.key] || "",
4130
+ value: c[a.key] || "",
4131
4131
  onChange: (m) => {
4132
- const g = { ...i, [a.key]: m.target.value };
4133
- c(g), s && s(n.key, g);
4132
+ const g = { ...c, [a.key]: m.target.value };
4133
+ i(g), s && s(n.key, g);
4134
4134
  },
4135
4135
  required: a.required,
4136
4136
  disabled: a.disabled ? a.disabled : !1,
@@ -4147,10 +4147,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4147
4147
  name: a.key,
4148
4148
  defaultValue: a.default,
4149
4149
  placeholder: a.placeholder || "Enter URL",
4150
- value: i[a.key] || "",
4150
+ value: c[a.key] || "",
4151
4151
  onChange: (m) => {
4152
- const g = { ...i, [a.key]: m.target.value };
4153
- c(g), s && s(n.key, g);
4152
+ const g = { ...c, [a.key]: m.target.value };
4153
+ i(g), s && s(n.key, g);
4154
4154
  },
4155
4155
  required: a.required,
4156
4156
  disabled: a.disabled ? a.disabled : !1,
@@ -4167,10 +4167,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4167
4167
  name: a.key,
4168
4168
  defaultValue: a.default,
4169
4169
  placeholder: a.placeholder || "Enter password",
4170
- value: i[a.key] || "",
4170
+ value: c[a.key] || "",
4171
4171
  onChange: (m) => {
4172
- const g = { ...i, [a.key]: m.target.value };
4173
- c(g), s && s(n.key, g);
4172
+ const g = { ...c, [a.key]: m.target.value };
4173
+ i(g), s && s(n.key, g);
4174
4174
  },
4175
4175
  required: a.required,
4176
4176
  disabled: a.disabled ? a.disabled : !1,
@@ -4183,10 +4183,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4183
4183
  /* @__PURE__ */ e(
4184
4184
  qe,
4185
4185
  {
4186
- selectedItems: i[a.key] || [],
4186
+ selectedItems: c[a.key] || [],
4187
4187
  onSelectionChange: (m) => {
4188
- const g = { ...i, [a.key]: m };
4189
- c(g), s && s(n.key, g);
4188
+ const g = { ...c, [a.key]: m };
4189
+ i(g), s && s(n.key, g);
4190
4190
  },
4191
4191
  options: a.options || [],
4192
4192
  placeholder: a.placeholder || `Select ${a.label}`,
@@ -4200,11 +4200,11 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4200
4200
  /* @__PURE__ */ e(
4201
4201
  Ma,
4202
4202
  {
4203
- checked: typeof i[a.key] == "boolean" ? i[a.key] : a.default,
4203
+ checked: typeof c[a.key] == "boolean" ? c[a.key] : a.default,
4204
4204
  onChange: (m) => {
4205
4205
  console.log("Toggle changed:", a.key, m);
4206
- const g = { ...i, [a.key]: m };
4207
- c(g), s && s(n.key, g);
4206
+ const g = { ...c, [a.key]: m };
4207
+ i(g), s && s(n.key, g);
4208
4208
  },
4209
4209
  label: a.placeholder || a.label,
4210
4210
  disabled: a.disabled ? a.disabled : !1
@@ -4216,10 +4216,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4216
4216
  za,
4217
4217
  {
4218
4218
  label: a.label,
4219
- value: i[a.key] ? new Date(i[a.key]) : null,
4219
+ value: c[a.key] ? new Date(c[a.key]) : null,
4220
4220
  onChange: (m) => {
4221
- const g = { ...i, [a.key]: m ? m.toISOString().split("T")[0] : "" };
4222
- c(g), s && s(n.key, g);
4221
+ const g = { ...c, [a.key]: m ? m.toISOString().split("T")[0] : "" };
4222
+ i(g), s && s(n.key, g);
4223
4223
  },
4224
4224
  placeholder: a.placeholder || "Select date",
4225
4225
  disabled: a.disabled ? a.disabled : !1,
@@ -4231,10 +4231,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4231
4231
  Gr,
4232
4232
  {
4233
4233
  label: a.label,
4234
- value: i[a.key] || { from: null, to: null },
4234
+ value: c[a.key] || { from: null, to: null },
4235
4235
  onChange: (m) => {
4236
- const g = { ...i, [a.key]: m };
4237
- c(g), s && s(n.key, g);
4236
+ const g = { ...c, [a.key]: m };
4237
+ i(g), s && s(n.key, g);
4238
4238
  },
4239
4239
  placeholder: a.placeholder || "Select date range",
4240
4240
  disabled: a.disabled ? a.disabled : !1,
@@ -4246,10 +4246,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4246
4246
  /* @__PURE__ */ e(
4247
4247
  Ba,
4248
4248
  {
4249
- selectedValue: typeof i[a.key] < "u" ? i[a.key] : a.default || "",
4249
+ selectedValue: typeof c[a.key] < "u" ? c[a.key] : a.default || "",
4250
4250
  onValueChange: (m) => {
4251
- const g = { ...i, [a.key]: m };
4252
- c(g), s && s(n.key, g);
4251
+ const g = { ...c, [a.key]: m };
4252
+ i(g), s && s(n.key, g);
4253
4253
  },
4254
4254
  options: a.options || [],
4255
4255
  disabled: a.disabled ? a.disabled : !1,
@@ -4267,10 +4267,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4267
4267
  id: `${a.key}-${m.value}`,
4268
4268
  name: a.key,
4269
4269
  value: m.value,
4270
- checked: i[a.key] === m.value,
4270
+ checked: c[a.key] === m.value,
4271
4271
  onChange: (g) => {
4272
- const $ = { ...i, [a.key]: g.target.value };
4273
- c($), s && s(n.key, $);
4272
+ const $ = { ...c, [a.key]: g.target.value };
4273
+ i($), s && s(n.key, $);
4274
4274
  },
4275
4275
  disabled: a.disabled
4276
4276
  }
@@ -4286,10 +4286,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4286
4286
  /* @__PURE__ */ e(
4287
4287
  he,
4288
4288
  {
4289
- value: i[a.key] || "",
4289
+ value: c[a.key] || "",
4290
4290
  onChange: (m) => {
4291
- const g = { ...i, [a.key]: m };
4292
- c(g), s && s(n.key, g);
4291
+ const g = { ...c, [a.key]: m };
4292
+ i(g), s && s(n.key, g);
4293
4293
  },
4294
4294
  placeholder: a.placeholder || `Search ${a.label}`,
4295
4295
  className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
@@ -4305,10 +4305,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4305
4305
  name: a.key,
4306
4306
  defaultValue: a.default,
4307
4307
  placeholder: a.placeholder || "Select date and time",
4308
- value: i[a.key] || "",
4308
+ value: c[a.key] || "",
4309
4309
  onChange: (m) => {
4310
- const g = { ...i, [a.key]: m.target.value };
4311
- c(g), s && s(n.key, g);
4310
+ const g = { ...c, [a.key]: m.target.value };
4311
+ i(g), s && s(n.key, g);
4312
4312
  },
4313
4313
  required: a.required,
4314
4314
  className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
@@ -4324,10 +4324,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4324
4324
  name: a.key,
4325
4325
  defaultValue: a.default,
4326
4326
  placeholder: a.placeholder || "Select time",
4327
- value: i[a.key] || "",
4327
+ value: c[a.key] || "",
4328
4328
  onChange: (m) => {
4329
- const g = { ...i, [a.key]: m.target.value };
4330
- c(g), s && s(n.key, g);
4329
+ const g = { ...c, [a.key]: m.target.value };
4330
+ i(g), s && s(n.key, g);
4331
4331
  },
4332
4332
  required: a.required,
4333
4333
  className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
@@ -4342,10 +4342,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4342
4342
  type: "color",
4343
4343
  name: a.key,
4344
4344
  defaultValue: a.default || "#000000",
4345
- value: i[a.key] || "#000000",
4345
+ value: c[a.key] || "#000000",
4346
4346
  onChange: (m) => {
4347
- const g = { ...i, [a.key]: m.target.value };
4348
- c(g), s && s(n.key, g);
4347
+ const g = { ...c, [a.key]: m.target.value };
4348
+ i(g), s && s(n.key, g);
4349
4349
  },
4350
4350
  className: `w-full h-10 ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
4351
4351
  }
@@ -4359,10 +4359,10 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4359
4359
  type: "range",
4360
4360
  name: a.key,
4361
4361
  defaultValue: a.default || a.min || 0,
4362
- value: i[a.key] || a.min || 0,
4362
+ value: c[a.key] || a.min || 0,
4363
4363
  onChange: (m) => {
4364
- const g = { ...i, [a.key]: m.target.value };
4365
- c(g), s && s(n.key, g);
4364
+ const g = { ...c, [a.key]: m.target.value };
4365
+ i(g), s && s(n.key, g);
4366
4366
  },
4367
4367
  min: a.min || 0,
4368
4368
  max: a.max || 100,
@@ -4374,7 +4374,7 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4374
4374
  /* @__PURE__ */ e("span", { children: a.min || 0 }),
4375
4375
  /* @__PURE__ */ l("span", { children: [
4376
4376
  "Current: ",
4377
- i[a.key] || a.min || 0
4377
+ c[a.key] || a.min || 0
4378
4378
  ] }),
4379
4379
  /* @__PURE__ */ e("span", { children: a.max || 100 })
4380
4380
  ] }),
@@ -4387,8 +4387,8 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4387
4387
  type: "file",
4388
4388
  name: a.key,
4389
4389
  onChange: (m) => {
4390
- const g = m.target.files[0], $ = { ...i, [a.key]: g ? g.name : "" };
4391
- c($), s && s(n.key, $);
4390
+ const g = m.target.files[0], $ = { ...c, [a.key]: g ? g.name : "" };
4391
+ i($), s && s(n.key, $);
4392
4392
  },
4393
4393
  accept: a.accept,
4394
4394
  className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
@@ -4401,11 +4401,11 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4401
4401
  Qa,
4402
4402
  {
4403
4403
  endpoints: a.endpoints || {},
4404
- initialData: i[a.key] || a.initialData || [],
4404
+ initialData: c[a.key] || a.initialData || [],
4405
4405
  className: a.className || "",
4406
4406
  onCollectionChange: (m) => {
4407
- const g = { ...i, [a.key]: m };
4408
- c(g), s && s(n.key, g);
4407
+ const g = { ...c, [a.key]: m };
4408
+ i(g), s && s(n.key, g);
4409
4409
  },
4410
4410
  showSearch: a.showSearch !== !1,
4411
4411
  allowAdd: a.allowAdd !== !1,
@@ -4433,7 +4433,7 @@ function $n({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4433
4433
  const Tn = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
4434
4434
  function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4435
4435
  console.log(`[DynamicConfig/DataTableRenderer] Component loaded for section: ${t.key}`);
4436
- const [n, u] = L(t), [i, c] = L(null), [y, b] = L(null);
4436
+ const [n, u] = L(t), [c, i] = L(null), [y, b] = L(null);
4437
4437
  console.log(`[DataTableRenderer] ${n.key} - Received props:`, { item: t, initialData: r });
4438
4438
  const [N, a] = L(() => {
4439
4439
  const v = r && r[n.key] || [], p = v.length > 0 ? v : [{ id: 0 }];
@@ -4457,8 +4457,8 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4457
4457
  const $ = (v) => {
4458
4458
  const p = (d, h) => {
4459
4459
  console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: d, value: h, type: typeof h }), a((x) => {
4460
- const D = [...x];
4461
- return D[d][v.key] = h, D;
4460
+ const F = [...x];
4461
+ return F[d][v.key] = h, F;
4462
4462
  });
4463
4463
  }, f = (d) => o[n.key]?.[d]?.[v.key], k = (d) => {
4464
4464
  const h = f(d);
@@ -4574,12 +4574,12 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4574
4574
  return (d, h) => {
4575
4575
  const x = () => {
4576
4576
  if (v.optionsFrom && r) {
4577
- const { config: D, valueField: B, labelField: G } = v.optionsFrom, F = r[D] || [];
4578
- if (Array.isArray(F))
4579
- return F.map((O) => ({
4580
- id: O[B] || "",
4581
- value: O[B] || "",
4582
- label: O[G] || ""
4577
+ const { config: F, valueField: z, labelField: q } = v.optionsFrom, D = r[F] || [];
4578
+ if (Array.isArray(D))
4579
+ return D.map((A) => ({
4580
+ id: A[z] || "",
4581
+ value: A[z] || "",
4582
+ label: A[q] || ""
4583
4583
  }));
4584
4584
  }
4585
4585
  return v.options || [];
@@ -4590,7 +4590,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4590
4590
  {
4591
4591
  index: h,
4592
4592
  value: d[v.key] || "",
4593
- onChange: (D) => p(h, D),
4593
+ onChange: (F) => p(h, F),
4594
4594
  options: x(),
4595
4595
  placeholder: v.placeholder || `Select ${v.label}`,
4596
4596
  required: v.required,
@@ -4608,7 +4608,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4608
4608
  qe,
4609
4609
  {
4610
4610
  selectedItems: x,
4611
- onSelectionChange: (D) => p(h, D),
4611
+ onSelectionChange: (F) => p(h, F),
4612
4612
  options: v.options || [],
4613
4613
  placeholder: v.placeholder || `Select ${v.label}`,
4614
4614
  className: "w-full"
@@ -4693,29 +4693,29 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4693
4693
  );
4694
4694
  case "audience":
4695
4695
  return (d, h) => {
4696
- const x = d[v.key] || { users: [], groups: [], roles: [] }, D = [
4696
+ const x = d[v.key] || { users: [], groups: [], roles: [] }, F = [
4697
4697
  ...x.users || [],
4698
4698
  ...x.groups || [],
4699
4699
  ...x.roles || []
4700
4700
  ];
4701
4701
  return /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
4702
- /* @__PURE__ */ e(Tn, { children: D.length > 0 ? D.slice(0, 3).map((B, G) => /* @__PURE__ */ e(
4702
+ /* @__PURE__ */ e(Tn, { children: F.length > 0 ? F.slice(0, 3).map((z, q) => /* @__PURE__ */ e(
4703
4703
  Ta,
4704
4704
  {
4705
4705
  size: "small",
4706
- name: B.name || B.displayName || B.id,
4707
- src: B.avatarUrl
4706
+ name: z.name || z.displayName || z.id,
4707
+ src: z.avatarUrl
4708
4708
  },
4709
- G
4709
+ q
4710
4710
  )) : null }),
4711
4711
  /* @__PURE__ */ e(
4712
4712
  "button",
4713
4713
  {
4714
4714
  className: "text-blue-600 font-semibold hover:text-blue-800",
4715
4715
  onClick: () => {
4716
- b(v.key), c(h);
4716
+ b(v.key), i(h);
4717
4717
  },
4718
- children: D.length > 0 ? "Edit" : "Assign"
4718
+ children: F.length > 0 ? "Edit" : "Assign"
4719
4719
  }
4720
4720
  )
4721
4721
  ] });
@@ -4752,8 +4752,8 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4752
4752
  {
4753
4753
  type: "file",
4754
4754
  onChange: (x) => {
4755
- const D = x.target.files[0];
4756
- p(h, D ? D.name : "");
4755
+ const F = x.target.files[0];
4756
+ p(h, F ? F.name : "");
4757
4757
  },
4758
4758
  accept: v.accept,
4759
4759
  className: "w-full"
@@ -4784,7 +4784,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4784
4784
  k(h)
4785
4785
  ] });
4786
4786
  }
4787
- }, P = K(() => {
4787
+ }, O = K(() => {
4788
4788
  console.log("[DataTableRenderer] Adding blank row"), a((v) => {
4789
4789
  console.log("[DataTableRenderer] Current data before add:", v);
4790
4790
  const p = {
@@ -4797,38 +4797,38 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4797
4797
  const f = [...v, p];
4798
4798
  return console.log("[DataTableRenderer] Updated data:", f), f;
4799
4799
  });
4800
- }, [n.fields]), E = K((v) => {
4800
+ }, [n.fields]), R = K((v) => {
4801
4801
  a((p) => {
4802
4802
  if (p.length <= 1)
4803
4803
  return p;
4804
4804
  const f = [...p];
4805
4805
  return f.splice(v, 1), f;
4806
4806
  });
4807
- }, []), [S, I] = L(null), z = K((v, p) => {
4808
- I(p), v.dataTransfer.effectAllowed = "move", v.dataTransfer.setData("text/html", "");
4809
- }, []), A = K((v) => {
4807
+ }, []), [S, B] = L(null), P = K((v, p) => {
4808
+ B(p), v.dataTransfer.effectAllowed = "move", v.dataTransfer.setData("text/html", "");
4809
+ }, []), E = K((v) => {
4810
4810
  v.preventDefault(), v.dataTransfer.dropEffect = "move";
4811
- }, []), M = K((v, p) => {
4811
+ }, []), V = K((v, p) => {
4812
4812
  v.preventDefault(), !(S === null || S === p) && (a((f) => {
4813
4813
  const k = [...f], d = k[S];
4814
4814
  return k.splice(S, 1), k.splice(p, 0, d), k;
4815
- }), I(null));
4815
+ }), B(null));
4816
4816
  }, [S]), U = K(() => {
4817
- I(null);
4818
- }, []), q = K((v) => {
4817
+ B(null);
4818
+ }, []), j = K((v) => {
4819
4819
  console.log("[DataTableRenderer] handleAddAudience called with:", v), a((p) => {
4820
4820
  const f = [...p];
4821
- if (i !== null && y && f[i]) {
4822
- const k = v.pendingInvites || [], d = k.filter((D) => D.type === "User"), h = k.filter((D) => D.type === "Group"), x = k.filter((D) => D.type === "Role");
4823
- f[i][y] = {
4824
- users: [...f[i][y]?.users || [], ...d],
4825
- groups: [...f[i][y]?.groups || [], ...h],
4826
- roles: [...f[i][y]?.roles || [], ...x]
4827
- }, console.log("[DataTableRenderer] Updated audience data:", f[i][y]);
4821
+ if (c !== null && y && f[c]) {
4822
+ const k = v.pendingInvites || [], d = k.filter((F) => F.type === "User"), h = k.filter((F) => F.type === "Group"), x = k.filter((F) => F.type === "Role");
4823
+ f[c][y] = {
4824
+ users: [...f[c][y]?.users || [], ...d],
4825
+ groups: [...f[c][y]?.groups || [], ...h],
4826
+ roles: [...f[c][y]?.roles || [], ...x]
4827
+ }, console.log("[DataTableRenderer] Updated audience data:", f[c][y]);
4828
4828
  }
4829
4829
  return f;
4830
- }), c(null), b(null);
4831
- }, [i, y]);
4830
+ }), i(null), b(null);
4831
+ }, [c, y]);
4832
4832
  return /* @__PURE__ */ l("div", { children: [
4833
4833
  /* @__PURE__ */ l("div", { style: { marginBottom: "20px" }, children: [
4834
4834
  /* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
@@ -4837,7 +4837,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4837
4837
  "button",
4838
4838
  {
4839
4839
  className: "btn btn-primary text-white px-6 py-2 rounded-2xl cursor-pointer hover:bg-gray-800",
4840
- onClick: P,
4840
+ onClick: O,
4841
4841
  children: "Add"
4842
4842
  }
4843
4843
  )
@@ -4862,9 +4862,9 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4862
4862
  {
4863
4863
  className: `hover:bg-gray-50 ${S === p ? "opacity-50" : ""}`,
4864
4864
  draggable: !0,
4865
- onDragStart: (f) => z(f, p),
4866
- onDragOver: A,
4867
- onDrop: (f) => M(f, p),
4865
+ onDragStart: (f) => P(f, p),
4866
+ onDragOver: E,
4867
+ onDrop: (f) => V(f, p),
4868
4868
  onDragEnd: U,
4869
4869
  children: [
4870
4870
  /* @__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 }) }) }),
@@ -4872,7 +4872,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4872
4872
  /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
4873
4873
  "button",
4874
4874
  {
4875
- onClick: () => E(p),
4875
+ onClick: () => R(p),
4876
4876
  className: "text-red-500 hover:text-red-700",
4877
4877
  title: "Delete row",
4878
4878
  children: /* @__PURE__ */ e(Gt, { size: 16 })
@@ -4883,20 +4883,20 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
4883
4883
  p
4884
4884
  )) })
4885
4885
  ] }) }),
4886
- i !== null && (() => {
4887
- const v = N[i] && N[i][y] ? {
4888
- users: N[i][y].users || [],
4889
- groups: N[i][y].groups || [],
4890
- roles: N[i][y].roles || []
4886
+ c !== null && (() => {
4887
+ const v = N[c] && N[c][y] ? {
4888
+ users: N[c][y].users || [],
4889
+ groups: N[c][y].groups || [],
4890
+ roles: N[c][y].roles || []
4891
4891
  } : { users: [], groups: [], roles: [] };
4892
- return console.log("[DataTableRenderer] Opening modal with existing data:", v), console.log("[DataTableRenderer] Row data:", N[i]), console.log("[DataTableRenderer] Field name:", y), /* @__PURE__ */ e(
4892
+ return console.log("[DataTableRenderer] Opening modal with existing data:", v), console.log("[DataTableRenderer] Row data:", N[c]), console.log("[DataTableRenderer] Field name:", y), /* @__PURE__ */ e(
4893
4893
  fn,
4894
4894
  {
4895
4895
  isOpen: !0,
4896
4896
  onClose: () => {
4897
- c(null), b(null);
4897
+ i(null), b(null);
4898
4898
  },
4899
- onFinalSubmit: q,
4899
+ onFinalSubmit: j,
4900
4900
  existingShares: v,
4901
4901
  allowedPermissions: ["view", "remove"]
4902
4902
  }
@@ -4966,127 +4966,127 @@ const ma = () => {
4966
4966
  showSearch: o = !0,
4967
4967
  allowAdd: n = !0,
4968
4968
  allowEdit: u = !0,
4969
- allowDelete: i = !0,
4970
- allowReorder: c = !0,
4969
+ allowDelete: c = !0,
4970
+ allowReorder: i = !0,
4971
4971
  initialData: y = null
4972
4972
  // Add prop for initial demo data
4973
4973
  }) => {
4974
- const [b, N] = L(null), [a, w] = L(""), [m, g] = L(() => Array.isArray(y) ? y : []), [$, P] = L(null), [E, S] = L(null), [I, z] = L(""), A = async () => {
4974
+ const [b, N] = L(null), [a, w] = L(""), [m, g] = L(() => Array.isArray(y) ? y : []), [$, O] = L(null), [R, S] = L(null), [B, P] = L(""), E = async () => {
4975
4975
  try {
4976
- const F = await Fe(t.collectionList);
4977
- if (F) {
4978
- const O = F.map((V, T) => ({
4979
- ...V,
4980
- order: typeof V.order == "number" ? V.order : T + 1
4976
+ const D = await $e(t.collectionList);
4977
+ if (D) {
4978
+ const A = D.map((M, T) => ({
4979
+ ...M,
4980
+ order: typeof M.order == "number" ? M.order : T + 1
4981
4981
  }));
4982
- O.sort((V, T) => (V.order ?? 0) - (T.order ?? 0)), g(O), s?.(O);
4982
+ A.sort((M, T) => (M.order ?? 0) - (T.order ?? 0)), g(A), s?.(A);
4983
4983
  }
4984
- } catch (F) {
4985
- console.log("Error loading collections:", F), typeof window < "u" && !window.location.pathname.includes("iframe.html") && le.error("Failed to load collections");
4984
+ } catch (D) {
4985
+ console.log("Error loading collections:", D), typeof window < "u" && !window.location.pathname.includes("iframe.html") && le.error("Failed to load collections");
4986
4986
  }
4987
4987
  };
4988
4988
  Q(() => {
4989
- (!y || y.length === 0) && A();
4989
+ (!y || y.length === 0) && E();
4990
4990
  }, [y]), Q(() => {
4991
4991
  Array.isArray(y) && g(y);
4992
4992
  }, [y]);
4993
- const M = (F) => {
4994
- u && (N(F.id), w(F.categoryName || ""));
4993
+ const V = (D) => {
4994
+ u && (N(D.id), w(D.categoryName || ""));
4995
4995
  }, U = () => {
4996
4996
  if (!n || b !== null) return;
4997
- const F = `temp-${Date.now()}`;
4998
- g((O) => [
4999
- ...O,
4997
+ const D = `temp-${Date.now()}`;
4998
+ g((A) => [
4999
+ ...A,
5000
5000
  {
5001
- id: F,
5001
+ id: D,
5002
5002
  categoryName: "",
5003
5003
  links: [],
5004
- order: (O.at(-1)?.order ?? 0) + 1,
5004
+ order: (A.at(-1)?.order ?? 0) + 1,
5005
5005
  _temp: !0
5006
5006
  }
5007
- ]), N(F), w("");
5008
- }, q = () => {
5009
- b != null && (g((F) => {
5010
- const O = F.find((T) => T.id === b), V = O && O._temp ? F.filter((T) => T.id !== b) : F;
5011
- return s?.(V), V;
5007
+ ]), N(D), w("");
5008
+ }, j = () => {
5009
+ b != null && (g((D) => {
5010
+ const A = D.find((T) => T.id === b), M = A && A._temp ? D.filter((T) => T.id !== b) : D;
5011
+ return s?.(M), M;
5012
5012
  }), N(null), w(""));
5013
5013
  }, v = async () => {
5014
5014
  if (b == null || !a.trim()) return;
5015
- const F = typeof b == "string" && b.startsWith("temp-");
5015
+ const D = typeof b == "string" && b.startsWith("temp-");
5016
5016
  try {
5017
- if (F) {
5018
- const O = await $e(t.collectionCreate, {
5017
+ if (D) {
5018
+ const A = await Fe(t.collectionCreate, {
5019
5019
  categoryName: a.trim(),
5020
5020
  order: (Array.isArray(m) && m.length > 0 ? m.at(-1)?.order ?? 0 : 0) + 1
5021
5021
  });
5022
- O && (g((V) => {
5023
- const T = V.map((C) => C.id === b ? O : C);
5022
+ A && (g((M) => {
5023
+ const T = M.map((C) => C.id === b ? A : C);
5024
5024
  return s?.(T), T;
5025
5025
  }), ve.success("Collection created successfully"));
5026
5026
  } else {
5027
- const O = await ln(
5027
+ const A = await ln(
5028
5028
  `${t.collectionUpdate}/${b}?newName=${a.trim()}`
5029
5029
  );
5030
- g((V) => {
5031
- const T = V.map(
5032
- (C) => C.id === b ? O && O.id ? { ...C, ...O } : { ...C, categoryName: a.trim() } : C
5030
+ g((M) => {
5031
+ const T = M.map(
5032
+ (C) => C.id === b ? A && A.id ? { ...C, ...A } : { ...C, categoryName: a.trim() } : C
5033
5033
  );
5034
5034
  return s?.(T), T;
5035
5035
  }), le.success("Collection updated successfully");
5036
5036
  }
5037
5037
  N(null), w("");
5038
- } catch (O) {
5039
- console.log(O), le.error("Failed to save collection");
5038
+ } catch (A) {
5039
+ console.log(A), le.error("Failed to save collection");
5040
5040
  }
5041
- }, p = async (F) => {
5042
- if (i)
5041
+ }, p = async (D) => {
5042
+ if (c)
5043
5043
  try {
5044
- await sn(`${t.collectionUpdate}/${F.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }), A());
5045
- } catch (O) {
5046
- console.log(O), le.error("Failed to delete collection");
5044
+ await sn(`${t.collectionUpdate}/${D.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }), E());
5045
+ } catch (A) {
5046
+ console.log(A), le.error("Failed to delete collection");
5047
5047
  }
5048
- }, f = (F, O, V) => {
5049
- if (!c || !O || !V || O === V) return F;
5050
- const T = F.findIndex((H) => H.id === O), C = F.findIndex((H) => H.id === V);
5051
- if (T === -1 || C === -1) return F;
5052
- const R = [...F], [j] = R.splice(T, 1);
5053
- return R.splice(C, 0, j), R.map((H, ie) => ({ ...H, order: ie + 1 }));
5054
- }, k = async (F) => {
5055
- const O = F.map((V) => ({
5056
- id: V.id,
5057
- order: V.order,
5058
- categoryName: V.categoryName
5048
+ }, f = (D, A, M) => {
5049
+ if (!i || !A || !M || A === M) return D;
5050
+ const T = D.findIndex((H) => H.id === A), C = D.findIndex((H) => H.id === M);
5051
+ if (T === -1 || C === -1) return D;
5052
+ const I = [...D], [G] = I.splice(T, 1);
5053
+ return I.splice(C, 0, G), I.map((H, ce) => ({ ...H, order: ce + 1 }));
5054
+ }, k = async (D) => {
5055
+ const A = D.map((M) => ({
5056
+ id: M.id,
5057
+ order: M.order,
5058
+ categoryName: M.categoryName
5059
5059
  }));
5060
5060
  try {
5061
- await $e(t.updateCollection, O);
5062
- } catch (V) {
5063
- console.log(V), le.error("Failed to save order", { autoClose: 2500 });
5061
+ await Fe(t.updateCollection, A);
5062
+ } catch (M) {
5063
+ console.log(M), le.error("Failed to save order", { autoClose: 2500 });
5064
5064
  }
5065
- }, d = (F, O) => {
5066
- c && (F.dataTransfer.effectAllowed = "move", F.dataTransfer.setData("text/plain", String(O)), P(O));
5067
- }, h = (F) => {
5068
- $ && F !== E && S(F);
5069
- }, x = (F) => {
5070
- F.preventDefault();
5071
- }, D = async (F, O) => {
5072
- F.preventDefault();
5073
- const V = F.dataTransfer.getData("text/plain");
5074
- V && (g((T) => {
5075
- const C = f(T, V, O);
5065
+ }, d = (D, A) => {
5066
+ i && (D.dataTransfer.effectAllowed = "move", D.dataTransfer.setData("text/plain", String(A)), O(A));
5067
+ }, h = (D) => {
5068
+ $ && D !== R && S(D);
5069
+ }, x = (D) => {
5070
+ D.preventDefault();
5071
+ }, F = async (D, A) => {
5072
+ D.preventDefault();
5073
+ const M = D.dataTransfer.getData("text/plain");
5074
+ M && (g((T) => {
5075
+ const C = f(T, M, A);
5076
5076
  return console.log("Reordered", C), k(C), s?.(C), C;
5077
- }), P(null), S(null));
5078
- }, B = () => {
5079
- P(null), S(null);
5080
- }, G = Array.isArray(m) ? m.filter(
5081
- (F) => F.categoryName?.toLowerCase().includes(I.toLowerCase())
5077
+ }), O(null), S(null));
5078
+ }, z = () => {
5079
+ O(null), S(null);
5080
+ }, q = Array.isArray(m) ? m.filter(
5081
+ (D) => D.categoryName?.toLowerCase().includes(B.toLowerCase())
5082
5082
  ) : [];
5083
5083
  return /* @__PURE__ */ l("div", { className: `manage-collection-list ${r}`, children: [
5084
5084
  /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ l("div", { className: "w-1/2 flex justify-end", children: [
5085
5085
  o && /* @__PURE__ */ e(
5086
5086
  he,
5087
5087
  {
5088
- value: I,
5089
- onDebouncedChange: z,
5088
+ value: B,
5089
+ onDebouncedChange: P,
5090
5090
  placeholder: "Search Collection",
5091
5091
  customClass: "mr-4 searchmanagecollection"
5092
5092
  }
@@ -5104,32 +5104,32 @@ const ma = () => {
5104
5104
  }
5105
5105
  )
5106
5106
  ] }) }),
5107
- /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: G.map((F) => {
5108
- const O = b === F.id, V = F?.links?.length ?? 0, T = $ === F.id, C = E === F.id && $ !== F.id;
5107
+ /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: q.map((D) => {
5108
+ const A = b === D.id, M = D?.links?.length ?? 0, T = $ === D.id, C = R === D.id && $ !== D.id;
5109
5109
  return /* @__PURE__ */ e(
5110
5110
  "div",
5111
5111
  {
5112
- onDragEnter: () => h(F.id),
5112
+ onDragEnter: () => h(D.id),
5113
5113
  onDragOver: x,
5114
- onDrop: (R) => D(R, F.id),
5115
- onDragEnd: B,
5114
+ onDrop: (I) => F(I, D.id),
5115
+ onDragEnd: z,
5116
5116
  className: [
5117
5117
  "flex items-center justify-between p-3 border rounded-2xl mb-3",
5118
5118
  "border-gray-300",
5119
5119
  C ? "ring-2 ring-gray-800/20" : "",
5120
5120
  T ? "opacity-60" : ""
5121
5121
  ].join(" "),
5122
- children: O ? /* @__PURE__ */ l(ee, { children: [
5122
+ children: A ? /* @__PURE__ */ l(ee, { children: [
5123
5123
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
5124
5124
  "input",
5125
5125
  {
5126
5126
  type: "text",
5127
5127
  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",
5128
5128
  value: a,
5129
- placeholder: F._temp ? "New collection name" : "Edit collection name",
5130
- onChange: (R) => w(R.target.value),
5131
- onKeyDown: (R) => {
5132
- R.key === "Enter" && v(), R.key === "Escape" && q();
5129
+ placeholder: D._temp ? "New collection name" : "Edit collection name",
5130
+ onChange: (I) => w(I.target.value),
5131
+ onKeyDown: (I) => {
5132
+ I.key === "Enter" && v(), I.key === "Escape" && j();
5133
5133
  },
5134
5134
  autoFocus: !0
5135
5135
  }
@@ -5139,7 +5139,7 @@ const ma = () => {
5139
5139
  "button",
5140
5140
  {
5141
5141
  className: "cursor-pointer border border-gray-300 p-2 rounded-2xl",
5142
- onClick: q,
5142
+ onClick: j,
5143
5143
  "aria-label": "Cancel edit",
5144
5144
  children: /* @__PURE__ */ e(ge, { color: "#767676" })
5145
5145
  }
@@ -5161,43 +5161,43 @@ const ma = () => {
5161
5161
  ] })
5162
5162
  ] }) : /* @__PURE__ */ l(ee, { children: [
5163
5163
  /* @__PURE__ */ l("div", { className: "flex gap-2 items-center", children: [
5164
- c && /* @__PURE__ */ e(
5164
+ i && /* @__PURE__ */ e(
5165
5165
  "span",
5166
5166
  {
5167
5167
  role: "button",
5168
5168
  "aria-label": "Drag to reorder",
5169
5169
  className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
5170
5170
  draggable: !0,
5171
- onDragStart: (R) => d(R, F.id),
5171
+ onDragStart: (I) => d(I, D.id),
5172
5172
  children: /* @__PURE__ */ e(ea, {})
5173
5173
  }
5174
5174
  ),
5175
- /* @__PURE__ */ e("span", { children: F.categoryName })
5175
+ /* @__PURE__ */ e("span", { children: D.categoryName })
5176
5176
  ] }),
5177
5177
  /* @__PURE__ */ l("div", { className: "flex gap-2 items-center", children: [
5178
- F.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: F.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${V} ${V === 1 ? "link" : "links"}` }),
5178
+ D.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: D.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${M} ${M === 1 ? "link" : "links"}` }),
5179
5179
  u && /* @__PURE__ */ e(
5180
5180
  "button",
5181
5181
  {
5182
5182
  className: "cursor-pointer",
5183
- onClick: () => M(F),
5184
- "aria-label": `Edit ${F.categoryName}`,
5183
+ onClick: () => V(D),
5184
+ "aria-label": `Edit ${D.categoryName}`,
5185
5185
  children: /* @__PURE__ */ e(_t, { color: "#767676" })
5186
5186
  }
5187
5187
  ),
5188
- i && /* @__PURE__ */ e(
5188
+ c && /* @__PURE__ */ e(
5189
5189
  "span",
5190
5190
  {
5191
- className: V === 0 && !F.protected ? "cursor-pointer" : "cursor-not-allowed",
5192
- title: V === 0 && !F.protected ? "Delete" : "Cannot delete this collection",
5193
- onClick: V === 0 ? () => p(F) : null,
5194
- children: /* @__PURE__ */ e(Pe, { color: V === 0 ? "#767676" : "#C2C2C2" })
5191
+ className: M === 0 && !D.protected ? "cursor-pointer" : "cursor-not-allowed",
5192
+ title: M === 0 && !D.protected ? "Delete" : "Cannot delete this collection",
5193
+ onClick: M === 0 ? () => p(D) : null,
5194
+ children: /* @__PURE__ */ e(Pe, { color: M === 0 ? "#767676" : "#C2C2C2" })
5195
5195
  }
5196
5196
  )
5197
5197
  ] })
5198
5198
  ] })
5199
5199
  },
5200
- F.id
5200
+ D.id
5201
5201
  );
5202
5202
  }) })
5203
5203
  ] });
@@ -5206,14 +5206,14 @@ const ma = () => {
5206
5206
  label: o = "Manage Collections",
5207
5207
  description: n = "",
5208
5208
  endpoints: u = {},
5209
- initialData: i = null,
5210
- showSearch: c = !0,
5209
+ initialData: c = null,
5210
+ showSearch: i = !0,
5211
5211
  allowAdd: y = !0,
5212
5212
  allowEdit: b = !0,
5213
5213
  allowDelete: N = !0,
5214
5214
  allowReorder: a = !0,
5215
5215
  className: w = ""
5216
- } = t, m = r?.[t.key] || i || [], g = Array.isArray(m) ? m : [];
5216
+ } = t, m = r?.[t.key] || c || [], g = Array.isArray(m) ? m : [];
5217
5217
  return /* @__PURE__ */ l("div", { className: "dynamic-config-manage-collection-list", children: [
5218
5218
  (o || n) && /* @__PURE__ */ l("div", { className: "mb-4", children: [
5219
5219
  o && /* @__PURE__ */ e("h3", { className: "text-lg font-medium text-gray-900 mb-1", children: o }),
@@ -5225,10 +5225,10 @@ const ma = () => {
5225
5225
  endpoints: u,
5226
5226
  initialData: g,
5227
5227
  className: w,
5228
- onCollectionChange: (P) => {
5229
- s && s(t.key, P);
5228
+ onCollectionChange: (O) => {
5229
+ s && s(t.key, O);
5230
5230
  },
5231
- showSearch: c,
5231
+ showSearch: i,
5232
5232
  allowAdd: y,
5233
5233
  allowEdit: b,
5234
5234
  allowDelete: N,
@@ -5241,7 +5241,7 @@ const ma = () => {
5241
5241
  " ",
5242
5242
  /* @__PURE__ */ e("span", { className: "font-mono", children: String(t?.type ?? "N/A") })
5243
5243
  ] }), xe = /* @__PURE__ */ Object.create(null);
5244
- xe.section = $n;
5244
+ xe.section = Fn;
5245
5245
  xe.datatable = An;
5246
5246
  xe.managecollectionlist = Xa;
5247
5247
  xe["manage-collection-list"] = Xa;
@@ -5259,36 +5259,36 @@ function Bn({
5259
5259
  onCancel: o,
5260
5260
  onSave: n
5261
5261
  }) {
5262
- const [u, i] = re.useState(r), [c, y] = re.useState(null), [b, N] = L(!1), [a, w] = L(!1), [m, g] = L({}), $ = `${be()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, P = $, [E, S] = L(1), I = (f) => {
5262
+ const [u, c] = re.useState(r), [i, y] = re.useState(null), [b, N] = L(!1), [a, w] = L(!1), [m, g] = L({}), $ = `${be()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, O = $, [R, S] = L(1), B = (f) => {
5263
5263
  if (!r || !r.configuration)
5264
5264
  return f;
5265
5265
  const k = {}, d = f?.configuration || {};
5266
5266
  return r.configuration.forEach((h) => {
5267
- if (h.key && h.type === "datatable" && h.key === "newsFeeds") {
5268
- const D = (d.newsFeeds || []).map((B, G) => {
5269
- let F = { users: [], groups: [], roles: [] };
5270
- return B.audience && (Array.isArray(B.audience) ? F = { users: [], groups: [], roles: [] } : typeof B.audience == "object" && (F = {
5271
- users: B.audience.users || [],
5272
- groups: B.audience.groups || [],
5273
- roles: B.audience.roles || []
5274
- })), {
5275
- id: B.id || 0,
5276
- category: B.category || "",
5277
- url: B.url || "",
5278
- // Keep as 'url' to match config.json
5279
- audience: F
5280
- };
5267
+ if (h.key && h.type === "datatable") {
5268
+ const F = (d[h.key] || []).map((z, q) => {
5269
+ const D = { id: z.id || 0 };
5270
+ return h.fields && h.fields.forEach((A) => {
5271
+ if (A.fieldtype === "audience") {
5272
+ let M = { users: [], groups: [], roles: [] };
5273
+ z[A.key] && (Array.isArray(z[A.key]) ? M = { users: [], groups: [], roles: [] } : typeof z[A.key] == "object" && (M = {
5274
+ users: z[A.key].users || [],
5275
+ groups: z[A.key].groups || [],
5276
+ roles: z[A.key].roles || []
5277
+ })), D[A.key] = M;
5278
+ } else
5279
+ D[A.key] = z[A.key] || A.default || "";
5280
+ }), D;
5281
5281
  });
5282
- if (D.length === 0) {
5283
- const B = { id: 0 };
5284
- h.fields && h.fields.forEach((G) => {
5285
- G.fieldtype === "audience" ? B[G.key] = { users: [], groups: [], roles: [] } : B[G.key] = G.default || "";
5286
- }), D.push(B);
5282
+ if (F.length === 0) {
5283
+ const z = { id: 0 };
5284
+ h.fields && h.fields.forEach((q) => {
5285
+ q.fieldtype === "audience" ? z[q.key] = { users: [], groups: [], roles: [] } : z[q.key] = q.default || "";
5286
+ }), F.push(z);
5287
5287
  }
5288
- k[h.key] = D;
5288
+ k[h.key] = F;
5289
5289
  } else h.key && (k[h.key] = d[h.key] || {});
5290
5290
  }), k;
5291
- }, z = () => {
5291
+ }, P = () => {
5292
5292
  if (r && r.configuration) {
5293
5293
  const f = {};
5294
5294
  r.configuration.forEach((k) => {
@@ -5316,12 +5316,12 @@ function Bn({
5316
5316
  const f = async () => {
5317
5317
  try {
5318
5318
  N(!0);
5319
- let k = await Fe($);
5319
+ let k = await $e($);
5320
5320
  if (k) {
5321
- const d = I(k);
5321
+ const d = B(k);
5322
5322
  y(d);
5323
5323
  } else
5324
- z();
5324
+ P();
5325
5325
  } catch (k) {
5326
5326
  console.error("Error fetching configuration:", k);
5327
5327
  let d = "Failed to load configuration";
@@ -5329,14 +5329,14 @@ function Bn({
5329
5329
  const h = k.response.status, x = k.response.data?.message || k.response.data?.error;
5330
5330
  h === 400 ? d = x || "Invalid request. Please check the application ID." : h === 401 ? d = "You are not authorized to access this configuration." : h === 403 ? d = "Access denied. You don't have permission to view this configuration." : h === 404 ? d = "Configuration not found. It may not exist yet or the application ID is incorrect." : h >= 500 ? d = x || "Server error. Please try again later." : d = x || `Failed to load configuration (Error ${h})`;
5331
5331
  } else k.request ? d = "Network error. Please check your connection and try again." : d = k.message || "An unexpected error occurred while loading configuration.";
5332
- ve.error(d), z();
5332
+ ve.error(d), P();
5333
5333
  } finally {
5334
5334
  N(!1);
5335
5335
  }
5336
5336
  };
5337
- r && (i(r), t ? f() : z());
5338
- }, [r, E, t, s]);
5339
- const A = (f, k) => {
5337
+ r && (c(r), t ? f() : P());
5338
+ }, [r, R, t, s]);
5339
+ const E = (f, k) => {
5340
5340
  y((d) => ({
5341
5341
  ...d,
5342
5342
  [f]: k
@@ -5344,36 +5344,36 @@ function Bn({
5344
5344
  const h = { ...d };
5345
5345
  return h[f] && delete h[f], h;
5346
5346
  });
5347
- }, M = () => {
5347
+ }, V = () => {
5348
5348
  const f = {};
5349
- return !u || !c || u.configuration.forEach((k) => {
5349
+ return !u || !i || u.configuration.forEach((k) => {
5350
5350
  if (k.type === "section")
5351
5351
  k.fields.forEach((d) => {
5352
5352
  if (d.required) {
5353
- const h = c[k.key]?.[d.key];
5353
+ const h = i[k.key]?.[d.key];
5354
5354
  (!h || typeof h == "string" && h.trim() === "") && (f[k.key] || (f[k.key] = {}), f[k.key][d.key] = `${d.label} is required`);
5355
5355
  }
5356
5356
  });
5357
5357
  else if (k.type === "datatable") {
5358
- const d = c[k.key];
5358
+ const d = i[k.key];
5359
5359
  Array.isArray(d) && d.forEach((h, x) => {
5360
- k.fields.forEach((D) => {
5361
- if (D.required) {
5362
- const B = h[D.key];
5363
- (!B || typeof B == "string" && B.trim() === "") && (f[k.key] || (f[k.key] = {}), f[k.key][x] || (f[k.key][x] = {}), f[k.key][x][D.key] = `${D.label} is required`);
5360
+ k.fields.forEach((F) => {
5361
+ if (F.required) {
5362
+ const z = h[F.key];
5363
+ (!z || typeof z == "string" && z.trim() === "") && (f[k.key] || (f[k.key] = {}), f[k.key][x] || (f[k.key][x] = {}), f[k.key][x][F.key] = `${F.label} is required`);
5364
5364
  }
5365
5365
  });
5366
5366
  });
5367
5367
  }
5368
5368
  }), f;
5369
- }, U = (f) => Object.keys(f).length > 0, q = () => {
5370
- const f = M();
5369
+ }, U = (f) => Object.keys(f).length > 0, j = () => {
5370
+ const f = V();
5371
5371
  if (g(f), U(f)) {
5372
5372
  let d = [];
5373
5373
  Object.keys(f).forEach((h) => {
5374
5374
  typeof f[h] == "object" && Object.keys(f[h]).forEach((x) => {
5375
- typeof f[h][x] == "object" ? Object.keys(f[h][x]).forEach((D) => {
5376
- d.push(`${h} row ${parseInt(x) + 1}: ${f[h][x][D]}`);
5375
+ typeof f[h][x] == "object" ? Object.keys(f[h][x]).forEach((F) => {
5376
+ d.push(`${h} row ${parseInt(x) + 1}: ${f[h][x][F]}`);
5377
5377
  }) : d.push(`${h}: ${f[h][x]}`);
5378
5378
  });
5379
5379
  });
@@ -5383,27 +5383,30 @@ function Bn({
5383
5383
  try {
5384
5384
  w(!0);
5385
5385
  const d = {};
5386
- c && Object.keys(c).forEach((x) => {
5387
- x === "newsFeeds" && Array.isArray(c[x]) ? d[x] = c[x].map((D) => {
5388
- let B = { users: [], groups: [], roles: [] };
5389
- return D.audience && typeof D.audience == "object" && !Array.isArray(D.audience) && (B = {
5390
- users: D.audience.users || [],
5391
- groups: D.audience.groups || [],
5392
- roles: D.audience.roles || []
5393
- }), {
5394
- id: D.id || 0,
5395
- category: D.category || "",
5396
- url: D.url || "",
5397
- // Keep as 'url' to match API and config
5398
- audience: B
5399
- };
5400
- }) : d[x] = c[x];
5386
+ i && Object.keys(i).forEach((x) => {
5387
+ const F = r?.configuration?.find(
5388
+ (z) => z.key === x && z.type === "datatable"
5389
+ );
5390
+ F && Array.isArray(i[x]) ? d[x] = i[x].map((z) => {
5391
+ const q = { id: z.id || 0 };
5392
+ return F.fields && F.fields.forEach((D) => {
5393
+ if (D.fieldtype === "audience") {
5394
+ let A = { users: [], groups: [], roles: [] };
5395
+ z[D.key] && typeof z[D.key] == "object" && !Array.isArray(z[D.key]) && (A = {
5396
+ users: z[D.key].users || [],
5397
+ groups: z[D.key].groups || [],
5398
+ roles: z[D.key].roles || []
5399
+ }), q[D.key] = A;
5400
+ } else
5401
+ q[D.key] = z[D.key] || "";
5402
+ }), q;
5403
+ }) : d[x] = i[x];
5401
5404
  });
5402
- let h = await $e(P, d);
5405
+ let h = await Fe(O, d);
5403
5406
  if (console.log(), h && h.status != "fail") {
5404
5407
  g({});
5405
5408
  const x = h.message || "Configuration has been saved successfully";
5406
- ve.success(x), n && typeof n == "function" && n(c);
5409
+ ve.success(x), n && typeof n == "function" && n(i);
5407
5410
  } else
5408
5411
  throw ve.error(h?.message || "Failed to save configuration"), new Error("No response received from server");
5409
5412
  } catch (d) {
@@ -5425,7 +5428,7 @@ function Bn({
5425
5428
  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" }) });
5426
5429
  const p = r?.configuration || u?.configuration;
5427
5430
  return Q(() => {
5428
- s && r ? (!c || Object.keys(c).length === 0) && z() : s && !r && z();
5431
+ s && r ? (!i || Object.keys(i).length === 0) && P() : s && !r && P();
5429
5432
  }, [s, r]), /* @__PURE__ */ l("div", { children: [
5430
5433
  /* @__PURE__ */ l(
5431
5434
  "div",
@@ -5441,8 +5444,8 @@ function Bn({
5441
5444
  d,
5442
5445
  {
5443
5446
  item: f,
5444
- data: c,
5445
- updateHandler: A,
5447
+ data: i,
5448
+ updateHandler: E,
5446
5449
  validationErrors: m
5447
5450
  },
5448
5451
  k
@@ -5465,7 +5468,7 @@ function Bn({
5465
5468
  Z,
5466
5469
  {
5467
5470
  category: "primary",
5468
- onClick: q,
5471
+ onClick: j,
5469
5472
  disabled: a,
5470
5473
  label: a ? "Saving..." : "Apply",
5471
5474
  type: "submit"
@@ -5479,7 +5482,7 @@ const us = ({
5479
5482
  appid: r = "Configuration-Page",
5480
5483
  disableApi: s = !1
5481
5484
  }) => {
5482
- const [o, n] = L(0), [u, i] = L(!1), [c, y] = L(r), {
5485
+ const [o, n] = L(0), [u, c] = L(!1), [i, y] = L(r), {
5483
5486
  pageHeader: b = {},
5484
5487
  appletHeader: N = {},
5485
5488
  breadcrumb: a = [],
@@ -5497,7 +5500,7 @@ const us = ({
5497
5500
  disabled: !0,
5498
5501
  placeholder: r
5499
5502
  }, f.some((x) => x.key === "displayname")) {
5500
- const x = f.findIndex((D) => D.key === "displayname");
5503
+ const x = f.findIndex((F) => F.key === "displayname");
5501
5504
  f[x] = {
5502
5505
  ...f[x],
5503
5506
  default: r,
@@ -5528,14 +5531,14 @@ const us = ({
5528
5531
  isLeftArrow: !0,
5529
5532
  onBackClick: () => window.history.back(),
5530
5533
  ...b
5531
- }, P = a.map((p) => ({
5534
+ }, O = a.map((p) => ({
5532
5535
  label: p.text,
5533
5536
  href: p.href || "#"
5534
- })), E = K(() => {
5535
- console.log("handleCancelRequest called - showing modal"), i(!0);
5537
+ })), R = K(() => {
5538
+ console.log("handleCancelRequest called - showing modal"), c(!0);
5536
5539
  }, []), S = K((p) => {
5537
- i(!1), p.primary ? (console.log("User confirmed cancel - navigating back"), window.history.back()) : console.log("User cancelled the cancel action - modal closed, data preserved");
5538
- }, []), I = () => {
5540
+ c(!1), p.primary ? (console.log("User confirmed cancel - navigating back"), window.history.back()) : console.log("User cancelled the cancel action - modal closed, data preserved");
5541
+ }, []), B = () => {
5539
5542
  for (const p of g)
5540
5543
  if (p.type === "section" && p.fields) {
5541
5544
  const f = p.fields.find((k) => k.key === "displayname");
@@ -5545,20 +5548,20 @@ const us = ({
5545
5548
  return r;
5546
5549
  };
5547
5550
  re.useEffect(() => {
5548
- y(I());
5551
+ y(B());
5549
5552
  }, [g]);
5550
- const z = K((p) => {
5553
+ const P = K((p) => {
5551
5554
  console.log("Config saved with data:", p), Object.keys(p).forEach((f) => {
5552
5555
  const k = p[f];
5553
5556
  console.log(`Checking section ${f}:`, k), k && k.displayname && (console.log("Found displayname:", k.displayname), y(k.displayname));
5554
5557
  });
5555
- }, []), A = {
5558
+ }, []), E = {
5556
5559
  subHeading: "Application configuration and details",
5557
5560
  tags: [],
5558
5561
  ...N,
5559
- heading: c
5562
+ heading: i
5560
5563
  // Ensure displayname always overrides config heading
5561
- }, M = {
5564
+ }, V = {
5562
5565
  about: "This application provides comprehensive functionality for your organization.",
5563
5566
  images: {
5564
5567
  desktop: "https://via.placeholder.com/600x400?text=Desktop+View",
@@ -5577,10 +5580,10 @@ const us = ({
5577
5580
  ],
5578
5581
  ...w
5579
5582
  }, U = [
5580
- { label: "Overview", content: v(M) },
5581
- { label: "Configuration", content: /* @__PURE__ */ e(Bn, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: E, onSave: z }) }
5583
+ { label: "Overview", content: v(V) },
5584
+ { label: "Configuration", content: /* @__PURE__ */ e(Bn, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: R, onSave: P }) }
5582
5585
  ];
5583
- function q(p) {
5586
+ function j(p) {
5584
5587
  return p ? p.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: p } }) : p : "📱";
5585
5588
  }
5586
5589
  function v(p) {
@@ -5630,18 +5633,18 @@ const us = ({
5630
5633
  Qr,
5631
5634
  {
5632
5635
  heading: $.heading,
5633
- subHeading: P.length > 0 ? void 0 : $.subHeading,
5634
- breadcrumbItems: P,
5636
+ subHeading: O.length > 0 ? void 0 : $.subHeading,
5637
+ breadcrumbItems: O,
5635
5638
  isLeftArrow: $.isLeftArrow,
5636
5639
  onBackClick: $.onBackClick
5637
5640
  }
5638
5641
  ),
5639
5642
  /* @__PURE__ */ l("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
5640
- /* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: q(A.icon) }),
5643
+ /* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: j(E.icon) }),
5641
5644
  /* @__PURE__ */ l("div", { className: "flex flex-col min-w-0", children: [
5642
- /* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: A.heading }),
5643
- /* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: A.subHeading }),
5644
- /* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: A.tags && A.tags.map((p, f) => /* @__PURE__ */ e(
5645
+ /* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: E.heading }),
5646
+ /* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: E.subHeading }),
5647
+ /* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: E.tags && E.tags.map((p, f) => /* @__PURE__ */ e(
5645
5648
  "span",
5646
5649
  {
5647
5650
  className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
@@ -5712,8 +5715,8 @@ const hs = ({
5712
5715
  apiRef: n,
5713
5716
  // preferred
5714
5717
  onAdd: u,
5715
- onFilterOpen: i,
5716
- addBtnText: c = "Add",
5718
+ onFilterOpen: c,
5719
+ addBtnText: i = "Add",
5717
5720
  // Feature toggles
5718
5721
  showSearch: y = !0,
5719
5722
  showColumnChooser: b = !0,
@@ -5724,30 +5727,30 @@ const hs = ({
5724
5727
  showRefresh: g = !1,
5725
5728
  showAdd: $ = !1,
5726
5729
  // Additional props
5727
- searchPlaceholder: P = "Search...",
5728
- handleRefreshClick: E = () => {
5730
+ searchPlaceholder: O = "Search...",
5731
+ handleRefreshClick: R = () => {
5729
5732
  },
5730
5733
  handleSearchChange: S = () => {
5731
5734
  },
5732
5735
  // Optional: override export file names
5733
- excelFileName: I,
5734
- pdfFileName: z
5736
+ excelFileName: B,
5737
+ pdfFileName: P
5735
5738
  }) => {
5736
- const A = () => n?.current || o?.current, [M, U] = re.useState(""), q = (t || "export").toString().trim() || "export", v = `${I || q}.xlsx`, p = `${z || q}.pdf`, f = (h, x, D) => Math.max(x, Math.min(h, D)), k = K(
5739
+ const E = () => n?.current || o?.current, [V, U] = re.useState(""), j = (t || "export").toString().trim() || "export", v = `${B || j}.xlsx`, p = `${P || j}.pdf`, f = (h, x, F) => Math.max(x, Math.min(h, F)), k = K(
5737
5740
  (h) => {
5738
- const x = A();
5741
+ const x = E();
5739
5742
  if (console.log("openColumnChooserNear", x), !!x?.openColumnChooser) {
5740
5743
  if (typeof window > "u" || !h?.currentTarget) {
5741
5744
  x.openColumnChooser();
5742
5745
  return;
5743
5746
  }
5744
5747
  try {
5745
- const D = h.currentTarget.getBoundingClientRect(), B = D.left + window.scrollX, G = D.bottom + window.scrollY;
5746
- let F = B - 120, O = G - 120;
5747
- const V = window.innerWidth, T = window.innerHeight;
5748
- F = f(F, window.scrollX + 8, window.scrollX + V - 340), O = f(O, window.scrollY, window.scrollY + T - 120), console.log("openColumnChooserNear", F, O), x.openColumnChooser(F, O);
5749
- } catch (D) {
5750
- console.log("coloumn choose error", D);
5748
+ const F = h.currentTarget.getBoundingClientRect(), z = F.left + window.scrollX, q = F.bottom + window.scrollY;
5749
+ let D = z - 120, A = q - 120;
5750
+ const M = window.innerWidth, T = window.innerHeight;
5751
+ D = f(D, window.scrollX + 8, window.scrollX + M - 340), A = f(A, window.scrollY, window.scrollY + T - 120), console.log("openColumnChooserNear", D, A), x.openColumnChooser(D, A);
5752
+ } catch (F) {
5753
+ console.log("coloumn choose error", F);
5751
5754
  }
5752
5755
  }
5753
5756
  },
@@ -5755,27 +5758,27 @@ const hs = ({
5755
5758
  // no external deps; reads ref at call time
5756
5759
  ), d = K(
5757
5760
  (h, x) => {
5758
- const D = A();
5759
- if (D)
5761
+ const F = E();
5762
+ if (F)
5760
5763
  switch (h) {
5761
5764
  case "ColumnChooser":
5762
- b && (console.log("openColumnChooser", x), x ? k(x) : D.openColumnChooser?.()), console.log("openColumnChooser out", x);
5765
+ b && (console.log("openColumnChooser", x), x ? k(x) : F.openColumnChooser?.()), console.log("openColumnChooser out", x);
5763
5766
  break;
5764
5767
  case "Print":
5765
- a && D.print?.();
5768
+ a && F.print?.();
5766
5769
  break;
5767
5770
  case "Excel":
5768
- w && D.excelExport?.({ fileName: v });
5771
+ w && F.excelExport?.({ fileName: v });
5769
5772
  break;
5770
5773
  case "Pdf":
5771
- m && D.pdfExport?.({ fileName: p });
5774
+ m && F.pdfExport?.({ fileName: p });
5772
5775
  break;
5773
5776
  case "Refresh":
5774
- g && E();
5777
+ g && R();
5775
5778
  break;
5776
5779
  }
5777
5780
  },
5778
- [b, a, w, m, g, v, p, E, k]
5781
+ [b, a, w, m, g, v, p, R, k]
5779
5782
  );
5780
5783
  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: [
5781
5784
  /* @__PURE__ */ l("div", { className: "flex flex-col", children: [
@@ -5790,8 +5793,8 @@ const hs = ({
5790
5793
  y && /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
5791
5794
  he,
5792
5795
  {
5793
- placeholder: P,
5794
- value: M,
5796
+ placeholder: O,
5797
+ value: V,
5795
5798
  onDebouncedChange: (h) => {
5796
5799
  U(h), S(h);
5797
5800
  }
@@ -5814,7 +5817,7 @@ const hs = ({
5814
5817
  Z,
5815
5818
  {
5816
5819
  icon: Wt,
5817
- onClick: i,
5820
+ onClick: c,
5818
5821
  size: "small",
5819
5822
  ariaLabel: "Filters",
5820
5823
  category: "secondary",
@@ -5869,12 +5872,12 @@ const hs = ({
5869
5872
  $ && u && /* @__PURE__ */ e(
5870
5873
  Z,
5871
5874
  {
5872
- label: c,
5875
+ label: i,
5873
5876
  icon: Ht,
5874
5877
  onClick: u,
5875
5878
  size: "small",
5876
5879
  ariaLabel: "Add New",
5877
- title: c
5880
+ title: i
5878
5881
  }
5879
5882
  )
5880
5883
  ] })
@@ -5889,8 +5892,8 @@ function ps(t) {
5889
5892
  pageIndex: n = 1,
5890
5893
  // 1-based
5891
5894
  pageSize: u = 10,
5892
- allowPaging: i = !0,
5893
- allowSorting: c = !0,
5895
+ allowPaging: c = !0,
5896
+ allowSorting: i = !0,
5894
5897
  allowFiltering: y = !1,
5895
5898
  allowGrouping: b = !1,
5896
5899
  allowReordering: N = !0,
@@ -5899,15 +5902,15 @@ function ps(t) {
5899
5902
  allowPdfExport: m = !1,
5900
5903
  showColumnChooser: g = !1,
5901
5904
  enableSearchApi: $ = !1,
5902
- height: P = "600",
5903
- selectionSettings: E = { type: "Multiple", mode: "Row" },
5905
+ height: O = "600",
5906
+ selectionSettings: R = { type: "Multiple", mode: "Row" },
5904
5907
  enableCheckbox: S = !1,
5905
- columns: I = [],
5906
- onGridStateChange: z,
5907
- onRowSelected: A,
5908
- onRowDeselected: M,
5908
+ columns: B = [],
5909
+ onGridStateChange: P,
5910
+ onRowSelected: E,
5911
+ onRowDeselected: V,
5909
5912
  onRowDoubleClick: U,
5910
- apiRef: q,
5913
+ apiRef: j,
5911
5914
  gridProps: v = {}
5912
5915
  } = t, p = ue(null), {
5913
5916
  pageSettings: f,
@@ -5915,62 +5918,62 @@ function ps(t) {
5915
5918
  ...d
5916
5919
  } = v || {}, h = ne(() => {
5917
5920
  const C = [wr];
5918
- return c && C.push(Cr), y && C.push(Sr), b && C.push(Dr), $ && C.push(Fr), w && C.push($r), m && C.push(Tr), g && C.push(Ar), a && C.push(Er), N && C.push(Rr), C.push(Ir), C;
5919
- }, [c, y, b, $, w, m, g, a, N]), x = ne(() => {
5920
- const C = () => p.current, R = (j, H) => {
5921
- !H && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${j} requested but related service/feature is disabled.`);
5921
+ return i && C.push(Cr), y && C.push(Sr), b && C.push(Dr), $ && C.push($r), w && C.push(Fr), m && C.push(Tr), g && C.push(Ar), a && C.push(Er), N && C.push(Rr), C.push(Ir), C;
5922
+ }, [i, y, b, $, w, m, g, a, N]), x = ne(() => {
5923
+ const C = () => p.current, I = (G, H) => {
5924
+ !H && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${G} requested but related service/feature is disabled.`);
5922
5925
  };
5923
5926
  return {
5924
5927
  getInstance: () => C(),
5925
5928
  refresh: () => C()?.refresh?.(),
5926
5929
  getSelectedRecords: () => C()?.getSelectedRecords?.() ?? [],
5927
5930
  clearSelection: () => C()?.clearSelection?.(),
5928
- selectRow: (j) => C()?.selectRow?.(j),
5929
- selectRows: (j) => C()?.selectRows?.(j),
5930
- search: (j) => {
5931
- R("search()", $), C()?.search?.(j);
5931
+ selectRow: (G) => C()?.selectRow?.(G),
5932
+ selectRows: (G) => C()?.selectRows?.(G),
5933
+ search: (G) => {
5934
+ I("search()", $), C()?.search?.(G);
5932
5935
  },
5933
5936
  print: () => C()?.print?.(),
5934
- excelExport: (j) => {
5935
- R("excelExport()", w), C()?.excelExport?.(j);
5937
+ excelExport: (G) => {
5938
+ I("excelExport()", w), C()?.excelExport?.(G);
5936
5939
  },
5937
- pdfExport: (j) => {
5938
- R("pdfExport()", m), C()?.pdfExport?.(j);
5940
+ pdfExport: (G) => {
5941
+ I("pdfExport()", m), C()?.pdfExport?.(G);
5939
5942
  },
5940
- openColumnChooser: (j, H) => {
5941
- R("openColumnChooser()", g), C()?.columnChooserModule?.openColumnChooser?.(j, H);
5943
+ openColumnChooser: (G, H) => {
5944
+ I("openColumnChooser()", g), C()?.columnChooserModule?.openColumnChooser?.(G, H);
5942
5945
  }
5943
5946
  };
5944
5947
  }, []);
5945
5948
  Q(() => {
5946
- q && (q.current = x);
5947
- }, [q, x]), Q(() => () => {
5948
- q && (q.current = null);
5949
+ j && (j.current = x);
5950
+ }, [j, x]), Q(() => () => {
5951
+ j && (j.current = null);
5949
5952
  }, []);
5950
- const D = (C) => {
5951
- const R = String(C || "");
5952
- return R === "Ascending" || R === "Descending" ? R : R.toLowerCase() === "ascending" ? "Ascending" : "Descending";
5953
- }, B = ne(() => ({
5953
+ const F = (C) => {
5954
+ const I = String(C || "");
5955
+ return I === "Ascending" || I === "Descending" ? I : I.toLowerCase() === "ascending" ? "Ascending" : "Descending";
5956
+ }, z = ne(() => ({
5954
5957
  pageSize: u,
5955
5958
  currentPage: n,
5956
5959
  totalRecordsCount: s,
5957
5960
  pageSizes: !0,
5958
5961
  ...f || {}
5959
- }), [n, u, s, f]), G = ne(() => {
5960
- if (!c || !k) return;
5961
- const C = (k.columns || []).map((R) => ({
5962
- ...R,
5963
- direction: D(R.direction || R.dir)
5962
+ }), [n, u, s, f]), q = ne(() => {
5963
+ if (!i || !k) return;
5964
+ const C = (k.columns || []).map((I) => ({
5965
+ ...I,
5966
+ direction: F(I.direction || I.dir)
5964
5967
  }));
5965
5968
  return { allowUnsort: !0, ...k, columns: C };
5966
- }, [k, c]), F = (C) => {
5967
- const R = p.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 ?? R?.pageSettings?.pageSize ?? u, ce = C?.currentPage ?? R?.pageSettings?.currentPage ?? n, je = C?.columnName && C?.direction ? [{ field: C.columnName, dir: D(C.direction) }] : (R?.sortSettings?.columns || []).map((Ce) => ({
5969
+ }, [k, i]), D = (C) => {
5970
+ const I = p.current, G = C?.requestType, H = G === "paging" ? "paging" : G === "sorting" ? "sorting" : G === "searching" ? "searching" : G === "filtering" ? "filtering" : G === "grouping" ? "grouping" : G === "reorder" ? "reorder" : G === "columnstate" ? "columnstate" : "other", ce = C?.pageSize ?? I?.pageSettings?.pageSize ?? u, ie = C?.currentPage ?? I?.pageSettings?.currentPage ?? n, je = C?.columnName && C?.direction ? [{ field: C.columnName, dir: F(C.direction) }] : (I?.sortSettings?.columns || []).map((Ce) => ({
5968
5971
  field: Ce.field,
5969
- dir: D(Ce.direction ?? Ce.dir)
5970
- })), Ge = C?.searchString ?? "", _e = C?.columns ?? R?.filterSettings?.columns ?? [];
5972
+ dir: F(Ce.direction ?? Ce.dir)
5973
+ })), Ge = C?.searchString ?? "", _e = C?.columns ?? I?.filterSettings?.columns ?? [];
5971
5974
  return {
5972
5975
  reason: H,
5973
- page: { index: ce, size: ie, skip: (ce - 1) * ie, take: ie },
5976
+ page: { index: ie, size: ce, skip: (ie - 1) * ce, take: ce },
5974
5977
  sort: je,
5975
5978
  // [{ field, dir: 'Ascending'|'Descending' }]
5976
5979
  search: Ge,
@@ -5984,25 +5987,25 @@ function ps(t) {
5984
5987
  id: o,
5985
5988
  ref: p,
5986
5989
  dataSource: r,
5987
- height: P,
5988
- allowPaging: i,
5989
- allowSorting: c,
5990
+ height: O,
5991
+ allowPaging: c,
5992
+ allowSorting: i,
5990
5993
  allowFiltering: y,
5991
5994
  allowGrouping: b,
5992
5995
  allowReordering: N,
5993
5996
  allowResizing: a,
5994
5997
  showColumnChooser: g,
5995
- selectionSettings: E,
5996
- pageSettings: B,
5997
- sortSettings: G,
5998
+ selectionSettings: R,
5999
+ pageSettings: z,
6000
+ sortSettings: q,
5998
6001
  actionBegin: (C) => {
5999
- if (["paging", "sorting", "searching", "filtering", "grouping", "reorder", "columnstate"].includes(C?.requestType) && (C.cancel = !0), typeof z == "function") {
6000
- const j = F(C);
6001
- z(j, C);
6002
+ if (["paging", "sorting", "searching", "filtering", "grouping", "reorder", "columnstate"].includes(C?.requestType) && (C.cancel = !0), typeof P == "function") {
6003
+ const G = D(C);
6004
+ P(G, C);
6002
6005
  }
6003
6006
  },
6004
- rowSelected: A,
6005
- rowDeselected: M,
6007
+ rowSelected: E,
6008
+ rowDeselected: V,
6006
6009
  recordDoubleClick: (C) => {
6007
6010
  typeof U == "function" && U(C?.rowData, C);
6008
6011
  },
@@ -6010,11 +6013,11 @@ function ps(t) {
6010
6013
  children: [
6011
6014
  /* @__PURE__ */ e(Br, { children: (() => {
6012
6015
  const C = [];
6013
- return S && C.push(/* @__PURE__ */ e(ra, { type: "checkbox", width: "50" }, "__checkbox__")), I.forEach((R, j) => {
6016
+ return S && C.push(/* @__PURE__ */ e(ra, { type: "checkbox", width: "50" }, "__checkbox__")), B.forEach((I, G) => {
6014
6017
  const {
6015
6018
  field: H,
6016
- headerText: ie,
6017
- width: ce,
6019
+ headerText: ce,
6020
+ width: ie,
6018
6021
  textAlign: je = "Left",
6019
6022
  template: Ge,
6020
6023
  isPrimaryKey: _e,
@@ -6028,14 +6031,14 @@ function ps(t) {
6028
6031
  maxWidth: rt,
6029
6032
  customAttributes: nt,
6030
6033
  ...st
6031
- } = R || {};
6034
+ } = I || {};
6032
6035
  C.push(
6033
6036
  /* @__PURE__ */ e(
6034
6037
  ra,
6035
6038
  {
6036
6039
  field: H,
6037
- headerText: ie,
6038
- width: ce,
6040
+ headerText: ce,
6041
+ width: ie,
6039
6042
  textAlign: je,
6040
6043
  template: Ge,
6041
6044
  isPrimaryKey: _e,
@@ -6050,7 +6053,7 @@ function ps(t) {
6050
6053
  customAttributes: nt,
6051
6054
  ...st
6052
6055
  },
6053
- H || `col-${j}`
6056
+ H || `col-${G}`
6054
6057
  )
6055
6058
  );
6056
6059
  }), C;
@@ -6069,7 +6072,7 @@ export {
6069
6072
  Vr as Button,
6070
6073
  Aa as Checkbox,
6071
6074
  ps as CustomDataGrid,
6072
- is as CustomDialog,
6075
+ cs as CustomDialog,
6073
6076
  hs as CustomGridToolbar,
6074
6077
  ds as CustomTab,
6075
6078
  za as DatePicker,
@@ -6096,14 +6099,14 @@ export {
6096
6099
  ms as ToastProvider,
6097
6100
  Ma as ToggleSwitch,
6098
6101
  es as Tooltip,
6099
- cs as TreeView,
6102
+ is as TreeView,
6100
6103
  Z as UnifyedCoreButton,
6101
6104
  as as WizardModal,
6102
6105
  Ga as adGroupsListSearchApi,
6103
6106
  sn as axiosDelete,
6104
- Fe as axiosGet,
6107
+ $e as axiosGet,
6105
6108
  ls as axiosPatch,
6106
- $e as axiosPost,
6109
+ Fe as axiosPost,
6107
6110
  ln as axiosPut,
6108
6111
  ns as cookies,
6109
6112
  nn as createHttpClient,