unifyedx-storybook-new 0.2.92 → 0.2.94

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,14 +1,14 @@
1
1
  import { jsxs as n, jsx as e, Fragment as re } from "react/jsx-runtime";
2
2
  import ne, { useState as B, useMemo as ae, useId as Ze, Fragment as ee, useEffect as te, useCallback as K, useRef as ge } from "react";
3
- import { a as Z, U as ct, X as Ne, P as c, L as Ra, C as ve, b as tt, D as dt, f as Ct, d as Wt, F as Ia, e as Oa, h as Ma, T as Be, u as Pa, I as Jt, i as Xt, j as La, k as Ba, l as Va, m as Qt, S as yt, n as Ht, M as ja, o as _a, p as xt, q as Ga, A as Ua, E as Zt, r as qa, s as Ya, t as Wa, v as Ja, w as Kt, x as Xa, y as Qa, z as Ha, B as Za, G as Ka, H as er, J as Ve, K as zt, N as St, O as tr, Q as ea, R as ar, V as vt, W as rr, Y as nr, Z as je, _ as sr, $ as lr, a0 as ir, a1 as or, a2 as cr, a3 as dr, a4 as Dt, a5 as mr, a6 as ur, a7 as hr, a8 as pr, a9 as gr, aa as br, ab as fr, ac as yr, ad as Te, ae as ta, af as xr, ag as vr, ah as Nr, ai as wr, aj as kr, ak as aa, al as Cr, am as zr, an as ra, ao as Sr, ap as mt, aq as na, ar as Dr } from "./vendor-DPyu0wpu.js";
3
+ import { c as Z, U as ct, X as Ne, P as c, L as Ra, C as ve, a as tt, D as dt, f as Ct, b as Wt, F as Ia, d as Oa, e as Ma, T as Be, u as Pa, I as Jt, g as Xt, h as La, i as Ba, j as Va, k as Qt, S as yt, l as Ht, M as ja, m as _a, n as xt, o as Ga, A as Ua, E as Zt, p as qa, q as Ya, r as Wa, s as Ja, t as Kt, v as Xa, w as Qa, x as Ha, y as Za, z as Ka, B as er, G as Ve, H as zt, J as St, K as tr, N as ea, O as ar, Q as vt, R as rr, V as nr, W as je, Y as sr, Z as lr, _ as ir, $ as or, a0 as cr, a1 as dr, a2 as Dt, a3 as mr, a4 as ur, a5 as hr, a6 as pr, a7 as gr, a8 as br, a9 as fr, aa as yr, ab as Te, ac as ta, ad as xr, ae as vr, af as Nr, ag as wr, ah as kr, ai as aa, aj as Cr, ak as zr, al as ra, am as Sr, an as mt, ao as na, ap as Dr } from "./vendor-j6TpyJEY.js";
4
4
  import { Popover as $r, PopoverButton as Ar, PopoverPanel as Tr, Transition as fe, Dialog as xe, TransitionChild as ke, DialogPanel as Fe, DialogTitle as at, TabGroup as Fr, TabList as Er, Tab as le, TabPanels as Rr, RadioGroup as qe, Listbox as oe, ListboxButton as Ir, ListboxOptions as Or, ListboxOption as Mr, SwitchGroup as Pr, Switch as it, Menu as Lr, MenuButton as Br, Portal as Vr, MenuItems as jr, MenuItem as _r, DialogBackdrop as Gr } from "@headlessui/react";
5
5
  import { motion as ce, AnimatePresence as De } from "framer-motion";
6
- import { d as Ur } from "./vendor-lodash-C6XpDdXw.js";
6
+ import Ur from "lodash/debounce";
7
7
  import { useFloating as qr, offset as Yr, flip as Wr, shift as Jr, autoUpdate as Xr } from "@floating-ui/react";
8
8
  import ot, { debounce as Qr } from "lodash";
9
9
  import { ToastContainer as Hr, Slide as Zr, toast as Me } from "react-toastify";
10
10
  import "react-toastify/dist/ReactToastify.css";
11
- import { P as Kr, S as en, a as tn, F as an, G as rn, b as nn, E as sn, c as ln, C as on, R as cn, d as dn, e as mn, f as un, g as hn, I as pn, h as $t } from "./vendor-syncfusion-BHkXI8Em.js";
11
+ import { Page as Kr, Selection as en, Sort as tn, Filter as an, Group as rn, Search as nn, ExcelExport as sn, PdfExport as ln, ColumnChooser as on, Resize as cn, Reorder as dn, Print as mn, GridComponent as un, ColumnsDirective as hn, Inject as pn, ColumnDirective as $t } from "@syncfusion/ej2-react-grids";
12
12
  const gn = (t) => {
13
13
  let a = 2166136261;
14
14
  for (let s = 0; s < t.length; s++)
@@ -910,9 +910,9 @@ const vn = {
910
910
  "select",
911
911
  {
912
912
  value: F.operator || "in",
913
- onChange: (D) => T.setFieldValue(`${E}.operator`, D.target.value),
913
+ onChange: (z) => T.setFieldValue(`${E}.operator`, z.target.value),
914
914
  className: "filter-select",
915
- children: U.operators.map((D) => /* @__PURE__ */ e("option", { value: D, children: D === "in" ? "Includes" : "Excludes" }, D))
915
+ children: U.operators.map((z) => /* @__PURE__ */ e("option", { value: z, children: z === "in" ? "Includes" : "Excludes" }, z))
916
916
  }
917
917
  )
918
918
  ] }),
@@ -925,8 +925,8 @@ const vn = {
925
925
  id: `select-all-${E}`,
926
926
  className: "filter-checkbox-input",
927
927
  checked: U.options.length > 0 && m.length === U.options.length,
928
- onChange: (D) => {
929
- const M = D.target.checked ? U.options.map((q) => q.value) : [];
928
+ onChange: (z) => {
929
+ const M = z.target.checked ? U.options.map((q) => q.value) : [];
930
930
  T.setFieldValue(`${E}.values`, M);
931
931
  }
932
932
  }
@@ -940,16 +940,16 @@ const vn = {
940
940
  }
941
941
  )
942
942
  ] }),
943
- U.options.map((D) => /* @__PURE__ */ n("div", { className: "filter-checkbox-item", children: [
943
+ U.options.map((z) => /* @__PURE__ */ n("div", { className: "filter-checkbox-item", children: [
944
944
  /* @__PURE__ */ e(
945
945
  "input",
946
946
  {
947
947
  type: "checkbox",
948
- id: `${E}-${D.value}`,
948
+ id: `${E}-${z.value}`,
949
949
  className: "filter-checkbox-input",
950
- checked: m.includes(D.value),
950
+ checked: m.includes(z.value),
951
951
  onChange: (M) => {
952
- const q = M.target.checked ? [...m, D.value] : m.filter((X) => X !== D.value);
952
+ const q = M.target.checked ? [...m, z.value] : m.filter((X) => X !== z.value);
953
953
  T.setFieldValue(`${E}.values`, q);
954
954
  }
955
955
  }
@@ -957,12 +957,12 @@ const vn = {
957
957
  /* @__PURE__ */ e(
958
958
  "label",
959
959
  {
960
- htmlFor: `${E}-${D.value}`,
960
+ htmlFor: `${E}-${z.value}`,
961
961
  className: "filter-checkbox-label",
962
- children: D.label
962
+ children: z.label
963
963
  }
964
964
  )
965
- ] }, D.value))
965
+ ] }, z.value))
966
966
  ] })
967
967
  ] });
968
968
  case "multiselect-users":
@@ -974,9 +974,9 @@ const vn = {
974
974
  "select",
975
975
  {
976
976
  value: F.operator || "in",
977
- onChange: (D) => T.setFieldValue(`${E}.operator`, D.target.value),
977
+ onChange: (z) => T.setFieldValue(`${E}.operator`, z.target.value),
978
978
  className: "filter-select",
979
- children: U.operators.map((D) => /* @__PURE__ */ e("option", { value: D, children: D === "in" ? "Includes" : "Excludes" }, D))
979
+ children: U.operators.map((z) => /* @__PURE__ */ e("option", { value: z, children: z === "in" ? "Includes" : "Excludes" }, z))
980
980
  }
981
981
  )
982
982
  ] }),
@@ -989,8 +989,8 @@ const vn = {
989
989
  id: `select-all-users-${E}`,
990
990
  className: "filter-checkbox-input",
991
991
  checked: k.length > 0 && m.length === k.length,
992
- onChange: (D) => {
993
- const M = D.target.checked ? k.map((q) => q.email) : [];
992
+ onChange: (z) => {
993
+ const M = z.target.checked ? k.map((q) => q.email) : [];
994
994
  T.setFieldValue(
995
995
  `${E}.values`,
996
996
  M
@@ -1007,16 +1007,16 @@ const vn = {
1007
1007
  }
1008
1008
  )
1009
1009
  ] }),
