@wf-financing/ui 4.6.2 → 4.7.1

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