react-datagrid-component
Version:
A powerful, customizable data grid component built with React, TypeScript, and TanStack Table v8
1,350 lines (1,348 loc) • 877 kB
JavaScript
import * as $e from "react";
import Lr, { useRef as qr, useMemo as pn, useEffect as Br, useState as Be, useCallback as is, useLayoutEffect as _l } from "react";
import { useReactTable as kl, getCoreRowModel as yl, getFilteredRowModel as El, getPaginationRowModel as Tl, getSortedRowModel as Sl, flexRender as g0 } from "@tanstack/react-table";
import { Check as Mt, ChevronRight as Si, Circle as Fl, Sun as bl, Moon as Al, Palette as Cl, Upload as Nl, FileText as jc, Table as Dl, X as Nr, Settings as Rl, GripVertical as Uc, Eye as Wc, EyeOff as Hc, Filter as fs, ChevronDown as Fi, ChevronUp as Ol, Plus as Il, MoreHorizontal as Pl, Trash2 as Ll, Download as Ml, Copy as Bl, ChevronsLeft as ni, ChevronLeft as Vc, ChevronsRight as si, Minimize2 as zc, Maximize2 as Gc, Save as jl, Edit as Qt, Calendar as $c, Pin as tn, ArrowUp as w0, ArrowDown as _0, ArrowUpDown as Ul, MoreVerticalIcon as k0, ArrowLeft as Wl, ArrowRight as Hl, MoveLeft as Vl, MoveRight as zl, PinOff as Gl, Text as $l, Hash as Xl, List as Kl, BadgeCheck as Yl, Image as ql, BarChart2 as Jl, Clock as Zl, Search as Xc } from "lucide-react";
import { Slot as Ql } from "@radix-ui/react-slot";
import { cva as Kc } from "class-variance-authority";
import { clsx as eu } from "clsx";
import { twMerge as ru } from "tailwind-merge";
import * as ii from "@radix-ui/react-checkbox";
import * as yr from "@radix-ui/react-dropdown-menu";
import * as mn from "@radix-ui/react-popover";
import * as la from "@radix-ui/react-scroll-area";
import * as _r from "@radix-ui/react-select";
import * as Rt from "@radix-ui/react-dialog";
import { DayPicker as tu } from "react-day-picker";
import { format as y0 } from "date-fns";
var au = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function nu(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var ci = { exports: {} }, qa = {};
/**
* @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 E0;
function su() {
if (E0) return qa;
E0 = 1;
var e = Lr, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, n = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
function i(c, o, f) {
var l, h = {}, x = null, m = null;
f !== void 0 && (x = "" + f), o.key !== void 0 && (x = "" + o.key), o.ref !== void 0 && (m = o.ref);
for (l in o) a.call(o, l) && !s.hasOwnProperty(l) && (h[l] = o[l]);
if (c && c.defaultProps) for (l in o = c.defaultProps, o) h[l] === void 0 && (h[l] = o[l]);
return { $$typeof: t, type: c, key: x, ref: m, props: h, _owner: n.current };
}
return qa.Fragment = r, qa.jsx = i, qa.jsxs = i, qa;
}
var Ja = {};
/**
* @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 T0;
function iu() {
return T0 || (T0 = 1, process.env.NODE_ENV !== "production" && function() {
var e = Lr, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), c = Symbol.for("react.context"), o = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), v = Symbol.iterator, d = "@@iterator";
function g(p) {
if (p === null || typeof p != "object")
return null;
var _ = v && p[v] || p[d];
return typeof _ == "function" ? _ : null;
}
var S = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function A(p) {
{
for (var _ = arguments.length, F = new Array(_ > 1 ? _ - 1 : 0), b = 1; b < _; b++)
F[b - 1] = arguments[b];
k("error", p, F);
}
}
function k(p, _, F) {
{
var b = S.ReactDebugCurrentFrame, G = b.getStackAddendum();
G !== "" && (_ += "%s", F = F.concat([G]));
var q = F.map(function(V) {
return String(V);
});
q.unshift("Warning: " + _), Function.prototype.apply.call(console[p], console, q);
}
}
var O = !1, L = !1, I = !1, E = !1, w = !1, y;
y = Symbol.for("react.module.reference");
function P(p) {
return !!(typeof p == "string" || typeof p == "function" || p === a || p === s || w || p === n || p === f || p === l || E || p === m || O || L || I || typeof p == "object" && p !== null && (p.$$typeof === x || p.$$typeof === h || p.$$typeof === i || p.$$typeof === c || p.$$typeof === o || // 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.
p.$$typeof === y || p.getModuleId !== void 0));
}
function j(p, _, F) {
var b = p.displayName;
if (b)
return b;
var G = _.displayName || _.name || "";
return G !== "" ? F + "(" + G + ")" : F;
}
function N(p) {
return p.displayName || "Context";
}
function H(p) {
if (p == null)
return null;
if (typeof p.tag == "number" && A("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof p == "function")
return p.displayName || p.name || null;
if (typeof p == "string")
return p;
switch (p) {
case a:
return "Fragment";
case r:
return "Portal";
case s:
return "Profiler";
case n:
return "StrictMode";
case f:
return "Suspense";
case l:
return "SuspenseList";
}
if (typeof p == "object")
switch (p.$$typeof) {
case c:
var _ = p;
return N(_) + ".Consumer";
case i:
var F = p;
return N(F._context) + ".Provider";
case o:
return j(p, p.render, "ForwardRef");
case h:
var b = p.displayName || null;
return b !== null ? b : H(p.type) || "Memo";
case x: {
var G = p, q = G._payload, V = G._init;
try {
return H(V(q));
} catch {
return null;
}
}
}
return null;
}
var J = Object.assign, ce = 0, ue, te, _e, W, ge, fe, C;
function M() {
}
M.__reactDisabledLog = !0;
function B() {
{
if (ce === 0) {
ue = console.log, te = console.info, _e = console.warn, W = console.error, ge = console.group, fe = console.groupCollapsed, C = console.groupEnd;
var p = {
configurable: !0,
enumerable: !0,
value: M,
writable: !0
};
Object.defineProperties(console, {
info: p,
log: p,
warn: p,
error: p,
group: p,
groupCollapsed: p,
groupEnd: p
});
}
ce++;
}
}
function U() {
{
if (ce--, ce === 0) {
var p = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: J({}, p, {
value: ue
}),
info: J({}, p, {
value: te
}),
warn: J({}, p, {
value: _e
}),
error: J({}, p, {
value: W
}),
group: J({}, p, {
value: ge
}),
groupCollapsed: J({}, p, {
value: fe
}),
groupEnd: J({}, p, {
value: C
})
});
}
ce < 0 && A("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var Y = S.ReactCurrentDispatcher, se;
function Q(p, _, F) {
{
if (se === void 0)
try {
throw Error();
} catch (G) {
var b = G.stack.trim().match(/\n( *(at )?)/);
se = b && b[1] || "";
}
return `
` + se + p;
}
}
var Z = !1, re;
{
var xe = typeof WeakMap == "function" ? WeakMap : Map;
re = new xe();
}
function D(p, _) {
if (!p || Z)
return "";
{
var F = re.get(p);
if (F !== void 0)
return F;
}
var b;
Z = !0;
var G = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var q;
q = Y.current, Y.current = null, B();
try {
if (_) {
var V = function() {
throw Error();
};
if (Object.defineProperty(V.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(V, []);
} catch (be) {
b = be;
}
Reflect.construct(p, [], V);
} else {
try {
V.call();
} catch (be) {
b = be;
}
p.call(V.prototype);
}
} else {
try {
throw Error();
} catch (be) {
b = be;
}
p();
}
} catch (be) {
if (be && b && typeof be.stack == "string") {
for (var z = be.stack.split(`
`), X = b.stack.split(`
`), ae = z.length - 1, le = X.length - 1; ae >= 1 && le >= 0 && z[ae] !== X[le]; )
le--;
for (; ae >= 1 && le >= 0; ae--, le--)
if (z[ae] !== X[le]) {
if (ae !== 1 || le !== 1)
do
if (ae--, le--, le < 0 || z[ae] !== X[le]) {
var we = `
` + z[ae].replace(" at new ", " at ");
return p.displayName && we.includes("<anonymous>") && (we = we.replace("<anonymous>", p.displayName)), typeof p == "function" && re.set(p, we), we;
}
while (ae >= 1 && le >= 0);
break;
}
}
} finally {
Z = !1, Y.current = q, U(), Error.prepareStackTrace = G;
}
var he = p ? p.displayName || p.name : "", ke = he ? Q(he) : "";
return typeof p == "function" && re.set(p, ke), ke;
}
function Ne(p, _, F) {
return D(p, !1);
}
function ye(p) {
var _ = p.prototype;
return !!(_ && _.isReactComponent);
}
function Te(p, _, F) {
if (p == null)
return "";
if (typeof p == "function")
return D(p, ye(p));
if (typeof p == "string")
return Q(p);
switch (p) {
case f:
return Q("Suspense");
case l:
return Q("SuspenseList");
}
if (typeof p == "object")
switch (p.$$typeof) {
case o:
return Ne(p.render);
case h:
return Te(p.type, _, F);
case x: {
var b = p, G = b._payload, q = b._init;
try {
return Te(q(G), _, F);
} catch {
}
}
}
return "";
}
var pe = Object.prototype.hasOwnProperty, de = {}, Ee = S.ReactDebugCurrentFrame;
function Pe(p) {
if (p) {
var _ = p._owner, F = Te(p.type, p._source, _ ? _.type : null);
Ee.setExtraStackFrame(F);
} else
Ee.setExtraStackFrame(null);
}
function ur(p, _, F, b, G) {
{
var q = Function.call.bind(pe);
for (var V in p)
if (q(p, V)) {
var z = void 0;
try {
if (typeof p[V] != "function") {
var X = Error((b || "React class") + ": " + F + " type `" + V + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof p[V] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw X.name = "Invariant Violation", X;
}
z = p[V](_, V, b, F, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (ae) {
z = ae;
}
z && !(z instanceof Error) && (Pe(G), A("%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).", b || "React class", F, V, typeof z), Pe(null)), z instanceof Error && !(z.message in de) && (de[z.message] = !0, Pe(G), A("Failed %s type: %s", F, z.message), Pe(null));
}
}
}
var sr = Array.isArray;
function xr(p) {
return sr(p);
}
function br(p) {
{
var _ = typeof Symbol == "function" && Symbol.toStringTag, F = _ && p[Symbol.toStringTag] || p.constructor.name || "Object";
return F;
}
}
function Ge(p) {
try {
return ir(p), !1;
} catch {
return !0;
}
}
function ir(p) {
return "" + p;
}
function Ye(p) {
if (Ge(p))
return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", br(p)), ir(p);
}
var Ze = S.ReactCurrentOwner, Qe = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Ar, Oe, ne;
ne = {};
function K(p) {
if (pe.call(p, "ref")) {
var _ = Object.getOwnPropertyDescriptor(p, "ref").get;
if (_ && _.isReactWarning)
return !1;
}
return p.ref !== void 0;
}
function oe(p) {
if (pe.call(p, "key")) {
var _ = Object.getOwnPropertyDescriptor(p, "key").get;
if (_ && _.isReactWarning)
return !1;
}
return p.key !== void 0;
}
function Fe(p, _) {
if (typeof p.ref == "string" && Ze.current && _ && Ze.current.stateNode !== _) {
var F = H(Ze.current.type);
ne[F] || (A('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', H(Ze.current.type), p.ref), ne[F] = !0);
}
}
function qe(p, _) {
{
var F = function() {
Ar || (Ar = !0, A("%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)", _));
};
F.isReactWarning = !0, Object.defineProperty(p, "key", {
get: F,
configurable: !0
});
}
}
function Le(p, _) {
{
var F = function() {
Oe || (Oe = !0, A("%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)", _));
};
F.isReactWarning = !0, Object.defineProperty(p, "ref", {
get: F,
configurable: !0
});
}
}
var Me = function(p, _, F, b, G, q, V) {
var z = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: t,
// Built-in properties that belong on the element
type: p,
key: _,
ref: F,
props: V,
// Record the component responsible for creating this element.
_owner: q
};
return z._store = {}, Object.defineProperty(z._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(z, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: b
}), Object.defineProperty(z, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: G
}), Object.freeze && (Object.freeze(z.props), Object.freeze(z)), z;
};
function pr(p, _, F, b, G) {
{
var q, V = {}, z = null, X = null;
F !== void 0 && (Ye(F), z = "" + F), oe(_) && (Ye(_.key), z = "" + _.key), K(_) && (X = _.ref, Fe(_, G));
for (q in _)
pe.call(_, q) && !Qe.hasOwnProperty(q) && (V[q] = _[q]);
if (p && p.defaultProps) {
var ae = p.defaultProps;
for (q in ae)
V[q] === void 0 && (V[q] = ae[q]);
}
if (z || X) {
var le = typeof p == "function" ? p.displayName || p.name || "Unknown" : p;
z && qe(V, le), X && Le(V, le);
}
return Me(p, z, X, G, b, Ze.current, V);
}
}
var jr = S.ReactCurrentOwner, nt = S.ReactDebugCurrentFrame;
function Ie(p) {
if (p) {
var _ = p._owner, F = Te(p.type, p._source, _ ? _.type : null);
nt.setExtraStackFrame(F);
} else
nt.setExtraStackFrame(null);
}
var ze;
ze = !1;
function Gr(p) {
return typeof p == "object" && p !== null && p.$$typeof === t;
}
function Wn() {
{
if (jr.current) {
var p = H(jr.current.type);
if (p)
return `
Check the render method of \`` + p + "`.";
}
return "";
}
}
function Ps(p) {
return "";
}
var Hn = {};
function Ls(p) {
{
var _ = Wn();
if (!_) {
var F = typeof p == "string" ? p : p.displayName || p.name;
F && (_ = `
Check the top-level render call using <` + F + ">.");
}
return _;
}
}
function Vn(p, _) {
{
if (!p._store || p._store.validated || p.key != null)
return;
p._store.validated = !0;
var F = Ls(_);
if (Hn[F])
return;
Hn[F] = !0;
var b = "";
p && p._owner && p._owner !== jr.current && (b = " It was passed a child from " + H(p._owner.type) + "."), Ie(p), A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', F, b), Ie(null);
}
}
function zn(p, _) {
{
if (typeof p != "object")
return;
if (xr(p))
for (var F = 0; F < p.length; F++) {
var b = p[F];
Gr(b) && Vn(b, _);
}
else if (Gr(p))
p._store && (p._store.validated = !0);
else if (p) {
var G = g(p);
if (typeof G == "function" && G !== p.entries)
for (var q = G.call(p), V; !(V = q.next()).done; )
Gr(V.value) && Vn(V.value, _);
}
}
}
function Ms(p) {
{
var _ = p.type;
if (_ == null || typeof _ == "string")
return;
var F;
if (typeof _ == "function")
F = _.propTypes;
else if (typeof _ == "object" && (_.$$typeof === o || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
_.$$typeof === h))
F = _.propTypes;
else
return;
if (F) {
var b = H(_);
ur(F, p.props, "prop", b, p);
} else if (_.PropTypes !== void 0 && !ze) {
ze = !0;
var G = H(_);
A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", G || "Unknown");
}
typeof _.getDefaultProps == "function" && !_.getDefaultProps.isReactClassApproved && A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function Bs(p) {
{
for (var _ = Object.keys(p.props), F = 0; F < _.length; F++) {
var b = _[F];
if (b !== "children" && b !== "key") {
Ie(p), A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", b), Ie(null);
break;
}
}
p.ref !== null && (Ie(p), A("Invalid attribute `ref` supplied to `React.Fragment`."), Ie(null));
}
}
var Ca = {};
function Gn(p, _, F, b, G, q) {
{
var V = P(p);
if (!V) {
var z = "";
(p === void 0 || typeof p == "object" && p !== null && Object.keys(p).length === 0) && (z += " 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 X = Ps();
X ? z += X : z += Wn();
var ae;
p === null ? ae = "null" : xr(p) ? ae = "array" : p !== void 0 && p.$$typeof === t ? (ae = "<" + (H(p.type) || "Unknown") + " />", z = " Did you accidentally export a JSX literal instead of a component?") : ae = typeof p, A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ae, z);
}
var le = pr(p, _, F, G, q);
if (le == null)
return le;
if (V) {
var we = _.children;
if (we !== void 0)
if (b)
if (xr(we)) {
for (var he = 0; he < we.length; he++)
zn(we[he], p);
Object.freeze && Object.freeze(we);
} else
A("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
zn(we, p);
}
if (pe.call(_, "key")) {
var ke = H(p), be = Object.keys(_).filter(function(Rr) {
return Rr !== "key";
}), nr = be.length > 0 ? "{key: someKey, " + be.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!Ca[ke + nr]) {
var cr = be.length > 0 ? "{" + be.join(": ..., ") + ": ...}" : "{}";
A(`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} />`, nr, ke, cr, ke), Ca[ke + nr] = !0;
}
}
return p === a ? Bs(le) : Ms(le), le;
}
}
function js(p, _, F) {
return Gn(p, _, F, !0);
}
function Us(p, _, F) {
return Gn(p, _, F, !1);
}
var T = Us, R = js;
Ja.Fragment = a, Ja.jsx = T, Ja.jsxs = R;
}()), Ja;
}
process.env.NODE_ENV === "production" ? ci.exports = su() : ci.exports = iu();
var u = ci.exports;
function We(...e) {
return ru(eu(e));
}
const oi = Kc(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline"
},
size: {
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
icon: "h-10 w-10"
}
},
defaultVariants: {
variant: "default",
size: "default"
}
}
), Se = $e.forwardRef(
({ className: e, variant: t, size: r, asChild: a = !1, ...n }, s) => {
const i = a ? Ql : "button";
return /* @__PURE__ */ u.jsx(
i,
{
className: We(oi({ variant: t, size: r, className: e })),
ref: s,
...n
}
);
}
);
Se.displayName = "Button";
const pa = $e.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u.jsx(
ii.Root,
{
ref: r,
className: We(
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
e
),
...t,
children: /* @__PURE__ */ u.jsx(
ii.Indicator,
{
className: We("flex items-center justify-center text-current"),
children: /* @__PURE__ */ u.jsx(Mt, { className: "h-4 w-4" })
}
)
}
));
pa.displayName = ii.Root.displayName;
const bi = yr.Root, Ai = yr.Trigger, cu = $e.forwardRef(({ className: e, inset: t, children: r, ...a }, n) => /* @__PURE__ */ u.jsxs(
yr.SubTrigger,
{
ref: n,
className: We(
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
t && "pl-8",
e
),
...a,
children: [
r,
/* @__PURE__ */ u.jsx(Si, { className: "ml-auto h-4 w-4" })
]
}
));
cu.displayName = yr.SubTrigger.displayName;
const ou = $e.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u.jsx(
yr.SubContent,
{
ref: r,
className: We(
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
e
),
...t
}
));
ou.displayName = yr.SubContent.displayName;
const Ts = $e.forwardRef(({ className: e, sideOffset: t = 4, ...r }, a) => /* @__PURE__ */ u.jsx(yr.Portal, { children: /* @__PURE__ */ u.jsx(
yr.Content,
{
ref: a,
sideOffset: t,
className: We(
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
e
),
...r
}
) }));
Ts.displayName = yr.Content.displayName;
const lt = $e.forwardRef(({ className: e, inset: t, ...r }, a) => /* @__PURE__ */ u.jsx(
yr.Item,
{
ref: a,
className: We(
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
t && "pl-8",
e
),
...r
}
));
lt.displayName = yr.Item.displayName;
const fu = $e.forwardRef(({ className: e, children: t, checked: r, ...a }, n) => /* @__PURE__ */ u.jsxs(
yr.CheckboxItem,
{
ref: n,
className: We(
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
e
),
checked: r,
...a,
children: [
/* @__PURE__ */ u.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ u.jsx(yr.ItemIndicator, { children: /* @__PURE__ */ u.jsx(Mt, { className: "h-4 w-4" }) }) }),
t
]
}
));
fu.displayName = yr.CheckboxItem.displayName;
const lu = $e.forwardRef(({ className: e, children: t, ...r }, a) => /* @__PURE__ */ u.jsxs(
yr.RadioItem,
{
ref: a,
className: We(
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
e
),
...r,
children: [
/* @__PURE__ */ u.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ u.jsx(yr.ItemIndicator, { children: /* @__PURE__ */ u.jsx(Fl, { className: "h-2 w-2 fill-current" }) }) }),
t
]
}
));
lu.displayName = yr.RadioItem.displayName;
const uu = $e.forwardRef(({ className: e, inset: t, ...r }, a) => /* @__PURE__ */ u.jsx(
yr.Label,
{
ref: a,
className: We(
"px-2 py-1.5 text-sm font-semibold",
t && "pl-8",
e
),
...r
}
));
uu.displayName = yr.Label.displayName;
const hu = $e.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u.jsx(
yr.Separator,
{
ref: r,
className: We("-mx-1 my-1 h-px bg-muted", e),
...t
}
));
hu.displayName = yr.Separator.displayName;
const du = 1, xu = 1e6;
let Hs = 0;
function pu() {
return Hs = (Hs + 1) % Number.MAX_SAFE_INTEGER, Hs.toString();
}
const Vs = /* @__PURE__ */ new Map(), S0 = (e) => {
if (Vs.has(e))
return;
const t = setTimeout(() => {
Vs.delete(e), an({
type: "REMOVE_TOAST",
toastId: e
});
}, xu);
Vs.set(e, t);
}, mu = (e, t) => {
switch (t.type) {
case "ADD_TOAST":
return {
...e,
toasts: [t.toast, ...e.toasts].slice(0, du)
};
case "UPDATE_TOAST":
return {
...e,
toasts: e.toasts.map(
(r) => r.id === t.toast.id ? { ...r, ...t.toast } : r
)
};
case "DISMISS_TOAST": {
const { toastId: r } = t;
return r ? S0(r) : e.toasts.forEach((a) => {
S0(a.id);
}), {
...e,
toasts: e.toasts.map(
(a) => a.id === r || r === void 0 ? {
...a,
open: !1
} : a
)
};
}
case "REMOVE_TOAST":
return t.toastId === void 0 ? {
...e,
toasts: []
} : {
...e,
toasts: e.toasts.filter((r) => r.id !== t.toastId)
};
}
}, cs = [];
let os = { toasts: [] };
function an(e) {
os = mu(os, e), cs.forEach((t) => {
t(os);
});
}
function vu({ ...e }) {
const t = pu(), r = (n) => an({
type: "UPDATE_TOAST",
toast: { ...n, id: t }
}), a = () => an({ type: "DISMISS_TOAST", toastId: t });
return an({
type: "ADD_TOAST",
toast: {
...e,
id: t,
open: !0,
onOpenChange: (n) => {
n || a();
}
}
}), {
id: t,
dismiss: a,
update: r
};
}
function Yc() {
const [e, t] = $e.useState(os);
return $e.useEffect(() => (cs.push(t), () => {
const r = cs.indexOf(t);
r > -1 && cs.splice(r, 1);
}), [e]), {
...e,
toast: vu,
dismiss: (r) => an({ type: "DISMISS_TOAST", toastId: r })
};
}
function Ss() {
return (Ss = Object.assign || function(e) {
for (var t = 1; t < arguments.length; t++) {
var r = arguments[t];
for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a]);
}
return e;
}).apply(this, arguments);
}
function qc(e, t) {
if (e == null) return {};
var r, a, n = {}, s = Object.keys(e);
for (a = 0; a < s.length; a++) t.indexOf(r = s[a]) >= 0 || (n[r] = e[r]);
return n;
}
function fi(e) {
var t = qr(e), r = qr(function(a) {
t.current && t.current(a);
});
return t.current = e, r.current;
}
var vn = function(e, t, r) {
return t === void 0 && (t = 0), r === void 0 && (r = 1), e > r ? r : e < t ? t : e;
}, nn = function(e) {
return "touches" in e;
}, li = function(e) {
return e && e.ownerDocument.defaultView || self;
}, F0 = function(e, t, r) {
var a = e.getBoundingClientRect(), n = nn(t) ? function(s, i) {
for (var c = 0; c < s.length; c++) if (s[c].identifier === i) return s[c];
return s[0];
}(t.touches, r) : t;
return { left: vn((n.pageX - (a.left + li(e).pageXOffset)) / a.width), top: vn((n.pageY - (a.top + li(e).pageYOffset)) / a.height) };
}, b0 = function(e) {
!nn(e) && e.preventDefault();
}, Jc = Lr.memo(function(e) {
var t = e.onMove, r = e.onKey, a = qc(e, ["onMove", "onKey"]), n = qr(null), s = fi(t), i = fi(r), c = qr(null), o = qr(!1), f = pn(function() {
var m = function(g) {
b0(g), (nn(g) ? g.touches.length > 0 : g.buttons > 0) && n.current ? s(F0(n.current, g, c.current)) : d(!1);
}, v = function() {
return d(!1);
};
function d(g) {
var S = o.current, A = li(n.current), k = g ? A.addEventListener : A.removeEventListener;
k(S ? "touchmove" : "mousemove", m), k(S ? "touchend" : "mouseup", v);
}
return [function(g) {
var S = g.nativeEvent, A = n.current;
if (A && (b0(S), !function(O, L) {
return L && !nn(O);
}(S, o.current) && A)) {
if (nn(S)) {
o.current = !0;
var k = S.changedTouches || [];
k.length && (c.current = k[0].identifier);
}
A.focus(), s(F0(A, S, c.current)), d(!0);
}
}, function(g) {
var S = g.which || g.keyCode;
S < 37 || S > 40 || (g.preventDefault(), i({ left: S === 39 ? 0.05 : S === 37 ? -0.05 : 0, top: S === 40 ? 0.05 : S === 38 ? -0.05 : 0 }));
}, d];
}, [i, s]), l = f[0], h = f[1], x = f[2];
return Br(function() {
return x;
}, [x]), Lr.createElement("div", Ss({}, a, { onTouchStart: l, onMouseDown: l, className: "react-colorful__interactive", ref: n, onKeyDown: h, tabIndex: 0, role: "slider" }));
}), Ci = function(e) {
return e.filter(Boolean).join(" ");
}, Zc = function(e) {
var t = e.color, r = e.left, a = e.top, n = a === void 0 ? 0.5 : a, s = Ci(["react-colorful__pointer", e.className]);
return Lr.createElement("div", { className: s, style: { top: 100 * n + "%", left: 100 * r + "%" } }, Lr.createElement("div", { className: "react-colorful__pointer-fill", style: { backgroundColor: t } }));
}, zr = function(e, t, r) {
return t === void 0 && (t = 0), r === void 0 && (r = Math.pow(10, t)), Math.round(r * e) / r;
}, gu = function(e) {
return Eu(ui(e));
}, ui = function(e) {
return e[0] === "#" && (e = e.substring(1)), e.length < 6 ? { r: parseInt(e[0] + e[0], 16), g: parseInt(e[1] + e[1], 16), b: parseInt(e[2] + e[2], 16), a: e.length === 4 ? zr(parseInt(e[3] + e[3], 16) / 255, 2) : 1 } : { r: parseInt(e.substring(0, 2), 16), g: parseInt(e.substring(2, 4), 16), b: parseInt(e.substring(4, 6), 16), a: e.length === 8 ? zr(parseInt(e.substring(6, 8), 16) / 255, 2) : 1 };
}, wu = function(e) {
return yu(ku(e));
}, _u = function(e) {
var t = e.s, r = e.v, a = e.a, n = (200 - t) * r / 100;
return { h: zr(e.h), s: zr(n > 0 && n < 200 ? t * r / 100 / (n <= 100 ? n : 200 - n) * 100 : 0), l: zr(n / 2), a: zr(a, 2) };
}, hi = function(e) {
var t = _u(e);
return "hsl(" + t.h + ", " + t.s + "%, " + t.l + "%)";
}, ku = function(e) {
var t = e.h, r = e.s, a = e.v, n = e.a;
t = t / 360 * 6, r /= 100, a /= 100;
var s = Math.floor(t), i = a * (1 - r), c = a * (1 - (t - s) * r), o = a * (1 - (1 - t + s) * r), f = s % 6;
return { r: zr(255 * [a, c, i, i, o, a][f]), g: zr(255 * [o, a, a, c, i, i][f]), b: zr(255 * [i, i, o, a, a, c][f]), a: zr(n, 2) };
}, $n = function(e) {
var t = e.toString(16);
return t.length < 2 ? "0" + t : t;
}, yu = function(e) {
var t = e.r, r = e.g, a = e.b, n = e.a, s = n < 1 ? $n(zr(255 * n)) : "";
return "#" + $n(t) + $n(r) + $n(a) + s;
}, Eu = function(e) {
var t = e.r, r = e.g, a = e.b, n = e.a, s = Math.max(t, r, a), i = s - Math.min(t, r, a), c = i ? s === t ? (r - a) / i : s === r ? 2 + (a - t) / i : 4 + (t - r) / i : 0;
return { h: zr(60 * (c < 0 ? c + 6 : c)), s: zr(s ? i / s * 100 : 0), v: zr(s / 255 * 100), a: n };
}, Tu = Lr.memo(function(e) {
var t = e.hue, r = e.onChange, a = Ci(["react-colorful__hue", e.className]);
return Lr.createElement("div", { className: a }, Lr.createElement(Jc, { onMove: function(n) {
r({ h: 360 * n.left });
}, onKey: function(n) {
r({ h: vn(t + 360 * n.left, 0, 360) });
}, "aria-label": "Hue", "aria-valuenow": zr(t), "aria-valuemax": "360", "aria-valuemin": "0" }, Lr.createElement(Zc, { className: "react-colorful__hue-pointer", left: t / 360, color: hi({ h: t, s: 100, v: 100, a: 1 }) })));
}), Su = Lr.memo(function(e) {
var t = e.hsva, r = e.onChange, a = { backgroundColor: hi({ h: t.h, s: 100, v: 100, a: 1 }) };
return Lr.createElement("div", { className: "react-colorful__saturation", style: a }, Lr.createElement(Jc, { onMove: function(n) {
r({ s: 100 * n.left, v: 100 - 100 * n.top });
}, onKey: function(n) {
r({ s: vn(t.s + 100 * n.left, 0, 100), v: vn(t.v - 100 * n.top, 0, 100) });
}, "aria-label": "Color", "aria-valuetext": "Saturation " + zr(t.s) + "%, Brightness " + zr(t.v) + "%" }, Lr.createElement(Zc, { className: "react-colorful__saturation-pointer", top: 1 - t.v / 100, left: t.s / 100, color: hi(t) })));
}), Qc = function(e, t) {
if (e === t) return !0;
for (var r in e) if (e[r] !== t[r]) return !1;
return !0;
}, Fu = function(e, t) {
return e.toLowerCase() === t.toLowerCase() || Qc(ui(e), ui(t));
};
function bu(e, t, r) {
var a = fi(r), n = Be(function() {
return e.toHsva(t);
}), s = n[0], i = n[1], c = qr({ color: t, hsva: s });
Br(function() {
if (!e.equal(t, c.current.color)) {
var f = e.toHsva(t);
c.current = { hsva: f, color: t }, i(f);
}
}, [t, e]), Br(function() {
var f;
Qc(s, c.current.hsva) || e.equal(f = e.fromHsva(s), c.current.color) || (c.current = { hsva: s, color: f }, a(f));
}, [s, e, a]);
var o = is(function(f) {
i(function(l) {
return Object.assign({}, l, f);
});
}, []);
return [s, o];
}
var Au = typeof window < "u" ? _l : Br, Cu = function() {
return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : void 0;
}, A0 = /* @__PURE__ */ new Map(), Nu = function(e) {
Au(function() {
var t = e.current ? e.current.ownerDocument : document;
if (t !== void 0 && !A0.has(t)) {
var r = t.createElement("style");
r.innerHTML = `.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`, A0.set(t, r);
var a = Cu();
a && r.setAttribute("nonce", a), t.head.appendChild(r);
}
}, []);
}, Du = function(e) {
var t = e.className, r = e.colorModel, a = e.color, n = a === void 0 ? r.defaultColor : a, s = e.onChange, i = qc(e, ["className", "colorModel", "color", "onChange"]), c = qr(null);
Nu(c);
var o = bu(r, n, s), f = o[0], l = o[1], h = Ci(["react-colorful", t]);
return Lr.createElement("div", Ss({}, i, { ref: c, className: h }), Lr.createElement(Su, { hsva: f, onChange: l }), Lr.createElement(Tu, { hue: f.h, onChange: l, className: "react-colorful__last-control" }));
}, Ru = { defaultColor: "000", toHsva: gu, fromHsva: function(e) {
return wu({ h: e.h, s: e.s, v: e.v, a: 1 });
}, equal: Fu }, Ou = function(e) {
return Lr.createElement(Du, Ss({}, e, { colorModel: Ru }));
};
const Dn = mn.Root, Rn = mn.Trigger, Ha = $e.forwardRef(({ className: e, align: t = "center", sideOffset: r = 4, ...a }, n) => /* @__PURE__ */ u.jsx(mn.Portal, { children: /* @__PURE__ */ u.jsx(
mn.Content,
{
ref: n,
align: t,
sideOffset: r,
className: We(
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
e
),
...a
}
) }));
Ha.displayName = mn.Content.displayName;
const eo = $e.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u.jsx(
"div",
{
ref: r,
className: We(
"rounded-lg border bg-card text-card-foreground shadow-sm",
e
),
...t
}
));
eo.displayName = "Card";
const Iu = $e.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u.jsx(
"div",
{
ref: r,
className: We("flex flex-col space-y-1.5 p-6", e),
...t
}
));
Iu.displayName = "CardHeader";
const Pu = $e.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u.jsx(
"h3",
{
ref: r,
className: We(
"text-2xl font-semibold leading-none tracking-tight",
e
),
...t
}
));
Pu.displayName = "CardTitle";
const Lu = $e.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u.jsx(
"p",
{
ref: r,
className: We("text-sm text-muted-foreground", e),
...t
}
));
Lu.displayName = "CardDescription";
const Mu = $e.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u.jsx("div", { ref: r, className: We("p-6 pt-0", e), ...t }));
Mu.displayName = "CardContent";
const Bu = $e.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ u.jsx(
"div",
{
ref: r,
className: We("flex items-center p-6 pt-0", e),
...t
}
));
Bu.displayName = "CardFooter";
const ju = [
"#3B82F6",
// Blue
"#8B5CF6",
// Purple
"#10B981",
// Green
"#F59E0B",
// Amber
"#EF4444",
// Red
"#EC4899",
// Pink
"#6366F1",
// Indigo
"#14B8A6"
// Teal
];
function Uu({ theme: e, onThemeChange: t }) {
const [r, a] = Be(!1), [n, s] = Be(e.primaryColor || "#3B82F6"), i = (f) => {
s(f);
}, c = (f) => {
const l = Wu(f);
document.documentElement.style.setProperty("--primary", l), document.documentElement.style.setProperty("--primary-hover", `${l.split(" ")[0]} ${l.split(" ")[1]} ${Math.max(parseInt(l.split(" ")[2]) - 5, 5)}%`), document.documentElement.style.setProperty("--primary-light", `${l.split(" ")[0]} ${l.split(" ")[1]} 85%`), t({ ...e, primaryColor: f }), a(!1);
}, o = () => {
const f = e.mode === "light" ? "dark" : "light";
document.documentElement.classList.toggle("dark", f === "dark"), t({ ...e, mode: f });
};
return /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
/* @__PURE__ */ u.jsxs(
Se,
{
variant: "outline",
size: "sm",
onClick: o,
className: "flex items-center gap-2",
children: [
e.mode === "light" ? /* @__PURE__ */ u.jsx(bl, { className: "w-4 h-4" }) : /* @__PURE__ */ u.jsx(Al, { className: "w-4 h-4" }),
e.mode === "light" ? "Light" : "Dark"
]
}
),
/* @__PURE__ */ u.jsxs(Dn, { open: r, onOpenChange: a, children: [
/* @__PURE__ */ u.jsx(Rn, { asChild: !0, children: /* @__PURE__ */ u.jsxs(Se, { variant: "outline", size: "sm", className: "flex items-center gap-2", children: [
/* @__PURE__ */ u.jsx(Cl, { className: "w-4 h-4" }),
"Theme"
] }) }),
/* @__PURE__ */ u.jsx(Ha, { className: "w-80 p-4", align: "end", children: /* @__PURE__ */ u.jsx(eo, { className: "p-4", children: /* @__PURE__ */ u.jsxs("div", { className: "space-y-4", children: [
/* @__PURE__ */ u.jsxs("div", { children: [
/* @__PURE__ */ u.jsx("h4", { className: "text-sm font-medium mb-3", children: "Choose Primary Color" }),
/* @__PURE__ */ u.jsx("div", { className: "grid grid-cols-4 gap-2 mb-4", children: ju.map((f) => /* @__PURE__ */ u.jsx(
"button",
{
className: "w-8 h-8 rounded border-2 border-border hover:scale-110 transition-transform",
style: { backgroundColor: f },
onClick: () => c(f)
},
f
)) })
] }),
/* @__PURE__ */ u.jsxs("div", { children: [
/* @__PURE__ */ u.jsx("h4", { className: "text-sm font-medium mb-3", children: "Custom Color" }),
/* @__PURE__ */ u.jsxs("div", { className: "space-y-3", children: [
/* @__PURE__ */ u.jsx(
Ou,
{
color: n,
onChange: i,
style: { width: "100%", height: "150px" }
}
),
/* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
/* @__PURE__ */ u.jsx(
"input",
{
type: "text",
value: n,
onChange: (f) => s(f.target.value),
className: "flex-1 px-2 py-1 text-sm border rounded bg-background",
placeholder: "#3B82F6"
}
),
/* @__PURE__ */ u.jsx(Se, { size: "sm", onClick: () => c(n), children: "Apply" })
] })
] })
] })
] }) }) })
] })
] });
}
function Wu(e) {
const t = parseInt(e.slice(1, 3), 16) / 255, r = parseInt(e.slice(3, 5), 16) / 255, a = parseInt(e.slice(5, 7), 16) / 255, n = Math.max(t, r, a), s = Math.min(t, r, a);
let i, c, o = (n + s) / 2;
if (n === s)
i = c = 0;
else {
const f = n - s;
switch (c = o > 0.5 ? f / (2 - n - s) : f / (n + s), n) {
case t:
i = (r - a) / f + (r < a ? 6 : 0);
break;
case r:
i = (a - t) / f + 2;
break;
case a:
i = (t - r) / f + 4;
break;
default:
i = 0;
}
i /= 6;
}
return `${Math.round(i * 360)} ${Math.round(c * 100)}% ${Math.round(o * 100)}%`;
}
/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
var ls = {};
ls.version = "0.18.5";
var ro = 1252, Hu = [874, 932, 936, 949, 950, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1e4], Ni = {
/*::[*/
0: 1252,
/* ANSI */
/*::[*/
1: 65001,
/* DEFAULT */
/*::[*/
2: 65001,
/* SYMBOL */
/*::[*/
77: 1e4,
/* MAC */
/*::[*/
128: 932,
/* SHIFTJIS */
/*::[*/
129: 949,
/* HANGUL */
/*::[*/
130: 1361,
/* JOHAB */
/*::[*/
134: 936,
/* GB2312 */
/*::[*/
136: 950,
/* CHINESEBIG5 */
/*::[*/
161: 1253,
/* GREEK */
/*::[*/
162: 1254,
/* TURKISH */
/*::[*/
163: 1258,
/* VIETNAMESE */
/*::[*/
177: 1255,
/* HEBREW */
/*::[*/
178: 1256,
/* ARABIC */
/*::[*/
186: 1257,
/* BALTIC */
/*::[*/
204: 1251,
/* RUSSIAN */
/*::[*/
222: 874,
/* THAI */
/*::[*/
238: 1250,
/* EASTEUROPE */
/*::[*/
255: 1252,
/* OEM */
/*::[*/
69: 6969
/* MISC */
}, Di = function(e) {
Hu.indexOf(e) != -1 && (ro = Ni[0] = e);
};
function Vu() {
Di(1252);
}
var At = function(e) {
Di(e);
};
function Ri() {
At(1200), Vu();
}
function C0(e) {
for (var t = [], r = 0, a = e.length; r < a; ++r) t[r] = e.charCodeAt(r);
return t;
}
function zu(e) {
for (var t = [], r = 0; r < e.length >> 1; ++r) t[r] = String.fromCharCode(e.charCodeAt(2 * r) + (e.charCodeAt(2 * r + 1) << 8));
return t.join("");
}
function to(e) {
for (var t = [], r = 0; r < e.length >> 1; ++r) t[r] = String.fromCharCode(e.charCodeAt(2 * r + 1) + (e.charCodeAt(2 * r) << 8));
return t.join("");
}
var Qa = function(e) {
var t = e.charCodeAt(0), r = e.charCodeAt(1);
return t == 255 && r == 254 ? zu(e.slice(2)) : t == 254 && r == 255 ? to(e.slice(2)) : t == 65279 ? e.slice(1) : e;
}, Xn = function(t) {
return String.fromCharCode(t);
}, N0 = function(t) {
return String.fromCharCode(t);
}, qt, Jt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234