@kareemelbalshe/any-table 1.0.2 → 1.0.4

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