@redi.run/redi-components 0.0.60 → 0.0.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,177 +1,41 @@
1
1
  import * as React$1 from "react";
2
- import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
2
+ import React, { createContext, forwardRef, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
- const CloseIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
5
- fill: e,
6
- width: t,
7
- height: t,
8
- viewBox: "0 0 20 20",
9
- children: /* @__PURE__ */ jsx("path", {
10
- fillRule: "evenodd",
11
- d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
12
- clipRule: "evenodd",
13
- fill: "currentColor"
14
- })
15
- }), DownloadIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
16
- width: t,
17
- height: t,
18
- viewBox: "0 0 20 20",
19
- fill: e,
20
- children: /* @__PURE__ */ jsx("path", {
21
- fillRule: "evenodd",
22
- d: "M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",
23
- clipRule: "evenodd",
24
- fill: "currentColor"
25
- })
26
- }), DragIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
27
- fill: e,
28
- stroke: "currentColor",
4
+ const CheckIcon = ({ className: e,...t }) => /* @__PURE__ */ jsx("svg", {
5
+ className: e || "w-3.5 h-3.5",
6
+ fill: "none",
29
7
  viewBox: "0 0 24 24",
30
- width: t,
31
- height: t,
8
+ stroke: "currentColor",
9
+ strokeWidth: 3,
10
+ ...t,
32
11
  children: /* @__PURE__ */ jsx("path", {
33
12
  strokeLinecap: "round",
34
13
  strokeLinejoin: "round",
35
- strokeWidth: 2,
36
- d: "M8 9h8M8 15h8"
14
+ d: "M4.5 12.75l6 6 9-13.5"
37
15
  })
38
- }), DragToggleIcon = ({ active: e = !1, size: t = 14, className: n = "", label: i = "Draggable" }) => e ? /* @__PURE__ */ jsx(DragIcon, {
39
- size: t,
40
- className: n
41
- }) : /* @__PURE__ */ jsxs("svg", {
42
- width: t,
43
- height: t,
44
- viewBox: "0 0 24 24",
45
- fill: "none",
46
- xmlns: "http://www.w3.org/2000/svg",
47
- className: n,
48
- "aria-label": i,
49
- children: [
50
- /* @__PURE__ */ jsx("title", { children: i }),
51
- /* @__PURE__ */ jsx("rect", {
52
- x: "4",
53
- y: "4",
54
- width: "16",
55
- height: "16",
56
- rx: "2",
57
- stroke: "#9ca3af",
58
- strokeWidth: "2",
59
- fill: "none"
60
- }),
61
- /* @__PURE__ */ jsx("line", {
62
- x1: "4",
63
- y1: "4",
64
- x2: "20",
65
- y2: "20",
66
- stroke: "#9ca3af",
67
- strokeWidth: "2"
68
- })
69
- ]
70
- }), EyeIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsxs("svg", {
71
- viewBox: "0 0 20 20",
72
- fill: e,
73
- width: t,
74
- height: t,
75
- children: [/* @__PURE__ */ jsx("path", {
76
- d: "M10 12a2 2 0 100-4 2 2 0 000 4z",
77
- fill: "currentColor"
78
- }), /* @__PURE__ */ jsx("path", {
79
- fillRule: "evenodd",
80
- d: "M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z",
81
- clipRule: "evenodd",
82
- fill: "currentColor"
83
- })]
84
- }), FilterIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
16
+ }), CloseIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
85
17
  fill: e,
86
- stroke: "currentColor",
87
- viewBox: "0 0 24 24",
88
18
  width: t,
89
19
  height: t,
20
+ viewBox: "0 0 20 20",
90
21
  children: /* @__PURE__ */ jsx("path", {
91
22
  fillRule: "evenodd",
92
- d: "M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z",
23
+ d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
93
24
  clipRule: "evenodd",
94
25
  fill: "currentColor"
95
26
  })
96
- }), FilterOffIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsxs("svg", {
97
- fill: e,
98
- stroke: "currentColor",
99
- viewBox: "0 0 24 24",
100
- width: t,
101
- height: t,
102
- children: [/* @__PURE__ */ jsx("path", {
103
- fillRule: "evenodd",
104
- d: "M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z",
105
- clipRule: "evenodd",
106
- fill: "none",
107
- strokeWidth: "2"
108
- }), /* @__PURE__ */ jsx("line", {
109
- x1: "3",
110
- y1: "3",
111
- x2: "21",
112
- y2: "21",
113
- stroke: e,
114
- strokeWidth: "2",
115
- strokeLinecap: "round"
116
- })]
117
- }), PinIcon = ({ size: e = 20, color: t = "currentColor", className: n = "" }) => /* @__PURE__ */ jsxs("svg", {
118
- width: e,
119
- height: e,
120
- viewBox: "0 0 24 24",
121
- fill: "none",
122
- stroke: t,
123
- strokeWidth: "2",
124
- strokeLinecap: "round",
125
- strokeLinejoin: "round",
126
- className: n,
127
- children: [/* @__PURE__ */ jsx("line", {
128
- x1: "12",
129
- y1: "17",
130
- x2: "12",
131
- y2: "22"
132
- }), /* @__PURE__ */ jsx("path", { d: "M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z" })]
133
- }), PinOffIcon = ({ size: e = 20, color: t = "currentColor", className: n = "" }) => /* @__PURE__ */ jsxs("svg", {
134
- width: e,
135
- height: e,
136
- viewBox: "0 0 24 24",
27
+ }), EditIcon = ({ className: e,...t }) => /* @__PURE__ */ jsx("svg", {
28
+ className: e || "w-3.5 h-3.5",
137
29
  fill: "none",
138
- stroke: t,
139
- strokeWidth: "2",
140
- strokeLinecap: "round",
141
- strokeLinejoin: "round",
142
- className: n,
143
- children: [
144
- /* @__PURE__ */ jsx("line", {
145
- x1: "2",
146
- y1: "2",
147
- x2: "22",
148
- y2: "22"
149
- }),
150
- /* @__PURE__ */ jsx("path", { d: "M12 17v5" }),
151
- /* @__PURE__ */ jsx("path", { d: "M9 9V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v.76" }),
152
- /* @__PURE__ */ jsx("path", { d: "M15 6v4.76a2 2 0 0 1 1.11 1.79l1.78.9A2 2 0 0 1 19 15.24v1.76H10" }),
153
- /* @__PURE__ */ jsx("path", { d: "M5 17h.35" })
154
- ]
155
- }), RefreshIcon = ({ size: e = 20, color: t = "currentColor", className: n = "" }) => /* @__PURE__ */ jsxs("svg", {
156
- width: e,
157
- height: e,
158
30
  viewBox: "0 0 24 24",
159
- fill: "none",
160
- xmlns: "http://www.w3.org/2000/svg",
161
- className: n,
162
- children: [/* @__PURE__ */ jsx("path", {
163
- d: "M4.06189 13C4.0276 12.6724 4.01001 12.3387 4.01001 12C4.01001 7.58172 7.59173 4 12.01 4C16.4283 4 20.01 7.58172 20.01 12C20.01 16.4183 16.4283 20 12.01 20C9.52552 20 7.30615 18.8662 5.8604 17.0732",
164
- stroke: t,
165
- strokeWidth: "1.5",
166
- strokeLinecap: "round",
167
- strokeLinejoin: "round"
168
- }), /* @__PURE__ */ jsx("path", {
169
- d: "M3.5 8L4.04145 11.1448C4.12057 11.6044 4.16014 11.8342 4.32777 11.9753C4.47524 12.0994 4.6649 12.1594 4.85734 12.1429C5.07604 12.1241 5.25902 11.9482 5.62496 11.5966L8 9.31429",
170
- stroke: t,
171
- strokeWidth: "1.5",
31
+ stroke: "currentColor",
32
+ strokeWidth: 2,
33
+ ...t,
34
+ children: /* @__PURE__ */ jsx("path", {
172
35
  strokeLinecap: "round",
173
- strokeLinejoin: "round"
174
- })]
36
+ strokeLinejoin: "round",
37
+ d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125"
38
+ })
175
39
  });
