@sps-woodland/modal 8.0.2 → 8.0.4

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,59 +1,79 @@
1
- import { Metadata as Be, cl as re, combineEventHandlers as ve, I18nContext as Qe, useChildTestIdAttrBuilder as Ze, selectChildren as et, modChildren as tt, Icon as ot, contentOf as Z } from "@sps-woodland/core";
2
- import { Button as he } from "@sps-woodland/buttons";
3
- import * as d from "react";
4
- import y, { useState as X, useRef as $, useCallback as S, useContext as A, useEffect as T, useMemo as K } from "react";
5
- import rt from "react-dom";
6
- import { code as g } from "@spscommerce/utils";
7
- function nt(e, t, o) {
8
- let [r, n] = X(e || t), a = $(e !== void 0), l = a.current, i = e !== void 0, s = $(r);
9
- l !== i && console.warn(`WARN: A component changed from ${l ? "controlled" : "uncontrolled"} to ${i ? "controlled" : "uncontrolled"}.`), a.current = i;
10
- let u = S((c, ...f) => {
11
- let m = (b, ...p) => {
12
- o && (Object.is(s.current, b) || o(b, ...p)), i || (s.current = b);
1
+ import { Metadata as Le, cl as ne, combineEventHandlers as be, I18nContext as et, useChildTestIdAttrBuilder as tt, selectChildren as ot, modChildren as rt, Icon as nt, contentOf as ee } from "@sps-woodland/core";
2
+ import { Button as ve } from "@sps-woodland/buttons";
3
+ import * as u from "react";
4
+ import h, { useState as z, useRef as M, useEffect as S, useCallback as k, useContext as q, useMemo as W } from "react";
5
+ import at from "react-dom";
6
+ import { code as b } from "@spscommerce/utils";
7
+ function lt(e, t, o) {
8
+ let [r, n] = z(e || t), a = M(e !== void 0), l = e !== void 0;
9
+ S(() => {
10
+ let d = a.current;
11
+ d !== l && console.warn(`WARN: A component changed from ${d ? "controlled" : "uncontrolled"} to ${l ? "controlled" : "uncontrolled"}.`), a.current = l;
12
+ }, [
13
+ l
14
+ ]);
15
+ let s = l ? e : r, i = k((d, ...c) => {
16
+ let p = (m, ...f) => {
17
+ o && (Object.is(s, m) || o(m, ...f)), l || (s = m);
13
18
  };
14
- typeof c == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), n((p, ...N) => {
15
- let z = c(i ? s.current : p, ...N);
16
- return m(z, ...f), i ? p : z;
17
- })) : (i || n(c), m(c, ...f));
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((f, ...g) => {
20
+ let P = d(l ? s : f, ...g);
21
+ return p(P, ...c), l ? f : P;
22
+ })) : (l || n(d), p(d, ...c));
18
23
  }, [
19
- i,
24
+ l,
25
+ s,
20
26
  o
21
27
  ]);
22
- return i ? s.current = e : e = r, [
23
- e,
24
- u
28
+ return [
29
+ s,
30
+ i
25
31
  ];
26
32
  }
27
- const Ce = {
33
+ const j = {
28
34
  prefix: String(Math.round(Math.random() * 1e10)),
29
- current: 0,
30
- isSSR: !1
31
- }, de = /* @__PURE__ */ y.createContext(Ce);
32
- let at = Boolean(typeof window < "u" && window.document && window.document.createElement), ee = /* @__PURE__ */ new WeakMap();
33
- function lt(e = !1) {
34
- let t = A(de), o = $(null);
35
+ current: 0
36
+ }, Be = /* @__PURE__ */ h.createContext(j), it = /* @__PURE__ */ h.createContext(!1);
37
+ let st = Boolean(typeof window < "u" && window.document && window.document.createElement), te = /* @__PURE__ */ new WeakMap();
38
+ function dt(e = !1) {
39
+ let t = q(Be), o = M(null);
35
40
  if (o.current === null && !e) {
36
41
  var r, n;
37
- let a = (r = y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || r === void 0 || (n = r.ReactCurrentOwner) === null || n === void 0 ? void 0 : n.current;
42
+ let a = (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;
38
43
  if (a) {
39
- let l = ee.get(a);
40
- l == null ? ee.set(a, {
44
+ let l = te.get(a);
45
+ l == null ? te.set(a, {
41
46
  id: t.current,
42
47
  state: a.memoizedState
43
- }) : a.memoizedState !== l.state && (t.current = l.id, ee.delete(a));
48
+ }) : a.memoizedState !== l.state && (t.current = l.id, te.delete(a));
44
49
  }
45
50
  o.current = ++t.current;
46
51
  }
47
52
  return o.current;
48
53
  }
49
- function it(e) {
50
- let t = A(de);
51
- t === Ce && !at && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
52
- let o = lt(!!e);
53
- return e || `react-aria${t.prefix}-${o}`;
54
+ function ut(e) {
55
+ let t = q(Be);
56
+ t === j && !st && 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 = dt(!!e), r = t === j && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${t.prefix}`;
58
+ return e || `${r}-${o}`;
59
+ }
60
+ function ct(e) {
61
+ let t = h.useId(), [o] = z(Ce()), r = o || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${j.prefix}`;
62
+ return e || `${r}-${t}`;
63
+ }
64
+ const mt = typeof h.useId == "function" ? ct : ut;
65
+ function pt() {
66
+ return !1;
67
+ }
68
+ function ft() {
69
+ return !0;
54
70
  }
55
- function st() {
56
- return A(de).isSSR;
71
+ function gt(e) {
72
+ return () => {
73
+ };
74
+ }
75
+ function Ce() {
76
+ return typeof h.useSyncExternalStore == "function" ? h.useSyncExternalStore(gt, pt, ft) : q(it);
57
77
  }
58
78
  function Ne(e) {
59
79
  var t, o, r = "";
@@ -68,66 +88,72 @@ function Ne(e) {
68
88
  e[t] && (r && (r += " "), r += t);
69
89
  return r;
70
90
  }
71
- function dt() {
91
+ function bt() {
72
92
  for (var e, t, o = 0, r = ""; o < arguments.length; )
73
93
  (e = arguments[o++]) && (t = Ne(e)) && (r && (r += " "), r += t);
74
94
  return r;
75
95
  }
76
- const E = typeof window < "u" ? y.useLayoutEffect : () => {
96
+ const w = typeof document < "u" ? h.useLayoutEffect : () => {
77
97
  };
78
- function ut(e) {
79
- let [t, o] = X(e), r = $(t), n = $(null);
80
- r.current = t;
81
- let a = $(null);
82
- a.current = () => {
83
- let i = n.current.next();
84
- if (i.done) {
85
- n.current = null;
98
+ function R(e) {
99
+ const t = M(null);
100
+ return w(() => {
101
+ t.current = e;
102
+ }, [
103
+ e
104
+ ]), k((...o) => {
105
+ const r = t.current;
106
+ return r(...o);
107
+ }, []);
108
+ }
109
+ function vt(e) {
110
+ let [t, o] = z(e), r = M(null), n = R(() => {
111
+ let l = r.current.next();
112
+ if (l.done) {
113
+ r.current = null;
86
114
  return;
87
115
  }
88
- t === i.value ? a.current() : o(i.value);
89
- }, E(() => {
90
- n.current && a.current();
116
+ t === l.value ? n() : o(l.value);
117
+ });
118
+ w(() => {
119
+ r.current && n();
120
+ });
121
+ let a = R((l) => {
122
+ r.current = l(t), n();
91
123
  });
92
- let l = S((i) => {
93
- n.current = i(r.current), a.current();
94
- }, [
95
- n,
96
- a
97
- ]);
98
124
  return [
99
125
  t,
100
- l
126
+ a
101
127
  ];
102
128
  }
103
- let _ = /* @__PURE__ */ new Map();
129
+ let $t = Boolean(typeof window < "u" && window.document && window.document.createElement), U = /* @__PURE__ */ new Map();
104
130
  function Oe(e) {
105
- let [t, o] = X(e), r = $(null), n = it(t), a = S((l) => {
131
+ let [t, o] = z(e), r = M(null), n = mt(t), a = k((l) => {
106
132
  r.current = l;
107
133
  }, []);
108
- return _.set(n, a), E(() => {
134
+ return $t && U.set(n, a), w(() => {
109
135
  let l = n;
110
136
  return () => {
111
- _.delete(l);
137
+ U.delete(l);
112
138
  };
113
139
  }, [
114
140
  n
115
- ]), T(() => {
141
+ ]), S(() => {
116
142
  let l = r.current;
117
143
  l && (r.current = null, o(l));
118
144
  }), n;
119
145
  }
120
- function ct(e, t) {
146
+ function ht(e, t) {
121
147
  if (e === t)
122
148
  return e;
123
- let o = _.get(e);
149
+ let o = U.get(e);
124
150
  if (o)
125
151
  return o(t), t;
126
- let r = _.get(t);
152
+ let r = U.get(t);
127
153
  return r ? (r(e), e) : t;
128
154
  }
129
- function mt(e = []) {
130
- let t = Oe(), [o, r] = ut(t), n = S(() => {
155
+ function wt(e = []) {
156
+ let t = Oe(), [o, r] = vt(t), n = k(() => {
131
157
  r(function* () {
132
158
  yield t, yield document.getElementById(t) ? t : void 0;
133
159
  });
@@ -135,19 +161,23 @@ function mt(e = []) {
135
161
  t,
136
162
  r
137
163
  ]);
138
- return E(n, [
164
+ return w(n, [
139
165
  t,
140
166
  n,
141
167
  ...e
142
168
  ]), o;
143
169
  }
144
- function j(...e) {
170
+ function G(...e) {
145
171
  return (...t) => {
146
172
  for (let o of e)
147
173
  typeof o == "function" && o(...t);
148
174
  };
149
175
  }
150
- function pt(...e) {
176
+ const Et = (e) => {
177
+ var t;
178
+ return (t = e == null ? void 0 : e.ownerDocument) !== null && t !== void 0 ? t : document;
179
+ };
180
+ function Mt(...e) {
151
181
  let t = {
152
182
  ...e[0]
153
183
  };
@@ -155,52 +185,59 @@ function pt(...e) {
155
185
  let r = e[o];
156
186
  for (let n in r) {
157
187
  let a = t[n], l = r[n];
158
- typeof a == "function" && typeof l == "function" && n[0] === "o" && n[1] === "n" && n.charCodeAt(2) >= 65 && n.charCodeAt(2) <= 90 ? t[n] = j(a, l) : (n === "className" || n === "UNSAFE_className") && typeof a == "string" && typeof l == "string" ? t[n] = dt(a, l) : n === "id" && a && l ? t.id = ct(a, l) : t[n] = l !== void 0 ? l : a;
188
+ typeof a == "function" && typeof l == "function" && n[0] === "o" && n[1] === "n" && n.charCodeAt(2) >= 65 && n.charCodeAt(2) <= 90 ? t[n] = G(a, l) : (n === "className" || n === "UNSAFE_className") && typeof a == "string" && typeof l == "string" ? t[n] = bt(a, l) : n === "id" && a && l ? t.id = ht(a, l) : t[n] = l !== void 0 ? l : a;
159
189
  }
160
190
  }
161
191
  return t;
162
192
  }
163
- const ft = /* @__PURE__ */ new Set([
193
+ const yt = /* @__PURE__ */ new Set([
164
194
  "id"
165
- ]), gt = /* @__PURE__ */ new Set([
195
+ ]), Pt = /* @__PURE__ */ new Set([
166
196
  "aria-label",
167
197
  "aria-labelledby",
168
198
  "aria-describedby",
169
199
  "aria-details"
170
- ]), bt = /^(data-.*)$/;
171
- function vt(e, t = {}) {
172
- let { labelable: o, propNames: r } = t, n = {};
173
- for (const a in e)
174
- Object.prototype.hasOwnProperty.call(e, a) && (ft.has(a) || o && gt.has(a) || (r == null ? void 0 : r.has(a)) || bt.test(a)) && (n[a] = e[a]);
175
- return n;
200
+ ]), kt = /* @__PURE__ */ new Set([
201
+ "href",
202
+ "target",
203
+ "rel",
204
+ "download",
205
+ "ping",
206
+ "referrerPolicy"
207
+ ]), Tt = /^(data-.*)$/;
208
+ function xt(e, t = {}) {
209
+ let { labelable: o, isLink: r, propNames: n } = t, a = {};
210
+ for (const l in e)
211
+ Object.prototype.hasOwnProperty.call(e, l) && (yt.has(l) || o && Pt.has(l) || r && kt.has(l) || (n == null ? void 0 : n.has(l)) || Tt.test(l)) && (a[l] = e[l]);
212
+ return a;
176
213
  }
177
214
  function $e(e) {
178
- if (ht())
215
+ if (St())
179
216
  e.focus({
180
217
  preventScroll: !0
181
218
  });
182
219
  else {
183
- let t = $t(e);
184
- e.focus(), wt(t);
220
+ let t = Ft(e);
221
+ e.focus(), Lt(t);
185
222
  }
186
223
  }
187
- let q = null;
188
- function ht() {
189
- if (q == null) {
190
- q = !1;
224
+ let H = null;
225
+ function St() {
226
+ if (H == null) {
227
+ H = !1;
191
228
  try {
192
229
  var e = document.createElement("div");
193
230
  e.focus({
194
231
  get preventScroll() {
195
- return q = !0, !0;
232
+ return H = !0, !0;
196
233
  }
197
234
  });
198
235
  } catch {
199
236
  }
200
237
  }
201
- return q;
238
+ return H;
202
239
  }
203
- function $t(e) {
240
+ function Ft(e) {
204
241
  for (var t = e.parentNode, o = [], r = document.scrollingElement || document.documentElement; t instanceof HTMLElement && t !== r; )
205
242
  (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && o.push({
206
243
  element: t,
@@ -213,79 +250,83 @@ function $t(e) {
213
250
  scrollLeft: r.scrollLeft
214
251
  }), o;
215
252
  }
216
- function wt(e) {
253
+ function Lt(e) {
217
254
  for (let { element: t, scrollTop: o, scrollLeft: r } of e)
218
255
  t.scrollTop = o, t.scrollLeft = r;
219
256
  }
220
- let C = /* @__PURE__ */ new Map(), ne = /* @__PURE__ */ new Set();
221
- function we() {
257
+ function Bt(e) {
258
+ var t;
259
+ return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((o) => e.test(o.brand))) || e.test(window.navigator.userAgent);
260
+ }
261
+ function de(e) {
262
+ var t;
263
+ return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
264
+ }
265
+ function De() {
266
+ return de(/^Mac/i);
267
+ }
268
+ function Ct() {
269
+ return de(/^iPhone/i);
270
+ }
271
+ function Nt() {
272
+ return de(/^iPad/i) || De() && navigator.maxTouchPoints > 1;
273
+ }
274
+ function Ot() {
275
+ return Ct() || Nt();
276
+ }
277
+ function Dt() {
278
+ return Bt(/Android/i);
279
+ }
280
+ let N = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Set();
281
+ function he() {
222
282
  if (typeof window > "u")
223
283
  return;
224
284
  let e = (o) => {
225
- let r = C.get(o.target);
226
- r || (r = /* @__PURE__ */ new Set(), C.set(o.target, r), o.target.addEventListener("transitioncancel", t)), r.add(o.propertyName);
285
+ let r = N.get(o.target);
286
+ r || (r = /* @__PURE__ */ new Set(), N.set(o.target, r), o.target.addEventListener("transitioncancel", t)), r.add(o.propertyName);
227
287
  }, t = (o) => {
228
- let r = C.get(o.target);
229
- if (!!r && (r.delete(o.propertyName), r.size === 0 && (o.target.removeEventListener("transitioncancel", t), C.delete(o.target)), C.size === 0)) {
230
- for (let n of ne)
288
+ let r = N.get(o.target);
289
+ if (!!r && (r.delete(o.propertyName), r.size === 0 && (o.target.removeEventListener("transitioncancel", t), N.delete(o.target)), N.size === 0)) {
290
+ for (let n of ae)
231
291
  n();
232
- ne.clear();
292
+ ae.clear();
233
293
  }
234
294
  };
235
295
  document.body.addEventListener("transitionrun", e), document.body.addEventListener("transitionend", t);
236
296
  }
237
- typeof document < "u" && (document.readyState !== "loading" ? we() : document.addEventListener("DOMContentLoaded", we));
238
- function Et(e) {
297
+ typeof document < "u" && (document.readyState !== "loading" ? he() : document.addEventListener("DOMContentLoaded", he));
298
+ function At(e) {
239
299
  requestAnimationFrame(() => {
240
- C.size === 0 ? e() : ne.add(e);
300
+ N.size === 0 ? e() : ae.add(e);
241
301
  });
242
302
  }
243
- function De(e) {
244
- for (Ee(e) && (e = e.parentElement); e && !Ee(e); )
303
+ function Ae(e) {
304
+ for (we(e) && (e = e.parentElement); e && !we(e); )
245
305
  e = e.parentElement;
246
306
  return e || document.scrollingElement || document.documentElement;
247
307
  }
248
- function Ee(e) {
308
+ function we(e) {
249
309
  let t = window.getComputedStyle(e);
250
310
  return /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
251
311
  }
252
- function Mt(e) {
253
- var t;
254
- return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((o) => e.test(o.brand))) || e.test(window.navigator.userAgent);
255
- }
256
- function ue(e) {
257
- var t;
258
- return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
259
- }
260
- function Ie() {
261
- return ue(/^Mac/i);
262
- }
263
- function yt() {
264
- return ue(/^iPhone/i);
265
- }
266
- function Pt() {
267
- return ue(/^iPad/i) || Ie() && navigator.maxTouchPoints > 1;
268
- }
269
- function kt() {
270
- return yt() || Pt();
271
- }
272
- function Tt() {
273
- return Mt(/Android/i);
274
- }
275
- function xt(e) {
276
- return e.mozInputSource === 0 && e.isTrusted ? !0 : Tt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
312
+ function Wt(e) {
313
+ return e.mozInputSource === 0 && e.isTrusted ? !0 : Dt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
277
314
  }
278
- function ae(e, t, o) {
279
- return t in e ? Object.defineProperty(e, t, {
280
- value: o,
281
- enumerable: !0,
282
- configurable: !0,
283
- writable: !0
284
- }) : e[t] = o, e;
315
+ const We = h.createContext({
316
+ register: () => {
317
+ }
318
+ });
319
+ We.displayName = "PressResponderContext";
320
+ function It({ children: e }) {
321
+ let t = W(() => ({
322
+ register: () => {
323
+ }
324
+ }), []);
325
+ return /* @__PURE__ */ h.createElement(We.Provider, {
326
+ value: t
327
+ }, e);
285
328
  }
286
- const Ft = y.createContext(null);
287
- Ft.displayName = "PressResponderContext";
288
- class St {
329
+ class Rt {
289
330
  isDefaultPrevented() {
290
331
  return this.nativeEvent.defaultPrevented;
291
332
  }
@@ -304,139 +345,153 @@ class St {
304
345
  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;
305
346
  }
306
347
  }
307
- function Lt(e) {
308
- let t = $({
348
+ function zt(e) {
349
+ let t = M({
309
350
  isFocused: !1,
310
- onBlur: e,
311
351
  observer: null
312
352
  });
313
- return t.current.onBlur = e, E(() => {
314
- const o = t.current;
353
+ w(() => {
354
+ const r = t.current;
315
355
  return () => {
316
- o.observer && (o.observer.disconnect(), o.observer = null);
356
+ r.observer && (r.observer.disconnect(), r.observer = null);
317
357
  };
318
- }, []), S((o) => {
319
- if (o.target instanceof HTMLButtonElement || o.target instanceof HTMLInputElement || o.target instanceof HTMLTextAreaElement || o.target instanceof HTMLSelectElement) {
358
+ }, []);
359
+ let o = R((r) => {
360
+ e == null || e(r);
361
+ });
362
+ return k((r) => {
363
+ if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
320
364
  t.current.isFocused = !0;
321
- let r = o.target, n = (a) => {
322
- var l, i;
323
- t.current.isFocused = !1, r.disabled && ((i = (l = t.current).onBlur) === null || i === void 0 || i.call(l, new St("blur", a))), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
365
+ let n = r.target, a = (l) => {
366
+ t.current.isFocused = !1, n.disabled && o(new Rt("blur", l)), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
324
367
  };
325
- r.addEventListener("focusout", n, {
368
+ n.addEventListener("focusout", a, {
326
369
  once: !0
327
370
  }), t.current.observer = new MutationObserver(() => {
328
- t.current.isFocused && r.disabled && (t.current.observer.disconnect(), r.dispatchEvent(new FocusEvent("blur")), r.dispatchEvent(new FocusEvent("focusout", {
329
- bubbles: !0
330
- })));
331
- }), t.current.observer.observe(r, {
371
+ if (t.current.isFocused && n.disabled) {
372
+ var l;
373
+ (l = t.current.observer) === null || l === void 0 || l.disconnect();
374
+ let s = n === document.activeElement ? null : document.activeElement;
375
+ n.dispatchEvent(new FocusEvent("blur", {
376
+ relatedTarget: s
377
+ })), n.dispatchEvent(new FocusEvent("focusout", {
378
+ bubbles: !0,
379
+ relatedTarget: s
380
+ }));
381
+ }
382
+ }), t.current.observer.observe(n, {
332
383
  attributes: !0,
333
384
  attributeFilter: [
334
385
  "disabled"
335
386
  ]
336
387
  });
337
388
  }
338
- }, []);
389
+ }, [
390
+ o
391
+ ]);
339
392
  }
340
- let W = null, Bt = /* @__PURE__ */ new Set(), Me = !1, L = !1, le = !1;
341
- function ce(e, t) {
342
- for (let o of Bt)
393
+ let V = null, qt = /* @__PURE__ */ new Set(), Ee = !1, B = !1, le = !1;
394
+ function ue(e, t) {
395
+ for (let o of qt)
343
396
  o(e, t);
344
397
  }
345
- function Ct(e) {
346
- return !(e.metaKey || !Ie() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
398
+ function Vt(e) {
399
+ return !(e.metaKey || !De() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
347
400
  }
348
- function ye(e) {
349
- L = !0, Ct(e) && (W = "keyboard", ce("keyboard", e));
401
+ function Me(e) {
402
+ B = !0, Vt(e) && (V = "keyboard", ue("keyboard", e));
350
403
  }
351
- function B(e) {
352
- W = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (L = !0, ce("pointer", e));
404
+ function C(e) {
405
+ V = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (B = !0, ue("pointer", e));
353
406
  }
354
- function Nt(e) {
355
- xt(e) && (L = !0, W = "virtual");
407
+ function Ht(e) {
408
+ Wt(e) && (B = !0, V = "virtual");
356
409
  }
357
- function Ot(e) {
358
- e.target === window || e.target === document || (!L && !le && (W = "virtual", ce("virtual", e)), L = !1, le = !1);
410
+ function Kt(e) {
411
+ e.target === window || e.target === document || (!B && !le && (V = "virtual", ue("virtual", e)), B = !1, le = !1);
359
412
  }
360
- function Dt() {
361
- L = !1, le = !0;
413
+ function _t() {
414
+ B = !1, le = !0;
362
415
  }
363
- function Pe() {
364
- if (typeof window > "u" || Me)
416
+ function ye() {
417
+ if (typeof window > "u" || Ee)
365
418
  return;
366
419
  let e = HTMLElement.prototype.focus;
367
420
  HTMLElement.prototype.focus = function() {
368
- L = !0, e.apply(this, arguments);
369
- }, document.addEventListener("keydown", ye, !0), document.addEventListener("keyup", ye, !0), document.addEventListener("click", Nt, !0), window.addEventListener("focus", Ot, !0), window.addEventListener("blur", Dt, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", B, !0), document.addEventListener("pointermove", B, !0), document.addEventListener("pointerup", B, !0)) : (document.addEventListener("mousedown", B, !0), document.addEventListener("mousemove", B, !0), document.addEventListener("mouseup", B, !0)), Me = !0;
421
+ B = !0, e.apply(this, arguments);
422
+ }, document.addEventListener("keydown", Me, !0), document.addEventListener("keyup", Me, !0), document.addEventListener("click", Ht, !0), window.addEventListener("focus", Kt, !0), window.addEventListener("blur", _t, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", C, !0), document.addEventListener("pointermove", C, !0), document.addEventListener("pointerup", C, !0)) : (document.addEventListener("mousedown", C, !0), document.addEventListener("mousemove", C, !0), document.addEventListener("mouseup", C, !0)), Ee = !0;
370
423
  }
371
- typeof document < "u" && (document.readyState !== "loading" ? Pe() : document.addEventListener("DOMContentLoaded", Pe));
372
- function It() {
373
- return W;
424
+ typeof document < "u" && (document.readyState !== "loading" ? ye() : document.addEventListener("DOMContentLoaded", ye));
425
+ function jt() {
426
+ return V;
374
427
  }
375
- function At(e) {
376
- let { isDisabled: t, onBlurWithin: o, onFocusWithin: r, onFocusWithinChange: n } = e, a = $({
428
+ function Ut(e) {
429
+ let { isDisabled: t, onBlurWithin: o, onFocusWithin: r, onFocusWithinChange: n } = e, a = M({
377
430
  isFocusWithin: !1
378
- }), l = S((u) => {
379
- a.current.isFocusWithin && !u.currentTarget.contains(u.relatedTarget) && (a.current.isFocusWithin = !1, o && o(u), n && n(!1));
431
+ }), l = k((d) => {
432
+ a.current.isFocusWithin && !d.currentTarget.contains(d.relatedTarget) && (a.current.isFocusWithin = !1, o && o(d), n && n(!1));
380
433
  }, [
381
434
  o,
382
435
  n,
383
436
  a
384
- ]), i = Lt(l), s = S((u) => {
385
- !a.current.isFocusWithin && document.activeElement === u.target && (r && r(u), n && n(!0), a.current.isFocusWithin = !0, i(u));
437
+ ]), s = zt(l), i = k((d) => {
438
+ !a.current.isFocusWithin && document.activeElement === d.target && (r && r(d), n && n(!0), a.current.isFocusWithin = !0, s(d));
386
439
  }, [
387
440
  r,
388
441
  n,
389
- i
442
+ s
390
443
  ]);
391
444
  return t ? {
392
445
  focusWithinProps: {
393
- onFocus: null,
394
- onBlur: null
446
+ onFocus: void 0,
447
+ onBlur: void 0
395
448
  }
396
449
  } : {
397
450
  focusWithinProps: {
398
- onFocus: s,
451
+ onFocus: i,
399
452
  onBlur: l
400
453
  }
401
454
  };
402
455
  }
403
- function Wt(e) {
404
- let { ref: t, onInteractOutside: o, isDisabled: r, onInteractOutsideStart: n } = e, l = $({
456
+ function Gt(e) {
457
+ let { ref: t, onInteractOutside: o, isDisabled: r, onInteractOutsideStart: n } = e, a = M({
405
458
  isPointerDown: !1,
406
- ignoreEmulatedMouseEvents: !1,
407
- onInteractOutside: o,
408
- onInteractOutsideStart: n
409
- }).current;
410
- l.onInteractOutside = o, l.onInteractOutsideStart = n, T(() => {
459
+ ignoreEmulatedMouseEvents: !1
460
+ }), l = R((i) => {
461
+ o && K(i, t) && (n && n(i), a.current.isPointerDown = !0);
462
+ }), s = R((i) => {
463
+ o && o(i);
464
+ });
465
+ S(() => {
466
+ let i = a.current;
411
467
  if (r)
412
468
  return;
413
- let i = (s) => {
414
- R(s, t) && l.onInteractOutside && (l.onInteractOutsideStart && l.onInteractOutsideStart(s), l.isPointerDown = !0);
415
- };
469
+ const d = t.current, c = Et(d);
416
470
  if (typeof PointerEvent < "u") {
417
- let s = (u) => {
418
- l.isPointerDown && l.onInteractOutside && R(u, t) && l.onInteractOutside(u), l.isPointerDown = !1;
471
+ let p = (m) => {
472
+ i.isPointerDown && K(m, t) && s(m), i.isPointerDown = !1;
419
473
  };
420
- return document.addEventListener("pointerdown", i, !0), document.addEventListener("pointerup", s, !0), () => {
421
- document.removeEventListener("pointerdown", i, !0), document.removeEventListener("pointerup", s, !0);
474
+ return c.addEventListener("pointerdown", l, !0), c.addEventListener("pointerup", p, !0), () => {
475
+ c.removeEventListener("pointerdown", l, !0), c.removeEventListener("pointerup", p, !0);
422
476
  };
423
477
  } else {
424
- let s = (c) => {
425
- l.ignoreEmulatedMouseEvents ? l.ignoreEmulatedMouseEvents = !1 : l.isPointerDown && l.onInteractOutside && R(c, t) && l.onInteractOutside(c), l.isPointerDown = !1;
426
- }, u = (c) => {
427
- l.ignoreEmulatedMouseEvents = !0, l.onInteractOutside && l.isPointerDown && R(c, t) && l.onInteractOutside(c), l.isPointerDown = !1;
478
+ let p = (f) => {
479
+ i.ignoreEmulatedMouseEvents ? i.ignoreEmulatedMouseEvents = !1 : i.isPointerDown && K(f, t) && s(f), i.isPointerDown = !1;
480
+ }, m = (f) => {
481
+ i.ignoreEmulatedMouseEvents = !0, i.isPointerDown && K(f, t) && s(f), i.isPointerDown = !1;
428
482
  };
429
- return document.addEventListener("mousedown", i, !0), document.addEventListener("mouseup", s, !0), document.addEventListener("touchstart", i, !0), document.addEventListener("touchend", u, !0), () => {
430
- document.removeEventListener("mousedown", i, !0), document.removeEventListener("mouseup", s, !0), document.removeEventListener("touchstart", i, !0), document.removeEventListener("touchend", u, !0);
483
+ return c.addEventListener("mousedown", l, !0), c.addEventListener("mouseup", p, !0), c.addEventListener("touchstart", l, !0), c.addEventListener("touchend", m, !0), () => {
484
+ c.removeEventListener("mousedown", l, !0), c.removeEventListener("mouseup", p, !0), c.removeEventListener("touchstart", l, !0), c.removeEventListener("touchend", m, !0);
431
485
  };
432
486
  }
433
487
  }, [
434
488
  t,
489
+ r,
435
490
  l,
436
- r
491
+ s
437
492
  ]);
438
493
  }
439
- function R(e, t) {
494
+ function K(e, t) {
440
495
  if (e.button > 0)
441
496
  return !1;
442
497
  if (e.target) {
@@ -447,15 +502,15 @@ function R(e, t) {
447
502
  return t.current && !t.current.contains(e.target);
448
503
  }
449
504
  function ie(e) {
450
- if (It() === "virtual") {
505
+ if (jt() === "virtual") {
451
506
  let t = document.activeElement;
452
- Et(() => {
507
+ At(() => {
453
508
  document.activeElement === t && document.contains(e) && $e(e);
454
509
  });
455
510
  } else
456
511
  $e(e);
457
512
  }
458
- function zt(e) {
513
+ function Yt(e) {
459
514
  if (!(e instanceof HTMLElement) && !(e instanceof SVGElement))
460
515
  return !1;
461
516
  let { display: t, visibility: o } = e.style, r = t !== "none" && o !== "hidden" && o !== "collapse";
@@ -466,118 +521,119 @@ function zt(e) {
466
521
  }
467
522
  return r;
468
523
  }
469
- function qt(e, t) {
524
+ function Xt(e, t) {
470
525
  return !e.hasAttribute("hidden") && (e.nodeName === "DETAILS" && t && t.nodeName !== "SUMMARY" ? e.hasAttribute("open") : !0);
471
526
  }
472
- function Ae(e, t) {
473
- return e.nodeName !== "#comment" && zt(e) && qt(e, t) && (!e.parentElement || Ae(e.parentElement, e));
527
+ function Ie(e, t) {
528
+ return e.nodeName !== "#comment" && Yt(e) && Xt(e, t) && (!e.parentElement || Ie(e.parentElement, e));
474
529
  }
475
- const ke = /* @__PURE__ */ y.createContext(null);
530
+ const Pe = /* @__PURE__ */ h.createContext(null);
476
531
  let v = null;
477
- function Rt(e) {
478
- let { children: t, contain: o, restoreFocus: r, autoFocus: n } = e, a = $(), l = $(), i = $([]), { parentNode: s } = A(ke) || {}, u = K(() => new se({
479
- scopeRef: i
532
+ function Jt(e) {
533
+ let { children: t, contain: o, restoreFocus: r, autoFocus: n } = e, a = M(null), l = M(null), s = M([]), { parentNode: i } = q(Pe) || {}, d = W(() => new se({
534
+ scopeRef: s
480
535
  }), [
481
- i
536
+ s
482
537
  ]);
483
- E(() => {
484
- let m = s || h.root;
485
- if (h.getTreeNode(m.scopeRef) && v && !G(v, m.scopeRef)) {
486
- let b = h.getTreeNode(v);
487
- b && (m = b);
538
+ w(() => {
539
+ let m = i || $.root;
540
+ if ($.getTreeNode(m.scopeRef) && v && !X(v, m.scopeRef)) {
541
+ let f = $.getTreeNode(v);
542
+ f && (m = f);
488
543
  }
489
- m.addChild(u), h.addNode(u);
544
+ m.addChild(d), $.addNode(d);
490
545
  }, [
491
- u,
492
- s
493
- ]), E(() => {
494
- let m = h.getTreeNode(i);
495
- m.contain = o;
546
+ d,
547
+ i
548
+ ]), w(() => {
549
+ let m = $.getTreeNode(s);
550
+ m && (m.contain = !!o);
496
551
  }, [
497
552
  o
498
- ]), E(() => {
499
- let m = a.current.nextSibling, b = [];
500
- for (; m && m !== l.current; )
501
- b.push(m), m = m.nextSibling;
502
- i.current = b;
553
+ ]), w(() => {
554
+ var m;
555
+ let f = (m = a.current) === null || m === void 0 ? void 0 : m.nextSibling, g = [];
556
+ for (; f && f !== l.current; )
557
+ g.push(f), f = f.nextSibling;
558
+ s.current = g;
503
559
  }, [
504
560
  t
505
- ]), Gt(i, r, o), _t(i, o), Xt(i, r, o), Ut(i, n), T(() => {
506
- if (i) {
507
- let m = document.activeElement, b = null;
508
- if (w(m, i.current)) {
509
- for (let p of h.traverse())
510
- w(m, p.scopeRef.current) && (b = p);
511
- b === h.getTreeNode(i) && (v = b.scopeRef);
512
- }
513
- return () => {
514
- let p = h.getTreeNode(i).parent.scopeRef;
515
- (i === v || G(i, v)) && (!p || h.getTreeNode(p)) && (v = p), h.removeTreeNode(i);
516
- };
561
+ ]), no(s, r, o), to(s, o), lo(s, r, o), ro(s, n), S(() => {
562
+ let m = document.activeElement, f = null;
563
+ if (E(m, s.current)) {
564
+ for (let g of $.traverse())
565
+ g.scopeRef && E(m, g.scopeRef.current) && (f = g);
566
+ f === $.getTreeNode(s) && (v = f.scopeRef);
517
567
  }
518
568
  }, [
519
- i
569
+ s
570
+ ]), w(() => () => {
571
+ var m, f, g;
572
+ let P = (g = (f = $.getTreeNode(s)) === null || f === void 0 || (m = f.parent) === null || m === void 0 ? void 0 : m.scopeRef) !== null && g !== void 0 ? g : null;
573
+ (s === v || X(s, v)) && (!P || $.getTreeNode(P)) && (v = P), $.removeTreeNode(s);
574
+ }, [
575
+ s
520
576
  ]);
521
- let c = K(() => Ht(i), []), f = K(() => ({
577
+ let c = W(() => Qt(s), []), p = W(() => ({
522
578
  focusManager: c,
523
- parentNode: u
579
+ parentNode: d
524
580
  }), [
525
- u,
581
+ d,
526
582
  c
527
583
  ]);
528
- return /* @__PURE__ */ y.createElement(ke.Provider, {
529
- value: f
530
- }, /* @__PURE__ */ y.createElement("span", {
584
+ return /* @__PURE__ */ h.createElement(Pe.Provider, {
585
+ value: p
586
+ }, /* @__PURE__ */ h.createElement("span", {
531
587
  "data-focus-scope-start": !0,
532
588
  hidden: !0,
533
589
  ref: a
534
- }), t, /* @__PURE__ */ y.createElement("span", {
590
+ }), t, /* @__PURE__ */ h.createElement("span", {
535
591
  "data-focus-scope-end": !0,
536
592
  hidden: !0,
537
593
  ref: l
538
594
  }));
539
595
  }
540
- function Ht(e) {
596
+ function Qt(e) {
541
597
  return {
542
598
  focusNext(t = {}) {
543
- let o = e.current, { from: r, tabbable: n, wrap: a, accept: l } = t, i = r || document.activeElement, s = o[0].previousElementSibling, u = x(F(o), {
599
+ let o = e.current, { from: r, tabbable: n, wrap: a, accept: l } = t, s = r || document.activeElement, i = o[0].previousElementSibling, d = L(o), c = F(d, {
544
600
  tabbable: n,
545
601
  accept: l
546
602
  }, o);
547
- u.currentNode = w(i, o) ? i : s;
548
- let c = u.nextNode();
549
- return !c && a && (u.currentNode = s, c = u.nextNode()), c && k(c, !0), c;
603
+ c.currentNode = E(s, o) ? s : i;
604
+ let p = c.nextNode();
605
+ return !p && a && (c.currentNode = i, p = c.nextNode()), p && x(p, !0), p;
550
606
  },
551
607
  focusPrevious(t = {}) {
552
- let o = e.current, { from: r, tabbable: n, wrap: a, accept: l } = t, i = r || document.activeElement, s = o[o.length - 1].nextElementSibling, u = x(F(o), {
608
+ let o = e.current, { from: r, tabbable: n, wrap: a, accept: l } = t, s = r || document.activeElement, i = o[o.length - 1].nextElementSibling, d = L(o), c = F(d, {
553
609
  tabbable: n,
554
610
  accept: l
555
611
  }, o);
556
- u.currentNode = w(i, o) ? i : s;
557
- let c = u.previousNode();
558
- return !c && a && (u.currentNode = s, c = u.previousNode()), c && k(c, !0), c;
612
+ c.currentNode = E(s, o) ? s : i;
613
+ let p = c.previousNode();
614
+ return !p && a && (c.currentNode = i, p = c.previousNode()), p && x(p, !0), p;
559
615
  },
560
616
  focusFirst(t = {}) {
561
- let o = e.current, { tabbable: r, accept: n } = t, a = x(F(o), {
617
+ let o = e.current, { tabbable: r, accept: n } = t, a = L(o), l = F(a, {
562
618
  tabbable: r,
563
619
  accept: n
564
620
  }, o);
565
- a.currentNode = o[0].previousElementSibling;
566
- let l = a.nextNode();
567
- return l && k(l, !0), l;
621
+ l.currentNode = o[0].previousElementSibling;
622
+ let s = l.nextNode();
623
+ return s && x(s, !0), s;
568
624
  },
569
625
  focusLast(t = {}) {
570
- let o = e.current, { tabbable: r, accept: n } = t, a = x(F(o), {
626
+ let o = e.current, { tabbable: r, accept: n } = t, a = L(o), l = F(a, {
571
627
  tabbable: r,
572
628
  accept: n
573
629
  }, o);
574
- a.currentNode = o[o.length - 1].nextElementSibling;
575
- let l = a.previousNode();
576
- return l && k(l, !0), l;
630
+ l.currentNode = o[o.length - 1].nextElementSibling;
631
+ let s = l.previousNode();
632
+ return s && x(s, !0), s;
577
633
  }
578
634
  };
579
635
  }
580
- const me = [
636
+ const ce = [
581
637
  "input:not([disabled]):not([type=hidden])",
582
638
  "select:not([disabled])",
583
639
  "textarea:not([disabled])",
@@ -591,14 +647,14 @@ const me = [
591
647
  "audio[controls]",
592
648
  "video[controls]",
593
649
  "[contenteditable]"
594
- ], Vt = me.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
595
- me.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
596
- const Kt = me.join(':not([hidden]):not([tabindex="-1"]),');
597
- function F(e) {
650
+ ], Zt = ce.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
651
+ ce.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
652
+ const eo = ce.join(':not([hidden]):not([tabindex="-1"]),');
653
+ function L(e) {
598
654
  return e[0].parentElement;
599
655
  }
600
- function H(e) {
601
- let t = h.getTreeNode(v);
656
+ function A(e) {
657
+ let t = $.getTreeNode(v);
602
658
  for (; t && t.scopeRef !== e; ) {
603
659
  if (t.contain)
604
660
  return !1;
@@ -606,65 +662,72 @@ function H(e) {
606
662
  }
607
663
  return !0;
608
664
  }
609
- function _t(e, t) {
610
- let o = $(), r = $(null);
611
- E(() => {
665
+ function to(e, t) {
666
+ let o = M(), r = M();
667
+ w(() => {
612
668
  let n = e.current;
613
669
  if (!t) {
614
- r.current && (cancelAnimationFrame(r.current), r.current = null);
670
+ r.current && (cancelAnimationFrame(r.current), r.current = void 0);
615
671
  return;
616
672
  }
617
- let a = (s) => {
618
- if (s.key !== "Tab" || s.altKey || s.ctrlKey || s.metaKey || !H(e))
673
+ let a = (i) => {
674
+ if (i.key !== "Tab" || i.altKey || i.ctrlKey || i.metaKey || !A(e))
619
675
  return;
620
- let u = document.activeElement, c = e.current;
621
- if (!w(u, c))
676
+ let d = document.activeElement, c = e.current;
677
+ if (!c || !E(d, c))
622
678
  return;
623
- let f = x(F(c), {
679
+ let p = L(c), m = F(p, {
624
680
  tabbable: !0
625
681
  }, c);
626
- f.currentNode = u;
627
- let m = s.shiftKey ? f.previousNode() : f.nextNode();
628
- m || (f.currentNode = s.shiftKey ? c[c.length - 1].nextElementSibling : c[0].previousElementSibling, m = s.shiftKey ? f.previousNode() : f.nextNode()), s.preventDefault(), m && k(m, !0);
629
- }, l = (s) => {
630
- (!v || G(v, e)) && w(s.target, e.current) ? (v = e, o.current = s.target) : H(e) && !U(s.target, e) ? o.current ? o.current.focus() : v && Y(v.current) : H(e) && (o.current = s.target);
631
- }, i = (s) => {
682
+ if (!d)
683
+ return;
684
+ m.currentNode = d;
685
+ let f = i.shiftKey ? m.previousNode() : m.nextNode();
686
+ f || (m.currentNode = i.shiftKey ? c[c.length - 1].nextElementSibling : c[0].previousElementSibling, f = i.shiftKey ? m.previousNode() : m.nextNode()), i.preventDefault(), f && x(f, !0);
687
+ }, l = (i) => {
688
+ (!v || X(v, e)) && E(i.target, e.current) ? (v = e, o.current = i.target) : A(e) && !Y(i.target, e) ? o.current ? o.current.focus() : v && v.current && J(v.current) : A(e) && (o.current = i.target);
689
+ }, s = (i) => {
632
690
  r.current && cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
633
- H(e) && !U(document.activeElement, e) && (v = e, document.body.contains(s.target) ? (o.current = s.target, o.current.focus()) : v && Y(v.current));
691
+ if (document.activeElement && A(e) && !Y(document.activeElement, e))
692
+ if (v = e, document.body.contains(i.target)) {
693
+ var d;
694
+ o.current = i.target, (d = o.current) === null || d === void 0 || d.focus();
695
+ } else
696
+ v.current && J(v.current);
634
697
  });
635
698
  };
636
- return document.addEventListener("keydown", a, !1), document.addEventListener("focusin", l, !1), n.forEach((s) => s.addEventListener("focusin", l, !1)), n.forEach((s) => s.addEventListener("focusout", i, !1)), () => {
637
- document.removeEventListener("keydown", a, !1), document.removeEventListener("focusin", l, !1), n.forEach((s) => s.removeEventListener("focusin", l, !1)), n.forEach((s) => s.removeEventListener("focusout", i, !1));
699
+ return document.addEventListener("keydown", a, !1), document.addEventListener("focusin", l, !1), n == null || n.forEach((i) => i.addEventListener("focusin", l, !1)), n == null || n.forEach((i) => i.addEventListener("focusout", s, !1)), () => {
700
+ document.removeEventListener("keydown", a, !1), document.removeEventListener("focusin", l, !1), n == null || n.forEach((i) => i.removeEventListener("focusin", l, !1)), n == null || n.forEach((i) => i.removeEventListener("focusout", s, !1));
638
701
  };
639
702
  }, [
640
703
  e,
641
704
  t
642
- ]), T(() => () => {
705
+ ]), w(() => () => {
643
706
  r.current && cancelAnimationFrame(r.current);
644
707
  }, [
645
708
  r
646
709
  ]);
647
710
  }
648
- function We(e) {
649
- return U(e);
711
+ function Re(e) {
712
+ return Y(e);
650
713
  }
651
- function w(e, t) {
652
- return t.some((o) => o.contains(e));
714
+ function E(e, t) {
715
+ return !e || !t ? !1 : t.some((o) => o.contains(e));
653
716
  }
654
- function U(e, t = null) {
717
+ function Y(e, t = null) {
655
718
  if (e instanceof Element && e.closest("[data-react-aria-top-layer]"))
656
719
  return !0;
657
- for (let { scopeRef: o } of h.traverse(h.getTreeNode(t)))
658
- if (w(e, o.current))
720
+ for (let { scopeRef: o } of $.traverse($.getTreeNode(t)))
721
+ if (o && E(e, o.current))
659
722
  return !0;
660
723
  return !1;
661
724
  }
662
- function jt(e) {
663
- return U(e, v);
725
+ function oo(e) {
726
+ return Y(e, v);
664
727
  }
665
- function G(e, t) {
728
+ function X(e, t) {
666
729
  var o;
667
- let r = (o = h.getTreeNode(t)) === null || o === void 0 ? void 0 : o.parent;
730
+ let r = (o = $.getTreeNode(t)) === null || o === void 0 ? void 0 : o.parent;
668
731
  for (; r; ) {
669
732
  if (r.scopeRef === e)
670
733
  return !0;
@@ -672,7 +735,7 @@ function G(e, t) {
672
735
  }
673
736
  return !1;
674
737
  }
675
- function k(e, t = !1) {
738
+ function x(e, t = !1) {
676
739
  if (e != null && !t)
677
740
  try {
678
741
  ie(e);
@@ -684,34 +747,34 @@ function k(e, t = !1) {
684
747
  } catch {
685
748
  }
686
749
  }
687
- function Y(e, t = !0) {
688
- let o = e[0].previousElementSibling, r = x(F(e), {
750
+ function J(e, t = !0) {
751
+ let o = e[0].previousElementSibling, r = L(e), n = F(r, {
689
752
  tabbable: t
690
753
  }, e);
691
- r.currentNode = o;
692
- let n = r.nextNode();
693
- t && !n && (r = x(F(e), {
754
+ n.currentNode = o;
755
+ let a = n.nextNode();
756
+ t && !a && (r = L(e), n = F(r, {
694
757
  tabbable: !1
695
- }, e), r.currentNode = o, n = r.nextNode()), k(n);
758
+ }, e), n.currentNode = o, a = n.nextNode()), x(a);
696
759
  }
697
- function Ut(e, t) {
698
- const o = y.useRef(t);
699
- T(() => {
700
- o.current && (v = e, w(document.activeElement, v.current) || Y(e.current)), o.current = !1;
760
+ function ro(e, t) {
761
+ const o = h.useRef(t);
762
+ S(() => {
763
+ o.current && (v = e, !E(document.activeElement, v.current) && e.current && J(e.current)), o.current = !1;
701
764
  }, [
702
765
  e
703
766
  ]);
704
767
  }
705
- function Gt(e, t, o) {
706
- E(() => {
768
+ function no(e, t, o) {
769
+ w(() => {
707
770
  if (t || o)
708
771
  return;
709
772
  let r = e.current, n = (a) => {
710
773
  let l = a.target;
711
- w(l, e.current) ? v = e : We(l) || (v = null);
774
+ E(l, e.current) ? v = e : Re(l) || (v = null);
712
775
  };
713
- return document.addEventListener("focusin", n, !1), r.forEach((a) => a.addEventListener("focusin", n, !1)), () => {
714
- document.removeEventListener("focusin", n, !1), r.forEach((a) => a.removeEventListener("focusin", n, !1));
776
+ return document.addEventListener("focusin", n, !1), r == null || r.forEach((a) => a.addEventListener("focusin", n, !1)), () => {
777
+ document.removeEventListener("focusin", n, !1), r == null || r.forEach((a) => a.removeEventListener("focusin", n, !1));
715
778
  };
716
779
  }, [
717
780
  e,
@@ -719,8 +782,8 @@ function Gt(e, t, o) {
719
782
  o
720
783
  ]);
721
784
  }
722
- function Yt(e) {
723
- let t = h.getTreeNode(v);
785
+ function ao(e) {
786
+ let t = $.getTreeNode(v);
724
787
  for (; t && t.scopeRef !== e; ) {
725
788
  if (t.nodeToRestore)
726
789
  return !1;
@@ -728,86 +791,103 @@ function Yt(e) {
728
791
  }
729
792
  return (t == null ? void 0 : t.scopeRef) === e;
730
793
  }
731
- function Xt(e, t, o) {
732
- const r = $(typeof document < "u" ? document.activeElement : null);
733
- E(() => {
794
+ function lo(e, t, o) {
795
+ const r = M(typeof document < "u" ? document.activeElement : null);
796
+ w(() => {
734
797
  let n = e.current;
735
798
  if (!t || o)
736
799
  return;
737
800
  let a = () => {
738
- (!v || G(v, e)) && (v = e);
801
+ (!v || X(v, e)) && E(document.activeElement, e.current) && (v = e);
739
802
  };
740
- return document.addEventListener("focusin", a, !1), n.forEach((l) => l.addEventListener("focusin", a, !1)), () => {
741
- document.removeEventListener("focusin", a, !1), n.forEach((l) => l.removeEventListener("focusin", a, !1));
803
+ return document.addEventListener("focusin", a, !1), n == null || n.forEach((l) => l.addEventListener("focusin", a, !1)), () => {
804
+ document.removeEventListener("focusin", a, !1), n == null || n.forEach((l) => l.removeEventListener("focusin", a, !1));
742
805
  };
743
806
  }, [
744
807
  e,
745
808
  o
746
- ]), E(() => {
809
+ ]), w(() => {
747
810
  if (!t)
748
811
  return;
749
- h.getTreeNode(e).nodeToRestore = r.current;
750
812
  let n = (a) => {
751
- if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey)
813
+ if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey || !A(e))
752
814
  return;
753
815
  let l = document.activeElement;
754
- if (!w(l, e.current))
816
+ if (!E(l, e.current))
755
817
  return;
756
- let i = h.getTreeNode(e).nodeToRestore, s = x(document.body, {
818
+ let s = $.getTreeNode(e);
819
+ if (!s)
820
+ return;
821
+ let i = s.nodeToRestore, d = F(document.body, {
757
822
  tabbable: !0
758
823
  });
759
- s.currentNode = l;
760
- let u = a.shiftKey ? s.previousNode() : s.nextNode();
761
- if ((!document.body.contains(i) || i === document.body) && (i = null, h.getTreeNode(e).nodeToRestore = null), (!u || !w(u, e.current)) && i) {
762
- s.currentNode = i;
824
+ d.currentNode = l;
825
+ let c = a.shiftKey ? d.previousNode() : d.nextNode();
826
+ if ((!i || !document.body.contains(i) || i === document.body) && (i = void 0, s.nodeToRestore = void 0), (!c || !E(c, e.current)) && i) {
827
+ d.currentNode = i;
763
828
  do
764
- u = a.shiftKey ? s.previousNode() : s.nextNode();
765
- while (w(u, e.current));
766
- a.preventDefault(), a.stopPropagation(), u ? k(u, !0) : We(i) ? k(i, !0) : l.blur();
829
+ c = a.shiftKey ? d.previousNode() : d.nextNode();
830
+ while (E(c, e.current));
831
+ a.preventDefault(), a.stopPropagation(), c ? x(c, !0) : Re(i) ? x(i, !0) : l.blur();
767
832
  }
768
833
  };
769
834
  return o || document.addEventListener("keydown", n, !0), () => {
770
835
  o || document.removeEventListener("keydown", n, !0);
771
- let a = h.getTreeNode(e).nodeToRestore;
772
- if (t && a && (w(document.activeElement, e.current) || document.activeElement === document.body && Yt(e))) {
773
- let l = h.clone();
774
- requestAnimationFrame(() => {
775
- if (document.activeElement === document.body) {
776
- let i = l.getTreeNode(e);
777
- for (; i; ) {
778
- if (i.nodeToRestore && document.body.contains(i.nodeToRestore)) {
779
- k(i.nodeToRestore);
780
- return;
781
- }
782
- i = i.parent;
783
- }
784
- for (i = l.getTreeNode(e); i; ) {
785
- if (i.scopeRef && h.getTreeNode(i.scopeRef)) {
786
- Y(i.scopeRef.current, !0);
787
- return;
788
- }
789
- i = i.parent;
790
- }
791
- }
792
- });
793
- }
794
836
  };
795
837
  }, [
796
838
  e,
797
839
  t,
798
840
  o
841
+ ]), w(() => {
842
+ if (!t)
843
+ return;
844
+ let n = $.getTreeNode(e);
845
+ if (!!n) {
846
+ var a;
847
+ return n.nodeToRestore = (a = r.current) !== null && a !== void 0 ? a : void 0, () => {
848
+ let l = $.getTreeNode(e);
849
+ if (!l)
850
+ return;
851
+ let s = l.nodeToRestore;
852
+ if (t && s && (E(document.activeElement, e.current) || document.activeElement === document.body && ao(e))) {
853
+ let i = $.clone();
854
+ requestAnimationFrame(() => {
855
+ if (document.activeElement === document.body) {
856
+ let d = i.getTreeNode(e);
857
+ for (; d; ) {
858
+ if (d.nodeToRestore && document.body.contains(d.nodeToRestore)) {
859
+ x(d.nodeToRestore);
860
+ return;
861
+ }
862
+ d = d.parent;
863
+ }
864
+ for (d = i.getTreeNode(e); d; ) {
865
+ if (d.scopeRef && d.scopeRef.current && $.getTreeNode(d.scopeRef)) {
866
+ J(d.scopeRef.current, !0);
867
+ return;
868
+ }
869
+ d = d.parent;
870
+ }
871
+ }
872
+ });
873
+ }
874
+ };
875
+ }
876
+ }, [
877
+ e,
878
+ t
799
879
  ]);
800
880
  }
801
- function x(e, t, o) {
802
- let r = t != null && t.tabbable ? Kt : Vt, n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
881
+ function F(e, t, o) {
882
+ let r = t != null && t.tabbable ? eo : Zt, n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
803
883
  acceptNode(a) {
804
884
  var l;
805
- return !(t == null || (l = t.from) === null || l === void 0) && l.contains(a) ? NodeFilter.FILTER_REJECT : a.matches(r) && Ae(a) && (!o || w(a, o)) && (!(t != null && t.accept) || t.accept(a)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
885
+ return !(t == null || (l = t.from) === null || l === void 0) && l.contains(a) ? NodeFilter.FILTER_REJECT : a.matches(r) && Ie(a) && (!o || E(a, o)) && (!(t != null && t.accept) || t.accept(a)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
806
886
  }
807
887
  });
808
888
  return t != null && t.from && (n.currentNode = t.from), n;
809
889
  }
810
- class pe {
890
+ class me {
811
891
  get size() {
812
892
  return this.fastMap.size;
813
893
  }
@@ -815,7 +895,10 @@ class pe {
815
895
  return this.fastMap.get(t);
816
896
  }
817
897
  addTreeNode(t, o, r) {
818
- let n = this.fastMap.get(o != null ? o : null), a = new se({
898
+ let n = this.fastMap.get(o != null ? o : null);
899
+ if (!n)
900
+ return;
901
+ let a = new se({
819
902
  scopeRef: t
820
903
  });
821
904
  n.addChild(a), a.parent = n, this.fastMap.set(t, a), r && (a.nodeToRestore = r);
@@ -826,11 +909,14 @@ class pe {
826
909
  removeTreeNode(t) {
827
910
  if (t === null)
828
911
  return;
829
- let o = this.fastMap.get(t), r = o.parent;
912
+ let o = this.fastMap.get(t);
913
+ if (!o)
914
+ return;
915
+ let r = o.parent;
830
916
  for (let a of this.traverse())
831
- a !== o && o.nodeToRestore && a.nodeToRestore && o.scopeRef.current && w(a.nodeToRestore, o.scopeRef.current) && (a.nodeToRestore = o.nodeToRestore);
917
+ a !== o && o.nodeToRestore && a.nodeToRestore && o.scopeRef && o.scopeRef.current && E(a.nodeToRestore, o.scopeRef.current) && (a.nodeToRestore = o.nodeToRestore);
832
918
  let n = o.children;
833
- r.removeChild(o), n.size > 0 && n.forEach((a) => r.addChild(a)), this.fastMap.delete(o.scopeRef);
919
+ r && (r.removeChild(o), n.size > 0 && n.forEach((a) => r && r.addChild(a))), this.fastMap.delete(o.scopeRef);
834
920
  }
835
921
  *traverse(t = this.root) {
836
922
  if (t.scopeRef != null && (yield t), t.children.size > 0)
@@ -838,13 +924,15 @@ class pe {
838
924
  yield* this.traverse(o);
839
925
  }
840
926
  clone() {
841
- let t = new pe();
842
- for (let o of this.traverse())
843
- t.addTreeNode(o.scopeRef, o.parent.scopeRef, o.nodeToRestore);
844
- return t;
927
+ var t;
928
+ let o = new me();
929
+ var r;
930
+ for (let n of this.traverse())
931
+ o.addTreeNode(n.scopeRef, (r = (t = n.parent) === null || t === void 0 ? void 0 : t.scopeRef) !== null && r !== void 0 ? r : null, n.nodeToRestore);
932
+ return o;
845
933
  }
846
934
  constructor() {
847
- ae(this, "fastMap", /* @__PURE__ */ new Map()), this.root = new se({
935
+ this.fastMap = /* @__PURE__ */ new Map(), this.root = new se({
848
936
  scopeRef: null
849
937
  }), this.fastMap.set(null, this.root);
850
938
  }
@@ -857,56 +945,56 @@ class se {
857
945
  this.children.delete(t), t.parent = void 0;
858
946
  }
859
947
  constructor(t) {
860
- ae(this, "children", /* @__PURE__ */ new Set()), ae(this, "contain", !1), this.scopeRef = t.scopeRef;
948
+ this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = t.scopeRef;
861
949
  }
862
950
  }
863
- let h = new pe();
864
- const Jt = /* @__PURE__ */ new WeakMap(), P = [];
865
- function Qt(e, t) {
866
- let { onClose: o, shouldCloseOnBlur: r, isOpen: n, isDismissable: a = !1, isKeyboardDismissDisabled: l = !1, shouldCloseOnInteractOutside: i } = e;
867
- T(() => (n && P.push(t), () => {
868
- let p = P.indexOf(t);
869
- p >= 0 && P.splice(p, 1);
951
+ let $ = new me();
952
+ const io = /* @__PURE__ */ new WeakMap(), T = [];
953
+ function so(e, t) {
954
+ let { onClose: o, shouldCloseOnBlur: r, isOpen: n, isDismissable: a = !1, isKeyboardDismissDisabled: l = !1, shouldCloseOnInteractOutside: s } = e;
955
+ S(() => (n && T.push(t), () => {
956
+ let g = T.indexOf(t);
957
+ g >= 0 && T.splice(g, 1);
870
958
  }), [
871
959
  n,
872
960
  t
873
961
  ]);
874
- let s = () => {
875
- P[P.length - 1] === t && o && o();
876
- }, u = (p) => {
877
- (!i || i(p.target)) && P[P.length - 1] === t && (p.stopPropagation(), p.preventDefault());
878
- }, c = (p) => {
879
- (!i || i(p.target)) && (P[P.length - 1] === t && (p.stopPropagation(), p.preventDefault()), s());
880
- }, f = (p) => {
881
- p.key === "Escape" && !l && (p.stopPropagation(), p.preventDefault(), s());
962
+ let i = () => {
963
+ T[T.length - 1] === t && o && o();
964
+ }, d = (g) => {
965
+ (!s || s(g.target)) && T[T.length - 1] === t && (g.stopPropagation(), g.preventDefault());
966
+ }, c = (g) => {
967
+ (!s || s(g.target)) && (T[T.length - 1] === t && (g.stopPropagation(), g.preventDefault()), i());
968
+ }, p = (g) => {
969
+ g.key === "Escape" && !l && (g.stopPropagation(), g.preventDefault(), i());
882
970
  };
883
- Wt({
971
+ Gt({
884
972
  ref: t,
885
- onInteractOutside: a ? c : null,
886
- onInteractOutsideStart: u
973
+ onInteractOutside: a && n ? c : null,
974
+ onInteractOutsideStart: d
887
975
  });
888
- let { focusWithinProps: m } = At({
976
+ let { focusWithinProps: m } = Ut({
889
977
  isDisabled: !r,
890
- onBlurWithin: (p) => {
891
- p.relatedTarget && jt(p.relatedTarget) || (!i || i(p.relatedTarget)) && o();
978
+ onBlurWithin: (g) => {
979
+ !g.relatedTarget || oo(g.relatedTarget) || (!s || s(g.relatedTarget)) && o();
892
980
  }
893
- }), b = (p) => {
894
- p.target === p.currentTarget && p.preventDefault();
981
+ }), f = (g) => {
982
+ g.target === g.currentTarget && g.preventDefault();
895
983
  };
896
984
  return {
897
985
  overlayProps: {
898
- onKeyDown: f,
986
+ onKeyDown: p,
899
987
  ...m
900
988
  },
901
989
  underlayProps: {
902
- onPointerDown: b
990
+ onPointerDown: f
903
991
  }
904
992
  };
905
993
  }
906
- function Zt(e, t, o) {
994
+ function uo(e, t, o) {
907
995
  let { type: r } = e, { isOpen: n } = t;
908
- T(() => {
909
- o && o.current && Jt.set(o.current, t.close);
996
+ S(() => {
997
+ o && o.current && io.set(o.current, t.close);
910
998
  });
911
999
  let a;
912
1000
  r === "menu" ? a = !0 : r === "listbox" && (a = "listbox");
@@ -923,7 +1011,7 @@ function Zt(e, t, o) {
923
1011
  }
924
1012
  };
925
1013
  }
926
- const te = typeof window < "u" && window.visualViewport, eo = /* @__PURE__ */ new Set([
1014
+ const oe = typeof document < "u" && window.visualViewport, co = /* @__PURE__ */ new Set([
927
1015
  "checkbox",
928
1016
  "radio",
929
1017
  "range",
@@ -934,50 +1022,50 @@ const te = typeof window < "u" && window.visualViewport, eo = /* @__PURE__ */ ne
934
1022
  "submit",
935
1023
  "reset"
936
1024
  ]);
937
- let V = 0, oe;
938
- function to(e = {}) {
1025
+ let _ = 0, re;
1026
+ function mo(e = {}) {
939
1027
  let { isDisabled: t } = e;
940
- E(() => {
1028
+ w(() => {
941
1029
  if (!t)
942
- return V++, V === 1 && (kt() ? oe = ro() : oe = oo()), () => {
943
- V--, V === 0 && oe();
1030
+ return _++, _ === 1 && (Ot() ? re = fo() : re = po()), () => {
1031
+ _--, _ === 0 && re();
944
1032
  };
945
1033
  }, [
946
1034
  t
947
1035
  ]);
948
1036
  }
949
- function oo() {
950
- return j(I(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), I(document.documentElement, "overflow", "hidden"));
1037
+ function po() {
1038
+ return G(I(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), I(document.documentElement, "overflow", "hidden"));
951
1039
  }
952
- function ro() {
953
- let e, t = 0, o = (f) => {
954
- e = De(f.target), !(e === document.documentElement && e === document.body) && (t = f.changedTouches[0].pageY);
955
- }, r = (f) => {
956
- if (e === document.documentElement || e === document.body) {
957
- f.preventDefault();
1040
+ function fo() {
1041
+ let e, t = 0, o = (p) => {
1042
+ e = Ae(p.target), !(e === document.documentElement && e === document.body) && (t = p.changedTouches[0].pageY);
1043
+ }, r = (p) => {
1044
+ if (!e || e === document.documentElement || e === document.body) {
1045
+ p.preventDefault();
958
1046
  return;
959
1047
  }
960
- let m = f.changedTouches[0].pageY, b = e.scrollTop, p = e.scrollHeight - e.clientHeight;
961
- (b <= 0 && m > t || b >= p && m < t) && f.preventDefault(), t = m;
962
- }, n = (f) => {
963
- let m = f.target;
964
- xe(m) && m !== document.activeElement && (f.preventDefault(), m.style.transform = "translateY(-2000px)", m.focus(), requestAnimationFrame(() => {
1048
+ let m = p.changedTouches[0].pageY, f = e.scrollTop, g = e.scrollHeight - e.clientHeight;
1049
+ g !== 0 && ((f <= 0 && m > t || f >= g && m < t) && p.preventDefault(), t = m);
1050
+ }, n = (p) => {
1051
+ let m = p.target;
1052
+ Te(m) && m !== document.activeElement && (p.preventDefault(), m.style.transform = "translateY(-2000px)", m.focus(), requestAnimationFrame(() => {
965
1053
  m.style.transform = "";
966
1054
  }));
967
- }, a = (f) => {
968
- let m = f.target;
969
- xe(m) && (m.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
970
- m.style.transform = "", te && (te.height < window.innerHeight ? requestAnimationFrame(() => {
971
- Te(m);
972
- }) : te.addEventListener("resize", () => Te(m), {
1055
+ }, a = (p) => {
1056
+ let m = p.target;
1057
+ Te(m) && (m.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
1058
+ m.style.transform = "", oe && (oe.height < window.innerHeight ? requestAnimationFrame(() => {
1059
+ ke(m);
1060
+ }) : oe.addEventListener("resize", () => ke(m), {
973
1061
  once: !0
974
1062
  }));
975
1063
  }));
976
1064
  }, l = () => {
977
1065
  window.scrollTo(0, 0);
978
- }, i = window.pageXOffset, s = window.pageYOffset, u = j(I(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), I(document.documentElement, "overflow", "hidden"), I(document.body, "marginTop", `-${s}px`));
1066
+ }, s = window.pageXOffset, i = window.pageYOffset, d = G(I(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), I(document.documentElement, "overflow", "hidden"), I(document.body, "marginTop", `-${i}px`));
979
1067
  window.scrollTo(0, 0);
980
- let c = j(O(document, "touchstart", o, {
1068
+ let c = G(O(document, "touchstart", o, {
981
1069
  passive: !1,
982
1070
  capture: !0
983
1071
  }), O(document, "touchmove", r, {
@@ -988,7 +1076,7 @@ function ro() {
988
1076
  capture: !0
989
1077
  }), O(document, "focus", a, !0), O(window, "scroll", l));
990
1078
  return () => {
991
- u(), c(), window.scrollTo(i, s);
1079
+ d(), c(), window.scrollTo(s, i);
992
1080
  };
993
1081
  }
994
1082
  function I(e, t, o) {
@@ -1002,10 +1090,10 @@ function O(e, t, o, r) {
1002
1090
  e.removeEventListener(t, o, r);
1003
1091
  };
1004
1092
  }
1005
- function Te(e) {
1093
+ function ke(e) {
1006
1094
  let t = document.scrollingElement || document.documentElement;
1007
1095
  for (; e && e !== t; ) {
1008
- let o = De(e);
1096
+ let o = Ae(e);
1009
1097
  if (o !== document.documentElement && o !== document.body && o !== e) {
1010
1098
  let r = o.getBoundingClientRect().top, n = e.getBoundingClientRect().top;
1011
1099
  n > r + e.clientHeight && (o.scrollTop += n - r);
@@ -1013,44 +1101,44 @@ function Te(e) {
1013
1101
  e = o.parentElement;
1014
1102
  }
1015
1103
  }
1016
- function xe(e) {
1017
- return e instanceof HTMLInputElement && !eo.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
1104
+ function Te(e) {
1105
+ return e instanceof HTMLInputElement && !co.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
1018
1106
  }
1019
- let D = /* @__PURE__ */ new WeakMap(), M = [];
1020
- function no(e, t = document.body) {
1021
- let o = new Set(e), r = /* @__PURE__ */ new Set(), n = (s) => {
1022
- for (let m of s.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))
1107
+ let D = /* @__PURE__ */ new WeakMap(), y = [];
1108
+ function go(e, t = document.body) {
1109
+ let o = new Set(e), r = /* @__PURE__ */ new Set(), n = (i) => {
1110
+ for (let m of i.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))
1023
1111
  o.add(m);
1024
- let u = (m) => {
1112
+ let d = (m) => {
1025
1113
  if (o.has(m) || r.has(m.parentElement) && m.parentElement.getAttribute("role") !== "row")
1026
1114
  return NodeFilter.FILTER_REJECT;
1027
- for (let b of o)
1028
- if (m.contains(b))
1115
+ for (let f of o)
1116
+ if (m.contains(f))
1029
1117
  return NodeFilter.FILTER_SKIP;
1030
1118
  return NodeFilter.FILTER_ACCEPT;
1031
- }, c = document.createTreeWalker(s, NodeFilter.SHOW_ELEMENT, {
1032
- acceptNode: u
1033
- }), f = u(s);
1034
- if (f === NodeFilter.FILTER_ACCEPT && a(s), f !== NodeFilter.FILTER_REJECT) {
1119
+ }, c = document.createTreeWalker(i, NodeFilter.SHOW_ELEMENT, {
1120
+ acceptNode: d
1121
+ }), p = d(i);
1122
+ if (p === NodeFilter.FILTER_ACCEPT && a(i), p !== NodeFilter.FILTER_REJECT) {
1035
1123
  let m = c.nextNode();
1036
1124
  for (; m != null; )
1037
1125
  a(m), m = c.nextNode();
1038
1126
  }
1039
- }, a = (s) => {
1040
- var u;
1041
- let c = (u = D.get(s)) !== null && u !== void 0 ? u : 0;
1042
- s.getAttribute("aria-hidden") === "true" && c === 0 || (c === 0 && s.setAttribute("aria-hidden", "true"), r.add(s), D.set(s, c + 1));
1127
+ }, a = (i) => {
1128
+ var d;
1129
+ let c = (d = D.get(i)) !== null && d !== void 0 ? d : 0;
1130
+ i.getAttribute("aria-hidden") === "true" && c === 0 || (c === 0 && i.setAttribute("aria-hidden", "true"), r.add(i), D.set(i, c + 1));
1043
1131
  };
1044
- M.length && M[M.length - 1].disconnect(), n(t);
1045
- let l = new MutationObserver((s) => {
1046
- for (let u of s)
1047
- if (!(u.type !== "childList" || u.addedNodes.length === 0) && ![
1132
+ y.length && y[y.length - 1].disconnect(), n(t);
1133
+ let l = new MutationObserver((i) => {
1134
+ for (let d of i)
1135
+ if (!(d.type !== "childList" || d.addedNodes.length === 0) && ![
1048
1136
  ...o,
1049
1137
  ...r
1050
- ].some((c) => c.contains(u.target))) {
1051
- for (let c of u.removedNodes)
1138
+ ].some((c) => c.contains(d.target))) {
1139
+ for (let c of d.removedNodes)
1052
1140
  c instanceof Element && (o.delete(c), r.delete(c));
1053
- for (let c of u.addedNodes)
1141
+ for (let c of d.addedNodes)
1054
1142
  (c instanceof HTMLElement || c instanceof SVGElement) && (c.dataset.liveAnnouncer === "true" || c.dataset.reactAriaTopLayer === "true") ? o.add(c) : c instanceof Element && n(c);
1055
1143
  }
1056
1144
  });
@@ -1058,7 +1146,7 @@ function no(e, t = document.body) {
1058
1146
  childList: !0,
1059
1147
  subtree: !0
1060
1148
  });
1061
- let i = {
1149
+ let s = {
1062
1150
  observe() {
1063
1151
  l.observe(t, {
1064
1152
  childList: !0,
@@ -1069,68 +1157,68 @@ function no(e, t = document.body) {
1069
1157
  l.disconnect();
1070
1158
  }
1071
1159
  };
1072
- return M.push(i), () => {
1160
+ return y.push(s), () => {
1073
1161
  l.disconnect();
1074
- for (let s of r) {
1075
- let u = D.get(s);
1076
- u === 1 ? (s.removeAttribute("aria-hidden"), D.delete(s)) : D.set(s, u - 1);
1162
+ for (let i of r) {
1163
+ let d = D.get(i);
1164
+ d === 1 ? (i.removeAttribute("aria-hidden"), D.delete(i)) : D.set(i, d - 1);
1077
1165
  }
1078
- i === M[M.length - 1] ? (M.pop(), M.length && M[M.length - 1].observe()) : M.splice(M.indexOf(i), 1);
1166
+ s === y[y.length - 1] ? (y.pop(), y.length && y[y.length - 1].observe()) : y.splice(y.indexOf(s), 1);
1079
1167
  };
1080
1168
  }
1081
- const ze = /* @__PURE__ */ y.createContext(null);
1082
- function ao(e) {
1083
- let t = st(), { portalContainer: o = t ? null : document.body } = e, [r, n] = X(!1), a = K(() => ({
1084
- contain: r,
1085
- setContain: n
1169
+ const ze = /* @__PURE__ */ h.createContext(null);
1170
+ function bo(e) {
1171
+ let t = Ce(), { portalContainer: o = t ? null : document.body, isExiting: r } = e, [n, a] = z(!1), l = W(() => ({
1172
+ contain: n,
1173
+ setContain: a
1086
1174
  }), [
1087
- r,
1088
- n
1175
+ n,
1176
+ a
1089
1177
  ]);
1090
1178
  if (!o)
1091
1179
  return null;
1092
- let l = /* @__PURE__ */ y.createElement(ze.Provider, {
1093
- value: a
1094
- }, /* @__PURE__ */ y.createElement(Rt, {
1180
+ let s = e.children;
1181
+ return e.disableFocusManagement || (s = /* @__PURE__ */ h.createElement(Jt, {
1095
1182
  restoreFocus: !0,
1096
- contain: r
1097
- }, e.children));
1098
- return /* @__PURE__ */ rt.createPortal(l, o);
1183
+ contain: n && !r
1184
+ }, s)), s = /* @__PURE__ */ h.createElement(ze.Provider, {
1185
+ value: l
1186
+ }, /* @__PURE__ */ h.createElement(It, null, s)), /* @__PURE__ */ at.createPortal(s, o);
1099
1187
  }
1100
1188
  function qe() {
1101
- let e = A(ze), t = e == null ? void 0 : e.setContain;
1102
- E(() => {
1189
+ let e = q(ze), t = e == null ? void 0 : e.setContain;
1190
+ w(() => {
1103
1191
  t == null || t(!0);
1104
1192
  }, [
1105
1193
  t
1106
1194
  ]);
1107
1195
  }
1108
- function lo(e, t, o) {
1109
- let { overlayProps: r, underlayProps: n } = Qt({
1196
+ function vo(e, t, o) {
1197
+ let { overlayProps: r, underlayProps: n } = so({
1110
1198
  ...e,
1111
1199
  isOpen: t.isOpen,
1112
1200
  onClose: t.close
1113
1201
  }, o);
1114
- return to({
1202
+ return mo({
1115
1203
  isDisabled: !t.isOpen
1116
- }), qe(), T(() => {
1204
+ }), qe(), S(() => {
1117
1205
  if (t.isOpen)
1118
- return no([
1206
+ return go([
1119
1207
  o.current
1120
1208
  ]);
1121
1209
  }, [
1122
1210
  t.isOpen,
1123
1211
  o
1124
1212
  ]), {
1125
- modalProps: pt(r),
1213
+ modalProps: Mt(r),
1126
1214
  underlayProps: n
1127
1215
  };
1128
1216
  }
1129
- function io(e, t) {
1130
- let { role: o = "dialog" } = e, r = mt();
1217
+ function $o(e, t) {
1218
+ let { role: o = "dialog" } = e, r = wt();
1131
1219
  r = e["aria-label"] ? void 0 : r;
1132
- let n = $(!1);
1133
- return T(() => {
1220
+ let n = M(!1);
1221
+ return S(() => {
1134
1222
  if (t.current && !t.current.contains(document.activeElement)) {
1135
1223
  ie(t.current);
1136
1224
  let a = setTimeout(() => {
@@ -1144,7 +1232,7 @@ function io(e, t) {
1144
1232
  t
1145
1233
  ]), qe(), {
1146
1234
  dialogProps: {
1147
- ...vt(e, {
1235
+ ...xt(e, {
1148
1236
  labelable: !0
1149
1237
  }),
1150
1238
  role: o,
@@ -1159,7 +1247,7 @@ function io(e, t) {
1159
1247
  }
1160
1248
  };
1161
1249
  }
1162
- function so(e, t, o) {
1250
+ function ho(e, t, o) {
1163
1251
  return t in e ? Object.defineProperty(e, t, {
1164
1252
  value: o,
1165
1253
  enumerable: !0,
@@ -1167,7 +1255,7 @@ function so(e, t, o) {
1167
1255
  writable: !0
1168
1256
  }) : e[t] = o, e;
1169
1257
  }
1170
- function Fe(e, t) {
1258
+ function xe(e, t) {
1171
1259
  var o = Object.keys(e);
1172
1260
  if (Object.getOwnPropertySymbols) {
1173
1261
  var r = Object.getOwnPropertySymbols(e);
@@ -1180,48 +1268,45 @@ function Fe(e, t) {
1180
1268
  function Se(e) {
1181
1269
  for (var t = 1; t < arguments.length; t++) {
1182
1270
  var o = arguments[t] != null ? arguments[t] : {};
1183
- t % 2 ? Fe(Object(o), !0).forEach(function(r) {
1184
- so(e, r, o[r]);
1185
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : Fe(Object(o)).forEach(function(r) {
1271
+ t % 2 ? xe(Object(o), !0).forEach(function(r) {
1272
+ ho(e, r, o[r]);
1273
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : xe(Object(o)).forEach(function(r) {
1186
1274
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(o, r));
1187
1275
  });
1188
1276
  }
1189
1277
  return e;
1190
1278
  }
1191
- var uo = (e, t, o) => {
1279
+ var wo = (e, t, o) => {
1192
1280
  for (var r of Object.keys(e)) {
1193
1281
  var n;
1194
1282
  if (e[r] !== ((n = t[r]) !== null && n !== void 0 ? n : o[r]))
1195
1283
  return !1;
1196
1284
  }
1197
1285
  return !0;
1198
- }, Re = (e) => (t) => {
1286
+ }, Ve = (e) => (t) => {
1199
1287
  var o = e.defaultClassName, r = Se(Se({}, e.defaultVariants), t);
1200
1288
  for (var n in r) {
1201
1289
  var a, l = (a = r[n]) !== null && a !== void 0 ? a : e.defaultVariants[n];
1202
1290
  if (l != null) {
1203
- var i = l;
1204
- typeof i == "boolean" && (i = i === !0 ? "true" : "false");
1205
- var s = e.variantClassNames[n][i];
1206
- s && (o += " " + s);
1291
+ var s = l;
1292
+ typeof s == "boolean" && (s = s === !0 ? "true" : "false");
1293
+ var i = e.variantClassNames[n][s];
1294
+ i && (o += " " + i);
1207
1295
  }
1208
1296
  }
1209
- for (var [u, c] of e.compoundVariants)
1210
- uo(u, r, e.defaultVariants) && (o += " " + c);
1297
+ for (var [d, c] of e.compoundVariants)
1298
+ wo(d, r, e.defaultVariants) && (o += " " + c);
1211
1299
  return o;
1212
- }, co = "_3moto2o", mo = "_3moto2q", po = "_3moto2r", He = "_3moto2p", fo = Re({ 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: [] }), go = "_3moto2n", bo = Re({ defaultClassName: "_3moto2e", variantClassNames: { kind: { form: "_3moto2f", delete: "_3moto2g", failure: "_3moto2h", informational: "_3moto2i", success: "_3moto2j", warning: "_3moto2k", successWithFailures: "_3moto2l" } }, defaultVariants: {}, compoundVariants: [] }), vo = "_3moto2m", ho = "_3moto2s";
1213
- function Ve({
1300
+ }, Eo = "_3moto2o", Mo = "_3moto2q", yo = "_3moto2r", He = "_3moto2p", Po = Ve({ 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: [] }), ko = "_3moto2n", To = Ve({ defaultClassName: "_3moto2e", variantClassNames: { kind: { form: "_3moto2f", delete: "_3moto2g", failure: "_3moto2h", informational: "_3moto2i", success: "_3moto2j", warning: "_3moto2k", successWithFailures: "_3moto2l" } }, defaultVariants: {}, compoundVariants: [] }), xo = "_3moto2m", So = "_3moto2s";
1301
+ function Ke({
1214
1302
  children: e,
1215
1303
  className: t = "",
1216
1304
  ...o
1217
1305
  }) {
1218
- return /* @__PURE__ */ d.createElement("div", {
1219
- className: re(He, t),
1220
- ...o
1221
- }, e);
1306
+ return /* @__PURE__ */ u.createElement("div", { className: ne(He, t), ...o }, e);
1222
1307
  }
1223
- Be.set(Ve, { name: "ModalFooter" });
1224
- const Le = Object.freeze({
1308
+ Le.set(Ke, { name: "ModalFooter" });
1309
+ const Fe = Object.freeze({
1225
1310
  form: "pencil",
1226
1311
  delete: "trash",
1227
1312
  failure: "status-error",
@@ -1230,7 +1315,7 @@ const Le = Object.freeze({
1230
1315
  successWithFailures: "status-warning",
1231
1316
  warning: "status-warning"
1232
1317
  });
1233
- function $o({
1318
+ function Fo({
1234
1319
  children: e,
1235
1320
  className: t,
1236
1321
  "data-testid": o,
@@ -1238,74 +1323,68 @@ function $o({
1238
1323
  onBlur: n,
1239
1324
  onFocus: a,
1240
1325
  overlayProps: l,
1241
- size: i = "sm",
1242
- state: s,
1243
- title: u,
1326
+ size: s = "sm",
1327
+ state: i,
1328
+ title: d,
1244
1329
  dismissable: c = !0,
1245
- onClose: f,
1330
+ onClose: p,
1246
1331
  fullHeight: m = !1,
1247
- ...b
1332
+ ...f
1248
1333
  }) {
1249
- const p = d.useRef(null), { modalProps: N, underlayProps: z } = lo(
1334
+ const g = u.useRef(null), { modalProps: P, underlayProps: je } = vo(
1250
1335
  {
1251
1336
  isDismissable: c,
1252
1337
  isKeyboardDismissDisabled: !c,
1253
- ...b
1338
+ ...f
1254
1339
  },
1255
- s,
1256
- p
1257
- ), { dialogProps: J, titleProps: _e } = io(b, p), je = ve(N.onFocus, J.onFocus, a), Ue = ve(N.onBlur, J.onBlur, n), { t: Ge } = d.useContext(Qe), Ye = Ze({ "data-testid": o }), [Q, Xe] = et(
1340
+ i,
1341
+ g
1342
+ ), { dialogProps: Q, titleProps: Ue } = $o(f, g), Ge = be(P.onFocus, Q.onFocus, a), Ye = be(P.onBlur, Q.onBlur, n), { t: Xe } = u.useContext(et), Je = tt({ "data-testid": o }), [Z, Qe] = ot(
1258
1343
  e,
1259
- [{ type: Ve }]
1344
+ [{ type: Ke }]
1260
1345
  );
1261
- function fe() {
1262
- f && typeof f == "function" && f(), s.close();
1346
+ function pe() {
1347
+ p && typeof p == "function" && p(), i.close();
1263
1348
  }
1264
- const ge = function() {
1265
- return c ? /* @__PURE__ */ d.createElement(he, {
1266
- "aria-label": "Close",
1267
- onClick: fe,
1268
- kind: "icon",
1269
- icon: "x",
1270
- className: mo
1271
- }) : null;
1272
- }, Je = tt(Xe, (be) => be.type === ge ? [{ className: re(be.props.classname, po) }] : []);
1273
- return /* @__PURE__ */ d.createElement(ao, null, /* @__PURE__ */ d.createElement("div", {
1274
- className: ho,
1275
- ...z,
1276
- ...b
1277
- }, /* @__PURE__ */ d.createElement("div", {
1278
- ...N,
1279
- ...J,
1280
- ...l,
1281
- onFocus: je,
1282
- onBlur: Ue,
1283
- ...Ye("dialog"),
1284
- ref: p,
1285
- className: re(fo({ kind: r, size: i, fullHeight: m }), t)
1286
- }, /* @__PURE__ */ d.createElement("div", {
1287
- ..._e,
1288
- className: bo({ kind: r })
1289
- }, r && /* @__PURE__ */ d.createElement(ot, {
1290
- icon: Le[r] || Le.informational,
1291
- className: go
1292
- }), /* @__PURE__ */ d.createElement("div", {
1293
- className: vo
1294
- }, Z(u, s.close)), /* @__PURE__ */ d.createElement(ge, null)), /* @__PURE__ */ d.createElement("div", {
1295
- className: co
1296
- }, Z(Je, s.close)), Q && Q.length > 0 ? /* @__PURE__ */ d.createElement(d.Fragment, null, Z(Q, s.close)) : /* @__PURE__ */ d.createElement("div", {
1297
- className: He
1298
- }, /* @__PURE__ */ d.createElement(he, {
1299
- kind: "key",
1300
- onClick: fe
1301
- }, Ge("design-system:modal.defaultButtonLabel"))))));
1302
- }
1303
- function Ke(e) {
1304
- return e.state.isOpen ? /* @__PURE__ */ d.createElement($o, {
1305
- ...e
1306
- }, e.children) : /* @__PURE__ */ d.createElement(d.Fragment, null);
1349
+ const fe = function() {
1350
+ return c ? /* @__PURE__ */ u.createElement(
1351
+ ve,
1352
+ {
1353
+ "aria-label": "Close",
1354
+ onClick: pe,
1355
+ kind: "icon",
1356
+ icon: "x",
1357
+ className: Mo
1358
+ }
1359
+ ) : null;
1360
+ }, Ze = rt(Qe, (ge) => ge.type === fe ? [{ className: ne(ge.props.classname, yo) }] : []);
1361
+ return /* @__PURE__ */ u.createElement(bo, null, /* @__PURE__ */ u.createElement("div", { className: So, ...je, ...f }, /* @__PURE__ */ u.createElement(
1362
+ "div",
1363
+ {
1364
+ ...P,
1365
+ ...Q,
1366
+ ...l,
1367
+ onFocus: Ge,
1368
+ onBlur: Ye,
1369
+ ...Je("dialog"),
1370
+ ref: g,
1371
+ className: ne(Po({ kind: r, size: s, fullHeight: m }), t)
1372
+ },
1373
+ /* @__PURE__ */ u.createElement("div", { ...Ue, className: To({ kind: r }) }, r && /* @__PURE__ */ u.createElement(
1374
+ nt,
1375
+ {
1376
+ icon: Fe[r] || Fe.informational,
1377
+ className: ko
1378
+ }
1379
+ ), /* @__PURE__ */ u.createElement("div", { className: xo }, ee(d, i.close)), /* @__PURE__ */ u.createElement(fe, null)),
1380
+ /* @__PURE__ */ u.createElement("div", { className: Eo }, ee(Ze, i.close)),
1381
+ Z && Z.length > 0 ? /* @__PURE__ */ u.createElement(u.Fragment, null, ee(Z, i.close)) : /* @__PURE__ */ u.createElement("div", { className: He }, /* @__PURE__ */ u.createElement(ve, { kind: "key", onClick: pe }, Xe("design-system:modal.defaultButtonLabel")))
1382
+ )));
1383
+ }
1384
+ function _e(e) {
1385
+ return e.state.isOpen ? /* @__PURE__ */ u.createElement(Fo, { ...e }, e.children) : /* @__PURE__ */ u.createElement(u.Fragment, null);
1307
1386
  }
1308
- Be.set(Ke, {
1387
+ Le.set(_e, {
1309
1388
  name: "Modal",
1310
1389
  props: {
1311
1390
  dismissable: { type: "boolean", default: "true" },
@@ -1318,24 +1397,32 @@ Be.set(Ke, {
1318
1397
  title: { type: "string" }
1319
1398
  }
1320
1399
  });
1321
- function wo(e) {
1322
- let [t, o] = nt(e.isOpen, e.defaultOpen || !1, e.onOpenChange);
1400
+ function Lo(e) {
1401
+ let [t, o] = lt(e.isOpen, e.defaultOpen || !1, e.onOpenChange);
1402
+ const r = k(() => {
1403
+ o(!0);
1404
+ }, [
1405
+ o
1406
+ ]), n = k(() => {
1407
+ o(!1);
1408
+ }, [
1409
+ o
1410
+ ]), a = k(() => {
1411
+ o(!t);
1412
+ }, [
1413
+ o,
1414
+ t
1415
+ ]);
1323
1416
  return {
1324
1417
  isOpen: t,
1325
1418
  setOpen: o,
1326
- open() {
1327
- o(!0);
1328
- },
1329
- close() {
1330
- o(!1);
1331
- },
1332
- toggle() {
1333
- o(!t);
1334
- }
1419
+ open: r,
1420
+ close: n,
1421
+ toggle: a
1335
1422
  };
1336
1423
  }
1337
- function xo(e = {}) {
1338
- const t = wo(e), o = $(null), { triggerProps: r, overlayProps: n } = Zt(
1424
+ function Wo(e = {}) {
1425
+ const t = Lo(e), o = M(null), { triggerProps: r, overlayProps: n } = uo(
1339
1426
  { type: "dialog" },
1340
1427
  t,
1341
1428
  o
@@ -1353,24 +1440,20 @@ function xo(e = {}) {
1353
1440
  modalProps: { overlayProps: n, state: t }
1354
1441
  };
1355
1442
  }
1356
- const Eo = {
1357
- description: () => /* @__PURE__ */ d.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."),
1358
- components: [Ke],
1443
+ const Bo = {
1444
+ 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."),
1445
+ components: [_e],
1359
1446
  examples: {
1360
1447
  general: {
1361
1448
  label: "Usage",
1362
- description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("h5", null, "Use a Modal:"), /* @__PURE__ */ d.createElement("ul", null, /* @__PURE__ */ d.createElement("li", null, "When the user needs to confirm a basic decision, such as deleting a record."), /* @__PURE__ */ d.createElement("li", null, "When important information needs to be displayed to the user before continuing."), /* @__PURE__ */ d.createElement("li", null, "When a simple selection, such as a single form input, is required before proceeding.")), /* @__PURE__ */ d.createElement("h5", null, "Avoid a Modal:"), /* @__PURE__ */ d.createElement("ul", null, /* @__PURE__ */ d.createElement("li", null, "When a complex form is required. Use a ", /* @__PURE__ */ d.createElement(e, {
1363
- to: "focused-task"
1364
- }, "Focused Task View"), " instead."), /* @__PURE__ */ d.createElement("li", null, "When sharing non-critical or tertiary information. Use a ", /* @__PURE__ */ d.createElement(e, {
1365
- to: "growlers"
1366
- }, "Growler"), " instead.")))
1449
+ description: ({ NavigateTo: e }) => /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("h5", null, "Use a Modal:"), /* @__PURE__ */ u.createElement("ul", null, /* @__PURE__ */ u.createElement("li", null, "When the user needs to confirm a basic decision, such as deleting a record."), /* @__PURE__ */ u.createElement("li", null, "When important information needs to be displayed to the user before continuing."), /* @__PURE__ */ u.createElement("li", null, "When a simple selection, such as a single form input, is required before proceeding.")), /* @__PURE__ */ u.createElement("h5", null, "Avoid a Modal:"), /* @__PURE__ */ u.createElement("ul", null, /* @__PURE__ */ u.createElement("li", null, "When a complex form is required. Use a ", /* @__PURE__ */ u.createElement(e, { to: "focused-task" }, "Focused Task View"), " instead."), /* @__PURE__ */ u.createElement("li", null, "When sharing non-critical or tertiary information. Use a ", /* @__PURE__ */ u.createElement(e, { to: "growlers" }, "Growler"), " instead.")))
1367
1450
  },
1368
1451
  implementation: {
1369
1452
  label: "Close Button",
1370
- description: () => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("h5", null, "Close Button and Modal dismissiability"), /* @__PURE__ */ d.createElement("p", null, "Remove the Close Button in the upper right of the Modal if the user must choose the course of action before proceeding."), /* @__PURE__ */ d.createElement("p", null, "The close button is included by default and omitted when the prop ", /* @__PURE__ */ d.createElement("code", null, "dismissable"), " is set to ", /* @__PURE__ */ d.createElement("strong", null, "false"), "."), /* @__PURE__ */ d.createElement("p", null, "Setting the ", /* @__PURE__ */ d.createElement("code", null, "dismissable"), " prop to false also prevents dismissing the modal by clicking outside of the modal or by using the", " ", /* @__PURE__ */ d.createElement("strong", null, "escape"), " key.")),
1453
+ description: () => /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("h5", null, "Close Button and Modal dismissiability"), /* @__PURE__ */ u.createElement("p", null, "Remove the Close Button in the upper right of the Modal if the user must choose the course of action before proceeding."), /* @__PURE__ */ u.createElement("p", null, "The close button is included by default and omitted when the prop ", /* @__PURE__ */ u.createElement("code", null, "dismissable"), " is set to ", /* @__PURE__ */ u.createElement("strong", null, "false"), "."), /* @__PURE__ */ u.createElement("p", null, "Setting the ", /* @__PURE__ */ u.createElement("code", null, "dismissable"), " prop to false also prevents dismissing the modal by clicking outside of the modal or by using the", " ", /* @__PURE__ */ u.createElement("strong", null, "escape"), " key.")),
1371
1454
  examples: {
1372
1455
  basic: {
1373
- react: g`
1456
+ react: b`
1374
1457
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1375
1458
  import { sprinkles } from "@sps-woodland/tokens";
1376
1459
  import { Button } from "@sps-woodland/buttons";
@@ -1419,7 +1502,7 @@ const Eo = {
1419
1502
  },
1420
1503
  hooks: {
1421
1504
  label: "Using Hooks",
1422
- description: () => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("h5", null, "Using the hook"), /* @__PURE__ */ d.createElement("p", null, "To use any modals, you must call the ", /* @__PURE__ */ d.createElement("code", null, "useModal"), " hook. Optional arguments for this hook include:"), /* @__PURE__ */ d.createElement("dl", null, /* @__PURE__ */ d.createElement("dt", null, /* @__PURE__ */ d.createElement("code", null, "isOpen"), ": boolean"), /* @__PURE__ */ d.createElement("dd", null, "Whether the overlay is open by default (controlled)"), /* @__PURE__ */ d.createElement("dt", null, /* @__PURE__ */ d.createElement("code", null, "defaultOpen"), ": boolean"), /* @__PURE__ */ d.createElement("dd", null, "Whether the overlay is open by default (uncontrolled)."), /* @__PURE__ */ d.createElement("dt", null, /* @__PURE__ */ d.createElement("code", null, "onOpenChange"), ": function"), /* @__PURE__ */ d.createElement("dd", null, "Handler that is called when the overlay's open state changes.", /* @__PURE__ */ d.createElement("code", null, "(isOpen: boolean) => void"))), /* @__PURE__ */ d.createElement("h5", null, "Modal Props, Modal State, and Trigger Props"), /* @__PURE__ */ d.createElement("p", null, "The ", /* @__PURE__ */ d.createElement("code", null, "useModal"), " returns an object with ", /* @__PURE__ */ d.createElement("code", null, "modalProps"), ", ", /* @__PURE__ */ d.createElement("code", null, "modalState"), " and ", /* @__PURE__ */ d.createElement("code", null, "triggerProps")), /* @__PURE__ */ d.createElement("p", null, "The ", /* @__PURE__ */ d.createElement("code", null, "triggerProps"), " need to be spread on the element that triggers the modal."), /* @__PURE__ */ d.createElement("p", null, "The ", /* @__PURE__ */ d.createElement("code", null, "modalState"), " object (which is also included in ", /* @__PURE__ */ d.createElement("code", null, "modalProps"), ") allows programmatic access to the state of the modal. This includes a read only ", /* @__PURE__ */ d.createElement("code", null, "isOpen"), " property, a ", /* @__PURE__ */ d.createElement("code", null, "setOpen(isOpen: boolean)"), " method which can be use to set whether the overlay is open, an ", /* @__PURE__ */ d.createElement("code", null, "open()"), " method which open the overlay, a ", /* @__PURE__ */ d.createElement("code", null, "close()"), " method which closes the overlay and a ", /* @__PURE__ */ d.createElement("code", null, "toggle()"), " method that toggles the overlay's visiblity."), /* @__PURE__ */ d.createElement("p", null, "The ", /* @__PURE__ */ d.createElement("code", null, "modalProps"), " should be spread on the actual ", /* @__PURE__ */ d.createElement("code", null, "Modal"), " component."), /* @__PURE__ */ d.createElement("p", null, "Please refer to the examples to see its implementation"))
1505
+ description: () => /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("h5", null, "Using the hook"), /* @__PURE__ */ u.createElement("p", null, "To use any modals, you must call the ", /* @__PURE__ */ u.createElement("code", null, "useModal"), " hook. Optional arguments for this hook include:"), /* @__PURE__ */ u.createElement("dl", null, /* @__PURE__ */ u.createElement("dt", null, /* @__PURE__ */ u.createElement("code", null, "isOpen"), ": boolean"), /* @__PURE__ */ u.createElement("dd", null, "Whether the overlay is open by default (controlled)"), /* @__PURE__ */ u.createElement("dt", null, /* @__PURE__ */ u.createElement("code", null, "defaultOpen"), ": boolean"), /* @__PURE__ */ u.createElement("dd", null, "Whether the overlay is open by default (uncontrolled)."), /* @__PURE__ */ u.createElement("dt", null, /* @__PURE__ */ u.createElement("code", null, "onOpenChange"), ": function"), /* @__PURE__ */ u.createElement("dd", null, "Handler that is called when the overlay's open state changes.", /* @__PURE__ */ u.createElement("code", null, "(isOpen: boolean) => void"))), /* @__PURE__ */ u.createElement("h5", null, "Modal Props, Modal State, and Trigger Props"), /* @__PURE__ */ u.createElement("p", null, "The ", /* @__PURE__ */ u.createElement("code", null, "useModal"), " returns an object with ", /* @__PURE__ */ u.createElement("code", null, "modalProps"), ", ", /* @__PURE__ */ u.createElement("code", null, "modalState"), " and ", /* @__PURE__ */ u.createElement("code", null, "triggerProps")), /* @__PURE__ */ u.createElement("p", null, "The ", /* @__PURE__ */ u.createElement("code", null, "triggerProps"), " need to be spread on the element that triggers the modal."), /* @__PURE__ */ u.createElement("p", null, "The ", /* @__PURE__ */ u.createElement("code", null, "modalState"), " object (which is also included in ", /* @__PURE__ */ u.createElement("code", null, "modalProps"), ") allows programmatic access to the state of the modal. This includes a read only ", /* @__PURE__ */ u.createElement("code", null, "isOpen"), " property, a ", /* @__PURE__ */ u.createElement("code", null, "setOpen(isOpen: boolean)"), " method which can be use to set whether the overlay is open, an ", /* @__PURE__ */ u.createElement("code", null, "open()"), " method which open the overlay, a ", /* @__PURE__ */ u.createElement("code", null, "close()"), " method which closes the overlay and a ", /* @__PURE__ */ u.createElement("code", null, "toggle()"), " method that toggles the overlay's visiblity."), /* @__PURE__ */ u.createElement("p", null, "The ", /* @__PURE__ */ u.createElement("code", null, "modalProps"), " should be spread on the actual ", /* @__PURE__ */ u.createElement("code", null, "Modal"), " component."), /* @__PURE__ */ u.createElement("p", null, "Please refer to the examples to see its implementation"))
1423
1506
  },
1424
1507
  informational: {
1425
1508
  label: "Informational",
@@ -1428,7 +1511,7 @@ const Eo = {
1428
1511
  examples: {
1429
1512
  small: {
1430
1513
  description: "Small",
1431
- react: g`
1514
+ react: b`
1432
1515
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1433
1516
  import { sprinkles } from "@sps-woodland/tokens";
1434
1517
  import { Button } from "@sps-woodland/buttons";
@@ -1457,7 +1540,7 @@ const Eo = {
1457
1540
  },
1458
1541
  medium: {
1459
1542
  description: "Medium",
1460
- react: g`
1543
+ react: b`
1461
1544
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1462
1545
  import { sprinkles } from "@sps-woodland/tokens";
1463
1546
  import { Button } from "@sps-woodland/buttons";
@@ -1483,7 +1566,7 @@ const Eo = {
1483
1566
  },
1484
1567
  large: {
1485
1568
  description: "Large",
1486
- react: g`
1569
+ react: b`
1487
1570
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1488
1571
  import { sprinkles } from "@sps-woodland/tokens";
1489
1572
  import { Button } from "@sps-woodland/buttons";
@@ -1509,7 +1592,7 @@ const Eo = {
1509
1592
  },
1510
1593
  xlarge: {
1511
1594
  description: "Extra Large",
1512
- react: g`
1595
+ react: b`
1513
1596
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1514
1597
  import { sprinkles } from "@sps-woodland/tokens";
1515
1598
  import { Button } from "@sps-woodland/buttons";
@@ -1542,7 +1625,7 @@ const Eo = {
1542
1625
  examples: {
1543
1626
  small: {
1544
1627
  description: "Small",
1545
- react: g`
1628
+ react: b`
1546
1629
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1547
1630
  import { sprinkles } from "@sps-woodland/tokens";
1548
1631
  import { Button } from "@sps-woodland/buttons";
@@ -1564,7 +1647,7 @@ const Eo = {
1564
1647
  },
1565
1648
  medium: {
1566
1649
  description: "Medium",
1567
- react: g`
1650
+ react: b`
1568
1651
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1569
1652
  import { sprinkles } from "@sps-woodland/tokens";
1570
1653
  import { Button } from "@sps-woodland/buttons";
@@ -1585,7 +1668,7 @@ const Eo = {
1585
1668
  },
1586
1669
  large: {
1587
1670
  description: "Large",
1588
- react: g`
1671
+ react: b`
1589
1672
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1590
1673
  import { sprinkles } from "@sps-woodland/tokens";
1591
1674
  import { Button } from "@sps-woodland/buttons";
@@ -1607,7 +1690,7 @@ const Eo = {
1607
1690
  },
1608
1691
  xlarge: {
1609
1692
  description: "Extra Large",
1610
- react: g`
1693
+ react: b`
1611
1694
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1612
1695
  import { sprinkles } from "@sps-woodland/tokens";
1613
1696
  import { Button } from "@sps-woodland/buttons";
@@ -1634,7 +1717,7 @@ const Eo = {
1634
1717
  examples: {
1635
1718
  small: {
1636
1719
  description: "Small",
1637
- react: g`
1720
+ react: b`
1638
1721
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1639
1722
  import { sprinkles } from "@sps-woodland/tokens";
1640
1723
  import { Button } from "@sps-woodland/buttons";
@@ -1656,7 +1739,7 @@ const Eo = {
1656
1739
  },
1657
1740
  medium: {
1658
1741
  description: "Medium",
1659
- react: g`
1742
+ react: b`
1660
1743
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1661
1744
  import { sprinkles } from "@sps-woodland/tokens";
1662
1745
  import { Button } from "@sps-woodland/buttons";
@@ -1677,7 +1760,7 @@ const Eo = {
1677
1760
  },
1678
1761
  large: {
1679
1762
  description: "Large",
1680
- react: g`
1763
+ react: b`
1681
1764
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1682
1765
  import { sprinkles } from "@sps-woodland/tokens";
1683
1766
  import { Button } from "@sps-woodland/buttons";
@@ -1699,7 +1782,7 @@ const Eo = {
1699
1782
  },
1700
1783
  xlarge: {
1701
1784
  description: "Extra Large",
1702
- react: g`
1785
+ react: b`
1703
1786
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1704
1787
  import { sprinkles } from "@sps-woodland/tokens";
1705
1788
  import { Button } from "@sps-woodland/buttons";
@@ -1726,7 +1809,7 @@ const Eo = {
1726
1809
  examples: {
1727
1810
  small: {
1728
1811
  description: "Small",
1729
- react: g`
1812
+ react: b`
1730
1813
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1731
1814
  import { sprinkles } from "@sps-woodland/tokens";
1732
1815
  import { Button } from "@sps-woodland/buttons";
@@ -1748,7 +1831,7 @@ const Eo = {
1748
1831
  },
1749
1832
  medium: {
1750
1833
  description: "Medium",
1751
- react: g`
1834
+ react: b`
1752
1835
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1753
1836
  import { sprinkles } from "@sps-woodland/tokens";
1754
1837
  import { Button } from "@sps-woodland/buttons";
@@ -1769,7 +1852,7 @@ const Eo = {
1769
1852
  },
1770
1853
  large: {
1771
1854
  description: "Large",
1772
- react: g`
1855
+ react: b`
1773
1856
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1774
1857
  import { sprinkles } from "@sps-woodland/tokens";
1775
1858
  import { Button } from "@sps-woodland/buttons";
@@ -1791,7 +1874,7 @@ const Eo = {
1791
1874
  },
1792
1875
  xlarge: {
1793
1876
  description: "Extra Large",
1794
- react: g`
1877
+ react: b`
1795
1878
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1796
1879
  import { sprinkles } from "@sps-woodland/tokens";
1797
1880
  import { Button } from "@sps-woodland/buttons";
@@ -1818,7 +1901,7 @@ const Eo = {
1818
1901
  examples: {
1819
1902
  small: {
1820
1903
  description: "Small",
1821
- react: g`
1904
+ react: b`
1822
1905
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1823
1906
  import { sprinkles } from "@sps-woodland/tokens";
1824
1907
  import { Button } from "@sps-woodland/buttons";
@@ -1840,7 +1923,7 @@ const Eo = {
1840
1923
  },
1841
1924
  medium: {
1842
1925
  description: "Medium",
1843
- react: g`
1926
+ react: b`
1844
1927
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1845
1928
  import { sprinkles } from "@sps-woodland/tokens";
1846
1929
  import { Button } from "@sps-woodland/buttons";
@@ -1861,7 +1944,7 @@ const Eo = {
1861
1944
  },
1862
1945
  large: {
1863
1946
  description: "Large",
1864
- react: g`
1947
+ react: b`
1865
1948
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1866
1949
  import { sprinkles } from "@sps-woodland/tokens";
1867
1950
  import { Button } from "@sps-woodland/buttons";
@@ -1883,7 +1966,7 @@ const Eo = {
1883
1966
  },
1884
1967
  xlarge: {
1885
1968
  description: "Extra Large",
1886
- react: g`
1969
+ react: b`
1887
1970
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1888
1971
  import { sprinkles } from "@sps-woodland/tokens";
1889
1972
  import { Button } from "@sps-woodland/buttons";
@@ -1910,7 +1993,7 @@ const Eo = {
1910
1993
  examples: {
1911
1994
  small: {
1912
1995
  description: "Small",
1913
- react: g`
1996
+ react: b`
1914
1997
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1915
1998
  import { sprinkles } from "@sps-woodland/tokens";
1916
1999
  import { Button } from "@sps-woodland/buttons";
@@ -1937,7 +2020,7 @@ const Eo = {
1937
2020
  },
1938
2021
  medium: {
1939
2022
  description: "Medium",
1940
- react: g`
2023
+ react: b`
1941
2024
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1942
2025
  import { sprinkles } from "@sps-woodland/tokens";
1943
2026
  import { Button } from "@sps-woodland/buttons";
@@ -1962,7 +2045,7 @@ const Eo = {
1962
2045
  },
1963
2046
  large: {
1964
2047
  description: "Large",
1965
- react: g`
2048
+ react: b`
1966
2049
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1967
2050
  import { sprinkles } from "@sps-woodland/tokens";
1968
2051
  import { Button } from "@sps-woodland/buttons";
@@ -1984,7 +2067,7 @@ const Eo = {
1984
2067
  },
1985
2068
  xlarge: {
1986
2069
  description: "Extra Large",
1987
- react: g`
2070
+ react: b`
1988
2071
  import { Modal, ModalFooter } from "@sps-woodland/modal";
1989
2072
  import { sprinkles } from "@sps-woodland/tokens";
1990
2073
  import { Button } from "@sps-woodland/buttons";
@@ -2011,7 +2094,7 @@ const Eo = {
2011
2094
  examples: {
2012
2095
  small: {
2013
2096
  description: "Small",
2014
- react: g`
2097
+ react: b`
2015
2098
  import { Modal, ModalFooter } from "@sps-woodland/modal";
2016
2099
  import { sprinkles } from "@sps-woodland/tokens";
2017
2100
  import { Button } from "@sps-woodland/buttons";
@@ -2033,7 +2116,7 @@ const Eo = {
2033
2116
  },
2034
2117
  medium: {
2035
2118
  description: "Medium",
2036
- react: g`
2119
+ react: b`
2037
2120
  import { Modal, ModalFooter } from "@sps-woodland/modal";
2038
2121
  import { sprinkles } from "@sps-woodland/tokens";
2039
2122
  import { Button } from "@sps-woodland/buttons";
@@ -2054,7 +2137,7 @@ const Eo = {
2054
2137
  },
2055
2138
  large: {
2056
2139
  description: "Large",
2057
- react: g`
2140
+ react: b`
2058
2141
  import { Modal, ModalFooter } from "@sps-woodland/modal";
2059
2142
  import { sprinkles } from "@sps-woodland/tokens";
2060
2143
  import { Button } from "@sps-woodland/buttons";
@@ -2076,7 +2159,7 @@ const Eo = {
2076
2159
  },
2077
2160
  xlarge: {
2078
2161
  description: "Extra Large",
2079
- react: g`
2162
+ react: b`
2080
2163
  import { Modal, ModalFooter } from "@sps-woodland/modal";
2081
2164
  import { sprinkles } from "@sps-woodland/tokens";
2082
2165
  import { Button } from "@sps-woodland/buttons";
@@ -2098,13 +2181,13 @@ const Eo = {
2098
2181
  }
2099
2182
  }
2100
2183
  }
2101
- }, Fo = {
2102
- Modals: Eo
2184
+ }, Io = {
2185
+ Modals: Bo
2103
2186
  };
2104
2187
  export {
2105
- Fo as MANIFEST,
2106
- Ke as Modal,
2107
- Ve as ModalFooter,
2108
- Le as ModalIcons,
2109
- xo as useModal
2188
+ Io as MANIFEST,
2189
+ _e as Modal,
2190
+ Ke as ModalFooter,
2191
+ Fe as ModalIcons,
2192
+ Wo as useModal
2110
2193
  };