@arkitektbedriftene/fe-lib 0.3.5 → 0.3.6

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