import { f as lt, j as u, u as _O, c as ur, m as jr, a as $e, b as It, d as oa, e as Pt, w as Yp, A as Wu, g as zs, h as Ha, o as Tr, B as MO, i as Kt, k as Hd, l as _s, n as Am, p as Kp, q as Gu, r as ib, s as p2, _ as dS, t as kO, v as RO, x as PO, y as bw, z as NO, C as h2, S as OO, D as v2, E as AO, F as zO, G as IO, H as FO, I as hg, J as LO, P as Wm, K as BO, L as UO, M as HO, N as VO, O as Cw, Q as m2, R as WO, T as Pe, U as g2, V as y2, W as vg, X as Xp, Y as ne, Z as xe, $ as W, a0 as Ce, a1 as xx, a2 as ct, a3 as Ea, a4 as Be, a5 as GO, a6 as qO, a7 as x2, a8 as S2, a9 as an, aa as YO, ab as zt, ac as $p, ad as Yn, ae as Ew, af as Qp, ag as KO, ah as XO, ai as $O, aj as QO, ak as Au, al as mg, am as b2, an as ww, ao as ZO, ap as C2, aq as JO, ar as E2, as as eA, at as tA, au as w2, av as nA, aw as rA, ax as aA, ay as iA, az as oA, aA as sA, aB as Wo, aC as lA, aD as ob, aE as j2, aF as uA, aG as cA, aH as dA, aI as fA, aJ as pA, aK as hA, aL as T2, aM as vA, aN as mA, aO as Gm, aP as gA, aQ as gg, aR as yA, aS as zm, aT as qm, aU as fS, aV as pS, aW as hS, aX as xA, aY as D2, aZ as SA, a_ as _2, a$ as bA, b0 as M2, b1 as k2, b2 as CA, b3 as jw, b4 as zd, b5 as sb, b6 as EA, b7 as wA, b8 as jA, b9 as TA, ba as DA, bb as _A, bc as qu, bd as zu, be as ei, bf as R2, bg as Zp, bh as MA, bi as kA, bj as P2, bk as vS, bl as mS, bm as N2, bn as gS, bo as yS, bp as Tw, bq as O2, br as A2, bs as z2, bt as Im, bu as Fm, bv as RA, bw as xS, bx as I2, by as Id, bz as PA, bA as NA, bB as F2, bC as L2, bD as lb, bE as OA, bF as AA, bG as Dw, bH as _w, bI as zA, bJ as IA, bK as FA, bL as B2, bM as U2, bN as LA, bO as BA, bP as H2, bQ as Mw, bR as UA, bS as kw, bT as HA, bU as VA, bV as V2, bW as WA, bX as GA, bY as qA, bZ as YA, b_ as KA, b$ as XA, c0 as $A, c1 as Sx, c2 as Rw, c3 as QA, c4 as W2, c5 as SS, c6 as ZA, c7 as JA, c8 as ez, c9 as Pw, ca as tz, cb as nz, cc as Fp, cd as Ym, ce as G2, cf as Km, cg as rz, ch as az, ci as Go, cj as q2, ck as ub, cl as Jp, cm as iz, cn as oz, co as sz, cp as Yo, cq as Y2, cr as lz, cs as uz, ct as K2, cu as cz, cv as dz, cw as fz, cx as pz, cy as hz, cz as vz, cA as mz, cB as gz, cC as yz, cD as Nw, cE as xz, cF as Sz, cG as bz, cH as Cz, cI as Ez, cJ as wz, cK as jz, cL as Tz, cM as cb, cN as Dz, cO as _z, cP as bx, cQ as Rp, cR as pm, cS as Ow, cT as Cx, cU as Ex, cV as hm, cW as Aw, cX as bS, cY as Mz, cZ as kz, c_ as Rz, c$ as yg, d0 as Pz, d1 as Nz, d2 as Oz, d3 as Az, d4 as zz, d5 as Iz, d6 as vm, d7 as wx, d8 as mm, d9 as Tp, da as Fz, db as Lz, dc as X2, dd as Xm, de as $2, df as Q2, dg as db, dh as fb, di as Z2, dj as J2, dk as eD, dl as tD, dm as nD, dn as rD, dp as aD, dq as iD, dr as Bz, ds as oD, dt as pb, du as sD, dv as lD, dw as uD, dx as cD, dy as kd, dz as Rd, dA as dD, dB as fD, dC as pD, dD as hD, dE as vD, dF as Uz, dG as Hz, dH as Vz, dI as zw, dJ as gm, dK as Wz, dL as Iw, dM as Fw, dN as Lw, dO as Bw, dP as Gz, dQ as qz, dR as CS, dS as Yz, dT as Kz, dU as Uw, dV as Xz, dW as ym, dX as $z, dY as $m, dZ as Qz, d_ as Zz, d$ as Jz, e0 as eI, e1 as mD, e2 as tI, e3 as nI } from "./exports-21bec2df.mjs";
import * as Ge from "react";
import jt, { Children as eh, useMemo as Xt, useLayoutEffect as co, useEffect as ot, useRef as Xe, useState as qe, useId as Ko, useCallback as ee, forwardRef as Fl, cloneElement as Ll, PureComponent as rI, isValidElement as gD, createElement as Ds, createContext as xg, useReducer as yD, useImperativeHandle as hb, Fragment as aI, useContext as Bl, memo as Yr, Component as iI, useTransition as oI } from "react";
import { I as ia, u as sI, c as lI, C as uI } from "./chunk-ZP4IHIHZ-8f3a3ec4.mjs";
import { flushSync as cI } from "react-dom";
function dI(e, t) {
if (e == null)
return {};
var r = {}, i = Object.keys(e), s, c;
for (c = 0; c < i.length; c++)
s = i[c], !(t.indexOf(s) >= 0) && (r[s] = e[s]);
return r;
}
var Qm = "NOT_FOUND";
function fI(e) {
var t;
return {
get: function(i) {
return t && e(t.key, i) ? t.value : Qm;
},
put: function(i, s) {
t = {
key: i,
value: s
};
},
getEntries: function() {
return t ? [t] : [];
},
clear: function() {
t = void 0;
}
};
}
function pI(e, t) {
var r = [];
function i(m) {
var y = r.findIndex(function(S) {
return t(m, S.key);
});
if (y > -1) {
var g = r[y];
return y > 0 && (r.splice(y, 1), r.unshift(g)), g.value;
}
return Qm;
}
function s(m, y) {
i(m) === Qm && (r.unshift({
key: m,
value: y
}), r.length > e && r.pop());
}
function c() {
return r;
}
function f() {
r = [];
}
return {
get: i,
put: s,
getEntries: c,
clear: f
};
}
var hI = function(t, r) {
return t === r;
};
function vI(e) {
return function(r, i) {
if (r === null || i === null || r.length !== i.length)
return !1;
for (var s = r.length, c = 0; c < s; c++)
if (!e(r[c], i[c]))
return !1;
return !0;
};
}
function mI(e, t) {
var r = typeof t == "object" ? t : {
equalityCheck: t
}, i = r.equalityCheck, s = i === void 0 ? hI : i, c = r.maxSize, f = c === void 0 ? 1 : c, m = r.resultEqualityCheck, y = vI(s), g = f === 1 ? fI(y) : pI(f, y);
function S() {
var E = g.get(arguments);
if (E === Qm) {
if (E = e.apply(null, arguments), m) {
var w = g.getEntries(), D = w.find(function(M) {
return m(M.value, E);
});
D && (E = D.value);
}
g.put(arguments, E);
}
return E;
}
return S.clearCache = function() {
return g.clear();
}, S;
}
function gI(e) {
var t = Array.isArray(e[0]) ? e[0] : e;
if (!t.every(function(i) {
return typeof i == "function";
})) {
var r = t.map(function(i) {
return typeof i == "function" ? "function " + (i.name || "unnamed") + "()" : typeof i;
}).join(", ");
throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + r + "]");
}
return t;
}
function yI(e) {
for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
r[i - 1] = arguments[i];
var s = function() {
for (var f = arguments.length, m = new Array(f), y = 0; y < f; y++)
m[y] = arguments[y];
var g = 0, S, E = {
memoizeOptions: void 0
}, w = m.pop();
if (typeof w == "object" && (E = w, w = m.pop()), typeof w != "function")
throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof w + "]");
var D = E, M = D.memoizeOptions, k = M === void 0 ? r : M, R = Array.isArray(k) ? k : [k], O = gI(m), I = e.apply(void 0, [function() {
return g++, w.apply(null, arguments);
}].concat(R)), A = e(function() {
for (var H = [], q = O.length, U = 0; U < q; U++)
H.push(O[U].apply(null, arguments));
return S = I.apply(null, H), S;
});
return Object.assign(A, {
resultFunc: w,
memoizedResultFunc: I,
dependencies: O,
lastResult: function() {
return S;
},
recomputations: function() {
return g;
},
resetRecomputations: function() {
return g = 0;
}
}), A;
};
return s;
}
var Ze = /* @__PURE__ */ yI(mI);
function xI(e) {
return e != null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
}
function xD(e) {
var t;
return xI(e) && (t = e.ownerDocument) != null ? t : document;
}
function SI() {
return !!(typeof window < "u" && window.document && window.document.createElement);
}
var bI = /* @__PURE__ */ SI();
const SD = 1 / 60 * 1e3, CI = typeof performance < "u" ? () => performance.now() : () => Date.now(), bD = typeof window < "u" ? (e) => window.requestAnimationFrame(e) : (e) => setTimeout(() => e(CI()), SD);
function EI(e) {
let t = [], r = [], i = 0, s = !1, c = !1;
const f = /* @__PURE__ */ new WeakSet(), m = {
schedule: (y, g = !1, S = !1) => {
const E = S && s, w = E ? t : r;
return g && f.add(y), w.indexOf(y) === -1 && (w.push(y), E && s && (i = t.length)), y;
},
cancel: (y) => {
const g = r.indexOf(y);
g !== -1 && r.splice(g, 1), f.delete(y);
},
process: (y) => {
if (s) {
c = !0;
return;
}
if (s = !0, [t, r] = [r, t], r.length = 0, i = t.length, i)
for (let g = 0; g < i; g++) {
const S = t[g];
S(y), f.has(S) && (m.schedule(S), e());
}
s = !1, c && (c = !1, m.process(y));
}
};
return m;
}
const wI = 40;
let ES = !0, Lp = !1, wS = !1;
const Pd = {
delta: 0,
timestamp: 0
}, th = [
"read",
"update",
"preRender",
"render",
"postRender"
], Sg = th.reduce((e, t) => (e[t] = EI(() => Lp = !0), e), {}), jI = th.reduce((e, t) => {
const r = Sg[t];
return e[t] = (i, s = !1, c = !1) => (Lp || _I(), r.schedule(i, s, c)), e;
}, {}), TI = th.reduce((e, t) => (e[t] = Sg[t].cancel, e), {});
th.reduce((e, t) => (e[t] = () => Sg[t].process(Pd), e), {});
const DI = (e) => Sg[e].process(Pd), CD = (e) => {
Lp = !1, Pd.delta = ES ? SD : Math.max(Math.min(e - Pd.timestamp, wI), 1), Pd.timestamp = e, wS = !0, th.forEach(DI), wS = !1, Lp && (ES = !1, bD(CD));
}, _I = () => {
Lp = !0, ES = !0, wS || bD(CD);
}, Hw = () => Pd;
function vb(e) {
const {
viewBox: t = "0 0 24 24",
d: r,
displayName: i,
defaultProps: s = {}
} = e, c = eh.toArray(e.path), f = lt((m, y) => /* @__PURE__ */ u.jsx(ia, { ref: y, viewBox: t, ...s, ...m, children: c.length ? c : /* @__PURE__ */ u.jsx("path", { fill: "currentColor", d: r }) }));
return f.displayName = i, f;
}
function nh(e) {
const { theme: t } = _O(), r = sI();
return Xt(
() => lI(t.direction, {
...r,
...e
}),
[e, t.direction, r]
);
}
var MI = Object.defineProperty, kI = (e, t, r) => t in e ? MI(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, lr = (e, t, r) => (kI(e, typeof t != "symbol" ? t + "" : t, r), r);
function Vw(e) {
return e.sort((t, r) => {
const i = t.compareDocumentPosition(r);
if (i & Node.DOCUMENT_POSITION_FOLLOWING || i & Node.DOCUMENT_POSITION_CONTAINED_BY)
return -1;
if (i & Node.DOCUMENT_POSITION_PRECEDING || i & Node.DOCUMENT_POSITION_CONTAINS)
return 1;
if (i & Node.DOCUMENT_POSITION_DISCONNECTED || i & Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)
throw Error("Cannot sort the given nodes.");
return 0;
});
}
var RI = (e) => typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
function Ww(e, t, r) {
let i = e + 1;
return r && i >= t && (i = 0), i;
}
function Gw(e, t, r) {
let i = e - 1;
return r && i < 0 && (i = t), i;
}
var jS = typeof window < "u" ? co : ot, Zm = (e) => e, PI = class {
constructor() {
lr(this, "descendants", /* @__PURE__ */ new Map()), lr(this, "register", (e) => {
if (e != null)
return RI(e) ? this.registerNode(e) : (t) => {
this.registerNode(t, e);
};
}), lr(this, "unregister", (e) => {
this.descendants.delete(e);
const t = Vw(Array.from(this.descendants.keys()));
this.assignIndex(t);
}), lr(this, "destroy", () => {
this.descendants.clear();
}), lr(this, "assignIndex", (e) => {
this.descendants.forEach((t) => {
const r = e.indexOf(t.node);
t.index = r, t.node.dataset.index = t.index.toString();
});
}), lr(this, "count", () => this.descendants.size), lr(this, "enabledCount", () => this.enabledValues().length), lr(this, "values", () => Array.from(this.descendants.values()).sort((t, r) => t.index - r.index)), lr(this, "enabledValues", () => this.values().filter((e) => !e.disabled)), lr(this, "item", (e) => {
if (this.count() !== 0)
return this.values()[e];
}), lr(this, "enabledItem", (e) => {
if (this.enabledCount() !== 0)
return this.enabledValues()[e];
}), lr(this, "first", () => this.item(0)), lr(this, "firstEnabled", () => this.enabledItem(0)), lr(this, "last", () => this.item(this.descendants.size - 1)), lr(this, "lastEnabled", () => {
const e = this.enabledValues().length - 1;
return this.enabledItem(e);
}), lr(this, "indexOf", (e) => {
var t, r;
return e && (r = (t = this.descendants.get(e)) == null ? void 0 : t.index) != null ? r : -1;
}), lr(this, "enabledIndexOf", (e) => e == null ? -1 : this.enabledValues().findIndex((t) => t.node.isSameNode(e))), lr(this, "next", (e, t = !0) => {
const r = Ww(e, this.count(), t);
return this.item(r);
}), lr(this, "nextEnabled", (e, t = !0) => {
const r = this.item(e);
if (!r)
return;
const i = this.enabledIndexOf(r.node), s = Ww(
i,
this.enabledCount(),
t
);
return this.enabledItem(s);
}), lr(this, "prev", (e, t = !0) => {
const r = Gw(e, this.count() - 1, t);
return this.item(r);
}), lr(this, "prevEnabled", (e, t = !0) => {
const r = this.item(e);
if (!r)
return;
const i = this.enabledIndexOf(r.node), s = Gw(
i,
this.enabledCount() - 1,
t
);
return this.enabledItem(s);
}), lr(this, "registerNode", (e, t) => {
if (!e || this.descendants.has(e))
return;
const r = Array.from(this.descendants.keys()).concat(e), i = Vw(r);
t != null && t.disabled && (t.disabled = !!t.disabled);
const s = { node: e, index: -1, ...t };
this.descendants.set(e, s), this.assignIndex(i);
});
}
};
function NI() {
const e = Xe(new PI());
return jS(() => () => e.current.destroy()), e.current;
}
var [OI, ED] = ur({
name: "DescendantsProvider",
errorMessage: "useDescendantsContext must be used within DescendantsProvider"
});
function AI(e) {
const t = ED(), [r, i] = qe(-1), s = Xe(null);
jS(() => () => {
s.current && t.unregister(s.current);
}, []), jS(() => {
if (!s.current)
return;
const f = Number(s.current.dataset.index);
r != f && !Number.isNaN(f) && i(f);
});
const c = Zm(e ? t.register(e) : t.register);
return {
descendants: t,
index: r,
enabledIndex: t.enabledIndexOf(s.current),
register: jr(c, s)
};
}
function mb() {
return [
Zm(OI),
() => Zm(ED()),
() => NI(),
(s) => AI(s)
];
}
var [zI, bg] = ur({
name: "AccordionStylesContext",
hookName: "useAccordionStyles",
providerName: ""
}), [II, gb] = ur({
name: "AccordionItemContext",
hookName: "useAccordionItemContext",
providerName: ""
}), [
FI,
dX,
LI,
BI
] = mb(), wd = lt(
function(t, r) {
const { getButtonProps: i } = gb(), s = i(t, r), f = {
display: "flex",
alignItems: "center",
width: "100%",
outline: 0,
...bg().button
};
return /* @__PURE__ */ u.jsx(
$e.button,
{
...s,
className: It("chakra-accordion__button", t.className),
__css: f
}
);
}
);
wd.displayName = "AccordionButton";
function yb(e) {
const {
value: t,
defaultValue: r,
onChange: i,
shouldUpdate: s = (w, D) => w !== D
} = e, c = oa(i), f = oa(s), [m, y] = qe(r), g = t !== void 0, S = g ? t : m, E = oa(
(w) => {
const M = typeof w == "function" ? w(S) : w;
f(S, M) && (g || y(M), c(M));
},
[g, c, S, f]
);
return [S, E];
}
function UI(e) {
const {
onChange: t,
defaultIndex: r,
index: i,
allowMultiple: s,
allowToggle: c,
...f
} = e;
WI(e), GI(e);
const m = LI(), [y, g] = qe(-1);
ot(() => () => {
g(-1);
}, []);
const [S, E] = yb({
value: i,
defaultValue() {
return s ? r ?? [] : r ?? -1;
},
onChange: t
});
return {
index: S,
setIndex: E,
htmlProps: f,
getAccordionItemProps: (D) => {
let M = !1;
return D !== null && (M = Array.isArray(S) ? S.includes(D) : S === D), { isOpen: M, onChange: (R) => {
if (D !== null)
if (s && Array.isArray(S)) {
const O = R ? S.concat(D) : S.filter((I) => I !== D);
E(O);
} else
R ? E(D) : c && E(-1);
} };
},
focusedIndex: y,
setFocusedIndex: g,
descendants: m
};
}
var [HI, xb] = ur({
name: "AccordionContext",
hookName: "useAccordionContext",
providerName: "Accordion"
});
function VI(e) {
const { isDisabled: t, isFocusable: r, id: i, ...s } = e, { getAccordionItemProps: c, setFocusedIndex: f } = xb(), m = Xe(null), y = Ko(), g = i ?? y, S = `accordion-button-${g}`, E = `accordion-panel-${g}`;
qI(e);
const { register: w, index: D, descendants: M } = BI({
disabled: t && !r
}), { isOpen: k, onChange: R } = c(
D === -1 ? null : D
);
YI({ isOpen: k, isDisabled: t });
const O = () => {
R == null || R(!0);
}, I = () => {
R == null || R(!1);
}, A = ee(() => {
R == null || R(!k), f(D);
}, [D, f, k, R]), L = ee(
($) => {
const oe = {
ArrowDown: () => {
const Y = M.nextEnabled(D);
Y == null || Y.node.focus();
},
ArrowUp: () => {
const Y = M.prevEnabled(D);
Y == null || Y.node.focus();
},
Home: () => {
const Y = M.firstEnabled();
Y == null || Y.node.focus();
},
End: () => {
const Y = M.lastEnabled();
Y == null || Y.node.focus();
}
}[$.key];
oe && ($.preventDefault(), oe($));
},
[M, D]
), H = ee(() => {
f(D);
}, [f, D]), q = ee(
function(ae = {}, oe = null) {
return {
...ae,
type: "button",
ref: jr(w, m, oe),
id: S,
disabled: !!t,
"aria-expanded": !!k,
"aria-controls": E,
onClick: Pt(ae.onClick, A),
onFocus: Pt(ae.onFocus, H),
onKeyDown: Pt(ae.onKeyDown, L)
};
},
[
S,
t,
k,
A,
H,
L,
E,
w
]
), U = ee(
function(ae = {}, oe = null) {
return {
...ae,
ref: oe,
role: "region",
id: E,
"aria-labelledby": S,
hidden: !k
};
},
[S, k, E]
);
return {
isOpen: k,
isDisabled: t,
isFocusable: r,
onOpen: O,
onClose: I,
getButtonProps: q,
getPanelProps: U,
htmlProps: s
};
}
function WI(e) {
const t = e.index || e.defaultIndex, r = t != null && !Array.isArray(t) && e.allowMultiple;
Yp({
condition: !!r,
message: `If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`
});
}
function GI(e) {
Yp({
condition: !!(e.allowMultiple && e.allowToggle),
message: "If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"
});
}
function qI(e) {
Yp({
condition: !!(e.isFocusable && !e.isDisabled),
message: `Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well.
`
});
}
function YI(e) {
Yp({
condition: e.isOpen && !!e.isDisabled,
message: "Cannot open a disabled accordion item"
});
}
function jd(e) {
const { isOpen: t, isDisabled: r } = gb(), { reduceMotion: i } = xb(), s = It("chakra-accordion__icon", e.className), c = bg(), f = {
opacity: r ? 0.4 : 1,
transform: t ? "rotate(-180deg)" : void 0,
transition: i ? void 0 : "transform 0.2s",
transformOrigin: "center",
...c.icon
};
return /* @__PURE__ */ u.jsx(
ia,
{
viewBox: "0 0 24 24",
"aria-hidden": !0,
className: s,
__css: f,
...e,
children: /* @__PURE__ */ u.jsx(
"path",
{
fill: "currentColor",
d: "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"
}
)
}
);
}
jd.displayName = "AccordionIcon";
var Td = lt(
function(t, r) {
const { children: i, className: s } = t, { htmlProps: c, ...f } = VI(t), y = {
...bg().container,
overflowAnchor: "none"
}, g = Xt(() => f, [f]);
return /* @__PURE__ */ u.jsx(II, { value: g, children: /* @__PURE__ */ u.jsx(
$e.div,
{
ref: r,
...c,
className: It("chakra-accordion__item", s),
__css: y,
children: typeof i == "function" ? i({
isExpanded: !!f.isOpen,
isDisabled: !!f.isDisabled
}) : i
}
) });
}
);
Td.displayName = "AccordionItem";
var Nu = {
ease: [0.25, 0.1, 0.25, 1],
easeIn: [0.4, 0, 1, 1],
easeOut: [0, 0, 0.2, 1],
easeInOut: [0.4, 0, 0.2, 1]
}, Dp = {
scale: {
enter: { scale: 1 },
exit: { scale: 0.95 }
},
fade: {
enter: { opacity: 1 },
exit: { opacity: 0 }
},
pushLeft: {
enter: { x: "100%" },
exit: { x: "-30%" }
},
pushRight: {
enter: { x: "-100%" },
exit: { x: "30%" }
},
pushUp: {
enter: { y: "100%" },
exit: { y: "-30%" }
},
pushDown: {
enter: { y: "-100%" },
exit: { y: "30%" }
},
slideLeft: {
position: { left: 0, top: 0, bottom: 0, width: "100%" },
enter: { x: 0, y: 0 },
exit: { x: "-100%", y: 0 }
},
slideRight: {
position: { right: 0, top: 0, bottom: 0, width: "100%" },
enter: { x: 0, y: 0 },
exit: { x: "100%", y: 0 }
},
slideUp: {
position: { top: 0, left: 0, right: 0, maxWidth: "100vw" },
enter: { x: 0, y: 0 },
exit: { x: 0, y: "-100%" }
},
slideDown: {
position: { bottom: 0, left: 0, right: 0, maxWidth: "100vw" },
enter: { x: 0, y: 0 },
exit: { x: 0, y: "100%" }
}
};
function TS(e) {
var t;
switch ((t = e == null ? void 0 : e.direction) != null ? t : "right") {
case "right":
return Dp.slideRight;
case "left":
return Dp.slideLeft;
case "bottom":
return Dp.slideDown;
case "top":
return Dp.slideUp;
default:
return Dp.slideRight;
}
}
var Iu = {
enter: {
duration: 0.2,
ease: Nu.easeOut
},
exit: {
duration: 0.1,
ease: Nu.easeIn
}
}, lo = {
enter: (e, t) => ({
...e,
delay: typeof t == "number" ? t : t == null ? void 0 : t.enter
}),
exit: (e, t) => ({
...e,
delay: typeof t == "number" ? t : t == null ? void 0 : t.exit
})
}, KI = (e) => e != null && parseInt(e.toString(), 10) > 0, qw = {
exit: {
height: { duration: 0.2, ease: Nu.ease },
opacity: { duration: 0.3, ease: Nu.ease }
},
enter: {
height: { duration: 0.3, ease: Nu.ease },
opacity: { duration: 0.4, ease: Nu.ease }
}
}, XI = {
exit: ({
animateOpacity: e,
startingHeight: t,
transition: r,
transitionEnd: i,
delay: s
}) => {
var c;
return {
...e && { opacity: KI(t) ? 1 : 0 },
height: t,
transitionEnd: i == null ? void 0 : i.exit,
transition: (c = r == null ? void 0 : r.exit) != null ? c : lo.exit(qw.exit, s)
};
},
enter: ({
animateOpacity: e,
endingHeight: t,
transition: r,
transitionEnd: i,
delay: s
}) => {
var c;
return {
...e && { opacity: 1 },
height: t,
transitionEnd: i == null ? void 0 : i.enter,
transition: (c = r == null ? void 0 : r.enter) != null ? c : lo.enter(qw.enter, s)
};
}
}, wD = Fl(
(e, t) => {
const {
in: r,
unmountOnExit: i,
animateOpacity: s = !0,
startingHeight: c = 0,
endingHeight: f = "auto",
style: m,
className: y,
transition: g,
transitionEnd: S,
...E
} = e, [w, D] = qe(!1);
ot(() => {
const I = setTimeout(() => {
D(!0);
});
return () => clearTimeout(I);
}, []), Yp({
condition: Boolean(c > 0 && i),
message: "startingHeight and unmountOnExit are mutually exclusive. You can't use them together"
});
const M = parseFloat(c.toString()) > 0, k = {
startingHeight: c,
endingHeight: f,
animateOpacity: s,
transition: w ? g : { enter: { duration: 0 } },
transitionEnd: {
enter: S == null ? void 0 : S.enter,
exit: i ? S == null ? void 0 : S.exit : {
...S == null ? void 0 : S.exit,
display: M ? "block" : "none"
}
}
}, R = i ? r : !0, O = r || i ? "enter" : "exit";
return /* @__PURE__ */ u.jsx(Wu, { initial: !1, custom: k, children: R && /* @__PURE__ */ u.jsx(
zs.div,
{
ref: t,
...E,
className: It("chakra-collapse", y),
style: {
overflow: "hidden",
display: "block",
...m
},
custom: k,
variants: XI,
initial: i ? "exit" : !1,
animate: O,
exit: "exit"
}
) });
}
);
wD.displayName = "Collapse";
var $I = {
enter: ({ transition: e, transitionEnd: t, delay: r } = {}) => {
var i;
return {
opacity: 1,
transition: (i = e == null ? void 0 : e.enter) != null ? i : lo.enter(Iu.enter, r),
transitionEnd: t == null ? void 0 : t.enter
};
},
exit: ({ transition: e, transitionEnd: t, delay: r } = {}) => {
var i;
return {
opacity: 0,
transition: (i = e == null ? void 0 : e.exit) != null ? i : lo.exit(Iu.exit, r),
transitionEnd: t == null ? void 0 : t.exit
};
}
}, jD = {
initial: "exit",
animate: "enter",
exit: "exit",
variants: $I
}, QI = Fl(function(t, r) {
const {
unmountOnExit: i,
in: s,
className: c,
transition: f,
transitionEnd: m,
delay: y,
...g
} = t, S = s || i ? "enter" : "exit", E = i ? s && i : !0, w = { transition: f, transitionEnd: m, delay: y };
return /* @__PURE__ */ u.jsx(Wu, { custom: w, children: E && /* @__PURE__ */ u.jsx(
zs.div,
{
ref: r,
className: It("chakra-fade", c),
custom: w,
...jD,
animate: S,
...g
}
) });
});
QI.displayName = "Fade";
var ZI = {
exit: ({ reverse: e, initialScale: t, transition: r, transitionEnd: i, delay: s }) => {
var c;
return {
opacity: 0,
...e ? { scale: t, transitionEnd: i == null ? void 0 : i.exit } : { transitionEnd: { scale: t, ...i == null ? void 0 : i.exit } },
transition: (c = r == null ? void 0 : r.exit) != null ? c : lo.exit(Iu.exit, s)
};
},
enter: ({ transitionEnd: e, transition: t, delay: r }) => {
var i;
return {
opacity: 1,
scale: 1,
transition: (i = t == null ? void 0 : t.enter) != null ? i : lo.enter(Iu.enter, r),
transitionEnd: e == null ? void 0 : e.enter
};
}
}, TD = {
initial: "exit",
animate: "enter",
exit: "exit",
variants: ZI
}, JI = Fl(
function(t, r) {
const {
unmountOnExit: i,
in: s,
reverse: c = !0,
initialScale: f = 0.95,
className: m,
transition: y,
transitionEnd: g,
delay: S,
...E
} = t, w = i ? s && i : !0, D = s || i ? "enter" : "exit", M = { initialScale: f, reverse: c, transition: y, transitionEnd: g, delay: S };
return /* @__PURE__ */ u.jsx(Wu, { custom: M, children: w && /* @__PURE__ */ u.jsx(
zs.div,
{
ref: r,
className: It("chakra-offset-slide", m),
...TD,
animate: D,
custom: M,
...E
}
) });
}
);
JI.displayName = "ScaleFade";
var e4 = {
initial: ({ offsetX: e, offsetY: t, transition: r, transitionEnd: i, delay: s }) => {
var c;
return {
opacity: 0,
x: e,
y: t,
transition: (c = r == null ? void 0 : r.exit) != null ? c : lo.exit(Iu.exit, s),
transitionEnd: i == null ? void 0 : i.exit
};
},
enter: ({ transition: e, transitionEnd: t, delay: r }) => {
var i;
return {
opacity: 1,
x: 0,
y: 0,
transition: (i = e == null ? void 0 : e.enter) != null ? i : lo.enter(Iu.enter, r),
transitionEnd: t == null ? void 0 : t.enter
};
},
exit: ({ offsetY: e, offsetX: t, transition: r, transitionEnd: i, reverse: s, delay: c }) => {
var f;
const m = { x: t, y: e };
return {
opacity: 0,
transition: (f = r == null ? void 0 : r.exit) != null ? f : lo.exit(Iu.exit, c),
...s ? { ...m, transitionEnd: i == null ? void 0 : i.exit } : { transitionEnd: { ...m, ...i == null ? void 0 : i.exit } }
};
}
}, DS = {
initial: "initial",
animate: "enter",
exit: "exit",
variants: e4
}, t4 = Fl(
function(t, r) {
const {
unmountOnExit: i,
in: s,
reverse: c = !0,
className: f,
offsetX: m = 0,
offsetY: y = 8,
transition: g,
transitionEnd: S,
delay: E,
...w
} = t, D = i ? s && i : !0, M = s || i ? "enter" : "exit", k = {
offsetX: m,
offsetY: y,
reverse: c,
transition: g,
transitionEnd: S,
delay: E
};
return /* @__PURE__ */ u.jsx(Wu, { custom: k, children: D && /* @__PURE__ */ u.jsx(
zs.div,
{
ref: r,
className: It("chakra-offset-slide", f),
custom: k,
...DS,
animate: M,
...w
}
) });
}
);
t4.displayName = "SlideFade";
var Yw = {
exit: {
duration: 0.15,
ease: Nu.easeInOut
},
enter: {
type: "spring",
damping: 25,
stiffness: 180
}
}, n4 = {
exit: ({ direction: e, transition: t, transitionEnd: r, delay: i }) => {
var s;
const { exit: c } = TS({ direction: e });
return {
...c,
transition: (s = t == null ? void 0 : t.exit) != null ? s : lo.exit(Yw.exit, i),
transitionEnd: r == null ? void 0 : r.exit
};
},
enter: ({ direction: e, transitionEnd: t, transition: r, delay: i }) => {
var s;
const { enter: c } = TS({ direction: e });
return {
...c,
transition: (s = r == null ? void 0 : r.enter) != null ? s : lo.enter(Yw.enter, i),
transitionEnd: t == null ? void 0 : t.enter
};
}
}, DD = Fl(function(t, r) {
const {
direction: i = "right",
style: s,
unmountOnExit: c,
in: f,
className: m,
transition: y,
transitionEnd: g,
delay: S,
motionProps: E,
...w
} = t, D = TS({ direction: i }), M = Object.assign(
{ position: "fixed" },
D.position,
s
), k = c ? f && c : !0, R = f || c ? "enter" : "exit", O = { transitionEnd: g, transition: y, direction: i, delay: S };
return /* @__PURE__ */ u.jsx(Wu, { custom: O, children: k && /* @__PURE__ */ u.jsx(
zs.div,
{
...w,
ref: r,
initial: "exit",
className: It("chakra-slide", m),
animate: R,
exit: "exit",
custom: O,
variants: n4,
style: M,
...E
}
) });
});
DD.displayName = "Slide";
var Dd = lt(
function(t, r) {
const { className: i, motionProps: s, ...c } = t, { reduceMotion: f } = xb(), { getPanelProps: m, isOpen: y } = gb(), g = m(c, r), S = It("chakra-accordion__panel", i), E = bg();
f || delete g.hidden;
const w = /* @__PURE__ */ u.jsx($e.div, { ...g, __css: E.panel, className: S });
return f ? w : /* @__PURE__ */ u.jsx(wD, { in: y, ...s, children: w });
}
);
Dd.displayName = "AccordionPanel";
var Sb = lt(function({ children: t, reduceMotion: r, ...i }, s) {
const c = Ha("Accordion", i), f = Tr(i), { htmlProps: m, descendants: y, ...g } = UI(f), S = Xt(
() => ({ ...g, reduceMotion: !!r }),
[g, r]
);
return /* @__PURE__ */ u.jsx(FI, { value: y, children: /* @__PURE__ */ u.jsx(HI, { value: S, children: /* @__PURE__ */ u.jsx(zI, { value: c, children: /* @__PURE__ */ u.jsx(
$e.div,
{
ref: s,
...m,
className: It("chakra-accordion", i.className),
__css: c.root,
children: t
}
) }) }) });
});
Sb.displayName = "Accordion";
var r4 = {
horizontal: {
"> *:first-of-type:not(:last-of-type)": { borderEndRadius: 0 },
"> *:not(:first-of-type):not(:last-of-type)": { borderRadius: 0 },
"> *:not(:first-of-type):last-of-type": { borderStartRadius: 0 }
},
vertical: {
"> *:first-of-type:not(:last-of-type)": { borderBottomRadius: 0 },
"> *:not(:first-of-type):not(:last-of-type)": { borderRadius: 0 },
"> *:not(:first-of-type):last-of-type": { borderTopRadius: 0 }
}
}, a4 = {
horizontal: (e) => ({
"& > *:not(style) ~ *:not(style)": { marginStart: e }
}),
vertical: (e) => ({
"& > *:not(style) ~ *:not(style)": { marginTop: e }
})
}, qr = lt(
function(t, r) {
const {
size: i,
colorScheme: s,
variant: c,
className: f,
spacing: m = "0.5rem",
isAttached: y,
isDisabled: g,
orientation: S = "horizontal",
...E
} = t, w = It("chakra-button__group", f), D = Xt(
() => ({ size: i, colorScheme: s, variant: c, isDisabled: g }),
[i, s, c, g]
);
let M = {
display: "inline-flex",
...y ? r4[S] : a4[S](m)
};
const k = S === "vertical";
return /* @__PURE__ */ u.jsx(MO, { value: D, children: /* @__PURE__ */ u.jsx(
$e.div,
{
ref: r,
role: "group",
__css: M,
className: w,
"data-attached": y ? "" : void 0,
"data-orientation": S,
flexDir: k ? "column" : void 0,
...E
}
) });
}
);
qr.displayName = "ButtonGroup";
var [fX, i4] = ur({
name: "CheckboxGroupContext",
strict: !1
});
function o4(e) {
return /* @__PURE__ */ u.jsx(
$e.svg,
{
width: "1.2em",
viewBox: "0 0 12 10",
style: {
fill: "none",
strokeWidth: 2,
stroke: "currentColor",
strokeDasharray: 16
},
...e,
children: /* @__PURE__ */ u.jsx("polyline", { points: "1.5 6 4.5 9 10.5 1" })
}
);
}
function s4(e) {
return /* @__PURE__ */ u.jsx(
$e.svg,
{
width: "1.2em",
viewBox: "0 0 24 24",
style: { stroke: "currentColor", strokeWidth: 4 },
...e,
children: /* @__PURE__ */ u.jsx("line", { x1: "21", x2: "3", y1: "12", y2: "12" })
}
);
}
function l4(e) {
const { isIndeterminate: t, isChecked: r, ...i } = e, s = t ? s4 : o4;
return r || t ? /* @__PURE__ */ u.jsx(
$e.div,
{
style: {
display: "flex",
alignItems: "center",
justifyContent: "center",
height: "100%"
},
children: /* @__PURE__ */ u.jsx(s, { ...i })
}
) : null;
}
var [u4, _D] = ur({
name: "FormControlStylesContext",
errorMessage: `useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `
}), [c4, Yu] = ur({
strict: !1,
name: "FormControlContext"
});
function d4(e) {
const {
id: t,
isRequired: r,
isInvalid: i,
isDisabled: s,
isReadOnly: c,
...f
} = e, m = Ko(), y = t || `field-${m}`, g = `${y}-label`, S = `${y}-feedback`, E = `${y}-helptext`, [w, D] = qe(!1), [M, k] = qe(!1), [R, O] = qe(!1), I = ee(
(U = {}, $ = null) => ({
id: E,
...U,
ref: jr($, (ae) => {
ae && k(!0);
})
}),
[E]
), A = ee(
(U = {}, $ = null) => {
var ae, oe;
return {
...U,
ref: $,
"data-focus": Kt(R),
"data-disabled": Kt(s),
"data-invalid": Kt(i),
"data-readonly": Kt(c),
id: (ae = U.id) != null ? ae : g,
htmlFor: (oe = U.htmlFor) != null ? oe : y
};
},
[y, s, R, i, c, g]
), L = ee(
(U = {}, $ = null) => ({
id: S,
...U,
ref: jr($, (ae) => {
ae && D(!0);
}),
"aria-live": "polite"
}),
[S]
), H = ee(
(U = {}, $ = null) => ({
...U,
...f,
ref: $,
role: "group"
}),
[f]
), q = ee(
(U = {}, $ = null) => ({
...U,
ref: $,
role: "presentation",
"aria-hidden": !0,
children: U.children || "*"
}),
[]
);
return {
isRequired: !!r,
isInvalid: !!i,
isReadOnly: !!c,
isDisabled: !!s,
isFocused: !!R,
onFocus: () => O(!0),
onBlur: () => O(!1),
hasFeedbackText: w,
setHasFeedbackText: D,
hasHelpText: M,
setHasHelpText: k,
id: y,
labelId: g,
feedbackId: S,
helpTextId: E,
htmlProps: f,
getHelpTextProps: I,
getErrorMessageProps: L,
getRootProps: H,
getLabelProps: A,
getRequiredIndicatorProps: q
};
}
var dn = lt(
function(t, r) {
const i = Ha("Form", t), s = Tr(t), {
getRootProps: c,
htmlProps: f,
...m
} = d4(s), y = It("chakra-form-control", t.className);
return /* @__PURE__ */ u.jsx(c4, { value: m, children: /* @__PURE__ */ u.jsx(u4, { value: i, children: /* @__PURE__ */ u.jsx(
$e.div,
{
...c({}, r),
className: y,
__css: i.container
}
) }) });
}
);
dn.displayName = "FormControl";
var Fa = lt(
function(t, r) {
const i = Yu(), s = _D(), c = It("chakra-form__helper-text", t.className);
return /* @__PURE__ */ u.jsx(
$e.div,
{
...i == null ? void 0 : i.getHelpTextProps(t, r),
__css: s.helperText,
className: c
}
);
}
);
Fa.displayName = "FormHelperText";
var [f4, p4] = ur({
name: "FormErrorStylesContext",
errorMessage: `useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `
}), La = lt(
(e, t) => {
const r = Ha("FormError", e), i = Tr(e), s = Yu();
return s != null && s.isInvalid ? /* @__PURE__ */ u.jsx(f4, { value: r, children: /* @__PURE__ */ u.jsx(
$e.div,
{
...s == null ? void 0 : s.getErrorMessageProps(i, t),
className: It("chakra-form__error-message", e.className),
__css: {
display: "flex",
alignItems: "center",
...r.text
}
}
) }) : null;
}
);
La.displayName = "FormErrorMessage";
var h4 = lt((e, t) => {
const r = p4(), i = Yu();
if (!(i != null && i.isInvalid))
return null;
const s = It("chakra-form__error-icon", e.className);
return /* @__PURE__ */ u.jsx(
ia,
{
ref: t,
"aria-hidden": !0,
...e,
__css: r.icon,
className: s,
children: /* @__PURE__ */ u.jsx(
"path",
{
fill: "currentColor",
d: "M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"
}
)
}
);
});
h4.displayName = "FormErrorIcon";
var Sn = lt(function(t, r) {
var i;
const s = Hd("FormLabel", t), c = Tr(t), {
className: f,
children: m,
requiredIndicator: y = /* @__PURE__ */ u.jsx(MD, {}),
optionalIndicator: g = null,
...S
} = c, E = Yu(), w = (i = E == null ? void 0 : E.getLabelProps(S, r)) != null ? i : { ref: r, ...S };
return /* @__PURE__ */ u.jsxs(
$e.label,
{
...w,
className: It("chakra-form__label", c.className),
__css: {
display: "block",
textAlign: "start",
...s
},
children: [
m,
E != null && E.isRequired ? y : g
]
}
);
});
Sn.displayName = "FormLabel";
var MD = lt(
function(t, r) {
const i = Yu(), s = _D();
if (!(i != null && i.isRequired))
return null;
const c = It("chakra-form__required-indicator", t.className);
return /* @__PURE__ */ u.jsx(
$e.span,
{
...i == null ? void 0 : i.getRequiredIndicatorProps(t, r),
__css: s.requiredIndicator,
className: c
}
);
}
);
MD.displayName = "RequiredIndicator";
function bb(e) {
const { isDisabled: t, isInvalid: r, isReadOnly: i, isRequired: s, ...c } = Cb(e);
return {
...c,
disabled: t,
readOnly: i,
required: s,
"aria-invalid": _s(r),
"aria-required": _s(s),
"aria-readonly": _s(i)
};
}
function Cb(e) {
var t, r, i;
const s = Yu(), {
id: c,
disabled: f,
readOnly: m,
required: y,
isRequired: g,
isInvalid: S,
isReadOnly: E,
isDisabled: w,
onFocus: D,
onBlur: M,
...k
} = e, R = e["aria-describedby"] ? [e["aria-describedby"]] : [];
return s != null && s.hasFeedbackText && (s != null && s.isInvalid) && R.push(s.feedbackId), s != null && s.hasHelpText && R.push(s.helpTextId), {
...k,
"aria-describedby": R.join(" ") || void 0,
id: c ?? (s == null ? void 0 : s.id),
isDisabled: (t = f ?? w) != null ? t : s == null ? void 0 : s.isDisabled,
isReadOnly: (r = m ?? E) != null ? r : s == null ? void 0 : s.isReadOnly,
isRequired: (i = y ?? g) != null ? i : s == null ? void 0 : s.isRequired,
isInvalid: S ?? (s == null ? void 0 : s.isInvalid),
onFocus: Pt(s == null ? void 0 : s.onFocus, D),
onBlur: Pt(s == null ? void 0 : s.onBlur, M)
};
}
var Eb = {
border: "0",
clip: "rect(0, 0, 0, 0)",
height: "1px",
width: "1px",
margin: "-1px",
padding: "0",
overflow: "hidden",
whiteSpace: "nowrap",
position: "absolute"
}, kD = $e("span", {
baseStyle: Eb
});
kD.displayName = "VisuallyHidden";
var v4 = $e("input", {
baseStyle: Eb
});
v4.displayName = "VisuallyHiddenInput";
var Kw = !1, rh = null, Uu = !1, _S = !1, MS = /* @__PURE__ */ new Set();
function wb(e, t) {
MS.forEach((r) => r(e, t));
}
var m4 = typeof window < "u" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : !1;
function g4(e) {
return !(e.metaKey || !m4 && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
}
function Xw(e) {
Uu = !0, g4(e) && (rh = "keyboard", wb("keyboard", e));
}
function gd(e) {
if (rh = "pointer", e.type === "mousedown" || e.type === "pointerdown") {
Uu = !0;
const t = e.composedPath ? e.composedPath()[0] : e.target;
let r = !1;
try {
r = t.matches(":focus-visible");
} catch {
}
if (r)
return;
wb("pointer", e);
}
}
function y4(e) {
return e.mozInputSource === 0 && e.isTrusted ? !0 : e.detail === 0 && !e.pointerType;
}
function x4(e) {
y4(e) && (Uu = !0, rh = "virtual");
}
function S4(e) {
e.target === window || e.target === document || (!Uu && !_S && (rh = "virtual", wb("virtual", e)), Uu = !1, _S = !1);
}
function b4() {
Uu = !1, _S = !0;
}
function $w() {
return rh !== "pointer";
}
function C4() {
if (typeof window > "u" || Kw)
return;
const { focus: e } = HTMLElement.prototype;
HTMLElement.prototype.focus = function(...r) {
Uu = !0, e.apply(this, r);
}, document.addEventListener("keydown", Xw, !0), document.addEventListener("keyup", Xw, !0), document.addEventListener("click", x4, !0), window.addEventListener("focus", S4, !0), window.addEventListener("blur", b4, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", gd, !0), document.addEventListener("pointermove", gd, !0), document.addEventListener("pointerup", gd, !0)) : (document.addEventListener("mousedown", gd, !0), document.addEventListener("mousemove", gd, !0), document.addEventListener("mouseup", gd, !0)), Kw = !0;
}
function RD(e) {
C4(), e($w());
const t = () => e($w());
return MS.add(t), () => {
MS.delete(t);
};
}
function E4(e, t = []) {
const r = Object.assign({}, e);
for (const i of t)
i in r && delete r[i];
return r;
}
function PD(e = {}) {
const t = Cb(e), {
isDisabled: r,
isReadOnly: i,
isRequired: s,
isInvalid: c,
id: f,
onBlur: m,
onFocus: y,
"aria-describedby": g
} = t, {
defaultChecked: S,
isChecked: E,
isFocusable: w,
onChange: D,
isIndeterminate: M,
name: k,
value: R,
tabIndex: O = void 0,
"aria-label": I,
"aria-labelledby": A,
"aria-invalid": L,
...H
} = e, q = E4(H, [
"isDisabled",
"isReadOnly",
"isRequired",
"isInvalid",
"id",
"onBlur",
"onFocus",
"aria-describedby"
]), U = oa(D), $ = oa(m), ae = oa(y), [oe, Y] = qe(!1), [ve, de] = qe(!1), [fe, _e] = qe(!1), [Me, te] = qe(!1);
ot(() => RD(Y), []);
const K = Xe(null), [se, B] = qe(!0), [re, ke] = qe(!!S), De = E !== void 0, Se = De ? E : re, be = ee(
(Qe) => {
if (i || r) {
Qe.preventDefault();
return;
}
De || ke(Se ? Qe.target.checked : M ? !0 : Qe.target.checked), U == null || U(Qe);
},
[
i,
r,
Se,
De,
M,
U
]
);
Am(() => {
K.current && (K.current.indeterminate = Boolean(M));
}, [M]), Kp(() => {
r && de(!1);
}, [r, de]), Am(() => {
const Qe = K.current;
Qe != null && Qe.form && (Qe.form.onreset = () => {
ke(!!S);
});
}, []);
const Ie = r && !w, Ue = ee(
(Qe) => {
Qe.key === " " && te(!0);
},
[te]
), tt = ee(
(Qe) => {
Qe.key === " " && te(!1);
},
[te]
);
Am(() => {
if (!K.current)
return;
K.current.checked !== Se && ke(K.current.checked);
}, [K.current]);
const ht = ee(
(Qe = {}, rn = null) => {
const Tn = (pn) => {
ve && pn.preventDefault(), te(!0);
};
return {
...Qe,
ref: rn,
"data-active": Kt(Me),
"data-hover": Kt(fe),
"data-checked": Kt(Se),
"data-focus": Kt(ve),
"data-focus-visible": Kt(ve && oe),
"data-indeterminate": Kt(M),
"data-disabled": Kt(r),
"data-invalid": Kt(c),
"data-readonly": Kt(i),
"aria-hidden": !0,
onMouseDown: Pt(Qe.onMouseDown, Tn),
onMouseUp: Pt(Qe.onMouseUp, () => te(!1)),
onMouseEnter: Pt(
Qe.onMouseEnter,
() => _e(!0)
),
onMouseLeave: Pt(
Qe.onMouseLeave,
() => _e(!1)
)
};
},
[
Me,
Se,
r,
ve,
oe,
fe,
M,
c,
i
]
), dt = ee(
(Qe = {}, rn = null) => ({
...q,
...Qe,
ref: jr(rn, (Tn) => {
Tn && B(Tn.tagName === "LABEL");
}),
onClick: Pt(Qe.onClick, () => {
var Tn;
se || ((Tn = K.current) == null || Tn.click(), requestAnimationFrame(() => {
var pn;
(pn = K.current) == null || pn.focus();
}));
}),
"data-disabled": Kt(r),
"data-checked": Kt(Se),
"data-invalid": Kt(c)
}),
[q, r, Se, c, se]
), Le = ee(
(Qe = {}, rn = null) => ({
...Qe,
ref: jr(K, rn),
type: "checkbox",
name: k,
value: R,
id: f,
tabIndex: O,
onChange: Pt(Qe.onChange, be),
onBlur: Pt(
Qe.onBlur,
$,
() => de(!1)
),
onFocus: Pt(
Qe.onFocus,
ae,
() => de(!0)
),
onKeyDown: Pt(Qe.onKeyDown, Ue),
onKeyUp: Pt(Qe.onKeyUp, tt),
required: s,
checked: Se,
disabled: Ie,
readOnly: i,
"aria-label": I,
"aria-labelledby": A,
"aria-invalid": L ? Boolean(L) : c,
"aria-describedby": g,
"aria-disabled": r,
style: Eb
}),
[
k,
R,
f,
be,
$,
ae,
Ue,
tt,
s,
Se,
Ie,
i,
I,
A,
L,
c,
g,
r,
O
]
), yt = ee(
(Qe = {}, rn = null) => ({
...Qe,
ref: rn,
onMouseDown: Pt(Qe.onMouseDown, Qw),
onTouchStart: Pt(Qe.onTouchStart, Qw),
"data-disabled": Kt(r),
"data-checked": Kt(Se),
"data-invalid": Kt(c)
}),
[Se, r, c]
);
return {
state: {
isInvalid: c,
isFocused: ve,
isChecked: Se,
isActive: Me,
isHovered: fe,
isIndeterminate: M,
isDisabled: r,
isReadOnly: i,
isRequired: s
},
getRootProps: dt,
getCheckboxProps: ht,
getInputProps: Le,
getLabelProps: yt,
htmlProps: q
};
}
function Qw(e) {
e.preventDefault(), e.stopPropagation();
}
var w4 = {
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
verticalAlign: "top",
userSelect: "none",
flexShrink: 0
}, j4 = {
cursor: "pointer",
display: "inline-flex",
alignItems: "center",
verticalAlign: "top",
position: "relative"
}, T4 = Gu({
from: {
opacity: 0,
strokeDashoffset: 16,
transform: "scale(0.95)"
},
to: {
opacity: 1,
strokeDashoffset: 0,
transform: "scale(1)"
}
}), D4 = Gu({
from: {
opacity: 0
},
to: {
opacity: 1
}
}), _4 = Gu({
from: {
transform: "scaleX(0.65)"
},
to: {
transform: "scaleX(1)"
}
}), ND = lt(function(t, r) {
const i = i4(), s = { ...i, ...t }, c = Ha("Checkbox", s), f = Tr(t), {
spacing: m = "0.5rem",
className: y,
children: g,
iconColor: S,
iconSize: E,
icon: w = /* @__PURE__ */ u.jsx(l4, {}),
isChecked: D,
isDisabled: M = i == null ? void 0 : i.isDisabled,
onChange: k,
inputProps: R,
...O
} = f;
let I = D;
i != null && i.value && f.value && (I = i.value.includes(f.value));
let A = k;
i != null && i.onChange && f.value && (A = ib(i.onChange, k));
const {
state: L,
getInputProps: H,
getCheckboxProps: q,
getLabelProps: U,
getRootProps: $
} = PD({
...O,
isDisabled: M,
isChecked: I,
onChange: A
}), ae = Xt(
() => ({
animation: L.isIndeterminate ? `${D4} 20ms linear, ${_4} 200ms linear` : `${T4} 200ms linear`,
fontSize: E,
color: S,
...c.icon
}),
[S, E, , L.isIndeterminate, c.icon]
), oe = Ll(w, {
__css: ae,
isIndeterminate: L.isIndeterminate,
isChecked: L.isChecked
});
return /* @__PURE__ */ u.jsxs(
$e.label,
{
__css: { ...j4, ...c.container },
className: It("chakra-checkbox", y),
...$(),
children: [
/* @__PURE__ */ u.jsx(
"input",
{
className: "chakra-checkbox__input",
...H(R, r)
}
),
/* @__PURE__ */ u.jsx(
$e.span,
{
__css: { ...w4, ...c.control },
className: "chakra-checkbox__control",
...q(),
children: oe
}
),
g && /* @__PURE__ */ u.jsx(
$e.span,
{
className: "chakra-checkbox__label",
...U(),
__css: {
marginStart: m,
...c.label
},
children: g
}
)
]
}
);
});
ND.displayName = "Checkbox";
function M4(e) {
const t = parseFloat(e);
return typeof t != "number" || Number.isNaN(t) ? 0 : t;
}
function jb(e, t) {
let r = M4(e);
const i = 10 ** (t ?? 10);
return r = Math.round(r * i) / i, t ? r.toFixed(t) : r.toString();
}
function kS(e) {
if (!Number.isFinite(e))
return 0;
let t = 1, r = 0;
for (; Math.round(e * t) / t !== e; )
t *= 10, r += 1;
return r;
}
function Zw(e, t, r) {
return (e - t) * 100 / (r - t);
}
function k4(e, t, r) {
return (r - t) * e + t;
}
function Jw(e, t, r) {
const i = Math.round((e - t) / r) * r + t, s = kS(r);
return jb(i, s);
}
function Lm(e, t, r) {
return e == null ? e : (r < t && console.warn("clamp: max cannot be less than min"), Math.min(Math.max(e, t), r));
}
function R4(e = {}) {
const {
onChange: t,
precision: r,
defaultValue: i,
value: s,
step: c = 1,
min: f = Number.MIN_SAFE_INTEGER,
max: m = Number.MAX_SAFE_INTEGER,
keepWithinRange: y = !0
} = e, g = oa(t), [S, E] = qe(() => {
var oe;
return i == null ? "" : (oe = jx(i, c, r)) != null ? oe : "";
}), w = typeof s < "u", D = w ? s : S, M = OD(_l(D), c), k = r ?? M, R = ee(
(oe) => {
oe !== D && (w || E(oe.toString()), g == null || g(oe.toString(), _l(oe)));
},
[g, w, D]
), O = ee(
(oe) => {
let Y = oe;
return y && (Y = Lm(Y, f, m)), jb(Y, k);
},
[k, y, m, f]
), I = ee(
(oe = c) => {
let Y;
D === "" ? Y = _l(oe) : Y = _l(D) + oe, Y = O(Y), R(Y);
},
[O, c, R, D]
), A = ee(
(oe = c) => {
let Y;
D === "" ? Y = _l(-oe) : Y = _l(D) - oe, Y = O(Y), R(Y);
},
[O, c, R, D]
), L = ee(() => {
var oe;
let Y;
i == null ? Y = "" : Y = (oe = jx(i, c, r)) != null ? oe : f, R(Y);
}, [i, r, c, R, f]), H = ee(
(oe) => {
var Y;
const ve = (Y = jx(oe, c, k)) != null ? Y : f;
R(ve);
},
[k, c, R, f]
), q = _l(D);
return {
isOutOfRange: q > m || q < f,
isAtMax: q === m,
isAtMin: q === f,
precision: k,
value: D,
valueAsNumber: q,
update: R,
reset: L,
increment: I,
decrement: A,
clamp: O,
cast: H,
setValue: E
};
}
function _l(e) {
return parseFloat(e.toString().replace(/[^\w.-]+/g, ""));
}
function OD(e, t) {
return Math.max(kS(t), kS(e));
}
function jx(e, t, r) {
const i = _l(e);
if (Number.isNaN(i))
return;
const s = OD(i, t);
return jb(i, r ?? s);
}
var St = {}, ej = {
get exports() {
return St;
},
set exports(e) {
St = e;
}
};
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var Tx, tj;
function P4() {
if (tj)
return Tx;
tj = 1;
var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, r = Object.prototype.propertyIsEnumerable;
function i(c) {
if (c == null)
throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(c);
}
function s() {
try {
if (!Object.assign)
return !1;
var c = new String("abc");
if (c[5] = "de", Object.getOwnPropertyNames(c)[0] === "5")
return !1;
for (var f = {}, m = 0; m < 10; m++)
f["_" + String.fromCharCode(m)] = m;
var y = Object.getOwnPropertyNames(f).map(function(S) {
return f[S];
});
if (y.join("") !== "0123456789")
return !1;
var g = {};
return "abcdefghijklmnopqrst".split("").forEach(function(S) {
g[S] = S;
}), Object.keys(Object.assign({}, g)).join("") === "abcdefghijklmnopqrst";
} catch {
return !1;
}
}
return Tx = s() ? Object.assign : function(c, f) {
for (var m, y = i(c), g, S = 1; S < arguments.length; S++) {
m = Object(arguments[S]);
for (var E in m)
t.call(m, E) && (y[E] = m[E]);
if (e) {
g = e(m);
for (var w = 0; w < g.length; w++)
r.call(m, g[w]) && (y[g[w]] = m[g[w]]);
}
}
return y;
}, Tx;
}
var Dx, nj;
function Tb() {
if (nj)
return Dx;
nj = 1;
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
return Dx = e, Dx;
}
var _x, rj;
function AD() {
return rj || (rj = 1, _x = Function.call.bind(Object.prototype.hasOwnProperty)), _x;
}
var Mx, aj;
function N4() {
if (aj)
return Mx;
aj = 1;
var e = function() {
};
if (process.env.NODE_ENV !== "production") {
var t = Tb(), r = {}, i = AD();
e = function(c) {
var f = "Warning: " + c;
typeof console < "u" && console.error(f);
try {
throw new Error(f);
} catch {
}
};
}
function s(c, f, m, y, g) {
if (process.env.NODE_ENV !== "production") {
for (var S in c)
if (i(c, S)) {
var E;
try {
if (typeof c[S] != "function") {
var w = Error(
(y || "React class") + ": " + m + " type `" + S + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof c[S] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
);
throw w.name = "Invariant Violation", w;
}
E = c[S](f, S, y, m, null, t);
} catch (M) {
E = M;
}
if (E && !(E instanceof Error) && e(
(y || "React class") + ": type specification of " + m + " `" + S + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof E + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
), E instanceof Error && !(E.message in r)) {
r[E.message] = !0;
var D = g ? g() : "";
e(
"Failed " + m + " type: " + E.message + (D ?? "")
);
}
}
}
}
return s.resetWarningCache = function() {
process.env.NODE_ENV !== "production" && (r = {});
}, Mx = s, Mx;
}
var kx, ij;
function O4() {
if (ij)
return kx;
ij = 1;
var e = p2, t = P4(), r = Tb(), i = AD(), s = N4(), c = function() {
};
process.env.NODE_ENV !== "production" && (c = function(m) {
var y = "Warning: " + m;
typeof console < "u" && console.error(y);
try {
throw new Error(y);
} catch {
}
});
function f() {
return null;
}
return kx = function(m, y) {
var g = typeof Symbol == "function" && Symbol.iterator, S = "@@iterator";
function E(B) {
var re = B && (g && B[g] || B[S]);
if (typeof re == "function")
return re;
}
var w = "<>", D = {
array: O("array"),
bigint: O("bigint"),
bool: O("boolean"),
func: O("function"),
number: O("number"),
object: O("object"),
string: O("string"),
symbol: O("symbol"),
any: I(),
arrayOf: A,
element: L(),
elementType: H(),
instanceOf: q,
node: oe(),
objectOf: $,
oneOf: U,
oneOfType: ae,
shape: ve,
exact: de
};
function M(B, re) {
return B === re ? B !== 0 || 1 / B === 1 / re : B !== B && re !== re;
}
function k(B, re) {
this.message = B, this.data = re && typeof re == "object" ? re : {}, this.stack = "";
}
k.prototype = Error.prototype;
function R(B) {
if (process.env.NODE_ENV !== "production")
var re = {}, ke = 0;
function De(be, Ie, Ue, tt, ht, dt, Le) {
if (tt = tt || w, dt = dt || Ue, Le !== r) {
if (y) {
var yt = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
);
throw yt.name = "Invariant Violation", yt;
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
var Ot = tt + ":" + Ue;
!re[Ot] && // Avoid spamming the console because they are often not actionable except for lib authors
ke < 3 && (c(
"You are manually calling a React.PropTypes validation function for the `" + dt + "` prop on `" + tt + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
), re[Ot] = !0, ke++);
}
}
return Ie[Ue] == null ? be ? Ie[Ue] === null ? new k("The " + ht + " `" + dt + "` is marked as required " + ("in `" + tt + "`, but its value is `null`.")) : new k("The " + ht + " `" + dt + "` is marked as required in " + ("`" + tt + "`, but its value is `undefined`.")) : null : B(Ie, Ue, tt, ht, dt);
}
var Se = De.bind(null, !1);
return Se.isRequired = De.bind(null, !0), Se;
}
function O(B) {
function re(ke, De, Se, be, Ie, Ue) {
var tt = ke[De], ht = Me(tt);
if (ht !== B) {
var dt = te(tt);
return new k(
"Invalid " + be + " `" + Ie + "` of type " + ("`" + dt + "` supplied to `" + Se + "`, expected ") + ("`" + B + "`."),
{ expectedType: B }
);
}
return null;
}
return R(re);
}
function I() {
return R(f);
}
function A(B) {
function re(ke, De, Se, be, Ie) {
if (typeof B != "function")
return new k("Property `" + Ie + "` of component `" + Se + "` has invalid PropType notation inside arrayOf.");
var Ue = ke[De];
if (!Array.isArray(Ue)) {
var tt = Me(Ue);
return new k("Invalid " + be + " `" + Ie + "` of type " + ("`" + tt + "` supplied to `" + Se + "`, expected an array."));
}
for (var ht = 0; ht < Ue.length; ht++) {
var dt = B(Ue, ht, Se, be, Ie + "[" + ht + "]", r);
if (dt instanceof Error)
return dt;
}
return null;
}
return R(re);
}
function L() {
function B(re, ke, De, Se, be) {
var Ie = re[ke];
if (!m(Ie)) {
var Ue = Me(Ie);
return new k("Invalid " + Se + " `" + be + "` of type " + ("`" + Ue + "` supplied to `" + De + "`, expected a single ReactElement."));
}
return null;
}
return R(B);
}
function H() {
function B(re, ke, De, Se, be) {
var Ie = re[ke];
if (!e.isValidElementType(Ie)) {
var Ue = Me(Ie);
return new k("Invalid " + Se + " `" + be + "` of type " + ("`" + Ue + "` supplied to `" + De + "`, expected a single ReactElement type."));
}
return null;
}
return R(B);
}
function q(B) {
function re(ke, De, Se, be, Ie) {
if (!(ke[De] instanceof B)) {
var Ue = B.name || w, tt = se(ke[De]);
return new k("Invalid " + be + " `" + Ie + "` of type " + ("`" + tt + "` supplied to `" + Se + "`, expected ") + ("instance of `" + Ue + "`."));
}
return null;
}
return R(re);
}
function U(B) {
if (!Array.isArray(B))
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? c(
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
) : c("Invalid argument supplied to oneOf, expected an array.")), f;
function re(ke, De, Se, be, Ie) {
for (var Ue = ke[De], tt = 0; tt < B.length; tt++)
if (M(Ue, B[tt]))
return null;
var ht = JSON.stringify(B, function(Le, yt) {
var Ot = te(yt);
return Ot === "symbol" ? String(yt) : yt;
});
return new k("Invalid " + be + " `" + Ie + "` of value `" + String(Ue) + "` " + ("supplied to `" + Se + "`, expected one of " + ht + "."));
}
return R(re);
}
function $(B) {
function re(ke, De, Se, be, Ie) {
if (typeof B != "function")
return new k("Property `" + Ie + "` of component `" + Se + "` has invalid PropType notation inside objectOf.");
var Ue = ke[De], tt = Me(Ue);
if (tt !== "object")
return new k("Invalid " + be + " `" + Ie + "` of type " + ("`" + tt + "` supplied to `" + Se + "`, expected an object."));
for (var ht in Ue)
if (i(Ue, ht)) {
var dt = B(Ue, ht, Se, be, Ie + "." + ht, r);
if (dt instanceof Error)
return dt;
}
return null;
}
return R(re);
}
function ae(B) {
if (!Array.isArray(B))
return process.env.NODE_ENV !== "production" && c("Invalid argument supplied to oneOfType, expected an instance of array."), f;
for (var re = 0; re < B.length; re++) {
var ke = B[re];
if (typeof ke != "function")
return c(
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + K(ke) + " at index " + re + "."
), f;
}
function De(Se, be, Ie, Ue, tt) {
for (var ht = [], dt = 0; dt < B.length; dt++) {
var Le = B[dt], yt = Le(Se, be, Ie, Ue, tt, r);
if (yt == null)
return null;
yt.data && i(yt.data, "expectedType") && ht.push(yt.data.expectedType);
}
var Ot = ht.length > 0 ? ", expected one of type [" + ht.join(", ") + "]" : "";
return new k("Invalid " + Ue + " `" + tt + "` supplied to " + ("`" + Ie + "`" + Ot + "."));
}
return R(De);
}
function oe() {
function B(re, ke, De, Se, be) {
return fe(re[ke]) ? null : new k("Invalid " + Se + " `" + be + "` supplied to " + ("`" + De + "`, expected a ReactNode."));
}
return R(B);
}
function Y(B, re, ke, De, Se) {
return new k(
(B || "React class") + ": " + re + " type `" + ke + "." + De + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + Se + "`."
);
}
function ve(B) {
function re(ke, De, Se, be, Ie) {
var Ue = ke[De], tt = Me(Ue);
if (tt !== "object")
return new k("Invalid " + be + " `" + Ie + "` of type `" + tt + "` " + ("supplied to `" + Se + "`, expected `object`."));
for (var ht in B) {
var dt = B[ht];
if (typeof dt != "function")
return Y(Se, be, Ie, ht, te(dt));
var Le = dt(Ue, ht, Se, be, Ie + "." + ht, r);
if (Le)
return Le;
}
return null;
}
return R(re);
}
function de(B) {
function re(ke, De, Se, be, Ie) {
var Ue = ke[De], tt = Me(Ue);
if (tt !== "object")
return new k("Invalid " + be + " `" + Ie + "` of type `" + tt + "` " + ("supplied to `" + Se + "`, expected `object`."));
var ht = t({}, ke[De], B);
for (var dt in ht) {
var Le = B[dt];
if (i(B, dt) && typeof Le != "function")
return Y(Se, be, Ie, dt, te(Le));
if (!Le)
return new k(
"Invalid " + be + " `" + Ie + "` key `" + dt + "` supplied to `" + Se + "`.\nBad object: " + JSON.stringify(ke[De], null, " ") + `
Valid keys: ` + JSON.stringify(Object.keys(B), null, " ")
);
var yt = Le(Ue, dt, Se, be, Ie + "." + dt, r);
if (yt)
return yt;
}
return null;
}
return R(re);
}
function fe(B) {
switch (typeof B) {
case "number":
case "string":
case "undefined":
return !0;
case "boolean":
return !B;
case "object":
if (Array.isArray(B))
return B.every(fe);
if (B === null || m(B))
return !0;
var re = E(B);
if (re) {
var ke = re.call(B), De;
if (re !== B.entries) {
for (; !(De = ke.next()).done; )
if (!fe(De.value))
return !1;
} else
for (; !(De = ke.next()).done; ) {
var Se = De.value;
if (Se && !fe(Se[1]))
return !1;
}
} else
return !1;
return !0;
default:
return !1;
}
}
function _e(B, re) {
return B === "symbol" ? !0 : re ? re["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && re instanceof Symbol : !1;
}
function Me(B) {
var re = typeof B;
return Array.isArray(B) ? "array" : B instanceof RegExp ? "object" : _e(re, B) ? "symbol" : re;
}
function te(B) {
if (typeof B > "u" || B === null)
return "" + B;
var re = Me(B);
if (re === "object") {
if (B instanceof Date)
return "date";
if (B instanceof RegExp)
return "regexp";
}
return re;
}
function K(B) {
var re = te(B);
switch (re) {
case "array":
case "object":
return "an " + re;
case "boolean":
case "date":
case "regexp":
return "a " + re;
default:
return re;
}
}
function se(B) {
return !B.constructor || !B.constructor.name ? w : B.constructor.name;
}
return D.checkPropTypes = s, D.resetWarningCache = s.resetWarningCache, D.PropTypes = D, D;
}, kx;
}
var Rx, oj;
function A4() {
if (oj)
return Rx;
oj = 1;
var e = Tb();
function t() {
}
function r() {
}
return r.resetWarningCache = t, Rx = function() {
function i(f, m, y, g, S, E) {
if (E !== e) {
var w = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
);
throw w.name = "Invariant Violation", w;
}
}
i.isRequired = i;
function s() {
return i;
}
var c = {
array: i,
bigint: i,
bool: i,
func: i,
number: i,
object: i,
string: i,
symbol: i,
any: i,
arrayOf: s,
element: i,
elementType: i,
instanceOf: s,
node: i,
objectOf: s,
oneOf: s,
oneOfType: s,
shape: s,
exact: s,
checkPropTypes: r,
resetWarningCache: t
};
return c.PropTypes = c, c;
}, Rx;
}
if (process.env.NODE_ENV !== "production") {
var z4 = p2, I4 = !0;
ej.exports = O4()(z4.isElement, I4);
} else
ej.exports = A4()();
var RS = "data-focus-lock", zD = "data-focus-lock-disabled", F4 = "data-no-focus-lock", L4 = "data-autofocus-inside", B4 = "data-no-autofocus";
function U4(e, t) {
return typeof e == "function" ? e(t) : e && (e.current = t), e;
}
function H4(e, t) {
var r = qe(function() {
return {
// value
value: e,
// last callback
callback: t,
// "memoized" public interface
facade: {
get current() {
return r.value;
},
set current(i) {
var s = r.value;
s !== i && (r.value = i, r.callback(i, s));
}
}
};
})[0];
return r.callback = t, r.facade;
}
function ID(e, t) {
return H4(t || null, function(r) {
return e.forEach(function(i) {
return U4(i, r);
});
});
}
var Px = {
width: "1px",
height: "0px",
padding: 0,
overflow: "hidden",
position: "fixed",
top: "1px",
left: "1px"
};
process.env.NODE_ENV !== "production" && St.node;
var Ho = function() {
return Ho = Object.assign || function(t) {
for (var r, i = 1, s = arguments.length; i < s; i++) {
r = arguments[i];
for (var c in r)
Object.prototype.hasOwnProperty.call(r, c) && (t[c] = r[c]);
}
return t;
}, Ho.apply(this, arguments);
};
function FD(e, t) {
var r = {};
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && t.indexOf(i) < 0 && (r[i] = e[i]);
if (e != null && typeof Object.getOwnPropertySymbols == "function")
for (var s = 0, i = Object.getOwnPropertySymbols(e); s < i.length; s++)
t.indexOf(i[s]) < 0 && Object.prototype.propertyIsEnumerable.call(e, i[s]) && (r[i[s]] = e[i[s]]);
return r;
}
function Vd(e, t, r, i) {
function s(c) {
return c instanceof r ? c : new r(function(f) {
f(c);
});
}
return new (r || (r = Promise))(function(c, f) {
function m(S) {
try {
g(i.next(S));
} catch (E) {
f(E);
}
}
function y(S) {
try {
g(i.throw(S));
} catch (E) {
f(E);
}
}
function g(S) {
S.done ? c(S.value) : s(S.value).then(m, y);
}
g((i = i.apply(e, t || [])).next());
});
}
function Wd(e, t) {
var r = { label: 0, sent: function() {
if (c[0] & 1)
throw c[1];
return c[1];
}, trys: [], ops: [] }, i, s, c, f;
return f = { next: m(0), throw: m(1), return: m(2) }, typeof Symbol == "function" && (f[Symbol.iterator] = function() {
return this;
}), f;
function m(g) {
return function(S) {
return y([g, S]);
};
}
function y(g) {
if (i)
throw new TypeError("Generator is already executing.");
for (; f && (f = 0, g[0] && (r = 0)), r; )
try {
if (i = 1, s && (c = g[0] & 2 ? s.return : g[0] ? s.throw || ((c = s.return) && c.call(s), 0) : s.next) && !(c = c.call(s, g[1])).done)
return c;
switch (s = 0, c && (g = [g[0] & 2, c.value]), g[0]) {
case 0:
case 1:
c = g;
break;
case 4:
return r.label++, { value: g[1], done: !1 };
case 5:
r.label++, s = g[1], g = [0];
continue;
case 7:
g = r.ops.pop(), r.trys.pop();
continue;
default:
if (c = r.trys, !(c = c.length > 0 && c[c.length - 1]) && (g[0] === 6 || g[0] === 2)) {
r = 0;
continue;
}
if (g[0] === 3 && (!c || g[1] > c[0] && g[1] < c[3])) {
r.label = g[1];
break;
}
if (g[0] === 6 && r.label < c[1]) {
r.label = c[1], c = g;
break;
}
if (c && r.label < c[2]) {
r.label = c[2], r.ops.push(g);
break;
}
c[2] && r.ops.pop(), r.trys.pop();
continue;
}
g = t.call(e, r);
} catch (S) {
g = [6, S], s = 0;
} finally {
i = c = 0;
}
if (g[0] & 5)
throw g[1];
return { value: g[0] ? g[1] : void 0, done: !0 };
}
}
function sj(e, t) {
var r = typeof Symbol == "function" && e[Symbol.iterator];
if (!r)
return e;
var i = r.call(e), s, c = [], f;
try {
for (; (t === void 0 || t-- > 0) && !(s = i.next()).done; )
c.push(s.value);
} catch (m) {
f = { error: m };
} finally {
try {
s && !s.done && (r = i.return) && r.call(i);
} finally {
if (f)
throw f.error;
}
}
return c;
}
function PS(e, t, r) {
if (r || arguments.length === 2)
for (var i = 0, s = t.length, c; i < s; i++)
(c || !(i in t)) && (c || (c = Array.prototype.slice.call(t, 0, i)), c[i] = t[i]);
return e.concat(c || Array.prototype.slice.call(t));
}
function LD(e) {
return e;
}
function BD(e, t) {
t === void 0 && (t = LD);
var r = [], i = !1, s = {
read: function() {
if (i)
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
return r.length ? r[r.length - 1] : e;
},
useMedium: function(c) {
var f = t(c, i);
return r.push(f), function() {
r = r.filter(function(m) {
return m !== f;
});
};
},
assignSyncMedium: function(c) {
for (i = !0; r.length; ) {
var f = r;
r = [], f.forEach(c);
}
r = {
push: function(m) {
return c(m);
},
filter: function() {
return r;
}
};
},
assignMedium: function(c) {
i = !0;
var f = [];
if (r.length) {
var m = r;
r = [], m.forEach(c), f = r;
}
var y = function() {
var S = f;
f = [], S.forEach(c);
}, g = function() {
return Promise.resolve().then(y);
};
g(), r = {
push: function(S) {
f.push(S), g();
},
filter: function(S) {
return f = f.filter(S), r;
}
};
}
};
return s;
}
function Db(e, t) {
return t === void 0 && (t = LD), BD(e, t);
}
function UD(e) {
e === void 0 && (e = {});
var t = BD(null);
return t.options = Ho({ async: !0, ssr: !1 }, e), t;
}
var HD = function(e) {
var t = e.sideCar, r = FD(e, ["sideCar"]);
if (!t)
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
var i = t.read();
if (!i)
throw new Error("Sidecar medium not found");
return Ge.createElement(i, Ho({}, r));
};
HD.isSideCarExport = !0;
function V4(e, t) {
return e.useMedium(t), HD;
}
var VD = Db({}, function(e) {
var t = e.target, r = e.currentTarget;
return {
target: t,
currentTarget: r
};
}), WD = Db(), W4 = Db(), G4 = UD({
async: !0
// focus-lock sidecar is not required on the server
// however, it might be required for JSDOM tests
// ssr: true,
}), q4 = [], _b = /* @__PURE__ */ Ge.forwardRef(function(t, r) {
var i, s = Ge.useState(), c = s[0], f = s[1], m = Ge.useRef(), y = Ge.useRef(!1), g = Ge.useRef(null), S = t.children, E = t.disabled, w = t.noFocusGuards, D = t.persistentFocus, M = t.crossFrame, k = t.autoFocus, R = t.allowTextSelection, O = t.group, I = t.className, A = t.whiteList, L = t.hasPositiveIndices, H = t.shards, q = H === void 0 ? q4 : H, U = t.as, $ = U === void 0 ? "div" : U, ae = t.lockProps, oe = ae === void 0 ? {} : ae, Y = t.sideCar, ve = t.returnFocus, de = t.focusOptions, fe = t.onActivation, _e = t.onDeactivation, Me = Ge.useState({}), te = Me[0], K = Ge.useCallback(function() {
g.current = g.current || document && document.activeElement, m.current && fe && fe(m.current), y.current = !0;
}, [fe]), se = Ge.useCallback(function() {
y.current = !1, _e && _e(m.current);
}, [_e]);
ot(function() {
E || (g.current = null);
}, []);
var B = Ge.useCallback(function(tt) {
var ht = g.current;
if (ht && ht.focus) {
var dt = typeof ve == "function" ? ve(ht) : ve;
if (dt) {
var Le = typeof dt == "object" ? dt : void 0;
g.current = null, tt ? Promise.resolve().then(function() {
return ht.focus(Le);
}) : ht.focus(Le);
}
}
}, [ve]), re = Ge.useCallback(function(tt) {
y.current && VD.useMedium(tt);
}, []), ke = WD.useMedium, De = Ge.useCallback(function(tt) {
m.current !== tt && (m.current = tt, f(tt));
}, []);
process.env.NODE_ENV !== "production" && (typeof R < "u" && console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"), Ge.useEffect(function() {
!m.current && typeof $ != "string" && console.error("FocusLock: could not obtain ref to internal node");
}, []));
var Se = dS((i = {}, i[zD] = E && "disabled", i[RS] = O, i), oe), be = w !== !0, Ie = be && w !== "tail", Ue = ID([r, De]);
return /* @__PURE__ */ Ge.createElement(Ge.Fragment, null, be && [
// nearest focus guard
/* @__PURE__ */ Ge.createElement("div", {
key: "guard-first",
"data-focus-guard": !0,
tabIndex: E ? -1 : 0,
style: Px
}),
// first tabbed element guard
L ? /* @__PURE__ */ Ge.createElement("div", {
key: "guard-nearest",
"data-focus-guard": !0,
tabIndex: E ? -1 : 1,
style: Px
}) : null
], !E && /* @__PURE__ */ Ge.createElement(Y, {
id: te,
sideCar: G4,
observed: c,
disabled: E,
persistentFocus: D,
crossFrame: M,
autoFocus: k,
whiteList: A,
shards: q,
onActivation: K,
onDeactivation: se,
returnFocus: B,
focusOptions: de
}), /* @__PURE__ */ Ge.createElement($, dS({
ref: Ue
}, Se, {
className: I,
onBlur: ke,
onFocus: re
}), S), Ie && /* @__PURE__ */ Ge.createElement("div", {
"data-focus-guard": !0,
tabIndex: E ? -1 : 0,
style: Px
}));
});
_b.propTypes = process.env.NODE_ENV !== "production" ? {
children: St.node,
disabled: St.bool,
returnFocus: St.oneOfType([St.bool, St.object, St.func]),
focusOptions: St.object,
noFocusGuards: St.bool,
hasPositiveIndices: St.bool,
allowTextSelection: St.bool,
autoFocus: St.bool,
persistentFocus: St.bool,
crossFrame: St.bool,
group: St.string,
className: St.string,
whiteList: St.func,
shards: St.arrayOf(St.any),
as: St.oneOfType([St.string, St.func, St.object]),
lockProps: St.object,
onActivation: St.func,
onDeactivation: St.func,
sideCar: St.any.isRequired
} : {};
_b.defaultProps = {
children: void 0,
disabled: !1,
returnFocus: !1,
focusOptions: void 0,
noFocusGuards: !1,
autoFocus: !0,
persistentFocus: !1,
crossFrame: !0,
hasPositiveIndices: void 0,
allowTextSelection: void 0,
group: void 0,
className: void 0,
whiteList: void 0,
shards: void 0,
as: "div",
lockProps: {},
onActivation: void 0,
onDeactivation: void 0
};
const GD = _b;
function Y4(e, t) {
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, kO(e, t);
}
function K4(e, t) {
if (process.env.NODE_ENV !== "production") {
if (typeof e != "function")
throw new Error("Expected reducePropsToState to be a function.");
if (typeof t != "function")
throw new Error("Expected handleStateChangeOnClient to be a function.");
}
function r(i) {
return i.displayName || i.name || "Component";
}
return function(s) {
if (process.env.NODE_ENV !== "production" && typeof s != "function")
throw new Error("Expected WrappedComponent to be a React component.");
var c = [], f;
function m() {
f = e(c.map(function(g) {
return g.props;
})), t(f);
}
var y = /* @__PURE__ */ function(g) {
Y4(S, g);
function S() {
return g.apply(this, arguments) || this;
}
S.peek = function() {
return f;
};
var E = S.prototype;
return E.componentDidMount = function() {
c.push(this), m();
}, E.componentDidUpdate = function() {
m();
}, E.componentWillUnmount = function() {
var D = c.indexOf(this);
c.splice(D, 1), m();
}, E.render = function() {
return /* @__PURE__ */ jt.createElement(s, this.props);
}, S;
}(rI);
return RO(y, "displayName", "SideEffect(" + r(s) + ")"), y;
};
}
var Xo = function(e) {
for (var t = Array(e.length), r = 0; r < e.length; ++r)
t[r] = e[r];
return t;
}, Jm = function(e) {
return Array.isArray(e) ? e : [e];
}, qD = function(e) {
return Array.isArray(e) ? e[0] : e;
}, X4 = function(e) {
if (e.nodeType !== Node.ELEMENT_NODE)
return !1;
var t = window.getComputedStyle(e, null);
return !t || !t.getPropertyValue ? !1 : t.getPropertyValue("display") === "none" || t.getPropertyValue("visibility") === "hidden";
}, YD = function(e) {
return e.parentNode && e.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
e.parentNode.host
) : e.parentNode;
}, KD = function(e) {
return e === document || e && e.nodeType === Node.DOCUMENT_NODE;
}, $4 = function(e, t) {
return !e || KD(e) || !X4(e) && t(YD(e));
}, XD = function(e, t) {
var r = e.get(t);
if (r !== void 0)
return r;
var i = $4(t, XD.bind(void 0, e));
return e.set(t, i), i;
}, Q4 = function(e, t) {
return e && !KD(e) ? e5(e) ? t(YD(e)) : !1 : !0;
}, $D = function(e, t) {
var r = e.get(t);
if (r !== void 0)
return r;
var i = Q4(t, $D.bind(void 0, e));
return e.set(t, i), i;
}, QD = function(e) {
return e.dataset;
}, Z4 = function(e) {
return e.tagName === "BUTTON";
}, ZD = function(e) {
return e.tagName === "INPUT";
}, JD = function(e) {
return ZD(e) && e.type === "radio";
}, J4 = function(e) {
return !((ZD(e) || Z4(e)) && (e.type === "hidden" || e.disabled));
}, e5 = function(e) {
var t = e.getAttribute(B4);
return ![!0, "true", ""].includes(t);
}, Mb = function(e) {
var t;
return Boolean(e && ((t = QD(e)) === null || t === void 0 ? void 0 : t.focusGuard));
}, eg = function(e) {
return !Mb(e);
}, t5 = function(e) {
return Boolean(e);
}, n5 = function(e, t) {
var r = e.tabIndex - t.tabIndex, i = e.index - t.index;
if (r) {
if (!e.tabIndex)
return 1;
if (!t.tabIndex)
return -1;
}
return r || i;
}, e_ = function(e, t, r) {
return Xo(e).map(function(i, s) {
return {
node: i,
index: s,
tabIndex: r && i.tabIndex === -1 ? (i.dataset || {}).focusGuard ? 0 : -1 : i.tabIndex
};
}).filter(function(i) {
return !t || i.tabIndex >= 0;
}).sort(n5);
}, r5 = [
"button:enabled",
"select:enabled",
"textarea:enabled",
"input:enabled",
// elements with explicit roles will also use explicit tabindex
// '[role="button"]',
"a[href]",
"area[href]",
"summary",
"iframe",
"object",
"embed",
"audio[controls]",
"video[controls]",
"[tabindex]",
"[contenteditable]",
"[autofocus]"
], kb = r5.join(","), a5 = "".concat(kb, ", [data-focus-guard]"), t_ = function(e, t) {
return Xo((e.shadowRoot || e).children).reduce(function(r, i) {
return r.concat(i.matches(t ? a5 : kb) ? [i] : [], t_(i));
}, []);
}, i5 = function(e, t) {
var r;
return e instanceof HTMLIFrameElement && (!((r = e.contentDocument) === null || r === void 0) && r.body) ? Cg([e.contentDocument.body], t) : [e];
}, Cg = function(e, t) {
return e.reduce(function(r, i) {
var s, c = t_(i, t), f = (s = []).concat.apply(s, c.map(function(m) {
return i5(m, t);
}));
return r.concat(
// add all tabbables inside and within shadow DOMs in DOM order
f,
// add if node is tabbable itself
i.parentNode ? Xo(i.parentNode.querySelectorAll(kb)).filter(function(m) {
return m === i;
}) : []
);
}, []);
}, o5 = function(e) {
var t = e.querySelectorAll("[".concat(L4, "]"));
return Xo(t).map(function(r) {
return Cg([r]);
}).reduce(function(r, i) {
return r.concat(i);
}, []);
}, Rb = function(e, t) {
return Xo(e).filter(function(r) {
return XD(t, r);
}).filter(function(r) {
return J4(r);
});
}, lj = function(e, t) {
return t === void 0 && (t = /* @__PURE__ */ new Map()), Xo(e).filter(function(r) {
return $D(t, r);
});
}, NS = function(e, t, r) {
return e_(Rb(Cg(e, r), t), !0, r);
}, uj = function(e, t) {
return e_(Rb(Cg(e), t), !1);
}, s5 = function(e, t) {
return Rb(o5(e), t);
}, Nd = function(e, t) {
return e.shadowRoot ? Nd(e.shadowRoot, t) : Object.getPrototypeOf(e).contains !== void 0 && Object.getPrototypeOf(e).contains.call(e, t) ? !0 : Xo(e.children).some(function(r) {
var i;
if (r instanceof HTMLIFrameElement) {
var s = (i = r.contentDocument) === null || i === void 0 ? void 0 : i.body;
return s ? Nd(s, t) : !1;
}
return Nd(r, t);
});
}, l5 = function(e) {
for (var t = /* @__PURE__ */ new Set(), r = e.length, i = 0; i < r; i += 1)
for (var s = i + 1; s < r; s += 1) {
var c = e[i].compareDocumentPosition(e[s]);
(c & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0 && t.add(s), (c & Node.DOCUMENT_POSITION_CONTAINS) > 0 && t.add(i);
}
return e.filter(function(f, m) {
return !t.has(m);
});
}, n_ = function(e) {
return e.parentNode ? n_(e.parentNode) : e;
}, Pb = function(e) {
var t = Jm(e);
return t.filter(Boolean).reduce(function(r, i) {
var s = i.getAttribute(RS);
return r.push.apply(r, s ? l5(Xo(n_(i).querySelectorAll("[".concat(RS, '="').concat(s, '"]:not([').concat(zD, '="disabled"])')))) : [i]), r;
}, []);
}, u5 = function(e) {
try {
return e();
} catch {
return;
}
}, Bp = function(e) {
if (e === void 0 && (e = document), !(!e || !e.activeElement)) {
var t = e.activeElement;
return t.shadowRoot ? Bp(t.shadowRoot) : t instanceof HTMLIFrameElement && u5(function() {
return t.contentWindow.document;
}) ? Bp(t.contentWindow.document) : t;
}
}, c5 = function(e, t) {
return e === t;
}, d5 = function(e, t) {
return Boolean(Xo(e.querySelectorAll("iframe")).some(function(r) {
return c5(r, t);
}));
}, r_ = function(e, t) {
return t === void 0 && (t = Bp(qD(e).ownerDocument)), !t || t.dataset && t.dataset.focusGuard ? !1 : Pb(e).some(function(r) {
return Nd(r, t) || d5(r, t);
});
}, f5 = function(e) {
e === void 0 && (e = document);
var t = Bp(e);
return t ? Xo(e.querySelectorAll("[".concat(F4, "]"))).some(function(r) {
return Nd(r, t);
}) : !1;
}, p5 = function(e, t) {
return t.filter(JD).filter(function(r) {
return r.name === e.name;
}).filter(function(r) {
return r.checked;
})[0] || e;
}, Nb = function(e, t) {
return JD(e) && e.name ? p5(e, t) : e;
}, h5 = function(e) {
var t = /* @__PURE__ */ new Set();
return e.forEach(function(r) {
return t.add(Nb(r, e));
}), e.filter(function(r) {
return t.has(r);
});
}, cj = function(e) {
return e[0] && e.length > 1 ? Nb(e[0], e) : e[0];
}, dj = function(e, t) {
return e.length > 1 ? e.indexOf(Nb(e[t], e)) : t;
}, a_ = "NEW_FOCUS", v5 = function(e, t, r, i) {
var s = e.length, c = e[0], f = e[s - 1], m = Mb(r);
if (!(r && e.indexOf(r) >= 0)) {
var y = r !== void 0 ? t.indexOf(r) : -1, g = i ? t.indexOf(i) : y, S = i ? e.indexOf(i) : -1, E = y - g, w = t.indexOf(c), D = t.indexOf(f), M = h5(t), k = r !== void 0 ? M.indexOf(r) : -1, R = k - (i ? M.indexOf(i) : y), O = dj(e, 0), I = dj(e, s - 1);
if (y === -1 || S === -1)
return a_;
if (!E && S >= 0)
return S;
if (y <= w && m && Math.abs(E) > 1)
return I;
if (y >= D && m && Math.abs(E) > 1)
return O;
if (E && Math.abs(R) > 1)
return S;
if (y <= w)
return I;
if (y > D)
return O;
if (E)
return Math.abs(E) > 1 ? S : (s + S + E) % s;
}
}, m5 = function(e) {
return function(t) {
var r, i = (r = QD(t)) === null || r === void 0 ? void 0 : r.autofocus;
return (
// @ts-expect-error
t.autofocus || //
i !== void 0 && i !== "false" || //
e.indexOf(t) >= 0
);
};
}, g5 = function(e, t, r) {
var i = e.map(function(c) {
var f = c.node;
return f;
}), s = lj(i.filter(m5(r)));
return s && s.length ? cj(s) : cj(lj(t));
}, OS = function(e, t) {
return t === void 0 && (t = []), t.push(e), e.parentNode && OS(e.parentNode.host || e.parentNode, t), t;
}, Nx = function(e, t) {
for (var r = OS(e), i = OS(t), s = 0; s < r.length; s += 1) {
var c = r[s];
if (i.indexOf(c) >= 0)
return c;
}
return !1;
}, i_ = function(e, t, r) {
var i = Jm(e), s = Jm(t), c = i[0], f = !1;
return s.filter(Boolean).forEach(function(m) {
f = Nx(f || m, m) || f, r.filter(Boolean).forEach(function(y) {
var g = Nx(c, y);
g && (!f || Nd(g, f) ? f = g : f = Nx(g, f));
});
}), f;
}, y5 = function(e, t) {
return e.reduce(function(r, i) {
return r.concat(s5(i, t));
}, []);
}, x5 = function(e, t) {
var r = /* @__PURE__ */ new Map();
return t.forEach(function(i) {
return r.set(i.node, i);
}), e.map(function(i) {
return r.get(i);
}).filter(t5);
}, S5 = function(e, t) {
var r = Bp(Jm(e).length > 0 ? document : qD(e).ownerDocument), i = Pb(e).filter(eg), s = i_(r || e, e, i), c = /* @__PURE__ */ new Map(), f = uj(i, c), m = NS(i, c).filter(function(D) {
var M = D.node;
return eg(M);
});
if (!(!m[0] && (m = f, !m[0]))) {
var y = uj([s], c).map(function(D) {
var M = D.node;
return M;
}), g = x5(y, m), S = g.map(function(D) {
var M = D.node;
return M;
}), E = v5(S, y, r, t);
if (E === a_) {
var w = g5(f, S, y5(i, c));
if (w)
return { node: w };
console.warn("focus-lock: cannot find any node to move focus into");
return;
}
return E === void 0 ? E : g[E];
}
}, b5 = function(e) {
var t = Pb(e).filter(eg), r = i_(e, e, t), i = /* @__PURE__ */ new Map(), s = NS([r], i, !0), c = NS(t, i).filter(function(f) {
var m = f.node;
return eg(m);
}).map(function(f) {
var m = f.node;
return m;
});
return s.map(function(f) {
var m = f.node, y = f.index;
return {
node: m,
index: y,
lockItem: c.indexOf(m) >= 0,
guard: Mb(m)
};
});
}, C5 = function(e, t) {
"focus" in e && e.focus(t), "contentWindow" in e && e.contentWindow && e.contentWindow.focus();
}, Ox = 0, Ax = !1, o_ = function(e, t, r) {
r === void 0 && (r = {});
var i = S5(e, t);
if (!Ax && i) {
if (Ox > 2) {
console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"), Ax = !0, setTimeout(function() {
Ax = !1;
}, 1);
return;
}
Ox++, C5(i.node, r.focusOptions), Ox--;
}
};
function s_(e) {
var t = window, r = t.setImmediate;
typeof r < "u" ? r(e) : setTimeout(e, 1);
}
var E5 = function() {
return document && document.activeElement === document.body;
}, w5 = function() {
return E5() || f5();
}, Od = null, _d = null, Ad = null, Up = !1, j5 = function() {
return !0;
}, T5 = function(t) {
return (Od.whiteList || j5)(t);
}, D5 = function(t, r) {
Ad = {
observerNode: t,
portaledElement: r
};
}, _5 = function(t) {
return Ad && Ad.portaledElement === t;
};
function fj(e, t, r, i) {
var s = null, c = e;
do {
var f = i[c];
if (f.guard)
f.node.dataset.focusAutoGuard && (s = f);
else if (f.lockItem) {
if (c !== e)
return;
s = null;
} else
break;
} while ((c += r) !== t);
s && (s.node.tabIndex = 0);
}
var M5 = function(t) {
return t && "current" in t ? t.current : t;
}, k5 = function(t) {
return t ? Boolean(Up) : Up === "meanwhile";
}, R5 = function e(t, r, i) {
return r && // find host equal to active element and check nested active element
(r.host === t && (!r.activeElement || i.contains(r.activeElement)) || r.parentNode && e(t, r.parentNode, i));
}, P5 = function(t, r) {
return r.some(function(i) {
return R5(t, i, i);
});
}, tg = function() {
var t = !1;
if (Od) {
var r = Od, i = r.observed, s = r.persistentFocus, c = r.autoFocus, f = r.shards, m = r.crossFrame, y = r.focusOptions, g = i || Ad && Ad.portaledElement, S = document && document.activeElement;
if (g) {
var E = [g].concat(f.map(M5).filter(Boolean));
if ((!S || T5(S)) && (s || k5(m) || !w5() || !_d && c) && (g && !// active element is "inside" working area
(r_(E) || // check for shadow-dom contained elements
S && P5(S, E) || _5(S)) && (document && !_d && S && !c ? (S.blur && S.blur(), document.body.focus()) : (t = o_(E, _d, {
focusOptions: y
}), Ad = {})), Up = !1, _d = document && document.activeElement), document) {
var w = document && document.activeElement, D = b5(E), M = D.map(function(k) {
var R = k.node;
return R;
}).indexOf(w);
M > -1 && (D.filter(function(k) {
var R = k.guard, O = k.node;
return R && O.dataset.focusAutoGuard;
}).forEach(function(k) {
var R = k.node;
return R.removeAttribute("tabIndex");
}), fj(M, D.length, 1, D), fj(M, -1, -1, D));
}
}
}
return t;
}, l_ = function(t) {
tg() && t && (t.stopPropagation(), t.preventDefault());
}, Ob = function() {
return s_(tg);
}, N5 = function(t) {
var r = t.target, i = t.currentTarget;
i.contains(r) || D5(i, r);
}, O5 = function() {
return null;
};
process.env.NODE_ENV !== "production" && St.node.isRequired;
var u_ = function() {
Up = "just", setTimeout(function() {
Up = "meanwhile";
}, 0);
}, A5 = function() {
document.addEventListener("focusin", l_), document.addEventListener("focusout", Ob), window.addEventListener("blur", u_);
}, z5 = function() {
document.removeEventListener("focusin", l_), document.removeEventListener("focusout", Ob), window.removeEventListener("blur", u_);
};
function I5(e) {
return e.filter(function(t) {
var r = t.disabled;
return !r;
});
}
function F5(e) {
var t = e.slice(-1)[0];
t && !Od && A5();
var r = Od, i = r && t && t.id === r.id;
Od = t, r && !i && (r.onDeactivation(), e.filter(function(s) {
var c = s.id;
return c === r.id;
}).length || r.returnFocus(!t)), t ? (_d = null, (!i || r.observed !== t.observed) && t.onActivation(), tg(), s_(tg)) : (z5(), _d = null);
}
VD.assignSyncMedium(N5);
WD.assignMedium(Ob);
W4.assignMedium(function(e) {
return e({
moveFocusInside: o_,
focusInside: r_
});
});
const L5 = K4(I5, F5)(O5);
var c_ = /* @__PURE__ */ Ge.forwardRef(function(t, r) {
return /* @__PURE__ */ Ge.createElement(GD, dS({
sideCar: L5,
ref: r
}, t));
}), d_ = GD.propTypes || {};
d_.sideCar;
var B5 = dI(d_, ["sideCar"]);
c_.propTypes = process.env.NODE_ENV !== "production" ? B5 : {};
const pj = c_;
var hj, U5 = (hj = pj.default) != null ? hj : pj, f_ = (e) => {
const {
initialFocusRef: t,
finalFocusRef: r,
contentRef: i,
restoreFocus: s,
children: c,
isDisabled: f,
autoFocus: m,
persistentFocus: y,
lockFocusAcrossFrames: g
} = e, S = ee(() => {
t != null && t.current ? t.current.focus() : i != null && i.current && PO(i.current).length === 0 && requestAnimationFrame(() => {
var M;
(M = i.current) == null || M.focus();
});
}, [t, i]), E = ee(() => {
var D;
(D = r == null ? void 0 : r.current) == null || D.focus();
}, [r]), w = s && !r;
return /* @__PURE__ */ u.jsx(
U5,
{
crossFrame: g,
persistentFocus: y,
autoFocus: m,
disabled: f,
onActivation: S,
onDeactivation: E,
returnFocus: w,
children: c
}
);
};
f_.displayName = "FocusLock";
var H5 = bI ? co : ot;
function ng(e, t = []) {
const r = Xe(e);
return H5(() => {
r.current = e;
}), ee((...i) => {
var s;
return (s = r.current) == null ? void 0 : s.call(r, ...i);
}, t);
}
function V5(e, t, r, i) {
const s = ng(t);
return ot(() => {
var c;
const f = (c = bw(r)) != null ? c : document;
if (t)
return f.addEventListener(e, s, i), () => {
f.removeEventListener(e, s, i);
};
}, [e, r, i, s, t]), () => {
var c;
((c = bw(r)) != null ? c : document).removeEventListener(e, s, i);
};
}
function W5(e) {
const { ref: t, handler: r, enabled: i = !0 } = e, s = ng(r), f = Xe({
isPointerDown: !1,
ignoreEmulatedMouseEvents: !1
}).current;
ot(() => {
if (!i)
return;
const m = (E) => {
zx(E, t) && (f.isPointerDown = !0);
}, y = (E) => {
if (f.ignoreEmulatedMouseEvents) {
f.ignoreEmulatedMouseEvents = !1;
return;
}
f.isPointerDown && r && zx(E, t) && (f.isPointerDown = !1, s(E));
}, g = (E) => {
f.ignoreEmulatedMouseEvents = !0, r && f.isPointerDown && zx(E, t) && (f.isPointerDown = !1, s(E));
}, S = xD(t.current);
return S.addEventListener("mousedown", m, !0), S.addEventListener("mouseup", y, !0), S.addEventListener("touchstart", m, !0), S.addEventListener("touchend", g, !0), () => {
S.removeEventListener("mousedown", m, !0), S.removeEventListener("mouseup", y, !0), S.removeEventListener("touchstart", m, !0), S.removeEventListener("touchend", g, !0);
};
}, [r, t, s, f, i]);
}
function zx(e, t) {
var r;
const i = e.target;
return e.button > 0 || i && !xD(i).contains(i) ? !1 : !((r = t.current) != null && r.contains(i));
}
function G5(e, t) {
const r = Ko();
return Xt(
() => e || [t, r].filter(Boolean).join("-"),
[e, t, r]
);
}
function q5(e, t) {
const r = e !== void 0;
return [r, r && typeof e < "u" ? e : t];
}
function Ol(e = {}) {
const {
onClose: t,
onOpen: r,
isOpen: i,
id: s
} = e, c = ng(r), f = ng(t), [m, y] = qe(e.defaultIsOpen || !1), [g, S] = q5(i, m), E = G5(s, "disclosure"), w = ee(() => {
g || y(!1), f == null || f();
}, [g, f]), D = ee(() => {
g || y(!0), c == null || c();
}, [g, c]), M = ee(() => {
(S ? w : D)();
}, [S, D, w]);
return {
isOpen: !!S,
onOpen: D,
onClose: w,
onToggle: M,
isControlled: g,
getButtonProps: (k = {}) => ({
...k,
"aria-expanded": S,
"aria-controls": E,
onClick: NO(k.onClick, M)
}),
getDisclosureProps: (k = {}) => ({
...k,
hidden: !S,
id: E
})
};
}
var Ab = lt(function(t, r) {
const { htmlSize: i, ...s } = t, c = Ha("Input", s), f = Tr(s), m = bb(f), y = It("chakra-input", t.className);
return /* @__PURE__ */ u.jsx(
$e.input,
{
size: i,
...m,
__css: c.field,
ref: r,
className: y
}
);
});
Ab.displayName = "Input";
Ab.id = "Input";
var [Y5, p_] = ur({
name: "ListStylesContext",
errorMessage: `useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "
" `
}), zb = lt(function(t, r) {
const i = Ha("List", t), {
children: s,
styleType: c = "none",
stylePosition: f,
spacing: m,
...y
} = Tr(t), g = h2(s), E = m ? { ["& > *:not(style) ~ *:not(style)"]: { mt: m } } : {};
return /* @__PURE__ */ u.jsx(Y5, { value: i, children: /* @__PURE__ */ u.jsx(
$e.ul,
{
ref: r,
listStyleType: c,
listStylePosition: f,
role: "list",
__css: { ...i.container, ...E },
...y,
children: g
}
) });
});
zb.displayName = "List";
var K5 = lt((e, t) => {
const { as: r, ...i } = e;
return /* @__PURE__ */ u.jsx(zb, { ref: t, as: "ol", styleType: "decimal", marginStart: "1em", ...i });
});
K5.displayName = "OrderedList";
var h_ = lt(function(t, r) {
const { as: i, ...s } = t;
return /* @__PURE__ */ u.jsx(zb, { ref: r, as: "ul", styleType: "initial", marginStart: "1em", ...s });
});
h_.displayName = "UnorderedList";
var Pp = lt(function(t, r) {
const i = p_();
return /* @__PURE__ */ u.jsx($e.li, { ref: r, ...t, __css: i.item });
});
Pp.displayName = "ListItem";
var X5 = lt(function(t, r) {
const i = p_();
return /* @__PURE__ */ u.jsx(ia, { ref: r, role: "presentation", ...t, __css: i.icon });
});
X5.displayName = "ListIcon";
var uo = lt(function(t, r) {
const {
templateAreas: i,
gap: s,
rowGap: c,
columnGap: f,
column: m,
row: y,
autoFlow: g,
autoRows: S,
templateRows: E,
autoColumns: w,
templateColumns: D,
...M
} = t, k = {
display: "grid",
gridTemplateAreas: i,
gridGap: s,
gridRowGap: c,
gridColumnGap: f,
gridAutoColumns: w,
gridColumn: m,
gridRow: y,
gridAutoFlow: g,
gridAutoRows: S,
gridTemplateRows: E,
gridTemplateColumns: D
};
return /* @__PURE__ */ u.jsx($e.div, { ref: r, __css: k, ...M });
});
uo.displayName = "Grid";
var Eg = $e("div", {
baseStyle: {
flex: 1,
justifySelf: "stretch",
alignSelf: "stretch"
}
});
Eg.displayName = "Spacer";
var Gd = lt((e, t) => /* @__PURE__ */ u.jsx(OO, { align: "center", ...e, direction: "row", ref: t }));
Gd.displayName = "HStack";
var Ni = lt(function(t, r) {
const i = Hd("Heading", t), { className: s, ...c } = Tr(t);
return /* @__PURE__ */ u.jsx(
$e.h2,
{
ref: r,
className: It("chakra-heading", t.className),
...c,
__css: i
}
);
});
Ni.displayName = "Heading";
var Ut = $e("div");
Ut.displayName = "Box";
var v_ = lt(function(t, r) {
const { size: i, centerContent: s = !0, ...c } = t, f = s ? { display: "flex", alignItems: "center", justifyContent: "center" } : {};
return /* @__PURE__ */ u.jsx(
Ut,
{
ref: r,
boxSize: i,
__css: {
...f,
flexShrink: 0,
flexGrow: 0
},
...c
}
);
});
v_.displayName = "Square";
var $5 = lt(function(t, r) {
const { size: i, ...s } = t;
return /* @__PURE__ */ u.jsx(v_, { size: i, ref: r, borderRadius: "9999px", ...s });
});
$5.displayName = "Circle";
var Fu = lt(function(t, r) {
const i = Hd("Link", t), { className: s, isExternal: c, ...f } = Tr(t);
return /* @__PURE__ */ u.jsx(
$e.a,
{
target: c ? "_blank" : void 0,
rel: c ? "noopener" : void 0,
ref: r,
className: It("chakra-link", s),
...f,
__css: i
}
);
});
Fu.displayName = "Link";
var m_ = lt(function(t, r) {
const i = Hd("Badge", t), { className: s, ...c } = Tr(t);
return /* @__PURE__ */ u.jsx(
$e.span,
{
ref: r,
className: It("chakra-badge", t.className),
...c,
__css: {
display: "inline-block",
whiteSpace: "nowrap",
verticalAlign: "middle",
...i
}
}
);
});
m_.displayName = "Badge";
var g_ = $e("div", {
baseStyle: {
display: "flex",
alignItems: "center",
justifyContent: "center"
}
});
g_.displayName = "Center";
var Q5 = {
horizontal: {
insetStart: "50%",
transform: "translateX(-50%)"
},
vertical: {
top: "50%",
transform: "translateY(-50%)"
},
both: {
insetStart: "50%",
top: "50%",
transform: "translate(-50%, -50%)"
}
};
lt(
function(t, r) {
const { axis: i = "both", ...s } = t;
return /* @__PURE__ */ u.jsx(
$e.div,
{
ref: r,
__css: Q5[i],
...s,
position: "absolute"
}
);
}
);
var y_ = lt(function(t, r) {
const {
borderLeftWidth: i,
borderBottomWidth: s,
borderTopWidth: c,
borderRightWidth: f,
borderWidth: m,
borderStyle: y,
borderColor: g,
...S
} = Hd("Divider", t), {
className: E,
orientation: w = "horizontal",
__css: D,
...M
} = Tr(t), k = {
vertical: {
borderLeftWidth: i || f || m || "1px",
height: "100%"
},
horizontal: {
borderBottomWidth: s || c || m || "1px",
width: "100%"
}
};
return /* @__PURE__ */ u.jsx(
$e.hr,
{
ref: r,
"aria-orientation": w,
...M,
__css: {
...S,
border: "0",
borderColor: g,
borderStyle: y,
...k[w],
...D
},
className: It("chakra-divider", E)
}
);
});
y_.displayName = "Divider";
function Z5(e) {
const { key: t } = e;
return t.length === 1 || t.length > 1 && /[^a-zA-Z0-9]/.test(t);
}
function J5(e = {}) {
const { timeout: t = 300, preventDefault: r = () => !0 } = e, [i, s] = qe([]), c = Xe(), f = () => {
c.current && (clearTimeout(c.current), c.current = null);
}, m = () => {
f(), c.current = setTimeout(() => {
s([]), c.current = null;
}, t);
};
ot(() => f, []);
function y(g) {
return (S) => {
if (S.key === "Backspace") {
const E = [...i];
E.pop(), s(E);
return;
}
if (Z5(S)) {
const E = i.concat(S.key);
r(S) && (S.preventDefault(), S.stopPropagation()), s(E), g(E.join("")), m();
}
};
}
return y;
}
function eF(e, t, r, i) {
if (t == null)
return i;
if (!i)
return e.find(
(f) => r(f).toLowerCase().startsWith(t.toLowerCase())
);
const s = e.filter(
(c) => r(c).toLowerCase().startsWith(t.toLowerCase())
);
if (s.length > 0) {
let c;
return s.includes(i) ? (c = s.indexOf(i) + 1, c === s.length && (c = 0), s[c]) : (c = e.indexOf(s[0]), e[c]);
}
return i;
}
function tF() {
const e = Xe(/* @__PURE__ */ new Map()), t = e.current, r = ee((s, c, f, m) => {
e.current.set(f, { type: c, el: s, options: m }), s.addEventListener(c, f, m);
}, []), i = ee(
(s, c, f, m) => {
s.removeEventListener(c, f, m), e.current.delete(f);
},
[]
);
return ot(
() => () => {
t.forEach((s, c) => {
i(s.el, s.type, c, s.options);
});
},
[i, t]
), { add: r, remove: i };
}
function Ix(e) {
const t = e.target, { tagName: r, isContentEditable: i } = t;
return r !== "INPUT" && r !== "TEXTAREA" && i !== !0;
}
function x_(e = {}) {
const {
ref: t,
isDisabled: r,
isFocusable: i,
clickOnEnter: s = !0,
clickOnSpace: c = !0,
onMouseDown: f,
onMouseUp: m,
onClick: y,
onKeyDown: g,
onKeyUp: S,
tabIndex: E,
onMouseOver: w,
onMouseLeave: D,
...M
} = e, [k, R] = qe(!0), [O, I] = qe(!1), A = tF(), L = (te) => {
te && te.tagName !== "BUTTON" && R(!1);
}, H = k ? E : E || 0, q = r && !i, U = ee(
(te) => {
if (r) {
te.stopPropagation(), te.preventDefault();
return;
}
te.currentTarget.focus(), y == null || y(te);
},
[r, y]
), $ = ee(
(te) => {
O && Ix(te) && (te.preventDefault(), te.stopPropagation(), I(!1), A.remove(document, "keyup", $, !1));
},
[O, A]
), ae = ee(
(te) => {
if (g == null || g(te), r || te.defaultPrevented || te.metaKey || !Ix(te.nativeEvent) || k)
return;
const K = s && te.key === "Enter";
c && te.key === " " && (te.preventDefault(), I(!0)), K && (te.preventDefault(), te.currentTarget.click()), A.add(document, "keyup", $, !1);
},
[
r,
k,
g,
s,
c,
A,
$
]
), oe = ee(
(te) => {
if (S == null || S(te), r || te.defaultPrevented || te.metaKey || !Ix(te.nativeEvent) || k)
return;
c && te.key === " " && (te.preventDefault(), I(!1), te.currentTarget.click());
},
[c, k, r, S]
), Y = ee(
(te) => {
te.button === 0 && (I(!1), A.remove(document, "mouseup", Y, !1));
},
[A]
), ve = ee(
(te) => {
if (te.button !== 0)
return;
if (r) {
te.stopPropagation(), te.preventDefault();
return;
}
k || I(!0), te.currentTarget.focus({ preventScroll: !0 }), A.add(document, "mouseup", Y, !1), f == null || f(te);
},
[r, k, f, A, Y]
), de = ee(
(te) => {
te.button === 0 && (k || I(!1), m == null || m(te));
},
[m, k]
), fe = ee(
(te) => {
if (r) {
te.preventDefault();
return;
}
w == null || w(te);
},
[r, w]
), _e = ee(
(te) => {
O && (te.preventDefault(), I(!1)), D == null || D(te);
},
[O, D]
), Me = jr(t, L);
return k ? {
...M,
ref: Me,
type: "button",
"aria-disabled": q ? void 0 : r,
disabled: q,
onClick: U,
onMouseDown: f,
onMouseUp: m,
onKeyUp: S,
onKeyDown: g,
onMouseOver: w,
onMouseLeave: D
} : {
...M,
ref: Me,
role: "button",
"data-active": Kt(O),
"aria-disabled": r ? "true" : void 0,
tabIndex: q ? void 0 : H,
onClick: U,
onMouseDown: ve,
onMouseUp: de,
onKeyUp: oe,
onKeyDown: ae,
onMouseOver: fe,
onMouseLeave: _e
};
}
function nF(e) {
const { ref: t, handler: r, enabled: i = !0 } = e, s = oa(r), f = Xe({
isPointerDown: !1,
ignoreEmulatedMouseEvents: !1
}).current;
ot(() => {
if (!i)
return;
const m = (E) => {
Fx(E, t) && (f.isPointerDown = !0);
}, y = (E) => {
if (f.ignoreEmulatedMouseEvents) {
f.ignoreEmulatedMouseEvents = !1;
return;
}
f.isPointerDown && r && Fx(E, t) && (f.isPointerDown = !1, s(E));
}, g = (E) => {
f.ignoreEmulatedMouseEvents = !0, r && f.isPointerDown && Fx(E, t) && (f.isPointerDown = !1, s(E));
}, S = S_(t.current);
return S.addEventListener("mousedown", m, !0), S.addEventListener("mouseup", y, !0), S.addEventListener("touchstart", m, !0), S.addEventListener("touchend", g, !0), () => {
S.removeEventListener("mousedown", m, !0), S.removeEventListener("mouseup", y, !0), S.removeEventListener("touchstart", m, !0), S.removeEventListener("touchend", g, !0);
};
}, [r, t, s, f, i]);
}
function Fx(e, t) {
var r;
const i = e.target;
return e.button > 0 || i && !S_(i).contains(i) ? !1 : !((r = t.current) != null && r.contains(i));
}
function S_(e) {
var t;
return (t = e == null ? void 0 : e.ownerDocument) != null ? t : document;
}
var [
rF,
aF,
iF,
oF
] = mb(), [sF, ah] = ur({
strict: !1,
name: "MenuContext"
});
function lF(e, ...t) {
const r = Ko(), i = e || r;
return Xt(() => t.map((s) => `${s}-${i}`), [i, t]);
}
function b_(e) {
var t;
return (t = e == null ? void 0 : e.ownerDocument) != null ? t : document;
}
function vj(e) {
return b_(e).activeElement === e;
}
function uF(e = {}) {
const {
id: t,
closeOnSelect: r = !0,
closeOnBlur: i = !0,
initialFocusRef: s,
autoSelect: c = !0,
isLazy: f,
isOpen: m,
defaultIsOpen: y,
onClose: g,
onOpen: S,
placement: E = "bottom-start",
lazyBehavior: w = "unmount",
direction: D,
computePositionOnMount: M = !1,
...k
} = e, R = Xe(null), O = Xe(null), I = iF(), A = ee(() => {
requestAnimationFrame(() => {
var De;
(De = R.current) == null || De.focus({ preventScroll: !1 });
});
}, []), L = ee(() => {
const De = setTimeout(() => {
var Se;
if (s)
(Se = s.current) == null || Se.focus();
else {
const be = I.firstEnabled();
be && de(be.index);
}
});
K.current.add(De);
}, [I, s]), H = ee(() => {
const De = setTimeout(() => {
const Se = I.lastEnabled();
Se && de(Se.index);
});
K.current.add(De);
}, [I]), q = ee(() => {
S == null || S(), c ? L() : A();
}, [c, L, A, S]), { isOpen: U, onOpen: $, onClose: ae, onToggle: oe } = AO({
isOpen: m,
defaultIsOpen: y,
onClose: g,
onOpen: q
});
nF({
enabled: U && i,
ref: R,
handler: (De) => {
var Se;
(Se = O.current) != null && Se.contains(De.target) || ae();
}
});
const Y = zO({
...k,
enabled: U || M,
placement: E,
direction: D
}), [ve, de] = qe(-1);
Kp(() => {
U || de(-1);
}, [U]), IO(R, {
focusRef: O,
visible: U,
shouldFocus: !0
});
const fe = FO({ isOpen: U, ref: R }), [_e, Me] = lF(t, "menu-button", "menu-list"), te = ee(() => {
$(), A();
}, [$, A]), K = Xe(/* @__PURE__ */ new Set([]));
mF(() => {
K.current.forEach((De) => clearTimeout(De)), K.current.clear();
});
const se = ee(() => {
$(), L();
}, [L, $]), B = ee(() => {
$(), H();
}, [$, H]), re = ee(() => {
var De, Se;
const be = b_(R.current), Ie = (De = R.current) == null ? void 0 : De.contains(be.activeElement);
if (!(U && !Ie))
return;
const tt = (Se = I.item(ve)) == null ? void 0 : Se.node;
tt == null || tt.focus();
}, [U, ve, I]), ke = Xe(null);
return {
openAndFocusMenu: te,
openAndFocusFirstItem: se,
openAndFocusLastItem: B,
onTransitionEnd: re,
unstable__animationState: fe,
descendants: I,
popper: Y,
buttonId: _e,
menuId: Me,
forceUpdate: Y.forceUpdate,
orientation: "vertical",
isOpen: U,
onToggle: oe,
onOpen: $,
onClose: ae,
menuRef: R,
buttonRef: O,
focusedIndex: ve,
closeOnSelect: r,
closeOnBlur: i,
autoSelect: c,
setFocusedIndex: de,
isLazy: f,
lazyBehavior: w,
initialFocusRef: s,
rafId: ke
};
}
function cF(e = {}, t = null) {
const r = ah(), { onToggle: i, popper: s, openAndFocusFirstItem: c, openAndFocusLastItem: f } = r, m = ee(
(y) => {
const g = y.key, E = {
Enter: c,
ArrowDown: c,
ArrowUp: f
}[g];
E && (y.preventDefault(), y.stopPropagation(), E(y));
},
[c, f]
);
return {
...e,
ref: jr(r.buttonRef, t, s.referenceRef),
id: r.buttonId,
"data-active": Kt(r.isOpen),
"aria-expanded": r.isOpen,
"aria-haspopup": "menu",
"aria-controls": r.menuId,
onClick: Pt(e.onClick, i),
onKeyDown: Pt(e.onKeyDown, m)
};
}
function AS(e) {
var t;
return hF(e) && !!((t = e == null ? void 0 : e.getAttribute("role")) != null && t.startsWith("menuitem"));
}
function dF(e = {}, t = null) {
const r = ah();
if (!r)
throw new Error(
"useMenuContext: context is undefined. Seems you forgot to wrap component within