@sps-woodland/modal 8.7.4 → 8.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.es.js CHANGED
@@ -1,42 +1,51 @@
1
1
  import { Metadata as Oe, cl as ue, combineEventHandlers as Me, I18nContext as st, useChildTestIdAttrBuilder as dt, selectChildren as ut, modChildren as ct, Icon as mt, contentOf as le } from "@sps-woodland/core";
2
2
  import { Button as ye } from "@sps-woodland/buttons";
3
3
  import * as u from "react";
4
- import h, { useState as H, useRef as y, useEffect as F, useCallback as x, useContext as V, useMemo as z } from "react";
5
- import ft from "react-dom";
4
+ import h, { useRef as y, useCallback as x, useState as V, useContext as W, useEffect as F, useMemo as q, createContext as ft } from "react";
5
+ import pt from "react-dom";
6
6
  import { code as b } from "@spscommerce/utils";
7
- function pt(e, t, o) {
8
- let [r, n] = H(e || t), l = y(e !== void 0), a = e !== void 0;
9
- F(() => {
10
- let d = l.current;
11
- d !== a && console.warn(`WARN: A component changed from ${d ? "controlled" : "uncontrolled"} to ${a ? "controlled" : "uncontrolled"}.`), l.current = a;
12
- }, [
13
- a
14
- ]);
15
- let s = a ? e : r, c = x((d, ...i) => {
16
- let f = (m, ...g) => {
17
- o && (Object.is(s, m) || o(m, ...g)), a || (s = m);
18
- };
19
- typeof d == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), n((g, ...p) => {
20
- let T = d(a ? s : g, ...p);
21
- return f(T, ...i), a ? g : T;
22
- })) : (a || n(d), f(d, ...i));
7
+ const w = typeof document < "u" ? h.useLayoutEffect : () => {
8
+ };
9
+ function H(e) {
10
+ const t = y(null);
11
+ return w(() => {
12
+ t.current = e;
23
13
  }, [
24
- a,
25
- s,
26
- o
27
- ]);
14
+ e
15
+ ]), x((...o) => {
16
+ const r = t.current;
17
+ return r == null ? void 0 : r(...o);
18
+ }, []);
19
+ }
20
+ function gt(e) {
21
+ let [t, o] = V(e), r = y(null), n = H(() => {
22
+ if (!r.current)
23
+ return;
24
+ let a = r.current.next();
25
+ if (a.done) {
26
+ r.current = null;
27
+ return;
28
+ }
29
+ t === a.value ? n() : o(a.value);
30
+ });
31
+ w(() => {
32
+ r.current && n();
33
+ });
34
+ let l = H((a) => {
35
+ r.current = a(t), n();
36
+ });
28
37
  return [
29
- s,
30
- c
38
+ t,
39
+ l
31
40
  ];
32
41
  }
