@box/box-ai-agent-selector 0.47.14 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/lib/box-ai-agent-selector-with-api-container.js +13 -10
- package/dist/esm/lib/box-ai-agent-selector-with-api.js +15 -12
- package/dist/esm/lib/box-ai-agent-selector.js +976 -974
- package/dist/esm/lib/box-ai-agent.js +58 -53
- package/dist/types/lib/box-ai-agent-selector-with-api-container.d.ts +1 -1
- package/dist/types/lib/box-ai-agent-selector-with-api.d.ts +2 -1
- package/dist/types/lib/box-ai-agent-selector.d.ts +2 -1
- package/dist/types/lib/types.d.ts +3 -0
- package/package.json +2 -2
@@ -13,14 +13,14 @@ import Ei from "./hooks/useLocalStorageAIAgents.js";
|
|
13
13
|
import Qe from "./messages.js";
|
14
14
|
import { R as fn } from "../../chunks/types.js";
|
15
15
|
import { ACTIONS as dr } from "./contexts/actions.js";
|
16
|
-
import '../../styles/box-ai-agent-selector.css';var xi = Object.defineProperty, Pi = Object.defineProperties, Ii = Object.getOwnPropertyDescriptors, Wt = Object.getOwnPropertySymbols, Jr = Object.prototype.hasOwnProperty, Qr = Object.prototype.propertyIsEnumerable, pr = (e, t, r) => t in e ? xi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r,
|
16
|
+
import '../../styles/box-ai-agent-selector.css';var xi = Object.defineProperty, Pi = Object.defineProperties, Ii = Object.getOwnPropertyDescriptors, Wt = Object.getOwnPropertySymbols, Jr = Object.prototype.hasOwnProperty, Qr = Object.prototype.propertyIsEnumerable, pr = (e, t, r) => t in e ? xi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, O = (e, t) => {
|
17
17
|
for (var r in t || (t = {}))
|
18
18
|
Jr.call(t, r) && pr(e, r, t[r]);
|
19
19
|
if (Wt)
|
20
20
|
for (var r of Wt(t))
|
21
21
|
Qr.call(t, r) && pr(e, r, t[r]);
|
22
22
|
return e;
|
23
|
-
},
|
23
|
+
}, $ = (e, t) => Pi(e, Ii(t)), J = (e, t) => {
|
24
24
|
var r = {};
|
25
25
|
for (var n in e)
|
26
26
|
Jr.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
@@ -113,10 +113,10 @@ function Mi(e) {
|
|
113
113
|
return !e || !Yr(e) ? !1 : "ref" in e.props || "ref" in e;
|
114
114
|
}
|
115
115
|
function ki(e) {
|
116
|
-
return Mi(e) ?
|
116
|
+
return Mi(e) ? O({}, e.props).ref || e.ref : null;
|
117
117
|
}
|
118
118
|
function Vi(e, t) {
|
119
|
-
const r =
|
119
|
+
const r = O({}, e);
|
120
120
|
for (const n in t) {
|
121
121
|
if (!Ne(t, n)) continue;
|
122
122
|
if (n === "className") {
|
@@ -126,7 +126,7 @@ function Vi(e, t) {
|
|
126
126
|
}
|
127
127
|
if (n === "style") {
|
128
128
|
const i = "style";
|
129
|
-
r[i] = e[i] ?
|
129
|
+
r[i] = e[i] ? O(O({}, e[i]), t[i]) : t[i];
|
130
130
|
continue;
|
131
131
|
}
|
132
132
|
const o = t[n];
|
@@ -259,8 +259,8 @@ function so(e, t) {
|
|
259
259
|
const r = e.map((o, i) => [i, o]);
|
260
260
|
let n = !1;
|
261
261
|
return r.sort(([o, i], [s, u]) => {
|
262
|
-
const a = t(i),
|
263
|
-
return a ===
|
262
|
+
const a = t(i), f = t(u);
|
263
|
+
return a === f || !a || !f ? 0 : qi(a, f) ? (o > s && (n = !0), -1) : (o < s && (n = !0), 1);
|
264
264
|
}), n ? r.map(([o, i]) => i) : e;
|
265
265
|
}
|
266
266
|
function qi(e, t) {
|
@@ -345,7 +345,7 @@ function Ce(e, t, r, n = window) {
|
|
345
345
|
s();
|
346
346
|
};
|
347
347
|
}
|
348
|
-
var Vn =
|
348
|
+
var Vn = O({}, ce), gr = Vn.useId;
|
349
349
|
Vn.useDeferredValue;
|
350
350
|
var hr = Vn.useInsertionEffect, ee = yt ? li : W;
|
351
351
|
function Ji(e) {
|
@@ -416,8 +416,8 @@ function Zi(e, t, r) {
|
|
416
416
|
const s = e && "current" in e ? e.current : e;
|
417
417
|
if (!s) return;
|
418
418
|
const u = () => {
|
419
|
-
const
|
420
|
-
i(
|
419
|
+
const f = s.getAttribute(t);
|
420
|
+
i(f ?? n);
|
421
421
|
}, a = new MutationObserver(u);
|
422
422
|
return a.observe(s, { attributeFilter: [t] }), u(), () => a.disconnect();
|
423
423
|
}, [e, t, n]), o;
|
@@ -448,7 +448,7 @@ function le(e, t, r = []) {
|
|
448
448
|
(o) => (e.wrapElement && (o = e.wrapElement(o)), t(o)),
|
449
449
|
[...r, e.wrapElement]
|
450
450
|
);
|
451
|
-
return
|
451
|
+
return $(O({}, e), { wrapElement: n });
|
452
452
|
}
|
453
453
|
function lo(e = !1, t) {
|
454
454
|
const [r, n] = X(null);
|
@@ -456,7 +456,7 @@ function lo(e = !1, t) {
|
|
456
456
|
}
|
457
457
|
function fo(e, t, r) {
|
458
458
|
const n = e.onLoadedMetadataCapture, o = He(() => Object.assign(() => {
|
459
|
-
},
|
459
|
+
}, $(O({}, n), { [t]: r })), [n, t, r]);
|
460
460
|
return [n == null ? void 0 : n[t], { onLoadedMetadataCapture: o }];
|
461
461
|
}
|
462
462
|
function ts() {
|
@@ -476,7 +476,7 @@ function kt() {
|
|
476
476
|
$n = !1;
|
477
477
|
}
|
478
478
|
function G(e) {
|
479
|
-
const t = ce.forwardRef((r, n) => e(
|
479
|
+
const t = ce.forwardRef((r, n) => e($(O({}, r), { ref: n })));
|
480
480
|
return t.displayName = e.displayName || e.name, t;
|
481
481
|
}
|
482
482
|
function Bn(e, t) {
|
@@ -486,9 +486,9 @@ function Q(e, t) {
|
|
486
486
|
const r = t, { wrapElement: n, render: o } = r, i = J(r, ["wrapElement", "render"]), s = de(t.ref, ki(o));
|
487
487
|
let u;
|
488
488
|
if (ce.isValidElement(o)) {
|
489
|
-
const a =
|
489
|
+
const a = $(O({}, o.props), { ref: s });
|
490
490
|
u = ce.cloneElement(o, Vi(i, a));
|
491
|
-
} else o ? u = o(i) : u = /* @__PURE__ */ k(e,
|
491
|
+
} else o ? u = o(i) : u = /* @__PURE__ */ k(e, O({}, i));
|
492
492
|
return n ? n(u) : u;
|
493
493
|
}
|
494
494
|
function Z(e) {
|
@@ -496,16 +496,16 @@ function Z(e) {
|
|
496
496
|
return t.displayName = e.name, t;
|
497
497
|
}
|
498
498
|
function it(e = [], t = []) {
|
499
|
-
const r = ce.createContext(void 0), n = ce.createContext(void 0), o = () => ce.useContext(r), i = (
|
500
|
-
const
|
501
|
-
return
|
499
|
+
const r = ce.createContext(void 0), n = ce.createContext(void 0), o = () => ce.useContext(r), i = (f = !1) => {
|
500
|
+
const d = ce.useContext(n), c = o();
|
501
|
+
return f ? d : d || c;
|
502
502
|
}, s = () => {
|
503
|
-
const
|
504
|
-
if (!(
|
505
|
-
return
|
506
|
-
}, u = (
|
507
|
-
(
|
508
|
-
/* @__PURE__ */ k(r.Provider,
|
503
|
+
const f = ce.useContext(n), d = o();
|
504
|
+
if (!(f && f === d))
|
505
|
+
return d;
|
506
|
+
}, u = (f) => e.reduceRight(
|
507
|
+
(d, c) => /* @__PURE__ */ k(c, $(O({}, f), { children: d })),
|
508
|
+
/* @__PURE__ */ k(r.Provider, O({}, f))
|
509
509
|
);
|
510
510
|
return {
|
511
511
|
context: r,
|
@@ -514,9 +514,9 @@ function it(e = [], t = []) {
|
|
514
514
|
useScopedContext: i,
|
515
515
|
useProviderContext: s,
|
516
516
|
ContextProvider: u,
|
517
|
-
ScopedContextProvider: (
|
518
|
-
(
|
519
|
-
/* @__PURE__ */ k(n.Provider,
|
517
|
+
ScopedContextProvider: (f) => /* @__PURE__ */ k(u, $(O({}, f), { children: t.reduceRight(
|
518
|
+
(d, c) => /* @__PURE__ */ k(c, $(O({}, f), { children: d })),
|
519
|
+
/* @__PURE__ */ k(n.Provider, O({}, f))
|
520
520
|
) }))
|
521
521
|
};
|
522
522
|
}
|
@@ -561,23 +561,23 @@ function St(e, t) {
|
|
561
561
|
}
|
562
562
|
function Ke(e, ...t) {
|
563
563
|
let r = e, n = r, o = Symbol(), i = Kt;
|
564
|
-
const s = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(),
|
565
|
-
const A = s.size,
|
566
|
-
s.add(
|
564
|
+
const s = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), p = (A) => (a.add(A), () => a.delete(A)), b = () => {
|
565
|
+
const A = s.size, w = Symbol();
|
566
|
+
s.add(w);
|
567
567
|
const T = () => {
|
568
|
-
s.delete(
|
568
|
+
s.delete(w), !s.size && i();
|
569
569
|
};
|
570
570
|
if (A) return T;
|
571
|
-
const
|
571
|
+
const F = Ni(r).map(
|
572
572
|
(L) => Te(
|
573
573
|
...t.map((D) => {
|
574
|
-
var
|
575
|
-
const
|
576
|
-
if (
|
577
|
-
return $e(D, [L], (
|
578
|
-
|
574
|
+
var y;
|
575
|
+
const R = (y = D == null ? void 0 : D.getState) == null ? void 0 : y.call(D);
|
576
|
+
if (R && Ne(R, L))
|
577
|
+
return $e(D, [L], (B) => {
|
578
|
+
I(
|
579
579
|
L,
|
580
|
-
|
580
|
+
B[L],
|
581
581
|
// @ts-expect-error - Not public API. This is just to prevent
|
582
582
|
// infinite loops.
|
583
583
|
!0
|
@@ -585,54 +585,54 @@ function Ke(e, ...t) {
|
|
585
585
|
});
|
586
586
|
})
|
587
587
|
)
|
588
|
-
),
|
588
|
+
), N = [];
|
589
589
|
for (const L of a)
|
590
|
-
|
591
|
-
const
|
592
|
-
return i = Te(...
|
593
|
-
}, v = (A,
|
594
|
-
var
|
595
|
-
(
|
596
|
-
}),
|
597
|
-
var
|
590
|
+
N.push(L());
|
591
|
+
const C = t.map(Un);
|
592
|
+
return i = Te(...F, ...N, ...C), T;
|
593
|
+
}, v = (A, w, T = f) => (T.add(w), l.set(w, A), () => {
|
594
|
+
var F;
|
595
|
+
(F = c.get(w)) == null || F(), c.delete(w), l.delete(w), T.delete(w);
|
596
|
+
}), E = (A, w) => v(A, w), x = (A, w) => (c.set(w, w(r, r)), v(A, w)), P = (A, w) => (c.set(w, w(r, n)), v(A, w, d)), g = (A) => Ke(Fi(r, A), _), m = (A) => Ke(Ri(r, A), _), S = () => r, I = (A, w, T = !1) => {
|
597
|
+
var F;
|
598
598
|
if (!Ne(r, A)) return;
|
599
|
-
const
|
600
|
-
if (
|
599
|
+
const N = Di(w, r[A]);
|
600
|
+
if (N === r[A]) return;
|
601
601
|
if (!T)
|
602
|
-
for (const
|
603
|
-
(
|
604
|
-
const
|
605
|
-
r = ve(te({}, r), { [A]:
|
602
|
+
for (const y of t)
|
603
|
+
(F = y == null ? void 0 : y.setState) == null || F.call(y, A, N);
|
604
|
+
const C = r;
|
605
|
+
r = ve(te({}, r), { [A]: N });
|
606
606
|
const L = Symbol();
|
607
607
|
o = L, u.add(A);
|
608
|
-
const D = (
|
609
|
-
var
|
610
|
-
const
|
611
|
-
(!
|
608
|
+
const D = (y, R, B) => {
|
609
|
+
var h;
|
610
|
+
const M = l.get(y), K = (H) => B ? B.has(H) : H === A;
|
611
|
+
(!M || M.some(K)) && ((h = c.get(y)) == null || h(), c.set(y, y(r, R)));
|
612
612
|
};
|
613
|
-
for (const
|
614
|
-
D(
|
613
|
+
for (const y of f)
|
614
|
+
D(y, C);
|
615
615
|
queueMicrotask(() => {
|
616
616
|
if (o !== L) return;
|
617
|
-
const
|
618
|
-
for (const
|
619
|
-
D(
|
620
|
-
n =
|
617
|
+
const y = r;
|
618
|
+
for (const R of d)
|
619
|
+
D(R, n, u);
|
620
|
+
n = y, u.clear();
|
621
621
|
});
|
622
|
-
},
|
623
|
-
getState:
|
624
|
-
setState:
|
622
|
+
}, _ = {
|
623
|
+
getState: S,
|
624
|
+
setState: I,
|
625
625
|
__unstableInternals: {
|
626
626
|
setup: p,
|
627
627
|
init: b,
|
628
|
-
subscribe:
|
629
|
-
sync:
|
628
|
+
subscribe: E,
|
629
|
+
sync: x,
|
630
630
|
batch: P,
|
631
631
|
pick: g,
|
632
632
|
omit: m
|
633
633
|
}
|
634
634
|
};
|
635
|
-
return
|
635
|
+
return _;
|
636
636
|
}
|
637
637
|
function Oe(e, ...t) {
|
638
638
|
if (e)
|
@@ -719,12 +719,12 @@ function ys() {
|
|
719
719
|
}
|
720
720
|
var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, o = e.useEffect, i = e.useLayoutEffect, s = e.useDebugValue;
|
721
721
|
function u(c, l) {
|
722
|
-
var p = l(), b = n({ inst: { value: p, getSnapshot: l } }), v = b[0].inst,
|
722
|
+
var p = l(), b = n({ inst: { value: p, getSnapshot: l } }), v = b[0].inst, E = b[1];
|
723
723
|
return i(function() {
|
724
|
-
v.value = p, v.getSnapshot = l, a(v) &&
|
724
|
+
v.value = p, v.getSnapshot = l, a(v) && E({ inst: v });
|
725
725
|
}, [c, p, l]), o(function() {
|
726
|
-
return a(v) &&
|
727
|
-
a(v) &&
|
726
|
+
return a(v) && E({ inst: v }), c(function() {
|
727
|
+
a(v) && E({ inst: v });
|
728
728
|
});
|
729
729
|
}, [c]), s(p), p;
|
730
730
|
}
|
@@ -738,11 +738,11 @@ function ys() {
|
|
738
738
|
return !0;
|
739
739
|
}
|
740
740
|
}
|
741
|
-
function
|
741
|
+
function f(c, l) {
|
742
742
|
return l();
|
743
743
|
}
|
744
|
-
var
|
745
|
-
return dn.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore :
|
744
|
+
var d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? f : u;
|
745
|
+
return dn.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : d, dn;
|
746
746
|
}
|
747
747
|
var pn = {};
|
748
748
|
/**
|
@@ -761,17 +761,17 @@ function Ss() {
|
|
761
761
|
var e = Gr, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
762
762
|
function r(g) {
|
763
763
|
{
|
764
|
-
for (var m = arguments.length,
|
765
|
-
|
766
|
-
n("error", g,
|
764
|
+
for (var m = arguments.length, S = new Array(m > 1 ? m - 1 : 0), I = 1; I < m; I++)
|
765
|
+
S[I - 1] = arguments[I];
|
766
|
+
n("error", g, S);
|
767
767
|
}
|
768
768
|
}
|
769
|
-
function n(g, m,
|
769
|
+
function n(g, m, S) {
|
770
770
|
{
|
771
|
-
var
|
772
|
-
|
773
|
-
var A =
|
774
|
-
return String(
|
771
|
+
var I = t.ReactDebugCurrentFrame, _ = I.getStackAddendum();
|
772
|
+
_ !== "" && (m += "%s", S = S.concat([_]));
|
773
|
+
var A = S.map(function(w) {
|
774
|
+
return String(w);
|
775
775
|
});
|
776
776
|
A.unshift("Warning: " + m), Function.prototype.apply.call(console[g], console, A);
|
777
777
|
}
|
@@ -779,49 +779,49 @@ function Ss() {
|
|
779
779
|
function o(g, m) {
|
780
780
|
return g === m && (g !== 0 || 1 / g === 1 / m) || g !== g && m !== m;
|
781
781
|
}
|
782
|
-
var i = typeof Object.is == "function" ? Object.is : o, s = e.useState, u = e.useEffect, a = e.useLayoutEffect,
|
783
|
-
function l(g, m,
|
784
|
-
|
785
|
-
var
|
782
|
+
var i = typeof Object.is == "function" ? Object.is : o, s = e.useState, u = e.useEffect, a = e.useLayoutEffect, f = e.useDebugValue, d = !1, c = !1;
|
783
|
+
function l(g, m, S) {
|
784
|
+
d || e.startTransition !== void 0 && (d = !0, r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
785
|
+
var I = m();
|
786
786
|
if (!c) {
|
787
|
-
var
|
788
|
-
i(
|
787
|
+
var _ = m();
|
788
|
+
i(I, _) || (r("The result of getSnapshot should be cached to avoid an infinite loop"), c = !0);
|
789
789
|
}
|
790
790
|
var A = s({
|
791
791
|
inst: {
|
792
|
-
value:
|
792
|
+
value: I,
|
793
793
|
getSnapshot: m
|
794
794
|
}
|
795
|
-
}),
|
795
|
+
}), w = A[0].inst, T = A[1];
|
796
796
|
return a(function() {
|
797
|
-
|
798
|
-
inst:
|
797
|
+
w.value = I, w.getSnapshot = m, p(w) && T({
|
798
|
+
inst: w
|
799
799
|
});
|
800
|
-
}, [g,
|
801
|
-
p(
|
802
|
-
inst:
|
800
|
+
}, [g, I, m]), u(function() {
|
801
|
+
p(w) && T({
|
802
|
+
inst: w
|
803
803
|
});
|
804
|
-
var
|
805
|
-
p(
|
806
|
-
inst:
|
804
|
+
var F = function() {
|
805
|
+
p(w) && T({
|
806
|
+
inst: w
|
807
807
|
});
|
808
808
|
};
|
809
|
-
return g(
|
810
|
-
}, [g]),
|
809
|
+
return g(F);
|
810
|
+
}, [g]), f(I), I;
|
811
811
|
}
|
812
812
|
function p(g) {
|
813
|
-
var m = g.getSnapshot,
|
813
|
+
var m = g.getSnapshot, S = g.value;
|
814
814
|
try {
|
815
|
-
var
|
816
|
-
return !i(
|
815
|
+
var I = m();
|
816
|
+
return !i(S, I);
|
817
817
|
} catch {
|
818
818
|
return !0;
|
819
819
|
}
|
820
820
|
}
|
821
|
-
function b(g, m,
|
821
|
+
function b(g, m, S) {
|
822
822
|
return m();
|
823
823
|
}
|
824
|
-
var v = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u",
|
824
|
+
var v = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", E = !v, x = E ? b : l, P = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : x;
|
825
825
|
pn.useSyncExternalStore = P, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
826
826
|
}()), pn;
|
827
827
|
}
|
@@ -853,26 +853,26 @@ function ho(e, t) {
|
|
853
853
|
let s = !1;
|
854
854
|
const u = r.current;
|
855
855
|
for (const a in t) {
|
856
|
-
const
|
857
|
-
if (typeof
|
858
|
-
const
|
859
|
-
|
856
|
+
const f = t[a];
|
857
|
+
if (typeof f == "function") {
|
858
|
+
const d = f(i);
|
859
|
+
d !== u[a] && (u[a] = d, s = !0);
|
860
860
|
}
|
861
|
-
if (typeof
|
862
|
-
if (!i || !Ne(i,
|
863
|
-
const
|
864
|
-
|
861
|
+
if (typeof f == "string") {
|
862
|
+
if (!i || !Ne(i, f)) continue;
|
863
|
+
const d = i[f];
|
864
|
+
d !== u[a] && (u[a] = d, s = !0);
|
865
865
|
}
|
866
866
|
}
|
867
|
-
return s && (r.current =
|
867
|
+
return s && (r.current = O({}, u)), r.current;
|
868
868
|
};
|
869
869
|
return vo(n, o, o);
|
870
870
|
}
|
871
871
|
function pe(e, t, r, n) {
|
872
872
|
const o = Ne(t, r) ? t[r] : void 0, i = n ? t[n] : void 0, s = Qi({ value: o, setValue: i });
|
873
873
|
ee(() => $e(e, [r], (u, a) => {
|
874
|
-
const { value:
|
875
|
-
|
874
|
+
const { value: f, setValue: d } = s.current;
|
875
|
+
d && u[r] !== a[r] && u[r] !== f && d(u[r]);
|
876
876
|
}), [e, r]), ee(() => {
|
877
877
|
if (o !== void 0)
|
878
878
|
return e.setState(r, o), zt(e, [r], () => {
|
@@ -887,10 +887,10 @@ function Xn(e, t) {
|
|
887
887
|
(u) => _e(r, u),
|
888
888
|
[r]
|
889
889
|
), i = ce.useMemo(
|
890
|
-
() =>
|
890
|
+
() => $(O({}, r), { useState: o }),
|
891
891
|
[r, o]
|
892
892
|
), s = U(() => {
|
893
|
-
n((u) => e(
|
893
|
+
n((u) => e(O(O({}, t), u.getState())));
|
894
894
|
});
|
895
895
|
return [i, s];
|
896
896
|
}
|
@@ -922,7 +922,7 @@ function Is(e = {}) {
|
|
922
922
|
}, s = Ps(e.store), u = Ke(
|
923
923
|
{ items: n, renderedItems: i.renderedItems },
|
924
924
|
s
|
925
|
-
), a = Ke(i, e.store),
|
925
|
+
), a = Ke(i, e.store), f = (l) => {
|
926
926
|
const p = so(l, (b) => b.element);
|
927
927
|
u.setState("renderedItems", p), a.setState("renderedItems", p);
|
928
928
|
};
|
@@ -931,7 +931,7 @@ function Is(e = {}) {
|
|
931
931
|
})), Oe(u, () => zt(u, ["renderedItems"], (l) => {
|
932
932
|
let p = !0, b = requestAnimationFrame(() => {
|
933
933
|
const { renderedItems: P } = a.getState();
|
934
|
-
l.renderedItems !== P &&
|
934
|
+
l.renderedItems !== P && f(l.renderedItems);
|
935
935
|
});
|
936
936
|
if (typeof IntersectionObserver != "function")
|
937
937
|
return () => cancelAnimationFrame(b);
|
@@ -940,36 +940,36 @@ function Is(e = {}) {
|
|
940
940
|
p = !1;
|
941
941
|
return;
|
942
942
|
}
|
943
|
-
cancelAnimationFrame(b), b = requestAnimationFrame(() =>
|
944
|
-
},
|
943
|
+
cancelAnimationFrame(b), b = requestAnimationFrame(() => f(l.renderedItems));
|
944
|
+
}, E = xs(l.renderedItems), x = new IntersectionObserver(v, { root: E });
|
945
945
|
for (const P of l.renderedItems)
|
946
|
-
P.element &&
|
946
|
+
P.element && x.observe(P.element);
|
947
947
|
return () => {
|
948
|
-
cancelAnimationFrame(b),
|
948
|
+
cancelAnimationFrame(b), x.disconnect();
|
949
949
|
};
|
950
950
|
}));
|
951
|
-
const
|
951
|
+
const d = (l, p, b = !1) => {
|
952
952
|
let v;
|
953
|
-
return p((
|
954
|
-
const P =
|
953
|
+
return p((x) => {
|
954
|
+
const P = x.findIndex(({ id: m }) => m === l.id), g = x.slice();
|
955
955
|
if (P !== -1) {
|
956
|
-
v =
|
956
|
+
v = x[P];
|
957
957
|
const m = te(te({}, v), l);
|
958
958
|
g[P] = m, o.set(l.id, m);
|
959
959
|
} else
|
960
960
|
g.push(l), o.set(l.id, l);
|
961
961
|
return g;
|
962
962
|
}), () => {
|
963
|
-
p((
|
963
|
+
p((x) => {
|
964
964
|
if (!v)
|
965
|
-
return b && o.delete(l.id),
|
966
|
-
const P =
|
967
|
-
if (P === -1) return
|
968
|
-
const g =
|
965
|
+
return b && o.delete(l.id), x.filter(({ id: m }) => m !== l.id);
|
966
|
+
const P = x.findIndex(({ id: m }) => m === l.id);
|
967
|
+
if (P === -1) return x;
|
968
|
+
const g = x.slice();
|
969
969
|
return g[P] = v, o.set(l.id, v), g;
|
970
970
|
});
|
971
971
|
};
|
972
|
-
}, c = (l) =>
|
972
|
+
}, c = (l) => d(
|
973
973
|
l,
|
974
974
|
(p) => u.setState("items", p),
|
975
975
|
!0
|
@@ -978,7 +978,7 @@ function Is(e = {}) {
|
|
978
978
|
registerItem: c,
|
979
979
|
renderItem: (l) => Te(
|
980
980
|
c(l),
|
981
|
-
|
981
|
+
d(
|
982
982
|
l,
|
983
983
|
(p) => u.setState("renderedItems", p)
|
984
984
|
)
|
@@ -1119,64 +1119,64 @@ function Rs(e = {}) {
|
|
1119
1119
|
Oe(
|
1120
1120
|
s,
|
1121
1121
|
() => $e(s, ["renderedItems", "activeId"], (a) => {
|
1122
|
-
s.setState("activeId", (
|
1123
|
-
var
|
1124
|
-
return
|
1122
|
+
s.setState("activeId", (f) => {
|
1123
|
+
var d;
|
1124
|
+
return f !== void 0 ? f : (d = ke(a.renderedItems)) == null ? void 0 : d.id;
|
1125
1125
|
});
|
1126
1126
|
})
|
1127
1127
|
);
|
1128
|
-
const u = (a = "next",
|
1129
|
-
var
|
1128
|
+
const u = (a = "next", f = {}) => {
|
1129
|
+
var d, c;
|
1130
1130
|
const l = s.getState(), {
|
1131
1131
|
skip: p = 0,
|
1132
1132
|
activeId: b = l.activeId,
|
1133
1133
|
focusShift: v = l.focusShift,
|
1134
|
-
focusLoop:
|
1135
|
-
focusWrap:
|
1134
|
+
focusLoop: E = l.focusLoop,
|
1135
|
+
focusWrap: x = l.focusWrap,
|
1136
1136
|
includesBaseElement: P = l.includesBaseElement,
|
1137
1137
|
renderedItems: g = l.renderedItems,
|
1138
1138
|
rtl: m = l.rtl
|
1139
|
-
} =
|
1140
|
-
let
|
1139
|
+
} = f, S = a === "up" || a === "down", I = a === "next" || a === "down", _ = I ? m && !S : !m || S, A = v && !p;
|
1140
|
+
let w = S ? yo(
|
1141
1141
|
Ts(So(g), b, A)
|
1142
1142
|
) : g;
|
1143
|
-
if (
|
1144
|
-
return (
|
1145
|
-
const T =
|
1143
|
+
if (w = _ ? Pn(w) : w, w = S ? Ls(w) : w, b == null)
|
1144
|
+
return (d = ke(w)) == null ? void 0 : d.id;
|
1145
|
+
const T = w.find((h) => h.id === b);
|
1146
1146
|
if (!T)
|
1147
|
-
return (c = ke(
|
1148
|
-
const
|
1147
|
+
return (c = ke(w)) == null ? void 0 : c.id;
|
1148
|
+
const F = w.some((h) => h.rowId), N = w.indexOf(T), C = w.slice(N + 1), L = Er(C, T.rowId);
|
1149
1149
|
if (p) {
|
1150
|
-
const
|
1151
|
-
|
1152
|
-
return
|
1150
|
+
const h = _s(L, b), M = h.slice(p)[0] || // If we can't find an item, just return the last one.
|
1151
|
+
h[h.length - 1];
|
1152
|
+
return M == null ? void 0 : M.id;
|
1153
1153
|
}
|
1154
|
-
const D =
|
1154
|
+
const D = E && (S ? E !== "horizontal" : E !== "vertical"), y = F && x && (S ? x !== "horizontal" : x !== "vertical"), R = I ? (!F || S) && D && P : S ? P : !1;
|
1155
1155
|
if (D) {
|
1156
|
-
const
|
1156
|
+
const h = y && !R ? w : Er(w, T.rowId), M = Ds(h, b, R), K = ke(M, b);
|
1157
1157
|
return K == null ? void 0 : K.id;
|
1158
1158
|
}
|
1159
|
-
if (
|
1160
|
-
const
|
1159
|
+
if (y) {
|
1160
|
+
const h = ke(
|
1161
1161
|
// We can use nextItems, which contains all the next items, including
|
1162
1162
|
// items from other rows, to wrap between rows. However, if there is a
|
1163
1163
|
// null item (the composite container), we'll only use the next items in
|
1164
1164
|
// the row. So moving next from the last item will focus on the
|
1165
1165
|
// composite container. On grid composites, horizontal navigation never
|
1166
1166
|
// focuses on the composite container, only vertical.
|
1167
|
-
|
1167
|
+
R ? L : C,
|
1168
1168
|
b
|
1169
1169
|
);
|
1170
|
-
return
|
1170
|
+
return R ? (h == null ? void 0 : h.id) || null : h == null ? void 0 : h.id;
|
1171
1171
|
}
|
1172
|
-
const
|
1173
|
-
return !
|
1172
|
+
const B = ke(L, b);
|
1173
|
+
return !B && R ? null : B == null ? void 0 : B.id;
|
1174
1174
|
};
|
1175
1175
|
return ve(te(te({}, n), s), {
|
1176
1176
|
setBaseElement: (a) => s.setState("baseElement", a),
|
1177
1177
|
setActiveId: (a) => s.setState("activeId", a),
|
1178
1178
|
move: (a) => {
|
1179
|
-
a !== void 0 && (s.setState("activeId", a), s.setState("moves", (
|
1179
|
+
a !== void 0 && (s.setState("activeId", a), s.setState("moves", (f) => f + 1));
|
1180
1180
|
},
|
1181
1181
|
first: () => {
|
1182
1182
|
var a;
|
@@ -1194,7 +1194,7 @@ function Rs(e = {}) {
|
|
1194
1194
|
}
|
1195
1195
|
function Fs(e) {
|
1196
1196
|
const t = ot(e.id);
|
1197
|
-
return
|
1197
|
+
return O({ id: t }, e);
|
1198
1198
|
}
|
1199
1199
|
function Ns(e, t, r) {
|
1200
1200
|
return e = Cs(e, t, r), pe(e, r, "activeId", "setActiveId"), pe(e, r, "includesBaseElement"), pe(e, r, "virtualFocus"), pe(e, r, "orientation"), pe(e, r, "rtl"), pe(e, r, "focusLoop"), pe(e, r, "focusWrap"), pe(e, r, "focusShift"), e;
|
@@ -1289,12 +1289,12 @@ function Vs(e = {}) {
|
|
1289
1289
|
popoverElement: z(i == null ? void 0 : i.popoverElement, null),
|
1290
1290
|
arrowElement: z(i == null ? void 0 : i.arrowElement, null),
|
1291
1291
|
rendered: Symbol("rendered")
|
1292
|
-
}),
|
1293
|
-
return ve(te(te({}, s),
|
1294
|
-
setAnchorElement: (
|
1295
|
-
setPopoverElement: (
|
1296
|
-
setArrowElement: (
|
1297
|
-
render: () =>
|
1292
|
+
}), f = Ke(a, s, o);
|
1293
|
+
return ve(te(te({}, s), f), {
|
1294
|
+
setAnchorElement: (d) => f.setState("anchorElement", d),
|
1295
|
+
setPopoverElement: (d) => f.setState("popoverElement", d),
|
1296
|
+
setArrowElement: (d) => f.setState("arrowElement", d),
|
1297
|
+
render: () => f.setState("rendered", Symbol("rendered"))
|
1298
1298
|
});
|
1299
1299
|
}
|
1300
1300
|
function $s(e, t, r) {
|
@@ -1351,7 +1351,7 @@ function Bs(e = {}) {
|
|
1351
1351
|
i.placement,
|
1352
1352
|
"bottom-start"
|
1353
1353
|
)
|
1354
|
-
})), a = new String(""),
|
1354
|
+
})), a = new String(""), f = ve(te(te({}, s.getState()), u.getState()), {
|
1355
1355
|
value: z(
|
1356
1356
|
n.value,
|
1357
1357
|
i.value,
|
@@ -1366,51 +1366,51 @@ function Bs(e = {}) {
|
|
1366
1366
|
labelElement: z(i.labelElement, null),
|
1367
1367
|
selectElement: z(i.selectElement, null),
|
1368
1368
|
listElement: z(i.listElement, null)
|
1369
|
-
}),
|
1369
|
+
}), d = Ke(f, s, u, o);
|
1370
1370
|
return Oe(
|
1371
|
-
|
1372
|
-
() => $e(
|
1371
|
+
d,
|
1372
|
+
() => $e(d, ["value", "items"], (c) => {
|
1373
1373
|
if (c.value !== a || !c.items.length) return;
|
1374
1374
|
const l = c.items.find(
|
1375
1375
|
(p) => !p.disabled && p.value != null
|
1376
1376
|
);
|
1377
|
-
(l == null ? void 0 : l.value) != null &&
|
1377
|
+
(l == null ? void 0 : l.value) != null && d.setState("value", l.value);
|
1378
1378
|
})
|
1379
1379
|
), Oe(
|
1380
|
-
|
1381
|
-
() => $e(
|
1382
|
-
c.mounted ||
|
1380
|
+
d,
|
1381
|
+
() => $e(d, ["mounted"], (c) => {
|
1382
|
+
c.mounted || d.setState("activeId", f.activeId);
|
1383
1383
|
})
|
1384
1384
|
), Oe(
|
1385
|
-
|
1386
|
-
() => $e(
|
1385
|
+
d,
|
1386
|
+
() => $e(d, ["mounted", "items", "value"], (c) => {
|
1387
1387
|
if (r || c.mounted) return;
|
1388
1388
|
const l = bo(c.value), p = l[l.length - 1];
|
1389
1389
|
if (p == null) return;
|
1390
1390
|
const b = c.items.find(
|
1391
1391
|
(v) => !v.disabled && v.value === p
|
1392
1392
|
);
|
1393
|
-
b &&
|
1393
|
+
b && d.setState("activeId", b.id);
|
1394
1394
|
})
|
1395
1395
|
), Oe(
|
1396
|
-
|
1397
|
-
() => zt(
|
1398
|
-
const { mounted: l, value: p, activeId: b } =
|
1396
|
+
d,
|
1397
|
+
() => zt(d, ["setValueOnMove", "moves"], (c) => {
|
1398
|
+
const { mounted: l, value: p, activeId: b } = d.getState();
|
1399
1399
|
if (!c.setValueOnMove && l || Array.isArray(p) || !c.moves || !b) return;
|
1400
1400
|
const v = s.item(b);
|
1401
|
-
!v || v.disabled || v.value == null ||
|
1401
|
+
!v || v.disabled || v.value == null || d.setState("value", v.value);
|
1402
1402
|
})
|
1403
|
-
), ve(te(te(te({}, s), u),
|
1403
|
+
), ve(te(te(te({}, s), u), d), {
|
1404
1404
|
combobox: r,
|
1405
|
-
setValue: (c) =>
|
1406
|
-
setLabelElement: (c) =>
|
1407
|
-
setSelectElement: (c) =>
|
1408
|
-
setListElement: (c) =>
|
1405
|
+
setValue: (c) => d.setState("value", c),
|
1406
|
+
setLabelElement: (c) => d.setState("labelElement", c),
|
1407
|
+
setSelectElement: (c) => d.setState("selectElement", c),
|
1408
|
+
setListElement: (c) => d.setState("listElement", c)
|
1409
1409
|
});
|
1410
1410
|
}
|
1411
1411
|
function Ks(e) {
|
1412
1412
|
const t = hs();
|
1413
|
-
return e =
|
1413
|
+
return e = $(O({}, e), {
|
1414
1414
|
combobox: e.combobox !== void 0 ? e.combobox : t
|
1415
1415
|
}), Fs(e);
|
1416
1416
|
}
|
@@ -1620,95 +1620,95 @@ var on = Z(
|
|
1620
1620
|
n && (Ce("mousedown", lu, !0), Ce("keydown", fu, !0));
|
1621
1621
|
}, [n]), Ir && W(() => {
|
1622
1622
|
if (!n) return;
|
1623
|
-
const
|
1624
|
-
if (!
|
1625
|
-
const
|
1626
|
-
if (!
|
1627
|
-
const
|
1628
|
-
for (const
|
1629
|
-
|
1623
|
+
const y = a.current;
|
1624
|
+
if (!y || !Or(y)) return;
|
1625
|
+
const R = su(y);
|
1626
|
+
if (!R) return;
|
1627
|
+
const B = () => queueMicrotask(() => y.focus());
|
1628
|
+
for (const h of R)
|
1629
|
+
h.addEventListener("mouseup", B);
|
1630
1630
|
return () => {
|
1631
|
-
for (const
|
1632
|
-
|
1631
|
+
for (const h of R)
|
1632
|
+
h.removeEventListener("mouseup", B);
|
1633
1633
|
};
|
1634
1634
|
}, [n]);
|
1635
|
-
const
|
1635
|
+
const f = n && Xt(u), d = !!f && !o, [c, l] = X(!1);
|
1636
1636
|
W(() => {
|
1637
|
-
n &&
|
1638
|
-
}, [n,
|
1637
|
+
n && d && c && l(!1);
|
1638
|
+
}, [n, d, c]), W(() => {
|
1639
1639
|
if (!n || !c) return;
|
1640
|
-
const
|
1641
|
-
if (!
|
1642
|
-
const
|
1643
|
-
De(
|
1640
|
+
const y = a.current;
|
1641
|
+
if (!y || typeof IntersectionObserver > "u") return;
|
1642
|
+
const R = new IntersectionObserver(() => {
|
1643
|
+
De(y) || l(!1);
|
1644
1644
|
});
|
1645
|
-
return
|
1645
|
+
return R.observe(y), () => R.disconnect();
|
1646
1646
|
}, [n, c]);
|
1647
1647
|
const p = vn(
|
1648
1648
|
u.onKeyPressCapture,
|
1649
|
-
|
1649
|
+
f
|
1650
1650
|
), b = vn(
|
1651
1651
|
u.onMouseDownCapture,
|
1652
|
-
|
1653
|
-
), v = vn(u.onClickCapture,
|
1654
|
-
if (
|
1655
|
-
const
|
1656
|
-
if (!Ir || uo(
|
1657
|
-
let
|
1658
|
-
const
|
1659
|
-
|
1660
|
-
},
|
1661
|
-
|
1662
|
-
const K = Js(
|
1663
|
-
Cr(K, !0), vt(
|
1664
|
-
|
1652
|
+
f
|
1653
|
+
), v = vn(u.onClickCapture, f), E = u.onMouseDown, x = U((y) => {
|
1654
|
+
if (E == null || E(y), y.defaultPrevented || !n) return;
|
1655
|
+
const R = y.currentTarget;
|
1656
|
+
if (!Ir || uo(y) || !Xe(R) && !Or(R)) return;
|
1657
|
+
let B = !1;
|
1658
|
+
const h = () => {
|
1659
|
+
B = !0;
|
1660
|
+
}, M = { capture: !0, once: !0 };
|
1661
|
+
R.addEventListener("focusin", h, M);
|
1662
|
+
const K = Js(R.parentElement);
|
1663
|
+
Cr(K, !0), vt(R, "mouseup", () => {
|
1664
|
+
R.removeEventListener("focusin", h, !0), Cr(K, !1), !B && Ao(R);
|
1665
1665
|
});
|
1666
|
-
}), P = (
|
1667
|
-
if (
|
1668
|
-
const
|
1669
|
-
|
1670
|
-
}, g = u.onKeyDownCapture, m = U((
|
1671
|
-
if (g == null || g(
|
1672
|
-
const
|
1673
|
-
vt(
|
1674
|
-
}),
|
1675
|
-
if (
|
1676
|
-
if (!me(
|
1666
|
+
}), P = (y, R) => {
|
1667
|
+
if (R && (y.currentTarget = R), !n) return;
|
1668
|
+
const B = y.currentTarget;
|
1669
|
+
B && Ut(B) && (s == null || s(y), !y.defaultPrevented && (B.dataset.focusVisible = "true", l(!0)));
|
1670
|
+
}, g = u.onKeyDownCapture, m = U((y) => {
|
1671
|
+
if (g == null || g(y), y.defaultPrevented || !n || c || y.metaKey || y.altKey || y.ctrlKey || !me(y)) return;
|
1672
|
+
const R = y.currentTarget;
|
1673
|
+
vt(R, "focusout", () => P(y, R));
|
1674
|
+
}), S = u.onFocusCapture, I = U((y) => {
|
1675
|
+
if (S == null || S(y), y.defaultPrevented || !n) return;
|
1676
|
+
if (!me(y)) {
|
1677
1677
|
l(!1);
|
1678
1678
|
return;
|
1679
1679
|
}
|
1680
|
-
const
|
1681
|
-
Zn || iu(
|
1682
|
-
}),
|
1683
|
-
|
1684
|
-
}),
|
1685
|
-
n && i &&
|
1686
|
-
Ut(
|
1680
|
+
const R = y.currentTarget, B = () => P(y, R);
|
1681
|
+
Zn || iu(y.target) ? vt(y.target, "focusout", B) : l(!1);
|
1682
|
+
}), _ = u.onBlur, A = U((y) => {
|
1683
|
+
_ == null || _(y), n && pt(y) && l(!1);
|
1684
|
+
}), w = et(_o), T = U((y) => {
|
1685
|
+
n && i && y && w && queueMicrotask(() => {
|
1686
|
+
Ut(y) || De(y) && y.focus();
|
1687
1687
|
});
|
1688
|
-
}),
|
1689
|
-
return u =
|
1688
|
+
}), F = co(a), N = n && uu(F), C = n && au(F), L = u.style, D = He(() => d ? O({ pointerEvents: "none" }, L) : L, [d, L]);
|
1689
|
+
return u = $(O({
|
1690
1690
|
"data-focus-visible": n && c || void 0,
|
1691
1691
|
"data-autofocus": i || void 0,
|
1692
|
-
"aria-disabled":
|
1692
|
+
"aria-disabled": f || void 0
|
1693
1693
|
}, u), {
|
1694
1694
|
ref: de(a, T, u.ref),
|
1695
1695
|
style: D,
|
1696
1696
|
tabIndex: cu(
|
1697
1697
|
n,
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1698
|
+
d,
|
1699
|
+
N,
|
1700
|
+
C,
|
1701
1701
|
u.tabIndex
|
1702
1702
|
),
|
1703
|
-
disabled:
|
1703
|
+
disabled: C && d ? !0 : void 0,
|
1704
1704
|
// TODO: Test Focusable contentEditable.
|
1705
|
-
contentEditable:
|
1705
|
+
contentEditable: f ? void 0 : u.contentEditable,
|
1706
1706
|
onKeyPressCapture: p,
|
1707
1707
|
onClickCapture: v,
|
1708
1708
|
onMouseDownCapture: b,
|
1709
|
-
onMouseDown:
|
1709
|
+
onMouseDown: x,
|
1710
1710
|
onKeyDownCapture: m,
|
1711
|
-
onFocusCapture:
|
1711
|
+
onFocusCapture: I,
|
1712
1712
|
onBlur: A
|
1713
1713
|
}), rt(u);
|
1714
1714
|
}
|
@@ -1730,40 +1730,40 @@ var pu = Symbol("command"), er = Z(
|
|
1730
1730
|
W(() => {
|
1731
1731
|
s.current && a(Xe(s.current));
|
1732
1732
|
}, []);
|
1733
|
-
const [
|
1733
|
+
const [f, d] = X(!1), c = Y(!1), l = Xt(i), [p, b] = fo(i, pu, !0), v = i.onKeyDown, E = U((g) => {
|
1734
1734
|
v == null || v(g);
|
1735
1735
|
const m = g.currentTarget;
|
1736
1736
|
if (g.defaultPrevented || p || l || !me(g) || qe(m) || m.isContentEditable) return;
|
1737
|
-
const
|
1738
|
-
if (
|
1737
|
+
const S = n && g.key === "Enter", I = o && g.key === " ", _ = g.key === "Enter" && !n, A = g.key === " " && !o;
|
1738
|
+
if (_ || A) {
|
1739
1739
|
g.preventDefault();
|
1740
1740
|
return;
|
1741
1741
|
}
|
1742
|
-
if (
|
1743
|
-
const
|
1744
|
-
if (
|
1745
|
-
if (!
|
1742
|
+
if (S || I) {
|
1743
|
+
const w = _r(g);
|
1744
|
+
if (S) {
|
1745
|
+
if (!w) {
|
1746
1746
|
g.preventDefault();
|
1747
|
-
const T = g,
|
1748
|
-
Ui() ? vt(m, "keyup",
|
1747
|
+
const T = g, F = J(T, ["view"]), N = () => vr(m, F);
|
1748
|
+
Ui() ? vt(m, "keyup", N) : queueMicrotask(N);
|
1749
1749
|
}
|
1750
|
-
} else
|
1750
|
+
} else I && (c.current = !0, w || (g.preventDefault(), d(!0)));
|
1751
1751
|
}
|
1752
|
-
}),
|
1753
|
-
if (
|
1752
|
+
}), x = i.onKeyUp, P = U((g) => {
|
1753
|
+
if (x == null || x(g), g.defaultPrevented || p || l || g.metaKey) return;
|
1754
1754
|
const m = o && g.key === " ";
|
1755
1755
|
if (c.current && m && (c.current = !1, !_r(g))) {
|
1756
|
-
g.preventDefault(),
|
1757
|
-
const
|
1758
|
-
queueMicrotask(() => vr(
|
1756
|
+
g.preventDefault(), d(!1);
|
1757
|
+
const S = g.currentTarget, I = g, _ = J(I, ["view"]);
|
1758
|
+
queueMicrotask(() => vr(S, _));
|
1759
1759
|
}
|
1760
1760
|
});
|
1761
|
-
return i =
|
1762
|
-
"data-active":
|
1761
|
+
return i = $(O(O({
|
1762
|
+
"data-active": f || void 0,
|
1763
1763
|
type: u ? "button" : void 0
|
1764
1764
|
}, b), i), {
|
1765
1765
|
ref: de(s, i.ref),
|
1766
|
-
onKeyDown:
|
1766
|
+
onKeyDown: E,
|
1767
1767
|
onKeyUp: P
|
1768
1768
|
}), i = on(i), i;
|
1769
1769
|
}
|
@@ -1779,7 +1779,7 @@ var Lo = "button", Ro = Z(
|
|
1779
1779
|
);
|
1780
1780
|
return W(() => {
|
1781
1781
|
r.current && i(Xe(r.current));
|
1782
|
-
}, []), t =
|
1782
|
+
}, []), t = $(O({
|
1783
1783
|
role: !o && n !== "a" ? "button" : void 0
|
1784
1784
|
}, t), {
|
1785
1785
|
ref: de(r, t.ref)
|
@@ -1798,20 +1798,20 @@ var mu = "button", vu = Symbol("disclosure"), Fo = Z(
|
|
1798
1798
|
n,
|
1799
1799
|
process.env.NODE_ENV !== "production" && "Disclosure must receive a `store` prop or be wrapped in a DisclosureProvider component."
|
1800
1800
|
);
|
1801
|
-
const u = Y(null), [a,
|
1801
|
+
const u = Y(null), [a, f] = X(!1), d = n.useState("disclosureElement"), c = n.useState("open");
|
1802
1802
|
W(() => {
|
1803
|
-
let P =
|
1804
|
-
|
1805
|
-
}, [
|
1806
|
-
const l = i.onClick, p = fe(o), [b, v] = fo(i, vu, !0),
|
1803
|
+
let P = d === u.current;
|
1804
|
+
d != null && d.isConnected || (n == null || n.setDisclosureElement(u.current), P = !0), f(c && P);
|
1805
|
+
}, [d, n, c]);
|
1806
|
+
const l = i.onClick, p = fe(o), [b, v] = fo(i, vu, !0), E = U((P) => {
|
1807
1807
|
l == null || l(P), !P.defaultPrevented && (b || p(P) && (n == null || n.setDisclosureElement(P.currentTarget), n == null || n.toggle()));
|
1808
|
-
}),
|
1809
|
-
return i =
|
1808
|
+
}), x = n.useState("contentElement");
|
1809
|
+
return i = $(O(O({
|
1810
1810
|
"aria-expanded": a,
|
1811
|
-
"aria-controls":
|
1811
|
+
"aria-controls": x == null ? void 0 : x.id
|
1812
1812
|
}, v), i), {
|
1813
1813
|
ref: de(u, i.ref),
|
1814
|
-
onClick:
|
1814
|
+
onClick: E
|
1815
1815
|
}), i = Ro(i), i;
|
1816
1816
|
}
|
1817
1817
|
);
|
@@ -1828,9 +1828,9 @@ var gu = "button", No = Z(
|
|
1828
1828
|
process.env.NODE_ENV !== "production" && "DialogDisclosure must receive a `store` prop or be wrapped in a DialogProvider component."
|
1829
1829
|
);
|
1830
1830
|
const s = n.useState("contentElement");
|
1831
|
-
return o =
|
1831
|
+
return o = O({
|
1832
1832
|
"aria-haspopup": Nn(s, "dialog")
|
1833
|
-
}, o), o = Fo(
|
1833
|
+
}, o), o = Fo(O({ store: n }, o)), o;
|
1834
1834
|
}
|
1835
1835
|
);
|
1836
1836
|
G(function(t) {
|
@@ -1841,7 +1841,7 @@ var hu = "div", Mo = Z(
|
|
1841
1841
|
function(t) {
|
1842
1842
|
var r = t, { store: n } = r, o = J(r, ["store"]);
|
1843
1843
|
const i = Zt();
|
1844
|
-
return n = n || i, o =
|
1844
|
+
return n = n || i, o = $(O({}, o), {
|
1845
1845
|
ref: de(n == null ? void 0 : n.setAnchorElement, o.ref)
|
1846
1846
|
}), o;
|
1847
1847
|
}
|
@@ -1864,9 +1864,9 @@ var bu = "button", ko = Z(function(t) {
|
|
1864
1864
|
o,
|
1865
1865
|
(a) => /* @__PURE__ */ k(en, { value: n, children: a }),
|
1866
1866
|
[n]
|
1867
|
-
), o =
|
1867
|
+
), o = $(O({}, o), {
|
1868
1868
|
onClick: u
|
1869
|
-
}), o = Mo(
|
1869
|
+
}), o = Mo(O({ store: n }, o)), o = No(O({ store: n }, o)), o;
|
1870
1870
|
});
|
1871
1871
|
G(function(t) {
|
1872
1872
|
const r = ko(t);
|
@@ -1884,7 +1884,7 @@ var yu = "span", Su = {
|
|
1884
1884
|
n,
|
1885
1885
|
process.env.NODE_ENV !== "production" && "PopoverDisclosureArrow must be wrapped in a PopoverDisclosure component."
|
1886
1886
|
);
|
1887
|
-
const a = n.useState((c) => o || c.placement).split("-")[0],
|
1887
|
+
const a = n.useState((c) => o || c.placement).split("-")[0], f = Su[a], d = He(
|
1888
1888
|
() => /* @__PURE__ */ k(
|
1889
1889
|
"svg",
|
1890
1890
|
{
|
@@ -1897,16 +1897,16 @@ var yu = "span", Su = {
|
|
1897
1897
|
viewBox: "0 0 16 16",
|
1898
1898
|
height: "1em",
|
1899
1899
|
width: "1em",
|
1900
|
-
children: /* @__PURE__ */ k("polyline", { points:
|
1900
|
+
children: /* @__PURE__ */ k("polyline", { points: f })
|
1901
1901
|
}
|
1902
1902
|
),
|
1903
|
-
[
|
1903
|
+
[f]
|
1904
1904
|
);
|
1905
|
-
return i =
|
1906
|
-
children:
|
1905
|
+
return i = $(O({
|
1906
|
+
children: d,
|
1907
1907
|
"aria-hidden": !0
|
1908
1908
|
}, i), {
|
1909
|
-
style:
|
1909
|
+
style: O({
|
1910
1910
|
width: "1em",
|
1911
1911
|
height: "1em",
|
1912
1912
|
pointerEvents: "none"
|
@@ -1923,7 +1923,7 @@ var wu = "span", Eu = Z(
|
|
1923
1923
|
function(t) {
|
1924
1924
|
var r = t, { store: n } = r, o = J(r, ["store"]);
|
1925
1925
|
const i = Co();
|
1926
|
-
return n = n || i, o = Vo(
|
1926
|
+
return n = n || i, o = Vo(O({ store: n }, o)), o;
|
1927
1927
|
}
|
1928
1928
|
), xu = G(function(t) {
|
1929
1929
|
const r = Eu(t);
|
@@ -2016,30 +2016,30 @@ var tr = Z(function(t) {
|
|
2016
2016
|
n,
|
2017
2017
|
process.env.NODE_ENV !== "production" && "CompositeTypeahead must be a Composite component"
|
2018
2018
|
);
|
2019
|
-
const u = i.onKeyDownCapture, a = Y(0),
|
2020
|
-
if (u == null || u(
|
2021
|
-
if (!Lu(
|
2019
|
+
const u = i.onKeyDownCapture, a = Y(0), f = U((d) => {
|
2020
|
+
if (u == null || u(d), d.defaultPrevented || !o || !n) return;
|
2021
|
+
if (!Lu(d))
|
2022
2022
|
return gn();
|
2023
2023
|
const { renderedItems: c, items: l, activeId: p, id: b } = n.getState();
|
2024
2024
|
let v = Fu(
|
2025
2025
|
l.length > c.length ? l : c
|
2026
2026
|
);
|
2027
|
-
const
|
2028
|
-
for (const
|
2029
|
-
const
|
2030
|
-
v.push({ id:
|
2027
|
+
const E = ne(d.currentTarget), x = `[data-offscreen-id="${b}"]`, P = E.querySelectorAll(x);
|
2028
|
+
for (const S of P) {
|
2029
|
+
const I = S.ariaDisabled === "true" || "disabled" in S && !!S.disabled;
|
2030
|
+
v.push({ id: S.id, element: S, disabled: I });
|
2031
2031
|
}
|
2032
|
-
if (P.length && (v = so(v, (
|
2033
|
-
|
2032
|
+
if (P.length && (v = so(v, (S) => S.element)), !Ru(d, v)) return gn();
|
2033
|
+
d.preventDefault(), window.clearTimeout(a.current), a.current = window.setTimeout(() => {
|
2034
2034
|
Ve = "";
|
2035
2035
|
}, 500);
|
2036
|
-
const g =
|
2036
|
+
const g = d.key.toLowerCase();
|
2037
2037
|
Ve += g, v = Nu(v, g, p);
|
2038
|
-
const m = v.find((
|
2038
|
+
const m = v.find((S) => Ht(S, Ve));
|
2039
2039
|
m ? n.move(m.id) : gn();
|
2040
2040
|
});
|
2041
|
-
return i =
|
2042
|
-
onKeyDownCapture:
|
2041
|
+
return i = $(O({}, i), {
|
2042
|
+
onKeyDownCapture: f
|
2043
2043
|
}), rt(i);
|
2044
2044
|
});
|
2045
2045
|
G(function(t) {
|
@@ -2072,8 +2072,8 @@ var Vu = Z(function(t) {
|
|
2072
2072
|
required: s,
|
2073
2073
|
showOnKeyDown: u = !0,
|
2074
2074
|
moveOnKeyDown: a = !0,
|
2075
|
-
toggleOnPress:
|
2076
|
-
toggleOnClick:
|
2075
|
+
toggleOnPress: f = !0,
|
2076
|
+
toggleOnClick: d = f
|
2077
2077
|
} = r, c = J(r, [
|
2078
2078
|
"store",
|
2079
2079
|
"name",
|
@@ -2089,41 +2089,41 @@ var Vu = Z(function(t) {
|
|
2089
2089
|
n,
|
2090
2090
|
process.env.NODE_ENV !== "production" && "Select must receive a `store` prop or be wrapped in a SelectProvider component."
|
2091
2091
|
);
|
2092
|
-
const p = c.onKeyDown, b = fe(u), v = fe(a),
|
2093
|
-
var
|
2092
|
+
const p = c.onKeyDown, b = fe(u), v = fe(a), x = n.useState("placement").split("-")[0], P = n.useState("value"), g = Array.isArray(P), m = U((D) => {
|
2093
|
+
var y;
|
2094
2094
|
if (p == null || p(D), D.defaultPrevented || !n) return;
|
2095
|
-
const { orientation:
|
2096
|
-
ArrowUp: (H ||
|
2095
|
+
const { orientation: R, items: B, activeId: h } = n.getState(), M = R !== "horizontal", K = R !== "vertical", H = !!((y = B.find((ue) => !ue.disabled && ue.value != null)) != null && y.rowId), oe = {
|
2096
|
+
ArrowUp: (H || M) && Vt(n, n.up),
|
2097
2097
|
ArrowRight: (H || K) && Vt(n, n.next),
|
2098
|
-
ArrowDown: (H ||
|
2098
|
+
ArrowDown: (H || M) && Vt(n, n.down),
|
2099
2099
|
ArrowLeft: (H || K) && Vt(n, n.previous)
|
2100
2100
|
}[D.key];
|
2101
2101
|
oe && v(D) && (D.preventDefault(), n.move(oe()));
|
2102
|
-
const re =
|
2102
|
+
const re = x === "top" || x === "bottom";
|
2103
2103
|
({
|
2104
2104
|
ArrowDown: re,
|
2105
2105
|
ArrowUp: re,
|
2106
|
-
ArrowLeft:
|
2107
|
-
ArrowRight:
|
2108
|
-
})[D.key] && b(D) && (D.preventDefault(), n.move(
|
2106
|
+
ArrowLeft: x === "left",
|
2107
|
+
ArrowRight: x === "right"
|
2108
|
+
})[D.key] && b(D) && (D.preventDefault(), n.move(h), vt(D.currentTarget, "keyup", n.show));
|
2109
2109
|
});
|
2110
2110
|
c = le(
|
2111
2111
|
c,
|
2112
2112
|
(D) => /* @__PURE__ */ k(Oo, { value: n, children: D }),
|
2113
2113
|
[n]
|
2114
2114
|
);
|
2115
|
-
const [
|
2115
|
+
const [S, I] = X(!1), _ = Y(!1);
|
2116
2116
|
W(() => {
|
2117
|
-
const D =
|
2118
|
-
|
2117
|
+
const D = _.current;
|
2118
|
+
_.current = !1, !D && I(!1);
|
2119
2119
|
}, [P]);
|
2120
2120
|
const A = n.useState((D) => {
|
2121
|
-
var
|
2122
|
-
return (
|
2123
|
-
}),
|
2121
|
+
var y;
|
2122
|
+
return (y = D.labelElement) == null ? void 0 : y.id;
|
2123
|
+
}), w = c["aria-label"], T = c["aria-labelledby"] || A, F = n.useState((D) => {
|
2124
2124
|
if (o)
|
2125
2125
|
return D.items;
|
2126
|
-
}),
|
2126
|
+
}), N = He(() => [...new Set(F == null ? void 0 : F.map((D) => D.value).filter((D) => D != null))], [F]);
|
2127
2127
|
c = le(
|
2128
2128
|
c,
|
2129
2129
|
(D) => o ? /* @__PURE__ */ Fe(mt, { children: [
|
@@ -2143,7 +2143,7 @@ var Vu = Z(function(t) {
|
|
2143
2143
|
},
|
2144
2144
|
tabIndex: -1,
|
2145
2145
|
"aria-hidden": !0,
|
2146
|
-
"aria-label":
|
2146
|
+
"aria-label": w,
|
2147
2147
|
"aria-labelledby": T,
|
2148
2148
|
name: o,
|
2149
2149
|
form: i,
|
@@ -2151,17 +2151,17 @@ var Vu = Z(function(t) {
|
|
2151
2151
|
value: P,
|
2152
2152
|
multiple: g,
|
2153
2153
|
onFocus: () => {
|
2154
|
-
var
|
2155
|
-
return (
|
2154
|
+
var y;
|
2155
|
+
return (y = n == null ? void 0 : n.getState().selectElement) == null ? void 0 : y.focus();
|
2156
2156
|
},
|
2157
|
-
onChange: (
|
2158
|
-
|
2159
|
-
g ? ku(
|
2157
|
+
onChange: (y) => {
|
2158
|
+
_.current = !0, I(!0), n == null || n.setValue(
|
2159
|
+
g ? ku(y.target) : y.target.value
|
2160
2160
|
);
|
2161
2161
|
},
|
2162
2162
|
children: [
|
2163
|
-
bo(P).map((
|
2164
|
-
|
2163
|
+
bo(P).map((y) => y == null || N.includes(y) ? null : /* @__PURE__ */ k("option", { value: y, children: y }, y)),
|
2164
|
+
N.map((y) => /* @__PURE__ */ k("option", { value: y, children: y }, y))
|
2165
2165
|
]
|
2166
2166
|
}
|
2167
2167
|
),
|
@@ -2169,32 +2169,32 @@ var Vu = Z(function(t) {
|
|
2169
2169
|
] }) : D,
|
2170
2170
|
[
|
2171
2171
|
n,
|
2172
|
-
|
2172
|
+
w,
|
2173
2173
|
T,
|
2174
2174
|
o,
|
2175
2175
|
i,
|
2176
2176
|
s,
|
2177
2177
|
P,
|
2178
2178
|
g,
|
2179
|
-
|
2179
|
+
N
|
2180
2180
|
]
|
2181
2181
|
);
|
2182
|
-
const
|
2182
|
+
const C = /* @__PURE__ */ Fe(mt, { children: [
|
2183
2183
|
P,
|
2184
2184
|
/* @__PURE__ */ k(xu, {})
|
2185
2185
|
] }), L = n.useState("contentElement");
|
2186
|
-
return c =
|
2186
|
+
return c = $(O({
|
2187
2187
|
role: "combobox",
|
2188
2188
|
"aria-autocomplete": "none",
|
2189
2189
|
"aria-labelledby": A,
|
2190
2190
|
"aria-haspopup": Nn(L, "listbox"),
|
2191
|
-
"data-autofill":
|
2191
|
+
"data-autofill": S || void 0,
|
2192
2192
|
"data-name": o,
|
2193
|
-
children:
|
2193
|
+
children: C
|
2194
2194
|
}, c), {
|
2195
2195
|
ref: de(n.setSelectElement, c.ref),
|
2196
2196
|
onKeyDown: m
|
2197
|
-
}), c = ko(
|
2197
|
+
}), c = ko(O({ store: n, toggleOnClick: d }, c)), c = tr(O({ store: n }, c)), c;
|
2198
2198
|
}), $u = G(function(t) {
|
2199
2199
|
const r = Vu(t);
|
2200
2200
|
return Q(Mu, r);
|
@@ -2238,21 +2238,21 @@ var Bo = Z(
|
|
2238
2238
|
n,
|
2239
2239
|
process.env.NODE_ENV !== "production" && "CompositeHover must be wrapped in a Composite component."
|
2240
2240
|
);
|
2241
|
-
const a = ts(),
|
2242
|
-
if (
|
2243
|
-
if (!Do(
|
2244
|
-
const
|
2245
|
-
|
2241
|
+
const a = ts(), f = s.onMouseMove, d = fe(o), c = U((E) => {
|
2242
|
+
if (f == null || f(E), !E.defaultPrevented && a() && d(E)) {
|
2243
|
+
if (!Do(E.currentTarget)) {
|
2244
|
+
const x = n == null ? void 0 : n.getState().baseElement;
|
2245
|
+
x && !Ut(x) && x.focus();
|
2246
2246
|
}
|
2247
|
-
n == null || n.setActiveId(
|
2247
|
+
n == null || n.setActiveId(E.currentTarget.id);
|
2248
2248
|
}
|
2249
|
-
}), l = s.onMouseLeave, p = fe(i), b = U((
|
2250
|
-
var
|
2251
|
-
l == null || l(
|
2252
|
-
}), v = xe((
|
2253
|
-
|
2249
|
+
}), l = s.onMouseLeave, p = fe(i), b = U((E) => {
|
2250
|
+
var x;
|
2251
|
+
l == null || l(E), !E.defaultPrevented && a() && (Hu(E) || Wu(E) || d(E) && p(E) && (n == null || n.setActiveId(null), (x = n == null ? void 0 : n.getState().baseElement) == null || x.focus()));
|
2252
|
+
}), v = xe((E) => {
|
2253
|
+
E && (E[Cn] = !0);
|
2254
2254
|
}, []);
|
2255
|
-
return s =
|
2255
|
+
return s = $(O({}, s), {
|
2256
2256
|
ref: de(v, s.ref),
|
2257
2257
|
onMouseMove: c,
|
2258
2258
|
onMouseLeave: b
|
@@ -2281,14 +2281,14 @@ var qu = "div", Ko = Z(
|
|
2281
2281
|
]);
|
2282
2282
|
const a = os();
|
2283
2283
|
n = n || a;
|
2284
|
-
const
|
2284
|
+
const f = ot(u.id), d = Y(s);
|
2285
2285
|
return W(() => {
|
2286
|
-
const c =
|
2287
|
-
if (!
|
2288
|
-
const l = i({ id:
|
2286
|
+
const c = d.current;
|
2287
|
+
if (!f || !c || !o) return;
|
2288
|
+
const l = i({ id: f, element: c });
|
2289
2289
|
return n == null ? void 0 : n.renderItem(l);
|
2290
|
-
}, [
|
2291
|
-
ref: de(
|
2290
|
+
}, [f, o, i, n]), u = $(O({}, u), {
|
2291
|
+
ref: de(d, u.ref)
|
2292
2292
|
}), rt(u);
|
2293
2293
|
}
|
2294
2294
|
);
|
@@ -2314,19 +2314,19 @@ function Ar(e, t, r, n = !1) {
|
|
2314
2314
|
const { renderedItems: i } = t.getState(), s = io(e);
|
2315
2315
|
if (!s) return;
|
2316
2316
|
const u = ju(s, n);
|
2317
|
-
let a,
|
2318
|
-
for (let
|
2317
|
+
let a, f;
|
2318
|
+
for (let d = 0; d < i.length; d += 1) {
|
2319
2319
|
const c = a;
|
2320
|
-
if (a = r(
|
2320
|
+
if (a = r(d), !a) break;
|
2321
2321
|
if (a === c) continue;
|
2322
2322
|
const l = (o = Ge(t, a)) == null ? void 0 : o.element;
|
2323
2323
|
if (!l) continue;
|
2324
2324
|
const b = Gu(l, n) - u, v = Math.abs(b);
|
2325
2325
|
if (n && b <= 0 || !n && b >= 0) {
|
2326
|
-
|
2326
|
+
f !== void 0 && f < v && (a = c);
|
2327
2327
|
break;
|
2328
2328
|
}
|
2329
|
-
|
2329
|
+
f = v;
|
2330
2330
|
}
|
2331
2331
|
return a;
|
2332
2332
|
}
|
@@ -2342,8 +2342,8 @@ var Ho = Z(
|
|
2342
2342
|
moveOnKeyPress: s = !0,
|
2343
2343
|
tabbable: u = !1,
|
2344
2344
|
getItem: a,
|
2345
|
-
"aria-setsize":
|
2346
|
-
"aria-posinset":
|
2345
|
+
"aria-setsize": f,
|
2346
|
+
"aria-posinset": d
|
2347
2347
|
} = r, c = J(r, [
|
2348
2348
|
"store",
|
2349
2349
|
"rowId",
|
@@ -2356,127 +2356,127 @@ var Ho = Z(
|
|
2356
2356
|
]);
|
2357
2357
|
const l = Kn();
|
2358
2358
|
n = n || l;
|
2359
|
-
const p = ot(c.id), b = Y(null), v = et(cs),
|
2359
|
+
const p = ot(c.id), b = Y(null), v = et(cs), x = Xt(c) && !c.accessibleWhenDisabled, {
|
2360
2360
|
rowId: P,
|
2361
2361
|
baseElement: g,
|
2362
2362
|
isActiveItem: m,
|
2363
|
-
ariaSetSize:
|
2364
|
-
ariaPosInSet:
|
2365
|
-
isTabbable:
|
2363
|
+
ariaSetSize: S,
|
2364
|
+
ariaPosInSet: I,
|
2365
|
+
isTabbable: _
|
2366
2366
|
} = ho(n, {
|
2367
|
-
rowId(
|
2367
|
+
rowId(h) {
|
2368
2368
|
if (o) return o;
|
2369
|
-
if (
|
2369
|
+
if (h && v != null && v.baseElement && v.baseElement === h.baseElement)
|
2370
2370
|
return v.id;
|
2371
2371
|
},
|
2372
|
-
baseElement(
|
2373
|
-
return (
|
2372
|
+
baseElement(h) {
|
2373
|
+
return (h == null ? void 0 : h.baseElement) || void 0;
|
2374
2374
|
},
|
2375
|
-
isActiveItem(
|
2376
|
-
return !!
|
2375
|
+
isActiveItem(h) {
|
2376
|
+
return !!h && h.activeId === p;
|
2377
2377
|
},
|
2378
|
-
ariaSetSize(
|
2379
|
-
if (
|
2380
|
-
if (
|
2378
|
+
ariaSetSize(h) {
|
2379
|
+
if (f != null) return f;
|
2380
|
+
if (h && v != null && v.ariaSetSize && v.baseElement === h.baseElement)
|
2381
2381
|
return v.ariaSetSize;
|
2382
2382
|
},
|
2383
|
-
ariaPosInSet(
|
2384
|
-
if (
|
2385
|
-
if (!
|
2386
|
-
const
|
2383
|
+
ariaPosInSet(h) {
|
2384
|
+
if (d != null) return d;
|
2385
|
+
if (!h || !(v != null && v.ariaPosInSet) || v.baseElement !== h.baseElement) return;
|
2386
|
+
const M = h.renderedItems.filter(
|
2387
2387
|
(K) => K.rowId === P
|
2388
2388
|
);
|
2389
|
-
return v.ariaPosInSet +
|
2389
|
+
return v.ariaPosInSet + M.findIndex((K) => K.id === p);
|
2390
2390
|
},
|
2391
|
-
isTabbable(
|
2392
|
-
if (!(
|
2393
|
-
if (
|
2391
|
+
isTabbable(h) {
|
2392
|
+
if (!(h != null && h.renderedItems.length)) return !0;
|
2393
|
+
if (h.virtualFocus) return !1;
|
2394
2394
|
if (u) return !0;
|
2395
|
-
if (
|
2396
|
-
const
|
2397
|
-
return
|
2395
|
+
if (h.activeId === null) return !1;
|
2396
|
+
const M = n == null ? void 0 : n.item(h.activeId);
|
2397
|
+
return M != null && M.disabled || !(M != null && M.element) ? !0 : h.activeId === p;
|
2398
2398
|
}
|
2399
2399
|
}), A = xe(
|
2400
|
-
(
|
2401
|
-
var
|
2402
|
-
const K =
|
2403
|
-
id: p ||
|
2400
|
+
(h) => {
|
2401
|
+
var M;
|
2402
|
+
const K = $(O({}, h), {
|
2403
|
+
id: p || h.id,
|
2404
2404
|
rowId: P,
|
2405
|
-
disabled: !!
|
2406
|
-
children: (
|
2405
|
+
disabled: !!x,
|
2406
|
+
children: (M = h.element) == null ? void 0 : M.textContent
|
2407
2407
|
});
|
2408
2408
|
return a ? a(K) : K;
|
2409
2409
|
},
|
2410
|
-
[p, P,
|
2411
|
-
),
|
2412
|
-
if (
|
2413
|
-
const { virtualFocus:
|
2414
|
-
if (n.setActiveId(p), En(
|
2415
|
-
kn() &&
|
2410
|
+
[p, P, x, a]
|
2411
|
+
), w = c.onFocus, T = Y(!1), F = U((h) => {
|
2412
|
+
if (w == null || w(h), h.defaultPrevented || uo(h) || !p || !n || Yu(h, n)) return;
|
2413
|
+
const { virtualFocus: M, baseElement: K } = n.getState();
|
2414
|
+
if (n.setActiveId(p), En(h.currentTarget) && _u(h.currentTarget), !M || !me(h) || Uu(h.currentTarget) || !(K != null && K.isConnected)) return;
|
2415
|
+
kn() && h.currentTarget.hasAttribute("data-autofocus") && h.currentTarget.scrollIntoView({
|
2416
2416
|
block: "nearest",
|
2417
2417
|
inline: "nearest"
|
2418
|
-
}), T.current = !0,
|
2419
|
-
}),
|
2420
|
-
if (
|
2421
|
-
const
|
2422
|
-
|
2423
|
-
}), L = c.onKeyDown, D = fe(i),
|
2424
|
-
if (L == null || L(
|
2425
|
-
const { currentTarget:
|
2418
|
+
}), T.current = !0, h.relatedTarget === K || xt(n, h.relatedTarget) ? Du(K) : K.focus();
|
2419
|
+
}), N = c.onBlurCapture, C = U((h) => {
|
2420
|
+
if (N == null || N(h), h.defaultPrevented) return;
|
2421
|
+
const M = n == null ? void 0 : n.getState();
|
2422
|
+
M != null && M.virtualFocus && T.current && (T.current = !1, h.preventDefault(), h.stopPropagation());
|
2423
|
+
}), L = c.onKeyDown, D = fe(i), y = fe(s), R = U((h) => {
|
2424
|
+
if (L == null || L(h), h.defaultPrevented || !me(h) || !n) return;
|
2425
|
+
const { currentTarget: M } = h, K = n.getState(), H = n.item(p), ie = !!(H != null && H.rowId), oe = K.orientation !== "horizontal", re = K.orientation !== "vertical", be = () => !!(ie || re || !K.baseElement || !qe(K.baseElement)), ye = {
|
2426
2426
|
ArrowUp: (ie || oe) && n.up,
|
2427
2427
|
ArrowRight: (ie || re) && n.next,
|
2428
2428
|
ArrowDown: (ie || oe) && n.down,
|
2429
2429
|
ArrowLeft: (ie || re) && n.previous,
|
2430
2430
|
Home: () => {
|
2431
2431
|
if (be())
|
2432
|
-
return !ie ||
|
2432
|
+
return !ie || h.ctrlKey ? n == null ? void 0 : n.first() : n == null ? void 0 : n.previous(-1);
|
2433
2433
|
},
|
2434
2434
|
End: () => {
|
2435
2435
|
if (be())
|
2436
|
-
return !ie ||
|
2436
|
+
return !ie || h.ctrlKey ? n == null ? void 0 : n.last() : n == null ? void 0 : n.next(-1);
|
2437
2437
|
},
|
2438
|
-
PageUp: () => Ar(
|
2439
|
-
PageDown: () => Ar(
|
2440
|
-
}[
|
2438
|
+
PageUp: () => Ar(M, n, n == null ? void 0 : n.up, !0),
|
2439
|
+
PageDown: () => Ar(M, n, n == null ? void 0 : n.down)
|
2440
|
+
}[h.key];
|
2441
2441
|
if (ye) {
|
2442
|
-
if (En(
|
2443
|
-
const ue = Hi(
|
2442
|
+
if (En(M)) {
|
2443
|
+
const ue = Hi(M), ut = re && h.key === "ArrowLeft", at = re && h.key === "ArrowRight", Me = oe && h.key === "ArrowUp", Ue = oe && h.key === "ArrowDown";
|
2444
2444
|
if (at || Ue) {
|
2445
|
-
const { length: ct } = Ki(
|
2445
|
+
const { length: ct } = Ki(M);
|
2446
2446
|
if (ue.end !== ct) return;
|
2447
2447
|
} else if ((ut || Me) && ue.start !== 0) return;
|
2448
2448
|
}
|
2449
2449
|
const Ie = ye();
|
2450
|
-
if (D(
|
2451
|
-
if (!h
|
2452
|
-
|
2450
|
+
if (D(h) || Ie !== void 0) {
|
2451
|
+
if (!y(h)) return;
|
2452
|
+
h.preventDefault(), n.move(Ie);
|
2453
2453
|
}
|
2454
2454
|
}
|
2455
|
-
}),
|
2455
|
+
}), B = He(
|
2456
2456
|
() => ({ id: p, baseElement: g }),
|
2457
2457
|
[p, g]
|
2458
2458
|
);
|
2459
2459
|
return c = le(
|
2460
2460
|
c,
|
2461
|
-
(
|
2462
|
-
[
|
2463
|
-
), c =
|
2461
|
+
(h) => /* @__PURE__ */ k(as.Provider, { value: B, children: h }),
|
2462
|
+
[B]
|
2463
|
+
), c = $(O({
|
2464
2464
|
id: p,
|
2465
2465
|
"data-active-item": m || void 0
|
2466
2466
|
}, c), {
|
2467
2467
|
ref: de(b, c.ref),
|
2468
|
-
tabIndex:
|
2469
|
-
onFocus:
|
2470
|
-
onBlurCapture:
|
2471
|
-
onKeyDown:
|
2472
|
-
}), c = er(c), c = Ko(
|
2468
|
+
tabIndex: _ ? c.tabIndex : -1,
|
2469
|
+
onFocus: F,
|
2470
|
+
onBlurCapture: C,
|
2471
|
+
onKeyDown: R
|
2472
|
+
}), c = er(c), c = Ko($(O({
|
2473
2473
|
store: n
|
2474
2474
|
}, c), {
|
2475
2475
|
getItem: A,
|
2476
2476
|
shouldRegisterItem: p ? c.shouldRegisterItem : !1
|
2477
|
-
})), rt(
|
2478
|
-
"aria-setsize":
|
2479
|
-
"aria-posinset":
|
2477
|
+
})), rt($(O({}, c), {
|
2478
|
+
"aria-setsize": S,
|
2479
|
+
"aria-posinset": I
|
2480
2480
|
}));
|
2481
2481
|
}
|
2482
2482
|
);
|
@@ -2500,8 +2500,8 @@ var Qu = Z(
|
|
2500
2500
|
hideOnClick: s,
|
2501
2501
|
setValueOnClick: u = o != null,
|
2502
2502
|
preventScrollOnKeyDown: a = !0,
|
2503
|
-
focusOnHover:
|
2504
|
-
} = r,
|
2503
|
+
focusOnHover: f = !0
|
2504
|
+
} = r, d = J(r, [
|
2505
2505
|
"store",
|
2506
2506
|
"value",
|
2507
2507
|
"getItem",
|
@@ -2515,20 +2515,20 @@ var Qu = Z(
|
|
2515
2515
|
n,
|
2516
2516
|
process.env.NODE_ENV !== "production" && "SelectItem must be wrapped in a SelectList or SelectPopover component."
|
2517
2517
|
);
|
2518
|
-
const p = ot(
|
2518
|
+
const p = ot(d.id), b = Xt(d), { listElement: v, multiSelectable: E, selected: x, autoFocus: P } = ho(n, {
|
2519
2519
|
listElement: "listElement",
|
2520
|
-
multiSelectable(
|
2521
|
-
return Array.isArray(
|
2520
|
+
multiSelectable(w) {
|
2521
|
+
return Array.isArray(w.value);
|
2522
2522
|
},
|
2523
|
-
selected(
|
2524
|
-
return Ju(
|
2523
|
+
selected(w) {
|
2524
|
+
return Ju(w.value, o);
|
2525
2525
|
},
|
2526
|
-
autoFocus(
|
2527
|
-
return o == null ||
|
2526
|
+
autoFocus(w) {
|
2527
|
+
return o == null || w.value == null || w.activeId !== p && (n != null && n.item(w.activeId)) ? !1 : Array.isArray(w.value) ? w.value[w.value.length - 1] === o : w.value === o;
|
2528
2528
|
}
|
2529
2529
|
}), g = xe(
|
2530
|
-
(
|
2531
|
-
const T =
|
2530
|
+
(w) => {
|
2531
|
+
const T = $(O({}, w), {
|
2532
2532
|
value: b ? void 0 : o,
|
2533
2533
|
children: o
|
2534
2534
|
});
|
@@ -2536,40 +2536,40 @@ var Qu = Z(
|
|
2536
2536
|
},
|
2537
2537
|
[b, o, i]
|
2538
2538
|
);
|
2539
|
-
s = s ?? (o != null && !
|
2540
|
-
const m =
|
2541
|
-
m == null || m(
|
2539
|
+
s = s ?? (o != null && !E);
|
2540
|
+
const m = d.onClick, S = fe(u), I = fe(s), _ = U((w) => {
|
2541
|
+
m == null || m(w), !w.defaultPrevented && (Yi(w) || Gi(w) || (S(w) && o != null && (n == null || n.setValue((T) => Array.isArray(T) ? T.includes(o) ? T.filter((F) => F !== o) : [...T, o] : o)), I(w) && (n == null || n.hide())));
|
2542
2542
|
});
|
2543
|
-
|
2544
|
-
|
2545
|
-
(
|
2546
|
-
[
|
2547
|
-
),
|
2543
|
+
d = le(
|
2544
|
+
d,
|
2545
|
+
(w) => /* @__PURE__ */ k(Us.Provider, { value: x ?? !1, children: w }),
|
2546
|
+
[x]
|
2547
|
+
), d = $(O({
|
2548
2548
|
id: p,
|
2549
2549
|
role: Wi(v),
|
2550
|
-
"aria-selected":
|
2550
|
+
"aria-selected": x,
|
2551
2551
|
children: o
|
2552
|
-
},
|
2553
|
-
autoFocus: (c =
|
2554
|
-
onClick:
|
2555
|
-
}),
|
2552
|
+
}, d), {
|
2553
|
+
autoFocus: (c = d.autoFocus) != null ? c : P,
|
2554
|
+
onClick: _
|
2555
|
+
}), d = Ho(O({
|
2556
2556
|
store: n,
|
2557
2557
|
getItem: g,
|
2558
2558
|
preventScrollOnKeyDown: a
|
2559
|
-
},
|
2560
|
-
const A = fe(
|
2561
|
-
return
|
2559
|
+
}, d));
|
2560
|
+
const A = fe(f);
|
2561
|
+
return d = Bo($(O({
|
2562
2562
|
store: n
|
2563
|
-
},
|
2563
|
+
}, d), {
|
2564
2564
|
// We have to disable focusOnHover when the popup is closed, otherwise
|
2565
2565
|
// the active item will change to null (the container) when the popup is
|
2566
2566
|
// closed by clicking on an item.
|
2567
|
-
focusOnHover(
|
2568
|
-
if (!A(
|
2567
|
+
focusOnHover(w) {
|
2568
|
+
if (!A(w)) return !1;
|
2569
2569
|
const T = n == null ? void 0 : n.getState();
|
2570
2570
|
return !!(T != null && T.open);
|
2571
2571
|
}
|
2572
|
-
})),
|
2572
|
+
})), d;
|
2573
2573
|
}
|
2574
2574
|
), Zu = Bn(
|
2575
2575
|
G(function(t) {
|
@@ -2593,8 +2593,8 @@ function Tr(e, t, r) {
|
|
2593
2593
|
if (t == null || t(n), n.defaultPrevented || n.isPropagationStopped() || !me(n) || ra(n) || na(n)) return;
|
2594
2594
|
const i = e.getState(), s = (o = Ge(e, i.activeId)) == null ? void 0 : o.element;
|
2595
2595
|
if (!s) return;
|
2596
|
-
const u = n, a = J(u, ["view"]),
|
2597
|
-
s !==
|
2596
|
+
const u = n, a = J(u, ["view"]), f = r == null ? void 0 : r.current;
|
2597
|
+
s !== f && s.focus(), Xi(s, n.type, a) || n.preventDefault(), n.currentTarget.contains(s) && n.stopPropagation();
|
2598
2598
|
});
|
2599
2599
|
}
|
2600
2600
|
function oa(e) {
|
@@ -2629,111 +2629,111 @@ var Wo = Z(
|
|
2629
2629
|
n,
|
2630
2630
|
process.env.NODE_ENV !== "production" && "Composite must receive a `store` prop or be wrapped in a CompositeProvider component."
|
2631
2631
|
);
|
2632
|
-
const
|
2632
|
+
const f = Y(null), d = Y(null), c = ia(n), l = n.useState("moves"), [, p] = ao(
|
2633
2633
|
o ? n.setBaseElement : null
|
2634
2634
|
);
|
2635
2635
|
W(() => {
|
2636
|
-
var
|
2636
|
+
var C;
|
2637
2637
|
if (!n || !l || !o || !i) return;
|
2638
|
-
const { activeId: L } = n.getState(), D = (
|
2638
|
+
const { activeId: L } = n.getState(), D = (C = Ge(n, L)) == null ? void 0 : C.element;
|
2639
2639
|
D && tu(D);
|
2640
2640
|
}, [n, l, o, i]), ee(() => {
|
2641
2641
|
if (!n || !l || !o) return;
|
2642
|
-
const { baseElement:
|
2643
|
-
if (!(L === null) || !
|
2644
|
-
const
|
2645
|
-
|
2642
|
+
const { baseElement: C, activeId: L } = n.getState();
|
2643
|
+
if (!(L === null) || !C) return;
|
2644
|
+
const y = d.current;
|
2645
|
+
d.current = null, y && dt(y, { relatedTarget: C }), Ut(C) || C.focus();
|
2646
2646
|
}, [n, l, o]);
|
2647
2647
|
const b = n.useState("activeId"), v = n.useState("virtualFocus");
|
2648
2648
|
ee(() => {
|
2649
|
-
var
|
2649
|
+
var C;
|
2650
2650
|
if (!n || !o || !v) return;
|
2651
|
-
const L =
|
2652
|
-
if (
|
2653
|
-
const
|
2654
|
-
|
2651
|
+
const L = d.current;
|
2652
|
+
if (d.current = null, !L) return;
|
2653
|
+
const y = ((C = Ge(n, b)) == null ? void 0 : C.element) || We(L);
|
2654
|
+
y !== L && dt(L, { relatedTarget: y });
|
2655
2655
|
}, [n, b, v, o]);
|
2656
|
-
const
|
2656
|
+
const E = Tr(
|
2657
2657
|
n,
|
2658
2658
|
u.onKeyDownCapture,
|
2659
|
-
|
2660
|
-
),
|
2659
|
+
d
|
2660
|
+
), x = Tr(
|
2661
2661
|
n,
|
2662
2662
|
u.onKeyUpCapture,
|
2663
|
-
|
2664
|
-
), P = u.onFocusCapture, g = U((
|
2665
|
-
if (P == null || P(
|
2663
|
+
d
|
2664
|
+
), P = u.onFocusCapture, g = U((C) => {
|
2665
|
+
if (P == null || P(C), C.defaultPrevented || !n) return;
|
2666
2666
|
const { virtualFocus: L } = n.getState();
|
2667
2667
|
if (!L) return;
|
2668
|
-
const D =
|
2669
|
-
me(
|
2670
|
-
}), m = u.onFocus,
|
2671
|
-
if (m == null || m(
|
2672
|
-
const { relatedTarget: L } =
|
2673
|
-
D ? me(
|
2674
|
-
}),
|
2668
|
+
const D = C.relatedTarget, y = Au(C.currentTarget);
|
2669
|
+
me(C) && y && (C.stopPropagation(), d.current = D);
|
2670
|
+
}), m = u.onFocus, S = U((C) => {
|
2671
|
+
if (m == null || m(C), C.defaultPrevented || !o || !n) return;
|
2672
|
+
const { relatedTarget: L } = C, { virtualFocus: D } = n.getState();
|
2673
|
+
D ? me(C) && !xt(n, L) && queueMicrotask(c) : me(C) && n.setActiveId(null);
|
2674
|
+
}), I = u.onBlurCapture, _ = U((C) => {
|
2675
2675
|
var L;
|
2676
|
-
if (
|
2677
|
-
const { virtualFocus: D, activeId:
|
2676
|
+
if (I == null || I(C), C.defaultPrevented || !n) return;
|
2677
|
+
const { virtualFocus: D, activeId: y } = n.getState();
|
2678
2678
|
if (!D) return;
|
2679
|
-
const
|
2680
|
-
|
2681
|
-
}), A = u.onKeyDown,
|
2679
|
+
const R = (L = Ge(n, y)) == null ? void 0 : L.element, B = C.relatedTarget, h = xt(n, B), M = d.current;
|
2680
|
+
d.current = null, me(C) && h ? (B === R ? M && M !== B && dt(M, C) : R ? dt(R, C) : M && dt(M, C), C.stopPropagation()) : !xt(n, C.target) && R && dt(R, C);
|
2681
|
+
}), A = u.onKeyDown, w = fe(s), T = U((C) => {
|
2682
2682
|
var L;
|
2683
|
-
if (A == null || A(
|
2684
|
-
const { orientation: D, renderedItems:
|
2685
|
-
if ((L =
|
2686
|
-
const
|
2687
|
-
if ((
|
2683
|
+
if (A == null || A(C), C.defaultPrevented || !n || !me(C)) return;
|
2684
|
+
const { orientation: D, renderedItems: y, activeId: R } = n.getState(), B = Ge(n, R);
|
2685
|
+
if ((L = B == null ? void 0 : B.element) != null && L.isConnected) return;
|
2686
|
+
const h = D !== "horizontal", M = D !== "vertical", K = ta(y);
|
2687
|
+
if ((C.key === "ArrowLeft" || C.key === "ArrowRight" || C.key === "Home" || C.key === "End") && qe(C.currentTarget)) return;
|
2688
2688
|
const re = {
|
2689
|
-
ArrowUp: (K ||
|
2689
|
+
ArrowUp: (K || h) && (() => {
|
2690
2690
|
if (K) {
|
2691
|
-
const be = oa(
|
2691
|
+
const be = oa(y);
|
2692
2692
|
return be == null ? void 0 : be.id;
|
2693
2693
|
}
|
2694
2694
|
return n == null ? void 0 : n.last();
|
2695
2695
|
}),
|
2696
|
-
ArrowRight: (K ||
|
2697
|
-
ArrowDown: (K ||
|
2698
|
-
ArrowLeft: (K ||
|
2696
|
+
ArrowRight: (K || M) && n.first,
|
2697
|
+
ArrowDown: (K || h) && n.first,
|
2698
|
+
ArrowLeft: (K || M) && n.last,
|
2699
2699
|
Home: n.first,
|
2700
2700
|
End: n.last,
|
2701
2701
|
PageUp: n.first,
|
2702
2702
|
PageDown: n.last
|
2703
|
-
}[
|
2703
|
+
}[C.key];
|
2704
2704
|
if (re) {
|
2705
2705
|
const be = re();
|
2706
2706
|
if (be !== void 0) {
|
2707
|
-
if (!
|
2708
|
-
|
2707
|
+
if (!w(C)) return;
|
2708
|
+
C.preventDefault(), n.move(be);
|
2709
2709
|
}
|
2710
2710
|
}
|
2711
2711
|
});
|
2712
2712
|
u = le(
|
2713
2713
|
u,
|
2714
|
-
(
|
2714
|
+
(C) => /* @__PURE__ */ k(Hn, { value: n, children: C }),
|
2715
2715
|
[n]
|
2716
2716
|
);
|
2717
|
-
const
|
2717
|
+
const F = n.useState((C) => {
|
2718
2718
|
var L;
|
2719
|
-
if (n && o &&
|
2720
|
-
return (L = Ge(n,
|
2719
|
+
if (n && o && C.virtualFocus)
|
2720
|
+
return (L = Ge(n, C.activeId)) == null ? void 0 : L.id;
|
2721
2721
|
});
|
2722
|
-
u =
|
2723
|
-
"aria-activedescendant":
|
2722
|
+
u = $(O({
|
2723
|
+
"aria-activedescendant": F
|
2724
2724
|
}, u), {
|
2725
|
-
ref: de(
|
2726
|
-
onKeyDownCapture:
|
2727
|
-
onKeyUpCapture:
|
2725
|
+
ref: de(f, p, u.ref),
|
2726
|
+
onKeyDownCapture: E,
|
2727
|
+
onKeyUpCapture: x,
|
2728
2728
|
onFocusCapture: g,
|
2729
|
-
onFocus:
|
2730
|
-
onBlurCapture:
|
2729
|
+
onFocus: S,
|
2730
|
+
onBlurCapture: _,
|
2731
2731
|
onKeyDown: T
|
2732
2732
|
});
|
2733
|
-
const
|
2734
|
-
(
|
2733
|
+
const N = n.useState(
|
2734
|
+
(C) => o && (C.virtualFocus || C.activeId === null)
|
2735
2735
|
);
|
2736
|
-
return u = on(
|
2736
|
+
return u = on(O({ focusable: N }, u)), u;
|
2737
2737
|
}
|
2738
2738
|
);
|
2739
2739
|
G(function(t) {
|
@@ -2767,7 +2767,7 @@ var rr = Z(function(t) {
|
|
2767
2767
|
n,
|
2768
2768
|
process.env.NODE_ENV !== "production" && "DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component."
|
2769
2769
|
);
|
2770
|
-
const u = Y(null), a = ot(i.id), [
|
2770
|
+
const u = Y(null), a = ot(i.id), [f, d] = X(null), c = n.useState("open"), l = n.useState("mounted"), p = n.useState("animated"), b = n.useState("contentElement"), v = _e(n.disclosure, "contentElement");
|
2771
2771
|
ee(() => {
|
2772
2772
|
u.current && (n == null || n.setContentElement(u.current));
|
2773
2773
|
}, [n]), ee(() => {
|
@@ -2778,58 +2778,58 @@ var rr = Z(function(t) {
|
|
2778
2778
|
}, [n]), ee(() => {
|
2779
2779
|
if (p) {
|
2780
2780
|
if (!(b != null && b.isConnected)) {
|
2781
|
-
|
2781
|
+
d(null);
|
2782
2782
|
return;
|
2783
2783
|
}
|
2784
2784
|
return ua(() => {
|
2785
|
-
|
2785
|
+
d(c ? "enter" : l ? "leave" : null);
|
2786
2786
|
});
|
2787
2787
|
}
|
2788
2788
|
}, [p, b, c, l]), ee(() => {
|
2789
|
-
if (!n || !p || !
|
2789
|
+
if (!n || !p || !f || !b) return;
|
2790
2790
|
const g = () => n == null ? void 0 : n.setState("animating", !1), m = () => Xr(g);
|
2791
|
-
if (
|
2791
|
+
if (f === "leave" && c || f === "enter" && !c) return;
|
2792
2792
|
if (typeof p == "number")
|
2793
2793
|
return Lr(p, m);
|
2794
2794
|
const {
|
2795
|
-
transitionDuration:
|
2796
|
-
animationDuration:
|
2797
|
-
transitionDelay:
|
2795
|
+
transitionDuration: S,
|
2796
|
+
animationDuration: I,
|
2797
|
+
transitionDelay: _,
|
2798
2798
|
animationDelay: A
|
2799
2799
|
} = getComputedStyle(b), {
|
2800
|
-
transitionDuration:
|
2800
|
+
transitionDuration: w = "0",
|
2801
2801
|
animationDuration: T = "0",
|
2802
|
-
transitionDelay:
|
2803
|
-
animationDelay:
|
2804
|
-
} = v ? getComputedStyle(v) : {},
|
2805
|
-
|
2802
|
+
transitionDelay: F = "0",
|
2803
|
+
animationDelay: N = "0"
|
2804
|
+
} = v ? getComputedStyle(v) : {}, C = Rr(
|
2805
|
+
_,
|
2806
2806
|
A,
|
2807
|
-
|
2808
|
-
|
2807
|
+
F,
|
2808
|
+
N
|
2809
2809
|
), L = Rr(
|
2810
|
-
y,
|
2811
|
-
C,
|
2812
2810
|
S,
|
2811
|
+
I,
|
2812
|
+
w,
|
2813
2813
|
T
|
2814
|
-
), D =
|
2814
|
+
), D = C + L;
|
2815
2815
|
if (!D) {
|
2816
|
-
|
2816
|
+
f === "enter" && n.setState("animated", !1), g();
|
2817
2817
|
return;
|
2818
2818
|
}
|
2819
|
-
const
|
2820
|
-
return Lr(
|
2821
|
-
}, [n, p, b, v, c,
|
2819
|
+
const y = 1e3 / 60, R = Math.max(D - y, 0);
|
2820
|
+
return Lr(R, m);
|
2821
|
+
}, [n, p, b, v, c, f]), i = le(
|
2822
2822
|
i,
|
2823
2823
|
(g) => /* @__PURE__ */ k(zn, { value: n, children: g }),
|
2824
2824
|
[n]
|
2825
2825
|
);
|
2826
|
-
const
|
2827
|
-
return i =
|
2826
|
+
const E = nr(l, i.hidden, o), x = i.style, P = He(() => E ? $(O({}, x), { display: "none" }) : x, [E, x]);
|
2827
|
+
return i = $(O({
|
2828
2828
|
id: a,
|
2829
2829
|
"data-open": c || void 0,
|
2830
|
-
"data-enter":
|
2831
|
-
"data-leave":
|
2832
|
-
hidden:
|
2830
|
+
"data-enter": f === "enter" || void 0,
|
2831
|
+
"data-leave": f === "leave" || void 0,
|
2832
|
+
hidden: E
|
2833
2833
|
}, i), {
|
2834
2834
|
ref: de(a ? n.setContentElement : null, u, i.ref),
|
2835
2835
|
style: P
|
@@ -2848,7 +2848,7 @@ G(function(t) {
|
|
2848
2848
|
return _e(
|
2849
2849
|
s,
|
2850
2850
|
(a) => !n || (a == null ? void 0 : a.mounted)
|
2851
|
-
) === !1 ? null : /* @__PURE__ */ k(aa,
|
2851
|
+
) === !1 ? null : /* @__PURE__ */ k(aa, O({}, o));
|
2852
2852
|
});
|
2853
2853
|
var ca = "div", Fr = ge(null), qo = Z(
|
2854
2854
|
function(t) {
|
@@ -2859,7 +2859,7 @@ var ca = "div", Fr = ge(null), qo = Z(
|
|
2859
2859
|
focusOnMove: s = !0,
|
2860
2860
|
composite: u,
|
2861
2861
|
alwaysVisible: a
|
2862
|
-
} = r,
|
2862
|
+
} = r, f = J(r, [
|
2863
2863
|
"store",
|
2864
2864
|
"resetOnEscape",
|
2865
2865
|
"hideOnEnter",
|
@@ -2867,53 +2867,53 @@ var ca = "div", Fr = ge(null), qo = Z(
|
|
2867
2867
|
"composite",
|
2868
2868
|
"alwaysVisible"
|
2869
2869
|
]);
|
2870
|
-
const
|
2871
|
-
n = n ||
|
2870
|
+
const d = Co();
|
2871
|
+
n = n || d, he(
|
2872
2872
|
n,
|
2873
2873
|
process.env.NODE_ENV !== "production" && "SelectList must receive a `store` prop or be wrapped in a SelectProvider component."
|
2874
2874
|
);
|
2875
|
-
const c = ot(
|
2875
|
+
const c = ot(f.id), l = n.useState("value"), p = Array.isArray(l), [b, v] = X(l), E = n.useState("mounted");
|
2876
2876
|
W(() => {
|
2877
|
-
|
2878
|
-
}, [
|
2879
|
-
const
|
2880
|
-
|
2881
|
-
}),
|
2882
|
-
() => [
|
2883
|
-
[
|
2884
|
-
), [T,
|
2877
|
+
E || v(l);
|
2878
|
+
}, [E, l]), o = o && !p;
|
2879
|
+
const x = f.onKeyDown, P = fe(o), g = fe(i), m = U((H) => {
|
2880
|
+
x == null || x(H), !H.defaultPrevented && (H.key === "Escape" && P(H) && (n == null || n.setValue(b)), (H.key === " " || H.key === "Enter") && me(H) && g(H) && (H.preventDefault(), n == null || n.hide()));
|
2881
|
+
}), S = et(xr), I = X(), [_, A] = S || I, w = He(
|
2882
|
+
() => [_, A],
|
2883
|
+
[_]
|
2884
|
+
), [T, F] = X(null), N = et(Fr);
|
2885
2885
|
W(() => {
|
2886
|
-
if (
|
2887
|
-
return
|
2888
|
-
}, [
|
2889
|
-
|
2890
|
-
(H) => /* @__PURE__ */ k(Oo, { value: n, children: /* @__PURE__ */ k(Fr.Provider, { value:
|
2891
|
-
[n,
|
2886
|
+
if (N)
|
2887
|
+
return N(n), () => N(null);
|
2888
|
+
}, [N, n]), f = le(
|
2889
|
+
f,
|
2890
|
+
(H) => /* @__PURE__ */ k(Oo, { value: n, children: /* @__PURE__ */ k(Fr.Provider, { value: F, children: /* @__PURE__ */ k(xr.Provider, { value: w, children: H }) }) }),
|
2891
|
+
[n, w]
|
2892
2892
|
);
|
2893
|
-
const
|
2894
|
-
u = u ?? (!
|
2893
|
+
const C = !!n.combobox;
|
2894
|
+
u = u ?? (!C && T !== n);
|
2895
2895
|
const [L, D] = ao(
|
2896
2896
|
u ? n.setListElement : null
|
2897
|
-
),
|
2898
|
-
u && (
|
2897
|
+
), y = Zi(L, "role", f.role), B = (u || (y === "listbox" || y === "menu" || y === "tree" || y === "grid")) && p || void 0, h = nr(E, f.hidden, a), M = h ? $(O({}, f.style), { display: "none" }) : f.style;
|
2898
|
+
u && (f = O({
|
2899
2899
|
role: "listbox",
|
2900
|
-
"aria-multiselectable":
|
2901
|
-
},
|
2900
|
+
"aria-multiselectable": B
|
2901
|
+
}, f));
|
2902
2902
|
const K = n.useState(
|
2903
2903
|
(H) => {
|
2904
2904
|
var ie;
|
2905
|
-
return
|
2905
|
+
return _ || ((ie = H.labelElement) == null ? void 0 : ie.id);
|
2906
2906
|
}
|
2907
2907
|
);
|
2908
|
-
return
|
2908
|
+
return f = $(O({
|
2909
2909
|
id: c,
|
2910
2910
|
"aria-labelledby": K,
|
2911
|
-
hidden:
|
2912
|
-
},
|
2913
|
-
ref: de(D,
|
2914
|
-
style:
|
2911
|
+
hidden: h
|
2912
|
+
}, f), {
|
2913
|
+
ref: de(D, f.ref),
|
2914
|
+
style: M,
|
2915
2915
|
onKeyDown: m
|
2916
|
-
}),
|
2916
|
+
}), f = Wo($(O({ store: n }, f), { composite: u })), f = tr(O({ store: n, typeahead: !C }, f)), f;
|
2917
2917
|
}
|
2918
2918
|
), la = G(function(t) {
|
2919
2919
|
const r = qo(t);
|
@@ -3109,14 +3109,14 @@ function ya({
|
|
3109
3109
|
}) {
|
3110
3110
|
const o = Y(null), i = Ms({ disclosure: e }), s = _e(e, "contentElement");
|
3111
3111
|
W(() => {
|
3112
|
-
const
|
3113
|
-
|
3112
|
+
const f = o.current, d = s;
|
3113
|
+
f && d && (f.style.zIndex = getComputedStyle(d).zIndex);
|
3114
3114
|
}, [s]), ee(() => {
|
3115
|
-
const
|
3116
|
-
if (!
|
3117
|
-
const
|
3118
|
-
if (
|
3119
|
-
return Uo(
|
3115
|
+
const f = s == null ? void 0 : s.id;
|
3116
|
+
if (!f) return;
|
3117
|
+
const d = o.current;
|
3118
|
+
if (d)
|
3119
|
+
return Uo(d, f);
|
3120
3120
|
}, [s]);
|
3121
3121
|
const u = rr({
|
3122
3122
|
ref: o,
|
@@ -3135,9 +3135,9 @@ function ya({
|
|
3135
3135
|
});
|
3136
3136
|
if (!t) return null;
|
3137
3137
|
if (Yr(t))
|
3138
|
-
return /* @__PURE__ */ k(Dn,
|
3138
|
+
return /* @__PURE__ */ k(Dn, $(O({}, u), { render: t }));
|
3139
3139
|
const a = typeof t != "boolean" ? t : "div";
|
3140
|
-
return /* @__PURE__ */ k(Dn,
|
3140
|
+
return /* @__PURE__ */ k(Dn, $(O({}, u), { render: /* @__PURE__ */ k(a, {}) }));
|
3141
3141
|
}
|
3142
3142
|
function Sa(e, ...t) {
|
3143
3143
|
if (!e) return !1;
|
@@ -3220,29 +3220,29 @@ function Ia(e, t, r) {
|
|
3220
3220
|
});
|
3221
3221
|
W(() => {
|
3222
3222
|
if (!n() || !e) return;
|
3223
|
-
const o = ne(e), i = ro(e), { documentElement: s, body: u } = o, a = s.style.getPropertyValue("--scrollbar-width"),
|
3223
|
+
const o = ne(e), i = ro(e), { documentElement: s, body: u } = o, a = s.style.getPropertyValue("--scrollbar-width"), f = a ? Number.parseInt(a) : i.innerWidth - s.clientWidth, d = () => fa(
|
3224
3224
|
s,
|
3225
3225
|
"--scrollbar-width",
|
3226
|
-
`${
|
3226
|
+
`${f}px`
|
3227
3227
|
), c = Pa(s), l = () => On(u, {
|
3228
3228
|
overflow: "hidden",
|
3229
|
-
[c]: `${
|
3229
|
+
[c]: `${f}px`
|
3230
3230
|
}), p = () => {
|
3231
|
-
var v,
|
3232
|
-
const { scrollX:
|
3231
|
+
var v, E;
|
3232
|
+
const { scrollX: x, scrollY: P, visualViewport: g } = i, m = (v = g == null ? void 0 : g.offsetLeft) != null ? v : 0, S = (E = g == null ? void 0 : g.offsetTop) != null ? E : 0, I = On(u, {
|
3233
3233
|
position: "fixed",
|
3234
3234
|
overflow: "hidden",
|
3235
|
-
top: `${-(P - Math.floor(
|
3236
|
-
left: `${-(
|
3235
|
+
top: `${-(P - Math.floor(S))}px`,
|
3236
|
+
left: `${-(x - Math.floor(m))}px`,
|
3237
3237
|
right: "0",
|
3238
|
-
[c]: `${
|
3238
|
+
[c]: `${f}px`
|
3239
3239
|
});
|
3240
3240
|
return () => {
|
3241
|
-
|
3241
|
+
I(), process.env.NODE_ENV !== "test" && i.scrollTo({ left: x, top: P, behavior: "instant" });
|
3242
3242
|
};
|
3243
3243
|
}, b = Mn() && !ji();
|
3244
3244
|
return Te(
|
3245
|
-
|
3245
|
+
d(),
|
3246
3246
|
b ? p() : l()
|
3247
3247
|
);
|
3248
3248
|
}, [n, e]);
|
@@ -3252,8 +3252,8 @@ function Ca(e) {
|
|
3252
3252
|
const t = et(Mr), [r, n] = X([]), o = xe(
|
3253
3253
|
(u) => {
|
3254
3254
|
var a;
|
3255
|
-
return n((
|
3256
|
-
n((
|
3255
|
+
return n((f) => [...f, u]), Te((a = t.add) == null ? void 0 : a.call(t, u), () => {
|
3256
|
+
n((f) => f.filter((d) => d !== u));
|
3257
3257
|
});
|
3258
3258
|
},
|
3259
3259
|
[t]
|
@@ -3312,13 +3312,13 @@ function bn({
|
|
3312
3312
|
if (!s || !o) return;
|
3313
3313
|
const { contentElement: a } = e.getState();
|
3314
3314
|
if (!a) return;
|
3315
|
-
const
|
3315
|
+
const f = () => {
|
3316
3316
|
u.current = !0;
|
3317
3317
|
};
|
3318
|
-
return a.addEventListener("focusin",
|
3319
|
-
}, [e, s, o]), W(() => s ? Ce(t, (
|
3320
|
-
const { contentElement:
|
3321
|
-
!
|
3318
|
+
return a.addEventListener("focusin", f, !0), () => a.removeEventListener("focusin", f, !0);
|
3319
|
+
}, [e, s, o]), W(() => s ? Ce(t, (f) => {
|
3320
|
+
const { contentElement: d, disclosureElement: c } = e.getState(), l = f.target;
|
3321
|
+
!d || !l || !_a(l) || se(d, l) || Da(c, l) || l.hasAttribute("data-focus-trap") || Aa(f, d) || u.current && !sr(l, d.id) || ou(l) || i(f);
|
3322
3322
|
}, n) : void 0, [s, n]);
|
3323
3323
|
}
|
3324
3324
|
function yn(e, t) {
|
@@ -3326,19 +3326,19 @@ function yn(e, t) {
|
|
3326
3326
|
}
|
3327
3327
|
function Ta(e, t, r) {
|
3328
3328
|
const n = _e(e, "open"), o = Oa(n), i = { store: e, domReady: r, capture: !0 };
|
3329
|
-
bn(
|
3329
|
+
bn($(O({}, i), {
|
3330
3330
|
type: "click",
|
3331
3331
|
listener: (s) => {
|
3332
3332
|
const { contentElement: u } = e.getState(), a = o.current;
|
3333
3333
|
a && oo(a) && sr(a, u == null ? void 0 : u.id) && yn(t, s) && e.hide();
|
3334
3334
|
}
|
3335
|
-
})), bn(
|
3335
|
+
})), bn($(O({}, i), {
|
3336
3336
|
type: "focusin",
|
3337
3337
|
listener: (s) => {
|
3338
3338
|
const { contentElement: u } = e.getState();
|
3339
3339
|
u && s.target !== ne(u) && yn(t, s) && e.hide();
|
3340
3340
|
}
|
3341
|
-
})), bn(
|
3341
|
+
})), bn($(O({}, i), {
|
3342
3342
|
type: "contextmenu",
|
3343
3343
|
listener: (s) => {
|
3344
3344
|
yn(t, s) && e.hide();
|
@@ -3382,8 +3382,8 @@ function Fa({ level: e, children: t }) {
|
|
3382
3382
|
}
|
3383
3383
|
var Na = "span", Xo = Z(
|
3384
3384
|
function(t) {
|
3385
|
-
return t =
|
3386
|
-
style:
|
3385
|
+
return t = $(O({}, t), {
|
3386
|
+
style: O({
|
3387
3387
|
border: 0,
|
3388
3388
|
clip: "rect(0 0 0 0)",
|
3389
3389
|
height: "1px",
|
@@ -3403,12 +3403,12 @@ G(function(t) {
|
|
3403
3403
|
});
|
3404
3404
|
var Ma = "span", ka = Z(
|
3405
3405
|
function(t) {
|
3406
|
-
return t =
|
3406
|
+
return t = $(O({
|
3407
3407
|
"data-focus-trap": "",
|
3408
3408
|
tabIndex: 0,
|
3409
3409
|
"aria-hidden": !0
|
3410
3410
|
}, t), {
|
3411
|
-
style:
|
3411
|
+
style: O({
|
3412
3412
|
// Prevents unintended scroll jumps.
|
3413
3413
|
position: "fixed",
|
3414
3414
|
top: 0,
|
@@ -3448,45 +3448,45 @@ var Jo = Z(function(t) {
|
|
3448
3448
|
"portalRef",
|
3449
3449
|
"portal"
|
3450
3450
|
]);
|
3451
|
-
const
|
3451
|
+
const f = Y(null), d = de(f, a.ref), c = et(kr), [l, p] = X(null), [b, v] = X(
|
3452
3452
|
null
|
3453
|
-
),
|
3453
|
+
), E = Y(null), x = Y(null), P = Y(null), g = Y(null);
|
3454
3454
|
return ee(() => {
|
3455
|
-
const m =
|
3455
|
+
const m = f.current;
|
3456
3456
|
if (!m || !u) {
|
3457
3457
|
p(null);
|
3458
3458
|
return;
|
3459
3459
|
}
|
3460
|
-
const
|
3461
|
-
if (!
|
3460
|
+
const S = Ba(m, i);
|
3461
|
+
if (!S) {
|
3462
3462
|
p(null);
|
3463
3463
|
return;
|
3464
3464
|
}
|
3465
|
-
const
|
3466
|
-
if (
|
3465
|
+
const I = S.isConnected;
|
3466
|
+
if (I || (c || $a(m)).appendChild(S), S.id || (S.id = m.id ? `portal/${m.id}` : Ka()), p(S), wn(s, S), !I)
|
3467
3467
|
return () => {
|
3468
|
-
|
3468
|
+
S.remove(), wn(s, null);
|
3469
3469
|
};
|
3470
3470
|
}, [u, i, c, s]), ee(() => {
|
3471
3471
|
if (!u || !n || !o) return;
|
3472
|
-
const
|
3473
|
-
return
|
3474
|
-
|
3472
|
+
const S = ne(o).createElement("span");
|
3473
|
+
return S.style.position = "fixed", o.insertAdjacentElement("afterend", S), v(S), () => {
|
3474
|
+
S.remove(), v(null);
|
3475
3475
|
};
|
3476
3476
|
}, [u, n, o]), W(() => {
|
3477
3477
|
if (!l || !n) return;
|
3478
3478
|
let m = 0;
|
3479
|
-
const
|
3480
|
-
if (!pt(
|
3481
|
-
const
|
3482
|
-
if (cancelAnimationFrame(m),
|
3479
|
+
const S = (I) => {
|
3480
|
+
if (!pt(I)) return;
|
3481
|
+
const _ = I.type === "focusin";
|
3482
|
+
if (cancelAnimationFrame(m), _)
|
3483
3483
|
return eu(l);
|
3484
3484
|
m = requestAnimationFrame(() => {
|
3485
3485
|
Zs(l, !0);
|
3486
3486
|
});
|
3487
3487
|
};
|
3488
|
-
return l.addEventListener("focusin",
|
3489
|
-
cancelAnimationFrame(m), l.removeEventListener("focusin",
|
3488
|
+
return l.addEventListener("focusin", S, !0), l.addEventListener("focusout", S, !0), () => {
|
3489
|
+
cancelAnimationFrame(m), l.removeEventListener("focusin", S, !0), l.removeEventListener("focusout", S, !0);
|
3490
3490
|
};
|
3491
3491
|
}, [l, n]), a = le(
|
3492
3492
|
a,
|
@@ -3499,7 +3499,7 @@ var Jo = Z(function(t) {
|
|
3499
3499
|
return /* @__PURE__ */ k(
|
3500
3500
|
"span",
|
3501
3501
|
{
|
3502
|
-
ref:
|
3502
|
+
ref: d,
|
3503
3503
|
id: a.id,
|
3504
3504
|
style: { position: "fixed" },
|
3505
3505
|
hidden: !0
|
@@ -3509,11 +3509,11 @@ var Jo = Z(function(t) {
|
|
3509
3509
|
n && l && /* @__PURE__ */ k(
|
3510
3510
|
$t,
|
3511
3511
|
{
|
3512
|
-
ref:
|
3512
|
+
ref: x,
|
3513
3513
|
"data-focus-trap": a.id,
|
3514
3514
|
className: "__focus-trap-inner-before",
|
3515
|
-
onFocus: (
|
3516
|
-
pt(
|
3515
|
+
onFocus: (I) => {
|
3516
|
+
pt(I, l) ? je(mn()) : je(E.current);
|
3517
3517
|
}
|
3518
3518
|
}
|
3519
3519
|
),
|
@@ -3524,21 +3524,21 @@ var Jo = Z(function(t) {
|
|
3524
3524
|
ref: P,
|
3525
3525
|
"data-focus-trap": a.id,
|
3526
3526
|
className: "__focus-trap-inner-after",
|
3527
|
-
onFocus: (
|
3528
|
-
pt(
|
3527
|
+
onFocus: (I) => {
|
3528
|
+
pt(I, l) ? je(Pr()) : je(g.current);
|
3529
3529
|
}
|
3530
3530
|
}
|
3531
3531
|
)
|
3532
3532
|
] }), l && (m = fr(m, l));
|
3533
|
-
let
|
3533
|
+
let S = /* @__PURE__ */ Fe(mt, { children: [
|
3534
3534
|
n && l && /* @__PURE__ */ k(
|
3535
3535
|
$t,
|
3536
3536
|
{
|
3537
|
-
ref:
|
3537
|
+
ref: E,
|
3538
3538
|
"data-focus-trap": a.id,
|
3539
3539
|
className: "__focus-trap-outer-before",
|
3540
|
-
onFocus: (
|
3541
|
-
!(
|
3540
|
+
onFocus: (I) => {
|
3541
|
+
!(I.relatedTarget === g.current) && pt(I, l) ? je(x.current) : je(Pr());
|
3542
3542
|
}
|
3543
3543
|
}
|
3544
3544
|
),
|
@@ -3551,35 +3551,35 @@ var Jo = Z(function(t) {
|
|
3551
3551
|
ref: g,
|
3552
3552
|
"data-focus-trap": a.id,
|
3553
3553
|
className: "__focus-trap-outer-after",
|
3554
|
-
onFocus: (
|
3555
|
-
if (pt(
|
3554
|
+
onFocus: (I) => {
|
3555
|
+
if (pt(I, l))
|
3556
3556
|
je(P.current);
|
3557
3557
|
else {
|
3558
|
-
const
|
3559
|
-
if (
|
3558
|
+
const _ = mn();
|
3559
|
+
if (_ === x.current) {
|
3560
3560
|
requestAnimationFrame(() => {
|
3561
3561
|
var A;
|
3562
3562
|
return (A = mn()) == null ? void 0 : A.focus();
|
3563
3563
|
});
|
3564
3564
|
return;
|
3565
3565
|
}
|
3566
|
-
je(
|
3566
|
+
je(_);
|
3567
3567
|
}
|
3568
3568
|
}
|
3569
3569
|
}
|
3570
3570
|
)
|
3571
3571
|
] });
|
3572
|
-
return b && n && (
|
3573
|
-
|
3572
|
+
return b && n && (S = fr(
|
3573
|
+
S,
|
3574
3574
|
b
|
3575
3575
|
)), /* @__PURE__ */ Fe(mt, { children: [
|
3576
|
-
|
3576
|
+
S,
|
3577
3577
|
m
|
3578
3578
|
] });
|
3579
3579
|
},
|
3580
3580
|
[l, c, u, a.id, n, b]
|
3581
|
-
), a =
|
3582
|
-
ref:
|
3581
|
+
), a = $(O({}, a), {
|
3582
|
+
ref: d
|
3583
3583
|
}), a;
|
3584
3584
|
});
|
3585
3585
|
G(function(t) {
|
@@ -3604,15 +3604,15 @@ var Qo = Z(function(t) {
|
|
3604
3604
|
focusable: s = !0,
|
3605
3605
|
modal: u = !0,
|
3606
3606
|
portal: a = !!u,
|
3607
|
-
backdrop:
|
3608
|
-
hideOnEscape:
|
3607
|
+
backdrop: f = !!u,
|
3608
|
+
hideOnEscape: d = !0,
|
3609
3609
|
hideOnInteractOutside: c = !0,
|
3610
3610
|
getPersistentElements: l,
|
3611
3611
|
preventBodyScroll: p = !!u,
|
3612
3612
|
autoFocusOnShow: b = !0,
|
3613
3613
|
autoFocusOnHide: v = !0,
|
3614
|
-
initialFocus:
|
3615
|
-
finalFocus:
|
3614
|
+
initialFocus: E,
|
3615
|
+
finalFocus: x,
|
3616
3616
|
unmountOnHide: P,
|
3617
3617
|
unstable_treeSnapshotKey: g
|
3618
3618
|
} = r, m = J(r, [
|
@@ -3634,96 +3634,96 @@ var Qo = Z(function(t) {
|
|
3634
3634
|
"unmountOnHide",
|
3635
3635
|
"unstable_treeSnapshotKey"
|
3636
3636
|
]);
|
3637
|
-
const
|
3638
|
-
store: n ||
|
3637
|
+
const S = Qt(), I = Y(null), _ = ks({
|
3638
|
+
store: n || S,
|
3639
3639
|
open: o,
|
3640
|
-
setOpen(
|
3641
|
-
if (
|
3642
|
-
const q =
|
3640
|
+
setOpen(V) {
|
3641
|
+
if (V) return;
|
3642
|
+
const q = I.current;
|
3643
3643
|
if (!q) return;
|
3644
3644
|
const ae = new Event("close", { bubbles: !1, cancelable: !0 });
|
3645
|
-
i && q.addEventListener("close", i, { once: !0 }), q.dispatchEvent(ae), ae.defaultPrevented &&
|
3645
|
+
i && q.addEventListener("close", i, { once: !0 }), q.dispatchEvent(ae), ae.defaultPrevented && _.setOpen(!0);
|
3646
3646
|
}
|
3647
|
-
}), { portalRef: A, domReady:
|
3648
|
-
|
3649
|
-
(
|
3650
|
-
),
|
3651
|
-
Ia(D,
|
3652
|
-
const { wrapElement:
|
3653
|
-
m = le(m,
|
3654
|
-
if (!
|
3655
|
-
const
|
3656
|
-
q && q.tagName !== "BODY" && (
|
3657
|
-
}, [
|
3647
|
+
}), { portalRef: A, domReady: w } = lo(a, m.portalRef), T = m.preserveTabOrder, F = _e(
|
3648
|
+
_,
|
3649
|
+
(V) => T && !u && V.mounted
|
3650
|
+
), N = ot(m.id), C = _e(_, "open"), L = _e(_, "mounted"), D = _e(_, "contentElement"), y = nr(L, m.hidden, m.alwaysVisible);
|
3651
|
+
Ia(D, N, p && !y), Ta(_, c, w);
|
3652
|
+
const { wrapElement: R, nestedDialogs: B } = Ca(_);
|
3653
|
+
m = le(m, R, [R]), ee(() => {
|
3654
|
+
if (!C) return;
|
3655
|
+
const V = I.current, q = We(V, !0);
|
3656
|
+
q && q.tagName !== "BODY" && (V && se(V, q) || _.setDisclosureElement(q));
|
3657
|
+
}, [_, C]), Vr && W(() => {
|
3658
3658
|
if (!L) return;
|
3659
|
-
const { disclosureElement:
|
3660
|
-
if (
|
3659
|
+
const { disclosureElement: V } = _.getState();
|
3660
|
+
if (!V || !Xe(V)) return;
|
3661
3661
|
const q = () => {
|
3662
3662
|
let ae = !1;
|
3663
3663
|
const j = () => {
|
3664
3664
|
ae = !0;
|
3665
3665
|
}, Se = { capture: !0, once: !0 };
|
3666
|
-
|
3667
|
-
|
3666
|
+
V.addEventListener("focusin", j, Se), vt(V, "mouseup", () => {
|
3667
|
+
V.removeEventListener("focusin", j, !0), !ae && Ao(V);
|
3668
3668
|
});
|
3669
3669
|
};
|
3670
|
-
return
|
3671
|
-
|
3670
|
+
return V.addEventListener("mousedown", q), () => {
|
3671
|
+
V.removeEventListener("mousedown", q);
|
3672
3672
|
};
|
3673
|
-
}, [
|
3674
|
-
if (!L || !
|
3675
|
-
const
|
3676
|
-
if (
|
3677
|
-
const q = ro(
|
3673
|
+
}, [_, L]), W(() => {
|
3674
|
+
if (!L || !w) return;
|
3675
|
+
const V = I.current;
|
3676
|
+
if (!V) return;
|
3677
|
+
const q = ro(V), ae = q.visualViewport || q, j = () => {
|
3678
3678
|
var Se, Re;
|
3679
3679
|
const Et = (Re = (Se = q.visualViewport) == null ? void 0 : Se.height) != null ? Re : q.innerHeight;
|
3680
|
-
|
3680
|
+
V.style.setProperty("--dialog-viewport-height", `${Et}px`);
|
3681
3681
|
};
|
3682
3682
|
return j(), ae.addEventListener("resize", j), () => {
|
3683
3683
|
ae.removeEventListener("resize", j);
|
3684
3684
|
};
|
3685
|
-
}, [L,
|
3686
|
-
if (!u || !L || !
|
3687
|
-
const
|
3688
|
-
if (!(
|
3689
|
-
return La(
|
3690
|
-
}, [
|
3691
|
-
if (!jo() ||
|
3692
|
-
const
|
3693
|
-
if (
|
3694
|
-
return Go(
|
3695
|
-
}, [
|
3696
|
-
const
|
3685
|
+
}, [L, w]), W(() => {
|
3686
|
+
if (!u || !L || !w) return;
|
3687
|
+
const V = I.current;
|
3688
|
+
if (!(!V || V.querySelector("[data-dialog-dismiss]")))
|
3689
|
+
return La(V, _.hide);
|
3690
|
+
}, [_, u, L, w]), ee(() => {
|
3691
|
+
if (!jo() || C || !L || !w) return;
|
3692
|
+
const V = I.current;
|
3693
|
+
if (V)
|
3694
|
+
return Go(V);
|
3695
|
+
}, [C, L, w]);
|
3696
|
+
const h = C && w;
|
3697
3697
|
ee(() => {
|
3698
|
-
if (!
|
3699
|
-
const
|
3700
|
-
return va(
|
3701
|
-
}, [
|
3702
|
-
const
|
3698
|
+
if (!N || !h) return;
|
3699
|
+
const V = I.current;
|
3700
|
+
return va(N, [V]);
|
3701
|
+
}, [N, h, g]);
|
3702
|
+
const M = U(l);
|
3703
3703
|
ee(() => {
|
3704
|
-
if (!
|
3705
|
-
const { disclosureElement:
|
3704
|
+
if (!N || !h) return;
|
3705
|
+
const { disclosureElement: V } = _.getState(), q = I.current, ae = M() || [], j = [
|
3706
3706
|
q,
|
3707
3707
|
...ae,
|
3708
|
-
...
|
3708
|
+
...B.map((Se) => Se.getState().contentElement)
|
3709
3709
|
];
|
3710
3710
|
return u ? Te(
|
3711
|
-
Nr(
|
3712
|
-
Ea(
|
3713
|
-
) : Nr(
|
3711
|
+
Nr(N, j),
|
3712
|
+
Ea(N, j)
|
3713
|
+
) : Nr(N, [V, ...j]);
|
3714
3714
|
}, [
|
3715
|
+
N,
|
3716
|
+
_,
|
3717
|
+
h,
|
3715
3718
|
M,
|
3716
|
-
|
3717
|
-
E,
|
3718
|
-
V,
|
3719
|
-
R,
|
3719
|
+
B,
|
3720
3720
|
u,
|
3721
3721
|
g
|
3722
3722
|
]);
|
3723
3723
|
const K = !!b, H = fe(b), [ie, oe] = X(!1);
|
3724
3724
|
W(() => {
|
3725
|
-
if (!
|
3726
|
-
const
|
3725
|
+
if (!C || !K || !w || !(D != null && D.isConnected)) return;
|
3726
|
+
const V = $r(E, !0) || // If no initial focus is specified, we try to focus the first element
|
3727
3727
|
// with the autofocus attribute. If it's an Ariakit component, the
|
3728
3728
|
// Focusable component will consume the autoFocus prop and add the
|
3729
3729
|
// data-autofocus attribute to the element instead.
|
@@ -3733,31 +3733,31 @@ var Qo = Z(function(t) {
|
|
3733
3733
|
// dialogs with preserveTabOrder set to true will not receive focus
|
3734
3734
|
// properly because the elements aren't tabbable until the dialog receives
|
3735
3735
|
// focus.
|
3736
|
-
Gs(D, !0, a &&
|
3737
|
-
D, q = De(
|
3738
|
-
H(q ?
|
3739
|
-
|
3736
|
+
Gs(D, !0, a && F) || // Finally, we fallback to the dialog element itself.
|
3737
|
+
D, q = De(V);
|
3738
|
+
H(q ? V : null) && (oe(!0), queueMicrotask(() => {
|
3739
|
+
V.focus(), Vr && V.scrollIntoView({ block: "nearest", inline: "nearest" });
|
3740
3740
|
}));
|
3741
3741
|
}, [
|
3742
|
-
|
3742
|
+
C,
|
3743
3743
|
K,
|
3744
|
-
|
3744
|
+
w,
|
3745
3745
|
D,
|
3746
|
-
|
3746
|
+
E,
|
3747
3747
|
a,
|
3748
|
-
|
3748
|
+
F,
|
3749
3749
|
H
|
3750
3750
|
]);
|
3751
3751
|
const re = !!v, be = fe(v), [ze, ye] = X(!1);
|
3752
3752
|
W(() => {
|
3753
|
-
if (
|
3753
|
+
if (C)
|
3754
3754
|
return ye(!0), () => ye(!1);
|
3755
|
-
}, [
|
3755
|
+
}, [C]);
|
3756
3756
|
const Ie = xe(
|
3757
|
-
(
|
3758
|
-
const { disclosureElement: ae } =
|
3759
|
-
if (Wa(
|
3760
|
-
let j = $r(
|
3757
|
+
(V, q = !0) => {
|
3758
|
+
const { disclosureElement: ae } = _.getState();
|
3759
|
+
if (Wa(V)) return;
|
3760
|
+
let j = $r(x) || ae;
|
3761
3761
|
if (j != null && j.id) {
|
3762
3762
|
const Re = ne(j), Et = `[aria-activedescendant="${j.id}"]`, Ft = Re.querySelector(Et);
|
3763
3763
|
Ft && (j = Ft);
|
@@ -3771,76 +3771,76 @@ var Qo = Z(function(t) {
|
|
3771
3771
|
}
|
3772
3772
|
const Se = j && De(j);
|
3773
3773
|
if (!Se && q) {
|
3774
|
-
requestAnimationFrame(() => Ie(
|
3774
|
+
requestAnimationFrame(() => Ie(V, !1));
|
3775
3775
|
return;
|
3776
3776
|
}
|
3777
3777
|
be(Se ? j : null) && Se && (j == null || j.focus());
|
3778
3778
|
},
|
3779
|
-
[
|
3779
|
+
[_, x, be]
|
3780
3780
|
), ue = Y(!1);
|
3781
3781
|
ee(() => {
|
3782
|
-
if (
|
3783
|
-
const
|
3784
|
-
ue.current = !0, Ie(
|
3785
|
-
}, [
|
3782
|
+
if (C || !ze || !re) return;
|
3783
|
+
const V = I.current;
|
3784
|
+
ue.current = !0, Ie(V);
|
3785
|
+
}, [C, ze, w, re, Ie]), W(() => {
|
3786
3786
|
if (!ze || !re) return;
|
3787
|
-
const
|
3787
|
+
const V = I.current;
|
3788
3788
|
return () => {
|
3789
3789
|
if (ue.current) {
|
3790
3790
|
ue.current = !1;
|
3791
3791
|
return;
|
3792
3792
|
}
|
3793
|
-
Ie(
|
3793
|
+
Ie(V);
|
3794
3794
|
};
|
3795
3795
|
}, [ze, re, Ie]);
|
3796
|
-
const ut = fe(
|
3797
|
-
W(() => !
|
3796
|
+
const ut = fe(d);
|
3797
|
+
W(() => !w || !L ? void 0 : Ce("keydown", (q) => {
|
3798
3798
|
if (q.key !== "Escape" || q.defaultPrevented) return;
|
3799
|
-
const ae =
|
3799
|
+
const ae = I.current;
|
3800
3800
|
if (!ae || sr(ae)) return;
|
3801
3801
|
const j = q.target;
|
3802
3802
|
if (!j) return;
|
3803
|
-
const { disclosureElement: Se } =
|
3804
|
-
!!(j.tagName === "BODY" || se(ae, j) || !Se || se(Se, j)) && ut(q) &&
|
3805
|
-
}, !0), [
|
3803
|
+
const { disclosureElement: Se } = _.getState();
|
3804
|
+
!!(j.tagName === "BODY" || se(ae, j) || !Se || se(Se, j)) && ut(q) && _.hide();
|
3805
|
+
}, !0), [_, w, L, ut]), m = le(
|
3806
3806
|
m,
|
3807
|
-
(
|
3807
|
+
(V) => /* @__PURE__ */ k(Fa, { level: u ? 1 : void 0, children: V }),
|
3808
3808
|
[u]
|
3809
3809
|
);
|
3810
3810
|
const at = m.hidden, Me = m.alwaysVisible;
|
3811
3811
|
m = le(
|
3812
3812
|
m,
|
3813
|
-
(
|
3813
|
+
(V) => f ? /* @__PURE__ */ Fe(mt, { children: [
|
3814
3814
|
/* @__PURE__ */ k(
|
3815
3815
|
ya,
|
3816
3816
|
{
|
3817
|
-
store:
|
3818
|
-
backdrop:
|
3817
|
+
store: _,
|
3818
|
+
backdrop: f,
|
3819
3819
|
hidden: at,
|
3820
3820
|
alwaysVisible: Me
|
3821
3821
|
}
|
3822
3822
|
),
|
3823
|
-
|
3824
|
-
] }) :
|
3825
|
-
[
|
3823
|
+
V
|
3824
|
+
] }) : V,
|
3825
|
+
[_, f, at, Me]
|
3826
3826
|
);
|
3827
3827
|
const [Ue, ct] = X(), [lt, ft] = X();
|
3828
3828
|
return m = le(
|
3829
3829
|
m,
|
3830
|
-
(
|
3831
|
-
[
|
3832
|
-
), m =
|
3833
|
-
id:
|
3830
|
+
(V) => /* @__PURE__ */ k(zn, { value: _, children: /* @__PURE__ */ k(ps.Provider, { value: ct, children: /* @__PURE__ */ k(ms.Provider, { value: ft, children: V }) }) }),
|
3831
|
+
[_]
|
3832
|
+
), m = $(O({
|
3833
|
+
id: N,
|
3834
3834
|
"data-dialog": "",
|
3835
3835
|
role: "dialog",
|
3836
3836
|
tabIndex: s ? -1 : void 0,
|
3837
3837
|
"aria-labelledby": Ue,
|
3838
3838
|
"aria-describedby": lt
|
3839
3839
|
}, m), {
|
3840
|
-
ref: de(
|
3841
|
-
}), m = Yo(
|
3840
|
+
ref: de(I, m.ref)
|
3841
|
+
}), m = Yo($(O({}, m), {
|
3842
3842
|
autoFocusOnShow: ie
|
3843
|
-
})), m = rr(
|
3843
|
+
})), m = rr(O({ store: _ }, m)), m = on($(O({}, m), { focusable: s })), m = Jo($(O({ portal: a }, m), { portalRef: A, preserveTabOrder: F })), m;
|
3844
3844
|
});
|
3845
3845
|
function ur(e, t = Qt) {
|
3846
3846
|
return G(function(n) {
|
@@ -3848,7 +3848,7 @@ function ur(e, t = Qt) {
|
|
3848
3848
|
return _e(
|
3849
3849
|
i,
|
3850
3850
|
(u) => !n.unmountOnHide || (u == null ? void 0 : u.mounted) || !!n.open
|
3851
|
-
) ? /* @__PURE__ */ k(e,
|
3851
|
+
) ? /* @__PURE__ */ k(e, O({}, n)) : null;
|
3852
3852
|
});
|
3853
3853
|
}
|
3854
3854
|
ur(
|
@@ -3872,7 +3872,7 @@ function st(e) {
|
|
3872
3872
|
}
|
3873
3873
|
function Br(e, t, r) {
|
3874
3874
|
let { reference: n, floating: o } = e;
|
3875
|
-
const i = n.x + n.width / 2 - o.width / 2, s = n.y + n.height / 2 - o.height / 2, u = st(t), a = ar(u),
|
3875
|
+
const i = n.x + n.width / 2 - o.width / 2, s = n.y + n.height / 2 - o.height / 2, u = st(t), a = ar(u), f = n[a] / 2 - o[a] / 2, d = u === "x";
|
3876
3876
|
let c;
|
3877
3877
|
switch (Be(t)) {
|
3878
3878
|
case "top":
|
@@ -3892,21 +3892,21 @@ function Br(e, t, r) {
|
|
3892
3892
|
}
|
3893
3893
|
switch (wt(t)) {
|
3894
3894
|
case "start":
|
3895
|
-
c[u] -=
|
3895
|
+
c[u] -= f * (r && d ? -1 : 1);
|
3896
3896
|
break;
|
3897
3897
|
case "end":
|
3898
|
-
c[u] +=
|
3898
|
+
c[u] += f * (r && d ? -1 : 1);
|
3899
3899
|
}
|
3900
3900
|
return c;
|
3901
3901
|
}
|
3902
3902
|
const qa = async (e, t, r) => {
|
3903
3903
|
const { placement: n = "bottom", strategy: o = "absolute", middleware: i = [], platform: s } = r, u = i.filter(Boolean), a = await (s.isRTL == null ? void 0 : s.isRTL(t));
|
3904
|
-
let
|
3904
|
+
let f = await s.getElementRects({ reference: e, floating: t, strategy: o }), { x: d, y: c } = Br(f, n, a), l = n, p = {}, b = 0;
|
3905
3905
|
for (let v = 0; v < u.length; v++) {
|
3906
|
-
const { name:
|
3907
|
-
|
3906
|
+
const { name: E, fn: x } = u[v], { x: P, y: g, data: m, reset: S } = await x({ x: d, y: c, initialPlacement: n, placement: l, strategy: o, middlewareData: p, rects: f, platform: s, elements: { reference: e, floating: t } });
|
3907
|
+
d = P ?? d, c = g ?? c, p = { ...p, [E]: { ...p[E], ...m } }, S && b <= 50 && (b++, typeof S == "object" && (S.placement && (l = S.placement), S.rects && (f = S.rects === !0 ? await s.getElementRects({ reference: e, floating: t, strategy: o }) : S.rects), { x: d, y: c } = Br(f, l, a)), v = -1);
|
3908
3908
|
}
|
3909
|
-
return { x:
|
3909
|
+
return { x: d, y: c, placement: l, strategy: o, middlewareData: p };
|
3910
3910
|
};
|
3911
3911
|
function Zo(e) {
|
3912
3912
|
return typeof e != "number" ? function(t) {
|
@@ -3919,21 +3919,21 @@ function jt(e) {
|
|
3919
3919
|
async function cr(e, t) {
|
3920
3920
|
var r;
|
3921
3921
|
t === void 0 && (t = {});
|
3922
|
-
const { x: n, y: o, platform: i, rects: s, elements: u, strategy: a } = e, { boundary:
|
3923
|
-
return { top: (
|
3922
|
+
const { x: n, y: o, platform: i, rects: s, elements: u, strategy: a } = e, { boundary: f = "clippingAncestors", rootBoundary: d = "viewport", elementContext: c = "floating", altBoundary: l = !1, padding: p = 0 } = t, b = Zo(p), v = u[l ? c === "floating" ? "reference" : "floating" : c], E = jt(await i.getClippingRect({ element: (r = await (i.isElement == null ? void 0 : i.isElement(v))) == null || r ? v : v.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(u.floating)), boundary: f, rootBoundary: d, strategy: a })), x = c === "floating" ? { ...s.floating, x: n, y: o } : s.reference, P = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u.floating)), g = await (i.isElement == null ? void 0 : i.isElement(P)) && await (i.getScale == null ? void 0 : i.getScale(P)) || { x: 1, y: 1 }, m = jt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({ rect: x, offsetParent: P, strategy: a }) : x);
|
3923
|
+
return { top: (E.top - m.top + b.top) / g.y, bottom: (m.bottom - E.bottom + b.bottom) / g.y, left: (E.left - m.left + b.left) / g.x, right: (m.right - E.right + b.right) / g.x };
|
3924
3924
|
}
|
3925
3925
|
const An = Math.min, Ze = Math.max;
|
3926
3926
|
function Tn(e, t, r) {
|
3927
3927
|
return Ze(e, An(t, r));
|
3928
3928
|
}
|
3929
3929
|
const za = (e) => ({ name: "arrow", options: e, async fn(t) {
|
3930
|
-
const { element: r, padding: n = 0 } = e, { x: o, y: i, placement: s, rects: u, platform: a, elements:
|
3930
|
+
const { element: r, padding: n = 0 } = e, { x: o, y: i, placement: s, rects: u, platform: a, elements: f } = t;
|
3931
3931
|
if (r == null) return {};
|
3932
|
-
const
|
3933
|
-
let
|
3934
|
-
|
3935
|
-
const
|
3936
|
-
return { [l]: c[l] - (
|
3932
|
+
const d = Zo(n), c = { x: o, y: i }, l = st(s), p = ar(l), b = await a.getDimensions(r), v = l === "y", E = v ? "top" : "left", x = v ? "bottom" : "right", P = v ? "clientHeight" : "clientWidth", g = u.reference[p] + u.reference[l] - c[l] - u.floating[p], m = c[l] - u.reference[l], S = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(r));
|
3933
|
+
let I = S ? S[P] : 0;
|
3934
|
+
I && await (a.isElement == null ? void 0 : a.isElement(S)) || (I = f.floating[P] || u.floating[p]);
|
3935
|
+
const _ = g / 2 - m / 2, A = d[E], w = I - b[p] - d[x], T = I / 2 - b[p] / 2 + _, F = Tn(A, T, w), N = wt(s) != null && T != F && u.reference[p] / 2 - (T < A ? d[E] : d[x]) - b[p] / 2 < 0;
|
3936
|
+
return { [l]: c[l] - (N ? T < A ? A - T : w - T : 0), data: { [l]: F, centerOffset: T - F } };
|
3937
3937
|
} }), Ua = ["top", "right", "bottom", "left"];
|
3938
3938
|
Ua.reduce((e, t) => e.concat(t, t + "-start", t + "-end"), []);
|
3939
3939
|
const ja = { left: "right", right: "left", bottom: "top", top: "bottom" };
|
@@ -3953,58 +3953,58 @@ function Sn(e) {
|
|
3953
3953
|
const Xa = function(e) {
|
3954
3954
|
return e === void 0 && (e = {}), { name: "flip", options: e, async fn(t) {
|
3955
3955
|
var r;
|
3956
|
-
const { placement: n, middlewareData: o, rects: i, initialPlacement: s, platform: u, elements: a } = t, { mainAxis:
|
3957
|
-
const
|
3958
|
-
return [Sn(
|
3956
|
+
const { placement: n, middlewareData: o, rects: i, initialPlacement: s, platform: u, elements: a } = t, { mainAxis: f = !0, crossAxis: d = !0, fallbackPlacements: c, fallbackStrategy: l = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: b = !0, ...v } = e, E = Be(n), x = Be(s) === s, P = await (u.isRTL == null ? void 0 : u.isRTL(a.floating)), g = c || (x || !b ? [Gt(s)] : function(F) {
|
3957
|
+
const N = Gt(F);
|
3958
|
+
return [Sn(F), N, Sn(N)];
|
3959
3959
|
}(s));
|
3960
|
-
c || p === "none" || g.push(...function(
|
3961
|
-
const D = wt(
|
3962
|
-
let
|
3963
|
-
const
|
3964
|
-
switch (
|
3960
|
+
c || p === "none" || g.push(...function(F, N, C, L) {
|
3961
|
+
const D = wt(F);
|
3962
|
+
let y = function(R, B, h) {
|
3963
|
+
const M = ["left", "right"], K = ["right", "left"], H = ["top", "bottom"], ie = ["bottom", "top"];
|
3964
|
+
switch (R) {
|
3965
3965
|
case "top":
|
3966
3966
|
case "bottom":
|
3967
|
-
return
|
3967
|
+
return h ? B ? K : M : B ? M : K;
|
3968
3968
|
case "left":
|
3969
3969
|
case "right":
|
3970
|
-
return
|
3970
|
+
return B ? H : ie;
|
3971
3971
|
default:
|
3972
3972
|
return [];
|
3973
3973
|
}
|
3974
|
-
}(Be(
|
3975
|
-
return D && (
|
3974
|
+
}(Be(F), C === "start", L);
|
3975
|
+
return D && (y = y.map((R) => R + "-" + D), N && (y = y.concat(y.map(Sn)))), y;
|
3976
3976
|
}(s, b, p, P));
|
3977
|
-
const m = [s, ...g],
|
3978
|
-
let
|
3979
|
-
if (
|
3980
|
-
const { main:
|
3981
|
-
|
3977
|
+
const m = [s, ...g], S = await cr(t, v), I = [];
|
3978
|
+
let _ = ((r = o.flip) == null ? void 0 : r.overflows) || [];
|
3979
|
+
if (f && I.push(S[E]), d) {
|
3980
|
+
const { main: F, cross: N } = Ga(n, i, P);
|
3981
|
+
I.push(S[F], S[N]);
|
3982
3982
|
}
|
3983
|
-
if (
|
3984
|
-
var A,
|
3985
|
-
const
|
3986
|
-
if (
|
3987
|
-
let
|
3988
|
-
if (!
|
3983
|
+
if (_ = [..._, { placement: n, overflows: I }], !I.every((F) => F <= 0)) {
|
3984
|
+
var A, w;
|
3985
|
+
const F = (((A = o.flip) == null ? void 0 : A.index) || 0) + 1, N = m[F];
|
3986
|
+
if (N) return { data: { index: F, overflows: _ }, reset: { placement: N } };
|
3987
|
+
let C = (w = _.filter((L) => L.overflows[0] <= 0).sort((L, D) => L.overflows[1] - D.overflows[1])[0]) == null ? void 0 : w.placement;
|
3988
|
+
if (!C) switch (l) {
|
3989
3989
|
case "bestFit": {
|
3990
3990
|
var T;
|
3991
|
-
const L = (T =
|
3992
|
-
L && (
|
3991
|
+
const L = (T = _.map((D) => [D.placement, D.overflows.filter((y) => y > 0).reduce((y, R) => y + R, 0)]).sort((D, y) => D[1] - y[1])[0]) == null ? void 0 : T[0];
|
3992
|
+
L && (C = L);
|
3993
3993
|
break;
|
3994
3994
|
}
|
3995
3995
|
case "initialPlacement":
|
3996
|
-
|
3996
|
+
C = s;
|
3997
3997
|
}
|
3998
|
-
if (n !==
|
3998
|
+
if (n !== C) return { reset: { placement: C } };
|
3999
3999
|
}
|
4000
4000
|
return {};
|
4001
4001
|
} };
|
4002
4002
|
}, Ja = function(e) {
|
4003
4003
|
return e === void 0 && (e = 0), { name: "offset", options: e, async fn(t) {
|
4004
4004
|
const { x: r, y: n } = t, o = await async function(i, s) {
|
4005
|
-
const { placement: u, platform: a, elements:
|
4006
|
-
let { mainAxis:
|
4007
|
-
return l && typeof g == "number" && (P = l === "end" ? -1 * g : g), p ? { x: P * v, y:
|
4005
|
+
const { placement: u, platform: a, elements: f } = i, d = await (a.isRTL == null ? void 0 : a.isRTL(f.floating)), c = Be(u), l = wt(u), p = st(u) === "x", b = ["left", "top"].includes(c) ? -1 : 1, v = d && p ? -1 : 1, E = typeof s == "function" ? s(i) : s;
|
4006
|
+
let { mainAxis: x, crossAxis: P, alignmentAxis: g } = typeof E == "number" ? { mainAxis: E, crossAxis: 0, alignmentAxis: null } : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...E };
|
4007
|
+
return l && typeof g == "number" && (P = l === "end" ? -1 * g : g), p ? { x: P * v, y: x * b } : { x: x * b, y: P * v };
|
4008
4008
|
}(t, e);
|
4009
4009
|
return { x: r + o.x, y: n + o.y, data: o };
|
4010
4010
|
} };
|
@@ -4014,60 +4014,60 @@ function ei(e) {
|
|
4014
4014
|
}
|
4015
4015
|
const Qa = function(e) {
|
4016
4016
|
return e === void 0 && (e = {}), { name: "shift", options: e, async fn(t) {
|
4017
|
-
const { x: r, y: n, placement: o } = t, { mainAxis: i = !0, crossAxis: s = !1, limiter: u = { fn: (
|
4018
|
-
let { x
|
4019
|
-
return { x
|
4020
|
-
} }, ...a } = e,
|
4021
|
-
let p =
|
4017
|
+
const { x: r, y: n, placement: o } = t, { mainAxis: i = !0, crossAxis: s = !1, limiter: u = { fn: (E) => {
|
4018
|
+
let { x, y: P } = E;
|
4019
|
+
return { x, y: P };
|
4020
|
+
} }, ...a } = e, f = { x: r, y: n }, d = await cr(t, a), c = st(Be(o)), l = ei(c);
|
4021
|
+
let p = f[c], b = f[l];
|
4022
4022
|
if (i) {
|
4023
|
-
const
|
4024
|
-
p = Tn(p +
|
4023
|
+
const E = c === "y" ? "bottom" : "right";
|
4024
|
+
p = Tn(p + d[c === "y" ? "top" : "left"], p, p - d[E]);
|
4025
4025
|
}
|
4026
4026
|
if (s) {
|
4027
|
-
const
|
4028
|
-
b = Tn(b +
|
4027
|
+
const E = l === "y" ? "bottom" : "right";
|
4028
|
+
b = Tn(b + d[l === "y" ? "top" : "left"], b, b - d[E]);
|
4029
4029
|
}
|
4030
4030
|
const v = u.fn({ ...t, [c]: p, [l]: b });
|
4031
4031
|
return { ...v, data: { x: v.x - r, y: v.y - n } };
|
4032
4032
|
} };
|
4033
4033
|
}, Za = function(e) {
|
4034
4034
|
return e === void 0 && (e = {}), { options: e, fn(t) {
|
4035
|
-
const { x: r, y: n, placement: o, rects: i, middlewareData: s } = t, { offset: u = 0, mainAxis: a = !0, crossAxis:
|
4036
|
-
let p =
|
4037
|
-
const v = typeof u == "function" ? u(t) : u,
|
4035
|
+
const { x: r, y: n, placement: o, rects: i, middlewareData: s } = t, { offset: u = 0, mainAxis: a = !0, crossAxis: f = !0 } = e, d = { x: r, y: n }, c = st(o), l = ei(c);
|
4036
|
+
let p = d[c], b = d[l];
|
4037
|
+
const v = typeof u == "function" ? u(t) : u, E = typeof v == "number" ? { mainAxis: v, crossAxis: 0 } : { mainAxis: 0, crossAxis: 0, ...v };
|
4038
4038
|
if (a) {
|
4039
|
-
const g = c === "y" ? "height" : "width", m = i.reference[c] - i.floating[g] +
|
4040
|
-
p < m ? p = m : p >
|
4039
|
+
const g = c === "y" ? "height" : "width", m = i.reference[c] - i.floating[g] + E.mainAxis, S = i.reference[c] + i.reference[g] - E.mainAxis;
|
4040
|
+
p < m ? p = m : p > S && (p = S);
|
4041
4041
|
}
|
4042
|
-
if (
|
4043
|
-
var
|
4044
|
-
const g = c === "y" ? "width" : "height", m = ["top", "left"].includes(Be(o)),
|
4045
|
-
b <
|
4042
|
+
if (f) {
|
4043
|
+
var x, P;
|
4044
|
+
const g = c === "y" ? "width" : "height", m = ["top", "left"].includes(Be(o)), S = i.reference[l] - i.floating[g] + (m && ((x = s.offset) == null ? void 0 : x[l]) || 0) + (m ? 0 : E.crossAxis), I = i.reference[l] + i.reference[g] + (m ? 0 : ((P = s.offset) == null ? void 0 : P[l]) || 0) - (m ? E.crossAxis : 0);
|
4045
|
+
b < S ? b = S : b > I && (b = I);
|
4046
4046
|
}
|
4047
4047
|
return { [c]: p, [l]: b };
|
4048
4048
|
} };
|
4049
4049
|
}, ec = function(e) {
|
4050
4050
|
return e === void 0 && (e = {}), { name: "size", options: e, async fn(t) {
|
4051
4051
|
const { placement: r, rects: n, platform: o, elements: i } = t, { apply: s = () => {
|
4052
|
-
}, ...u } = e, a = await cr(t, u),
|
4052
|
+
}, ...u } = e, a = await cr(t, u), f = Be(r), d = wt(r), c = st(r) === "x", { width: l, height: p } = n.floating;
|
4053
4053
|
let b, v;
|
4054
|
-
|
4055
|
-
const
|
4056
|
-
let g =
|
4054
|
+
f === "top" || f === "bottom" ? (b = f, v = d === (await (o.isRTL == null ? void 0 : o.isRTL(i.floating)) ? "start" : "end") ? "left" : "right") : (v = f, b = d === "end" ? "top" : "bottom");
|
4055
|
+
const E = p - a[b], x = l - a[v], P = !t.middlewareData.shift;
|
4056
|
+
let g = E, m = x;
|
4057
4057
|
if (c) {
|
4058
|
-
const
|
4059
|
-
m =
|
4058
|
+
const I = l - a.left - a.right;
|
4059
|
+
m = d || P ? An(x, I) : I;
|
4060
4060
|
} else {
|
4061
|
-
const
|
4062
|
-
g =
|
4061
|
+
const I = p - a.top - a.bottom;
|
4062
|
+
g = d || P ? An(E, I) : I;
|
4063
4063
|
}
|
4064
|
-
if (P && !
|
4065
|
-
const
|
4066
|
-
c ? m = l - 2 * (
|
4064
|
+
if (P && !d) {
|
4065
|
+
const I = Ze(a.left, 0), _ = Ze(a.right, 0), A = Ze(a.top, 0), w = Ze(a.bottom, 0);
|
4066
|
+
c ? m = l - 2 * (I !== 0 || _ !== 0 ? I + _ : Ze(a.left, a.right)) : g = p - 2 * (A !== 0 || w !== 0 ? A + w : Ze(a.top, a.bottom));
|
4067
4067
|
}
|
4068
4068
|
await s({ ...t, availableWidth: m, availableHeight: g });
|
4069
|
-
const
|
4070
|
-
return l !==
|
4069
|
+
const S = await o.getDimensions(i.floating);
|
4070
|
+
return l !== S.width || p !== S.height ? { reset: { rects: !0 } } : {};
|
4071
4071
|
} };
|
4072
4072
|
};
|
4073
4073
|
function we(e) {
|
@@ -4142,14 +4142,14 @@ function nt(e, t, r, n) {
|
|
4142
4142
|
const s = e.getBoundingClientRect(), u = oi(e);
|
4143
4143
|
let a = ii;
|
4144
4144
|
t && (n ? Ee(n) && (a = gt(n)) : a = gt(e));
|
4145
|
-
const
|
4146
|
-
let c = (s.left + (
|
4145
|
+
const f = u ? we(u) : window, d = Rn() && r;
|
4146
|
+
let c = (s.left + (d && ((o = f.visualViewport) == null ? void 0 : o.offsetLeft) || 0)) / a.x, l = (s.top + (d && ((i = f.visualViewport) == null ? void 0 : i.offsetTop) || 0)) / a.y, p = s.width / a.x, b = s.height / a.y;
|
4147
4147
|
if (u) {
|
4148
|
-
const v = we(u),
|
4149
|
-
let
|
4150
|
-
for (;
|
4151
|
-
const P = gt(
|
4152
|
-
g.x += (
|
4148
|
+
const v = we(u), E = n && Ee(n) ? we(n) : n;
|
4149
|
+
let x = v.frameElement;
|
4150
|
+
for (; x && n && E !== v; ) {
|
4151
|
+
const P = gt(x), g = x.getBoundingClientRect(), m = getComputedStyle(x);
|
4152
|
+
g.x += (x.clientLeft + parseFloat(m.paddingLeft)) * P.x, g.y += (x.clientTop + parseFloat(m.paddingTop)) * P.y, c *= P.x, l *= P.y, p *= P.x, b *= P.y, c += g.x, l += g.y, x = we(x).frameElement;
|
4153
4153
|
}
|
4154
4154
|
}
|
4155
4155
|
return jt({ width: p, height: b, x: c, y: l });
|
@@ -4181,24 +4181,24 @@ function It(e, t) {
|
|
4181
4181
|
function Wr(e, t, r) {
|
4182
4182
|
let n;
|
4183
4183
|
if (t === "viewport") n = function(s, u) {
|
4184
|
-
const a = we(s),
|
4185
|
-
let c =
|
4186
|
-
if (
|
4187
|
-
c =
|
4184
|
+
const a = we(s), f = Ye(s), d = a.visualViewport;
|
4185
|
+
let c = f.clientWidth, l = f.clientHeight, p = 0, b = 0;
|
4186
|
+
if (d) {
|
4187
|
+
c = d.width, l = d.height;
|
4188
4188
|
const v = Rn();
|
4189
|
-
(!v || v && u === "fixed") && (p =
|
4189
|
+
(!v || v && u === "fixed") && (p = d.offsetLeft, b = d.offsetTop);
|
4190
4190
|
}
|
4191
4191
|
return { width: c, height: l, x: p, y: b };
|
4192
4192
|
}(e, r);
|
4193
4193
|
else if (t === "document") n = function(s) {
|
4194
|
-
const u = Ye(s), a = un(s),
|
4194
|
+
const u = Ye(s), a = un(s), f = s.ownerDocument.body, d = Pt(u.scrollWidth, u.clientWidth, f.scrollWidth, f.clientWidth), c = Pt(u.scrollHeight, u.clientHeight, f.scrollHeight, f.clientHeight);
|
4195
4195
|
let l = -a.scrollLeft + si(s);
|
4196
4196
|
const p = -a.scrollTop;
|
4197
|
-
return Ae(
|
4197
|
+
return Ae(f).direction === "rtl" && (l += Pt(u.clientWidth, f.clientWidth) - d), { width: d, height: c, x: l, y: p };
|
4198
4198
|
}(Ye(e));
|
4199
4199
|
else if (Ee(t)) n = function(s, u) {
|
4200
|
-
const a = nt(s, !0, u === "fixed"),
|
4201
|
-
return { width: s.clientWidth * c.x, height: s.clientHeight * c.y, x:
|
4200
|
+
const a = nt(s, !0, u === "fixed"), f = a.top + s.clientTop, d = a.left + s.clientLeft, c = Le(s) ? gt(s) : { x: 1, y: 1 };
|
4201
|
+
return { width: s.clientWidth * c.x, height: s.clientHeight * c.y, x: d * c.x, y: f * c.y };
|
4202
4202
|
}(t, r);
|
4203
4203
|
else {
|
4204
4204
|
const s = { ...t };
|
@@ -4244,20 +4244,20 @@ function nc(e, t, r) {
|
|
4244
4244
|
}
|
4245
4245
|
const rc = { getClippingRect: function(e) {
|
4246
4246
|
let { element: t, boundary: r, rootBoundary: n, strategy: o } = e;
|
4247
|
-
const i = r === "clippingAncestors" ? function(
|
4248
|
-
const c =
|
4247
|
+
const i = r === "clippingAncestors" ? function(f, d) {
|
4248
|
+
const c = d.get(f);
|
4249
4249
|
if (c) return c;
|
4250
|
-
let l = It(
|
4251
|
-
const b = Ae(
|
4252
|
-
let v = b ? bt(
|
4250
|
+
let l = It(f).filter((E) => Ee(E) && Je(E) !== "body"), p = null;
|
4251
|
+
const b = Ae(f).position === "fixed";
|
4252
|
+
let v = b ? bt(f) : f;
|
4253
4253
|
for (; Ee(v) && !sn(v); ) {
|
4254
|
-
const
|
4255
|
-
|
4254
|
+
const E = Ae(v), x = Ln(v);
|
4255
|
+
x || E.position !== "fixed" || (p = null), (b ? !x && !p : !x && E.position === "static" && p && ["absolute", "fixed"].includes(p.position) || Ot(v) && !x && ai(f, v)) ? l = l.filter((P) => P !== v) : p = E, v = bt(v);
|
4256
4256
|
}
|
4257
|
-
return
|
4258
|
-
}(t, this._c) : [].concat(r), s = [...i, n], u = s[0], a = s.reduce((
|
4259
|
-
const c = Wr(t,
|
4260
|
-
return
|
4257
|
+
return d.set(f, l), l;
|
4258
|
+
}(t, this._c) : [].concat(r), s = [...i, n], u = s[0], a = s.reduce((f, d) => {
|
4259
|
+
const c = Wr(t, d, o);
|
4260
|
+
return f.top = Pt(c.top, f.top), f.right = Hr(c.right, f.right), f.bottom = Hr(c.bottom, f.bottom), f.left = Pt(c.left, f.left), f;
|
4261
4261
|
}, Wr(t, u, o));
|
4262
4262
|
return { width: a.right - a.left, height: a.bottom - a.top, x: a.left, y: a.top };
|
4263
4263
|
}, convertOffsetParentRelativeRectToViewportRelativeRect: function(e) {
|
@@ -4267,8 +4267,8 @@ const rc = { getClippingRect: function(e) {
|
|
4267
4267
|
let s = { scrollLeft: 0, scrollTop: 0 }, u = { x: 1, y: 1 };
|
4268
4268
|
const a = { x: 0, y: 0 };
|
4269
4269
|
if ((o || !o && n !== "fixed") && ((Je(r) !== "body" || Ot(i)) && (s = un(r)), Le(r))) {
|
4270
|
-
const
|
4271
|
-
u = gt(r), a.x =
|
4270
|
+
const f = nt(r);
|
4271
|
+
u = gt(r), a.x = f.x + r.clientLeft, a.y = f.y + r.clientTop;
|
4272
4272
|
}
|
4273
4273
|
return { width: t.width * u.x, height: t.height * u.y, x: t.x * u.x - s.scrollLeft * u.x + a.x, y: t.y * u.y - s.scrollTop * u.y + a.y };
|
4274
4274
|
}, isElement: Ee, getDimensions: function(e) {
|
@@ -4285,19 +4285,19 @@ function oc(e, t, r, n) {
|
|
4285
4285
|
const p = !Ee(l) && l.toString().includes("V");
|
4286
4286
|
!o || u && !p || l.addEventListener("scroll", r, { passive: !0 }), i && l.addEventListener("resize", r);
|
4287
4287
|
});
|
4288
|
-
let
|
4289
|
-
s && (
|
4288
|
+
let f, d = null;
|
4289
|
+
s && (d = new ResizeObserver(() => {
|
4290
4290
|
r();
|
4291
|
-
}), Ee(e) && !u &&
|
4291
|
+
}), Ee(e) && !u && d.observe(e), Ee(e) || !e.contextElement || u || d.observe(e.contextElement), d.observe(t));
|
4292
4292
|
let c = u ? nt(e) : null;
|
4293
4293
|
return u && function l() {
|
4294
4294
|
const p = nt(e);
|
4295
|
-
!c || p.x === c.x && p.y === c.y && p.width === c.width && p.height === c.height || r(), c = p,
|
4295
|
+
!c || p.x === c.x && p.y === c.y && p.width === c.width && p.height === c.height || r(), c = p, f = requestAnimationFrame(l);
|
4296
4296
|
}(), r(), () => {
|
4297
4297
|
var l;
|
4298
4298
|
a.forEach((p) => {
|
4299
4299
|
o && p.removeEventListener("scroll", r), i && p.removeEventListener("resize", r);
|
4300
|
-
}), (l =
|
4300
|
+
}), (l = d) == null || l.disconnect(), d = null, u && cancelAnimationFrame(f);
|
4301
4301
|
};
|
4302
4302
|
}
|
4303
4303
|
const ic = (e, t, r) => {
|
@@ -4318,7 +4318,7 @@ function Ur(e = 0, t = 0, r = 0, n = 0) {
|
|
4318
4318
|
bottom: t + n,
|
4319
4319
|
left: e
|
4320
4320
|
};
|
4321
|
-
return
|
4321
|
+
return $(O({}, o), { toJSON: () => o });
|
4322
4322
|
}
|
4323
4323
|
function uc(e) {
|
4324
4324
|
if (!e) return Ur();
|
@@ -4406,19 +4406,19 @@ var ci = Z(
|
|
4406
4406
|
preserveTabOrder: s = !0,
|
4407
4407
|
autoFocusOnShow: u = !0,
|
4408
4408
|
wrapperProps: a,
|
4409
|
-
fixed:
|
4410
|
-
flip:
|
4409
|
+
fixed: f = !1,
|
4410
|
+
flip: d = !0,
|
4411
4411
|
shift: c = 0,
|
4412
4412
|
slide: l = !0,
|
4413
4413
|
overlap: p = !1,
|
4414
4414
|
sameWidth: b = !1,
|
4415
4415
|
fitViewport: v = !1,
|
4416
|
-
gutter:
|
4417
|
-
arrowPadding:
|
4416
|
+
gutter: E,
|
4417
|
+
arrowPadding: x = 4,
|
4418
4418
|
overflowPadding: P = 8,
|
4419
4419
|
getAnchorRect: g,
|
4420
4420
|
updatePosition: m
|
4421
|
-
} = r,
|
4421
|
+
} = r, S = J(r, [
|
4422
4422
|
"store",
|
4423
4423
|
"modal",
|
4424
4424
|
"portal",
|
@@ -4438,49 +4438,49 @@ var ci = Z(
|
|
4438
4438
|
"getAnchorRect",
|
4439
4439
|
"updatePosition"
|
4440
4440
|
]);
|
4441
|
-
const
|
4442
|
-
n = n ||
|
4441
|
+
const I = Zt();
|
4442
|
+
n = n || I, he(
|
4443
4443
|
n,
|
4444
4444
|
process.env.NODE_ENV !== "production" && "Popover must receive a `store` prop or be wrapped in a PopoverProvider component."
|
4445
4445
|
);
|
4446
|
-
const
|
4446
|
+
const _ = n.useState("arrowElement"), A = n.useState("anchorElement"), w = n.useState("disclosureElement"), T = n.useState("popoverElement"), F = n.useState("contentElement"), N = n.useState("placement"), C = n.useState("mounted"), L = n.useState("rendered"), D = Y(null), [y, R] = X(!1), { portalRef: B, domReady: h } = lo(i, S.portalRef), M = U(g), K = U(m), H = !!m;
|
4447
4447
|
ee(() => {
|
4448
4448
|
if (!(T != null && T.isConnected)) return;
|
4449
4449
|
T.style.setProperty(
|
4450
4450
|
"--popover-overflow-padding",
|
4451
4451
|
`${P}px`
|
4452
4452
|
);
|
4453
|
-
const oe = ac(A,
|
4454
|
-
if (!
|
4455
|
-
|
4456
|
-
const ye =
|
4457
|
-
lc(ye, { gutter:
|
4458
|
-
fc({ flip:
|
4453
|
+
const oe = ac(A, M), re = async () => {
|
4454
|
+
if (!C) return;
|
4455
|
+
_ || (D.current = D.current || document.createElement("div"));
|
4456
|
+
const ye = _ || D.current, Ie = [
|
4457
|
+
lc(ye, { gutter: E, shift: c }),
|
4458
|
+
fc({ flip: d, overflowPadding: P }),
|
4459
4459
|
dc({ slide: l, shift: c, overlap: p, overflowPadding: P }),
|
4460
|
-
mc(ye, { arrowPadding:
|
4460
|
+
mc(ye, { arrowPadding: x }),
|
4461
4461
|
pc({
|
4462
4462
|
sameWidth: b,
|
4463
4463
|
fitViewport: v,
|
4464
4464
|
overflowPadding: P
|
4465
4465
|
})
|
4466
4466
|
], ue = await ic(oe, T, {
|
4467
|
-
placement:
|
4468
|
-
strategy:
|
4467
|
+
placement: N,
|
4468
|
+
strategy: f ? "fixed" : "absolute",
|
4469
4469
|
middleware: Ie
|
4470
4470
|
});
|
4471
|
-
n == null || n.setState("currentPlacement", ue.placement),
|
4471
|
+
n == null || n.setState("currentPlacement", ue.placement), R(!0);
|
4472
4472
|
const ut = jr(ue.x), at = jr(ue.y);
|
4473
4473
|
if (Object.assign(T.style, {
|
4474
4474
|
top: "0",
|
4475
4475
|
left: "0",
|
4476
4476
|
transform: `translate3d(${ut}px,${at}px,0)`
|
4477
4477
|
}), ye && ue.middlewareData.arrow) {
|
4478
|
-
const { x: Me, y: Ue } = ue.middlewareData.arrow, ct = ue.placement.split("-")[0], lt = ye.clientWidth / 2, ft = ye.clientHeight / 2,
|
4478
|
+
const { x: Me, y: Ue } = ue.middlewareData.arrow, ct = ue.placement.split("-")[0], lt = ye.clientWidth / 2, ft = ye.clientHeight / 2, V = Me != null ? Me + lt : -lt, q = Ue != null ? Ue + ft : -ft;
|
4479
4479
|
T.style.setProperty(
|
4480
4480
|
"--popover-transform-origin",
|
4481
4481
|
{
|
4482
|
-
top: `${
|
4483
|
-
bottom: `${
|
4482
|
+
top: `${V}px calc(100% + ${ft}px)`,
|
4483
|
+
bottom: `${V}px ${-ft}px`,
|
4484
4484
|
left: `calc(100% + ${lt}px) ${q}px`,
|
4485
4485
|
right: `${-lt}px ${q}px`
|
4486
4486
|
}[ct]
|
@@ -4491,55 +4491,55 @@ var ci = Z(
|
|
4491
4491
|
});
|
4492
4492
|
}
|
4493
4493
|
}, ze = oc(oe, T, async () => {
|
4494
|
-
H ? (await K({ updatePosition: re }),
|
4494
|
+
H ? (await K({ updatePosition: re }), R(!0)) : await re();
|
4495
4495
|
}, {
|
4496
4496
|
// JSDOM doesn't support ResizeObserver
|
4497
4497
|
elementResize: typeof ResizeObserver == "function"
|
4498
4498
|
});
|
4499
4499
|
return () => {
|
4500
|
-
|
4500
|
+
R(!1), ze();
|
4501
4501
|
};
|
4502
4502
|
}, [
|
4503
4503
|
n,
|
4504
4504
|
L,
|
4505
4505
|
T,
|
4506
|
-
|
4506
|
+
_,
|
4507
4507
|
A,
|
4508
4508
|
T,
|
4509
|
-
|
4510
|
-
|
4511
|
-
|
4512
|
-
d,
|
4509
|
+
N,
|
4510
|
+
C,
|
4511
|
+
h,
|
4513
4512
|
f,
|
4513
|
+
d,
|
4514
4514
|
c,
|
4515
4515
|
l,
|
4516
4516
|
p,
|
4517
4517
|
b,
|
4518
4518
|
v,
|
4519
|
+
E,
|
4519
4520
|
x,
|
4520
|
-
w,
|
4521
4521
|
P,
|
4522
|
-
|
4522
|
+
M,
|
4523
4523
|
H,
|
4524
4524
|
K
|
4525
4525
|
]), ee(() => {
|
4526
|
-
if (!
|
4526
|
+
if (!C || !h || !(T != null && T.isConnected) || !(F != null && F.isConnected)) return;
|
4527
4527
|
const oe = () => {
|
4528
|
-
T.style.zIndex = getComputedStyle(
|
4528
|
+
T.style.zIndex = getComputedStyle(F).zIndex;
|
4529
4529
|
};
|
4530
4530
|
oe();
|
4531
4531
|
let re = requestAnimationFrame(() => {
|
4532
4532
|
re = requestAnimationFrame(oe);
|
4533
4533
|
});
|
4534
4534
|
return () => cancelAnimationFrame(re);
|
4535
|
-
}, [
|
4536
|
-
const ie =
|
4537
|
-
return
|
4538
|
-
|
4535
|
+
}, [C, h, T, F]);
|
4536
|
+
const ie = f ? "fixed" : "absolute";
|
4537
|
+
return S = le(
|
4538
|
+
S,
|
4539
4539
|
(oe) => /* @__PURE__ */ k(
|
4540
4540
|
"div",
|
4541
|
-
|
4542
|
-
style:
|
4541
|
+
$(O({}, a), {
|
4542
|
+
style: O({
|
4543
4543
|
// https://floating-ui.com/docs/computeposition#initial-layout
|
4544
4544
|
position: ie,
|
4545
4545
|
top: 0,
|
@@ -4551,30 +4551,30 @@ var ci = Z(
|
|
4551
4551
|
})
|
4552
4552
|
),
|
4553
4553
|
[n, ie, a]
|
4554
|
-
),
|
4555
|
-
|
4554
|
+
), S = le(
|
4555
|
+
S,
|
4556
4556
|
(oe) => /* @__PURE__ */ k(en, { value: n, children: oe }),
|
4557
4557
|
[n]
|
4558
|
-
),
|
4558
|
+
), S = $(O({
|
4559
4559
|
// data-placing is not part of the public API. We're setting this here so
|
4560
4560
|
// we can wait for the popover to be positioned before other components
|
4561
4561
|
// move focus into it. For example, this attribute is observed by the
|
4562
4562
|
// Combobox component with the autoSelect behavior.
|
4563
|
-
"data-placing": !
|
4564
|
-
},
|
4565
|
-
style:
|
4563
|
+
"data-placing": !y || void 0
|
4564
|
+
}, S), {
|
4565
|
+
style: O({
|
4566
4566
|
position: "relative"
|
4567
|
-
},
|
4568
|
-
}),
|
4567
|
+
}, S.style)
|
4568
|
+
}), S = Qo($(O({
|
4569
4569
|
store: n,
|
4570
4570
|
modal: o,
|
4571
4571
|
portal: i,
|
4572
4572
|
preserveTabOrder: s,
|
4573
|
-
preserveTabOrderAnchor:
|
4574
|
-
autoFocusOnShow:
|
4575
|
-
},
|
4576
|
-
portalRef:
|
4577
|
-
})),
|
4573
|
+
preserveTabOrderAnchor: w || A,
|
4574
|
+
autoFocusOnShow: y && u
|
4575
|
+
}, S), {
|
4576
|
+
portalRef: B
|
4577
|
+
})), S;
|
4578
4578
|
}
|
4579
4579
|
);
|
4580
4580
|
ur(
|
@@ -4588,7 +4588,7 @@ var vc = "div", gc = Z(
|
|
4588
4588
|
function(t) {
|
4589
4589
|
var r = t, { store: n, alwaysVisible: o } = r, i = J(r, ["store", "alwaysVisible"]);
|
4590
4590
|
const s = Jn();
|
4591
|
-
return n = n || s, i = qo(
|
4591
|
+
return n = n || s, i = qo(O({ store: n, alwaysVisible: o }, i)), i = ci(O({ store: n, alwaysVisible: o }, i)), i;
|
4592
4592
|
}
|
4593
4593
|
), hc = ur(
|
4594
4594
|
G(function(t) {
|
@@ -4622,132 +4622,134 @@ function zc({
|
|
4622
4622
|
onAgentsListOpen: s,
|
4623
4623
|
selectedAgent: u,
|
4624
4624
|
triggerChipClassName: a,
|
4625
|
+
useAgentLocalStorage: f = !1,
|
4626
|
+
// All non-Box AI Q&A experiences should pass in true
|
4625
4627
|
variant: d = "modal"
|
4626
4628
|
}) {
|
4627
|
-
var
|
4629
|
+
var B;
|
4628
4630
|
const {
|
4629
|
-
formatMessage:
|
4630
|
-
} = bi(), [
|
4631
|
-
let
|
4632
|
-
|
4633
|
-
const
|
4634
|
-
Wrapper:
|
4635
|
-
wrapperProps:
|
4631
|
+
formatMessage: c
|
4632
|
+
} = bi(), [l, p] = X(!1), b = o === fn.ERROR, [v, E] = X(b), [x, P] = Ei(Si), g = wi(), m = o === fn.SUCCESS, S = o === fn.IN_PROGRESS, I = c(Qe.selectAgent), _ = c(Qe.defaultAgent);
|
4633
|
+
let A = "";
|
4634
|
+
m ? A = (u == null ? void 0 : u.name) ?? I : b && (A = _);
|
4635
|
+
const w = Y(null), {
|
4636
|
+
Wrapper: T,
|
4637
|
+
wrapperProps: F
|
4636
4638
|
} = di({
|
4637
|
-
ref:
|
4638
|
-
textValue:
|
4639
|
+
ref: w,
|
4640
|
+
textValue: A
|
4639
4641
|
});
|
4640
4642
|
W(() => {
|
4641
|
-
|
4643
|
+
l && n && n({
|
4642
4644
|
...an,
|
4643
4645
|
action: cn,
|
4644
4646
|
target: ln.OPEN_SELECTOR
|
4645
4647
|
});
|
4646
|
-
}, [
|
4647
|
-
if (x) {
|
4648
|
-
const
|
4649
|
-
|
4648
|
+
}, [l, n]), W(() => {
|
4649
|
+
if (f && x) {
|
4650
|
+
const h = e.find((M) => M.id === x);
|
4651
|
+
h ? g({
|
4650
4652
|
type: dr.SET_SELECTED_AGENT,
|
4651
|
-
id:
|
4652
|
-
}) :
|
4653
|
+
id: h.id
|
4654
|
+
}) : P(null);
|
4653
4655
|
}
|
4654
4656
|
}, [e]);
|
4655
|
-
const N = xe((
|
4656
|
-
|
4657
|
+
const N = xe((h) => {
|
4658
|
+
p(!1), g({
|
4657
4659
|
type: dr.SET_SELECTED_AGENT,
|
4658
|
-
id:
|
4659
|
-
}),
|
4660
|
+
id: h.id
|
4661
|
+
}), f && P(h.id), n && n({
|
4660
4662
|
...an,
|
4661
4663
|
action: cn,
|
4662
4664
|
target: ln.SELECT_AGENT
|
4663
4665
|
});
|
4664
|
-
}, [
|
4665
|
-
|
4666
|
+
}, [g, n, P, f]), C = xe(() => {
|
4667
|
+
p(!1), r(), n && n({
|
4666
4668
|
...an,
|
4667
4669
|
action: cn,
|
4668
4670
|
target: ln.RETRY_LOADING_AGENTS
|
4669
4671
|
});
|
4670
|
-
}, [r, n]),
|
4671
|
-
|
4672
|
-
},
|
4673
|
-
(
|
4672
|
+
}, [r, n]), L = xe((h) => E(b && b && !l && h ? h : !1), [b, l]), D = (h) => {
|
4673
|
+
h && s && s(), p(h);
|
4674
|
+
}, y = d === "sidebar" && Pe.sidebar, R = (h) => {
|
4675
|
+
(h.key === "ArrowUp" || h.key === "ArrowDown" || h.key === "ArrowLeft" || h.key === "ArrowRight") && h.stopPropagation();
|
4674
4676
|
};
|
4675
4677
|
return /* @__PURE__ */ k(Nt.Group, {
|
4676
|
-
className: Mt(Pe.agentSelector, a,
|
4677
|
-
name:
|
4678
|
-
onKeyDown:
|
4678
|
+
className: Mt(Pe.agentSelector, a, y),
|
4679
|
+
name: I,
|
4680
|
+
onKeyDown: R,
|
4679
4681
|
type: "multiple",
|
4680
4682
|
children: /* @__PURE__ */ Fe(Bu, {
|
4681
|
-
defaultValue: (
|
4682
|
-
open:
|
4683
|
-
setOpen:
|
4683
|
+
defaultValue: (B = e[0]) == null ? void 0 : B.id,
|
4684
|
+
open: l,
|
4685
|
+
setOpen: D,
|
4684
4686
|
children: [/* @__PURE__ */ k(pi, {
|
4685
|
-
content:
|
4686
|
-
onOpenChange:
|
4687
|
-
open:
|
4687
|
+
content: c(Qe.errorTooltip),
|
4688
|
+
onOpenChange: L,
|
4689
|
+
open: v,
|
4688
4690
|
side: "bottom",
|
4689
4691
|
variant: "error",
|
4690
4692
|
children: /* @__PURE__ */ k($u, {
|
4691
4693
|
className: Pe.selectAgentButton,
|
4692
|
-
disabled: i ||
|
4694
|
+
disabled: i || S,
|
4693
4695
|
render: /* @__PURE__ */ Fe(Nt.TriggerChip, {
|
4694
|
-
"aria-label":
|
4696
|
+
"aria-label": A,
|
4695
4697
|
className: Pe.triggerChip,
|
4696
4698
|
"data-target-id": "FilterChip.TriggerChip-agentSelectorTrigger",
|
4697
4699
|
value: "trigger-chip",
|
4698
4700
|
children: [/* @__PURE__ */ k(mi, {
|
4699
4701
|
className: Pe.agentStatus,
|
4700
4702
|
colorIndex: 0,
|
4701
|
-
text:
|
4702
|
-
}),
|
4703
|
-
"aria-label":
|
4703
|
+
text: c(Qe.agent)
|
4704
|
+
}), S && /* @__PURE__ */ k(vi, {
|
4705
|
+
"aria-label": c(Qe.loadingMessage),
|
4704
4706
|
className: Pe.agentLoader,
|
4705
4707
|
variant: "default"
|
4706
|
-
}),
|
4708
|
+
}), b && /* @__PURE__ */ k(hi, {
|
4707
4709
|
className: Pe.agentError,
|
4708
4710
|
height: "1rem",
|
4709
4711
|
role: "presentation",
|
4710
4712
|
width: "1rem"
|
4711
|
-
}), /* @__PURE__ */ k(
|
4712
|
-
...
|
4713
|
+
}), /* @__PURE__ */ k(T, {
|
4714
|
+
...F,
|
4713
4715
|
children: /* @__PURE__ */ k(Nt.Label, {
|
4714
|
-
ref:
|
4716
|
+
ref: w,
|
4715
4717
|
className: Pe.agentLabel,
|
4716
|
-
children:
|
4718
|
+
children: A
|
4717
4719
|
})
|
4718
|
-
}), !
|
4720
|
+
}), !S && /* @__PURE__ */ k("div", {
|
4719
4721
|
className: Pe.dropdownIndicator,
|
4720
4722
|
children: /* @__PURE__ */ k(Nt.DropdownIndicator, {})
|
4721
4723
|
})]
|
4722
4724
|
})
|
4723
4725
|
})
|
4724
4726
|
}), /* @__PURE__ */ Fe(hc, {
|
4725
|
-
"aria-label":
|
4726
|
-
className: Mt(Pe.agentListContainer,
|
4727
|
+
"aria-label": c(Qe.agentList),
|
4728
|
+
className: Mt(Pe.agentListContainer, y),
|
4727
4729
|
unmountOnHide: !0,
|
4728
|
-
children: [
|
4730
|
+
children: [m && /* @__PURE__ */ k(la, {
|
4729
4731
|
className: Mt(Pe.agentList, t),
|
4730
|
-
children: e.map((
|
4732
|
+
children: e.map((h, M) => /* @__PURE__ */ k(Zu, {
|
4731
4733
|
clickOnEnter: !0,
|
4732
4734
|
clickOnSpace: !0,
|
4733
4735
|
focusable: !0,
|
4734
4736
|
focusOnHover: !0,
|
4735
4737
|
hideOnClick: !0,
|
4736
4738
|
onClick: () => {
|
4737
|
-
N(
|
4739
|
+
N(h);
|
4738
4740
|
},
|
4739
4741
|
setValueOnClick: !0,
|
4740
|
-
value:
|
4742
|
+
value: h.id,
|
4741
4743
|
children: /* @__PURE__ */ k(yi, {
|
4742
|
-
agent:
|
4744
|
+
agent: h
|
4743
4745
|
})
|
4744
|
-
},
|
4745
|
-
}),
|
4746
|
-
className: Mt(Pe.agentListRetryButton,
|
4747
|
-
onClick:
|
4746
|
+
}, h.id))
|
4747
|
+
}), b && /* @__PURE__ */ k(gi, {
|
4748
|
+
className: Mt(Pe.agentListRetryButton, y),
|
4749
|
+
onClick: C,
|
4748
4750
|
variant: "tertiary",
|
4749
4751
|
"data-target-id": "Button-errorMessage",
|
4750
|
-
children:
|
4752
|
+
children: c(Qe.errorMessage)
|
4751
4753
|
})]
|
4752
4754
|
})]
|
4753
4755
|
})
|