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