react-admin-crud-manager 1.0.10 → 1.0.12

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