@nafr/echo-ui
Version:
A UI library born for WAA
1,759 lines (1,755 loc) • 685 kB
JavaScript
import bc, { useCallback as Ct, useRef as J, useEffect as rt, createContext as Br, forwardRef as It, useContext as er, useState as K, useImperativeHandle as un, useMemo as Rt, isValidElement as gh } from "react";
var Ai = { exports: {} }, ur = {};
/**
* @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 fa;
function _h() {
return fa || (fa = 1, process.env.NODE_ENV !== "production" && function() {
var e = bc, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), a = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), f = Symbol.for("react.offscreen"), p = Symbol.iterator, m = "@@iterator";
function g(A) {
if (A === null || typeof A != "object")
return null;
var L = p && A[p] || A[m];
return typeof L == "function" ? L : null;
}
var _ = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function w(A) {
{
for (var L = arguments.length, U = new Array(L > 1 ? L - 1 : 0), et = 1; et < L; et++)
U[et - 1] = arguments[et];
k("error", A, U);
}
}
function k(A, L, U) {
{
var et = _.ReactDebugCurrentFrame, mt = et.getStackAddendum();
mt !== "" && (L += "%s", U = U.concat([mt]));
var yt = U.map(function(pt) {
return String(pt);
});
yt.unshift("Warning: " + L), Function.prototype.apply.call(console[A], console, yt);
}
}
var v = !1, y = !1, C = !1, S = !1, x = !1, O;
O = Symbol.for("react.module.reference");
function E(A) {
return !!(typeof A == "string" || typeof A == "function" || A === r || A === i || x || A === s || A === l || A === u || S || A === f || v || y || C || typeof A == "object" && A !== null && (A.$$typeof === d || A.$$typeof === h || A.$$typeof === o || A.$$typeof === a || A.$$typeof === c || // 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.
A.$$typeof === O || A.getModuleId !== void 0));
}
function T(A, L, U) {
var et = A.displayName;
if (et)
return et;
var mt = L.displayName || L.name || "";
return mt !== "" ? U + "(" + mt + ")" : U;
}
function b(A) {
return A.displayName || "Context";
}
function N(A) {
if (A == null)
return null;
if (typeof A.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof A == "function")
return A.displayName || A.name || null;
if (typeof A == "string")
return A;
switch (A) {
case r:
return "Fragment";
case n:
return "Portal";
case i:
return "Profiler";
case s:
return "StrictMode";
case l:
return "Suspense";
case u:
return "SuspenseList";
}
if (typeof A == "object")
switch (A.$$typeof) {
case a:
var L = A;
return b(L) + ".Consumer";
case o:
var U = A;
return b(U._context) + ".Provider";
case c:
return T(A, A.render, "ForwardRef");
case h:
var et = A.displayName || null;
return et !== null ? et : N(A.type) || "Memo";
case d: {
var mt = A, yt = mt._payload, pt = mt._init;
try {
return N(pt(yt));
} catch {
return null;
}
}
}
return null;
}
var M = Object.assign, D = 0, I, R, $, P, j, W, H;
function G() {
}
G.__reactDisabledLog = !0;
function at() {
{
if (D === 0) {
I = console.log, R = console.info, $ = console.warn, P = console.error, j = console.group, W = console.groupCollapsed, H = console.groupEnd;
var A = {
configurable: !0,
enumerable: !0,
value: G,
writable: !0
};
Object.defineProperties(console, {
info: A,
log: A,
warn: A,
error: A,
group: A,
groupCollapsed: A,
groupEnd: A
});
}
D++;
}
}
function X() {
{
if (D--, D === 0) {
var A = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: M({}, A, {
value: I
}),
info: M({}, A, {
value: R
}),
warn: M({}, A, {
value: $
}),
error: M({}, A, {
value: P
}),
group: M({}, A, {
value: j
}),
groupCollapsed: M({}, A, {
value: W
}),
groupEnd: M({}, A, {
value: H
})
});
}
D < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var it = _.ReactCurrentDispatcher, q;
function F(A, L, U) {
{
if (q === void 0)
try {
throw Error();
} catch (mt) {
var et = mt.stack.trim().match(/\n( *(at )?)/);
q = et && et[1] || "";
}
return `
` + q + A;
}
}
var V = !1, tt;
{
var bt = typeof WeakMap == "function" ? WeakMap : Map;
tt = new bt();
}
function gt(A, L) {
if (!A || V)
return "";
{
var U = tt.get(A);
if (U !== void 0)
return U;
}
var et;
V = !0;
var mt = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var yt;
yt = it.current, it.current = null, at();
try {
if (L) {
var pt = function() {
throw Error();
};
if (Object.defineProperty(pt.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(pt, []);
} catch (je) {
et = je;
}
Reflect.construct(A, [], pt);
} else {
try {
pt.call();
} catch (je) {
et = je;
}
A.call(pt.prototype);
}
} else {
try {
throw Error();
} catch (je) {
et = je;
}
A();
}
} catch (je) {
if (je && et && typeof je.stack == "string") {
for (var ht = je.stack.split(`
`), ne = et.stack.split(`
`), Vt = ht.length - 1, Wt = ne.length - 1; Vt >= 1 && Wt >= 0 && ht[Vt] !== ne[Wt]; )
Wt--;
for (; Vt >= 1 && Wt >= 0; Vt--, Wt--)
if (ht[Vt] !== ne[Wt]) {
if (Vt !== 1 || Wt !== 1)
do
if (Vt--, Wt--, Wt < 0 || ht[Vt] !== ne[Wt]) {
var ge = `
` + ht[Vt].replace(" at new ", " at ");
return A.displayName && ge.includes("<anonymous>") && (ge = ge.replace("<anonymous>", A.displayName)), typeof A == "function" && tt.set(A, ge), ge;
}
while (Vt >= 1 && Wt >= 0);
break;
}
}
} finally {
V = !1, it.current = yt, X(), Error.prepareStackTrace = mt;
}
var Vn = A ? A.displayName || A.name : "", da = Vn ? F(Vn) : "";
return typeof A == "function" && tt.set(A, da), da;
}
function Bt(A, L, U) {
return gt(A, !1);
}
function Oe(A) {
var L = A.prototype;
return !!(L && L.isReactComponent);
}
function z(A, L, U) {
if (A == null)
return "";
if (typeof A == "function")
return gt(A, Oe(A));
if (typeof A == "string")
return F(A);
switch (A) {
case l:
return F("Suspense");
case u:
return F("SuspenseList");
}
if (typeof A == "object")
switch (A.$$typeof) {
case c:
return Bt(A.render);
case h:
return z(A.type, L, U);
case d: {
var et = A, mt = et._payload, yt = et._init;
try {
return z(yt(mt), L, U);
} catch {
}
}
}
return "";
}
var Q = Object.prototype.hasOwnProperty, wt = {}, ut = _.ReactDebugCurrentFrame;
function nt(A) {
if (A) {
var L = A._owner, U = z(A.type, A._source, L ? L.type : null);
ut.setExtraStackFrame(U);
} else
ut.setExtraStackFrame(null);
}
function xt(A, L, U, et, mt) {
{
var yt = Function.call.bind(Q);
for (var pt in A)
if (yt(A, pt)) {
var ht = void 0;
try {
if (typeof A[pt] != "function") {
var ne = Error((et || "React class") + ": " + U + " type `" + pt + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof A[pt] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw ne.name = "Invariant Violation", ne;
}
ht = A[pt](L, pt, et, U, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (Vt) {
ht = Vt;
}
ht && !(ht instanceof Error) && (nt(mt), w("%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).", et || "React class", U, pt, typeof ht), nt(null)), ht instanceof Error && !(ht.message in wt) && (wt[ht.message] = !0, nt(mt), w("Failed %s type: %s", U, ht.message), nt(null));
}
}
}
var Zt = Array.isArray;
function ee(A) {
return Zt(A);
}
function lt(A) {
{
var L = typeof Symbol == "function" && Symbol.toStringTag, U = L && A[Symbol.toStringTag] || A.constructor.name || "Object";
return U;
}
}
function pe(A) {
try {
return Re(A), !1;
} catch {
return !0;
}
}
function Re(A) {
return "" + A;
}
function me(A) {
if (pe(A))
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", lt(A)), Re(A);
}
var lr = _.ReactCurrentOwner, th = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, sa, ia, pi;
pi = {};
function eh(A) {
if (Q.call(A, "ref")) {
var L = Object.getOwnPropertyDescriptor(A, "ref").get;
if (L && L.isReactWarning)
return !1;
}
return A.ref !== void 0;
}
function nh(A) {
if (Q.call(A, "key")) {
var L = Object.getOwnPropertyDescriptor(A, "key").get;
if (L && L.isReactWarning)
return !1;
}
return A.key !== void 0;
}
function rh(A, L) {
if (typeof A.ref == "string" && lr.current && L && lr.current.stateNode !== L) {
var U = N(lr.current.type);
pi[U] || (w('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', N(lr.current.type), A.ref), pi[U] = !0);
}
}
function sh(A, L) {
{
var U = function() {
sa || (sa = !0, w("%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)", L));
};
U.isReactWarning = !0, Object.defineProperty(A, "key", {
get: U,
configurable: !0
});
}
}
function ih(A, L) {
{
var U = function() {
ia || (ia = !0, w("%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)", L));
};
U.isReactWarning = !0, Object.defineProperty(A, "ref", {
get: U,
configurable: !0
});
}
}
var oh = function(A, L, U, et, mt, yt, pt) {
var ht = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: t,
// Built-in properties that belong on the element
type: A,
key: L,
ref: U,
props: pt,
// Record the component responsible for creating this element.
_owner: yt
};
return ht._store = {}, Object.defineProperty(ht._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(ht, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: et
}), Object.defineProperty(ht, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: mt
}), Object.freeze && (Object.freeze(ht.props), Object.freeze(ht)), ht;
};
function ah(A, L, U, et, mt) {
{
var yt, pt = {}, ht = null, ne = null;
U !== void 0 && (me(U), ht = "" + U), nh(L) && (me(L.key), ht = "" + L.key), eh(L) && (ne = L.ref, rh(L, mt));
for (yt in L)
Q.call(L, yt) && !th.hasOwnProperty(yt) && (pt[yt] = L[yt]);
if (A && A.defaultProps) {
var Vt = A.defaultProps;
for (yt in Vt)
pt[yt] === void 0 && (pt[yt] = Vt[yt]);
}
if (ht || ne) {
var Wt = typeof A == "function" ? A.displayName || A.name || "Unknown" : A;
ht && sh(pt, Wt), ne && ih(pt, Wt);
}
return oh(A, ht, ne, mt, et, lr.current, pt);
}
}
var mi = _.ReactCurrentOwner, oa = _.ReactDebugCurrentFrame;
function Pn(A) {
if (A) {
var L = A._owner, U = z(A.type, A._source, L ? L.type : null);
oa.setExtraStackFrame(U);
} else
oa.setExtraStackFrame(null);
}
var gi;
gi = !1;
function _i(A) {
return typeof A == "object" && A !== null && A.$$typeof === t;
}
function aa() {
{
if (mi.current) {
var A = N(mi.current.type);
if (A)
return `
Check the render method of \`` + A + "`.";
}
return "";
}
}
function ch(A) {
{
if (A !== void 0) {
var L = A.fileName.replace(/^.*[\\\/]/, ""), U = A.lineNumber;
return `
Check your code at ` + L + ":" + U + ".";
}
return "";
}
}
var ca = {};
function lh(A) {
{
var L = aa();
if (!L) {
var U = typeof A == "string" ? A : A.displayName || A.name;
U && (L = `
Check the top-level render call using <` + U + ">.");
}
return L;
}
}
function la(A, L) {
{
if (!A._store || A._store.validated || A.key != null)
return;
A._store.validated = !0;
var U = lh(L);
if (ca[U])
return;
ca[U] = !0;
var et = "";
A && A._owner && A._owner !== mi.current && (et = " It was passed a child from " + N(A._owner.type) + "."), Pn(A), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', U, et), Pn(null);
}
}
function ua(A, L) {
{
if (typeof A != "object")
return;
if (ee(A))
for (var U = 0; U < A.length; U++) {
var et = A[U];
_i(et) && la(et, L);
}
else if (_i(A))
A._store && (A._store.validated = !0);
else if (A) {
var mt = g(A);
if (typeof mt == "function" && mt !== A.entries)
for (var yt = mt.call(A), pt; !(pt = yt.next()).done; )
_i(pt.value) && la(pt.value, L);
}
}
}
function uh(A) {
{
var L = A.type;
if (L == null || typeof L == "string")
return;
var U;
if (typeof L == "function")
U = L.propTypes;
else if (typeof L == "object" && (L.$$typeof === c || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
L.$$typeof === h))
U = L.propTypes;
else
return;
if (U) {
var et = N(L);
xt(U, A.props, "prop", et, A);
} else if (L.PropTypes !== void 0 && !gi) {
gi = !0;
var mt = N(L);
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", mt || "Unknown");
}
typeof L.getDefaultProps == "function" && !L.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function hh(A) {
{
for (var L = Object.keys(A.props), U = 0; U < L.length; U++) {
var et = L[U];
if (et !== "children" && et !== "key") {
Pn(A), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", et), Pn(null);
break;
}
}
A.ref !== null && (Pn(A), w("Invalid attribute `ref` supplied to `React.Fragment`."), Pn(null));
}
}
function ha(A, L, U, et, mt, yt) {
{
var pt = E(A);
if (!pt) {
var ht = "";
(A === void 0 || typeof A == "object" && A !== null && Object.keys(A).length === 0) && (ht += " 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 ne = ch(mt);
ne ? ht += ne : ht += aa();
var Vt;
A === null ? Vt = "null" : ee(A) ? Vt = "array" : A !== void 0 && A.$$typeof === t ? (Vt = "<" + (N(A.type) || "Unknown") + " />", ht = " Did you accidentally export a JSX literal instead of a component?") : Vt = typeof A, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Vt, ht);
}
var Wt = ah(A, L, U, mt, yt);
if (Wt == null)
return Wt;
if (pt) {
var ge = L.children;
if (ge !== void 0)
if (et)
if (ee(ge)) {
for (var Vn = 0; Vn < ge.length; Vn++)
ua(ge[Vn], A);
Object.freeze && Object.freeze(ge);
} else
w("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
ua(ge, A);
}
return A === r ? hh(Wt) : uh(Wt), Wt;
}
}
function dh(A, L, U) {
return ha(A, L, U, !0);
}
function fh(A, L, U) {
return ha(A, L, U, !1);
}
var ph = fh, mh = dh;
ur.Fragment = r, ur.jsx = ph, ur.jsxs = mh;
}()), ur;
}
var hr = {};
/**
* @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 pa;
function yh() {
if (pa)
return hr;
pa = 1;
var e = bc, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, s = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
function o(a, c, l) {
var u, h = {}, d = null, f = null;
l !== void 0 && (d = "" + l), c.key !== void 0 && (d = "" + c.key), c.ref !== void 0 && (f = c.ref);
for (u in c)
r.call(c, u) && !i.hasOwnProperty(u) && (h[u] = c[u]);
if (a && a.defaultProps)
for (u in c = a.defaultProps, c)
h[u] === void 0 && (h[u] = c[u]);
return { $$typeof: t, type: a, key: d, ref: f, props: h, _owner: s.current };
}
return hr.Fragment = n, hr.jsx = o, hr.jsxs = o, hr;
}
process.env.NODE_ENV === "production" ? Ai.exports = yh() : Ai.exports = _h();
var Y = Ai.exports;
const lo = (e) => Ct(
(n) => {
(n.metaKey || n.altKey) && n.button === 0 && e();
},
[e]
), Ks = (e, t, n = []) => {
if (!t)
return e;
const r = { ...e, ...t }, s = { ...e };
for (const i in r)
if (!n.includes(i))
if (i in e)
s[i] = e[i];
else {
if (i === "children" || i === "className" || i === "style")
continue;
s[i] = t[i];
}
return s;
}, Gr = (e, t, n, r, s = !0, i = null) => {
const o = J({ width: t, height: n });
return rt(() => {
const a = vh(r, 100), c = new ResizeObserver(([l]) => {
const { width: u, height: h } = l.contentRect;
(u !== o.current.width || h !== o.current.height) && (o.current = { width: u, height: h }, s ? a() : r());
});
return e.current && c.observe(e.current), () => c.disconnect();
}, [e, s, t, n, i]), o;
}, vh = (e, t) => {
let n;
return function() {
n || (e(), n = !0, setTimeout(() => {
n = !1, e();
}, t));
};
};
function wc(e) {
var t, n, r = "";
if (typeof e == "string" || typeof e == "number")
r += e;
else if (typeof e == "object")
if (Array.isArray(e))
for (t = 0; t < e.length; t++)
e[t] && (n = wc(e[t])) && (r && (r += " "), r += n);
else
for (t in e)
e[t] && (r && (r += " "), r += t);
return r;
}
function bh() {
for (var e, t, n = 0, r = ""; n < arguments.length; )
(e = arguments[n++]) && (t = wc(e)) && (r && (r += " "), r += t);
return r;
}
const uo = "-";
function wh(e) {
const t = Th(e), {
conflictingClassGroups: n,
conflictingClassGroupModifiers: r
} = e;
function s(o) {
const a = o.split(uo);
return a[0] === "" && a.length !== 1 && a.shift(), xc(a, t) || xh(o);
}
function i(o, a) {
const c = n[o] || [];
return a && r[o] ? [...c, ...r[o]] : c;
}
return {
getClassGroupId: s,
getConflictingClassGroupIds: i
};
}
function xc(e, t) {
var o;
if (e.length === 0)
return t.classGroupId;
const n = e[0], r = t.nextPart.get(n), s = r ? xc(e.slice(1), r) : void 0;
if (s)
return s;
if (t.validators.length === 0)
return;
const i = e.join(uo);
return (o = t.validators.find(({
validator: a
}) => a(i))) == null ? void 0 : o.classGroupId;
}
const ma = /^\[(.+)\]$/;
function xh(e) {
if (ma.test(e)) {
const t = ma.exec(e)[1], n = t == null ? void 0 : t.substring(0, t.indexOf(":"));
if (n)
return "arbitrary.." + n;
}
}
function Th(e) {
const {
theme: t,
prefix: n
} = e, r = {
nextPart: /* @__PURE__ */ new Map(),
validators: []
};
return Sh(Object.entries(e.classGroups), n).forEach(([i, o]) => {
Ni(o, r, i, t);
}), r;
}
function Ni(e, t, n, r) {
e.forEach((s) => {
if (typeof s == "string") {
const i = s === "" ? t : ga(t, s);
i.classGroupId = n;
return;
}
if (typeof s == "function") {
if (Ch(s)) {
Ni(s(r), t, n, r);
return;
}
t.validators.push({
validator: s,
classGroupId: n
});
return;
}
Object.entries(s).forEach(([i, o]) => {
Ni(o, ga(t, i), n, r);
});
});
}
function ga(e, t) {
let n = e;
return t.split(uo).forEach((r) => {
n.nextPart.has(r) || n.nextPart.set(r, {
nextPart: /* @__PURE__ */ new Map(),
validators: []
}), n = n.nextPart.get(r);
}), n;
}
function Ch(e) {
return e.isThemeGetter;
}
function Sh(e, t) {
return t ? e.map(([n, r]) => {
const s = r.map((i) => typeof i == "string" ? t + i : typeof i == "object" ? Object.fromEntries(Object.entries(i).map(([o, a]) => [t + o, a])) : i);
return [n, s];
}) : e;
}
function kh(e) {
if (e < 1)
return {
get: () => {
},
set: () => {
}
};
let t = 0, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
function s(i, o) {
n.set(i, o), t++, t > e && (t = 0, r = n, n = /* @__PURE__ */ new Map());
}
return {
get(i) {
let o = n.get(i);
if (o !== void 0)
return o;
if ((o = r.get(i)) !== void 0)
return s(i, o), o;
},
set(i, o) {
n.has(i) ? n.set(i, o) : s(i, o);
}
};
}
const Tc = "!";
function Ah(e) {
const t = e.separator, n = t.length === 1, r = t[0], s = t.length;
return function(o) {
const a = [];
let c = 0, l = 0, u;
for (let m = 0; m < o.length; m++) {
let g = o[m];
if (c === 0) {
if (g === r && (n || o.slice(m, m + s) === t)) {
a.push(o.slice(l, m)), l = m + s;
continue;
}
if (g === "/") {
u = m;
continue;
}
}
g === "[" ? c++ : g === "]" && c--;
}
const h = a.length === 0 ? o : o.substring(l), d = h.startsWith(Tc), f = d ? h.substring(1) : h, p = u && u > l ? u - l : void 0;
return {
modifiers: a,
hasImportantModifier: d,
baseClassName: f,
maybePostfixModifierPosition: p
};
};
}
function Nh(e) {
if (e.length <= 1)
return e;
const t = [];
let n = [];
return e.forEach((r) => {
r[0] === "[" ? (t.push(...n.sort(), r), n = []) : n.push(r);
}), t.push(...n.sort()), t;
}
function Eh(e) {
return {
cache: kh(e.cacheSize),
splitModifiers: Ah(e),
...wh(e)
};
}
const Mh = /\s+/;
function Ih(e, t) {
const {
splitModifiers: n,
getClassGroupId: r,
getConflictingClassGroupIds: s
} = t, i = /* @__PURE__ */ new Set();
return e.trim().split(Mh).map((o) => {
const {
modifiers: a,
hasImportantModifier: c,
baseClassName: l,
maybePostfixModifierPosition: u
} = n(o);
let h = r(u ? l.substring(0, u) : l), d = !!u;
if (!h) {
if (!u)
return {
isTailwindClass: !1,
originalClassName: o
};
if (h = r(l), !h)
return {
isTailwindClass: !1,
originalClassName: o
};
d = !1;
}
const f = Nh(a).join(":");
return {
isTailwindClass: !0,
modifierId: c ? f + Tc : f,
classGroupId: h,
originalClassName: o,
hasPostfixModifier: d
};
}).reverse().filter((o) => {
if (!o.isTailwindClass)
return !0;
const {
modifierId: a,
classGroupId: c,
hasPostfixModifier: l
} = o, u = a + c;
return i.has(u) ? !1 : (i.add(u), s(c, l).forEach((h) => i.add(a + h)), !0);
}).reverse().map((o) => o.originalClassName).join(" ");
}
function Oh() {
let e = 0, t, n, r = "";
for (; e < arguments.length; )
(t = arguments[e++]) && (n = Cc(t)) && (r && (r += " "), r += n);
return r;
}
function Cc(e) {
if (typeof e == "string")
return e;
let t, n = "";
for (let r = 0; r < e.length; r++)
e[r] && (t = Cc(e[r])) && (n && (n += " "), n += t);
return n;
}
function Rh(e, ...t) {
let n, r, s, i = o;
function o(c) {
const l = t.reduce((u, h) => h(u), e());
return n = Eh(l), r = n.cache.get, s = n.cache.set, i = a, a(c);
}
function a(c) {
const l = r(c);
if (l)
return l;
const u = Ih(c, n);
return s(c, u), u;
}
return function() {
return i(Oh.apply(null, arguments));
};
}
function kt(e) {
const t = (n) => n[e] || [];
return t.isThemeGetter = !0, t;
}
const Sc = /^\[(?:([a-z-]+):)?(.+)\]$/i, Dh = /^\d+\/\d+$/, Ph = /* @__PURE__ */ new Set(["px", "full", "screen"]), Vh = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Fh = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, $h = /^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Lh = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
function ve(e) {
return mn(e) || Ph.has(e) || Dh.test(e);
}
function Ke(e) {
return nr(e, "length", Yh);
}
function mn(e) {
return !!e && !Number.isNaN(Number(e));
}
function ss(e) {
return nr(e, "number", mn);
}
function dr(e) {
return !!e && Number.isInteger(Number(e));
}
function Wh(e) {
return e.endsWith("%") && mn(e.slice(0, -1));
}
function ct(e) {
return Sc.test(e);
}
function tn(e) {
return Vh.test(e);
}
const qh = /* @__PURE__ */ new Set(["length", "size", "percentage"]);
function jh(e) {
return nr(e, qh, kc);
}
function zh(e) {
return nr(e, "position", kc);
}
const Bh = /* @__PURE__ */ new Set(["image", "url"]);
function Gh(e) {
return nr(e, Bh, Xh);
}
function Uh(e) {
return nr(e, "", Hh);
}
function fr() {
return !0;
}
function nr(e, t, n) {
const r = Sc.exec(e);
return r ? r[1] ? typeof t == "string" ? r[1] === t : t.has(r[1]) : n(r[2]) : !1;
}
function Yh(e) {
return Fh.test(e);
}
function kc() {
return !1;
}
function Hh(e) {
return $h.test(e);
}
function Xh(e) {
return Lh.test(e);
}
function Zh() {
const e = kt("colors"), t = kt("spacing"), n = kt("blur"), r = kt("brightness"), s = kt("borderColor"), i = kt("borderRadius"), o = kt("borderSpacing"), a = kt("borderWidth"), c = kt("contrast"), l = kt("grayscale"), u = kt("hueRotate"), h = kt("invert"), d = kt("gap"), f = kt("gradientColorStops"), p = kt("gradientColorStopPositions"), m = kt("inset"), g = kt("margin"), _ = kt("opacity"), w = kt("padding"), k = kt("saturate"), v = kt("scale"), y = kt("sepia"), C = kt("skew"), S = kt("space"), x = kt("translate"), O = () => ["auto", "contain", "none"], E = () => ["auto", "hidden", "clip", "visible", "scroll"], T = () => ["auto", ct, t], b = () => [ct, t], N = () => ["", ve, Ke], M = () => ["auto", mn, ct], D = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], I = () => ["solid", "dashed", "dotted", "double", "none"], R = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity", "plus-lighter"], $ = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], P = () => ["", "0", ct], j = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], W = () => [mn, ss], H = () => [mn, ct];
return {
cacheSize: 500,
separator: ":",
theme: {
colors: [fr],
spacing: [ve, Ke],
blur: ["none", "", tn, ct],
brightness: W(),
borderColor: [e],
borderRadius: ["none", "", "full", tn, ct],
borderSpacing: b(),
borderWidth: N(),
contrast: W(),
grayscale: P(),
hueRotate: H(),
invert: P(),
gap: b(),
gradientColorStops: [e],
gradientColorStopPositions: [Wh, Ke],
inset: T(),
margin: T(),
opacity: W(),
padding: b(),
saturate: W(),
scale: W(),
sepia: P(),
skew: H(),
space: b(),
translate: b()
},
classGroups: {
// Layout
/**
* Aspect Ratio
* @see https://tailwindcss.com/docs/aspect-ratio
*/
aspect: [{
aspect: ["auto", "square", "video", ct]
}],
/**
* Container
* @see https://tailwindcss.com/docs/container
*/
container: ["container"],
/**
* Columns
* @see https://tailwindcss.com/docs/columns
*/
columns: [{
columns: [tn]
}],
/**
* Break After
* @see https://tailwindcss.com/docs/break-after
*/
"break-after": [{
"break-after": j()
}],
/**
* Break Before
* @see https://tailwindcss.com/docs/break-before
*/
"break-before": [{
"break-before": j()
}],
/**
* Break Inside
* @see https://tailwindcss.com/docs/break-inside
*/
"break-inside": [{
"break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
}],
/**
* Box Decoration Break
* @see https://tailwindcss.com/docs/box-decoration-break
*/
"box-decoration": [{
"box-decoration": ["slice", "clone"]
}],
/**
* Box Sizing
* @see https://tailwindcss.com/docs/box-sizing
*/
box: [{
box: ["border", "content"]
}],
/**
* Display
* @see https://tailwindcss.com/docs/display
*/
display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"],
/**
* Floats
* @see https://tailwindcss.com/docs/float
*/
float: [{
float: ["right", "left", "none"]
}],
/**
* Clear
* @see https://tailwindcss.com/docs/clear
*/
clear: [{
clear: ["left", "right", "both", "none"]
}],
/**
* Isolation
* @see https://tailwindcss.com/docs/isolation
*/
isolation: ["isolate", "isolation-auto"],
/**
* Object Fit
* @see https://tailwindcss.com/docs/object-fit
*/
"object-fit": [{
object: ["contain", "cover", "fill", "none", "scale-down"]
}],
/**
* Object Position
* @see https://tailwindcss.com/docs/object-position
*/
"object-position": [{
object: [...D(), ct]
}],
/**
* Overflow
* @see https://tailwindcss.com/docs/overflow
*/
overflow: [{
overflow: E()
}],
/**
* Overflow X
* @see https://tailwindcss.com/docs/overflow
*/
"overflow-x": [{
"overflow-x": E()
}],
/**
* Overflow Y
* @see https://tailwindcss.com/docs/overflow
*/
"overflow-y": [{
"overflow-y": E()
}],
/**
* Overscroll Behavior
* @see https://tailwindcss.com/docs/overscroll-behavior
*/
overscroll: [{
overscroll: O()
}],
/**
* Overscroll Behavior X
* @see https://tailwindcss.com/docs/overscroll-behavior
*/
"overscroll-x": [{
"overscroll-x": O()
}],
/**
* Overscroll Behavior Y
* @see https://tailwindcss.com/docs/overscroll-behavior
*/
"overscroll-y": [{
"overscroll-y": O()
}],
/**
* Position
* @see https://tailwindcss.com/docs/position
*/
position: ["static", "fixed", "absolute", "relative", "sticky"],
/**
* Top / Right / Bottom / Left
* @see https://tailwindcss.com/docs/top-right-bottom-left
*/
inset: [{
inset: [m]
}],
/**
* Right / Left
* @see https://tailwindcss.com/docs/top-right-bottom-left
*/
"inset-x": [{
"inset-x": [m]
}],
/**
* Top / Bottom
* @see https://tailwindcss.com/docs/top-right-bottom-left
*/
"inset-y": [{
"inset-y": [m]
}],
/**
* Start
* @see https://tailwindcss.com/docs/top-right-bottom-left
*/
start: [{
start: [m]
}],
/**
* End
* @see https://tailwindcss.com/docs/top-right-bottom-left
*/
end: [{
end: [m]
}],
/**
* Top
* @see https://tailwindcss.com/docs/top-right-bottom-left
*/
top: [{
top: [m]
}],
/**
* Right
* @see https://tailwindcss.com/docs/top-right-bottom-left
*/
right: [{
right: [m]
}],
/**
* Bottom
* @see https://tailwindcss.com/docs/top-right-bottom-left
*/
bottom: [{
bottom: [m]
}],
/**
* Left
* @see https://tailwindcss.com/docs/top-right-bottom-left
*/
left: [{
left: [m]
}],
/**
* Visibility
* @see https://tailwindcss.com/docs/visibility
*/
visibility: ["visible", "invisible", "collapse"],
/**
* Z-Index
* @see https://tailwindcss.com/docs/z-index
*/
z: [{
z: ["auto", dr, ct]
}],
// Flexbox and Grid
/**
* Flex Basis
* @see https://tailwindcss.com/docs/flex-basis
*/
basis: [{
basis: T()
}],
/**
* Flex Direction
* @see https://tailwindcss.com/docs/flex-direction
*/
"flex-direction": [{
flex: ["row", "row-reverse", "col", "col-reverse"]
}],
/**
* Flex Wrap
* @see https://tailwindcss.com/docs/flex-wrap
*/
"flex-wrap": [{
flex: ["wrap", "wrap-reverse", "nowrap"]
}],
/**
* Flex
* @see https://tailwindcss.com/docs/flex
*/
flex: [{
flex: ["1", "auto", "initial", "none", ct]
}],
/**
* Flex Grow
* @see https://tailwindcss.com/docs/flex-grow
*/
grow: [{
grow: P()
}],
/**
* Flex Shrink
* @see https://tailwindcss.com/docs/flex-shrink
*/
shrink: [{
shrink: P()
}],
/**
* Order
* @see https://tailwindcss.com/docs/order
*/
order: [{
order: ["first", "last", "none", dr, ct]
}],
/**
* Grid Template Columns
* @see https://tailwindcss.com/docs/grid-template-columns
*/
"grid-cols": [{
"grid-cols": [fr]
}],
/**
* Grid Column Start / End
* @see https://tailwindcss.com/docs/grid-column
*/
"col-start-end": [{
col: ["auto", {
span: ["full", dr, ct]
}, ct]
}],
/**
* Grid Column Start
* @see https://tailwindcss.com/docs/grid-column
*/
"col-start": [{
"col-start": M()
}],
/**
* Grid Column End
* @see https://tailwindcss.com/docs/grid-column
*/
"col-end": [{
"col-end": M()
}],
/**
* Grid Template Rows
* @see https://tailwindcss.com/docs/grid-template-rows
*/
"grid-rows": [{
"grid-rows": [fr]
}],
/**
* Grid Row Start / End
* @see https://tailwindcss.com/docs/grid-row
*/
"row-start-end": [{
row: ["auto", {
span: [dr, ct]
}, ct]
}],
/**
* Grid Row Start
* @see https://tailwindcss.com/docs/grid-row
*/
"row-start": [{
"row-start": M()
}],
/**
* Grid Row End
* @see https://tailwindcss.com/docs/grid-row
*/
"row-end": [{
"row-end": M()
}],
/**
* Grid Auto Flow
* @see https://tailwindcss.com/docs/grid-auto-flow
*/
"grid-flow": [{
"grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
}],
/**
* Grid Auto Columns
* @see https://tailwindcss.com/docs/grid-auto-columns
*/
"auto-cols": [{
"auto-cols": ["auto", "min", "max", "fr", ct]
}],
/**
* Grid Auto Rows
* @see https://tailwindcss.com/docs/grid-auto-rows
*/
"auto-rows": [{
"auto-rows": ["auto", "min", "max", "fr", ct]
}],
/**
* Gap
* @see https://tailwindcss.com/docs/gap
*/
gap: [{
gap: [d]
}],
/**
* Gap X
* @see https://tailwindcss.com/docs/gap
*/
"gap-x": [{
"gap-x": [d]
}],
/**
* Gap Y
* @see https://tailwindcss.com/docs/gap
*/
"gap-y": [{
"gap-y": [d]
}],
/**
* Justify Content
* @see https://tailwindcss.com/docs/justify-content
*/
"justify-content": [{
justify: ["normal", ...$()]
}],
/**
* Justify Items
* @see https://tailwindcss.com/docs/justify-items
*/
"justify-items": [{
"justify-items": ["start", "end", "center", "stretch"]
}],
/**
* Justify Self
* @see https://tailwindcss.com/docs/justify-self
*/
"justify-self": [{
"justify-self": ["auto", "start", "end", "center", "stretch"]
}],
/**
* Align Content
* @see https://tailwindcss.com/docs/align-content
*/
"align-content": [{
content: ["normal", ...$(), "baseline"]
}],
/**
* Align Items
* @see https://tailwindcss.com/docs/align-items
*/
"align-items": [{
items: ["start", "end", "center", "baseline", "stretch"]
}],
/**
* Align Self
* @see https://tailwindcss.com/docs/align-self
*/
"align-self": [{
self: ["auto", "start", "end", "center", "stretch", "baseline"]
}],
/**
* Place Content
* @see https://tailwindcss.com/docs/place-content
*/
"place-content": [{
"place-content": [...$(), "baseline"]
}],
/**
* Place Items
* @see https://tailwindcss.com/docs/place-items
*/
"place-items": [{
"place-items": ["start", "end", "center", "baseline", "stretch"]
}],
/**
* Place Self
* @see https://tailwindcss.com/docs/place-self
*/
"place-self": [{
"place-self": ["auto", "start", "end", "center", "stretch"]
}],
// Spacing
/**
* Padding
* @see https://tailwindcss.com/docs/padding
*/
p: [{
p: [w]
}],
/**
* Padding X
* @see https://tailwindcss.com/docs/padding
*/
px: [{
px: [w]
}],
/**
* Padding Y
* @see https://tailwindcss.com/docs/padding
*/
py: [{
py: [w]
}],
/**
* Padding Start
* @see https://tailwindcss.com/docs/padding
*/
ps: [{
ps: [w]
}],
/**
* Padding End
* @see https://tailwindcss.com/docs/padding
*/
pe: [{
pe: [w]
}],
/**
* Padding Top
* @see https://tailwindcss.com/docs/padding
*/
pt: [{
pt: [w]
}],
/**
* Padding Right
* @see https://tailwindcss.com/docs/padding
*/
pr: [{
pr: [w]
}],
/**
* Padding Bottom
* @see https://tailwindcss.com/docs/padding
*/
pb: [{
pb: [w]
}],
/**
* Padding Left
* @see https://tailwindcss.com/docs/padding
*/
pl: [{
pl: [w]
}],
/**
* Margin
* @see https://tailwindcss.com/docs/margin
*/
m: [{
m: [g]
}],
/**
* Margin X
* @see https://tailwindcss.com/docs/margin
*/
mx: [{
mx: [g]
}],
/**
* Margin Y
* @see https://tailwindcss.com/docs/margin
*/
my: [{
my: [g]
}],
/**
* Margin Start
* @see https://tailwindcss.com/docs/margin
*/
ms: [{
ms: [g]
}],
/**
* Margin End
* @see https://tailwindcss.com/docs/margin
*/
me: [{
me: [g]
}],
/**
* Margin Top
* @see https://tailwindcss.com/docs/margin
*/
mt: [{
mt: [g]
}],
/**
* Margin Right
* @see https://tailwindcss.com/docs/margin
*/
mr: [{
mr: [g]
}],
/**
* Margin Bottom
* @see https://tailwindcss.com/docs/margin
*/
mb: [{
mb: [g]
}],
/**
* Margin Left
* @see https://tailwindcss.com/docs/margin
*/
ml: [{
ml: [g]
}],
/**
* Space Between X
* @see https://tailwindcss.com/docs/space
*/
"space-x": [{
"space-x": [S]
}],
/**
* Space Between X Reverse
* @see https://tailwindcss.com/docs/space
*/
"space-x-reverse": ["space-x-reverse"],
/**
* Space Between Y
* @see https://tailwindcss.com/docs/space
*/
"space-y": [{
"space-y": [S]
}],
/**
* Space Between Y Reverse
* @see https://tailwindcss.com/docs/space
*/
"space-y-reverse": ["space-y-reverse"],
// Sizing
/**
* Width
* @see https://tailwindcss.com/docs/width
*/
w: [{
w: ["auto", "min", "max", "fit", ct, t]
}],
/**
* Min-Width
* @see https://tailwindcss.com/docs/min-width
*/
"min-w": [{
"min-w": ["min", "max", "fit", ct, ve]
}],
/**
* Max-Width
* @see https://tailwindcss.com/docs/max-width
*/
"max-w": [{
"max-w": ["0", "none", "full", "min", "max", "fit", "prose", {
screen: [tn]
}, tn, ct]
}],
/**
* Height
* @see https://tailwindcss.com/docs/height
*/
h: [{
h: [ct, t, "auto", "min", "max", "fit"]
}],
/**
* Min-Height
* @see https://tailwindcss.com/docs/min-height
*/
"min-h": [{
"min-h": ["min", "max", "fit", ve, ct]
}],
/**
* Max-Height
* @see https://tailwindcss.com/docs/max-height
*/
"max-h": [{
"max-h": [ct, t, "min", "max", "fit"]
}],
// Typography
/**
* Font Size
* @see https://tailwindcss.com/docs/font-size
*/
"font-size": [{
text: ["base", tn, Ke]
}],
/**
* Font Smoothing
* @see https://tailwindcss.com/docs/font-smoothing
*/
"font-smoothing": ["antialiased", "subpixel-antialiased"],
/**
* Font Style
* @see https://tailwindcss.com/docs/font-style
*/
"font-style": ["italic", "not-italic"],
/**
* Font Weight
* @see https://tailwindcss.com/docs/font-weight
*/
"font-weight": [{
font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", ss]
}],
/**
* Font Family
* @see https://tailwindcss.com/docs/font-family
*/
"font-family": [{
font: [fr]
}],
/**
* Font Variant Numeric
* @see https://tailwindcss.com/docs/font-variant-numeric
*/
"fvn-normal": ["normal-nums"],
/**
* Font Variant Numeric
* @see https://tailwindcss.com/docs/font-variant-numeric
*/
"fvn-ordinal": ["ordinal"],
/**
* Font Variant Numeric
* @see https://tailwindcss.com/docs/font-variant-numeric
*/
"fvn-slashed-zero": ["slashed-zero"],
/**
* Font Variant Numeric
* @see https://tailwindcss.com/docs/font-variant-numeric
*/
"fvn-figure": ["lining-nums", "oldstyle-nums"],
/**
* Font Variant Numeric
* @see https://tailwindcss.com/docs/font-variant-numeric
*/
"fvn-spacing": ["proportional-nums", "tabular-nums"],
/**
* Font Variant Numeric
* @see https://tailwindcss.com/docs/font-variant-numeric
*/
"fvn-fraction": ["diagonal-fractions", "stacked-fractons"],
/**
* Letter Spacing
* @see https://tailwindcss.com/docs/letter-spacing
*/
tracking: [{
tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", ct]
}],
/**
* Line Clamp
* @see https://tailwindcss.com/docs/line-clamp
*/
"line-clamp": [{
"line-clamp": ["none", mn, ss]
}],
/**
* Line Height
* @see https://tailwindcss.com/docs/line-height
*/
leading: [{
leading: ["none", "tight", "snug", "normal", "relaxed", "loose", ve, ct]
}],
/**
* List Style Image
* @see https://tailwindcss.com/docs/list-style-image
*/
"list-image": [{
"list-image": ["none", ct]
}],
/**
* List Style Type
* @see https://tailwindcss.com/docs/list-style-type
*/
"list-style-type": [{
list: ["none", "disc", "decimal", ct]
}],
/**
* List Style Position
* @see https://tailwindcss.com/docs/list-style-position
*/
"list-style-position": [{
list: ["inside", "outside"]
}],
/**
* Placeholder Color
* @deprecated since Tailwind CSS v3.0.0
* @see https://tailwindcss.com/docs/placeholder-color
*/
"placeholder-color": [{
placeholder: [e]
}],
/**