1010
- k.map((D) => /* @__PURE__ */ n("div", { className: "filter-checkbox-item createdby", children: [
1010
+ k.map((z) => /* @__PURE__ */ n("div", { className: "filter-checkbox-item createdby", children: [
1011
1011
  /* @__PURE__ */ e(
1012
1012
  "input",
1013
1013
  {
1014
1014
  type: "checkbox",
1015
- id: `${E}-${D.email}`,
1015
+ id: `${E}-${z.email}`,
1016
1016
  className: "filter-checkbox-input",
1017
- checked: m.includes(D.email),
1017
+ checked: m.includes(z.email),
1018
1018
  onChange: (M) => {
1019
- const q = M.target.checked ? [...m, D.email] : m.filter((X) => X !== D.email);
1019
+ const q = M.target.checked ? [...m, z.email] : m.filter((X) => X !== z.email);
1020
1020
  T.setFieldValue(
1021
1021
  `${E}.values`,
1022
1022
  q
@@ -1027,19 +1027,19 @@ const vn = {
1027
1027
  /* @__PURE__ */ n(
1028
1028
  "label",
1029
1029
  {
1030
- htmlFor: `${E}-${D.email}`,
1030
+ htmlFor: `${E}-${z.email}`,
1031
1031
  className: "filter-checkbox-label",
1032
1032
  children: [
1033
- /* @__PURE__ */ e("span", { className: "user-label-name", children: D.name }),
1034
- /* @__PURE__ */ e("span", { className: "user-label-email", children: D.email })
1033
+ /* @__PURE__ */ e("span", { className: "user-label-name", children: z.name }),
1034
+ /* @__PURE__ */ e("span", { className: "user-label-email", children: z.email })
1035
1035
  ]
1036
1036
  }
1037
1037
  )
1038
- ] }, D.email))
1038
+ ] }, z.email))
1039
1039
  ] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
1040
1040
  ] });
1041
1041
  case "date":
1042
- const P = F.values || [], [$, p] = P, z = $ && p, I = P[0] || null, w = P[1] || null, S = {
1042
+ const P = F.values || [], [$, p] = P, S = $ && p, I = P[0] || null, w = P[1] || null, D = {
1043
1043
  startDate: I instanceof Date ? I.toISOString().slice(0, 10) : null,
1044
1044
  endDate: I instanceof Date ? I.toISOString().slice(0, 10) : null
1045
1045
  }, y = {
@@ -1053,17 +1053,17 @@ const vn = {
1053
1053
  { key: "this_month", label: "This Month" },
1054
1054
  { key: "last_month", label: "Last Month" },
1055
1055
  { key: "custom", label: "Custom" }
1056
- ], R = (D) => {
1057
- if (D === "anytime") {
1056
+ ], R = (z) => {
1057
+ if (z === "anytime") {
1058
1058
  T.setFieldValue(`${E}.values`, []), T.setFieldValue(`${E}.range`, "anytime");
1059
1059
  return;
1060
1060
  }
1061
- if (D === "custom") {
1061
+ if (z === "custom") {
1062
1062
  T.setFieldValue(`${E}.range`, "custom");
1063
1063
  return;
1064
1064
  }
1065
- const [M, q] = Tn(D);
1066
- T.setFieldValue(`${E}.values`, M && q ? [M, q] : []), T.setFieldValue(`${E}.range`, D);
1065
+ const [M, q] = Tn(z);
1066
+ T.setFieldValue(`${E}.values`, M && q ? [M, q] : []), T.setFieldValue(`${E}.range`, z);
1067
1067
  };
1068
1068
  return /* @__PURE__ */ n("div", { className: "filter-panel-content", children: [
1069
1069
  /* @__PURE__ */ n("div", { className: "filter-operator-group", children: [
@@ -1072,12 +1072,12 @@ const vn = {
1072
1072
  "select",
1073
1073
  {
1074
1074
  value: F.operator,
1075
- onChange: (D) => T.setFieldValue(`${E}.operator`, D.target.value),
1075
+ onChange: (z) => T.setFieldValue(`${E}.operator`, z.target.value),
1076
1076
  className: "filter-select",
1077
- children: U.operators.map((D) => /* @__PURE__ */ e("option", { value: D, children: D === "in" ? "Is" : "Is not" }, D))
1077
+ children: U.operators.map((z) => /* @__PURE__ */ e("option", { value: z, children: z === "in" ? "Is" : "Is not" }, z))
1078
1078
  }
1079
1079
  ),
1080
- z && /* @__PURE__ */ e(
1080
+ S && /* @__PURE__ */ e(
1081
1081
  "button",
1082
1082
  {
1083
1083
  type: "button",
@@ -1092,8 +1092,8 @@ const vn = {
1092
1092
  }
1093
1093
  )
1094
1094
  ] }),
1095
- /* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children: N.map((D) => {
1096
- const M = F.range === D.key || D.key === "anytime" && (!Array.isArray(F.values) || F.values.length === 0);
1095
+ /* @__PURE__ */ e("div", { className: "pb-0", children: /* @__PURE__ */ e("div", { className: "space-y-3", children: N.map((z) => {
1096
+ const M = F.range === z.key || z.key === "anytime" && (!Array.isArray(F.values) || F.values.length === 0);
1097
1097
  return /* @__PURE__ */ n(
1098
1098
  "label",
1099
1099
  {
@@ -1105,15 +1105,15 @@ const vn = {
1105
1105
  type: "radio",
1106
1106
  name: `preset-${E}`,
1107
1107
  checked: M,
1108
- onChange: () => R(D.key),
1108
+ onChange: () => R(z.key),
1109
1109
  className: "h-4 w-4"
1110
1110
  }
1111
1111
  ),
1112
- /* @__PURE__ */ e("span", { className: "text-sm text-[#222]", children: D.label }),
1113
- D.key === "anytime" && M && /* @__PURE__ */ e("span", { className: "ml-2 text-xs bg-yellow-100 text-yellow-800 px-2 py-0.5 rounded", children: "Default" })
1112
+ /* @__PURE__ */ e("span", { className: "text-sm text-[#222]", children: z.label }),
1113
+ z.key === "anytime" && M && /* @__PURE__ */ e("span", { className: "ml-2 text-xs bg-yellow-100 text-yellow-800 px-2 py-0.5 rounded", children: "Default" })
1114
1114
  ]
1115
1115
  },
1116
- D.key
1116
+ z.key
1117
1117
  );
1118
1118
  }) }) }),
1119
1119
  /* @__PURE__ */ n("div", { className: "", children: [
@@ -1125,9 +1125,9 @@ const vn = {
1125
1125
  {
1126
1126
  asSingle: !0,
1127
1127
  useRange: !1,
1128
- value: S,
1129
- onChange: (D) => {
1130
- const M = D?.startDate ? _e(new Date(D.startDate)) : null, q = P[1] || null;
1128
+ value: D,
1129
+ onChange: (z) => {
1130
+ const M = z?.startDate ? _e(new Date(z.startDate)) : null, q = P[1] || null;
1131
1131
  M && (T.setFieldValue(`${E}.values`, [M, q]), T.setFieldValue(`${E}.range`, "custom"));
1132
1132
  },
1133
1133
  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,8 +1150,8 @@ const vn = {
1150
1150
  asSingle: !0,
1151
1151
  useRange: !1,
1152
1152
  value: y,
1153
- onChange: (D) => {
1154
- const M = D?.startDate ? Ge(new Date(D.startDate)) : null, q = P[0] || null;
1153
+ onChange: (z) => {
1154
+ const M = z?.startDate ? Ge(new Date(z.startDate)) : null, q = P[0] || null;
1155
1155
  M && (T.setFieldValue(`${E}.values`, [q, M]), T.setFieldValue(`${E}.range`, "custom"));
1156
1156
  },
1157
1157
  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",
@@ -2694,17 +2694,17 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
2694
2694
  d.filter((y) => C.has(y.id)).forEach((y) => {
2695
2695
  F.find((N) => N.id === y.id) || m({ ...y, permission: V.name });
2696
2696
  }), T(/* @__PURE__ */ new Set()), r("");
2697
- }, z = (y) => {
2697
+ }, S = (y) => {
2698
2698
  _(y), F.forEach(
2699
2699
  (N, R) => L(R, { ...F[R], permission: y.name })
2700
2700
  );
2701
2701
  }, I = async (y) => {
2702
2702
  try {
2703
2703
  if (l === pe.DRIVE) {
2704
- const N = y.pendingInvites.map((D) => ({
2705
- id: D.id,
2706
- permission: D.permission,
2707
- type: D.type.toLowerCase()
2704
+ const N = y.pendingInvites.map((z) => ({
2705
+ id: z.id,
2706
+ permission: z.permission,
2707
+ type: z.type.toLowerCase()
2708
2708
  }));
2709
2709
  o({
2710
2710
  entity: t,
@@ -2724,10 +2724,10 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
2724
2724
  }));
2725
2725
  o(N, i);
2726
2726
  } else if (l === pe.ARTICLE) {
2727
- const N = y.pendingInvites.map((D) => ({
2728
- id: D.id,
2729
- permission: D.permission,
2730
- type: D.type.toLowerCase()
2727
+ const N = y.pendingInvites.map((z) => ({
2728
+ id: z.id,
2729
+ permission: z.permission,
2730
+ type: z.type.toLowerCase()
2731
2731
  }));
2732
2732
  o({
2733
2733
  entity: t,
@@ -2745,7 +2745,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
2745
2745
  }, w = (y) => {
2746
2746
  const N = i[f.code].find((R) => R.name === y.name && R.permission !== "remove") || P.find((R) => R.name === y.name);
2747
2747
  return N ? `${N.permission}` : "";
2748
- }, S = () => {
2748
+ }, D = () => {
2749
2749
  switch (l) {
2750
2750
  case pe.DRIVE:
2751
2751
  return "Share with others";
@@ -2759,7 +2759,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
2759
2759
  };
2760
2760
  return ae(() => (console.log("InviteFlow - isChanged:", h, "pendingInvites.length:", P.length), P.length === 0 && !h), [P.length, h]), /* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-white", children: [
2761
2761
  /* @__PURE__ */ n("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
2762
- /* @__PURE__ */ e(xe.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: S() }),
2762
+ /* @__PURE__ */ e(xe.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: D() }),
2763
2763
  /* @__PURE__ */ n("div", { className: "flex items-center gap-4", children: [
2764
2764
  l === pe.DRIVE && /* @__PURE__ */ n("button", { className: "flex items-center gap-2 text-sm text-blue-600 hover:text-blue-800 font-semibold hover:cursor-pointer", children: [
2765
2765
  /* @__PURE__ */ e(er, { className: "h-5 w-5" }),
@@ -2919,7 +2919,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
2919
2919
  oe,
2920
2920
  {
2921
2921
  value: V,
2922
- onChange: z,
2922
+ onChange: S,
2923
2923
  children: /* @__PURE__ */ n("div", { className: "relative", children: [
2924
2924
  /* @__PURE__ */ n(oe.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
2925
  /* @__PURE__ */ n("span", { className: "flex items-center", children: [
@@ -3361,7 +3361,7 @@ const Ee = qn(), Ke = Ee.axiosGet, Ml = Ee.axiosDelete, ft = Ee.axiosPost, Pl =
3361
3361
  b({ id: F, type: k, name: m }), _(v), g(be.MEMBERS);
3362
3362
  }, E = (F, m = !1) => {
3363
3363
  console.log("changedExistingShares", F), x(F);
3364
- const k = ot.mapValues(t, ($) => $.map((p) => ({ id: p.id, permission: p.permission })).sort((p, z) => p.id - z.id)), L = ot.mapValues(F, ($) => $.map((p) => ({ id: p.id, permission: p.permission })).sort((p, z) => p.id - z.id));
3364
+ const k = ot.mapValues(t, ($) => $.map((p) => ({ id: p.id, permission: p.permission })).sort((p, S) => p.id - S.id)), L = ot.mapValues(F, ($) => $.map((p) => ({ id: p.id, permission: p.permission })).sort((p, S) => p.id - S.id));
3365
3365
  console.log("Existing data:", k), console.log("Changed data:", L);
3366
3366
  const P = !ot.isEqual(k, L);
3367
3367
  console.log("hasPermissionChanged:", P), T(P), P && (console.log("[AddUserGroupsRolesModal] Immediately syncing changes with parent"), s({ pendingInvites: [] }, F)), m && v === be.MANAGE ? console.log("[AddUserGroupsRolesModal] Staying in ManageFlow after removal") : g(v === be.MEMBERS ? V : be.INVITE);
@@ -3565,7 +3565,7 @@ function rt({
3565
3565
  $ ? " text-gray-400 bg-white cursor-not-allowed" : p ? " bg-gray-200 text-gray-900" : " text-gray-900",
3566
3566
  " relative cursor-default select-none py-2 pl-3 pr-9"
3567
3567
  ),
3568
- children: ({ selected: p, active: z }) => /* @__PURE__ */ n(re, { children: [
3568
+ children: ({ selected: p, active: S }) => /* @__PURE__ */ n(re, { children: [
3569
3569
  /* @__PURE__ */ e(
3570
3570
  "span",
3571
3571
  {
@@ -3580,7 +3580,7 @@ function rt({
3580
3580
  "span",
3581
3581
  {
3582
3582
  className: Ye(
3583
- z ? " text-gray-900" : " text-gray-600",
3583
+ S ? " text-gray-900" : " text-gray-600",
3584
3584
  " absolute inset-y-0 right-0 flex items-center pr-4"
3585
3585
  ),
3586
3586
  children: /* @__PURE__ */ e(tt, { className: "w-5 h-5", "aria-hidden": "true" })
@@ -3899,9 +3899,9 @@ function jl({
3899
3899
  { rootId: a, getId: i, getParent: l, getName: u }
3900
3900
  ), [t, a, i, l, u]), [T, A] = B({}), O = K(($) => {
3901
3901
  const p = {};
3902
- return (function z(I) {
3902
+ return (function S(I) {
3903
3903
  I.forEach((w) => {
3904
- p[w.id] = !0, w.children?.length && z(w.children);
3904
+ p[w.id] = !0, w.children?.length && S(w.children);
3905
3905
  });
3906
3906
  })($), p;
3907
3907
  }, []);
@@ -3920,62 +3920,62 @@ function jl({
3920
3920
  F.current = $?.x ?? 0;
3921
3921
  }, L = K(
3922
3922
  ({ active: $, over: p }) => {
3923
- const z = F.current;
3923
+ const S = F.current;
3924
3924
  if (F.current = 0, U(null), !$ || !p) return;
3925
3925
  const I = String($.id).replace(/^drag-/, ""), w = String(p.id).replace(/^drop-/, "");
3926
3926
  if (!I || !w || I === w) return;
3927
- let S = w;
3928
- const y = Math.max(0, Math.floor(-z / b));
3927
+ let D = w;
3928
+ const y = Math.max(0, Math.floor(-S / b));
3929
3929
  if (y > 0) {
3930
3930
  let q = w;
3931
3931
  for (let X = 0; X < y; X++) {
3932
3932
  const Y = xa(_, q, null);
3933
3933
  if (!Y) break;
3934
3934
  if (!Y.parentId) {
3935
- S = a;
3935
+ D = a;
3936
3936
  break;
3937
3937
  }
3938
- S = Y.parentId, q = Y.parentId;
3938
+ D = Y.parentId, q = Y.parentId;
3939
3939
  }
3940
3940
  }
3941
- if (d && S === a) {
3941
+ if (d && D === a) {
3942
3942
  G(Le(C));
3943
3943
  return;
3944
3944
  }
3945
- const N = Le(_), { newRoots: R, removed: D } = cs(N, I);
3946
- if (!D) return;
3947
- const M = ds(R, S, D);
3948
- G(M), r?.({ sourceId: I, destParentId: S, newTree: M });
3945
+ const N = Le(_), { newRoots: R, removed: z } = cs(N, I);
3946
+ if (!z) return;
3947
+ const M = ds(R, D, z);
3948
+ G(M), r?.({ sourceId: I, destParentId: D, newTree: M });
3949
3949
  },
3950
3950
  [_, C, a, d, b, r]
3951
3951
  ), P = K(
3952
- ($, p = 0) => $.map((z) => /* @__PURE__ */ n(ne.Fragment, { children: [
3952
+ ($, p = 0) => $.map((S) => /* @__PURE__ */ n(ne.Fragment, { children: [
3953
3953
  /* @__PURE__ */ e(
3954
3954
  as,
3955
3955
  {
3956
- node: z,
3956
+ node: S,
3957
3957
  depth: p,
3958
- expanded: !!T[z.id],
3959
- onToggle: () => V(z.id),
3958
+ expanded: !!T[S.id],
3959
+ onToggle: () => V(S.id),
3960
3960
  onSelect: o,
3961
3961
  onCreateChild: f,
3962
3962
  onRename: v,
3963
3963
  onDelete: g,
3964
3964
  renderActions: x,
3965
- dragId: `drag-${z.id}`,
3966
- dropId: `drop-${z.id}`,
3965
+ dragId: `drag-${S.id}`,
3966
+ dropId: `drop-${S.id}`,
3967
3967
  indent: b
3968
3968
  }
3969
3969
  ),
3970
- T[z.id] && z.children?.length > 0 ? P(z.children, p + 1) : null
3971
- ] }, z.id)),
3970
+ T[S.id] && S.children?.length > 0 ? P(S.children, p + 1) : null
3971
+ ] }, S.id)),
3972
3972
  [T, b, f, g, v, o, x, V]
3973
3973
  );
3974
3974
  return ne.useMemo(() => {
3975
3975
  if (!E) return null;
3976
3976
  const $ = String(E).replace(/^drag-/, "");
3977
- function p(z) {
3978
- for (const I of z) {
3977
+ function p(S) {
3978
+ for (const I of S) {
3979
3979
  if (I.id === $) return I;
3980
3980
  const w = I.children?.length ? p(I.children) : null;
3981
3981
  if (w) return w;
@@ -4249,7 +4249,7 @@ function ms({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4249
4249
  {
4250
4250
  name: r.key,
4251
4251
  defaultValue: r.default,
4252
- value: o[r.key] || "",
4252
+ value: o[r.key] !== void 0 && o[r.key] !== null ? o[r.key] : r.default !== void 0 ? r.default : "",
4253
4253
  onChange: (d) => {
4254
4254
  const b = { ...o, [r.key]: d };
4255
4255
  h(b);
@@ -4604,8 +4604,8 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4604
4604
  }, []);
4605
4605
  const A = (m) => {
4606
4606
  const k = ($, p) => {
4607
- r((z) => {
4608
- const I = [...z];
4607
+ r((S) => {
4608
+ const I = [...S];
4609
4609
  return I[$][m.key] = p, I;
4610
4610
  });
4611
4611
  }, L = ($) => i[l.key]?.[$]?.[m.key], P = ($) => {
@@ -4619,7 +4619,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4619
4619
  H,
4620
4620
  {
4621
4621
  value: $[m.key] || "",
4622
- onChange: (z) => k(p, z.target.value),
4622
+ onChange: (S) => k(p, S.target.value),
4623
4623
  placeholder: m.placeholder || `Enter ${m.label}`,
4624
4624
  required: m.required,
4625
4625
  className: `w-full ${L(p) ? "border-red-500" : ""}`
@@ -4633,7 +4633,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4633
4633
  da,
4634
4634
  {
4635
4635
  value: $[m.key] || "",
4636
- onChange: (z) => k(p, z.target.value),
4636
+ onChange: (S) => k(p, S.target.value),
4637
4637
  placeholder: m.placeholder || `Enter ${m.label}`,
4638
4638
  required: m.required,
4639
4639
  className: `w-full ${L(p) ? "border-red-500" : ""}`,
@@ -4652,12 +4652,12 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4652
4652
  min: m.min,
4653
4653
  max: m.max,
4654
4654
  step: m.step,
4655
- onChange: (z) => k(p, z.target.value),
4656
- onBlur: (z) => {
4657
- const I = z.target.value;
4655
+ onChange: (S) => k(p, S.target.value),
4656
+ onBlur: (S) => {
4657
+ const I = S.target.value;
4658
4658
  if (I !== "" && I !== null && I !== void 0) {
4659
4659
  const w = Number(I);
4660
- isNaN(w) || (m.min !== void 0 && w < m.min ? (z.target.setCustomValidity(`${m.label} must be at least ${m.min}`), z.target.reportValidity()) : m.max !== void 0 && w > m.max ? (z.target.setCustomValidity(`${m.label} must not exceed ${m.max}`), z.target.reportValidity()) : z.target.setCustomValidity(""));
4660
+ isNaN(w) || (m.min !== void 0 && w < m.min ? (S.target.setCustomValidity(`${m.label} must be at least ${m.min}`), S.target.reportValidity()) : m.max !== void 0 && w > m.max ? (S.target.setCustomValidity(`${m.label} must not exceed ${m.max}`), S.target.reportValidity()) : S.target.setCustomValidity(""));
4661
4661
  }
4662
4662
  },
4663
4663
  placeholder: m.placeholder || `Enter ${m.label}`,
@@ -4682,7 +4682,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4682
4682
  {
4683
4683
  type: "email",
4684
4684
  value: $[m.key] || "",
4685
- onChange: (z) => k(p, z.target.value),
4685
+ onChange: (S) => k(p, S.target.value),
4686
4686
  placeholder: m.placeholder || "Enter email address",
4687
4687
  required: m.required,
4688
4688
  className: `w-full ${L(p) ? "border-red-500" : ""}`
@@ -4697,7 +4697,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4697
4697
  {
4698
4698
  type: "url",
4699
4699
  value: $[m.key] || "",
4700
- onChange: (z) => k(p, z.target.value),
4700
+ onChange: (S) => k(p, S.target.value),
4701
4701
  placeholder: m.placeholder || "Enter URL",
4702
4702
  required: m.required,
4703
4703
  className: `w-full ${L(p) ? "border-red-500" : ""}`
@@ -4712,7 +4712,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4712
4712
  {
4713
4713
  type: "password",
4714
4714
  value: $[m.key] || "",
4715
- onChange: (z) => k(p, z.target.value),
4715
+ onChange: (S) => k(p, S.target.value),
4716
4716
  placeholder: m.placeholder || "Enter password",
4717
4717
  required: m.required,
4718
4718
  className: `w-full ${L(p) ? "border-red-500" : ""}`
@@ -4726,8 +4726,8 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4726
4726
  /* @__PURE__ */ e(
4727
4727
  gt,
4728
4728
  {
4729
- value: $[m.key] || "",
4730
- onChange: (z) => k(p, z),
4729
+ value: $[m.key] !== void 0 && $[m.key] !== null && $[m.key] !== "" ? $[m.key] : m.default || "",
4730
+ onChange: (S) => k(p, S),
4731
4731
  options: m.options || [],
4732
4732
  placeholder: m.placeholder || `Select ${m.label}`,
4733
4733
  required: m.required,
@@ -4738,14 +4738,14 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4738
4738
  ] });
4739
4739
  case "selectDynamic":
4740
4740
  return ($, p) => {
4741
- const z = () => {
4741
+ const S = () => {
4742
4742
  if (m.optionsFrom && a) {
4743
- const { config: I, valueField: w, labelField: S } = m.optionsFrom, y = a[I] || [];
4743
+ const { config: I, valueField: w, labelField: D } = m.optionsFrom, y = a[I] || [];
4744
4744
  if (Array.isArray(y))
4745
4745
  return y.map((N) => ({
4746
4746
  id: N[w] || "",
4747
4747
  value: N[w] || "",
4748
- label: N[S] || ""
4748
+ label: N[D] || ""
4749
4749
  }));
4750
4750
  }
4751
4751
  return m.options || [];
@@ -4757,7 +4757,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4757
4757
  index: p,
4758
4758
  value: $[m.key] || "",
4759
4759
  onChange: (I) => k(p, I),
4760
- options: z(),
4760
+ options: S(),
4761
4761
  placeholder: m.placeholder || `Select ${m.label}`,
4762
4762
  required: m.required,
4763
4763
  className: `w-full ${L(p) ? "border-red-500" : ""}`
@@ -4769,11 +4769,11 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4769
4769
  };
4770
4770
  case "multiselect":
4771
4771
  return ($, p) => {
4772
- const z = $[m.key] || [];
4772
+ const S = $[m.key] || [];
4773
4773
  return /* @__PURE__ */ e(
4774
4774
  rt,
4775
4775
  {
4776
- selectedItems: z,
4776
+ selectedItems: S,
4777
4777
  onSelectionChange: (I) => k(p, I),
4778
4778
  options: m.options || [],
4779
4779
  placeholder: m.placeholder || `Select ${m.label}`,
@@ -4787,7 +4787,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4787
4787
  ut,
4788
4788
  {
4789
4789
  checked: !!$[m.key],
4790
- onChange: (z) => k(p, z),
4790
+ onChange: (S) => k(p, S),
4791
4791
  label: m.placeholder || m.label,
4792
4792
  className: "w-full"
4793
4793
  }
@@ -4798,7 +4798,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4798
4798
  ma,
4799
4799
  {
4800
4800
  isOn: !!$[m.key],
4801
- onToggle: (z) => k(p, z),
4801
+ onToggle: (S) => k(p, S),
4802
4802
  label: m.placeholder || m.label,
4803
4803
  className: "w-full"
4804
4804
  }
@@ -4808,7 +4808,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4808
4808
  la,
4809
4809
  {
4810
4810
  selectedDate: $[m.key] ? new Date($[m.key]) : null,
4811
- onDateChange: (z) => k(p, z ? z.toISOString().split("T")[0] : ""),
4811
+ onDateChange: (S) => k(p, S ? S.toISOString().split("T")[0] : ""),
4812
4812
  placeholder: m.placeholder || "Select date",
4813
4813
  className: "w-full"
4814
4814
  }
@@ -4819,7 +4819,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4819
4819
  {
4820
4820
  type: "datetime-local",
4821
4821
  value: $[m.key] || "",
4822
- onChange: (z) => k(p, z.target.value),
4822
+ onChange: (S) => k(p, S.target.value),
4823
4823
  placeholder: m.placeholder || "Select date and time",
4824
4824
  required: m.required,
4825
4825
  className: "w-full"
@@ -4831,7 +4831,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4831
4831
  {
4832
4832
  type: "time",
4833
4833
  value: $[m.key] || "",
4834
- onChange: (z) => k(p, z.target.value),
4834
+ onChange: (S) => k(p, S.target.value),
4835
4835
  placeholder: m.placeholder || "Select time",
4836
4836
  required: m.required,
4837
4837
  className: "w-full"
@@ -4842,7 +4842,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4842
4842
  ia,
4843
4843
  {
4844
4844
  selectedValue: $[m.key] || "",
4845
- onValueChange: (z) => k(p, z),
4845
+ onValueChange: (S) => k(p, S),
4846
4846
  options: m.options || [],
4847
4847
  className: "w-full"
4848
4848
  }
@@ -4852,27 +4852,27 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4852
4852
  ye,
4853
4853
  {
4854
4854
  value: $[m.key] || "",
4855
- onChange: (z) => k(p, z),
4855
+ onChange: (S) => k(p, S),
4856
4856
  placeholder: m.placeholder || `Search ${m.label}`,
4857
4857
  className: "w-full"
4858
4858
  }
4859
4859
  );
4860
4860
  case "audience":
4861
4861
  return ($, p) => {
4862
- const z = $[m.key] || { users: [], groups: [], roles: [] }, I = [
4863
- ...z.users || [],
4864
- ...z.groups || [],
4865
- ...z.roles || []
4862
+ const S = $[m.key] || { users: [], groups: [], roles: [] }, I = [
4863
+ ...S.users || [],
4864
+ ...S.groups || [],
4865
+ ...S.roles || []
4866
4866
  ];
4867
4867
  return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
4868
- /* @__PURE__ */ e(us, { children: I.length > 0 ? I.slice(0, 3).map((w, S) => /* @__PURE__ */ e(
4868
+ /* @__PURE__ */ e(us, { children: I.length > 0 ? I.slice(0, 3).map((w, D) => /* @__PURE__ */ e(
4869
4869
  we,
4870
4870
  {
4871
4871
  size: "small",
4872
4872
  name: w.name || w.displayName || w.id,
4873
4873
  src: w.avatarUrl
4874
4874
  },
4875
- S
4875
+ D
4876
4876
  )) : null }),
4877
4877
  /* @__PURE__ */ e(
4878
4878
  "button",
@@ -4892,7 +4892,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4892
4892
  {
4893
4893
  type: "color",
4894
4894
  value: $[m.key] || "#000000",
4895
- onChange: (z) => k(p, z.target.value),
4895
+ onChange: (S) => k(p, S.target.value),
4896
4896
  className: "w-full h-10"
4897
4897
  }
4898
4898
  );
@@ -4903,7 +4903,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4903
4903
  {
4904
4904
  type: "range",
4905
4905
  value: $[m.key] || m.min || 0,
4906
- onChange: (z) => k(p, z.target.value),
4906
+ onChange: (S) => k(p, S.target.value),
4907
4907
  min: m.min || 0,
4908
4908
  max: m.max || 100,
4909
4909
  step: m.step || 1,
@@ -4917,8 +4917,8 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4917
4917
  H,
4918
4918
  {
4919
4919
  type: "file",
4920
- onChange: (z) => {
4921
- const I = z.target.files[0];
4920
+ onChange: (S) => {
4921
+ const I = S.target.files[0];
4922
4922
  k(p, I ? I.name : "");
4923
4923
  },
4924
4924
  accept: m.accept,
@@ -4931,7 +4931,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4931
4931
  {
4932
4932
  type: "hidden",
4933
4933
  value: $[m.key] || "",
4934
- onChange: (z) => k(p, z.target.value)
4934
+ onChange: (S) => k(p, S.target.value)
4935
4935
  }
4936
4936
  );
4937
4937
  // Default fallback for unknown field types
@@ -4941,7 +4941,7 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4941
4941
  H,
4942
4942
  {
4943
4943
  value: $[m.key] || "",
4944
- onChange: (z) => k(p, z.target.value),
4944
+ onChange: (S) => k(p, S.target.value),
4945
4945
  placeholder: m.placeholder || `Enter ${m.label}`,
4946
4946
  required: m.required,
4947
4947
  className: `w-full ${L(p) ? "border-red-500" : ""}`
@@ -4984,11 +4984,11 @@ function hs({ item: t, data: a, updateHandler: s, validationErrors: i = {} }) {
4984
4984
  if (o !== null && f && $[o]) {
4985
4985
  const p = m?.pendingInvites || [];
4986
4986
  if (p.length > 0) {
4987
- const z = p.filter((y) => y.type === "User"), I = p.filter((y) => y.type === "Group"), w = p.filter((y) => y.type === "Role"), S = $[o][f] || { users: [], groups: [], roles: [] };
4987
+ const S = p.filter((y) => y.type === "User"), I = p.filter((y) => y.type === "Group"), w = p.filter((y) => y.type === "Role"), D = $[o][f] || { users: [], groups: [], roles: [] };
4988
4988
  $[o][f] = {
4989
- users: [...S.users || [], ...z],
4990
- groups: [...S.groups || [], ...I],
4991
- roles: [...S.roles || [], ...w]
4989
+ users: [...D.users || [], ...S],
4990
+ groups: [...D.groups || [], ...I],
4991
+ roles: [...D.roles || [], ...w]
4992
4992
  };
4993
4993
  } else k && ($[o][f] = {
4994
4994
  users: k.users || [],
@@ -5105,13 +5105,13 @@ function fs({
5105
5105
  const w = (R) => {
5106
5106
  if (R == null || typeof R != "object") return R;
5107
5107
  if (Array.isArray(R)) return R.map(w);
5108
- const D = {};
5108
+ const z = {};
5109
5109
  return Object.keys(R).sort().forEach((M) => {
5110
- D[M] = w(R[M]);
5111
- }), D;
5112
- }, S = w(x), y = w(g), N = JSON.stringify(S) !== JSON.stringify(y);
5110
+ z[M] = w(R[M]);
5111
+ }), z;
5112
+ }, D = w(x), y = w(g), N = JSON.stringify(D) !== JSON.stringify(y);
5113
5113
  return console.log("[DynamicConfig] hasUnsavedChanges:", N, {
5114
- originalData: S,
5114
+ originalData: D,
5115
5115
  currentData: y,
5116
5116
  originalRaw: x,
5117
5117
  currentRaw: g
@@ -5119,10 +5119,10 @@ function fs({
5119
5119
  }, m = (w) => {
5120
5120
  if (!a || !a.configuration)
5121
5121
  return w;
5122
- const S = {}, y = w?.configuration || {};
5122
+ const D = {}, y = w?.configuration || {};
5123
5123
  return a.configuration.forEach((N) => {
5124
5124
  if (N.key && N.type === "datatable") {
5125
- const D = (y[N.key] || []).map((M, q) => {
5125
+ const z = (y[N.key] || []).map((M, q) => {
5126
5126
  const X = { id: M.id || 0 };
5127
5127
  return N.fields && N.fields.forEach((Y) => {
5128
5128
  if (Y.fieldtype === "audience") {
@@ -5135,37 +5135,37 @@ function fs({
5135
5135
  } else Y.fieldtype === "select" ? X[Y.key] = M[Y.key] !== void 0 && M[Y.key] !== "" ? M[Y.key] : Y.default || "" : X[Y.key] = M[Y.key] || Y.default || "";
5136
5136
  }), X;
5137
5137
  });
5138
- if (D.length === 0) {
5138
+ if (z.length === 0) {
5139
5139
  const M = { id: 0 };
5140
5140
  N.fields && N.fields.forEach((q) => {
5141
5141
  q.fieldtype === "audience" ? M[q.key] = { users: [], groups: [], roles: [] } : M[q.key] = q.default || "";
5142
- }), D.push(M);
5142
+ }), z.push(M);
5143
5143
  }
5144
- S[N.key] = D;
5144
+ D[N.key] = z;
5145
5145
  } else if (N.key) {
5146
5146
  const R = y[N.key] || {};
5147
- N.type === "section" && N.fields && N.fields.forEach((D) => {
5148
- D.fieldtype === "managecollectionlist" && D.key && (!R[D.key] || !Array.isArray(R[D.key])) && (R[D.key] = D.initialData || []);
5149
- }), S[N.key] = R;
5147
+ N.type === "section" && N.fields && N.fields.forEach((z) => {
5148
+ z.key && (z.fieldtype === "managecollectionlist" ? (!R[z.key] || !Array.isArray(R[z.key])) && (R[z.key] = z.initialData || []) : (R[z.key] === void 0 || R[z.key] === null) && (R[z.key] = z.default !== void 0 ? z.default : z.value !== void 0 ? z.value : ""));
5149
+ }), D[N.key] = R;
5150
5150
  }
5151
- }), S;
5151
+ }), D;
5152
5152
  }, k = () => {
5153
5153
  if (a && a.configuration) {
5154
5154
  const w = {};
5155
- a.configuration.forEach((S) => {
5156
- if (S.key)
5157
- if (S.type === "datatable") {
5155
+ a.configuration.forEach((D) => {
5156
+ if (D.key)
5157
+ if (D.type === "datatable") {
5158
5158
  const y = { id: 0 };
5159
- S.fields && S.fields.forEach((N) => {
5159
+ D.fields && D.fields.forEach((N) => {
5160
5160
  N.fieldtype === "audience" ? y[N.key] = { users: [], groups: [], roles: [] } : (N.fieldtype, y[N.key] = N.default || "");
5161
- }), w[S.key] = [y];
5162
- } else if (S.type === "section") {
5161
+ }), w[D.key] = [y];
5162
+ } else if (D.type === "section") {
5163
5163
  const y = {};
5164
- S.fields && Array.isArray(S.fields) && S.fields.forEach((N) => {
5164
+ D.fields && Array.isArray(D.fields) && D.fields.forEach((N) => {
5165
5165
  N.key && (N.fieldtype === "managecollectionlist" ? y[N.key] = N.initialData || [] : y[N.key] = N.default || "");
5166
- }), w[S.key] = y;
5166
+ }), w[D.key] = y;
5167
5167
  } else
5168
- w[S.key] = {};
5168
+ w[D.key] = {};
5169
5169
  }), r(w), d(w);
5170
5170
  }
5171
5171
  };
@@ -5177,19 +5177,19 @@ function fs({
5177
5177
  const w = async () => {
5178
5178
  try {
5179
5179
  C(!0);
5180
- let S = await Ke(W);
5181
- if (S) {
5182
- const y = m(S);
5180
+ let D = await Ke(W);
5181
+ if (D) {
5182
+ const y = m(D);
5183
5183
  r(y), d(y);
5184
5184
  } else
5185
5185
  k();
5186
- } catch (S) {
5187
- console.error("Error fetching configuration:", S);
5186
+ } catch (D) {
5187
+ console.error("Error fetching configuration:", D);
5188
5188
  let y = "Failed to load configuration";
5189
- if (S.response) {
5190
- const N = S.response.status, R = S.response.data?.message || S.response.data?.error;
5189
+ if (D.response) {
5190
+ const N = D.response.status, R = D.response.data?.message || D.response.data?.error;
5191
5191
  N === 400 ? y = R || "Invalid request. Please check the application ID." : N === 401 ? y = "You are not authorized to access this configuration." : N === 403 ? y = "Access denied. You don't have permission to view this configuration." : N === 404 ? y = "Configuration not found. It may not exist yet or the application ID is incorrect." : N >= 500 ? y = R || "Server error. Please try again later." : y = R || `Failed to load configuration (Error ${N})`;
5192
- } else S.request ? y = "Network error. Please check your connection and try again." : y = S.message || "An unexpected error occurred while loading configuration.";
5192
+ } else D.request ? y = "Network error. Please check your connection and try again." : y = D.message || "An unexpected error occurred while loading configuration.";
5193
5193
  We.error(y), k();
5194
5194
  } finally {
5195
5195
  C(!1);
@@ -5197,41 +5197,41 @@ function fs({
5197
5197
  };
5198
5198
  a && (v(a), t ? w() : k());
5199
5199
  }, [a, E, t, s]);
5200
- const L = (w, S) => {
5200
+ const L = (w, D) => {
5201
5201
  r((y) => ({
5202
5202
  ...y,
5203
- [w]: S
5203
+ [w]: D
5204
5204
  })), V((y) => {
5205
5205
  const N = { ...y };
5206
5206
  return N[w] && delete N[w], N;
5207
5207
  });
5208
5208
  }, P = () => {
5209
5209
  const w = {};
5210
- return !f || !g || f.configuration.forEach((S) => {
5211
- if (S.type === "section")
5212
- S.fields.forEach((y) => {
5213
- const N = g[S.key]?.[y.key];
5210
+ return !f || !g || f.configuration.forEach((D) => {
5211
+ if (D.type === "section")
5212
+ D.fields.forEach((y) => {
5213
+ const N = g[D.key]?.[y.key];
5214
5214
  if (y.required && (!N || typeof N == "string" && N.trim() === "")) {
5215
- w[S.key] || (w[S.key] = {}), w[S.key][y.key] = `${y.label} is required`;
5215
+ w[D.key] || (w[D.key] = {}), w[D.key][y.key] = `${y.label} is required`;
5216
5216
  return;
5217
5217
  }
5218
5218
  if (y.fieldtype === "number" && N !== "" && N !== null && N !== void 0) {
5219
5219
  const R = Number(N);
5220
- isNaN(R) ? (w[S.key] || (w[S.key] = {}), w[S.key][y.key] = `${y.label} must be a valid number`) : (y.min !== void 0 && R < y.min && (w[S.key] || (w[S.key] = {}), w[S.key][y.key] = `${y.label} must be at least ${y.min}`), y.max !== void 0 && R > y.max && (w[S.key] || (w[S.key] = {}), w[S.key][y.key] = `${y.label} must not exceed ${y.max}`));
5220
+ isNaN(R) ? (w[D.key] || (w[D.key] = {}), w[D.key][y.key] = `${y.label} must be a valid number`) : (y.min !== void 0 && R < y.min && (w[D.key] || (w[D.key] = {}), w[D.key][y.key] = `${y.label} must be at least ${y.min}`), y.max !== void 0 && R > y.max && (w[D.key] || (w[D.key] = {}), w[D.key][y.key] = `${y.label} must not exceed ${y.max}`));
5221
5221
  }
5222
5222
  });
5223
- else if (S.type === "datatable") {
5224
- const y = g[S.key];
5223
+ else if (D.type === "datatable") {
5224
+ const y = g[D.key];
5225
5225
  Array.isArray(y) && y.forEach((N, R) => {
5226
- S.fields.forEach((D) => {
5227
- const M = N[D.key];
5228
- if (D.required && (!M || typeof M == "string" && M.trim() === "")) {
5229
- w[S.key] || (w[S.key] = {}), w[S.key][R] || (w[S.key][R] = {}), w[S.key][R][D.key] = `${D.label} is required`;
5226
+ D.fields.forEach((z) => {
5227
+ const M = N[z.key];
5228
+ if (z.required && (!M || typeof M == "string" && M.trim() === "")) {
5229
+ w[D.key] || (w[D.key] = {}), w[D.key][R] || (w[D.key][R] = {}), w[D.key][R][z.key] = `${z.label} is required`;
5230
5230
  return;
5231
5231
  }
5232
- if (D.fieldtype === "number" && M !== "" && M !== null && M !== void 0) {
5232
+ if (z.fieldtype === "number" && M !== "" && M !== null && M !== void 0) {
5233
5233
  const q = Number(M);
5234
- isNaN(q) ? (w[S.key] || (w[S.key] = {}), w[S.key][R] || (w[S.key][R] = {}), w[S.key][R][D.key] = `${D.label} must be a valid number`) : (D.min !== void 0 && q < D.min && (w[S.key] || (w[S.key] = {}), w[S.key][R] || (w[S.key][R] = {}), w[S.key][R][D.key] = `${D.label} must be at least ${D.min}`), D.max !== void 0 && q > D.max && (w[S.key] || (w[S.key] = {}), w[S.key][R] || (w[S.key][R] = {}), w[S.key][R][D.key] = `${D.label} must not exceed ${D.max}`));
5234
+ isNaN(q) ? (w[D.key] || (w[D.key] = {}), w[D.key][R] || (w[D.key][R] = {}), w[D.key][R][z.key] = `${z.label} must be a valid number`) : (z.min !== void 0 && q < z.min && (w[D.key] || (w[D.key] = {}), w[D.key][R] || (w[D.key][R] = {}), w[D.key][R][z.key] = `${z.label} must be at least ${z.min}`), z.max !== void 0 && q > z.max && (w[D.key] || (w[D.key] = {}), w[D.key][R] || (w[D.key][R] = {}), w[D.key][R][z.key] = `${z.label} must not exceed ${z.max}`));
5235
5235
  }
5236
5236
  });
5237
5237
  });
@@ -5245,8 +5245,8 @@ function fs({
5245
5245
  let y = [];
5246
5246
  Object.keys(w).forEach((N) => {
5247
5247
  typeof w[N] == "object" && Object.keys(w[N]).forEach((R) => {
5248
- typeof w[N][R] == "object" ? Object.keys(w[N][R]).forEach((D) => {
5249
- y.push(`${N} row ${parseInt(R) + 1}: ${w[N][R][D]}`);
5248
+ typeof w[N][R] == "object" ? Object.keys(w[N][R]).forEach((z) => {
5249
+ y.push(`${N} row ${parseInt(R) + 1}: ${w[N][R][z]}`);
5250
5250
  }) : y.push(`${N}: ${w[N][R]}`);
5251
5251
  });
5252
5252
  });
@@ -5257,12 +5257,12 @@ function fs({
5257
5257
  A(!0);
5258
5258
  const y = {};
5259
5259
  g && Object.keys(g).forEach((R) => {
5260
- const D = a?.configuration?.find(
5260
+ const z = a?.configuration?.find(
5261
5261
  (M) => M.key === R && M.type === "datatable"
5262
5262
  );
5263
- D && Array.isArray(g[R]) ? y[R] = g[R].map((M) => {
5263
+ z && Array.isArray(g[R]) ? y[R] = g[R].map((M) => {
5264
5264
  const q = { id: M.id || 0 };
5265
- return D.fields && D.fields.forEach((X) => {
5265
+ return z.fields && z.fields.forEach((X) => {
5266
5266
  if (X.fieldtype === "audience") {
5267
5267
  let Y = { users: [], groups: [], roles: [] };
5268
5268
  M[X.key] && typeof M[X.key] == "object" && !Array.isArray(M[X.key]) && (Y = {
@@ -5288,7 +5288,7 @@ function fs({
5288
5288
  A(!1);
5289
5289
  }
5290
5290
  })();
5291
- }, z = () => {
5291
+ }, S = () => {
5292
5292
  F() ? l ? l() : console.warn("[DynamicConfig] onShowCancelModal not provided, cannot show modal") : u ? u() : window.history.back();
5293
5293
  };
5294
5294
  if (!f?.configuration && !a?.configuration)
@@ -5304,7 +5304,7 @@ function fs({
5304
5304
  style: { padding: "0px 20px 0px 0px" },
5305
5305
  children: [
5306
5306
  b && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(ca, { size: "large" }) }),
5307
- !b && I?.map((w, S) => {
5307
+ !b && I?.map((w, D) => {
5308
5308
  const y = {
5309
5309
  ...w,
5310
5310
  fields: Array.isArray(w.fields) ? w.fields.filter((R) => !R.hidden) : w.fields
@@ -5318,7 +5318,7 @@ function fs({
5318
5318
  updateHandler: L,
5319
5319
  validationErrors: O
5320
5320
  },
5321
- S
5321
+ D
5322
5322
  );
5323
5323
  })
5324
5324
  ]
@@ -5329,7 +5329,7 @@ function fs({
5329
5329
  ie,
5330
5330
  {
5331
5331
  category: "secondary",
5332
- onClick: z,
5332
+ onClick: S,
5333
5333
  label: "Cancel",
5334
5334
  disabled: T,
5335
5335
  type: "button"
@@ -5373,11 +5373,11 @@ const Ul = ({
5373
5373
  placeholder: a,
5374
5374
  disabled: !1
5375
5375
  }, k.some((p) => p.key === "displayname")) {
5376
- const p = k.findIndex((I) => I.key === "displayname"), z = k[p] || {};
5376
+ const p = k.findIndex((I) => I.key === "displayname"), S = k[p] || {};
5377
5377
  k[p] = {
5378
- ...z,
5379
- default: z.default || z.value || a,
5380
- placeholder: z.placeholder || "Enter display name"
5378
+ ...S,
5379
+ default: S.default || S.value || a,
5380
+ placeholder: S.placeholder || "Enter display name"
5381
5381
  };
5382
5382
  } else {
5383
5383
  const p = {
@@ -5567,18 +5567,18 @@ const Ul = ({
5567
5567
  l && (v(p._id), r(p.categoryName || ""));
5568
5568
  }, G = () => {
5569
5569
  if (!i || f !== null) return;
5570
- const z = (x.length > 0 ? Math.max(...x.map((I) => typeof I._id == "number" ? I._id : 0)) : 0) + 1;
5570
+ const S = (x.length > 0 ? Math.max(...x.map((I) => typeof I._id == "number" ? I._id : 0)) : 0) + 1;
5571
5571
  d((I) => [
5572
5572
  ...I,
5573
5573
  {
5574
- _id: z,
5574
+ _id: S,
5575
5575
  categoryName: "",
5576
5576
  links: [],
5577
5577
  order: (I.at(-1)?.order ?? 0) + 1,
5578
5578
  protected: !1,
5579
5579
  _class: "com.unifyed.model.Collection"
5580
5580
  }
5581
- ]), v(z), r("");
5581
+ ]), v(S), r("");
5582
5582
  }, W = () => {
5583
5583
  f != null && (d((p) => {
5584
5584
  const I = !Array.isArray(h) || !h.some((w) => w._id === f) ? p.filter((w) => w._id !== f) : p;
@@ -5586,35 +5586,35 @@ const Ul = ({
5586
5586
  }), v(null), r(""));
5587
5587
  }, J = () => {
5588
5588
  f == null || !g.trim() || (d((p) => {
5589
- const z = p.map((I) => I._id === f ? {
5589
+ const S = p.map((I) => I._id === f ? {
5590
5590
  ...I,
5591
5591
  categoryName: g.trim()
5592
5592
  } : I);
5593
- return a?.(z), z;
5593
+ return a?.(S), S;
5594
5594
  }), v(null), r(""));
5595
5595
  }, E = (p) => {
5596
- u && d((z) => {
5597
- const I = z.filter((w) => w._id !== p._id);
5596
+ u && d((S) => {
5597
+ const I = S.filter((w) => w._id !== p._id);
5598
5598
  return a?.(I), I;
5599
5599
  });
5600
- }, U = (p, z, I) => {
5601
- const w = Number(z), S = Number(I);
5602
- if (!o || w === S) return p;
5603
- const y = p.findIndex((M) => Number(M._id) === w), N = p.findIndex((M) => Number(M._id) === S);
5600
+ }, U = (p, S, I) => {
5601
+ const w = Number(S), D = Number(I);
5602
+ if (!o || w === D) return p;
5603
+ const y = p.findIndex((M) => Number(M._id) === w), N = p.findIndex((M) => Number(M._id) === D);
5604
5604
  if (y === -1 || N === -1) return p;
5605
- const R = [...p], [D] = R.splice(y, 1);
5606
- return R.splice(N, 0, D), R.map((M, q) => ({ ...M, order: q + 1 }));
5607
- }, F = (p, z) => {
5608
- o && (p.dataTransfer.effectAllowed = "move", p.dataTransfer.setData("text/plain", String(z)), C(Number(z)));
5605
+ const R = [...p], [z] = R.splice(y, 1);
5606
+ return R.splice(N, 0, z), R.map((M, q) => ({ ...M, order: q + 1 }));
5607
+ }, F = (p, S) => {
5608
+ o && (p.dataTransfer.effectAllowed = "move", p.dataTransfer.setData("text/plain", String(S)), C(Number(S)));
5609
5609
  }, m = (p) => {
5610
5610
  b && p !== T && A(p);
5611
5611
  }, k = (p) => {
5612
5612
  p.preventDefault();
5613
- }, L = (p, z) => {
5613
+ }, L = (p, S) => {
5614
5614
  p.preventDefault();
5615
- const I = p.dataTransfer.getData("text/plain"), w = I === "0" ? 0 : Number(I), S = z === "0" ? 0 : Number(z);
5616
- w === void 0 || S === void 0 || (d((y) => {
5617
- const N = U(y, w, S);
5615
+ const I = p.dataTransfer.getData("text/plain"), w = I === "0" ? 0 : Number(I), D = S === "0" ? 0 : Number(S);
5616
+ w === void 0 || D === void 0 || (d((y) => {
5617
+ const N = U(y, w, D);
5618
5618
  return a?.(N), N;
5619
5619
  }), C(null), A(null));
5620
5620
  }, P = () => {
@@ -5647,7 +5647,7 @@ const Ul = ({
5647
5647
  )
5648
5648
  ] }) }),
5649
5649
  /* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: $.map((p) => {
5650
- const z = f === p._id, I = p?.links?.length ?? 0, w = b === p._id, S = T === p._id && b !== p._id;
5650
+ const S = f === p._id, I = p?.links?.length ?? 0, w = b === p._id, D = T === p._id && b !== p._id;
5651
5651
  return /* @__PURE__ */ e(
5652
5652
  "div",
5653
5653
  {
@@ -5658,10 +5658,10 @@ const Ul = ({
5658
5658
  className: [
5659
5659
  "flex items-center justify-between p-3 border rounded-2xl mb-3",
5660
5660
  "border-gray-300",
5661
- S ? "ring-2 ring-gray-800/20" : "",
5661
+ D ? "ring-2 ring-gray-800/20" : "",
5662
5662
  w ? "opacity-60" : ""
5663
5663
  ].join(" "),
5664
- children: z ? /* @__PURE__ */ n(re, { children: [
5664
+ children: S ? /* @__PURE__ */ n(re, { children: [
5665
5665
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
5666
5666
  "input",
5667
5667
  {
@@ -5851,19 +5851,19 @@ const Bt = () => {
5851
5851
  searchIconClass: U,
5852
5852
  inputStyle: F
5853
5853
  }) => {
5854
- const m = () => l?.current || i?.current, [k, L] = ne.useState(""), P = (t || "export").toString().trim() || "export", $ = `${W || P}.xlsx`, p = `${J || P}.pdf`, z = (S, y, N) => Math.max(y, Math.min(S, N)), I = K(
5855
- (S) => {
5854
+ const m = () => l?.current || i?.current, [k, L] = ne.useState(""), P = (t || "export").toString().trim() || "export", $ = `${W || P}.xlsx`, p = `${J || P}.pdf`, S = (D, y, N) => Math.max(y, Math.min(D, N)), I = K(
5855
+ (D) => {
5856
5856
  const y = m();
5857
5857
  if (y?.openColumnChooser) {
5858
- if (typeof window > "u" || !S?.currentTarget) {
5858
+ if (typeof window > "u" || !D?.currentTarget) {
5859
5859
  y.openColumnChooser();
5860
5860
  return;
5861
5861
  }
5862
5862
  try {
5863
- const N = S.currentTarget.getBoundingClientRect(), R = N.left + window.scrollX, D = N.bottom + window.scrollY;
5864
- let M = R - 120, q = D - 120;
5863
+ const N = D.currentTarget.getBoundingClientRect(), R = N.left + window.scrollX, z = N.bottom + window.scrollY;
5864
+ let M = R - 120, q = z - 120;
5865
5865
  const X = window.innerWidth, Y = window.innerHeight;
5866
- M = z(M, window.scrollX + 8, window.scrollX + X - 340), q = z(q, window.scrollY, window.scrollY + Y - 120), y.openColumnChooser(M, q);
5866
+ M = S(M, window.scrollX + 8, window.scrollX + X - 340), q = S(q, window.scrollY, window.scrollY + Y - 120), y.openColumnChooser(M, q);
5867
5867
  } catch (N) {
5868
5868
  console.log("coloumn choose error", N);
5869
5869
  }
@@ -5872,10 +5872,10 @@ const Bt = () => {
5872
5872
  []
5873
5873
  // no external deps; reads ref at call time
5874
5874
  ), w = K(
5875
- (S, y) => {
5875
+ (D, y) => {
5876
5876
  const N = m();
5877
5877
  if (N)
5878
- switch (S) {
5878
+ switch (D) {
5879
5879
  case "Delete": {
5880
5880
  if (v) {
5881
5881
  const R = N.getSelectedRecords();
@@ -5917,8 +5917,8 @@ const Bt = () => {
5917
5917
  {
5918
5918
  placeholder: O,
5919
5919
  value: k,
5920
- onDebouncedChange: (S) => {
5921
- L(S), _(S);
5920
+ onDebouncedChange: (D) => {
5921
+ L(D), _(D);
5922
5922
  },
5923
5923
  searchIconSize: E || 16,
5924
5924
  searchIconClass: U || "",
@@ -5940,7 +5940,7 @@ const Bt = () => {
5940
5940
  ze,
5941
5941
  {
5942
5942
  icon: hr,
5943
- onClick: (S) => w("ColumnChooser", S),
5943
+ onClick: (D) => w("ColumnChooser", D),
5944
5944
  ariaLabel: "Column Chooser"
5945
5945
  }
5946
5946
  ),
@@ -6031,7 +6031,7 @@ function Wl(t) {
6031
6031
  pageSettings: m,
6032
6032
  sortSettings: k,
6033
6033
  ...L
6034
- } = U || {}, [P, $] = ne.useState(m?.page || l), [p, z] = ne.useState(m?.pageSize || u), [I, w] = ne.useState(k?.sortKey || "updatedDate"), [S, y] = ne.useState(k?.direction || "Descending"), N = ae(() => {
6034
+ } = U || {}, [P, $] = ne.useState(m?.page || l), [p, S] = ne.useState(m?.pageSize || u), [I, w] = ne.useState(k?.sortKey || "updatedDate"), [D, y] = ne.useState(k?.direction || "Descending"), N = ae(() => {
6035
6035
  const j = A || {
6036
6036
  type: "Multiple",
6037
6037
  mode: "Row"
@@ -6060,7 +6060,7 @@ function Wl(t) {
6060
6060
  g,
6061
6061
  O,
6062
6062
  A
6063
- ]), D = ae(() => {
6063
+ ]), z = ae(() => {
6064
6064
  const j = () => F.current, se = (Q, me) => {
6065
6065
  !me && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${Q} requested but related service/feature is disabled.`);
6066
6066
  };
@@ -6091,8 +6091,8 @@ function Wl(t) {
6091
6091
  };
6092
6092
  }, [C, x, d, b]);
6093
6093
  te(() => {
6094
- E && (E.current = D);
6095
- }, [E, D]), te(() => () => {
6094
+ E && (E.current = z);
6095
+ }, [E, z]), te(() => () => {
6096
6096
  E && (E.current = null);
6097
6097
  }, [E]);
6098
6098
  const M = (j) => {
@@ -6119,7 +6119,7 @@ function Wl(t) {
6119
6119
  }, X = (j) => {
6120
6120
  setTimeout(() => {
6121
6121
  F?.current?.hideSpinner();
6122
- }, 1e3), j.requestType === "paging" && ($(j.currentPage), z(j.pageSize)), j.requestType === "sorting" && (w(j.columnName || "updatedDate"), y(j.direction)), _?.(q(j), j);
6122
+ }, 1e3), j.requestType === "paging" && ($(j.currentPage), S(j.pageSize)), j.requestType === "sorting" && (w(j.columnName || "updatedDate"), y(j.direction)), _?.(q(j), j);
6123
6123
  }, Y = (j) => {
6124
6124
  J?.(j?.rowData, j);
6125
6125
  }, Re = () => {
@@ -6187,9 +6187,9 @@ function Wl(t) {
6187
6187
  pageSizes: m?.pageSizes ?? [10, 20, 40, 60, 80, 100],
6188
6188
  totalCount: s
6189
6189
  }), [P, p, m?.pageSizes, s]), ka = ae(() => k ?? {
6190
- columns: [{ field: I, direction: M(S) }],
6190
+ columns: [{ field: I, direction: M(D) }],
6191
6191
  allowUnsort: !1
6192
- }, [k, I, S]);
6192
+ }, [k, I, D]);
6193
6193
  return /* @__PURE__ */ n(
6194
6194
  un,
6195
6195
  {