react-admin-crud-manager 1.0.24 → 1.0.25

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.
package/dist/index.es.js CHANGED
@@ -1,65 +1,65 @@
1
- import { jsx as e, Fragment as E, jsxs as h } from "react/jsx-runtime";
1
+ import { jsx as e, Fragment as $, jsxs as c } from "react/jsx-runtime";
2
2
  import Oe, { useState as R, useRef as ae, useEffect as z, useMemo as Le } from "react";
3
- import { ChevronDown as Be, Search as Ae, Check as Ve, X as Se, Plus as We, Filter as qe, ChevronLeft as Ze, ChevronRight as Je, EllipsisVertical as Qe, User as Ue, Music as Xe } from "lucide-react";
4
- import { createPortal as ea } from "react-dom";
3
+ import { Info as Ve, ChevronDown as Be, Search as Ae, Check as We, X as Se, Plus as qe, Filter as Ze, ChevronLeft as Je, ChevronRight as Qe, EllipsisVertical as Xe, User as Ue, Music as ea } from "lucide-react";
4
+ import { createPortal as aa } from "react-dom";
5
5
  import { Icon as re } from "@iconify/react";
6
- import { Editor as aa } from "@tinymce/tinymce-react";
7
- import { SnackbarProvider as ta, enqueueSnackbar as Me } from "notistack";
6
+ import { Editor as ta } from "@tinymce/tinymce-react";
7
+ import { SnackbarProvider as ra, enqueueSnackbar as Me } from "notistack";
8
8
  import r from "prop-types";