176
40
  /*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
177
41
  var XLSX = {};
@@ -1474,8 +1338,8 @@ var CRC32 = /* @__PURE__ */ (function() {
1474
1338
  return c ||= {};
1475
1339
  }
1476
1340
  function u(e, t) {
1477
- if (e[0] == 80 && e[1] == 75) return Zh(e, t);
1478
- if ((e[0] | 32) == 109 && (e[1] | 32) == 105) return ag(e, t);
1341
+ if (e[0] == 80 && e[1] == 75) return mg(e, t);
1342
+ if ((e[0] | 32) == 109 && (e[1] | 32) == 105) return Cg(e, t);
1479
1343
  if (e.length < 512) throw Error("CFB file size " + e.length + " < 512");
1480
1344
  var n = 3, i = 512, a = 0, o = 0, s = 0, c = 0, l = 0, u = [], h = e.slice(0, 512);
1481
1345
  prep_blob(h, 0);
@@ -1487,7 +1351,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1487
1351
  case 4:
1488
1352
  i = 4096;
1489
1353
  break;
1490
- case 0: if (_[1] == 0) return Zh(e, t);
1354
+ case 0: if (_[1] == 0) return mg(e, t);
1491
1355
  default: throw Error("Major Version: Expected 3 or 4 saw " + n);
1492
1356
  }
1493
1357
  i !== 512 && (h = e.slice(0, i), prep_blob(h, 28));
@@ -1701,9 +1565,9 @@ var CRC32 = /* @__PURE__ */ (function() {
1701
1565
  }
1702
1566
  function E(e, t) {
1703
1567
  var n = t || {};
1704
- if (n.fileType == "mad") return og(e, n);
1568
+ if (n.fileType == "mad") return wg(e, n);
1705
1569
  switch (T(e), n.fileType) {
1706
- case "zip": return $h(e, n);
1570
+ case "zip": return gg(e, n);
1707
1571
  }
1708
1572
  var i = (function(e) {
1709
1573
  for (var t = 0, n = 0, i = 0; i < e.FileIndex.length; ++i) {
@@ -1738,13 +1602,13 @@ var CRC32 = /* @__PURE__ */ (function() {
1738
1602
  for (s += e; o < s - 1; ++o) a.write_shift(-4, o + 1);
1739
1603
  e && (++o, a.write_shift(-4, k));
1740
1604
  };
1741
- for (s = o = 0, s += i[1]; o < s; ++o) a.write_shift(-4, N.DIFSECT);
1742
- for (s += i[2]; o < s; ++o) a.write_shift(-4, N.FATSECT);
1605
+ for (s = o = 0, s += i[1]; o < s; ++o) a.write_shift(-4, z.DIFSECT);
1606
+ for (s += i[2]; o < s; ++o) a.write_shift(-4, z.FATSECT);
1743
1607
  c(i[3]), c(i[4]);
1744
1608
  for (var l = 0, u = 0, d = e.FileIndex[0]; l < e.FileIndex.length; ++l) d = e.FileIndex[l], d.content && (u = d.content.length, !(u < 4096) && (d.start = s, c(u + 511 >> 9)));
1745
- for (c(i[6] + 7 >> 3); a.l & 511;) a.write_shift(-4, N.ENDOFCHAIN);
1609
+ for (c(i[6] + 7 >> 3); a.l & 511;) a.write_shift(-4, z.ENDOFCHAIN);
1746
1610
  for (s = o = 0, l = 0; l < e.FileIndex.length; ++l) d = e.FileIndex[l], d.content && (u = d.content.length, !(!u || u >= 4096) && (d.start = s, c(u + 63 >> 6)));
1747
- for (; a.l & 511;) a.write_shift(-4, N.ENDOFCHAIN);
1611
+ for (; a.l & 511;) a.write_shift(-4, z.ENDOFCHAIN);
1748
1612
  for (o = 0; o < i[4] << 2; ++o) {
1749
1613
  var f = e.FullPaths[o];
1750
1614
  if (!f || f.length === 0) {
@@ -1796,7 +1660,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1796
1660
  177,
1797
1661
  26,
1798
1662
  225
1799
- ], M = "00000000000000000000000000000000", N = {
1663
+ ], M = "00000000000000000000000000000000", z = {
1800
1664
  MAXREGSECT: -6,
1801
1665
  DIFSECT: -4,
1802
1666
  FATSECT: -3,
@@ -1816,45 +1680,45 @@ var CRC32 = /* @__PURE__ */ (function() {
1816
1680
  "root"
1817
1681
  ]
1818
1682
  };
1819
- function P(e, t, n) {
1683
+ function B(e, t, n) {
1820
1684
  l();
1821
1685
  var i = E(e, n);
1822
1686
  c.writeFileSync(t, i);
1823
1687
  }
1824
- function F(e) {
1688
+ function V(e) {
1825
1689
  for (var t = Array(e.length), n = 0; n < e.length; ++n) t[n] = String.fromCharCode(e[n]);
1826
1690
  return t.join("");
1827
1691
  }
1828
- function I(e, t) {
1692
+ function H(e, t) {
1829
1693
  var n = E(e, t);
1830
1694
  switch (t && t.type || "buffer") {
1831
1695
  case "file": return l(), c.writeFileSync(t.filename, n), n;
1832
- case "binary": return typeof n == "string" ? n : F(n);
1833
- case "base64": return Base64_encode(typeof n == "string" ? n : F(n));
1696
+ case "binary": return typeof n == "string" ? n : V(n);
1697
+ case "base64": return Base64_encode(typeof n == "string" ? n : V(n));
1834
1698
  case "buffer": if (has_buf) return Buffer.isBuffer(n) ? n : Buffer_from(n);
1835
1699
  case "array": return typeof n == "string" ? s2a(n) : n;
1836
1700
  }
1837
1701
  return n;
1838
1702
  }
1839
- var L;
1840
- function _h(e) {
1703
+ var W;
1704
+ function G(e) {
1841
1705
  try {
1842
1706
  var t = e.InflateRaw, n = new t();
1843
- if (n._processChunk(new Uint8Array([3, 0]), n._finishFlushFlag), n.bytesRead) L = e;
1707
+ if (n._processChunk(new Uint8Array([3, 0]), n._finishFlushFlag), n.bytesRead) W = e;
1844
1708
  else throw Error("zlib does not expose bytesRead");
1845
1709
  } catch (e) {
1846
1710
  console.error("cannot use native zlib: " + (e.message || e));
1847
1711
  }
1848
1712
  }
1849
- function Th(e, t) {
1850
- if (!L) return Yh(e, t);
1851
- var n = L.InflateRaw, i = new n(), a = i._processChunk(e.slice(e.l), i._finishFlushFlag);
1713
+ function K(e, t) {
1714
+ if (!W) return fg(e, t);
1715
+ var n = W.InflateRaw, i = new n(), a = i._processChunk(e.slice(e.l), i._finishFlushFlag);
1852
1716
  return e.l += i.bytesRead, a;
1853
1717
  }
1854
- function Eh(e) {
1855
- return L ? L.deflateRawSync(e) : J(e);
1718
+ function Rh(e) {
1719
+ return W ? W.deflateRawSync(e) : ig(e);
1856
1720
  }
1857
- var R = [
1721
+ var q = [
1858
1722
  16,
1859
1723
  17,
1860
1724
  18,
@@ -1874,7 +1738,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1874
1738
  14,
1875
1739
  1,
1876
1740
  15
1877
- ], z = [
1741
+ ], J = [
1878
1742
  3,
1879
1743
  4,
1880
1744
  5,
@@ -1904,7 +1768,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1904
1768
  195,
1905
1769
  227,
1906
1770
  258
1907
- ], kh = [
1771
+ ], zh = [
1908
1772
  1,
1909
1773
  2,
1910
1774
  3,
@@ -1936,56 +1800,56 @@ var CRC32 = /* @__PURE__ */ (function() {
1936
1800
  16385,
1937
1801
  24577
1938
1802
  ];
1939
- function Ah(e) {
1803
+ function Bh(e) {
1940
1804
  var t = (e << 1 | e << 11) & 139536 | (e << 5 | e << 15) & 558144;
1941
1805
  return (t >> 16 | t >> 8 | t) & 255;
1942
1806
  }
1943
- for (var V = typeof Uint8Array < "u", H = V ? new Uint8Array(256) : [], U = 0; U < 256; ++U) H[U] = Ah(U);
1944
- function W(e, t) {
1945
- var n = H[e & 255];
1946
- return t <= 8 ? n >>> 8 - t : (n = n << 8 | H[e >> 8 & 255], t <= 16 ? n >>> 16 - t : (n = n << 8 | H[e >> 16 & 255], n >>> 24 - t));
1807
+ for (var Y = typeof Uint8Array < "u", X = Y ? new Uint8Array(256) : [], Vh = 0; Vh < 256; ++Vh) X[Vh] = Bh(Vh);
1808
+ function Hh(e, t) {
1809
+ var n = X[e & 255];
1810
+ return t <= 8 ? n >>> 8 - t : (n = n << 8 | X[e >> 8 & 255], t <= 16 ? n >>> 16 - t : (n = n << 8 | X[e >> 16 & 255], n >>> 24 - t));
1947
1811
  }
1948
- function jh(e, t) {
1812
+ function Uh(e, t) {
1949
1813
  var n = t & 7, i = t >>> 3;
1950
1814
  return (e[i] | (n <= 6 ? 0 : e[i + 1] << 8)) >>> n & 3;
1951
1815
  }
1952
- function Mh(e, t) {
1816
+ function Wh(e, t) {
1953
1817
  var n = t & 7, i = t >>> 3;
1954
1818
  return (e[i] | (n <= 5 ? 0 : e[i + 1] << 8)) >>> n & 7;
1955
1819
  }
1956
- function Nh(e, t) {
1820
+ function Gh(e, t) {
1957
1821
  var n = t & 7, i = t >>> 3;
1958
1822
  return (e[i] | (n <= 4 ? 0 : e[i + 1] << 8)) >>> n & 15;
1959
1823
  }
1960
- function Ph(e, t) {
1824
+ function Kh(e, t) {
1961
1825
  var n = t & 7, i = t >>> 3;
1962
1826
  return (e[i] | (n <= 3 ? 0 : e[i + 1] << 8)) >>> n & 31;
1963
1827
  }
1964
- function Fh(e, t) {
1828
+ function qh(e, t) {
1965
1829
  var n = t & 7, i = t >>> 3;
1966
1830
  return (e[i] | (n <= 1 ? 0 : e[i + 1] << 8)) >>> n & 127;
1967
1831
  }
1968
- function Ih(e, t, n) {
1832
+ function Jh(e, t, n) {
1969
1833
  var i = t & 7, a = t >>> 3, o = (1 << n) - 1, s = e[a] >>> i;
1970
1834
  return n < 8 - i || (s |= e[a + 1] << 8 - i, n < 16 - i) || (s |= e[a + 2] << 16 - i, n < 24 - i) || (s |= e[a + 3] << 24 - i), s & o;
1971
1835
  }
1972
- function Lh(e, t, n) {
1836
+ function Yh(e, t, n) {
1973
1837
  var i = t & 7, a = t >>> 3;
1974
1838
  return i <= 5 ? e[a] |= (n & 7) << i : (e[a] |= n << i & 255, e[a + 1] = (n & 7) >> 8 - i), t + 3;
1975
1839
  }
1976
- function Rh(e, t, n) {
1840
+ function Xh(e, t, n) {
1977
1841
  var i = t & 7, a = t >>> 3;
1978
1842
  return n = (n & 1) << i, e[a] |= n, t + 1;
1979
1843
  }
1980
- function G(e, t, n) {
1844
+ function Zh(e, t, n) {
1981
1845
  var i = t & 7, a = t >>> 3;
1982
1846
  return n <<= i, e[a] |= n & 255, n >>>= 8, e[a + 1] = n, t + 8;
1983
1847
  }
1984
- function zh(e, t, n) {
1848
+ function Qh(e, t, n) {
1985
1849
  var i = t & 7, a = t >>> 3;
1986
1850
  return n <<= i, e[a] |= n & 255, n >>>= 8, e[a + 1] = n & 255, e[a + 2] = n >>> 8, t + 16;
1987
1851
  }
1988
- function Bh(e, t) {
1852
+ function $h(e, t) {
1989
1853
  var n = e.length, i = 2 * n > t ? 2 * n : t + 5, a = 0;
1990
1854
  if (n >= t) return e;
1991
1855
  if (has_buf) {
@@ -1993,7 +1857,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1993
1857
  if (e.copy) e.copy(o);
1994
1858
  else for (; a < e.length; ++a) o[a] = e[a];
1995
1859
  return o;
1996
- } else if (V) {
1860
+ } else if (Y) {
1997
1861
  var s = new Uint8Array(i);
1998
1862
  if (s.set) s.set(e);
1999
1863
  else for (; a < n; ++a) s[a] = e[a];
@@ -2001,43 +1865,43 @@ var CRC32 = /* @__PURE__ */ (function() {
2001
1865
  }
2002
1866
  return e.length = i, e;
2003
1867
  }
2004
- function K(e) {
1868
+ function Z(e) {
2005
1869
  for (var t = Array(e), n = 0; n < e; ++n) t[n] = 0;
2006
1870
  return t;
2007
1871
  }
2008
- function Vh(e, t, n) {
2009
- var i = 1, a = 0, o = 0, s = 0, c = 0, l = e.length, u = V ? new Uint16Array(32) : K(32);
1872
+ function eg(e, t, n) {
1873
+ var i = 1, a = 0, o = 0, s = 0, c = 0, l = e.length, u = Y ? new Uint16Array(32) : Z(32);
2010
1874
  for (o = 0; o < 32; ++o) u[o] = 0;
2011
1875
  for (o = l; o < n; ++o) e[o] = 0;
2012
1876
  l = e.length;
2013
- var d = V ? new Uint16Array(l) : K(l);
1877
+ var d = Y ? new Uint16Array(l) : Z(l);
2014
1878
  for (o = 0; o < l; ++o) u[a = e[o]]++, i < a && (i = a), d[o] = 0;
2015
1879
  for (u[0] = 0, o = 1; o <= i; ++o) u[o + 16] = c = c + u[o - 1] << 1;
2016
1880
  for (o = 0; o < l; ++o) c = e[o], c != 0 && (d[o] = u[c + 16]++);
2017
1881
  var f = 0;
2018
- for (o = 0; o < l; ++o) if (f = e[o], f != 0) for (c = W(d[o], i) >> i - f, s = (1 << i + 4 - f) - 1; s >= 0; --s) t[c | s << f] = f & 15 | o << 4;
1882
+ for (o = 0; o < l; ++o) if (f = e[o], f != 0) for (c = Hh(d[o], i) >> i - f, s = (1 << i + 4 - f) - 1; s >= 0; --s) t[c | s << f] = f & 15 | o << 4;
2019
1883
  return i;
2020
1884
  }
2021
- var Hh = V ? new Uint16Array(512) : K(512), Uh = V ? new Uint16Array(32) : K(32);
2022
- if (!V) {
2023
- for (var q = 0; q < 512; ++q) Hh[q] = 0;
2024
- for (q = 0; q < 32; ++q) Uh[q] = 0;
1885
+ var tg = Y ? new Uint16Array(512) : Z(512), ng = Y ? new Uint16Array(32) : Z(32);
1886
+ if (!Y) {
1887
+ for (var Q = 0; Q < 512; ++Q) tg[Q] = 0;
1888
+ for (Q = 0; Q < 32; ++Q) ng[Q] = 0;
2025
1889
  }
2026
1890
  (function() {
2027
1891
  for (var e = [], t = 0; t < 32; t++) e.push(5);
2028
- Vh(e, Uh, 32);
1892
+ eg(e, ng, 32);
2029
1893
  var n = [];
2030
1894
  for (t = 0; t <= 143; t++) n.push(8);
2031
1895
  for (; t <= 255; t++) n.push(9);
2032
1896
  for (; t <= 279; t++) n.push(7);
2033
1897
  for (; t <= 287; t++) n.push(8);
2034
- Vh(n, Hh, 288);
1898
+ eg(n, tg, 288);
2035
1899
  })();
2036
- var Wh = /* @__PURE__ */ (function() {
2037
- for (var e = V ? new Uint8Array(32768) : [], t = 0, n = 0; t < kh.length - 1; ++t) for (; n < kh[t + 1]; ++n) e[n] = t;
1900
+ var rg = /* @__PURE__ */ (function() {
1901
+ for (var e = Y ? new Uint8Array(32768) : [], t = 0, n = 0; t < zh.length - 1; ++t) for (; n < zh[t + 1]; ++n) e[n] = t;
2038
1902
  for (; n < 32768; ++n) e[n] = 29;
2039
- var i = V ? new Uint8Array(259) : [];
2040
- for (t = 0, n = 0; t < z.length - 1; ++t) for (; n < z[t + 1]; ++n) i[n] = t;
1903
+ var i = Y ? new Uint8Array(259) : [];
1904
+ for (t = 0, n = 0; t < J.length - 1; ++t) for (; n < J[t + 1]; ++n) i[n] = t;
2041
1905
  function a(e, t) {
2042
1906
  for (var n = 0; n < e.length;) {
2043
1907
  var i = Math.min(65535, e.length - n), a = n + i == e.length;
@@ -2046,30 +1910,30 @@ var CRC32 = /* @__PURE__ */ (function() {
2046
1910
  return t.l;
2047
1911
  }
2048
1912
  function o(t, n) {
2049
- for (var a = 0, o = 0, s = V ? new Uint16Array(32768) : []; o < t.length;) {
1913
+ for (var a = 0, o = 0, s = Y ? new Uint16Array(32768) : []; o < t.length;) {
2050
1914
  var c = Math.min(65535, t.length - o);
2051
1915
  if (c < 10) {
2052
- for (a = Lh(n, a, +(o + c == t.length)), a & 7 && (a += 8 - (a & 7)), n.l = a / 8 | 0, n.write_shift(2, c), n.write_shift(2, ~c & 65535); c-- > 0;) n[n.l++] = t[o++];
1916
+ for (a = Yh(n, a, +(o + c == t.length)), a & 7 && (a += 8 - (a & 7)), n.l = a / 8 | 0, n.write_shift(2, c), n.write_shift(2, ~c & 65535); c-- > 0;) n[n.l++] = t[o++];
2053
1917
  a = n.l * 8;
2054
1918
  continue;
2055
1919
  }
2056
- a = Lh(n, a, +(o + c == t.length) + 2);
1920
+ a = Yh(n, a, +(o + c == t.length) + 2);
2057
1921
  for (var l = 0; c-- > 0;) {
2058
1922
  var u = t[o];
2059
1923
  l = (l << 5 ^ u) & 32767;
2060
1924
  var d = -1, f = 0;
2061
1925
  if ((d = s[l]) && (d |= o & -32768, d > o && (d -= 32768), d < o)) for (; t[d + f] == t[o + f] && f < 250;) ++f;
2062
1926
  if (f > 2) {
2063
- u = i[f], u <= 22 ? a = G(n, a, H[u + 1] >> 1) - 1 : (G(n, a, 3), a += 5, G(n, a, H[u - 23] >> 5), a += 3);
1927
+ u = i[f], u <= 22 ? a = Zh(n, a, X[u + 1] >> 1) - 1 : (Zh(n, a, 3), a += 5, Zh(n, a, X[u - 23] >> 5), a += 3);
2064
1928
  var p = u < 8 ? 0 : u - 4 >> 2;
2065
- p > 0 && (zh(n, a, f - z[u]), a += p), u = e[o - d], a = G(n, a, H[u] >> 3), a -= 3;
1929
+ p > 0 && (Qh(n, a, f - J[u]), a += p), u = e[o - d], a = Zh(n, a, X[u] >> 3), a -= 3;
2066
1930
  var m = u < 4 ? 0 : u - 2 >> 1;
2067
- m > 0 && (zh(n, a, o - d - kh[u]), a += m);
1931
+ m > 0 && (Qh(n, a, o - d - zh[u]), a += m);
2068
1932
  for (var h = 0; h < f; ++h) s[l] = o & 32767, l = (l << 5 ^ t[o]) & 32767, ++o;
2069
1933
  c -= f - 1;
2070
- } else u <= 143 ? u += 48 : a = Rh(n, a, 1), a = G(n, a, H[u]), s[l] = o & 32767, ++o;
1934
+ } else u <= 143 ? u += 48 : a = Xh(n, a, 1), a = Zh(n, a, X[u]), s[l] = o & 32767, ++o;
2071
1935
  }
2072
- a = G(n, a, 0) - 1;
1936
+ a = Zh(n, a, 0) - 1;
2073
1937
  }
2074
1938
  return n.l = (a + 7) / 8 | 0, n.l;
2075
1939
  }
@@ -2077,19 +1941,19 @@ var CRC32 = /* @__PURE__ */ (function() {
2077
1941
  return e.length < 8 ? a(e, t) : o(e, t);
2078
1942
  };
2079
1943
  })();
2080
- function J(e) {
2081
- var t = new_buf(50 + Math.floor(e.length * 1.1)), n = Wh(e, t);
1944
+ function ig(e) {
1945
+ var t = new_buf(50 + Math.floor(e.length * 1.1)), n = rg(e, t);
2082
1946
  return t.slice(0, n);
2083
1947
  }
2084
- var Gh = V ? new Uint16Array(32768) : K(32768), Y = V ? new Uint16Array(32768) : K(32768), X = V ? new Uint16Array(128) : K(128), Kh = 1, Z = 1;
2085
- function qh(e, t) {
2086
- var n = Ph(e, t) + 257;
1948
+ var ag = Y ? new Uint16Array(32768) : Z(32768), og = Y ? new Uint16Array(32768) : Z(32768), sg = Y ? new Uint16Array(128) : Z(128), cg = 1, lg = 1;
1949
+ function ug(e, t) {
1950
+ var n = Kh(e, t) + 257;
2087
1951
  t += 5;
2088
- var i = Ph(e, t) + 1;
1952
+ var i = Kh(e, t) + 1;
2089
1953
  t += 5;
2090
- var a = Nh(e, t) + 4;
1954
+ var a = Gh(e, t) + 4;
2091
1955
  t += 4;
2092
- for (var o = 0, s = V ? new Uint8Array(19) : K(19), c = [
1956
+ for (var o = 0, s = Y ? new Uint8Array(19) : Z(19), c = [
2093
1957
  0,
2094
1958
  0,
2095
1959
  0,
@@ -2109,25 +1973,25 @@ var CRC32 = /* @__PURE__ */ (function() {
2109
1973
  0,
2110
1974
  0,
2111
1975
  0
2112
- ], l = 1, u = V ? new Uint8Array(8) : K(8), d = V ? new Uint8Array(8) : K(8), f = s.length, p = 0; p < a; ++p) s[R[p]] = o = Mh(e, t), l < o && (l = o), u[o]++, t += 3;
1976
+ ], l = 1, u = Y ? new Uint8Array(8) : Z(8), d = Y ? new Uint8Array(8) : Z(8), f = s.length, p = 0; p < a; ++p) s[q[p]] = o = Wh(e, t), l < o && (l = o), u[o]++, t += 3;
2113
1977
  var m = 0;
2114
1978
  for (u[0] = 0, p = 1; p <= l; ++p) d[p] = m = m + u[p - 1] << 1;
2115
1979
  for (p = 0; p < f; ++p) (m = s[p]) != 0 && (c[p] = d[m]++);
2116
1980
  var h = 0;
2117
1981
  for (p = 0; p < f; ++p) if (h = s[p], h != 0) {
2118
- m = H[c[p]] >> 8 - h;
2119
- for (var g = (1 << 7 - h) - 1; g >= 0; --g) X[m | g << h] = h & 7 | p << 3;
1982
+ m = X[c[p]] >> 8 - h;
1983
+ for (var g = (1 << 7 - h) - 1; g >= 0; --g) sg[m | g << h] = h & 7 | p << 3;
2120
1984
  }
2121
1985
  var _ = [];
2122
- for (l = 1; _.length < n + i;) switch (m = X[Fh(e, t)], t += m & 7, m >>>= 3) {
1986
+ for (l = 1; _.length < n + i;) switch (m = sg[qh(e, t)], t += m & 7, m >>>= 3) {
2123
1987
  case 16:
2124
- for (o = 3 + jh(e, t), t += 2, m = _[_.length - 1]; o-- > 0;) _.push(m);
1988
+ for (o = 3 + Uh(e, t), t += 2, m = _[_.length - 1]; o-- > 0;) _.push(m);
2125
1989
  break;
2126
1990
  case 17:
2127
- for (o = 3 + Mh(e, t), t += 3; o-- > 0;) _.push(0);
1991
+ for (o = 3 + Wh(e, t), t += 3; o-- > 0;) _.push(0);
2128
1992
  break;
2129
1993
  case 18:
2130
- for (o = 11 + Fh(e, t), t += 7; o-- > 0;) _.push(0);
1994
+ for (o = 11 + qh(e, t), t += 7; o-- > 0;) _.push(0);
2131
1995
  break;
2132
1996
  default:
2133
1997
  _.push(m), l < m && (l = m);
@@ -2136,45 +2000,45 @@ var CRC32 = /* @__PURE__ */ (function() {
2136
2000
  var v = _.slice(0, n), y = _.slice(n);
2137
2001
  for (p = n; p < 286; ++p) v[p] = 0;
2138
2002
  for (p = i; p < 30; ++p) y[p] = 0;
2139
- return Kh = Vh(v, Gh, 286), Z = Vh(y, Y, 30), t;
2003
+ return cg = eg(v, ag, 286), lg = eg(y, og, 30), t;
2140
2004
  }
2141
- function Jh(e, t) {
2005
+ function dg(e, t) {
2142
2006
  if (e[0] == 3 && !(e[1] & 3)) return [new_raw_buf(t), 2];
2143
2007
  for (var n = 0, i = 0, a = new_unsafe_buf(t || 1 << 18), o = 0, s = a.length >>> 0, c = 0, l = 0; !(i & 1);) {
2144
- if (i = Mh(e, n), n += 3, i >>> 1) i >> 1 == 1 ? (c = 9, l = 5) : (n = qh(e, n), c = Kh, l = Z);
2008
+ if (i = Wh(e, n), n += 3, i >>> 1) i >> 1 == 1 ? (c = 9, l = 5) : (n = ug(e, n), c = cg, l = lg);
2145
2009
  else {
2146
2010
  n & 7 && (n += 8 - (n & 7));
2147
2011
  var u = e[n >>> 3] | e[(n >>> 3) + 1] << 8;
2148
- if (n += 32, u > 0) for (!t && s < o + u && (a = Bh(a, o + u), s = a.length); u-- > 0;) a[o++] = e[n >>> 3], n += 8;
2012
+ if (n += 32, u > 0) for (!t && s < o + u && (a = $h(a, o + u), s = a.length); u-- > 0;) a[o++] = e[n >>> 3], n += 8;
2149
2013
  continue;
2150
2014
  }
2151
2015
  for (;;) {
2152
- !t && s < o + 32767 && (a = Bh(a, o + 32767), s = a.length);
2153
- var d = Ih(e, n, c), f = i >>> 1 == 1 ? Hh[d] : Gh[d];
2016
+ !t && s < o + 32767 && (a = $h(a, o + 32767), s = a.length);
2017
+ var d = Jh(e, n, c), f = i >>> 1 == 1 ? tg[d] : ag[d];
2154
2018
  if (n += f & 15, f >>>= 4, !(f >>> 8 & 255)) a[o++] = f;
2155
2019
  else if (f == 256) break;
2156
2020
  else {
2157
2021
  f -= 257;
2158
2022
  var p = f < 8 ? 0 : f - 4 >> 2;
2159
2023
  p > 5 && (p = 0);
2160
- var m = o + z[f];
2161
- p > 0 && (m += Ih(e, n, p), n += p), d = Ih(e, n, l), f = i >>> 1 == 1 ? Uh[d] : Y[d], n += f & 15, f >>>= 4;
2162
- var h = f < 4 ? 0 : f - 2 >> 1, g = kh[f];
2163
- for (h > 0 && (g += Ih(e, n, h), n += h), !t && s < m && (a = Bh(a, m + 100), s = a.length); o < m;) a[o] = a[o - g], ++o;
2024
+ var m = o + J[f];
2025
+ p > 0 && (m += Jh(e, n, p), n += p), d = Jh(e, n, l), f = i >>> 1 == 1 ? ng[d] : og[d], n += f & 15, f >>>= 4;
2026
+ var h = f < 4 ? 0 : f - 2 >> 1, g = zh[f];
2027
+ for (h > 0 && (g += Jh(e, n, h), n += h), !t && s < m && (a = $h(a, m + 100), s = a.length); o < m;) a[o] = a[o - g], ++o;
2164
2028
  }
2165
2029
  }
2166
2030
  }
2167
2031
  return t ? [a, n + 7 >>> 3] : [a.slice(0, o), n + 7 >>> 3];
2168
2032
  }
2169
- function Yh(e, t) {
2170
- var n = e.slice(e.l || 0), i = Jh(n, t);
2033
+ function fg(e, t) {
2034
+ var n = e.slice(e.l || 0), i = dg(n, t);
2171
2035
  return e.l += i[1], i[0];
2172
2036
  }
2173
- function Xh(e, t) {
2037
+ function pg(e, t) {
2174
2038
  if (e) typeof console < "u" && console.error(t);
2175
2039
  else throw Error(t);
2176
2040
  }
2177
- function Zh(e, t) {
2041
+ function mg(e, t) {
2178
2042
  var n = e;
2179
2043
  prep_blob(n, 0);
2180
2044
  var i = {
@@ -2192,11 +2056,11 @@ var CRC32 = /* @__PURE__ */ (function() {
2192
2056
  var p = n.read_shift(4), m = s(n.slice(n.l + u, n.l + u + d));
2193
2057
  n.l += u + d + f;
2194
2058
  var h = n.l;
2195
- n.l = p + 4, Qh(n, c, l, i, m), n.l = h;
2059
+ n.l = p + 4, hg(n, c, l, i, m), n.l = h;
2196
2060
  }
2197
2061
  return i;
2198
2062
  }
2199
- function Qh(e, t, n, i, a) {
2063
+ function hg(e, t, n, i, a) {
2200
2064
  e.l += 2;
2201
2065
  var c = e.read_shift(2), l = e.read_shift(2), u = o(e);
2202
2066
  if (c & 8257) throw Error("Unsupported ZIP encryption");
@@ -2209,25 +2073,25 @@ var CRC32 = /* @__PURE__ */ (function() {
2209
2073
  var y = e.slice(e.l, e.l + f);
2210
2074
  switch (l) {
2211
2075
  case 8:
2212
- y = Th(e, p);
2076
+ y = K(e, p);
2213
2077
  break;
2214
2078
  case 0: break;
2215
2079
  default: throw Error("Unsupported ZIP Compression method " + l);
2216
2080
  }
2217
2081
  var b = !1;
2218
- c & 8 && (d = e.read_shift(4), d == 134695760 && (d = e.read_shift(4), b = !0), f = e.read_shift(4), p = e.read_shift(4)), f != t && Xh(b, "Bad compressed size: " + t + " != " + f), p != n && Xh(b, "Bad uncompressed size: " + n + " != " + p), cg(i, g, y, {
2082
+ c & 8 && (d = e.read_shift(4), d == 134695760 && (d = e.read_shift(4), b = !0), f = e.read_shift(4), p = e.read_shift(4)), f != t && pg(b, "Bad compressed size: " + t + " != " + f), p != n && pg(b, "Bad uncompressed size: " + n + " != " + p), Eg(i, g, y, {
2219
2083
  unsafe: !0,
2220
2084
  mt: u
2221
2085
  });
2222
2086
  }
2223
- function $h(e, t) {
2087
+ function gg(e, t) {
2224
2088
  var n = t || {}, i = [], o = [], s = new_buf(1), c = n.compression ? 8 : 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = e.FullPaths[0], h = m, g = e.FileIndex[0], _ = [], v = 0;
2225
2089
  for (u = 1; u < e.FullPaths.length; ++u) if (h = e.FullPaths[u].slice(m.length), g = e.FileIndex[u], !(!g.size || !g.content || h == "Sh33tJ5")) {
2226
2090
  var y = f, b = new_buf(h.length);
2227
2091
  for (d = 0; d < h.length; ++d) b.write_shift(1, h.charCodeAt(d) & 127);
2228
2092
  b = b.slice(0, b.l), _[p] = CRC32.buf(g.content, 0);
2229
2093
  var x = g.content;
2230
- c == 8 && (x = Eh(x)), s = new_buf(30), s.write_shift(4, 67324752), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), g.mt ? a(s, g.mt) : s.write_shift(4, 0), s.write_shift(-4, l & 8 ? 0 : _[p]), s.write_shift(4, l & 8 ? 0 : x.length), s.write_shift(4, l & 8 ? 0 : g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), f += s.length, i.push(s), f += b.length, i.push(b), f += x.length, i.push(x), l & 8 && (s = new_buf(12), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), f += s.l, i.push(s)), s = new_buf(46), s.write_shift(4, 33639248), s.write_shift(2, 0), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), s.write_shift(4, 0), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(4, 0), s.write_shift(4, y), v += s.l, o.push(s), v += b.length, o.push(b), ++p;
2094
+ c == 8 && (x = Rh(x)), s = new_buf(30), s.write_shift(4, 67324752), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), g.mt ? a(s, g.mt) : s.write_shift(4, 0), s.write_shift(-4, l & 8 ? 0 : _[p]), s.write_shift(4, l & 8 ? 0 : x.length), s.write_shift(4, l & 8 ? 0 : g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), f += s.length, i.push(s), f += b.length, i.push(b), f += x.length, i.push(x), l & 8 && (s = new_buf(12), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), f += s.l, i.push(s)), s = new_buf(46), s.write_shift(4, 33639248), s.write_shift(2, 0), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), s.write_shift(4, 0), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(4, 0), s.write_shift(4, y), v += s.l, o.push(s), v += b.length, o.push(b), ++p;
2231
2095
  }
2232
2096
  return s = new_buf(22), s.write_shift(4, 101010256), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, p), s.write_shift(2, p), s.write_shift(4, v), s.write_shift(4, f), s.write_shift(2, 0), bconcat([
2233
2097
  bconcat(i),
@@ -2235,7 +2099,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2235
2099
  s
2236
2100
  ]);
2237
2101
  }
2238
- var eg = {
2102
+ var _g = {
2239
2103
  htm: "text/html",
2240
2104
  xml: "text/xml",
2241
2105
  gif: "image/gif",
@@ -2245,16 +2109,16 @@ var CRC32 = /* @__PURE__ */ (function() {
2245
2109
  thmx: "application/vnd.ms-officetheme",
2246
2110
  sh33tj5: "application/octet-stream"
2247
2111
  };
2248
- function tg(e, t) {
2112
+ function vg(e, t) {
2249
2113
  if (e.ctype) return e.ctype;
2250
2114
  var n = e.name || "", i = n.match(/\.([^\.]+)$/);
2251
- return i && eg[i[1]] || t && (i = (n = t).match(/[\.\\]([^\.\\])+$/), i && eg[i[1]]) ? eg[i[1]] : "application/octet-stream";
2115
+ return i && _g[i[1]] || t && (i = (n = t).match(/[\.\\]([^\.\\])+$/), i && _g[i[1]]) ? _g[i[1]] : "application/octet-stream";
2252
2116
  }
2253
- function ng(e) {
2117
+ function yg(e) {
2254
2118
  for (var t = Base64_encode(e), n = [], i = 0; i < t.length; i += 76) n.push(t.slice(i, i + 76));
2255
2119
  return n.join("\r\n") + "\r\n";
2256
2120
  }
2257
- function rg(e) {
2121
+ function bg(e) {
2258
2122
  var t = e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g, function(e) {
2259
2123
  var t = e.charCodeAt(0).toString(16).toUpperCase();
2260
2124
  return "=" + (t.length == 1 ? "0" + t : t);
@@ -2273,7 +2137,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2273
2137
  }
2274
2138
  return n.join("\r\n");
2275
2139
  }
2276
- function Q(e) {
2140
+ function xg(e) {
2277
2141
  for (var t = [], n = 0; n < e.length; ++n) {
2278
2142
  for (var i = e[n]; n <= e.length && i.charAt(i.length - 1) == "=";) i = i.slice(0, i.length - 1) + e[++n];
2279
2143
  t.push(i);
@@ -2283,7 +2147,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2283
2147
  });
2284
2148
  return s2a(t.join("\r\n"));
2285
2149
  }
2286
- function ig(e, t, n) {
2150
+ function Sg(e, t, n) {
2287
2151
  for (var i = "", a = "", o = "", s, c = 0; c < 10; ++c) {
2288
2152
  var l = t[c];
2289
2153
  if (!l || l.match(/^\s*$/)) break;
@@ -2305,16 +2169,16 @@ var CRC32 = /* @__PURE__ */ (function() {
2305
2169
  s = s2a(Base64_decode(t.slice(c).join("")));
2306
2170
  break;
2307
2171
  case "quoted-printable":
2308
- s = Q(t.slice(c));
2172
+ s = xg(t.slice(c));
2309
2173
  break;
2310
2174
  default: throw Error("Unsupported Content-Transfer-Encoding " + a);
2311
2175
  }
2312
- var d = cg(e, i.slice(n.length), s, { unsafe: !0 });
2176
+ var d = Eg(e, i.slice(n.length), s, { unsafe: !0 });
2313
2177
  o && (d.ctype = o);
2314
2178
  }
2315
- function ag(e, t) {
2316
- if (F(e.slice(0, 13)).toLowerCase() != "mime-version:") throw Error("Unsupported MAD header");
2317
- var n = t && t.root || "", i = (has_buf && Buffer.isBuffer(e) ? e.toString("binary") : F(e)).split("\r\n"), a = 0, o = "";
2179
+ function Cg(e, t) {
2180
+ if (V(e.slice(0, 13)).toLowerCase() != "mime-version:") throw Error("Unsupported MAD header");
2181
+ var n = t && t.root || "", i = (has_buf && Buffer.isBuffer(e) ? e.toString("binary") : V(e)).split("\r\n"), a = 0, o = "";
2318
2182
  for (a = 0; a < i.length; ++a) if (o = i[a], /^Content-Location:/i.test(o) && (o = o.slice(o.indexOf("file")), n ||= o.slice(0, o.lastIndexOf("/") + 1), o.slice(0, n.length) != n)) for (; n.length > 0 && (n = n.slice(0, n.length - 1), n = n.slice(0, n.lastIndexOf("/") + 1), o.slice(0, n.length) != n););
2319
2183
  var s = (i[1] || "").match(/boundary="(.*?)"/);
2320
2184
  if (!s) throw Error("MAD cannot find boundary");
@@ -2326,11 +2190,11 @@ var CRC32 = /* @__PURE__ */ (function() {
2326
2190
  var u, d = 0;
2327
2191
  for (a = 0; a < i.length; ++a) {
2328
2192
  var f = i[a];
2329
- f !== c && f !== c + "--" || (d++ && ig(l, i.slice(u, a), n), u = a);
2193
+ f !== c && f !== c + "--" || (d++ && Sg(l, i.slice(u, a), n), u = a);
2330
2194
  }
2331
2195
  return l;
2332
2196
  }
2333
- function og(e, t) {
2197
+ function wg(e, t) {
2334
2198
  var n = t || {}, i = n.boundary || "SheetJS";
2335
2199
  i = "------=" + i;
2336
2200
  for (var a = [
@@ -2345,17 +2209,17 @@ var CRC32 = /* @__PURE__ */ (function() {
2345
2209
  }).replace(/[\u0080-\uFFFF]/g, function(e) {
2346
2210
  return "_u" + e.charCodeAt(0).toString(16) + "_";
2347
2211
  });
2348
- for (var u = c.content, d = has_buf && Buffer.isBuffer(u) ? u.toString("binary") : F(u), f = 0, p = Math.min(1024, d.length), m = 0, h = 0; h <= p; ++h) (m = d.charCodeAt(h)) >= 32 && m < 128 && ++f;
2212
+ for (var u = c.content, d = has_buf && Buffer.isBuffer(u) ? u.toString("binary") : V(u), f = 0, p = Math.min(1024, d.length), m = 0, h = 0; h <= p; ++h) (m = d.charCodeAt(h)) >= 32 && m < 128 && ++f;
2349
2213
  var g = f >= p * 4 / 5;
2350
- a.push(i), a.push("Content-Location: " + (n.root || "file:///C:/SheetJS/") + s), a.push("Content-Transfer-Encoding: " + (g ? "quoted-printable" : "base64")), a.push("Content-Type: " + tg(c, s)), a.push(""), a.push(g ? rg(d) : ng(d));
2214
+ a.push(i), a.push("Content-Location: " + (n.root || "file:///C:/SheetJS/") + s), a.push("Content-Transfer-Encoding: " + (g ? "quoted-printable" : "base64")), a.push("Content-Type: " + vg(c, s)), a.push(""), a.push(g ? bg(d) : yg(d));
2351
2215
  }
2352
2216
  return a.push(i + "--\r\n"), a.join("\r\n");
2353
2217
  }
2354
- function sg(e) {
2218
+ function Tg(e) {
2355
2219
  var t = {};
2356
2220
  return C(t, e), t;
2357
2221
  }
2358
- function cg(e, t, n, a) {
2222
+ function Eg(e, t, n, a) {
2359
2223
  var o = a && a.unsafe;
2360
2224
  o || C(e);
2361
2225
  var s = !o && CFB.find(e, t);
@@ -2368,7 +2232,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2368
2232
  }
2369
2233
  return s.content = n, s.size = n ? n.length : 0, a && (a.CLSID && (s.clsid = a.CLSID), a.mt && (s.mt = a.mt), a.ct && (s.ct = a.ct)), s;
2370
2234
  }
2371
- function lg(e, t) {
2235
+ function Dg(e, t) {
2372
2236
  C(e);
2373
2237
  var n = CFB.find(e, t);
2374
2238
  if (n) {
@@ -2376,7 +2240,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2376
2240
  }
2377
2241
  return !1;
2378
2242
  }
2379
- function ug(e, t, n) {
2243
+ function Og(e, t, n) {
2380
2244
  C(e);
2381
2245
  var a = CFB.find(e, t);
2382
2246
  if (a) {
@@ -2384,23 +2248,23 @@ var CRC32 = /* @__PURE__ */ (function() {
2384
2248
  }
2385
2249
  return !1;
2386
2250
  }
2387
- function dg(e) {
2251
+ function kg(e) {
2388
2252
  T(e, !0);
2389
2253
  }
2390
- return e.find = D, e.read = S, e.parse = u, e.write = I, e.writeFile = P, e.utils = {
2391
- cfb_new: sg,
2392
- cfb_add: cg,
2393
- cfb_del: lg,
2394
- cfb_mov: ug,
2395
- cfb_gc: dg,
2254
+ return e.find = D, e.read = S, e.parse = u, e.write = H, e.writeFile = B, e.utils = {
2255
+ cfb_new: Tg,
2256
+ cfb_add: Eg,
2257
+ cfb_del: Dg,
2258
+ cfb_mov: Og,
2259
+ cfb_gc: kg,
2396
2260
  ReadShift,
2397
2261
  CheckField,
2398
2262
  prep_blob,
2399
2263
  bconcat,
2400
- use_zlib: _h,
2401
- _deflateRaw: J,
2402
- _inflateRaw: Yh,
2403
- consts: N
2264
+ use_zlib: G,
2265
+ _deflateRaw: ig,
2266
+ _inflateRaw: fg,
2267
+ consts: z
2404
2268
  }, e;
2405
2269
  })(), _fs = void 0;
2406
2270
  function blobify(e) {
@@ -4869,60 +4733,60 @@ var DBF = /* @__PURE__ */ (function() {
4869
4733
  }
4870
4734
  var h = safe_decode_range(e["!ref"]), g = [], _ = [], v = [];
4871
4735
  for (d = 0; d <= h.e.c - h.s.c; ++d) {
4872
- var y = "", b = "", x = 0, S = [];
4873
- for (f = 0; f < l.length; ++f) l[f][d] != null && S.push(l[f][d]);
4874
- if (S.length == 0 || c[d] == null) {
4736
+ var b = "", x = "", S = 0, C = [];
4737
+ for (f = 0; f < l.length; ++f) l[f][d] != null && C.push(l[f][d]);
4738
+ if (C.length == 0 || c[d] == null) {
4875
4739
  g[d] = "?";
4876
4740
  continue;
4877
4741
  }
4878
- for (f = 0; f < S.length; ++f) {
4879
- switch (typeof S[f]) {
4742
+ for (f = 0; f < C.length; ++f) {
4743
+ switch (typeof C[f]) {
4880
4744
  case "number":
4881
- b = "B";
4745
+ x = "B";
4882
4746
  break;
4883
4747
  case "string":
4884
- b = "C";
4748
+ x = "C";
4885
4749
  break;
4886
4750
  case "boolean":
4887
- b = "L";
4751
+ x = "L";
4888
4752
  break;
4889
4753
  case "object":
4890
- b = S[f] instanceof Date ? "D" : "C";
4754
+ x = C[f] instanceof Date ? "D" : "C";
4891
4755
  break;
4892
- default: b = "C";
4756
+ default: x = "C";
4893
4757
  }
4894
- x = Math.max(x, String(S[f]).length), y = y && y != b ? "C" : b;
4758
+ S = Math.max(S, String(C[f]).length), b = b && b != x ? "C" : x;
4895
4759
  }
4896
- x > 250 && (x = 250), b = ((u[d] || {}).DBF || {}).type, b == "C" && u[d].DBF.len > x && (x = u[d].DBF.len), y == "B" && b == "N" && (y = "N", v[d] = u[d].DBF.dec, x = u[d].DBF.len), _[d] = y == "C" || b == "N" ? x : o[y] || 0, m += _[d], g[d] = y;
4760
+ S > 250 && (S = 250), x = ((u[d] || {}).DBF || {}).type, x == "C" && u[d].DBF.len > S && (S = u[d].DBF.len), b == "B" && x == "N" && (b = "N", v[d] = u[d].DBF.dec, S = u[d].DBF.len), _[d] = b == "C" || x == "N" ? S : o[b] || 0, m += _[d], g[d] = b;
4897
4761
  }
4898
- var C = a.next(32);
4899
- for (C.write_shift(4, 318902576), C.write_shift(4, l.length), C.write_shift(2, 296 + 32 * p), C.write_shift(2, m), d = 0; d < 4; ++d) C.write_shift(4, 0);
4900
- for (C.write_shift(4, 0 | (+t[current_ansi] || 3) << 8), d = 0, f = 0; d < c.length; ++d) if (c[d] != null) {
4901
- var w = a.next(32), E = (c[d].slice(-10) + "\0\0\0\0\0\0\0\0\0\0\0").slice(0, 11);
4902
- w.write_shift(1, E, "sbcs"), w.write_shift(1, g[d] == "?" ? "C" : g[d], "sbcs"), w.write_shift(4, f), w.write_shift(1, _[d] || o[g[d]] || 0), w.write_shift(1, v[d] || 0), w.write_shift(1, 2), w.write_shift(4, 0), w.write_shift(1, 0), w.write_shift(4, 0), w.write_shift(4, 0), f += _[d] || o[g[d]] || 0;
4762
+ var T = a.next(32);
4763
+ for (T.write_shift(4, 318902576), T.write_shift(4, l.length), T.write_shift(2, 296 + 32 * p), T.write_shift(2, m), d = 0; d < 4; ++d) T.write_shift(4, 0);
4764
+ for (T.write_shift(4, 0 | (+t[current_ansi] || 3) << 8), d = 0, f = 0; d < c.length; ++d) if (c[d] != null) {
4765
+ var E = a.next(32), D = (c[d].slice(-10) + "\0\0\0\0\0\0\0\0\0\0\0").slice(0, 11);
4766
+ E.write_shift(1, D, "sbcs"), E.write_shift(1, g[d] == "?" ? "C" : g[d], "sbcs"), E.write_shift(4, f), E.write_shift(1, _[d] || o[g[d]] || 0), E.write_shift(1, v[d] || 0), E.write_shift(1, 2), E.write_shift(4, 0), E.write_shift(1, 0), E.write_shift(4, 0), E.write_shift(4, 0), f += _[d] || o[g[d]] || 0;
4903
4767
  }
4904
- var D = a.next(264);
4905
- for (D.write_shift(4, 13), d = 0; d < 65; ++d) D.write_shift(4, 0);
4768
+ var O = a.next(264);
4769
+ for (O.write_shift(4, 13), d = 0; d < 65; ++d) O.write_shift(4, 0);
4906
4770
  for (d = 0; d < l.length; ++d) {
4907
- var O = a.next(m);
4908
- for (O.write_shift(1, 0), f = 0; f < c.length; ++f) if (c[f] != null) switch (g[f]) {
4771
+ var k = a.next(m);
4772
+ for (k.write_shift(1, 0), f = 0; f < c.length; ++f) if (c[f] != null) switch (g[f]) {
4909
4773
  case "L":
4910
- O.write_shift(1, l[d][f] == null ? 63 : l[d][f] ? 84 : 70);
4774
+ k.write_shift(1, l[d][f] == null ? 63 : l[d][f] ? 84 : 70);
4911
4775
  break;
4912
4776
  case "B":
4913
- O.write_shift(8, l[d][f] || 0, "f");
4777
+ k.write_shift(8, l[d][f] || 0, "f");
4914
4778
  break;
4915
4779
  case "N":
4916
- var k = "0";
4917
- for (typeof l[d][f] == "number" && (k = l[d][f].toFixed(v[f] || 0)), p = 0; p < _[f] - k.length; ++p) O.write_shift(1, 32);
4918
- O.write_shift(1, k, "sbcs");
4780
+ var A = "0";
4781
+ for (typeof l[d][f] == "number" && (A = l[d][f].toFixed(v[f] || 0)), p = 0; p < _[f] - A.length; ++p) k.write_shift(1, 32);
4782
+ k.write_shift(1, A, "sbcs");
4919
4783
  break;
4920
4784
  case "D":
4921
- l[d][f] ? (O.write_shift(4, ("0000" + l[d][f].getFullYear()).slice(-4), "sbcs"), O.write_shift(2, ("00" + (l[d][f].getMonth() + 1)).slice(-2), "sbcs"), O.write_shift(2, ("00" + l[d][f].getDate()).slice(-2), "sbcs")) : O.write_shift(8, "00000000", "sbcs");
4785
+ l[d][f] ? (k.write_shift(4, ("0000" + l[d][f].getFullYear()).slice(-4), "sbcs"), k.write_shift(2, ("00" + (l[d][f].getMonth() + 1)).slice(-2), "sbcs"), k.write_shift(2, ("00" + l[d][f].getDate()).slice(-2), "sbcs")) : k.write_shift(8, "00000000", "sbcs");
4922
4786
  break;
4923
4787
  case "C":
4924
4788
  var j = String(l[d][f] == null ? "" : l[d][f]).slice(0, _[f]);
4925
- for (O.write_shift(1, j, "sbcs"), p = 0; p < _[f] - j.length; ++p) O.write_shift(1, 32);
4789
+ for (k.write_shift(1, j, "sbcs"), p = 0; p < _[f] - j.length; ++p) k.write_shift(1, 32);
4926
4790
  break;
4927
4791
  }
4928
4792
  }
@@ -5056,53 +4920,53 @@ var DBF = /* @__PURE__ */ (function() {
5056
4920
  x[1].charAt(0) == "P" && f.push(b.slice(3).replace(/;;/g, ";"));
5057
4921
  break;
5058
4922
  case "C":
5059
- var w = !1, T = !1, E = !1, D = !1, O = -1, k = -1;
4923
+ var T = !1, E = !1, D = !1, O = !1, A = -1, j = -1;
5060
4924
  for (u = 1; u < x.length; ++u) switch (x[u].charAt(0)) {
5061
4925
  case "A": break;
5062
4926
  case "X":
5063
- c = parseInt(x[u].slice(1)) - 1, T = !0;
4927
+ c = parseInt(x[u].slice(1)) - 1, E = !0;
5064
4928
  break;
5065
4929
  case "Y":
5066
- for (s = parseInt(x[u].slice(1)) - 1, T || (c = 0), y = d.length; y <= s; ++y) d[y] = [];
4930
+ for (s = parseInt(x[u].slice(1)) - 1, E || (c = 0), y = d.length; y <= s; ++y) d[y] = [];
5067
4931
  break;
5068
4932
  case "K":
5069
- C = x[u].slice(1), C.charAt(0) === "\"" ? C = C.slice(1, C.length - 1) : C === "TRUE" ? C = !0 : C === "FALSE" ? C = !1 : isNaN(fuzzynum(C)) ? isNaN(fuzzydate(C).getDate()) || (C = parseDate(C)) : (C = fuzzynum(C), p !== null && fmt_is_date(p) && (C = numdate(C))), $cptable !== void 0 && typeof C == "string" && (a || {}).type != "string" && (a || {}).codepage && (C = $cptable.utils.decode(a.codepage, C)), w = !0;
4933
+ C = x[u].slice(1), C.charAt(0) === "\"" ? C = C.slice(1, C.length - 1) : C === "TRUE" ? C = !0 : C === "FALSE" ? C = !1 : isNaN(fuzzynum(C)) ? isNaN(fuzzydate(C).getDate()) || (C = parseDate(C)) : (C = fuzzynum(C), p !== null && fmt_is_date(p) && (C = numdate(C))), $cptable !== void 0 && typeof C == "string" && (a || {}).type != "string" && (a || {}).codepage && (C = $cptable.utils.decode(a.codepage, C)), T = !0;
5070
4934
  break;
5071
4935
  case "E":
5072
- D = !0;
5073
- var j = rc_to_a1(x[u].slice(1), {
4936
+ O = !0;
4937
+ var M = rc_to_a1(x[u].slice(1), {
5074
4938
  r: s,
5075
4939
  c
5076
4940
  });
5077
- d[s][c] = [d[s][c], j];
4941
+ d[s][c] = [d[s][c], M];
5078
4942
  break;
5079
4943
  case "S":
5080
- E = !0, d[s][c] = [d[s][c], "S5S"];
4944
+ D = !0, d[s][c] = [d[s][c], "S5S"];
5081
4945
  break;
5082
4946
  case "G": break;
5083
4947
  case "R":
5084
- O = parseInt(x[u].slice(1)) - 1;
4948
+ A = parseInt(x[u].slice(1)) - 1;
5085
4949
  break;
5086
4950
  case "C":
5087
- k = parseInt(x[u].slice(1)) - 1;
4951
+ j = parseInt(x[u].slice(1)) - 1;
5088
4952
  break;
5089
4953
  default: if (a && a.WTF) throw Error("SYLK bad record " + b);
5090
4954
  }
5091
- if (w && (d[s][c] && d[s][c].length == 2 ? d[s][c][0] = C : d[s][c] = C, p = null), E) {
5092
- if (D) throw Error("SYLK shared formula cannot have own formula");
5093
- var M = O > -1 && d[O][k];
5094
- if (!M || !M[1]) throw Error("SYLK shared formula cannot find base");
5095
- d[s][c][1] = shift_formula_str(M[1], {
5096
- r: s - O,
5097
- c: c - k
4955
+ if (T && (d[s][c] && d[s][c].length == 2 ? d[s][c][0] = C : d[s][c] = C, p = null), D) {
4956
+ if (O) throw Error("SYLK shared formula cannot have own formula");
4957
+ var N = A > -1 && d[A][j];
4958
+ if (!N || !N[1]) throw Error("SYLK shared formula cannot find base");
4959
+ d[s][c][1] = shift_formula_str(N[1], {
4960
+ r: s - A,
4961
+ c: c - j
5098
4962
  });
5099
4963
  }
5100
4964
  break;
5101
4965
  case "F":
5102
- var N = 0;
4966
+ var P = 0;
5103
4967
  for (u = 1; u < x.length; ++u) switch (x[u].charAt(0)) {
5104
4968
  case "X":
5105
- c = parseInt(x[u].slice(1)) - 1, ++N;
4969
+ c = parseInt(x[u].slice(1)) - 1, ++P;
5106
4970
  break;
5107
4971
  case "Y":
5108
4972
  for (s = parseInt(x[u].slice(1)) - 1, y = d.length; y <= s; ++y) d[y] = [];
@@ -5129,7 +4993,7 @@ var DBF = /* @__PURE__ */ (function() {
5129
4993
  break;
5130
4994
  default: if (a && a.WTF) throw Error("SYLK bad record " + b);
5131
4995
  }
5132
- N < 1 && (p = null);
4996
+ P < 1 && (p = null);
5133
4997
  break;
5134
4998
  default: if (a && a.WTF) throw Error("SYLK bad record " + b);
5135
4999
  }
@@ -5531,7 +5395,7 @@ var DBF = /* @__PURE__ */ (function() {
5531
5395
  function e(e, t, n) {
5532
5396
  if (e) {
5533
5397
  prep_blob(e, e.l || 0);
5534
- for (var i = n.Enum || vh; e.l < e.length;) {
5398
+ for (var i = n.Enum || B; e.l < e.length;) {
5535
5399
  var a = e.read_shift(2), o = i[a] || i[65535], s = e.read_shift(2), c = e.l + s, l = o.f && o.f(e, s, n);
5536
5400
  if (e.l = c, t(l, o, a)) return;
5537
5401
  }
@@ -5561,7 +5425,7 @@ var DBF = /* @__PURE__ */ (function() {
5561
5425
  }
5562
5426
  }, p = i.sheetRows || 0;
5563
5427
  if (t[2] == 0 && (t[3] == 8 || t[3] == 9) && t.length >= 16 && t[14] == 5 && t[15] === 108) throw Error("Unsupported Works 3 for Mac file");
5564
- if (t[2] == 2) i.Enum = vh, e(t, function(e, t, n) {
5428
+ if (t[2] == 2) i.Enum = B, e(t, function(e, t, n) {
5565
5429
  switch (n) {
5566
5430
  case 0:
5567
5431
  i.vers = e, e >= 4096 && (i.qpro = !0);
@@ -5600,7 +5464,7 @@ var DBF = /* @__PURE__ */ (function() {
5600
5464
  default:
5601
5465
  }
5602
5466
  }, i);
5603
- else if (t[2] == 26 || t[2] == 14) i.Enum = bh, t[2] == 14 && (i.qpro = !0, t.l = 0), e(t, function(e, t, n) {
5467
+ else if (t[2] == 26 || t[2] == 14) i.Enum = V, t[2] == 14 && (i.qpro = !0, t.l = 0), e(t, function(e, t, n) {
5604
5468
  switch (n) {
5605
5469
  case 204:
5606
5470
  o = e;
@@ -5665,7 +5529,7 @@ var DBF = /* @__PURE__ */ (function() {
5665
5529
  if (+n.codepage >= 0 && set_cp(+n.codepage), n.type == "string") throw Error("Cannot write WK3 to JS string");
5666
5530
  var i = buf_array();
5667
5531
  write_biff_rec(i, 0, s(e));
5668
- for (var a = 0, o = 0; a < e.SheetNames.length; ++a) (e.Sheets[e.SheetNames[a]] || {})["!ref"] && write_biff_rec(i, 27, _h(e.SheetNames[a], o++));
5532
+ for (var a = 0, o = 0; a < e.SheetNames.length; ++a) (e.Sheets[e.SheetNames[a]] || {})["!ref"] && write_biff_rec(i, 27, z(e.SheetNames[a], o++));
5669
5533
  var c = 0;
5670
5534
  for (a = 0; a < e.SheetNames.length; ++a) {
5671
5535
  var l = e.Sheets[e.SheetNames[a]];
@@ -5673,10 +5537,10 @@ var DBF = /* @__PURE__ */ (function() {
5673
5537
  for (var u = safe_decode_range(l["!ref"]), d = Array.isArray(l), f = [], p = Math.min(u.e.r, 8191), m = u.s.r; m <= p; ++m) for (var h = encode_row(m), g = u.s.c; g <= u.e.c; ++g) {
5674
5538
  m === u.s.r && (f[g] = encode_col(g));
5675
5539
  var _ = f[g] + h, v = d ? (l[m] || [])[g] : l[_];
5676
- if (!(!v || v.t == "z")) if (v.t == "n") write_biff_rec(i, 23, D(m, g, c, v.v));
5540
+ if (!(!v || v.t == "z")) if (v.t == "n") write_biff_rec(i, 23, O(m, g, c, v.v));
5677
5541
  else {
5678
5542
  var y = format_cell(v);
5679
- write_biff_rec(i, 22, w(m, g, c, y.slice(0, 239)));
5543
+ write_biff_rec(i, 22, T(m, g, c, y.slice(0, 239)));
5680
5544
  }
5681
5545
  }
5682
5546
  ++c;
@@ -5870,7 +5734,7 @@ var DBF = /* @__PURE__ */ (function() {
5870
5734
  var n = S(e, t);
5871
5735
  return n[1].t = "s", n[1].v = e.read_shift(t - 4, "cstr"), n;
5872
5736
  }
5873
- function w(e, t, n, i) {
5737
+ function T(e, t, n, i) {
5874
5738
  var a = new_buf(6 + i.length);
5875
5739
  a.write_shift(2, e), a.write_shift(1, n), a.write_shift(1, t), a.write_shift(1, 39);
5876
5740
  for (var o = 0; o < i.length; ++o) {
@@ -5879,7 +5743,7 @@ var DBF = /* @__PURE__ */ (function() {
5879
5743
  }
5880
5744
  return a.write_shift(1, 0), a;
5881
5745
  }
5882
- function T(e, t) {
5746
+ function E(e, t) {
5883
5747
  var n = S(e, t);
5884
5748
  n[1].v = e.read_shift(2);
5885
5749
  var i = n[1].v >> 1;
@@ -5911,44 +5775,44 @@ var DBF = /* @__PURE__ */ (function() {
5911
5775
  }
5912
5776
  return n[1].v = i, n;
5913
5777
  }
5914
- function E(e, t) {
5778
+ function D(e, t) {
5915
5779
  var n = S(e, t), i = e.read_shift(4), a = e.read_shift(4), o = e.read_shift(2);
5916
5780
  if (o == 65535) return i === 0 && a === 3221225472 ? (n[1].t = "e", n[1].v = 15) : i === 0 && a === 3489660928 ? (n[1].t = "e", n[1].v = 42) : n[1].v = 0, n;
5917
5781
  var s = o & 32768;
5918
5782
  return o = (o & 32767) - 16446, n[1].v = (1 - s * 2) * (a * 2 ** (o + 32) + i * 2 ** o), n;
5919
5783
  }
5920
- function D(e, t, n, i) {
5784
+ function O(e, t, n, i) {
5921
5785
  var a = new_buf(14);
5922
5786
  if (a.write_shift(2, e), a.write_shift(1, n), a.write_shift(1, t), i == 0) return a.write_shift(4, 0), a.write_shift(4, 0), a.write_shift(2, 65535), a;
5923
5787
  var o = 0, s = 0, c = 0, l = 0;
5924
5788
  return i < 0 && (o = 1, i = -i), s = Math.log2(i) | 0, i /= 2 ** (s - 31), l = i >>> 0, l & 2147483648 || (i /= 2, ++s, l = i >>> 0), i -= l, l |= 2147483648, l >>>= 0, i *= 2 ** 32, c = i >>> 0, a.write_shift(4, c), a.write_shift(4, l), s += 16383 + (o ? 32768 : 0), a.write_shift(2, s), a;
5925
5789
  }
5926
- function O(e, t) {
5927
- var n = E(e, 14);
5790
+ function k(e, t) {
5791
+ var n = D(e, 14);
5928
5792
  return e.l += t - 14, n;
5929
5793
  }
5930
- function k(e, t) {
5794
+ function j(e, t) {
5931
5795
  var n = S(e, t), i = e.read_shift(4);
5932
5796
  return n[1].v = i >> 6, n;
5933
5797
  }
5934
- function j(e, t) {
5798
+ function M(e, t) {
5935
5799
  var n = S(e, t), i = e.read_shift(8, "f");
5936
5800
  return n[1].v = i, n;
5937
5801
  }
5938
- function M(e, t) {
5939
- var n = j(e, 14);
5802
+ function N(e, t) {
5803
+ var n = M(e, 14);
5940
5804
  return e.l += t - 10, n;
5941
5805
  }
5942
- function N(e, t) {
5806
+ function F(e, t) {
5943
5807
  return e[e.l + t - 1] == 0 ? e.read_shift(t, "cstr") : "";
5944
5808
  }
5945
- function P(e, t) {
5809
+ function I(e, t) {
5946
5810
  var n = e[e.l++];
5947
5811
  n > t - 1 && (n = t - 1);
5948
5812
  for (var i = ""; i.length < n;) i += String.fromCharCode(e[e.l++]);
5949
5813
  return i;
5950
5814
  }
5951
- function F(e, t, n) {
5815
+ function L(e, t, n) {
5952
5816
  if (!(!n.qpro || t < 21)) {
5953
5817
  var i = e.read_shift(1);
5954
5818
  e.l += 17, e.l += 1, e.l += 2;
@@ -5956,7 +5820,7 @@ var DBF = /* @__PURE__ */ (function() {
5956
5820
  return [i, a];
5957
5821
  }
5958
5822
  }
5959
- function L(e, t) {
5823
+ function R(e, t) {
5960
5824
  for (var n = {}, i = e.l + t; e.l < i;) {
5961
5825
  var a = e.read_shift(2);
5962
5826
  if (a == 14e3) {
@@ -5966,7 +5830,7 @@ var DBF = /* @__PURE__ */ (function() {
5966
5830
  }
5967
5831
  return n;
5968
5832
  }
5969
- function _h(e, t) {
5833
+ function z(e, t) {
5970
5834
  var n = new_buf(5 + e.length);
5971
5835
  n.write_shift(2, 14e3), n.write_shift(2, t);
5972
5836
  for (var i = 0; i < e.length; ++i) {
@@ -5975,7 +5839,7 @@ var DBF = /* @__PURE__ */ (function() {
5975
5839
  }
5976
5840
  return n[n.l++] = 0, n;
5977
5841
  }
5978
- var vh = {
5842
+ var B = {
5979
5843
  0: {
5980
5844
  n: "BOF",
5981
5845
  f: parseuint16
@@ -6060,14 +5924,14 @@ var DBF = /* @__PURE__ */ (function() {
6060
5924
  105: { n: "MRANGES??" },
6061
5925
  204: {
6062
5926
  n: "SHEETNAMECS",
6063
- f: N
5927
+ f: F
6064
5928
  },
6065
5929
  222: {
6066
5930
  n: "SHEETNAMELP",
6067
- f: P
5931
+ f: I
6068
5932
  },
6069
5933
  65535: { n: "" }
6070
- }, bh = {
5934
+ }, V = {
6071
5935
  0: { n: "BOF" },
6072
5936
  1: { n: "EOF" },
6073
5937
  2: { n: "PASSWORD" },
@@ -6096,20 +5960,20 @@ var DBF = /* @__PURE__ */ (function() {
6096
5960
  },
6097
5961
  23: {
6098
5962
  n: "NUMBER17",
6099
- f: E
5963
+ f: D
6100
5964
  },
6101
5965
  24: {
6102
5966
  n: "NUMBER18",
6103
- f: T
5967
+ f: E
6104
5968
  },
6105
5969
  25: {
6106
5970
  n: "FORMULA19",
6107
- f: O
5971
+ f: k
6108
5972
  },
6109
5973
  26: { n: "FORMULA1A" },
6110
5974
  27: {
6111
5975
  n: "XFORMAT",
6112
- f: L
5976
+ f: R
6113
5977
  },
6114
5978
  28: { n: "DTLABELMISC" },
6115
5979
  29: { n: "DTLABELCELL" },
@@ -6121,16 +5985,16 @@ var DBF = /* @__PURE__ */ (function() {
6121
5985
  35: { n: "??" },
6122
5986
  37: {
6123
5987
  n: "NUMBER25",
6124
- f: k
5988
+ f: j
6125
5989
  },
6126
5990
  38: { n: "??" },
6127
5991
  39: {
6128
5992
  n: "NUMBER27",
6129
- f: j
5993
+ f: M
6130
5994
  },
6131
5995
  40: {
6132
5996
  n: "FORMULA28",
6133
- f: M
5997
+ f: N
6134
5998
  },
6135
5999
  142: { n: "??" },
6136
6000
  147: { n: "??" },
@@ -6155,7 +6019,7 @@ var DBF = /* @__PURE__ */ (function() {
6155
6019
  201: { n: "??" },
6156
6020
  204: {
6157
6021
  n: "SHEETNAMECS",
6158
- f: N
6022
+ f: F
6159
6023
  },
6160
6024
  205: { n: "??" },
6161
6025
  206: { n: "??" },
@@ -6203,7 +6067,7 @@ var DBF = /* @__PURE__ */ (function() {
6203
6067
  772: { n: "??" },
6204
6068
  1537: {
6205
6069
  n: "SHEETINFOQP",
6206
- f: F
6070
+ f: L
6207
6071
  },
6208
6072
  1600: { n: "??" },
6209
6073
  1602: { n: "??" },
@@ -11397,8 +11261,8 @@ function sheet_add_dom(e, t, n) {
11397
11261
  t: "n",
11398
11262
  v: fuzzynum(w)
11399
11263
  })), D.z === void 0 && T != null && (D.z = T);
11400
- var k = "", A = C.getElementsByTagName("A");
11401
- if (A && A.length) for (var j = 0; j < A.length && !(A[j].hasAttribute("href") && (k = A[j].getAttribute("href"), k.charAt(0) != "#")); ++j);
11264
+ var k = "", j = C.getElementsByTagName("A");
11265
+ if (j && j.length) for (var M = 0; M < j.length && !(j[M].hasAttribute("href") && (k = j[M].getAttribute("href"), k.charAt(0) != "#")); ++M);
11402
11266
  k && k.charAt(0) != "#" && (D.l = { Target: k }), i.dense ? (e[g + a] || (e[g + a] = []), e[g + a][v + o] = D) : e[encode_cell({
11403
11267
  c: v + o,
11404
11268
  r: g + a
@@ -12053,8 +11917,8 @@ function write_numbers_iwa(e, t) {
12053
11917
  var g = write_iwa_file(t);
12054
11918
  e.content = compress_iwa_file(g), e.size = e.content.length;
12055
11919
  })(), F.data = write_shallow(I), D[3][0].data = write_shallow(P), v[4][0].data = write_shallow(D), m.messages[0].data = write_shallow(v);
12056
- var _h = write_iwa_file(p);
12057
- return f.content = compress_iwa_file(_h), f.size = f.content.length, u;
11920
+ var R = write_iwa_file(p);
11921
+ return f.content = compress_iwa_file(R), f.size = f.content.length, u;
12058
11922
  }
12059
11923
  function fix_opts_func(e) {
12060
11924
  return function(t) {
@@ -12818,7 +12682,7 @@ var buildThemePalette$1 = (e) => {
12818
12682
  border: getColor(e, 3),
12819
12683
  text: getColor(e, 6)
12820
12684
  };
12821
- }, Button_default = ({ level: e = "primary", size: n = "medium", type: i = "button", posIcon: a = "left", disabled: o = !1, loading: s = !1, label: c, icon: l, children: p, theme: m, color: h, backgroundColor: g, className: _,...v }) => {
12685
+ }, Button_default = ({ level: e = "primary", size: n = "medium", type: i = "button", posIcon: a = "left", disabled: o = !1, loading: s = !1, label: c, icon: l, children: u, theme: m, color: h, backgroundColor: g, className: _,...v }) => {
12822
12686
  let y = h || g, b = React.useMemo(() => y ? generatePalette(y) : buildThemePalette$1(m ?? "blue"), [y, m]), [x, S] = React.useState(!1), [C, w] = React.useState(!1), T = !(o || s), E = {
12823
12687
  small: "h-6 px-3 text-xs",
12824
12688
  medium: "h-8 px-4 text-sm",
@@ -12927,13 +12791,148 @@ var buildThemePalette$1 = (e) => {
12927
12791
  fill: "currentColor",
12928
12792
  d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
12929
12793
  })]
12930
- }), p || /* @__PURE__ */ jsxs(Fragment, { children: [
12794
+ }), u || /* @__PURE__ */ jsxs(Fragment, { children: [
12931
12795
  l && a === "left" && !s && l,
12932
12796
  c && e !== "icon" && /* @__PURE__ */ jsx("span", { children: c }),
12933
12797
  l && a === "right" && !s && l
12934
12798
  ] })]
12935
12799
  });
12936
- }, AdvancedTable_module_default = {
12800
+ }, TableBody_default = ({ loading: e, paginatedData: t, displayColumns: n, getColumnWidth: i, pinnedColumns: a, stickyActionsColumn: o, rowKey: s, editingRowId: c, enableInlineEditing: l, editValues: u, validationErrors: d, handleInputChange: m, labels: h }) => /* @__PURE__ */ jsx("tbody", { children: e ? Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ jsx("tr", {
12801
+ className: "border-b border-solid border-gray-100",
12802
+ children: n.map((e, t) => {
12803
+ let s = i(e), c = a.includes(e.id), l = e.isAction && o, u = 0;
12804
+ if (c) for (let e = 0; e < t; e++) a.includes(n[e].id) && (u += i(n[e]));
12805
+ let d = {
12806
+ width: s,
12807
+ minWidth: s,
12808
+ maxWidth: s,
12809
+ ...l ? {
12810
+ position: "sticky",
12811
+ right: 0,
12812
+ zIndex: 10,
12813
+ backgroundColor: "white"
12814
+ } : c ? {
12815
+ position: "sticky",
12816
+ left: u,
12817
+ zIndex: 10,
12818
+ backgroundColor: "white"
12819
+ } : {}
12820
+ };
12821
+ return /* @__PURE__ */ jsx("td", {
12822
+ className: `py-2 px-3 ${e.isAction ? "bg-white border-l border-gray-200" : ""} ${c && !l ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""} ${l ? "shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}`,
12823
+ style: d,
12824
+ children: /* @__PURE__ */ jsx("div", { className: "h-4 bg-gray-200 rounded animate-pulse w-3/4" })
12825
+ }, `skeleton-cell-${t}`);
12826
+ })
12827
+ }, `skeleton-${t}`)) : t.length > 0 ? t.map((e, t) => /* @__PURE__ */ jsx("tr", {
12828
+ className: "even:bg-gray-50 hover:bg-gray-100 border-b border-solid border-b-gray-100 odd:bg-white",
12829
+ children: n.map((h, g) => {
12830
+ let _ = typeof h.accessor == "function" ? h.accessor(e) : e[h.accessor], v = h.isAction, y = i(h), b = a.includes(h.id), x = v && o, S = 0;
12831
+ if (b) for (let e = 0; e < g; e++) a.includes(n[e].id) && (S += i(n[e]));
12832
+ let C = `py-2 px-3 text-redi-text font-normal leading-6 align-middle border-r border-solid border-r-gray-300 static table-cell last:border-r-0 first:font-medium
12833
+ ${v ? "border-l border-gray-300" : ""}
12834
+ ${b && !x ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
12835
+ ${x ? "shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
12836
+ `, w = {
12837
+ width: y,
12838
+ minWidth: y,
12839
+ maxWidth: y,
12840
+ overflowWrap: "break-word",
12841
+ ...x ? {
12842
+ position: "sticky",
12843
+ right: 0,
12844
+ zIndex: 15,
12845
+ backgroundColor: "inherit"
12846
+ } : b ? {
12847
+ position: "sticky",
12848
+ left: S,
12849
+ zIndex: 10,
12850
+ backgroundColor: "inherit"
12851
+ } : {}
12852
+ }, T = c === (typeof s == "function" ? s(e) : e[s]);
12853
+ if (l && T && h.editable) {
12854
+ let e = u[h.id] ?? _, t = d[h.id];
12855
+ return /* @__PURE__ */ jsx("td", {
12856
+ className: `${C} p-1`,
12857
+ style: w,
12858
+ children: /* @__PURE__ */ jsxs("div", {
12859
+ className: "flex flex-col",
12860
+ children: [h.inputType === "select" ? /* @__PURE__ */ jsxs("select", {
12861
+ className: `w-full border ${t ? "border-red-500" : "border-gray-300"} rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-redi-primary`,
12862
+ value: e,
12863
+ onChange: (e) => m(h.id, e.target.value),
12864
+ onClick: (e) => e.stopPropagation(),
12865
+ children: [/* @__PURE__ */ jsx("option", {
12866
+ value: "",
12867
+ children: "Select..."
12868
+ }), h.options?.map((e) => /* @__PURE__ */ jsx("option", {
12869
+ value: e.value,
12870
+ children: e.label
12871
+ }, e.value))]
12872
+ }) : /* @__PURE__ */ jsx("input", {
12873
+ type: h.inputType || "text",
12874
+ className: `w-full border ${t ? "border-red-500" : "border-gray-300"} rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-redi-primary`,
12875
+ value: e,
12876
+ onChange: (e) => m(h.id, e.target.value),
12877
+ onClick: (e) => e.stopPropagation()
12878
+ }), t && /* @__PURE__ */ jsx("span", {
12879
+ className: "text-xs text-red-500 mt-1",
12880
+ children: t
12881
+ })]
12882
+ })
12883
+ }, h.id);
12884
+ }
12885
+ return h.render ? /* @__PURE__ */ jsx("td", {
12886
+ className: C,
12887
+ style: w,
12888
+ children: h.render({
12889
+ value: _,
12890
+ row: e,
12891
+ column: h,
12892
+ index: t
12893
+ })
12894
+ }, h.id) : /* @__PURE__ */ jsx("td", {
12895
+ className: C,
12896
+ style: w,
12897
+ children: formatCellValue(_)
12898
+ }, h.id);
12899
+ })
12900
+ }, t)) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
12901
+ colSpan: n.length,
12902
+ className: "py-12 text-center text-gray-500",
12903
+ children: /* @__PURE__ */ jsxs("div", {
12904
+ className: "flex flex-col items-center justify-center gap-2",
12905
+ children: [/* @__PURE__ */ jsx("svg", {
12906
+ className: "w-12 h-12 text-gray-300",
12907
+ fill: "none",
12908
+ stroke: "currentColor",
12909
+ viewBox: "0 0 24 24",
12910
+ children: /* @__PURE__ */ jsx("path", {
12911
+ strokeLinecap: "round",
12912
+ strokeLinejoin: "round",
12913
+ strokeWidth: 1.5,
12914
+ d: "M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"
12915
+ })
12916
+ }), /* @__PURE__ */ jsx("span", {
12917
+ className: "text-sm font-medium",
12918
+ children: h.noData
12919
+ })]
12920
+ })
12921
+ }) }) });
12922
+ const FilterIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
12923
+ fill: e,
12924
+ stroke: "currentColor",
12925
+ viewBox: "0 0 24 24",
12926
+ width: t,
12927
+ height: t,
12928
+ children: /* @__PURE__ */ jsx("path", {
12929
+ fillRule: "evenodd",
12930
+ d: "M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z",
12931
+ clipRule: "evenodd",
12932
+ fill: "currentColor"
12933
+ })
12934
+ });
12935
+ var AdvancedTable_module_default = {
12937
12936
  controls: "_controls_1pwn9_1",
12938
12937
  leftControls: "_leftControls_1pwn9_10",
12939
12938
  rightControls: "_rightControls_1pwn9_16",
@@ -13018,24 +13017,24 @@ var buildThemePalette$1 = (e) => {
13018
13017
  children: e.count
13019
13018
  })
13020
13019
  ]
13021
- }, e.value), AdvancedFilter_default = ({ label: e, options: t, textValue: n, selectedValues: i, onTextChange: a, onSelectionChange: s, onClose: u, loading: p = !1, isServerRefetch: m = !1 }) => {
13020
+ }, e.value), AdvancedFilter_default = ({ label: e, options: t, textValue: n, selectedValues: i, onTextChange: a, onSelectionChange: o, onClose: c, loading: d = !1, isServerRefetch: m = !1 }) => {
13022
13021
  let [h, g] = useState(""), _ = useRef(null), v = t.filter((e) => e.value.toLowerCase().includes(h.toLowerCase()) || e.label.toLowerCase().includes(h.toLowerCase())), y = (e) => {
13023
13022
  let t = i.includes(e.value) ? i.filter((t) => t !== e.value) : [...i, e.value];
13024
- s(t);
13023
+ o(t);
13025
13024
  }, b = () => {
13026
13025
  let e = v.map((e) => e.value);
13027
- s(e);
13026
+ o(e);
13028
13027
  }, x = () => {
13029
- s([]), a("");
13028
+ o([]), a("");
13030
13029
  };
13031
13030
  return useEffect(() => {
13032
13031
  let e = (e) => {
13033
- _.current && !_.current.contains(e.target) && u();
13032
+ _.current && !_.current.contains(e.target) && c();
13034
13033
  };
13035
13034
  return document.addEventListener("mousedown", e), () => {
13036
13035
  document.removeEventListener("mousedown", e);
13037
13036
  };
13038
- }, [u]), /* @__PURE__ */ jsxs("div", {
13037
+ }, [c]), /* @__PURE__ */ jsxs("div", {
13039
13038
  className: AdvancedTable_module_default.filterModal,
13040
13039
  ref: _,
13041
13040
  children: [
@@ -13070,7 +13069,7 @@ var buildThemePalette$1 = (e) => {
13070
13069
  level: "tertiary",
13071
13070
  children: "Limpiar todo"
13072
13071
  })]
13073
- }), p ? /* @__PURE__ */ jsx("div", {
13072
+ }), d ? /* @__PURE__ */ jsx("div", {
13074
13073
  className: AdvancedTable_module_default.filterOption,
13075
13074
  children: /* @__PURE__ */ jsx("span", {
13076
13075
  className: AdvancedTable_module_default.filterOptionLabel,
@@ -13104,14 +13103,14 @@ var buildThemePalette$1 = (e) => {
13104
13103
  onClick: () => {
13105
13104
  if (h.trim()) {
13106
13105
  let e = h.trim();
13107
- i.includes(e) || s([...i, e]);
13106
+ i.includes(e) || o([...i, e]);
13108
13107
  }
13109
- u();
13108
+ c();
13110
13109
  },
13111
13110
  level: "primary",
13112
13111
  children: "Buscar Avanzado"
13113
13112
  }) : /* @__PURE__ */ jsxs(Button_default, {
13114
- onClick: u,
13113
+ onClick: c,
13115
13114
  level: "primary",
13116
13115
  children: [
13117
13116
  "Aplicar (",
@@ -13122,36 +13121,653 @@ var buildThemePalette$1 = (e) => {
13122
13121
  })
13123
13122
  ]
13124
13123
  });
13125
- };
13126
- const useAdvancedTable = (e) => {
13127
- let { data: t, columns: n, defaultSort: a, defaultFilters: u = {}, defaultPageSize: d = 10, pageSizeOptions: f = [
13128
- 10,
13129
- 25,
13130
- 50,
13131
- 100,
13132
- 200,
13133
- 300,
13134
- 400,
13135
- 500
13136
- ], initialConfig: p, onConfigChange: m, onPaginationChange: h, onFiltersChange: g, fetchData: _, rowKey: v = "id", onRowSelectionChange: y, syncFiltersWithUrl: b = !1, enablePagination: x = !0 } = e, [S, C] = useState(p?.sort || a || void 0), [w, T] = useState(() => {
13137
- let e = p?.filters || u;
13138
- if (b && typeof window < "u") {
13139
- let t = new URLSearchParams(window.location.search), i = { ...e };
13140
- return t.forEach((e, a) => {
13141
- if (!n.find((e) => e.id === a)) return;
13142
- let o = i[a];
13143
- if (o) Array.isArray(o.value) ? i[a] = {
13144
- ...o,
13145
- value: [...o.value, e],
13146
- type: "multiselect"
13147
- } : i[a] = {
13148
- ...o,
13149
- value: [o.value, e],
13150
- type: "multiselect"
13151
- };
13152
- else {
13153
- let n = t.getAll(a);
13154
- n.length > 1 ? i[a] = {
13124
+ }, TableHeader_default = ({ displayColumns: e, getColumnWidth: t, pinnedColumns: n, stickyActionsColumn: i, enableColumnReordering: o, handleColumnReorder: c, sortConfig: d, handleSort: m, enableSorting: h, filters: g, handleFilter: _, fetchData: v, data: y, paginatedData: b, enableColumnResizing: x, handleColumnResize: S, tableColumns: C, rowKey: w, selectedRows: T, handleSelectAll: E, stateColumnOrder: D }) => {
13125
+ let [O, k] = useState(null), [A, j] = useState(null), [M, N] = useState(null), [P, F] = useState({}), [I, L] = useState({}), R = useRef(null);
13126
+ useEffect(() => {
13127
+ let e = (e) => {
13128
+ if (!R.current) return;
13129
+ let { columnId: t, startX: n, startWidth: i } = R.current, a = e.clientX - n;
13130
+ S(t, i + a);
13131
+ }, t = () => {
13132
+ R.current = null, document.body.style.cursor = "default", document.body.style.userSelect = "auto";
13133
+ };
13134
+ if (x) return document.addEventListener("mousemove", e), document.addEventListener("mouseup", t), () => {
13135
+ document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", t);
13136
+ };
13137
+ }, [x, S]);
13138
+ let Fh = (e, t, n) => {
13139
+ e.preventDefault(), e.stopPropagation(), R.current = {
13140
+ columnId: t,
13141
+ startX: e.clientX,
13142
+ startWidth: n
13143
+ }, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
13144
+ }, z = (e, t) => {
13145
+ k(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", "");
13146
+ }, B = (e, t) => {
13147
+ e.preventDefault(), e.dataTransfer.dropEffect = "move", j(t);
13148
+ }, V = () => {
13149
+ j(null);
13150
+ }, Ih = (t, n) => {
13151
+ if (t.preventDefault(), O === null) return;
13152
+ let i = e[O].id, a = e[n].id;
13153
+ if (i === a) {
13154
+ k(null), j(null);
13155
+ return;
13156
+ }
13157
+ let o = t.currentTarget.getBoundingClientRect(), s = t.clientX - o.left > o.width / 2, l = [...D], u = l.indexOf(i), d = l.indexOf(a);
13158
+ u === -1 || d === -1 || (l.splice(u, 1), d = l.indexOf(a), s ? l.splice(d + 1, 0, i) : l.splice(d, 0, i), c(l), k(null), j(null));
13159
+ }, H = () => {
13160
+ k(null), j(null);
13161
+ }, Lh = useCallback(async (e) => {
13162
+ let t = C.find((t) => t.id === e);
13163
+ if (t?.fetchColumn && !P[e]) {
13164
+ L((t) => ({
13165
+ ...t,
13166
+ [e]: !0
13167
+ }));
13168
+ try {
13169
+ let n = await t.fetchColumn();
13170
+ F((t) => ({
13171
+ ...t,
13172
+ [e]: n
13173
+ }));
13174
+ } catch (t) {
13175
+ console.error(`Failed to load options for column ${e}:`, t);
13176
+ } finally {
13177
+ L((t) => ({
13178
+ ...t,
13179
+ [e]: !1
13180
+ }));
13181
+ }
13182
+ }
13183
+ }, [C, P]), U = (e) => {
13184
+ let t = M !== e;
13185
+ N(t ? e : null), t && Lh(e);
13186
+ }, W = useCallback((e) => {
13187
+ let t = C.find((t) => t.id === e);
13188
+ if (!t) return [];
13189
+ if (t.fetchColumn && P[e]) return P[e];
13190
+ if (t.fetchColumn && !P[e]) return [];
13191
+ let n = v ? b : y, i = n.filter((t) => Object.entries(g).every(([n, i]) => {
13192
+ if (n === e || !i.value) return !0;
13193
+ let a = C.find((e) => e.id === n);
13194
+ if (!a) return !0;
13195
+ let o = typeof a.accessor == "function" ? a.accessor(t) : t[a.accessor], s = String(o || "").toLowerCase(), c = !0;
13196
+ return i.type === "text" && (c = s.includes(String(i.value).toLowerCase())), i.type === "select" && (c = s === String(i.value).toLowerCase()), i.type === "multiselect" && Array.isArray(i.value) && (c = i.value.some((e) => s === String(e).toLowerCase())), c;
13197
+ })), a = /* @__PURE__ */ new Map();
13198
+ i.forEach((e) => {
13199
+ let n = typeof t.accessor == "function" ? t.accessor(e) : e[t.accessor], i = formatCellValue(n);
13200
+ a.set(i, (a.get(i) || 0) + 1);
13201
+ });
13202
+ let o = /* @__PURE__ */ new Map();
13203
+ n.forEach((e) => {
13204
+ let n = typeof t.accessor == "function" ? t.accessor(e) : e[t.accessor], i = formatCellValue(n);
13205
+ o.set(i, (o.get(i) || 0) + 1);
13206
+ });
13207
+ let s = [], c = [];
13208
+ return o.forEach((e, t) => {
13209
+ let n = a.get(t);
13210
+ n !== void 0 && n > 0 ? s.push({
13211
+ value: t,
13212
+ count: n,
13213
+ label: `${t} (${n})`,
13214
+ group: "Disponibles"
13215
+ }) : c.push({
13216
+ value: t,
13217
+ count: e,
13218
+ label: `${t} (0)`,
13219
+ group: "Otros"
13220
+ });
13221
+ }), s.sort((e, t) => e.value.localeCompare(t.value)), c.sort((e, t) => e.value.localeCompare(t.value)), c.length === 0 ? s.map((e) => ({
13222
+ ...e,
13223
+ group: void 0
13224
+ })) : [...s, ...c];
13225
+ }, [
13226
+ y,
13227
+ b,
13228
+ v,
13229
+ g,
13230
+ C,
13231
+ P
13232
+ ]);
13233
+ return /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: e.map((a, s) => {
13234
+ let c = t(a), l = n.includes(a.id), u = a.isAction && i, y = 0;
13235
+ if (l) for (let i = 0; i < s; i++) n.includes(e[i].id) && (y += t(e[i]));
13236
+ let S = {
13237
+ width: c,
13238
+ minWidth: c,
13239
+ maxWidth: c,
13240
+ ...u ? {
13241
+ position: "sticky",
13242
+ right: 0,
13243
+ zIndex: 25,
13244
+ backgroundColor: "#f9fafb"
13245
+ } : l ? {
13246
+ position: "sticky",
13247
+ left: y,
13248
+ zIndex: 20,
13249
+ backgroundColor: "#f9fafb"
13250
+ } : {}
13251
+ };
13252
+ return /* @__PURE__ */ jsx("th", {
13253
+ className: `bg-gray-50 border-b border-solid border-gray-200 text-left font-semibold text-redi-text p-0 sticky top-0 z-10 select-none hover:bg-gray-200
13254
+ ${O === s ? "opacity-50 bg-gray-300" : ""}
13255
+ ${A === s ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
13256
+ ${l && !u ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
13257
+ ${u ? "shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
13258
+ `,
13259
+ style: S,
13260
+ draggable: !a.isAction && o && (a.draggable ?? !1),
13261
+ onDragStart: (e) => !a.isAction && o && (a.draggable ?? !1) && z(e, s),
13262
+ onDragOver: (e) => !a.isAction && o && B(e, s),
13263
+ onDragLeave: V,
13264
+ onDrop: (e) => !a.isAction && o && Ih(e, s),
13265
+ onDragEnd: H,
13266
+ "aria-sort": d?.column === a.id ? d.direction === "asc" ? "ascending" : "descending" : "none",
13267
+ children: /* @__PURE__ */ jsxs("div", {
13268
+ className: "flex items-center py-2 px-3 gap-2 min-h-10",
13269
+ children: [
13270
+ !a.isAction && o && (a.draggable ?? !1) && /* @__PURE__ */ jsx("div", {
13271
+ className: "text-gray-600 cursor-grab opacity-70 hover:opacity-100 text-base",
13272
+ "aria-hidden": "true",
13273
+ children: "⋮⋮"
13274
+ }),
13275
+ a.id === "selection-synthetic" && /* @__PURE__ */ jsx("input", {
13276
+ type: "checkbox",
13277
+ className: "w-4 h-4 accent-redi-primary cursor-pointer mr-2",
13278
+ checked: b.length > 0 && b.every((e) => {
13279
+ let t = typeof w == "function" ? w(e) : e[w];
13280
+ return T.includes(t);
13281
+ }),
13282
+ onChange: (e) => {
13283
+ e.stopPropagation(), E(b);
13284
+ }
13285
+ }),
13286
+ /* @__PURE__ */ jsxs("div", {
13287
+ className: "flex flex-1 items-center gap-2",
13288
+ children: [/* @__PURE__ */ jsxs("span", {
13289
+ className: h ? "cursor-pointer py-1 px-1.5 rounded-sm flex items-center gap-1.5 text-sm font-semibold text-redi-text uppercase hover:bg-redi-background hover:text-redi-link-text" : "",
13290
+ onClick: (e) => {
13291
+ e.stopPropagation(), a.sortable && m(a.id);
13292
+ },
13293
+ role: "button",
13294
+ tabIndex: 0,
13295
+ onKeyDown: (e) => {
13296
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a.sortable && m(a.id));
13297
+ },
13298
+ children: [a.label, a.sortable && d?.column === a.id && /* @__PURE__ */ jsx("span", {
13299
+ className: "font-bold text-redi-link-text text-base",
13300
+ children: d.direction === "asc" ? " ↑" : " ↓"
13301
+ })]
13302
+ }), /* @__PURE__ */ jsx("div", {
13303
+ className: "flex items-center gap-1",
13304
+ children: a.filterable && /* @__PURE__ */ jsxs("div", {
13305
+ className: "relative",
13306
+ children: [/* @__PURE__ */ jsx(Button_default, {
13307
+ level: "icon",
13308
+ onClick: (e) => {
13309
+ e.stopPropagation(), U(a.id);
13310
+ },
13311
+ "aria-label": `Filter by ${a.label}`,
13312
+ children: /* @__PURE__ */ jsx(FilterIcon, { size: 16 })
13313
+ }), M === a.id && /* @__PURE__ */ jsx(AdvancedFilter_default, {
13314
+ columnId: a.id,
13315
+ label: a.label,
13316
+ options: W(a.id),
13317
+ textValue: g[a.id]?.type === "text" ? String(g[a.id].value || "") : "",
13318
+ selectedValues: g[a.id]?.value ? Array.isArray(g[a.id].value) ? g[a.id].value : [String(g[a.id].value)] : [],
13319
+ onTextChange: (e) => _(a.id, e, "text"),
13320
+ onSelectionChange: (e) => _(a.id, e, "multiselect"),
13321
+ onClose: () => N(null),
13322
+ loading: I[a.id] || !1,
13323
+ isServerRefetch: !!v && !!a.shouldBeRefetch
13324
+ })]
13325
+ })
13326
+ })]
13327
+ }),
13328
+ x && !a.isAction && a.id !== "selection-synthetic" && /* @__PURE__ */ jsx("div", {
13329
+ className: "absolute right-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-redi-primary z-20",
13330
+ onMouseDown: (e) => Fh(e, a.id, c)
13331
+ })
13332
+ ]
13333
+ })
13334
+ }, a.id);
13335
+ }) }) });
13336
+ };
13337
+ const TablePagination = ({ pagination: e, labels: t, totalUnfiltered: n, pageSizeOptions: i, handlePageSizeChange: a, handlePageChange: o, totalPages: s }) => /* @__PURE__ */ jsxs("div", {
13338
+ className: "flex items-center justify-between py-4 px-6 bg-white border-t-gray-300 border-solid border-t gap-4",
13339
+ children: [/* @__PURE__ */ jsx("div", {
13340
+ className: "text-redi-text text-base font-medium shrink-0",
13341
+ children: /* @__PURE__ */ jsxs("span", { children: [
13342
+ t.pagination?.showingItems,
13343
+ " ",
13344
+ (e.page - 1) * e.pageSize + 1,
13345
+ " ",
13346
+ t.pagination?.to,
13347
+ " ",
13348
+ Math.min(e.page * e.pageSize, e.total),
13349
+ " ",
13350
+ t.pagination?.of,
13351
+ " ",
13352
+ e.total,
13353
+ e.total < n && n > 0 && /* @__PURE__ */ jsxs("span", {
13354
+ className: "text-gray-500",
13355
+ children: [
13356
+ " (filtrado de ",
13357
+ n,
13358
+ ")"
13359
+ ]
13360
+ }),
13361
+ " ",
13362
+ t.pagination?.items
13363
+ ] })
13364
+ }), /* @__PURE__ */ jsxs("div", {
13365
+ className: "flex items-center gap-5",
13366
+ children: [/* @__PURE__ */ jsxs("label", {
13367
+ className: "flex items-center gap-3 text-sm font-semibold text-redi-text",
13368
+ children: [
13369
+ t.pagination?.showPerPage,
13370
+ /* @__PURE__ */ jsx("select", {
13371
+ value: e.pageSize,
13372
+ onChange: (e) => a(Number(e.target.value)),
13373
+ className: "py-1.5 px-2.5 border border-solid border-gray-300 rounded-md bg-white text-redi-text focus:outline-none focus:ring-2 focus:ring-redi-primary",
13374
+ children: i.map((e) => /* @__PURE__ */ jsx("option", {
13375
+ value: e,
13376
+ children: e
13377
+ }, e))
13378
+ }),
13379
+ t.pagination?.perPageItems
13380
+ ]
13381
+ }), /* @__PURE__ */ jsxs("div", {
13382
+ className: "flex gap-1 items-center",
13383
+ children: [
13384
+ /* @__PURE__ */ jsx(Button_default, {
13385
+ level: "icon",
13386
+ onClick: () => o(1),
13387
+ disabled: e.page === 1,
13388
+ children: "<<"
13389
+ }),
13390
+ /* @__PURE__ */ jsx(Button_default, {
13391
+ level: "icon",
13392
+ onClick: () => o(e.page - 1),
13393
+ disabled: e.page === 1,
13394
+ children: "<"
13395
+ }),
13396
+ Array.from({ length: Math.min(3, s) }, (t, n) => {
13397
+ let i;
13398
+ return i = s <= 3 || e.page <= 2 ? n + 1 : e.page > s - 2 ? s - 2 + n : e.page - 1 + n, /* @__PURE__ */ jsx(Button_default, {
13399
+ level: e.page === i ? "primary" : "secondary",
13400
+ onClick: () => o(i),
13401
+ children: i
13402
+ }, i);
13403
+ }),
13404
+ /* @__PURE__ */ jsx(Button_default, {
13405
+ level: "icon",
13406
+ onClick: () => o(e.page + 1),
13407
+ disabled: e.page === s,
13408
+ children: ">"
13409
+ }),
13410
+ /* @__PURE__ */ jsx(Button_default, {
13411
+ level: "icon",
13412
+ onClick: () => o(s),
13413
+ disabled: e.page === s,
13414
+ children: ">>"
13415
+ })
13416
+ ]
13417
+ })]
13418
+ })]
13419
+ }), DownloadIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
13420
+ width: t,
13421
+ height: t,
13422
+ viewBox: "0 0 20 20",
13423
+ fill: e,
13424
+ children: /* @__PURE__ */ jsx("path", {
13425
+ fillRule: "evenodd",
13426
+ d: "M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",
13427
+ clipRule: "evenodd",
13428
+ fill: "currentColor"
13429
+ })
13430
+ }), EyeIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsxs("svg", {
13431
+ viewBox: "0 0 20 20",
13432
+ fill: e,
13433
+ width: t,
13434
+ height: t,
13435
+ children: [/* @__PURE__ */ jsx("path", {
13436
+ d: "M10 12a2 2 0 100-4 2 2 0 000 4z",
13437
+ fill: "currentColor"
13438
+ }), /* @__PURE__ */ jsx("path", {
13439
+ fillRule: "evenodd",
13440
+ d: "M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z",
13441
+ clipRule: "evenodd",
13442
+ fill: "currentColor"
13443
+ })]
13444
+ }), RefreshIcon = ({ size: e = 20, color: t = "currentColor", className: n = "" }) => /* @__PURE__ */ jsxs("svg", {
13445
+ width: e,
13446
+ height: e,
13447
+ viewBox: "0 0 24 24",
13448
+ fill: "none",
13449
+ xmlns: "http://www.w3.org/2000/svg",
13450
+ className: n,
13451
+ children: [/* @__PURE__ */ jsx("path", {
13452
+ d: "M4.06189 13C4.0276 12.6724 4.01001 12.3387 4.01001 12C4.01001 7.58172 7.59173 4 12.01 4C16.4283 4 20.01 7.58172 20.01 12C20.01 16.4183 16.4283 20 12.01 20C9.52552 20 7.30615 18.8662 5.8604 17.0732",
13453
+ stroke: t,
13454
+ strokeWidth: "1.5",
13455
+ strokeLinecap: "round",
13456
+ strokeLinejoin: "round"
13457
+ }), /* @__PURE__ */ jsx("path", {
13458
+ d: "M3.5 8L4.04145 11.1448C4.12057 11.6044 4.16014 11.8342 4.32777 11.9753C4.47524 12.0994 4.6649 12.1594 4.85734 12.1429C5.07604 12.1241 5.25902 11.9482 5.62496 11.5966L8 9.31429",
13459
+ stroke: t,
13460
+ strokeWidth: "1.5",
13461
+ strokeLinecap: "round",
13462
+ strokeLinejoin: "round"
13463
+ })]
13464
+ }), FilterTag = ({ columnLabel: e, value: t, onRemove: n }) => /* @__PURE__ */ jsxs("div", {
13465
+ className: "inline-flex items-center gap-1 bg-blue-100 text-blue-800 font-medium px-4 py-1 rounded-full border border-blue-300 hover:bg-blue-200 transition-colors",
13466
+ children: [
13467
+ /* @__PURE__ */ jsxs("span", {
13468
+ className: "font-semibold",
13469
+ children: [e, ":"]
13470
+ }),
13471
+ /* @__PURE__ */ jsx("span", {
13472
+ className: "max-w-50 truncate",
13473
+ children: t
13474
+ }),
13475
+ /* @__PURE__ */ jsx("button", {
13476
+ onClick: n,
13477
+ className: "ml-1 hover:bg-blue-300 rounded-full transition-colors cursor-pointer",
13478
+ "aria-label": `Remove filter ${e}: ${t}`,
13479
+ children: /* @__PURE__ */ jsx(CloseIcon, { size: 22 })
13480
+ })
13481
+ ]
13482
+ }), DragIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
13483
+ fill: e,
13484
+ stroke: "currentColor",
13485
+ viewBox: "0 0 24 24",
13486
+ width: t,
13487
+ height: t,
13488
+ children: /* @__PURE__ */ jsx("path", {
13489
+ strokeLinecap: "round",
13490
+ strokeLinejoin: "round",
13491
+ strokeWidth: 2,
13492
+ d: "M8 9h8M8 15h8"
13493
+ })
13494
+ }), DragToggleIcon = ({ active: e = !1, size: t = 14, className: n = "", label: i = "Draggable" }) => e ? /* @__PURE__ */ jsx(DragIcon, {
13495
+ size: t,
13496
+ className: n
13497
+ }) : /* @__PURE__ */ jsxs("svg", {
13498
+ width: t,
13499
+ height: t,
13500
+ viewBox: "0 0 24 24",
13501
+ fill: "none",
13502
+ xmlns: "http://www.w3.org/2000/svg",
13503
+ className: n,
13504
+ "aria-label": i,
13505
+ children: [
13506
+ /* @__PURE__ */ jsx("title", { children: i }),
13507
+ /* @__PURE__ */ jsx("rect", {
13508
+ x: "4",
13509
+ y: "4",
13510
+ width: "16",
13511
+ height: "16",
13512
+ rx: "2",
13513
+ stroke: "#9ca3af",
13514
+ strokeWidth: "2",
13515
+ fill: "none"
13516
+ }),
13517
+ /* @__PURE__ */ jsx("line", {
13518
+ x1: "4",
13519
+ y1: "4",
13520
+ x2: "20",
13521
+ y2: "20",
13522
+ stroke: "#9ca3af",
13523
+ strokeWidth: "2"
13524
+ })
13525
+ ]
13526
+ }), FilterOffIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsxs("svg", {
13527
+ fill: e,
13528
+ stroke: "currentColor",
13529
+ viewBox: "0 0 24 24",
13530
+ width: t,
13531
+ height: t,
13532
+ children: [/* @__PURE__ */ jsx("path", {
13533
+ fillRule: "evenodd",
13534
+ d: "M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z",
13535
+ clipRule: "evenodd",
13536
+ fill: "none",
13537
+ strokeWidth: "2"
13538
+ }), /* @__PURE__ */ jsx("line", {
13539
+ x1: "3",
13540
+ y1: "3",
13541
+ x2: "21",
13542
+ y2: "21",
13543
+ stroke: e,
13544
+ strokeWidth: "2",
13545
+ strokeLinecap: "round"
13546
+ })]
13547
+ }), PinIcon = ({ size: e = 20, color: t = "currentColor", className: n = "" }) => /* @__PURE__ */ jsxs("svg", {
13548
+ width: e,
13549
+ height: e,
13550
+ viewBox: "0 0 24 24",
13551
+ fill: "none",
13552
+ stroke: t,
13553
+ strokeWidth: "2",
13554
+ strokeLinecap: "round",
13555
+ strokeLinejoin: "round",
13556
+ className: n,
13557
+ children: [/* @__PURE__ */ jsx("line", {
13558
+ x1: "12",
13559
+ y1: "17",
13560
+ x2: "12",
13561
+ y2: "22"
13562
+ }), /* @__PURE__ */ jsx("path", { d: "M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z" })]
13563
+ }), PinOffIcon = ({ size: e = 20, color: t = "currentColor", className: n = "" }) => /* @__PURE__ */ jsxs("svg", {
13564
+ width: e,
13565
+ height: e,
13566
+ viewBox: "0 0 24 24",
13567
+ fill: "none",
13568
+ stroke: t,
13569
+ strokeWidth: "2",
13570
+ strokeLinecap: "round",
13571
+ strokeLinejoin: "round",
13572
+ className: n,
13573
+ children: [
13574
+ /* @__PURE__ */ jsx("line", {
13575
+ x1: "2",
13576
+ y1: "2",
13577
+ x2: "22",
13578
+ y2: "22"
13579
+ }),
13580
+ /* @__PURE__ */ jsx("path", { d: "M12 17v5" }),
13581
+ /* @__PURE__ */ jsx("path", { d: "M9 9V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v.76" }),
13582
+ /* @__PURE__ */ jsx("path", { d: "M15 6v4.76a2 2 0 0 1 1.11 1.79l1.78.9A2 2 0 0 1 19 15.24v1.76H10" }),
13583
+ /* @__PURE__ */ jsx("path", { d: "M5 17h.35" })
13584
+ ]
13585
+ });
13586
+ var TableConfig_default = forwardRef(({ tableColumns: e, hiddenColumns: t, pinnedColumns: n, labels: i, handleToggleColumn: a, handleTogglePin: o, setTableColumns: s, enableColumnPinning: c }, l) => /* @__PURE__ */ jsx("div", {
13587
+ className: "absolute top-full left-0 bg-white border border-solid border-gray-300 rounded-md shadow-lg z-1000 mt-2 min-w-2xs max-w-xs opacity-100 visible p-4",
13588
+ ref: l,
13589
+ children: /* @__PURE__ */ jsxs("div", {
13590
+ className: "mb-4 last:mb-0",
13591
+ children: [/* @__PURE__ */ jsx("div", {
13592
+ className: "text-sm font-semibold text-redi-text mb-2 uppercase",
13593
+ children: i.columnVisibility
13594
+ }), /* @__PURE__ */ jsx("div", {
13595
+ className: "flex flex-col gap-2",
13596
+ children: e.filter((e) => !e.isAction).map((i) => {
13597
+ let l = !t.includes(i.id);
13598
+ return /* @__PURE__ */ jsxs("div", {
13599
+ className: "flex items-center justify-between gap-2 hover:bg-gray-50 p-1 rounded",
13600
+ children: [/* @__PURE__ */ jsxs("div", {
13601
+ className: "flex items-center gap-2",
13602
+ children: [/* @__PURE__ */ jsx("input", {
13603
+ type: "checkbox",
13604
+ className: "w-4 h-4 accent-redi-primary cursor-pointer",
13605
+ checked: l,
13606
+ onChange: () => a(i.id),
13607
+ id: `col-visibility-${i.id}`
13608
+ }), /* @__PURE__ */ jsx("label", {
13609
+ htmlFor: `col-visibility-${i.id}`,
13610
+ className: "text-sm text-redi-text cursor-pointer select-none",
13611
+ children: i.label
13612
+ })]
13613
+ }), l && /* @__PURE__ */ jsxs("div", {
13614
+ className: "flex items-center gap-1",
13615
+ children: [
13616
+ c && /* @__PURE__ */ jsx(Button_default, {
13617
+ level: "icon",
13618
+ onClick: (e) => {
13619
+ e.stopPropagation(), o(i.id);
13620
+ },
13621
+ "aria-label": n.includes(i.id) ? "Unpin column" : "Pin column",
13622
+ className: "p-1 hover:bg-gray-200 rounded-full",
13623
+ children: n.includes(i.id) ? /* @__PURE__ */ jsx(PinIcon, {
13624
+ size: 14,
13625
+ className: "text-redi-primary"
13626
+ }) : /* @__PURE__ */ jsx(PinOffIcon, {
13627
+ size: 14,
13628
+ className: "text-gray-400"
13629
+ })
13630
+ }),
13631
+ /* @__PURE__ */ jsx(Button_default, {
13632
+ level: "icon",
13633
+ onClick: (t) => {
13634
+ t.stopPropagation();
13635
+ let n = e.map((e) => e.id === i.id ? {
13636
+ ...e,
13637
+ draggable: !e.draggable
13638
+ } : e);
13639
+ s(n);
13640
+ },
13641
+ "aria-label": i.draggable ? "Disable drag" : "Enable drag",
13642
+ className: "p-1 hover:bg-gray-200 rounded-full",
13643
+ children: /* @__PURE__ */ jsx(DragToggleIcon, {
13644
+ active: !!i.draggable,
13645
+ size: 14,
13646
+ label: "Draggable"
13647
+ })
13648
+ }),
13649
+ /* @__PURE__ */ jsx(Button_default, {
13650
+ level: "icon",
13651
+ onClick: (t) => {
13652
+ t.stopPropagation();
13653
+ let n = e.map((e) => e.id === i.id ? {
13654
+ ...e,
13655
+ filterable: !e.filterable
13656
+ } : e);
13657
+ s(n);
13658
+ },
13659
+ "aria-label": i.filterable ? "Disable filter" : "Enable filter",
13660
+ className: "p-1 hover:bg-gray-200 rounded-full",
13661
+ children: i.filterable ? /* @__PURE__ */ jsx(FilterIcon, {
13662
+ size: 14,
13663
+ color: "#fa8c16"
13664
+ }) : /* @__PURE__ */ jsx(FilterOffIcon, {
13665
+ size: 14,
13666
+ color: "#9ca3af"
13667
+ })
13668
+ })
13669
+ ]
13670
+ })]
13671
+ }, i.id);
13672
+ })
13673
+ })]
13674
+ })
13675
+ })), TableToolbar_default = ({ fetchData: e, onRefresh: t, handleRefreshClick: n, isLoading: i, enableColumnConfig: a, labels: o, tableColumns: c, hiddenColumns: d, pinnedColumns: m, handleToggleColumn: g, handleTogglePin: _, setTableColumns: v, enableColumnPinning: y, enableFiltering: b, hasActiveFilters: x, clearAllFilters: S, activeFilterTags: C, handleRemoveFilterTag: w, enableExport: T, handleExport: E }) => {
13676
+ let [D, O] = useState(!1), k = useRef(null);
13677
+ return useEffect(() => {
13678
+ let e = (e) => {
13679
+ k.current && !k.current.contains(e.target) && O(!1);
13680
+ };
13681
+ return D && document.addEventListener("mousedown", e), () => {
13682
+ document.removeEventListener("mousedown", e);
13683
+ };
13684
+ }, [D]), /* @__PURE__ */ jsxs("div", {
13685
+ className: "flex items-center justify-between p-2 bg-transparent border-b border-solid border-gray-400",
13686
+ children: [/* @__PURE__ */ jsxs("div", {
13687
+ className: "flex items-center gap-2",
13688
+ children: [
13689
+ (e || t) && /* @__PURE__ */ jsx(Button_default, {
13690
+ level: "secondary",
13691
+ onClick: n,
13692
+ loading: i,
13693
+ children: /* @__PURE__ */ jsx(RefreshIcon, { size: 18 })
13694
+ }),
13695
+ a && /* @__PURE__ */ jsxs("div", {
13696
+ className: "relative",
13697
+ children: [/* @__PURE__ */ jsxs(Button_default, {
13698
+ level: "secondary",
13699
+ onClick: () => O(!D),
13700
+ className: "p-1 px-2",
13701
+ children: [/* @__PURE__ */ jsx(EyeIcon, {}), /* @__PURE__ */ jsx("span", {
13702
+ className: "hidden md:block",
13703
+ children: o.configuration
13704
+ })]
13705
+ }), D && /* @__PURE__ */ jsx(TableConfig_default, {
13706
+ ref: k,
13707
+ tableColumns: c,
13708
+ hiddenColumns: d,
13709
+ pinnedColumns: m,
13710
+ labels: o,
13711
+ handleToggleColumn: g,
13712
+ handleTogglePin: _,
13713
+ setTableColumns: v,
13714
+ enableColumnPinning: y
13715
+ })]
13716
+ }),
13717
+ b && x && /* @__PURE__ */ jsx(Button_default, {
13718
+ level: "icon",
13719
+ onClick: S,
13720
+ label: o.clearAllFilters,
13721
+ children: /* @__PURE__ */ jsx(CloseIcon, { color: "white" })
13722
+ }),
13723
+ C.length > 0 && /* @__PURE__ */ jsx("div", {
13724
+ className: "flex items-center gap-2 flex-wrap ml-2",
13725
+ children: C.map((e, t) => /* @__PURE__ */ jsx(FilterTag, {
13726
+ columnLabel: e.columnLabel,
13727
+ value: e.displayValue,
13728
+ onRemove: () => w(e.columnId, e.value)
13729
+ }, `${e.columnId}-${e.value}-${t}`))
13730
+ })
13731
+ ]
13732
+ }), /* @__PURE__ */ jsx("div", {
13733
+ className: "flex items-center gap-2",
13734
+ children: T && /* @__PURE__ */ jsx(Button_default, {
13735
+ level: "secondary",
13736
+ onClick: E,
13737
+ children: /* @__PURE__ */ jsx(DownloadIcon, { size: 18 })
13738
+ })
13739
+ })]
13740
+ });
13741
+ };
13742
+ const useAdvancedTable = (e) => {
13743
+ let { data: t, columns: n, defaultSort: i, defaultFilters: o = {}, defaultPageSize: d = 10, pageSizeOptions: f = [
13744
+ 10,
13745
+ 25,
13746
+ 50,
13747
+ 100,
13748
+ 200,
13749
+ 300,
13750
+ 400,
13751
+ 500
13752
+ ], initialConfig: p, onConfigChange: m, onPaginationChange: h, onFiltersChange: g, fetchData: _, rowKey: v = "id", onRowSelectionChange: y, syncFiltersWithUrl: b = !1, enablePagination: x = !0 } = e, [S, C] = useState(p?.sort || i || void 0), [w, T] = useState(() => {
13753
+ let e = p?.filters || o;
13754
+ if (b && typeof window < "u") {
13755
+ let t = new URLSearchParams(window.location.search), i = { ...e };
13756
+ return t.forEach((e, a) => {
13757
+ if (!n.find((e) => e.id === a)) return;
13758
+ let o = i[a];
13759
+ if (o) Array.isArray(o.value) ? i[a] = {
13760
+ ...o,
13761
+ value: [...o.value, e],
13762
+ type: "multiselect"
13763
+ } : i[a] = {
13764
+ ...o,
13765
+ value: [o.value, e],
13766
+ type: "multiselect"
13767
+ };
13768
+ else {
13769
+ let n = t.getAll(a);
13770
+ n.length > 1 ? i[a] = {
13155
13771
  type: "multiselect",
13156
13772
  value: n
13157
13773
  } : i[a] = {
@@ -13165,7 +13781,7 @@ const useAdvancedTable = (e) => {
13165
13781
  }), [E, D] = useState(p?.columnOrder || n.map((e) => e.id)), [O, k] = useState(p?.hiddenColumns || []), [A, j] = useState(p?.pinnedColumns || []), [M, N] = useState([]), [P, F] = useState({}), [I, L] = useState({
13166
13782
  page: 1,
13167
13783
  pageSize: p?.pagination?.pageSize || d
13168
- }), [_h, vh] = useState([]), [yh, bh] = useState(0), [xh, Sh] = useState(0), [Ch, wh] = useState(!1), [Th, Eh] = useState(0);
13784
+ }), [R, Fh] = useState([]), [z, B] = useState(0), [V, Ih] = useState(0), [H, Lh] = useState(!1), [U, W] = useState(0);
13169
13785
  useEffect(() => {
13170
13786
  let e = n.map((e) => e.id);
13171
13787
  D((t) => {
@@ -13173,9 +13789,9 @@ const useAdvancedTable = (e) => {
13173
13789
  return [...n, ...i];
13174
13790
  }), k((t) => t.filter((t) => e.includes(t))), j((t) => t.filter((t) => e.includes(t)));
13175
13791
  }, [n]);
13176
- let R = useMemo(() => {
13792
+ let G = useMemo(() => {
13177
13793
  let e = [];
13178
- return e = _ ? [..._h] : [...t], Object.entries(w).forEach(([t, i]) => {
13794
+ return e = _ ? [...R] : [...t], Object.entries(w).forEach(([t, i]) => {
13179
13795
  let a = n.find((e) => e.id === t);
13180
13796
  a && (_ && a.shouldBeRefetch || (e = e.filter((e) => {
13181
13797
  let t = typeof a.accessor == "function" ? a.accessor(e) : e[a.accessor], n = String(t || "").toLowerCase(), o = !0;
@@ -13187,19 +13803,19 @@ const useAdvancedTable = (e) => {
13187
13803
  w,
13188
13804
  n,
13189
13805
  _,
13190
- _h
13191
- ]), Dh = _ ? yh : R.length, z = _ ? xh : t.length, B = useMemo(() => ({
13806
+ R
13807
+ ]), K = _ ? z : G.length, Rh = _ ? V : t.length, q = useMemo(() => ({
13192
13808
  page: I.page,
13193
13809
  pageSize: I.pageSize,
13194
- total: Dh
13810
+ total: K
13195
13811
  }), [
13196
13812
  I.page,
13197
13813
  I.pageSize,
13198
- Dh
13199
- ]), Oh = useMemo(() => {
13200
- if (_ || !S) return R;
13814
+ K
13815
+ ]), J = useMemo(() => {
13816
+ if (_ || !S) return G;
13201
13817
  let e = n.find((e) => e.id === S.column);
13202
- return e ? [...R].sort((t, n) => {
13818
+ return e ? [...G].sort((t, n) => {
13203
13819
  let i = typeof e.accessor == "function" ? e.accessor(t) : t[e.accessor], a = typeof e.accessor == "function" ? e.accessor(n) : n[e.accessor];
13204
13820
  if (i == null) return 1;
13205
13821
  if (a == null) return -1;
@@ -13212,93 +13828,93 @@ const useAdvancedTable = (e) => {
13212
13828
  o = e.localeCompare(t);
13213
13829
  }
13214
13830
  return S.direction === "desc" ? o * -1 : o;
13215
- }) : R;
13831
+ }) : G;
13216
13832
  }, [
13217
- R,
13833
+ G,
13218
13834
  S,
13219
13835
  n,
13220
13836
  _
13221
- ]), kh = useMemo(() => {
13222
- if (_ || !x) return Oh;
13223
- let e = (B.page - 1) * B.pageSize, t = e + B.pageSize;
13224
- return Oh.slice(e, t);
13837
+ ]), zh = useMemo(() => {
13838
+ if (_ || !x) return J;
13839
+ let e = (q.page - 1) * q.pageSize, t = e + q.pageSize;
13840
+ return J.slice(e, t);
13225
13841
  }, [
13226
- Oh,
13227
- B.page,
13228
- B.pageSize,
13842
+ J,
13843
+ q.page,
13844
+ q.pageSize,
13229
13845
  _,
13230
13846
  x
13231
- ]), Ah = useCallback(async () => {
13847
+ ]), Bh = useCallback(async () => {
13232
13848
  if (_) {
13233
- wh(!0);
13849
+ Lh(!0);
13234
13850
  try {
13235
13851
  let e = {
13236
- page_number: B.page,
13237
- page_size: B.pageSize
13852
+ page_number: q.page,
13853
+ page_size: q.pageSize
13238
13854
  };
13239
13855
  S && (e.order_by = `${S.direction === "desc" ? "-" : ""}${S.column}`), Object.entries(w).forEach(([t, i]) => {
13240
13856
  i.value && n.find((e) => e.id === t)?.shouldBeRefetch && (e[t] = i.value);
13241
13857
  });
13242
13858
  let t = await _(e);
13243
- vh(t.items), bh(t.total_items), t.total_unfiltered_items === void 0 ? Object.entries(w).some(([e, t]) => n.find((t) => t.id === e)?.shouldBeRefetch && t.value && (Array.isArray(t.value) ? t.value.length > 0 : !0)) || Sh(t.total_items) : Sh(t.total_unfiltered_items);
13859
+ Fh(t.items), B(t.total_items), t.total_unfiltered_items === void 0 ? Object.entries(w).some(([e, t]) => n.find((t) => t.id === e)?.shouldBeRefetch && t.value && (Array.isArray(t.value) ? t.value.length > 0 : !0)) || Ih(t.total_items) : Ih(t.total_unfiltered_items);
13244
13860
  } catch (e) {
13245
13861
  console.error("Failed to fetch data:", e);
13246
13862
  } finally {
13247
- wh(!1);
13863
+ Lh(!1);
13248
13864
  }
13249
13865
  }
13250
13866
  }, [
13251
13867
  _,
13252
- B.page,
13253
- B.pageSize,
13868
+ q.page,
13869
+ q.pageSize,
13254
13870
  S,
13255
13871
  w,
13256
13872
  n
13257
- ]), V = useRef(!0), H = useRef(w), U = useRef(S), W = useRef(B.page), jh = useRef(B.pageSize), Mh = useRef(Th);
13873
+ ]), Y = useRef(!0), X = useRef(w), Vh = useRef(S), Hh = useRef(q.page), Uh = useRef(q.pageSize), Wh = useRef(U);
13258
13874
  useEffect(() => {
13259
13875
  if (_) {
13260
- let e = !1, t = JSON.stringify(w) !== JSON.stringify(H.current);
13261
- if (V.current) e = !0, V.current = !1;
13262
- else if (Th !== Mh.current) e = !0, Mh.current = Th;
13263
- else if (B.page !== W.current || B.pageSize !== jh.current) e = !0;
13264
- else if (JSON.stringify(S) !== JSON.stringify(U.current)) e = !0;
13876
+ let e = !1, t = JSON.stringify(w) !== JSON.stringify(X.current);
13877
+ if (Y.current) e = !0, Y.current = !1;
13878
+ else if (U !== Wh.current) e = !0, Wh.current = U;
13879
+ else if (q.page !== Hh.current || q.pageSize !== Uh.current) e = !0;
13880
+ else if (JSON.stringify(S) !== JSON.stringify(Vh.current)) e = !0;
13265
13881
  else if (t) {
13266
- let t = Object.keys(H.current), i = Object.keys(w), a = Array.from(new Set([...t, ...i]));
13267
- for (let t of a) if (JSON.stringify(H.current[t]) !== JSON.stringify(w[t]) && n.find((e) => e.id === t)?.shouldBeRefetch === !0) {
13882
+ let t = Object.keys(X.current), i = Object.keys(w), a = Array.from(new Set([...t, ...i]));
13883
+ for (let t of a) if (JSON.stringify(X.current[t]) !== JSON.stringify(w[t]) && n.find((e) => e.id === t)?.shouldBeRefetch === !0) {
13268
13884
  e = !0;
13269
13885
  break;
13270
13886
  }
13271
13887
  }
13272
- W.current = B.page, jh.current = B.pageSize, U.current = S, H.current = w, e && Ah();
13888
+ Hh.current = q.page, Uh.current = q.pageSize, Vh.current = S, X.current = w, e && Bh();
13273
13889
  }
13274
13890
  }, [
13275
- Ah,
13276
- Th,
13891
+ Bh,
13892
+ U,
13277
13893
  _,
13278
- B.page,
13279
- B.pageSize,
13894
+ q.page,
13895
+ q.pageSize,
13280
13896
  S,
13281
13897
  w,
13282
13898
  n
13283
13899
  ]), useEffect(() => {
13284
13900
  if (!_) {
13285
- let e = Math.ceil(Dh / B.pageSize) || 1;
13286
- B.page > e && L((t) => ({
13901
+ let e = Math.ceil(K / q.pageSize) || 1;
13902
+ q.page > e && L((t) => ({
13287
13903
  ...t,
13288
13904
  page: e
13289
13905
  }));
13290
13906
  }
13291
13907
  }, [
13292
- Dh,
13293
- B.pageSize,
13908
+ K,
13909
+ q.pageSize,
13294
13910
  _,
13295
- B.page
13911
+ q.page
13296
13912
  ]), useEffect(() => {
13297
13913
  m?.({
13298
13914
  columns: n,
13299
13915
  sort: S,
13300
13916
  filters: w,
13301
- pagination: B,
13917
+ pagination: q,
13302
13918
  columnOrder: E,
13303
13919
  hiddenColumns: O,
13304
13920
  pinnedColumns: A
@@ -13309,13 +13925,13 @@ const useAdvancedTable = (e) => {
13309
13925
  E,
13310
13926
  O,
13311
13927
  A,
13312
- B.pageSize,
13928
+ q.pageSize,
13313
13929
  m,
13314
- B,
13930
+ q,
13315
13931
  n
13316
13932
  ]), useEffect(() => {
13317
- h?.(B);
13318
- }, [B, h]), useEffect(() => {
13933
+ h?.(q);
13934
+ }, [q, h]), useEffect(() => {
13319
13935
  g?.(w);
13320
13936
  }, [w, g]), useEffect(() => {
13321
13937
  if (b && typeof window < "u") {
@@ -13334,7 +13950,7 @@ const useAdvancedTable = (e) => {
13334
13950
  n,
13335
13951
  _
13336
13952
  ]);
13337
- let Nh = useCallback((e) => {
13953
+ let Gh = useCallback((e) => {
13338
13954
  C((t) => t?.column === e ? t.direction === "asc" ? {
13339
13955
  column: e,
13340
13956
  direction: "desc"
@@ -13342,7 +13958,7 @@ const useAdvancedTable = (e) => {
13342
13958
  column: e,
13343
13959
  direction: "asc"
13344
13960
  });
13345
- }, []), Ph = useCallback((e, t, n = "text") => {
13961
+ }, []), Kh = useCallback((e, t, n = "text") => {
13346
13962
  T((i) => ({
13347
13963
  ...i,
13348
13964
  [e]: {
@@ -13354,36 +13970,36 @@ const useAdvancedTable = (e) => {
13354
13970
  ...e,
13355
13971
  page: 1
13356
13972
  }));
13357
- }, []), Fh = useCallback((e) => {
13973
+ }, []), qh = useCallback((e) => {
13358
13974
  T((t) => {
13359
13975
  let n = { ...t };
13360
13976
  return delete n[e], n;
13361
13977
  });
13362
- }, []), Ih = useCallback(() => {
13978
+ }, []), Jh = useCallback(() => {
13363
13979
  T({});
13364
- }, []), Lh = useCallback((e) => {
13980
+ }, []), Yh = useCallback((e) => {
13365
13981
  L((t) => ({
13366
13982
  ...t,
13367
13983
  page: e
13368
13984
  }));
13369
- }, []), Rh = useCallback((e) => {
13985
+ }, []), Xh = useCallback((e) => {
13370
13986
  L((t) => ({
13371
13987
  ...t,
13372
13988
  pageSize: e,
13373
13989
  page: 1
13374
13990
  }));
13375
- }, []), G = useCallback((e) => {
13991
+ }, []), Zh = useCallback((e) => {
13376
13992
  D(e);
13377
- }, []), zh = useCallback((e) => {
13993
+ }, []), Qh = useCallback((e) => {
13378
13994
  k((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
13379
- }, []), Bh = useCallback((e) => {
13995
+ }, []), $h = useCallback((e) => {
13380
13996
  j((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
13381
- }, []), K = useCallback((e) => {
13997
+ }, []), Z = useCallback((e) => {
13382
13998
  N((t) => {
13383
13999
  let n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
13384
14000
  return y?.(n), n;
13385
14001
  });
13386
- }, [y]), Vh = useCallback((e) => {
14002
+ }, [y]), eg = useCallback((e) => {
13387
14003
  N((t) => {
13388
14004
  let n = e.map((e) => typeof v == "function" ? v(e) : e[v]), i = n.every((e) => t.includes(e)), a;
13389
14005
  if (i) a = t.filter((e) => !n.includes(e));
@@ -13393,56 +14009,56 @@ const useAdvancedTable = (e) => {
13393
14009
  }
13394
14010
  return y?.(a), a;
13395
14011
  });
13396
- }, [v, y]), Hh = useCallback((e, t) => {
14012
+ }, [v, y]), tg = useCallback((e, t) => {
13397
14013
  F((n) => ({
13398
14014
  ...n,
13399
14015
  [e]: Math.max(50, t)
13400
14016
  }));
13401
- }, []), Uh = useMemo(() => {
14017
+ }, []), ng = useMemo(() => {
13402
14018
  let e = new Map(n.map((e) => [e.id, e])), t = E.map((t) => e.get(t)).filter(Boolean), i = new Set(t.map((e) => e.id)), a = n.filter((e) => !i.has(e.id));
13403
14019
  return [...t, ...a].filter((e) => !O.includes(e.id));
13404
14020
  }, [
13405
14021
  E,
13406
14022
  n,
13407
14023
  O
13408
- ]), q = useCallback(() => {
13409
- Eh((e) => e + 1);
14024
+ ]), Q = useCallback(() => {
14025
+ W((e) => e + 1);
13410
14026
  }, []);
13411
14027
  return {
13412
14028
  state: {
13413
14029
  data: t,
13414
- filteredData: R,
13415
- paginatedData: kh,
14030
+ filteredData: G,
14031
+ paginatedData: zh,
13416
14032
  sortConfig: S,
13417
14033
  filters: w,
13418
- pagination: B,
14034
+ pagination: q,
13419
14035
  columnOrder: E,
13420
14036
  hiddenColumns: O,
13421
14037
  pinnedColumns: A,
13422
14038
  selectedRows: M,
13423
14039
  columnWidths: P,
13424
- loading: Ch,
13425
- totalUnfiltered: z
14040
+ loading: H,
14041
+ totalUnfiltered: Rh
13426
14042
  },
13427
- orderedColumns: Uh,
14043
+ orderedColumns: ng,
13428
14044
  pageSizeOptions: f,
13429
- handleSort: Nh,
13430
- handleFilter: Ph,
13431
- clearFilter: Fh,
13432
- clearAllFilters: Ih,
13433
- handlePageChange: Lh,
13434
- handlePageSizeChange: Rh,
13435
- handleColumnReorder: G,
13436
- handleToggleColumn: zh,
13437
- handleTogglePin: Bh,
13438
- handleRowSelect: K,
13439
- handleSelectAll: Vh,
13440
- handleColumnResize: Hh,
14045
+ handleSort: Gh,
14046
+ handleFilter: Kh,
14047
+ clearFilter: qh,
14048
+ clearAllFilters: Jh,
14049
+ handlePageChange: Yh,
14050
+ handlePageSizeChange: Xh,
14051
+ handleColumnReorder: Zh,
14052
+ handleToggleColumn: Qh,
14053
+ handleTogglePin: $h,
14054
+ handleRowSelect: Z,
14055
+ handleSelectAll: eg,
14056
+ handleColumnResize: tg,
13441
14057
  allColumns: n,
13442
- refresh: q
14058
+ refresh: Q
13443
14059
  };
13444
14060
  };
13445
- var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilters: a = {}, defaultPageSize: u = 10, pageSizeOptions: h = [
14061
+ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilters: i = {}, defaultPageSize: o = 10, pageSizeOptions: d = [
13446
14062
  10,
13447
14063
  25,
13448
14064
  50,
@@ -13451,7 +14067,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13451
14067
  300,
13452
14068
  400,
13453
14069
  500
13454
- ], enableSorting: C = !0, enableFiltering: w = !0, enablePagination: T = !0, enableExport: E = !0, initialConfig: D, onConfigChange: O, className: k = "", labels: A = {
14070
+ ], enableSorting: _ = !0, enableFiltering: v = !0, enablePagination: y = !0, enableExport: b = !0, initialConfig: x, onConfigChange: S, className: C = "", labels: w = {
13455
14071
  configuration: "Configuración",
13456
14072
  columnVisibility: "Columnas visibles",
13457
14073
  pagination: {
@@ -13464,54 +14080,105 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13464
14080
  },
13465
14081
  clearAllFilters: "Limpiar todos los filtros",
13466
14082
  noData: "No hay datos disponibles"
13467
- }, enableColumnReordering: j = !0, enableColumnPinning: M = !1, enableColumnResizing: N = !1, enableRowSelection: P = !1, stickyActionsColumn: F = !1, rowKey: I = "id", onRowSelectionChange: L, renderActions: _h, actionsColumnLabel: vh, loading: yh = !1, fetchData: bh, onRefresh: xh, onPaginationChange: Sh, onFiltersChange: Ch, syncFiltersWithUrl: wh = !1, enableColumnConfig: Th = !0 }) => {
13468
- let [Eh, R] = useState(null), [Dh, z] = useState(null), [B, Oh] = useState(!1), [kh, Ah] = useState(null), V = useRef(null), [H, U] = useState(t), [W, jh] = useState({}), [Mh, Nh] = useState({}), { state: Ph, orderedColumns: Fh, handleSort: Ih, handleFilter: Lh, clearAllFilters: Rh, handlePageChange: G, handlePageSizeChange: zh, handleColumnReorder: Bh, handleToggleColumn: K, handleTogglePin: Vh, handleRowSelect: Hh, handleSelectAll: Uh, handleColumnResize: q, refresh: Wh } = useAdvancedTable({
14083
+ }, enableColumnReordering: T = !0, enableColumnPinning: E = !1, enableColumnResizing: D = !1, enableRowSelection: O = !1, stickyActionsColumn: k = !1, rowKey: A = "id", onRowSelectionChange: j, renderActions: M, actionsColumnLabel: N, loading: P = !1, fetchData: F, onRefresh: I, onPaginationChange: L, onFiltersChange: R, syncFiltersWithUrl: Fh = !1, enableColumnConfig: z = !0, enableInlineEditing: B = !1, onRowSave: V, onRowEditCancel: Ih }) => {
14084
+ let [H, Lh] = useState(t), [U, W] = useState(null), [G, K] = useState({}), [Rh, q] = useState({}), [J, zh] = useState(!1), Bh = useCallback((e) => {
14085
+ let t = typeof A == "function" ? A(e) : e[A];
14086
+ W(t);
14087
+ let n = {};
14088
+ H.forEach((t) => {
14089
+ if (t.editable) {
14090
+ let i = typeof t.accessor == "function" ? t.accessor(e) : e[t.accessor];
14091
+ n[t.id] = i;
14092
+ }
14093
+ }), K(n), q({});
14094
+ }, [A, H]), Y = useCallback(() => {
14095
+ W(null), K({}), q({}), Ih?.();
14096
+ }, [Ih]), X = useCallback(async (e) => {
14097
+ let t = {}, n = !1, i = {};
14098
+ if (H.forEach((e) => {
14099
+ if (e.editable) {
14100
+ let a = G[e.id];
14101
+ if (e.inputType === "number" && typeof a == "string" && a !== "") {
14102
+ let e = Number(a);
14103
+ isNaN(e) || (a = e);
14104
+ }
14105
+ if (e.validation) {
14106
+ let i = e.validation(a);
14107
+ i && (t[e.id] = i, n = !0);
14108
+ }
14109
+ typeof e.accessor == "string" ? i[e.accessor] = a : i[e.id] = a;
14110
+ }
14111
+ }), n) {
14112
+ q(t);
14113
+ return;
14114
+ }
14115
+ zh(!0);
14116
+ try {
14117
+ await V?.(e, i), W(null), K({});
14118
+ } catch (e) {
14119
+ console.error("Failed to save row", e);
14120
+ } finally {
14121
+ zh(!1);
14122
+ }
14123
+ }, [
14124
+ V,
14125
+ H,
14126
+ G
14127
+ ]), Vh = (e, t) => {
14128
+ K((n) => ({
14129
+ ...n,
14130
+ [e]: t
14131
+ })), Rh[e] && q((t) => {
14132
+ let n = { ...t };
14133
+ return delete n[e], n;
14134
+ });
14135
+ }, { state: Hh, orderedColumns: Uh, handleSort: Wh, handleFilter: Gh, clearAllFilters: Kh, handlePageChange: qh, handlePageSizeChange: Jh, handleColumnReorder: Yh, handleToggleColumn: Xh, handleTogglePin: Zh, handleRowSelect: Qh, handleSelectAll: $h, handleColumnResize: Z, refresh: eg } = useAdvancedTable({
13469
14136
  data: e,
13470
14137
  columns: H,
13471
14138
  defaultSort: n,
13472
- defaultFilters: a,
13473
- defaultPageSize: u,
13474
- pageSizeOptions: h,
13475
- initialConfig: D,
13476
- onConfigChange: O,
13477
- fetchData: bh,
13478
- onPaginationChange: Sh,
13479
- onFiltersChange: Ch,
13480
- rowKey: I,
13481
- onRowSelectionChange: L,
13482
- syncFiltersWithUrl: wh,
13483
- enablePagination: T
13484
- }), { paginatedData: J, sortConfig: Gh, filters: Y, pagination: X, hiddenColumns: Kh, pinnedColumns: Z, selectedRows: qh, columnWidths: Jh, loading: Yh, totalUnfiltered: Xh } = Ph, Zh = yh || Yh;
13485
- useEffect(() => U(t), [t]);
13486
- let Qh = useRef(null), $h = useRef(null), [eg, tg] = useState(0);
14139
+ defaultFilters: i,
14140
+ defaultPageSize: o,
14141
+ pageSizeOptions: d,
14142
+ initialConfig: x,
14143
+ onConfigChange: S,
14144
+ fetchData: F,
14145
+ onPaginationChange: L,
14146
+ onFiltersChange: R,
14147
+ rowKey: A,
14148
+ onRowSelectionChange: j,
14149
+ syncFiltersWithUrl: Fh,
14150
+ enablePagination: y
14151
+ }), { paginatedData: tg, sortConfig: ng, filters: Q, pagination: rg, hiddenColumns: ig, pinnedColumns: ag, selectedRows: og, columnWidths: sg, loading: cg, totalUnfiltered: lg } = Hh, ug = P || cg;
14152
+ useEffect(() => Lh(t), [t]);
14153
+ let dg = useRef(null), fg = useRef(null), [pg, mg] = useState(0);
13487
14154
  useEffect(() => {
13488
14155
  let e = () => {
13489
- Qh.current && tg(Qh.current.scrollWidth);
14156
+ dg.current && mg(dg.current.scrollWidth);
13490
14157
  };
13491
14158
  e();
13492
14159
  let t = new ResizeObserver(e);
13493
- return Qh.current && t.observe(Qh.current), () => t.disconnect();
13494
- }, [J, H]);
13495
- let ng = (e) => {
13496
- Qh.current && (Qh.current.scrollLeft = e.currentTarget.scrollLeft);
13497
- }, rg = (e) => {
13498
- $h.current && ($h.current.scrollLeft = e.currentTarget.scrollLeft);
13499
- }, Q = useMemo(() => {
13500
- let e = [...Fh], t = e.filter((e) => e.isAction), n = [...e.filter((e) => !e.isAction), ...t];
13501
- return P && n.unshift({
14160
+ return dg.current && t.observe(dg.current), () => t.disconnect();
14161
+ }, [tg, H]);
14162
+ let hg = (e) => {
14163
+ dg.current && (dg.current.scrollLeft = e.currentTarget.scrollLeft);
14164
+ }, gg = (e) => {
14165
+ fg.current && (fg.current.scrollLeft = e.currentTarget.scrollLeft);
14166
+ }, _g = useMemo(() => {
14167
+ let e = [...Uh], t = e.filter((e) => e.isAction), n = [...e.filter((e) => !e.isAction), ...t];
14168
+ return O && n.unshift({
13502
14169
  id: "selection-synthetic",
13503
14170
  label: "",
13504
- accessor: (e) => e[I],
14171
+ accessor: (e) => e[A],
13505
14172
  width: 50,
13506
14173
  minWidth: 50,
13507
14174
  render: ({ row: e }) => {
13508
- let t = e[I];
14175
+ let t = e[A];
13509
14176
  return /* @__PURE__ */ jsx("input", {
13510
14177
  type: "checkbox",
13511
14178
  className: "w-4 h-4 accent-redi-primary cursor-pointer",
13512
- checked: qh.includes(t),
14179
+ checked: og.includes(t),
13513
14180
  onChange: (e) => {
13514
- e.stopPropagation(), Hh(t);
14181
+ e.stopPropagation(), Qh(t);
13515
14182
  },
13516
14183
  onClick: (e) => e.stopPropagation()
13517
14184
  });
@@ -13520,15 +14187,54 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13520
14187
  filterable: !1,
13521
14188
  sortable: !1,
13522
14189
  draggable: !1
13523
- }), _h && n.push({
14190
+ }), (M || B) && n.push({
13524
14191
  id: "actions-synthetic",
13525
- label: vh || "",
13526
- accessor: (e) => e[I],
13527
- render: ({ row: e, column: t, index: n }) => _h({
13528
- row: e,
13529
- index: n,
13530
- column: t
13531
- }),
14192
+ label: N || "",
14193
+ accessor: (e) => e[A],
14194
+ render: ({ row: e, column: t, index: n }) => {
14195
+ let i = typeof A == "function" ? A(e) : e[A];
14196
+ return B ? U === i ? /* @__PURE__ */ jsxs("div", {
14197
+ className: "flex items-center gap-2",
14198
+ children: [/* @__PURE__ */ jsx(Button_default, {
14199
+ level: "icon",
14200
+ onClick: (t) => {
14201
+ t.stopPropagation(), X(e);
14202
+ },
14203
+ disabled: J,
14204
+ className: "text-green-600 hover:bg-green-100 p-1 rounded-full",
14205
+ label: "Save",
14206
+ children: /* @__PURE__ */ jsx(CheckIcon, { size: 18 })
14207
+ }), /* @__PURE__ */ jsx(Button_default, {
14208
+ level: "icon",
14209
+ onClick: (e) => {
14210
+ e.stopPropagation(), Y();
14211
+ },
14212
+ disabled: J,
14213
+ className: "text-red-600 hover:bg-red-100 p-1 rounded-full",
14214
+ label: "Cancel",
14215
+ children: /* @__PURE__ */ jsx(CloseIcon, { size: 18 })
14216
+ })]
14217
+ }) : /* @__PURE__ */ jsxs("div", {
14218
+ className: "flex items-center gap-2",
14219
+ children: [/* @__PURE__ */ jsx(Button_default, {
14220
+ level: "icon",
14221
+ onClick: (t) => {
14222
+ t.stopPropagation(), Bh(e);
14223
+ },
14224
+ className: "text-blue-600 hover:bg-blue-100 p-1 rounded-full",
14225
+ label: "Edit",
14226
+ children: /* @__PURE__ */ jsx(EditIcon, { size: 18 })
14227
+ }), M && M({
14228
+ row: e,
14229
+ index: n,
14230
+ column: t
14231
+ })]
14232
+ }) : M ? M({
14233
+ row: e,
14234
+ index: n,
14235
+ column: t
14236
+ }) : null;
14237
+ },
13532
14238
  width: 100,
13533
14239
  isAction: !0,
13534
14240
  filterable: !1,
@@ -13536,125 +14242,26 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13536
14242
  draggable: !1
13537
14243
  }), n;
13538
14244
  }, [
13539
- Fh,
13540
- _h,
13541
- vh,
13542
- P,
13543
- qh,
13544
- I,
13545
- Hh
13546
- ]), ig = useRef(null);
13547
- useEffect(() => {
13548
- let e = (e) => {
13549
- if (!ig.current) return;
13550
- let { columnId: t, startX: n, startWidth: i } = ig.current, a = e.clientX - n;
13551
- q(t, i + a);
13552
- }, t = () => {
13553
- ig.current = null, document.body.style.cursor = "default", document.body.style.userSelect = "auto";
13554
- };
13555
- if (N) return document.addEventListener("mousemove", e), document.addEventListener("mouseup", t), () => {
13556
- document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", t);
13557
- };
13558
- }, [N, q]);
13559
- let ag = (e, t, n) => {
13560
- e.preventDefault(), e.stopPropagation(), ig.current = {
13561
- columnId: t,
13562
- startX: e.clientX,
13563
- startWidth: n
13564
- }, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
13565
- }, og = (e, t) => {
13566
- R(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", "");
13567
- }, sg = (e, t) => {
13568
- e.preventDefault(), e.dataTransfer.dropEffect = "move", z(t);
13569
- }, cg = () => {
13570
- z(null);
13571
- }, lg = (e, t) => {
13572
- if (e.preventDefault(), Eh === null) return;
13573
- let n = Q[Eh].id, i = Q[t].id;
13574
- if (n === i) {
13575
- R(null), z(null);
13576
- return;
13577
- }
13578
- let a = e.currentTarget.getBoundingClientRect(), o = e.clientX - a.left > a.width / 2, s = [...Ph.columnOrder], c = s.indexOf(n), l = s.indexOf(i);
13579
- c === -1 || l === -1 || (s.splice(c, 1), l = s.indexOf(i), o ? s.splice(l + 1, 0, n) : s.splice(l, 0, n), Bh(s), R(null), z(null));
13580
- }, ug = () => {
13581
- R(null), z(null);
13582
- }, dg = () => {
13583
- if (!E) return;
13584
- let e = Q.filter((e) => !e.isAction);
13585
- exportToExcel(Ph.filteredData, e, "table-data.xlsx");
13586
- }, fg = useCallback(async (e) => {
13587
- let t = H.find((t) => t.id === e);
13588
- if (t?.fetchColumn && !W[e]) {
13589
- Nh((t) => ({
13590
- ...t,
13591
- [e]: !0
13592
- }));
13593
- try {
13594
- let n = await t.fetchColumn();
13595
- jh((t) => ({
13596
- ...t,
13597
- [e]: n
13598
- }));
13599
- } catch (t) {
13600
- console.error(`Failed to load options for column ${e}:`, t);
13601
- } finally {
13602
- Nh((t) => ({
13603
- ...t,
13604
- [e]: !1
13605
- }));
13606
- }
13607
- }
13608
- }, [H, W]), pg = (e) => {
13609
- let t = kh !== e;
13610
- Ah(t ? e : null), t && fg(e);
13611
- }, mg = useCallback((t) => {
13612
- let n = H.find((e) => e.id === t);
13613
- if (!n) return [];
13614
- if (n.fetchColumn && W[t]) return W[t];
13615
- if (n.fetchColumn && !W[t]) return [];
13616
- let i = e.filter((e) => Object.entries(Y).every(([n, i]) => {
13617
- if (n === t || !i.value) return !0;
13618
- let a = H.find((e) => e.id === n);
13619
- if (!a) return !0;
13620
- let o = typeof a.accessor == "function" ? a.accessor(e) : e[a.accessor], s = String(o || "").toLowerCase(), c = !0;
13621
- return i.type === "text" && (c = s.includes(String(i.value).toLowerCase())), i.type === "select" && (c = s === String(i.value).toLowerCase()), i.type === "multiselect" && Array.isArray(i.value) && (c = i.value.some((e) => s === String(e).toLowerCase())), c;
13622
- })), a = /* @__PURE__ */ new Map();
13623
- i.forEach((e) => {
13624
- let t = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], i = formatCellValue(t);
13625
- a.set(i, (a.get(i) || 0) + 1);
13626
- });
13627
- let o = /* @__PURE__ */ new Map();
13628
- e.forEach((e) => {
13629
- let t = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], i = formatCellValue(t);
13630
- o.set(i, (o.get(i) || 0) + 1);
13631
- });
13632
- let s = [], c = [];
13633
- return o.forEach((e, t) => {
13634
- let n = a.get(t);
13635
- n !== void 0 && n > 0 ? s.push({
13636
- value: t,
13637
- count: n,
13638
- label: `${t} (${n})`,
13639
- group: "Disponibles"
13640
- }) : c.push({
13641
- value: t,
13642
- count: e,
13643
- label: `${t} (0)`,
13644
- group: "Otros"
13645
- });
13646
- }), s.sort((e, t) => e.value.localeCompare(t.value)), c.sort((e, t) => e.value.localeCompare(t.value)), c.length === 0 ? s.map((e) => ({
13647
- ...e,
13648
- group: void 0
13649
- })) : [...s, ...c];
13650
- }, [
13651
- e,
14245
+ Uh,
14246
+ O,
14247
+ M,
14248
+ B,
14249
+ A,
14250
+ og,
14251
+ Qh,
14252
+ N,
14253
+ U,
14254
+ J,
14255
+ X,
13652
14256
  Y,
13653
- H,
13654
- W
13655
- ]), hg = Object.values(Y).some((e) => e.type === "text" && e.value || e.type === "select" && e.value || e.type === "multiselect" && Array.isArray(e.value) && e.value.length > 0), gg = useMemo(() => {
14257
+ Bh
14258
+ ]), vg = () => {
14259
+ if (!b) return;
14260
+ let e = _g.filter((e) => !e.isAction);
14261
+ exportToExcel(Hh.filteredData, e, "table-data.xlsx");
14262
+ }, yg = Object.values(Q).some((e) => e.type === "text" && e.value || e.type === "select" && e.value || e.type === "multiselect" && Array.isArray(e.value) && e.value.length > 0), bg = useMemo(() => {
13656
14263
  let e = [];
13657
- return Object.entries(Y).forEach(([t, n]) => {
14264
+ return Object.entries(Q).forEach(([t, n]) => {
13658
14265
  let i = H.find((e) => e.id === t);
13659
14266
  i && (n.type === "text" && n.value ? e.push({
13660
14267
  columnId: t,
@@ -13670,476 +14277,105 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13670
14277
  });
13671
14278
  }));
13672
14279
  }), e;
13673
- }, [Y, H]), _g = (e, t) => {
13674
- let n = Y[e];
13675
- if (n.type === "text") Lh(e, "", "text");
14280
+ }, [Q, H]), xg = (e, t) => {
14281
+ let n = Q[e];
14282
+ if (n.type === "text") Gh(e, "", "text");
13676
14283
  else if (n.type === "multiselect" && Array.isArray(n.value)) {
13677
14284
  let i = n.value.filter((e) => e !== t);
13678
- Lh(e, i, "multiselect");
14285
+ Gh(e, i, "multiselect");
13679
14286
  }
13680
- };
13681
- useEffect(() => {
13682
- let e = (e) => {
13683
- V.current && !V.current.contains(e.target) && Oh(!1);
13684
- };
13685
- return B && document.addEventListener("mousedown", e), () => {
13686
- document.removeEventListener("mousedown", e);
13687
- };
13688
- }, [B]);
13689
- let vg = Math.ceil(X.total / X.pageSize), yg = (e) => Jh[e.id] ? Jh[e.id] : e.width ? e.width : e.isAction ? 100 : 150 + (e.filterable ? 50 : 0), bg = () => {
13690
- Wh(), xh?.();
13691
- }, xg = ({ columnLabel: e, value: t, onRemove: n }) => /* @__PURE__ */ jsxs("div", {
13692
- className: "inline-flex items-center gap-1 bg-blue-100 text-blue-800 font-medium px-4 py-1 rounded-full border border-blue-300 hover:bg-blue-200 transition-colors",
13693
- children: [
13694
- /* @__PURE__ */ jsxs("span", {
13695
- className: "font-semibold",
13696
- children: [e, ":"]
13697
- }),
13698
- /* @__PURE__ */ jsx("span", {
13699
- className: "max-w-50 truncate",
13700
- children: t
13701
- }),
13702
- /* @__PURE__ */ jsx("button", {
13703
- onClick: n,
13704
- className: "ml-1 hover:bg-blue-300 rounded-full transition-colors cursor-pointer",
13705
- "aria-label": `Remove filter ${e}: ${t}`,
13706
- children: /* @__PURE__ */ jsx(CloseIcon, { size: 22 })
13707
- })
13708
- ]
13709
- });
14287
+ }, Sg = Math.ceil(rg.total / rg.pageSize), Cg = (e) => sg[e.id] ? sg[e.id] : e.width ? e.width : e.isAction ? 100 : 150 + (e.filterable ? 50 : 0);
13710
14288
  return /* @__PURE__ */ jsxs("div", {
13711
- className: `w-full bg-redi-background border border-solid border-gray-500 rounded-xl overflow-hidden font-family-base shadow ${k}`,
14289
+ className: `w-full bg-redi-background border border-solid border-gray-500 rounded-xl overflow-hidden font-family-base shadow ${C}`,
13712
14290
  children: [
13713
- /* @__PURE__ */ jsxs("div", {
13714
- className: "flex items-center justify-between p-2 bg-transparent border-b border-solid border-gray-400",
13715
- children: [/* @__PURE__ */ jsxs("div", {
13716
- className: "flex items-center gap-2",
13717
- children: [
13718
- (bh || xh) && /* @__PURE__ */ jsx(Button_default, {
13719
- level: "secondary",
13720
- onClick: bg,
13721
- loading: Zh,
13722
- children: /* @__PURE__ */ jsx(RefreshIcon, { size: 18 })
13723
- }),
13724
- Th && /* @__PURE__ */ jsxs("div", {
13725
- className: "relative",
13726
- children: [/* @__PURE__ */ jsxs(Button_default, {
13727
- level: "secondary",
13728
- onClick: () => Oh(!B),
13729
- className: "p-1 px-2",
13730
- children: [/* @__PURE__ */ jsx(EyeIcon, {}), /* @__PURE__ */ jsx("span", {
13731
- className: "hidden md:block",
13732
- children: A.configuration
13733
- })]
13734
- }), B && /* @__PURE__ */ jsx("div", {
13735
- className: "absolute top-full left-0 bg-white border border-solid border-gray-300 rounded-md shadow-lg z-1000 mt-2 min-w-2xs max-w-xs opacity-100 visible p-4",
13736
- ref: V,
13737
- children: /* @__PURE__ */ jsxs("div", {
13738
- className: "mb-4 last:mb-0",
13739
- children: [/* @__PURE__ */ jsx("div", {
13740
- className: "text-sm font-semibold text-redi-text mb-2 uppercase",
13741
- children: A.columnVisibility
13742
- }), /* @__PURE__ */ jsx("div", {
13743
- className: "flex flex-col gap-2",
13744
- children: H.filter((e) => !e.isAction).map((e) => {
13745
- let t = !Kh.includes(e.id);
13746
- return /* @__PURE__ */ jsxs("div", {
13747
- className: "flex items-center justify-between gap-2 hover:bg-gray-50 p-1 rounded",
13748
- children: [/* @__PURE__ */ jsxs("div", {
13749
- className: "flex items-center gap-2",
13750
- children: [/* @__PURE__ */ jsx("input", {
13751
- type: "checkbox",
13752
- className: "w-4 h-4 accent-redi-primary cursor-pointer",
13753
- checked: t,
13754
- onChange: () => K(e.id),
13755
- id: `col-visibility-${e.id}`
13756
- }), /* @__PURE__ */ jsx("label", {
13757
- htmlFor: `col-visibility-${e.id}`,
13758
- className: "text-sm text-redi-text cursor-pointer select-none",
13759
- children: e.label
13760
- })]
13761
- }), t && /* @__PURE__ */ jsxs("div", {
13762
- className: "flex items-center gap-1",
13763
- children: [
13764
- M && /* @__PURE__ */ jsx(Button_default, {
13765
- level: "icon",
13766
- onClick: (t) => {
13767
- t.stopPropagation(), Vh(e.id);
13768
- },
13769
- "aria-label": Z.includes(e.id) ? "Unpin column" : "Pin column",
13770
- className: "p-1 hover:bg-gray-200 rounded-full",
13771
- children: Z.includes(e.id) ? /* @__PURE__ */ jsx(PinIcon, {
13772
- size: 14,
13773
- className: "text-redi-primary"
13774
- }) : /* @__PURE__ */ jsx(PinOffIcon, {
13775
- size: 14,
13776
- className: "text-gray-400"
13777
- })
13778
- }),
13779
- /* @__PURE__ */ jsx(Button_default, {
13780
- level: "icon",
13781
- onClick: (t) => {
13782
- t.stopPropagation();
13783
- let n = H.map((t) => t.id === e.id ? {
13784
- ...t,
13785
- draggable: !t.draggable
13786
- } : t);
13787
- U(n);
13788
- },
13789
- "aria-label": e.draggable ? "Disable drag" : "Enable drag",
13790
- className: "p-1 hover:bg-gray-200 rounded-full",
13791
- children: /* @__PURE__ */ jsx(DragToggleIcon, {
13792
- active: !!e.draggable,
13793
- size: 14,
13794
- label: "Draggable"
13795
- })
13796
- }),
13797
- /* @__PURE__ */ jsx(Button_default, {
13798
- level: "icon",
13799
- onClick: (t) => {
13800
- t.stopPropagation();
13801
- let n = H.map((t) => t.id === e.id ? {
13802
- ...t,
13803
- filterable: !t.filterable
13804
- } : t);
13805
- U(n);
13806
- },
13807
- "aria-label": e.filterable ? "Disable filter" : "Enable filter",
13808
- className: "p-1 hover:bg-gray-200 rounded-full",
13809
- children: e.filterable ? /* @__PURE__ */ jsx(FilterIcon, {
13810
- size: 14,
13811
- color: "#fa8c16"
13812
- }) : /* @__PURE__ */ jsx(FilterOffIcon, {
13813
- size: 14,
13814
- color: "#9ca3af"
13815
- })
13816
- })
13817
- ]
13818
- })]
13819
- }, e.id);
13820
- })
13821
- })]
13822
- })
13823
- })]
13824
- }),
13825
- w && hg && /* @__PURE__ */ jsx(Button_default, {
13826
- level: "icon",
13827
- onClick: Rh,
13828
- label: A.clearAllFilters,
13829
- children: /* @__PURE__ */ jsx(CloseIcon, { color: "white" })
13830
- }),
13831
- gg.length > 0 && /* @__PURE__ */ jsx("div", {
13832
- className: "flex items-center gap-2 flex-wrap ml-2",
13833
- children: gg.map((e, t) => /* @__PURE__ */ jsx(xg, {
13834
- columnLabel: e.columnLabel,
13835
- value: e.displayValue,
13836
- onRemove: () => _g(e.columnId, e.value)
13837
- }, `${e.columnId}-${e.value}-${t}`))
13838
- })
13839
- ]
13840
- }), /* @__PURE__ */ jsx("div", {
13841
- className: "flex items-center gap-2",
13842
- children: E && /* @__PURE__ */ jsx(Button_default, {
13843
- level: "secondary",
13844
- onClick: dg,
13845
- children: /* @__PURE__ */ jsx(DownloadIcon, { size: 18 })
13846
- })
13847
- })]
14291
+ /* @__PURE__ */ jsx(TableToolbar_default, {
14292
+ fetchData: F,
14293
+ onRefresh: I,
14294
+ handleRefreshClick: () => {
14295
+ eg(), I?.();
14296
+ },
14297
+ isLoading: ug,
14298
+ enableColumnConfig: z,
14299
+ labels: w,
14300
+ tableColumns: H,
14301
+ hiddenColumns: ig,
14302
+ pinnedColumns: ag,
14303
+ handleToggleColumn: Xh,
14304
+ handleTogglePin: Zh,
14305
+ setTableColumns: Lh,
14306
+ enableColumnPinning: E,
14307
+ enableFiltering: v,
14308
+ hasActiveFilters: yg,
14309
+ clearAllFilters: Kh,
14310
+ activeFilterTags: bg,
14311
+ handleRemoveFilterTag: xg,
14312
+ enableExport: b,
14313
+ handleExport: vg
13848
14314
  }),
13849
- /* @__PURE__ */ jsx("div", {
13850
- ref: $h,
13851
- className: `overflow-x-auto bg-gray-50 border-b border-gray-200 ${T ? "md:overflow-y-hidden" : ""}`,
13852
- onScroll: ng,
14315
+ y && /* @__PURE__ */ jsx("div", {
14316
+ ref: fg,
14317
+ className: `overflow-x-auto bg-gray-50 border-b border-gray-200 ${y ? "md:overflow-y-hidden" : ""}`,
14318
+ onScroll: hg,
13853
14319
  style: { height: "12px" },
13854
14320
  children: /* @__PURE__ */ jsx("div", { style: {
13855
- width: eg,
14321
+ width: pg,
13856
14322
  height: "1px"
13857
14323
  } })
13858
14324
  }),
13859
14325
  /* @__PURE__ */ jsx("div", {
13860
- ref: Qh,
13861
- onScroll: rg,
13862
- className: `overflow-x-auto bg-white relative ${T ? "max-h-150 md:max-h-none min-h-125 overflow-y-auto md:overflow-y-visible" : "max-h-125 overflow-y-auto"}`,
14326
+ ref: dg,
14327
+ onScroll: gg,
14328
+ className: `overflow-x-auto bg-white relative ${y ? "max-h-150 md:max-h-none min-h-125 overflow-y-auto md:overflow-y-visible" : "min-h-0 max-h-150 overflow-y-auto"}`,
13863
14329
  children: /* @__PURE__ */ jsxs("table", {
13864
14330
  className: "w-full border-separate border-spacing-0 table-auto text-sm relative",
13865
14331
  "aria-label": "Data Table",
13866
- children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: Q.map((e, t) => {
13867
- let n = yg(e), i = Z.includes(e.id), a = e.isAction && F, o = 0;
13868
- if (i) for (let e = 0; e < t; e++) Z.includes(Q[e].id) && (o += yg(Q[e]));
13869
- let s = {
13870
- width: n,
13871
- minWidth: n,
13872
- maxWidth: n,
13873
- ...a ? {
13874
- position: "sticky",
13875
- right: 0,
13876
- zIndex: 25,
13877
- backgroundColor: "#f9fafb"
13878
- } : i ? {
13879
- position: "sticky",
13880
- left: o,
13881
- zIndex: 20,
13882
- backgroundColor: "#f9fafb"
13883
- } : {}
13884
- };
13885
- return /* @__PURE__ */ jsx("th", {
13886
- className: `bg-gray-50 border-b border-solid border-gray-200 text-left font-semibold text-redi-text p-0 sticky top-0 z-10 select-none hover:bg-gray-200
13887
- ${Eh === t ? "opacity-50 bg-gray-300" : ""}
13888
- ${Dh === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
13889
- ${Dh === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
13890
- ${i && !a ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
13891
- ${a ? "shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
13892
- `,
13893
- style: s,
13894
- draggable: !e.isAction && j && (e.draggable ?? !1),
13895
- onDragStart: (n) => !e.isAction && j && (e.draggable ?? !1) && og(n, t),
13896
- onDragOver: (n) => !e.isAction && j && sg(n, t),
13897
- onDragLeave: cg,
13898
- onDrop: (n) => !e.isAction && j && lg(n, t),
13899
- onDragEnd: ug,
13900
- "aria-sort": Gh?.column === e.id ? Gh.direction === "asc" ? "ascending" : "descending" : "none",
13901
- children: /* @__PURE__ */ jsxs("div", {
13902
- className: "flex items-center py-2 px-3 gap-2 min-h-10",
13903
- children: [
13904
- !e.isAction && j && (e.draggable ?? !1) && /* @__PURE__ */ jsx("div", {
13905
- className: "text-gray-600 cursor-grab opacity-70 hover:opacity-100 text-base",
13906
- "aria-hidden": "true",
13907
- children: "⋮⋮"
13908
- }),
13909
- e.id === "selection-synthetic" && /* @__PURE__ */ jsx("input", {
13910
- type: "checkbox",
13911
- className: "w-4 h-4 accent-redi-primary cursor-pointer mr-2",
13912
- checked: J.length > 0 && J.every((e) => {
13913
- let t = typeof I == "function" ? I(e) : e[I];
13914
- return qh.includes(t);
13915
- }),
13916
- onChange: (e) => {
13917
- e.stopPropagation(), Uh(J);
13918
- }
13919
- }),
13920
- /* @__PURE__ */ jsxs("div", {
13921
- className: "flex flex-1 items-center gap-2",
13922
- children: [/* @__PURE__ */ jsxs("span", {
13923
- className: C ? "cursor-pointer py-1 px-1.5 rounded-sm flex items-center gap-1.5 text-sm font-semibold text-redi-text uppercase hover:bg-redi-background hover:text-redi-link-text" : "",
13924
- onClick: (t) => {
13925
- t.stopPropagation(), e.sortable && Ih(e.id);
13926
- },
13927
- role: "button",
13928
- tabIndex: 0,
13929
- onKeyDown: (t) => {
13930
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), e.sortable && Ih(e.id));
13931
- },
13932
- children: [e.label, e.sortable && Gh?.column === e.id && /* @__PURE__ */ jsx("span", {
13933
- className: "font-bold text-redi-link-text text-base",
13934
- children: Gh.direction === "asc" ? " ↑" : " ↓"
13935
- })]
13936
- }), /* @__PURE__ */ jsx("div", {
13937
- className: "flex items-center gap-1",
13938
- children: e.filterable && /* @__PURE__ */ jsxs("div", {
13939
- className: "relative",
13940
- children: [/* @__PURE__ */ jsx(Button_default, {
13941
- level: "icon",
13942
- onClick: (t) => {
13943
- t.stopPropagation(), pg(e.id);
13944
- },
13945
- "aria-label": `Filter by ${e.label}`,
13946
- children: /* @__PURE__ */ jsx(FilterIcon, { size: 16 })
13947
- }), kh === e.id && /* @__PURE__ */ jsx(AdvancedFilter_default, {
13948
- columnId: e.id,
13949
- label: e.label,
13950
- options: mg(e.id),
13951
- textValue: Y[e.id]?.type === "text" ? String(Y[e.id].value || "") : "",
13952
- selectedValues: Y[e.id]?.value ? Array.isArray(Y[e.id].value) ? Y[e.id].value : [String(Y[e.id].value)] : [],
13953
- onTextChange: (t) => Lh(e.id, t, "text"),
13954
- onSelectionChange: (t) => Lh(e.id, t, "multiselect"),
13955
- onClose: () => Ah(null),
13956
- loading: Mh[e.id] || !1,
13957
- isServerRefetch: !!bh && !!e.shouldBeRefetch
13958
- })]
13959
- })
13960
- })]
13961
- }),
13962
- N && !e.isAction && e.id !== "selection-synthetic" && /* @__PURE__ */ jsx("div", {
13963
- className: "absolute right-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-redi-primary z-20",
13964
- onMouseDown: (t) => ag(t, e.id, n)
13965
- })
13966
- ]
13967
- })
13968
- }, e.id);
13969
- }) }) }), /* @__PURE__ */ jsx("tbody", { children: yh ? Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ jsx("tr", {
13970
- className: "border-b border-solid border-gray-100",
13971
- children: Q.map((e, t) => {
13972
- let n = yg(e), i = Z.includes(e.id), a = e.isAction && F, o = 0;
13973
- if (i) for (let e = 0; e < t; e++) Z.includes(Q[e].id) && (o += yg(Q[e]));
13974
- let s = {
13975
- width: n,
13976
- minWidth: n,
13977
- maxWidth: n,
13978
- ...a ? {
13979
- position: "sticky",
13980
- right: 0,
13981
- zIndex: 10,
13982
- backgroundColor: "white"
13983
- } : i ? {
13984
- position: "sticky",
13985
- left: o,
13986
- zIndex: 10,
13987
- backgroundColor: "white"
13988
- } : {}
13989
- };
13990
- return /* @__PURE__ */ jsx("td", {
13991
- className: `py-2 px-3 ${e.isAction ? "bg-white border-l border-gray-200" : ""} ${i && !a ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""} ${a ? "shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}`,
13992
- style: s,
13993
- children: /* @__PURE__ */ jsx("div", { className: "h-4 bg-gray-200 rounded animate-pulse w-3/4" })
13994
- }, `skeleton-cell-${t}`);
13995
- })
13996
- }, `skeleton-${t}`)) : J.length > 0 ? J.map((e, t) => /* @__PURE__ */ jsx("tr", {
13997
- className: "even:bg-gray-50 hover:bg-gray-100 border-b border-solid border-b-gray-100 odd:bg-white",
13998
- children: Q.map((n, i) => {
13999
- let a = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], o = n.isAction, s = yg(n), c = Z.includes(n.id), l = o && F, u = 0;
14000
- if (c) for (let e = 0; e < i; e++) Z.includes(Q[e].id) && (u += yg(Q[e]));
14001
- let f = `py-2 px-3 text-redi-text font-normal leading-6 align-middle border-r border-solid border-r-gray-300 static table-cell last:border-r-0 first:font-medium
14002
- ${o ? "border-l border-gray-300" : ""}
14003
- ${c && !l ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
14004
- ${l ? "shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
14005
- `, p = {
14006
- width: s,
14007
- minWidth: s,
14008
- maxWidth: s,
14009
- overflowWrap: "break-word",
14010
- ...l ? {
14011
- position: "sticky",
14012
- right: 0,
14013
- zIndex: 15,
14014
- backgroundColor: "inherit"
14015
- } : c ? {
14016
- position: "sticky",
14017
- left: u,
14018
- zIndex: 10,
14019
- backgroundColor: "inherit"
14020
- } : {}
14021
- };
14022
- return n.render ? /* @__PURE__ */ jsx("td", {
14023
- className: f,
14024
- style: p,
14025
- children: n.render({
14026
- value: a,
14027
- row: e,
14028
- column: n,
14029
- index: t
14030
- })
14031
- }, n.id) : /* @__PURE__ */ jsx("td", {
14032
- className: f,
14033
- style: p,
14034
- children: formatCellValue(a)
14035
- }, n.id);
14036
- })
14037
- }, t)) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
14038
- colSpan: Q.length,
14039
- className: "py-12 text-center text-gray-500",
14040
- children: /* @__PURE__ */ jsxs("div", {
14041
- className: "flex flex-col items-center justify-center gap-2",
14042
- children: [/* @__PURE__ */ jsx("svg", {
14043
- className: "w-12 h-12 text-gray-300",
14044
- fill: "none",
14045
- stroke: "currentColor",
14046
- viewBox: "0 0 24 24",
14047
- children: /* @__PURE__ */ jsx("path", {
14048
- strokeLinecap: "round",
14049
- strokeLinejoin: "round",
14050
- strokeWidth: 1.5,
14051
- d: "M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"
14052
- })
14053
- }), /* @__PURE__ */ jsx("span", {
14054
- className: "text-sm font-medium",
14055
- children: A.noData
14056
- })]
14057
- })
14058
- }) }) })]
14332
+ children: [/* @__PURE__ */ jsx(TableHeader_default, {
14333
+ displayColumns: _g,
14334
+ getColumnWidth: Cg,
14335
+ pinnedColumns: ag,
14336
+ stickyActionsColumn: k,
14337
+ enableColumnReordering: T,
14338
+ handleColumnReorder: Yh,
14339
+ sortConfig: ng,
14340
+ handleSort: Wh,
14341
+ enableSorting: _,
14342
+ filters: Q,
14343
+ handleFilter: Gh,
14344
+ fetchData: F,
14345
+ data: e,
14346
+ paginatedData: tg,
14347
+ enableColumnResizing: D,
14348
+ handleColumnResize: Z,
14349
+ tableColumns: H,
14350
+ rowKey: A,
14351
+ selectedRows: og,
14352
+ handleSelectAll: $h,
14353
+ stateColumnOrder: Hh.columnOrder
14354
+ }), /* @__PURE__ */ jsx(TableBody_default, {
14355
+ loading: P,
14356
+ paginatedData: tg,
14357
+ displayColumns: _g,
14358
+ getColumnWidth: Cg,
14359
+ pinnedColumns: ag,
14360
+ stickyActionsColumn: k,
14361
+ rowKey: A,
14362
+ editingRowId: U,
14363
+ enableInlineEditing: B,
14364
+ editValues: G,
14365
+ validationErrors: Rh,
14366
+ handleInputChange: Vh,
14367
+ labels: w
14368
+ })]
14059
14369
  })
14060
14370
  }),
14061
- T && /* @__PURE__ */ jsxs("div", {
14062
- className: "flex items-center justify-between py-4 px-6 bg-white border-t-gray-300 border-solid border-t gap-4",
14063
- children: [/* @__PURE__ */ jsx("div", {
14064
- className: "text-redi-text text-base font-medium shrink-0",
14065
- children: /* @__PURE__ */ jsxs("span", { children: [
14066
- A.pagination?.showingItems,
14067
- " ",
14068
- (X.page - 1) * X.pageSize + 1,
14069
- " ",
14070
- A.pagination?.to,
14071
- " ",
14072
- Math.min(X.page * X.pageSize, X.total),
14073
- " ",
14074
- A.pagination?.of,
14075
- " ",
14076
- X.total,
14077
- X.total < Xh && Xh > 0 && /* @__PURE__ */ jsxs("span", {
14078
- className: "text-gray-500",
14079
- children: [
14080
- " (filtrado de ",
14081
- Xh,
14082
- ")"
14083
- ]
14084
- }),
14085
- " ",
14086
- A.pagination?.items
14087
- ] })
14088
- }), /* @__PURE__ */ jsxs("div", {
14089
- className: "flex items-center gap-5",
14090
- children: [/* @__PURE__ */ jsxs("label", {
14091
- className: "flex items-center gap-3 text-sm font-semibold text-redi-text",
14092
- children: [
14093
- A.pagination?.showPerPage,
14094
- /* @__PURE__ */ jsx("select", {
14095
- value: X.pageSize,
14096
- onChange: (e) => zh(Number(e.target.value)),
14097
- className: "py-1.5 px-2.5 border border-solid border-gray-300 rounded-md bg-white text-redi-text focus:outline-none focus:ring-2 focus:ring-redi-primary",
14098
- children: h.map((e) => /* @__PURE__ */ jsx("option", {
14099
- value: e,
14100
- children: e
14101
- }, e))
14102
- }),
14103
- A.pagination?.perPageItems
14104
- ]
14105
- }), /* @__PURE__ */ jsxs("div", {
14106
- className: "flex gap-1 items-center",
14107
- children: [
14108
- /* @__PURE__ */ jsx(Button_default, {
14109
- level: "icon",
14110
- onClick: () => G(1),
14111
- disabled: X.page === 1,
14112
- children: "<<"
14113
- }),
14114
- /* @__PURE__ */ jsx(Button_default, {
14115
- level: "icon",
14116
- onClick: () => G(X.page - 1),
14117
- disabled: X.page === 1,
14118
- children: "<"
14119
- }),
14120
- Array.from({ length: Math.min(3, vg) }, (e, t) => {
14121
- let n;
14122
- return n = vg <= 3 || X.page <= 2 ? t + 1 : X.page > vg - 2 ? vg - 2 + t : X.page - 1 + t, /* @__PURE__ */ jsx(Button_default, {
14123
- level: X.page === n ? "primary" : "secondary",
14124
- onClick: () => G(n),
14125
- children: n
14126
- }, n);
14127
- }),
14128
- /* @__PURE__ */ jsx(Button_default, {
14129
- level: "icon",
14130
- onClick: () => G(X.page + 1),
14131
- disabled: X.page === vg,
14132
- children: ">"
14133
- }),
14134
- /* @__PURE__ */ jsx(Button_default, {
14135
- level: "icon",
14136
- onClick: () => G(vg),
14137
- disabled: X.page === vg,
14138
- children: ">>"
14139
- })
14140
- ]
14141
- })]
14142
- })]
14371
+ y && /* @__PURE__ */ jsx(TablePagination, {
14372
+ pagination: rg,
14373
+ labels: w,
14374
+ totalUnfiltered: lg,
14375
+ pageSizeOptions: d,
14376
+ handlePageSizeChange: Jh,
14377
+ handlePageChange: qh,
14378
+ totalPages: Sg
14143
14379
  })
14144
14380
  ]
14145
14381
  });
@@ -14211,7 +14447,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14211
14447
  strokeLinecap: "round"
14212
14448
  })]
14213
14449
  });
14214
- }, KPI_default = ({ variant: e = "simple", title: t, value: n, progress: i = 0, trendValue: a, trendDirection: o = "neutral", icon: c, chartData: l, color: u, footer: p, subtitle: m, className: h = "" }) => {
14450
+ }, KPI_default = ({ variant: e = "simple", title: t, value: n, progress: i = 0, trendValue: a, trendDirection: o = "neutral", icon: s, chartData: l, color: u, footer: d, subtitle: m, className: h = "" }) => {
14215
14451
  let g = useMemo(() => o === "up" ? "text-green-500" : o === "down" ? "text-red-500" : "text-gray-500", [o]), _ = useMemo(() => o === "up" ? "↑" : o === "down" ? "↓" : "−", [o]), v = "rounded-lg border border-redi-border bg-white p-4 shadow-sm relative overflow-hidden transition-all duration-200 hover:shadow-md", y = u || "#1890ff";
14216
14452
  return e === "simple" ? /* @__PURE__ */ jsxs("div", {
14217
14453
  className: `${v} ${h}`,
@@ -14293,14 +14529,14 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14293
14529
  className: "text-2xl font-bold text-gray-900",
14294
14530
  children: n
14295
14531
  })]
14296
- }), c && /* @__PURE__ */ jsx("div", {
14532
+ }), s && /* @__PURE__ */ jsx("div", {
14297
14533
  className: "absolute right-[-10px] bottom-[-10px] opacity-10 text-[80px] pointer-events-none",
14298
14534
  style: { color: y },
14299
- children: c
14535
+ children: s
14300
14536
  })]
14301
14537
  }) : e === "side-icon" ? /* @__PURE__ */ jsxs("div", {
14302
14538
  className: `${v} flex items-center ${h}`,
14303
- children: [c && /* @__PURE__ */ jsx("div", {
14539
+ children: [s && /* @__PURE__ */ jsx("div", {
14304
14540
  className: "p-3 rounded-full mr-4 bg-opacity-10",
14305
14541
  style: {
14306
14542
  backgroundColor: `${y}20`,
@@ -14308,7 +14544,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14308
14544
  },
14309
14545
  children: /* @__PURE__ */ jsx("div", {
14310
14546
  className: "text-2xl",
14311
- children: c
14547
+ children: s
14312
14548
  })
14313
14549
  }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
14314
14550
  className: "text-sm text-gray-500 font-medium",
@@ -14328,9 +14564,9 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14328
14564
  className: "text-2xl font-bold text-gray-900",
14329
14565
  children: n
14330
14566
  })]
14331
- }), p && /* @__PURE__ */ jsx("div", {
14567
+ }), d && /* @__PURE__ */ jsx("div", {
14332
14568
  className: "bg-gray-50 px-4 py-2 border-t border-gray-100 text-xs text-gray-500",
14333
- children: p
14569
+ children: d
14334
14570
  })]
14335
14571
  }) : e === "circular" ? /* @__PURE__ */ jsxs("div", {
14336
14572
  className: `${v} flex items-center justify-between ${h}`,
@@ -14377,9 +14613,9 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14377
14613
  children: [/* @__PURE__ */ jsx("h3", {
14378
14614
  className: "text-2xl font-bold",
14379
14615
  children: n
14380
- }), c && /* @__PURE__ */ jsx("div", {
14616
+ }), s && /* @__PURE__ */ jsx("div", {
14381
14617
  className: "text-2xl opacity-80",
14382
- children: c
14618
+ children: s
14383
14619
  })]
14384
14620
  })]
14385
14621
  }) : e === "bordered" ? /* @__PURE__ */ jsxs("div", {
@@ -14394,18 +14630,18 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
14394
14630
  className: "text-2xl font-bold text-gray-900",
14395
14631
  children: n
14396
14632
  }),
14397
- p && /* @__PURE__ */ jsx("p", {
14633
+ d && /* @__PURE__ */ jsx("p", {
14398
14634
  className: "text-xs text-gray-400 mt-2",
14399
- children: p
14635
+ children: d
14400
14636
  })
14401
14637
  ]
14402
14638
  }) : e === "stacked" ? /* @__PURE__ */ jsxs("div", {
14403
14639
  className: `${v} flex flex-col items-center justify-center text-center ${h}`,
14404
14640
  children: [
14405
- c && /* @__PURE__ */ jsx("div", {
14641
+ s && /* @__PURE__ */ jsx("div", {
14406
14642
  className: "mb-2 text-2xl",
14407
14643
  style: { color: y },
14408
- children: c
14644
+ children: s
14409
14645
  }),
14410
14646
  /* @__PURE__ */ jsx("p", {
14411
14647
  className: "text-sm text-gray-500 font-medium",
@@ -15423,13 +15659,13 @@ function normalizeTwoToneColors(e) {
15423
15659
  return e ? Array.isArray(e) ? e : [e] : [];
15424
15660
  }
15425
15661
  const useInsertStyles = (e) => {
15426
- let { csp: t, prefixCls: n, layer: i } = useContext(Context_default), s = "\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n vertical-align: inherit;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";
15427
- n && (s = s.replace(/anticon/g, n)), i && (s = `@layer ${i} {\n${s}\n}`), useEffect(() => {
15428
- let n = e.current, a = getShadowRoot(n);
15429
- updateCSS(s, "@ant-design-icons", {
15662
+ let { csp: t, prefixCls: n, layer: i } = useContext(Context_default), a = "\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n vertical-align: inherit;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";
15663
+ n && (a = a.replace(/anticon/g, n)), i && (a = `@layer ${i} {\n${a}\n}`), useEffect(() => {
15664
+ let n = e.current, o = getShadowRoot(n);
15665
+ updateCSS(a, "@ant-design-icons", {
15430
15666
  prepend: !i,
15431
15667
  csp: t,
15432
- attachTo: a
15668
+ attachTo: o
15433
15669
  });
15434
15670
  }, []);
15435
15671
  };
@@ -15784,10 +16020,10 @@ var InfoCircleOutlined_default = RefIcon, tones$1 = {
15784
16020
  } : {
15785
16021
  role: "status",
15786
16022
  ariaLive: "polite"
15787
- }, Alert_default = ({ id: e, title: t, description: n, tone: i = "info", autoDismiss: a = 3e3, onClose: u, className: p = "", actions: m = [], closeOnAction: h = !1, showIcon: g = !0, icon: _ }) => {
16023
+ }, Alert_default = ({ id: e, title: t, description: n, tone: i = "info", autoDismiss: a = 3e3, onClose: o, className: d = "", actions: m = [], closeOnAction: h = !1, showIcon: g = !0, icon: _ }) => {
15788
16024
  let [v, y] = useState(!1), b = useRef(null), x = m.length > 0, S = () => {
15789
16025
  v || (y(!0), window.setTimeout(() => {
15790
- u?.(e);
16026
+ o?.(e);
15791
16027
  }, ANIMATION_DURATION));
15792
16028
  }, C = () => {
15793
16029
  b.current && window.clearTimeout(b.current), b.current = null;
@@ -15807,11 +16043,11 @@ var InfoCircleOutlined_default = RefIcon, tones$1 = {
15807
16043
  "transition-all duration-200 ease-out",
15808
16044
  tones$1[i],
15809
16045
  v ? "opacity-0 translate-y-2" : "opacity-100 translate-y-0",
15810
- p
16046
+ d
15811
16047
  ].join(" "), [
15812
16048
  i,
15813
16049
  v,
15814
- p
16050
+ d
15815
16051
  ]), D = _ ?? (g ? defaultIcons$1[i] : null), O = getA11y(i), k = [t, n].filter(Boolean).join(". ");
15816
16052
  return /* @__PURE__ */ jsxs("div", {
15817
16053
  className: E,
@@ -15898,7 +16134,7 @@ var tones = {
15898
16134
  } : {
15899
16135
  role: "status",
15900
16136
  ariaLive: "polite"
15901
- }, Badge_default = ({ label: e, count: t, max: n = 99, tone: i = "info", dot: a = !1, showIcon: c = !1, icon: u, iconPosition: p = "left", show: m = !0, animation: h = "scale", animationDuration: g = ANIMATION_DEFAULT, shape: _ = "auto", className: v = "", ariaLabel: y, role: b, ariaLive: x, onExited: S }) => {
16137
+ }, Badge_default = ({ label: e, count: t, max: n = 99, tone: i = "info", dot: a = !1, showIcon: o = !1, icon: l, iconPosition: d = "left", show: m = !0, animation: h = "scale", animationDuration: g = ANIMATION_DEFAULT, shape: _ = "auto", className: v = "", ariaLabel: y, role: b, ariaLive: x, onExited: S }) => {
15902
16138
  let [C, w] = useState(m), [T, E] = useState(!1);
15903
16139
  useEffect(() => {
15904
16140
  if (m) {
@@ -15921,10 +16157,10 @@ var tones = {
15921
16157
  t,
15922
16158
  n,
15923
16159
  e
15924
- ]), O = useMemo(() => a ? null : u ?? (c ? defaultIcons[i] : null), [
16160
+ ]), O = useMemo(() => a ? null : l ?? (o ? defaultIcons[i] : null), [
15925
16161
  a,
15926
- u,
15927
- c,
16162
+ l,
16163
+ o,
15928
16164
  i
15929
16165
  ]), k = useMemo(() => {
15930
16166
  let o = getA11yDefaults(i), s = b ?? o.role, c = x ?? o.ariaLive, l = (() => y || (a ? "Notificación" : typeof t == "number" ? `Notificaciones: ${formatCount(t, n)}` : typeof e == "string" && e.trim() ? e : "Notificación"))();
@@ -15960,7 +16196,7 @@ var tones = {
15960
16196
  "aria-label": k.derivedText,
15961
16197
  className: merge("inline-flex items-center gap-1 text-xs leading-none select-none", "shadow-sm", tones[i], F, A, v),
15962
16198
  children: [
15963
- !j && O && p === "left" && /* @__PURE__ */ jsx("span", {
16199
+ !j && O && d === "left" && /* @__PURE__ */ jsx("span", {
15964
16200
  className: "text-[0.85em] leading-none",
15965
16201
  children: O
15966
16202
  }),
@@ -15968,27 +16204,13 @@ var tones = {
15968
16204
  className: "whitespace-nowrap",
15969
16205
  children: D
15970
16206
  }),
15971
- !j && O && p === "right" && /* @__PURE__ */ jsx("span", {
16207
+ !j && O && d === "right" && /* @__PURE__ */ jsx("span", {
15972
16208
  className: "text-[0.85em] leading-none",
15973
16209
  children: O
15974
16210
  })
15975
16211
  ]
15976
16212
  });
15977
- };
15978
- const CheckIcon = ({ className: e,...t }) => /* @__PURE__ */ jsx("svg", {
15979
- className: e || "w-3.5 h-3.5",
15980
- fill: "none",
15981
- viewBox: "0 0 24 24",
15982
- stroke: "currentColor",
15983
- strokeWidth: 3,
15984
- ...t,
15985
- children: /* @__PURE__ */ jsx("path", {
15986
- strokeLinecap: "round",
15987
- strokeLinejoin: "round",
15988
- d: "M4.5 12.75l6 6 9-13.5"
15989
- })
15990
- });
15991
- var buildThemePalette = (e) => {
16213
+ }, buildThemePalette = (e) => {
15992
16214
  let t = getColor(e, 6);
15993
16215
  return {
15994
16216
  ...generatePalette(t),
@@ -15999,16 +16221,16 @@ var buildThemePalette = (e) => {
15999
16221
  border: getColor(e, 3),
16000
16222
  text: getColor(e, 6)
16001
16223
  };
16002
- }, Checkbox_default = ({ checked: e, onChange: n, label: i, disabled: a = !1, color: o, theme: s, indeterminate: c = !1, error: l = !1, helperText: u, id: p, name: m }) => {
16003
- let h = React.useMemo(() => o ? generatePalette(o) : buildThemePalette(s ?? "blue"), [o, s]), [g, _] = React.useState(!1), v = React.useRef(null);
16224
+ }, Checkbox_default = ({ checked: e, onChange: n, label: i, disabled: a = !1, color: o, theme: s, indeterminate: c = !1, error: l = !1, helperText: u, id: d, name: h }) => {
16225
+ let g = React.useMemo(() => o ? generatePalette(o) : buildThemePalette(s ?? "blue"), [o, s]), [_, v] = React.useState(!1), y = React.useRef(null);
16004
16226
  React.useEffect(() => {
16005
- v.current && (v.current.indeterminate = !!c);
16227
+ y.current && (y.current.indeterminate = !!c);
16006
16228
  }, [c]);
16007
- let y = l ? "#ef4444" : getColor("gray", 6), b = l ? "#ef4444" : h.active, x = g && !a && !l, S = e || c, C = {
16008
- "--checkbox-ring": b,
16009
- backgroundColor: S ? h.main : "#ffffff",
16010
- borderColor: S ? h.main : x ? h.hover : y
16011
- }, w = l ? "text-red-500" : a ? "text-gray-400" : "text-gray-700", T = a ? "text-gray-400" : "text-white", E = a ? "bg-gray-400" : "bg-white", D = a ? {
16229
+ let b = l ? "#ef4444" : getColor("gray", 6), x = l ? "#ef4444" : g.active, S = _ && !a && !l, C = e || c, w = {
16230
+ "--checkbox-ring": x,
16231
+ backgroundColor: C ? g.main : "#ffffff",
16232
+ borderColor: C ? g.main : S ? g.hover : b
16233
+ }, T = l ? "text-red-500" : a ? "text-gray-400" : "text-gray-700", E = a ? "text-gray-400" : "text-white", D = a ? "bg-gray-400" : "bg-white", O = a ? {
16012
16234
  backgroundColor: getColor("gray", 3),
16013
16235
  borderColor: getColor("gray", 6)
16014
16236
  } : {};
@@ -16016,15 +16238,15 @@ var buildThemePalette = (e) => {
16016
16238
  className: "flex flex-col",
16017
16239
  children: [/* @__PURE__ */ jsxs("label", {
16018
16240
  className: `inline-flex items-center gap-2 ${a ? "cursor-not-allowed opacity-60" : "cursor-pointer"}`,
16019
- onMouseEnter: () => !a && _(!0),
16020
- onMouseLeave: () => _(!1),
16241
+ onMouseEnter: () => !a && v(!0),
16242
+ onMouseLeave: () => v(!1),
16021
16243
  children: [/* @__PURE__ */ jsxs("div", {
16022
16244
  className: "relative flex items-center",
16023
16245
  children: [/* @__PURE__ */ jsx("input", {
16024
- id: p || m,
16025
- name: m,
16246
+ id: d || h,
16247
+ name: h,
16026
16248
  type: "checkbox",
16027
- ref: v,
16249
+ ref: y,
16028
16250
  checked: e,
16029
16251
  "aria-checked": c ? "mixed" : e,
16030
16252
  onChange: (e) => !a && n(e.target.checked),
@@ -16033,13 +16255,13 @@ var buildThemePalette = (e) => {
16033
16255
  }), /* @__PURE__ */ jsx("div", {
16034
16256
  className: "\n h-4 w-4 rounded-sm border transition-colors duration-200 flex items-center justify-center\n peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-(--checkbox-ring)\n ",
16035
16257
  style: {
16036
- ...C,
16037
- ...D
16258
+ ...w,
16259
+ ...O
16038
16260
  },
16039
- children: c ? /* @__PURE__ */ jsx("span", { className: `block h-0.5 w-2 ${E}` }) : /* @__PURE__ */ jsx(CheckIcon, { className: `w-3 h-3 ${T} transition-transform duration-200 ${e ? "scale-100" : "scale-0"}` })
16261
+ children: c ? /* @__PURE__ */ jsx("span", { className: `block h-0.5 w-2 ${D}` }) : /* @__PURE__ */ jsx(CheckIcon, { className: `w-3 h-3 ${E} transition-transform duration-200 ${e ? "scale-100" : "scale-0"}` })
16040
16262
  })]
16041
16263
  }), i && /* @__PURE__ */ jsx("span", {
16042
- className: `text-sm font-normal select-none ${w}`,
16264
+ className: `text-sm font-normal select-none ${T}`,
16043
16265
  children: i
16044
16266
  })]
16045
16267
  }), u && /* @__PURE__ */ jsx("span", {
@@ -16094,11 +16316,11 @@ const FileIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
16094
16316
  d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"
16095
16317
  })
16096
16318
  });
16097
- var FileInput_default = ({ multiple: e = !1, accept: t, onChange: n, disabled: i = !1, uploadUrl: a, onUploadComplete: o, onUploadError: s, maxSize: u, label: p, helperText: m, color: h, id: g, name: _ }) => {
16319
+ var FileInput_default = ({ multiple: e = !1, accept: t, onChange: n, disabled: i = !1, uploadUrl: a, onUploadComplete: o, onUploadError: s, maxSize: c, label: d, helperText: m, color: h, id: g, name: _ }) => {
16098
16320
  let [v, y] = useState([]), [b, x] = useState({}), [S, C] = useState(!1), w = useRef(null), T = (t) => {
16099
16321
  if (t.target.files) {
16100
- let i = Array.from(t.target.files), a = u ? i.filter((e) => e.size <= u) : i;
16101
- u && a.length < i.length && console.warn("Some files were skipped because they exceed the max size.");
16322
+ let i = Array.from(t.target.files), a = c ? i.filter((e) => e.size <= c) : i;
16323
+ c && a.length < i.length && console.warn("Some files were skipped because they exceed the max size.");
16102
16324
  let o = e ? [...v, ...a] : a;
16103
16325
  y(o), n(o), E(a);
16104
16326
  }
@@ -16144,9 +16366,9 @@ var FileInput_default = ({ multiple: e = !1, accept: t, onChange: n, disabled: i
16144
16366
  return /* @__PURE__ */ jsxs("div", {
16145
16367
  className: "flex flex-col gap-2",
16146
16368
  children: [
16147
- p && /* @__PURE__ */ jsx("label", {
16369
+ d && /* @__PURE__ */ jsx("label", {
16148
16370
  className: "text-sm font-medium text-gray-700",
16149
- children: p
16371
+ children: d
16150
16372
  }),
16151
16373
  /* @__PURE__ */ jsxs("div", {
16152
16374
  className: `
@@ -16252,14 +16474,14 @@ const ChevronDownIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg
16252
16474
  viewBox: "0 0 20 20",
16253
16475
  children: /* @__PURE__ */ jsx("path", { d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" })
16254
16476
  });
16255
- var Select_default = ({ options: e, value: t, onChange: n, disabled: i = !1, placeholder: a, label: o, error: s, helperText: c, color: u, fullWidth: p = !1, id: m, name: h }) => {
16256
- let [g, _] = useState(!1), v = s ? "border-red-500" : "border-gray-300", y = s ? "text-red-500" : "text-gray-700", b = u ? generatePalette(u) : null, x = s ? "border-red-500" : b ? "border-[var(--custom-color)]" : "border-redi-primary-bg", S = b ? {
16477
+ var Select_default = ({ options: e, value: t, onChange: n, disabled: i = !1, placeholder: a, label: o, error: s, helperText: c, color: l, fullWidth: d = !1, id: m, name: h }) => {
16478
+ let [g, _] = useState(!1), v = s ? "border-red-500" : "border-gray-300", y = s ? "text-red-500" : "text-gray-700", b = l ? generatePalette(l) : null, x = s ? "border-red-500" : b ? "border-[var(--custom-color)]" : "border-redi-primary-bg", S = b ? {
16257
16479
  "--custom-color": b.main,
16258
16480
  borderColor: g && !s ? b.main : void 0,
16259
16481
  boxShadow: g && !s ? `0 0 0 1px ${b.light}` : void 0
16260
16482
  } : {}, C = b && g && !s ? { color: b.main } : {};
16261
16483
  return /* @__PURE__ */ jsxs("div", {
16262
- className: `flex flex-col gap-1 ${p ? "w-full" : "w-auto"}`,
16484
+ className: `flex flex-col gap-1 ${d ? "w-full" : "w-auto"}`,
16263
16485
  children: [
16264
16486
  o && /* @__PURE__ */ jsx("label", {
16265
16487
  htmlFor: m || h,
@@ -16317,7 +16539,7 @@ var Select_default = ({ options: e, value: t, onChange: n, disabled: i = !1, pla
16317
16539
  backgroundColor: l.main,
16318
16540
  borderColor: l.main,
16319
16541
  "--switch-ring": l.active
16320
- } : {}, p = {
16542
+ } : {}, d = {
16321
16543
  small: {
16322
16544
  switch: "h-4 w-7",
16323
16545
  thumb: "h-3 w-3",
@@ -16344,15 +16566,15 @@ var Select_default = ({ options: e, value: t, onChange: n, disabled: i = !1, pla
16344
16566
  className: "sr-only peer"
16345
16567
  }), /* @__PURE__ */ jsx("div", {
16346
16568
  className: `
16347
- ${p.switch} rounded-full border transition-colors duration-200 ease-in-out
16569
+ ${d.switch} rounded-full border transition-colors duration-200 ease-in-out
16348
16570
  ${e ? "bg-redi-primary-bg border-redi-primary-bg" : "bg-gray-200 border-gray-200"}
16349
16571
  peer-focus:ring-2 peer-focus:ring-opacity-50 peer-focus:ring-offset-1
16350
16572
  ${l ? "peer-focus:ring-[var(--switch-ring)]" : "peer-focus:ring-redi-primary-bg"}
16351
16573
  `,
16352
16574
  style: u,
16353
16575
  children: /* @__PURE__ */ jsx("span", { className: `
16354
- pointer-events-none inline-block ${p.thumb} transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out
16355
- ${e ? `${p.translate}` : "translate-x-0.5"}
16576
+ pointer-events-none inline-block ${d.thumb} transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out
16577
+ ${e ? `${d.translate}` : "translate-x-0.5"}
16356
16578
  mt-0.5 ml-0.5
16357
16579
  ` })
16358
16580
  })]
@@ -16361,14 +16583,14 @@ var Select_default = ({ options: e, value: t, onChange: n, disabled: i = !1, pla
16361
16583
  children: i
16362
16584
  })]
16363
16585
  });
16364
- }, TextArea_default = ({ value: e, onChange: t, placeholder: n, rows: i = 4, disabled: a = !1, label: o, error: s, helperText: c, color: u, fullWidth: p = !1, id: m, name: h }) => {
16365
- let [g, _] = useState(!1), v = s ? "border-red-500" : "border-gray-300", y = s ? "text-red-500" : "text-gray-700", b = u ? generatePalette(u) : null, x = s ? "border-red-500" : b ? "border-[var(--custom-color)]" : "border-redi-primary-bg", S = b ? {
16586
+ }, TextArea_default = ({ value: e, onChange: t, placeholder: n, rows: i = 4, disabled: a = !1, label: o, error: s, helperText: c, color: l, fullWidth: d = !1, id: m, name: h }) => {
16587
+ let [g, _] = useState(!1), v = s ? "border-red-500" : "border-gray-300", y = s ? "text-red-500" : "text-gray-700", b = l ? generatePalette(l) : null, x = s ? "border-red-500" : b ? "border-[var(--custom-color)]" : "border-redi-primary-bg", S = b ? {
16366
16588
  "--custom-color": b.main,
16367
16589
  borderColor: g && !s ? b.main : void 0,
16368
16590
  boxShadow: g && !s ? `0 0 0 1px ${b.light}` : void 0
16369
16591
  } : {}, C = b && g && !s ? { color: b.main } : {};
16370
16592
  return /* @__PURE__ */ jsxs("div", {
16371
- className: `flex flex-col gap-1 ${p ? "w-full" : "w-auto"}`,
16593
+ className: `flex flex-col gap-1 ${d ? "w-full" : "w-auto"}`,
16372
16594
  children: [
16373
16595
  o && /* @__PURE__ */ jsx("label", {
16374
16596
  htmlFor: m || h,