@kareemelbalshe/any-table 1.0.0 → 1.0.1

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.js CHANGED
@@ -1,135 +1,135 @@
1
- import { jsx as s, jsxs as b, Fragment as Se } from "react/jsx-runtime";
2
- import Nt, { useMemo as O, useState as v, useEffect as ye, useCallback as w, useRef as wt, useImperativeHandle as vt, createContext as At, useContext as Ct } from "react";
3
- function S(e, t, n = void 0) {
4
- if (e == null) return n;
1
+ import { jsx as n, jsxs as h, Fragment as Ce } from "react/jsx-runtime";
2
+ import Xe, { useMemo as W, useState as S, useEffect as be, useCallback as A, useRef as $t, useImperativeHandle as Dt, createContext as Ft, useContext as Qe } from "react";
3
+ function P(e, t, s = void 0) {
4
+ if (e == null) return s;
5
5
  if (!t || typeof t != "string") return e;
6
6
  if (t in e && e[t] !== void 0)
7
7
  return e[t];
8
8
  const l = t.replace(/\[(\w+)\]/g, ".$1").split(".");
9
- let a = e;
9
+ let r = e;
10
10
  for (let i = 0; i < l.length; i++) {
11
11
  const g = l[i];
12
- if (a == null)
13
- return n;
14
- a = a[g];
12
+ if (r == null)
13
+ return s;
14
+ r = r[g];
15
15
  }
16
- return a !== void 0 ? a : n;
16
+ return r !== void 0 ? r : s;
17
17
  }
18
- function St(e) {
18
+ function Mt(e) {
19
19
  return e !== null && typeof e == "object" && !Array.isArray(e);
20
20
  }
21
- function fe(e) {
21
+ function ue(e) {
22
22
  if (!e || typeof e != "string") return "";
23
23
  let t = e.replace(/[._\-]+/g, " ");
24
- return t = t.replace(/([a-z])([A-Z])/g, "$1 $2"), t.split(" ").filter(Boolean).map((n) => {
25
- const o = n.toLowerCase();
26
- return n.length <= 3 && n === n.toUpperCase() ? n : o.charAt(0).toUpperCase() + o.slice(1);
24
+ return t = t.replace(/([a-z])([A-Z])/g, "$1 $2"), t.split(" ").filter(Boolean).map((s) => {
25
+ const o = s.toLowerCase();
26
+ return s.length <= 3 && s === s.toUpperCase() ? s : o.charAt(0).toUpperCase() + o.slice(1);
27
27
  }).join(" ");
28
28
  }
29
- const Tt = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg", ".bmp", ".avif"], Pt = ["image", "avatar", "photo", "logo", "picture", "thumbnail", "banner", "img", "icon"], Et = ["price", "spend", "cost", "amount", "total", "fee", "rate", "salary", "balance", "deposit", "commission", "charge"], $t = ["status", "state", "phase", "condition"];
30
- function be(e, t) {
31
- const n = e.toLowerCase();
32
- if (Pt.some((a) => n.includes(a)))
29
+ const _t = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg", ".bmp", ".avif"], jt = ["image", "avatar", "photo", "logo", "picture", "thumbnail", "banner", "img", "icon"], Wt = ["price", "spend", "cost", "amount", "total", "fee", "rate", "salary", "balance", "deposit", "commission", "charge"], zt = ["status", "state", "phase", "condition"];
30
+ function fe(e, t) {
31
+ const s = e.toLowerCase();
32
+ if (jt.some((r) => s.includes(r)))
33
33
  return "image";
34
- if (Et.some((a) => n.includes(a)))
34
+ if (Wt.some((r) => s.includes(r)))
35
35
  return "currency";
36
- if ($t.some((a) => n.includes(a)))
36
+ if (zt.some((r) => s.includes(r)))
37
37
  return "status";
38
- const o = t.filter((a) => a != null && a !== "");
38
+ const o = t.filter((r) => r != null && r !== "");
39
39
  if (o.length === 0)
40
40
  return "string";
41
41
  const l = o[0];
42
- if (typeof l == "boolean" || n.startsWith("is") || n.startsWith("has"))
42
+ if (typeof l == "boolean" || s.startsWith("is") || s.startsWith("has"))
43
43
  return "boolean";
44
44
  if (Array.isArray(l))
45
45
  return "array";
46
46
  if (typeof l == "object")
47
- return l.url && typeof l.url == "string" && Re(l.url) ? "image" : "object";
47
+ return l.url && typeof l.url == "string" && Ie(l.url) ? "image" : "object";
48
48
  if (typeof l == "number")
49
49
  return "number";
50
50
  if (typeof l == "string") {
51
- const a = l.trim();
52
- if (Re(a))
51
+ const r = l.trim();
52
+ if (Ie(r))
53
53
  return "image";
54
- if ((Dt(a) || n.includes("date") || n.includes("at") || n.includes("time")) && !isNaN(Date.parse(a)))
55
- return a.includes("T") || a.includes(":") ? "datetime" : "date";
56
- if (a.includes("@") && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a))
54
+ if ((Lt(r) || s.includes("date") || s.includes("at") || s.includes("time")) && !isNaN(Date.parse(r)))
55
+ return r.includes("T") || r.includes(":") ? "datetime" : "date";
56
+ if (r.includes("@") && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))
57
57
  return "email";
58
- if (a.startsWith("http://") || a.startsWith("https://"))
58
+ if (r.startsWith("http://") || r.startsWith("https://"))
59
59
  return "url";
60
- if (n.includes("phone") || n.includes("mobile") || n.includes("tel"))
60
+ if (s.includes("phone") || s.includes("mobile") || s.includes("tel"))
61
61
  return "phone";
62
62
  }
63
63
  return "string";
64
64
  }
65
- function Re(e) {
65
+ function Ie(e) {
66
66
  if (!e || typeof e != "string") return !1;
67
67
  if (e.startsWith("data:image/")) return !0;
68
68
  const t = e.toLowerCase().split("?")[0];
69
- return Tt.some((n) => t.endsWith(n));
69
+ return _t.some((s) => t.endsWith(s));
70
70
  }
71
- function Dt(e) {
71
+ function Lt(e) {
72
72
  return !e || typeof e != "string" || e.length < 10 ? !1 : /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/.test(e);
73
73
  }
74
- const Mt = ["__v", "password", "token", "refreshToken", "secret", "hash", "salt"];
75
- function _t(e, t = Mt, n = 2) {
74
+ const Rt = ["__v", "password", "token", "refreshToken", "secret", "hash", "salt"];
75
+ function Ot(e, t = Rt, s = 2) {
76
76
  if (!e || !e.length)
77
77
  return [];
78
78
  const o = /* @__PURE__ */ new Map(), l = e.slice(0, 10);
79
- for (const a of l)
80
- !a || typeof a != "object" || Ve(a, "", o, l, t, 0, n);
79
+ for (const r of l)
80
+ !r || typeof r != "object" || et(r, "", o, l, t, 0, s);
81
81
  return Array.from(o.values());
82
82
  }
83
- function Ve(e, t, n, o, l, a, i) {
84
- if (!(!e || typeof e != "object" || a > i))
83
+ function et(e, t, s, o, l, r, i) {
84
+ if (!(!e || typeof e != "object" || r > i))
85
85
  for (const g of Object.keys(e)) {
86
86
  if (l.includes(g)) continue;
87
87
  const c = t ? `${t}.${g}` : g, d = e[g];
88
- if (St(d) && !Bt(d) && a < i) {
89
- Ve(d, c, n, o, l, a + 1, i);
88
+ if (Mt(d) && !Ht(d) && r < i) {
89
+ et(d, c, s, o, l, r + 1, i);
90
90
  continue;
91
91
  }
92
- if (!n.has(c)) {
93
- const r = o.map((u) => S(u, c)), m = be(c, r);
94
- n.set(c, {
92
+ if (!s.has(c)) {
93
+ const a = o.map((m) => P(m, c)), u = fe(c, a);
94
+ s.set(c, {
95
95
  key: c,
96
- title: fe(c),
97
- type: m,
96
+ title: ue(c),
97
+ type: u,
98
98
  sortable: !0,
99
99
  searchable: !0,
100
- align: m === "number" || m === "currency" ? "right" : "left"
100
+ align: u === "number" || u === "currency" ? "right" : "left"
101
101
  });
102
102
  }
103
103
  }
104
104
  }
105
- function Bt(e, t) {
105
+ function Ht(e, t) {
106
106
  return "en" in e && "ar" in e && Object.keys(e).length <= 3 ? !1 : "url" in e && typeof e.url == "string" || "coordinates" in e || "lat" in e && "lng" in e;
107
107
  }
108
- function jt(e) {
109
- const { data: t = [], columns: n, autoColumns: o = !0, thead: l, headerData: a } = e;
110
- return a && Array.isArray(a) && a.length > 0 ? a.map((i, g) => {
111
- const c = l && l[g] ? l[g] : fe(i), d = t.map((m) => m?.[i]), r = be(i, d);
108
+ function Ut(e) {
109
+ const { data: t = [], columns: s, autoColumns: o = !0, thead: l, headerData: r } = e;
110
+ return r && Array.isArray(r) && r.length > 0 ? r.map((i, g) => {
111
+ const c = l && l[g] ? l[g] : ue(i), d = t.map((u) => u?.[i]), a = fe(i, d);
112
112
  return {
113
113
  key: i,
114
114
  title: c,
115
- type: r,
115
+ type: a,
116
116
  sortable: !0,
117
117
  searchable: !0,
118
- align: r === "number" || r === "currency" ? "right" : "left"
118
+ align: a === "number" || a === "currency" ? "right" : "left"
119
119
  };
120
- }) : n && Array.isArray(n) && n.length > 0 ? n.map((i) => {
120
+ }) : s && Array.isArray(s) && s.length > 0 ? s.map((i) => {
121
121
  if (typeof i == "string") {
122
- const r = t.map((u) => u?.[i]), m = be(i, r);
122
+ const a = t.map((m) => m?.[i]), u = fe(i, a);
123
123
  return {
124
124
  key: i,
125
- title: fe(i),
126
- type: m,
125
+ title: ue(i),
126
+ type: u,
127
127
  sortable: !0,
128
128
  searchable: !0,
129
- align: m === "number" || m === "currency" ? "right" : "left"
129
+ align: u === "number" || u === "currency" ? "right" : "left"
130
130
  };
131
131
  }
132
- const g = String(i.key), c = i.title !== void 0 ? i.title : fe(g), d = i.type || be(g, t.map((r) => r?.[g]));
132
+ const g = String(i.key), c = i.title !== void 0 ? i.title : ue(g), d = i.type || fe(g, t.map((a) => a?.[g]));
133
133
  return {
134
134
  ...i,
135
135
  title: c,
@@ -138,140 +138,140 @@ function jt(e) {
138
138
  searchable: i.searchable !== void 0 ? i.searchable : !0,
139
139
  align: i.align || (d === "number" || d === "currency" ? "right" : "left")
140
140
  };
141
- }) : o && t && t.length > 0 ? _t(t) : [];
141
+ }) : o && t && t.length > 0 ? Ot(t) : [];
142
142
  }
143
- function zt({
143
+ function Kt({
144
144
  config: e,
145
145
  onSearchChange: t
146
146
  }) {
147
- const n = O(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), o = n.enabled !== !1 && !!e, l = n.debounce ?? 350, [a, i] = v(""), [g, c] = v(""), [d, r] = v(!1);
148
- ye(() => {
147
+ const s = W(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), o = s.enabled !== !1 && !!e, l = s.debounce ?? 350, [r, i] = S(""), [g, c] = S(""), [d, a] = S(!1);
148
+ be(() => {
149
149
  if (!o) return;
150
- if (a === "") {
151
- c(""), r(!1), t?.("");
150
+ if (r === "") {
151
+ c(""), a(!1), t?.("");
152
152
  return;
153
153
  }
154
- r(!0);
154
+ a(!0);
155
155
  const f = setTimeout(() => {
156
- c(a), r(!1), t?.(a);
156
+ c(r), a(!1), t?.(r);
157
157
  }, l);
158
158
  return () => {
159
159
  clearTimeout(f);
160
160
  };
161
- }, [a, l, o, t]);
162
- const m = w((f) => {
161
+ }, [r, l, o, t]);
162
+ const u = A((f) => {
163
163
  i(f);
164
- }, []), u = w(() => {
165
- i(""), c(""), r(!1), t?.("");
164
+ }, []), m = A(() => {
165
+ i(""), c(""), a(!1), t?.("");
166
166
  }, [t]);
167
167
  return {
168
168
  enabled: o,
169
- search: a,
169
+ search: r,
170
170
  debouncedSearch: g,
171
171
  isDebouncing: d,
172
- setSearch: m,
173
- clearSearch: u,
174
- searchConfig: n
172
+ setSearch: u,
173
+ clearSearch: m,
174
+ searchConfig: s
175
175
  };
176
176
  }
177
- function Lt({
177
+ function It({
178
178
  config: e,
179
179
  onSortChange: t
180
180
  }) {
181
- const n = O(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), o = n.enabled !== !1 && !!e, l = n.allowUnsort ?? !0, [a, i] = v(
182
- n.defaultSortBy || null
183
- ), [g, c] = v(
184
- n.defaultSortOrder || null
185
- ), d = w(
186
- (u) => {
181
+ const s = W(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), o = s.enabled !== !1 && !!e, l = s.allowUnsort ?? !0, [r, i] = S(
182
+ s.defaultSortBy || null
183
+ ), [g, c] = S(
184
+ s.defaultSortOrder || null
185
+ ), d = A(
186
+ (m) => {
187
187
  if (o) {
188
- if (a !== u) {
189
- i(u), c("asc"), t?.(u, "asc");
188
+ if (r !== m) {
189
+ i(m), c("asc"), t?.(m, "asc");
190
190
  return;
191
191
  }
192
- g === "asc" ? (c("desc"), t?.(u, "desc")) : g === "desc" && l ? (i(null), c(null), t?.(null, null)) : (c("asc"), t?.(u, "asc"));
192
+ g === "asc" ? (c("desc"), t?.(m, "desc")) : g === "desc" && l ? (i(null), c(null), t?.(null, null)) : (c("asc"), t?.(m, "asc"));
193
193
  }
194
194
  },
195
- [o, a, g, l, t]
196
- ), r = w(
197
- (u, f) => {
198
- i(u), c(f), t?.(u, f);
195
+ [o, r, g, l, t]
196
+ ), a = A(
197
+ (m, f) => {
198
+ i(m), c(f), t?.(m, f);
199
199
  },
200
200
  [t]
201
- ), m = w(() => {
201
+ ), u = A(() => {
202
202
  i(null), c(null), t?.(null, null);
203
203
  }, [t]);
204
204
  return {
205
205
  enabled: o,
206
- sortBy: a,
206
+ sortBy: r,
207
207
  sortOrder: g,
208
208
  toggleSort: d,
209
- setSorting: r,
210
- resetSorting: m,
211
- sortingConfig: n
209
+ setSorting: a,
210
+ resetSorting: u,
211
+ sortingConfig: s
212
212
  };
213
213
  }
214
- function Ot({
214
+ function Gt({
215
215
  config: e,
216
216
  totalRecords: t,
217
- onPageChange: n
217
+ onPageChange: s
218
218
  }) {
219
- const o = O(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), l = o.enabled !== !1 && !!e, a = o.defaultPage || 1, i = o.defaultPageSize || 10, g = o.pageSizeOptions || [5, 10, 20, 50, 100], [c, d] = v(a), [r, m] = v(i), u = Math.max(1, Math.ceil(t / Math.max(1, r))), f = w(
220
- (N) => {
221
- const A = Math.max(1, Math.min(N, u));
222
- d(A), n?.(A, r);
219
+ const o = W(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), l = o.enabled !== !1 && !!e, r = o.defaultPage || 1, i = o.defaultPageSize || 10, g = o.pageSizeOptions || [5, 10, 20, 50, 100], [c, d] = S(r), [a, u] = S(i), m = Math.max(1, Math.ceil(t / Math.max(1, a))), f = A(
220
+ (v) => {
221
+ const w = Math.max(1, Math.min(v, m));
222
+ d(w), s?.(w, a);
223
223
  },
224
- [u, r, n]
225
- ), p = w(
226
- (N) => {
227
- m(N), d(1), n?.(1, N);
224
+ [m, a, s]
225
+ ), b = A(
226
+ (v) => {
227
+ u(v), d(1), s?.(1, v);
228
228
  },
229
- [n]
230
- ), k = w(() => {
231
- c < u && f(c + 1);
232
- }, [c, u, f]), E = w(() => {
229
+ [s]
230
+ ), k = A(() => {
231
+ c < m && f(c + 1);
232
+ }, [c, m, f]), C = A(() => {
233
233
  c > 1 && f(c - 1);
234
- }, [c, f]), h = w(() => {
235
- d(1), m(i), n?.(1, i);
236
- }, [i, n]), D = w(
237
- (N = 5) => {
238
- const A = Math.max(
234
+ }, [c, f]), $ = A(() => {
235
+ d(1), u(i), s?.(1, i);
236
+ }, [i, s]), F = A(
237
+ (v = 5) => {
238
+ const w = Math.max(
239
239
  1,
240
- Math.min(c - Math.floor(N / 2), u - N + 1)
241
- ), j = Math.min(u, A + N - 1), H = [];
242
- for (let W = A; W <= j; W++)
243
- H.push(W);
240
+ Math.min(c - Math.floor(v / 2), m - v + 1)
241
+ ), z = Math.min(m, w + v - 1), H = [];
242
+ for (let R = w; R <= z; R++)
243
+ H.push(R);
244
244
  return H;
245
245
  },
246
- [c, u]
247
- ), M = w(
248
- (N) => {
249
- if (!l) return N;
250
- const A = (c - 1) * r;
251
- return N.slice(A, A + r);
246
+ [c, m]
247
+ ), x = A(
248
+ (v) => {
249
+ if (!l) return v;
250
+ const w = (c - 1) * a;
251
+ return v.slice(w, w + a);
252
252
  },
253
- [l, c, r]
253
+ [l, c, a]
254
254
  );
255
255
  return {
256
256
  enabled: l,
257
257
  page: c,
258
- pageSize: r,
258
+ pageSize: a,
259
259
  totalRecords: t,
260
- totalPages: u,
260
+ totalPages: m,
261
261
  pageSizeOptions: g,
262
- hasNextPage: c < u,
262
+ hasNextPage: c < m,
263
263
  hasPrevPage: c > 1,
264
264
  setPage: f,
265
- setPageSize: p,
265
+ setPageSize: b,
266
266
  nextPage: k,
267
- prevPage: E,
268
- resetPagination: h,
269
- getPageWindow: D,
270
- sliceData: M,
267
+ prevPage: C,
268
+ resetPagination: $,
269
+ getPageWindow: F,
270
+ sliceData: x,
271
271
  paginationConfig: o
272
272
  };
273
273
  }
274
- const Wt = [
274
+ const Vt = [
275
275
  "total",
276
276
  "totalCount",
277
277
  "count",
@@ -287,7 +287,7 @@ const Wt = [
287
287
  "pageInfo.total",
288
288
  "pageInfo.totalCount",
289
289
  "paging.total"
290
- ], It = [
290
+ ], Yt = [
291
291
  "page",
292
292
  "currentPage",
293
293
  "pageNumber",
@@ -297,7 +297,7 @@ const Wt = [
297
297
  "pagination.page",
298
298
  "pagination.currentPage",
299
299
  "pageInfo.page"
300
- ], Ft = [
300
+ ], Zt = [
301
301
  "pageSize",
302
302
  "limit",
303
303
  "perPage",
@@ -308,7 +308,7 @@ const Wt = [
308
308
  "pagination.pageSize",
309
309
  "pagination.limit",
310
310
  "pagination.perPage"
311
- ], Ht = [
311
+ ], Jt = [
312
312
  "totalPages",
313
313
  "pageCount",
314
314
  "lastPage",
@@ -319,11 +319,11 @@ const Wt = [
319
319
  "pagination.totalPages",
320
320
  "pagination.lastPage"
321
321
  ];
322
- function X(e, t, n = 1, o = 10, l) {
322
+ function Q(e, t, s = 1, o = 10, l) {
323
323
  if (!e || typeof e != "object") {
324
324
  const d = l !== void 0 ? l : 0;
325
325
  return {
326
- page: n,
326
+ page: s,
327
327
  pageSize: o,
328
328
  total: d,
329
329
  totalPages: Math.max(1, Math.ceil(d / Math.max(1, o))),
@@ -331,75 +331,75 @@ function X(e, t, n = 1, o = 10, l) {
331
331
  hasPrevPage: !1
332
332
  };
333
333
  }
334
- let a;
334
+ let r;
335
335
  if (t?.totalPath) {
336
- const d = S(e, t.totalPath);
337
- typeof d == "number" ? a = d : typeof d == "string" && !isNaN(Number(d)) && (a = Number(d));
336
+ const d = P(e, t.totalPath);
337
+ typeof d == "number" ? r = d : typeof d == "string" && !isNaN(Number(d)) && (r = Number(d));
338
338
  }
339
- if (a === void 0)
340
- for (const d of Wt) {
341
- const r = S(e, d);
342
- if (typeof r == "number" && !isNaN(r)) {
343
- a = r;
339
+ if (r === void 0)
340
+ for (const d of Vt) {
341
+ const a = P(e, d);
342
+ if (typeof a == "number" && !isNaN(a)) {
343
+ r = a;
344
344
  break;
345
345
  }
346
- if (typeof r == "string" && r.trim() !== "" && !isNaN(Number(r))) {
347
- a = Number(r);
346
+ if (typeof a == "string" && a.trim() !== "" && !isNaN(Number(a))) {
347
+ r = Number(a);
348
348
  break;
349
349
  }
350
350
  }
351
- a === void 0 && (a = l !== void 0 ? l : 0);
351
+ r === void 0 && (r = l !== void 0 ? l : 0);
352
352
  let i;
353
353
  if (t?.pagePath) {
354
- const d = S(e, t.pagePath);
354
+ const d = P(e, t.pagePath);
355
355
  typeof d == "number" ? i = d : typeof d == "string" && !isNaN(Number(d)) && (i = Number(d));
356
356
  }
357
357
  if (i === void 0)
358
- for (const d of It) {
359
- const r = S(e, d);
360
- if (typeof r == "number" && !isNaN(r)) {
361
- i = r;
358
+ for (const d of Yt) {
359
+ const a = P(e, d);
360
+ if (typeof a == "number" && !isNaN(a)) {
361
+ i = a;
362
362
  break;
363
363
  }
364
- if (typeof r == "string" && r.trim() !== "" && !isNaN(Number(r))) {
365
- i = Number(r);
364
+ if (typeof a == "string" && a.trim() !== "" && !isNaN(Number(a))) {
365
+ i = Number(a);
366
366
  break;
367
367
  }
368
368
  }
369
- i === void 0 && (i = n);
369
+ i === void 0 && (i = s);
370
370
  let g;
371
371
  if (t?.pageSizePath) {
372
- const d = S(e, t.pageSizePath);
372
+ const d = P(e, t.pageSizePath);
373
373
  typeof d == "number" ? g = d : typeof d == "string" && !isNaN(Number(d)) && (g = Number(d));
374
374
  }
375
375
  if (g === void 0)
376
- for (const d of Ft) {
377
- const r = S(e, d);
378
- if (typeof r == "number" && !isNaN(r)) {
379
- g = r;
376
+ for (const d of Zt) {
377
+ const a = P(e, d);
378
+ if (typeof a == "number" && !isNaN(a)) {
379
+ g = a;
380
380
  break;
381
381
  }
382
- if (typeof r == "string" && r.trim() !== "" && !isNaN(Number(r))) {
383
- g = Number(r);
382
+ if (typeof a == "string" && a.trim() !== "" && !isNaN(Number(a))) {
383
+ g = Number(a);
384
384
  break;
385
385
  }
386
386
  }
387
387
  g === void 0 && (g = o);
388
388
  let c;
389
389
  if (t?.totalPagesPath) {
390
- const d = S(e, t.totalPagesPath);
390
+ const d = P(e, t.totalPagesPath);
391
391
  typeof d == "number" ? c = d : typeof d == "string" && !isNaN(Number(d)) && (c = Number(d));
392
392
  }
393
393
  if (c === void 0)
394
- for (const d of Ht) {
395
- const r = S(e, d);
396
- if (typeof r == "number" && !isNaN(r)) {
397
- c = r;
394
+ for (const d of Jt) {
395
+ const a = P(e, d);
396
+ if (typeof a == "number" && !isNaN(a)) {
397
+ c = a;
398
398
  break;
399
399
  }
400
400
  }
401
- return (c === void 0 || c <= 0) && (c = Math.max(1, Math.ceil(a / Math.max(1, g)))), {
402
- total: a,
401
+ return (c === void 0 || c <= 0) && (c = Math.max(1, Math.ceil(r / Math.max(1, g)))), {
402
+ total: r,
403
403
  page: i,
404
404
  pageSize: g,
405
405
  totalPages: c,
@@ -407,7 +407,7 @@ function X(e, t, n = 1, o = 10, l) {
407
407
  hasPrevPage: i > 1
408
408
  };
409
409
  }
410
- const Rt = [
410
+ const qt = [
411
411
  "data",
412
412
  "items",
413
413
  "results",
@@ -428,23 +428,23 @@ const Rt = [
428
428
  "subscriptions",
429
429
  "deadLetters.items"
430
430
  ];
431
- function Ut(e, t, n) {
432
- const o = n?.page || 1, l = n?.pageSize || 10;
431
+ function Xt(e, t, s) {
432
+ const o = s?.page || 1, l = s?.pageSize || 10;
433
433
  if (t?.transformResponse && typeof t.transformResponse == "function") {
434
- const a = t.transformResponse(e);
435
- if (Array.isArray(a))
434
+ const r = t.transformResponse(e);
435
+ if (Array.isArray(r))
436
436
  return {
437
- data: a,
438
- meta: X(e, t.response, o, l, a.length),
437
+ data: r,
438
+ meta: Q(e, t.response, o, l, r.length),
439
439
  raw: e
440
440
  };
441
- if (a && typeof a == "object") {
442
- const i = Array.isArray(a.data) ? a.data : [], g = a.meta ? {
443
- total: a.meta.total !== void 0 ? a.meta.total : i.length,
444
- page: a.meta.page !== void 0 ? a.meta.page : o,
445
- pageSize: a.meta.pageSize !== void 0 ? a.meta.pageSize : l,
446
- totalPages: a.meta.totalPages !== void 0 ? a.meta.totalPages : Math.max(1, Math.ceil((a.meta.total || i.length) / (a.meta.pageSize || l)))
447
- } : X(e, t.response, o, l, i.length);
441
+ if (r && typeof r == "object") {
442
+ const i = Array.isArray(r.data) ? r.data : [], g = r.meta ? {
443
+ total: r.meta.total !== void 0 ? r.meta.total : i.length,
444
+ page: r.meta.page !== void 0 ? r.meta.page : o,
445
+ pageSize: r.meta.pageSize !== void 0 ? r.meta.pageSize : l,
446
+ totalPages: r.meta.totalPages !== void 0 ? r.meta.totalPages : Math.max(1, Math.ceil((r.meta.total || i.length) / (r.meta.pageSize || l)))
447
+ } : Q(e, t.response, o, l, i.length);
448
448
  return { data: i, meta: g, raw: e };
449
449
  }
450
450
  }
@@ -462,14 +462,14 @@ function Ut(e, t, n) {
462
462
  raw: e
463
463
  };
464
464
  if (t?.response?.dataPath) {
465
- const a = S(e, t.response.dataPath), i = Array.isArray(a) ? a : [], g = X(e, t.response, o, l, i.length);
465
+ const r = P(e, t.response.dataPath), i = Array.isArray(r) ? r : [], g = Q(e, t.response, o, l, i.length);
466
466
  return { data: i, meta: g, raw: e };
467
467
  }
468
468
  if (e && typeof e == "object") {
469
- for (const a of Rt) {
470
- const i = S(e, a);
469
+ for (const r of qt) {
470
+ const i = P(e, r);
471
471
  if (Array.isArray(i)) {
472
- const g = X(e, t?.response, o, l, i.length);
472
+ const g = Q(e, t?.response, o, l, i.length);
473
473
  return {
474
474
  data: i,
475
475
  meta: g,
@@ -477,20 +477,20 @@ function Ut(e, t, n) {
477
477
  };
478
478
  }
479
479
  }
480
- for (const a in e)
481
- if (Array.isArray(e[a])) {
482
- const i = X(e, t?.response, o, l, e[a].length);
480
+ for (const r in e)
481
+ if (Array.isArray(e[r])) {
482
+ const i = Q(e, t?.response, o, l, e[r].length);
483
483
  return {
484
- data: e[a],
484
+ data: e[r],
485
485
  meta: i,
486
486
  raw: e
487
487
  };
488
488
  }
489
489
  if (Object.keys(e).length > 0 && !Array.isArray(e)) {
490
- const a = e.user || e.order || e.item || e.data || e;
491
- if (a && typeof a == "object" && !Array.isArray(a))
490
+ const r = e.user || e.order || e.item || e.data || e;
491
+ if (r && typeof r == "object" && !Array.isArray(r))
492
492
  return {
493
- data: [a],
493
+ data: [r],
494
494
  meta: {
495
495
  total: 1,
496
496
  page: 1,
@@ -516,54 +516,54 @@ function Ut(e, t, n) {
516
516
  raw: e
517
517
  };
518
518
  }
519
- function Kt(e, t, n, o) {
519
+ function Qt(e, t, s, o) {
520
520
  if (!e || !e.length) return [];
521
521
  if (!t || typeof t != "string" || !t.trim()) return e;
522
522
  const l = t.trim().toLowerCase();
523
523
  if (o && typeof o == "function")
524
524
  return e.filter((i) => o(i, l));
525
- const a = l.split(/\s+/).filter(Boolean);
525
+ const r = l.split(/\s+/).filter(Boolean);
526
526
  return e.filter((i) => {
527
527
  if (!i || typeof i != "object") return !1;
528
528
  const g = [];
529
- if (n && n.length > 0)
530
- for (const d of n) {
531
- const r = S(i, d);
532
- r != null && (typeof r == "object" ? g.push(JSON.stringify(r).toLowerCase()) : g.push(String(r).toLowerCase()));
529
+ if (s && s.length > 0)
530
+ for (const d of s) {
531
+ const a = P(i, d);
532
+ a != null && (typeof a == "object" ? g.push(JSON.stringify(a).toLowerCase()) : g.push(String(a).toLowerCase()));
533
533
  }
534
534
  else
535
- Te(i, g);
535
+ Se(i, g);
536
536
  const c = g.join(" ");
537
- return a.every((d) => c.includes(d));
537
+ return r.every((d) => c.includes(d));
538
538
  });
539
539
  }
540
- function Te(e, t, n = 0) {
541
- if (!(n > 4 || e === null || e === void 0)) {
540
+ function Se(e, t, s = 0) {
541
+ if (!(s > 4 || e === null || e === void 0)) {
542
542
  if (typeof e != "object") {
543
543
  t.push(String(e).toLowerCase());
544
544
  return;
545
545
  }
546
546
  if (Array.isArray(e)) {
547
547
  for (const o of e)
548
- Te(o, t, n + 1);
548
+ Se(o, t, s + 1);
549
549
  return;
550
550
  }
551
551
  for (const o in e)
552
552
  if (Object.prototype.hasOwnProperty.call(e, o)) {
553
553
  if (o.startsWith("__") || o.toLowerCase().includes("password")) continue;
554
- Te(e[o], t, n + 1);
554
+ Se(e[o], t, s + 1);
555
555
  }
556
556
  }
557
557
  }
558
- function Gt(e, t, n, o) {
559
- if (!e || !e.length || !t || !n)
558
+ function er(e, t, s, o) {
559
+ if (!e || !e.length || !t || !s)
560
560
  return e;
561
561
  const l = [...e];
562
- return o && typeof o == "function" ? (l.sort((a, i) => {
563
- const g = o(a, i);
564
- return n === "desc" ? -g : g;
565
- }), l) : (l.sort((a, i) => {
566
- const g = S(a, t), c = S(i, t);
562
+ return o && typeof o == "function" ? (l.sort((r, i) => {
563
+ const g = o(r, i);
564
+ return s === "desc" ? -g : g;
565
+ }), l) : (l.sort((r, i) => {
566
+ const g = P(r, t), c = P(i, t);
567
567
  if (g == null)
568
568
  return c == null ? 0 : 1;
569
569
  if (c == null)
@@ -575,153 +575,153 @@ function Gt(e, t, n, o) {
575
575
  d = g === c ? 0 : g ? -1 : 1;
576
576
  else if (g instanceof Date && c instanceof Date)
577
577
  d = g.getTime() - c.getTime();
578
- else if (typeof g == "string" && typeof c == "string" && Ue(g) && Ue(c))
578
+ else if (typeof g == "string" && typeof c == "string" && Ge(g) && Ge(c))
579
579
  d = new Date(g).getTime() - new Date(c).getTime();
580
580
  else {
581
- const r = String(g), m = String(c);
582
- d = r.localeCompare(m, void 0, {
581
+ const a = String(g), u = String(c);
582
+ d = a.localeCompare(u, void 0, {
583
583
  numeric: !0,
584
584
  sensitivity: "base"
585
585
  });
586
586
  }
587
- return n === "desc" ? -d : d;
587
+ return s === "desc" ? -d : d;
588
588
  }), l);
589
589
  }
590
- function Ue(e) {
590
+ function Ge(e) {
591
591
  return e.length < 10 ? !1 : /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/.test(e);
592
592
  }
593
- function Yt({
593
+ function tr({
594
594
  data: e,
595
595
  api: t,
596
- columns: n,
596
+ columns: s,
597
597
  searchQuery: o,
598
598
  sortBy: l,
599
- sortOrder: a,
599
+ sortOrder: r,
600
600
  page: i,
601
601
  pageSize: g,
602
602
  manualLoading: c
603
603
  }) {
604
- const d = !!(t && typeof t.fetcher == "function"), r = d && t?.mode !== "client", [m, u] = v([]), [f, p] = v(0), [k, E] = v(!1), [h, D] = v(null), [M, N] = v(0), A = wt(null), j = w(async () => {
604
+ const d = !!(t && typeof t.fetcher == "function"), a = d && t?.mode !== "client", [u, m] = S([]), [f, b] = S(0), [k, C] = S(!1), [$, F] = S(null), [x, v] = S(0), w = $t(null), z = A(async () => {
605
605
  if (!d || !t?.fetcher) return;
606
- A.current && A.current.abort();
607
- const B = new AbortController();
608
- A.current = B, E(!0), D(null);
609
- const z = t.paramNames || {}, R = z.pageParam || "page", re = z.pageSizeParam || "limit", G = z.searchParam || "q", Y = z.sortByParam || "sortBy", I = z.sortOrderParam || "sortOrder", U = {
610
- [R]: i,
611
- [re]: g,
606
+ w.current && w.current.abort();
607
+ const _ = new AbortController();
608
+ w.current = _, C(!0), F(null);
609
+ const j = t.paramNames || {}, U = j.pageParam || "page", te = j.pageSizeParam || "limit", V = j.searchParam || "q", Y = j.sortByParam || "sortBy", K = j.sortOrderParam || "sortOrder", Z = {
610
+ [U]: i,
611
+ [te]: g,
612
612
  page: i,
613
613
  pageSize: g,
614
- ...o ? { [G]: o, search: o, q: o } : {},
614
+ ...o ? { [V]: o, search: o, q: o } : {},
615
615
  ...l ? { [Y]: l, sortBy: l } : {},
616
- ...a ? { [I]: a, sortOrder: a } : {},
616
+ ...r ? { [K]: r, sortOrder: r } : {},
617
617
  ...t.params || {}
618
618
  };
619
619
  try {
620
- const T = await t.fetcher(U, B.signal);
621
- if (B.signal.aborted) return;
622
- const V = Ut(
623
- T,
620
+ const B = await t.fetcher(Z, _.signal);
621
+ if (_.signal.aborted) return;
622
+ const I = Xt(
623
+ B,
624
624
  t,
625
- U
625
+ Z
626
626
  );
627
- u(V.data), p(V.meta.total), t.onSuccess?.(V);
628
- } catch (T) {
629
- if (T?.name === "AbortError" || T?.name === "CanceledError")
627
+ m(I.data), b(I.meta.total), t.onSuccess?.(I);
628
+ } catch (B) {
629
+ if (B?.name === "AbortError" || B?.name === "CanceledError")
630
630
  return;
631
- D(T), t.onError?.(T);
631
+ F(B), t.onError?.(B);
632
632
  } finally {
633
- B.signal.aborted || E(!1);
633
+ _.signal.aborted || C(!1);
634
634
  }
635
- }, [d, t, i, g, o, l, a]);
636
- ye(() => {
637
- d && j();
638
- }, [j, M]), ye(() => () => {
639
- A.current && A.current.abort();
635
+ }, [d, t, i, g, o, l, r]);
636
+ be(() => {
637
+ d && z();
638
+ }, [z, x]), be(() => () => {
639
+ w.current && w.current.abort();
640
640
  }, []);
641
- const H = w(async () => {
642
- d && N((B) => B + 1);
643
- }, [d]), { displayRows: W, finalTotal: te } = O(() => {
644
- if (r)
641
+ const H = A(async () => {
642
+ d && v((_) => _ + 1);
643
+ }, [d]), { displayRows: R, finalTotal: ye } = W(() => {
644
+ if (a)
645
645
  return {
646
- displayRows: m,
646
+ displayRows: u,
647
647
  finalTotal: f
648
648
  };
649
- const B = d ? m : e || [], z = n.filter((T) => T.searchable !== !1).map((T) => T.key), R = Kt(B, o, z), G = n.find((T) => T.key === l)?.comparator, Y = Gt(R, l, a, G), I = (i - 1) * g;
649
+ const _ = d ? u : e || [], j = s.filter((B) => B.searchable !== !1).map((B) => B.key), U = Qt(_, o, j), V = s.find((B) => B.key === l)?.comparator, Y = er(U, l, r, V), K = (i - 1) * g;
650
650
  return {
651
- displayRows: Y.slice(I, I + g),
652
- finalTotal: R.length
651
+ displayRows: Y.slice(K, K + g),
652
+ finalTotal: U.length
653
653
  };
654
654
  }, [
655
- r,
655
+ a,
656
656
  d,
657
- m,
657
+ u,
658
658
  e,
659
659
  f,
660
- n,
660
+ s,
661
661
  o,
662
662
  l,
663
- a,
663
+ r,
664
664
  i,
665
665
  g
666
666
  ]);
667
667
  return {
668
- rows: W,
669
- totalRecords: te,
668
+ rows: R,
669
+ totalRecords: ye,
670
670
  loading: c !== void 0 ? c : k,
671
- error: h,
671
+ error: $,
672
672
  refresh: H,
673
- isServerMode: r,
674
- rawRemoteData: m
673
+ isServerMode: a,
674
+ rawRemoteData: u
675
675
  };
676
676
  }
677
- function Vt({
677
+ function rr({
678
678
  tableRef: e,
679
679
  refresh: t,
680
- resetPagination: n,
680
+ resetPagination: s,
681
681
  resetSearch: o,
682
682
  resetSorting: l,
683
- setPage: a,
683
+ setPage: r,
684
684
  setPageSize: i,
685
685
  setSearch: g,
686
686
  setSorting: c,
687
687
  selectedRows: d,
688
- clearSelection: r,
689
- getState: m
688
+ clearSelection: a,
689
+ getState: u
690
690
  }) {
691
- vt(
691
+ Dt(
692
692
  e,
693
693
  () => ({
694
694
  refresh: t,
695
695
  reset: () => {
696
- n(), o(), l(), r();
696
+ s(), o(), l(), a();
697
697
  },
698
698
  resetSearch: o,
699
699
  resetSorting: l,
700
- resetPagination: n,
701
- setPage: a,
700
+ resetPagination: s,
701
+ setPage: r,
702
702
  setPageSize: i,
703
703
  setSearch: g,
704
704
  setSorting: c,
705
705
  getSelectedRows: () => d,
706
- clearSelection: r,
707
- getState: m
706
+ clearSelection: a,
707
+ getState: u
708
708
  }),
709
709
  [
710
710
  t,
711
- n,
711
+ s,
712
712
  o,
713
713
  l,
714
- a,
714
+ r,
715
715
  i,
716
716
  g,
717
717
  c,
718
718
  d,
719
- r,
720
- m
719
+ a,
720
+ u
721
721
  ]
722
722
  );
723
723
  }
724
- const Jt = {
724
+ const tt = {
725
725
  primary: "#2667EC",
726
726
  primaryHover: "#1E54C6",
727
727
  primaryLight: "#397FF6",
@@ -740,9 +740,9 @@ const Jt = {
740
740
  inputBg: "#1E293B",
741
741
  rowHover: "rgba(38, 103, 236, 0.04)",
742
742
  rowSelected: "rgba(38, 103, 236, 0.08)"
743
- }, Q = {
743
+ }, rt = {
744
744
  mode: "auto",
745
- colors: Jt,
745
+ colors: tt,
746
746
  borderRadius: "1rem",
747
747
  fontFamily: "'Alexandria', system-ui, -apple-system, sans-serif",
748
748
  density: "normal",
@@ -762,37 +762,175 @@ const Jt = {
762
762
  paginationButtonActive: "bg-primary text-white hover:bg-primary-soft shadow-md shadow-primary/30",
763
763
  paginationSelect: "h-9 px-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-700 dark:text-gray-300 focus:outline-none focus:border-primary cursor-pointer"
764
764
  }
765
- }, Je = At(Q), Zt = ({
766
- theme: e,
767
- children: t
768
- }) => {
769
- const n = O(() => e ? {
770
- ...Q,
771
- ...e,
765
+ }, Ve = {
766
+ default: {
767
+ colors: tt,
768
+ borderRadius: "1rem",
769
+ density: "normal"
770
+ },
771
+ midnight: {
772
+ mode: "dark",
773
+ colors: {
774
+ primary: "#6366F1",
775
+ primaryHover: "#4F46E5",
776
+ primaryLight: "#818CF8",
777
+ card: "#090D16",
778
+ cardSecondary: "#111827",
779
+ border: "#1E293B",
780
+ textPrimary: "#F8FAFC",
781
+ textSecondary: "#94A3B8",
782
+ rowHover: "rgba(99, 102, 241, 0.08)",
783
+ rowSelected: "rgba(99, 102, 241, 0.16)",
784
+ theadBg: "#0F172A",
785
+ theadText: "#C7D2FE"
786
+ },
787
+ borderRadius: "1.25rem",
788
+ classes: {
789
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-indigo-950/70 bg-[#090D16] shadow-2xl shadow-indigo-950/30",
790
+ thead: "bg-[#0F172A]/90 backdrop-blur-md border-b border-indigo-950/80 text-indigo-200 font-bold uppercase text-xs tracking-wider",
791
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-indigo-900/50 bg-[#111827] text-white placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/40 focus:border-indigo-500",
792
+ paginationButtonActive: "bg-indigo-600 text-white shadow-lg shadow-indigo-600/30"
793
+ }
794
+ },
795
+ emerald: {
796
+ colors: {
797
+ primary: "#10B981",
798
+ primaryHover: "#059669",
799
+ primaryLight: "#34D399",
800
+ border: "#10B98125",
801
+ rowHover: "rgba(16, 185, 129, 0.06)",
802
+ rowSelected: "rgba(16, 185, 129, 0.12)",
803
+ theadBg: "rgba(16, 185, 129, 0.08)",
804
+ theadText: "#065F46"
805
+ },
806
+ borderRadius: "1rem",
807
+ classes: {
808
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-emerald-500/20 bg-white dark:bg-slate-900 shadow-lg shadow-emerald-500/5",
809
+ thead: "bg-emerald-500/10 dark:bg-emerald-950/30 border-b border-emerald-500/20 text-emerald-800 dark:text-emerald-300 font-bold uppercase text-xs",
810
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-emerald-500/30 bg-white dark:bg-slate-800 text-gray-900 dark:text-white focus:ring-emerald-500/40 focus:border-emerald-500",
811
+ paginationButtonActive: "bg-emerald-600 text-white shadow-md shadow-emerald-600/30"
812
+ }
813
+ },
814
+ ocean: {
772
815
  colors: {
773
- ...Q.colors,
774
- ...e.colors || {}
816
+ primary: "#0EA5E9",
817
+ primaryHover: "#0284C7",
818
+ primaryLight: "#38BDF8",
819
+ secondary: "#06B6D4",
820
+ rowHover: "rgba(14, 165, 233, 0.06)",
821
+ rowSelected: "rgba(14, 165, 233, 0.12)",
822
+ theadBg: "rgba(14, 165, 233, 0.08)",
823
+ theadText: "#0369A1"
775
824
  },
825
+ borderRadius: "1rem",
776
826
  classes: {
777
- ...Q.classes,
778
- ...e.classes || {}
827
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-sky-500/20 bg-white dark:bg-slate-900 shadow-lg shadow-sky-500/5",
828
+ thead: "bg-sky-500/10 dark:bg-sky-950/30 border-b border-sky-500/20 text-sky-800 dark:text-sky-300 font-bold uppercase text-xs",
829
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-sky-500/30 bg-white dark:bg-slate-800 text-gray-900 dark:text-white focus:ring-sky-500/40 focus:border-sky-500",
830
+ paginationButtonActive: "bg-sky-500 text-white shadow-md shadow-sky-500/30"
779
831
  }
780
- } : Q, [e]);
781
- return /* @__PURE__ */ s(Je.Provider, { value: n, children: t });
832
+ },
833
+ luxury: {
834
+ colors: {
835
+ primary: "#D97706",
836
+ primaryHover: "#B45309",
837
+ primaryLight: "#F59E0B",
838
+ rowHover: "rgba(245, 158, 11, 0.06)",
839
+ rowSelected: "rgba(245, 158, 11, 0.14)",
840
+ theadBg: "rgba(245, 158, 11, 0.08)",
841
+ theadText: "#78350F"
842
+ },
843
+ borderRadius: "1.25rem",
844
+ classes: {
845
+ tableWrapper: "w-full overflow-x-auto rounded-3xl border border-amber-500/30 bg-white dark:bg-[#120F0B] shadow-2xl shadow-amber-500/10",
846
+ thead: "bg-amber-500/10 dark:bg-amber-950/30 border-b border-amber-500/20 text-amber-800 dark:text-amber-300 font-bold uppercase text-xs tracking-wider",
847
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-amber-500/30 bg-white dark:bg-[#1A1612] text-gray-900 dark:text-amber-100 focus:ring-amber-500/40 focus:border-amber-500",
848
+ paginationButtonActive: "bg-gradient-to-r from-amber-500 to-yellow-500 text-white shadow-md shadow-amber-500/30 font-black"
849
+ }
850
+ },
851
+ crimson: {
852
+ colors: {
853
+ primary: "#F43F5E",
854
+ primaryHover: "#E11D48",
855
+ primaryLight: "#FB7185",
856
+ rowHover: "rgba(244, 63, 94, 0.06)",
857
+ rowSelected: "rgba(244, 63, 94, 0.12)",
858
+ theadBg: "rgba(244, 63, 94, 0.08)",
859
+ theadText: "#881337"
860
+ },
861
+ borderRadius: "1rem",
862
+ classes: {
863
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-rose-500/20 bg-white dark:bg-slate-900 shadow-lg shadow-rose-500/5",
864
+ thead: "bg-rose-500/10 dark:bg-rose-950/30 border-b border-rose-500/20 text-rose-800 dark:text-rose-300 font-bold uppercase text-xs",
865
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-rose-500/30 bg-white dark:bg-slate-800 text-gray-900 dark:text-white focus:ring-rose-500/40 focus:border-rose-500",
866
+ paginationButtonActive: "bg-rose-500 text-white shadow-md shadow-rose-500/30"
867
+ }
868
+ },
869
+ minimal: {
870
+ borderRadius: "0.5rem",
871
+ density: "spacious",
872
+ classes: {
873
+ tableWrapper: "w-full overflow-x-auto rounded-lg border-0 bg-transparent shadow-none",
874
+ thead: "bg-transparent border-b border-gray-200 dark:border-gray-800 text-gray-500 dark:text-gray-400 font-semibold text-xs tracking-wider",
875
+ tbody: "divide-y divide-gray-100 dark:divide-gray-800/40 bg-transparent",
876
+ tr: "hover:bg-gray-500/5 transition-colors",
877
+ searchInput: "w-full pl-10 pr-10 py-2 rounded-lg border border-gray-200 dark:border-gray-800 bg-transparent text-sm focus:border-gray-400",
878
+ paginationButtonActive: "bg-gray-900 dark:bg-white text-white dark:text-gray-900 font-bold"
879
+ }
880
+ },
881
+ corporate: {
882
+ colors: {
883
+ primary: "#1E40AF",
884
+ primaryHover: "#1E3A8A",
885
+ primaryLight: "#3B82F6"
886
+ },
887
+ borderRadius: "0.375rem",
888
+ density: "compact",
889
+ classes: {
890
+ tableWrapper: "w-full overflow-x-auto rounded-md border border-gray-300 dark:border-gray-700 bg-white dark:bg-slate-900 shadow-sm",
891
+ thead: "bg-gray-100 dark:bg-slate-800 border-b border-gray-300 dark:border-gray-700 text-gray-700 dark:text-gray-300 font-bold uppercase text-xs",
892
+ searchInput: "w-full pl-9 pr-8 py-1.5 rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-slate-800 text-xs",
893
+ paginationButtonActive: "bg-blue-800 text-white"
894
+ }
895
+ }
896
+ }, Te = Ft(rt), ar = ({
897
+ theme: e,
898
+ preset: t,
899
+ children: s
900
+ }) => {
901
+ const o = Qe(Te), l = W(() => {
902
+ const r = o || rt, i = t && Ve[t] ? Ve[t] : {};
903
+ return {
904
+ ...r,
905
+ ...i,
906
+ ...e || {},
907
+ colors: {
908
+ ...r.colors,
909
+ ...i.colors || {},
910
+ ...e?.colors || {}
911
+ },
912
+ classes: {
913
+ ...r.classes,
914
+ ...i.classes || {},
915
+ ...e?.classes || {}
916
+ }
917
+ };
918
+ }, [o, t, e]);
919
+ return /* @__PURE__ */ n(Te.Provider, { value: l, children: s });
782
920
  };
783
921
  function ee() {
784
- return Ct(Je);
922
+ return Qe(Te);
785
923
  }
786
- const qt = ({
924
+ const nr = ({
787
925
  value: e,
788
926
  onChange: t,
789
- onClear: n,
927
+ onClear: s,
790
928
  isDebouncing: o = !1,
791
929
  placeholder: l = "Search records..."
792
930
  }) => {
793
- const a = ee();
794
- return /* @__PURE__ */ b("div", { className: a.classes?.searchContainer || "w-full sm:max-w-md relative flex items-center", children: [
795
- /* @__PURE__ */ s("span", { className: "absolute left-3.5 text-gray-400 dark:text-gray-500 pointer-events-none flex items-center", children: /* @__PURE__ */ s(
931
+ const r = ee();
932
+ return /* @__PURE__ */ h("div", { className: r.classes?.searchContainer || "w-full sm:max-w-md relative flex items-center", children: [
933
+ /* @__PURE__ */ n("span", { className: "absolute left-3.5 text-gray-400 dark:text-gray-500 pointer-events-none flex items-center", children: /* @__PURE__ */ n(
796
934
  "svg",
797
935
  {
798
936
  className: "w-4 h-4",
@@ -800,7 +938,7 @@ const qt = ({
800
938
  stroke: "currentColor",
801
939
  viewBox: "0 0 24 24",
802
940
  xmlns: "http://www.w3.org/2000/svg",
803
- children: /* @__PURE__ */ s(
941
+ children: /* @__PURE__ */ n(
804
942
  "path",
805
943
  {
806
944
  strokeLinecap: "round",
@@ -811,26 +949,26 @@ const qt = ({
811
949
  )
812
950
  }
813
951
  ) }),
814
- /* @__PURE__ */ s(
952
+ /* @__PURE__ */ n(
815
953
  "input",
816
954
  {
817
955
  type: "text",
818
956
  value: e,
819
957
  onChange: (i) => t(i.target.value),
820
958
  placeholder: l,
821
- className: a.classes?.searchInput || "w-full pl-10 pr-10 py-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary transition-all"
959
+ className: r.classes?.searchInput || "w-full pl-10 pr-10 py-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary transition-all"
822
960
  }
823
961
  ),
824
- /* @__PURE__ */ b("div", { className: "absolute right-3 flex items-center gap-1.5", children: [
825
- o && /* @__PURE__ */ s("span", { className: "w-3.5 h-3.5 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
826
- e && /* @__PURE__ */ s(
962
+ /* @__PURE__ */ h("div", { className: "absolute right-3 flex items-center gap-1.5", children: [
963
+ o && /* @__PURE__ */ n("span", { className: "w-3.5 h-3.5 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
964
+ e && /* @__PURE__ */ n(
827
965
  "button",
828
966
  {
829
967
  type: "button",
830
- onClick: n,
968
+ onClick: s,
831
969
  className: "p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded-full hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors",
832
970
  title: "Clear search",
833
- children: /* @__PURE__ */ s(
971
+ children: /* @__PURE__ */ n(
834
972
  "svg",
835
973
  {
836
974
  className: "w-3.5 h-3.5",
@@ -838,139 +976,147 @@ const qt = ({
838
976
  stroke: "currentColor",
839
977
  viewBox: "0 0 24 24",
840
978
  xmlns: "http://www.w3.org/2000/svg",
841
- children: /* @__PURE__ */ s("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" })
979
+ children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" })
842
980
  }
843
981
  )
844
982
  }
845
983
  )
846
984
  ] })
847
985
  ] });
848
- }, Xt = ({
986
+ }, sr = ({
849
987
  columns: e,
850
988
  hasActions: t,
851
- actionsTitle: n = "Actions",
989
+ actionsTitle: s = "Actions",
852
990
  actionsWidth: o,
853
991
  sortBy: l,
854
- sortOrder: a,
992
+ sortOrder: r,
855
993
  onSort: i,
856
994
  selectable: g,
857
995
  allSelected: c,
858
996
  isIndeterminate: d,
859
- onToggleSelectAll: r
997
+ onToggleSelectAll: a,
998
+ headerClassName: u = ""
860
999
  }) => {
861
- const m = ee();
862
- return /* @__PURE__ */ s("thead", { className: m.classes?.thead || "bg-gray-50/80 dark:bg-slate-800/80 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ b("tr", { children: [
863
- g && /* @__PURE__ */ s("th", { className: "w-10 px-4 py-3 text-center align-middle", children: /* @__PURE__ */ s(
864
- "input",
865
- {
866
- type: "checkbox",
867
- checked: c,
868
- ref: (u) => {
869
- u && (u.indeterminate = !!d);
870
- },
871
- onChange: r,
872
- className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
873
- }
874
- ) }),
875
- e.map((u) => {
876
- const f = l === u.key, p = u.sortable !== !1 && !!i, k = u.align === "center" ? "text-center" : u.align === "right" ? "text-right" : "text-left";
877
- return /* @__PURE__ */ s(
878
- "th",
879
- {
880
- style: {
881
- width: u.width,
882
- minWidth: u.minWidth,
883
- maxWidth: u.maxWidth
884
- },
885
- onClick: () => p && i?.(String(u.key)),
886
- className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} ${k} ${u.headerClassName || ""} ${p ? "cursor-pointer hover:text-primary transition-colors group" : ""}`,
887
- children: /* @__PURE__ */ b(
888
- "div",
1000
+ const m = ee(), f = {};
1001
+ return m.colors?.theadBg && (f.backgroundColor = m.colors.theadBg), m.colors?.theadText && (f.color = m.colors.theadText), /* @__PURE__ */ n(
1002
+ "thead",
1003
+ {
1004
+ style: f,
1005
+ className: `${m.classes?.thead || "bg-gray-50/80 dark:bg-slate-800/80 border-b border-gray-200 dark:border-gray-800"} ${u}`,
1006
+ children: /* @__PURE__ */ h("tr", { children: [
1007
+ g && /* @__PURE__ */ n("th", { className: "w-10 px-4 py-3 text-center align-middle", children: /* @__PURE__ */ n(
1008
+ "input",
1009
+ {
1010
+ type: "checkbox",
1011
+ checked: c,
1012
+ ref: (b) => {
1013
+ b && (b.indeterminate = !!d);
1014
+ },
1015
+ onChange: a,
1016
+ className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
1017
+ }
1018
+ ) }),
1019
+ e.map((b) => {
1020
+ const k = l === b.key, C = b.sortable !== !1 && !!i, $ = b.align === "center" ? "text-center" : b.align === "right" ? "text-right" : "text-left";
1021
+ return /* @__PURE__ */ n(
1022
+ "th",
889
1023
  {
890
- className: `inline-flex items-center gap-1.5 ${u.align === "center" ? "justify-center" : u.align === "right" ? "justify-end" : "justify-start"}`,
891
- children: [
892
- /* @__PURE__ */ s("span", { children: u.title }),
893
- p && /* @__PURE__ */ s(
894
- "span",
895
- {
896
- className: `inline-flex flex-col text-[10px] transition-transform ${f ? "text-primary scale-110" : "text-gray-400 opacity-40 group-hover:opacity-100"}`,
897
- children: f ? a === "asc" ? "▲" : "▼" : /* @__PURE__ */ s("span", { className: "text-[9px] leading-none opacity-50", children: "▲▼" })
898
- }
899
- )
900
- ]
901
- }
902
- )
903
- },
904
- String(u.key)
905
- );
906
- }),
907
- t && /* @__PURE__ */ s(
908
- "th",
909
- {
910
- style: { width: o || "auto" },
911
- className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} text-right pr-6`,
912
- children: n
913
- }
914
- )
915
- ] }) });
916
- }, _ = () => /* @__PURE__ */ s("span", { className: "text-gray-400 dark:text-gray-500 font-mono text-sm", children: "—" }), Ze = ({ value: e }) => {
1024
+ style: {
1025
+ width: b.width,
1026
+ minWidth: b.minWidth,
1027
+ maxWidth: b.maxWidth
1028
+ },
1029
+ onClick: () => C && i?.(String(b.key)),
1030
+ className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} ${$} ${b.headerClassName || ""} ${C ? "cursor-pointer hover:text-primary transition-colors group" : ""}`,
1031
+ children: /* @__PURE__ */ h(
1032
+ "div",
1033
+ {
1034
+ className: `inline-flex items-center gap-1.5 ${b.align === "center" ? "justify-center" : b.align === "right" ? "justify-end" : "justify-start"}`,
1035
+ children: [
1036
+ /* @__PURE__ */ n("span", { children: b.title }),
1037
+ C && /* @__PURE__ */ n(
1038
+ "span",
1039
+ {
1040
+ className: `inline-flex flex-col text-[10px] transition-transform ${k ? "text-primary scale-110" : "text-gray-400 opacity-40 group-hover:opacity-100"}`,
1041
+ children: k ? r === "asc" ? "▲" : "▼" : /* @__PURE__ */ n("span", { className: "text-[9px] leading-none opacity-50", children: "▲▼" })
1042
+ }
1043
+ )
1044
+ ]
1045
+ }
1046
+ )
1047
+ },
1048
+ String(b.key)
1049
+ );
1050
+ }),
1051
+ t && /* @__PURE__ */ n(
1052
+ "th",
1053
+ {
1054
+ style: { width: o || "auto" },
1055
+ className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} text-right pr-6`,
1056
+ children: s
1057
+ }
1058
+ )
1059
+ ] })
1060
+ }
1061
+ );
1062
+ }, M = () => /* @__PURE__ */ n("span", { className: "text-gray-400 dark:text-gray-500 font-mono text-sm", children: "—" }), at = ({ value: e }) => {
917
1063
  if (e == null || e === "")
918
- return /* @__PURE__ */ s(_, {});
1064
+ return /* @__PURE__ */ n(M, {});
919
1065
  const t = String(e);
920
- return /* @__PURE__ */ s("span", { className: "truncate block max-w-xs font-normal text-sm", title: t, children: t });
921
- }, Qt = ({ value: e }) => {
1066
+ return /* @__PURE__ */ n("span", { className: "truncate block max-w-xs font-normal text-sm", title: t, children: t });
1067
+ }, or = ({ value: e }) => {
922
1068
  if (e == null || isNaN(Number(e)))
923
- return /* @__PURE__ */ s(_, {});
1069
+ return /* @__PURE__ */ n(M, {});
924
1070
  const t = Number(e);
925
- return /* @__PURE__ */ s("span", { className: "font-mono text-sm font-medium", children: t.toLocaleString() });
926
- }, er = ({ value: e }) => {
1071
+ return /* @__PURE__ */ n("span", { className: "font-mono text-sm font-medium", children: t.toLocaleString() });
1072
+ }, ir = ({ value: e }) => {
927
1073
  if (e == null)
928
- return /* @__PURE__ */ s(_, {});
1074
+ return /* @__PURE__ */ n(M, {});
929
1075
  const t = !!e;
930
- return /* @__PURE__ */ b(
1076
+ return /* @__PURE__ */ h(
931
1077
  "span",
932
1078
  {
933
1079
  className: `inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-semibold tracking-wide ${t ? "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20" : "bg-rose-500/10 text-rose-600 dark:text-rose-400 border border-rose-500/20"}`,
934
1080
  children: [
935
- /* @__PURE__ */ s("span", { className: `w-1.5 h-1.5 rounded-full ${t ? "bg-emerald-500" : "bg-rose-500"}` }),
1081
+ /* @__PURE__ */ n("span", { className: `w-1.5 h-1.5 rounded-full ${t ? "bg-emerald-500" : "bg-rose-500"}` }),
936
1082
  t ? "Yes" : "No"
937
1083
  ]
938
1084
  }
939
1085
  );
940
- }, Ke = ({
1086
+ }, Ye = ({
941
1087
  value: e,
942
1088
  isDateTime: t = !1
943
1089
  }) => {
944
- if (!e) return /* @__PURE__ */ s(_, {});
945
- const n = e instanceof Date ? e : new Date(e);
946
- return isNaN(n.getTime()) ? /* @__PURE__ */ s(Ze, { value: e, column: { key: "" } }) : /* @__PURE__ */ b("span", { className: "whitespace-nowrap text-xs sm:text-sm font-medium text-gray-700 dark:text-gray-300", children: [
947
- n.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }),
948
- t && /* @__PURE__ */ s("span", { className: "text-xs text-gray-400 dark:text-gray-500 ml-1.5", children: n.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" }) })
1090
+ if (!e) return /* @__PURE__ */ n(M, {});
1091
+ const s = e instanceof Date ? e : new Date(e);
1092
+ return isNaN(s.getTime()) ? /* @__PURE__ */ n(at, { value: e, column: { key: "" } }) : /* @__PURE__ */ h("span", { className: "whitespace-nowrap text-xs sm:text-sm font-medium text-gray-700 dark:text-gray-300", children: [
1093
+ s.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }),
1094
+ t && /* @__PURE__ */ n("span", { className: "text-xs text-gray-400 dark:text-gray-500 ml-1.5", children: s.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" }) })
949
1095
  ] });
950
- }, tr = ({ value: e, column: t }) => {
1096
+ }, lr = ({ value: e, column: t }) => {
951
1097
  if (e == null || isNaN(Number(e)))
952
- return /* @__PURE__ */ s(_, {});
953
- const n = Number(e), o = t.currency || "EGP";
954
- return /* @__PURE__ */ b("span", { className: "font-mono text-sm font-bold text-gray-900 dark:text-white", children: [
955
- n.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 }),
1098
+ return /* @__PURE__ */ n(M, {});
1099
+ const s = Number(e), o = t.currency || "EGP";
1100
+ return /* @__PURE__ */ h("span", { className: "font-mono text-sm font-bold text-gray-900 dark:text-white", children: [
1101
+ s.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 }),
956
1102
  " ",
957
- /* @__PURE__ */ s("span", { className: "text-xs font-normal text-gray-500 dark:text-gray-400", children: o })
1103
+ /* @__PURE__ */ n("span", { className: "text-xs font-normal text-gray-500 dark:text-gray-400", children: o })
958
1104
  ] });
959
- }, Ge = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E", rr = ({ value: e }) => {
1105
+ }, Ze = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E", dr = ({ value: e }) => {
960
1106
  let t = "";
961
- return typeof e == "string" ? t = e : Array.isArray(e) && e.length > 0 ? t = typeof e[0] == "string" ? e[0] : e[0]?.url || "" : e && typeof e == "object" && (t = e.url || ""), t || (t = Ge), /* @__PURE__ */ s("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ s(
1107
+ return typeof e == "string" ? t = e : Array.isArray(e) && e.length > 0 ? t = typeof e[0] == "string" ? e[0] : e[0]?.url || "" : e && typeof e == "object" && (t = e.url || ""), t || (t = Ze), /* @__PURE__ */ n("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ n(
962
1108
  "img",
963
1109
  {
964
1110
  src: t,
965
1111
  alt: "Thumbnail",
966
1112
  className: "w-10 h-10 rounded-full object-cover border border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 shadow-sm",
967
1113
  loading: "lazy",
968
- onError: (n) => {
969
- n.target.src = Ge;
1114
+ onError: (s) => {
1115
+ s.target.src = Ze;
970
1116
  }
971
1117
  }
972
1118
  ) });
973
- }, ar = {
1119
+ }, cr = {
974
1120
  active: { bg: "bg-emerald-500/10 border-emerald-500/20", text: "text-emerald-600 dark:text-emerald-400", dot: "bg-emerald-500" },
975
1121
  delivered: { bg: "bg-emerald-500/10 border-emerald-500/20", text: "text-emerald-600 dark:text-emerald-400", dot: "bg-emerald-500" },
976
1122
  completed: { bg: "bg-emerald-500/10 border-emerald-500/20", text: "text-emerald-600 dark:text-emerald-400", dot: "bg-emerald-500" },
@@ -986,56 +1132,56 @@ const qt = ({
986
1132
  cancelled: { bg: "bg-rose-500/10 border-rose-500/20", text: "text-rose-600 dark:text-rose-400", dot: "bg-rose-500" },
987
1133
  offline: { bg: "bg-gray-500/10 border-gray-500/20", text: "text-gray-600 dark:text-gray-400", dot: "bg-gray-500" },
988
1134
  closed: { bg: "bg-gray-500/10 border-gray-500/20", text: "text-gray-600 dark:text-gray-400", dot: "bg-gray-500" }
989
- }, nr = ({ value: e, column: t }) => {
1135
+ }, gr = ({ value: e, column: t }) => {
990
1136
  if (e == null || e === "")
991
- return /* @__PURE__ */ s(_, {});
992
- const n = String(e), o = n.toLowerCase();
993
- if (t.statusMap && t.statusMap[n]) {
994
- const a = t.statusMap[n];
995
- return /* @__PURE__ */ b(
1137
+ return /* @__PURE__ */ n(M, {});
1138
+ const s = String(e), o = s.toLowerCase();
1139
+ if (t.statusMap && t.statusMap[s]) {
1140
+ const r = t.statusMap[s];
1141
+ return /* @__PURE__ */ h(
996
1142
  "span",
997
1143
  {
998
1144
  className: "inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-bold uppercase tracking-wider border",
999
- style: { color: a.color, backgroundColor: a.bg },
1145
+ style: { color: r.color, backgroundColor: r.bg },
1000
1146
  children: [
1001
- /* @__PURE__ */ s("span", { className: "w-1.5 h-1.5 rounded-full", style: { backgroundColor: a.color } }),
1002
- a.label || n
1147
+ /* @__PURE__ */ n("span", { className: "w-1.5 h-1.5 rounded-full", style: { backgroundColor: r.color } }),
1148
+ r.label || s
1003
1149
  ]
1004
1150
  }
1005
1151
  );
1006
1152
  }
1007
- const l = ar[o] || {
1153
+ const l = cr[o] || {
1008
1154
  bg: "bg-gray-500/10 border-gray-500/20",
1009
1155
  text: "text-gray-700 dark:text-gray-300",
1010
1156
  dot: "bg-gray-400"
1011
1157
  };
1012
- return /* @__PURE__ */ b(
1158
+ return /* @__PURE__ */ h(
1013
1159
  "span",
1014
1160
  {
1015
1161
  className: `inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-bold uppercase tracking-wider border ${l.bg} ${l.text}`,
1016
1162
  children: [
1017
- /* @__PURE__ */ s("span", { className: `w-1.5 h-1.5 rounded-full ${l.dot}` }),
1018
- n
1163
+ /* @__PURE__ */ n("span", { className: `w-1.5 h-1.5 rounded-full ${l.dot}` }),
1164
+ s
1019
1165
  ]
1020
1166
  }
1021
1167
  );
1022
- }, sr = ({ value: e }) => !Array.isArray(e) || e.length === 0 ? /* @__PURE__ */ s(_, {}) : /* @__PURE__ */ b("div", { className: "flex flex-wrap gap-1 items-center", children: [
1023
- e.slice(0, 3).map((t, n) => /* @__PURE__ */ s(
1168
+ }, mr = ({ value: e }) => !Array.isArray(e) || e.length === 0 ? /* @__PURE__ */ n(M, {}) : /* @__PURE__ */ h("div", { className: "flex flex-wrap gap-1 items-center", children: [
1169
+ e.slice(0, 3).map((t, s) => /* @__PURE__ */ n(
1024
1170
  "span",
1025
1171
  {
1026
1172
  className: "inline-block px-2 py-0.5 text-xs rounded bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-gray-700",
1027
1173
  children: typeof t == "object" ? JSON.stringify(t) : String(t)
1028
1174
  },
1029
- n
1175
+ s
1030
1176
  )),
1031
- e.length > 3 && /* @__PURE__ */ b("span", { className: "text-xs text-gray-400 font-medium", children: [
1177
+ e.length > 3 && /* @__PURE__ */ h("span", { className: "text-xs text-gray-400 font-medium", children: [
1032
1178
  "+",
1033
1179
  e.length - 3
1034
1180
  ] })
1035
- ] }), or = ({ value: e }) => !e || typeof e != "object" ? /* @__PURE__ */ s(_, {}) : "en" in e || "ar" in e ? /* @__PURE__ */ s("span", { className: "font-medium text-sm", children: e.en || e.ar || "" }) : /* @__PURE__ */ s("span", { className: "font-mono text-xs text-gray-500 dark:text-gray-400 truncate block max-w-xs", title: JSON.stringify(e), children: JSON.stringify(e) }), ir = ({ value: e }) => {
1036
- if (!e) return /* @__PURE__ */ s(_, {});
1181
+ ] }), ur = ({ value: e }) => !e || typeof e != "object" ? /* @__PURE__ */ n(M, {}) : "en" in e || "ar" in e ? /* @__PURE__ */ n("span", { className: "font-medium text-sm", children: e.en || e.ar || "" }) : /* @__PURE__ */ n("span", { className: "font-mono text-xs text-gray-500 dark:text-gray-400 truncate block max-w-xs", title: JSON.stringify(e), children: JSON.stringify(e) }), fr = ({ value: e }) => {
1182
+ if (!e) return /* @__PURE__ */ n(M, {});
1037
1183
  const t = String(e);
1038
- return /* @__PURE__ */ b(
1184
+ return /* @__PURE__ */ h(
1039
1185
  "a",
1040
1186
  {
1041
1187
  href: t,
@@ -1043,15 +1189,15 @@ const qt = ({
1043
1189
  rel: "noopener noreferrer",
1044
1190
  className: "text-primary hover:underline text-sm font-medium inline-flex items-center gap-1",
1045
1191
  children: [
1046
- /* @__PURE__ */ s("span", { className: "truncate max-w-[150px]", children: t }),
1047
- /* @__PURE__ */ s("span", { className: "text-xs", children: "↗" })
1192
+ /* @__PURE__ */ n("span", { className: "truncate max-w-[150px]", children: t }),
1193
+ /* @__PURE__ */ n("span", { className: "text-xs", children: "↗" })
1048
1194
  ]
1049
1195
  }
1050
1196
  );
1051
- }, lr = ({ value: e }) => {
1052
- if (!e) return /* @__PURE__ */ s(_, {});
1197
+ }, br = ({ value: e }) => {
1198
+ if (!e) return /* @__PURE__ */ n(M, {});
1053
1199
  const t = String(e);
1054
- return /* @__PURE__ */ s(
1200
+ return /* @__PURE__ */ n(
1055
1201
  "a",
1056
1202
  {
1057
1203
  href: `mailto:${t}`,
@@ -1059,10 +1205,10 @@ const qt = ({
1059
1205
  children: t
1060
1206
  }
1061
1207
  );
1062
- }, dr = ({ value: e }) => {
1063
- if (!e) return /* @__PURE__ */ s(_, {});
1208
+ }, yr = ({ value: e }) => {
1209
+ if (!e) return /* @__PURE__ */ n(M, {});
1064
1210
  const t = String(e);
1065
- return /* @__PURE__ */ s(
1211
+ return /* @__PURE__ */ n(
1066
1212
  "a",
1067
1213
  {
1068
1214
  href: `tel:${t}`,
@@ -1070,78 +1216,78 @@ const qt = ({
1070
1216
  children: t
1071
1217
  }
1072
1218
  );
1073
- }, cr = ({ row: e, column: t, rowIndex: n }) => {
1074
- const o = S(e, t.key);
1219
+ }, hr = ({ row: e, column: t, rowIndex: s }) => {
1220
+ const o = P(e, t.key);
1075
1221
  if (t.render && typeof t.render == "function")
1076
- return /* @__PURE__ */ s(Se, { children: t.render(o, e, n) });
1222
+ return /* @__PURE__ */ n(Ce, { children: t.render(o, e, s) });
1077
1223
  if (t.formatter && typeof t.formatter == "function")
1078
- return /* @__PURE__ */ s(Se, { children: t.formatter(o, e, n) });
1224
+ return /* @__PURE__ */ n(Ce, { children: t.formatter(o, e, s) });
1079
1225
  switch (t.type) {
1080
1226
  case "boolean":
1081
- return /* @__PURE__ */ s(er, { value: o, column: t });
1227
+ return /* @__PURE__ */ n(ir, { value: o, column: t });
1082
1228
  case "number":
1083
- return /* @__PURE__ */ s(Qt, { value: o, column: t });
1229
+ return /* @__PURE__ */ n(or, { value: o, column: t });
1084
1230
  case "currency":
1085
- return /* @__PURE__ */ s(tr, { value: o, column: t });
1231
+ return /* @__PURE__ */ n(lr, { value: o, column: t });
1086
1232
  case "date":
1087
- return /* @__PURE__ */ s(Ke, { value: o, column: t, isDateTime: !1 });
1233
+ return /* @__PURE__ */ n(Ye, { value: o, column: t, isDateTime: !1 });
1088
1234
  case "datetime":
1089
- return /* @__PURE__ */ s(Ke, { value: o, column: t, isDateTime: !0 });
1235
+ return /* @__PURE__ */ n(Ye, { value: o, column: t, isDateTime: !0 });
1090
1236
  case "image":
1091
- return /* @__PURE__ */ s(rr, { value: o, column: t });
1237
+ return /* @__PURE__ */ n(dr, { value: o, column: t });
1092
1238
  case "status":
1093
- return /* @__PURE__ */ s(nr, { value: o, column: t });
1239
+ return /* @__PURE__ */ n(gr, { value: o, column: t });
1094
1240
  case "array":
1095
- return /* @__PURE__ */ s(sr, { value: o, column: t });
1241
+ return /* @__PURE__ */ n(mr, { value: o, column: t });
1096
1242
  case "object":
1097
- return /* @__PURE__ */ s(or, { value: o, column: t });
1243
+ return /* @__PURE__ */ n(ur, { value: o, column: t });
1098
1244
  case "url":
1099
- return /* @__PURE__ */ s(ir, { value: o, column: t });
1245
+ return /* @__PURE__ */ n(fr, { value: o, column: t });
1100
1246
  case "email":
1101
- return /* @__PURE__ */ s(lr, { value: o, column: t });
1247
+ return /* @__PURE__ */ n(br, { value: o, column: t });
1102
1248
  case "phone":
1103
- return /* @__PURE__ */ s(dr, { value: o, column: t });
1249
+ return /* @__PURE__ */ n(yr, { value: o, column: t });
1104
1250
  default:
1105
- return /* @__PURE__ */ s(Ze, { value: o, column: t });
1251
+ return /* @__PURE__ */ n(at, { value: o, column: t });
1106
1252
  }
1107
- }, gr = ({
1253
+ }, pr = ({
1108
1254
  isOpen: e,
1109
1255
  title: t,
1110
- message: n,
1256
+ message: s,
1111
1257
  confirmText: o = "Confirm",
1112
1258
  cancelText: l = "Cancel",
1113
- type: a = "danger",
1259
+ type: r = "danger",
1114
1260
  onClose: i,
1115
1261
  onConfirm: g,
1116
1262
  isLoading: c = !1
1117
- }) => (ye(() => {
1118
- const d = (r) => {
1119
- r.key === "Escape" && i();
1263
+ }) => (be(() => {
1264
+ const d = (a) => {
1265
+ a.key === "Escape" && i();
1120
1266
  };
1121
1267
  return e && window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
1122
- }, [e, i]), e ? /* @__PURE__ */ s(
1268
+ }, [e, i]), e ? /* @__PURE__ */ n(
1123
1269
  "div",
1124
1270
  {
1125
1271
  className: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm any-table-fade-in",
1126
1272
  onClick: i,
1127
- children: /* @__PURE__ */ b(
1273
+ children: /* @__PURE__ */ h(
1128
1274
  "div",
1129
1275
  {
1130
1276
  className: "bg-white dark:bg-slate-900 border border-gray-200 dark:border-gray-800 w-full max-w-md rounded-2xl p-6 shadow-2xl transform transition-all text-center",
1131
1277
  onClick: (d) => d.stopPropagation(),
1132
1278
  role: "dialog",
1133
1279
  children: [
1134
- /* @__PURE__ */ s(
1280
+ /* @__PURE__ */ n(
1135
1281
  "div",
1136
1282
  {
1137
- className: `mx-auto mb-4 w-14 h-14 rounded-full flex items-center justify-center text-2xl ${a === "danger" ? "bg-rose-500/10 text-rose-500" : a === "warning" ? "bg-amber-500/10 text-amber-500" : "bg-blue-500/10 text-blue-500"}`,
1138
- children: a === "danger" ? "⚠️" : a === "warning" ? "⚡" : "ℹ️"
1283
+ className: `mx-auto mb-4 w-14 h-14 rounded-full flex items-center justify-center text-2xl ${r === "danger" ? "bg-rose-500/10 text-rose-500" : r === "warning" ? "bg-amber-500/10 text-amber-500" : "bg-blue-500/10 text-blue-500"}`,
1284
+ children: r === "danger" ? "⚠️" : r === "warning" ? "⚡" : "ℹ️"
1139
1285
  }
1140
1286
  ),
1141
- /* @__PURE__ */ s("h3", { className: "text-xl font-black text-gray-900 dark:text-white mb-2", children: t }),
1142
- /* @__PURE__ */ s("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-6 leading-relaxed", children: n }),
1143
- /* @__PURE__ */ b("div", { className: "flex items-center justify-center gap-3", children: [
1144
- /* @__PURE__ */ s(
1287
+ /* @__PURE__ */ n("h3", { className: "text-xl font-black text-gray-900 dark:text-white mb-2", children: t }),
1288
+ /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-6 leading-relaxed", children: s }),
1289
+ /* @__PURE__ */ h("div", { className: "flex items-center justify-center gap-3", children: [
1290
+ /* @__PURE__ */ n(
1145
1291
  "button",
1146
1292
  {
1147
1293
  type: "button",
@@ -1151,13 +1297,13 @@ const qt = ({
1151
1297
  children: l
1152
1298
  }
1153
1299
  ),
1154
- /* @__PURE__ */ s(
1300
+ /* @__PURE__ */ n(
1155
1301
  "button",
1156
1302
  {
1157
1303
  type: "button",
1158
1304
  disabled: c,
1159
1305
  onClick: g,
1160
- className: `w-full py-2.5 px-4 rounded-xl font-bold text-sm text-white transition-all shadow-md active:scale-95 disabled:opacity-50 ${a === "danger" ? "bg-rose-600 hover:bg-rose-700 shadow-rose-600/30" : "bg-primary hover:bg-primary-soft shadow-primary/30"}`,
1306
+ className: `w-full py-2.5 px-4 rounded-xl font-bold text-sm text-white transition-all shadow-md active:scale-95 disabled:opacity-50 ${r === "danger" ? "bg-rose-600 hover:bg-rose-700 shadow-rose-600/30" : "bg-primary hover:bg-primary-soft shadow-primary/30"}`,
1161
1307
  children: c ? "Processing..." : o
1162
1308
  }
1163
1309
  )
@@ -1166,7 +1312,34 @@ const qt = ({
1166
1312
  }
1167
1313
  )
1168
1314
  }
1169
- ) : null), Ye = {
1315
+ ) : null);
1316
+ function nt(e, t) {
1317
+ if (!e) return null;
1318
+ if (Xe.isValidElement(e))
1319
+ return e;
1320
+ if (typeof e == "function") {
1321
+ if (e.prototype && e.prototype.isReactComponent)
1322
+ return /* @__PURE__ */ n(e, { className: "w-4 h-4 shrink-0" });
1323
+ const s = e.displayName || e.name || "";
1324
+ if (/^[A-Z]/.test(s))
1325
+ return /* @__PURE__ */ n(e, { className: "w-4 h-4 shrink-0" });
1326
+ try {
1327
+ const l = e(t);
1328
+ return nt(l, t);
1329
+ } catch {
1330
+ return /* @__PURE__ */ n(e, { className: "w-4 h-4 shrink-0" });
1331
+ }
1332
+ }
1333
+ return typeof e == "object" && e !== null && (e.$$typeof || e.render) ? /* @__PURE__ */ n(e, { className: "w-4 h-4 shrink-0" }) : typeof e == "string" ? e.startsWith("http://") || e.startsWith("https://") || e.startsWith("/") || e.startsWith("./") || e.startsWith("data:image/") || /\.(png|jpe?g|svg|webp|gif|ico)$/i.test(e) ? /* @__PURE__ */ n(
1334
+ "img",
1335
+ {
1336
+ src: e,
1337
+ alt: "action-icon",
1338
+ className: "w-4 h-4 object-contain shrink-0 inline-block"
1339
+ }
1340
+ ) : /* @__PURE__ */ n("span", { className: "inline-flex items-center justify-center leading-none text-base", children: e }) : e;
1341
+ }
1342
+ const Je = {
1170
1343
  primary: "bg-primary text-white hover:bg-primary-soft shadow-sm shadow-primary/20",
1171
1344
  secondary: "bg-emerald-600 text-white hover:bg-emerald-700 shadow-sm shadow-emerald-600/20",
1172
1345
  success: "bg-emerald-500 text-white hover:bg-emerald-600 shadow-sm shadow-emerald-500/20",
@@ -1175,107 +1348,107 @@ const qt = ({
1175
1348
  info: "bg-sky-500 text-white hover:bg-sky-600 shadow-sm shadow-sky-500/20",
1176
1349
  neutral: "bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-700 border border-gray-200 dark:border-gray-700",
1177
1350
  ghost: "bg-transparent text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"
1178
- }, ur = ({ row: e, actions: t, context: n }) => {
1179
- const [o, l] = v(null), [a, i] = v({});
1351
+ }, xr = ({ row: e, actions: t, context: s }) => {
1352
+ const [o, l] = S(null), [r, i] = S({});
1180
1353
  if (!t || !t.length)
1181
1354
  return null;
1182
- const g = async (r) => {
1183
- if (r.confirmation) {
1184
- const m = typeof r.confirmation.title == "function" ? r.confirmation.title(e) : r.confirmation.title || "Confirm Action", u = typeof r.confirmation.message == "function" ? r.confirmation.message(e) : r.confirmation.message || "Are you sure you want to perform this action?";
1355
+ const g = async (a) => {
1356
+ if (a.confirmation) {
1357
+ const u = typeof a.confirmation.title == "function" ? a.confirmation.title(e) : a.confirmation.title || "Confirm Action", m = typeof a.confirmation.message == "function" ? a.confirmation.message(e) : a.confirmation.message || "Are you sure you want to perform this action?";
1185
1358
  l({
1186
1359
  isOpen: !0,
1187
- title: m,
1188
- message: u,
1189
- confirmText: r.confirmation.confirmText || "Confirm",
1190
- cancelText: r.confirmation.cancelText || "Cancel",
1191
- type: r.confirmation.type || "danger",
1360
+ title: u,
1361
+ message: m,
1362
+ confirmText: a.confirmation.confirmText || "Confirm",
1363
+ cancelText: a.confirmation.cancelText || "Cancel",
1364
+ type: a.confirmation.type || "danger",
1192
1365
  onConfirm: async () => {
1193
- l(null), await c(r);
1366
+ l(null), await c(a);
1194
1367
  }
1195
1368
  });
1196
1369
  return;
1197
1370
  }
1198
- await c(r);
1199
- }, c = async (r) => {
1200
- if (r.type === "button" || !r.type) {
1201
- i((m) => ({ ...m, [r.id]: !0 }));
1371
+ await c(a);
1372
+ }, c = async (a) => {
1373
+ if (a.type === "button" || !a.type) {
1374
+ i((u) => ({ ...u, [a.id]: !0 }));
1202
1375
  try {
1203
- await r.onClick(e, n);
1376
+ await a.onClick(e, s);
1204
1377
  } finally {
1205
- i((m) => ({ ...m, [r.id]: !1 }));
1378
+ i((u) => ({ ...u, [a.id]: !1 }));
1206
1379
  }
1207
1380
  }
1208
- }, d = async (r, m) => {
1209
- const u = !m;
1210
- i((f) => ({ ...f, [r.id]: !0 }));
1381
+ }, d = async (a, u) => {
1382
+ const m = !u;
1383
+ i((f) => ({ ...f, [a.id]: !0 }));
1211
1384
  try {
1212
- await r.onChange(e, u, n);
1385
+ await a.onChange(e, m, s);
1213
1386
  } finally {
1214
- i((f) => ({ ...f, [r.id]: !1 }));
1387
+ i((f) => ({ ...f, [a.id]: !1 }));
1215
1388
  }
1216
1389
  };
1217
- return /* @__PURE__ */ b(Se, { children: [
1218
- /* @__PURE__ */ s("div", { className: "flex items-center justify-end gap-2 pr-2", children: t.map((r) => {
1219
- if (typeof r.hide == "function" && r.hide(e) || typeof r.show == "function" && !r.show(e)) return null;
1220
- const m = typeof r.disabled == "function" ? r.disabled(e) : !!r.disabled, u = a[r.id] || (typeof r.loading == "function" ? r.loading(e) : !!r.loading), f = typeof r.label == "function" ? r.label(e) : r.label, p = typeof r.icon == "function" ? r.icon(e) : r.icon, k = typeof r.tooltip == "function" ? r.tooltip(e) : r.tooltip, E = typeof r.className == "function" ? r.className(e) : r.className || "";
1221
- if (r.type === "custom" && r.render)
1222
- return /* @__PURE__ */ s(Nt.Fragment, { children: r.render(e, n) }, r.id);
1223
- if (r.type === "switch") {
1224
- const M = r, N = M.checked(e);
1225
- return /* @__PURE__ */ b(
1390
+ return /* @__PURE__ */ h(Ce, { children: [
1391
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-2 pr-2", children: t.map((a) => {
1392
+ if (typeof a.hide == "function" && a.hide(e) || typeof a.show == "function" && !a.show(e)) return null;
1393
+ const u = typeof a.disabled == "function" ? a.disabled(e) : !!a.disabled, m = r[a.id] || (typeof a.loading == "function" ? a.loading(e) : !!a.loading), f = typeof a.label == "function" ? a.label(e) : a.label, b = nt(a.icon, e), k = typeof a.tooltip == "function" ? a.tooltip(e) : a.tooltip, C = typeof a.className == "function" ? a.className(e) : a.className || "";
1394
+ if (a.type === "custom" && a.render)
1395
+ return /* @__PURE__ */ n(Xe.Fragment, { children: a.render(e, s) }, a.id);
1396
+ if (a.type === "switch") {
1397
+ const v = a, w = v.checked(e);
1398
+ return /* @__PURE__ */ h(
1226
1399
  "div",
1227
1400
  {
1228
1401
  className: "flex items-center gap-2",
1229
1402
  title: k || f,
1230
1403
  children: [
1231
- f && /* @__PURE__ */ b("span", { className: "text-xs font-semibold text-gray-500", children: [
1404
+ f && /* @__PURE__ */ h("span", { className: "text-xs font-semibold text-gray-500", children: [
1232
1405
  f,
1233
1406
  ":"
1234
1407
  ] }),
1235
- /* @__PURE__ */ s(
1408
+ /* @__PURE__ */ n(
1236
1409
  "button",
1237
1410
  {
1238
1411
  type: "button",
1239
1412
  role: "switch",
1240
- "aria-checked": N,
1241
- disabled: m || u,
1242
- onClick: () => d(M, N),
1243
- className: `relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${N ? "bg-emerald-500" : "bg-gray-300 dark:bg-gray-700"} ${E}`,
1244
- children: /* @__PURE__ */ s(
1413
+ "aria-checked": w,
1414
+ disabled: u || m,
1415
+ onClick: () => d(v, w),
1416
+ className: `relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${w ? "bg-emerald-500" : "bg-gray-300 dark:bg-gray-700"} ${C}`,
1417
+ children: /* @__PURE__ */ n(
1245
1418
  "span",
1246
1419
  {
1247
1420
  "aria-hidden": "true",
1248
- className: `pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out flex items-center justify-center ${N ? "translate-x-5" : "translate-x-0"}`,
1249
- children: u && /* @__PURE__ */ s("span", { className: "w-2.5 h-2.5 border-2 border-primary border-t-transparent rounded-full animate-spin" })
1421
+ className: `pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out flex items-center justify-center ${w ? "translate-x-5" : "translate-x-0"}`,
1422
+ children: m && /* @__PURE__ */ n("span", { className: "w-2.5 h-2.5 border-2 border-primary border-t-transparent rounded-full animate-spin" })
1250
1423
  }
1251
1424
  )
1252
1425
  }
1253
1426
  )
1254
1427
  ]
1255
1428
  },
1256
- r.id
1429
+ a.id
1257
1430
  );
1258
1431
  }
1259
- const h = typeof r.variant == "function" ? r.variant(e) : r.variant || "neutral", D = Ye[h] || Ye.neutral;
1260
- return /* @__PURE__ */ b(
1432
+ const $ = typeof a.variant == "function" ? a.variant(e) : a.variant || "neutral", F = Je[$] || Je.neutral, x = !f && b ? "p-2 min-w-[2rem]" : "px-3 py-1.5";
1433
+ return /* @__PURE__ */ h(
1261
1434
  "button",
1262
1435
  {
1263
1436
  type: "button",
1264
- disabled: m || u,
1265
- onClick: () => g(r),
1437
+ disabled: u || m,
1438
+ onClick: () => g(a),
1266
1439
  title: k,
1267
- style: r.color ? { backgroundColor: r.color, color: "#ffffff" } : void 0,
1268
- className: `inline-flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-xl text-xs font-bold transition-all duration-200 active:scale-95 disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100 ${D} ${E}`,
1440
+ style: a.color ? { backgroundColor: a.color, color: "#ffffff" } : void 0,
1441
+ className: `inline-flex items-center justify-center gap-1.5 ${x} rounded-xl text-xs font-bold transition-all duration-200 active:scale-95 disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100 ${F} ${C}`,
1269
1442
  children: [
1270
- u ? /* @__PURE__ */ s("span", { className: "w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full animate-spin" }) : p && /* @__PURE__ */ s("span", { className: "text-sm", children: p }),
1271
- f && /* @__PURE__ */ s("span", { children: f })
1443
+ m ? /* @__PURE__ */ n("span", { className: "w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full animate-spin" }) : b && /* @__PURE__ */ n("span", { className: "text-sm flex items-center justify-center shrink-0", children: b }),
1444
+ f && /* @__PURE__ */ n("span", { children: f })
1272
1445
  ]
1273
1446
  },
1274
- r.id
1447
+ a.id
1275
1448
  );
1276
1449
  }) }),
1277
- o && /* @__PURE__ */ s(
1278
- gr,
1450
+ o && /* @__PURE__ */ n(
1451
+ pr,
1279
1452
  {
1280
1453
  isOpen: o.isOpen,
1281
1454
  title: o.title,
@@ -1288,70 +1461,71 @@ const qt = ({
1288
1461
  }
1289
1462
  )
1290
1463
  ] });
1291
- }, mr = ({
1464
+ }, kr = ({
1292
1465
  rows: e,
1293
1466
  columns: t,
1294
- actions: n,
1467
+ actions: s,
1295
1468
  actionContext: o,
1296
1469
  rowKeyResolver: l,
1297
- selectable: a,
1470
+ selectable: r,
1298
1471
  selectedKeys: i,
1299
1472
  onToggleSelectRow: g,
1300
1473
  onRowClick: c,
1301
1474
  striped: d = !1,
1302
- hoverable: r = !0
1475
+ hoverable: a = !0,
1476
+ rowClassName: u
1303
1477
  }) => {
1304
- const m = ee(), u = !!(n && n.length > 0);
1305
- return /* @__PURE__ */ s("tbody", { className: m.classes?.tbody || "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900", children: e.map((f, p) => {
1306
- const k = l(f, p), E = i?.has(k);
1307
- return /* @__PURE__ */ b(
1478
+ const m = ee(), f = !!(s && s.length > 0);
1479
+ return /* @__PURE__ */ n("tbody", { className: m.classes?.tbody || "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900", children: e.map((b, k) => {
1480
+ const C = l(b, k), $ = i?.has(C), F = typeof u == "function" ? u(b, k) : u || "";
1481
+ return /* @__PURE__ */ h(
1308
1482
  "tr",
1309
1483
  {
1310
- onClick: (h) => c?.(f, p, h),
1311
- className: `${m.classes?.tr || "transition-colors duration-150"} ${d && p % 2 === 1 ? "bg-gray-50/40 dark:bg-slate-800/20" : ""} ${r ? "hover:bg-gray-50/70 dark:hover:bg-slate-800/50" : ""} ${E ? "bg-primary/5 dark:bg-primary/10" : ""} ${c ? "cursor-pointer" : ""}`,
1484
+ onClick: (x) => c?.(b, k, x),
1485
+ className: `${m.classes?.tr || "transition-colors duration-150"} ${d && k % 2 === 1 ? "bg-gray-50/40 dark:bg-slate-800/20" : ""} ${a ? "hover:bg-gray-50/70 dark:hover:bg-slate-800/50" : ""} ${$ ? "bg-primary/5 dark:bg-primary/10" : ""} ${c ? "cursor-pointer" : ""} ${F}`,
1312
1486
  children: [
1313
- a && /* @__PURE__ */ s(
1487
+ r && /* @__PURE__ */ n(
1314
1488
  "td",
1315
1489
  {
1316
1490
  className: "w-10 px-4 py-3 text-center align-middle",
1317
- onClick: (h) => h.stopPropagation(),
1318
- children: /* @__PURE__ */ s(
1491
+ onClick: (x) => x.stopPropagation(),
1492
+ children: /* @__PURE__ */ n(
1319
1493
  "input",
1320
1494
  {
1321
1495
  type: "checkbox",
1322
- checked: E,
1323
- onChange: () => g?.(k, f),
1496
+ checked: $,
1497
+ onChange: () => g?.(C, b),
1324
1498
  className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
1325
1499
  }
1326
1500
  )
1327
1501
  }
1328
1502
  ),
1329
- t.map((h) => {
1330
- const D = h.align === "center" ? "text-center" : h.align === "right" ? "text-right" : "text-left", M = typeof h.className == "function" ? h.className(f?.[h.key], f, p) : h.className || "";
1331
- return /* @__PURE__ */ s(
1503
+ t.map((x) => {
1504
+ const v = x.align === "center" ? "text-center" : x.align === "right" ? "text-right" : "text-left", w = typeof x.className == "function" ? x.className(b?.[x.key], b, k) : x.className || "";
1505
+ return /* @__PURE__ */ n(
1332
1506
  "td",
1333
1507
  {
1334
1508
  style: {
1335
- width: h.width,
1336
- minWidth: h.minWidth,
1337
- maxWidth: h.maxWidth
1509
+ width: x.width,
1510
+ minWidth: x.minWidth,
1511
+ maxWidth: x.maxWidth
1338
1512
  },
1339
- className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} ${D} ${M}`,
1340
- children: /* @__PURE__ */ s(cr, { row: f, column: h, rowIndex: p })
1513
+ className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} ${v} ${w}`,
1514
+ children: /* @__PURE__ */ n(hr, { row: b, column: x, rowIndex: k })
1341
1515
  },
1342
- String(h.key)
1516
+ String(x.key)
1343
1517
  );
1344
1518
  }),
1345
- u && /* @__PURE__ */ s(
1519
+ f && /* @__PURE__ */ n(
1346
1520
  "td",
1347
1521
  {
1348
1522
  className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} text-right`,
1349
- onClick: (h) => h.stopPropagation(),
1350
- children: /* @__PURE__ */ s(
1351
- ur,
1523
+ onClick: (x) => x.stopPropagation(),
1524
+ children: /* @__PURE__ */ n(
1525
+ xr,
1352
1526
  {
1353
- row: f,
1354
- actions: n || [],
1527
+ row: b,
1528
+ actions: s || [],
1355
1529
  context: o
1356
1530
  }
1357
1531
  )
@@ -1359,53 +1533,53 @@ const qt = ({
1359
1533
  )
1360
1534
  ]
1361
1535
  },
1362
- String(k)
1536
+ String(C)
1363
1537
  );
1364
1538
  }) });
1365
- }, fr = ({
1539
+ }, wr = ({
1366
1540
  page: e,
1367
1541
  pageSize: t,
1368
- totalRecords: n,
1542
+ totalRecords: s,
1369
1543
  totalPages: o,
1370
1544
  pageSizeOptions: l = [5, 10, 20, 50, 100],
1371
- onPageChange: a,
1545
+ onPageChange: r,
1372
1546
  onPageSizeChange: i,
1373
1547
  showPageSizeSelector: g = !0,
1374
1548
  showTotalCount: c = !0,
1375
1549
  pageWindow: d
1376
1550
  }) => {
1377
- const r = ee(), m = Math.min((e - 1) * t + 1, n), u = Math.min(e * t, n);
1378
- return /* @__PURE__ */ b(
1551
+ const a = ee(), u = Math.min((e - 1) * t + 1, s), m = Math.min(e * t, s);
1552
+ return /* @__PURE__ */ h(
1379
1553
  "div",
1380
1554
  {
1381
- className: r.classes?.paginationContainer || "w-full flex flex-wrap items-center justify-between gap-4 pt-4 text-sm text-gray-600 dark:text-gray-400",
1555
+ className: a.classes?.paginationContainer || "w-full flex flex-wrap items-center justify-between gap-4 pt-4 text-sm text-gray-600 dark:text-gray-400",
1382
1556
  children: [
1383
- /* @__PURE__ */ b("div", { className: "flex items-center gap-3", children: [
1384
- c && n > 0 ? /* @__PURE__ */ b("span", { className: "text-xs sm:text-sm font-medium", children: [
1557
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-3", children: [
1558
+ c && s > 0 ? /* @__PURE__ */ h("span", { className: "text-xs sm:text-sm font-medium", children: [
1385
1559
  "Showing ",
1386
- /* @__PURE__ */ s("strong", { className: "text-gray-900 dark:text-white font-bold", children: m }),
1560
+ /* @__PURE__ */ n("strong", { className: "text-gray-900 dark:text-white font-bold", children: u }),
1387
1561
  " to",
1388
1562
  " ",
1389
- /* @__PURE__ */ s("strong", { className: "text-gray-900 dark:text-white font-bold", children: u }),
1563
+ /* @__PURE__ */ n("strong", { className: "text-gray-900 dark:text-white font-bold", children: m }),
1390
1564
  " of",
1391
1565
  " ",
1392
- /* @__PURE__ */ s("strong", { className: "text-gray-900 dark:text-white font-bold", children: n.toLocaleString() }),
1566
+ /* @__PURE__ */ n("strong", { className: "text-gray-900 dark:text-white font-bold", children: s.toLocaleString() }),
1393
1567
  " results"
1394
- ] }) : /* @__PURE__ */ b("span", { className: "text-xs sm:text-sm font-medium", children: [
1568
+ ] }) : /* @__PURE__ */ h("span", { className: "text-xs sm:text-sm font-medium", children: [
1395
1569
  "Page ",
1396
1570
  e,
1397
1571
  " of ",
1398
1572
  o
1399
1573
  ] }),
1400
- g && /* @__PURE__ */ b("div", { className: "flex items-center gap-2 ml-2", children: [
1401
- /* @__PURE__ */ s("span", { className: "text-xs text-gray-500 hidden sm:inline", children: "Rows:" }),
1402
- /* @__PURE__ */ s(
1574
+ g && /* @__PURE__ */ h("div", { className: "flex items-center gap-2 ml-2", children: [
1575
+ /* @__PURE__ */ n("span", { className: "text-xs text-gray-500 hidden sm:inline", children: "Rows:" }),
1576
+ /* @__PURE__ */ n(
1403
1577
  "select",
1404
1578
  {
1405
1579
  value: t,
1406
1580
  onChange: (f) => i(Number(f.target.value)),
1407
- className: r.classes?.paginationSelect || "h-8 px-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-xs font-semibold text-gray-800 dark:text-gray-200 focus:outline-none focus:border-primary cursor-pointer",
1408
- children: l.map((f) => /* @__PURE__ */ b("option", { value: f, className: "bg-white dark:bg-slate-800 text-gray-900 dark:text-white", children: [
1581
+ className: a.classes?.paginationSelect || "h-8 px-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-xs font-semibold text-gray-800 dark:text-gray-200 focus:outline-none focus:border-primary cursor-pointer",
1582
+ children: l.map((f) => /* @__PURE__ */ h("option", { value: f, className: "bg-white dark:bg-slate-800 text-gray-900 dark:text-white", children: [
1409
1583
  f,
1410
1584
  " / page"
1411
1585
  ] }, f))
@@ -1413,39 +1587,39 @@ const qt = ({
1413
1587
  )
1414
1588
  ] })
1415
1589
  ] }),
1416
- /* @__PURE__ */ b("div", { className: "flex items-center gap-1.5 ml-auto", children: [
1417
- /* @__PURE__ */ s(
1590
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-1.5 ml-auto", children: [
1591
+ /* @__PURE__ */ n(
1418
1592
  "button",
1419
1593
  {
1420
1594
  type: "button",
1421
1595
  disabled: e <= 1,
1422
- onClick: () => a(e - 1),
1596
+ onClick: () => r(e - 1),
1423
1597
  "aria-label": "Previous Page",
1424
- className: `${r.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
1598
+ className: `${a.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
1425
1599
  children: "‹"
1426
1600
  }
1427
1601
  ),
1428
1602
  d.map((f) => {
1429
- const p = f === e;
1430
- return /* @__PURE__ */ s(
1603
+ const b = f === e;
1604
+ return /* @__PURE__ */ n(
1431
1605
  "button",
1432
1606
  {
1433
1607
  type: "button",
1434
- onClick: () => a(f),
1435
- className: `${r.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs"} ${p ? r.classes?.paginationButtonActive || "bg-primary text-white shadow-sm shadow-primary/30" : "bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700"}`,
1608
+ onClick: () => r(f),
1609
+ className: `${a.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs"} ${b ? a.classes?.paginationButtonActive || "bg-primary text-white shadow-sm shadow-primary/30" : "bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700"}`,
1436
1610
  children: f
1437
1611
  },
1438
1612
  f
1439
1613
  );
1440
1614
  }),
1441
- /* @__PURE__ */ s(
1615
+ /* @__PURE__ */ n(
1442
1616
  "button",
1443
1617
  {
1444
1618
  type: "button",
1445
1619
  disabled: e >= o,
1446
- onClick: () => a(e + 1),
1620
+ onClick: () => r(e + 1),
1447
1621
  "aria-label": "Next Page",
1448
- className: `${r.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
1622
+ className: `${a.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
1449
1623
  children: "›"
1450
1624
  }
1451
1625
  )
@@ -1453,12 +1627,12 @@ const qt = ({
1453
1627
  ]
1454
1628
  }
1455
1629
  );
1456
- }, br = ({
1630
+ }, vr = ({
1457
1631
  columnsCount: e = 5,
1458
1632
  rowsCount: t = 5,
1459
- hasActions: n = !0
1460
- }) => /* @__PURE__ */ s("tbody", { className: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900", children: Array.from({ length: t }).map((o, l) => /* @__PURE__ */ b("tr", { className: "any-table-pulse", children: [
1461
- Array.from({ length: e }).map((a, i) => /* @__PURE__ */ s("td", { className: "py-4 px-4 align-middle", children: /* @__PURE__ */ s(
1633
+ hasActions: s = !0
1634
+ }) => /* @__PURE__ */ n("tbody", { className: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900", children: Array.from({ length: t }).map((o, l) => /* @__PURE__ */ h("tr", { className: "any-table-pulse", children: [
1635
+ Array.from({ length: e }).map((r, i) => /* @__PURE__ */ n("td", { className: "py-4 px-4 align-middle", children: /* @__PURE__ */ n(
1462
1636
  "div",
1463
1637
  {
1464
1638
  className: "h-4 bg-gray-200 dark:bg-slate-700/60 rounded-md",
@@ -1467,20 +1641,20 @@ const qt = ({
1467
1641
  }
1468
1642
  }
1469
1643
  ) }, i)),
1470
- n && /* @__PURE__ */ s("td", { className: "py-4 px-4 text-right align-middle pr-6", children: /* @__PURE__ */ b("div", { className: "inline-flex gap-2 justify-end", children: [
1471
- /* @__PURE__ */ s("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" }),
1472
- /* @__PURE__ */ s("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" })
1644
+ s && /* @__PURE__ */ n("td", { className: "py-4 px-4 text-right align-middle pr-6", children: /* @__PURE__ */ h("div", { className: "inline-flex gap-2 justify-end", children: [
1645
+ /* @__PURE__ */ n("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" }),
1646
+ /* @__PURE__ */ n("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" })
1473
1647
  ] }) })
1474
- ] }, l)) }), yr = ({
1648
+ ] }, l)) }), Nr = ({
1475
1649
  title: e,
1476
1650
  description: t,
1477
- isSearchActive: n = !1,
1651
+ isSearchActive: s = !1,
1478
1652
  onClearSearch: o
1479
- }) => /* @__PURE__ */ b("div", { className: "w-full py-16 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1480
- /* @__PURE__ */ s("div", { className: "w-16 h-16 mb-4 rounded-2xl bg-gray-100 dark:bg-slate-800 text-gray-400 dark:text-gray-500 flex items-center justify-center text-3xl shadow-inner", children: n ? "🔍" : "📂" }),
1481
- /* @__PURE__ */ s("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: e || (n ? "No matching records found" : "No data available") }),
1482
- /* @__PURE__ */ s("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-sm mb-5 leading-relaxed", children: t || (n ? "Try adjusting your search criteria or clear the search filter." : "There are currently no records to display.") }),
1483
- n && o && /* @__PURE__ */ s(
1653
+ }) => /* @__PURE__ */ h("div", { className: "w-full py-16 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1654
+ /* @__PURE__ */ n("div", { className: "w-16 h-16 mb-4 rounded-2xl bg-gray-100 dark:bg-slate-800 text-gray-400 dark:text-gray-500 flex items-center justify-center text-3xl shadow-inner", children: s ? "🔍" : "📂" }),
1655
+ /* @__PURE__ */ n("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: e || (s ? "No matching records found" : "No data available") }),
1656
+ /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-sm mb-5 leading-relaxed", children: t || (s ? "Try adjusting your search criteria or clear the search filter." : "There are currently no records to display.") }),
1657
+ s && o && /* @__PURE__ */ n(
1484
1658
  "button",
1485
1659
  {
1486
1660
  type: "button",
@@ -1489,145 +1663,148 @@ const qt = ({
1489
1663
  children: "Clear Search Filter"
1490
1664
  }
1491
1665
  )
1492
- ] }), hr = ({ error: e, onRetry: t }) => {
1493
- const n = typeof e == "string" ? e : e?.message || e?.response?.data?.message || "Failed to load table data.";
1494
- return /* @__PURE__ */ b("div", { className: "w-full py-14 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1495
- /* @__PURE__ */ s("div", { className: "w-14 h-14 mb-4 rounded-2xl bg-rose-500/10 text-rose-500 flex items-center justify-center text-2xl border border-rose-500/20", children: "⚠️" }),
1496
- /* @__PURE__ */ s("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: "Unable to load data" }),
1497
- /* @__PURE__ */ s("p", { className: "text-xs sm:text-sm text-rose-600 dark:text-rose-400 font-medium max-w-md mb-5 leading-relaxed bg-rose-500/5 px-3 py-1.5 rounded-lg border border-rose-500/10", children: n }),
1498
- t && /* @__PURE__ */ b(
1666
+ ] }), Ar = ({ error: e, onRetry: t }) => {
1667
+ const s = typeof e == "string" ? e : e?.message || e?.response?.data?.message || "Failed to load table data.";
1668
+ return /* @__PURE__ */ h("div", { className: "w-full py-14 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1669
+ /* @__PURE__ */ n("div", { className: "w-14 h-14 mb-4 rounded-2xl bg-rose-500/10 text-rose-500 flex items-center justify-center text-2xl border border-rose-500/20", children: "⚠️" }),
1670
+ /* @__PURE__ */ n("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: "Unable to load data" }),
1671
+ /* @__PURE__ */ n("p", { className: "text-xs sm:text-sm text-rose-600 dark:text-rose-400 font-medium max-w-md mb-5 leading-relaxed bg-rose-500/5 px-3 py-1.5 rounded-lg border border-rose-500/10", children: s }),
1672
+ t && /* @__PURE__ */ h(
1499
1673
  "button",
1500
1674
  {
1501
1675
  type: "button",
1502
1676
  onClick: t,
1503
1677
  className: "inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-gray-900 dark:bg-white text-white dark:text-gray-900 text-xs font-bold hover:bg-gray-800 dark:hover:bg-gray-100 transition-all shadow-md active:scale-95",
1504
1678
  children: [
1505
- /* @__PURE__ */ s("span", { children: "🔄" }),
1506
- /* @__PURE__ */ s("span", { children: "Retry Request" })
1679
+ /* @__PURE__ */ n("span", { children: "🔄" }),
1680
+ /* @__PURE__ */ n("span", { children: "Retry Request" })
1507
1681
  ]
1508
1682
  }
1509
1683
  )
1510
1684
  ] });
1511
1685
  };
1512
- function pr(e) {
1686
+ function qe(e) {
1513
1687
  const {
1514
1688
  data: t,
1515
- api: n,
1689
+ api: s,
1516
1690
  columns: o,
1517
1691
  autoColumns: l = !0,
1518
- rowKey: a,
1692
+ rowKey: r,
1519
1693
  title: i,
1520
1694
  subtitle: g,
1521
1695
  actions: c,
1522
1696
  actionsTitle: d = "Actions",
1523
- actionsWidth: r,
1524
- search: m = !0,
1525
- sorting: u = !0,
1697
+ actionsWidth: a,
1698
+ search: u = !0,
1699
+ sorting: m = !0,
1526
1700
  pagination: f = !0,
1527
- selectable: p = !1,
1701
+ selectable: b = !1,
1528
1702
  onSelectionChange: k,
1529
- onRowClick: E,
1530
- loading: h,
1531
- loadingComponent: D,
1532
- emptyComponent: M,
1533
- emptyTitle: N,
1534
- emptyDescription: A,
1535
- errorComponent: j,
1703
+ onRowClick: C,
1704
+ loading: $,
1705
+ loadingComponent: F,
1706
+ emptyComponent: x,
1707
+ emptyTitle: v,
1708
+ emptyDescription: w,
1709
+ errorComponent: z,
1536
1710
  className: H = "",
1537
- tableClassName: W = "",
1538
- headerActions: te,
1539
- showHeader: B = !0,
1540
- bordered: z = !0,
1541
- striped: R = !1,
1542
- hoverable: re = !0,
1543
- stickyHeader: G = !1,
1544
- tableRef: Y,
1711
+ tableClassName: R = "",
1712
+ headerClassName: ye = "",
1713
+ rowClassName: _,
1714
+ headerActions: j,
1715
+ showHeader: U = !0,
1716
+ bordered: te = !0,
1717
+ striped: V = !1,
1718
+ hoverable: Y = !0,
1719
+ compact: K = !1,
1720
+ stickyHeader: Z = !1,
1721
+ tableRef: B,
1545
1722
  // Legacy Wasel Props
1546
1723
  thead: I,
1547
- headerData: U,
1548
- tbodys: T,
1549
- titleHeader: V,
1550
- add: Pe,
1551
- linkAdd: Ee,
1552
- addHandler: $e,
1553
- view: De,
1554
- linkView: ae,
1555
- viewHandler: ne,
1724
+ headerData: Pe,
1725
+ tbodys: Ee,
1726
+ titleHeader: st,
1727
+ add: Be,
1728
+ linkAdd: $e,
1729
+ addHandler: De,
1730
+ view: Fe,
1731
+ linkView: re,
1732
+ viewHandler: ae,
1556
1733
  edit: Me,
1557
- linkEdit: se,
1558
- editHandler: oe,
1734
+ linkEdit: ne,
1735
+ editHandler: se,
1559
1736
  del: _e,
1560
1737
  handleDelete: he,
1561
- block: Be,
1738
+ block: je,
1562
1739
  handleBlock: pe,
1563
- buttons: ie
1564
- } = e, xe = ee(), le = O(() => t || T || void 0, [t, T]), K = O(() => jt({
1565
- data: le,
1740
+ buttons: oe
1741
+ } = e, N = ee(), ie = W(() => t || Ee || void 0, [t, Ee]), G = W(() => Ut({
1742
+ data: ie,
1566
1743
  columns: o,
1567
1744
  autoColumns: l,
1568
1745
  thead: I,
1569
- headerData: U
1570
- }).filter((y) => typeof y.hidden == "function" ? !y.hidden({ data: le || [] }) : !y.hidden), [le, o, l, I, U]), F = w(
1571
- (x, y) => {
1572
- if (typeof a == "function")
1573
- return a(x, y);
1574
- if (typeof a == "string") {
1575
- const $ = S(x, a);
1576
- if ($ != null) return $;
1746
+ headerData: Pe
1747
+ }).filter((y) => typeof y.hidden == "function" ? !y.hidden({ data: ie || [] }) : !y.hidden), [ie, o, l, I, Pe]), O = A(
1748
+ (p, y) => {
1749
+ if (typeof r == "function")
1750
+ return r(p, y);
1751
+ if (typeof r == "string") {
1752
+ const D = P(p, r);
1753
+ if (D != null) return D;
1577
1754
  }
1578
- const P = x?._id ?? x?.id ?? x?.key;
1579
- return P ?? y;
1755
+ const E = p?._id ?? p?.id ?? p?.key;
1756
+ return E ?? y;
1580
1757
  },
1581
- [a]
1758
+ [r]
1582
1759
  ), {
1583
- enabled: je,
1760
+ enabled: We,
1584
1761
  search: ze,
1585
1762
  debouncedSearch: Le,
1586
- isDebouncing: qe,
1587
- setSearch: Oe,
1588
- clearSearch: ke,
1589
- searchConfig: Xe
1590
- } = zt({ config: m }), {
1591
- enabled: Qe,
1592
- sortBy: Ne,
1763
+ isDebouncing: ot,
1764
+ setSearch: Re,
1765
+ clearSearch: xe,
1766
+ searchConfig: it
1767
+ } = Kt({ config: u }), {
1768
+ enabled: lt,
1769
+ sortBy: ke,
1593
1770
  sortOrder: we,
1594
- toggleSort: et,
1595
- setSorting: tt,
1596
- resetSorting: rt
1597
- } = Lt({ config: u }), We = O(() => {
1598
- const x = [...c || []];
1599
- return ie && Array.isArray(ie) && ie.forEach((y, P) => {
1600
- x.push({
1601
- id: `legacy-btn-${P}`,
1771
+ toggleSort: dt,
1772
+ setSorting: ct,
1773
+ resetSorting: gt
1774
+ } = It({ config: m }), Oe = W(() => {
1775
+ const p = [...c || []];
1776
+ return oe && Array.isArray(oe) && oe.forEach((y, E) => {
1777
+ p.push({
1778
+ id: `legacy-btn-${E}`,
1602
1779
  label: y.label,
1603
1780
  icon: y.icon,
1604
1781
  className: y.className,
1605
1782
  show: y.show,
1606
1783
  hide: y.hide,
1607
- onClick: ($) => y.onClick($)
1784
+ onClick: (D) => y.onClick(D)
1608
1785
  });
1609
- }), Be && pe && x.push({
1786
+ }), je && pe && p.push({
1610
1787
  id: "legacy-block",
1611
1788
  label: (y) => y.isBanned || !y.isActive ? "Unblock" : "Block",
1612
1789
  variant: (y) => y.isBanned || !y.isActive ? "success" : "danger",
1613
1790
  onClick: (y) => pe(y?._id || y?.id)
1614
- }), De && (ne || ae) && x.push({
1791
+ }), Fe && (ae || re) && p.push({
1615
1792
  id: "legacy-view",
1616
1793
  label: "View",
1617
1794
  variant: "primary",
1618
1795
  onClick: (y) => {
1619
- const P = y?._id || y?.id;
1620
- ne ? ne(P) : ae && typeof window < "u" && (window.location.href = `${ae}/${P}`);
1796
+ const E = y?._id || y?.id;
1797
+ ae ? ae(E) : re && typeof window < "u" && (window.location.href = `${re}/${E}`);
1621
1798
  }
1622
- }), Me && (oe || se) && x.push({
1799
+ }), Me && (se || ne) && p.push({
1623
1800
  id: "legacy-edit",
1624
1801
  label: "Edit",
1625
1802
  variant: "info",
1626
1803
  onClick: (y) => {
1627
- const P = y?._id || y?.id;
1628
- oe ? oe(P) : se && typeof window < "u" && (window.location.href = `${se}/${P}`);
1804
+ const E = y?._id || y?.id;
1805
+ se ? se(E) : ne && typeof window < "u" && (window.location.href = `${ne}/${E}`);
1629
1806
  }
1630
- }), _e && he && x.push({
1807
+ }), _e && he && p.push({
1631
1808
  id: "legacy-del",
1632
1809
  label: "Delete",
1633
1810
  variant: "danger",
@@ -1636,295 +1813,307 @@ function pr(e) {
1636
1813
  message: "Are you sure you want to delete this record?"
1637
1814
  },
1638
1815
  onClick: (y) => he(y?._id || y?.id)
1639
- }), x;
1816
+ }), p;
1640
1817
  }, [
1641
1818
  c,
1642
- ie,
1643
- Be,
1819
+ oe,
1820
+ je,
1644
1821
  pe,
1645
- De,
1822
+ Fe,
1823
+ re,
1646
1824
  ae,
1647
- ne,
1648
1825
  Me,
1826
+ ne,
1649
1827
  se,
1650
- oe,
1651
1828
  _e,
1652
1829
  he
1653
- ]), [at, nt] = v(1), [st, ot] = v(10), {
1654
- rows: C,
1830
+ ]), [mt, ut] = S(1), [ft, bt] = S(10), {
1831
+ rows: T,
1655
1832
  totalRecords: ve,
1656
- loading: de,
1833
+ loading: le,
1657
1834
  error: J,
1658
- refresh: Z,
1659
- isServerMode: it
1660
- } = Yt({
1661
- data: le,
1662
- api: n,
1663
- columns: K,
1835
+ refresh: q,
1836
+ isServerMode: yt
1837
+ } = tr({
1838
+ data: ie,
1839
+ api: s,
1840
+ columns: G,
1664
1841
  searchQuery: Le,
1665
- sortBy: Ne,
1842
+ sortBy: ke,
1666
1843
  sortOrder: we,
1667
- page: at,
1668
- pageSize: st,
1669
- manualLoading: h
1844
+ page: mt,
1845
+ pageSize: ft,
1846
+ manualLoading: $
1670
1847
  }), {
1671
- enabled: lt,
1672
- page: ce,
1673
- pageSize: Ae,
1674
- totalPages: Ie,
1675
- pageSizeOptions: dt,
1676
- setPage: ge,
1677
- setPageSize: Fe,
1678
- resetPagination: ct,
1679
- getPageWindow: gt,
1680
- paginationConfig: He
1681
- } = Ot({
1848
+ enabled: ht,
1849
+ page: de,
1850
+ pageSize: Ne,
1851
+ totalPages: He,
1852
+ pageSizeOptions: pt,
1853
+ setPage: ce,
1854
+ setPageSize: Ue,
1855
+ resetPagination: xt,
1856
+ getPageWindow: kt,
1857
+ paginationConfig: Ke
1858
+ } = Gt({
1682
1859
  config: f,
1683
1860
  totalRecords: ve,
1684
- onPageChange: (x, y) => {
1685
- nt(x), ot(y);
1861
+ onPageChange: (p, y) => {
1862
+ ut(p), bt(y);
1686
1863
  }
1687
- }), [L, ue] = v(/* @__PURE__ */ new Set()), ut = w(
1688
- (x, y) => {
1689
- ue((P) => {
1690
- const $ = new Set(P);
1691
- if ($.has(x) ? $.delete(x) : $.add(x), k) {
1692
- const pt = C.filter((xt, kt) => $.has(F(xt, kt)));
1693
- k(pt, Array.from($));
1864
+ }), [L, ge] = S(/* @__PURE__ */ new Set()), wt = A(
1865
+ (p, y) => {
1866
+ ge((E) => {
1867
+ const D = new Set(E);
1868
+ if (D.has(p) ? D.delete(p) : D.add(p), k) {
1869
+ const Pt = T.filter((Et, Bt) => D.has(O(Et, Bt)));
1870
+ k(Pt, Array.from(D));
1694
1871
  }
1695
- return $;
1872
+ return D;
1696
1873
  });
1697
1874
  },
1698
- [C, F, k]
1699
- ), mt = w(() => {
1700
- if (L.size === C.length && C.length > 0)
1701
- ue(/* @__PURE__ */ new Set()), k?.([], []);
1875
+ [T, O, k]
1876
+ ), vt = A(() => {
1877
+ if (L.size === T.length && T.length > 0)
1878
+ ge(/* @__PURE__ */ new Set()), k?.([], []);
1702
1879
  else {
1703
- const x = new Set(C.map((y, P) => F(y, P)));
1704
- ue(x), k?.(C, Array.from(x));
1880
+ const p = new Set(T.map((y, E) => O(y, E)));
1881
+ ge(p), k?.(T, Array.from(p));
1705
1882
  }
1706
- }, [C, L.size, F, k]), ft = w(() => {
1707
- ue(/* @__PURE__ */ new Set()), k?.([], []);
1708
- }, [k]), bt = C.length > 0 && L.size === C.length, yt = L.size > 0 && L.size < C.length, Ce = O(
1883
+ }, [T, L.size, O, k]), Nt = A(() => {
1884
+ ge(/* @__PURE__ */ new Set()), k?.([], []);
1885
+ }, [k]), At = T.length > 0 && L.size === T.length, Ct = L.size > 0 && L.size < T.length, Ae = W(
1709
1886
  () => ({
1710
- refresh: Z,
1711
- loading: de,
1712
- page: ce,
1713
- selectedRows: C.filter((x, y) => L.has(F(x, y))),
1714
- setPage: ge
1887
+ refresh: q,
1888
+ loading: le,
1889
+ page: de,
1890
+ selectedRows: T.filter((p, y) => L.has(O(p, y))),
1891
+ setPage: ce
1715
1892
  }),
1716
- [Z, de, ce, C, L, F, ge]
1893
+ [q, le, de, T, L, O, ce]
1717
1894
  );
1718
- Vt({
1719
- tableRef: Y,
1720
- refresh: Z,
1721
- resetPagination: ct,
1722
- resetSearch: ke,
1723
- resetSorting: rt,
1724
- setPage: ge,
1725
- setPageSize: Fe,
1726
- setSearch: Oe,
1727
- setSorting: tt,
1728
- selectedRows: Ce.selectedRows,
1729
- clearSelection: ft,
1895
+ rr({
1896
+ tableRef: B,
1897
+ refresh: q,
1898
+ resetPagination: xt,
1899
+ resetSearch: xe,
1900
+ resetSorting: gt,
1901
+ setPage: ce,
1902
+ setPageSize: Ue,
1903
+ setSearch: Re,
1904
+ setSorting: ct,
1905
+ selectedRows: Ae.selectedRows,
1906
+ clearSelection: Nt,
1730
1907
  getState: () => ({
1731
- data: C,
1732
- loading: de,
1908
+ data: T,
1909
+ loading: le,
1733
1910
  error: J,
1734
- page: ce,
1735
- pageSize: Ae,
1911
+ page: de,
1912
+ pageSize: Ne,
1736
1913
  total: ve,
1737
- totalPages: Ie,
1914
+ totalPages: He,
1738
1915
  search: ze,
1739
- sortBy: Ne,
1916
+ sortBy: ke,
1740
1917
  sortOrder: we,
1741
1918
  selectedRowKeys: Array.from(L),
1742
- selectedRows: Ce.selectedRows,
1743
- isServerMode: it
1919
+ selectedRows: Ae.selectedRows,
1920
+ isServerMode: yt
1744
1921
  })
1745
1922
  });
1746
- const q = i || V, me = We.length > 0, ht = !!(q || g || je || te || Pe);
1747
- return /* @__PURE__ */ b("div", { className: `any-table-wrapper ${xe.classes?.container || "w-full flex flex-col gap-4 font-sans"} ${H}`, children: [
1748
- ht && /* @__PURE__ */ b("div", { className: "w-full flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-1", children: [
1749
- (q || g) && /* @__PURE__ */ b("div", { className: "flex flex-col", children: [
1750
- q && /* @__PURE__ */ b("h2", { className: "text-xl sm:text-2xl font-black text-gray-900 dark:text-white tracking-tight flex items-center gap-2.5", children: [
1751
- /* @__PURE__ */ s("span", { className: "w-1.5 h-6 bg-primary rounded-full inline-block" }),
1752
- q
1923
+ const X = i || st, me = Oe.length > 0, St = !!(X || g || We || j || Be), Tt = W(() => {
1924
+ const p = {};
1925
+ return N.borderRadius && (p["--any-table-radius"] = N.borderRadius), N.fontFamily && (p["--any-table-font"] = N.fontFamily, p.fontFamily = N.fontFamily), N.colors?.primary && (p["--any-table-primary"] = N.colors.primary), N.colors?.primaryHover && (p["--any-table-primary-hover"] = N.colors.primaryHover), N.colors?.border && (p["--any-table-border"] = N.colors.border), p;
1926
+ }, [N]);
1927
+ return /* @__PURE__ */ h(
1928
+ "div",
1929
+ {
1930
+ style: Tt,
1931
+ className: `any-table-wrapper ${N.classes?.container || "w-full flex flex-col gap-4 font-sans text-gray-900 dark:text-gray-100"} ${H}`,
1932
+ children: [
1933
+ St && /* @__PURE__ */ h("div", { className: "w-full flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-1", children: [
1934
+ (X || g) && /* @__PURE__ */ h("div", { className: "flex flex-col", children: [
1935
+ X && /* @__PURE__ */ n("h3", { className: "text-lg font-bold tracking-tight text-gray-900 dark:text-white flex items-center gap-2", children: X }),
1936
+ g && /* @__PURE__ */ n("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-0.5", children: g })
1937
+ ] }),
1938
+ /* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-3 w-full sm:w-auto justify-start sm:justify-end ml-auto", children: [
1939
+ We && /* @__PURE__ */ n(
1940
+ nr,
1941
+ {
1942
+ value: ze,
1943
+ onChange: Re,
1944
+ onClear: xe,
1945
+ isDebouncing: ot,
1946
+ placeholder: it.placeholder
1947
+ }
1948
+ ),
1949
+ j,
1950
+ Be && /* @__PURE__ */ h(
1951
+ "button",
1952
+ {
1953
+ type: "button",
1954
+ onClick: () => {
1955
+ De ? De() : $e && typeof window < "u" && (window.location.href = $e);
1956
+ },
1957
+ className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-xl bg-primary text-white text-xs sm:text-sm font-bold hover:bg-primary-soft transition-all shadow-sm shadow-primary/20 active:scale-95 whitespace-nowrap",
1958
+ children: [
1959
+ /* @__PURE__ */ n("span", { children: "+" }),
1960
+ /* @__PURE__ */ h("span", { children: [
1961
+ "Add ",
1962
+ X || "Record"
1963
+ ] })
1964
+ ]
1965
+ }
1966
+ )
1967
+ ] })
1753
1968
  ] }),
1754
- g && /* @__PURE__ */ s("p", { className: "text-xs sm:text-sm text-gray-500 dark:text-gray-400 font-medium mt-0.5 pl-4", children: g })
1755
- ] }),
1756
- /* @__PURE__ */ b("div", { className: "flex flex-wrap items-center gap-3 w-full sm:w-auto justify-start sm:justify-end ml-auto", children: [
1757
- je && /* @__PURE__ */ s(
1758
- qt,
1759
- {
1760
- value: ze,
1761
- onChange: Oe,
1762
- onClear: ke,
1763
- isDebouncing: qe,
1764
- placeholder: Xe.placeholder
1765
- }
1766
- ),
1767
- te,
1768
- Pe && /* @__PURE__ */ b(
1769
- "button",
1770
- {
1771
- type: "button",
1772
- onClick: () => {
1773
- $e ? $e() : Ee && typeof window < "u" && (window.location.href = Ee);
1774
- },
1775
- className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-xl bg-primary text-white text-xs sm:text-sm font-bold hover:bg-primary-soft transition-all shadow-sm shadow-primary/20 active:scale-95 whitespace-nowrap",
1776
- children: [
1777
- /* @__PURE__ */ s("span", { children: "+" }),
1778
- /* @__PURE__ */ b("span", { children: [
1779
- "Add ",
1780
- q || "Record"
1781
- ] })
1782
- ]
1783
- }
1784
- )
1785
- ] })
1786
- ] }),
1787
- /* @__PURE__ */ s(
1788
- "div",
1789
- {
1790
- className: `${xe.classes?.tableWrapper || "w-full overflow-x-auto rounded-2xl border bg-white dark:bg-slate-900"} ${z ? "border border-gray-200 dark:border-gray-800" : ""}`,
1791
- children: J ? typeof j == "function" ? j(J, Z) : j || /* @__PURE__ */ s(hr, { error: J, onRetry: Z }) : /* @__PURE__ */ b(
1792
- "table",
1969
+ /* @__PURE__ */ n(
1970
+ "div",
1793
1971
  {
1794
- className: `${xe.classes?.table || "w-full border-collapse text-left text-sm"} ${G ? "relative" : ""} ${W}`,
1795
- children: [
1796
- B && /* @__PURE__ */ s(
1797
- Xt,
1798
- {
1799
- columns: K,
1800
- hasActions: me,
1801
- actionsTitle: d,
1802
- actionsWidth: r,
1803
- sortBy: Ne,
1804
- sortOrder: we,
1805
- onSort: Qe ? et : void 0,
1806
- selectable: p,
1807
- allSelected: bt,
1808
- isIndeterminate: yt,
1809
- onToggleSelectAll: mt
1810
- }
1811
- ),
1812
- de && C.length === 0 ? D ? /* @__PURE__ */ s("tbody", { children: /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s("td", { colSpan: K.length + (p ? 1 : 0) + (me ? 1 : 0), children: D }) }) }) : /* @__PURE__ */ s(
1813
- br,
1814
- {
1815
- columnsCount: K.length + (p ? 1 : 0),
1816
- rowsCount: Ae || 5,
1817
- hasActions: me
1818
- }
1819
- ) : C.length === 0 ? (
1820
- /* Empty State */
1821
- /* @__PURE__ */ s("tbody", { children: /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s(
1822
- "td",
1823
- {
1824
- colSpan: K.length + (p ? 1 : 0) + (me ? 1 : 0),
1825
- className: "p-0",
1826
- children: M || /* @__PURE__ */ s(
1827
- yr,
1972
+ style: N.borderRadius ? { borderRadius: N.borderRadius } : void 0,
1973
+ className: `${N.classes?.tableWrapper || "w-full overflow-x-auto rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-slate-900 shadow-sm transition-colors"} ${te ? "border border-gray-200 dark:border-gray-800" : "border-0 shadow-none"}`,
1974
+ children: J ? typeof z == "function" ? z(J, q) : z || /* @__PURE__ */ n(Ar, { error: J, onRetry: q }) : /* @__PURE__ */ h(
1975
+ "table",
1976
+ {
1977
+ className: `${N.classes?.table || "w-full border-collapse text-left text-sm"} ${K || N.density === "compact" ? "text-xs" : ""} ${Z ? "relative" : ""} ${R}`,
1978
+ children: [
1979
+ U && /* @__PURE__ */ n(
1980
+ sr,
1981
+ {
1982
+ columns: G,
1983
+ hasActions: me,
1984
+ actionsTitle: d,
1985
+ actionsWidth: a,
1986
+ sortBy: ke,
1987
+ sortOrder: we,
1988
+ onSort: lt ? dt : void 0,
1989
+ selectable: b,
1990
+ allSelected: At,
1991
+ isIndeterminate: Ct,
1992
+ onToggleSelectAll: vt,
1993
+ headerClassName: ye
1994
+ }
1995
+ ),
1996
+ le && T.length === 0 ? F ? /* @__PURE__ */ n("tbody", { children: /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: G.length + (b ? 1 : 0) + (me ? 1 : 0), children: F }) }) }) : /* @__PURE__ */ n(
1997
+ vr,
1998
+ {
1999
+ columnsCount: G.length + (b ? 1 : 0),
2000
+ rowsCount: Ne || 5,
2001
+ hasActions: me
2002
+ }
2003
+ ) : T.length === 0 ? (
2004
+ /* Empty State */
2005
+ /* @__PURE__ */ n("tbody", { children: /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n(
2006
+ "td",
2007
+ {
2008
+ colSpan: G.length + (b ? 1 : 0) + (me ? 1 : 0),
2009
+ className: "p-0",
2010
+ children: x || /* @__PURE__ */ n(
2011
+ Nr,
2012
+ {
2013
+ title: v,
2014
+ description: w,
2015
+ isSearchActive: !!Le,
2016
+ onClearSearch: xe
2017
+ }
2018
+ )
2019
+ }
2020
+ ) }) })
2021
+ ) : (
2022
+ /* Body Rows */
2023
+ /* @__PURE__ */ n(
2024
+ kr,
1828
2025
  {
1829
- title: N,
1830
- description: A,
1831
- isSearchActive: !!Le,
1832
- onClearSearch: ke
2026
+ rows: T,
2027
+ columns: G,
2028
+ actions: Oe,
2029
+ actionContext: Ae,
2030
+ rowKeyResolver: O,
2031
+ selectable: b,
2032
+ selectedKeys: L,
2033
+ onToggleSelectRow: wt,
2034
+ onRowClick: C,
2035
+ striped: V,
2036
+ hoverable: Y,
2037
+ rowClassName: _
1833
2038
  }
1834
2039
  )
1835
- }
1836
- ) }) })
1837
- ) : (
1838
- /* Body Rows */
1839
- /* @__PURE__ */ s(
1840
- mr,
1841
- {
1842
- rows: C,
1843
- columns: K,
1844
- actions: We,
1845
- actionContext: Ce,
1846
- rowKeyResolver: F,
1847
- selectable: p,
1848
- selectedKeys: L,
1849
- onToggleSelectRow: ut,
1850
- onRowClick: E,
1851
- striped: R,
1852
- hoverable: re
1853
- }
1854
- )
1855
- )
1856
- ]
2040
+ )
2041
+ ]
2042
+ }
2043
+ )
2044
+ }
2045
+ ),
2046
+ ht && !J && /* @__PURE__ */ n(
2047
+ wr,
2048
+ {
2049
+ page: de,
2050
+ pageSize: Ne,
2051
+ totalRecords: ve,
2052
+ totalPages: He,
2053
+ pageSizeOptions: pt,
2054
+ onPageChange: ce,
2055
+ onPageSizeChange: Ue,
2056
+ showPageSizeSelector: Ke.showPageSizeSelector,
2057
+ showTotalCount: Ke.showTotalCount,
2058
+ pageWindow: kt(5)
1857
2059
  }
1858
2060
  )
1859
- }
1860
- ),
1861
- lt && !J && /* @__PURE__ */ s(
1862
- fr,
1863
- {
1864
- page: ce,
1865
- pageSize: Ae,
1866
- totalRecords: ve,
1867
- totalPages: Ie,
1868
- pageSizeOptions: dt,
1869
- onPageChange: ge,
1870
- onPageSizeChange: Fe,
1871
- showPageSizeSelector: He.showPageSizeSelector,
1872
- showTotalCount: He.showTotalCount,
1873
- pageWindow: gt(5)
1874
- }
1875
- )
1876
- ] });
2061
+ ]
2062
+ }
2063
+ );
1877
2064
  }
1878
- function Nr(e) {
1879
- return /* @__PURE__ */ s(Zt, { theme: e.theme, children: /* @__PURE__ */ s(pr, { ...e }) });
2065
+ function Tr(e) {
2066
+ return !e.theme && !e.preset ? /* @__PURE__ */ n(qe, { ...e }) : /* @__PURE__ */ n(ar, { theme: e.theme, preset: e.preset, children: /* @__PURE__ */ n(qe, { ...e }) });
1880
2067
  }
1881
2068
  export {
1882
- ur as ActionRenderer,
1883
- Nr as AnyTable,
1884
- pr as AnyTableInner,
1885
- Zt as AnyTableThemeProvider,
1886
- sr as ArrayRenderer,
1887
- er as BooleanRenderer,
1888
- cr as CellRenderer,
1889
- gr as ConfirmModal,
1890
- tr as CurrencyRenderer,
1891
- Jt as DEFAULT_THEME_COLORS,
1892
- Ke as DateRenderer,
1893
- lr as EmailRenderer,
1894
- _ as FallbackPlaceholder,
1895
- rr as ImageRenderer,
1896
- Qt as NumberRenderer,
1897
- or as ObjectRenderer,
1898
- dr as PhoneRenderer,
1899
- nr as StatusRenderer,
1900
- Ze as StringRenderer,
1901
- mr as TableBody,
1902
- yr as TableEmptyState,
1903
- hr as TableErrorState,
1904
- Xt as TableHeader,
1905
- fr as TablePagination,
1906
- qt as TableSearch,
1907
- br as TableSkeleton,
1908
- ir as UrlRenderer,
1909
- Nr as default,
1910
- Q as defaultAnyTableTheme,
1911
- X as extractPaginationMeta,
1912
- Kt as filterRowsBySearch,
1913
- _t as generateAutoColumns,
1914
- S as getNestedValue,
1915
- be as inferColumnType,
1916
- Re as isImageUrl,
1917
- Dt as isIsoDate,
1918
- St as isPlainObject,
1919
- Ut as normalizeApiResponse,
1920
- jt as resolveColumns,
1921
- Gt as sortRows,
1922
- fe as toTitleCase,
1923
- Vt as useAnyTableController,
1924
- Yt as useAnyTableData,
1925
- Ot as useAnyTablePagination,
1926
- zt as useAnyTableSearch,
1927
- Lt as useAnyTableSorting,
2069
+ xr as ActionRenderer,
2070
+ Tr as AnyTable,
2071
+ qe as AnyTableInner,
2072
+ ar as AnyTableThemeProvider,
2073
+ mr as ArrayRenderer,
2074
+ ir as BooleanRenderer,
2075
+ hr as CellRenderer,
2076
+ pr as ConfirmModal,
2077
+ lr as CurrencyRenderer,
2078
+ tt as DEFAULT_THEME_COLORS,
2079
+ Ye as DateRenderer,
2080
+ br as EmailRenderer,
2081
+ M as FallbackPlaceholder,
2082
+ dr as ImageRenderer,
2083
+ or as NumberRenderer,
2084
+ ur as ObjectRenderer,
2085
+ yr as PhoneRenderer,
2086
+ gr as StatusRenderer,
2087
+ at as StringRenderer,
2088
+ Ve as TABLE_PRESETS,
2089
+ kr as TableBody,
2090
+ Nr as TableEmptyState,
2091
+ Ar as TableErrorState,
2092
+ sr as TableHeader,
2093
+ wr as TablePagination,
2094
+ nr as TableSearch,
2095
+ vr as TableSkeleton,
2096
+ fr as UrlRenderer,
2097
+ Tr as default,
2098
+ rt as defaultAnyTableTheme,
2099
+ Q as extractPaginationMeta,
2100
+ Qt as filterRowsBySearch,
2101
+ Ot as generateAutoColumns,
2102
+ P as getNestedValue,
2103
+ fe as inferColumnType,
2104
+ Ie as isImageUrl,
2105
+ Lt as isIsoDate,
2106
+ Mt as isPlainObject,
2107
+ Xt as normalizeApiResponse,
2108
+ nt as renderActionIcon,
2109
+ Ut as resolveColumns,
2110
+ er as sortRows,
2111
+ ue as toTitleCase,
2112
+ rr as useAnyTableController,
2113
+ tr as useAnyTableData,
2114
+ Gt as useAnyTablePagination,
2115
+ Kt as useAnyTableSearch,
2116
+ It as useAnyTableSorting,
1928
2117
  ee as useAnyTableTheme
1929
2118
  };
1930
2119
  //# sourceMappingURL=index.js.map