unifyedx-storybook-new 0.2.78 → 0.2.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { jsxs as n, jsx as e, Fragment as te } from "react/jsx-runtime";
2
- import re, { useState as B, useMemo as ae, useId as He, Fragment as Q, useEffect as Z, useCallback as ee, useRef as fe } from "react";
1
+ import { jsxs as n, jsx as e, Fragment as ee } from "react/jsx-runtime";
2
+ import re, { useState as B, useMemo as ae, useId as He, Fragment as Q, useEffect as te, useCallback as K, useRef as fe } from "react";
3
3
  import { a as H, U as ct, X as ve, P as c, L as ja, C as xe, b as et, D as dt, f as St, d as Wt, F as _a, e as Ua, h as Ga, T as Le, u as qa, I as Jt, i as Xt, j as Ya, k as Wa, l as Ja, m as Ht, S as vt, n as Qt, M as Xa, o as Ha, p as Nt, q as Qa, A as Za, E as Zt, r as Ka, s as er, t as tr, v as ar, w as Kt, x as rr, y as ea, z as ta, B as nr, G as sr, H as lr, J as Qe, K as mt, N as ut, O as ir, Q as or, R as aa, V as cr, W as wt, Y as dr, Z as mr, _ as Be, $ as ur, a0 as hr, a1 as pr, a2 as gr, a3 as br, a4 as fr, a5 as Dt, a6 as yr, a7 as xr, a8 as vr, a9 as Nr, aa as wr, ab as kr, ac as Cr, ad as zr, ae as Sr, af as Ae, ag as ra, ah as Dr, ai as $r, aj as Tr, ak as Ar, al as Fr, am as na, an as Er, ao as Rr, ap as sa, aq as Ir, ar as ht, as as la, at as Or } from "./vendor-yf0QH1Io.js";
4
- import { Popover as Pr, PopoverButton as Mr, PopoverPanel as Lr, Transition as he, Dialog as ye, TransitionChild as ke, DialogPanel as Fe, DialogTitle as tt, TabGroup as Br, TabList as Vr, Tab as se, TabPanels as jr, RadioGroup as Ue, Listbox as K, ListboxButton as _r, ListboxOptions as Ur, ListboxOption as Gr, SwitchGroup as qr, Switch as lt, Menu as Yr, MenuButton as Wr, Portal as Jr, MenuItems as Xr, MenuItem as Hr, DialogBackdrop as Qr } from "@headlessui/react";
4
+ import { Popover as Pr, PopoverButton as Mr, PopoverPanel as Lr, Transition as he, Dialog as ye, TransitionChild as ke, DialogPanel as Fe, DialogTitle as tt, TabGroup as Br, TabList as Vr, Tab as se, TabPanels as jr, RadioGroup as Ue, Listbox as Z, ListboxButton as _r, ListboxOptions as Ur, ListboxOption as Gr, SwitchGroup as qr, Switch as lt, Menu as Yr, MenuButton as Wr, Portal as Jr, MenuItems as Xr, MenuItem as Hr, DialogBackdrop as Qr } from "@headlessui/react";
5
5
  import { motion as ie, AnimatePresence as Se } from "framer-motion";
6
6
  import { d as Zr } from "./vendor-lodash-Dkzj2D3U.js";
7
7
  import { useFloating as ia, offset as oa, flip as ca, shift as da, autoUpdate as ma, useClick as Kr, useDismiss as en, useInteractions as tn, FloatingPortal as an } from "@floating-ui/react";
