@lanaco/lnc-react-ui 4.0.2 → 4.0.3
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/bundle-visualization.html +4842 -0
- package/dist/Accordion.cjs +1 -1
- package/dist/Accordion.js +55 -50
- package/dist/AccordionDetails.cjs +1 -1
- package/dist/AccordionDetails.js +15 -15
- package/dist/AccordionSummary.cjs +1 -1
- package/dist/AccordionSummary.js +11 -11
- package/dist/ActionsToolbar.cjs +2 -2
- package/dist/ActionsToolbar.js +16 -16
- package/dist/Alert.cjs +1 -1
- package/dist/Alert.js +23 -23
- package/dist/Avatar.cjs +2 -2
- package/dist/Avatar.js +23 -25
- package/dist/Badge.cjs +1 -1
- package/dist/Badge.js +21 -14
- package/dist/Breadcrumbs.cjs +1 -1
- package/dist/Breadcrumbs.js +28 -28
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +21 -21
- package/dist/ButtonGroup.cjs +1 -1
- package/dist/ButtonGroup.js +10 -6
- package/dist/CheckBoxInput.cjs +1 -1
- package/dist/CheckBoxInput.js +4 -4
- package/dist/Chip.cjs +1 -1
- package/dist/Chip.js +9 -9
- package/dist/ColorInput.cjs +1 -1
- package/dist/ColorInput.js +5 -5
- package/dist/ConfirmationForm.cjs +5 -5
- package/dist/ConfirmationForm.js +59 -59
- package/dist/Content.cjs +1 -1
- package/dist/Content.js +8 -8
- package/dist/{CustomStyles-nfD3J1mi.js → CustomStyles-BUSJ8bZt.js} +5 -5
- package/dist/{CustomStyles-CqlCjTgU.cjs → CustomStyles-Dlqxic2X.cjs} +1 -1
- package/dist/DataView.cjs +1 -1
- package/dist/DataView.js +2 -2
- package/dist/DateInput.cjs +4 -4
- package/dist/DateInput.js +491 -491
- package/dist/DecimalInput.cjs +1 -1
- package/dist/DecimalInput.js +5 -5
- package/dist/DetailsView.cjs +4 -4
- package/dist/DetailsView.js +40 -40
- package/dist/DoubleRangeSlider.cjs +1 -1
- package/dist/DoubleRangeSlider.js +4 -4
- package/dist/DragAndDropFile.cjs +1 -1
- package/dist/DragAndDropFile.js +6 -6
- package/dist/DragDropFiles.cjs +1 -1
- package/dist/DragDropFiles.js +4 -4
- package/dist/Drawer.cjs +1 -1
- package/dist/Drawer.js +15 -15
- package/dist/Dropdown.cjs +1 -1
- package/dist/Dropdown.js +6 -6
- package/dist/DropdownItem.cjs +1 -1
- package/dist/DropdownItem.js +4 -4
- package/dist/DropdownLookup.cjs +1 -1
- package/dist/DropdownLookup.js +6 -6
- package/dist/DropdownMenu.cjs +7 -1
- package/dist/DropdownMenu.js +192 -10
- package/dist/EditableTable.cjs +1 -1
- package/dist/EditableTable.js +4 -4
- package/dist/FileInput.cjs +1 -1
- package/dist/FileInput.js +4 -4
- package/dist/FlexBox.cjs +1 -1
- package/dist/FlexBox.js +14 -14
- package/dist/FlexGrid.cjs +1 -1
- package/dist/FlexGrid.js +30 -30
- package/dist/FlexGridItem.cjs +1 -1
- package/dist/FlexGridItem.js +3 -3
- package/dist/Footer.cjs +1 -1
- package/dist/Footer.js +5 -5
- package/dist/FormField.cjs +1 -1
- package/dist/FormField.js +8 -9
- package/dist/FormView.cjs +1 -1
- package/dist/FormView.js +31 -31
- package/dist/Grid.cjs +1 -1
- package/dist/Grid.js +2 -2
- package/dist/GridItem.cjs +1 -1
- package/dist/GridItem.js +2 -2
- package/dist/Header.cjs +1 -1
- package/dist/Header.js +7 -7
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +33 -10
- package/dist/IconButton.cjs +5 -5
- package/dist/IconButton.js +33 -33
- package/dist/Kanban.cjs +12 -12
- package/dist/Kanban.js +948 -936
- package/dist/KanbanActionsToolbar.cjs +2 -2
- package/dist/KanbanActionsToolbar.js +28 -28
- package/dist/{KanbanCard-D9OhU8C6.js → KanbanCard-CHZ_C9kk.js} +50 -50
- package/dist/KanbanCard-DV3VnSUi.cjs +30 -0
- package/dist/KanbanCard.cjs +1 -1
- package/dist/KanbanCard.js +5 -5
- package/dist/KanbanFooter.cjs +1 -1
- package/dist/KanbanFooter.js +40 -40
- package/dist/KanbanHeader.cjs +2 -2
- package/dist/KanbanHeader.js +46 -46
- package/dist/KanbanView.cjs +1 -1
- package/dist/KanbanView.js +27 -27
- package/dist/Link.cjs +1 -1
- package/dist/Link.js +9 -9
- package/dist/MenuItem.cjs +1 -1
- package/dist/MenuItem.js +11 -11
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +7 -7
- package/dist/MultiSelectDropdown.cjs +1 -1
- package/dist/MultiSelectDropdown.js +4 -4
- package/dist/MultiSelectDropdownLookup.cjs +1 -1
- package/dist/MultiSelectDropdownLookup.js +4 -4
- package/dist/NestedDropdownItem.cjs +1 -1
- package/dist/NestedDropdownItem.js +18 -18
- package/dist/NestedMenuItem.cjs +1 -1
- package/dist/NestedMenuItem.js +9 -9
- package/dist/Notification.cjs +1 -83
- package/dist/Notification.js +3 -1077
- package/dist/NotificationContainer.cjs +37 -0
- package/dist/NotificationContainer.js +162 -0
- package/dist/NotificationMessage.cjs +47 -0
- package/dist/NotificationMessage.js +133 -0
- package/dist/NumberInput.cjs +1 -1
- package/dist/NumberInput.js +5 -5
- package/dist/PageLayout.cjs +2 -2
- package/dist/PageLayout.js +27 -27
- package/dist/Pagination.cjs +12 -0
- package/dist/Pagination.js +248 -0
- package/dist/PasswordInput.cjs +1 -1
- package/dist/PasswordInput.js +14 -14
- package/dist/Popover.cjs +1 -0
- package/dist/Popover.js +36 -0
- package/dist/PopoverClose.cjs +1 -0
- package/dist/PopoverClose.js +15 -0
- package/dist/PopoverContent.cjs +10 -0
- package/dist/PopoverContent.js +68 -0
- package/dist/PopoverContext.cjs +1 -0
- package/dist/PopoverContext.js +5 -0
- package/dist/PopoverDescription.cjs +1 -0
- package/dist/PopoverDescription.js +16 -0
- package/dist/PopoverHeading.cjs +1 -0
- package/dist/PopoverHeading.js +16 -0
- package/dist/PopoverTrigger.cjs +1 -0
- package/dist/PopoverTrigger.js +38 -0
- package/dist/ProgressBar.cjs +1 -1
- package/dist/ProgressBar.js +35 -24
- package/dist/RadioGroup.cjs +1 -1
- package/dist/RadioGroup.js +3 -3
- package/dist/RadioInput.cjs +1 -1
- package/dist/RadioInput.js +4 -4
- package/dist/RangeSlider.cjs +1 -1
- package/dist/RangeSlider.js +4 -4
- package/dist/SearchBar.cjs +1 -1
- package/dist/SearchBar.js +6 -6
- package/dist/Separator.cjs +1 -1
- package/dist/Separator.js +9 -9
- package/dist/Sidebar.cjs +1 -1
- package/dist/Sidebar.js +4 -4
- package/dist/Spinner.cjs +1 -1
- package/dist/Spinner.js +25 -20
- package/dist/Surface.cjs +2 -2
- package/dist/Surface.js +14 -15
- package/dist/SwipeableDrawer.cjs +1 -1
- package/dist/SwipeableDrawer.js +4 -4
- package/dist/TabItem.cjs +26 -0
- package/dist/TabItem.js +210 -0
- package/dist/Table.cjs +20 -20
- package/dist/Table.js +13 -12
- package/dist/TableView.cjs +8 -1
- package/dist/TableView.js +238 -9
- package/dist/Tabs.cjs +1 -1
- package/dist/Tabs.js +3 -3
- package/dist/TextAreaInput.cjs +1 -1
- package/dist/TextAreaInput.js +5 -5
- package/dist/TextInput.cjs +1 -1
- package/dist/TextInput.js +5 -5
- package/dist/ThemeProvider.cjs +1 -1
- package/dist/ThemeProvider.js +5 -5
- package/dist/TimeInput.cjs +1 -1
- package/dist/TimeInput.js +9 -9
- package/dist/Toggle.cjs +1 -1
- package/dist/Toggle.js +4 -4
- package/dist/TreeMenu.cjs +1 -1
- package/dist/TreeMenu.js +2 -2
- package/dist/TreeMenuSeparator.cjs +3 -3
- package/dist/TreeMenuSeparator.js +11 -11
- package/dist/UploadedFile.cjs +1 -1
- package/dist/UploadedFile.js +29 -29
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/{defineProperty-BHpTtkhC.js → defineProperty-B5pLF6px.js} +8 -8
- package/dist/{emotion-element-5486c51c.browser.esm-CSejtOeT.js → emotion-element-5486c51c.browser.esm-Bb4VkP8U.js} +4 -4
- package/dist/{emotion-is-prop-valid.esm-BzFBwmJz.js → emotion-is-prop-valid.esm-DkbeH1Xy.js} +1 -1
- package/dist/{emotion-react.browser.esm-OWM-uG8Q.js → emotion-react.browser.esm-CN-s34fZ.js} +6 -6
- package/dist/{emotion-react.browser.esm-DQBL7Wls.cjs → emotion-react.browser.esm-D7h2t2Bz.cjs} +1 -1
- package/dist/{emotion-styled.browser.esm-BZSYYThs.js → emotion-styled.browser.esm-BiK8DcgW.js} +12 -12
- package/dist/floating-ui.react.esm-72DKnou_.js +1198 -0
- package/dist/floating-ui.react.esm-C4vrBVJU.cjs +4 -0
- package/dist/{hoist-non-react-statics.cjs-Drf1aBlk.js → hoist-non-react-statics.cjs-CAHiRNzQ.js} +1 -1
- package/dist/{hoist-non-react-statics.cjs-B8r9S_ak.cjs → hoist-non-react-statics.cjs-Dr-ytKVG.cjs} +3 -3
- package/dist/{index-CZJEA84h.js → index--Kmch3aI.js} +1 -1
- package/dist/index-BIlhCoy2.cjs +20 -0
- package/dist/{index-BLQWNy78.js → index-BUChtubz.js} +4 -4
- package/dist/{index-Ds9PUTwb.js → index-BYnWp42a.js} +208 -213
- package/dist/{index-D5vEbKUT.js → index-CNBqQrtK.js} +1 -1
- package/dist/{index-IO9v6o0I.cjs → index-CSXL784P.cjs} +2 -2
- package/dist/{index-C29T0m2a.cjs → index-Ct1N7fF4.cjs} +1 -1
- package/dist/{index-BklgDeu4.js → index-Cu0xwYjD.js} +1 -1
- package/dist/{index-Cdkz-XH-.js → index-CvebWhtp.js} +1 -1
- package/dist/index-DAOBjHnD.cjs +1 -0
- package/dist/index-DBXXH_TD.cjs +1 -0
- package/dist/{index-B_da1uvD.js → index-DLVVKJXD.js} +1 -1
- package/dist/index-DaiUAQVF.cjs +1 -0
- package/dist/index.cjs +1 -26
- package/dist/index.js +180 -376
- package/dist/{motion-CtkUpWEn.js → motion-ecIGZGwI.js} +1 -1
- package/dist/react-toastify.esm-CkXGwKXL.js +798 -0
- package/dist/react-toastify.esm-Dqcb4SQT.cjs +1 -0
- package/dist/{setPrototypeOf-a891FLQJ.js → setPrototypeOf-CttqfWo1.js} +2 -2
- package/dist/{tslib.es6-ZNVz5r_T.js → tslib.es6-DQ-SzcmG.js} +5 -5
- package/dist/usePopover.cjs +1 -0
- package/dist/usePopover.js +44 -0
- package/dist/{utils-DEke8iwo.js → utils-C52T57HO.js} +73 -73
- package/dist/{utils-hdRGTsQ7.cjs → utils-DTAPpJXU.cjs} +1 -1
- package/package.json +17 -5
- package/vite.config.js +16 -0
- package/dist/DropdownMenu-B6qr13ik.cjs +0 -19
- package/dist/DropdownMenu-DZi3TJ8Q.js +0 -1547
- package/dist/KanbanCard-ConTmu3w.cjs +0 -30
- package/dist/TableView-Cj5_fbSR.js +0 -481
- package/dist/TableView-D8ex512p.cjs +0 -19
- package/dist/index-BjdOz5Ok.cjs +0 -1
- package/dist/index-DXnSjbfJ.cjs +0 -20
- package/dist/index-Dzkd2i4n.cjs +0 -1
- package/dist/index-P-naJISQ.cjs +0 -1
|
@@ -0,0 +1,1198 @@
|
|
|
1
|
+
import { c as Je, g as fe } from "./floating-ui.dom-BdUovkEr.js";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { useLayoutEffect as Be, useEffect as Ke, useRef as Qe } from "react";
|
|
4
|
+
import { r as ge } from "./index--Kmch3aI.js";
|
|
5
|
+
var te = typeof document < "u" ? Be : Ke;
|
|
6
|
+
function re(e, t) {
|
|
7
|
+
if (e === t)
|
|
8
|
+
return !0;
|
|
9
|
+
if (typeof e != typeof t)
|
|
10
|
+
return !1;
|
|
11
|
+
if (typeof e == "function" && e.toString() === t.toString())
|
|
12
|
+
return !0;
|
|
13
|
+
let n, r, o;
|
|
14
|
+
if (e && t && typeof e == "object") {
|
|
15
|
+
if (Array.isArray(e)) {
|
|
16
|
+
if (n = e.length, n != t.length) return !1;
|
|
17
|
+
for (r = n; r-- !== 0; )
|
|
18
|
+
if (!re(e[r], t[r]))
|
|
19
|
+
return !1;
|
|
20
|
+
return !0;
|
|
21
|
+
}
|
|
22
|
+
if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
|
|
23
|
+
return !1;
|
|
24
|
+
for (r = n; r-- !== 0; )
|
|
25
|
+
if (!Object.prototype.hasOwnProperty.call(t, o[r]))
|
|
26
|
+
return !1;
|
|
27
|
+
for (r = n; r-- !== 0; ) {
|
|
28
|
+
const i = o[r];
|
|
29
|
+
if (!(i === "_owner" && e.$$typeof) && !re(e[i], t[i]))
|
|
30
|
+
return !1;
|
|
31
|
+
}
|
|
32
|
+
return !0;
|
|
33
|
+
}
|
|
34
|
+
return e !== e && t !== t;
|
|
35
|
+
}
|
|
36
|
+
function Ie(e) {
|
|
37
|
+
const t = s.useRef(e);
|
|
38
|
+
return te(() => {
|
|
39
|
+
t.current = e;
|
|
40
|
+
}), t;
|
|
41
|
+
}
|
|
42
|
+
function et(e) {
|
|
43
|
+
e === void 0 && (e = {});
|
|
44
|
+
const {
|
|
45
|
+
placement: t = "bottom",
|
|
46
|
+
strategy: n = "absolute",
|
|
47
|
+
middleware: r = [],
|
|
48
|
+
platform: o,
|
|
49
|
+
whileElementsMounted: i,
|
|
50
|
+
open: u
|
|
51
|
+
} = e, [a, f] = s.useState({
|
|
52
|
+
x: null,
|
|
53
|
+
y: null,
|
|
54
|
+
strategy: n,
|
|
55
|
+
placement: t,
|
|
56
|
+
middlewareData: {},
|
|
57
|
+
isPositioned: !1
|
|
58
|
+
}), [v, m] = s.useState(r);
|
|
59
|
+
re(v, r) || m(r);
|
|
60
|
+
const c = s.useRef(null), l = s.useRef(null), p = s.useRef(a), w = Ie(i), b = Ie(o), [d, g] = s.useState(null), [I, E] = s.useState(null), F = s.useCallback((T) => {
|
|
61
|
+
c.current !== T && (c.current = T, g(T));
|
|
62
|
+
}, []), k = s.useCallback((T) => {
|
|
63
|
+
l.current !== T && (l.current = T, E(T));
|
|
64
|
+
}, []), O = s.useCallback(() => {
|
|
65
|
+
if (!c.current || !l.current)
|
|
66
|
+
return;
|
|
67
|
+
const T = {
|
|
68
|
+
placement: t,
|
|
69
|
+
strategy: n,
|
|
70
|
+
middleware: v
|
|
71
|
+
};
|
|
72
|
+
b.current && (T.platform = b.current), Je(c.current, l.current, T).then((D) => {
|
|
73
|
+
const A = {
|
|
74
|
+
...D,
|
|
75
|
+
isPositioned: !0
|
|
76
|
+
};
|
|
77
|
+
V.current && !re(p.current, A) && (p.current = A, ge.flushSync(() => {
|
|
78
|
+
f(A);
|
|
79
|
+
}));
|
|
80
|
+
});
|
|
81
|
+
}, [v, t, n, b]);
|
|
82
|
+
te(() => {
|
|
83
|
+
u === !1 && p.current.isPositioned && (p.current.isPositioned = !1, f((T) => ({
|
|
84
|
+
...T,
|
|
85
|
+
isPositioned: !1
|
|
86
|
+
})));
|
|
87
|
+
}, [u]);
|
|
88
|
+
const V = s.useRef(!1);
|
|
89
|
+
te(() => (V.current = !0, () => {
|
|
90
|
+
V.current = !1;
|
|
91
|
+
}), []), te(() => {
|
|
92
|
+
if (d && I) {
|
|
93
|
+
if (w.current)
|
|
94
|
+
return w.current(d, I, O);
|
|
95
|
+
O();
|
|
96
|
+
}
|
|
97
|
+
}, [d, I, O, w]);
|
|
98
|
+
const W = s.useMemo(() => ({
|
|
99
|
+
reference: c,
|
|
100
|
+
floating: l,
|
|
101
|
+
setReference: F,
|
|
102
|
+
setFloating: k
|
|
103
|
+
}), [F, k]), K = s.useMemo(() => ({
|
|
104
|
+
reference: d,
|
|
105
|
+
floating: I
|
|
106
|
+
}), [d, I]);
|
|
107
|
+
return s.useMemo(() => ({
|
|
108
|
+
...a,
|
|
109
|
+
update: O,
|
|
110
|
+
refs: W,
|
|
111
|
+
elements: K,
|
|
112
|
+
reference: F,
|
|
113
|
+
floating: k
|
|
114
|
+
}), [a, O, W, K, F, k]);
|
|
115
|
+
}
|
|
116
|
+
var tt = function(e) {
|
|
117
|
+
if (typeof document > "u")
|
|
118
|
+
return null;
|
|
119
|
+
var t = Array.isArray(e) ? e[0] : e;
|
|
120
|
+
return t.ownerDocument.body;
|
|
121
|
+
}, z = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), ee = {}, de = 0, Ve = function(e) {
|
|
122
|
+
return e && (e.host || Ve(e.parentNode));
|
|
123
|
+
}, nt = function(e, t) {
|
|
124
|
+
return t.map(function(n) {
|
|
125
|
+
if (e.contains(n))
|
|
126
|
+
return n;
|
|
127
|
+
var r = Ve(n);
|
|
128
|
+
return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
|
|
129
|
+
}).filter(function(n) {
|
|
130
|
+
return !!n;
|
|
131
|
+
});
|
|
132
|
+
}, rt = function(e, t, n, r) {
|
|
133
|
+
var o = nt(t, Array.isArray(e) ? e : [e]);
|
|
134
|
+
ee[n] || (ee[n] = /* @__PURE__ */ new WeakMap());
|
|
135
|
+
var i = ee[n], u = [], a = /* @__PURE__ */ new Set(), f = new Set(o), v = function(c) {
|
|
136
|
+
!c || a.has(c) || (a.add(c), v(c.parentNode));
|
|
137
|
+
};
|
|
138
|
+
o.forEach(v);
|
|
139
|
+
var m = function(c) {
|
|
140
|
+
!c || f.has(c) || Array.prototype.forEach.call(c.children, function(l) {
|
|
141
|
+
if (a.has(l))
|
|
142
|
+
m(l);
|
|
143
|
+
else
|
|
144
|
+
try {
|
|
145
|
+
var p = l.getAttribute(r), w = p !== null && p !== "false", b = (z.get(l) || 0) + 1, d = (i.get(l) || 0) + 1;
|
|
146
|
+
z.set(l, b), i.set(l, d), u.push(l), b === 1 && w && Q.set(l, !0), d === 1 && l.setAttribute(n, "true"), w || l.setAttribute(r, "true");
|
|
147
|
+
} catch (g) {
|
|
148
|
+
console.error("aria-hidden: cannot operate on ", l, g);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
return m(t), a.clear(), de++, function() {
|
|
153
|
+
u.forEach(function(c) {
|
|
154
|
+
var l = z.get(c) - 1, p = i.get(c) - 1;
|
|
155
|
+
z.set(c, l), i.set(c, p), l || (Q.has(c) || c.removeAttribute(r), Q.delete(c)), p || c.removeAttribute(n);
|
|
156
|
+
}), de--, de || (z = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), ee = {});
|
|
157
|
+
};
|
|
158
|
+
}, ot = function(e, t, n) {
|
|
159
|
+
n === void 0 && (n = "data-aria-hidden");
|
|
160
|
+
var r = Array.from(Array.isArray(e) ? e : [e]), o = tt(e);
|
|
161
|
+
return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live]"))), rt(r, o, n, "aria-hidden")) : function() {
|
|
162
|
+
return null;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
/*!
|
|
166
|
+
* tabbable 6.2.0
|
|
167
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
168
|
+
*/
|
|
169
|
+
var it = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], he = /* @__PURE__ */ it.join(","), We = typeof Element > "u", X = We ? function() {
|
|
170
|
+
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, oe = !We && Element.prototype.getRootNode ? function(e) {
|
|
171
|
+
var t;
|
|
172
|
+
return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
|
|
173
|
+
} : function(e) {
|
|
174
|
+
return e == null ? void 0 : e.ownerDocument;
|
|
175
|
+
}, ie = function e(t, n) {
|
|
176
|
+
var r;
|
|
177
|
+
n === void 0 && (n = !0);
|
|
178
|
+
var o = t == null || (r = t.getAttribute) === null || r === void 0 ? void 0 : r.call(t, "inert"), i = o === "" || o === "true", u = i || n && t && e(t.parentNode);
|
|
179
|
+
return u;
|
|
180
|
+
}, ut = function(t) {
|
|
181
|
+
var n, r = t == null || (n = t.getAttribute) === null || n === void 0 ? void 0 : n.call(t, "contenteditable");
|
|
182
|
+
return r === "" || r === "true";
|
|
183
|
+
}, st = function(t, n, r) {
|
|
184
|
+
if (ie(t))
|
|
185
|
+
return [];
|
|
186
|
+
var o = Array.prototype.slice.apply(t.querySelectorAll(he));
|
|
187
|
+
return n && X.call(t, he) && o.unshift(t), o = o.filter(r), o;
|
|
188
|
+
}, at = function e(t, n, r) {
|
|
189
|
+
for (var o = [], i = Array.from(t); i.length; ) {
|
|
190
|
+
var u = i.shift();
|
|
191
|
+
if (!ie(u, !1))
|
|
192
|
+
if (u.tagName === "SLOT") {
|
|
193
|
+
var a = u.assignedElements(), f = a.length ? a : u.children, v = e(f, !0, r);
|
|
194
|
+
r.flatten ? o.push.apply(o, v) : o.push({
|
|
195
|
+
scopeParent: u,
|
|
196
|
+
candidates: v
|
|
197
|
+
});
|
|
198
|
+
} else {
|
|
199
|
+
var m = X.call(u, he);
|
|
200
|
+
m && r.filter(u) && (n || !t.includes(u)) && o.push(u);
|
|
201
|
+
var c = u.shadowRoot || // check for an undisclosed shadow
|
|
202
|
+
typeof r.getShadowRoot == "function" && r.getShadowRoot(u), l = !ie(c, !1) && (!r.shadowRootFilter || r.shadowRootFilter(u));
|
|
203
|
+
if (c && l) {
|
|
204
|
+
var p = e(c === !0 ? u.children : c.children, !0, r);
|
|
205
|
+
r.flatten ? o.push.apply(o, p) : o.push({
|
|
206
|
+
scopeParent: u,
|
|
207
|
+
candidates: p
|
|
208
|
+
});
|
|
209
|
+
} else
|
|
210
|
+
i.unshift.apply(i, u.children);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return o;
|
|
214
|
+
}, $e = function(t) {
|
|
215
|
+
return !isNaN(parseInt(t.getAttribute("tabindex"), 10));
|
|
216
|
+
}, qe = function(t) {
|
|
217
|
+
if (!t)
|
|
218
|
+
throw new Error("No node provided");
|
|
219
|
+
return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || ut(t)) && !$e(t) ? 0 : t.tabIndex;
|
|
220
|
+
}, lt = function(t, n) {
|
|
221
|
+
var r = qe(t);
|
|
222
|
+
return r < 0 && n && !$e(t) ? 0 : r;
|
|
223
|
+
}, ct = function(t, n) {
|
|
224
|
+
return t.tabIndex === n.tabIndex ? t.documentOrder - n.documentOrder : t.tabIndex - n.tabIndex;
|
|
225
|
+
}, je = function(t) {
|
|
226
|
+
return t.tagName === "INPUT";
|
|
227
|
+
}, ft = function(t) {
|
|
228
|
+
return je(t) && t.type === "hidden";
|
|
229
|
+
}, dt = function(t) {
|
|
230
|
+
var n = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(r) {
|
|
231
|
+
return r.tagName === "SUMMARY";
|
|
232
|
+
});
|
|
233
|
+
return n;
|
|
234
|
+
}, vt = function(t, n) {
|
|
235
|
+
for (var r = 0; r < t.length; r++)
|
|
236
|
+
if (t[r].checked && t[r].form === n)
|
|
237
|
+
return t[r];
|
|
238
|
+
}, pt = function(t) {
|
|
239
|
+
if (!t.name)
|
|
240
|
+
return !0;
|
|
241
|
+
var n = t.form || oe(t), r = function(a) {
|
|
242
|
+
return n.querySelectorAll('input[type="radio"][name="' + a + '"]');
|
|
243
|
+
}, o;
|
|
244
|
+
if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
|
|
245
|
+
o = r(window.CSS.escape(t.name));
|
|
246
|
+
else
|
|
247
|
+
try {
|
|
248
|
+
o = r(t.name);
|
|
249
|
+
} catch (u) {
|
|
250
|
+
return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", u.message), !1;
|
|
251
|
+
}
|
|
252
|
+
var i = vt(o, t.form);
|
|
253
|
+
return !i || i === t;
|
|
254
|
+
}, bt = function(t) {
|
|
255
|
+
return je(t) && t.type === "radio";
|
|
256
|
+
}, mt = function(t) {
|
|
257
|
+
return bt(t) && !pt(t);
|
|
258
|
+
}, gt = function(t) {
|
|
259
|
+
var n, r = t && oe(t), o = (n = r) === null || n === void 0 ? void 0 : n.host, i = !1;
|
|
260
|
+
if (r && r !== t) {
|
|
261
|
+
var u, a, f;
|
|
262
|
+
for (i = !!((u = o) !== null && u !== void 0 && (a = u.ownerDocument) !== null && a !== void 0 && a.contains(o) || t != null && (f = t.ownerDocument) !== null && f !== void 0 && f.contains(t)); !i && o; ) {
|
|
263
|
+
var v, m, c;
|
|
264
|
+
r = oe(o), o = (v = r) === null || v === void 0 ? void 0 : v.host, i = !!((m = o) !== null && m !== void 0 && (c = m.ownerDocument) !== null && c !== void 0 && c.contains(o));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return i;
|
|
268
|
+
}, Ae = function(t) {
|
|
269
|
+
var n = t.getBoundingClientRect(), r = n.width, o = n.height;
|
|
270
|
+
return r === 0 && o === 0;
|
|
271
|
+
}, ht = function(t, n) {
|
|
272
|
+
var r = n.displayCheck, o = n.getShadowRoot;
|
|
273
|
+
if (getComputedStyle(t).visibility === "hidden")
|
|
274
|
+
return !0;
|
|
275
|
+
var i = X.call(t, "details>summary:first-of-type"), u = i ? t.parentElement : t;
|
|
276
|
+
if (X.call(u, "details:not([open]) *"))
|
|
277
|
+
return !0;
|
|
278
|
+
if (!r || r === "full" || r === "legacy-full") {
|
|
279
|
+
if (typeof o == "function") {
|
|
280
|
+
for (var a = t; t; ) {
|
|
281
|
+
var f = t.parentElement, v = oe(t);
|
|
282
|
+
if (f && !f.shadowRoot && o(f) === !0)
|
|
283
|
+
return Ae(t);
|
|
284
|
+
t.assignedSlot ? t = t.assignedSlot : !f && v !== t.ownerDocument ? t = v.host : t = f;
|
|
285
|
+
}
|
|
286
|
+
t = a;
|
|
287
|
+
}
|
|
288
|
+
if (gt(t))
|
|
289
|
+
return !t.getClientRects().length;
|
|
290
|
+
if (r !== "legacy-full")
|
|
291
|
+
return !0;
|
|
292
|
+
} else if (r === "non-zero-area")
|
|
293
|
+
return Ae(t);
|
|
294
|
+
return !1;
|
|
295
|
+
}, yt = function(t) {
|
|
296
|
+
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
|
|
297
|
+
for (var n = t.parentElement; n; ) {
|
|
298
|
+
if (n.tagName === "FIELDSET" && n.disabled) {
|
|
299
|
+
for (var r = 0; r < n.children.length; r++) {
|
|
300
|
+
var o = n.children.item(r);
|
|
301
|
+
if (o.tagName === "LEGEND")
|
|
302
|
+
return X.call(n, "fieldset[disabled] *") ? !0 : !o.contains(t);
|
|
303
|
+
}
|
|
304
|
+
return !0;
|
|
305
|
+
}
|
|
306
|
+
n = n.parentElement;
|
|
307
|
+
}
|
|
308
|
+
return !1;
|
|
309
|
+
}, Et = function(t, n) {
|
|
310
|
+
return !(n.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
|
|
311
|
+
// because we're limited in the type of selectors we can use in JSDom (see related
|
|
312
|
+
// note related to `candidateSelectors`)
|
|
313
|
+
ie(n) || ft(n) || ht(n, t) || // For a details element with a summary, the summary element gets the focus
|
|
314
|
+
dt(n) || yt(n));
|
|
315
|
+
}, Pe = function(t, n) {
|
|
316
|
+
return !(mt(n) || qe(n) < 0 || !Et(t, n));
|
|
317
|
+
}, Rt = function(t) {
|
|
318
|
+
var n = parseInt(t.getAttribute("tabindex"), 10);
|
|
319
|
+
return !!(isNaN(n) || n >= 0);
|
|
320
|
+
}, wt = function e(t) {
|
|
321
|
+
var n = [], r = [];
|
|
322
|
+
return t.forEach(function(o, i) {
|
|
323
|
+
var u = !!o.scopeParent, a = u ? o.scopeParent : o, f = lt(a, u), v = u ? e(o.candidates) : a;
|
|
324
|
+
f === 0 ? u ? n.push.apply(n, v) : n.push(a) : r.push({
|
|
325
|
+
documentOrder: i,
|
|
326
|
+
tabIndex: f,
|
|
327
|
+
item: o,
|
|
328
|
+
isScope: u,
|
|
329
|
+
content: v
|
|
330
|
+
});
|
|
331
|
+
}), r.sort(ct).reduce(function(o, i) {
|
|
332
|
+
return i.isScope ? o.push.apply(o, i.content) : o.push(i.content), o;
|
|
333
|
+
}, []).concat(n);
|
|
334
|
+
}, ue = function(t, n) {
|
|
335
|
+
n = n || {};
|
|
336
|
+
var r;
|
|
337
|
+
return n.getShadowRoot ? r = at([t], n.includeContainer, {
|
|
338
|
+
filter: Pe.bind(null, n),
|
|
339
|
+
flatten: !1,
|
|
340
|
+
getShadowRoot: n.getShadowRoot,
|
|
341
|
+
shadowRootFilter: Rt
|
|
342
|
+
}) : r = st(t, n.includeContainer, Pe.bind(null, n)), wt(r);
|
|
343
|
+
}, q = typeof document < "u" ? Be : Ke;
|
|
344
|
+
let ve = !1, St = 0;
|
|
345
|
+
const Fe = () => "floating-ui-" + St++;
|
|
346
|
+
function xt() {
|
|
347
|
+
const [e, t] = s.useState(() => ve ? Fe() : void 0);
|
|
348
|
+
return q(() => {
|
|
349
|
+
e == null && t(Fe());
|
|
350
|
+
}, []), s.useEffect(() => {
|
|
351
|
+
ve || (ve = !0);
|
|
352
|
+
}, []), e;
|
|
353
|
+
}
|
|
354
|
+
const Tt = s.useId, ye = Tt || xt;
|
|
355
|
+
function Ct() {
|
|
356
|
+
const e = /* @__PURE__ */ new Map();
|
|
357
|
+
return {
|
|
358
|
+
emit(t, n) {
|
|
359
|
+
var r;
|
|
360
|
+
(r = e.get(t)) == null || r.forEach((o) => o(n));
|
|
361
|
+
},
|
|
362
|
+
on(t, n) {
|
|
363
|
+
e.set(t, [...e.get(t) || [], n]);
|
|
364
|
+
},
|
|
365
|
+
off(t, n) {
|
|
366
|
+
e.set(t, (e.get(t) || []).filter((r) => r !== n));
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
const It = /* @__PURE__ */ s.createContext(null), At = /* @__PURE__ */ s.createContext(null), Pt = () => {
|
|
371
|
+
var e;
|
|
372
|
+
return ((e = s.useContext(It)) == null ? void 0 : e.id) || null;
|
|
373
|
+
}, we = () => s.useContext(At);
|
|
374
|
+
function G(e) {
|
|
375
|
+
return (e == null ? void 0 : e.ownerDocument) || document;
|
|
376
|
+
}
|
|
377
|
+
function He() {
|
|
378
|
+
const e = navigator.userAgentData;
|
|
379
|
+
return e != null && e.platform ? e.platform : navigator.platform;
|
|
380
|
+
}
|
|
381
|
+
function Ft() {
|
|
382
|
+
const e = navigator.userAgentData;
|
|
383
|
+
return e && Array.isArray(e.brands) ? e.brands.map((t) => {
|
|
384
|
+
let {
|
|
385
|
+
brand: n,
|
|
386
|
+
version: r
|
|
387
|
+
} = t;
|
|
388
|
+
return n + "/" + r;
|
|
389
|
+
}).join(" ") : navigator.userAgent;
|
|
390
|
+
}
|
|
391
|
+
function Se(e) {
|
|
392
|
+
return G(e).defaultView || window;
|
|
393
|
+
}
|
|
394
|
+
function H(e) {
|
|
395
|
+
return e ? e instanceof Se(e).Element : !1;
|
|
396
|
+
}
|
|
397
|
+
function Z(e) {
|
|
398
|
+
return e ? e instanceof Se(e).HTMLElement : !1;
|
|
399
|
+
}
|
|
400
|
+
function Ot(e) {
|
|
401
|
+
if (typeof ShadowRoot > "u")
|
|
402
|
+
return !1;
|
|
403
|
+
const t = Se(e).ShadowRoot;
|
|
404
|
+
return e instanceof t || e instanceof ShadowRoot;
|
|
405
|
+
}
|
|
406
|
+
function Dt(e) {
|
|
407
|
+
if (e.mozInputSource === 0 && e.isTrusted)
|
|
408
|
+
return !0;
|
|
409
|
+
const t = /Android/i;
|
|
410
|
+
return (t.test(He()) || t.test(Ft())) && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
411
|
+
}
|
|
412
|
+
function Mt(e) {
|
|
413
|
+
return e.width === 0 && e.height === 0 || e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType !== "mouse" || // iOS VoiceOver returns 0.333• for width/height.
|
|
414
|
+
e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0;
|
|
415
|
+
}
|
|
416
|
+
function Oe() {
|
|
417
|
+
return /apple/i.test(navigator.vendor);
|
|
418
|
+
}
|
|
419
|
+
function Nt() {
|
|
420
|
+
return He().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
421
|
+
}
|
|
422
|
+
function De(e, t) {
|
|
423
|
+
return ["mouse", "pen"].includes(e);
|
|
424
|
+
}
|
|
425
|
+
function $(e, t) {
|
|
426
|
+
if (!e || !t)
|
|
427
|
+
return !1;
|
|
428
|
+
const n = t.getRootNode && t.getRootNode();
|
|
429
|
+
if (e.contains(t))
|
|
430
|
+
return !0;
|
|
431
|
+
if (n && Ot(n)) {
|
|
432
|
+
let r = t;
|
|
433
|
+
do {
|
|
434
|
+
if (r && e === r)
|
|
435
|
+
return !0;
|
|
436
|
+
r = r.parentNode || r.host;
|
|
437
|
+
} while (r);
|
|
438
|
+
}
|
|
439
|
+
return !1;
|
|
440
|
+
}
|
|
441
|
+
function ne(e, t) {
|
|
442
|
+
let n = e.filter((o) => {
|
|
443
|
+
var i;
|
|
444
|
+
return o.parentId === t && ((i = o.context) == null ? void 0 : i.open);
|
|
445
|
+
}) || [], r = n;
|
|
446
|
+
for (; r.length; )
|
|
447
|
+
r = e.filter((o) => {
|
|
448
|
+
var i;
|
|
449
|
+
return (i = r) == null ? void 0 : i.some((u) => {
|
|
450
|
+
var a;
|
|
451
|
+
return o.parentId === u.id && ((a = o.context) == null ? void 0 : a.open);
|
|
452
|
+
});
|
|
453
|
+
}) || [], n = n.concat(r);
|
|
454
|
+
return n;
|
|
455
|
+
}
|
|
456
|
+
function Ue(e) {
|
|
457
|
+
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
458
|
+
}
|
|
459
|
+
function kt(e) {
|
|
460
|
+
const t = Qe(e);
|
|
461
|
+
return q(() => {
|
|
462
|
+
t.current = e;
|
|
463
|
+
}), t;
|
|
464
|
+
}
|
|
465
|
+
function se() {
|
|
466
|
+
return se = Object.assign || function(e) {
|
|
467
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
468
|
+
var n = arguments[t];
|
|
469
|
+
for (var r in n)
|
|
470
|
+
Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
471
|
+
}
|
|
472
|
+
return e;
|
|
473
|
+
}, se.apply(this, arguments);
|
|
474
|
+
}
|
|
475
|
+
function Ee(e) {
|
|
476
|
+
let t = e.activeElement;
|
|
477
|
+
for (; ((n = t) == null || (r = n.shadowRoot) == null ? void 0 : r.activeElement) != null; ) {
|
|
478
|
+
var n, r;
|
|
479
|
+
t = t.shadowRoot.activeElement;
|
|
480
|
+
}
|
|
481
|
+
return t;
|
|
482
|
+
}
|
|
483
|
+
let Me = 0;
|
|
484
|
+
function j(e, t) {
|
|
485
|
+
t === void 0 && (t = {});
|
|
486
|
+
const {
|
|
487
|
+
preventScroll: n = !1,
|
|
488
|
+
cancelPrevious: r = !0,
|
|
489
|
+
sync: o = !1
|
|
490
|
+
} = t;
|
|
491
|
+
r && cancelAnimationFrame(Me);
|
|
492
|
+
const i = () => e == null ? void 0 : e.focus({
|
|
493
|
+
preventScroll: n
|
|
494
|
+
});
|
|
495
|
+
o ? i() : Me = requestAnimationFrame(i);
|
|
496
|
+
}
|
|
497
|
+
function Lt(e, t) {
|
|
498
|
+
var n;
|
|
499
|
+
let r = [], o = (n = e.find((i) => i.id === t)) == null ? void 0 : n.parentId;
|
|
500
|
+
for (; o; ) {
|
|
501
|
+
const i = e.find((u) => u.id === o);
|
|
502
|
+
o = i == null ? void 0 : i.parentId, i && (r = r.concat(i));
|
|
503
|
+
}
|
|
504
|
+
return r;
|
|
505
|
+
}
|
|
506
|
+
const Bt = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
507
|
+
function _e(e) {
|
|
508
|
+
return Z(e) && e.matches(Bt);
|
|
509
|
+
}
|
|
510
|
+
function pe(e) {
|
|
511
|
+
e.preventDefault(), e.stopPropagation();
|
|
512
|
+
}
|
|
513
|
+
const ae = () => ({
|
|
514
|
+
getShadowRoot: !0,
|
|
515
|
+
displayCheck: (
|
|
516
|
+
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
517
|
+
// check if `ResizeObserver` is a real function (not polyfilled), which
|
|
518
|
+
// determines if the current environment is JSDOM-like.
|
|
519
|
+
typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
520
|
+
)
|
|
521
|
+
});
|
|
522
|
+
function ze(e, t) {
|
|
523
|
+
const n = ue(e, ae());
|
|
524
|
+
t === "prev" && n.reverse();
|
|
525
|
+
const r = n.indexOf(Ee(G(e)));
|
|
526
|
+
return n.slice(r + 1)[0];
|
|
527
|
+
}
|
|
528
|
+
function Ge() {
|
|
529
|
+
return ze(document.body, "next");
|
|
530
|
+
}
|
|
531
|
+
function Ye() {
|
|
532
|
+
return ze(document.body, "prev");
|
|
533
|
+
}
|
|
534
|
+
function Y(e, t) {
|
|
535
|
+
const n = t || e.currentTarget, r = e.relatedTarget;
|
|
536
|
+
return !r || !$(n, r);
|
|
537
|
+
}
|
|
538
|
+
function Kt(e) {
|
|
539
|
+
ue(e, ae()).forEach((n) => {
|
|
540
|
+
n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
function Vt(e) {
|
|
544
|
+
e.querySelectorAll("[data-tabindex]").forEach((n) => {
|
|
545
|
+
const r = n.dataset.tabindex;
|
|
546
|
+
delete n.dataset.tabindex, r ? n.setAttribute("tabindex", r) : n.removeAttribute("tabindex");
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
const Wt = s.useInsertionEffect, $t = Wt || ((e) => e());
|
|
550
|
+
function xe(e) {
|
|
551
|
+
const t = s.useRef(() => {
|
|
552
|
+
if (process.env.NODE_ENV !== "production")
|
|
553
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
554
|
+
});
|
|
555
|
+
return $t(() => {
|
|
556
|
+
t.current = e;
|
|
557
|
+
}), s.useCallback(function() {
|
|
558
|
+
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
559
|
+
r[o] = arguments[o];
|
|
560
|
+
return t.current == null ? void 0 : t.current(...r);
|
|
561
|
+
}, []);
|
|
562
|
+
}
|
|
563
|
+
const Te = {
|
|
564
|
+
border: 0,
|
|
565
|
+
clip: "rect(0 0 0 0)",
|
|
566
|
+
height: "1px",
|
|
567
|
+
margin: "-1px",
|
|
568
|
+
overflow: "hidden",
|
|
569
|
+
padding: 0,
|
|
570
|
+
position: "fixed",
|
|
571
|
+
whiteSpace: "nowrap",
|
|
572
|
+
width: "1px",
|
|
573
|
+
top: 0,
|
|
574
|
+
left: 0
|
|
575
|
+
};
|
|
576
|
+
let Re, Ce;
|
|
577
|
+
function Ne(e) {
|
|
578
|
+
e.key === "Tab" && (Re = e.target, clearTimeout(Ce));
|
|
579
|
+
}
|
|
580
|
+
function qt(e) {
|
|
581
|
+
const t = Re === e.relatedTarget;
|
|
582
|
+
return Re = e.relatedTarget, clearTimeout(Ce), t;
|
|
583
|
+
}
|
|
584
|
+
const le = /* @__PURE__ */ s.forwardRef(function(t, n) {
|
|
585
|
+
const r = xe(t.onFocus), [o, i] = s.useState();
|
|
586
|
+
return q(() => (Oe() && i("button"), document.addEventListener("keydown", Ne), () => {
|
|
587
|
+
document.removeEventListener("keydown", Ne);
|
|
588
|
+
}), []), /* @__PURE__ */ s.createElement("span", se({}, t, {
|
|
589
|
+
ref: n,
|
|
590
|
+
tabIndex: 0,
|
|
591
|
+
role: o,
|
|
592
|
+
"aria-hidden": o ? void 0 : !0,
|
|
593
|
+
"data-floating-ui-focus-guard": "",
|
|
594
|
+
style: Te,
|
|
595
|
+
onFocus: (u) => {
|
|
596
|
+
Oe() && Nt() && !qt(u) ? (u.persist(), Ce = window.setTimeout(() => {
|
|
597
|
+
r(u);
|
|
598
|
+
}, 50)) : r(u);
|
|
599
|
+
}
|
|
600
|
+
}));
|
|
601
|
+
}), Xe = /* @__PURE__ */ s.createContext(null), jt = function(e) {
|
|
602
|
+
let {
|
|
603
|
+
id: t,
|
|
604
|
+
enabled: n = !0
|
|
605
|
+
} = e === void 0 ? {} : e;
|
|
606
|
+
const [r, o] = s.useState(null), i = ye(), u = Ze();
|
|
607
|
+
return q(() => {
|
|
608
|
+
if (!n)
|
|
609
|
+
return;
|
|
610
|
+
const a = t ? document.getElementById(t) : null;
|
|
611
|
+
if (a)
|
|
612
|
+
a.setAttribute("data-floating-ui-portal", ""), o(a);
|
|
613
|
+
else {
|
|
614
|
+
const f = document.createElement("div");
|
|
615
|
+
f.id = t || i, f.setAttribute("data-floating-ui-portal", ""), o(f);
|
|
616
|
+
const v = (u == null ? void 0 : u.portalNode) || document.body;
|
|
617
|
+
return v.appendChild(f), () => {
|
|
618
|
+
v.removeChild(f);
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
}, [t, u, i, n]), r;
|
|
622
|
+
}, Zt = (e) => {
|
|
623
|
+
let {
|
|
624
|
+
children: t,
|
|
625
|
+
id: n,
|
|
626
|
+
root: r = null,
|
|
627
|
+
preserveTabOrder: o = !0
|
|
628
|
+
} = e;
|
|
629
|
+
const i = jt({
|
|
630
|
+
id: n,
|
|
631
|
+
enabled: !r
|
|
632
|
+
}), [u, a] = s.useState(null), f = s.useRef(null), v = s.useRef(null), m = s.useRef(null), c = s.useRef(null), l = (
|
|
633
|
+
// The FocusManager and therefore floating element are currently open/
|
|
634
|
+
// rendered.
|
|
635
|
+
!!u && // Guards are only for non-modal focus management.
|
|
636
|
+
!u.modal && !!(r || i) && o
|
|
637
|
+
);
|
|
638
|
+
return s.useEffect(() => {
|
|
639
|
+
if (!i || !o || u != null && u.modal)
|
|
640
|
+
return;
|
|
641
|
+
function p(w) {
|
|
642
|
+
i && Y(w) && (w.type === "focusin" ? Vt : Kt)(i);
|
|
643
|
+
}
|
|
644
|
+
return i.addEventListener("focusin", p, !0), i.addEventListener("focusout", p, !0), () => {
|
|
645
|
+
i.removeEventListener("focusin", p, !0), i.removeEventListener("focusout", p, !0);
|
|
646
|
+
};
|
|
647
|
+
}, [i, o, u == null ? void 0 : u.modal]), /* @__PURE__ */ s.createElement(Xe.Provider, {
|
|
648
|
+
value: s.useMemo(() => ({
|
|
649
|
+
preserveTabOrder: o,
|
|
650
|
+
beforeOutsideRef: f,
|
|
651
|
+
afterOutsideRef: v,
|
|
652
|
+
beforeInsideRef: m,
|
|
653
|
+
afterInsideRef: c,
|
|
654
|
+
portalNode: i,
|
|
655
|
+
setFocusManagerState: a
|
|
656
|
+
}), [o, i])
|
|
657
|
+
}, l && i && /* @__PURE__ */ s.createElement(le, {
|
|
658
|
+
ref: f,
|
|
659
|
+
onFocus: (p) => {
|
|
660
|
+
if (Y(p, i)) {
|
|
661
|
+
var w;
|
|
662
|
+
(w = m.current) == null || w.focus();
|
|
663
|
+
} else {
|
|
664
|
+
const b = Ye() || (u == null ? void 0 : u.refs.domReference.current);
|
|
665
|
+
b == null || b.focus();
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}), l && i && /* @__PURE__ */ s.createElement("span", {
|
|
669
|
+
"aria-owns": i.id,
|
|
670
|
+
style: Te
|
|
671
|
+
}), r ? /* @__PURE__ */ ge.createPortal(t, r) : i ? /* @__PURE__ */ ge.createPortal(t, i) : null, l && i && /* @__PURE__ */ s.createElement(le, {
|
|
672
|
+
ref: v,
|
|
673
|
+
onFocus: (p) => {
|
|
674
|
+
if (Y(p, i)) {
|
|
675
|
+
var w;
|
|
676
|
+
(w = c.current) == null || w.focus();
|
|
677
|
+
} else {
|
|
678
|
+
const b = Ge() || (u == null ? void 0 : u.refs.domReference.current);
|
|
679
|
+
b == null || b.focus(), u != null && u.closeOnFocusOut && (u == null || u.onOpenChange(!1));
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}));
|
|
683
|
+
}, Ze = () => s.useContext(Xe), Ht = /* @__PURE__ */ s.forwardRef(function(t, n) {
|
|
684
|
+
return /* @__PURE__ */ s.createElement("button", se({}, t, {
|
|
685
|
+
ref: n,
|
|
686
|
+
tabIndex: -1,
|
|
687
|
+
style: Te
|
|
688
|
+
}));
|
|
689
|
+
});
|
|
690
|
+
function Jt(e) {
|
|
691
|
+
let {
|
|
692
|
+
context: t,
|
|
693
|
+
children: n,
|
|
694
|
+
order: r = ["content"],
|
|
695
|
+
guards: o = !0,
|
|
696
|
+
initialFocus: i = 0,
|
|
697
|
+
returnFocus: u = !0,
|
|
698
|
+
modal: a = !0,
|
|
699
|
+
visuallyHiddenDismiss: f = !1,
|
|
700
|
+
closeOnFocusOut: v = !0
|
|
701
|
+
} = e;
|
|
702
|
+
const {
|
|
703
|
+
refs: m,
|
|
704
|
+
nodeId: c,
|
|
705
|
+
onOpenChange: l,
|
|
706
|
+
events: p,
|
|
707
|
+
dataRef: w,
|
|
708
|
+
elements: {
|
|
709
|
+
domReference: b,
|
|
710
|
+
floating: d
|
|
711
|
+
}
|
|
712
|
+
} = t, g = kt(r), I = we(), E = Ze(), [F, k] = s.useState(null), O = typeof i == "number" && i < 0, V = s.useRef(null), W = s.useRef(null), K = s.useRef(!1), T = s.useRef(null), D = s.useRef(!1), A = E != null, S = b && b.getAttribute("role") === "combobox" && _e(b), L = s.useCallback(function(h) {
|
|
713
|
+
return h === void 0 && (h = d), h ? ue(h, ae()) : [];
|
|
714
|
+
}, [d]), C = s.useCallback((h) => {
|
|
715
|
+
const R = L(h);
|
|
716
|
+
return g.current.map((y) => b && y === "reference" ? b : d && y === "floating" ? d : R).filter(Boolean).flat();
|
|
717
|
+
}, [b, d, g, L]);
|
|
718
|
+
s.useEffect(() => {
|
|
719
|
+
if (!a)
|
|
720
|
+
return;
|
|
721
|
+
function h(y) {
|
|
722
|
+
if (y.key === "Tab") {
|
|
723
|
+
L().length === 0 && !S && pe(y);
|
|
724
|
+
const x = C(), M = Ue(y);
|
|
725
|
+
g.current[0] === "reference" && M === b && (pe(y), y.shiftKey ? j(x[x.length - 1]) : j(x[1])), g.current[1] === "floating" && M === d && y.shiftKey && (pe(y), j(x[0]));
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
const R = G(d);
|
|
729
|
+
return R.addEventListener("keydown", h), () => {
|
|
730
|
+
R.removeEventListener("keydown", h);
|
|
731
|
+
};
|
|
732
|
+
}, [b, d, a, g, m, S, L, C]), s.useEffect(() => {
|
|
733
|
+
if (!v)
|
|
734
|
+
return;
|
|
735
|
+
function h() {
|
|
736
|
+
D.current = !0, setTimeout(() => {
|
|
737
|
+
D.current = !1;
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
function R(y) {
|
|
741
|
+
const x = y.relatedTarget, M = !($(b, x) || $(d, x) || $(x, d) || $(E == null ? void 0 : E.portalNode, x) || x != null && x.hasAttribute("data-floating-ui-focus-guard") || I && (ne(I.nodesRef.current, c).find((P) => {
|
|
742
|
+
var N, B;
|
|
743
|
+
return $((N = P.context) == null ? void 0 : N.elements.floating, x) || $((B = P.context) == null ? void 0 : B.elements.domReference, x);
|
|
744
|
+
}) || Lt(I.nodesRef.current, c).find((P) => {
|
|
745
|
+
var N, B;
|
|
746
|
+
return ((N = P.context) == null ? void 0 : N.elements.floating) === x || ((B = P.context) == null ? void 0 : B.elements.domReference) === x;
|
|
747
|
+
})));
|
|
748
|
+
x && M && !D.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
749
|
+
x !== T.current && (K.current = !0, setTimeout(() => l(!1)));
|
|
750
|
+
}
|
|
751
|
+
if (d && Z(b))
|
|
752
|
+
return b.addEventListener("focusout", R), b.addEventListener("pointerdown", h), !a && d.addEventListener("focusout", R), () => {
|
|
753
|
+
b.removeEventListener("focusout", R), b.removeEventListener("pointerdown", h), !a && d.removeEventListener("focusout", R);
|
|
754
|
+
};
|
|
755
|
+
}, [b, d, a, c, I, E, l, v]), s.useEffect(() => {
|
|
756
|
+
var h;
|
|
757
|
+
const R = Array.from((E == null || (h = E.portalNode) == null ? void 0 : h.querySelectorAll("[data-floating-ui-portal]")) || []);
|
|
758
|
+
function y() {
|
|
759
|
+
return [V.current, W.current].filter(Boolean);
|
|
760
|
+
}
|
|
761
|
+
if (d && a) {
|
|
762
|
+
const x = [d, ...R, ...y()], M = ot(g.current.includes("reference") || S ? x.concat(b || []) : x);
|
|
763
|
+
return () => {
|
|
764
|
+
M();
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
}, [b, d, a, g, E, S]), s.useEffect(() => {
|
|
768
|
+
if (a && !o && d) {
|
|
769
|
+
const h = [], R = ae(), y = ue(G(d).body, R), x = C(), M = y.filter((P) => !x.includes(P));
|
|
770
|
+
return M.forEach((P, N) => {
|
|
771
|
+
h[N] = P.getAttribute("tabindex"), P.setAttribute("tabindex", "-1");
|
|
772
|
+
}), () => {
|
|
773
|
+
M.forEach((P, N) => {
|
|
774
|
+
const B = h[N];
|
|
775
|
+
B == null ? P.removeAttribute("tabindex") : P.setAttribute("tabindex", B);
|
|
776
|
+
});
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
}, [d, a, o, C]), q(() => {
|
|
780
|
+
if (!d) return;
|
|
781
|
+
const h = G(d);
|
|
782
|
+
let R = u, y = !1;
|
|
783
|
+
const x = Ee(h), M = w.current;
|
|
784
|
+
T.current = x;
|
|
785
|
+
const P = C(d), N = (typeof i == "number" ? P[i] : i.current) || d;
|
|
786
|
+
!O && j(N, {
|
|
787
|
+
preventScroll: N === d
|
|
788
|
+
});
|
|
789
|
+
function B(_) {
|
|
790
|
+
if (_.type === "escapeKey" && m.domReference.current && (T.current = m.domReference.current), ["referencePress", "escapeKey"].includes(_.type))
|
|
791
|
+
return;
|
|
792
|
+
const ce = _.data.returnFocus;
|
|
793
|
+
typeof ce == "object" ? (R = !0, y = ce.preventScroll) : R = ce;
|
|
794
|
+
}
|
|
795
|
+
return p.on("dismiss", B), () => {
|
|
796
|
+
if (p.off("dismiss", B), $(d, Ee(h)) && m.domReference.current && (T.current = m.domReference.current), R && Z(T.current) && !K.current)
|
|
797
|
+
if (!m.domReference.current || D.current)
|
|
798
|
+
j(T.current, {
|
|
799
|
+
// When dismissing nested floating elements, by the time the rAF has
|
|
800
|
+
// executed, the menus will all have been unmounted. When they try
|
|
801
|
+
// to get focused, the calls get ignored — leaving the root
|
|
802
|
+
// reference focused as desired.
|
|
803
|
+
cancelPrevious: !1,
|
|
804
|
+
preventScroll: y
|
|
805
|
+
});
|
|
806
|
+
else {
|
|
807
|
+
var _;
|
|
808
|
+
M.__syncReturnFocus = !0, (_ = T.current) == null || _.focus({
|
|
809
|
+
preventScroll: y
|
|
810
|
+
}), setTimeout(() => {
|
|
811
|
+
delete M.__syncReturnFocus;
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
}, [d, C, i, u, w, m, p, O]), q(() => {
|
|
816
|
+
if (E)
|
|
817
|
+
return E.setFocusManagerState({
|
|
818
|
+
...t,
|
|
819
|
+
modal: a,
|
|
820
|
+
closeOnFocusOut: v
|
|
821
|
+
// Not concerned about the <RT> generic type.
|
|
822
|
+
}), () => {
|
|
823
|
+
E.setFocusManagerState(null);
|
|
824
|
+
};
|
|
825
|
+
}, [E, a, v, t]), q(() => {
|
|
826
|
+
if (O || !d) return;
|
|
827
|
+
function h() {
|
|
828
|
+
k(L().length);
|
|
829
|
+
}
|
|
830
|
+
if (h(), typeof MutationObserver == "function") {
|
|
831
|
+
const R = new MutationObserver(h);
|
|
832
|
+
return R.observe(d, {
|
|
833
|
+
childList: !0,
|
|
834
|
+
subtree: !0
|
|
835
|
+
}), () => {
|
|
836
|
+
R.disconnect();
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
}, [d, L, O, m]);
|
|
840
|
+
const J = o && (A || a) && !S;
|
|
841
|
+
function U(h) {
|
|
842
|
+
return f && a ? /* @__PURE__ */ s.createElement(Ht, {
|
|
843
|
+
ref: h === "start" ? V : W,
|
|
844
|
+
onClick: () => l(!1)
|
|
845
|
+
}, typeof f == "string" ? f : "Dismiss") : null;
|
|
846
|
+
}
|
|
847
|
+
return /* @__PURE__ */ s.createElement(s.Fragment, null, J && /* @__PURE__ */ s.createElement(le, {
|
|
848
|
+
ref: E == null ? void 0 : E.beforeInsideRef,
|
|
849
|
+
onFocus: (h) => {
|
|
850
|
+
if (a) {
|
|
851
|
+
const y = C();
|
|
852
|
+
j(r[0] === "reference" ? y[0] : y[y.length - 1]);
|
|
853
|
+
} else if (E != null && E.preserveTabOrder && E.portalNode)
|
|
854
|
+
if (K.current = !1, Y(h, E.portalNode)) {
|
|
855
|
+
const y = Ge() || b;
|
|
856
|
+
y == null || y.focus();
|
|
857
|
+
} else {
|
|
858
|
+
var R;
|
|
859
|
+
(R = E.beforeOutsideRef.current) == null || R.focus();
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}), S ? null : U("start"), /* @__PURE__ */ s.cloneElement(n, F === 0 || r.includes("floating") ? {
|
|
863
|
+
tabIndex: 0
|
|
864
|
+
} : {}), U("end"), J && /* @__PURE__ */ s.createElement(le, {
|
|
865
|
+
ref: E == null ? void 0 : E.afterInsideRef,
|
|
866
|
+
onFocus: (h) => {
|
|
867
|
+
if (a)
|
|
868
|
+
j(C()[0]);
|
|
869
|
+
else if (E != null && E.preserveTabOrder && E.portalNode)
|
|
870
|
+
if (K.current = !0, Y(h, E.portalNode)) {
|
|
871
|
+
const y = Ye() || b;
|
|
872
|
+
y == null || y.focus();
|
|
873
|
+
} else {
|
|
874
|
+
var R;
|
|
875
|
+
(R = E.afterOutsideRef.current) == null || R.focus();
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}));
|
|
879
|
+
}
|
|
880
|
+
function ke(e) {
|
|
881
|
+
return Z(e.target) && e.target.tagName === "BUTTON";
|
|
882
|
+
}
|
|
883
|
+
function Le(e) {
|
|
884
|
+
return _e(e);
|
|
885
|
+
}
|
|
886
|
+
const Qt = function(e, t) {
|
|
887
|
+
let {
|
|
888
|
+
open: n,
|
|
889
|
+
onOpenChange: r,
|
|
890
|
+
dataRef: o,
|
|
891
|
+
refs: i
|
|
892
|
+
} = e, {
|
|
893
|
+
enabled: u = !0,
|
|
894
|
+
event: a = "click",
|
|
895
|
+
toggle: f = !0,
|
|
896
|
+
ignoreMouse: v = !1,
|
|
897
|
+
keyboardHandlers: m = !0
|
|
898
|
+
} = t === void 0 ? {} : t;
|
|
899
|
+
const c = s.useRef();
|
|
900
|
+
return s.useMemo(() => u ? {
|
|
901
|
+
reference: {
|
|
902
|
+
onPointerDown(l) {
|
|
903
|
+
c.current = l.pointerType;
|
|
904
|
+
},
|
|
905
|
+
onMouseDown(l) {
|
|
906
|
+
l.button === 0 && (De(c.current) && v || a !== "click" && (n ? f && (!o.current.openEvent || o.current.openEvent.type === "mousedown") && r(!1) : (l.preventDefault(), r(!0)), o.current.openEvent = l.nativeEvent));
|
|
907
|
+
},
|
|
908
|
+
onClick(l) {
|
|
909
|
+
if (!o.current.__syncReturnFocus) {
|
|
910
|
+
if (a === "mousedown" && c.current) {
|
|
911
|
+
c.current = void 0;
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
De(c.current) && v || (n ? f && (!o.current.openEvent || o.current.openEvent.type === "click") && r(!1) : r(!0), o.current.openEvent = l.nativeEvent);
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
onKeyDown(l) {
|
|
918
|
+
c.current = void 0, m && (ke(l) || (l.key === " " && !Le(i.domReference.current) && l.preventDefault(), l.key === "Enter" && (n ? f && r(!1) : r(!0))));
|
|
919
|
+
},
|
|
920
|
+
onKeyUp(l) {
|
|
921
|
+
m && (ke(l) || Le(i.domReference.current) || l.key === " " && (n ? f && r(!1) : r(!0)));
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
} : {}, [u, o, a, v, m, i, f, n, r]);
|
|
925
|
+
};
|
|
926
|
+
function be(e, t) {
|
|
927
|
+
if (t == null)
|
|
928
|
+
return !1;
|
|
929
|
+
if ("composedPath" in e)
|
|
930
|
+
return e.composedPath().includes(t);
|
|
931
|
+
const n = e;
|
|
932
|
+
return n.target != null && t.contains(n.target);
|
|
933
|
+
}
|
|
934
|
+
const Ut = {
|
|
935
|
+
pointerdown: "onPointerDown",
|
|
936
|
+
mousedown: "onMouseDown",
|
|
937
|
+
click: "onClick"
|
|
938
|
+
}, _t = {
|
|
939
|
+
pointerdown: "onPointerDownCapture",
|
|
940
|
+
mousedown: "onMouseDownCapture",
|
|
941
|
+
click: "onClickCapture"
|
|
942
|
+
}, zt = function(e) {
|
|
943
|
+
var t, n;
|
|
944
|
+
return e === void 0 && (e = !0), {
|
|
945
|
+
escapeKeyBubbles: typeof e == "boolean" ? e : (t = e.escapeKey) != null ? t : !0,
|
|
946
|
+
outsidePressBubbles: typeof e == "boolean" ? e : (n = e.outsidePress) != null ? n : !0
|
|
947
|
+
};
|
|
948
|
+
}, en = function(e, t) {
|
|
949
|
+
let {
|
|
950
|
+
open: n,
|
|
951
|
+
onOpenChange: r,
|
|
952
|
+
events: o,
|
|
953
|
+
nodeId: i,
|
|
954
|
+
elements: {
|
|
955
|
+
reference: u,
|
|
956
|
+
domReference: a,
|
|
957
|
+
floating: f
|
|
958
|
+
}
|
|
959
|
+
} = e, {
|
|
960
|
+
enabled: v = !0,
|
|
961
|
+
escapeKey: m = !0,
|
|
962
|
+
outsidePress: c = !0,
|
|
963
|
+
outsidePressEvent: l = "pointerdown",
|
|
964
|
+
referencePress: p = !1,
|
|
965
|
+
referencePressEvent: w = "pointerdown",
|
|
966
|
+
ancestorScroll: b = !1,
|
|
967
|
+
bubbles: d = !0
|
|
968
|
+
} = {};
|
|
969
|
+
const g = we(), I = Pt() != null, E = xe(typeof c == "function" ? c : () => !1), F = typeof c == "function" ? E : c, k = s.useRef(!1), {
|
|
970
|
+
escapeKeyBubbles: O,
|
|
971
|
+
outsidePressBubbles: V
|
|
972
|
+
} = zt(d);
|
|
973
|
+
return s.useEffect(() => {
|
|
974
|
+
if (!n || !v)
|
|
975
|
+
return;
|
|
976
|
+
function W(S) {
|
|
977
|
+
if (S.key === "Escape") {
|
|
978
|
+
if (!O && g && ne(g.nodesRef.current, i).length > 0)
|
|
979
|
+
return;
|
|
980
|
+
o.emit("dismiss", {
|
|
981
|
+
type: "escapeKey",
|
|
982
|
+
data: {
|
|
983
|
+
returnFocus: {
|
|
984
|
+
preventScroll: !1
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
}), r(!1);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
function K(S) {
|
|
991
|
+
const L = k.current;
|
|
992
|
+
if (k.current = !1, L || typeof F == "function" && !F(S))
|
|
993
|
+
return;
|
|
994
|
+
const C = Ue(S);
|
|
995
|
+
if (Z(C) && f) {
|
|
996
|
+
const U = f.ownerDocument.defaultView || window, h = C.scrollWidth > C.clientWidth, R = C.scrollHeight > C.clientHeight;
|
|
997
|
+
let y = R && S.offsetX > C.clientWidth;
|
|
998
|
+
if (R && U.getComputedStyle(C).direction === "rtl" && (y = S.offsetX <= C.offsetWidth - C.clientWidth), y || h && S.offsetY > C.clientHeight)
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
const J = g && ne(g.nodesRef.current, i).some((U) => {
|
|
1002
|
+
var h;
|
|
1003
|
+
return be(S, (h = U.context) == null ? void 0 : h.elements.floating);
|
|
1004
|
+
});
|
|
1005
|
+
be(S, f) || be(S, a) || J || !V && g && ne(g.nodesRef.current, i).length > 0 || (o.emit("dismiss", {
|
|
1006
|
+
type: "outsidePress",
|
|
1007
|
+
data: {
|
|
1008
|
+
returnFocus: I ? {
|
|
1009
|
+
preventScroll: !0
|
|
1010
|
+
} : Dt(S) || Mt(S)
|
|
1011
|
+
}
|
|
1012
|
+
}), r(!1));
|
|
1013
|
+
}
|
|
1014
|
+
function T() {
|
|
1015
|
+
r(!1);
|
|
1016
|
+
}
|
|
1017
|
+
const D = G(f);
|
|
1018
|
+
m && D.addEventListener("keydown", W), F && D.addEventListener(l, K);
|
|
1019
|
+
let A = [];
|
|
1020
|
+
return b && (H(a) && (A = fe(a)), H(f) && (A = A.concat(fe(f))), !H(u) && u && u.contextElement && (A = A.concat(fe(u.contextElement)))), A = A.filter((S) => {
|
|
1021
|
+
var L;
|
|
1022
|
+
return S !== ((L = D.defaultView) == null ? void 0 : L.visualViewport);
|
|
1023
|
+
}), A.forEach((S) => {
|
|
1024
|
+
S.addEventListener("scroll", T, {
|
|
1025
|
+
passive: !0
|
|
1026
|
+
});
|
|
1027
|
+
}), () => {
|
|
1028
|
+
m && D.removeEventListener("keydown", W), F && D.removeEventListener(l, K), A.forEach((S) => {
|
|
1029
|
+
S.removeEventListener("scroll", T);
|
|
1030
|
+
});
|
|
1031
|
+
};
|
|
1032
|
+
}, [f, a, u, m, F, l, o, g, i, n, r, b, v, O, V, I]), s.useEffect(() => {
|
|
1033
|
+
k.current = !1;
|
|
1034
|
+
}, [F, l]), s.useMemo(() => v ? {
|
|
1035
|
+
reference: {
|
|
1036
|
+
[Ut[w]]: () => {
|
|
1037
|
+
p && (o.emit("dismiss", {
|
|
1038
|
+
type: "referencePress",
|
|
1039
|
+
data: {
|
|
1040
|
+
returnFocus: !1
|
|
1041
|
+
}
|
|
1042
|
+
}), r(!1));
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
1045
|
+
floating: {
|
|
1046
|
+
[_t[l]]: () => {
|
|
1047
|
+
k.current = !0;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
} : {}, [v, o, p, l, w, r]);
|
|
1051
|
+
};
|
|
1052
|
+
function tn(e) {
|
|
1053
|
+
return s.useMemo(() => e.every((t) => t == null) ? null : (t) => {
|
|
1054
|
+
e.forEach((n) => {
|
|
1055
|
+
typeof n == "function" ? n(t) : n != null && (n.current = t);
|
|
1056
|
+
});
|
|
1057
|
+
}, e);
|
|
1058
|
+
}
|
|
1059
|
+
const nn = function(e, t) {
|
|
1060
|
+
let {
|
|
1061
|
+
open: n
|
|
1062
|
+
} = e, {
|
|
1063
|
+
enabled: r = !0,
|
|
1064
|
+
role: o = "dialog"
|
|
1065
|
+
} = {};
|
|
1066
|
+
const i = ye(), u = ye();
|
|
1067
|
+
return s.useMemo(() => {
|
|
1068
|
+
const a = {
|
|
1069
|
+
id: i,
|
|
1070
|
+
role: o
|
|
1071
|
+
};
|
|
1072
|
+
return r ? o === "tooltip" ? {
|
|
1073
|
+
reference: {
|
|
1074
|
+
"aria-describedby": n ? i : void 0
|
|
1075
|
+
},
|
|
1076
|
+
floating: a
|
|
1077
|
+
} : {
|
|
1078
|
+
reference: {
|
|
1079
|
+
"aria-expanded": n ? "true" : "false",
|
|
1080
|
+
"aria-haspopup": o === "alertdialog" ? "dialog" : o,
|
|
1081
|
+
"aria-controls": n ? i : void 0,
|
|
1082
|
+
...o === "listbox" && {
|
|
1083
|
+
role: "combobox"
|
|
1084
|
+
},
|
|
1085
|
+
...o === "menu" && {
|
|
1086
|
+
id: u
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
floating: {
|
|
1090
|
+
...a,
|
|
1091
|
+
...o === "menu" && {
|
|
1092
|
+
"aria-labelledby": u
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
} : {};
|
|
1096
|
+
}, [r, o, n, i, u]);
|
|
1097
|
+
};
|
|
1098
|
+
function rn(e) {
|
|
1099
|
+
e === void 0 && (e = {});
|
|
1100
|
+
const {
|
|
1101
|
+
open: t = !1,
|
|
1102
|
+
onOpenChange: n,
|
|
1103
|
+
nodeId: r
|
|
1104
|
+
} = e, o = et(e), i = we(), u = s.useRef(null), a = s.useRef({}), f = s.useState(() => Ct())[0], [v, m] = s.useState(null), c = s.useCallback((g) => {
|
|
1105
|
+
const I = H(g) ? {
|
|
1106
|
+
getBoundingClientRect: () => g.getBoundingClientRect(),
|
|
1107
|
+
contextElement: g
|
|
1108
|
+
} : g;
|
|
1109
|
+
o.refs.setReference(I);
|
|
1110
|
+
}, [o.refs]), l = s.useCallback((g) => {
|
|
1111
|
+
(H(g) || g === null) && (u.current = g, m(g)), (H(o.refs.reference.current) || o.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
1112
|
+
// `null` to support `positionReference` + an unstable `reference`
|
|
1113
|
+
// callback ref.
|
|
1114
|
+
g !== null && !H(g)) && o.refs.setReference(g);
|
|
1115
|
+
}, [o.refs]), p = s.useMemo(() => ({
|
|
1116
|
+
...o.refs,
|
|
1117
|
+
setReference: l,
|
|
1118
|
+
setPositionReference: c,
|
|
1119
|
+
domReference: u
|
|
1120
|
+
}), [o.refs, l, c]), w = s.useMemo(() => ({
|
|
1121
|
+
...o.elements,
|
|
1122
|
+
domReference: v
|
|
1123
|
+
}), [o.elements, v]), b = xe(n), d = s.useMemo(() => ({
|
|
1124
|
+
...o,
|
|
1125
|
+
refs: p,
|
|
1126
|
+
elements: w,
|
|
1127
|
+
dataRef: a,
|
|
1128
|
+
nodeId: r,
|
|
1129
|
+
events: f,
|
|
1130
|
+
open: t,
|
|
1131
|
+
onOpenChange: b
|
|
1132
|
+
}), [o, r, f, t, b, p, w]);
|
|
1133
|
+
return q(() => {
|
|
1134
|
+
const g = i == null ? void 0 : i.nodesRef.current.find((I) => I.id === r);
|
|
1135
|
+
g && (g.context = d);
|
|
1136
|
+
}), s.useMemo(() => ({
|
|
1137
|
+
...o,
|
|
1138
|
+
context: d,
|
|
1139
|
+
refs: p,
|
|
1140
|
+
reference: l,
|
|
1141
|
+
positionReference: c
|
|
1142
|
+
}), [o, p, d, l, c]);
|
|
1143
|
+
}
|
|
1144
|
+
function me(e, t, n) {
|
|
1145
|
+
const r = /* @__PURE__ */ new Map();
|
|
1146
|
+
return {
|
|
1147
|
+
...n === "floating" && {
|
|
1148
|
+
tabIndex: -1
|
|
1149
|
+
},
|
|
1150
|
+
...e,
|
|
1151
|
+
...t.map((o) => o ? o[n] : null).concat(e).reduce((o, i) => (i && Object.entries(i).forEach((u) => {
|
|
1152
|
+
let [a, f] = u;
|
|
1153
|
+
if (a.indexOf("on") === 0) {
|
|
1154
|
+
if (r.has(a) || r.set(a, []), typeof f == "function") {
|
|
1155
|
+
var v;
|
|
1156
|
+
(v = r.get(a)) == null || v.push(f), o[a] = function() {
|
|
1157
|
+
for (var m, c = arguments.length, l = new Array(c), p = 0; p < c; p++)
|
|
1158
|
+
l[p] = arguments[p];
|
|
1159
|
+
(m = r.get(a)) == null || m.forEach((w) => w(...l));
|
|
1160
|
+
};
|
|
1161
|
+
}
|
|
1162
|
+
} else
|
|
1163
|
+
o[a] = f;
|
|
1164
|
+
}), o), {})
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
const on = function(e) {
|
|
1168
|
+
e === void 0 && (e = []);
|
|
1169
|
+
const t = e, n = s.useCallback(
|
|
1170
|
+
(i) => me(i, e, "reference"),
|
|
1171
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1172
|
+
t
|
|
1173
|
+
), r = s.useCallback(
|
|
1174
|
+
(i) => me(i, e, "floating"),
|
|
1175
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1176
|
+
t
|
|
1177
|
+
), o = s.useCallback(
|
|
1178
|
+
(i) => me(i, e, "item"),
|
|
1179
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1180
|
+
t
|
|
1181
|
+
);
|
|
1182
|
+
return s.useMemo(() => ({
|
|
1183
|
+
getReferenceProps: n,
|
|
1184
|
+
getFloatingProps: r,
|
|
1185
|
+
getItemProps: o
|
|
1186
|
+
}), [n, r, o]);
|
|
1187
|
+
};
|
|
1188
|
+
export {
|
|
1189
|
+
Zt as F,
|
|
1190
|
+
tn as a,
|
|
1191
|
+
Jt as b,
|
|
1192
|
+
rn as c,
|
|
1193
|
+
Qt as d,
|
|
1194
|
+
en as e,
|
|
1195
|
+
nn as f,
|
|
1196
|
+
on as g,
|
|
1197
|
+
ye as u
|
|
1198
|
+
};
|