9
- const je = (u, l = "DD MMM YYYY") => {
10
- if (!u) return "N/A";
11
- const i = new Date(u);
12
- if (isNaN(i)) return "Invalid Date";
13
- const o = (n) => String(n).padStart(2, "0"), d = {
14
- YYYY: i.getFullYear(),
15
- YY: String(i.getFullYear()).slice(-2),
16
- MMMM: i.toLocaleString("en-US", { month: "long" }),
17
- MMM: i.toLocaleString("en-US", { month: "short" }),
18
- MM: o(i.getMonth() + 1),
19
- M: i.getMonth() + 1,
20
- DD: o(i.getDate()),
21
- D: i.getDate(),
22
- dddd: i.toLocaleString("en-US", { weekday: "long" }),
23
- ddd: i.toLocaleString("en-US", { weekday: "short" }),
24
- HH: o(i.getHours()),
25
- hh: o(i.getHours() % 12 || 12),
26
- mm: o(i.getMinutes()),
27
- ss: o(i.getSeconds()),
28
- A: i.getHours() >= 12 ? "PM" : "AM"
9
+ const je = (h, o = "DD MMM YYYY") => {
10
+ if (!h) return "N/A";
11
+ const l = new Date(h);
12
+ if (isNaN(l)) return "Invalid Date";
13
+ const i = (n) => String(n).padStart(2, "0"), s = {
14
+ YYYY: l.getFullYear(),
15
+ YY: String(l.getFullYear()).slice(-2),
16
+ MMMM: l.toLocaleString("en-US", { month: "long" }),
17
+ MMM: l.toLocaleString("en-US", { month: "short" }),
18
+ MM: i(l.getMonth() + 1),
19
+ M: l.getMonth() + 1,
20
+ DD: i(l.getDate()),
21
+ D: l.getDate(),
22
+ dddd: l.toLocaleString("en-US", { weekday: "long" }),
23
+ ddd: l.toLocaleString("en-US", { weekday: "short" }),
24
+ HH: i(l.getHours()),
25
+ hh: i(l.getHours() % 12 || 12),
26
+ mm: i(l.getMinutes()),
27
+ ss: i(l.getSeconds()),
28
+ A: l.getHours() >= 12 ? "PM" : "AM"
29
29
  };
30
- return l.replace(
30
+ return o.replace(
31
31
  /YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|HH|hh|mm|ss|A/g,
32
- (n) => d[n]
32
+ (n) => s[n]
33
33
  );
34
- }, ra = (u, l, i = []) => {
35
- if (!(l != null && l.trim())) return u;
36
- const o = l.toLowerCase(), d = (n) => n == null ? [] : typeof n == "object" ? Object.values(n).flatMap(d) : [String(n)];
37
- return u.filter((n) => {
38
- let b = [];
39
- return i.length > 0 ? i.forEach((S) => {
40
- n[S] !== void 0 && b.push(...d(n[S]));
41
- }) : b = d(n), b.some(
42
- (S) => S.toLowerCase().includes(o)
34
+ }, na = (h, o, l = []) => {
35
+ if (!(o != null && o.trim())) return h;
36
+ const i = o.toLowerCase(), s = (n) => n == null ? [] : typeof n == "object" ? Object.values(n).flatMap(s) : [String(n)];
37
+ return h.filter((n) => {
38
+ let p = [];
39
+ return l.length > 0 ? l.forEach((S) => {
40
+ n[S] !== void 0 && p.push(...s(n[S]));
41
+ }) : p = s(n), p.some(
42
+ (S) => S.toLowerCase().includes(i)
43
43
  );
44
44
  });
45
45
  }, Q = Oe.forwardRef(
46
46
  ({
47
- className: u = "",
48
- variant: l = "contained",
49
- color: i = "default",
50
- size: o = "default",
51
- fullWidth: d = !1,
47
+ className: h = "",
48
+ variant: o = "contained",
49
+ color: l = "default",
50
+ size: i = "default",
51
+ fullWidth: s = !1,
52
52
  children: n,
53
- ...b
53
+ ...p
54
54
  }, S) => {
55
- var s;
56
- const O = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", c = {
55
+ var u;
56
+ const D = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", d = {
57
57
  sm: "h-8 px-3 rounded-md text-sm",
58
58
  md: "h-9 px-4 rounded-md text-sm",
59
59
  lg: "h-11 px-6 rounded-md text-base",
60
60
  xl: "h-12 px-8 rounded-lg text-lg",
61
61
  default: "h-9 px-4 rounded-md text-sm"
62
- }, m = {
62
+ }, f = {
63
63
  primary: {
64
64
  contained: "bg-primary text-white hover:bg-primary-600 focus:ring-primary-500 shadow-sm",
65
65
  outlined: "border border-primary bg-transparent text-primary hover:bg-primary-50 focus:ring-primary-500",
@@ -80,76 +80,90 @@ const je = (u, l = "DD MMM YYYY") => {
80
80
  outlined: "border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-300 dark:border-gray-600 dark:text-gray-200 dark:hover:bg-gray-700 dark:focus:ring-gray-500",
81
81
  text: "bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-300 dark:text-gray-200 dark:hover:bg-gray-700 dark:focus:ring-gray-500"
82
82
  }
83
- }, a = ((s = m[i]) == null ? void 0 : s[l]) || m.default.contained, f = c[o], y = `
84
- ${O}
83
+ }, a = ((u = f[l]) == null ? void 0 : u[o]) || f.default.contained, m = d[i], v = `
84
+ ${D}
85
85
  ${a}
86
- ${f}
87
- ${d ? "w-full" : ""}
88
- ${u}
86
+ ${m}
87
+ ${s ? "w-full" : ""}
88
+ ${h}
89
89
  `.trim();
90
90
  return /* @__PURE__ */ e(
91
91
  "button",
92
92
  {
93
93
  ref: S,
94
- type: b.type || "button",
95
- className: y,
96
- ...b,
94
+ type: p.type || "button",
95
+ className: v,
96
+ ...p,
97
97
  children: n
98
98
  }
99
99
  );
100
100
  }
101
101
  );
102
102
  Q.displayName = "Button";
103
- function Z({ label: u, required: l = !1 }) {
104
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ h("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
105
- u,
106
- l && /* @__PURE__ */ e("span", { className: "ml-1", children: "*" })
103
+ function q({ label: h, required: o = !1, infoText: l = "" }) {
104
+ return /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("label", { className: "flex text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
105
+ h,
106
+ o && /* @__PURE__ */ e("span", { className: "ml-1", children: "*" }),
107
+ l && /* @__PURE__ */ c("span", { className: "ml-2 relative group inline-flex items-center cursor-pointer", children: [
108
+ /* @__PURE__ */ e(Ve, { className: "w-4 h-4 text-gray-500 dark:text-gray-400" }),
109
+ /* @__PURE__ */ e(
110
+ "span",
111
+ {
112
+ className: `absolute left-1/2 top-full mt-2\r
113
+ w-max max-w-xs bg-white text-black dark:bg-black dark:text-white text-xs\r
114
+ rounded px-2 py-1 opacity-0 shadow-lg\r
115
+ group-hover:opacity-100 transition-opacity\r
116
+ duration-200 pointer-events-none z-50`,
117
+ children: l
118
+ }
119
+ )
120
+ ] })
107
121
  ] }) });
108
122
  }
109
- const na = ({
110
- options: u = [],
111
- value: l = "",
112
- defaultValue: i = "",
113
- onChange: o,
114
- placeholder: d = "Select option",
123
+ const la = ({
124
+ options: h = [],
125
+ value: o = "",
126
+ defaultValue: l = "",
127
+ onChange: i,
128
+ placeholder: s = "Select option",
115
129
  className: n = "",
116
- disabled: b = !1,
130
+ disabled: p = !1,
117
131
  search: S = !1,
118
- label: O = "",
119
- required: c = !1,
120
- name: m = "",
132
+ label: D = "",
133
+ required: d = !1,
134
+ name: f = "",
121
135
  parentClass: a = "",
122
- multiple: f = !1,
136
+ multiple: m = !1,
123
137
  // ✅ NEW
124
- dropdownMaxHeight: y = "",
125
- formData: s = {},
126
- dependencyKey: w = ""
138
+ dropdownMaxHeight: v = "",
139
+ formData: u = {},
140
+ dependencyKey: y = ""
127
141
  }) => {
128
142
  var _;
129
- const [x, N] = R(!1), [P, F] = R(""), [M, L] = R(!0), B = ae(null), T = ae(null), [C, j] = R([]);
130
- let G = l || l === !1 ? l : i;
131
- const W = (k) => k == null || k === "" ? "" : String(typeof k == "boolean" ? k : k ?? "");
143
+ const [x, N] = R(!1), [I, P] = R(""), [M, L] = R(!0), B = ae(null), F = ae(null), [C, E] = R([]);
144
+ let G = o || o === !1 ? o : l;
145
+ const Y = (k) => k == null || k === "" ? "" : String(typeof k == "boolean" ? k : k ?? "");
132
146
  z(
133
147
  () => {
134
148
  (async () => {
135
- if (typeof u == "function") {
136
- const U = await u(s);
137
- j(U);
149
+ if (typeof h == "function") {
150
+ const j = await h(u);
151
+ E(j);
138
152
  } else
139
- j(u || []);
153
+ E(h || []);
140
154
  })();
141
155
  },
142
- w ? [u, s == null ? void 0 : s[w]] : [u]
156
+ y ? [h, u == null ? void 0 : u[y]] : [h]
143
157
  );
144
- const $ = f ? (G || []).map(W) : W(G), H = C.filter(
145
- (k) => k.label.toLowerCase().includes(P.toLowerCase())
146
- ), Y = (k) => {
147
- const U = W(k);
148
- return f ? $.includes(U) : U === $;
158
+ const W = m ? (G || []).map(Y) : Y(G), U = C.filter(
159
+ (k) => k.label.toLowerCase().includes(I.toLowerCase())
160
+ ), K = (k) => {
161
+ const j = Y(k);
162
+ return m ? W.includes(j) : j === W;
149
163
  };
150
164
  z(() => {
151
- const k = (U) => {
152
- B.current && !B.current.contains(U.target) && (N(!1), F(""));
165
+ const k = (j) => {
166
+ B.current && !B.current.contains(j.target) && (N(!1), P(""));
153
167
  };
154
168
  return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
155
169
  }, []), z(() => {
@@ -158,49 +172,49 @@ const na = ({
158
172
  L(X < 200);
159
173
  }
160
174
  }, [x]), z(() => {
161
- x && T.current && T.current.focus();
175
+ x && F.current && F.current.focus();
162
176
  }, [x]);
163
- const I = (k) => {
164
- let U = k;
165
- if (k === "true" ? U = !0 : k === "false" && (U = !1), f) {
166
- const X = $.includes(W(k));
177
+ const Z = (k) => {
178
+ let j = k;
179
+ if (k === "true" ? j = !0 : k === "false" && (j = !1), m) {
180
+ const X = W.includes(Y(k));
167
181
  let J;
168
- X ? J = l.filter(
169
- (ee) => W(ee) !== W(k)
170
- ) : J = [...l || [], U], o(J);
182
+ X ? J = o.filter(
183
+ (ee) => Y(ee) !== Y(k)
184
+ ) : J = [...o || [], j], i(J);
171
185
  } else
172
- o(U), N(!1);
173
- F("");
174
- }, K = f ? C.filter((k) => Y(k.value)).map((k) => k.label).join(", ") : (_ = C.find((k) => Y(k.value))) == null ? void 0 : _.label;
186
+ i(j), N(!1);
187
+ P("");
188
+ }, O = m ? C.filter((k) => K(k.value)).map((k) => k.label).join(", ") : (_ = C.find((k) => K(k.value))) == null ? void 0 : _.label;
175
189
  return z(() => {
176
190
  (G || G === !1) && setTimeout(() => {
177
- o(G);
191
+ i(G);
178
192
  }, 100);
179
- }, []), /* @__PURE__ */ h("div", { className: a || "col-span-12", children: [
180
- /* @__PURE__ */ e(Z, { label: O, required: c }),
181
- /* @__PURE__ */ h("div", { className: `relative ${n}`, ref: B, children: [
193
+ }, []), /* @__PURE__ */ c("div", { className: a || "col-span-12", children: [
194
+ /* @__PURE__ */ e(q, { label: D, required: d }),
195
+ /* @__PURE__ */ c("div", { className: `relative ${n}`, ref: B, children: [
182
196
  /* @__PURE__ */ e(
183
197
  "select",
184
198
  {
185
199
  name: "hidden_select_for_validation",
186
- value: K || "",
187
- required: c,
188
- multiple: f,
200
+ value: O || "",
201
+ required: d,
202
+ multiple: m,
189
203
  className: "absolute opacity-0 right-1/2 top-[80%] -translate-x-1/2 -translate-y-1/2 pointer-events-none h-[10px]",
190
- children: /* @__PURE__ */ e("option", { hidden: !0, value: K, children: K })
204
+ children: /* @__PURE__ */ e("option", { hidden: !0, value: O, children: O })
191
205
  }
192
206
  ),
193
- /* @__PURE__ */ h(
207
+ /* @__PURE__ */ c(
194
208
  "button",
195
209
  {
196
210
  type: "button",
197
- onClick: () => !b && N(!x),
198
- disabled: b,
211
+ onClick: () => !p && N(!x),
212
+ disabled: p,
199
213
  className: `w-full h-10 px-3 border border-gray-300 dark:border-gray-600 rounded-md text-left text-sm flex items-center justify-between
200
- ${K ? "dark:text-white" : "text-gray-500 dark:text-gray-400"}
201
- ${b ? "opacity-50 cursor-not-allowed" : "dark:bg-gray-700"}`,
214
+ ${O ? "dark:text-white" : "text-gray-500 dark:text-gray-400"}
215
+ ${p ? "opacity-50 cursor-not-allowed" : "dark:bg-gray-700"}`,
202
216
  children: [
203
- /* @__PURE__ */ e("span", { className: "truncate", children: K || d }),
217
+ /* @__PURE__ */ e("span", { className: "truncate", children: O || s }),
204
218
  /* @__PURE__ */ e(
205
219
  Be,
206
220
  {
@@ -210,21 +224,21 @@ const na = ({
210
224
  ]
211
225
  }
212
226
  ),
213
- x && /* @__PURE__ */ h(
227
+ x && /* @__PURE__ */ c(
214
228
  "div",
215
229
  {
216
230
  className: `absolute z-50 w-full border rounded-md bg-white dark:bg-gray-700 shadow-lg
217
231
  ${M ? "bottom-full mb-1" : "top-full mt-1"}`,
218
232
  children: [
219
- S && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-600", children: /* @__PURE__ */ h("div", { className: "relative", children: [
233
+ S && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-600", children: /* @__PURE__ */ c("div", { className: "relative", children: [
220
234
  /* @__PURE__ */ e(Ae, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400" }),
221
235
  /* @__PURE__ */ e(
222
236
  "input",
223
237
  {
224
- ref: T,
238
+ ref: F,
225
239
  type: "text",
226
- value: P,
227
- onChange: (k) => F(k.target.value),
240
+ value: I,
241
+ onChange: (k) => P(k.target.value),
228
242
  placeholder: "Search...",
229
243
  className: "w-full pl-9 pr-3 py-2 text-sm border rounded-md bg-white dark:bg-gray-800 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none"
230
244
  }
@@ -235,18 +249,18 @@ const na = ({
235
249
  {
236
250
  className: "max-h-40 overflow-y-auto",
237
251
  style: {
238
- maxHeight: y || ""
252
+ maxHeight: v || ""
239
253
  },
240
- children: H.length > 0 ? H.map((k) => /* @__PURE__ */ h(
254
+ children: U.length > 0 ? U.map((k) => /* @__PURE__ */ c(
241
255
  "button",
242
256
  {
243
257
  type: "button",
244
- onClick: () => I(String(k.value)),
258
+ onClick: () => Z(String(k.value)),
245
259
  className: `w-full px-3 py-2 text-left text-sm flex items-center justify-between hover:bg-gray-100 dark:hover:bg-gray-600
246
- ${Y(k.value) ? "bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300" : ""}`,
260
+ ${K(k.value) ? "bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300" : ""}`,
247
261
  children: [
248
262
  /* @__PURE__ */ e("span", { children: k.label }),
249
- f && Y(k.value) && /* @__PURE__ */ e(Ve, { className: "w-4 h-4" })
263
+ m && K(k.value) && /* @__PURE__ */ e(We, { className: "w-4 h-4" })
250
264
  ]
251
265
  },
252
266
  String(k.value)
@@ -257,27 +271,27 @@ const na = ({
257
271
  }
258
272
  )
259
273
  ] })
260
- ] }, m);
261
- }, la = ({
262
- value: u = !0,
263
- onChange: l,
264
- text: i,
265
- options: o = [],
266
- label: d,
274
+ ] }, f);
275
+ }, oa = ({
276
+ value: h = !0,
277
+ onChange: o,
278
+ text: l,
279
+ options: i = [],
280
+ label: s,
267
281
  required: n,
268
- name: b = "",
282
+ name: p = "",
269
283
  disabled: S = !1,
270
- parentClass: O = ""
284
+ parentClass: D = ""
271
285
  }) => {
272
- const c = o.length > 0 ? o : [
286
+ const d = i.length > 0 ? i : [
273
287
  { label: "Active", value: !0 },
274
288
  { label: "Inactive", value: !1 }
275
289
  ];
276
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ h("div", { className: O || "col-span-12", children: [
277
- /* @__PURE__ */ e(Z, { label: d, required: n }),
278
- /* @__PURE__ */ h("div", { className: "flex items-center justify-between h-10 gap-4 bg-gray-100 dark:bg-gray-700 px-3 rounded-md border border-gray-100 dark:border-gray-600", children: [
279
- i && /* @__PURE__ */ e("p", { className: "text-xs text-gray-600 dark:text-gray-400 flex-shrink overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]", children: i }),
280
- /* @__PURE__ */ e("div", { className: "flex items-center gap-6", children: c.map((m, a) => /* @__PURE__ */ h(
290
+ return /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: D || "col-span-12", children: [
291
+ /* @__PURE__ */ e(q, { label: s, required: n }),
292
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between h-10 gap-4 bg-gray-100 dark:bg-gray-700 px-3 rounded-md border border-gray-100 dark:border-gray-600", children: [
293
+ l && /* @__PURE__ */ e("p", { className: "text-xs text-gray-600 dark:text-gray-400 flex-shrink overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]", children: l }),
294
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-6", children: d.map((f, a) => /* @__PURE__ */ c(
281
295
  "label",
282
296
  {
283
297
  className: "flex items-center gap-2 cursor-pointer select-none",
@@ -288,20 +302,20 @@ const na = ({
288
302
  type: "radio",
289
303
  name: "switch-field",
290
304
  required: n && a === 0,
291
- value: m.value,
305
+ value: f.value,
292
306
  disabled: S,
293
- checked: u === m.value,
294
- onChange: () => l(m.value),
307
+ checked: h === f.value,
308
+ onChange: () => o(f.value),
295
309
  className: "w-4 h-4 border-gray-300 cursor-pointer"
296
310
  }
297
311
  ),
298
- /* @__PURE__ */ e("span", { className: "text-sm text-gray-700 dark:text-white", children: m.label })
312
+ /* @__PURE__ */ e("span", { className: "text-sm text-gray-700 dark:text-white", children: f.label })
299
313
  ]
300
314
  },
301
315
  a
302
316
  )) })
303
317
  ] })
304
- ] }, b) });
318
+ ] }, p) });
305
319
  }, ke = [
306
320
  { label: "Afghanistan", code: "AF", phone: "93" },
307
321
  { label: "Aland Islands", code: "AX", phone: "358" },
@@ -554,58 +568,58 @@ const na = ({
554
568
  { label: "Zambia", code: "ZM", phone: "260" },
555
569
  { label: "Zimbabwe", code: "ZW", phone: "263" }
556
570
  ];
557
- function oa({
558
- label: u = "",
559
- value: l = "",
560
- name: i = "",
561
- parentClass: o = "",
562
- onChange: d,
571
+ function ia({
572
+ label: h = "",
573
+ value: o = "",
574
+ name: l = "",
575
+ parentClass: i = "",
576
+ onChange: s,
563
577
  disabled: n = !1,
564
- required: b = !1,
578
+ required: p = !1,
565
579
  placeholder: S = "Phone number",
566
- search: O = !1,
567
- countriesList: c = !1,
568
- defaultCountry: m = ""
580
+ search: D = !1,
581
+ countriesList: d = !1,
582
+ defaultCountry: f = ""
569
583
  }) {
570
- const a = (C) => ke.find((j) => j.code == C), [f, y] = R(
571
- a(m) || ke[0]
572
- ), [s, w] = R(""), [x, N] = R(!1), [P, F] = R(""), M = ae();
584
+ const a = (C) => ke.find((E) => E.code == C), [m, v] = R(
585
+ a(f) || ke[0]
586
+ ), [u, y] = R(""), [x, N] = R(!1), [I, P] = R(""), M = ae();
573
587
  z(() => {
574
- if (typeof l == "string" && l.startsWith("+")) {
575
- const C = ke.filter((j) => l.startsWith("+" + j.phone)).sort((j, G) => G.phone.length - j.phone.length)[0];
588
+ if (typeof o == "string" && o.startsWith("+")) {
589
+ const C = ke.filter((E) => o.startsWith("+" + E.phone)).sort((E, G) => G.phone.length - E.phone.length)[0];
576
590
  if (C) {
577
- y(C), w(l.replace("+" + C.phone, ""));
591
+ v(C), y(o.replace("+" + C.phone, ""));
578
592
  return;
579
593
  }
580
594
  }
581
- w(l);
582
- }, [l]);
595
+ y(o);
596
+ }, [o]);
583
597
  const L = (C) => {
584
- const j = C.target.value.replace(/\D/g, "");
585
- w(j), f && d && d("+" + f.phone + j);
598
+ const E = C.target.value.replace(/\D/g, "");
599
+ y(E), m && s && s("+" + m.phone + E);
586
600
  }, B = (C) => {
587
- y(C), d && d("+" + C.phone + s), N(!1), F("");
601
+ v(C), s && s("+" + C.phone + u), N(!1), P("");
588
602
  };
589
603
  z(() => {
590
- const C = (j) => {
591
- M.current && !M.current.contains(j.target) && N(!1);
604
+ const C = (E) => {
605
+ M.current && !M.current.contains(E.target) && N(!1);
592
606
  };
593
607
  return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
594
608
  }, []);
595
- const T = ke.filter(
596
- (C) => C.label.toLowerCase().includes(P.toLowerCase()) || C.phone.includes(P)
609
+ const F = ke.filter(
610
+ (C) => C.label.toLowerCase().includes(I.toLowerCase()) || C.phone.includes(I)
597
611
  );
598
- return c ? /* @__PURE__ */ e(E, { children: /* @__PURE__ */ h("div", { className: o || "col-span-12", children: [
599
- /* @__PURE__ */ e(Z, { label: u, required: b }),
600
- /* @__PURE__ */ h("div", { className: "relative ", ref: M, children: [
601
- /* @__PURE__ */ h(
612
+ return d ? /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: i || "col-span-12", children: [
613
+ /* @__PURE__ */ e(q, { label: h, required: p }),
614
+ /* @__PURE__ */ c("div", { className: "relative ", ref: M, children: [
615
+ /* @__PURE__ */ c(
602
616
  "div",
603
617
  {
604
618
  className: `h-[40px] flex items-center border rounded-md px-2 bg-white dark:bg-gray-700 transition-all
605
619
  ${x ? "ring-0.5 ring-blue-100 border-blue-300" : "border-gray-300 dark:border-gray-600"}
606
620
  ${n ? "opacity-60 cursor-not-allowed" : ""}`,
607
621
  children: [
608
- /* @__PURE__ */ h(
622
+ /* @__PURE__ */ c(
609
623
  "button",
610
624
  {
611
625
  type: "button",
@@ -613,11 +627,11 @@ function oa({
613
627
  onClick: () => N(!x),
614
628
  className: "flex items-center gap-1 pr-2 border-r border-gray-300 dark:border-gray-700 focus:outline-none",
615
629
  children: [
616
- f ? /* @__PURE__ */ e(
630
+ m ? /* @__PURE__ */ e(
617
631
  "img",
618
632
  {
619
- src: `https://flagcdn.com/w20/${f.code.toLowerCase()}.png`,
620
- alt: f.code,
633
+ src: `https://flagcdn.com/w20/${m.code.toLowerCase()}.png`,
634
+ alt: m.code,
621
635
  className: "w-5 h-3 object-cover"
622
636
  }
623
637
  ) : /* @__PURE__ */ e("span", { className: "text-gray-400 text-xs", children: "🌐" }),
@@ -625,19 +639,19 @@ function oa({
625
639
  ]
626
640
  }
627
641
  ),
628
- f && /* @__PURE__ */ h("span", { className: "ml-2 text-sm text-gray-700 dark:text-gray-200 whitespace-nowrap", children: [
642
+ m && /* @__PURE__ */ c("span", { className: "ml-2 text-sm text-gray-700 dark:text-gray-200 whitespace-nowrap", children: [
629
643
  "+",
630
- f.phone
644
+ m.phone
631
645
  ] }),
632
646
  /* @__PURE__ */ e(
633
647
  "input",
634
648
  {
635
649
  type: "tel",
636
- value: s,
650
+ value: u,
637
651
  onChange: L,
638
- required: b,
639
- disabled: n || !f,
640
- placeholder: f ? S : "Select a country",
652
+ required: p,
653
+ disabled: n || !m,
654
+ placeholder: m ? S : "Select a country",
641
655
  className: "flex-1 ml-2 bg-transparent outline-none text-sm text-gray-800 dark:text-gray-100 placeholder-gray-400"
642
656
  }
643
657
  ),
@@ -645,10 +659,10 @@ function oa({
645
659
  "input",
646
660
  {
647
661
  type: "tel",
648
- required: b,
662
+ required: p,
649
663
  tabIndex: -1,
650
664
  readOnly: !0,
651
- value: f && s ? "+" + f.phone + s : "",
665
+ value: m && u ? "+" + m.phone + u : "",
652
666
  style: {
653
667
  position: "absolute",
654
668
  opacity: 0,
@@ -660,21 +674,21 @@ function oa({
660
674
  ]
661
675
  }
662
676
  ),
663
- x && /* @__PURE__ */ h("div", { className: "absolute top-full left-0 w-full mt-1 border border-gray-300 dark:border-gray-700 rounded-md bg-white dark:bg-gray-700 shadow-lg z-50 max-h-60 overflow-y-auto", children: [
664
- O && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ h("div", { className: "relative", children: [
677
+ x && /* @__PURE__ */ c("div", { className: "absolute top-full left-0 w-full mt-1 border border-gray-300 dark:border-gray-700 rounded-md bg-white dark:bg-gray-700 shadow-lg z-50 max-h-60 overflow-y-auto", children: [
678
+ D && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ c("div", { className: "relative", children: [
665
679
  /* @__PURE__ */ e(Ae, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400" }),
666
680
  /* @__PURE__ */ e(
667
681
  "input",
668
682
  {
669
683
  type: "text",
670
- value: P,
671
- onChange: (C) => F(C.target.value),
684
+ value: I,
685
+ onChange: (C) => P(C.target.value),
672
686
  placeholder: "Search country...",
673
687
  className: "w-full pl-9 pr-3 py-2 text-sm border rounded-md bg-white dark:bg-gray-800 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none "
674
688
  }
675
689
  )
676
690
  ] }) }),
677
- T.map((C) => /* @__PURE__ */ h(
691
+ F.map((C) => /* @__PURE__ */ c(
678
692
  "button",
679
693
  {
680
694
  type: "button",
@@ -689,7 +703,7 @@ function oa({
689
703
  className: "w-5 h-3 object-cover"
690
704
  }
691
705
  ),
692
- /* @__PURE__ */ h("span", { children: [
706
+ /* @__PURE__ */ c("span", { children: [
693
707
  C.label,
694
708
  " (+",
695
709
  C.phone,
@@ -701,20 +715,20 @@ function oa({
701
715
  ))
702
716
  ] })
703
717
  ] })
704
- ] }, i) }) : /* @__PURE__ */ e(E, { children: /* @__PURE__ */ h("div", { className: o || "col-span-12", children: [
705
- /* @__PURE__ */ e(Z, { label: u, required: b }),
718
+ ] }, l) }) : /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: i || "col-span-12", children: [
719
+ /* @__PURE__ */ e(q, { label: h, required: p }),
706
720
  /* @__PURE__ */ e(
707
721
  "input",
708
722
  {
709
723
  type: "text",
710
- value: l,
711
- onChange: (j) => {
712
- const G = j.target.value.replace(/[^+\d]/g, ""), W = G.startsWith("+") ? "+" + G.replace(/[+]/g, "").slice(0) : G;
713
- d(W);
724
+ value: o,
725
+ onChange: (E) => {
726
+ const G = E.target.value.replace(/[^+\d]/g, ""), Y = G.startsWith("+") ? "+" + G.replace(/[+]/g, "").slice(0) : G;
727
+ s(Y);
714
728
  },
715
729
  placeholder: S,
716
730
  disabled: n,
717
- required: b,
731
+ required: p,
718
732
  className: `w-full h-10 px-3 text-sm border border-gray-300 dark:border-gray-600 rounded-md \r
719
733
  bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:outline-none \r
720
734
  focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-200`,
@@ -722,103 +736,103 @@ function oa({
722
736
  pattern: "^\\+\\d{1,15}$"
723
737
  }
724
738
  )
725
- ] }, i) });
739
+ ] }, l) });
726
740
  }
727
741
  const Ee = Oe.forwardRef(
728
- ({ className: u = "", label: l, required: i, ...o }, d) => {
742
+ ({ className: h = "", label: o, required: l, ...i }, s) => {
729
743
  const n = `
730
744
  placeholder-gray-400 dark:placeholder-gray-400
731
- ${u}
745
+ ${h}
732
746
  `.trim();
733
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ h("div", { className: o.parentClass || "col-span-12", children: [
734
- /* @__PURE__ */ e(Z, { label: l, required: i }),
747
+ return /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: i.parentClass || "col-span-12", children: [
748
+ /* @__PURE__ */ e(q, { label: o, required: l }),
735
749
  /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
736
750
  "textarea",
737
751
  {
738
752
  className: n,
739
- ref: d,
740
- required: i,
741
- ...o
753
+ ref: s,
754
+ required: l,
755
+ ...i
742
756
  }
743
757
  ) })
744
- ] }, o.name) });
758
+ ] }, i.name) });
745
759
  }
746
760
  );
747
761
  Ee.displayName = "TextArea";
748
- const ia = ({
749
- label: u = "",
750
- value: l = null,
751
- onChange: i,
752
- required: o = !1,
753
- accept: d = "image/*",
762
+ const sa = ({
763
+ label: h = "",
764
+ value: o = null,
765
+ onChange: l,
766
+ required: i = !1,
767
+ accept: s = "image/*",
754
768
  id: n,
755
- dragDrop: b = !1,
769
+ dragDrop: p = !1,
756
770
  name: S = "",
757
- parentClass: O = ""
771
+ parentClass: D = ""
758
772
  }) => {
759
- const [c, m] = R(l), [a, f] = R(!1), y = ae(null);
760
- z(() => (l instanceof File ? m({ file: l, preview: URL.createObjectURL(l) }) : (l != null && l.preview, m(l)), () => {
761
- c != null && c.preview && c.preview.startsWith("blob:") && URL.revokeObjectURL(c.preview);
762
- }), [l]);
763
- const s = (M) => {
773
+ const [d, f] = R(o), [a, m] = R(!1), v = ae(null);
774
+ z(() => (o instanceof File ? f({ file: o, preview: URL.createObjectURL(o) }) : (o != null && o.preview, f(o)), () => {
775
+ d != null && d.preview && d.preview.startsWith("blob:") && URL.revokeObjectURL(d.preview);
776
+ }), [o]);
777
+ const u = (M) => {
764
778
  if (!M || M.length === 0)
765
779
  return;
766
- const L = M[0], B = URL.createObjectURL(L), T = { file: L, preview: B };
767
- c != null && c.preview && c.preview.startsWith("blob:") && URL.revokeObjectURL(c.preview), m(T), i == null || i(L);
768
- }, w = (M) => {
769
- M && M.stopPropagation(), c != null && c.preview && c.preview.startsWith("blob:") && URL.revokeObjectURL(c.preview), m(null), i == null || i(null), y.current && (y.current.value = "");
780
+ const L = M[0], B = URL.createObjectURL(L), F = { file: L, preview: B };
781
+ d != null && d.preview && d.preview.startsWith("blob:") && URL.revokeObjectURL(d.preview), f(F), l == null || l(L);
782
+ }, y = (M) => {
783
+ M && M.stopPropagation(), d != null && d.preview && d.preview.startsWith("blob:") && URL.revokeObjectURL(d.preview), f(null), l == null || l(null), v.current && (v.current.value = "");
770
784
  }, x = (M) => {
771
- b && (M.preventDefault(), f(!0));
785
+ p && (M.preventDefault(), m(!0));
772
786
  }, N = (M) => {
773
- b && (M.preventDefault(), f(!1));
774
- }, P = (M) => {
775
- b && (M.preventDefault(), f(!1), s(M.dataTransfer.files));
776
- }, F = () => {
777
- y.current.click();
787
+ p && (M.preventDefault(), m(!1));
788
+ }, I = (M) => {
789
+ p && (M.preventDefault(), m(!1), u(M.dataTransfer.files));
790
+ }, P = () => {
791
+ v.current.click();
778
792
  };
779
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ h("div", { className: O || "col-span-12", children: [
780
- /* @__PURE__ */ e(Z, { label: u, required: o }),
781
- /* @__PURE__ */ h(
793
+ return /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: D || "col-span-12", children: [
794
+ /* @__PURE__ */ e(q, { label: h, required: i }),
795
+ /* @__PURE__ */ c(
782
796
  "div",
783
797
  {
784
798
  className: `relative rounded-md p-2 transition-all ${a ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
785
799
  onDragOver: x,
786
800
  onDragLeave: N,
787
- onDrop: P,
801
+ onDrop: I,
788
802
  children: [
789
803
  /* @__PURE__ */ e(
790
804
  "input",
791
805
  {
792
- ref: y,
806
+ ref: v,
793
807
  id: n,
794
808
  type: "file",
795
- accept: d,
796
- onChange: (M) => s(M.target.files),
797
- required: o && !c,
809
+ accept: s,
810
+ onChange: (M) => u(M.target.files),
811
+ required: i && !d,
798
812
  className: "absolute opacity-0 right-[50%] top-[80%] -translate-y-1/2 pointer-events-none h-[10px]"
799
813
  }
800
814
  ),
801
- /* @__PURE__ */ h(
815
+ /* @__PURE__ */ c(
802
816
  "div",
803
817
  {
804
818
  className: `flex items-center space-x-4 transition-all ${a ? "opacity-50" : ""}`,
805
819
  children: [
806
- c ? (
820
+ d ? (
807
821
  // Image preview with close button
808
- /* @__PURE__ */ h("div", { className: "relative group", children: [
822
+ /* @__PURE__ */ c("div", { className: "relative group", children: [
809
823
  /* @__PURE__ */ e(
810
824
  "img",
811
825
  {
812
- src: c.preview || c,
826
+ src: d.preview || d,
813
827
  alt: "preview",
814
828
  className: "object-cover w-20 h-20 rounded-full shadow-md"
815
829
  }
816
830
  ),
817
- !o && /* @__PURE__ */ e(
831
+ !i && /* @__PURE__ */ e(
818
832
  "button",
819
833
  {
820
834
  type: "button",
821
- onClick: w,
835
+ onClick: y,
822
836
  className: "absolute top-0 -right-2 bg-red-500 text-white rounded-full p-1 shadow-lg hover:bg-red-600 transition-colors focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2",
823
837
  "aria-label": "Remove image",
824
838
  children: /* @__PURE__ */ e(re, { icon: "mdi:close", className: "w-3 h-3" })
@@ -835,135 +849,143 @@ const ia = ({
835
849
  }
836
850
  ) })
837
851
  ),
838
- /* @__PURE__ */ h("div", { className: "flex flex-col items-center space-y-1", children: [
852
+ /* @__PURE__ */ c("div", { className: "flex flex-col items-center space-y-1", children: [
839
853
  /* @__PURE__ */ e(
840
854
  Q,
841
855
  {
842
856
  type: "button",
843
- onClick: F,
857
+ onClick: P,
844
858
  variant: "outlined",
845
859
  color: "default",
846
- children: c ? "Change Image" : "Select Image"
860
+ children: d ? "Change Image" : "Select Image"
847
861
  }
848
862
  ),
849
- b && !c && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop" })
863
+ p && !d && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop" })
850
864
  ] })
851
865
  ]
852
866
  }
853
867
  ),
854
- b && a && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-md", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg", children: "Drop image here" }) })
868
+ p && a && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-md", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg", children: "Drop image here" }) })
855
869
  ]
856
870
  }
857
871
  )
858
872
  ] }, S) });
859
873
  }, $e = Oe.forwardRef(
860
874
  ({
861
- label: u,
862
- required: l,
863
- parentClass: i = "",
864
- className: o = "",
865
- type: d = "text",
875
+ label: h,
876
+ required: o,
877
+ parentClass: l = "",
878
+ className: i = "",
879
+ type: s = "text",
866
880
  onKeyDown: n,
867
- negativeNumberAllow: b = !0,
881
+ negativeNumberAllow: p = !0,
868
882
  defaultValue: S = "",
869
- ...O
870
- }, c) => {
871
- const [m, a] = R(!1), f = (s) => {
872
- if (d === "number") {
873
- if (["e", "E", "+"].includes(s.key)) {
874
- s.preventDefault();
883
+ field: D = {},
884
+ ...d
885
+ }, f) => {
886
+ const [a, m] = R(!1), v = (y) => {
887
+ if (s === "number") {
888
+ if (["e", "E", "+"].includes(y.key)) {
889
+ y.preventDefault();
875
890
  return;
876
891
  }
877
- if (b == !1 && s.key === "-") {
878
- s.preventDefault();
892
+ if (p == !1 && y.key === "-") {
893
+ y.preventDefault();
879
894
  return;
880
895
  }
881
- if (["ArrowUp", "ArrowDown"].includes(s.key)) {
882
- s.preventDefault();
896
+ if (["ArrowUp", "ArrowDown"].includes(y.key)) {
897
+ y.preventDefault();
883
898
  return;
884
899
  }
885
900
  }
886
- n == null || n(s);
887
- }, y = `
901
+ n == null || n(y);
902
+ }, u = `
888
903
  h-10 placeholder-gray-400 dark:placeholder-gray-400
889
- ${d === "password" ? "pr-10" : ""}
890
- ${d === "number" ? "no-spinner" : ""}
891
- ${o}
904
+ ${s === "password" ? "pr-10" : ""}
905
+ ${s === "number" ? "no-spinner" : ""}
906
+ ${i}
892
907
  `.trim();
893
908
  return z(() => {
894
909
  if (S) {
895
- let s = O.value || S;
910
+ let y = d.value || S;
896
911
  setTimeout(() => {
897
- var w;
898
- (w = O.onChange) == null || w.call(O, { target: { value: s } });
912
+ var x;
913
+ (x = d.onChange) == null || x.call(d, { target: { value: y } });
899
914
  }, 100);
900
915
  }
901
- }, [S]), /* @__PURE__ */ e(E, { children: /* @__PURE__ */ h("div", { className: i || "col-span-12", children: [
902
- /* @__PURE__ */ e(Z, { label: u, required: l }),
903
- /* @__PURE__ */ h("div", { className: "relative", children: [
916
+ }, [S]), /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: l || "col-span-12", children: [
917
+ /* @__PURE__ */ e(
918
+ q,
919
+ {
920
+ label: h,
921
+ required: o,
922
+ infoText: D.infoText
923
+ }
924
+ ),
925
+ /* @__PURE__ */ c("div", { className: "relative", children: [
904
926
  /* @__PURE__ */ e(
905
927
  "input",
906
928
  {
907
- type: d === "password" && m ? "text" : d,
908
- ref: c,
909
- required: l,
910
- onKeyDown: f,
911
- className: y,
912
- ...O
929
+ type: s === "password" && a ? "text" : s,
930
+ ref: f,
931
+ required: o,
932
+ onKeyDown: v,
933
+ className: u,
934
+ ...d
913
935
  }
914
936
  ),
915
- d === "password" && /* @__PURE__ */ e(
937
+ s === "password" && /* @__PURE__ */ e(
916
938
  "button",
917
939
  {
918
940
  type: "button",
919
941
  tabIndex: -1,
920
- onClick: () => a((s) => !s),
942
+ onClick: () => m((y) => !y),
921
943
  className: "absolute inset-y-0 right-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-200",
922
944
  children: /* @__PURE__ */ e(
923
945
  re,
924
946
  {
925
- icon: m ? "mdi:eye-outline" : "mdi:eye-off-outline",
947
+ icon: a ? "mdi:eye-outline" : "mdi:eye-off-outline",
926
948
  className: "w-5 h-5"
927
949
  }
928
950
  )
929
951
  }
930
952
  )
931
953
  ] })
932
- ] }, O.name) });
954
+ ] }, d.name) });
933
955
  }
934
956
  );
935
957
  $e.displayName = "Input";
936
- const sa = ({
937
- key: u,
938
- editorKey: l = "",
939
- value: i = "",
940
- onChange: o,
941
- label: d = "",
958
+ const da = ({
959
+ key: h,
960
+ editorKey: o = "",
961
+ value: l = "",
962
+ onChange: i,
963
+ label: s = "",
942
964
  required: n = !1,
943
- placeholder: b = "",
965
+ placeholder: p = "",
944
966
  parentClass: S = "col-span-12",
945
- height: O = 400,
946
- inline: c = !1,
947
- disabled: m = !1,
967
+ height: D = 400,
968
+ inline: d = !1,
969
+ disabled: f = !1,
948
970
  plugins: a,
949
- toolbar: f,
950
- menubar: y = !1,
951
- fontFamily: s = "Inter, sans-serif",
952
- initConfig: w = {},
971
+ toolbar: m,
972
+ menubar: v = !1,
973
+ fontFamily: u = "Inter, sans-serif",
974
+ initConfig: y = {},
953
975
  imageUploadHandler: x
954
976
  // ✅ Promise function passed from parent
955
- }) => /* @__PURE__ */ h("div", { className: S, children: [
956
- d && /* @__PURE__ */ e(Z, { label: d, required: n }),
977
+ }) => /* @__PURE__ */ c("div", { className: S, children: [
978
+ s && /* @__PURE__ */ e(q, { label: s, required: n }),
957
979
  /* @__PURE__ */ e(
958
- aa,
980
+ ta,
959
981
  {
960
- apiKey: l,
961
- value: i,
962
- disabled: m,
982
+ apiKey: o,
983
+ value: l,
984
+ disabled: f,
963
985
  init: {
964
- height: O,
965
- inline: c,
966
- menubar: y,
986
+ height: D,
987
+ inline: d,
988
+ menubar: v,
967
989
  branding: !1,
968
990
  statusbar: !0,
969
991
  automatic_uploads: !0,
@@ -972,11 +994,11 @@ const sa = ({
972
994
  L(`data:${M.blob().type};base64,${M.base64()}`);
973
995
  return;
974
996
  }
975
- x(M).then((T) => {
976
- T ? L(T) : B("Upload failed: No URL returned");
977
- }).catch((T) => {
997
+ x(M).then((F) => {
998
+ F ? L(F) : B("Upload failed: No URL returned");
999
+ }).catch((F) => {
978
1000
  B(
979
- typeof T == "string" ? T : (T == null ? void 0 : T.message) || "Image upload failed"
1001
+ typeof F == "string" ? F : (F == null ? void 0 : F.message) || "Image upload failed"
980
1002
  );
981
1003
  });
982
1004
  }),
@@ -999,162 +1021,162 @@ const sa = ({
999
1021
  "help",
1000
1022
  "wordcount"
1001
1023
  ],
1002
- toolbar: f ?? "undo redo | blocks | bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media table | removeformat | code fullscreen preview",
1003
- placeholder: b,
1024
+ toolbar: m ?? "undo redo | blocks | bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media table | removeformat | code fullscreen preview",
1025
+ placeholder: p,
1004
1026
  content_style: `
1005
1027
  body {
1006
- font-family: ${s};
1028
+ font-family: ${u};
1007
1029
  }
1008
1030
  `,
1009
- ...w
1031
+ ...y
1010
1032
  },
1011
1033
  onEditorChange: (M) => {
1012
- o && o(M);
1034
+ i && i(M);
1013
1035
  }
1014
1036
  }
1015
1037
  )
1016
- ] }, u), da = ({
1017
- name: u = "",
1018
- label: l = "",
1038
+ ] }, h), ca = ({
1039
+ name: h = "",
1040
+ label: o = "",
1019
1041
  // label for single checkbox
1020
- options: i = [],
1042
+ options: l = [],
1021
1043
  // array of { label, value } for multiple
1022
- value: o = null,
1044
+ value: i = null,
1023
1045
  // boolean for single, array for multiple, or string for single select
1024
- onChange: d,
1046
+ onChange: s,
1025
1047
  disabled: n = !1,
1026
- required: b = !1,
1048
+ required: p = !1,
1027
1049
  parentClass: S = "col-span-12",
1028
- className: O = "",
1029
- multiSelect: c = !1
1050
+ className: D = "",
1051
+ multiSelect: d = !1
1030
1052
  // ✅ if true, only one option can be selected (like radio)
1031
1053
  }) => {
1032
- const m = Array.isArray(i) && i.length > 0, a = (s) => m ? c ? Array.isArray(o) && o.includes(s) : o === s : !!o, f = (s) => {
1033
- d == null || d(s.target.checked, u);
1034
- }, y = (s, w) => {
1035
- if (d)
1036
- if (!c)
1037
- d(w ? s : "", u);
1054
+ const f = Array.isArray(l) && l.length > 0, a = (u) => f ? d ? Array.isArray(i) && i.includes(u) : i === u : !!i, m = (u) => {
1055
+ s == null || s(u.target.checked, h);
1056
+ }, v = (u, y) => {
1057
+ if (s)
1058
+ if (!d)
1059
+ s(y ? u : "", h);
1038
1060
  else {
1039
- const x = Array.isArray(o) ? [...o] : [];
1040
- if (w)
1041
- x.includes(s) || x.push(s);
1061
+ const x = Array.isArray(i) ? [...i] : [];
1062
+ if (y)
1063
+ x.includes(u) || x.push(u);
1042
1064
  else {
1043
- const N = x.indexOf(s);
1065
+ const N = x.indexOf(u);
1044
1066
  N > -1 && x.splice(N, 1);
1045
1067
  }
1046
- d(x, u);
1068
+ s(x, h);
1047
1069
  }
1048
1070
  };
1049
- return m ? /* @__PURE__ */ e(E, { children: /* @__PURE__ */ h("div", { className: `${S}`, children: [
1050
- /* @__PURE__ */ e(Z, { label: l, required: b }),
1051
- /* @__PURE__ */ e("div", { className: "flex flex-col space-y-2", children: i.map((s, w) => /* @__PURE__ */ h("div", { className: "flex items-center", children: [
1071
+ return f ? /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: `${S}`, children: [
1072
+ /* @__PURE__ */ e(q, { label: o, required: p }),
1073
+ /* @__PURE__ */ e("div", { className: "flex flex-col space-y-2", children: l.map((u, y) => /* @__PURE__ */ c("div", { className: "flex items-center", children: [
1052
1074
  /* @__PURE__ */ e(
1053
1075
  "input",
1054
1076
  {
1055
1077
  type: "checkbox",
1056
- name: u,
1057
- value: s.value,
1058
- checked: a(s.value),
1059
- disabled: n || s.disabled,
1060
- required: b && w === 0,
1061
- onChange: (x) => y(s.value, x.target.checked),
1062
- className: `h-4 w-4 cursor-pointer text-blue-600 border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${O}`
1078
+ name: h,
1079
+ value: u.value,
1080
+ checked: a(u.value),
1081
+ disabled: n || u.disabled,
1082
+ required: p && y === 0,
1083
+ onChange: (x) => v(u.value, x.target.checked),
1084
+ className: `h-4 w-4 cursor-pointer text-blue-600 border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${D}`
1063
1085
  },
1064
- u
1086
+ h
1065
1087
  ),
1066
- s.label && /* @__PURE__ */ e(
1088
+ u.label && /* @__PURE__ */ e(
1067
1089
  "label",
1068
1090
  {
1069
- htmlFor: u,
1091
+ htmlFor: h,
1070
1092
  className: "ml-2 text-sm text-gray-700 dark:text-gray-200 select-none",
1071
- children: s.label
1093
+ children: u.label
1072
1094
  }
1073
1095
  )
1074
- ] }, s.value || s.label)) })
1075
- ] }) }) : /* @__PURE__ */ h("div", { className: `flex items-center ${S}`, children: [
1096
+ ] }, u.value || u.label)) })
1097
+ ] }) }) : /* @__PURE__ */ c("div", { className: `flex items-center ${S}`, children: [
1076
1098
  /* @__PURE__ */ e(
1077
1099
  "input",
1078
1100
  {
1079
1101
  type: "checkbox",
1080
- name: u,
1102
+ name: h,
1081
1103
  checked: a(),
1082
1104
  disabled: n,
1083
- required: b,
1084
- onChange: f,
1085
- className: `h-4 w-4 text-blue-600 cursor-pointer border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${O}`
1105
+ required: p,
1106
+ onChange: m,
1107
+ className: `h-4 w-4 text-blue-600 cursor-pointer border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${D}`
1086
1108
  }
1087
1109
  ),
1088
- l && /* @__PURE__ */ e(
1110
+ o && /* @__PURE__ */ e(
1089
1111
  "label",
1090
1112
  {
1091
- htmlFor: u,
1113
+ htmlFor: h,
1092
1114
  className: "ml-2 text-sm text-gray-700 dark:text-gray-200 select-none",
1093
- children: l
1115
+ children: o
1094
1116
  }
1095
1117
  )
1096
1118
  ] });
1097
- }, ca = ({
1098
- label: u = "",
1099
- value: l = null,
1100
- onChange: i,
1101
- required: o = !1,
1102
- accept: d = "audio/*",
1119
+ }, ha = ({
1120
+ label: h = "",
1121
+ value: o = null,
1122
+ onChange: l,
1123
+ required: i = !1,
1124
+ accept: s = "audio/*",
1103
1125
  id: n,
1104
- dragDrop: b = !1,
1126
+ dragDrop: p = !1,
1105
1127
  name: S = "",
1106
- parentClass: O = ""
1128
+ parentClass: D = ""
1107
1129
  }) => {
1108
- const [c, m] = R(null), [a, f] = R(!1), y = ae(null);
1130
+ const [d, f] = R(null), [a, m] = R(!1), v = ae(null);
1109
1131
  z(() => {
1110
- if (!l) {
1111
- s(), m(null);
1132
+ if (!o) {
1133
+ u(), f(null);
1112
1134
  return;
1113
1135
  }
1114
- if (l instanceof File) {
1115
- const L = URL.createObjectURL(l);
1116
- return m({ file: l, preview: L }), () => {
1136
+ if (o instanceof File) {
1137
+ const L = URL.createObjectURL(o);
1138
+ return f({ file: o, preview: L }), () => {
1117
1139
  URL.revokeObjectURL(L);
1118
1140
  };
1119
- } else typeof l == "string" ? m({ preview: l }) : l != null && l.preview && m(l);
1120
- }, [l]);
1121
- const s = () => {
1122
- c != null && c.preview && c.preview.startsWith("blob:") && URL.revokeObjectURL(c.preview);
1123
- }, w = (L) => {
1141
+ } else typeof o == "string" ? f({ preview: o }) : o != null && o.preview && f(o);
1142
+ }, [o]);
1143
+ const u = () => {
1144
+ d != null && d.preview && d.preview.startsWith("blob:") && URL.revokeObjectURL(d.preview);
1145
+ }, y = (L) => {
1124
1146
  if (!L || L.length === 0)
1125
1147
  return;
1126
- const B = L[0], T = URL.createObjectURL(B);
1127
- s(), m({ file: B, preview: T }), i == null || i(B);
1148
+ const B = L[0], F = URL.createObjectURL(B);
1149
+ u(), f({ file: B, preview: F }), l == null || l(B);
1128
1150
  }, x = (L) => {
1129
- L && L.stopPropagation(), s(), m(null), i == null || i(null), y.current && (y.current.value = "");
1151
+ L && L.stopPropagation(), u(), f(null), l == null || l(null), v.current && (v.current.value = "");
1130
1152
  }, N = (L) => {
1131
- b && (L.preventDefault(), f(!0));
1153
+ p && (L.preventDefault(), m(!0));
1154
+ }, I = (L) => {
1155
+ p && (L.preventDefault(), m(!1));
1132
1156
  }, P = (L) => {
1133
- b && (L.preventDefault(), f(!1));
1134
- }, F = (L) => {
1135
- b && (L.preventDefault(), f(!1), w(L.dataTransfer.files));
1157
+ p && (L.preventDefault(), m(!1), y(L.dataTransfer.files));
1136
1158
  }, M = () => {
1137
- y.current.click();
1159
+ v.current.click();
1138
1160
  };
1139
- return /* @__PURE__ */ h("div", { className: O || "col-span-12", children: [
1140
- /* @__PURE__ */ e(Z, { label: u, required: o }),
1141
- /* @__PURE__ */ h(
1161
+ return /* @__PURE__ */ c("div", { className: D || "col-span-12", children: [
1162
+ /* @__PURE__ */ e(q, { label: h, required: i }),
1163
+ /* @__PURE__ */ c(
1142
1164
  "div",
1143
1165
  {
1144
1166
  className: `relative rounded-lg p-2 transition-all ${a ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
1145
1167
  onDragOver: N,
1146
- onDragLeave: P,
1147
- onDrop: F,
1168
+ onDragLeave: I,
1169
+ onDrop: P,
1148
1170
  children: [
1149
1171
  /* @__PURE__ */ e(
1150
1172
  "input",
1151
1173
  {
1152
- ref: y,
1174
+ ref: v,
1153
1175
  id: n,
1154
1176
  type: "file",
1155
- accept: d,
1156
- onChange: (L) => w(L.target.files),
1157
- required: o && !c,
1177
+ accept: s,
1178
+ onChange: (L) => y(L.target.files),
1179
+ required: i && !d,
1158
1180
  className: "absolute opacity-0 right-[50%] top-[80%] -translate-y-1/2 pointer-events-none h-[10px]"
1159
1181
  }
1160
1182
  ),
@@ -1162,11 +1184,11 @@ const sa = ({
1162
1184
  "div",
1163
1185
  {
1164
1186
  className: `flex items-center space-x-4 transition-all ${a ? "opacity-50" : ""}`,
1165
- children: c ? (
1187
+ children: d ? (
1166
1188
  // Audio player with close button and change button
1167
- /* @__PURE__ */ h("div", { className: "flex items-center space-x-4", children: [
1168
- /* @__PURE__ */ h("div", { className: "relative w-full", children: [
1169
- !o && /* @__PURE__ */ e(
1189
+ /* @__PURE__ */ c("div", { className: "flex items-center space-x-4", children: [
1190
+ /* @__PURE__ */ c("div", { className: "relative w-full", children: [
1191
+ !i && /* @__PURE__ */ e(
1170
1192
  "button",
1171
1193
  {
1172
1194
  type: "button",
@@ -1179,18 +1201,18 @@ const sa = ({
1179
1201
  /* @__PURE__ */ e(
1180
1202
  "audio",
1181
1203
  {
1182
- src: c.preview,
1204
+ src: d.preview,
1183
1205
  controls: !0,
1184
1206
  controlsList: "nodownload"
1185
1207
  },
1186
- c.preview
1208
+ d.preview
1187
1209
  )
1188
1210
  ] }),
1189
1211
  /* @__PURE__ */ e(Q, { type: "button", onClick: M, children: /* @__PURE__ */ e("span", { children: "Change Audio File" }) })
1190
1212
  ] })
1191
1213
  ) : (
1192
1214
  // Empty state with upload button
1193
- /* @__PURE__ */ h("div", { className: "flex items-center justify-center space-x-4", children: [
1215
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-center space-x-4", children: [
1194
1216
  /* @__PURE__ */ e("div", { className: "rounded-full bg-gray-100 dark:bg-gray-700 h-20 w-20 flex items-center justify-center", children: /* @__PURE__ */ e(re, { icon: "mdi:music", className: "text-gray-400 w-10 h-10" }) }),
1195
1217
  /* @__PURE__ */ e(
1196
1218
  Q,
@@ -1201,117 +1223,118 @@ const sa = ({
1201
1223
  children: /* @__PURE__ */ e("span", { children: "Choose Audio File" })
1202
1224
  }
1203
1225
  ),
1204
- b && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop your audio file here" })
1226
+ p && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop your audio file here" })
1205
1227
  ] })
1206
1228
  )
1207
1229
  }
1208
1230
  ),
1209
- b && a && !c && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-lg", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg bg-white dark:bg-gray-800 px-4 py-2 rounded-lg shadow-lg", children: "Drop audio here" }) })
1231
+ p && a && !d && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-lg", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg bg-white dark:bg-gray-800 px-4 py-2 rounded-lg shadow-lg", children: "Drop audio here" }) })
1210
1232
  ]
1211
1233
  }
1212
1234
  )
1213
1235
  ] }, S);
1214
- }, Ge = ({ field: u, formData: l, handleChange: i }) => {
1236
+ }, Ge = ({ field: h, formData: o, handleChange: l }) => {
1215
1237
  const {
1216
- key: o,
1217
- label: d,
1238
+ key: i,
1239
+ label: s,
1218
1240
  type: n,
1219
- options: b,
1241
+ options: p,
1220
1242
  placeholder: S,
1221
- rows: O,
1222
- inputClass: c,
1223
- search: m,
1243
+ rows: D,
1244
+ inputClass: d,
1245
+ search: f,
1224
1246
  accept: a,
1225
- text: f,
1226
- required: y = !1,
1227
- minLength: s,
1228
- dragDrop: w,
1247
+ text: m,
1248
+ required: v = !1,
1249
+ minLength: u,
1250
+ dragDrop: y,
1229
1251
  parentClass: x,
1230
1252
  countriesList: N,
1231
- defaultCountry: P,
1232
- multiple: F,
1253
+ defaultCountry: I,
1254
+ multiple: P,
1233
1255
  dropdownMaxHeight: M,
1234
1256
  editorKey: L,
1235
1257
  fontFamily: B,
1236
- disabled: T,
1258
+ disabled: F,
1237
1259
  negativeNumberAllow: C,
1238
- defaultValue: j,
1260
+ defaultValue: E,
1239
1261
  renderCondition: G,
1240
- optionDependencyKey: W
1241
- } = u;
1242
- let $ = l == null ? void 0 : l[o];
1243
- $ == null && ($ = "");
1244
- const H = S || (n === "select" ? `Select ${d}` : `Enter ${d}`), Y = "w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 text-sm focus:outline-none focus:ring-1 focus:ring-blue-200 bg-white text-black dark:bg-gray-700 dark:text-white";
1245
- if (G && typeof G == "function" && !G(l))
1262
+ optionDependencyKey: Y,
1263
+ pattern: W
1264
+ } = h;
1265
+ let U = o == null ? void 0 : o[i];
1266
+ U == null && (U = "");
1267
+ const K = S || (n === "select" ? `Select ${s}` : `Enter ${s}`), Z = "w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 text-sm focus:outline-none focus:ring-1 focus:ring-blue-200 bg-white text-black dark:bg-gray-700 dark:text-white";
1268
+ if (G && typeof G == "function" && !G(o))
1246
1269
  return null;
1247
1270
  switch (n) {
1248
1271
  case "select":
1249
1272
  return /* @__PURE__ */ e(
1250
- na,
1273
+ la,
1251
1274
  {
1252
- options: b || [],
1253
- value: $,
1254
- formData: l,
1255
- dependencyKey: W,
1256
- onChange: (I) => i(o, I),
1257
- placeholder: H,
1258
- className: c || "",
1259
- search: m,
1260
- required: y,
1261
- defaultValue: j,
1262
- label: d,
1263
- name: o,
1264
- disabled: T,
1275
+ options: p || [],
1276
+ value: U,
1277
+ formData: o,
1278
+ dependencyKey: Y,
1279
+ onChange: (O) => l(i, O),
1280
+ placeholder: K,
1281
+ className: d || "",
1282
+ search: f,
1283
+ required: v,
1284
+ defaultValue: E,
1285
+ label: s,
1286
+ name: i,
1287
+ disabled: F,
1265
1288
  parentClass: x,
1266
- multiple: F,
1289
+ multiple: P,
1267
1290
  dropdownMaxHeight: M
1268
1291
  }
1269
1292
  );
1270
1293
  case "checkbox":
1271
1294
  return /* @__PURE__ */ e(
1272
- da,
1295
+ ca,
1273
1296
  {
1274
- name: o,
1275
- label: d,
1276
- options: b || [],
1277
- value: $,
1278
- onChange: (I) => i(o, I),
1279
- required: y,
1297
+ name: i,
1298
+ label: s,
1299
+ options: p || [],
1300
+ value: U,
1301
+ onChange: (O) => l(i, O),
1302
+ required: v,
1280
1303
  parentClass: x,
1281
- className: c || "",
1282
- multiSelect: F,
1283
- disabled: T
1304
+ className: d || "",
1305
+ multiSelect: P,
1306
+ disabled: F
1284
1307
  }
1285
1308
  );
1286
1309
  case "switch":
1287
1310
  return /* @__PURE__ */ e(
1288
- la,
1311
+ oa,
1289
1312
  {
1290
- value: $,
1291
- onChange: (I) => i(o, I),
1292
- text: f,
1293
- options: b || [],
1294
- label: d,
1295
- required: y,
1296
- name: o,
1297
- disabled: T,
1313
+ value: U,
1314
+ onChange: (O) => l(i, O),
1315
+ text: m,
1316
+ options: p || [],
1317
+ label: s,
1318
+ required: v,
1319
+ name: i,
1320
+ disabled: F,
1298
1321
  parentClass: x
1299
1322
  }
1300
1323
  );
1301
1324
  case "phone":
1302
1325
  return /* @__PURE__ */ e(
1303
- oa,
1326
+ ia,
1304
1327
  {
1305
- value: $,
1306
- onChange: (I) => i(o, I),
1328
+ value: U,
1329
+ onChange: (O) => l(i, O),
1307
1330
  countriesList: N,
1308
- defaultCountry: P,
1309
- required: y,
1310
- placeholder: H,
1311
- search: m,
1312
- label: d,
1313
- name: o,
1314
- disabled: T,
1331
+ defaultCountry: I,
1332
+ required: v,
1333
+ placeholder: K,
1334
+ search: f,
1335
+ label: s,
1336
+ name: i,
1337
+ disabled: F,
1315
1338
  parentClass: x
1316
1339
  }
1317
1340
  );
@@ -1319,130 +1342,132 @@ const sa = ({
1319
1342
  return /* @__PURE__ */ e(
1320
1343
  Ee,
1321
1344
  {
1322
- value: $,
1323
- onChange: (I) => i(o, I.target.value),
1324
- placeholder: H,
1325
- rows: O || 3,
1326
- className: `${Y} ${c || ""}`,
1327
- required: y,
1328
- name: o,
1329
- label: d,
1330
- disabled: T,
1345
+ value: U,
1346
+ onChange: (O) => l(i, O.target.value),
1347
+ placeholder: K,
1348
+ rows: D || 3,
1349
+ className: `${Z} ${d || ""}`,
1350
+ required: v,
1351
+ name: i,
1352
+ label: s,
1353
+ disabled: F,
1331
1354
  parentClass: x
1332
1355
  }
1333
1356
  );
1334
1357
  case "image":
1335
1358
  return /* @__PURE__ */ e(
1336
- ia,
1359
+ sa,
1337
1360
  {
1338
- value: $,
1339
- onChange: (I) => i(o, I),
1340
- required: y,
1361
+ value: U,
1362
+ onChange: (O) => l(i, O),
1363
+ required: v,
1341
1364
  accept: a || "image/*",
1342
- id: `file-${o}`,
1343
- dragDrop: w,
1344
- label: d,
1345
- name: o,
1365
+ id: `file-${i}`,
1366
+ dragDrop: y,
1367
+ label: s,
1368
+ name: i,
1346
1369
  parentClass: x
1347
1370
  }
1348
1371
  );
1349
1372
  case "audio":
1350
1373
  return /* @__PURE__ */ e(
1351
- ca,
1374
+ ha,
1352
1375
  {
1353
- value: $,
1354
- onChange: (I) => i(o, I),
1355
- required: y,
1376
+ value: U,
1377
+ onChange: (O) => l(i, O),
1378
+ required: v,
1356
1379
  accept: a || "audio/*",
1357
- id: `file-${o}`,
1358
- dragDrop: w,
1359
- label: d,
1360
- name: o,
1380
+ id: `file-${i}`,
1381
+ dragDrop: y,
1382
+ label: s,
1383
+ name: i,
1361
1384
  parentClass: x
1362
1385
  }
1363
1386
  );
1364
1387
  case "tinyEditor":
1365
1388
  return /* @__PURE__ */ e(
1366
- sa,
1389
+ da,
1367
1390
  {
1368
- value: $,
1369
- onChange: (I) => i(o, I),
1370
- required: y,
1371
- placeholder: H,
1372
- label: d,
1391
+ value: U,
1392
+ onChange: (O) => l(i, O),
1393
+ required: v,
1394
+ placeholder: K,
1395
+ label: s,
1373
1396
  parentClass: x,
1374
1397
  fontFamily: B,
1375
1398
  editorKey: L,
1376
- disabled: T
1399
+ disabled: F
1377
1400
  },
1378
- `editor-${o}`
1401
+ `editor-${i}`
1379
1402
  );
1380
1403
  default:
1381
1404
  return /* @__PURE__ */ e(
1382
1405
  $e,
1383
1406
  {
1407
+ field: h,
1384
1408
  type: n || "text",
1385
- defaultValue: j,
1386
- value: $,
1387
- onChange: (I) => i(o, I.target.value),
1388
- placeholder: H,
1389
- className: `${Y} ${c || ""}`,
1390
- required: y,
1391
- name: o,
1392
- minLength: s,
1393
- label: d,
1409
+ defaultValue: E,
1410
+ value: U,
1411
+ onChange: (O) => l(i, O.target.value),
1412
+ placeholder: K,
1413
+ className: `${Z} ${d || ""}`,
1414
+ required: v,
1415
+ name: i,
1416
+ minLength: u,
1417
+ label: s,
1394
1418
  negativeNumberAllow: C,
1395
1419
  parentClass: x,
1396
- disabled: T
1420
+ disabled: F,
1421
+ pattern: W
1397
1422
  }
1398
1423
  );
1399
1424
  }
1400
- }, ha = ({ isOpen: u, onClose: l, config: i, onApply: o }) => {
1401
- var c;
1402
- const [d, n] = R({}), b = (m, a) => {
1403
- n((f) => ({ ...f, [m]: a }));
1425
+ }, ua = ({ isOpen: h, onClose: o, config: l, onApply: i }) => {
1426
+ var d;
1427
+ const [s, n] = R({}), p = (f, a) => {
1428
+ n((m) => ({ ...m, [f]: a }));
1404
1429
  }, S = () => {
1405
- o == null || o(d), l();
1406
- }, O = () => {
1407
- n({}), o == null || o({}), l();
1430
+ i == null || i(s), o();
1431
+ }, D = () => {
1432
+ n({}), i == null || i({}), o();
1408
1433
  };
1409
- return /* @__PURE__ */ h(E, { children: [
1434
+ return /* @__PURE__ */ c($, { children: [
1410
1435
  /* @__PURE__ */ e(
1411
1436
  "div",
1412
1437
  {
1413
- className: `fixed inset-0 bg-black/50 z-40 transition-opacity duration-300 ${u ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
1414
- onClick: l
1438
+ className: `fixed inset-0 bg-black/50 z-40 transition-opacity duration-300 ${h ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
1439
+ onClick: o
1415
1440
  }
1416
1441
  ),
1417
- /* @__PURE__ */ h(
1442
+ /* @__PURE__ */ c(
1418
1443
  "div",
1419
1444
  {
1420
1445
  className: `fixed top-0 right-0 h-full w-[28rem] bg-white dark:bg-gray-900 shadow-2xl z-50 flex flex-col border-l border-gray-200 dark:border-gray-700
1421
1446
  transform transition-transform duration-300 ease-in-out
1422
- ${u ? "translate-x-0" : "translate-x-full"}
1447
+ ${h ? "translate-x-0" : "translate-x-full"}
1423
1448
  `,
1424
1449
  children: [
1425
- /* @__PURE__ */ h("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700", children: [
1450
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700", children: [
1426
1451
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "Filters" }),
1427
1452
  /* @__PURE__ */ e(
1428
1453
  "button",
1429
1454
  {
1430
- onClick: l,
1455
+ onClick: o,
1431
1456
  className: "p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition",
1432
1457
  children: /* @__PURE__ */ e(Se, { className: "w-5 h-5 text-gray-500 dark:text-gray-400" })
1433
1458
  }
1434
1459
  )
1435
1460
  ] }),
1436
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 py-3", children: i != null && i.component ? /* @__PURE__ */ e(i.component, { filters: d, onFilterChange: b }) : /* @__PURE__ */ e("div", { className: "space-y-4", children: (c = i == null ? void 0 : i.fields) == null ? void 0 : c.map((m) => /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
1461
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 py-3", children: l != null && l.component ? /* @__PURE__ */ e(l.component, { filters: s, onFilterChange: p }) : /* @__PURE__ */ e("div", { className: "space-y-4", children: (d = l == null ? void 0 : l.fields) == null ? void 0 : d.map((f) => /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
1437
1462
  Ge,
1438
1463
  {
1439
- field: m,
1440
- formData: d,
1441
- handleChange: b
1464
+ field: f,
1465
+ formData: s,
1466
+ handleChange: p
1442
1467
  },
1443
- m.key
1468
+ f.key
1444
1469
  ) })) }) }),
1445
- /* @__PURE__ */ h("div", { className: "flex gap-2 px-4 py-3 border-t border-gray-200 dark:border-gray-700", children: [
1470
+ /* @__PURE__ */ c("div", { className: "flex gap-2 px-4 py-3 border-t border-gray-200 dark:border-gray-700", children: [
1446
1471
  /* @__PURE__ */ e(
1447
1472
  Q,
1448
1473
  {
@@ -1456,7 +1481,7 @@ const sa = ({
1456
1481
  /* @__PURE__ */ e(
1457
1482
  Q,
1458
1483
  {
1459
- onClick: O,
1484
+ onClick: D,
1460
1485
  variant: "contained",
1461
1486
  className: "min-w-[150px]",
1462
1487
  children: "Reset"
@@ -1501,56 +1526,56 @@ const sa = ({
1501
1526
  outline: "border !bg-transparent",
1502
1527
  soft: "bg opacity-90"
1503
1528
  }, Ke = ({
1504
- label: u,
1505
- variant: l = "contained",
1529
+ label: h,
1530
+ variant: o = "contained",
1506
1531
  // contained | outline | soft
1507
- color: i = "green",
1508
- className: o = ""
1532
+ color: l = "green",
1533
+ className: i = ""
1509
1534
  }) => {
1510
- const d = Fe[i] || Fe.green, n = Pe[l] || Pe.contained, b = l === "outline" ? d.border : d.bg;
1535
+ const s = Fe[l] || Fe.green, n = Pe[o] || Pe.contained, p = o === "outline" ? s.border : s.bg;
1511
1536
  return /* @__PURE__ */ e(
1512
1537
  "span",
1513
1538
  {
1514
1539
  className: `inline-flex justify-center items-center rounded-sm text-xs font-semibold px-3 py-1 min-w-[78px]
1515
- ${b}
1540
+ ${p}
1516
1541
  ${n}
1517
- ${o}`,
1518
- children: u
1542
+ ${i}`,
1543
+ children: h
1519
1544
  }
1520
1545
  );
1521
- }, ua = ({ rows: u = 5, columns: l = 5 }) => /* @__PURE__ */ h(E, { children: [
1546
+ }, pa = ({ rows: h = 5, columns: o = 5 }) => /* @__PURE__ */ c($, { children: [
1522
1547
  /* @__PURE__ */ e("div", { className: "w-full mb-6 inline-flex justify-end items-center", children: /* @__PURE__ */ e("div", { className: "h-8 w-80 bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }),
1523
- /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-md border border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ h("table", { className: "w-full border-collapse", children: [
1524
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "bg-gray-50 dark:bg-gray-900", children: Array.from({ length: l }).map((i, o) => /* @__PURE__ */ e("th", { className: "px-4 py-3", children: /* @__PURE__ */ e("div", { className: "h-6 w-24 bg-gray-300 dark:bg-gray-700 rounded animate-pulse inline-flex justify-center items-center" }) }, o)) }) }),
1525
- /* @__PURE__ */ e("tbody", { children: Array.from({ length: u }).map((i, o) => /* @__PURE__ */ e(
1548
+ /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-md border border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ c("table", { className: "w-full border-collapse", children: [
1549
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "bg-gray-50 dark:bg-gray-900", children: Array.from({ length: o }).map((l, i) => /* @__PURE__ */ e("th", { className: "px-4 py-3", children: /* @__PURE__ */ e("div", { className: "h-6 w-24 bg-gray-300 dark:bg-gray-700 rounded animate-pulse inline-flex justify-center items-center" }) }, i)) }) }),
1550
+ /* @__PURE__ */ e("tbody", { children: Array.from({ length: h }).map((l, i) => /* @__PURE__ */ e(
1526
1551
  "tr",
1527
1552
  {
1528
1553
  className: "border-t border-gray-200 dark:border-gray-800",
1529
- children: Array.from({ length: l }).map((d, n) => /* @__PURE__ */ e("td", { className: "px-4 py-6", children: /* @__PURE__ */ e("div", { className: "h-6 w-full bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }, n))
1554
+ children: Array.from({ length: o }).map((s, n) => /* @__PURE__ */ e("td", { className: "px-4 py-6", children: /* @__PURE__ */ e("div", { className: "h-6 w-full bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }, n))
1530
1555
  },
1531
- o
1556
+ i
1532
1557
  )) })
1533
1558
  ] }) })
1534
- ] }), _e = ({ src: u, alt: l = "preview", isOpen: i, setIsOpen: o }) => {
1535
- const d = () => o(!1);
1559
+ ] }), _e = ({ src: h, alt: o = "preview", isOpen: l, setIsOpen: i }) => {
1560
+ const s = () => i(!1);
1536
1561
  return z(() => {
1537
- const n = (b) => {
1538
- b.key === "Escape" && d();
1562
+ const n = (p) => {
1563
+ p.key === "Escape" && s();
1539
1564
  };
1540
- return i && (document.body.style.overflow = "hidden", document.addEventListener("keydown", n)), () => {
1565
+ return l && (document.body.style.overflow = "hidden", document.addEventListener("keydown", n)), () => {
1541
1566
  document.body.style.overflow = "", document.removeEventListener("keydown", n);
1542
1567
  };
1543
- }, [i]), /* @__PURE__ */ e(E, { children: /* @__PURE__ */ h(
1568
+ }, [l]), /* @__PURE__ */ e($, { children: /* @__PURE__ */ c(
1544
1569
  "div",
1545
1570
  {
1546
1571
  className: `fixed inset-0 z-50 flex items-center justify-center bg-black/70 dark:bg-black/80 \r
1547
1572
  backdrop-blur-sm animate-in fade-in duration-200`,
1548
- onClick: d,
1573
+ onClick: s,
1549
1574
  children: [
1550
1575
  /* @__PURE__ */ e(
1551
1576
  "button",
1552
1577
  {
1553
- onClick: d,
1578
+ onClick: s,
1554
1579
  className: `absolute top-4 right-4 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200\r
1555
1580
  hover:bg-gray-100 dark:hover:bg-gray-700 rounded-full p-2 shadow-lg transition`,
1556
1581
  children: /* @__PURE__ */ e(Se, { size: 20 })
@@ -1564,8 +1589,8 @@ const sa = ({
1564
1589
  children: /* @__PURE__ */ e(
1565
1590
  "img",
1566
1591
  {
1567
- src: u,
1568
- alt: l,
1592
+ src: h,
1593
+ alt: o,
1569
1594
  className: "w-full max-h-[90vh] object-contain rounded-xl"
1570
1595
  }
1571
1596
  )
@@ -1575,23 +1600,23 @@ const sa = ({
1575
1600
  }
1576
1601
  ) });
1577
1602
  }, ba = ({
1578
- config: u,
1579
- setShowAdd: l,
1580
- title: i,
1581
- buttonText: o,
1582
- description: d,
1603
+ config: h,
1604
+ setShowAdd: o,
1605
+ title: l,
1606
+ buttonText: i,
1607
+ description: s,
1583
1608
  showAddButton: n
1584
1609
  }) => {
1585
1610
  const {
1586
- data: b = [],
1611
+ data: p = [],
1587
1612
  table_head: S = [],
1588
- loading: O = !1,
1589
- search: c = {
1613
+ loading: D = !1,
1614
+ search: d = {
1590
1615
  enabled: !1,
1591
1616
  placeholder: "Search...",
1592
1617
  useServerSideSearch: !1
1593
1618
  },
1594
- filter: m = {
1619
+ filter: f = {
1595
1620
  enabled: !1,
1596
1621
  useServerSideFilters: !1
1597
1622
  },
@@ -1600,21 +1625,21 @@ const sa = ({
1600
1625
  rows_per_page: 10,
1601
1626
  useServerSidePagination: !1
1602
1627
  },
1603
- emptyMessage: f = "No data available",
1604
- onMenuAction: y,
1605
- setServerSidePaginationData: s = () => {
1628
+ emptyMessage: m = "No data available",
1629
+ onMenuAction: v,
1630
+ setServerSidePaginationData: u = () => {
1606
1631
  },
1607
- onFilterApply: w,
1632
+ onFilterApply: y,
1608
1633
  filterConfig: x = null,
1609
1634
  rowClick: N = null
1610
- } = u, [P, F] = R(""), [M, L] = R(null), [B, T] = R([]), [C, j] = R({}), [G, W] = R(!1), [$, H] = R(null), [Y, I] = R(!1), K = Le(() => !c.enabled || !P.trim() || c.useServerSideSearch ? b : ra(b, P, c.searchKeys || []), [b, P, c]), [_, k] = R(1), [U, X] = R((a == null ? void 0 : a.rows_per_page) || 50), [J, ee] = R(K.length || 0), ne = a != null && a.useServerSidePagination ? a.total_pages : Math.ceil(K.length / U), ce = Le(() => {
1611
- if (a.useServerSidePagination) return K;
1612
- const t = (_ - 1) * U;
1613
- return K.slice(t, t + U);
1614
- }, [K, _, U]), le = ae(null), oe = ae({}), te = ae(null), he = (t) => {
1615
- F(t), k(1), c.useServerSideSearch && (te.current && clearTimeout(te.current), te.current = setTimeout(async () => {
1635
+ } = h, [I, P] = R(""), [M, L] = R(null), [B, F] = R([]), [C, E] = R({}), [G, Y] = R(!1), [W, U] = R(null), [K, Z] = R(!1), O = Le(() => !d.enabled || !I.trim() || d.useServerSideSearch ? p : na(p, I, d.searchKeys || []), [p, I, d]), [_, k] = R(1), [j, X] = R((a == null ? void 0 : a.rows_per_page) || 50), [J, ee] = R(O.length || 0), ne = a != null && a.useServerSidePagination ? a.total_pages : Math.ceil(O.length / j), ce = Le(() => {
1636
+ if (a.useServerSidePagination) return O;
1637
+ const t = (_ - 1) * j;
1638
+ return O.slice(t, t + j);
1639
+ }, [O, _, j]), le = ae(null), oe = ae({}), te = ae(null), he = (t) => {
1640
+ P(t), k(1), d.useServerSideSearch && (te.current && clearTimeout(te.current), te.current = setTimeout(async () => {
1616
1641
  try {
1617
- await s((g) => ({
1642
+ await u((g) => ({
1618
1643
  ...g,
1619
1644
  search: t,
1620
1645
  current_page: 1
@@ -1623,20 +1648,20 @@ const sa = ({
1623
1648
  console.error("Search error:", g);
1624
1649
  }
1625
1650
  }, 800));
1626
- }, ue = (t, g, D) => {
1627
- D.stopPropagation(), L(null), y == null || y(t.type, g);
1628
- }, be = (t, g, D) => {
1629
- g.stopPropagation(), T(D);
1630
- const p = g.currentTarget;
1631
- oe.current[t] = p;
1632
- const v = p.getBoundingClientRect(), A = 192, q = D.length * 40, V = window.innerWidth, Te = window.innerHeight, He = V - v.right < A ? v.left - A + v.width : v.left, Ye = Te - v.bottom < q && v.top > q ? v.top - q - 2 : v.bottom + 2;
1633
- j({
1634
- top: Math.max(8, Math.min(Ye, Te - q - 8)),
1635
- left: Math.max(8, Math.min(He, V - A - 8))
1651
+ }, ue = (t, g, T) => {
1652
+ T.stopPropagation(), L(null), v == null || v(t.type, g);
1653
+ }, pe = (t, g, T) => {
1654
+ g.stopPropagation(), F(T);
1655
+ const b = g.currentTarget;
1656
+ oe.current[t] = b;
1657
+ const w = b.getBoundingClientRect(), A = 192, V = T.length * 40, H = window.innerWidth, Te = window.innerHeight, He = H - w.right < A ? w.left - A + w.width : w.left, Ye = Te - w.bottom < V && w.top > V ? w.top - V - 2 : w.bottom + 2;
1658
+ E({
1659
+ top: Math.max(8, Math.min(Ye, Te - V - 8)),
1660
+ left: Math.max(8, Math.min(He, H - A - 8))
1636
1661
  }), L(M === t ? null : t);
1637
- }, pe = (t) => (_ - 1) * U + t + 1, ge = (t) => {
1638
- t && t.src instanceof File && (t = { ...t, src: URL.createObjectURL(t.src) }), H(t), I(!0);
1639
- }, ie = (t, g, D, p = null, v = null) => /* @__PURE__ */ e(E, { children: t ? /* @__PURE__ */ e(
1662
+ }, be = (t) => (_ - 1) * j + t + 1, ge = (t) => {
1663
+ t && t.src instanceof File && (t = { ...t, src: URL.createObjectURL(t.src) }), U(t), Z(!0);
1664
+ }, ie = (t, g, T, b = null, w = null) => /* @__PURE__ */ e($, { children: t ? /* @__PURE__ */ e(
1640
1665
  "img",
1641
1666
  {
1642
1667
  src: t instanceof File ? URL.createObjectURL(t) : t,
@@ -1644,32 +1669,32 @@ const sa = ({
1644
1669
  onClick: (A) => {
1645
1670
  A.stopPropagation(), A.preventDefault(), ge({ src: t, alt: g });
1646
1671
  },
1647
- className: `w-10 h-10 cursor-pointer shrink-0 rounded-full object-cover border border-gray-200 dark:border-gray-700 ${D || ""}`
1672
+ className: `w-10 h-10 cursor-pointer shrink-0 rounded-full object-cover border border-gray-200 dark:border-gray-700 ${T || ""}`
1648
1673
  }
1649
- ) : /* @__PURE__ */ e(E, { children: p ? typeof p == "function" ? p(v) : p : /* @__PURE__ */ e(
1674
+ ) : /* @__PURE__ */ e($, { children: b ? typeof b == "function" ? b(w) : b : /* @__PURE__ */ e(
1650
1675
  "div",
1651
1676
  {
1652
- className: `w-10 h-10 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${D || ""}`,
1677
+ className: `w-10 h-10 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${T || ""}`,
1653
1678
  children: /* @__PURE__ */ e(Ue, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
1654
1679
  }
1655
- ) }) }), me = (t, g) => /* @__PURE__ */ e(E, { children: t ? /* @__PURE__ */ e(
1680
+ ) }) }), me = (t, g) => /* @__PURE__ */ e($, { children: t ? /* @__PURE__ */ e(
1656
1681
  "audio",
1657
1682
  {
1658
1683
  controls: !0,
1659
1684
  src: t instanceof File ? URL.createObjectURL(t) : t,
1660
- onClick: (D) => {
1661
- D.stopPropagation();
1685
+ onClick: (T) => {
1686
+ T.stopPropagation();
1662
1687
  },
1663
1688
  className: `w-64 cursor-pointer ${g || ""}`
1664
1689
  },
1665
1690
  t instanceof File ? URL.createObjectURL(t) : t
1666
- ) : /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
1691
+ ) : /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
1667
1692
  "div",
1668
1693
  {
1669
1694
  className: `w-12 h-12 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${g || ""}`,
1670
- children: /* @__PURE__ */ e(Xe, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
1695
+ children: /* @__PURE__ */ e(ea, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
1671
1696
  }
1672
- ) }) }), fe = (t, g) => /* @__PURE__ */ h("div", { className: `flex items-center space-x-4 ${g.className || ""}`, children: [
1697
+ ) }) }), fe = (t, g) => /* @__PURE__ */ c("div", { className: `flex items-center space-x-4 ${g.className || ""}`, children: [
1673
1698
  g.imageKey ? ie(
1674
1699
  t[g.imageKey],
1675
1700
  t[g.titleKey],
@@ -1677,53 +1702,53 @@ const sa = ({
1677
1702
  g.fallback_icon,
1678
1703
  t
1679
1704
  ) : "",
1680
- /* @__PURE__ */ h("div", { children: [
1705
+ /* @__PURE__ */ c("div", { children: [
1681
1706
  /* @__PURE__ */ e("p", { className: "font-medium text-gray-900 dark:text-white group-title", children: t[g.titleKey] || "" }),
1682
1707
  /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400 group-sub-title", children: t[g.subtitleKey] || "" })
1683
1708
  ] })
1684
1709
  ] }), ye = (t, g) => {
1685
1710
  var A;
1686
- let D = String(t);
1687
- const p = g.variant || "contained";
1688
- let v = g.defaultColor;
1711
+ let T = String(t);
1712
+ const b = g.variant || "contained";
1713
+ let w = g.defaultColor;
1689
1714
  if (((A = g == null ? void 0 : g.chipOptions) == null ? void 0 : A.length) > 0) {
1690
- let q = g == null ? void 0 : g.chipOptions.find((V) => V.value == t);
1691
- q && (D = q.label, v = q.color);
1715
+ let V = g == null ? void 0 : g.chipOptions.find((H) => H.value == t);
1716
+ V && (T = V.label, w = V.color);
1692
1717
  }
1693
1718
  return /* @__PURE__ */ e(
1694
1719
  Ke,
1695
1720
  {
1696
- label: D,
1697
- variant: p,
1698
- color: v,
1721
+ label: T,
1722
+ variant: b,
1723
+ color: w,
1699
1724
  className: g.className || ""
1700
1725
  }
1701
1726
  );
1702
- }, xe = (t, g, D) => {
1703
- const p = g[t.key];
1727
+ }, xe = (t, g, T) => {
1728
+ const b = g[t.key];
1704
1729
  return t.type === "menu_actions" ? /* @__PURE__ */ e("div", { className: `text-center ${t.className || ""}`, children: /* @__PURE__ */ e(
1705
1730
  "button",
1706
1731
  {
1707
- ref: (v) => oe.current[g.id || g._id] = v,
1708
- onClick: (v) => be(g.id || g._id, v, t.menuList),
1732
+ ref: (w) => oe.current[g.id || g._id] = w,
1733
+ onClick: (w) => pe(g.id || g._id, w, t.menuList),
1709
1734
  className: "p-2 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-full transition text-gray-700 dark:text-gray-300",
1710
- children: /* @__PURE__ */ e(Qe, { className: "h-4 w-4" })
1735
+ children: /* @__PURE__ */ e(Xe, { className: "h-4 w-4" })
1711
1736
  }
1712
- ) }) : t.type === "index" ? /* @__PURE__ */ e("span", { className: t.className || "", children: pe(D) }) : t.type === "group" ? fe(g, t) : t.type === "chip" ? /* @__PURE__ */ e(E, { children: ye(p, t) }) : t.type === "date" ? /* @__PURE__ */ e("span", { className: t.className || "", children: je(p, t.format || "DD MMM YYYY") }) : t.type === "avatar" ? /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e("div", { className: "min-w-[40px]", children: ie(
1713
- p,
1737
+ ) }) : t.type === "index" ? /* @__PURE__ */ e("span", { className: t.className || "", children: be(T) }) : t.type === "group" ? fe(g, t) : t.type === "chip" ? /* @__PURE__ */ e($, { children: ye(b, t) }) : t.type === "date" ? /* @__PURE__ */ e("span", { className: t.className || "", children: je(b, t.format || "DD MMM YYYY") }) : t.type === "avatar" ? /* @__PURE__ */ e($, { children: /* @__PURE__ */ e("div", { className: "min-w-[40px]", children: ie(
1738
+ b,
1714
1739
  t.alt,
1715
1740
  t.className,
1716
1741
  t.fallback_icon,
1717
1742
  g
1718
- ) }) }) : t.type === "audio" ? /* @__PURE__ */ e(E, { children: me(p, t.className) }) : /* @__PURE__ */ e("span", { className: t.className || "", children: p || "N/A" });
1743
+ ) }) }) : t.type === "audio" ? /* @__PURE__ */ e($, { children: me(b, t.className) }) : /* @__PURE__ */ e("span", { className: t.className || "", children: b || "N/A" });
1719
1744
  }, ve = (t) => {
1720
1745
  if (typeof N == "function")
1721
1746
  return N(t);
1722
1747
  if (N)
1723
- return y == null ? void 0 : y("view", t);
1748
+ return v == null ? void 0 : v("view", t);
1724
1749
  }, we = (t, g) => {
1725
1750
  if (t.onClickDetails)
1726
- return y == null ? void 0 : y("view", g);
1751
+ return v == null ? void 0 : v("view", g);
1727
1752
  if (typeof t.handleClick == "function")
1728
1753
  return t.handleClick(g);
1729
1754
  }, se = () => N || typeof N == "function", de = (t) => t.onClickDetails || typeof t.handleClick == "function";
@@ -1747,54 +1772,54 @@ const sa = ({
1747
1772
  a.current_page
1748
1773
  ]), z(() => {
1749
1774
  ee(
1750
- a != null && a.useServerSidePagination ? a.total_records : K.length
1751
- ), K.length <= U * (_ - 1) && !(a != null && a.useServerSidePagination) && k((t) => t - 1 || 1);
1775
+ a != null && a.useServerSidePagination ? a.total_records : O.length
1776
+ ), O.length <= j * (_ - 1) && !(a != null && a.useServerSidePagination) && k((t) => t - 1 || 1);
1752
1777
  }, [
1753
- K.length,
1778
+ O.length,
1754
1779
  a.total_records,
1755
1780
  a == null ? void 0 : a.useServerSidePagination
1756
- ]), O ? /* @__PURE__ */ e(ua, { rows: 6, columns: 6 }) : /* @__PURE__ */ h(E, { children: [
1757
- /* @__PURE__ */ h("div", { className: "flex flex-col sm:flex-row sm:justify-between gap-4 mb-3", children: [
1758
- /* @__PURE__ */ h("div", { children: [
1759
- /* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: i }),
1760
- /* @__PURE__ */ e("p", { className: "text-md text-gray-600 dark:text-gray-400", children: d })
1781
+ ]), D ? /* @__PURE__ */ e(pa, { rows: 6, columns: 6 }) : /* @__PURE__ */ c($, { children: [
1782
+ /* @__PURE__ */ c("div", { className: "flex flex-col sm:flex-row sm:justify-between gap-4 mb-3", children: [
1783
+ /* @__PURE__ */ c("div", { children: [
1784
+ /* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: l }),
1785
+ /* @__PURE__ */ e("p", { className: "text-md text-gray-600 dark:text-gray-400", children: s })
1761
1786
  ] }),
1762
- /* @__PURE__ */ h("div", { className: "flex flex-col justify-end items-end gap-2", children: [
1763
- n && /* @__PURE__ */ h(
1787
+ /* @__PURE__ */ c("div", { className: "flex flex-col justify-end items-end gap-2", children: [
1788
+ n && /* @__PURE__ */ c(
1764
1789
  Q,
1765
1790
  {
1766
- onClick: () => l(!0),
1791
+ onClick: () => o(!0),
1767
1792
  variant: "contained",
1768
1793
  color: "primary",
1769
1794
  children: [
1770
- /* @__PURE__ */ e(We, { className: "w-4 h-4 mr-2" }),
1771
- o || "Add New"
1795
+ /* @__PURE__ */ e(qe, { className: "w-4 h-4 mr-2" }),
1796
+ i || "Add New"
1772
1797
  ]
1773
1798
  }
1774
1799
  ),
1775
- /* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
1776
- c.enabled && /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ h("div", { className: "relative min-w-[300px]", children: [
1800
+ /* @__PURE__ */ c("div", { className: "flex justify-end items-center gap-2", children: [
1801
+ d.enabled && /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ c("div", { className: "relative min-w-[300px]", children: [
1777
1802
  /* @__PURE__ */ e(Ae, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-300" }),
1778
1803
  /* @__PURE__ */ e(
1779
1804
  "input",
1780
1805
  {
1781
1806
  type: "text",
1782
- placeholder: c.placeholder || "Search...",
1783
- value: P,
1807
+ placeholder: d.placeholder || "Search...",
1808
+ value: I,
1784
1809
  onChange: (t) => he(t.target.value),
1785
1810
  className: "w-full h-[36px] pl-9 pr-4 py-3 text-sm border border-gray-300 dark:border-gray-600 rounded-md bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-300 dark:ring-blue-200 disabled:opacity-50"
1786
1811
  }
1787
1812
  )
1788
1813
  ] }) }),
1789
- x && m.enabled && /* @__PURE__ */ h(Q, { onClick: () => W(!0), variant: "contained", children: [
1790
- /* @__PURE__ */ e(qe, { className: "w-4 h-4 mr-2" }),
1814
+ x && f.enabled && /* @__PURE__ */ c(Q, { onClick: () => Y(!0), variant: "contained", children: [
1815
+ /* @__PURE__ */ e(Ze, { className: "w-4 h-4 mr-2" }),
1791
1816
  "Filters"
1792
1817
  ] })
1793
1818
  ] })
1794
1819
  ] })
1795
1820
  ] }),
1796
- /* @__PURE__ */ h("div", { className: "bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden border border-gray-200 dark:border-gray-700", children: [
1797
- /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ h("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [
1821
+ /* @__PURE__ */ c("div", { className: "bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden border border-gray-200 dark:border-gray-700", children: [
1822
+ /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ c("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [
1798
1823
  /* @__PURE__ */ e("thead", { className: "bg-gray-50 dark:bg-gray-700/60", children: /* @__PURE__ */ e("tr", { children: S.map((t) => /* @__PURE__ */ e(
1799
1824
  "th",
1800
1825
  {
@@ -1808,54 +1833,54 @@ const sa = ({
1808
1833
  {
1809
1834
  colSpan: S.length,
1810
1835
  className: "text-center py-10 text-gray-500 dark:text-gray-400",
1811
- children: f
1836
+ children: m
1812
1837
  }
1813
1838
  ) }) : ce.map((t, g) => /* @__PURE__ */ e(
1814
1839
  "tr",
1815
1840
  {
1816
1841
  className: `hover:bg-gray-50 dark:hover:bg-blue-800/10 transition ${se() ? "cursor-pointer" : ""}`,
1817
- onClick: (D) => {
1842
+ onClick: (T) => {
1818
1843
  se() && ve(t);
1819
1844
  },
1820
- children: S.map((D) => /* @__PURE__ */ e(
1845
+ children: S.map((T) => /* @__PURE__ */ e(
1821
1846
  "td",
1822
1847
  {
1823
- className: `px-6 py-4 text-sm text-gray-900 dark:text-gray-100 min-w-max ${D.type == "audio" ? "" : "max-w-[300px]"} truncate ${de(D) ? "cursor-pointer" : ""}`,
1824
- title: String(t[D.key] ?? ""),
1825
- onClick: (p) => {
1826
- de(D) && (p.stopPropagation(), p.preventDefault(), we(D, t));
1848
+ className: `px-6 py-4 text-sm text-gray-900 dark:text-gray-100 min-w-max ${T.type == "audio" ? "" : "max-w-[300px]"} truncate ${de(T) ? "cursor-pointer" : ""}`,
1849
+ title: String(t[T.key] ?? ""),
1850
+ onClick: (b) => {
1851
+ de(T) && (b.stopPropagation(), b.preventDefault(), we(T, t));
1827
1852
  },
1828
- children: D.render ? D.render(t, g) : xe(D, t, g)
1853
+ children: T.render ? T.render(t, g) : xe(T, t, g)
1829
1854
  },
1830
- D.key
1855
+ T.key
1831
1856
  ))
1832
1857
  },
1833
1858
  t.id || t._id || g
1834
1859
  )) })
1835
1860
  ] }) }),
1836
- (a == null ? void 0 : a.enabled) && K.length > 0 && /* @__PURE__ */ h("div", { className: " bg-gray-50 dark:bg-gray-700/60 px-6 py-3 flex flex-wrap items-center justify-between border-t border-gray-200 dark:border-gray-600 gap-3", children: [
1837
- /* @__PURE__ */ h("div", { className: "text-sm text-gray-700 dark:text-gray-300", children: [
1861
+ (a == null ? void 0 : a.enabled) && O.length > 0 && /* @__PURE__ */ c("div", { className: " bg-gray-50 dark:bg-gray-700/60 px-6 py-3 flex flex-wrap items-center justify-between border-t border-gray-200 dark:border-gray-600 gap-3", children: [
1862
+ /* @__PURE__ */ c("div", { className: "text-sm text-gray-700 dark:text-gray-300", children: [
1838
1863
  "Showing ",
1839
- (_ - 1) * U + 1,
1864
+ (_ - 1) * j + 1,
1840
1865
  " to",
1841
1866
  " ",
1842
- Math.min(_ * U, J),
1867
+ Math.min(_ * j, J),
1843
1868
  " of ",
1844
1869
  J,
1845
1870
  " ",
1846
1871
  "results"
1847
1872
  ] }),
1848
- /* @__PURE__ */ h("div", { className: "flex items-center gap-4", children: [
1849
- /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1873
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-4", children: [
1874
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
1850
1875
  /* @__PURE__ */ e("span", { className: "text-sm text-gray-700 dark:text-gray-300", children: "Rows per page:" }),
1851
1876
  /* @__PURE__ */ e(
1852
1877
  "select",
1853
1878
  {
1854
- value: U,
1879
+ value: j,
1855
1880
  onChange: (t) => {
1856
1881
  const g = Number(t.target.value);
1857
- X(g), k(1), a.useServerSidePagination && s((D) => ({
1858
- ...D,
1882
+ X(g), k(1), a.useServerSidePagination && u((T) => ({
1883
+ ...T,
1859
1884
  current_page: 1,
1860
1885
  rows_per_page: g
1861
1886
  }));
@@ -1865,14 +1890,14 @@ const sa = ({
1865
1890
  }
1866
1891
  )
1867
1892
  ] }),
1868
- /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1893
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
1869
1894
  /* @__PURE__ */ e(
1870
1895
  "button",
1871
1896
  {
1872
1897
  onClick: () => {
1873
1898
  if (_ > 1) {
1874
1899
  const t = _ - 1;
1875
- k(t), a.useServerSidePagination && s((g) => ({
1900
+ k(t), a.useServerSidePagination && u((g) => ({
1876
1901
  ...g,
1877
1902
  current_page: t
1878
1903
  }));
@@ -1880,10 +1905,10 @@ const sa = ({
1880
1905
  },
1881
1906
  disabled: _ === 1,
1882
1907
  className: "p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md transition text-gray-500 dark:text-gray-300 disabled:opacity-50",
1883
- children: /* @__PURE__ */ e(Ze, { className: "h-4 w-4" })
1908
+ children: /* @__PURE__ */ e(Je, { className: "h-4 w-4" })
1884
1909
  }
1885
1910
  ),
1886
- /* @__PURE__ */ h("span", { className: "text-sm text-gray-800 dark:text-gray-200", children: [
1911
+ /* @__PURE__ */ c("span", { className: "text-sm text-gray-800 dark:text-gray-200", children: [
1887
1912
  "Page ",
1888
1913
  _,
1889
1914
  " of ",
@@ -1895,7 +1920,7 @@ const sa = ({
1895
1920
  onClick: () => {
1896
1921
  if (_ < ne) {
1897
1922
  const t = _ + 1;
1898
- k(t), a.useServerSidePagination && s((g) => ({
1923
+ k(t), a.useServerSidePagination && u((g) => ({
1899
1924
  ...g,
1900
1925
  current_page: t
1901
1926
  }));
@@ -1903,14 +1928,14 @@ const sa = ({
1903
1928
  },
1904
1929
  disabled: _ === ne,
1905
1930
  className: "p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md transition text-gray-500 dark:text-gray-300 disabled:opacity-50",
1906
- children: /* @__PURE__ */ e(Je, { className: "h-4 w-4" })
1931
+ children: /* @__PURE__ */ e(Qe, { className: "h-4 w-4" })
1907
1932
  }
1908
1933
  )
1909
1934
  ] })
1910
1935
  ] })
1911
1936
  ] })
1912
1937
  ] }),
1913
- M && ea(
1938
+ M && aa(
1914
1939
  /* @__PURE__ */ e(
1915
1940
  "div",
1916
1941
  {
@@ -1922,15 +1947,15 @@ const sa = ({
1922
1947
  zIndex: 9999
1923
1948
  },
1924
1949
  className: "w-48 bg-white dark:bg-gray-700 rounded-md shadow-lg border border-gray-200 dark:border-gray-600",
1925
- children: B.map((t, g) => /* @__PURE__ */ h(
1950
+ children: B.map((t, g) => /* @__PURE__ */ c(
1926
1951
  "button",
1927
1952
  {
1928
- onClick: (D) => ue(
1953
+ onClick: (T) => ue(
1929
1954
  t,
1930
- b.find(
1931
- (p) => p.id === M || p._id == M
1955
+ p.find(
1956
+ (b) => b.id === M || b._id == M
1932
1957
  ),
1933
- D
1958
+ T
1934
1959
  ),
1935
1960
  className: `w-full flex items-center gap-2 px-4 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-gray-600 ${t.variant === "danger" ? "text-red-600 dark:text-red-500" : "text-gray-700 dark:text-gray-200"}`,
1936
1961
  children: [
@@ -1945,45 +1970,45 @@ const sa = ({
1945
1970
  document.body
1946
1971
  ),
1947
1972
  x && /* @__PURE__ */ e(
1948
- ha,
1973
+ ua,
1949
1974
  {
1950
1975
  isOpen: G,
1951
- onClose: () => W(!1),
1976
+ onClose: () => Y(!1),
1952
1977
  config: x,
1953
- onApply: w
1978
+ onApply: y
1954
1979
  }
1955
1980
  ),
1956
- Y && /* @__PURE__ */ e(
1981
+ K && /* @__PURE__ */ e(
1957
1982
  _e,
1958
1983
  {
1959
- src: $.src,
1960
- alt: $.alt,
1961
- isOpen: Y,
1962
- setIsOpen: I
1984
+ src: W.src,
1985
+ alt: W.alt,
1986
+ isOpen: K,
1987
+ setIsOpen: Z
1963
1988
  }
1964
1989
  )
1965
1990
  ] });
1966
1991
  }, Ne = ({
1967
- isOpen: u,
1968
- onClose: l,
1969
- icon: i,
1970
- title: o,
1971
- children: d,
1992
+ isOpen: h,
1993
+ onClose: o,
1994
+ icon: l,
1995
+ title: i,
1996
+ children: s,
1972
1997
  size: n = "md",
1973
- actionButtons: b = [],
1998
+ actionButtons: p = [],
1974
1999
  actions: S,
1975
- showDefaultClose: O = !0,
1976
- footerConfig: c = null,
1977
- hideFooter: m = !1,
2000
+ showDefaultClose: D = !0,
2001
+ footerConfig: d = null,
2002
+ hideFooter: f = !1,
1978
2003
  onFormSubmit: a = () => {
1979
2004
  },
1980
- onCancel: f,
1981
- loadingBtn: y = !1,
1982
- executeFunction: s = () => {
2005
+ onCancel: m,
2006
+ loadingBtn: v = !1,
2007
+ executeFunction: u = () => {
1983
2008
  },
1984
- selectedItem: w = null
2009
+ selectedItem: y = null
1985
2010
  }) => {
1986
- if (!u) return null;
2011
+ if (!h) return null;
1987
2012
  const x = {
1988
2013
  sm: "max-w-md",
1989
2014
  md: "max-w-lg",
@@ -1991,52 +2016,52 @@ const sa = ({
1991
2016
  xl: "max-w-4xl",
1992
2017
  full: "max-w-full"
1993
2018
  };
1994
- return /* @__PURE__ */ h("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
2019
+ return /* @__PURE__ */ c("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1995
2020
  /* @__PURE__ */ e(
1996
2021
  "div",
1997
2022
  {
1998
2023
  className: "fixed inset-0 bg-gray-500 opacity-75",
1999
- onClick: () => l()
2024
+ onClick: () => o()
2000
2025
  }
2001
2026
  ),
2002
- /* @__PURE__ */ h(
2027
+ /* @__PURE__ */ c(
2003
2028
  "div",
2004
2029
  {
2005
2030
  className: `relative bg-white rounded-lg shadow-xl w-full ${x[n] || x.md} max-h-[90vh] flex flex-col dark:bg-gray-800`,
2006
2031
  children: [
2007
- /* @__PURE__ */ h("div", { className: "flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0", children: [
2008
- /* @__PURE__ */ h("div", { className: "flex items-center gap-1", children: [
2009
- i && /* @__PURE__ */ e("span", { children: i }),
2010
- /* @__PURE__ */ e("h3", { className: "text-lg font-medium text-gray-900 dark:text-white", children: o })
2032
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0", children: [
2033
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
2034
+ l && /* @__PURE__ */ e("span", { children: l }),
2035
+ /* @__PURE__ */ e("h3", { className: "text-lg font-medium text-gray-900 dark:text-white", children: i })
2011
2036
  ] }),
2012
2037
  /* @__PURE__ */ e(
2013
2038
  "button",
2014
2039
  {
2015
- onClick: () => l(),
2040
+ onClick: () => o(),
2016
2041
  className: "text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",
2017
2042
  children: /* @__PURE__ */ e(Se, { className: "w-6 h-6" })
2018
2043
  }
2019
2044
  )
2020
2045
  ] }),
2021
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: d }),
2022
- b.length > 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 flex justify-end gap-3 border-t border-gray-200 dark:border-gray-700 sm:px-6", children: b.map((N) => /* @__PURE__ */ e(
2046
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: s }),
2047
+ p.length > 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 flex justify-end gap-3 border-t border-gray-200 dark:border-gray-700 sm:px-6", children: p.map((N) => /* @__PURE__ */ e(
2023
2048
  Q,
2024
2049
  {
2025
- onClick: (P) => {
2026
- N.type == "submit" ? a(P) : s(
2050
+ onClick: (I) => {
2051
+ N.type == "submit" ? a(I) : u(
2027
2052
  () => {
2028
- var F;
2029
- return (F = N == null ? void 0 : N.onClick) == null ? void 0 : F.call(N, P, w);
2053
+ var P;
2054
+ return (P = N == null ? void 0 : N.onClick) == null ? void 0 : P.call(N, I, y);
2030
2055
  },
2031
- (F) => l == null ? void 0 : l(F)
2056
+ (P) => o == null ? void 0 : o(P)
2032
2057
  );
2033
2058
  },
2034
- disabled: y || N.disabled,
2059
+ disabled: v || N.disabled,
2035
2060
  variant: N.variant || "contained",
2036
2061
  color: N.color || "primary",
2037
2062
  className: `min-w-[100px] ${N.className}`,
2038
2063
  type: N.type || "button",
2039
- children: y ? /* @__PURE__ */ h("div", { className: "flex items-center", children: [
2064
+ children: v ? /* @__PURE__ */ c("div", { className: "flex items-center", children: [
2040
2065
  /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-white/30 border-t-2 border-t-white mr-2" }),
2041
2066
  N.label || "Submit",
2042
2067
  "..."
@@ -2047,230 +2072,230 @@ const sa = ({
2047
2072
  }
2048
2073
  )
2049
2074
  ] });
2050
- }, Ie = ({ config: u, onSubmit: l, initialData: i = {}, type: o = "add" }) => {
2051
- const { formClass: d = "grid grid-cols-12 gap-4", formFields: n = [] } = u || {}, [b, S] = R(i);
2075
+ }, Ie = ({ config: h, onSubmit: o, initialData: l = {}, type: i = "add" }) => {
2076
+ const { formClass: s = "grid grid-cols-12 gap-4", formFields: n = [] } = h || {}, [p, S] = R(l);
2052
2077
  z(() => {
2053
- S(i);
2078
+ S(l);
2054
2079
  }, []);
2055
- const O = (m, a) => {
2056
- S((f) => ({ ...f, [m]: a }));
2057
- }, c = (m) => {
2058
- m.preventDefault();
2059
- const a = m.target;
2080
+ const D = (f, a) => {
2081
+ S((m) => ({ ...m, [f]: a }));
2082
+ }, d = (f) => {
2083
+ f.preventDefault();
2084
+ const a = f.target;
2060
2085
  if (!a.checkValidity()) {
2061
2086
  a.reportValidity();
2062
2087
  return;
2063
2088
  }
2064
- l(b);
2089
+ o(p);
2065
2090
  };
2066
2091
  return /* @__PURE__ */ e(
2067
2092
  "form",
2068
2093
  {
2069
- id: o == "add" ? "addForm" : o == "edit" ? "editForm" : "defaultForm",
2070
- onSubmit: c,
2071
- className: d,
2094
+ id: i == "add" ? "addForm" : i == "edit" ? "editForm" : "defaultForm",
2095
+ onSubmit: d,
2096
+ className: s,
2072
2097
  noValidate: !1,
2073
- children: n.map((m) => /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
2098
+ children: n.map((f) => /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
2074
2099
  Ge,
2075
2100
  {
2076
- field: m,
2077
- formData: b,
2078
- handleChange: O
2101
+ field: f,
2102
+ formData: p,
2103
+ handleChange: D
2079
2104
  },
2080
- m.key
2105
+ f.key
2081
2106
  ) }))
2082
2107
  }
2083
2108
  );
2084
2109
  };
2085
- function pa({ data: u, config: l }) {
2086
- const { fields: i, containerClass: o } = l, [d, n] = R(null), [b, S] = R(!1), O = (a) => {
2110
+ function ga({ data: h, config: o }) {
2111
+ const { fields: l, containerClass: i } = o, [s, n] = R(null), [p, S] = R(!1), D = (a) => {
2087
2112
  a && a.src instanceof File && (a = { ...a, src: URL.createObjectURL(a.src) }), n(a), S(!0);
2088
- }, c = ({ col: a }) => {
2089
- var P;
2090
- let f = a == null ? void 0 : a.icon, y = a.label, s = u[a.key], w = a.type, x = a.variant || "outline", N = a.defaultColor;
2091
- if (w === "chip" && ((P = a.chipOptions) == null ? void 0 : P.length) > 0) {
2092
- let F = a == null ? void 0 : a.chipOptions.find((M) => M.value == s);
2093
- F && (s = F.label, N = F.color);
2113
+ }, d = ({ col: a }) => {
2114
+ var I;
2115
+ let m = a == null ? void 0 : a.icon, v = a.label, u = h[a.key], y = a.type, x = a.variant || "outline", N = a.defaultColor;
2116
+ if (y === "chip" && ((I = a.chipOptions) == null ? void 0 : I.length) > 0) {
2117
+ let P = a == null ? void 0 : a.chipOptions.find((M) => M.value == u);
2118
+ P && (u = P.label, N = P.color);
2094
2119
  }
2095
- return /* @__PURE__ */ h(
2120
+ return /* @__PURE__ */ c(
2096
2121
  "div",
2097
2122
  {
2098
2123
  className: `col-span-12 flex items-center space-x-4 p-4 rounded-xl
2099
2124
  bg-gray-100 dark:bg-gray-900 ${a.blockClass || ""}`,
2100
2125
  children: [
2101
- f && /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: f }),
2102
- /* @__PURE__ */ h("div", { className: "flex-1 min-w-0", children: [
2103
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: y }),
2104
- w === "chip" ? /* @__PURE__ */ e(
2126
+ m && /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: m }),
2127
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
2128
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: v }),
2129
+ y === "chip" ? /* @__PURE__ */ e(
2105
2130
  Ke,
2106
2131
  {
2107
- label: s,
2132
+ label: u,
2108
2133
  variant: x,
2109
2134
  color: N,
2110
2135
  className: "mt-1"
2111
2136
  }
2112
2137
  ) : (
2113
2138
  /* TINY EDITOR */
2114
- w === "tinyEditor" ? /* @__PURE__ */ e(
2139
+ y === "tinyEditor" ? /* @__PURE__ */ e(
2115
2140
  "p",
2116
2141
  {
2117
2142
  className: "mt-1 text-sm text-gray-900 dark:text-white break-words",
2118
2143
  dangerouslySetInnerHTML: {
2119
- __html: s
2144
+ __html: u
2120
2145
  }
2121
2146
  }
2122
- ) : w === "audio" ? s ? /* @__PURE__ */ e(
2147
+ ) : y === "audio" ? u ? /* @__PURE__ */ e(
2123
2148
  "audio",
2124
2149
  {
2125
2150
  controls: !0,
2126
- src: s instanceof File ? URL.createObjectURL(s) : s,
2127
- onClick: (F) => F.stopPropagation(),
2151
+ src: u instanceof File ? URL.createObjectURL(u) : u,
2152
+ onClick: (P) => P.stopPropagation(),
2128
2153
  className: "shadow-md rounded-full mt-1"
2129
2154
  },
2130
- s instanceof File ? URL.createObjectURL(s) : s
2155
+ u instanceof File ? URL.createObjectURL(u) : u
2131
2156
  ) : /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-400", children: "N/A" }) : (
2132
2157
  /* DEFAULT */
2133
- /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-900 dark:text-white break-words", children: w == "date" ? /* @__PURE__ */ e("span", { children: je(s, a.format || "DD MMM YYYY") }) : s || "N/A" })
2158
+ /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-900 dark:text-white break-words", children: y == "date" ? /* @__PURE__ */ e("span", { children: je(u, a.format || "DD MMM YYYY") }) : u || "N/A" })
2134
2159
  )
2135
2160
  )
2136
2161
  ] })
2137
2162
  ]
2138
2163
  }
2139
2164
  );
2140
- }, m = ({ col: a }) => {
2141
- let f = u[a.titleKey], y = u[a.subtitleKey], s = u[a.imageKey], w = a.fallback_icon;
2142
- return /* @__PURE__ */ h(
2165
+ }, f = ({ col: a }) => {
2166
+ let m = h[a.titleKey], v = h[a.subtitleKey], u = h[a.imageKey], y = a.fallback_icon;
2167
+ return /* @__PURE__ */ c(
2143
2168
  "div",
2144
2169
  {
2145
2170
  className: `col-span-12 flex items-center space-x-4 p-4 rounded-xl
2146
2171
  bg-gray-100 dark:bg-gray-900
2147
2172
  ${a.blockClass}`,
2148
2173
  children: [
2149
- s ? /* @__PURE__ */ e(
2174
+ u ? /* @__PURE__ */ e(
2150
2175
  "img",
2151
2176
  {
2152
- src: s instanceof File ? URL.createObjectURL(s) : s,
2153
- alt: f,
2154
- onClick: () => O({ src: s, alt: f }),
2177
+ src: u instanceof File ? URL.createObjectURL(u) : u,
2178
+ alt: m,
2179
+ onClick: () => D({ src: u, alt: m }),
2155
2180
  className: "w-16 h-16 cursor-pointer rounded-full object-cover border-2 border-gray-200 dark:border-gray-700"
2156
2181
  }
2157
- ) : w ? w instanceof Function ? w(u) : w : /* @__PURE__ */ e("div", { className: "w-16 h-16 flex items-center justify-center rounded-full border-2 border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600", children: /* @__PURE__ */ e(Ue, { className: "w-8 h-8 text-gray-400" }) }),
2158
- /* @__PURE__ */ h("div", { children: [
2159
- /* @__PURE__ */ e("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: f }),
2160
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: y })
2182
+ ) : y ? y instanceof Function ? y(h) : y : /* @__PURE__ */ e("div", { className: "w-16 h-16 flex items-center justify-center rounded-full border-2 border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600", children: /* @__PURE__ */ e(Ue, { className: "w-8 h-8 text-gray-400" }) }),
2183
+ /* @__PURE__ */ c("div", { children: [
2184
+ /* @__PURE__ */ e("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: m }),
2185
+ /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: v })
2161
2186
  ] })
2162
2187
  ]
2163
2188
  }
2164
2189
  );
2165
2190
  };
2166
- return /* @__PURE__ */ h(E, { children: [
2167
- b && /* @__PURE__ */ e(
2191
+ return /* @__PURE__ */ c($, { children: [
2192
+ p && /* @__PURE__ */ e(
2168
2193
  _e,
2169
2194
  {
2170
- src: d.src,
2171
- alt: d.alt,
2172
- isOpen: b,
2195
+ src: s.src,
2196
+ alt: s.alt,
2197
+ isOpen: p,
2173
2198
  setIsOpen: S
2174
2199
  }
2175
2200
  ),
2176
- /* @__PURE__ */ e("div", { className: `grid grid-cols-12 gap-4 ${o || ""}`, children: i.map((a) => a.renderCondition && typeof a.renderCondition == "function" && !a.renderCondition(u) ? null : a.type == "group" ? /* @__PURE__ */ e(m, { col: a }) : /* @__PURE__ */ e(c, { col: a })) })
2201
+ /* @__PURE__ */ e("div", { className: `grid grid-cols-12 gap-4 ${i || ""}`, children: l.map((a) => a.renderCondition && typeof a.renderCondition == "function" && !a.renderCondition(h) ? null : a.type == "group" ? /* @__PURE__ */ e(f, { col: a }) : /* @__PURE__ */ e(d, { col: a })) })
2177
2202
  ] });
2178
2203
  }
2179
- const ze = ({ config: u }) => {
2180
- var oe, te, he, ue, be, pe, ge, ie, me, fe, ye, xe, ve, we, se, de, t, g, D;
2204
+ const ze = ({ config: h }) => {
2205
+ var oe, te, he, ue, pe, be, ge, ie, me, fe, ye, xe, ve, we, se, de, t, g, T;
2181
2206
  const {
2182
- title: l,
2183
- fetchData: i = async () => {
2207
+ title: o,
2208
+ fetchData: l = async () => {
2184
2209
  },
2185
- isStaticData: o = !1,
2186
- tableConfig: d = {},
2210
+ isStaticData: i = !1,
2211
+ tableConfig: s = {},
2187
2212
  modalConfig: n = {},
2188
- filterConfig: b
2189
- } = u, [S, O] = R(!0), [c, m] = R(!1), [a, f] = R([]), [y, s] = R(null), [w, x] = R({
2213
+ filterConfig: p
2214
+ } = h, [S, D] = R(!0), [d, f] = R(!1), [a, m] = R([]), [v, u] = R(null), [y, x] = R({
2190
2215
  search: "",
2191
2216
  rows_per_page: 50,
2192
2217
  current_page: 1
2193
- }), [N, P] = R({}), [F, M] = R(!1), [L, B] = R(!1), [T, C] = R(!1), [j, G] = R(!1), [W, $] = R(!1), [H, Y] = R(null), I = (p, v) => {
2194
- p === "edit" ? (Y(v), C(!0)) : p === "view" ? (Y(v), $(!0)) : p === "delete" && (Y(v), G(!0));
2195
- }, K = async (p, v, A = "", q = "") => {
2196
- m(!0);
2218
+ }), [N, I] = R({}), [P, M] = R(!1), [L, B] = R(!1), [F, C] = R(!1), [E, G] = R(!1), [Y, W] = R(!1), [U, K] = R(null), Z = (b, w) => {
2219
+ b === "edit" ? (K(w), C(!0)) : b === "view" ? (K(w), W(!0)) : b === "delete" && (K(w), G(!0));
2220
+ }, O = async (b, w, A = "", V = "") => {
2221
+ f(!0);
2197
2222
  try {
2198
- const V = await (p == null ? void 0 : p());
2199
- (A || V.message) && Me(A || V.message, {
2223
+ const H = await (b == null ? void 0 : b());
2224
+ (A || H.message) && Me(A || H.message, {
2200
2225
  variant: "success"
2201
- }), v == null || v(V);
2202
- } catch (V) {
2203
- (q || V.message) && Me(q || V.message, { variant: "error" });
2226
+ }), w == null || w(H);
2227
+ } catch (H) {
2228
+ (V || H.message) && Me(V || H.message, { variant: "error" });
2204
2229
  } finally {
2205
- m(!1);
2230
+ f(!1);
2206
2231
  }
2207
- }, _ = (p) => {
2208
- let v = p.newObject;
2209
- o ? (f((A) => [v, ...A]), s((A) => ({
2232
+ }, _ = (b) => {
2233
+ let w = b.newObject;
2234
+ i ? (m((A) => [w, ...A]), u((A) => ({
2210
2235
  ...A,
2211
2236
  current_page: 1
2212
2237
  }))) : (x((A) => ({
2213
2238
  ...A,
2214
2239
  current_page: 1
2215
- })), w.current_page == 1 && ee()), B(!1);
2216
- }, k = (p) => {
2217
- let v = p.newObject, A = p.targetObject;
2218
- o ? f(
2219
- (q) => q.map(
2220
- (V) => V.id === A.id ? { ...V, ...v } : V
2240
+ })), y.current_page == 1 && ee()), B(!1);
2241
+ }, k = (b) => {
2242
+ let w = b.newObject, A = b.targetObject;
2243
+ i ? m(
2244
+ (V) => V.map(
2245
+ (H) => H.id === A.id ? { ...H, ...w } : H
2221
2246
  )
2222
2247
  ) : ee(), C(!1);
2223
- }, U = (p) => {
2224
- if (!p) {
2225
- G(!1), Y(null);
2248
+ }, j = (b) => {
2249
+ if (!b) {
2250
+ G(!1), K(null);
2226
2251
  return;
2227
2252
  }
2228
- o ? f(
2229
- (v) => v.filter((A) => A.id !== p.targetObject.id)
2230
- ) : a.length == 1 && w.current_page > 1 ? x((v) => ({
2231
- ...v,
2232
- current_page: v.current_page - 1
2233
- })) : ee(), G(!1), Y(null);
2234
- }, X = (p) => K(
2253
+ i ? m(
2254
+ (w) => w.filter((A) => A.id !== b.targetObject.id)
2255
+ ) : a.length == 1 && y.current_page > 1 ? x((w) => ({
2256
+ ...w,
2257
+ current_page: w.current_page - 1
2258
+ })) : ee(), G(!1), K(null);
2259
+ }, X = (b) => O(
2235
2260
  () => {
2236
- var v, A;
2237
- return (A = (v = n == null ? void 0 : n.addModal) == null ? void 0 : v.handleSubmit) == null ? void 0 : A.call(v, p);
2261
+ var w, A;
2262
+ return (A = (w = n == null ? void 0 : n.addModal) == null ? void 0 : w.handleSubmit) == null ? void 0 : A.call(w, b);
2238
2263
  },
2239
2264
  _
2240
- ), J = (p) => K(
2265
+ ), J = (b) => O(
2241
2266
  () => {
2242
- var v, A;
2243
- return (A = (v = n == null ? void 0 : n.editModal) == null ? void 0 : v.handleSubmit) == null ? void 0 : A.call(v, p, H);
2267
+ var w, A;
2268
+ return (A = (w = n == null ? void 0 : n.editModal) == null ? void 0 : w.handleSubmit) == null ? void 0 : A.call(w, b, U);
2244
2269
  },
2245
2270
  k
2246
2271
  ), ee = async () => {
2247
- O(!0), i == null || i({ ...w, ...N }).then((p) => {
2248
- f(p.data), s(p.pagination);
2249
- }).catch((p) => {
2250
- Me(p.message, { variant: "error" });
2272
+ D(!0), l == null || l({ ...y, ...N }).then((b) => {
2273
+ m(b.data), u(b.pagination);
2274
+ }).catch((b) => {
2275
+ Me(b.message, { variant: "error" });
2251
2276
  }).finally(() => {
2252
- O(!1);
2277
+ D(!1);
2253
2278
  });
2254
- }, ne = (p) => {
2255
- var v;
2256
- P((A) => ({
2257
- ...p
2258
- })), (v = d == null ? void 0 : d.filter) != null && v.useServerSideFilters && M((A) => !A);
2259
- }, ce = (p, v) => p.filter(
2260
- (A) => Object.entries(v).every(([q, V]) => A[q] === V)
2279
+ }, ne = (b) => {
2280
+ var w;
2281
+ I((A) => ({
2282
+ ...b
2283
+ })), (w = s == null ? void 0 : s.filter) != null && w.useServerSideFilters && M((A) => !A);
2284
+ }, ce = (b, w) => b.filter(
2285
+ (A) => Object.entries(w).every(([V, H]) => A[V] === H)
2261
2286
  ), le = Le(() => {
2262
- var p;
2263
- return (p = d == null ? void 0 : d.filter) != null && p.useServerSideFilters ? a : ce(a, N);
2287
+ var b;
2288
+ return (b = s == null ? void 0 : s.filter) != null && b.useServerSideFilters ? a : ce(a, N);
2264
2289
  }, [a, N]);
2265
2290
  return z(() => {
2266
2291
  ee();
2267
2292
  }, [
2268
- w.search,
2269
- w.rows_per_page,
2270
- w.current_page,
2271
- F
2293
+ y.search,
2294
+ y.rows_per_page,
2295
+ y.current_page,
2296
+ P
2272
2297
  ]), /* @__PURE__ */ e(
2273
- ta,
2298
+ ra,
2274
2299
  {
2275
2300
  maxSnack: 3,
2276
2301
  anchorOrigin: {
@@ -2278,37 +2303,37 @@ const ze = ({ config: u }) => {
2278
2303
  horizontal: "right"
2279
2304
  },
2280
2305
  autoHideDuration: 3e3,
2281
- action: (p) => /* @__PURE__ */ e(
2306
+ action: (b) => /* @__PURE__ */ e(
2282
2307
  "button",
2283
2308
  {
2284
2309
  onClick: () => {
2285
2310
  window.dispatchEvent(
2286
- new CustomEvent("closeSnackbar", { detail: p })
2311
+ new CustomEvent("closeSnackbar", { detail: b })
2287
2312
  );
2288
2313
  },
2289
2314
  className: "p-1 hover:bg-white/20 rounded-full transition-colors duration-200 text-white flex items-center justify-center",
2290
2315
  children: /* @__PURE__ */ e(Se, { className: "h-4 w-4" })
2291
2316
  }
2292
2317
  ),
2293
- children: /* @__PURE__ */ h("div", { children: [
2318
+ children: /* @__PURE__ */ c("div", { children: [
2294
2319
  /* @__PURE__ */ e(
2295
2320
  ba,
2296
2321
  {
2297
- title: l,
2322
+ title: o,
2298
2323
  setShowAdd: B,
2299
- description: u.description,
2300
- buttonText: u.buttonText,
2324
+ description: h.description,
2325
+ buttonText: h.buttonText,
2301
2326
  showAddButton: !!n.addModal,
2302
2327
  config: {
2303
- ...d,
2328
+ ...s,
2304
2329
  pagination: {
2305
- ...d.pagination,
2306
- ...y
2330
+ ...s.pagination,
2331
+ ...v
2307
2332
  },
2308
2333
  data: le,
2309
2334
  setServerSidePaginationData: x,
2310
- onMenuAction: I,
2311
- filterConfig: b,
2335
+ onMenuAction: Z,
2336
+ filterConfig: p,
2312
2337
  onFilterApply: ne,
2313
2338
  loading: S
2314
2339
  }
@@ -2319,16 +2344,16 @@ const ze = ({ config: u }) => {
2319
2344
  {
2320
2345
  isOpen: L,
2321
2346
  onClose: () => {
2322
- c || B(!1);
2347
+ d || B(!1);
2323
2348
  },
2324
2349
  icon: (oe = n.addModal) == null ? void 0 : oe.icon,
2325
2350
  title: ((te = n.addModal) == null ? void 0 : te.title) || "Add New",
2326
2351
  size: ((he = n.addModal) == null ? void 0 : he.size) || "md",
2327
2352
  onFormSubmit: () => {
2328
- var p;
2329
- return (p = document.querySelector("#addForm")) == null ? void 0 : p.requestSubmit();
2353
+ var b;
2354
+ return (b = document.querySelector("#addForm")) == null ? void 0 : b.requestSubmit();
2330
2355
  },
2331
- loadingBtn: c,
2356
+ loadingBtn: d,
2332
2357
  actionButtons: ((ue = n == null ? void 0 : n.addModal) == null ? void 0 : ue.actionButtons) || [],
2333
2358
  children: /* @__PURE__ */ e(
2334
2359
  Ie,
@@ -2337,7 +2362,7 @@ const ze = ({ config: u }) => {
2337
2362
  onSubmit: X,
2338
2363
  initialData: {},
2339
2364
  type: "add",
2340
- loading: c
2365
+ loading: d
2341
2366
  }
2342
2367
  )
2343
2368
  }
@@ -2345,66 +2370,66 @@ const ze = ({ config: u }) => {
2345
2370
  /* @__PURE__ */ e(
2346
2371
  Ne,
2347
2372
  {
2348
- isOpen: T,
2373
+ isOpen: F,
2349
2374
  onClose: () => {
2350
- c || C(!1);
2375
+ d || C(!1);
2351
2376
  },
2352
- icon: (be = n.editModal) == null ? void 0 : be.icon,
2353
- title: ((pe = n.editModal) == null ? void 0 : pe.title) || "Edit",
2377
+ icon: (pe = n.editModal) == null ? void 0 : pe.icon,
2378
+ title: ((be = n.editModal) == null ? void 0 : be.title) || "Edit",
2354
2379
  size: ((ge = n.editModal) == null ? void 0 : ge.size) || "md",
2355
2380
  onFormSubmit: () => {
2356
- var p;
2357
- return (p = document.querySelector("#editForm")) == null ? void 0 : p.requestSubmit();
2381
+ var b;
2382
+ return (b = document.querySelector("#editForm")) == null ? void 0 : b.requestSubmit();
2358
2383
  },
2359
2384
  actionButtons: ((ie = n == null ? void 0 : n.editModal) == null ? void 0 : ie.actionButtons) || [],
2360
- loadingBtn: c,
2385
+ loadingBtn: d,
2361
2386
  children: /* @__PURE__ */ e(
2362
2387
  Ie,
2363
2388
  {
2364
2389
  config: n.editModal || {},
2365
2390
  onSubmit: J,
2366
- initialData: H,
2391
+ initialData: U,
2367
2392
  type: "edit",
2368
- loading: c
2393
+ loading: d
2369
2394
  }
2370
2395
  )
2371
2396
  }
2372
2397
  ),
2373
- j && /* @__PURE__ */ e(
2398
+ E && /* @__PURE__ */ e(
2374
2399
  Ne,
2375
2400
  {
2376
- isOpen: j,
2377
- onClose: (p) => {
2378
- U(p);
2401
+ isOpen: E,
2402
+ onClose: (b) => {
2403
+ j(b);
2379
2404
  },
2380
2405
  icon: ((me = n.deleteModal) == null ? void 0 : me.icon) || /* @__PURE__ */ e(re, { icon: "ph:warning-bold", className: "w-6 h-6 text-red-500" }),
2381
2406
  title: ((fe = n.deleteModal) == null ? void 0 : fe.title) || "Confirm Delete",
2382
2407
  size: ((ye = n.deleteModal) == null ? void 0 : ye.size) || "md",
2383
- loading: c,
2408
+ loading: d,
2384
2409
  actionButtons: ((xe = n == null ? void 0 : n.deleteModal) == null ? void 0 : xe.actionButtons) || [],
2385
- executeFunction: K,
2386
- selectedItem: H,
2387
- children: /* @__PURE__ */ e("div", { className: "flex items-center space-x-2 py-3", children: /* @__PURE__ */ h("div", { children: [
2410
+ executeFunction: O,
2411
+ selectedItem: U,
2412
+ children: /* @__PURE__ */ e("div", { className: "flex items-center space-x-2 py-3", children: /* @__PURE__ */ c("div", { children: [
2388
2413
  /* @__PURE__ */ e("p", { className: "text-md text-gray-700 dark:text-white", children: ((ve = n.deleteModal) == null ? void 0 : ve.confirmText) || "Are you sure you want to delete this item?" }),
2389
- ((we = n.deleteModal) == null ? void 0 : we.referenceKey) && /* @__PURE__ */ e("p", { className: "text-md font-semibold text-gray-700 dark:text-white", children: H[(se = n.deleteModal) == null ? void 0 : se.referenceKey] })
2414
+ ((we = n.deleteModal) == null ? void 0 : we.referenceKey) && /* @__PURE__ */ e("p", { className: "text-md font-semibold text-gray-700 dark:text-white", children: U[(se = n.deleteModal) == null ? void 0 : se.referenceKey] })
2390
2415
  ] }) })
2391
2416
  }
2392
2417
  ),
2393
2418
  n.viewModal && /* @__PURE__ */ e(
2394
2419
  Ne,
2395
2420
  {
2396
- isOpen: W,
2421
+ isOpen: Y,
2397
2422
  onClose: () => {
2398
- $(!1), Y(null);
2423
+ W(!1), K(null);
2399
2424
  },
2400
2425
  icon: (de = n.viewModal) == null ? void 0 : de.icon,
2401
2426
  title: ((t = n.viewModal) == null ? void 0 : t.title) || "View Details",
2402
2427
  size: ((g = n.viewModal) == null ? void 0 : g.size) || "lg",
2403
2428
  footerConfig: n == null ? void 0 : n.viewModal.footer,
2404
- children: (D = n.viewModal) != null && D.component ? /* @__PURE__ */ e(n.viewModal.component, { data: H }) : /* @__PURE__ */ e(
2405
- pa,
2429
+ children: (T = n.viewModal) != null && T.component ? /* @__PURE__ */ e(n.viewModal.component, { data: U }) : /* @__PURE__ */ e(
2430
+ ga,
2406
2431
  {
2407
- data: H,
2432
+ data: U,
2408
2433
  config: n.viewModal || {}
2409
2434
  }
2410
2435
  )
@@ -2427,12 +2452,12 @@ const ze = ({ config: u }) => {
2427
2452
  color: r.string,
2428
2453
  variant: r.string,
2429
2454
  onClick: r.func
2430
- }), ga = r.shape({
2455
+ }), ma = r.shape({
2431
2456
  title: r.string.isRequired,
2432
2457
  type: r.string.isRequired,
2433
2458
  variant: r.string,
2434
2459
  icon: r.node
2435
- }), ma = r.shape({
2460
+ }), fa = r.shape({
2436
2461
  key: r.string.isRequired,
2437
2462
  title: r.string,
2438
2463
  type: r.string,
@@ -2445,7 +2470,7 @@ const ze = ({ config: u }) => {
2445
2470
  defaultColor: r.string,
2446
2471
  className: r.string,
2447
2472
  format: r.string,
2448
- menuList: r.arrayOf(ga)
2473
+ menuList: r.arrayOf(ma)
2449
2474
  }), Re = r.shape({
2450
2475
  key: r.string.isRequired,
2451
2476
  label: r.string,
@@ -2464,7 +2489,7 @@ const ze = ({ config: u }) => {
2464
2489
  text: r.string,
2465
2490
  editorKey: r.string,
2466
2491
  options: r.arrayOf(De)
2467
- }), fa = r.shape({
2492
+ }), ya = r.shape({
2468
2493
  key: r.string,
2469
2494
  label: r.string,
2470
2495
  type: r.string,
@@ -2488,7 +2513,7 @@ ze.propTypes = {
2488
2513
  isStaticData: r.bool,
2489
2514
  /* ================= TABLE CONFIG ================= */
2490
2515
  tableConfig: r.shape({
2491
- table_head: r.arrayOf(ma).isRequired,
2516
+ table_head: r.arrayOf(fa).isRequired,
2492
2517
  search: r.shape({
2493
2518
  enabled: r.bool,
2494
2519
  useServerSideSearch: r.bool,
@@ -2534,7 +2559,7 @@ ze.propTypes = {
2534
2559
  // 👇 This covers your commented code:
2535
2560
  component: r.elementType,
2536
2561
  // for custom component like TeamMemberDetail
2537
- fields: r.arrayOf(fa),
2562
+ fields: r.arrayOf(ya),
2538
2563
  footer: r.shape({
2539
2564
  cancelButton: r.bool,
2540
2565
  cancelText: r.string
@@ -2547,11 +2572,11 @@ ze.propTypes = {
2547
2572
  })
2548
2573
  }).isRequired
2549
2574
  };
2550
- const ya = () => {
2575
+ const xa = () => {
2551
2576
  if (typeof document > "u" || document.getElementById("react-admin-crud-manager-styles")) return;
2552
- const u = document.createElement("style");
2553
- u.id = "react-admin-crud-manager-styles";
2554
- const l = `
2577
+ const h = document.createElement("style");
2578
+ h.id = "react-admin-crud-manager-styles";
2579
+ const o = `
2555
2580
  .no-spinner::-webkit-outer-spin-button,
2556
2581
  .no-spinner::-webkit-inner-spin-button {
2557
2582
  -webkit-appearance: none;
@@ -2567,14 +2592,14 @@ const ya = () => {
2567
2592
  box-shadow: none !important;
2568
2593
  }
2569
2594
  `;
2570
- u.textContent = l, document.head.appendChild(u);
2595
+ h.textContent = o, document.head.appendChild(h);
2571
2596
  };
2572
- function Oa(u) {
2597
+ function Aa(h) {
2573
2598
  return z(() => {
2574
- ya();
2575
- }, []), /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(ze, { config: u.config }) });
2599
+ xa();
2600
+ }, []), /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(ze, { config: h.config }) });
2576
2601
  }
2577
2602
  export {
2578
- Oa as default
2603
+ Aa as default
2579
2604
  };
2580
2605
  //# sourceMappingURL=index.es.js.map