@@ -15,8 +15,8 @@ const wn = (t) => {
15
15
  a ^= t.charCodeAt(s), a += (a << 1) + (a << 4) + (a << 7) + (a << 8) + (a << 24);
16
16
  return a >>> 0;
17
17
  }, kn = (t) => {
18
- const a = (t ?? "").trim().toLowerCase(), s = parseInt((a.match(/\d+$/) ?? [0])[0], 10) || 0, i = wn(a), l = (i % 360 + 37 * s) % 360, m = 55 + (i >>> 8) % 20, o = 30 + (i >>> 16) % 10, h = 86 + (i >>> 24) % 8, u = `hsl(${l}, ${m}%, ${h}%)`, N = `hsl(${l}, ${m}%, ${o}%)`;
19
- return { bg: u, text: N };
18
+ const a = (t ?? "").trim().toLowerCase(), s = parseInt((a.match(/\d+$/) ?? [0])[0], 10) || 0, i = wn(a), l = (i % 360 + 37 * s) % 360, m = 55 + (i >>> 8) % 20, o = 30 + (i >>> 16) % 10, u = 86 + (i >>> 24) % 8, h = `hsl(${l}, ${m}%, ${u}%)`, N = `hsl(${l}, ${m}%, ${o}%)`;
19
+ return { bg: h, text: N };
20
20
  }, Cn = (t = "") => t.split(" ").map((a) => a[0]).slice(0, 2).join("").toUpperCase(), we = ({
21
21
  src: t,
22
22
  name: a,
@@ -29,14 +29,14 @@ const wn = (t) => {
29
29
  className: m,
30
30
  ...o
31
31
  }) => {
32
- const [h, u] = B(!1), N = ae(() => kn(a), []), y = t && !h, r = !y && a, v = !y && !a, d = H(
32
+ const [u, h] = B(!1), N = ae(() => kn(a), []), y = t && !u, r = !y && a, v = !y && !a, d = H(
33
33
  "avatar-container",
34
34
  `avatar--size-${s}`,
35
35
  m
36
- ), g = y ? "transparent" : i || N.bg, D = l || N.text;
36
+ ), g = y ? "transparent" : i || N.bg, S = l || N.text;
37
37
  return /* @__PURE__ */ n("div", { className: d, style: {
38
38
  backgroundColor: g,
39
- color: D
39
+ color: S
40
40
  }, ...o, children: [
41
41
  y && /* @__PURE__ */ e(
42
42
  "img",
@@ -44,7 +44,7 @@ const wn = (t) => {
44
44
  src: t,
45
45
  alt: a || "User avatar",
46
46
  className: "avatar-image",
47
- onError: () => u(!0)
47
+ onError: () => h(!0)
48
48
  }
49
49
  ),
50
50
  r && /* @__PURE__ */ e("span", { className: "avatar-initials", "aria-label": a, children: Cn(a) }),
@@ -71,21 +71,21 @@ const wn = (t) => {
71
71
  onRemove: l,
72
72
  bgColor: m,
73
73
  textColor: o,
74
- className: h,
75
- ...u
74
+ className: u,
75
+ ...h
76
76
  }) => {
77
77
  const N = H(
78
78
  "badge",
79
79
  `badge--variant-${a}`,
80
80
  `badge--size-${s}`,
81
81
  { "badge--with-remove": !!l },
82
- h
82
+ u
83
83
  );
84
84
  return /* @__PURE__ */ n("span", { className: N, style: m && o ? {
85
85
  backgroundColor: m,
86
86
  color: o,
87
87
  borderColor: "#ff0000"
88
- } : {}, ...u, children: [
88
+ } : {}, ...h, children: [
89
89
  i && /* @__PURE__ */ e(i, { className: "badge-icon" }),
90
90
  /* @__PURE__ */ e("span", { className: "badge-label", children: t }),
91
91
  l && /* @__PURE__ */ e(
@@ -146,9 +146,9 @@ const Dn = {
146
146
  // ✅ Default is now empty
147
147
  loader: m = !1,
148
148
  category: o = "primary",
149
- icon: h,
149
+ icon: u,
150
150
  // Renamed for clarity, expecting a component type e.g., CheckCircle
151
- disabled: u = !1,
151
+ disabled: h = !1,
152
152
  size: N = "medium",
153
153
  label: y,
154
154
  children: r,
@@ -156,11 +156,11 @@ const Dn = {
156
156
  iconWidth: v,
157
157
  iconHeight: d,
158
158
  iconColor: g,
159
- strokeWidth: D,
159
+ strokeWidth: S,
160
160
  onClick: F,
161
161
  ...E
162
162
  }) => {
163
- const I = u || m, P = h && !y, _ = H(
163
+ const R = h || m, P = u && !y, j = H(
164
164
  "btn-base",
165
165
  Dn[N],
166
166
  $n[o],
@@ -175,14 +175,14 @@ const Dn = {
175
175
  {
176
176
  "data-testid": t,
177
177
  type: s,
178
- className: _,
179
- disabled: I,
178
+ className: j,
179
+ disabled: R,
180
180
  onClick: F,
181
181
  title: a || P && i || (typeof y == "string" ? y : void 0),
182
182
  "aria-label": i || P && a || (typeof y == "string" ? y : void 0),
183
183
  ...E,
184
- children: m ? /* @__PURE__ */ e(ja, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ n(te, { children: [
185
- h && /* @__PURE__ */ e(h, { size: N === "large" ? 20 : 16, width: v || 16, height: d || 16, color: g || "#767676", strokeWidth: D || 2 }),
184
+ children: m ? /* @__PURE__ */ e(ja, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ n(ee, { children: [
185
+ u && /* @__PURE__ */ e(u, { size: N === "large" ? 20 : 16, width: v || 16, height: d || 16, color: g || "#767676", strokeWidth: S || 2 }),
186
186
  y,
187
187
  r,
188
188
  " "
@@ -220,9 +220,9 @@ const Dn = {
220
220
  ref: l,
221
221
  checked: m,
222
222
  onChange: o,
223
- ...h
223
+ ...u
224
224
  }) => {
225
- const u = He(), N = a || u;
225
+ const h = He(), N = a || h;
226
226
  return /* @__PURE__ */ n("div", { className: `checkbox-container ${i || ""}`, children: [
227
227
  /* @__PURE__ */ n("label", { htmlFor: N, className: "checkbox-wrapper", children: [
228
228
  /* @__PURE__ */ e(
@@ -234,7 +234,7 @@ const Dn = {
234
234
  className: "checkbox-input",
235
235
  checked: m,
236
236
  onChange: o,
237
- ...h
237
+ ...u
238
238
  }
239
239
  ),
240
240
  /* @__PURE__ */ e(
@@ -260,9 +260,9 @@ const Dn = {
260
260
  label: l,
261
261
  error: m,
262
262
  disabled: o = !1,
263
- className: h,
264
- ...u
265
- }) => /* @__PURE__ */ n("div", { className: H("datepicker-wrapper", h), children: [
263
+ className: u,
264
+ ...h
265
+ }) => /* @__PURE__ */ n("div", { className: H("datepicker-wrapper", u), children: [
266
266
  l && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "datepicker-input", children: l }),
267
267
  /* @__PURE__ */ e(
268
268
  ua,
@@ -288,17 +288,17 @@ const Dn = {
288
288
  label: l,
289
289
  error: m,
290
290
  disabled: o = !1,
291
- className: h,
292
- ...u
291
+ className: u,
292
+ ...h
293
293
  }) => {
294
294
  const N = t?.from, y = t?.to, r = (d) => {
295
295
  d.stopPropagation(), d.preventDefault(), s?.();
296
- }, v = N && y ? /* @__PURE__ */ n(te, { children: [
296
+ }, v = N && y ? /* @__PURE__ */ n(ee, { children: [
297
297
  St(N, "MMM d, y"),
298
298
  " - ",
299
299
  St(y, "MMM d, y")
300
300
  ] }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: i });
301
- return /* @__PURE__ */ n("div", { className: H("datepicker-wrapper", h), children: [
301
+ return /* @__PURE__ */ n("div", { className: H("datepicker-wrapper", u), children: [
302
302
  l && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "daterangepicker-input", children: l }),
303
303
  /* @__PURE__ */ n(An, { children: [
304
304
  /* @__PURE__ */ e(Fn, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "datepicker-input-container", children: [
@@ -599,8 +599,8 @@ const Dn = {
599
599
  open: m,
600
600
  // --- Form and File State ---
601
601
  validFiles: o = [],
602
- rejectedFiles: h = [],
603
- handleRemoveValidFile: u,
602
+ rejectedFiles: u = [],
603
+ handleRemoveValidFile: h,
604
604
  handleRemoveRejectedFile: N,
605
605
  handleSubmit: y,
606
606
  isSubmitting: r,
@@ -609,7 +609,7 @@ const Dn = {
609
609
  title: d = "Upload Files",
610
610
  subHeading: g = "Supports PNG, JPG, PDF. Max size: 50MB."
611
611
  }) => {
612
- const D = o.length > 0 || h.length > 0;
612
+ const S = o.length > 0 || u.length > 0;
613
613
  return /* @__PURE__ */ e(he, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ n(
614
614
  ye,
615
615
  {
@@ -685,7 +685,7 @@ const Dn = {
685
685
  }
686
686
  ),
687
687
  v.filesToUpload && /* @__PURE__ */ e("p", { className: "form-error-message", children: v.filesToUpload.message }),
688
- D && /* @__PURE__ */ n("div", { className: "file-list-container", children: [
688
+ S && /* @__PURE__ */ n("div", { className: "file-list-container", children: [
689
689
  /* @__PURE__ */ e("h3", { children: "Upload Queue" }),
690
690
  /* @__PURE__ */ n("ul", { className: "file-list", children: [
691
691
  o.map((F, E) => /* @__PURE__ */ n(
@@ -709,7 +709,7 @@ const Dn = {
709
709
  "button",
710
710
  {
711
711
  type: "button",
712
- onClick: () => u(E),
712
+ onClick: () => h(E),
713
713
  className: "remove-file-button",
714
714
  children: /* @__PURE__ */ e(Le, { size: 16 })
715
715
  }
@@ -718,7 +718,7 @@ const Dn = {
718
718
  },
719
719
  `${F.name}-${E}`
720
720
  )),
721
- h.map(({ file: F, message: E }, I) => /* @__PURE__ */ n(
721
+ u.map(({ file: F, message: E }, R) => /* @__PURE__ */ n(
722
722
  "li",
723
723
  {
724
724
  className: "file-item file-item--rejected",
@@ -740,14 +740,14 @@ const Dn = {
740
740
  "button",
741
741
  {
742
742
  type: "button",
743
- onClick: () => N(I),
743
+ onClick: () => N(R),
744
744
  className: "remove-file-button",
745
745
  children: /* @__PURE__ */ e(Le, { size: 16 })
746
746
  }
747
747
  )
748
748
  ]
749
749
  },
750
- `${F.name}-${I}`
750
+ `${F.name}-${R}`
751
751
  ))
752
752
  ] })
753
753
  ] })
@@ -829,10 +829,10 @@ const Dn = {
829
829
  filterConfig: l = [],
830
830
  initialFormikValues: m,
831
831
  customStyles: o = "",
832
- fetchCreatedOrUpdatedByUsers: h = async () => []
832
+ fetchCreatedOrUpdatedByUsers: u = async () => []
833
833
  // Mockable fetcher
834
834
  }) => {
835
- const [u, N] = B({
835
+ const [h, N] = B({
836
836
  createdBy: [],
837
837
  updatedBy: []
838
838
  }), [y, r] = B({
@@ -840,66 +840,66 @@ const Dn = {
840
840
  updatedBy: !1
841
841
  }), [v, d] = B({
842
842
  startDate: null
843
- }), [g, D] = B({
843
+ }), [g, S] = B({
844
844
  endDate: null
845
845
  }), F = qa({
846
846
  initialValues: JSON.parse(JSON.stringify(m)),
847
847
  // Deep copy
848
848
  onSubmit: ($) => {
849
849
  const x = {};
850
- Object.keys($).forEach((b) => {
851
- x[b] = {
852
- operator: $[b].operator || "in",
853
- values: Array.isArray($[b].values) ? $[b].values : [],
854
- range: $[b].range || null
850
+ Object.keys($).forEach((f) => {
851
+ x[f] = {
852
+ operator: $[f].operator || "in",
853
+ values: Array.isArray($[f].values) ? $[f].values : [],
854
+ range: $[f].range || null
855
855
  };
856
856
  }), console.log("[storybook filter] Applied Filters:", x), typeof s == "function" && s({
857
857
  filters: x,
858
- activeCount: I
858
+ activeCount: R
859
859
  }), a();
860
860
  },
861
861
  enableReinitialize: !0
862
862
  }), E = ae(() => l.reduce(($, x) => {
863
- const b = x.key, S = F.values[b];
863
+ const f = x.key, z = F.values[f];
864
864
  let O = !1;
865
- if (S)
865
+ if (z)
866
866
  switch (x.type) {
867
867
  case "multiselect":
868
868
  case "multiselect-users":
869
- O = Array.isArray(S.values) && S.values.length > 0;
869
+ O = Array.isArray(z.values) && z.values.length > 0;
870
870
  break;
871
871
  case "date":
872
- (S.range && S.range !== "" || Array.isArray(S.values) && S.values.length > 0) && (O = !0);
872
+ (z.range && z.range !== "" || Array.isArray(z.values) && z.values.length > 0) && (O = !0);
873
873
  break;
874
874
  }
875
- return $[b] = O, $;
876
- }, {}), [l, F.values]), I = Object.values(E).filter(Boolean).length, P = ae(() => l.some(($) => {
875
+ return $[f] = O, $;
876
+ }, {}), [l, F.values]), R = Object.values(E).filter(Boolean).length, P = ae(() => l.some(($) => {
877
877
  if ($.type !== "date") return !1;
878
878
  const x = F.values?.[$.key]?.values;
879
879
  if (!Array.isArray(x) || x.length < 2) return !1;
880
- const [b, S] = x;
881
- if (!b || !S) return !1;
882
- const O = b instanceof Date ? b : new Date(b), R = S instanceof Date ? S : new Date(S);
883
- return O > R;
884
- }), [l, F.values]), _ = async ($, x) => {
880
+ const [f, z] = x;
881
+ if (!f || !z) return !1;
882
+ const O = f instanceof Date ? f : new Date(f), I = z instanceof Date ? z : new Date(z);
883
+ return O > I;
884
+ }), [l, F.values]), j = async ($, x) => {
885
885
  try {
886
- r((S) => ({ ...S, [$]: !0 }));
887
- const b = await h($, x);
888
- N((S) => ({ ...S, [$]: b }));
889
- } catch (b) {
890
- console.error(`Error fetching ${$} users:`, b);
886
+ r((z) => ({ ...z, [$]: !0 }));
887
+ const f = await u($, x);
888
+ N((z) => ({ ...z, [$]: f }));
889
+ } catch (f) {
890
+ console.error(`Error fetching ${$} users:`, f);
891
891
  } finally {
892
- r((b) => ({ ...b, [$]: !1 }));
892
+ r((f) => ({ ...f, [$]: !1 }));
893
893
  }
894
894
  }, U = ($) => {
895
- const x = l[$].key, b = l[$].url;
896
- l[$].type === "multiselect-users" && u[x].length === 0 && !y[x] && _(x, b);
895
+ const x = l[$].key, f = l[$].url;
896
+ l[$].type === "multiselect-users" && h[x].length === 0 && !y[x] && j(x, f);
897
897
  }, Y = () => {
898
898
  F.resetForm(), N({ createdBy: [], updatedBy: [] }), i();
899
899
  }, q = ($) => {
900
900
  const x = l.find((O) => O.key === $);
901
901
  if (!x) return null;
902
- const b = F.values[$] || m[$], S = Array.isArray(b.values) ? b.values : [];
902
+ const f = F.values[$] || m[$], z = Array.isArray(f.values) ? f.values : [];
903
903
  switch (x.type) {
904
904
  case "multiselect":
905
905
  return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
@@ -908,7 +908,7 @@ const Dn = {
908
908
  /* @__PURE__ */ e(
909
909
  "select",
910
910
  {
911
- value: b.operator || "in",
911
+ value: f.operator || "in",
912
912
  onChange: (A) => F.setFieldValue(`${$}.operator`, A.target.value),
913
913
  className: "filter-select",
914
914
  children: x.operators.map((A) => /* @__PURE__ */ e("option", { value: A, children: A === "in" ? "Includes" : "Excludes" }, A))
@@ -923,7 +923,7 @@ const Dn = {
923
923
  type: "checkbox",
924
924
  id: `select-all-${$}`,
925
925
  className: "filter-checkbox-input",
926
- checked: x.options.length > 0 && S.length === x.options.length,
926
+ checked: x.options.length > 0 && z.length === x.options.length,
927
927
  onChange: (A) => {
928
928
  const G = A.target.checked ? x.options.map((W) => W.value) : [];
929
929
  F.setFieldValue(`${$}.values`, G);
@@ -946,9 +946,9 @@ const Dn = {
946
946
  type: "checkbox",
947
947
  id: `${$}-${A.value}`,
948
948
  className: "filter-checkbox-input",
949
- checked: S.includes(A.value),
949
+ checked: z.includes(A.value),
950
950
  onChange: (G) => {
951
- const W = G.target.checked ? [...S, A.value] : S.filter((pe) => pe !== A.value);
951
+ const W = G.target.checked ? [...z, A.value] : z.filter((pe) => pe !== A.value);
952
952
  F.setFieldValue(`${$}.values`, W);
953
953
  }
954
954
  }
@@ -965,21 +965,21 @@ const Dn = {
965
965
  ] })
966
966
  ] });
967
967
  case "multiselect-users":
968
- const O = u[$] || [], R = y[$];
968
+ const O = h[$] || [], I = y[$];
969
969
  return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
970
970
  /* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
971
971
  /* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
972
972
  /* @__PURE__ */ e(
973
973
  "select",
974
974
  {
975
- value: b.operator || "in",
975
+ value: f.operator || "in",
976
976
  onChange: (A) => F.setFieldValue(`${$}.operator`, A.target.value),
977
977
  className: "filter-select",
978
978
  children: x.operators.map((A) => /* @__PURE__ */ e("option", { value: A, children: A === "in" ? "Includes" : "Excludes" }, A))
979
979
  }
980
980
  )
981
981
  ] }),
982
- R ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: O.length > 0 ? /* @__PURE__ */ n(te, { children: [
982
+ I ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: O.length > 0 ? /* @__PURE__ */ n(ee, { children: [
983
983
  /* @__PURE__ */ n("div", { className: "filter-checkbox-item", children: [
984
984
  /* @__PURE__ */ e(
985
985
  "input",
@@ -987,7 +987,7 @@ const Dn = {
987
987
  type: "checkbox",
988
988
  id: `select-all-users-${$}`,
989
989
  className: "filter-checkbox-input",
990
- checked: O.length > 0 && S.length === O.length,
990
+ checked: O.length > 0 && z.length === O.length,
991
991
  onChange: (A) => {
992
992
  const G = A.target.checked ? O.map((W) => W.email) : [];
993
993
  F.setFieldValue(
@@ -1013,9 +1013,9 @@ const Dn = {
1013
1013
  type: "checkbox",
1014
1014
  id: `${$}-${A.email}`,
1015
1015
  className: "filter-checkbox-input",
1016
- checked: S.includes(A.email),
1016
+ checked: z.includes(A.email),
1017
1017
  onChange: (G) => {
1018
- const W = G.target.checked ? [...S, A.email] : S.filter((pe) => pe !== A.email);
1018
+ const W = G.target.checked ? [...z, A.email] : z.filter((pe) => pe !== A.email);
1019
1019
  F.setFieldValue(
1020
1020
  `${$}.values`,
1021
1021
  W
@@ -1038,9 +1038,9 @@ const Dn = {
1038
1038
  ] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
1039
1039
  ] });
1040
1040
  case "date":
1041
- const z = b.values || [], [f, p] = z, k = f && p, w = z[0] || null, T = z[1] || null, L = {
1042
- startDate: w instanceof Date ? w.toISOString().slice(0, 10) : null,
1043
- endDate: w instanceof Date ? w.toISOString().slice(0, 10) : null
1041
+ const D = f.values || [], [b, p] = D, w = b && p, k = D[0] || null, T = D[1] || null, L = {
1042
+ startDate: k instanceof Date ? k.toISOString().slice(0, 10) : null,
1043
+ endDate: k instanceof Date ? k.toISOString().slice(0, 10) : null
1044
1044
  }, C = {
1045
1045
  startDate: T instanceof Date ? T.toISOString().slice(0, 10) : null,
1046
1046
  endDate: T instanceof Date ? T.toISOString().slice(0, 10) : null
@@ -1052,7 +1052,7 @@ const Dn = {
1052
1052
  { key: "this_month", label: "This Month" },
1053
1053
  { key: "last_month", label: "Last Month" },
1054
1054
  { key: "custom", label: "Custom" }
1055
- ], V = (A) => {
1055
+ ], _ = (A) => {
1056
1056
  if (A === "anytime") {
1057
1057
  F.setFieldValue(`${$}.values`, []), F.setFieldValue(`${$}.range`, "anytime");
1058
1058
  return;
@@ -1070,13 +1070,13 @@ const Dn = {
1070
1070
  /* @__PURE__ */ e(
1071
1071
  "select",
1072
1072
  {
1073
- value: b.operator,
1073
+ value: f.operator,
1074
1074
  onChange: (A) => F.setFieldValue(`${$}.operator`, A.target.value),
1075
1075
  className: "filter-select",
1076
1076
  children: x.operators.map((A) => /* @__PURE__ */ e("option", { value: A, children: A === "in" ? "Is" : "Is not" }, A))
1077
1077
  }
1078
1078
  ),
1079
- k && /* @__PURE__ */ e(
1079
+ w && /* @__PURE__ */ e(
1080
1080
  "button",
1081
1081
  {
1082
1082
  type: "button",
@@ -1092,7 +1092,7 @@ const Dn = {
1092
1092
  )
1093
1093
  ] }),
1094
1094
  /* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children: M.map((A) => {
1095
- const G = b.range === A.key || A.key === "anytime" && (!Array.isArray(b.values) || b.values.length === 0);
1095
+ const G = f.range === A.key || A.key === "anytime" && (!Array.isArray(f.values) || f.values.length === 0);
1096
1096
  return /* @__PURE__ */ n(
1097
1097
  "label",
1098
1098
  {
@@ -1104,7 +1104,7 @@ const Dn = {
1104
1104
  type: "radio",
1105
1105
  name: `preset-${$}`,
1106
1106
  checked: G,
1107
- onChange: () => V(A.key),
1107
+ onChange: () => _(A.key),
1108
1108
  className: "h-4 w-4"
1109
1109
  }
1110
1110
  ),
@@ -1126,7 +1126,7 @@ const Dn = {
1126
1126
  useRange: !1,
1127
1127
  value: L,
1128
1128
  onChange: (A) => {
1129
- const G = A?.startDate ? Ve(new Date(A.startDate)) : null, W = z[1] || null;
1129
+ const G = A?.startDate ? Ve(new Date(A.startDate)) : null, W = D[1] || null;
1130
1130
  G && (F.setFieldValue(`${$}.values`, [G, W]), F.setFieldValue(`${$}.range`, "custom"));
1131
1131
  },
1132
1132
  inputClassName: "w-full rounded-xl border border-[#767676] px-4 py-2 text-sm font-normal text-[#101112] focus:border-violet-500 focus:outline-none focus:ring-1 focus:ring-violet-500",
@@ -1150,7 +1150,7 @@ const Dn = {
1150
1150
  useRange: !1,
1151
1151
  value: C,
1152
1152
  onChange: (A) => {
1153
- const G = A?.startDate ? je(new Date(A.startDate)) : null, W = z[0] || null;
1153
+ const G = A?.startDate ? je(new Date(A.startDate)) : null, W = D[0] || null;
1154
1154
  G && (F.setFieldValue(`${$}.values`, [W, G]), F.setFieldValue(`${$}.range`, "custom"));
1155
1155
  },
1156
1156
  inputClassName: "w-full rounded-xl border border-[#767676] px-4 py-2 text-sm font-normal text-[#101112] focus:border-violet-500 focus:outline-none focus:ring-1 focus:ring-violet-500",
@@ -1164,7 +1164,7 @@ const Dn = {
1164
1164
  }
1165
1165
  )
1166
1166
  ] }),
1167
- w && T && w > T && /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-2", children: "End date must be after start date" })
1167
+ k && T && k > T && /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-2", children: "End date must be after start date" })
1168
1168
  ] })
1169
1169
  ] });
1170
1170
  default:
@@ -1272,7 +1272,7 @@ const Dn = {
1272
1272
  children: [
1273
1273
  "Apply Filters",
1274
1274
  " ",
1275
- I > 0 ? `(${I})` : ""
1275
+ R > 0 ? `(${R})` : ""
1276
1276
  ]
1277
1277
  }
1278
1278
  )
@@ -1291,24 +1291,24 @@ const Dn = {
1291
1291
  className: m,
1292
1292
  ref: o,
1293
1293
  // ✅ 'ref' is now received directly as a prop
1294
- ...h
1294
+ ...u
1295
1295
  }) => {
1296
- const u = a || h.name;
1296
+ const h = a || u.name;
1297
1297
  return /* @__PURE__ */ n("div", { className: `input-wrapper ${m || ""}`, children: [
1298
- t && /* @__PURE__ */ e("label", { htmlFor: u, className: "input-label", children: t }),
1298
+ t && /* @__PURE__ */ e("label", { htmlFor: h, className: "input-label", children: t }),
1299
1299
  /* @__PURE__ */ n("div", { className: "input-field-container", children: [
1300
1300
  i && /* @__PURE__ */ e(i, { className: "input-icon", size: 20 }),
1301
1301
  /* @__PURE__ */ e(
1302
1302
  "input",
1303
1303
  {
1304
- id: u,
1304
+ id: h,
1305
1305
  type: s,
1306
1306
  ref: o,
1307
1307
  className: H("input-field", {
1308
1308
  "input-field--error": !!l,
1309
1309
  "input-field--with-icon": !!i
1310
1310
  }),
1311
- ...h
1311
+ ...u
1312
1312
  }
1313
1313
  )
1314
1314
  ] }),
@@ -1344,8 +1344,8 @@ const Dn = {
1344
1344
  // No default
1345
1345
  variant: o = "info",
1346
1346
  // 'info', 'warning', 'delete'
1347
- loading: h = !1,
1348
- buttonProps: u = {},
1347
+ loading: u = !1,
1348
+ buttonProps: h = {},
1349
1349
  size: N
1350
1350
  // Add size prop
1351
1351
  }) => {
@@ -1402,7 +1402,7 @@ const Dn = {
1402
1402
  type: "button",
1403
1403
  onClick: v,
1404
1404
  label: l,
1405
- ...u
1405
+ ...h
1406
1406
  }
1407
1407
  )
1408
1408
  ] })
@@ -1418,14 +1418,14 @@ const Dn = {
1418
1418
  onItemsPerPageChange: l,
1419
1419
  itemsPerPageOptions: m = [10, 15, 20]
1420
1420
  }) => {
1421
- const o = Math.ceil(a / s), [h, u] = B(t);
1422
- Z(() => {
1423
- u(t);
1421
+ const o = Math.ceil(a / s), [u, h] = B(t);
1422
+ te(() => {
1423
+ h(t);
1424
1424
  }, [t]);
1425
1425
  const N = Math.min((t - 1) * s + 1, a), y = Math.min(t * s, a), r = (v) => {
1426
1426
  v.preventDefault();
1427
- let d = parseInt(h, 10);
1428
- isNaN(d) || d < 1 ? d = 1 : d > o && (d = o), u(d), d !== t && i(d);
1427
+ let d = parseInt(u, 10);
1428
+ isNaN(d) || d < 1 ? d = 1 : d > o && (d = o), h(d), d !== t && i(d);
1429
1429
  };
1430
1430
  return /* @__PURE__ */ n("div", { className: "pagination-container", children: [
1431
1431
  /* @__PURE__ */ n("div", { className: "pagination-left", children: [
@@ -1475,8 +1475,8 @@ const Dn = {
1475
1475
  {
1476
1476
  type: "number",
1477
1477
  className: "page-input",
1478
- value: h,
1479
- onChange: (v) => u(v.target.value),
1478
+ value: u,
1479
+ onChange: (v) => h(v.target.value),
1480
1480
  onBlur: r,
1481
1481
  "aria-label": `Current page, Page ${t}`
1482
1482
  }
@@ -1527,12 +1527,12 @@ const Dn = {
1527
1527
  Ue.Option,
1528
1528
  {
1529
1529
  value: o.value,
1530
- className: ({ active: h, checked: u }) => H("radiogroup-option", {
1531
- "radiogroup-option--active": h,
1532
- "radiogroup-option--checked": u,
1530
+ className: ({ active: u, checked: h }) => H("radiogroup-option", {
1531
+ "radiogroup-option--active": u,
1532
+ "radiogroup-option--checked": h,
1533
1533
  "radiogroup-option--error": !!l
1534
1534
  }),
1535
- children: ({ checked: h }) => /* @__PURE__ */ n(te, { children: [
1535
+ children: ({ checked: u }) => /* @__PURE__ */ n(ee, { children: [
1536
1536
  /* @__PURE__ */ n("div", { className: "radiogroup-option-content", children: [
1537
1537
  /* @__PURE__ */ e(Ue.Label, { as: "p", className: "option-label", children: o.label }),
1538
1538
  o.description && /* @__PURE__ */ e(
@@ -1544,7 +1544,7 @@ const Dn = {
1544
1544
  }
1545
1545
  )
1546
1546
  ] }),
1547
- h && /* @__PURE__ */ e("div", { className: "option-checkmark", children: /* @__PURE__ */ e(Ht, { size: 20 }) })
1547
+ u && /* @__PURE__ */ e("div", { className: "option-checkmark", children: /* @__PURE__ */ e(Ht, { size: 20 }) })
1548
1548
  ] })
1549
1549
  },
1550
1550
  o.value
@@ -1561,35 +1561,35 @@ const Dn = {
1561
1561
  // Added a default label for accessibility
1562
1562
  customClass: m = "",
1563
1563
  inputStyle: o = {},
1564
- placeholderClass: h = "",
1565
- searchIconSize: u = 16,
1564
+ placeholderClass: u = "",
1565
+ searchIconSize: h = 16,
1566
1566
  searchIconClass: N = "",
1567
1567
  ...y
1568
1568
  }) => {
1569
1569
  const [r, v] = B(t);
1570
- Z(() => {
1570
+ te(() => {
1571
1571
  v(t);
1572
1572
  }, [t]);
1573
- const d = ee(
1574
- Zr((D) => {
1575
- a?.(D);
1573
+ const d = K(
1574
+ Zr((S) => {
1575
+ a?.(S);
1576
1576
  }, s),
1577
1577
  [s, a]
1578
1578
  );
1579
- Z(() => (r !== t && d(r), () => {
1579
+ te(() => (r !== t && d(r), () => {
1580
1580
  d.cancel();
1581
1581
  }), [r, d, t]);
1582
- const g = (D) => {
1583
- v(D.target.value);
1582
+ const g = (S) => {
1583
+ v(S.target.value);
1584
1584
  };
1585
1585
  return /* @__PURE__ */ n("div", { className: `search-bar-wrapper ${m}`, children: [
1586
1586
  l && /* @__PURE__ */ e("label", { htmlFor: "search-field", className: "sr-only", children: l }),
1587
- /* @__PURE__ */ e("div", { className: "search-bar-icon-wrapper", children: /* @__PURE__ */ e(vt, { size: u || 16, className: `search-bar-icon ${N}`, "aria-hidden": "true" }) }),
1587
+ /* @__PURE__ */ e("div", { className: "search-bar-icon-wrapper", children: /* @__PURE__ */ e(vt, { size: h || 16, className: `search-bar-icon ${N}`, "aria-hidden": "true" }) }),
1588
1588
  /* @__PURE__ */ e(
1589
1589
  "input",
1590
1590
  {
1591
1591
  id: "search-field",
1592
- className: `search-bar-input ${h}`,
1592
+ className: `search-bar-input ${u}`,
1593
1593
  placeholder: i,
1594
1594
  type: "search",
1595
1595
  name: "search",
@@ -1610,9 +1610,9 @@ const Dn = {
1610
1610
  placeholder: l = "Select an option...",
1611
1611
  disabled: m = !1,
1612
1612
  error: o,
1613
- ref: h,
1613
+ ref: u,
1614
1614
  // From RHF's <Controller>
1615
- showSearch: u = !0
1615
+ showSearch: h = !0
1616
1616
  }) => {
1617
1617
  const [N, y] = B("");
1618
1618
  console.log("Select component - value:", a, "type:", typeof a), console.log("Select component - options:", i);
@@ -1627,7 +1627,7 @@ const Dn = {
1627
1627
  }
1628
1628
  return d.id === a || d.value === a || d.label === a;
1629
1629
  });
1630
- return /* @__PURE__ */ e(K, { value: a, onChange: s, disabled: m, children: /* @__PURE__ */ n("div", { className: "select-wrapper", ref: h, children: [
1630
+ return /* @__PURE__ */ e(Z, { value: a, onChange: s, disabled: m, children: /* @__PURE__ */ n("div", { className: "select-wrapper", ref: u, children: [
1631
1631
  t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
1632
1632
  /* @__PURE__ */ n("div", { className: "select-button-container", children: [
1633
1633
  /* @__PURE__ */ n(
@@ -1649,7 +1649,7 @@ const Dn = {
1649
1649
  leaveFrom: "opacity-100",
1650
1650
  leaveTo: "opacity-0",
1651
1651
  children: /* @__PURE__ */ n(Ur, { className: "select-options", children: [
1652
- u && /* @__PURE__ */ e("div", { className: "search-input-wrapper", children: /* @__PURE__ */ e(
1652
+ h && /* @__PURE__ */ e("div", { className: "search-input-wrapper", children: /* @__PURE__ */ e(
1653
1653
  ge,
1654
1654
  {
1655
1655
  onKeyDown: (d) => {
@@ -1665,7 +1665,7 @@ const Dn = {
1665
1665
  {
1666
1666
  className: ({ active: g }) => `select-option ${g ? "active" : ""}`,
1667
1667
  value: d,
1668
- children: ({ selected: g }) => /* @__PURE__ */ n(te, { children: [
1668
+ children: ({ selected: g }) => /* @__PURE__ */ n(ee, { children: [
1669
1669
  /* @__PURE__ */ n("div", { className: "option-content", children: [
1670
1670
  d.icon && /* @__PURE__ */ e(d.icon, { className: "option-icon" }),
1671
1671
  /* @__PURE__ */ e(
@@ -1695,7 +1695,7 @@ const Dn = {
1695
1695
  ] }) });
1696
1696
  }, Bn = () => {
1697
1697
  const [t, a] = B(window.location.pathname);
1698
- return Z(() => {
1698
+ return te(() => {
1699
1699
  const s = () => {
1700
1700
  a(window.location.pathname);
1701
1701
  };
@@ -1709,11 +1709,11 @@ const Dn = {
1709
1709
  return s;
1710
1710
  return null;
1711
1711
  }, ga = ({ item: t, isCollapsed: a, level: s = 0 }) => {
1712
- const { pathname: i } = Bn(), l = t.href || t.url || t.path, [m, o] = B(!1), h = t.icon;
1713
- Z(() => {
1712
+ const { pathname: i } = Bn(), l = t.href || t.url || t.path, [m, o] = B(!1), u = t.icon;
1713
+ te(() => {
1714
1714
  yt([t], i) && o(!0);
1715
1715
  }, [t, i]);
1716
- const u = i === l, N = !u && !!yt([t], i), y = (r) => {
1716
+ const h = i === l, N = !h && !!yt([t], i), y = (r) => {
1717
1717
  r.preventDefault(), o(!m);
1718
1718
  };
1719
1719
  return /* @__PURE__ */ n(
@@ -1731,12 +1731,12 @@ const Dn = {
1731
1731
  target: t.target,
1732
1732
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
1733
1733
  className: H("nav-item", {
1734
- "nav-item--active": u,
1734
+ "nav-item--active": h,
1735
1735
  "nav-item--collapsed": a
1736
1736
  }),
1737
- "aria-current": u ? "page" : void 0,
1737
+ "aria-current": h ? "page" : void 0,
1738
1738
  children: [
1739
- h && /* @__PURE__ */ e(h, { className: "nav-icon", "aria-hidden": "true" }),
1739
+ u && /* @__PURE__ */ e(u, { className: "nav-icon", "aria-hidden": "true" }),
1740
1740
  /* @__PURE__ */ e("span", { className: "nav-label", children: t.label || t.name }),
1741
1741
  t.children && /* @__PURE__ */ e(
1742
1742
  "button",
@@ -1788,8 +1788,8 @@ const Dn = {
1788
1788
  onToggleMobile: l,
1789
1789
  logoSmall: m,
1790
1790
  logoLarge: o,
1791
- user: h = { name: "", email: "" }
1792
- }) => /* @__PURE__ */ n(te, { children: [
1791
+ user: u = { name: "", email: "" }
1792
+ }) => /* @__PURE__ */ n(ee, { children: [
1793
1793
  i && /* @__PURE__ */ e(
1794
1794
  "div",
1795
1795
  {
@@ -1831,12 +1831,12 @@ const Dn = {
1831
1831
  }
1832
1832
  )
1833
1833
  ] }),
1834
- /* @__PURE__ */ e("nav", { className: "sidebar-nav", "aria-label": "Primary", children: /* @__PURE__ */ e("ul", { className: "sidebar-nav-list", children: t.map((u) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(ga, { item: u, isCollapsed: a }) }, u.label || u.name)) }) }),
1834
+ /* @__PURE__ */ e("nav", { className: "sidebar-nav", "aria-label": "Primary", children: /* @__PURE__ */ e("ul", { className: "sidebar-nav-list", children: t.map((h) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(ga, { item: h, isCollapsed: a }) }, h.label || h.name)) }) }),
1835
1835
  /* @__PURE__ */ n("div", { className: "sidebar-footer", children: [
1836
- /* @__PURE__ */ e(we, { src: h.avatar, name: h.name, size: "medium" }),
1836
+ /* @__PURE__ */ e(we, { src: u.avatar, name: u.name, size: "medium" }),
1837
1837
  /* @__PURE__ */ n("div", { className: "user-info", children: [
1838
- /* @__PURE__ */ e("span", { className: "user-name", children: h.name }),
1839
- /* @__PURE__ */ e("span", { className: "user-email", children: h.email })
1838
+ /* @__PURE__ */ e("span", { className: "user-name", children: u.name }),
1839
+ /* @__PURE__ */ e("span", { className: "user-email", children: u.email })
1840
1840
  ] }),
1841
1841
  /* @__PURE__ */ e(
1842
1842
  "button",
@@ -1897,16 +1897,16 @@ const Dn = {
1897
1897
  // ✅ New prop for max length
1898
1898
  showCharCount: o = !1,
1899
1899
  // ✅ New prop to control visibility
1900
- ...h
1900
+ ...u
1901
1901
  }) => {
1902
- const u = a || h.name, [N, y] = B(
1903
- h.value?.length || h.defaultValue?.length || 0
1902
+ const h = a || u.name, [N, y] = B(
1903
+ u.value?.length || u.defaultValue?.length || 0
1904
1904
  ), r = (d) => {
1905
- y(d.target.value.length), h.onChange && h.onChange(d);
1905
+ y(d.target.value.length), u.onChange && u.onChange(d);
1906
1906
  }, v = m - N;
1907
1907
  return /* @__PURE__ */ n("div", { className: `textarea-wrapper ${i || ""}`, children: [
1908
1908
  /* @__PURE__ */ n("div", { className: "textarea-header", children: [
1909
- t && /* @__PURE__ */ e("label", { htmlFor: u, className: "textarea-label", children: t }),
1909
+ t && /* @__PURE__ */ e("label", { htmlFor: h, className: "textarea-label", children: t }),
1910
1910
  o && m && /* @__PURE__ */ n("span", { className: "char-counter", children: [
1911
1911
  v,
1912
1912
  " characters remaining"
@@ -1915,14 +1915,14 @@ const Dn = {
1915
1915
  /* @__PURE__ */ e(
1916
1916
  "textarea",
1917
1917
  {
1918
- id: u,
1918
+ id: h,
1919
1919
  ref: l,
1920
1920
  className: H("textarea-field", {
1921
1921
  "textarea-field--error": !!s
1922
1922
  }),
1923
1923
  maxLength: m,
1924
1924
  onChange: r,
1925
- ...h
1925
+ ...u
1926
1926
  }
1927
1927
  ),
1928
1928
  s && /* @__PURE__ */ e("p", { className: "textarea-error-message", children: s })
@@ -1967,13 +1967,13 @@ const Dn = {
1967
1967
  // For external styling of the tooltip itself
1968
1968
  ...o
1969
1969
  }) => {
1970
- const h = re.useId();
1971
- return /* @__PURE__ */ n(te, { children: [
1972
- re.cloneElement(t, { "data-tooltip-id": h }),
1970
+ const u = re.useId();
1971
+ return /* @__PURE__ */ n(ee, { children: [
1972
+ re.cloneElement(t, { "data-tooltip-id": u }),
1973
1973
  /* @__PURE__ */ e(
1974
1974
  Qa,
1975
1975
  {
1976
- id: h,
1976
+ id: u,
1977
1977
  content: a,
1978
1978
  place: l,
1979
1979
  variant: s,
@@ -2003,8 +2003,8 @@ const Dn = {
2003
2003
  direction: l = 1,
2004
2004
  stepProps: m = {},
2005
2005
  title: o,
2006
- description: h,
2007
- showProgress: u = !0,
2006
+ description: u,
2007
+ showProgress: h = !0,
2008
2008
  closeOnOverlayClick: N = !0
2009
2009
  }) => {
2010
2010
  const y = s[i], r = Object.keys(s), v = r.indexOf(i), d = (v + 1) / r.length * 100, g = v > 0 && m.onBack;
@@ -2053,7 +2053,7 @@ const Dn = {
2053
2053
  ),
2054
2054
  /* @__PURE__ */ n("div", { className: "wizard-header-text", children: [
2055
2055
  /* @__PURE__ */ e(ye.Title, { as: "h3", className: "wizard-title", children: o }),
2056
- h && /* @__PURE__ */ e(ye.Description, { className: "wizard-description", children: h })
2056
+ u && /* @__PURE__ */ e(ye.Description, { className: "wizard-description", children: u })
2057
2057
  ] })
2058
2058
  ] }),
2059
2059
  /* @__PURE__ */ e(
@@ -2066,7 +2066,7 @@ const Dn = {
2066
2066
  }
2067
2067
  )
2068
2068
  ] }),
2069
- u && /* @__PURE__ */ e("div", { className: "wizard-progress-container", children: /* @__PURE__ */ e(
2069
+ h && /* @__PURE__ */ e("div", { className: "wizard-progress-container", children: /* @__PURE__ */ e(
2070
2070
  "div",
2071
2071
  {
2072
2072
  className: "wizard-progress-bar",
@@ -2123,18 +2123,18 @@ const Dn = {
2123
2123
  category: m = "secondary",
2124
2124
  icon: o,
2125
2125
  // Renamed for clarity, expecting a component type e.g., CheckCircle
2126
- disabled: h = !1,
2127
- size: u = "small",
2126
+ disabled: u = !1,
2127
+ size: h = "small",
2128
2128
  label: N,
2129
2129
  children: y,
2130
2130
  // ✅ Add children to the props list
2131
2131
  onClick: r,
2132
2132
  ...v
2133
2133
  }) => {
2134
- const d = h, g = H(
2134
+ const d = u, g = H(
2135
2135
  "btn-base-icon",
2136
2136
  "btn-icon-only",
2137
- jn[u],
2137
+ jn[h],
2138
2138
  _n[m],
2139
2139
  l
2140
2140
  );
@@ -2149,7 +2149,7 @@ const Dn = {
2149
2149
  title: i,
2150
2150
  "aria-label": i,
2151
2151
  ...v,
2152
- children: o && /* @__PURE__ */ e(o, { size: u === "large" ? 20 : 16 })
2152
+ children: o && /* @__PURE__ */ e(o, { size: h === "large" ? 20 : 16 })
2153
2153
  }
2154
2154
  );
2155
2155
  }, jl = ({
@@ -2162,7 +2162,7 @@ const Dn = {
2162
2162
  // fullHeight = false,
2163
2163
  ...o
2164
2164
  }) => {
2165
- const h = H(
2165
+ const u = H(
2166
2166
  "page-layout",
2167
2167
  {
2168
2168
  "page-layout--with-footer": a
@@ -2170,7 +2170,7 @@ const Dn = {
2170
2170
  },
2171
2171
  o.className
2172
2172
  );
2173
- return /* @__PURE__ */ n("div", { className: h, ...o, children: [
2173
+ return /* @__PURE__ */ n("div", { className: u, ...o, children: [
2174
2174
  /* @__PURE__ */ e("div", { className: "page-layout-content", children: t }),
2175
2175
  a && /* @__PURE__ */ e("footer", { className: "page-layout-footer", children: s || /* @__PURE__ */ n("div", { className: "footer-actions", children: [
2176
2176
  m?.show && /* @__PURE__ */ e(
@@ -2425,13 +2425,13 @@ function Ot() {
2425
2425
  }
2426
2426
  function Zn(t) {
2427
2427
  if (t && t.isAxiosError) {
2428
- const { response: a, config: s, message: i } = t, l = a?.status ?? null, m = a?.statusText ?? null, o = a?.data ?? null, h = typeof o == "string" && o || o?.message || o?.msg || o?.error || o?.errors?.[0]?.message || null;
2428
+ const { response: a, config: s, message: i } = t, l = a?.status ?? null, m = a?.statusText ?? null, o = a?.data ?? null, u = typeof o == "string" && o || o?.message || o?.msg || o?.error || o?.errors?.[0]?.message || null;
2429
2429
  return {
2430
2430
  ok: !1,
2431
2431
  status: l,
2432
2432
  statusText: m,
2433
2433
  code: o?.code || null,
2434
- message: h || i || "Request failed",
2434
+ message: u || i || "Request failed",
2435
2435
  details: o || null,
2436
2436
  request: {
2437
2437
  url: s?.url || null,
@@ -2492,10 +2492,10 @@ function Kn({
2492
2492
  async function o(N, y = {}, r = !1, v = {}) {
2493
2493
  return s.post(N, y, i({ open: r, customHeader: v }));
2494
2494
  }
2495
- async function h(N, y = {}, r = !1, v = {}) {
2495
+ async function u(N, y = {}, r = !1, v = {}) {
2496
2496
  return s.put(N, y, i({ open: r, customHeader: v }));
2497
2497
  }
2498
- async function u(N, y = {}, r = !1, v = {}) {
2498
+ async function h(N, y = {}, r = !1, v = {}) {
2499
2499
  return s.patch(N, y, i({ open: r, customHeader: v }));
2500
2500
  }
2501
2501
  return {
@@ -2504,8 +2504,8 @@ function Kn({
2504
2504
  axiosGet: l,
2505
2505
  axiosDelete: m,
2506
2506
  axiosPost: o,
2507
- axiosPut: h,
2508
- axiosPatch: u
2507
+ axiosPut: u,
2508
+ axiosPatch: h
2509
2509
  };
2510
2510
  }
2511
2511
  const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl = Ee.axiosPut, Wl = Ee.axiosPatch, Jl = Ee.instance, es = async (t, a) => {
@@ -2595,7 +2595,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2595
2595
  }
2596
2596
  }, zt = (t, a) => {
2597
2597
  const [s, i] = B(t);
2598
- return Z(
2598
+ return te(
2599
2599
  () => {
2600
2600
  const l = rn(() => {
2601
2601
  i(t);
@@ -2615,9 +2615,9 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2615
2615
  }) => {
2616
2616
  const l = t.slice(0, 2), m = [];
2617
2617
  t.length > 0 && m.push(t[0].name), a.length > 0 && m.push(a[0].name), s.length > 0 && m.length < 2 && m.push(s[0].name);
2618
- const o = t.length + a.length + s.length, h = o - m.length;
2619
- let u = m.join(", ");
2620
- return h > 0 && (u += ` and ${h} others`), o === 0 ? /* @__PURE__ */ e(
2618
+ const o = t.length + a.length + s.length, u = o - m.length;
2619
+ let h = m.join(", ");
2620
+ return u > 0 && (h += ` and ${u} others`), o === 0 ? /* @__PURE__ */ e(
2621
2621
  "div",
2622
2622
  {
2623
2623
  className: "flex items-center justify-between p-3 border border-dashed border-gray-400 rounded-lg hover:bg-gray-50",
@@ -2640,7 +2640,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2640
2640
  },
2641
2641
  N.id || y
2642
2642
  )) }),
2643
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-800 truncate", children: u })
2643
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-800 truncate", children: h })
2644
2644
  ] }),
2645
2645
  /* @__PURE__ */ e(xe, { size: 20 })
2646
2646
  ]
@@ -2664,9 +2664,9 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2664
2664
  showExistingShares: m = !1,
2665
2665
  onFinalSubmit: o = () => {
2666
2666
  },
2667
- isChanged: h = !1
2667
+ isChanged: u = !1
2668
2668
  }) => {
2669
- const [u, N] = B(Mt[0]), [y, r] = B(""), v = zt(y, 400), [d, g] = B([]), [D, F] = B(/* @__PURE__ */ new Set()), [E, I] = B(!1), [P, _] = B(Lt[0]), {
2669
+ const [h, N] = B(Mt[0]), [y, r] = B(""), v = zt(y, 400), [d, g] = B([]), [S, F] = B(/* @__PURE__ */ new Set()), [E, R] = B(!1), [P, j] = B(Lt[0]), {
2670
2670
  control: U,
2671
2671
  handleSubmit: Y,
2672
2672
  watch: q,
@@ -2674,29 +2674,29 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2674
2674
  } = nr({
2675
2675
  defaultValues: { pendingInvites: [] },
2676
2676
  resolver: ir(rs)
2677
- }), { fields: b, append: S, remove: O, update: R } = sr({
2677
+ }), { fields: f, append: z, remove: O, update: I } = sr({
2678
2678
  control: U,
2679
2679
  name: "pendingInvites"
2680
- }), z = q("pendingInvites");
2681
- Z(() => {
2682
- v.length > 1 ? (I(!0), es(u.name, v).then((C) => {
2680
+ }), D = q("pendingInvites");
2681
+ te(() => {
2682
+ v.length > 1 ? (R(!0), es(h.name, v).then((C) => {
2683
2683
  g(C);
2684
- }).catch((C) => console.error("Search failed:", C)).finally(() => I(!1))) : (g([]), F(/* @__PURE__ */ new Set()));
2685
- }, [v, u]);
2686
- const f = (C) => {
2684
+ }).catch((C) => console.error("Search failed:", C)).finally(() => R(!1))) : (g([]), F(/* @__PURE__ */ new Set()));
2685
+ }, [v, h]);
2686
+ const b = (C) => {
2687
2687
  F((M) => {
2688
- const V = new Set(M);
2689
- return V.has(C) ? V.delete(C) : V.add(C), V;
2688
+ const _ = new Set(M);
2689
+ return _.has(C) ? _.delete(C) : _.add(C), _;
2690
2690
  });
2691
2691
  }, p = () => {
2692
- d.filter((C) => D.has(C.id)).forEach((C) => {
2693
- b.find((M) => M.id === C.id) || S({ ...C, permission: P.name });
2692
+ d.filter((C) => S.has(C.id)).forEach((C) => {
2693
+ f.find((M) => M.id === C.id) || z({ ...C, permission: P.name });
2694
2694
  }), F(/* @__PURE__ */ new Set()), r("");
2695
- }, k = (C) => {
2696
- _(C), b.forEach(
2697
- (M, V) => R(V, { ...b[V], permission: C.name })
2695
+ }, w = (C) => {
2696
+ j(C), f.forEach(
2697
+ (M, _) => I(_, { ...f[_], permission: C.name })
2698
2698
  );
2699
- }, w = async (C) => {
2699
+ }, k = async (C) => {
2700
2700
  try {
2701
2701
  if (l === ue.DRIVE) {
2702
2702
  const M = C.pendingInvites.map((A) => ({
@@ -2711,13 +2711,13 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2711
2711
  // Always send updated existing shares
2712
2712
  }, i);
2713
2713
  } else if (l === ue.INTEREST) {
2714
- const M = C.pendingInvites.map((V) => ({
2715
- identity: V.id,
2716
- type: V.type.toLowerCase(),
2714
+ const M = C.pendingInvites.map((_) => ({
2715
+ identity: _.id,
2716
+ type: _.type.toLowerCase(),
2717
2717
  opt: !0,
2718
2718
  lock: !1,
2719
2719
  moderator: !1,
2720
- userName: V.name,
2720
+ userName: _.name,
2721
2721
  interestId: t?.data?.id
2722
2722
  }));
2723
2723
  o(M, i);
@@ -2741,7 +2741,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2741
2741
  throw console.error("Failed to submit invites:", M), M;
2742
2742
  }
2743
2743
  }, T = (C) => {
2744
- const M = i[u.code].find((V) => V.name === C.name && V.permission !== "remove") || z.find((V) => V.name === C.name);
2744
+ const M = i[h.code].find((_) => _.name === C.name && _.permission !== "remove") || D.find((_) => _.name === C.name);
2745
2745
  return M ? `${M.permission}` : "";
2746
2746
  }, L = () => {
2747
2747
  switch (l) {
@@ -2755,9 +2755,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2755
2755
  return "Add User, Groups or Roles test";
2756
2756
  }
2757
2757
  };
2758
- return ae(() => (console.log("InviteFlow - isChanged:", h, "pendingInvites.length:", z.length), z.length === 0 && !h), [z.length, h]), Z(() => {
2759
- typeof o == "function" && o({ pendingInvites: z }, i);
2760
- }, [z]), /* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-white", children: [
2758
+ return ae(() => (console.log("InviteFlow - isChanged:", u, "pendingInvites.length:", D.length), D.length === 0 && !u), [D.length, u]), /* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-white", children: [
2761
2759
  /* @__PURE__ */ n("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
2762
2760
  /* @__PURE__ */ e(ye.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: L() }),
2763
2761
  /* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
@@ -2786,11 +2784,11 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2786
2784
  }
2787
2785
  ),
2788
2786
  /* @__PURE__ */ n("div", { className: "relative grid grid-cols-3 gap-2 items-start", children: [
2789
- /* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(K, { value: u, onChange: N, children: /* @__PURE__ */ n("div", { className: "relative", children: [
2790
- /* @__PURE__ */ n(K.Button, { className: "relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
2787
+ /* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(Z, { value: h, onChange: N, children: /* @__PURE__ */ n("div", { className: "relative", children: [
2788
+ /* @__PURE__ */ n(Z.Button, { className: "relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
2791
2789
  /* @__PURE__ */ n("span", { className: "flex items-center", children: [
2792
- /* @__PURE__ */ e(u.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
2793
- /* @__PURE__ */ e("span", { className: "truncate", children: u.name })
2790
+ /* @__PURE__ */ e(h.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
2791
+ /* @__PURE__ */ e("span", { className: "truncate", children: h.name })
2794
2792
  ] }),
2795
2793
  /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(mt, { className: "h-5 w-5 text-gray-400" }) })
2796
2794
  ] }),
@@ -2801,12 +2799,12 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2801
2799
  leave: "transition ease-in duration-100",
2802
2800
  leaveFrom: "opacity-100",
2803
2801
  leaveTo: "opacity-0",
2804
- children: /* @__PURE__ */ e(K.Options, { className: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Mt.map((C) => /* @__PURE__ */ e(
2805
- K.Option,
2802
+ children: /* @__PURE__ */ e(Z.Options, { className: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Mt.map((C) => /* @__PURE__ */ e(
2803
+ Z.Option,
2806
2804
  {
2807
2805
  value: C,
2808
2806
  className: ({ active: M }) => `${M ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
2809
- children: ({ selected: M }) => /* @__PURE__ */ n(te, { children: [
2807
+ children: ({ selected: M }) => /* @__PURE__ */ n(ee, { children: [
2810
2808
  /* @__PURE__ */ n(
2811
2809
  "span",
2812
2810
  {
@@ -2833,7 +2831,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2833
2831
  /* @__PURE__ */ e("div", { className: "col-span-2", children: /* @__PURE__ */ e(
2834
2832
  ge,
2835
2833
  {
2836
- placeholder: `Search by ${u.name.toLowerCase()}...`,
2834
+ placeholder: `Search by ${h.name.toLowerCase()}...`,
2837
2835
  onDebouncedChange: (C) => r(C),
2838
2836
  value: y
2839
2837
  }
@@ -2846,20 +2844,20 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2846
2844
  exit: { opacity: 0, y: -10 },
2847
2845
  transition: { duration: 0.2 },
2848
2846
  className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
2849
- children: E ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(te, { children: [
2847
+ children: E ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ n(ee, { children: [
2850
2848
  /* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: d.map((C) => {
2851
2849
  const M = T(C);
2852
2850
  return /* @__PURE__ */ n(
2853
2851
  "div",
2854
2852
  {
2855
- onClick: () => M ? null : f(C.id),
2853
+ onClick: () => M ? null : b(C.id),
2856
2854
  className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${M ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
2857
2855
  children: [
2858
2856
  /* @__PURE__ */ e(
2859
2857
  "input",
2860
2858
  {
2861
2859
  type: "checkbox",
2862
- checked: D.has(C.id),
2860
+ checked: S.has(C.id),
2863
2861
  readOnly: !0,
2864
2862
  className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",
2865
2863
  disabled: !!M
@@ -2868,9 +2866,9 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2868
2866
  /* @__PURE__ */ e(we, { src: C.avatarUrl, name: C.name, size: "small" }),
2869
2867
  /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
2870
2868
  /* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: C.name }),
2871
- u.name === De.USER && /* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: C.id })
2869
+ h.name === De.USER && /* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: C.id })
2872
2870
  ] }),
2873
- M ? /* @__PURE__ */ n(te, { children: [
2871
+ M ? /* @__PURE__ */ n(ee, { children: [
2874
2872
  /* @__PURE__ */ e("span", { className: "text-sm px-3 py-0.5 border border-dashed rounded-xl bg-teal-100 text-teal-700", children: M }),
2875
2873
  /* @__PURE__ */ e("span", { className: "text-sm text-gray-400", children: "Already added" })
2876
2874
  ] }) : ""
@@ -2902,7 +2900,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2902
2900
  }
2903
2901
  ) })
2904
2902
  ] }),
2905
- /* @__PURE__ */ e(Se, { children: b.length > 0 && /* @__PURE__ */ n(
2903
+ /* @__PURE__ */ e(Se, { children: f.length > 0 && /* @__PURE__ */ n(
2906
2904
  ie.div,
2907
2905
  {
2908
2906
  initial: { opacity: 0, y: 20 },
@@ -2912,16 +2910,16 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2912
2910
  /* @__PURE__ */ n("div", { className: "flex justify-between items-center", children: [
2913
2911
  /* @__PURE__ */ n("div", { className: "font-semibold text-gray-800", children: [
2914
2912
  "Pending Invites (",
2915
- b.length,
2913
+ f.length,
2916
2914
  ")"
2917
2915
  ] }),
2918
2916
  l === ue.DRIVE && /* @__PURE__ */ e(
2919
- K,
2917
+ Z,
2920
2918
  {
2921
2919
  value: P,
2922
- onChange: k,
2920
+ onChange: w,
2923
2921
  children: /* @__PURE__ */ n("div", { className: "relative", children: [
2924
- /* @__PURE__ */ n(K.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: [
2922
+ /* @__PURE__ */ n(Z.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
2925
2923
  /* @__PURE__ */ n("span", { className: "flex items-center", children: [
2926
2924
  /* @__PURE__ */ e(P.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
2927
2925
  /* @__PURE__ */ n("span", { className: "truncate", children: [
@@ -2938,12 +2936,12 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2938
2936
  leave: "transition ease-in duration-100",
2939
2937
  leaveFrom: "opacity-100",
2940
2938
  leaveTo: "opacity-0",
2941
- children: /* @__PURE__ */ e(K.Options, { className: "absolute z-10 mt-1 w-auto min-w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Lt.map((C) => /* @__PURE__ */ e(
2942
- K.Option,
2939
+ children: /* @__PURE__ */ e(Z.Options, { className: "absolute z-10 mt-1 w-auto min-w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: Lt.map((C) => /* @__PURE__ */ e(
2940
+ Z.Option,
2943
2941
  {
2944
2942
  value: C,
2945
2943
  className: ({ active: M }) => `${M ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
2946
- children: ({ selected: M, active: V }) => /* @__PURE__ */ n(te, { children: [
2944
+ children: ({ selected: M, active: _ }) => /* @__PURE__ */ n(ee, { children: [
2947
2945
  /* @__PURE__ */ n(
2948
2946
  "span",
2949
2947
  {
@@ -2952,7 +2950,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2952
2950
  /* @__PURE__ */ e(
2953
2951
  C.icon,
2954
2952
  {
2955
- className: `h-5 w-5 mr-2 ${V ? "text-white" : "text-gray-400"}`
2953
+ className: `h-5 w-5 mr-2 ${_ ? "text-white" : "text-gray-400"}`
2956
2954
  }
2957
2955
  ),
2958
2956
  "Can ",
@@ -2977,7 +2975,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
2977
2975
  }
2978
2976
  )
2979
2977
  ] }),
2980
- /* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Se, { children: b.map((C, M) => /* @__PURE__ */ n(
2978
+ /* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(Se, { children: f.map((C, M) => /* @__PURE__ */ n(
2981
2979
  ie.div,
2982
2980
  {
2983
2981
  layout: !0,
@@ -3021,9 +3019,9 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3021
3019
  ] }),
3022
3020
  /* @__PURE__ */ e("footer", { className: "p-4 border-t border-gray-300 shrink-0", children: /* @__PURE__ */ n("div", { className: "flex justify-between items-center", children: [
3023
3021
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600", children: [
3024
- z.length,
3022
+ D.length,
3025
3023
  " invitation",
3026
- z.length !== 1 ? "s" : "",
3024
+ D.length !== 1 ? "s" : "",
3027
3025
  " selected"
3028
3026
  ] }),
3029
3027
  /* @__PURE__ */ n("div", { className: "flex gap-2", children: [
@@ -3038,8 +3036,8 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3038
3036
  /* @__PURE__ */ e(
3039
3037
  le,
3040
3038
  {
3041
- onClick: () => Y(w)(),
3042
- disabled: x || z.length === 0 && !h,
3039
+ onClick: () => Y(k)(),
3040
+ disabled: x || D.length === 0 && !u,
3043
3041
  label: x ? "Inviting..." : l === ue.DRIVE ? "Send Invites" : "Add"
3044
3042
  }
3045
3043
  )
@@ -3051,24 +3049,24 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3051
3049
  { name: "Can manage", icon: ta, value: "edit" },
3052
3050
  { name: "Remove", icon: or, isDestructive: !0, value: "remove" }
3053
3051
  ], ss = ({ item: t, allowedPermissions: a, onPermissionChange: s }) => {
3054
- const [i, l] = B(!1), { refs: m, floatingStyles: o, context: h } = ia({
3052
+ const [i, l] = B(!1), { refs: m, floatingStyles: o, context: u } = ia({
3055
3053
  open: i,
3056
3054
  onOpenChange: l,
3057
3055
  middleware: [oa(8), ca(), da({ padding: 8 })],
3058
3056
  whileElementsMounted: ma,
3059
3057
  placement: "bottom-end"
3060
- }), u = Kr(h), N = en(h), { getReferenceProps: y, getFloatingProps: r } = tn([
3061
- u,
3058
+ }), h = Kr(u), N = en(u), { getReferenceProps: y, getFloatingProps: r } = tn([
3059
+ h,
3062
3060
  N
3063
3061
  ]), v = ot.find((g) => g.name === t.permission || g.value === t.permission) || ot[0];
3064
3062
  return (
3065
3063
  // FIX: The <Listbox> component now wraps both the button and the portal.
3066
3064
  // This provides the necessary context for both children.
3067
- /* @__PURE__ */ n(K, { value: v, onChange: (g) => {
3065
+ /* @__PURE__ */ n(Z, { value: v, onChange: (g) => {
3068
3066
  s(g), l(!1);
3069
3067
  }, children: [
3070
3068
  /* @__PURE__ */ n(
3071
- K.Button,
3069
+ Z.Button,
3072
3070
  {
3073
3071
  ref: m.setReference,
3074
3072
  ...y(),
@@ -3091,7 +3089,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3091
3089
  leaveFrom: "transform opacity-100 scale-100",
3092
3090
  leaveTo: "transform opacity-0 scale-95",
3093
3091
  children: /* @__PURE__ */ e(
3094
- K.Options,
3092
+ Z.Options,
3095
3093
  {
3096
3094
  ref: m.setFloating,
3097
3095
  style: o,
@@ -3099,27 +3097,27 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3099
3097
  static: !0,
3100
3098
  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",
3101
3099
  children: ot.filter((g) => a.includes(g.value)).map((g) => /* @__PURE__ */ e(
3102
- K.Option,
3100
+ Z.Option,
3103
3101
  {
3104
3102
  className: ({
3105
- active: D
3103
+ active: S
3106
3104
  }) => `relative select-none py-2 pl-10 pr-4 hover:cursor-pointer
3107
- ${D ? "bg-blue-100 text-blue-900" : "text-gray-900"}
3108
- ${g.isDestructive && D ? "bg-red-100 text-red-900" : ""}
3109
- ${g.isDestructive && !D ? "text-red-600" : ""}`,
3105
+ ${S ? "bg-blue-100 text-blue-900" : "text-gray-900"}
3106
+ ${g.isDestructive && S ? "bg-red-100 text-red-900" : ""}
3107
+ ${g.isDestructive && !S ? "text-red-600" : ""}`,
3110
3108
  value: g,
3111
- children: ({ selected: D }) => /* @__PURE__ */ n(te, { children: [
3109
+ children: ({ selected: S }) => /* @__PURE__ */ n(ee, { children: [
3112
3110
  /* @__PURE__ */ n(
3113
3111
  "span",
3114
3112
  {
3115
- className: `flex items-center gap-2 truncate ${D ? "font-medium" : "font-normal"}`,
3113
+ className: `flex items-center gap-2 truncate ${S ? "font-medium" : "font-normal"}`,
3116
3114
  children: [
3117
3115
  /* @__PURE__ */ e(g.icon, { className: "h-5 w-5", "aria-hidden": "true" }),
3118
3116
  g.name
3119
3117
  ]
3120
3118
  }
3121
3119
  ),
3122
- D && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(ut, { className: "h-5 w-5", "aria-hidden": "true" }) })
3120
+ S && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(ut, { className: "h-5 w-5", "aria-hidden": "true" }) })
3123
3121
  ] })
3124
3122
  },
3125
3123
  g.name
@@ -3139,31 +3137,31 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3139
3137
  existingShares: l,
3140
3138
  allowedPermissions: m
3141
3139
  }) => {
3142
- const [o, h] = B(l), [u, N] = B(0), [y, r] = B(""), v = zt(y, 300), d = {
3140
+ const [o, u] = B(l), [h, N] = B(0), [y, r] = B(""), v = zt(y, 300), d = {
3143
3141
  users: o.users.filter(
3144
- (I) => I.name.toLowerCase().includes(v.toLowerCase())
3142
+ (R) => R.name.toLowerCase().includes(v.toLowerCase())
3145
3143
  ),
3146
3144
  groups: o.groups.filter(
3147
- (I) => I.name.toLowerCase().includes(v.toLowerCase())
3145
+ (R) => R.name.toLowerCase().includes(v.toLowerCase())
3148
3146
  ),
3149
3147
  roles: o.roles.filter(
3150
- (I) => I.name.toLowerCase().includes(v.toLowerCase())
3148
+ (R) => R.name.toLowerCase().includes(v.toLowerCase())
3151
3149
  )
3152
- }, g = async (I, P, _, U) => {
3150
+ }, g = async (R, P, j, U) => {
3153
3151
  const Y = P.value;
3154
- h((q) => ({
3152
+ u((q) => ({
3155
3153
  ...q,
3156
- [_]: q[_].map(
3157
- ($) => $.id === I.id ? { ...$, permission: Y } : $
3154
+ [j]: q[j].map(
3155
+ ($) => $.id === R.id ? { ...$, permission: Y } : $
3158
3156
  )
3159
3157
  }));
3160
- }, D = () => {
3161
- const I = {
3158
+ }, S = () => {
3159
+ const R = {
3162
3160
  users: o.users.filter((P) => P.permission !== "remove"),
3163
3161
  groups: o.groups.filter((P) => P.permission !== "remove"),
3164
3162
  roles: o.roles.filter((P) => P.permission !== "remove")
3165
3163
  };
3166
- a(I);
3164
+ a(R);
3167
3165
  }, F = ["users", "groups", "roles"], E = ["Users", "Groups", "Roles"];
3168
3166
  return (
3169
3167
  // The main structure remains the same...
@@ -3191,9 +3189,9 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3191
3189
  )
3192
3190
  ] }),
3193
3191
  /* @__PURE__ */ n("div", { className: "flex flex-col flex-grow", children: [
3194
- /* @__PURE__ */ n(se.Group, { selectedIndex: u, onChange: N, children: [
3192
+ /* @__PURE__ */ n(se.Group, { selectedIndex: h, onChange: N, children: [
3195
3193
  /* @__PURE__ */ n("div", { className: "p-4 bg-white border-b border-gray-300", children: [
3196
- /* @__PURE__ */ e(se.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: E.map((I) => /* @__PURE__ */ e(
3194
+ /* @__PURE__ */ e(se.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: E.map((R) => /* @__PURE__ */ e(
3197
3195
  se,
3198
3196
  {
3199
3197
  className: ({
@@ -3201,16 +3199,16 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3201
3199
  }) => `w-full py-2 text-sm font-medium leading-5 rounded-md
3202
3200
  focus:outline-none focus:ring-2 ring-offset-2 ring-offset-blue-400 ring-white ring-opacity-60
3203
3201
  ${P ? "bg-white shadow text-blue-700" : "text-gray-600 hover:bg-white/[0.6]"}`,
3204
- children: I
3202
+ children: R
3205
3203
  },
3206
- I
3204
+ R
3207
3205
  )) }),
3208
3206
  /* @__PURE__ */ e("div", { className: "mt-4", children: /* @__PURE__ */ e(
3209
3207
  ge,
3210
3208
  {
3211
3209
  onDebouncedChange: r,
3212
3210
  value: y,
3213
- placeholder: `Search in ${E[u]}...`
3211
+ placeholder: `Search in ${E[h]}...`
3214
3212
  }
3215
3213
  ) })
3216
3214
  ] }),
@@ -3221,11 +3219,11 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3221
3219
  animate: { y: 0, opacity: 1 },
3222
3220
  exit: { y: -10, opacity: 0 },
3223
3221
  transition: { duration: 0.2 },
3224
- children: /* @__PURE__ */ e(se.Panels, { as: Q, children: F.map((I) => /* @__PURE__ */ e(
3222
+ children: /* @__PURE__ */ e(se.Panels, { as: Q, children: F.map((R) => /* @__PURE__ */ e(
3225
3223
  se.Panel,
3226
3224
  {
3227
3225
  className: "space-y-3 focus:outline-none",
3228
- children: /* @__PURE__ */ e(Se, { children: d[I].length > 0 ? d[I].map((P) => /* @__PURE__ */ n(
3226
+ children: /* @__PURE__ */ e(Se, { children: d[R].length > 0 ? d[R].map((P) => /* @__PURE__ */ n(
3229
3227
  ie.div,
3230
3228
  {
3231
3229
  layout: !0,
@@ -3249,12 +3247,12 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3249
3247
  ),
3250
3248
  /* @__PURE__ */ n("div", { className: "overflow-hidden", children: [
3251
3249
  /* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: P.name }),
3252
- I !== "users" && /* @__PURE__ */ e(
3250
+ R !== "users" && /* @__PURE__ */ e(
3253
3251
  "button",
3254
3252
  {
3255
3253
  onClick: () => i({
3256
3254
  id: P.id,
3257
- type: I,
3255
+ type: R,
3258
3256
  name: P.name
3259
3257
  }),
3260
3258
  className: "text-sm text-blue-600 hover:underline hover:cursor-pointer",
@@ -3268,10 +3266,10 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3268
3266
  {
3269
3267
  item: P,
3270
3268
  allowedPermissions: m,
3271
- onPermissionChange: (_) => g(
3269
+ onPermissionChange: (j) => g(
3272
3270
  P,
3273
- _,
3274
- I
3271
+ j,
3272
+ R
3275
3273
  )
3276
3274
  }
3277
3275
  )
@@ -3290,25 +3288,25 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3290
3288
  /* @__PURE__ */ e(Kt, { className: "h-12 w-12 text-gray-400" }),
3291
3289
  /* @__PURE__ */ n("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
3292
3290
  "No ",
3293
- E[u],
3291
+ E[h],
3294
3292
  " Found"
3295
3293
  ] }),
3296
- /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: y ? `No results for "${y}"` : `There are no ${E[u].toLowerCase()} with access.` })
3294
+ /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: y ? `No results for "${y}"` : `There are no ${E[h].toLowerCase()} with access.` })
3297
3295
  ]
3298
3296
  }
3299
3297
  )
3300
3298
  ) })
3301
3299
  },
3302
- I
3300
+ R
3303
3301
  )) })
3304
3302
  },
3305
- u
3303
+ h
3306
3304
  ) }) })
3307
3305
  ] }),
3308
3306
  /* @__PURE__ */ e("div", { className: "p-4 bg-white border-t border-gray-300 flex justify-end", children: /* @__PURE__ */ e(
3309
3307
  "button",
3310
3308
  {
3311
- onClick: D,
3309
+ onClick: S,
3312
3310
  className: "px-4 py-2 bg-blue-600 text-white rounded-md shadow hover:bg-blue-700",
3313
3311
  children: "Update"
3314
3312
  }
@@ -3329,8 +3327,8 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3329
3327
  onClose: s,
3330
3328
  members: i
3331
3329
  }) => {
3332
- const [l, m] = B(!0), [o, h] = B(""), u = zt(o, 300), N = i.filter(
3333
- (d) => d.name.toLowerCase().includes(u.toLowerCase())
3330
+ const [l, m] = B(!0), [o, u] = B(""), h = zt(o, 300), N = i.filter(
3331
+ (d) => d.name.toLowerCase().includes(h.toLowerCase())
3334
3332
  ), y = {
3335
3333
  hidden: { opacity: 0 },
3336
3334
  visible: {
@@ -3355,7 +3353,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3355
3353
  children: [
3356
3354
  /* @__PURE__ */ e(cr, { className: "h-12 w-12 text-gray-400" }),
3357
3355
  /* @__PURE__ */ e("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: "No Users Found" }),
3358
- /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: u ? `No one found matching "${u}"` : `There are no users in this ${t.type}.` })
3356
+ /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: h ? `No one found matching "${h}"` : `There are no users in this ${t.type}.` })
3359
3357
  ]
3360
3358
  }
3361
3359
  ) : /* @__PURE__ */ e(
@@ -3422,7 +3420,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3422
3420
  /* @__PURE__ */ e("div", { className: "p-4 border-b border-gray-200 flex-shrink-0", children: /* @__PURE__ */ e(
3423
3421
  ge,
3424
3422
  {
3425
- onDebouncedChange: h,
3423
+ onDebouncedChange: u,
3426
3424
  value: o,
3427
3425
  placeholder: "Search members..."
3428
3426
  }
@@ -3447,29 +3445,29 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3447
3445
  onClose: m = () => {
3448
3446
  },
3449
3447
  showExistingShares: o = !0,
3450
- allowedPermissions: h = [],
3451
- ...u
3448
+ allowedPermissions: u = [],
3449
+ ...h
3452
3450
  }) => {
3453
- const [N, y] = B(be.INVITE), [r, v] = B(t), [d, g] = B(null), [D, F] = B(!1), [E, I] = B([]), [P, _] = B(be.MANAGE), U = () => {
3451
+ const [N, y] = B(be.INVITE), [r, v] = B(t), [d, g] = B(null), [S, F] = B(!1), [E, R] = B([]), [P, j] = B(be.MANAGE), U = () => {
3454
3452
  y(be.INVITE), g(null), m();
3455
3453
  }, Y = () => {
3456
3454
  y(be.MANAGE);
3457
- }, q = async ({ id: b, name: S, type: O }) => {
3455
+ }, q = async ({ id: f, name: z, type: O }) => {
3458
3456
  if (O === "groups") {
3459
3457
  try {
3460
- const R = await Ze(`${Je.getMembersForGroup(S)}`);
3461
- } catch (R) {
3462
- console.log("Error searching entities:", R);
3458
+ const I = await Ze(`${Je.getMembersForGroup(z)}`);
3459
+ } catch (I) {
3460
+ console.log("Error searching entities:", I);
3463
3461
  }
3464
- I(resp);
3462
+ R(resp);
3465
3463
  }
3466
- g({ id: b, type: O, name: S }), _(N), y(be.MEMBERS);
3467
- }, $ = (b) => {
3468
- console.log("changedExistingShares", b), v(b);
3469
- const S = it.mapValues(t, (z) => z.map((f) => ({ id: f.id, permission: f.permission })).sort((f, p) => f.id - p.id)), O = it.mapValues(b, (z) => z.map((f) => ({ id: f.id, permission: f.permission })).sort((f, p) => f.id - p.id));
3470
- console.log("Existing data:", S), console.log("Changed data:", O);
3471
- const R = !it.isEqual(S, O);
3472
- console.log("hasPermissionChanged:", R), F(R), y(N === be.MEMBERS ? P : be.INVITE);
3464
+ g({ id: f, type: O, name: z }), j(N), y(be.MEMBERS);
3465
+ }, $ = (f) => {
3466
+ console.log("changedExistingShares", f), v(f);
3467
+ const z = it.mapValues(t, (D) => D.map((b) => ({ id: b.id, permission: b.permission })).sort((b, p) => b.id - p.id)), O = it.mapValues(f, (D) => D.map((b) => ({ id: b.id, permission: b.permission })).sort((b, p) => b.id - p.id));
3468
+ console.log("Existing data:", z), console.log("Changed data:", O);
3469
+ const I = !it.isEqual(z, O);
3470
+ console.log("hasPermissionChanged:", I), F(I), y(N === be.MEMBERS ? P : be.INVITE);
3473
3471
  };
3474
3472
  return /* @__PURE__ */ e(he, { appear: !0, show: a, as: Q, children: /* @__PURE__ */ n(ye, { as: "div", className: "relative z-50", onClose: U, children: [
3475
3473
  /* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
@@ -3493,7 +3491,7 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3493
3491
  onOpenMembers: q,
3494
3492
  existingShares: r,
3495
3493
  calledBy: l,
3496
- allowedPermissions: h
3494
+ allowedPermissions: u
3497
3495
  }
3498
3496
  )
3499
3497
  },
@@ -3540,10 +3538,10 @@ const Ee = Kn(), Ze = Ee.axiosGet, ql = Ee.axiosDelete, xt = Ee.axiosPost, Yl =
3540
3538
  existingShares: r,
3541
3539
  calledBy: l,
3542
3540
  showExistingShares: o,
3543
- onFinalSubmit: (b) => {
3544
- s(b, r);
3541
+ onFinalSubmit: (f) => {
3542
+ s(f, r);
3545
3543
  },
3546
- isChanged: D
3544
+ isChanged: S
3547
3545
  }
3548
3546
  )
3549
3547
  },
@@ -3566,8 +3564,8 @@ function at({
3566
3564
  },
3567
3565
  placeholder: m = "Select options",
3568
3566
  error: o = null,
3569
- displayLimit: h = 3,
3570
- selectionLimit: u = -1,
3567
+ displayLimit: u = 3,
3568
+ selectionLimit: h = -1,
3571
3569
  // NEW: search behavior
3572
3570
  searchMode: N = "client",
3573
3571
  // "client" | "server"
@@ -3576,27 +3574,27 @@ function at({
3576
3574
  serverLoading: r = !1,
3577
3575
  minSearchChars: v = 2,
3578
3576
  // NEW: mappers (id/label keys)
3579
- getOptionId: d = (D) => String(D.id),
3580
- getOptionLabel: g = (D) => D.name
3577
+ getOptionId: d = (S) => String(S.id),
3578
+ getOptionLabel: g = (S) => S.name
3581
3579
  }) {
3582
- const D = He(), F = He(), [E, I] = B(""), P = fe(""), _ = ae(() => {
3583
- const b = /* @__PURE__ */ new Map();
3584
- for (const S of a) b.set(d(S), S);
3585
- return b;
3586
- }, [a, d]), U = ae(() => Array.isArray(s) ? s.map((b) => b && typeof b == "object" ? _.get(d(b)) || null : _.get(String(b))).filter(Boolean) : [], [s, _, d]), Y = ae(() => {
3580
+ const S = He(), F = He(), [E, R] = B(""), P = fe(""), j = ae(() => {
3581
+ const f = /* @__PURE__ */ new Map();
3582
+ for (const z of a) f.set(d(z), z);
3583
+ return f;
3584
+ }, [a, d]), U = ae(() => Array.isArray(s) ? s.map((f) => f && typeof f == "object" ? j.get(d(f)) || null : j.get(String(f))).filter(Boolean) : [], [s, j, d]), Y = ae(() => {
3587
3585
  if (!E) return a;
3588
- const b = E.toLowerCase();
3589
- return a.filter((S) => g(S).toLowerCase().includes(b));
3586
+ const f = E.toLowerCase();
3587
+ return a.filter((z) => g(z).toLowerCase().includes(f));
3590
3588
  }, [a, E, g]);
3591
- Z(() => {
3589
+ te(() => {
3592
3590
  N === "server" && E.length >= v && E !== P.current && (P.current = E, y && y(E));
3593
3591
  }, [E, N, v, y]);
3594
3592
  const q = N === "client" ? Y : a, $ = () => {
3595
3593
  if (!U.length)
3596
3594
  return /* @__PURE__ */ e("span", { className: "text-gray-500", children: m });
3597
- const b = U.slice(0, h), S = U.length - h;
3595
+ const f = U.slice(0, u), z = U.length - u;
3598
3596
  return /* @__PURE__ */ n("div", { className: "flex flex-wrap gap-2", children: [
3599
- b.map((O) => /* @__PURE__ */ e(
3597
+ f.map((O) => /* @__PURE__ */ e(
3600
3598
  "span",
3601
3599
  {
3602
3600
  className: "px-2 py-1 text-xs font-medium text-white bg-gray-800 rounded-full",
@@ -3604,30 +3602,30 @@ function at({
3604
3602
  },
3605
3603
  d(O)
3606
3604
  )),
3607
- S > 0 && /* @__PURE__ */ n("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
3605
+ z > 0 && /* @__PURE__ */ n("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
3608
3606
  "+",
3609
- S,
3607
+ z,
3610
3608
  " more"
3611
3609
  ] })
3612
3610
  ] });
3613
3611
  };
3614
- return /* @__PURE__ */ e(K, { value: U, onChange: (b) => {
3615
- const S = Array.from(new Set(b.map((O) => d(O))));
3616
- u !== -1 && S.length > u || i(S);
3617
- }, multiple: !0, by: "id", children: ({ open: b }) => /* @__PURE__ */ n("div", { children: [
3612
+ return /* @__PURE__ */ e(Z, { value: U, onChange: (f) => {
3613
+ const z = Array.from(new Set(f.map((O) => d(O))));
3614
+ h !== -1 && z.length > h || i(z);
3615
+ }, multiple: !0, by: "id", children: ({ open: f }) => /* @__PURE__ */ n("div", { children: [
3618
3616
  /* @__PURE__ */ e(
3619
- K.Label,
3617
+ Z.Label,
3620
3618
  {
3621
- id: D,
3619
+ id: S,
3622
3620
  className: "block text-sm font-medium leading-6 text-gray-900",
3623
3621
  children: t
3624
3622
  }
3625
3623
  ),
3626
3624
  /* @__PURE__ */ n("div", { className: "relative mt-2", children: [
3627
3625
  /* @__PURE__ */ n(
3628
- K.Button,
3626
+ Z.Button,
3629
3627
  {
3630
- "aria-labelledby": D,
3628
+ "aria-labelledby": S,
3631
3629
  "aria-invalid": !!o,
3632
3630
  "aria-describedby": o ? F : void 0,
3633
3631
  onBlur: l,
@@ -3645,32 +3643,32 @@ function at({
3645
3643
  he,
3646
3644
  {
3647
3645
  as: Q,
3648
- show: b,
3646
+ show: f,
3649
3647
  leave: "transition ease-in duration-100",
3650
3648
  leaveFrom: "opacity-100",
3651
3649
  leaveTo: "opacity-0",
3652
- children: /* @__PURE__ */ n(K.Options, { className: "absolute z-10 w-full py-1 mt-1 overflow-auto text-base bg-white rounded-md shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: [
3650
+ children: /* @__PURE__ */ n(Z.Options, { className: "absolute z-10 w-full py-1 mt-1 overflow-auto text-base bg-white rounded-md shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: [
3653
3651
  /* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
3654
3652
  ge,
3655
3653
  {
3656
3654
  value: E,
3657
- onDebouncedChange: I,
3655
+ onDebouncedChange: R,
3658
3656
  placeholder: N === "server" ? `Search (min ${v})…` : "Search options…"
3659
3657
  }
3660
3658
  ) }),
3661
3659
  N === "server" && r && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
3662
- q.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: N === "server" ? E.length < v ? `Type at least ${v} characters to search.` : "No results." : "No options found." }) : q.map((S) => {
3663
- const O = d(S), R = g(S), z = U.some((p) => d(p) === O), f = u !== -1 && U.length >= u && !z;
3660
+ q.length === 0 && !r ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: N === "server" ? E.length < v ? `Type at least ${v} characters to search.` : "No results." : "No options found." }) : q.map((z) => {
3661
+ const O = d(z), I = g(z), D = U.some((p) => d(p) === O), b = h !== -1 && U.length >= h && !D;
3664
3662
  return /* @__PURE__ */ e(
3665
- K.Option,
3663
+ Z.Option,
3666
3664
  {
3667
- value: S,
3668
- disabled: f,
3665
+ value: z,
3666
+ disabled: b,
3669
3667
  className: ({ active: p }) => Ge(
3670
- f ? " text-gray-400 bg-white cursor-not-allowed" : p ? " bg-gray-200 text-gray-900" : " text-gray-900",
3668
+ b ? " text-gray-400 bg-white cursor-not-allowed" : p ? " bg-gray-200 text-gray-900" : " text-gray-900",
3671
3669
  " relative cursor-default select-none py-2 pl-3 pr-9"
3672
3670
  ),
3673
- children: ({ selected: p, active: k }) => /* @__PURE__ */ n(te, { children: [
3671
+ children: ({ selected: p, active: w }) => /* @__PURE__ */ n(ee, { children: [
3674
3672
  /* @__PURE__ */ e(
3675
3673
  "span",
3676
3674
  {
@@ -3678,14 +3676,14 @@ function at({
3678
3676
  p ? "font-semibold" : "font-normal",
3679
3677
  "block truncate"
3680
3678
  ),
3681
- children: R
3679
+ children: I
3682
3680
  }
3683
3681
  ),
3684
3682
  p && /* @__PURE__ */ e(
3685
3683
  "span",
3686
3684
  {
3687
3685
  className: Ge(
3688
- k ? " text-gray-900" : " text-gray-600",
3686
+ w ? " text-gray-900" : " text-gray-600",
3689
3687
  " absolute inset-y-0 right-0 flex items-center pr-4"
3690
3688
  ),
3691
3689
  children: /* @__PURE__ */ e(et, { className: "w-5 h-5", "aria-hidden": "true" })
@@ -3753,9 +3751,9 @@ const Xl = ({
3753
3751
  footer: l = { show: !0, customFooter: null },
3754
3752
  primaryAction: m = { onSubmit: null, label: "Save", loader: !1, disabled: !1 },
3755
3753
  secondaryAction: o = { onCancel: null, label: "Cancel" },
3756
- dialogPanelClass: h = ""
3754
+ dialogPanelClass: u = ""
3757
3755
  }) => {
3758
- const u = (y) => {
3756
+ const h = (y) => {
3759
3757
  y.target === y.currentTarget && a(!1);
3760
3758
  }, N = (y) => {
3761
3759
  y.stopPropagation();
@@ -3771,13 +3769,13 @@ const Xl = ({
3771
3769
  Qr,
3772
3770
  {
3773
3771
  className: "fixed inset-0 bg-black/30",
3774
- onClick: u
3772
+ onClick: h
3775
3773
  }
3776
3774
  ),
3777
3775
  /* @__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__ */ n(
3778
3776
  Fe,
3779
3777
  {
3780
- className: `${h} 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`,
3778
+ className: `${u} relative bg-white align-middle w-full lg:w-[36rem] mx-5 lg:mx-0 transform overflow-hidden rounded-2xl text-left shadow-xl lg:min-w-[36rem] md:min-w-96 transition-all`,
3781
3779
  onClick: N,
3782
3780
  children: [
3783
3781
  /* @__PURE__ */ n("div", { className: "flex justify-between items-center border-b border-gray-200 p-6 flex-shrink-0", children: [
@@ -3850,16 +3848,16 @@ function ms({
3850
3848
  onSelect: l,
3851
3849
  onCreateChild: m,
3852
3850
  onRename: o,
3853
- onDelete: h,
3854
- renderActions: u,
3851
+ onDelete: u,
3852
+ renderActions: h,
3855
3853
  // optional override
3856
3854
  dragId: N,
3857
3855
  dropId: y,
3858
3856
  indent: r = 24
3859
3857
  }) {
3860
- const { setNodeRef: v, isOver: d } = dr({ id: y }), { attributes: g, listeners: D, setNodeRef: F, transform: E, isDragging: I } = mr({ id: N }), P = E ? { transform: `translate3d(${Math.round(E.x)}px, ${Math.round(E.y)}px, 0)` } : void 0, [_, U] = B(!1), [Y, q] = B(t.name), $ = () => {
3861
- const b = Y.trim();
3862
- U(!1), b && b !== t.name ? o?.(t, b) : q(t.name);
3858
+ const { setNodeRef: v, isOver: d } = dr({ id: y }), { attributes: g, listeners: S, setNodeRef: F, transform: E, isDragging: R } = mr({ id: N }), P = E ? { transform: `translate3d(${Math.round(E.x)}px, ${Math.round(E.y)}px, 0)` } : void 0, [j, U] = B(!1), [Y, q] = B(t.name), $ = () => {
3859
+ const f = Y.trim();
3860
+ U(!1), f && f !== t.name ? o?.(t, f) : q(t.name);
3863
3861
  }, x = ae(() => /* @__PURE__ */ e(
3864
3862
  Gn,
3865
3863
  {
@@ -3868,41 +3866,41 @@ function ms({
3868
3866
  { action: "rename", label: "Rename" },
3869
3867
  { action: "delete", label: "Delete" }
3870
3868
  ],
3871
- onSelect: (S) => {
3872
- S.action === "create" ? m?.(t) : S.action === "rename" ? U(!0) : S.action === "delete" && h?.(t);
3869
+ onSelect: (z) => {
3870
+ z.action === "create" ? m?.(t) : z.action === "rename" ? U(!0) : z.action === "delete" && u?.(t);
3873
3871
  }
3874
3872
  }
3875
- ), [t, m, h]);
3873
+ ), [t, m, u]);
3876
3874
  return /* @__PURE__ */ n(
3877
3875
  "div",
3878
3876
  {
3879
3877
  ref: v,
3880
- className: `tv-row ${d ? "tv-drop-over" : ""} ${I ? "dragging" : ""}`,
3878
+ className: `tv-row ${d ? "tv-drop-over" : ""} ${R ? "dragging" : ""}`,
3881
3879
  style: { ...P, paddingLeft: 8 + a * r },
3882
- onClick: (b) => {
3883
- b.target.closest(".tv-toggle") || b.target.tagName === "INPUT" || l?.(t);
3880
+ onClick: (f) => {
3881
+ f.target.closest(".tv-toggle") || f.target.tagName === "INPUT" || l?.(t);
3884
3882
  },
3885
3883
  children: [
3886
3884
  /* @__PURE__ */ e("button", { className: "tv-toggle", onClick: i, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(Nt, { size: 16 }) : /* @__PURE__ */ e(xe, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
3887
3885
  /* @__PURE__ */ e(Be, { size: 16, className: "tv-folder-ic" }),
3888
- /* @__PURE__ */ e("div", { className: "tv-name", ref: F, children: _ ? /* @__PURE__ */ e(
3886
+ /* @__PURE__ */ e("div", { className: "tv-name", ref: F, children: j ? /* @__PURE__ */ e(
3889
3887
  "input",
3890
3888
  {
3891
3889
  className: "tv-input",
3892
3890
  value: Y,
3893
- onChange: (b) => q(b.target.value),
3891
+ onChange: (f) => q(f.target.value),
3894
3892
  onBlur: $,
3895
- onKeyDown: (b) => {
3896
- b.key === "Enter" && $(), b.key === "Escape" && (U(!1), q(t.name));
3893
+ onKeyDown: (f) => {
3894
+ f.key === "Enter" && $(), f.key === "Escape" && (U(!1), q(t.name));
3897
3895
  },
3898
3896
  autoFocus: !0
3899
3897
  }
3900
3898
  ) : /* @__PURE__ */ e("span", { onDoubleClick: () => U(!0), children: t.name }) }),
3901
- /* @__PURE__ */ e(ds, { listeners: D, attributes: g }),
3902
- /* @__PURE__ */ e("div", { className: "tv-actions", children: u ? u(t, {
3899
+ /* @__PURE__ */ e(ds, { listeners: S, attributes: g }),
3900
+ /* @__PURE__ */ e("div", { className: "tv-actions", children: h ? h(t, {
3903
3901
  onCreateChild: () => m?.(t),
3904
3902
  onRename: () => U(!0),
3905
- onDelete: () => h?.(t)
3903
+ onDelete: () => u?.(t)
3906
3904
  }) : x })
3907
3905
  ]
3908
3906
  }
@@ -3911,35 +3909,35 @@ function ms({
3911
3909
  const us = (t) => String(t.id ?? t._id), hs = (t) => t.parent !== void 0 ? String(t.parent) : t.parentId != null ? String(t.parentId) : "root", ps = (t) => t.name ?? t.label ?? "", gs = (t) => Array.isArray(t) && t.some((a) => Array.isArray(a.children));
3912
3910
  function bs(t, { rootId: a, getId: s, getParent: i, getName: l }) {
3913
3911
  const m = /* @__PURE__ */ new Map();
3914
- t.forEach((h) => {
3915
- const u = s(h);
3916
- m.set(u, {
3917
- ...h,
3918
- id: u,
3919
- name: l(h),
3920
- parentId: i(h) || a,
3912
+ t.forEach((u) => {
3913
+ const h = s(u);
3914
+ m.set(h, {
3915
+ ...u,
3916
+ id: h,
3917
+ name: l(u),
3918
+ parentId: i(u) || a,
3921
3919
  children: []
3922
3920
  });
3923
3921
  });
3924
3922
  const o = [];
3925
- return m.forEach((h) => {
3926
- const u = h.parentId || a;
3927
- u !== a && m.has(u) ? m.get(u).children.push(h) : o.push(h);
3923
+ return m.forEach((u) => {
3924
+ const h = u.parentId || a;
3925
+ h !== a && m.has(h) ? m.get(h).children.push(u) : o.push(u);
3928
3926
  }), { roots: o, byId: m };
3929
3927
  }
3930
3928
  function fs(t, { rootId: a, getId: s, getName: i }) {
3931
3929
  const l = /* @__PURE__ */ new Map();
3932
- function m(h, u) {
3933
- const N = s(h), y = {
3934
- ...h,
3930
+ function m(u, h) {
3931
+ const N = s(u), y = {
3932
+ ...u,
3935
3933
  id: N,
3936
- name: i(h),
3937
- parentId: u || a,
3938
- children: (h.children || []).map((r) => m(r, N))
3934
+ name: i(u),
3935
+ parentId: h || a,
3936
+ children: (u.children || []).map((r) => m(r, N))
3939
3937
  };
3940
3938
  return l.set(N, y), y;
3941
3939
  }
3942
- return { roots: t.map((h) => m(h, null)), byId: l };
3940
+ return { roots: t.map((u) => m(u, null)), byId: l };
3943
3941
  }
3944
3942
  const Me = (t) => t.map((a) => ({ ...a, children: Me(a.children || []) }));
3945
3943
  function ys(t, a) {
@@ -3949,8 +3947,8 @@ function ys(t, a) {
3949
3947
  if (o.id === a)
3950
3948
  return s = o, null;
3951
3949
  if (o.children?.length) {
3952
- const h = i(o.children);
3953
- if (h !== o.children) return { ...o, children: h };
3950
+ const u = i(o.children);
3951
+ if (u !== o.children) return { ...o, children: u };
3954
3952
  }
3955
3953
  return o;
3956
3954
  }).filter(Boolean);
@@ -3989,8 +3987,8 @@ function Hl({
3989
3987
  getParent: l = hs,
3990
3988
  getName: m = ps,
3991
3989
  onSelect: o,
3992
- onCreateRoot: h,
3993
- onCreateChild: u,
3990
+ onCreateRoot: u,
3991
+ onCreateChild: h,
3994
3992
  onRename: N,
3995
3993
  onDelete: y,
3996
3994
  onMove: r,
@@ -3999,42 +3997,42 @@ function Hl({
3999
3997
  // ← allow root moves by default now
4000
3998
  indentUnit: g = 24
4001
3999
  }) {
4002
- const { roots: D } = ae(() => gs(t) ? fs(t, { rootId: a, getId: i, getName: m }) : bs(
4003
- t.map((f) => ({ ...f })),
4000
+ const { roots: S } = ae(() => gs(t) ? fs(t, { rootId: a, getId: i, getName: m }) : bs(
4001
+ t.map((b) => ({ ...b })),
4004
4002
  { rootId: a, getId: i, getParent: l, getName: m }
4005
- ), [t, a, i, l, m]), [F, E] = B({}), I = ee((f) => {
4003
+ ), [t, a, i, l, m]), [F, E] = B({}), R = K((b) => {
4006
4004
  const p = {};
4007
- return (function k(w) {
4008
- w.forEach((T) => {
4009
- p[T.id] = !0, T.children?.length && k(T.children);
4005
+ return (function w(k) {
4006
+ k.forEach((T) => {
4007
+ p[T.id] = !0, T.children?.length && w(T.children);
4010
4008
  });
4011
- })(f), p;
4009
+ })(b), p;
4012
4010
  }, []);
4013
4011
  re.useEffect(() => {
4014
- E(I(D));
4015
- }, [D, I]);
4016
- const P = ee(
4017
- (f) => E((p) => ({ ...p, [f]: !p[f] })),
4012
+ E(R(S));
4013
+ }, [S, R]);
4014
+ const P = K(
4015
+ (b) => E((p) => ({ ...p, [b]: !p[b] })),
4018
4016
  []
4019
- ), [_, U] = B(() => Me(D));
4020
- re.useEffect(() => U(Me(D)), [D]);
4017
+ ), [j, U] = B(() => Me(S));
4018
+ re.useEffect(() => U(Me(S)), [S]);
4021
4019
  const Y = ur(
4022
4020
  hr(fr, { activationConstraint: { delay: 250, tolerance: 5 } })
4023
- ), q = fe(null), [$, x] = B(null), b = fe(0), S = () => {
4024
- }, O = ({ delta: f }) => {
4025
- b.current = f?.x ?? 0;
4026
- }, R = ee(
4027
- ({ active: f, over: p }) => {
4028
- const k = b.current;
4029
- if (b.current = 0, x(null), !f || !p) return;
4030
- const w = String(f.id).replace(/^drag-/, ""), T = String(p.id).replace(/^drop-/, "");
4031
- if (!w || !T || w === T) return;
4021
+ ), q = fe(null), [$, x] = B(null), f = fe(0), z = () => {
4022
+ }, O = ({ delta: b }) => {
4023
+ f.current = b?.x ?? 0;
4024
+ }, I = K(
4025
+ ({ active: b, over: p }) => {
4026
+ const w = f.current;
4027
+ if (f.current = 0, x(null), !b || !p) return;
4028
+ const k = String(b.id).replace(/^drag-/, ""), T = String(p.id).replace(/^drop-/, "");
4029
+ if (!k || !T || k === T) return;
4032
4030
  let L = T;
4033
- const C = Math.max(0, Math.floor(-k / g));
4031
+ const C = Math.max(0, Math.floor(-w / g));
4034
4032
  if (C > 0) {
4035
4033
  let W = T;
4036
4034
  for (let pe = 0; pe < C; pe++) {
4037
- const Ne = Sa(_, W, null);
4035
+ const Ne = Sa(j, W, null);
4038
4036
  if (!Ne) break;
4039
4037
  if (!Ne.parentId) {
4040
4038
  L = a;
@@ -4044,70 +4042,70 @@ function Hl({
4044
4042
  }
4045
4043
  }
4046
4044
  if (d && L === a) {
4047
- U(Me(D));
4045
+ U(Me(S));
4048
4046
  return;
4049
4047
  }
4050
- const M = Me(_), { newRoots: V, removed: A } = ys(M, w);
4048
+ const M = Me(j), { newRoots: _, removed: A } = ys(M, k);
4051
4049
  if (!A) return;
4052
- const G = xs(V, L, A);
4053
- U(G), r?.({ sourceId: w, destParentId: L, newTree: G });
4050
+ const G = xs(_, L, A);
4051
+ U(G), r?.({ sourceId: k, destParentId: L, newTree: G });
4054
4052
  },
4055
- [_, D, a, d, g, r]
4056
- ), z = ee(
4057
- (f, p = 0) => f.map((k) => /* @__PURE__ */ n(re.Fragment, { children: [
4053
+ [j, S, a, d, g, r]
4054
+ ), D = K(
4055
+ (b, p = 0) => b.map((w) => /* @__PURE__ */ n(re.Fragment, { children: [
4058
4056
  /* @__PURE__ */ e(
4059
4057
  ms,
4060
4058
  {
4061
- node: k,
4059
+ node: w,
4062
4060
  depth: p,
4063
- expanded: !!F[k.id],
4064
- onToggle: () => P(k.id),
4061
+ expanded: !!F[w.id],
4062
+ onToggle: () => P(w.id),
4065
4063
  onSelect: o,
4066
- onCreateChild: u,
4064
+ onCreateChild: h,
4067
4065
  onRename: N,
4068
4066
  onDelete: y,
4069
4067
  renderActions: v,
4070
- dragId: `drag-${k.id}`,
4071
- dropId: `drop-${k.id}`,
4068
+ dragId: `drag-${w.id}`,
4069
+ dropId: `drop-${w.id}`,
4072
4070
  indent: g
4073
4071
  }
4074
4072
  ),
4075
- F[k.id] && k.children?.length > 0 ? z(k.children, p + 1) : null
4076
- ] }, k.id)),
4077
- [F, g, u, y, N, o, v, P]
4073
+ F[w.id] && w.children?.length > 0 ? D(w.children, p + 1) : null
4074
+ ] }, w.id)),
4075
+ [F, g, h, y, N, o, v, P]
4078
4076
  );
4079
4077
  return re.useMemo(() => {
4080
4078
  if (!$) return null;
4081
- const f = String($).replace(/^drag-/, "");
4082
- function p(k) {
4083
- for (const w of k) {
4084
- if (w.id === f) return w;
4085
- const T = w.children?.length ? p(w.children) : null;
4079
+ const b = String($).replace(/^drag-/, "");
4080
+ function p(w) {
4081
+ for (const k of w) {
4082
+ if (k.id === b) return k;
4083
+ const T = k.children?.length ? p(k.children) : null;
4086
4084
  if (T) return T;
4087
4085
  }
4088
4086
  return null;
4089
4087
  }
4090
- return p(_);
4091
- }, [$, _]), /* @__PURE__ */ n("div", { className: "tv", children: [
4088
+ return p(j);
4089
+ }, [$, j]), /* @__PURE__ */ n("div", { className: "tv", children: [
4092
4090
  s !== !1 && /* @__PURE__ */ n("div", { className: "tv-header", children: [
4093
4091
  /* @__PURE__ */ e("div", { className: "tv-title", children: s }),
4094
- /* @__PURE__ */ e("button", { className: "tv-btn", onClick: h, children: "+ New folder" })
4092
+ /* @__PURE__ */ e("button", { className: "tv-btn", onClick: u, children: "+ New folder" })
4095
4093
  ] }),
4096
4094
  /* @__PURE__ */ n("div", { className: "tv-root-row", children: [
4097
4095
  /* @__PURE__ */ e(Be, { size: 16, className: "tv-folder-ic" }),
4098
4096
  /* @__PURE__ */ e("strong", { children: "ROOT" }),
4099
- /* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick: h, children: "+" })
4097
+ /* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick: u, children: "+" })
4100
4098
  ] }),
4101
4099
  /* @__PURE__ */ e(
4102
4100
  pr,
4103
4101
  {
4104
4102
  collisionDetection: br,
4105
4103
  sensors: Y,
4106
- onDragStart: S,
4104
+ onDragStart: z,
4107
4105
  onDragMove: O,
4108
- onDragEnd: R,
4106
+ onDragEnd: I,
4109
4107
  modifiers: [gr],
4110
- children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children: z(_, 0) })
4108
+ children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children: D(j, 0) })
4111
4109
  }
4112
4110
  )
4113
4111
  ] });
@@ -4123,22 +4121,22 @@ const Ql = ({
4123
4121
  listClassName: l = "",
4124
4122
  panelClassName: m = "",
4125
4123
  tabClassName: o,
4126
- ...h
4124
+ ...u
4127
4125
  // Pass remaining props to Tab.Group
4128
4126
  }) => {
4129
- const u = s === "vertical", N = (v) => ze(
4127
+ const h = s === "vertical", N = (v) => ze(
4130
4128
  "py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
4131
4129
  v ? "border-primaryX text-textX" : "border-transparent text-slate-600 hover:text-indigo-700"
4132
4130
  ), y = (v) => ze(
4133
4131
  "text-left text-sm rounded-md px-2 py-1.5 focus:outline-none",
4134
4132
  v ? "bg-primaryX text-white" : "text-textX hover:bg-lightgray-100 hover:text-primaryX"
4135
- ), r = ({ selected: v }) => o ? typeof o == "function" ? o(v) : o : u ? y(v) : N(v);
4136
- return /* @__PURE__ */ e(se.Group, { vertical: u, ...h, children: u ? /* @__PURE__ */ n("div", { className: ze("flex gap-4", i), children: [
4133
+ ), r = ({ selected: v }) => o ? typeof o == "function" ? o(v) : o : h ? y(v) : N(v);
4134
+ return /* @__PURE__ */ e(se.Group, { vertical: h, ...u, children: h ? /* @__PURE__ */ n("div", { className: ze("flex gap-4", i), children: [
4137
4135
  /* @__PURE__ */ e(se.List, { className: ze("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", l), children: t.map((v) => /* @__PURE__ */ e(se, { className: r, children: v.label }, v.key)) }),
4138
4136
  /* @__PURE__ */ e(se.Panels, { unmount: !a, className: ze("flex-1", m), children: t.map((v) => /* @__PURE__ */ e(se.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: v.content }) }, v.key)) })
4139
4137
  ] }) : (
4140
4138
  // mostly this part is used : horizontal
4141
- /* @__PURE__ */ n(te, { children: [
4139
+ /* @__PURE__ */ n(ee, { children: [
4142
4140
  /* @__PURE__ */ e(se.List, { className: ze("flex gap-6 border rounded-t-2xl px-1.5 border-gray-300 mb-3 ", l), children: t.map((v) => /* @__PURE__ */ e(se, { className: r, children: v.label }, v.key)) }),
4143
4141
  /* @__PURE__ */ e(se.Panels, { unmount: !a, className: ze("mt-2", m), children: t.map((v) => /* @__PURE__ */ e(se.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: v.content }) }, v.key)) })
4144
4142
  ] })
@@ -4150,41 +4148,41 @@ function Zl(t, a = "YYYY-MM-DD HH:mm:ss") {
4150
4148
  c.string;
4151
4149
  function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4152
4150
  console.log(t);
4153
- const [l, m] = re.useState(t), [o, h] = re.useState(() => {
4151
+ const [l, m] = re.useState(t), [o, u] = re.useState(() => {
4154
4152
  const r = a && a[t.key] || {};
4155
4153
  return console.log("Initial Section data for", t.key, r), r;
4156
- }), u = fe(a);
4157
- Z(() => {
4158
- if (u.current !== a) {
4159
- u.current = a;
4154
+ }), h = fe(a);
4155
+ te(() => {
4156
+ if (h.current !== a) {
4157
+ h.current = a;
4160
4158
  const r = a && a[t.key] || {};
4161
- console.log("Updated Section data for", t.key, r), h(r);
4159
+ console.log("Updated Section data for", t.key, r), u(r);
4162
4160
  }
4163
4161
  }, [a, t.key]), console.log("Section data", o);
4164
4162
  const N = fe(o);
4165
- Z(() => {
4163
+ te(() => {
4166
4164
  N.current !== o && s && typeof s == "function" && (N.current = o, s(l.key, o));
4167
4165
  }, [l.key, o, s]);
4168
4166
  const y = (r) => {
4169
4167
  if (!r.dependsOn) return !0;
4170
- const { field: v, value: d, operator: g = "equals" } = r.dependsOn, D = o[v];
4168
+ const { field: v, value: d, operator: g = "equals" } = r.dependsOn, S = o[v];
4171
4169
  switch (g) {
4172
4170
  case "equals":
4173
- return D === d;
4171
+ return S === d;
4174
4172
  case "notEquals":
4175
- return D !== d;
4173
+ return S !== d;
4176
4174
  case "contains":
4177
- return Array.isArray(D) && D.includes(d);
4175
+ return Array.isArray(S) && S.includes(d);
4178
4176
  case "notContains":
4179
- return !Array.isArray(D) || !D.includes(d);
4177
+ return !Array.isArray(S) || !S.includes(d);
4180
4178
  case "greaterThan":
4181
- return Number(D) > Number(d);
4179
+ return Number(S) > Number(d);
4182
4180
  case "lessThan":
4183
- return Number(D) < Number(d);
4181
+ return Number(S) < Number(d);
4184
4182
  case "isEmpty":
4185
- return !D || Array.isArray(D) && D.length === 0;
4183
+ return !S || Array.isArray(S) && S.length === 0;
4186
4184
  case "isNotEmpty":
4187
- return D && (!Array.isArray(D) || D.length > 0);
4185
+ return S && (!Array.isArray(S) || S.length > 0);
4188
4186
  default:
4189
4187
  return !0;
4190
4188
  }
@@ -4210,8 +4208,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4210
4208
  name: r.key,
4211
4209
  checked: !!(o[r.key] || r.default),
4212
4210
  onChange: (d) => {
4213
- const g = d.target ? d.target.checked : d, D = { ...o, [r.key]: g };
4214
- h(D), s && s(l.key, D);
4211
+ const g = d.target ? d.target.checked : d, S = { ...o, [r.key]: g };
4212
+ u(S), s && s(l.key, S);
4215
4213
  },
4216
4214
  label: r.label,
4217
4215
  disabled: r.disabled ? r.disabled : !1
@@ -4266,7 +4264,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4266
4264
  value: o[r.key] || "",
4267
4265
  onChange: (d) => {
4268
4266
  const g = { ...o, [r.key]: d.target.value };
4269
- h(g), s && s(l.key, g);
4267
+ u(g), s && s(l.key, g);
4270
4268
  },
4271
4269
  required: r.required,
4272
4270
  disabled: r.disabled ? r.disabled : !1,
@@ -4286,7 +4284,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4286
4284
  value: o[r.key] || "",
4287
4285
  onChange: (d) => {
4288
4286
  const g = { ...o, [r.key]: d.target.value };
4289
- h(g), s && s(l.key, g);
4287
+ u(g), s && s(l.key, g);
4290
4288
  },
4291
4289
  rows: 3,
4292
4290
  required: r.required,
@@ -4310,14 +4308,14 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4310
4308
  max: r.max,
4311
4309
  step: r.step,
4312
4310
  onChange: (d) => {
4313
- const g = d.target.value, D = { ...o, [r.key]: g };
4314
- h(D), s && s(l.key, D);
4311
+ const g = d.target.value, S = { ...o, [r.key]: g };
4312
+ u(S), s && s(l.key, S);
4315
4313
  },
4316
4314
  onBlur: (d) => {
4317
4315
  const g = d.target.value;
4318
4316
  if (g !== "" && g !== null && g !== void 0) {
4319
- const D = Number(g);
4320
- isNaN(D) || (r.min !== void 0 && D < r.min ? (d.target.setCustomValidity(`${r.label} must be at least ${r.min}`), d.target.reportValidity()) : r.max !== void 0 && D > r.max ? (d.target.setCustomValidity(`${r.label} must not exceed ${r.max}`), d.target.reportValidity()) : d.target.setCustomValidity(""));
4317
+ const S = Number(g);
4318
+ isNaN(S) || (r.min !== void 0 && S < r.min ? (d.target.setCustomValidity(`${r.label} must be at least ${r.min}`), d.target.reportValidity()) : r.max !== void 0 && S > r.max ? (d.target.setCustomValidity(`${r.label} must not exceed ${r.max}`), d.target.reportValidity()) : d.target.setCustomValidity(""));
4321
4319
  }
4322
4320
  },
4323
4321
  required: r.required,
@@ -4342,8 +4340,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4342
4340
  name: r.key,
4343
4341
  checked: !!(o[r.key] || r.default),
4344
4342
  onChange: (d) => {
4345
- const g = d.target ? d.target.checked : d, D = { ...o, [r.key]: g };
4346
- h(D), s && s(l.key, D);
4343
+ const g = d.target ? d.target.checked : d, S = { ...o, [r.key]: g };
4344
+ u(S), s && s(l.key, S);
4347
4345
  },
4348
4346
  label: r.placeholder || r.label,
4349
4347
  disabled: r.disabled ? r.disabled : !1,
@@ -4361,7 +4359,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4361
4359
  value: o[r.key] || "",
4362
4360
  onChange: (d) => {
4363
4361
  const g = { ...o, [r.key]: d };
4364
- h(g);
4362
+ u(g);
4365
4363
  },
4366
4364
  options: r.options || [],
4367
4365
  placeholder: r.placeholder || `Select ${r.label}`,
@@ -4383,7 +4381,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4383
4381
  value: o[r.key] || "",
4384
4382
  onChange: (d) => {
4385
4383
  const g = { ...o, [r.key]: d.target.value };
4386
- h(g), s && s(l.key, g);
4384
+ u(g), s && s(l.key, g);
4387
4385
  },
4388
4386
  required: r.required,
4389
4387
  disabled: r.disabled ? r.disabled : !1,
@@ -4403,7 +4401,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4403
4401
  value: o[r.key] || "",
4404
4402
  onChange: (d) => {
4405
4403
  const g = { ...o, [r.key]: d.target.value };
4406
- h(g), s && s(l.key, g);
4404
+ u(g), s && s(l.key, g);
4407
4405
  },
4408
4406
  required: r.required,
4409
4407
  disabled: r.disabled ? r.disabled : !1,
@@ -4423,7 +4421,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4423
4421
  value: o[r.key] || "",
4424
4422
  onChange: (d) => {
4425
4423
  const g = { ...o, [r.key]: d.target.value };
4426
- h(g), s && s(l.key, g);
4424
+ u(g), s && s(l.key, g);
4427
4425
  },
4428
4426
  required: r.required,
4429
4427
  disabled: r.disabled ? r.disabled : !1,
@@ -4439,7 +4437,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4439
4437
  selectedItems: o[r.key] || [],
4440
4438
  onSelectionChange: (d) => {
4441
4439
  const g = { ...o, [r.key]: d };
4442
- h(g), s && s(l.key, g);
4440
+ u(g), s && s(l.key, g);
4443
4441
  },
4444
4442
  options: r.options || [],
4445
4443
  placeholder: r.placeholder || `Select ${r.label}`,
@@ -4457,7 +4455,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4457
4455
  onChange: (d) => {
4458
4456
  console.log("Toggle changed:", r.key, d);
4459
4457
  const g = { ...o, [r.key]: d };
4460
- h(g), s && s(l.key, g);
4458
+ u(g), s && s(l.key, g);
4461
4459
  },
4462
4460
  disabled: r.disabled ? r.disabled : !1
4463
4461
  }
@@ -4471,7 +4469,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4471
4469
  value: o[r.key] ? new Date(o[r.key]) : null,
4472
4470
  onChange: (d) => {
4473
4471
  const g = { ...o, [r.key]: d ? d.toISOString().split("T")[0] : "" };
4474
- h(g), s && s(l.key, g);
4472
+ u(g), s && s(l.key, g);
4475
4473
  },
4476
4474
  placeholder: r.placeholder || "Select date",
4477
4475
  disabled: r.disabled ? r.disabled : !1,
@@ -4486,7 +4484,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4486
4484
  value: o[r.key] || { from: null, to: null },
4487
4485
  onChange: (d) => {
4488
4486
  const g = { ...o, [r.key]: d };
4489
- h(g), s && s(l.key, g);
4487
+ u(g), s && s(l.key, g);
4490
4488
  },
4491
4489
  placeholder: r.placeholder || "Select date range",
4492
4490
  disabled: r.disabled ? r.disabled : !1,
@@ -4501,7 +4499,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4501
4499
  selectedValue: typeof o[r.key] < "u" ? o[r.key] : r.default || "",
4502
4500
  onValueChange: (d) => {
4503
4501
  const g = { ...o, [r.key]: d };
4504
- h(g), s && s(l.key, g);
4502
+ u(g), s && s(l.key, g);
4505
4503
  },
4506
4504
  options: r.options || [],
4507
4505
  disabled: r.disabled ? r.disabled : !1,
@@ -4521,8 +4519,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4521
4519
  value: d.value,
4522
4520
  checked: o[r.key] === d.value,
4523
4521
  onChange: (g) => {
4524
- const D = { ...o, [r.key]: g.target.value };
4525
- h(D), s && s(l.key, D);
4522
+ const S = { ...o, [r.key]: g.target.value };
4523
+ u(S), s && s(l.key, S);
4526
4524
  },
4527
4525
  disabled: r.disabled
4528
4526
  }
@@ -4541,7 +4539,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4541
4539
  value: o[r.key] || "",
4542
4540
  onChange: (d) => {
4543
4541
  const g = { ...o, [r.key]: d };
4544
- h(g), s && s(l.key, g);
4542
+ u(g), s && s(l.key, g);
4545
4543
  },
4546
4544
  placeholder: r.placeholder || `Search ${r.label}`,
4547
4545
  className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
@@ -4560,7 +4558,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4560
4558
  value: o[r.key] || "",
4561
4559
  onChange: (d) => {
4562
4560
  const g = { ...o, [r.key]: d.target.value };
4563
- h(g), s && s(l.key, g);
4561
+ u(g), s && s(l.key, g);
4564
4562
  },
4565
4563
  required: r.required,
4566
4564
  className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
@@ -4579,7 +4577,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4579
4577
  value: o[r.key] || "",
4580
4578
  onChange: (d) => {
4581
4579
  const g = { ...o, [r.key]: d.target.value };
4582
- h(g), s && s(l.key, g);
4580
+ u(g), s && s(l.key, g);
4583
4581
  },
4584
4582
  required: r.required,
4585
4583
  className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
@@ -4597,7 +4595,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4597
4595
  value: o[r.key] || "#000000",
4598
4596
  onChange: (d) => {
4599
4597
  const g = { ...o, [r.key]: d.target.value };
4600
- h(g), s && s(l.key, g);
4598
+ u(g), s && s(l.key, g);
4601
4599
  },
4602
4600
  className: `w-full h-10 ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
4603
4601
  }
@@ -4614,7 +4612,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4614
4612
  value: o[r.key] || r.min || 0,
4615
4613
  onChange: (d) => {
4616
4614
  const g = { ...o, [r.key]: d.target.value };
4617
- h(g), s && s(l.key, g);
4615
+ u(g), s && s(l.key, g);
4618
4616
  },
4619
4617
  min: r.min || 0,
4620
4618
  max: r.max || 100,
@@ -4639,8 +4637,8 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4639
4637
  type: "file",
4640
4638
  name: r.key,
4641
4639
  onChange: (d) => {
4642
- const g = d.target.files[0], D = { ...o, [r.key]: g ? g.name : "" };
4643
- h(D), s && s(l.key, D);
4640
+ const g = d.target.files[0], S = { ...o, [r.key]: g ? g.name : "" };
4641
+ u(S), s && s(l.key, S);
4644
4642
  },
4645
4643
  accept: r.accept,
4646
4644
  className: `w-full ${i[l.key]?.[r.key] ? "border-red-500" : ""}`
@@ -4657,7 +4655,7 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4657
4655
  className: r.className || "",
4658
4656
  onCollectionChange: (d) => {
4659
4657
  const g = { ...o, [r.key]: d };
4660
- h(g), s && s(l.key, g);
4658
+ u(g), s && s(l.key, g);
4661
4659
  },
4662
4660
  showSearch: r.showSearch !== !1,
4663
4661
  allowAdd: r.allowAdd !== !1,
@@ -4685,88 +4683,88 @@ function vs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4685
4683
  const Ns = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
4686
4684
  function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4687
4685
  console.log(`[DynamicConfig/DataTableRenderer] Component loaded for section: ${t.key}`);
4688
- const [l, m] = B(t), [o, h] = B(null), [u, N] = B(null);
4686
+ const [l, m] = B(t), [o, u] = B(null), [h, N] = B(null);
4689
4687
  console.log(`[DataTableRenderer] ${l.key} - Received props:`, { item: t, initialData: a });
4690
4688
  const [y, r] = B(() => {
4691
- const x = a && a[l.key] || [], b = x.length > 0 ? x : [{ id: 0 }];
4692
- return console.log(`[DataTableRenderer] ${l.key} - Initial data:`, b), b;
4689
+ const x = a && a[l.key] || [], f = x.length > 0 ? x : [{ id: 0 }];
4690
+ return console.log(`[DataTableRenderer] ${l.key} - Initial data:`, f), f;
4693
4691
  }), v = fe(a);
4694
- Z(() => {
4692
+ te(() => {
4695
4693
  if (console.log(`[DataTableRenderer] ${l.key} - Checking for initialData changes`), console.log(`[DataTableRenderer] ${l.key} - Previous:`, v.current), console.log(`[DataTableRenderer] ${l.key} - Current:`, a), v.current !== a) {
4696
4694
  v.current = a;
4697
- const x = a && a[l.key] || [], b = x.length > 0 ? x : [{ id: 0 }];
4698
- console.log(`[DataTableRenderer] ${l.key} - Setting new data:`, b), r(b);
4695
+ const x = a && a[l.key] || [], f = x.length > 0 ? x : [{ id: 0 }];
4696
+ console.log(`[DataTableRenderer] ${l.key} - Setting new data:`, f), r(f);
4699
4697
  }
4700
4698
  }, [a, l.key]);
4701
4699
  const d = fe(y), g = fe(null);
4702
- Z(() => {
4700
+ te(() => {
4703
4701
  d.current !== y && s && typeof s == "function" && (d.current = y, g.current && clearTimeout(g.current), g.current = setTimeout(() => {
4704
4702
  s(l.key, y);
4705
4703
  }, 300));
4706
- }, [l.key, y, s]), Z(() => () => {
4704
+ }, [l.key, y, s]), te(() => () => {
4707
4705
  g.current && clearTimeout(g.current);
4708
4706
  }, []);
4709
- const D = (x) => {
4710
- const b = (R, z) => {
4711
- console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: R, value: z, type: typeof z }), r((f) => {
4712
- const p = [...f];
4713
- return p[R][x.key] = z, p;
4707
+ const S = (x) => {
4708
+ const f = (I, D) => {
4709
+ console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: I, value: D, type: typeof D }), r((b) => {
4710
+ const p = [...b];
4711
+ return p[I][x.key] = D, p;
4714
4712
  });
4715
- }, S = (R) => i[l.key]?.[R]?.[x.key], O = (R) => {
4716
- const z = S(R);
4717
- return z ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: z }) : null;
4713
+ }, z = (I) => i[l.key]?.[I]?.[x.key], O = (I) => {
4714
+ const D = z(I);
4715
+ return D ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: D }) : null;
4718
4716
  };
4719
4717
  switch (x.fieldtype) {
4720
4718
  case "text":
4721
- return (R, z) => /* @__PURE__ */ n("div", { children: [
4719
+ return (I, D) => /* @__PURE__ */ n("div", { children: [
4722
4720
  /* @__PURE__ */ e(
4723
4721
  X,
4724
4722
  {
4725
- value: R[x.key] || "",
4726
- onChange: (f) => b(z, f.target.value),
4723
+ value: I[x.key] || "",
4724
+ onChange: (b) => f(D, b.target.value),
4727
4725
  placeholder: x.placeholder || `Enter ${x.label}`,
4728
4726
  required: x.required,
4729
- className: `w-full ${S(z) ? "border-red-500" : ""}`
4727
+ className: `w-full ${z(D) ? "border-red-500" : ""}`
4730
4728
  }
4731
4729
  ),
4732
- O(z)
4730
+ O(D)
4733
4731
  ] });
4734
4732
  case "textarea":
4735
- return (R, z) => /* @__PURE__ */ n("div", { children: [
4733
+ return (I, D) => /* @__PURE__ */ n("div", { children: [
4736
4734
  /* @__PURE__ */ e(
4737
4735
  fa,
4738
4736
  {
4739
- value: R[x.key] || "",
4740
- onChange: (f) => b(z, f.target.value),
4737
+ value: I[x.key] || "",
4738
+ onChange: (b) => f(D, b.target.value),
4741
4739
  placeholder: x.placeholder || `Enter ${x.label}`,
4742
4740
  required: x.required,
4743
- className: `w-full ${S(z) ? "border-red-500" : ""}`,
4741
+ className: `w-full ${z(D) ? "border-red-500" : ""}`,
4744
4742
  rows: 3
4745
4743
  }
4746
4744
  ),
4747
- O(z)
4745
+ O(D)
4748
4746
  ] });
4749
4747
  case "number":
4750
- return (R, z) => /* @__PURE__ */ n("div", { children: [
4748
+ return (I, D) => /* @__PURE__ */ n("div", { children: [
4751
4749
  /* @__PURE__ */ e(
4752
4750
  X,
4753
4751
  {
4754
4752
  type: "number",
4755
- value: R[x.key] || "",
4753
+ value: I[x.key] || "",
4756
4754
  min: x.min,
4757
4755
  max: x.max,
4758
4756
  step: x.step,
4759
- onChange: (f) => b(z, f.target.value),
4760
- onBlur: (f) => {
4761
- const p = f.target.value;
4757
+ onChange: (b) => f(D, b.target.value),
4758
+ onBlur: (b) => {
4759
+ const p = b.target.value;
4762
4760
  if (p !== "" && p !== null && p !== void 0) {
4763
- const k = Number(p);
4764
- isNaN(k) || (x.min !== void 0 && k < x.min ? (f.target.setCustomValidity(`${x.label} must be at least ${x.min}`), f.target.reportValidity()) : x.max !== void 0 && k > x.max ? (f.target.setCustomValidity(`${x.label} must not exceed ${x.max}`), f.target.reportValidity()) : f.target.setCustomValidity(""));
4761
+ const w = Number(p);
4762
+ isNaN(w) || (x.min !== void 0 && w < x.min ? (b.target.setCustomValidity(`${x.label} must be at least ${x.min}`), b.target.reportValidity()) : x.max !== void 0 && w > x.max ? (b.target.setCustomValidity(`${x.label} must not exceed ${x.max}`), b.target.reportValidity()) : b.target.setCustomValidity(""));
4765
4763
  }
4766
4764
  },
4767
4765
  placeholder: x.placeholder || `Enter ${x.label}`,
4768
4766
  required: x.required,
4769
- className: `w-full ${S(z) ? "border-red-500" : ""}`
4767
+ className: `w-full ${z(D) ? "border-red-500" : ""}`
4770
4768
  }
4771
4769
  ),
4772
4770
  x.min !== void 0 && /* @__PURE__ */ n("div", { style: { color: "#6b7280", fontSize: "11px", marginTop: "2px" }, children: [
@@ -4777,79 +4775,79 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4777
4775
  "Max: ",
4778
4776
  x.max
4779
4777
  ] }),
4780
- O(z)
4778
+ O(D)
4781
4779
  ] });
4782
4780
  case "email":
4783
- return (R, z) => /* @__PURE__ */ n("div", { children: [
4781
+ return (I, D) => /* @__PURE__ */ n("div", { children: [
4784
4782
  /* @__PURE__ */ e(
4785
4783
  X,
4786
4784
  {
4787
4785
  type: "email",
4788
- value: R[x.key] || "",
4789
- onChange: (f) => b(z, f.target.value),
4786
+ value: I[x.key] || "",
4787
+ onChange: (b) => f(D, b.target.value),
4790
4788
  placeholder: x.placeholder || "Enter email address",
4791
4789
  required: x.required,
4792
- className: `w-full ${S(z) ? "border-red-500" : ""}`
4790
+ className: `w-full ${z(D) ? "border-red-500" : ""}`
4793
4791
  }
4794
4792
  ),
4795
- O(z)
4793
+ O(D)
4796
4794
  ] });
4797
4795
  case "url":
4798
- return (R, z) => /* @__PURE__ */ n("div", { children: [
4796
+ return (I, D) => /* @__PURE__ */ n("div", { children: [
4799
4797
  /* @__PURE__ */ e(
4800
4798
  X,
4801
4799
  {
4802
4800
  type: "url",
4803
- value: R[x.key] || "",
4804
- onChange: (f) => b(z, f.target.value),
4801
+ value: I[x.key] || "",
4802
+ onChange: (b) => f(D, b.target.value),
4805
4803
  placeholder: x.placeholder || "Enter URL",
4806
4804
  required: x.required,
4807
- className: `w-full ${S(z) ? "border-red-500" : ""}`
4805
+ className: `w-full ${z(D) ? "border-red-500" : ""}`
4808
4806
  }
4809
4807
  ),
4810
- O(z)
4808
+ O(D)
4811
4809
  ] });
4812
4810
  case "password":
4813
- return (R, z) => /* @__PURE__ */ n("div", { children: [
4811
+ return (I, D) => /* @__PURE__ */ n("div", { children: [
4814
4812
  /* @__PURE__ */ e(
4815
4813
  X,
4816
4814
  {
4817
4815
  type: "password",
4818
- value: R[x.key] || "",
4819
- onChange: (f) => b(z, f.target.value),
4816
+ value: I[x.key] || "",
4817
+ onChange: (b) => f(D, b.target.value),
4820
4818
  placeholder: x.placeholder || "Enter password",
4821
4819
  required: x.required,
4822
- className: `w-full ${S(z) ? "border-red-500" : ""}`
4820
+ className: `w-full ${z(D) ? "border-red-500" : ""}`
4823
4821
  }
4824
4822
  ),
4825
- O(z)
4823
+ O(D)
4826
4824
  ] });
4827
4825
  case "select":
4828
4826
  case "dropdown":
4829
- return (R, z) => /* @__PURE__ */ n("div", { children: [
4827
+ return (I, D) => /* @__PURE__ */ n("div", { children: [
4830
4828
  /* @__PURE__ */ e(
4831
4829
  ft,
4832
4830
  {
4833
- value: R[x.key] || "",
4834
- onChange: (f) => b(z, f),
4831
+ value: I[x.key] || "",
4832
+ onChange: (b) => f(D, b),
4835
4833
  options: x.options || [],
4836
4834
  placeholder: x.placeholder || `Select ${x.label}`,
4837
4835
  required: x.required,
4838
- className: `w-full ${S(z) ? "border-red-500" : ""}`
4836
+ className: `w-full ${z(D) ? "border-red-500" : ""}`
4839
4837
  }
4840
4838
  ),
4841
- O(z)
4839
+ O(D)
4842
4840
  ] });
4843
4841
  case "selectDynamic":
4844
- return (R, z) => {
4845
- const f = () => {
4842
+ return (I, D) => {
4843
+ const b = () => {
4846
4844
  if (x.optionsFrom && a) {
4847
- const { config: p, valueField: k, labelField: w } = x.optionsFrom, T = a[p] || [];
4845
+ const { config: p, valueField: w, labelField: k } = x.optionsFrom, T = a[p] || [];
4848
4846
  if (Array.isArray(T))
4849
4847
  return T.map((L) => ({
4850
- id: L[k] || "",
4851
- value: L[k] || "",
4852
- label: L[w] || ""
4848
+ id: L[w] || "",
4849
+ value: L[w] || "",
4850
+ label: L[k] || ""
4853
4851
  }));
4854
4852
  }
4855
4853
  return x.options || [];
@@ -4858,27 +4856,27 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4858
4856
  /* @__PURE__ */ e(
4859
4857
  ft,
4860
4858
  {
4861
- index: z,
4862
- value: R[x.key] || "",
4863
- onChange: (p) => b(z, p),
4864
- options: f(),
4859
+ index: D,
4860
+ value: I[x.key] || "",
4861
+ onChange: (p) => f(D, p),
4862
+ options: b(),
4865
4863
  placeholder: x.placeholder || `Select ${x.label}`,
4866
4864
  required: x.required,
4867
- className: `w-full ${S(z) ? "border-red-500" : ""}`
4865
+ className: `w-full ${z(D) ? "border-red-500" : ""}`
4868
4866
  },
4869
4867
  Math.random()
4870
4868
  ),
4871
- O(z)
4869
+ O(D)
4872
4870
  ] });
4873
4871
  };
4874
4872
  case "multiselect":
4875
- return (R, z) => {
4876
- const f = R[x.key] || [];
4873
+ return (I, D) => {
4874
+ const b = I[x.key] || [];
4877
4875
  return /* @__PURE__ */ e(
4878
4876
  at,
4879
4877
  {
4880
- selectedItems: f,
4881
- onSelectionChange: (p) => b(z, p),
4878
+ selectedItems: b,
4879
+ onSelectionChange: (p) => f(D, p),
4882
4880
  options: x.options || [],
4883
4881
  placeholder: x.placeholder || `Select ${x.label}`,
4884
4882
  className: "w-full"
@@ -4887,110 +4885,103 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4887
4885
  };
4888
4886
  case "checkbox":
4889
4887
  case "boolean":
4890
- return (R, z) => /* @__PURE__ */ e(
4888
+ return (I, D) => /* @__PURE__ */ e(
4891
4889
  pt,
4892
4890
  {
4893
- checked: !!R[x.key],
4894
- onChange: (f) => b(z, f),
4891
+ checked: !!I[x.key],
4892
+ onChange: (b) => f(D, b),
4895
4893
  label: x.placeholder || x.label,
4896
4894
  className: "w-full"
4897
4895
  }
4898
4896
  );
4899
4897
  case "toggle":
4900
4898
  case "switch":
4901
- return (R, z) => /* @__PURE__ */ e(
4899
+ return (I, D) => /* @__PURE__ */ e(
4902
4900
  ya,
4903
4901
  {
4904
- isOn: !!R[x.key],
4905
- onToggle: (f) => b(z, f),
4902
+ isOn: !!I[x.key],
4903
+ onToggle: (b) => f(D, b),
4906
4904
  label: x.placeholder || x.label,
4907
4905
  className: "w-full"
4908
4906
  }
4909
4907
  );
4910
4908
  case "date":
4911
- return (R, z) => /* @__PURE__ */ e(
4909
+ return (I, D) => /* @__PURE__ */ e(
4912
4910
  ha,
4913
4911
  {
4914
- selectedDate: R[x.key] ? new Date(R[x.key]) : null,
4915
- onDateChange: (f) => b(z, f ? f.toISOString().split("T")[0] : ""),
4912
+ selectedDate: I[x.key] ? new Date(I[x.key]) : null,
4913
+ onDateChange: (b) => f(D, b ? b.toISOString().split("T")[0] : ""),
4916
4914
  placeholder: x.placeholder || "Select date",
4917
4915
  className: "w-full"
4918
4916
  }
4919
4917
  );
4920
4918
  case "datetime":
4921
- return (R, z) => /* @__PURE__ */ e(
4919
+ return (I, D) => /* @__PURE__ */ e(
4922
4920
  X,
4923
4921
  {
4924
4922
  type: "datetime-local",
4925
- value: R[x.key] || "",
4926
- onChange: (f) => b(z, f.target.value),
4923
+ value: I[x.key] || "",
4924
+ onChange: (b) => f(D, b.target.value),
4927
4925
  placeholder: x.placeholder || "Select date and time",
4928
4926
  required: x.required,
4929
4927
  className: "w-full"
4930
4928
  }
4931
4929
  );
4932
4930
  case "time":
4933
- return (R, z) => /* @__PURE__ */ e(
4931
+ return (I, D) => /* @__PURE__ */ e(
4934
4932
  X,
4935
4933
  {
4936
4934
  type: "time",
4937
- value: R[x.key] || "",
4938
- onChange: (f) => b(z, f.target.value),
4935
+ value: I[x.key] || "",
4936
+ onChange: (b) => f(D, b.target.value),
4939
4937
  placeholder: x.placeholder || "Select time",
4940
4938
  required: x.required,
4941
4939
  className: "w-full"
4942
4940
  }
4943
4941
  );
4944
4942
  case "radio":
4945
- return (R, z) => /* @__PURE__ */ e(
4943
+ return (I, D) => /* @__PURE__ */ e(
4946
4944
  pa,
4947
4945
  {
4948
- selectedValue: R[x.key] || "",
4949
- onValueChange: (f) => b(z, f),
4946
+ selectedValue: I[x.key] || "",
4947
+ onValueChange: (b) => f(D, b),
4950
4948
  options: x.options || [],
4951
4949
  className: "w-full"
4952
4950
  }
4953
4951
  );
4954
4952
  case "search":
4955
- return (R, z) => /* @__PURE__ */ e(
4953
+ return (I, D) => /* @__PURE__ */ e(
4956
4954
  ge,
4957
4955
  {
4958
- value: R[x.key] || "",
4959
- onChange: (f) => b(z, f),
4956
+ value: I[x.key] || "",
4957
+ onChange: (b) => f(D, b),
4960
4958
  placeholder: x.placeholder || `Search ${x.label}`,
4961
4959
  className: "w-full"
4962
4960
  }
4963
4961
  );
4964
4962
  case "audience":
4965
- return (R, z) => {
4966
- const f = R[x.key] || { users: [], groups: [], roles: [] }, p = [
4967
- ...f.users || [],
4968
- ...f.groups || [],
4969
- ...f.roles || []
4963
+ return (I, D) => {
4964
+ const b = I[x.key] || { users: [], groups: [], roles: [] }, p = [
4965
+ ...b.users || [],
4966
+ ...b.groups || [],
4967
+ ...b.roles || []
4970
4968
  ];
4971
4969
  return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
4972
- /* @__PURE__ */ e(Ns, { children: p.length > 0 ? p.slice(0, 3).map((k, w) => /* @__PURE__ */ e(
4970
+ /* @__PURE__ */ e(Ns, { children: p.length > 0 ? p.slice(0, 3).map((w, k) => /* @__PURE__ */ e(
4973
4971
  we,
4974
4972
  {
4975
4973
  size: "small",
4976
- name: k.name || k.displayName || k.id,
4977
- src: k.avatarUrl
4974
+ name: w.name || w.displayName || w.id,
4975
+ src: w.avatarUrl
4978
4976
  },
4979
- w
4977
+ k
4980
4978
  )) : null }),
4981
4979
  /* @__PURE__ */ e(
4982
4980
  "button",
4983
4981
  {
4984
4982
  className: "text-blue-600 font-semibold hover:text-blue-800",
4985
4983
  onClick: () => {
4986
- console.log("[DataTableRenderer] Button clicked:", {
4987
- fieldKey: x.key,
4988
- rowIndex: z,
4989
- buttonText: p.length > 0 ? "Edit" : "Assign",
4990
- currentAudienceRowId: o,
4991
- currentAudienceFieldName: u,
4992
- allAudience: p
4993
- }), N(x.key), h(z);
4984
+ N(x.key), u(D);
4994
4985
  },
4995
4986
  children: p.length > 0 ? "Edit" : "Assign"
4996
4987
  }
@@ -4998,136 +4989,114 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4998
4989
  ] });
4999
4990
  };
5000
4991
  case "color":
5001
- return (R, z) => /* @__PURE__ */ e(
4992
+ return (I, D) => /* @__PURE__ */ e(
5002
4993
  X,
5003
4994
  {
5004
4995
  type: "color",
5005
- value: R[x.key] || "#000000",
5006
- onChange: (f) => b(z, f.target.value),
4996
+ value: I[x.key] || "#000000",
4997
+ onChange: (b) => f(D, b.target.value),
5007
4998
  className: "w-full h-10"
5008
4999
  }
5009
5000
  );
5010
5001
  case "range":
5011
- return (R, z) => /* @__PURE__ */ n("div", { className: "w-full", children: [
5002
+ return (I, D) => /* @__PURE__ */ n("div", { className: "w-full", children: [
5012
5003
  /* @__PURE__ */ e(
5013
5004
  X,
5014
5005
  {
5015
5006
  type: "range",
5016
- value: R[x.key] || x.min || 0,
5017
- onChange: (f) => b(z, f.target.value),
5007
+ value: I[x.key] || x.min || 0,
5008
+ onChange: (b) => f(D, b.target.value),
5018
5009
  min: x.min || 0,
5019
5010
  max: x.max || 100,
5020
5011
  step: x.step || 1,
5021
5012
  className: "w-full"
5022
5013
  }
5023
5014
  ),
5024
- /* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: R[x.key] || x.min || 0 })
5015
+ /* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: I[x.key] || x.min || 0 })
5025
5016
  ] });
5026
5017
  case "file":
5027
- return (R, z) => /* @__PURE__ */ e(
5018
+ return (I, D) => /* @__PURE__ */ e(
5028
5019
  X,
5029
5020
  {
5030
5021
  type: "file",
5031
- onChange: (f) => {
5032
- const p = f.target.files[0];
5033
- b(z, p ? p.name : "");
5022
+ onChange: (b) => {
5023
+ const p = b.target.files[0];
5024
+ f(D, p ? p.name : "");
5034
5025
  },
5035
5026
  accept: x.accept,
5036
5027
  className: "w-full"
5037
5028
  }
5038
5029
  );
5039
5030
  case "hidden":
5040
- return (R, z) => /* @__PURE__ */ e(
5031
+ return (I, D) => /* @__PURE__ */ e(
5041
5032
  X,
5042
5033
  {
5043
5034
  type: "hidden",
5044
- value: R[x.key] || "",
5045
- onChange: (f) => b(z, f.target.value)
5035
+ value: I[x.key] || "",
5036
+ onChange: (b) => f(D, b.target.value)
5046
5037
  }
5047
5038
  );
5048
5039
  // Default fallback for unknown field types
5049
5040
  default:
5050
- return (R, z) => /* @__PURE__ */ n("div", { children: [
5041
+ return (I, D) => /* @__PURE__ */ n("div", { children: [
5051
5042
  /* @__PURE__ */ e(
5052
5043
  X,
5053
5044
  {
5054
- value: R[x.key] || "",
5055
- onChange: (f) => b(z, f.target.value),
5045
+ value: I[x.key] || "",
5046
+ onChange: (b) => f(D, b.target.value),
5056
5047
  placeholder: x.placeholder || `Enter ${x.label}`,
5057
5048
  required: x.required,
5058
- className: `w-full ${S(z) ? "border-red-500" : ""}`
5049
+ className: `w-full ${z(D) ? "border-red-500" : ""}`
5059
5050
  }
5060
5051
  ),
5061
- O(z)
5052
+ O(D)
5062
5053
  ] });
5063
5054
  }
5064
- }, F = ee(() => {
5055
+ }, F = K(() => {
5065
5056
  console.log("[DataTableRenderer] Adding blank row"), r((x) => {
5066
5057
  console.log("[DataTableRenderer] Current data before add:", x);
5067
- const b = {
5058
+ const f = {
5068
5059
  id: x.length
5069
5060
  // Assign next available ID
5070
5061
  };
5071
5062
  l.fields.forEach((O) => {
5072
- O.fieldtype === "audience" ? b[O.key] = { users: [], groups: [], roles: [] } : b[O.key] = O.default || "";
5073
- }), console.log("[DataTableRenderer] New blank row:", b);
5074
- const S = [...x, b];
5075
- return console.log("[DataTableRenderer] Updated data:", S), S;
5063
+ O.fieldtype === "audience" ? f[O.key] = { users: [], groups: [], roles: [] } : f[O.key] = O.default || "";
5064
+ }), console.log("[DataTableRenderer] New blank row:", f);
5065
+ const z = [...x, f];
5066
+ return console.log("[DataTableRenderer] Updated data:", z), z;
5076
5067
  });
5077
- }, [l.fields]), E = ee((x) => {
5078
- r((b) => {
5079
- if (b.length <= 1)
5080
- return b;
5081
- const S = [...b];
5082
- return S.splice(x, 1), S;
5068
+ }, [l.fields]), E = K((x) => {
5069
+ r((f) => {
5070
+ if (f.length <= 1)
5071
+ return f;
5072
+ const z = [...f];
5073
+ return z.splice(x, 1), z;
5083
5074
  });
5084
- }, []), [I, P] = B(null), _ = ee((x, b) => {
5085
- P(b), x.dataTransfer.effectAllowed = "move", x.dataTransfer.setData("text/html", "");
5086
- }, []), U = ee((x) => {
5075
+ }, []), [R, P] = B(null), j = K((x, f) => {
5076
+ P(f), x.dataTransfer.effectAllowed = "move", x.dataTransfer.setData("text/html", "");
5077
+ }, []), U = K((x) => {
5087
5078
  x.preventDefault(), x.dataTransfer.dropEffect = "move";
5088
- }, []), Y = ee((x, b) => {
5089
- x.preventDefault(), !(I === null || I === b) && (r((S) => {
5090
- const O = [...S], R = O[I];
5091
- return O.splice(I, 1), O.splice(b, 0, R), O;
5079
+ }, []), Y = K((x, f) => {
5080
+ x.preventDefault(), !(R === null || R === f) && (r((z) => {
5081
+ const O = [...z], I = O[R];
5082
+ return O.splice(R, 1), O.splice(f, 0, I), O;
5092
5083
  }), P(null));
5093
- }, [I]), q = ee(() => {
5084
+ }, [R]), q = K(() => {
5094
5085
  P(null);
5095
- }, []), $ = ee((x, b) => {
5096
- console.log("[DataTableRenderer] handleAddAudience called with:", { selectedEntities: x, existingShares: b });
5097
- const S = x.pendingInvites || [], O = !b || !b.users?.length && !b.groups?.length && !b.roles?.length;
5098
- if (S.length === 0 && O) {
5099
- console.log("[DataTableRenderer] Ignoring empty initial call from InviteFlow useEffect");
5100
- return;
5101
- }
5102
- if (S.length === 0 && !O && o !== null && u) {
5103
- console.log("[DataTableRenderer] Edit mode - no pending invites, checking if this is initial call");
5104
- const R = y[o] && y[o][u] ? y[o][u] : { users: [], groups: [], roles: [] }, z = (b.users || []).map((V) => V.id).sort(), f = (b.groups || []).map((V) => V.id).sort(), p = (b.roles || []).map((V) => V.id).sort(), k = (R.users || []).map((V) => V.id).sort(), w = (R.groups || []).map((V) => V.id).sort(), T = (R.roles || []).map((V) => V.id).sort(), L = JSON.stringify(z) === JSON.stringify(k), C = JSON.stringify(f) === JSON.stringify(w), M = JSON.stringify(p) === JSON.stringify(T);
5105
- if (L && C && M) {
5106
- console.log("[DataTableRenderer] Ignoring initial Edit call - existing shares match current data exactly");
5107
- return;
5108
- }
5109
- console.log("[DataTableRenderer] Data has changed, processing update");
5110
- }
5111
- r((R) => {
5112
- const z = [...R];
5113
- if (o !== null && u && z[o]) {
5114
- if (S.length > 0) {
5115
- const f = S.filter((w) => w.type === "User"), p = S.filter((w) => w.type === "Group"), k = S.filter((w) => w.type === "Role");
5116
- z[o][u] = {
5117
- users: [...z[o][u]?.users || [], ...f],
5118
- groups: [...z[o][u]?.groups || [], ...p],
5119
- roles: [...z[o][u]?.roles || [], ...k]
5120
- };
5121
- } else b && !O && (z[o][u] = {
5122
- users: b.users || [],
5123
- groups: b.groups || [],
5124
- roles: b.roles || []
5125
- });
5126
- console.log("[DataTableRenderer] Updated audience data:", z[o][u]);
5086
+ }, []), $ = K((x) => {
5087
+ console.log("[DataTableRenderer] handleAddAudience called with:", x), r((f) => {
5088
+ const z = [...f];
5089
+ if (o !== null && h && z[o]) {
5090
+ const O = x.pendingInvites || [], I = O.filter((p) => p.type === "User"), D = O.filter((p) => p.type === "Group"), b = O.filter((p) => p.type === "Role");
5091
+ z[o][h] = {
5092
+ users: [...z[o][h]?.users || [], ...I],
5093
+ groups: [...z[o][h]?.groups || [], ...D],
5094
+ roles: [...z[o][h]?.roles || [], ...b]
5095
+ }, console.log("[DataTableRenderer] Updated audience data:", z[o][h]);
5127
5096
  }
5128
5097
  return z;
5129
- }), console.log("[DataTableRenderer] Closing modal after update"), h(null), N(null);
5130
- }, [o, u]);
5098
+ }), u(null), N(null);
5099
+ }, [o, h]);
5131
5100
  return /* @__PURE__ */ n("div", { children: [
5132
5101
  /* @__PURE__ */ n("div", { style: { marginBottom: "20px" }, children: [
5133
5102
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
@@ -5146,32 +5115,32 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
5146
5115
  /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ n("table", { className: "min-w-full bg-white border border-gray-300", style: { marginBottom: "20px" }, children: [
5147
5116
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "bg-gray-50", children: [
5148
5117
  /* @__PURE__ */ e("th", { className: "px-4 py-2 w-10" }),
5149
- l.fields.map((x, b) => /* @__PURE__ */ e(
5118
+ l.fields.map((x, f) => /* @__PURE__ */ e(
5150
5119
  "th",
5151
5120
  {
5152
5121
  className: "px-4 py-2 text-left text-sm font-medium text-gray-700",
5153
5122
  children: x.label || x.key
5154
5123
  },
5155
- b
5124
+ f
5156
5125
  )),
5157
5126
  /* @__PURE__ */ e("th", { className: "px-4 py-2 w-16" })
5158
5127
  ] }) }),
5159
- /* @__PURE__ */ e("tbody", { children: y.map((x, b) => /* @__PURE__ */ n(
5128
+ /* @__PURE__ */ e("tbody", { children: y.map((x, f) => /* @__PURE__ */ n(
5160
5129
  "tr",
5161
5130
  {
5162
- className: `hover:bg-gray-50 ${I === b ? "opacity-50" : ""}`,
5131
+ className: `hover:bg-gray-50 ${R === f ? "opacity-50" : ""}`,
5163
5132
  draggable: !0,
5164
- onDragStart: (S) => _(S, b),
5133
+ onDragStart: (z) => j(z, f),
5165
5134
  onDragOver: U,
5166
- onDrop: (S) => Y(S, b),
5135
+ onDrop: (z) => Y(z, f),
5167
5136
  onDragEnd: q,
5168
5137
  children: [
5169
5138
  /* @__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(wt, { size: 16 }) }) }),
5170
- l.fields.map((S, O) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: D(S)(x, b) }, O)),
5139
+ l.fields.map((z, O) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: S(z)(x, f) }, O)),
5171
5140
  /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
5172
5141
  "button",
5173
5142
  {
5174
- onClick: () => E(b),
5143
+ onClick: () => E(f),
5175
5144
  className: "text-red-500 hover:text-red-700",
5176
5145
  title: "Delete row",
5177
5146
  children: /* @__PURE__ */ e(yr, { size: 16 })
@@ -5179,26 +5148,21 @@ function ws({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
5179
5148
  ) })
5180
5149
  ]
5181
5150
  },
5182
- b
5151
+ f
5183
5152
  )) })
5184
5153
  ] }) }),
5185
- (() => {
5186
- if (console.log("[DataTableRenderer] Modal condition check:", {
5187
- audienceRowId: o,
5188
- audienceFieldName: u,
5189
- shouldRender: o !== null
5190
- }), o === null) return null;
5191
- const x = y[o] && y[o][u] ? {
5192
- users: y[o][u].users || [],
5193
- groups: y[o][u].groups || [],
5194
- roles: y[o][u].roles || []
5154
+ o !== null && (() => {
5155
+ const x = y[o] && y[o][h] ? {
5156
+ users: y[o][h].users || [],
5157
+ groups: y[o][h].groups || [],
5158
+ roles: y[o][h].roles || []
5195
5159
  } : { users: [], groups: [], roles: [] };
5196
- return console.log("[DataTableRenderer] Opening modal with existing data:", x), console.log("[DataTableRenderer] Row data:", y[o]), console.log("[DataTableRenderer] Field name:", u), /* @__PURE__ */ e(
5160
+ return console.log("[DataTableRenderer] Opening modal with existing data:", x), console.log("[DataTableRenderer] Row data:", y[o]), console.log("[DataTableRenderer] Field name:", h), /* @__PURE__ */ e(
5197
5161
  cs,
5198
5162
  {
5199
5163
  isOpen: !0,
5200
5164
  onClose: () => {
5201
- h(null), N(null);
5165
+ u(null), N(null);
5202
5166
  },
5203
5167
  onFinalSubmit: $,
5204
5168
  existingShares: x,
@@ -5230,209 +5194,209 @@ function Ss({
5230
5194
  onShowCancelModal: l,
5231
5195
  onCancel: m
5232
5196
  }) {
5233
- const [o, h] = re.useState(a), [u, N] = re.useState(null), [y, r] = re.useState(null), [v, d] = B(!1), [g, D] = B(!1), [F, E] = B({}), I = `${$e()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, P = I, [_, U] = B(1), Y = () => {
5234
- if (!y || !u)
5235
- return console.log("[DynamicConfig] hasUnsavedChanges: false (no data)", { originalData: y, data: u }), !1;
5236
- const f = (T) => {
5197
+ const [o, u] = re.useState(a), [h, N] = re.useState(null), [y, r] = re.useState(null), [v, d] = B(!1), [g, S] = B(!1), [F, E] = B({}), R = `${$e()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, P = R, [j, U] = B(1), Y = () => {
5198
+ if (!y || !h)
5199
+ return console.log("[DynamicConfig] hasUnsavedChanges: false (no data)", { originalData: y, data: h }), !1;
5200
+ const b = (T) => {
5237
5201
  if (T == null || typeof T != "object") return T;
5238
- if (Array.isArray(T)) return T.map(f);
5202
+ if (Array.isArray(T)) return T.map(b);
5239
5203
  const L = {};
5240
5204
  return Object.keys(T).sort().forEach((C) => {
5241
- L[C] = f(T[C]);
5205
+ L[C] = b(T[C]);
5242
5206
  }), L;
5243
- }, p = f(y), k = f(u), w = JSON.stringify(p) !== JSON.stringify(k);
5244
- return console.log("[DynamicConfig] hasUnsavedChanges:", w, {
5207
+ }, p = b(y), w = b(h), k = JSON.stringify(p) !== JSON.stringify(w);
5208
+ return console.log("[DynamicConfig] hasUnsavedChanges:", k, {
5245
5209
  originalData: p,
5246
- currentData: k,
5210
+ currentData: w,
5247
5211
  originalRaw: y,
5248
- currentRaw: u
5249
- }), w;
5250
- }, q = (f) => {
5212
+ currentRaw: h
5213
+ }), k;
5214
+ }, q = (b) => {
5251
5215
  if (!a || !a.configuration)
5252
- return f;
5253
- const p = {}, k = f?.configuration || {};
5254
- return a.configuration.forEach((w) => {
5255
- if (w.key && w.type === "datatable") {
5256
- const L = (k[w.key] || []).map((C, M) => {
5257
- const V = { id: C.id || 0 };
5258
- return w.fields && w.fields.forEach((A) => {
5216
+ return b;
5217
+ const p = {}, w = b?.configuration || {};
5218
+ return a.configuration.forEach((k) => {
5219
+ if (k.key && k.type === "datatable") {
5220
+ const L = (w[k.key] || []).map((C, M) => {
5221
+ const _ = { id: C.id || 0 };
5222
+ return k.fields && k.fields.forEach((A) => {
5259
5223
  if (A.fieldtype === "audience") {
5260
5224
  let G = { users: [], groups: [], roles: [] };
5261
5225
  C[A.key] && (Array.isArray(C[A.key]) ? G = { users: [], groups: [], roles: [] } : typeof C[A.key] == "object" && (G = {
5262
5226
  users: C[A.key].users || [],
5263
5227
  groups: C[A.key].groups || [],
5264
5228
  roles: C[A.key].roles || []
5265
- })), V[A.key] = G;
5266
- } else A.fieldtype === "select" ? V[A.key] = C[A.key] !== void 0 && C[A.key] !== "" ? C[A.key] : A.default || "" : V[A.key] = C[A.key] || A.default || "";
5267
- }), V;
5229
+ })), _[A.key] = G;
5230
+ } else A.fieldtype === "select" ? _[A.key] = C[A.key] !== void 0 && C[A.key] !== "" ? C[A.key] : A.default || "" : _[A.key] = C[A.key] || A.default || "";
5231
+ }), _;
5268
5232
  });
5269
5233
  if (L.length === 0) {
5270
5234
  const C = { id: 0 };
5271
- w.fields && w.fields.forEach((M) => {
5235
+ k.fields && k.fields.forEach((M) => {
5272
5236
  M.fieldtype === "audience" ? C[M.key] = { users: [], groups: [], roles: [] } : C[M.key] = M.default || "";
5273
5237
  }), L.push(C);
5274
5238
  }
5275
- p[w.key] = L;
5276
- } else if (w.key) {
5277
- const T = k[w.key] || {};
5278
- w.type === "section" && w.fields && w.fields.forEach((L) => {
5239
+ p[k.key] = L;
5240
+ } else if (k.key) {
5241
+ const T = w[k.key] || {};
5242
+ k.type === "section" && k.fields && k.fields.forEach((L) => {
5279
5243
  L.fieldtype === "managecollectionlist" && L.key && (!T[L.key] || !Array.isArray(T[L.key])) && (T[L.key] = L.initialData || []);
5280
- }), p[w.key] = T;
5244
+ }), p[k.key] = T;
5281
5245
  }
5282
5246
  }), p;
5283
5247
  }, $ = () => {
5284
5248
  if (a && a.configuration) {
5285
- const f = {};
5249
+ const b = {};
5286
5250
  a.configuration.forEach((p) => {
5287
5251
  if (p.key)
5288
5252
  if (p.type === "datatable") {
5289
- const k = { id: 0 };
5290
- p.fields && p.fields.forEach((w) => {
5291
- w.fieldtype === "audience" ? k[w.key] = { users: [], groups: [], roles: [] } : (w.fieldtype, k[w.key] = w.default || "");
5292
- }), f[p.key] = [k];
5253
+ const w = { id: 0 };
5254
+ p.fields && p.fields.forEach((k) => {
5255
+ k.fieldtype === "audience" ? w[k.key] = { users: [], groups: [], roles: [] } : (k.fieldtype, w[k.key] = k.default || "");
5256
+ }), b[p.key] = [w];
5293
5257
  } else if (p.type === "section") {
5294
- const k = {};
5295
- p.fields && Array.isArray(p.fields) && p.fields.forEach((w) => {
5296
- w.key && (w.fieldtype === "managecollectionlist" ? k[w.key] = w.initialData || [] : k[w.key] = w.default || "");
5297
- }), f[p.key] = k;
5258
+ const w = {};
5259
+ p.fields && Array.isArray(p.fields) && p.fields.forEach((k) => {
5260
+ k.key && (k.fieldtype === "managecollectionlist" ? w[k.key] = k.initialData || [] : w[k.key] = k.default || "");
5261
+ }), b[p.key] = w;
5298
5262
  } else
5299
- f[p.key] = {};
5300
- }), N(f), r(f);
5263
+ b[p.key] = {};
5264
+ }), N(b), r(b);
5301
5265
  }
5302
5266
  };
5303
- Z(() => {
5267
+ te(() => {
5304
5268
  if (s) {
5305
5269
  d(!1);
5306
5270
  return;
5307
5271
  }
5308
- const f = async () => {
5272
+ const b = async () => {
5309
5273
  try {
5310
5274
  d(!0);
5311
- let p = await Ze(I);
5275
+ let p = await Ze(R);
5312
5276
  if (p) {
5313
- const k = q(p);
5314
- N(k), r(k);
5277
+ const w = q(p);
5278
+ N(w), r(w);
5315
5279
  } else
5316
5280
  $();
5317
5281
  } catch (p) {
5318
5282
  console.error("Error fetching configuration:", p);
5319
- let k = "Failed to load configuration";
5283
+ let w = "Failed to load configuration";
5320
5284
  if (p.response) {
5321
- const w = p.response.status, T = p.response.data?.message || p.response.data?.error;
5322
- w === 400 ? k = T || "Invalid request. Please check the application ID." : w === 401 ? k = "You are not authorized to access this configuration." : w === 403 ? k = "Access denied. You don't have permission to view this configuration." : w === 404 ? k = "Configuration not found. It may not exist yet or the application ID is incorrect." : w >= 500 ? k = T || "Server error. Please try again later." : k = T || `Failed to load configuration (Error ${w})`;
5323
- } else p.request ? k = "Network error. Please check your connection and try again." : k = p.message || "An unexpected error occurred while loading configuration.";
5324
- qe.error(k), $();
5285
+ const k = p.response.status, T = p.response.data?.message || p.response.data?.error;
5286
+ k === 400 ? w = T || "Invalid request. Please check the application ID." : k === 401 ? w = "You are not authorized to access this configuration." : k === 403 ? w = "Access denied. You don't have permission to view this configuration." : k === 404 ? w = "Configuration not found. It may not exist yet or the application ID is incorrect." : k >= 500 ? w = T || "Server error. Please try again later." : w = T || `Failed to load configuration (Error ${k})`;
5287
+ } else p.request ? w = "Network error. Please check your connection and try again." : w = p.message || "An unexpected error occurred while loading configuration.";
5288
+ qe.error(w), $();
5325
5289
  } finally {
5326
5290
  d(!1);
5327
5291
  }
5328
5292
  };
5329
- a && (h(a), t ? f() : $());
5330
- }, [a, _, t, s]);
5331
- const x = (f, p) => {
5332
- console.log(`[DynamicConfig] handleSectionChange called for ${f}:`, p), N((k) => {
5333
- const w = {
5334
- ...k,
5335
- [f]: p
5293
+ a && (u(a), t ? b() : $());
5294
+ }, [a, j, t, s]);
5295
+ const x = (b, p) => {
5296
+ console.log(`[DynamicConfig] handleSectionChange called for ${b}:`, p), N((w) => {
5297
+ const k = {
5298
+ ...w,
5299
+ [b]: p
5336
5300
  };
5337
- return console.log("[DynamicConfig] Updated data state:", w), w;
5338
- }), E((k) => {
5339
- const w = { ...k };
5340
- return w[f] && delete w[f], w;
5301
+ return console.log("[DynamicConfig] Updated data state:", k), k;
5302
+ }), E((w) => {
5303
+ const k = { ...w };
5304
+ return k[b] && delete k[b], k;
5341
5305
  });
5342
- }, b = () => {
5343
- const f = {};
5344
- return !o || !u || o.configuration.forEach((p) => {
5306
+ }, f = () => {
5307
+ const b = {};
5308
+ return !o || !h || o.configuration.forEach((p) => {
5345
5309
  if (p.type === "section")
5346
- p.fields.forEach((k) => {
5347
- const w = u[p.key]?.[k.key];
5348
- if (k.required && (!w || typeof w == "string" && w.trim() === "")) {
5349
- f[p.key] || (f[p.key] = {}), f[p.key][k.key] = `${k.label} is required`;
5310
+ p.fields.forEach((w) => {
5311
+ const k = h[p.key]?.[w.key];
5312
+ if (w.required && (!k || typeof k == "string" && k.trim() === "")) {
5313
+ b[p.key] || (b[p.key] = {}), b[p.key][w.key] = `${w.label} is required`;
5350
5314
  return;
5351
5315
  }
5352
- if (k.fieldtype === "number" && w !== "" && w !== null && w !== void 0) {
5353
- const T = Number(w);
5354
- isNaN(T) ? (f[p.key] || (f[p.key] = {}), f[p.key][k.key] = `${k.label} must be a valid number`) : (k.min !== void 0 && T < k.min && (f[p.key] || (f[p.key] = {}), f[p.key][k.key] = `${k.label} must be at least ${k.min}`), k.max !== void 0 && T > k.max && (f[p.key] || (f[p.key] = {}), f[p.key][k.key] = `${k.label} must not exceed ${k.max}`));
5316
+ if (w.fieldtype === "number" && k !== "" && k !== null && k !== void 0) {
5317
+ const T = Number(k);
5318
+ isNaN(T) ? (b[p.key] || (b[p.key] = {}), b[p.key][w.key] = `${w.label} must be a valid number`) : (w.min !== void 0 && T < w.min && (b[p.key] || (b[p.key] = {}), b[p.key][w.key] = `${w.label} must be at least ${w.min}`), w.max !== void 0 && T > w.max && (b[p.key] || (b[p.key] = {}), b[p.key][w.key] = `${w.label} must not exceed ${w.max}`));
5355
5319
  }
5356
5320
  });
5357
5321
  else if (p.type === "datatable") {
5358
- const k = u[p.key];
5359
- Array.isArray(k) && k.forEach((w, T) => {
5322
+ const w = h[p.key];
5323
+ Array.isArray(w) && w.forEach((k, T) => {
5360
5324
  p.fields.forEach((L) => {
5361
- const C = w[L.key];
5325
+ const C = k[L.key];
5362
5326
  if (L.required && (!C || typeof C == "string" && C.trim() === "")) {
5363
- f[p.key] || (f[p.key] = {}), f[p.key][T] || (f[p.key][T] = {}), f[p.key][T][L.key] = `${L.label} is required`;
5327
+ b[p.key] || (b[p.key] = {}), b[p.key][T] || (b[p.key][T] = {}), b[p.key][T][L.key] = `${L.label} is required`;
5364
5328
  return;
5365
5329
  }
5366
5330
  if (L.fieldtype === "number" && C !== "" && C !== null && C !== void 0) {
5367
5331
  const M = Number(C);
5368
- isNaN(M) ? (f[p.key] || (f[p.key] = {}), f[p.key][T] || (f[p.key][T] = {}), f[p.key][T][L.key] = `${L.label} must be a valid number`) : (L.min !== void 0 && M < L.min && (f[p.key] || (f[p.key] = {}), f[p.key][T] || (f[p.key][T] = {}), f[p.key][T][L.key] = `${L.label} must be at least ${L.min}`), L.max !== void 0 && M > L.max && (f[p.key] || (f[p.key] = {}), f[p.key][T] || (f[p.key][T] = {}), f[p.key][T][L.key] = `${L.label} must not exceed ${L.max}`));
5332
+ isNaN(M) ? (b[p.key] || (b[p.key] = {}), b[p.key][T] || (b[p.key][T] = {}), b[p.key][T][L.key] = `${L.label} must be a valid number`) : (L.min !== void 0 && M < L.min && (b[p.key] || (b[p.key] = {}), b[p.key][T] || (b[p.key][T] = {}), b[p.key][T][L.key] = `${L.label} must be at least ${L.min}`), L.max !== void 0 && M > L.max && (b[p.key] || (b[p.key] = {}), b[p.key][T] || (b[p.key][T] = {}), b[p.key][T][L.key] = `${L.label} must not exceed ${L.max}`));
5369
5333
  }
5370
5334
  });
5371
5335
  });
5372
5336
  }
5373
- }), f;
5374
- }, S = (f) => Object.keys(f).length > 0, O = () => {
5337
+ }), b;
5338
+ }, z = (b) => Object.keys(b).length > 0, O = () => {
5375
5339
  if (g) {
5376
5340
  console.log("[handleSave] Already saving, ignoring duplicate call");
5377
5341
  return;
5378
5342
  }
5379
5343
  console.log("[handleSave] Starting save process");
5380
- const f = b();
5381
- if (E(f), S(f)) {
5382
- let k = [];
5383
- Object.keys(f).forEach((w) => {
5384
- typeof f[w] == "object" && Object.keys(f[w]).forEach((T) => {
5385
- typeof f[w][T] == "object" ? Object.keys(f[w][T]).forEach((L) => {
5386
- k.push(`${w} row ${parseInt(T) + 1}: ${f[w][T][L]}`);
5387
- }) : k.push(`${w}: ${f[w][T]}`);
5344
+ const b = f();
5345
+ if (E(b), z(b)) {
5346
+ let w = [];
5347
+ Object.keys(b).forEach((k) => {
5348
+ typeof b[k] == "object" && Object.keys(b[k]).forEach((T) => {
5349
+ typeof b[k][T] == "object" ? Object.keys(b[k][T]).forEach((L) => {
5350
+ w.push(`${k} row ${parseInt(T) + 1}: ${b[k][T][L]}`);
5351
+ }) : w.push(`${k}: ${b[k][T]}`);
5388
5352
  });
5389
5353
  });
5390
5354
  return;
5391
5355
  }
5392
5356
  (async () => {
5393
5357
  try {
5394
- D(!0);
5395
- const k = {};
5396
- u && Object.keys(u).forEach((T) => {
5358
+ S(!0);
5359
+ const w = {};
5360
+ h && Object.keys(h).forEach((T) => {
5397
5361
  const L = a?.configuration?.find(
5398
5362
  (C) => C.key === T && C.type === "datatable"
5399
5363
  );
5400
- L && Array.isArray(u[T]) ? k[T] = u[T].map((C) => {
5364
+ L && Array.isArray(h[T]) ? w[T] = h[T].map((C) => {
5401
5365
  const M = { id: C.id || 0 };
5402
- return L.fields && L.fields.forEach((V) => {
5403
- if (V.fieldtype === "audience") {
5366
+ return L.fields && L.fields.forEach((_) => {
5367
+ if (_.fieldtype === "audience") {
5404
5368
  let A = { users: [], groups: [], roles: [] };
5405
- C[V.key] && typeof C[V.key] == "object" && !Array.isArray(C[V.key]) && (A = {
5406
- users: C[V.key].users || [],
5407
- groups: C[V.key].groups || [],
5408
- roles: C[V.key].roles || []
5409
- }), M[V.key] = A;
5369
+ C[_.key] && typeof C[_.key] == "object" && !Array.isArray(C[_.key]) && (A = {
5370
+ users: C[_.key].users || [],
5371
+ groups: C[_.key].groups || [],
5372
+ roles: C[_.key].roles || []
5373
+ }), M[_.key] = A;
5410
5374
  } else
5411
- M[V.key] = C[V.key] || "";
5375
+ M[_.key] = C[_.key] || "";
5412
5376
  }), M;
5413
- }) : k[T] = u[T];
5414
- }), (!k.appkey || k.appkey === "") && (k.appkey = t);
5415
- let w = await xt(P, k);
5416
- if (w && w.status != "fail") {
5417
- E({}), r(JSON.parse(JSON.stringify(u)));
5418
- const T = w.message || "Configuration has been saved successfully";
5419
- qe.success(T), i && typeof i == "function" && i(u);
5377
+ }) : w[T] = h[T];
5378
+ }), (!w.appkey || w.appkey === "") && (w.appkey = t);
5379
+ let k = await xt(P, w);
5380
+ if (k && k.status != "fail") {
5381
+ E({}), r(JSON.parse(JSON.stringify(h)));
5382
+ const T = k.message || "Configuration has been saved successfully";
5383
+ qe.success(T), i && typeof i == "function" && i(h);
5420
5384
  } else
5421
- throw qe.error(w?.message || "Failed to save configuration"), new Error("No response received from server");
5422
- } catch (k) {
5423
- console.error("Error saving configuration:", k), qe.error(k?.message || "Failed to save configuration");
5385
+ throw qe.error(k?.message || "Failed to save configuration"), new Error("No response received from server");
5386
+ } catch (w) {
5387
+ console.error("Error saving configuration:", w), qe.error(w?.message || "Failed to save configuration");
5424
5388
  } finally {
5425
- D(!1);
5389
+ S(!1);
5426
5390
  }
5427
5391
  })();
5428
- }, R = () => {
5392
+ }, I = () => {
5429
5393
  console.log("[DynamicConfig] handleCancel called"), Y() ? (console.log("[DynamicConfig] Unsaved changes detected - showing modal"), l ? l() : console.warn("[DynamicConfig] onShowCancelModal not provided, cannot show modal")) : (console.log("[DynamicConfig] No unsaved changes - going back directly"), m ? m() : (console.log("[DynamicConfig] Using fallback window.history.back()"), window.history.back()));
5430
5394
  };
5431
5395
  if (!o?.configuration && !a?.configuration)
5432
5396
  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" }) });
5433
- const z = a?.configuration || o?.configuration;
5434
- return Z(() => {
5435
- s && a ? (!u || Object.keys(u).length === 0) && $() : s && !a && $();
5397
+ const D = a?.configuration || o?.configuration;
5398
+ return te(() => {
5399
+ s && a ? (!h || Object.keys(h).length === 0) && $() : s && !a && $();
5436
5400
  }, [s, a]), /* @__PURE__ */ n("div", { children: [
5437
5401
  /* @__PURE__ */ n(
5438
5402
  "div",
@@ -5441,14 +5405,14 @@ function Ss({
5441
5405
  style: { padding: "0px 20px 0px 0px" },
5442
5406
  children: [
5443
5407
  v && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(ba, { size: "large" }) }),
5444
- !v && z?.map((f, p) => {
5445
- const k = zs(f.type);
5446
- if (k && k !== "UnknownType")
5408
+ !v && D?.map((b, p) => {
5409
+ const w = zs(b.type);
5410
+ if (w && w !== "UnknownType")
5447
5411
  return /* @__PURE__ */ e(
5448
- k,
5412
+ w,
5449
5413
  {
5450
- item: f,
5451
- data: u,
5414
+ item: b,
5415
+ data: h,
5452
5416
  updateHandler: x,
5453
5417
  validationErrors: F
5454
5418
  },
@@ -5463,7 +5427,7 @@ function Ss({
5463
5427
  le,
5464
5428
  {
5465
5429
  category: "secondary",
5466
- onClick: R,
5430
+ onClick: I,
5467
5431
  label: "Cancel",
5468
5432
  disabled: g,
5469
5433
  type: "button"
@@ -5488,32 +5452,32 @@ const Kl = ({
5488
5452
  disableApi: s = !1
5489
5453
  }) => {
5490
5454
  const [i, l] = B(0), [m, o] = B(!1), {
5491
- pageHeader: h = {},
5492
- appletHeader: u = {},
5455
+ pageHeader: u = {},
5456
+ appletHeader: h = {},
5493
5457
  breadcrumb: N = [],
5494
5458
  overview: y = {},
5495
5459
  configuration: r = []
5496
- } = t, v = ae(() => r.map((b) => {
5497
- if (b.type === "section" && b.fields) {
5498
- const S = [...b.fields], O = S.findIndex((R) => R && R.key === "appkey");
5460
+ } = t, v = ae(() => r.map((f) => {
5461
+ if (f.type === "section" && f.fields) {
5462
+ const z = [...f.fields], O = z.findIndex((I) => I && I.key === "appkey");
5499
5463
  if (O !== -1) {
5500
- const R = S[O];
5501
- if (S[O] = {
5502
- ...R,
5464
+ const I = z[O];
5465
+ if (z[O] = {
5466
+ ...I,
5503
5467
  default: a,
5504
5468
  value: a,
5505
5469
  readonly: !0,
5506
5470
  placeholder: a,
5507
5471
  disabled: !1
5508
- }, S.some((f) => f.key === "displayname")) {
5509
- const f = S.findIndex((k) => k.key === "displayname"), p = S[f] || {};
5510
- S[f] = {
5472
+ }, z.some((b) => b.key === "displayname")) {
5473
+ const b = z.findIndex((w) => w.key === "displayname"), p = z[b] || {};
5474
+ z[b] = {
5511
5475
  ...p,
5512
5476
  default: p.default || p.value || a,
5513
5477
  placeholder: p.placeholder || "Enter display name"
5514
5478
  };
5515
5479
  } else {
5516
- const f = {
5480
+ const b = {
5517
5481
  key: "displayname",
5518
5482
  label: "Display Name",
5519
5483
  fieldtype: "text",
@@ -5522,53 +5486,53 @@ const Kl = ({
5522
5486
  placeholder: "Enter display name",
5523
5487
  required: !1
5524
5488
  };
5525
- S.splice(O + 1, 0, f);
5489
+ z.splice(O + 1, 0, b);
5526
5490
  }
5527
5491
  }
5528
5492
  return {
5529
- ...b,
5530
- fields: S
5493
+ ...f,
5494
+ fields: z
5531
5495
  };
5532
5496
  }
5533
- return b;
5497
+ return f;
5534
5498
  }), [r, a]), d = {
5535
5499
  heading: "App Details",
5536
5500
  subHeading: "View app details and customize configurations to align with institutional requirements.",
5537
5501
  isLeftArrow: !0,
5538
5502
  onBackClick: () => window.history.back(),
5539
- ...h
5540
- }, g = N.map((b) => ({
5541
- label: b.text,
5542
- href: b.href || "#"
5543
- })), D = ee(() => {
5503
+ ...u
5504
+ }, g = N.map((f) => ({
5505
+ label: f.text,
5506
+ href: f.href || "#"
5507
+ })), S = K(() => {
5544
5508
  o(!0);
5545
- }, []), F = ee((b) => {
5546
- o(!1), b.primary && window.history.back();
5547
- }, []), E = ee((b) => {
5548
- console.log("Configuration changed:", b);
5549
- }, []), I = ee(() => {
5509
+ }, []), F = K((f) => {
5510
+ o(!1), f.primary && window.history.back();
5511
+ }, []), E = K((f) => {
5512
+ console.log("Configuration changed:", f);
5513
+ }, []), R = K(() => {
5550
5514
  window.history.back();
5551
5515
  }, []), P = (() => {
5552
- if (u.headingKey && Array.isArray(r)) {
5553
- const b = u.headingKey.split("."), S = b[0], O = b[1], R = r.find((z) => z && z.key === S);
5554
- if (R && R.fields) {
5555
- const z = R.fields.find((f) => f && f.key === O);
5556
- if (z)
5557
- return z.default ?? z.value ?? u.heading ?? a;
5516
+ if (h.headingKey && Array.isArray(r)) {
5517
+ const f = h.headingKey.split("."), z = f[0], O = f[1], I = r.find((D) => D && D.key === z);
5518
+ if (I && I.fields) {
5519
+ const D = I.fields.find((b) => b && b.key === O);
5520
+ if (D)
5521
+ return D.default ?? D.value ?? h.heading ?? a;
5558
5522
  }
5559
5523
  }
5560
5524
  if (Array.isArray(r)) {
5561
- for (const b of r)
5562
- if (b && b.fields) {
5563
- const S = b.fields.find((O) => O && O.key === "displayname");
5564
- if (S) return S.default ?? S.value ?? a;
5525
+ for (const f of r)
5526
+ if (f && f.fields) {
5527
+ const z = f.fields.find((O) => O && O.key === "displayname");
5528
+ if (z) return z.default ?? z.value ?? a;
5565
5529
  }
5566
5530
  }
5567
- return u.heading || a;
5568
- })(), _ = {
5531
+ return h.heading || a;
5532
+ })(), j = {
5569
5533
  subHeading: "Application configuration and details",
5570
5534
  tags: [],
5571
- ...u,
5535
+ ...h,
5572
5536
  heading: P
5573
5537
  // Use resolvedDisplayName only
5574
5538
  }, U = {
@@ -5593,22 +5557,22 @@ const Kl = ({
5593
5557
  configuration: v
5594
5558
  }), [v]), q = ae(() => [
5595
5559
  { label: "Overview", content: x(U) },
5596
- { label: "Configuration", content: /* @__PURE__ */ e(Ss, { appid: a, configdata: Y, disableApi: s, onSave: E, onShowCancelModal: D, onCancel: I }) }
5597
- ], [a, Y, s, E, D, I, U]);
5598
- function $(b) {
5599
- return b ? b.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: b } }) : b : "📱";
5560
+ { label: "Configuration", content: /* @__PURE__ */ e(Ss, { appid: a, configdata: Y, disableApi: s, onSave: E, onShowCancelModal: S, onCancel: R }) }
5561
+ ], [a, Y, s, E, S, R, U]);
5562
+ function $(f) {
5563
+ return f ? f.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: f } }) : f : "📱";
5600
5564
  }
5601
- function x(b) {
5565
+ function x(f) {
5602
5566
  return /* @__PURE__ */ n("div", { className: "bg-white rounded-2xl p-1", children: [
5603
5567
  /* @__PURE__ */ n("section", { className: "mb-8", children: [
5604
5568
  /* @__PURE__ */ e("h2", { className: "text-xl font-semibold mb-2", children: "About" }),
5605
- /* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children: b.about })
5569
+ /* @__PURE__ */ e("p", { className: "text-gray-700 text-base", children: f.about })
5606
5570
  ] }),
5607
5571
  /* @__PURE__ */ n("section", { className: "flex flex-row gap-6 justify-center items-center mb-8", children: [
5608
5572
  /* @__PURE__ */ e(
5609
5573
  "img",
5610
5574
  {
5611
- src: b.images.desktop,
5575
+ src: f.images.desktop,
5612
5576
  alt: "Desktop View",
5613
5577
  className: "rounded-xl border border-gray-200 w-[340px] h-[220px] object-cover"
5614
5578
  }
@@ -5616,7 +5580,7 @@ const Kl = ({
5616
5580
  /* @__PURE__ */ e(
5617
5581
  "img",
5618
5582
  {
5619
- src: b.images.mobile1,
5583
+ src: f.images.mobile1,
5620
5584
  alt: "Mobile View 1",
5621
5585
  className: "rounded-2xl border border-gray-200 w-[120px] h-[220px] object-cover"
5622
5586
  }
@@ -5624,10 +5588,10 @@ const Kl = ({
5624
5588
  ] }),
5625
5589
  /* @__PURE__ */ n("section", { children: [
5626
5590
  /* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-4", children: "Key Features" }),
5627
- /* @__PURE__ */ e("ul", { className: "space-y-3", children: b.features.map((S, O) => /* @__PURE__ */ n("li", { children: [
5628
- /* @__PURE__ */ e("span", { className: "font-semibold", children: S.title }),
5591
+ /* @__PURE__ */ e("ul", { className: "space-y-3", children: f.features.map((z, O) => /* @__PURE__ */ n("li", { children: [
5592
+ /* @__PURE__ */ e("span", { className: "font-semibold", children: z.title }),
5629
5593
  /* @__PURE__ */ e("br", {}),
5630
- /* @__PURE__ */ e("span", { className: "text-gray-700", children: S.description })
5594
+ /* @__PURE__ */ e("span", { className: "text-gray-700", children: z.description })
5631
5595
  ] }, O)) })
5632
5596
  ] })
5633
5597
  ] });
@@ -5644,29 +5608,29 @@ const Kl = ({
5644
5608
  }
5645
5609
  ),
5646
5610
  /* @__PURE__ */ n("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
5647
- /* @__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: $(_.icon) }),
5611
+ /* @__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.icon) }),
5648
5612
  /* @__PURE__ */ n("div", { className: "flex flex-col min-w-0", children: [
5649
- /* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: _.heading }),
5650
- /* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: _.subHeading }),
5651
- /* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: _.tags && _.tags.map((b, S) => /* @__PURE__ */ e(
5613
+ /* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: j.heading }),
5614
+ /* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: j.subHeading }),
5615
+ /* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: j.tags && j.tags.map((f, z) => /* @__PURE__ */ e(
5652
5616
  "span",
5653
5617
  {
5654
5618
  className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
5655
- children: b
5619
+ children: f
5656
5620
  },
5657
- S
5621
+ z
5658
5622
  )) })
5659
5623
  ] })
5660
5624
  ] }),
5661
5625
  /* @__PURE__ */ n("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
5662
- /* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: q.map((b, S) => /* @__PURE__ */ e(
5626
+ /* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: q.map((f, z) => /* @__PURE__ */ e(
5663
5627
  "button",
5664
5628
  {
5665
- onClick: () => l(S),
5666
- className: `${i === S ? "border-black text-black" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} whitespace-nowrap py-3 px-6 border-b-2 font-medium text-sm transition-colors duration-200`,
5667
- children: b.label
5629
+ onClick: () => l(z),
5630
+ className: `${i === z ? "border-black text-black" : "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"} whitespace-nowrap py-3 px-6 border-b-2 font-medium text-sm transition-colors duration-200`,
5631
+ children: f.label
5668
5632
  },
5669
- S
5633
+ z
5670
5634
  )) }) }),
5671
5635
  /* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: q[i].content })
5672
5636
  ] }),
@@ -5691,77 +5655,77 @@ const Kl = ({
5691
5655
  allowEdit: l = !0,
5692
5656
  allowDelete: m = !0,
5693
5657
  allowReorder: o = !0,
5694
- initialData: h = null
5658
+ initialData: u = null
5695
5659
  }) => {
5696
- const [u, N] = B(null), [y, r] = B(""), [v, d] = B(() => Array.isArray(h) ? h : []), [g, D] = B(null), [F, E] = B(null), [I, P] = B("");
5697
- Z(() => {
5698
- Array.isArray(h) && d(h);
5699
- }, [h]);
5700
- const _ = (p) => {
5660
+ const [h, N] = B(null), [y, r] = B(""), [v, d] = B(() => Array.isArray(u) ? u : []), [g, S] = B(null), [F, E] = B(null), [R, P] = B("");
5661
+ te(() => {
5662
+ Array.isArray(u) && d(u);
5663
+ }, [u]);
5664
+ const j = (p) => {
5701
5665
  l && (N(p._id), r(p.categoryName || ""));
5702
5666
  }, U = () => {
5703
- if (!i || u !== null) return;
5704
- const k = (v.length > 0 ? Math.max(...v.map((w) => typeof w._id == "number" ? w._id : 0)) : 0) + 1;
5705
- d((w) => [
5706
- ...w,
5667
+ if (!i || h !== null) return;
5668
+ const w = (v.length > 0 ? Math.max(...v.map((k) => typeof k._id == "number" ? k._id : 0)) : 0) + 1;
5669
+ d((k) => [
5670
+ ...k,
5707
5671
  {
5708
- _id: k,
5672
+ _id: w,
5709
5673
  categoryName: "",
5710
5674
  links: [],
5711
- order: (w.at(-1)?.order ?? 0) + 1,
5675
+ order: (k.at(-1)?.order ?? 0) + 1,
5712
5676
  protected: !1,
5713
5677
  _class: "com.unifyed.model.Collection"
5714
5678
  }
5715
- ]), N(k), r("");
5679
+ ]), N(w), r("");
5716
5680
  }, Y = () => {
5717
- u != null && (d((p) => {
5718
- const w = !Array.isArray(h) || !h.some((T) => T._id === u) ? p.filter((T) => T._id !== u) : p;
5719
- return a?.(w), w;
5681
+ h != null && (d((p) => {
5682
+ const k = !Array.isArray(u) || !u.some((T) => T._id === h) ? p.filter((T) => T._id !== h) : p;
5683
+ return a?.(k), k;
5720
5684
  }), N(null), r(""));
5721
5685
  }, q = () => {
5722
- u == null || !y.trim() || (d((p) => {
5723
- const k = p.map((w) => w._id === u ? {
5724
- ...w,
5686
+ h == null || !y.trim() || (d((p) => {
5687
+ const w = p.map((k) => k._id === h ? {
5688
+ ...k,
5725
5689
  categoryName: y.trim()
5726
- } : w);
5727
- return a?.(k), k;
5690
+ } : k);
5691
+ return a?.(w), w;
5728
5692
  }), N(null), r(""));
5729
5693
  }, $ = (p) => {
5730
- m && d((k) => {
5731
- const w = k.filter((T) => T._id !== p._id);
5732
- return a?.(w), w;
5694
+ m && d((w) => {
5695
+ const k = w.filter((T) => T._id !== p._id);
5696
+ return a?.(k), k;
5733
5697
  });
5734
- }, x = (p, k, w) => {
5735
- const T = Number(k), L = Number(w);
5698
+ }, x = (p, w, k) => {
5699
+ const T = Number(w), L = Number(k);
5736
5700
  if (!o || T === L) return p;
5737
5701
  const C = p.findIndex((G) => Number(G._id) === T), M = p.findIndex((G) => Number(G._id) === L);
5738
5702
  if (C === -1 || M === -1) return p;
5739
- const V = [...p], [A] = V.splice(C, 1);
5740
- return V.splice(M, 0, A), V.map((G, W) => ({ ...G, order: W + 1 }));
5741
- }, b = (p, k) => {
5742
- o && (p.dataTransfer.effectAllowed = "move", p.dataTransfer.setData("text/plain", String(k)), D(Number(k)));
5743
- }, S = (p) => {
5703
+ const _ = [...p], [A] = _.splice(C, 1);
5704
+ return _.splice(M, 0, A), _.map((G, W) => ({ ...G, order: W + 1 }));
5705
+ }, f = (p, w) => {
5706
+ o && (p.dataTransfer.effectAllowed = "move", p.dataTransfer.setData("text/plain", String(w)), S(Number(w)));
5707
+ }, z = (p) => {
5744
5708
  g && p !== F && E(p);
5745
5709
  }, O = (p) => {
5746
5710
  p.preventDefault();
5747
- }, R = (p, k) => {
5711
+ }, I = (p, w) => {
5748
5712
  p.preventDefault();
5749
- const w = p.dataTransfer.getData("text/plain"), T = w === "0" ? 0 : Number(w), L = k === "0" ? 0 : Number(k);
5713
+ const k = p.dataTransfer.getData("text/plain"), T = k === "0" ? 0 : Number(k), L = w === "0" ? 0 : Number(w);
5750
5714
  T === void 0 || L === void 0 || (d((C) => {
5751
5715
  const M = x(C, T, L);
5752
5716
  return a?.(M), M;
5753
- }), D(null), E(null));
5754
- }, z = () => {
5755
- D(null), E(null);
5756
- }, f = Array.isArray(v) ? v.filter(
5757
- (p) => p.categoryName?.toLowerCase().includes(I.toLowerCase())
5717
+ }), S(null), E(null));
5718
+ }, D = () => {
5719
+ S(null), E(null);
5720
+ }, b = Array.isArray(v) ? v.filter(
5721
+ (p) => p.categoryName?.toLowerCase().includes(R.toLowerCase())
5758
5722
  ) : [];
5759
5723
  return /* @__PURE__ */ n("div", { className: `manage-collection-list ${t}`, children: [
5760
5724
  /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ n("div", { className: "w-1/2 flex justify-end", children: [
5761
5725
  s && /* @__PURE__ */ e(
5762
5726
  ge,
5763
5727
  {
5764
- value: I,
5728
+ value: R,
5765
5729
  onDebouncedChange: P,
5766
5730
  placeholder: "Search Collection",
5767
5731
  customClass: "mr-4 searchmanagecollection"
@@ -5772,37 +5736,37 @@ const Kl = ({
5772
5736
  {
5773
5737
  className: [
5774
5738
  "px-4 py-3 bg-black text-white rounded-2xl ml-4",
5775
- u !== null ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
5739
+ h !== null ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
5776
5740
  ].join(" "),
5777
5741
  onClick: U,
5778
- disabled: u !== null,
5742
+ disabled: h !== null,
5779
5743
  children: "Add a Collection"
5780
5744
  }
5781
5745
  )
5782
5746
  ] }) }),
5783
- /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: f.map((p) => {
5784
- const k = u === p._id, w = p?.links?.length ?? 0, T = g === p._id, L = F === p._id && g !== p._id;
5747
+ /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: b.map((p) => {
5748
+ const w = h === p._id, k = p?.links?.length ?? 0, T = g === p._id, L = F === p._id && g !== p._id;
5785
5749
  return /* @__PURE__ */ e(
5786
5750
  "div",
5787
5751
  {
5788
- onDragEnter: () => S(p._id),
5752
+ onDragEnter: () => z(p._id),
5789
5753
  onDragOver: O,
5790
- onDrop: (C) => R(C, p._id),
5791
- onDragEnd: z,
5754
+ onDrop: (C) => I(C, p._id),
5755
+ onDragEnd: D,
5792
5756
  className: [
5793
5757
  "flex items-center justify-between p-3 border rounded-2xl mb-3",
5794
5758
  "border-gray-300",
5795
5759
  L ? "ring-2 ring-gray-800/20" : "",
5796
5760
  T ? "opacity-60" : ""
5797
5761
  ].join(" "),
5798
- children: k ? /* @__PURE__ */ n(te, { children: [
5762
+ children: w ? /* @__PURE__ */ n(ee, { children: [
5799
5763
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
5800
5764
  "input",
5801
5765
  {
5802
5766
  type: "text",
5803
5767
  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",
5804
5768
  value: y,
5805
- placeholder: !Array.isArray(h) || !h.some((C) => C._id === p._id) ? "New collection name" : "Edit collection name",
5769
+ placeholder: !Array.isArray(u) || !u.some((C) => C._id === p._id) ? "New collection name" : "Edit collection name",
5806
5770
  onChange: (C) => r(C.target.value),
5807
5771
  onKeyDown: (C) => {
5808
5772
  C.key === "Enter" && q(), C.key === "Escape" && Y();
@@ -5835,7 +5799,7 @@ const Kl = ({
5835
5799
  }
5836
5800
  )
5837
5801
  ] })
5838
- ] }) : /* @__PURE__ */ n(te, { children: [
5802
+ ] }) : /* @__PURE__ */ n(ee, { children: [
5839
5803
  /* @__PURE__ */ n("div", { className: "flex gap-2 items-center", children: [
5840
5804
  o && /* @__PURE__ */ e(
5841
5805
  "span",
@@ -5844,19 +5808,19 @@ const Kl = ({
5844
5808
  "aria-label": "Drag to reorder",
5845
5809
  className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
5846
5810
  draggable: !0,
5847
- onDragStart: (C) => b(C, p._id),
5811
+ onDragStart: (C) => f(C, p._id),
5848
5812
  children: /* @__PURE__ */ e(wt, {})
5849
5813
  }
5850
5814
  ),
5851
5815
  /* @__PURE__ */ e("span", { children: p.categoryName })
5852
5816
  ] }),
5853
5817
  /* @__PURE__ */ n("div", { className: "flex gap-2 items-center", children: [
5854
- p.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: p.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${w} ${w === 1 ? "link" : "links"}` }),
5818
+ p.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: p.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${k} ${k === 1 ? "link" : "links"}` }),
5855
5819
  l && /* @__PURE__ */ e(
5856
5820
  "button",
5857
5821
  {
5858
5822
  className: "cursor-pointer",
5859
- onClick: () => _(p),
5823
+ onClick: () => j(p),
5860
5824
  "aria-label": `Edit ${p.categoryName}`,
5861
5825
  children: /* @__PURE__ */ e(xr, { color: "#767676" })
5862
5826
  }
@@ -5864,10 +5828,10 @@ const Kl = ({
5864
5828
  m && /* @__PURE__ */ e(
5865
5829
  "span",
5866
5830
  {
5867
- className: w === 0 && !p.protected ? "cursor-pointer" : "cursor-not-allowed",
5868
- title: w === 0 && !p.protected ? "Delete" : "Cannot delete a collection with linked items",
5869
- onClick: w === 0 ? () => $(p) : null,
5870
- children: /* @__PURE__ */ e(Le, { color: w === 0 ? "#767676" : "#C2C2C2" })
5831
+ className: k === 0 && !p.protected ? "cursor-pointer" : "cursor-not-allowed",
5832
+ title: k === 0 && !p.protected ? "Delete" : "Cannot delete a collection with linked items",
5833
+ onClick: k === 0 ? () => $(p) : null,
5834
+ children: /* @__PURE__ */ e(Le, { color: k === 0 ? "#767676" : "#C2C2C2" })
5871
5835
  }
5872
5836
  )
5873
5837
  ] })
@@ -5879,7 +5843,7 @@ const Kl = ({
5879
5843
  ] });
5880
5844
  };
5881
5845
  function ei({ children: t }) {
5882
- return /* @__PURE__ */ n(te, { children: [
5846
+ return /* @__PURE__ */ n(ee, { children: [
5883
5847
  t,
5884
5848
  /* @__PURE__ */ e(
5885
5849
  nn,
@@ -5958,23 +5922,23 @@ const Bt = () => {
5958
5922
  // preferred
5959
5923
  onAdd: m,
5960
5924
  onFilterOpen: o,
5961
- addBtnText: h = "Add",
5925
+ addBtnText: u = "Add",
5962
5926
  // Feature toggles
5963
- showSearch: u = !0,
5927
+ showSearch: h = !0,
5964
5928
  showDelete: N = !0,
5965
5929
  showColumnChooser: y = !0,
5966
5930
  showFilter: r = !1,
5967
5931
  showPrint: v = !1,
5968
5932
  showExcel: d = !1,
5969
5933
  showPdf: g = !1,
5970
- showRefresh: D = !1,
5934
+ showRefresh: S = !1,
5971
5935
  showAdd: F = !1,
5972
5936
  iSelectedRecords: E = 0,
5973
5937
  // Additional props
5974
- searchPlaceholder: I = "Search...",
5938
+ searchPlaceholder: R = "Search...",
5975
5939
  handleRefreshClick: P = () => {
5976
5940
  },
5977
- handleSearchChange: _ = () => {
5941
+ handleSearchChange: j = () => {
5978
5942
  },
5979
5943
  handleDeleteClick: U = () => {
5980
5944
  },
@@ -5983,21 +5947,21 @@ const Bt = () => {
5983
5947
  pdfFileName: q,
5984
5948
  searchIconSize: $,
5985
5949
  searchIconClass: x,
5986
- inputStyle: b
5950
+ inputStyle: f
5987
5951
  }) => {
5988
- const S = () => l?.current || i?.current, [O, R] = re.useState(""), z = (t || "export").toString().trim() || "export", f = `${Y || z}.xlsx`, p = `${q || z}.pdf`, k = (L, C, M) => Math.max(C, Math.min(L, M)), w = ee(
5952
+ const z = () => l?.current || i?.current, [O, I] = re.useState(""), D = (t || "export").toString().trim() || "export", b = `${Y || D}.xlsx`, p = `${q || D}.pdf`, w = (L, C, M) => Math.max(C, Math.min(L, M)), k = K(
5989
5953
  (L) => {
5990
- const C = S();
5954
+ const C = z();
5991
5955
  if (C?.openColumnChooser) {
5992
5956
  if (typeof window > "u" || !L?.currentTarget) {
5993
5957
  C.openColumnChooser();
5994
5958
  return;
5995
5959
  }
5996
5960
  try {
5997
- const M = L.currentTarget.getBoundingClientRect(), V = M.left + window.scrollX, A = M.bottom + window.scrollY;
5998
- let G = V - 120, W = A - 120;
5961
+ const M = L.currentTarget.getBoundingClientRect(), _ = M.left + window.scrollX, A = M.bottom + window.scrollY;
5962
+ let G = _ - 120, W = A - 120;
5999
5963
  const pe = window.innerWidth, Ne = window.innerHeight;
6000
- G = k(G, window.scrollX + 8, window.scrollX + pe - 340), W = k(W, window.scrollY, window.scrollY + Ne - 120), C.openColumnChooser(G, W);
5964
+ G = w(G, window.scrollX + 8, window.scrollX + pe - 340), W = w(W, window.scrollY, window.scrollY + Ne - 120), C.openColumnChooser(G, W);
6001
5965
  } catch (M) {
6002
5966
  console.log("coloumn choose error", M);
6003
5967
  }
@@ -6005,36 +5969,36 @@ const Bt = () => {
6005
5969
  },
6006
5970
  []
6007
5971
  // no external deps; reads ref at call time
6008
- ), T = ee(
5972
+ ), T = K(
6009
5973
  (L, C) => {
6010
- const M = S();
5974
+ const M = z();
6011
5975
  if (M)
6012
5976
  switch (L) {
6013
5977
  case "Delete": {
6014
5978
  if (N) {
6015
- const V = M.getSelectedRecords();
6016
- return U(V);
5979
+ const _ = M.getSelectedRecords();
5980
+ return U(_);
6017
5981
  }
6018
5982
  break;
6019
5983
  }
6020
5984
  case "ColumnChooser":
6021
- y && (C ? w(C) : M.openColumnChooser?.());
5985
+ y && (C ? k(C) : M.openColumnChooser?.());
6022
5986
  break;
6023
5987
  case "Print":
6024
5988
  v && M.print?.();
6025
5989
  break;
6026
5990
  case "Excel":
6027
- d && M.excelExport?.({ fileName: f });
5991
+ d && M.excelExport?.({ fileName: b });
6028
5992
  break;
6029
5993
  case "Pdf":
6030
5994
  g && M.pdfExport?.({ fileName: p });
6031
5995
  break;
6032
5996
  case "Refresh":
6033
- D && P();
5997
+ S && P();
6034
5998
  break;
6035
5999
  }
6036
6000
  },
6037
- [y, v, d, g, D, f, p, P, w]
6001
+ [y, v, d, g, S, b, p, P, k]
6038
6002
  );
6039
6003
  return /* @__PURE__ */ n("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: [
6040
6004
  /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
@@ -6046,17 +6010,17 @@ const Bt = () => {
6046
6010
  a ? /* @__PURE__ */ e("div", { className: "text-sm text-gray-500", children: a }) : null
6047
6011
  ] }),
6048
6012
  /* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
6049
- u && /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
6013
+ h && /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
6050
6014
  ge,
6051
6015
  {
6052
- placeholder: I,
6016
+ placeholder: R,
6053
6017
  value: O,
6054
6018
  onDebouncedChange: (L) => {
6055
- R(L), _(L);
6019
+ I(L), j(L);
6056
6020
  },
6057
6021
  searchIconSize: $ || 16,
6058
6022
  searchIconClass: x || "",
6059
- inputStyle: b || { paddingTop: "4px", paddingBottom: "4px" }
6023
+ inputStyle: f || { paddingTop: "4px", paddingBottom: "4px" }
6060
6024
  }
6061
6025
  ) }),
6062
6026
  /* @__PURE__ */ n("div", { className: "flex gap-3", children: [
@@ -6110,7 +6074,7 @@ const Bt = () => {
6110
6074
  ariaLabel: "PDF Download"
6111
6075
  }
6112
6076
  ),
6113
- D && /* @__PURE__ */ e(
6077
+ S && /* @__PURE__ */ e(
6114
6078
  Ce,
6115
6079
  {
6116
6080
  icon: zr,
@@ -6122,12 +6086,12 @@ const Bt = () => {
6122
6086
  F && m && /* @__PURE__ */ e(
6123
6087
  le,
6124
6088
  {
6125
- label: h,
6089
+ label: u,
6126
6090
  icon: Sr,
6127
6091
  onClick: m,
6128
6092
  size: "small",
6129
6093
  ariaLabel: "Add New",
6130
- title: h
6094
+ title: u
6131
6095
  }
6132
6096
  )
6133
6097
  ] })
@@ -6143,101 +6107,101 @@ function ai(t) {
6143
6107
  // 1-based
6144
6108
  pageSize: m = 20,
6145
6109
  allowPaging: o = !0,
6146
- allowSorting: h = !0,
6147
- allowFiltering: u = !1,
6110
+ allowSorting: u = !0,
6111
+ allowFiltering: h = !1,
6148
6112
  allowGrouping: N = !1,
6149
6113
  allowReordering: y = !0,
6150
6114
  allowResizing: r = !0,
6151
6115
  allowExcelExport: v = !1,
6152
6116
  allowPdfExport: d = !1,
6153
6117
  showColumnChooser: g = !1,
6154
- enableSearchApi: D = !1,
6118
+ enableSearchApi: S = !1,
6155
6119
  height: F = "600",
6156
6120
  selectionSettings: E,
6157
- enableCheckbox: I = !1,
6121
+ enableCheckbox: R = !1,
6158
6122
  columns: P = [],
6159
- onGridStateChange: _,
6123
+ onGridStateChange: j,
6160
6124
  onRowSelected: U,
6161
6125
  onRowDeselected: Y,
6162
6126
  onRowDoubleClick: q,
6163
6127
  apiRef: $,
6164
6128
  gridProps: x = {}
6165
- } = t, b = fe(null), {
6166
- pageSettings: S,
6129
+ } = t, f = fe(null), {
6130
+ pageSettings: z,
6167
6131
  sortSettings: O,
6168
- ...R
6169
- } = x || {}, [z, f] = re.useState(S?.page || l), [p, k] = re.useState(S?.pageSize || m), [w, T] = re.useState(O?.sortKey || "updatedDate"), [L, C] = re.useState(O?.direction || "Descending"), M = ae(() => {
6170
- const j = E || {
6132
+ ...I
6133
+ } = x || {}, [D, b] = re.useState(z?.page || l), [p, w] = re.useState(z?.pageSize || m), [k, T] = re.useState(O?.sortKey || "updatedDate"), [L, C] = re.useState(O?.direction || "Descending"), M = ae(() => {
6134
+ const V = E || {
6171
6135
  type: "Multiple",
6172
6136
  mode: "Row"
6173
6137
  };
6174
- return I ? {
6175
- ...j,
6138
+ return R ? {
6139
+ ...V,
6176
6140
  // These are important for checkbox selection
6177
6141
  enableToggle: !0,
6178
6142
  persistSelection: !0,
6179
6143
  // Enable checkbox specific settings
6180
6144
  checkboxOnly: !1,
6181
6145
  enableSimpleMultiRowSelection: !0
6182
- } : j;
6183
- }, [E, I]), V = ae(() => {
6184
- const j = [ln];
6185
- return (I || E) && j.push(on), h && j.push(cn), u && j.push(dn), N && j.push(mn), D && j.push(un), v && j.push(hn), d && j.push(pn), g && j.push(gn), r && j.push(bn), y && j.push(fn), j.push(yn), j;
6146
+ } : V;
6147
+ }, [E, R]), _ = ae(() => {
6148
+ const V = [ln];
6149
+ return (R || E) && V.push(on), u && V.push(cn), h && V.push(dn), N && V.push(mn), S && V.push(un), v && V.push(hn), d && V.push(pn), g && V.push(gn), r && V.push(bn), y && V.push(fn), V.push(yn), V;
6186
6150
  }, [
6187
- h,
6188
6151
  u,
6152
+ h,
6189
6153
  N,
6190
- D,
6154
+ S,
6191
6155
  v,
6192
6156
  d,
6193
6157
  g,
6194
6158
  r,
6195
6159
  y,
6196
- I,
6160
+ R,
6197
6161
  E
6198
6162
  ]), A = ae(() => {
6199
- const j = () => b.current, ne = (J, ce) => {
6163
+ const V = () => f.current, ne = (J, ce) => {
6200
6164
  !ce && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${J} requested but related service/feature is disabled.`);
6201
6165
  };
6202
6166
  return {
6203
- getInstance: () => j(),
6204
- refresh: () => j()?.refresh?.(),
6205
- getSelectedRecords: () => j()?.getSelectedRecords?.() ?? [],
6206
- clearSelection: () => j()?.clearSelection?.(),
6207
- selectRow: (J, ce = !1) => j()?.selectRow?.(J, ce),
6208
- selectRows: (J, ce = !1) => j()?.selectRows?.(J, ce),
6167
+ getInstance: () => V(),
6168
+ refresh: () => V()?.refresh?.(),
6169
+ getSelectedRecords: () => V()?.getSelectedRecords?.() ?? [],
6170
+ clearSelection: () => V()?.clearSelection?.(),
6171
+ selectRow: (J, ce = !1) => V()?.selectRow?.(J, ce),
6172
+ selectRows: (J, ce = !1) => V()?.selectRows?.(J, ce),
6209
6173
  search: (J) => {
6210
- ne("search()", D), j()?.search?.(J);
6174
+ ne("search()", S), V()?.search?.(J);
6211
6175
  },
6212
- print: () => j()?.print?.(),
6176
+ print: () => V()?.print?.(),
6213
6177
  excelExport: (J) => {
6214
- ne("excelExport()", v), j()?.excelExport?.(J);
6178
+ ne("excelExport()", v), V()?.excelExport?.(J);
6215
6179
  },
6216
6180
  pdfExport: (J) => {
6217
- ne("pdfExport()", d), j()?.pdfExport?.(J);
6181
+ ne("pdfExport()", d), V()?.pdfExport?.(J);
6218
6182
  },
6219
6183
  openColumnChooser: (J, ce) => {
6220
- ne("openColumnChooser()", g), j()?.columnChooserModule?.openColumnChooser?.(J, ce);
6184
+ ne("openColumnChooser()", g), V()?.columnChooserModule?.openColumnChooser?.(J, ce);
6221
6185
  },
6222
6186
  // Additional useful methods
6223
- getColumns: () => j()?.getColumns?.(),
6224
- getFilteredRecords: () => j()?.getFilteredRecords?.(),
6225
- autoFitColumns: (J) => j()?.autoFitColumns?.(J)
6187
+ getColumns: () => V()?.getColumns?.(),
6188
+ getFilteredRecords: () => V()?.getFilteredRecords?.(),
6189
+ autoFitColumns: (J) => V()?.autoFitColumns?.(J)
6226
6190
  };
6227
- }, [D, v, d, g]);
6228
- Z(() => {
6191
+ }, [S, v, d, g]);
6192
+ te(() => {
6229
6193
  $ && ($.current = A);
6230
- }, [$, A]), Z(() => () => {
6194
+ }, [$, A]), te(() => () => {
6231
6195
  $ && ($.current = null);
6232
6196
  }, [$]);
6233
- const G = (j) => {
6234
- const ne = String(j || "");
6197
+ const G = (V) => {
6198
+ const ne = String(V || "");
6235
6199
  return ne === "Ascending" || ne === "Descending" ? ne : ne.toLowerCase() === "ascending" ? "Ascending" : "Descending";
6236
- }, W = (j) => {
6237
- const ne = b.current, J = j?.requestType, ce = J === "paging" ? "paging" : J === "sorting" ? "sorting" : J === "searching" ? "searching" : J === "filtering" ? "filtering" : J === "grouping" ? "grouping" : J === "reorder" ? "reorder" : J === "columnstate" ? "columnstate" : "other", Re = j?.pageSize ?? ne?.pageSettings?.pageSize ?? p, _e = j?.currentPage ?? ne?.pageSettings?.currentPage ?? l, rt = j?.columnName && j?.direction ? [{ field: j.columnName, dir: G(j.direction) }] : (ne?.sortSettings?.columns || []).map((Ie) => ({
6200
+ }, W = (V) => {
6201
+ const ne = f.current, J = V?.requestType, ce = J === "paging" ? "paging" : J === "sorting" ? "sorting" : J === "searching" ? "searching" : J === "filtering" ? "filtering" : J === "grouping" ? "grouping" : J === "reorder" ? "reorder" : J === "columnstate" ? "columnstate" : "other", Re = V?.pageSize ?? ne?.pageSettings?.pageSize ?? p, _e = V?.currentPage ?? ne?.pageSettings?.currentPage ?? l, rt = V?.columnName && V?.direction ? [{ field: V.columnName, dir: G(V.direction) }] : (ne?.sortSettings?.columns || []).map((Ie) => ({
6238
6202
  field: Ie.field,
6239
6203
  dir: G(Ie.direction ?? Ie.dir)
6240
- })), nt = j?.searchString ?? "", st = j?.columns ?? ne?.filterSettings?.columns ?? [];
6204
+ })), nt = V?.searchString ?? "", st = V?.columns ?? ne?.filterSettings?.columns ?? [];
6241
6205
  return {
6242
6206
  reason: ce,
6243
6207
  page: {
@@ -6249,17 +6213,17 @@ function ai(t) {
6249
6213
  sort: rt,
6250
6214
  search: nt,
6251
6215
  filters: st,
6252
- rawEvent: j
6216
+ rawEvent: V
6253
6217
  };
6254
- }, pe = (j) => {
6218
+ }, pe = (V) => {
6255
6219
  setTimeout(() => {
6256
- b?.current?.hideSpinner();
6257
- }, 1e3), j.requestType === "paging" && (f(j.currentPage), k(j.pageSize)), j.requestType === "sorting" && (T(j.columnName || "updatedDate"), C(j.direction)), _?.(W(j), j);
6258
- }, Ne = (j) => {
6259
- q?.(j?.rowData, j);
6220
+ f?.current?.hideSpinner();
6221
+ }, 1e3), V.requestType === "paging" && (b(V.currentPage), w(V.pageSize)), V.requestType === "sorting" && (T(V.columnName || "updatedDate"), C(V.direction)), j?.(W(V), V);
6222
+ }, Ne = (V) => {
6223
+ q?.(V?.rowData, V);
6260
6224
  }, Ta = () => {
6261
- const j = [];
6262
- return I && j.push(
6225
+ const V = [];
6226
+ return R && V.push(
6263
6227
  /* @__PURE__ */ e(
6264
6228
  $t,
6265
6229
  {
@@ -6291,7 +6255,7 @@ function ai(t) {
6291
6255
  customAttributes: Ba,
6292
6256
  ...Va
6293
6257
  } = ne || {};
6294
- j.push(
6258
+ V.push(
6295
6259
  /* @__PURE__ */ e(
6296
6260
  $t,
6297
6261
  {
@@ -6315,29 +6279,29 @@ function ai(t) {
6315
6279
  ce || `col-${J}`
6316
6280
  )
6317
6281
  );
6318
- }), j;
6282
+ }), V;
6319
6283
  }, Aa = ae(() => ({
6320
- currentPage: z,
6284
+ currentPage: D,
6321
6285
  pageSize: p,
6322
- pageSizes: S?.pageSizes ?? [10, 20, 40, 60, 80, 100],
6286
+ pageSizes: z?.pageSizes ?? [10, 20, 40, 60, 80, 100],
6323
6287
  totalCount: s
6324
- }), [z, p, S?.pageSizes, s]), Fa = ae(() => O ?? {
6325
- columns: [{ field: w, direction: G(L) }],
6288
+ }), [D, p, z?.pageSizes, s]), Fa = ae(() => O ?? {
6289
+ columns: [{ field: k, direction: G(L) }],
6326
6290
  allowUnsort: !1
6327
- }, [O, w, L]);
6291
+ }, [O, k, L]);
6328
6292
  return /* @__PURE__ */ n(
6329
6293
  xn,
6330
6294
  {
6331
6295
  id: i,
6332
- ref: b,
6296
+ ref: f,
6333
6297
  dataSource: {
6334
6298
  result: a,
6335
6299
  count: s
6336
6300
  },
6337
6301
  height: F,
6338
6302
  allowPaging: o,
6339
- allowSorting: h,
6340
- allowFiltering: u,
6303
+ allowSorting: u,
6304
+ allowFiltering: h,
6341
6305
  allowGrouping: N,
6342
6306
  allowReordering: y,
6343
6307
  allowResizing: r,
@@ -6350,10 +6314,10 @@ function ai(t) {
6350
6314
  rowDeselected: Y,
6351
6315
  recordDoubleClick: Ne,
6352
6316
  cssClass: "custom-grid-padding",
6353
- ...R,
6317
+ ...I,
6354
6318
  children: [
6355
6319
  /* @__PURE__ */ e(vn, { children: Ta() }),
6356
- /* @__PURE__ */ e(Nn, { services: V })
6320
+ /* @__PURE__ */ e(Nn, { services: _ })
6357
6321
  ]
6358
6322
  }
6359
6323
  );
@@ -6390,14 +6354,14 @@ function oe({
6390
6354
  onSelect: l,
6391
6355
  identity: m = "_id",
6392
6356
  details: o = {},
6393
- ...h
6357
+ ...u
6394
6358
  }) {
6395
- const u = He(), N = $s(h, m), y = (v) => {
6359
+ const h = He(), N = $s(u, m), y = (v) => {
6396
6360
  l?.({
6397
6361
  key: N,
6398
6362
  checked: v.target.checked,
6399
6363
  details: o,
6400
- props: h
6364
+ props: u
6401
6365
  });
6402
6366
  }, r = i === "top-right" ? "top-3 right-3" : "top-3 left-3";
6403
6367
  return /* @__PURE__ */ n(
@@ -6409,7 +6373,7 @@ function oe({
6409
6373
  s && /* @__PURE__ */ e("div", { className: `absolute ${r} z-10`, children: /* @__PURE__ */ e(
6410
6374
  "input",
6411
6375
  {
6412
- id: u,
6376
+ id: h,
6413
6377
  type: "checkbox",
6414
6378
  className: "h-4 w-4 rounded border-zinc-300 focus:ring-[var(--primaryColor)]",
6415
6379
  onChange: y,
@@ -6437,8 +6401,8 @@ function Ts({
6437
6401
  // content
6438
6402
  title: m = "Activity",
6439
6403
  group: o = "Global",
6440
- moreGroupsLabel: h = "+ 5 more",
6441
- author: u = "Judith Black",
6404
+ moreGroupsLabel: u = "+ 5 more",
6405
+ author: h = "Judith Black",
6442
6406
  timeLabel: N = "Just now",
6443
6407
  imageUrl: y = "https://images.unsplash.com/photo-1469980098053-382eb10ba017?q=80&w=1200&auto=format&fit=crop",
6444
6408
  description: r = "Columbia University is a prestigious Ivy League institution located in the heart of New York City.",
@@ -6454,21 +6418,21 @@ function Ts({
6454
6418
  checkboxPosition: s,
6455
6419
  onSelect: i,
6456
6420
  identity: l,
6457
- details: { type: "activity", title: m, group: o, author: u },
6421
+ details: { type: "activity", title: m, group: o, author: h },
6458
6422
  ...v,
6459
6423
  children: [
6460
6424
  /* @__PURE__ */ e("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${g.title} ml-3`, children: m }) }),
6461
6425
  /* @__PURE__ */ n("div", { className: `text-zinc-500 dark:text-zinc-400 ${g.meta}`, children: [
6462
6426
  "Posted in ",
6463
6427
  /* @__PURE__ */ e("span", { className: "font-medium", children: "Global" }),
6464
- h ? /* @__PURE__ */ n(te, { children: [
6428
+ u ? /* @__PURE__ */ n(ee, { children: [
6465
6429
  ",",
6466
6430
  " ",
6467
6431
  /* @__PURE__ */ e(
6468
6432
  "span",
6469
6433
  {
6470
6434
  className: "font-medium text-indigo-700",
6471
- children: h
6435
+ children: u
6472
6436
  }
6473
6437
  )
6474
6438
  ] }) : null,
@@ -6478,7 +6442,7 @@ function Ts({
6478
6442
  /* @__PURE__ */ n("div", { className: "mt-2 flex items-center gap-3", children: [
6479
6443
  /* @__PURE__ */ e(we, { name: "John", size: "medium" }),
6480
6444
  /* @__PURE__ */ n("div", { className: "leading-tight", children: [
6481
- /* @__PURE__ */ e("div", { className: "text-sm font-medium text-zinc-800 dark:text-zinc-100", children: u }),
6445
+ /* @__PURE__ */ e("div", { className: "text-sm font-medium text-zinc-800 dark:text-zinc-100", children: h }),
6482
6446
  /* @__PURE__ */ e("div", { className: `text-zinc-500 dark:text-zinc-400 ${g.meta}`, children: N })
6483
6447
  ] })
6484
6448
  ] }),
@@ -6560,9 +6524,9 @@ function Is({
6560
6524
  title: m = "Communities",
6561
6525
  activeTab: o = "joined",
6562
6526
  // "joined" | "suggested"
6563
- items: h = Es,
6527
+ items: u = Es,
6564
6528
  // spread for identity (_id/instanceId/etc)
6565
- ...u
6529
+ ...h
6566
6530
  }) {
6567
6531
  const N = de(t), y = me[N], r = Rs[N], v = (d) => `px-1 pb-2 text-sm font-medium ${d === o ? "text-zinc-900 dark:text-zinc-100 border-b-2" : "text-zinc-500 dark:text-zinc-400"}`;
6568
6532
  return /* @__PURE__ */ n(
@@ -6573,8 +6537,8 @@ function Is({
6573
6537
  checkboxPosition: s,
6574
6538
  onSelect: i,
6575
6539
  identity: l,
6576
- details: { type: "communities", title: m, activeTab: o, count: h?.length ?? 0 },
6577
- ...u,
6540
+ details: { type: "communities", title: m, activeTab: o, count: u?.length ?? 0 },
6541
+ ...h,
6578
6542
  children: [
6579
6543
  /* @__PURE__ */ n("div", { className: "flex items-start justify-between", children: [
6580
6544
  /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${y.title}`, children: m }),
@@ -6603,7 +6567,7 @@ function Is({
6603
6567
  }
6604
6568
  )
6605
6569
  ] }),
6606
- /* @__PURE__ */ e("div", { className: "grid gap-4 md:gap-5", children: h.map((d) => /* @__PURE__ */ e(
6570
+ /* @__PURE__ */ e("div", { className: "grid gap-4 md:gap-5", children: u.map((d) => /* @__PURE__ */ e(
6607
6571
  "div",
6608
6572
  {
6609
6573
  className: "rounded-2xl border border-zinc-200 dark:border-zinc-800 p-3 md:p-4",
@@ -6746,9 +6710,9 @@ function Ms({
6746
6710
  title: m = "News",
6747
6711
  items: o = Os,
6748
6712
  // spread for identity fields: _id / id / instanceId etc.
6749
- ...h
6713
+ ...u
6750
6714
  }) {
6751
- const u = de(t), N = me[u], y = Ps[u];
6715
+ const h = de(t), N = me[h], y = Ps[h];
6752
6716
  return /* @__PURE__ */ n(
6753
6717
  oe,
6754
6718
  {
@@ -6758,13 +6722,13 @@ function Ms({
6758
6722
  onSelect: i,
6759
6723
  identity: l,
6760
6724
  details: { type: "news", title: m, count: o?.length ?? 0 },
6761
- ...h,
6725
+ ...u,
6762
6726
  children: [
6763
6727
  /* @__PURE__ */ n("div", { className: "flex items-start justify-between", children: [
6764
6728
  /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${N.title}`, children: m }),
6765
6729
  /* @__PURE__ */ e("span", { className: "text-sm text-indigo-700 cursor-default select-none", children: "View All" })
6766
6730
  ] }),
6767
- u === "lg" ? (
6731
+ h === "lg" ? (
6768
6732
  // Large: 3-up grid of image cards
6769
6733
  /* @__PURE__ */ e("div", { className: `mt-4 ${y.grid}`, children: o.slice(0, 3).map((r) => /* @__PURE__ */ n("article", { children: [
6770
6734
  /* @__PURE__ */ e("img", { src: r.thumb, alt: "", className: y.cardImg }),
@@ -6861,8 +6825,8 @@ function _s({
6861
6825
  identity: l = "_id",
6862
6826
  title: m = "Campus Map",
6863
6827
  campusName: o = "Morningside Heights Campus",
6864
- filters: h = Ls,
6865
- activeFilter: u = "All",
6828
+ filters: u = Ls,
6829
+ activeFilter: h = "All",
6866
6830
  // NEW: iframe controls
6867
6831
  mapQuery: N = "Florida",
6868
6832
  zoom: y = 12,
@@ -6870,18 +6834,18 @@ function _s({
6870
6834
  // optional full embed URL override
6871
6835
  ...v
6872
6836
  }) {
6873
- const d = de(t), g = me[d], D = Bs[d], F = r || js(N, y);
6837
+ const d = de(t), g = me[d], S = Bs[d], F = r || js(N, y);
6874
6838
  return /* @__PURE__ */ e(
6875
6839
  oe,
6876
6840
  {
6877
- className: `flex flex-col ${g.card} ${D.wrap}`,
6841
+ className: `flex flex-col ${g.card} ${S.wrap}`,
6878
6842
  showCheckbox: a,
6879
6843
  checkboxPosition: s,
6880
6844
  onSelect: i,
6881
6845
  identity: l,
6882
- details: { type: "campus-map", title: m, campusName: o, activeFilter: u, mapQuery: N, zoom: y },
6846
+ details: { type: "campus-map", title: m, campusName: o, activeFilter: h, mapQuery: N, zoom: y },
6883
6847
  ...v,
6884
- children: /* @__PURE__ */ n("div", { className: `relative mt-3 overflow-hidden rounded-2xl border border-zinc-200 dark:border-zinc-800 ${D.mapH}`, children: [
6848
+ children: /* @__PURE__ */ n("div", { className: `relative mt-3 overflow-hidden rounded-2xl border border-zinc-200 dark:border-zinc-800 ${S.mapH}`, children: [
6885
6849
  /* @__PURE__ */ e(
6886
6850
  "iframe",
6887
6851
  {
@@ -6895,7 +6859,7 @@ function _s({
6895
6859
  }
6896
6860
  ),
6897
6861
  /* @__PURE__ */ n("div", { className: "absolute left-4 right-4 top-3 flex items-center justify-between pointer-events-none", children: [
6898
- /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 ${D.campusPill}`, children: [
6862
+ /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 ${S.campusPill}`, children: [
6899
6863
  /* @__PURE__ */ e("span", { className: "truncate max-w-[60vw]", children: o }),
6900
6864
  /* @__PURE__ */ e("span", { className: "ml-2 text-zinc-400", children: "▾" })
6901
6865
  ] }),
@@ -6904,8 +6868,8 @@ function _s({
6904
6868
  /* @__PURE__ */ e("div", { className: "h-8 w-8 rounded-full bg-white/90 border border-zinc-300 flex items-center justify-center", children: "›" })
6905
6869
  ] })
6906
6870
  ] }),
6907
- /* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-14 md:top-12 pointer-events-none mt-2", children: /* @__PURE__ */ e("div", { className: `flex ${D.chipGap} overflow-x-auto scrollbar-none`, children: h.map((E) => /* @__PURE__ */ e(Vs, { label: E, active: E === u, size: d }, E)) }) }),
6908
- /* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-28 md:top-24 pointer-events-none", children: /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 px-4 ${D.searchH}`, children: [
6871
+ /* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-14 md:top-12 pointer-events-none mt-2", children: /* @__PURE__ */ e("div", { className: `flex ${S.chipGap} overflow-x-auto scrollbar-none`, children: u.map((E) => /* @__PURE__ */ e(Vs, { label: E, active: E === h, size: d }, E)) }) }),
6872
+ /* @__PURE__ */ e("div", { className: "absolute left-4 right-4 top-28 md:top-24 pointer-events-none", children: /* @__PURE__ */ n("div", { className: `flex items-center rounded-full bg-white dark:bg-zinc-900 shadow border border-zinc-200 dark:border-zinc-700 px-4 ${S.searchH}`, children: [
6909
6873
  /* @__PURE__ */ e("svg", { width: "18", height: "18", viewBox: "0 0 24 24", "aria-hidden": "true", className: "opacity-60", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M15.5 14h-.79l-.28-.27a6.471 6.471 0 001.48-4.23C15.91 6.01 13.4 3.5 10.45 3.5S5 6.01 5 9.5 7.5 15.5 10.45 15.5c1.61 0 3.09-.59 4.23-1.48l.27.28v.79l4.25 4.25c.41.41 1.07.41 1.48 0s.41-1.07 0-1.48L15.5 14Zm-5.05 0C8.01 14 6 11.99 6 9.5S8.01 5 10.45 5s4.45 2.01 4.45 4.5-2.01 4.5-4.45 4.5Z" }) }),
6910
6874
  /* @__PURE__ */ e("span", { className: "ml-2 text-zinc-500 dark:text-zinc-400", children: "Search places" })
6911
6875
  ] }) })
@@ -7073,11 +7037,11 @@ function Ws({
7073
7037
  identity: l = "_id",
7074
7038
  title: m = "Upcoming Events",
7075
7039
  events: o = Us,
7076
- selectedIndex: h = 0,
7077
- ...u
7040
+ selectedIndex: u = 0,
7041
+ ...h
7078
7042
  }) {
7079
- const [N, y] = B(h), r = de(t), v = me[r], d = Gs[r], g = o[N] || o[0], D = (E, I) => {
7080
- y(I), i?.(E);
7043
+ const [N, y] = B(u), r = de(t), v = me[r], d = Gs[r], g = o[N] || o[0], S = (E, R) => {
7044
+ y(R), i?.(E);
7081
7045
  }, F = r === "lg";
7082
7046
  return /* @__PURE__ */ n(
7083
7047
  oe,
@@ -7088,7 +7052,7 @@ function Ws({
7088
7052
  onSelect: i,
7089
7053
  identity: l,
7090
7054
  details: { type: "events", title: m, count: o?.length ?? 0 },
7091
- ...u,
7055
+ ...h,
7092
7056
  children: [
7093
7057
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between mb-4", children: [
7094
7058
  /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${v.title}`, children: m }),
@@ -7097,29 +7061,29 @@ function Ws({
7097
7061
  F ? (
7098
7062
  // Large: Two-column layout
7099
7063
  /* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
7100
- /* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E, I) => /* @__PURE__ */ e(
7064
+ /* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E, R) => /* @__PURE__ */ e(
7101
7065
  _t,
7102
7066
  {
7103
7067
  ev: E,
7104
7068
  sizeMeta: d,
7105
- isSelected: I === N,
7106
- onClick: (P) => D(P, I)
7069
+ isSelected: R === N,
7070
+ onClick: (P) => S(P, R)
7107
7071
  },
7108
- E._id || E.id || I
7072
+ E._id || E.id || R
7109
7073
  )) }),
7110
7074
  /* @__PURE__ */ e(Ys, { ev: g, sizeMeta: d })
7111
7075
  ] })
7112
7076
  ) : (
7113
7077
  // Small/Medium: Simple list only
7114
- /* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E, I) => /* @__PURE__ */ e(
7078
+ /* @__PURE__ */ e("div", { className: "space-y-1", children: o.map((E, R) => /* @__PURE__ */ e(
7115
7079
  _t,
7116
7080
  {
7117
7081
  ev: E,
7118
7082
  sizeMeta: d,
7119
- isSelected: I === N,
7120
- onClick: (P) => D(P, I)
7083
+ isSelected: R === N,
7084
+ onClick: (P) => S(P, R)
7121
7085
  },
7122
- E._id || E.id || I
7086
+ E._id || E.id || R
7123
7087
  )) })
7124
7088
  ),
7125
7089
  !F && /* @__PURE__ */ e("div", { className: "mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-800", children: /* @__PURE__ */ e("button", { className: "w-full text-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 text-sm font-medium transition-colors duration-200", children: "View All" }) })
@@ -7232,10 +7196,10 @@ const Js = [
7232
7196
  }
7233
7197
  };
7234
7198
  function Hs({ email: t, sizeMeta: a, isSelected: s, onClick: i, onStar: l, onPin: m }) {
7235
- const o = (u) => {
7236
- u.stopPropagation(), l?.(t);
7237
- }, h = (u) => {
7238
- u.stopPropagation(), m?.(t);
7199
+ const o = (h) => {
7200
+ h.stopPropagation(), l?.(t);
7201
+ }, u = (h) => {
7202
+ h.stopPropagation(), m?.(t);
7239
7203
  };
7240
7204
  return /* @__PURE__ */ n(
7241
7205
  "div",
@@ -7255,7 +7219,7 @@ function Hs({ email: t, sizeMeta: a, isSelected: s, onClick: i, onStar: l, onPin
7255
7219
  /* @__PURE__ */ e(
7256
7220
  "button",
7257
7221
  {
7258
- onClick: h,
7222
+ onClick: u,
7259
7223
  className: "p-1 rounded hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors duration-200",
7260
7224
  children: t.pinned ? /* @__PURE__ */ e(Ar, { className: "h-4 w-4 fill-blue-500 text-blue-500" }) : /* @__PURE__ */ e(Fr, { className: "h-4 w-4 text-zinc-400 group-hover:text-blue-500" })
7261
7225
  }
@@ -7288,24 +7252,24 @@ function Qs({
7288
7252
  identity: l = "_id",
7289
7253
  title: m = "0365 Mails",
7290
7254
  emails: o = Js,
7291
- selectedIndex: h = 0,
7292
- onStar: u,
7255
+ selectedIndex: u = 0,
7256
+ onStar: h,
7293
7257
  onPin: N,
7294
7258
  ...y
7295
7259
  }) {
7296
- const [r, v] = B(h), d = de(t), g = me[d], D = Xs[d], F = (P, _) => {
7297
- v(_), i?.(P);
7260
+ const [r, v] = B(u), d = de(t), g = me[d], S = Xs[d], F = (P, j) => {
7261
+ v(j), i?.(P);
7298
7262
  }, E = (P) => {
7299
- const _ = { ...P, starred: !P.starred };
7300
- u?.(_);
7301
- }, I = (P) => {
7302
- const _ = { ...P, pinned: !P.pinned };
7303
- N?.(_);
7263
+ const j = { ...P, starred: !P.starred };
7264
+ h?.(j);
7265
+ }, R = (P) => {
7266
+ const j = { ...P, pinned: !P.pinned };
7267
+ N?.(j);
7304
7268
  };
7305
7269
  return /* @__PURE__ */ n(
7306
7270
  oe,
7307
7271
  {
7308
- className: `flex flex-col ${g.card} ${D.wrap}`,
7272
+ className: `flex flex-col ${g.card} ${S.wrap}`,
7309
7273
  showCheckbox: a,
7310
7274
  checkboxPosition: s,
7311
7275
  onSelect: i,
@@ -7315,17 +7279,17 @@ function Qs({
7315
7279
  children: [
7316
7280
  /* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${g.title}`, children: m }) }),
7317
7281
  /* @__PURE__ */ e(ge, { placeholder: "Type to search..." }),
7318
- /* @__PURE__ */ e("div", { className: "space-y-0", children: o.map((P, _) => /* @__PURE__ */ e(
7282
+ /* @__PURE__ */ e("div", { className: "space-y-0", children: o.map((P, j) => /* @__PURE__ */ e(
7319
7283
  Hs,
7320
7284
  {
7321
7285
  email: P,
7322
- sizeMeta: D,
7323
- isSelected: _ === r,
7324
- onClick: (U) => F(U, _),
7286
+ sizeMeta: S,
7287
+ isSelected: j === r,
7288
+ onClick: (U) => F(U, j),
7325
7289
  onStar: E,
7326
- onPin: I
7290
+ onPin: R
7327
7291
  },
7328
- P._id || P.id || _
7292
+ P._id || P.id || j
7329
7293
  )) }),
7330
7294
  /* @__PURE__ */ e("div", { className: "mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-800", children: /* @__PURE__ */ e("button", { className: "w-full text-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 text-sm font-medium transition-colors duration-200", children: "View All" }) })
7331
7295
  ]
@@ -7542,12 +7506,12 @@ function al({
7542
7506
  identity: l = "_id",
7543
7507
  title: m = "Directory",
7544
7508
  contacts: o = Zs,
7545
- selectedIndex: h = 0,
7546
- ...u
7509
+ selectedIndex: u = 0,
7510
+ ...h
7547
7511
  }) {
7548
- const [N, y] = B(h), r = de(t), v = me[r], d = Ks[r], g = (E, I) => {
7549
- y(I), i?.(E);
7550
- }, D = o[N] || o[0], F = d.layout === "split";
7512
+ const [N, y] = B(u), r = de(t), v = me[r], d = Ks[r], g = (E, R) => {
7513
+ y(R), i?.(E);
7514
+ }, S = o[N] || o[0], F = d.layout === "split";
7551
7515
  return /* @__PURE__ */ n(
7552
7516
  oe,
7553
7517
  {
@@ -7557,39 +7521,39 @@ function al({
7557
7521
  onSelect: i,
7558
7522
  identity: l,
7559
7523
  details: { type: "directory", title: m, count: o?.length ?? 0 },
7560
- ...u,
7524
+ ...h,
7561
7525
  children: [
7562
7526
  /* @__PURE__ */ e("div", { className: "flex items-center justify-between mb-4", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${v.title}`, children: m }) }),
7563
7527
  /* @__PURE__ */ e(tl, { sizeMeta: d }),
7564
7528
  F ? /* @__PURE__ */ n("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0", children: [
7565
- /* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E, I) => /* @__PURE__ */ e(
7529
+ /* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E, R) => /* @__PURE__ */ e(
7566
7530
  Ut,
7567
7531
  {
7568
7532
  contact: E,
7569
7533
  sizeMeta: d,
7570
- isSelected: I === N,
7571
- onClick: (P) => g(P, I)
7534
+ isSelected: R === N,
7535
+ onClick: (P) => g(P, R)
7572
7536
  },
7573
- E._id || E.id || I
7537
+ E._id || E.id || R
7574
7538
  )) }),
7575
7539
  /* @__PURE__ */ e(
7576
7540
  el,
7577
7541
  {
7578
- contact: D,
7542
+ contact: S,
7579
7543
  sizeMeta: d
7580
7544
  }
7581
7545
  )
7582
7546
  ] }) : (
7583
7547
  // Single column layout for small screens
7584
- /* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E, I) => /* @__PURE__ */ e(
7548
+ /* @__PURE__ */ e("div", { className: "space-y-3", children: o.map((E, R) => /* @__PURE__ */ e(
7585
7549
  Ut,
7586
7550
  {
7587
7551
  contact: E,
7588
7552
  sizeMeta: d,
7589
- isSelected: I === N,
7590
- onClick: (P) => g(P, I)
7553
+ isSelected: R === N,
7554
+ onClick: (P) => g(P, R)
7591
7555
  },
7592
- E._id || E.id || I
7556
+ E._id || E.id || R
7593
7557
  )) })
7594
7558
  ),
7595
7559
  /* @__PURE__ */ e("div", { className: "mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-800", children: /* @__PURE__ */ e("button", { className: "w-full text-center text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 text-sm font-medium transition-colors duration-200", children: "View All" }) })
@@ -7676,8 +7640,8 @@ function sl({
7676
7640
  // content
7677
7641
  title: m = "Account Summary",
7678
7642
  termLabel: o = "Spring 2024",
7679
- balance: h = 3e3,
7680
- totalCharges: u = 4440,
7643
+ balance: u = 3e3,
7644
+ totalCharges: h = 4440,
7681
7645
  totalPayments: N = 1568,
7682
7646
  transactions: y = [
7683
7647
  {
@@ -7706,7 +7670,7 @@ function sl({
7706
7670
  checkboxPosition: s,
7707
7671
  onSelect: i,
7708
7672
  identity: l,
7709
- details: { type: "account-summary", termLabel: o, balance: h, totalCharges: u, totalPayments: N },
7673
+ details: { type: "account-summary", termLabel: o, balance: u, totalCharges: h, totalPayments: N },
7710
7674
  ...r,
7711
7675
  children: [
7712
7676
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
@@ -7719,11 +7683,11 @@ function sl({
7719
7683
  /* @__PURE__ */ n("div", { className: g.topGrid || g.grid, children: [
7720
7684
  /* @__PURE__ */ n("div", { className: "space-y-4", children: [
7721
7685
  /* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Account Balance" }),
7722
- /* @__PURE__ */ e("div", { className: g.balance, children: Te(h) }),
7686
+ /* @__PURE__ */ e("div", { className: g.balance, children: Te(u) }),
7723
7687
  !g.showTxns && /* @__PURE__ */ n("div", { className: g.totalsRow, children: [
7724
7688
  /* @__PURE__ */ n("div", { children: [
7725
7689
  /* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Charges" }),
7726
- /* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Te(u) })
7690
+ /* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Te(h) })
7727
7691
  ] }),
7728
7692
  /* @__PURE__ */ n("div", { children: [
7729
7693
  /* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Payments" }),
@@ -7735,23 +7699,23 @@ function sl({
7735
7699
  /* @__PURE__ */ n("div", { className: g.totalsRow, children: [
7736
7700
  /* @__PURE__ */ n("div", { children: [
7737
7701
  /* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Charges" }),
7738
- /* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Te(u) })
7702
+ /* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-rose-600", children: Te(h) })
7739
7703
  ] }),
7740
7704
  /* @__PURE__ */ n("div", { children: [
7741
7705
  /* @__PURE__ */ e("div", { className: "text-sm text-zinc-600 dark:text-zinc-400", children: "Total Payments" }),
7742
7706
  /* @__PURE__ */ e("div", { className: "mt-1 font-semibold text-green-600", children: Te(N) })
7743
7707
  ] })
7744
7708
  ] }),
7745
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: y.slice(0, 2).map((D, F) => /* @__PURE__ */ e(
7709
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: y.slice(0, 2).map((S, F) => /* @__PURE__ */ e(
7746
7710
  rl,
7747
7711
  {
7748
7712
  side: F === 0 ? "left" : "right",
7749
- date: D.date,
7750
- title: D.title,
7751
- amount: D.amount,
7752
- kind: D.kind
7713
+ date: S.date,
7714
+ title: S.title,
7715
+ amount: S.amount,
7716
+ kind: S.kind
7753
7717
  },
7754
- D.id || F
7718
+ S.id || F
7755
7719
  )) })
7756
7720
  ] })
7757
7721
  ] }),
@@ -7868,9 +7832,9 @@ function il({
7868
7832
  identity: l = "_id",
7869
7833
  title: m = "Pay Stub and Leave Balance",
7870
7834
  term: o = "Fall 2025",
7871
- ...h
7835
+ ...u
7872
7836
  }) {
7873
- const [u, N] = B("vacation"), [y, r] = B(!1), v = de(t), d = me[v], g = ll[v], D = Ye.find((F) => F.id === u) || Ye[0];
7837
+ const [h, N] = B("vacation"), [y, r] = B(!1), v = de(t), d = me[v], g = ll[v], S = Ye.find((F) => F.id === h) || Ye[0];
7874
7838
  return /* @__PURE__ */ n(
7875
7839
  oe,
7876
7840
  {
@@ -7880,7 +7844,7 @@ function il({
7880
7844
  onSelect: i,
7881
7845
  identity: l,
7882
7846
  details: { type: "leave-balance", title: m },
7883
- ...h,
7847
+ ...u,
7884
7848
  children: [
7885
7849
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
7886
7850
  /* @__PURE__ */ n("div", { children: [
@@ -7909,7 +7873,7 @@ function il({
7909
7873
  g.showTabs && /* @__PURE__ */ e("div", { className: "flex border-b border-zinc-200 dark:border-zinc-800", children: Ye.map((F) => /* @__PURE__ */ e(
7910
7874
  "button",
7911
7875
  {
7912
- className: `flex-1 py-2 px-4 text-center ${g.tab} font-medium border-b-2 transition-colors duration-200 ${u === F.id ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100"}`,
7876
+ className: `flex-1 py-2 px-4 text-center ${g.tab} font-medium border-b-2 transition-colors duration-200 ${h === F.id ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100"}`,
7913
7877
  onClick: () => N(F.id),
7914
7878
  children: F.name.split(" ")[0]
7915
7879
  },
@@ -7920,14 +7884,14 @@ function il({
7920
7884
  Ye.map((F) => /* @__PURE__ */ e(Gt, { leave: F, sizeMeta: g }, F.id))
7921
7885
  ) : g.showSingleLeave ? (
7922
7886
  // MD: Show active tab leave type
7923
- /* @__PURE__ */ e(Gt, { leave: D, sizeMeta: g })
7887
+ /* @__PURE__ */ e(Gt, { leave: S, sizeMeta: g })
7924
7888
  ) : (
7925
7889
  // SM: Show only available hours
7926
7890
  /* @__PURE__ */ e("div", { className: "bg-white dark:bg-zinc-900 rounded-lg border border-zinc-200 dark:border-zinc-800 p-4", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-3 mb-3", children: [
7927
7891
  /* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-blue-600 dark:text-blue-400" }),
7928
7892
  /* @__PURE__ */ n("div", { children: [
7929
7893
  /* @__PURE__ */ e("div", { className: `font-medium text-zinc-900 dark:text-zinc-100 ${g.table}`, children: "Available Leave" }),
7930
- /* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${g.table}`, children: D.available })
7894
+ /* @__PURE__ */ e("div", { className: `text-zinc-600 dark:text-zinc-400 ${g.table}`, children: S.available })
7931
7895
  ] })
7932
7896
  ] }) })
7933
7897
  ) }),
@@ -8059,9 +8023,9 @@ function ml({
8059
8023
  identity: l = "_id",
8060
8024
  title: m = "Drive",
8061
8025
  subtitle: o = "Drive Shared",
8062
- ...h
8026
+ ...u
8063
8027
  }) {
8064
- const [u, N] = B(!1), y = de(t), r = me[y], v = dl[y];
8028
+ const [h, N] = B(!1), y = de(t), r = me[y], v = dl[y];
8065
8029
  return /* @__PURE__ */ n(
8066
8030
  oe,
8067
8031
  {
@@ -8071,7 +8035,7 @@ function ml({
8071
8035
  onSelect: i,
8072
8036
  identity: l,
8073
8037
  details: { type: "drive", title: m },
8074
- ...h,
8038
+ ...u,
8075
8039
  children: [
8076
8040
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
8077
8041
  /* @__PURE__ */ n("div", { children: [
@@ -8083,11 +8047,11 @@ function ml({
8083
8047
  "button",
8084
8048
  {
8085
8049
  className: "flex items-center gap-1 p-2 text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors duration-200",
8086
- onClick: () => N(!u),
8050
+ onClick: () => N(!h),
8087
8051
  children: /* @__PURE__ */ e(Zt, { className: "h-4 w-4" })
8088
8052
  }
8089
8053
  ),
8090
- u && /* @__PURE__ */ n("div", { className: "absolute right-0 top-full mt-1 w-48 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-md shadow-lg z-10 py-1", children: [
8054
+ h && /* @__PURE__ */ n("div", { className: "absolute right-0 top-full mt-1 w-48 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-md shadow-lg z-10 py-1", children: [
8091
8055
  /* @__PURE__ */ n("button", { className: "w-full px-4 py-2 text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-700 text-left flex items-center gap-2", children: [
8092
8056
  /* @__PURE__ */ e(sa, { className: "h-4 w-4" }),
8093
8057
  "Download All"
@@ -8253,7 +8217,7 @@ const ul = [
8253
8217
  }
8254
8218
  };
8255
8219
  function gl({ alert: t, sizeMeta: a, onDismiss: s, onMarkRead: i }) {
8256
- const [l, m] = B(!1), o = $a(t.type), h = pl(t.type);
8220
+ const [l, m] = B(!1), o = $a(t.type), u = pl(t.type);
8257
8221
  return l ? null : /* @__PURE__ */ n("div", { className: `relative rounded-lg border-l-4 p-4 transition-all duration-200 ${o.bg} ${o.border} ${t.read ? "border-l-2 opacity-80" : "border-l-4"}`, style: { borderLeftColor: o.accent }, children: [
8258
8222
  /* @__PURE__ */ e(
8259
8223
  "button",
@@ -8263,7 +8227,7 @@ function gl({ alert: t, sizeMeta: a, onDismiss: s, onMarkRead: i }) {
8263
8227
  }
8264
8228
  ),
8265
8229
  /* @__PURE__ */ n("div", { className: "flex gap-3 pr-6", children: [
8266
- /* @__PURE__ */ e("div", { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ e(h, { className: `h-4 w-4 ${o.icon}` }) }),
8230
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ e(u, { className: `h-4 w-4 ${o.icon}` }) }),
8267
8231
  /* @__PURE__ */ n("div", { className: "flex-grow min-w-0", children: [
8268
8232
  /* @__PURE__ */ e("div", { className: `${a.title} text-zinc-900 dark:text-zinc-100 mb-1 ${t.read ? "font-medium" : "font-semibold"}`, children: Yt(t.title, a.maxTitleWords) }),
8269
8233
  a.showMessage && t.message && /* @__PURE__ */ e("div", { className: `${a.message} text-zinc-600 dark:text-zinc-400 mb-2 leading-relaxed`, children: Yt(t.message, a.maxMessageWords) }),
@@ -8304,12 +8268,12 @@ function fl({
8304
8268
  identity: l = "_id",
8305
8269
  title: m = "Alerts",
8306
8270
  alerts: o = ul,
8307
- showBanner: h = !0,
8308
- ...u
8271
+ showBanner: u = !0,
8272
+ ...h
8309
8273
  }) {
8310
8274
  const [N, y] = B(o), r = de(t), v = me[r], d = hl[r], g = (E) => {
8311
- y((I) => I.filter((P) => P.id !== E.id));
8312
- }, D = N.find((E) => E.type === "banner"), F = N.filter((E) => E.type !== "banner");
8275
+ y((R) => R.filter((P) => P.id !== E.id));
8276
+ }, S = N.find((E) => E.type === "banner"), F = N.filter((E) => E.type !== "banner");
8313
8277
  return /* @__PURE__ */ n(
8314
8278
  oe,
8315
8279
  {
@@ -8319,13 +8283,13 @@ function fl({
8319
8283
  onSelect: i,
8320
8284
  identity: l,
8321
8285
  details: { type: "alerts", title: m, count: N.length },
8322
- ...u,
8286
+ ...h,
8323
8287
  children: [
8324
8288
  /* @__PURE__ */ e("div", { className: "flex items-center justify-between ", children: /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${v.title}`, children: m }) }),
8325
- h && D && t !== "sm" && /* @__PURE__ */ e(
8289
+ u && S && t !== "sm" && /* @__PURE__ */ e(
8326
8290
  bl,
8327
8291
  {
8328
- alert: D,
8292
+ alert: S,
8329
8293
  onDismiss: g
8330
8294
  }
8331
8295
  ),
@@ -8481,9 +8445,9 @@ function Nl({
8481
8445
  identity: l = "_id",
8482
8446
  title: m = "Videos",
8483
8447
  videos: o = yl,
8484
- ...h
8448
+ ...u
8485
8449
  }) {
8486
- const [u, N] = B(!1), y = de(t), r = me[y], v = xl[y];
8450
+ const [h, N] = B(!1), y = de(t), r = me[y], v = xl[y];
8487
8451
  return /* @__PURE__ */ n(
8488
8452
  oe,
8489
8453
  {
@@ -8493,7 +8457,7 @@ function Nl({
8493
8457
  onSelect: i,
8494
8458
  identity: l,
8495
8459
  details: { type: "videos", title: m, count: o.length },
8496
- ...h,
8460
+ ...u,
8497
8461
  children: [
8498
8462
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between ", children: [
8499
8463
  /* @__PURE__ */ e("h3", { className: `font-semibold text-zinc-900 dark:text-zinc-100 ${r.title}`, children: m }),
@@ -8502,14 +8466,14 @@ function Nl({
8502
8466
  "button",
8503
8467
  {
8504
8468
  className: "flex items-center gap-1 px-3 py-1.5 text-sm text-zinc-600 dark:text-zinc-400 hover:text-zinc-900 dark:hover:text-zinc-100 border border-zinc-300 dark:border-zinc-600 rounded-md transition-colors duration-200",
8505
- onClick: () => N(!u),
8469
+ onClick: () => N(!h),
8506
8470
  children: [
8507
8471
  "Filter",
8508
8472
  /* @__PURE__ */ e(xe, { className: "h-4 w-4 transform rotate-90" })
8509
8473
  ]
8510
8474
  }
8511
8475
  ),
8512
- u && /* @__PURE__ */ n("div", { className: "absolute right-0 top-full mt-1 w-48 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-md shadow-lg z-10 py-1", children: [
8476
+ h && /* @__PURE__ */ n("div", { className: "absolute right-0 top-full mt-1 w-48 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-md shadow-lg z-10 py-1", children: [
8513
8477
  /* @__PURE__ */ e("button", { className: "w-full px-4 py-2 text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-700 text-left", children: "All Videos" }),
8514
8478
  /* @__PURE__ */ e("button", { className: "w-full px-4 py-2 text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-700 text-left", children: "Campus Life" }),
8515
8479
  /* @__PURE__ */ e("button", { className: "w-full px-4 py-2 text-sm text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-700 text-left", children: "Academic" }),