@forsyteco/product-ui 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{active-element-history-BJ1HYFpN.mjs → active-element-history-B7wA4w4L.mjs} +3 -3
- package/dist/autocomplete/autocomplete.d.ts +87 -0
- package/dist/autocomplete/autocomplete.d.ts.map +1 -0
- package/dist/autocomplete/index.cjs +1 -0
- package/dist/autocomplete/index.d.ts +4 -0
- package/dist/autocomplete/index.d.ts.map +1 -0
- package/dist/autocomplete/index.mjs +4 -0
- package/dist/autocomplete/types.d.ts +7 -0
- package/dist/autocomplete/types.d.ts.map +1 -0
- package/dist/autocomplete-DqDP76nV.mjs +318 -0
- package/dist/autocomplete-DuGKfbQn.js +1 -0
- package/dist/avatar/index.mjs +1 -1
- package/dist/{avatar-CN9vtSKm.mjs → avatar-Br4ih6PQ.mjs} +2 -2
- package/dist/breadcrumb/index.cjs +1 -1
- package/dist/breadcrumb/index.mjs +1 -1
- package/dist/{breadcrumb-Bz_JVFcb.mjs → breadcrumb-C81R8CJz.mjs} +2 -2
- package/dist/{breadcrumb-y_RB72EG.js → breadcrumb-DJGlCCR1.js} +1 -1
- package/dist/{bugs-bn44RJ1Q.mjs → bugs-g7aYPtcD.mjs} +1 -1
- package/dist/calendar/calendar.d.ts.map +1 -1
- package/dist/calendar/index.cjs +1 -1
- package/dist/calendar/index.mjs +1 -1
- package/dist/{calendar-CAySGYDy.mjs → calendar-DQdo9vO-.mjs} +1058 -993
- package/dist/calendar-v2NOtsdr.js +1 -0
- package/dist/chevron-right-CIgI-iLu.js +1 -0
- package/dist/{chevron-right-DcjcIxI2.mjs → chevron-right-Ck5BtE5n.mjs} +11 -6
- package/dist/combobox/combobox.d.ts +72 -17
- package/dist/combobox/combobox.d.ts.map +1 -1
- package/dist/combobox/index.cjs +1 -1
- package/dist/combobox/index.d.ts +2 -1
- package/dist/combobox/index.d.ts.map +1 -1
- package/dist/combobox/index.mjs +1 -1
- package/dist/combobox/types.d.ts +7 -0
- package/dist/combobox/types.d.ts.map +1 -0
- package/dist/combobox-B1h2hn6a.js +4 -0
- package/dist/combobox-BHLjk9D9.mjs +293 -0
- package/dist/combobox-DxpuSWuM.js +1 -0
- package/dist/{combobox-Dyen_KC6.mjs → combobox-Umb1ZW9S.mjs} +358 -408
- package/dist/data-table/components/table-body.d.ts.map +1 -1
- package/dist/date-picker/date-picker.d.ts.map +1 -1
- package/dist/{description-CAH1nOgr.mjs → description-hiFZ303Y.mjs} +2 -2
- package/dist/dialog/index.mjs +1 -1
- package/dist/{dialog-nGcnK6o1.mjs → dialog-Cs7TMa7R.mjs} +53 -53
- package/dist/disclosure/index.cjs +1 -1
- package/dist/disclosure/index.mjs +1 -1
- package/dist/{disclosure-CA45jH3I.mjs → disclosure-DOWglOHy.mjs} +8 -12
- package/dist/{disclosure-CGxPdR-8.js → disclosure-qEQ_kll8.js} +1 -1
- package/dist/dropdown-menu/index.cjs +1 -1
- package/dist/dropdown-menu/index.mjs +1 -1
- package/dist/{dropdown-menu-Bj9ftuBZ.mjs → dropdown-menu--aGYYbJi.mjs} +22 -30
- package/dist/dropdown-menu-B9fTvSZe.js +1 -0
- package/dist/{element-movement-B3AVr940.mjs → element-movement-Bad2OqSj.mjs} +4 -4
- package/dist/floating-C1n3e5u7.js +1 -0
- package/dist/{floating-dEgEvBqv.mjs → floating-DQ2M2ViQ.mjs} +429 -425
- package/dist/{focus-management-DUVCz_zm.mjs → focus-management-BGuC9pKE.mjs} +2 -2
- package/dist/{form-fields-CXtJvVC5.mjs → form-fields-Bpp9kTvo.mjs} +2 -2
- package/dist/{frozen-Cpa22rmr.mjs → frozen-CXF36eio.mjs} +2 -2
- package/dist/{hidden-Blo8kfIB.mjs → hidden-H5tOTsXH.mjs} +1 -1
- package/dist/{index-CuNisU0H.mjs → index-Dh75VhI6.mjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +769 -776
- package/dist/{keyboard-Bi11Rnr0.mjs → keyboard-BzaAKRwG.mjs} +1 -1
- package/dist/{label-DAaE-vxI.mjs → label--pGndX3z.mjs} +3 -3
- package/dist/listbox/index.cjs +1 -1
- package/dist/listbox/index.mjs +1 -1
- package/dist/{listbox-DZ4v8TYt.mjs → listbox-3DAgC6_y.mjs} +17 -21
- package/dist/{listbox-BIwbzCji.js → listbox-cpJossI7.js} +1 -1
- package/dist/{open-closed-BkH8ZC7H.mjs → open-closed-Be5nD5U2.mjs} +4 -4
- package/dist/popover/index.cjs +1 -1
- package/dist/popover/index.mjs +1 -1
- package/dist/{popover-BAm_8SCx.mjs → popover-CZO6Afya.mjs} +22 -22
- package/dist/{popover-B5-dVDC1.js → popover-CysmX396.js} +1 -1
- package/dist/{portal-BaBdcS83.mjs → portal-D-TZOwvF.mjs} +6 -6
- package/dist/radio-group/index.cjs +1 -1
- package/dist/radio-group/index.mjs +1 -1
- package/dist/{radio-group-CTf6mrDs.mjs → radio-group-BIQWXrVI.mjs} +8 -8
- package/dist/{radio-group-d2V69c7t.js → radio-group-CbQAsBFv.js} +1 -1
- package/dist/sonner/index.cjs +1 -1
- package/dist/sonner/index.mjs +1 -1
- package/dist/{sonner-CuPfwlK5.js → sonner-BRjN2nJD.js} +1 -1
- package/dist/{sonner-Ce9PJbum.mjs → sonner-Cgc0p6ph.mjs} +3 -5
- package/dist/switch/index.cjs +1 -1
- package/dist/switch/index.mjs +1 -1
- package/dist/{switch-DqAuXwa2.js → switch-D0OrcI50.js} +1 -1
- package/dist/{switch-DKcD0IFH.mjs → switch-Eoi1pTsi.mjs} +13 -13
- package/dist/tabs/index.cjs +1 -1
- package/dist/tabs/index.mjs +1 -1
- package/dist/{tabs-DLqfQ301.mjs → tabs-Cufnu60W.mjs} +15 -15
- package/dist/{tabs-X4sPQQYs.js → tabs-TTkcVq-Q.js} +1 -1
- package/dist/transition/index.mjs +1 -1
- package/dist/{transition-B0MGuDho.mjs → transition-B4KhhkrB.mjs} +4 -4
- package/dist/{transition-D0HuUd2-.mjs → transition-Dfxdl8Si.mjs} +1 -1
- package/dist/{use-event-listener-BjXsgSkG.mjs → use-event-listener-BUA2xXRr.mjs} +1 -1
- package/dist/{use-inert-others-BCB16FKE.mjs → use-inert-others-CgSXXC-d.mjs} +3 -3
- package/dist/{use-is-mounted-COmayWN0.mjs → use-is-mounted-DJc35WXO.mjs} +1 -1
- package/dist/{use-resolve-button-type-637wy6MK.mjs → use-resolve-button-type-BhmWA6Dl.mjs} +2 -2
- package/dist/{use-sync-refs-B0fmGxD4.mjs → use-sync-refs-CDCE8QtA.mjs} +2 -2
- package/dist/{use-tab-direction-BTonGsg0.mjs → use-tab-direction-tJsn3ckX.mjs} +8 -8
- package/dist/{use-text-value-BMXU9EaO.mjs → use-text-value-BKEvykNe.mjs} +2 -2
- package/dist/{use-tree-walker-D25YXIMY.mjs → use-tree-walker-CHC6ccbq.mjs} +2 -2
- package/dist/useFocusRing-BM96K_1O.js +1 -0
- package/dist/useFocusRing-Df1NuOsX.mjs +497 -0
- package/package.json +32 -22
- package/dist/calendar-BIhWkTtG.js +0 -1
- package/dist/chevron-right-HwlOajQy.js +0 -1
- package/dist/combobox-Cm_xVD4l.js +0 -4
- package/dist/dropdown-menu-BPMdVlet.js +0 -1
- package/dist/floating-CTjRm9bt.js +0 -1
- package/dist/useFocusRing-Bocdsy5M.mjs +0 -446
- package/dist/useFocusRing-uXUSOfAR.js +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { useState as et, useLayoutEffect as
|
|
3
|
-
import { n as lt, o as be, a as
|
|
1
|
+
import * as v from "react";
|
|
2
|
+
import { useState as et, useLayoutEffect as Qt, useEffect as xe, useRef as ve, useMemo as nt, useContext as ot, useCallback as ye, createContext as Zt } from "react";
|
|
3
|
+
import { n as lt, o as be, a as te, p as Re } from "./use-sync-refs-CDCE8QtA.mjs";
|
|
4
4
|
import * as dt from "react-dom";
|
|
5
|
-
import { n as Ce } from "./keyboard-
|
|
6
|
-
function
|
|
5
|
+
import { n as Ce } from "./keyboard-BzaAKRwG.mjs";
|
|
6
|
+
function Nt(t) {
|
|
7
7
|
if (t === null) return { width: 0, height: 0 };
|
|
8
8
|
let { width: e, height: o } = t.getBoundingClientRect();
|
|
9
9
|
return { width: e, height: o };
|
|
10
10
|
}
|
|
11
11
|
function Jn(t, e, o = !1) {
|
|
12
|
-
let [n, r] = et(() =>
|
|
12
|
+
let [n, r] = et(() => Nt(e));
|
|
13
13
|
return lt(() => {
|
|
14
14
|
if (!e || !t) return;
|
|
15
15
|
let i = be();
|
|
16
16
|
return i.requestAnimationFrame(function s() {
|
|
17
17
|
i.requestAnimationFrame(s), r((l) => {
|
|
18
|
-
let
|
|
19
|
-
return
|
|
18
|
+
let c = Nt(e);
|
|
19
|
+
return c.width === l.width && c.height === l.height ? l : c;
|
|
20
20
|
});
|
|
21
21
|
}), () => {
|
|
22
22
|
i.dispose();
|
|
@@ -27,7 +27,7 @@ function pt() {
|
|
|
27
27
|
return typeof window < "u";
|
|
28
28
|
}
|
|
29
29
|
function Q(t) {
|
|
30
|
-
return
|
|
30
|
+
return ee(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
31
31
|
}
|
|
32
32
|
function B(t) {
|
|
33
33
|
var e;
|
|
@@ -35,9 +35,9 @@ function B(t) {
|
|
|
35
35
|
}
|
|
36
36
|
function j(t) {
|
|
37
37
|
var e;
|
|
38
|
-
return (e = (
|
|
38
|
+
return (e = (ee(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function ee(t) {
|
|
41
41
|
return pt() ? t instanceof Node || t instanceof B(t).Node : !1;
|
|
42
42
|
}
|
|
43
43
|
function L(t) {
|
|
@@ -46,7 +46,7 @@ function L(t) {
|
|
|
46
46
|
function _(t) {
|
|
47
47
|
return pt() ? t instanceof HTMLElement || t instanceof B(t).HTMLElement : !1;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function $t(t) {
|
|
50
50
|
return !pt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof B(t).ShadowRoot;
|
|
51
51
|
}
|
|
52
52
|
const Se = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
@@ -60,12 +60,12 @@ function ct(t) {
|
|
|
60
60
|
return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !Se.has(r);
|
|
61
61
|
}
|
|
62
62
|
const Ae = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
63
|
-
function
|
|
63
|
+
function Oe(t) {
|
|
64
64
|
return Ae.has(Q(t));
|
|
65
65
|
}
|
|
66
|
-
const
|
|
66
|
+
const Ee = [":popover-open", ":modal"];
|
|
67
67
|
function wt(t) {
|
|
68
|
-
return
|
|
68
|
+
return Ee.some((e) => {
|
|
69
69
|
try {
|
|
70
70
|
return t.matches(e);
|
|
71
71
|
} catch {
|
|
@@ -74,14 +74,14 @@ function wt(t) {
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
const Te = ["transform", "translate", "scale", "rotate", "perspective"], Fe = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Me = ["paint", "layout", "strict", "content"];
|
|
77
|
-
function
|
|
78
|
-
const e =
|
|
77
|
+
function Ft(t) {
|
|
78
|
+
const e = Mt(), o = L(t) ? W(t) : t;
|
|
79
79
|
return Te.some((n) => o[n] ? o[n] !== "none" : !1) || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || Fe.some((n) => (o.willChange || "").includes(n)) || Me.some((n) => (o.contain || "").includes(n));
|
|
80
80
|
}
|
|
81
81
|
function Pe(t) {
|
|
82
82
|
let e = q(t);
|
|
83
83
|
for (; _(e) && !J(e); ) {
|
|
84
|
-
if (
|
|
84
|
+
if (Ft(e))
|
|
85
85
|
return e;
|
|
86
86
|
if (wt(e))
|
|
87
87
|
return null;
|
|
@@ -89,7 +89,7 @@ function Pe(t) {
|
|
|
89
89
|
}
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Mt() {
|
|
93
93
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
94
94
|
}
|
|
95
95
|
const De = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
@@ -115,19 +115,19 @@ function q(t) {
|
|
|
115
115
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
116
116
|
t.assignedSlot || // DOM Element detected.
|
|
117
117
|
t.parentNode || // ShadowRoot detected.
|
|
118
|
-
|
|
118
|
+
$t(t) && t.host || // Fallback.
|
|
119
119
|
j(t)
|
|
120
120
|
);
|
|
121
|
-
return
|
|
121
|
+
return $t(e) ? e.host : e;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function ne(t) {
|
|
124
124
|
const e = q(t);
|
|
125
|
-
return J(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : _(e) && ct(e) ? e :
|
|
125
|
+
return J(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : _(e) && ct(e) ? e : ne(e);
|
|
126
126
|
}
|
|
127
127
|
function rt(t, e, o) {
|
|
128
128
|
var n;
|
|
129
129
|
e === void 0 && (e = []), o === void 0 && (o = !0);
|
|
130
|
-
const r =
|
|
130
|
+
const r = ne(t), i = r === ((n = t.ownerDocument) == null ? void 0 : n.body), s = B(r);
|
|
131
131
|
if (i) {
|
|
132
132
|
const l = Ot(s);
|
|
133
133
|
return e.concat(s, s.visualViewport || [], ct(r) ? r : [], l && o ? rt(l) : []);
|
|
@@ -159,7 +159,7 @@ const X = Math.min, D = Math.max, it = Math.round, at = Math.floor, k = (t) => (
|
|
|
159
159
|
start: "end",
|
|
160
160
|
end: "start"
|
|
161
161
|
};
|
|
162
|
-
function
|
|
162
|
+
function It(t, e, o) {
|
|
163
163
|
return D(t, X(e, o));
|
|
164
164
|
}
|
|
165
165
|
function Z(t, e) {
|
|
@@ -171,38 +171,38 @@ function U(t) {
|
|
|
171
171
|
function ft(t) {
|
|
172
172
|
return t.split("-")[1];
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function oe(t) {
|
|
175
175
|
return t === "x" ? "y" : "x";
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function re(t) {
|
|
178
178
|
return t === "y" ? "height" : "width";
|
|
179
179
|
}
|
|
180
180
|
const $e = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
181
181
|
function Y(t) {
|
|
182
182
|
return $e.has(U(t)) ? "y" : "x";
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
return
|
|
184
|
+
function ie(t) {
|
|
185
|
+
return oe(Y(t));
|
|
186
186
|
}
|
|
187
187
|
function Ie(t, e, o) {
|
|
188
188
|
o === void 0 && (o = !1);
|
|
189
|
-
const n = ft(t), r =
|
|
189
|
+
const n = ft(t), r = ie(t), i = re(r);
|
|
190
190
|
let s = r === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
191
191
|
return e.reference[i] > e.floating[i] && (s = mt(s)), [s, mt(s)];
|
|
192
192
|
}
|
|
193
193
|
function Be(t) {
|
|
194
194
|
const e = mt(t);
|
|
195
|
-
return [
|
|
195
|
+
return [Et(t), e, Et(e)];
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function Et(t) {
|
|
198
198
|
return t.replace(/start|end/g, (e) => Ne[e]);
|
|
199
199
|
}
|
|
200
|
-
const
|
|
200
|
+
const Bt = ["left", "right"], Vt = ["right", "left"], Ve = ["top", "bottom"], We = ["bottom", "top"];
|
|
201
201
|
function ke(t, e, o) {
|
|
202
202
|
switch (t) {
|
|
203
203
|
case "top":
|
|
204
204
|
case "bottom":
|
|
205
|
-
return o ? e ?
|
|
205
|
+
return o ? e ? Vt : Bt : e ? Bt : Vt;
|
|
206
206
|
case "left":
|
|
207
207
|
case "right":
|
|
208
208
|
return e ? Ve : We;
|
|
@@ -213,7 +213,7 @@ function ke(t, e, o) {
|
|
|
213
213
|
function _e(t, e, o, n) {
|
|
214
214
|
const r = ft(t);
|
|
215
215
|
let i = ke(U(t), o === "start", n);
|
|
216
|
-
return r && (i = i.map((s) => s + "-" + r), e && (i = i.concat(i.map(
|
|
216
|
+
return r && (i = i.map((s) => s + "-" + r), e && (i = i.concat(i.map(Et)))), i;
|
|
217
217
|
}
|
|
218
218
|
function mt(t) {
|
|
219
219
|
return t.replace(/left|right|bottom|top/g, (e) => He[e]);
|
|
@@ -253,53 +253,98 @@ function gt(t) {
|
|
|
253
253
|
y: o
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function Wt(t, e, o) {
|
|
257
257
|
let {
|
|
258
258
|
reference: n,
|
|
259
259
|
floating: r
|
|
260
260
|
} = t;
|
|
261
|
-
const i = Y(e), s =
|
|
262
|
-
let
|
|
263
|
-
switch (
|
|
261
|
+
const i = Y(e), s = ie(e), l = re(s), c = U(e), a = i === "y", u = n.x + n.width / 2 - r.width / 2, m = n.y + n.height / 2 - r.height / 2, g = n[l] / 2 - r[l] / 2;
|
|
262
|
+
let f;
|
|
263
|
+
switch (c) {
|
|
264
264
|
case "top":
|
|
265
|
-
|
|
265
|
+
f = {
|
|
266
266
|
x: u,
|
|
267
267
|
y: n.y - r.height
|
|
268
268
|
};
|
|
269
269
|
break;
|
|
270
270
|
case "bottom":
|
|
271
|
-
|
|
271
|
+
f = {
|
|
272
272
|
x: u,
|
|
273
273
|
y: n.y + n.height
|
|
274
274
|
};
|
|
275
275
|
break;
|
|
276
276
|
case "right":
|
|
277
|
-
|
|
277
|
+
f = {
|
|
278
278
|
x: n.x + n.width,
|
|
279
279
|
y: m
|
|
280
280
|
};
|
|
281
281
|
break;
|
|
282
282
|
case "left":
|
|
283
|
-
|
|
283
|
+
f = {
|
|
284
284
|
x: n.x - r.width,
|
|
285
285
|
y: m
|
|
286
286
|
};
|
|
287
287
|
break;
|
|
288
288
|
default:
|
|
289
|
-
|
|
289
|
+
f = {
|
|
290
290
|
x: n.x,
|
|
291
291
|
y: n.y
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
294
|
switch (ft(e)) {
|
|
295
295
|
case "start":
|
|
296
|
-
|
|
296
|
+
f[s] -= g * (o && a ? -1 : 1);
|
|
297
297
|
break;
|
|
298
298
|
case "end":
|
|
299
|
-
|
|
299
|
+
f[s] += g * (o && a ? -1 : 1);
|
|
300
300
|
break;
|
|
301
301
|
}
|
|
302
|
-
return
|
|
302
|
+
return f;
|
|
303
|
+
}
|
|
304
|
+
async function se(t, e) {
|
|
305
|
+
var o;
|
|
306
|
+
e === void 0 && (e = {});
|
|
307
|
+
const {
|
|
308
|
+
x: n,
|
|
309
|
+
y: r,
|
|
310
|
+
platform: i,
|
|
311
|
+
rects: s,
|
|
312
|
+
elements: l,
|
|
313
|
+
strategy: c
|
|
314
|
+
} = t, {
|
|
315
|
+
boundary: a = "clippingAncestors",
|
|
316
|
+
rootBoundary: u = "viewport",
|
|
317
|
+
elementContext: m = "floating",
|
|
318
|
+
altBoundary: g = !1,
|
|
319
|
+
padding: f = 0
|
|
320
|
+
} = Z(e, t), d = ze(f), p = l[g ? m === "floating" ? "reference" : "floating" : m], x = gt(await i.getClippingRect({
|
|
321
|
+
element: (o = await (i.isElement == null ? void 0 : i.isElement(p))) == null || o ? p : p.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(l.floating)),
|
|
322
|
+
boundary: a,
|
|
323
|
+
rootBoundary: u,
|
|
324
|
+
strategy: c
|
|
325
|
+
})), y = m === "floating" ? {
|
|
326
|
+
x: n,
|
|
327
|
+
y: r,
|
|
328
|
+
width: s.floating.width,
|
|
329
|
+
height: s.floating.height
|
|
330
|
+
} : s.reference, w = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l.floating)), b = await (i.isElement == null ? void 0 : i.isElement(w)) ? await (i.getScale == null ? void 0 : i.getScale(w)) || {
|
|
331
|
+
x: 1,
|
|
332
|
+
y: 1
|
|
333
|
+
} : {
|
|
334
|
+
x: 1,
|
|
335
|
+
y: 1
|
|
336
|
+
}, R = gt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
337
|
+
elements: l,
|
|
338
|
+
rect: y,
|
|
339
|
+
offsetParent: w,
|
|
340
|
+
strategy: c
|
|
341
|
+
}) : y);
|
|
342
|
+
return {
|
|
343
|
+
top: (x.top - R.top + d.top) / b.y,
|
|
344
|
+
bottom: (R.bottom - x.bottom + d.bottom) / b.y,
|
|
345
|
+
left: (x.left - R.left + d.left) / b.x,
|
|
346
|
+
right: (R.right - x.right + d.right) / b.x
|
|
347
|
+
};
|
|
303
348
|
}
|
|
304
349
|
const Ye = async (t, e, o) => {
|
|
305
350
|
const {
|
|
@@ -307,7 +352,7 @@ const Ye = async (t, e, o) => {
|
|
|
307
352
|
strategy: r = "absolute",
|
|
308
353
|
middleware: i = [],
|
|
309
354
|
platform: s
|
|
310
|
-
} = o, l = i.filter(Boolean),
|
|
355
|
+
} = o, l = i.filter(Boolean), c = await (s.isRTL == null ? void 0 : s.isRTL(e));
|
|
311
356
|
let a = await s.getElementRects({
|
|
312
357
|
reference: t,
|
|
313
358
|
floating: e,
|
|
@@ -315,99 +360,57 @@ const Ye = async (t, e, o) => {
|
|
|
315
360
|
}), {
|
|
316
361
|
x: u,
|
|
317
362
|
y: m
|
|
318
|
-
} =
|
|
319
|
-
for (let
|
|
363
|
+
} = Wt(a, n, c), g = n, f = {}, d = 0;
|
|
364
|
+
for (let p = 0; p < l.length; p++) {
|
|
365
|
+
var h;
|
|
320
366
|
const {
|
|
321
|
-
name:
|
|
322
|
-
fn:
|
|
323
|
-
} = l[
|
|
324
|
-
x:
|
|
325
|
-
y:
|
|
326
|
-
data:
|
|
327
|
-
reset:
|
|
328
|
-
} = await
|
|
367
|
+
name: x,
|
|
368
|
+
fn: y
|
|
369
|
+
} = l[p], {
|
|
370
|
+
x: w,
|
|
371
|
+
y: b,
|
|
372
|
+
data: R,
|
|
373
|
+
reset: C
|
|
374
|
+
} = await y({
|
|
329
375
|
x: u,
|
|
330
376
|
y: m,
|
|
331
377
|
initialPlacement: n,
|
|
332
378
|
placement: g,
|
|
333
379
|
strategy: r,
|
|
334
|
-
middlewareData:
|
|
380
|
+
middlewareData: f,
|
|
335
381
|
rects: a,
|
|
336
|
-
platform:
|
|
382
|
+
platform: {
|
|
383
|
+
...s,
|
|
384
|
+
detectOverflow: (h = s.detectOverflow) != null ? h : se
|
|
385
|
+
},
|
|
337
386
|
elements: {
|
|
338
387
|
reference: t,
|
|
339
388
|
floating: e
|
|
340
389
|
}
|
|
341
390
|
});
|
|
342
|
-
u =
|
|
343
|
-
...
|
|
344
|
-
[
|
|
345
|
-
...
|
|
346
|
-
...
|
|
391
|
+
u = w ?? u, m = b ?? m, f = {
|
|
392
|
+
...f,
|
|
393
|
+
[x]: {
|
|
394
|
+
...f[x],
|
|
395
|
+
...R
|
|
347
396
|
}
|
|
348
|
-
},
|
|
397
|
+
}, C && d <= 50 && (d++, typeof C == "object" && (C.placement && (g = C.placement), C.rects && (a = C.rects === !0 ? await s.getElementRects({
|
|
349
398
|
reference: t,
|
|
350
399
|
floating: e,
|
|
351
400
|
strategy: r
|
|
352
|
-
}) :
|
|
401
|
+
}) : C.rects), {
|
|
353
402
|
x: u,
|
|
354
403
|
y: m
|
|
355
|
-
} =
|
|
404
|
+
} = Wt(a, g, c)), p = -1);
|
|
356
405
|
}
|
|
357
406
|
return {
|
|
358
407
|
x: u,
|
|
359
408
|
y: m,
|
|
360
409
|
placement: g,
|
|
361
410
|
strategy: r,
|
|
362
|
-
middlewareData:
|
|
411
|
+
middlewareData: f
|
|
363
412
|
};
|
|
364
|
-
}
|
|
365
|
-
async function vt(t, e) {
|
|
366
|
-
var o;
|
|
367
|
-
e === void 0 && (e = {});
|
|
368
|
-
const {
|
|
369
|
-
x: n,
|
|
370
|
-
y: r,
|
|
371
|
-
platform: i,
|
|
372
|
-
rects: s,
|
|
373
|
-
elements: l,
|
|
374
|
-
strategy: f
|
|
375
|
-
} = t, {
|
|
376
|
-
boundary: a = "clippingAncestors",
|
|
377
|
-
rootBoundary: u = "viewport",
|
|
378
|
-
elementContext: m = "floating",
|
|
379
|
-
altBoundary: g = !1,
|
|
380
|
-
padding: c = 0
|
|
381
|
-
} = Z(e, t), d = ze(c), p = l[g ? m === "floating" ? "reference" : "floating" : m], v = gt(await i.getClippingRect({
|
|
382
|
-
element: (o = await (i.isElement == null ? void 0 : i.isElement(p))) == null || o ? p : p.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(l.floating)),
|
|
383
|
-
boundary: a,
|
|
384
|
-
rootBoundary: u,
|
|
385
|
-
strategy: f
|
|
386
|
-
})), y = m === "floating" ? {
|
|
387
|
-
x: n,
|
|
388
|
-
y: r,
|
|
389
|
-
width: s.floating.width,
|
|
390
|
-
height: s.floating.height
|
|
391
|
-
} : s.reference, w = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l.floating)), b = await (i.isElement == null ? void 0 : i.isElement(w)) ? await (i.getScale == null ? void 0 : i.getScale(w)) || {
|
|
392
|
-
x: 1,
|
|
393
|
-
y: 1
|
|
394
|
-
} : {
|
|
395
|
-
x: 1,
|
|
396
|
-
y: 1
|
|
397
|
-
}, R = gt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
398
|
-
elements: l,
|
|
399
|
-
rect: y,
|
|
400
|
-
offsetParent: w,
|
|
401
|
-
strategy: f
|
|
402
|
-
}) : y);
|
|
403
|
-
return {
|
|
404
|
-
top: (v.top - R.top + d.top) / b.y,
|
|
405
|
-
bottom: (R.bottom - v.bottom + d.bottom) / b.y,
|
|
406
|
-
left: (v.left - R.left + d.left) / b.x,
|
|
407
|
-
right: (R.right - v.right + d.right) / b.x
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
const qe = function(t) {
|
|
413
|
+
}, qe = function(t) {
|
|
411
414
|
return t === void 0 && (t = {}), {
|
|
412
415
|
name: "flip",
|
|
413
416
|
options: t,
|
|
@@ -418,24 +421,24 @@ const qe = function(t) {
|
|
|
418
421
|
middlewareData: i,
|
|
419
422
|
rects: s,
|
|
420
423
|
initialPlacement: l,
|
|
421
|
-
platform:
|
|
424
|
+
platform: c,
|
|
422
425
|
elements: a
|
|
423
426
|
} = e, {
|
|
424
427
|
mainAxis: u = !0,
|
|
425
428
|
crossAxis: m = !0,
|
|
426
429
|
fallbackPlacements: g,
|
|
427
|
-
fallbackStrategy:
|
|
430
|
+
fallbackStrategy: f = "bestFit",
|
|
428
431
|
fallbackAxisSideDirection: d = "none",
|
|
429
432
|
flipAlignment: h = !0,
|
|
430
433
|
...p
|
|
431
434
|
} = Z(t, e);
|
|
432
435
|
if ((o = i.arrow) != null && o.alignmentOffset)
|
|
433
436
|
return {};
|
|
434
|
-
const
|
|
435
|
-
!g &&
|
|
436
|
-
const A = [l, ...R], H = await
|
|
437
|
+
const x = U(r), y = Y(l), w = U(l) === l, b = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), R = g || (w || !h ? [mt(l)] : Be(l)), C = d !== "none";
|
|
438
|
+
!g && C && R.push(..._e(l, h, d, b));
|
|
439
|
+
const A = [l, ...R], H = await c.detectOverflow(e, p), V = [];
|
|
437
440
|
let T = ((n = i.flip) == null ? void 0 : n.overflows) || [];
|
|
438
|
-
if (u && V.push(H[
|
|
441
|
+
if (u && V.push(H[x]), m) {
|
|
439
442
|
const F = Ie(r, s, b);
|
|
440
443
|
V.push(H[F[0]], H[F[1]]);
|
|
441
444
|
}
|
|
@@ -443,11 +446,11 @@ const qe = function(t) {
|
|
|
443
446
|
placement: r,
|
|
444
447
|
overflows: V
|
|
445
448
|
}], !V.every((F) => F <= 0)) {
|
|
446
|
-
var
|
|
447
|
-
const F = (((
|
|
449
|
+
var E, $;
|
|
450
|
+
const F = (((E = i.flip) == null ? void 0 : E.index) || 0) + 1, z = A[F];
|
|
448
451
|
if (z && (!(m === "alignment" ? y !== Y(z) : !1) || // We leave the current main axis only if every placement on that axis
|
|
449
452
|
// overflows the main axis.
|
|
450
|
-
T.every((
|
|
453
|
+
T.every((S) => Y(S.placement) === y ? S.overflows[0] > 0 : !0)))
|
|
451
454
|
return {
|
|
452
455
|
data: {
|
|
453
456
|
index: F,
|
|
@@ -457,20 +460,20 @@ const qe = function(t) {
|
|
|
457
460
|
placement: z
|
|
458
461
|
}
|
|
459
462
|
};
|
|
460
|
-
let M = ($ = T.filter((I) => I.overflows[0] <= 0).sort((I,
|
|
463
|
+
let M = ($ = T.filter((I) => I.overflows[0] <= 0).sort((I, S) => I.overflows[1] - S.overflows[1])[0]) == null ? void 0 : $.placement;
|
|
461
464
|
if (!M)
|
|
462
|
-
switch (
|
|
465
|
+
switch (f) {
|
|
463
466
|
case "bestFit": {
|
|
464
467
|
var P;
|
|
465
|
-
const I = (P = T.filter((
|
|
466
|
-
if (
|
|
467
|
-
const
|
|
468
|
-
return
|
|
468
|
+
const I = (P = T.filter((S) => {
|
|
469
|
+
if (C) {
|
|
470
|
+
const O = Y(S.placement);
|
|
471
|
+
return O === y || // Create a bias to the `y` side axis due to horizontal
|
|
469
472
|
// reading directions favoring greater width.
|
|
470
|
-
|
|
473
|
+
O === "y";
|
|
471
474
|
}
|
|
472
475
|
return !0;
|
|
473
|
-
}).map((
|
|
476
|
+
}).map((S) => [S.placement, S.overflows.filter((O) => O > 0).reduce((O, N) => O + N, 0)]).sort((S, O) => S[1] - O[1])[0]) == null ? void 0 : P[0];
|
|
474
477
|
I && (M = I);
|
|
475
478
|
break;
|
|
476
479
|
}
|
|
@@ -494,10 +497,10 @@ async function Xe(t, e) {
|
|
|
494
497
|
placement: o,
|
|
495
498
|
platform: n,
|
|
496
499
|
elements: r
|
|
497
|
-
} = t, i = await (n.isRTL == null ? void 0 : n.isRTL(r.floating)), s = U(o), l = ft(o),
|
|
500
|
+
} = t, i = await (n.isRTL == null ? void 0 : n.isRTL(r.floating)), s = U(o), l = ft(o), c = Y(o) === "y", a = Ue.has(s) ? -1 : 1, u = i && c ? -1 : 1, m = Z(e, t);
|
|
498
501
|
let {
|
|
499
502
|
mainAxis: g,
|
|
500
|
-
crossAxis:
|
|
503
|
+
crossAxis: f,
|
|
501
504
|
alignmentAxis: d
|
|
502
505
|
} = typeof m == "number" ? {
|
|
503
506
|
mainAxis: m,
|
|
@@ -508,12 +511,12 @@ async function Xe(t, e) {
|
|
|
508
511
|
crossAxis: m.crossAxis || 0,
|
|
509
512
|
alignmentAxis: m.alignmentAxis
|
|
510
513
|
};
|
|
511
|
-
return l && typeof d == "number" && (
|
|
512
|
-
x:
|
|
514
|
+
return l && typeof d == "number" && (f = l === "end" ? d * -1 : d), c ? {
|
|
515
|
+
x: f * u,
|
|
513
516
|
y: g * a
|
|
514
517
|
} : {
|
|
515
518
|
x: g * a,
|
|
516
|
-
y:
|
|
519
|
+
y: f * u
|
|
517
520
|
};
|
|
518
521
|
}
|
|
519
522
|
const Ke = function(t) {
|
|
@@ -527,12 +530,12 @@ const Ke = function(t) {
|
|
|
527
530
|
y: i,
|
|
528
531
|
placement: s,
|
|
529
532
|
middlewareData: l
|
|
530
|
-
} = e,
|
|
533
|
+
} = e, c = await Xe(e, t);
|
|
531
534
|
return s === ((o = l.offset) == null ? void 0 : o.placement) && (n = l.arrow) != null && n.alignmentOffset ? {} : {
|
|
532
|
-
x: r +
|
|
533
|
-
y: i +
|
|
535
|
+
x: r + c.x,
|
|
536
|
+
y: i + c.y,
|
|
534
537
|
data: {
|
|
535
|
-
...
|
|
538
|
+
...c,
|
|
536
539
|
placement: s
|
|
537
540
|
}
|
|
538
541
|
};
|
|
@@ -546,49 +549,50 @@ const Ke = function(t) {
|
|
|
546
549
|
const {
|
|
547
550
|
x: o,
|
|
548
551
|
y: n,
|
|
549
|
-
placement: r
|
|
552
|
+
placement: r,
|
|
553
|
+
platform: i
|
|
550
554
|
} = e, {
|
|
551
|
-
mainAxis:
|
|
552
|
-
crossAxis:
|
|
553
|
-
limiter:
|
|
554
|
-
fn: (
|
|
555
|
+
mainAxis: s = !0,
|
|
556
|
+
crossAxis: l = !1,
|
|
557
|
+
limiter: c = {
|
|
558
|
+
fn: (x) => {
|
|
555
559
|
let {
|
|
556
|
-
x:
|
|
557
|
-
y
|
|
558
|
-
} =
|
|
560
|
+
x: y,
|
|
561
|
+
y: w
|
|
562
|
+
} = x;
|
|
559
563
|
return {
|
|
560
|
-
x:
|
|
561
|
-
y
|
|
564
|
+
x: y,
|
|
565
|
+
y: w
|
|
562
566
|
};
|
|
563
567
|
}
|
|
564
568
|
},
|
|
565
|
-
...
|
|
566
|
-
} = Z(t, e),
|
|
569
|
+
...a
|
|
570
|
+
} = Z(t, e), u = {
|
|
567
571
|
x: o,
|
|
568
572
|
y: n
|
|
569
|
-
},
|
|
570
|
-
let
|
|
571
|
-
if (i) {
|
|
572
|
-
const p = g === "y" ? "top" : "left", v = g === "y" ? "bottom" : "right", y = c + u[p], w = c - u[v];
|
|
573
|
-
c = Bt(y, c, w);
|
|
574
|
-
}
|
|
573
|
+
}, m = await i.detectOverflow(e, a), g = Y(U(r)), f = oe(g);
|
|
574
|
+
let d = u[f], h = u[g];
|
|
575
575
|
if (s) {
|
|
576
|
-
const
|
|
577
|
-
d =
|
|
576
|
+
const x = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", w = d + m[x], b = d - m[y];
|
|
577
|
+
d = It(w, d, b);
|
|
578
|
+
}
|
|
579
|
+
if (l) {
|
|
580
|
+
const x = g === "y" ? "top" : "left", y = g === "y" ? "bottom" : "right", w = h + m[x], b = h - m[y];
|
|
581
|
+
h = It(w, h, b);
|
|
578
582
|
}
|
|
579
|
-
const
|
|
583
|
+
const p = c.fn({
|
|
580
584
|
...e,
|
|
581
|
-
[
|
|
582
|
-
[
|
|
585
|
+
[f]: d,
|
|
586
|
+
[g]: h
|
|
583
587
|
});
|
|
584
588
|
return {
|
|
585
|
-
...
|
|
589
|
+
...p,
|
|
586
590
|
data: {
|
|
587
|
-
x:
|
|
588
|
-
y:
|
|
591
|
+
x: p.x - o,
|
|
592
|
+
y: p.y - n,
|
|
589
593
|
enabled: {
|
|
590
|
-
[
|
|
591
|
-
[
|
|
594
|
+
[f]: s,
|
|
595
|
+
[g]: l
|
|
592
596
|
}
|
|
593
597
|
}
|
|
594
598
|
};
|
|
@@ -606,22 +610,22 @@ const Ke = function(t) {
|
|
|
606
610
|
platform: s,
|
|
607
611
|
elements: l
|
|
608
612
|
} = e, {
|
|
609
|
-
apply:
|
|
613
|
+
apply: c = () => {
|
|
610
614
|
},
|
|
611
615
|
...a
|
|
612
|
-
} = Z(t, e), u = await
|
|
616
|
+
} = Z(t, e), u = await s.detectOverflow(e, a), m = U(r), g = ft(r), f = Y(r) === "y", {
|
|
613
617
|
width: d,
|
|
614
618
|
height: h
|
|
615
619
|
} = i.floating;
|
|
616
|
-
let p,
|
|
617
|
-
m === "top" || m === "bottom" ? (p = m,
|
|
618
|
-
const y = h - u.top - u.bottom, w = d - u.left - u.right, b = X(h - u[p], y), R = X(d - u[
|
|
620
|
+
let p, x;
|
|
621
|
+
m === "top" || m === "bottom" ? (p = m, x = g === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (x = m, p = g === "end" ? "top" : "bottom");
|
|
622
|
+
const y = h - u.top - u.bottom, w = d - u.left - u.right, b = X(h - u[p], y), R = X(d - u[x], w), C = !e.middlewareData.shift;
|
|
619
623
|
let A = b, H = R;
|
|
620
|
-
if ((o = e.middlewareData.shift) != null && o.enabled.x && (H = w), (n = e.middlewareData.shift) != null && n.enabled.y && (A = y),
|
|
621
|
-
const T = D(u.left, 0),
|
|
622
|
-
|
|
624
|
+
if ((o = e.middlewareData.shift) != null && o.enabled.x && (H = w), (n = e.middlewareData.shift) != null && n.enabled.y && (A = y), C && !g) {
|
|
625
|
+
const T = D(u.left, 0), E = D(u.right, 0), $ = D(u.top, 0), P = D(u.bottom, 0);
|
|
626
|
+
f ? H = d - 2 * (T !== 0 || E !== 0 ? T + E : D(u.left, u.right)) : A = h - 2 * ($ !== 0 || P !== 0 ? $ + P : D(u.top, u.bottom));
|
|
623
627
|
}
|
|
624
|
-
await
|
|
628
|
+
await c({
|
|
625
629
|
...e,
|
|
626
630
|
availableWidth: H,
|
|
627
631
|
availableHeight: A
|
|
@@ -645,11 +649,11 @@ function le(t) {
|
|
|
645
649
|
$: l
|
|
646
650
|
};
|
|
647
651
|
}
|
|
648
|
-
function
|
|
652
|
+
function Pt(t) {
|
|
649
653
|
return L(t) ? t : t.contextElement;
|
|
650
654
|
}
|
|
651
655
|
function G(t) {
|
|
652
|
-
const e =
|
|
656
|
+
const e = Pt(t);
|
|
653
657
|
if (!_(e))
|
|
654
658
|
return k(1);
|
|
655
659
|
const o = e.getBoundingClientRect(), {
|
|
@@ -666,7 +670,7 @@ function G(t) {
|
|
|
666
670
|
const Qe = /* @__PURE__ */ k(0);
|
|
667
671
|
function ce(t) {
|
|
668
672
|
const e = B(t);
|
|
669
|
-
return !
|
|
673
|
+
return !Mt() || !e.visualViewport ? Qe : {
|
|
670
674
|
x: e.visualViewport.offsetLeft,
|
|
671
675
|
y: e.visualViewport.offsetTop
|
|
672
676
|
};
|
|
@@ -676,32 +680,32 @@ function Ze(t, e, o) {
|
|
|
676
680
|
}
|
|
677
681
|
function K(t, e, o, n) {
|
|
678
682
|
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
679
|
-
const r = t.getBoundingClientRect(), i =
|
|
683
|
+
const r = t.getBoundingClientRect(), i = Pt(t);
|
|
680
684
|
let s = k(1);
|
|
681
685
|
e && (n ? L(n) && (s = G(n)) : s = G(t));
|
|
682
686
|
const l = Ze(i, o, n) ? ce(i) : k(0);
|
|
683
|
-
let
|
|
687
|
+
let c = (r.left + l.x) / s.x, a = (r.top + l.y) / s.y, u = r.width / s.x, m = r.height / s.y;
|
|
684
688
|
if (i) {
|
|
685
|
-
const g = B(i),
|
|
689
|
+
const g = B(i), f = n && L(n) ? B(n) : n;
|
|
686
690
|
let d = g, h = Ot(d);
|
|
687
|
-
for (; h && n &&
|
|
688
|
-
const p = G(h),
|
|
689
|
-
|
|
691
|
+
for (; h && n && f !== d; ) {
|
|
692
|
+
const p = G(h), x = h.getBoundingClientRect(), y = W(h), w = x.left + (h.clientLeft + parseFloat(y.paddingLeft)) * p.x, b = x.top + (h.clientTop + parseFloat(y.paddingTop)) * p.y;
|
|
693
|
+
c *= p.x, a *= p.y, u *= p.x, m *= p.y, c += w, a += b, d = B(h), h = Ot(d);
|
|
690
694
|
}
|
|
691
695
|
}
|
|
692
696
|
return gt({
|
|
693
697
|
width: u,
|
|
694
698
|
height: m,
|
|
695
|
-
x:
|
|
699
|
+
x: c,
|
|
696
700
|
y: a
|
|
697
701
|
});
|
|
698
702
|
}
|
|
699
|
-
function
|
|
703
|
+
function vt(t, e) {
|
|
700
704
|
const o = xt(t).scrollLeft;
|
|
701
705
|
return e ? e.left + o : K(j(t)).left + o;
|
|
702
706
|
}
|
|
703
707
|
function fe(t, e) {
|
|
704
|
-
const o = t.getBoundingClientRect(), n = o.left + e.scrollLeft -
|
|
708
|
+
const o = t.getBoundingClientRect(), n = o.left + e.scrollLeft - vt(t, o), r = o.top + e.scrollTop;
|
|
705
709
|
return {
|
|
706
710
|
x: n,
|
|
707
711
|
y: r
|
|
@@ -717,21 +721,21 @@ function tn(t) {
|
|
|
717
721
|
const i = r === "fixed", s = j(n), l = e ? wt(e.floating) : !1;
|
|
718
722
|
if (n === s || l && i)
|
|
719
723
|
return o;
|
|
720
|
-
let
|
|
724
|
+
let c = {
|
|
721
725
|
scrollLeft: 0,
|
|
722
726
|
scrollTop: 0
|
|
723
727
|
}, a = k(1);
|
|
724
728
|
const u = k(0), m = _(n);
|
|
725
|
-
if ((m || !m && !i) && ((Q(n) !== "body" || ct(s)) && (
|
|
726
|
-
const
|
|
727
|
-
a = G(n), u.x =
|
|
729
|
+
if ((m || !m && !i) && ((Q(n) !== "body" || ct(s)) && (c = xt(n)), _(n))) {
|
|
730
|
+
const f = K(n);
|
|
731
|
+
a = G(n), u.x = f.x + n.clientLeft, u.y = f.y + n.clientTop;
|
|
728
732
|
}
|
|
729
|
-
const g = s && !m && !i ? fe(s,
|
|
733
|
+
const g = s && !m && !i ? fe(s, c) : k(0);
|
|
730
734
|
return {
|
|
731
735
|
width: o.width * a.x,
|
|
732
736
|
height: o.height * a.y,
|
|
733
|
-
x: o.x * a.x -
|
|
734
|
-
y: o.y * a.y -
|
|
737
|
+
x: o.x * a.x - c.scrollLeft * a.x + u.x + g.x,
|
|
738
|
+
y: o.y * a.y - c.scrollTop * a.y + u.y + g.y
|
|
735
739
|
};
|
|
736
740
|
}
|
|
737
741
|
function en(t) {
|
|
@@ -739,7 +743,7 @@ function en(t) {
|
|
|
739
743
|
}
|
|
740
744
|
function nn(t) {
|
|
741
745
|
const e = j(t), o = xt(t), n = t.ownerDocument.body, r = D(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), i = D(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
|
|
742
|
-
let s = -o.scrollLeft +
|
|
746
|
+
let s = -o.scrollLeft + vt(t);
|
|
743
747
|
const l = -o.scrollTop;
|
|
744
748
|
return W(n).direction === "rtl" && (s += D(e.clientWidth, n.clientWidth) - r), {
|
|
745
749
|
width: r,
|
|
@@ -748,38 +752,38 @@ function nn(t) {
|
|
|
748
752
|
y: l
|
|
749
753
|
};
|
|
750
754
|
}
|
|
751
|
-
const
|
|
755
|
+
const kt = 25;
|
|
752
756
|
function on(t, e) {
|
|
753
757
|
const o = B(t), n = j(t), r = o.visualViewport;
|
|
754
|
-
let i = n.clientWidth, s = n.clientHeight, l = 0,
|
|
758
|
+
let i = n.clientWidth, s = n.clientHeight, l = 0, c = 0;
|
|
755
759
|
if (r) {
|
|
756
760
|
i = r.width, s = r.height;
|
|
757
|
-
const u =
|
|
758
|
-
(!u || u && e === "fixed") && (l = r.offsetLeft,
|
|
761
|
+
const u = Mt();
|
|
762
|
+
(!u || u && e === "fixed") && (l = r.offsetLeft, c = r.offsetTop);
|
|
759
763
|
}
|
|
760
|
-
const a =
|
|
764
|
+
const a = vt(n);
|
|
761
765
|
if (a <= 0) {
|
|
762
|
-
const u = n.ownerDocument, m = u.body, g = getComputedStyle(m),
|
|
763
|
-
d <=
|
|
764
|
-
} else a <=
|
|
766
|
+
const u = n.ownerDocument, m = u.body, g = getComputedStyle(m), f = u.compatMode === "CSS1Compat" && parseFloat(g.marginLeft) + parseFloat(g.marginRight) || 0, d = Math.abs(n.clientWidth - m.clientWidth - f);
|
|
767
|
+
d <= kt && (i -= d);
|
|
768
|
+
} else a <= kt && (i += a);
|
|
765
769
|
return {
|
|
766
770
|
width: i,
|
|
767
771
|
height: s,
|
|
768
772
|
x: l,
|
|
769
|
-
y:
|
|
773
|
+
y: c
|
|
770
774
|
};
|
|
771
775
|
}
|
|
772
776
|
const rn = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
773
777
|
function sn(t, e) {
|
|
774
|
-
const o = K(t, !0, e === "fixed"), n = o.top + t.clientTop, r = o.left + t.clientLeft, i = _(t) ? G(t) : k(1), s = t.clientWidth * i.x, l = t.clientHeight * i.y,
|
|
778
|
+
const o = K(t, !0, e === "fixed"), n = o.top + t.clientTop, r = o.left + t.clientLeft, i = _(t) ? G(t) : k(1), s = t.clientWidth * i.x, l = t.clientHeight * i.y, c = r * i.x, a = n * i.y;
|
|
775
779
|
return {
|
|
776
780
|
width: s,
|
|
777
781
|
height: l,
|
|
778
|
-
x:
|
|
782
|
+
x: c,
|
|
779
783
|
y: a
|
|
780
784
|
};
|
|
781
785
|
}
|
|
782
|
-
function
|
|
786
|
+
function _t(t, e, o) {
|
|
783
787
|
let n;
|
|
784
788
|
if (e === "viewport")
|
|
785
789
|
n = on(t, o);
|
|
@@ -810,8 +814,8 @@ function ln(t, e) {
|
|
|
810
814
|
const i = W(t).position === "fixed";
|
|
811
815
|
let s = i ? q(t) : t;
|
|
812
816
|
for (; L(s) && !J(s); ) {
|
|
813
|
-
const l = W(s),
|
|
814
|
-
!
|
|
817
|
+
const l = W(s), c = Ft(s);
|
|
818
|
+
!c && l.position === "fixed" && (r = null), (i ? !c && !r : !c && l.position === "static" && !!r && rn.has(r.position) || ct(s) && !c && ae(t, s)) ? n = n.filter((u) => u !== s) : r = l, s = q(s);
|
|
815
819
|
}
|
|
816
820
|
return e.set(t, n), n;
|
|
817
821
|
}
|
|
@@ -822,15 +826,15 @@ function cn(t) {
|
|
|
822
826
|
rootBoundary: n,
|
|
823
827
|
strategy: r
|
|
824
828
|
} = t;
|
|
825
|
-
const s = [...o === "clippingAncestors" ? wt(e) ? [] : ln(e, this._c) : [].concat(o), n], l = s[0],
|
|
826
|
-
const m =
|
|
829
|
+
const s = [...o === "clippingAncestors" ? wt(e) ? [] : ln(e, this._c) : [].concat(o), n], l = s[0], c = s.reduce((a, u) => {
|
|
830
|
+
const m = _t(e, u, r);
|
|
827
831
|
return a.top = D(m.top, a.top), a.right = X(m.right, a.right), a.bottom = X(m.bottom, a.bottom), a.left = D(m.left, a.left), a;
|
|
828
|
-
},
|
|
832
|
+
}, _t(e, l, r));
|
|
829
833
|
return {
|
|
830
|
-
width:
|
|
831
|
-
height:
|
|
832
|
-
x:
|
|
833
|
-
y:
|
|
834
|
+
width: c.right - c.left,
|
|
835
|
+
height: c.bottom - c.top,
|
|
836
|
+
x: c.left,
|
|
837
|
+
y: c.top
|
|
834
838
|
};
|
|
835
839
|
}
|
|
836
840
|
function fn(t) {
|
|
@@ -849,17 +853,17 @@ function an(t, e, o) {
|
|
|
849
853
|
scrollLeft: 0,
|
|
850
854
|
scrollTop: 0
|
|
851
855
|
};
|
|
852
|
-
const
|
|
856
|
+
const c = k(0);
|
|
853
857
|
function a() {
|
|
854
|
-
|
|
858
|
+
c.x = vt(r);
|
|
855
859
|
}
|
|
856
860
|
if (n || !n && !i)
|
|
857
861
|
if ((Q(e) !== "body" || ct(r)) && (l = xt(e)), n) {
|
|
858
|
-
const
|
|
859
|
-
|
|
862
|
+
const f = K(e, !0, i, e);
|
|
863
|
+
c.x = f.x + e.clientLeft, c.y = f.y + e.clientTop;
|
|
860
864
|
} else r && a();
|
|
861
865
|
i && !n && r && a();
|
|
862
|
-
const u = r && !n && !i ? fe(r, l) : k(0), m = s.left + l.scrollLeft -
|
|
866
|
+
const u = r && !n && !i ? fe(r, l) : k(0), m = s.left + l.scrollLeft - c.x - u.x, g = s.top + l.scrollTop - c.y - u.y;
|
|
863
867
|
return {
|
|
864
868
|
x: m,
|
|
865
869
|
y: g,
|
|
@@ -867,10 +871,10 @@ function an(t, e, o) {
|
|
|
867
871
|
height: s.height
|
|
868
872
|
};
|
|
869
873
|
}
|
|
870
|
-
function
|
|
874
|
+
function bt(t) {
|
|
871
875
|
return W(t).position === "static";
|
|
872
876
|
}
|
|
873
|
-
function
|
|
877
|
+
function jt(t, e) {
|
|
874
878
|
if (!_(t) || W(t).position === "fixed")
|
|
875
879
|
return null;
|
|
876
880
|
if (e)
|
|
@@ -885,16 +889,16 @@ function ue(t, e) {
|
|
|
885
889
|
if (!_(t)) {
|
|
886
890
|
let r = q(t);
|
|
887
891
|
for (; r && !J(r); ) {
|
|
888
|
-
if (L(r) && !
|
|
892
|
+
if (L(r) && !bt(r))
|
|
889
893
|
return r;
|
|
890
894
|
r = q(r);
|
|
891
895
|
}
|
|
892
896
|
return o;
|
|
893
897
|
}
|
|
894
|
-
let n =
|
|
895
|
-
for (; n &&
|
|
896
|
-
n =
|
|
897
|
-
return n && J(n) &&
|
|
898
|
+
let n = jt(t, e);
|
|
899
|
+
for (; n && Oe(n) && bt(n); )
|
|
900
|
+
n = jt(n, e);
|
|
901
|
+
return n && J(n) && bt(n) && !Ft(n) ? o : n || Pe(t) || o;
|
|
898
902
|
}
|
|
899
903
|
const un = async function(t) {
|
|
900
904
|
const e = this.getOffsetParent || ue, o = this.getDimensions, n = await o(t.floating);
|
|
@@ -933,24 +937,24 @@ function gn(t, e) {
|
|
|
933
937
|
var l;
|
|
934
938
|
clearTimeout(n), (l = o) == null || l.disconnect(), o = null;
|
|
935
939
|
}
|
|
936
|
-
function s(l,
|
|
937
|
-
l === void 0 && (l = !1),
|
|
940
|
+
function s(l, c) {
|
|
941
|
+
l === void 0 && (l = !1), c === void 0 && (c = 1), i();
|
|
938
942
|
const a = t.getBoundingClientRect(), {
|
|
939
943
|
left: u,
|
|
940
944
|
top: m,
|
|
941
945
|
width: g,
|
|
942
|
-
height:
|
|
946
|
+
height: f
|
|
943
947
|
} = a;
|
|
944
|
-
if (l || e(), !g || !
|
|
948
|
+
if (l || e(), !g || !f)
|
|
945
949
|
return;
|
|
946
|
-
const d = at(m), h = at(r.clientWidth - (u + g)), p = at(r.clientHeight - (m +
|
|
947
|
-
rootMargin: -d + "px " + -h + "px " + -p + "px " + -
|
|
948
|
-
threshold: D(0, X(1,
|
|
950
|
+
const d = at(m), h = at(r.clientWidth - (u + g)), p = at(r.clientHeight - (m + f)), x = at(u), w = {
|
|
951
|
+
rootMargin: -d + "px " + -h + "px " + -p + "px " + -x + "px",
|
|
952
|
+
threshold: D(0, X(1, c)) || 1
|
|
949
953
|
};
|
|
950
954
|
let b = !0;
|
|
951
|
-
function R(
|
|
952
|
-
const A =
|
|
953
|
-
if (A !==
|
|
955
|
+
function R(C) {
|
|
956
|
+
const A = C[0].intersectionRatio;
|
|
957
|
+
if (A !== c) {
|
|
954
958
|
if (!b)
|
|
955
959
|
return s();
|
|
956
960
|
A ? s(!1, A) : n = setTimeout(() => {
|
|
@@ -979,36 +983,36 @@ function hn(t, e, o, n) {
|
|
|
979
983
|
ancestorResize: i = !0,
|
|
980
984
|
elementResize: s = typeof ResizeObserver == "function",
|
|
981
985
|
layoutShift: l = typeof IntersectionObserver == "function",
|
|
982
|
-
animationFrame:
|
|
983
|
-
} = n, a =
|
|
984
|
-
u.forEach((
|
|
985
|
-
r &&
|
|
986
|
+
animationFrame: c = !1
|
|
987
|
+
} = n, a = Pt(t), u = r || i ? [...a ? rt(a) : [], ...rt(e)] : [];
|
|
988
|
+
u.forEach((x) => {
|
|
989
|
+
r && x.addEventListener("scroll", o, {
|
|
986
990
|
passive: !0
|
|
987
|
-
}), i &&
|
|
991
|
+
}), i && x.addEventListener("resize", o);
|
|
988
992
|
});
|
|
989
993
|
const m = a && l ? gn(a, o) : null;
|
|
990
|
-
let g = -1,
|
|
991
|
-
s && (
|
|
992
|
-
let [y] =
|
|
993
|
-
y && y.target === a &&
|
|
994
|
+
let g = -1, f = null;
|
|
995
|
+
s && (f = new ResizeObserver((x) => {
|
|
996
|
+
let [y] = x;
|
|
997
|
+
y && y.target === a && f && (f.unobserve(e), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
|
|
994
998
|
var w;
|
|
995
|
-
(w =
|
|
999
|
+
(w = f) == null || w.observe(e);
|
|
996
1000
|
})), o();
|
|
997
|
-
}), a && !
|
|
998
|
-
let d, h =
|
|
999
|
-
|
|
1001
|
+
}), a && !c && f.observe(a), f.observe(e));
|
|
1002
|
+
let d, h = c ? K(t) : null;
|
|
1003
|
+
c && p();
|
|
1000
1004
|
function p() {
|
|
1001
|
-
const
|
|
1002
|
-
h && !de(h,
|
|
1005
|
+
const x = K(t);
|
|
1006
|
+
h && !de(h, x) && o(), h = x, d = requestAnimationFrame(p);
|
|
1003
1007
|
}
|
|
1004
1008
|
return o(), () => {
|
|
1005
|
-
var
|
|
1009
|
+
var x;
|
|
1006
1010
|
u.forEach((y) => {
|
|
1007
1011
|
r && y.removeEventListener("scroll", o), i && y.removeEventListener("resize", o);
|
|
1008
|
-
}), m?.(), (
|
|
1012
|
+
}), m?.(), (x = f) == null || x.disconnect(), f = null, c && cancelAnimationFrame(d);
|
|
1009
1013
|
};
|
|
1010
1014
|
}
|
|
1011
|
-
const
|
|
1015
|
+
const Rt = se, pn = Ke, wn = Ge, xn = qe, vn = Je, yn = (t, e, o) => {
|
|
1012
1016
|
const n = /* @__PURE__ */ new Map(), r = {
|
|
1013
1017
|
platform: mn,
|
|
1014
1018
|
...o
|
|
@@ -1022,7 +1026,7 @@ const Ct = vt, pn = Ke, wn = Ge, xn = qe, vn = Je, yn = (t, e, o) => {
|
|
|
1022
1026
|
});
|
|
1023
1027
|
};
|
|
1024
1028
|
var bn = typeof document < "u", Rn = function() {
|
|
1025
|
-
}, ut = bn ?
|
|
1029
|
+
}, ut = bn ? Qt : Rn;
|
|
1026
1030
|
function ht(t, e) {
|
|
1027
1031
|
if (t === e)
|
|
1028
1032
|
return !0;
|
|
@@ -1056,12 +1060,12 @@ function ht(t, e) {
|
|
|
1056
1060
|
function me(t) {
|
|
1057
1061
|
return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1058
1062
|
}
|
|
1059
|
-
function
|
|
1063
|
+
function zt(t, e) {
|
|
1060
1064
|
const o = me(t);
|
|
1061
1065
|
return Math.round(e * o) / o;
|
|
1062
1066
|
}
|
|
1063
|
-
function
|
|
1064
|
-
const e =
|
|
1067
|
+
function Ct(t) {
|
|
1068
|
+
const e = v.useRef(t);
|
|
1065
1069
|
return ut(() => {
|
|
1066
1070
|
e.current = t;
|
|
1067
1071
|
}), e;
|
|
@@ -1078,32 +1082,32 @@ function Cn(t) {
|
|
|
1078
1082
|
floating: s
|
|
1079
1083
|
} = {},
|
|
1080
1084
|
transform: l = !0,
|
|
1081
|
-
whileElementsMounted:
|
|
1085
|
+
whileElementsMounted: c,
|
|
1082
1086
|
open: a
|
|
1083
|
-
} = t, [u, m] =
|
|
1087
|
+
} = t, [u, m] = v.useState({
|
|
1084
1088
|
x: 0,
|
|
1085
1089
|
y: 0,
|
|
1086
1090
|
strategy: o,
|
|
1087
1091
|
placement: e,
|
|
1088
1092
|
middlewareData: {},
|
|
1089
1093
|
isPositioned: !1
|
|
1090
|
-
}), [g,
|
|
1091
|
-
ht(g, n) ||
|
|
1092
|
-
const [d, h] =
|
|
1093
|
-
|
|
1094
|
-
}, []), w =
|
|
1095
|
-
|
|
1096
|
-
}, []), b = i || d, R = s || p,
|
|
1097
|
-
if (!
|
|
1094
|
+
}), [g, f] = v.useState(n);
|
|
1095
|
+
ht(g, n) || f(n);
|
|
1096
|
+
const [d, h] = v.useState(null), [p, x] = v.useState(null), y = v.useCallback((S) => {
|
|
1097
|
+
S !== C.current && (C.current = S, h(S));
|
|
1098
|
+
}, []), w = v.useCallback((S) => {
|
|
1099
|
+
S !== A.current && (A.current = S, x(S));
|
|
1100
|
+
}, []), b = i || d, R = s || p, C = v.useRef(null), A = v.useRef(null), H = v.useRef(u), V = c != null, T = Ct(c), E = Ct(r), $ = Ct(a), P = v.useCallback(() => {
|
|
1101
|
+
if (!C.current || !A.current)
|
|
1098
1102
|
return;
|
|
1099
|
-
const
|
|
1103
|
+
const S = {
|
|
1100
1104
|
placement: e,
|
|
1101
1105
|
strategy: o,
|
|
1102
1106
|
middleware: g
|
|
1103
1107
|
};
|
|
1104
|
-
|
|
1108
|
+
E.current && (S.platform = E.current), yn(C.current, A.current, S).then((O) => {
|
|
1105
1109
|
const N = {
|
|
1106
|
-
...
|
|
1110
|
+
...O,
|
|
1107
1111
|
// The floating element's position may be recomputed while it's closed
|
|
1108
1112
|
// but still mounted (such as when transitioning out). To ensure
|
|
1109
1113
|
// `isPositioned` will be `false` initially on the next open, avoid
|
|
@@ -1114,53 +1118,53 @@ function Cn(t) {
|
|
|
1114
1118
|
m(N);
|
|
1115
1119
|
}));
|
|
1116
1120
|
});
|
|
1117
|
-
}, [g, e, o,
|
|
1121
|
+
}, [g, e, o, E, $]);
|
|
1118
1122
|
ut(() => {
|
|
1119
|
-
a === !1 && H.current.isPositioned && (H.current.isPositioned = !1, m((
|
|
1120
|
-
...
|
|
1123
|
+
a === !1 && H.current.isPositioned && (H.current.isPositioned = !1, m((S) => ({
|
|
1124
|
+
...S,
|
|
1121
1125
|
isPositioned: !1
|
|
1122
1126
|
})));
|
|
1123
1127
|
}, [a]);
|
|
1124
|
-
const F =
|
|
1128
|
+
const F = v.useRef(!1);
|
|
1125
1129
|
ut(() => (F.current = !0, () => {
|
|
1126
1130
|
F.current = !1;
|
|
1127
1131
|
}), []), ut(() => {
|
|
1128
|
-
if (b && (
|
|
1132
|
+
if (b && (C.current = b), R && (A.current = R), b && R) {
|
|
1129
1133
|
if (T.current)
|
|
1130
1134
|
return T.current(b, R, P);
|
|
1131
1135
|
P();
|
|
1132
1136
|
}
|
|
1133
1137
|
}, [b, R, P, T, V]);
|
|
1134
|
-
const z =
|
|
1135
|
-
reference:
|
|
1138
|
+
const z = v.useMemo(() => ({
|
|
1139
|
+
reference: C,
|
|
1136
1140
|
floating: A,
|
|
1137
1141
|
setReference: y,
|
|
1138
1142
|
setFloating: w
|
|
1139
|
-
}), [y, w]), M =
|
|
1143
|
+
}), [y, w]), M = v.useMemo(() => ({
|
|
1140
1144
|
reference: b,
|
|
1141
1145
|
floating: R
|
|
1142
|
-
}), [b, R]), I =
|
|
1143
|
-
const
|
|
1146
|
+
}), [b, R]), I = v.useMemo(() => {
|
|
1147
|
+
const S = {
|
|
1144
1148
|
position: o,
|
|
1145
1149
|
left: 0,
|
|
1146
1150
|
top: 0
|
|
1147
1151
|
};
|
|
1148
1152
|
if (!M.floating)
|
|
1149
|
-
return
|
|
1150
|
-
const
|
|
1153
|
+
return S;
|
|
1154
|
+
const O = zt(M.floating, u.x), N = zt(M.floating, u.y);
|
|
1151
1155
|
return l ? {
|
|
1152
|
-
...
|
|
1153
|
-
transform: "translate(" +
|
|
1156
|
+
...S,
|
|
1157
|
+
transform: "translate(" + O + "px, " + N + "px)",
|
|
1154
1158
|
...me(M.floating) >= 1.5 && {
|
|
1155
1159
|
willChange: "transform"
|
|
1156
1160
|
}
|
|
1157
1161
|
} : {
|
|
1158
1162
|
position: o,
|
|
1159
|
-
left:
|
|
1163
|
+
left: O,
|
|
1160
1164
|
top: N
|
|
1161
1165
|
};
|
|
1162
1166
|
}, [o, l, M.floating, u.x, u.y]);
|
|
1163
|
-
return
|
|
1167
|
+
return v.useMemo(() => ({
|
|
1164
1168
|
...u,
|
|
1165
1169
|
update: P,
|
|
1166
1170
|
refs: z,
|
|
@@ -1177,38 +1181,38 @@ const ge = (t, e) => ({
|
|
|
1177
1181
|
}), An = (t, e) => ({
|
|
1178
1182
|
...xn(t),
|
|
1179
1183
|
options: [t, e]
|
|
1180
|
-
}),
|
|
1184
|
+
}), On = (t, e) => ({
|
|
1181
1185
|
...vn(t),
|
|
1182
1186
|
options: [t, e]
|
|
1183
1187
|
}), he = {
|
|
1184
|
-
...
|
|
1185
|
-
},
|
|
1188
|
+
...v
|
|
1189
|
+
}, En = he.useInsertionEffect, Tn = En || ((t) => t());
|
|
1186
1190
|
function pe(t) {
|
|
1187
|
-
const e =
|
|
1191
|
+
const e = v.useRef(() => {
|
|
1188
1192
|
if (process.env.NODE_ENV !== "production")
|
|
1189
1193
|
throw new Error("Cannot call an event handler while rendering.");
|
|
1190
1194
|
});
|
|
1191
1195
|
return Tn(() => {
|
|
1192
1196
|
e.current = t;
|
|
1193
|
-
}),
|
|
1197
|
+
}), v.useCallback(function() {
|
|
1194
1198
|
for (var o = arguments.length, n = new Array(o), r = 0; r < o; r++)
|
|
1195
1199
|
n[r] = arguments[r];
|
|
1196
1200
|
return e.current == null ? void 0 : e.current(...n);
|
|
1197
1201
|
}, []);
|
|
1198
1202
|
}
|
|
1199
|
-
var
|
|
1200
|
-
let
|
|
1201
|
-
const
|
|
1203
|
+
var Tt = typeof document < "u" ? Qt : xe;
|
|
1204
|
+
let Yt = !1, Fn = 0;
|
|
1205
|
+
const qt = () => (
|
|
1202
1206
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
1203
1207
|
// on <React 18
|
|
1204
1208
|
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Fn++
|
|
1205
1209
|
);
|
|
1206
1210
|
function Mn() {
|
|
1207
|
-
const [t, e] =
|
|
1208
|
-
return
|
|
1209
|
-
t == null && e(
|
|
1210
|
-
}, []),
|
|
1211
|
-
|
|
1211
|
+
const [t, e] = v.useState(() => Yt ? qt() : void 0);
|
|
1212
|
+
return Tt(() => {
|
|
1213
|
+
t == null && e(qt());
|
|
1214
|
+
}, []), v.useEffect(() => {
|
|
1215
|
+
Yt = !0;
|
|
1212
1216
|
}, []), t;
|
|
1213
1217
|
}
|
|
1214
1218
|
const Pn = he.useId, Dn = Pn || Mn;
|
|
@@ -1248,35 +1252,35 @@ function Nn() {
|
|
|
1248
1252
|
}
|
|
1249
1253
|
};
|
|
1250
1254
|
}
|
|
1251
|
-
const $n = /* @__PURE__ */
|
|
1255
|
+
const $n = /* @__PURE__ */ v.createContext(null), In = /* @__PURE__ */ v.createContext(null), Bn = () => {
|
|
1252
1256
|
var t;
|
|
1253
|
-
return ((t =
|
|
1254
|
-
}, Vn = () =>
|
|
1257
|
+
return ((t = v.useContext($n)) == null ? void 0 : t.id) || null;
|
|
1258
|
+
}, Vn = () => v.useContext(In), Wn = "data-floating-ui-focusable";
|
|
1255
1259
|
function kn(t) {
|
|
1256
1260
|
const {
|
|
1257
1261
|
open: e = !1,
|
|
1258
1262
|
onOpenChange: o,
|
|
1259
1263
|
elements: n
|
|
1260
|
-
} = t, r = Dn(), i =
|
|
1264
|
+
} = t, r = Dn(), i = v.useRef({}), [s] = v.useState(() => Nn()), l = Bn() != null;
|
|
1261
1265
|
if (process.env.NODE_ENV !== "production") {
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1266
|
+
const f = n.reference;
|
|
1267
|
+
f && !L(f) && Hn("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
1264
1268
|
}
|
|
1265
|
-
const [
|
|
1266
|
-
i.current.openEvent =
|
|
1267
|
-
open:
|
|
1269
|
+
const [c, a] = v.useState(n.reference), u = pe((f, d, h) => {
|
|
1270
|
+
i.current.openEvent = f ? d : void 0, s.emit("openchange", {
|
|
1271
|
+
open: f,
|
|
1268
1272
|
event: d,
|
|
1269
1273
|
reason: h,
|
|
1270
1274
|
nested: l
|
|
1271
|
-
}), o?.(
|
|
1272
|
-
}), m =
|
|
1275
|
+
}), o?.(f, d, h);
|
|
1276
|
+
}), m = v.useMemo(() => ({
|
|
1273
1277
|
setPositionReference: a
|
|
1274
|
-
}), []), g =
|
|
1275
|
-
reference:
|
|
1278
|
+
}), []), g = v.useMemo(() => ({
|
|
1279
|
+
reference: c || n.reference || null,
|
|
1276
1280
|
floating: n.floating || null,
|
|
1277
1281
|
domReference: n.reference
|
|
1278
|
-
}), [
|
|
1279
|
-
return
|
|
1282
|
+
}), [c, n.reference, n.floating]);
|
|
1283
|
+
return v.useMemo(() => ({
|
|
1280
1284
|
dataRef: i,
|
|
1281
1285
|
open: e,
|
|
1282
1286
|
onOpenChange: u,
|
|
@@ -1297,11 +1301,11 @@ function _n(t) {
|
|
|
1297
1301
|
floating: null,
|
|
1298
1302
|
...t.elements
|
|
1299
1303
|
}
|
|
1300
|
-
}), n = t.rootContext || o, r = n.elements, [i, s] =
|
|
1301
|
-
|
|
1304
|
+
}), n = t.rootContext || o, r = n.elements, [i, s] = v.useState(null), [l, c] = v.useState(null), u = r?.domReference || i, m = v.useRef(null), g = Vn();
|
|
1305
|
+
Tt(() => {
|
|
1302
1306
|
u && (m.current = u);
|
|
1303
1307
|
}, [u]);
|
|
1304
|
-
const
|
|
1308
|
+
const f = Cn({
|
|
1305
1309
|
...t,
|
|
1306
1310
|
elements: {
|
|
1307
1311
|
...r,
|
|
@@ -1309,54 +1313,54 @@ function _n(t) {
|
|
|
1309
1313
|
reference: l
|
|
1310
1314
|
}
|
|
1311
1315
|
}
|
|
1312
|
-
}), d =
|
|
1316
|
+
}), d = v.useCallback((w) => {
|
|
1313
1317
|
const b = L(w) ? {
|
|
1314
1318
|
getBoundingClientRect: () => w.getBoundingClientRect(),
|
|
1315
1319
|
contextElement: w
|
|
1316
1320
|
} : w;
|
|
1317
|
-
|
|
1318
|
-
}, [
|
|
1319
|
-
(L(w) || w === null) && (m.current = w, s(w)), (L(
|
|
1321
|
+
c(b), f.refs.setReference(b);
|
|
1322
|
+
}, [f.refs]), h = v.useCallback((w) => {
|
|
1323
|
+
(L(w) || w === null) && (m.current = w, s(w)), (L(f.refs.reference.current) || f.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
1320
1324
|
// `null` to support `positionReference` + an unstable `reference`
|
|
1321
1325
|
// callback ref.
|
|
1322
|
-
w !== null && !L(w)) &&
|
|
1323
|
-
}, [
|
|
1324
|
-
...
|
|
1326
|
+
w !== null && !L(w)) && f.refs.setReference(w);
|
|
1327
|
+
}, [f.refs]), p = v.useMemo(() => ({
|
|
1328
|
+
...f.refs,
|
|
1325
1329
|
setReference: h,
|
|
1326
1330
|
setPositionReference: d,
|
|
1327
1331
|
domReference: m
|
|
1328
|
-
}), [
|
|
1329
|
-
...
|
|
1332
|
+
}), [f.refs, h, d]), x = v.useMemo(() => ({
|
|
1333
|
+
...f.elements,
|
|
1330
1334
|
domReference: u
|
|
1331
|
-
}), [
|
|
1332
|
-
...
|
|
1335
|
+
}), [f.elements, u]), y = v.useMemo(() => ({
|
|
1336
|
+
...f,
|
|
1333
1337
|
...n,
|
|
1334
1338
|
refs: p,
|
|
1335
|
-
elements:
|
|
1339
|
+
elements: x,
|
|
1336
1340
|
nodeId: e
|
|
1337
|
-
}), [
|
|
1338
|
-
return
|
|
1341
|
+
}), [f, p, x, e, n]);
|
|
1342
|
+
return Tt(() => {
|
|
1339
1343
|
n.dataRef.current.floatingContext = y;
|
|
1340
1344
|
const w = g?.nodesRef.current.find((b) => b.id === e);
|
|
1341
1345
|
w && (w.context = y);
|
|
1342
|
-
}),
|
|
1343
|
-
...
|
|
1346
|
+
}), v.useMemo(() => ({
|
|
1347
|
+
...f,
|
|
1344
1348
|
context: y,
|
|
1345
1349
|
refs: p,
|
|
1346
|
-
elements:
|
|
1347
|
-
}), [
|
|
1350
|
+
elements: x
|
|
1351
|
+
}), [f, p, x, y]);
|
|
1348
1352
|
}
|
|
1349
|
-
const
|
|
1350
|
-
function
|
|
1353
|
+
const Ut = "active", Xt = "selected";
|
|
1354
|
+
function St(t, e, o) {
|
|
1351
1355
|
const n = /* @__PURE__ */ new Map(), r = o === "item";
|
|
1352
1356
|
let i = t;
|
|
1353
1357
|
if (r && t) {
|
|
1354
1358
|
const {
|
|
1355
|
-
[
|
|
1356
|
-
[
|
|
1357
|
-
...
|
|
1359
|
+
[Ut]: s,
|
|
1360
|
+
[Xt]: l,
|
|
1361
|
+
...c
|
|
1358
1362
|
} = t;
|
|
1359
|
-
i =
|
|
1363
|
+
i = c;
|
|
1360
1364
|
}
|
|
1361
1365
|
return {
|
|
1362
1366
|
...o === "floating" && {
|
|
@@ -1367,14 +1371,14 @@ function At(t, e, o) {
|
|
|
1367
1371
|
...e.map((s) => {
|
|
1368
1372
|
const l = s ? s[o] : null;
|
|
1369
1373
|
return typeof l == "function" ? t ? l(t) : null : l;
|
|
1370
|
-
}).concat(t).reduce((s, l) => (l && Object.entries(l).forEach((
|
|
1371
|
-
let [a, u] =
|
|
1372
|
-
if (!(r && [
|
|
1374
|
+
}).concat(t).reduce((s, l) => (l && Object.entries(l).forEach((c) => {
|
|
1375
|
+
let [a, u] = c;
|
|
1376
|
+
if (!(r && [Ut, Xt].includes(a)))
|
|
1373
1377
|
if (a.indexOf("on") === 0) {
|
|
1374
1378
|
if (n.has(a) || n.set(a, []), typeof u == "function") {
|
|
1375
1379
|
var m;
|
|
1376
1380
|
(m = n.get(a)) == null || m.push(u), s[a] = function() {
|
|
1377
|
-
for (var g,
|
|
1381
|
+
for (var g, f = arguments.length, d = new Array(f), h = 0; h < f; h++)
|
|
1378
1382
|
d[h] = arguments[h];
|
|
1379
1383
|
return (g = n.get(a)) == null ? void 0 : g.map((p) => p(...d)).find((p) => p !== void 0);
|
|
1380
1384
|
};
|
|
@@ -1386,26 +1390,26 @@ function At(t, e, o) {
|
|
|
1386
1390
|
}
|
|
1387
1391
|
function jn(t) {
|
|
1388
1392
|
t === void 0 && (t = []);
|
|
1389
|
-
const e = t.map((l) => l?.reference), o = t.map((l) => l?.floating), n = t.map((l) => l?.item), r =
|
|
1390
|
-
(l) =>
|
|
1393
|
+
const e = t.map((l) => l?.reference), o = t.map((l) => l?.floating), n = t.map((l) => l?.item), r = v.useCallback(
|
|
1394
|
+
(l) => St(l, t, "reference"),
|
|
1391
1395
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1392
1396
|
e
|
|
1393
|
-
), i =
|
|
1394
|
-
(l) =>
|
|
1397
|
+
), i = v.useCallback(
|
|
1398
|
+
(l) => St(l, t, "floating"),
|
|
1395
1399
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1396
1400
|
o
|
|
1397
|
-
), s =
|
|
1398
|
-
(l) =>
|
|
1401
|
+
), s = v.useCallback(
|
|
1402
|
+
(l) => St(l, t, "item"),
|
|
1399
1403
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1400
1404
|
n
|
|
1401
1405
|
);
|
|
1402
|
-
return
|
|
1406
|
+
return v.useMemo(() => ({
|
|
1403
1407
|
getReferenceProps: r,
|
|
1404
1408
|
getFloatingProps: i,
|
|
1405
1409
|
getItemProps: s
|
|
1406
1410
|
}), [r, i, s]);
|
|
1407
1411
|
}
|
|
1408
|
-
function
|
|
1412
|
+
function Kt(t, e) {
|
|
1409
1413
|
return {
|
|
1410
1414
|
...t,
|
|
1411
1415
|
rects: {
|
|
@@ -1428,7 +1432,7 @@ const zn = (t) => ({
|
|
|
1428
1432
|
offset: i = 0,
|
|
1429
1433
|
index: s = 0,
|
|
1430
1434
|
minItemsVisible: l = 4,
|
|
1431
|
-
referenceOverflowThreshold:
|
|
1435
|
+
referenceOverflowThreshold: c = 0,
|
|
1432
1436
|
scrollRef: a,
|
|
1433
1437
|
...u
|
|
1434
1438
|
} = Z(t, e), {
|
|
@@ -1436,21 +1440,21 @@ const zn = (t) => ({
|
|
|
1436
1440
|
elements: {
|
|
1437
1441
|
floating: g
|
|
1438
1442
|
}
|
|
1439
|
-
} = e,
|
|
1440
|
-
if (process.env.NODE_ENV !== "production" && (e.placement.startsWith("bottom") || Ln('`placement` side must be "bottom" when using the `inner`', "middleware.")), !
|
|
1443
|
+
} = e, f = o.current[s], d = a?.current || g, h = g.clientTop || d.clientTop, p = g.clientTop !== 0, x = d.clientTop !== 0, y = g === d;
|
|
1444
|
+
if (process.env.NODE_ENV !== "production" && (e.placement.startsWith("bottom") || Ln('`placement` side must be "bottom" when using the `inner`', "middleware.")), !f)
|
|
1441
1445
|
return {};
|
|
1442
1446
|
const w = {
|
|
1443
1447
|
...e,
|
|
1444
|
-
...await ge(-
|
|
1445
|
-
}, b = await
|
|
1448
|
+
...await ge(-f.offsetTop - g.clientTop - m.reference.height / 2 - f.offsetHeight / 2 - i).fn(e)
|
|
1449
|
+
}, b = await Rt(Kt(w, d.scrollHeight + h + g.clientTop), u), R = await Rt(w, {
|
|
1446
1450
|
...u,
|
|
1447
1451
|
elementContext: "reference"
|
|
1448
|
-
}),
|
|
1449
|
-
if (d.style.maxHeight = T + "px", d.scrollTop =
|
|
1450
|
-
const
|
|
1451
|
-
dt.flushSync(() => r(
|
|
1452
|
+
}), C = D(0, b.top), A = w.y + C, T = (d.scrollHeight > d.clientHeight ? (E) => E : it)(D(0, d.scrollHeight + (p && y || x ? h * 2 : 0) - C - D(0, b.bottom)));
|
|
1453
|
+
if (d.style.maxHeight = T + "px", d.scrollTop = C, r) {
|
|
1454
|
+
const E = d.offsetHeight < f.offsetHeight * X(l, o.current.length) - 1 || R.top >= -c || R.bottom >= -c;
|
|
1455
|
+
dt.flushSync(() => r(E));
|
|
1452
1456
|
}
|
|
1453
|
-
return n && (n.current = await
|
|
1457
|
+
return n && (n.current = await Rt(Kt({
|
|
1454
1458
|
...w,
|
|
1455
1459
|
y: A
|
|
1456
1460
|
}, d.offsetHeight + h + g.clientTop), u)), {
|
|
@@ -1467,28 +1471,28 @@ function Yn(t, e) {
|
|
|
1467
1471
|
overflowRef: i,
|
|
1468
1472
|
scrollRef: s,
|
|
1469
1473
|
onChange: l
|
|
1470
|
-
} = e,
|
|
1471
|
-
|
|
1474
|
+
} = e, c = pe(l), a = v.useRef(!1), u = v.useRef(null), m = v.useRef(null);
|
|
1475
|
+
v.useEffect(() => {
|
|
1472
1476
|
if (!r) return;
|
|
1473
|
-
function
|
|
1477
|
+
function f(h) {
|
|
1474
1478
|
if (h.ctrlKey || !d || i.current == null)
|
|
1475
1479
|
return;
|
|
1476
|
-
const p = h.deltaY,
|
|
1477
|
-
d.scrollHeight <= d.clientHeight || (!
|
|
1478
|
-
|
|
1480
|
+
const p = h.deltaY, x = i.current.top >= -0.5, y = i.current.bottom >= -0.5, w = d.scrollHeight - d.clientHeight, b = p < 0 ? -1 : 1, R = p < 0 ? "max" : "min";
|
|
1481
|
+
d.scrollHeight <= d.clientHeight || (!x && p > 0 || !y && p < 0 ? (h.preventDefault(), dt.flushSync(() => {
|
|
1482
|
+
c((C) => C + Math[R](p, w * b));
|
|
1479
1483
|
})) : /firefox/i.test(Le()) && (d.scrollTop += p));
|
|
1480
1484
|
}
|
|
1481
1485
|
const d = s?.current || n.floating;
|
|
1482
1486
|
if (o && d)
|
|
1483
|
-
return d.addEventListener("wheel",
|
|
1487
|
+
return d.addEventListener("wheel", f), requestAnimationFrame(() => {
|
|
1484
1488
|
u.current = d.scrollTop, i.current != null && (m.current = {
|
|
1485
1489
|
...i.current
|
|
1486
1490
|
});
|
|
1487
1491
|
}), () => {
|
|
1488
|
-
u.current = null, m.current = null, d.removeEventListener("wheel",
|
|
1492
|
+
u.current = null, m.current = null, d.removeEventListener("wheel", f);
|
|
1489
1493
|
};
|
|
1490
|
-
}, [r, o, n.floating, i, s,
|
|
1491
|
-
const g =
|
|
1494
|
+
}, [r, o, n.floating, i, s, c]);
|
|
1495
|
+
const g = v.useMemo(() => ({
|
|
1492
1496
|
onKeyDown() {
|
|
1493
1497
|
a.current = !0;
|
|
1494
1498
|
},
|
|
@@ -1499,28 +1503,28 @@ function Yn(t, e) {
|
|
|
1499
1503
|
a.current = !1;
|
|
1500
1504
|
},
|
|
1501
1505
|
onScroll() {
|
|
1502
|
-
const
|
|
1503
|
-
if (!(!i.current || !
|
|
1506
|
+
const f = s?.current || n.floating;
|
|
1507
|
+
if (!(!i.current || !f || !a.current)) {
|
|
1504
1508
|
if (u.current !== null) {
|
|
1505
|
-
const d =
|
|
1506
|
-
(i.current.bottom < -0.5 && d < -1 || i.current.top < -0.5 && d > 1) && dt.flushSync(() =>
|
|
1509
|
+
const d = f.scrollTop - u.current;
|
|
1510
|
+
(i.current.bottom < -0.5 && d < -1 || i.current.top < -0.5 && d > 1) && dt.flushSync(() => c((h) => h + d));
|
|
1507
1511
|
}
|
|
1508
1512
|
requestAnimationFrame(() => {
|
|
1509
|
-
u.current =
|
|
1513
|
+
u.current = f.scrollTop;
|
|
1510
1514
|
});
|
|
1511
1515
|
}
|
|
1512
1516
|
}
|
|
1513
|
-
}), [n.floating,
|
|
1514
|
-
return
|
|
1517
|
+
}), [n.floating, c, i, s]);
|
|
1518
|
+
return v.useMemo(() => r ? {
|
|
1515
1519
|
floating: g
|
|
1516
1520
|
} : {}, [r, g]);
|
|
1517
1521
|
}
|
|
1518
|
-
let tt =
|
|
1522
|
+
let tt = Zt({ styles: void 0, setReference: () => {
|
|
1519
1523
|
}, setFloating: () => {
|
|
1520
1524
|
}, getReferenceProps: () => ({}), getFloatingProps: () => ({}), slot: {} });
|
|
1521
1525
|
tt.displayName = "FloatingContext";
|
|
1522
|
-
let
|
|
1523
|
-
|
|
1526
|
+
let Dt = Zt(null);
|
|
1527
|
+
Dt.displayName = "PlacementContext";
|
|
1524
1528
|
function Qn(t) {
|
|
1525
1529
|
return nt(() => t ? typeof t == "string" ? { to: t } : t : null, [t]);
|
|
1526
1530
|
}
|
|
@@ -1536,7 +1540,7 @@ function eo() {
|
|
|
1536
1540
|
}
|
|
1537
1541
|
function no(t = null) {
|
|
1538
1542
|
t === !1 && (t = null), typeof t == "string" && (t = { to: t });
|
|
1539
|
-
let e = ot(
|
|
1543
|
+
let e = ot(Dt), o = nt(() => t, [JSON.stringify(t, (r, i) => {
|
|
1540
1544
|
var s;
|
|
1541
1545
|
return (s = i?.outerHTML) != null ? s : i;
|
|
1542
1546
|
})]);
|
|
@@ -1546,40 +1550,40 @@ function no(t = null) {
|
|
|
1546
1550
|
let n = ot(tt);
|
|
1547
1551
|
return nt(() => [n.setFloating, t ? n.styles : {}], [n.setFloating, t, n.styles]);
|
|
1548
1552
|
}
|
|
1549
|
-
let
|
|
1553
|
+
let Gt = 4;
|
|
1550
1554
|
function oo({ children: t, enabled: e = !0 }) {
|
|
1551
|
-
let [o, n] = et(null), [r, i] = et(0), s = ve(null), [l,
|
|
1555
|
+
let [o, n] = et(null), [r, i] = et(0), s = ve(null), [l, c] = et(null);
|
|
1552
1556
|
qn(l);
|
|
1553
|
-
let a = e && o !== null && l !== null, { to: u = "bottom", gap: m = 0, offset: g = 0, padding:
|
|
1557
|
+
let a = e && o !== null && l !== null, { to: u = "bottom", gap: m = 0, offset: g = 0, padding: f = 0, inner: d } = Un(o, l), [h, p = "center"] = u.split(" ");
|
|
1554
1558
|
lt(() => {
|
|
1555
1559
|
a && i(0);
|
|
1556
1560
|
}, [a]);
|
|
1557
|
-
let { refs:
|
|
1561
|
+
let { refs: x, floatingStyles: y, context: w } = _n({ open: a, placement: h === "selection" ? p === "center" ? "bottom" : `bottom-${p}` : p === "center" ? `${h}` : `${h}-${p}`, strategy: "absolute", transform: !1, middleware: [ge({ mainAxis: h === "selection" ? 0 : m, crossAxis: g }), Sn({ padding: f }), h !== "selection" && An({ padding: f }), h === "selection" && d ? zn({ ...d, padding: f, overflowRef: s, offset: r, minItemsVisible: Gt, referenceOverflowThreshold: f, onFallbackChange(E) {
|
|
1558
1562
|
var $, P;
|
|
1559
|
-
if (!
|
|
1563
|
+
if (!E) return;
|
|
1560
1564
|
let F = w.elements.floating;
|
|
1561
1565
|
if (!F) return;
|
|
1562
|
-
let z = parseFloat(getComputedStyle(F).scrollPaddingBottom) || 0, M = Math.min(
|
|
1563
|
-
for (let
|
|
1564
|
-
let N =
|
|
1565
|
-
if (N >=
|
|
1566
|
+
let z = parseFloat(getComputedStyle(F).scrollPaddingBottom) || 0, M = Math.min(Gt, F.childElementCount), I = 0, S = 0;
|
|
1567
|
+
for (let O of (P = ($ = w.elements.floating) == null ? void 0 : $.childNodes) != null ? P : []) if (Ce(O)) {
|
|
1568
|
+
let N = O.offsetTop, Lt = N + O.clientHeight + z, yt = F.scrollTop, Ht = yt + F.clientHeight;
|
|
1569
|
+
if (N >= yt && Lt <= Ht) M--;
|
|
1566
1570
|
else {
|
|
1567
|
-
|
|
1571
|
+
S = Math.max(0, Math.min(Lt, Ht) - Math.max(N, yt)), I = O.clientHeight;
|
|
1568
1572
|
break;
|
|
1569
1573
|
}
|
|
1570
1574
|
}
|
|
1571
|
-
M >= 1 && i((
|
|
1572
|
-
let N = I * M -
|
|
1573
|
-
return
|
|
1575
|
+
M >= 1 && i((O) => {
|
|
1576
|
+
let N = I * M - S + z;
|
|
1577
|
+
return O >= N ? O : N;
|
|
1574
1578
|
});
|
|
1575
|
-
} }) : null,
|
|
1576
|
-
Object.assign(P.floating.style, { overflow: "auto", maxWidth: `${
|
|
1579
|
+
} }) : null, On({ padding: f, apply({ availableWidth: E, availableHeight: $, elements: P }) {
|
|
1580
|
+
Object.assign(P.floating.style, { overflow: "auto", maxWidth: `${E}px`, maxHeight: `min(var(--anchor-max-height, 100vh), ${$}px)` });
|
|
1577
1581
|
} })].filter(Boolean), whileElementsMounted: hn }), [b = h, R = p] = w.placement.split("-");
|
|
1578
1582
|
h === "selection" && (b = "selection");
|
|
1579
|
-
let
|
|
1580
|
-
|
|
1583
|
+
let C = nt(() => ({ anchor: [b, R].filter(Boolean).join(" ") }), [b, R]), A = Yn(w, { overflowRef: s, onChange: i }), { getReferenceProps: H, getFloatingProps: V } = jn([A]), T = te((E) => {
|
|
1584
|
+
c(E), x.setFloating(E);
|
|
1581
1585
|
});
|
|
1582
|
-
return
|
|
1586
|
+
return v.createElement(Dt.Provider, { value: n }, v.createElement(tt.Provider, { value: { setFloating: T, setReference: x.setReference, styles: y, getReferenceProps: H, getFloatingProps: V, slot: C } }, t));
|
|
1583
1587
|
}
|
|
1584
1588
|
function qn(t) {
|
|
1585
1589
|
lt(() => {
|
|
@@ -1597,32 +1601,32 @@ function qn(t) {
|
|
|
1597
1601
|
}
|
|
1598
1602
|
function Un(t, e) {
|
|
1599
1603
|
var o, n, r;
|
|
1600
|
-
let i =
|
|
1604
|
+
let i = At((o = t?.gap) != null ? o : "var(--anchor-gap, 0)", e), s = At((n = t?.offset) != null ? n : "var(--anchor-offset, 0)", e), l = At((r = t?.padding) != null ? r : "var(--anchor-padding, 0)", e);
|
|
1601
1605
|
return { ...t, gap: i, offset: s, padding: l };
|
|
1602
1606
|
}
|
|
1603
|
-
function
|
|
1604
|
-
let n = Re(), r =
|
|
1605
|
-
if (
|
|
1606
|
-
if (typeof
|
|
1607
|
-
if (typeof
|
|
1607
|
+
function At(t, e, o = void 0) {
|
|
1608
|
+
let n = Re(), r = te((c, a) => {
|
|
1609
|
+
if (c == null) return [o, null];
|
|
1610
|
+
if (typeof c == "number") return [c, null];
|
|
1611
|
+
if (typeof c == "string") {
|
|
1608
1612
|
if (!a) return [o, null];
|
|
1609
|
-
let u =
|
|
1613
|
+
let u = Jt(c, a);
|
|
1610
1614
|
return [u, (m) => {
|
|
1611
|
-
let g = we(
|
|
1615
|
+
let g = we(c);
|
|
1612
1616
|
{
|
|
1613
|
-
let
|
|
1617
|
+
let f = g.map((d) => window.getComputedStyle(a).getPropertyValue(d));
|
|
1614
1618
|
n.requestAnimationFrame(function d() {
|
|
1615
1619
|
n.nextFrame(d);
|
|
1616
1620
|
let h = !1;
|
|
1617
|
-
for (let [
|
|
1621
|
+
for (let [x, y] of g.entries()) {
|
|
1618
1622
|
let w = window.getComputedStyle(a).getPropertyValue(y);
|
|
1619
|
-
if (
|
|
1620
|
-
|
|
1623
|
+
if (f[x] !== w) {
|
|
1624
|
+
f[x] = w, h = !0;
|
|
1621
1625
|
break;
|
|
1622
1626
|
}
|
|
1623
1627
|
}
|
|
1624
1628
|
if (!h) return;
|
|
1625
|
-
let p =
|
|
1629
|
+
let p = Jt(c, a);
|
|
1626
1630
|
u !== p && (m(p), u = p);
|
|
1627
1631
|
});
|
|
1628
1632
|
}
|
|
@@ -1632,8 +1636,8 @@ function Et(t, e, o = void 0) {
|
|
|
1632
1636
|
return [o, null];
|
|
1633
1637
|
}), i = nt(() => r(t, e)[0], [t, e]), [s = i, l] = et();
|
|
1634
1638
|
return lt(() => {
|
|
1635
|
-
let [
|
|
1636
|
-
if (l(
|
|
1639
|
+
let [c, a] = r(t, e);
|
|
1640
|
+
if (l(c), !!a) return a(l);
|
|
1637
1641
|
}, [t, e]), s;
|
|
1638
1642
|
}
|
|
1639
1643
|
function we(t) {
|
|
@@ -1646,7 +1650,7 @@ function we(t) {
|
|
|
1646
1650
|
}
|
|
1647
1651
|
return [];
|
|
1648
1652
|
}
|
|
1649
|
-
function
|
|
1653
|
+
function Jt(t, e) {
|
|
1650
1654
|
let o = document.createElement("div");
|
|
1651
1655
|
e.appendChild(o), o.style.setProperty("margin-top", "0px", "important"), o.style.setProperty("margin-top", t, "important");
|
|
1652
1656
|
let n = parseFloat(window.getComputedStyle(o).marginTop) || 0;
|