@commentkit/comment-kit 0.7.7 → 1.0.0-beta.2
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/CHANGELOG.md +87 -0
- package/README.md +172 -732
- package/SECURITY.md +24 -14
- package/dist/npm/THIRD_PARTY_NOTICES.txt +73 -0
- package/dist/npm/chunks/Guest-CKoV6pEK.js +157 -0
- package/dist/npm/chunks/MarkupEditor-DAo4qppg.js +199 -0
- package/dist/npm/chunks/Panel-BRBDHlGg.js +399 -0
- package/dist/npm/chunks/Shortcuts-CHMcrjAM.js +56 -0
- package/dist/npm/chunks/ThreadCard-D8FzIxbs.js +570 -0
- package/dist/npm/chunks/anchor-DT-Ynhh1.js +270 -0
- package/dist/npm/chunks/ar-D3SPpN1T.js +195 -0
- package/dist/npm/chunks/client-D1NizpDK.js +627 -0
- package/dist/{shared/capture-colors-D0uLr-vZ.js → npm/chunks/colors-CX-IPjvb.js} +2 -0
- package/dist/npm/chunks/de-C8eC6c6f.js +187 -0
- package/dist/npm/chunks/es-Bczf42tm.js +187 -0
- package/dist/npm/chunks/extension--it1LAj-.js +54 -0
- package/dist/npm/chunks/extension-XfuRGu2o.js +26 -0
- package/dist/npm/chunks/format-Bw_tNOh9.js +524 -0
- package/dist/npm/chunks/fr-BaQw-v2e.js +187 -0
- package/dist/npm/chunks/hi-BamV-yXv.js +187 -0
- package/dist/npm/chunks/html2canvas-DfGb8yka.js +4024 -0
- package/dist/npm/chunks/it-DC14_EjN.js +187 -0
- package/dist/npm/chunks/ja-B1mmTN7Y.js +187 -0
- package/dist/npm/chunks/mount-5fFig0k6.js +1447 -0
- package/dist/npm/chunks/nl-BfhqUsmX.js +187 -0
- package/dist/npm/chunks/privacy-DLhezjyi.js +30 -0
- package/dist/npm/chunks/pt-BR-CEPu4W5U.js +187 -0
- package/dist/{shared/pusher-CnhQgAvF.js → npm/chunks/pusher-BSsQoE1K.js} +224 -222
- package/dist/npm/chunks/realtime-CBRW9BB3.js +34 -0
- package/dist/npm/chunks/report-Dh4fxd4J.js +27 -0
- package/dist/npm/chunks/rolldown-runtime-Y_bBpyJl.js +20 -0
- package/dist/npm/chunks/src-DujplxfI.js +517 -0
- package/dist/npm/chunks/zh-CN-kgqjYwHQ.js +187 -0
- package/dist/npm/element.js +41 -0
- package/dist/npm/headless.js +3 -0
- package/dist/npm/index.js +3 -0
- package/dist/npm/react.js +26 -0
- package/dist/npm/svelte.js +17 -0
- package/dist/npm/types/adapters/react.d.ts +11 -0
- package/dist/npm/types/adapters/svelte.d.ts +9 -0
- package/dist/npm/types/adapters/vue.d.ts +118 -0
- package/dist/npm/types/anchor/index.d.ts +49 -0
- package/dist/npm/types/core/api.d.ts +31 -0
- package/dist/npm/types/core/auth.d.ts +87 -0
- package/dist/npm/types/core/client.d.ts +114 -0
- package/dist/npm/types/core/store.d.ts +7 -0
- package/dist/npm/types/core/types.d.ts +303 -0
- package/dist/npm/types/element.d.ts +13 -0
- package/dist/npm/types/headless.d.ts +7 -0
- package/dist/npm/types/index.d.ts +32 -0
- package/dist/npm/vue.js +71 -0
- package/package.json +71 -173
- package/dist/THIRD_PARTY_NOTICES.txt +0 -284
- package/dist/angular.es.js +0 -321
- package/dist/comment-kit.es.js +0 -218
- package/dist/demo.es.js +0 -483
- package/dist/headless.es.js +0 -4
- package/dist/preact.es.js +0 -117
- package/dist/qwik.es.js +0 -1
- package/dist/qwik.qwik.mjs +0 -114
- package/dist/react.es.js +0 -98
- package/dist/shared/ShadowRootContext-DD6a0QaI.js +0 -11
- package/dist/shared/annotation-icons-Dh-bmNYK.js +0 -172
- package/dist/shared/annotation-toolbar-zeiCmKIr.js +0 -1086
- package/dist/shared/attachment-refresh-DAacLaRu.js +0 -94
- package/dist/shared/bridge-CJoGYngu.js +0 -177
- package/dist/shared/button-D4GHW6oZ.js +0 -474
- package/dist/shared/button-group-BVR7iT-S.js +0 -91
- package/dist/shared/capture-privacy-CiOrcAlt.js +0 -101
- package/dist/shared/comment-drawing-canvas-Btc12IsS.js +0 -124
- package/dist/shared/comment-icon-D8JTCEJ7.js +0 -607
- package/dist/shared/comment-image-lightbox--QpbcAtH.js +0 -190
- package/dist/shared/comment-images-content-C_r4SHM-.js +0 -214
- package/dist/shared/comment-kit-core-CmLUFujd.js +0 -3682
- package/dist/shared/comment-kit-ui-BHwYuSIi.js +0 -19391
- package/dist/shared/comment-screenshot-annotator-zJZyO-XM.js +0 -151
- package/dist/shared/comment-screenshot-overlay-CoKTYB0J.js +0 -205
- package/dist/shared/comment-shortcut-groups-CfEmkitU.js +0 -153
- package/dist/shared/createReactComponent-BZHeRbD0.js +0 -45
- package/dist/shared/dev-export-panel-Cnt6oCZU.js +0 -207
- package/dist/shared/dev-grab-B85jo9AS.js +0 -197
- package/dist/shared/dist-D9A5k-N4.js +0 -617
- package/dist/shared/dom-Bhf4WFtY.js +0 -223
- package/dist/shared/element-selector-Cng84xC7.js +0 -902
- package/dist/shared/error-boundary-D3PD74vI.js +0 -21
- package/dist/shared/errors-Bu5ajEmB.js +0 -22
- package/dist/shared/icons-nzMOLzrm.js +0 -266
- package/dist/shared/input-UPtAj0M6.js +0 -111
- package/dist/shared/mount-ui-Dz7FB_Ak.js +0 -208
- package/dist/shared/realtime-recovery-BjlV-ewc.js +0 -162
- package/dist/shared/realtime-yGLX4wMK.js +0 -334
- package/dist/shared/request-activity-DQrAUwfA.js +0 -11
- package/dist/shared/screenshot-B5-hwpmt.js +0 -199
- package/dist/shared/separator-UhJb0Row.js +0 -3955
- package/dist/shared/shadow-root-B58ZI2yz.js +0 -133
- package/dist/shared/styles-CnYsLS2f.js +0 -2
- package/dist/shared/text-B4HHZNaa.js +0 -23
- package/dist/shared/token-session-D92MYbNu.js +0 -25
- package/dist/shared/useLabelableId-8n0QmH8N.js +0 -154
- package/dist/shared/useRender-Uxk1OPK-.js +0 -5
- package/dist/shared/useValueChanged-DKq5cMot.js +0 -92
- package/dist/shared/validation-3wbbbuX0.js +0 -70
- package/dist/shared/websocket-manager-KhH4hL0Q.js +0 -381
- package/dist/solid.es.js +0 -98
- package/dist/svelte.es.js +0 -130
- package/dist/types/adapters/bridge.d.ts +0 -122
- package/dist/types/angular/index.d.ts +0 -145
- package/dist/types/core/agent-context.d.ts +0 -17
- package/dist/types/core/api-client.d.ts +0 -155
- package/dist/types/core/comment-kit-core.d.ts +0 -254
- package/dist/types/core/local-demo.d.ts +0 -60
- package/dist/types/core/types.d.ts +0 -770
- package/dist/types/core/websocket-manager.d.ts +0 -125
- package/dist/types/core/write-access.d.ts +0 -11
- package/dist/types/demo.d.ts +0 -17
- package/dist/types/headless.d.ts +0 -8
- package/dist/types/index.d.ts +0 -87
- package/dist/types/preact/index.d.ts +0 -25
- package/dist/types/qwik/index.d.ts +0 -73
- package/dist/types/react/client.d.ts +0 -31
- package/dist/types/react/index.d.ts +0 -4
- package/dist/types/solid/index.d.ts +0 -37
- package/dist/types/svelte/index.d.ts +0 -55
- package/dist/types/utils/dom.d.ts +0 -59
- package/dist/types/utils/event-emitter.d.ts +0 -11
- package/dist/types/vue/index.d.ts +0 -87
- package/dist/vue.es.js +0 -148
- package/docs/api-reference.md +0 -405
- package/docs/local-demo.md +0 -60
|
@@ -1,3955 +0,0 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, E as r, F as i, L as a, M as o, N as s, O as c, P as l, R as u, S as d, T as f, _ as p, b as m, d as h, f as g, g as _, h as v, j as y, k as b, l as x, s as S, u as C, v as w, w as T, x as E, y as D, z as O } from "./button-D4GHW6oZ.js";
|
|
2
|
-
import { C as k, D as A, F as j, N as M, O as N, P, S as ee, d as te, i as F, j as I, k as ne, l as L, n as re, p as R, r as z } from "./useValueChanged-DKq5cMot.js";
|
|
3
|
-
import { a as ie, r as ae } from "./ShadowRootContext-DD6a0QaI.js";
|
|
4
|
-
import * as B from "react";
|
|
5
|
-
import { useDebugValue as V, useEffect as oe, useLayoutEffect as H, useMemo as se, useRef as ce, useSyncExternalStore as le, useSyncExternalStore as U } from "react";
|
|
6
|
-
import { jsx as W, jsxs as ue } from "react/jsx-runtime";
|
|
7
|
-
import * as de from "react-dom";
|
|
8
|
-
var fe = [], pe = void 0;
|
|
9
|
-
function me() {
|
|
10
|
-
return pe;
|
|
11
|
-
}
|
|
12
|
-
function he(e) {
|
|
13
|
-
fe.push(e);
|
|
14
|
-
}
|
|
15
|
-
function ge(e) {
|
|
16
|
-
let t = (t, n) => {
|
|
17
|
-
let r = O(ve).current, i;
|
|
18
|
-
try {
|
|
19
|
-
pe = r;
|
|
20
|
-
for (let e of fe) e.before(r);
|
|
21
|
-
i = e(t, n);
|
|
22
|
-
for (let e of fe) e.after(r);
|
|
23
|
-
r.didInitialize = !0;
|
|
24
|
-
} finally {
|
|
25
|
-
pe = void 0;
|
|
26
|
-
}
|
|
27
|
-
return i;
|
|
28
|
-
};
|
|
29
|
-
return t.displayName = e.displayName || e.name, t;
|
|
30
|
-
}
|
|
31
|
-
function _e(e) {
|
|
32
|
-
return /*#__PURE__*/ B.forwardRef(ge(e));
|
|
33
|
-
}
|
|
34
|
-
function ve() {
|
|
35
|
-
return { didInitialize: !1 };
|
|
36
|
-
}
|
|
37
|
-
var ye = /*#__PURE__*/ B.createContext(void 0);
|
|
38
|
-
function be(e) {
|
|
39
|
-
let t = B.useContext(ye);
|
|
40
|
-
if (t === void 0 && !e) throw Error(l(72));
|
|
41
|
-
return t;
|
|
42
|
-
}
|
|
43
|
-
function xe() {
|
|
44
|
-
return typeof navigator > "u" ? {
|
|
45
|
-
userAgent: "",
|
|
46
|
-
platform: "",
|
|
47
|
-
maxTouchPoints: 0
|
|
48
|
-
} : {
|
|
49
|
-
userAgent: navigator.userAgent,
|
|
50
|
-
platform: navigator.platform ?? "",
|
|
51
|
-
maxTouchPoints: navigator.maxTouchPoints ?? 0
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
var { userAgent: Se, platform: Ce, maxTouchPoints: we } = xe(), Te = Se.toLowerCase(), Ee = Ce.toLowerCase(), G = /^i(os$|p)/.test(Ee) || Ee === "macintel" && we > 1, De = "android", Oe = Ee === De || Te.includes(De), ke = !G && Ee.startsWith("mac");
|
|
55
|
-
Ee.startsWith("win"), !Oe && /^(linux|chrome os)/.test(Ee);
|
|
56
|
-
var Ae = ke || G, je = typeof CSS < "u" && !!CSS.supports?.("-webkit-backdrop-filter:none"), Me = !je && Te.includes("firefox");
|
|
57
|
-
!je && Te.includes("chrom");
|
|
58
|
-
var Ne = Ae, Pe = /jsdom|happydom/.test(Te);
|
|
59
|
-
function Fe(e) {
|
|
60
|
-
e.preventDefault(), e.stopPropagation();
|
|
61
|
-
}
|
|
62
|
-
function Ie(e) {
|
|
63
|
-
return "nativeEvent" in e;
|
|
64
|
-
}
|
|
65
|
-
function Le(e) {
|
|
66
|
-
return e.pointerType === "" && e.isTrusted ? !0 : Oe && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
67
|
-
}
|
|
68
|
-
function Re(e) {
|
|
69
|
-
return Pe ? !1 : !Oe && e.width === 0 && e.height === 0 || e.type === "pointerdown" && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" && (Oe || e.buttons === 0) || e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
|
|
70
|
-
}
|
|
71
|
-
function ze(e, t) {
|
|
72
|
-
let n = ["mouse", "pen"];
|
|
73
|
-
return t || n.push("", void 0), n.includes(e);
|
|
74
|
-
}
|
|
75
|
-
function Be(e) {
|
|
76
|
-
let t = e.type;
|
|
77
|
-
return t === "click" || t === "mousedown" || t === "keydown" || t === "keyup";
|
|
78
|
-
}
|
|
79
|
-
function Ve(e) {
|
|
80
|
-
let t = e.activeElement;
|
|
81
|
-
for (; t?.shadowRoot?.activeElement != null;) t = t.shadowRoot.activeElement;
|
|
82
|
-
return t;
|
|
83
|
-
}
|
|
84
|
-
function K(t, n) {
|
|
85
|
-
if (!t || !n) return !1;
|
|
86
|
-
let r = n.getRootNode?.();
|
|
87
|
-
if (t.contains(n)) return !0;
|
|
88
|
-
if (r && e(r)) {
|
|
89
|
-
let e = n;
|
|
90
|
-
for (; e;) {
|
|
91
|
-
if (t === e) return !0;
|
|
92
|
-
e = e.parentNode || e.host;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return !1;
|
|
96
|
-
}
|
|
97
|
-
function He(t, n) {
|
|
98
|
-
let r = t;
|
|
99
|
-
for (; r;) {
|
|
100
|
-
if (f(r) && r.matches(n)) return r;
|
|
101
|
-
r = r.assignedSlot ?? r.parentNode ?? (e(r) ? r.host : null);
|
|
102
|
-
}
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
function Ue(e) {
|
|
106
|
-
return "composedPath" in e ? e.composedPath()[0] ?? e.target : e.target;
|
|
107
|
-
}
|
|
108
|
-
var We = "data-base-ui-focusable", Ge = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])", Ke = "ArrowLeft", qe = "ArrowRight", Je = "ArrowUp", Ye = "ArrowDown", Xe = "data-starting-style", Ze = "data-ending-style", Qe = { [Xe]: "" }, $e = { [Ze]: "" }, et = { transitionStatus(e) {
|
|
109
|
-
return e === "starting" ? Qe : e === "ending" ? $e : null;
|
|
110
|
-
} }, tt = "data-open", nt = "data-closed", rt = Xe, it = Ze, at = "data-anchor-hidden", ot = "data-popup-open", st = "data-pressed", ct = { [ot]: "" }, lt = {
|
|
111
|
-
[ot]: "",
|
|
112
|
-
[st]: ""
|
|
113
|
-
}, ut = { [tt]: "" }, dt = { [nt]: "" }, ft = { [at]: "" }, pt = { open(e) {
|
|
114
|
-
return e ? ct : null;
|
|
115
|
-
} }, mt = { open(e) {
|
|
116
|
-
return e ? lt : null;
|
|
117
|
-
} }, ht = {
|
|
118
|
-
open(e) {
|
|
119
|
-
return e ? ut : dt;
|
|
120
|
-
},
|
|
121
|
-
anchorHidden(e) {
|
|
122
|
-
return e ? ft : null;
|
|
123
|
-
}
|
|
124
|
-
}, gt = {
|
|
125
|
-
...ht,
|
|
126
|
-
...et
|
|
127
|
-
}, _t = "data-trigger-disabled";
|
|
128
|
-
function vt(e, t) {
|
|
129
|
-
if (!f(e)) return !1;
|
|
130
|
-
let n = e;
|
|
131
|
-
if (t.hasElement(n)) return !n.hasAttribute(_t);
|
|
132
|
-
for (let [, e] of t.entries()) if (K(e, n)) return !e.hasAttribute(_t);
|
|
133
|
-
return !1;
|
|
134
|
-
}
|
|
135
|
-
function yt(e, t) {
|
|
136
|
-
if (t == null) return !1;
|
|
137
|
-
if ("composedPath" in e) return e.composedPath().includes(t);
|
|
138
|
-
let n = e;
|
|
139
|
-
return n.target != null && t.contains(n.target);
|
|
140
|
-
}
|
|
141
|
-
function bt(e) {
|
|
142
|
-
return e.matches("html,body");
|
|
143
|
-
}
|
|
144
|
-
function xt(e) {
|
|
145
|
-
return r(e) && e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])");
|
|
146
|
-
}
|
|
147
|
-
function St(e) {
|
|
148
|
-
return He(e, `button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ge}`) != null;
|
|
149
|
-
}
|
|
150
|
-
function Ct(e) {
|
|
151
|
-
return e ? e.getAttribute("role") === "combobox" && xt(e) : !1;
|
|
152
|
-
}
|
|
153
|
-
function wt(e) {
|
|
154
|
-
if (!e || Pe) return !0;
|
|
155
|
-
try {
|
|
156
|
-
return e.matches(":focus-visible");
|
|
157
|
-
} catch {
|
|
158
|
-
return !0;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
function Tt(e) {
|
|
162
|
-
return e ? e.hasAttribute("data-base-ui-focusable") ? e : e.querySelector("[data-base-ui-focusable]") || e : null;
|
|
163
|
-
}
|
|
164
|
-
function Et(e, t) {
|
|
165
|
-
return t != null && !ze(t) ? 0 : typeof e == "function" ? e() : e;
|
|
166
|
-
}
|
|
167
|
-
function Dt(e, t, n) {
|
|
168
|
-
let r = Et(e, n);
|
|
169
|
-
return typeof r == "number" ? r : r?.[t];
|
|
170
|
-
}
|
|
171
|
-
function Ot(e) {
|
|
172
|
-
return typeof e == "function" ? e() : e;
|
|
173
|
-
}
|
|
174
|
-
function kt(e, t) {
|
|
175
|
-
return t || e === "click" || e === "mousedown";
|
|
176
|
-
}
|
|
177
|
-
function At(e) {
|
|
178
|
-
return e?.includes("mouse") && e !== "mousedown";
|
|
179
|
-
}
|
|
180
|
-
var jt = /*#__PURE__*/ B.createContext({
|
|
181
|
-
hasProvider: !1,
|
|
182
|
-
timeoutMs: 0,
|
|
183
|
-
delayRef: { current: 0 },
|
|
184
|
-
initialDelayRef: { current: 0 },
|
|
185
|
-
timeout: new M(),
|
|
186
|
-
currentIdRef: { current: null },
|
|
187
|
-
currentContextRef: { current: null }
|
|
188
|
-
});
|
|
189
|
-
function Mt(e, t) {
|
|
190
|
-
e.current = t.current;
|
|
191
|
-
}
|
|
192
|
-
function Nt(e) {
|
|
193
|
-
let { children: t, delay: n, timeoutMs: r = 0 } = e, a = B.useRef(n), o = B.useRef(n), s = B.useRef(null), c = B.useRef(null), l = P();
|
|
194
|
-
return i(() => {
|
|
195
|
-
o.current = n, s.current ? a.current = {
|
|
196
|
-
open: Dt(a.current, "open"),
|
|
197
|
-
close: Dt(n, "close")
|
|
198
|
-
} : a.current = n;
|
|
199
|
-
}, [
|
|
200
|
-
n,
|
|
201
|
-
s,
|
|
202
|
-
a,
|
|
203
|
-
o
|
|
204
|
-
]), /*#__PURE__*/ W(jt.Provider, {
|
|
205
|
-
value: B.useMemo(() => ({
|
|
206
|
-
hasProvider: !0,
|
|
207
|
-
delayRef: a,
|
|
208
|
-
initialDelayRef: o,
|
|
209
|
-
currentIdRef: s,
|
|
210
|
-
timeoutMs: r,
|
|
211
|
-
currentContextRef: c,
|
|
212
|
-
timeout: l
|
|
213
|
-
}), [r, l]),
|
|
214
|
-
children: t
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
function Pt(e, t = { open: !1 }) {
|
|
218
|
-
let { open: n } = t, r = e.useState("floatingId"), { currentIdRef: a, delayRef: o, timeoutMs: s, initialDelayRef: c, currentContextRef: l, hasProvider: u, timeout: d } = B.useContext(jt), [f, p] = B.useState(!1), m = B.useRef(n);
|
|
219
|
-
return i(() => {
|
|
220
|
-
m.current = n;
|
|
221
|
-
}, [n]), i(() => {
|
|
222
|
-
function t() {
|
|
223
|
-
l.current?.setIsInstantPhase(!1), a.current = null, l.current = null, o.current = c.current, d.clear();
|
|
224
|
-
}
|
|
225
|
-
if (a.current && !n && a.current === r) {
|
|
226
|
-
if (p(!1), s) {
|
|
227
|
-
let n = r;
|
|
228
|
-
return d.start(s, () => {
|
|
229
|
-
e.select("open") || a.current && a.current !== n || t();
|
|
230
|
-
}), () => {
|
|
231
|
-
(m.current || a.current !== n) && d.clear();
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
t();
|
|
235
|
-
}
|
|
236
|
-
}, [
|
|
237
|
-
n,
|
|
238
|
-
r,
|
|
239
|
-
a,
|
|
240
|
-
o,
|
|
241
|
-
s,
|
|
242
|
-
c,
|
|
243
|
-
l,
|
|
244
|
-
d,
|
|
245
|
-
e
|
|
246
|
-
]), i(() => {
|
|
247
|
-
if (!n) return;
|
|
248
|
-
let t = l.current, i = a.current;
|
|
249
|
-
d.clear(), l.current = {
|
|
250
|
-
onOpenChange: e.setOpen,
|
|
251
|
-
setIsInstantPhase: p
|
|
252
|
-
}, a.current = r, o.current = {
|
|
253
|
-
open: 0,
|
|
254
|
-
close: Dt(c.current, "close")
|
|
255
|
-
}, i !== null && i !== r ? (p(!0), t?.setIsInstantPhase(!0), t?.onOpenChange(!1, I(ee))) : (p(!1), t?.setIsInstantPhase(!1));
|
|
256
|
-
}, [
|
|
257
|
-
n,
|
|
258
|
-
r,
|
|
259
|
-
e,
|
|
260
|
-
a,
|
|
261
|
-
o,
|
|
262
|
-
c,
|
|
263
|
-
l,
|
|
264
|
-
d
|
|
265
|
-
]), i(() => () => {
|
|
266
|
-
if (a.current === r) {
|
|
267
|
-
if (l.current = null, !m.current) return;
|
|
268
|
-
a.current = null, Mt(o, c), d.clear();
|
|
269
|
-
}
|
|
270
|
-
}, [
|
|
271
|
-
l,
|
|
272
|
-
a,
|
|
273
|
-
o,
|
|
274
|
-
r,
|
|
275
|
-
c,
|
|
276
|
-
d
|
|
277
|
-
]), B.useMemo(() => ({
|
|
278
|
-
activeIdRef: a,
|
|
279
|
-
hasProvider: u,
|
|
280
|
-
delayRef: o,
|
|
281
|
-
isInstantPhase: f
|
|
282
|
-
}), [
|
|
283
|
-
a,
|
|
284
|
-
u,
|
|
285
|
-
o,
|
|
286
|
-
f
|
|
287
|
-
]);
|
|
288
|
-
}
|
|
289
|
-
function q(e, t, n, r) {
|
|
290
|
-
return e.addEventListener(t, n, r), () => {
|
|
291
|
-
e.removeEventListener(t, n, r);
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
function Ft(...e) {
|
|
295
|
-
return () => {
|
|
296
|
-
for (let t = 0; t < e.length; t += 1) {
|
|
297
|
-
let n = e[t];
|
|
298
|
-
n && n();
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
function J(e) {
|
|
303
|
-
let t = O(It, e).current;
|
|
304
|
-
return t.next = e, i(t.effect), t;
|
|
305
|
-
}
|
|
306
|
-
function It(e) {
|
|
307
|
-
let t = {
|
|
308
|
-
current: e,
|
|
309
|
-
next: e,
|
|
310
|
-
effect: () => {
|
|
311
|
-
t.current = t.next;
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
return t;
|
|
315
|
-
}
|
|
316
|
-
var Lt = null;
|
|
317
|
-
globalThis.requestAnimationFrame;
|
|
318
|
-
var Rt = new class {
|
|
319
|
-
callbacks = [];
|
|
320
|
-
callbacksCount = 0;
|
|
321
|
-
nextId = 1;
|
|
322
|
-
startId = 1;
|
|
323
|
-
isScheduled = !1;
|
|
324
|
-
tick = (e) => {
|
|
325
|
-
this.isScheduled = !1;
|
|
326
|
-
let t = this.callbacks, n = this.callbacksCount;
|
|
327
|
-
if (this.callbacks = [], this.callbacksCount = 0, this.startId = this.nextId, n > 0) for (let n = 0; n < t.length; n += 1) t[n]?.(e);
|
|
328
|
-
};
|
|
329
|
-
request(e) {
|
|
330
|
-
let t = this.nextId;
|
|
331
|
-
return this.nextId += 1, this.callbacks.push(e), this.callbacksCount += 1, this.isScheduled ||= (requestAnimationFrame(this.tick), !0), t;
|
|
332
|
-
}
|
|
333
|
-
cancel(e) {
|
|
334
|
-
let t = e - this.startId;
|
|
335
|
-
t < 0 || t >= this.callbacks.length || this.callbacks[t] !== null && (this.callbacks[t] = null, --this.callbacksCount);
|
|
336
|
-
}
|
|
337
|
-
}(), zt = class e {
|
|
338
|
-
static create() {
|
|
339
|
-
return new e();
|
|
340
|
-
}
|
|
341
|
-
static request(e) {
|
|
342
|
-
return Rt.request(e);
|
|
343
|
-
}
|
|
344
|
-
static cancel(e) {
|
|
345
|
-
return Rt.cancel(e);
|
|
346
|
-
}
|
|
347
|
-
currentId = Lt;
|
|
348
|
-
request(e) {
|
|
349
|
-
this.cancel(), this.currentId = Rt.request(() => {
|
|
350
|
-
this.currentId = Lt, e();
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
cancel = () => {
|
|
354
|
-
this.currentId !== Lt && (Rt.cancel(this.currentId), this.currentId = Lt);
|
|
355
|
-
};
|
|
356
|
-
disposeEffect = () => this.cancel;
|
|
357
|
-
};
|
|
358
|
-
function Bt() {
|
|
359
|
-
let e = O(zt.create).current;
|
|
360
|
-
return j(e.disposeEffect), e;
|
|
361
|
-
}
|
|
362
|
-
function Y(e) {
|
|
363
|
-
return e?.ownerDocument || document;
|
|
364
|
-
}
|
|
365
|
-
var Vt = {
|
|
366
|
-
clipPath: "inset(50%)",
|
|
367
|
-
overflow: "hidden",
|
|
368
|
-
whiteSpace: "nowrap",
|
|
369
|
-
border: 0,
|
|
370
|
-
padding: 0,
|
|
371
|
-
width: 1,
|
|
372
|
-
height: 1,
|
|
373
|
-
margin: -1
|
|
374
|
-
}, Ht = {
|
|
375
|
-
...Vt,
|
|
376
|
-
position: "fixed",
|
|
377
|
-
margin: 0,
|
|
378
|
-
top: 0,
|
|
379
|
-
left: 0
|
|
380
|
-
}, Ut = {
|
|
381
|
-
...Vt,
|
|
382
|
-
position: "absolute"
|
|
383
|
-
}, Wt = /*#__PURE__*/ B.forwardRef(function(e, t) {
|
|
384
|
-
let [n, r] = B.useState();
|
|
385
|
-
i(() => {
|
|
386
|
-
Ne && je && r("button");
|
|
387
|
-
}, []);
|
|
388
|
-
let a = {
|
|
389
|
-
tabIndex: 0,
|
|
390
|
-
role: n
|
|
391
|
-
};
|
|
392
|
-
return /*#__PURE__*/ W("span", {
|
|
393
|
-
...e,
|
|
394
|
-
ref: t,
|
|
395
|
-
style: Ht,
|
|
396
|
-
"aria-hidden": !n || void 0,
|
|
397
|
-
...a,
|
|
398
|
-
"data-base-ui-focus-guard": ""
|
|
399
|
-
});
|
|
400
|
-
}), Gt = Math.min, Kt = Math.max, qt = Math.round, Jt = Math.floor, Yt = (e) => ({
|
|
401
|
-
x: e,
|
|
402
|
-
y: e
|
|
403
|
-
}), Xt = {
|
|
404
|
-
left: "right",
|
|
405
|
-
right: "left",
|
|
406
|
-
bottom: "top",
|
|
407
|
-
top: "bottom"
|
|
408
|
-
};
|
|
409
|
-
function Zt(e, t, n) {
|
|
410
|
-
return Kt(e, Gt(t, n));
|
|
411
|
-
}
|
|
412
|
-
function Qt(e, t) {
|
|
413
|
-
return typeof e == "function" ? e(t) : e;
|
|
414
|
-
}
|
|
415
|
-
function X(e) {
|
|
416
|
-
return e.split("-")[0];
|
|
417
|
-
}
|
|
418
|
-
function $t(e) {
|
|
419
|
-
return e.split("-")[1];
|
|
420
|
-
}
|
|
421
|
-
function en(e) {
|
|
422
|
-
return e === "x" ? "y" : "x";
|
|
423
|
-
}
|
|
424
|
-
function tn(e) {
|
|
425
|
-
return e === "y" ? "height" : "width";
|
|
426
|
-
}
|
|
427
|
-
function Z(e) {
|
|
428
|
-
let t = e[0];
|
|
429
|
-
return t === "t" || t === "b" ? "y" : "x";
|
|
430
|
-
}
|
|
431
|
-
function nn(e) {
|
|
432
|
-
return en(Z(e));
|
|
433
|
-
}
|
|
434
|
-
function rn(e, t, n) {
|
|
435
|
-
n === void 0 && (n = !1);
|
|
436
|
-
let r = $t(e), i = nn(e), a = tn(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
437
|
-
return t.reference[a] > t.floating[a] && (o = pn(o)), [o, pn(o)];
|
|
438
|
-
}
|
|
439
|
-
function an(e) {
|
|
440
|
-
let t = pn(e);
|
|
441
|
-
return [
|
|
442
|
-
on(e),
|
|
443
|
-
t,
|
|
444
|
-
on(t)
|
|
445
|
-
];
|
|
446
|
-
}
|
|
447
|
-
function on(e) {
|
|
448
|
-
return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
|
|
449
|
-
}
|
|
450
|
-
var sn = ["left", "right"], cn = ["right", "left"], ln = ["top", "bottom"], un = ["bottom", "top"];
|
|
451
|
-
function dn(e, t, n) {
|
|
452
|
-
switch (e) {
|
|
453
|
-
case "top":
|
|
454
|
-
case "bottom": return n ? t ? cn : sn : t ? sn : cn;
|
|
455
|
-
case "left":
|
|
456
|
-
case "right": return t ? ln : un;
|
|
457
|
-
default: return [];
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
function fn(e, t, n, r) {
|
|
461
|
-
let i = $t(e), a = dn(X(e), n === "start", r);
|
|
462
|
-
return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(on)))), a;
|
|
463
|
-
}
|
|
464
|
-
function pn(e) {
|
|
465
|
-
let t = X(e);
|
|
466
|
-
return Xt[t] + e.slice(t.length);
|
|
467
|
-
}
|
|
468
|
-
function mn(e) {
|
|
469
|
-
return {
|
|
470
|
-
top: e.top ?? 0,
|
|
471
|
-
right: e.right ?? 0,
|
|
472
|
-
bottom: e.bottom ?? 0,
|
|
473
|
-
left: e.left ?? 0
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
function hn(e) {
|
|
477
|
-
return typeof e == "number" ? {
|
|
478
|
-
top: e,
|
|
479
|
-
right: e,
|
|
480
|
-
bottom: e,
|
|
481
|
-
left: e
|
|
482
|
-
} : mn(e);
|
|
483
|
-
}
|
|
484
|
-
function gn(e) {
|
|
485
|
-
let { x: t, y: n, width: r, height: i } = e;
|
|
486
|
-
return {
|
|
487
|
-
width: r,
|
|
488
|
-
height: i,
|
|
489
|
-
top: n,
|
|
490
|
-
left: t,
|
|
491
|
-
right: t + r,
|
|
492
|
-
bottom: n + i,
|
|
493
|
-
x: t,
|
|
494
|
-
y: n
|
|
495
|
-
};
|
|
496
|
-
}
|
|
497
|
-
function _n(e, t, n) {
|
|
498
|
-
return Math.floor(e / t) !== n;
|
|
499
|
-
}
|
|
500
|
-
function vn(e, t) {
|
|
501
|
-
return t < 0 || t >= e.length;
|
|
502
|
-
}
|
|
503
|
-
function yn(e, t) {
|
|
504
|
-
return Q(e.current, { disabledIndices: t });
|
|
505
|
-
}
|
|
506
|
-
function bn(e, t) {
|
|
507
|
-
return Q(e.current, {
|
|
508
|
-
decrement: !0,
|
|
509
|
-
startingIndex: e.current.length,
|
|
510
|
-
disabledIndices: t
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
function xn(e, t, n) {
|
|
514
|
-
let { decrement: r, loopFocus: i, allowEscape: a, disabledIndices: o, minIndex: s, maxIndex: c } = n, l = () => Q(e, {
|
|
515
|
-
startingIndex: t,
|
|
516
|
-
decrement: r,
|
|
517
|
-
disabledIndices: o
|
|
518
|
-
}), u, d = !1;
|
|
519
|
-
if (!i) u = r ? Math.max(s, l()) : Math.min(c, l());
|
|
520
|
-
else if (r ? t <= s : t >= c) {
|
|
521
|
-
let n = r ? -1 : e.length;
|
|
522
|
-
a && t !== n ? u = -1 : (u = r ? c : s, d = !0);
|
|
523
|
-
} else u = l();
|
|
524
|
-
return {
|
|
525
|
-
index: vn(e, u) ? -1 : u,
|
|
526
|
-
wrapped: d
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
function Q(e, { startingIndex: t = -1, decrement: n = !1, disabledIndices: r, amount: i = 1 } = {}) {
|
|
530
|
-
let a = t;
|
|
531
|
-
do
|
|
532
|
-
a += n ? -i : i;
|
|
533
|
-
while (a >= 0 && a <= e.length - 1 && Cn(e, a, r));
|
|
534
|
-
return a;
|
|
535
|
-
}
|
|
536
|
-
function Sn(e, { event: t, orientation: n, loopFocus: r, onLoop: i, rtl: a, cols: o, disabledIndices: s, minIndex: c, maxIndex: l, prevIndex: u, stopEvent: d = !1 }) {
|
|
537
|
-
let f = u, p;
|
|
538
|
-
if (t.key === "ArrowUp" ? p = "up" : t.key === "ArrowDown" && (p = "down"), p) {
|
|
539
|
-
let n = [], a = [], m = !1, h = 0;
|
|
540
|
-
{
|
|
541
|
-
let t = null, r = -1;
|
|
542
|
-
e.forEach((e, i) => {
|
|
543
|
-
if (e == null) return;
|
|
544
|
-
h += 1;
|
|
545
|
-
let o = He(e, "[role=\"row\"]");
|
|
546
|
-
o && (m = !0), (o !== t || r === -1) && (t = o, r += 1, n[r] = []), n[r].push(i), a[i] = r;
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
let g = !1, _ = 0;
|
|
550
|
-
if (m) for (let e of n) {
|
|
551
|
-
let t = e.length;
|
|
552
|
-
t > _ && (_ = t), t !== o && (g = !0);
|
|
553
|
-
}
|
|
554
|
-
let v = g && h < e.length, y = _ || o, b = (o) => {
|
|
555
|
-
if (!g || u === -1) return;
|
|
556
|
-
let c = a[u];
|
|
557
|
-
if (c == null) return;
|
|
558
|
-
let l = n[c].indexOf(u), d = o === "up" ? -1 : 1;
|
|
559
|
-
for (let o = c + d, f = 0; f < n.length; f += 1, o += d) {
|
|
560
|
-
if (o < 0 || o >= n.length) {
|
|
561
|
-
if (!r || v) return;
|
|
562
|
-
if (o = o < 0 ? n.length - 1 : 0, i) {
|
|
563
|
-
let e = Math.min(l, n[o].length - 1), r = i(t, u, n[o][e] ?? n[o][0]);
|
|
564
|
-
o = a[r] ?? o;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
let c = n[o];
|
|
568
|
-
for (let t = Math.min(l, c.length - 1); t >= 0; --t) {
|
|
569
|
-
let n = c[t];
|
|
570
|
-
if (!Cn(e, n, s)) return n;
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
}, x = (t) => {
|
|
574
|
-
if (!v || u === -1) return;
|
|
575
|
-
let n = u % y, i = t === "up" ? -y : y, a = l - l % y, o = Jt(l / y) + 1;
|
|
576
|
-
for (let t = u - n + i, c = 0; c < o; c += 1, t += i) {
|
|
577
|
-
if (t < 0 || t > l) {
|
|
578
|
-
if (!r) return;
|
|
579
|
-
t = t < 0 ? a : 0;
|
|
580
|
-
}
|
|
581
|
-
let i = Math.min(t + y - 1, l);
|
|
582
|
-
for (let r = Math.min(t + n, i); r >= t; --r) if (!Cn(e, r, s)) return r;
|
|
583
|
-
}
|
|
584
|
-
};
|
|
585
|
-
d && Fe(t);
|
|
586
|
-
let S = b(p) ?? x(p);
|
|
587
|
-
if (S !== void 0) f = S;
|
|
588
|
-
else if (u === -1) f = p === "up" ? l : c;
|
|
589
|
-
else if (f = Q(e, {
|
|
590
|
-
startingIndex: u,
|
|
591
|
-
amount: y,
|
|
592
|
-
decrement: p === "up",
|
|
593
|
-
disabledIndices: s
|
|
594
|
-
}), r) {
|
|
595
|
-
if (p === "up" && (u - y < c || f < 0)) {
|
|
596
|
-
let e = u % y, n = l % y, r = l - (n - e);
|
|
597
|
-
f = n === e ? l : n > e ? r : r - y, i && (f = i(t, u, f));
|
|
598
|
-
}
|
|
599
|
-
p === "down" && u + y > l && (f = Q(e, {
|
|
600
|
-
startingIndex: u % y - y,
|
|
601
|
-
amount: y,
|
|
602
|
-
disabledIndices: s
|
|
603
|
-
}), i && (f = i(t, u, f)));
|
|
604
|
-
}
|
|
605
|
-
vn(e, f) && (f = u);
|
|
606
|
-
}
|
|
607
|
-
if (n === "both") {
|
|
608
|
-
let n = Jt(u / o);
|
|
609
|
-
t.key === (a ? "ArrowLeft" : "ArrowRight") && (d && Fe(t), u % o === o - 1 ? r && (f = Q(e, {
|
|
610
|
-
startingIndex: u - u % o - 1,
|
|
611
|
-
disabledIndices: s
|
|
612
|
-
}), i && (f = i(t, u, f))) : (f = Q(e, {
|
|
613
|
-
startingIndex: u,
|
|
614
|
-
disabledIndices: s
|
|
615
|
-
}), r && _n(f, o, n) && (f = Q(e, {
|
|
616
|
-
startingIndex: u - u % o - 1,
|
|
617
|
-
disabledIndices: s
|
|
618
|
-
}), i && (f = i(t, u, f)))), _n(f, o, n) && (f = u)), t.key === (a ? "ArrowRight" : "ArrowLeft") && (d && Fe(t), u % o === 0 ? r && (f = Q(e, {
|
|
619
|
-
startingIndex: u + (o - u % o),
|
|
620
|
-
decrement: !0,
|
|
621
|
-
disabledIndices: s
|
|
622
|
-
}), i && (f = i(t, u, f))) : (f = Q(e, {
|
|
623
|
-
startingIndex: u,
|
|
624
|
-
decrement: !0,
|
|
625
|
-
disabledIndices: s
|
|
626
|
-
}), r && _n(f, o, n) && (f = Q(e, {
|
|
627
|
-
startingIndex: u + (o - u % o),
|
|
628
|
-
decrement: !0,
|
|
629
|
-
disabledIndices: s
|
|
630
|
-
}), i && (f = i(t, u, f)))), _n(f, o, n) && (f = u));
|
|
631
|
-
let c = Jt(l / o) === n;
|
|
632
|
-
vn(e, f) && (r && c ? (f = t.key === (a ? "ArrowRight" : "ArrowLeft") ? l : Q(e, {
|
|
633
|
-
startingIndex: u - u % o - 1,
|
|
634
|
-
disabledIndices: s
|
|
635
|
-
}), i && (f = i(t, u, f))) : f = u);
|
|
636
|
-
}
|
|
637
|
-
return f;
|
|
638
|
-
}
|
|
639
|
-
function Cn(e, t, n) {
|
|
640
|
-
if (typeof n == "function" ? n(t) : n?.includes(t) ?? !1) return !0;
|
|
641
|
-
let r = e[t];
|
|
642
|
-
return r ? !Tn(r) || r.matches(":disabled") ? !0 : !n && (r.hasAttribute("disabled") || r.getAttribute("aria-disabled") === "true") : !1;
|
|
643
|
-
}
|
|
644
|
-
function wn(e) {
|
|
645
|
-
return e.visibility === "hidden" || e.visibility === "collapse";
|
|
646
|
-
}
|
|
647
|
-
function Tn(e, t = e ? v(e) : null) {
|
|
648
|
-
return !e || !e.isConnected || !t || wn(t) ? !1 : typeof e.checkVisibility == "function" ? e.checkVisibility() : t.display !== "none" && t.display !== "contents";
|
|
649
|
-
}
|
|
650
|
-
var En = "a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable=\"false\"]),audio[controls],video[controls]";
|
|
651
|
-
function Dn(t) {
|
|
652
|
-
let n = t.assignedSlot;
|
|
653
|
-
if (n) return n;
|
|
654
|
-
if (t.parentElement) return t.parentElement;
|
|
655
|
-
let r = t.getRootNode();
|
|
656
|
-
return e(r) ? r.host : null;
|
|
657
|
-
}
|
|
658
|
-
function On(e) {
|
|
659
|
-
for (let t of Array.from(e.children)) if (D(t) === "summary") return t;
|
|
660
|
-
return null;
|
|
661
|
-
}
|
|
662
|
-
function kn(e, t) {
|
|
663
|
-
let n = On(t);
|
|
664
|
-
return !!n && (e === n || K(n, e));
|
|
665
|
-
}
|
|
666
|
-
function An(e) {
|
|
667
|
-
let t = e ? D(e) : "";
|
|
668
|
-
return e != null && e.matches(En) && (t !== "summary" || e.parentElement != null && D(e.parentElement) === "details" && On(e.parentElement) === e) && (t !== "details" || On(e) == null) && (t !== "input" || e.type !== "hidden");
|
|
669
|
-
}
|
|
670
|
-
function jn(e) {
|
|
671
|
-
if (!An(e) || !e.isConnected || e.matches(":disabled")) return !1;
|
|
672
|
-
for (let t = e; t; t = Dn(t)) {
|
|
673
|
-
let n = t !== e, r = D(t) === "slot";
|
|
674
|
-
if (t.hasAttribute("inert") || n && D(t) === "details" && !t.open && !kn(e, t) || t.hasAttribute("hidden") || !r && !Mn(t, n)) return !1;
|
|
675
|
-
}
|
|
676
|
-
return !0;
|
|
677
|
-
}
|
|
678
|
-
function Mn(e, t) {
|
|
679
|
-
let n = v(e);
|
|
680
|
-
return t ? n.display !== "none" : Tn(e, n);
|
|
681
|
-
}
|
|
682
|
-
function Nn(e) {
|
|
683
|
-
let t = e.tabIndex;
|
|
684
|
-
if (t < 0) {
|
|
685
|
-
let t = D(e);
|
|
686
|
-
if (t === "details" || t === "audio" || t === "video" || r(e) && e.isContentEditable) return 0;
|
|
687
|
-
}
|
|
688
|
-
return t;
|
|
689
|
-
}
|
|
690
|
-
function Pn(e) {
|
|
691
|
-
if (D(e) !== "input") return null;
|
|
692
|
-
let t = e;
|
|
693
|
-
return t.type === "radio" && t.name !== "" ? t : null;
|
|
694
|
-
}
|
|
695
|
-
function Fn(e, t) {
|
|
696
|
-
let n = Pn(e);
|
|
697
|
-
if (!n) return !0;
|
|
698
|
-
let r = t.find((e) => {
|
|
699
|
-
let t = Pn(e);
|
|
700
|
-
return t?.name === n.name && t.form === n.form && t.checked;
|
|
701
|
-
});
|
|
702
|
-
return r ? r === n : t.find((e) => {
|
|
703
|
-
let t = Pn(e);
|
|
704
|
-
return t?.name === n.name && t.form === n.form;
|
|
705
|
-
}) === n;
|
|
706
|
-
}
|
|
707
|
-
function In(e) {
|
|
708
|
-
if (r(e) && D(e) === "slot") {
|
|
709
|
-
let t = e.assignedElements({ flatten: !0 });
|
|
710
|
-
if (t.length > 0) return t;
|
|
711
|
-
}
|
|
712
|
-
return r(e) && e.shadowRoot ? Array.from(e.shadowRoot.children) : Array.from(e.children);
|
|
713
|
-
}
|
|
714
|
-
function Ln(e, t) {
|
|
715
|
-
In(e).forEach((e) => {
|
|
716
|
-
An(e) && t.push(e), Ln(e, t);
|
|
717
|
-
});
|
|
718
|
-
}
|
|
719
|
-
function Rn(e, t, n) {
|
|
720
|
-
In(e).forEach((e) => {
|
|
721
|
-
r(e) && e.matches(t) && n.push(e), Rn(e, t, n);
|
|
722
|
-
});
|
|
723
|
-
}
|
|
724
|
-
function zn(e) {
|
|
725
|
-
return jn(e) && Nn(e) >= 0;
|
|
726
|
-
}
|
|
727
|
-
function Bn(e) {
|
|
728
|
-
let t = [];
|
|
729
|
-
return Ln(e, t), t.filter(jn);
|
|
730
|
-
}
|
|
731
|
-
function Vn(e) {
|
|
732
|
-
let t = Bn(e);
|
|
733
|
-
return t.filter((e) => Nn(e) >= 0 && Fn(e, t));
|
|
734
|
-
}
|
|
735
|
-
function Hn(e, t) {
|
|
736
|
-
let n = Vn(e), r = n.length;
|
|
737
|
-
if (r === 0) return;
|
|
738
|
-
let i = Ve(Y(e)), a = n.indexOf(i);
|
|
739
|
-
return n[a === -1 ? t === 1 ? 0 : r - 1 : a + t];
|
|
740
|
-
}
|
|
741
|
-
function Un(e) {
|
|
742
|
-
return Hn(Y(e).body, 1) || e;
|
|
743
|
-
}
|
|
744
|
-
function Wn(e) {
|
|
745
|
-
return Hn(Y(e).body, -1) || e;
|
|
746
|
-
}
|
|
747
|
-
function Gn(e, t, n) {
|
|
748
|
-
if (!e) return null;
|
|
749
|
-
let r = [];
|
|
750
|
-
Ln(Y(e).body, r);
|
|
751
|
-
let i = r.indexOf(e);
|
|
752
|
-
if (i === -1) return null;
|
|
753
|
-
let a = r.filter(jn);
|
|
754
|
-
for (let e = 1; e < r.length; e += 1) {
|
|
755
|
-
let o = r[(i + t * e + r.length) % r.length];
|
|
756
|
-
if (!K(n, o) && zn(o) && Fn(o, a)) return o;
|
|
757
|
-
}
|
|
758
|
-
return r[i];
|
|
759
|
-
}
|
|
760
|
-
function Kn(e, t) {
|
|
761
|
-
let n = t || e.currentTarget, r = e.relatedTarget;
|
|
762
|
-
return !r || !K(n, r);
|
|
763
|
-
}
|
|
764
|
-
function qn(e) {
|
|
765
|
-
Vn(e).forEach((e) => {
|
|
766
|
-
e.dataset.tabindex = e.getAttribute("tabindex") || "", e.setAttribute("tabindex", "-1");
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
function Jn(e) {
|
|
770
|
-
let t = [];
|
|
771
|
-
Rn(e, "[data-tabindex]", t), t.forEach((e) => {
|
|
772
|
-
let t = e.dataset.tabindex;
|
|
773
|
-
delete e.dataset.tabindex, t ? e.setAttribute("tabindex", t) : e.removeAttribute("tabindex");
|
|
774
|
-
});
|
|
775
|
-
}
|
|
776
|
-
function Yn(e, t, n = !0) {
|
|
777
|
-
return e.filter((e) => e.parentId === t).flatMap((t) => [...!n || t.context?.open ? [t] : [], ...Yn(e, t.id, n)]);
|
|
778
|
-
}
|
|
779
|
-
function Xn(e, t) {
|
|
780
|
-
let n = [], r = e.find((e) => e.id === t)?.parentId;
|
|
781
|
-
for (; r;) {
|
|
782
|
-
let t = e.find((e) => e.id === r);
|
|
783
|
-
r = t?.parentId, t && (n = n.concat(t));
|
|
784
|
-
}
|
|
785
|
-
return n;
|
|
786
|
-
}
|
|
787
|
-
function Zn(e) {
|
|
788
|
-
return `data-base-ui-${e}`;
|
|
789
|
-
}
|
|
790
|
-
var Qn = { style: { transition: "none" } }, $n = "data-base-ui-click-trigger", er = { fallbackAxisSide: "none" }, tr = { fallbackAxisSide: "end" }, nr = {
|
|
791
|
-
clipPath: "inset(50%)",
|
|
792
|
-
position: "fixed",
|
|
793
|
-
top: 0,
|
|
794
|
-
left: 0
|
|
795
|
-
}, rr = /*#__PURE__*/ B.createContext(null), ir = () => B.useContext(rr), ar = Zn("portal");
|
|
796
|
-
function or(e = {}) {
|
|
797
|
-
let { ref: t, container: n, componentProps: r = a, elementProps: o } = e, s = z(), l = ir()?.portalNode, [u, d] = B.useState(null), [f, p] = B.useState(null), m = g((e) => {
|
|
798
|
-
e !== null && p(e);
|
|
799
|
-
}), h = B.useRef(null);
|
|
800
|
-
i(() => {
|
|
801
|
-
if (n === null) {
|
|
802
|
-
h.current && (h.current = null, p(null), d(null));
|
|
803
|
-
return;
|
|
804
|
-
}
|
|
805
|
-
let e = (n && (c(n) ? n : n.current)) ?? l ?? document.body;
|
|
806
|
-
e == null ? h.current && (h.current = null, p(null), d(null)) : h.current !== e && (h.current = e, p(null), d(e));
|
|
807
|
-
}, [n, l]);
|
|
808
|
-
let _ = x("div", r, {
|
|
809
|
-
ref: [t, m],
|
|
810
|
-
props: [{
|
|
811
|
-
id: s,
|
|
812
|
-
[ar]: ""
|
|
813
|
-
}, o]
|
|
814
|
-
}), v = u && _ ? /*#__PURE__*/ de.createPortal(_, u) : null;
|
|
815
|
-
return {
|
|
816
|
-
node: f,
|
|
817
|
-
nodeId: /*#__PURE__*/ B.isValidElement(_) ? _.props.id : void 0,
|
|
818
|
-
subtree: v
|
|
819
|
-
};
|
|
820
|
-
}
|
|
821
|
-
var sr = /*#__PURE__*/ B.forwardRef(function(e, t) {
|
|
822
|
-
let { render: n, className: r, style: a, children: o, container: s, portalOwnerRole: c, ...l } = e, { node: u, nodeId: d, subtree: f } = or({
|
|
823
|
-
container: s,
|
|
824
|
-
ref: t,
|
|
825
|
-
componentProps: e,
|
|
826
|
-
elementProps: l
|
|
827
|
-
}), p = B.useRef(null), m = B.useRef(null), h = B.useRef(null), g = B.useRef(null), [_, v] = B.useState(null), y = B.useRef(!1), b = _?.modal, x = _?.open, S = !!_ && !_.modal && _.open && !!u;
|
|
828
|
-
B.useEffect(() => {
|
|
829
|
-
if (!u || b) return;
|
|
830
|
-
function e(e) {
|
|
831
|
-
u && e.relatedTarget && Kn(e) && (e.type === "focusin" ? y.current &&= (Jn(u), !1) : (qn(u), y.current = !0));
|
|
832
|
-
}
|
|
833
|
-
return Ft(q(u, "focusin", e, !0), q(u, "focusout", e, !0));
|
|
834
|
-
}, [u, b]), i(() => {
|
|
835
|
-
u && x === !0 && y.current && (Jn(u), y.current = !1);
|
|
836
|
-
}, [x, u]);
|
|
837
|
-
let C = B.useMemo(() => ({
|
|
838
|
-
beforeOutsideRef: p,
|
|
839
|
-
afterOutsideRef: m,
|
|
840
|
-
beforeInsideRef: h,
|
|
841
|
-
afterInsideRef: g,
|
|
842
|
-
portalNode: u,
|
|
843
|
-
setFocusManagerState: v
|
|
844
|
-
}), [u]);
|
|
845
|
-
return /*#__PURE__*/ ue(B.Fragment, { children: [f, /*#__PURE__*/ ue(rr.Provider, {
|
|
846
|
-
value: C,
|
|
847
|
-
children: [
|
|
848
|
-
S && u && /*#__PURE__*/ W(Wt, {
|
|
849
|
-
"data-type": "outside",
|
|
850
|
-
ref: p,
|
|
851
|
-
onFocus: (e) => {
|
|
852
|
-
Kn(e, u) ? h.current?.focus() : Wn(_ ? _.domReference : null)?.focus();
|
|
853
|
-
}
|
|
854
|
-
}),
|
|
855
|
-
S && u && /*#__PURE__*/ W("span", {
|
|
856
|
-
role: c,
|
|
857
|
-
"aria-owns": d,
|
|
858
|
-
style: nr
|
|
859
|
-
}),
|
|
860
|
-
u && /*#__PURE__*/ de.createPortal(o, u),
|
|
861
|
-
S && u && /*#__PURE__*/ W(Wt, {
|
|
862
|
-
"data-type": "outside",
|
|
863
|
-
ref: m,
|
|
864
|
-
onFocus: (e) => {
|
|
865
|
-
Kn(e, u) ? g.current?.focus() : (Un(_ ? _.domReference : null)?.focus(), _?.closeOnFocusOut && _?.onOpenChange(!1, I("focus-out", e.nativeEvent)));
|
|
866
|
-
}
|
|
867
|
-
})
|
|
868
|
-
]
|
|
869
|
-
})] });
|
|
870
|
-
});
|
|
871
|
-
function cr() {
|
|
872
|
-
let e = /* @__PURE__ */ new Map();
|
|
873
|
-
return {
|
|
874
|
-
emit(t, n) {
|
|
875
|
-
e.get(t)?.forEach((e) => e(n));
|
|
876
|
-
},
|
|
877
|
-
on(t, n) {
|
|
878
|
-
e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n);
|
|
879
|
-
},
|
|
880
|
-
off(t, n) {
|
|
881
|
-
e.get(t)?.delete(n);
|
|
882
|
-
}
|
|
883
|
-
};
|
|
884
|
-
}
|
|
885
|
-
var lr = class {
|
|
886
|
-
nodesRef = { current: [] };
|
|
887
|
-
events = cr();
|
|
888
|
-
addNode(e) {
|
|
889
|
-
this.nodesRef.current.push(e);
|
|
890
|
-
}
|
|
891
|
-
removeNode(e) {
|
|
892
|
-
let t = this.nodesRef.current.findIndex((t) => t === e);
|
|
893
|
-
t !== -1 && this.nodesRef.current.splice(t, 1);
|
|
894
|
-
}
|
|
895
|
-
}, ur = /*#__PURE__*/ B.createContext(null), dr = /*#__PURE__*/ B.createContext(null), fr = () => B.useContext(ur)?.id || null, pr = (e) => {
|
|
896
|
-
let t = B.useContext(dr);
|
|
897
|
-
return e ?? t;
|
|
898
|
-
};
|
|
899
|
-
function mr(e) {
|
|
900
|
-
let t = z(), n = pr(e), r = fr();
|
|
901
|
-
return i(() => {
|
|
902
|
-
if (!t) return;
|
|
903
|
-
let e = {
|
|
904
|
-
id: t,
|
|
905
|
-
parentId: r
|
|
906
|
-
};
|
|
907
|
-
return n?.addNode(e), () => {
|
|
908
|
-
n?.removeNode(e);
|
|
909
|
-
};
|
|
910
|
-
}, [
|
|
911
|
-
n,
|
|
912
|
-
t,
|
|
913
|
-
r
|
|
914
|
-
]), t;
|
|
915
|
-
}
|
|
916
|
-
function hr(e) {
|
|
917
|
-
let { children: t, id: n } = e, r = fr();
|
|
918
|
-
return /*#__PURE__*/ W(ur.Provider, {
|
|
919
|
-
value: B.useMemo(() => ({
|
|
920
|
-
id: n,
|
|
921
|
-
parentId: r
|
|
922
|
-
}), [n, r]),
|
|
923
|
-
children: t
|
|
924
|
-
});
|
|
925
|
-
}
|
|
926
|
-
function gr(e) {
|
|
927
|
-
let { children: t, externalTree: n } = e, r = O(() => n ?? new lr()).current;
|
|
928
|
-
return /*#__PURE__*/ W(dr.Provider, {
|
|
929
|
-
value: r,
|
|
930
|
-
children: t
|
|
931
|
-
});
|
|
932
|
-
}
|
|
933
|
-
function _r(e) {
|
|
934
|
-
return e == null ? e : "current" in e ? e.current : e;
|
|
935
|
-
}
|
|
936
|
-
function vr(e, t) {
|
|
937
|
-
let n = null, r = null, i = !1;
|
|
938
|
-
return {
|
|
939
|
-
contextElement: e || void 0,
|
|
940
|
-
getBoundingClientRect() {
|
|
941
|
-
let a = e?.getBoundingClientRect() || {
|
|
942
|
-
width: 0,
|
|
943
|
-
height: 0,
|
|
944
|
-
x: 0,
|
|
945
|
-
y: 0
|
|
946
|
-
}, o = t.axis === "x" || t.axis === "both", s = t.axis === "y" || t.axis === "both", c = ["mouseenter", "mousemove"].includes(t.dataRef.current.openEvent?.type || "") && t.pointerType !== "touch", l = t.axis === "y" ? a.width : 0, u = t.axis === "x" ? a.height : 0, d = a.x, f = a.y;
|
|
947
|
-
return n == null && t.x && o && (n = a.x - t.x), r == null && t.y && s && (r = a.y - t.y), d -= n || 0, f -= r || 0, (!i || c) && (d = o && t.x != null ? t.x : d, f = s && t.y != null ? t.y : f), i = !0, {
|
|
948
|
-
width: l,
|
|
949
|
-
height: u,
|
|
950
|
-
x: d,
|
|
951
|
-
y: f,
|
|
952
|
-
top: f,
|
|
953
|
-
right: d + l,
|
|
954
|
-
bottom: f + u,
|
|
955
|
-
left: d
|
|
956
|
-
};
|
|
957
|
-
}
|
|
958
|
-
};
|
|
959
|
-
}
|
|
960
|
-
function yr(e) {
|
|
961
|
-
return e != null && e.clientX != null;
|
|
962
|
-
}
|
|
963
|
-
function br(e, n = {}) {
|
|
964
|
-
let { enabled: r = !0, axis: i = "both" } = n, a = e.useState("open"), o = e.useState("floatingElement"), s = e.useState("domReferenceElement"), c = e.context.dataRef, l = B.useRef(!1), u = B.useRef(null), [d, f] = B.useState(), [p, m] = B.useState([]), h = g((t) => {
|
|
965
|
-
e.set("positionReference", t);
|
|
966
|
-
}), _ = g((t, n, r) => {
|
|
967
|
-
l.current || (!c.current.openEvent || yr(c.current.openEvent)) && e.set("positionReference", vr(r ?? s, {
|
|
968
|
-
x: t,
|
|
969
|
-
y: n,
|
|
970
|
-
axis: i,
|
|
971
|
-
dataRef: c,
|
|
972
|
-
pointerType: d
|
|
973
|
-
}));
|
|
974
|
-
}), v = g((e) => {
|
|
975
|
-
a ? u.current || (_(e.clientX, e.clientY, e.currentTarget), m([])) : _(e.clientX, e.clientY, e.currentTarget);
|
|
976
|
-
}), y = ze(d) ? o : a;
|
|
977
|
-
B.useEffect(() => {
|
|
978
|
-
if (!r) {
|
|
979
|
-
h(s);
|
|
980
|
-
return;
|
|
981
|
-
}
|
|
982
|
-
if (!y) return;
|
|
983
|
-
function e() {
|
|
984
|
-
u.current?.(), u.current = null;
|
|
985
|
-
}
|
|
986
|
-
let n = t(o);
|
|
987
|
-
function i(t) {
|
|
988
|
-
let n = Ue(t);
|
|
989
|
-
K(o, n) ? e() : _(t.clientX, t.clientY);
|
|
990
|
-
}
|
|
991
|
-
return !c.current.openEvent || yr(c.current.openEvent) ? u.current = q(n, "mousemove", i) : h(s), e;
|
|
992
|
-
}, [
|
|
993
|
-
y,
|
|
994
|
-
r,
|
|
995
|
-
o,
|
|
996
|
-
c,
|
|
997
|
-
s,
|
|
998
|
-
e,
|
|
999
|
-
_,
|
|
1000
|
-
h,
|
|
1001
|
-
p
|
|
1002
|
-
]), B.useEffect(() => () => {
|
|
1003
|
-
e.set("positionReference", null);
|
|
1004
|
-
}, [e]), B.useEffect(() => {
|
|
1005
|
-
r && !o && (l.current = !1);
|
|
1006
|
-
}, [r, o]), B.useEffect(() => {
|
|
1007
|
-
!r && a && (l.current = !0);
|
|
1008
|
-
}, [r, a]);
|
|
1009
|
-
let b = B.useMemo(() => {
|
|
1010
|
-
function e(e) {
|
|
1011
|
-
f(e.pointerType);
|
|
1012
|
-
}
|
|
1013
|
-
return {
|
|
1014
|
-
onPointerDown: e,
|
|
1015
|
-
onPointerEnter: e,
|
|
1016
|
-
onMouseMove: v,
|
|
1017
|
-
onMouseEnter: v
|
|
1018
|
-
};
|
|
1019
|
-
}, [v]);
|
|
1020
|
-
return B.useMemo(() => r ? {
|
|
1021
|
-
reference: b,
|
|
1022
|
-
trigger: b
|
|
1023
|
-
} : {}, [r, b]);
|
|
1024
|
-
}
|
|
1025
|
-
function xr() {
|
|
1026
|
-
return !1;
|
|
1027
|
-
}
|
|
1028
|
-
function Sr(e) {
|
|
1029
|
-
return {
|
|
1030
|
-
escapeKey: typeof e == "boolean" ? e : e?.escapeKey ?? !1,
|
|
1031
|
-
outsidePress: typeof e == "boolean" ? e : e?.outsidePress ?? !0
|
|
1032
|
-
};
|
|
1033
|
-
}
|
|
1034
|
-
function Cr(t, i = {}) {
|
|
1035
|
-
let { enabled: a = !0, escapeKey: o = !0, outsidePress: s = !0, outsidePressEvent: c = "sloppy", referencePress: l = xr, bubbles: u, externalTree: p } = i, m = t.useState("open"), h = t.useState("floatingElement"), { dataRef: _, events: y } = t.context, b = pr(p), x = g(typeof s == "function" ? s : () => !1), S = typeof s == "function" ? x : s, C = S !== !1, w = g(() => c), { escapeKey: T, outsidePress: E } = Sr(u), D = B.useRef(!1), O = B.useRef(!1), A = B.useRef(!1), j = B.useRef(!1), N = B.useRef(!1), ee = B.useRef(""), F = B.useRef(null), L = P(), re = P(), R = P(), z = g(() => {
|
|
1036
|
-
re.clear(), _.current.insideReactTree = !1;
|
|
1037
|
-
}), ie = g((e) => {
|
|
1038
|
-
let t = _.current.floatingContext?.nodeId;
|
|
1039
|
-
return (b ? Yn(b.nodesRef.current, t) : []).some((t) => t.context?.open && !t.context.dataRef.current[e]);
|
|
1040
|
-
}), ae = g((e) => yt(e, t.select("floatingElement")) || yt(e, t.select("domReferenceElement"))), V = g((e) => {
|
|
1041
|
-
l() && t.setOpen(!1, I(ne, e.nativeEvent));
|
|
1042
|
-
}), oe = g((e) => {
|
|
1043
|
-
if (!m || !a || !o || e.key !== "Escape") return;
|
|
1044
|
-
let n = Ie(e) ? e.nativeEvent : e;
|
|
1045
|
-
if (N.current || n.isComposing || !T && ie("__escapeKeyBubbles")) return;
|
|
1046
|
-
let r = I(te, n);
|
|
1047
|
-
t.setOpen(!1, r), r.isCanceled || e.preventDefault(), !T && !r.isPropagationAllowed && e.stopPropagation();
|
|
1048
|
-
}), H = g(() => {
|
|
1049
|
-
_.current.insideReactTree = !0, re.start(0, z);
|
|
1050
|
-
}), se = g((e) => {
|
|
1051
|
-
if (!m || !a || e.button !== 0) return;
|
|
1052
|
-
let n = Ue(e.nativeEvent);
|
|
1053
|
-
K(t.select("floatingElement"), n) && (D.current || (D.current = !0, O.current = !1));
|
|
1054
|
-
}), ce = g((e) => {
|
|
1055
|
-
m && a && (e.defaultPrevented || e.nativeEvent.defaultPrevented) && D.current && (O.current = !0);
|
|
1056
|
-
});
|
|
1057
|
-
B.useEffect(() => {
|
|
1058
|
-
function e(e) {
|
|
1059
|
-
e.open || (j.current = !1);
|
|
1060
|
-
}
|
|
1061
|
-
return y.on("openchange", e), () => {
|
|
1062
|
-
y.off("openchange", e);
|
|
1063
|
-
};
|
|
1064
|
-
}, [y]), B.useEffect(() => z, [z]), B.useEffect(() => {
|
|
1065
|
-
if (!m || !a) return m || (j.current = !1, N.current = !1, ee.current = "", F.current = null), z;
|
|
1066
|
-
_.current.__escapeKeyBubbles = T, _.current.__outsidePressBubbles = E;
|
|
1067
|
-
let i = new M(), s = Y(h);
|
|
1068
|
-
function c() {
|
|
1069
|
-
R.clear(), N.current = !0;
|
|
1070
|
-
}
|
|
1071
|
-
function l() {
|
|
1072
|
-
N.current = !0, R.start(je ? 5 : 0, () => {
|
|
1073
|
-
N.current = !1;
|
|
1074
|
-
});
|
|
1075
|
-
}
|
|
1076
|
-
function u() {
|
|
1077
|
-
A.current = !0, i.start(0, () => {
|
|
1078
|
-
A.current = !1;
|
|
1079
|
-
});
|
|
1080
|
-
}
|
|
1081
|
-
function p() {
|
|
1082
|
-
D.current = !1, O.current = !1;
|
|
1083
|
-
}
|
|
1084
|
-
function g() {
|
|
1085
|
-
let e = ee.current, t = e === "pen" || !e ? "mouse" : e, n = w(), r = typeof n == "function" ? n() : n;
|
|
1086
|
-
return typeof r == "string" ? r : r[t];
|
|
1087
|
-
}
|
|
1088
|
-
function y(e) {
|
|
1089
|
-
let t = g();
|
|
1090
|
-
return t === "intentional" && e.type !== "click" || t === "sloppy" && e.type === "click";
|
|
1091
|
-
}
|
|
1092
|
-
function x(e) {
|
|
1093
|
-
let t = _.current.floatingContext?.nodeId, n = b && Yn(b.nodesRef.current, t).some((t) => yt(e, t.context?.elements.floating));
|
|
1094
|
-
return ae(e) || n;
|
|
1095
|
-
}
|
|
1096
|
-
function P(a) {
|
|
1097
|
-
if (y(a)) {
|
|
1098
|
-
a.type !== "click" && !ae(a) && (i.clear(), A.current = !1), z();
|
|
1099
|
-
return;
|
|
1100
|
-
}
|
|
1101
|
-
if (_.current.insideReactTree) {
|
|
1102
|
-
z();
|
|
1103
|
-
return;
|
|
1104
|
-
}
|
|
1105
|
-
let o = Ue(a), s = `[${Zn("inert")}]`, c = f(o) ? o.getRootNode() : null, l = Array.from((e(c) ? c : Y(t.select("floatingElement"))).querySelectorAll(s)), u = t.context.triggerElements;
|
|
1106
|
-
if (o && (u.hasElement(o) || u.hasMatchingElement((e) => K(e, o)))) return;
|
|
1107
|
-
let p = f(o) ? o : null;
|
|
1108
|
-
for (; p && !n(p);) {
|
|
1109
|
-
let e = d(p);
|
|
1110
|
-
if (n(e) || !f(e)) break;
|
|
1111
|
-
p = e;
|
|
1112
|
-
}
|
|
1113
|
-
if (!(l.length && f(o) && !bt(o) && !K(o, t.select("floatingElement")) && l.every((e) => !K(p, e)))) {
|
|
1114
|
-
if (r(o) && !("touches" in a)) {
|
|
1115
|
-
let e = n(o), t = v(o), r = /auto|scroll/, i = e || r.test(t.overflowX), s = e || r.test(t.overflowY), c = i && o.clientWidth > 0 && o.scrollWidth > o.clientWidth, l = s && o.clientHeight > 0 && o.scrollHeight > o.clientHeight, u = t.direction === "rtl", d = l && (u ? a.offsetX <= o.offsetWidth - o.clientWidth : a.offsetX > o.clientWidth), f = c && a.offsetY > o.clientHeight;
|
|
1116
|
-
if (d || f) return;
|
|
1117
|
-
}
|
|
1118
|
-
if (!x(a)) {
|
|
1119
|
-
if (g() === "intentional") {
|
|
1120
|
-
if (a.detail !== 0 && !Le(a) && !j.current) return;
|
|
1121
|
-
if (A.current) {
|
|
1122
|
-
i.clear(), A.current = !1;
|
|
1123
|
-
return;
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
(typeof S != "function" || S(a)) && (ie("__outsidePressBubbles") || (t.setOpen(!1, I(k, a)), z()));
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
function te(e) {
|
|
1131
|
-
g() === "sloppy" && e.pointerType !== "touch" && t.select("open") && a && !ae(e) && P(e);
|
|
1132
|
-
}
|
|
1133
|
-
function ne(e) {
|
|
1134
|
-
if (g() !== "sloppy" || !t.select("open") || !a || ae(e)) return;
|
|
1135
|
-
let n = e.touches[0];
|
|
1136
|
-
n && (F.current = {
|
|
1137
|
-
startTime: Date.now(),
|
|
1138
|
-
startX: n.clientX,
|
|
1139
|
-
startY: n.clientY,
|
|
1140
|
-
dismissOnTouchEnd: !1,
|
|
1141
|
-
dismissOnMouseDown: !0
|
|
1142
|
-
}, L.start(1e3, () => {
|
|
1143
|
-
F.current && (F.current.dismissOnTouchEnd = !1, F.current.dismissOnMouseDown = !1);
|
|
1144
|
-
}));
|
|
1145
|
-
}
|
|
1146
|
-
function re(e, t) {
|
|
1147
|
-
let n = Ue(e);
|
|
1148
|
-
if (!n) return;
|
|
1149
|
-
let r = q(n, e.type, () => {
|
|
1150
|
-
t(e), r();
|
|
1151
|
-
});
|
|
1152
|
-
}
|
|
1153
|
-
function B(e) {
|
|
1154
|
-
ee.current = "touch", re(e, ne);
|
|
1155
|
-
}
|
|
1156
|
-
function V(e) {
|
|
1157
|
-
L.clear(), e.type === "pointerdown" && (e.button === 0 && (j.current = !0), ee.current = e.pointerType), (e.type !== "mousedown" || !F.current || F.current.dismissOnMouseDown) && re(e, (e) => {
|
|
1158
|
-
e.type === "pointerdown" ? te(e) : P(e);
|
|
1159
|
-
});
|
|
1160
|
-
}
|
|
1161
|
-
function H(e) {
|
|
1162
|
-
if (e.type === "pointercancel" && (j.current = !1), !D.current) return;
|
|
1163
|
-
let t = O.current;
|
|
1164
|
-
p(), g() === "intentional" && (e.type === "pointercancel" ? t && u() : x(e) || (t ? u() : (typeof S != "function" || S(e)) && (i.clear(), A.current = !0, z())));
|
|
1165
|
-
}
|
|
1166
|
-
function se(e) {
|
|
1167
|
-
if (g() !== "sloppy" || !F.current || ae(e)) return;
|
|
1168
|
-
let t = e.touches[0];
|
|
1169
|
-
if (!t) return;
|
|
1170
|
-
let n = Math.abs(t.clientX - F.current.startX), r = Math.abs(t.clientY - F.current.startY), i = Math.sqrt(n * n + r * r);
|
|
1171
|
-
i > 5 && (F.current.dismissOnTouchEnd = !0), i > 10 && (P(e), L.clear(), F.current = null);
|
|
1172
|
-
}
|
|
1173
|
-
function ce(e) {
|
|
1174
|
-
re(e, se);
|
|
1175
|
-
}
|
|
1176
|
-
function le(e) {
|
|
1177
|
-
g() === "sloppy" && F.current && !ae(e) && (F.current.dismissOnTouchEnd && P(e), L.clear(), F.current = null);
|
|
1178
|
-
}
|
|
1179
|
-
function U(e) {
|
|
1180
|
-
re(e, le);
|
|
1181
|
-
}
|
|
1182
|
-
let W = Ft(o && Ft(q(s, "keydown", oe), q(s, "compositionstart", c), q(s, "compositionend", l)), C && Ft(q(s, "click", V, !0), q(s, "pointerdown", V, !0), q(s, "pointerup", H, !0), q(s, "pointercancel", H, !0), q(s, "mousedown", V, !0), q(s, "mouseup", H, !0), q(s, "touchstart", B, {
|
|
1183
|
-
capture: !0,
|
|
1184
|
-
passive: !0
|
|
1185
|
-
}), q(s, "touchmove", ce, {
|
|
1186
|
-
capture: !0,
|
|
1187
|
-
passive: !0
|
|
1188
|
-
}), q(s, "touchend", U, {
|
|
1189
|
-
capture: !0,
|
|
1190
|
-
passive: !0
|
|
1191
|
-
})));
|
|
1192
|
-
return () => {
|
|
1193
|
-
W(), i.clear(), p(), A.current = !1;
|
|
1194
|
-
};
|
|
1195
|
-
}, [
|
|
1196
|
-
_,
|
|
1197
|
-
h,
|
|
1198
|
-
o,
|
|
1199
|
-
C,
|
|
1200
|
-
S,
|
|
1201
|
-
m,
|
|
1202
|
-
a,
|
|
1203
|
-
T,
|
|
1204
|
-
E,
|
|
1205
|
-
oe,
|
|
1206
|
-
z,
|
|
1207
|
-
w,
|
|
1208
|
-
ie,
|
|
1209
|
-
ae,
|
|
1210
|
-
b,
|
|
1211
|
-
t,
|
|
1212
|
-
L,
|
|
1213
|
-
R
|
|
1214
|
-
]);
|
|
1215
|
-
let le = B.useMemo(() => ({
|
|
1216
|
-
onKeyDown: oe,
|
|
1217
|
-
onPointerDown: V,
|
|
1218
|
-
onClick: V
|
|
1219
|
-
}), [oe, V]), U = B.useMemo(() => ({
|
|
1220
|
-
onKeyDown: oe,
|
|
1221
|
-
onPointerDown: ce,
|
|
1222
|
-
onMouseDown: ce,
|
|
1223
|
-
onClickCapture: H,
|
|
1224
|
-
onMouseDownCapture(e) {
|
|
1225
|
-
H(), se(e);
|
|
1226
|
-
},
|
|
1227
|
-
onPointerDownCapture(e) {
|
|
1228
|
-
H(), se(e);
|
|
1229
|
-
},
|
|
1230
|
-
onMouseUpCapture: H,
|
|
1231
|
-
onTouchEndCapture: H,
|
|
1232
|
-
onTouchMoveCapture: H
|
|
1233
|
-
}), [
|
|
1234
|
-
oe,
|
|
1235
|
-
H,
|
|
1236
|
-
se,
|
|
1237
|
-
ce
|
|
1238
|
-
]);
|
|
1239
|
-
return B.useMemo(() => a ? {
|
|
1240
|
-
reference: le,
|
|
1241
|
-
floating: U,
|
|
1242
|
-
trigger: le
|
|
1243
|
-
} : {}, [
|
|
1244
|
-
a,
|
|
1245
|
-
le,
|
|
1246
|
-
U
|
|
1247
|
-
]);
|
|
1248
|
-
}
|
|
1249
|
-
function wr(e) {
|
|
1250
|
-
let { popupStore: t, treatPopupAsFloatingElement: n = !1, floatingRootContext: r, floatingId: a, nested: o, onOpenChange: s } = e, c = t.useState("open"), l = t.useState("activeTriggerElement"), u = t.useState(n ? "popupElement" : "positionerElement"), d = s;
|
|
1251
|
-
return t.useSyncedValue("floatingId", a), i(() => {
|
|
1252
|
-
let e = {
|
|
1253
|
-
open: c,
|
|
1254
|
-
floatingId: a,
|
|
1255
|
-
referenceElement: l,
|
|
1256
|
-
floatingElement: u
|
|
1257
|
-
};
|
|
1258
|
-
f(l) && (e.domReferenceElement = l), r.state.positionReference === r.state.referenceElement && (e.positionReference = l), r.update(e);
|
|
1259
|
-
}, [
|
|
1260
|
-
c,
|
|
1261
|
-
a,
|
|
1262
|
-
l,
|
|
1263
|
-
u,
|
|
1264
|
-
r
|
|
1265
|
-
]), r.context.onOpenChange = d, r.context.nested = o, r;
|
|
1266
|
-
}
|
|
1267
|
-
function Tr(e, t = !1, n = !1, r = !1) {
|
|
1268
|
-
let [a, o] = B.useState(e && t ? "idle" : void 0), [s, c] = B.useState(e && !r);
|
|
1269
|
-
return e && !s && (c(!0), o("starting")), !e && s && a !== "ending" && !n && o("ending"), !e && !s && a === "ending" && o(void 0), i(() => {
|
|
1270
|
-
if (!e && s && a !== "ending" && n) {
|
|
1271
|
-
let e = zt.request(() => {
|
|
1272
|
-
o("ending");
|
|
1273
|
-
});
|
|
1274
|
-
return () => {
|
|
1275
|
-
zt.cancel(e);
|
|
1276
|
-
};
|
|
1277
|
-
}
|
|
1278
|
-
}, [
|
|
1279
|
-
e,
|
|
1280
|
-
s,
|
|
1281
|
-
a,
|
|
1282
|
-
n
|
|
1283
|
-
]), i(() => {
|
|
1284
|
-
if (!e || t || a === void 0) return;
|
|
1285
|
-
let n = zt.request(() => {
|
|
1286
|
-
o(void 0);
|
|
1287
|
-
});
|
|
1288
|
-
return () => {
|
|
1289
|
-
zt.cancel(n);
|
|
1290
|
-
};
|
|
1291
|
-
}, [
|
|
1292
|
-
t,
|
|
1293
|
-
e,
|
|
1294
|
-
a
|
|
1295
|
-
]), i(() => {
|
|
1296
|
-
if (!e || !t) return;
|
|
1297
|
-
e && s && a !== "idle" && o("starting");
|
|
1298
|
-
let n = zt.request(() => {
|
|
1299
|
-
o("idle");
|
|
1300
|
-
});
|
|
1301
|
-
return () => {
|
|
1302
|
-
zt.cancel(n);
|
|
1303
|
-
};
|
|
1304
|
-
}, [
|
|
1305
|
-
t,
|
|
1306
|
-
e,
|
|
1307
|
-
s,
|
|
1308
|
-
a
|
|
1309
|
-
]), {
|
|
1310
|
-
mounted: s,
|
|
1311
|
-
setMounted: c,
|
|
1312
|
-
transitionStatus: a
|
|
1313
|
-
};
|
|
1314
|
-
}
|
|
1315
|
-
function Er(e, t) {
|
|
1316
|
-
return e.getAnimations(t).filter((e) => {
|
|
1317
|
-
let t = e.effect?.getTiming();
|
|
1318
|
-
return t?.duration !== Infinity && t?.iterations !== Infinity;
|
|
1319
|
-
});
|
|
1320
|
-
}
|
|
1321
|
-
var Dr = null;
|
|
1322
|
-
function Or(e) {
|
|
1323
|
-
if (!Dr) {
|
|
1324
|
-
let e = [];
|
|
1325
|
-
Dr = e, queueMicrotask(() => {
|
|
1326
|
-
Dr = null, de.flushSync(() => {
|
|
1327
|
-
for (let t of e) t();
|
|
1328
|
-
});
|
|
1329
|
-
});
|
|
1330
|
-
}
|
|
1331
|
-
Dr.push(e);
|
|
1332
|
-
}
|
|
1333
|
-
function kr(e, t = !1, n = !1) {
|
|
1334
|
-
let r = Bt();
|
|
1335
|
-
return g((i, a = null) => {
|
|
1336
|
-
r.cancel();
|
|
1337
|
-
let o = _r(e);
|
|
1338
|
-
if (o == null) return;
|
|
1339
|
-
let s = o, c = () => {
|
|
1340
|
-
n ? Or(() => {
|
|
1341
|
-
a?.aborted || i();
|
|
1342
|
-
}) : de.flushSync(i);
|
|
1343
|
-
};
|
|
1344
|
-
if (typeof s.getAnimations != "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
|
|
1345
|
-
i();
|
|
1346
|
-
return;
|
|
1347
|
-
}
|
|
1348
|
-
function l() {
|
|
1349
|
-
Promise.all(Er(s).map((e) => e.finished.then(u))).then(() => {
|
|
1350
|
-
a?.aborted || c();
|
|
1351
|
-
}, () => {
|
|
1352
|
-
a?.aborted || (Er(s).some((e) => e.pending || e.playState !== "finished") ? l() : c());
|
|
1353
|
-
});
|
|
1354
|
-
}
|
|
1355
|
-
if (t) {
|
|
1356
|
-
let e = Xe;
|
|
1357
|
-
if (!s.hasAttribute(e)) {
|
|
1358
|
-
r.request(l);
|
|
1359
|
-
return;
|
|
1360
|
-
}
|
|
1361
|
-
let t = new MutationObserver(() => {
|
|
1362
|
-
s.hasAttribute(e) || (t.disconnect(), l());
|
|
1363
|
-
});
|
|
1364
|
-
t.observe(s, {
|
|
1365
|
-
attributes: !0,
|
|
1366
|
-
attributeFilter: [e]
|
|
1367
|
-
}), a?.addEventListener("abort", () => t.disconnect(), { once: !0 });
|
|
1368
|
-
} else r.request(l);
|
|
1369
|
-
});
|
|
1370
|
-
}
|
|
1371
|
-
function Ar(e) {
|
|
1372
|
-
let { enabled: t = !0, open: n, ref: r, batch: i = !1, onComplete: a } = e, o = g(a), s = kr(r, n, i);
|
|
1373
|
-
B.useEffect(() => {
|
|
1374
|
-
if (!t) return;
|
|
1375
|
-
let e = new AbortController();
|
|
1376
|
-
return s(o, e.signal), () => {
|
|
1377
|
-
e.abort();
|
|
1378
|
-
};
|
|
1379
|
-
}, [
|
|
1380
|
-
t,
|
|
1381
|
-
n,
|
|
1382
|
-
o,
|
|
1383
|
-
s
|
|
1384
|
-
]);
|
|
1385
|
-
}
|
|
1386
|
-
function jr(e) {
|
|
1387
|
-
let { open: t, ref: n, preventUnmountOnClose: r, setPreventUnmountOnClose: a, onUnmount: o, animateInitialOpen: s } = e, c = g(a), { mounted: l, setMounted: u, transitionStatus: d } = Tr(t, !1, !1, s), f = !t && r;
|
|
1388
|
-
i(() => {
|
|
1389
|
-
t && c(!1);
|
|
1390
|
-
}, [t, c]);
|
|
1391
|
-
let p = B.useRef(l), m = B.useRef(!1), h = F(), _ = () => {
|
|
1392
|
-
p.current = !1, u(!1), o();
|
|
1393
|
-
};
|
|
1394
|
-
i(() => {
|
|
1395
|
-
p.current = l, m.current && (m.current = !1, !t && l && _());
|
|
1396
|
-
});
|
|
1397
|
-
let v = g(() => {
|
|
1398
|
-
p.current && (t ? (m.current = !0, h()) : _());
|
|
1399
|
-
});
|
|
1400
|
-
return Ar({
|
|
1401
|
-
enabled: l && !t && !f,
|
|
1402
|
-
open: t,
|
|
1403
|
-
ref: n,
|
|
1404
|
-
onComplete() {
|
|
1405
|
-
t || v();
|
|
1406
|
-
}
|
|
1407
|
-
}), {
|
|
1408
|
-
mounted: l,
|
|
1409
|
-
transitionStatus: d,
|
|
1410
|
-
preventUnmountingOnClose: f,
|
|
1411
|
-
forceUnmount: v
|
|
1412
|
-
};
|
|
1413
|
-
}
|
|
1414
|
-
var Mr = {
|
|
1415
|
-
tabIndex: -1,
|
|
1416
|
-
[We]: ""
|
|
1417
|
-
};
|
|
1418
|
-
function Nr(e) {
|
|
1419
|
-
return (t) => t !== "touch" || e.current;
|
|
1420
|
-
}
|
|
1421
|
-
function Pr(e, t = !1) {
|
|
1422
|
-
let n = z(), r = fr() != null, i = O(() => e(n, r)).current;
|
|
1423
|
-
return wr({
|
|
1424
|
-
popupStore: i,
|
|
1425
|
-
treatPopupAsFloatingElement: t,
|
|
1426
|
-
floatingRootContext: i.state.floatingRootContext,
|
|
1427
|
-
floatingId: n,
|
|
1428
|
-
nested: r,
|
|
1429
|
-
onOpenChange: i.setOpen
|
|
1430
|
-
}), i;
|
|
1431
|
-
}
|
|
1432
|
-
function Fr({ handle: e, store: t }) {
|
|
1433
|
-
return i(() => e.attachStore(t), [e, t]), null;
|
|
1434
|
-
}
|
|
1435
|
-
function Ir(e) {
|
|
1436
|
-
let t = e.context.triggerElements.size;
|
|
1437
|
-
e.select("open") && e.state.triggerCount !== t && e.set("triggerCount", t);
|
|
1438
|
-
}
|
|
1439
|
-
function Lr(e, t) {
|
|
1440
|
-
let n = B.useRef(null);
|
|
1441
|
-
return g((r) => {
|
|
1442
|
-
let i = n.current;
|
|
1443
|
-
if (i !== null) {
|
|
1444
|
-
if (i.element === r && i.store === t && i.id === e) return;
|
|
1445
|
-
n.current = null;
|
|
1446
|
-
let a = i.store;
|
|
1447
|
-
a.context.triggerElements.getById(i.id) === i.element && (a.context.triggerElements.delete(i.id), Ir(a));
|
|
1448
|
-
}
|
|
1449
|
-
r !== null && e !== void 0 && (n.current = {
|
|
1450
|
-
store: t,
|
|
1451
|
-
id: e,
|
|
1452
|
-
element: r
|
|
1453
|
-
}, t.context.triggerElements.add(e, r), Ir(t));
|
|
1454
|
-
});
|
|
1455
|
-
}
|
|
1456
|
-
function Rr(e, t, n, r = !1) {
|
|
1457
|
-
let i = e.preventUnmountingOnClose;
|
|
1458
|
-
t ? i = !1 : r && (i = !0);
|
|
1459
|
-
let a = n?.id ?? null, o = e.activeTriggerId, s = e.activeTriggerElement;
|
|
1460
|
-
return (a || t) && (o = a, s = n ?? null), {
|
|
1461
|
-
open: t,
|
|
1462
|
-
preventUnmountingOnClose: i,
|
|
1463
|
-
activeTriggerId: o,
|
|
1464
|
-
activeTriggerElement: s,
|
|
1465
|
-
openedWithoutTrigger: t ? n == null : e.openedWithoutTrigger
|
|
1466
|
-
};
|
|
1467
|
-
}
|
|
1468
|
-
function zr(e) {
|
|
1469
|
-
let t = !1;
|
|
1470
|
-
return e.preventUnmountOnClose = () => {
|
|
1471
|
-
t = !0;
|
|
1472
|
-
}, () => t;
|
|
1473
|
-
}
|
|
1474
|
-
function Br(e, t, n, r = {}) {
|
|
1475
|
-
let i = n.reason, a = i === N, o = t && i === "trigger-focus", s = !t && (i === "trigger-press" || i === "escape-key"), c = zr(n);
|
|
1476
|
-
if (e.context.onOpenChange?.(t, n), n.isCanceled) return;
|
|
1477
|
-
r.onBeforeDispatch?.(), e.state.floatingRootContext.dispatchOpenChange(t, n);
|
|
1478
|
-
let l = () => {
|
|
1479
|
-
let i = Rr(e.state, t, n.trigger, c()), l = {
|
|
1480
|
-
...r.extraState,
|
|
1481
|
-
...i
|
|
1482
|
-
};
|
|
1483
|
-
o ? l.instantType = "focus" : s ? l.instantType = "dismiss" : a && (l.instantType = void 0), e.update(l);
|
|
1484
|
-
};
|
|
1485
|
-
a ? de.flushSync(l) : l();
|
|
1486
|
-
}
|
|
1487
|
-
function Vr(e, t, n, r) {
|
|
1488
|
-
let a = n.useState("isMountedByTrigger", e), o = Lr(e, n), s = g((t) => {
|
|
1489
|
-
let i = n.select("open"), a = n.select("activeTriggerId");
|
|
1490
|
-
if (a === e) {
|
|
1491
|
-
let e = {
|
|
1492
|
-
activeTriggerElement: t,
|
|
1493
|
-
...i ? r : null
|
|
1494
|
-
};
|
|
1495
|
-
n.update(e);
|
|
1496
|
-
} else if (a == null && i && !n.state.openedWithoutTrigger) {
|
|
1497
|
-
let i = {
|
|
1498
|
-
activeTriggerId: e ?? null,
|
|
1499
|
-
activeTriggerElement: t,
|
|
1500
|
-
...r
|
|
1501
|
-
};
|
|
1502
|
-
n.update(i);
|
|
1503
|
-
}
|
|
1504
|
-
}), c = g((e) => {
|
|
1505
|
-
o(e), e && s(e);
|
|
1506
|
-
});
|
|
1507
|
-
return i(() => (c(t.current), () => c(null)), [
|
|
1508
|
-
c,
|
|
1509
|
-
t,
|
|
1510
|
-
n,
|
|
1511
|
-
e
|
|
1512
|
-
]), i(() => {
|
|
1513
|
-
if (a) {
|
|
1514
|
-
let e = {
|
|
1515
|
-
activeTriggerElement: t.current,
|
|
1516
|
-
...r
|
|
1517
|
-
};
|
|
1518
|
-
n.update(e);
|
|
1519
|
-
}
|
|
1520
|
-
}, [
|
|
1521
|
-
a,
|
|
1522
|
-
n,
|
|
1523
|
-
t,
|
|
1524
|
-
...Object.values(r)
|
|
1525
|
-
]), {
|
|
1526
|
-
registerTrigger: c,
|
|
1527
|
-
isMountedByThisTrigger: a
|
|
1528
|
-
};
|
|
1529
|
-
}
|
|
1530
|
-
function Hr(e, t = {}) {
|
|
1531
|
-
let { closeOnActiveTriggerUnmount: n = !1 } = t, r = B.useRef(null), a = e.useState("open"), o = e.useState("triggerCount"), s = e.useState("activeTriggerId"), c = e.useState("activeTriggerElement");
|
|
1532
|
-
i(() => {
|
|
1533
|
-
if (!a) {
|
|
1534
|
-
r.current = null, e.state.triggerCount !== 0 && e.set("triggerCount", 0), e.state.openedWithoutTrigger && e.set("openedWithoutTrigger", !1);
|
|
1535
|
-
return;
|
|
1536
|
-
}
|
|
1537
|
-
let t = e.context.triggerElements.size, i = {};
|
|
1538
|
-
e.state.triggerCount !== t && (i.triggerCount = t);
|
|
1539
|
-
let o = e.select("activeTriggerId"), s = null;
|
|
1540
|
-
if (o) {
|
|
1541
|
-
let t = e.context.triggerElements.getById(o);
|
|
1542
|
-
if (t) r.current = o, t !== e.state.activeTriggerElement && (i.activeTriggerElement = t);
|
|
1543
|
-
else {
|
|
1544
|
-
for (let [t, n] of e.context.triggerElements.entries()) if (n === e.state.activeTriggerElement) {
|
|
1545
|
-
i.activeTriggerId = t, i.activeTriggerElement = n, r.current = t;
|
|
1546
|
-
break;
|
|
1547
|
-
}
|
|
1548
|
-
i.activeTriggerId === void 0 && (r.current === o ? s = o : r.current = null);
|
|
1549
|
-
}
|
|
1550
|
-
} else r.current = null;
|
|
1551
|
-
if (!s && !o && !e.state.openedWithoutTrigger && t === 1) {
|
|
1552
|
-
let t = e.context.triggerElements.entries().next();
|
|
1553
|
-
if (!t.done) {
|
|
1554
|
-
let [e, n] = t.value;
|
|
1555
|
-
i.activeTriggerId = e, i.activeTriggerElement = n, r.current = e;
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
(i.triggerCount !== void 0 || i.activeTriggerId !== void 0 || i.activeTriggerElement !== void 0) && e.update(i), s && n && queueMicrotask(() => {
|
|
1559
|
-
if (e.select("open") && e.select("activeTriggerId") === s && !e.context.triggerElements.getById(s)) {
|
|
1560
|
-
let t = I(ee);
|
|
1561
|
-
e.setOpen(!1, t), t.isCanceled || e.update({
|
|
1562
|
-
activeTriggerId: null,
|
|
1563
|
-
activeTriggerElement: null
|
|
1564
|
-
});
|
|
1565
|
-
}
|
|
1566
|
-
});
|
|
1567
|
-
}, [
|
|
1568
|
-
a,
|
|
1569
|
-
e,
|
|
1570
|
-
o,
|
|
1571
|
-
s,
|
|
1572
|
-
c,
|
|
1573
|
-
n
|
|
1574
|
-
]);
|
|
1575
|
-
}
|
|
1576
|
-
function Ur(e, t, n, r) {
|
|
1577
|
-
let { mounted: i, transitionStatus: a, forceUnmount: o } = jr({
|
|
1578
|
-
open: e,
|
|
1579
|
-
ref: t.context.popupRef,
|
|
1580
|
-
preventUnmountOnClose: t.useState("preventUnmountingOnClose"),
|
|
1581
|
-
setPreventUnmountOnClose: (e) => t.set("preventUnmountingOnClose", e),
|
|
1582
|
-
animateInitialOpen: r,
|
|
1583
|
-
onUnmount() {
|
|
1584
|
-
t.update({
|
|
1585
|
-
activeTriggerId: null,
|
|
1586
|
-
activeTriggerElement: null,
|
|
1587
|
-
mounted: !1,
|
|
1588
|
-
preventUnmountingOnClose: !1
|
|
1589
|
-
}), n?.(), t.context.onOpenChangeComplete?.(!1);
|
|
1590
|
-
}
|
|
1591
|
-
});
|
|
1592
|
-
return O(() => (t.set("mounted", i), null)), t.useSyncedValues({
|
|
1593
|
-
mounted: i,
|
|
1594
|
-
transitionStatus: a
|
|
1595
|
-
}), {
|
|
1596
|
-
forceUnmount: o,
|
|
1597
|
-
transitionStatus: a
|
|
1598
|
-
};
|
|
1599
|
-
}
|
|
1600
|
-
function Wr(e, t) {
|
|
1601
|
-
e.useSyncedValues(t), i(() => () => {
|
|
1602
|
-
e.update({
|
|
1603
|
-
activeTriggerProps: a,
|
|
1604
|
-
inactiveTriggerProps: a,
|
|
1605
|
-
popupProps: a
|
|
1606
|
-
});
|
|
1607
|
-
}, [e]);
|
|
1608
|
-
}
|
|
1609
|
-
function Gr(e, t) {
|
|
1610
|
-
i(() => {
|
|
1611
|
-
!t && e.state.openMethod !== null && e.set("openMethod", null);
|
|
1612
|
-
}, [t, e]), i(() => () => {
|
|
1613
|
-
e.state.openMethod !== null && e.set("openMethod", null);
|
|
1614
|
-
}, [e]);
|
|
1615
|
-
}
|
|
1616
|
-
var Kr = class {
|
|
1617
|
-
idMap = /* @__PURE__ */ new Map();
|
|
1618
|
-
add(e, t) {
|
|
1619
|
-
this.idMap.set(e, t);
|
|
1620
|
-
}
|
|
1621
|
-
delete(e) {
|
|
1622
|
-
this.idMap.delete(e);
|
|
1623
|
-
}
|
|
1624
|
-
hasElement(e) {
|
|
1625
|
-
for (let t of this.idMap.values()) if (t === e) return !0;
|
|
1626
|
-
return !1;
|
|
1627
|
-
}
|
|
1628
|
-
hasMatchingElement(e) {
|
|
1629
|
-
for (let t of this.idMap.values()) if (e(t)) return !0;
|
|
1630
|
-
return !1;
|
|
1631
|
-
}
|
|
1632
|
-
getById(e) {
|
|
1633
|
-
return this.idMap.get(e);
|
|
1634
|
-
}
|
|
1635
|
-
entries() {
|
|
1636
|
-
return this.idMap.entries();
|
|
1637
|
-
}
|
|
1638
|
-
elements() {
|
|
1639
|
-
return this.idMap.values();
|
|
1640
|
-
}
|
|
1641
|
-
get size() {
|
|
1642
|
-
return this.idMap.size;
|
|
1643
|
-
}
|
|
1644
|
-
};
|
|
1645
|
-
function qr(e, t, n, r, i) {
|
|
1646
|
-
let a = ce({
|
|
1647
|
-
hasValue: !1,
|
|
1648
|
-
value: null
|
|
1649
|
-
}), [o, s] = se(() => {
|
|
1650
|
-
let e = !1, o, s, c = (t) => {
|
|
1651
|
-
if (!e) {
|
|
1652
|
-
e = !0, o = t;
|
|
1653
|
-
let n = r(t), c = a.current;
|
|
1654
|
-
return i && c.hasValue && i(c.value, n) ? (s = c.value, s) : (s = n, s);
|
|
1655
|
-
}
|
|
1656
|
-
if (Object.is(o, t)) return s;
|
|
1657
|
-
let n = r(t);
|
|
1658
|
-
return i && i(s, n) ? (o = t, s) : (o = t, s = n, s);
|
|
1659
|
-
};
|
|
1660
|
-
return [() => c(t()), n ? () => c(n()) : void 0];
|
|
1661
|
-
}, [
|
|
1662
|
-
t,
|
|
1663
|
-
n,
|
|
1664
|
-
r,
|
|
1665
|
-
i
|
|
1666
|
-
]), c = le(e, o, s);
|
|
1667
|
-
return oe(() => {
|
|
1668
|
-
a.current.hasValue = !0, a.current.value = c;
|
|
1669
|
-
}, [c]), V(c), c;
|
|
1670
|
-
}
|
|
1671
|
-
var Jr = h(19) ? Zr : Qr;
|
|
1672
|
-
function Yr(e, t, n, r, i) {
|
|
1673
|
-
return Jr(e, t, n, r, i);
|
|
1674
|
-
}
|
|
1675
|
-
function Xr(e, t, n, r, i) {
|
|
1676
|
-
let a = B.useCallback(() => t(e.getSnapshot(), n, r, i), [
|
|
1677
|
-
e,
|
|
1678
|
-
t,
|
|
1679
|
-
n,
|
|
1680
|
-
r,
|
|
1681
|
-
i
|
|
1682
|
-
]);
|
|
1683
|
-
return U(e.subscribe, a, a);
|
|
1684
|
-
}
|
|
1685
|
-
he({
|
|
1686
|
-
before(e) {
|
|
1687
|
-
e.syncIndex = 0, e.didInitialize || (e.syncTick = 1, e.syncHooks = [], e.didChangeStore = !0, e.getSnapshot = () => {
|
|
1688
|
-
let t = !1;
|
|
1689
|
-
for (let n = 0; n < e.syncHooks.length; n += 1) {
|
|
1690
|
-
let r = e.syncHooks[n], i = r.selector(r.store.state, r.a1, r.a2, r.a3);
|
|
1691
|
-
Object.is(r.value, i) || (t = !0, r.value = i);
|
|
1692
|
-
}
|
|
1693
|
-
return t && (e.syncTick += 1), e.syncTick;
|
|
1694
|
-
});
|
|
1695
|
-
},
|
|
1696
|
-
after(e) {
|
|
1697
|
-
e.syncHooks.length > 0 && (e.didChangeStore && (e.didChangeStore = !1, e.subscribe = (t) => {
|
|
1698
|
-
let n = /* @__PURE__ */ new Set();
|
|
1699
|
-
for (let t of e.syncHooks) n.add(t.store);
|
|
1700
|
-
let r = [];
|
|
1701
|
-
for (let e of n) r.push(e.subscribe(t));
|
|
1702
|
-
return () => {
|
|
1703
|
-
for (let e of r) e();
|
|
1704
|
-
};
|
|
1705
|
-
}), U(e.subscribe, e.getSnapshot, e.getSnapshot));
|
|
1706
|
-
}
|
|
1707
|
-
});
|
|
1708
|
-
function Zr(e, t, n, r, i) {
|
|
1709
|
-
let a = me();
|
|
1710
|
-
if (!a) return Xr(e, t, n, r, i);
|
|
1711
|
-
let o = a.syncIndex;
|
|
1712
|
-
a.syncIndex += 1;
|
|
1713
|
-
let s;
|
|
1714
|
-
return a.didInitialize ? (s = a.syncHooks[o], (s.store !== e || s.selector !== t || !Object.is(s.a1, n) || !Object.is(s.a2, r) || !Object.is(s.a3, i)) && (s.store !== e && (a.didChangeStore = !0), s.store = e, s.selector = t, s.a1 = n, s.a2 = r, s.a3 = i, s.value = t(e.getSnapshot(), n, r, i))) : (s = {
|
|
1715
|
-
store: e,
|
|
1716
|
-
selector: t,
|
|
1717
|
-
a1: n,
|
|
1718
|
-
a2: r,
|
|
1719
|
-
a3: i,
|
|
1720
|
-
value: t(e.getSnapshot(), n, r, i)
|
|
1721
|
-
}, a.syncHooks.push(s)), s.value;
|
|
1722
|
-
}
|
|
1723
|
-
function Qr(e, t, n, r, i) {
|
|
1724
|
-
return qr(e.subscribe, e.getSnapshot, e.getSnapshot, (e) => t(e, n, r, i));
|
|
1725
|
-
}
|
|
1726
|
-
var $r = class {
|
|
1727
|
-
static create(e) {
|
|
1728
|
-
return new this(e);
|
|
1729
|
-
}
|
|
1730
|
-
constructor(e) {
|
|
1731
|
-
this.state = e, this.listeners = /* @__PURE__ */ new Set(), this.updateTick = 0;
|
|
1732
|
-
}
|
|
1733
|
-
subscribe = (e) => (this.listeners.add(e), () => {
|
|
1734
|
-
this.listeners.delete(e);
|
|
1735
|
-
});
|
|
1736
|
-
getSnapshot = () => this.state;
|
|
1737
|
-
setState(e) {
|
|
1738
|
-
if (this.state === e) return;
|
|
1739
|
-
this.state = e, this.updateTick += 1;
|
|
1740
|
-
let t = this.updateTick;
|
|
1741
|
-
for (let n of this.listeners) {
|
|
1742
|
-
if (t !== this.updateTick) return;
|
|
1743
|
-
n(e);
|
|
1744
|
-
}
|
|
1745
|
-
}
|
|
1746
|
-
update(e) {
|
|
1747
|
-
for (let t in e) if (!Object.is(this.state[t], e[t])) {
|
|
1748
|
-
this.setState({
|
|
1749
|
-
...this.state,
|
|
1750
|
-
...e
|
|
1751
|
-
});
|
|
1752
|
-
return;
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
set(e, t) {
|
|
1756
|
-
Object.is(this.state[e], t) || this.setState({
|
|
1757
|
-
...this.state,
|
|
1758
|
-
[e]: t
|
|
1759
|
-
});
|
|
1760
|
-
}
|
|
1761
|
-
notifyAll() {
|
|
1762
|
-
let e = { ...this.state };
|
|
1763
|
-
this.setState(e);
|
|
1764
|
-
}
|
|
1765
|
-
use(e, t, n, r) {
|
|
1766
|
-
return Yr(this, e, t, n, r);
|
|
1767
|
-
}
|
|
1768
|
-
}, ei = class extends $r {
|
|
1769
|
-
constructor(e, t = {}, n) {
|
|
1770
|
-
super(e), this.context = t, this.selectors = n;
|
|
1771
|
-
}
|
|
1772
|
-
useSyncedValue(e, t) {
|
|
1773
|
-
B.useDebugValue(e);
|
|
1774
|
-
let n = this;
|
|
1775
|
-
i(() => {
|
|
1776
|
-
n.state[e] !== t && n.set(e, t);
|
|
1777
|
-
}, [
|
|
1778
|
-
n,
|
|
1779
|
-
e,
|
|
1780
|
-
t
|
|
1781
|
-
]);
|
|
1782
|
-
}
|
|
1783
|
-
useSyncedValueWithCleanup(e, t) {
|
|
1784
|
-
let n = this;
|
|
1785
|
-
i(() => (n.state[e] !== t && n.set(e, t), () => {
|
|
1786
|
-
n.set(e, void 0);
|
|
1787
|
-
}), [
|
|
1788
|
-
n,
|
|
1789
|
-
e,
|
|
1790
|
-
t
|
|
1791
|
-
]);
|
|
1792
|
-
}
|
|
1793
|
-
useSyncedValues(e) {
|
|
1794
|
-
let t = this, n = Object.values(e);
|
|
1795
|
-
i(() => {
|
|
1796
|
-
t.update(e);
|
|
1797
|
-
}, [t, ...n]);
|
|
1798
|
-
}
|
|
1799
|
-
useControlledProp(e, t) {
|
|
1800
|
-
B.useDebugValue(e);
|
|
1801
|
-
let n = this, r = t !== void 0;
|
|
1802
|
-
i(() => {
|
|
1803
|
-
r && !Object.is(n.state[e], t) && n.setState({
|
|
1804
|
-
...n.state,
|
|
1805
|
-
[e]: t
|
|
1806
|
-
});
|
|
1807
|
-
}, [
|
|
1808
|
-
n,
|
|
1809
|
-
e,
|
|
1810
|
-
t,
|
|
1811
|
-
r
|
|
1812
|
-
]);
|
|
1813
|
-
}
|
|
1814
|
-
select(e, t, n, r) {
|
|
1815
|
-
let i = this.selectors[e];
|
|
1816
|
-
return i(this.state, t, n, r);
|
|
1817
|
-
}
|
|
1818
|
-
useState(e, t, n, r) {
|
|
1819
|
-
return B.useDebugValue(e), Yr(this, this.selectors[e], t, n, r);
|
|
1820
|
-
}
|
|
1821
|
-
useContextCallback(e, t) {
|
|
1822
|
-
B.useDebugValue(e);
|
|
1823
|
-
let n = g(t ?? u);
|
|
1824
|
-
this.context[e] = n;
|
|
1825
|
-
}
|
|
1826
|
-
useStateSetter(e) {
|
|
1827
|
-
let t = B.useRef(void 0);
|
|
1828
|
-
return t.current === void 0 && (t.current = (t) => {
|
|
1829
|
-
this.set(e, t);
|
|
1830
|
-
}), t.current;
|
|
1831
|
-
}
|
|
1832
|
-
observe(e, t) {
|
|
1833
|
-
let n;
|
|
1834
|
-
n = typeof e == "function" ? e : this.selectors[e];
|
|
1835
|
-
let r = n(this.state);
|
|
1836
|
-
return t(r, r, this), this.subscribe((e) => {
|
|
1837
|
-
let i = n(e);
|
|
1838
|
-
if (!Object.is(r, i)) {
|
|
1839
|
-
let e = r;
|
|
1840
|
-
r = i, t(i, e, this);
|
|
1841
|
-
}
|
|
1842
|
-
});
|
|
1843
|
-
}
|
|
1844
|
-
}, ti = {
|
|
1845
|
-
open: (e) => e.open,
|
|
1846
|
-
transitionStatus: (e) => e.transitionStatus,
|
|
1847
|
-
domReferenceElement: (e) => e.domReferenceElement,
|
|
1848
|
-
referenceElement: (e) => e.positionReference ?? e.referenceElement,
|
|
1849
|
-
floatingElement: (e) => e.floatingElement,
|
|
1850
|
-
floatingId: (e) => e.floatingId
|
|
1851
|
-
}, ni = class extends ei {
|
|
1852
|
-
constructor(e) {
|
|
1853
|
-
let { syncOnly: t, nested: n, onOpenChange: r, triggerElements: i, ...a } = e;
|
|
1854
|
-
super({
|
|
1855
|
-
...a,
|
|
1856
|
-
positionReference: a.referenceElement,
|
|
1857
|
-
domReferenceElement: a.referenceElement
|
|
1858
|
-
}, {
|
|
1859
|
-
onOpenChange: r,
|
|
1860
|
-
dataRef: { current: {} },
|
|
1861
|
-
events: cr(),
|
|
1862
|
-
nested: n,
|
|
1863
|
-
triggerElements: i
|
|
1864
|
-
}, ti), this.syncOnly = t;
|
|
1865
|
-
}
|
|
1866
|
-
syncOpenEvent = (e, t) => {
|
|
1867
|
-
(!e || !this.state.open || t != null && Be(t)) && (this.context.dataRef.current.openEvent = e ? t : void 0);
|
|
1868
|
-
};
|
|
1869
|
-
dispatchOpenChange = (e, t) => {
|
|
1870
|
-
this.syncOpenEvent(e, t.event);
|
|
1871
|
-
let n = {
|
|
1872
|
-
open: e,
|
|
1873
|
-
reason: t.reason,
|
|
1874
|
-
nativeEvent: t.event,
|
|
1875
|
-
nested: this.context.nested,
|
|
1876
|
-
triggerElement: t.trigger
|
|
1877
|
-
};
|
|
1878
|
-
this.context.events.emit("openchange", n);
|
|
1879
|
-
};
|
|
1880
|
-
setOpen = (e, t) => {
|
|
1881
|
-
this.syncOnly || this.dispatchOpenChange(e, t), this.context.onOpenChange?.(e, t);
|
|
1882
|
-
};
|
|
1883
|
-
};
|
|
1884
|
-
function ri(e, t, n = !1) {
|
|
1885
|
-
return {
|
|
1886
|
-
open: !1,
|
|
1887
|
-
openProp: void 0,
|
|
1888
|
-
mounted: !1,
|
|
1889
|
-
transitionStatus: void 0,
|
|
1890
|
-
floatingRootContext: new ni({
|
|
1891
|
-
open: !1,
|
|
1892
|
-
transitionStatus: void 0,
|
|
1893
|
-
floatingElement: null,
|
|
1894
|
-
referenceElement: null,
|
|
1895
|
-
triggerElements: e,
|
|
1896
|
-
floatingId: t,
|
|
1897
|
-
syncOnly: !0,
|
|
1898
|
-
nested: n,
|
|
1899
|
-
onOpenChange: void 0
|
|
1900
|
-
}),
|
|
1901
|
-
floatingId: t,
|
|
1902
|
-
triggerCount: 0,
|
|
1903
|
-
preventUnmountingOnClose: !1,
|
|
1904
|
-
payload: void 0,
|
|
1905
|
-
activeTriggerId: null,
|
|
1906
|
-
activeTriggerElement: null,
|
|
1907
|
-
openedWithoutTrigger: !1,
|
|
1908
|
-
triggerIdProp: void 0,
|
|
1909
|
-
popupElement: null,
|
|
1910
|
-
positionerElement: null,
|
|
1911
|
-
activeTriggerProps: a,
|
|
1912
|
-
inactiveTriggerProps: a,
|
|
1913
|
-
popupProps: a
|
|
1914
|
-
};
|
|
1915
|
-
}
|
|
1916
|
-
var ii = (e) => e.triggerIdProp ?? e.activeTriggerId, ai = (e) => e.openProp ?? e.open, oi = (e) => (e.popupElement?.id ?? e.floatingId) || void 0;
|
|
1917
|
-
function si(e, t) {
|
|
1918
|
-
return t !== void 0 && ai(e) && ii(e) === t;
|
|
1919
|
-
}
|
|
1920
|
-
function ci(e, t) {
|
|
1921
|
-
return si(e, t) ? !0 : t !== void 0 && ai(e) && ii(e) == null && !e.openedWithoutTrigger && e.triggerCount === 1;
|
|
1922
|
-
}
|
|
1923
|
-
var li = {
|
|
1924
|
-
open: ai,
|
|
1925
|
-
mounted: (e) => e.mounted,
|
|
1926
|
-
transitionStatus: (e) => ai(e) && !e.mounted ? "starting" : e.transitionStatus,
|
|
1927
|
-
floatingRootContext: (e) => e.floatingRootContext,
|
|
1928
|
-
triggerCount: (e) => e.triggerCount,
|
|
1929
|
-
preventUnmountingOnClose: (e) => e.preventUnmountingOnClose,
|
|
1930
|
-
payload: (e) => e.payload,
|
|
1931
|
-
activeTriggerId: ii,
|
|
1932
|
-
activeTriggerElement: (e) => e.mounted ? e.activeTriggerElement : null,
|
|
1933
|
-
popupId: oi,
|
|
1934
|
-
isTriggerActive: (e, t) => t !== void 0 && ii(e) === t,
|
|
1935
|
-
isOpenedByTrigger: (e, t) => si(e, t),
|
|
1936
|
-
isMountedByTrigger: (e, t) => t !== void 0 && ii(e) === t && e.mounted,
|
|
1937
|
-
triggerProps: (e, t) => t ? e.activeTriggerProps : e.inactiveTriggerProps,
|
|
1938
|
-
triggerPopupId: (e, t) => ci(e, t) ? oi(e) : void 0,
|
|
1939
|
-
popupProps: (e) => e.popupProps,
|
|
1940
|
-
popupElement: (e) => e.popupElement,
|
|
1941
|
-
positionerElement: (e) => e.positionerElement
|
|
1942
|
-
};
|
|
1943
|
-
function ui(e) {
|
|
1944
|
-
let t = B.useCallback((t) => e === void 0 ? u : e.subscribeStore(t), [e]), n = B.useCallback(() => e === void 0 ? void 0 : e.store, [e]);
|
|
1945
|
-
return U(t, n, () => e?.serverStore);
|
|
1946
|
-
}
|
|
1947
|
-
var di = ke && je;
|
|
1948
|
-
function fi(e, n = {}) {
|
|
1949
|
-
let { enabled: i = !0, delay: a } = n, { events: o, dataRef: s } = e.context, c = B.useRef(!1), l = B.useRef(null), u = B.useRef(!0), d = P();
|
|
1950
|
-
B.useEffect(() => {
|
|
1951
|
-
let n = e.select("domReferenceElement");
|
|
1952
|
-
if (!i) return;
|
|
1953
|
-
let a = t(n);
|
|
1954
|
-
function o() {
|
|
1955
|
-
let t = e.select("domReferenceElement");
|
|
1956
|
-
!e.select("open") && r(t) && t === Ve(Y(t)) && (c.current = !0, l.current = t);
|
|
1957
|
-
}
|
|
1958
|
-
function s() {
|
|
1959
|
-
u.current = !0;
|
|
1960
|
-
}
|
|
1961
|
-
function d() {
|
|
1962
|
-
u.current = !1;
|
|
1963
|
-
}
|
|
1964
|
-
return Ft(q(a, "blur", o), di && q(a, "keydown", s, !0), di && q(a, "pointerdown", d, !0));
|
|
1965
|
-
}, [e, i]), B.useEffect(() => {
|
|
1966
|
-
if (!i) return;
|
|
1967
|
-
function t(t) {
|
|
1968
|
-
if (t.reason === "trigger-press" || t.reason === "escape-key") {
|
|
1969
|
-
let t = e.select("domReferenceElement");
|
|
1970
|
-
f(t) && (l.current = t, c.current = !0);
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
return o.on("openchange", t), () => {
|
|
1974
|
-
o.off("openchange", t);
|
|
1975
|
-
};
|
|
1976
|
-
}, [
|
|
1977
|
-
o,
|
|
1978
|
-
i,
|
|
1979
|
-
e
|
|
1980
|
-
]);
|
|
1981
|
-
let p = B.useMemo(() => {
|
|
1982
|
-
function t() {
|
|
1983
|
-
c.current = !1, l.current = null;
|
|
1984
|
-
}
|
|
1985
|
-
return {
|
|
1986
|
-
onMouseLeave() {
|
|
1987
|
-
t();
|
|
1988
|
-
},
|
|
1989
|
-
onFocus(n) {
|
|
1990
|
-
let r = n.currentTarget;
|
|
1991
|
-
if (c.current) {
|
|
1992
|
-
if (l.current === r) return;
|
|
1993
|
-
t();
|
|
1994
|
-
}
|
|
1995
|
-
let i = Ue(n.nativeEvent);
|
|
1996
|
-
if (f(i)) {
|
|
1997
|
-
if (di && !n.relatedTarget) {
|
|
1998
|
-
if (!u.current && !xt(i)) return;
|
|
1999
|
-
} else if (!wt(i)) return;
|
|
2000
|
-
}
|
|
2001
|
-
let o = vt(n.relatedTarget, e.context.triggerElements), { nativeEvent: s, currentTarget: p } = n;
|
|
2002
|
-
e.select("open") && o || !a ? e.setOpen(!0, I(A, s, p)) : d.start(a, () => {
|
|
2003
|
-
c.current || e.setOpen(!0, I(A, s, p));
|
|
2004
|
-
});
|
|
2005
|
-
},
|
|
2006
|
-
onBlur(n) {
|
|
2007
|
-
t();
|
|
2008
|
-
let r = n.relatedTarget, i = n.nativeEvent, a = f(r) && r.hasAttribute(Zn("focus-guard")) && r.getAttribute("data-type") === "outside";
|
|
2009
|
-
d.start(0, () => {
|
|
2010
|
-
let t = e.select("domReferenceElement"), n = Ve(Y(t));
|
|
2011
|
-
(r || n !== t) && (K(s.current.floatingContext?.refs.floating.current, n) || K(t, n) || a || vt(r ?? n, e.context.triggerElements) || e.setOpen(!1, I(A, i)));
|
|
2012
|
-
});
|
|
2013
|
-
}
|
|
2014
|
-
};
|
|
2015
|
-
}, [
|
|
2016
|
-
s,
|
|
2017
|
-
a,
|
|
2018
|
-
e,
|
|
2019
|
-
d
|
|
2020
|
-
]);
|
|
2021
|
-
return B.useMemo(() => i ? {
|
|
2022
|
-
reference: p,
|
|
2023
|
-
trigger: p
|
|
2024
|
-
} : {}, [i, p]);
|
|
2025
|
-
}
|
|
2026
|
-
var pi = class e {
|
|
2027
|
-
pointerType = void 0;
|
|
2028
|
-
interactedInside = !1;
|
|
2029
|
-
handler = void 0;
|
|
2030
|
-
blockMouseMove = !0;
|
|
2031
|
-
performedPointerEventsMutation = !1;
|
|
2032
|
-
pointerEventsScopeElement = null;
|
|
2033
|
-
pointerEventsReferenceElement = null;
|
|
2034
|
-
pointerEventsFloatingElement = null;
|
|
2035
|
-
restTimeoutPending = !1;
|
|
2036
|
-
openChangeTimeout = new M();
|
|
2037
|
-
restTimeout = new M();
|
|
2038
|
-
handleCloseOptions = void 0;
|
|
2039
|
-
static create() {
|
|
2040
|
-
return new e();
|
|
2041
|
-
}
|
|
2042
|
-
dispose = () => {
|
|
2043
|
-
this.openChangeTimeout.clear(), this.restTimeout.clear();
|
|
2044
|
-
};
|
|
2045
|
-
disposeEffect = () => this.dispose;
|
|
2046
|
-
}, mi = /* @__PURE__ */ new WeakMap();
|
|
2047
|
-
function hi(e) {
|
|
2048
|
-
if (!e.performedPointerEventsMutation) return;
|
|
2049
|
-
let t = e.pointerEventsScopeElement;
|
|
2050
|
-
t && mi.get(t) === e && (e.pointerEventsScopeElement?.style.removeProperty("pointer-events"), e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"), e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"), mi.delete(t)), e.performedPointerEventsMutation = !1, e.pointerEventsScopeElement = null, e.pointerEventsReferenceElement = null, e.pointerEventsFloatingElement = null;
|
|
2051
|
-
}
|
|
2052
|
-
function gi(e, t) {
|
|
2053
|
-
let { scopeElement: n, referenceElement: r, floatingElement: i } = t, a = mi.get(n);
|
|
2054
|
-
a && a !== e && hi(a), hi(e), e.performedPointerEventsMutation = !0, e.pointerEventsScopeElement = n, e.pointerEventsReferenceElement = r, e.pointerEventsFloatingElement = i, mi.set(n, e), n.style.pointerEvents = "none", r.style.pointerEvents = "auto", i.style.pointerEvents = "auto";
|
|
2055
|
-
}
|
|
2056
|
-
function _i(e) {
|
|
2057
|
-
let t = e.context.dataRef.current, n = O(() => t.hoverInteractionState ?? pi.create()).current;
|
|
2058
|
-
return t.hoverInteractionState ||= n, j(t.hoverInteractionState.disposeEffect), t.hoverInteractionState;
|
|
2059
|
-
}
|
|
2060
|
-
function vi(e, t = {}) {
|
|
2061
|
-
let { enabled: n = !0, closeDelay: r = 0, nodeId: a } = t, o = e.useState("open"), s = e.useState("floatingElement"), c = e.useState("domReferenceElement"), { dataRef: l } = e.context, u = pr(), d = fr(), p = _i(e), m = P(), h = g(() => kt(l.current.openEvent?.type, p.interactedInside)), _ = g(() => At(l.current.openEvent?.type)), v = g(() => {
|
|
2062
|
-
hi(p);
|
|
2063
|
-
});
|
|
2064
|
-
i(() => {
|
|
2065
|
-
o || (p.pointerType = void 0, p.restTimeoutPending = !1, p.interactedInside = !1, v());
|
|
2066
|
-
}, [
|
|
2067
|
-
o,
|
|
2068
|
-
p,
|
|
2069
|
-
v
|
|
2070
|
-
]), B.useEffect(() => v, [v]), i(() => {
|
|
2071
|
-
if (n && o && p.handleCloseOptions?.blockPointerEvents && _() && f(c) && s) {
|
|
2072
|
-
let e = c, t = s, n = Y(s), r = u?.nodesRef.current.find((e) => e.id === d)?.context?.elements.floating;
|
|
2073
|
-
r && (r.style.pointerEvents = "");
|
|
2074
|
-
let i = p.pointerEventsScopeElement === t ? null : p.pointerEventsScopeElement, a = r === t ? null : r, o = p.handleCloseOptions?.getScope?.() ?? i ?? a ?? He(e, "[data-rootownerid]") ?? n.body;
|
|
2075
|
-
return gi(p, {
|
|
2076
|
-
scopeElement: o,
|
|
2077
|
-
referenceElement: e,
|
|
2078
|
-
floatingElement: t
|
|
2079
|
-
}), () => {
|
|
2080
|
-
v();
|
|
2081
|
-
};
|
|
2082
|
-
}
|
|
2083
|
-
}, [
|
|
2084
|
-
n,
|
|
2085
|
-
o,
|
|
2086
|
-
c,
|
|
2087
|
-
s,
|
|
2088
|
-
p,
|
|
2089
|
-
_,
|
|
2090
|
-
u,
|
|
2091
|
-
d,
|
|
2092
|
-
v
|
|
2093
|
-
]), B.useEffect(() => {
|
|
2094
|
-
if (!n) return;
|
|
2095
|
-
function t() {
|
|
2096
|
-
return !!(u && d && Yn(u.nodesRef.current, d).length > 0);
|
|
2097
|
-
}
|
|
2098
|
-
function i(t) {
|
|
2099
|
-
let n = Dt(r, "close", p.pointerType), i = () => {
|
|
2100
|
-
e.setOpen(!1, I(N, t)), u?.events.emit("floating.closed", t);
|
|
2101
|
-
};
|
|
2102
|
-
n ? p.openChangeTimeout.start(n, i) : (p.openChangeTimeout.clear(), i());
|
|
2103
|
-
}
|
|
2104
|
-
function o(e) {
|
|
2105
|
-
let t = Ue(e);
|
|
2106
|
-
St(t) ? p.interactedInside = He(t, "[aria-haspopup]") != null : p.interactedInside = !1;
|
|
2107
|
-
}
|
|
2108
|
-
function c() {
|
|
2109
|
-
p.openChangeTimeout.clear(), m.clear(), u?.events.off("floating.closed", y), v();
|
|
2110
|
-
}
|
|
2111
|
-
function g(n) {
|
|
2112
|
-
if (t() && u) {
|
|
2113
|
-
u.events.on("floating.closed", y);
|
|
2114
|
-
return;
|
|
2115
|
-
}
|
|
2116
|
-
if (vt(n.relatedTarget, e.context.triggerElements)) return;
|
|
2117
|
-
let r = l.current.floatingContext?.nodeId ?? a, o = n.relatedTarget;
|
|
2118
|
-
u && r && f(o) && Yn(u.nodesRef.current, r, !1).some((e) => K(e.context?.elements.floating, o)) || (p.handler ? p.handler(n) : (v(), _() && !h() && i(n)));
|
|
2119
|
-
}
|
|
2120
|
-
function y(n) {
|
|
2121
|
-
u && d && !t() && m.start(0, () => {
|
|
2122
|
-
u.events.off("floating.closed", y), e.setOpen(!1, I(N, n)), u.events.emit("floating.closed", n);
|
|
2123
|
-
});
|
|
2124
|
-
}
|
|
2125
|
-
let b = s;
|
|
2126
|
-
return Ft(b && q(b, "mouseenter", c), b && q(b, "mouseleave", g), b && q(b, "pointerdown", o, !0), () => {
|
|
2127
|
-
u?.events.off("floating.closed", y);
|
|
2128
|
-
});
|
|
2129
|
-
}, [
|
|
2130
|
-
n,
|
|
2131
|
-
s,
|
|
2132
|
-
e,
|
|
2133
|
-
l,
|
|
2134
|
-
r,
|
|
2135
|
-
a,
|
|
2136
|
-
_,
|
|
2137
|
-
h,
|
|
2138
|
-
v,
|
|
2139
|
-
p,
|
|
2140
|
-
u,
|
|
2141
|
-
d,
|
|
2142
|
-
m
|
|
2143
|
-
]);
|
|
2144
|
-
}
|
|
2145
|
-
var yi = { current: null };
|
|
2146
|
-
function bi(e, t = {}) {
|
|
2147
|
-
let { enabled: n = !0, delay: r = 0, handleClose: i = null, mouseOnly: a = !1, restMs: o = 0, move: s = !0, triggerElementRef: c = yi, externalTree: l, isActiveTrigger: u = !0, getHandleCloseContext: d, isClosing: p, shouldOpen: m, guardStaleOpen: h = !1 } = t, { dataRef: _, events: v } = e.context, y = pr(l), b = _i(e), x = B.useRef(!1), S = J(i), C = J(r), w = J(o), T = J(n), E = J(m), D = J(p), O = g(() => kt(_.current.openEvent?.type, b.interactedInside)), k = g(() => E.current?.() !== !1), A = g((t, n, r) => {
|
|
2148
|
-
let i = e.context.triggerElements;
|
|
2149
|
-
if (i.hasElement(n)) return !t || !K(t, n);
|
|
2150
|
-
if (!f(r)) return !1;
|
|
2151
|
-
let a = r;
|
|
2152
|
-
return i.hasMatchingElement((e) => K(e, a)) && (!t || !K(t, a));
|
|
2153
|
-
}), j = g(() => {
|
|
2154
|
-
b.handler &&= (Y(e.select("domReferenceElement")).removeEventListener("mousemove", b.handler), void 0);
|
|
2155
|
-
}), M = g(() => {
|
|
2156
|
-
hi(b);
|
|
2157
|
-
});
|
|
2158
|
-
return u && (b.handleCloseOptions = i?.__options), B.useEffect(() => j, [j]), B.useEffect(() => {
|
|
2159
|
-
if (!n) return;
|
|
2160
|
-
function e(e) {
|
|
2161
|
-
e.open ? x.current = !1 : (x.current = e.reason === N, j(), b.openChangeTimeout.clear(), b.restTimeout.clear(), b.blockMouseMove = !0, b.restTimeoutPending = !1);
|
|
2162
|
-
}
|
|
2163
|
-
return v.on("openchange", e), () => {
|
|
2164
|
-
v.off("openchange", e);
|
|
2165
|
-
};
|
|
2166
|
-
}, [
|
|
2167
|
-
n,
|
|
2168
|
-
v,
|
|
2169
|
-
b,
|
|
2170
|
-
j
|
|
2171
|
-
]), B.useEffect(() => {
|
|
2172
|
-
if (!n) return;
|
|
2173
|
-
function t(t, n = !0) {
|
|
2174
|
-
let r = Dt(C.current, "close", b.pointerType);
|
|
2175
|
-
r ? b.openChangeTimeout.start(r, () => {
|
|
2176
|
-
e.setOpen(!1, I(N, t)), y?.events.emit("floating.closed", t);
|
|
2177
|
-
}) : n && (b.openChangeTimeout.clear(), e.setOpen(!1, I(N, t)), y?.events.emit("floating.closed", t));
|
|
2178
|
-
}
|
|
2179
|
-
let r = c.current ?? (u ? e.select("domReferenceElement") : null);
|
|
2180
|
-
if (!f(r)) return;
|
|
2181
|
-
function i(t) {
|
|
2182
|
-
if (b.openChangeTimeout.clear(), b.blockMouseMove = !1, a && !ze(b.pointerType)) return;
|
|
2183
|
-
let n = Ot(w.current), r = Dt(C.current, "open", b.pointerType), i = Ue(t), o = t.currentTarget ?? null, s = e.select("domReferenceElement"), c = o;
|
|
2184
|
-
if (f(i) && !e.context.triggerElements.hasElement(i)) {
|
|
2185
|
-
for (let t of e.context.triggerElements.elements()) if (K(t, i)) {
|
|
2186
|
-
c = t;
|
|
2187
|
-
break;
|
|
2188
|
-
}
|
|
2189
|
-
}
|
|
2190
|
-
f(o) && f(s) && !e.context.triggerElements.hasElement(o) && K(o, s) && (c = s);
|
|
2191
|
-
let l = c != null && A(s, c, i), u = e.select("open"), d = D.current?.() ?? e.select("transitionStatus") === "ending", p = !u && d && x.current, m = !l && f(c) && f(s) && K(s, c) && p, h = n > 0 && !r, g = l && (u || p) || m, _ = !u || l;
|
|
2192
|
-
g ? k() && e.setOpen(!0, I(N, t, c)) : h || (r ? b.openChangeTimeout.start(r, () => {
|
|
2193
|
-
_ && k() && e.setOpen(!0, I(N, t, c));
|
|
2194
|
-
}) : _ && k() && e.setOpen(!0, I(N, t, c)));
|
|
2195
|
-
}
|
|
2196
|
-
function o(n) {
|
|
2197
|
-
if (O()) {
|
|
2198
|
-
M();
|
|
2199
|
-
return;
|
|
2200
|
-
}
|
|
2201
|
-
j();
|
|
2202
|
-
let r = Y(e.select("domReferenceElement"));
|
|
2203
|
-
b.restTimeout.clear(), b.restTimeoutPending = !1;
|
|
2204
|
-
let i = _.current.floatingContext ?? d?.();
|
|
2205
|
-
if (!vt(n.relatedTarget, e.context.triggerElements)) {
|
|
2206
|
-
if (S.current && i) {
|
|
2207
|
-
e.select("open") || b.openChangeTimeout.clear();
|
|
2208
|
-
let a = c.current;
|
|
2209
|
-
b.handler = S.current({
|
|
2210
|
-
...i,
|
|
2211
|
-
tree: y,
|
|
2212
|
-
x: n.clientX,
|
|
2213
|
-
y: n.clientY,
|
|
2214
|
-
onClose() {
|
|
2215
|
-
M(), j(), T.current && !O() && a === e.select("domReferenceElement") && t(n, !0);
|
|
2216
|
-
}
|
|
2217
|
-
}), r.addEventListener("mousemove", b.handler), b.handler(n);
|
|
2218
|
-
} else (b.pointerType !== "touch" || !K(e.select("floatingElement"), n.relatedTarget)) && t(n);
|
|
2219
|
-
}
|
|
2220
|
-
}
|
|
2221
|
-
function l(e) {
|
|
2222
|
-
K(r, e.relatedTarget) || (b.openChangeTimeout.clear(), b.restTimeout.clear(), b.restTimeoutPending = !1);
|
|
2223
|
-
}
|
|
2224
|
-
let p = h ? q(r, "mouseout", l) : void 0;
|
|
2225
|
-
return s ? Ft(q(r, "mousemove", i, { once: !0 }), q(r, "mouseenter", i), q(r, "mouseleave", o), p) : Ft(q(r, "mouseenter", i), q(r, "mouseleave", o), p);
|
|
2226
|
-
}, [
|
|
2227
|
-
j,
|
|
2228
|
-
M,
|
|
2229
|
-
_,
|
|
2230
|
-
C,
|
|
2231
|
-
e,
|
|
2232
|
-
n,
|
|
2233
|
-
S,
|
|
2234
|
-
b,
|
|
2235
|
-
u,
|
|
2236
|
-
A,
|
|
2237
|
-
O,
|
|
2238
|
-
a,
|
|
2239
|
-
s,
|
|
2240
|
-
w,
|
|
2241
|
-
c,
|
|
2242
|
-
y,
|
|
2243
|
-
T,
|
|
2244
|
-
d,
|
|
2245
|
-
D,
|
|
2246
|
-
k,
|
|
2247
|
-
h
|
|
2248
|
-
]), B.useMemo(() => {
|
|
2249
|
-
if (!n) return;
|
|
2250
|
-
function t(e) {
|
|
2251
|
-
b.pointerType = e.pointerType;
|
|
2252
|
-
}
|
|
2253
|
-
return {
|
|
2254
|
-
onPointerDown: t,
|
|
2255
|
-
onPointerEnter: t,
|
|
2256
|
-
onMouseMove(t) {
|
|
2257
|
-
let { nativeEvent: n } = t, r = t.currentTarget, i = e.select("domReferenceElement"), o = e.select("open"), s = A(i, r, t.target);
|
|
2258
|
-
if (a && !ze(b.pointerType)) return;
|
|
2259
|
-
if (o && s && b.handleCloseOptions?.blockPointerEvents) {
|
|
2260
|
-
let t = e.select("floatingElement");
|
|
2261
|
-
if (t) {
|
|
2262
|
-
let e = b.handleCloseOptions?.getScope?.() ?? r.ownerDocument.body;
|
|
2263
|
-
gi(b, {
|
|
2264
|
-
scopeElement: e,
|
|
2265
|
-
referenceElement: r,
|
|
2266
|
-
floatingElement: t
|
|
2267
|
-
});
|
|
2268
|
-
}
|
|
2269
|
-
}
|
|
2270
|
-
let c = Ot(w.current);
|
|
2271
|
-
if (o && !s || c === 0 || !s && b.restTimeoutPending && t.movementX ** 2 + t.movementY ** 2 < 2) return;
|
|
2272
|
-
b.restTimeout.clear();
|
|
2273
|
-
function l() {
|
|
2274
|
-
if (b.restTimeoutPending = !1, O()) return;
|
|
2275
|
-
let t = e.select("open");
|
|
2276
|
-
!b.blockMouseMove && (!t || s) && k() && e.setOpen(!0, I(N, n, r));
|
|
2277
|
-
}
|
|
2278
|
-
b.pointerType === "touch" ? de.flushSync(() => {
|
|
2279
|
-
l();
|
|
2280
|
-
}) : s && o ? l() : (b.restTimeoutPending = !0, b.restTimeout.start(c, l));
|
|
2281
|
-
}
|
|
2282
|
-
};
|
|
2283
|
-
}, [
|
|
2284
|
-
n,
|
|
2285
|
-
b,
|
|
2286
|
-
O,
|
|
2287
|
-
A,
|
|
2288
|
-
a,
|
|
2289
|
-
e,
|
|
2290
|
-
w,
|
|
2291
|
-
k
|
|
2292
|
-
]);
|
|
2293
|
-
}
|
|
2294
|
-
var xi = .1, Si = xi * xi, $ = .5;
|
|
2295
|
-
function Ci(e, t, n, r, i, a) {
|
|
2296
|
-
return r >= t != a >= t && e <= (i - n) * (t - r) / (a - r) + n;
|
|
2297
|
-
}
|
|
2298
|
-
function wi(e, t, n, r, i, a, o, s, c, l) {
|
|
2299
|
-
let u = !1;
|
|
2300
|
-
return Ci(e, t, n, r, i, a) && (u = !u), Ci(e, t, i, a, o, s) && (u = !u), Ci(e, t, o, s, c, l) && (u = !u), Ci(e, t, c, l, n, r) && (u = !u), u;
|
|
2301
|
-
}
|
|
2302
|
-
function Ti(e, t, n) {
|
|
2303
|
-
return e >= n.x && e <= n.x + n.width && t >= n.y && t <= n.y + n.height;
|
|
2304
|
-
}
|
|
2305
|
-
function Ei(e, t, n, r, i, a) {
|
|
2306
|
-
return e >= Math.min(n, i) && e <= Math.max(n, i) && t >= Math.min(r, a) && t <= Math.max(r, a);
|
|
2307
|
-
}
|
|
2308
|
-
function Di(e = {}) {
|
|
2309
|
-
let { blockPointerEvents: t = !1 } = e, n = new M(), r = ({ x: e, y: t, placement: r, elements: i, onClose: a, nodeId: o, tree: s }) => {
|
|
2310
|
-
let c = r?.split("-")[0], l = !1, u = null, d = null, p = typeof performance < "u" ? performance.now() : 0;
|
|
2311
|
-
function m(e, t) {
|
|
2312
|
-
let n = performance.now(), r = n - p;
|
|
2313
|
-
if (u === null || d === null || r === 0) return u = e, d = t, p = n, !1;
|
|
2314
|
-
let i = e - u, a = t - d, o = i * i + a * a, s = r * r * Si;
|
|
2315
|
-
return u = e, d = t, p = n, o < s;
|
|
2316
|
-
}
|
|
2317
|
-
function h() {
|
|
2318
|
-
n.clear(), a();
|
|
2319
|
-
}
|
|
2320
|
-
return function(r) {
|
|
2321
|
-
n.clear();
|
|
2322
|
-
let a = i.domReference, u = i.floating;
|
|
2323
|
-
if (!a || !u || c == null || e == null || t == null) return;
|
|
2324
|
-
let { clientX: d, clientY: p } = r, g = Ue(r), _ = r.type === "mouseleave", v = K(u, g), y = K(a, g);
|
|
2325
|
-
if (v && (l = !0, !_)) return;
|
|
2326
|
-
if (y && (l = !1, !_)) {
|
|
2327
|
-
l = !0;
|
|
2328
|
-
return;
|
|
2329
|
-
}
|
|
2330
|
-
if (_ && f(r.relatedTarget) && K(u, r.relatedTarget)) return;
|
|
2331
|
-
function b() {
|
|
2332
|
-
return !!(s && Yn(s.nodesRef.current, o).length > 0);
|
|
2333
|
-
}
|
|
2334
|
-
function x() {
|
|
2335
|
-
b() || h();
|
|
2336
|
-
}
|
|
2337
|
-
if (b()) return;
|
|
2338
|
-
let S = a.getBoundingClientRect(), C = u.getBoundingClientRect(), w = e > C.right - C.width / 2, T = t > C.bottom - C.height / 2, E = C.width > S.width, D = C.height > S.height, O = (E ? S : C).left, k = (E ? S : C).right, A = (D ? S : C).top, j = (D ? S : C).bottom;
|
|
2339
|
-
if (c === "top" && t >= S.bottom - 1 || c === "bottom" && t <= S.top + 1 || c === "left" && e >= S.right - 1 || c === "right" && e <= S.left + 1) {
|
|
2340
|
-
x();
|
|
2341
|
-
return;
|
|
2342
|
-
}
|
|
2343
|
-
let M = !1;
|
|
2344
|
-
switch (c) {
|
|
2345
|
-
case "top":
|
|
2346
|
-
M = Ei(d, p, O, S.top + 1, k, C.bottom - 1);
|
|
2347
|
-
break;
|
|
2348
|
-
case "bottom":
|
|
2349
|
-
M = Ei(d, p, O, C.top + 1, k, S.bottom - 1);
|
|
2350
|
-
break;
|
|
2351
|
-
case "left":
|
|
2352
|
-
M = Ei(d, p, C.right - 1, j, S.left + 1, A);
|
|
2353
|
-
break;
|
|
2354
|
-
case "right": M = Ei(d, p, S.right - 1, j, C.left + 1, A);
|
|
2355
|
-
}
|
|
2356
|
-
if (M) return;
|
|
2357
|
-
if (l && !Ti(d, p, S) || !_ && m(d, p)) {
|
|
2358
|
-
x();
|
|
2359
|
-
return;
|
|
2360
|
-
}
|
|
2361
|
-
let N = !1;
|
|
2362
|
-
switch (c) {
|
|
2363
|
-
case "top": {
|
|
2364
|
-
let n = E ? $ / 2 : $ * 4, r = E || w ? e + n : e - n, i = E ? e - n : w ? e + n : e - n, a = t + $ + 1, o = w || E ? C.bottom - $ : C.top, s = w ? E ? C.bottom - $ : C.top : C.bottom - $;
|
|
2365
|
-
N = wi(d, p, r, a, i, a, C.left, o, C.right, s);
|
|
2366
|
-
break;
|
|
2367
|
-
}
|
|
2368
|
-
case "bottom": {
|
|
2369
|
-
let n = E ? $ / 2 : $ * 4, r = E || w ? e + n : e - n, i = E ? e - n : w ? e + n : e - n, a = t - $, o = w || E ? C.top + $ : C.bottom, s = w ? E ? C.top + $ : C.bottom : C.top + $;
|
|
2370
|
-
N = wi(d, p, r, a, i, a, C.left, o, C.right, s);
|
|
2371
|
-
break;
|
|
2372
|
-
}
|
|
2373
|
-
case "left": {
|
|
2374
|
-
let n = D ? $ / 2 : $ * 4, r = D || T ? t + n : t - n, i = D ? t - n : T ? t + n : t - n, a = e + $ + 1, o = T || D ? C.right - $ : C.left, s = T ? D ? C.right - $ : C.left : C.right - $;
|
|
2375
|
-
N = wi(d, p, o, C.top, s, C.bottom, a, r, a, i);
|
|
2376
|
-
break;
|
|
2377
|
-
}
|
|
2378
|
-
case "right": {
|
|
2379
|
-
let n = D ? $ / 2 : $ * 4, r = D || T ? t + n : t - n, i = D ? t - n : T ? t + n : t - n, a = e - $, o = T || D ? C.left + $ : C.right, s = T ? D ? C.left + $ : C.right : C.left + $;
|
|
2380
|
-
N = wi(d, p, a, r, a, i, o, C.top, s, C.bottom);
|
|
2381
|
-
break;
|
|
2382
|
-
}
|
|
2383
|
-
}
|
|
2384
|
-
N ? l || n.start(40, x) : x();
|
|
2385
|
-
};
|
|
2386
|
-
};
|
|
2387
|
-
return r.__options = {
|
|
2388
|
-
...e,
|
|
2389
|
-
blockPointerEvents: t
|
|
2390
|
-
}, r;
|
|
2391
|
-
}
|
|
2392
|
-
function Oi(e, t, n) {
|
|
2393
|
-
let { reference: r, floating: i } = e, a = Z(t), o = nn(t), s = tn(o), c = X(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
|
|
2394
|
-
switch (c) {
|
|
2395
|
-
case "top":
|
|
2396
|
-
p = {
|
|
2397
|
-
x: u,
|
|
2398
|
-
y: r.y - i.height
|
|
2399
|
-
};
|
|
2400
|
-
break;
|
|
2401
|
-
case "bottom":
|
|
2402
|
-
p = {
|
|
2403
|
-
x: u,
|
|
2404
|
-
y: r.y + r.height
|
|
2405
|
-
};
|
|
2406
|
-
break;
|
|
2407
|
-
case "right":
|
|
2408
|
-
p = {
|
|
2409
|
-
x: r.x + r.width,
|
|
2410
|
-
y: d
|
|
2411
|
-
};
|
|
2412
|
-
break;
|
|
2413
|
-
case "left":
|
|
2414
|
-
p = {
|
|
2415
|
-
x: r.x - i.width,
|
|
2416
|
-
y: d
|
|
2417
|
-
};
|
|
2418
|
-
break;
|
|
2419
|
-
default: p = {
|
|
2420
|
-
x: r.x,
|
|
2421
|
-
y: r.y
|
|
2422
|
-
};
|
|
2423
|
-
}
|
|
2424
|
-
let m = $t(t);
|
|
2425
|
-
return m && (p[o] += f * (m === "end" ? 1 : -1) * (n && l ? -1 : 1)), p;
|
|
2426
|
-
}
|
|
2427
|
-
async function ki(e, t) {
|
|
2428
|
-
t === void 0 && (t = {});
|
|
2429
|
-
let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = Qt(t, e), p = hn(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = gn(await i.getClippingRect({
|
|
2430
|
-
element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
|
|
2431
|
-
boundary: c,
|
|
2432
|
-
rootBoundary: l,
|
|
2433
|
-
strategy: s
|
|
2434
|
-
})), g = u === "floating" ? {
|
|
2435
|
-
x: n,
|
|
2436
|
-
y: r,
|
|
2437
|
-
width: a.floating.width,
|
|
2438
|
-
height: a.floating.height
|
|
2439
|
-
} : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
|
|
2440
|
-
x: 1,
|
|
2441
|
-
y: 1
|
|
2442
|
-
}, y = gn(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2443
|
-
elements: o,
|
|
2444
|
-
rect: g,
|
|
2445
|
-
offsetParent: _,
|
|
2446
|
-
strategy: s
|
|
2447
|
-
}) : g);
|
|
2448
|
-
return {
|
|
2449
|
-
top: (h.top - y.top + p.top) / v.y,
|
|
2450
|
-
bottom: (y.bottom - h.bottom + p.bottom) / v.y,
|
|
2451
|
-
left: (h.left - y.left + p.left) / v.x,
|
|
2452
|
-
right: (y.right - h.right + p.right) / v.x
|
|
2453
|
-
};
|
|
2454
|
-
}
|
|
2455
|
-
var Ai = 50, ji = async (e, t, n) => {
|
|
2456
|
-
let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
|
|
2457
|
-
...o,
|
|
2458
|
-
detectOverflow: ki
|
|
2459
|
-
}, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
|
|
2460
|
-
reference: e,
|
|
2461
|
-
floating: t,
|
|
2462
|
-
strategy: i
|
|
2463
|
-
}), { x: u, y: d } = Oi(l, r, c), f = r, p = 0, m = {};
|
|
2464
|
-
for (let n = 0; n < a.length; n++) {
|
|
2465
|
-
let h = a[n];
|
|
2466
|
-
if (!h) continue;
|
|
2467
|
-
let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({
|
|
2468
|
-
x: u,
|
|
2469
|
-
y: d,
|
|
2470
|
-
initialPlacement: r,
|
|
2471
|
-
placement: f,
|
|
2472
|
-
strategy: i,
|
|
2473
|
-
middlewareData: m,
|
|
2474
|
-
rects: l,
|
|
2475
|
-
platform: s,
|
|
2476
|
-
elements: {
|
|
2477
|
-
reference: e,
|
|
2478
|
-
floating: t
|
|
2479
|
-
}
|
|
2480
|
-
});
|
|
2481
|
-
u = v ?? u, d = y ?? d, m[g] = {
|
|
2482
|
-
...m[g],
|
|
2483
|
-
...b
|
|
2484
|
-
}, x && p < Ai && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
|
|
2485
|
-
reference: e,
|
|
2486
|
-
floating: t,
|
|
2487
|
-
strategy: i
|
|
2488
|
-
}) : x.rects), {x: u, y: d} = Oi(l, f, c)), n = -1);
|
|
2489
|
-
}
|
|
2490
|
-
return {
|
|
2491
|
-
x: u,
|
|
2492
|
-
y: d,
|
|
2493
|
-
placement: f,
|
|
2494
|
-
strategy: i,
|
|
2495
|
-
middlewareData: m
|
|
2496
|
-
};
|
|
2497
|
-
}, Mi = function(e) {
|
|
2498
|
-
return e === void 0 && (e = {}), {
|
|
2499
|
-
name: "flip",
|
|
2500
|
-
options: e,
|
|
2501
|
-
async fn(t) {
|
|
2502
|
-
var n;
|
|
2503
|
-
let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = Qt(e, t);
|
|
2504
|
-
if ((n = i.arrow) != null && n.alignmentOffset) return {};
|
|
2505
|
-
let g = X(r), _ = Z(o), v = X(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [pn(o)] : an(o)), x = p !== "none";
|
|
2506
|
-
!d && x && b.push(...fn(o, m, p, y));
|
|
2507
|
-
let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
|
|
2508
|
-
if (l && w.push(C[g]), u) {
|
|
2509
|
-
let e = rn(r, a, y);
|
|
2510
|
-
w.push(C[e[0]], C[e[1]]);
|
|
2511
|
-
}
|
|
2512
|
-
if (T = [...T, {
|
|
2513
|
-
placement: r,
|
|
2514
|
-
overflows: w
|
|
2515
|
-
}], !w.every((e) => e <= 0)) {
|
|
2516
|
-
let e = (i.flip?.index || 0) + 1, t = S[e];
|
|
2517
|
-
if (t && (u !== "alignment" || _ === Z(t) || T.every((e) => Z(e.placement) !== _ || e.overflows[0] > 0))) return {
|
|
2518
|
-
data: {
|
|
2519
|
-
index: e,
|
|
2520
|
-
overflows: T
|
|
2521
|
-
},
|
|
2522
|
-
reset: { placement: t }
|
|
2523
|
-
};
|
|
2524
|
-
let n = T.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement;
|
|
2525
|
-
if (!n) switch (f) {
|
|
2526
|
-
case "bestFit": {
|
|
2527
|
-
let e = T.filter((e) => {
|
|
2528
|
-
if (x) {
|
|
2529
|
-
let t = Z(e.placement);
|
|
2530
|
-
return t === _ || t === "y";
|
|
2531
|
-
}
|
|
2532
|
-
return !0;
|
|
2533
|
-
}).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0];
|
|
2534
|
-
e && (n = e);
|
|
2535
|
-
break;
|
|
2536
|
-
}
|
|
2537
|
-
case "initialPlacement": n = o;
|
|
2538
|
-
}
|
|
2539
|
-
if (r !== n) return { reset: { placement: n } };
|
|
2540
|
-
}
|
|
2541
|
-
return {};
|
|
2542
|
-
}
|
|
2543
|
-
};
|
|
2544
|
-
}, Ni = /*#__PURE__*/ new Set(["left", "top"]);
|
|
2545
|
-
async function Pi(e, t) {
|
|
2546
|
-
let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = X(n), s = $t(n), c = Z(n) === "y", l = Ni.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = Qt(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
|
|
2547
|
-
mainAxis: d,
|
|
2548
|
-
crossAxis: 0,
|
|
2549
|
-
alignmentAxis: null
|
|
2550
|
-
} : {
|
|
2551
|
-
mainAxis: d.mainAxis || 0,
|
|
2552
|
-
crossAxis: d.crossAxis || 0,
|
|
2553
|
-
alignmentAxis: d.alignmentAxis
|
|
2554
|
-
};
|
|
2555
|
-
return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
|
|
2556
|
-
x: p * u,
|
|
2557
|
-
y: f * l
|
|
2558
|
-
} : {
|
|
2559
|
-
x: f * l,
|
|
2560
|
-
y: p * u
|
|
2561
|
-
};
|
|
2562
|
-
}
|
|
2563
|
-
var Fi = function(e) {
|
|
2564
|
-
return e === void 0 && (e = 0), {
|
|
2565
|
-
name: "offset",
|
|
2566
|
-
options: e,
|
|
2567
|
-
async fn(t) {
|
|
2568
|
-
var n;
|
|
2569
|
-
let { x: r, y: i, placement: a, middlewareData: o } = t, s = await Pi(t, e);
|
|
2570
|
-
return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
|
|
2571
|
-
x: r + s.x,
|
|
2572
|
-
y: i + s.y,
|
|
2573
|
-
data: {
|
|
2574
|
-
...s,
|
|
2575
|
-
placement: a
|
|
2576
|
-
}
|
|
2577
|
-
};
|
|
2578
|
-
}
|
|
2579
|
-
};
|
|
2580
|
-
}, Ii = function(e) {
|
|
2581
|
-
return e === void 0 && (e = {}), {
|
|
2582
|
-
name: "shift",
|
|
2583
|
-
options: e,
|
|
2584
|
-
async fn(t) {
|
|
2585
|
-
let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => {
|
|
2586
|
-
let { x: t, y: n } = e;
|
|
2587
|
-
return {
|
|
2588
|
-
x: t,
|
|
2589
|
-
y: n
|
|
2590
|
-
};
|
|
2591
|
-
} }, ...l } = Qt(e, t), u = {
|
|
2592
|
-
x: n,
|
|
2593
|
-
y: r
|
|
2594
|
-
}, d = await a.detectOverflow(t, l), f = Z(i), p = en(f), m = u[p], h = u[f], g = (e, t) => Zt(t + d[e === "y" ? "top" : "left"], t, t - d[e === "y" ? "bottom" : "right"]);
|
|
2595
|
-
o && (m = g(p, m)), s && (h = g(f, h));
|
|
2596
|
-
let _ = c.fn({
|
|
2597
|
-
...t,
|
|
2598
|
-
[p]: m,
|
|
2599
|
-
[f]: h
|
|
2600
|
-
});
|
|
2601
|
-
return {
|
|
2602
|
-
..._,
|
|
2603
|
-
data: {
|
|
2604
|
-
x: _.x - n,
|
|
2605
|
-
y: _.y - r,
|
|
2606
|
-
enabled: {
|
|
2607
|
-
[p]: o,
|
|
2608
|
-
[f]: s
|
|
2609
|
-
}
|
|
2610
|
-
}
|
|
2611
|
-
};
|
|
2612
|
-
}
|
|
2613
|
-
};
|
|
2614
|
-
}, Li = function(e) {
|
|
2615
|
-
return e === void 0 && (e = {}), {
|
|
2616
|
-
options: e,
|
|
2617
|
-
fn(t) {
|
|
2618
|
-
let { x: n, y: r, placement: i, rects: a, middlewareData: o } = t, { offset: s = 0, mainAxis: c = !0, crossAxis: l = !0 } = Qt(e, t), u = {
|
|
2619
|
-
x: n,
|
|
2620
|
-
y: r
|
|
2621
|
-
}, d = Z(i), f = en(d), p = u[f], m = u[d], h = Qt(s, t), g = typeof h == "number" ? {
|
|
2622
|
-
mainAxis: h,
|
|
2623
|
-
crossAxis: 0
|
|
2624
|
-
} : {
|
|
2625
|
-
mainAxis: h.mainAxis ?? 0,
|
|
2626
|
-
crossAxis: h.crossAxis ?? 0
|
|
2627
|
-
};
|
|
2628
|
-
if (c) {
|
|
2629
|
-
let e = f === "y" ? "height" : "width", t = a.reference[f] - a.floating[e] + g.mainAxis, n = a.reference[f] + a.reference[e] - g.mainAxis;
|
|
2630
|
-
p < t ? p = t : p > n && (p = n);
|
|
2631
|
-
}
|
|
2632
|
-
if (l) {
|
|
2633
|
-
let e = f === "y" ? "width" : "height", t = Ni.has(X(i)), n = a.reference[d] - a.floating[e] + (t && o.offset?.[d] || 0) + (t ? 0 : g.crossAxis), r = a.reference[d] + a.reference[e] + (t ? 0 : o.offset?.[d] || 0) - (t ? g.crossAxis : 0);
|
|
2634
|
-
m < n ? m = n : m > r && (m = r);
|
|
2635
|
-
}
|
|
2636
|
-
return {
|
|
2637
|
-
[f]: p,
|
|
2638
|
-
[d]: m
|
|
2639
|
-
};
|
|
2640
|
-
}
|
|
2641
|
-
};
|
|
2642
|
-
}, Ri = function(e) {
|
|
2643
|
-
return e === void 0 && (e = {}), {
|
|
2644
|
-
name: "size",
|
|
2645
|
-
options: e,
|
|
2646
|
-
async fn(t) {
|
|
2647
|
-
let { placement: n, rects: r, platform: i, elements: a } = t, { apply: o = () => {}, ...s } = Qt(e, t), c = await i.detectOverflow(t, s), l = X(n), u = $t(n), d = Z(n) === "y", { width: f, height: p } = r.floating, m, h;
|
|
2648
|
-
l === "top" || l === "bottom" ? (m = l, h = u === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (h = l, m = u === "end" ? "top" : "bottom");
|
|
2649
|
-
let g = p - c.top - c.bottom, _ = f - c.left - c.right, v = Gt(p - c[m], g), y = Gt(f - c[h], _), b = t.middlewareData.shift, x = !b, S = v, C = y;
|
|
2650
|
-
b != null && b.enabled.x && (C = _), b != null && b.enabled.y && (S = g), x && !u && (d ? C = f - 2 * Kt(c.left, c.right) : S = p - 2 * Kt(c.top, c.bottom)), await o({
|
|
2651
|
-
...t,
|
|
2652
|
-
availableWidth: C,
|
|
2653
|
-
availableHeight: S
|
|
2654
|
-
});
|
|
2655
|
-
let w = await i.getDimensions(a.floating);
|
|
2656
|
-
return f !== w.width || p !== w.height ? { reset: { rects: !0 } } : {};
|
|
2657
|
-
}
|
|
2658
|
-
};
|
|
2659
|
-
};
|
|
2660
|
-
function zi(e) {
|
|
2661
|
-
let t = v(e), n = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0, a = r(e), o = a ? e.offsetWidth : n, s = a ? e.offsetHeight : i, c = qt(n) !== o || qt(i) !== s;
|
|
2662
|
-
return c && (n = o, i = s), {
|
|
2663
|
-
width: n,
|
|
2664
|
-
height: i,
|
|
2665
|
-
$: c
|
|
2666
|
-
};
|
|
2667
|
-
}
|
|
2668
|
-
function Bi(e) {
|
|
2669
|
-
return f(e) ? e : e.contextElement;
|
|
2670
|
-
}
|
|
2671
|
-
function Vi(e) {
|
|
2672
|
-
let t = Bi(e);
|
|
2673
|
-
if (!r(t)) return Yt(1);
|
|
2674
|
-
let n = t.getBoundingClientRect(), { width: i, height: a, $: o } = zi(t), s = (o ? qt(n.width) : n.width) / i, c = (o ? qt(n.height) : n.height) / a;
|
|
2675
|
-
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
2676
|
-
x: s,
|
|
2677
|
-
y: c
|
|
2678
|
-
};
|
|
2679
|
-
}
|
|
2680
|
-
var Hi = /*#__PURE__*/ Yt(0);
|
|
2681
|
-
function Ui(e) {
|
|
2682
|
-
let n = t(e);
|
|
2683
|
-
return !s() || !n.visualViewport ? Hi : {
|
|
2684
|
-
x: n.visualViewport.offsetLeft,
|
|
2685
|
-
y: n.visualViewport.offsetTop
|
|
2686
|
-
};
|
|
2687
|
-
}
|
|
2688
|
-
function Wi(e, n, r) {
|
|
2689
|
-
return n === void 0 && (n = !1), !!r && n && r === t(e);
|
|
2690
|
-
}
|
|
2691
|
-
function Gi(e, n, r, i) {
|
|
2692
|
-
n === void 0 && (n = !1), r === void 0 && (r = !1);
|
|
2693
|
-
let a = e.getBoundingClientRect(), o = Bi(e), s = Yt(1);
|
|
2694
|
-
n && (i ? f(i) && (s = Vi(i)) : s = Vi(e));
|
|
2695
|
-
let c = Wi(o, r, i) ? Ui(o) : Yt(0), l = (a.left + c.x) / s.x, u = (a.top + c.y) / s.y, d = a.width / s.x, p = a.height / s.y;
|
|
2696
|
-
if (o && i) {
|
|
2697
|
-
let e = t(o), n = f(i) ? t(i) : i, r = e, a = w(r);
|
|
2698
|
-
for (; a && n !== r;) {
|
|
2699
|
-
let e = Vi(a), n = a.getBoundingClientRect(), i = v(a), o = n.left + (a.clientLeft + parseFloat(i.paddingLeft)) * e.x, s = n.top + (a.clientTop + parseFloat(i.paddingTop)) * e.y;
|
|
2700
|
-
l *= e.x, u *= e.y, d *= e.x, p *= e.y, l += o, u += s, r = t(a), a = w(r);
|
|
2701
|
-
}
|
|
2702
|
-
}
|
|
2703
|
-
return gn({
|
|
2704
|
-
width: d,
|
|
2705
|
-
height: p,
|
|
2706
|
-
x: l,
|
|
2707
|
-
y: u
|
|
2708
|
-
});
|
|
2709
|
-
}
|
|
2710
|
-
function Ki(e, t) {
|
|
2711
|
-
let n = m(e).scrollLeft;
|
|
2712
|
-
return t ? t.left + n : Gi(p(e)).left + n;
|
|
2713
|
-
}
|
|
2714
|
-
function qi(e, t) {
|
|
2715
|
-
let n = e.getBoundingClientRect();
|
|
2716
|
-
return {
|
|
2717
|
-
x: n.left + t.scrollLeft - Ki(e, n),
|
|
2718
|
-
y: n.top + t.scrollTop
|
|
2719
|
-
};
|
|
2720
|
-
}
|
|
2721
|
-
function Ji(e) {
|
|
2722
|
-
let { elements: t, rect: n, offsetParent: i, strategy: a } = e, s = a === "fixed", c = p(i), l = t ? o(t.floating) : !1;
|
|
2723
|
-
if (i === c || l && s) return n;
|
|
2724
|
-
let u = {
|
|
2725
|
-
scrollLeft: 0,
|
|
2726
|
-
scrollTop: 0
|
|
2727
|
-
}, d = Yt(1), f = Yt(0), h = r(i);
|
|
2728
|
-
if ((h || !s) && ((D(i) !== "body" || b(c)) && (u = m(i)), h)) {
|
|
2729
|
-
let e = Gi(i);
|
|
2730
|
-
d = Vi(i), f.x = e.x + i.clientLeft, f.y = e.y + i.clientTop;
|
|
2731
|
-
}
|
|
2732
|
-
let g = c && !h && !s ? qi(c, u) : Yt(0);
|
|
2733
|
-
return {
|
|
2734
|
-
width: n.width * d.x,
|
|
2735
|
-
height: n.height * d.y,
|
|
2736
|
-
x: n.x * d.x - u.scrollLeft * d.x + f.x + g.x,
|
|
2737
|
-
y: n.y * d.y - u.scrollTop * d.y + f.y + g.y
|
|
2738
|
-
};
|
|
2739
|
-
}
|
|
2740
|
-
function Yi(e) {
|
|
2741
|
-
return e.getClientRects ? Array.from(e.getClientRects()) : [];
|
|
2742
|
-
}
|
|
2743
|
-
function Xi(e) {
|
|
2744
|
-
let t = m(e), n = e.ownerDocument.body, r = Kt(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), i = Kt(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight), a = -t.scrollLeft + Ki(e), o = -t.scrollTop;
|
|
2745
|
-
return v(n).direction === "rtl" && (a += Kt(e.clientWidth, n.clientWidth) - r), {
|
|
2746
|
-
width: r,
|
|
2747
|
-
height: i,
|
|
2748
|
-
x: a,
|
|
2749
|
-
y: o
|
|
2750
|
-
};
|
|
2751
|
-
}
|
|
2752
|
-
var Zi = 25;
|
|
2753
|
-
function Qi(e, n, r) {
|
|
2754
|
-
r === void 0 && (r = "viewport");
|
|
2755
|
-
let i = r === "layoutViewport", a = t(e), o = p(e), c = a.visualViewport, l = o.clientWidth, u = o.clientHeight, d = 0, f = 0;
|
|
2756
|
-
if (c) {
|
|
2757
|
-
let e = !s() || n === "fixed";
|
|
2758
|
-
i ? e || (d = -c.offsetLeft, f = -c.offsetTop) : (l = c.width, u = c.height, e && (d = c.offsetLeft, f = c.offsetTop));
|
|
2759
|
-
}
|
|
2760
|
-
if (Ki(o) <= 0) {
|
|
2761
|
-
let e = o.ownerDocument, t = e.body, n = getComputedStyle(t), r = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, i = Math.abs(o.clientWidth - t.clientWidth - r), a = getComputedStyle(o).scrollbarGutter === "stable both-edges" ? i / 2 : i;
|
|
2762
|
-
a <= Zi && (l -= a);
|
|
2763
|
-
}
|
|
2764
|
-
return {
|
|
2765
|
-
width: l,
|
|
2766
|
-
height: u,
|
|
2767
|
-
x: d,
|
|
2768
|
-
y: f
|
|
2769
|
-
};
|
|
2770
|
-
}
|
|
2771
|
-
function $i(e, t) {
|
|
2772
|
-
let n = Gi(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = Vi(e);
|
|
2773
|
-
return {
|
|
2774
|
-
width: e.clientWidth * a.x,
|
|
2775
|
-
height: e.clientHeight * a.y,
|
|
2776
|
-
x: i * a.x,
|
|
2777
|
-
y: r * a.y
|
|
2778
|
-
};
|
|
2779
|
-
}
|
|
2780
|
-
function ea(e, t, n) {
|
|
2781
|
-
let r;
|
|
2782
|
-
if (t === "viewport" || t === "layoutViewport") r = Qi(e, n, t);
|
|
2783
|
-
else if (t === "document") r = Xi(p(e));
|
|
2784
|
-
else if (f(t)) r = $i(t, n);
|
|
2785
|
-
else {
|
|
2786
|
-
let n = Ui(e);
|
|
2787
|
-
r = {
|
|
2788
|
-
x: t.x - n.x,
|
|
2789
|
-
y: t.y - n.y,
|
|
2790
|
-
width: t.width,
|
|
2791
|
-
height: t.height
|
|
2792
|
-
};
|
|
2793
|
-
}
|
|
2794
|
-
return gn(r);
|
|
2795
|
-
}
|
|
2796
|
-
function ta(e, t) {
|
|
2797
|
-
let r = t.get(e);
|
|
2798
|
-
if (r) return r;
|
|
2799
|
-
let i = E(e, [], !1).filter((e) => f(e) && D(e) !== "body"), a = null, o = v(e).position === "fixed", s = o ? d(e) : e;
|
|
2800
|
-
for (; f(s) && !n(s);) {
|
|
2801
|
-
let e = v(s), t = T(s), n = a ? a.position : o ? "fixed" : "";
|
|
2802
|
-
!t && (n === "fixed" || n === "absolute" && e.position === "static") ? i = i.filter((e) => e !== s) : a = e, s = d(s);
|
|
2803
|
-
}
|
|
2804
|
-
return t.set(e, i), i;
|
|
2805
|
-
}
|
|
2806
|
-
function na(e) {
|
|
2807
|
-
let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? o(t) ? [] : ta(t, this._c) : [].concat(n), r], s = ea(t, a[0], i), c = s.top, l = s.right, u = s.bottom, d = s.left;
|
|
2808
|
-
for (let e = 1; e < a.length; e++) {
|
|
2809
|
-
let n = ea(t, a[e], i);
|
|
2810
|
-
c = Kt(n.top, c), l = Gt(n.right, l), u = Gt(n.bottom, u), d = Kt(n.left, d);
|
|
2811
|
-
}
|
|
2812
|
-
return {
|
|
2813
|
-
width: l - d,
|
|
2814
|
-
height: u - c,
|
|
2815
|
-
x: d,
|
|
2816
|
-
y: c
|
|
2817
|
-
};
|
|
2818
|
-
}
|
|
2819
|
-
function ra(e) {
|
|
2820
|
-
let { width: t, height: n } = zi(e);
|
|
2821
|
-
return {
|
|
2822
|
-
width: t,
|
|
2823
|
-
height: n
|
|
2824
|
-
};
|
|
2825
|
-
}
|
|
2826
|
-
function ia(e, t, n) {
|
|
2827
|
-
let i = r(t), a = p(t), o = n === "fixed", s = Gi(e, !0, o, t), c = {
|
|
2828
|
-
scrollLeft: 0,
|
|
2829
|
-
scrollTop: 0
|
|
2830
|
-
}, l = Yt(0);
|
|
2831
|
-
if ((i || !o) && ((D(t) !== "body" || b(a)) && (c = m(t)), i)) {
|
|
2832
|
-
let e = Gi(t, !0, o, t);
|
|
2833
|
-
l.x = e.x + t.clientLeft, l.y = e.y + t.clientTop;
|
|
2834
|
-
}
|
|
2835
|
-
!i && a && (l.x = Ki(a));
|
|
2836
|
-
let u = a && !i && !o ? qi(a, c) : Yt(0);
|
|
2837
|
-
return {
|
|
2838
|
-
x: s.left + c.scrollLeft - l.x - u.x,
|
|
2839
|
-
y: s.top + c.scrollTop - l.y - u.y,
|
|
2840
|
-
width: s.width,
|
|
2841
|
-
height: s.height
|
|
2842
|
-
};
|
|
2843
|
-
}
|
|
2844
|
-
function aa(e) {
|
|
2845
|
-
return v(e).position === "static";
|
|
2846
|
-
}
|
|
2847
|
-
function oa(e, t) {
|
|
2848
|
-
if (!r(e) || v(e).position === "fixed") return null;
|
|
2849
|
-
if (t) return t(e);
|
|
2850
|
-
let n = e.offsetParent;
|
|
2851
|
-
return p(e) === n && (n = n.ownerDocument.body), n;
|
|
2852
|
-
}
|
|
2853
|
-
function sa(e, i) {
|
|
2854
|
-
let a = t(e);
|
|
2855
|
-
if (o(e)) return a;
|
|
2856
|
-
if (!r(e)) {
|
|
2857
|
-
let t = d(e);
|
|
2858
|
-
for (; t && !n(t);) {
|
|
2859
|
-
if (f(t) && !aa(t)) return t;
|
|
2860
|
-
t = d(t);
|
|
2861
|
-
}
|
|
2862
|
-
return a;
|
|
2863
|
-
}
|
|
2864
|
-
let s = oa(e, i);
|
|
2865
|
-
for (; s && y(s) && aa(s);) s = oa(s, i);
|
|
2866
|
-
return s && n(s) && aa(s) && !T(s) ? a : s || _(e) || a;
|
|
2867
|
-
}
|
|
2868
|
-
var ca = async function(e) {
|
|
2869
|
-
let t = this.getOffsetParent || sa, n = this.getDimensions, r = await n(e.floating);
|
|
2870
|
-
return {
|
|
2871
|
-
reference: ia(e.reference, await t(e.floating), e.strategy),
|
|
2872
|
-
floating: {
|
|
2873
|
-
x: 0,
|
|
2874
|
-
y: 0,
|
|
2875
|
-
width: r.width,
|
|
2876
|
-
height: r.height
|
|
2877
|
-
}
|
|
2878
|
-
};
|
|
2879
|
-
};
|
|
2880
|
-
function la(e) {
|
|
2881
|
-
return v(e).direction === "rtl";
|
|
2882
|
-
}
|
|
2883
|
-
var ua = {
|
|
2884
|
-
convertOffsetParentRelativeRectToViewportRelativeRect: Ji,
|
|
2885
|
-
getDocumentElement: p,
|
|
2886
|
-
getClippingRect: na,
|
|
2887
|
-
getOffsetParent: sa,
|
|
2888
|
-
getElementRects: ca,
|
|
2889
|
-
getClientRects: Yi,
|
|
2890
|
-
getDimensions: ra,
|
|
2891
|
-
getScale: Vi,
|
|
2892
|
-
isElement: f,
|
|
2893
|
-
isRTL: la
|
|
2894
|
-
};
|
|
2895
|
-
function da(e, t) {
|
|
2896
|
-
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
2897
|
-
}
|
|
2898
|
-
function fa(e, n, r) {
|
|
2899
|
-
let i = null, a, o = p(e);
|
|
2900
|
-
function s() {
|
|
2901
|
-
var e;
|
|
2902
|
-
clearTimeout(a), (e = i) == null || e.disconnect(), i = null;
|
|
2903
|
-
}
|
|
2904
|
-
function c(t, r) {
|
|
2905
|
-
t === void 0 && (t = !1), r === void 0 && (r = 1), s();
|
|
2906
|
-
let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
|
|
2907
|
-
if (t || n(), !f || !p) return;
|
|
2908
|
-
let m = Jt(d), h = Jt(o.clientWidth - (u + f)), g = Jt(o.clientHeight - (d + p)), _ = Jt(u), v = {
|
|
2909
|
-
rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
|
|
2910
|
-
threshold: Kt(0, Gt(1, r)) || 1
|
|
2911
|
-
}, y = !0;
|
|
2912
|
-
function b(t) {
|
|
2913
|
-
let n = t[0].intersectionRatio;
|
|
2914
|
-
if (!da(l, e.getBoundingClientRect())) return c();
|
|
2915
|
-
if (n !== r) {
|
|
2916
|
-
if (!y) return c();
|
|
2917
|
-
n ? c(!1, n) : a = setTimeout(() => {
|
|
2918
|
-
c(!1, 1e-7);
|
|
2919
|
-
}, 1e3);
|
|
2920
|
-
}
|
|
2921
|
-
y = !1;
|
|
2922
|
-
}
|
|
2923
|
-
try {
|
|
2924
|
-
i = new IntersectionObserver(b, {
|
|
2925
|
-
...v,
|
|
2926
|
-
root: o.ownerDocument
|
|
2927
|
-
});
|
|
2928
|
-
} catch {
|
|
2929
|
-
i = new IntersectionObserver(b, v);
|
|
2930
|
-
}
|
|
2931
|
-
i.observe(e);
|
|
2932
|
-
}
|
|
2933
|
-
let l = t(e), u = () => c(r);
|
|
2934
|
-
return l.addEventListener("resize", u), c(!0), () => {
|
|
2935
|
-
l.removeEventListener("resize", u), s();
|
|
2936
|
-
};
|
|
2937
|
-
}
|
|
2938
|
-
function pa(e, t, n, r) {
|
|
2939
|
-
r === void 0 && (r = {});
|
|
2940
|
-
let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = Bi(e), u = i || a ? [...l ? E(l) : [], ...t ? E(t) : []] : [];
|
|
2941
|
-
u.forEach((e) => {
|
|
2942
|
-
i && e.addEventListener("scroll", n), a && e.addEventListener("resize", n);
|
|
2943
|
-
});
|
|
2944
|
-
let d = l && s ? fa(l, n, a) : null, f = -1, p = null;
|
|
2945
|
-
o && (p = new ResizeObserver((e) => {
|
|
2946
|
-
let [r] = e;
|
|
2947
|
-
r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
2948
|
-
var e;
|
|
2949
|
-
(e = p) == null || e.observe(t);
|
|
2950
|
-
})), n();
|
|
2951
|
-
}), l && !c && p.observe(l), t && p.observe(t));
|
|
2952
|
-
let m, h = c ? Gi(e) : null;
|
|
2953
|
-
c && g();
|
|
2954
|
-
function g() {
|
|
2955
|
-
let t = Gi(e);
|
|
2956
|
-
h && !da(h, t) && n(), h = t, m = requestAnimationFrame(g);
|
|
2957
|
-
}
|
|
2958
|
-
return n(), () => {
|
|
2959
|
-
var e;
|
|
2960
|
-
u.forEach((e) => {
|
|
2961
|
-
i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n);
|
|
2962
|
-
}), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
|
|
2963
|
-
};
|
|
2964
|
-
}
|
|
2965
|
-
var ma = Fi, ha = Ii, ga = Mi, _a = Ri, va = Li, ya = (e, t, n) => {
|
|
2966
|
-
let r = /* @__PURE__ */ new Map(), i = n ?? {}, a = {
|
|
2967
|
-
...ua,
|
|
2968
|
-
...i.platform,
|
|
2969
|
-
_c: r
|
|
2970
|
-
};
|
|
2971
|
-
return ji(e, t, {
|
|
2972
|
-
...i,
|
|
2973
|
-
platform: a
|
|
2974
|
-
});
|
|
2975
|
-
}, ba = typeof document < "u" ? H : function() {};
|
|
2976
|
-
function xa(e, t) {
|
|
2977
|
-
if (e === t) return !0;
|
|
2978
|
-
if (typeof e != typeof t) return !1;
|
|
2979
|
-
if (typeof e == "function" && e.toString() === t.toString()) return !0;
|
|
2980
|
-
let n, r, i;
|
|
2981
|
-
if (e && t && typeof e == "object") {
|
|
2982
|
-
if (Array.isArray(e)) {
|
|
2983
|
-
if (n = e.length, n !== t.length) return !1;
|
|
2984
|
-
for (r = n; r-- !== 0;) if (!xa(e[r], t[r])) return !1;
|
|
2985
|
-
return !0;
|
|
2986
|
-
}
|
|
2987
|
-
if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length) return !1;
|
|
2988
|
-
for (r = n; r-- !== 0;) if (!{}.hasOwnProperty.call(t, i[r])) return !1;
|
|
2989
|
-
for (r = n; r-- !== 0;) {
|
|
2990
|
-
let n = i[r];
|
|
2991
|
-
if (!(n === "_owner" && e.$$typeof) && !xa(e[n], t[n])) return !1;
|
|
2992
|
-
}
|
|
2993
|
-
return !0;
|
|
2994
|
-
}
|
|
2995
|
-
return e !== e && t !== t;
|
|
2996
|
-
}
|
|
2997
|
-
function Sa(e) {
|
|
2998
|
-
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
2999
|
-
}
|
|
3000
|
-
function Ca(e, t) {
|
|
3001
|
-
let n = Sa(e);
|
|
3002
|
-
return Math.round(t * n) / n;
|
|
3003
|
-
}
|
|
3004
|
-
function wa(e) {
|
|
3005
|
-
let t = B.useRef(e);
|
|
3006
|
-
return ba(() => {
|
|
3007
|
-
t.current = e;
|
|
3008
|
-
}), t;
|
|
3009
|
-
}
|
|
3010
|
-
function Ta(e) {
|
|
3011
|
-
e === void 0 && (e = {});
|
|
3012
|
-
let { placement: t = "bottom", strategy: n = "absolute", middleware: r = [], platform: i, elements: { reference: a, floating: o } = {}, transform: s = !0, whileElementsMounted: c, open: l } = e, [u, d] = B.useState({
|
|
3013
|
-
x: 0,
|
|
3014
|
-
y: 0,
|
|
3015
|
-
strategy: n,
|
|
3016
|
-
placement: t,
|
|
3017
|
-
middlewareData: {},
|
|
3018
|
-
isPositioned: !1
|
|
3019
|
-
}), [f, p] = B.useState(r);
|
|
3020
|
-
xa(f, r) || p(r);
|
|
3021
|
-
let [m, h] = B.useState(null), [g, _] = B.useState(null), v = B.useCallback((e) => {
|
|
3022
|
-
e !== S.current && (S.current = e, h(e));
|
|
3023
|
-
}, []), y = B.useCallback((e) => {
|
|
3024
|
-
e !== C.current && (C.current = e, _(e));
|
|
3025
|
-
}, []), b = a || m, x = o || g, S = B.useRef(null), C = B.useRef(null), w = B.useRef(u), T = c != null, E = wa(c), D = wa(i), O = wa(l), k = B.useCallback(() => {
|
|
3026
|
-
if (!S.current || !C.current) return;
|
|
3027
|
-
let e = {
|
|
3028
|
-
placement: t,
|
|
3029
|
-
strategy: n,
|
|
3030
|
-
middleware: f
|
|
3031
|
-
};
|
|
3032
|
-
D.current && (e.platform = D.current), ya(S.current, C.current, e).then((e) => {
|
|
3033
|
-
let t = {
|
|
3034
|
-
...e,
|
|
3035
|
-
isPositioned: O.current !== !1
|
|
3036
|
-
};
|
|
3037
|
-
A.current && !xa(w.current, t) && (w.current = t, de.flushSync(() => {
|
|
3038
|
-
d(t);
|
|
3039
|
-
}));
|
|
3040
|
-
});
|
|
3041
|
-
}, [
|
|
3042
|
-
f,
|
|
3043
|
-
t,
|
|
3044
|
-
n,
|
|
3045
|
-
D,
|
|
3046
|
-
O
|
|
3047
|
-
]);
|
|
3048
|
-
ba(() => {
|
|
3049
|
-
l === !1 && w.current.isPositioned && (w.current.isPositioned = !1, d((e) => ({
|
|
3050
|
-
...e,
|
|
3051
|
-
isPositioned: !1
|
|
3052
|
-
})));
|
|
3053
|
-
}, [l]);
|
|
3054
|
-
let A = B.useRef(!1);
|
|
3055
|
-
ba(() => (A.current = !0, () => {
|
|
3056
|
-
A.current = !1;
|
|
3057
|
-
}), []), ba(() => {
|
|
3058
|
-
if (b && (S.current = b), x && (C.current = x), b && x) {
|
|
3059
|
-
if (E.current) return E.current(b, x, k);
|
|
3060
|
-
k();
|
|
3061
|
-
}
|
|
3062
|
-
}, [
|
|
3063
|
-
b,
|
|
3064
|
-
x,
|
|
3065
|
-
k,
|
|
3066
|
-
E,
|
|
3067
|
-
T
|
|
3068
|
-
]);
|
|
3069
|
-
let j = B.useMemo(() => ({
|
|
3070
|
-
reference: S,
|
|
3071
|
-
floating: C,
|
|
3072
|
-
setReference: v,
|
|
3073
|
-
setFloating: y
|
|
3074
|
-
}), [v, y]), M = B.useMemo(() => ({
|
|
3075
|
-
reference: b,
|
|
3076
|
-
floating: x
|
|
3077
|
-
}), [b, x]), N = B.useMemo(() => {
|
|
3078
|
-
let e = {
|
|
3079
|
-
position: n,
|
|
3080
|
-
left: 0,
|
|
3081
|
-
top: 0
|
|
3082
|
-
};
|
|
3083
|
-
if (!M.floating) return e;
|
|
3084
|
-
let t = Ca(M.floating, u.x), r = Ca(M.floating, u.y);
|
|
3085
|
-
return s ? {
|
|
3086
|
-
...e,
|
|
3087
|
-
transform: "translate(" + t + "px, " + r + "px)",
|
|
3088
|
-
...Sa(M.floating) >= 1.5 && { willChange: "transform" }
|
|
3089
|
-
} : {
|
|
3090
|
-
position: n,
|
|
3091
|
-
left: t,
|
|
3092
|
-
top: r
|
|
3093
|
-
};
|
|
3094
|
-
}, [
|
|
3095
|
-
n,
|
|
3096
|
-
s,
|
|
3097
|
-
M.floating,
|
|
3098
|
-
u.x,
|
|
3099
|
-
u.y
|
|
3100
|
-
]);
|
|
3101
|
-
return B.useMemo(() => ({
|
|
3102
|
-
...u,
|
|
3103
|
-
update: k,
|
|
3104
|
-
refs: j,
|
|
3105
|
-
elements: M,
|
|
3106
|
-
floatingStyles: N
|
|
3107
|
-
}), [
|
|
3108
|
-
u,
|
|
3109
|
-
k,
|
|
3110
|
-
j,
|
|
3111
|
-
M,
|
|
3112
|
-
N
|
|
3113
|
-
]);
|
|
3114
|
-
}
|
|
3115
|
-
var Ea = (e, t) => {
|
|
3116
|
-
let n = ma(e);
|
|
3117
|
-
return {
|
|
3118
|
-
name: n.name,
|
|
3119
|
-
fn: n.fn,
|
|
3120
|
-
options: [e, t]
|
|
3121
|
-
};
|
|
3122
|
-
}, Da = (e, t) => {
|
|
3123
|
-
let n = ha(e);
|
|
3124
|
-
return {
|
|
3125
|
-
name: n.name,
|
|
3126
|
-
fn: n.fn,
|
|
3127
|
-
options: [e, t]
|
|
3128
|
-
};
|
|
3129
|
-
}, Oa = (e, t) => ({
|
|
3130
|
-
fn: va(e).fn,
|
|
3131
|
-
options: [e, t]
|
|
3132
|
-
}), ka = (e, t) => {
|
|
3133
|
-
let n = ga(e);
|
|
3134
|
-
return {
|
|
3135
|
-
name: n.name,
|
|
3136
|
-
fn: n.fn,
|
|
3137
|
-
options: [e, t]
|
|
3138
|
-
};
|
|
3139
|
-
}, Aa = (e, t) => {
|
|
3140
|
-
let n = _a(e);
|
|
3141
|
-
return {
|
|
3142
|
-
name: n.name,
|
|
3143
|
-
fn: n.fn,
|
|
3144
|
-
options: [e, t]
|
|
3145
|
-
};
|
|
3146
|
-
}, ja = {
|
|
3147
|
-
...li,
|
|
3148
|
-
disabled: (e) => e.disabled,
|
|
3149
|
-
instantType: (e) => e.instantType,
|
|
3150
|
-
isInstantPhase: (e) => e.isInstantPhase,
|
|
3151
|
-
trackCursorAxis: (e) => e.trackCursorAxis,
|
|
3152
|
-
disableHoverablePopup: (e) => e.disableHoverablePopup,
|
|
3153
|
-
lastOpenChangeReason: (e) => e.openChangeReason,
|
|
3154
|
-
closeOnClick: (e) => e.closeOnClick,
|
|
3155
|
-
appliedTriggerProps: (e, t) => t ? e.activeTriggerProps : void 0,
|
|
3156
|
-
closeDelay: (e) => e.closeDelay,
|
|
3157
|
-
adaptiveOrigin: (e) => e.adaptiveOrigin
|
|
3158
|
-
}, Ma = class extends ei {
|
|
3159
|
-
constructor(e, t, n) {
|
|
3160
|
-
let r = new Kr();
|
|
3161
|
-
super(Na(e, r, t, n), Pa(r), ja);
|
|
3162
|
-
}
|
|
3163
|
-
setOpen = (e, t) => {
|
|
3164
|
-
Br(this, e, t, { extraState: { openChangeReason: t.reason } });
|
|
3165
|
-
};
|
|
3166
|
-
cancelPendingOpen(e) {
|
|
3167
|
-
this.state.floatingRootContext.dispatchOpenChange(!1, I(ne, e));
|
|
3168
|
-
}
|
|
3169
|
-
};
|
|
3170
|
-
function Na(e, t, n, r = !1) {
|
|
3171
|
-
return {
|
|
3172
|
-
...ri(t, n, r),
|
|
3173
|
-
disabled: !1,
|
|
3174
|
-
instantType: void 0,
|
|
3175
|
-
isInstantPhase: !1,
|
|
3176
|
-
trackCursorAxis: "none",
|
|
3177
|
-
disableHoverablePopup: !1,
|
|
3178
|
-
openChangeReason: null,
|
|
3179
|
-
closeOnClick: !0,
|
|
3180
|
-
closeDelay: 0,
|
|
3181
|
-
adaptiveOrigin: void 0,
|
|
3182
|
-
...e
|
|
3183
|
-
};
|
|
3184
|
-
}
|
|
3185
|
-
function Pa(e) {
|
|
3186
|
-
return {
|
|
3187
|
-
popupRef: /*#__PURE__*/ B.createRef(),
|
|
3188
|
-
onOpenChange: void 0,
|
|
3189
|
-
onOpenChangeComplete: void 0,
|
|
3190
|
-
triggerElements: e
|
|
3191
|
-
};
|
|
3192
|
-
}
|
|
3193
|
-
var Fa = ge(function(e) {
|
|
3194
|
-
let { disabled: t = !1, defaultOpen: n = !1, open: r, disableHoverablePopup: a = !1, trackCursorAxis: o = "none", actionsRef: s, onOpenChange: c, onOpenChangeComplete: l, handle: u, triggerId: d, defaultTriggerId: f = null, children: p } = e, m = Pr((e, t) => new Ma({
|
|
3195
|
-
open: n,
|
|
3196
|
-
openProp: r,
|
|
3197
|
-
activeTriggerId: f,
|
|
3198
|
-
triggerIdProp: d
|
|
3199
|
-
}, e, t));
|
|
3200
|
-
m.useControlledProp("openProp", r), m.useControlledProp("triggerIdProp", d), m.useContextCallback("onOpenChange", c), m.useContextCallback("onOpenChangeComplete", l);
|
|
3201
|
-
let h = m.useState("open"), g = !t && h, _ = m.useState("activeTriggerId"), v = m.useState("mounted"), y = m.useState("payload");
|
|
3202
|
-
m.useSyncedValues({
|
|
3203
|
-
trackCursorAxis: o,
|
|
3204
|
-
disableHoverablePopup: a,
|
|
3205
|
-
disabled: t
|
|
3206
|
-
}), Hr(m, { closeOnActiveTriggerUnmount: !0 });
|
|
3207
|
-
let { forceUnmount: b, transitionStatus: x } = Ur(g, m), S = m.useState("isInstantPhase"), C = m.useState("instantType"), w = m.useState("lastOpenChangeReason"), T = B.useRef(null);
|
|
3208
|
-
i(() => {
|
|
3209
|
-
h && t && m.setOpen(!1, I(L));
|
|
3210
|
-
}, [
|
|
3211
|
-
h,
|
|
3212
|
-
t,
|
|
3213
|
-
m
|
|
3214
|
-
]), i(() => {
|
|
3215
|
-
x === "ending" && w === "none" || x !== "ending" && S ? (C !== "delay" && (T.current = C), m.set("instantType", "delay")) : T.current !== null && (m.set("instantType", T.current), T.current = null);
|
|
3216
|
-
}, [
|
|
3217
|
-
x,
|
|
3218
|
-
S,
|
|
3219
|
-
w,
|
|
3220
|
-
C,
|
|
3221
|
-
m
|
|
3222
|
-
]), i(() => {
|
|
3223
|
-
g && (_ ?? m.set("payload", void 0));
|
|
3224
|
-
}, [
|
|
3225
|
-
m,
|
|
3226
|
-
_,
|
|
3227
|
-
g
|
|
3228
|
-
]), B.useImperativeHandle(s, () => ({
|
|
3229
|
-
unmount: b,
|
|
3230
|
-
close: () => m.setOpen(!1, I(R))
|
|
3231
|
-
}), [b, m]);
|
|
3232
|
-
let E = g || v || !t && o !== "none";
|
|
3233
|
-
return /*#__PURE__*/ ue(ye.Provider, {
|
|
3234
|
-
value: m,
|
|
3235
|
-
children: [
|
|
3236
|
-
u && /*#__PURE__*/ W(Fr, {
|
|
3237
|
-
handle: u,
|
|
3238
|
-
store: m
|
|
3239
|
-
}),
|
|
3240
|
-
E && /*#__PURE__*/ W(Ia, {
|
|
3241
|
-
store: m,
|
|
3242
|
-
disabled: t,
|
|
3243
|
-
trackCursorAxis: o
|
|
3244
|
-
}),
|
|
3245
|
-
typeof p == "function" ? p({ payload: y }) : p
|
|
3246
|
-
]
|
|
3247
|
-
});
|
|
3248
|
-
});
|
|
3249
|
-
function Ia({ store: e, disabled: t, trackCursorAxis: n }) {
|
|
3250
|
-
let r = e.useState("floatingRootContext"), i = Cr(r, {
|
|
3251
|
-
enabled: !t,
|
|
3252
|
-
referencePress: () => e.select("closeOnClick")
|
|
3253
|
-
}), o = br(r, {
|
|
3254
|
-
enabled: !t && n !== "none",
|
|
3255
|
-
axis: n === "none" ? void 0 : n
|
|
3256
|
-
}), s = B.useMemo(() => C(o.reference, i.reference), [o.reference, i.reference]);
|
|
3257
|
-
return Wr(e, {
|
|
3258
|
-
activeTriggerProps: s,
|
|
3259
|
-
inactiveTriggerProps: s,
|
|
3260
|
-
popupProps: i.floating ?? a
|
|
3261
|
-
}), null;
|
|
3262
|
-
}
|
|
3263
|
-
var La = /*#__PURE__*/ B.createContext(void 0);
|
|
3264
|
-
function Ra() {
|
|
3265
|
-
return B.useContext(La);
|
|
3266
|
-
}
|
|
3267
|
-
var za = "data-base-ui-tooltip-trigger";
|
|
3268
|
-
function Ba(e) {
|
|
3269
|
-
let t = Ue(e);
|
|
3270
|
-
return f(t) ? t : null;
|
|
3271
|
-
}
|
|
3272
|
-
var Va = _e(function(e, t) {
|
|
3273
|
-
let { render: n, className: r, style: i, handle: a, payload: o, disabled: s, delay: c, closeOnClick: u = !0, closeDelay: d, id: f, ...p } = e, m = be(!0), h = ui(a) ?? m;
|
|
3274
|
-
if (!h) throw Error(l(82));
|
|
3275
|
-
let g = re(f), _ = h.useState("isTriggerActive", g), v = h.useState("isOpenedByTrigger", g), y = h.useState("floatingRootContext"), b = B.useRef(null), S = d ?? 0, { registerTrigger: C, isMountedByThisTrigger: w } = Vr(g, b, h, {
|
|
3276
|
-
payload: o,
|
|
3277
|
-
closeOnClick: u,
|
|
3278
|
-
closeDelay: S
|
|
3279
|
-
}), T = Ra(), { activeIdRef: E, delayRef: D, isInstantPhase: O, hasProvider: k } = Pt(y, { open: v }), A = _i(y);
|
|
3280
|
-
h.useSyncedValue("isInstantPhase", O);
|
|
3281
|
-
let j = h.useState("disabled"), M = s ?? j, ee = J(M), te = h.useState("trackCursorAxis"), F = h.useState("disableHoverablePopup"), ne = B.useRef(!1), L = P(), R = B.useRef(void 0);
|
|
3282
|
-
function z() {
|
|
3283
|
-
return k && E.current != null ? 0 : c ?? T ?? 600;
|
|
3284
|
-
}
|
|
3285
|
-
function ie(e) {
|
|
3286
|
-
let t = b.current;
|
|
3287
|
-
if (!t || !e) return !1;
|
|
3288
|
-
let n = He(e, `[${za}]`);
|
|
3289
|
-
return n !== null && n !== t && K(t, n);
|
|
3290
|
-
}
|
|
3291
|
-
function ae(e) {
|
|
3292
|
-
let t = ie(e);
|
|
3293
|
-
return ne.current = t, t && (A.openChangeTimeout.clear(), A.restTimeout.clear(), A.restTimeoutPending = !1, L.clear()), t;
|
|
3294
|
-
}
|
|
3295
|
-
let V = bi(y, {
|
|
3296
|
-
enabled: !M,
|
|
3297
|
-
mouseOnly: !0,
|
|
3298
|
-
move: !1,
|
|
3299
|
-
handleClose: !F && te !== "both" ? Di() : null,
|
|
3300
|
-
restMs: z,
|
|
3301
|
-
delay() {
|
|
3302
|
-
return d == null && k ? { close: Dt(D.current, "close") } : { close: S };
|
|
3303
|
-
},
|
|
3304
|
-
triggerElementRef: b,
|
|
3305
|
-
isActiveTrigger: _,
|
|
3306
|
-
isClosing: () => h.select("transitionStatus") === "ending",
|
|
3307
|
-
shouldOpen() {
|
|
3308
|
-
return !ne.current;
|
|
3309
|
-
}
|
|
3310
|
-
}), oe = fi(y, { enabled: !M }).reference, H = (e) => {
|
|
3311
|
-
let t = ne.current, n = Ba(e), r = ae(n), i = b.current, a = i && n && K(i, n);
|
|
3312
|
-
if (r && h.select("open") && h.select("lastOpenChangeReason") === "trigger-hover") h.setOpen(!1, I(N, e));
|
|
3313
|
-
else if (t && !r && a && !ee.current && !h.select("open") && i && ze(R.current)) {
|
|
3314
|
-
let t = () => {
|
|
3315
|
-
!ne.current && !ee.current && !h.select("open") && h.setOpen(!0, I(N, e, i));
|
|
3316
|
-
}, n = z();
|
|
3317
|
-
n === 0 ? (L.clear(), t()) : L.start(n, t);
|
|
3318
|
-
}
|
|
3319
|
-
}, se = h.useState("appliedTriggerProps", w || te !== "none");
|
|
3320
|
-
return x("button", e, {
|
|
3321
|
-
state: { open: v },
|
|
3322
|
-
ref: [
|
|
3323
|
-
t,
|
|
3324
|
-
C,
|
|
3325
|
-
b
|
|
3326
|
-
],
|
|
3327
|
-
props: [
|
|
3328
|
-
V,
|
|
3329
|
-
oe,
|
|
3330
|
-
se,
|
|
3331
|
-
{
|
|
3332
|
-
onMouseOver(e) {
|
|
3333
|
-
H(e.nativeEvent);
|
|
3334
|
-
},
|
|
3335
|
-
onFocus(e) {
|
|
3336
|
-
ie(Ba(e.nativeEvent)) && e.preventBaseUIHandler();
|
|
3337
|
-
},
|
|
3338
|
-
onMouseLeave() {
|
|
3339
|
-
ne.current = !1, L.clear(), R.current = void 0;
|
|
3340
|
-
},
|
|
3341
|
-
onPointerEnter(e) {
|
|
3342
|
-
R.current = e.pointerType;
|
|
3343
|
-
},
|
|
3344
|
-
onPointerDown(e) {
|
|
3345
|
-
R.current = e.pointerType, h.set("closeOnClick", u), u && !h.select("open") && h.cancelPendingOpen(e.nativeEvent);
|
|
3346
|
-
},
|
|
3347
|
-
onClick(e) {
|
|
3348
|
-
u && !h.select("open") && h.cancelPendingOpen(e.nativeEvent);
|
|
3349
|
-
},
|
|
3350
|
-
id: g,
|
|
3351
|
-
[_t]: M ? "" : void 0,
|
|
3352
|
-
[za]: M ? void 0 : ""
|
|
3353
|
-
},
|
|
3354
|
-
p
|
|
3355
|
-
],
|
|
3356
|
-
stateAttributesMapping: pt
|
|
3357
|
-
});
|
|
3358
|
-
}), Ha = /*#__PURE__*/ B.createContext(void 0);
|
|
3359
|
-
function Ua() {
|
|
3360
|
-
let e = B.useContext(Ha);
|
|
3361
|
-
if (e === void 0) throw Error(l(70));
|
|
3362
|
-
return e;
|
|
3363
|
-
}
|
|
3364
|
-
var Wa = /*#__PURE__*/ B.forwardRef(function(e, t) {
|
|
3365
|
-
let { children: n, container: r, className: i, render: a, style: o, ...s } = e, { node: c, subtree: l } = or({
|
|
3366
|
-
container: r,
|
|
3367
|
-
ref: t,
|
|
3368
|
-
componentProps: e,
|
|
3369
|
-
elementProps: s
|
|
3370
|
-
});
|
|
3371
|
-
return !l && !c ? null : /*#__PURE__*/ ue(B.Fragment, { children: [l, c && /*#__PURE__*/ de.createPortal(n, c)] });
|
|
3372
|
-
}), Ga = /*#__PURE__*/ B.forwardRef(function(e, t) {
|
|
3373
|
-
let { keepMounted: n = !1, ...r } = e;
|
|
3374
|
-
return be().useState("mounted") || n ? /*#__PURE__*/ W(Ha.Provider, {
|
|
3375
|
-
value: n,
|
|
3376
|
-
children: /*#__PURE__*/ W(Wa, {
|
|
3377
|
-
ref: t,
|
|
3378
|
-
...r
|
|
3379
|
-
})
|
|
3380
|
-
}) : null;
|
|
3381
|
-
}), Ka = /*#__PURE__*/ B.createContext(void 0);
|
|
3382
|
-
function qa() {
|
|
3383
|
-
let e = B.useContext(Ka);
|
|
3384
|
-
if (e === void 0) throw Error(l(71));
|
|
3385
|
-
return e;
|
|
3386
|
-
}
|
|
3387
|
-
function Ja(e) {
|
|
3388
|
-
let { nodeId: t, externalTree: n, rootContext: r } = e, a = r.useState("referenceElement"), o = r.useState("floatingElement"), s = r.useState("domReferenceElement"), c = r.useState("open"), l = r.useState("floatingId"), [u, d] = B.useState(null), p = B.useRef(null), m = pr(n), h = B.useMemo(() => ({
|
|
3389
|
-
reference: a,
|
|
3390
|
-
floating: o,
|
|
3391
|
-
domReference: s
|
|
3392
|
-
}), [
|
|
3393
|
-
a,
|
|
3394
|
-
o,
|
|
3395
|
-
s
|
|
3396
|
-
]), g = Ta({
|
|
3397
|
-
...e,
|
|
3398
|
-
elements: {
|
|
3399
|
-
...h,
|
|
3400
|
-
...u && { reference: u }
|
|
3401
|
-
}
|
|
3402
|
-
}), _ = B.useCallback((e) => {
|
|
3403
|
-
let t = f(e) ? {
|
|
3404
|
-
getBoundingClientRect: () => e.getBoundingClientRect(),
|
|
3405
|
-
getClientRects: () => e.getClientRects(),
|
|
3406
|
-
contextElement: e
|
|
3407
|
-
} : e;
|
|
3408
|
-
d(t), g.refs.setReference(t);
|
|
3409
|
-
}, [g.refs]), v = B.useMemo(() => ({
|
|
3410
|
-
...g.refs,
|
|
3411
|
-
setPositionReference: _,
|
|
3412
|
-
domReference: p
|
|
3413
|
-
}), [g.refs, _]), y = B.useMemo(() => ({
|
|
3414
|
-
...g.elements,
|
|
3415
|
-
domReference: s
|
|
3416
|
-
}), [g.elements, s]), b = B.useMemo(() => ({
|
|
3417
|
-
...g,
|
|
3418
|
-
dataRef: r.context.dataRef,
|
|
3419
|
-
open: c,
|
|
3420
|
-
onOpenChange: r.setOpen,
|
|
3421
|
-
events: r.context.events,
|
|
3422
|
-
floatingId: l,
|
|
3423
|
-
refs: v,
|
|
3424
|
-
elements: y,
|
|
3425
|
-
nodeId: t,
|
|
3426
|
-
rootStore: r
|
|
3427
|
-
}), [
|
|
3428
|
-
g,
|
|
3429
|
-
v,
|
|
3430
|
-
y,
|
|
3431
|
-
t,
|
|
3432
|
-
r,
|
|
3433
|
-
c,
|
|
3434
|
-
l
|
|
3435
|
-
]);
|
|
3436
|
-
return i(() => {
|
|
3437
|
-
s && (p.current = s);
|
|
3438
|
-
}, [s]), i(() => {
|
|
3439
|
-
r.context.dataRef.current.floatingContext = b;
|
|
3440
|
-
let e = m?.nodesRef.current.find((e) => e.id === t);
|
|
3441
|
-
e && (e.context = b);
|
|
3442
|
-
}), B.useMemo(() => ({
|
|
3443
|
-
...g,
|
|
3444
|
-
context: b,
|
|
3445
|
-
refs: v,
|
|
3446
|
-
elements: y,
|
|
3447
|
-
rootStore: r
|
|
3448
|
-
}), [
|
|
3449
|
-
g,
|
|
3450
|
-
v,
|
|
3451
|
-
y,
|
|
3452
|
-
b,
|
|
3453
|
-
r
|
|
3454
|
-
]);
|
|
3455
|
-
}
|
|
3456
|
-
var Ya = (e) => ({
|
|
3457
|
-
name: "arrow",
|
|
3458
|
-
options: e,
|
|
3459
|
-
async fn(t) {
|
|
3460
|
-
let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = Qt(e, t) || {};
|
|
3461
|
-
if (l == null) return {};
|
|
3462
|
-
let d = hn(u), f = {
|
|
3463
|
-
x: n,
|
|
3464
|
-
y: r
|
|
3465
|
-
}, p = nn(i), m = tn(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = s.floating[y] || a.floating[m], C = b / 2 - x / 2, w = S / 2 - h[m] / 2 - 1, T = Math.min(d[_], w), E = Math.min(d[v], w), D = T, O = S - h[m] - E, k = S / 2 - h[m] / 2 + C, A = Zt(D, k, O), j = !c.arrow && $t(i) != null && k !== A && a.reference[m] / 2 - (k < D ? T : E) - h[m] / 2 < 0, M = j ? k < D ? k - D : k - O : 0;
|
|
3466
|
-
return {
|
|
3467
|
-
[p]: f[p] + M,
|
|
3468
|
-
data: {
|
|
3469
|
-
[p]: A,
|
|
3470
|
-
centerOffset: k - A - M,
|
|
3471
|
-
...j && { alignmentOffset: M }
|
|
3472
|
-
},
|
|
3473
|
-
reset: j
|
|
3474
|
-
};
|
|
3475
|
-
}
|
|
3476
|
-
}), Xa = (e, t) => {
|
|
3477
|
-
let { name: n, fn: r } = Ya(e);
|
|
3478
|
-
return {
|
|
3479
|
-
name: n,
|
|
3480
|
-
fn: r,
|
|
3481
|
-
options: [e, t]
|
|
3482
|
-
};
|
|
3483
|
-
}, Za = {
|
|
3484
|
-
name: "hide",
|
|
3485
|
-
async fn(e) {
|
|
3486
|
-
let { width: t, height: n, x: r, y: i } = e.rects.reference, a = t === 0 && n === 0 && r === 0 && i === 0, o = await e.platform.detectOverflow(e, { elementContext: "reference" });
|
|
3487
|
-
return { data: { referenceHidden: o.top - n >= 0 || o.right - t >= 0 || o.bottom - n >= 0 || o.left - t >= 0 || a } };
|
|
3488
|
-
}
|
|
3489
|
-
}, Qa = {
|
|
3490
|
-
sideX: "left",
|
|
3491
|
-
sideY: "top"
|
|
3492
|
-
}, $a = "--available-width", eo = "--available-height", to = "--anchor-width", no = "--anchor-height", ro = "--transform-origin", io = $a, ao = eo;
|
|
3493
|
-
function oo(e, t, n) {
|
|
3494
|
-
let r = e === "inline-start" || e === "inline-end";
|
|
3495
|
-
return {
|
|
3496
|
-
top: "top",
|
|
3497
|
-
right: r ? n ? "inline-start" : "inline-end" : "right",
|
|
3498
|
-
bottom: "bottom",
|
|
3499
|
-
left: r ? n ? "inline-end" : "inline-start" : "left"
|
|
3500
|
-
}[t];
|
|
3501
|
-
}
|
|
3502
|
-
function so(e, t, n) {
|
|
3503
|
-
let { rects: r, placement: i } = e;
|
|
3504
|
-
return {
|
|
3505
|
-
side: oo(t, X(i), n),
|
|
3506
|
-
align: $t(i) || "center",
|
|
3507
|
-
anchor: {
|
|
3508
|
-
width: r.reference.width,
|
|
3509
|
-
height: r.reference.height
|
|
3510
|
-
},
|
|
3511
|
-
positioner: {
|
|
3512
|
-
width: r.floating.width,
|
|
3513
|
-
height: r.floating.height
|
|
3514
|
-
}
|
|
3515
|
-
};
|
|
3516
|
-
}
|
|
3517
|
-
function co(e) {
|
|
3518
|
-
return lo(e, Ja);
|
|
3519
|
-
}
|
|
3520
|
-
function lo(e, n) {
|
|
3521
|
-
let { anchor: r, positionMethod: a = "absolute", side: o = "bottom", sideOffset: s = 0, align: c = "center", alignOffset: l = 0, collisionBoundary: u, collisionPadding: d = 5, sticky: f = !1, arrowPadding: p = 5, disableAnchorTracking: m = !1, inline: h, keepMounted: _ = !1, floatingRootContext: v, mounted: y, collisionAvoidance: b, shift: x, nodeId: S, adaptiveOrigin: C, lazyFlip: w = !1, externalTree: T } = e, E = b.side || "flip", D = b.align || "flip", O = b.fallbackAxisSide || "end", k = x?.crossAxis ?? !1, A = x?.rootBoundary, j = typeof r == "function" ? r : void 0, M = g(j), N = j ? M : r, P = J(r), ee = J(y), te = ie() === "rtl", [F, I] = B.useState(null);
|
|
3522
|
-
!y && F !== null && I(null);
|
|
3523
|
-
let ne = w === "placement", L = F ? X(F) : null, re = F && ne ? $t(F) || "center" : null, R = L || {
|
|
3524
|
-
top: "top",
|
|
3525
|
-
right: "right",
|
|
3526
|
-
bottom: "bottom",
|
|
3527
|
-
left: "left",
|
|
3528
|
-
"inline-end": te ? "left" : "right",
|
|
3529
|
-
"inline-start": te ? "right" : "left"
|
|
3530
|
-
}[o], z = re || c, ae = z === "center" ? R : `${R}-${z}`, V = d;
|
|
3531
|
-
typeof V == "number" ? V = {
|
|
3532
|
-
top: V,
|
|
3533
|
-
right: V,
|
|
3534
|
-
bottom: V,
|
|
3535
|
-
left: V
|
|
3536
|
-
} : V &&= {
|
|
3537
|
-
top: V.top || 0,
|
|
3538
|
-
right: V.right || 0,
|
|
3539
|
-
bottom: V.bottom || 0,
|
|
3540
|
-
left: V.left || 0
|
|
3541
|
-
};
|
|
3542
|
-
let oe = +(o === "bottom"), H = +(o === "top"), se = +(o === "right"), ce = +(o === "left"), le = {
|
|
3543
|
-
boundary: u === "clipping-ancestors" ? "clippingAncestors" : u,
|
|
3544
|
-
padding: V
|
|
3545
|
-
}, U = B.useRef(null), W = J(s), ue = J(l), de = typeof s == "function" ? 0 : s, fe = typeof l == "function" ? 0 : l, pe = [];
|
|
3546
|
-
h && pe.push(h), pe.push(Ea((e) => {
|
|
3547
|
-
let t = so(e, o, te), n = typeof W.current == "function" ? W.current(t) : W.current, r = typeof ue.current == "function" ? ue.current(t) : ue.current;
|
|
3548
|
-
return {
|
|
3549
|
-
mainAxis: n,
|
|
3550
|
-
crossAxis: r,
|
|
3551
|
-
alignmentAxis: r
|
|
3552
|
-
};
|
|
3553
|
-
}, [
|
|
3554
|
-
de,
|
|
3555
|
-
fe,
|
|
3556
|
-
te,
|
|
3557
|
-
o
|
|
3558
|
-
]));
|
|
3559
|
-
let me = D === "none" && E !== "shift", he = !me && (f || k || E === "shift"), ge = E === "none" ? null : ka({
|
|
3560
|
-
...le,
|
|
3561
|
-
padding: {
|
|
3562
|
-
top: V.top + 1 + oe,
|
|
3563
|
-
right: V.right + 1 + ce,
|
|
3564
|
-
bottom: V.bottom + 1 + H,
|
|
3565
|
-
left: V.left + 1 + se
|
|
3566
|
-
},
|
|
3567
|
-
mainAxis: !k && E === "flip",
|
|
3568
|
-
crossAxis: D === "flip" && "alignment",
|
|
3569
|
-
fallbackAxisSideDirection: O
|
|
3570
|
-
}), _e = me ? null : Da({
|
|
3571
|
-
...le,
|
|
3572
|
-
rootBoundary: A,
|
|
3573
|
-
mainAxis: D !== "none",
|
|
3574
|
-
crossAxis: he,
|
|
3575
|
-
limiter: f || k ? void 0 : Oa((e) => {
|
|
3576
|
-
if (!U.current) return {};
|
|
3577
|
-
let { width: t, height: n } = U.current.getBoundingClientRect(), r = Z(X(e.placement)), i = r === "y" ? t : n, a = r === "y" ? V.left + V.right : V.top + V.bottom;
|
|
3578
|
-
return { offset: i / 2 + a / 2 };
|
|
3579
|
-
})
|
|
3580
|
-
}, [
|
|
3581
|
-
le,
|
|
3582
|
-
f,
|
|
3583
|
-
k,
|
|
3584
|
-
A,
|
|
3585
|
-
V,
|
|
3586
|
-
D
|
|
3587
|
-
]);
|
|
3588
|
-
E === "shift" || D === "shift" || z === "center" ? pe.push(_e, ge) : pe.push(ge, _e), pe.push(Aa({
|
|
3589
|
-
...le,
|
|
3590
|
-
apply({ elements: { floating: e }, availableWidth: n, availableHeight: r, rects: i }) {
|
|
3591
|
-
if (!ee.current) return;
|
|
3592
|
-
let a = e.style;
|
|
3593
|
-
a.setProperty(io, `${n}px`), a.setProperty(ao, `${r}px`);
|
|
3594
|
-
let o = t(e).devicePixelRatio || 1, { x: s, y: c, width: l, height: u } = i.reference, d = (Math.round((s + l) * o) - Math.round(s * o)) / o, f = (Math.round((c + u) * o) - Math.round(c * o)) / o;
|
|
3595
|
-
a.setProperty(to, `${d}px`), a.setProperty(no, `${f}px`);
|
|
3596
|
-
}
|
|
3597
|
-
}), Xa((e) => ({
|
|
3598
|
-
element: U.current || Y(e.elements.floating).createElement("div"),
|
|
3599
|
-
padding: U.current ? p : 0
|
|
3600
|
-
}), [p]), {
|
|
3601
|
-
name: "transformOrigin",
|
|
3602
|
-
fn(e) {
|
|
3603
|
-
let { elements: { floating: t }, middlewareData: n, placement: r, platform: i, rects: a, y: c } = e, l = X(r), u = $t(r), d = Z(l) === "y", f = U.current, p = typeof s == "function" ? s(so(e, o, te)) : s, m;
|
|
3604
|
-
m = !f && u && Math.abs(d ? n.shift?.x || 0 : n.shift?.y || 0) <= 1 ? u === "start" === (d && i.isRTL?.(t) === !0) ? "100%" : "0%" : `${(d ? n.arrow?.x || 0 : n.arrow?.y || 0) + (d ? f?.clientWidth || 0 : f?.clientHeight || 0) / 2}px`;
|
|
3605
|
-
let h = l === "top" || l === "left" ? `calc(100% + ${p}px)` : `${-p}px`;
|
|
3606
|
-
return he && d && Math.abs(n.shift?.y || 0) > p && (h = `${a.reference.y + a.reference.height / 2 - c}px`), t.style.setProperty(ro, d ? `${m} ${h}` : `${h} ${m}`), {};
|
|
3607
|
-
}
|
|
3608
|
-
}, Za, C), i(() => {
|
|
3609
|
-
!y && v && v.update({
|
|
3610
|
-
referenceElement: null,
|
|
3611
|
-
floatingElement: null,
|
|
3612
|
-
domReferenceElement: null,
|
|
3613
|
-
positionReference: null
|
|
3614
|
-
});
|
|
3615
|
-
}, [y, v]);
|
|
3616
|
-
let ve = B.useMemo(() => ({
|
|
3617
|
-
ancestorScroll: !m,
|
|
3618
|
-
elementResize: !m && typeof ResizeObserver < "u",
|
|
3619
|
-
layoutShift: !m && typeof IntersectionObserver < "u"
|
|
3620
|
-
}), [m]), { refs: ye, elements: be, x: xe, y: Se, middlewareData: Ce, update: we, placement: Te, context: Ee, isPositioned: G, floatingStyles: De } = n({
|
|
3621
|
-
rootContext: v,
|
|
3622
|
-
open: _ ? y : void 0,
|
|
3623
|
-
placement: ae,
|
|
3624
|
-
middleware: pe,
|
|
3625
|
-
strategy: a,
|
|
3626
|
-
whileElementsMounted: _ ? void 0 : (...e) => pa(...e, ve),
|
|
3627
|
-
nodeId: S,
|
|
3628
|
-
externalTree: T
|
|
3629
|
-
}), { sideX: Oe, sideY: ke } = Ce.adaptiveOrigin || Qa, Ae = G ? a : "fixed", je = B.useMemo(() => {
|
|
3630
|
-
let e;
|
|
3631
|
-
return e = G ? C ? {
|
|
3632
|
-
position: Ae,
|
|
3633
|
-
[Oe]: xe,
|
|
3634
|
-
[ke]: Se
|
|
3635
|
-
} : {
|
|
3636
|
-
...De,
|
|
3637
|
-
position: Ae
|
|
3638
|
-
} : {
|
|
3639
|
-
position: Ae,
|
|
3640
|
-
top: 0,
|
|
3641
|
-
left: 0
|
|
3642
|
-
}, e[io] = "100vw", e[ao] = "100vh", G || (e.opacity = 0), e;
|
|
3643
|
-
}, [
|
|
3644
|
-
C,
|
|
3645
|
-
Ae,
|
|
3646
|
-
Oe,
|
|
3647
|
-
xe,
|
|
3648
|
-
ke,
|
|
3649
|
-
Se,
|
|
3650
|
-
De,
|
|
3651
|
-
G
|
|
3652
|
-
]), Me = B.useRef(null);
|
|
3653
|
-
i(() => {
|
|
3654
|
-
if (!y) return;
|
|
3655
|
-
let e = P.current, t = typeof e == "function" ? e() : e, n = (uo(t) ? t.current : t) || null;
|
|
3656
|
-
n !== Me.current && (ye.setPositionReference(n), Me.current = n);
|
|
3657
|
-
}, [
|
|
3658
|
-
y,
|
|
3659
|
-
ye,
|
|
3660
|
-
N,
|
|
3661
|
-
P
|
|
3662
|
-
]), B.useEffect(() => {
|
|
3663
|
-
if (!y) return;
|
|
3664
|
-
let e = P.current;
|
|
3665
|
-
typeof e != "function" && uo(e) && e.current !== Me.current && (ye.setPositionReference(e.current), Me.current = e.current);
|
|
3666
|
-
}, [
|
|
3667
|
-
y,
|
|
3668
|
-
ye,
|
|
3669
|
-
N,
|
|
3670
|
-
P
|
|
3671
|
-
]), B.useEffect(() => {
|
|
3672
|
-
if (_ && y && be.reference && be.floating) return pa(be.reference, be.floating, we, ve);
|
|
3673
|
-
}, [
|
|
3674
|
-
_,
|
|
3675
|
-
y,
|
|
3676
|
-
be,
|
|
3677
|
-
we,
|
|
3678
|
-
ve
|
|
3679
|
-
]);
|
|
3680
|
-
let Ne = X(Te), Pe = oo(o, Ne, te), Fe = $t(Te) || "center", Ie = !!Ce.hide?.referenceHidden;
|
|
3681
|
-
i(() => {
|
|
3682
|
-
w && y && G && (Ne !== R || ne && Fe !== z) && I(Te);
|
|
3683
|
-
}, [
|
|
3684
|
-
w,
|
|
3685
|
-
ne,
|
|
3686
|
-
y,
|
|
3687
|
-
G,
|
|
3688
|
-
Te,
|
|
3689
|
-
Ne,
|
|
3690
|
-
Fe,
|
|
3691
|
-
R,
|
|
3692
|
-
z
|
|
3693
|
-
]);
|
|
3694
|
-
let Le = B.useMemo(() => ({
|
|
3695
|
-
position: "absolute",
|
|
3696
|
-
top: Ce.arrow?.y,
|
|
3697
|
-
left: Ce.arrow?.x
|
|
3698
|
-
}), [Ce.arrow]), Re = Ce.arrow?.centerOffset !== 0;
|
|
3699
|
-
return B.useMemo(() => ({
|
|
3700
|
-
positionerStyles: je,
|
|
3701
|
-
arrowStyles: Le,
|
|
3702
|
-
arrowRef: U,
|
|
3703
|
-
arrowUncentered: Re,
|
|
3704
|
-
side: Pe,
|
|
3705
|
-
align: Fe,
|
|
3706
|
-
physicalSide: Ne,
|
|
3707
|
-
anchorHidden: Ie,
|
|
3708
|
-
refs: ye,
|
|
3709
|
-
context: Ee,
|
|
3710
|
-
isPositioned: G,
|
|
3711
|
-
update: we
|
|
3712
|
-
}), [
|
|
3713
|
-
je,
|
|
3714
|
-
Le,
|
|
3715
|
-
U,
|
|
3716
|
-
Re,
|
|
3717
|
-
Pe,
|
|
3718
|
-
Fe,
|
|
3719
|
-
Ne,
|
|
3720
|
-
Ie,
|
|
3721
|
-
ye,
|
|
3722
|
-
Ee,
|
|
3723
|
-
G,
|
|
3724
|
-
we
|
|
3725
|
-
]);
|
|
3726
|
-
}
|
|
3727
|
-
function uo(e) {
|
|
3728
|
-
return e != null && "current" in e;
|
|
3729
|
-
}
|
|
3730
|
-
function fo(e) {
|
|
3731
|
-
return e === "starting" ? Qn : a;
|
|
3732
|
-
}
|
|
3733
|
-
function po(e, t, { styles: n, transitionStatus: r, props: i, refs: a, hidden: o, inert: s = !1 }) {
|
|
3734
|
-
let c = { ...n };
|
|
3735
|
-
return s && (c.pointerEvents = "none"), x("div", e, {
|
|
3736
|
-
state: t,
|
|
3737
|
-
ref: a,
|
|
3738
|
-
props: [
|
|
3739
|
-
{
|
|
3740
|
-
role: "presentation",
|
|
3741
|
-
hidden: o,
|
|
3742
|
-
style: c
|
|
3743
|
-
},
|
|
3744
|
-
fo(r),
|
|
3745
|
-
i
|
|
3746
|
-
],
|
|
3747
|
-
stateAttributesMapping: ht
|
|
3748
|
-
});
|
|
3749
|
-
}
|
|
3750
|
-
var mo = /*#__PURE__*/ B.forwardRef(function(e, t) {
|
|
3751
|
-
let { render: n, className: r, anchor: i, positionMethod: a = "absolute", side: o = "top", align: s = "center", sideOffset: c = 0, alignOffset: l = 0, collisionBoundary: u = "clipping-ancestors", collisionPadding: d = 5, arrowPadding: f = 5, sticky: p = !1, disableAnchorTracking: m = !1, collisionAvoidance: h = tr, style: g, ..._ } = e, v = be(), y = Ua(), b = v.useState("open"), x = v.useState("mounted"), S = v.useState("trackCursorAxis"), C = v.useState("disableHoverablePopup"), w = v.useState("floatingRootContext"), T = v.useState("instantType"), E = v.useState("transitionStatus"), D = co({
|
|
3752
|
-
anchor: i,
|
|
3753
|
-
positionMethod: a,
|
|
3754
|
-
floatingRootContext: w,
|
|
3755
|
-
mounted: x,
|
|
3756
|
-
side: o,
|
|
3757
|
-
sideOffset: c,
|
|
3758
|
-
align: s,
|
|
3759
|
-
alignOffset: l,
|
|
3760
|
-
collisionBoundary: u,
|
|
3761
|
-
collisionPadding: d,
|
|
3762
|
-
sticky: p,
|
|
3763
|
-
arrowPadding: f,
|
|
3764
|
-
disableAnchorTracking: m,
|
|
3765
|
-
keepMounted: y,
|
|
3766
|
-
collisionAvoidance: h,
|
|
3767
|
-
adaptiveOrigin: v.useState("adaptiveOrigin")
|
|
3768
|
-
}), O = po(e, B.useMemo(() => ({
|
|
3769
|
-
open: b,
|
|
3770
|
-
side: D.side,
|
|
3771
|
-
align: D.align,
|
|
3772
|
-
anchorHidden: D.anchorHidden,
|
|
3773
|
-
instant: S === "none" ? T : "tracking-cursor"
|
|
3774
|
-
}), [
|
|
3775
|
-
b,
|
|
3776
|
-
D.side,
|
|
3777
|
-
D.align,
|
|
3778
|
-
D.anchorHidden,
|
|
3779
|
-
S,
|
|
3780
|
-
T
|
|
3781
|
-
]), {
|
|
3782
|
-
styles: D.positionerStyles,
|
|
3783
|
-
transitionStatus: E,
|
|
3784
|
-
props: _,
|
|
3785
|
-
refs: [t, v.useStateSetter("positionerElement")],
|
|
3786
|
-
hidden: !x,
|
|
3787
|
-
inert: !b || S === "both" || C
|
|
3788
|
-
});
|
|
3789
|
-
return /*#__PURE__*/ W(Ka.Provider, {
|
|
3790
|
-
value: D,
|
|
3791
|
-
children: O
|
|
3792
|
-
});
|
|
3793
|
-
}), ho = /*#__PURE__*/ B.forwardRef(function(e, t) {
|
|
3794
|
-
let { render: n, className: r, style: i, ...a } = e, o = be(), { side: s, align: c } = qa(), l = o.useState("open"), u = o.useState("instantType"), d = o.useState("transitionStatus"), f = o.useState("popupProps"), p = o.useState("floatingRootContext"), m = o.useState("disabled"), h = o.useState("closeDelay");
|
|
3795
|
-
Ar({
|
|
3796
|
-
open: l,
|
|
3797
|
-
ref: o.context.popupRef,
|
|
3798
|
-
onComplete() {
|
|
3799
|
-
l && o.context.onOpenChangeComplete?.(!0);
|
|
3800
|
-
}
|
|
3801
|
-
}), vi(p, {
|
|
3802
|
-
enabled: !m,
|
|
3803
|
-
closeDelay: h
|
|
3804
|
-
});
|
|
3805
|
-
let g = o.useStateSetter("popupElement");
|
|
3806
|
-
return x("div", e, {
|
|
3807
|
-
state: {
|
|
3808
|
-
open: l,
|
|
3809
|
-
side: s,
|
|
3810
|
-
align: c,
|
|
3811
|
-
instant: u,
|
|
3812
|
-
transitionStatus: d
|
|
3813
|
-
},
|
|
3814
|
-
ref: [
|
|
3815
|
-
t,
|
|
3816
|
-
o.context.popupRef,
|
|
3817
|
-
g
|
|
3818
|
-
],
|
|
3819
|
-
props: [
|
|
3820
|
-
Mr,
|
|
3821
|
-
f,
|
|
3822
|
-
fo(d),
|
|
3823
|
-
a
|
|
3824
|
-
],
|
|
3825
|
-
stateAttributesMapping: gt
|
|
3826
|
-
});
|
|
3827
|
-
}), go = /*#__PURE__*/ B.forwardRef(function(e, t) {
|
|
3828
|
-
let { render: n, className: r, style: i, ...a } = e, o = be(), { arrowRef: s, side: c, align: l, arrowUncentered: u, arrowStyles: d } = qa(), f = {
|
|
3829
|
-
open: o.useState("open"),
|
|
3830
|
-
side: c,
|
|
3831
|
-
align: l,
|
|
3832
|
-
uncentered: u,
|
|
3833
|
-
instant: o.useState("instantType")
|
|
3834
|
-
};
|
|
3835
|
-
return x("div", e, {
|
|
3836
|
-
state: f,
|
|
3837
|
-
ref: [t, s],
|
|
3838
|
-
props: [{
|
|
3839
|
-
style: d,
|
|
3840
|
-
"aria-hidden": !0
|
|
3841
|
-
}, a],
|
|
3842
|
-
stateAttributesMapping: ht
|
|
3843
|
-
});
|
|
3844
|
-
}), _o = function(e) {
|
|
3845
|
-
let { delay: t, closeDelay: n, timeout: r = 400 } = e, i = B.useMemo(() => ({
|
|
3846
|
-
open: t,
|
|
3847
|
-
close: n
|
|
3848
|
-
}), [t, n]);
|
|
3849
|
-
return /*#__PURE__*/ W(La.Provider, {
|
|
3850
|
-
value: t,
|
|
3851
|
-
children: /*#__PURE__*/ W(Nt, {
|
|
3852
|
-
delay: i,
|
|
3853
|
-
timeoutMs: r,
|
|
3854
|
-
children: e.children
|
|
3855
|
-
})
|
|
3856
|
-
});
|
|
3857
|
-
};
|
|
3858
|
-
function vo({ delay: e = 0, ...t }) {
|
|
3859
|
-
return /* @__PURE__ */ W(_o, {
|
|
3860
|
-
"data-slot": "tooltip-provider",
|
|
3861
|
-
delay: e,
|
|
3862
|
-
...t
|
|
3863
|
-
});
|
|
3864
|
-
}
|
|
3865
|
-
var yo = B.createContext(null);
|
|
3866
|
-
function bo({ open: e, defaultOpen: t = !1, disabled: n, onOpenChange: r, ...i }) {
|
|
3867
|
-
let a = B.useId(), [o, s] = B.useState(a), [c, l] = B.useState(t), u = B.useMemo(() => ({
|
|
3868
|
-
id: o,
|
|
3869
|
-
setId: s,
|
|
3870
|
-
open: !n && (e ?? c)
|
|
3871
|
-
}), [
|
|
3872
|
-
o,
|
|
3873
|
-
n,
|
|
3874
|
-
e,
|
|
3875
|
-
c
|
|
3876
|
-
]);
|
|
3877
|
-
return /* @__PURE__ */ W(yo.Provider, {
|
|
3878
|
-
value: u,
|
|
3879
|
-
children: /* @__PURE__ */ W(Fa, {
|
|
3880
|
-
"data-slot": "tooltip",
|
|
3881
|
-
open: e,
|
|
3882
|
-
defaultOpen: t,
|
|
3883
|
-
disabled: n,
|
|
3884
|
-
onOpenChange: (e, t) => {
|
|
3885
|
-
r?.(e, t), t.isCanceled || l(e);
|
|
3886
|
-
},
|
|
3887
|
-
...i
|
|
3888
|
-
})
|
|
3889
|
-
});
|
|
3890
|
-
}
|
|
3891
|
-
var xo = B.forwardRef(function({ "aria-describedby": e, ...t }, n) {
|
|
3892
|
-
let r = B.useCallback((e) => {
|
|
3893
|
-
if (typeof n == "function") return n(e);
|
|
3894
|
-
n && (n.current = e);
|
|
3895
|
-
}, [n]), i = B.useContext(yo), a = [e, i?.open ? i.id : void 0].filter(Boolean).join(" ") || void 0;
|
|
3896
|
-
return /* @__PURE__ */ W(Va, {
|
|
3897
|
-
ref: r,
|
|
3898
|
-
"data-slot": "tooltip-trigger",
|
|
3899
|
-
"aria-describedby": a,
|
|
3900
|
-
...t
|
|
3901
|
-
});
|
|
3902
|
-
});
|
|
3903
|
-
xo.displayName = "TooltipTrigger";
|
|
3904
|
-
var So = B.forwardRef(function({ className: e, id: t, side: n = "top", sideOffset: r = 4, align: i = "center", alignOffset: a = 0, children: o, ...s }, c) {
|
|
3905
|
-
let l = ae(), u = B.useContext(yo), d = B.useId(), f = t ?? u?.id ?? d, p = u?.setId;
|
|
3906
|
-
return B.useEffect(() => {
|
|
3907
|
-
p?.(t ?? d);
|
|
3908
|
-
}, [
|
|
3909
|
-
t,
|
|
3910
|
-
d,
|
|
3911
|
-
p
|
|
3912
|
-
]), /* @__PURE__ */ W(Ga, {
|
|
3913
|
-
container: l ?? void 0,
|
|
3914
|
-
children: /* @__PURE__ */ W(mo, {
|
|
3915
|
-
align: i,
|
|
3916
|
-
alignOffset: a,
|
|
3917
|
-
side: n,
|
|
3918
|
-
sideOffset: r,
|
|
3919
|
-
className: "ck-tooltip-positioner",
|
|
3920
|
-
children: /* @__PURE__ */ ue(ho, {
|
|
3921
|
-
ref: c,
|
|
3922
|
-
"data-slot": "tooltip-content",
|
|
3923
|
-
id: f,
|
|
3924
|
-
role: "tooltip",
|
|
3925
|
-
className: S("ck-tooltip-content", e),
|
|
3926
|
-
...s,
|
|
3927
|
-
children: [o, /* @__PURE__ */ W(go, { className: "ck-tooltip-arrow" })]
|
|
3928
|
-
})
|
|
3929
|
-
})
|
|
3930
|
-
});
|
|
3931
|
-
});
|
|
3932
|
-
So.displayName = "TooltipContent";
|
|
3933
|
-
var Co = /*#__PURE__*/ B.forwardRef(function(e, t) {
|
|
3934
|
-
let { className: n, render: r, orientation: i = "horizontal", style: a, ...o } = e;
|
|
3935
|
-
return x("div", e, {
|
|
3936
|
-
state: { orientation: i },
|
|
3937
|
-
ref: t,
|
|
3938
|
-
props: [{
|
|
3939
|
-
role: "separator",
|
|
3940
|
-
"aria-orientation": i
|
|
3941
|
-
}, o]
|
|
3942
|
-
});
|
|
3943
|
-
}), wo = B.forwardRef(function({ className: e, orientation: t = "horizontal", ...n }, r) {
|
|
3944
|
-
return /* @__PURE__ */ W(Co, {
|
|
3945
|
-
ref: r,
|
|
3946
|
-
"data-slot": "separator",
|
|
3947
|
-
orientation: t,
|
|
3948
|
-
"data-horizontal": t === "horizontal" ? "" : void 0,
|
|
3949
|
-
"data-vertical": t === "vertical" ? "" : void 0,
|
|
3950
|
-
className: S("ck-separator", e),
|
|
3951
|
-
...n
|
|
3952
|
-
});
|
|
3953
|
-
});
|
|
3954
|
-
wo.displayName = "Separator";
|
|
3955
|
-
export { er as $, K as $t, Ur as A, St as At, Tr as B, nt as Bt, Mr as C, Y as Ct, Nr as D, Ft as Dt, zr as E, J as Et, Lr as F, gt as Ft, gr as G, Ze as Gt, Cr as H, tt as Ht, jr as I, mt as It, pr as J, Ke as Jt, mr as K, Xe as Kt, Ar as L, pt as Lt, Pr as M, xt as Mt, Gr as N, wt as Nt, Rr as O, q as Ot, Vr as P, ht as Pt, $n as Q, He as Qt, kr as R, ot as Rt, Kr as S, Ut as St, Br as T, Bt as Tt, _r as U, rt as Ut, wr as V, it as Vt, hr as W, et as Wt, sr as X, Je as Xt, lr as Y, qe as Yt, ir as Z, Ve as Zt, ri as _, vn as _t, vo as a, Pe as an, Un as at, ei as b, Wt as bt, fo as c, je as cn, Kn as ct, ua as d, ke as dn, Q as dt, Ue as en, tr as et, Di as f, ge as fn, Sn as ft, ui as g, Tn as gt, fi as h, xn as ht, So as i, Fe as in, Bn as it, Wr as j, Ct as jt, Hr as k, Tt as kt, co as l, Oe as ln, zn as lt, vi as m, yn as mt, Co as n, Le as nn, Xn as nt, xo as o, Ne as on, Wn as ot, bi as p, _e as pn, bn as pt, fr as q, Ye as qt, bo as r, Re as rn, Yn as rt, po as s, Me as sn, Gn as st, wo as t, ze as tn, Zn as tt, Wa as u, G as un, Vn as ut, li as v, Cn as vt, Fr as w, zt as wt, U as x, Ht as xt, ni as y, gn as yt, Er as z, st as zt };
|