@arkitektbedriftene/fe-lib 0.3.14 → 0.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3238 +0,0 @@
1
- import { j as G } from "./jsx-runtime-d0aa4c5b.js";
2
- import * as y from "react";
3
- import ve, { forwardRef as ct, useLayoutEffect as Yt, useEffect as Kt, useRef as vn, createContext as xn, useMemo as wn, useContext as Xt, isValidElement as $n, cloneElement as Sn } from "react";
4
- import * as Rn from "react-dom";
5
- import { createPortal as En } from "react-dom";
6
- var N = "colors", V = "sizes", E = "space", Cn = { gap: E, gridGap: E, columnGap: E, gridColumnGap: E, rowGap: E, gridRowGap: E, inset: E, insetBlock: E, insetBlockEnd: E, insetBlockStart: E, insetInline: E, insetInlineEnd: E, insetInlineStart: E, margin: E, marginTop: E, marginRight: E, marginBottom: E, marginLeft: E, marginBlock: E, marginBlockEnd: E, marginBlockStart: E, marginInline: E, marginInlineEnd: E, marginInlineStart: E, padding: E, paddingTop: E, paddingRight: E, paddingBottom: E, paddingLeft: E, paddingBlock: E, paddingBlockEnd: E, paddingBlockStart: E, paddingInline: E, paddingInlineEnd: E, paddingInlineStart: E, top: E, right: E, bottom: E, left: E, scrollMargin: E, scrollMarginTop: E, scrollMarginRight: E, scrollMarginBottom: E, scrollMarginLeft: E, scrollMarginX: E, scrollMarginY: E, scrollMarginBlock: E, scrollMarginBlockEnd: E, scrollMarginBlockStart: E, scrollMarginInline: E, scrollMarginInlineEnd: E, scrollMarginInlineStart: E, scrollPadding: E, scrollPaddingTop: E, scrollPaddingRight: E, scrollPaddingBottom: E, scrollPaddingLeft: E, scrollPaddingX: E, scrollPaddingY: E, scrollPaddingBlock: E, scrollPaddingBlockEnd: E, scrollPaddingBlockStart: E, scrollPaddingInline: E, scrollPaddingInlineEnd: E, scrollPaddingInlineStart: E, fontSize: "fontSizes", background: N, backgroundColor: N, backgroundImage: N, borderImage: N, border: N, borderBlock: N, borderBlockEnd: N, borderBlockStart: N, borderBottom: N, borderBottomColor: N, borderColor: N, borderInline: N, borderInlineEnd: N, borderInlineStart: N, borderLeft: N, borderLeftColor: N, borderRight: N, borderRightColor: N, borderTop: N, borderTopColor: N, caretColor: N, color: N, columnRuleColor: N, fill: N, outline: N, outlineColor: N, stroke: N, textDecorationColor: N, fontFamily: "fonts", fontWeight: "fontWeights", lineHeight: "lineHeights", letterSpacing: "letterSpacings", blockSize: V, minBlockSize: V, maxBlockSize: V, inlineSize: V, minInlineSize: V, maxInlineSize: V, width: V, minWidth: V, maxWidth: V, height: V, minHeight: V, maxHeight: V, flexBasis: V, gridTemplateColumns: V, gridTemplateRows: V, borderWidth: "borderWidths", borderTopWidth: "borderWidths", borderRightWidth: "borderWidths", borderBottomWidth: "borderWidths", borderLeftWidth: "borderWidths", borderStyle: "borderStyles", borderTopStyle: "borderStyles", borderRightStyle: "borderStyles", borderBottomStyle: "borderStyles", borderLeftStyle: "borderStyles", borderRadius: "radii", borderTopLeftRadius: "radii", borderTopRightRadius: "radii", borderBottomRightRadius: "radii", borderBottomLeftRadius: "radii", boxShadow: "shadows", textShadow: "shadows", transition: "transitions", zIndex: "zIndices" }, kn = (e, t) => typeof t == "function" ? { "()": Function.prototype.toString.call(t) } : t, Te = () => {
7
- const e = /* @__PURE__ */ Object.create(null);
8
- return (t, n, ...r) => {
9
- const o = ((i) => JSON.stringify(i, kn))(t);
10
- return o in e ? e[o] : e[o] = n(t, ...r);
11
- };
12
- }, ue = Symbol.for("sxs.internal"), ut = (e, t) => Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)), yt = (e) => {
13
- for (const t in e)
14
- return !0;
15
- return !1;
16
- }, { hasOwnProperty: Tn } = Object.prototype, rt = (e) => e.includes("-") ? e : e.replace(/[A-Z]/g, (t) => "-" + t.toLowerCase()), In = /\s+(?![^()]*\))/, xe = (e) => (t) => e(...typeof t == "string" ? String(t).split(In) : [t]), vt = { appearance: (e) => ({ WebkitAppearance: e, appearance: e }), backfaceVisibility: (e) => ({ WebkitBackfaceVisibility: e, backfaceVisibility: e }), backdropFilter: (e) => ({ WebkitBackdropFilter: e, backdropFilter: e }), backgroundClip: (e) => ({ WebkitBackgroundClip: e, backgroundClip: e }), boxDecorationBreak: (e) => ({ WebkitBoxDecorationBreak: e, boxDecorationBreak: e }), clipPath: (e) => ({ WebkitClipPath: e, clipPath: e }), content: (e) => ({ content: e.includes('"') || e.includes("'") || /^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e) ? e : `"${e}"` }), hyphens: (e) => ({ WebkitHyphens: e, hyphens: e }), maskImage: (e) => ({ WebkitMaskImage: e, maskImage: e }), maskSize: (e) => ({ WebkitMaskSize: e, maskSize: e }), tabSize: (e) => ({ MozTabSize: e, tabSize: e }), textSizeAdjust: (e) => ({ WebkitTextSizeAdjust: e, textSizeAdjust: e }), userSelect: (e) => ({ WebkitUserSelect: e, userSelect: e }), marginBlock: xe((e, t) => ({ marginBlockStart: e, marginBlockEnd: t || e })), marginInline: xe((e, t) => ({ marginInlineStart: e, marginInlineEnd: t || e })), maxSize: xe((e, t) => ({ maxBlockSize: e, maxInlineSize: t || e })), minSize: xe((e, t) => ({ minBlockSize: e, minInlineSize: t || e })), paddingBlock: xe((e, t) => ({ paddingBlockStart: e, paddingBlockEnd: t || e })), paddingInline: xe((e, t) => ({ paddingInlineStart: e, paddingInlineEnd: t || e })) }, Ge = /([\d.]+)([^]*)/, Pn = (e, t) => e.length ? e.reduce((n, r) => (n.push(...t.map((o) => o.includes("&") ? o.replace(/&/g, /[ +>|~]/.test(r) && /&.*&/.test(o) ? `:is(${r})` : r) : r + " " + o)), n), []) : t, An = (e, t) => e in Bn && typeof t == "string" ? t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/, (n, r, o, i) => r + (o === "stretch" ? `-moz-available${i};${rt(e)}:${r}-webkit-fill-available` : `-moz-fit-content${i};${rt(e)}:${r}fit-content`) + i) : String(t), Bn = { blockSize: 1, height: 1, inlineSize: 1, maxBlockSize: 1, maxHeight: 1, maxInlineSize: 1, maxWidth: 1, minBlockSize: 1, minHeight: 1, minInlineSize: 1, minWidth: 1, width: 1 }, J = (e) => e ? e + "-" : "", Ut = (e, t, n) => e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g, (r, o, i, s, l) => s == "$" == !!i ? r : (o || s == "--" ? "calc(" : "") + "var(--" + (s === "$" ? J(t) + (l.includes("$") ? "" : J(n)) + l.replace(/\$/g, "-") : l) + ")" + (o || s == "--" ? "*" + (o || "") + (i || "1") + ")" : "")), On = /\s*,\s*(?![^()]*\))/, Dn = Object.prototype.toString, Re = (e, t, n, r, o) => {
17
- let i, s, l;
18
- const a = (c, m, d) => {
19
- let f, u;
20
- const g = (p) => {
21
- for (f in p) {
22
- const x = f.charCodeAt(0) === 64, P = x && Array.isArray(p[f]) ? p[f] : [p[f]];
23
- for (u of P) {
24
- const S = /[A-Z]/.test(h = f) ? h : h.replace(/-[^]/g, (I) => I[1].toUpperCase()), C = typeof u == "object" && u && u.toString === Dn && (!r.utils[S] || !m.length);
25
- if (S in r.utils && !C) {
26
- const I = r.utils[S];
27
- if (I !== s) {
28
- s = I, g(I(u)), s = null;
29
- continue;
30
- }
31
- } else if (S in vt) {
32
- const I = vt[S];
33
- if (I !== l) {
34
- l = I, g(I(u)), l = null;
35
- continue;
36
- }
37
- }
38
- if (x && ($ = f.slice(1) in r.media ? "@media " + r.media[f.slice(1)] : f, f = $.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g, (I, A, k, O, D, L) => {
39
- const M = Ge.test(A), B = 0.0625 * (M ? -1 : 1), [b, v] = M ? [O, A] : [A, O];
40
- return "(" + (k[0] === "=" ? "" : k[0] === ">" === M ? "max-" : "min-") + b + ":" + (k[0] !== "=" && k.length === 1 ? v.replace(Ge, (T, R, w) => Number(R) + B * (k === ">" ? 1 : -1) + w) : v) + (D ? ") and (" + (D[0] === ">" ? "min-" : "max-") + b + ":" + (D.length === 1 ? L.replace(Ge, (T, R, w) => Number(R) + B * (D === ">" ? -1 : 1) + w) : L) : "") + ")";
41
- })), C) {
42
- const I = x ? d.concat(f) : [...d], A = x ? [...m] : Pn(m, f.split(On));
43
- i !== void 0 && o(xt(...i)), i = void 0, a(u, A, I);
44
- } else
45
- i === void 0 && (i = [[], m, d]), f = x || f.charCodeAt(0) !== 36 ? f : `--${J(r.prefix)}${f.slice(1).replace(/\$/g, "-")}`, u = C ? u : typeof u == "number" ? u && S in Mn ? String(u) + "px" : String(u) : Ut(An(S, u ?? ""), r.prefix, r.themeMap[S]), i[0].push(`${x ? `${f} ` : `${rt(f)}:`}${u}`);
46
- }
47
- }
48
- var $, h;
49
- };
50
- g(c), i !== void 0 && o(xt(...i)), i = void 0;
51
- };
52
- a(e, t, n);
53
- }, xt = (e, t, n) => `${n.map((r) => `${r}{`).join("")}${t.length ? `${t.join(",")}{` : ""}${e.join(";")}${t.length ? "}" : ""}${Array(n.length ? n.length + 1 : 0).join("}")}`, Mn = { animationDelay: 1, animationDuration: 1, backgroundSize: 1, blockSize: 1, border: 1, borderBlock: 1, borderBlockEnd: 1, borderBlockEndWidth: 1, borderBlockStart: 1, borderBlockStartWidth: 1, borderBlockWidth: 1, borderBottom: 1, borderBottomLeftRadius: 1, borderBottomRightRadius: 1, borderBottomWidth: 1, borderEndEndRadius: 1, borderEndStartRadius: 1, borderInlineEnd: 1, borderInlineEndWidth: 1, borderInlineStart: 1, borderInlineStartWidth: 1, borderInlineWidth: 1, borderLeft: 1, borderLeftWidth: 1, borderRadius: 1, borderRight: 1, borderRightWidth: 1, borderSpacing: 1, borderStartEndRadius: 1, borderStartStartRadius: 1, borderTop: 1, borderTopLeftRadius: 1, borderTopRightRadius: 1, borderTopWidth: 1, borderWidth: 1, bottom: 1, columnGap: 1, columnRule: 1, columnRuleWidth: 1, columnWidth: 1, containIntrinsicSize: 1, flexBasis: 1, fontSize: 1, gap: 1, gridAutoColumns: 1, gridAutoRows: 1, gridTemplateColumns: 1, gridTemplateRows: 1, height: 1, inlineSize: 1, inset: 1, insetBlock: 1, insetBlockEnd: 1, insetBlockStart: 1, insetInline: 1, insetInlineEnd: 1, insetInlineStart: 1, left: 1, letterSpacing: 1, margin: 1, marginBlock: 1, marginBlockEnd: 1, marginBlockStart: 1, marginBottom: 1, marginInline: 1, marginInlineEnd: 1, marginInlineStart: 1, marginLeft: 1, marginRight: 1, marginTop: 1, maxBlockSize: 1, maxHeight: 1, maxInlineSize: 1, maxWidth: 1, minBlockSize: 1, minHeight: 1, minInlineSize: 1, minWidth: 1, offsetDistance: 1, offsetRotate: 1, outline: 1, outlineOffset: 1, outlineWidth: 1, overflowClipMargin: 1, padding: 1, paddingBlock: 1, paddingBlockEnd: 1, paddingBlockStart: 1, paddingBottom: 1, paddingInline: 1, paddingInlineEnd: 1, paddingInlineStart: 1, paddingLeft: 1, paddingRight: 1, paddingTop: 1, perspective: 1, right: 1, rowGap: 1, scrollMargin: 1, scrollMarginBlock: 1, scrollMarginBlockEnd: 1, scrollMarginBlockStart: 1, scrollMarginBottom: 1, scrollMarginInline: 1, scrollMarginInlineEnd: 1, scrollMarginInlineStart: 1, scrollMarginLeft: 1, scrollMarginRight: 1, scrollMarginTop: 1, scrollPadding: 1, scrollPaddingBlock: 1, scrollPaddingBlockEnd: 1, scrollPaddingBlockStart: 1, scrollPaddingBottom: 1, scrollPaddingInline: 1, scrollPaddingInlineEnd: 1, scrollPaddingInlineStart: 1, scrollPaddingLeft: 1, scrollPaddingRight: 1, scrollPaddingTop: 1, shapeMargin: 1, textDecoration: 1, textDecorationThickness: 1, textIndent: 1, textUnderlineOffset: 1, top: 1, transitionDelay: 1, transitionDuration: 1, verticalAlign: 1, width: 1, wordSpacing: 1 }, wt = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), de = (e) => ((t) => {
54
- let n, r = "";
55
- for (n = Math.abs(t); n > 52; n = n / 52 | 0)
56
- r = wt(n % 52) + r;
57
- return wt(n % 52) + r;
58
- })(((t, n) => {
59
- let r = n.length;
60
- for (; r; )
61
- t = 33 * t ^ n.charCodeAt(--r);
62
- return t;
63
- })(5381, JSON.stringify(e)) >>> 0), Ae = ["themed", "global", "styled", "onevar", "resonevar", "allvar", "inline"], Ln = (e) => {
64
- if (e.href && !e.href.startsWith(location.origin))
65
- return !1;
66
- try {
67
- return !!e.cssRules;
68
- } catch {
69
- return !1;
70
- }
71
- }, Fn = (e) => {
72
- let t;
73
- const n = () => {
74
- const { cssRules: o } = t.sheet;
75
- return [].map.call(o, (i, s) => {
76
- const { cssText: l } = i;
77
- let a = "";
78
- if (l.startsWith("--sxs"))
79
- return "";
80
- if (o[s - 1] && (a = o[s - 1].cssText).startsWith("--sxs")) {
81
- if (!i.cssRules.length)
82
- return "";
83
- for (const c in t.rules)
84
- if (t.rules[c].group === i)
85
- return `--sxs{--sxs:${[...t.rules[c].cache].join(" ")}}${l}`;
86
- return i.cssRules.length ? `${a}${l}` : "";
87
- }
88
- return l;
89
- }).join("");
90
- }, r = () => {
91
- if (t) {
92
- const { rules: l, sheet: a } = t;
93
- if (!a.deleteRule) {
94
- for (; Object(Object(a.cssRules)[0]).type === 3; )
95
- a.cssRules.splice(0, 1);
96
- a.cssRules = [];
97
- }
98
- for (const c in l)
99
- delete l[c];
100
- }
101
- const o = Object(e).styleSheets || [];
102
- for (const l of o)
103
- if (Ln(l)) {
104
- for (let a = 0, c = l.cssRules; c[a]; ++a) {
105
- const m = Object(c[a]);
106
- if (m.type !== 1)
107
- continue;
108
- const d = Object(c[a + 1]);
109
- if (d.type !== 4)
110
- continue;
111
- ++a;
112
- const { cssText: f } = m;
113
- if (!f.startsWith("--sxs"))
114
- continue;
115
- const u = f.slice(14, -3).trim().split(/\s+/), g = Ae[u[0]];
116
- g && (t || (t = { sheet: l, reset: r, rules: {}, toString: n }), t.rules[g] = { group: d, index: a, cache: new Set(u) });
117
- }
118
- if (t)
119
- break;
120
- }
121
- if (!t) {
122
- const l = (a, c) => ({ type: c, cssRules: [], insertRule(m, d) {
123
- this.cssRules.splice(d, 0, l(m, { import: 3, undefined: 1 }[(m.toLowerCase().match(/^@([a-z]+)/) || [])[1]] || 4));
124
- }, get cssText() {
125
- return a === "@media{}" ? `@media{${[].map.call(this.cssRules, (m) => m.cssText).join("")}}` : a;
126
- } });
127
- t = { sheet: e ? (e.head || e).appendChild(document.createElement("style")).sheet : l("", "text/css"), rules: {}, reset: r, toString: n };
128
- }
129
- const { sheet: i, rules: s } = t;
130
- for (let l = Ae.length - 1; l >= 0; --l) {
131
- const a = Ae[l];
132
- if (!s[a]) {
133
- const c = Ae[l + 1], m = s[c] ? s[c].index : i.cssRules.length;
134
- i.insertRule("@media{}", m), i.insertRule(`--sxs{--sxs:${l}}`, m), s[a] = { group: i.cssRules[m + 1], index: m, cache: /* @__PURE__ */ new Set([l]) };
135
- }
136
- Nn(s[a]);
137
- }
138
- };
139
- return r(), t;
140
- }, Nn = (e) => {
141
- const t = e.group;
142
- let n = t.cssRules.length;
143
- e.apply = (r) => {
144
- try {
145
- t.insertRule(r, n), ++n;
146
- } catch {
147
- }
148
- };
149
- }, Pe = Symbol(), Wn = Te(), $t = (e, t) => Wn(e, () => (...n) => {
150
- let r = { type: null, composers: /* @__PURE__ */ new Set() };
151
- for (const o of n)
152
- if (o != null)
153
- if (o[ue]) {
154
- r.type == null && (r.type = o[ue].type);
155
- for (const i of o[ue].composers)
156
- r.composers.add(i);
157
- } else
158
- o.constructor !== Object || o.$$typeof ? r.type == null && (r.type = o) : r.composers.add(jn(o, e));
159
- return r.type == null && (r.type = "span"), r.composers.size || r.composers.add(["PJLV", {}, [], [], {}, []]), zn(e, r, t);
160
- }), jn = ({ variants: e, compoundVariants: t, defaultVariants: n, ...r }, o) => {
161
- const i = `${J(o.prefix)}c-${de(r)}`, s = [], l = [], a = /* @__PURE__ */ Object.create(null), c = [];
162
- for (const f in n)
163
- a[f] = String(n[f]);
164
- if (typeof e == "object" && e)
165
- for (const f in e) {
166
- m = a, d = f, Tn.call(m, d) || (a[f] = "undefined");
167
- const u = e[f];
168
- for (const g in u) {
169
- const p = { [f]: String(g) };
170
- String(g) === "undefined" && c.push(f);
171
- const $ = u[g], h = [p, $, !yt($)];
172
- s.push(h);
173
- }
174
- }
175
- var m, d;
176
- if (typeof t == "object" && t)
177
- for (const f of t) {
178
- let { css: u, ...g } = f;
179
- u = typeof u == "object" && u || {};
180
- for (const $ in g)
181
- g[$] = String(g[$]);
182
- const p = [g, u, !yt(u)];
183
- l.push(p);
184
- }
185
- return [i, r, s, l, a, c];
186
- }, zn = (e, t, n) => {
187
- const [r, o, i, s] = Hn(t.composers), l = typeof t.type == "function" || t.type.$$typeof ? ((d) => {
188
- function f() {
189
- for (let u = 0; u < f[Pe].length; u++) {
190
- const [g, p] = f[Pe][u];
191
- d.rules[g].apply(p);
192
- }
193
- return f[Pe] = [], null;
194
- }
195
- return f[Pe] = [], f.rules = {}, Ae.forEach((u) => f.rules[u] = { apply: (g) => f[Pe].push([u, g]) }), f;
196
- })(n) : null, a = (l || n).rules, c = `.${r}${o.length > 1 ? `:where(.${o.slice(1).join(".")})` : ""}`, m = (d) => {
197
- d = typeof d == "object" && d || Vn;
198
- const { css: f, ...u } = d, g = {};
199
- for (const h in i)
200
- if (delete u[h], h in d) {
201
- let x = d[h];
202
- typeof x == "object" && x ? g[h] = { "@initial": i[h], ...x } : (x = String(x), g[h] = x !== "undefined" || s.has(h) ? x : i[h]);
203
- } else
204
- g[h] = i[h];
205
- const p = /* @__PURE__ */ new Set([...o]);
206
- for (const [h, x, P, S] of t.composers) {
207
- n.rules.styled.cache.has(h) || (n.rules.styled.cache.add(h), Re(x, [`.${h}`], [], e, (A) => {
208
- a.styled.apply(A);
209
- }));
210
- const C = St(P, g, e.media), I = St(S, g, e.media, !0);
211
- for (const A of C)
212
- if (A !== void 0)
213
- for (const [k, O, D] of A) {
214
- const L = `${h}-${de(O)}-${k}`;
215
- p.add(L);
216
- const M = (D ? n.rules.resonevar : n.rules.onevar).cache, B = D ? a.resonevar : a.onevar;
217
- M.has(L) || (M.add(L), Re(O, [`.${L}`], [], e, (b) => {
218
- B.apply(b);
219
- }));
220
- }
221
- for (const A of I)
222
- if (A !== void 0)
223
- for (const [k, O] of A) {
224
- const D = `${h}-${de(O)}-${k}`;
225
- p.add(D), n.rules.allvar.cache.has(D) || (n.rules.allvar.cache.add(D), Re(O, [`.${D}`], [], e, (L) => {
226
- a.allvar.apply(L);
227
- }));
228
- }
229
- }
230
- if (typeof f == "object" && f) {
231
- const h = `${r}-i${de(f)}-css`;
232
- p.add(h), n.rules.inline.cache.has(h) || (n.rules.inline.cache.add(h), Re(f, [`.${h}`], [], e, (x) => {
233
- a.inline.apply(x);
234
- }));
235
- }
236
- for (const h of String(d.className || "").trim().split(/\s+/))
237
- h && p.add(h);
238
- const $ = u.className = [...p].join(" ");
239
- return { type: t.type, className: $, selector: c, props: u, toString: () => $, deferredInjector: l };
240
- };
241
- return ut(m, { className: r, selector: c, [ue]: t, toString: () => (n.rules.styled.cache.has(r) || m(), r) });
242
- }, Hn = (e) => {
243
- let t = "";
244
- const n = [], r = {}, o = [];
245
- for (const [i, , , , s, l] of e) {
246
- t === "" && (t = i), n.push(i), o.push(...l);
247
- for (const a in s) {
248
- const c = s[a];
249
- (r[a] === void 0 || c !== "undefined" || l.includes(c)) && (r[a] = c);
250
- }
251
- }
252
- return [t, n, r, new Set(o)];
253
- }, St = (e, t, n, r) => {
254
- const o = [];
255
- e:
256
- for (let [i, s, l] of e) {
257
- if (l)
258
- continue;
259
- let a, c = 0, m = !1;
260
- for (a in i) {
261
- const d = i[a];
262
- let f = t[a];
263
- if (f !== d) {
264
- if (typeof f != "object" || !f)
265
- continue e;
266
- {
267
- let u, g, p = 0;
268
- for (const $ in f) {
269
- if (d === String(f[$])) {
270
- if ($ !== "@initial") {
271
- const h = $.slice(1);
272
- (g = g || []).push(h in n ? n[h] : $.replace(/^@media ?/, "")), m = !0;
273
- }
274
- c += p, u = !0;
275
- }
276
- ++p;
277
- }
278
- if (g && g.length && (s = { ["@media " + g.join(", ")]: s }), !u)
279
- continue e;
280
- }
281
- }
282
- }
283
- (o[c] = o[c] || []).push([r ? "cv" : `${a}-${i[a]}`, s, m]);
284
- }
285
- return o;
286
- }, Vn = {}, _n = Te(), Yn = (e, t) => _n(e, () => (...n) => {
287
- const r = () => {
288
- for (let o of n) {
289
- o = typeof o == "object" && o || {};
290
- let i = de(o);
291
- if (!t.rules.global.cache.has(i)) {
292
- if (t.rules.global.cache.add(i), "@import" in o) {
293
- let s = [].indexOf.call(t.sheet.cssRules, t.rules.themed.group) - 1;
294
- for (let l of [].concat(o["@import"]))
295
- l = l.includes('"') || l.includes("'") ? l : `"${l}"`, t.sheet.insertRule(`@import ${l};`, s++);
296
- delete o["@import"];
297
- }
298
- Re(o, [], [], e, (s) => {
299
- t.rules.global.apply(s);
300
- });
301
- }
302
- }
303
- return "";
304
- };
305
- return ut(r, { toString: r });
306
- }), Kn = Te(), Xn = (e, t) => Kn(e, () => (n) => {
307
- const r = `${J(e.prefix)}k-${de(n)}`, o = () => {
308
- if (!t.rules.global.cache.has(r)) {
309
- t.rules.global.cache.add(r);
310
- const i = [];
311
- Re(n, [], [], e, (l) => i.push(l));
312
- const s = `@keyframes ${r}{${i.join("")}}`;
313
- t.rules.global.apply(s);
314
- }
315
- return r;
316
- };
317
- return ut(o, { get name() {
318
- return o();
319
- }, toString: o });
320
- }), Un = class {
321
- constructor(e, t, n, r) {
322
- this.token = e == null ? "" : String(e), this.value = t == null ? "" : String(t), this.scale = n == null ? "" : String(n), this.prefix = r == null ? "" : String(r);
323
- }
324
- get computedValue() {
325
- return "var(" + this.variable + ")";
326
- }
327
- get variable() {
328
- return "--" + J(this.prefix) + J(this.scale) + this.token;
329
- }
330
- toString() {
331
- return this.computedValue;
332
- }
333
- }, qn = Te(), Gn = (e, t) => qn(e, () => (n, r) => {
334
- r = typeof n == "object" && n || Object(r);
335
- const o = `.${n = (n = typeof n == "string" ? n : "") || `${J(e.prefix)}t-${de(r)}`}`, i = {}, s = [];
336
- for (const a in r) {
337
- i[a] = {};
338
- for (const c in r[a]) {
339
- const m = `--${J(e.prefix)}${a}-${c}`, d = Ut(String(r[a][c]), e.prefix, a);
340
- i[a][c] = new Un(c, d, a, e.prefix), s.push(`${m}:${d}`);
341
- }
342
- }
343
- const l = () => {
344
- if (s.length && !t.rules.themed.cache.has(n)) {
345
- t.rules.themed.cache.add(n);
346
- const a = `${r === e.theme ? ":root," : ""}.${n}{${s.join(";")}}`;
347
- t.rules.themed.apply(a);
348
- }
349
- return n;
350
- };
351
- return { ...i, get className() {
352
- return l();
353
- }, selector: o, toString: l };
354
- }), Zn = Te(), Jn = Te(), Qn = (e) => {
355
- const t = ((n) => {
356
- let r = !1;
357
- const o = Zn(n, (i) => {
358
- r = !0;
359
- const s = "prefix" in (i = typeof i == "object" && i || {}) ? String(i.prefix) : "", l = typeof i.media == "object" && i.media || {}, a = typeof i.root == "object" ? i.root || null : globalThis.document || null, c = typeof i.theme == "object" && i.theme || {}, m = { prefix: s, media: l, theme: c, themeMap: typeof i.themeMap == "object" && i.themeMap || { ...Cn }, utils: typeof i.utils == "object" && i.utils || {} }, d = Fn(a), f = { css: $t(m, d), globalCss: Yn(m, d), keyframes: Xn(m, d), createTheme: Gn(m, d), reset() {
360
- d.reset(), f.theme.toString();
361
- }, theme: {}, sheet: d, config: m, prefix: s, getCssText: d.toString, toString: d.toString };
362
- return String(f.theme = f.createTheme(c)), f;
363
- });
364
- return r || o.reset(), o;
365
- })(e);
366
- return t.styled = (({ config: n, sheet: r }) => Jn(n, () => {
367
- const o = $t(n, r);
368
- return (...i) => {
369
- const s = o(...i), l = s[ue].type, a = ve.forwardRef((c, m) => {
370
- const d = c && c.as || l, { props: f, deferredInjector: u } = s(c);
371
- return delete f.as, f.ref = m, u ? ve.createElement(ve.Fragment, null, ve.createElement(d, f), ve.createElement(u, null)) : ve.createElement(d, f);
372
- });
373
- return a.className = s.className, a.displayName = `Styled.${l.displayName || l.name || l}`, a.selector = s.selector, a.toString = () => s.selector, a[ue] = s[ue], a;
374
- };
375
- }))(t), t;
376
- };
377
- let Rt = 9999;
378
- const Ze = () => (Rt--, Rt), { styled: re, css: qt, keyframes: Ie, globalCss: ni } = Qn({
379
- theme: {
380
- colors: {
381
- gray50: "#F9FAFA",
382
- gray100: "#EBEEEE",
383
- gray200: "#CFD6D7",
384
- gray300: "#B3BEC0",
385
- gray400: "#97A6A8",
386
- gray500: "#7C8E91",
387
- gray600: "#627578",
388
- gray700: "#4F5F61",
389
- gray800: "#414D4F",
390
- gray900: "#2C3435",
391
- blue50: "#F7FBFB",
392
- blue100: "#E3F0F2",
393
- blue200: "#BADADF",
394
- blue300: "#92C5CC",
395
- blue400: "#67AEB8",
396
- blue500: "#3C97A3",
397
- blue600: "#1F7D8A",
398
- blue700: "#19656F",
399
- blue800: "#14525B",
400
- blue900: "#0E383E",
401
- yellow50: "#FDFAEF",
402
- yellow100: "#F9EDCA",
403
- yellow200: "#EFD27A",
404
- yellow300: "#E5B626",
405
- yellow400: "#C89E1C",
406
- yellow500: "#AA8618",
407
- yellow600: "#8C6E14",
408
- yellow700: "#715910",
409
- yellow800: "#5C490D",
410
- yellow900: "#3E3109",
411
- orange500: "#D1721C",
412
- red50: "#FDF9F9",
413
- red100: "#F7EBEB",
414
- red200: "#EBCECD",
415
- red300: "#DFB1B0",
416
- red400: "#D39392",
417
- red500: "#C67473",
418
- red600: "#B85250",
419
- red700: "#A92F2D",
420
- red800: "#901F1E",
421
- red900: "#631614",
422
- green50: "#F8FAF9",
423
- green100: "#E7F0EA",
424
- green200: "#C5D9CB",
425
- green300: "#A4C4AD",
426
- green400: "#82AD8D",
427
- green500: "#60976F",
428
- green600: "#3C7F4E",
429
- green700: "#296839",
430
- green800: "#21552F",
431
- green900: "#163920",
432
- // Primary
433
- primaryTextOnLightBg: "#194b58",
434
- primaryBg: "$blue600",
435
- primaryBgHover: "$blue700",
436
- primaryTextOnWhite: "$blue600",
437
- bodyGray: "$gray100",
438
- hoverDarker: "hsla(214deg, 25%, 21%, 0.06)",
439
- borderDarker: "hsla(214deg, 25%, 21%, 0.1)",
440
- selectedDarker: "hsla(214deg, 25%, 21%, 0.06)",
441
- selectedOnBodyGray: "hsl(214deg, 35%, 80%)",
442
- darkGrayBg: "#1f2937",
443
- border: "hsl(214deg, 25%, 80%)",
444
- text: "#1f2937",
445
- secondaryText: "$gray500",
446
- focusRing: "hsla(214deg, 15%, 10%, 0.6)"
447
- },
448
- fontSizes: {
449
- xs: "0.75rem",
450
- // 12px
451
- sm: "0.875rem",
452
- // 14px
453
- md: "1rem",
454
- // 16px
455
- lg: "1.125rem",
456
- // 18px
457
- xl: "1.25rem",
458
- // 20px
459
- "2xl": "1.5rem",
460
- // 24px
461
- "3xl": "1.875rem"
462
- // 30px
463
- },
464
- fontWeights: {
465
- normal: "var(--ui-font-weight-normal)",
466
- medium: "var(--ui-font-weight-semibold)",
467
- bold: "var(--ui-font-weight-bold)"
468
- },
469
- space: {
470
- 1: "0.25rem",
471
- 2: "0.5rem",
472
- 3: "0.75rem",
473
- 4: "1rem",
474
- 6: "1.5rem",
475
- 8: "2rem"
476
- },
477
- shadows: {
478
- xs: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
479
- sm: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
480
- md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
481
- lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
482
- overlayCard: "0 5px 50px 0px rgb(0 0 0 / 0.15), 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"
483
- },
484
- radii: {
485
- xs: "0.125rem",
486
- sm: "0.25rem",
487
- md: "0.5rem",
488
- mdmd: "calc(0.5rem - 0.125rem)",
489
- full: "9999px"
490
- },
491
- zIndices: {
492
- /**
493
- * By using createLayerBelow() we can order the list of layers.
494
- * Layers higher up will be on top of layers lower down.
495
- */
496
- toast: Ze(),
497
- overlayCard: Ze(),
498
- modal: Ze()
499
- }
500
- },
501
- media: {
502
- lg: "(min-width: 1200px)",
503
- print: "print"
504
- }
505
- }), er = Ie({
506
- "0%": {
507
- transform: "rotate(0)"
508
- },
509
- "100%": {
510
- transform: "rotate(360deg)"
511
- }
512
- }), tr = Ie({
513
- "0%": {
514
- strokeDashoffset: 600
515
- },
516
- "100%": {
517
- strokeDashoffset: 0
518
- }
519
- }), nr = re("svg", {
520
- animation: `${er} 2s linear infinite`
521
- }), rr = re("circle", {
522
- animation: `${tr} 1.6s cubic-bezier(0.4, 0.15, 0.6, 0.85) infinite`,
523
- fill: "transparent",
524
- stroke: "currentColor",
525
- strokeDasharray: 300,
526
- strokeDashoffset: 600,
527
- strokeLinecap: "round",
528
- strokeMiterlimit: 10,
529
- strokeWidth: 12
530
- }), or = re("div", {
531
- lineHeight: 0,
532
- flexShrink: 0,
533
- variants: {
534
- size: {
535
- xs: {
536
- width: "1rem",
537
- height: "1rem"
538
- },
539
- sm: {
540
- width: "1.25rem",
541
- height: "1.25rem"
542
- },
543
- md: {
544
- width: "1.75rem",
545
- height: "1.75rem"
546
- },
547
- lg: {
548
- width: "2.25rem",
549
- height: "2.25rem"
550
- }
551
- },
552
- color: {
553
- light: {
554
- color: "$gray200"
555
- },
556
- dark: {
557
- color: "$gray800"
558
- },
559
- inherit: {
560
- color: "inherit"
561
- }
562
- }
563
- },
564
- defaultVariants: {
565
- size: "sm",
566
- color: "dark"
567
- }
568
- }), ir = ct(
569
- (e, t) => /* @__PURE__ */ G.jsx(
570
- or,
571
- {
572
- ref: t,
573
- ...e,
574
- children: /* @__PURE__ */ G.jsx(
575
- nr,
576
- {
577
- x: "0px",
578
- y: "0px",
579
- viewBox: "0 0 150 150",
580
- children: /* @__PURE__ */ G.jsx(
581
- rr,
582
- {
583
- cx: "75",
584
- cy: "75",
585
- r: "60"
586
- }
587
- )
588
- }
589
- )
590
- }
591
- )
592
- ), sr = re("button", {
593
- appearance: "none",
594
- margin: 0,
595
- padding: 0,
596
- border: "none",
597
- background: "none",
598
- cursor: "pointer",
599
- fontFamily: "inherit",
600
- textAlign: "left",
601
- textDecoration: "none",
602
- textIndent: 0,
603
- lineHeight: 1.25,
604
- display: "inline-flex",
605
- justifyContent: "center",
606
- alignItems: "center",
607
- gap: "$2",
608
- position: "relative",
609
- fontWeight: "$medium",
610
- borderRadius: "$sm",
611
- whiteSpace: "nowrap",
612
- transition: "background 0.2s ease-in-out",
613
- "&:focus, &:focus-visible": {
614
- outline: "none"
615
- },
616
- "&:focus-visible": {
617
- boxShadow: "0 0 0 2px white, 0 0 0 4px $colors$focusRing"
618
- },
619
- "&:disabled": {
620
- cursor: "not-allowed"
621
- },
622
- variants: {
623
- color: {
624
- primary: {
625
- $$solid: "$colors$blue600",
626
- $$solidHover: "$colors$blue700",
627
- $$outline: "$colors$blue600",
628
- $$outlineHover: "$colors$blue100",
629
- $$outlineText: "$colors$blue600",
630
- $$disabled: "$colors$blue200"
631
- },
632
- secondary: {
633
- $$solid: "$colors$gray600",
634
- $$solidHover: "$colors$gray700",
635
- $$outline: "$colors$gray400",
636
- $$outlineHover: "$colors$gray100",
637
- $$outlineText: "$colors$gray600",
638
- $$disabled: "$colors$gray200"
639
- },
640
- success: {
641
- $$solid: "$colors$green600",
642
- $$solidHover: "$colors$green700",
643
- $$outline: "$colors$green600",
644
- $$outlineHover: "$colors$green100",
645
- $$outlineText: "$colors$green600",
646
- $$disabled: "$colors$green200"
647
- },
648
- danger: {
649
- $$solid: "$colors$red600",
650
- $$solidHover: "$colors$red700",
651
- $$outline: "$colors$red600",
652
- $$outlineHover: "$colors$red100",
653
- $$outlineText: "$colors$red600",
654
- $$disabled: "$colors$red200"
655
- },
656
- warning: {
657
- $$solid: "$colors$yellow600",
658
- $$solidHover: "$colors$yellow700",
659
- $$outline: "$colors$yellow400",
660
- $$outlineHover: "$colors$yellow50",
661
- $$outlineText: "$colors$yellow600",
662
- $$disabled: "$colors$yellow100"
663
- }
664
- },
665
- size: {
666
- md: {
667
- fontSize: "$sm",
668
- padding: "$2 $4",
669
- height: "2.25rem"
670
- },
671
- lg: {
672
- fontSize: "$md",
673
- padding: "$3 $6",
674
- height: "2.75rem"
675
- }
676
- },
677
- variant: {
678
- primary: {
679
- background: "$$solid",
680
- color: "white",
681
- "&:hover:not(:disabled)": {
682
- backgroundColor: "$$solidHover"
683
- },
684
- "&:disabled": {
685
- backgroundColor: "$$disabled"
686
- }
687
- },
688
- outline: {
689
- boxShadow: "inset 0 0 0 1px $$outline",
690
- color: "$$outlineText",
691
- "&:hover:not(:disabled)": {
692
- backgroundColor: "$$outlineHover"
693
- },
694
- "&:disabled": {
695
- boxShadow: "inset 0 0 0 1px $$disabled",
696
- color: "$$disabled"
697
- }
698
- },
699
- transparent: {
700
- backgroundColor: "transparent",
701
- color: "$$outlineText",
702
- "&:hover:not(:disabled)": {
703
- backgroundColor: "$$outlineHover"
704
- },
705
- "&:disabled": {
706
- color: "$$disabled"
707
- }
708
- }
709
- },
710
- icon: {
711
- true: {}
712
- }
713
- },
714
- compoundVariants: [
715
- {
716
- icon: !0,
717
- size: "md",
718
- css: {
719
- padding: "$2",
720
- width: "2.25rem"
721
- }
722
- },
723
- {
724
- icon: !0,
725
- size: "lg",
726
- css: {
727
- padding: "$2",
728
- width: "2.75rem"
729
- }
730
- }
731
- ],
732
- defaultVariants: {
733
- variant: "outline",
734
- color: "secondary",
735
- size: "md"
736
- }
737
- }), ri = ct(
738
- ({ children: e, disabled: t, isLoading: n, variant: r, color: o, ...i }, s) => (!o && r === "primary" && (o = "primary"), /* @__PURE__ */ G.jsxs(
739
- sr,
740
- {
741
- ref: s,
742
- type: "button",
743
- role: "button",
744
- disabled: t || n,
745
- variant: r,
746
- color: o,
747
- ...i,
748
- children: [
749
- e,
750
- n && /* @__PURE__ */ G.jsx(ir, { color: "inherit" })
751
- ]
752
- }
753
- ))
754
- ), lr = re("div", {
755
- padding: "$3",
756
- borderRadius: "$md",
757
- variants: {
758
- color: {
759
- warning: {
760
- background: "$yellow200",
761
- border: "1px solid $yellow400",
762
- color: "$yellow900"
763
- },
764
- danger: {
765
- background: "$red200",
766
- border: "1px solid $red400",
767
- color: "$red900"
768
- },
769
- info: {
770
- background: "$blue200",
771
- border: "1px solid $blue400",
772
- color: "$blue900"
773
- },
774
- success: {
775
- background: "$green200",
776
- border: "1px solid $green400",
777
- color: "$green900"
778
- }
779
- },
780
- size: {
781
- sm: {
782
- fontSize: "$sm"
783
- },
784
- md: {
785
- fontSize: "$md"
786
- }
787
- }
788
- },
789
- defaultVariants: {
790
- color: "info",
791
- size: "md"
792
- }
793
- }), oi = ct(
794
- ({ children: e, ...t }, n) => /* @__PURE__ */ G.jsx(
795
- lr,
796
- {
797
- ref: n,
798
- role: "alert",
799
- ...t,
800
- children: e
801
- }
802
- )
803
- ), ar = Ie({
804
- "0%": { opacity: 0, transform: "translateY(0.5rem)" },
805
- "100%": { opacity: 1, transform: "translateY(0)" }
806
- }), cr = Ie({
807
- "0%": { opacity: 0, transform: "translateX(-0.5rem)" },
808
- "100%": { opacity: 1, transform: "translateX(0)" }
809
- }), ur = Ie({
810
- "0%": { opacity: 0, transform: "translateY(-0.5rem)" },
811
- "100%": { opacity: 1, transform: "translateY(0)" }
812
- }), dr = Ie({
813
- "0%": { opacity: 0, transform: "translateX(0.5rem)" },
814
- "100%": { opacity: 1, transform: "translateX(0)" }
815
- }), fr = qt({
816
- backgroundColor: "white",
817
- boxShadow: "$overlayCard",
818
- borderRadius: "$sm",
819
- overflow: "hidden",
820
- zIndex: "$overlayCard"
821
- }), mr = qt({
822
- animationDuration: "400ms",
823
- animationTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)",
824
- willChange: "transform, opacity",
825
- '&[data-state="open"]': {
826
- '&[data-side="top"]': { animationName: ur },
827
- '&[data-side="right"]': { animationName: dr },
828
- '&[data-side="bottom"]': { animationName: ar },
829
- '&[data-side="left"]': { animationName: cr }
830
- }
831
- }), gr = re(
832
- "div",
833
- fr,
834
- mr
835
- );
836
- function te(e) {
837
- return Gt(e) ? (e.nodeName || "").toLowerCase() : "#document";
838
- }
839
- function X(e) {
840
- var t;
841
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
842
- }
843
- function Q(e) {
844
- var t;
845
- return (t = (Gt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
846
- }
847
- function Gt(e) {
848
- return e instanceof Node || e instanceof X(e).Node;
849
- }
850
- function W(e) {
851
- return e instanceof Element || e instanceof X(e).Element;
852
- }
853
- function U(e) {
854
- return e instanceof HTMLElement || e instanceof X(e).HTMLElement;
855
- }
856
- function ot(e) {
857
- return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof X(e).ShadowRoot;
858
- }
859
- function Oe(e) {
860
- const {
861
- overflow: t,
862
- overflowX: n,
863
- overflowY: r,
864
- display: o
865
- } = q(e);
866
- return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !["inline", "contents"].includes(o);
867
- }
868
- function pr(e) {
869
- return ["table", "td", "th"].includes(te(e));
870
- }
871
- function dt(e) {
872
- const t = ft(), n = q(e);
873
- return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((r) => (n.willChange || "").includes(r)) || ["paint", "layout", "strict", "content"].some((r) => (n.contain || "").includes(r));
874
- }
875
- function hr(e) {
876
- let t = ge(e);
877
- for (; U(t) && !ke(t); ) {
878
- if (dt(t))
879
- return t;
880
- t = ge(t);
881
- }
882
- return null;
883
- }
884
- function ft() {
885
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
886
- }
887
- function ke(e) {
888
- return ["html", "body", "#document"].includes(te(e));
889
- }
890
- function q(e) {
891
- return X(e).getComputedStyle(e);
892
- }
893
- function Ye(e) {
894
- return W(e) ? {
895
- scrollLeft: e.scrollLeft,
896
- scrollTop: e.scrollTop
897
- } : {
898
- scrollLeft: e.pageXOffset,
899
- scrollTop: e.pageYOffset
900
- };
901
- }
902
- function ge(e) {
903
- if (te(e) === "html")
904
- return e;
905
- const t = (
906
- // Step into the shadow DOM of the parent of a slotted node.
907
- e.assignedSlot || // DOM Element detected.
908
- e.parentNode || // ShadowRoot detected.
909
- ot(e) && e.host || // Fallback.
910
- Q(e)
911
- );
912
- return ot(t) ? t.host : t;
913
- }
914
- function Zt(e) {
915
- const t = ge(e);
916
- return ke(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : U(t) && Oe(t) ? t : Zt(t);
917
- }
918
- function ee(e, t, n) {
919
- var r;
920
- t === void 0 && (t = []), n === void 0 && (n = !0);
921
- const o = Zt(e), i = o === ((r = e.ownerDocument) == null ? void 0 : r.body), s = X(o);
922
- return i ? t.concat(s, s.visualViewport || [], Oe(o) ? o : [], s.frameElement && n ? ee(s.frameElement) : []) : t.concat(o, ee(o, [], n));
923
- }
924
- function br(e) {
925
- let t = e.activeElement;
926
- for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
927
- var n;
928
- t = t.shadowRoot.activeElement;
929
- }
930
- return t;
931
- }
932
- function fe(e, t) {
933
- if (!e || !t)
934
- return !1;
935
- const n = t.getRootNode == null ? void 0 : t.getRootNode();
936
- if (e.contains(t))
937
- return !0;
938
- if (n && ot(n)) {
939
- let r = t;
940
- for (; r; ) {
941
- if (e === r)
942
- return !0;
943
- r = r.parentNode || r.host;
944
- }
945
- }
946
- return !1;
947
- }
948
- function yr() {
949
- return /apple/i.test(navigator.vendor);
950
- }
951
- function Fe(e, t) {
952
- const n = ["mouse", "pen"];
953
- return t || n.push("", void 0), n.includes(e);
954
- }
955
- function vr(e) {
956
- return "nativeEvent" in e;
957
- }
958
- function xr(e) {
959
- return e.matches("html,body");
960
- }
961
- function ce(e) {
962
- return (e == null ? void 0 : e.ownerDocument) || document;
963
- }
964
- function Je(e, t) {
965
- if (t == null)
966
- return !1;
967
- if ("composedPath" in e)
968
- return e.composedPath().includes(t);
969
- const n = e;
970
- return n.target != null && t.contains(n.target);
971
- }
972
- function $e(e) {
973
- return "composedPath" in e ? e.composedPath()[0] : e.target;
974
- }
975
- const wr = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
976
- function $r(e) {
977
- return U(e) && e.matches(wr);
978
- }
979
- const Ne = Math.min, me = Math.max, We = Math.round, De = Math.floor, ne = (e) => ({
980
- x: e,
981
- y: e
982
- }), Sr = {
983
- left: "right",
984
- right: "left",
985
- bottom: "top",
986
- top: "bottom"
987
- }, Rr = {
988
- start: "end",
989
- end: "start"
990
- };
991
- function Et(e, t, n) {
992
- return me(e, Ne(t, n));
993
- }
994
- function Ke(e, t) {
995
- return typeof e == "function" ? e(t) : e;
996
- }
997
- function pe(e) {
998
- return e.split("-")[0];
999
- }
1000
- function Xe(e) {
1001
- return e.split("-")[1];
1002
- }
1003
- function Jt(e) {
1004
- return e === "x" ? "y" : "x";
1005
- }
1006
- function Qt(e) {
1007
- return e === "y" ? "height" : "width";
1008
- }
1009
- function Ue(e) {
1010
- return ["top", "bottom"].includes(pe(e)) ? "y" : "x";
1011
- }
1012
- function en(e) {
1013
- return Jt(Ue(e));
1014
- }
1015
- function Er(e, t, n) {
1016
- n === void 0 && (n = !1);
1017
- const r = Xe(e), o = en(e), i = Qt(o);
1018
- let s = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
1019
- return t.reference[i] > t.floating[i] && (s = je(s)), [s, je(s)];
1020
- }
1021
- function Cr(e) {
1022
- const t = je(e);
1023
- return [it(e), t, it(t)];
1024
- }
1025
- function it(e) {
1026
- return e.replace(/start|end/g, (t) => Rr[t]);
1027
- }
1028
- function kr(e, t, n) {
1029
- const r = ["left", "right"], o = ["right", "left"], i = ["top", "bottom"], s = ["bottom", "top"];
1030
- switch (e) {
1031
- case "top":
1032
- case "bottom":
1033
- return n ? t ? o : r : t ? r : o;
1034
- case "left":
1035
- case "right":
1036
- return t ? i : s;
1037
- default:
1038
- return [];
1039
- }
1040
- }
1041
- function Tr(e, t, n, r) {
1042
- const o = Xe(e);
1043
- let i = kr(pe(e), n === "start", r);
1044
- return o && (i = i.map((s) => s + "-" + o), t && (i = i.concat(i.map(it)))), i;
1045
- }
1046
- function je(e) {
1047
- return e.replace(/left|right|bottom|top/g, (t) => Sr[t]);
1048
- }
1049
- function Ir(e) {
1050
- return {
1051
- top: 0,
1052
- right: 0,
1053
- bottom: 0,
1054
- left: 0,
1055
- ...e
1056
- };
1057
- }
1058
- function Pr(e) {
1059
- return typeof e != "number" ? Ir(e) : {
1060
- top: e,
1061
- right: e,
1062
- bottom: e,
1063
- left: e
1064
- };
1065
- }
1066
- function ze(e) {
1067
- return {
1068
- ...e,
1069
- top: e.y,
1070
- left: e.x,
1071
- right: e.x + e.width,
1072
- bottom: e.y + e.height
1073
- };
1074
- }
1075
- function Ct(e, t, n) {
1076
- let {
1077
- reference: r,
1078
- floating: o
1079
- } = e;
1080
- const i = Ue(t), s = en(t), l = Qt(s), a = pe(t), c = i === "y", m = r.x + r.width / 2 - o.width / 2, d = r.y + r.height / 2 - o.height / 2, f = r[l] / 2 - o[l] / 2;
1081
- let u;
1082
- switch (a) {
1083
- case "top":
1084
- u = {
1085
- x: m,
1086
- y: r.y - o.height
1087
- };
1088
- break;
1089
- case "bottom":
1090
- u = {
1091
- x: m,
1092
- y: r.y + r.height
1093
- };
1094
- break;
1095
- case "right":
1096
- u = {
1097
- x: r.x + r.width,
1098
- y: d
1099
- };
1100
- break;
1101
- case "left":
1102
- u = {
1103
- x: r.x - o.width,
1104
- y: d
1105
- };
1106
- break;
1107
- default:
1108
- u = {
1109
- x: r.x,
1110
- y: r.y
1111
- };
1112
- }
1113
- switch (Xe(t)) {
1114
- case "start":
1115
- u[s] -= f * (n && c ? -1 : 1);
1116
- break;
1117
- case "end":
1118
- u[s] += f * (n && c ? -1 : 1);
1119
- break;
1120
- }
1121
- return u;
1122
- }
1123
- const Ar = async (e, t, n) => {
1124
- const {
1125
- placement: r = "bottom",
1126
- strategy: o = "absolute",
1127
- middleware: i = [],
1128
- platform: s
1129
- } = n, l = i.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(t));
1130
- let c = await s.getElementRects({
1131
- reference: e,
1132
- floating: t,
1133
- strategy: o
1134
- }), {
1135
- x: m,
1136
- y: d
1137
- } = Ct(c, r, a), f = r, u = {}, g = 0;
1138
- for (let p = 0; p < l.length; p++) {
1139
- const {
1140
- name: $,
1141
- fn: h
1142
- } = l[p], {
1143
- x,
1144
- y: P,
1145
- data: S,
1146
- reset: C
1147
- } = await h({
1148
- x: m,
1149
- y: d,
1150
- initialPlacement: r,
1151
- placement: f,
1152
- strategy: o,
1153
- middlewareData: u,
1154
- rects: c,
1155
- platform: s,
1156
- elements: {
1157
- reference: e,
1158
- floating: t
1159
- }
1160
- });
1161
- m = x ?? m, d = P ?? d, u = {
1162
- ...u,
1163
- [$]: {
1164
- ...u[$],
1165
- ...S
1166
- }
1167
- }, C && g <= 50 && (g++, typeof C == "object" && (C.placement && (f = C.placement), C.rects && (c = C.rects === !0 ? await s.getElementRects({
1168
- reference: e,
1169
- floating: t,
1170
- strategy: o
1171
- }) : C.rects), {
1172
- x: m,
1173
- y: d
1174
- } = Ct(c, f, a)), p = -1);
1175
- }
1176
- return {
1177
- x: m,
1178
- y: d,
1179
- placement: f,
1180
- strategy: o,
1181
- middlewareData: u
1182
- };
1183
- };
1184
- async function tn(e, t) {
1185
- var n;
1186
- t === void 0 && (t = {});
1187
- const {
1188
- x: r,
1189
- y: o,
1190
- platform: i,
1191
- rects: s,
1192
- elements: l,
1193
- strategy: a
1194
- } = e, {
1195
- boundary: c = "clippingAncestors",
1196
- rootBoundary: m = "viewport",
1197
- elementContext: d = "floating",
1198
- altBoundary: f = !1,
1199
- padding: u = 0
1200
- } = Ke(t, e), g = Pr(u), $ = l[f ? d === "floating" ? "reference" : "floating" : d], h = ze(await i.getClippingRect({
1201
- element: (n = await (i.isElement == null ? void 0 : i.isElement($))) == null || n ? $ : $.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(l.floating)),
1202
- boundary: c,
1203
- rootBoundary: m,
1204
- strategy: a
1205
- })), x = d === "floating" ? {
1206
- ...s.floating,
1207
- x: r,
1208
- y: o
1209
- } : s.reference, P = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l.floating)), S = await (i.isElement == null ? void 0 : i.isElement(P)) ? await (i.getScale == null ? void 0 : i.getScale(P)) || {
1210
- x: 1,
1211
- y: 1
1212
- } : {
1213
- x: 1,
1214
- y: 1
1215
- }, C = ze(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
1216
- elements: l,
1217
- rect: x,
1218
- offsetParent: P,
1219
- strategy: a
1220
- }) : x);
1221
- return {
1222
- top: (h.top - C.top + g.top) / S.y,
1223
- bottom: (C.bottom - h.bottom + g.bottom) / S.y,
1224
- left: (h.left - C.left + g.left) / S.x,
1225
- right: (C.right - h.right + g.right) / S.x
1226
- };
1227
- }
1228
- const Br = function(e) {
1229
- return e === void 0 && (e = {}), {
1230
- name: "flip",
1231
- options: e,
1232
- async fn(t) {
1233
- var n, r;
1234
- const {
1235
- placement: o,
1236
- middlewareData: i,
1237
- rects: s,
1238
- initialPlacement: l,
1239
- platform: a,
1240
- elements: c
1241
- } = t, {
1242
- mainAxis: m = !0,
1243
- crossAxis: d = !0,
1244
- fallbackPlacements: f,
1245
- fallbackStrategy: u = "bestFit",
1246
- fallbackAxisSideDirection: g = "none",
1247
- flipAlignment: p = !0,
1248
- ...$
1249
- } = Ke(e, t);
1250
- if ((n = i.arrow) != null && n.alignmentOffset)
1251
- return {};
1252
- const h = pe(o), x = pe(l) === l, P = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), S = f || (x || !p ? [je(l)] : Cr(l));
1253
- !f && g !== "none" && S.push(...Tr(l, p, g, P));
1254
- const C = [l, ...S], I = await tn(t, $), A = [];
1255
- let k = ((r = i.flip) == null ? void 0 : r.overflows) || [];
1256
- if (m && A.push(I[h]), d) {
1257
- const M = Er(o, s, P);
1258
- A.push(I[M[0]], I[M[1]]);
1259
- }
1260
- if (k = [...k, {
1261
- placement: o,
1262
- overflows: A
1263
- }], !A.every((M) => M <= 0)) {
1264
- var O, D;
1265
- const M = (((O = i.flip) == null ? void 0 : O.index) || 0) + 1, B = C[M];
1266
- if (B)
1267
- return {
1268
- data: {
1269
- index: M,
1270
- overflows: k
1271
- },
1272
- reset: {
1273
- placement: B
1274
- }
1275
- };
1276
- let b = (D = k.filter((v) => v.overflows[0] <= 0).sort((v, T) => v.overflows[1] - T.overflows[1])[0]) == null ? void 0 : D.placement;
1277
- if (!b)
1278
- switch (u) {
1279
- case "bestFit": {
1280
- var L;
1281
- const v = (L = k.map((T) => [T.placement, T.overflows.filter((R) => R > 0).reduce((R, w) => R + w, 0)]).sort((T, R) => T[1] - R[1])[0]) == null ? void 0 : L[0];
1282
- v && (b = v);
1283
- break;
1284
- }
1285
- case "initialPlacement":
1286
- b = l;
1287
- break;
1288
- }
1289
- if (o !== b)
1290
- return {
1291
- reset: {
1292
- placement: b
1293
- }
1294
- };
1295
- }
1296
- return {};
1297
- }
1298
- };
1299
- };
1300
- async function Or(e, t) {
1301
- const {
1302
- placement: n,
1303
- platform: r,
1304
- elements: o
1305
- } = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), s = pe(n), l = Xe(n), a = Ue(n) === "y", c = ["left", "top"].includes(s) ? -1 : 1, m = i && a ? -1 : 1, d = Ke(t, e);
1306
- let {
1307
- mainAxis: f,
1308
- crossAxis: u,
1309
- alignmentAxis: g
1310
- } = typeof d == "number" ? {
1311
- mainAxis: d,
1312
- crossAxis: 0,
1313
- alignmentAxis: null
1314
- } : {
1315
- mainAxis: 0,
1316
- crossAxis: 0,
1317
- alignmentAxis: null,
1318
- ...d
1319
- };
1320
- return l && typeof g == "number" && (u = l === "end" ? g * -1 : g), a ? {
1321
- x: u * m,
1322
- y: f * c
1323
- } : {
1324
- x: f * c,
1325
- y: u * m
1326
- };
1327
- }
1328
- const Dr = function(e) {
1329
- return e === void 0 && (e = 0), {
1330
- name: "offset",
1331
- options: e,
1332
- async fn(t) {
1333
- var n, r;
1334
- const {
1335
- x: o,
1336
- y: i,
1337
- placement: s,
1338
- middlewareData: l
1339
- } = t, a = await Or(t, e);
1340
- return s === ((n = l.offset) == null ? void 0 : n.placement) && (r = l.arrow) != null && r.alignmentOffset ? {} : {
1341
- x: o + a.x,
1342
- y: i + a.y,
1343
- data: {
1344
- ...a,
1345
- placement: s
1346
- }
1347
- };
1348
- }
1349
- };
1350
- }, Mr = function(e) {
1351
- return e === void 0 && (e = {}), {
1352
- name: "shift",
1353
- options: e,
1354
- async fn(t) {
1355
- const {
1356
- x: n,
1357
- y: r,
1358
- placement: o
1359
- } = t, {
1360
- mainAxis: i = !0,
1361
- crossAxis: s = !1,
1362
- limiter: l = {
1363
- fn: ($) => {
1364
- let {
1365
- x: h,
1366
- y: x
1367
- } = $;
1368
- return {
1369
- x: h,
1370
- y: x
1371
- };
1372
- }
1373
- },
1374
- ...a
1375
- } = Ke(e, t), c = {
1376
- x: n,
1377
- y: r
1378
- }, m = await tn(t, a), d = Ue(pe(o)), f = Jt(d);
1379
- let u = c[f], g = c[d];
1380
- if (i) {
1381
- const $ = f === "y" ? "top" : "left", h = f === "y" ? "bottom" : "right", x = u + m[$], P = u - m[h];
1382
- u = Et(x, u, P);
1383
- }
1384
- if (s) {
1385
- const $ = d === "y" ? "top" : "left", h = d === "y" ? "bottom" : "right", x = g + m[$], P = g - m[h];
1386
- g = Et(x, g, P);
1387
- }
1388
- const p = l.fn({
1389
- ...t,
1390
- [f]: u,
1391
- [d]: g
1392
- });
1393
- return {
1394
- ...p,
1395
- data: {
1396
- x: p.x - n,
1397
- y: p.y - r
1398
- }
1399
- };
1400
- }
1401
- };
1402
- };
1403
- function nn(e) {
1404
- const t = q(e);
1405
- let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
1406
- const o = U(e), i = o ? e.offsetWidth : n, s = o ? e.offsetHeight : r, l = We(n) !== i || We(r) !== s;
1407
- return l && (n = i, r = s), {
1408
- width: n,
1409
- height: r,
1410
- $: l
1411
- };
1412
- }
1413
- function mt(e) {
1414
- return W(e) ? e : e.contextElement;
1415
- }
1416
- function Ce(e) {
1417
- const t = mt(e);
1418
- if (!U(t))
1419
- return ne(1);
1420
- const n = t.getBoundingClientRect(), {
1421
- width: r,
1422
- height: o,
1423
- $: i
1424
- } = nn(t);
1425
- let s = (i ? We(n.width) : n.width) / r, l = (i ? We(n.height) : n.height) / o;
1426
- return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
1427
- x: s,
1428
- y: l
1429
- };
1430
- }
1431
- const Lr = /* @__PURE__ */ ne(0);
1432
- function rn(e) {
1433
- const t = X(e);
1434
- return !ft() || !t.visualViewport ? Lr : {
1435
- x: t.visualViewport.offsetLeft,
1436
- y: t.visualViewport.offsetTop
1437
- };
1438
- }
1439
- function Fr(e, t, n) {
1440
- return t === void 0 && (t = !1), !n || t && n !== X(e) ? !1 : t;
1441
- }
1442
- function he(e, t, n, r) {
1443
- t === void 0 && (t = !1), n === void 0 && (n = !1);
1444
- const o = e.getBoundingClientRect(), i = mt(e);
1445
- let s = ne(1);
1446
- t && (r ? W(r) && (s = Ce(r)) : s = Ce(e));
1447
- const l = Fr(i, n, r) ? rn(i) : ne(0);
1448
- let a = (o.left + l.x) / s.x, c = (o.top + l.y) / s.y, m = o.width / s.x, d = o.height / s.y;
1449
- if (i) {
1450
- const f = X(i), u = r && W(r) ? X(r) : r;
1451
- let g = f, p = g.frameElement;
1452
- for (; p && r && u !== g; ) {
1453
- const $ = Ce(p), h = p.getBoundingClientRect(), x = q(p), P = h.left + (p.clientLeft + parseFloat(x.paddingLeft)) * $.x, S = h.top + (p.clientTop + parseFloat(x.paddingTop)) * $.y;
1454
- a *= $.x, c *= $.y, m *= $.x, d *= $.y, a += P, c += S, g = X(p), p = g.frameElement;
1455
- }
1456
- }
1457
- return ze({
1458
- width: m,
1459
- height: d,
1460
- x: a,
1461
- y: c
1462
- });
1463
- }
1464
- const Nr = [":popover-open", ":modal"];
1465
- function on(e) {
1466
- return Nr.some((t) => {
1467
- try {
1468
- return e.matches(t);
1469
- } catch {
1470
- return !1;
1471
- }
1472
- });
1473
- }
1474
- function Wr(e) {
1475
- let {
1476
- elements: t,
1477
- rect: n,
1478
- offsetParent: r,
1479
- strategy: o
1480
- } = e;
1481
- const i = o === "fixed", s = Q(r), l = t ? on(t.floating) : !1;
1482
- if (r === s || l && i)
1483
- return n;
1484
- let a = {
1485
- scrollLeft: 0,
1486
- scrollTop: 0
1487
- }, c = ne(1);
1488
- const m = ne(0), d = U(r);
1489
- if ((d || !d && !i) && ((te(r) !== "body" || Oe(s)) && (a = Ye(r)), U(r))) {
1490
- const f = he(r);
1491
- c = Ce(r), m.x = f.x + r.clientLeft, m.y = f.y + r.clientTop;
1492
- }
1493
- return {
1494
- width: n.width * c.x,
1495
- height: n.height * c.y,
1496
- x: n.x * c.x - a.scrollLeft * c.x + m.x,
1497
- y: n.y * c.y - a.scrollTop * c.y + m.y
1498
- };
1499
- }
1500
- function jr(e) {
1501
- return Array.from(e.getClientRects());
1502
- }
1503
- function sn(e) {
1504
- return he(Q(e)).left + Ye(e).scrollLeft;
1505
- }
1506
- function zr(e) {
1507
- const t = Q(e), n = Ye(e), r = e.ownerDocument.body, o = me(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = me(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
1508
- let s = -n.scrollLeft + sn(e);
1509
- const l = -n.scrollTop;
1510
- return q(r).direction === "rtl" && (s += me(t.clientWidth, r.clientWidth) - o), {
1511
- width: o,
1512
- height: i,
1513
- x: s,
1514
- y: l
1515
- };
1516
- }
1517
- function Hr(e, t) {
1518
- const n = X(e), r = Q(e), o = n.visualViewport;
1519
- let i = r.clientWidth, s = r.clientHeight, l = 0, a = 0;
1520
- if (o) {
1521
- i = o.width, s = o.height;
1522
- const c = ft();
1523
- (!c || c && t === "fixed") && (l = o.offsetLeft, a = o.offsetTop);
1524
- }
1525
- return {
1526
- width: i,
1527
- height: s,
1528
- x: l,
1529
- y: a
1530
- };
1531
- }
1532
- function Vr(e, t) {
1533
- const n = he(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = U(e) ? Ce(e) : ne(1), s = e.clientWidth * i.x, l = e.clientHeight * i.y, a = o * i.x, c = r * i.y;
1534
- return {
1535
- width: s,
1536
- height: l,
1537
- x: a,
1538
- y: c
1539
- };
1540
- }
1541
- function kt(e, t, n) {
1542
- let r;
1543
- if (t === "viewport")
1544
- r = Hr(e, n);
1545
- else if (t === "document")
1546
- r = zr(Q(e));
1547
- else if (W(t))
1548
- r = Vr(t, n);
1549
- else {
1550
- const o = rn(e);
1551
- r = {
1552
- ...t,
1553
- x: t.x - o.x,
1554
- y: t.y - o.y
1555
- };
1556
- }
1557
- return ze(r);
1558
- }
1559
- function ln(e, t) {
1560
- const n = ge(e);
1561
- return n === t || !W(n) || ke(n) ? !1 : q(n).position === "fixed" || ln(n, t);
1562
- }
1563
- function _r(e, t) {
1564
- const n = t.get(e);
1565
- if (n)
1566
- return n;
1567
- let r = ee(e, [], !1).filter((l) => W(l) && te(l) !== "body"), o = null;
1568
- const i = q(e).position === "fixed";
1569
- let s = i ? ge(e) : e;
1570
- for (; W(s) && !ke(s); ) {
1571
- const l = q(s), a = dt(s);
1572
- !a && l.position === "fixed" && (o = null), (i ? !a && !o : !a && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || Oe(s) && !a && ln(e, s)) ? r = r.filter((m) => m !== s) : o = l, s = ge(s);
1573
- }
1574
- return t.set(e, r), r;
1575
- }
1576
- function Yr(e) {
1577
- let {
1578
- element: t,
1579
- boundary: n,
1580
- rootBoundary: r,
1581
- strategy: o
1582
- } = e;
1583
- const s = [...n === "clippingAncestors" ? _r(t, this._c) : [].concat(n), r], l = s[0], a = s.reduce((c, m) => {
1584
- const d = kt(t, m, o);
1585
- return c.top = me(d.top, c.top), c.right = Ne(d.right, c.right), c.bottom = Ne(d.bottom, c.bottom), c.left = me(d.left, c.left), c;
1586
- }, kt(t, l, o));
1587
- return {
1588
- width: a.right - a.left,
1589
- height: a.bottom - a.top,
1590
- x: a.left,
1591
- y: a.top
1592
- };
1593
- }
1594
- function Kr(e) {
1595
- const {
1596
- width: t,
1597
- height: n
1598
- } = nn(e);
1599
- return {
1600
- width: t,
1601
- height: n
1602
- };
1603
- }
1604
- function Xr(e, t, n) {
1605
- const r = U(t), o = Q(t), i = n === "fixed", s = he(e, !0, i, t);
1606
- let l = {
1607
- scrollLeft: 0,
1608
- scrollTop: 0
1609
- };
1610
- const a = ne(0);
1611
- if (r || !r && !i)
1612
- if ((te(t) !== "body" || Oe(o)) && (l = Ye(t)), r) {
1613
- const d = he(t, !0, i, t);
1614
- a.x = d.x + t.clientLeft, a.y = d.y + t.clientTop;
1615
- } else
1616
- o && (a.x = sn(o));
1617
- const c = s.left + l.scrollLeft - a.x, m = s.top + l.scrollTop - a.y;
1618
- return {
1619
- x: c,
1620
- y: m,
1621
- width: s.width,
1622
- height: s.height
1623
- };
1624
- }
1625
- function Tt(e, t) {
1626
- return !U(e) || q(e).position === "fixed" ? null : t ? t(e) : e.offsetParent;
1627
- }
1628
- function an(e, t) {
1629
- const n = X(e);
1630
- if (!U(e) || on(e))
1631
- return n;
1632
- let r = Tt(e, t);
1633
- for (; r && pr(r) && q(r).position === "static"; )
1634
- r = Tt(r, t);
1635
- return r && (te(r) === "html" || te(r) === "body" && q(r).position === "static" && !dt(r)) ? n : r || hr(e) || n;
1636
- }
1637
- const Ur = async function(e) {
1638
- const t = this.getOffsetParent || an, n = this.getDimensions;
1639
- return {
1640
- reference: Xr(e.reference, await t(e.floating), e.strategy),
1641
- floating: {
1642
- x: 0,
1643
- y: 0,
1644
- ...await n(e.floating)
1645
- }
1646
- };
1647
- };
1648
- function qr(e) {
1649
- return q(e).direction === "rtl";
1650
- }
1651
- const Gr = {
1652
- convertOffsetParentRelativeRectToViewportRelativeRect: Wr,
1653
- getDocumentElement: Q,
1654
- getClippingRect: Yr,
1655
- getOffsetParent: an,
1656
- getElementRects: Ur,
1657
- getClientRects: jr,
1658
- getDimensions: Kr,
1659
- getScale: Ce,
1660
- isElement: W,
1661
- isRTL: qr
1662
- };
1663
- function Zr(e, t) {
1664
- let n = null, r;
1665
- const o = Q(e);
1666
- function i() {
1667
- var l;
1668
- clearTimeout(r), (l = n) == null || l.disconnect(), n = null;
1669
- }
1670
- function s(l, a) {
1671
- l === void 0 && (l = !1), a === void 0 && (a = 1), i();
1672
- const {
1673
- left: c,
1674
- top: m,
1675
- width: d,
1676
- height: f
1677
- } = e.getBoundingClientRect();
1678
- if (l || t(), !d || !f)
1679
- return;
1680
- const u = De(m), g = De(o.clientWidth - (c + d)), p = De(o.clientHeight - (m + f)), $ = De(c), x = {
1681
- rootMargin: -u + "px " + -g + "px " + -p + "px " + -$ + "px",
1682
- threshold: me(0, Ne(1, a)) || 1
1683
- };
1684
- let P = !0;
1685
- function S(C) {
1686
- const I = C[0].intersectionRatio;
1687
- if (I !== a) {
1688
- if (!P)
1689
- return s();
1690
- I ? s(!1, I) : r = setTimeout(() => {
1691
- s(!1, 1e-7);
1692
- }, 100);
1693
- }
1694
- P = !1;
1695
- }
1696
- try {
1697
- n = new IntersectionObserver(S, {
1698
- ...x,
1699
- // Handle <iframe>s
1700
- root: o.ownerDocument
1701
- });
1702
- } catch {
1703
- n = new IntersectionObserver(S, x);
1704
- }
1705
- n.observe(e);
1706
- }
1707
- return s(!0), i;
1708
- }
1709
- function Jr(e, t, n, r) {
1710
- r === void 0 && (r = {});
1711
- const {
1712
- ancestorScroll: o = !0,
1713
- ancestorResize: i = !0,
1714
- elementResize: s = typeof ResizeObserver == "function",
1715
- layoutShift: l = typeof IntersectionObserver == "function",
1716
- animationFrame: a = !1
1717
- } = r, c = mt(e), m = o || i ? [...c ? ee(c) : [], ...ee(t)] : [];
1718
- m.forEach((h) => {
1719
- o && h.addEventListener("scroll", n, {
1720
- passive: !0
1721
- }), i && h.addEventListener("resize", n);
1722
- });
1723
- const d = c && l ? Zr(c, n) : null;
1724
- let f = -1, u = null;
1725
- s && (u = new ResizeObserver((h) => {
1726
- let [x] = h;
1727
- x && x.target === c && u && (u.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
1728
- var P;
1729
- (P = u) == null || P.observe(t);
1730
- })), n();
1731
- }), c && !a && u.observe(c), u.observe(t));
1732
- let g, p = a ? he(e) : null;
1733
- a && $();
1734
- function $() {
1735
- const h = he(e);
1736
- p && (h.x !== p.x || h.y !== p.y || h.width !== p.width || h.height !== p.height) && n(), p = h, g = requestAnimationFrame($);
1737
- }
1738
- return n(), () => {
1739
- var h;
1740
- m.forEach((x) => {
1741
- o && x.removeEventListener("scroll", n), i && x.removeEventListener("resize", n);
1742
- }), d == null || d(), (h = u) == null || h.disconnect(), u = null, a && cancelAnimationFrame(g);
1743
- };
1744
- }
1745
- const Qr = Mr, eo = Br, to = (e, t, n) => {
1746
- const r = /* @__PURE__ */ new Map(), o = {
1747
- platform: Gr,
1748
- ...n
1749
- }, i = {
1750
- ...o.platform,
1751
- _c: r
1752
- };
1753
- return Ar(e, t, {
1754
- ...o,
1755
- platform: i
1756
- });
1757
- };
1758
- var Me = typeof document < "u" ? Yt : Kt;
1759
- function He(e, t) {
1760
- if (e === t)
1761
- return !0;
1762
- if (typeof e != typeof t)
1763
- return !1;
1764
- if (typeof e == "function" && e.toString() === t.toString())
1765
- return !0;
1766
- let n, r, o;
1767
- if (e && t && typeof e == "object") {
1768
- if (Array.isArray(e)) {
1769
- if (n = e.length, n !== t.length)
1770
- return !1;
1771
- for (r = n; r-- !== 0; )
1772
- if (!He(e[r], t[r]))
1773
- return !1;
1774
- return !0;
1775
- }
1776
- if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
1777
- return !1;
1778
- for (r = n; r-- !== 0; )
1779
- if (!{}.hasOwnProperty.call(t, o[r]))
1780
- return !1;
1781
- for (r = n; r-- !== 0; ) {
1782
- const i = o[r];
1783
- if (!(i === "_owner" && e.$$typeof) && !He(e[i], t[i]))
1784
- return !1;
1785
- }
1786
- return !0;
1787
- }
1788
- return e !== e && t !== t;
1789
- }
1790
- function cn(e) {
1791
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1792
- }
1793
- function It(e, t) {
1794
- const n = cn(e);
1795
- return Math.round(t * n) / n;
1796
- }
1797
- function Pt(e) {
1798
- const t = y.useRef(e);
1799
- return Me(() => {
1800
- t.current = e;
1801
- }), t;
1802
- }
1803
- function no(e) {
1804
- e === void 0 && (e = {});
1805
- const {
1806
- placement: t = "bottom",
1807
- strategy: n = "absolute",
1808
- middleware: r = [],
1809
- platform: o,
1810
- elements: {
1811
- reference: i,
1812
- floating: s
1813
- } = {},
1814
- transform: l = !0,
1815
- whileElementsMounted: a,
1816
- open: c
1817
- } = e, [m, d] = y.useState({
1818
- x: 0,
1819
- y: 0,
1820
- strategy: n,
1821
- placement: t,
1822
- middlewareData: {},
1823
- isPositioned: !1
1824
- }), [f, u] = y.useState(r);
1825
- He(f, r) || u(r);
1826
- const [g, p] = y.useState(null), [$, h] = y.useState(null), x = y.useCallback((R) => {
1827
- R !== I.current && (I.current = R, p(R));
1828
- }, []), P = y.useCallback((R) => {
1829
- R !== A.current && (A.current = R, h(R));
1830
- }, []), S = i || g, C = s || $, I = y.useRef(null), A = y.useRef(null), k = y.useRef(m), O = a != null, D = Pt(a), L = Pt(o), M = y.useCallback(() => {
1831
- if (!I.current || !A.current)
1832
- return;
1833
- const R = {
1834
- placement: t,
1835
- strategy: n,
1836
- middleware: f
1837
- };
1838
- L.current && (R.platform = L.current), to(I.current, A.current, R).then((w) => {
1839
- const F = {
1840
- ...w,
1841
- isPositioned: !0
1842
- };
1843
- B.current && !He(k.current, F) && (k.current = F, Rn.flushSync(() => {
1844
- d(F);
1845
- }));
1846
- });
1847
- }, [f, t, n, L]);
1848
- Me(() => {
1849
- c === !1 && k.current.isPositioned && (k.current.isPositioned = !1, d((R) => ({
1850
- ...R,
1851
- isPositioned: !1
1852
- })));
1853
- }, [c]);
1854
- const B = y.useRef(!1);
1855
- Me(() => (B.current = !0, () => {
1856
- B.current = !1;
1857
- }), []), Me(() => {
1858
- if (S && (I.current = S), C && (A.current = C), S && C) {
1859
- if (D.current)
1860
- return D.current(S, C, M);
1861
- M();
1862
- }
1863
- }, [S, C, M, D, O]);
1864
- const b = y.useMemo(() => ({
1865
- reference: I,
1866
- floating: A,
1867
- setReference: x,
1868
- setFloating: P
1869
- }), [x, P]), v = y.useMemo(() => ({
1870
- reference: S,
1871
- floating: C
1872
- }), [S, C]), T = y.useMemo(() => {
1873
- const R = {
1874
- position: n,
1875
- left: 0,
1876
- top: 0
1877
- };
1878
- if (!v.floating)
1879
- return R;
1880
- const w = It(v.floating, m.x), F = It(v.floating, m.y);
1881
- return l ? {
1882
- ...R,
1883
- transform: "translate(" + w + "px, " + F + "px)",
1884
- ...cn(v.floating) >= 1.5 && {
1885
- willChange: "transform"
1886
- }
1887
- } : {
1888
- position: n,
1889
- left: w,
1890
- top: F
1891
- };
1892
- }, [n, l, v.floating, m.x, m.y]);
1893
- return y.useMemo(() => ({
1894
- ...m,
1895
- update: M,
1896
- refs: b,
1897
- elements: v,
1898
- floatingStyles: T
1899
- }), [m, M, b, v, T]);
1900
- }
1901
- /*!
1902
- * tabbable 6.2.0
1903
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
1904
- */
1905
- var ro = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], st = /* @__PURE__ */ ro.join(","), un = typeof Element > "u", Be = un ? function() {
1906
- } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Ve = !un && Element.prototype.getRootNode ? function(e) {
1907
- var t;
1908
- return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
1909
- } : function(e) {
1910
- return e == null ? void 0 : e.ownerDocument;
1911
- }, _e = function e(t, n) {
1912
- var r;
1913
- n === void 0 && (n = !0);
1914
- var o = t == null || (r = t.getAttribute) === null || r === void 0 ? void 0 : r.call(t, "inert"), i = o === "" || o === "true", s = i || n && t && e(t.parentNode);
1915
- return s;
1916
- }, oo = function(t) {
1917
- var n, r = t == null || (n = t.getAttribute) === null || n === void 0 ? void 0 : n.call(t, "contenteditable");
1918
- return r === "" || r === "true";
1919
- }, io = function(t, n, r) {
1920
- if (_e(t))
1921
- return [];
1922
- var o = Array.prototype.slice.apply(t.querySelectorAll(st));
1923
- return n && Be.call(t, st) && o.unshift(t), o = o.filter(r), o;
1924
- }, so = function e(t, n, r) {
1925
- for (var o = [], i = Array.from(t); i.length; ) {
1926
- var s = i.shift();
1927
- if (!_e(s, !1))
1928
- if (s.tagName === "SLOT") {
1929
- var l = s.assignedElements(), a = l.length ? l : s.children, c = e(a, !0, r);
1930
- r.flatten ? o.push.apply(o, c) : o.push({
1931
- scopeParent: s,
1932
- candidates: c
1933
- });
1934
- } else {
1935
- var m = Be.call(s, st);
1936
- m && r.filter(s) && (n || !t.includes(s)) && o.push(s);
1937
- var d = s.shadowRoot || // check for an undisclosed shadow
1938
- typeof r.getShadowRoot == "function" && r.getShadowRoot(s), f = !_e(d, !1) && (!r.shadowRootFilter || r.shadowRootFilter(s));
1939
- if (d && f) {
1940
- var u = e(d === !0 ? s.children : d.children, !0, r);
1941
- r.flatten ? o.push.apply(o, u) : o.push({
1942
- scopeParent: s,
1943
- candidates: u
1944
- });
1945
- } else
1946
- i.unshift.apply(i, s.children);
1947
- }
1948
- }
1949
- return o;
1950
- }, dn = function(t) {
1951
- return !isNaN(parseInt(t.getAttribute("tabindex"), 10));
1952
- }, fn = function(t) {
1953
- if (!t)
1954
- throw new Error("No node provided");
1955
- return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || oo(t)) && !dn(t) ? 0 : t.tabIndex;
1956
- }, lo = function(t, n) {
1957
- var r = fn(t);
1958
- return r < 0 && n && !dn(t) ? 0 : r;
1959
- }, ao = function(t, n) {
1960
- return t.tabIndex === n.tabIndex ? t.documentOrder - n.documentOrder : t.tabIndex - n.tabIndex;
1961
- }, mn = function(t) {
1962
- return t.tagName === "INPUT";
1963
- }, co = function(t) {
1964
- return mn(t) && t.type === "hidden";
1965
- }, uo = function(t) {
1966
- var n = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(r) {
1967
- return r.tagName === "SUMMARY";
1968
- });
1969
- return n;
1970
- }, fo = function(t, n) {
1971
- for (var r = 0; r < t.length; r++)
1972
- if (t[r].checked && t[r].form === n)
1973
- return t[r];
1974
- }, mo = function(t) {
1975
- if (!t.name)
1976
- return !0;
1977
- var n = t.form || Ve(t), r = function(l) {
1978
- return n.querySelectorAll('input[type="radio"][name="' + l + '"]');
1979
- }, o;
1980
- if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
1981
- o = r(window.CSS.escape(t.name));
1982
- else
1983
- try {
1984
- o = r(t.name);
1985
- } catch (s) {
1986
- return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", s.message), !1;
1987
- }
1988
- var i = fo(o, t.form);
1989
- return !i || i === t;
1990
- }, go = function(t) {
1991
- return mn(t) && t.type === "radio";
1992
- }, po = function(t) {
1993
- return go(t) && !mo(t);
1994
- }, ho = function(t) {
1995
- var n, r = t && Ve(t), o = (n = r) === null || n === void 0 ? void 0 : n.host, i = !1;
1996
- if (r && r !== t) {
1997
- var s, l, a;
1998
- for (i = !!((s = o) !== null && s !== void 0 && (l = s.ownerDocument) !== null && l !== void 0 && l.contains(o) || t != null && (a = t.ownerDocument) !== null && a !== void 0 && a.contains(t)); !i && o; ) {
1999
- var c, m, d;
2000
- r = Ve(o), o = (c = r) === null || c === void 0 ? void 0 : c.host, i = !!((m = o) !== null && m !== void 0 && (d = m.ownerDocument) !== null && d !== void 0 && d.contains(o));
2001
- }
2002
- }
2003
- return i;
2004
- }, At = function(t) {
2005
- var n = t.getBoundingClientRect(), r = n.width, o = n.height;
2006
- return r === 0 && o === 0;
2007
- }, bo = function(t, n) {
2008
- var r = n.displayCheck, o = n.getShadowRoot;
2009
- if (getComputedStyle(t).visibility === "hidden")
2010
- return !0;
2011
- var i = Be.call(t, "details>summary:first-of-type"), s = i ? t.parentElement : t;
2012
- if (Be.call(s, "details:not([open]) *"))
2013
- return !0;
2014
- if (!r || r === "full" || r === "legacy-full") {
2015
- if (typeof o == "function") {
2016
- for (var l = t; t; ) {
2017
- var a = t.parentElement, c = Ve(t);
2018
- if (a && !a.shadowRoot && o(a) === !0)
2019
- return At(t);
2020
- t.assignedSlot ? t = t.assignedSlot : !a && c !== t.ownerDocument ? t = c.host : t = a;
2021
- }
2022
- t = l;
2023
- }
2024
- if (ho(t))
2025
- return !t.getClientRects().length;
2026
- if (r !== "legacy-full")
2027
- return !0;
2028
- } else if (r === "non-zero-area")
2029
- return At(t);
2030
- return !1;
2031
- }, yo = function(t) {
2032
- if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
2033
- for (var n = t.parentElement; n; ) {
2034
- if (n.tagName === "FIELDSET" && n.disabled) {
2035
- for (var r = 0; r < n.children.length; r++) {
2036
- var o = n.children.item(r);
2037
- if (o.tagName === "LEGEND")
2038
- return Be.call(n, "fieldset[disabled] *") ? !0 : !o.contains(t);
2039
- }
2040
- return !0;
2041
- }
2042
- n = n.parentElement;
2043
- }
2044
- return !1;
2045
- }, vo = function(t, n) {
2046
- return !(n.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
2047
- // because we're limited in the type of selectors we can use in JSDom (see related
2048
- // note related to `candidateSelectors`)
2049
- _e(n) || co(n) || bo(n, t) || // For a details element with a summary, the summary element gets the focus
2050
- uo(n) || yo(n));
2051
- }, Bt = function(t, n) {
2052
- return !(po(n) || fn(n) < 0 || !vo(t, n));
2053
- }, xo = function(t) {
2054
- var n = parseInt(t.getAttribute("tabindex"), 10);
2055
- return !!(isNaN(n) || n >= 0);
2056
- }, wo = function e(t) {
2057
- var n = [], r = [];
2058
- return t.forEach(function(o, i) {
2059
- var s = !!o.scopeParent, l = s ? o.scopeParent : o, a = lo(l, s), c = s ? e(o.candidates) : l;
2060
- a === 0 ? s ? n.push.apply(n, c) : n.push(l) : r.push({
2061
- documentOrder: i,
2062
- tabIndex: a,
2063
- item: o,
2064
- isScope: s,
2065
- content: c
2066
- });
2067
- }), r.sort(ao).reduce(function(o, i) {
2068
- return i.isScope ? o.push.apply(o, i.content) : o.push(i.content), o;
2069
- }, []).concat(n);
2070
- }, gn = function(t, n) {
2071
- n = n || {};
2072
- var r;
2073
- return n.getShadowRoot ? r = so([t], n.includeContainer, {
2074
- filter: Bt.bind(null, n),
2075
- flatten: !1,
2076
- getShadowRoot: n.getShadowRoot,
2077
- shadowRootFilter: xo
2078
- }) : r = io(t, n.includeContainer, Bt.bind(null, n)), wo(r);
2079
- };
2080
- const $o = y[/* @__PURE__ */ "useInsertionEffect".toString()], So = $o || ((e) => e());
2081
- function Se(e) {
2082
- const t = y.useRef(() => {
2083
- if (process.env.NODE_ENV !== "production")
2084
- throw new Error("Cannot call an event handler while rendering.");
2085
- });
2086
- return So(() => {
2087
- t.current = e;
2088
- }), y.useCallback(function() {
2089
- for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
2090
- r[o] = arguments[o];
2091
- return t.current == null ? void 0 : t.current(...r);
2092
- }, []);
2093
- }
2094
- var Z = typeof document < "u" ? Yt : Kt;
2095
- function lt() {
2096
- return lt = Object.assign ? Object.assign.bind() : function(e) {
2097
- for (var t = 1; t < arguments.length; t++) {
2098
- var n = arguments[t];
2099
- for (var r in n)
2100
- Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
2101
- }
2102
- return e;
2103
- }, lt.apply(this, arguments);
2104
- }
2105
- let Qe = !1, Ro = 0;
2106
- const Ot = () => "floating-ui-" + Ro++;
2107
- function Eo() {
2108
- const [e, t] = y.useState(() => Qe ? Ot() : void 0);
2109
- return Z(() => {
2110
- e == null && t(Ot());
2111
- }, []), y.useEffect(() => {
2112
- Qe || (Qe = !0);
2113
- }, []), e;
2114
- }
2115
- const Co = y[/* @__PURE__ */ "useId".toString()], gt = Co || Eo;
2116
- function ko() {
2117
- const e = /* @__PURE__ */ new Map();
2118
- return {
2119
- emit(t, n) {
2120
- var r;
2121
- (r = e.get(t)) == null || r.forEach((o) => o(n));
2122
- },
2123
- on(t, n) {
2124
- e.set(t, [...e.get(t) || [], n]);
2125
- },
2126
- off(t, n) {
2127
- var r;
2128
- e.set(t, ((r = e.get(t)) == null ? void 0 : r.filter((o) => o !== n)) || []);
2129
- }
2130
- };
2131
- }
2132
- const To = /* @__PURE__ */ y.createContext(null), Io = /* @__PURE__ */ y.createContext(null), pt = () => {
2133
- var e;
2134
- return ((e = y.useContext(To)) == null ? void 0 : e.id) || null;
2135
- }, ht = () => y.useContext(Io);
2136
- function qe(e) {
2137
- return "data-floating-ui-" + e;
2138
- }
2139
- function Ee(e) {
2140
- const t = vn(e);
2141
- return Z(() => {
2142
- t.current = e;
2143
- }), t;
2144
- }
2145
- const Dt = /* @__PURE__ */ qe("safe-polygon");
2146
- function et(e, t, n) {
2147
- return n && !Fe(n) ? 0 : typeof e == "number" ? e : e == null ? void 0 : e[t];
2148
- }
2149
- function Po(e, t) {
2150
- t === void 0 && (t = {});
2151
- const {
2152
- open: n,
2153
- onOpenChange: r,
2154
- dataRef: o,
2155
- events: i,
2156
- elements: {
2157
- domReference: s,
2158
- floating: l
2159
- },
2160
- refs: a
2161
- } = e, {
2162
- enabled: c = !0,
2163
- delay: m = 0,
2164
- handleClose: d = null,
2165
- mouseOnly: f = !1,
2166
- restMs: u = 0,
2167
- move: g = !0
2168
- } = t, p = ht(), $ = pt(), h = Ee(d), x = Ee(m), P = y.useRef(), S = y.useRef(), C = y.useRef(), I = y.useRef(), A = y.useRef(!0), k = y.useRef(!1), O = y.useRef(() => {
2169
- }), D = y.useCallback(() => {
2170
- var b;
2171
- const v = (b = o.current.openEvent) == null ? void 0 : b.type;
2172
- return (v == null ? void 0 : v.includes("mouse")) && v !== "mousedown";
2173
- }, [o]);
2174
- y.useEffect(() => {
2175
- if (!c)
2176
- return;
2177
- function b(v) {
2178
- let {
2179
- open: T
2180
- } = v;
2181
- T || (clearTimeout(S.current), clearTimeout(I.current), A.current = !0);
2182
- }
2183
- return i.on("openchange", b), () => {
2184
- i.off("openchange", b);
2185
- };
2186
- }, [c, i]), y.useEffect(() => {
2187
- if (!c || !h.current || !n)
2188
- return;
2189
- function b(T) {
2190
- D() && r(!1, T, "hover");
2191
- }
2192
- const v = ce(l).documentElement;
2193
- return v.addEventListener("mouseleave", b), () => {
2194
- v.removeEventListener("mouseleave", b);
2195
- };
2196
- }, [l, n, r, c, h, D]);
2197
- const L = y.useCallback(function(b, v, T) {
2198
- v === void 0 && (v = !0), T === void 0 && (T = "hover");
2199
- const R = et(x.current, "close", P.current);
2200
- R && !C.current ? (clearTimeout(S.current), S.current = setTimeout(() => r(!1, b, T), R)) : v && (clearTimeout(S.current), r(!1, b, T));
2201
- }, [x, r]), M = y.useCallback(() => {
2202
- O.current(), C.current = void 0;
2203
- }, []), B = y.useCallback(() => {
2204
- if (k.current) {
2205
- const b = ce(a.floating.current).body;
2206
- b.style.pointerEvents = "", b.removeAttribute(Dt), k.current = !1;
2207
- }
2208
- }, [a]);
2209
- return y.useEffect(() => {
2210
- if (!c)
2211
- return;
2212
- function b() {
2213
- return o.current.openEvent ? ["click", "mousedown"].includes(o.current.openEvent.type) : !1;
2214
- }
2215
- function v(w) {
2216
- if (clearTimeout(S.current), A.current = !1, f && !Fe(P.current) || u > 0 && et(x.current, "open") === 0)
2217
- return;
2218
- const F = et(x.current, "open", P.current);
2219
- F ? S.current = setTimeout(() => {
2220
- r(!0, w, "hover");
2221
- }, F) : r(!0, w, "hover");
2222
- }
2223
- function T(w) {
2224
- if (b())
2225
- return;
2226
- O.current();
2227
- const F = ce(l);
2228
- if (clearTimeout(I.current), h.current) {
2229
- n || clearTimeout(S.current), C.current = h.current({
2230
- ...e,
2231
- tree: p,
2232
- x: w.clientX,
2233
- y: w.clientY,
2234
- onClose() {
2235
- B(), M(), L(w, !0, "safe-polygon");
2236
- }
2237
- });
2238
- const K = C.current;
2239
- F.addEventListener("mousemove", K), O.current = () => {
2240
- F.removeEventListener("mousemove", K);
2241
- };
2242
- return;
2243
- }
2244
- (P.current === "touch" ? !fe(l, w.relatedTarget) : !0) && L(w);
2245
- }
2246
- function R(w) {
2247
- b() || h.current == null || h.current({
2248
- ...e,
2249
- tree: p,
2250
- x: w.clientX,
2251
- y: w.clientY,
2252
- onClose() {
2253
- B(), M(), L(w);
2254
- }
2255
- })(w);
2256
- }
2257
- if (W(s)) {
2258
- const w = s;
2259
- return n && w.addEventListener("mouseleave", R), l == null || l.addEventListener("mouseleave", R), g && w.addEventListener("mousemove", v, {
2260
- once: !0
2261
- }), w.addEventListener("mouseenter", v), w.addEventListener("mouseleave", T), () => {
2262
- n && w.removeEventListener("mouseleave", R), l == null || l.removeEventListener("mouseleave", R), g && w.removeEventListener("mousemove", v), w.removeEventListener("mouseenter", v), w.removeEventListener("mouseleave", T);
2263
- };
2264
- }
2265
- }, [s, l, c, e, f, u, g, L, M, B, r, n, p, x, h, o]), Z(() => {
2266
- var b;
2267
- if (c && n && (b = h.current) != null && b.__options.blockPointerEvents && D()) {
2268
- const T = ce(l).body;
2269
- if (T.setAttribute(Dt, ""), T.style.pointerEvents = "none", k.current = !0, W(s) && l) {
2270
- var v;
2271
- const R = s, w = p == null || (v = p.nodesRef.current.find((F) => F.id === $)) == null || (v = v.context) == null ? void 0 : v.elements.floating;
2272
- return w && (w.style.pointerEvents = ""), R.style.pointerEvents = "auto", l.style.pointerEvents = "auto", () => {
2273
- R.style.pointerEvents = "", l.style.pointerEvents = "";
2274
- };
2275
- }
2276
- }
2277
- }, [c, n, $, l, s, p, h, D]), Z(() => {
2278
- n || (P.current = void 0, M(), B());
2279
- }, [n, M, B]), y.useEffect(() => () => {
2280
- M(), clearTimeout(S.current), clearTimeout(I.current), B();
2281
- }, [c, s, M, B]), y.useMemo(() => {
2282
- if (!c)
2283
- return {};
2284
- function b(v) {
2285
- P.current = v.pointerType;
2286
- }
2287
- return {
2288
- reference: {
2289
- onPointerDown: b,
2290
- onPointerEnter: b,
2291
- onMouseMove(v) {
2292
- n || u === 0 || (clearTimeout(I.current), I.current = setTimeout(() => {
2293
- A.current || r(!0, v.nativeEvent, "hover");
2294
- }, u));
2295
- }
2296
- },
2297
- floating: {
2298
- onMouseEnter() {
2299
- clearTimeout(S.current);
2300
- },
2301
- onMouseLeave(v) {
2302
- L(v.nativeEvent, !1);
2303
- }
2304
- }
2305
- };
2306
- }, [c, u, n, r, L]);
2307
- }
2308
- function Le(e, t) {
2309
- let n = e.filter((o) => {
2310
- var i;
2311
- return o.parentId === t && ((i = o.context) == null ? void 0 : i.open);
2312
- }), r = n;
2313
- for (; r.length; )
2314
- r = e.filter((o) => {
2315
- var i;
2316
- return (i = r) == null ? void 0 : i.some((s) => {
2317
- var l;
2318
- return o.parentId === s.id && ((l = o.context) == null ? void 0 : l.open);
2319
- });
2320
- }), n = n.concat(r);
2321
- return n;
2322
- }
2323
- const pn = () => ({
2324
- getShadowRoot: !0,
2325
- displayCheck: (
2326
- // JSDOM does not support the `tabbable` library. To solve this we can
2327
- // check if `ResizeObserver` is a real function (not polyfilled), which
2328
- // determines if the current environment is JSDOM-like.
2329
- typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
2330
- )
2331
- });
2332
- function hn(e, t) {
2333
- const n = gn(e, pn());
2334
- t === "prev" && n.reverse();
2335
- const r = n.indexOf(br(ce(e)));
2336
- return n.slice(r + 1)[0];
2337
- }
2338
- function Ao() {
2339
- return hn(document.body, "next");
2340
- }
2341
- function Bo() {
2342
- return hn(document.body, "prev");
2343
- }
2344
- function tt(e, t) {
2345
- const n = t || e.currentTarget, r = e.relatedTarget;
2346
- return !r || !fe(n, r);
2347
- }
2348
- function Oo(e) {
2349
- gn(e, pn()).forEach((n) => {
2350
- n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
2351
- });
2352
- }
2353
- function Do(e) {
2354
- e.querySelectorAll("[data-tabindex]").forEach((n) => {
2355
- const r = n.dataset.tabindex;
2356
- delete n.dataset.tabindex, r ? n.setAttribute("tabindex", r) : n.removeAttribute("tabindex");
2357
- });
2358
- }
2359
- const bn = {
2360
- border: 0,
2361
- clip: "rect(0 0 0 0)",
2362
- height: "1px",
2363
- margin: "-1px",
2364
- overflow: "hidden",
2365
- padding: 0,
2366
- position: "fixed",
2367
- whiteSpace: "nowrap",
2368
- width: "1px",
2369
- top: 0,
2370
- left: 0
2371
- };
2372
- let Mo;
2373
- function Mt(e) {
2374
- e.key === "Tab" && (e.target, clearTimeout(Mo));
2375
- }
2376
- const Lt = /* @__PURE__ */ y.forwardRef(function(t, n) {
2377
- const [r, o] = y.useState();
2378
- Z(() => (yr() && o("button"), document.addEventListener("keydown", Mt), () => {
2379
- document.removeEventListener("keydown", Mt);
2380
- }), []);
2381
- const i = {
2382
- ref: n,
2383
- tabIndex: 0,
2384
- // Role is only for VoiceOver
2385
- role: r,
2386
- "aria-hidden": r ? void 0 : !0,
2387
- [qe("focus-guard")]: "",
2388
- style: bn
2389
- };
2390
- return /* @__PURE__ */ y.createElement("span", lt({}, t, i));
2391
- }), yn = /* @__PURE__ */ y.createContext(null), Ft = /* @__PURE__ */ qe("portal");
2392
- function Lo(e) {
2393
- let {
2394
- id: t,
2395
- root: n
2396
- } = e === void 0 ? {} : e;
2397
- const [r, o] = y.useState(null), i = gt(), s = No(), l = y.useRef(null);
2398
- return Z(() => () => {
2399
- r == null || r.remove(), queueMicrotask(() => {
2400
- l.current = null;
2401
- });
2402
- }, [r]), Z(() => {
2403
- if (l.current)
2404
- return;
2405
- const a = t ? document.getElementById(t) : null;
2406
- if (!a)
2407
- return;
2408
- const c = document.createElement("div");
2409
- c.id = i, c.setAttribute(Ft, ""), a.appendChild(c), l.current = c, o(c);
2410
- }, [t, i]), Z(() => {
2411
- if (l.current)
2412
- return;
2413
- let a = n || (s == null ? void 0 : s.portalNode);
2414
- a && !W(a) && (a = a.current), a = a || document.body;
2415
- let c = null;
2416
- t && (c = document.createElement("div"), c.id = t, a.appendChild(c));
2417
- const m = document.createElement("div");
2418
- m.id = i, m.setAttribute(Ft, ""), a = c || a, a.appendChild(m), l.current = m, o(m);
2419
- }, [t, n, i, s]), r;
2420
- }
2421
- function Fo(e) {
2422
- let {
2423
- children: t,
2424
- id: n,
2425
- root: r = null,
2426
- preserveTabOrder: o = !0
2427
- } = e;
2428
- const i = Lo({
2429
- id: n,
2430
- root: r
2431
- }), [s, l] = y.useState(null), a = y.useRef(null), c = y.useRef(null), m = y.useRef(null), d = y.useRef(null), f = (
2432
- // The FocusManager and therefore floating element are currently open/
2433
- // rendered.
2434
- !!s && // Guards are only for non-modal focus management.
2435
- !s.modal && // Don't render if unmount is transitioning.
2436
- s.open && o && !!(r || i)
2437
- );
2438
- return y.useEffect(() => {
2439
- if (!i || !o || s != null && s.modal)
2440
- return;
2441
- function u(g) {
2442
- i && tt(g) && (g.type === "focusin" ? Do : Oo)(i);
2443
- }
2444
- return i.addEventListener("focusin", u, !0), i.addEventListener("focusout", u, !0), () => {
2445
- i.removeEventListener("focusin", u, !0), i.removeEventListener("focusout", u, !0);
2446
- };
2447
- }, [i, o, s == null ? void 0 : s.modal]), /* @__PURE__ */ y.createElement(yn.Provider, {
2448
- value: y.useMemo(() => ({
2449
- preserveTabOrder: o,
2450
- beforeOutsideRef: a,
2451
- afterOutsideRef: c,
2452
- beforeInsideRef: m,
2453
- afterInsideRef: d,
2454
- portalNode: i,
2455
- setFocusManagerState: l
2456
- }), [o, i])
2457
- }, f && i && /* @__PURE__ */ y.createElement(Lt, {
2458
- "data-type": "outside",
2459
- ref: a,
2460
- onFocus: (u) => {
2461
- if (tt(u, i)) {
2462
- var g;
2463
- (g = m.current) == null || g.focus();
2464
- } else {
2465
- const p = Bo() || (s == null ? void 0 : s.refs.domReference.current);
2466
- p == null || p.focus();
2467
- }
2468
- }
2469
- }), f && i && /* @__PURE__ */ y.createElement("span", {
2470
- "aria-owns": i.id,
2471
- style: bn
2472
- }), i && /* @__PURE__ */ En(t, i), f && i && /* @__PURE__ */ y.createElement(Lt, {
2473
- "data-type": "outside",
2474
- ref: c,
2475
- onFocus: (u) => {
2476
- if (tt(u, i)) {
2477
- var g;
2478
- (g = d.current) == null || g.focus();
2479
- } else {
2480
- const p = Ao() || (s == null ? void 0 : s.refs.domReference.current);
2481
- p == null || p.focus(), s != null && s.closeOnFocusOut && (s == null || s.onOpenChange(!1, u.nativeEvent));
2482
- }
2483
- }
2484
- }));
2485
- }
2486
- const No = () => y.useContext(yn);
2487
- function Nt(e) {
2488
- return U(e.target) && e.target.tagName === "BUTTON";
2489
- }
2490
- function Wt(e) {
2491
- return $r(e);
2492
- }
2493
- function Wo(e, t) {
2494
- t === void 0 && (t = {});
2495
- const {
2496
- open: n,
2497
- onOpenChange: r,
2498
- dataRef: o,
2499
- elements: {
2500
- domReference: i
2501
- }
2502
- } = e, {
2503
- enabled: s = !0,
2504
- event: l = "click",
2505
- toggle: a = !0,
2506
- ignoreMouse: c = !1,
2507
- keyboardHandlers: m = !0
2508
- } = t, d = y.useRef(), f = y.useRef(!1);
2509
- return y.useMemo(() => s ? {
2510
- reference: {
2511
- onPointerDown(u) {
2512
- d.current = u.pointerType;
2513
- },
2514
- onMouseDown(u) {
2515
- u.button === 0 && (Fe(d.current, !0) && c || l !== "click" && (n && a && (!o.current.openEvent || o.current.openEvent.type === "mousedown") ? r(!1, u.nativeEvent, "click") : (u.preventDefault(), r(!0, u.nativeEvent, "click"))));
2516
- },
2517
- onClick(u) {
2518
- if (l === "mousedown" && d.current) {
2519
- d.current = void 0;
2520
- return;
2521
- }
2522
- Fe(d.current, !0) && c || (n && a && (!o.current.openEvent || o.current.openEvent.type === "click") ? r(!1, u.nativeEvent, "click") : r(!0, u.nativeEvent, "click"));
2523
- },
2524
- onKeyDown(u) {
2525
- d.current = void 0, !(u.defaultPrevented || !m || Nt(u)) && (u.key === " " && !Wt(i) && (u.preventDefault(), f.current = !0), u.key === "Enter" && r(!(n && a), u.nativeEvent, "click"));
2526
- },
2527
- onKeyUp(u) {
2528
- u.defaultPrevented || !m || Nt(u) || Wt(i) || u.key === " " && f.current && (f.current = !1, r(!(n && a), u.nativeEvent, "click"));
2529
- }
2530
- }
2531
- } : {}, [s, o, l, c, m, i, a, n, r]);
2532
- }
2533
- const jo = {
2534
- pointerdown: "onPointerDown",
2535
- mousedown: "onMouseDown",
2536
- click: "onClick"
2537
- }, zo = {
2538
- pointerdown: "onPointerDownCapture",
2539
- mousedown: "onMouseDownCapture",
2540
- click: "onClickCapture"
2541
- }, jt = (e) => {
2542
- var t, n;
2543
- return {
2544
- escapeKey: typeof e == "boolean" ? e : (t = e == null ? void 0 : e.escapeKey) != null ? t : !1,
2545
- outsidePress: typeof e == "boolean" ? e : (n = e == null ? void 0 : e.outsidePress) != null ? n : !0
2546
- };
2547
- };
2548
- function Ho(e, t) {
2549
- t === void 0 && (t = {});
2550
- const {
2551
- open: n,
2552
- onOpenChange: r,
2553
- nodeId: o,
2554
- elements: {
2555
- reference: i,
2556
- domReference: s,
2557
- floating: l
2558
- },
2559
- dataRef: a
2560
- } = e, {
2561
- enabled: c = !0,
2562
- escapeKey: m = !0,
2563
- outsidePress: d = !0,
2564
- outsidePressEvent: f = "pointerdown",
2565
- referencePress: u = !1,
2566
- referencePressEvent: g = "pointerdown",
2567
- ancestorScroll: p = !1,
2568
- bubbles: $,
2569
- capture: h
2570
- } = t, x = ht(), P = Se(typeof d == "function" ? d : () => !1), S = typeof d == "function" ? P : d, C = y.useRef(!1), I = y.useRef(!1), {
2571
- escapeKey: A,
2572
- outsidePress: k
2573
- } = jt($), {
2574
- escapeKey: O,
2575
- outsidePress: D
2576
- } = jt(h), L = Se((v) => {
2577
- if (!n || !c || !m || v.key !== "Escape")
2578
- return;
2579
- const T = x ? Le(x.nodesRef.current, o) : [];
2580
- if (!A && (v.stopPropagation(), T.length > 0)) {
2581
- let R = !0;
2582
- if (T.forEach((w) => {
2583
- var F;
2584
- if ((F = w.context) != null && F.open && !w.context.dataRef.current.__escapeKeyBubbles) {
2585
- R = !1;
2586
- return;
2587
- }
2588
- }), !R)
2589
- return;
2590
- }
2591
- r(!1, vr(v) ? v.nativeEvent : v, "escape-key");
2592
- }), M = Se((v) => {
2593
- var T;
2594
- const R = () => {
2595
- var w;
2596
- L(v), (w = $e(v)) == null || w.removeEventListener("keydown", R);
2597
- };
2598
- (T = $e(v)) == null || T.addEventListener("keydown", R);
2599
- }), B = Se((v) => {
2600
- const T = C.current;
2601
- C.current = !1;
2602
- const R = I.current;
2603
- if (I.current = !1, f === "click" && R || T || typeof S == "function" && !S(v))
2604
- return;
2605
- const w = $e(v), F = "[" + qe("inert") + "]", _ = ce(l).querySelectorAll(F);
2606
- let K = W(w) ? w : null;
2607
- for (; K && !ke(K); ) {
2608
- const z = ge(K);
2609
- if (ke(z) || !W(z))
2610
- break;
2611
- K = z;
2612
- }
2613
- if (_.length && W(w) && !xr(w) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
2614
- !fe(w, l) && // If the target root element contains none of the markers, then the
2615
- // element was injected after the floating element rendered.
2616
- Array.from(_).every((z) => !fe(K, z)))
2617
- return;
2618
- if (U(w) && l) {
2619
- const z = w.clientWidth > 0 && w.scrollWidth > w.clientWidth, Y = w.clientHeight > 0 && w.scrollHeight > w.clientHeight;
2620
- let ie = Y && v.offsetX > w.clientWidth;
2621
- if (Y && q(w).direction === "rtl" && (ie = v.offsetX <= w.offsetWidth - w.clientWidth), ie || z && v.offsetY > w.clientHeight)
2622
- return;
2623
- }
2624
- const be = x && Le(x.nodesRef.current, o).some((z) => {
2625
- var Y;
2626
- return Je(v, (Y = z.context) == null ? void 0 : Y.elements.floating);
2627
- });
2628
- if (Je(v, l) || Je(v, s) || be)
2629
- return;
2630
- const oe = x ? Le(x.nodesRef.current, o) : [];
2631
- if (oe.length > 0) {
2632
- let z = !0;
2633
- if (oe.forEach((Y) => {
2634
- var ie;
2635
- if ((ie = Y.context) != null && ie.open && !Y.context.dataRef.current.__outsidePressBubbles) {
2636
- z = !1;
2637
- return;
2638
- }
2639
- }), !z)
2640
- return;
2641
- }
2642
- r(!1, v, "outside-press");
2643
- }), b = Se((v) => {
2644
- var T;
2645
- const R = () => {
2646
- var w;
2647
- B(v), (w = $e(v)) == null || w.removeEventListener(f, R);
2648
- };
2649
- (T = $e(v)) == null || T.addEventListener(f, R);
2650
- });
2651
- return y.useEffect(() => {
2652
- if (!n || !c)
2653
- return;
2654
- a.current.__escapeKeyBubbles = A, a.current.__outsidePressBubbles = k;
2655
- function v(w) {
2656
- r(!1, w, "ancestor-scroll");
2657
- }
2658
- const T = ce(l);
2659
- m && T.addEventListener("keydown", O ? M : L, O), S && T.addEventListener(f, D ? b : B, D);
2660
- let R = [];
2661
- return p && (W(s) && (R = ee(s)), W(l) && (R = R.concat(ee(l))), !W(i) && i && i.contextElement && (R = R.concat(ee(i.contextElement)))), R = R.filter((w) => {
2662
- var F;
2663
- return w !== ((F = T.defaultView) == null ? void 0 : F.visualViewport);
2664
- }), R.forEach((w) => {
2665
- w.addEventListener("scroll", v, {
2666
- passive: !0
2667
- });
2668
- }), () => {
2669
- m && T.removeEventListener("keydown", O ? M : L, O), S && T.removeEventListener(f, D ? b : B, D), R.forEach((w) => {
2670
- w.removeEventListener("scroll", v);
2671
- });
2672
- };
2673
- }, [a, l, s, i, m, S, f, n, r, p, c, A, k, L, O, M, B, D, b]), y.useEffect(() => {
2674
- C.current = !1;
2675
- }, [S, f]), y.useMemo(() => c ? {
2676
- reference: {
2677
- onKeyDown: L,
2678
- [jo[g]]: (v) => {
2679
- u && r(!1, v.nativeEvent, "reference-press");
2680
- }
2681
- },
2682
- floating: {
2683
- onKeyDown: L,
2684
- onMouseDown() {
2685
- I.current = !0;
2686
- },
2687
- onMouseUp() {
2688
- I.current = !0;
2689
- },
2690
- [zo[f]]: () => {
2691
- C.current = !0;
2692
- }
2693
- }
2694
- } : {}, [c, u, f, g, r, L]);
2695
- }
2696
- let at;
2697
- process.env.NODE_ENV !== "production" && (at = /* @__PURE__ */ new Set());
2698
- function Vo(e) {
2699
- var t;
2700
- e === void 0 && (e = {});
2701
- const {
2702
- open: n = !1,
2703
- onOpenChange: r,
2704
- nodeId: o
2705
- } = e;
2706
- if (process.env.NODE_ENV !== "production") {
2707
- var i;
2708
- const k = "Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";
2709
- if ((i = e.elements) != null && i.reference && !W(e.elements.reference)) {
2710
- var s;
2711
- if (!((s = at) != null && s.has(k))) {
2712
- var l;
2713
- (l = at) == null || l.add(k), console.error(k);
2714
- }
2715
- }
2716
- }
2717
- const [a, c] = y.useState(null), m = ((t = e.elements) == null ? void 0 : t.reference) || a, d = no(e), f = ht(), u = pt() != null, g = Se((k, O, D) => {
2718
- k && ($.current.openEvent = O), h.emit("openchange", {
2719
- open: k,
2720
- event: O,
2721
- reason: D,
2722
- nested: u
2723
- }), r == null || r(k, O, D);
2724
- }), p = y.useRef(null), $ = y.useRef({}), h = y.useState(() => ko())[0], x = gt(), P = y.useCallback((k) => {
2725
- const O = W(k) ? {
2726
- getBoundingClientRect: () => k.getBoundingClientRect(),
2727
- contextElement: k
2728
- } : k;
2729
- d.refs.setReference(O);
2730
- }, [d.refs]), S = y.useCallback((k) => {
2731
- (W(k) || k === null) && (p.current = k, c(k)), (W(d.refs.reference.current) || d.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
2732
- // `null` to support `positionReference` + an unstable `reference`
2733
- // callback ref.
2734
- k !== null && !W(k)) && d.refs.setReference(k);
2735
- }, [d.refs]), C = y.useMemo(() => ({
2736
- ...d.refs,
2737
- setReference: S,
2738
- setPositionReference: P,
2739
- domReference: p
2740
- }), [d.refs, S, P]), I = y.useMemo(() => ({
2741
- ...d.elements,
2742
- domReference: m
2743
- }), [d.elements, m]), A = y.useMemo(() => ({
2744
- ...d,
2745
- refs: C,
2746
- elements: I,
2747
- dataRef: $,
2748
- nodeId: o,
2749
- floatingId: x,
2750
- events: h,
2751
- open: n,
2752
- onOpenChange: g
2753
- }), [d, o, x, h, n, g, C, I]);
2754
- return Z(() => {
2755
- const k = f == null ? void 0 : f.nodesRef.current.find((O) => O.id === o);
2756
- k && (k.context = A);
2757
- }), y.useMemo(() => ({
2758
- ...d,
2759
- context: A,
2760
- refs: C,
2761
- elements: I
2762
- }), [d, C, I, A]);
2763
- }
2764
- const zt = "active", Ht = "selected";
2765
- function nt(e, t, n) {
2766
- const r = /* @__PURE__ */ new Map(), o = n === "item";
2767
- let i = e;
2768
- if (o && e) {
2769
- const {
2770
- [zt]: s,
2771
- [Ht]: l,
2772
- ...a
2773
- } = e;
2774
- i = a;
2775
- }
2776
- return {
2777
- ...n === "floating" && {
2778
- tabIndex: -1
2779
- },
2780
- ...i,
2781
- ...t.map((s) => {
2782
- const l = s ? s[n] : null;
2783
- return typeof l == "function" ? e ? l(e) : null : l;
2784
- }).concat(e).reduce((s, l) => (l && Object.entries(l).forEach((a) => {
2785
- let [c, m] = a;
2786
- if (!(o && [zt, Ht].includes(c)))
2787
- if (c.indexOf("on") === 0) {
2788
- if (r.has(c) || r.set(c, []), typeof m == "function") {
2789
- var d;
2790
- (d = r.get(c)) == null || d.push(m), s[c] = function() {
2791
- for (var f, u = arguments.length, g = new Array(u), p = 0; p < u; p++)
2792
- g[p] = arguments[p];
2793
- return (f = r.get(c)) == null ? void 0 : f.map(($) => $(...g)).find(($) => $ !== void 0);
2794
- };
2795
- }
2796
- } else
2797
- s[c] = m;
2798
- }), s), {})
2799
- };
2800
- }
2801
- function _o(e) {
2802
- e === void 0 && (e = []);
2803
- const t = e, n = y.useCallback((i) => nt(i, e, "reference"), t), r = y.useCallback((i) => nt(i, e, "floating"), t), o = y.useCallback(
2804
- (i) => nt(i, e, "item"),
2805
- // Granularly check for `item` changes, because the `getItemProps` getter
2806
- // should be as referentially stable as possible since it may be passed as
2807
- // a prop to many components. All `item` key values must therefore be
2808
- // memoized.
2809
- e.map((i) => i == null ? void 0 : i.item)
2810
- );
2811
- return y.useMemo(() => ({
2812
- getReferenceProps: n,
2813
- getFloatingProps: r,
2814
- getItemProps: o
2815
- }), [n, r, o]);
2816
- }
2817
- const Yo = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
2818
- function Ko(e, t) {
2819
- var n;
2820
- t === void 0 && (t = {});
2821
- const {
2822
- open: r,
2823
- floatingId: o
2824
- } = e, {
2825
- enabled: i = !0,
2826
- role: s = "dialog"
2827
- } = t, l = (n = Yo.get(s)) != null ? n : s, a = gt(), m = pt() != null;
2828
- return y.useMemo(() => {
2829
- if (!i)
2830
- return {};
2831
- const d = {
2832
- id: o,
2833
- ...l && {
2834
- role: l
2835
- }
2836
- };
2837
- return l === "tooltip" || s === "label" ? {
2838
- reference: {
2839
- ["aria-" + (s === "label" ? "labelledby" : "describedby")]: r ? o : void 0
2840
- },
2841
- floating: d
2842
- } : {
2843
- reference: {
2844
- "aria-expanded": r ? "true" : "false",
2845
- "aria-haspopup": l === "alertdialog" ? "dialog" : l,
2846
- "aria-controls": r ? o : void 0,
2847
- ...l === "listbox" && {
2848
- role: "combobox"
2849
- },
2850
- ...l === "menu" && {
2851
- id: a
2852
- },
2853
- ...l === "menu" && m && {
2854
- role: "menuitem"
2855
- },
2856
- ...s === "select" && {
2857
- "aria-autocomplete": "none"
2858
- },
2859
- ...s === "combobox" && {
2860
- "aria-autocomplete": "list"
2861
- }
2862
- },
2863
- floating: {
2864
- ...d,
2865
- ...l === "menu" && {
2866
- "aria-labelledby": a
2867
- }
2868
- },
2869
- item(f) {
2870
- let {
2871
- active: u,
2872
- selected: g
2873
- } = f;
2874
- const p = {
2875
- role: "option",
2876
- ...u && {
2877
- id: o + "-option"
2878
- }
2879
- };
2880
- switch (s) {
2881
- case "select":
2882
- return {
2883
- ...p,
2884
- "aria-selected": u && g
2885
- };
2886
- case "combobox":
2887
- return {
2888
- ...p,
2889
- ...u && {
2890
- "aria-selected": !0
2891
- }
2892
- };
2893
- }
2894
- return {};
2895
- }
2896
- };
2897
- }, [i, s, l, r, o, a, m]);
2898
- }
2899
- const Vt = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (t, n) => (n ? "-" : "") + t.toLowerCase());
2900
- function we(e, t) {
2901
- return typeof e == "function" ? e(t) : e;
2902
- }
2903
- function Xo(e, t) {
2904
- const [n, r] = y.useState(e);
2905
- return e && !n && r(!0), y.useEffect(() => {
2906
- if (!e) {
2907
- const o = setTimeout(() => r(!1), t);
2908
- return () => clearTimeout(o);
2909
- }
2910
- }, [e, t]), n;
2911
- }
2912
- function Uo(e, t) {
2913
- t === void 0 && (t = {});
2914
- const {
2915
- open: n,
2916
- elements: {
2917
- floating: r
2918
- }
2919
- } = e, {
2920
- duration: o = 250
2921
- } = t, s = (typeof o == "number" ? o : o.close) || 0, [l, a] = y.useState(!1), [c, m] = y.useState("unmounted"), d = Xo(n, s);
2922
- return Z(() => {
2923
- l && !d && m("unmounted");
2924
- }, [l, d]), Z(() => {
2925
- if (r) {
2926
- if (n) {
2927
- m("initial");
2928
- const f = requestAnimationFrame(() => {
2929
- m("open");
2930
- });
2931
- return () => {
2932
- cancelAnimationFrame(f);
2933
- };
2934
- }
2935
- a(!0), m("close");
2936
- }
2937
- }, [n, r]), {
2938
- isMounted: d,
2939
- status: c
2940
- };
2941
- }
2942
- function qo(e, t) {
2943
- t === void 0 && (t = {});
2944
- const {
2945
- initial: n = {
2946
- opacity: 0
2947
- },
2948
- open: r,
2949
- close: o,
2950
- common: i,
2951
- duration: s = 250
2952
- } = t, l = e.placement, a = l.split("-")[0], c = y.useMemo(() => ({
2953
- side: a,
2954
- placement: l
2955
- }), [a, l]), m = typeof s == "number", d = (m ? s : s.open) || 0, f = (m ? s : s.close) || 0, [u, g] = y.useState(() => ({
2956
- ...we(i, c),
2957
- ...we(n, c)
2958
- })), {
2959
- isMounted: p,
2960
- status: $
2961
- } = Uo(e, {
2962
- duration: s
2963
- }), h = Ee(n), x = Ee(r), P = Ee(o), S = Ee(i);
2964
- return Z(() => {
2965
- const C = we(h.current, c), I = we(P.current, c), A = we(S.current, c), k = we(x.current, c) || Object.keys(C).reduce((O, D) => (O[D] = "", O), {});
2966
- if ($ === "initial" && g((O) => ({
2967
- transitionProperty: O.transitionProperty,
2968
- ...A,
2969
- ...C
2970
- })), $ === "open" && g({
2971
- transitionProperty: Object.keys(k).map(Vt).join(","),
2972
- transitionDuration: d + "ms",
2973
- ...A,
2974
- ...k
2975
- }), $ === "close") {
2976
- const O = I || C;
2977
- g({
2978
- transitionProperty: Object.keys(O).map(Vt).join(","),
2979
- transitionDuration: f + "ms",
2980
- ...A,
2981
- ...O
2982
- });
2983
- }
2984
- }, [f, P, h, x, S, d, $, c]), {
2985
- isMounted: p,
2986
- styles: u
2987
- };
2988
- }
2989
- function _t(e, t) {
2990
- const [n, r] = e;
2991
- let o = !1;
2992
- const i = t.length;
2993
- for (let s = 0, l = i - 1; s < i; l = s++) {
2994
- const [a, c] = t[s] || [0, 0], [m, d] = t[l] || [0, 0];
2995
- c >= r != d >= r && n <= (m - a) * (r - c) / (d - c) + a && (o = !o);
2996
- }
2997
- return o;
2998
- }
2999
- function Go(e, t) {
3000
- return e[0] >= t.x && e[0] <= t.x + t.width && e[1] >= t.y && e[1] <= t.y + t.height;
3001
- }
3002
- function Zo(e) {
3003
- e === void 0 && (e = {});
3004
- const {
3005
- buffer: t = 0.5,
3006
- blockPointerEvents: n = !1,
3007
- requireIntent: r = !0
3008
- } = e;
3009
- let o, i = !1, s = null, l = null, a = performance.now();
3010
- function c(d, f) {
3011
- const u = performance.now(), g = u - a;
3012
- if (s === null || l === null || g === 0)
3013
- return s = d, l = f, a = u, null;
3014
- const p = d - s, $ = f - l, x = Math.sqrt(p * p + $ * $) / g;
3015
- return s = d, l = f, a = u, x;
3016
- }
3017
- const m = (d) => {
3018
- let {
3019
- x: f,
3020
- y: u,
3021
- placement: g,
3022
- elements: p,
3023
- onClose: $,
3024
- nodeId: h,
3025
- tree: x
3026
- } = d;
3027
- return function(S) {
3028
- function C() {
3029
- clearTimeout(o), $();
3030
- }
3031
- if (clearTimeout(o), !p.domReference || !p.floating || g == null || f == null || u == null)
3032
- return;
3033
- const {
3034
- clientX: I,
3035
- clientY: A
3036
- } = S, k = [I, A], O = $e(S), D = S.type === "mouseleave", L = fe(p.floating, O), M = fe(p.domReference, O), B = p.domReference.getBoundingClientRect(), b = p.floating.getBoundingClientRect(), v = g.split("-")[0], T = f > b.right - b.width / 2, R = u > b.bottom - b.height / 2, w = Go(k, B), F = b.width > B.width, _ = b.height > B.height, K = (F ? B : b).left, be = (F ? B : b).right, oe = (_ ? B : b).top, z = (_ ? B : b).bottom;
3037
- if (L && (i = !0, !D))
3038
- return;
3039
- if (M && (i = !1), M && !D) {
3040
- i = !0;
3041
- return;
3042
- }
3043
- if (D && W(S.relatedTarget) && fe(p.floating, S.relatedTarget) || x && Le(x.nodesRef.current, h).some((se) => {
3044
- let {
3045
- context: j
3046
- } = se;
3047
- return j == null ? void 0 : j.open;
3048
- }))
3049
- return;
3050
- if (v === "top" && u >= B.bottom - 1 || v === "bottom" && u <= B.top + 1 || v === "left" && f >= B.right - 1 || v === "right" && f <= B.left + 1)
3051
- return C();
3052
- let Y = [];
3053
- switch (v) {
3054
- case "top":
3055
- Y = [[K, B.top + 1], [K, b.bottom - 1], [be, b.bottom - 1], [be, B.top + 1]];
3056
- break;
3057
- case "bottom":
3058
- Y = [[K, b.top + 1], [K, B.bottom - 1], [be, B.bottom - 1], [be, b.top + 1]];
3059
- break;
3060
- case "left":
3061
- Y = [[b.right - 1, z], [b.right - 1, oe], [B.left + 1, oe], [B.left + 1, z]];
3062
- break;
3063
- case "right":
3064
- Y = [[B.right - 1, z], [B.right - 1, oe], [b.left + 1, oe], [b.left + 1, z]];
3065
- break;
3066
- }
3067
- function ie(se) {
3068
- let [j, H] = se;
3069
- switch (v) {
3070
- case "top": {
3071
- const le = [F ? j + t / 2 : T ? j + t * 4 : j - t * 4, H + t + 1], ae = [F ? j - t / 2 : T ? j + t * 4 : j - t * 4, H + t + 1], ye = [[b.left, T || F ? b.bottom - t : b.top], [b.right, T ? F ? b.bottom - t : b.top : b.bottom - t]];
3072
- return [le, ae, ...ye];
3073
- }
3074
- case "bottom": {
3075
- const le = [F ? j + t / 2 : T ? j + t * 4 : j - t * 4, H - t], ae = [F ? j - t / 2 : T ? j + t * 4 : j - t * 4, H - t], ye = [[b.left, T || F ? b.top + t : b.bottom], [b.right, T ? F ? b.top + t : b.bottom : b.top + t]];
3076
- return [le, ae, ...ye];
3077
- }
3078
- case "left": {
3079
- const le = [j + t + 1, _ ? H + t / 2 : R ? H + t * 4 : H - t * 4], ae = [j + t + 1, _ ? H - t / 2 : R ? H + t * 4 : H - t * 4];
3080
- return [...[[R || _ ? b.right - t : b.left, b.top], [R ? _ ? b.right - t : b.left : b.right - t, b.bottom]], le, ae];
3081
- }
3082
- case "right": {
3083
- const le = [j - t, _ ? H + t / 2 : R ? H + t * 4 : H - t * 4], ae = [j - t, _ ? H - t / 2 : R ? H + t * 4 : H - t * 4], ye = [[R || _ ? b.left + t : b.right, b.top], [R ? _ ? b.left + t : b.right : b.left + t, b.bottom]];
3084
- return [le, ae, ...ye];
3085
- }
3086
- }
3087
- }
3088
- if (!_t([I, A], Y)) {
3089
- if (i && !w)
3090
- return C();
3091
- if (!D && r) {
3092
- const se = c(S.clientX, S.clientY);
3093
- if (se !== null && se < 0.1)
3094
- return C();
3095
- }
3096
- _t([I, A], ie([f, u])) ? !i && r && (o = window.setTimeout(C, 40)) : C();
3097
- }
3098
- };
3099
- };
3100
- return m.__options = {
3101
- blockPointerEvents: n
3102
- }, m;
3103
- }
3104
- const Jo = re("div"), bt = xn(
3105
- {}
3106
- ), ii = ({
3107
- children: e,
3108
- offset: t,
3109
- open: n,
3110
- onOpenChange: r,
3111
- trigger: o = "click",
3112
- hoverDelay: i,
3113
- placement: s = "bottom",
3114
- role: l = "dialog"
3115
- }) => {
3116
- const { refs: a, floatingStyles: c, context: m } = Vo({
3117
- open: n,
3118
- onOpenChange: r,
3119
- placement: s,
3120
- whileElementsMounted: Jr,
3121
- middleware: [Dr(t), eo(), Qr()]
3122
- }), { isMounted: d, styles: f } = qo(m, {
3123
- initial: ({ side: S }) => ({
3124
- opacity: 0,
3125
- transform: {
3126
- top: "translateY(-0.5rem)",
3127
- right: "translateX(0.5rem)",
3128
- bottom: "translateY(0.5rem)",
3129
- left: "translateX(-0.5rem)"
3130
- }[S]
3131
- })
3132
- }), u = Wo(m, { enabled: o === "click" }), g = Po(m, {
3133
- enabled: o === "hover",
3134
- delay: i,
3135
- handleClose: Zo()
3136
- }), p = Ho(m), $ = Ko(m, { role: l }), { getFloatingProps: h, getReferenceProps: x } = _o([
3137
- u,
3138
- g,
3139
- p,
3140
- $
3141
- ]), P = wn(
3142
- () => ({
3143
- getFloatingProps: h,
3144
- getReferenceProps: x,
3145
- floatingStyles: c,
3146
- refs: a,
3147
- isMounted: d,
3148
- transitionStyles: f
3149
- }),
3150
- [
3151
- h,
3152
- x,
3153
- d,
3154
- a,
3155
- c,
3156
- f
3157
- ]
3158
- );
3159
- return /* @__PURE__ */ G.jsx(bt.Provider, { value: P, children: e });
3160
- }, si = ({ children: e }) => {
3161
- const { getReferenceProps: t, refs: n } = Xt(bt);
3162
- return /* @__PURE__ */ G.jsx(G.Fragment, { children: $n(e) && Sn(e, {
3163
- ref: n.setReference,
3164
- ...t()
3165
- }) });
3166
- }, li = ({ children: e, overlayCardProps: t }) => {
3167
- const {
3168
- getFloatingProps: n,
3169
- isMounted: r,
3170
- refs: o,
3171
- floatingStyles: i,
3172
- transitionStyles: s
3173
- } = Xt(bt);
3174
- return r ? /* @__PURE__ */ G.jsx(Fo, { children: /* @__PURE__ */ G.jsx(
3175
- Jo,
3176
- {
3177
- ref: o.setFloating,
3178
- style: i,
3179
- ...n(),
3180
- css: {
3181
- zIndex: "$overlayCard"
3182
- },
3183
- children: /* @__PURE__ */ G.jsx(gr, { ...t, style: s, children: e })
3184
- }
3185
- ) }) : null;
3186
- }, ai = re("span", {
3187
- flex: "0 0 auto",
3188
- display: "inline-flex",
3189
- padding: "$1 $2",
3190
- fontSize: "$xs",
3191
- fontWeight: "$medium",
3192
- lineHeight: "1",
3193
- whiteSpace: "nowrap",
3194
- borderRadius: "$sm",
3195
- overflow: "hidden",
3196
- variants: {
3197
- color: {
3198
- success: {
3199
- backgroundColor: "$green200",
3200
- color: "$green800"
3201
- },
3202
- warning: {
3203
- backgroundColor: "$yellow100",
3204
- color: "$yellow700"
3205
- },
3206
- danger: {
3207
- backgroundColor: "$red200",
3208
- color: "$red800"
3209
- },
3210
- primary: {
3211
- backgroundColor: "$blue200",
3212
- color: "$blue800"
3213
- },
3214
- secondary: {
3215
- backgroundColor: "$gray200",
3216
- color: "$gray800"
3217
- }
3218
- }
3219
- },
3220
- defaultVariants: {
3221
- color: "primary"
3222
- }
3223
- });
3224
- export {
3225
- oi as A,
3226
- Jo as B,
3227
- gr as O,
3228
- ii as P,
3229
- ir as S,
3230
- si as a,
3231
- li as b,
3232
- qt as c,
3233
- ri as d,
3234
- ai as e,
3235
- ni as g,
3236
- Ie as k,
3237
- re as s
3238
- };