@czkoudy/data-table
Version:
A React data table component with pagination, sorting, and filtering capabilities.
1,148 lines (1,146 loc) • 163 kB
JavaScript
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`.DataTable-wrapper{position:relative;font-family:Segoe UI,IBM Plex Sans,sans-serif}.DataTable-loadingOverlay{position:absolute;inset:0;background:#ffffffbf;display:flex;align-items:center;justify-content:center;z-index:10}.DataTable-loadingContent{display:flex;flex-direction:column;align-items:center;gap:12px}.DataTable-loadingSpinner{animation:spin 1s linear infinite;border-radius:50%;height:32px;width:32px;border-bottom:2px solid #2563eb;border-left:2px solid #e5e7eb;border-right:2px solid #e5e7eb;border-top:2px solid #e5e7eb}@keyframes spin{to{transform:rotate(360deg)}}.DataTable-loadingText{font-size:.875rem;color:#4b5563}.DataTable-globalFilterWrapper{margin-bottom:1rem;text-align:left}.DataTable-globalFilterInput{padding:.75rem 1rem;border:1px solid #d1d5db;border-radius:.375rem;outline:none}.DataTable-actionToolbar{display:flex;align-items:center;gap:1rem;padding:.75rem 1rem;margin-bottom:1rem;background-color:#f3f4f6;border:1px solid #d1d5db;border-radius:.375rem}.DataTable-actionToolbarText{font-size:.875rem;color:#374151;font-weight:500}.DataTable-table{width:100%;border-collapse:collapse}.DataTable-headerCell{display:flex;align-items:center;font-weight:500;font-size:.8125rem;line-height:1.125rem;color:#78829d;background-color:#fcfcfc;vertical-align:middle;border:none}.DataTable-headerCellSortable{cursor:pointer;-webkit-user-select:none;user-select:none}.DataTable-headerSortIcon{color:#9ca3af}.DataTable-alignLeft{text-align:left}.DataTable-alignCenter{text-align:center}.DataTable-alignRight{text-align:right}.DataTable-justifyStart{justify-content:flex-start}.DataTable-justifyCenter{justify-content:center}.DataTable-justifyEnd{justify-content:flex-end}.DataTable-filterRowCell{padding:.5rem;padding-left:0;padding-right:0;text-align:left;background-color:#fcfcfc;border-bottom:#e5e7eb 1px solid}.DataTable-filterButton{width:100%;border:1px solid #d1d5db;border-radius:.2rem;background:#fff;text-align:left;display:flex;align-items:left;justify-content:space-between;padding:.25rem .5rem}.DataTable-filterButton>span{font-size:.75rem!important;color:#78829d}.DataTable-filterBackdrop{position:fixed;inset:0;z-index:9999;background:transparent;pointer-events:auto}.DataTable-filterDropdown{position:absolute;top:calc(100% + 4px);left:0;right:auto;z-index:10000;background:#fff;border:1px solid #d1d5db;border-radius:.375rem;box-shadow:0 2px 8px #00000014;max-height:12rem;overflow-y:auto;min-width:max-content;width:100%}.DataTable-filterDropdownHeader{padding:.5rem;border-bottom:1px solid #e5e7eb}.DataTable-filterDropdownLabel{display:flex;align-items:center;font-size:.75rem;font-weight:500;white-space:nowrap;color:#78829d}.DataTable-filterDropdownOption{display:flex;align-items:center;padding:.5rem;font-size:.75rem;cursor:pointer;white-space:nowrap;color:#78829d}.DataTable-noDataMessage{text-align:center;padding:2rem 0;color:#6b7280}.DataTable-paginationWrapper{display:flex;align-items:center;justify-content:space-between;margin-top:1rem}.DataTable-paginationInfo{display:flex;align-items:center;gap:8px}.DataTable-paginationText{font-size:.875rem;color:#374151}.DataTable-paginationControls{display:flex;align-items:center;gap:8px}.DataTable-paginationButton{padding:.25rem .75rem;font-size:.875rem;border:1px solid #d1d5db;border-radius:.2rem;background:#fff;cursor:pointer}.DataTable-paginationButton:disabled{opacity:.5;cursor:not-allowed}.DataTable-paginationPageInfo{display:flex;align-items:center;gap:4px}.DataTable-paginationSelect{padding:.25rem .5rem;font-size:.875rem;border:1px solid #d1d5db;border-radius:.2rem;outline:none}.table-body__row{border-bottom:1px solid #e5e7eb;transition:background-color .2s ease;cursor:pointer}.table-body__row:last-child{border-bottom:none}.table-body__row:hover{background-color:#f9fafb}.table-body__row--selected{background-color:#eff6ff}.table-body__row--selected:hover{background-color:#dbeafe}.table-body__row--grouped{background-color:#f3f4f6;font-weight:600;border-bottom:2px solid #d1d5db}.table-body__row--grouped:hover{background-color:#e5e7eb}.table-body__grouped-cell{padding:12px 16px;font-size:14px;color:#374151}.table-body__group-icon{display:inline-block;margin-right:8px;font-size:12px;color:#6b7280;transition:transform .2s ease}.table-body__group-text{color:#111827}.table-body__row-selector{padding:8px;text-align:center;border-right:none;background-color:inherit}.table-body__checkbox{width:16px;height:16px;cursor:pointer;accent-color:#3b82f6}.table-body__cell{font-weight:500;color:#4b5675;vertical-align:middle;border-right:none;padding-top:.5rem;padding-bottom:.5rem}.table-body__cell:last-child{border-right:none}.table-body__cell--align-left{text-align:left}.table-body__cell--align-center{text-align:center}.table-body__cell--align-right{text-align:right}.table-body__cell-text{display:block;word-wrap:break-word;overflow-wrap:break-word;line-height:1.5;font-size:12.25px!important}.table-body__row--grouped:focus-within{outline-color:#6b7280}.table-body__row--loading{background-color:#f9fafb;animation:pulse 2s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.7}}.table-body__row--empty{text-align:center;font-style:italic;color:#6b7280}.table-body__row:nth-child(2n).table-body__row--striped{background-color:#f9fafb}.table-body__row:nth-child(2n).table-body__row--striped:hover{background-color:#f3f4f6}.table-header__row{border-bottom:1px solid #e5e7eb;background-color:#f9fafb;height:30px}.table-header__row-selector{padding:8px;border-right:1px solid #e5e7eb}.table-header__cell--align-left{text-align:left}.table-header__cell--align-center{text-align:center}.table-header__cell--align-right{text-align:right}.table-header__content{display:flex;align-items:center;font-weight:600;font-size:"14px";cursor:default;min-height:20px;color:#78829d;background-color:#fcfcfc;justify-content:flex-start}.table-header__content--sortable{cursor:pointer;-webkit-user-select:none;user-select:none}.table-header__content--justify-start{justify-content:flex-start}.table-header__content--justify-center{justify-content:center}.table-header__content--justify-end{justify-content:flex-end}.table-header__text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500}.table-header__sort-icon{margin-left:8px;font-size:12px}.table-pagination{display:grid;grid-auto-flow:column;grid-template-columns:1fr 1fr 1fr;align-items:center;gap:1rem;padding:16px 0;border-top:1px solid #e5e7eb;background-color:#fff;flex-wrap:wrap;justify-content:space-between}.table-pagination__section--left{display:flex;align-items:center;justify-content:flex-start}.table-pagination__section--right{display:flex;align-items:center;justify-content:flex-end}.table-pagination__section--center{display:flex;align-items:center;justify-content:center}.table-pagination__info{display:flex}.table-pagination__text,.table-pagination__text--info{font-size:12.25px;color:#6b7280;line-height:1.5}.table-pagination__text--bold{font-weight:600;color:#374151}.table-pagination__controls{display:flex;gap:10px}.table-pagination__button{display:inline-flex;align-items:center;justify-content:center;font-size:12.25px;font-weight:500;color:#374151;background-color:#fff;border:1px solid #d1d5db;border-radius:2px;cursor:pointer;-webkit-user-select:none;user-select:none;padding:4px 8px}.table-pagination__button:hover:not(:disabled){background-color:#f9fafb;border-color:#9ca3af;color:#111827}.table-pagination__button:active:not(:disabled){background-color:#f3f4f6}.table-pagination__button:disabled{opacity:.5;cursor:not-allowed;color:#9ca3af;background-color:#f9fafb}.table-pagination__button--first,.table-pagination__button--last,.table-pagination__button--previous,.table-pagination__button--next{font-size:12.25px}.table-pagination__page-info{display:flex;align-items:center;white-space:nowrap;gap:6px}.table-pagination__page-size{display:flex;align-items:center;gap:8px;flex-shrink:0}.table-pagination__label{font-size:12.25px;color:#6b7280;font-weight:500;white-space:nowrap}.table-pagination__select{min-width:80px;padding:.25rem .5rem;font-size:14px;color:#374151;background-color:#fff;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");background-position:right 8px center;background-repeat:no-repeat;background-size:16px;border:1px solid #d1d5db;border-radius:6px;appearance:none;cursor:pointer;transition:all .2s ease}.table-pagination__select:hover{border-color:#9ca3af}`)),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
import * as ct from "react";
import N, { useImperativeHandle as jn } from "react";
var je = { exports: {} }, ye = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Ot;
function An() {
if (Ot) return ye;
Ot = 1;
var e = N, n = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
function a(l, u, d) {
var g, p = {}, f = null, c = null;
d !== void 0 && (f = "" + d), u.key !== void 0 && (f = "" + u.key), u.ref !== void 0 && (c = u.ref);
for (g in u) r.call(u, g) && !i.hasOwnProperty(g) && (p[g] = u[g]);
if (l && l.defaultProps) for (g in u = l.defaultProps, u) p[g] === void 0 && (p[g] = u[g]);
return { $$typeof: n, type: l, key: f, ref: c, props: p, _owner: o.current };
}
return ye.Fragment = t, ye.jsx = a, ye.jsxs = a, ye;
}
var xe = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var It;
function kn() {
return It || (It = 1, process.env.NODE_ENV !== "production" && (function() {
var e = N, n = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), l = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), c = Symbol.for("react.offscreen"), m = Symbol.iterator, v = "@@iterator";
function R(s) {
if (s === null || typeof s != "object")
return null;
var h = m && s[m] || s[v];
return typeof h == "function" ? h : null;
}
var C = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function x(s) {
{
for (var h = arguments.length, S = new Array(h > 1 ? h - 1 : 0), F = 1; F < h; F++)
S[F - 1] = arguments[F];
$("error", s, S);
}
}
function $(s, h, S) {
{
var F = C.ReactDebugCurrentFrame, V = F.getStackAddendum();
V !== "" && (h += "%s", S = S.concat([V]));
var I = S.map(function(b) {
return String(b);
});
I.unshift("Warning: " + h), Function.prototype.apply.call(console[s], console, I);
}
}
var A = !1, D = !1, E = !1, K = !1, Z = !1, ee;
ee = Symbol.for("react.module.reference");
function ve(s) {
return !!(typeof s == "string" || typeof s == "function" || s === r || s === i || Z || s === o || s === d || s === g || K || s === c || A || D || E || typeof s == "object" && s !== null && (s.$$typeof === f || s.$$typeof === p || s.$$typeof === a || s.$$typeof === l || s.$$typeof === u || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
s.$$typeof === ee || s.getModuleId !== void 0));
}
function pe(s, h, S) {
var F = s.displayName;
if (F)
return F;
var V = h.displayName || h.name || "";
return V !== "" ? S + "(" + V + ")" : S;
}
function De(s) {
return s.displayName || "Context";
}
function U(s) {
if (s == null)
return null;
if (typeof s.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof s == "function")
return s.displayName || s.name || null;
if (typeof s == "string")
return s;
switch (s) {
case r:
return "Fragment";
case t:
return "Portal";
case i:
return "Profiler";
case o:
return "StrictMode";
case d:
return "Suspense";
case g:
return "SuspenseList";
}
if (typeof s == "object")
switch (s.$$typeof) {
case l:
var h = s;
return De(h) + ".Consumer";
case a:
var S = s;
return De(S._context) + ".Provider";
case u:
return pe(s, s.render, "ForwardRef");
case p:
var F = s.displayName || null;
return F !== null ? F : U(s.type) || "Memo";
case f: {
var V = s, I = V._payload, b = V._init;
try {
return U(b(I));
} catch {
return null;
}
}
}
return null;
}
var te = Object.assign, ce = 0, $e, Ve, Q, oe, B, ie, ne;
function Se() {
}
Se.__reactDisabledLog = !0;
function Be() {
{
if (ce === 0) {
$e = console.log, Ve = console.info, Q = console.warn, oe = console.error, B = console.group, ie = console.groupCollapsed, ne = console.groupEnd;
var s = {
configurable: !0,
enumerable: !0,
value: Se,
writable: !0
};
Object.defineProperties(console, {
info: s,
log: s,
warn: s,
error: s,
group: s,
groupCollapsed: s,
groupEnd: s
});
}
ce++;
}
}
function Ye() {
{
if (ce--, ce === 0) {
var s = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: te({}, s, {
value: $e
}),
info: te({}, s, {
value: Ve
}),
warn: te({}, s, {
value: Q
}),
error: te({}, s, {
value: oe
}),
group: te({}, s, {
value: B
}),
groupCollapsed: te({}, s, {
value: ie
}),
groupEnd: te({}, s, {
value: ne
})
});
}
ce < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var Ce = C.ReactCurrentDispatcher, P;
function T(s, h, S) {
{
if (P === void 0)
try {
throw Error();
} catch (V) {
var F = V.stack.trim().match(/\n( *(at )?)/);
P = F && F[1] || "";
}
return `
` + P + s;
}
}
var k = !1, G;
{
var Re = typeof WeakMap == "function" ? WeakMap : Map;
G = new Re();
}
function Oe(s, h) {
if (!s || k)
return "";
{
var S = G.get(s);
if (S !== void 0)
return S;
}
var F;
k = !0;
var V = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var I;
I = Ce.current, Ce.current = null, Be();
try {
if (h) {
var b = function() {
throw Error();
};
if (Object.defineProperty(b.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(b, []);
} catch (z) {
F = z;
}
Reflect.construct(s, [], b);
} else {
try {
b.call();
} catch (z) {
F = z;
}
s.call(b.prototype);
}
} else {
try {
throw Error();
} catch (z) {
F = z;
}
s();
}
} catch (z) {
if (z && F && typeof z.stack == "string") {
for (var M = z.stack.split(`
`), W = F.stack.split(`
`), j = M.length - 1, L = W.length - 1; j >= 1 && L >= 0 && M[j] !== W[L]; )
L--;
for (; j >= 1 && L >= 0; j--, L--)
if (M[j] !== W[L]) {
if (j !== 1 || L !== 1)
do
if (j--, L--, L < 0 || M[j] !== W[L]) {
var Y = `
` + M[j].replace(" at new ", " at ");
return s.displayName && Y.includes("<anonymous>") && (Y = Y.replace("<anonymous>", s.displayName)), typeof s == "function" && G.set(s, Y), Y;
}
while (j >= 1 && L >= 0);
break;
}
}
} finally {
k = !1, Ce.current = I, Ye(), Error.prepareStackTrace = V;
}
var he = s ? s.displayName || s.name : "", ge = he ? T(he) : "";
return typeof s == "function" && G.set(s, ge), ge;
}
function de(s, h, S) {
return Oe(s, !1);
}
function fn(s) {
var h = s.prototype;
return !!(h && h.isReactComponent);
}
function Ie(s, h, S) {
if (s == null)
return "";
if (typeof s == "function")
return Oe(s, fn(s));
if (typeof s == "string")
return T(s);
switch (s) {
case d:
return T("Suspense");
case g:
return T("SuspenseList");
}
if (typeof s == "object")
switch (s.$$typeof) {
case u:
return de(s.render);
case p:
return Ie(s.type, h, S);
case f: {
var F = s, V = F._payload, I = F._init;
try {
return Ie(I(V), h, S);
} catch {
}
}
}
return "";
}
var _e = Object.prototype.hasOwnProperty, St = {}, Ct = C.ReactDebugCurrentFrame;
function Te(s) {
if (s) {
var h = s._owner, S = Ie(s.type, s._source, h ? h.type : null);
Ct.setExtraStackFrame(S);
} else
Ct.setExtraStackFrame(null);
}
function pn(s, h, S, F, V) {
{
var I = Function.call.bind(_e);
for (var b in s)
if (I(s, b)) {
var M = void 0;
try {
if (typeof s[b] != "function") {
var W = Error((F || "React class") + ": " + S + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof s[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw W.name = "Invariant Violation", W;
}
M = s[b](h, b, F, S, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (j) {
M = j;
}
M && !(M instanceof Error) && (Te(V), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", F || "React class", S, b, typeof M), Te(null)), M instanceof Error && !(M.message in St) && (St[M.message] = !0, Te(V), x("Failed %s type: %s", S, M.message), Te(null));
}
}
}
var mn = Array.isArray;
function Ue(s) {
return mn(s);
}
function hn(s) {
{
var h = typeof Symbol == "function" && Symbol.toStringTag, S = h && s[Symbol.toStringTag] || s.constructor.name || "Object";
return S;
}
}
function wn(s) {
try {
return Rt(s), !1;
} catch {
return !0;
}
}
function Rt(s) {
return "" + s;
}
function _t(s) {
if (wn(s))
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", hn(s)), Rt(s);
}
var yt = C.ReactCurrentOwner, vn = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, xt, Ft;
function Sn(s) {
if (_e.call(s, "ref")) {
var h = Object.getOwnPropertyDescriptor(s, "ref").get;
if (h && h.isReactWarning)
return !1;
}
return s.ref !== void 0;
}
function Cn(s) {
if (_e.call(s, "key")) {
var h = Object.getOwnPropertyDescriptor(s, "key").get;
if (h && h.isReactWarning)
return !1;
}
return s.key !== void 0;
}
function Rn(s, h) {
typeof s.ref == "string" && yt.current;
}
function _n(s, h) {
{
var S = function() {
xt || (xt = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", h));
};
S.isReactWarning = !0, Object.defineProperty(s, "key", {
get: S,
configurable: !0
});
}
}
function yn(s, h) {
{
var S = function() {
Ft || (Ft = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", h));
};
S.isReactWarning = !0, Object.defineProperty(s, "ref", {
get: S,
configurable: !0
});
}
}
var xn = function(s, h, S, F, V, I, b) {
var M = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: n,
// Built-in properties that belong on the element
type: s,
key: h,
ref: S,
props: b,
// Record the component responsible for creating this element.
_owner: I
};
return M._store = {}, Object.defineProperty(M._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(M, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: F
}), Object.defineProperty(M, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: V
}), Object.freeze && (Object.freeze(M.props), Object.freeze(M)), M;
};
function Fn(s, h, S, F, V) {
{
var I, b = {}, M = null, W = null;
S !== void 0 && (_t(S), M = "" + S), Cn(h) && (_t(h.key), M = "" + h.key), Sn(h) && (W = h.ref, Rn(h, V));
for (I in h)
_e.call(h, I) && !vn.hasOwnProperty(I) && (b[I] = h[I]);
if (s && s.defaultProps) {
var j = s.defaultProps;
for (I in j)
b[I] === void 0 && (b[I] = j[I]);
}
if (M || W) {
var L = typeof s == "function" ? s.displayName || s.name || "Unknown" : s;
M && _n(b, L), W && yn(b, L);
}
return xn(s, M, W, V, F, yt.current, b);
}
}
var Xe = C.ReactCurrentOwner, Pt = C.ReactDebugCurrentFrame;
function me(s) {
if (s) {
var h = s._owner, S = Ie(s.type, s._source, h ? h.type : null);
Pt.setExtraStackFrame(S);
} else
Pt.setExtraStackFrame(null);
}
var Je;
Je = !1;
function Qe(s) {
return typeof s == "object" && s !== null && s.$$typeof === n;
}
function Mt() {
{
if (Xe.current) {
var s = U(Xe.current.type);
if (s)
return `
Check the render method of \`` + s + "`.";
}
return "";
}
}
function Pn(s) {
return "";
}
var Et = {};
function Mn(s) {
{
var h = Mt();
if (!h) {
var S = typeof s == "string" ? s : s.displayName || s.name;
S && (h = `
Check the top-level render call using <` + S + ">.");
}
return h;
}
}
function bt(s, h) {
{
if (!s._store || s._store.validated || s.key != null)
return;
s._store.validated = !0;
var S = Mn(h);
if (Et[S])
return;
Et[S] = !0;
var F = "";
s && s._owner && s._owner !== Xe.current && (F = " It was passed a child from " + U(s._owner.type) + "."), me(s), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', S, F), me(null);
}
}
function Dt(s, h) {
{
if (typeof s != "object")
return;
if (Ue(s))
for (var S = 0; S < s.length; S++) {
var F = s[S];
Qe(F) && bt(F, h);
}
else if (Qe(s))
s._store && (s._store.validated = !0);
else if (s) {
var V = R(s);
if (typeof V == "function" && V !== s.entries)
for (var I = V.call(s), b; !(b = I.next()).done; )
Qe(b.value) && bt(b.value, h);
}
}
}
function En(s) {
{
var h = s.type;
if (h == null || typeof h == "string")
return;
var S;
if (typeof h == "function")
S = h.propTypes;
else if (typeof h == "object" && (h.$$typeof === u || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
h.$$typeof === p))
S = h.propTypes;
else
return;
if (S) {
var F = U(h);
pn(S, s.props, "prop", F, s);
} else if (h.PropTypes !== void 0 && !Je) {
Je = !0;
var V = U(h);
x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", V || "Unknown");
}
typeof h.getDefaultProps == "function" && !h.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function bn(s) {
{
for (var h = Object.keys(s.props), S = 0; S < h.length; S++) {
var F = h[S];
if (F !== "children" && F !== "key") {
me(s), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", F), me(null);
break;
}
}
s.ref !== null && (me(s), x("Invalid attribute `ref` supplied to `React.Fragment`."), me(null));
}
}
var $t = {};
function Vt(s, h, S, F, V, I) {
{
var b = ve(s);
if (!b) {
var M = "";
(s === void 0 || typeof s == "object" && s !== null && Object.keys(s).length === 0) && (M += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var W = Pn();
W ? M += W : M += Mt();
var j;
s === null ? j = "null" : Ue(s) ? j = "array" : s !== void 0 && s.$$typeof === n ? (j = "<" + (U(s.type) || "Unknown") + " />", M = " Did you accidentally export a JSX literal instead of a component?") : j = typeof s, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", j, M);
}
var L = Fn(s, h, S, V, I);
if (L == null)
return L;
if (b) {
var Y = h.children;
if (Y !== void 0)
if (F)
if (Ue(Y)) {
for (var he = 0; he < Y.length; he++)
Dt(Y[he], s);
Object.freeze && Object.freeze(Y);
} else
x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
Dt(Y, s);
}
if (_e.call(h, "key")) {
var ge = U(s), z = Object.keys(h).filter(function(Tn) {
return Tn !== "key";
}), Ke = z.length > 0 ? "{key: someKey, " + z.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!$t[ge + Ke]) {
var In = z.length > 0 ? "{" + z.join(": ..., ") + ": ...}" : "{}";
x(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`, Ke, ge, In, ge), $t[ge + Ke] = !0;
}
}
return s === r ? bn(L) : En(L), L;
}
}
function Dn(s, h, S) {
return Vt(s, h, S, !0);
}
function $n(s, h, S) {
return Vt(s, h, S, !1);
}
var Vn = $n, On = Dn;
xe.Fragment = r, xe.jsx = Vn, xe.jsxs = On;
})()), xe;
}
var Tt;
function Ln() {
return Tt || (Tt = 1, process.env.NODE_ENV === "production" ? je.exports = An() : je.exports = kn()), je.exports;
}
var w = Ln();
/**
* table-core
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
function se(e, n) {
return typeof e == "function" ? e(n) : e;
}
function q(e, n) {
return (t) => {
n.setState((r) => ({
...r,
[e]: se(t, r[e])
}));
};
}
function We(e) {
return e instanceof Function;
}
function Gn(e) {
return Array.isArray(e) && e.every((n) => typeof n == "number");
}
function Ut(e, n) {
const t = [], r = (o) => {
o.forEach((i) => {
t.push(i);
const a = n(i);
a != null && a.length && r(a);
});
};
return r(e), t;
}
function _(e, n, t) {
let r = [], o;
return (i) => {
let a;
t.key && t.debug && (a = Date.now());
const l = e(i);
if (!(l.length !== r.length || l.some((g, p) => r[p] !== g)))
return o;
r = l;
let d;
if (t.key && t.debug && (d = Date.now()), o = n(...l), t == null || t.onChange == null || t.onChange(o), t.key && t.debug && t != null && t.debug()) {
const g = Math.round((Date.now() - a) * 100) / 100, p = Math.round((Date.now() - d) * 100) / 100, f = p / 16, c = (m, v) => {
for (m = String(m); m.length < v; )
m = " " + m;
return m;
};
console.info(`%c⏱ ${c(p, 5)} /${c(g, 5)} ms`, `
font-size: .6rem;
font-weight: bold;
color: hsl(${Math.max(0, Math.min(120 - 120 * f, 120))}deg 100% 31%);`, t?.key);
}
return o;
};
}
function y(e, n, t, r) {
return {
debug: () => {
var o;
return (o = e?.debugAll) != null ? o : e[n];
},
key: process.env.NODE_ENV === "development" && t,
onChange: r
};
}
function Hn(e, n, t, r) {
const o = () => {
var a;
return (a = i.getValue()) != null ? a : e.options.renderFallbackValue;
}, i = {
id: `${n.id}_${t.id}`,
row: n,
column: t,
getValue: () => n.getValue(r),
renderValue: o,
getContext: _(() => [e, t, n, i], (a, l, u, d) => ({
table: a,
column: l,
row: u,
cell: d,
getValue: d.getValue,
renderValue: d.renderValue
}), y(e.options, "debugCells", "cell.getContext"))
};
return e._features.forEach((a) => {
a.createCell == null || a.createCell(i, t, n, e);
}, {}), i;
}
function Nn(e, n, t, r) {
var o, i;
const l = {
...e._getDefaultColumnDef(),
...n
}, u = l.accessorKey;
let d = (o = (i = l.id) != null ? i : u ? typeof String.prototype.replaceAll == "function" ? u.replaceAll(".", "_") : u.replace(/\./g, "_") : void 0) != null ? o : typeof l.header == "string" ? l.header : void 0, g;
if (l.accessorFn ? g = l.accessorFn : u && (u.includes(".") ? g = (f) => {
let c = f;
for (const v of u.split(".")) {
var m;
c = (m = c) == null ? void 0 : m[v], process.env.NODE_ENV !== "production" && c === void 0 && console.warn(`"${v}" in deeply nested key "${u}" returned undefined.`);
}
return c;
} : g = (f) => f[l.accessorKey]), !d)
throw process.env.NODE_ENV !== "production" ? new Error(l.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
let p = {
id: `${String(d)}`,
accessorFn: g,
parent: r,
depth: t,
columnDef: l,
columns: [],
getFlatColumns: _(() => [!0], () => {
var f;
return [p, ...(f = p.columns) == null ? void 0 : f.flatMap((c) => c.getFlatColumns())];
}, y(e.options, "debugColumns", "column.getFlatColumns")),
getLeafColumns: _(() => [e._getOrderColumnsFn()], (f) => {
var c;
if ((c = p.columns) != null && c.length) {
let m = p.columns.flatMap((v) => v.getLeafColumns());
return f(m);
}
return [p];
}, y(e.options, "debugColumns", "column.getLeafColumns"))
};
for (const f of e._features)
f.createColumn == null || f.createColumn(p, e);
return p;
}
const H = "debugHeaders";
function jt(e, n, t) {
var r;
let i = {
id: (r = t.id) != null ? r : n.id,
column: n,
index: t.index,
isPlaceholder: !!t.isPlaceholder,
placeholderId: t.placeholderId,
depth: t.depth,
subHeaders: [],
colSpan: 0,
rowSpan: 0,
headerGroup: null,
getLeafHeaders: () => {
const a = [], l = (u) => {
u.subHeaders && u.subHeaders.length && u.subHeaders.map(l), a.push(u);
};
return l(i), a;
},
getContext: () => ({
table: e,
header: i,
column: n
})
};
return e._features.forEach((a) => {
a.createHeader == null || a.createHeader(i, e);
}), i;
}
const Wn = {
createTable: (e) => {
e.getHeaderGroups = _(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (n, t, r, o) => {
var i, a;
const l = (i = r?.map((p) => t.find((f) => f.id === p)).filter(Boolean)) != null ? i : [], u = (a = o?.map((p) => t.find((f) => f.id === p)).filter(Boolean)) != null ? a : [], d = t.filter((p) => !(r != null && r.includes(p.id)) && !(o != null && o.includes(p.id)));
return Ae(n, [...l, ...d, ...u], e);
}, y(e.options, H, "getHeaderGroups")), e.getCenterHeaderGroups = _(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (n, t, r, o) => (t = t.filter((i) => !(r != null && r.includes(i.id)) && !(o != null && o.includes(i.id))), Ae(n, t, e, "center")), y(e.options, H, "getCenterHeaderGroups")), e.getLeftHeaderGroups = _(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (n, t, r) => {
var o;
const i = (o = r?.map((a) => t.find((l) => l.id === a)).filter(Boolean)) != null ? o : [];
return Ae(n, i, e, "left");
}, y(e.options, H, "getLeftHeaderGroups")), e.getRightHeaderGroups = _(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (n, t, r) => {
var o;
const i = (o = r?.map((a) => t.find((l) => l.id === a)).filter(Boolean)) != null ? o : [];
return Ae(n, i, e, "right");
}, y(e.options, H, "getRightHeaderGroups")), e.getFooterGroups = _(() => [e.getHeaderGroups()], (n) => [...n].reverse(), y(e.options, H, "getFooterGroups")), e.getLeftFooterGroups = _(() => [e.getLeftHeaderGroups()], (n) => [...n].reverse(), y(e.options, H, "getLeftFooterGroups")), e.getCenterFooterGroups = _(() => [e.getCenterHeaderGroups()], (n) => [...n].reverse(), y(e.options, H, "getCenterFooterGroups")), e.getRightFooterGroups = _(() => [e.getRightHeaderGroups()], (n) => [...n].reverse(), y(e.options, H, "getRightFooterGroups")), e.getFlatHeaders = _(() => [e.getHeaderGroups()], (n) => n.map((t) => t.headers).flat(), y(e.options, H, "getFlatHeaders")), e.getLeftFlatHeaders = _(() => [e.getLeftHeaderGroups()], (n) => n.map((t) => t.headers).flat(), y(e.options, H, "getLeftFlatHeaders")), e.getCenterFlatHeaders = _(() => [e.getCenterHeaderGroups()], (n) => n.map((t) => t.headers).flat(), y(e.options, H, "getCenterFlatHeaders")), e.getRightFlatHeaders = _(() => [e.getRightHeaderGroups()], (n) => n.map((t) => t.headers).flat(), y(e.options, H, "getRightFlatHeaders")), e.getCenterLeafHeaders = _(() => [e.getCenterFlatHeaders()], (n) => n.filter((t) => {
var r;
return !((r = t.subHeaders) != null && r.length);
}), y(e.options, H, "getCenterLeafHeaders")), e.getLeftLeafHeaders = _(() => [e.getLeftFlatHeaders()], (n) => n.filter((t) => {
var r;
return !((r = t.subHeaders) != null && r.length);
}), y(e.options, H, "getLeftLeafHeaders")), e.getRightLeafHeaders = _(() => [e.getRightFlatHeaders()], (n) => n.filter((t) => {
var r;
return !((r = t.subHeaders) != null && r.length);
}), y(e.options, H, "getRightLeafHeaders")), e.getLeafHeaders = _(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (n, t, r) => {
var o, i, a, l, u, d;
return [...(o = (i = n[0]) == null ? void 0 : i.headers) != null ? o : [], ...(a = (l = t[0]) == null ? void 0 : l.headers) != null ? a : [], ...(u = (d = r[0]) == null ? void 0 : d.headers) != null ? u : []].map((g) => g.getLeafHeaders()).flat();
}, y(e.options, H, "getLeafHeaders"));
}
};
function Ae(e, n, t, r) {
var o, i;
let a = 0;
const l = function(f, c) {
c === void 0 && (c = 1), a = Math.max(a, c), f.filter((m) => m.getIsVisible()).forEach((m) => {
var v;
(v = m.columns) != null && v.length && l(m.columns, c + 1);
}, 0);
};
l(e);
let u = [];
const d = (f, c) => {
const m = {
depth: c,
id: [r, `${c}`].filter(Boolean).join("_"),
headers: []
}, v = [];
f.forEach((R) => {
const C = [...v].reverse()[0], x = R.column.depth === m.depth;
let $, A = !1;
if (x && R.column.parent ? $ = R.column.parent : ($ = R.column, A = !0), C && C?.column === $)
C.subHeaders.push(R);
else {
const D = jt(t, $, {
id: [r, c, $.id, R?.id].filter(Boolean).join("_"),
isPlaceholder: A,
placeholderId: A ? `${v.filter((E) => E.column === $).length}` : void 0,
depth: c,
index: v.length
});
D.subHeaders.push(R), v.push(D);
}
m.headers.push(R), R.headerGroup = m;
}), u.push(m), c > 0 && d(v, c - 1);
}, g = n.map((f, c) => jt(t, f, {
depth: a,
index: c
}));
d(g, a - 1), u.reverse();
const p = (f) => f.filter((m) => m.column.getIsVisible()).map((m) => {
let v = 0, R = 0, C = [0];
m.subHeaders && m.subHeaders.length ? (C = [], p(m.subHeaders).forEach(($) => {
let {
colSpan: A,
rowSpan: D
} = $;
v += A, C.push(D);
})) : v = 1;
const x = Math.min(...C);
return R = R + x, m.colSpan = v, m.rowSpan = R, {
colSpan: v,
rowSpan: R
};
});
return p((o = (i = u[0]) == null ? void 0 : i.headers) != null ? o : []), u;
}
const ze = (e, n, t, r, o, i, a) => {
let l = {
id: n,
index: r,
original: t,
depth: o,
parentId: a,
_valuesCache: {},
_uniqueValuesCache: {},
getValue: (u) => {
if (l._valuesCache.hasOwnProperty(u))
return l._valuesCache[u];
const d = e.getColumn(u);
if (d != null && d.accessorFn)
return l._valuesCache[u] = d.accessorFn(l.original, r), l._valuesCache[u];
},
getUniqueValues: (u) => {
if (l._uniqueValuesCache.hasOwnProperty(u))
return l._uniqueValuesCache[u];
const d = e.getColumn(u);
if (d != null && d.accessorFn)
return d.columnDef.getUniqueValues ? (l._uniqueValuesCache[u] = d.columnDef.getUniqueValues(l.original, r), l._uniqueValuesCache[u]) : (l._uniqueValuesCache[u] = [l.getValue(u)], l._uniqueValuesCache[u]);
},
renderValue: (u) => {
var d;
return (d = l.getValue(u)) != null ? d : e.options.renderFallbackValue;
},
subRows: i ?? [],
getLeafRows: () => Ut(l.subRows, (u) => u.subRows),
getParentRow: () => l.parentId ? e.getRow(l.parentId, !0) : void 0,
getParentRows: () => {
let u = [], d = l;
for (; ; ) {
const g = d.getParentRow();
if (!g) break;
u.push(g), d = g;
}
return u.reverse();
},
getAllCells: _(() => [e.getAllLeafColumns()], (u) => u.map((d) => Hn(e, l, d, d.id)), y(e.options, "debugRows", "getAllCells")),
_getAllCellsByColumnId: _(() => [l.getAllCells()], (u) => u.reduce((d, g) => (d[g.column.id] = g, d), {}), y(e.options, "debugRows", "getAllCellsByColumnId"))
};
for (let u = 0; u < e._features.length; u++) {
const d = e._features[u];
d == null || d.createRow == null || d.createRow(l, e);
}
return l;
}, zn = {
createColumn: (e, n) => {
e._getFacetedRowModel = n.options.getFacetedRowModel && n.options.getFacetedRowModel(n, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : n.getPreFilteredRowModel(), e._getFacetedUniqueValues = n.options.getFacetedUniqueValues && n.options.getFacetedUniqueValues(n, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = n.options.getFacetedMinMaxValues && n.options.getFacetedMinMaxValues(n, e.id), e.getFacetedMinMaxValues = () => {
if (e._getFacetedMinMaxValues)
return e._getFacetedMinMaxValues();
};
}
}, Xt = (e, n, t) => {
var r, o;
const i = t == null || (r = t.toString()) == null ? void 0 : r.toLowerCase();
return !!(!((o = e.getValue(n)) == null || (o = o.toString()) == null || (o = o.toLowerCase()) == null) && o.includes(i));
};
Xt.autoRemove = (e) => X(e);
const Jt = (e, n, t) => {
var r;
return !!(!((r = e.getValue(n)) == null || (r = r.toString()) == null) && r.includes(t));
};
Jt.autoRemove = (e) => X(e);
const Qt = (e, n, t) => {
var r;
return ((r = e.getValue(n)) == null || (r = r.toString()) == null ? void 0 : r.toLowerCase()) === t?.toLowerCase();
};
Qt.autoRemove = (e) => X(e);
const Kt = (e, n, t) => {
var r;
return (r = e.getValue(n)) == null ? void 0 : r.includes(t);
};
Kt.autoRemove = (e) => X(e);
const Zt = (e, n, t) => !t.some((r) => {
var o;
return !((o = e.getValue(n)) != null && o.includes(r));
});
Zt.autoRemove = (e) => X(e) || !(e != null && e.length);
const en = (e, n, t) => t.some((r) => {
var o;
return (o = e.getValue(n)) == null ? void 0 : o.includes(r);
});
en.autoRemove = (e) => X(e) || !(e != null && e.length);
const tn = (e, n, t) => e.getValue(n) === t;
tn.autoRemove = (e) => X(e);
const nn = (e, n, t) => e.getValue(n) == t;
nn.autoRemove = (e) => X(e);
const ht = (e, n, t) => {
let [r, o] = t;
const i = e.getValue(n);
return i >= r && i <= o;
};
ht.resolveFilterValue = (e) => {
let [n, t] = e, r = typeof n != "number" ? parseFloat(n) : n, o = typeof t != "number" ? parseFloat(t) : t, i = n === null || Number.isNaN(r) ? -1 / 0 : r, a = t === null || Number.isNaN(o) ? 1 / 0 : o;
if (i > a) {
const l = i;
i = a, a = l;
}
return [i, a];
};
ht.autoRemove = (e) => X(e) || X(e[0]) && X(e[1]);
const re = {
includesString: Xt,
includesStringSensitive: Jt,
equalsString: Qt,
arrIncludes: Kt,
arrIncludesAll: Zt,
arrIncludesSome: en,
equals: tn,
weakEquals: nn,
inNumberRange: ht
};
function X(e) {
return e == null || e === "";
}
const qn = {
getDefaultColumnDef: () => ({
filterFn: "auto"
}),
getInitialState: (e) => ({
columnFilters: [],
...e
}),
getDefaultOptions: (e) => ({
onColumnFiltersChange: q("columnFilters", e),
filterFromLeafRows: !1,
maxLeafRowFilterDepth: 100
}),
createColumn: (e, n) => {
e.getAutoFilterFn = () => {
const t = n.getCoreRowModel().flatRows[0], r = t?.getValue(e.id);
return typeof r == "string" ? re.includesString : typeof r == "number" ? re.inNumberRange : typeof r == "boolean" || r !== null && typeof r == "object" ? re.equals : Array.isArray(r) ? re.arrIncludes : re.weakEquals;
}, e.getFilterFn = () => {
var t, r;
return We(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
// @ts-ignore
(t = (r = n.options.filterFns) == null ? void 0 : r[e.columnDef.filterFn]) != null ? t : re[e.columnDef.filterFn]
);
}, e.getCanFilter = () => {
var t, r, o;
return ((t = e.columnDef.enableColumnFilter) != null ? t : !0) && ((r = n.options.enableColumnFilters) != null ? r : !0) && ((o = n.options.enableFilters) != null ? o : !0) && !!e.accessorFn;
}, e.getIsFiltered = () => e.getFilterIndex() > -1, e.getFilterValue = () => {
var t;
return (t = n.getState().columnFilters) == null || (t = t.find((r) => r.id === e.id)) == null ? void 0 : t.value;
}, e.getFilterIndex = () => {
var t, r;
return (t = (r = n.getState().columnFilters) == null ? void 0 : r.findIndex((o) => o.id === e.id)) != null ? t : -1;
}, e.setFilterValue = (t) => {
n.setColumnFilters((r) => {
const o = e.getFilterFn(), i = r?.find((g) => g.id === e.id), a = se(t, i ? i.value : void 0);
if (At(o, a, e)) {
var l;
return (l = r?.filter((g) => g.id !== e.id)) != null ? l : [];
}
const u = {
id: e.id,
value: a
};
if (i) {
var d;
return (d = r?.map((g) => g.id === e.id ? u : g)) != null ? d : [];
}
return r != null && r.length ? [...r, u] : [u];
});
};
},
createRow: (e, n) => {
e.columnFilters = {}, e.columnFiltersMeta = {};
},
createTable: (e) => {
e.setColumnFilters = (n) => {
const t = e.getAllLeafColumns(), r = (o) => {
var i;
return (i = se(n, o)) == null ? void 0 : i.filter((a) => {
const l = t.find((u) => u.id === a.id);
if (l) {
const u = l.getFilterFn();
if (At(u, a.value, l))
return !1;
}
return !0;
});
};
e.options.onColumnFiltersChange == null || e.options.onColumnFiltersChange(r);
}, e.resetColumnFilters = (n) => {
var t, r;
e.setColumnFilters(n ? [] : (t = (r = e.initialState) == null ? void 0 : r.columnFilters) != null ? t : []);
}, e.getPreFilteredRowModel = () => e.getCoreRowModel(), e.getFilteredRowModel = () => (!e._getFilteredRowModel && e.options.getFilteredRowModel && (e._getFilteredRowModel = e.options.getFilteredRowModel(e)), e.options.manualFiltering || !e._getFilteredRowModel ? e.getPreFilteredRowModel() : e._getFilteredRowModel());
}
};
function At(e, n, t) {
return (e && e.autoRemove ? e.autoRemove(n, t) : !1) || typeof n > "u" || typeof n == "string" && !n;
}
const Bn = (e, n, t) => t.reduce((r, o) => {
const i = o.getValue(e);
return r + (typeof i == "number" ? i : 0);
}, 0), Yn = (e, n, t) => {
let r;
return t.forEach((o) => {
const i = o.getValue(e);
i != null && (r > i || r === void 0 && i >= i) && (r = i);
}), r;
}, Un = (e, n, t) => {
let r;
return t.forEach((o) => {
const i = o.getValue(e);
i != null && (r < i || r === void 0 && i >= i) && (r = i);
}), r;
}, Xn = (e, n, t) => {
let r, o;
return t.forEach((i) => {
const a = i.getValue(e);
a != null && (r === void 0 ? a >= a && (r = o = a) : (r > a && (r = a), o < a && (o = a)));
}), [r, o];
}, Jn = (e, n) => {
let t = 0, r = 0;
if (n.forEach((o) => {
let i = o.getValue(e);
i != null && (i = +i) >= i && (++t, r += i);
}), t) return r / t;
}, Qn = (e, n) => {
if (!n.length)
return;
const t = n.map((i) => i.getValue(e));
if (!Gn(t))
return;
if (t.length === 1)
return t[0];
const r = Math.floor(t.length / 2), o = t.sort((i, a) => i - a);
return t.length % 2 !== 0 ? o[r] : (o[r - 1] + o[r]) / 2;
}, Kn = (e, n) => Array.from(new Set(n.map((t) => t.getValue(e))).values()), Zn = (e, n) => new Set(n.map((t) => t.getValue(e))).size, er = (e, n) => n.length, Ze = {
sum: Bn,
min: Yn,
max: Un,
extent: Xn,
mean: Jn,
median: Qn,
unique: Kn,
uniqueCount: Zn,
count: er
}, tr = {
getDefaultColumnDef: () => ({
aggregatedCell: (e) => {
var n, t;
return (n = (t = e.getValue()) == null || t.toString == null ? void 0 : t.toString()) != null ? n : null;
},
aggregationFn: "auto"
}),
getInitialState: (e) => ({
grouping: [],
...e
}),
getDefaultOptions: (e) => ({
onGroupingChange: q("grouping", e),
groupedColumnMode: "reorder"
}),
createColumn: (e, n) => {
e.toggleGrouping = () => {
n.setGrouping((t) => t != null && t.includes(e.id) ? t.filter((r) => r !== e.id) : [...t ?? [], e.id]);
}, e.getCanGroup = () => {
var t, r;
return ((t = e.columnDef.enableGrouping) != null ? t : !0) && ((r = n.options.enableGrouping) != null ? r : !0) && (!!e.accessorFn || !!e.columnDef.getGroupingValue);
}, e.getIsGrouped = () => {
var t;
retur