@pittorica/popover-react 0.25.0 → 0.26.0
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/Popover.d.ts +11 -17
- package/dist/Popover.d.ts.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +717 -669
- package/package.json +12 -11
- package/dist/Popover.stories.d.ts +0 -8
- package/dist/Popover.stories.d.ts.map +0 -1
- package/dist/Popover.test.d.ts +0 -5
- package/dist/Popover.test.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { useLayoutEffect as
|
|
4
|
-
import * as
|
|
5
|
-
function
|
|
1
|
+
import { jsxs as Qt, jsx as H } from "react/jsx-runtime";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import { useLayoutEffect as _e, createContext as en, useState as vt, useMemo as tn, use as nn, useEffect as on } from "react";
|
|
4
|
+
import * as bt from "react-dom";
|
|
5
|
+
function yt(e) {
|
|
6
6
|
var t, n, o = "";
|
|
7
7
|
if (typeof e == "string" || typeof e == "number") o += e;
|
|
8
8
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
9
9
|
var r = e.length;
|
|
10
|
-
for (t = 0; t < r; t++) e[t] && (n =
|
|
10
|
+
for (t = 0; t < r; t++) e[t] && (n = yt(e[t])) && (o && (o += " "), o += n);
|
|
11
11
|
} else for (n in e) e[n] && (o && (o += " "), o += n);
|
|
12
12
|
return o;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
for (var e, t, n = 0, o = "", r = arguments.length; n < r; n++) (e = arguments[n]) && (t =
|
|
14
|
+
function rn() {
|
|
15
|
+
for (var e, t, n = 0, o = "", r = arguments.length; n < r; n++) (e = arguments[n]) && (t = yt(e)) && (o && (o += " "), o += t);
|
|
16
16
|
return o;
|
|
17
17
|
}
|
|
18
18
|
function we() {
|
|
19
19
|
return typeof window < "u";
|
|
20
20
|
}
|
|
21
21
|
function re(e) {
|
|
22
|
-
return
|
|
22
|
+
return Ve(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function $(e) {
|
|
25
25
|
var t;
|
|
26
26
|
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function j(e) {
|
|
29
29
|
var t;
|
|
30
|
-
return (t = (
|
|
30
|
+
return (t = (Ve(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return we() ? e instanceof Node || e instanceof
|
|
32
|
+
function Ve(e) {
|
|
33
|
+
return we() ? e instanceof Node || e instanceof $(e).Node : !1;
|
|
34
34
|
}
|
|
35
35
|
function D(e) {
|
|
36
|
-
return we() ? e instanceof Element || e instanceof
|
|
36
|
+
return we() ? e instanceof Element || e instanceof $(e).Element : !1;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return we() ? e instanceof HTMLElement || e instanceof
|
|
38
|
+
function N(e) {
|
|
39
|
+
return we() ? e instanceof HTMLElement || e instanceof $(e).HTMLElement : !1;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return !we() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof
|
|
41
|
+
function Le(e) {
|
|
42
|
+
return !we() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof $(e).ShadowRoot;
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const sn = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
45
45
|
function le(e) {
|
|
46
46
|
const {
|
|
47
47
|
overflow: t,
|
|
48
48
|
overflowX: n,
|
|
49
49
|
overflowY: o,
|
|
50
50
|
display: r
|
|
51
|
-
} =
|
|
52
|
-
return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !
|
|
51
|
+
} = W(e);
|
|
52
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !sn.has(r);
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
function
|
|
56
|
-
return
|
|
54
|
+
const cn = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
55
|
+
function an(e) {
|
|
56
|
+
return cn.has(re(e));
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const ln = [":popover-open", ":modal"];
|
|
59
59
|
function xe(e) {
|
|
60
|
-
return
|
|
60
|
+
return ln.some((t) => {
|
|
61
61
|
try {
|
|
62
62
|
return e.matches(t);
|
|
63
63
|
} catch {
|
|
@@ -65,31 +65,31 @@ function xe(e) {
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
const
|
|
69
|
-
function
|
|
70
|
-
const t = Re(), n = D(e) ?
|
|
71
|
-
return
|
|
68
|
+
const un = ["transform", "translate", "scale", "rotate", "perspective"], fn = ["transform", "translate", "scale", "rotate", "perspective", "filter"], dn = ["paint", "layout", "strict", "content"];
|
|
69
|
+
function We(e) {
|
|
70
|
+
const t = Re(), n = D(e) ? W(e) : e;
|
|
71
|
+
return un.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || fn.some((o) => (n.willChange || "").includes(o)) || dn.some((o) => (n.contain || "").includes(o));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
let t =
|
|
75
|
-
for (;
|
|
76
|
-
if (
|
|
73
|
+
function pn(e) {
|
|
74
|
+
let t = Y(e);
|
|
75
|
+
for (; N(t) && !U(t); ) {
|
|
76
|
+
if (We(t))
|
|
77
77
|
return t;
|
|
78
78
|
if (xe(t))
|
|
79
79
|
return null;
|
|
80
|
-
t =
|
|
80
|
+
t = Y(t);
|
|
81
81
|
}
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
84
|
function Re() {
|
|
85
85
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
86
86
|
}
|
|
87
|
-
const
|
|
88
|
-
function
|
|
89
|
-
return
|
|
87
|
+
const mn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
88
|
+
function U(e) {
|
|
89
|
+
return mn.has(re(e));
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
return
|
|
91
|
+
function W(e) {
|
|
92
|
+
return $(e).getComputedStyle(e);
|
|
93
93
|
}
|
|
94
94
|
function Ee(e) {
|
|
95
95
|
return D(e) ? {
|
|
@@ -100,48 +100,48 @@ function Ee(e) {
|
|
|
100
100
|
scrollTop: e.scrollY
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function Y(e) {
|
|
104
104
|
if (re(e) === "html")
|
|
105
105
|
return e;
|
|
106
106
|
const t = (
|
|
107
107
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
108
108
|
e.assignedSlot || // DOM Element detected.
|
|
109
109
|
e.parentNode || // ShadowRoot detected.
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
Le(e) && e.host || // Fallback.
|
|
111
|
+
j(e)
|
|
112
112
|
);
|
|
113
|
-
return
|
|
113
|
+
return Le(t) ? t.host : t;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
const t =
|
|
117
|
-
return
|
|
115
|
+
function wt(e) {
|
|
116
|
+
const t = Y(e);
|
|
117
|
+
return U(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : N(t) && le(t) ? t : wt(t);
|
|
118
118
|
}
|
|
119
119
|
function Z(e, t, n) {
|
|
120
120
|
var o;
|
|
121
121
|
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
122
|
-
const r =
|
|
122
|
+
const r = wt(e), i = r === ((o = e.ownerDocument) == null ? void 0 : o.body), s = $(r);
|
|
123
123
|
if (i) {
|
|
124
|
-
const c =
|
|
124
|
+
const c = Me(s);
|
|
125
125
|
return t.concat(s, s.visualViewport || [], le(r) ? r : [], c && n ? Z(c) : []);
|
|
126
126
|
}
|
|
127
127
|
return t.concat(r, Z(r, [], n));
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function Me(e) {
|
|
130
130
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
131
131
|
}
|
|
132
|
-
const pe = Math.min, J = Math.max,
|
|
132
|
+
const pe = Math.min, J = Math.max, me = Math.round, ue = Math.floor, K = (e) => ({
|
|
133
133
|
x: e,
|
|
134
134
|
y: e
|
|
135
|
-
}),
|
|
135
|
+
}), gn = {
|
|
136
136
|
left: "right",
|
|
137
137
|
right: "left",
|
|
138
138
|
bottom: "top",
|
|
139
139
|
top: "bottom"
|
|
140
|
-
},
|
|
140
|
+
}, hn = {
|
|
141
141
|
start: "end",
|
|
142
142
|
end: "start"
|
|
143
143
|
};
|
|
144
|
-
function
|
|
144
|
+
function Xe(e, t, n) {
|
|
145
145
|
return J(e, pe(t, n));
|
|
146
146
|
}
|
|
147
147
|
function Se(e, t) {
|
|
@@ -153,54 +153,54 @@ function ee(e) {
|
|
|
153
153
|
function Ce(e) {
|
|
154
154
|
return e.split("-")[1];
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function xt(e) {
|
|
157
157
|
return e === "x" ? "y" : "x";
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function Rt(e) {
|
|
160
160
|
return e === "y" ? "height" : "width";
|
|
161
161
|
}
|
|
162
|
-
const
|
|
162
|
+
const vn = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
163
163
|
function G(e) {
|
|
164
|
-
return
|
|
164
|
+
return vn.has(ee(e)) ? "y" : "x";
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
return
|
|
166
|
+
function Et(e) {
|
|
167
|
+
return xt(G(e));
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function bn(e, t, n) {
|
|
170
170
|
n === void 0 && (n = !1);
|
|
171
|
-
const o = Ce(e), r =
|
|
171
|
+
const o = Ce(e), r = Et(e), i = Rt(r);
|
|
172
172
|
let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
173
|
-
return t.reference[i] > t.floating[i] && (s =
|
|
173
|
+
return t.reference[i] > t.floating[i] && (s = ge(s)), [s, ge(s)];
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
const t =
|
|
175
|
+
function yn(e) {
|
|
176
|
+
const t = ge(e);
|
|
177
177
|
return [ke(e), t, ke(t)];
|
|
178
178
|
}
|
|
179
179
|
function ke(e) {
|
|
180
|
-
return e.replace(/start|end/g, (t) =>
|
|
180
|
+
return e.replace(/start|end/g, (t) => hn[t]);
|
|
181
181
|
}
|
|
182
|
-
const
|
|
183
|
-
function
|
|
182
|
+
const ze = ["left", "right"], Ge = ["right", "left"], wn = ["top", "bottom"], xn = ["bottom", "top"];
|
|
183
|
+
function Rn(e, t, n) {
|
|
184
184
|
switch (e) {
|
|
185
185
|
case "top":
|
|
186
186
|
case "bottom":
|
|
187
|
-
return n ? t ?
|
|
187
|
+
return n ? t ? Ge : ze : t ? ze : Ge;
|
|
188
188
|
case "left":
|
|
189
189
|
case "right":
|
|
190
|
-
return t ?
|
|
190
|
+
return t ? wn : xn;
|
|
191
191
|
default:
|
|
192
192
|
return [];
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function En(e, t, n, o) {
|
|
196
196
|
const r = Ce(e);
|
|
197
|
-
let i =
|
|
197
|
+
let i = Rn(ee(e), n === "start", o);
|
|
198
198
|
return r && (i = i.map((s) => s + "-" + r), t && (i = i.concat(i.map(ke)))), i;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
return e.replace(/left|right|bottom|top/g, (t) =>
|
|
200
|
+
function ge(e) {
|
|
201
|
+
return e.replace(/left|right|bottom|top/g, (t) => gn[t]);
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function Sn(e) {
|
|
204
204
|
return {
|
|
205
205
|
top: 0,
|
|
206
206
|
right: 0,
|
|
@@ -209,8 +209,8 @@ function Rn(e) {
|
|
|
209
209
|
...e
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
return typeof e != "number" ?
|
|
212
|
+
function Cn(e) {
|
|
213
|
+
return typeof e != "number" ? Sn(e) : {
|
|
214
214
|
top: e,
|
|
215
215
|
right: e,
|
|
216
216
|
bottom: e,
|
|
@@ -239,8 +239,8 @@ function he(e) {
|
|
|
239
239
|
* tabbable 6.4.0
|
|
240
240
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
241
241
|
*/
|
|
242
|
-
var
|
|
243
|
-
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, ve = !
|
|
242
|
+
var Tn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], Ne = /* @__PURE__ */ Tn.join(","), St = typeof Element > "u", ce = St ? function() {
|
|
243
|
+
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, ve = !St && Element.prototype.getRootNode ? function(e) {
|
|
244
244
|
var t;
|
|
245
245
|
return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
|
|
246
246
|
} : function(e) {
|
|
@@ -252,10 +252,10 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
252
252
|
// lookup upward, in case it is not defined.
|
|
253
253
|
(typeof t.closest == "function" ? t.closest("[inert]") : be(t.parentNode));
|
|
254
254
|
return s;
|
|
255
|
-
},
|
|
255
|
+
}, An = function(t) {
|
|
256
256
|
var n, o = t == null || (n = t.getAttribute) === null || n === void 0 ? void 0 : n.call(t, "contenteditable");
|
|
257
257
|
return o === "" || o === "true";
|
|
258
|
-
},
|
|
258
|
+
}, On = function(t, n, o) {
|
|
259
259
|
if (be(t))
|
|
260
260
|
return [];
|
|
261
261
|
var r = Array.prototype.slice.apply(t.querySelectorAll(Ne));
|
|
@@ -274,8 +274,8 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
274
274
|
var u = ce.call(s, Ne);
|
|
275
275
|
u && o.filter(s) && (n || !t.includes(s)) && r.push(s);
|
|
276
276
|
var f = s.shadowRoot || // check for an undisclosed shadow
|
|
277
|
-
typeof o.getShadowRoot == "function" && o.getShadowRoot(s),
|
|
278
|
-
if (f &&
|
|
277
|
+
typeof o.getShadowRoot == "function" && o.getShadowRoot(s), m = !be(f, !1) && (!o.shadowRootFilter || o.shadowRootFilter(s));
|
|
278
|
+
if (f && m) {
|
|
279
279
|
var d = Fe(f === !0 ? s.children : f.children, !0, o);
|
|
280
280
|
o.flatten ? r.push.apply(r, d) : r.push({
|
|
281
281
|
scopeParent: s,
|
|
@@ -286,31 +286,31 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
return r;
|
|
289
|
-
},
|
|
289
|
+
}, Ct = function(t) {
|
|
290
290
|
return !isNaN(parseInt(t.getAttribute("tabindex"), 10));
|
|
291
|
-
},
|
|
291
|
+
}, Tt = function(t) {
|
|
292
292
|
if (!t)
|
|
293
293
|
throw new Error("No node provided");
|
|
294
|
-
return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) ||
|
|
295
|
-
},
|
|
296
|
-
var o =
|
|
297
|
-
return o < 0 && n && !
|
|
298
|
-
},
|
|
294
|
+
return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || An(t)) && !Ct(t) ? 0 : t.tabIndex;
|
|
295
|
+
}, Pn = function(t, n) {
|
|
296
|
+
var o = Tt(t);
|
|
297
|
+
return o < 0 && n && !Ct(t) ? 0 : o;
|
|
298
|
+
}, In = function(t, n) {
|
|
299
299
|
return t.tabIndex === n.tabIndex ? t.documentOrder - n.documentOrder : t.tabIndex - n.tabIndex;
|
|
300
|
-
},
|
|
300
|
+
}, At = function(t) {
|
|
301
301
|
return t.tagName === "INPUT";
|
|
302
|
-
},
|
|
303
|
-
return
|
|
304
|
-
},
|
|
302
|
+
}, Dn = function(t) {
|
|
303
|
+
return At(t) && t.type === "hidden";
|
|
304
|
+
}, Ln = function(t) {
|
|
305
305
|
var n = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(o) {
|
|
306
306
|
return o.tagName === "SUMMARY";
|
|
307
307
|
});
|
|
308
308
|
return n;
|
|
309
|
-
},
|
|
309
|
+
}, Mn = function(t, n) {
|
|
310
310
|
for (var o = 0; o < t.length; o++)
|
|
311
311
|
if (t[o].checked && t[o].form === n)
|
|
312
312
|
return t[o];
|
|
313
|
-
},
|
|
313
|
+
}, kn = function(t) {
|
|
314
314
|
if (!t.name)
|
|
315
315
|
return !0;
|
|
316
316
|
var n = t.form || ve(t), o = function(c) {
|
|
@@ -324,13 +324,13 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
324
324
|
} catch (s) {
|
|
325
325
|
return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", s.message), !1;
|
|
326
326
|
}
|
|
327
|
-
var i =
|
|
327
|
+
var i = Mn(r, t.form);
|
|
328
328
|
return !i || i === t;
|
|
329
|
-
}, Ln = function(t) {
|
|
330
|
-
return Ct(t) && t.type === "radio";
|
|
331
|
-
}, kn = function(t) {
|
|
332
|
-
return Ln(t) && !Mn(t);
|
|
333
329
|
}, Nn = function(t) {
|
|
330
|
+
return At(t) && t.type === "radio";
|
|
331
|
+
}, Fn = function(t) {
|
|
332
|
+
return Nn(t) && !kn(t);
|
|
333
|
+
}, $n = function(t) {
|
|
334
334
|
var n, o = t && ve(t), r = (n = o) === null || n === void 0 ? void 0 : n.host, i = !1;
|
|
335
335
|
if (o && o !== t) {
|
|
336
336
|
var s, c, a;
|
|
@@ -340,10 +340,10 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
return i;
|
|
343
|
-
},
|
|
343
|
+
}, Ze = function(t) {
|
|
344
344
|
var n = t.getBoundingClientRect(), o = n.width, r = n.height;
|
|
345
345
|
return o === 0 && r === 0;
|
|
346
|
-
},
|
|
346
|
+
}, Bn = function(t, n) {
|
|
347
347
|
var o = n.displayCheck, r = n.getShadowRoot;
|
|
348
348
|
if (o === "full-native" && "checkVisibility" in t) {
|
|
349
349
|
var i = t.checkVisibility({
|
|
@@ -373,19 +373,19 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
373
373
|
for (var a = t; t; ) {
|
|
374
374
|
var l = t.parentElement, u = ve(t);
|
|
375
375
|
if (l && !l.shadowRoot && r(l) === !0)
|
|
376
|
-
return
|
|
376
|
+
return Ze(t);
|
|
377
377
|
t.assignedSlot ? t = t.assignedSlot : !l && u !== t.ownerDocument ? t = u.host : t = l;
|
|
378
378
|
}
|
|
379
379
|
t = a;
|
|
380
380
|
}
|
|
381
|
-
if (
|
|
381
|
+
if ($n(t))
|
|
382
382
|
return !t.getClientRects().length;
|
|
383
383
|
if (o !== "legacy-full")
|
|
384
384
|
return !0;
|
|
385
385
|
} else if (o === "non-zero-area")
|
|
386
|
-
return
|
|
386
|
+
return Ze(t);
|
|
387
387
|
return !1;
|
|
388
|
-
},
|
|
388
|
+
}, _n = function(t) {
|
|
389
389
|
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
|
|
390
390
|
for (var n = t.parentElement; n; ) {
|
|
391
391
|
if (n.tagName === "FIELDSET" && n.disabled) {
|
|
@@ -399,18 +399,18 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
399
399
|
n = n.parentElement;
|
|
400
400
|
}
|
|
401
401
|
return !1;
|
|
402
|
-
},
|
|
403
|
-
return !(n.disabled ||
|
|
404
|
-
|
|
405
|
-
},
|
|
406
|
-
return !(
|
|
407
|
-
},
|
|
402
|
+
}, Vn = function(t, n) {
|
|
403
|
+
return !(n.disabled || Dn(n) || Bn(n, t) || // For a details element with a summary, the summary element gets the focus
|
|
404
|
+
Ln(n) || _n(n));
|
|
405
|
+
}, Je = function(t, n) {
|
|
406
|
+
return !(Fn(n) || Tt(n) < 0 || !Vn(t, n));
|
|
407
|
+
}, Wn = function(t) {
|
|
408
408
|
var n = parseInt(t.getAttribute("tabindex"), 10);
|
|
409
409
|
return !!(isNaN(n) || n >= 0);
|
|
410
|
-
},
|
|
410
|
+
}, Ot = function(t) {
|
|
411
411
|
var n = [], o = [];
|
|
412
412
|
return t.forEach(function(r, i) {
|
|
413
|
-
var s = !!r.scopeParent, c = s ? r.scopeParent : r, a =
|
|
413
|
+
var s = !!r.scopeParent, c = s ? r.scopeParent : r, a = Pn(c, s), l = s ? Ot(r.candidates) : c;
|
|
414
414
|
a === 0 ? s ? n.push.apply(n, l) : n.push(c) : o.push({
|
|
415
415
|
documentOrder: i,
|
|
416
416
|
tabIndex: a,
|
|
@@ -418,24 +418,24 @@ var Sn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
418
418
|
isScope: s,
|
|
419
419
|
content: l
|
|
420
420
|
});
|
|
421
|
-
}), o.sort(
|
|
421
|
+
}), o.sort(In).reduce(function(r, i) {
|
|
422
422
|
return i.isScope ? r.push.apply(r, i.content) : r.push(i.content), r;
|
|
423
423
|
}, []).concat(n);
|
|
424
|
-
},
|
|
424
|
+
}, Pt = function(t, n) {
|
|
425
425
|
n = n || {};
|
|
426
426
|
var o;
|
|
427
427
|
return n.getShadowRoot ? o = Fe([t], n.includeContainer, {
|
|
428
|
-
filter:
|
|
428
|
+
filter: Je.bind(null, n),
|
|
429
429
|
flatten: !1,
|
|
430
430
|
getShadowRoot: n.getShadowRoot,
|
|
431
|
-
shadowRootFilter:
|
|
432
|
-
}) : o =
|
|
431
|
+
shadowRootFilter: Wn
|
|
432
|
+
}) : o = On(t, n.includeContainer, Je.bind(null, n)), Ot(o);
|
|
433
433
|
};
|
|
434
|
-
function
|
|
434
|
+
function Hn() {
|
|
435
435
|
return /apple/i.test(navigator.vendor);
|
|
436
436
|
}
|
|
437
|
-
const
|
|
438
|
-
function
|
|
437
|
+
const Qe = "data-floating-ui-focusable", Kn = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
438
|
+
function jn(e) {
|
|
439
439
|
let t = e.activeElement;
|
|
440
440
|
for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
|
|
441
441
|
var n;
|
|
@@ -449,7 +449,7 @@ function $e(e, t) {
|
|
|
449
449
|
const n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
450
450
|
if (e.contains(t))
|
|
451
451
|
return !0;
|
|
452
|
-
if (n &&
|
|
452
|
+
if (n && Le(n)) {
|
|
453
453
|
let o = t;
|
|
454
454
|
for (; o; ) {
|
|
455
455
|
if (e === o)
|
|
@@ -470,17 +470,17 @@ function Ae(e, t) {
|
|
|
470
470
|
const n = e;
|
|
471
471
|
return n.target != null && t.contains(n.target);
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function qn(e) {
|
|
474
474
|
return e.matches("html,body");
|
|
475
475
|
}
|
|
476
476
|
function ae(e) {
|
|
477
477
|
return (e == null ? void 0 : e.ownerDocument) || document;
|
|
478
478
|
}
|
|
479
|
-
function jn(e) {
|
|
480
|
-
return F(e) && e.matches(Wn);
|
|
481
|
-
}
|
|
482
479
|
function Un(e) {
|
|
483
|
-
return e
|
|
480
|
+
return N(e) && e.matches(Kn);
|
|
481
|
+
}
|
|
482
|
+
function Yn(e) {
|
|
483
|
+
return e ? e.hasAttribute(Qe) ? e : e.querySelector("[" + Qe + "]") || e : null;
|
|
484
484
|
}
|
|
485
485
|
function fe(e, t, n) {
|
|
486
486
|
return n === void 0 && (n = !0), e.filter((r) => {
|
|
@@ -488,31 +488,31 @@ function fe(e, t, n) {
|
|
|
488
488
|
return r.parentId === t && (!n || ((i = r.context) == null ? void 0 : i.open));
|
|
489
489
|
}).flatMap((r) => [r, ...fe(e, r.id, n)]);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function Xn(e) {
|
|
492
492
|
return "nativeEvent" in e;
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function et(e, t) {
|
|
495
495
|
return ["mouse", "pen"].includes(e);
|
|
496
496
|
}
|
|
497
|
-
var
|
|
498
|
-
}, Q =
|
|
499
|
-
const
|
|
500
|
-
...
|
|
501
|
-
},
|
|
497
|
+
var zn = typeof document < "u", Gn = function() {
|
|
498
|
+
}, Q = zn ? _e : Gn;
|
|
499
|
+
const Zn = {
|
|
500
|
+
...g
|
|
501
|
+
}, Jn = Zn.useInsertionEffect, Qn = Jn || ((e) => e());
|
|
502
502
|
function ne(e) {
|
|
503
|
-
const t =
|
|
503
|
+
const t = g.useRef(() => {
|
|
504
504
|
if (process.env.NODE_ENV !== "production")
|
|
505
505
|
throw new Error("Cannot call an event handler while rendering.");
|
|
506
506
|
});
|
|
507
|
-
return
|
|
507
|
+
return Qn(() => {
|
|
508
508
|
t.current = e;
|
|
509
|
-
}),
|
|
509
|
+
}), g.useCallback(function() {
|
|
510
510
|
for (var n = arguments.length, o = new Array(n), r = 0; r < n; r++)
|
|
511
511
|
o[r] = arguments[r];
|
|
512
512
|
return t.current == null ? void 0 : t.current(...o);
|
|
513
513
|
}, []);
|
|
514
514
|
}
|
|
515
|
-
const
|
|
515
|
+
const It = () => ({
|
|
516
516
|
getShadowRoot: !0,
|
|
517
517
|
displayCheck: (
|
|
518
518
|
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
@@ -521,39 +521,39 @@ const Ot = () => ({
|
|
|
521
521
|
typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
522
522
|
)
|
|
523
523
|
});
|
|
524
|
-
function
|
|
525
|
-
const n =
|
|
524
|
+
function Dt(e, t) {
|
|
525
|
+
const n = Pt(e, It()), o = n.length;
|
|
526
526
|
if (o === 0) return;
|
|
527
|
-
const r =
|
|
527
|
+
const r = jn(ae(e)), i = n.indexOf(r), s = i === -1 ? t === 1 ? 0 : o - 1 : i + t;
|
|
528
528
|
return n[s];
|
|
529
529
|
}
|
|
530
|
-
function
|
|
531
|
-
return
|
|
530
|
+
function eo(e) {
|
|
531
|
+
return Dt(ae(e).body, 1) || e;
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
return
|
|
533
|
+
function to(e) {
|
|
534
|
+
return Dt(ae(e).body, -1) || e;
|
|
535
535
|
}
|
|
536
536
|
function Oe(e, t) {
|
|
537
537
|
const n = t || e.currentTarget, o = e.relatedTarget;
|
|
538
538
|
return !o || !$e(n, o);
|
|
539
539
|
}
|
|
540
|
-
function
|
|
541
|
-
|
|
540
|
+
function no(e) {
|
|
541
|
+
Pt(e, It()).forEach((n) => {
|
|
542
542
|
n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
|
|
543
543
|
});
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function tt(e) {
|
|
546
546
|
e.querySelectorAll("[data-tabindex]").forEach((n) => {
|
|
547
547
|
const o = n.dataset.tabindex;
|
|
548
548
|
delete n.dataset.tabindex, o ? n.setAttribute("tabindex", o) : n.removeAttribute("tabindex");
|
|
549
549
|
});
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function nt(e, t, n) {
|
|
552
552
|
let {
|
|
553
553
|
reference: o,
|
|
554
554
|
floating: r
|
|
555
555
|
} = e;
|
|
556
|
-
const i = G(t), s =
|
|
556
|
+
const i = G(t), s = Et(t), c = Rt(s), a = ee(t), l = i === "y", u = o.x + o.width / 2 - r.width / 2, f = o.y + o.height / 2 - r.height / 2, m = o[c] / 2 - r[c] / 2;
|
|
557
557
|
let d;
|
|
558
558
|
switch (a) {
|
|
559
559
|
case "top":
|
|
@@ -588,15 +588,15 @@ function tt(e, t, n) {
|
|
|
588
588
|
}
|
|
589
589
|
switch (Ce(t)) {
|
|
590
590
|
case "start":
|
|
591
|
-
d[s] -=
|
|
591
|
+
d[s] -= m * (n && l ? -1 : 1);
|
|
592
592
|
break;
|
|
593
593
|
case "end":
|
|
594
|
-
d[s] +=
|
|
594
|
+
d[s] += m * (n && l ? -1 : 1);
|
|
595
595
|
break;
|
|
596
596
|
}
|
|
597
597
|
return d;
|
|
598
598
|
}
|
|
599
|
-
async function
|
|
599
|
+
async function oo(e, t) {
|
|
600
600
|
var n;
|
|
601
601
|
t === void 0 && (t = {});
|
|
602
602
|
const {
|
|
@@ -610,10 +610,10 @@ async function to(e, t) {
|
|
|
610
610
|
boundary: l = "clippingAncestors",
|
|
611
611
|
rootBoundary: u = "viewport",
|
|
612
612
|
elementContext: f = "floating",
|
|
613
|
-
altBoundary:
|
|
613
|
+
altBoundary: m = !1,
|
|
614
614
|
padding: d = 0
|
|
615
|
-
} = Se(t, e),
|
|
616
|
-
element: (n = await (i.isElement == null ? void 0 : i.isElement(
|
|
615
|
+
} = Se(t, e), v = Cn(d), b = c[m ? f === "floating" ? "reference" : "floating" : f], h = he(await i.getClippingRect({
|
|
616
|
+
element: (n = await (i.isElement == null ? void 0 : i.isElement(b))) == null || n ? b : b.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
|
|
617
617
|
boundary: l,
|
|
618
618
|
rootBoundary: u,
|
|
619
619
|
strategy: a
|
|
@@ -635,13 +635,13 @@ async function to(e, t) {
|
|
|
635
635
|
strategy: a
|
|
636
636
|
}) : w);
|
|
637
637
|
return {
|
|
638
|
-
top: (
|
|
639
|
-
bottom: (C.bottom -
|
|
640
|
-
left: (
|
|
641
|
-
right: (C.right -
|
|
638
|
+
top: (h.top - C.top + v.top) / E.y,
|
|
639
|
+
bottom: (C.bottom - h.bottom + v.bottom) / E.y,
|
|
640
|
+
left: (h.left - C.left + v.left) / E.x,
|
|
641
|
+
right: (C.right - h.right + v.right) / E.x
|
|
642
642
|
};
|
|
643
643
|
}
|
|
644
|
-
const
|
|
644
|
+
const ro = async (e, t, n) => {
|
|
645
645
|
const {
|
|
646
646
|
placement: o = "bottom",
|
|
647
647
|
strategy: r = "absolute",
|
|
@@ -655,13 +655,13 @@ const no = async (e, t, n) => {
|
|
|
655
655
|
}), {
|
|
656
656
|
x: u,
|
|
657
657
|
y: f
|
|
658
|
-
} =
|
|
659
|
-
for (let
|
|
658
|
+
} = nt(l, o, a), m = o, d = {}, v = 0;
|
|
659
|
+
for (let b = 0; b < c.length; b++) {
|
|
660
660
|
var p;
|
|
661
661
|
const {
|
|
662
|
-
name:
|
|
662
|
+
name: h,
|
|
663
663
|
fn: w
|
|
664
|
-
} = c[
|
|
664
|
+
} = c[b], {
|
|
665
665
|
x,
|
|
666
666
|
y: E,
|
|
667
667
|
data: C,
|
|
@@ -670,13 +670,13 @@ const no = async (e, t, n) => {
|
|
|
670
670
|
x: u,
|
|
671
671
|
y: f,
|
|
672
672
|
initialPlacement: o,
|
|
673
|
-
placement:
|
|
673
|
+
placement: m,
|
|
674
674
|
strategy: r,
|
|
675
675
|
middlewareData: d,
|
|
676
676
|
rects: l,
|
|
677
677
|
platform: {
|
|
678
678
|
...s,
|
|
679
|
-
detectOverflow: (p = s.detectOverflow) != null ? p :
|
|
679
|
+
detectOverflow: (p = s.detectOverflow) != null ? p : oo
|
|
680
680
|
},
|
|
681
681
|
elements: {
|
|
682
682
|
reference: e,
|
|
@@ -685,27 +685,27 @@ const no = async (e, t, n) => {
|
|
|
685
685
|
});
|
|
686
686
|
u = x ?? u, f = E ?? f, d = {
|
|
687
687
|
...d,
|
|
688
|
-
[
|
|
689
|
-
...d[
|
|
688
|
+
[h]: {
|
|
689
|
+
...d[h],
|
|
690
690
|
...C
|
|
691
691
|
}
|
|
692
|
-
}, T &&
|
|
692
|
+
}, T && v <= 50 && (v++, typeof T == "object" && (T.placement && (m = T.placement), T.rects && (l = T.rects === !0 ? await s.getElementRects({
|
|
693
693
|
reference: e,
|
|
694
694
|
floating: t,
|
|
695
695
|
strategy: r
|
|
696
696
|
}) : T.rects), {
|
|
697
697
|
x: u,
|
|
698
698
|
y: f
|
|
699
|
-
} =
|
|
699
|
+
} = nt(l, m, a)), b = -1);
|
|
700
700
|
}
|
|
701
701
|
return {
|
|
702
702
|
x: u,
|
|
703
703
|
y: f,
|
|
704
|
-
placement:
|
|
704
|
+
placement: m,
|
|
705
705
|
strategy: r,
|
|
706
706
|
middlewareData: d
|
|
707
707
|
};
|
|
708
|
-
},
|
|
708
|
+
}, io = function(e) {
|
|
709
709
|
return e === void 0 && (e = {}), {
|
|
710
710
|
name: "flip",
|
|
711
711
|
options: e,
|
|
@@ -721,54 +721,54 @@ const no = async (e, t, n) => {
|
|
|
721
721
|
} = t, {
|
|
722
722
|
mainAxis: u = !0,
|
|
723
723
|
crossAxis: f = !0,
|
|
724
|
-
fallbackPlacements:
|
|
724
|
+
fallbackPlacements: m,
|
|
725
725
|
fallbackStrategy: d = "bestFit",
|
|
726
|
-
fallbackAxisSideDirection:
|
|
726
|
+
fallbackAxisSideDirection: v = "none",
|
|
727
727
|
flipAlignment: p = !0,
|
|
728
|
-
...
|
|
728
|
+
...b
|
|
729
729
|
} = Se(e, t);
|
|
730
730
|
if ((n = i.arrow) != null && n.alignmentOffset)
|
|
731
731
|
return {};
|
|
732
|
-
const
|
|
733
|
-
!
|
|
734
|
-
const
|
|
735
|
-
let
|
|
736
|
-
if (u &&
|
|
737
|
-
const R =
|
|
738
|
-
|
|
732
|
+
const h = ee(r), w = G(c), x = ee(c) === c, E = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), C = m || (x || !p ? [ge(c)] : yn(c)), T = v !== "none";
|
|
733
|
+
!m && T && C.push(...En(c, p, v, E));
|
|
734
|
+
const M = [c, ...C], k = await a.detectOverflow(t, b), B = [];
|
|
735
|
+
let S = ((o = i.flip) == null ? void 0 : o.overflows) || [];
|
|
736
|
+
if (u && B.push(k[h]), f) {
|
|
737
|
+
const R = bn(r, s, E);
|
|
738
|
+
B.push(k[R[0]], k[R[1]]);
|
|
739
739
|
}
|
|
740
|
-
if (
|
|
740
|
+
if (S = [...S, {
|
|
741
741
|
placement: r,
|
|
742
|
-
overflows:
|
|
743
|
-
}], !
|
|
744
|
-
var
|
|
745
|
-
const R = (((
|
|
746
|
-
if (
|
|
742
|
+
overflows: B
|
|
743
|
+
}], !B.every((R) => R <= 0)) {
|
|
744
|
+
var _, X;
|
|
745
|
+
const R = (((_ = i.flip) == null ? void 0 : _.index) || 0) + 1, L = M[R];
|
|
746
|
+
if (L && (!(f === "alignment" ? w !== G(L) : !1) || // We leave the current main axis only if every placement on that axis
|
|
747
747
|
// overflows the main axis.
|
|
748
|
-
|
|
748
|
+
S.every((y) => G(y.placement) === w ? y.overflows[0] > 0 : !0)))
|
|
749
749
|
return {
|
|
750
750
|
data: {
|
|
751
751
|
index: R,
|
|
752
|
-
overflows:
|
|
752
|
+
overflows: S
|
|
753
753
|
},
|
|
754
754
|
reset: {
|
|
755
|
-
placement:
|
|
755
|
+
placement: L
|
|
756
756
|
}
|
|
757
757
|
};
|
|
758
|
-
let O = (X =
|
|
758
|
+
let O = (X = S.filter((P) => P.overflows[0] <= 0).sort((P, y) => P.overflows[1] - y.overflows[1])[0]) == null ? void 0 : X.placement;
|
|
759
759
|
if (!O)
|
|
760
760
|
switch (d) {
|
|
761
761
|
case "bestFit": {
|
|
762
|
-
var
|
|
763
|
-
const P = (
|
|
762
|
+
var V;
|
|
763
|
+
const P = (V = S.filter((y) => {
|
|
764
764
|
if (T) {
|
|
765
|
-
const A = G(
|
|
765
|
+
const A = G(y.placement);
|
|
766
766
|
return A === w || // Create a bias to the `y` side axis due to horizontal
|
|
767
767
|
// reading directions favoring greater width.
|
|
768
768
|
A === "y";
|
|
769
769
|
}
|
|
770
770
|
return !0;
|
|
771
|
-
}).map((
|
|
771
|
+
}).map((y) => [y.placement, y.overflows.filter((A) => A > 0).reduce((A, I) => A + I, 0)]).sort((y, A) => y[1] - A[1])[0]) == null ? void 0 : V[0];
|
|
772
772
|
P && (O = P);
|
|
773
773
|
break;
|
|
774
774
|
}
|
|
@@ -786,17 +786,17 @@ const no = async (e, t, n) => {
|
|
|
786
786
|
return {};
|
|
787
787
|
}
|
|
788
788
|
};
|
|
789
|
-
},
|
|
790
|
-
async function
|
|
789
|
+
}, so = /* @__PURE__ */ new Set(["left", "top"]);
|
|
790
|
+
async function co(e, t) {
|
|
791
791
|
const {
|
|
792
792
|
placement: n,
|
|
793
793
|
platform: o,
|
|
794
794
|
elements: r
|
|
795
|
-
} = e, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = ee(n), c = Ce(n), a = G(n) === "y", l =
|
|
795
|
+
} = e, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = ee(n), c = Ce(n), a = G(n) === "y", l = so.has(s) ? -1 : 1, u = i && a ? -1 : 1, f = Se(t, e);
|
|
796
796
|
let {
|
|
797
|
-
mainAxis:
|
|
797
|
+
mainAxis: m,
|
|
798
798
|
crossAxis: d,
|
|
799
|
-
alignmentAxis:
|
|
799
|
+
alignmentAxis: v
|
|
800
800
|
} = typeof f == "number" ? {
|
|
801
801
|
mainAxis: f,
|
|
802
802
|
crossAxis: 0,
|
|
@@ -806,15 +806,15 @@ async function io(e, t) {
|
|
|
806
806
|
crossAxis: f.crossAxis || 0,
|
|
807
807
|
alignmentAxis: f.alignmentAxis
|
|
808
808
|
};
|
|
809
|
-
return c && typeof
|
|
809
|
+
return c && typeof v == "number" && (d = c === "end" ? v * -1 : v), a ? {
|
|
810
810
|
x: d * u,
|
|
811
|
-
y:
|
|
811
|
+
y: m * l
|
|
812
812
|
} : {
|
|
813
|
-
x:
|
|
813
|
+
x: m * l,
|
|
814
814
|
y: d * u
|
|
815
815
|
};
|
|
816
816
|
}
|
|
817
|
-
const
|
|
817
|
+
const ao = function(e) {
|
|
818
818
|
return e === void 0 && (e = 0), {
|
|
819
819
|
name: "offset",
|
|
820
820
|
options: e,
|
|
@@ -825,7 +825,7 @@ const so = function(e) {
|
|
|
825
825
|
y: i,
|
|
826
826
|
placement: s,
|
|
827
827
|
middlewareData: c
|
|
828
|
-
} = t, a = await
|
|
828
|
+
} = t, a = await co(t, e);
|
|
829
829
|
return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
|
|
830
830
|
x: r + a.x,
|
|
831
831
|
y: i + a.y,
|
|
@@ -836,7 +836,7 @@ const so = function(e) {
|
|
|
836
836
|
};
|
|
837
837
|
}
|
|
838
838
|
};
|
|
839
|
-
},
|
|
839
|
+
}, lo = function(e) {
|
|
840
840
|
return e === void 0 && (e = {}), {
|
|
841
841
|
name: "shift",
|
|
842
842
|
options: e,
|
|
@@ -850,11 +850,11 @@ const so = function(e) {
|
|
|
850
850
|
mainAxis: s = !0,
|
|
851
851
|
crossAxis: c = !1,
|
|
852
852
|
limiter: a = {
|
|
853
|
-
fn: (
|
|
853
|
+
fn: (h) => {
|
|
854
854
|
let {
|
|
855
855
|
x: w,
|
|
856
856
|
y: x
|
|
857
|
-
} =
|
|
857
|
+
} = h;
|
|
858
858
|
return {
|
|
859
859
|
x: w,
|
|
860
860
|
y: x
|
|
@@ -865,87 +865,87 @@ const so = function(e) {
|
|
|
865
865
|
} = Se(e, t), u = {
|
|
866
866
|
x: n,
|
|
867
867
|
y: o
|
|
868
|
-
}, f = await i.detectOverflow(t, l),
|
|
869
|
-
let
|
|
868
|
+
}, f = await i.detectOverflow(t, l), m = G(ee(r)), d = xt(m);
|
|
869
|
+
let v = u[d], p = u[m];
|
|
870
870
|
if (s) {
|
|
871
|
-
const
|
|
872
|
-
|
|
871
|
+
const h = d === "y" ? "top" : "left", w = d === "y" ? "bottom" : "right", x = v + f[h], E = v - f[w];
|
|
872
|
+
v = Xe(x, v, E);
|
|
873
873
|
}
|
|
874
874
|
if (c) {
|
|
875
|
-
const
|
|
876
|
-
p =
|
|
875
|
+
const h = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right", x = p + f[h], E = p - f[w];
|
|
876
|
+
p = Xe(x, p, E);
|
|
877
877
|
}
|
|
878
|
-
const
|
|
878
|
+
const b = a.fn({
|
|
879
879
|
...t,
|
|
880
|
-
[d]:
|
|
881
|
-
[
|
|
880
|
+
[d]: v,
|
|
881
|
+
[m]: p
|
|
882
882
|
});
|
|
883
883
|
return {
|
|
884
|
-
...
|
|
884
|
+
...b,
|
|
885
885
|
data: {
|
|
886
|
-
x:
|
|
887
|
-
y:
|
|
886
|
+
x: b.x - n,
|
|
887
|
+
y: b.y - o,
|
|
888
888
|
enabled: {
|
|
889
889
|
[d]: s,
|
|
890
|
-
[
|
|
890
|
+
[m]: c
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
};
|
|
894
894
|
}
|
|
895
895
|
};
|
|
896
896
|
};
|
|
897
|
-
function
|
|
898
|
-
const t =
|
|
897
|
+
function Lt(e) {
|
|
898
|
+
const t = W(e);
|
|
899
899
|
let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
|
|
900
|
-
const r =
|
|
900
|
+
const r = N(e), i = r ? e.offsetWidth : n, s = r ? e.offsetHeight : o, c = me(n) !== i || me(o) !== s;
|
|
901
901
|
return c && (n = i, o = s), {
|
|
902
902
|
width: n,
|
|
903
903
|
height: o,
|
|
904
904
|
$: c
|
|
905
905
|
};
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function He(e) {
|
|
908
908
|
return D(e) ? e : e.contextElement;
|
|
909
909
|
}
|
|
910
910
|
function oe(e) {
|
|
911
|
-
const t =
|
|
912
|
-
if (!
|
|
913
|
-
return
|
|
911
|
+
const t = He(e);
|
|
912
|
+
if (!N(t))
|
|
913
|
+
return K(1);
|
|
914
914
|
const n = t.getBoundingClientRect(), {
|
|
915
915
|
width: o,
|
|
916
916
|
height: r,
|
|
917
917
|
$: i
|
|
918
|
-
} =
|
|
919
|
-
let s = (i ?
|
|
918
|
+
} = Lt(t);
|
|
919
|
+
let s = (i ? me(n.width) : n.width) / o, c = (i ? me(n.height) : n.height) / r;
|
|
920
920
|
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
921
921
|
x: s,
|
|
922
922
|
y: c
|
|
923
923
|
};
|
|
924
924
|
}
|
|
925
|
-
const
|
|
926
|
-
function
|
|
927
|
-
const t =
|
|
928
|
-
return !Re() || !t.visualViewport ?
|
|
925
|
+
const uo = /* @__PURE__ */ K(0);
|
|
926
|
+
function Mt(e) {
|
|
927
|
+
const t = $(e);
|
|
928
|
+
return !Re() || !t.visualViewport ? uo : {
|
|
929
929
|
x: t.visualViewport.offsetLeft,
|
|
930
930
|
y: t.visualViewport.offsetTop
|
|
931
931
|
};
|
|
932
932
|
}
|
|
933
|
-
function
|
|
934
|
-
return t === void 0 && (t = !1), !n || t && n !==
|
|
933
|
+
function fo(e, t, n) {
|
|
934
|
+
return t === void 0 && (t = !1), !n || t && n !== $(e) ? !1 : t;
|
|
935
935
|
}
|
|
936
936
|
function te(e, t, n, o) {
|
|
937
937
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
938
|
-
const r = e.getBoundingClientRect(), i =
|
|
939
|
-
let s =
|
|
938
|
+
const r = e.getBoundingClientRect(), i = He(e);
|
|
939
|
+
let s = K(1);
|
|
940
940
|
t && (o ? D(o) && (s = oe(o)) : s = oe(e));
|
|
941
|
-
const c =
|
|
941
|
+
const c = fo(i, n, o) ? Mt(i) : K(0);
|
|
942
942
|
let a = (r.left + c.x) / s.x, l = (r.top + c.y) / s.y, u = r.width / s.x, f = r.height / s.y;
|
|
943
943
|
if (i) {
|
|
944
|
-
const
|
|
945
|
-
let
|
|
946
|
-
for (; p && o && d !==
|
|
947
|
-
const
|
|
948
|
-
a *=
|
|
944
|
+
const m = $(i), d = o && D(o) ? $(o) : o;
|
|
945
|
+
let v = m, p = Me(v);
|
|
946
|
+
for (; p && o && d !== v; ) {
|
|
947
|
+
const b = oe(p), h = p.getBoundingClientRect(), w = W(p), x = h.left + (p.clientLeft + parseFloat(w.paddingLeft)) * b.x, E = h.top + (p.clientTop + parseFloat(w.paddingTop)) * b.y;
|
|
948
|
+
a *= b.x, l *= b.y, u *= b.x, f *= b.y, a += x, l += E, v = $(p), p = Me(v);
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
951
|
return he({
|
|
@@ -957,59 +957,59 @@ function te(e, t, n, o) {
|
|
|
957
957
|
}
|
|
958
958
|
function Te(e, t) {
|
|
959
959
|
const n = Ee(e).scrollLeft;
|
|
960
|
-
return t ? t.left + n : te(
|
|
960
|
+
return t ? t.left + n : te(j(e)).left + n;
|
|
961
961
|
}
|
|
962
|
-
function
|
|
962
|
+
function kt(e, t) {
|
|
963
963
|
const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - Te(e, n), r = n.top + t.scrollTop;
|
|
964
964
|
return {
|
|
965
965
|
x: o,
|
|
966
966
|
y: r
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function po(e) {
|
|
970
970
|
let {
|
|
971
971
|
elements: t,
|
|
972
972
|
rect: n,
|
|
973
973
|
offsetParent: o,
|
|
974
974
|
strategy: r
|
|
975
975
|
} = e;
|
|
976
|
-
const i = r === "fixed", s =
|
|
976
|
+
const i = r === "fixed", s = j(o), c = t ? xe(t.floating) : !1;
|
|
977
977
|
if (o === s || c && i)
|
|
978
978
|
return n;
|
|
979
979
|
let a = {
|
|
980
980
|
scrollLeft: 0,
|
|
981
981
|
scrollTop: 0
|
|
982
|
-
}, l =
|
|
983
|
-
const u =
|
|
984
|
-
if ((f || !f && !i) && ((re(o) !== "body" || le(s)) && (a = Ee(o)),
|
|
982
|
+
}, l = K(1);
|
|
983
|
+
const u = K(0), f = N(o);
|
|
984
|
+
if ((f || !f && !i) && ((re(o) !== "body" || le(s)) && (a = Ee(o)), N(o))) {
|
|
985
985
|
const d = te(o);
|
|
986
986
|
l = oe(o), u.x = d.x + o.clientLeft, u.y = d.y + o.clientTop;
|
|
987
987
|
}
|
|
988
|
-
const
|
|
988
|
+
const m = s && !f && !i ? kt(s, a) : K(0);
|
|
989
989
|
return {
|
|
990
990
|
width: n.width * l.x,
|
|
991
991
|
height: n.height * l.y,
|
|
992
|
-
x: n.x * l.x - a.scrollLeft * l.x + u.x +
|
|
993
|
-
y: n.y * l.y - a.scrollTop * l.y + u.y +
|
|
992
|
+
x: n.x * l.x - a.scrollLeft * l.x + u.x + m.x,
|
|
993
|
+
y: n.y * l.y - a.scrollTop * l.y + u.y + m.y
|
|
994
994
|
};
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function mo(e) {
|
|
997
997
|
return Array.from(e.getClientRects());
|
|
998
998
|
}
|
|
999
|
-
function
|
|
1000
|
-
const t =
|
|
999
|
+
function go(e) {
|
|
1000
|
+
const t = j(e), n = Ee(e), o = e.ownerDocument.body, r = J(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), i = J(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
|
|
1001
1001
|
let s = -n.scrollLeft + Te(e);
|
|
1002
1002
|
const c = -n.scrollTop;
|
|
1003
|
-
return
|
|
1003
|
+
return W(o).direction === "rtl" && (s += J(t.clientWidth, o.clientWidth) - r), {
|
|
1004
1004
|
width: r,
|
|
1005
1005
|
height: i,
|
|
1006
1006
|
x: s,
|
|
1007
1007
|
y: c
|
|
1008
1008
|
};
|
|
1009
1009
|
}
|
|
1010
|
-
const
|
|
1011
|
-
function
|
|
1012
|
-
const n =
|
|
1010
|
+
const ot = 25;
|
|
1011
|
+
function ho(e, t) {
|
|
1012
|
+
const n = $(e), o = j(e), r = n.visualViewport;
|
|
1013
1013
|
let i = o.clientWidth, s = o.clientHeight, c = 0, a = 0;
|
|
1014
1014
|
if (r) {
|
|
1015
1015
|
i = r.width, s = r.height;
|
|
@@ -1018,9 +1018,9 @@ function go(e, t) {
|
|
|
1018
1018
|
}
|
|
1019
1019
|
const l = Te(o);
|
|
1020
1020
|
if (l <= 0) {
|
|
1021
|
-
const u = o.ownerDocument, f = u.body,
|
|
1022
|
-
|
|
1023
|
-
} else l <=
|
|
1021
|
+
const u = o.ownerDocument, f = u.body, m = getComputedStyle(f), d = u.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, v = Math.abs(o.clientWidth - f.clientWidth - d);
|
|
1022
|
+
v <= ot && (i -= v);
|
|
1023
|
+
} else l <= ot && (i += l);
|
|
1024
1024
|
return {
|
|
1025
1025
|
width: i,
|
|
1026
1026
|
height: s,
|
|
@@ -1028,9 +1028,9 @@ function go(e, t) {
|
|
|
1028
1028
|
y: a
|
|
1029
1029
|
};
|
|
1030
1030
|
}
|
|
1031
|
-
const
|
|
1032
|
-
function
|
|
1033
|
-
const n = te(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, i =
|
|
1031
|
+
const vo = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1032
|
+
function bo(e, t) {
|
|
1033
|
+
const n = te(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, i = N(e) ? oe(e) : K(1), s = e.clientWidth * i.x, c = e.clientHeight * i.y, a = r * i.x, l = o * i.y;
|
|
1034
1034
|
return {
|
|
1035
1035
|
width: s,
|
|
1036
1036
|
height: c,
|
|
@@ -1038,16 +1038,16 @@ function ho(e, t) {
|
|
|
1038
1038
|
y: l
|
|
1039
1039
|
};
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function rt(e, t, n) {
|
|
1042
1042
|
let o;
|
|
1043
1043
|
if (t === "viewport")
|
|
1044
|
-
o =
|
|
1044
|
+
o = ho(e, n);
|
|
1045
1045
|
else if (t === "document")
|
|
1046
|
-
o =
|
|
1046
|
+
o = go(j(e));
|
|
1047
1047
|
else if (D(t))
|
|
1048
|
-
o =
|
|
1048
|
+
o = bo(t, n);
|
|
1049
1049
|
else {
|
|
1050
|
-
const r =
|
|
1050
|
+
const r = Mt(e);
|
|
1051
1051
|
o = {
|
|
1052
1052
|
x: t.x - r.x,
|
|
1053
1053
|
y: t.y - r.y,
|
|
@@ -1057,34 +1057,34 @@ function ot(e, t, n) {
|
|
|
1057
1057
|
}
|
|
1058
1058
|
return he(o);
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1061
|
-
const n =
|
|
1062
|
-
return n === t || !D(n) ||
|
|
1060
|
+
function Nt(e, t) {
|
|
1061
|
+
const n = Y(e);
|
|
1062
|
+
return n === t || !D(n) || U(n) ? !1 : W(n).position === "fixed" || Nt(n, t);
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1064
|
+
function yo(e, t) {
|
|
1065
1065
|
const n = t.get(e);
|
|
1066
1066
|
if (n)
|
|
1067
1067
|
return n;
|
|
1068
1068
|
let o = Z(e, [], !1).filter((c) => D(c) && re(c) !== "body"), r = null;
|
|
1069
|
-
const i =
|
|
1070
|
-
let s = i ?
|
|
1071
|
-
for (; D(s) && !
|
|
1072
|
-
const c =
|
|
1073
|
-
!a && c.position === "fixed" && (r = null), (i ? !a && !r : !a && c.position === "static" && !!r &&
|
|
1069
|
+
const i = W(e).position === "fixed";
|
|
1070
|
+
let s = i ? Y(e) : e;
|
|
1071
|
+
for (; D(s) && !U(s); ) {
|
|
1072
|
+
const c = W(s), a = We(s);
|
|
1073
|
+
!a && c.position === "fixed" && (r = null), (i ? !a && !r : !a && c.position === "static" && !!r && vo.has(r.position) || le(s) && !a && Nt(e, s)) ? o = o.filter((u) => u !== s) : r = c, s = Y(s);
|
|
1074
1074
|
}
|
|
1075
1075
|
return t.set(e, o), o;
|
|
1076
1076
|
}
|
|
1077
|
-
function
|
|
1077
|
+
function wo(e) {
|
|
1078
1078
|
let {
|
|
1079
1079
|
element: t,
|
|
1080
1080
|
boundary: n,
|
|
1081
1081
|
rootBoundary: o,
|
|
1082
1082
|
strategy: r
|
|
1083
1083
|
} = e;
|
|
1084
|
-
const s = [...n === "clippingAncestors" ? xe(t) ? [] :
|
|
1085
|
-
const f =
|
|
1084
|
+
const s = [...n === "clippingAncestors" ? xe(t) ? [] : yo(t, this._c) : [].concat(n), o], c = s[0], a = s.reduce((l, u) => {
|
|
1085
|
+
const f = rt(t, u, r);
|
|
1086
1086
|
return l.top = J(f.top, l.top), l.right = pe(f.right, l.right), l.bottom = pe(f.bottom, l.bottom), l.left = J(f.left, l.left), l;
|
|
1087
|
-
},
|
|
1087
|
+
}, rt(t, c, r));
|
|
1088
1088
|
return {
|
|
1089
1089
|
width: a.right - a.left,
|
|
1090
1090
|
height: a.bottom - a.top,
|
|
@@ -1092,23 +1092,23 @@ function bo(e) {
|
|
|
1092
1092
|
y: a.top
|
|
1093
1093
|
};
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function xo(e) {
|
|
1096
1096
|
const {
|
|
1097
1097
|
width: t,
|
|
1098
1098
|
height: n
|
|
1099
|
-
} =
|
|
1099
|
+
} = Lt(e);
|
|
1100
1100
|
return {
|
|
1101
1101
|
width: t,
|
|
1102
1102
|
height: n
|
|
1103
1103
|
};
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1106
|
-
const o =
|
|
1105
|
+
function Ro(e, t, n) {
|
|
1106
|
+
const o = N(t), r = j(t), i = n === "fixed", s = te(e, !0, i, t);
|
|
1107
1107
|
let c = {
|
|
1108
1108
|
scrollLeft: 0,
|
|
1109
1109
|
scrollTop: 0
|
|
1110
1110
|
};
|
|
1111
|
-
const a =
|
|
1111
|
+
const a = K(0);
|
|
1112
1112
|
function l() {
|
|
1113
1113
|
a.x = Te(r);
|
|
1114
1114
|
}
|
|
@@ -1118,47 +1118,47 @@ function wo(e, t, n) {
|
|
|
1118
1118
|
a.x = d.x + t.clientLeft, a.y = d.y + t.clientTop;
|
|
1119
1119
|
} else r && l();
|
|
1120
1120
|
i && !o && r && l();
|
|
1121
|
-
const u = r && !o && !i ?
|
|
1121
|
+
const u = r && !o && !i ? kt(r, c) : K(0), f = s.left + c.scrollLeft - a.x - u.x, m = s.top + c.scrollTop - a.y - u.y;
|
|
1122
1122
|
return {
|
|
1123
1123
|
x: f,
|
|
1124
|
-
y:
|
|
1124
|
+
y: m,
|
|
1125
1125
|
width: s.width,
|
|
1126
1126
|
height: s.height
|
|
1127
1127
|
};
|
|
1128
1128
|
}
|
|
1129
1129
|
function Pe(e) {
|
|
1130
|
-
return
|
|
1130
|
+
return W(e).position === "static";
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1133
|
-
if (!
|
|
1132
|
+
function it(e, t) {
|
|
1133
|
+
if (!N(e) || W(e).position === "fixed")
|
|
1134
1134
|
return null;
|
|
1135
1135
|
if (t)
|
|
1136
1136
|
return t(e);
|
|
1137
1137
|
let n = e.offsetParent;
|
|
1138
|
-
return
|
|
1138
|
+
return j(e) === n && (n = n.ownerDocument.body), n;
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1141
|
-
const n =
|
|
1140
|
+
function Ft(e, t) {
|
|
1141
|
+
const n = $(e);
|
|
1142
1142
|
if (xe(e))
|
|
1143
1143
|
return n;
|
|
1144
|
-
if (!
|
|
1145
|
-
let r =
|
|
1146
|
-
for (; r && !
|
|
1144
|
+
if (!N(e)) {
|
|
1145
|
+
let r = Y(e);
|
|
1146
|
+
for (; r && !U(r); ) {
|
|
1147
1147
|
if (D(r) && !Pe(r))
|
|
1148
1148
|
return r;
|
|
1149
|
-
r =
|
|
1149
|
+
r = Y(r);
|
|
1150
1150
|
}
|
|
1151
1151
|
return n;
|
|
1152
1152
|
}
|
|
1153
|
-
let o =
|
|
1154
|
-
for (; o &&
|
|
1155
|
-
o =
|
|
1156
|
-
return o &&
|
|
1153
|
+
let o = it(e, t);
|
|
1154
|
+
for (; o && an(o) && Pe(o); )
|
|
1155
|
+
o = it(o, t);
|
|
1156
|
+
return o && U(o) && Pe(o) && !We(o) ? n : o || pn(e) || n;
|
|
1157
1157
|
}
|
|
1158
|
-
const
|
|
1159
|
-
const t = this.getOffsetParent ||
|
|
1158
|
+
const Eo = async function(e) {
|
|
1159
|
+
const t = this.getOffsetParent || Ft, n = this.getDimensions, o = await n(e.floating);
|
|
1160
1160
|
return {
|
|
1161
|
-
reference:
|
|
1161
|
+
reference: Ro(e.reference, await t(e.floating), e.strategy),
|
|
1162
1162
|
floating: {
|
|
1163
1163
|
x: 0,
|
|
1164
1164
|
y: 0,
|
|
@@ -1167,27 +1167,27 @@ const xo = async function(e) {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
};
|
|
1169
1169
|
};
|
|
1170
|
-
function
|
|
1171
|
-
return
|
|
1172
|
-
}
|
|
1173
|
-
const
|
|
1174
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
1175
|
-
getDocumentElement:
|
|
1176
|
-
getClippingRect:
|
|
1177
|
-
getOffsetParent:
|
|
1178
|
-
getElementRects:
|
|
1179
|
-
getClientRects:
|
|
1180
|
-
getDimensions:
|
|
1170
|
+
function So(e) {
|
|
1171
|
+
return W(e).direction === "rtl";
|
|
1172
|
+
}
|
|
1173
|
+
const Co = {
|
|
1174
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: po,
|
|
1175
|
+
getDocumentElement: j,
|
|
1176
|
+
getClippingRect: wo,
|
|
1177
|
+
getOffsetParent: Ft,
|
|
1178
|
+
getElementRects: Eo,
|
|
1179
|
+
getClientRects: mo,
|
|
1180
|
+
getDimensions: xo,
|
|
1181
1181
|
getScale: oe,
|
|
1182
1182
|
isElement: D,
|
|
1183
|
-
isRTL:
|
|
1183
|
+
isRTL: So
|
|
1184
1184
|
};
|
|
1185
|
-
function
|
|
1185
|
+
function $t(e, t) {
|
|
1186
1186
|
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1188
|
+
function To(e, t) {
|
|
1189
1189
|
let n = null, o;
|
|
1190
|
-
const r =
|
|
1190
|
+
const r = j(e);
|
|
1191
1191
|
function i() {
|
|
1192
1192
|
var c;
|
|
1193
1193
|
clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
|
|
@@ -1197,26 +1197,26 @@ function So(e, t) {
|
|
|
1197
1197
|
const l = e.getBoundingClientRect(), {
|
|
1198
1198
|
left: u,
|
|
1199
1199
|
top: f,
|
|
1200
|
-
width:
|
|
1200
|
+
width: m,
|
|
1201
1201
|
height: d
|
|
1202
1202
|
} = l;
|
|
1203
|
-
if (c || t(), !
|
|
1203
|
+
if (c || t(), !m || !d)
|
|
1204
1204
|
return;
|
|
1205
|
-
const
|
|
1206
|
-
rootMargin: -
|
|
1205
|
+
const v = ue(f), p = ue(r.clientWidth - (u + m)), b = ue(r.clientHeight - (f + d)), h = ue(u), x = {
|
|
1206
|
+
rootMargin: -v + "px " + -p + "px " + -b + "px " + -h + "px",
|
|
1207
1207
|
threshold: J(0, pe(1, a)) || 1
|
|
1208
1208
|
};
|
|
1209
1209
|
let E = !0;
|
|
1210
1210
|
function C(T) {
|
|
1211
|
-
const
|
|
1212
|
-
if (
|
|
1211
|
+
const M = T[0].intersectionRatio;
|
|
1212
|
+
if (M !== a) {
|
|
1213
1213
|
if (!E)
|
|
1214
1214
|
return s();
|
|
1215
|
-
|
|
1215
|
+
M ? s(!1, M) : o = setTimeout(() => {
|
|
1216
1216
|
s(!1, 1e-7);
|
|
1217
1217
|
}, 1e3);
|
|
1218
1218
|
}
|
|
1219
|
-
|
|
1219
|
+
M === 1 && !$t(l, e.getBoundingClientRect()) && s(), E = !1;
|
|
1220
1220
|
}
|
|
1221
1221
|
try {
|
|
1222
1222
|
n = new IntersectionObserver(C, {
|
|
@@ -1231,7 +1231,7 @@ function So(e, t) {
|
|
|
1231
1231
|
}
|
|
1232
1232
|
return s(!0), i;
|
|
1233
1233
|
}
|
|
1234
|
-
function
|
|
1234
|
+
function Ao(e, t, n, o) {
|
|
1235
1235
|
o === void 0 && (o = {});
|
|
1236
1236
|
const {
|
|
1237
1237
|
ancestorScroll: r = !0,
|
|
@@ -1239,49 +1239,49 @@ function Co(e, t, n, o) {
|
|
|
1239
1239
|
elementResize: s = typeof ResizeObserver == "function",
|
|
1240
1240
|
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1241
1241
|
animationFrame: a = !1
|
|
1242
|
-
} = o, l =
|
|
1243
|
-
u.forEach((
|
|
1244
|
-
r &&
|
|
1242
|
+
} = o, l = He(e), u = r || i ? [...l ? Z(l) : [], ...Z(t)] : [];
|
|
1243
|
+
u.forEach((h) => {
|
|
1244
|
+
r && h.addEventListener("scroll", n, {
|
|
1245
1245
|
passive: !0
|
|
1246
|
-
}), i &&
|
|
1246
|
+
}), i && h.addEventListener("resize", n);
|
|
1247
1247
|
});
|
|
1248
|
-
const f = l && c ?
|
|
1249
|
-
let
|
|
1250
|
-
s && (d = new ResizeObserver((
|
|
1251
|
-
let [w] =
|
|
1252
|
-
w && w.target === l && d && (d.unobserve(t), cancelAnimationFrame(
|
|
1248
|
+
const f = l && c ? To(l, n) : null;
|
|
1249
|
+
let m = -1, d = null;
|
|
1250
|
+
s && (d = new ResizeObserver((h) => {
|
|
1251
|
+
let [w] = h;
|
|
1252
|
+
w && w.target === l && d && (d.unobserve(t), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
1253
1253
|
var x;
|
|
1254
1254
|
(x = d) == null || x.observe(t);
|
|
1255
1255
|
})), n();
|
|
1256
1256
|
}), l && !a && d.observe(l), d.observe(t));
|
|
1257
|
-
let
|
|
1258
|
-
a &&
|
|
1259
|
-
function
|
|
1260
|
-
const
|
|
1261
|
-
p &&
|
|
1257
|
+
let v, p = a ? te(e) : null;
|
|
1258
|
+
a && b();
|
|
1259
|
+
function b() {
|
|
1260
|
+
const h = te(e);
|
|
1261
|
+
p && !$t(p, h) && n(), p = h, v = requestAnimationFrame(b);
|
|
1262
1262
|
}
|
|
1263
1263
|
return n(), () => {
|
|
1264
|
-
var
|
|
1264
|
+
var h;
|
|
1265
1265
|
u.forEach((w) => {
|
|
1266
1266
|
r && w.removeEventListener("scroll", n), i && w.removeEventListener("resize", n);
|
|
1267
|
-
}), f == null || f(), (
|
|
1267
|
+
}), f == null || f(), (h = d) == null || h.disconnect(), d = null, a && cancelAnimationFrame(v);
|
|
1268
1268
|
};
|
|
1269
1269
|
}
|
|
1270
|
-
const
|
|
1270
|
+
const Oo = ao, Po = lo, Io = io, Do = (e, t, n) => {
|
|
1271
1271
|
const o = /* @__PURE__ */ new Map(), r = {
|
|
1272
|
-
platform:
|
|
1272
|
+
platform: Co,
|
|
1273
1273
|
...n
|
|
1274
1274
|
}, i = {
|
|
1275
1275
|
...r.platform,
|
|
1276
1276
|
_c: o
|
|
1277
1277
|
};
|
|
1278
|
-
return
|
|
1278
|
+
return ro(e, t, {
|
|
1279
1279
|
...r,
|
|
1280
1280
|
platform: i
|
|
1281
1281
|
});
|
|
1282
1282
|
};
|
|
1283
|
-
var
|
|
1284
|
-
}, de =
|
|
1283
|
+
var Lo = typeof document < "u", Mo = function() {
|
|
1284
|
+
}, de = Lo ? _e : Mo;
|
|
1285
1285
|
function ye(e, t) {
|
|
1286
1286
|
if (e === t)
|
|
1287
1287
|
return !0;
|
|
@@ -1312,20 +1312,20 @@ function ye(e, t) {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
return e !== e && t !== t;
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function Bt(e) {
|
|
1316
1316
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1317
1317
|
}
|
|
1318
|
-
function
|
|
1319
|
-
const n =
|
|
1318
|
+
function st(e, t) {
|
|
1319
|
+
const n = Bt(e);
|
|
1320
1320
|
return Math.round(t * n) / n;
|
|
1321
1321
|
}
|
|
1322
1322
|
function Ie(e) {
|
|
1323
|
-
const t =
|
|
1323
|
+
const t = g.useRef(e);
|
|
1324
1324
|
return de(() => {
|
|
1325
1325
|
t.current = e;
|
|
1326
1326
|
}), t;
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1328
|
+
function ko(e) {
|
|
1329
1329
|
e === void 0 && (e = {});
|
|
1330
1330
|
const {
|
|
1331
1331
|
placement: t = "bottom",
|
|
@@ -1339,28 +1339,28 @@ function Mo(e) {
|
|
|
1339
1339
|
transform: c = !0,
|
|
1340
1340
|
whileElementsMounted: a,
|
|
1341
1341
|
open: l
|
|
1342
|
-
} = e, [u, f] =
|
|
1342
|
+
} = e, [u, f] = g.useState({
|
|
1343
1343
|
x: 0,
|
|
1344
1344
|
y: 0,
|
|
1345
1345
|
strategy: n,
|
|
1346
1346
|
placement: t,
|
|
1347
1347
|
middlewareData: {},
|
|
1348
1348
|
isPositioned: !1
|
|
1349
|
-
}), [
|
|
1350
|
-
ye(
|
|
1351
|
-
const [
|
|
1352
|
-
|
|
1353
|
-
}, []), x =
|
|
1354
|
-
|
|
1355
|
-
}, []), E = i ||
|
|
1356
|
-
if (!T.current || !
|
|
1349
|
+
}), [m, d] = g.useState(o);
|
|
1350
|
+
ye(m, o) || d(o);
|
|
1351
|
+
const [v, p] = g.useState(null), [b, h] = g.useState(null), w = g.useCallback((y) => {
|
|
1352
|
+
y !== T.current && (T.current = y, p(y));
|
|
1353
|
+
}, []), x = g.useCallback((y) => {
|
|
1354
|
+
y !== M.current && (M.current = y, h(y));
|
|
1355
|
+
}, []), E = i || v, C = s || b, T = g.useRef(null), M = g.useRef(null), k = g.useRef(u), B = a != null, S = Ie(a), _ = Ie(r), X = Ie(l), V = g.useCallback(() => {
|
|
1356
|
+
if (!T.current || !M.current)
|
|
1357
1357
|
return;
|
|
1358
|
-
const
|
|
1358
|
+
const y = {
|
|
1359
1359
|
placement: t,
|
|
1360
1360
|
strategy: n,
|
|
1361
|
-
middleware:
|
|
1361
|
+
middleware: m
|
|
1362
1362
|
};
|
|
1363
|
-
|
|
1363
|
+
_.current && (y.platform = _.current), Do(T.current, M.current, y).then((A) => {
|
|
1364
1364
|
const I = {
|
|
1365
1365
|
...A,
|
|
1366
1366
|
// The floating element's position may be recomputed while it's closed
|
|
@@ -1369,48 +1369,48 @@ function Mo(e) {
|
|
|
1369
1369
|
// setting it to `true` when `open === false` (must be specified).
|
|
1370
1370
|
isPositioned: X.current !== !1
|
|
1371
1371
|
};
|
|
1372
|
-
R.current && !ye(k.current, I) && (k.current = I,
|
|
1372
|
+
R.current && !ye(k.current, I) && (k.current = I, bt.flushSync(() => {
|
|
1373
1373
|
f(I);
|
|
1374
1374
|
}));
|
|
1375
1375
|
});
|
|
1376
|
-
}, [
|
|
1376
|
+
}, [m, t, n, _, X]);
|
|
1377
1377
|
de(() => {
|
|
1378
|
-
l === !1 && k.current.isPositioned && (k.current.isPositioned = !1, f((
|
|
1379
|
-
...
|
|
1378
|
+
l === !1 && k.current.isPositioned && (k.current.isPositioned = !1, f((y) => ({
|
|
1379
|
+
...y,
|
|
1380
1380
|
isPositioned: !1
|
|
1381
1381
|
})));
|
|
1382
1382
|
}, [l]);
|
|
1383
|
-
const R =
|
|
1383
|
+
const R = g.useRef(!1);
|
|
1384
1384
|
de(() => (R.current = !0, () => {
|
|
1385
1385
|
R.current = !1;
|
|
1386
1386
|
}), []), de(() => {
|
|
1387
|
-
if (E && (T.current = E), C && (
|
|
1388
|
-
if (
|
|
1389
|
-
return
|
|
1390
|
-
|
|
1387
|
+
if (E && (T.current = E), C && (M.current = C), E && C) {
|
|
1388
|
+
if (S.current)
|
|
1389
|
+
return S.current(E, C, V);
|
|
1390
|
+
V();
|
|
1391
1391
|
}
|
|
1392
|
-
}, [E, C,
|
|
1393
|
-
const
|
|
1392
|
+
}, [E, C, V, S, B]);
|
|
1393
|
+
const L = g.useMemo(() => ({
|
|
1394
1394
|
reference: T,
|
|
1395
|
-
floating:
|
|
1395
|
+
floating: M,
|
|
1396
1396
|
setReference: w,
|
|
1397
1397
|
setFloating: x
|
|
1398
|
-
}), [w, x]), O =
|
|
1398
|
+
}), [w, x]), O = g.useMemo(() => ({
|
|
1399
1399
|
reference: E,
|
|
1400
1400
|
floating: C
|
|
1401
|
-
}), [E, C]), P =
|
|
1402
|
-
const
|
|
1401
|
+
}), [E, C]), P = g.useMemo(() => {
|
|
1402
|
+
const y = {
|
|
1403
1403
|
position: n,
|
|
1404
1404
|
left: 0,
|
|
1405
1405
|
top: 0
|
|
1406
1406
|
};
|
|
1407
1407
|
if (!O.floating)
|
|
1408
|
-
return
|
|
1409
|
-
const A =
|
|
1408
|
+
return y;
|
|
1409
|
+
const A = st(O.floating, u.x), I = st(O.floating, u.y);
|
|
1410
1410
|
return c ? {
|
|
1411
|
-
...
|
|
1411
|
+
...y,
|
|
1412
1412
|
transform: "translate(" + A + "px, " + I + "px)",
|
|
1413
|
-
...
|
|
1413
|
+
...Bt(O.floating) >= 1.5 && {
|
|
1414
1414
|
willChange: "transform"
|
|
1415
1415
|
}
|
|
1416
1416
|
} : {
|
|
@@ -1419,44 +1419,44 @@ function Mo(e) {
|
|
|
1419
1419
|
top: I
|
|
1420
1420
|
};
|
|
1421
1421
|
}, [n, c, O.floating, u.x, u.y]);
|
|
1422
|
-
return
|
|
1422
|
+
return g.useMemo(() => ({
|
|
1423
1423
|
...u,
|
|
1424
|
-
update:
|
|
1425
|
-
refs:
|
|
1424
|
+
update: V,
|
|
1425
|
+
refs: L,
|
|
1426
1426
|
elements: O,
|
|
1427
1427
|
floatingStyles: P
|
|
1428
|
-
}), [u,
|
|
1428
|
+
}), [u, V, L, O, P]);
|
|
1429
1429
|
}
|
|
1430
|
-
const
|
|
1431
|
-
...
|
|
1430
|
+
const No = (e, t) => ({
|
|
1431
|
+
...Oo(e),
|
|
1432
1432
|
options: [e, t]
|
|
1433
|
-
}),
|
|
1434
|
-
...
|
|
1433
|
+
}), Fo = (e, t) => ({
|
|
1434
|
+
...Po(e),
|
|
1435
1435
|
options: [e, t]
|
|
1436
|
-
}),
|
|
1437
|
-
...
|
|
1436
|
+
}), $o = (e, t) => ({
|
|
1437
|
+
...Io(e),
|
|
1438
1438
|
options: [e, t]
|
|
1439
|
-
}),
|
|
1440
|
-
...
|
|
1439
|
+
}), Bo = "data-floating-ui-focusable", ct = "active", at = "selected", _o = {
|
|
1440
|
+
...g
|
|
1441
1441
|
};
|
|
1442
|
-
let
|
|
1443
|
-
const
|
|
1442
|
+
let lt = !1, Vo = 0;
|
|
1443
|
+
const ut = () => (
|
|
1444
1444
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
1445
1445
|
// on <React 18
|
|
1446
|
-
"floating-ui-" + Math.random().toString(36).slice(2, 6) +
|
|
1446
|
+
"floating-ui-" + Math.random().toString(36).slice(2, 6) + Vo++
|
|
1447
1447
|
);
|
|
1448
|
-
function
|
|
1449
|
-
const [e, t] =
|
|
1448
|
+
function Wo() {
|
|
1449
|
+
const [e, t] = g.useState(() => lt ? ut() : void 0);
|
|
1450
1450
|
return Q(() => {
|
|
1451
|
-
e == null && t(
|
|
1452
|
-
}, []),
|
|
1453
|
-
|
|
1451
|
+
e == null && t(ut());
|
|
1452
|
+
}, []), g.useEffect(() => {
|
|
1453
|
+
lt = !0;
|
|
1454
1454
|
}, []), e;
|
|
1455
1455
|
}
|
|
1456
|
-
const
|
|
1456
|
+
const Ho = _o.useId, Ke = Ho || Wo;
|
|
1457
1457
|
let Be;
|
|
1458
1458
|
process.env.NODE_ENV !== "production" && (Be = /* @__PURE__ */ new Set());
|
|
1459
|
-
function
|
|
1459
|
+
function Ko() {
|
|
1460
1460
|
for (var e, t = arguments.length, n = new Array(t), o = 0; o < t; o++)
|
|
1461
1461
|
n[o] = arguments[o];
|
|
1462
1462
|
const r = "Floating UI: " + n.join(" ");
|
|
@@ -1465,7 +1465,7 @@ function Wo() {
|
|
|
1465
1465
|
(i = Be) == null || i.add(r), console.error(r);
|
|
1466
1466
|
}
|
|
1467
1467
|
}
|
|
1468
|
-
function
|
|
1468
|
+
function jo() {
|
|
1469
1469
|
const e = /* @__PURE__ */ new Map();
|
|
1470
1470
|
return {
|
|
1471
1471
|
emit(t, n) {
|
|
@@ -1481,14 +1481,14 @@ function Ho() {
|
|
|
1481
1481
|
}
|
|
1482
1482
|
};
|
|
1483
1483
|
}
|
|
1484
|
-
const
|
|
1484
|
+
const qo = /* @__PURE__ */ g.createContext(null), Uo = /* @__PURE__ */ g.createContext(null), _t = () => {
|
|
1485
1485
|
var e;
|
|
1486
|
-
return ((e =
|
|
1487
|
-
},
|
|
1488
|
-
function
|
|
1486
|
+
return ((e = g.useContext(qo)) == null ? void 0 : e.id) || null;
|
|
1487
|
+
}, Vt = () => g.useContext(Uo);
|
|
1488
|
+
function je(e) {
|
|
1489
1489
|
return "data-floating-ui-" + e;
|
|
1490
1490
|
}
|
|
1491
|
-
const
|
|
1491
|
+
const Yo = {
|
|
1492
1492
|
border: 0,
|
|
1493
1493
|
clip: "rect(0 0 0 0)",
|
|
1494
1494
|
height: "1px",
|
|
@@ -1500,10 +1500,10 @@ const Uo = {
|
|
|
1500
1500
|
width: "1px",
|
|
1501
1501
|
top: 0,
|
|
1502
1502
|
left: 0
|
|
1503
|
-
},
|
|
1504
|
-
const [o, r] =
|
|
1503
|
+
}, ft = /* @__PURE__ */ g.forwardRef(function(t, n) {
|
|
1504
|
+
const [o, r] = g.useState();
|
|
1505
1505
|
Q(() => {
|
|
1506
|
-
|
|
1506
|
+
Hn() && r("button");
|
|
1507
1507
|
}, []);
|
|
1508
1508
|
const i = {
|
|
1509
1509
|
ref: n,
|
|
@@ -1511,25 +1511,25 @@ const Uo = {
|
|
|
1511
1511
|
// Role is only for VoiceOver
|
|
1512
1512
|
role: o,
|
|
1513
1513
|
"aria-hidden": o ? void 0 : !0,
|
|
1514
|
-
[
|
|
1515
|
-
style:
|
|
1514
|
+
[je("focus-guard")]: "",
|
|
1515
|
+
style: Yo
|
|
1516
1516
|
};
|
|
1517
|
-
return /* @__PURE__ */
|
|
1517
|
+
return /* @__PURE__ */ H("span", {
|
|
1518
1518
|
...t,
|
|
1519
1519
|
...i
|
|
1520
1520
|
});
|
|
1521
|
-
}),
|
|
1521
|
+
}), Xo = {
|
|
1522
1522
|
clipPath: "inset(50%)",
|
|
1523
1523
|
position: "fixed",
|
|
1524
1524
|
top: 0,
|
|
1525
1525
|
left: 0
|
|
1526
|
-
},
|
|
1527
|
-
function
|
|
1526
|
+
}, Wt = /* @__PURE__ */ g.createContext(null), dt = /* @__PURE__ */ je("portal");
|
|
1527
|
+
function zo(e) {
|
|
1528
1528
|
e === void 0 && (e = {});
|
|
1529
1529
|
const {
|
|
1530
1530
|
id: t,
|
|
1531
1531
|
root: n
|
|
1532
|
-
} = e, o =
|
|
1532
|
+
} = e, o = Ke(), r = Zo(), [i, s] = g.useState(null), c = g.useRef(null);
|
|
1533
1533
|
return Q(() => () => {
|
|
1534
1534
|
i == null || i.remove(), queueMicrotask(() => {
|
|
1535
1535
|
c.current = null;
|
|
@@ -1539,46 +1539,46 @@ function qo(e) {
|
|
|
1539
1539
|
const a = t ? document.getElementById(t) : null;
|
|
1540
1540
|
if (!a) return;
|
|
1541
1541
|
const l = document.createElement("div");
|
|
1542
|
-
l.id = o, l.setAttribute(
|
|
1542
|
+
l.id = o, l.setAttribute(dt, ""), a.appendChild(l), c.current = l, s(l);
|
|
1543
1543
|
}, [t, o]), Q(() => {
|
|
1544
1544
|
if (n === null || !o || c.current) return;
|
|
1545
1545
|
let a = n || (r == null ? void 0 : r.portalNode);
|
|
1546
|
-
a && !
|
|
1546
|
+
a && !Ve(a) && (a = a.current), a = a || document.body;
|
|
1547
1547
|
let l = null;
|
|
1548
1548
|
t && (l = document.createElement("div"), l.id = t, a.appendChild(l));
|
|
1549
1549
|
const u = document.createElement("div");
|
|
1550
|
-
u.id = o, u.setAttribute(
|
|
1550
|
+
u.id = o, u.setAttribute(dt, ""), a = l || a, a.appendChild(u), c.current = u, s(u);
|
|
1551
1551
|
}, [t, n, o, r]), i;
|
|
1552
1552
|
}
|
|
1553
|
-
function
|
|
1553
|
+
function Go(e) {
|
|
1554
1554
|
const {
|
|
1555
1555
|
children: t,
|
|
1556
1556
|
id: n,
|
|
1557
1557
|
root: o,
|
|
1558
1558
|
preserveTabOrder: r = !0
|
|
1559
|
-
} = e, i =
|
|
1559
|
+
} = e, i = zo({
|
|
1560
1560
|
id: n,
|
|
1561
1561
|
root: o
|
|
1562
|
-
}), [s, c] =
|
|
1562
|
+
}), [s, c] = g.useState(null), a = g.useRef(null), l = g.useRef(null), u = g.useRef(null), f = g.useRef(null), m = s == null ? void 0 : s.modal, d = s == null ? void 0 : s.open, v = (
|
|
1563
1563
|
// The FocusManager and therefore floating element are currently open/
|
|
1564
1564
|
// rendered.
|
|
1565
1565
|
!!s && // Guards are only for non-modal focus management.
|
|
1566
1566
|
!s.modal && // Don't render if unmount is transitioning.
|
|
1567
1567
|
s.open && r && !!(o || i)
|
|
1568
1568
|
);
|
|
1569
|
-
return
|
|
1570
|
-
if (!i || !r ||
|
|
1569
|
+
return g.useEffect(() => {
|
|
1570
|
+
if (!i || !r || m)
|
|
1571
1571
|
return;
|
|
1572
|
-
function p(
|
|
1573
|
-
i && Oe(
|
|
1572
|
+
function p(b) {
|
|
1573
|
+
i && Oe(b) && (b.type === "focusin" ? tt : no)(i);
|
|
1574
1574
|
}
|
|
1575
1575
|
return i.addEventListener("focusin", p, !0), i.addEventListener("focusout", p, !0), () => {
|
|
1576
1576
|
i.removeEventListener("focusin", p, !0), i.removeEventListener("focusout", p, !0);
|
|
1577
1577
|
};
|
|
1578
|
-
}, [i, r,
|
|
1579
|
-
i && (d ||
|
|
1580
|
-
}, [d, i]), /* @__PURE__ */
|
|
1581
|
-
value:
|
|
1578
|
+
}, [i, r, m]), g.useEffect(() => {
|
|
1579
|
+
i && (d || tt(i));
|
|
1580
|
+
}, [d, i]), /* @__PURE__ */ Qt(Wt.Provider, {
|
|
1581
|
+
value: g.useMemo(() => ({
|
|
1582
1582
|
preserveTabOrder: r,
|
|
1583
1583
|
beforeOutsideRef: a,
|
|
1584
1584
|
afterOutsideRef: l,
|
|
@@ -1587,47 +1587,47 @@ function Xo(e) {
|
|
|
1587
1587
|
portalNode: i,
|
|
1588
1588
|
setFocusManagerState: c
|
|
1589
1589
|
}), [r, i]),
|
|
1590
|
-
children: [
|
|
1590
|
+
children: [v && i && /* @__PURE__ */ H(ft, {
|
|
1591
1591
|
"data-type": "outside",
|
|
1592
1592
|
ref: a,
|
|
1593
1593
|
onFocus: (p) => {
|
|
1594
1594
|
if (Oe(p, i)) {
|
|
1595
|
-
var
|
|
1596
|
-
(
|
|
1595
|
+
var b;
|
|
1596
|
+
(b = u.current) == null || b.focus();
|
|
1597
1597
|
} else {
|
|
1598
|
-
const
|
|
1598
|
+
const h = s ? s.domReference : null, w = to(h);
|
|
1599
1599
|
w == null || w.focus();
|
|
1600
1600
|
}
|
|
1601
1601
|
}
|
|
1602
|
-
}),
|
|
1602
|
+
}), v && i && /* @__PURE__ */ H("span", {
|
|
1603
1603
|
"aria-owns": i.id,
|
|
1604
|
-
style:
|
|
1605
|
-
}), i && /* @__PURE__ */
|
|
1604
|
+
style: Xo
|
|
1605
|
+
}), i && /* @__PURE__ */ bt.createPortal(t, i), v && i && /* @__PURE__ */ H(ft, {
|
|
1606
1606
|
"data-type": "outside",
|
|
1607
1607
|
ref: l,
|
|
1608
1608
|
onFocus: (p) => {
|
|
1609
1609
|
if (Oe(p, i)) {
|
|
1610
|
-
var
|
|
1611
|
-
(
|
|
1610
|
+
var b;
|
|
1611
|
+
(b = f.current) == null || b.focus();
|
|
1612
1612
|
} else {
|
|
1613
|
-
const
|
|
1613
|
+
const h = s ? s.domReference : null, w = eo(h);
|
|
1614
1614
|
w == null || w.focus(), s != null && s.closeOnFocusOut && (s == null || s.onOpenChange(!1, p.nativeEvent, "focus-out"));
|
|
1615
1615
|
}
|
|
1616
1616
|
}
|
|
1617
1617
|
})]
|
|
1618
1618
|
});
|
|
1619
1619
|
}
|
|
1620
|
-
const
|
|
1621
|
-
function
|
|
1622
|
-
return
|
|
1620
|
+
const Zo = () => g.useContext(Wt);
|
|
1621
|
+
function pt(e) {
|
|
1622
|
+
return N(e.target) && e.target.tagName === "BUTTON";
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1625
|
-
return
|
|
1624
|
+
function Jo(e) {
|
|
1625
|
+
return N(e.target) && e.target.tagName === "A";
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1628
|
-
return
|
|
1627
|
+
function mt(e) {
|
|
1628
|
+
return Un(e);
|
|
1629
1629
|
}
|
|
1630
|
-
function
|
|
1630
|
+
function Qo(e, t) {
|
|
1631
1631
|
t === void 0 && (t = {});
|
|
1632
1632
|
const {
|
|
1633
1633
|
open: n,
|
|
@@ -1643,38 +1643,38 @@ function Zo(e, t) {
|
|
|
1643
1643
|
ignoreMouse: l = !1,
|
|
1644
1644
|
keyboardHandlers: u = !0,
|
|
1645
1645
|
stickIfOpen: f = !0
|
|
1646
|
-
} = t,
|
|
1646
|
+
} = t, m = g.useRef(), d = g.useRef(!1), v = g.useMemo(() => ({
|
|
1647
1647
|
onPointerDown(p) {
|
|
1648
|
-
|
|
1648
|
+
m.current = p.pointerType;
|
|
1649
1649
|
},
|
|
1650
1650
|
onMouseDown(p) {
|
|
1651
|
-
const
|
|
1652
|
-
p.button === 0 && c !== "click" && (
|
|
1651
|
+
const b = m.current;
|
|
1652
|
+
p.button === 0 && c !== "click" && (et(b) && l || (n && a && (!(r.current.openEvent && f) || r.current.openEvent.type === "mousedown") ? o(!1, p.nativeEvent, "click") : (p.preventDefault(), o(!0, p.nativeEvent, "click"))));
|
|
1653
1653
|
},
|
|
1654
1654
|
onClick(p) {
|
|
1655
|
-
const
|
|
1656
|
-
if (c === "mousedown" &&
|
|
1657
|
-
|
|
1655
|
+
const b = m.current;
|
|
1656
|
+
if (c === "mousedown" && m.current) {
|
|
1657
|
+
m.current = void 0;
|
|
1658
1658
|
return;
|
|
1659
1659
|
}
|
|
1660
|
-
|
|
1660
|
+
et(b) && l || (n && a && (!(r.current.openEvent && f) || r.current.openEvent.type === "click") ? o(!1, p.nativeEvent, "click") : o(!0, p.nativeEvent, "click"));
|
|
1661
1661
|
},
|
|
1662
1662
|
onKeyDown(p) {
|
|
1663
|
-
|
|
1663
|
+
m.current = void 0, !(p.defaultPrevented || !u || pt(p)) && (p.key === " " && !mt(i) && (p.preventDefault(), d.current = !0), !Jo(p) && p.key === "Enter" && o(!(n && a), p.nativeEvent, "click"));
|
|
1664
1664
|
},
|
|
1665
1665
|
onKeyUp(p) {
|
|
1666
|
-
p.defaultPrevented || !u ||
|
|
1666
|
+
p.defaultPrevented || !u || pt(p) || mt(i) || p.key === " " && d.current && (d.current = !1, o(!(n && a), p.nativeEvent, "click"));
|
|
1667
1667
|
}
|
|
1668
1668
|
}), [r, i, c, l, u, o, n, f, a]);
|
|
1669
|
-
return
|
|
1670
|
-
reference:
|
|
1671
|
-
} : {}, [s,
|
|
1669
|
+
return g.useMemo(() => s ? {
|
|
1670
|
+
reference: v
|
|
1671
|
+
} : {}, [s, v]);
|
|
1672
1672
|
}
|
|
1673
|
-
const
|
|
1673
|
+
const er = {
|
|
1674
1674
|
pointerdown: "onPointerDown",
|
|
1675
1675
|
mousedown: "onMouseDown",
|
|
1676
1676
|
click: "onClick"
|
|
1677
|
-
},
|
|
1677
|
+
}, tr = {
|
|
1678
1678
|
pointerdown: "onPointerDownCapture",
|
|
1679
1679
|
mousedown: "onMouseDownCapture",
|
|
1680
1680
|
click: "onClickCapture"
|
|
@@ -1685,7 +1685,7 @@ const Jo = {
|
|
|
1685
1685
|
outsidePress: typeof e == "boolean" ? e : (n = e == null ? void 0 : e.outsidePress) != null ? n : !0
|
|
1686
1686
|
};
|
|
1687
1687
|
};
|
|
1688
|
-
function
|
|
1688
|
+
function nr(e, t) {
|
|
1689
1689
|
t === void 0 && (t = {});
|
|
1690
1690
|
const {
|
|
1691
1691
|
open: n,
|
|
@@ -1699,134 +1699,134 @@ function er(e, t) {
|
|
|
1699
1699
|
outsidePressEvent: l = "pointerdown",
|
|
1700
1700
|
referencePress: u = !1,
|
|
1701
1701
|
referencePressEvent: f = "pointerdown",
|
|
1702
|
-
ancestorScroll:
|
|
1702
|
+
ancestorScroll: m = !1,
|
|
1703
1703
|
bubbles: d,
|
|
1704
|
-
capture:
|
|
1705
|
-
} = t, p =
|
|
1704
|
+
capture: v
|
|
1705
|
+
} = t, p = Vt(), b = ne(typeof a == "function" ? a : () => !1), h = typeof a == "function" ? b : a, w = g.useRef(!1), {
|
|
1706
1706
|
escapeKey: x,
|
|
1707
1707
|
outsidePress: E
|
|
1708
1708
|
} = gt(d), {
|
|
1709
1709
|
escapeKey: C,
|
|
1710
1710
|
outsidePress: T
|
|
1711
|
-
} = gt(
|
|
1712
|
-
var
|
|
1713
|
-
if (!n || !s || !c || R.key !== "Escape" ||
|
|
1711
|
+
} = gt(v), M = g.useRef(!1), k = ne((R) => {
|
|
1712
|
+
var L;
|
|
1713
|
+
if (!n || !s || !c || R.key !== "Escape" || M.current)
|
|
1714
1714
|
return;
|
|
1715
|
-
const O = (
|
|
1715
|
+
const O = (L = i.current.floatingContext) == null ? void 0 : L.nodeId, P = p ? fe(p.nodesRef.current, O) : [];
|
|
1716
1716
|
if (!x && (R.stopPropagation(), P.length > 0)) {
|
|
1717
|
-
let
|
|
1717
|
+
let y = !0;
|
|
1718
1718
|
if (P.forEach((A) => {
|
|
1719
1719
|
var I;
|
|
1720
1720
|
if ((I = A.context) != null && I.open && !A.context.dataRef.current.__escapeKeyBubbles) {
|
|
1721
|
-
|
|
1721
|
+
y = !1;
|
|
1722
1722
|
return;
|
|
1723
1723
|
}
|
|
1724
|
-
}), !
|
|
1724
|
+
}), !y)
|
|
1725
1725
|
return;
|
|
1726
1726
|
}
|
|
1727
|
-
o(!1,
|
|
1728
|
-
}),
|
|
1729
|
-
var
|
|
1727
|
+
o(!1, Xn(R) ? R.nativeEvent : R, "escape-key");
|
|
1728
|
+
}), B = ne((R) => {
|
|
1729
|
+
var L;
|
|
1730
1730
|
const O = () => {
|
|
1731
1731
|
var P;
|
|
1732
1732
|
k(R), (P = se(R)) == null || P.removeEventListener("keydown", O);
|
|
1733
1733
|
};
|
|
1734
|
-
(
|
|
1735
|
-
}),
|
|
1736
|
-
var
|
|
1734
|
+
(L = se(R)) == null || L.addEventListener("keydown", O);
|
|
1735
|
+
}), S = ne((R) => {
|
|
1736
|
+
var L;
|
|
1737
1737
|
const O = i.current.insideReactTree;
|
|
1738
1738
|
i.current.insideReactTree = !1;
|
|
1739
1739
|
const P = w.current;
|
|
1740
|
-
if (w.current = !1, l === "click" && P || O || typeof
|
|
1740
|
+
if (w.current = !1, l === "click" && P || O || typeof h == "function" && !h(R))
|
|
1741
1741
|
return;
|
|
1742
|
-
const
|
|
1743
|
-
let z = D(
|
|
1744
|
-
for (; z && !
|
|
1745
|
-
const
|
|
1746
|
-
if (
|
|
1742
|
+
const y = se(R), A = "[" + je("inert") + "]", I = ae(r.floating).querySelectorAll(A);
|
|
1743
|
+
let z = D(y) ? y : null;
|
|
1744
|
+
for (; z && !U(z); ) {
|
|
1745
|
+
const F = Y(z);
|
|
1746
|
+
if (U(F) || !D(F))
|
|
1747
1747
|
break;
|
|
1748
|
-
z =
|
|
1748
|
+
z = F;
|
|
1749
1749
|
}
|
|
1750
|
-
if (I.length && D(
|
|
1751
|
-
!$e(
|
|
1750
|
+
if (I.length && D(y) && !qn(y) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
1751
|
+
!$e(y, r.floating) && // If the target root element contains none of the markers, then the
|
|
1752
1752
|
// element was injected after the floating element rendered.
|
|
1753
|
-
Array.from(I).every((
|
|
1753
|
+
Array.from(I).every((F) => !$e(z, F)))
|
|
1754
1754
|
return;
|
|
1755
|
-
if (
|
|
1756
|
-
const
|
|
1757
|
-
if (
|
|
1755
|
+
if (N(y) && V) {
|
|
1756
|
+
const F = U(y), q = W(y), ie = /auto|scroll/, Ut = F || ie.test(q.overflowX), Yt = F || ie.test(q.overflowY), Xt = Ut && y.clientWidth > 0 && y.scrollWidth > y.clientWidth, zt = Yt && y.clientHeight > 0 && y.scrollHeight > y.clientHeight, Gt = q.direction === "rtl", Zt = zt && (Gt ? R.offsetX <= y.offsetWidth - y.clientWidth : R.offsetX > y.clientWidth), Jt = Xt && R.offsetY > y.clientHeight;
|
|
1757
|
+
if (Zt || Jt)
|
|
1758
1758
|
return;
|
|
1759
1759
|
}
|
|
1760
|
-
const Ue = (
|
|
1761
|
-
var
|
|
1762
|
-
return Ae(R, (
|
|
1760
|
+
const Ue = (L = i.current.floatingContext) == null ? void 0 : L.nodeId, qt = p && fe(p.nodesRef.current, Ue).some((F) => {
|
|
1761
|
+
var q;
|
|
1762
|
+
return Ae(R, (q = F.context) == null ? void 0 : q.elements.floating);
|
|
1763
1763
|
});
|
|
1764
|
-
if (Ae(R, r.floating) || Ae(R, r.domReference) ||
|
|
1764
|
+
if (Ae(R, r.floating) || Ae(R, r.domReference) || qt)
|
|
1765
1765
|
return;
|
|
1766
1766
|
const Ye = p ? fe(p.nodesRef.current, Ue) : [];
|
|
1767
1767
|
if (Ye.length > 0) {
|
|
1768
|
-
let
|
|
1769
|
-
if (Ye.forEach((
|
|
1768
|
+
let F = !0;
|
|
1769
|
+
if (Ye.forEach((q) => {
|
|
1770
1770
|
var ie;
|
|
1771
|
-
if ((ie =
|
|
1772
|
-
|
|
1771
|
+
if ((ie = q.context) != null && ie.open && !q.context.dataRef.current.__outsidePressBubbles) {
|
|
1772
|
+
F = !1;
|
|
1773
1773
|
return;
|
|
1774
1774
|
}
|
|
1775
|
-
}),
|
|
1775
|
+
}), !F)
|
|
1776
1776
|
return;
|
|
1777
1777
|
}
|
|
1778
1778
|
o(!1, R, "outside-press");
|
|
1779
|
-
}),
|
|
1780
|
-
var
|
|
1779
|
+
}), _ = ne((R) => {
|
|
1780
|
+
var L;
|
|
1781
1781
|
const O = () => {
|
|
1782
1782
|
var P;
|
|
1783
|
-
|
|
1783
|
+
S(R), (P = se(R)) == null || P.removeEventListener(l, O);
|
|
1784
1784
|
};
|
|
1785
|
-
(
|
|
1785
|
+
(L = se(R)) == null || L.addEventListener(l, O);
|
|
1786
1786
|
});
|
|
1787
|
-
|
|
1787
|
+
g.useEffect(() => {
|
|
1788
1788
|
if (!n || !s)
|
|
1789
1789
|
return;
|
|
1790
1790
|
i.current.__escapeKeyBubbles = x, i.current.__outsidePressBubbles = E;
|
|
1791
1791
|
let R = -1;
|
|
1792
|
-
function
|
|
1792
|
+
function L(I) {
|
|
1793
1793
|
o(!1, I, "ancestor-scroll");
|
|
1794
1794
|
}
|
|
1795
1795
|
function O() {
|
|
1796
|
-
window.clearTimeout(R),
|
|
1796
|
+
window.clearTimeout(R), M.current = !0;
|
|
1797
1797
|
}
|
|
1798
1798
|
function P() {
|
|
1799
1799
|
R = window.setTimeout(
|
|
1800
1800
|
() => {
|
|
1801
|
-
|
|
1801
|
+
M.current = !1;
|
|
1802
1802
|
},
|
|
1803
1803
|
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
1804
1804
|
// Only apply to WebKit for the test to remain 0ms.
|
|
1805
1805
|
Re() ? 5 : 0
|
|
1806
1806
|
);
|
|
1807
1807
|
}
|
|
1808
|
-
const
|
|
1809
|
-
c && (
|
|
1808
|
+
const y = ae(r.floating);
|
|
1809
|
+
c && (y.addEventListener("keydown", C ? B : k, C), y.addEventListener("compositionstart", O), y.addEventListener("compositionend", P)), h && y.addEventListener(l, T ? _ : S, T);
|
|
1810
1810
|
let A = [];
|
|
1811
|
-
return
|
|
1811
|
+
return m && (D(r.domReference) && (A = Z(r.domReference)), D(r.floating) && (A = A.concat(Z(r.floating))), !D(r.reference) && r.reference && r.reference.contextElement && (A = A.concat(Z(r.reference.contextElement)))), A = A.filter((I) => {
|
|
1812
1812
|
var z;
|
|
1813
|
-
return I !== ((z =
|
|
1813
|
+
return I !== ((z = y.defaultView) == null ? void 0 : z.visualViewport);
|
|
1814
1814
|
}), A.forEach((I) => {
|
|
1815
|
-
I.addEventListener("scroll",
|
|
1815
|
+
I.addEventListener("scroll", L, {
|
|
1816
1816
|
passive: !0
|
|
1817
1817
|
});
|
|
1818
1818
|
}), () => {
|
|
1819
|
-
c && (
|
|
1820
|
-
I.removeEventListener("scroll",
|
|
1819
|
+
c && (y.removeEventListener("keydown", C ? B : k, C), y.removeEventListener("compositionstart", O), y.removeEventListener("compositionend", P)), h && y.removeEventListener(l, T ? _ : S, T), A.forEach((I) => {
|
|
1820
|
+
I.removeEventListener("scroll", L);
|
|
1821
1821
|
}), window.clearTimeout(R);
|
|
1822
1822
|
};
|
|
1823
|
-
}, [i, r, c,
|
|
1823
|
+
}, [i, r, c, h, l, n, o, m, s, x, E, k, C, B, S, T, _]), g.useEffect(() => {
|
|
1824
1824
|
i.current.insideReactTree = !1;
|
|
1825
|
-
}, [i,
|
|
1826
|
-
const X =
|
|
1825
|
+
}, [i, h, l]);
|
|
1826
|
+
const X = g.useMemo(() => ({
|
|
1827
1827
|
onKeyDown: k,
|
|
1828
1828
|
...u && {
|
|
1829
|
-
[
|
|
1829
|
+
[er[f]]: (R) => {
|
|
1830
1830
|
o(!1, R.nativeEvent, "reference-press");
|
|
1831
1831
|
},
|
|
1832
1832
|
...f !== "click" && {
|
|
@@ -1835,7 +1835,7 @@ function er(e, t) {
|
|
|
1835
1835
|
}
|
|
1836
1836
|
}
|
|
1837
1837
|
}
|
|
1838
|
-
}), [k, o, u, f]),
|
|
1838
|
+
}), [k, o, u, f]), V = g.useMemo(() => ({
|
|
1839
1839
|
onKeyDown: k,
|
|
1840
1840
|
onMouseDown() {
|
|
1841
1841
|
w.current = !0;
|
|
@@ -1843,65 +1843,65 @@ function er(e, t) {
|
|
|
1843
1843
|
onMouseUp() {
|
|
1844
1844
|
w.current = !0;
|
|
1845
1845
|
},
|
|
1846
|
-
[
|
|
1846
|
+
[tr[l]]: () => {
|
|
1847
1847
|
i.current.insideReactTree = !0;
|
|
1848
1848
|
}
|
|
1849
1849
|
}), [k, l, i]);
|
|
1850
|
-
return
|
|
1850
|
+
return g.useMemo(() => s ? {
|
|
1851
1851
|
reference: X,
|
|
1852
|
-
floating:
|
|
1853
|
-
} : {}, [s, X,
|
|
1852
|
+
floating: V
|
|
1853
|
+
} : {}, [s, X, V]);
|
|
1854
1854
|
}
|
|
1855
|
-
function
|
|
1855
|
+
function or(e) {
|
|
1856
1856
|
const {
|
|
1857
1857
|
open: t = !1,
|
|
1858
1858
|
onOpenChange: n,
|
|
1859
1859
|
elements: o
|
|
1860
|
-
} = e, r =
|
|
1860
|
+
} = e, r = Ke(), i = g.useRef({}), [s] = g.useState(() => jo()), c = _t() != null;
|
|
1861
1861
|
if (process.env.NODE_ENV !== "production") {
|
|
1862
1862
|
const d = o.reference;
|
|
1863
|
-
d && !D(d) &&
|
|
1863
|
+
d && !D(d) && Ko("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
1864
1864
|
}
|
|
1865
|
-
const [a, l] =
|
|
1866
|
-
i.current.openEvent = d ?
|
|
1865
|
+
const [a, l] = g.useState(o.reference), u = ne((d, v, p) => {
|
|
1866
|
+
i.current.openEvent = d ? v : void 0, s.emit("openchange", {
|
|
1867
1867
|
open: d,
|
|
1868
|
-
event:
|
|
1868
|
+
event: v,
|
|
1869
1869
|
reason: p,
|
|
1870
1870
|
nested: c
|
|
1871
|
-
}), n == null || n(d,
|
|
1872
|
-
}), f =
|
|
1871
|
+
}), n == null || n(d, v, p);
|
|
1872
|
+
}), f = g.useMemo(() => ({
|
|
1873
1873
|
setPositionReference: l
|
|
1874
|
-
}), []),
|
|
1874
|
+
}), []), m = g.useMemo(() => ({
|
|
1875
1875
|
reference: a || o.reference || null,
|
|
1876
1876
|
floating: o.floating || null,
|
|
1877
1877
|
domReference: o.reference
|
|
1878
1878
|
}), [a, o.reference, o.floating]);
|
|
1879
|
-
return
|
|
1879
|
+
return g.useMemo(() => ({
|
|
1880
1880
|
dataRef: i,
|
|
1881
1881
|
open: t,
|
|
1882
1882
|
onOpenChange: u,
|
|
1883
|
-
elements:
|
|
1883
|
+
elements: m,
|
|
1884
1884
|
events: s,
|
|
1885
1885
|
floatingId: r,
|
|
1886
1886
|
refs: f
|
|
1887
|
-
}), [t, u,
|
|
1887
|
+
}), [t, u, m, s, r, f]);
|
|
1888
1888
|
}
|
|
1889
|
-
function
|
|
1889
|
+
function rr(e) {
|
|
1890
1890
|
e === void 0 && (e = {});
|
|
1891
1891
|
const {
|
|
1892
1892
|
nodeId: t
|
|
1893
|
-
} = e, n =
|
|
1893
|
+
} = e, n = or({
|
|
1894
1894
|
...e,
|
|
1895
1895
|
elements: {
|
|
1896
1896
|
reference: null,
|
|
1897
1897
|
floating: null,
|
|
1898
1898
|
...e.elements
|
|
1899
1899
|
}
|
|
1900
|
-
}), o = e.rootContext || n, r = o.elements, [i, s] =
|
|
1900
|
+
}), o = e.rootContext || n, r = o.elements, [i, s] = g.useState(null), [c, a] = g.useState(null), u = (r == null ? void 0 : r.domReference) || i, f = g.useRef(null), m = Vt();
|
|
1901
1901
|
Q(() => {
|
|
1902
1902
|
u && (f.current = u);
|
|
1903
1903
|
}, [u]);
|
|
1904
|
-
const d =
|
|
1904
|
+
const d = ko({
|
|
1905
1905
|
...e,
|
|
1906
1906
|
elements: {
|
|
1907
1907
|
...r,
|
|
@@ -1909,51 +1909,51 @@ function nr(e) {
|
|
|
1909
1909
|
reference: c
|
|
1910
1910
|
}
|
|
1911
1911
|
}
|
|
1912
|
-
}),
|
|
1912
|
+
}), v = g.useCallback((x) => {
|
|
1913
1913
|
const E = D(x) ? {
|
|
1914
1914
|
getBoundingClientRect: () => x.getBoundingClientRect(),
|
|
1915
1915
|
getClientRects: () => x.getClientRects(),
|
|
1916
1916
|
contextElement: x
|
|
1917
1917
|
} : x;
|
|
1918
1918
|
a(E), d.refs.setReference(E);
|
|
1919
|
-
}, [d.refs]), p =
|
|
1919
|
+
}, [d.refs]), p = g.useCallback((x) => {
|
|
1920
1920
|
(D(x) || x === null) && (f.current = x, s(x)), (D(d.refs.reference.current) || d.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
1921
1921
|
// `null` to support `positionReference` + an unstable `reference`
|
|
1922
1922
|
// callback ref.
|
|
1923
1923
|
x !== null && !D(x)) && d.refs.setReference(x);
|
|
1924
|
-
}, [d.refs]),
|
|
1924
|
+
}, [d.refs]), b = g.useMemo(() => ({
|
|
1925
1925
|
...d.refs,
|
|
1926
1926
|
setReference: p,
|
|
1927
|
-
setPositionReference:
|
|
1927
|
+
setPositionReference: v,
|
|
1928
1928
|
domReference: f
|
|
1929
|
-
}), [d.refs, p,
|
|
1929
|
+
}), [d.refs, p, v]), h = g.useMemo(() => ({
|
|
1930
1930
|
...d.elements,
|
|
1931
1931
|
domReference: u
|
|
1932
|
-
}), [d.elements, u]), w =
|
|
1932
|
+
}), [d.elements, u]), w = g.useMemo(() => ({
|
|
1933
1933
|
...d,
|
|
1934
1934
|
...o,
|
|
1935
|
-
refs:
|
|
1936
|
-
elements:
|
|
1935
|
+
refs: b,
|
|
1936
|
+
elements: h,
|
|
1937
1937
|
nodeId: t
|
|
1938
|
-
}), [d,
|
|
1938
|
+
}), [d, b, h, t, o]);
|
|
1939
1939
|
return Q(() => {
|
|
1940
1940
|
o.dataRef.current.floatingContext = w;
|
|
1941
|
-
const x =
|
|
1941
|
+
const x = m == null ? void 0 : m.nodesRef.current.find((E) => E.id === t);
|
|
1942
1942
|
x && (x.context = w);
|
|
1943
|
-
}),
|
|
1943
|
+
}), g.useMemo(() => ({
|
|
1944
1944
|
...d,
|
|
1945
1945
|
context: w,
|
|
1946
|
-
refs:
|
|
1947
|
-
elements:
|
|
1948
|
-
}), [d,
|
|
1946
|
+
refs: b,
|
|
1947
|
+
elements: h
|
|
1948
|
+
}), [d, b, h, w]);
|
|
1949
1949
|
}
|
|
1950
1950
|
function De(e, t, n) {
|
|
1951
1951
|
const o = /* @__PURE__ */ new Map(), r = n === "item";
|
|
1952
1952
|
let i = e;
|
|
1953
1953
|
if (r && e) {
|
|
1954
1954
|
const {
|
|
1955
|
-
[
|
|
1956
|
-
[
|
|
1955
|
+
[ct]: s,
|
|
1956
|
+
[at]: c,
|
|
1957
1957
|
...a
|
|
1958
1958
|
} = e;
|
|
1959
1959
|
i = a;
|
|
@@ -1961,7 +1961,7 @@ function De(e, t, n) {
|
|
|
1961
1961
|
return {
|
|
1962
1962
|
...n === "floating" && {
|
|
1963
1963
|
tabIndex: -1,
|
|
1964
|
-
[
|
|
1964
|
+
[Bo]: ""
|
|
1965
1965
|
},
|
|
1966
1966
|
...i,
|
|
1967
1967
|
...t.map((s) => {
|
|
@@ -1969,14 +1969,14 @@ function De(e, t, n) {
|
|
|
1969
1969
|
return typeof c == "function" ? e ? c(e) : null : c;
|
|
1970
1970
|
}).concat(e).reduce((s, c) => (c && Object.entries(c).forEach((a) => {
|
|
1971
1971
|
let [l, u] = a;
|
|
1972
|
-
if (!(r && [
|
|
1972
|
+
if (!(r && [ct, at].includes(l)))
|
|
1973
1973
|
if (l.indexOf("on") === 0) {
|
|
1974
1974
|
if (o.has(l) || o.set(l, []), typeof u == "function") {
|
|
1975
1975
|
var f;
|
|
1976
1976
|
(f = o.get(l)) == null || f.push(u), s[l] = function() {
|
|
1977
|
-
for (var
|
|
1978
|
-
|
|
1979
|
-
return (
|
|
1977
|
+
for (var m, d = arguments.length, v = new Array(d), p = 0; p < d; p++)
|
|
1978
|
+
v[p] = arguments[p];
|
|
1979
|
+
return (m = o.get(l)) == null ? void 0 : m.map((b) => b(...v)).find((b) => b !== void 0);
|
|
1980
1980
|
};
|
|
1981
1981
|
}
|
|
1982
1982
|
} else
|
|
@@ -1984,29 +1984,29 @@ function De(e, t, n) {
|
|
|
1984
1984
|
}), s), {})
|
|
1985
1985
|
};
|
|
1986
1986
|
}
|
|
1987
|
-
function
|
|
1987
|
+
function ir(e) {
|
|
1988
1988
|
e === void 0 && (e = []);
|
|
1989
|
-
const t = e.map((c) => c == null ? void 0 : c.reference), n = e.map((c) => c == null ? void 0 : c.floating), o = e.map((c) => c == null ? void 0 : c.item), r =
|
|
1989
|
+
const t = e.map((c) => c == null ? void 0 : c.reference), n = e.map((c) => c == null ? void 0 : c.floating), o = e.map((c) => c == null ? void 0 : c.item), r = g.useCallback(
|
|
1990
1990
|
(c) => De(c, e, "reference"),
|
|
1991
1991
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1992
1992
|
t
|
|
1993
|
-
), i =
|
|
1993
|
+
), i = g.useCallback(
|
|
1994
1994
|
(c) => De(c, e, "floating"),
|
|
1995
1995
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1996
1996
|
n
|
|
1997
|
-
), s =
|
|
1997
|
+
), s = g.useCallback(
|
|
1998
1998
|
(c) => De(c, e, "item"),
|
|
1999
1999
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2000
2000
|
o
|
|
2001
2001
|
);
|
|
2002
|
-
return
|
|
2002
|
+
return g.useMemo(() => ({
|
|
2003
2003
|
getReferenceProps: r,
|
|
2004
2004
|
getFloatingProps: i,
|
|
2005
2005
|
getItemProps: s
|
|
2006
2006
|
}), [r, i, s]);
|
|
2007
2007
|
}
|
|
2008
|
-
const
|
|
2009
|
-
function
|
|
2008
|
+
const sr = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
|
|
2009
|
+
function cr(e, t) {
|
|
2010
2010
|
var n, o;
|
|
2011
2011
|
t === void 0 && (t = {});
|
|
2012
2012
|
const {
|
|
@@ -2016,22 +2016,22 @@ function ir(e, t) {
|
|
|
2016
2016
|
} = e, {
|
|
2017
2017
|
enabled: c = !0,
|
|
2018
2018
|
role: a = "dialog"
|
|
2019
|
-
} = t, l =
|
|
2019
|
+
} = t, l = Ke(), u = ((n = i.domReference) == null ? void 0 : n.id) || l, f = g.useMemo(() => {
|
|
2020
2020
|
var w;
|
|
2021
|
-
return ((w =
|
|
2022
|
-
}, [i.floating, s]),
|
|
2021
|
+
return ((w = Yn(i.floating)) == null ? void 0 : w.id) || s;
|
|
2022
|
+
}, [i.floating, s]), m = (o = sr.get(a)) != null ? o : a, v = _t() != null, p = g.useMemo(() => m === "tooltip" || a === "label" ? {
|
|
2023
2023
|
["aria-" + (a === "label" ? "labelledby" : "describedby")]: r ? f : void 0
|
|
2024
2024
|
} : {
|
|
2025
2025
|
"aria-expanded": r ? "true" : "false",
|
|
2026
|
-
"aria-haspopup":
|
|
2026
|
+
"aria-haspopup": m === "alertdialog" ? "dialog" : m,
|
|
2027
2027
|
"aria-controls": r ? f : void 0,
|
|
2028
|
-
...
|
|
2028
|
+
...m === "listbox" && {
|
|
2029
2029
|
role: "combobox"
|
|
2030
2030
|
},
|
|
2031
|
-
...
|
|
2031
|
+
...m === "menu" && {
|
|
2032
2032
|
id: u
|
|
2033
2033
|
},
|
|
2034
|
-
...
|
|
2034
|
+
...m === "menu" && v && {
|
|
2035
2035
|
role: "menuitem"
|
|
2036
2036
|
},
|
|
2037
2037
|
...a === "select" && {
|
|
@@ -2040,20 +2040,20 @@ function ir(e, t) {
|
|
|
2040
2040
|
...a === "combobox" && {
|
|
2041
2041
|
"aria-autocomplete": "list"
|
|
2042
2042
|
}
|
|
2043
|
-
}, [
|
|
2043
|
+
}, [m, f, v, r, u, a]), b = g.useMemo(() => {
|
|
2044
2044
|
const w = {
|
|
2045
2045
|
id: f,
|
|
2046
|
-
...
|
|
2047
|
-
role:
|
|
2046
|
+
...m && {
|
|
2047
|
+
role: m
|
|
2048
2048
|
}
|
|
2049
2049
|
};
|
|
2050
|
-
return
|
|
2050
|
+
return m === "tooltip" || a === "label" ? w : {
|
|
2051
2051
|
...w,
|
|
2052
|
-
...
|
|
2052
|
+
...m === "menu" && {
|
|
2053
2053
|
"aria-labelledby": u
|
|
2054
2054
|
}
|
|
2055
2055
|
};
|
|
2056
|
-
}, [
|
|
2056
|
+
}, [m, f, u, a]), h = g.useCallback((w) => {
|
|
2057
2057
|
let {
|
|
2058
2058
|
active: x,
|
|
2059
2059
|
selected: E
|
|
@@ -2074,26 +2074,26 @@ function ir(e, t) {
|
|
|
2074
2074
|
}
|
|
2075
2075
|
return {};
|
|
2076
2076
|
}, [f, a]);
|
|
2077
|
-
return
|
|
2077
|
+
return g.useMemo(() => c ? {
|
|
2078
2078
|
reference: p,
|
|
2079
|
-
floating:
|
|
2080
|
-
item:
|
|
2081
|
-
} : {}, [c, p,
|
|
2079
|
+
floating: b,
|
|
2080
|
+
item: h
|
|
2081
|
+
} : {}, [c, p, b, h]);
|
|
2082
2082
|
}
|
|
2083
|
-
function
|
|
2083
|
+
function Ht(e) {
|
|
2084
2084
|
var t, n, o = "";
|
|
2085
2085
|
if (typeof e == "string" || typeof e == "number") o += e;
|
|
2086
2086
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
2087
2087
|
var r = e.length;
|
|
2088
|
-
for (t = 0; t < r; t++) e[t] && (n =
|
|
2088
|
+
for (t = 0; t < r; t++) e[t] && (n = Ht(e[t])) && (o && (o += " "), o += n);
|
|
2089
2089
|
} else for (n in e) e[n] && (o && (o += " "), o += n);
|
|
2090
2090
|
return o;
|
|
2091
2091
|
}
|
|
2092
|
-
function
|
|
2093
|
-
for (var e, t, n = 0, o = "", r = arguments.length; n < r; n++) (e = arguments[n]) && (t =
|
|
2092
|
+
function ar() {
|
|
2093
|
+
for (var e, t, n = 0, o = "", r = arguments.length; n < r; n++) (e = arguments[n]) && (t = Ht(e)) && (o && (o += " "), o += t);
|
|
2094
2094
|
return o;
|
|
2095
2095
|
}
|
|
2096
|
-
const
|
|
2096
|
+
const qe = ({
|
|
2097
2097
|
as: e,
|
|
2098
2098
|
children: t,
|
|
2099
2099
|
display: n,
|
|
@@ -2106,113 +2106,161 @@ const je = ({
|
|
|
2106
2106
|
my: l,
|
|
2107
2107
|
p: u,
|
|
2108
2108
|
pt: f,
|
|
2109
|
-
pr:
|
|
2109
|
+
pr: m,
|
|
2110
2110
|
pb: d,
|
|
2111
|
-
pl:
|
|
2111
|
+
pl: v,
|
|
2112
2112
|
px: p,
|
|
2113
|
-
py:
|
|
2114
|
-
width:
|
|
2113
|
+
py: b,
|
|
2114
|
+
width: h,
|
|
2115
2115
|
height: w,
|
|
2116
2116
|
position: x,
|
|
2117
2117
|
style: E,
|
|
2118
2118
|
className: C,
|
|
2119
2119
|
disabled: T,
|
|
2120
|
-
|
|
2120
|
+
required: M,
|
|
2121
|
+
...k
|
|
2121
2122
|
}) => {
|
|
2122
|
-
const
|
|
2123
|
-
n && (S.display = n),
|
|
2124
|
-
const
|
|
2123
|
+
const B = e || "div", S = {};
|
|
2124
|
+
n && (S.display = n), h && (S.width = h), w && (S.height = w), x && (S.position = x), o && (S.margin = `var(--pittorica-space-${o})`), r && (S.marginTop = `var(--pittorica-space-${r})`), i && (S.marginRight = `var(--pittorica-space-${i})`), s && (S.marginBottom = `var(--pittorica-space-${s})`), c && (S.marginLeft = `var(--pittorica-space-${c})`), a && (S.marginLeft = `var(--pittorica-space-${a})`, S.marginRight = `var(--pittorica-space-${a})`), l && (S.marginTop = `var(--pittorica-space-${l})`, S.marginBottom = `var(--pittorica-space-${l})`), u && (S.padding = `var(--pittorica-space-${u})`), f && (S.paddingTop = `var(--pittorica-space-${f})`), m && (S.paddingRight = `var(--pittorica-space-${m})`), d && (S.paddingBottom = `var(--pittorica-space-${d})`), v && (S.paddingLeft = `var(--pittorica-space-${v})`), p && (S.paddingLeft = `var(--pittorica-space-${p})`, S.paddingRight = `var(--pittorica-space-${p})`), b && (S.paddingTop = `var(--pittorica-space-${b})`, S.paddingBottom = `var(--pittorica-space-${b})`);
|
|
2125
|
+
const _ = {
|
|
2125
2126
|
...E,
|
|
2126
2127
|
...S
|
|
2127
2128
|
};
|
|
2128
|
-
return /* @__PURE__ */
|
|
2129
|
-
|
|
2129
|
+
return /* @__PURE__ */ H(
|
|
2130
|
+
B,
|
|
2130
2131
|
{
|
|
2131
|
-
className:
|
|
2132
|
-
style:
|
|
2132
|
+
className: ar("pittorica-box", C),
|
|
2133
|
+
style: _,
|
|
2133
2134
|
disabled: T,
|
|
2134
|
-
|
|
2135
|
+
required: M,
|
|
2136
|
+
...k,
|
|
2135
2137
|
children: t
|
|
2136
2138
|
}
|
|
2137
2139
|
);
|
|
2138
2140
|
};
|
|
2139
|
-
|
|
2140
|
-
const
|
|
2141
|
-
|
|
2141
|
+
qe.displayName = "Box";
|
|
2142
|
+
const lr = ({
|
|
2143
|
+
children: e,
|
|
2144
|
+
sourceColor: t = "indigo",
|
|
2145
|
+
appearance: n = "light",
|
|
2146
|
+
radius: o = "medium",
|
|
2147
|
+
className: r,
|
|
2148
|
+
style: i,
|
|
2149
|
+
id: s
|
|
2150
|
+
}) => {
|
|
2151
|
+
const c = t.startsWith("#") || t.startsWith("rgb"), a = {
|
|
2152
|
+
id: s,
|
|
2153
|
+
className: ["pittorica-theme", r].filter(Boolean).join(" "),
|
|
2154
|
+
"data-source-color": c ? "custom" : t,
|
|
2155
|
+
"data-appearance": n,
|
|
2156
|
+
"data-radius": o,
|
|
2157
|
+
style: {
|
|
2158
|
+
...i,
|
|
2159
|
+
...c ? { "--pittorica-source-color": t } : {}
|
|
2160
|
+
}
|
|
2161
|
+
};
|
|
2162
|
+
return /* @__PURE__ */ H("div", { ...a, children: e });
|
|
2163
|
+
}, Kt = en(null), jt = () => {
|
|
2164
|
+
const e = nn(Kt);
|
|
2142
2165
|
if (!e)
|
|
2143
|
-
throw new Error("Popover components must be wrapped in <Popover />");
|
|
2166
|
+
throw new Error("Popover components must be wrapped in <Popover.Root />");
|
|
2144
2167
|
return e;
|
|
2145
|
-
},
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2168
|
+
}, ht = ({
|
|
2169
|
+
children: e,
|
|
2170
|
+
placement: t = "bottom",
|
|
2171
|
+
appearance: n
|
|
2172
|
+
}) => {
|
|
2173
|
+
const [o, r] = vt(!1), { refs: i, floatingStyles: s, context: c } = rr({
|
|
2174
|
+
open: o,
|
|
2175
|
+
onOpenChange: r,
|
|
2149
2176
|
placement: t,
|
|
2150
|
-
whileElementsMounted:
|
|
2151
|
-
middleware: [
|
|
2152
|
-
}),
|
|
2153
|
-
c,
|
|
2177
|
+
whileElementsMounted: Ao,
|
|
2178
|
+
middleware: [No(8), $o(), Fo({ padding: 5 })]
|
|
2179
|
+
}), a = Qo(c), l = nr(c), u = cr(c), { getReferenceProps: f, getFloatingProps: m } = ir([
|
|
2154
2180
|
a,
|
|
2155
|
-
l
|
|
2156
|
-
|
|
2181
|
+
l,
|
|
2182
|
+
u
|
|
2183
|
+
]), d = tn(
|
|
2157
2184
|
() => ({
|
|
2158
|
-
isOpen:
|
|
2159
|
-
setIsOpen:
|
|
2160
|
-
refs:
|
|
2161
|
-
floatingStyles:
|
|
2162
|
-
getReferenceProps:
|
|
2163
|
-
getFloatingProps:
|
|
2185
|
+
isOpen: o,
|
|
2186
|
+
setIsOpen: r,
|
|
2187
|
+
refs: i,
|
|
2188
|
+
floatingStyles: s,
|
|
2189
|
+
getReferenceProps: f,
|
|
2190
|
+
getFloatingProps: m,
|
|
2191
|
+
appearance: n
|
|
2164
2192
|
}),
|
|
2165
|
-
[
|
|
2193
|
+
[
|
|
2194
|
+
o,
|
|
2195
|
+
i,
|
|
2196
|
+
s,
|
|
2197
|
+
f,
|
|
2198
|
+
m,
|
|
2199
|
+
n
|
|
2200
|
+
]
|
|
2166
2201
|
);
|
|
2167
|
-
return /* @__PURE__ */
|
|
2168
|
-
},
|
|
2202
|
+
return /* @__PURE__ */ H(Kt, { value: d, children: e });
|
|
2203
|
+
}, ur = ({
|
|
2169
2204
|
children: e,
|
|
2170
2205
|
as: t,
|
|
2171
2206
|
ref: n,
|
|
2172
2207
|
...o
|
|
2173
2208
|
}) => {
|
|
2174
|
-
const { refs: r, getReferenceProps: i } =
|
|
2209
|
+
const { refs: r, getReferenceProps: i } = jt(), s = (a) => {
|
|
2175
2210
|
r.setReference(a), n && (typeof n == "function" ? n(a) : typeof n == "object" && (n.current = a));
|
|
2176
2211
|
};
|
|
2177
|
-
return /* @__PURE__ */
|
|
2178
|
-
|
|
2212
|
+
return /* @__PURE__ */ H(
|
|
2213
|
+
qe,
|
|
2179
2214
|
{
|
|
2180
2215
|
as: t || "span",
|
|
2181
2216
|
display: "inline-flex",
|
|
2182
|
-
...i(),
|
|
2217
|
+
...i(o),
|
|
2183
2218
|
ref: s,
|
|
2184
|
-
...o,
|
|
2185
2219
|
children: e
|
|
2186
2220
|
}
|
|
2187
2221
|
);
|
|
2188
|
-
},
|
|
2222
|
+
}, fr = ({
|
|
2189
2223
|
children: e,
|
|
2190
2224
|
className: t,
|
|
2191
2225
|
as: n,
|
|
2192
2226
|
ref: o,
|
|
2193
|
-
|
|
2227
|
+
style: r,
|
|
2228
|
+
...i
|
|
2194
2229
|
}) => {
|
|
2195
|
-
const { isOpen:
|
|
2196
|
-
|
|
2230
|
+
const { isOpen: s, refs: c, floatingStyles: a, getFloatingProps: l, appearance: u } = jt(), [f, m] = vt();
|
|
2231
|
+
(globalThis.window === void 0 ? on : _e)(() => {
|
|
2232
|
+
if (s && c.domReference.current) {
|
|
2233
|
+
const h = c.domReference.current.closest(
|
|
2234
|
+
".pittorica-theme"
|
|
2235
|
+
);
|
|
2236
|
+
if (h) {
|
|
2237
|
+
const w = h.dataset.appearance;
|
|
2238
|
+
m(w || void 0);
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
}, [s, c.domReference]);
|
|
2242
|
+
const v = (h) => {
|
|
2243
|
+
c.setFloating(h), o && (typeof o == "function" ? o(h) : typeof o == "object" && (o.current = h));
|
|
2197
2244
|
};
|
|
2198
|
-
return
|
|
2199
|
-
|
|
2245
|
+
return s ? /* @__PURE__ */ H(Go, { children: /* @__PURE__ */ H(lr, { appearance: u === "inherit" ? f : u ?? f, children: /* @__PURE__ */ H(
|
|
2246
|
+
qe,
|
|
2200
2247
|
{
|
|
2201
2248
|
as: n || "div",
|
|
2202
|
-
...
|
|
2203
|
-
ref:
|
|
2204
|
-
className:
|
|
2205
|
-
style: { ...
|
|
2206
|
-
...r,
|
|
2249
|
+
...l(i),
|
|
2250
|
+
ref: v,
|
|
2251
|
+
className: rn("pittorica-popover-content", t),
|
|
2252
|
+
style: { ...a, ...r },
|
|
2207
2253
|
children: e
|
|
2208
2254
|
}
|
|
2209
|
-
) }) : null;
|
|
2210
|
-
}
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2255
|
+
) }) }) : null;
|
|
2256
|
+
}, mr = Object.assign(ht, {
|
|
2257
|
+
Root: ht,
|
|
2258
|
+
Trigger: ur,
|
|
2259
|
+
Content: fr
|
|
2260
|
+
});
|
|
2214
2261
|
export {
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2262
|
+
mr as Popover,
|
|
2263
|
+
fr as PopoverContent,
|
|
2264
|
+
ht as PopoverRoot,
|
|
2265
|
+
ur as PopoverTrigger
|
|
2218
2266
|
};
|