@redi.run/redi-components 0.0.43 → 0.0.46

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.
@@ -1474,8 +1474,8 @@ var CRC32 = /* @__PURE__ */ (function() {
1474
1474
  return c ||= {};
1475
1475
  }
1476
1476
  function u(e, t) {
1477
- if (e[0] == 80 && e[1] == 75) return rg(e, t);
1478
- if ((e[0] | 32) == 109 && (e[1] | 32) == 105) return fg(e, t);
1477
+ if (e[0] == 80 && e[1] == 75) return sg(e, t);
1478
+ if ((e[0] | 32) == 109 && (e[1] | 32) == 105) return hg(e, t);
1479
1479
  if (e.length < 512) throw Error("CFB file size " + e.length + " < 512");
1480
1480
  var n = 3, i = 512, a = 0, o = 0, s = 0, c = 0, l = 0, u = [], h = e.slice(0, 512);
1481
1481
  prep_blob(h, 0);
@@ -1487,7 +1487,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1487
1487
  case 4:
1488
1488
  i = 4096;
1489
1489
  break;
1490
- case 0: if (_[1] == 0) return rg(e, t);
1490
+ case 0: if (_[1] == 0) return sg(e, t);
1491
1491
  default: throw Error("Major Version: Expected 3 or 4 saw " + n);
1492
1492
  }
1493
1493
  i !== 512 && (h = e.slice(0, i), prep_blob(h, 28));
@@ -1701,9 +1701,9 @@ var CRC32 = /* @__PURE__ */ (function() {
1701
1701
  }
1702
1702
  function E(e, t) {
1703
1703
  var n = t || {};
1704
- if (n.fileType == "mad") return pg(e, n);
1704
+ if (n.fileType == "mad") return gg(e, n);
1705
1705
  switch (T(e), n.fileType) {
1706
- case "zip": return ag(e, n);
1706
+ case "zip": return lg(e, n);
1707
1707
  }
1708
1708
  var i = (function(e) {
1709
1709
  for (var t = 0, n = 0, i = 0; i < e.FileIndex.length; ++i) {
@@ -1825,7 +1825,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1825
1825
  for (var t = Array(e.length), n = 0; n < e.length; ++n) t[n] = String.fromCharCode(e[n]);
1826
1826
  return t.join("");
1827
1827
  }
1828
- function I(e, t) {
1828
+ function Dh(e, t) {
1829
1829
  var n = E(e, t);
1830
1830
  switch (t && t.type || "buffer") {
1831
1831
  case "file": return l(), c.writeFileSync(t.filename, n), n;
@@ -1836,25 +1836,25 @@ var CRC32 = /* @__PURE__ */ (function() {
1836
1836
  }
1837
1837
  return n;
1838
1838
  }
1839
- var L;
1840
- function R(e) {
1839
+ var I;
1840
+ function Oh(e) {
1841
1841
  try {
1842
1842
  var t = e.InflateRaw, n = new t();
1843
- if (n._processChunk(new Uint8Array([3, 0]), n._finishFlushFlag), n.bytesRead) L = e;
1843
+ if (n._processChunk(new Uint8Array([3, 0]), n._finishFlushFlag), n.bytesRead) I = e;
1844
1844
  else throw Error("zlib does not expose bytesRead");
1845
1845
  } catch (e) {
1846
1846
  console.error("cannot use native zlib: " + (e.message || e));
1847
1847
  }
1848
1848
  }
1849
- function Ah(e, t) {
1850
- if (!L) return tg(e, t);
1851
- var n = L.InflateRaw, i = new n(), a = i._processChunk(e.slice(e.l), i._finishFlushFlag);
1849
+ function Ih(e, t) {
1850
+ if (!I) return ag(e, t);
1851
+ var n = I.InflateRaw, i = new n(), a = i._processChunk(e.slice(e.l), i._finishFlushFlag);
1852
1852
  return e.l += i.bytesRead, a;
1853
1853
  }
1854
- function jh(e) {
1855
- return L ? L.deflateRawSync(e) : Yh(e);
1854
+ function L(e) {
1855
+ return I ? I.deflateRawSync(e) : Qh(e);
1856
1856
  }
1857
- var B = [
1857
+ var Lh = [
1858
1858
  16,
1859
1859
  17,
1860
1860
  18,
@@ -1874,7 +1874,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1874
1874
  14,
1875
1875
  1,
1876
1876
  15
1877
- ], V = [
1877
+ ], R = [
1878
1878
  3,
1879
1879
  4,
1880
1880
  5,
@@ -1904,7 +1904,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1904
1904
  195,
1905
1905
  227,
1906
1906
  258
1907
- ], Fh = [
1907
+ ], B = [
1908
1908
  1,
1909
1909
  2,
1910
1910
  3,
@@ -1936,56 +1936,56 @@ var CRC32 = /* @__PURE__ */ (function() {
1936
1936
  16385,
1937
1937
  24577
1938
1938
  ];
1939
- function Ih(e) {
1939
+ function Bh(e) {
1940
1940
  var t = (e << 1 | e << 11) & 139536 | (e << 5 | e << 15) & 558144;
1941
1941
  return (t >> 16 | t >> 8 | t) & 255;
1942
1942
  }
1943
- for (var H = typeof Uint8Array < "u", U = H ? new Uint8Array(256) : [], Lh = 0; Lh < 256; ++Lh) U[Lh] = Ih(Lh);
1944
- function Rh(e, t) {
1945
- var n = U[e & 255];
1946
- return t <= 8 ? n >>> 8 - t : (n = n << 8 | U[e >> 8 & 255], t <= 16 ? n >>> 16 - t : (n = n << 8 | U[e >> 16 & 255], n >>> 24 - t));
1943
+ for (var V = typeof Uint8Array < "u", H = V ? new Uint8Array(256) : [], U = 0; U < 256; ++U) H[U] = Bh(U);
1944
+ function Vh(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));
1947
1947
  }
1948
- function zh(e, t) {
1948
+ function Hh(e, t) {
1949
1949
  var n = t & 7, i = t >>> 3;
1950
1950
  return (e[i] | (n <= 6 ? 0 : e[i + 1] << 8)) >>> n & 3;
1951
1951
  }
1952
- function Bh(e, t) {
1952
+ function W(e, t) {
1953
1953
  var n = t & 7, i = t >>> 3;
1954
1954
  return (e[i] | (n <= 5 ? 0 : e[i + 1] << 8)) >>> n & 7;
1955
1955
  }
1956
- function Vh(e, t) {
1956
+ function Uh(e, t) {
1957
1957
  var n = t & 7, i = t >>> 3;
1958
1958
  return (e[i] | (n <= 4 ? 0 : e[i + 1] << 8)) >>> n & 15;
1959
1959
  }
1960
- function Hh(e, t) {
1960
+ function Wh(e, t) {
1961
1961
  var n = t & 7, i = t >>> 3;
1962
1962
  return (e[i] | (n <= 3 ? 0 : e[i + 1] << 8)) >>> n & 31;
1963
1963
  }
1964
- function W(e, t) {
1964
+ function Gh(e, t) {
1965
1965
  var n = t & 7, i = t >>> 3;
1966
1966
  return (e[i] | (n <= 1 ? 0 : e[i + 1] << 8)) >>> n & 127;
1967
1967
  }
1968
- function G(e, t, n) {
1968
+ function Kh(e, t, n) {
1969
1969
  var i = t & 7, a = t >>> 3, o = (1 << n) - 1, s = e[a] >>> i;
1970
1970
  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
1971
  }
1972
- function Uh(e, t, n) {
1972
+ function qh(e, t, n) {
1973
1973
  var i = t & 7, a = t >>> 3;
1974
1974
  return i <= 5 ? e[a] |= (n & 7) << i : (e[a] |= n << i & 255, e[a + 1] = (n & 7) >> 8 - i), t + 3;
1975
1975
  }
1976
- function K(e, t, n) {
1976
+ function Jh(e, t, n) {
1977
1977
  var i = t & 7, a = t >>> 3;
1978
1978
  return n = (n & 1) << i, e[a] |= n, t + 1;
1979
1979
  }
1980
- function q(e, t, n) {
1980
+ function G(e, t, n) {
1981
1981
  var i = t & 7, a = t >>> 3;
1982
1982
  return n <<= i, e[a] |= n & 255, n >>>= 8, e[a + 1] = n, t + 8;
1983
1983
  }
1984
- function Wh(e, t, n) {
1984
+ function Yh(e, t, n) {
1985
1985
  var i = t & 7, a = t >>> 3;
1986
1986
  return n <<= i, e[a] |= n & 255, n >>>= 8, e[a + 1] = n & 255, e[a + 2] = n >>> 8, t + 16;
1987
1987
  }
1988
- function J(e, t) {
1988
+ function K(e, t) {
1989
1989
  var n = e.length, i = 2 * n > t ? 2 * n : t + 5, a = 0;
1990
1990
  if (n >= t) return e;
1991
1991
  if (has_buf) {
@@ -1993,7 +1993,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1993
1993
  if (e.copy) e.copy(o);
1994
1994
  else for (; a < e.length; ++a) o[a] = e[a];
1995
1995
  return o;
1996
- } else if (H) {
1996
+ } else if (V) {
1997
1997
  var s = new Uint8Array(i);
1998
1998
  if (s.set) s.set(e);
1999
1999
  else for (; a < n; ++a) s[a] = e[a];
@@ -2001,43 +2001,43 @@ var CRC32 = /* @__PURE__ */ (function() {
2001
2001
  }
2002
2002
  return e.length = i, e;
2003
2003
  }
2004
- function Y(e) {
2004
+ function q(e) {
2005
2005
  for (var t = Array(e), n = 0; n < e; ++n) t[n] = 0;
2006
2006
  return t;
2007
2007
  }
2008
- function Gh(e, t, n) {
2009
- var i = 1, a = 0, o = 0, s = 0, c = 0, l = e.length, u = H ? new Uint16Array(32) : Y(32);
2008
+ function J(e, t, n) {
2009
+ var i = 1, a = 0, o = 0, s = 0, c = 0, l = e.length, u = V ? new Uint16Array(32) : q(32);
2010
2010
  for (o = 0; o < 32; ++o) u[o] = 0;
2011
2011
  for (o = l; o < n; ++o) e[o] = 0;
2012
2012
  l = e.length;
2013
- var d = H ? new Uint16Array(l) : Y(l);
2013
+ var d = V ? new Uint16Array(l) : q(l);
2014
2014
  for (o = 0; o < l; ++o) u[a = e[o]]++, i < a && (i = a), d[o] = 0;
2015
2015
  for (u[0] = 0, o = 1; o <= i; ++o) u[o + 16] = c = c + u[o - 1] << 1;
2016
2016
  for (o = 0; o < l; ++o) c = e[o], c != 0 && (d[o] = u[c + 16]++);
2017
2017
  var f = 0;
2018
- for (o = 0; o < l; ++o) if (f = e[o], f != 0) for (c = Rh(d[o], i) >> i - f, s = (1 << i + 4 - f) - 1; s >= 0; --s) t[c | s << f] = f & 15 | o << 4;
2018
+ for (o = 0; o < l; ++o) if (f = e[o], f != 0) for (c = Vh(d[o], i) >> i - f, s = (1 << i + 4 - f) - 1; s >= 0; --s) t[c | s << f] = f & 15 | o << 4;
2019
2019
  return i;
2020
2020
  }
2021
- var Kh = H ? new Uint16Array(512) : Y(512), qh = H ? new Uint16Array(32) : Y(32);
2022
- if (!H) {
2023
- for (var X = 0; X < 512; ++X) Kh[X] = 0;
2024
- for (X = 0; X < 32; ++X) qh[X] = 0;
2021
+ var Y = V ? new Uint16Array(512) : q(512), Xh = V ? new Uint16Array(32) : q(32);
2022
+ if (!V) {
2023
+ for (var X = 0; X < 512; ++X) Y[X] = 0;
2024
+ for (X = 0; X < 32; ++X) Xh[X] = 0;
2025
2025
  }
2026
2026
  (function() {
2027
2027
  for (var e = [], t = 0; t < 32; t++) e.push(5);
2028
- Gh(e, qh, 32);
2028
+ J(e, Xh, 32);
2029
2029
  var n = [];
2030
2030
  for (t = 0; t <= 143; t++) n.push(8);
2031
2031
  for (; t <= 255; t++) n.push(9);
2032
2032
  for (; t <= 279; t++) n.push(7);
2033
2033
  for (; t <= 287; t++) n.push(8);
2034
- Gh(n, Kh, 288);
2034
+ J(n, Y, 288);
2035
2035
  })();
2036
- var Jh = /* @__PURE__ */ (function() {
2037
- for (var e = H ? new Uint8Array(32768) : [], t = 0, n = 0; t < Fh.length - 1; ++t) for (; n < Fh[t + 1]; ++n) e[n] = t;
2036
+ var Zh = /* @__PURE__ */ (function() {
2037
+ for (var e = V ? new Uint8Array(32768) : [], t = 0, n = 0; t < B.length - 1; ++t) for (; n < B[t + 1]; ++n) e[n] = t;
2038
2038
  for (; n < 32768; ++n) e[n] = 29;
2039
- var i = H ? new Uint8Array(259) : [];
2040
- for (t = 0, n = 0; t < V.length - 1; ++t) for (; n < V[t + 1]; ++n) i[n] = t;
2039
+ var i = V ? new Uint8Array(259) : [];
2040
+ for (t = 0, n = 0; t < R.length - 1; ++t) for (; n < R[t + 1]; ++n) i[n] = t;
2041
2041
  function a(e, t) {
2042
2042
  for (var n = 0; n < e.length;) {
2043
2043
  var i = Math.min(65535, e.length - n), a = n + i == e.length;
@@ -2046,30 +2046,30 @@ var CRC32 = /* @__PURE__ */ (function() {
2046
2046
  return t.l;
2047
2047
  }
2048
2048
  function o(t, n) {
2049
- for (var a = 0, o = 0, s = H ? new Uint16Array(32768) : []; o < t.length;) {
2049
+ for (var a = 0, o = 0, s = V ? new Uint16Array(32768) : []; o < t.length;) {
2050
2050
  var c = Math.min(65535, t.length - o);
2051
2051
  if (c < 10) {
2052
- for (a = Uh(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++];
2052
+ for (a = qh(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
2053
  a = n.l * 8;
2054
2054
  continue;
2055
2055
  }
2056
- a = Uh(n, a, +(o + c == t.length) + 2);
2056
+ a = qh(n, a, +(o + c == t.length) + 2);
2057
2057
  for (var l = 0; c-- > 0;) {
2058
2058
  var u = t[o];
2059
2059
  l = (l << 5 ^ u) & 32767;
2060
2060
  var d = -1, f = 0;
2061
2061
  if ((d = s[l]) && (d |= o & -32768, d > o && (d -= 32768), d < o)) for (; t[d + f] == t[o + f] && f < 250;) ++f;
2062
2062
  if (f > 2) {
2063
- u = i[f], u <= 22 ? a = q(n, a, U[u + 1] >> 1) - 1 : (q(n, a, 3), a += 5, q(n, a, U[u - 23] >> 5), a += 3);
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);
2064
2064
  var p = u < 8 ? 0 : u - 4 >> 2;
2065
- p > 0 && (Wh(n, a, f - V[u]), a += p), u = e[o - d], a = q(n, a, U[u] >> 3), a -= 3;
2065
+ p > 0 && (Yh(n, a, f - R[u]), a += p), u = e[o - d], a = G(n, a, H[u] >> 3), a -= 3;
2066
2066
  var m = u < 4 ? 0 : u - 2 >> 1;
2067
- m > 0 && (Wh(n, a, o - d - Fh[u]), a += m);
2067
+ m > 0 && (Yh(n, a, o - d - B[u]), a += m);
2068
2068
  for (var h = 0; h < f; ++h) s[l] = o & 32767, l = (l << 5 ^ t[o]) & 32767, ++o;
2069
2069
  c -= f - 1;
2070
- } else u <= 143 ? u += 48 : a = K(n, a, 1), a = q(n, a, U[u]), s[l] = o & 32767, ++o;
2070
+ } else u <= 143 ? u += 48 : a = Jh(n, a, 1), a = G(n, a, H[u]), s[l] = o & 32767, ++o;
2071
2071
  }
2072
- a = q(n, a, 0) - 1;
2072
+ a = G(n, a, 0) - 1;
2073
2073
  }
2074
2074
  return n.l = (a + 7) / 8 | 0, n.l;
2075
2075
  }
@@ -2077,19 +2077,19 @@ var CRC32 = /* @__PURE__ */ (function() {
2077
2077
  return e.length < 8 ? a(e, t) : o(e, t);
2078
2078
  };
2079
2079
  })();
2080
- function Yh(e) {
2081
- var t = new_buf(50 + Math.floor(e.length * 1.1)), n = Jh(e, t);
2080
+ function Qh(e) {
2081
+ var t = new_buf(50 + Math.floor(e.length * 1.1)), n = Zh(e, t);
2082
2082
  return t.slice(0, n);
2083
2083
  }
2084
- var Xh = H ? new Uint16Array(32768) : Y(32768), Zh = H ? new Uint16Array(32768) : Y(32768), Z = H ? new Uint16Array(128) : Y(128), Q = 1, Qh = 1;
2085
- function $h(e, t) {
2086
- var n = Hh(e, t) + 257;
2084
+ var $h = V ? new Uint16Array(32768) : q(32768), eg = V ? new Uint16Array(32768) : q(32768), Z = V ? new Uint16Array(128) : q(128), tg = 1, ng = 1;
2085
+ function rg(e, t) {
2086
+ var n = Wh(e, t) + 257;
2087
2087
  t += 5;
2088
- var i = Hh(e, t) + 1;
2088
+ var i = Wh(e, t) + 1;
2089
2089
  t += 5;
2090
- var a = Vh(e, t) + 4;
2090
+ var a = Uh(e, t) + 4;
2091
2091
  t += 4;
2092
- for (var o = 0, s = H ? new Uint8Array(19) : Y(19), c = [
2092
+ for (var o = 0, s = V ? new Uint8Array(19) : q(19), c = [
2093
2093
  0,
2094
2094
  0,
2095
2095
  0,
@@ -2109,25 +2109,25 @@ var CRC32 = /* @__PURE__ */ (function() {
2109
2109
  0,
2110
2110
  0,
2111
2111
  0
2112
- ], l = 1, u = H ? new Uint8Array(8) : Y(8), d = H ? new Uint8Array(8) : Y(8), f = s.length, p = 0; p < a; ++p) s[B[p]] = o = Bh(e, t), l < o && (l = o), u[o]++, t += 3;
2112
+ ], l = 1, u = V ? new Uint8Array(8) : q(8), d = V ? new Uint8Array(8) : q(8), f = s.length, p = 0; p < a; ++p) s[Lh[p]] = o = W(e, t), l < o && (l = o), u[o]++, t += 3;
2113
2113
  var m = 0;
2114
2114
  for (u[0] = 0, p = 1; p <= l; ++p) d[p] = m = m + u[p - 1] << 1;
2115
2115
  for (p = 0; p < f; ++p) (m = s[p]) != 0 && (c[p] = d[m]++);
2116
2116
  var h = 0;
2117
2117
  for (p = 0; p < f; ++p) if (h = s[p], h != 0) {
2118
- m = U[c[p]] >> 8 - h;
2118
+ m = H[c[p]] >> 8 - h;
2119
2119
  for (var g = (1 << 7 - h) - 1; g >= 0; --g) Z[m | g << h] = h & 7 | p << 3;
2120
2120
  }
2121
2121
  var _ = [];
2122
- for (l = 1; _.length < n + i;) switch (m = Z[W(e, t)], t += m & 7, m >>>= 3) {
2122
+ for (l = 1; _.length < n + i;) switch (m = Z[Gh(e, t)], t += m & 7, m >>>= 3) {
2123
2123
  case 16:
2124
- for (o = 3 + zh(e, t), t += 2, m = _[_.length - 1]; o-- > 0;) _.push(m);
2124
+ for (o = 3 + Hh(e, t), t += 2, m = _[_.length - 1]; o-- > 0;) _.push(m);
2125
2125
  break;
2126
2126
  case 17:
2127
- for (o = 3 + Bh(e, t), t += 3; o-- > 0;) _.push(0);
2127
+ for (o = 3 + W(e, t), t += 3; o-- > 0;) _.push(0);
2128
2128
  break;
2129
2129
  case 18:
2130
- for (o = 11 + W(e, t), t += 7; o-- > 0;) _.push(0);
2130
+ for (o = 11 + Gh(e, t), t += 7; o-- > 0;) _.push(0);
2131
2131
  break;
2132
2132
  default:
2133
2133
  _.push(m), l < m && (l = m);
@@ -2136,45 +2136,45 @@ var CRC32 = /* @__PURE__ */ (function() {
2136
2136
  var v = _.slice(0, n), y = _.slice(n);
2137
2137
  for (p = n; p < 286; ++p) v[p] = 0;
2138
2138
  for (p = i; p < 30; ++p) y[p] = 0;
2139
- return Q = Gh(v, Xh, 286), Qh = Gh(y, Zh, 30), t;
2139
+ return tg = J(v, $h, 286), ng = J(y, eg, 30), t;
2140
2140
  }
2141
- function eg(e, t) {
2141
+ function ig(e, t) {
2142
2142
  if (e[0] == 3 && !(e[1] & 3)) return [new_raw_buf(t), 2];
2143
2143
  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 = Bh(e, n), n += 3, i >>> 1) i >> 1 == 1 ? (c = 9, l = 5) : (n = $h(e, n), c = Q, l = Qh);
2144
+ if (i = W(e, n), n += 3, i >>> 1) i >> 1 == 1 ? (c = 9, l = 5) : (n = rg(e, n), c = tg, l = ng);
2145
2145
  else {
2146
2146
  n & 7 && (n += 8 - (n & 7));
2147
2147
  var u = e[n >>> 3] | e[(n >>> 3) + 1] << 8;
2148
- if (n += 32, u > 0) for (!t && s < o + u && (a = J(a, o + u), s = a.length); u-- > 0;) a[o++] = e[n >>> 3], n += 8;
2148
+ if (n += 32, u > 0) for (!t && s < o + u && (a = K(a, o + u), s = a.length); u-- > 0;) a[o++] = e[n >>> 3], n += 8;
2149
2149
  continue;
2150
2150
  }
2151
2151
  for (;;) {
2152
- !t && s < o + 32767 && (a = J(a, o + 32767), s = a.length);
2153
- var d = G(e, n, c), f = i >>> 1 == 1 ? Kh[d] : Xh[d];
2152
+ !t && s < o + 32767 && (a = K(a, o + 32767), s = a.length);
2153
+ var d = Kh(e, n, c), f = i >>> 1 == 1 ? Y[d] : $h[d];
2154
2154
  if (n += f & 15, f >>>= 4, !(f >>> 8 & 255)) a[o++] = f;
2155
2155
  else if (f == 256) break;
2156
2156
  else {
2157
2157
  f -= 257;
2158
2158
  var p = f < 8 ? 0 : f - 4 >> 2;
2159
2159
  p > 5 && (p = 0);
2160
- var m = o + V[f];
2161
- p > 0 && (m += G(e, n, p), n += p), d = G(e, n, l), f = i >>> 1 == 1 ? qh[d] : Zh[d], n += f & 15, f >>>= 4;
2162
- var h = f < 4 ? 0 : f - 2 >> 1, g = Fh[f];
2163
- for (h > 0 && (g += G(e, n, h), n += h), !t && s < m && (a = J(a, m + 100), s = a.length); o < m;) a[o] = a[o - g], ++o;
2160
+ var m = o + R[f];
2161
+ p > 0 && (m += Kh(e, n, p), n += p), d = Kh(e, n, l), f = i >>> 1 == 1 ? Xh[d] : eg[d], n += f & 15, f >>>= 4;
2162
+ var h = f < 4 ? 0 : f - 2 >> 1, g = B[f];
2163
+ for (h > 0 && (g += Kh(e, n, h), n += h), !t && s < m && (a = K(a, m + 100), s = a.length); o < m;) a[o] = a[o - g], ++o;
2164
2164
  }
2165
2165
  }
2166
2166
  }
2167
2167
  return t ? [a, n + 7 >>> 3] : [a.slice(0, o), n + 7 >>> 3];
2168
2168
  }
2169
- function tg(e, t) {
2170
- var n = e.slice(e.l || 0), i = eg(n, t);
2169
+ function ag(e, t) {
2170
+ var n = e.slice(e.l || 0), i = ig(n, t);
2171
2171
  return e.l += i[1], i[0];
2172
2172
  }
2173
- function ng(e, t) {
2173
+ function og(e, t) {
2174
2174
  if (e) typeof console < "u" && console.error(t);
2175
2175
  else throw Error(t);
2176
2176
  }
2177
- function rg(e, t) {
2177
+ function sg(e, t) {
2178
2178
  var n = e;
2179
2179
  prep_blob(n, 0);
2180
2180
  var i = {
@@ -2192,11 +2192,11 @@ var CRC32 = /* @__PURE__ */ (function() {
2192
2192
  var p = n.read_shift(4), m = s(n.slice(n.l + u, n.l + u + d));
2193
2193
  n.l += u + d + f;
2194
2194
  var h = n.l;
2195
- n.l = p + 4, ig(n, c, l, i, m), n.l = h;
2195
+ n.l = p + 4, cg(n, c, l, i, m), n.l = h;
2196
2196
  }
2197
2197
  return i;
2198
2198
  }
2199
- function ig(e, t, n, i, a) {
2199
+ function cg(e, t, n, i, a) {
2200
2200
  e.l += 2;
2201
2201
  var c = e.read_shift(2), l = e.read_shift(2), u = o(e);
2202
2202
  if (c & 8257) throw Error("Unsupported ZIP encryption");
@@ -2209,25 +2209,25 @@ var CRC32 = /* @__PURE__ */ (function() {
2209
2209
  var y = e.slice(e.l, e.l + f);
2210
2210
  switch (l) {
2211
2211
  case 8:
2212
- y = Ah(e, p);
2212
+ y = Ih(e, p);
2213
2213
  break;
2214
2214
  case 0: break;
2215
2215
  default: throw Error("Unsupported ZIP Compression method " + l);
2216
2216
  }
2217
2217
  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 && ng(b, "Bad compressed size: " + t + " != " + f), p != n && ng(b, "Bad uncompressed size: " + n + " != " + p), hg(i, g, y, {
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 && og(b, "Bad compressed size: " + t + " != " + f), p != n && og(b, "Bad uncompressed size: " + n + " != " + p), vg(i, g, y, {
2219
2219
  unsafe: !0,
2220
2220
  mt: u
2221
2221
  });
2222
2222
  }
2223
- function ag(e, t) {
2223
+ function lg(e, t) {
2224
2224
  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
2225
  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
2226
  var y = f, b = new_buf(h.length);
2227
2227
  for (d = 0; d < h.length; ++d) b.write_shift(1, h.charCodeAt(d) & 127);
2228
2228
  b = b.slice(0, b.l), _[p] = CRC32.buf(g.content, 0);
2229
2229
  var x = g.content;
2230
- c == 8 && (x = jh(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;
2230
+ c == 8 && (x = L(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
2231
  }
2232
2232
  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
2233
  bconcat(i),
@@ -2235,7 +2235,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2235
2235
  s
2236
2236
  ]);
2237
2237
  }
2238
- var og = {
2238
+ var ug = {
2239
2239
  htm: "text/html",
2240
2240
  xml: "text/xml",
2241
2241
  gif: "image/gif",
@@ -2245,16 +2245,16 @@ var CRC32 = /* @__PURE__ */ (function() {
2245
2245
  thmx: "application/vnd.ms-officetheme",
2246
2246
  sh33tj5: "application/octet-stream"
2247
2247
  };
2248
- function sg(e, t) {
2248
+ function dg(e, t) {
2249
2249
  if (e.ctype) return e.ctype;
2250
2250
  var n = e.name || "", i = n.match(/\.([^\.]+)$/);
2251
- return i && og[i[1]] || t && (i = (n = t).match(/[\.\\]([^\.\\])+$/), i && og[i[1]]) ? og[i[1]] : "application/octet-stream";
2251
+ return i && ug[i[1]] || t && (i = (n = t).match(/[\.\\]([^\.\\])+$/), i && ug[i[1]]) ? ug[i[1]] : "application/octet-stream";
2252
2252
  }
2253
- function cg(e) {
2253
+ function Q(e) {
2254
2254
  for (var t = Base64_encode(e), n = [], i = 0; i < t.length; i += 76) n.push(t.slice(i, i + 76));
2255
2255
  return n.join("\r\n") + "\r\n";
2256
2256
  }
2257
- function lg(e) {
2257
+ function fg(e) {
2258
2258
  var t = e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g, function(e) {
2259
2259
  var t = e.charCodeAt(0).toString(16).toUpperCase();
2260
2260
  return "=" + (t.length == 1 ? "0" + t : t);
@@ -2273,7 +2273,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2273
2273
  }
2274
2274
  return n.join("\r\n");
2275
2275
  }
2276
- function ug(e) {
2276
+ function pg(e) {
2277
2277
  for (var t = [], n = 0; n < e.length; ++n) {
2278
2278
  for (var i = e[n]; n <= e.length && i.charAt(i.length - 1) == "=";) i = i.slice(0, i.length - 1) + e[++n];
2279
2279
  t.push(i);
@@ -2283,7 +2283,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2283
2283
  });
2284
2284
  return s2a(t.join("\r\n"));
2285
2285
  }
2286
- function dg(e, t, n) {
2286
+ function mg(e, t, n) {
2287
2287
  for (var i = "", a = "", o = "", s, c = 0; c < 10; ++c) {
2288
2288
  var l = t[c];
2289
2289
  if (!l || l.match(/^\s*$/)) break;
@@ -2305,14 +2305,14 @@ var CRC32 = /* @__PURE__ */ (function() {
2305
2305
  s = s2a(Base64_decode(t.slice(c).join("")));
2306
2306
  break;
2307
2307
  case "quoted-printable":
2308
- s = ug(t.slice(c));
2308
+ s = pg(t.slice(c));
2309
2309
  break;
2310
2310
  default: throw Error("Unsupported Content-Transfer-Encoding " + a);
2311
2311
  }
2312
- var d = hg(e, i.slice(n.length), s, { unsafe: !0 });
2312
+ var d = vg(e, i.slice(n.length), s, { unsafe: !0 });
2313
2313
  o && (d.ctype = o);
2314
2314
  }
2315
- function fg(e, t) {
2315
+ function hg(e, t) {
2316
2316
  if (F(e.slice(0, 13)).toLowerCase() != "mime-version:") throw Error("Unsupported MAD header");
2317
2317
  var n = t && t.root || "", i = (has_buf && Buffer.isBuffer(e) ? e.toString("binary") : F(e)).split("\r\n"), a = 0, o = "";
2318
2318
  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););
@@ -2326,11 +2326,11 @@ var CRC32 = /* @__PURE__ */ (function() {
2326
2326
  var u, d = 0;
2327
2327
  for (a = 0; a < i.length; ++a) {
2328
2328
  var f = i[a];
2329
- f !== c && f !== c + "--" || (d++ && dg(l, i.slice(u, a), n), u = a);
2329
+ f !== c && f !== c + "--" || (d++ && mg(l, i.slice(u, a), n), u = a);
2330
2330
  }
2331
2331
  return l;
2332
2332
  }
2333
- function pg(e, t) {
2333
+ function gg(e, t) {
2334
2334
  var n = t || {}, i = n.boundary || "SheetJS";
2335
2335
  i = "------=" + i;
2336
2336
  for (var a = [
@@ -2347,15 +2347,15 @@ var CRC32 = /* @__PURE__ */ (function() {
2347
2347
  });
2348
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;
2349
2349
  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: " + sg(c, s)), a.push(""), a.push(g ? lg(d) : cg(d));
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: " + dg(c, s)), a.push(""), a.push(g ? fg(d) : Q(d));
2351
2351
  }
2352
2352
  return a.push(i + "--\r\n"), a.join("\r\n");
2353
2353
  }
2354
- function mg(e) {
2354
+ function _g(e) {
2355
2355
  var t = {};
2356
2356
  return C(t, e), t;
2357
2357
  }
2358
- function hg(e, t, n, a) {
2358
+ function vg(e, t, n, a) {
2359
2359
  var o = a && a.unsafe;
2360
2360
  o || C(e);
2361
2361
  var s = !o && CFB.find(e, t);
@@ -2368,7 +2368,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2368
2368
  }
2369
2369
  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
2370
  }
2371
- function gg(e, t) {
2371
+ function yg(e, t) {
2372
2372
  C(e);
2373
2373
  var n = CFB.find(e, t);
2374
2374
  if (n) {
@@ -2376,7 +2376,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2376
2376
  }
2377
2377
  return !1;
2378
2378
  }
2379
- function _g(e, t, n) {
2379
+ function bg(e, t, n) {
2380
2380
  C(e);
2381
2381
  var a = CFB.find(e, t);
2382
2382
  if (a) {
@@ -2384,22 +2384,22 @@ var CRC32 = /* @__PURE__ */ (function() {
2384
2384
  }
2385
2385
  return !1;
2386
2386
  }
2387
- function vg(e) {
2387
+ function xg(e) {
2388
2388
  T(e, !0);
2389
2389
  }
2390
- return e.find = D, e.read = S, e.parse = u, e.write = I, e.writeFile = P, e.utils = {
2391
- cfb_new: mg,
2392
- cfb_add: hg,
2393
- cfb_del: gg,
2394
- cfb_mov: _g,
2395
- cfb_gc: vg,
2390
+ return e.find = D, e.read = S, e.parse = u, e.write = Dh, e.writeFile = P, e.utils = {
2391
+ cfb_new: _g,
2392
+ cfb_add: vg,
2393
+ cfb_del: yg,
2394
+ cfb_mov: bg,
2395
+ cfb_gc: xg,
2396
2396
  ReadShift,
2397
2397
  CheckField,
2398
2398
  prep_blob,
2399
2399
  bconcat,
2400
- use_zlib: R,
2401
- _deflateRaw: Yh,
2402
- _inflateRaw: tg,
2400
+ use_zlib: Oh,
2401
+ _deflateRaw: Qh,
2402
+ _inflateRaw: ag,
2403
2403
  consts: N
2404
2404
  }, e;
2405
2405
  })(), _fs = void 0;
@@ -5531,7 +5531,7 @@ var DBF = /* @__PURE__ */ (function() {
5531
5531
  function e(e, t, n) {
5532
5532
  if (e) {
5533
5533
  prep_blob(e, e.l || 0);
5534
- for (var i = n.Enum || z; e.l < e.length;) {
5534
+ for (var i = n.Enum || kh; e.l < e.length;) {
5535
5535
  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
5536
  if (e.l = c, t(l, o, a)) return;
5537
5537
  }
@@ -5561,7 +5561,7 @@ var DBF = /* @__PURE__ */ (function() {
5561
5561
  }
5562
5562
  }, p = i.sheetRows || 0;
5563
5563
  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 = z, e(t, function(e, t, n) {
5564
+ if (t[2] == 2) i.Enum = kh, e(t, function(e, t, n) {
5565
5565
  switch (n) {
5566
5566
  case 0:
5567
5567
  i.vers = e, e >= 4096 && (i.qpro = !0);
@@ -5600,7 +5600,7 @@ var DBF = /* @__PURE__ */ (function() {
5600
5600
  default:
5601
5601
  }
5602
5602
  }, i);
5603
- else if (t[2] == 26 || t[2] == 14) i.Enum = Th, t[2] == 14 && (i.qpro = !0, t.l = 0), e(t, function(e, t, n) {
5603
+ else if (t[2] == 26 || t[2] == 14) i.Enum = jh, t[2] == 14 && (i.qpro = !0, t.l = 0), e(t, function(e, t, n) {
5604
5604
  switch (n) {
5605
5605
  case 204:
5606
5606
  o = e;
@@ -5665,7 +5665,7 @@ var DBF = /* @__PURE__ */ (function() {
5665
5665
  if (+n.codepage >= 0 && set_cp(+n.codepage), n.type == "string") throw Error("Cannot write WK3 to JS string");
5666
5666
  var i = buf_array();
5667
5667
  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, R(e.SheetNames[a], o++));
5668
+ for (var a = 0, o = 0; a < e.SheetNames.length; ++a) (e.Sheets[e.SheetNames[a]] || {})["!ref"] && write_biff_rec(i, 27, Oh(e.SheetNames[a], o++));
5669
5669
  var c = 0;
5670
5670
  for (a = 0; a < e.SheetNames.length; ++a) {
5671
5671
  var l = e.Sheets[e.SheetNames[a]];
@@ -5956,7 +5956,7 @@ var DBF = /* @__PURE__ */ (function() {
5956
5956
  return [i, a];
5957
5957
  }
5958
5958
  }
5959
- function L(e, t) {
5959
+ function I(e, t) {
5960
5960
  for (var n = {}, i = e.l + t; e.l < i;) {
5961
5961
  var a = e.read_shift(2);
5962
5962
  if (a == 14e3) {
@@ -5966,7 +5966,7 @@ var DBF = /* @__PURE__ */ (function() {
5966
5966
  }
5967
5967
  return n;
5968
5968
  }
5969
- function R(e, t) {
5969
+ function Oh(e, t) {
5970
5970
  var n = new_buf(5 + e.length);
5971
5971
  n.write_shift(2, 14e3), n.write_shift(2, t);
5972
5972
  for (var i = 0; i < e.length; ++i) {
@@ -5975,7 +5975,7 @@ var DBF = /* @__PURE__ */ (function() {
5975
5975
  }
5976
5976
  return n[n.l++] = 0, n;
5977
5977
  }
5978
- var z = {
5978
+ var kh = {
5979
5979
  0: {
5980
5980
  n: "BOF",
5981
5981
  f: parseuint16
@@ -6067,7 +6067,7 @@ var DBF = /* @__PURE__ */ (function() {
6067
6067
  f: P
6068
6068
  },
6069
6069
  65535: { n: "" }
6070
- }, Th = {
6070
+ }, jh = {
6071
6071
  0: { n: "BOF" },
6072
6072
  1: { n: "EOF" },
6073
6073
  2: { n: "PASSWORD" },
@@ -6109,7 +6109,7 @@ var DBF = /* @__PURE__ */ (function() {
6109
6109
  26: { n: "FORMULA1A" },
6110
6110
  27: {
6111
6111
  n: "XFORMAT",
6112
- f: L
6112
+ f: I
6113
6113
  },
6114
6114
  28: { n: "DTLABELMISC" },
6115
6115
  29: { n: "DTLABELCELL" },
@@ -12020,11 +12020,11 @@ function write_numbers_iwa(e, t) {
12020
12020
  })();
12021
12021
  var P = parse_shallow(D[3][0].data), F = P[1][0];
12022
12022
  delete P[2];
12023
- var I = parse_shallow(F.data), L = parse_TSP_Reference(I[2][0].data);
12023
+ var Dh = parse_shallow(F.data), I = parse_TSP_Reference(Dh[2][0].data);
12024
12024
  (function() {
12025
- for (var e = CFB.find(u, c[L].location), t = parse_iwa_file(decompress_iwa_file(e.content)), n, a = 0; a < t.length; ++a) {
12025
+ for (var e = CFB.find(u, c[I].location), t = parse_iwa_file(decompress_iwa_file(e.content)), n, a = 0; a < t.length; ++a) {
12026
12026
  var l = t[a];
12027
- l.id == L && (n = l);
12027
+ l.id == I && (n = l);
12028
12028
  }
12029
12029
  var d = parse_shallow(n.messages[0].data);
12030
12030
  delete d[6], delete P[7];
@@ -12052,9 +12052,9 @@ function write_numbers_iwa(e, t) {
12052
12052
  }], n.messages[0].data = write_shallow(d);
12053
12053
  var g = write_iwa_file(t);
12054
12054
  e.content = compress_iwa_file(g), e.size = e.content.length;
12055
- })(), 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 R = write_iwa_file(p);
12057
- return f.content = compress_iwa_file(R), f.size = f.content.length, u;
12055
+ })(), F.data = write_shallow(Dh), D[3][0].data = write_shallow(P), v[4][0].data = write_shallow(D), m.messages[0].data = write_shallow(v);
12056
+ var Oh = write_iwa_file(p);
12057
+ return f.content = compress_iwa_file(Oh), f.size = f.content.length, u;
12058
12058
  }
12059
12059
  function fix_opts_func(e) {
12060
12060
  return function(t) {
@@ -13039,23 +13039,16 @@ var buildThemePalette$1 = (e) => {
13039
13039
  className: AdvancedTable_module_default.filterModal,
13040
13040
  ref: h,
13041
13041
  children: [
13042
- /* @__PURE__ */ jsxs("div", {
13042
+ /* @__PURE__ */ jsx("div", {
13043
13043
  className: AdvancedTable_module_default.filterModalHeader,
13044
- children: [/* @__PURE__ */ jsx("input", {
13044
+ children: /* @__PURE__ */ jsx("input", {
13045
13045
  type: "text",
13046
13046
  className: AdvancedTable_module_default.filterSearchInput,
13047
13047
  placeholder: `Buscar texto en ${e.toLowerCase()}...`,
13048
- value: n,
13049
- onChange: (e) => a(e.target.value),
13050
- autoFocus: !0
13051
- }), /* @__PURE__ */ jsx("input", {
13052
- type: "text",
13053
- className: AdvancedTable_module_default.filterSearchInput,
13054
- placeholder: "Buscar opciones...",
13055
13048
  value: p,
13056
13049
  onChange: (e) => m(e.target.value),
13057
13050
  style: { marginTop: "8px" }
13058
- })]
13051
+ })
13059
13052
  }),
13060
13053
  /* @__PURE__ */ jsxs("div", {
13061
13054
  className: AdvancedTable_module_default.filterOptions,
@@ -13113,7 +13106,7 @@ var buildThemePalette$1 = (e) => {
13113
13106
  });
13114
13107
  };
13115
13108
  const useAdvancedTable = (e) => {
13116
- let { data: t, columns: n, defaultSort: a, defaultFilters: c = {}, defaultPageSize: u = 10, pageSizeOptions: d = [
13109
+ let { data: t, columns: n, defaultSort: a, defaultFilters: u = {}, defaultPageSize: d = 10, pageSizeOptions: f = [
13117
13110
  10,
13118
13111
  25,
13119
13112
  50,
@@ -13122,74 +13115,92 @@ const useAdvancedTable = (e) => {
13122
13115
  300,
13123
13116
  400,
13124
13117
  500
13125
- ], initialConfig: f, onConfigChange: p, onPaginationChange: m, onFiltersChange: h, fetchData: g } = e, [_, v] = useState(f?.sort || a || void 0), [y, b] = useState(f?.filters || c), [x, S] = useState(f?.columnOrder || n.map((e) => e.id)), [C, w] = useState(f?.hiddenColumns || []), [T, E] = useState(f?.pinnedColumns || []), [D, O] = useState({
13118
+ ], initialConfig: p, onConfigChange: m, onPaginationChange: h, onFiltersChange: g, fetchData: _, rowKey: v = "id", onRowSelectionChange: y } = e, [b, x] = useState(p?.sort || a || void 0), [S, C] = useState(p?.filters || u), [w, T] = useState(p?.columnOrder || n.map((e) => e.id)), [E, D] = useState(p?.hiddenColumns || []), [O, k] = useState(p?.pinnedColumns || []), [A, j] = useState([]), [M, N] = useState({}), [P, F] = useState({
13126
13119
  page: 1,
13127
- pageSize: f?.pagination?.pageSize || u,
13128
- total: f?.pagination?.total || t.length
13129
- }), [k, A] = useState([]), [j, M] = useState(0), [N, P] = useState(!1), [F, I] = useState(0), L = useCallback(async () => {
13130
- if (g) {
13131
- P(!0);
13120
+ pageSize: p?.pagination?.pageSize || d,
13121
+ total: p?.pagination?.total || t.length
13122
+ }), [Dh, I] = useState([]), [Oh, kh] = useState(0), [Ah, jh] = useState(!1), [Mh, Nh] = useState(0), Ph = useCallback(async () => {
13123
+ if (_) {
13124
+ jh(!0);
13132
13125
  try {
13133
13126
  let e = {
13134
- page_number: D.page,
13135
- page_size: D.pageSize
13127
+ page_number: P.page,
13128
+ page_size: P.pageSize
13136
13129
  };
13137
- _ && (e.order_by = `${_.direction === "desc" ? "-" : ""}${_.column}`), Object.entries(y).forEach(([t, n]) => {
13130
+ b && (e.order_by = `${b.direction === "desc" ? "-" : ""}${b.column}`), Object.entries(S).forEach(([t, n]) => {
13138
13131
  n.value && (e[t] = n.value);
13139
13132
  });
13140
- let t = await g(e);
13141
- A(t.items), M(t.total_items);
13133
+ let t = await _(e);
13134
+ I(t.items), kh(t.total_items);
13142
13135
  } catch (e) {
13143
13136
  console.error("Failed to fetch data:", e);
13144
13137
  } finally {
13145
- P(!1);
13138
+ jh(!1);
13146
13139
  }
13147
13140
  }
13148
13141
  }, [
13149
- g,
13150
- D.page,
13151
- D.pageSize,
13152
13142
  _,
13153
- y
13154
- ]);
13143
+ P.page,
13144
+ P.pageSize,
13145
+ b,
13146
+ S
13147
+ ]), Fh = useRef(!0), Ih = useRef(S), L = useRef(b), Lh = useRef(P.page), Rh = useRef(P.pageSize), R = useRef(Mh);
13155
13148
  useEffect(() => {
13156
- g && L();
13149
+ if (_) {
13150
+ let e = !1, t = JSON.stringify(S) !== JSON.stringify(Ih.current);
13151
+ if (Fh.current) e = !0, Fh.current = !1;
13152
+ else if (Mh !== R.current) e = !0, R.current = Mh;
13153
+ else if (P.page !== Lh.current || P.pageSize !== Rh.current) e = !0;
13154
+ else if (JSON.stringify(b) !== JSON.stringify(L.current)) e = !0;
13155
+ else if (t) {
13156
+ let t = Object.keys(Ih.current), i = Object.keys(S), a = Array.from(new Set([...t, ...i]));
13157
+ for (let t of a) if (JSON.stringify(Ih.current[t]) !== JSON.stringify(S[t]) && n.find((e) => e.id === t)?.shouldBeRefetch === !0) {
13158
+ e = !0;
13159
+ break;
13160
+ }
13161
+ }
13162
+ Lh.current = P.page, Rh.current = P.pageSize, L.current = b, Ih.current = S, e && Ph();
13163
+ }
13157
13164
  }, [
13158
- L,
13159
- F,
13160
- g
13165
+ Ph,
13166
+ Mh,
13167
+ _,
13168
+ P.page,
13169
+ P.pageSize,
13170
+ b,
13171
+ S,
13172
+ n
13161
13173
  ]), useEffect(() => {
13162
- g && O((e) => ({
13174
+ _ && F((e) => ({
13163
13175
  ...e,
13164
- total: j
13176
+ total: Oh
13165
13177
  }));
13166
- }, [j, g]), useEffect(() => {
13178
+ }, [Oh, _]), useEffect(() => {
13167
13179
  let e = n.map((e) => e.id);
13168
- S((t) => {
13180
+ T((t) => {
13169
13181
  let n = t.filter((t) => e.includes(t)), i = e.filter((e) => !n.includes(e));
13170
13182
  return [...n, ...i];
13171
- }), w((t) => t.filter((t) => e.includes(t))), E((t) => t.filter((t) => e.includes(t)));
13183
+ }), D((t) => t.filter((t) => e.includes(t))), k((t) => t.filter((t) => e.includes(t)));
13172
13184
  }, [n]);
13173
- let R = useMemo(() => {
13174
- if (g) return k;
13175
- let e = [...t];
13176
- return Object.entries(y).forEach(([t, i]) => {
13185
+ let z = useMemo(() => {
13186
+ let e = [];
13187
+ return e = _ ? [...Dh] : [...t], Object.entries(S).forEach(([t, i]) => {
13177
13188
  let a = n.find((e) => e.id === t);
13178
- a && (e = e.filter((e) => {
13189
+ a && (_ && a.shouldBeRefetch || (e = e.filter((e) => {
13179
13190
  let t = typeof a.accessor == "function" ? a.accessor(e) : e[a.accessor], n = String(t || "").toLowerCase(), o = !0;
13180
13191
  return i.type === "text" && i.value && (o &&= n.includes(String(i.value).toLowerCase())), i.type === "select" && i.value && (o &&= n === String(i.value).toLowerCase()), i.type === "multiselect" && Array.isArray(i.value) && i.value.length > 0 && (o &&= i.value.some((e) => n === String(e).toLowerCase())), o;
13181
- }));
13192
+ })));
13182
13193
  }), e;
13183
13194
  }, [
13184
13195
  t,
13185
- y,
13196
+ S,
13186
13197
  n,
13187
- g,
13188
- k
13189
- ]), z = useMemo(() => {
13190
- if (g || !_) return R;
13191
- let e = n.find((e) => e.id === _.column);
13192
- return e ? [...R].sort((t, n) => {
13198
+ _,
13199
+ Dh
13200
+ ]), zh = useMemo(() => {
13201
+ if (_ || !b) return z;
13202
+ let e = n.find((e) => e.id === b.column);
13203
+ return e ? [...z].sort((t, n) => {
13193
13204
  let i = typeof e.accessor == "function" ? e.accessor(t) : t[e.accessor], a = typeof e.accessor == "function" ? e.accessor(n) : n[e.accessor];
13194
13205
  if (i == null) return 1;
13195
13206
  if (a == null) return -1;
@@ -13201,134 +13212,159 @@ const useAdvancedTable = (e) => {
13201
13212
  let e = String(i).toLowerCase(), t = String(a).toLowerCase();
13202
13213
  o = e.localeCompare(t);
13203
13214
  }
13204
- return _.direction === "desc" ? o * -1 : o;
13205
- }) : R;
13215
+ return b.direction === "desc" ? o * -1 : o;
13216
+ }) : z;
13206
13217
  }, [
13207
- R,
13208
- _,
13218
+ z,
13219
+ b,
13209
13220
  n,
13210
- g
13211
- ]), wh = useMemo(() => {
13212
- if (g) return z;
13213
- let e = (D.page - 1) * D.pageSize, t = e + D.pageSize;
13214
- return z.slice(e, t);
13221
+ _
13222
+ ]), B = useMemo(() => {
13223
+ if (_) return zh;
13224
+ let e = (P.page - 1) * P.pageSize, t = e + P.pageSize;
13225
+ return zh.slice(e, t);
13215
13226
  }, [
13216
- z,
13217
- D.page,
13218
- D.pageSize,
13219
- g
13227
+ zh,
13228
+ P.page,
13229
+ P.pageSize,
13230
+ _
13220
13231
  ]);
13221
13232
  useEffect(() => {
13222
- g || O((e) => ({
13233
+ _ || F((e) => ({
13223
13234
  ...e,
13224
- total: R.length,
13225
- page: Math.min(e.page, Math.ceil(R.length / e.pageSize) || 1)
13235
+ total: z.length,
13236
+ page: Math.min(e.page, Math.ceil(z.length / e.pageSize) || 1)
13226
13237
  }));
13227
- }, [R.length, g]), useEffect(() => {
13228
- p?.({
13238
+ }, [z.length, _]), useEffect(() => {
13239
+ m?.({
13229
13240
  columns: n,
13230
- sort: _,
13231
- filters: y,
13232
- pagination: D,
13233
- columnOrder: x,
13234
- hiddenColumns: C,
13235
- pinnedColumns: T
13241
+ sort: b,
13242
+ filters: S,
13243
+ pagination: P,
13244
+ columnOrder: w,
13245
+ hiddenColumns: E,
13246
+ pinnedColumns: O
13236
13247
  });
13237
13248
  }, [
13238
- _,
13239
- y,
13240
- x,
13241
- C,
13242
- T,
13243
- D.pageSize,
13244
- p,
13245
- D,
13249
+ b,
13250
+ S,
13251
+ w,
13252
+ E,
13253
+ O,
13254
+ P.pageSize,
13255
+ m,
13256
+ P,
13246
13257
  n
13247
13258
  ]), useEffect(() => {
13248
- m?.(D);
13249
- }, [D, m]), useEffect(() => {
13250
- h?.(y);
13251
- }, [y, h]);
13252
- let Th = useCallback((e) => {
13253
- v((t) => t?.column === e ? t.direction === "asc" ? {
13259
+ h?.(P);
13260
+ }, [P, h]), useEffect(() => {
13261
+ g?.(S);
13262
+ }, [S, g]);
13263
+ let Bh = useCallback((e) => {
13264
+ x((t) => t?.column === e ? t.direction === "asc" ? {
13254
13265
  column: e,
13255
13266
  direction: "desc"
13256
13267
  } : void 0 : {
13257
13268
  column: e,
13258
13269
  direction: "asc"
13259
13270
  });
13260
- }, []), Eh = useCallback((e, t, n = "text") => {
13261
- b((i) => ({
13271
+ }, []), V = useCallback((e, t, n = "text") => {
13272
+ C((i) => ({
13262
13273
  ...i,
13263
13274
  [e]: {
13264
13275
  type: n,
13265
13276
  value: t,
13266
13277
  options: i[e]?.options
13267
13278
  }
13268
- })), O((e) => ({
13279
+ })), F((e) => ({
13269
13280
  ...e,
13270
13281
  page: 1
13271
13282
  }));
13272
- }, []), Dh = useCallback((e) => {
13273
- b((t) => {
13283
+ }, []), H = useCallback((e) => {
13284
+ C((t) => {
13274
13285
  let n = { ...t };
13275
13286
  return delete n[e], n;
13276
13287
  });
13277
- }, []), Oh = useCallback(() => {
13278
- b({});
13279
- }, []), kh = useCallback((e) => {
13280
- O((t) => ({
13288
+ }, []), U = useCallback(() => {
13289
+ C({});
13290
+ }, []), Vh = useCallback((e) => {
13291
+ F((t) => ({
13281
13292
  ...t,
13282
13293
  page: e
13283
13294
  }));
13284
- }, []), Ah = useCallback((e) => {
13285
- O((t) => ({
13295
+ }, []), Hh = useCallback((e) => {
13296
+ F((t) => ({
13286
13297
  ...t,
13287
13298
  pageSize: e,
13288
13299
  page: 1
13289
13300
  }));
13290
- }, []), jh = useCallback((e) => {
13291
- S(e);
13292
- }, []), B = useCallback((e) => {
13293
- w((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
13294
- }, []), Mh = useCallback((e) => {
13295
- E((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
13296
- }, []), V = useMemo(() => {
13297
- let e = new Map(n.map((e) => [e.id, e])), t = x.map((t) => e.get(t)).filter(Boolean), i = new Set(t.map((e) => e.id)), a = n.filter((e) => !i.has(e.id));
13298
- return [...t, ...a].filter((e) => !C.includes(e.id));
13301
+ }, []), W = useCallback((e) => {
13302
+ T(e);
13303
+ }, []), Uh = useCallback((e) => {
13304
+ D((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
13305
+ }, []), Wh = useCallback((e) => {
13306
+ k((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
13307
+ }, []), Gh = useCallback((e) => {
13308
+ j((t) => {
13309
+ let n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
13310
+ return y?.(n), n;
13311
+ });
13312
+ }, [y]), Kh = useCallback((e) => {
13313
+ j((t) => {
13314
+ let n = e.map((e) => typeof v == "function" ? v(e) : e[v]), i = n.every((e) => t.includes(e)), a;
13315
+ if (i) a = t.filter((e) => !n.includes(e));
13316
+ else {
13317
+ let e = n.filter((e) => !t.includes(e));
13318
+ a = [...t, ...e];
13319
+ }
13320
+ return y?.(a), a;
13321
+ });
13322
+ }, [v, y]), qh = useCallback((e, t) => {
13323
+ N((n) => ({
13324
+ ...n,
13325
+ [e]: Math.max(50, t)
13326
+ }));
13327
+ }, []), Jh = useMemo(() => {
13328
+ let e = new Map(n.map((e) => [e.id, e])), t = w.map((t) => e.get(t)).filter(Boolean), i = new Set(t.map((e) => e.id)), a = n.filter((e) => !i.has(e.id));
13329
+ return [...t, ...a].filter((e) => !E.includes(e.id));
13299
13330
  }, [
13300
- x,
13331
+ w,
13301
13332
  n,
13302
- C
13303
- ]), Nh = useCallback(() => {
13304
- I((e) => e + 1);
13333
+ E
13334
+ ]), G = useCallback(() => {
13335
+ Nh((e) => e + 1);
13305
13336
  }, []);
13306
13337
  return {
13307
13338
  state: {
13308
13339
  data: t,
13309
- filteredData: R,
13310
- paginatedData: wh,
13311
- sortConfig: _,
13312
- filters: y,
13313
- pagination: D,
13314
- columnOrder: x,
13315
- hiddenColumns: C,
13316
- pinnedColumns: T,
13317
- loading: N
13340
+ filteredData: z,
13341
+ paginatedData: B,
13342
+ sortConfig: b,
13343
+ filters: S,
13344
+ pagination: P,
13345
+ columnOrder: w,
13346
+ hiddenColumns: E,
13347
+ pinnedColumns: O,
13348
+ selectedRows: A,
13349
+ columnWidths: M,
13350
+ loading: Ah
13318
13351
  },
13319
- orderedColumns: V,
13320
- pageSizeOptions: d,
13321
- handleSort: Th,
13322
- handleFilter: Eh,
13323
- clearFilter: Dh,
13324
- clearAllFilters: Oh,
13325
- handlePageChange: kh,
13326
- handlePageSizeChange: Ah,
13327
- handleColumnReorder: jh,
13328
- handleToggleColumn: B,
13329
- handleTogglePin: Mh,
13352
+ orderedColumns: Jh,
13353
+ pageSizeOptions: f,
13354
+ handleSort: Bh,
13355
+ handleFilter: V,
13356
+ clearFilter: H,
13357
+ clearAllFilters: U,
13358
+ handlePageChange: Vh,
13359
+ handlePageSizeChange: Hh,
13360
+ handleColumnReorder: W,
13361
+ handleToggleColumn: Uh,
13362
+ handleTogglePin: Wh,
13363
+ handleRowSelect: Gh,
13364
+ handleSelectAll: Kh,
13365
+ handleColumnResize: qh,
13330
13366
  allColumns: n,
13331
- refresh: Nh
13367
+ refresh: G
13332
13368
  };
13333
13369
  };
13334
13370
  var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilters: i = {}, defaultPageSize: a = 10, pageSizeOptions: u = [
@@ -13353,8 +13389,8 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13353
13389
  },
13354
13390
  clearAllFilters: "Limpiar todos los filtros",
13355
13391
  noData: "No hay datos disponibles"
13356
- }, enableColumnReordering: A = !0, enableColumnPinning: j = !1, renderActions: M, actionsColumnLabel: N, loading: P = !1, fetchData: F, onRefresh: I, onPaginationChange: L, onFiltersChange: R }) => {
13357
- let [z, wh] = useState(null), [Th, Eh] = useState(null), [Dh, Oh] = useState(!1), [kh, Ah] = useState(null), jh = useRef(null), [B, Mh] = useState(t), { state: V, orderedColumns: Nh, handleSort: Ph, handleFilter: Fh, clearAllFilters: Ih, handlePageChange: H, handlePageSizeChange: U, handleColumnReorder: Lh, handleToggleColumn: Rh, handleTogglePin: zh, refresh: Bh } = useAdvancedTable({
13392
+ }, enableColumnReordering: A = !0, enableColumnPinning: j = !1, enableColumnResizing: M = !1, enableRowSelection: N = !1, stickyActionsColumn: P = !1, rowKey: F = "id", onRowSelectionChange: Dh, renderActions: I, actionsColumnLabel: Oh, loading: kh = !1, fetchData: Ah, onRefresh: jh, onPaginationChange: Mh, onFiltersChange: Nh }) => {
13393
+ let [Ph, Fh] = useState(null), [Ih, L] = useState(null), [Lh, Rh] = useState(!1), [R, z] = useState(null), zh = useRef(null), [B, Bh] = useState(t), { state: V, orderedColumns: H, handleSort: U, handleFilter: Vh, clearAllFilters: Hh, handlePageChange: W, handlePageSizeChange: Uh, handleColumnReorder: Wh, handleToggleColumn: Gh, handleTogglePin: Kh, handleRowSelect: qh, handleSelectAll: Jh, handleColumnResize: G, refresh: Yh } = useAdvancedTable({
13358
13394
  data: e,
13359
13395
  columns: B,
13360
13396
  defaultSort: n,
@@ -13363,18 +13399,42 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13363
13399
  pageSizeOptions: u,
13364
13400
  initialConfig: E,
13365
13401
  onConfigChange: D,
13366
- fetchData: F,
13367
- onPaginationChange: L,
13368
- onFiltersChange: R
13369
- }), { paginatedData: Vh, sortConfig: Hh, filters: W, pagination: G, hiddenColumns: Uh, pinnedColumns: K, loading: q } = V, Wh = P || q;
13370
- useEffect(() => Mh(t), [t]);
13371
- let J = useMemo(() => {
13372
- let e = [...Nh], t = e.filter((e) => e.isAction), n = [...e.filter((e) => !e.isAction), ...t];
13373
- return M && n.push({
13402
+ fetchData: Ah,
13403
+ onPaginationChange: Mh,
13404
+ onFiltersChange: Nh,
13405
+ rowKey: F,
13406
+ onRowSelectionChange: Dh
13407
+ }), { paginatedData: K, sortConfig: q, filters: J, pagination: Y, hiddenColumns: Xh, pinnedColumns: X, selectedRows: Zh, columnWidths: Qh, loading: $h } = V, eg = kh || $h;
13408
+ useEffect(() => Bh(t), [t]);
13409
+ let Z = useMemo(() => {
13410
+ let e = [...H], t = e.filter((e) => e.isAction), n = [...e.filter((e) => !e.isAction), ...t];
13411
+ return N && n.unshift({
13412
+ id: "selection-synthetic",
13413
+ label: "",
13414
+ accessor: (e) => e[F],
13415
+ width: 50,
13416
+ minWidth: 50,
13417
+ render: ({ row: e }) => {
13418
+ let t = e[F];
13419
+ return /* @__PURE__ */ jsx("input", {
13420
+ type: "checkbox",
13421
+ className: "w-4 h-4 accent-redi-primary cursor-pointer",
13422
+ checked: Zh.includes(t),
13423
+ onChange: (e) => {
13424
+ e.stopPropagation(), qh(t);
13425
+ },
13426
+ onClick: (e) => e.stopPropagation()
13427
+ });
13428
+ },
13429
+ isAction: !1,
13430
+ filterable: !1,
13431
+ sortable: !1,
13432
+ draggable: !1
13433
+ }), I && n.push({
13374
13434
  id: "actions-synthetic",
13375
- label: N || "",
13376
- accessor: (e) => e,
13377
- render: ({ row: e, column: t, index: n }) => M({
13435
+ label: Oh || "",
13436
+ accessor: (e) => e[F],
13437
+ render: ({ row: e, column: t, index: n }) => I({
13378
13438
  row: e,
13379
13439
  index: n,
13380
13440
  column: t
@@ -13386,33 +13446,56 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13386
13446
  draggable: !1
13387
13447
  }), n;
13388
13448
  }, [
13389
- Nh,
13390
- M,
13391
- N
13392
- ]), Y = (e, t) => {
13393
- wh(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", "");
13394
- }, Gh = (e, t) => {
13395
- e.preventDefault(), e.dataTransfer.dropEffect = "move", Eh(t);
13396
- }, Kh = () => {
13397
- Eh(null);
13398
- }, qh = (e, t) => {
13399
- if (e.preventDefault(), z === null) return;
13400
- let n = J[z].id, i = J[t].id;
13449
+ H,
13450
+ I,
13451
+ Oh,
13452
+ N,
13453
+ Zh,
13454
+ F,
13455
+ qh
13456
+ ]), tg = useRef(null);
13457
+ useEffect(() => {
13458
+ let e = (e) => {
13459
+ if (!tg.current) return;
13460
+ let { columnId: t, startX: n, startWidth: i } = tg.current, a = e.clientX - n;
13461
+ G(t, i + a);
13462
+ }, t = () => {
13463
+ tg.current = null, document.body.style.cursor = "default", document.body.style.userSelect = "auto";
13464
+ };
13465
+ if (M) return document.addEventListener("mousemove", e), document.addEventListener("mouseup", t), () => {
13466
+ document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", t);
13467
+ };
13468
+ }, [M, G]);
13469
+ let ng = (e, t, n) => {
13470
+ e.preventDefault(), e.stopPropagation(), tg.current = {
13471
+ columnId: t,
13472
+ startX: e.clientX,
13473
+ startWidth: n
13474
+ }, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
13475
+ }, rg = (e, t) => {
13476
+ Fh(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", "");
13477
+ }, ig = (e, t) => {
13478
+ e.preventDefault(), e.dataTransfer.dropEffect = "move", L(t);
13479
+ }, ag = () => {
13480
+ L(null);
13481
+ }, og = (e, t) => {
13482
+ if (e.preventDefault(), Ph === null) return;
13483
+ let n = Z[Ph].id, i = Z[t].id;
13401
13484
  if (n === i) {
13402
- wh(null), Eh(null);
13485
+ Fh(null), L(null);
13403
13486
  return;
13404
13487
  }
13405
13488
  let a = e.currentTarget.getBoundingClientRect(), o = e.clientX - a.left > a.width / 2, s = [...V.columnOrder], c = s.indexOf(n), l = s.indexOf(i);
13406
- c === -1 || l === -1 || (s.splice(c, 1), l = s.indexOf(i), o ? s.splice(l + 1, 0, n) : s.splice(l, 0, n), Lh(s), wh(null), Eh(null));
13407
- }, X = () => {
13408
- wh(null), Eh(null);
13409
- }, Jh = () => {
13489
+ c === -1 || l === -1 || (s.splice(c, 1), l = s.indexOf(i), o ? s.splice(l + 1, 0, n) : s.splice(l, 0, n), Wh(s), Fh(null), L(null));
13490
+ }, sg = () => {
13491
+ Fh(null), L(null);
13492
+ }, cg = () => {
13410
13493
  if (!T) return;
13411
- let e = J.filter((e) => !e.isAction);
13494
+ let e = Z.filter((e) => !e.isAction);
13412
13495
  exportToExcel(V.filteredData, e, "table-data.xlsx");
13413
- }, Yh = (e) => {
13414
- Ah(kh === e ? null : e);
13415
- }, Xh = (t) => {
13496
+ }, lg = (e) => {
13497
+ z(R === e ? null : e);
13498
+ }, ug = (t) => {
13416
13499
  let n = B.find((e) => e.id === t);
13417
13500
  if (!n) return [];
13418
13501
  let i = /* @__PURE__ */ new Map();
@@ -13424,16 +13507,16 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13424
13507
  count: t,
13425
13508
  label: `${e} (${t})`
13426
13509
  })).sort((e, t) => e.value.localeCompare(t.value));
13427
- }, Zh = Object.values(W).some((e) => e.type === "text" && e.value || e.type === "select" && e.value || e.type === "multiselect" && Array.isArray(e.value) && e.value.length > 0);
13510
+ }, dg = Object.values(J).some((e) => e.type === "text" && e.value || e.type === "select" && e.value || e.type === "multiselect" && Array.isArray(e.value) && e.value.length > 0);
13428
13511
  useEffect(() => {
13429
13512
  let e = (e) => {
13430
- jh.current && !jh.current.contains(e.target) && Oh(!1);
13513
+ zh.current && !zh.current.contains(e.target) && Rh(!1);
13431
13514
  };
13432
- return Dh && document.addEventListener("mousedown", e), () => {
13515
+ return Lh && document.addEventListener("mousedown", e), () => {
13433
13516
  document.removeEventListener("mousedown", e);
13434
13517
  };
13435
- }, [Dh]);
13436
- let Z = Math.ceil(G.total / G.pageSize), Q = (e) => e.width ? e.width : e.isAction ? 100 : 150 + (e.filterable ? 50 : 0);
13518
+ }, [Lh]);
13519
+ let Q = Math.ceil(Y.total / Y.pageSize), fg = (e) => Qh[e.id] ? Qh[e.id] : e.width ? e.width : e.isAction ? 100 : 150 + (e.filterable ? 50 : 0);
13437
13520
  return /* @__PURE__ */ jsxs("div", {
13438
13521
  className: `w-full bg-redi-background border border-solid border-gray-500 rounded-xl overflow-hidden font-family-base shadow ${O}`,
13439
13522
  children: [
@@ -13442,26 +13525,26 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13442
13525
  children: [/* @__PURE__ */ jsxs("div", {
13443
13526
  className: "flex items-center gap-2",
13444
13527
  children: [
13445
- (F || I) && /* @__PURE__ */ jsx(Button_default, {
13528
+ (Ah || jh) && /* @__PURE__ */ jsx(Button_default, {
13446
13529
  level: "secondary",
13447
13530
  onClick: () => {
13448
- Bh(), I?.();
13531
+ Yh(), jh?.();
13449
13532
  },
13450
- loading: Wh,
13533
+ loading: eg,
13451
13534
  children: /* @__PURE__ */ jsx(RefreshIcon, { size: 18 })
13452
13535
  }),
13453
13536
  /* @__PURE__ */ jsxs("div", {
13454
13537
  className: "relative",
13455
13538
  children: [/* @__PURE__ */ jsxs(Button_default, {
13456
13539
  level: "secondary",
13457
- onClick: () => Oh(!Dh),
13540
+ onClick: () => Rh(!Lh),
13458
13541
  children: [/* @__PURE__ */ jsx(EyeIcon, {}), /* @__PURE__ */ jsx("span", {
13459
13542
  className: "hidden md:block",
13460
13543
  children: k.configuration
13461
13544
  })]
13462
- }), Dh && /* @__PURE__ */ jsx("div", {
13545
+ }), Lh && /* @__PURE__ */ jsx("div", {
13463
13546
  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",
13464
- ref: jh,
13547
+ ref: zh,
13465
13548
  children: /* @__PURE__ */ jsxs("div", {
13466
13549
  className: "mb-4 last:mb-0",
13467
13550
  children: [/* @__PURE__ */ jsx("div", {
@@ -13470,7 +13553,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13470
13553
  }), /* @__PURE__ */ jsx("div", {
13471
13554
  className: "flex flex-col gap-2",
13472
13555
  children: B.filter((e) => !e.isAction).map((e) => {
13473
- let t = !Uh.includes(e.id);
13556
+ let t = !Xh.includes(e.id);
13474
13557
  return /* @__PURE__ */ jsxs("div", {
13475
13558
  className: "flex items-center justify-between gap-2 hover:bg-gray-50 p-1 rounded",
13476
13559
  children: [/* @__PURE__ */ jsxs("div", {
@@ -13479,7 +13562,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13479
13562
  type: "checkbox",
13480
13563
  className: "w-4 h-4 accent-redi-primary cursor-pointer",
13481
13564
  checked: t,
13482
- onChange: () => Rh(e.id),
13565
+ onChange: () => Gh(e.id),
13483
13566
  id: `col-visibility-${e.id}`
13484
13567
  }), /* @__PURE__ */ jsx("label", {
13485
13568
  htmlFor: `col-visibility-${e.id}`,
@@ -13492,11 +13575,11 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13492
13575
  j && /* @__PURE__ */ jsx(Button_default, {
13493
13576
  level: "icon",
13494
13577
  onClick: (t) => {
13495
- t.stopPropagation(), zh(e.id);
13578
+ t.stopPropagation(), Kh(e.id);
13496
13579
  },
13497
- "aria-label": K.includes(e.id) ? "Unpin column" : "Pin column",
13580
+ "aria-label": X.includes(e.id) ? "Unpin column" : "Pin column",
13498
13581
  className: "p-1 hover:bg-gray-200 rounded-full",
13499
- children: K.includes(e.id) ? /* @__PURE__ */ jsx(PinIcon, {
13582
+ children: X.includes(e.id) ? /* @__PURE__ */ jsx(PinIcon, {
13500
13583
  size: 14,
13501
13584
  className: "text-redi-primary"
13502
13585
  }) : /* @__PURE__ */ jsx(PinOffIcon, {
@@ -13512,7 +13595,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13512
13595
  ...t,
13513
13596
  draggable: !t.draggable
13514
13597
  } : t);
13515
- Mh(n);
13598
+ Bh(n);
13516
13599
  },
13517
13600
  "aria-label": e.draggable ? "Disable drag" : "Enable drag",
13518
13601
  className: "p-1 hover:bg-gray-200 rounded-full",
@@ -13530,7 +13613,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13530
13613
  ...t,
13531
13614
  filterable: !t.filterable
13532
13615
  } : t);
13533
- Mh(n);
13616
+ Bh(n);
13534
13617
  },
13535
13618
  "aria-label": e.filterable ? "Disable filter" : "Enable filter",
13536
13619
  className: "p-1 hover:bg-gray-200 rounded-full",
@@ -13550,9 +13633,9 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13550
13633
  })
13551
13634
  })]
13552
13635
  }),
13553
- C && Zh && /* @__PURE__ */ jsx(Button_default, {
13636
+ C && dg && /* @__PURE__ */ jsx(Button_default, {
13554
13637
  level: "icon",
13555
- onClick: Ih,
13638
+ onClick: Hh,
13556
13639
  label: k.clearAllFilters,
13557
13640
  children: /* @__PURE__ */ jsx(CloseIcon, { color: "white" })
13558
13641
  })
@@ -13561,7 +13644,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13561
13644
  className: "flex items-center gap-2",
13562
13645
  children: T && /* @__PURE__ */ jsx(Button_default, {
13563
13646
  level: "secondary",
13564
- onClick: Jh,
13647
+ onClick: cg,
13565
13648
  children: /* @__PURE__ */ jsx(DownloadIcon, { size: 18 })
13566
13649
  })
13567
13650
  })]
@@ -13571,9 +13654,9 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13571
13654
  children: /* @__PURE__ */ jsxs("table", {
13572
13655
  className: "w-full border-separate border-spacing-0 table-auto text-sm relative",
13573
13656
  "aria-label": "Data Table",
13574
- children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: J.map((e, t) => {
13575
- let n = Q(e), i = K.includes(e.id), a = 0;
13576
- if (i) for (let e = 0; e < t; e++) K.includes(J[e].id) && (a += Q(J[e]));
13657
+ children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: Z.map((e, t) => {
13658
+ let n = fg(e), i = X.includes(e.id), a = 0;
13659
+ if (i) for (let e = 0; e < t; e++) X.includes(Z[e].id) && (a += fg(Z[e]));
13577
13660
  let o = {
13578
13661
  width: n,
13579
13662
  minWidth: n,
@@ -13587,72 +13670,90 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13587
13670
  };
13588
13671
  return /* @__PURE__ */ jsx("th", {
13589
13672
  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
13590
- ${z === t ? "opacity-50 bg-gray-300" : ""}
13591
- ${Th === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
13592
- ${Th === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
13673
+ ${Ph === t ? "opacity-50 bg-gray-300" : ""}
13674
+ ${Ih === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
13675
+ ${Ih === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
13593
13676
  ${i ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
13594
13677
  `,
13595
13678
  style: o,
13596
13679
  draggable: !e.isAction && A && (e.draggable ?? !1),
13597
- onDragStart: (n) => !e.isAction && A && (e.draggable ?? !1) && Y(n, t),
13598
- onDragOver: (n) => !e.isAction && A && Gh(n, t),
13599
- onDragLeave: Kh,
13600
- onDrop: (n) => !e.isAction && A && qh(n, t),
13601
- onDragEnd: X,
13602
- "aria-sort": Hh?.column === e.id ? Hh.direction === "asc" ? "ascending" : "descending" : "none",
13680
+ onDragStart: (n) => !e.isAction && A && (e.draggable ?? !1) && rg(n, t),
13681
+ onDragOver: (n) => !e.isAction && A && ig(n, t),
13682
+ onDragLeave: ag,
13683
+ onDrop: (n) => !e.isAction && A && og(n, t),
13684
+ onDragEnd: sg,
13685
+ "aria-sort": q?.column === e.id ? q.direction === "asc" ? "ascending" : "descending" : "none",
13603
13686
  children: /* @__PURE__ */ jsxs("div", {
13604
13687
  className: "flex items-center py-3 px-4 gap-2 min-h-12",
13605
- children: [!e.isAction && A && (e.draggable ?? !1) && /* @__PURE__ */ jsx("div", {
13606
- className: "text-gray-600 cursor-grab opacity-70 hover:opacity-100 text-base",
13607
- "aria-hidden": "true",
13608
- children: "⋮⋮"
13609
- }), /* @__PURE__ */ jsxs("div", {
13610
- className: "flex flex-1 items-center gap-2",
13611
- children: [/* @__PURE__ */ jsxs("span", {
13612
- 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" : "",
13613
- onClick: (t) => {
13614
- t.stopPropagation(), e.sortable && Ph(e.id);
13615
- },
13616
- role: "button",
13617
- tabIndex: 0,
13618
- onKeyDown: (t) => {
13619
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), e.sortable && Ph(e.id));
13620
- },
13621
- children: [e.label, e.sortable && Hh?.column === e.id && /* @__PURE__ */ jsx("span", {
13622
- className: "font-bold text-redi-link-text text-base",
13623
- children: Hh.direction === "asc" ? " " : " ↓"
13624
- })]
13625
- }), /* @__PURE__ */ jsx("div", {
13626
- className: "flex items-center gap-1",
13627
- children: e.filterable && /* @__PURE__ */ jsxs("div", {
13628
- className: "relative",
13629
- children: [/* @__PURE__ */ jsx(Button_default, {
13630
- level: "icon",
13631
- onClick: (t) => {
13632
- t.stopPropagation(), Yh(e.id);
13633
- },
13634
- "aria-label": `Filter by ${e.label}`,
13635
- children: /* @__PURE__ */ jsx(FilterIcon, { size: 16 })
13636
- }), kh === e.id && /* @__PURE__ */ jsx(AdvancedFilter_default, {
13637
- columnId: e.id,
13638
- label: e.label,
13639
- options: Xh(e.id),
13640
- textValue: W[e.id]?.type === "text" ? String(W[e.id].value || "") : "",
13641
- selectedValues: W[e.id]?.type === "multiselect" && Array.isArray(W[e.id]?.value) ? W[e.id].value : [],
13642
- onTextChange: (t) => Fh(e.id, t, "text"),
13643
- onSelectionChange: (t) => Fh(e.id, t, "multiselect"),
13644
- onClose: () => Ah(null)
13688
+ children: [
13689
+ !e.isAction && A && (e.draggable ?? !1) && /* @__PURE__ */ jsx("div", {
13690
+ className: "text-gray-600 cursor-grab opacity-70 hover:opacity-100 text-base",
13691
+ "aria-hidden": "true",
13692
+ children: "⋮⋮"
13693
+ }),
13694
+ e.id === "selection-synthetic" && /* @__PURE__ */ jsx("input", {
13695
+ type: "checkbox",
13696
+ className: "w-4 h-4 accent-redi-primary cursor-pointer mr-2",
13697
+ checked: K.length > 0 && K.every((e) => {
13698
+ let t = typeof F == "function" ? F(e) : e[F];
13699
+ return Zh.includes(t);
13700
+ }),
13701
+ onChange: (e) => {
13702
+ e.stopPropagation(), Jh(K);
13703
+ }
13704
+ }),
13705
+ /* @__PURE__ */ jsxs("div", {
13706
+ className: "flex flex-1 items-center gap-2",
13707
+ children: [/* @__PURE__ */ jsxs("span", {
13708
+ 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" : "",
13709
+ onClick: (t) => {
13710
+ t.stopPropagation(), e.sortable && U(e.id);
13711
+ },
13712
+ role: "button",
13713
+ tabIndex: 0,
13714
+ onKeyDown: (t) => {
13715
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), e.sortable && U(e.id));
13716
+ },
13717
+ children: [e.label, e.sortable && q?.column === e.id && /* @__PURE__ */ jsx("span", {
13718
+ className: "font-bold text-redi-link-text text-base",
13719
+ children: q.direction === "asc" ? " ↑" : " ↓"
13645
13720
  })]
13646
- })
13647
- })]
13648
- })]
13721
+ }), /* @__PURE__ */ jsx("div", {
13722
+ className: "flex items-center gap-1",
13723
+ children: e.filterable && /* @__PURE__ */ jsxs("div", {
13724
+ className: "relative",
13725
+ children: [/* @__PURE__ */ jsx(Button_default, {
13726
+ level: "icon",
13727
+ onClick: (t) => {
13728
+ t.stopPropagation(), lg(e.id);
13729
+ },
13730
+ "aria-label": `Filter by ${e.label}`,
13731
+ children: /* @__PURE__ */ jsx(FilterIcon, { size: 16 })
13732
+ }), R === e.id && /* @__PURE__ */ jsx(AdvancedFilter_default, {
13733
+ columnId: e.id,
13734
+ label: e.label,
13735
+ options: ug(e.id),
13736
+ textValue: J[e.id]?.type === "text" ? String(J[e.id].value || "") : "",
13737
+ selectedValues: J[e.id]?.type === "multiselect" && Array.isArray(J[e.id]?.value) ? J[e.id].value : [],
13738
+ onTextChange: (t) => Vh(e.id, t, "text"),
13739
+ onSelectionChange: (t) => Vh(e.id, t, "multiselect"),
13740
+ onClose: () => z(null)
13741
+ })]
13742
+ })
13743
+ })]
13744
+ }),
13745
+ M && !e.isAction && e.id !== "selection-synthetic" && /* @__PURE__ */ jsx("div", {
13746
+ className: "absolute right-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-redi-primary z-20",
13747
+ onMouseDown: (t) => ng(t, e.id, n)
13748
+ })
13749
+ ]
13649
13750
  })
13650
13751
  }, e.id);
13651
- }) }) }), /* @__PURE__ */ jsx("tbody", { children: P ? Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ jsx("tr", {
13752
+ }) }) }), /* @__PURE__ */ jsx("tbody", { children: kh ? Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ jsx("tr", {
13652
13753
  className: "border-b border-solid border-gray-100",
13653
- children: J.map((e, t) => {
13654
- let n = Q(e), i = K.includes(e.id), a = 0;
13655
- if (i) for (let e = 0; e < t; e++) K.includes(J[e].id) && (a += Q(J[e]));
13754
+ children: Z.map((e, t) => {
13755
+ let n = fg(e), i = X.includes(e.id), a = 0;
13756
+ if (i) for (let e = 0; e < t; e++) X.includes(Z[e].id) && (a += fg(Z[e]));
13656
13757
  let o = {
13657
13758
  width: n,
13658
13759
  minWidth: n,
@@ -13670,29 +13771,36 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13670
13771
  children: /* @__PURE__ */ jsx("div", { className: "h-4 bg-gray-200 rounded animate-pulse w-3/4" })
13671
13772
  }, `skeleton-cell-${t}`);
13672
13773
  })
13673
- }, `skeleton-${t}`)) : Vh.length > 0 ? Vh.map((e, t) => /* @__PURE__ */ jsx("tr", {
13774
+ }, `skeleton-${t}`)) : K.length > 0 ? K.map((e, t) => /* @__PURE__ */ jsx("tr", {
13674
13775
  className: "even:bg-gray-50 hover:bg-gray-100 border-b border-solid border-b-gray-100 odd:bg-white",
13675
- children: J.map((n, i) => {
13676
- let a = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], o = n.isAction, s = Q(n), c = K.includes(n.id), l = 0;
13677
- if (c) for (let e = 0; e < i; e++) K.includes(J[e].id) && (l += Q(J[e]));
13678
- let u = `py-3 px-4 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
13679
- ${o ? "border-l border-gray-300 shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.05)]" : ""}
13776
+ children: Z.map((n, i) => {
13777
+ let a = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], o = n.isAction, s = fg(n), c = X.includes(n.id), l = o && P, u = 0;
13778
+ if (c) for (let e = 0; e < i; e++) X.includes(Z[e].id) && (u += fg(Z[e]));
13779
+ let f = `py-3 px-4 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
13780
+ ${o ? "border-l border-gray-300" : ""}
13680
13781
  ${c ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
13681
- `, f = {
13782
+ `, p = {
13682
13783
  width: s,
13683
13784
  minWidth: s,
13684
13785
  maxWidth: s,
13685
13786
  overflowWrap: "break-word",
13686
13787
  ...c ? {
13687
13788
  position: "sticky",
13688
- left: l,
13789
+ left: u,
13689
13790
  zIndex: 10,
13690
13791
  backgroundColor: "inherit"
13792
+ } : {},
13793
+ ...l ? {
13794
+ position: "sticky",
13795
+ right: 0,
13796
+ zIndex: 15,
13797
+ backgroundColor: "inherit",
13798
+ boxShadow: "-2px 0 5px -2px rgba(0,0,0,0.1)"
13691
13799
  } : {}
13692
13800
  };
13693
13801
  return n.render ? /* @__PURE__ */ jsx("td", {
13694
- className: u,
13695
- style: f,
13802
+ className: f,
13803
+ style: p,
13696
13804
  children: n.render({
13697
13805
  value: a,
13698
13806
  row: e,
@@ -13700,13 +13808,13 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13700
13808
  index: t
13701
13809
  })
13702
13810
  }, n.id) : /* @__PURE__ */ jsx("td", {
13703
- className: u,
13704
- style: f,
13811
+ className: f,
13812
+ style: p,
13705
13813
  children: formatCellValue(a)
13706
13814
  }, n.id);
13707
13815
  })
13708
13816
  }, t)) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
13709
- colSpan: J.length,
13817
+ colSpan: Z.length,
13710
13818
  className: "py-12 text-center text-gray-500",
13711
13819
  children: /* @__PURE__ */ jsxs("div", {
13712
13820
  className: "flex flex-col items-center justify-center gap-2",
@@ -13736,15 +13844,15 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13736
13844
  children: /* @__PURE__ */ jsxs("span", { children: [
13737
13845
  k.pagination?.showingItems,
13738
13846
  " ",
13739
- (G.page - 1) * G.pageSize + 1,
13847
+ (Y.page - 1) * Y.pageSize + 1,
13740
13848
  " ",
13741
13849
  k.pagination?.to,
13742
13850
  " ",
13743
- Math.min(G.page * G.pageSize, G.total),
13851
+ Math.min(Y.page * Y.pageSize, Y.total),
13744
13852
  " ",
13745
13853
  k.pagination?.of,
13746
13854
  " ",
13747
- G.total,
13855
+ Y.total,
13748
13856
  " ",
13749
13857
  k.pagination?.items
13750
13858
  ] })
@@ -13755,8 +13863,8 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13755
13863
  children: [
13756
13864
  k.pagination?.showPerPage,
13757
13865
  /* @__PURE__ */ jsx("select", {
13758
- value: G.pageSize,
13759
- onChange: (e) => U(Number(e.target.value)),
13866
+ value: Y.pageSize,
13867
+ onChange: (e) => Uh(Number(e.target.value)),
13760
13868
  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",
13761
13869
  children: u.map((e) => /* @__PURE__ */ jsx("option", {
13762
13870
  value: e,
@@ -13770,34 +13878,34 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13770
13878
  children: [
13771
13879
  /* @__PURE__ */ jsx(Button_default, {
13772
13880
  level: "icon",
13773
- onClick: () => H(1),
13774
- disabled: G.page === 1,
13881
+ onClick: () => W(1),
13882
+ disabled: Y.page === 1,
13775
13883
  children: "<<"
13776
13884
  }),
13777
13885
  /* @__PURE__ */ jsx(Button_default, {
13778
13886
  level: "icon",
13779
- onClick: () => H(G.page - 1),
13780
- disabled: G.page === 1,
13887
+ onClick: () => W(Y.page - 1),
13888
+ disabled: Y.page === 1,
13781
13889
  children: "<"
13782
13890
  }),
13783
- Array.from({ length: Math.min(3, Z) }, (e, t) => {
13891
+ Array.from({ length: Math.min(3, Q) }, (e, t) => {
13784
13892
  let n;
13785
- return n = Z <= 3 || G.page <= 2 ? t + 1 : G.page > Z - 2 ? Z - 2 + t : G.page - 1 + t, /* @__PURE__ */ jsx(Button_default, {
13786
- level: G.page === n ? "primary" : "secondary",
13787
- onClick: () => H(n),
13893
+ return n = Q <= 3 || Y.page <= 2 ? t + 1 : Y.page > Q - 2 ? Q - 2 + t : Y.page - 1 + t, /* @__PURE__ */ jsx(Button_default, {
13894
+ level: Y.page === n ? "primary" : "secondary",
13895
+ onClick: () => W(n),
13788
13896
  children: n
13789
13897
  }, n);
13790
13898
  }),
13791
13899
  /* @__PURE__ */ jsx(Button_default, {
13792
13900
  level: "icon",
13793
- onClick: () => H(G.page + 1),
13794
- disabled: G.page === Z,
13901
+ onClick: () => W(Y.page + 1),
13902
+ disabled: Y.page === Q,
13795
13903
  children: ">"
13796
13904
  }),
13797
13905
  /* @__PURE__ */ jsx(Button_default, {
13798
13906
  level: "icon",
13799
- onClick: () => H(Z),
13800
- disabled: G.page === Z,
13907
+ onClick: () => W(Q),
13908
+ disabled: Y.page === Q,
13801
13909
  children: ">>"
13802
13910
  })
13803
13911
  ]
@@ -13806,6 +13914,284 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13806
13914
  })
13807
13915
  ]
13808
13916
  });
13917
+ }, Sparkline = ({ data: e, color: t = "currentColor", height: n = 40 }) => {
13918
+ if (!e || e.length < 2) return null;
13919
+ let i = Math.max(...e), a = Math.min(...e), o = i - a || 1, s = e.map((t, i) => {
13920
+ let s = i / (e.length - 1) * 100, c = n - (t - a) / o * n;
13921
+ return `${s},${c}`;
13922
+ }).join(" "), c = `0,${n} ${s} 100,${n}`;
13923
+ return /* @__PURE__ */ jsxs("svg", {
13924
+ viewBox: `0 0 100 ${n}`,
13925
+ className: "w-full h-full overflow-visible",
13926
+ preserveAspectRatio: "none",
13927
+ children: [
13928
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", {
13929
+ id: `gradient-${t}`,
13930
+ x1: "0",
13931
+ x2: "0",
13932
+ y1: "0",
13933
+ y2: "1",
13934
+ children: [/* @__PURE__ */ jsx("stop", {
13935
+ offset: "0%",
13936
+ stopColor: t,
13937
+ stopOpacity: "0.2"
13938
+ }), /* @__PURE__ */ jsx("stop", {
13939
+ offset: "100%",
13940
+ stopColor: t,
13941
+ stopOpacity: "0"
13942
+ })]
13943
+ }) }),
13944
+ /* @__PURE__ */ jsx("polygon", {
13945
+ points: c,
13946
+ fill: `url(#gradient-${t})`
13947
+ }),
13948
+ /* @__PURE__ */ jsx("polyline", {
13949
+ points: s,
13950
+ fill: "none",
13951
+ stroke: t,
13952
+ strokeWidth: "2",
13953
+ vectorEffect: "non-scaling-stroke",
13954
+ strokeLinecap: "round",
13955
+ strokeLinejoin: "round"
13956
+ })
13957
+ ]
13958
+ });
13959
+ }, CircularProgress = ({ progress: e, color: t = "currentColor", size: n = 60 }) => {
13960
+ let i = 2 * Math.PI * 26, a = i - e / 100 * i;
13961
+ return /* @__PURE__ */ jsxs("svg", {
13962
+ width: n,
13963
+ height: n,
13964
+ viewBox: "0 0 60 60",
13965
+ className: "transform -rotate-90",
13966
+ children: [/* @__PURE__ */ jsx("circle", {
13967
+ cx: "30",
13968
+ cy: "30",
13969
+ r: 26,
13970
+ stroke: "#e5e7eb",
13971
+ strokeWidth: "6",
13972
+ fill: "transparent"
13973
+ }), /* @__PURE__ */ jsx("circle", {
13974
+ cx: "30",
13975
+ cy: "30",
13976
+ r: 26,
13977
+ stroke: t,
13978
+ strokeWidth: "6",
13979
+ fill: "transparent",
13980
+ strokeDasharray: i,
13981
+ strokeDashoffset: a,
13982
+ strokeLinecap: "round"
13983
+ })]
13984
+ });
13985
+ }, 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 = "" }) => {
13986
+ 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";
13987
+ return e === "simple" ? /* @__PURE__ */ jsxs("div", {
13988
+ className: `${v} ${h}`,
13989
+ children: [/* @__PURE__ */ jsx("p", {
13990
+ className: "text-sm text-gray-500 font-medium mb-1",
13991
+ children: t
13992
+ }), /* @__PURE__ */ jsx("h3", {
13993
+ className: "text-2xl font-bold text-gray-900",
13994
+ children: n
13995
+ })]
13996
+ }) : e === "chart" ? /* @__PURE__ */ jsxs("div", {
13997
+ className: `${v} ${h}`,
13998
+ children: [/* @__PURE__ */ jsxs("div", {
13999
+ className: "relative z-10",
14000
+ children: [/* @__PURE__ */ jsx("p", {
14001
+ className: "text-sm text-gray-500 font-medium mb-1",
14002
+ children: t
14003
+ }), /* @__PURE__ */ jsx("h3", {
14004
+ className: "text-2xl font-bold text-gray-900",
14005
+ children: n
14006
+ })]
14007
+ }), /* @__PURE__ */ jsx("div", {
14008
+ className: "absolute bottom-0 left-0 right-0 h-12 opacity-50",
14009
+ children: l && /* @__PURE__ */ jsx(Sparkline, {
14010
+ data: l,
14011
+ color: y
14012
+ })
14013
+ })]
14014
+ }) : e === "trend" ? /* @__PURE__ */ jsxs("div", {
14015
+ className: `${v} ${h}`,
14016
+ children: [/* @__PURE__ */ jsx("p", {
14017
+ className: "text-sm text-gray-500 font-medium mb-1",
14018
+ children: t
14019
+ }), /* @__PURE__ */ jsxs("div", {
14020
+ className: "flex items-baseline justify-between",
14021
+ children: [/* @__PURE__ */ jsx("h3", {
14022
+ className: "text-2xl font-bold text-gray-900",
14023
+ children: n
14024
+ }), a && /* @__PURE__ */ jsxs("span", {
14025
+ className: `flex items-center text-sm font-medium ${g} bg-opacity-10 px-2 py-0.5 rounded-full`,
14026
+ children: [/* @__PURE__ */ jsx("span", {
14027
+ className: "mr-1",
14028
+ children: _
14029
+ }), a]
14030
+ })]
14031
+ })]
14032
+ }) : e === "progress" ? /* @__PURE__ */ jsxs("div", {
14033
+ className: `${v} ${h}`,
14034
+ children: [/* @__PURE__ */ jsxs("div", {
14035
+ className: "flex justify-between items-end mb-2",
14036
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
14037
+ className: "text-sm text-gray-500 font-medium mb-1",
14038
+ children: t
14039
+ }), /* @__PURE__ */ jsx("h3", {
14040
+ className: "text-2xl font-bold text-gray-900",
14041
+ children: n
14042
+ })] }), /* @__PURE__ */ jsxs("span", {
14043
+ className: "text-sm font-medium text-gray-500",
14044
+ children: [i, "%"]
14045
+ })]
14046
+ }), /* @__PURE__ */ jsx("div", {
14047
+ className: "w-full bg-gray-100 rounded-full h-2 overflow-hidden",
14048
+ children: /* @__PURE__ */ jsx("div", {
14049
+ className: "h-2 rounded-full transition-all duration-500",
14050
+ style: {
14051
+ width: `${Math.min(100, Math.max(0, i))}%`,
14052
+ backgroundColor: y
14053
+ }
14054
+ })
14055
+ })]
14056
+ }) : e === "icon-bg" ? /* @__PURE__ */ jsxs("div", {
14057
+ className: `${v} ${h}`,
14058
+ children: [/* @__PURE__ */ jsxs("div", {
14059
+ className: "relative z-10",
14060
+ children: [/* @__PURE__ */ jsx("p", {
14061
+ className: "text-sm text-gray-500 font-medium mb-1",
14062
+ children: t
14063
+ }), /* @__PURE__ */ jsx("h3", {
14064
+ className: "text-2xl font-bold text-gray-900",
14065
+ children: n
14066
+ })]
14067
+ }), c && /* @__PURE__ */ jsx("div", {
14068
+ className: "absolute right-[-10px] bottom-[-10px] opacity-10 text-[80px] pointer-events-none",
14069
+ style: { color: y },
14070
+ children: c
14071
+ })]
14072
+ }) : e === "side-icon" ? /* @__PURE__ */ jsxs("div", {
14073
+ className: `${v} flex items-center ${h}`,
14074
+ children: [c && /* @__PURE__ */ jsx("div", {
14075
+ className: "p-3 rounded-full mr-4 bg-opacity-10",
14076
+ style: {
14077
+ backgroundColor: `${y}20`,
14078
+ color: y
14079
+ },
14080
+ children: /* @__PURE__ */ jsx("div", {
14081
+ className: "text-2xl",
14082
+ children: c
14083
+ })
14084
+ }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
14085
+ className: "text-sm text-gray-500 font-medium",
14086
+ children: t
14087
+ }), /* @__PURE__ */ jsx("h3", {
14088
+ className: "text-2xl font-bold text-gray-900",
14089
+ children: n
14090
+ })] })]
14091
+ }) : e === "card-footer" ? /* @__PURE__ */ jsxs("div", {
14092
+ className: `rounded-lg border border-redi-border bg-white shadow-sm overflow-hidden ${h}`,
14093
+ children: [/* @__PURE__ */ jsxs("div", {
14094
+ className: "p-4",
14095
+ children: [/* @__PURE__ */ jsx("p", {
14096
+ className: "text-sm text-gray-500 font-medium mb-1",
14097
+ children: t
14098
+ }), /* @__PURE__ */ jsx("h3", {
14099
+ className: "text-2xl font-bold text-gray-900",
14100
+ children: n
14101
+ })]
14102
+ }), p && /* @__PURE__ */ jsx("div", {
14103
+ className: "bg-gray-50 px-4 py-2 border-t border-gray-100 text-xs text-gray-500",
14104
+ children: p
14105
+ })]
14106
+ }) : e === "circular" ? /* @__PURE__ */ jsxs("div", {
14107
+ className: `${v} flex items-center justify-between ${h}`,
14108
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
14109
+ className: "text-sm text-gray-500 font-medium mb-1",
14110
+ children: t
14111
+ }), /* @__PURE__ */ jsx("h3", {
14112
+ className: "text-2xl font-bold text-gray-900",
14113
+ children: n
14114
+ })] }), /* @__PURE__ */ jsx("div", {
14115
+ className: "flex-shrink-0 ml-4",
14116
+ children: /* @__PURE__ */ jsx(CircularProgress, {
14117
+ progress: i,
14118
+ color: y
14119
+ })
14120
+ })]
14121
+ }) : e === "sparkline-row" ? /* @__PURE__ */ jsxs("div", {
14122
+ className: `${v} flex items-center justify-between py-3 ${h}`,
14123
+ children: [/* @__PURE__ */ jsxs("div", {
14124
+ className: "mr-4",
14125
+ children: [/* @__PURE__ */ jsx("p", {
14126
+ className: "text-xs text-gray-500 font-medium",
14127
+ children: t
14128
+ }), /* @__PURE__ */ jsx("h3", {
14129
+ className: "text-xl font-bold text-gray-900",
14130
+ children: n
14131
+ })]
14132
+ }), /* @__PURE__ */ jsx("div", {
14133
+ className: "w-24 h-8",
14134
+ children: l && /* @__PURE__ */ jsx(Sparkline, {
14135
+ data: l,
14136
+ color: y,
14137
+ height: 30
14138
+ })
14139
+ })]
14140
+ }) : e === "solid" ? /* @__PURE__ */ jsxs("div", {
14141
+ className: `rounded-lg shadow-sm p-4 text-white ${h}`,
14142
+ style: { backgroundColor: y },
14143
+ children: [/* @__PURE__ */ jsx("p", {
14144
+ className: "text-sm font-medium opacity-90 mb-1",
14145
+ children: t
14146
+ }), /* @__PURE__ */ jsxs("div", {
14147
+ className: "flex justify-between items-end",
14148
+ children: [/* @__PURE__ */ jsx("h3", {
14149
+ className: "text-2xl font-bold",
14150
+ children: n
14151
+ }), c && /* @__PURE__ */ jsx("div", {
14152
+ className: "text-2xl opacity-80",
14153
+ children: c
14154
+ })]
14155
+ })]
14156
+ }) : e === "bordered" ? /* @__PURE__ */ jsxs("div", {
14157
+ className: `${v} border-l-4 ${h}`,
14158
+ style: { borderLeftColor: y },
14159
+ children: [
14160
+ /* @__PURE__ */ jsx("p", {
14161
+ className: "text-sm text-gray-500 font-medium mb-1",
14162
+ children: t
14163
+ }),
14164
+ /* @__PURE__ */ jsx("h3", {
14165
+ className: "text-2xl font-bold text-gray-900",
14166
+ children: n
14167
+ }),
14168
+ p && /* @__PURE__ */ jsx("p", {
14169
+ className: "text-xs text-gray-400 mt-2",
14170
+ children: p
14171
+ })
14172
+ ]
14173
+ }) : e === "stacked" ? /* @__PURE__ */ jsxs("div", {
14174
+ className: `${v} flex flex-col items-center justify-center text-center ${h}`,
14175
+ children: [
14176
+ c && /* @__PURE__ */ jsx("div", {
14177
+ className: "mb-2 text-2xl",
14178
+ style: { color: y },
14179
+ children: c
14180
+ }),
14181
+ /* @__PURE__ */ jsx("p", {
14182
+ className: "text-sm text-gray-500 font-medium",
14183
+ children: t
14184
+ }),
14185
+ /* @__PURE__ */ jsx("h3", {
14186
+ className: "text-3xl font-bold text-gray-900 my-1",
14187
+ children: n
14188
+ }),
14189
+ m && /* @__PURE__ */ jsx("p", {
14190
+ className: "text-xs text-gray-400",
14191
+ children: m
14192
+ })
14193
+ ]
14194
+ }) : null;
13809
14195
  }, Context_default = /* @__PURE__ */ createContext({});
13810
14196
  function r(e) {
13811
14197
  var t, n, i = "";
@@ -15912,4 +16298,4 @@ var Select_default = ({ options: e, value: t, onChange: n, disabled: i = !1, pla
15912
16298
  children: e.find((e) => e.id === i)?.content
15913
16299
  })] });
15914
16300
  };
15915
- export { AdvancedTable_default as AdvancedTable, Alert_default as Alert, AlertViewport, Badge_default as Badge, Breadcrumbs_default as Breadcrumbs, Button_default as Button, Card_default as Card, Checkbox_default as Checkbox, Container_default as Container, DateInput_default as DateInput, Divider_default as Divider, FileInput_default as FileInput, Grid_default as Grid, Link_default as Link, Modal_default as Modal, Pagination_default as Pagination, RadioGroup_default as RadioGroup, Select_default as Select, Slider_default as Slider, Stack_default as Stack, Switch_default as Switch, Tabs_default as Tabs, TextArea_default as TextArea };
16301
+ export { AdvancedTable_default as AdvancedTable, Alert_default as Alert, AlertViewport, Badge_default as Badge, Breadcrumbs_default as Breadcrumbs, Button_default as Button, Card_default as Card, Checkbox_default as Checkbox, Container_default as Container, DateInput_default as DateInput, Divider_default as Divider, FileInput_default as FileInput, Grid_default as Grid, KPI_default as KPI, Link_default as Link, Modal_default as Modal, Pagination_default as Pagination, RadioGroup_default as RadioGroup, Select_default as Select, Slider_default as Slider, Stack_default as Stack, Switch_default as Switch, Tabs_default as Tabs, TextArea_default as TextArea };