33
42
  const G = {
34
43
  prefix: String(Math.round(Math.random() * 1e10)),
35
44
  current: 0
36
- }, De = /* @__PURE__ */ h.createContext(G), gt = /* @__PURE__ */ h.createContext(!1);
37
- let bt = Boolean(typeof window < "u" && window.document && window.document.createElement), ie = /* @__PURE__ */ new WeakMap();
38
- function vt(e = !1) {
39
- let t = V(De), o = y(null);
45
+ }, De = /* @__PURE__ */ h.createContext(G), bt = /* @__PURE__ */ h.createContext(!1);
46
+ let vt = !!(typeof window < "u" && window.document && window.document.createElement), ie = /* @__PURE__ */ new WeakMap();
47
+ function $t(e = !1) {
48
+ let t = W(De), o = y(null);
40
49
  if (o.current === null && !e) {
41
50
  var r, n;
42
51
  let l = (n = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || n === void 0 || (r = n.ReactCurrentOwner) === null || r === void 0 ? void 0 : r.current;
@@ -51,90 +60,36 @@ function vt(e = !1) {
51
60
  }
52
61
  return o.current;
53
62
  }
54
- function $t(e) {
55
- let t = V(De);
56
- t === G && !bt && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
57
- let o = vt(!!e), r = t === G && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${t.prefix}`;
63
+ function ht(e) {
64
+ let t = W(De);
65
+ t === G && !vt && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
66
+ let o = $t(!!e), r = t === G && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${t.prefix}`;
58
67
  return e || `${r}-${o}`;
59
68
  }
60
- function ht(e) {
61
- let t = h.useId(), [o] = H(We()), r = o || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${G.prefix}`;
69
+ function wt(e) {
70
+ let t = h.useId(), [o] = V(We()), r = o || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${G.prefix}`;
62
71
  return e || `${r}-${t}`;
63
72
  }
64
- const wt = typeof h.useId == "function" ? ht : $t;
65
- function Et() {
73
+ const Et = typeof h.useId == "function" ? wt : ht;
74
+ function Mt() {
66
75
  return !1;
67
76
  }
68
- function Mt() {
77
+ function yt() {
69
78
  return !0;
70
79
  }
71
- function yt(e) {
80
+ function Pt(e) {
72
81
  return () => {
73
82
  };
74
83
  }
75
84
  function We() {
76
- return typeof h.useSyncExternalStore == "function" ? h.useSyncExternalStore(yt, Et, Mt) : V(gt);
85
+ return typeof h.useSyncExternalStore == "function" ? h.useSyncExternalStore(Pt, Mt, yt) : W(bt);
77
86
  }
87
+ let kt = !!(typeof window < "u" && window.document && window.document.createElement), X = /* @__PURE__ */ new Map();
78
88
  function Ae(e) {
79
- var t, o, r = "";
80
- if (typeof e == "string" || typeof e == "number")
81
- r += e;
82
- else if (typeof e == "object")
83
- if (Array.isArray(e)) {
84
- var n = e.length;
85
- for (t = 0; t < n; t++)
86
- e[t] && (o = Ae(e[t])) && (r && (r += " "), r += o);
87
- } else
88
- for (o in e)
89
- e[o] && (r && (r += " "), r += o);
90
- return r;
91
- }
92
- function Pt() {
93
- for (var e, t, o = 0, r = "", n = arguments.length; o < n; o++)
94
- (e = arguments[o]) && (t = Ae(e)) && (r && (r += " "), r += t);
95
- return r;
96
- }
97
- const w = typeof document < "u" ? h.useLayoutEffect : () => {
98
- };
99
- function R(e) {
100
- const t = y(null);
101
- return w(() => {
102
- t.current = e;
103
- }, [
104
- e
105
- ]), x((...o) => {
106
- const r = t.current;
107
- return r == null ? void 0 : r(...o);
108
- }, []);
109
- }
110
- function kt(e) {
111
- let [t, o] = H(e), r = y(null), n = R(() => {
112
- if (!r.current)
113
- return;
114
- let a = r.current.next();
115
- if (a.done) {
116
- r.current = null;
117
- return;
118
- }
119
- t === a.value ? n() : o(a.value);
120
- });
121
- w(() => {
122
- r.current && n();
123
- });
124
- let l = R((a) => {
125
- r.current = a(t), n();
126
- });
127
- return [
128
- t,
129
- l
130
- ];
131
- }
132
- let xt = Boolean(typeof window < "u" && window.document && window.document.createElement), X = /* @__PURE__ */ new Map();
133
- function Ie(e) {
134
- let [t, o] = H(e), r = y(null), n = wt(t), l = x((a) => {
89
+ let [t, o] = V(e), r = y(null), n = Et(t), l = x((a) => {
135
90
  r.current = a;
136
91
  }, []);
137
- return xt && X.set(n, l), w(() => {
92
+ return kt && X.set(n, l), w(() => {
138
93
  let a = n;
139
94
  return () => {
140
95
  X.delete(a);
@@ -146,7 +101,7 @@ function Ie(e) {
146
101
  a && (r.current = null, o(a));
147
102
  }), n;
148
103
  }
149
- function Tt(e, t) {
104
+ function xt(e, t) {
150
105
  if (e === t)
151
106
  return e;
152
107
  let o = X.get(e);
@@ -155,8 +110,8 @@ function Tt(e, t) {
155
110
  let r = X.get(t);
156
111
  return r ? (r(e), e) : t;
157
112
  }
158
- function St(e = []) {
159
- let t = Ie(), [o, r] = kt(t), n = x(() => {
113
+ function Tt(e = []) {
114
+ let t = Ae(), [o, r] = gt(t), n = x(() => {
160
115
  r(function* () {
161
116
  yield t, yield document.getElementById(t) ? t : void 0;
162
117
  });
@@ -180,6 +135,25 @@ const E = (e) => {
180
135
  var t;
181
136
  return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
182
137
  }, Y = (e) => e && "window" in e && e.window === e ? e : E(e).defaultView || window;
138
+ function Ie(e) {
139
+ var t, o, r = "";
140
+ if (typeof e == "string" || typeof e == "number")
141
+ r += e;
142
+ else if (typeof e == "object")
143
+ if (Array.isArray(e)) {
144
+ var n = e.length;
145
+ for (t = 0; t < n; t++)
146
+ e[t] && (o = Ie(e[t])) && (r && (r += " "), r += o);
147
+ } else
148
+ for (o in e)
149
+ e[o] && (r && (r += " "), r += o);
150
+ return r;
151
+ }
152
+ function St() {
153
+ for (var e, t, o = 0, r = "", n = arguments.length; o < n; o++)
154
+ (e = arguments[o]) && (t = Ie(e)) && (r && (r += " "), r += t);
155
+ return r;
156
+ }
183
157
  function Lt(...e) {
184
158
  let t = {
185
159
  ...e[0]
@@ -188,20 +162,24 @@ function Lt(...e) {
188
162
  let r = e[o];
189
163
  for (let n in r) {
190
164
  let l = t[n], a = r[n];
191
- typeof l == "function" && typeof a == "function" && n[0] === "o" && n[1] === "n" && n.charCodeAt(2) >= 65 && n.charCodeAt(2) <= 90 ? t[n] = J(l, a) : (n === "className" || n === "UNSAFE_className") && typeof l == "string" && typeof a == "string" ? t[n] = Pt(l, a) : n === "id" && l && a ? t.id = Tt(l, a) : t[n] = a !== void 0 ? a : l;
165
+ typeof l == "function" && typeof a == "function" && // This is a lot faster than a regex.
166
+ n[0] === "o" && n[1] === "n" && n.charCodeAt(2) >= /* 'A' */
167
+ 65 && n.charCodeAt(2) <= /* 'Z' */
168
+ 90 ? t[n] = J(l, a) : (n === "className" || n === "UNSAFE_className") && typeof l == "string" && typeof a == "string" ? t[n] = St(l, a) : n === "id" && l && a ? t.id = xt(l, a) : t[n] = a !== void 0 ? a : l;
192
169
  }
193
170
  }
194
171
  return t;
195
172
  }
196
173
  const Ft = /* @__PURE__ */ new Set([
197
174
  "id"
198
- ]), Bt = /* @__PURE__ */ new Set([
175
+ ]), Ct = /* @__PURE__ */ new Set([
199
176
  "aria-label",
200
177
  "aria-labelledby",
201
178
  "aria-describedby",
202
179
  "aria-details"
203
- ]), Ct = /* @__PURE__ */ new Set([
180
+ ]), Bt = /* @__PURE__ */ new Set([
204
181
  "href",
182
+ "hrefLang",
205
183
  "target",
206
184
  "rel",
207
185
  "download",
@@ -211,7 +189,7 @@ const Ft = /* @__PURE__ */ new Set([
211
189
  function Ot(e, t = {}) {
212
190
  let { labelable: o, isLink: r, propNames: n } = t, l = {};
213
191
  for (const a in e)
214
- Object.prototype.hasOwnProperty.call(e, a) && (Ft.has(a) || o && Bt.has(a) || r && Ct.has(a) || (n == null ? void 0 : n.has(a)) || Nt.test(a)) && (l[a] = e[a]);
192
+ Object.prototype.hasOwnProperty.call(e, a) && (Ft.has(a) || o && Ct.has(a) || r && Bt.has(a) || n != null && n.has(a) || Nt.test(a)) && (l[a] = e[a]);
215
193
  return l;
216
194
  }
217
195
  function Pe(e) {
@@ -224,20 +202,20 @@ function Pe(e) {
224
202
  e.focus(), At(t);
225
203
  }
226
204
  }
227
- let _ = null;
205
+ let j = null;
228
206
  function Dt() {
229
- if (_ == null) {
230
- _ = !1;
207
+ if (j == null) {
208
+ j = !1;
231
209
  try {
232
210
  document.createElement("div").focus({
233
211
  get preventScroll() {
234
- return _ = !0, !0;
212
+ return j = !0, !0;
235
213
  }
236
214
  });
237
215
  } catch {
238
216
  }
239
217
  }
240
- return _;
218
+ return j;
241
219
  }
242
220
  function Wt(e) {
243
221
  let t = e.parentNode, o = [], r = document.scrollingElement || document.documentElement;
@@ -272,7 +250,8 @@ function zt() {
272
250
  return ge(/^iPhone/i);
273
251
  }
274
252
  function qt() {
275
- return ge(/^iPad/i) || ze() && navigator.maxTouchPoints > 1;
253
+ return ge(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
254
+ ze() && navigator.maxTouchPoints > 1;
276
255
  }
277
256
  function Rt() {
278
257
  return zt() || qt();
@@ -298,7 +277,7 @@ function ke() {
298
277
  if (!e(r) || !r.target)
299
278
  return;
300
279
  let n = O.get(r.target);
301
- if (!!n && (n.delete(r.propertyName), n.size === 0 && (r.target.removeEventListener("transitioncancel", o), O.delete(r.target)), O.size === 0)) {
280
+ if (n && (n.delete(r.propertyName), n.size === 0 && (r.target.removeEventListener("transitioncancel", o), O.delete(r.target)), O.size === 0)) {
302
281
  for (let l of ce)
303
282
  l();
304
283
  ce.clear();
@@ -312,26 +291,52 @@ function Vt(e) {
312
291
  O.size === 0 ? e() : ce.add(e);
313
292
  });
314
293
  }
294
+ function xe(e, t) {
295
+ let o = window.getComputedStyle(e), r = /(auto|scroll)/.test(o.overflow + o.overflowX + o.overflowY);
296
+ return r && t && (r = e.scrollHeight !== e.clientHeight || e.scrollWidth !== e.clientWidth), r;
297
+ }
315
298
  function qe(e, t) {
316
299
  let o = e;
317
300
  for (xe(o, t) && (o = o.parentElement); o && !xe(o, t); )
318
301
  o = o.parentElement;
319
302
  return o || document.scrollingElement || document.documentElement;
320
303
  }
321
- function xe(e, t) {
322
- let o = window.getComputedStyle(e), r = /(auto|scroll)/.test(o.overflow + o.overflowX + o.overflowY);
323
- return r && t && (r = e.scrollHeight !== e.clientHeight || e.scrollWidth !== e.clientWidth), r;
324
- }
325
304
  function Kt(e) {
326
305
  return e.mozInputSource === 0 && e.isTrusted ? !0 : Ht() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
327
306
  }
307
+ function jt(e, t, o) {
308
+ let [r, n] = V(e || t), l = y(e !== void 0), a = e !== void 0;
309
+ F(() => {
310
+ let i = l.current;
311
+ i !== a && console.warn(`WARN: A component changed from ${i ? "controlled" : "uncontrolled"} to ${a ? "controlled" : "uncontrolled"}.`), l.current = a;
312
+ }, [
313
+ a
314
+ ]);
315
+ let d = a ? e : r, c = x((i, ...s) => {
316
+ let f = (m, ...g) => {
317
+ o && (Object.is(d, m) || o(m, ...g)), a || (d = m);
318
+ };
319
+ typeof i == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), n((g, ...p) => {
320
+ let T = i(a ? d : g, ...p);
321
+ return f(T, ...s), a ? g : T;
322
+ })) : (a || n(i), f(i, ...s));
323
+ }, [
324
+ a,
325
+ d,
326
+ o
327
+ ]);
328
+ return [
329
+ d,
330
+ c
331
+ ];
332
+ }
328
333
  const Re = h.createContext({
329
334
  register: () => {
330
335
  }
331
336
  });
332
337
  Re.displayName = "PressResponderContext";
333
338
  function _t({ children: e }) {
334
- let t = z(() => ({
339
+ let t = q(() => ({
335
340
  register: () => {
336
341
  }
337
342
  }), []);
@@ -339,7 +344,7 @@ function _t({ children: e }) {
339
344
  value: t
340
345
  }, e);
341
346
  }
342
- class jt {
347
+ class Ut {
343
348
  isDefaultPrevented() {
344
349
  return this.nativeEvent.defaultPrevented;
345
350
  }
@@ -358,7 +363,7 @@ class jt {
358
363
  this.nativeEvent = o, this.target = o.target, this.currentTarget = o.currentTarget, this.relatedTarget = o.relatedTarget, this.bubbles = o.bubbles, this.cancelable = o.cancelable, this.defaultPrevented = o.defaultPrevented, this.eventPhase = o.eventPhase, this.isTrusted = o.isTrusted, this.timeStamp = o.timeStamp, this.type = t;
359
364
  }
360
365
  }
361
- function Ut(e) {
366
+ function Gt(e) {
362
367
  let t = y({
363
368
  isFocused: !1,
364
369
  observer: null
@@ -369,14 +374,14 @@ function Ut(e) {
369
374
  r.observer && (r.observer.disconnect(), r.observer = null);
370
375
  };
371
376
  }, []);
372
- let o = R((r) => {
377
+ let o = H((r) => {
373
378
  e == null || e(r);
374
379
  });
375
380
  return x((r) => {
376
381
  if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
377
382
  t.current.isFocused = !0;
378
383
  let n = r.target, l = (a) => {
379
- t.current.isFocused = !1, n.disabled && o(new jt("blur", a)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
384
+ t.current.isFocused = !1, n.disabled && o(new Ut("blur", a)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
380
385
  };
381
386
  n.addEventListener("focusout", l, {
382
387
  once: !0
@@ -384,12 +389,12 @@ function Ut(e) {
384
389
  if (t.current.isFocused && n.disabled) {
385
390
  var a;
386
391
  (a = t.current.observer) === null || a === void 0 || a.disconnect();
387
- let s = n === document.activeElement ? null : document.activeElement;
392
+ let d = n === document.activeElement ? null : document.activeElement;
388
393
  n.dispatchEvent(new FocusEvent("blur", {
389
- relatedTarget: s
394
+ relatedTarget: d
390
395
  })), n.dispatchEvent(new FocusEvent("focusout", {
391
396
  bubbles: !0,
392
- relatedTarget: s
397
+ relatedTarget: d
393
398
  }));
394
399
  }
395
400
  }), t.current.observer.observe(n, {
@@ -403,16 +408,16 @@ function Ut(e) {
403
408
  o
404
409
  ]);
405
410
  }
406
- let K = null, Gt = /* @__PURE__ */ new Set(), q = /* @__PURE__ */ new Map(), N = !1, me = !1;
411
+ let K = null, Xt = /* @__PURE__ */ new Set(), R = /* @__PURE__ */ new Map(), N = !1, me = !1;
407
412
  function be(e, t) {
408
- for (let o of Gt)
413
+ for (let o of Xt)
409
414
  o(e, t);
410
415
  }
411
- function Xt(e) {
416
+ function Jt(e) {
412
417
  return !(e.metaKey || !ze() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
413
418
  }
414
419
  function Q(e) {
415
- N = !0, Xt(e) && (K = "keyboard", be("keyboard", e));
420
+ N = !0, Jt(e) && (K = "keyboard", be("keyboard", e));
416
421
  }
417
422
  function k(e) {
418
423
  K = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (N = !0, be("pointer", e));
@@ -427,53 +432,54 @@ function Ke() {
427
432
  N = !1, me = !0;
428
433
  }
429
434
  function Te(e) {
430
- if (typeof window > "u" || q.get(Y(e)))
435
+ if (typeof window > "u" || R.get(Y(e)))
431
436
  return;
432
437
  const t = Y(e), o = E(e);
433
438
  let r = t.HTMLElement.prototype.focus;
434
439
  t.HTMLElement.prototype.focus = function() {
435
440
  N = !0, r.apply(this, arguments);
436
441
  }, o.addEventListener("keydown", Q, !0), o.addEventListener("keyup", Q, !0), o.addEventListener("click", He, !0), t.addEventListener("focus", Ve, !0), t.addEventListener("blur", Ke, !1), typeof PointerEvent < "u" ? (o.addEventListener("pointerdown", k, !0), o.addEventListener("pointermove", k, !0), o.addEventListener("pointerup", k, !0)) : (o.addEventListener("mousedown", k, !0), o.addEventListener("mousemove", k, !0), o.addEventListener("mouseup", k, !0)), t.addEventListener("beforeunload", () => {
437
- _e(e);
442
+ je(e);
438
443
  }, {
439
444
  once: !0
440
- }), q.set(t, {
445
+ }), R.set(t, {
441
446
  focus: r
442
447
  });
443
448
  }
444
- const _e = (e, t) => {
449
+ const je = (e, t) => {
445
450
  const o = Y(e), r = E(e);
446
- t && r.removeEventListener("DOMContentLoaded", t), q.has(o) && (o.HTMLElement.prototype.focus = q.get(o).focus, r.removeEventListener("keydown", Q, !0), r.removeEventListener("keyup", Q, !0), r.removeEventListener("click", He, !0), o.removeEventListener("focus", Ve, !0), o.removeEventListener("blur", Ke, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", k, !0), r.removeEventListener("pointermove", k, !0), r.removeEventListener("pointerup", k, !0)) : (r.removeEventListener("mousedown", k, !0), r.removeEventListener("mousemove", k, !0), r.removeEventListener("mouseup", k, !0)), q.delete(o));
451
+ t && r.removeEventListener("DOMContentLoaded", t), R.has(o) && (o.HTMLElement.prototype.focus = R.get(o).focus, r.removeEventListener("keydown", Q, !0), r.removeEventListener("keyup", Q, !0), r.removeEventListener("click", He, !0), o.removeEventListener("focus", Ve, !0), o.removeEventListener("blur", Ke, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", k, !0), r.removeEventListener("pointermove", k, !0), r.removeEventListener("pointerup", k, !0)) : (r.removeEventListener("mousedown", k, !0), r.removeEventListener("mousemove", k, !0), r.removeEventListener("mouseup", k, !0)), R.delete(o));
447
452
  };
448
- function Jt(e) {
453
+ function Yt(e) {
449
454
  const t = E(e);
450
455
  let o;
451
456
  return t.readyState !== "loading" ? Te(e) : (o = () => {
452
457
  Te(e);
453
- }, t.addEventListener("DOMContentLoaded", o)), () => _e(e, o);
458
+ }, t.addEventListener("DOMContentLoaded", o)), () => je(e, o);
454
459
  }
455
- typeof document < "u" && Jt();
456
- function Yt() {
460
+ typeof document < "u" && Yt();
461
+ function Qt() {
457
462
  return K;
458
463
  }
459
- function Qt(e) {
464
+ function Zt(e) {
460
465
  let { isDisabled: t, onBlurWithin: o, onFocusWithin: r, onFocusWithinChange: n } = e, l = y({
461
466
  isFocusWithin: !1
462
- }), a = x((d) => {
463
- l.current.isFocusWithin && !d.currentTarget.contains(d.relatedTarget) && (l.current.isFocusWithin = !1, o && o(d), n && n(!1));
467
+ }), a = x((i) => {
468
+ l.current.isFocusWithin && !i.currentTarget.contains(i.relatedTarget) && (l.current.isFocusWithin = !1, o && o(i), n && n(!1));
464
469
  }, [
465
470
  o,
466
471
  n,
467
472
  l
468
- ]), s = Ut(a), c = x((d) => {
469
- !l.current.isFocusWithin && document.activeElement === d.target && (r && r(d), n && n(!0), l.current.isFocusWithin = !0, s(d));
473
+ ]), d = Gt(a), c = x((i) => {
474
+ !l.current.isFocusWithin && document.activeElement === i.target && (r && r(i), n && n(!0), l.current.isFocusWithin = !0, d(i));
470
475
  }, [
471
476
  r,
472
477
  n,
473
- s
478
+ d
474
479
  ]);
475
480
  return t ? {
476
481
  focusWithinProps: {
482
+ // These should not have been null, that would conflict in mergeProps
477
483
  onFocus: void 0,
478
484
  onBlur: void 0
479
485
  }
@@ -484,45 +490,45 @@ function Qt(e) {
484
490
  }
485
491
  };
486
492
  }
487
- function Zt(e) {
493
+ function eo(e) {
488
494
  let { ref: t, onInteractOutside: o, isDisabled: r, onInteractOutsideStart: n } = e, l = y({
489
495
  isPointerDown: !1,
490
496
  ignoreEmulatedMouseEvents: !1
491
- }), a = R((c) => {
492
- o && j(c, t) && (n && n(c), l.current.isPointerDown = !0);
493
- }), s = R((c) => {
497
+ }), a = H((c) => {
498
+ o && _(c, t) && (n && n(c), l.current.isPointerDown = !0);
499
+ }), d = H((c) => {
494
500
  o && o(c);
495
501
  });
496
502
  F(() => {
497
503
  let c = l.current;
498
504
  if (r)
499
505
  return;
500
- const d = t.current, i = E(d);
506
+ const i = t.current, s = E(i);
501
507
  if (typeof PointerEvent < "u") {
502
508
  let f = (m) => {
503
- c.isPointerDown && j(m, t) && s(m), c.isPointerDown = !1;
509
+ c.isPointerDown && _(m, t) && d(m), c.isPointerDown = !1;
504
510
  };
505
- return i.addEventListener("pointerdown", a, !0), i.addEventListener("pointerup", f, !0), () => {
506
- i.removeEventListener("pointerdown", a, !0), i.removeEventListener("pointerup", f, !0);
511
+ return s.addEventListener("pointerdown", a, !0), s.addEventListener("pointerup", f, !0), () => {
512
+ s.removeEventListener("pointerdown", a, !0), s.removeEventListener("pointerup", f, !0);
507
513
  };
508
514
  } else {
509
515
  let f = (g) => {
510
- c.ignoreEmulatedMouseEvents ? c.ignoreEmulatedMouseEvents = !1 : c.isPointerDown && j(g, t) && s(g), c.isPointerDown = !1;
516
+ c.ignoreEmulatedMouseEvents ? c.ignoreEmulatedMouseEvents = !1 : c.isPointerDown && _(g, t) && d(g), c.isPointerDown = !1;
511
517
  }, m = (g) => {
512
- c.ignoreEmulatedMouseEvents = !0, c.isPointerDown && j(g, t) && s(g), c.isPointerDown = !1;
518
+ c.ignoreEmulatedMouseEvents = !0, c.isPointerDown && _(g, t) && d(g), c.isPointerDown = !1;
513
519
  };
514
- return i.addEventListener("mousedown", a, !0), i.addEventListener("mouseup", f, !0), i.addEventListener("touchstart", a, !0), i.addEventListener("touchend", m, !0), () => {
515
- i.removeEventListener("mousedown", a, !0), i.removeEventListener("mouseup", f, !0), i.removeEventListener("touchstart", a, !0), i.removeEventListener("touchend", m, !0);
520
+ return s.addEventListener("mousedown", a, !0), s.addEventListener("mouseup", f, !0), s.addEventListener("touchstart", a, !0), s.addEventListener("touchend", m, !0), () => {
521
+ s.removeEventListener("mousedown", a, !0), s.removeEventListener("mouseup", f, !0), s.removeEventListener("touchstart", a, !0), s.removeEventListener("touchend", m, !0);
516
522
  };
517
523
  }
518
524
  }, [
519
525
  t,
520
526
  r,
521
527
  a,
522
- s
528
+ d
523
529
  ]);
524
530
  }
525
- function j(e, t) {
531
+ function _(e, t) {
526
532
  if (e.button > 0)
527
533
  return !1;
528
534
  if (e.target) {
@@ -534,7 +540,7 @@ function j(e, t) {
534
540
  }
535
541
  function fe(e) {
536
542
  const t = E(e);
537
- if (Yt() === "virtual") {
543
+ if (Qt() === "virtual") {
538
544
  let o = t.activeElement;
539
545
  Vt(() => {
540
546
  t.activeElement === o && e.isConnected && Pe(e);
@@ -542,31 +548,32 @@ function fe(e) {
542
548
  } else
543
549
  Pe(e);
544
550
  }
545
- function eo(e) {
551
+ function to(e) {
546
552
  const t = Y(e);
547
553
  if (!(e instanceof t.HTMLElement) && !(e instanceof t.SVGElement))
548
554
  return !1;
549
555
  let { display: o, visibility: r } = e.style, n = o !== "none" && r !== "hidden" && r !== "collapse";
550
556
  if (n) {
551
557
  const { getComputedStyle: l } = e.ownerDocument.defaultView;
552
- let { display: a, visibility: s } = l(e);
553
- n = a !== "none" && s !== "hidden" && s !== "collapse";
558
+ let { display: a, visibility: d } = l(e);
559
+ n = a !== "none" && d !== "hidden" && d !== "collapse";
554
560
  }
555
561
  return n;
556
562
  }
557
- function to(e, t) {
558
- return !e.hasAttribute("hidden") && (e.nodeName === "DETAILS" && t && t.nodeName !== "SUMMARY" ? e.hasAttribute("open") : !0);
563
+ function oo(e, t) {
564
+ return !e.hasAttribute("hidden") && // Ignore HiddenSelect when tree walking.
565
+ !e.hasAttribute("data-react-aria-prevent-focus") && (e.nodeName === "DETAILS" && t && t.nodeName !== "SUMMARY" ? e.hasAttribute("open") : !0);
559
566
  }
560
- function je(e, t) {
561
- return e.nodeName !== "#comment" && eo(e) && to(e, t) && (!e.parentElement || je(e.parentElement, e));
567
+ function _e(e, t) {
568
+ return e.nodeName !== "#comment" && to(e) && oo(e, t) && (!e.parentElement || _e(e.parentElement, e));
562
569
  }
563
570
  const Se = /* @__PURE__ */ h.createContext(null);
564
571
  let v = null;
565
- function oo(e) {
566
- let { children: t, contain: o, restoreFocus: r, autoFocus: n } = e, l = y(null), a = y(null), s = y([]), { parentNode: c } = V(Se) || {}, d = z(() => new pe({
567
- scopeRef: s
572
+ function ro(e) {
573
+ let { children: t, contain: o, restoreFocus: r, autoFocus: n } = e, l = y(null), a = y(null), d = y([]), { parentNode: c } = W(Se) || {}, i = q(() => new pe({
574
+ scopeRef: d
568
575
  }), [
569
- s
576
+ d
570
577
  ]);
571
578
  w(() => {
572
579
  let m = c || $.root;
@@ -574,12 +581,12 @@ function oo(e) {
574
581
  let g = $.getTreeNode(v);
575
582
  g && (m = g);
576
583
  }
577
- m.addChild(d), $.addNode(d);
584
+ m.addChild(i), $.addNode(i);
578
585
  }, [
579
- d,
586
+ i,
580
587
  c
581
588
  ]), w(() => {
582
- let m = $.getTreeNode(s);
589
+ let m = $.getTreeNode(d);
583
590
  m && (m.contain = !!o);
584
591
  }, [
585
592
  o
@@ -588,32 +595,32 @@ function oo(e) {
588
595
  let g = (m = l.current) === null || m === void 0 ? void 0 : m.nextSibling, p = [];
589
596
  for (; g && g !== a.current; )
590
597
  p.push(g), g = g.nextSibling;
591
- s.current = p;
598
+ d.current = p;
592
599
  }, [
593
600
  t
594
- ]), uo(s, r, o), lo(s, o), mo(s, r, o), so(s, n), F(() => {
595
- const m = E(s.current ? s.current[0] : void 0).activeElement;
601
+ ]), co(d, r, o), io(d, o), fo(d, r, o), uo(d, n), F(() => {
602
+ const m = E(d.current ? d.current[0] : void 0).activeElement;
596
603
  let g = null;
597
- if (M(m, s.current)) {
604
+ if (M(m, d.current)) {
598
605
  for (let p of $.traverse())
599
606
  p.scopeRef && M(m, p.scopeRef.current) && (g = p);
600
- g === $.getTreeNode(s) && (v = g.scopeRef);
607
+ g === $.getTreeNode(d) && (v = g.scopeRef);
601
608
  }
602
609
  }, [
603
- s
610
+ d
604
611
  ]), w(() => () => {
605
612
  var m, g, p;
606
- let T = (p = (g = $.getTreeNode(s)) === null || g === void 0 || (m = g.parent) === null || m === void 0 ? void 0 : m.scopeRef) !== null && p !== void 0 ? p : null;
607
- (s === v || ee(s, v)) && (!T || $.getTreeNode(T)) && (v = T), $.removeTreeNode(s);
613
+ let T = (p = (g = $.getTreeNode(d)) === null || g === void 0 || (m = g.parent) === null || m === void 0 ? void 0 : m.scopeRef) !== null && p !== void 0 ? p : null;
614
+ (d === v || ee(d, v)) && (!T || $.getTreeNode(T)) && (v = T), $.removeTreeNode(d);
608
615
  }, [
609
- s
616
+ d
610
617
  ]);
611
- let i = z(() => ro(s), []), f = z(() => ({
612
- focusManager: i,
613
- parentNode: d
618
+ let s = q(() => no(d), []), f = q(() => ({
619
+ focusManager: s,
620
+ parentNode: i
614
621
  }), [
615
- d,
616
- i
622
+ i,
623
+ s
617
624
  ]);
618
625
  return /* @__PURE__ */ h.createElement(Se.Provider, {
619
626
  value: f
@@ -627,43 +634,43 @@ function oo(e) {
627
634
  ref: a
628
635
  }));
629
636
  }
630
- function ro(e) {
637
+ function no(e) {
631
638
  return {
632
639
  focusNext(t = {}) {
633
- let o = e.current, { from: r, tabbable: n, wrap: l, accept: a } = t, s = r || E(o[0]).activeElement, c = o[0].previousElementSibling, d = C(o), i = B(d, {
640
+ let o = e.current, { from: r, tabbable: n, wrap: l, accept: a } = t, d = r || E(o[0]).activeElement, c = o[0].previousElementSibling, i = B(o), s = C(i, {
634
641
  tabbable: n,
635
642
  accept: a
636
643
  }, o);
637
- i.currentNode = M(s, o) ? s : c;
638
- let f = i.nextNode();
639
- return !f && l && (i.currentNode = c, f = i.nextNode()), f && L(f, !0), f;
644
+ s.currentNode = M(d, o) ? d : c;
645
+ let f = s.nextNode();
646
+ return !f && l && (s.currentNode = c, f = s.nextNode()), f && L(f, !0), f;
640
647
  },
641
648
  focusPrevious(t = {}) {
642
- let o = e.current, { from: r, tabbable: n, wrap: l, accept: a } = t, s = r || E(o[0]).activeElement, c = o[o.length - 1].nextElementSibling, d = C(o), i = B(d, {
649
+ let o = e.current, { from: r, tabbable: n, wrap: l, accept: a } = t, d = r || E(o[0]).activeElement, c = o[o.length - 1].nextElementSibling, i = B(o), s = C(i, {
643
650
  tabbable: n,
644
651
  accept: a
645
652
  }, o);
646
- i.currentNode = M(s, o) ? s : c;
647
- let f = i.previousNode();
648
- return !f && l && (i.currentNode = c, f = i.previousNode()), f && L(f, !0), f;
653
+ s.currentNode = M(d, o) ? d : c;
654
+ let f = s.previousNode();
655
+ return !f && l && (s.currentNode = c, f = s.previousNode()), f && L(f, !0), f;
649
656
  },
650
657
  focusFirst(t = {}) {
651
- let o = e.current, { tabbable: r, accept: n } = t, l = C(o), a = B(l, {
658
+ let o = e.current, { tabbable: r, accept: n } = t, l = B(o), a = C(l, {
652
659
  tabbable: r,
653
660
  accept: n
654
661
  }, o);
655
662
  a.currentNode = o[0].previousElementSibling;
656
- let s = a.nextNode();
657
- return s && L(s, !0), s;
663
+ let d = a.nextNode();
664
+ return d && L(d, !0), d;
658
665
  },
659
666
  focusLast(t = {}) {
660
- let o = e.current, { tabbable: r, accept: n } = t, l = C(o), a = B(l, {
667
+ let o = e.current, { tabbable: r, accept: n } = t, l = B(o), a = C(l, {
661
668
  tabbable: r,
662
669
  accept: n
663
670
  }, o);
664
671
  a.currentNode = o[o.length - 1].nextElementSibling;
665
- let s = a.previousNode();
666
- return s && L(s, !0), s;
672
+ let d = a.previousNode();
673
+ return d && L(d, !0), d;
667
674
  }
668
675
  };
669
676
  }
@@ -681,13 +688,13 @@ const ve = [
681
688
  "audio[controls]",
682
689
  "video[controls]",
683
690
  "[contenteditable]"
684
- ], no = ve.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
691
+ ], ao = ve.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
685
692
  ve.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
686
- const ao = ve.join(':not([hidden]):not([tabindex="-1"]),');
687
- function C(e) {
693
+ const lo = ve.join(':not([hidden]):not([tabindex="-1"]),');
694
+ function B(e) {
688
695
  return e[0].parentElement;
689
696
  }
690
- function I(e) {
697
+ function z(e) {
691
698
  let t = $.getTreeNode(v);
692
699
  for (; t && t.scopeRef !== e; ) {
693
700
  if (t.contain)
@@ -696,7 +703,7 @@ function I(e) {
696
703
  }
697
704
  return !0;
698
705
  }
699
- function lo(e, t) {
706
+ function io(e, t) {
700
707
  let o = y(), r = y();
701
708
  w(() => {
702
709
  let n = e.current;
@@ -705,34 +712,34 @@ function lo(e, t) {
705
712
  return;
706
713
  }
707
714
  const l = E(n ? n[0] : void 0);
708
- let a = (d) => {
709
- if (d.key !== "Tab" || d.altKey || d.ctrlKey || d.metaKey || !I(e))
715
+ let a = (i) => {
716
+ if (i.key !== "Tab" || i.altKey || i.ctrlKey || i.metaKey || !z(e) || i.isComposing)
710
717
  return;
711
- let i = l.activeElement, f = e.current;
712
- if (!f || !M(i, f))
718
+ let s = l.activeElement, f = e.current;
719
+ if (!f || !M(s, f))
713
720
  return;
714
- let m = C(f), g = B(m, {
721
+ let m = B(f), g = C(m, {
715
722
  tabbable: !0
716
723
  }, f);
717
- if (!i)
724
+ if (!s)
718
725
  return;
719
- g.currentNode = i;
720
- let p = d.shiftKey ? g.previousNode() : g.nextNode();
721
- p || (g.currentNode = d.shiftKey ? f[f.length - 1].nextElementSibling : f[0].previousElementSibling, p = d.shiftKey ? g.previousNode() : g.nextNode()), d.preventDefault(), p && L(p, !0);
722
- }, s = (d) => {
723
- (!v || ee(v, e)) && M(d.target, e.current) ? (v = e, o.current = d.target) : I(e) && !Z(d.target, e) ? o.current ? o.current.focus() : v && v.current && te(v.current) : I(e) && (o.current = d.target);
724
- }, c = (d) => {
726
+ g.currentNode = s;
727
+ let p = i.shiftKey ? g.previousNode() : g.nextNode();
728
+ p || (g.currentNode = i.shiftKey ? f[f.length - 1].nextElementSibling : f[0].previousElementSibling, p = i.shiftKey ? g.previousNode() : g.nextNode()), i.preventDefault(), p && L(p, !0);
729
+ }, d = (i) => {
730
+ (!v || ee(v, e)) && M(i.target, e.current) ? (v = e, o.current = i.target) : z(e) && !Z(i.target, e) ? o.current ? o.current.focus() : v && v.current && te(v.current) : z(e) && (o.current = i.target);
731
+ }, c = (i) => {
725
732
  r.current && cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
726
- if (l.activeElement && I(e) && !Z(l.activeElement, e))
727
- if (v = e, l.body.contains(d.target)) {
728
- var i;
729
- o.current = d.target, (i = o.current) === null || i === void 0 || i.focus();
733
+ if (l.activeElement && z(e) && !Z(l.activeElement, e))
734
+ if (v = e, l.body.contains(i.target)) {
735
+ var s;
736
+ o.current = i.target, (s = o.current) === null || s === void 0 || s.focus();
730
737
  } else
731
738
  v.current && te(v.current);
732
739
  });
733
740
  };
734
- return l.addEventListener("keydown", a, !1), l.addEventListener("focusin", s, !1), n == null || n.forEach((d) => d.addEventListener("focusin", s, !1)), n == null || n.forEach((d) => d.addEventListener("focusout", c, !1)), () => {
735
- l.removeEventListener("keydown", a, !1), l.removeEventListener("focusin", s, !1), n == null || n.forEach((d) => d.removeEventListener("focusin", s, !1)), n == null || n.forEach((d) => d.removeEventListener("focusout", c, !1));
741
+ return l.addEventListener("keydown", a, !1), l.addEventListener("focusin", d, !1), n == null || n.forEach((i) => i.addEventListener("focusin", d, !1)), n == null || n.forEach((i) => i.addEventListener("focusout", c, !1)), () => {
742
+ l.removeEventListener("keydown", a, !1), l.removeEventListener("focusin", d, !1), n == null || n.forEach((i) => i.removeEventListener("focusin", d, !1)), n == null || n.forEach((i) => i.removeEventListener("focusout", c, !1));
736
743
  };
737
744
  }, [
738
745
  e,
@@ -757,7 +764,7 @@ function Z(e, t = null) {
757
764
  return !0;
758
765
  return !1;
759
766
  }
760
- function io(e) {
767
+ function so(e) {
761
768
  return Z(e, v);
762
769
  }
763
770
  function ee(e, t) {
@@ -783,16 +790,16 @@ function L(e, t = !1) {
783
790
  }
784
791
  }
785
792
  function te(e, t = !0) {
786
- let o = e[0].previousElementSibling, r = C(e), n = B(r, {
793
+ let o = e[0].previousElementSibling, r = B(e), n = C(r, {
787
794
  tabbable: t
788
795
  }, e);
789
796
  n.currentNode = o;
790
797
  let l = n.nextNode();
791
- t && !l && (r = C(e), n = B(r, {
798
+ t && !l && (r = B(e), n = C(r, {
792
799
  tabbable: !1
793
800
  }, e), n.currentNode = o, l = n.nextNode()), L(l);
794
801
  }
795
- function so(e, t) {
802
+ function uo(e, t) {
796
803
  const o = h.useRef(t);
797
804
  F(() => {
798
805
  if (o.current) {
@@ -805,15 +812,15 @@ function so(e, t) {
805
812
  e
806
813
  ]);
807
814
  }
808
- function uo(e, t, o) {
815
+ function co(e, t, o) {
809
816
  w(() => {
810
817
  if (t || o)
811
818
  return;
812
819
  let r = e.current;
813
820
  const n = E(r ? r[0] : void 0);
814
821
  let l = (a) => {
815
- let s = a.target;
816
- M(s, e.current) ? v = e : Ue(s) || (v = null);
822
+ let d = a.target;
823
+ M(d, e.current) ? v = e : Ue(d) || (v = null);
817
824
  };
818
825
  return n.addEventListener("focusin", l, !1), r == null || r.forEach((a) => a.addEventListener("focusin", l, !1)), () => {
819
826
  n.removeEventListener("focusin", l, !1), r == null || r.forEach((a) => a.removeEventListener("focusin", l, !1));
@@ -824,7 +831,7 @@ function uo(e, t, o) {
824
831
  o
825
832
  ]);
826
833
  }
827
- function co(e) {
834
+ function mo(e) {
828
835
  let t = $.getTreeNode(v);
829
836
  for (; t && t.scopeRef !== e; ) {
830
837
  if (t.nodeToRestore)
@@ -833,7 +840,7 @@ function co(e) {
833
840
  }
834
841
  return (t == null ? void 0 : t.scopeRef) === e;
835
842
  }
836
- function mo(e, t, o) {
843
+ function fo(e, t, o) {
837
844
  const r = y(typeof document < "u" ? E(e.current ? e.current[0] : void 0).activeElement : null);
838
845
  w(() => {
839
846
  let n = e.current;
@@ -843,8 +850,8 @@ function mo(e, t, o) {
843
850
  let a = () => {
844
851
  (!v || ee(v, e)) && M(l.activeElement, e.current) && (v = e);
845
852
  };
846
- return l.addEventListener("focusin", a, !1), n == null || n.forEach((s) => s.addEventListener("focusin", a, !1)), () => {
847
- l.removeEventListener("focusin", a, !1), n == null || n.forEach((s) => s.removeEventListener("focusin", a, !1));
853
+ return l.addEventListener("focusin", a, !1), n == null || n.forEach((d) => d.addEventListener("focusin", a, !1)), () => {
854
+ l.removeEventListener("focusin", a, !1), n == null || n.forEach((d) => d.removeEventListener("focusin", a, !1));
848
855
  };
849
856
  }, [
850
857
  e,
@@ -854,25 +861,25 @@ function mo(e, t, o) {
854
861
  if (!t)
855
862
  return;
856
863
  let l = (a) => {
857
- if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey || !I(e))
864
+ if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey || !z(e) || a.isComposing)
858
865
  return;
859
- let s = n.activeElement;
860
- if (!M(s, e.current))
866
+ let d = n.activeElement;
867
+ if (!M(d, e.current))
861
868
  return;
862
869
  let c = $.getTreeNode(e);
863
870
  if (!c)
864
871
  return;
865
- let d = c.nodeToRestore, i = B(n.body, {
872
+ let i = c.nodeToRestore, s = C(n.body, {
866
873
  tabbable: !0
867
874
  });
868
- i.currentNode = s;
869
- let f = a.shiftKey ? i.previousNode() : i.nextNode();
870
- if ((!d || !n.body.contains(d) || d === n.body) && (d = void 0, c.nodeToRestore = void 0), (!f || !M(f, e.current)) && d) {
871
- i.currentNode = d;
875
+ s.currentNode = d;
876
+ let f = a.shiftKey ? s.previousNode() : s.nextNode();
877
+ if ((!i || !n.body.contains(i) || i === n.body) && (i = void 0, c.nodeToRestore = void 0), (!f || !M(f, e.current)) && i) {
878
+ s.currentNode = i;
872
879
  do
873
- f = a.shiftKey ? i.previousNode() : i.nextNode();
880
+ f = a.shiftKey ? s.previousNode() : s.nextNode();
874
881
  while (M(f, e.current));
875
- a.preventDefault(), a.stopPropagation(), f ? L(f, !0) : Ue(d) ? L(d, !0) : s.blur();
882
+ a.preventDefault(), a.stopPropagation(), f ? L(f, !0) : Ue(i) ? L(i, !0) : d.blur();
876
883
  }
877
884
  };
878
885
  return o || n.addEventListener("keydown", l, !0), () => {
@@ -887,31 +894,32 @@ function mo(e, t, o) {
887
894
  if (!t)
888
895
  return;
889
896
  let l = $.getTreeNode(e);
890
- if (!!l) {
897
+ if (l) {
891
898
  var a;
892
899
  return l.nodeToRestore = (a = r.current) !== null && a !== void 0 ? a : void 0, () => {
893
- let s = $.getTreeNode(e);
894
- if (!s)
900
+ let d = $.getTreeNode(e);
901
+ if (!d)
895
902
  return;
896
- let c = s.nodeToRestore;
897
- if (t && c && (M(n.activeElement, e.current) || n.activeElement === n.body && co(e))) {
898
- let d = $.clone();
903
+ let c = d.nodeToRestore;
904
+ if (t && c && // eslint-disable-next-line react-hooks/exhaustive-deps
905
+ (M(n.activeElement, e.current) || n.activeElement === n.body && mo(e))) {
906
+ let i = $.clone();
899
907
  requestAnimationFrame(() => {
900
908
  if (n.activeElement === n.body) {
901
- let i = d.getTreeNode(e);
902
- for (; i; ) {
903
- if (i.nodeToRestore && i.nodeToRestore.isConnected) {
904
- L(i.nodeToRestore);
909
+ let s = i.getTreeNode(e);
910
+ for (; s; ) {
911
+ if (s.nodeToRestore && s.nodeToRestore.isConnected) {
912
+ L(s.nodeToRestore);
905
913
  return;
906
914
  }
907
- i = i.parent;
915
+ s = s.parent;
908
916
  }
909
- for (i = d.getTreeNode(e); i; ) {
910
- if (i.scopeRef && i.scopeRef.current && $.getTreeNode(i.scopeRef)) {
911
- te(i.scopeRef.current, !0);
917
+ for (s = i.getTreeNode(e); s; ) {
918
+ if (s.scopeRef && s.scopeRef.current && $.getTreeNode(s.scopeRef)) {
919
+ te(s.scopeRef.current, !0);
912
920
  return;
913
921
  }
914
- i = i.parent;
922
+ s = s.parent;
915
923
  }
916
924
  }
917
925
  });
@@ -923,11 +931,11 @@ function mo(e, t, o) {
923
931
  t
924
932
  ]);
925
933
  }
926
- function B(e, t, o) {
927
- let r = t != null && t.tabbable ? ao : no, n = E(e).createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
934
+ function C(e, t, o) {
935
+ let r = t != null && t.tabbable ? lo : ao, n = E(e).createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
928
936
  acceptNode(l) {
929
937
  var a;
930
- return !(t == null || (a = t.from) === null || a === void 0) && a.contains(l) ? NodeFilter.FILTER_REJECT : l.matches(r) && je(l) && (!o || M(l, o)) && (!(t != null && t.accept) || t.accept(l)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
938
+ return !(t == null || (a = t.from) === null || a === void 0) && a.contains(l) ? NodeFilter.FILTER_REJECT : l.matches(r) && _e(l) && (!o || M(l, o)) && (!(t != null && t.accept) || t.accept(l)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
931
939
  }
932
940
  });
933
941
  return t != null && t.from && (n.currentNode = t.from), n;
@@ -940,7 +948,7 @@ class $e {
940
948
  return this.fastMap.get(t);
941
949
  }
942
950
  addTreeNode(t, o, r) {
943
- let n = this.fastMap.get(o != null ? o : null);
951
+ let n = this.fastMap.get(o ?? null);
944
952
  if (!n)
945
953
  return;
946
954
  let l = new pe({
@@ -963,6 +971,7 @@ class $e {
963
971
  let n = o.children;
964
972
  r && (r.removeChild(o), n.size > 0 && n.forEach((l) => r && r.addChild(l))), this.fastMap.delete(o.scopeRef);
965
973
  }
974
+ // Pre Order Depth First
966
975
  *traverse(t = this.root) {
967
976
  if (t.scopeRef != null && (yield t), t.children.size > 0)
968
977
  for (let o of t.children)
@@ -994,9 +1003,9 @@ class pe {
994
1003
  }
995
1004
  }
996
1005
  let $ = new $e();
997
- const fo = /* @__PURE__ */ new WeakMap(), S = [];
998
- function po(e, t) {
999
- let { onClose: o, shouldCloseOnBlur: r, isOpen: n, isDismissable: l = !1, isKeyboardDismissDisabled: a = !1, shouldCloseOnInteractOutside: s } = e;
1006
+ const po = /* @__PURE__ */ new WeakMap(), S = [];
1007
+ function go(e, t) {
1008
+ let { onClose: o, shouldCloseOnBlur: r, isOpen: n, isDismissable: l = !1, isKeyboardDismissDisabled: a = !1, shouldCloseOnInteractOutside: d } = e;
1000
1009
  F(() => (n && S.push(t), () => {
1001
1010
  let p = S.indexOf(t);
1002
1011
  p >= 0 && S.splice(p, 1);
@@ -1006,22 +1015,22 @@ function po(e, t) {
1006
1015
  ]);
1007
1016
  let c = () => {
1008
1017
  S[S.length - 1] === t && o && o();
1009
- }, d = (p) => {
1010
- (!s || s(p.target)) && S[S.length - 1] === t && (p.stopPropagation(), p.preventDefault());
1011
1018
  }, i = (p) => {
1012
- (!s || s(p.target)) && (S[S.length - 1] === t && (p.stopPropagation(), p.preventDefault()), c());
1019
+ (!d || d(p.target)) && S[S.length - 1] === t && (p.stopPropagation(), p.preventDefault());
1020
+ }, s = (p) => {
1021
+ (!d || d(p.target)) && (S[S.length - 1] === t && (p.stopPropagation(), p.preventDefault()), c());
1013
1022
  }, f = (p) => {
1014
- p.key === "Escape" && !a && (p.stopPropagation(), p.preventDefault(), c());
1023
+ p.key === "Escape" && !a && !p.nativeEvent.isComposing && (p.stopPropagation(), p.preventDefault(), c());
1015
1024
  };
1016
- Zt({
1025
+ eo({
1017
1026
  ref: t,
1018
- onInteractOutside: l && n ? i : null,
1019
- onInteractOutsideStart: d
1027
+ onInteractOutside: l && n ? s : null,
1028
+ onInteractOutsideStart: i
1020
1029
  });
1021
- let { focusWithinProps: m } = Qt({
1030
+ let { focusWithinProps: m } = Zt({
1022
1031
  isDisabled: !r,
1023
1032
  onBlurWithin: (p) => {
1024
- !p.relatedTarget || io(p.relatedTarget) || (!s || s(p.relatedTarget)) && o();
1033
+ !p.relatedTarget || so(p.relatedTarget) || (!d || d(p.relatedTarget)) && o();
1025
1034
  }
1026
1035
  }), g = (p) => {
1027
1036
  p.target === p.currentTarget && p.preventDefault();
@@ -1036,14 +1045,14 @@ function po(e, t) {
1036
1045
  }
1037
1046
  };
1038
1047
  }
1039
- function go(e, t, o) {
1048
+ function bo(e, t, o) {
1040
1049
  let { type: r } = e, { isOpen: n } = t;
1041
1050
  F(() => {
1042
- o && o.current && fo.set(o.current, t.close);
1051
+ o && o.current && po.set(o.current, t.close);
1043
1052
  });
1044
1053
  let l;
1045
1054
  r === "menu" ? l = !0 : r === "listbox" && (l = "listbox");
1046
- let a = Ie();
1055
+ let a = Ae();
1047
1056
  return {
1048
1057
  triggerProps: {
1049
1058
  "aria-haspopup": l,
@@ -1056,7 +1065,7 @@ function go(e, t, o) {
1056
1065
  }
1057
1066
  };
1058
1067
  }
1059
- const se = typeof document < "u" && window.visualViewport, bo = /* @__PURE__ */ new Set([
1068
+ const se = typeof document < "u" && window.visualViewport, vo = /* @__PURE__ */ new Set([
1060
1069
  "checkbox",
1061
1070
  "radio",
1062
1071
  "range",
@@ -1068,62 +1077,62 @@ const se = typeof document < "u" && window.visualViewport, bo = /* @__PURE__ */
1068
1077
  "reset"
1069
1078
  ]);
1070
1079
  let U = 0, de;
1071
- function vo(e = {}) {
1080
+ function $o(e = {}) {
1072
1081
  let { isDisabled: t } = e;
1073
1082
  w(() => {
1074
1083
  if (!t)
1075
- return U++, U === 1 && (Rt() ? de = ho() : de = $o()), () => {
1084
+ return U++, U === 1 && (Rt() ? de = wo() : de = ho()), () => {
1076
1085
  U--, U === 0 && de();
1077
1086
  };
1078
1087
  }, [
1079
1088
  t
1080
1089
  ]);
1081
1090
  }
1082
- function $o() {
1091
+ function ho() {
1083
1092
  return J(D(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), D(document.documentElement, "overflow", "hidden"));
1084
1093
  }
1085
- function ho() {
1086
- let e, t, o = (d) => {
1087
- e = qe(d.target, !0), !(e === document.documentElement && e === document.body) && e instanceof HTMLElement && window.getComputedStyle(e).overscrollBehavior === "auto" && (t = D(e, "overscrollBehavior", "contain"));
1088
- }, r = (d) => {
1094
+ function wo() {
1095
+ let e, t, o = (i) => {
1096
+ e = qe(i.target, !0), !(e === document.documentElement && e === document.body) && e instanceof HTMLElement && window.getComputedStyle(e).overscrollBehavior === "auto" && (t = D(e, "overscrollBehavior", "contain"));
1097
+ }, r = (i) => {
1089
1098
  if (!e || e === document.documentElement || e === document.body) {
1090
- d.preventDefault();
1099
+ i.preventDefault();
1091
1100
  return;
1092
1101
  }
1093
- e.scrollHeight === e.clientHeight && e.scrollWidth === e.clientWidth && d.preventDefault();
1094
- }, n = (d) => {
1095
- let i = d.target;
1096
- Fe(i) && i !== document.activeElement && (d.preventDefault(), s(), i.style.transform = "translateY(-2000px)", i.focus(), requestAnimationFrame(() => {
1097
- i.style.transform = "";
1102
+ e.scrollHeight === e.clientHeight && e.scrollWidth === e.clientWidth && i.preventDefault();
1103
+ }, n = (i) => {
1104
+ let s = i.target;
1105
+ Fe(s) && s !== document.activeElement && (i.preventDefault(), d(), s.style.transform = "translateY(-2000px)", s.focus(), requestAnimationFrame(() => {
1106
+ s.style.transform = "";
1098
1107
  })), t && t();
1099
- }, l = (d) => {
1100
- let i = d.target;
1101
- Fe(i) && (s(), i.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
1102
- i.style.transform = "", se && (se.height < window.innerHeight ? requestAnimationFrame(() => {
1103
- Le(i);
1104
- }) : se.addEventListener("resize", () => Le(i), {
1108
+ }, l = (i) => {
1109
+ let s = i.target;
1110
+ Fe(s) && (d(), s.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
1111
+ s.style.transform = "", se && (se.height < window.innerHeight ? requestAnimationFrame(() => {
1112
+ Le(s);
1113
+ }) : se.addEventListener("resize", () => Le(s), {
1105
1114
  once: !0
1106
1115
  }));
1107
1116
  }));
1108
- }, a = null, s = () => {
1117
+ }, a = null, d = () => {
1109
1118
  if (a)
1110
1119
  return;
1111
- let d = () => {
1120
+ let i = () => {
1112
1121
  window.scrollTo(0, 0);
1113
- }, i = window.pageXOffset, f = window.pageYOffset;
1114
- a = J(W(window, "scroll", d), D(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), D(document.documentElement, "overflow", "hidden"), D(document.body, "marginTop", `-${f}px`), () => {
1115
- window.scrollTo(i, f);
1122
+ }, s = window.pageXOffset, f = window.pageYOffset;
1123
+ a = J(A(window, "scroll", i), D(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), D(document.documentElement, "overflow", "hidden"), D(document.body, "marginTop", `-${f}px`), () => {
1124
+ window.scrollTo(s, f);
1116
1125
  }), window.scrollTo(0, 0);
1117
- }, c = J(W(document, "touchstart", o, {
1126
+ }, c = J(A(document, "touchstart", o, {
1118
1127
  passive: !1,
1119
1128
  capture: !0
1120
- }), W(document, "touchmove", r, {
1129
+ }), A(document, "touchmove", r, {
1121
1130
  passive: !1,
1122
1131
  capture: !0
1123
- }), W(document, "touchend", n, {
1132
+ }), A(document, "touchend", n, {
1124
1133
  passive: !1,
1125
1134
  capture: !0
1126
- }), W(document, "focus", l, !0));
1135
+ }), A(document, "focus", l, !0));
1127
1136
  return () => {
1128
1137
  t == null || t(), a == null || a(), c();
1129
1138
  };
@@ -1134,7 +1143,7 @@ function D(e, t, o) {
1134
1143
  e.style[t] = r;
1135
1144
  };
1136
1145
  }
1137
- function W(e, t, o, r) {
1146
+ function A(e, t, o, r) {
1138
1147
  return e.addEventListener(t, o, r), () => {
1139
1148
  e.removeEventListener(t, o, r);
1140
1149
  };
@@ -1151,51 +1160,51 @@ function Le(e) {
1151
1160
  }
1152
1161
  }
1153
1162
  function Fe(e) {
1154
- return e instanceof HTMLInputElement && !bo.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
1163
+ return e instanceof HTMLInputElement && !vo.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
1155
1164
  }
1156
- let A = /* @__PURE__ */ new WeakMap(), P = [];
1157
- function wo(e, t = document.body) {
1165
+ let I = /* @__PURE__ */ new WeakMap(), P = [];
1166
+ function Eo(e, t = document.body) {
1158
1167
  let o = new Set(e), r = /* @__PURE__ */ new Set(), n = (c) => {
1159
1168
  for (let m of c.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))
1160
1169
  o.add(m);
1161
- let d = (m) => {
1170
+ let i = (m) => {
1162
1171
  if (o.has(m) || r.has(m.parentElement) && m.parentElement.getAttribute("role") !== "row")
1163
1172
  return NodeFilter.FILTER_REJECT;
1164
1173
  for (let g of o)
1165
1174
  if (m.contains(g))
1166
1175
  return NodeFilter.FILTER_SKIP;
1167
1176
  return NodeFilter.FILTER_ACCEPT;
1168
- }, i = document.createTreeWalker(c, NodeFilter.SHOW_ELEMENT, {
1169
- acceptNode: d
1170
- }), f = d(c);
1177
+ }, s = document.createTreeWalker(c, NodeFilter.SHOW_ELEMENT, {
1178
+ acceptNode: i
1179
+ }), f = i(c);
1171
1180
  if (f === NodeFilter.FILTER_ACCEPT && l(c), f !== NodeFilter.FILTER_REJECT) {
1172
- let m = i.nextNode();
1181
+ let m = s.nextNode();
1173
1182
  for (; m != null; )
1174
- l(m), m = i.nextNode();
1183
+ l(m), m = s.nextNode();
1175
1184
  }
1176
1185
  }, l = (c) => {
1177
- var d;
1178
- let i = (d = A.get(c)) !== null && d !== void 0 ? d : 0;
1179
- c.getAttribute("aria-hidden") === "true" && i === 0 || (i === 0 && c.setAttribute("aria-hidden", "true"), r.add(c), A.set(c, i + 1));
1186
+ var i;
1187
+ let s = (i = I.get(c)) !== null && i !== void 0 ? i : 0;
1188
+ c.getAttribute("aria-hidden") === "true" && s === 0 || (s === 0 && c.setAttribute("aria-hidden", "true"), r.add(c), I.set(c, s + 1));
1180
1189
  };
1181
1190
  P.length && P[P.length - 1].disconnect(), n(t);
1182
1191
  let a = new MutationObserver((c) => {
1183
- for (let d of c)
1184
- if (!(d.type !== "childList" || d.addedNodes.length === 0) && ![
1192
+ for (let i of c)
1193
+ if (!(i.type !== "childList" || i.addedNodes.length === 0) && ![
1185
1194
  ...o,
1186
1195
  ...r
1187
- ].some((i) => i.contains(d.target))) {
1188
- for (let i of d.removedNodes)
1189
- i instanceof Element && (o.delete(i), r.delete(i));
1190
- for (let i of d.addedNodes)
1191
- (i instanceof HTMLElement || i instanceof SVGElement) && (i.dataset.liveAnnouncer === "true" || i.dataset.reactAriaTopLayer === "true") ? o.add(i) : i instanceof Element && n(i);
1196
+ ].some((s) => s.contains(i.target))) {
1197
+ for (let s of i.removedNodes)
1198
+ s instanceof Element && (o.delete(s), r.delete(s));
1199
+ for (let s of i.addedNodes)
1200
+ (s instanceof HTMLElement || s instanceof SVGElement) && (s.dataset.liveAnnouncer === "true" || s.dataset.reactAriaTopLayer === "true") ? o.add(s) : s instanceof Element && n(s);
1192
1201
  }
1193
1202
  });
1194
1203
  a.observe(t, {
1195
1204
  childList: !0,
1196
1205
  subtree: !0
1197
1206
  });
1198
- let s = {
1207
+ let d = {
1199
1208
  observe() {
1200
1209
  a.observe(t, {
1201
1210
  childList: !0,
@@ -1206,53 +1215,58 @@ function wo(e, t = document.body) {
1206
1215
  a.disconnect();
1207
1216
  }
1208
1217
  };
1209
- return P.push(s), () => {
1218
+ return P.push(d), () => {
1210
1219
  a.disconnect();
1211
1220
  for (let c of r) {
1212
- let d = A.get(c);
1213
- d === 1 ? (c.removeAttribute("aria-hidden"), A.delete(c)) : A.set(c, d - 1);
1221
+ let i = I.get(c);
1222
+ i === 1 ? (c.removeAttribute("aria-hidden"), I.delete(c)) : I.set(c, i - 1);
1214
1223
  }
1215
- s === P[P.length - 1] ? (P.pop(), P.length && P[P.length - 1].observe()) : P.splice(P.indexOf(s), 1);
1224
+ d === P[P.length - 1] ? (P.pop(), P.length && P[P.length - 1].observe()) : P.splice(P.indexOf(d), 1);
1216
1225
  };
1217
1226
  }
1227
+ const Mo = /* @__PURE__ */ ft({});
1228
+ function yo() {
1229
+ var e;
1230
+ return (e = W(Mo)) !== null && e !== void 0 ? e : {};
1231
+ }
1218
1232
  const Ge = /* @__PURE__ */ h.createContext(null);
1219
- function Eo(e) {
1220
- let t = We(), { portalContainer: o = t ? null : document.body, isExiting: r } = e, [n, l] = H(!1), a = z(() => ({
1233
+ function Po(e) {
1234
+ let t = We(), { portalContainer: o = t ? null : document.body, isExiting: r } = e, [n, l] = V(!1), a = q(() => ({
1221
1235
  contain: n,
1222
1236
  setContain: l
1223
1237
  }), [
1224
1238
  n,
1225
1239
  l
1226
- ]);
1227
- if (!o)
1240
+ ]), { getContainer: d } = yo();
1241
+ if (!e.portalContainer && d && (o = d()), !o)
1228
1242
  return null;
1229
- let s = e.children;
1230
- return e.disableFocusManagement || (s = /* @__PURE__ */ h.createElement(oo, {
1243
+ let c = e.children;
1244
+ return e.disableFocusManagement || (c = /* @__PURE__ */ h.createElement(ro, {
1231
1245
  restoreFocus: !0,
1232
1246
  contain: n && !r
1233
- }, s)), s = /* @__PURE__ */ h.createElement(Ge.Provider, {
1247
+ }, c)), c = /* @__PURE__ */ h.createElement(Ge.Provider, {
1234
1248
  value: a
1235
- }, /* @__PURE__ */ h.createElement(_t, null, s)), /* @__PURE__ */ ft.createPortal(s, o);
1249
+ }, /* @__PURE__ */ h.createElement(_t, null, c)), /* @__PURE__ */ pt.createPortal(c, o);
1236
1250
  }
1237
1251
  function Xe() {
1238
- let e = V(Ge), t = e == null ? void 0 : e.setContain;
1252
+ let e = W(Ge), t = e == null ? void 0 : e.setContain;
1239
1253
  w(() => {
1240
1254
  t == null || t(!0);
1241
1255
  }, [
1242
1256
  t
1243
1257
  ]);
1244
1258
  }
1245
- function Mo(e, t, o) {
1246
- let { overlayProps: r, underlayProps: n } = po({
1259
+ function ko(e, t, o) {
1260
+ let { overlayProps: r, underlayProps: n } = go({
1247
1261
  ...e,
1248
1262
  isOpen: t.isOpen,
1249
1263
  onClose: t.close
1250
1264
  }, o);
1251
- return vo({
1265
+ return $o({
1252
1266
  isDisabled: !t.isOpen
1253
1267
  }), Xe(), F(() => {
1254
1268
  if (t.isOpen)
1255
- return wo([
1269
+ return Eo([
1256
1270
  o.current
1257
1271
  ]);
1258
1272
  }, [
@@ -1263,8 +1277,8 @@ function Mo(e, t, o) {
1263
1277
  underlayProps: n
1264
1278
  };
1265
1279
  }
1266
- function yo(e, t) {
1267
- let { role: o = "dialog" } = e, r = St();
1280
+ function xo(e, t) {
1281
+ let { role: o = "dialog" } = e, r = Tt();
1268
1282
  r = e["aria-label"] ? void 0 : r;
1269
1283
  let n = y(!1);
1270
1284
  return F(() => {
@@ -1287,6 +1301,9 @@ function yo(e, t) {
1287
1301
  role: o,
1288
1302
  tabIndex: -1,
1289
1303
  "aria-labelledby": e["aria-labelledby"] || r,
1304
+ // Prevent blur events from reaching useOverlay, which may cause
1305
+ // popovers to close. Since focus is contained within the dialog,
1306
+ // we don't want this to occur due to the above useEffect.
1290
1307
  onBlur: (l) => {
1291
1308
  n.current && l.stopPropagation();
1292
1309
  }
@@ -1296,7 +1313,7 @@ function yo(e, t) {
1296
1313
  }
1297
1314
  };
1298
1315
  }
1299
- function Po(e, t, o) {
1316
+ function To(e, t, o) {
1300
1317
  return t in e ? Object.defineProperty(e, t, {
1301
1318
  value: o,
1302
1319
  enumerable: !0,
@@ -1304,7 +1321,7 @@ function Po(e, t, o) {
1304
1321
  writable: !0
1305
1322
  }) : e[t] = o, e;
1306
1323
  }
1307
- function Be(e, t) {
1324
+ function Ce(e, t) {
1308
1325
  var o = Object.keys(e);
1309
1326
  if (Object.getOwnPropertySymbols) {
1310
1327
  var r = Object.getOwnPropertySymbols(e);
@@ -1314,18 +1331,18 @@ function Be(e, t) {
1314
1331
  }
1315
1332
  return o;
1316
1333
  }
1317
- function Ce(e) {
1334
+ function Be(e) {
1318
1335
  for (var t = 1; t < arguments.length; t++) {
1319
1336
  var o = arguments[t] != null ? arguments[t] : {};
1320
- t % 2 ? Be(Object(o), !0).forEach(function(r) {
1321
- Po(e, r, o[r]);
1322
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : Be(Object(o)).forEach(function(r) {
1337
+ t % 2 ? Ce(Object(o), !0).forEach(function(r) {
1338
+ To(e, r, o[r]);
1339
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : Ce(Object(o)).forEach(function(r) {
1323
1340
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(o, r));
1324
1341
  });
1325
1342
  }
1326
1343
  return e;
1327
1344
  }
1328
- var ko = (e, t, o) => {
1345
+ var So = (e, t, o) => {
1329
1346
  for (var r of Object.keys(e)) {
1330
1347
  var n;
1331
1348
  if (e[r] !== ((n = t[r]) !== null && n !== void 0 ? n : o[r]))
@@ -1333,20 +1350,23 @@ var ko = (e, t, o) => {
1333
1350
  }
1334
1351
  return !0;
1335
1352
  }, Je = (e) => (t) => {
1336
- var o = e.defaultClassName, r = Ce(Ce({}, e.defaultVariants), t);
1353
+ var o = e.defaultClassName, r = Be(Be({}, e.defaultVariants), t);
1337
1354
  for (var n in r) {
1338
1355
  var l, a = (l = r[n]) !== null && l !== void 0 ? l : e.defaultVariants[n];
1339
1356
  if (a != null) {
1340
- var s = a;
1341
- typeof s == "boolean" && (s = s === !0 ? "true" : "false");
1342
- var c = e.variantClassNames[n][s];
1357
+ var d = a;
1358
+ typeof d == "boolean" && (d = d === !0 ? "true" : "false");
1359
+ var c = (
1360
+ // @ts-expect-error
1361
+ e.variantClassNames[n][d]
1362
+ );
1343
1363
  c && (o += " " + c);
1344
1364
  }
1345
1365
  }
1346
- for (var [d, i] of e.compoundVariants)
1347
- ko(d, r, e.defaultVariants) && (o += " " + i);
1366
+ for (var [i, s] of e.compoundVariants)
1367
+ So(i, r, e.defaultVariants) && (o += " " + s);
1348
1368
  return o;
1349
- }, xo = "_3moto2o", To = "_3moto2q", So = "_3moto2r", Ye = "_3moto2p", Lo = Je({ defaultClassName: "_3moto20", variantClassNames: { kind: { informational: "_3moto21", delete: "_3moto22", failure: "_3moto23", success: "_3moto24", warning: "_3moto25", successWithFailures: "_3moto26", form: "_3moto27" }, size: { sm: "_3moto28", md: "_3moto29", lg: "_3moto2a", xl: "_3moto2b" }, fullHeight: { true: "_3moto2c", false: "_3moto2d" } }, defaultVariants: {}, compoundVariants: [] }), Fo = "_3moto2n", Bo = Je({ defaultClassName: "_3moto2e", variantClassNames: { kind: { form: "_3moto2f", delete: "_3moto2g", failure: "_3moto2h", informational: "_3moto2i", success: "_3moto2j", warning: "_3moto2k", successWithFailures: "_3moto2l" } }, defaultVariants: {}, compoundVariants: [] }), Co = "_3moto2m", No = "_3moto2s";
1369
+ }, Lo = "_3moto2o", Fo = "_3moto2q", Co = "_3moto2r", Ye = "_3moto2p", Bo = Je({ defaultClassName: "_3moto20", variantClassNames: { kind: { informational: "_3moto21", delete: "_3moto22", failure: "_3moto23", success: "_3moto24", warning: "_3moto25", successWithFailures: "_3moto26", form: "_3moto27" }, size: { sm: "_3moto28", md: "_3moto29", lg: "_3moto2a", xl: "_3moto2b" }, fullHeight: { true: "_3moto2c", false: "_3moto2d" } }, defaultVariants: {}, compoundVariants: [] }), No = "_3moto2n", Oo = Je({ defaultClassName: "_3moto2e", variantClassNames: { kind: { form: "_3moto2f", delete: "_3moto2g", failure: "_3moto2h", informational: "_3moto2i", success: "_3moto2j", warning: "_3moto2k", successWithFailures: "_3moto2l" } }, defaultVariants: {}, compoundVariants: [] }), Do = "_3moto2m", Wo = "_3moto2s";
1350
1370
  function Qe({
1351
1371
  children: e,
1352
1372
  className: t = "",
@@ -1364,7 +1384,7 @@ const Ne = Object.freeze({
1364
1384
  successWithFailures: "status-warning",
1365
1385
  warning: "status-warning"
1366
1386
  });
1367
- function Oo({
1387
+ function Ao({
1368
1388
  children: e,
1369
1389
  className: t,
1370
1390
  "data-testid": o,
@@ -1372,23 +1392,23 @@ function Oo({
1372
1392
  onBlur: n,
1373
1393
  onFocus: l,
1374
1394
  overlayProps: a,
1375
- size: s = "sm",
1395
+ size: d = "sm",
1376
1396
  state: c,
1377
- title: d,
1378
- dismissible: i,
1397
+ title: i,
1398
+ dismissible: s,
1379
1399
  dismissable: f = !0,
1380
1400
  onClose: m,
1381
1401
  fullHeight: g = !1,
1382
1402
  ...p
1383
1403
  }) {
1384
- const T = i != null ? i : f, oe = u.useRef(null), { modalProps: re, underlayProps: et } = Mo(
1404
+ const T = s ?? f, oe = u.useRef(null), { modalProps: re, underlayProps: et } = ko(
1385
1405
  {
1386
1406
  isKeyboardDismissDisabled: !T,
1387
1407
  ...p
1388
1408
  },
1389
1409
  c,
1390
1410
  oe
1391
- ), { dialogProps: ne, titleProps: tt } = yo(p, oe), ot = Me(re.onFocus, ne.onFocus, l), rt = Me(re.onBlur, ne.onBlur, n), { t: nt } = u.useContext(st), at = dt({ "data-testid": o }), [ae, lt] = ut(
1411
+ ), { dialogProps: ne, titleProps: tt } = xo(p, oe), ot = Me(re.onFocus, ne.onFocus, l), rt = Me(re.onBlur, ne.onBlur, n), { t: nt } = u.useContext(st), at = dt({ "data-testid": o }), [ae, lt] = ut(
1392
1412
  e,
1393
1413
  [{ type: Qe }]
1394
1414
  );
@@ -1403,11 +1423,11 @@ function Oo({
1403
1423
  onClick: he,
1404
1424
  kind: "icon",
1405
1425
  icon: "x",
1406
- className: To
1426
+ className: Fo
1407
1427
  }
1408
1428
  ) : null;
1409
- }, it = ct(lt, (Ee) => Ee.type === we ? [{ className: ue(Ee.props.classname, So) }] : []);
1410
- return /* @__PURE__ */ u.createElement(Eo, null, /* @__PURE__ */ u.createElement("div", { className: No, ...et, ...p }, /* @__PURE__ */ u.createElement(
1429
+ }, it = ct(lt, (Ee) => Ee.type === we ? [{ className: ue(Ee.props.classname, Co) }] : []);
1430
+ return /* @__PURE__ */ u.createElement(Po, null, /* @__PURE__ */ u.createElement("div", { className: Wo, ...et, ...p }, /* @__PURE__ */ u.createElement(
1411
1431
  "div",
1412
1432
  {
1413
1433
  ...re,
@@ -1417,21 +1437,21 @@ function Oo({
1417
1437
  onBlur: rt,
1418
1438
  ...at("dialog"),
1419
1439
  ref: oe,
1420
- className: ue(Lo({ kind: r, size: s, fullHeight: g }), t)
1440
+ className: ue(Bo({ kind: r, size: d, fullHeight: g }), t)
1421
1441
  },
1422
- /* @__PURE__ */ u.createElement("div", { ...tt, className: Bo({ kind: r }) }, r && /* @__PURE__ */ u.createElement(
1442
+ /* @__PURE__ */ u.createElement("div", { ...tt, className: Oo({ kind: r }) }, r && /* @__PURE__ */ u.createElement(
1423
1443
  mt,
1424
1444
  {
1425
1445
  icon: Ne[r] || Ne.informational,
1426
- className: Fo
1446
+ className: No
1427
1447
  }
1428
- ), /* @__PURE__ */ u.createElement("div", { className: Co }, le(d, c.close)), /* @__PURE__ */ u.createElement(we, null)),
1429
- /* @__PURE__ */ u.createElement("div", { className: xo }, le(it, c.close)),
1448
+ ), /* @__PURE__ */ u.createElement("div", { className: Do }, le(i, c.close)), /* @__PURE__ */ u.createElement(we, null)),
1449
+ /* @__PURE__ */ u.createElement("div", { className: Lo }, le(it, c.close)),
1430
1450
  ae && ae.length > 0 ? /* @__PURE__ */ u.createElement(u.Fragment, null, le(ae, c.close)) : /* @__PURE__ */ u.createElement("div", { className: Ye }, /* @__PURE__ */ u.createElement(ye, { kind: "key", onClick: he }, nt("design-system:modal.defaultButtonLabel")))
1431
1451
  )));
1432
1452
  }
1433
1453
  function Ze(e) {
1434
- return e.state.isOpen ? /* @__PURE__ */ u.createElement(Oo, { ...e }, e.children) : /* @__PURE__ */ u.createElement(u.Fragment, null);
1454
+ return e.state.isOpen ? /* @__PURE__ */ u.createElement(Ao, { ...e }, e.children) : /* @__PURE__ */ u.createElement(u.Fragment, null);
1435
1455
  }
1436
1456
  Oe.set(Ze, {
1437
1457
  name: "Modal",
@@ -1446,8 +1466,8 @@ Oe.set(Ze, {
1446
1466
  title: { type: "string" }
1447
1467
  }
1448
1468
  });
1449
- function Do(e) {
1450
- let [t, o] = pt(e.isOpen, e.defaultOpen || !1, e.onOpenChange);
1469
+ function Io(e) {
1470
+ let [t, o] = jt(e.isOpen, e.defaultOpen || !1, e.onOpenChange);
1451
1471
  const r = x(() => {
1452
1472
  o(!0);
1453
1473
  }, [
@@ -1470,8 +1490,8 @@ function Do(e) {
1470
1490
  toggle: l
1471
1491
  };
1472
1492
  }
1473
- function Ho(e = {}) {
1474
- const t = Do(e), o = y(null), { triggerProps: r, overlayProps: n } = go(
1493
+ function jo(e = {}) {
1494
+ const t = Io(e), o = y(null), { triggerProps: r, overlayProps: n } = bo(
1475
1495
  { type: "dialog" },
1476
1496
  t,
1477
1497
  o
@@ -1489,8 +1509,8 @@ function Ho(e = {}) {
1489
1509
  modalProps: { overlayProps: n, state: t }
1490
1510
  };
1491
1511
  }
1492
- const Wo = {
1493
- description: () => /* @__PURE__ */ u.createElement("p", null, "Modals are overlays on a page that focus a user\u2019s attention on an important message or a simple action. Examples of a Modal include confirming the deletion of a record, or making a single selection."),
1512
+ const zo = {
1513
+ description: () => /* @__PURE__ */ u.createElement("p", null, "Modals are overlays on a page that focus a user’s attention on an important message or a simple action. Examples of a Modal include confirming the deletion of a record, or making a single selection."),
1494
1514
  components: [Ze],
1495
1515
  examples: {
1496
1516
  general: {
@@ -2230,13 +2250,13 @@ const Wo = {
2230
2250
  }
2231
2251
  }
2232
2252
  }
2233
- }, Vo = {
2234
- Modals: Wo
2253
+ }, _o = {
2254
+ Modals: zo
2235
2255
  };
2236
2256
  export {
2237
- Vo as MANIFEST,
2257
+ _o as MANIFEST,
2238
2258
  Ze as Modal,
2239
2259
  Qe as ModalFooter,
2240
2260
  Ne as ModalIcons,
2241
- Ho as useModal
2261
+ jo as useModal
2242
2262
  };