@iress-oss/ids-components 5.20.7 → 5.20.8
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/{AutocompleteNoResults-C17GZMC5.js → AutocompleteNoResults-B60rzwfa.js} +1 -1
- package/dist/{ComboboxHiddenInput-Bcgb791z.js → ComboboxHiddenInput-BUswpU00.js} +5 -5
- package/dist/{FieldAppendToLabel-BitJwDPF.js → FieldAppendToLabel-BK8cAMZT.js} +3 -3
- package/dist/{InputBase-B1iM_zGQ.js → InputBase-B6gEHXZ7.js} +1 -1
- package/dist/Loading.module-BXP_0EH0.js +13 -0
- package/dist/{LoadingSuspense-Dpeukkud.js → LoadingSuspense-CuQm3zqO.js} +115 -115
- package/dist/LogoFromSrc-BvialtyP.js +59 -0
- package/dist/MenuItem.module-BFPHZtJl.js +24 -0
- package/dist/Popover.module-oIsv6lht.js +11 -0
- package/dist/{PopoverProvider-LcpEvIV2.js → PopoverProvider-BMBTLkRr.js} +5 -5
- package/dist/{SelectControl-BwOmdZRG.js → SelectControl-Bf6qXlwP.js} +1 -1
- package/dist/{SliderTicks-BUkhZPcp.js → SliderTicks-DRFLh0Rw.js} +1 -1
- package/dist/TabSet.module-Dks7jQfN.js +13 -0
- package/dist/Table.module-BARl9Jy6.js +32 -0
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +3 -3
- package/dist/components/Autocomplete/components/AutocompleteNoResults.js +1 -1
- package/dist/components/Autocomplete/index.js +1 -1
- package/dist/components/Badge/Badge.js +4 -4
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Button/CloseButton/CloseButton.js +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +2 -2
- package/dist/components/ButtonGroup/hooks/useIDSButtonGroupItem.js +1 -1
- package/dist/components/ButtonGroup/index.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/helpers/mapCheckboxGroupOptions.js +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.js +6 -6
- package/dist/components/CheckboxMark/CheckboxMark.types.js +2 -2
- package/dist/components/Combobox/Combobox.js +3 -3
- package/dist/components/Combobox/MultiCombobox/MultiCombobox.js +3 -3
- package/dist/components/Combobox/components/ComboboxHiddenInput.js +1 -1
- package/dist/components/Combobox/components/ComboboxResults.js +4 -4
- package/dist/components/Combobox/components/ComboboxResultsDescriptor.js +2 -2
- package/dist/components/Combobox/index.js +1 -1
- package/dist/components/Expander/Expander.js +1 -1
- package/dist/components/Field/Field.js +1 -1
- package/dist/components/Field/FieldGroup/FieldGroup.js +2 -2
- package/dist/components/Field/components/FieldAppendToLabel.js +3 -3
- package/dist/components/Filter/Filter.js +3 -3
- package/dist/components/Filter/components/FilterResetButton.js +2 -2
- package/dist/components/Filter/components/FilterSearch.js +2 -2
- package/dist/components/Filter/index.js +1 -1
- package/dist/components/Form/Form.js +1 -1
- package/dist/components/Form/FormField/FormField.js +2 -2
- package/dist/components/Form/FormField/FormFieldset.js +2 -2
- package/dist/components/Form/HookForm/HookForm.js +1 -1
- package/dist/components/Form/index.js +1 -1
- package/dist/components/Hide/Hide.js +1 -1
- package/dist/components/Hide/helpers/composeHideClasses.js +2 -2
- package/dist/components/Hide/index.js +1 -1
- package/dist/components/Icon/Icon.js +2 -2
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/Inline/Inline.js +2 -2
- package/dist/components/Inline/index.js +1 -1
- package/dist/components/Input/ClearButton/ClearButton.js +1 -1
- package/dist/components/Input/Input.js +2 -2
- package/dist/components/Input/InputBase/InputBase.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputCurrency/InputCurrency.js +1 -1
- package/dist/components/InputCurrency/index.js +1 -1
- package/dist/components/Label/LabelBase/LabelBase.js +1 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/MenuDivider/MenuDivider.js +2 -2
- package/dist/components/Menu/MenuHeading/MenuHeading.js +2 -2
- package/dist/components/Menu/MenuItem/MenuItem.js +1 -1
- package/dist/components/Menu/MenuItem/hooks/useMenuItemButtonProps.js +1 -1
- package/dist/components/Menu/MenuItem/hooks/useMenuItemComposite.js +2 -2
- package/dist/components/Menu/MenuText/MenuText.js +3 -3
- package/dist/components/Menu/helpers/mapMenuItems.js +1 -1
- package/dist/components/Menu/hooks/useMenuStyles.js +3 -3
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Navbar/Navbar.js +2 -2
- package/dist/components/Navbar/components/HomeLinkContent.js +2 -2
- package/dist/components/Navbar/components/LogoFromSrc.js +1 -1
- package/dist/components/Navbar/components/NavbarLogo.js +2 -2
- package/dist/components/Navbar/index.js +1 -1
- package/dist/components/Placeholder/Placeholder.js +1 -1
- package/dist/components/Popover/InputPopover/InputPopover.js +1 -1
- package/dist/components/Popover/InputPopover/InputPopoverActivator.js +1 -1
- package/dist/components/Popover/InputPopover/InputPopoverProvider.js +2 -2
- package/dist/components/Popover/Popover.js +2 -2
- package/dist/components/Popover/PopoverProvider.js +2 -2
- package/dist/components/Popover/components/NestedPopoverActivator.js +1 -1
- package/dist/components/Popover/components/PopoverActivator.js +1 -1
- package/dist/components/Popover/components/PopoverContent.js +2 -2
- package/dist/components/Popover/helpers/handlePopoverTabKey.js +1 -1
- package/dist/components/Popover/hooks/usePopover.js +1 -1
- package/dist/components/Popover/hooks/usePopoverItem.js +1 -1
- package/dist/components/Popover/hooks/usePopoverNavigation.js +1 -1
- package/dist/components/Progress/Progress.js +1 -1
- package/dist/components/Provider/Provider.js +1 -1
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/Radio/helpers/mapRadioGroupOptions.js +1 -1
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/Readonly/Readonly.js +3 -3
- package/dist/components/Readonly/index.js +1 -1
- package/dist/components/RichSelect/RichSelect.js +2 -2
- package/dist/components/RichSelect/SelectBody/SelectBody.js +2 -2
- package/dist/components/RichSelect/SelectCreate/SelectCreate.js +2 -2
- package/dist/components/RichSelect/SelectHeading/SelectHeading.js +2 -2
- package/dist/components/RichSelect/SelectLabel/SelectLabel.js +1 -1
- package/dist/components/RichSelect/SelectMenu/SelectMenu.js +2 -2
- package/dist/components/RichSelect/SelectMenu/SelectMenuItem.js +2 -2
- package/dist/components/RichSelect/SelectSearch/SelectSearch.js +1 -1
- package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.js +1 -1
- package/dist/components/RichSelect/SelectTags/SelectTags.js +1 -1
- package/dist/components/RichSelect/components/SelectActivator.js +1 -1
- package/dist/components/RichSelect/components/SelectOptions.js +2 -2
- package/dist/components/RichSelect/index.js +1 -1
- package/dist/components/Row/Row.js +2 -2
- package/dist/components/Row/index.js +1 -1
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/components/SelectControl.js +1 -1
- package/dist/components/Select/components/SelectReadonly.js +2 -2
- package/dist/components/Select/helpers/mapSelectOptions.js +1 -1
- package/dist/components/Select/helpers/nodesToSelectOptions.js +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Skeleton/Skeleton.js +2 -2
- package/dist/components/SkipLink/SkipLink.js +1 -1
- package/dist/components/Slideout/Slideout.js +3 -3
- package/dist/components/Slideout/components/SlideoutInner.js +2 -2
- package/dist/components/Slideout/index.js +1 -1
- package/dist/components/Slider/Slider.js +2 -2
- package/dist/components/Slider/components/SliderTicks.js +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Spinner/index.js +1 -1
- package/dist/components/TabSet/Tab/Tab.js +1 -1
- package/dist/components/TabSet/TabSet.js +2 -2
- package/dist/components/TabSet/components/TabSetItem.js +2 -2
- package/dist/components/Table/Table.js +2 -2
- package/dist/components/Table/TableBody/TableBody.js +2 -2
- package/dist/components/Table/components/TableEmpty.js +1 -1
- package/dist/components/Table/components/TableHeader.js +1 -1
- package/dist/components/Table/components/TableHeaderCell.js +1 -1
- package/dist/components/Table/components/TableSortButton.js +2 -2
- package/dist/components/Table/hooks/useIDSTableColumnStyles.js +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/TagInput/TagInput.js +1 -1
- package/dist/components/Tag/components/TagListInput/TagListInput.js +1 -1
- package/dist/components/Tag/index.js +1 -1
- package/dist/components/Toaster/Toast/Toast.js +1 -1
- package/dist/components/Toaster/Toast/ToastAnimated.js +2 -2
- package/dist/components/Toaster/Toast/ToastIcon.js +1 -1
- package/dist/components/Toaster/Toaster.js +2 -2
- package/dist/components/Toaster/ToasterProvider.js +1 -1
- package/dist/components/Toaster/hooks/useToaster.js +1 -1
- package/dist/components/Toaster/index.js +1 -1
- package/dist/components/Toggle/Toggle.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +2 -2
- package/dist/components/ValidationMessage/ValidationBase/ValidationBase.js +1 -1
- package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/{floating-ui.react-BoSeAoXU.js → floating-ui.react-DfIjfJIq.js} +1351 -1312
- package/dist/main.js +2 -2
- package/dist/patterns/Loading/Loading.js +1 -1
- package/dist/patterns/Loading/LoadingSuspense.js +1 -1
- package/dist/patterns/Loading/components/ComponentLoading.js +2 -2
- package/dist/patterns/Loading/components/DefaultLoading.js +2 -2
- package/dist/patterns/Loading/components/LongLoading.js +2 -2
- package/dist/patterns/Loading/components/PageLoading.js +2 -2
- package/dist/patterns/Loading/components/StartUpLoading.js +2 -2
- package/dist/patterns/Loading/components/ValidateLoading.js +2 -2
- package/dist/patterns/Loading/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{useIDSButtonGroupItem-B2tN1t3Z.js → useIDSButtonGroupItem-DXJpvTGd.js} +1 -1
- package/package.json +22 -22
- package/dist/Loading.module-CKBFK8HQ.js +0 -13
- package/dist/LogoFromSrc-Bmy4soAb.js +0 -59
- package/dist/MenuItem.module-CqRjlcI0.js +0 -24
- package/dist/Popover.module-DAzssZjn.js +0 -11
- package/dist/TabSet.module-DO_A1O9o.js +0 -13
- package/dist/Table.module-p7T7USNr.js +0 -32
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as d from "react";
|
|
2
|
-
import { useLayoutEffect as
|
|
3
|
-
import { t as
|
|
4
|
-
import { jsx as me, jsxs as
|
|
2
|
+
import { useLayoutEffect as qn } from "react";
|
|
3
|
+
import { t as St, i as Xn, f as Lr } from "./index.esm-CL8gh5wr.js";
|
|
4
|
+
import { jsx as me, jsxs as Yn, Fragment as kr } from "react/jsx-runtime";
|
|
5
5
|
import * as nn from "react-dom";
|
|
6
|
-
function
|
|
6
|
+
function Pt() {
|
|
7
7
|
return typeof window < "u";
|
|
8
8
|
}
|
|
9
9
|
function We(e) {
|
|
@@ -13,73 +13,73 @@ function pe(e) {
|
|
|
13
13
|
var t;
|
|
14
14
|
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function Oe(e) {
|
|
17
17
|
var t;
|
|
18
18
|
return (t = (rn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
19
19
|
}
|
|
20
20
|
function rn(e) {
|
|
21
|
-
return
|
|
21
|
+
return Pt() ? e instanceof Node || e instanceof pe(e).Node : !1;
|
|
22
22
|
}
|
|
23
23
|
function Y(e) {
|
|
24
|
-
return
|
|
24
|
+
return Pt() ? e instanceof Element || e instanceof pe(e).Element : !1;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function re(e) {
|
|
27
|
+
return Pt() ? e instanceof HTMLElement || e instanceof pe(e).HTMLElement : !1;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return !
|
|
29
|
+
function Rt(e) {
|
|
30
|
+
return !Pt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof pe(e).ShadowRoot;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
function ut(e) {
|
|
32
|
+
function lt(e) {
|
|
34
33
|
const {
|
|
35
34
|
overflow: t,
|
|
36
35
|
overflowX: n,
|
|
37
36
|
overflowY: r,
|
|
38
37
|
display: o
|
|
39
38
|
} = we(e);
|
|
40
|
-
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) &&
|
|
39
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && o !== "inline" && o !== "contents";
|
|
41
40
|
}
|
|
42
|
-
const kr = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
43
41
|
function Fr(e) {
|
|
44
|
-
return
|
|
42
|
+
return /^(table|td|th)$/.test(We(e));
|
|
45
43
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
44
|
+
function Dt(e) {
|
|
45
|
+
try {
|
|
46
|
+
if (e.matches(":popover-open"))
|
|
47
|
+
return !0;
|
|
48
|
+
} catch {
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
return e.matches(":modal");
|
|
52
|
+
} catch {
|
|
53
|
+
return !1;
|
|
54
|
+
}
|
|
55
55
|
}
|
|
56
|
-
const
|
|
56
|
+
const Nr = /transform|translate|scale|rotate|perspective|filter/, _r = /paint|layout|strict|content/, $e = (e) => !!e && e !== "none";
|
|
57
|
+
let Wt;
|
|
57
58
|
function on(e) {
|
|
58
|
-
const t =
|
|
59
|
-
return
|
|
59
|
+
const t = Y(e) ? we(e) : e;
|
|
60
|
+
return $e(t.transform) || $e(t.translate) || $e(t.scale) || $e(t.rotate) || $e(t.perspective) || !Lt() && ($e(t.backdropFilter) || $e(t.filter)) || Nr.test(t.willChange || "") || _r.test(t.contain || "");
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
+
function Wr(e) {
|
|
62
63
|
let t = Pe(e);
|
|
63
|
-
for (;
|
|
64
|
+
for (; re(t) && !Se(t); ) {
|
|
64
65
|
if (on(t))
|
|
65
66
|
return t;
|
|
66
|
-
if (
|
|
67
|
+
if (Dt(t))
|
|
67
68
|
return null;
|
|
68
69
|
t = Pe(t);
|
|
69
70
|
}
|
|
70
71
|
return null;
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
-
return typeof CSS
|
|
73
|
+
function Lt() {
|
|
74
|
+
return Wt == null && (Wt = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), Wt;
|
|
74
75
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return $r.has(We(e));
|
|
76
|
+
function Se(e) {
|
|
77
|
+
return /^(html|body|#document)$/.test(We(e));
|
|
78
78
|
}
|
|
79
79
|
function we(e) {
|
|
80
80
|
return pe(e).getComputedStyle(e);
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function kt(e) {
|
|
83
83
|
return Y(e) ? {
|
|
84
84
|
scrollLeft: e.scrollLeft,
|
|
85
85
|
scrollTop: e.scrollTop
|
|
@@ -95,44 +95,41 @@ function Pe(e) {
|
|
|
95
95
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
96
96
|
e.assignedSlot || // DOM Element detected.
|
|
97
97
|
e.parentNode || // ShadowRoot detected.
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
Rt(e) && e.host || // Fallback.
|
|
99
|
+
Oe(e)
|
|
100
100
|
);
|
|
101
|
-
return
|
|
101
|
+
return Rt(t) ? t.host : t;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function Jn(e) {
|
|
104
104
|
const t = Pe(e);
|
|
105
|
-
return
|
|
105
|
+
return Se(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : re(t) && lt(t) ? t : Jn(t);
|
|
106
106
|
}
|
|
107
107
|
function ke(e, t, n) {
|
|
108
108
|
var r;
|
|
109
109
|
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
110
|
-
const o =
|
|
110
|
+
const o = Jn(e), s = o === ((r = e.ownerDocument) == null ? void 0 : r.body), i = pe(o);
|
|
111
111
|
if (s) {
|
|
112
112
|
const c = Qt(i);
|
|
113
|
-
return t.concat(i, i.visualViewport || [],
|
|
114
|
-
}
|
|
115
|
-
|
|
113
|
+
return t.concat(i, i.visualViewport || [], lt(o) ? o : [], c && n ? ke(c) : []);
|
|
114
|
+
} else
|
|
115
|
+
return t.concat(o, ke(o, [], n));
|
|
116
116
|
}
|
|
117
117
|
function Qt(e) {
|
|
118
118
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
119
119
|
}
|
|
120
|
-
const
|
|
120
|
+
const Kr = ["top", "right", "bottom", "left"], gn = ["start", "end"], hn = /* @__PURE__ */ Kr.reduce((e, t) => e.concat(t, t + "-" + gn[0], t + "-" + gn[1]), []), Qe = Math.min, he = Math.max, Et = Math.round, qe = Math.floor, Ee = (e) => ({
|
|
121
121
|
x: e,
|
|
122
122
|
y: e
|
|
123
|
-
}),
|
|
123
|
+
}), $r = {
|
|
124
124
|
left: "right",
|
|
125
125
|
right: "left",
|
|
126
126
|
bottom: "top",
|
|
127
127
|
top: "bottom"
|
|
128
|
-
}, zr = {
|
|
129
|
-
start: "end",
|
|
130
|
-
end: "start"
|
|
131
128
|
};
|
|
132
|
-
function
|
|
133
|
-
return he(e,
|
|
129
|
+
function vn(e, t, n) {
|
|
130
|
+
return he(e, Qe(t, n));
|
|
134
131
|
}
|
|
135
|
-
function
|
|
132
|
+
function Ze(e, t) {
|
|
136
133
|
return typeof e == "function" ? e(t) : e;
|
|
137
134
|
}
|
|
138
135
|
function Ie(e) {
|
|
@@ -141,54 +138,55 @@ function Ie(e) {
|
|
|
141
138
|
function Ce(e) {
|
|
142
139
|
return e.split("-")[1];
|
|
143
140
|
}
|
|
144
|
-
function
|
|
141
|
+
function Qn(e) {
|
|
145
142
|
return e === "x" ? "y" : "x";
|
|
146
143
|
}
|
|
147
|
-
function
|
|
144
|
+
function Zn(e) {
|
|
148
145
|
return e === "y" ? "height" : "width";
|
|
149
146
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return
|
|
147
|
+
function Me(e) {
|
|
148
|
+
const t = e[0];
|
|
149
|
+
return t === "t" || t === "b" ? "y" : "x";
|
|
153
150
|
}
|
|
154
|
-
function
|
|
155
|
-
return
|
|
151
|
+
function er(e) {
|
|
152
|
+
return Qn(Me(e));
|
|
156
153
|
}
|
|
157
|
-
function
|
|
154
|
+
function tr(e, t, n) {
|
|
158
155
|
n === void 0 && (n = !1);
|
|
159
|
-
const r = Ce(e), o =
|
|
156
|
+
const r = Ce(e), o = er(e), s = Zn(o);
|
|
160
157
|
let i = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
161
|
-
return t.reference[s] > t.floating[s] && (i =
|
|
158
|
+
return t.reference[s] > t.floating[s] && (i = It(i)), [i, It(i)];
|
|
162
159
|
}
|
|
163
|
-
function
|
|
164
|
-
const t =
|
|
165
|
-
return [
|
|
160
|
+
function Vr(e) {
|
|
161
|
+
const t = It(e);
|
|
162
|
+
return [Ct(e), t, Ct(t)];
|
|
166
163
|
}
|
|
167
|
-
function
|
|
168
|
-
return e.replace(
|
|
164
|
+
function Ct(e) {
|
|
165
|
+
return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
|
|
169
166
|
}
|
|
170
|
-
const
|
|
171
|
-
function
|
|
167
|
+
const bn = ["left", "right"], yn = ["right", "left"], Br = ["top", "bottom"], Hr = ["bottom", "top"];
|
|
168
|
+
function zr(e, t, n) {
|
|
172
169
|
switch (e) {
|
|
173
170
|
case "top":
|
|
174
171
|
case "bottom":
|
|
175
|
-
return n ? t ?
|
|
172
|
+
return n ? t ? yn : bn : t ? bn : yn;
|
|
176
173
|
case "left":
|
|
177
174
|
case "right":
|
|
178
|
-
return t ?
|
|
175
|
+
return t ? Br : Hr;
|
|
179
176
|
default:
|
|
180
177
|
return [];
|
|
181
178
|
}
|
|
182
179
|
}
|
|
183
|
-
function
|
|
180
|
+
function Ur(e, t, n, r) {
|
|
184
181
|
const o = Ce(e);
|
|
185
|
-
let s =
|
|
186
|
-
return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(
|
|
182
|
+
let s = zr(Ie(e), n === "start", r);
|
|
183
|
+
return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(Ct)))), s;
|
|
187
184
|
}
|
|
188
|
-
function
|
|
189
|
-
|
|
185
|
+
function It(e) {
|
|
186
|
+
const t = Ie(e);
|
|
187
|
+
return $r[t] + e.slice(t.length);
|
|
190
188
|
}
|
|
191
|
-
function
|
|
189
|
+
function Gr(e) {
|
|
192
190
|
return {
|
|
193
191
|
top: 0,
|
|
194
192
|
right: 0,
|
|
@@ -197,15 +195,15 @@ function Jr(e) {
|
|
|
197
195
|
...e
|
|
198
196
|
};
|
|
199
197
|
}
|
|
200
|
-
function
|
|
201
|
-
return typeof e != "number" ?
|
|
198
|
+
function jr(e) {
|
|
199
|
+
return typeof e != "number" ? Gr(e) : {
|
|
202
200
|
top: e,
|
|
203
201
|
right: e,
|
|
204
202
|
bottom: e,
|
|
205
203
|
left: e
|
|
206
204
|
};
|
|
207
205
|
}
|
|
208
|
-
function
|
|
206
|
+
function Ot(e) {
|
|
209
207
|
const {
|
|
210
208
|
x: t,
|
|
211
209
|
y: n,
|
|
@@ -227,7 +225,7 @@ function sn() {
|
|
|
227
225
|
const e = navigator.userAgentData;
|
|
228
226
|
return e != null && e.platform ? e.platform : navigator.platform;
|
|
229
227
|
}
|
|
230
|
-
function
|
|
228
|
+
function nr() {
|
|
231
229
|
const e = navigator.userAgentData;
|
|
232
230
|
return e && Array.isArray(e.brands) ? e.brands.map((t) => {
|
|
233
231
|
let {
|
|
@@ -237,20 +235,20 @@ function er() {
|
|
|
237
235
|
return n + "/" + r;
|
|
238
236
|
}).join(" ") : navigator.userAgent;
|
|
239
237
|
}
|
|
240
|
-
function
|
|
238
|
+
function rr() {
|
|
241
239
|
return /apple/i.test(navigator.vendor);
|
|
242
240
|
}
|
|
243
241
|
function Zt() {
|
|
244
242
|
const e = /android/i;
|
|
245
|
-
return e.test(sn()) || e.test(
|
|
243
|
+
return e.test(sn()) || e.test(nr());
|
|
246
244
|
}
|
|
247
|
-
function
|
|
245
|
+
function qr() {
|
|
248
246
|
return sn().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
249
247
|
}
|
|
250
|
-
function
|
|
251
|
-
return
|
|
248
|
+
function or() {
|
|
249
|
+
return nr().includes("jsdom/");
|
|
252
250
|
}
|
|
253
|
-
const
|
|
251
|
+
const wn = "data-floating-ui-focusable", Xr = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])", Kt = "ArrowLeft", $t = "ArrowRight", Yr = "ArrowUp", Jr = "ArrowDown";
|
|
254
252
|
function Re(e) {
|
|
255
253
|
let t = e.activeElement;
|
|
256
254
|
for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
|
|
@@ -265,7 +263,7 @@ function ce(e, t) {
|
|
|
265
263
|
const n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
266
264
|
if (e.contains(t))
|
|
267
265
|
return !0;
|
|
268
|
-
if (n &&
|
|
266
|
+
if (n && Rt(n)) {
|
|
269
267
|
let r = t;
|
|
270
268
|
for (; r; ) {
|
|
271
269
|
if (e === r)
|
|
@@ -278,7 +276,7 @@ function ce(e, t) {
|
|
|
278
276
|
function Ae(e) {
|
|
279
277
|
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
280
278
|
}
|
|
281
|
-
function
|
|
279
|
+
function Vt(e, t) {
|
|
282
280
|
if (t == null)
|
|
283
281
|
return !1;
|
|
284
282
|
if ("composedPath" in e)
|
|
@@ -286,45 +284,45 @@ function Kt(e, t) {
|
|
|
286
284
|
const n = e;
|
|
287
285
|
return n.target != null && t.contains(n.target);
|
|
288
286
|
}
|
|
289
|
-
function
|
|
287
|
+
function Qr(e) {
|
|
290
288
|
return e.matches("html,body");
|
|
291
289
|
}
|
|
292
290
|
function le(e) {
|
|
293
291
|
return e?.ownerDocument || document;
|
|
294
292
|
}
|
|
295
293
|
function cn(e) {
|
|
296
|
-
return
|
|
294
|
+
return re(e) && e.matches(Xr);
|
|
297
295
|
}
|
|
298
296
|
function en(e) {
|
|
299
297
|
return e ? e.getAttribute("role") === "combobox" && cn(e) : !1;
|
|
300
298
|
}
|
|
301
|
-
function
|
|
302
|
-
if (!e ||
|
|
299
|
+
function Zr(e) {
|
|
300
|
+
if (!e || or()) return !0;
|
|
303
301
|
try {
|
|
304
302
|
return e.matches(":focus-visible");
|
|
305
303
|
} catch {
|
|
306
304
|
return !0;
|
|
307
305
|
}
|
|
308
306
|
}
|
|
309
|
-
function
|
|
310
|
-
return e ? e.hasAttribute(
|
|
307
|
+
function Tt(e) {
|
|
308
|
+
return e ? e.hasAttribute(wn) ? e : e.querySelector("[" + wn + "]") || e : null;
|
|
311
309
|
}
|
|
312
|
-
function
|
|
310
|
+
function Be(e, t, n) {
|
|
313
311
|
return n === void 0 && (n = !0), e.filter((o) => {
|
|
314
312
|
var s;
|
|
315
313
|
return o.parentId === t && (!n || ((s = o.context) == null ? void 0 : s.open));
|
|
316
|
-
}).flatMap((o) => [o,
|
|
314
|
+
}).flatMap((o) => [o, ...Be(e, o.id, n)]);
|
|
317
315
|
}
|
|
318
|
-
function
|
|
316
|
+
function eo(e, t) {
|
|
319
317
|
let n, r = -1;
|
|
320
318
|
function o(s, i) {
|
|
321
|
-
i > r && (n = s, r = i),
|
|
322
|
-
o(
|
|
319
|
+
i > r && (n = s, r = i), Be(e, s).forEach((f) => {
|
|
320
|
+
o(f.id, i + 1);
|
|
323
321
|
});
|
|
324
322
|
}
|
|
325
323
|
return o(t, 0), e.find((s) => s.id === n);
|
|
326
324
|
}
|
|
327
|
-
function
|
|
325
|
+
function xn(e, t) {
|
|
328
326
|
var n;
|
|
329
327
|
let r = [], o = (n = e.find((s) => s.id === t)) == null ? void 0 : n.parentId;
|
|
330
328
|
for (; o; ) {
|
|
@@ -336,23 +334,23 @@ function wn(e, t) {
|
|
|
336
334
|
function de(e) {
|
|
337
335
|
e.preventDefault(), e.stopPropagation();
|
|
338
336
|
}
|
|
339
|
-
function
|
|
337
|
+
function to(e) {
|
|
340
338
|
return "nativeEvent" in e;
|
|
341
339
|
}
|
|
342
|
-
function
|
|
340
|
+
function ir(e) {
|
|
343
341
|
return e.mozInputSource === 0 && e.isTrusted ? !0 : Zt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
344
342
|
}
|
|
345
|
-
function
|
|
346
|
-
return
|
|
343
|
+
function sr(e) {
|
|
344
|
+
return or() ? !1 : !Zt() && e.width === 0 && e.height === 0 || Zt() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
|
|
347
345
|
e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
|
|
348
346
|
}
|
|
349
|
-
function
|
|
347
|
+
function st(e, t) {
|
|
350
348
|
const n = ["mouse", "pen"];
|
|
351
349
|
return t || n.push("", void 0), n.includes(e);
|
|
352
350
|
}
|
|
353
|
-
var
|
|
354
|
-
}, X =
|
|
355
|
-
const
|
|
351
|
+
var no = typeof document < "u", ro = function() {
|
|
352
|
+
}, X = no ? qn : ro;
|
|
353
|
+
const oo = {
|
|
356
354
|
...d
|
|
357
355
|
};
|
|
358
356
|
function ye(e) {
|
|
@@ -361,13 +359,13 @@ function ye(e) {
|
|
|
361
359
|
t.current = e;
|
|
362
360
|
}), t;
|
|
363
361
|
}
|
|
364
|
-
const
|
|
362
|
+
const io = oo.useInsertionEffect, so = io || ((e) => e());
|
|
365
363
|
function ie(e) {
|
|
366
364
|
const t = d.useRef(() => {
|
|
367
365
|
if (process.env.NODE_ENV !== "production")
|
|
368
366
|
throw new Error("Cannot call an event handler while rendering.");
|
|
369
367
|
});
|
|
370
|
-
return
|
|
368
|
+
return so(() => {
|
|
371
369
|
t.current = e;
|
|
372
370
|
}), d.useCallback(function() {
|
|
373
371
|
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
@@ -375,13 +373,13 @@ function ie(e) {
|
|
|
375
373
|
return t.current == null ? void 0 : t.current(...r);
|
|
376
374
|
}, []);
|
|
377
375
|
}
|
|
378
|
-
function
|
|
376
|
+
function gt(e, t, n) {
|
|
379
377
|
return Math.floor(e / t) !== n;
|
|
380
378
|
}
|
|
381
|
-
function
|
|
379
|
+
function Xe(e, t) {
|
|
382
380
|
return t < 0 || t >= e.current.length;
|
|
383
381
|
}
|
|
384
|
-
function
|
|
382
|
+
function wt(e, t) {
|
|
385
383
|
return ue(e, {
|
|
386
384
|
disabledIndices: t
|
|
387
385
|
});
|
|
@@ -402,10 +400,10 @@ function ue(e, t) {
|
|
|
402
400
|
} = t === void 0 ? {} : t, i = n;
|
|
403
401
|
do
|
|
404
402
|
i += r ? -s : s;
|
|
405
|
-
while (i >= 0 && i <= e.current.length - 1 &&
|
|
403
|
+
while (i >= 0 && i <= e.current.length - 1 && He(e, i, o));
|
|
406
404
|
return i;
|
|
407
405
|
}
|
|
408
|
-
function
|
|
406
|
+
function cr(e, t) {
|
|
409
407
|
let {
|
|
410
408
|
event: n,
|
|
411
409
|
orientation: r,
|
|
@@ -413,88 +411,88 @@ function ir(e, t) {
|
|
|
413
411
|
rtl: s,
|
|
414
412
|
cols: i,
|
|
415
413
|
disabledIndices: c,
|
|
416
|
-
minIndex:
|
|
414
|
+
minIndex: f,
|
|
417
415
|
maxIndex: l,
|
|
418
416
|
prevIndex: u,
|
|
419
|
-
stopEvent:
|
|
420
|
-
} = t,
|
|
421
|
-
if (n.key ===
|
|
422
|
-
if (
|
|
423
|
-
|
|
424
|
-
else if (
|
|
425
|
-
startingIndex:
|
|
417
|
+
stopEvent: p = !1
|
|
418
|
+
} = t, m = u;
|
|
419
|
+
if (n.key === Yr) {
|
|
420
|
+
if (p && de(n), u === -1)
|
|
421
|
+
m = l;
|
|
422
|
+
else if (m = ue(e, {
|
|
423
|
+
startingIndex: m,
|
|
426
424
|
amount: i,
|
|
427
425
|
decrement: !0,
|
|
428
426
|
disabledIndices: c
|
|
429
|
-
}), o && (u - i <
|
|
430
|
-
const
|
|
431
|
-
v ===
|
|
427
|
+
}), o && (u - i < f || m < 0)) {
|
|
428
|
+
const a = u % i, v = l % i, g = l - (v - a);
|
|
429
|
+
v === a ? m = l : m = v > a ? g : g - i;
|
|
432
430
|
}
|
|
433
|
-
|
|
431
|
+
Xe(e, m) && (m = u);
|
|
434
432
|
}
|
|
435
|
-
if (n.key ===
|
|
433
|
+
if (n.key === Jr && (p && de(n), u === -1 ? m = f : (m = ue(e, {
|
|
436
434
|
startingIndex: u,
|
|
437
435
|
amount: i,
|
|
438
436
|
disabledIndices: c
|
|
439
|
-
}), o && u + i > l && (
|
|
437
|
+
}), o && u + i > l && (m = ue(e, {
|
|
440
438
|
startingIndex: u % i - i,
|
|
441
439
|
amount: i,
|
|
442
440
|
disabledIndices: c
|
|
443
|
-
}))),
|
|
444
|
-
const
|
|
445
|
-
n.key === (s ?
|
|
441
|
+
}))), Xe(e, m) && (m = u)), r === "both") {
|
|
442
|
+
const a = qe(u / i);
|
|
443
|
+
n.key === (s ? Kt : $t) && (p && de(n), u % i !== i - 1 ? (m = ue(e, {
|
|
446
444
|
startingIndex: u,
|
|
447
445
|
disabledIndices: c
|
|
448
|
-
}), o &&
|
|
446
|
+
}), o && gt(m, i, a) && (m = ue(e, {
|
|
449
447
|
startingIndex: u - u % i - 1,
|
|
450
448
|
disabledIndices: c
|
|
451
|
-
}))) : o && (
|
|
449
|
+
}))) : o && (m = ue(e, {
|
|
452
450
|
startingIndex: u - u % i - 1,
|
|
453
451
|
disabledIndices: c
|
|
454
|
-
})),
|
|
452
|
+
})), gt(m, i, a) && (m = u)), n.key === (s ? $t : Kt) && (p && de(n), u % i !== 0 ? (m = ue(e, {
|
|
455
453
|
startingIndex: u,
|
|
456
454
|
decrement: !0,
|
|
457
455
|
disabledIndices: c
|
|
458
|
-
}), o &&
|
|
456
|
+
}), o && gt(m, i, a) && (m = ue(e, {
|
|
459
457
|
startingIndex: u + (i - u % i),
|
|
460
458
|
decrement: !0,
|
|
461
459
|
disabledIndices: c
|
|
462
|
-
}))) : o && (
|
|
460
|
+
}))) : o && (m = ue(e, {
|
|
463
461
|
startingIndex: u + (i - u % i),
|
|
464
462
|
decrement: !0,
|
|
465
463
|
disabledIndices: c
|
|
466
|
-
})),
|
|
467
|
-
const v =
|
|
468
|
-
|
|
464
|
+
})), gt(m, i, a) && (m = u));
|
|
465
|
+
const v = qe(l / i) === a;
|
|
466
|
+
Xe(e, m) && (o && v ? m = n.key === (s ? $t : Kt) ? l : ue(e, {
|
|
469
467
|
startingIndex: u - u % i - 1,
|
|
470
468
|
disabledIndices: c
|
|
471
|
-
}) :
|
|
469
|
+
}) : m = u);
|
|
472
470
|
}
|
|
473
|
-
return
|
|
471
|
+
return m;
|
|
474
472
|
}
|
|
475
|
-
function
|
|
473
|
+
function ur(e, t, n) {
|
|
476
474
|
const r = [];
|
|
477
475
|
let o = 0;
|
|
478
476
|
return e.forEach((s, i) => {
|
|
479
477
|
let {
|
|
480
478
|
width: c,
|
|
481
|
-
height:
|
|
479
|
+
height: f
|
|
482
480
|
} = s;
|
|
483
481
|
if (c > t && process.env.NODE_ENV !== "production")
|
|
484
482
|
throw new Error("[Floating UI]: Invalid grid - item width at index " + i + " is greater than grid columns");
|
|
485
483
|
let l = !1;
|
|
486
484
|
for (n && (o = 0); !l; ) {
|
|
487
485
|
const u = [];
|
|
488
|
-
for (let
|
|
489
|
-
for (let
|
|
490
|
-
u.push(o +
|
|
491
|
-
o % t + c <= t && u.every((
|
|
492
|
-
r[
|
|
486
|
+
for (let p = 0; p < c; p++)
|
|
487
|
+
for (let m = 0; m < f; m++)
|
|
488
|
+
u.push(o + p + m * t);
|
|
489
|
+
o % t + c <= t && u.every((p) => r[p] == null) ? (u.forEach((p) => {
|
|
490
|
+
r[p] = i;
|
|
493
491
|
}), l = !0) : o++;
|
|
494
492
|
}
|
|
495
493
|
}), [...r];
|
|
496
494
|
}
|
|
497
|
-
function
|
|
495
|
+
function lr(e, t, n, r, o) {
|
|
498
496
|
if (e === -1) return -1;
|
|
499
497
|
const s = n.indexOf(e), i = t[e];
|
|
500
498
|
switch (o) {
|
|
@@ -508,10 +506,10 @@ function cr(e, t, n, r, o) {
|
|
|
508
506
|
return n.lastIndexOf(e);
|
|
509
507
|
}
|
|
510
508
|
}
|
|
511
|
-
function
|
|
509
|
+
function ar(e, t) {
|
|
512
510
|
return t.flatMap((n, r) => e.includes(n) ? [r] : []);
|
|
513
511
|
}
|
|
514
|
-
function
|
|
512
|
+
function He(e, t, n) {
|
|
515
513
|
if (typeof n == "function")
|
|
516
514
|
return n(t);
|
|
517
515
|
if (n)
|
|
@@ -519,7 +517,7 @@ function Be(e, t, n) {
|
|
|
519
517
|
const r = e.current[t];
|
|
520
518
|
return r == null || r.hasAttribute("disabled") || r.getAttribute("aria-disabled") === "true";
|
|
521
519
|
}
|
|
522
|
-
const
|
|
520
|
+
const at = () => ({
|
|
523
521
|
getShadowRoot: !0,
|
|
524
522
|
displayCheck: (
|
|
525
523
|
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
@@ -528,191 +526,195 @@ const lt = () => ({
|
|
|
528
526
|
typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
529
527
|
)
|
|
530
528
|
});
|
|
531
|
-
function
|
|
532
|
-
const n =
|
|
529
|
+
function fr(e, t) {
|
|
530
|
+
const n = St(e, at()), r = n.length;
|
|
533
531
|
if (r === 0) return;
|
|
534
532
|
const o = Re(le(e)), s = n.indexOf(o), i = s === -1 ? t === 1 ? 0 : r - 1 : s + t;
|
|
535
533
|
return n[i];
|
|
536
534
|
}
|
|
537
|
-
function
|
|
538
|
-
return
|
|
535
|
+
function dr(e) {
|
|
536
|
+
return fr(le(e).body, 1) || e;
|
|
539
537
|
}
|
|
540
|
-
function
|
|
541
|
-
return
|
|
538
|
+
function mr(e) {
|
|
539
|
+
return fr(le(e).body, -1) || e;
|
|
542
540
|
}
|
|
543
|
-
function
|
|
541
|
+
function it(e, t) {
|
|
544
542
|
const n = t || e.currentTarget, r = e.relatedTarget;
|
|
545
543
|
return !r || !ce(n, r);
|
|
546
544
|
}
|
|
547
|
-
function
|
|
548
|
-
|
|
545
|
+
function co(e) {
|
|
546
|
+
St(e, at()).forEach((n) => {
|
|
549
547
|
n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
|
|
550
548
|
});
|
|
551
549
|
}
|
|
552
|
-
function
|
|
550
|
+
function Rn(e) {
|
|
553
551
|
e.querySelectorAll("[data-tabindex]").forEach((n) => {
|
|
554
552
|
const r = n.dataset.tabindex;
|
|
555
553
|
delete n.dataset.tabindex, r ? n.setAttribute("tabindex", r) : n.removeAttribute("tabindex");
|
|
556
554
|
});
|
|
557
555
|
}
|
|
558
|
-
function
|
|
556
|
+
function En(e, t, n) {
|
|
559
557
|
let {
|
|
560
558
|
reference: r,
|
|
561
559
|
floating: o
|
|
562
560
|
} = e;
|
|
563
|
-
const s =
|
|
564
|
-
let
|
|
565
|
-
switch (
|
|
561
|
+
const s = Me(t), i = er(t), c = Zn(i), f = Ie(t), l = s === "y", u = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2, m = r[c] / 2 - o[c] / 2;
|
|
562
|
+
let a;
|
|
563
|
+
switch (f) {
|
|
566
564
|
case "top":
|
|
567
|
-
|
|
565
|
+
a = {
|
|
568
566
|
x: u,
|
|
569
567
|
y: r.y - o.height
|
|
570
568
|
};
|
|
571
569
|
break;
|
|
572
570
|
case "bottom":
|
|
573
|
-
|
|
571
|
+
a = {
|
|
574
572
|
x: u,
|
|
575
573
|
y: r.y + r.height
|
|
576
574
|
};
|
|
577
575
|
break;
|
|
578
576
|
case "right":
|
|
579
|
-
|
|
577
|
+
a = {
|
|
580
578
|
x: r.x + r.width,
|
|
581
|
-
y:
|
|
579
|
+
y: p
|
|
582
580
|
};
|
|
583
581
|
break;
|
|
584
582
|
case "left":
|
|
585
|
-
|
|
583
|
+
a = {
|
|
586
584
|
x: r.x - o.width,
|
|
587
|
-
y:
|
|
585
|
+
y: p
|
|
588
586
|
};
|
|
589
587
|
break;
|
|
590
588
|
default:
|
|
591
|
-
|
|
589
|
+
a = {
|
|
592
590
|
x: r.x,
|
|
593
591
|
y: r.y
|
|
594
592
|
};
|
|
595
593
|
}
|
|
596
594
|
switch (Ce(t)) {
|
|
597
595
|
case "start":
|
|
598
|
-
|
|
596
|
+
a[i] -= m * (n && l ? -1 : 1);
|
|
599
597
|
break;
|
|
600
598
|
case "end":
|
|
601
|
-
|
|
599
|
+
a[i] += m * (n && l ? -1 : 1);
|
|
602
600
|
break;
|
|
603
601
|
}
|
|
604
|
-
return
|
|
602
|
+
return a;
|
|
603
|
+
}
|
|
604
|
+
async function uo(e, t) {
|
|
605
|
+
var n;
|
|
606
|
+
t === void 0 && (t = {});
|
|
607
|
+
const {
|
|
608
|
+
x: r,
|
|
609
|
+
y: o,
|
|
610
|
+
platform: s,
|
|
611
|
+
rects: i,
|
|
612
|
+
elements: c,
|
|
613
|
+
strategy: f
|
|
614
|
+
} = e, {
|
|
615
|
+
boundary: l = "clippingAncestors",
|
|
616
|
+
rootBoundary: u = "viewport",
|
|
617
|
+
elementContext: p = "floating",
|
|
618
|
+
altBoundary: m = !1,
|
|
619
|
+
padding: a = 0
|
|
620
|
+
} = Ze(t, e), v = jr(a), w = c[m ? p === "floating" ? "reference" : "floating" : p], x = Ot(await s.getClippingRect({
|
|
621
|
+
element: (n = await (s.isElement == null ? void 0 : s.isElement(w))) == null || n ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
|
|
622
|
+
boundary: l,
|
|
623
|
+
rootBoundary: u,
|
|
624
|
+
strategy: f
|
|
625
|
+
})), b = p === "floating" ? {
|
|
626
|
+
x: r,
|
|
627
|
+
y: o,
|
|
628
|
+
width: i.floating.width,
|
|
629
|
+
height: i.floating.height
|
|
630
|
+
} : i.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), C = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
|
|
631
|
+
x: 1,
|
|
632
|
+
y: 1
|
|
633
|
+
} : {
|
|
634
|
+
x: 1,
|
|
635
|
+
y: 1
|
|
636
|
+
}, D = Ot(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
637
|
+
elements: c,
|
|
638
|
+
rect: b,
|
|
639
|
+
offsetParent: y,
|
|
640
|
+
strategy: f
|
|
641
|
+
}) : b);
|
|
642
|
+
return {
|
|
643
|
+
top: (x.top - D.top + v.top) / C.y,
|
|
644
|
+
bottom: (D.bottom - x.bottom + v.bottom) / C.y,
|
|
645
|
+
left: (x.left - D.left + v.left) / C.x,
|
|
646
|
+
right: (D.right - x.right + v.right) / C.x
|
|
647
|
+
};
|
|
605
648
|
}
|
|
606
|
-
const
|
|
649
|
+
const lo = 50, ao = async (e, t, n) => {
|
|
607
650
|
const {
|
|
608
651
|
placement: r = "bottom",
|
|
609
652
|
strategy: o = "absolute",
|
|
610
653
|
middleware: s = [],
|
|
611
654
|
platform: i
|
|
612
|
-
} = n, c =
|
|
655
|
+
} = n, c = i.detectOverflow ? i : {
|
|
656
|
+
...i,
|
|
657
|
+
detectOverflow: uo
|
|
658
|
+
}, f = await (i.isRTL == null ? void 0 : i.isRTL(t));
|
|
613
659
|
let l = await i.getElementRects({
|
|
614
660
|
reference: e,
|
|
615
661
|
floating: t,
|
|
616
662
|
strategy: o
|
|
617
663
|
}), {
|
|
618
664
|
x: u,
|
|
619
|
-
y:
|
|
620
|
-
} =
|
|
621
|
-
|
|
665
|
+
y: p
|
|
666
|
+
} = En(l, r, f), m = r, a = 0;
|
|
667
|
+
const v = {};
|
|
668
|
+
for (let g = 0; g < s.length; g++) {
|
|
669
|
+
const w = s[g];
|
|
670
|
+
if (!w)
|
|
671
|
+
continue;
|
|
622
672
|
const {
|
|
623
|
-
name:
|
|
624
|
-
fn:
|
|
625
|
-
} =
|
|
626
|
-
x:
|
|
627
|
-
y:
|
|
628
|
-
data:
|
|
629
|
-
reset:
|
|
630
|
-
} = await
|
|
673
|
+
name: x,
|
|
674
|
+
fn: b
|
|
675
|
+
} = w, {
|
|
676
|
+
x: y,
|
|
677
|
+
y: C,
|
|
678
|
+
data: D,
|
|
679
|
+
reset: P
|
|
680
|
+
} = await b({
|
|
631
681
|
x: u,
|
|
632
|
-
y:
|
|
682
|
+
y: p,
|
|
633
683
|
initialPlacement: r,
|
|
634
|
-
placement:
|
|
684
|
+
placement: m,
|
|
635
685
|
strategy: o,
|
|
636
|
-
middlewareData:
|
|
686
|
+
middlewareData: v,
|
|
637
687
|
rects: l,
|
|
638
|
-
platform:
|
|
688
|
+
platform: c,
|
|
639
689
|
elements: {
|
|
640
690
|
reference: e,
|
|
641
691
|
floating: t
|
|
642
692
|
}
|
|
643
693
|
});
|
|
644
|
-
u =
|
|
645
|
-
...
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
...C
|
|
649
|
-
}
|
|
650
|
-
}, M && v <= 50 && (v++, typeof M == "object" && (M.placement && (p = M.placement), M.rects && (l = M.rects === !0 ? await i.getElementRects({
|
|
694
|
+
u = y ?? u, p = C ?? p, v[x] = {
|
|
695
|
+
...v[x],
|
|
696
|
+
...D
|
|
697
|
+
}, P && a < lo && (a++, typeof P == "object" && (P.placement && (m = P.placement), P.rects && (l = P.rects === !0 ? await i.getElementRects({
|
|
651
698
|
reference: e,
|
|
652
699
|
floating: t,
|
|
653
700
|
strategy: o
|
|
654
|
-
}) :
|
|
701
|
+
}) : P.rects), {
|
|
655
702
|
x: u,
|
|
656
|
-
y:
|
|
657
|
-
} =
|
|
703
|
+
y: p
|
|
704
|
+
} = En(l, m, f)), g = -1);
|
|
658
705
|
}
|
|
659
706
|
return {
|
|
660
707
|
x: u,
|
|
661
|
-
y:
|
|
662
|
-
placement:
|
|
708
|
+
y: p,
|
|
709
|
+
placement: m,
|
|
663
710
|
strategy: o,
|
|
664
|
-
middlewareData:
|
|
711
|
+
middlewareData: v
|
|
665
712
|
};
|
|
666
713
|
};
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
t === void 0 && (t = {});
|
|
670
|
-
const {
|
|
671
|
-
x: r,
|
|
672
|
-
y: o,
|
|
673
|
-
platform: s,
|
|
674
|
-
rects: i,
|
|
675
|
-
elements: c,
|
|
676
|
-
strategy: a
|
|
677
|
-
} = e, {
|
|
678
|
-
boundary: l = "clippingAncestors",
|
|
679
|
-
rootBoundary: u = "viewport",
|
|
680
|
-
elementContext: m = "floating",
|
|
681
|
-
altBoundary: p = !1,
|
|
682
|
-
padding: f = 0
|
|
683
|
-
} = Qe(t, e), v = Qr(f), y = c[p ? m === "floating" ? "reference" : "floating" : m], x = Ct(await s.getClippingRect({
|
|
684
|
-
element: (n = await (s.isElement == null ? void 0 : s.isElement(y))) == null || n ? y : y.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
|
|
685
|
-
boundary: l,
|
|
686
|
-
rootBoundary: u,
|
|
687
|
-
strategy: a
|
|
688
|
-
})), b = m === "floating" ? {
|
|
689
|
-
x: r,
|
|
690
|
-
y: o,
|
|
691
|
-
width: i.floating.width,
|
|
692
|
-
height: i.floating.height
|
|
693
|
-
} : i.reference, w = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), C = await (s.isElement == null ? void 0 : s.isElement(w)) ? await (s.getScale == null ? void 0 : s.getScale(w)) || {
|
|
694
|
-
x: 1,
|
|
695
|
-
y: 1
|
|
696
|
-
} : {
|
|
697
|
-
x: 1,
|
|
698
|
-
y: 1
|
|
699
|
-
}, M = Ct(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
700
|
-
elements: c,
|
|
701
|
-
rect: b,
|
|
702
|
-
offsetParent: w,
|
|
703
|
-
strategy: a
|
|
704
|
-
}) : b);
|
|
705
|
-
return {
|
|
706
|
-
top: (x.top - M.top + v.top) / C.y,
|
|
707
|
-
bottom: (M.bottom - x.bottom + v.bottom) / C.y,
|
|
708
|
-
left: (x.left - M.left + v.left) / C.x,
|
|
709
|
-
right: (M.right - x.right + v.right) / C.x
|
|
710
|
-
};
|
|
711
|
-
}
|
|
712
|
-
function go(e, t, n) {
|
|
713
|
-
return (e ? [...n.filter((o) => Ce(o) === e), ...n.filter((o) => Ce(o) !== e)] : n.filter((o) => Ie(o) === o)).filter((o) => e ? Ce(o) === e || (t ? Rt(o) !== o : !1) : !0);
|
|
714
|
+
function fo(e, t, n) {
|
|
715
|
+
return (e ? [...n.filter((o) => Ce(o) === e), ...n.filter((o) => Ce(o) !== e)] : n.filter((o) => Ie(o) === o)).filter((o) => e ? Ce(o) === e || (t ? Ct(o) !== o : !1) : !0);
|
|
714
716
|
}
|
|
715
|
-
const
|
|
717
|
+
const mo = function(e) {
|
|
716
718
|
return e === void 0 && (e = {}), {
|
|
717
719
|
name: "autoPlacement",
|
|
718
720
|
options: e,
|
|
@@ -722,65 +724,65 @@ const ho = function(e) {
|
|
|
722
724
|
rects: s,
|
|
723
725
|
middlewareData: i,
|
|
724
726
|
placement: c,
|
|
725
|
-
platform:
|
|
727
|
+
platform: f,
|
|
726
728
|
elements: l
|
|
727
729
|
} = t, {
|
|
728
730
|
crossAxis: u = !1,
|
|
729
|
-
alignment:
|
|
730
|
-
allowedPlacements:
|
|
731
|
-
autoAlignment:
|
|
731
|
+
alignment: p,
|
|
732
|
+
allowedPlacements: m = hn,
|
|
733
|
+
autoAlignment: a = !0,
|
|
732
734
|
...v
|
|
733
|
-
} =
|
|
735
|
+
} = Ze(e, t), g = p !== void 0 || m === hn ? fo(p || null, a, m) : m, w = await f.detectOverflow(t, v), x = ((n = i.autoPlacement) == null ? void 0 : n.index) || 0, b = g[x];
|
|
734
736
|
if (b == null)
|
|
735
737
|
return {};
|
|
736
|
-
const
|
|
738
|
+
const y = tr(b, s, await (f.isRTL == null ? void 0 : f.isRTL(l.floating)));
|
|
737
739
|
if (c !== b)
|
|
738
740
|
return {
|
|
739
741
|
reset: {
|
|
740
742
|
placement: g[0]
|
|
741
743
|
}
|
|
742
744
|
};
|
|
743
|
-
const C = [
|
|
745
|
+
const C = [w[Ie(b)], w[y[0]], w[y[1]]], D = [...((r = i.autoPlacement) == null ? void 0 : r.overflows) || [], {
|
|
744
746
|
placement: b,
|
|
745
747
|
overflows: C
|
|
746
|
-
}],
|
|
747
|
-
if (
|
|
748
|
+
}], P = g[x + 1];
|
|
749
|
+
if (P)
|
|
748
750
|
return {
|
|
749
751
|
data: {
|
|
750
752
|
index: x + 1,
|
|
751
|
-
overflows:
|
|
753
|
+
overflows: D
|
|
752
754
|
},
|
|
753
755
|
reset: {
|
|
754
|
-
placement:
|
|
756
|
+
placement: P
|
|
755
757
|
}
|
|
756
758
|
};
|
|
757
|
-
const N =
|
|
758
|
-
const _ = Ce(
|
|
759
|
-
return [
|
|
759
|
+
const N = D.map((k) => {
|
|
760
|
+
const _ = Ce(k.placement);
|
|
761
|
+
return [k.placement, _ && u ? (
|
|
760
762
|
// Check along the mainAxis and main crossAxis side.
|
|
761
|
-
|
|
763
|
+
k.overflows.slice(0, 2).reduce((G, W) => G + W, 0)
|
|
762
764
|
) : (
|
|
763
765
|
// Check only the mainAxis.
|
|
764
|
-
|
|
765
|
-
),
|
|
766
|
-
}).sort((
|
|
766
|
+
k.overflows[0]
|
|
767
|
+
), k.overflows];
|
|
768
|
+
}).sort((k, _) => k[1] - _[1]), K = ((o = N.filter((k) => k[2].slice(
|
|
767
769
|
0,
|
|
768
770
|
// Aligned placements should not check their opposite crossAxis
|
|
769
771
|
// side.
|
|
770
|
-
Ce(
|
|
772
|
+
Ce(k[0]) ? 2 : 3
|
|
771
773
|
).every((_) => _ <= 0))[0]) == null ? void 0 : o[0]) || N[0][0];
|
|
772
|
-
return
|
|
774
|
+
return K !== c ? {
|
|
773
775
|
data: {
|
|
774
776
|
index: x + 1,
|
|
775
|
-
overflows:
|
|
777
|
+
overflows: D
|
|
776
778
|
},
|
|
777
779
|
reset: {
|
|
778
|
-
placement:
|
|
780
|
+
placement: K
|
|
779
781
|
}
|
|
780
782
|
} : {};
|
|
781
783
|
}
|
|
782
784
|
};
|
|
783
|
-
},
|
|
785
|
+
}, po = function(e) {
|
|
784
786
|
return e === void 0 && (e = {}), {
|
|
785
787
|
name: "flip",
|
|
786
788
|
options: e,
|
|
@@ -791,105 +793,105 @@ const ho = function(e) {
|
|
|
791
793
|
middlewareData: s,
|
|
792
794
|
rects: i,
|
|
793
795
|
initialPlacement: c,
|
|
794
|
-
platform:
|
|
796
|
+
platform: f,
|
|
795
797
|
elements: l
|
|
796
798
|
} = t, {
|
|
797
799
|
mainAxis: u = !0,
|
|
798
|
-
crossAxis:
|
|
799
|
-
fallbackPlacements:
|
|
800
|
-
fallbackStrategy:
|
|
800
|
+
crossAxis: p = !0,
|
|
801
|
+
fallbackPlacements: m,
|
|
802
|
+
fallbackStrategy: a = "bestFit",
|
|
801
803
|
fallbackAxisSideDirection: v = "none",
|
|
802
804
|
flipAlignment: g = !0,
|
|
803
|
-
...
|
|
804
|
-
} =
|
|
805
|
+
...w
|
|
806
|
+
} = Ze(e, t);
|
|
805
807
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
806
808
|
return {};
|
|
807
|
-
const x = Ie(o), b =
|
|
808
|
-
!
|
|
809
|
-
const N = [c, ...
|
|
810
|
-
let
|
|
811
|
-
if (u &&
|
|
812
|
-
const R =
|
|
813
|
-
|
|
809
|
+
const x = Ie(o), b = Me(c), y = Ie(c) === c, C = await (f.isRTL == null ? void 0 : f.isRTL(l.floating)), D = m || (y || !g ? [It(c)] : Vr(c)), P = v !== "none";
|
|
810
|
+
!m && P && D.push(...Ur(c, g, v, C));
|
|
811
|
+
const N = [c, ...D], S = await f.detectOverflow(t, w), K = [];
|
|
812
|
+
let k = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
813
|
+
if (u && K.push(S[x]), p) {
|
|
814
|
+
const R = tr(o, i, C);
|
|
815
|
+
K.push(S[R[0]], S[R[1]]);
|
|
814
816
|
}
|
|
815
|
-
if (
|
|
817
|
+
if (k = [...k, {
|
|
816
818
|
placement: o,
|
|
817
|
-
overflows:
|
|
818
|
-
}], !
|
|
819
|
+
overflows: K
|
|
820
|
+
}], !K.every((R) => R <= 0)) {
|
|
819
821
|
var _, G;
|
|
820
822
|
const R = (((_ = s.flip) == null ? void 0 : _.index) || 0) + 1, E = N[R];
|
|
821
|
-
if (E && (!(
|
|
823
|
+
if (E && (!(p === "alignment" ? b !== Me(E) : !1) || // We leave the current main axis only if every placement on that axis
|
|
822
824
|
// overflows the main axis.
|
|
823
|
-
|
|
825
|
+
k.every((h) => Me(h.placement) === b ? h.overflows[0] > 0 : !0)))
|
|
824
826
|
return {
|
|
825
827
|
data: {
|
|
826
828
|
index: R,
|
|
827
|
-
overflows:
|
|
829
|
+
overflows: k
|
|
828
830
|
},
|
|
829
831
|
reset: {
|
|
830
832
|
placement: E
|
|
831
833
|
}
|
|
832
834
|
};
|
|
833
|
-
let
|
|
834
|
-
if (
|
|
835
|
-
switch (
|
|
835
|
+
let V = (G = k.filter((O) => O.overflows[0] <= 0).sort((O, h) => O.overflows[1] - h.overflows[1])[0]) == null ? void 0 : G.placement;
|
|
836
|
+
if (!V)
|
|
837
|
+
switch (a) {
|
|
836
838
|
case "bestFit": {
|
|
837
839
|
var W;
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
840
|
-
const I =
|
|
840
|
+
const O = (W = k.filter((h) => {
|
|
841
|
+
if (P) {
|
|
842
|
+
const I = Me(h.placement);
|
|
841
843
|
return I === b || // Create a bias to the `y` side axis due to horizontal
|
|
842
844
|
// reading directions favoring greater width.
|
|
843
845
|
I === "y";
|
|
844
846
|
}
|
|
845
847
|
return !0;
|
|
846
|
-
}).map((h) => [h.placement, h.overflows.filter((I) => I > 0).reduce((I,
|
|
847
|
-
|
|
848
|
+
}).map((h) => [h.placement, h.overflows.filter((I) => I > 0).reduce((I, L) => I + L, 0)]).sort((h, I) => h[1] - I[1])[0]) == null ? void 0 : W[0];
|
|
849
|
+
O && (V = O);
|
|
848
850
|
break;
|
|
849
851
|
}
|
|
850
852
|
case "initialPlacement":
|
|
851
|
-
|
|
853
|
+
V = c;
|
|
852
854
|
break;
|
|
853
855
|
}
|
|
854
|
-
if (o !==
|
|
856
|
+
if (o !== V)
|
|
855
857
|
return {
|
|
856
858
|
reset: {
|
|
857
|
-
placement:
|
|
859
|
+
placement: V
|
|
858
860
|
}
|
|
859
861
|
};
|
|
860
862
|
}
|
|
861
863
|
return {};
|
|
862
864
|
}
|
|
863
865
|
};
|
|
864
|
-
},
|
|
865
|
-
async function
|
|
866
|
+
}, go = /* @__PURE__ */ new Set(["left", "top"]);
|
|
867
|
+
async function ho(e, t) {
|
|
866
868
|
const {
|
|
867
869
|
placement: n,
|
|
868
870
|
platform: r,
|
|
869
871
|
elements: o
|
|
870
|
-
} = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = Ie(n), c = Ce(n),
|
|
872
|
+
} = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = Ie(n), c = Ce(n), f = Me(n) === "y", l = go.has(i) ? -1 : 1, u = s && f ? -1 : 1, p = Ze(t, e);
|
|
871
873
|
let {
|
|
872
|
-
mainAxis: p,
|
|
873
|
-
crossAxis: f,
|
|
874
|
-
alignmentAxis: v
|
|
875
|
-
} = typeof m == "number" ? {
|
|
876
874
|
mainAxis: m,
|
|
875
|
+
crossAxis: a,
|
|
876
|
+
alignmentAxis: v
|
|
877
|
+
} = typeof p == "number" ? {
|
|
878
|
+
mainAxis: p,
|
|
877
879
|
crossAxis: 0,
|
|
878
880
|
alignmentAxis: null
|
|
879
881
|
} : {
|
|
880
|
-
mainAxis:
|
|
881
|
-
crossAxis:
|
|
882
|
-
alignmentAxis:
|
|
882
|
+
mainAxis: p.mainAxis || 0,
|
|
883
|
+
crossAxis: p.crossAxis || 0,
|
|
884
|
+
alignmentAxis: p.alignmentAxis
|
|
883
885
|
};
|
|
884
|
-
return c && typeof v == "number" && (
|
|
885
|
-
x:
|
|
886
|
-
y:
|
|
886
|
+
return c && typeof v == "number" && (a = c === "end" ? v * -1 : v), f ? {
|
|
887
|
+
x: a * u,
|
|
888
|
+
y: m * l
|
|
887
889
|
} : {
|
|
888
|
-
x:
|
|
889
|
-
y:
|
|
890
|
+
x: m * l,
|
|
891
|
+
y: a * u
|
|
890
892
|
};
|
|
891
893
|
}
|
|
892
|
-
const
|
|
894
|
+
const vo = function(e) {
|
|
893
895
|
return e === void 0 && (e = 0), {
|
|
894
896
|
name: "offset",
|
|
895
897
|
options: e,
|
|
@@ -900,18 +902,18 @@ const wo = function(e) {
|
|
|
900
902
|
y: s,
|
|
901
903
|
placement: i,
|
|
902
904
|
middlewareData: c
|
|
903
|
-
} = t,
|
|
905
|
+
} = t, f = await ho(t, e);
|
|
904
906
|
return i === ((n = c.offset) == null ? void 0 : n.placement) && (r = c.arrow) != null && r.alignmentOffset ? {} : {
|
|
905
|
-
x: o +
|
|
906
|
-
y: s +
|
|
907
|
+
x: o + f.x,
|
|
908
|
+
y: s + f.y,
|
|
907
909
|
data: {
|
|
908
|
-
...
|
|
910
|
+
...f,
|
|
909
911
|
placement: i
|
|
910
912
|
}
|
|
911
913
|
};
|
|
912
914
|
}
|
|
913
915
|
};
|
|
914
|
-
},
|
|
916
|
+
}, bo = function(e) {
|
|
915
917
|
return e === void 0 && (e = {}), {
|
|
916
918
|
name: "shift",
|
|
917
919
|
options: e,
|
|
@@ -919,55 +921,56 @@ const wo = function(e) {
|
|
|
919
921
|
const {
|
|
920
922
|
x: n,
|
|
921
923
|
y: r,
|
|
922
|
-
placement: o
|
|
924
|
+
placement: o,
|
|
925
|
+
platform: s
|
|
923
926
|
} = t, {
|
|
924
|
-
mainAxis:
|
|
925
|
-
crossAxis:
|
|
926
|
-
limiter:
|
|
927
|
-
fn: (
|
|
927
|
+
mainAxis: i = !0,
|
|
928
|
+
crossAxis: c = !1,
|
|
929
|
+
limiter: f = {
|
|
930
|
+
fn: (x) => {
|
|
928
931
|
let {
|
|
929
|
-
x,
|
|
930
|
-
y
|
|
931
|
-
} =
|
|
932
|
+
x: b,
|
|
933
|
+
y
|
|
934
|
+
} = x;
|
|
932
935
|
return {
|
|
933
|
-
x,
|
|
934
|
-
y
|
|
936
|
+
x: b,
|
|
937
|
+
y
|
|
935
938
|
};
|
|
936
939
|
}
|
|
937
940
|
},
|
|
938
|
-
...
|
|
939
|
-
} =
|
|
941
|
+
...l
|
|
942
|
+
} = Ze(e, t), u = {
|
|
940
943
|
x: n,
|
|
941
944
|
y: r
|
|
942
|
-
},
|
|
943
|
-
let
|
|
944
|
-
if (s) {
|
|
945
|
-
const y = p === "y" ? "top" : "left", x = p === "y" ? "bottom" : "right", b = f + u[y], w = f - u[x];
|
|
946
|
-
f = hn(b, f, w);
|
|
947
|
-
}
|
|
945
|
+
}, p = await s.detectOverflow(t, l), m = Me(Ie(o)), a = Qn(m);
|
|
946
|
+
let v = u[a], g = u[m];
|
|
948
947
|
if (i) {
|
|
949
|
-
const
|
|
950
|
-
v =
|
|
948
|
+
const x = a === "y" ? "top" : "left", b = a === "y" ? "bottom" : "right", y = v + p[x], C = v - p[b];
|
|
949
|
+
v = vn(y, v, C);
|
|
951
950
|
}
|
|
952
|
-
|
|
951
|
+
if (c) {
|
|
952
|
+
const x = m === "y" ? "top" : "left", b = m === "y" ? "bottom" : "right", y = g + p[x], C = g - p[b];
|
|
953
|
+
g = vn(y, g, C);
|
|
954
|
+
}
|
|
955
|
+
const w = f.fn({
|
|
953
956
|
...t,
|
|
954
|
-
[
|
|
955
|
-
[m]:
|
|
957
|
+
[a]: v,
|
|
958
|
+
[m]: g
|
|
956
959
|
});
|
|
957
960
|
return {
|
|
958
|
-
...
|
|
961
|
+
...w,
|
|
959
962
|
data: {
|
|
960
|
-
x:
|
|
961
|
-
y:
|
|
963
|
+
x: w.x - n,
|
|
964
|
+
y: w.y - r,
|
|
962
965
|
enabled: {
|
|
963
|
-
[
|
|
964
|
-
[m]:
|
|
966
|
+
[a]: i,
|
|
967
|
+
[m]: c
|
|
965
968
|
}
|
|
966
969
|
}
|
|
967
970
|
};
|
|
968
971
|
}
|
|
969
972
|
};
|
|
970
|
-
},
|
|
973
|
+
}, yo = function(e) {
|
|
971
974
|
return e === void 0 && (e = {}), {
|
|
972
975
|
name: "size",
|
|
973
976
|
options: e,
|
|
@@ -979,28 +982,28 @@ const wo = function(e) {
|
|
|
979
982
|
platform: i,
|
|
980
983
|
elements: c
|
|
981
984
|
} = t, {
|
|
982
|
-
apply:
|
|
985
|
+
apply: f = () => {
|
|
983
986
|
},
|
|
984
987
|
...l
|
|
985
|
-
} =
|
|
988
|
+
} = Ze(e, t), u = await i.detectOverflow(t, l), p = Ie(o), m = Ce(o), a = Me(o) === "y", {
|
|
986
989
|
width: v,
|
|
987
990
|
height: g
|
|
988
991
|
} = s.floating;
|
|
989
|
-
let
|
|
990
|
-
|
|
991
|
-
const b = g - u.top - u.bottom,
|
|
992
|
-
let N = C,
|
|
993
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (
|
|
994
|
-
const
|
|
995
|
-
|
|
992
|
+
let w, x;
|
|
993
|
+
p === "top" || p === "bottom" ? (w = p, x = m === (await (i.isRTL == null ? void 0 : i.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (x = p, w = m === "end" ? "top" : "bottom");
|
|
994
|
+
const b = g - u.top - u.bottom, y = v - u.left - u.right, C = Qe(g - u[w], b), D = Qe(v - u[x], y), P = !t.middlewareData.shift;
|
|
995
|
+
let N = C, S = D;
|
|
996
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (S = y), (r = t.middlewareData.shift) != null && r.enabled.y && (N = b), P && !m) {
|
|
997
|
+
const k = he(u.left, 0), _ = he(u.right, 0), G = he(u.top, 0), W = he(u.bottom, 0);
|
|
998
|
+
a ? S = v - 2 * (k !== 0 || _ !== 0 ? k + _ : he(u.left, u.right)) : N = g - 2 * (G !== 0 || W !== 0 ? G + W : he(u.top, u.bottom));
|
|
996
999
|
}
|
|
997
|
-
await
|
|
1000
|
+
await f({
|
|
998
1001
|
...t,
|
|
999
|
-
availableWidth:
|
|
1002
|
+
availableWidth: S,
|
|
1000
1003
|
availableHeight: N
|
|
1001
1004
|
});
|
|
1002
|
-
const
|
|
1003
|
-
return v !==
|
|
1005
|
+
const K = await i.getDimensions(c.floating);
|
|
1006
|
+
return v !== K.width || g !== K.height ? {
|
|
1004
1007
|
reset: {
|
|
1005
1008
|
rects: !0
|
|
1006
1009
|
}
|
|
@@ -1008,10 +1011,10 @@ const wo = function(e) {
|
|
|
1008
1011
|
}
|
|
1009
1012
|
};
|
|
1010
1013
|
};
|
|
1011
|
-
function
|
|
1014
|
+
function pr(e) {
|
|
1012
1015
|
const t = we(e);
|
|
1013
1016
|
let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
|
|
1014
|
-
const o =
|
|
1017
|
+
const o = re(e), s = o ? e.offsetWidth : n, i = o ? e.offsetHeight : r, c = Et(n) !== s || Et(r) !== i;
|
|
1015
1018
|
return c && (n = s, r = i), {
|
|
1016
1019
|
width: n,
|
|
1017
1020
|
height: r,
|
|
@@ -1021,98 +1024,98 @@ function dr(e) {
|
|
|
1021
1024
|
function un(e) {
|
|
1022
1025
|
return Y(e) ? e : e.contextElement;
|
|
1023
1026
|
}
|
|
1024
|
-
function
|
|
1027
|
+
function Ye(e) {
|
|
1025
1028
|
const t = un(e);
|
|
1026
|
-
if (!
|
|
1029
|
+
if (!re(t))
|
|
1027
1030
|
return Ee(1);
|
|
1028
1031
|
const n = t.getBoundingClientRect(), {
|
|
1029
1032
|
width: r,
|
|
1030
1033
|
height: o,
|
|
1031
1034
|
$: s
|
|
1032
|
-
} =
|
|
1033
|
-
let i = (s ?
|
|
1035
|
+
} = pr(t);
|
|
1036
|
+
let i = (s ? Et(n.width) : n.width) / r, c = (s ? Et(n.height) : n.height) / o;
|
|
1034
1037
|
return (!i || !Number.isFinite(i)) && (i = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
1035
1038
|
x: i,
|
|
1036
1039
|
y: c
|
|
1037
1040
|
};
|
|
1038
1041
|
}
|
|
1039
|
-
const
|
|
1040
|
-
function
|
|
1042
|
+
const wo = /* @__PURE__ */ Ee(0);
|
|
1043
|
+
function gr(e) {
|
|
1041
1044
|
const t = pe(e);
|
|
1042
|
-
return !
|
|
1045
|
+
return !Lt() || !t.visualViewport ? wo : {
|
|
1043
1046
|
x: t.visualViewport.offsetLeft,
|
|
1044
1047
|
y: t.visualViewport.offsetTop
|
|
1045
1048
|
};
|
|
1046
1049
|
}
|
|
1047
|
-
function
|
|
1050
|
+
function xo(e, t, n) {
|
|
1048
1051
|
return t === void 0 && (t = !1), !n || t && n !== pe(e) ? !1 : t;
|
|
1049
1052
|
}
|
|
1050
|
-
function
|
|
1053
|
+
function ze(e, t, n, r) {
|
|
1051
1054
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
1052
1055
|
const o = e.getBoundingClientRect(), s = un(e);
|
|
1053
1056
|
let i = Ee(1);
|
|
1054
|
-
t && (r ? Y(r) && (i =
|
|
1055
|
-
const c =
|
|
1056
|
-
let
|
|
1057
|
+
t && (r ? Y(r) && (i = Ye(r)) : i = Ye(e));
|
|
1058
|
+
const c = xo(s, n, r) ? gr(s) : Ee(0);
|
|
1059
|
+
let f = (o.left + c.x) / i.x, l = (o.top + c.y) / i.y, u = o.width / i.x, p = o.height / i.y;
|
|
1057
1060
|
if (s) {
|
|
1058
|
-
const
|
|
1059
|
-
let v =
|
|
1060
|
-
for (; g && r &&
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1061
|
+
const m = pe(s), a = r && Y(r) ? pe(r) : r;
|
|
1062
|
+
let v = m, g = Qt(v);
|
|
1063
|
+
for (; g && r && a !== v; ) {
|
|
1064
|
+
const w = Ye(g), x = g.getBoundingClientRect(), b = we(g), y = x.left + (g.clientLeft + parseFloat(b.paddingLeft)) * w.x, C = x.top + (g.clientTop + parseFloat(b.paddingTop)) * w.y;
|
|
1065
|
+
f *= w.x, l *= w.y, u *= w.x, p *= w.y, f += y, l += C, v = pe(g), g = Qt(v);
|
|
1063
1066
|
}
|
|
1064
1067
|
}
|
|
1065
|
-
return
|
|
1068
|
+
return Ot({
|
|
1066
1069
|
width: u,
|
|
1067
|
-
height:
|
|
1068
|
-
x:
|
|
1070
|
+
height: p,
|
|
1071
|
+
x: f,
|
|
1069
1072
|
y: l
|
|
1070
1073
|
});
|
|
1071
1074
|
}
|
|
1072
|
-
function
|
|
1073
|
-
const n =
|
|
1074
|
-
return t ? t.left + n :
|
|
1075
|
+
function Ft(e, t) {
|
|
1076
|
+
const n = kt(e).scrollLeft;
|
|
1077
|
+
return t ? t.left + n : ze(Oe(e)).left + n;
|
|
1075
1078
|
}
|
|
1076
|
-
function
|
|
1077
|
-
const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft -
|
|
1079
|
+
function hr(e, t) {
|
|
1080
|
+
const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - Ft(e, n), o = n.top + t.scrollTop;
|
|
1078
1081
|
return {
|
|
1079
1082
|
x: r,
|
|
1080
1083
|
y: o
|
|
1081
1084
|
};
|
|
1082
1085
|
}
|
|
1083
|
-
function
|
|
1086
|
+
function Ro(e) {
|
|
1084
1087
|
let {
|
|
1085
1088
|
elements: t,
|
|
1086
1089
|
rect: n,
|
|
1087
1090
|
offsetParent: r,
|
|
1088
1091
|
strategy: o
|
|
1089
1092
|
} = e;
|
|
1090
|
-
const s = o === "fixed", i =
|
|
1093
|
+
const s = o === "fixed", i = Oe(r), c = t ? Dt(t.floating) : !1;
|
|
1091
1094
|
if (r === i || c && s)
|
|
1092
1095
|
return n;
|
|
1093
|
-
let
|
|
1096
|
+
let f = {
|
|
1094
1097
|
scrollLeft: 0,
|
|
1095
1098
|
scrollTop: 0
|
|
1096
1099
|
}, l = Ee(1);
|
|
1097
|
-
const u = Ee(0),
|
|
1098
|
-
if ((
|
|
1099
|
-
const
|
|
1100
|
-
l =
|
|
1100
|
+
const u = Ee(0), p = re(r);
|
|
1101
|
+
if ((p || !p && !s) && ((We(r) !== "body" || lt(i)) && (f = kt(r)), p)) {
|
|
1102
|
+
const a = ze(r);
|
|
1103
|
+
l = Ye(r), u.x = a.x + r.clientLeft, u.y = a.y + r.clientTop;
|
|
1101
1104
|
}
|
|
1102
|
-
const
|
|
1105
|
+
const m = i && !p && !s ? hr(i, f) : Ee(0);
|
|
1103
1106
|
return {
|
|
1104
1107
|
width: n.width * l.x,
|
|
1105
1108
|
height: n.height * l.y,
|
|
1106
|
-
x: n.x * l.x -
|
|
1107
|
-
y: n.y * l.y -
|
|
1109
|
+
x: n.x * l.x - f.scrollLeft * l.x + u.x + m.x,
|
|
1110
|
+
y: n.y * l.y - f.scrollTop * l.y + u.y + m.y
|
|
1108
1111
|
};
|
|
1109
1112
|
}
|
|
1110
|
-
function
|
|
1113
|
+
function Eo(e) {
|
|
1111
1114
|
return Array.from(e.getClientRects());
|
|
1112
1115
|
}
|
|
1113
|
-
function
|
|
1114
|
-
const t =
|
|
1115
|
-
let i = -n.scrollLeft +
|
|
1116
|
+
function Co(e) {
|
|
1117
|
+
const t = Oe(e), n = kt(e), r = e.ownerDocument.body, o = he(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = he(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
|
|
1118
|
+
let i = -n.scrollLeft + Ft(e);
|
|
1116
1119
|
const c = -n.scrollTop;
|
|
1117
1120
|
return we(r).direction === "rtl" && (i += he(t.clientWidth, r.clientWidth) - o), {
|
|
1118
1121
|
width: o,
|
|
@@ -1121,47 +1124,46 @@ function Oo(e) {
|
|
|
1121
1124
|
y: c
|
|
1122
1125
|
};
|
|
1123
1126
|
}
|
|
1124
|
-
const
|
|
1125
|
-
function
|
|
1126
|
-
const n = pe(e), r =
|
|
1127
|
-
let s = r.clientWidth, i = r.clientHeight, c = 0,
|
|
1127
|
+
const Cn = 25;
|
|
1128
|
+
function Io(e, t) {
|
|
1129
|
+
const n = pe(e), r = Oe(e), o = n.visualViewport;
|
|
1130
|
+
let s = r.clientWidth, i = r.clientHeight, c = 0, f = 0;
|
|
1128
1131
|
if (o) {
|
|
1129
1132
|
s = o.width, i = o.height;
|
|
1130
|
-
const u =
|
|
1131
|
-
(!u || u && t === "fixed") && (c = o.offsetLeft,
|
|
1133
|
+
const u = Lt();
|
|
1134
|
+
(!u || u && t === "fixed") && (c = o.offsetLeft, f = o.offsetTop);
|
|
1132
1135
|
}
|
|
1133
|
-
const l =
|
|
1136
|
+
const l = Ft(r);
|
|
1134
1137
|
if (l <= 0) {
|
|
1135
|
-
const u = r.ownerDocument,
|
|
1136
|
-
v <=
|
|
1137
|
-
} else l <=
|
|
1138
|
+
const u = r.ownerDocument, p = u.body, m = getComputedStyle(p), a = u.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, v = Math.abs(r.clientWidth - p.clientWidth - a);
|
|
1139
|
+
v <= Cn && (s -= v);
|
|
1140
|
+
} else l <= Cn && (s += l);
|
|
1138
1141
|
return {
|
|
1139
1142
|
width: s,
|
|
1140
1143
|
height: i,
|
|
1141
1144
|
x: c,
|
|
1142
|
-
y:
|
|
1145
|
+
y: f
|
|
1143
1146
|
};
|
|
1144
1147
|
}
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
const n = He(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = ne(e) ? Xe(e) : Ee(1), i = e.clientWidth * s.x, c = e.clientHeight * s.y, a = o * s.x, l = r * s.y;
|
|
1148
|
+
function Oo(e, t) {
|
|
1149
|
+
const n = ze(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = re(e) ? Ye(e) : Ee(1), i = e.clientWidth * s.x, c = e.clientHeight * s.y, f = o * s.x, l = r * s.y;
|
|
1148
1150
|
return {
|
|
1149
1151
|
width: i,
|
|
1150
1152
|
height: c,
|
|
1151
|
-
x:
|
|
1153
|
+
x: f,
|
|
1152
1154
|
y: l
|
|
1153
1155
|
};
|
|
1154
1156
|
}
|
|
1155
|
-
function
|
|
1157
|
+
function In(e, t, n) {
|
|
1156
1158
|
let r;
|
|
1157
1159
|
if (t === "viewport")
|
|
1158
|
-
r =
|
|
1160
|
+
r = Io(e, n);
|
|
1159
1161
|
else if (t === "document")
|
|
1160
|
-
r =
|
|
1162
|
+
r = Co(Oe(e));
|
|
1161
1163
|
else if (Y(t))
|
|
1162
|
-
r =
|
|
1164
|
+
r = Oo(t, n);
|
|
1163
1165
|
else {
|
|
1164
|
-
const o =
|
|
1166
|
+
const o = gr(e);
|
|
1165
1167
|
r = {
|
|
1166
1168
|
x: t.x - o.x,
|
|
1167
1169
|
y: t.y - o.y,
|
|
@@ -1169,110 +1171,112 @@ function Cn(e, t, n) {
|
|
|
1169
1171
|
height: t.height
|
|
1170
1172
|
};
|
|
1171
1173
|
}
|
|
1172
|
-
return
|
|
1174
|
+
return Ot(r);
|
|
1173
1175
|
}
|
|
1174
|
-
function
|
|
1176
|
+
function vr(e, t) {
|
|
1175
1177
|
const n = Pe(e);
|
|
1176
|
-
return n === t || !Y(n) ||
|
|
1178
|
+
return n === t || !Y(n) || Se(n) ? !1 : we(n).position === "fixed" || vr(n, t);
|
|
1177
1179
|
}
|
|
1178
|
-
function
|
|
1180
|
+
function To(e, t) {
|
|
1179
1181
|
const n = t.get(e);
|
|
1180
1182
|
if (n)
|
|
1181
1183
|
return n;
|
|
1182
1184
|
let r = ke(e, [], !1).filter((c) => Y(c) && We(c) !== "body"), o = null;
|
|
1183
1185
|
const s = we(e).position === "fixed";
|
|
1184
1186
|
let i = s ? Pe(e) : e;
|
|
1185
|
-
for (; Y(i) && !
|
|
1186
|
-
const c = we(i),
|
|
1187
|
-
!
|
|
1187
|
+
for (; Y(i) && !Se(i); ) {
|
|
1188
|
+
const c = we(i), f = on(i);
|
|
1189
|
+
!f && c.position === "fixed" && (o = null), (s ? !f && !o : !f && c.position === "static" && !!o && (o.position === "absolute" || o.position === "fixed") || lt(i) && !f && vr(e, i)) ? r = r.filter((u) => u !== i) : o = c, i = Pe(i);
|
|
1188
1190
|
}
|
|
1189
1191
|
return t.set(e, r), r;
|
|
1190
1192
|
}
|
|
1191
|
-
function
|
|
1193
|
+
function Ao(e) {
|
|
1192
1194
|
let {
|
|
1193
1195
|
element: t,
|
|
1194
1196
|
boundary: n,
|
|
1195
1197
|
rootBoundary: r,
|
|
1196
1198
|
strategy: o
|
|
1197
1199
|
} = e;
|
|
1198
|
-
const i = [...n === "clippingAncestors" ?
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1200
|
+
const i = [...n === "clippingAncestors" ? Dt(t) ? [] : To(t, this._c) : [].concat(n), r], c = In(t, i[0], o);
|
|
1201
|
+
let f = c.top, l = c.right, u = c.bottom, p = c.left;
|
|
1202
|
+
for (let m = 1; m < i.length; m++) {
|
|
1203
|
+
const a = In(t, i[m], o);
|
|
1204
|
+
f = he(a.top, f), l = Qe(a.right, l), u = Qe(a.bottom, u), p = he(a.left, p);
|
|
1205
|
+
}
|
|
1202
1206
|
return {
|
|
1203
|
-
width:
|
|
1204
|
-
height:
|
|
1205
|
-
x:
|
|
1206
|
-
y:
|
|
1207
|
+
width: l - p,
|
|
1208
|
+
height: u - f,
|
|
1209
|
+
x: p,
|
|
1210
|
+
y: f
|
|
1207
1211
|
};
|
|
1208
1212
|
}
|
|
1209
|
-
function
|
|
1213
|
+
function Mo(e) {
|
|
1210
1214
|
const {
|
|
1211
1215
|
width: t,
|
|
1212
1216
|
height: n
|
|
1213
|
-
} =
|
|
1217
|
+
} = pr(e);
|
|
1214
1218
|
return {
|
|
1215
1219
|
width: t,
|
|
1216
1220
|
height: n
|
|
1217
1221
|
};
|
|
1218
1222
|
}
|
|
1219
|
-
function
|
|
1220
|
-
const r =
|
|
1223
|
+
function So(e, t, n) {
|
|
1224
|
+
const r = re(t), o = Oe(t), s = n === "fixed", i = ze(e, !0, s, t);
|
|
1221
1225
|
let c = {
|
|
1222
1226
|
scrollLeft: 0,
|
|
1223
1227
|
scrollTop: 0
|
|
1224
1228
|
};
|
|
1225
|
-
const
|
|
1229
|
+
const f = Ee(0);
|
|
1226
1230
|
function l() {
|
|
1227
|
-
|
|
1231
|
+
f.x = Ft(o);
|
|
1228
1232
|
}
|
|
1229
1233
|
if (r || !r && !s)
|
|
1230
|
-
if ((We(t) !== "body" ||
|
|
1231
|
-
const
|
|
1232
|
-
|
|
1234
|
+
if ((We(t) !== "body" || lt(o)) && (c = kt(t)), r) {
|
|
1235
|
+
const a = ze(t, !0, s, t);
|
|
1236
|
+
f.x = a.x + t.clientLeft, f.y = a.y + t.clientTop;
|
|
1233
1237
|
} else o && l();
|
|
1234
1238
|
s && !r && o && l();
|
|
1235
|
-
const u = o && !r && !s ?
|
|
1239
|
+
const u = o && !r && !s ? hr(o, c) : Ee(0), p = i.left + c.scrollLeft - f.x - u.x, m = i.top + c.scrollTop - f.y - u.y;
|
|
1236
1240
|
return {
|
|
1237
|
-
x:
|
|
1238
|
-
y:
|
|
1241
|
+
x: p,
|
|
1242
|
+
y: m,
|
|
1239
1243
|
width: i.width,
|
|
1240
1244
|
height: i.height
|
|
1241
1245
|
};
|
|
1242
1246
|
}
|
|
1243
|
-
function
|
|
1247
|
+
function Bt(e) {
|
|
1244
1248
|
return we(e).position === "static";
|
|
1245
1249
|
}
|
|
1246
|
-
function
|
|
1247
|
-
if (!
|
|
1250
|
+
function On(e, t) {
|
|
1251
|
+
if (!re(e) || we(e).position === "fixed")
|
|
1248
1252
|
return null;
|
|
1249
1253
|
if (t)
|
|
1250
1254
|
return t(e);
|
|
1251
1255
|
let n = e.offsetParent;
|
|
1252
|
-
return
|
|
1256
|
+
return Oe(e) === n && (n = n.ownerDocument.body), n;
|
|
1253
1257
|
}
|
|
1254
|
-
function
|
|
1258
|
+
function br(e, t) {
|
|
1255
1259
|
const n = pe(e);
|
|
1256
|
-
if (
|
|
1260
|
+
if (Dt(e))
|
|
1257
1261
|
return n;
|
|
1258
|
-
if (!
|
|
1262
|
+
if (!re(e)) {
|
|
1259
1263
|
let o = Pe(e);
|
|
1260
|
-
for (; o && !
|
|
1261
|
-
if (Y(o) &&
|
|
1264
|
+
for (; o && !Se(o); ) {
|
|
1265
|
+
if (Y(o) && !Bt(o))
|
|
1262
1266
|
return o;
|
|
1263
1267
|
o = Pe(o);
|
|
1264
1268
|
}
|
|
1265
1269
|
return n;
|
|
1266
1270
|
}
|
|
1267
|
-
let r =
|
|
1268
|
-
for (; r && Fr(r) &&
|
|
1269
|
-
r =
|
|
1270
|
-
return r &&
|
|
1271
|
+
let r = On(e, t);
|
|
1272
|
+
for (; r && Fr(r) && Bt(r); )
|
|
1273
|
+
r = On(r, t);
|
|
1274
|
+
return r && Se(r) && Bt(r) && !on(r) ? n : r || Wr(e) || n;
|
|
1271
1275
|
}
|
|
1272
|
-
const
|
|
1273
|
-
const t = this.getOffsetParent ||
|
|
1276
|
+
const Po = async function(e) {
|
|
1277
|
+
const t = this.getOffsetParent || br, n = this.getDimensions, r = await n(e.floating);
|
|
1274
1278
|
return {
|
|
1275
|
-
reference:
|
|
1279
|
+
reference: So(e.reference, await t(e.floating), e.strategy),
|
|
1276
1280
|
floating: {
|
|
1277
1281
|
x: 0,
|
|
1278
1282
|
y: 0,
|
|
@@ -1281,122 +1285,122 @@ const Fo = async function(e) {
|
|
|
1281
1285
|
}
|
|
1282
1286
|
};
|
|
1283
1287
|
};
|
|
1284
|
-
function
|
|
1288
|
+
function Do(e) {
|
|
1285
1289
|
return we(e).direction === "rtl";
|
|
1286
1290
|
}
|
|
1287
|
-
const
|
|
1288
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
1289
|
-
getDocumentElement:
|
|
1290
|
-
getClippingRect:
|
|
1291
|
-
getOffsetParent:
|
|
1292
|
-
getElementRects:
|
|
1293
|
-
getClientRects:
|
|
1294
|
-
getDimensions:
|
|
1295
|
-
getScale:
|
|
1291
|
+
const Lo = {
|
|
1292
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ro,
|
|
1293
|
+
getDocumentElement: Oe,
|
|
1294
|
+
getClippingRect: Ao,
|
|
1295
|
+
getOffsetParent: br,
|
|
1296
|
+
getElementRects: Po,
|
|
1297
|
+
getClientRects: Eo,
|
|
1298
|
+
getDimensions: Mo,
|
|
1299
|
+
getScale: Ye,
|
|
1296
1300
|
isElement: Y,
|
|
1297
|
-
isRTL:
|
|
1301
|
+
isRTL: Do
|
|
1298
1302
|
};
|
|
1299
|
-
function
|
|
1303
|
+
function yr(e, t) {
|
|
1300
1304
|
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1301
1305
|
}
|
|
1302
|
-
function
|
|
1306
|
+
function ko(e, t) {
|
|
1303
1307
|
let n = null, r;
|
|
1304
|
-
const o =
|
|
1308
|
+
const o = Oe(e);
|
|
1305
1309
|
function s() {
|
|
1306
1310
|
var c;
|
|
1307
1311
|
clearTimeout(r), (c = n) == null || c.disconnect(), n = null;
|
|
1308
1312
|
}
|
|
1309
|
-
function i(c,
|
|
1310
|
-
c === void 0 && (c = !1),
|
|
1313
|
+
function i(c, f) {
|
|
1314
|
+
c === void 0 && (c = !1), f === void 0 && (f = 1), s();
|
|
1311
1315
|
const l = e.getBoundingClientRect(), {
|
|
1312
1316
|
left: u,
|
|
1313
|
-
top:
|
|
1314
|
-
width:
|
|
1315
|
-
height:
|
|
1317
|
+
top: p,
|
|
1318
|
+
width: m,
|
|
1319
|
+
height: a
|
|
1316
1320
|
} = l;
|
|
1317
|
-
if (c || t(), !
|
|
1321
|
+
if (c || t(), !m || !a)
|
|
1318
1322
|
return;
|
|
1319
|
-
const v =
|
|
1320
|
-
rootMargin: -v + "px " + -g + "px " + -
|
|
1321
|
-
threshold: he(0,
|
|
1323
|
+
const v = qe(p), g = qe(o.clientWidth - (u + m)), w = qe(o.clientHeight - (p + a)), x = qe(u), y = {
|
|
1324
|
+
rootMargin: -v + "px " + -g + "px " + -w + "px " + -x + "px",
|
|
1325
|
+
threshold: he(0, Qe(1, f)) || 1
|
|
1322
1326
|
};
|
|
1323
1327
|
let C = !0;
|
|
1324
|
-
function
|
|
1325
|
-
const N =
|
|
1326
|
-
if (N !==
|
|
1328
|
+
function D(P) {
|
|
1329
|
+
const N = P[0].intersectionRatio;
|
|
1330
|
+
if (N !== f) {
|
|
1327
1331
|
if (!C)
|
|
1328
1332
|
return i();
|
|
1329
1333
|
N ? i(!1, N) : r = setTimeout(() => {
|
|
1330
1334
|
i(!1, 1e-7);
|
|
1331
1335
|
}, 1e3);
|
|
1332
1336
|
}
|
|
1333
|
-
N === 1 && !
|
|
1337
|
+
N === 1 && !yr(l, e.getBoundingClientRect()) && i(), C = !1;
|
|
1334
1338
|
}
|
|
1335
1339
|
try {
|
|
1336
|
-
n = new IntersectionObserver(
|
|
1337
|
-
...
|
|
1340
|
+
n = new IntersectionObserver(D, {
|
|
1341
|
+
...y,
|
|
1338
1342
|
// Handle <iframe>s
|
|
1339
1343
|
root: o.ownerDocument
|
|
1340
1344
|
});
|
|
1341
1345
|
} catch {
|
|
1342
|
-
n = new IntersectionObserver(
|
|
1346
|
+
n = new IntersectionObserver(D, y);
|
|
1343
1347
|
}
|
|
1344
1348
|
n.observe(e);
|
|
1345
1349
|
}
|
|
1346
1350
|
return i(!0), s;
|
|
1347
1351
|
}
|
|
1348
|
-
function
|
|
1352
|
+
function wi(e, t, n, r) {
|
|
1349
1353
|
r === void 0 && (r = {});
|
|
1350
1354
|
const {
|
|
1351
1355
|
ancestorScroll: o = !0,
|
|
1352
1356
|
ancestorResize: s = !0,
|
|
1353
1357
|
elementResize: i = typeof ResizeObserver == "function",
|
|
1354
1358
|
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1355
|
-
animationFrame:
|
|
1356
|
-
} = r, l = un(e), u = o || s ? [...l ? ke(l) : [], ...ke(t)] : [];
|
|
1359
|
+
animationFrame: f = !1
|
|
1360
|
+
} = r, l = un(e), u = o || s ? [...l ? ke(l) : [], ...t ? ke(t) : []] : [];
|
|
1357
1361
|
u.forEach((x) => {
|
|
1358
1362
|
o && x.addEventListener("scroll", n, {
|
|
1359
1363
|
passive: !0
|
|
1360
1364
|
}), s && x.addEventListener("resize", n);
|
|
1361
1365
|
});
|
|
1362
|
-
const
|
|
1363
|
-
let
|
|
1364
|
-
i && (
|
|
1366
|
+
const p = l && c ? ko(l, n) : null;
|
|
1367
|
+
let m = -1, a = null;
|
|
1368
|
+
i && (a = new ResizeObserver((x) => {
|
|
1365
1369
|
let [b] = x;
|
|
1366
|
-
b && b.target === l &&
|
|
1367
|
-
var
|
|
1368
|
-
(
|
|
1370
|
+
b && b.target === l && a && t && (a.unobserve(t), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
1371
|
+
var y;
|
|
1372
|
+
(y = a) == null || y.observe(t);
|
|
1369
1373
|
})), n();
|
|
1370
|
-
}), l && !
|
|
1371
|
-
let v, g =
|
|
1372
|
-
|
|
1373
|
-
function
|
|
1374
|
-
const x =
|
|
1375
|
-
g && !
|
|
1374
|
+
}), l && !f && a.observe(l), t && a.observe(t));
|
|
1375
|
+
let v, g = f ? ze(e) : null;
|
|
1376
|
+
f && w();
|
|
1377
|
+
function w() {
|
|
1378
|
+
const x = ze(e);
|
|
1379
|
+
g && !yr(g, x) && n(), g = x, v = requestAnimationFrame(w);
|
|
1376
1380
|
}
|
|
1377
1381
|
return n(), () => {
|
|
1378
1382
|
var x;
|
|
1379
1383
|
u.forEach((b) => {
|
|
1380
1384
|
o && b.removeEventListener("scroll", n), s && b.removeEventListener("resize", n);
|
|
1381
|
-
}),
|
|
1385
|
+
}), p?.(), (x = a) == null || x.disconnect(), a = null, f && cancelAnimationFrame(v);
|
|
1382
1386
|
};
|
|
1383
1387
|
}
|
|
1384
|
-
const
|
|
1388
|
+
const Fo = vo, No = mo, _o = bo, Wo = po, Ko = yo, $o = (e, t, n) => {
|
|
1385
1389
|
const r = /* @__PURE__ */ new Map(), o = {
|
|
1386
|
-
platform:
|
|
1390
|
+
platform: Lo,
|
|
1387
1391
|
...n
|
|
1388
1392
|
}, s = {
|
|
1389
1393
|
...o.platform,
|
|
1390
1394
|
_c: r
|
|
1391
1395
|
};
|
|
1392
|
-
return
|
|
1396
|
+
return ao(e, t, {
|
|
1393
1397
|
...o,
|
|
1394
1398
|
platform: s
|
|
1395
1399
|
});
|
|
1396
1400
|
};
|
|
1397
|
-
var
|
|
1398
|
-
},
|
|
1399
|
-
function
|
|
1401
|
+
var Vo = typeof document < "u", Bo = function() {
|
|
1402
|
+
}, xt = Vo ? qn : Bo;
|
|
1403
|
+
function At(e, t) {
|
|
1400
1404
|
if (e === t)
|
|
1401
1405
|
return !0;
|
|
1402
1406
|
if (typeof e != typeof t)
|
|
@@ -1408,7 +1412,7 @@ function Tt(e, t) {
|
|
|
1408
1412
|
if (Array.isArray(e)) {
|
|
1409
1413
|
if (n = e.length, n !== t.length) return !1;
|
|
1410
1414
|
for (r = n; r-- !== 0; )
|
|
1411
|
-
if (!
|
|
1415
|
+
if (!At(e[r], t[r]))
|
|
1412
1416
|
return !1;
|
|
1413
1417
|
return !0;
|
|
1414
1418
|
}
|
|
@@ -1419,27 +1423,27 @@ function Tt(e, t) {
|
|
|
1419
1423
|
return !1;
|
|
1420
1424
|
for (r = n; r-- !== 0; ) {
|
|
1421
1425
|
const s = o[r];
|
|
1422
|
-
if (!(s === "_owner" && e.$$typeof) && !
|
|
1426
|
+
if (!(s === "_owner" && e.$$typeof) && !At(e[s], t[s]))
|
|
1423
1427
|
return !1;
|
|
1424
1428
|
}
|
|
1425
1429
|
return !0;
|
|
1426
1430
|
}
|
|
1427
1431
|
return e !== e && t !== t;
|
|
1428
1432
|
}
|
|
1429
|
-
function
|
|
1433
|
+
function wr(e) {
|
|
1430
1434
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1431
1435
|
}
|
|
1432
1436
|
function Tn(e, t) {
|
|
1433
|
-
const n =
|
|
1437
|
+
const n = wr(e);
|
|
1434
1438
|
return Math.round(t * n) / n;
|
|
1435
1439
|
}
|
|
1436
|
-
function
|
|
1440
|
+
function Ht(e) {
|
|
1437
1441
|
const t = d.useRef(e);
|
|
1438
|
-
return
|
|
1442
|
+
return xt(() => {
|
|
1439
1443
|
t.current = e;
|
|
1440
1444
|
}), t;
|
|
1441
1445
|
}
|
|
1442
|
-
function
|
|
1446
|
+
function Ho(e) {
|
|
1443
1447
|
e === void 0 && (e = {});
|
|
1444
1448
|
const {
|
|
1445
1449
|
placement: t = "bottom",
|
|
@@ -1451,31 +1455,31 @@ function jo(e) {
|
|
|
1451
1455
|
floating: i
|
|
1452
1456
|
} = {},
|
|
1453
1457
|
transform: c = !0,
|
|
1454
|
-
whileElementsMounted:
|
|
1458
|
+
whileElementsMounted: f,
|
|
1455
1459
|
open: l
|
|
1456
|
-
} = e, [u,
|
|
1460
|
+
} = e, [u, p] = d.useState({
|
|
1457
1461
|
x: 0,
|
|
1458
1462
|
y: 0,
|
|
1459
1463
|
strategy: n,
|
|
1460
1464
|
placement: t,
|
|
1461
1465
|
middlewareData: {},
|
|
1462
1466
|
isPositioned: !1
|
|
1463
|
-
}), [
|
|
1464
|
-
|
|
1465
|
-
const [v, g] = d.useState(null), [
|
|
1466
|
-
h !==
|
|
1467
|
-
}, []),
|
|
1467
|
+
}), [m, a] = d.useState(r);
|
|
1468
|
+
At(m, r) || a(r);
|
|
1469
|
+
const [v, g] = d.useState(null), [w, x] = d.useState(null), b = d.useCallback((h) => {
|
|
1470
|
+
h !== P.current && (P.current = h, g(h));
|
|
1471
|
+
}, []), y = d.useCallback((h) => {
|
|
1468
1472
|
h !== N.current && (N.current = h, x(h));
|
|
1469
|
-
}, []), C = s || v,
|
|
1470
|
-
if (!
|
|
1473
|
+
}, []), C = s || v, D = i || w, P = d.useRef(null), N = d.useRef(null), S = d.useRef(u), K = f != null, k = Ht(f), _ = Ht(o), G = Ht(l), W = d.useCallback(() => {
|
|
1474
|
+
if (!P.current || !N.current)
|
|
1471
1475
|
return;
|
|
1472
1476
|
const h = {
|
|
1473
1477
|
placement: t,
|
|
1474
1478
|
strategy: n,
|
|
1475
|
-
middleware:
|
|
1479
|
+
middleware: m
|
|
1476
1480
|
};
|
|
1477
|
-
_.current && (h.platform = _.current),
|
|
1478
|
-
const
|
|
1481
|
+
_.current && (h.platform = _.current), $o(P.current, N.current, h).then((I) => {
|
|
1482
|
+
const L = {
|
|
1479
1483
|
...I,
|
|
1480
1484
|
// The floating element's position may be recomputed while it's closed
|
|
1481
1485
|
// but still mounted (such as when transitioning out). To ensure
|
|
@@ -1483,81 +1487,101 @@ function jo(e) {
|
|
|
1483
1487
|
// setting it to `true` when `open === false` (must be specified).
|
|
1484
1488
|
isPositioned: G.current !== !1
|
|
1485
1489
|
};
|
|
1486
|
-
R.current && !
|
|
1487
|
-
|
|
1490
|
+
R.current && !At(S.current, L) && (S.current = L, nn.flushSync(() => {
|
|
1491
|
+
p(L);
|
|
1488
1492
|
}));
|
|
1489
1493
|
});
|
|
1490
|
-
}, [
|
|
1491
|
-
|
|
1492
|
-
l === !1 &&
|
|
1494
|
+
}, [m, t, n, _, G]);
|
|
1495
|
+
xt(() => {
|
|
1496
|
+
l === !1 && S.current.isPositioned && (S.current.isPositioned = !1, p((h) => ({
|
|
1493
1497
|
...h,
|
|
1494
1498
|
isPositioned: !1
|
|
1495
1499
|
})));
|
|
1496
1500
|
}, [l]);
|
|
1497
1501
|
const R = d.useRef(!1);
|
|
1498
|
-
|
|
1502
|
+
xt(() => (R.current = !0, () => {
|
|
1499
1503
|
R.current = !1;
|
|
1500
|
-
}), []),
|
|
1501
|
-
if (C && (
|
|
1502
|
-
if (
|
|
1503
|
-
return
|
|
1504
|
+
}), []), xt(() => {
|
|
1505
|
+
if (C && (P.current = C), D && (N.current = D), C && D) {
|
|
1506
|
+
if (k.current)
|
|
1507
|
+
return k.current(C, D, W);
|
|
1504
1508
|
W();
|
|
1505
1509
|
}
|
|
1506
|
-
}, [C,
|
|
1510
|
+
}, [C, D, W, k, K]);
|
|
1507
1511
|
const E = d.useMemo(() => ({
|
|
1508
|
-
reference:
|
|
1512
|
+
reference: P,
|
|
1509
1513
|
floating: N,
|
|
1510
1514
|
setReference: b,
|
|
1511
|
-
setFloating:
|
|
1512
|
-
}), [b,
|
|
1515
|
+
setFloating: y
|
|
1516
|
+
}), [b, y]), V = d.useMemo(() => ({
|
|
1513
1517
|
reference: C,
|
|
1514
|
-
floating:
|
|
1515
|
-
}), [C,
|
|
1518
|
+
floating: D
|
|
1519
|
+
}), [C, D]), O = d.useMemo(() => {
|
|
1516
1520
|
const h = {
|
|
1517
1521
|
position: n,
|
|
1518
1522
|
left: 0,
|
|
1519
1523
|
top: 0
|
|
1520
1524
|
};
|
|
1521
|
-
if (
|
|
1525
|
+
if (!V.floating)
|
|
1522
1526
|
return h;
|
|
1523
|
-
const I = Tn(
|
|
1527
|
+
const I = Tn(V.floating, u.x), L = Tn(V.floating, u.y);
|
|
1524
1528
|
return c ? {
|
|
1525
1529
|
...h,
|
|
1526
|
-
transform: "translate(" + I + "px, " +
|
|
1527
|
-
...
|
|
1530
|
+
transform: "translate(" + I + "px, " + L + "px)",
|
|
1531
|
+
...wr(V.floating) >= 1.5 && {
|
|
1528
1532
|
willChange: "transform"
|
|
1529
1533
|
}
|
|
1530
1534
|
} : {
|
|
1531
1535
|
position: n,
|
|
1532
1536
|
left: I,
|
|
1533
|
-
top:
|
|
1537
|
+
top: L
|
|
1534
1538
|
};
|
|
1535
|
-
}, [n, c,
|
|
1539
|
+
}, [n, c, V.floating, u.x, u.y]);
|
|
1536
1540
|
return d.useMemo(() => ({
|
|
1537
1541
|
...u,
|
|
1538
1542
|
update: W,
|
|
1539
1543
|
refs: E,
|
|
1540
|
-
elements:
|
|
1541
|
-
floatingStyles:
|
|
1542
|
-
}), [u, W, E,
|
|
1543
|
-
}
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1544
|
+
elements: V,
|
|
1545
|
+
floatingStyles: O
|
|
1546
|
+
}), [u, W, E, V, O]);
|
|
1547
|
+
}
|
|
1548
|
+
const xi = (e, t) => {
|
|
1549
|
+
const n = Fo(e);
|
|
1550
|
+
return {
|
|
1551
|
+
name: n.name,
|
|
1552
|
+
fn: n.fn,
|
|
1553
|
+
options: [e, t]
|
|
1554
|
+
};
|
|
1555
|
+
}, Ri = (e, t) => {
|
|
1556
|
+
const n = _o(e);
|
|
1557
|
+
return {
|
|
1558
|
+
name: n.name,
|
|
1559
|
+
fn: n.fn,
|
|
1560
|
+
options: [e, t]
|
|
1561
|
+
};
|
|
1562
|
+
}, Ei = (e, t) => {
|
|
1563
|
+
const n = Wo(e);
|
|
1564
|
+
return {
|
|
1565
|
+
name: n.name,
|
|
1566
|
+
fn: n.fn,
|
|
1567
|
+
options: [e, t]
|
|
1568
|
+
};
|
|
1569
|
+
}, Ci = (e, t) => {
|
|
1570
|
+
const n = Ko(e);
|
|
1571
|
+
return {
|
|
1572
|
+
name: n.name,
|
|
1573
|
+
fn: n.fn,
|
|
1574
|
+
options: [e, t]
|
|
1575
|
+
};
|
|
1576
|
+
}, Ii = (e, t) => {
|
|
1577
|
+
const n = No(e);
|
|
1578
|
+
return {
|
|
1579
|
+
name: n.name,
|
|
1580
|
+
fn: n.fn,
|
|
1581
|
+
options: [e, t]
|
|
1582
|
+
};
|
|
1583
|
+
};
|
|
1584
|
+
function zo(e) {
|
|
1561
1585
|
const t = d.useRef(void 0), n = d.useCallback((r) => {
|
|
1562
1586
|
const o = e.map((s) => {
|
|
1563
1587
|
if (s != null) {
|
|
@@ -1580,11 +1604,11 @@ function qo(e) {
|
|
|
1580
1604
|
t.current && (t.current(), t.current = void 0), r != null && (t.current = n(r));
|
|
1581
1605
|
}, e);
|
|
1582
1606
|
}
|
|
1583
|
-
function
|
|
1607
|
+
function Uo(e, t) {
|
|
1584
1608
|
const n = e.compareDocumentPosition(t);
|
|
1585
1609
|
return n & Node.DOCUMENT_POSITION_FOLLOWING || n & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING || n & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
|
|
1586
1610
|
}
|
|
1587
|
-
const
|
|
1611
|
+
const xr = /* @__PURE__ */ d.createContext({
|
|
1588
1612
|
register: () => {
|
|
1589
1613
|
},
|
|
1590
1614
|
unregister: () => {
|
|
@@ -1594,7 +1618,7 @@ const yr = /* @__PURE__ */ d.createContext({
|
|
|
1594
1618
|
current: []
|
|
1595
1619
|
}
|
|
1596
1620
|
});
|
|
1597
|
-
function
|
|
1621
|
+
function Go(e) {
|
|
1598
1622
|
const {
|
|
1599
1623
|
children: t,
|
|
1600
1624
|
elementsRef: n,
|
|
@@ -1603,27 +1627,27 @@ function Yo(e) {
|
|
|
1603
1627
|
s((u) => new Set(u).add(l));
|
|
1604
1628
|
}, []), c = d.useCallback((l) => {
|
|
1605
1629
|
s((u) => {
|
|
1606
|
-
const
|
|
1607
|
-
return
|
|
1630
|
+
const p = new Set(u);
|
|
1631
|
+
return p.delete(l), p;
|
|
1608
1632
|
});
|
|
1609
|
-
}, []),
|
|
1633
|
+
}, []), f = d.useMemo(() => {
|
|
1610
1634
|
const l = /* @__PURE__ */ new Map();
|
|
1611
|
-
return Array.from(o.keys()).sort(
|
|
1612
|
-
l.set(
|
|
1635
|
+
return Array.from(o.keys()).sort(Uo).forEach((p, m) => {
|
|
1636
|
+
l.set(p, m);
|
|
1613
1637
|
}), l;
|
|
1614
1638
|
}, [o]);
|
|
1615
|
-
return /* @__PURE__ */ me(
|
|
1639
|
+
return /* @__PURE__ */ me(xr.Provider, {
|
|
1616
1640
|
value: d.useMemo(() => ({
|
|
1617
1641
|
register: i,
|
|
1618
1642
|
unregister: c,
|
|
1619
|
-
map:
|
|
1643
|
+
map: f,
|
|
1620
1644
|
elementsRef: n,
|
|
1621
1645
|
labelsRef: r
|
|
1622
|
-
}), [i, c,
|
|
1646
|
+
}), [i, c, f, n, r]),
|
|
1623
1647
|
children: t
|
|
1624
1648
|
});
|
|
1625
1649
|
}
|
|
1626
|
-
function
|
|
1650
|
+
function jo(e) {
|
|
1627
1651
|
e === void 0 && (e = {});
|
|
1628
1652
|
const {
|
|
1629
1653
|
label: t
|
|
@@ -1633,89 +1657,89 @@ function Jo(e) {
|
|
|
1633
1657
|
map: o,
|
|
1634
1658
|
elementsRef: s,
|
|
1635
1659
|
labelsRef: i
|
|
1636
|
-
} = d.useContext(
|
|
1637
|
-
if (l.current =
|
|
1638
|
-
var
|
|
1639
|
-
const
|
|
1640
|
-
i.current[c] =
|
|
1660
|
+
} = d.useContext(xr), [c, f] = d.useState(null), l = d.useRef(null), u = d.useCallback((p) => {
|
|
1661
|
+
if (l.current = p, c !== null && (s.current[c] = p, i)) {
|
|
1662
|
+
var m;
|
|
1663
|
+
const a = t !== void 0;
|
|
1664
|
+
i.current[c] = a ? t : (m = p?.textContent) != null ? m : null;
|
|
1641
1665
|
}
|
|
1642
1666
|
}, [c, s, i, t]);
|
|
1643
1667
|
return X(() => {
|
|
1644
|
-
const
|
|
1645
|
-
if (
|
|
1646
|
-
return n(
|
|
1647
|
-
r(
|
|
1668
|
+
const p = l.current;
|
|
1669
|
+
if (p)
|
|
1670
|
+
return n(p), () => {
|
|
1671
|
+
r(p);
|
|
1648
1672
|
};
|
|
1649
1673
|
}, [n, r]), X(() => {
|
|
1650
|
-
const
|
|
1651
|
-
|
|
1674
|
+
const p = l.current ? o.get(l.current) : null;
|
|
1675
|
+
p != null && f(p);
|
|
1652
1676
|
}, [o]), d.useMemo(() => ({
|
|
1653
1677
|
ref: u,
|
|
1654
1678
|
index: c ?? -1
|
|
1655
1679
|
}), [c, u]);
|
|
1656
1680
|
}
|
|
1657
|
-
const
|
|
1658
|
-
function
|
|
1681
|
+
const qo = "data-floating-ui-focusable", An = "active", Mn = "selected", Ne = "ArrowLeft", _e = "ArrowRight", ct = "ArrowUp", Fe = "ArrowDown";
|
|
1682
|
+
function Rr(e, t) {
|
|
1659
1683
|
return typeof e == "function" ? e(t) : e ? /* @__PURE__ */ d.cloneElement(e, t) : /* @__PURE__ */ me("div", {
|
|
1660
1684
|
...t
|
|
1661
1685
|
});
|
|
1662
1686
|
}
|
|
1663
|
-
const
|
|
1687
|
+
const Er = /* @__PURE__ */ d.createContext({
|
|
1664
1688
|
activeIndex: 0,
|
|
1665
1689
|
onNavigate: () => {
|
|
1666
1690
|
}
|
|
1667
|
-
}),
|
|
1691
|
+
}), Cr = [Ne, _e], Ir = [ct, Fe], zt = [...Cr, ...Ir], Oi = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
1668
1692
|
const {
|
|
1669
1693
|
render: r,
|
|
1670
1694
|
orientation: o = "both",
|
|
1671
1695
|
loop: s = !0,
|
|
1672
1696
|
rtl: i = !1,
|
|
1673
1697
|
cols: c = 1,
|
|
1674
|
-
disabledIndices:
|
|
1698
|
+
disabledIndices: f,
|
|
1675
1699
|
activeIndex: l,
|
|
1676
1700
|
onNavigate: u,
|
|
1677
|
-
itemSizes:
|
|
1678
|
-
dense:
|
|
1679
|
-
...
|
|
1680
|
-
} = t, [v, g] = d.useState(0),
|
|
1681
|
-
activeIndex:
|
|
1701
|
+
itemSizes: p,
|
|
1702
|
+
dense: m = !1,
|
|
1703
|
+
...a
|
|
1704
|
+
} = t, [v, g] = d.useState(0), w = l ?? v, x = ie(u ?? g), b = d.useRef([]), y = r && typeof r != "function" ? r.props : {}, C = d.useMemo(() => ({
|
|
1705
|
+
activeIndex: w,
|
|
1682
1706
|
onNavigate: x
|
|
1683
|
-
}), [
|
|
1684
|
-
function
|
|
1685
|
-
if (!
|
|
1686
|
-
let
|
|
1687
|
-
const
|
|
1688
|
-
if (
|
|
1689
|
-
const h =
|
|
1707
|
+
}), [w, x]), D = c > 1;
|
|
1708
|
+
function P(S) {
|
|
1709
|
+
if (!zt.includes(S.key)) return;
|
|
1710
|
+
let K = w;
|
|
1711
|
+
const k = wt(b, f), _ = tn(b, f), G = i ? Ne : _e, W = i ? _e : Ne;
|
|
1712
|
+
if (D) {
|
|
1713
|
+
const h = p || Array.from({
|
|
1690
1714
|
length: b.current.length
|
|
1691
1715
|
}, () => ({
|
|
1692
1716
|
width: 1,
|
|
1693
1717
|
height: 1
|
|
1694
|
-
})), I =
|
|
1695
|
-
current: I.map((
|
|
1718
|
+
})), I = ur(h, c, m), L = I.findIndex((T) => T != null && !He(b, T, f)), ee = I.reduce((T, J, j) => J != null && !He(b, J, f) ? j : T, -1), F = I[cr({
|
|
1719
|
+
current: I.map((T) => T ? b.current[T] : null)
|
|
1696
1720
|
}, {
|
|
1697
|
-
event:
|
|
1721
|
+
event: S,
|
|
1698
1722
|
orientation: o,
|
|
1699
1723
|
loop: s,
|
|
1700
1724
|
rtl: i,
|
|
1701
1725
|
cols: c,
|
|
1702
1726
|
// treat undefined (empty grid spaces) as disabled indices so we
|
|
1703
1727
|
// don't end up in them
|
|
1704
|
-
disabledIndices:
|
|
1705
|
-
minIndex:
|
|
1728
|
+
disabledIndices: ar([...(typeof f != "function" ? f : null) || b.current.map((T, J) => He(b, J, f) ? J : void 0), void 0], I),
|
|
1729
|
+
minIndex: L,
|
|
1706
1730
|
maxIndex: ee,
|
|
1707
|
-
prevIndex:
|
|
1708
|
-
|
|
1731
|
+
prevIndex: lr(
|
|
1732
|
+
w > _ ? k : w,
|
|
1709
1733
|
h,
|
|
1710
1734
|
I,
|
|
1711
1735
|
c,
|
|
1712
1736
|
// use a corner matching the edge closest to the direction we're
|
|
1713
1737
|
// moving in so we don't end up in the same item. Prefer
|
|
1714
1738
|
// top/left over bottom/right.
|
|
1715
|
-
|
|
1739
|
+
S.key === Fe ? "bl" : S.key === G ? "tr" : "tl"
|
|
1716
1740
|
)
|
|
1717
1741
|
})];
|
|
1718
|
-
F != null && (
|
|
1742
|
+
F != null && (K = F);
|
|
1719
1743
|
}
|
|
1720
1744
|
const R = {
|
|
1721
1745
|
horizontal: [G],
|
|
@@ -1723,98 +1747,98 @@ const xr = /* @__PURE__ */ d.createContext({
|
|
|
1723
1747
|
both: [G, Fe]
|
|
1724
1748
|
}[o], E = {
|
|
1725
1749
|
horizontal: [W],
|
|
1726
|
-
vertical: [
|
|
1727
|
-
both: [W,
|
|
1728
|
-
}[o],
|
|
1729
|
-
horizontal:
|
|
1730
|
-
vertical:
|
|
1731
|
-
both:
|
|
1750
|
+
vertical: [ct],
|
|
1751
|
+
both: [W, ct]
|
|
1752
|
+
}[o], V = D ? zt : {
|
|
1753
|
+
horizontal: Cr,
|
|
1754
|
+
vertical: Ir,
|
|
1755
|
+
both: zt
|
|
1732
1756
|
}[o];
|
|
1733
|
-
if (
|
|
1734
|
-
startingIndex:
|
|
1735
|
-
decrement: E.includes(
|
|
1736
|
-
disabledIndices:
|
|
1737
|
-
})),
|
|
1738
|
-
var
|
|
1739
|
-
|
|
1757
|
+
if (K === w && [...R, ...E].includes(S.key) && (s && K === _ && R.includes(S.key) ? K = k : s && K === k && E.includes(S.key) ? K = _ : K = ue(b, {
|
|
1758
|
+
startingIndex: K,
|
|
1759
|
+
decrement: E.includes(S.key),
|
|
1760
|
+
disabledIndices: f
|
|
1761
|
+
})), K !== w && !Xe(b, K)) {
|
|
1762
|
+
var O;
|
|
1763
|
+
S.stopPropagation(), V.includes(S.key) && S.preventDefault(), x(K), (O = b.current[K]) == null || O.focus();
|
|
1740
1764
|
}
|
|
1741
1765
|
}
|
|
1742
1766
|
const N = {
|
|
1743
|
-
...
|
|
1744
|
-
...
|
|
1767
|
+
...a,
|
|
1768
|
+
...y,
|
|
1745
1769
|
ref: n,
|
|
1746
1770
|
"aria-orientation": o === "both" ? void 0 : o,
|
|
1747
|
-
onKeyDown(
|
|
1748
|
-
|
|
1771
|
+
onKeyDown(S) {
|
|
1772
|
+
a.onKeyDown == null || a.onKeyDown(S), y.onKeyDown == null || y.onKeyDown(S), P(S);
|
|
1749
1773
|
}
|
|
1750
1774
|
};
|
|
1751
|
-
return /* @__PURE__ */ me(
|
|
1775
|
+
return /* @__PURE__ */ me(Er.Provider, {
|
|
1752
1776
|
value: C,
|
|
1753
|
-
children: /* @__PURE__ */ me(
|
|
1777
|
+
children: /* @__PURE__ */ me(Go, {
|
|
1754
1778
|
elementsRef: b,
|
|
1755
|
-
children:
|
|
1779
|
+
children: Rr(r, N)
|
|
1756
1780
|
})
|
|
1757
1781
|
});
|
|
1758
|
-
}),
|
|
1782
|
+
}), Ti = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
1759
1783
|
const {
|
|
1760
1784
|
render: r,
|
|
1761
1785
|
...o
|
|
1762
1786
|
} = t, s = r && typeof r != "function" ? r.props : {}, {
|
|
1763
1787
|
activeIndex: i,
|
|
1764
1788
|
onNavigate: c
|
|
1765
|
-
} = d.useContext(
|
|
1766
|
-
ref:
|
|
1789
|
+
} = d.useContext(Er), {
|
|
1790
|
+
ref: f,
|
|
1767
1791
|
index: l
|
|
1768
|
-
} =
|
|
1792
|
+
} = jo(), u = zo([f, n, s.ref]), p = i === l, m = {
|
|
1769
1793
|
...o,
|
|
1770
1794
|
...s,
|
|
1771
1795
|
ref: u,
|
|
1772
|
-
tabIndex:
|
|
1773
|
-
"data-active":
|
|
1774
|
-
onFocus(
|
|
1775
|
-
o.onFocus == null || o.onFocus(
|
|
1796
|
+
tabIndex: p ? 0 : -1,
|
|
1797
|
+
"data-active": p ? "" : void 0,
|
|
1798
|
+
onFocus(a) {
|
|
1799
|
+
o.onFocus == null || o.onFocus(a), s.onFocus == null || s.onFocus(a), c(l);
|
|
1776
1800
|
}
|
|
1777
1801
|
};
|
|
1778
|
-
return
|
|
1779
|
-
}),
|
|
1802
|
+
return Rr(r, m);
|
|
1803
|
+
}), Xo = {
|
|
1780
1804
|
...d
|
|
1781
1805
|
};
|
|
1782
|
-
let Sn = !1,
|
|
1783
|
-
const
|
|
1806
|
+
let Sn = !1, Yo = 0;
|
|
1807
|
+
const Pn = () => (
|
|
1784
1808
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
1785
1809
|
// on <React 18
|
|
1786
|
-
"floating-ui-" + Math.random().toString(36).slice(2, 6) +
|
|
1810
|
+
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Yo++
|
|
1787
1811
|
);
|
|
1788
|
-
function
|
|
1789
|
-
const [e, t] = d.useState(() => Sn ?
|
|
1812
|
+
function Jo() {
|
|
1813
|
+
const [e, t] = d.useState(() => Sn ? Pn() : void 0);
|
|
1790
1814
|
return X(() => {
|
|
1791
|
-
e == null && t(
|
|
1815
|
+
e == null && t(Pn());
|
|
1792
1816
|
}, []), d.useEffect(() => {
|
|
1793
1817
|
Sn = !0;
|
|
1794
1818
|
}, []), e;
|
|
1795
1819
|
}
|
|
1796
|
-
const
|
|
1797
|
-
let
|
|
1798
|
-
process.env.NODE_ENV !== "production" && (
|
|
1799
|
-
function
|
|
1820
|
+
const Qo = Xo.useId, Nt = Qo || Jo;
|
|
1821
|
+
let ut;
|
|
1822
|
+
process.env.NODE_ENV !== "production" && (ut = /* @__PURE__ */ new Set());
|
|
1823
|
+
function Ut() {
|
|
1800
1824
|
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
1801
1825
|
n[r] = arguments[r];
|
|
1802
1826
|
const o = "Floating UI: " + n.join(" ");
|
|
1803
|
-
if (!((e =
|
|
1827
|
+
if (!((e = ut) != null && e.has(o))) {
|
|
1804
1828
|
var s;
|
|
1805
|
-
(s =
|
|
1829
|
+
(s = ut) == null || s.add(o), console.warn(o);
|
|
1806
1830
|
}
|
|
1807
1831
|
}
|
|
1808
|
-
function
|
|
1832
|
+
function Zo() {
|
|
1809
1833
|
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
1810
1834
|
n[r] = arguments[r];
|
|
1811
1835
|
const o = "Floating UI: " + n.join(" ");
|
|
1812
|
-
if (!((e =
|
|
1836
|
+
if (!((e = ut) != null && e.has(o))) {
|
|
1813
1837
|
var s;
|
|
1814
|
-
(s =
|
|
1838
|
+
(s = ut) == null || s.add(o), console.error(o);
|
|
1815
1839
|
}
|
|
1816
1840
|
}
|
|
1817
|
-
function
|
|
1841
|
+
function Or() {
|
|
1818
1842
|
const e = /* @__PURE__ */ new Map();
|
|
1819
1843
|
return {
|
|
1820
1844
|
emit(t, n) {
|
|
@@ -1830,12 +1854,12 @@ function Cr() {
|
|
|
1830
1854
|
}
|
|
1831
1855
|
};
|
|
1832
1856
|
}
|
|
1833
|
-
const
|
|
1857
|
+
const Tr = /* @__PURE__ */ d.createContext(null), Ar = /* @__PURE__ */ d.createContext(null), et = () => {
|
|
1834
1858
|
var e;
|
|
1835
|
-
return ((e = d.useContext(
|
|
1836
|
-
},
|
|
1837
|
-
function
|
|
1838
|
-
const t =
|
|
1859
|
+
return ((e = d.useContext(Tr)) == null ? void 0 : e.id) || null;
|
|
1860
|
+
}, tt = () => d.useContext(Ar);
|
|
1861
|
+
function Ai(e) {
|
|
1862
|
+
const t = Nt(), n = tt(), o = et();
|
|
1839
1863
|
return X(() => {
|
|
1840
1864
|
if (!t) return;
|
|
1841
1865
|
const s = {
|
|
@@ -1847,12 +1871,12 @@ function Di(e) {
|
|
|
1847
1871
|
};
|
|
1848
1872
|
}, [n, t, o]), t;
|
|
1849
1873
|
}
|
|
1850
|
-
function
|
|
1874
|
+
function Mi(e) {
|
|
1851
1875
|
const {
|
|
1852
1876
|
children: t,
|
|
1853
1877
|
id: n
|
|
1854
|
-
} = e, r =
|
|
1855
|
-
return /* @__PURE__ */ me(
|
|
1878
|
+
} = e, r = et();
|
|
1879
|
+
return /* @__PURE__ */ me(Tr.Provider, {
|
|
1856
1880
|
value: d.useMemo(() => ({
|
|
1857
1881
|
id: n,
|
|
1858
1882
|
parentId: r
|
|
@@ -1860,15 +1884,15 @@ function Li(e) {
|
|
|
1860
1884
|
children: t
|
|
1861
1885
|
});
|
|
1862
1886
|
}
|
|
1863
|
-
function
|
|
1887
|
+
function Si(e) {
|
|
1864
1888
|
const {
|
|
1865
1889
|
children: t
|
|
1866
1890
|
} = e, n = d.useRef([]), r = d.useCallback((i) => {
|
|
1867
1891
|
n.current = [...n.current, i];
|
|
1868
1892
|
}, []), o = d.useCallback((i) => {
|
|
1869
1893
|
n.current = n.current.filter((c) => c !== i);
|
|
1870
|
-
}, []), [s] = d.useState(() =>
|
|
1871
|
-
return /* @__PURE__ */ me(
|
|
1894
|
+
}, []), [s] = d.useState(() => Or());
|
|
1895
|
+
return /* @__PURE__ */ me(Ar.Provider, {
|
|
1872
1896
|
value: d.useMemo(() => ({
|
|
1873
1897
|
nodesRef: n,
|
|
1874
1898
|
addNode: r,
|
|
@@ -1878,15 +1902,15 @@ function ki(e) {
|
|
|
1878
1902
|
children: t
|
|
1879
1903
|
});
|
|
1880
1904
|
}
|
|
1881
|
-
function
|
|
1905
|
+
function Ue(e) {
|
|
1882
1906
|
return "data-floating-ui-" + e;
|
|
1883
1907
|
}
|
|
1884
1908
|
function ge(e) {
|
|
1885
1909
|
e.current !== -1 && (clearTimeout(e.current), e.current = -1);
|
|
1886
1910
|
}
|
|
1887
|
-
const
|
|
1888
|
-
function
|
|
1889
|
-
if (n && !
|
|
1911
|
+
const Dn = /* @__PURE__ */ Ue("safe-polygon");
|
|
1912
|
+
function Gt(e, t, n) {
|
|
1913
|
+
if (n && !st(n))
|
|
1890
1914
|
return 0;
|
|
1891
1915
|
if (typeof e == "number")
|
|
1892
1916
|
return e;
|
|
@@ -1896,10 +1920,10 @@ function Ut(e, t, n) {
|
|
|
1896
1920
|
}
|
|
1897
1921
|
return e?.[t];
|
|
1898
1922
|
}
|
|
1899
|
-
function
|
|
1923
|
+
function jt(e) {
|
|
1900
1924
|
return typeof e == "function" ? e() : e;
|
|
1901
1925
|
}
|
|
1902
|
-
function
|
|
1926
|
+
function Pi(e, t) {
|
|
1903
1927
|
t === void 0 && (t = {});
|
|
1904
1928
|
const {
|
|
1905
1929
|
open: n,
|
|
@@ -1909,89 +1933,89 @@ function Fi(e, t) {
|
|
|
1909
1933
|
elements: i
|
|
1910
1934
|
} = e, {
|
|
1911
1935
|
enabled: c = !0,
|
|
1912
|
-
delay:
|
|
1936
|
+
delay: f = 0,
|
|
1913
1937
|
handleClose: l = null,
|
|
1914
1938
|
mouseOnly: u = !1,
|
|
1915
|
-
restMs:
|
|
1916
|
-
move:
|
|
1917
|
-
} = t,
|
|
1918
|
-
}),
|
|
1919
|
-
var
|
|
1920
|
-
const h = (
|
|
1939
|
+
restMs: p = 0,
|
|
1940
|
+
move: m = !0
|
|
1941
|
+
} = t, a = tt(), v = et(), g = ye(l), w = ye(f), x = ye(n), b = ye(p), y = d.useRef(), C = d.useRef(-1), D = d.useRef(), P = d.useRef(-1), N = d.useRef(!0), S = d.useRef(!1), K = d.useRef(() => {
|
|
1942
|
+
}), k = d.useRef(!1), _ = ie(() => {
|
|
1943
|
+
var O;
|
|
1944
|
+
const h = (O = o.current.openEvent) == null ? void 0 : O.type;
|
|
1921
1945
|
return h?.includes("mouse") && h !== "mousedown";
|
|
1922
1946
|
});
|
|
1923
1947
|
d.useEffect(() => {
|
|
1924
1948
|
if (!c) return;
|
|
1925
|
-
function
|
|
1949
|
+
function O(h) {
|
|
1926
1950
|
let {
|
|
1927
1951
|
open: I
|
|
1928
1952
|
} = h;
|
|
1929
|
-
I || (ge(C), ge(
|
|
1953
|
+
I || (ge(C), ge(P), N.current = !0, k.current = !1);
|
|
1930
1954
|
}
|
|
1931
|
-
return s.on("openchange",
|
|
1932
|
-
s.off("openchange",
|
|
1955
|
+
return s.on("openchange", O), () => {
|
|
1956
|
+
s.off("openchange", O);
|
|
1933
1957
|
};
|
|
1934
1958
|
}, [c, s]), d.useEffect(() => {
|
|
1935
1959
|
if (!c || !g.current || !n) return;
|
|
1936
|
-
function
|
|
1960
|
+
function O(I) {
|
|
1937
1961
|
_() && r(!1, I, "hover");
|
|
1938
1962
|
}
|
|
1939
1963
|
const h = le(i.floating).documentElement;
|
|
1940
|
-
return h.addEventListener("mouseleave",
|
|
1941
|
-
h.removeEventListener("mouseleave",
|
|
1964
|
+
return h.addEventListener("mouseleave", O), () => {
|
|
1965
|
+
h.removeEventListener("mouseleave", O);
|
|
1942
1966
|
};
|
|
1943
1967
|
}, [i.floating, n, r, c, g, _]);
|
|
1944
|
-
const G = d.useCallback(function(
|
|
1968
|
+
const G = d.useCallback(function(O, h, I) {
|
|
1945
1969
|
h === void 0 && (h = !0), I === void 0 && (I = "hover");
|
|
1946
|
-
const
|
|
1947
|
-
|
|
1948
|
-
}, [
|
|
1949
|
-
|
|
1970
|
+
const L = Gt(w.current, "close", y.current);
|
|
1971
|
+
L && !D.current ? (ge(C), C.current = window.setTimeout(() => r(!1, O, I), L)) : h && (ge(C), r(!1, O, I));
|
|
1972
|
+
}, [w, r]), W = ie(() => {
|
|
1973
|
+
K.current(), D.current = void 0;
|
|
1950
1974
|
}), R = ie(() => {
|
|
1951
|
-
if (
|
|
1952
|
-
const
|
|
1953
|
-
|
|
1975
|
+
if (S.current) {
|
|
1976
|
+
const O = le(i.floating).body;
|
|
1977
|
+
O.style.pointerEvents = "", O.removeAttribute(Dn), S.current = !1;
|
|
1954
1978
|
}
|
|
1955
1979
|
}), E = ie(() => o.current.openEvent ? ["click", "mousedown"].includes(o.current.openEvent.type) : !1);
|
|
1956
1980
|
d.useEffect(() => {
|
|
1957
1981
|
if (!c) return;
|
|
1958
|
-
function
|
|
1959
|
-
if (ge(C), N.current = !1, u && !
|
|
1982
|
+
function O(F) {
|
|
1983
|
+
if (ge(C), N.current = !1, u && !st(y.current) || jt(b.current) > 0 && !Gt(w.current, "open"))
|
|
1960
1984
|
return;
|
|
1961
|
-
const
|
|
1962
|
-
|
|
1985
|
+
const T = Gt(w.current, "open", y.current);
|
|
1986
|
+
T ? C.current = window.setTimeout(() => {
|
|
1963
1987
|
x.current || r(!0, F, "hover");
|
|
1964
|
-
},
|
|
1988
|
+
}, T) : n || r(!0, F, "hover");
|
|
1965
1989
|
}
|
|
1966
1990
|
function h(F) {
|
|
1967
1991
|
if (E()) {
|
|
1968
1992
|
R();
|
|
1969
1993
|
return;
|
|
1970
1994
|
}
|
|
1971
|
-
|
|
1972
|
-
const
|
|
1973
|
-
if (ge(
|
|
1974
|
-
n || ge(C),
|
|
1995
|
+
K.current();
|
|
1996
|
+
const T = le(i.floating);
|
|
1997
|
+
if (ge(P), k.current = !1, g.current && o.current.floatingContext) {
|
|
1998
|
+
n || ge(C), D.current = g.current({
|
|
1975
1999
|
...o.current.floatingContext,
|
|
1976
|
-
tree:
|
|
2000
|
+
tree: a,
|
|
1977
2001
|
x: F.clientX,
|
|
1978
2002
|
y: F.clientY,
|
|
1979
2003
|
onClose() {
|
|
1980
2004
|
R(), W(), E() || G(F, !0, "safe-polygon");
|
|
1981
2005
|
}
|
|
1982
2006
|
});
|
|
1983
|
-
const j =
|
|
1984
|
-
|
|
1985
|
-
|
|
2007
|
+
const j = D.current;
|
|
2008
|
+
T.addEventListener("mousemove", j), K.current = () => {
|
|
2009
|
+
T.removeEventListener("mousemove", j);
|
|
1986
2010
|
};
|
|
1987
2011
|
return;
|
|
1988
2012
|
}
|
|
1989
|
-
(
|
|
2013
|
+
(y.current !== "touch" || !ce(i.floating, F.relatedTarget)) && G(F);
|
|
1990
2014
|
}
|
|
1991
2015
|
function I(F) {
|
|
1992
2016
|
E() || o.current.floatingContext && (g.current == null || g.current({
|
|
1993
2017
|
...o.current.floatingContext,
|
|
1994
|
-
tree:
|
|
2018
|
+
tree: a,
|
|
1995
2019
|
x: F.clientX,
|
|
1996
2020
|
y: F.clientY,
|
|
1997
2021
|
onClose() {
|
|
@@ -1999,126 +2023,130 @@ function Fi(e, t) {
|
|
|
1999
2023
|
}
|
|
2000
2024
|
})(F));
|
|
2001
2025
|
}
|
|
2002
|
-
function
|
|
2026
|
+
function L() {
|
|
2003
2027
|
ge(C);
|
|
2004
2028
|
}
|
|
2005
2029
|
function ee(F) {
|
|
2006
2030
|
E() || G(F, !1);
|
|
2007
2031
|
}
|
|
2008
2032
|
if (Y(i.domReference)) {
|
|
2009
|
-
const F = i.domReference,
|
|
2010
|
-
return n && F.addEventListener("mouseleave", I),
|
|
2033
|
+
const F = i.domReference, T = i.floating;
|
|
2034
|
+
return n && F.addEventListener("mouseleave", I), m && F.addEventListener("mousemove", O, {
|
|
2011
2035
|
once: !0
|
|
2012
|
-
}), F.addEventListener("mouseenter",
|
|
2013
|
-
n && F.removeEventListener("mouseleave", I),
|
|
2036
|
+
}), F.addEventListener("mouseenter", O), F.addEventListener("mouseleave", h), T && (T.addEventListener("mouseleave", I), T.addEventListener("mouseenter", L), T.addEventListener("mouseleave", ee)), () => {
|
|
2037
|
+
n && F.removeEventListener("mouseleave", I), m && F.removeEventListener("mousemove", O), F.removeEventListener("mouseenter", O), F.removeEventListener("mouseleave", h), T && (T.removeEventListener("mouseleave", I), T.removeEventListener("mouseenter", L), T.removeEventListener("mouseleave", ee));
|
|
2014
2038
|
};
|
|
2015
2039
|
}
|
|
2016
|
-
}, [i, c, e, u,
|
|
2017
|
-
var
|
|
2018
|
-
if (c && n && (
|
|
2019
|
-
|
|
2040
|
+
}, [i, c, e, u, m, G, W, R, r, n, x, a, w, g, o, E, b]), X(() => {
|
|
2041
|
+
var O;
|
|
2042
|
+
if (c && n && (O = g.current) != null && (O = O.__options) != null && O.blockPointerEvents && _()) {
|
|
2043
|
+
S.current = !0;
|
|
2020
2044
|
const I = i.floating;
|
|
2021
2045
|
if (Y(i.domReference) && I) {
|
|
2022
2046
|
var h;
|
|
2023
|
-
const
|
|
2024
|
-
|
|
2025
|
-
const ee = i.domReference, F =
|
|
2026
|
-
return F && (F.style.pointerEvents = ""),
|
|
2027
|
-
|
|
2047
|
+
const L = le(i.floating).body;
|
|
2048
|
+
L.setAttribute(Dn, "");
|
|
2049
|
+
const ee = i.domReference, F = a == null || (h = a.nodesRef.current.find((T) => T.id === v)) == null || (h = h.context) == null ? void 0 : h.elements.floating;
|
|
2050
|
+
return F && (F.style.pointerEvents = ""), L.style.pointerEvents = "none", ee.style.pointerEvents = "auto", I.style.pointerEvents = "auto", () => {
|
|
2051
|
+
L.style.pointerEvents = "", ee.style.pointerEvents = "", I.style.pointerEvents = "";
|
|
2028
2052
|
};
|
|
2029
2053
|
}
|
|
2030
2054
|
}
|
|
2031
|
-
}, [c, n, v, i,
|
|
2032
|
-
n || (
|
|
2055
|
+
}, [c, n, v, i, a, g, _]), X(() => {
|
|
2056
|
+
n || (y.current = void 0, k.current = !1, W(), R());
|
|
2033
2057
|
}, [n, W, R]), d.useEffect(() => () => {
|
|
2034
|
-
W(), ge(C), ge(
|
|
2058
|
+
W(), ge(C), ge(P), R();
|
|
2035
2059
|
}, [c, i.domReference, W, R]);
|
|
2036
|
-
const
|
|
2037
|
-
function
|
|
2038
|
-
|
|
2060
|
+
const V = d.useMemo(() => {
|
|
2061
|
+
function O(h) {
|
|
2062
|
+
y.current = h.pointerType;
|
|
2039
2063
|
}
|
|
2040
2064
|
return {
|
|
2041
|
-
onPointerDown:
|
|
2042
|
-
onPointerEnter:
|
|
2065
|
+
onPointerDown: O,
|
|
2066
|
+
onPointerEnter: O,
|
|
2043
2067
|
onMouseMove(h) {
|
|
2044
2068
|
const {
|
|
2045
2069
|
nativeEvent: I
|
|
2046
2070
|
} = h;
|
|
2047
|
-
function
|
|
2071
|
+
function L() {
|
|
2048
2072
|
!N.current && !x.current && r(!0, I, "hover");
|
|
2049
2073
|
}
|
|
2050
|
-
u && !
|
|
2074
|
+
u && !st(y.current) || n || jt(b.current) === 0 || k.current && h.movementX ** 2 + h.movementY ** 2 < 2 || (ge(P), y.current === "touch" ? L() : (k.current = !0, P.current = window.setTimeout(L, jt(b.current))));
|
|
2051
2075
|
}
|
|
2052
2076
|
};
|
|
2053
2077
|
}, [u, r, n, x, b]);
|
|
2054
2078
|
return d.useMemo(() => c ? {
|
|
2055
|
-
reference:
|
|
2056
|
-
} : {}, [c,
|
|
2079
|
+
reference: V
|
|
2080
|
+
} : {}, [c, V]);
|
|
2057
2081
|
}
|
|
2058
|
-
let
|
|
2059
|
-
function
|
|
2082
|
+
let Ln = 0;
|
|
2083
|
+
function Ve(e, t) {
|
|
2060
2084
|
t === void 0 && (t = {});
|
|
2061
2085
|
const {
|
|
2062
2086
|
preventScroll: n = !1,
|
|
2063
2087
|
cancelPrevious: r = !0,
|
|
2064
2088
|
sync: o = !1
|
|
2065
2089
|
} = t;
|
|
2066
|
-
r && cancelAnimationFrame(
|
|
2090
|
+
r && cancelAnimationFrame(Ln);
|
|
2067
2091
|
const s = () => e?.focus({
|
|
2068
2092
|
preventScroll: n
|
|
2069
2093
|
});
|
|
2070
|
-
o ? s() :
|
|
2094
|
+
o ? s() : Ln = requestAnimationFrame(s);
|
|
2071
2095
|
}
|
|
2072
|
-
function
|
|
2096
|
+
function ei(e) {
|
|
2073
2097
|
return e?.ownerDocument || document;
|
|
2074
2098
|
}
|
|
2075
|
-
const
|
|
2099
|
+
const Je = {
|
|
2076
2100
|
inert: /* @__PURE__ */ new WeakMap(),
|
|
2077
2101
|
"aria-hidden": /* @__PURE__ */ new WeakMap(),
|
|
2078
2102
|
none: /* @__PURE__ */ new WeakMap()
|
|
2079
2103
|
};
|
|
2080
|
-
function
|
|
2081
|
-
return e === "inert" ?
|
|
2104
|
+
function kn(e) {
|
|
2105
|
+
return e === "inert" ? Je.inert : e === "aria-hidden" ? Je["aria-hidden"] : Je.none;
|
|
2082
2106
|
}
|
|
2083
|
-
let
|
|
2084
|
-
const
|
|
2107
|
+
let ht = /* @__PURE__ */ new WeakSet(), vt = {}, qt = 0;
|
|
2108
|
+
const ti = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype;
|
|
2109
|
+
function Mr(e) {
|
|
2110
|
+
return e ? Rt(e) ? e.host : Mr(e.parentNode) : null;
|
|
2111
|
+
}
|
|
2112
|
+
const ni = (e, t) => t.map((n) => {
|
|
2085
2113
|
if (e.contains(n))
|
|
2086
2114
|
return n;
|
|
2087
|
-
const r =
|
|
2115
|
+
const r = Mr(n);
|
|
2088
2116
|
return e.contains(r) ? r : null;
|
|
2089
2117
|
}).filter((n) => n != null);
|
|
2090
|
-
function
|
|
2091
|
-
const o = "data-floating-ui-inert", s = r ? "inert" : n ? "aria-hidden" : null, i =
|
|
2092
|
-
|
|
2093
|
-
const u =
|
|
2094
|
-
i.forEach(
|
|
2095
|
-
function
|
|
2096
|
-
!
|
|
2118
|
+
function ri(e, t, n, r) {
|
|
2119
|
+
const o = "data-floating-ui-inert", s = r ? "inert" : n ? "aria-hidden" : null, i = ni(t, e), c = /* @__PURE__ */ new Set(), f = new Set(i), l = [];
|
|
2120
|
+
vt[o] || (vt[o] = /* @__PURE__ */ new WeakMap());
|
|
2121
|
+
const u = vt[o];
|
|
2122
|
+
i.forEach(p), m(t), c.clear();
|
|
2123
|
+
function p(a) {
|
|
2124
|
+
!a || c.has(a) || (c.add(a), a.parentNode && p(a.parentNode));
|
|
2097
2125
|
}
|
|
2098
|
-
function
|
|
2099
|
-
!
|
|
2126
|
+
function m(a) {
|
|
2127
|
+
!a || f.has(a) || [].forEach.call(a.children, (v) => {
|
|
2100
2128
|
if (We(v) !== "script")
|
|
2101
2129
|
if (c.has(v))
|
|
2102
|
-
|
|
2130
|
+
m(v);
|
|
2103
2131
|
else {
|
|
2104
|
-
const g = s ? v.getAttribute(s) : null,
|
|
2105
|
-
x.set(v, b), u.set(v,
|
|
2132
|
+
const g = s ? v.getAttribute(s) : null, w = g !== null && g !== "false", x = kn(s), b = (x.get(v) || 0) + 1, y = (u.get(v) || 0) + 1;
|
|
2133
|
+
x.set(v, b), u.set(v, y), l.push(v), b === 1 && w && ht.add(v), y === 1 && v.setAttribute(o, ""), !w && s && v.setAttribute(s, s === "inert" ? "" : "true");
|
|
2106
2134
|
}
|
|
2107
2135
|
});
|
|
2108
2136
|
}
|
|
2109
|
-
return
|
|
2110
|
-
l.forEach((
|
|
2111
|
-
const v =
|
|
2112
|
-
v.set(
|
|
2113
|
-
}),
|
|
2137
|
+
return qt++, () => {
|
|
2138
|
+
l.forEach((a) => {
|
|
2139
|
+
const v = kn(s), w = (v.get(a) || 0) - 1, x = (u.get(a) || 0) - 1;
|
|
2140
|
+
v.set(a, w), u.set(a, x), w || (!ht.has(a) && s && a.removeAttribute(s), ht.delete(a)), x || a.removeAttribute(o);
|
|
2141
|
+
}), qt--, qt || (Je.inert = /* @__PURE__ */ new WeakMap(), Je["aria-hidden"] = /* @__PURE__ */ new WeakMap(), Je.none = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakSet(), vt = {});
|
|
2114
2142
|
};
|
|
2115
2143
|
}
|
|
2116
|
-
function
|
|
2144
|
+
function Fn(e, t, n) {
|
|
2117
2145
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
2118
|
-
const r =
|
|
2119
|
-
return
|
|
2146
|
+
const r = ei(e[0]).body;
|
|
2147
|
+
return ri(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))), r, t, n);
|
|
2120
2148
|
}
|
|
2121
|
-
const
|
|
2149
|
+
const ln = {
|
|
2122
2150
|
border: 0,
|
|
2123
2151
|
clip: "rect(0 0 0 0)",
|
|
2124
2152
|
height: "1px",
|
|
@@ -2130,10 +2158,10 @@ const Nt = {
|
|
|
2130
2158
|
width: "1px",
|
|
2131
2159
|
top: 0,
|
|
2132
2160
|
left: 0
|
|
2133
|
-
},
|
|
2161
|
+
}, Mt = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
2134
2162
|
const [r, o] = d.useState();
|
|
2135
2163
|
X(() => {
|
|
2136
|
-
|
|
2164
|
+
rr() && o("button");
|
|
2137
2165
|
}, []);
|
|
2138
2166
|
const s = {
|
|
2139
2167
|
ref: n,
|
|
@@ -2141,50 +2169,55 @@ const Nt = {
|
|
|
2141
2169
|
// Role is only for VoiceOver
|
|
2142
2170
|
role: r,
|
|
2143
2171
|
"aria-hidden": r ? void 0 : !0,
|
|
2144
|
-
[
|
|
2145
|
-
style:
|
|
2172
|
+
[Ue("focus-guard")]: "",
|
|
2173
|
+
style: ln
|
|
2146
2174
|
};
|
|
2147
2175
|
return /* @__PURE__ */ me("span", {
|
|
2148
2176
|
...t,
|
|
2149
2177
|
...s
|
|
2150
2178
|
});
|
|
2151
|
-
}),
|
|
2152
|
-
|
|
2179
|
+
}), oi = {
|
|
2180
|
+
clipPath: "inset(50%)",
|
|
2181
|
+
position: "fixed",
|
|
2182
|
+
top: 0,
|
|
2183
|
+
left: 0
|
|
2184
|
+
}, Sr = /* @__PURE__ */ d.createContext(null), Nn = /* @__PURE__ */ Ue("portal");
|
|
2185
|
+
function ii(e) {
|
|
2153
2186
|
e === void 0 && (e = {});
|
|
2154
2187
|
const {
|
|
2155
2188
|
id: t,
|
|
2156
2189
|
root: n
|
|
2157
|
-
} = e, r =
|
|
2190
|
+
} = e, r = Nt(), o = Pr(), [s, i] = d.useState(null), c = d.useRef(null);
|
|
2158
2191
|
return X(() => () => {
|
|
2159
2192
|
s?.remove(), queueMicrotask(() => {
|
|
2160
2193
|
c.current = null;
|
|
2161
2194
|
});
|
|
2162
2195
|
}, [s]), X(() => {
|
|
2163
2196
|
if (!r || c.current) return;
|
|
2164
|
-
const
|
|
2165
|
-
if (!
|
|
2197
|
+
const f = t ? document.getElementById(t) : null;
|
|
2198
|
+
if (!f) return;
|
|
2166
2199
|
const l = document.createElement("div");
|
|
2167
|
-
l.id = r, l.setAttribute(
|
|
2200
|
+
l.id = r, l.setAttribute(Nn, ""), f.appendChild(l), c.current = l, i(l);
|
|
2168
2201
|
}, [t, r]), X(() => {
|
|
2169
2202
|
if (n === null || !r || c.current) return;
|
|
2170
|
-
let
|
|
2171
|
-
|
|
2203
|
+
let f = n || o?.portalNode;
|
|
2204
|
+
f && !rn(f) && (f = f.current), f = f || document.body;
|
|
2172
2205
|
let l = null;
|
|
2173
|
-
t && (l = document.createElement("div"), l.id = t,
|
|
2206
|
+
t && (l = document.createElement("div"), l.id = t, f.appendChild(l));
|
|
2174
2207
|
const u = document.createElement("div");
|
|
2175
|
-
u.id = r, u.setAttribute(
|
|
2208
|
+
u.id = r, u.setAttribute(Nn, ""), f = l || f, f.appendChild(u), c.current = u, i(u);
|
|
2176
2209
|
}, [t, n, r, o]), s;
|
|
2177
2210
|
}
|
|
2178
|
-
function
|
|
2211
|
+
function Di(e) {
|
|
2179
2212
|
const {
|
|
2180
2213
|
children: t,
|
|
2181
2214
|
id: n,
|
|
2182
2215
|
root: r,
|
|
2183
2216
|
preserveTabOrder: o = !0
|
|
2184
|
-
} = e, s =
|
|
2217
|
+
} = e, s = ii({
|
|
2185
2218
|
id: n,
|
|
2186
2219
|
root: r
|
|
2187
|
-
}), [i, c] = d.useState(null),
|
|
2220
|
+
}), [i, c] = d.useState(null), f = d.useRef(null), l = d.useRef(null), u = d.useRef(null), p = d.useRef(null), m = i?.modal, a = i?.open, v = (
|
|
2188
2221
|
// The FocusManager and therefore floating element are currently open/
|
|
2189
2222
|
// rendered.
|
|
2190
2223
|
!!i && // Guards are only for non-modal focus management.
|
|
@@ -2192,99 +2225,104 @@ function Ni(e) {
|
|
|
2192
2225
|
i.open && o && !!(r || s)
|
|
2193
2226
|
);
|
|
2194
2227
|
return d.useEffect(() => {
|
|
2195
|
-
if (!s || !o ||
|
|
2228
|
+
if (!s || !o || m)
|
|
2196
2229
|
return;
|
|
2197
|
-
function g(
|
|
2198
|
-
s &&
|
|
2230
|
+
function g(w) {
|
|
2231
|
+
s && it(w) && (w.type === "focusin" ? Rn : co)(s);
|
|
2199
2232
|
}
|
|
2200
2233
|
return s.addEventListener("focusin", g, !0), s.addEventListener("focusout", g, !0), () => {
|
|
2201
2234
|
s.removeEventListener("focusin", g, !0), s.removeEventListener("focusout", g, !0);
|
|
2202
2235
|
};
|
|
2203
|
-
}, [s, o,
|
|
2204
|
-
s && (
|
|
2205
|
-
}, [
|
|
2236
|
+
}, [s, o, m]), d.useEffect(() => {
|
|
2237
|
+
s && (a || Rn(s));
|
|
2238
|
+
}, [a, s]), /* @__PURE__ */ Yn(Sr.Provider, {
|
|
2206
2239
|
value: d.useMemo(() => ({
|
|
2207
2240
|
preserveTabOrder: o,
|
|
2208
|
-
beforeOutsideRef:
|
|
2241
|
+
beforeOutsideRef: f,
|
|
2209
2242
|
afterOutsideRef: l,
|
|
2210
2243
|
beforeInsideRef: u,
|
|
2211
|
-
afterInsideRef:
|
|
2244
|
+
afterInsideRef: p,
|
|
2212
2245
|
portalNode: s,
|
|
2213
2246
|
setFocusManagerState: c
|
|
2214
2247
|
}), [o, s]),
|
|
2215
|
-
children: [v && s && /* @__PURE__ */ me(
|
|
2248
|
+
children: [v && s && /* @__PURE__ */ me(Mt, {
|
|
2216
2249
|
"data-type": "outside",
|
|
2217
|
-
ref:
|
|
2250
|
+
ref: f,
|
|
2218
2251
|
onFocus: (g) => {
|
|
2219
|
-
if (
|
|
2220
|
-
var
|
|
2221
|
-
(
|
|
2252
|
+
if (it(g, s)) {
|
|
2253
|
+
var w;
|
|
2254
|
+
(w = u.current) == null || w.focus();
|
|
2222
2255
|
} else {
|
|
2223
|
-
const x = i ? i.domReference : null, b =
|
|
2256
|
+
const x = i ? i.domReference : null, b = mr(x);
|
|
2224
2257
|
b?.focus();
|
|
2225
2258
|
}
|
|
2226
2259
|
}
|
|
2227
2260
|
}), v && s && /* @__PURE__ */ me("span", {
|
|
2228
2261
|
"aria-owns": s.id,
|
|
2229
|
-
style:
|
|
2230
|
-
}), s && /* @__PURE__ */ nn.createPortal(t, s), v && s && /* @__PURE__ */ me(
|
|
2262
|
+
style: oi
|
|
2263
|
+
}), s && /* @__PURE__ */ nn.createPortal(t, s), v && s && /* @__PURE__ */ me(Mt, {
|
|
2231
2264
|
"data-type": "outside",
|
|
2232
2265
|
ref: l,
|
|
2233
2266
|
onFocus: (g) => {
|
|
2234
|
-
if (
|
|
2235
|
-
var
|
|
2236
|
-
(
|
|
2267
|
+
if (it(g, s)) {
|
|
2268
|
+
var w;
|
|
2269
|
+
(w = p.current) == null || w.focus();
|
|
2237
2270
|
} else {
|
|
2238
|
-
const x = i ? i.domReference : null, b =
|
|
2271
|
+
const x = i ? i.domReference : null, b = dr(x);
|
|
2239
2272
|
b?.focus(), i?.closeOnFocusOut && i?.onOpenChange(!1, g.nativeEvent, "focus-out");
|
|
2240
2273
|
}
|
|
2241
2274
|
}
|
|
2242
2275
|
})]
|
|
2243
2276
|
});
|
|
2244
2277
|
}
|
|
2245
|
-
const
|
|
2246
|
-
function
|
|
2278
|
+
const Pr = () => d.useContext(Sr);
|
|
2279
|
+
function _n(e) {
|
|
2247
2280
|
return d.useMemo(() => (t) => {
|
|
2248
2281
|
e.forEach((n) => {
|
|
2249
2282
|
n && (n.current = t);
|
|
2250
2283
|
});
|
|
2251
2284
|
}, e);
|
|
2252
2285
|
}
|
|
2253
|
-
const
|
|
2286
|
+
const Wn = 20;
|
|
2254
2287
|
let Le = [];
|
|
2255
|
-
function
|
|
2256
|
-
Le = Le.filter((e) =>
|
|
2288
|
+
function an() {
|
|
2289
|
+
Le = Le.filter((e) => {
|
|
2290
|
+
var t;
|
|
2291
|
+
return (t = e.deref()) == null ? void 0 : t.isConnected;
|
|
2292
|
+
});
|
|
2257
2293
|
}
|
|
2258
|
-
function
|
|
2259
|
-
|
|
2294
|
+
function si(e) {
|
|
2295
|
+
an(), e && We(e) !== "body" && (Le.push(new WeakRef(e)), Le.length > Wn && (Le = Le.slice(-Wn)));
|
|
2260
2296
|
}
|
|
2261
|
-
function
|
|
2262
|
-
|
|
2297
|
+
function Kn() {
|
|
2298
|
+
an();
|
|
2299
|
+
const e = Le[Le.length - 1];
|
|
2300
|
+
return e?.deref();
|
|
2263
2301
|
}
|
|
2264
|
-
function
|
|
2265
|
-
const t =
|
|
2266
|
-
return
|
|
2302
|
+
function ci(e) {
|
|
2303
|
+
const t = at();
|
|
2304
|
+
return Xn(e, t) ? e : St(e, t)[0] || e;
|
|
2267
2305
|
}
|
|
2268
|
-
function
|
|
2306
|
+
function $n(e, t) {
|
|
2269
2307
|
var n;
|
|
2270
2308
|
if (!t.current.includes("floating") && !((n = e.getAttribute("role")) != null && n.includes("dialog")))
|
|
2271
2309
|
return;
|
|
2272
|
-
const r =
|
|
2273
|
-
const
|
|
2274
|
-
return
|
|
2310
|
+
const r = at(), s = Lr(e, r).filter((c) => {
|
|
2311
|
+
const f = c.getAttribute("data-tabindex") || "";
|
|
2312
|
+
return Xn(c, r) || c.hasAttribute("data-tabindex") && !f.startsWith("-");
|
|
2275
2313
|
}), i = e.getAttribute("tabindex");
|
|
2276
2314
|
t.current.includes("floating") || s.length === 0 ? i !== "0" && e.setAttribute("tabindex", "0") : (i !== "-1" || e.hasAttribute("data-tabindex") && e.getAttribute("data-tabindex") !== "-1") && (e.setAttribute("tabindex", "-1"), e.setAttribute("data-tabindex", "-1"));
|
|
2277
2315
|
}
|
|
2278
|
-
const
|
|
2316
|
+
const ui = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
2279
2317
|
return /* @__PURE__ */ me("button", {
|
|
2280
2318
|
...t,
|
|
2281
2319
|
type: "button",
|
|
2282
2320
|
ref: n,
|
|
2283
2321
|
tabIndex: -1,
|
|
2284
|
-
style:
|
|
2322
|
+
style: ln
|
|
2285
2323
|
});
|
|
2286
2324
|
});
|
|
2287
|
-
function
|
|
2325
|
+
function Li(e) {
|
|
2288
2326
|
const {
|
|
2289
2327
|
context: t,
|
|
2290
2328
|
children: n,
|
|
@@ -2293,55 +2331,55 @@ function _i(e) {
|
|
|
2293
2331
|
guards: s = !0,
|
|
2294
2332
|
initialFocus: i = 0,
|
|
2295
2333
|
returnFocus: c = !0,
|
|
2296
|
-
restoreFocus:
|
|
2334
|
+
restoreFocus: f = !1,
|
|
2297
2335
|
modal: l = !0,
|
|
2298
2336
|
visuallyHiddenDismiss: u = !1,
|
|
2299
|
-
closeOnFocusOut:
|
|
2300
|
-
outsideElementsInert:
|
|
2301
|
-
getInsideElements:
|
|
2337
|
+
closeOnFocusOut: p = !0,
|
|
2338
|
+
outsideElementsInert: m = !1,
|
|
2339
|
+
getInsideElements: a = () => []
|
|
2302
2340
|
} = e, {
|
|
2303
2341
|
open: v,
|
|
2304
2342
|
onOpenChange: g,
|
|
2305
|
-
events:
|
|
2343
|
+
events: w,
|
|
2306
2344
|
dataRef: x,
|
|
2307
2345
|
elements: {
|
|
2308
2346
|
domReference: b,
|
|
2309
|
-
floating:
|
|
2347
|
+
floating: y
|
|
2310
2348
|
}
|
|
2311
2349
|
} = t, C = ie(() => {
|
|
2312
|
-
var
|
|
2313
|
-
return (
|
|
2314
|
-
}),
|
|
2315
|
-
return
|
|
2316
|
-
}), j = ie((
|
|
2317
|
-
const z = J(
|
|
2318
|
-
return _.current.map((B) => b && B === "reference" ? b :
|
|
2350
|
+
var $;
|
|
2351
|
+
return ($ = x.current.floatingContext) == null ? void 0 : $.nodeId;
|
|
2352
|
+
}), D = ie(a), P = typeof i == "number" && i < 0, N = en(b) && P, S = ti(), K = S ? s : !0, k = !K || S && m, _ = ye(o), G = ye(i), W = ye(c), R = tt(), E = Pr(), V = d.useRef(null), O = d.useRef(null), h = d.useRef(!1), I = d.useRef(!1), L = d.useRef(-1), ee = d.useRef(-1), F = E != null, T = Tt(y), J = ie(function($) {
|
|
2353
|
+
return $ === void 0 && ($ = T), $ ? St($, at()) : [];
|
|
2354
|
+
}), j = ie(($) => {
|
|
2355
|
+
const z = J($);
|
|
2356
|
+
return _.current.map((B) => b && B === "reference" ? b : T && B === "floating" ? T : z).filter(Boolean).flat();
|
|
2319
2357
|
});
|
|
2320
2358
|
d.useEffect(() => {
|
|
2321
2359
|
if (r || !l) return;
|
|
2322
|
-
function
|
|
2360
|
+
function $(B) {
|
|
2323
2361
|
if (B.key === "Tab") {
|
|
2324
|
-
ce(
|
|
2362
|
+
ce(T, Re(le(T))) && J().length === 0 && !N && de(B);
|
|
2325
2363
|
const Q = j(), te = Ae(B);
|
|
2326
|
-
_.current[0] === "reference" && te === b && (de(B), B.shiftKey ?
|
|
2364
|
+
_.current[0] === "reference" && te === b && (de(B), B.shiftKey ? Ve(Q[Q.length - 1]) : Ve(Q[1])), _.current[1] === "floating" && te === T && B.shiftKey && (de(B), Ve(Q[0]));
|
|
2327
2365
|
}
|
|
2328
2366
|
}
|
|
2329
|
-
const z = le(
|
|
2330
|
-
return z.addEventListener("keydown",
|
|
2331
|
-
z.removeEventListener("keydown",
|
|
2367
|
+
const z = le(T);
|
|
2368
|
+
return z.addEventListener("keydown", $), () => {
|
|
2369
|
+
z.removeEventListener("keydown", $);
|
|
2332
2370
|
};
|
|
2333
|
-
}, [r, b,
|
|
2334
|
-
if (r || !
|
|
2335
|
-
function
|
|
2371
|
+
}, [r, b, T, l, _, N, J, j]), d.useEffect(() => {
|
|
2372
|
+
if (r || !y) return;
|
|
2373
|
+
function $(z) {
|
|
2336
2374
|
const B = Ae(z), te = J().indexOf(B);
|
|
2337
|
-
te !== -1 && (
|
|
2375
|
+
te !== -1 && (L.current = te);
|
|
2338
2376
|
}
|
|
2339
|
-
return
|
|
2340
|
-
|
|
2377
|
+
return y.addEventListener("focusin", $), () => {
|
|
2378
|
+
y.removeEventListener("focusin", $);
|
|
2341
2379
|
};
|
|
2342
|
-
}, [r,
|
|
2343
|
-
if (r || !
|
|
2344
|
-
function
|
|
2380
|
+
}, [r, y, J]), d.useEffect(() => {
|
|
2381
|
+
if (r || !p) return;
|
|
2382
|
+
function $() {
|
|
2345
2383
|
I.current = !0, setTimeout(() => {
|
|
2346
2384
|
I.current = !1;
|
|
2347
2385
|
});
|
|
@@ -2349,24 +2387,24 @@ function _i(e) {
|
|
|
2349
2387
|
function z(te) {
|
|
2350
2388
|
const U = te.relatedTarget, fe = te.currentTarget, se = Ae(te);
|
|
2351
2389
|
queueMicrotask(() => {
|
|
2352
|
-
const ae = C(), xe = !(ce(b, U) || ce(
|
|
2390
|
+
const ae = C(), xe = !(ce(b, U) || ce(y, U) || ce(U, y) || ce(E?.portalNode, U) || U != null && U.hasAttribute(Ue("focus-guard")) || R && (Be(R.nodesRef.current, ae).find((M) => {
|
|
2353
2391
|
var H, A;
|
|
2354
|
-
return ce((H =
|
|
2355
|
-
}) ||
|
|
2392
|
+
return ce((H = M.context) == null ? void 0 : H.elements.floating, U) || ce((A = M.context) == null ? void 0 : A.elements.domReference, U);
|
|
2393
|
+
}) || xn(R.nodesRef.current, ae).find((M) => {
|
|
2356
2394
|
var H, A, q;
|
|
2357
|
-
return [(H =
|
|
2395
|
+
return [(H = M.context) == null ? void 0 : H.elements.floating, Tt((A = M.context) == null ? void 0 : A.elements.floating)].includes(U) || ((q = M.context) == null ? void 0 : q.elements.domReference) === U;
|
|
2358
2396
|
})));
|
|
2359
|
-
if (fe === b &&
|
|
2360
|
-
|
|
2361
|
-
const
|
|
2362
|
-
|
|
2397
|
+
if (fe === b && T && $n(T, _), f && fe !== b && !(se != null && se.isConnected) && Re(le(T)) === le(T).body) {
|
|
2398
|
+
re(T) && T.focus();
|
|
2399
|
+
const M = L.current, H = J(), A = H[M] || H[H.length - 1] || T;
|
|
2400
|
+
re(A) && A.focus();
|
|
2363
2401
|
}
|
|
2364
2402
|
if (x.current.insideReactTree) {
|
|
2365
2403
|
x.current.insideReactTree = !1;
|
|
2366
2404
|
return;
|
|
2367
2405
|
}
|
|
2368
2406
|
(N || !l) && U && xe && !I.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
2369
|
-
U !==
|
|
2407
|
+
U !== Kn() && (h.current = !0, g(!1, te, "focus-out"));
|
|
2370
2408
|
});
|
|
2371
2409
|
}
|
|
2372
2410
|
const B = !!(!R && E);
|
|
@@ -2375,35 +2413,35 @@ function _i(e) {
|
|
|
2375
2413
|
x.current.insideReactTree = !1;
|
|
2376
2414
|
});
|
|
2377
2415
|
}
|
|
2378
|
-
if (
|
|
2379
|
-
return b.addEventListener("focusout", z), b.addEventListener("pointerdown",
|
|
2380
|
-
b.removeEventListener("focusout", z), b.removeEventListener("pointerdown",
|
|
2416
|
+
if (y && re(b))
|
|
2417
|
+
return b.addEventListener("focusout", z), b.addEventListener("pointerdown", $), y.addEventListener("focusout", z), B && y.addEventListener("focusout", Q, !0), () => {
|
|
2418
|
+
b.removeEventListener("focusout", z), b.removeEventListener("pointerdown", $), y.removeEventListener("focusout", z), B && y.removeEventListener("focusout", Q, !0);
|
|
2381
2419
|
};
|
|
2382
|
-
}, [r, b,
|
|
2383
|
-
const oe = d.useRef(null), ve = d.useRef(null),
|
|
2420
|
+
}, [r, b, y, T, l, R, E, g, p, f, J, N, C, _, x]);
|
|
2421
|
+
const oe = d.useRef(null), ve = d.useRef(null), nt = _n([oe, E?.beforeInsideRef]), Ge = _n([ve, E?.afterInsideRef]);
|
|
2384
2422
|
d.useEffect(() => {
|
|
2385
|
-
var
|
|
2386
|
-
if (r || !
|
|
2387
|
-
const B = Array.from((E == null || (
|
|
2423
|
+
var $, z;
|
|
2424
|
+
if (r || !y) return;
|
|
2425
|
+
const B = Array.from((E == null || ($ = E.portalNode) == null ? void 0 : $.querySelectorAll("[" + Ue("portal") + "]")) || []), te = (z = (R ? xn(R.nodesRef.current, C()) : []).find((se) => {
|
|
2388
2426
|
var ae;
|
|
2389
2427
|
return en(((ae = se.context) == null ? void 0 : ae.elements.domReference) || null);
|
|
2390
|
-
})) == null || (z = z.context) == null ? void 0 : z.elements.domReference, U = [
|
|
2428
|
+
})) == null || (z = z.context) == null ? void 0 : z.elements.domReference, U = [y, te, ...B, ...D(), V.current, O.current, oe.current, ve.current, E?.beforeOutsideRef.current, E?.afterOutsideRef.current, _.current.includes("reference") || N ? b : null].filter((se) => se != null), fe = l || N ? Fn(U, !k, k) : Fn(U);
|
|
2391
2429
|
return () => {
|
|
2392
2430
|
fe();
|
|
2393
2431
|
};
|
|
2394
|
-
}, [r, b,
|
|
2395
|
-
if (r || !
|
|
2396
|
-
const
|
|
2432
|
+
}, [r, b, y, l, _, E, N, K, k, R, C, D]), X(() => {
|
|
2433
|
+
if (r || !re(T)) return;
|
|
2434
|
+
const $ = le(T), z = Re($);
|
|
2397
2435
|
queueMicrotask(() => {
|
|
2398
|
-
const B = j(
|
|
2399
|
-
!
|
|
2400
|
-
preventScroll: te ===
|
|
2436
|
+
const B = j(T), Q = G.current, te = (typeof Q == "number" ? B[Q] : Q.current) || T, U = ce(T, z);
|
|
2437
|
+
!P && !U && v && Ve(te, {
|
|
2438
|
+
preventScroll: te === T
|
|
2401
2439
|
});
|
|
2402
2440
|
});
|
|
2403
|
-
}, [r, v,
|
|
2404
|
-
if (r || !
|
|
2405
|
-
const
|
|
2406
|
-
|
|
2441
|
+
}, [r, v, T, P, j, G]), X(() => {
|
|
2442
|
+
if (r || !T) return;
|
|
2443
|
+
const $ = le(T), z = Re($);
|
|
2444
|
+
si(z);
|
|
2407
2445
|
function B(U) {
|
|
2408
2446
|
let {
|
|
2409
2447
|
reason: fe,
|
|
@@ -2413,7 +2451,7 @@ function _i(e) {
|
|
|
2413
2451
|
if (["hover", "safe-polygon"].includes(fe) && se.type === "mouseleave" && (h.current = !0), fe === "outside-press")
|
|
2414
2452
|
if (ae)
|
|
2415
2453
|
h.current = !1;
|
|
2416
|
-
else if (
|
|
2454
|
+
else if (ir(se) || sr(se))
|
|
2417
2455
|
h.current = !1;
|
|
2418
2456
|
else {
|
|
2419
2457
|
let xe = !1;
|
|
@@ -2424,85 +2462,85 @@ function _i(e) {
|
|
|
2424
2462
|
}), xe ? h.current = !1 : h.current = !0;
|
|
2425
2463
|
}
|
|
2426
2464
|
}
|
|
2427
|
-
|
|
2428
|
-
const Q =
|
|
2429
|
-
Q.setAttribute("tabindex", "-1"), Q.setAttribute("aria-hidden", "true"), Object.assign(Q.style,
|
|
2465
|
+
w.on("openchange", B);
|
|
2466
|
+
const Q = $.createElement("span");
|
|
2467
|
+
Q.setAttribute("tabindex", "-1"), Q.setAttribute("aria-hidden", "true"), Object.assign(Q.style, ln), F && b && b.insertAdjacentElement("afterend", Q);
|
|
2430
2468
|
function te() {
|
|
2431
2469
|
if (typeof W.current == "boolean") {
|
|
2432
|
-
const U = b ||
|
|
2470
|
+
const U = b || Kn();
|
|
2433
2471
|
return U && U.isConnected ? U : Q;
|
|
2434
2472
|
}
|
|
2435
2473
|
return W.current.current || Q;
|
|
2436
2474
|
}
|
|
2437
2475
|
return () => {
|
|
2438
|
-
|
|
2439
|
-
const U = Re(
|
|
2476
|
+
w.off("openchange", B);
|
|
2477
|
+
const U = Re($), fe = ce(y, U) || R && Be(R.nodesRef.current, C(), !1).some((ae) => {
|
|
2440
2478
|
var xe;
|
|
2441
2479
|
return ce((xe = ae.context) == null ? void 0 : xe.elements.floating, U);
|
|
2442
2480
|
}), se = te();
|
|
2443
2481
|
queueMicrotask(() => {
|
|
2444
|
-
const ae =
|
|
2482
|
+
const ae = ci(se);
|
|
2445
2483
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2446
|
-
W.current && !h.current &&
|
|
2484
|
+
W.current && !h.current && re(ae) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
2447
2485
|
// since it likely entered a different element which should be
|
|
2448
2486
|
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
2449
|
-
(!(ae !== U && U !==
|
|
2487
|
+
(!(ae !== U && U !== $.body) || fe) && ae.focus({
|
|
2450
2488
|
preventScroll: !0
|
|
2451
2489
|
}), Q.remove();
|
|
2452
2490
|
});
|
|
2453
2491
|
};
|
|
2454
|
-
}, [r,
|
|
2492
|
+
}, [r, y, T, W, x, w, R, F, b, C]), d.useEffect(() => (queueMicrotask(() => {
|
|
2455
2493
|
h.current = !1;
|
|
2456
2494
|
}), () => {
|
|
2457
|
-
queueMicrotask(
|
|
2495
|
+
queueMicrotask(an);
|
|
2458
2496
|
}), [r]), X(() => {
|
|
2459
2497
|
if (!r && E)
|
|
2460
2498
|
return E.setFocusManagerState({
|
|
2461
2499
|
modal: l,
|
|
2462
|
-
closeOnFocusOut:
|
|
2500
|
+
closeOnFocusOut: p,
|
|
2463
2501
|
open: v,
|
|
2464
2502
|
onOpenChange: g,
|
|
2465
2503
|
domReference: b
|
|
2466
2504
|
}), () => {
|
|
2467
2505
|
E.setFocusManagerState(null);
|
|
2468
2506
|
};
|
|
2469
|
-
}, [r, E, l, v, g,
|
|
2470
|
-
r ||
|
|
2471
|
-
}, [r,
|
|
2472
|
-
function
|
|
2473
|
-
return r || !u || !l ? null : /* @__PURE__ */ me(
|
|
2474
|
-
ref:
|
|
2507
|
+
}, [r, E, l, v, g, p, b]), X(() => {
|
|
2508
|
+
r || T && $n(T, _);
|
|
2509
|
+
}, [r, T, _]);
|
|
2510
|
+
function Te($) {
|
|
2511
|
+
return r || !u || !l ? null : /* @__PURE__ */ me(ui, {
|
|
2512
|
+
ref: $ === "start" ? V : O,
|
|
2475
2513
|
onClick: (z) => g(!1, z.nativeEvent),
|
|
2476
2514
|
children: typeof u == "string" ? u : "Dismiss"
|
|
2477
2515
|
});
|
|
2478
2516
|
}
|
|
2479
|
-
const
|
|
2480
|
-
return /* @__PURE__ */
|
|
2481
|
-
children: [
|
|
2517
|
+
const je = !r && K && (l ? !N : !0) && (F || l);
|
|
2518
|
+
return /* @__PURE__ */ Yn(kr, {
|
|
2519
|
+
children: [je && /* @__PURE__ */ me(Mt, {
|
|
2482
2520
|
"data-type": "inside",
|
|
2483
|
-
ref:
|
|
2484
|
-
onFocus: (
|
|
2521
|
+
ref: nt,
|
|
2522
|
+
onFocus: ($) => {
|
|
2485
2523
|
if (l) {
|
|
2486
2524
|
const B = j();
|
|
2487
|
-
|
|
2525
|
+
Ve(o[0] === "reference" ? B[0] : B[B.length - 1]);
|
|
2488
2526
|
} else if (E != null && E.preserveTabOrder && E.portalNode)
|
|
2489
|
-
if (h.current = !1,
|
|
2490
|
-
const B =
|
|
2527
|
+
if (h.current = !1, it($, E.portalNode)) {
|
|
2528
|
+
const B = dr(b);
|
|
2491
2529
|
B?.focus();
|
|
2492
2530
|
} else {
|
|
2493
2531
|
var z;
|
|
2494
2532
|
(z = E.beforeOutsideRef.current) == null || z.focus();
|
|
2495
2533
|
}
|
|
2496
2534
|
}
|
|
2497
|
-
}), !N &&
|
|
2535
|
+
}), !N && Te("start"), n, Te("end"), je && /* @__PURE__ */ me(Mt, {
|
|
2498
2536
|
"data-type": "inside",
|
|
2499
|
-
ref:
|
|
2500
|
-
onFocus: (
|
|
2537
|
+
ref: Ge,
|
|
2538
|
+
onFocus: ($) => {
|
|
2501
2539
|
if (l)
|
|
2502
|
-
|
|
2540
|
+
Ve(j()[0]);
|
|
2503
2541
|
else if (E != null && E.preserveTabOrder && E.portalNode)
|
|
2504
|
-
if (
|
|
2505
|
-
const B =
|
|
2542
|
+
if (p && (h.current = !0), it($, E.portalNode)) {
|
|
2543
|
+
const B = mr(b);
|
|
2506
2544
|
B?.focus();
|
|
2507
2545
|
} else {
|
|
2508
2546
|
var z;
|
|
@@ -2512,17 +2550,17 @@ function _i(e) {
|
|
|
2512
2550
|
})]
|
|
2513
2551
|
});
|
|
2514
2552
|
}
|
|
2515
|
-
let
|
|
2553
|
+
let bt = 0;
|
|
2516
2554
|
const Vn = "--floating-ui-scrollbar-width";
|
|
2517
|
-
function
|
|
2555
|
+
function li() {
|
|
2518
2556
|
const e = sn(), t = /iP(hone|ad|od)|iOS/.test(e) || // iPads can claim to be MacIntel
|
|
2519
2557
|
e === "MacIntel" && navigator.maxTouchPoints > 1, n = document.body.style, o = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft ? "paddingLeft" : "paddingRight", s = window.innerWidth - document.documentElement.clientWidth, i = n.left ? parseFloat(n.left) : window.scrollX, c = n.top ? parseFloat(n.top) : window.scrollY;
|
|
2520
2558
|
if (n.overflow = "hidden", n.setProperty(Vn, s + "px"), s && (n[o] = s + "px"), t) {
|
|
2521
|
-
var
|
|
2522
|
-
const u = ((
|
|
2559
|
+
var f, l;
|
|
2560
|
+
const u = ((f = window.visualViewport) == null ? void 0 : f.offsetLeft) || 0, p = ((l = window.visualViewport) == null ? void 0 : l.offsetTop) || 0;
|
|
2523
2561
|
Object.assign(n, {
|
|
2524
2562
|
position: "fixed",
|
|
2525
|
-
top: -(c - Math.floor(
|
|
2563
|
+
top: -(c - Math.floor(p)) + "px",
|
|
2526
2564
|
left: -(i - Math.floor(u)) + "px",
|
|
2527
2565
|
right: "0"
|
|
2528
2566
|
});
|
|
@@ -2539,17 +2577,17 @@ function mi() {
|
|
|
2539
2577
|
}), window.scrollTo(i, c));
|
|
2540
2578
|
};
|
|
2541
2579
|
}
|
|
2542
|
-
let
|
|
2580
|
+
let Bn = () => {
|
|
2543
2581
|
};
|
|
2544
|
-
const
|
|
2582
|
+
const ki = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
2545
2583
|
const {
|
|
2546
2584
|
lockScroll: r = !1,
|
|
2547
2585
|
...o
|
|
2548
2586
|
} = t;
|
|
2549
2587
|
return X(() => {
|
|
2550
2588
|
if (r)
|
|
2551
|
-
return
|
|
2552
|
-
|
|
2589
|
+
return bt++, bt === 1 && (Bn = li()), () => {
|
|
2590
|
+
bt--, bt === 0 && Bn();
|
|
2553
2591
|
};
|
|
2554
2592
|
}, [r]), /* @__PURE__ */ me("div", {
|
|
2555
2593
|
ref: n,
|
|
@@ -2565,16 +2603,16 @@ const Wi = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
|
2565
2603
|
}
|
|
2566
2604
|
});
|
|
2567
2605
|
});
|
|
2568
|
-
function
|
|
2569
|
-
return
|
|
2606
|
+
function Hn(e) {
|
|
2607
|
+
return re(e.target) && e.target.tagName === "BUTTON";
|
|
2570
2608
|
}
|
|
2571
|
-
function
|
|
2572
|
-
return
|
|
2609
|
+
function ai(e) {
|
|
2610
|
+
return re(e.target) && e.target.tagName === "A";
|
|
2573
2611
|
}
|
|
2574
|
-
function
|
|
2612
|
+
function zn(e) {
|
|
2575
2613
|
return cn(e);
|
|
2576
2614
|
}
|
|
2577
|
-
function
|
|
2615
|
+
function Fi(e, t) {
|
|
2578
2616
|
t === void 0 && (t = {});
|
|
2579
2617
|
const {
|
|
2580
2618
|
open: n,
|
|
@@ -2586,53 +2624,53 @@ function Vi(e, t) {
|
|
|
2586
2624
|
} = e, {
|
|
2587
2625
|
enabled: i = !0,
|
|
2588
2626
|
event: c = "click",
|
|
2589
|
-
toggle:
|
|
2627
|
+
toggle: f = !0,
|
|
2590
2628
|
ignoreMouse: l = !1,
|
|
2591
2629
|
keyboardHandlers: u = !0,
|
|
2592
|
-
stickIfOpen:
|
|
2593
|
-
} = t,
|
|
2630
|
+
stickIfOpen: p = !0
|
|
2631
|
+
} = t, m = d.useRef(), a = d.useRef(!1), v = d.useMemo(() => ({
|
|
2594
2632
|
onPointerDown(g) {
|
|
2595
|
-
|
|
2633
|
+
m.current = g.pointerType;
|
|
2596
2634
|
},
|
|
2597
2635
|
onMouseDown(g) {
|
|
2598
|
-
const
|
|
2599
|
-
g.button === 0 && c !== "click" && (
|
|
2636
|
+
const w = m.current;
|
|
2637
|
+
g.button === 0 && c !== "click" && (st(w, !0) && l || (n && f && (!(o.current.openEvent && p) || o.current.openEvent.type === "mousedown") ? r(!1, g.nativeEvent, "click") : (g.preventDefault(), r(!0, g.nativeEvent, "click"))));
|
|
2600
2638
|
},
|
|
2601
2639
|
onClick(g) {
|
|
2602
|
-
const
|
|
2603
|
-
if (c === "mousedown" &&
|
|
2604
|
-
|
|
2640
|
+
const w = m.current;
|
|
2641
|
+
if (c === "mousedown" && m.current) {
|
|
2642
|
+
m.current = void 0;
|
|
2605
2643
|
return;
|
|
2606
2644
|
}
|
|
2607
|
-
|
|
2645
|
+
st(w, !0) && l || (n && f && (!(o.current.openEvent && p) || o.current.openEvent.type === "click") ? r(!1, g.nativeEvent, "click") : r(!0, g.nativeEvent, "click"));
|
|
2608
2646
|
},
|
|
2609
2647
|
onKeyDown(g) {
|
|
2610
|
-
|
|
2648
|
+
m.current = void 0, !(g.defaultPrevented || !u || Hn(g)) && (g.key === " " && !zn(s) && (g.preventDefault(), a.current = !0), !ai(g) && g.key === "Enter" && r(!(n && f), g.nativeEvent, "click"));
|
|
2611
2649
|
},
|
|
2612
2650
|
onKeyUp(g) {
|
|
2613
|
-
g.defaultPrevented || !u ||
|
|
2651
|
+
g.defaultPrevented || !u || Hn(g) || zn(s) || g.key === " " && a.current && (a.current = !1, r(!(n && f), g.nativeEvent, "click"));
|
|
2614
2652
|
}
|
|
2615
|
-
}), [o, s, c, l, u, r, n,
|
|
2653
|
+
}), [o, s, c, l, u, r, n, p, f]);
|
|
2616
2654
|
return d.useMemo(() => i ? {
|
|
2617
2655
|
reference: v
|
|
2618
2656
|
} : {}, [i, v]);
|
|
2619
2657
|
}
|
|
2620
|
-
const
|
|
2658
|
+
const fi = {
|
|
2621
2659
|
pointerdown: "onPointerDown",
|
|
2622
2660
|
mousedown: "onMouseDown",
|
|
2623
2661
|
click: "onClick"
|
|
2624
|
-
},
|
|
2662
|
+
}, di = {
|
|
2625
2663
|
pointerdown: "onPointerDownCapture",
|
|
2626
2664
|
mousedown: "onMouseDownCapture",
|
|
2627
2665
|
click: "onClickCapture"
|
|
2628
|
-
},
|
|
2666
|
+
}, Un = (e) => {
|
|
2629
2667
|
var t, n;
|
|
2630
2668
|
return {
|
|
2631
2669
|
escapeKey: typeof e == "boolean" ? e : (t = e?.escapeKey) != null ? t : !1,
|
|
2632
2670
|
outsidePress: typeof e == "boolean" ? e : (n = e?.outsidePress) != null ? n : !0
|
|
2633
2671
|
};
|
|
2634
2672
|
};
|
|
2635
|
-
function
|
|
2673
|
+
function Ni(e, t) {
|
|
2636
2674
|
t === void 0 && (t = {});
|
|
2637
2675
|
const {
|
|
2638
2676
|
open: n,
|
|
@@ -2642,75 +2680,75 @@ function Ki(e, t) {
|
|
|
2642
2680
|
} = e, {
|
|
2643
2681
|
enabled: i = !0,
|
|
2644
2682
|
escapeKey: c = !0,
|
|
2645
|
-
outsidePress:
|
|
2683
|
+
outsidePress: f = !0,
|
|
2646
2684
|
outsidePressEvent: l = "pointerdown",
|
|
2647
2685
|
referencePress: u = !1,
|
|
2648
|
-
referencePressEvent:
|
|
2649
|
-
ancestorScroll:
|
|
2650
|
-
bubbles:
|
|
2686
|
+
referencePressEvent: p = "pointerdown",
|
|
2687
|
+
ancestorScroll: m = !1,
|
|
2688
|
+
bubbles: a,
|
|
2651
2689
|
capture: v
|
|
2652
|
-
} = t, g =
|
|
2653
|
-
escapeKey:
|
|
2690
|
+
} = t, g = tt(), w = ie(typeof f == "function" ? f : () => !1), x = typeof f == "function" ? w : f, b = d.useRef(!1), {
|
|
2691
|
+
escapeKey: y,
|
|
2654
2692
|
outsidePress: C
|
|
2655
|
-
} =
|
|
2656
|
-
escapeKey:
|
|
2657
|
-
outsidePress:
|
|
2658
|
-
} =
|
|
2693
|
+
} = Un(a), {
|
|
2694
|
+
escapeKey: D,
|
|
2695
|
+
outsidePress: P
|
|
2696
|
+
} = Un(v), N = d.useRef(!1), S = ie((R) => {
|
|
2659
2697
|
var E;
|
|
2660
2698
|
if (!n || !i || !c || R.key !== "Escape" || N.current)
|
|
2661
2699
|
return;
|
|
2662
|
-
const
|
|
2663
|
-
if (!
|
|
2700
|
+
const V = (E = s.current.floatingContext) == null ? void 0 : E.nodeId, O = g ? Be(g.nodesRef.current, V) : [];
|
|
2701
|
+
if (!y && (R.stopPropagation(), O.length > 0)) {
|
|
2664
2702
|
let h = !0;
|
|
2665
|
-
if (
|
|
2666
|
-
var
|
|
2667
|
-
if ((
|
|
2703
|
+
if (O.forEach((I) => {
|
|
2704
|
+
var L;
|
|
2705
|
+
if ((L = I.context) != null && L.open && !I.context.dataRef.current.__escapeKeyBubbles) {
|
|
2668
2706
|
h = !1;
|
|
2669
2707
|
return;
|
|
2670
2708
|
}
|
|
2671
2709
|
}), !h)
|
|
2672
2710
|
return;
|
|
2673
2711
|
}
|
|
2674
|
-
r(!1,
|
|
2675
|
-
}),
|
|
2712
|
+
r(!1, to(R) ? R.nativeEvent : R, "escape-key");
|
|
2713
|
+
}), K = ie((R) => {
|
|
2676
2714
|
var E;
|
|
2677
|
-
const
|
|
2678
|
-
var
|
|
2679
|
-
|
|
2715
|
+
const V = () => {
|
|
2716
|
+
var O;
|
|
2717
|
+
S(R), (O = Ae(R)) == null || O.removeEventListener("keydown", V);
|
|
2680
2718
|
};
|
|
2681
|
-
(E = Ae(R)) == null || E.addEventListener("keydown",
|
|
2682
|
-
}),
|
|
2719
|
+
(E = Ae(R)) == null || E.addEventListener("keydown", V);
|
|
2720
|
+
}), k = ie((R) => {
|
|
2683
2721
|
var E;
|
|
2684
|
-
const
|
|
2722
|
+
const V = s.current.insideReactTree;
|
|
2685
2723
|
s.current.insideReactTree = !1;
|
|
2686
|
-
const
|
|
2687
|
-
if (b.current = !1, l === "click" &&
|
|
2724
|
+
const O = b.current;
|
|
2725
|
+
if (b.current = !1, l === "click" && O || V || typeof x == "function" && !x(R))
|
|
2688
2726
|
return;
|
|
2689
|
-
const h = Ae(R), I = "[" +
|
|
2727
|
+
const h = Ae(R), I = "[" + Ue("inert") + "]", L = le(o.floating).querySelectorAll(I);
|
|
2690
2728
|
let ee = Y(h) ? h : null;
|
|
2691
|
-
for (; ee && !
|
|
2729
|
+
for (; ee && !Se(ee); ) {
|
|
2692
2730
|
const j = Pe(ee);
|
|
2693
|
-
if (
|
|
2731
|
+
if (Se(j) || !Y(j))
|
|
2694
2732
|
break;
|
|
2695
2733
|
ee = j;
|
|
2696
2734
|
}
|
|
2697
|
-
if (
|
|
2735
|
+
if (L.length && Y(h) && !Qr(h) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
2698
2736
|
!ce(h, o.floating) && // If the target root element contains none of the markers, then the
|
|
2699
2737
|
// element was injected after the floating element rendered.
|
|
2700
|
-
Array.from(
|
|
2738
|
+
Array.from(L).every((j) => !ce(ee, j)))
|
|
2701
2739
|
return;
|
|
2702
|
-
if (
|
|
2703
|
-
const j =
|
|
2740
|
+
if (re(h) && W) {
|
|
2741
|
+
const j = Se(h), oe = we(h), ve = /auto|scroll/, nt = j || ve.test(oe.overflowX), Ge = j || ve.test(oe.overflowY), Te = nt && h.clientWidth > 0 && h.scrollWidth > h.clientWidth, je = Ge && h.clientHeight > 0 && h.scrollHeight > h.clientHeight, $ = oe.direction === "rtl", z = je && ($ ? R.offsetX <= h.offsetWidth - h.clientWidth : R.offsetX > h.clientWidth), B = Te && R.offsetY > h.clientHeight;
|
|
2704
2742
|
if (z || B)
|
|
2705
2743
|
return;
|
|
2706
2744
|
}
|
|
2707
|
-
const F = (E = s.current.floatingContext) == null ? void 0 : E.nodeId,
|
|
2745
|
+
const F = (E = s.current.floatingContext) == null ? void 0 : E.nodeId, T = g && Be(g.nodesRef.current, F).some((j) => {
|
|
2708
2746
|
var oe;
|
|
2709
|
-
return
|
|
2747
|
+
return Vt(R, (oe = j.context) == null ? void 0 : oe.elements.floating);
|
|
2710
2748
|
});
|
|
2711
|
-
if (
|
|
2749
|
+
if (Vt(R, o.floating) || Vt(R, o.domReference) || T)
|
|
2712
2750
|
return;
|
|
2713
|
-
const J = g ?
|
|
2751
|
+
const J = g ? Be(g.nodesRef.current, F) : [];
|
|
2714
2752
|
if (J.length > 0) {
|
|
2715
2753
|
let j = !0;
|
|
2716
2754
|
if (J.forEach((oe) => {
|
|
@@ -2725,130 +2763,131 @@ function Ki(e, t) {
|
|
|
2725
2763
|
r(!1, R, "outside-press");
|
|
2726
2764
|
}), _ = ie((R) => {
|
|
2727
2765
|
var E;
|
|
2728
|
-
const
|
|
2729
|
-
var
|
|
2730
|
-
|
|
2766
|
+
const V = () => {
|
|
2767
|
+
var O;
|
|
2768
|
+
k(R), (O = Ae(R)) == null || O.removeEventListener(l, V);
|
|
2731
2769
|
};
|
|
2732
|
-
(E = Ae(R)) == null || E.addEventListener(l,
|
|
2770
|
+
(E = Ae(R)) == null || E.addEventListener(l, V);
|
|
2733
2771
|
});
|
|
2734
2772
|
d.useEffect(() => {
|
|
2735
2773
|
if (!n || !i)
|
|
2736
2774
|
return;
|
|
2737
|
-
s.current.__escapeKeyBubbles =
|
|
2775
|
+
s.current.__escapeKeyBubbles = y, s.current.__outsidePressBubbles = C;
|
|
2738
2776
|
let R = -1;
|
|
2739
|
-
function E(
|
|
2740
|
-
r(!1,
|
|
2777
|
+
function E(L) {
|
|
2778
|
+
r(!1, L, "ancestor-scroll");
|
|
2741
2779
|
}
|
|
2742
|
-
function
|
|
2780
|
+
function V() {
|
|
2743
2781
|
window.clearTimeout(R), N.current = !0;
|
|
2744
2782
|
}
|
|
2745
|
-
function
|
|
2783
|
+
function O() {
|
|
2746
2784
|
R = window.setTimeout(
|
|
2747
2785
|
() => {
|
|
2748
2786
|
N.current = !1;
|
|
2749
2787
|
},
|
|
2750
2788
|
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
2751
2789
|
// Only apply to WebKit for the test to remain 0ms.
|
|
2752
|
-
|
|
2790
|
+
Lt() ? 5 : 0
|
|
2753
2791
|
);
|
|
2754
2792
|
}
|
|
2755
2793
|
const h = le(o.floating);
|
|
2756
|
-
c && (h.addEventListener("keydown",
|
|
2794
|
+
c && (h.addEventListener("keydown", D ? K : S, D), h.addEventListener("compositionstart", V), h.addEventListener("compositionend", O)), x && h.addEventListener(l, P ? _ : k, P);
|
|
2757
2795
|
let I = [];
|
|
2758
|
-
return
|
|
2796
|
+
return m && (Y(o.domReference) && (I = ke(o.domReference)), Y(o.floating) && (I = I.concat(ke(o.floating))), !Y(o.reference) && o.reference && o.reference.contextElement && (I = I.concat(ke(o.reference.contextElement)))), I = I.filter((L) => {
|
|
2759
2797
|
var ee;
|
|
2760
|
-
return
|
|
2761
|
-
}), I.forEach((
|
|
2762
|
-
|
|
2798
|
+
return L !== ((ee = h.defaultView) == null ? void 0 : ee.visualViewport);
|
|
2799
|
+
}), I.forEach((L) => {
|
|
2800
|
+
L.addEventListener("scroll", E, {
|
|
2763
2801
|
passive: !0
|
|
2764
2802
|
});
|
|
2765
2803
|
}), () => {
|
|
2766
|
-
c && (h.removeEventListener("keydown",
|
|
2767
|
-
|
|
2804
|
+
c && (h.removeEventListener("keydown", D ? K : S, D), h.removeEventListener("compositionstart", V), h.removeEventListener("compositionend", O)), x && h.removeEventListener(l, P ? _ : k, P), I.forEach((L) => {
|
|
2805
|
+
L.removeEventListener("scroll", E);
|
|
2768
2806
|
}), window.clearTimeout(R);
|
|
2769
2807
|
};
|
|
2770
|
-
}, [s, o, c, x, l, n, r,
|
|
2808
|
+
}, [s, o, c, x, l, n, r, m, i, y, C, S, D, K, k, P, _]), d.useEffect(() => {
|
|
2771
2809
|
s.current.insideReactTree = !1;
|
|
2772
2810
|
}, [s, x, l]);
|
|
2773
2811
|
const G = d.useMemo(() => ({
|
|
2774
|
-
onKeyDown:
|
|
2812
|
+
onKeyDown: S,
|
|
2775
2813
|
...u && {
|
|
2776
|
-
[
|
|
2814
|
+
[fi[p]]: (R) => {
|
|
2777
2815
|
r(!1, R.nativeEvent, "reference-press");
|
|
2778
2816
|
},
|
|
2779
|
-
...
|
|
2817
|
+
...p !== "click" && {
|
|
2780
2818
|
onClick(R) {
|
|
2781
2819
|
r(!1, R.nativeEvent, "reference-press");
|
|
2782
2820
|
}
|
|
2783
2821
|
}
|
|
2784
2822
|
}
|
|
2785
|
-
}), [
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
b.current = !0;
|
|
2789
|
-
},
|
|
2790
|
-
onMouseUp() {
|
|
2791
|
-
b.current = !0;
|
|
2792
|
-
},
|
|
2793
|
-
[hi[l]]: () => {
|
|
2794
|
-
s.current.insideReactTree = !0;
|
|
2823
|
+
}), [S, r, u, p]), W = d.useMemo(() => {
|
|
2824
|
+
function R(E) {
|
|
2825
|
+
E.button === 0 && (b.current = !0);
|
|
2795
2826
|
}
|
|
2796
|
-
|
|
2827
|
+
return {
|
|
2828
|
+
onKeyDown: S,
|
|
2829
|
+
onMouseDown: R,
|
|
2830
|
+
onMouseUp: R,
|
|
2831
|
+
[di[l]]: () => {
|
|
2832
|
+
s.current.insideReactTree = !0;
|
|
2833
|
+
}
|
|
2834
|
+
};
|
|
2835
|
+
}, [S, l, s]);
|
|
2797
2836
|
return d.useMemo(() => i ? {
|
|
2798
2837
|
reference: G,
|
|
2799
2838
|
floating: W
|
|
2800
2839
|
} : {}, [i, G, W]);
|
|
2801
2840
|
}
|
|
2802
|
-
function
|
|
2841
|
+
function mi(e) {
|
|
2803
2842
|
const {
|
|
2804
2843
|
open: t = !1,
|
|
2805
2844
|
onOpenChange: n,
|
|
2806
2845
|
elements: r
|
|
2807
|
-
} = e, o =
|
|
2846
|
+
} = e, o = Nt(), s = d.useRef({}), [i] = d.useState(() => Or()), c = et() != null;
|
|
2808
2847
|
if (process.env.NODE_ENV !== "production") {
|
|
2809
|
-
const
|
|
2810
|
-
|
|
2848
|
+
const a = r.reference;
|
|
2849
|
+
a && !Y(a) && Zo("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
2811
2850
|
}
|
|
2812
|
-
const [
|
|
2813
|
-
s.current.openEvent =
|
|
2814
|
-
open:
|
|
2851
|
+
const [f, l] = d.useState(r.reference), u = ie((a, v, g) => {
|
|
2852
|
+
s.current.openEvent = a ? v : void 0, i.emit("openchange", {
|
|
2853
|
+
open: a,
|
|
2815
2854
|
event: v,
|
|
2816
2855
|
reason: g,
|
|
2817
2856
|
nested: c
|
|
2818
|
-
}), n?.(
|
|
2819
|
-
}),
|
|
2857
|
+
}), n?.(a, v, g);
|
|
2858
|
+
}), p = d.useMemo(() => ({
|
|
2820
2859
|
setPositionReference: l
|
|
2821
|
-
}), []),
|
|
2822
|
-
reference:
|
|
2860
|
+
}), []), m = d.useMemo(() => ({
|
|
2861
|
+
reference: f || r.reference || null,
|
|
2823
2862
|
floating: r.floating || null,
|
|
2824
2863
|
domReference: r.reference
|
|
2825
|
-
}), [
|
|
2864
|
+
}), [f, r.reference, r.floating]);
|
|
2826
2865
|
return d.useMemo(() => ({
|
|
2827
2866
|
dataRef: s,
|
|
2828
2867
|
open: t,
|
|
2829
2868
|
onOpenChange: u,
|
|
2830
|
-
elements:
|
|
2869
|
+
elements: m,
|
|
2831
2870
|
events: i,
|
|
2832
2871
|
floatingId: o,
|
|
2833
|
-
refs:
|
|
2834
|
-
}), [t, u,
|
|
2872
|
+
refs: p
|
|
2873
|
+
}), [t, u, m, i, o, p]);
|
|
2835
2874
|
}
|
|
2836
|
-
function
|
|
2875
|
+
function _i(e) {
|
|
2837
2876
|
e === void 0 && (e = {});
|
|
2838
2877
|
const {
|
|
2839
2878
|
nodeId: t
|
|
2840
|
-
} = e, n =
|
|
2879
|
+
} = e, n = mi({
|
|
2841
2880
|
...e,
|
|
2842
2881
|
elements: {
|
|
2843
2882
|
reference: null,
|
|
2844
2883
|
floating: null,
|
|
2845
2884
|
...e.elements
|
|
2846
2885
|
}
|
|
2847
|
-
}), r = e.rootContext || n, o = r.elements, [s, i] = d.useState(null), [c,
|
|
2886
|
+
}), r = e.rootContext || n, o = r.elements, [s, i] = d.useState(null), [c, f] = d.useState(null), u = o?.domReference || s, p = d.useRef(null), m = tt();
|
|
2848
2887
|
X(() => {
|
|
2849
|
-
u && (
|
|
2888
|
+
u && (p.current = u);
|
|
2850
2889
|
}, [u]);
|
|
2851
|
-
const
|
|
2890
|
+
const a = Ho({
|
|
2852
2891
|
...e,
|
|
2853
2892
|
elements: {
|
|
2854
2893
|
...o,
|
|
@@ -2856,48 +2895,48 @@ function $i(e) {
|
|
|
2856
2895
|
reference: c
|
|
2857
2896
|
}
|
|
2858
2897
|
}
|
|
2859
|
-
}), v = d.useCallback((
|
|
2860
|
-
const C = Y(
|
|
2861
|
-
getBoundingClientRect: () =>
|
|
2862
|
-
getClientRects: () =>
|
|
2863
|
-
contextElement:
|
|
2864
|
-
} :
|
|
2865
|
-
|
|
2866
|
-
}, [
|
|
2867
|
-
(Y(
|
|
2898
|
+
}), v = d.useCallback((y) => {
|
|
2899
|
+
const C = Y(y) ? {
|
|
2900
|
+
getBoundingClientRect: () => y.getBoundingClientRect(),
|
|
2901
|
+
getClientRects: () => y.getClientRects(),
|
|
2902
|
+
contextElement: y
|
|
2903
|
+
} : y;
|
|
2904
|
+
f(C), a.refs.setReference(C);
|
|
2905
|
+
}, [a.refs]), g = d.useCallback((y) => {
|
|
2906
|
+
(Y(y) || y === null) && (p.current = y, i(y)), (Y(a.refs.reference.current) || a.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
2868
2907
|
// `null` to support `positionReference` + an unstable `reference`
|
|
2869
2908
|
// callback ref.
|
|
2870
|
-
|
|
2871
|
-
}, [
|
|
2872
|
-
...
|
|
2909
|
+
y !== null && !Y(y)) && a.refs.setReference(y);
|
|
2910
|
+
}, [a.refs]), w = d.useMemo(() => ({
|
|
2911
|
+
...a.refs,
|
|
2873
2912
|
setReference: g,
|
|
2874
2913
|
setPositionReference: v,
|
|
2875
|
-
domReference:
|
|
2876
|
-
}), [
|
|
2877
|
-
...
|
|
2914
|
+
domReference: p
|
|
2915
|
+
}), [a.refs, g, v]), x = d.useMemo(() => ({
|
|
2916
|
+
...a.elements,
|
|
2878
2917
|
domReference: u
|
|
2879
|
-
}), [
|
|
2880
|
-
...
|
|
2918
|
+
}), [a.elements, u]), b = d.useMemo(() => ({
|
|
2919
|
+
...a,
|
|
2881
2920
|
...r,
|
|
2882
|
-
refs:
|
|
2921
|
+
refs: w,
|
|
2883
2922
|
elements: x,
|
|
2884
2923
|
nodeId: t
|
|
2885
|
-
}), [
|
|
2924
|
+
}), [a, w, x, t, r]);
|
|
2886
2925
|
return X(() => {
|
|
2887
2926
|
r.dataRef.current.floatingContext = b;
|
|
2888
|
-
const
|
|
2889
|
-
|
|
2927
|
+
const y = m?.nodesRef.current.find((C) => C.id === t);
|
|
2928
|
+
y && (y.context = b);
|
|
2890
2929
|
}), d.useMemo(() => ({
|
|
2891
|
-
...
|
|
2930
|
+
...a,
|
|
2892
2931
|
context: b,
|
|
2893
|
-
refs:
|
|
2932
|
+
refs: w,
|
|
2894
2933
|
elements: x
|
|
2895
|
-
}), [
|
|
2934
|
+
}), [a, w, x, b]);
|
|
2896
2935
|
}
|
|
2897
|
-
function
|
|
2898
|
-
return
|
|
2936
|
+
function Xt() {
|
|
2937
|
+
return qr() && rr();
|
|
2899
2938
|
}
|
|
2900
|
-
function
|
|
2939
|
+
function Wi(e, t) {
|
|
2901
2940
|
t === void 0 && (t = {});
|
|
2902
2941
|
const {
|
|
2903
2942
|
open: n,
|
|
@@ -2907,97 +2946,97 @@ function Bi(e, t) {
|
|
|
2907
2946
|
elements: i
|
|
2908
2947
|
} = e, {
|
|
2909
2948
|
enabled: c = !0,
|
|
2910
|
-
visibleOnly:
|
|
2911
|
-
} = t, l = d.useRef(!1), u = d.useRef(-1),
|
|
2949
|
+
visibleOnly: f = !0
|
|
2950
|
+
} = t, l = d.useRef(!1), u = d.useRef(-1), p = d.useRef(!0);
|
|
2912
2951
|
d.useEffect(() => {
|
|
2913
2952
|
if (!c) return;
|
|
2914
|
-
const
|
|
2953
|
+
const a = pe(i.domReference);
|
|
2915
2954
|
function v() {
|
|
2916
|
-
!n &&
|
|
2955
|
+
!n && re(i.domReference) && i.domReference === Re(le(i.domReference)) && (l.current = !0);
|
|
2917
2956
|
}
|
|
2918
2957
|
function g() {
|
|
2919
|
-
|
|
2958
|
+
p.current = !0;
|
|
2920
2959
|
}
|
|
2921
|
-
function
|
|
2922
|
-
|
|
2960
|
+
function w() {
|
|
2961
|
+
p.current = !1;
|
|
2923
2962
|
}
|
|
2924
|
-
return
|
|
2925
|
-
|
|
2963
|
+
return a.addEventListener("blur", v), Xt() && (a.addEventListener("keydown", g, !0), a.addEventListener("pointerdown", w, !0)), () => {
|
|
2964
|
+
a.removeEventListener("blur", v), Xt() && (a.removeEventListener("keydown", g, !0), a.removeEventListener("pointerdown", w, !0));
|
|
2926
2965
|
};
|
|
2927
2966
|
}, [i.domReference, n, c]), d.useEffect(() => {
|
|
2928
2967
|
if (!c) return;
|
|
2929
|
-
function
|
|
2968
|
+
function a(v) {
|
|
2930
2969
|
let {
|
|
2931
2970
|
reason: g
|
|
2932
2971
|
} = v;
|
|
2933
2972
|
(g === "reference-press" || g === "escape-key") && (l.current = !0);
|
|
2934
2973
|
}
|
|
2935
|
-
return o.on("openchange",
|
|
2936
|
-
o.off("openchange",
|
|
2974
|
+
return o.on("openchange", a), () => {
|
|
2975
|
+
o.off("openchange", a);
|
|
2937
2976
|
};
|
|
2938
2977
|
}, [o, c]), d.useEffect(() => () => {
|
|
2939
2978
|
ge(u);
|
|
2940
2979
|
}, []);
|
|
2941
|
-
const
|
|
2980
|
+
const m = d.useMemo(() => ({
|
|
2942
2981
|
onMouseLeave() {
|
|
2943
2982
|
l.current = !1;
|
|
2944
2983
|
},
|
|
2945
|
-
onFocus(
|
|
2984
|
+
onFocus(a) {
|
|
2946
2985
|
if (l.current) return;
|
|
2947
|
-
const v = Ae(
|
|
2948
|
-
if (
|
|
2949
|
-
if (
|
|
2950
|
-
if (!
|
|
2986
|
+
const v = Ae(a.nativeEvent);
|
|
2987
|
+
if (f && Y(v)) {
|
|
2988
|
+
if (Xt() && !a.relatedTarget) {
|
|
2989
|
+
if (!p.current && !cn(v))
|
|
2951
2990
|
return;
|
|
2952
|
-
} else if (!
|
|
2991
|
+
} else if (!Zr(v))
|
|
2953
2992
|
return;
|
|
2954
2993
|
}
|
|
2955
|
-
r(!0,
|
|
2994
|
+
r(!0, a.nativeEvent, "focus");
|
|
2956
2995
|
},
|
|
2957
|
-
onBlur(
|
|
2996
|
+
onBlur(a) {
|
|
2958
2997
|
l.current = !1;
|
|
2959
|
-
const v =
|
|
2998
|
+
const v = a.relatedTarget, g = a.nativeEvent, w = Y(v) && v.hasAttribute(Ue("focus-guard")) && v.getAttribute("data-type") === "outside";
|
|
2960
2999
|
u.current = window.setTimeout(() => {
|
|
2961
3000
|
var x;
|
|
2962
3001
|
const b = Re(i.domReference ? i.domReference.ownerDocument : document);
|
|
2963
|
-
!v && b === i.domReference || ce((x = s.current.floatingContext) == null ? void 0 : x.refs.floating.current, b) || ce(i.domReference, b) ||
|
|
3002
|
+
!v && b === i.domReference || ce((x = s.current.floatingContext) == null ? void 0 : x.refs.floating.current, b) || ce(i.domReference, b) || w || r(!1, g, "focus");
|
|
2964
3003
|
});
|
|
2965
3004
|
}
|
|
2966
|
-
}), [s, i.domReference, r,
|
|
3005
|
+
}), [s, i.domReference, r, f]);
|
|
2967
3006
|
return d.useMemo(() => c ? {
|
|
2968
|
-
reference:
|
|
2969
|
-
} : {}, [c,
|
|
3007
|
+
reference: m
|
|
3008
|
+
} : {}, [c, m]);
|
|
2970
3009
|
}
|
|
2971
|
-
function
|
|
3010
|
+
function Yt(e, t, n) {
|
|
2972
3011
|
const r = /* @__PURE__ */ new Map(), o = n === "item";
|
|
2973
3012
|
let s = e;
|
|
2974
3013
|
if (o && e) {
|
|
2975
3014
|
const {
|
|
2976
|
-
[
|
|
2977
|
-
[
|
|
2978
|
-
...
|
|
3015
|
+
[An]: i,
|
|
3016
|
+
[Mn]: c,
|
|
3017
|
+
...f
|
|
2979
3018
|
} = e;
|
|
2980
|
-
s =
|
|
3019
|
+
s = f;
|
|
2981
3020
|
}
|
|
2982
3021
|
return {
|
|
2983
3022
|
...n === "floating" && {
|
|
2984
3023
|
tabIndex: -1,
|
|
2985
|
-
[
|
|
3024
|
+
[qo]: ""
|
|
2986
3025
|
},
|
|
2987
3026
|
...s,
|
|
2988
3027
|
...t.map((i) => {
|
|
2989
3028
|
const c = i ? i[n] : null;
|
|
2990
3029
|
return typeof c == "function" ? e ? c(e) : null : c;
|
|
2991
|
-
}).concat(e).reduce((i, c) => (c && Object.entries(c).forEach((
|
|
2992
|
-
let [l, u] =
|
|
2993
|
-
if (!(o && [
|
|
3030
|
+
}).concat(e).reduce((i, c) => (c && Object.entries(c).forEach((f) => {
|
|
3031
|
+
let [l, u] = f;
|
|
3032
|
+
if (!(o && [An, Mn].includes(l)))
|
|
2994
3033
|
if (l.indexOf("on") === 0) {
|
|
2995
3034
|
if (r.has(l) || r.set(l, []), typeof u == "function") {
|
|
2996
|
-
var
|
|
2997
|
-
(
|
|
2998
|
-
for (var
|
|
3035
|
+
var p;
|
|
3036
|
+
(p = r.get(l)) == null || p.push(u), i[l] = function() {
|
|
3037
|
+
for (var m, a = arguments.length, v = new Array(a), g = 0; g < a; g++)
|
|
2999
3038
|
v[g] = arguments[g];
|
|
3000
|
-
return (
|
|
3039
|
+
return (m = r.get(l)) == null ? void 0 : m.map((w) => w(...v)).find((w) => w !== void 0);
|
|
3001
3040
|
};
|
|
3002
3041
|
}
|
|
3003
3042
|
} else
|
|
@@ -3005,18 +3044,18 @@ function Xt(e, t, n) {
|
|
|
3005
3044
|
}), i), {})
|
|
3006
3045
|
};
|
|
3007
3046
|
}
|
|
3008
|
-
function
|
|
3047
|
+
function Ki(e) {
|
|
3009
3048
|
e === void 0 && (e = []);
|
|
3010
3049
|
const t = e.map((c) => c?.reference), n = e.map((c) => c?.floating), r = e.map((c) => c?.item), o = d.useCallback(
|
|
3011
|
-
(c) =>
|
|
3050
|
+
(c) => Yt(c, e, "reference"),
|
|
3012
3051
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3013
3052
|
t
|
|
3014
3053
|
), s = d.useCallback(
|
|
3015
|
-
(c) =>
|
|
3054
|
+
(c) => Yt(c, e, "floating"),
|
|
3016
3055
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3017
3056
|
n
|
|
3018
3057
|
), i = d.useCallback(
|
|
3019
|
-
(c) =>
|
|
3058
|
+
(c) => Yt(c, e, "item"),
|
|
3020
3059
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3021
3060
|
r
|
|
3022
3061
|
);
|
|
@@ -3026,7 +3065,7 @@ function Hi(e) {
|
|
|
3026
3065
|
getItemProps: i
|
|
3027
3066
|
}), [o, s, i]);
|
|
3028
3067
|
}
|
|
3029
|
-
const
|
|
3068
|
+
const pi = "Escape";
|
|
3030
3069
|
function _t(e, t, n) {
|
|
3031
3070
|
switch (e) {
|
|
3032
3071
|
case "vertical":
|
|
@@ -3037,20 +3076,20 @@ function _t(e, t, n) {
|
|
|
3037
3076
|
return t || n;
|
|
3038
3077
|
}
|
|
3039
3078
|
}
|
|
3040
|
-
function
|
|
3041
|
-
return _t(t, e ===
|
|
3079
|
+
function yt(e, t) {
|
|
3080
|
+
return _t(t, e === ct || e === Fe, e === Ne || e === _e);
|
|
3042
3081
|
}
|
|
3043
|
-
function
|
|
3082
|
+
function Jt(e, t, n) {
|
|
3044
3083
|
return _t(t, e === Fe, n ? e === Ne : e === _e) || e === "Enter" || e === " " || e === "";
|
|
3045
3084
|
}
|
|
3046
|
-
function
|
|
3085
|
+
function Gn(e, t, n) {
|
|
3047
3086
|
return _t(t, n ? e === Ne : e === _e, e === Fe);
|
|
3048
3087
|
}
|
|
3049
|
-
function
|
|
3050
|
-
const o = n ? e === _e : e === Ne, s = e ===
|
|
3051
|
-
return t === "both" || t === "horizontal" && r && r > 1 ? e ===
|
|
3088
|
+
function jn(e, t, n, r) {
|
|
3089
|
+
const o = n ? e === _e : e === Ne, s = e === ct;
|
|
3090
|
+
return t === "both" || t === "horizontal" && r && r > 1 ? e === pi : _t(t, o, s);
|
|
3052
3091
|
}
|
|
3053
|
-
function
|
|
3092
|
+
function $i(e, t) {
|
|
3054
3093
|
const {
|
|
3055
3094
|
open: n,
|
|
3056
3095
|
onOpenChange: r,
|
|
@@ -3059,95 +3098,95 @@ function zi(e, t) {
|
|
|
3059
3098
|
} = e, {
|
|
3060
3099
|
listRef: i,
|
|
3061
3100
|
activeIndex: c,
|
|
3062
|
-
onNavigate:
|
|
3101
|
+
onNavigate: f = () => {
|
|
3063
3102
|
},
|
|
3064
3103
|
enabled: l = !0,
|
|
3065
3104
|
selectedIndex: u = null,
|
|
3066
|
-
allowEscape:
|
|
3067
|
-
loop:
|
|
3068
|
-
nested:
|
|
3105
|
+
allowEscape: p = !1,
|
|
3106
|
+
loop: m = !1,
|
|
3107
|
+
nested: a = !1,
|
|
3069
3108
|
rtl: v = !1,
|
|
3070
3109
|
virtual: g = !1,
|
|
3071
|
-
focusItemOnOpen:
|
|
3110
|
+
focusItemOnOpen: w = "auto",
|
|
3072
3111
|
focusItemOnHover: x = !0,
|
|
3073
3112
|
openOnArrowKeyDown: b = !0,
|
|
3074
|
-
disabledIndices:
|
|
3113
|
+
disabledIndices: y = void 0,
|
|
3075
3114
|
orientation: C = "vertical",
|
|
3076
|
-
parentOrientation:
|
|
3077
|
-
cols:
|
|
3115
|
+
parentOrientation: D,
|
|
3116
|
+
cols: P = 1,
|
|
3078
3117
|
scrollItemIntoView: N = !0,
|
|
3079
|
-
virtualItemRef:
|
|
3080
|
-
itemSizes:
|
|
3081
|
-
dense:
|
|
3118
|
+
virtualItemRef: S,
|
|
3119
|
+
itemSizes: K,
|
|
3120
|
+
dense: k = !1
|
|
3082
3121
|
} = t;
|
|
3083
|
-
process.env.NODE_ENV !== "production" && (
|
|
3084
|
-
const _ =
|
|
3122
|
+
process.env.NODE_ENV !== "production" && (p && (m || Ut("`useListNavigation` looping must be enabled to allow escaping."), g || Ut("`useListNavigation` must be virtual to allow escaping.")), C === "vertical" && P > 1 && Ut("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".'));
|
|
3123
|
+
const _ = Tt(o.floating), G = ye(_), W = et(), R = tt();
|
|
3085
3124
|
X(() => {
|
|
3086
3125
|
e.dataRef.current.orientation = C;
|
|
3087
3126
|
}, [e, C]);
|
|
3088
3127
|
const E = ie(() => {
|
|
3089
|
-
|
|
3090
|
-
}),
|
|
3091
|
-
function
|
|
3128
|
+
f(h.current === -1 ? null : h.current);
|
|
3129
|
+
}), V = en(o.domReference), O = d.useRef(w), h = d.useRef(u ?? -1), I = d.useRef(null), L = d.useRef(!0), ee = d.useRef(E), F = d.useRef(!!o.floating), T = d.useRef(n), J = d.useRef(!1), j = d.useRef(!1), oe = ye(y), ve = ye(n), nt = ye(N), Ge = ye(u), [Te, je] = d.useState(), [$, z] = d.useState(), B = ie(() => {
|
|
3130
|
+
function M(Z) {
|
|
3092
3131
|
if (g) {
|
|
3093
|
-
var
|
|
3094
|
-
(
|
|
3132
|
+
var ne;
|
|
3133
|
+
(ne = Z.id) != null && ne.endsWith("-fui-option") && (Z.id = s + "-" + Math.random().toString(16).slice(2, 10)), je(Z.id), R?.events.emit("virtualfocus", Z), S && (S.current = Z);
|
|
3095
3134
|
} else
|
|
3096
|
-
|
|
3135
|
+
Ve(Z, {
|
|
3097
3136
|
sync: J.current,
|
|
3098
3137
|
preventScroll: !0
|
|
3099
3138
|
});
|
|
3100
3139
|
}
|
|
3101
3140
|
const H = i.current[h.current], A = j.current;
|
|
3102
|
-
H &&
|
|
3141
|
+
H && M(H), (J.current ? (Z) => Z() : requestAnimationFrame)(() => {
|
|
3103
3142
|
const Z = i.current[h.current] || H;
|
|
3104
3143
|
if (!Z) return;
|
|
3105
|
-
H ||
|
|
3106
|
-
const
|
|
3107
|
-
|
|
3144
|
+
H || M(Z);
|
|
3145
|
+
const ne = nt.current;
|
|
3146
|
+
ne && te && (A || !L.current) && (Z.scrollIntoView == null || Z.scrollIntoView(typeof ne == "boolean" ? {
|
|
3108
3147
|
block: "nearest",
|
|
3109
3148
|
inline: "nearest"
|
|
3110
|
-
} :
|
|
3149
|
+
} : ne));
|
|
3111
3150
|
});
|
|
3112
3151
|
});
|
|
3113
3152
|
X(() => {
|
|
3114
|
-
l && (n && o.floating ?
|
|
3153
|
+
l && (n && o.floating ? O.current && u != null && (j.current = !0, h.current = u, E()) : F.current && (h.current = -1, ee.current()));
|
|
3115
3154
|
}, [l, n, o.floating, u, E]), X(() => {
|
|
3116
3155
|
if (l && n && o.floating)
|
|
3117
3156
|
if (c == null) {
|
|
3118
|
-
if (J.current = !1,
|
|
3157
|
+
if (J.current = !1, Ge.current != null)
|
|
3119
3158
|
return;
|
|
3120
|
-
if (F.current && (h.current = -1, B()), (!
|
|
3121
|
-
let
|
|
3159
|
+
if (F.current && (h.current = -1, B()), (!T.current || !F.current) && O.current && (I.current != null || O.current === !0 && I.current == null)) {
|
|
3160
|
+
let M = 0;
|
|
3122
3161
|
const H = () => {
|
|
3123
|
-
i.current[0] == null ? (
|
|
3162
|
+
i.current[0] == null ? (M < 2 && (M ? requestAnimationFrame : queueMicrotask)(H), M++) : (h.current = I.current == null || Jt(I.current, C, v) || a ? wt(i, oe.current) : tn(i, oe.current), I.current = null, E());
|
|
3124
3163
|
};
|
|
3125
3164
|
H();
|
|
3126
3165
|
}
|
|
3127
|
-
} else
|
|
3128
|
-
}, [l, n, o.floating, c,
|
|
3129
|
-
var
|
|
3166
|
+
} else Xe(i, c) || (h.current = c, B(), j.current = !1);
|
|
3167
|
+
}, [l, n, o.floating, c, Ge, a, i, C, v, E, B, oe]), X(() => {
|
|
3168
|
+
var M;
|
|
3130
3169
|
if (!l || o.floating || !R || g || !F.current)
|
|
3131
3170
|
return;
|
|
3132
|
-
const H = R.nodesRef.current, A = (
|
|
3133
|
-
A && !Z &&
|
|
3171
|
+
const H = R.nodesRef.current, A = (M = H.find((ne) => ne.id === W)) == null || (M = M.context) == null ? void 0 : M.elements.floating, q = Re(le(o.floating)), Z = H.some((ne) => ne.context && ce(ne.context.elements.floating, q));
|
|
3172
|
+
A && !Z && L.current && A.focus({
|
|
3134
3173
|
preventScroll: !0
|
|
3135
3174
|
});
|
|
3136
3175
|
}, [l, o.floating, R, W, g]), X(() => {
|
|
3137
3176
|
if (!l || !R || !g || W) return;
|
|
3138
|
-
function
|
|
3139
|
-
z(H.id),
|
|
3177
|
+
function M(H) {
|
|
3178
|
+
z(H.id), S && (S.current = H);
|
|
3140
3179
|
}
|
|
3141
|
-
return R.events.on("virtualfocus",
|
|
3142
|
-
R.events.off("virtualfocus",
|
|
3180
|
+
return R.events.on("virtualfocus", M), () => {
|
|
3181
|
+
R.events.off("virtualfocus", M);
|
|
3143
3182
|
};
|
|
3144
|
-
}, [l, R, g, W,
|
|
3145
|
-
ee.current = E,
|
|
3183
|
+
}, [l, R, g, W, S]), X(() => {
|
|
3184
|
+
ee.current = E, T.current = n, F.current = !!o.floating;
|
|
3146
3185
|
}), X(() => {
|
|
3147
|
-
n || (I.current = null,
|
|
3148
|
-
}, [n,
|
|
3186
|
+
n || (I.current = null, O.current = w);
|
|
3187
|
+
}, [n, w]);
|
|
3149
3188
|
const Q = c != null, te = d.useMemo(() => {
|
|
3150
|
-
function
|
|
3189
|
+
function M(A) {
|
|
3151
3190
|
if (!ve.current) return;
|
|
3152
3191
|
const q = i.current.indexOf(A);
|
|
3153
3192
|
q !== -1 && h.current !== q && (h.current = q, E());
|
|
@@ -3157,7 +3196,7 @@ function zi(e, t) {
|
|
|
3157
3196
|
let {
|
|
3158
3197
|
currentTarget: q
|
|
3159
3198
|
} = A;
|
|
3160
|
-
J.current = !0,
|
|
3199
|
+
J.current = !0, M(q);
|
|
3161
3200
|
},
|
|
3162
3201
|
onClick: (A) => {
|
|
3163
3202
|
let {
|
|
@@ -3172,13 +3211,13 @@ function zi(e, t) {
|
|
|
3172
3211
|
let {
|
|
3173
3212
|
currentTarget: q
|
|
3174
3213
|
} = A;
|
|
3175
|
-
J.current = !0, j.current = !1, x &&
|
|
3214
|
+
J.current = !0, j.current = !1, x && M(q);
|
|
3176
3215
|
},
|
|
3177
3216
|
onPointerLeave(A) {
|
|
3178
3217
|
let {
|
|
3179
3218
|
pointerType: q
|
|
3180
3219
|
} = A;
|
|
3181
|
-
if (!(!
|
|
3220
|
+
if (!(!L.current || q === "touch") && (J.current = !0, !!x && (h.current = -1, E(), !g))) {
|
|
3182
3221
|
var Z;
|
|
3183
3222
|
(Z = G.current) == null || Z.focus({
|
|
3184
3223
|
preventScroll: !0
|
|
@@ -3187,119 +3226,119 @@ function zi(e, t) {
|
|
|
3187
3226
|
}
|
|
3188
3227
|
};
|
|
3189
3228
|
}, [ve, G, x, i, E, g]), U = d.useCallback(() => {
|
|
3190
|
-
var
|
|
3191
|
-
return
|
|
3192
|
-
}, [W, R,
|
|
3193
|
-
if (
|
|
3229
|
+
var M;
|
|
3230
|
+
return D ?? (R == null || (M = R.nodesRef.current.find((H) => H.id === W)) == null || (M = M.context) == null || (M = M.dataRef) == null ? void 0 : M.current.orientation);
|
|
3231
|
+
}, [W, R, D]), fe = ie((M) => {
|
|
3232
|
+
if (L.current = !1, J.current = !0, M.which === 229 || !ve.current && M.currentTarget === G.current)
|
|
3194
3233
|
return;
|
|
3195
|
-
if (
|
|
3196
|
-
|
|
3234
|
+
if (a && jn(M.key, C, v, P)) {
|
|
3235
|
+
yt(M.key, U()) || de(M), r(!1, M.nativeEvent, "list-navigation"), re(o.domReference) && (g ? R?.events.emit("virtualfocus", o.domReference) : o.domReference.focus());
|
|
3197
3236
|
return;
|
|
3198
3237
|
}
|
|
3199
|
-
const H = h.current, A =
|
|
3200
|
-
if (
|
|
3201
|
-
const Z =
|
|
3238
|
+
const H = h.current, A = wt(i, y), q = tn(i, y);
|
|
3239
|
+
if (V || (M.key === "Home" && (de(M), h.current = A, E()), M.key === "End" && (de(M), h.current = q, E())), P > 1) {
|
|
3240
|
+
const Z = K || Array.from({
|
|
3202
3241
|
length: i.current.length
|
|
3203
3242
|
}, () => ({
|
|
3204
3243
|
width: 1,
|
|
3205
3244
|
height: 1
|
|
3206
|
-
})),
|
|
3207
|
-
current:
|
|
3245
|
+
})), ne = ur(Z, P, k), rt = ne.findIndex((be) => be != null && !He(i, be, y)), ft = ne.reduce((be, Ke, dt) => Ke != null && !He(i, Ke, y) ? dt : be, -1), ot = ne[cr({
|
|
3246
|
+
current: ne.map((be) => be != null ? i.current[be] : null)
|
|
3208
3247
|
}, {
|
|
3209
|
-
event:
|
|
3248
|
+
event: M,
|
|
3210
3249
|
orientation: C,
|
|
3211
|
-
loop:
|
|
3250
|
+
loop: m,
|
|
3212
3251
|
rtl: v,
|
|
3213
|
-
cols:
|
|
3252
|
+
cols: P,
|
|
3214
3253
|
// treat undefined (empty grid spaces) as disabled indices so we
|
|
3215
3254
|
// don't end up in them
|
|
3216
|
-
disabledIndices:
|
|
3217
|
-
minIndex:
|
|
3218
|
-
maxIndex:
|
|
3219
|
-
prevIndex:
|
|
3255
|
+
disabledIndices: ar([...(typeof y != "function" ? y : null) || i.current.map((be, Ke) => He(i, Ke, y) ? Ke : void 0), void 0], ne),
|
|
3256
|
+
minIndex: rt,
|
|
3257
|
+
maxIndex: ft,
|
|
3258
|
+
prevIndex: lr(
|
|
3220
3259
|
h.current > q ? A : h.current,
|
|
3221
3260
|
Z,
|
|
3222
|
-
|
|
3223
|
-
|
|
3261
|
+
ne,
|
|
3262
|
+
P,
|
|
3224
3263
|
// use a corner matching the edge closest to the direction
|
|
3225
3264
|
// we're moving in so we don't end up in the same item. Prefer
|
|
3226
3265
|
// top/left over bottom/right.
|
|
3227
|
-
|
|
3266
|
+
M.key === Fe ? "bl" : M.key === (v ? Ne : _e) ? "tr" : "tl"
|
|
3228
3267
|
),
|
|
3229
3268
|
stopEvent: !0
|
|
3230
3269
|
})];
|
|
3231
|
-
if (
|
|
3270
|
+
if (ot != null && (h.current = ot, E()), C === "both")
|
|
3232
3271
|
return;
|
|
3233
3272
|
}
|
|
3234
|
-
if (
|
|
3235
|
-
if (de(
|
|
3236
|
-
h.current =
|
|
3273
|
+
if (yt(M.key, C)) {
|
|
3274
|
+
if (de(M), n && !g && Re(M.currentTarget.ownerDocument) === M.currentTarget) {
|
|
3275
|
+
h.current = Jt(M.key, C, v) ? A : q, E();
|
|
3237
3276
|
return;
|
|
3238
3277
|
}
|
|
3239
|
-
|
|
3278
|
+
Jt(M.key, C, v) ? m ? h.current = H >= q ? p && H !== i.current.length ? -1 : A : ue(i, {
|
|
3240
3279
|
startingIndex: H,
|
|
3241
|
-
disabledIndices:
|
|
3280
|
+
disabledIndices: y
|
|
3242
3281
|
}) : h.current = Math.min(q, ue(i, {
|
|
3243
3282
|
startingIndex: H,
|
|
3244
|
-
disabledIndices:
|
|
3245
|
-
})) :
|
|
3283
|
+
disabledIndices: y
|
|
3284
|
+
})) : m ? h.current = H <= A ? p && H !== -1 ? i.current.length : q : ue(i, {
|
|
3246
3285
|
startingIndex: H,
|
|
3247
3286
|
decrement: !0,
|
|
3248
|
-
disabledIndices:
|
|
3287
|
+
disabledIndices: y
|
|
3249
3288
|
}) : h.current = Math.max(A, ue(i, {
|
|
3250
3289
|
startingIndex: H,
|
|
3251
3290
|
decrement: !0,
|
|
3252
|
-
disabledIndices:
|
|
3253
|
-
})),
|
|
3291
|
+
disabledIndices: y
|
|
3292
|
+
})), Xe(i, h.current) && (h.current = -1), E();
|
|
3254
3293
|
}
|
|
3255
3294
|
}), se = d.useMemo(() => g && n && Q && {
|
|
3256
|
-
"aria-activedescendant":
|
|
3257
|
-
}, [g, n, Q,
|
|
3295
|
+
"aria-activedescendant": $ || Te
|
|
3296
|
+
}, [g, n, Q, $, Te]), ae = d.useMemo(() => ({
|
|
3258
3297
|
"aria-orientation": C === "both" ? void 0 : C,
|
|
3259
|
-
|
|
3298
|
+
...V ? {} : se,
|
|
3260
3299
|
onKeyDown: fe,
|
|
3261
3300
|
onPointerMove() {
|
|
3262
|
-
|
|
3301
|
+
L.current = !0;
|
|
3263
3302
|
}
|
|
3264
|
-
}), [se, fe, C,
|
|
3265
|
-
function
|
|
3266
|
-
|
|
3303
|
+
}), [se, fe, C, V]), xe = d.useMemo(() => {
|
|
3304
|
+
function M(A) {
|
|
3305
|
+
w === "auto" && ir(A.nativeEvent) && (O.current = !0);
|
|
3267
3306
|
}
|
|
3268
3307
|
function H(A) {
|
|
3269
|
-
|
|
3308
|
+
O.current = w, w === "auto" && sr(A.nativeEvent) && (O.current = !0);
|
|
3270
3309
|
}
|
|
3271
3310
|
return {
|
|
3272
3311
|
...se,
|
|
3273
3312
|
onKeyDown(A) {
|
|
3274
|
-
|
|
3275
|
-
const q = A.key.startsWith("Arrow"), Z = ["Home", "End"].includes(A.key),
|
|
3313
|
+
L.current = !1;
|
|
3314
|
+
const q = A.key.startsWith("Arrow"), Z = ["Home", "End"].includes(A.key), ne = q || Z, rt = Gn(A.key, C, v), ft = jn(A.key, C, v, P), ot = Gn(A.key, U(), v), be = yt(A.key, C), Ke = (a ? ot : be) || A.key === "Enter" || A.key.trim() === "";
|
|
3276
3315
|
if (g && n) {
|
|
3277
|
-
const
|
|
3278
|
-
if (
|
|
3279
|
-
const
|
|
3316
|
+
const mt = R?.nodesRef.current.find((pt) => pt.parentId == null), De = R && mt ? eo(R.nodesRef.current, mt.id) : null;
|
|
3317
|
+
if (ne && De && S) {
|
|
3318
|
+
const pt = new KeyboardEvent("keydown", {
|
|
3280
3319
|
key: A.key,
|
|
3281
3320
|
bubbles: !0
|
|
3282
3321
|
});
|
|
3283
|
-
if (
|
|
3284
|
-
var
|
|
3285
|
-
const
|
|
3286
|
-
|
|
3322
|
+
if (rt || ft) {
|
|
3323
|
+
var dt, fn;
|
|
3324
|
+
const Dr = ((dt = De.context) == null ? void 0 : dt.elements.domReference) === A.currentTarget, mn = ft && !Dr ? (fn = De.context) == null ? void 0 : fn.elements.domReference : rt ? i.current.find((pn) => pn?.id === Te) : null;
|
|
3325
|
+
mn && (de(A), mn.dispatchEvent(pt), z(void 0));
|
|
3287
3326
|
}
|
|
3288
3327
|
if ((be || Z) && De.context && De.context.open && De.parentId && A.currentTarget !== De.context.elements.domReference) {
|
|
3289
|
-
var
|
|
3290
|
-
de(A), (
|
|
3328
|
+
var dn;
|
|
3329
|
+
de(A), (dn = De.context.elements.domReference) == null || dn.dispatchEvent(pt);
|
|
3291
3330
|
return;
|
|
3292
3331
|
}
|
|
3293
3332
|
}
|
|
3294
3333
|
return fe(A);
|
|
3295
3334
|
}
|
|
3296
3335
|
if (!(!n && !b && q)) {
|
|
3297
|
-
if (
|
|
3298
|
-
const
|
|
3299
|
-
I.current =
|
|
3336
|
+
if (Ke) {
|
|
3337
|
+
const mt = yt(A.key, U());
|
|
3338
|
+
I.current = a && mt ? null : A.key;
|
|
3300
3339
|
}
|
|
3301
|
-
if (
|
|
3302
|
-
|
|
3340
|
+
if (a) {
|
|
3341
|
+
ot && (de(A), n ? (h.current = wt(i, oe.current), E()) : r(!0, A.nativeEvent, "list-navigation"));
|
|
3303
3342
|
return;
|
|
3304
3343
|
}
|
|
3305
3344
|
be && (u != null && (h.current = u), de(A), !n && b ? r(!0, A.nativeEvent, "list-navigation") : fe(A), n && E());
|
|
@@ -3310,18 +3349,18 @@ function zi(e, t) {
|
|
|
3310
3349
|
},
|
|
3311
3350
|
onPointerDown: H,
|
|
3312
3351
|
onPointerEnter: H,
|
|
3313
|
-
onMouseDown:
|
|
3314
|
-
onClick:
|
|
3352
|
+
onMouseDown: M,
|
|
3353
|
+
onClick: M
|
|
3315
3354
|
};
|
|
3316
|
-
}, [
|
|
3355
|
+
}, [Te, se, P, fe, oe, w, i, a, E, r, n, b, C, U, v, u, R, g, S]);
|
|
3317
3356
|
return d.useMemo(() => l ? {
|
|
3318
3357
|
reference: xe,
|
|
3319
3358
|
floating: ae,
|
|
3320
3359
|
item: te
|
|
3321
3360
|
} : {}, [l, xe, ae, te]);
|
|
3322
3361
|
}
|
|
3323
|
-
const
|
|
3324
|
-
function
|
|
3362
|
+
const gi = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
|
|
3363
|
+
function Vi(e, t) {
|
|
3325
3364
|
var n, r;
|
|
3326
3365
|
t === void 0 && (t = {});
|
|
3327
3366
|
const {
|
|
@@ -3330,72 +3369,72 @@ function Ui(e, t) {
|
|
|
3330
3369
|
floatingId: i
|
|
3331
3370
|
} = e, {
|
|
3332
3371
|
enabled: c = !0,
|
|
3333
|
-
role:
|
|
3334
|
-
} = t, l =
|
|
3372
|
+
role: f = "dialog"
|
|
3373
|
+
} = t, l = Nt(), u = ((n = s.domReference) == null ? void 0 : n.id) || l, p = d.useMemo(() => {
|
|
3335
3374
|
var b;
|
|
3336
|
-
return ((b =
|
|
3337
|
-
}, [s.floating, i]),
|
|
3338
|
-
["aria-" + (
|
|
3375
|
+
return ((b = Tt(s.floating)) == null ? void 0 : b.id) || i;
|
|
3376
|
+
}, [s.floating, i]), m = (r = gi.get(f)) != null ? r : f, v = et() != null, g = d.useMemo(() => m === "tooltip" || f === "label" ? {
|
|
3377
|
+
["aria-" + (f === "label" ? "labelledby" : "describedby")]: o ? p : void 0
|
|
3339
3378
|
} : {
|
|
3340
3379
|
"aria-expanded": o ? "true" : "false",
|
|
3341
|
-
"aria-haspopup":
|
|
3342
|
-
"aria-controls": o ?
|
|
3343
|
-
...
|
|
3380
|
+
"aria-haspopup": m === "alertdialog" ? "dialog" : m,
|
|
3381
|
+
"aria-controls": o ? p : void 0,
|
|
3382
|
+
...m === "listbox" && {
|
|
3344
3383
|
role: "combobox"
|
|
3345
3384
|
},
|
|
3346
|
-
...
|
|
3385
|
+
...m === "menu" && {
|
|
3347
3386
|
id: u
|
|
3348
3387
|
},
|
|
3349
|
-
...
|
|
3388
|
+
...m === "menu" && v && {
|
|
3350
3389
|
role: "menuitem"
|
|
3351
3390
|
},
|
|
3352
|
-
...
|
|
3391
|
+
...f === "select" && {
|
|
3353
3392
|
"aria-autocomplete": "none"
|
|
3354
3393
|
},
|
|
3355
|
-
...
|
|
3394
|
+
...f === "combobox" && {
|
|
3356
3395
|
"aria-autocomplete": "list"
|
|
3357
3396
|
}
|
|
3358
|
-
}, [
|
|
3397
|
+
}, [m, p, v, o, u, f]), w = d.useMemo(() => {
|
|
3359
3398
|
const b = {
|
|
3360
|
-
id:
|
|
3361
|
-
...
|
|
3362
|
-
role:
|
|
3399
|
+
id: p,
|
|
3400
|
+
...m && {
|
|
3401
|
+
role: m
|
|
3363
3402
|
}
|
|
3364
3403
|
};
|
|
3365
|
-
return
|
|
3404
|
+
return m === "tooltip" || f === "label" ? b : {
|
|
3366
3405
|
...b,
|
|
3367
|
-
...
|
|
3406
|
+
...m === "menu" && {
|
|
3368
3407
|
"aria-labelledby": u
|
|
3369
3408
|
}
|
|
3370
3409
|
};
|
|
3371
|
-
}, [
|
|
3410
|
+
}, [m, p, u, f]), x = d.useCallback((b) => {
|
|
3372
3411
|
let {
|
|
3373
|
-
active:
|
|
3412
|
+
active: y,
|
|
3374
3413
|
selected: C
|
|
3375
3414
|
} = b;
|
|
3376
|
-
const
|
|
3415
|
+
const D = {
|
|
3377
3416
|
role: "option",
|
|
3378
|
-
...
|
|
3379
|
-
id:
|
|
3417
|
+
...y && {
|
|
3418
|
+
id: p + "-fui-option"
|
|
3380
3419
|
}
|
|
3381
3420
|
};
|
|
3382
|
-
switch (
|
|
3421
|
+
switch (f) {
|
|
3383
3422
|
case "select":
|
|
3384
3423
|
case "combobox":
|
|
3385
3424
|
return {
|
|
3386
|
-
...
|
|
3425
|
+
...D,
|
|
3387
3426
|
"aria-selected": C
|
|
3388
3427
|
};
|
|
3389
3428
|
}
|
|
3390
3429
|
return {};
|
|
3391
|
-
}, [
|
|
3430
|
+
}, [p, f]);
|
|
3392
3431
|
return d.useMemo(() => c ? {
|
|
3393
3432
|
reference: g,
|
|
3394
|
-
floating:
|
|
3433
|
+
floating: w,
|
|
3395
3434
|
item: x
|
|
3396
|
-
} : {}, [c, g,
|
|
3435
|
+
} : {}, [c, g, w, x]);
|
|
3397
3436
|
}
|
|
3398
|
-
function
|
|
3437
|
+
function hi(e, t) {
|
|
3399
3438
|
const [n, r] = d.useState(e);
|
|
3400
3439
|
return e && !n && r(!0), d.useEffect(() => {
|
|
3401
3440
|
if (!e && n) {
|
|
@@ -3404,7 +3443,7 @@ function wi(e, t) {
|
|
|
3404
3443
|
}
|
|
3405
3444
|
}, [e, n, t]), n;
|
|
3406
3445
|
}
|
|
3407
|
-
function
|
|
3446
|
+
function Bi(e, t) {
|
|
3408
3447
|
t === void 0 && (t = {});
|
|
3409
3448
|
const {
|
|
3410
3449
|
open: n,
|
|
@@ -3413,21 +3452,21 @@ function Gi(e, t) {
|
|
|
3413
3452
|
}
|
|
3414
3453
|
} = e, {
|
|
3415
3454
|
duration: o = 250
|
|
3416
|
-
} = t, i = (typeof o == "number" ? o : o.close) || 0, [c,
|
|
3417
|
-
return !l && c === "close" &&
|
|
3455
|
+
} = t, i = (typeof o == "number" ? o : o.close) || 0, [c, f] = d.useState("unmounted"), l = hi(n, i);
|
|
3456
|
+
return !l && c === "close" && f("unmounted"), X(() => {
|
|
3418
3457
|
if (r) {
|
|
3419
3458
|
if (n) {
|
|
3420
|
-
|
|
3459
|
+
f("initial");
|
|
3421
3460
|
const u = requestAnimationFrame(() => {
|
|
3422
3461
|
nn.flushSync(() => {
|
|
3423
|
-
|
|
3462
|
+
f("open");
|
|
3424
3463
|
});
|
|
3425
3464
|
});
|
|
3426
3465
|
return () => {
|
|
3427
3466
|
cancelAnimationFrame(u);
|
|
3428
3467
|
};
|
|
3429
3468
|
}
|
|
3430
|
-
|
|
3469
|
+
f("close");
|
|
3431
3470
|
}
|
|
3432
3471
|
}, [n, r]), {
|
|
3433
3472
|
isMounted: l,
|
|
@@ -3435,30 +3474,30 @@ function Gi(e, t) {
|
|
|
3435
3474
|
};
|
|
3436
3475
|
}
|
|
3437
3476
|
export {
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3477
|
+
Oi as C,
|
|
3478
|
+
Si as F,
|
|
3479
|
+
Ti as a,
|
|
3480
|
+
et as b,
|
|
3481
|
+
Ai as c,
|
|
3482
|
+
Mi as d,
|
|
3483
|
+
Di as e,
|
|
3484
|
+
Go as f,
|
|
3485
|
+
Li as g,
|
|
3486
|
+
Ei as h,
|
|
3487
|
+
_i as i,
|
|
3488
|
+
wi as j,
|
|
3489
|
+
Ni as k,
|
|
3490
|
+
Vi as l,
|
|
3491
|
+
Ki as m,
|
|
3492
|
+
$i as n,
|
|
3493
|
+
xi as o,
|
|
3494
|
+
Ii as p,
|
|
3495
|
+
Ri as q,
|
|
3496
|
+
Pi as r,
|
|
3497
|
+
Ci as s,
|
|
3498
|
+
Wi as t,
|
|
3499
|
+
jo as u,
|
|
3500
|
+
Fi as v,
|
|
3501
|
+
Bi as w,
|
|
3502
|
+
ki as x
|
|
3464
3503
|
};
|