import { f as $e, j as c, u as DR, c as Be, a as At, b as St, w as kh, d as Da, o as ar, S as rS, e as Xl, g as Yt, h as zs, k as uc, i as e0, r as Y5, _ as yh, l as MR, m as RR, n as U3, p as kR, q as nx, s as cc, t as Q5, v as X5, x as PR, y as OR, z as Ie, A as K5, B as Z5, C as t0, D as Ph, F as ce, E as Pe, T as mt, G as AR, H as wg, I as Og, J as rx, K as ax, L as ix, U as NR, M as J5, N as $5, O as zR, P as e6, Q as t6, R as IR, V as n6, W as r6, X as Ku, Y as ei, Z as a6, $ as Oh, a0 as LR, a1 as FR, a2 as i6, a3 as ca, a4 as n0, a5 as BR, a6 as H3, a7 as Qu, a8 as _R, a9 as UR, aa as rh, ab as Jm, ac as HR, ad as VR, ae as WR, af as GR, ag as qR, ah as o6, ai as s6, aj as ox, ak as sx, al as l6, am as lx, an as ux, ao as V3, ap as u6, aq as c6, ar as d6, as as Eg, at as jg, au as YR, av as cx, aw as f6, ax as QR, ay as l2, az as W3, aA as p6, aB as h6, aC as dx, aD as Zu, aE as XR, aF as KR, aG as G3, aH as q3, aI as ZR, aJ as JR, aK as $R, aL as v6, aM as m6, aN as ek, aO as tk, aP as Y3, aQ as nk, aR as Q3, aS as rk, aT as ak, aU as ik, aV as ok, aW as sk, aX as lk, aY as uk, aZ as ck, a_ as X3, a$ as dk, b0 as fk, b1 as xh, b2 as Ag, b3 as g6, b4 as Ng, b5 as pk, b6 as hk, b7 as es, b8 as y6, b9 as aS, ba as Ah, bb as vk, bc as mk, bd as gk, be as ns, bf as x6, bg as yk, bh as xk, bi as S6, bj as Sk, bk, bl as Ck, bm as wk, bn as Ek, bo as jk, bp as Tk, bq as Dk, br as Mk, bs as K3, bt as Rk, bu as kk, bv as Pk, bw as Ok, bx as Ak, by as Nk, bz as u2, bA as lh, bB as $m, bC as Z3, bD as c2, bE as d2, bF as eg, bG as J3, bH as fx, bI as zk, bJ as Ik, bK as Lk, bL as Fk, bM as Bk, bN as _k, bO as Uk, bP as tg, bQ as f2, bR as ng, bS as go, bT as Hk, bU as Vk, bV as b6, bW as zg, bX as iS, bY as C6, bZ as w6, b_ as E6, b$ as Wk, c0 as j6, c1 as T6, c2 as D6, c3 as M6, c4 as R6, c5 as rf, c6 as af, c7 as k6, c8 as P6, c9 as O6, ca as A6, cb as N6, cc as Gk, cd as qk, ce as $3, cf as rg, cg as Yk, ch as ew, ci as tw, cj as nw, ck as rw, cl as p2, cm as z6, cn as Qk, co as Nh, cp as aw, cq as Xk, cr as Kk, cs as Zk, ct as Ju, cu as I6, cv as iw, cw as Jk, cx as $k, cy as eP, cz as tP, cA as nP, cB as rP, cC as aP, cD as iP, cE as oP, cF as sP, cG as lP, cH as uP } from "./component-6919b100.mjs";
import * as Je from "react";
import pt, { Children as Kl, useMemo as an, useLayoutEffect as bo, useEffect as rt, useRef as He, useState as qe, useId as bi, useCallback as Q, forwardRef as dc, isValidElement as zh, cloneElement as Ci, PureComponent as cP, Fragment as L6, createElement as Ns, createContext as r0, useContext as Zl, memo as F6, useImperativeHandle as oS, useReducer as B6, Component as dP, useTransition as fP } from "react";
import { I as Zr, u as pP, c as hP, a as Qn, b as kr, A as Sf, m as Ws, d as of, e as fc, P as sS, f as vP, C as mP, g as Z, h as je, n as _6 } from "./scrollbar-d87b3f9c.mjs";
import ag, { flushSync as gP } from "react-dom";
function lS(e, t) {
if (e == null)
return {};
var n = {}, i = Object.keys(e), o, l;
for (l = 0; l < i.length; l++)
o = i[l], !(t.indexOf(o) >= 0) && (n[o] = e[o]);
return n;
}
var Ig = "NOT_FOUND";
function yP(e) {
var t;
return {
get: function(i) {
return t && e(t.key, i) ? t.value : Ig;
},
put: function(i, o) {
t = {
key: i,
value: o
};
},
getEntries: function() {
return t ? [t] : [];
},
clear: function() {
t = void 0;
}
};
}
function xP(e, t) {
var n = [];
function i(h) {
var y = n.findIndex(function(x) {
return t(h, x.key);
});
if (y > -1) {
var m = n[y];
return y > 0 && (n.splice(y, 1), n.unshift(m)), m.value;
}
return Ig;
}
function o(h, y) {
i(h) === Ig && (n.unshift({
key: h,
value: y
}), n.length > e && n.pop());
}
function l() {
return n;
}
function f() {
n = [];
}
return {
get: i,
put: o,
getEntries: l,
clear: f
};
}
var SP = function(t, n) {
return t === n;
};
function bP(e) {
return function(n, i) {
if (n === null || i === null || n.length !== i.length)
return !1;
for (var o = n.length, l = 0; l < o; l++)
if (!e(n[l], i[l]))
return !1;
return !0;
};
}
function CP(e, t) {
var n = typeof t == "object" ? t : {
equalityCheck: t
}, i = n.equalityCheck, o = i === void 0 ? SP : i, l = n.maxSize, f = l === void 0 ? 1 : l, h = n.resultEqualityCheck, y = bP(o), m = f === 1 ? yP(y) : xP(f, y);
function x() {
var b = m.get(arguments);
if (b === Ig) {
if (b = e.apply(null, arguments), h) {
var E = m.getEntries(), j = E.find(function(M) {
return h(M.value, b);
});
j && (b = j.value);
}
m.put(arguments, b);
}
return b;
}
return x.clearCache = function() {
return m.clear();
}, x;
}
function wP(e) {
var t = Array.isArray(e[0]) ? e[0] : e;
if (!t.every(function(i) {
return typeof i == "function";
})) {
var n = 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: [" + n + "]");
}
return t;
}
function EP(e) {
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
n[i - 1] = arguments[i];
var o = function() {
for (var f = arguments.length, h = new Array(f), y = 0; y < f; y++)
h[y] = arguments[y];
var m = 0, x, b = {
memoizeOptions: void 0
}, E = h.pop();
if (typeof E == "object" && (b = E, E = h.pop()), typeof E != "function")
throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof E + "]");
var j = b, M = j.memoizeOptions, R = M === void 0 ? n : M, k = Array.isArray(R) ? R : [R], A = wP(h), L = e.apply(void 0, [function() {
return m++, E.apply(null, arguments);
}].concat(k)), z = e(function() {
for (var _ = [], U = A.length, B = 0; B < U; B++)
_.push(A[B].apply(null, arguments));
return x = L.apply(null, _), x;
});
return Object.assign(z, {
resultFunc: E,
memoizedResultFunc: L,
dependencies: A,
lastResult: function() {
return x;
},
recomputations: function() {
return m;
},
resetRecomputations: function() {
return m = 0;
}
}), z;
};
return o;
}
var ct = /* @__PURE__ */ EP(CP);
function jP() {
return !!(typeof window < "u" && window.document && window.document.createElement);
}
var TP = /* @__PURE__ */ jP();
const U6 = 1 / 60 * 1e3, DP = typeof performance < "u" ? () => performance.now() : () => Date.now(), H6 = typeof window < "u" ? (e) => window.requestAnimationFrame(e) : (e) => setTimeout(() => e(DP()), U6);
function MP(e) {
let t = [], n = [], i = 0, o = !1, l = !1;
const f = /* @__PURE__ */ new WeakSet(), h = {
schedule: (y, m = !1, x = !1) => {
const b = x && o, E = b ? t : n;
return m && f.add(y), E.indexOf(y) === -1 && (E.push(y), b && o && (i = t.length)), y;
},
cancel: (y) => {
const m = n.indexOf(y);
m !== -1 && n.splice(m, 1), f.delete(y);
},
process: (y) => {
if (o) {
l = !0;
return;
}
if (o = !0, [t, n] = [n, t], n.length = 0, i = t.length, i)
for (let m = 0; m < i; m++) {
const x = t[m];
x(y), f.has(x) && (h.schedule(x), e());
}
o = !1, l && (l = !1, h.process(y));
}
};
return h;
}
const RP = 40;
let px = !0, Sh = !1, hx = !1;
const sf = {
delta: 0,
timestamp: 0
}, Ih = [
"read",
"update",
"preRender",
"render",
"postRender"
], a0 = Ih.reduce((e, t) => (e[t] = MP(() => Sh = !0), e), {}), kP = Ih.reduce((e, t) => {
const n = a0[t];
return e[t] = (i, o = !1, l = !1) => (Sh || AP(), n.schedule(i, o, l)), e;
}, {}), PP = Ih.reduce((e, t) => (e[t] = a0[t].cancel, e), {});
Ih.reduce((e, t) => (e[t] = () => a0[t].process(sf), e), {});
const OP = (e) => a0[e].process(sf), V6 = (e) => {
Sh = !1, sf.delta = px ? U6 : Math.max(Math.min(e - sf.timestamp, RP), 1), sf.timestamp = e, hx = !0, Ih.forEach(OP), hx = !1, Sh && (px = !1, H6(V6));
}, AP = () => {
Sh = !0, px = !0, hx || H6(V6);
}, ow = () => sf;
function uS(e) {
const {
viewBox: t = "0 0 24 24",
d: n,
displayName: i,
defaultProps: o = {}
} = e, l = Kl.toArray(e.path), f = $e((h, y) => /* @__PURE__ */ c.jsx(Zr, { ref: y, viewBox: t, ...o, ...h, children: l.length ? l : /* @__PURE__ */ c.jsx("path", { fill: "currentColor", d: n }) }));
return f.displayName = i, f;
}
function Lh(e) {
const { theme: t } = DR(), n = pP();
return an(
() => hP(t.direction, {
...n,
...e
}),
[e, t.direction, n]
);
}
var NP = Object.defineProperty, zP = (e, t, n) => t in e ? NP(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, fr = (e, t, n) => (zP(e, typeof t != "symbol" ? t + "" : t, n), n);
function sw(e) {
return e.sort((t, n) => {
const i = t.compareDocumentPosition(n);
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 IP = (e) => typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
function lw(e, t, n) {
let i = e + 1;
return n && i >= t && (i = 0), i;
}
function uw(e, t, n) {
let i = e - 1;
return n && i < 0 && (i = t), i;
}
var vx = typeof window < "u" ? bo : rt, Lg = (e) => e, LP = class {
constructor() {
fr(this, "descendants", /* @__PURE__ */ new Map()), fr(this, "register", (e) => {
if (e != null)
return IP(e) ? this.registerNode(e) : (t) => {
this.registerNode(t, e);
};
}), fr(this, "unregister", (e) => {
this.descendants.delete(e);
const t = sw(Array.from(this.descendants.keys()));
this.assignIndex(t);
}), fr(this, "destroy", () => {
this.descendants.clear();
}), fr(this, "assignIndex", (e) => {
this.descendants.forEach((t) => {
const n = e.indexOf(t.node);
t.index = n, t.node.dataset.index = t.index.toString();
});
}), fr(this, "count", () => this.descendants.size), fr(this, "enabledCount", () => this.enabledValues().length), fr(this, "values", () => Array.from(this.descendants.values()).sort((t, n) => t.index - n.index)), fr(this, "enabledValues", () => this.values().filter((e) => !e.disabled)), fr(this, "item", (e) => {
if (this.count() !== 0)
return this.values()[e];
}), fr(this, "enabledItem", (e) => {
if (this.enabledCount() !== 0)
return this.enabledValues()[e];
}), fr(this, "first", () => this.item(0)), fr(this, "firstEnabled", () => this.enabledItem(0)), fr(this, "last", () => this.item(this.descendants.size - 1)), fr(this, "lastEnabled", () => {
const e = this.enabledValues().length - 1;
return this.enabledItem(e);
}), fr(this, "indexOf", (e) => {
var t, n;
return e && (n = (t = this.descendants.get(e)) == null ? void 0 : t.index) != null ? n : -1;
}), fr(this, "enabledIndexOf", (e) => e == null ? -1 : this.enabledValues().findIndex((t) => t.node.isSameNode(e))), fr(this, "next", (e, t = !0) => {
const n = lw(e, this.count(), t);
return this.item(n);
}), fr(this, "nextEnabled", (e, t = !0) => {
const n = this.item(e);
if (!n)
return;
const i = this.enabledIndexOf(n.node), o = lw(
i,
this.enabledCount(),
t
);
return this.enabledItem(o);
}), fr(this, "prev", (e, t = !0) => {
const n = uw(e, this.count() - 1, t);
return this.item(n);
}), fr(this, "prevEnabled", (e, t = !0) => {
const n = this.item(e);
if (!n)
return;
const i = this.enabledIndexOf(n.node), o = uw(
i,
this.enabledCount() - 1,
t
);
return this.enabledItem(o);
}), fr(this, "registerNode", (e, t) => {
if (!e || this.descendants.has(e))
return;
const n = Array.from(this.descendants.keys()).concat(e), i = sw(n);
t != null && t.disabled && (t.disabled = !!t.disabled);
const o = { node: e, index: -1, ...t };
this.descendants.set(e, o), this.assignIndex(i);
});
}
};
function FP(e, t) {
if (e != null) {
if (typeof e == "function") {
e(t);
return;
}
try {
e.current = t;
} catch {
throw new Error(`Cannot assign value '${t}' to ref '${e}'`);
}
}
}
function Rn(...e) {
return (t) => {
e.forEach((n) => {
FP(n, t);
});
};
}
function BP(...e) {
return an(() => Rn(...e), e);
}
function _P() {
const e = He(new LP());
return vx(() => () => e.current.destroy()), e.current;
}
var [UP, W6] = Qn({
name: "DescendantsProvider",
errorMessage: "useDescendantsContext must be used within DescendantsProvider"
});
function HP(e) {
const t = W6(), [n, i] = qe(-1), o = He(null);
vx(() => () => {
o.current && t.unregister(o.current);
}, []), vx(() => {
if (!o.current)
return;
const f = Number(o.current.dataset.index);
n != f && !Number.isNaN(f) && i(f);
});
const l = Lg(e ? t.register(e) : t.register);
return {
descendants: t,
index: n,
enabledIndex: t.enabledIndexOf(o.current),
register: Rn(l, o)
};
}
function cS() {
return [
Lg(UP),
() => Lg(W6()),
() => _P(),
(o) => HP(o)
];
}
var [VP, i0] = Qn({
name: "AccordionStylesContext",
hookName: "useAccordionStyles",
providerName: ""
}), [WP, dS] = Qn({
name: "AccordionItemContext",
hookName: "useAccordionItemContext",
providerName: ""
}), [
GP,
HJ,
qP,
YP
] = cS(), Kd = $e(
function(t, n) {
const { getButtonProps: i } = dS(), o = i(t, n), f = {
display: "flex",
alignItems: "center",
width: "100%",
outline: 0,
...i0().button
};
return /* @__PURE__ */ c.jsx(
Be.button,
{
...o,
className: At("chakra-accordion__button", t.className),
__css: f
}
);
}
);
Kd.displayName = "AccordionButton";
function fS(e) {
const {
value: t,
defaultValue: n,
onChange: i,
shouldUpdate: o = (E, j) => E !== j
} = e, l = kr(i), f = kr(o), [h, y] = qe(n), m = t !== void 0, x = m ? t : h, b = kr(
(E) => {
const M = typeof E == "function" ? E(x) : E;
f(x, M) && (m || y(M), l(M));
},
[m, l, x, f]
);
return [x, b];
}
function QP(e) {
const {
onChange: t,
defaultIndex: n,
index: i,
allowMultiple: o,
allowToggle: l,
...f
} = e;
ZP(e), JP(e);
const h = qP(), [y, m] = qe(-1);
rt(() => () => {
m(-1);
}, []);
const [x, b] = fS({
value: i,
defaultValue() {
return o ? n ?? [] : n ?? -1;
},
onChange: t
});
return {
index: x,
setIndex: b,
htmlProps: f,
getAccordionItemProps: (j) => {
let M = !1;
return j !== null && (M = Array.isArray(x) ? x.includes(j) : x === j), { isOpen: M, onChange: (k) => {
if (j !== null)
if (o && Array.isArray(x)) {
const A = k ? x.concat(j) : x.filter((L) => L !== j);
b(A);
} else
k ? b(j) : l && b(-1);
} };
},
focusedIndex: y,
setFocusedIndex: m,
descendants: h
};
}
var [XP, pS] = Qn({
name: "AccordionContext",
hookName: "useAccordionContext",
providerName: "Accordion"
});
function KP(e) {
const { isDisabled: t, isFocusable: n, id: i, ...o } = e, { getAccordionItemProps: l, setFocusedIndex: f } = pS(), h = He(null), y = bi(), m = i ?? y, x = `accordion-button-${m}`, b = `accordion-panel-${m}`;
$P(e);
const { register: E, index: j, descendants: M } = YP({
disabled: t && !n
}), { isOpen: R, onChange: k } = l(
j === -1 ? null : j
);
eO({ isOpen: R, isDisabled: t });
const A = () => {
k == null || k(!0);
}, L = () => {
k == null || k(!1);
}, z = Q(() => {
k == null || k(!R), f(j);
}, [j, f, R, k]), I = Q(
(q) => {
const G = {
ArrowDown: () => {
const H = M.nextEnabled(j);
H == null || H.node.focus();
},
ArrowUp: () => {
const H = M.prevEnabled(j);
H == null || H.node.focus();
},
Home: () => {
const H = M.firstEnabled();
H == null || H.node.focus();
},
End: () => {
const H = M.lastEnabled();
H == null || H.node.focus();
}
}[q.key];
G && (q.preventDefault(), G(q));
},
[M, j]
), _ = Q(() => {
f(j);
}, [f, j]), U = Q(
function(J = {}, G = null) {
return {
...J,
type: "button",
ref: Rn(E, h, G),
id: x,
disabled: !!t,
"aria-expanded": !!R,
"aria-controls": b,
onClick: St(J.onClick, z),
onFocus: St(J.onFocus, _),
onKeyDown: St(J.onKeyDown, I)
};
},
[
x,
t,
R,
z,
_,
I,
b,
E
]
), B = Q(
function(J = {}, G = null) {
return {
...J,
ref: G,
role: "region",
id: b,
"aria-labelledby": x,
hidden: !R
};
},
[x, R, b]
);
return {
isOpen: R,
isDisabled: t,
isFocusable: n,
onOpen: A,
onClose: L,
getButtonProps: U,
getPanelProps: B,
htmlProps: o
};
}
function ZP(e) {
const t = e.index || e.defaultIndex, n = t != null && !Array.isArray(t) && e.allowMultiple;
kh({
condition: !!n,
message: `If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`
});
}
function JP(e) {
kh({
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 $P(e) {
kh({
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 eO(e) {
kh({
condition: e.isOpen && !!e.isDisabled,
message: "Cannot open a disabled accordion item"
});
}
function Zd(e) {
const { isOpen: t, isDisabled: n } = dS(), { reduceMotion: i } = pS(), o = At("chakra-accordion__icon", e.className), l = i0(), f = {
opacity: n ? 0.4 : 1,
transform: t ? "rotate(-180deg)" : void 0,
transition: i ? void 0 : "transform 0.2s",
transformOrigin: "center",
...l.icon
};
return /* @__PURE__ */ c.jsx(
Zr,
{
viewBox: "0 0 24 24",
"aria-hidden": !0,
className: o,
__css: f,
...e,
children: /* @__PURE__ */ c.jsx(
"path",
{
fill: "currentColor",
d: "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"
}
)
}
);
}
Zd.displayName = "AccordionIcon";
var Jd = $e(
function(t, n) {
const { children: i, className: o } = t, { htmlProps: l, ...f } = KP(t), y = {
...i0().container,
overflowAnchor: "none"
}, m = an(() => f, [f]);
return /* @__PURE__ */ c.jsx(WP, { value: m, children: /* @__PURE__ */ c.jsx(
Be.div,
{
ref: n,
...l,
className: At("chakra-accordion__item", o),
__css: y,
children: typeof i == "function" ? i({
isExpanded: !!f.isOpen,
isDisabled: !!f.isDisabled
}) : i
}
) });
}
);
Jd.displayName = "AccordionItem";
var $d = {
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]
}, $u = {
enter: {
duration: 0.2,
ease: $d.easeOut
},
exit: {
duration: 0.1,
ease: $d.easeIn
}
}, Is = {
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
})
}, tO = (e) => e != null && parseInt(e.toString(), 10) > 0, cw = {
exit: {
height: { duration: 0.2, ease: $d.ease },
opacity: { duration: 0.3, ease: $d.ease }
},
enter: {
height: { duration: 0.3, ease: $d.ease },
opacity: { duration: 0.4, ease: $d.ease }
}
}, nO = {
exit: ({
animateOpacity: e,
startingHeight: t,
transition: n,
transitionEnd: i,
delay: o
}) => {
var l;
return {
...e && { opacity: tO(t) ? 1 : 0 },
height: t,
transitionEnd: i == null ? void 0 : i.exit,
transition: (l = n == null ? void 0 : n.exit) != null ? l : Is.exit(cw.exit, o)
};
},
enter: ({
animateOpacity: e,
endingHeight: t,
transition: n,
transitionEnd: i,
delay: o
}) => {
var l;
return {
...e && { opacity: 1 },
height: t,
transitionEnd: i == null ? void 0 : i.enter,
transition: (l = n == null ? void 0 : n.enter) != null ? l : Is.enter(cw.enter, o)
};
}
}, G6 = dc(
(e, t) => {
const {
in: n,
unmountOnExit: i,
animateOpacity: o = !0,
startingHeight: l = 0,
endingHeight: f = "auto",
style: h,
className: y,
transition: m,
transitionEnd: x,
...b
} = e, [E, j] = qe(!1);
rt(() => {
const L = setTimeout(() => {
j(!0);
});
return () => clearTimeout(L);
}, []), kh({
condition: Boolean(l > 0 && i),
message: "startingHeight and unmountOnExit are mutually exclusive. You can't use them together"
});
const M = parseFloat(l.toString()) > 0, R = {
startingHeight: l,
endingHeight: f,
animateOpacity: o,
transition: E ? m : { enter: { duration: 0 } },
transitionEnd: {
enter: x == null ? void 0 : x.enter,
exit: i ? x == null ? void 0 : x.exit : {
...x == null ? void 0 : x.exit,
display: M ? "block" : "none"
}
}
}, k = i ? n : !0, A = n || i ? "enter" : "exit";
return /* @__PURE__ */ c.jsx(Sf, { initial: !1, custom: R, children: k && /* @__PURE__ */ c.jsx(
Ws.div,
{
ref: t,
...b,
className: At("chakra-collapse", y),
style: {
overflow: "hidden",
display: "block",
...h
},
custom: R,
variants: nO,
initial: i ? "exit" : !1,
animate: A,
exit: "exit"
}
) });
}
);
G6.displayName = "Collapse";
var rO = {
enter: ({ transition: e, transitionEnd: t, delay: n } = {}) => {
var i;
return {
opacity: 1,
transition: (i = e == null ? void 0 : e.enter) != null ? i : Is.enter($u.enter, n),
transitionEnd: t == null ? void 0 : t.enter
};
},
exit: ({ transition: e, transitionEnd: t, delay: n } = {}) => {
var i;
return {
opacity: 0,
transition: (i = e == null ? void 0 : e.exit) != null ? i : Is.exit($u.exit, n),
transitionEnd: t == null ? void 0 : t.exit
};
}
}, q6 = {
initial: "exit",
animate: "enter",
exit: "exit",
variants: rO
}, aO = dc(function(t, n) {
const {
unmountOnExit: i,
in: o,
className: l,
transition: f,
transitionEnd: h,
delay: y,
...m
} = t, x = o || i ? "enter" : "exit", b = i ? o && i : !0, E = { transition: f, transitionEnd: h, delay: y };
return /* @__PURE__ */ c.jsx(Sf, { custom: E, children: b && /* @__PURE__ */ c.jsx(
Ws.div,
{
ref: n,
className: At("chakra-fade", l),
custom: E,
...q6,
animate: x,
...m
}
) });
});
aO.displayName = "Fade";
var iO = {
exit: ({ reverse: e, initialScale: t, transition: n, transitionEnd: i, delay: o }) => {
var l;
return {
opacity: 0,
...e ? { scale: t, transitionEnd: i == null ? void 0 : i.exit } : { transitionEnd: { scale: t, ...i == null ? void 0 : i.exit } },
transition: (l = n == null ? void 0 : n.exit) != null ? l : Is.exit($u.exit, o)
};
},
enter: ({ transitionEnd: e, transition: t, delay: n }) => {
var i;
return {
opacity: 1,
scale: 1,
transition: (i = t == null ? void 0 : t.enter) != null ? i : Is.enter($u.enter, n),
transitionEnd: e == null ? void 0 : e.enter
};
}
}, Y6 = {
initial: "exit",
animate: "enter",
exit: "exit",
variants: iO
}, oO = dc(
function(t, n) {
const {
unmountOnExit: i,
in: o,
reverse: l = !0,
initialScale: f = 0.95,
className: h,
transition: y,
transitionEnd: m,
delay: x,
...b
} = t, E = i ? o && i : !0, j = o || i ? "enter" : "exit", M = { initialScale: f, reverse: l, transition: y, transitionEnd: m, delay: x };
return /* @__PURE__ */ c.jsx(Sf, { custom: M, children: E && /* @__PURE__ */ c.jsx(
Ws.div,
{
ref: n,
className: At("chakra-offset-slide", h),
...Y6,
animate: j,
custom: M,
...b
}
) });
}
);
oO.displayName = "ScaleFade";
var sO = {
initial: ({ offsetX: e, offsetY: t, transition: n, transitionEnd: i, delay: o }) => {
var l;
return {
opacity: 0,
x: e,
y: t,
transition: (l = n == null ? void 0 : n.exit) != null ? l : Is.exit($u.exit, o),
transitionEnd: i == null ? void 0 : i.exit
};
},
enter: ({ transition: e, transitionEnd: t, delay: n }) => {
var i;
return {
opacity: 1,
x: 0,
y: 0,
transition: (i = e == null ? void 0 : e.enter) != null ? i : Is.enter($u.enter, n),
transitionEnd: t == null ? void 0 : t.enter
};
},
exit: ({ offsetY: e, offsetX: t, transition: n, transitionEnd: i, reverse: o, delay: l }) => {
var f;
const h = { x: t, y: e };
return {
opacity: 0,
transition: (f = n == null ? void 0 : n.exit) != null ? f : Is.exit($u.exit, l),
...o ? { ...h, transitionEnd: i == null ? void 0 : i.exit } : { transitionEnd: { ...h, ...i == null ? void 0 : i.exit } }
};
}
}, mx = {
initial: "initial",
animate: "enter",
exit: "exit",
variants: sO
}, lO = dc(
function(t, n) {
const {
unmountOnExit: i,
in: o,
reverse: l = !0,
className: f,
offsetX: h = 0,
offsetY: y = 8,
transition: m,
transitionEnd: x,
delay: b,
...E
} = t, j = i ? o && i : !0, M = o || i ? "enter" : "exit", R = {
offsetX: h,
offsetY: y,
reverse: l,
transition: m,
transitionEnd: x,
delay: b
};
return /* @__PURE__ */ c.jsx(Sf, { custom: R, children: j && /* @__PURE__ */ c.jsx(
Ws.div,
{
ref: n,
className: At("chakra-offset-slide", f),
custom: R,
...mx,
animate: M,
...E
}
) });
}
);
lO.displayName = "SlideFade";
var ef = $e(
function(t, n) {
const { className: i, motionProps: o, ...l } = t, { reduceMotion: f } = pS(), { getPanelProps: h, isOpen: y } = dS(), m = h(l, n), x = At("chakra-accordion__panel", i), b = i0();
f || delete m.hidden;
const E = /* @__PURE__ */ c.jsx(Be.div, { ...m, __css: b.panel, className: x });
return f ? E : /* @__PURE__ */ c.jsx(G6, { in: y, ...o, children: E });
}
);
ef.displayName = "AccordionPanel";
var hS = $e(function({ children: t, reduceMotion: n, ...i }, o) {
const l = Da("Accordion", i), f = ar(i), { htmlProps: h, descendants: y, ...m } = QP(f), x = an(
() => ({ ...m, reduceMotion: !!n }),
[m, n]
);
return /* @__PURE__ */ c.jsx(GP, { value: y, children: /* @__PURE__ */ c.jsx(XP, { value: x, children: /* @__PURE__ */ c.jsx(VP, { value: l, children: /* @__PURE__ */ c.jsx(
Be.div,
{
ref: o,
...h,
className: At("chakra-accordion", i.className),
__css: l.root,
children: t
}
) }) }) });
});
hS.displayName = "Accordion";
var gx = $e(function(t, n) {
const { htmlWidth: i, htmlHeight: o, alt: l, ...f } = t;
return /* @__PURE__ */ c.jsx("img", { width: i, height: o, ref: n, alt: l, ...f });
});
gx.displayName = "NativeImage";
function uO(e) {
const {
loading: t,
src: n,
srcSet: i,
onLoad: o,
onError: l,
crossOrigin: f,
sizes: h,
ignoreFallback: y
} = e, [m, x] = qe("pending");
rt(() => {
x(n ? "loading" : "pending");
}, [n]);
const b = He(), E = Q(() => {
if (!n)
return;
j();
const M = new Image();
M.src = n, f && (M.crossOrigin = f), i && (M.srcset = i), h && (M.sizes = h), t && (M.loading = t), M.onload = (R) => {
j(), x("loaded"), o == null || o(R);
}, M.onerror = (R) => {
j(), x("failed"), l == null || l(R);
}, b.current = M;
}, [n, f, i, h, o, l, t]), j = () => {
b.current && (b.current.onload = null, b.current.onerror = null, b.current = null);
};
return of(() => {
if (!y)
return m === "loading" && E(), () => {
j();
};
}, [m, E, y]), y ? "loaded" : m;
}
var cO = (e, t) => e !== "loaded" && t === "beforeLoadOrError" || e === "failed" && t === "onError";
function dO(e, t = []) {
const n = Object.assign({}, e);
for (const i of t)
i in n && delete n[i];
return n;
}
var Fh = $e(function(t, n) {
const {
fallbackSrc: i,
fallback: o,
src: l,
srcSet: f,
align: h,
fit: y,
loading: m,
ignoreFallback: x,
crossOrigin: b,
fallbackStrategy: E = "beforeLoadOrError",
referrerPolicy: j,
...M
} = t, R = i !== void 0 || o !== void 0, k = m != null || x || !R, A = uO({
...t,
ignoreFallback: k
}), L = cO(A, E), z = {
ref: n,
objectFit: y,
objectPosition: h,
...k ? M : dO(M, ["onError", "onLoad"])
};
return L ? o || /* @__PURE__ */ c.jsx(
Be.img,
{
as: gx,
className: "chakra-image__placeholder",
src: i,
...z
}
) : /* @__PURE__ */ c.jsx(
Be.img,
{
as: gx,
src: l,
srcSet: f,
crossOrigin: b,
loading: m,
referrerPolicy: j,
className: "chakra-image",
...z
}
);
});
Fh.displayName = "Image";
function vS(e) {
return Kl.toArray(e).filter(
(t) => zh(t)
);
}
var [fO, pO] = Qn({
strict: !1,
name: "ButtonGroupContext"
}), hO = {
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 }
}
}, vO = {
horizontal: (e) => ({
"& > *:not(style) ~ *:not(style)": { marginStart: e }
}),
vertical: (e) => ({
"& > *:not(style) ~ *:not(style)": { marginTop: e }
})
}, Jr = $e(
function(t, n) {
const {
size: i,
colorScheme: o,
variant: l,
className: f,
spacing: h = "0.5rem",
isAttached: y,
isDisabled: m,
orientation: x = "horizontal",
...b
} = t, E = At("chakra-button__group", f), j = an(
() => ({ size: i, colorScheme: o, variant: l, isDisabled: m }),
[i, o, l, m]
);
let M = {
display: "inline-flex",
...y ? hO[x] : vO[x](h)
};
const R = x === "vertical";
return /* @__PURE__ */ c.jsx(fO, { value: j, children: /* @__PURE__ */ c.jsx(
Be.div,
{
ref: n,
role: "group",
__css: M,
className: E,
"data-attached": y ? "" : void 0,
"data-orientation": x,
flexDir: R ? "column" : void 0,
...b
}
) });
}
);
Jr.displayName = "ButtonGroup";
function mO(e) {
const [t, n] = qe(!e);
return { ref: Q((l) => {
l && n(l.tagName === "BUTTON");
}, []), type: t ? "button" : void 0 };
}
function yx(e) {
const { children: t, className: n, ...i } = e, o = zh(t) ? Ci(t, {
"aria-hidden": !0,
focusable: !1
}) : t, l = At("chakra-button__icon", n);
return /* @__PURE__ */ c.jsx(
Be.span,
{
display: "inline-flex",
alignSelf: "center",
flexShrink: 0,
...i,
className: l,
children: o
}
);
}
yx.displayName = "ButtonIcon";
function Fg(e) {
const {
label: t,
placement: n,
spacing: i = "0.5rem",
children: o = /* @__PURE__ */ c.jsx(rS, { color: "currentColor", width: "1em", height: "1em" }),
className: l,
__css: f,
...h
} = e, y = At("chakra-button__spinner", l), m = n === "start" ? "marginEnd" : "marginStart", x = an(
() => ({
display: "flex",
alignItems: "center",
position: t ? "relative" : "absolute",
[m]: t ? i : 0,
fontSize: "1em",
lineHeight: "normal",
...f
}),
[f, t, m, i]
);
return /* @__PURE__ */ c.jsx(Be.div, { className: y, ...h, __css: x, children: o });
}
Fg.displayName = "ButtonSpinner";
var pc = $e((e, t) => {
const n = pO(), i = Xl("Button", { ...n, ...e }), {
isDisabled: o = n == null ? void 0 : n.isDisabled,
isLoading: l,
isActive: f,
children: h,
leftIcon: y,
rightIcon: m,
loadingText: x,
iconSpacing: b = "0.5rem",
type: E,
spinner: j,
spinnerPlacement: M = "start",
className: R,
as: k,
...A
} = ar(e), L = an(() => {
const U = { ...i == null ? void 0 : i._focus, zIndex: 1 };
return {
display: "inline-flex",
appearance: "none",
alignItems: "center",
justifyContent: "center",
userSelect: "none",
position: "relative",
whiteSpace: "nowrap",
verticalAlign: "middle",
outline: "none",
...i,
...!!n && { _focus: U }
};
}, [i, n]), { ref: z, type: I } = mO(k), _ = { rightIcon: m, leftIcon: y, iconSpacing: b, children: h };
return /* @__PURE__ */ c.jsxs(
Be.button,
{
ref: BP(t, z),
as: k,
type: E ?? I,
"data-active": Yt(f),
"data-loading": Yt(l),
__css: L,
className: At("chakra-button", R),
...A,
disabled: o || l,
children: [
l && M === "start" && /* @__PURE__ */ c.jsx(
Fg,
{
className: "chakra-button__spinner--start",
label: x,
placement: "start",
spacing: b,
children: j
}
),
l ? x || /* @__PURE__ */ c.jsx(Be.span, { opacity: 0, children: /* @__PURE__ */ c.jsx(dw, { ..._ }) }) : /* @__PURE__ */ c.jsx(dw, { ..._ }),
l && M === "end" && /* @__PURE__ */ c.jsx(
Fg,
{
className: "chakra-button__spinner--end",
label: x,
placement: "end",
spacing: b,
children: j
}
)
]
}
);
});
pc.displayName = "Button";
function dw(e) {
const { leftIcon: t, rightIcon: n, children: i, iconSpacing: o } = e;
return /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
t && /* @__PURE__ */ c.jsx(yx, { marginEnd: o, children: t }),
i,
n && /* @__PURE__ */ c.jsx(yx, { marginStart: o, children: n })
] });
}
var Wl = $e(
(e, t) => {
const { icon: n, children: i, isRound: o, "aria-label": l, ...f } = e, h = n || i, y = zh(h) ? Ci(h, {
"aria-hidden": !0,
focusable: !1
}) : null;
return /* @__PURE__ */ c.jsx(
pc,
{
padding: "0",
borderRadius: o ? "full" : void 0,
ref: t,
"aria-label": l,
...f,
children: y
}
);
}
);
Wl.displayName = "IconButton";
var [VJ, gO] = Qn({
name: "CheckboxGroupContext",
strict: !1
});
function yO(e) {
return /* @__PURE__ */ c.jsx(
Be.svg,
{
width: "1.2em",
viewBox: "0 0 12 10",
style: {
fill: "none",
strokeWidth: 2,
stroke: "currentColor",
strokeDasharray: 16
},
...e,
children: /* @__PURE__ */ c.jsx("polyline", { points: "1.5 6 4.5 9 10.5 1" })
}
);
}
function xO(e) {
return /* @__PURE__ */ c.jsx(
Be.svg,
{
width: "1.2em",
viewBox: "0 0 24 24",
style: { stroke: "currentColor", strokeWidth: 4 },
...e,
children: /* @__PURE__ */ c.jsx("line", { x1: "21", x2: "3", y1: "12", y2: "12" })
}
);
}
function SO(e) {
const { isIndeterminate: t, isChecked: n, ...i } = e, o = t ? xO : yO;
return n || t ? /* @__PURE__ */ c.jsx(
Be.div,
{
style: {
display: "flex",
alignItems: "center",
justifyContent: "center",
height: "100%"
},
children: /* @__PURE__ */ c.jsx(o, { ...i })
}
) : null;
}
var [bO, Q6] = Qn({
name: "FormControlStylesContext",
errorMessage: `useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `
}), [CO, hc] = Qn({
strict: !1,
name: "FormControlContext"
});
function wO(e) {
const {
id: t,
isRequired: n,
isInvalid: i,
isDisabled: o,
isReadOnly: l,
...f
} = e, h = bi(), y = t || `field-${h}`, m = `${y}-label`, x = `${y}-feedback`, b = `${y}-helptext`, [E, j] = qe(!1), [M, R] = qe(!1), [k, A] = qe(!1), L = Q(
(B = {}, q = null) => ({
id: b,
...B,
ref: Rn(q, (J) => {
J && R(!0);
})
}),
[b]
), z = Q(
(B = {}, q = null) => {
var J, G;
return {
...B,
ref: q,
"data-focus": Yt(k),
"data-disabled": Yt(o),
"data-invalid": Yt(i),
"data-readonly": Yt(l),
id: (J = B.id) != null ? J : m,
htmlFor: (G = B.htmlFor) != null ? G : y
};
},
[y, o, k, i, l, m]
), I = Q(
(B = {}, q = null) => ({
id: x,
...B,
ref: Rn(q, (J) => {
J && j(!0);
}),
"aria-live": "polite"
}),
[x]
), _ = Q(
(B = {}, q = null) => ({
...B,
...f,
ref: q,
role: "group"
}),
[f]
), U = Q(
(B = {}, q = null) => ({
...B,
ref: q,
role: "presentation",
"aria-hidden": !0,
children: B.children || "*"
}),
[]
);
return {
isRequired: !!n,
isInvalid: !!i,
isReadOnly: !!l,
isDisabled: !!o,
isFocused: !!k,
onFocus: () => A(!0),
onBlur: () => A(!1),
hasFeedbackText: E,
setHasFeedbackText: j,
hasHelpText: M,
setHasHelpText: R,
id: y,
labelId: m,
feedbackId: x,
helpTextId: b,
htmlProps: f,
getHelpTextProps: L,
getErrorMessageProps: I,
getRootProps: _,
getLabelProps: z,
getRequiredIndicatorProps: U
};
}
var vn = $e(
function(t, n) {
const i = Da("Form", t), o = ar(t), {
getRootProps: l,
htmlProps: f,
...h
} = wO(o), y = At("chakra-form-control", t.className);
return /* @__PURE__ */ c.jsx(CO, { value: h, children: /* @__PURE__ */ c.jsx(bO, { value: i, children: /* @__PURE__ */ c.jsx(
Be.div,
{
...l({}, n),
className: y,
__css: i.container
}
) }) });
}
);
vn.displayName = "FormControl";
var Gn = $e(
function(t, n) {
const i = hc(), o = Q6(), l = At("chakra-form__helper-text", t.className);
return /* @__PURE__ */ c.jsx(
Be.div,
{
...i == null ? void 0 : i.getHelpTextProps(t, n),
__css: o.helperText,
className: l
}
);
}
);
Gn.displayName = "FormHelperText";
var [EO, jO] = Qn({
name: "FormErrorStylesContext",
errorMessage: `useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `
}), qn = $e(
(e, t) => {
const n = Da("FormError", e), i = ar(e), o = hc();
return o != null && o.isInvalid ? /* @__PURE__ */ c.jsx(EO, { value: n, children: /* @__PURE__ */ c.jsx(
Be.div,
{
...o == null ? void 0 : o.getErrorMessageProps(i, t),
className: At("chakra-form__error-message", e.className),
__css: {
display: "flex",
alignItems: "center",
...n.text
}
}
) }) : null;
}
);
qn.displayName = "FormErrorMessage";
var TO = $e((e, t) => {
const n = jO(), i = hc();
if (!(i != null && i.isInvalid))
return null;
const o = At("chakra-form__error-icon", e.className);
return /* @__PURE__ */ c.jsx(
Zr,
{
ref: t,
"aria-hidden": !0,
...e,
__css: n.icon,
className: o,
children: /* @__PURE__ */ c.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"
}
)
}
);
});
TO.displayName = "FormErrorIcon";
var wn = $e(function(t, n) {
var i;
const o = Xl("FormLabel", t), l = ar(t), {
className: f,
children: h,
requiredIndicator: y = /* @__PURE__ */ c.jsx(X6, {}),
optionalIndicator: m = null,
...x
} = l, b = hc(), E = (i = b == null ? void 0 : b.getLabelProps(x, n)) != null ? i : { ref: n, ...x };
return /* @__PURE__ */ c.jsxs(
Be.label,
{
...E,
className: At("chakra-form__label", l.className),
__css: {
display: "block",
textAlign: "start",
...o
},
children: [
h,
b != null && b.isRequired ? y : m
]
}
);
});
wn.displayName = "FormLabel";
var X6 = $e(
function(t, n) {
const i = hc(), o = Q6();
if (!(i != null && i.isRequired))
return null;
const l = At("chakra-form__required-indicator", t.className);
return /* @__PURE__ */ c.jsx(
Be.span,
{
...i == null ? void 0 : i.getRequiredIndicatorProps(t, n),
__css: o.requiredIndicator,
className: l
}
);
}
);
X6.displayName = "RequiredIndicator";
function mS(e) {
const { isDisabled: t, isInvalid: n, isReadOnly: i, isRequired: o, ...l } = gS(e);
return {
...l,
disabled: t,
readOnly: i,
required: o,
"aria-invalid": zs(n),
"aria-required": zs(o),
"aria-readonly": zs(i)
};
}
function gS(e) {
var t, n, i;
const o = hc(), {
id: l,
disabled: f,
readOnly: h,
required: y,
isRequired: m,
isInvalid: x,
isReadOnly: b,
isDisabled: E,
onFocus: j,
onBlur: M,
...R
} = e, k = e["aria-describedby"] ? [e["aria-describedby"]] : [];
return o != null && o.hasFeedbackText && (o != null && o.isInvalid) && k.push(o.feedbackId), o != null && o.hasHelpText && k.push(o.helpTextId), {
...R,
"aria-describedby": k.join(" ") || void 0,
id: l ?? (o == null ? void 0 : o.id),
isDisabled: (t = f ?? E) != null ? t : o == null ? void 0 : o.isDisabled,
isReadOnly: (n = h ?? b) != null ? n : o == null ? void 0 : o.isReadOnly,
isRequired: (i = y ?? m) != null ? i : o == null ? void 0 : o.isRequired,
isInvalid: x ?? (o == null ? void 0 : o.isInvalid),
onFocus: St(o == null ? void 0 : o.onFocus, j),
onBlur: St(o == null ? void 0 : o.onBlur, M)
};
}
var yS = {
border: "0",
clip: "rect(0, 0, 0, 0)",
height: "1px",
width: "1px",
margin: "-1px",
padding: "0",
overflow: "hidden",
whiteSpace: "nowrap",
position: "absolute"
}, K6 = Be("span", {
baseStyle: yS
});
K6.displayName = "VisuallyHidden";
var DO = Be("input", {
baseStyle: yS
});
DO.displayName = "VisuallyHiddenInput";
var fw = !1, Bh = null, ic = !1, xx = !1, Sx = /* @__PURE__ */ new Set();
function xS(e, t) {
Sx.forEach((n) => n(e, t));
}
var MO = typeof window < "u" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : !1;
function RO(e) {
return !(e.metaKey || !MO && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
}
function pw(e) {
ic = !0, RO(e) && (Bh = "keyboard", xS("keyboard", e));
}
function _d(e) {
if (Bh = "pointer", e.type === "mousedown" || e.type === "pointerdown") {
ic = !0;
const t = e.composedPath ? e.composedPath()[0] : e.target;
let n = !1;
try {
n = t.matches(":focus-visible");
} catch {
}
if (n)
return;
xS("pointer", e);
}
}
function kO(e) {
return e.mozInputSource === 0 && e.isTrusted ? !0 : e.detail === 0 && !e.pointerType;
}
function PO(e) {
kO(e) && (ic = !0, Bh = "virtual");
}
function OO(e) {
e.target === window || e.target === document || (!ic && !xx && (Bh = "virtual", xS("virtual", e)), ic = !1, xx = !1);
}
function AO() {
ic = !1, xx = !0;
}
function hw() {
return Bh !== "pointer";
}
function NO() {
if (typeof window > "u" || fw)
return;
const { focus: e } = HTMLElement.prototype;
HTMLElement.prototype.focus = function(...n) {
ic = !0, e.apply(this, n);
}, document.addEventListener("keydown", pw, !0), document.addEventListener("keyup", pw, !0), document.addEventListener("click", PO, !0), window.addEventListener("focus", OO, !0), window.addEventListener("blur", AO, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", _d, !0), document.addEventListener("pointermove", _d, !0), document.addEventListener("pointerup", _d, !0)) : (document.addEventListener("mousedown", _d, !0), document.addEventListener("mousemove", _d, !0), document.addEventListener("mouseup", _d, !0)), fw = !0;
}
function Z6(e) {
NO(), e(hw());
const t = () => e(hw());
return Sx.add(t), () => {
Sx.delete(t);
};
}
function zO(e, t = []) {
const n = Object.assign({}, e);
for (const i of t)
i in n && delete n[i];
return n;
}
function J6(e = {}) {
const t = gS(e), {
isDisabled: n,
isReadOnly: i,
isRequired: o,
isInvalid: l,
id: f,
onBlur: h,
onFocus: y,
"aria-describedby": m
} = t, {
defaultChecked: x,
isChecked: b,
isFocusable: E,
onChange: j,
isIndeterminate: M,
name: R,
value: k,
tabIndex: A = void 0,
"aria-label": L,
"aria-labelledby": z,
"aria-invalid": I,
..._
} = e, U = zO(_, [
"isDisabled",
"isReadOnly",
"isRequired",
"isInvalid",
"id",
"onBlur",
"onFocus",
"aria-describedby"
]), B = kr(j), q = kr(h), J = kr(y), [G, H] = qe(!1), [le, ae] = qe(!1), [he, Te] = qe(!1), [xe, $] = qe(!1);
rt(() => Z6(H), []);
const Y = He(null), [te, V] = qe(!0), [ne, we] = qe(!!x), Ee = b !== void 0, se = Ee ? b : ne, ve = Q(
(Xe) => {
if (i || n) {
Xe.preventDefault();
return;
}
Ee || we(se ? Xe.target.checked : M ? !0 : Xe.target.checked), B == null || B(Xe);
},
[
i,
n,
se,
Ee,
M,
B
]
);
of(() => {
Y.current && (Y.current.indeterminate = Boolean(M));
}, [M]), fc(() => {
n && ae(!1);
}, [n, ae]), of(() => {
const Xe = Y.current;
Xe != null && Xe.form && (Xe.form.onreset = () => {
we(!!x);
});
}, []);
const Ce = n && !E, Ae = Q(
(Xe) => {
Xe.key === " " && $(!0);
},
[$]
), Ve = Q(
(Xe) => {
Xe.key === " " && $(!1);
},
[$]
);
of(() => {
if (!Y.current)
return;
Y.current.checked !== se && we(Y.current.checked);
}, [Y.current]);
const tt = Q(
(Xe = {}, ht = null) => {
const Ht = (Ot) => {
le && Ot.preventDefault(), $(!0);
};
return {
...Xe,
ref: ht,
"data-active": Yt(xe),
"data-hover": Yt(he),
"data-checked": Yt(se),
"data-focus": Yt(le),
"data-focus-visible": Yt(le && G),
"data-indeterminate": Yt(M),
"data-disabled": Yt(n),
"data-invalid": Yt(l),
"data-readonly": Yt(i),
"aria-hidden": !0,
onMouseDown: St(Xe.onMouseDown, Ht),
onMouseUp: St(Xe.onMouseUp, () => $(!1)),
onMouseEnter: St(
Xe.onMouseEnter,
() => Te(!0)
),
onMouseLeave: St(
Xe.onMouseLeave,
() => Te(!1)
)
};
},
[
xe,
se,
n,
le,
G,
he,
M,
l,
i
]
), at = Q(
(Xe = {}, ht = null) => ({
...U,
...Xe,
ref: Rn(ht, (Ht) => {
Ht && V(Ht.tagName === "LABEL");
}),
onClick: St(Xe.onClick, () => {
var Ht;
te || ((Ht = Y.current) == null || Ht.click(), requestAnimationFrame(() => {
var Ot;
(Ot = Y.current) == null || Ot.focus();
}));
}),
"data-disabled": Yt(n),
"data-checked": Yt(se),
"data-invalid": Yt(l)
}),
[U, n, se, l, te]
), ze = Q(
(Xe = {}, ht = null) => ({
...Xe,
ref: Rn(Y, ht),
type: "checkbox",
name: R,
value: k,
id: f,
tabIndex: A,
onChange: St(Xe.onChange, ve),
onBlur: St(
Xe.onBlur,
q,
() => ae(!1)
),
onFocus: St(
Xe.onFocus,
J,
() => ae(!0)
),
onKeyDown: St(Xe.onKeyDown, Ae),
onKeyUp: St(Xe.onKeyUp, Ve),
required: o,
checked: se,
disabled: Ce,
readOnly: i,
"aria-label": L,
"aria-labelledby": z,
"aria-invalid": I ? Boolean(I) : l,
"aria-describedby": m,
"aria-disabled": n,
style: yS
}),
[
R,
k,
f,
ve,
q,
J,
Ae,
Ve,
o,
se,
Ce,
i,
L,
z,
I,
l,
m,
n,
A
]
), Qe = Q(
(Xe = {}, ht = null) => ({
...Xe,
ref: ht,
onMouseDown: St(Xe.onMouseDown, vw),
onTouchStart: St(Xe.onTouchStart, vw),
"data-disabled": Yt(n),
"data-checked": Yt(se),
"data-invalid": Yt(l)
}),
[se, n, l]
);
return {
state: {
isInvalid: l,
isFocused: le,
isChecked: se,
isActive: xe,
isHovered: he,
isIndeterminate: M,
isDisabled: n,
isReadOnly: i,
isRequired: o
},
getRootProps: at,
getCheckboxProps: tt,
getInputProps: ze,
getLabelProps: Qe,
htmlProps: U
};
}
function vw(e) {
e.preventDefault(), e.stopPropagation();
}
var IO = {
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
verticalAlign: "top",
userSelect: "none",
flexShrink: 0
}, LO = {
cursor: "pointer",
display: "inline-flex",
alignItems: "center",
verticalAlign: "top",
position: "relative"
}, FO = uc({
from: {
opacity: 0,
strokeDashoffset: 16,
transform: "scale(0.95)"
},
to: {
opacity: 1,
strokeDashoffset: 0,
transform: "scale(1)"
}
}), BO = uc({
from: {
opacity: 0
},
to: {
opacity: 1
}
}), _O = uc({
from: {
transform: "scaleX(0.65)"
},
to: {
transform: "scaleX(1)"
}
}), $6 = $e(function(t, n) {
const i = gO(), o = { ...i, ...t }, l = Da("Checkbox", o), f = ar(t), {
spacing: h = "0.5rem",
className: y,
children: m,
iconColor: x,
iconSize: b,
icon: E = /* @__PURE__ */ c.jsx(SO, {}),
isChecked: j,
isDisabled: M = i == null ? void 0 : i.isDisabled,
onChange: R,
inputProps: k,
...A
} = f;
let L = j;
i != null && i.value && f.value && (L = i.value.includes(f.value));
let z = R;
i != null && i.onChange && f.value && (z = e0(i.onChange, R));
const {
state: I,
getInputProps: _,
getCheckboxProps: U,
getLabelProps: B,
getRootProps: q
} = J6({
...A,
isDisabled: M,
isChecked: L,
onChange: z
}), J = an(
() => ({
animation: I.isIndeterminate ? `${BO} 20ms linear, ${_O} 200ms linear` : `${FO} 200ms linear`,
fontSize: b,
color: x,
...l.icon
}),
[x, b, , I.isIndeterminate, l.icon]
), G = Ci(E, {
__css: J,
isIndeterminate: I.isIndeterminate,
isChecked: I.isChecked
});
return /* @__PURE__ */ c.jsxs(
Be.label,
{
__css: { ...LO, ...l.container },
className: At("chakra-checkbox", y),
...q(),
children: [
/* @__PURE__ */ c.jsx(
"input",
{
className: "chakra-checkbox__input",
..._(k, n)
}
),
/* @__PURE__ */ c.jsx(
Be.span,
{
__css: { ...IO, ...l.control },
className: "chakra-checkbox__control",
...U(),
children: G
}
),
m && /* @__PURE__ */ c.jsx(
Be.span,
{
className: "chakra-checkbox__label",
...B(),
__css: {
marginStart: h,
...l.label
},
children: m
}
)
]
}
);
});
$6.displayName = "Checkbox";
function UO(e) {
const t = parseFloat(e);
return typeof t != "number" || Number.isNaN(t) ? 0 : t;
}
function SS(e, t) {
let n = UO(e);
const i = 10 ** (t ?? 10);
return n = Math.round(n * i) / i, t ? n.toFixed(t) : n.toString();
}
function bx(e) {
if (!Number.isFinite(e))
return 0;
let t = 1, n = 0;
for (; Math.round(e * t) / t !== e; )
t *= 10, n += 1;
return n;
}
function mw(e, t, n) {
return (e - t) * 100 / (n - t);
}
function HO(e, t, n) {
return (n - t) * e + t;
}
function gw(e, t, n) {
const i = Math.round((e - t) / n) * n + t, o = bx(n);
return SS(i, o);
}
function Tg(e, t, n) {
return e == null ? e : (n < t && console.warn("clamp: max cannot be less than min"), Math.min(Math.max(e, t), n));
}
function VO(e = {}) {
const {
onChange: t,
precision: n,
defaultValue: i,
value: o,
step: l = 1,
min: f = Number.MIN_SAFE_INTEGER,
max: h = Number.MAX_SAFE_INTEGER,
keepWithinRange: y = !0
} = e, m = kr(t), [x, b] = qe(() => {
var G;
return i == null ? "" : (G = h2(i, l, n)) != null ? G : "";
}), E = typeof o < "u", j = E ? o : x, M = ej(Ll(j), l), R = n ?? M, k = Q(
(G) => {
G !== j && (E || b(G.toString()), m == null || m(G.toString(), Ll(G)));
},
[m, E, j]
), A = Q(
(G) => {
let H = G;
return y && (H = Tg(H, f, h)), SS(H, R);
},
[R, y, h, f]
), L = Q(
(G = l) => {
let H;
j === "" ? H = Ll(G) : H = Ll(j) + G, H = A(H), k(H);
},
[A, l, k, j]
), z = Q(
(G = l) => {
let H;
j === "" ? H = Ll(-G) : H = Ll(j) - G, H = A(H), k(H);
},
[A, l, k, j]
), I = Q(() => {
var G;
let H;
i == null ? H = "" : H = (G = h2(i, l, n)) != null ? G : f, k(H);
}, [i, n, l, k, f]), _ = Q(
(G) => {
var H;
const le = (H = h2(G, l, R)) != null ? H : f;
k(le);
},
[R, l, k, f]
), U = Ll(j);
return {
isOutOfRange: U > h || U < f,
isAtMax: U === h,
isAtMin: U === f,
precision: R,
value: j,
valueAsNumber: U,
update: k,
reset: I,
increment: L,
decrement: z,
clamp: A,
cast: _,
setValue: b
};
}
function Ll(e) {
return parseFloat(e.toString().replace(/[^\w.-]+/g, ""));
}
function ej(e, t) {
return Math.max(bx(t), bx(e));
}
function h2(e, t, n) {
const i = Ll(e);
if (Number.isNaN(i))
return;
const o = ej(i, t);
return SS(i, n ?? o);
}
function ec(e, t, n, i) {
const o = kr(n);
return rt(() => {
const l = typeof e == "function" ? e() : e ?? document;
if (!(!n || !l))
return l.addEventListener(t, o, i), () => {
l.removeEventListener(t, o, i);
};
}, [t, e, i, o, n]), () => {
const l = typeof e == "function" ? e() : e ?? document;
l == null || l.removeEventListener(t, o, i);
};
}
function WO(e) {
return "current" in e;
}
var tj = () => typeof window < "u";
function GO() {
var e;
const t = navigator.userAgentData;
return (e = t == null ? void 0 : t.platform) != null ? e : navigator.platform;
}
var qO = (e) => tj() && e.test(navigator.vendor), YO = (e) => tj() && e.test(GO()), QO = () => YO(/mac|iphone|ipad|ipod/i), XO = () => QO() && qO(/apple/i);
function KO(e) {
const { ref: t, elements: n, enabled: i } = e, o = () => {
var l, f;
return (f = (l = t.current) == null ? void 0 : l.ownerDocument) != null ? f : document;
};
ec(o, "pointerdown", (l) => {
if (!XO() || !i)
return;
const f = l.target, y = (n ?? [t]).some((m) => {
const x = WO(m) ? m.current : m;
return (x == null ? void 0 : x.contains(f)) || x === f;
});
o().activeElement !== f && y && (l.preventDefault(), f.focus());
});
}
var Oe = {}, yw = {
get exports() {
return Oe;
},
set exports(e) {
Oe = e;
}
};
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var v2, xw;
function ZO() {
if (xw)
return v2;
xw = 1;
var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
function i(l) {
if (l == null)
throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(l);
}
function o() {
try {
if (!Object.assign)
return !1;
var l = new String("abc");
if (l[5] = "de", Object.getOwnPropertyNames(l)[0] === "5")
return !1;
for (var f = {}, h = 0; h < 10; h++)
f["_" + String.fromCharCode(h)] = h;
var y = Object.getOwnPropertyNames(f).map(function(x) {
return f[x];
});
if (y.join("") !== "0123456789")
return !1;
var m = {};
return "abcdefghijklmnopqrst".split("").forEach(function(x) {
m[x] = x;
}), Object.keys(Object.assign({}, m)).join("") === "abcdefghijklmnopqrst";
} catch {
return !1;
}
}
return v2 = o() ? Object.assign : function(l, f) {
for (var h, y = i(l), m, x = 1; x < arguments.length; x++) {
h = Object(arguments[x]);
for (var b in h)
t.call(h, b) && (y[b] = h[b]);
if (e) {
m = e(h);
for (var E = 0; E < m.length; E++)
n.call(h, m[E]) && (y[m[E]] = h[m[E]]);
}
}
return y;
}, v2;
}
var m2, Sw;
function bS() {
if (Sw)
return m2;
Sw = 1;
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
return m2 = e, m2;
}
var g2, bw;
function nj() {
return bw || (bw = 1, g2 = Function.call.bind(Object.prototype.hasOwnProperty)), g2;
}
var y2, Cw;
function JO() {
if (Cw)
return y2;
Cw = 1;
var e = function() {
};
if (process.env.NODE_ENV !== "production") {
var t = bS(), n = {}, i = nj();
e = function(l) {
var f = "Warning: " + l;
typeof console < "u" && console.error(f);
try {
throw new Error(f);
} catch {
}
};
}
function o(l, f, h, y, m) {
if (process.env.NODE_ENV !== "production") {
for (var x in l)
if (i(l, x)) {
var b;
try {
if (typeof l[x] != "function") {
var E = Error(
(y || "React class") + ": " + h + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof l[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
);
throw E.name = "Invariant Violation", E;
}
b = l[x](f, x, y, h, null, t);
} catch (M) {
b = M;
}
if (b && !(b instanceof Error) && e(
(y || "React class") + ": type specification of " + h + " `" + x + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof b + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
), b instanceof Error && !(b.message in n)) {
n[b.message] = !0;
var j = m ? m() : "";
e(
"Failed " + h + " type: " + b.message + (j ?? "")
);
}
}
}
}
return o.resetWarningCache = function() {
process.env.NODE_ENV !== "production" && (n = {});
}, y2 = o, y2;
}
var x2, ww;
function $O() {
if (ww)
return x2;
ww = 1;
var e = Y5, t = ZO(), n = bS(), i = nj(), o = JO(), l = function() {
};
process.env.NODE_ENV !== "production" && (l = function(h) {
var y = "Warning: " + h;
typeof console < "u" && console.error(y);
try {
throw new Error(y);
} catch {
}
});
function f() {
return null;
}
return x2 = function(h, y) {
var m = typeof Symbol == "function" && Symbol.iterator, x = "@@iterator";
function b(V) {
var ne = V && (m && V[m] || V[x]);
if (typeof ne == "function")
return ne;
}
var E = "<>", j = {
array: A("array"),
bigint: A("bigint"),
bool: A("boolean"),
func: A("function"),
number: A("number"),
object: A("object"),
string: A("string"),
symbol: A("symbol"),
any: L(),
arrayOf: z,
element: I(),
elementType: _(),
instanceOf: U,
node: G(),
objectOf: q,
oneOf: B,
oneOfType: J,
shape: le,
exact: ae
};
function M(V, ne) {
return V === ne ? V !== 0 || 1 / V === 1 / ne : V !== V && ne !== ne;
}
function R(V, ne) {
this.message = V, this.data = ne && typeof ne == "object" ? ne : {}, this.stack = "";
}
R.prototype = Error.prototype;
function k(V) {
if (process.env.NODE_ENV !== "production")
var ne = {}, we = 0;
function Ee(ve, Ce, Ae, Ve, tt, at, ze) {
if (Ve = Ve || E, at = at || Ae, ze !== n) {
if (y) {
var Qe = 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 Qe.name = "Invariant Violation", Qe;
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
var Et = Ve + ":" + Ae;
!ne[Et] && // Avoid spamming the console because they are often not actionable except for lib authors
we < 3 && (l(
"You are manually calling a React.PropTypes validation function for the `" + at + "` prop on `" + Ve + "`. 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."
), ne[Et] = !0, we++);
}
}
return Ce[Ae] == null ? ve ? Ce[Ae] === null ? new R("The " + tt + " `" + at + "` is marked as required " + ("in `" + Ve + "`, but its value is `null`.")) : new R("The " + tt + " `" + at + "` is marked as required in " + ("`" + Ve + "`, but its value is `undefined`.")) : null : V(Ce, Ae, Ve, tt, at);
}
var se = Ee.bind(null, !1);
return se.isRequired = Ee.bind(null, !0), se;
}
function A(V) {
function ne(we, Ee, se, ve, Ce, Ae) {
var Ve = we[Ee], tt = xe(Ve);
if (tt !== V) {
var at = $(Ve);
return new R(
"Invalid " + ve + " `" + Ce + "` of type " + ("`" + at + "` supplied to `" + se + "`, expected ") + ("`" + V + "`."),
{ expectedType: V }
);
}
return null;
}
return k(ne);
}
function L() {
return k(f);
}
function z(V) {
function ne(we, Ee, se, ve, Ce) {
if (typeof V != "function")
return new R("Property `" + Ce + "` of component `" + se + "` has invalid PropType notation inside arrayOf.");
var Ae = we[Ee];
if (!Array.isArray(Ae)) {
var Ve = xe(Ae);
return new R("Invalid " + ve + " `" + Ce + "` of type " + ("`" + Ve + "` supplied to `" + se + "`, expected an array."));
}
for (var tt = 0; tt < Ae.length; tt++) {
var at = V(Ae, tt, se, ve, Ce + "[" + tt + "]", n);
if (at instanceof Error)
return at;
}
return null;
}
return k(ne);
}
function I() {
function V(ne, we, Ee, se, ve) {
var Ce = ne[we];
if (!h(Ce)) {
var Ae = xe(Ce);
return new R("Invalid " + se + " `" + ve + "` of type " + ("`" + Ae + "` supplied to `" + Ee + "`, expected a single ReactElement."));
}
return null;
}
return k(V);
}
function _() {
function V(ne, we, Ee, se, ve) {
var Ce = ne[we];
if (!e.isValidElementType(Ce)) {
var Ae = xe(Ce);
return new R("Invalid " + se + " `" + ve + "` of type " + ("`" + Ae + "` supplied to `" + Ee + "`, expected a single ReactElement type."));
}
return null;
}
return k(V);
}
function U(V) {
function ne(we, Ee, se, ve, Ce) {
if (!(we[Ee] instanceof V)) {
var Ae = V.name || E, Ve = te(we[Ee]);
return new R("Invalid " + ve + " `" + Ce + "` of type " + ("`" + Ve + "` supplied to `" + se + "`, expected ") + ("instance of `" + Ae + "`."));
}
return null;
}
return k(ne);
}
function B(V) {
if (!Array.isArray(V))
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? l(
"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])."
) : l("Invalid argument supplied to oneOf, expected an array.")), f;
function ne(we, Ee, se, ve, Ce) {
for (var Ae = we[Ee], Ve = 0; Ve < V.length; Ve++)
if (M(Ae, V[Ve]))
return null;
var tt = JSON.stringify(V, function(ze, Qe) {
var Et = $(Qe);
return Et === "symbol" ? String(Qe) : Qe;
});
return new R("Invalid " + ve + " `" + Ce + "` of value `" + String(Ae) + "` " + ("supplied to `" + se + "`, expected one of " + tt + "."));
}
return k(ne);
}
function q(V) {
function ne(we, Ee, se, ve, Ce) {
if (typeof V != "function")
return new R("Property `" + Ce + "` of component `" + se + "` has invalid PropType notation inside objectOf.");
var Ae = we[Ee], Ve = xe(Ae);
if (Ve !== "object")
return new R("Invalid " + ve + " `" + Ce + "` of type " + ("`" + Ve + "` supplied to `" + se + "`, expected an object."));
for (var tt in Ae)
if (i(Ae, tt)) {
var at = V(Ae, tt, se, ve, Ce + "." + tt, n);
if (at instanceof Error)
return at;
}
return null;
}
return k(ne);
}
function J(V) {
if (!Array.isArray(V))
return process.env.NODE_ENV !== "production" && l("Invalid argument supplied to oneOfType, expected an instance of array."), f;
for (var ne = 0; ne < V.length; ne++) {
var we = V[ne];
if (typeof we != "function")
return l(
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + Y(we) + " at index " + ne + "."
), f;
}
function Ee(se, ve, Ce, Ae, Ve) {
for (var tt = [], at = 0; at < V.length; at++) {
var ze = V[at], Qe = ze(se, ve, Ce, Ae, Ve, n);
if (Qe == null)
return null;
Qe.data && i(Qe.data, "expectedType") && tt.push(Qe.data.expectedType);
}
var Et = tt.length > 0 ? ", expected one of type [" + tt.join(", ") + "]" : "";
return new R("Invalid " + Ae + " `" + Ve + "` supplied to " + ("`" + Ce + "`" + Et + "."));
}
return k(Ee);
}
function G() {
function V(ne, we, Ee, se, ve) {
return he(ne[we]) ? null : new R("Invalid " + se + " `" + ve + "` supplied to " + ("`" + Ee + "`, expected a ReactNode."));
}
return k(V);
}
function H(V, ne, we, Ee, se) {
return new R(
(V || "React class") + ": " + ne + " type `" + we + "." + Ee + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + se + "`."
);
}
function le(V) {
function ne(we, Ee, se, ve, Ce) {
var Ae = we[Ee], Ve = xe(Ae);
if (Ve !== "object")
return new R("Invalid " + ve + " `" + Ce + "` of type `" + Ve + "` " + ("supplied to `" + se + "`, expected `object`."));
for (var tt in V) {
var at = V[tt];
if (typeof at != "function")
return H(se, ve, Ce, tt, $(at));
var ze = at(Ae, tt, se, ve, Ce + "." + tt, n);
if (ze)
return ze;
}
return null;
}
return k(ne);
}
function ae(V) {
function ne(we, Ee, se, ve, Ce) {
var Ae = we[Ee], Ve = xe(Ae);
if (Ve !== "object")
return new R("Invalid " + ve + " `" + Ce + "` of type `" + Ve + "` " + ("supplied to `" + se + "`, expected `object`."));
var tt = t({}, we[Ee], V);
for (var at in tt) {
var ze = V[at];
if (i(V, at) && typeof ze != "function")
return H(se, ve, Ce, at, $(ze));
if (!ze)
return new R(
"Invalid " + ve + " `" + Ce + "` key `" + at + "` supplied to `" + se + "`.\nBad object: " + JSON.stringify(we[Ee], null, " ") + `
Valid keys: ` + JSON.stringify(Object.keys(V), null, " ")
);
var Qe = ze(Ae, at, se, ve, Ce + "." + at, n);
if (Qe)
return Qe;
}
return null;
}
return k(ne);
}
function he(V) {
switch (typeof V) {
case "number":
case "string":
case "undefined":
return !0;
case "boolean":
return !V;
case "object":
if (Array.isArray(V))
return V.every(he);
if (V === null || h(V))
return !0;
var ne = b(V);
if (ne) {
var we = ne.call(V), Ee;
if (ne !== V.entries) {
for (; !(Ee = we.next()).done; )
if (!he(Ee.value))
return !1;
} else
for (; !(Ee = we.next()).done; ) {
var se = Ee.value;
if (se && !he(se[1]))
return !1;
}
} else
return !1;
return !0;
default:
return !1;
}
}
function Te(V, ne) {
return V === "symbol" ? !0 : ne ? ne["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && ne instanceof Symbol : !1;
}
function xe(V) {
var ne = typeof V;
return Array.isArray(V) ? "array" : V instanceof RegExp ? "object" : Te(ne, V) ? "symbol" : ne;
}
function $(V) {
if (typeof V > "u" || V === null)
return "" + V;
var ne = xe(V);
if (ne === "object") {
if (V instanceof Date)
return "date";
if (V instanceof RegExp)
return "regexp";
}
return ne;
}
function Y(V) {
var ne = $(V);
switch (ne) {
case "array":
case "object":
return "an " + ne;
case "boolean":
case "date":
case "regexp":
return "a " + ne;
default:
return ne;
}
}
function te(V) {
return !V.constructor || !V.constructor.name ? E : V.constructor.name;
}
return j.checkPropTypes = o, j.resetWarningCache = o.resetWarningCache, j.PropTypes = j, j;
}, x2;
}
var S2, Ew;
function eA() {
if (Ew)
return S2;
Ew = 1;
var e = bS();
function t() {
}
function n() {
}
return n.resetWarningCache = t, S2 = function() {
function i(f, h, y, m, x, b) {
if (b !== e) {
var E = 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 E.name = "Invariant Violation", E;
}
}
i.isRequired = i;
function o() {
return i;
}
var l = {
array: i,
bigint: i,
bool: i,
func: i,
number: i,
object: i,
string: i,
symbol: i,
any: i,
arrayOf: o,
element: i,
elementType: i,
instanceOf: o,
node: i,
objectOf: o,
oneOf: o,
oneOfType: o,
shape: o,
exact: o,
checkPropTypes: n,
resetWarningCache: t
};
return l.PropTypes = l, l;
}, S2;
}
if (process.env.NODE_ENV !== "production") {
var tA = Y5, nA = !0;
yw.exports = $O()(tA.isElement, nA);
} else
yw.exports = eA()();
var Cx = "data-focus-lock", rj = "data-focus-lock-disabled", rA = "data-no-focus-lock", aA = "data-autofocus-inside", iA = "data-no-autofocus";
function oA(e, t) {
return typeof e == "function" ? e(t) : e && (e.current = t), e;
}
function sA(e, t) {
var n = qe(function() {
return {
// value
value: e,
// last callback
callback: t,
// "memoized" public interface
facade: {
get current() {
return n.value;
},
set current(i) {
var o = n.value;
o !== i && (n.value = i, n.callback(i, o));
}
}
};
})[0];
return n.callback = t, n.facade;
}
function aj(e, t) {
return sA(t || null, function(n) {
return e.forEach(function(i) {
return oA(i, n);
});
});
}
var b2 = {
width: "1px",
height: "0px",
padding: 0,
overflow: "hidden",
position: "fixed",
top: "1px",
left: "1px"
};
process.env.NODE_ENV !== "production" && Oe.node;
var Jo = function() {
return Jo = Object.assign || function(t) {
for (var n, i = 1, o = arguments.length; i < o; i++) {
n = arguments[i];
for (var l in n)
Object.prototype.hasOwnProperty.call(n, l) && (t[l] = n[l]);
}
return t;
}, Jo.apply(this, arguments);
};
function ij(e, t) {
var n = {};
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
if (e != null && typeof Object.getOwnPropertySymbols == "function")
for (var o = 0, i = Object.getOwnPropertySymbols(e); o < i.length; o++)
t.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, i[o]) && (n[i[o]] = e[i[o]]);
return n;
}
function bf(e, t, n, i) {
function o(l) {
return l instanceof n ? l : new n(function(f) {
f(l);
});
}
return new (n || (n = Promise))(function(l, f) {
function h(x) {
try {
m(i.next(x));
} catch (b) {
f(b);
}
}
function y(x) {
try {
m(i.throw(x));
} catch (b) {
f(b);
}
}
function m(x) {
x.done ? l(x.value) : o(x.value).then(h, y);
}
m((i = i.apply(e, t || [])).next());
});
}
function Cf(e, t) {
var n = { label: 0, sent: function() {
if (l[0] & 1)
throw l[1];
return l[1];
}, trys: [], ops: [] }, i, o, l, f;
return f = { next: h(0), throw: h(1), return: h(2) }, typeof Symbol == "function" && (f[Symbol.iterator] = function() {
return this;
}), f;
function h(m) {
return function(x) {
return y([m, x]);
};
}
function y(m) {
if (i)
throw new TypeError("Generator is already executing.");
for (; f && (f = 0, m[0] && (n = 0)), n; )
try {
if (i = 1, o && (l = m[0] & 2 ? o.return : m[0] ? o.throw || ((l = o.return) && l.call(o), 0) : o.next) && !(l = l.call(o, m[1])).done)
return l;
switch (o = 0, l && (m = [m[0] & 2, l.value]), m[0]) {
case 0:
case 1:
l = m;
break;
case 4:
return n.label++, { value: m[1], done: !1 };
case 5:
n.label++, o = m[1], m = [0];
continue;
case 7:
m = n.ops.pop(), n.trys.pop();
continue;
default:
if (l = n.trys, !(l = l.length > 0 && l[l.length - 1]) && (m[0] === 6 || m[0] === 2)) {
n = 0;
continue;
}
if (m[0] === 3 && (!l || m[1] > l[0] && m[1] < l[3])) {
n.label = m[1];
break;
}
if (m[0] === 6 && n.label < l[1]) {
n.label = l[1], l = m;
break;
}
if (l && n.label < l[2]) {
n.label = l[2], n.ops.push(m);
break;
}
l[2] && n.ops.pop(), n.trys.pop();
continue;
}
m = t.call(e, n);
} catch (x) {
m = [6, x], o = 0;
} finally {
i = l = 0;
}
if (m[0] & 5)
throw m[1];
return { value: m[0] ? m[1] : void 0, done: !0 };
}
}
function jw(e, t) {
var n = typeof Symbol == "function" && e[Symbol.iterator];
if (!n)
return e;
var i = n.call(e), o, l = [], f;
try {
for (; (t === void 0 || t-- > 0) && !(o = i.next()).done; )
l.push(o.value);
} catch (h) {
f = { error: h };
} finally {
try {
o && !o.done && (n = i.return) && n.call(i);
} finally {
if (f)
throw f.error;
}
}
return l;
}
function wx(e, t, n) {
if (n || arguments.length === 2)
for (var i = 0, o = t.length, l; i < o; i++)
(l || !(i in t)) && (l || (l = Array.prototype.slice.call(t, 0, i)), l[i] = t[i]);
return e.concat(l || Array.prototype.slice.call(t));
}
function oj(e) {
return e;
}
function sj(e, t) {
t === void 0 && (t = oj);
var n = [], i = !1, o = {
read: function() {
if (i)
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
return n.length ? n[n.length - 1] : e;
},
useMedium: function(l) {
var f = t(l, i);
return n.push(f), function() {
n = n.filter(function(h) {
return h !== f;
});
};
},
assignSyncMedium: function(l) {
for (i = !0; n.length; ) {
var f = n;
n = [], f.forEach(l);
}
n = {
push: function(h) {
return l(h);
},
filter: function() {
return n;
}
};
},
assignMedium: function(l) {
i = !0;
var f = [];
if (n.length) {
var h = n;
n = [], h.forEach(l), f = n;
}
var y = function() {
var x = f;
f = [], x.forEach(l);
}, m = function() {
return Promise.resolve().then(y);
};
m(), n = {
push: function(x) {
f.push(x), m();
},
filter: function(x) {
return f = f.filter(x), n;
}
};
}
};
return o;
}
function CS(e, t) {
return t === void 0 && (t = oj), sj(e, t);
}
function lj(e) {
e === void 0 && (e = {});
var t = sj(null);
return t.options = Jo({ async: !0, ssr: !1 }, e), t;
}
var uj = function(e) {
var t = e.sideCar, n = ij(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 Je.createElement(i, Jo({}, n));
};
uj.isSideCarExport = !0;
function lA(e, t) {
return e.useMedium(t), uj;
}
var cj = CS({}, function(e) {
var t = e.target, n = e.currentTarget;
return {
target: t,
currentTarget: n
};
}), dj = CS(), uA = CS(), cA = lj({
async: !0
// focus-lock sidecar is not required on the server
// however, it might be required for JSDOM tests
// ssr: true,
}), dA = [], wS = /* @__PURE__ */ Je.forwardRef(function(t, n) {
var i, o = Je.useState(), l = o[0], f = o[1], h = Je.useRef(), y = Je.useRef(!1), m = Je.useRef(null), x = t.children, b = t.disabled, E = t.noFocusGuards, j = t.persistentFocus, M = t.crossFrame, R = t.autoFocus, k = t.allowTextSelection, A = t.group, L = t.className, z = t.whiteList, I = t.hasPositiveIndices, _ = t.shards, U = _ === void 0 ? dA : _, B = t.as, q = B === void 0 ? "div" : B, J = t.lockProps, G = J === void 0 ? {} : J, H = t.sideCar, le = t.returnFocus, ae = t.focusOptions, he = t.onActivation, Te = t.onDeactivation, xe = Je.useState({}), $ = xe[0], Y = Je.useCallback(function() {
m.current = m.current || document && document.activeElement, h.current && he && he(h.current), y.current = !0;
}, [he]), te = Je.useCallback(function() {
y.current = !1, Te && Te(h.current);
}, [Te]);
rt(function() {
b || (m.current = null);
}, []);
var V = Je.useCallback(function(Ve) {
var tt = m.current;
if (tt && tt.focus) {
var at = typeof le == "function" ? le(tt) : le;
if (at) {
var ze = typeof at == "object" ? at : void 0;
m.current = null, Ve ? Promise.resolve().then(function() {
return tt.focus(ze);
}) : tt.focus(ze);
}
}
}, [le]), ne = Je.useCallback(function(Ve) {
y.current && cj.useMedium(Ve);
}, []), we = dj.useMedium, Ee = Je.useCallback(function(Ve) {
h.current !== Ve && (h.current = Ve, f(Ve));
}, []);
process.env.NODE_ENV !== "production" && (typeof k < "u" && console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"), Je.useEffect(function() {
!h.current && typeof q != "string" && console.error("FocusLock: could not obtain ref to internal node");
}, []));
var se = yh((i = {}, i[rj] = b && "disabled", i[Cx] = A, i), G), ve = E !== !0, Ce = ve && E !== "tail", Ae = aj([n, Ee]);
return /* @__PURE__ */ Je.createElement(Je.Fragment, null, ve && [
// nearest focus guard
/* @__PURE__ */ Je.createElement("div", {
key: "guard-first",
"data-focus-guard": !0,
tabIndex: b ? -1 : 0,
style: b2
}),
// first tabbed element guard
I ? /* @__PURE__ */ Je.createElement("div", {
key: "guard-nearest",
"data-focus-guard": !0,
tabIndex: b ? -1 : 1,
style: b2
}) : null
], !b && /* @__PURE__ */ Je.createElement(H, {
id: $,
sideCar: cA,
observed: l,
disabled: b,
persistentFocus: j,
crossFrame: M,
autoFocus: R,
whiteList: z,
shards: U,
onActivation: Y,
onDeactivation: te,
returnFocus: V,
focusOptions: ae
}), /* @__PURE__ */ Je.createElement(q, yh({
ref: Ae
}, se, {
className: L,
onBlur: we,
onFocus: ne
}), x), Ce && /* @__PURE__ */ Je.createElement("div", {
"data-focus-guard": !0,
tabIndex: b ? -1 : 0,
style: b2
}));
});
wS.propTypes = process.env.NODE_ENV !== "production" ? {
children: Oe.node,
disabled: Oe.bool,
returnFocus: Oe.oneOfType([Oe.bool, Oe.object, Oe.func]),
focusOptions: Oe.object,
noFocusGuards: Oe.bool,
hasPositiveIndices: Oe.bool,
allowTextSelection: Oe.bool,
autoFocus: Oe.bool,
persistentFocus: Oe.bool,
crossFrame: Oe.bool,
group: Oe.string,
className: Oe.string,
whiteList: Oe.func,
shards: Oe.arrayOf(Oe.any),
as: Oe.oneOfType([Oe.string, Oe.func, Oe.object]),
lockProps: Oe.object,
onActivation: Oe.func,
onDeactivation: Oe.func,
sideCar: Oe.any.isRequired
} : {};
wS.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 fj = wS;
function ES(e, t) {
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, MR(e, t);
}
function fA(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 n(i) {
return i.displayName || i.name || "Component";
}
return function(o) {
if (process.env.NODE_ENV !== "production" && typeof o != "function")
throw new Error("Expected WrappedComponent to be a React component.");
var l = [], f;
function h() {
f = e(l.map(function(m) {
return m.props;
})), t(f);
}
var y = /* @__PURE__ */ function(m) {
ES(x, m);
function x() {
return m.apply(this, arguments) || this;
}
x.peek = function() {
return f;
};
var b = x.prototype;
return b.componentDidMount = function() {
l.push(this), h();
}, b.componentDidUpdate = function() {
h();
}, b.componentWillUnmount = function() {
var j = l.indexOf(this);
l.splice(j, 1), h();
}, b.render = function() {
return /* @__PURE__ */ pt.createElement(o, this.props);
}, x;
}(cP);
return RR(y, "displayName", "SideEffect(" + n(o) + ")"), y;
};
}
var as = function(e) {
for (var t = Array(e.length), n = 0; n < e.length; ++n)
t[n] = e[n];
return t;
}, Bg = function(e) {
return Array.isArray(e) ? e : [e];
}, pj = function(e) {
return Array.isArray(e) ? e[0] : e;
}, pA = 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";
}, hj = 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;
}, vj = function(e) {
return e === document || e && e.nodeType === Node.DOCUMENT_NODE;
}, hA = function(e, t) {
return !e || vj(e) || !pA(e) && t(hj(e));
}, mj = function(e, t) {
var n = e.get(t);
if (n !== void 0)
return n;
var i = hA(t, mj.bind(void 0, e));
return e.set(t, i), i;
}, vA = function(e, t) {
return e && !vj(e) ? yA(e) ? t(hj(e)) : !1 : !0;
}, gj = function(e, t) {
var n = e.get(t);
if (n !== void 0)
return n;
var i = vA(t, gj.bind(void 0, e));
return e.set(t, i), i;
}, yj = function(e) {
return e.dataset;
}, mA = function(e) {
return e.tagName === "BUTTON";
}, xj = function(e) {
return e.tagName === "INPUT";
}, Sj = function(e) {
return xj(e) && e.type === "radio";
}, gA = function(e) {
return !((xj(e) || mA(e)) && (e.type === "hidden" || e.disabled));
}, yA = function(e) {
var t = e.getAttribute(iA);
return ![!0, "true", ""].includes(t);
}, jS = function(e) {
var t;
return Boolean(e && ((t = yj(e)) === null || t === void 0 ? void 0 : t.focusGuard));
}, _g = function(e) {
return !jS(e);
}, xA = function(e) {
return Boolean(e);
}, SA = function(e, t) {
var n = e.tabIndex - t.tabIndex, i = e.index - t.index;
if (n) {
if (!e.tabIndex)
return 1;
if (!t.tabIndex)
return -1;
}
return n || i;
}, bj = function(e, t, n) {
return as(e).map(function(i, o) {
return {
node: i,
index: o,
tabIndex: n && i.tabIndex === -1 ? (i.dataset || {}).focusGuard ? 0 : -1 : i.tabIndex
};
}).filter(function(i) {
return !t || i.tabIndex >= 0;
}).sort(SA);
}, bA = [
"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]"
], TS = bA.join(","), CA = "".concat(TS, ", [data-focus-guard]"), Cj = function(e, t) {
return as((e.shadowRoot || e).children).reduce(function(n, i) {
return n.concat(i.matches(t ? CA : TS) ? [i] : [], Cj(i));
}, []);
}, wA = function(e, t) {
var n;
return e instanceof HTMLIFrameElement && (!((n = e.contentDocument) === null || n === void 0) && n.body) ? o0([e.contentDocument.body], t) : [e];
}, o0 = function(e, t) {
return e.reduce(function(n, i) {
var o, l = Cj(i, t), f = (o = []).concat.apply(o, l.map(function(h) {
return wA(h, t);
}));
return n.concat(
// add all tabbables inside and within shadow DOMs in DOM order
f,
// add if node is tabbable itself
i.parentNode ? as(i.parentNode.querySelectorAll(TS)).filter(function(h) {
return h === i;
}) : []
);
}, []);
}, EA = function(e) {
var t = e.querySelectorAll("[".concat(aA, "]"));
return as(t).map(function(n) {
return o0([n]);
}).reduce(function(n, i) {
return n.concat(i);
}, []);
}, DS = function(e, t) {
return as(e).filter(function(n) {
return mj(t, n);
}).filter(function(n) {
return gA(n);
});
}, Tw = function(e, t) {
return t === void 0 && (t = /* @__PURE__ */ new Map()), as(e).filter(function(n) {
return gj(t, n);
});
}, Ex = function(e, t, n) {
return bj(DS(o0(e, n), t), !0, n);
}, Dw = function(e, t) {
return bj(DS(o0(e), t), !1);
}, jA = function(e, t) {
return DS(EA(e), t);
}, lf = function(e, t) {
return e.shadowRoot ? lf(e.shadowRoot, t) : Object.getPrototypeOf(e).contains !== void 0 && Object.getPrototypeOf(e).contains.call(e, t) ? !0 : as(e.children).some(function(n) {
var i;
if (n instanceof HTMLIFrameElement) {
var o = (i = n.contentDocument) === null || i === void 0 ? void 0 : i.body;
return o ? lf(o, t) : !1;
}
return lf(n, t);
});
}, TA = function(e) {
for (var t = /* @__PURE__ */ new Set(), n = e.length, i = 0; i < n; i += 1)
for (var o = i + 1; o < n; o += 1) {
var l = e[i].compareDocumentPosition(e[o]);
(l & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0 && t.add(o), (l & Node.DOCUMENT_POSITION_CONTAINS) > 0 && t.add(i);
}
return e.filter(function(f, h) {
return !t.has(h);
});
}, wj = function(e) {
return e.parentNode ? wj(e.parentNode) : e;
}, MS = function(e) {
var t = Bg(e);
return t.filter(Boolean).reduce(function(n, i) {
var o = i.getAttribute(Cx);
return n.push.apply(n, o ? TA(as(wj(i).querySelectorAll("[".concat(Cx, '="').concat(o, '"]:not([').concat(rj, '="disabled"])')))) : [i]), n;
}, []);
}, DA = function(e) {
try {
return e();
} catch {
return;
}
}, bh = function(e) {
if (e === void 0 && (e = document), !(!e || !e.activeElement)) {
var t = e.activeElement;
return t.shadowRoot ? bh(t.shadowRoot) : t instanceof HTMLIFrameElement && DA(function() {
return t.contentWindow.document;
}) ? bh(t.contentWindow.document) : t;
}
}, MA = function(e, t) {
return e === t;
}, RA = function(e, t) {
return Boolean(as(e.querySelectorAll("iframe")).some(function(n) {
return MA(n, t);
}));
}, Ej = function(e, t) {
return t === void 0 && (t = bh(pj(e).ownerDocument)), !t || t.dataset && t.dataset.focusGuard ? !1 : MS(e).some(function(n) {
return lf(n, t) || RA(n, t);
});
}, kA = function(e) {
e === void 0 && (e = document);
var t = bh(e);
return t ? as(e.querySelectorAll("[".concat(rA, "]"))).some(function(n) {
return lf(n, t);
}) : !1;
}, PA = function(e, t) {
return t.filter(Sj).filter(function(n) {
return n.name === e.name;
}).filter(function(n) {
return n.checked;
})[0] || e;
}, RS = function(e, t) {
return Sj(e) && e.name ? PA(e, t) : e;
}, OA = function(e) {
var t = /* @__PURE__ */ new Set();
return e.forEach(function(n) {
return t.add(RS(n, e));
}), e.filter(function(n) {
return t.has(n);
});
}, Mw = function(e) {
return e[0] && e.length > 1 ? RS(e[0], e) : e[0];
}, Rw = function(e, t) {
return e.length > 1 ? e.indexOf(RS(e[t], e)) : t;
}, jj = "NEW_FOCUS", AA = function(e, t, n, i) {
var o = e.length, l = e[0], f = e[o - 1], h = jS(n);
if (!(n && e.indexOf(n) >= 0)) {
var y = n !== void 0 ? t.indexOf(n) : -1, m = i ? t.indexOf(i) : y, x = i ? e.indexOf(i) : -1, b = y - m, E = t.indexOf(l), j = t.indexOf(f), M = OA(t), R = n !== void 0 ? M.indexOf(n) : -1, k = R - (i ? M.indexOf(i) : y), A = Rw(e, 0), L = Rw(e, o - 1);
if (y === -1 || x === -1)
return jj;
if (!b && x >= 0)
return x;
if (y <= E && h && Math.abs(b) > 1)
return L;
if (y >= j && h && Math.abs(b) > 1)
return A;
if (b && Math.abs(k) > 1)
return x;
if (y <= E)
return L;
if (y > j)
return A;
if (b)
return Math.abs(b) > 1 ? x : (o + x + b) % o;
}
}, NA = function(e) {
return function(t) {
var n, i = (n = yj(t)) === null || n === void 0 ? void 0 : n.autofocus;
return (
// @ts-expect-error
t.autofocus || //
i !== void 0 && i !== "false" || //
e.indexOf(t) >= 0
);
};
}, zA = function(e, t, n) {
var i = e.map(function(l) {
var f = l.node;
return f;
}), o = Tw(i.filter(NA(n)));
return o && o.length ? Mw(o) : Mw(Tw(t));
}, jx = function(e, t) {
return t === void 0 && (t = []), t.push(e), e.parentNode && jx(e.parentNode.host || e.parentNode, t), t;
}, C2 = function(e, t) {
for (var n = jx(e), i = jx(t), o = 0; o < n.length; o += 1) {
var l = n[o];
if (i.indexOf(l) >= 0)
return l;
}
return !1;
}, Tj = function(e, t, n) {
var i = Bg(e), o = Bg(t), l = i[0], f = !1;
return o.filter(Boolean).forEach(function(h) {
f = C2(f || h, h) || f, n.filter(Boolean).forEach(function(y) {
var m = C2(l, y);
m && (!f || lf(m, f) ? f = m : f = C2(m, f));
});
}), f;
}, IA = function(e, t) {
return e.reduce(function(n, i) {
return n.concat(jA(i, t));
}, []);
}, LA = function(e, t) {
var n = /* @__PURE__ */ new Map();
return t.forEach(function(i) {
return n.set(i.node, i);
}), e.map(function(i) {
return n.get(i);
}).filter(xA);
}, FA = function(e, t) {
var n = bh(Bg(e).length > 0 ? document : pj(e).ownerDocument), i = MS(e).filter(_g), o = Tj(n || e, e, i), l = /* @__PURE__ */ new Map(), f = Dw(i, l), h = Ex(i, l).filter(function(j) {
var M = j.node;
return _g(M);
});
if (!(!h[0] && (h = f, !h[0]))) {
var y = Dw([o], l).map(function(j) {
var M = j.node;
return M;
}), m = LA(y, h), x = m.map(function(j) {
var M = j.node;
return M;
}), b = AA(x, y, n, t);
if (b === jj) {
var E = zA(f, x, IA(i, l));
if (E)
return { node: E };
console.warn("focus-lock: cannot find any node to move focus into");
return;
}
return b === void 0 ? b : m[b];
}
}, BA = function(e) {
var t = MS(e).filter(_g), n = Tj(e, e, t), i = /* @__PURE__ */ new Map(), o = Ex([n], i, !0), l = Ex(t, i).filter(function(f) {
var h = f.node;
return _g(h);
}).map(function(f) {
var h = f.node;
return h;
});
return o.map(function(f) {
var h = f.node, y = f.index;
return {
node: h,
index: y,
lockItem: l.indexOf(h) >= 0,
guard: jS(h)
};
});
}, _A = function(e, t) {
"focus" in e && e.focus(t), "contentWindow" in e && e.contentWindow && e.contentWindow.focus();
}, w2 = 0, E2 = !1, Dj = function(e, t, n) {
n === void 0 && (n = {});
var i = FA(e, t);
if (!E2 && i) {
if (w2 > 2) {
console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"), E2 = !0, setTimeout(function() {
E2 = !1;
}, 1);
return;
}
w2++, _A(i.node, n.focusOptions), w2--;
}
};
function Mj(e) {
var t = window, n = t.setImmediate;
typeof n < "u" ? n(e) : setTimeout(e, 1);
}
var UA = function() {
return document && document.activeElement === document.body;
}, HA = function() {
return UA() || kA();
}, uf = null, tf = null, cf = null, Ch = !1, VA = function() {
return !0;
}, WA = function(t) {
return (uf.whiteList || VA)(t);
}, GA = function(t, n) {
cf = {
observerNode: t,
portaledElement: n
};
}, qA = function(t) {
return cf && cf.portaledElement === t;
};
function kw(e, t, n, i) {
var o = null, l = e;
do {
var f = i[l];
if (f.guard)
f.node.dataset.focusAutoGuard && (o = f);
else if (f.lockItem) {
if (l !== e)
return;
o = null;
} else
break;
} while ((l += n) !== t);
o && (o.node.tabIndex = 0);
}
var YA = function(t) {
return t && "current" in t ? t.current : t;
}, QA = function(t) {
return t ? Boolean(Ch) : Ch === "meanwhile";
}, XA = function e(t, n, i) {
return n && // find host equal to active element and check nested active element
(n.host === t && (!n.activeElement || i.contains(n.activeElement)) || n.parentNode && e(t, n.parentNode, i));
}, KA = function(t, n) {
return n.some(function(i) {
return XA(t, i, i);
});
}, Ug = function() {
var t = !1;
if (uf) {
var n = uf, i = n.observed, o = n.persistentFocus, l = n.autoFocus, f = n.shards, h = n.crossFrame, y = n.focusOptions, m = i || cf && cf.portaledElement, x = document && document.activeElement;
if (m) {
var b = [m].concat(f.map(YA).filter(Boolean));
if ((!x || WA(x)) && (o || QA(h) || !HA() || !tf && l) && (m && !// active element is "inside" working area
(Ej(b) || // check for shadow-dom contained elements
x && KA(x, b) || qA(x)) && (document && !tf && x && !l ? (x.blur && x.blur(), document.body.focus()) : (t = Dj(b, tf, {
focusOptions: y
}), cf = {})), Ch = !1, tf = document && document.activeElement), document) {
var E = document && document.activeElement, j = BA(b), M = j.map(function(R) {
var k = R.node;
return k;
}).indexOf(E);
M > -1 && (j.filter(function(R) {
var k = R.guard, A = R.node;
return k && A.dataset.focusAutoGuard;
}).forEach(function(R) {
var k = R.node;
return k.removeAttribute("tabIndex");
}), kw(M, j.length, 1, j), kw(M, -1, -1, j));
}
}
}
return t;
}, Rj = function(t) {
Ug() && t && (t.stopPropagation(), t.preventDefault());
}, kS = function() {
return Mj(Ug);
}, ZA = function(t) {
var n = t.target, i = t.currentTarget;
i.contains(n) || GA(i, n);
}, JA = function() {
return null;
};
process.env.NODE_ENV !== "production" && Oe.node.isRequired;
var kj = function() {
Ch = "just", setTimeout(function() {
Ch = "meanwhile";
}, 0);
}, $A = function() {
document.addEventListener("focusin", Rj), document.addEventListener("focusout", kS), window.addEventListener("blur", kj);
}, eN = function() {
document.removeEventListener("focusin", Rj), document.removeEventListener("focusout", kS), window.removeEventListener("blur", kj);
};
function tN(e) {
return e.filter(function(t) {
var n = t.disabled;
return !n;
});
}
function nN(e) {
var t = e.slice(-1)[0];
t && !uf && $A();
var n = uf, i = n && t && t.id === n.id;
uf = t, n && !i && (n.onDeactivation(), e.filter(function(o) {
var l = o.id;
return l === n.id;
}).length || n.returnFocus(!t)), t ? (tf = null, (!i || n.observed !== t.observed) && t.onActivation(), Ug(), Mj(Ug)) : (eN(), tf = null);
}
cj.assignSyncMedium(ZA);
dj.assignMedium(kS);
uA.assignMedium(function(e) {
return e({
moveFocusInside: Dj,
focusInside: Ej
});
});
const rN = fA(tN, nN)(JA);
var Pj = /* @__PURE__ */ Je.forwardRef(function(t, n) {
return /* @__PURE__ */ Je.createElement(fj, yh({
sideCar: rN,
ref: n
}, t));
}), Oj = fj.propTypes || {};
Oj.sideCar;
var aN = lS(Oj, ["sideCar"]);
Pj.propTypes = process.env.NODE_ENV !== "production" ? aN : {};
const Pw = Pj;
function Aj(e) {
return e != null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
}
function Nj(e) {
var t;
if (!Aj(e))
return !1;
const n = (t = e.ownerDocument.defaultView) != null ? t : window;
return e instanceof n.HTMLElement;
}
function iN(e) {
var t, n;
return (n = (t = zj(e)) == null ? void 0 : t.defaultView) != null ? n : window;
}
function zj(e) {
return Aj(e) ? e.ownerDocument : document;
}
function oN(e) {
return zj(e).activeElement;
}
var Ij = (e) => e.hasAttribute("tabindex"), sN = (e) => Ij(e) && e.tabIndex === -1;
function lN(e) {
return Boolean(e.getAttribute("disabled")) === !0 || Boolean(e.getAttribute("aria-disabled")) === !0;
}
function Lj(e) {
return e.parentElement && Lj(e.parentElement) ? !0 : e.hidden;
}
function uN(e) {
const t = e.getAttribute("contenteditable");
return t !== "false" && t != null;
}
function Fj(e) {
if (!Nj(e) || Lj(e) || lN(e))
return !1;
const { localName: t } = e;
if (["input", "select", "textarea", "button"].indexOf(t) >= 0)
return !0;
const i = {
a: () => e.hasAttribute("href"),
audio: () => e.hasAttribute("controls"),
video: () => e.hasAttribute("controls")
};
return t in i ? i[t]() : uN(e) ? !0 : Ij(e);
}
function cN(e) {
return e ? Nj(e) && Fj(e) && !sN(e) : !1;
}
var dN = [
"input:not(:disabled):not([disabled])",
"select:not(:disabled):not([disabled])",
"textarea:not(:disabled):not([disabled])",
"embed",
"iframe",
"object",
"a[href]",
"area[href]",
"button:not(:disabled):not([disabled])",
"[tabindex]",
"audio[controls]",
"video[controls]",
"*[tabindex]:not([aria-disabled])",
"*[contenteditable]"
], fN = dN.join(), pN = (e) => e.offsetWidth > 0 && e.offsetHeight > 0;
function Bj(e) {
const t = Array.from(
e.querySelectorAll(fN)
);
return t.unshift(e), t.filter((n) => Fj(n) && pN(n));
}
var Ow, hN = (Ow = Pw.default) != null ? Ow : Pw, _j = (e) => {
const {
initialFocusRef: t,
finalFocusRef: n,
contentRef: i,
restoreFocus: o,
children: l,
isDisabled: f,
autoFocus: h,
persistentFocus: y,
lockFocusAcrossFrames: m
} = e, x = Q(() => {
t != null && t.current ? t.current.focus() : i != null && i.current && Bj(i.current).length === 0 && requestAnimationFrame(() => {
var M;
(M = i.current) == null || M.focus();
});
}, [t, i]), b = Q(() => {
var j;
(j = n == null ? void 0 : n.current) == null || j.focus();
}, [n]), E = o && !n;
return /* @__PURE__ */ c.jsx(
hN,
{
crossFrame: m,
persistentFocus: y,
autoFocus: h,
disabled: f,
onActivation: x,
onDeactivation: b,
returnFocus: E,
children: l
}
);
};
_j.displayName = "FocusLock";
var vN = TP ? bo : rt;
function Tx(e, t = []) {
const n = He(e);
return vN(() => {
n.current = e;
}), Q((...i) => {
var o;
return (o = n.current) == null ? void 0 : o.call(n, ...i);
}, t);
}
function mN(e, t, n, i) {
const o = Tx(t);
return rt(() => {
var l;
const f = (l = U3(n)) != null ? l : document;
if (t)
return f.addEventListener(e, o, i), () => {
f.removeEventListener(e, o, i);
};
}, [e, n, i, o, t]), () => {
var l;
((l = U3(n)) != null ? l : document).removeEventListener(e, o, i);
};
}
function gN(e, t) {
const n = bi();
return an(
() => e || [t, n].filter(Boolean).join("-"),
[e, t, n]
);
}
function yN(e, t) {
const n = e !== void 0;
return [n, n && typeof e < "u" ? e : t];
}
function Gl(e = {}) {
const {
onClose: t,
onOpen: n,
isOpen: i,
id: o
} = e, l = Tx(n), f = Tx(t), [h, y] = qe(e.defaultIsOpen || !1), [m, x] = yN(i, h), b = gN(o, "disclosure"), E = Q(() => {
m || y(!1), f == null || f();
}, [m, f]), j = Q(() => {
m || y(!0), l == null || l();
}, [m, l]), M = Q(() => {
(x ? E : j)();
}, [x, j, E]);
return {
isOpen: !!x,
onOpen: j,
onClose: E,
onToggle: M,
isControlled: m,
getButtonProps: (R = {}) => ({
...R,
"aria-expanded": x,
"aria-controls": b,
onClick: kR(R.onClick, M)
}),
getDisclosureProps: (R = {}) => ({
...R,
hidden: !x,
id: b
})
};
}
var PS = $e(function(t, n) {
const { htmlSize: i, ...o } = t, l = Da("Input", o), f = ar(o), h = mS(f), y = At("chakra-input", t.className);
return /* @__PURE__ */ c.jsx(
Be.input,
{
size: i,
...h,
__css: l.field,
ref: n,
className: y
}
);
});
PS.displayName = "Input";
PS.id = "Input";
var [xN, Uj] = Qn({
name: "ListStylesContext",
errorMessage: `useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "
" `
}), OS = $e(function(t, n) {
const i = Da("List", t), {
children: o,
styleType: l = "none",
stylePosition: f,
spacing: h,
...y
} = ar(t), m = vS(o), b = h ? { ["& > *:not(style) ~ *:not(style)"]: { mt: h } } : {};
return /* @__PURE__ */ c.jsx(xN, { value: i, children: /* @__PURE__ */ c.jsx(
Be.ul,
{
ref: n,
listStyleType: l,
listStylePosition: f,
role: "list",
__css: { ...i.container, ...b },
...y,
children: m
}
) });
});
OS.displayName = "List";
var SN = $e((e, t) => {
const { as: n, ...i } = e;
return /* @__PURE__ */ c.jsx(OS, { ref: t, as: "ol", styleType: "decimal", marginStart: "1em", ...i });
});
SN.displayName = "OrderedList";
var Hj = $e(function(t, n) {
const { as: i, ...o } = t;
return /* @__PURE__ */ c.jsx(OS, { ref: n, as: "ul", styleType: "initial", marginStart: "1em", ...o });
});
Hj.displayName = "UnorderedList";
var uh = $e(function(t, n) {
const i = Uj();
return /* @__PURE__ */ c.jsx(Be.li, { ref: n, ...t, __css: i.item });
});
uh.displayName = "ListItem";
var bN = $e(function(t, n) {
const i = Uj();
return /* @__PURE__ */ c.jsx(Zr, { ref: n, role: "presentation", ...t, __css: i.icon });
});
bN.displayName = "ListIcon";
var _i = $e(function(t, n) {
const {
templateAreas: i,
gap: o,
rowGap: l,
columnGap: f,
column: h,
row: y,
autoFlow: m,
autoRows: x,
templateRows: b,
autoColumns: E,
templateColumns: j,
...M
} = t, R = {
display: "grid",
gridTemplateAreas: i,
gridGap: o,
gridRowGap: l,
gridColumnGap: f,
gridAutoColumns: E,
gridColumn: h,
gridRow: y,
gridAutoFlow: m,
gridAutoRows: x,
gridTemplateRows: b,
gridTemplateColumns: j
};
return /* @__PURE__ */ c.jsx(Be.div, { ref: n, __css: R, ...M });
});
_i.displayName = "Grid";
function Vj(e, t) {
return Array.isArray(e) ? e.map((n) => n === null ? null : t(n)) : nx(e) ? Object.keys(e).reduce((n, i) => (n[i] = t(e[i]), n), {}) : e != null ? t(e) : null;
}
var s0 = Be("div", {
baseStyle: {
flex: 1,
justifySelf: "stretch",
alignSelf: "stretch"
}
});
s0.displayName = "Spacer";
var Wj = (e) => /* @__PURE__ */ c.jsx(
Be.div,
{
className: "chakra-stack__item",
...e,
__css: {
display: "inline-block",
flex: "0 0 auto",
minWidth: 0,
...e.__css
}
}
);
Wj.displayName = "StackItem";
var Dx = "& > *:not(style) ~ *:not(style)";
function CN(e) {
const { spacing: t, direction: n } = e, i = {
column: {
marginTop: t,
marginEnd: 0,
marginBottom: 0,
marginStart: 0
},
row: { marginTop: 0, marginEnd: 0, marginBottom: 0, marginStart: t },
"column-reverse": {
marginTop: 0,
marginEnd: 0,
marginBottom: t,
marginStart: 0
},
"row-reverse": {
marginTop: 0,
marginEnd: t,
marginBottom: 0,
marginStart: 0
}
};
return {
flexDirection: n,
[Dx]: Vj(
n,
(o) => i[o]
)
};
}
function wN(e) {
const { spacing: t, direction: n } = e, i = {
column: {
my: t,
mx: 0,
borderLeftWidth: 0,
borderBottomWidth: "1px"
},
"column-reverse": {
my: t,
mx: 0,
borderLeftWidth: 0,
borderBottomWidth: "1px"
},
row: {
mx: t,
my: 0,
borderLeftWidth: "1px",
borderBottomWidth: 0
},
"row-reverse": {
mx: t,
my: 0,
borderLeftWidth: "1px",
borderBottomWidth: 0
}
};
return {
"&": Vj(
n,
(o) => i[o]
)
};
}
var AS = $e((e, t) => {
const {
isInline: n,
direction: i,
align: o,
justify: l,
spacing: f = "0.5rem",
wrap: h,
children: y,
divider: m,
className: x,
shouldWrapChildren: b,
...E
} = e, j = n ? "row" : i ?? "column", M = an(
() => CN({ direction: j, spacing: f }),
[j, f]
), R = an(
() => wN({ spacing: f, direction: j }),
[f, j]
), k = !!m, A = !b && !k, L = an(() => {
const I = vS(y);
return A ? I : I.map((_, U) => {
const B = typeof _.key < "u" ? _.key : U, q = U + 1 === I.length, G = b ? /* @__PURE__ */ c.jsx(Wj, { children: _ }, B) : _;
if (!k)
return G;
const H = Ci(
m,
{
__css: R
}
), le = q ? null : H;
return /* @__PURE__ */ c.jsxs(L6, { children: [
G,
le
] }, B);
});
}, [
m,
R,
k,
A,
b,
y
]), z = At("chakra-stack", x);
return /* @__PURE__ */ c.jsx(
Be.div,
{
ref: t,
display: "flex",
alignItems: o,
justifyContent: l,
flexDirection: M.flexDirection,
flexWrap: h,
className: z,
__css: k ? {} : { [Dx]: M[Dx] },
...E,
children: L
}
);
});
AS.displayName = "Stack";
var Bt = $e((e, t) => /* @__PURE__ */ c.jsx(AS, { align: "center", ...e, direction: "column", ref: t }));
Bt.displayName = "VStack";
var wf = $e((e, t) => /* @__PURE__ */ c.jsx(AS, { align: "center", ...e, direction: "row", ref: t }));
wf.displayName = "HStack";
var Bi = $e(function(t, n) {
const i = Xl("Heading", t), { className: o, ...l } = ar(t);
return /* @__PURE__ */ c.jsx(
Be.h2,
{
ref: n,
className: At("chakra-heading", t.className),
...l,
__css: i
}
);
});
Bi.displayName = "Heading";
var Ut = Be("div");
Ut.displayName = "Box";
var Gj = $e(function(t, n) {
const { size: i, centerContent: o = !0, ...l } = t, f = o ? { display: "flex", alignItems: "center", justifyContent: "center" } : {};
return /* @__PURE__ */ c.jsx(
Ut,
{
ref: n,
boxSize: i,
__css: {
...f,
flexShrink: 0,
flexGrow: 0
},
...l
}
);
});
Gj.displayName = "Square";
var EN = $e(function(t, n) {
const { size: i, ...o } = t;
return /* @__PURE__ */ c.jsx(Gj, { size: i, ref: n, borderRadius: "9999px", ...o });
});
EN.displayName = "Circle";
var tc = $e(function(t, n) {
const i = Xl("Link", t), { className: o, isExternal: l, ...f } = ar(t);
return /* @__PURE__ */ c.jsx(
Be.a,
{
target: l ? "_blank" : void 0,
rel: l ? "noopener" : void 0,
ref: n,
className: At("chakra-link", o),
...f,
__css: i
}
);
});
tc.displayName = "Link";
var qj = $e(function(t, n) {
const i = Xl("Badge", t), { className: o, ...l } = ar(t);
return /* @__PURE__ */ c.jsx(
Be.span,
{
ref: n,
className: At("chakra-badge", t.className),
...l,
__css: {
display: "inline-block",
whiteSpace: "nowrap",
verticalAlign: "middle",
...i
}
}
);
});
qj.displayName = "Badge";
var Yj = Be("div", {
baseStyle: {
display: "flex",
alignItems: "center",
justifyContent: "center"
}
});
Yj.displayName = "Center";
var jN = {
horizontal: {
insetStart: "50%",
transform: "translateX(-50%)"
},
vertical: {
top: "50%",
transform: "translateY(-50%)"
},
both: {
insetStart: "50%",
top: "50%",
transform: "translate(-50%, -50%)"
}
};
$e(
function(t, n) {
const { axis: i = "both", ...o } = t;
return /* @__PURE__ */ c.jsx(
Be.div,
{
ref: n,
__css: jN[i],
...o,
position: "absolute"
}
);
}
);
var Qj = $e(function(t, n) {
const {
borderLeftWidth: i,
borderBottomWidth: o,
borderTopWidth: l,
borderRightWidth: f,
borderWidth: h,
borderStyle: y,
borderColor: m,
...x
} = Xl("Divider", t), {
className: b,
orientation: E = "horizontal",
__css: j,
...M
} = ar(t), R = {
vertical: {
borderLeftWidth: i || f || h || "1px",
height: "100%"
},
horizontal: {
borderBottomWidth: o || l || h || "1px",
width: "100%"
}
};
return /* @__PURE__ */ c.jsx(
Be.hr,
{
ref: n,
"aria-orientation": E,
...M,
__css: {
...x,
border: "0",
borderColor: m,
borderStyle: y,
...R[E],
...j
},
className: At("chakra-divider", b)
}
);
});
Qj.displayName = "Divider";
function TN(e) {
const { key: t } = e;
return t.length === 1 || t.length > 1 && /[^a-zA-Z0-9]/.test(t);
}
function DN(e = {}) {
const { timeout: t = 300, preventDefault: n = () => !0 } = e, [i, o] = qe([]), l = He(), f = () => {
l.current && (clearTimeout(l.current), l.current = null);
}, h = () => {
f(), l.current = setTimeout(() => {
o([]), l.current = null;
}, t);
};
rt(() => f, []);
function y(m) {
return (x) => {
if (x.key === "Backspace") {
const b = [...i];
b.pop(), o(b);
return;
}
if (TN(x)) {
const b = i.concat(x.key);
n(x) && (x.preventDefault(), x.stopPropagation()), o(b), m(b.join("")), h();
}
};
}
return y;
}
function MN(e, t, n, i) {
if (t == null)
return i;
if (!i)
return e.find(
(f) => n(f).toLowerCase().startsWith(t.toLowerCase())
);
const o = e.filter(
(l) => n(l).toLowerCase().startsWith(t.toLowerCase())
);
if (o.length > 0) {
let l;
return o.includes(i) ? (l = o.indexOf(i) + 1, l === o.length && (l = 0), o[l]) : (l = e.indexOf(o[0]), e[l]);
}
return i;
}
function RN() {
const e = He(/* @__PURE__ */ new Map()), t = e.current, n = Q((o, l, f, h) => {
e.current.set(f, { type: l, el: o, options: h }), o.addEventListener(l, f, h);
}, []), i = Q(
(o, l, f, h) => {
o.removeEventListener(l, f, h), e.current.delete(f);
},
[]
);
return rt(
() => () => {
t.forEach((o, l) => {
i(o.el, o.type, l, o.options);
});
},
[i, t]
), { add: n, remove: i };
}
function j2(e) {
const t = e.target, { tagName: n, isContentEditable: i } = t;
return n !== "INPUT" && n !== "TEXTAREA" && i !== !0;
}
function Xj(e = {}) {
const {
ref: t,
isDisabled: n,
isFocusable: i,
clickOnEnter: o = !0,
clickOnSpace: l = !0,
onMouseDown: f,
onMouseUp: h,
onClick: y,
onKeyDown: m,
onKeyUp: x,
tabIndex: b,
onMouseOver: E,
onMouseLeave: j,
...M
} = e, [R, k] = qe(!0), [A, L] = qe(!1), z = RN(), I = ($) => {
$ && $.tagName !== "BUTTON" && k(!1);
}, _ = R ? b : b || 0, U = n && !i, B = Q(
($) => {
if (n) {
$.stopPropagation(), $.preventDefault();
return;
}
$.currentTarget.focus(), y == null || y($);
},
[n, y]
), q = Q(
($) => {
A && j2($) && ($.preventDefault(), $.stopPropagation(), L(!1), z.remove(document, "keyup", q, !1));
},
[A, z]
), J = Q(
($) => {
if (m == null || m($), n || $.defaultPrevented || $.metaKey || !j2($.nativeEvent) || R)
return;
const Y = o && $.key === "Enter";
l && $.key === " " && ($.preventDefault(), L(!0)), Y && ($.preventDefault(), $.currentTarget.click()), z.add(document, "keyup", q, !1);
},
[
n,
R,
m,
o,
l,
z,
q
]
), G = Q(
($) => {
if (x == null || x($), n || $.defaultPrevented || $.metaKey || !j2($.nativeEvent) || R)
return;
l && $.key === " " && ($.preventDefault(), L(!1), $.currentTarget.click());
},
[l, R, n, x]
), H = Q(
($) => {
$.button === 0 && (L(!1), z.remove(document, "mouseup", H, !1));
},
[z]
), le = Q(
($) => {
if ($.button !== 0)
return;
if (n) {
$.stopPropagation(), $.preventDefault();
return;
}
R || L(!0), $.currentTarget.focus({ preventScroll: !0 }), z.add(document, "mouseup", H, !1), f == null || f($);
},
[n, R, f, z, H]
), ae = Q(
($) => {
$.button === 0 && (R || L(!1), h == null || h($));
},
[h, R]
), he = Q(
($) => {
if (n) {
$.preventDefault();
return;
}
E == null || E($);
},
[n, E]
), Te = Q(
($) => {
A && ($.preventDefault(), L(!1)), j == null || j($);
},
[A, j]
), xe = Rn(t, I);
return R ? {
...M,
ref: xe,
type: "button",
"aria-disabled": U ? void 0 : n,
disabled: U,
onClick: B,
onMouseDown: f,
onMouseUp: h,
onKeyUp: x,
onKeyDown: m,
onMouseOver: E,
onMouseLeave: j
} : {
...M,
ref: xe,
role: "button",
"data-active": Yt(A),
"aria-disabled": n ? "true" : void 0,
tabIndex: U ? void 0 : _,
onClick: B,
onMouseDown: le,
onMouseUp: ae,
onKeyUp: G,
onKeyDown: J,
onMouseOver: he,
onMouseLeave: Te
};
}
function kN(e) {
const t = e.current;
if (!t)
return !1;
const n = oN(t);
return !n || t.contains(n) ? !1 : !!cN(n);
}
function Kj(e, t) {
const { shouldFocus: n, visible: i, focusRef: o } = t, l = n && !i;
fc(() => {
if (!l || kN(e))
return;
const f = (o == null ? void 0 : o.current) || e.current;
f && requestAnimationFrame(() => {
f.focus();
});
}, [l, e, o]);
}
var PN = {
preventScroll: !0,
shouldFocus: !1
};
function ON(e, t = PN) {
const { focusRef: n, preventScroll: i, shouldFocus: o, visible: l } = t, f = AN(e) ? e.current : e, h = o && l, y = He(h), m = He(l);
of(() => {
!m.current && l && (y.current = h), m.current = l;
}, [l, h]);
const x = Q(() => {
if (!(!l || !f || !y.current) && (y.current = !1, !f.contains(document.activeElement)))
if (n != null && n.current)
requestAnimationFrame(() => {
var b;
(b = n.current) == null || b.focus({ preventScroll: i });
});
else {
const b = Bj(f);
b.length > 0 && requestAnimationFrame(() => {
b[0].focus({ preventScroll: i });
});
}
}, [l, i, f, n]);
fc(() => {
x();
}, [x]), ec(f, "transitionend", x);
}
function AN(e) {
return "current" in e;
}
var Ud = (e, t) => ({
var: e,
varRef: t ? `var(${e}, ${t})` : `var(${e})`
}), Rr = {
arrowShadowColor: Ud("--popper-arrow-shadow-color"),
arrowSize: Ud("--popper-arrow-size", "8px"),
arrowSizeHalf: Ud("--popper-arrow-size-half"),
arrowBg: Ud("--popper-arrow-bg"),
transformOrigin: Ud("--popper-transform-origin"),
arrowOffset: Ud("--popper-arrow-offset")
};
function NN(e) {
if (e.includes("top"))
return "1px 1px 1px 0 var(--popper-arrow-shadow-color)";
if (e.includes("bottom"))
return "-1px -1px 1px 0 var(--popper-arrow-shadow-color)";
if (e.includes("right"))
return "-1px 1px 1px 0 var(--popper-arrow-shadow-color)";
if (e.includes("left"))
return "1px -1px 1px 0 var(--popper-arrow-shadow-color)";
}
var zN = {
top: "bottom center",
"top-start": "bottom left",
"top-end": "bottom right",
bottom: "top center",
"bottom-start": "top left",
"bottom-end": "top right",
left: "right center",
"left-start": "right top",
"left-end": "right bottom",
right: "left center",
"right-start": "left top",
"right-end": "left bottom"
}, IN = (e) => zN[e], Aw = {
scroll: !0,
resize: !0
};
function LN(e) {
let t;
return typeof e == "object" ? t = {
enabled: !0,
options: { ...Aw, ...e }
} : t = {
enabled: e,
options: Aw
}, t;
}
var FN = {
name: "matchWidth",
enabled: !0,
phase: "beforeWrite",
requires: ["computeStyles"],
fn: ({ state: e }) => {
e.styles.popper.width = `${e.rects.reference.width}px`;
},
effect: ({ state: e }) => () => {
const t = e.elements.reference;
e.elements.popper.style.width = `${t.offsetWidth}px`;
}
}, BN = {
name: "transformOrigin",
enabled: !0,
phase: "write",
fn: ({ state: e }) => {
Nw(e);
},
effect: ({ state: e }) => () => {
Nw(e);
}
}, Nw = (e) => {
e.elements.popper.style.setProperty(
Rr.transformOrigin.var,
IN(e.placement)
);
}, _N = {
name: "positionArrow",
enabled: !0,
phase: "afterWrite",
fn: ({ state: e }) => {
UN(e);
}
}, UN = (e) => {
var t;
if (!e.placement)
return;
const n = HN(e.placement);
if ((t = e.elements) != null && t.arrow && n) {
Object.assign(e.elements.arrow.style, {
[n.property]: n.value,
width: Rr.arrowSize.varRef,
height: Rr.arrowSize.varRef,
zIndex: -1
});
const i = {
[Rr.arrowSizeHalf.var]: `calc(${Rr.arrowSize.varRef} / 2)`,
[Rr.arrowOffset.var]: `calc(${Rr.arrowSizeHalf.varRef} * -1)`
};
for (const o in i)
e.elements.arrow.style.setProperty(o, i[o]);
}
}, HN = (e) => {
if (e.startsWith("top"))
return { property: "bottom", value: Rr.arrowOffset.varRef };
if (e.startsWith("bottom"))
return { property: "top", value: Rr.arrowOffset.varRef };
if (e.startsWith("left"))
return { property: "right", value: Rr.arrowOffset.varRef };
if (e.startsWith("right"))
return { property: "left", value: Rr.arrowOffset.varRef };
}, VN = {
name: "innerArrow",
enabled: !0,
phase: "main",
requires: ["arrow"],
fn: ({ state: e }) => {
zw(e);
},
effect: ({ state: e }) => () => {
zw(e);
}
}, zw = (e) => {
if (!e.elements.arrow)
return;
const t = e.elements.arrow.querySelector(
"[data-popper-arrow-inner]"
);
if (!t)
return;
const n = NN(e.placement);
n && t.style.setProperty("--popper-arrow-default-shadow", n), Object.assign(t.style, {
transform: "rotate(45deg)",
background: Rr.arrowBg.varRef,
top: 0,
left: 0,
width: "100%",
height: "100%",
position: "absolute",
zIndex: "inherit",
boxShadow: "var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"
});
}, WN = {
"start-start": { ltr: "left-start", rtl: "right-start" },
"start-end": { ltr: "left-end", rtl: "right-end" },
"end-start": { ltr: "right-start", rtl: "left-start" },
"end-end": { ltr: "right-end", rtl: "left-end" },
start: { ltr: "left", rtl: "right" },
end: { ltr: "right", rtl: "left" }
}, GN = {
"auto-start": "auto-end",
"auto-end": "auto-start",
"top-start": "top-end",
"top-end": "top-start",
"bottom-start": "bottom-end",
"bottom-end": "bottom-start"
};
function qN(e, t = "ltr") {
var n, i;
const o = ((n = WN[e]) == null ? void 0 : n[t]) || e;
return t === "ltr" ? o : (i = GN[e]) != null ? i : o;
}
var ni = "top", Ui = "bottom", Hi = "right", ri = "left", l0 = "auto", _h = [ni, Ui, Hi, ri], df = "start", wh = "end", YN = "clippingParents", Zj = "viewport", ah = "popper", QN = "reference", Iw = /* @__PURE__ */ _h.reduce(function(e, t) {
return e.concat([t + "-" + df, t + "-" + wh]);
}, []), Jj = /* @__PURE__ */ [].concat(_h, [l0]).reduce(function(e, t) {
return e.concat([t, t + "-" + df, t + "-" + wh]);
}, []), XN = "beforeRead", KN = "read", ZN = "afterRead", JN = "beforeMain", $N = "main", ez = "afterMain", tz = "beforeWrite", nz = "write", rz = "afterWrite", Mx = [XN, KN, ZN, JN, $N, ez, tz, nz, rz];
function rs(e) {
return e ? (e.nodeName || "").toLowerCase() : null;
}
function Vi(e) {
if (e == null)
return window;
if (e.toString() !== "[object Window]") {
var t = e.ownerDocument;
return t && t.defaultView || window;
}
return e;
}
function oc(e) {
var t = Vi(e).Element;
return e instanceof t || e instanceof Element;
}
function Si(e) {
var t = Vi(e).HTMLElement;
return e instanceof t || e instanceof HTMLElement;
}
function NS(e) {
if (typeof ShadowRoot > "u")
return !1;
var t = Vi(e).ShadowRoot;
return e instanceof t || e instanceof ShadowRoot;
}
function az(e) {
var t = e.state;
Object.keys(t.elements).forEach(function(n) {
var i = t.styles[n] || {}, o = t.attributes[n] || {}, l = t.elements[n];
!Si(l) || !rs(l) || (Object.assign(l.style, i), Object.keys(o).forEach(function(f) {
var h = o[f];
h === !1 ? l.removeAttribute(f) : l.setAttribute(f, h === !0 ? "" : h);
}));
});
}
function iz(e) {
var t = e.state, n = {
popper: {
position: t.options.strategy,
left: "0",
top: "0",
margin: "0"
},
arrow: {
position: "absolute"
},
reference: {}
};
return Object.assign(t.elements.popper.style, n.popper), t.styles = n, t.elements.arrow && Object.assign(t.elements.arrow.style, n.arrow), function() {
Object.keys(t.elements).forEach(function(i) {
var o = t.elements[i], l = t.attributes[i] || {}, f = Object.keys(t.styles.hasOwnProperty(i) ? t.styles[i] : n[i]), h = f.reduce(function(y, m) {
return y[m] = "", y;
}, {});
!Si(o) || !rs(o) || (Object.assign(o.style, h), Object.keys(l).forEach(function(y) {
o.removeAttribute(y);
}));
});
};
}
const oz = {
name: "applyStyles",
enabled: !0,
phase: "write",
fn: az,
effect: iz,
requires: ["computeStyles"]
};
function yo(e) {
return e.split("-")[0];
}
var nc = Math.max, Hg = Math.min, ff = Math.round;
function Rx() {
var e = navigator.userAgentData;
return e != null && e.brands ? e.brands.map(function(t) {
return t.brand + "/" + t.version;
}).join(" ") : navigator.userAgent;
}
function $j() {
return !/^((?!chrome|android).)*safari/i.test(Rx());
}
function pf(e, t, n) {
t === void 0 && (t = !1), n === void 0 && (n = !1);
var i = e.getBoundingClientRect(), o = 1, l = 1;
t && Si(e) && (o = e.offsetWidth > 0 && ff(i.width) / e.offsetWidth || 1, l = e.offsetHeight > 0 && ff(i.height) / e.offsetHeight || 1);
var f = oc(e) ? Vi(e) : window, h = f.visualViewport, y = !$j() && n, m = (i.left + (y && h ? h.offsetLeft : 0)) / o, x = (i.top + (y && h ? h.offsetTop : 0)) / l, b = i.width / o, E = i.height / l;
return {
width: b,
height: E,
top: x,
right: m + b,
bottom: x + E,
left: m,
x: m,
y: x
};
}
function zS(e) {
var t = pf(e), n = e.offsetWidth, i = e.offsetHeight;
return Math.abs(t.width - n) <= 1 && (n = t.width), Math.abs(t.height - i) <= 1 && (i = t.height), {
x: e.offsetLeft,
y: e.offsetTop,
width: n,
height: i
};
}
function eT(e, t) {
var n = t.getRootNode && t.getRootNode();
if (e.contains(t))
return !0;
if (n && NS(n)) {
var i = t;
do {
if (i && e.isSameNode(i))
return !0;
i = i.parentNode || i.host;
} while (i);
}
return !1;
}
function So(e) {
return Vi(e).getComputedStyle(e);
}
function sz(e) {
return ["table", "td", "th"].indexOf(rs(e)) >= 0;
}
function Jl(e) {
return ((oc(e) ? e.ownerDocument : (
// $FlowFixMe[prop-missing]
e.document
)) || window.document).documentElement;
}
function u0(e) {
return rs(e) === "html" ? e : (
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
// $FlowFixMe[incompatible-return]
// $FlowFixMe[prop-missing]
e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
e.parentNode || // DOM Element detected
(NS(e) ? e.host : null) || // ShadowRoot detected
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
Jl(e)
);
}
function Lw(e) {
return !Si(e) || // https://github.com/popperjs/popper-core/issues/837
So(e).position === "fixed" ? null : e.offsetParent;
}
function lz(e) {
var t = /firefox/i.test(Rx()), n = /Trident/i.test(Rx());
if (n && Si(e)) {
var i = So(e);
if (i.position === "fixed")
return null;
}
var o = u0(e);
for (NS(o) && (o = o.host); Si(o) && ["html", "body"].indexOf(rs(o)) < 0; ) {
var l = So(o);
if (l.transform !== "none" || l.perspective !== "none" || l.contain === "paint" || ["transform", "perspective"].indexOf(l.willChange) !== -1 || t && l.willChange === "filter" || t && l.filter && l.filter !== "none")
return o;
o = o.parentNode;
}
return null;
}
function Uh(e) {
for (var t = Vi(e), n = Lw(e); n && sz(n) && So(n).position === "static"; )
n = Lw(n);
return n && (rs(n) === "html" || rs(n) === "body" && So(n).position === "static") ? t : n || lz(e) || t;
}
function IS(e) {
return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
}
function fh(e, t, n) {
return nc(e, Hg(t, n));
}
function uz(e, t, n) {
var i = fh(e, t, n);
return i > n ? n : i;
}
function tT() {
return {
top: 0,
right: 0,
bottom: 0,
left: 0
};
}
function nT(e) {
return Object.assign({}, tT(), e);
}
function rT(e, t) {
return t.reduce(function(n, i) {
return n[i] = e, n;
}, {});
}
var cz = function(t, n) {
return t = typeof t == "function" ? t(Object.assign({}, n.rects, {
placement: n.placement
})) : t, nT(typeof t != "number" ? t : rT(t, _h));
};
function dz(e) {
var t, n = e.state, i = e.name, o = e.options, l = n.elements.arrow, f = n.modifiersData.popperOffsets, h = yo(n.placement), y = IS(h), m = [ri, Hi].indexOf(h) >= 0, x = m ? "height" : "width";
if (!(!l || !f)) {
var b = cz(o.padding, n), E = zS(l), j = y === "y" ? ni : ri, M = y === "y" ? Ui : Hi, R = n.rects.reference[x] + n.rects.reference[y] - f[y] - n.rects.popper[x], k = f[y] - n.rects.reference[y], A = Uh(l), L = A ? y === "y" ? A.clientHeight || 0 : A.clientWidth || 0 : 0, z = R / 2 - k / 2, I = b[j], _ = L - E[x] - b[M], U = L / 2 - E[x] / 2 + z, B = fh(I, U, _), q = y;
n.modifiersData[i] = (t = {}, t[q] = B, t.centerOffset = B - U, t);
}
}
function fz(e) {
var t = e.state, n = e.options, i = n.element, o = i === void 0 ? "[data-popper-arrow]" : i;
if (o != null && !(typeof o == "string" && (o = t.elements.popper.querySelector(o), !o))) {
if (process.env.NODE_ENV !== "production" && (Si(o) || console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', "To use an SVG arrow, wrap it in an HTMLElement that will be used as", "the arrow."].join(" "))), !eT(t.elements.popper, o)) {
process.env.NODE_ENV !== "production" && console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" "));
return;
}
t.elements.arrow = o;
}
}
const pz = {
name: "arrow",
enabled: !0,
phase: "main",
fn: dz,
effect: fz,
requires: ["popperOffsets"],
requiresIfExists: ["preventOverflow"]
};
function hf(e) {
return e.split("-")[1];
}
var hz = {
top: "auto",
right: "auto",
bottom: "auto",
left: "auto"
};
function vz(e) {
var t = e.x, n = e.y, i = window, o = i.devicePixelRatio || 1;
return {
x: ff(t * o) / o || 0,
y: ff(n * o) / o || 0
};
}
function Fw(e) {
var t, n = e.popper, i = e.popperRect, o = e.placement, l = e.variation, f = e.offsets, h = e.position, y = e.gpuAcceleration, m = e.adaptive, x = e.roundOffsets, b = e.isFixed, E = f.x, j = E === void 0 ? 0 : E, M = f.y, R = M === void 0 ? 0 : M, k = typeof x == "function" ? x({
x: j,
y: R
}) : {
x: j,
y: R
};
j = k.x, R = k.y;
var A = f.hasOwnProperty("x"), L = f.hasOwnProperty("y"), z = ri, I = ni, _ = window;
if (m) {
var U = Uh(n), B = "clientHeight", q = "clientWidth";
if (U === Vi(n) && (U = Jl(n), So(U).position !== "static" && h === "absolute" && (B = "scrollHeight", q = "scrollWidth")), U = U, o === ni || (o === ri || o === Hi) && l === wh) {
I = Ui;
var J = b && U === _ && _.visualViewport ? _.visualViewport.height : (
// $FlowFixMe[prop-missing]
U[B]
);
R -= J - i.height, R *= y ? 1 : -1;
}
if (o === ri || (o === ni || o === Ui) && l === wh) {
z = Hi;
var G = b && U === _ && _.visualViewport ? _.visualViewport.width : (
// $FlowFixMe[prop-missing]
U[q]
);
j -= G - i.width, j *= y ? 1 : -1;
}
}
var H = Object.assign({
position: h
}, m && hz), le = x === !0 ? vz({
x: j,
y: R
}) : {
x: j,
y: R
};
if (j = le.x, R = le.y, y) {
var ae;
return Object.assign({}, H, (ae = {}, ae[I] = L ? "0" : "", ae[z] = A ? "0" : "", ae.transform = (_.devicePixelRatio || 1) <= 1 ? "translate(" + j + "px, " + R + "px)" : "translate3d(" + j + "px, " + R + "px, 0)", ae));
}
return Object.assign({}, H, (t = {}, t[I] = L ? R + "px" : "", t[z] = A ? j + "px" : "", t.transform = "", t));
}
function mz(e) {
var t = e.state, n = e.options, i = n.gpuAcceleration, o = i === void 0 ? !0 : i, l = n.adaptive, f = l === void 0 ? !0 : l, h = n.roundOffsets, y = h === void 0 ? !0 : h;
if (process.env.NODE_ENV !== "production") {
var m = So(t.elements.popper).transitionProperty || "";
f && ["transform", "top", "right", "bottom", "left"].some(function(b) {
return m.indexOf(b) >= 0;
}) && console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', `
`, 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", `
`, "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
}
var x = {
placement: yo(t.placement),
variation: hf(t.placement),
popper: t.elements.popper,
popperRect: t.rects.popper,
gpuAcceleration: o,
isFixed: t.options.strategy === "fixed"
};
t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, Fw(Object.assign({}, x, {
offsets: t.modifiersData.popperOffsets,
position: t.options.strategy,
adaptive: f,
roundOffsets: y
})))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, Fw(Object.assign({}, x, {
offsets: t.modifiersData.arrow,
position: "absolute",
adaptive: !1,
roundOffsets: y
})))), t.attributes.popper = Object.assign({}, t.attributes.popper, {
"data-popper-placement": t.placement
});
}
const gz = {
name: "computeStyles",
enabled: !0,
phase: "beforeWrite",
fn: mz,
data: {}
};
var ig = {
passive: !0
};
function yz(e) {
var t = e.state, n = e.instance, i = e.options, o = i.scroll, l = o === void 0 ? !0 : o, f = i.resize, h = f === void 0 ? !0 : f, y = Vi(t.elements.popper), m = [].concat(t.scrollParents.reference, t.scrollParents.popper);
return l && m.forEach(function(x) {
x.addEventListener("scroll", n.update, ig);
}), h && y.addEventListener("resize", n.update, ig), function() {
l && m.forEach(function(x) {
x.removeEventListener("scroll", n.update, ig);
}), h && y.removeEventListener("resize", n.update, ig);
};
}
const xz = {
name: "eventListeners",
enabled: !0,
phase: "write",
fn: function() {
},
effect: yz,
data: {}
};
var Sz = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
function Dg(e) {
return e.replace(/left|right|bottom|top/g, function(t) {
return Sz[t];
});
}
var bz = {
start: "end",
end: "start"
};
function Bw(e) {
return e.replace(/start|end/g, function(t) {
return bz[t];
});
}
function LS(e) {
var t = Vi(e), n = t.pageXOffset, i = t.pageYOffset;
return {
scrollLeft: n,
scrollTop: i
};
}
function FS(e) {
return pf(Jl(e)).left + LS(e).scrollLeft;
}
function Cz(e, t) {
var n = Vi(e), i = Jl(e), o = n.visualViewport, l = i.clientWidth, f = i.clientHeight, h = 0, y = 0;
if (o) {
l = o.width, f = o.height;
var m = $j();
(m || !m && t === "fixed") && (h = o.offsetLeft, y = o.offsetTop);
}
return {
width: l,
height: f,
x: h + FS(e),
y
};
}
function wz(e) {
var t, n = Jl(e), i = LS(e), o = (t = e.ownerDocument) == null ? void 0 : t.body, l = nc(n.scrollWidth, n.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), f = nc(n.scrollHeight, n.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), h = -i.scrollLeft + FS(e), y = -i.scrollTop;
return So(o || n).direction === "rtl" && (h += nc(n.clientWidth, o ? o.clientWidth : 0) - l), {
width: l,
height: f,
x: h,
y
};
}
function BS(e) {
var t = So(e), n = t.overflow, i = t.overflowX, o = t.overflowY;
return /auto|scroll|overlay|hidden/.test(n + o + i);
}
function aT(e) {
return ["html", "body", "#document"].indexOf(rs(e)) >= 0 ? e.ownerDocument.body : Si(e) && BS(e) ? e : aT(u0(e));
}
function ph(e, t) {
var n;
t === void 0 && (t = []);
var i = aT(e), o = i === ((n = e.ownerDocument) == null ? void 0 : n.body), l = Vi(i), f = o ? [l].concat(l.visualViewport || [], BS(i) ? i : []) : i, h = t.concat(f);
return o ? h : (
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
h.concat(ph(u0(f)))
);
}
function kx(e) {
return Object.assign({}, e, {
left: e.x,
top: e.y,
right: e.x + e.width,
bottom: e.y + e.height
});
}
function Ez(e, t) {
var n = pf(e, !1, t === "fixed");
return n.top = n.top + e.clientTop, n.left = n.left + e.clientLeft, n.bottom = n.top + e.clientHeight, n.right = n.left + e.clientWidth, n.width = e.clientWidth, n.height = e.clientHeight, n.x = n.left, n.y = n.top, n;
}
function _w(e, t, n) {
return t === Zj ? kx(Cz(e, n)) : oc(t) ? Ez(t, n) : kx(wz(Jl(e)));
}
function jz(e) {
var t = ph(u0(e)), n = ["absolute", "fixed"].indexOf(So(e).position) >= 0, i = n && Si(e) ? Uh(e) : e;
return oc(i) ? t.filter(function(o) {
return oc(o) && eT(o, i) && rs(o) !== "body";
}) : [];
}
function Tz(e, t, n, i) {
var o = t === "clippingParents" ? jz(e) : [].concat(t), l = [].concat(o, [n]), f = l[0], h = l.reduce(function(y, m) {
var x = _w(e, m, i);
return y.top = nc(x.top, y.top), y.right = Hg(x.right, y.right), y.bottom = Hg(x.bottom, y.bottom), y.left = nc(x.left, y.left), y;
}, _w(e, f, i));
return h.width = h.right - h.left, h.height = h.bottom - h.top, h.x = h.left, h.y = h.top, h;
}
function iT(e) {
var t = e.reference, n = e.element, i = e.placement, o = i ? yo(i) : null, l = i ? hf(i) : null, f = t.x + t.width / 2 - n.width / 2, h = t.y + t.height / 2 - n.height / 2, y;
switch (o) {
case ni:
y = {
x: f,
y: t.y - n.height
};
break;
case Ui:
y = {
x: f,
y: t.y + t.height
};
break;
case Hi:
y = {
x: t.x + t.width,
y: h
};
break;
case ri:
y = {
x: t.x - n.width,
y: h
};
break;
default:
y = {
x: t.x,
y: t.y
};
}
var m = o ? IS(o) : null;
if (m != null) {
var x = m === "y" ? "height" : "width";
switch (l) {
case df:
y[m] = y[m] - (t[x] / 2 - n[x] / 2);
break;
case wh:
y[m] = y[m] + (t[x] / 2 - n[x] / 2);
break;
}
}
return y;
}
function Eh(e, t) {
t === void 0 && (t = {});
var n = t, i = n.placement, o = i === void 0 ? e.placement : i, l = n.strategy, f = l === void 0 ? e.strategy : l, h = n.boundary, y = h === void 0 ? YN : h, m = n.rootBoundary, x = m === void 0 ? Zj : m, b = n.elementContext, E = b === void 0 ? ah : b, j = n.altBoundary, M = j === void 0 ? !1 : j, R = n.padding, k = R === void 0 ? 0 : R, A = nT(typeof k != "number" ? k : rT(k, _h)), L = E === ah ? QN : ah, z = e.rects.popper, I = e.elements[M ? L : E], _ = Tz(oc(I) ? I : I.contextElement || Jl(e.elements.popper), y, x, f), U = pf(e.elements.reference), B = iT({
reference: U,
element: z,
strategy: "absolute",
placement: o
}), q = kx(Object.assign({}, z, B)), J = E === ah ? q : U, G = {
top: _.top - J.top + A.top,
bottom: J.bottom - _.bottom + A.bottom,
left: _.left - J.left + A.left,
right: J.right - _.right + A.right
}, H = e.modifiersData.offset;
if (E === ah && H) {
var le = H[o];
Object.keys(G).forEach(function(ae) {
var he = [Hi, Ui].indexOf(ae) >= 0 ? 1 : -1, Te = [ni, Ui].indexOf(ae) >= 0 ? "y" : "x";
G[ae] += le[Te] * he;
});
}
return G;
}
function Dz(e, t) {
t === void 0 && (t = {});
var n = t, i = n.placement, o = n.boundary, l = n.rootBoundary, f = n.padding, h = n.flipVariations, y = n.allowedAutoPlacements, m = y === void 0 ? Jj : y, x = hf(i), b = x ? h ? Iw : Iw.filter(function(M) {
return hf(M) === x;
}) : _h, E = b.filter(function(M) {
return m.indexOf(M) >= 0;
});
E.length === 0 && (E = b, process.env.NODE_ENV !== "production" && console.error(["Popper: The `allowedAutoPlacements` option did not allow any", "placements. Ensure the `placement` option matches the variation", "of the allowed placements.", 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(" ")));
var j = E.reduce(function(M, R) {
return M[R] = Eh(e, {
placement: R,
boundary: o,
rootBoundary: l,
padding: f
})[yo(R)], M;
}, {});
return Object.keys(j).sort(function(M, R) {
return j[M] - j[R];
});
}
function Mz(e) {
if (yo(e) === l0)
return [];
var t = Dg(e);
return [Bw(e), t, Bw(t)];
}
function Rz(e) {
var t = e.state, n = e.options, i = e.name;
if (!t.modifiersData[i]._skip) {
for (var o = n.mainAxis, l = o === void 0 ? !0 : o, f = n.altAxis, h = f === void 0 ? !0 : f, y = n.fallbackPlacements, m = n.padding, x = n.boundary, b = n.rootBoundary, E = n.altBoundary, j = n.flipVariations, M = j === void 0 ? !0 : j, R = n.allowedAutoPlacements, k = t.options.placement, A = yo(k), L = A === k, z = y || (L || !M ? [Dg(k)] : Mz(k)), I = [k].concat(z).reduce(function(se, ve) {
return se.concat(yo(ve) === l0 ? Dz(t, {
placement: ve,
boundary: x,
rootBoundary: b,
padding: m,
flipVariations: M,
allowedAutoPlacements: R
}) : ve);
}, []), _ = t.rects.reference, U = t.rects.popper, B = /* @__PURE__ */ new Map(), q = !0, J = I[0], G = 0; G < I.length; G++) {
var H = I[G], le = yo(H), ae = hf(H) === df, he = [ni, Ui].indexOf(le) >= 0, Te = he ? "width" : "height", xe = Eh(t, {
placement: H,
boundary: x,
rootBoundary: b,
altBoundary: E,
padding: m
}), $ = he ? ae ? Hi : ri : ae ? Ui : ni;
_[Te] > U[Te] && ($ = Dg($));
var Y = Dg($), te = [];
if (l && te.push(xe[le] <= 0), h && te.push(xe[$] <= 0, xe[Y] <= 0), te.every(function(se) {
return se;
})) {
J = H, q = !1;
break;
}
B.set(H, te);
}
if (q)
for (var V = M ? 3 : 1, ne = function(ve) {
var Ce = I.find(function(Ae) {
var Ve = B.get(Ae);
if (Ve)
return Ve.slice(0, ve).every(function(tt) {
return tt;
});
});
if (Ce)
return J = Ce, "break";
}, we = V; we > 0; we--) {
var Ee = ne(we);
if (Ee === "break")
break;
}
t.placement !== J && (t.modifiersData[i]._skip = !0, t.placement = J, t.reset = !0);
}
}
const kz = {
name: "flip",
enabled: !0,
phase: "main",
fn: Rz,
requiresIfExists: ["offset"],
data: {
_skip: !1
}
};
function Uw(e, t, n) {
return n === void 0 && (n = {
x: 0,
y: 0
}), {
top: e.top - t.height - n.y,
right: e.right - t.width + n.x,
bottom: e.bottom - t.height + n.y,
left: e.left - t.width - n.x
};
}
function Hw(e) {
return [ni, Hi, Ui, ri].some(function(t) {
return e[t] >= 0;
});
}
function Pz(e) {
var t = e.state, n = e.name, i = t.rects.reference, o = t.rects.popper, l = t.modifiersData.preventOverflow, f = Eh(t, {
elementContext: "reference"
}), h = Eh(t, {
altBoundary: !0
}), y = Uw(f, i), m = Uw(h, o, l), x = Hw(y), b = Hw(m);
t.modifiersData[n] = {
referenceClippingOffsets: y,
popperEscapeOffsets: m,
isReferenceHidden: x,
hasPopperEscaped: b
}, t.attributes.popper = Object.assign({}, t.attributes.popper, {
"data-popper-reference-hidden": x,
"data-popper-escaped": b
});
}
const Oz = {
name: "hide",
enabled: !0,
phase: "main",
requiresIfExists: ["preventOverflow"],
fn: Pz
};
function Az(e, t, n) {
var i = yo(e), o = [ri, ni].indexOf(i) >= 0 ? -1 : 1, l = typeof n == "function" ? n(Object.assign({}, t, {
placement: e
})) : n, f = l[0], h = l[1];
return f = f || 0, h = (h || 0) * o, [ri, Hi].indexOf(i) >= 0 ? {
x: h,
y: f
} : {
x: f,
y: h
};
}
function Nz(e) {
var t = e.state, n = e.options, i = e.name, o = n.offset, l = o === void 0 ? [0, 0] : o, f = Jj.reduce(function(x, b) {
return x[b] = Az(b, t.rects, l), x;
}, {}), h = f[t.placement], y = h.x, m = h.y;
t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += y, t.modifiersData.popperOffsets.y += m), t.modifiersData[i] = f;
}
const zz = {
name: "offset",
enabled: !0,
phase: "main",
requires: ["popperOffsets"],
fn: Nz
};
function Iz(e) {
var t = e.state, n = e.name;
t.modifiersData[n] = iT({
reference: t.rects.reference,
element: t.rects.popper,
strategy: "absolute",
placement: t.placement
});
}
const Lz = {
name: "popperOffsets",
enabled: !0,
phase: "read",
fn: Iz,
data: {}
};
function Fz(e) {
return e === "x" ? "y" : "x";
}
function Bz(e) {
var t = e.state, n = e.options, i = e.name, o = n.mainAxis, l = o === void 0 ? !0 : o, f = n.altAxis, h = f === void 0 ? !1 : f, y = n.boundary, m = n.rootBoundary, x = n.altBoundary, b = n.padding, E = n.tether, j = E === void 0 ? !0 : E, M = n.tetherOffset, R = M === void 0 ? 0 : M, k = Eh(t, {
boundary: y,
rootBoundary: m,
padding: b,
altBoundary: x
}), A = yo(t.placement), L = hf(t.placement), z = !L, I = IS(A), _ = Fz(I), U = t.modifiersData.popperOffsets, B = t.rects.reference, q = t.rects.popper, J = typeof R == "function" ? R(Object.assign({}, t.rects, {
placement: t.placement
})) : R, G = typeof J == "number" ? {
mainAxis: J,
altAxis: J
} : Object.assign({
mainAxis: 0,
altAxis: 0
}, J), H = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, le = {
x: 0,
y: 0
};
if (U) {
if (l) {
var ae, he = I === "y" ? ni : ri, Te = I === "y" ? Ui : Hi, xe = I === "y" ? "height" : "width", $ = U[I], Y = $ + k[he], te = $ - k[Te], V = j ? -q[xe] / 2 : 0, ne = L === df ? B[xe] : q[xe], we = L === df ? -q[xe] : -B[xe], Ee = t.elements.arrow, se = j && Ee ? zS(Ee) : {
width: 0,
height: 0
}, ve = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : tT(), Ce = ve[he], Ae = ve[Te], Ve = fh(0, B[xe], se[xe]), tt = z ? B[xe] / 2 - V - Ve - Ce - G.mainAxis : ne - Ve - Ce - G.mainAxis, at = z ? -B[xe] / 2 + V + Ve + Ae + G.mainAxis : we + Ve + Ae + G.mainAxis, ze = t.elements.arrow && Uh(t.elements.arrow), Qe = ze ? I === "y" ? ze.clientTop || 0 : ze.clientLeft || 0 : 0, Et = (ae = H == null ? void 0 : H[I]) != null ? ae : 0, Xe = $ + tt - Et - Qe, ht = $ + at - Et, Ht = fh(j ? Hg(Y, Xe) : Y, $, j ? nc(te, ht) : te);
U[I] = Ht, le[I] = Ht - $;
}
if (h) {
var Ot, on = I === "x" ? ni : ri, En = I === "x" ? Ui : Hi, ee = U[_], We = _ === "y" ? "height" : "width", Fe = ee + k[on], ot = ee - k[En], me = [ni, ri].indexOf(A) !== -1, Le = (Ot = H == null ? void 0 : H[_]) != null ? Ot : 0, Dt = me ? Fe : ee - B[We] - q[We] - Le + G.altAxis, Vt = me ? ee + B[We] + q[We] - Le - G.altAxis : ot, ke = j && me ? uz(Dt, ee, Vt) : fh(j ? Dt : Fe, ee, j ? Vt : ot);
U[_] = ke, le[_] = ke - ee;
}
t.modifiersData[i] = le;
}
}
const _z = {
name: "preventOverflow",
enabled: !0,
phase: "main",
fn: Bz,
requiresIfExists: ["offset"]
};
function Uz(e) {
return {
scrollLeft: e.scrollLeft,
scrollTop: e.scrollTop
};
}
function Hz(e) {
return e === Vi(e) || !Si(e) ? LS(e) : Uz(e);
}
function Vz(e) {
var t = e.getBoundingClientRect(), n = ff(t.width) / e.offsetWidth || 1, i = ff(t.height) / e.offsetHeight || 1;
return n !== 1 || i !== 1;
}
function Wz(e, t, n) {
n === void 0 && (n = !1);
var i = Si(t), o = Si(t) && Vz(t), l = Jl(t), f = pf(e, o, n), h = {
scrollLeft: 0,
scrollTop: 0
}, y = {
x: 0,
y: 0
};
return (i || !i && !n) && ((rs(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
BS(l)) && (h = Hz(t)), Si(t) ? (y = pf(t, !0), y.x += t.clientLeft, y.y += t.clientTop) : l && (y.x = FS(l))), {
x: f.left + h.scrollLeft - y.x,
y: f.top + h.scrollTop - y.y,
width: f.width,
height: f.height
};
}
function Gz(e) {
var t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), i = [];
e.forEach(function(l) {
t.set(l.name, l);
});
function o(l) {
n.add(l.name);
var f = [].concat(l.requires || [], l.requiresIfExists || []);
f.forEach(function(h) {
if (!n.has(h)) {
var y = t.get(h);
y && o(y);
}
}), i.push(l);
}
return e.forEach(function(l) {
n.has(l.name) || o(l);
}), i;
}
function qz(e) {
var t = Gz(e);
return Mx.reduce(function(n, i) {
return n.concat(t.filter(function(o) {
return o.phase === i;
}));
}, []);
}
function Yz(e) {
var t;
return function() {
return t || (t = new Promise(function(n) {
Promise.resolve().then(function() {
t = void 0, n(e());
});
})), t;
};
}
function Nl(e) {
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
n[i - 1] = arguments[i];
return [].concat(n).reduce(function(o, l) {
return o.replace(/%s/, l);
}, e);
}
var _u = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s', Qz = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available', Vw = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
function Xz(e) {
e.forEach(function(t) {
[].concat(Object.keys(t), Vw).filter(function(n, i, o) {
return o.indexOf(n) === i;
}).forEach(function(n) {
switch (n) {
case "name":
typeof t.name != "string" && console.error(Nl(_u, String(t.name), '"name"', '"string"', '"' + String(t.name) + '"'));
break;
case "enabled":
typeof t.enabled != "boolean" && console.error(Nl(_u, t.name, '"enabled"', '"boolean"', '"' + String(t.enabled) + '"'));
break;
case "phase":
Mx.indexOf(t.phase) < 0 && console.error(Nl(_u, t.name, '"phase"', "either " + Mx.join(", "), '"' + String(t.phase) + '"'));
break;
case "fn":
typeof t.fn != "function" && console.error(Nl(_u, t.name, '"fn"', '"function"', '"' + String(t.fn) + '"'));
break;
case "effect":
t.effect != null && typeof t.effect != "function" && console.error(Nl(_u, t.name, '"effect"', '"function"', '"' + String(t.fn) + '"'));
break;
case "requires":
t.requires != null && !Array.isArray(t.requires) && console.error(Nl(_u, t.name, '"requires"', '"array"', '"' + String(t.requires) + '"'));
break;
case "requiresIfExists":
Array.isArray(t.requiresIfExists) || console.error(Nl(_u, t.name, '"requiresIfExists"', '"array"', '"' + String(t.requiresIfExists) + '"'));
break;
case "options":
case "data":
break;
default:
console.error('PopperJS: an invalid property has been provided to the "' + t.name + '" modifier, valid properties are ' + Vw.map(function(i) {
return '"' + i + '"';
}).join(", ") + '; but "' + n + '" was provided.');
}
t.requires && t.requires.forEach(function(i) {
e.find(function(o) {
return o.name === i;
}) == null && console.error(Nl(Qz, String(t.name), i, i));
});
});
});
}
function Kz(e, t) {
var n = /* @__PURE__ */ new Set();
return e.filter(function(i) {
var o = t(i);
if (!n.has(o))
return n.add(o), !0;
});
}
function Zz(e) {
var t = e.reduce(function(n, i) {
var o = n[i.name];
return n[i.name] = o ? Object.assign({}, o, i, {
options: Object.assign({}, o.options, i.options),
data: Object.assign({}, o.data, i.data)
}) : i, n;
}, {});
return Object.keys(t).map(function(n) {
return t[n];
});
}
var Ww = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.", Jz = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.", Gw = {
placement: "bottom",
modifiers: [],
strategy: "absolute"
};
function qw() {
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
t[n] = arguments[n];
return !t.some(function(i) {
return !(i && typeof i.getBoundingClientRect == "function");
});
}
function $z(e) {
e === void 0 && (e = {});
var t = e, n = t.defaultModifiers, i = n === void 0 ? [] : n, o = t.defaultOptions, l = o === void 0 ? Gw : o;
return function(h, y, m) {
m === void 0 && (m = l);
var x = {
placement: "bottom",
orderedModifiers: [],
options: Object.assign({}, Gw, l),
modifiersData: {},
elements: {
reference: h,
popper: y
},
attributes: {},
styles: {}
}, b = [], E = !1, j = {
state: x,
setOptions: function(A) {
var L = typeof A == "function" ? A(x.options) : A;
R(), x.options = Object.assign({}, l, x.options, L), x.scrollParents = {
reference: oc(h) ? ph(h) : h.contextElement ? ph(h.contextElement) : [],
popper: ph(y)
};
var z = qz(Zz([].concat(i, x.options.modifiers)));
if (x.orderedModifiers = z.filter(function(H) {
return H.enabled;
}), process.env.NODE_ENV !== "production") {
var I = Kz([].concat(z, x.options.modifiers), function(H) {
var le = H.name;
return le;
});
if (Xz(I), yo(x.options.placement) === l0) {
var _ = x.orderedModifiers.find(function(H) {
var le = H.name;
return le === "flip";
});
_ || console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
}
var U = So(y), B = U.marginTop, q = U.marginRight, J = U.marginBottom, G = U.marginLeft;
[B, q, J, G].some(function(H) {
return parseFloat(H);
}) && console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "));
}
return M(), j.update();
},
// Sync update – it will always be executed, even if not necessary. This
// is useful for low frequency updates where sync behavior simplifies the
// logic.
// For high frequency updates (e.g. `resize` and `scroll` events), always
// prefer the async Popper#update method
forceUpdate: function() {
if (!E) {
var A = x.elements, L = A.reference, z = A.popper;
if (!qw(L, z)) {
process.env.NODE_ENV !== "production" && console.error(Ww);
return;
}
x.rects = {
reference: Wz(L, Uh(z), x.options.strategy === "fixed"),
popper: zS(z)
}, x.reset = !1, x.placement = x.options.placement, x.orderedModifiers.forEach(function(H) {
return x.modifiersData[H.name] = Object.assign({}, H.data);
});
for (var I = 0, _ = 0; _ < x.orderedModifiers.length; _++) {
if (process.env.NODE_ENV !== "production" && (I += 1, I > 100)) {
console.error(Jz);
break;
}
if (x.reset === !0) {
x.reset = !1, _ = -1;
continue;
}
var U = x.orderedModifiers[_], B = U.fn, q = U.options, J = q === void 0 ? {} : q, G = U.name;
typeof B == "function" && (x = B({
state: x,
options: J,
name: G,
instance: j
}) || x);
}
}
},
// Async and optimistically optimized update – it will not be executed if
// not necessary (debounced to run at most once-per-tick)
update: Yz(function() {
return new Promise(function(k) {
j.forceUpdate(), k(x);
});
}),
destroy: function() {
R(), E = !0;
}
};
if (!qw(h, y))
return process.env.NODE_ENV !== "production" && console.error(Ww), j;
j.setOptions(m).then(function(k) {
!E && m.onFirstUpdate && m.onFirstUpdate(k);
});
function M() {
x.orderedModifiers.forEach(function(k) {
var A = k.name, L = k.options, z = L === void 0 ? {} : L, I = k.effect;
if (typeof I == "function") {
var _ = I({
state: x,
name: A,
instance: j,
options: z
}), U = function() {
};
b.push(_ || U);
}
});
}
function R() {
b.forEach(function(k) {
return k();
}), b = [];
}
return j;
};
}
var eI = [xz, Lz, gz, oz, zz, kz, _z, pz, Oz], tI = /* @__PURE__ */ $z({
defaultModifiers: eI
});
function _S(e = {}) {
const {
enabled: t = !0,
modifiers: n,
placement: i = "bottom",
strategy: o = "absolute",
arrowPadding: l = 8,
eventListeners: f = !0,
offset: h,
gutter: y = 8,
flip: m = !0,
boundary: x = "clippingParents",
preventOverflow: b = !0,
matchWidth: E,
direction: j = "ltr"
} = e, M = He(null), R = He(null), k = He(null), A = qN(i, j), L = He(() => {
}), z = Q(() => {
var G;
!t || !M.current || !R.current || ((G = L.current) == null || G.call(L), k.current = tI(M.current, R.current, {
placement: A,
modifiers: [
VN,
_N,
BN,
{
...FN,
enabled: !!E
},
{
name: "eventListeners",
...LN(f)
},
{
name: "arrow",
options: { padding: l }
},
{
name: "offset",
options: {
offset: h ?? [0, y]
}
},
{
name: "flip",
enabled: !!m,
options: { padding: 8 }
},
{
name: "preventOverflow",
enabled: !!b,
options: { boundary: x }
},
...n ?? []
],
strategy: o
}), k.current.forceUpdate(), L.current = k.current.destroy);
}, [
A,
t,
n,
E,
f,
l,
h,
y,
m,
b,
x,
o
]);
rt(() => () => {
var G;
!M.current && !R.current && ((G = k.current) == null || G.destroy(), k.current = null);
}, []);
const I = Q(
(G) => {
M.current = G, z();
},
[z]
), _ = Q(
(G = {}, H = null) => ({
...G,
ref: Rn(I, H)
}),
[I]
), U = Q(
(G) => {
R.current = G, z();
},
[z]
), B = Q(
(G = {}, H = null) => ({
...G,
ref: Rn(U, H),
style: {
...G.style,
position: o,
minWidth: E ? void 0 : "max-content",
inset: "0 auto auto 0"
}
}),
[o, U, E]
), q = Q((G = {}, H = null) => {
const { size: le, shadowColor: ae, bg: he, style: Te, ...xe } = G;
return {
...xe,
ref: H,
"data-popper-arrow": "",
style: nI(G)
};
}, []), J = Q(
(G = {}, H = null) => ({
...G,
ref: H,
"data-popper-arrow-inner": ""
}),
[]
);
return {
update() {
var G;
(G = k.current) == null || G.update();
},
forceUpdate() {
var G;
(G = k.current) == null || G.forceUpdate();
},
transformOrigin: Rr.transformOrigin.varRef,
referenceRef: I,
popperRef: U,
getPopperProps: B,
getArrowProps: q,
getArrowInnerProps: J,
getReferenceProps: _
};
}
function nI(e) {
const { size: t, shadowColor: n, bg: i, style: o } = e, l = { ...o, position: "absolute" };
return t && (l["--popper-arrow-size"] = t), n && (l["--popper-arrow-shadow-color"] = n), i && (l["--popper-arrow-bg"] = i), l;
}
function US(e = {}) {
const {
onClose: t,
onOpen: n,
isOpen: i,
id: o
} = e, l = kr(n), f = kr(t), [h, y] = qe(e.defaultIsOpen || !1), m = i !== void 0 ? i : h, x = i !== void 0, b = bi(), E = o ?? `disclosure-${b}`, j = Q(() => {
x || y(!1), f == null || f();
}, [x, f]), M = Q(() => {
x || y(!0), l == null || l();
}, [x, l]), R = Q(() => {
m ? j() : M();
}, [m, M, j]);
function k(L = {}) {
return {
...L,
"aria-expanded": m,
"aria-controls": E,
onClick(z) {
var I;
(I = L.onClick) == null || I.call(L, z), R();
}
};
}
function A(L = {}) {
return {
...L,
hidden: !m,
id: E
};
}
return {
isOpen: m,
onOpen: M,
onClose: j,
onToggle: R,
isControlled: x,
getButtonProps: k,
getDisclosureProps: A
};
}
function rI(e) {
const { ref: t, handler: n, enabled: i = !0 } = e, o = kr(n), f = He({
isPointerDown: !1,
ignoreEmulatedMouseEvents: !1
}).current;
rt(() => {
if (!i)
return;
const h = (b) => {
T2(b, t) && (f.isPointerDown = !0);
}, y = (b) => {
if (f.ignoreEmulatedMouseEvents) {
f.ignoreEmulatedMouseEvents = !1;
return;
}
f.isPointerDown && n && T2(b, t) && (f.isPointerDown = !1, o(b));
}, m = (b) => {
f.ignoreEmulatedMouseEvents = !0, n && f.isPointerDown && T2(b, t) && (f.isPointerDown = !1, o(b));
}, x = oT(t.current);
return x.addEventListener("mousedown", h, !0), x.addEventListener("mouseup", y, !0), x.addEventListener("touchstart", h, !0), x.addEventListener("touchend", m, !0), () => {
x.removeEventListener("mousedown", h, !0), x.removeEventListener("mouseup", y, !0), x.removeEventListener("touchstart", h, !0), x.removeEventListener("touchend", m, !0);
};
}, [n, t, o, f, i]);
}
function T2(e, t) {
var n;
const i = e.target;
return e.button > 0 || i && !oT(i).contains(i) ? !1 : !((n = t.current) != null && n.contains(i));
}
function oT(e) {
var t;
return (t = e == null ? void 0 : e.ownerDocument) != null ? t : document;
}
function sT(e) {
const { isOpen: t, ref: n } = e, [i, o] = qe(t), [l, f] = qe(!1);
return rt(() => {
l || (o(t), f(!0));
}, [t, l, i]), ec(
() => n.current,
"animationend",
() => {
o(t);
}
), {
present: !(t ? !1 : !i),
onComplete() {
var y;
const m = iN(n.current), x = new m.CustomEvent("animationend", { bubbles: !0 });
(y = n.current) == null || y.dispatchEvent(x);
}
};
}
function HS(e) {
const { wasSelected: t, enabled: n, isSelected: i, mode: o = "unmount" } = e;
return !!(!n || i || o === "keepMounted" && t);
}
var [
aI,
iI,
oI,
sI
] = cS(), [lI, Hh] = Qn({
strict: !1,
name: "MenuContext"
});
function uI(e, ...t) {
const n = bi(), i = e || n;
return an(() => t.map((o) => `${o}-${i}`), [i, t]);
}
function lT(e) {
var t;
return (t = e == null ? void 0 : e.ownerDocument) != null ? t : document;
}
function Yw(e) {
return lT(e).activeElement === e;
}
function cI(e = {}) {
const {
id: t,
closeOnSelect: n = !0,
closeOnBlur: i = !0,
initialFocusRef: o,
autoSelect: l = !0,
isLazy: f,
isOpen: h,
defaultIsOpen: y,
onClose: m,
onOpen: x,
placement: b = "bottom-start",
lazyBehavior: E = "unmount",
direction: j,
computePositionOnMount: M = !1,
...R
} = e, k = He(null), A = He(null), L = oI(), z = Q(() => {
requestAnimationFrame(() => {
var Ee;
(Ee = k.current) == null || Ee.focus({ preventScroll: !1 });
});
}, []), I = Q(() => {
const Ee = setTimeout(() => {
var se;
if (o)
(se = o.current) == null || se.focus();
else {
const ve = L.firstEnabled();
ve && ae(ve.index);
}
});
Y.current.add(Ee);
}, [L, o]), _ = Q(() => {
const Ee = setTimeout(() => {
const se = L.lastEnabled();
se && ae(se.index);
});
Y.current.add(Ee);
}, [L]), U = Q(() => {
x == null || x(), l ? I() : z();
}, [l, I, z, x]), { isOpen: B, onOpen: q, onClose: J, onToggle: G } = US({
isOpen: h,
defaultIsOpen: y,
onClose: m,
onOpen: U
});
rI({
enabled: B && i,
ref: k,
handler: (Ee) => {
var se;
(se = A.current) != null && se.contains(Ee.target) || J();
}
});
const H = _S({
...R,
enabled: B || M,
placement: b,
direction: j
}), [le, ae] = qe(-1);
fc(() => {
B || ae(-1);
}, [B]), Kj(k, {
focusRef: A,
visible: B,
shouldFocus: !0
});
const he = sT({ isOpen: B, ref: k }), [Te, xe] = uI(t, "menu-button", "menu-list"), $ = Q(() => {
q(), z();
}, [q, z]), Y = He(/* @__PURE__ */ new Set([]));
gI(() => {
Y.current.forEach((Ee) => clearTimeout(Ee)), Y.current.clear();
});
const te = Q(() => {
q(), I();
}, [I, q]), V = Q(() => {
q(), _();
}, [q, _]), ne = Q(() => {
var Ee, se;
const ve = lT(k.current), Ce = (Ee = k.current) == null ? void 0 : Ee.contains(ve.activeElement);
if (!(B && !Ce))
return;
const Ve = (se = L.item(le)) == null ? void 0 : se.node;
Ve == null || Ve.focus();
}, [B, le, L]), we = He(null);
return {
openAndFocusMenu: $,
openAndFocusFirstItem: te,
openAndFocusLastItem: V,
onTransitionEnd: ne,
unstable__animationState: he,
descendants: L,
popper: H,
buttonId: Te,
menuId: xe,
forceUpdate: H.forceUpdate,
orientation: "vertical",
isOpen: B,
onToggle: G,
onOpen: q,
onClose: J,
menuRef: k,
buttonRef: A,
focusedIndex: le,
closeOnSelect: n,
closeOnBlur: i,
autoSelect: l,
setFocusedIndex: ae,
isLazy: f,
lazyBehavior: E,
initialFocusRef: o,
rafId: we
};
}
function dI(e = {}, t = null) {
const n = Hh(), { onToggle: i, popper: o, openAndFocusFirstItem: l, openAndFocusLastItem: f } = n, h = Q(
(y) => {
const m = y.key, b = {
Enter: l,
ArrowDown: l,
ArrowUp: f
}[m];
b && (y.preventDefault(), y.stopPropagation(), b(y));
},
[l, f]
);
return {
...e,
ref: Rn(n.buttonRef, t, o.referenceRef),
id: n.buttonId,
"data-active": Yt(n.isOpen),
"aria-expanded": n.isOpen,
"aria-haspopup": "menu",
"aria-controls": n.menuId,
onClick: St(e.onClick, i),
onKeyDown: St(e.onKeyDown, h)
};
}
function Px(e) {
var t;
return vI(e) && !!((t = e == null ? void 0 : e.getAttribute("role")) != null && t.startsWith("menuitem"));
}
function fI(e = {}, t = null) {
const n = Hh();
if (!n)
throw new Error(
"useMenuContext: context is undefined. Seems you forgot to wrap component within