@kakadu/components 1.7.6 → 1.7.7

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.
@@ -1,10 +1,10 @@
1
1
  import { j as N } from "../jsx-runtime-B4hRZ52C.mjs";
2
- import je, { createContext as Ie, useRef as te, useState as re, useCallback as J, useMemo as ne, useEffect as H, useContext as Ae } from "react";
2
+ import Ie, { createContext as Ae, useRef as te, useState as re, useCallback as J, useMemo as ne, useEffect as H, useContext as xe } from "react";
3
3
  import { cx as pe } from "@kuma-ui/core";
4
- import { createPortal as xe } from "react-dom";
5
- import { a as _e } from "../icon-C6X3pQX0.mjs";
6
- import Le from "./text-button.mjs";
7
- function we(r) {
4
+ import { createPortal as _e } from "react-dom";
5
+ import { a as Le } from "../icon-C6X3pQX0.mjs";
6
+ import Be from "./text-button.mjs";
7
+ function ke(r) {
8
8
  if (Object.prototype.hasOwnProperty.call(r, "__esModule")) return r;
9
9
  var e = r.default;
10
10
  if (typeof e == "function") {
@@ -14,8 +14,8 @@ function we(r) {
14
14
  t.prototype = e.prototype;
15
15
  } else t = {};
16
16
  return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(r).forEach(function(a) {
17
- var u = Object.getOwnPropertyDescriptor(r, a);
18
- Object.defineProperty(t, a, u.get ? u : {
17
+ var s = Object.getOwnPropertyDescriptor(r, a);
18
+ Object.defineProperty(t, a, s.get ? s : {
19
19
  enumerable: !0,
20
20
  get: function() {
21
21
  return r[a];
@@ -28,8 +28,8 @@ var Q = { exports: {} };
28
28
  * tabbable 6.4.0
29
29
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
30
30
  */
31
- var ke = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], ie = /* @__PURE__ */ ke.join(","), Ee = typeof Element > "u", z = Ee ? function() {
32
- } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, oe = !Ee && Element.prototype.getRootNode ? function(r) {
31
+ var Ee = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], ie = /* @__PURE__ */ Ee.join(","), Fe = typeof Element > "u", z = Fe ? function() {
32
+ } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, oe = !Fe && Element.prototype.getRootNode ? function(r) {
33
33
  var e;
34
34
  return r == null || (e = r.getRootNode) === null || e === void 0 ? void 0 : e.call(r);
35
35
  } : function(r) {
@@ -37,103 +37,103 @@ var ke = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
37
37
  }, ue = function(e, t) {
38
38
  var a;
39
39
  t === void 0 && (t = !0);
40
- var u = e == null || (a = e.getAttribute) === null || a === void 0 ? void 0 : a.call(e, "inert"), c = u === "" || u === "true", n = c || t && e && // closest does not exist on shadow roots, so we fall back to a manual
40
+ var s = e == null || (a = e.getAttribute) === null || a === void 0 ? void 0 : a.call(e, "inert"), c = s === "" || s === "true", n = c || t && e && // closest does not exist on shadow roots, so we fall back to a manual
41
41
  // lookup upward, in case it is not defined.
42
42
  (typeof e.closest == "function" ? e.closest("[inert]") : ue(e.parentNode));
43
43
  return n;
44
- }, Be = function(e) {
44
+ }, Me = function(e) {
45
45
  var t, a = e == null || (t = e.getAttribute) === null || t === void 0 ? void 0 : t.call(e, "contenteditable");
46
46
  return a === "" || a === "true";
47
- }, Fe = function(e, t, a) {
47
+ }, Se = function(e, t, a) {
48
48
  if (ue(e))
49
49
  return [];
50
- var u = Array.prototype.slice.apply(e.querySelectorAll(ie));
51
- return t && z.call(e, ie) && u.unshift(e), u = u.filter(a), u;
50
+ var s = Array.prototype.slice.apply(e.querySelectorAll(ie));
51
+ return t && z.call(e, ie) && s.unshift(e), s = s.filter(a), s;
52
52
  }, se = function(e, t, a) {
53
- for (var u = [], c = Array.from(e); c.length; ) {
53
+ for (var s = [], c = Array.from(e); c.length; ) {
54
54
  var n = c.shift();
55
55
  if (!ue(n, !1))
56
56
  if (n.tagName === "SLOT") {
57
- var b = n.assignedElements(), g = b.length ? b : n.children, k = se(g, !0, a);
58
- a.flatten ? u.push.apply(u, k) : u.push({
57
+ var p = n.assignedElements(), y = p.length ? p : n.children, k = se(y, !0, a);
58
+ a.flatten ? s.push.apply(s, k) : s.push({
59
59
  scopeParent: n,
60
60
  candidates: k
61
61
  });
62
62
  } else {
63
63
  var S = z.call(n, ie);
64
- S && a.filter(n) && (t || !e.includes(n)) && u.push(n);
64
+ S && a.filter(n) && (t || !e.includes(n)) && s.push(n);
65
65
  var D = n.shadowRoot || // check for an undisclosed shadow
66
66
  typeof a.getShadowRoot == "function" && a.getShadowRoot(n), R = !ue(D, !1) && (!a.shadowRootFilter || a.shadowRootFilter(n));
67
67
  if (D && R) {
68
- var I = se(D === !0 ? n.children : D.children, !0, a);
69
- a.flatten ? u.push.apply(u, I) : u.push({
68
+ var A = se(D === !0 ? n.children : D.children, !0, a);
69
+ a.flatten ? s.push.apply(s, A) : s.push({
70
70
  scopeParent: n,
71
- candidates: I
71
+ candidates: A
72
72
  });
73
73
  } else
74
74
  c.unshift.apply(c, n.children);
75
75
  }
76
76
  }
77
- return u;
78
- }, Se = function(e) {
77
+ return s;
78
+ }, Oe = function(e) {
79
79
  return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
80
- }, V = function(e) {
80
+ }, K = function(e) {
81
81
  if (!e)
82
82
  throw new Error("No node provided");
83
- return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || Be(e)) && !Se(e) ? 0 : e.tabIndex;
84
- }, Me = function(e, t) {
85
- var a = V(e);
86
- return a < 0 && t && !Se(e) ? 0 : a;
83
+ return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || Me(e)) && !Oe(e) ? 0 : e.tabIndex;
87
84
  }, Ke = function(e, t) {
85
+ var a = K(e);
86
+ return a < 0 && t && !Oe(e) ? 0 : a;
87
+ }, qe = function(e, t) {
88
88
  return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
89
- }, Oe = function(e) {
89
+ }, De = function(e) {
90
90
  return e.tagName === "INPUT";
91
- }, qe = function(e) {
92
- return Oe(e) && e.type === "hidden";
93
91
  }, Ve = function(e) {
92
+ return De(e) && e.type === "hidden";
93
+ }, $e = function(e) {
94
94
  var t = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(a) {
95
95
  return a.tagName === "SUMMARY";
96
96
  });
97
97
  return t;
98
- }, $e = function(e, t) {
98
+ }, Ge = function(e, t) {
99
99
  for (var a = 0; a < e.length; a++)
100
100
  if (e[a].checked && e[a].form === t)
101
101
  return e[a];
102
- }, Ge = function(e) {
102
+ }, Ue = function(e) {
103
103
  if (!e.name)
104
104
  return !0;
105
- var t = e.form || oe(e), a = function(b) {
106
- return t.querySelectorAll('input[type="radio"][name="' + b + '"]');
107
- }, u;
105
+ var t = e.form || oe(e), a = function(p) {
106
+ return t.querySelectorAll('input[type="radio"][name="' + p + '"]');
107
+ }, s;
108
108
  if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
109
- u = a(window.CSS.escape(e.name));
109
+ s = a(window.CSS.escape(e.name));
110
110
  else
111
111
  try {
112
- u = a(e.name);
112
+ s = a(e.name);
113
113
  } catch (n) {
114
114
  return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", n.message), !1;
115
115
  }
116
- var c = $e(u, e.form);
116
+ var c = Ge(s, e.form);
117
117
  return !c || c === e;
118
- }, Ue = function(e) {
119
- return Oe(e) && e.type === "radio";
120
118
  }, We = function(e) {
121
- return Ue(e) && !Ge(e);
119
+ return De(e) && e.type === "radio";
122
120
  }, ze = function(e) {
123
- var t, a = e && oe(e), u = (t = a) === null || t === void 0 ? void 0 : t.host, c = !1;
121
+ return We(e) && !Ue(e);
122
+ }, Ye = function(e) {
123
+ var t, a = e && oe(e), s = (t = a) === null || t === void 0 ? void 0 : t.host, c = !1;
124
124
  if (a && a !== e) {
125
- var n, b, g;
126
- for (c = !!((n = u) !== null && n !== void 0 && (b = n.ownerDocument) !== null && b !== void 0 && b.contains(u) || e != null && (g = e.ownerDocument) !== null && g !== void 0 && g.contains(e)); !c && u; ) {
125
+ var n, p, y;
126
+ for (c = !!((n = s) !== null && n !== void 0 && (p = n.ownerDocument) !== null && p !== void 0 && p.contains(s) || e != null && (y = e.ownerDocument) !== null && y !== void 0 && y.contains(e)); !c && s; ) {
127
127
  var k, S, D;
128
- a = oe(u), u = (k = a) === null || k === void 0 ? void 0 : k.host, c = !!((S = u) !== null && S !== void 0 && (D = S.ownerDocument) !== null && D !== void 0 && D.contains(u));
128
+ a = oe(s), s = (k = a) === null || k === void 0 ? void 0 : k.host, c = !!((S = s) !== null && S !== void 0 && (D = S.ownerDocument) !== null && D !== void 0 && D.contains(s));
129
129
  }
130
130
  }
131
131
  return c;
132
132
  }, be = function(e) {
133
- var t = e.getBoundingClientRect(), a = t.width, u = t.height;
134
- return a === 0 && u === 0;
135
- }, Ye = function(e, t) {
136
- var a = t.displayCheck, u = t.getShadowRoot;
133
+ var t = e.getBoundingClientRect(), a = t.width, s = t.height;
134
+ return a === 0 && s === 0;
135
+ }, He = function(e, t) {
136
+ var a = t.displayCheck, s = t.getShadowRoot;
137
137
  if (a === "full-native" && "checkVisibility" in e) {
138
138
  var c = e.checkVisibility({
139
139
  // Checking opacity might be desirable for some use cases, but natively,
@@ -152,36 +152,36 @@ var ke = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
152
152
  }
153
153
  if (getComputedStyle(e).visibility === "hidden")
154
154
  return !0;
155
- var n = z.call(e, "details>summary:first-of-type"), b = n ? e.parentElement : e;
156
- if (z.call(b, "details:not([open]) *"))
155
+ var n = z.call(e, "details>summary:first-of-type"), p = n ? e.parentElement : e;
156
+ if (z.call(p, "details:not([open]) *"))
157
157
  return !0;
158
158
  if (!a || a === "full" || // full-native can run this branch when it falls through in case
159
159
  // Element#checkVisibility is unsupported
160
160
  a === "full-native" || a === "legacy-full") {
161
- if (typeof u == "function") {
162
- for (var g = e; e; ) {
161
+ if (typeof s == "function") {
162
+ for (var y = e; e; ) {
163
163
  var k = e.parentElement, S = oe(e);
164
- if (k && !k.shadowRoot && u(k) === !0)
164
+ if (k && !k.shadowRoot && s(k) === !0)
165
165
  return be(e);
166
166
  e.assignedSlot ? e = e.assignedSlot : !k && S !== e.ownerDocument ? e = S.host : e = k;
167
167
  }
168
- e = g;
168
+ e = y;
169
169
  }
170
- if (ze(e))
170
+ if (Ye(e))
171
171
  return !e.getClientRects().length;
172
172
  if (a !== "legacy-full")
173
173
  return !0;
174
174
  } else if (a === "non-zero-area")
175
175
  return be(e);
176
176
  return !1;
177
- }, He = function(e) {
177
+ }, Ze = function(e) {
178
178
  if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))
179
179
  for (var t = e.parentElement; t; ) {
180
180
  if (t.tagName === "FIELDSET" && t.disabled) {
181
181
  for (var a = 0; a < t.children.length; a++) {
182
- var u = t.children.item(a);
183
- if (u.tagName === "LEGEND")
184
- return z.call(t, "fieldset[disabled] *") ? !0 : !u.contains(e);
182
+ var s = t.children.item(a);
183
+ if (s.tagName === "LEGEND")
184
+ return z.call(t, "fieldset[disabled] *") ? !0 : !s.contains(e);
185
185
  }
186
186
  return !0;
187
187
  }
@@ -189,60 +189,60 @@ var ke = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
189
189
  }
190
190
  return !1;
191
191
  }, ce = function(e, t) {
192
- return !(t.disabled || qe(t) || Ye(t, e) || // For a details element with a summary, the summary element gets the focus
193
- Ve(t) || He(t));
192
+ return !(t.disabled || Ve(t) || He(t, e) || // For a details element with a summary, the summary element gets the focus
193
+ $e(t) || Ze(t));
194
194
  }, de = function(e, t) {
195
- return !(We(t) || V(t) < 0 || !ce(e, t));
196
- }, Ze = function(e) {
195
+ return !(ze(t) || K(t) < 0 || !ce(e, t));
196
+ }, Xe = function(e) {
197
197
  var t = parseInt(e.getAttribute("tabindex"), 10);
198
198
  return !!(isNaN(t) || t >= 0);
199
- }, De = function(e) {
199
+ }, Ne = function(e) {
200
200
  var t = [], a = [];
201
- return e.forEach(function(u, c) {
202
- var n = !!u.scopeParent, b = n ? u.scopeParent : u, g = Me(b, n), k = n ? De(u.candidates) : b;
203
- g === 0 ? n ? t.push.apply(t, k) : t.push(b) : a.push({
201
+ return e.forEach(function(s, c) {
202
+ var n = !!s.scopeParent, p = n ? s.scopeParent : s, y = Ke(p, n), k = n ? Ne(s.candidates) : p;
203
+ y === 0 ? n ? t.push.apply(t, k) : t.push(p) : a.push({
204
204
  documentOrder: c,
205
- tabIndex: g,
206
- item: u,
205
+ tabIndex: y,
206
+ item: s,
207
207
  isScope: n,
208
208
  content: k
209
209
  });
210
- }), a.sort(Ke).reduce(function(u, c) {
211
- return c.isScope ? u.push.apply(u, c.content) : u.push(c.content), u;
210
+ }), a.sort(qe).reduce(function(s, c) {
211
+ return c.isScope ? s.push.apply(s, c.content) : s.push(c.content), s;
212
212
  }, []).concat(t);
213
- }, Ne = function(e, t) {
213
+ }, Re = function(e, t) {
214
214
  t = t || {};
215
215
  var a;
216
216
  return t.getShadowRoot ? a = se([e], t.includeContainer, {
217
217
  filter: de.bind(null, t),
218
218
  flatten: !1,
219
219
  getShadowRoot: t.getShadowRoot,
220
- shadowRootFilter: Ze
221
- }) : a = Fe(e, t.includeContainer, de.bind(null, t)), De(a);
222
- }, Re = function(e, t) {
220
+ shadowRootFilter: Xe
221
+ }) : a = Se(e, t.includeContainer, de.bind(null, t)), Ne(a);
222
+ }, Pe = function(e, t) {
223
223
  t = t || {};
224
224
  var a;
225
225
  return t.getShadowRoot ? a = se([e], t.includeContainer, {
226
226
  filter: ce.bind(null, t),
227
227
  flatten: !0,
228
228
  getShadowRoot: t.getShadowRoot
229
- }) : a = Fe(e, t.includeContainer, ce.bind(null, t)), a;
229
+ }) : a = Se(e, t.includeContainer, ce.bind(null, t)), a;
230
230
  }, W = function(e, t) {
231
231
  if (t = t || {}, !e)
232
232
  throw new Error("No node provided");
233
233
  return z.call(e, ie) === !1 ? !1 : de(t, e);
234
- }, Xe = /* @__PURE__ */ ke.concat("iframe:not([inert]):not([inert] *)").join(","), ae = function(e, t) {
234
+ }, Je = /* @__PURE__ */ Ee.concat("iframe:not([inert]):not([inert] *)").join(","), ae = function(e, t) {
235
235
  if (t = t || {}, !e)
236
236
  throw new Error("No node provided");
237
- return z.call(e, Xe) === !1 ? !1 : ce(t, e);
237
+ return z.call(e, Je) === !1 ? !1 : ce(t, e);
238
238
  };
239
- const Je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
239
+ const Qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
240
240
  __proto__: null,
241
- focusable: Re,
242
- getTabIndex: V,
241
+ focusable: Pe,
242
+ getTabIndex: K,
243
243
  isFocusable: ae,
244
244
  isTabbable: W,
245
- tabbable: Ne
245
+ tabbable: Re
246
246
  }, Symbol.toStringTag, { value: "Module" }));
247
247
  /*!
248
248
  * focus-trap 7.8.0
@@ -253,18 +253,18 @@ function ve(r, e) {
253
253
  for (var t = 0, a = Array(e); t < e; t++) a[t] = r[t];
254
254
  return a;
255
255
  }
256
- function Qe(r) {
256
+ function et(r) {
257
257
  if (Array.isArray(r)) return ve(r);
258
258
  }
259
259
  function he(r, e) {
260
260
  var t = typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
261
261
  if (!t) {
262
- if (Array.isArray(r) || (t = Pe(r)) || e) {
262
+ if (Array.isArray(r) || (t = Ce(r)) || e) {
263
263
  t && (r = t);
264
- var a = 0, u = function() {
264
+ var a = 0, s = function() {
265
265
  };
266
266
  return {
267
- s: u,
267
+ s,
268
268
  n: function() {
269
269
  return a >= r.length ? {
270
270
  done: !0
@@ -273,48 +273,48 @@ function he(r, e) {
273
273
  value: r[a++]
274
274
  };
275
275
  },
276
- e: function(g) {
277
- throw g;
276
+ e: function(y) {
277
+ throw y;
278
278
  },
279
- f: u
279
+ f: s
280
280
  };
281
281
  }
282
282
  throw new TypeError(`Invalid attempt to iterate non-iterable instance.
283
283
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
284
284
  }
285
- var c, n = !0, b = !1;
285
+ var c, n = !0, p = !1;
286
286
  return {
287
287
  s: function() {
288
288
  t = t.call(r);
289
289
  },
290
290
  n: function() {
291
- var g = t.next();
292
- return n = g.done, g;
291
+ var y = t.next();
292
+ return n = y.done, y;
293
293
  },
294
- e: function(g) {
295
- b = !0, c = g;
294
+ e: function(y) {
295
+ p = !0, c = y;
296
296
  },
297
297
  f: function() {
298
298
  try {
299
299
  n || t.return == null || t.return();
300
300
  } finally {
301
- if (b) throw c;
301
+ if (p) throw c;
302
302
  }
303
303
  }
304
304
  };
305
305
  }
306
- function et(r, e, t) {
307
- return (e = it(e)) in r ? Object.defineProperty(r, e, {
306
+ function tt(r, e, t) {
307
+ return (e = ot(e)) in r ? Object.defineProperty(r, e, {
308
308
  value: t,
309
309
  enumerable: !0,
310
310
  configurable: !0,
311
311
  writable: !0
312
312
  }) : r[e] = t, r;
313
313
  }
314
- function tt(r) {
314
+ function rt(r) {
315
315
  if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
316
316
  }
317
- function rt() {
317
+ function at() {
318
318
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
319
319
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
320
320
  }
@@ -322,8 +322,8 @@ function ye(r, e) {
322
322
  var t = Object.keys(r);
323
323
  if (Object.getOwnPropertySymbols) {
324
324
  var a = Object.getOwnPropertySymbols(r);
325
- e && (a = a.filter(function(u) {
326
- return Object.getOwnPropertyDescriptor(r, u).enumerable;
325
+ e && (a = a.filter(function(s) {
326
+ return Object.getOwnPropertyDescriptor(r, s).enumerable;
327
327
  })), t.push.apply(t, a);
328
328
  }
329
329
  return t;
@@ -332,17 +332,17 @@ function me(r) {
332
332
  for (var e = 1; e < arguments.length; e++) {
333
333
  var t = arguments[e] != null ? arguments[e] : {};
334
334
  e % 2 ? ye(Object(t), !0).forEach(function(a) {
335
- et(r, a, t[a]);
335
+ tt(r, a, t[a]);
336
336
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : ye(Object(t)).forEach(function(a) {
337
337
  Object.defineProperty(r, a, Object.getOwnPropertyDescriptor(t, a));
338
338
  });
339
339
  }
340
340
  return r;
341
341
  }
342
- function at(r) {
343
- return Qe(r) || tt(r) || Pe(r) || rt();
342
+ function nt(r) {
343
+ return et(r) || rt(r) || Ce(r) || at();
344
344
  }
345
- function nt(r, e) {
345
+ function it(r, e) {
346
346
  if (typeof r != "object" || !r) return r;
347
347
  var t = r[Symbol.toPrimitive];
348
348
  if (t !== void 0) {
@@ -352,11 +352,11 @@ function nt(r, e) {
352
352
  }
353
353
  return (e === "string" ? String : Number)(r);
354
354
  }
355
- function it(r) {
356
- var e = nt(r, "string");
355
+ function ot(r) {
356
+ var e = it(r, "string");
357
357
  return typeof e == "symbol" ? e : e + "";
358
358
  }
359
- function Pe(r, e) {
359
+ function Ce(r, e) {
360
360
  if (r) {
361
361
  if (typeof r == "string") return ve(r, e);
362
362
  var t = {}.toString.call(r).slice(8, -1);
@@ -372,8 +372,8 @@ var B = {
372
372
  activateTrap: function(e, t) {
373
373
  var a = B.getActiveTrap(e);
374
374
  t !== a && B.pauseTrap(e);
375
- var u = e.indexOf(t);
376
- u === -1 || e.splice(u, 1), e.push(t);
375
+ var s = e.indexOf(t);
376
+ s === -1 || e.splice(s, 1), e.push(t);
377
377
  },
378
378
  // Removes the trap from the top of the stack, then unpauses the next trap down.
379
379
  deactivateTrap: function(e, t) {
@@ -390,32 +390,32 @@ var B = {
390
390
  var t = B.getActiveTrap(e);
391
391
  t && !t._isManuallyPaused() && t._setPausedState(!1);
392
392
  }
393
- }, ot = function(e) {
394
- return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
395
393
  }, ut = function(e) {
394
+ return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
395
+ }, st = function(e) {
396
396
  return (e == null ? void 0 : e.key) === "Escape" || (e == null ? void 0 : e.key) === "Esc" || (e == null ? void 0 : e.keyCode) === 27;
397
397
  }, X = function(e) {
398
398
  return (e == null ? void 0 : e.key) === "Tab" || (e == null ? void 0 : e.keyCode) === 9;
399
- }, st = function(e) {
400
- return X(e) && !e.shiftKey;
401
399
  }, ct = function(e) {
400
+ return X(e) && !e.shiftKey;
401
+ }, lt = function(e) {
402
402
  return X(e) && e.shiftKey;
403
403
  }, ge = function(e) {
404
404
  return setTimeout(e, 0);
405
405
  }, Z = function(e) {
406
- for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0), u = 1; u < t; u++)
407
- a[u - 1] = arguments[u];
406
+ for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
407
+ a[s - 1] = arguments[s];
408
408
  return typeof e == "function" ? e.apply(void 0, a) : e;
409
409
  }, ee = function(e) {
410
410
  return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
411
- }, lt = [], ft = function(e, t) {
412
- var a = (t == null ? void 0 : t.document) || document, u = (t == null ? void 0 : t.trapStack) || lt, c = me({
411
+ }, ft = [], dt = function(e, t) {
412
+ var a = (t == null ? void 0 : t.document) || document, s = (t == null ? void 0 : t.trapStack) || ft, c = me({
413
413
  returnFocusOnDeactivate: !0,
414
414
  escapeDeactivates: !0,
415
415
  delayInitialFocus: !0,
416
416
  isolateSubtrees: !1,
417
- isKeyForward: st,
418
- isKeyBackward: ct
417
+ isKeyForward: ct,
418
+ isKeyBackward: lt
419
419
  }, t), n = {
420
420
  // containers given to createFocusTrap()
421
421
  /** @type {Array<HTMLElement>} */
@@ -460,35 +460,35 @@ var B = {
460
460
  delayInitialFocusTimer: void 0,
461
461
  // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
462
462
  recentNavEvent: void 0
463
- }, b, g = function(o, i, l) {
463
+ }, p, y = function(o, i, l) {
464
464
  return o && o[i] !== void 0 ? o[i] : c[l || i];
465
465
  }, k = function(o, i) {
466
466
  var l = typeof (i == null ? void 0 : i.composedPath) == "function" ? i.composedPath() : void 0;
467
- return n.containerGroups.findIndex(function(m) {
468
- var y = m.container, w = m.tabbableNodes;
469
- return y.contains(o) || // fall back to explicit tabbable search which will take into consideration any
467
+ return n.containerGroups.findIndex(function(g) {
468
+ var h = g.container, w = g.tabbableNodes;
469
+ return h.contains(o) || // fall back to explicit tabbable search which will take into consideration any
470
470
  // web components if the `tabbableOptions.getShadowRoot` option was used for
471
471
  // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
472
472
  // look inside web components even if open)
473
- (l == null ? void 0 : l.includes(y)) || w.find(function(p) {
474
- return p === o;
473
+ (l == null ? void 0 : l.includes(h)) || w.find(function(v) {
474
+ return v === o;
475
475
  });
476
476
  });
477
477
  }, S = function(o) {
478
- var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = i.hasFallback, m = l === void 0 ? !1 : l, y = i.params, w = y === void 0 ? [] : y, p = c[o];
479
- if (typeof p == "function" && (p = p.apply(void 0, at(w))), p === !0 && (p = void 0), !p) {
480
- if (p === void 0 || p === !1)
481
- return p;
478
+ var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = i.hasFallback, g = l === void 0 ? !1 : l, h = i.params, w = h === void 0 ? [] : h, v = c[o];
479
+ if (typeof v == "function" && (v = v.apply(void 0, nt(w))), v === !0 && (v = void 0), !v) {
480
+ if (v === void 0 || v === !1)
481
+ return v;
482
482
  throw new Error("`".concat(o, "` was specified but was not a node, or did not return a node"));
483
483
  }
484
- var E = p;
485
- if (typeof p == "string") {
484
+ var E = v;
485
+ if (typeof v == "string") {
486
486
  try {
487
- E = a.querySelector(p);
487
+ E = a.querySelector(v);
488
488
  } catch (F) {
489
489
  throw new Error("`".concat(o, '` appears to be an invalid selector; error="').concat(F.message, '"'));
490
490
  }
491
- if (!E && !m)
491
+ if (!E && !g)
492
492
  throw new Error("`".concat(o, "` as selector refers to no known node"));
493
493
  }
494
494
  return E;
@@ -511,12 +511,12 @@ var B = {
511
511
  return o;
512
512
  }, R = function() {
513
513
  if (n.containerGroups = n.containers.map(function(o) {
514
- var i = Ne(o, c.tabbableOptions), l = Re(o, c.tabbableOptions), m = i.length > 0 ? i[0] : void 0, y = i.length > 0 ? i[i.length - 1] : void 0, w = l.find(function(F) {
514
+ var i = Re(o, c.tabbableOptions), l = Pe(o, c.tabbableOptions), g = i.length > 0 ? i[0] : void 0, h = i.length > 0 ? i[i.length - 1] : void 0, w = l.find(function(F) {
515
515
  return W(F);
516
- }), p = l.slice().reverse().find(function(F) {
516
+ }), v = l.slice().reverse().find(function(F) {
517
517
  return W(F);
518
518
  }), E = !!i.find(function(F) {
519
- return V(F) > 0;
519
+ return K(F) > 0;
520
520
  });
521
521
  return {
522
522
  container: o,
@@ -525,9 +525,9 @@ var B = {
525
525
  /** True if at least one node with positive `tabindex` was found in this container. */
526
526
  posTabIndexesFound: E,
527
527
  /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
528
- firstTabbableNode: m,
528
+ firstTabbableNode: g,
529
529
  /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
530
- lastTabbableNode: y,
530
+ lastTabbableNode: h,
531
531
  // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
532
532
  // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
533
533
  // because that API doesn't work with Shadow DOM as well as it should (@see
@@ -538,7 +538,7 @@ var B = {
538
538
  /** First tabbable node in container, __DOM__ order; `undefined` if none. */
539
539
  firstDomTabbableNode: w,
540
540
  /** Last tabbable node in container, __DOM__ order; `undefined` if none. */
541
- lastDomTabbableNode: p,
541
+ lastDomTabbableNode: v,
542
542
  /**
543
543
  * Finds the __tabbable__ node that follows the given node in the specified direction,
544
544
  * in this container, if any.
@@ -547,13 +547,13 @@ var B = {
547
547
  * in reverse.
548
548
  * @returns {HTMLElement|undefined} The next tabbable node, if any.
549
549
  */
550
- nextTabbableNode: function(C) {
551
- var _ = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, A = i.indexOf(C);
552
- return A < 0 ? _ ? l.slice(l.indexOf(C) + 1).find(function(U) {
550
+ nextTabbableNode: function(j) {
551
+ var _ = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, x = i.indexOf(j);
552
+ return x < 0 ? _ ? l.slice(l.indexOf(j) + 1).find(function(U) {
553
553
  return W(U);
554
- }) : l.slice(0, l.indexOf(C)).reverse().find(function(U) {
554
+ }) : l.slice(0, l.indexOf(j)).reverse().find(function(U) {
555
555
  return W(U);
556
- }) : i[A + (_ ? 1 : -1)];
556
+ }) : i[x + (_ ? 1 : -1)];
557
557
  }
558
558
  };
559
559
  }), n.tabbableGroups = n.containerGroups.filter(function(o) {
@@ -564,60 +564,60 @@ var B = {
564
564
  return o.posTabIndexesFound;
565
565
  }) && n.containerGroups.length > 1)
566
566
  throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
567
- }, I = function(o) {
567
+ }, A = function(o) {
568
568
  var i = o.activeElement;
569
569
  if (i)
570
- return i.shadowRoot && i.shadowRoot.activeElement !== null ? I(i.shadowRoot) : i;
571
- }, j = function(o) {
572
- if (o !== !1 && o !== I(document)) {
570
+ return i.shadowRoot && i.shadowRoot.activeElement !== null ? A(i.shadowRoot) : i;
571
+ }, P = function(o) {
572
+ if (o !== !1 && o !== A(document)) {
573
573
  if (!o || !o.focus) {
574
- j(D());
574
+ P(D());
575
575
  return;
576
576
  }
577
577
  o.focus({
578
578
  preventScroll: !!c.preventScroll
579
- }), n.mostRecentlyFocusedNode = o, ot(o) && o.select();
579
+ }), n.mostRecentlyFocusedNode = o, ut(o) && o.select();
580
580
  }
581
- }, x = function(o) {
581
+ }, Y = function(o) {
582
582
  var i = S("setReturnFocus", {
583
583
  params: [o]
584
584
  });
585
585
  return i || (i === !1 ? !1 : o);
586
- }, P = function(o) {
587
- var i = o.target, l = o.event, m = o.isBackward, y = m === void 0 ? !1 : m;
586
+ }, C = function(o) {
587
+ var i = o.target, l = o.event, g = o.isBackward, h = g === void 0 ? !1 : g;
588
588
  i = i || ee(l), R();
589
589
  var w = null;
590
590
  if (n.tabbableGroups.length > 0) {
591
- var p = k(i, l), E = p >= 0 ? n.containerGroups[p] : void 0;
592
- if (p < 0)
593
- y ? w = n.tabbableGroups[n.tabbableGroups.length - 1].lastTabbableNode : w = n.tabbableGroups[0].firstTabbableNode;
594
- else if (y) {
591
+ var v = k(i, l), E = v >= 0 ? n.containerGroups[v] : void 0;
592
+ if (v < 0)
593
+ h ? w = n.tabbableGroups[n.tabbableGroups.length - 1].lastTabbableNode : w = n.tabbableGroups[0].firstTabbableNode;
594
+ else if (h) {
595
595
  var F = n.tabbableGroups.findIndex(function(le) {
596
596
  var fe = le.firstTabbableNode;
597
597
  return i === fe;
598
598
  });
599
- if (F < 0 && (E.container === i || ae(i, c.tabbableOptions) && !W(i, c.tabbableOptions) && !E.nextTabbableNode(i, !1)) && (F = p), F >= 0) {
600
- var C = F === 0 ? n.tabbableGroups.length - 1 : F - 1, _ = n.tabbableGroups[C];
601
- w = V(i) >= 0 ? _.lastTabbableNode : _.lastDomTabbableNode;
599
+ if (F < 0 && (E.container === i || ae(i, c.tabbableOptions) && !W(i, c.tabbableOptions) && !E.nextTabbableNode(i, !1)) && (F = v), F >= 0) {
600
+ var j = F === 0 ? n.tabbableGroups.length - 1 : F - 1, _ = n.tabbableGroups[j];
601
+ w = K(i) >= 0 ? _.lastTabbableNode : _.lastDomTabbableNode;
602
602
  } else X(l) || (w = E.nextTabbableNode(i, !1));
603
603
  } else {
604
- var A = n.tabbableGroups.findIndex(function(le) {
604
+ var x = n.tabbableGroups.findIndex(function(le) {
605
605
  var fe = le.lastTabbableNode;
606
606
  return i === fe;
607
607
  });
608
- if (A < 0 && (E.container === i || ae(i, c.tabbableOptions) && !W(i, c.tabbableOptions) && !E.nextTabbableNode(i)) && (A = p), A >= 0) {
609
- var U = A === n.tabbableGroups.length - 1 ? 0 : A + 1, q = n.tabbableGroups[U];
610
- w = V(i) >= 0 ? q.firstTabbableNode : q.firstDomTabbableNode;
608
+ if (x < 0 && (E.container === i || ae(i, c.tabbableOptions) && !W(i, c.tabbableOptions) && !E.nextTabbableNode(i)) && (x = v), x >= 0) {
609
+ var U = x === n.tabbableGroups.length - 1 ? 0 : x + 1, M = n.tabbableGroups[U];
610
+ w = K(i) >= 0 ? M.firstTabbableNode : M.firstDomTabbableNode;
611
611
  } else X(l) || (w = E.nextTabbableNode(i));
612
612
  }
613
613
  } else
614
614
  w = S("fallbackFocus");
615
615
  return w;
616
- }, L = function(o) {
616
+ }, I = function(o) {
617
617
  var i = ee(o);
618
618
  if (!(k(i, o) >= 0)) {
619
619
  if (Z(c.clickOutsideDeactivates, o)) {
620
- b.deactivate({
620
+ p.deactivate({
621
621
  // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
622
622
  // which will result in the outside click setting focus to the node
623
623
  // that was clicked (and if not focusable, to "nothing"); by setting
@@ -630,115 +630,115 @@ var B = {
630
630
  }
631
631
  Z(c.allowOutsideClick, o) || o.preventDefault();
632
632
  }
633
- }, M = function(o) {
633
+ }, q = function(o) {
634
634
  var i = ee(o), l = k(i, o) >= 0;
635
635
  if (l || i instanceof Document)
636
636
  l && (n.mostRecentlyFocusedNode = i);
637
637
  else {
638
638
  o.stopImmediatePropagation();
639
- var m, y = !0;
639
+ var g, h = !0;
640
640
  if (n.mostRecentlyFocusedNode)
641
- if (V(n.mostRecentlyFocusedNode) > 0) {
642
- var w = k(n.mostRecentlyFocusedNode), p = n.containerGroups[w].tabbableNodes;
643
- if (p.length > 0) {
644
- var E = p.findIndex(function(F) {
641
+ if (K(n.mostRecentlyFocusedNode) > 0) {
642
+ var w = k(n.mostRecentlyFocusedNode), v = n.containerGroups[w].tabbableNodes;
643
+ if (v.length > 0) {
644
+ var E = v.findIndex(function(F) {
645
645
  return F === n.mostRecentlyFocusedNode;
646
646
  });
647
- E >= 0 && (c.isKeyForward(n.recentNavEvent) ? E + 1 < p.length && (m = p[E + 1], y = !1) : E - 1 >= 0 && (m = p[E - 1], y = !1));
647
+ E >= 0 && (c.isKeyForward(n.recentNavEvent) ? E + 1 < v.length && (g = v[E + 1], h = !1) : E - 1 >= 0 && (g = v[E - 1], h = !1));
648
648
  }
649
649
  } else
650
650
  n.containerGroups.some(function(F) {
651
- return F.tabbableNodes.some(function(C) {
652
- return V(C) > 0;
651
+ return F.tabbableNodes.some(function(j) {
652
+ return K(j) > 0;
653
653
  });
654
- }) || (y = !1);
654
+ }) || (h = !1);
655
655
  else
656
- y = !1;
657
- y && (m = P({
656
+ h = !1;
657
+ h && (g = C({
658
658
  // move FROM the MRU node, not event-related node (which will be the node that is
659
659
  // outside the trap causing the focus escape we're trying to fix)
660
660
  target: n.mostRecentlyFocusedNode,
661
661
  isBackward: c.isKeyBackward(n.recentNavEvent)
662
- })), j(m || n.mostRecentlyFocusedNode || D());
662
+ })), P(g || n.mostRecentlyFocusedNode || D());
663
663
  }
664
664
  n.recentNavEvent = void 0;
665
- }, Y = function(o) {
665
+ }, V = function(o) {
666
666
  var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
667
667
  n.recentNavEvent = o;
668
- var l = P({
668
+ var l = C({
669
669
  event: o,
670
670
  isBackward: i
671
671
  });
672
- l && (X(o) && o.preventDefault(), j(l));
672
+ l && (X(o) && o.preventDefault(), P(l));
673
673
  }, $ = function(o) {
674
- (c.isKeyForward(o) || c.isKeyBackward(o)) && Y(o, c.isKeyBackward(o));
674
+ (c.isKeyForward(o) || c.isKeyBackward(o)) && V(o, c.isKeyBackward(o));
675
675
  }, G = function(o) {
676
- ut(o) && Z(c.escapeDeactivates, o) !== !1 && (o.preventDefault(), b.deactivate());
677
- }, K = function(o) {
676
+ st(o) && Z(c.escapeDeactivates, o) !== !1 && (o.preventDefault(), p.deactivate());
677
+ }, L = function(o) {
678
678
  var i = ee(o);
679
679
  k(i, o) >= 0 || Z(c.clickOutsideDeactivates, o) || Z(c.allowOutsideClick, o) || (o.preventDefault(), o.stopImmediatePropagation());
680
- }, v = function() {
680
+ }, d = function() {
681
681
  if (n.active)
682
- return B.activateTrap(u, b), n.delayInitialFocusTimer = c.delayInitialFocus ? ge(function() {
683
- j(D());
684
- }) : j(D()), a.addEventListener("focusin", M, !0), a.addEventListener("mousedown", L, {
682
+ return B.activateTrap(s, p), n.delayInitialFocusTimer = c.delayInitialFocus ? ge(function() {
683
+ P(D());
684
+ }) : P(D()), a.addEventListener("focusin", q, !0), a.addEventListener("mousedown", I, {
685
685
  capture: !0,
686
686
  passive: !1
687
- }), a.addEventListener("touchstart", L, {
687
+ }), a.addEventListener("touchstart", I, {
688
688
  capture: !0,
689
689
  passive: !1
690
- }), a.addEventListener("click", K, {
690
+ }), a.addEventListener("click", L, {
691
691
  capture: !0,
692
692
  passive: !1
693
693
  }), a.addEventListener("keydown", $, {
694
694
  capture: !0,
695
695
  passive: !1
696
- }), a.addEventListener("keydown", G), b;
696
+ }), a.addEventListener("keydown", G), p;
697
697
  }, f = function(o) {
698
- n.active && !n.paused && b._setSubtreeIsolation(!1), n.adjacentElements.clear(), n.alreadySilent.clear();
699
- var i = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), m = he(o), y;
698
+ n.active && !n.paused && p._setSubtreeIsolation(!1), n.adjacentElements.clear(), n.alreadySilent.clear();
699
+ var i = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), g = he(o), h;
700
700
  try {
701
- for (m.s(); !(y = m.n()).done; ) {
702
- var w = y.value;
701
+ for (g.s(); !(h = g.n()).done; ) {
702
+ var w = h.value;
703
703
  i.add(w);
704
- for (var p = typeof ShadowRoot < "u" && w.getRootNode() instanceof ShadowRoot, E = w; E; ) {
704
+ for (var v = typeof ShadowRoot < "u" && w.getRootNode() instanceof ShadowRoot, E = w; E; ) {
705
705
  i.add(E);
706
- var F = E.parentElement, C = [];
707
- F ? C = F.children : !F && p && (C = E.getRootNode().children, F = E.getRootNode().host, p = typeof ShadowRoot < "u" && F.getRootNode() instanceof ShadowRoot);
708
- var _ = he(C), A;
706
+ var F = E.parentElement, j = [];
707
+ F ? j = F.children : !F && v && (j = E.getRootNode().children, F = E.getRootNode().host, v = typeof ShadowRoot < "u" && F.getRootNode() instanceof ShadowRoot);
708
+ var _ = he(j), x;
709
709
  try {
710
- for (_.s(); !(A = _.n()).done; ) {
711
- var U = A.value;
710
+ for (_.s(); !(x = _.n()).done; ) {
711
+ var U = x.value;
712
712
  l.add(U);
713
713
  }
714
- } catch (q) {
715
- _.e(q);
714
+ } catch (M) {
715
+ _.e(M);
716
716
  } finally {
717
717
  _.f();
718
718
  }
719
719
  E = F;
720
720
  }
721
721
  }
722
- } catch (q) {
723
- m.e(q);
722
+ } catch (M) {
723
+ g.e(M);
724
724
  } finally {
725
- m.f();
725
+ g.f();
726
726
  }
727
- i.forEach(function(q) {
728
- l.delete(q);
727
+ i.forEach(function(M) {
728
+ l.delete(M);
729
729
  }), n.adjacentElements = l;
730
- }, d = function() {
730
+ }, m = function() {
731
731
  if (n.active)
732
- return a.removeEventListener("focusin", M, !0), a.removeEventListener("mousedown", L, !0), a.removeEventListener("touchstart", L, !0), a.removeEventListener("click", K, !0), a.removeEventListener("keydown", $, !0), a.removeEventListener("keydown", G), b;
733
- }, s = function(o) {
732
+ return a.removeEventListener("focusin", q, !0), a.removeEventListener("mousedown", I, !0), a.removeEventListener("touchstart", I, !0), a.removeEventListener("click", L, !0), a.removeEventListener("keydown", $, !0), a.removeEventListener("keydown", G), p;
733
+ }, u = function(o) {
734
734
  var i = o.some(function(l) {
735
- var m = Array.from(l.removedNodes);
736
- return m.some(function(y) {
737
- return y === n.mostRecentlyFocusedNode;
735
+ var g = Array.from(l.removedNodes);
736
+ return g.some(function(h) {
737
+ return h === n.mostRecentlyFocusedNode;
738
738
  });
739
739
  });
740
- i && j(D());
741
- }, T = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(s) : void 0, O = function() {
740
+ i && P(D());
741
+ }, T = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(u) : void 0, O = function() {
742
742
  T && (T.disconnect(), n.active && !n.paused && n.containers.map(function(o) {
743
743
  T.observe(o, {
744
744
  subtree: !0,
@@ -746,7 +746,7 @@ var B = {
746
746
  });
747
747
  }));
748
748
  };
749
- return b = {
749
+ return p = {
750
750
  get active() {
751
751
  return n.active;
752
752
  },
@@ -756,25 +756,25 @@ var B = {
756
756
  activate: function(o) {
757
757
  if (n.active)
758
758
  return this;
759
- var i = g(o, "onActivate"), l = g(o, "onPostActivate"), m = g(o, "checkCanFocusTrap"), y = B.getActiveTrap(u), w = !1;
760
- if (y && !y.paused) {
761
- var p;
762
- (p = y._setSubtreeIsolation) === null || p === void 0 || p.call(y, !1), w = !0;
759
+ var i = y(o, "onActivate"), l = y(o, "onPostActivate"), g = y(o, "checkCanFocusTrap"), h = B.getActiveTrap(s), w = !1;
760
+ if (h && !h.paused) {
761
+ var v;
762
+ (v = h._setSubtreeIsolation) === null || v === void 0 || v.call(h, !1), w = !0;
763
763
  }
764
764
  try {
765
- m || R(), n.active = !0, n.paused = !1, n.nodeFocusedBeforeActivation = I(a), i == null || i();
765
+ g || R(), n.active = !0, n.paused = !1, n.nodeFocusedBeforeActivation = A(a), i == null || i();
766
766
  var E = function() {
767
- m && R(), v(), O(), c.isolateSubtrees && b._setSubtreeIsolation(!0), l == null || l();
767
+ g && R(), d(), O(), c.isolateSubtrees && p._setSubtreeIsolation(!0), l == null || l();
768
768
  };
769
- if (m)
770
- return m(n.containers.concat()).then(E, E), this;
769
+ if (g)
770
+ return g(n.containers.concat()).then(E, E), this;
771
771
  E();
772
- } catch (C) {
773
- if (y === B.getActiveTrap(u) && w) {
772
+ } catch (j) {
773
+ if (h === B.getActiveTrap(s) && w) {
774
774
  var F;
775
- (F = y._setSubtreeIsolation) === null || F === void 0 || F.call(y, !0);
775
+ (F = h._setSubtreeIsolation) === null || F === void 0 || F.call(h, !0);
776
776
  }
777
- throw C;
777
+ throw j;
778
778
  }
779
779
  return this;
780
780
  },
@@ -786,29 +786,29 @@ var B = {
786
786
  onPostDeactivate: c.onPostDeactivate,
787
787
  checkCanReturnFocus: c.checkCanReturnFocus
788
788
  }, o);
789
- clearTimeout(n.delayInitialFocusTimer), n.delayInitialFocusTimer = void 0, n.paused || b._setSubtreeIsolation(!1), n.alreadySilent.clear(), d(), n.active = !1, n.paused = !1, O(), B.deactivateTrap(u, b);
790
- var l = g(i, "onDeactivate"), m = g(i, "onPostDeactivate"), y = g(i, "checkCanReturnFocus"), w = g(i, "returnFocus", "returnFocusOnDeactivate");
789
+ clearTimeout(n.delayInitialFocusTimer), n.delayInitialFocusTimer = void 0, n.paused || p._setSubtreeIsolation(!1), n.alreadySilent.clear(), m(), n.active = !1, n.paused = !1, O(), B.deactivateTrap(s, p);
790
+ var l = y(i, "onDeactivate"), g = y(i, "onPostDeactivate"), h = y(i, "checkCanReturnFocus"), w = y(i, "returnFocus", "returnFocusOnDeactivate");
791
791
  l == null || l();
792
- var p = function() {
792
+ var v = function() {
793
793
  ge(function() {
794
- w && j(x(n.nodeFocusedBeforeActivation)), m == null || m();
794
+ w && P(Y(n.nodeFocusedBeforeActivation)), g == null || g();
795
795
  });
796
796
  };
797
- return w && y ? (y(x(n.nodeFocusedBeforeActivation)).then(p, p), this) : (p(), this);
797
+ return w && h ? (h(Y(n.nodeFocusedBeforeActivation)).then(v, v), this) : (v(), this);
798
798
  },
799
799
  pause: function(o) {
800
800
  return n.active ? (n.manuallyPaused = !0, this._setPausedState(!0, o)) : this;
801
801
  },
802
802
  unpause: function(o) {
803
- return n.active ? (n.manuallyPaused = !1, u[u.length - 1] !== this ? this : this._setPausedState(!1, o)) : this;
803
+ return n.active ? (n.manuallyPaused = !1, s[s.length - 1] !== this ? this : this._setPausedState(!1, o)) : this;
804
804
  },
805
805
  updateContainerElements: function(o) {
806
806
  var i = [].concat(o).filter(Boolean);
807
807
  return n.containers = i.map(function(l) {
808
808
  return typeof l == "string" ? a.querySelector(l) : l;
809
- }), c.isolateSubtrees && f(n.containers), n.active && (R(), c.isolateSubtrees && !n.paused && b._setSubtreeIsolation(!0)), O(), this;
809
+ }), c.isolateSubtrees && f(n.containers), n.active && (R(), c.isolateSubtrees && !n.paused && p._setSubtreeIsolation(!0)), O(), this;
810
810
  }
811
- }, Object.defineProperties(b, {
811
+ }, Object.defineProperties(p, {
812
812
  _isManuallyPaused: {
813
813
  value: function() {
814
814
  return n.manuallyPaused;
@@ -819,11 +819,11 @@ var B = {
819
819
  if (n.paused === o)
820
820
  return this;
821
821
  if (n.paused = o, o) {
822
- var l = g(i, "onPause"), m = g(i, "onPostPause");
823
- l == null || l(), d(), O(), b._setSubtreeIsolation(!1), m == null || m();
822
+ var l = y(i, "onPause"), g = y(i, "onPostPause");
823
+ l == null || l(), m(), O(), p._setSubtreeIsolation(!1), g == null || g();
824
824
  } else {
825
- var y = g(i, "onUnpause"), w = g(i, "onPostUnpause");
826
- y == null || y(), b._setSubtreeIsolation(!0), R(), v(), O(), w == null || w();
825
+ var h = y(i, "onUnpause"), w = y(i, "onPostUnpause");
826
+ h == null || h(), p._setSubtreeIsolation(!0), R(), d(), O(), w == null || w();
827
827
  }
828
828
  return this;
829
829
  }
@@ -852,113 +852,113 @@ var B = {
852
852
  });
853
853
  }
854
854
  }
855
- }), b.updateContainerElements(e), b;
855
+ }), p.updateContainerElements(e), p;
856
856
  };
857
- const dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
857
+ const vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
858
858
  __proto__: null,
859
- createFocusTrap: ft
860
- }, Symbol.toStringTag, { value: "Module" })), vt = /* @__PURE__ */ we(dt), pt = /* @__PURE__ */ we(Je);
859
+ createFocusTrap: dt
860
+ }, Symbol.toStringTag, { value: "Module" })), pt = /* @__PURE__ */ ke(vt), bt = /* @__PURE__ */ ke(Qe);
861
861
  var Te;
862
- function bt() {
862
+ function ht() {
863
863
  if (Te) return Q.exports;
864
864
  Te = 1;
865
- function r(v) {
865
+ function r(d) {
866
866
  "@babel/helpers - typeof";
867
867
  return r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(f) {
868
868
  return typeof f;
869
869
  } : function(f) {
870
870
  return f && typeof Symbol == "function" && f.constructor === Symbol && f !== Symbol.prototype ? "symbol" : typeof f;
871
- }, r(v);
871
+ }, r(d);
872
872
  }
873
873
  var e, t;
874
- function a(v, f) {
875
- if (!(v instanceof f)) throw new TypeError("Cannot call a class as a function");
874
+ function a(d, f) {
875
+ if (!(d instanceof f)) throw new TypeError("Cannot call a class as a function");
876
876
  }
877
- function u(v, f) {
878
- for (var d = 0; d < f.length; d++) {
879
- var s = f[d];
880
- s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(v, j(s.key), s);
877
+ function s(d, f) {
878
+ for (var m = 0; m < f.length; m++) {
879
+ var u = f[m];
880
+ u.enumerable = u.enumerable || !1, u.configurable = !0, "value" in u && (u.writable = !0), Object.defineProperty(d, P(u.key), u);
881
881
  }
882
882
  }
883
- function c(v, f, d) {
884
- return f && u(v.prototype, f), Object.defineProperty(v, "prototype", { writable: !1 }), v;
883
+ function c(d, f, m) {
884
+ return f && s(d.prototype, f), Object.defineProperty(d, "prototype", { writable: !1 }), d;
885
885
  }
886
- function n(v, f, d) {
887
- return f = S(f), b(v, k() ? Reflect.construct(f, d || [], S(v).constructor) : f.apply(v, d));
886
+ function n(d, f, m) {
887
+ return f = S(f), p(d, k() ? Reflect.construct(f, m || [], S(d).constructor) : f.apply(d, m));
888
888
  }
889
- function b(v, f) {
889
+ function p(d, f) {
890
890
  if (f && (r(f) == "object" || typeof f == "function")) return f;
891
891
  if (f !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
892
- return g(v);
892
+ return y(d);
893
893
  }
894
- function g(v) {
895
- if (v === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
896
- return v;
894
+ function y(d) {
895
+ if (d === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
896
+ return d;
897
897
  }
898
898
  function k() {
899
899
  try {
900
- var v = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
900
+ var d = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
901
901
  }));
902
902
  } catch {
903
903
  }
904
904
  return (k = function() {
905
- return !!v;
905
+ return !!d;
906
906
  })();
907
907
  }
908
- function S(v) {
908
+ function S(d) {
909
909
  return S = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(f) {
910
910
  return f.__proto__ || Object.getPrototypeOf(f);
911
- }, S(v);
911
+ }, S(d);
912
912
  }
913
- function D(v, f) {
913
+ function D(d, f) {
914
914
  if (typeof f != "function" && f !== null) throw new TypeError("Super expression must either be null or a function");
915
- v.prototype = Object.create(f && f.prototype, { constructor: { value: v, writable: !0, configurable: !0 } }), Object.defineProperty(v, "prototype", { writable: !1 }), f && R(v, f);
915
+ d.prototype = Object.create(f && f.prototype, { constructor: { value: d, writable: !0, configurable: !0 } }), Object.defineProperty(d, "prototype", { writable: !1 }), f && R(d, f);
916
916
  }
917
- function R(v, f) {
918
- return R = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(d, s) {
919
- return d.__proto__ = s, d;
920
- }, R(v, f);
917
+ function R(d, f) {
918
+ return R = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(m, u) {
919
+ return m.__proto__ = u, m;
920
+ }, R(d, f);
921
921
  }
922
- function I(v, f, d) {
923
- return (f = j(f)) in v ? Object.defineProperty(v, f, { value: d, enumerable: !0, configurable: !0, writable: !0 }) : v[f] = d, v;
922
+ function A(d, f, m) {
923
+ return (f = P(f)) in d ? Object.defineProperty(d, f, { value: m, enumerable: !0, configurable: !0, writable: !0 }) : d[f] = m, d;
924
924
  }
925
- function j(v) {
926
- var f = x(v, "string");
925
+ function P(d) {
926
+ var f = Y(d, "string");
927
927
  return r(f) == "symbol" ? f : f + "";
928
928
  }
929
- function x(v, f) {
930
- if (r(v) != "object" || !v) return v;
931
- var d = v[Symbol.toPrimitive];
932
- if (d !== void 0) {
933
- var s = d.call(v, f);
934
- if (r(s) != "object") return s;
929
+ function Y(d, f) {
930
+ if (r(d) != "object" || !d) return d;
931
+ var m = d[Symbol.toPrimitive];
932
+ if (m !== void 0) {
933
+ var u = m.call(d, f);
934
+ if (r(u) != "object") return u;
935
935
  throw new TypeError("@@toPrimitive must return a primitive value.");
936
936
  }
937
- return (f === "string" ? String : Number)(v);
937
+ return (f === "string" ? String : Number)(d);
938
938
  }
939
- var P = je, L = vt, M = L.createFocusTrap, Y = pt, $ = Y.isFocusable, G = parseInt((e = (t = /^(\d+)\./.exec(P.version)) === null || t === void 0 ? void 0 : t[1]) !== null && e !== void 0 ? e : 0, 10), K = /* @__PURE__ */ (function(v) {
940
- function f(d) {
941
- var s;
942
- a(this, f), s = n(this, f, [d]), I(s, "getNodeForOption", function(h) {
943
- var o, i = (o = this.internalOptions[h]) !== null && o !== void 0 ? o : this.originalOptions[h];
939
+ var C = Ie, I = pt, q = I.createFocusTrap, V = bt, $ = V.isFocusable, G = parseInt((e = (t = /^(\d+)\./.exec(C.version)) === null || t === void 0 ? void 0 : t[1]) !== null && e !== void 0 ? e : 0, 10), L = /* @__PURE__ */ (function(d) {
940
+ function f(m) {
941
+ var u;
942
+ a(this, f), u = n(this, f, [m]), A(u, "getNodeForOption", function(b) {
943
+ var o, i = (o = this.internalOptions[b]) !== null && o !== void 0 ? o : this.originalOptions[b];
944
944
  if (typeof i == "function") {
945
- for (var l = arguments.length, m = new Array(l > 1 ? l - 1 : 0), y = 1; y < l; y++)
946
- m[y - 1] = arguments[y];
947
- i = i.apply(void 0, m);
945
+ for (var l = arguments.length, g = new Array(l > 1 ? l - 1 : 0), h = 1; h < l; h++)
946
+ g[h - 1] = arguments[h];
947
+ i = i.apply(void 0, g);
948
948
  }
949
949
  if (i === !0 && (i = void 0), !i) {
950
950
  if (i === void 0 || i === !1)
951
951
  return i;
952
- throw new Error("`".concat(h, "` was specified but was not a node, or did not return a node"));
952
+ throw new Error("`".concat(b, "` was specified but was not a node, or did not return a node"));
953
953
  }
954
954
  var w = i;
955
955
  if (typeof i == "string") {
956
- var p;
957
- if (w = (p = this.getDocument()) === null || p === void 0 ? void 0 : p.querySelector(i), !w)
958
- throw new Error("`".concat(h, "` as selector refers to no known node"));
956
+ var v;
957
+ if (w = (v = this.getDocument()) === null || v === void 0 ? void 0 : v.querySelector(i), !w)
958
+ throw new Error("`".concat(b, "` as selector refers to no known node"));
959
959
  }
960
960
  return w;
961
- }), s.handleDeactivate = s.handleDeactivate.bind(s), s.handlePostDeactivate = s.handlePostDeactivate.bind(s), s.handleClickOutsideDeactivates = s.handleClickOutsideDeactivates.bind(s), s.internalOptions = {
961
+ }), u.handleDeactivate = u.handleDeactivate.bind(u), u.handlePostDeactivate = u.handlePostDeactivate.bind(u), u.handleClickOutsideDeactivates = u.handleClickOutsideDeactivates.bind(u), u.internalOptions = {
962
962
  // We need to hijack the returnFocusOnDeactivate option,
963
963
  // because React can move focus into the element before we arrived at
964
964
  // this lifecycle hook (e.g. with autoFocus inputs). So the component
@@ -968,14 +968,14 @@ function bt() {
968
968
  // the rest of these are also related to deactivation of the trap, and we
969
969
  // need to use them and control them as well
970
970
  checkCanReturnFocus: null,
971
- onDeactivate: s.handleDeactivate,
972
- onPostDeactivate: s.handlePostDeactivate,
971
+ onDeactivate: u.handleDeactivate,
972
+ onPostDeactivate: u.handlePostDeactivate,
973
973
  // we need to special-case this setting as well so that we can know if we should
974
974
  // NOT return focus if the trap gets auto-deactivated as the result of an
975
975
  // outside click (otherwise, we'll always think we should return focus because
976
976
  // of how we manage that flag internally here)
977
- clickOutsideDeactivates: s.handleClickOutsideDeactivates
978
- }, s.originalOptions = {
977
+ clickOutsideDeactivates: u.handleClickOutsideDeactivates
978
+ }, u.originalOptions = {
979
979
  // because of the above `internalOptions`, we maintain our own flag for
980
980
  // this option, and default it to `true` because that's focus-trap's default
981
981
  returnFocusOnDeactivate: !0,
@@ -988,18 +988,18 @@ function bt() {
988
988
  // the user's setting, defaulted to false since focus-trap defaults this to false
989
989
  clickOutsideDeactivates: !1
990
990
  };
991
- var T = d.focusTrapOptions;
991
+ var T = m.focusTrapOptions;
992
992
  for (var O in T)
993
993
  if (Object.prototype.hasOwnProperty.call(T, O)) {
994
994
  if (O === "returnFocusOnDeactivate" || O === "onDeactivate" || O === "onPostDeactivate" || O === "checkCanReturnFocus" || O === "clickOutsideDeactivates") {
995
- s.originalOptions[O] = T[O];
995
+ u.originalOptions[O] = T[O];
996
996
  continue;
997
997
  }
998
- s.internalOptions[O] = T[O];
998
+ u.internalOptions[O] = T[O];
999
999
  }
1000
- return s.outsideClick = null, s.focusTrapElements = d.containerElements || [], s.updatePreviousElement(), s;
1000
+ return u.outsideClick = null, u.focusTrapElements = m.containerElements || [], u.updatePreviousElement(), u;
1001
1001
  }
1002
- return D(f, v), c(f, [{
1002
+ return D(f, d), c(f, [{
1003
1003
  key: "getDocument",
1004
1004
  value: function() {
1005
1005
  return this.props.focusTrapOptions.document || (typeof document < "u" ? document : void 0);
@@ -1007,15 +1007,15 @@ function bt() {
1007
1007
  }, {
1008
1008
  key: "getReturnFocusNode",
1009
1009
  value: function() {
1010
- var s = this.getNodeForOption("setReturnFocus", this.previouslyFocusedElement);
1011
- return s || (s === !1 ? !1 : this.previouslyFocusedElement);
1010
+ var u = this.getNodeForOption("setReturnFocus", this.previouslyFocusedElement);
1011
+ return u || (u === !1 ? !1 : this.previouslyFocusedElement);
1012
1012
  }
1013
1013
  /** Update the previously focused element with the currently focused element. */
1014
1014
  }, {
1015
1015
  key: "updatePreviousElement",
1016
1016
  value: function() {
1017
- var s = this.getDocument();
1018
- s && (this.previouslyFocusedElement = s.activeElement);
1017
+ var u = this.getDocument();
1018
+ u && (this.previouslyFocusedElement = u.activeElement);
1019
1019
  }
1020
1020
  }, {
1021
1021
  key: "deactivateTrap",
@@ -1039,10 +1039,10 @@ function bt() {
1039
1039
  }
1040
1040
  }, {
1041
1041
  key: "handleClickOutsideDeactivates",
1042
- value: function(s) {
1043
- var T = typeof this.originalOptions.clickOutsideDeactivates == "function" ? this.originalOptions.clickOutsideDeactivates.call(null, s) : this.originalOptions.clickOutsideDeactivates;
1042
+ value: function(u) {
1043
+ var T = typeof this.originalOptions.clickOutsideDeactivates == "function" ? this.originalOptions.clickOutsideDeactivates.call(null, u) : this.originalOptions.clickOutsideDeactivates;
1044
1044
  return T && (this.outsideClick = {
1045
- target: s.target,
1045
+ target: u.target,
1046
1046
  allowDeactivation: T
1047
1047
  }), T;
1048
1048
  }
@@ -1054,18 +1054,18 @@ function bt() {
1054
1054
  }, {
1055
1055
  key: "handlePostDeactivate",
1056
1056
  value: function() {
1057
- var s = this, T = function() {
1058
- var h = s.getReturnFocusNode(), o = !!// did the consumer allow it?
1059
- (s.originalOptions.returnFocusOnDeactivate && // can we actually focus the node?
1060
- h !== null && h !== void 0 && h.focus && // was there an outside click that allowed deactivation?
1061
- (!s.outsideClick || // did the consumer allow deactivation when the outside node was clicked?
1062
- s.outsideClick.allowDeactivation && // is the outside node NOT focusable (implying that it did NOT receive focus
1057
+ var u = this, T = function() {
1058
+ var b = u.getReturnFocusNode(), o = !!// did the consumer allow it?
1059
+ (u.originalOptions.returnFocusOnDeactivate && // can we actually focus the node?
1060
+ b !== null && b !== void 0 && b.focus && // was there an outside click that allowed deactivation?
1061
+ (!u.outsideClick || // did the consumer allow deactivation when the outside node was clicked?
1062
+ u.outsideClick.allowDeactivation && // is the outside node NOT focusable (implying that it did NOT receive focus
1063
1063
  // as a result of the click-through) -- in which case do NOT restore focus
1064
1064
  // to `returnFocusNode` because focus should remain on the outside node
1065
- !$(s.outsideClick.target, s.internalOptions.tabbableOptions))), i = s.internalOptions.preventScroll, l = i === void 0 ? !1 : i;
1066
- o && h.focus({
1065
+ !$(u.outsideClick.target, u.internalOptions.tabbableOptions))), i = u.internalOptions.preventScroll, l = i === void 0 ? !1 : i;
1066
+ o && b.focus({
1067
1067
  preventScroll: l
1068
- }), s.originalOptions.onPostDeactivate && s.originalOptions.onPostDeactivate.call(null), s.outsideClick = null;
1068
+ }), u.originalOptions.onPostDeactivate && u.originalOptions.onPostDeactivate.call(null), u.outsideClick = null;
1069
1069
  };
1070
1070
  this.originalOptions.checkCanReturnFocus ? this.originalOptions.checkCanReturnFocus.call(null, this.getReturnFocusNode()).then(T, T) : T();
1071
1071
  }
@@ -1075,8 +1075,8 @@ function bt() {
1075
1075
  if (this.focusTrap)
1076
1076
  this.props.active && !this.focusTrap.active && (this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
1077
1077
  else {
1078
- var s = this.focusTrapElements.some(Boolean);
1079
- s && (this.focusTrap = this.props._createFocusTrap(this.focusTrapElements, this.internalOptions), this.props.active && this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
1078
+ var u = this.focusTrapElements.some(Boolean);
1079
+ u && (this.focusTrap = this.props._createFocusTrap(this.focusTrapElements, this.internalOptions), this.props.active && this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
1080
1080
  }
1081
1081
  }
1082
1082
  }, {
@@ -1086,17 +1086,17 @@ function bt() {
1086
1086
  }
1087
1087
  }, {
1088
1088
  key: "componentDidUpdate",
1089
- value: function(s) {
1089
+ value: function(u) {
1090
1090
  if (this.focusTrap) {
1091
- s.containerElements !== this.props.containerElements && this.focusTrap.updateContainerElements(this.props.containerElements);
1092
- var T = !s.active && this.props.active, O = s.active && !this.props.active, h = !s.paused && this.props.paused, o = s.paused && !this.props.paused;
1091
+ u.containerElements !== this.props.containerElements && this.focusTrap.updateContainerElements(this.props.containerElements);
1092
+ var T = !u.active && this.props.active, O = u.active && !this.props.active, b = !u.paused && this.props.paused, o = u.paused && !this.props.paused;
1093
1093
  if (T && (this.updatePreviousElement(), this.focusTrap.activate()), O) {
1094
1094
  this.deactivateTrap();
1095
1095
  return;
1096
1096
  }
1097
- h && this.focusTrap.pause(), o && this.focusTrap.unpause();
1097
+ b && this.focusTrap.pause(), o && this.focusTrap.unpause();
1098
1098
  } else
1099
- s.containerElements !== this.props.containerElements && (this.focusTrapElements = this.props.containerElements), this.props.active && (this.updatePreviousElement(), this.setupFocusTrap());
1099
+ u.containerElements !== this.props.containerElements && (this.focusTrapElements = this.props.containerElements), this.props.active && (this.updatePreviousElement(), this.setupFocusTrap());
1100
1100
  }
1101
1101
  }, {
1102
1102
  key: "componentWillUnmount",
@@ -1106,50 +1106,50 @@ function bt() {
1106
1106
  }, {
1107
1107
  key: "render",
1108
1108
  value: function() {
1109
- var s = this, T = this.props.children ? P.Children.only(this.props.children) : void 0;
1109
+ var u = this, T = this.props.children ? C.Children.only(this.props.children) : void 0;
1110
1110
  if (T) {
1111
- if (T.type && T.type === P.Fragment)
1111
+ if (T.type && T.type === C.Fragment)
1112
1112
  throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");
1113
1113
  var O = function(i) {
1114
- var l = s.props.containerElements;
1115
- T && (G >= 19 ? typeof T.props.ref == "function" ? T.props.ref(i) : T.props.ref && (T.props.ref.current = i) : typeof T.ref == "function" ? T.ref(i) : T.ref && (T.ref.current = i)), s.focusTrapElements = l || [i];
1116
- }, h = P.cloneElement(T, {
1114
+ var l = u.props.containerElements;
1115
+ T && (G >= 19 ? typeof T.props.ref == "function" ? T.props.ref(i) : T.props.ref && (T.props.ref.current = i) : typeof T.ref == "function" ? T.ref(i) : T.ref && (T.ref.current = i)), u.focusTrapElements = l || [i];
1116
+ }, b = C.cloneElement(T, {
1117
1117
  ref: O
1118
1118
  });
1119
- return h;
1119
+ return b;
1120
1120
  }
1121
1121
  return null;
1122
1122
  }
1123
1123
  }]);
1124
- })(P.Component);
1125
- return K.defaultProps = {
1124
+ })(C.Component);
1125
+ return L.defaultProps = {
1126
1126
  active: !0,
1127
1127
  paused: !1,
1128
1128
  focusTrapOptions: {},
1129
- _createFocusTrap: M
1130
- }, Q.exports = K, Q.exports.FocusTrap = K, Q.exports;
1129
+ _createFocusTrap: q
1130
+ }, Q.exports = L, Q.exports.FocusTrap = L, Q.exports;
1131
1131
  }
1132
- var ht = bt();
1133
- const Ce = Ie({
1132
+ var yt = ht();
1133
+ const je = Ae({
1134
1134
  isVisible: !1
1135
1135
  }), {
1136
- Provider: yt
1137
- } = Ce;
1138
- function mt() {
1139
- return Ae(Ce);
1140
- }
1136
+ Provider: mt
1137
+ } = je;
1141
1138
  function gt() {
1139
+ return xe(je);
1140
+ }
1141
+ function Tt() {
1142
1142
  const {
1143
1143
  close: r
1144
- } = mt(), e = J(() => {
1144
+ } = gt(), e = J(() => {
1145
1145
  r == null || r();
1146
1146
  }, [r]);
1147
1147
  return /* @__PURE__ */ N.jsxs(N.Fragment, { children: [
1148
1148
  /* @__PURE__ */ N.jsx("div", { className: "kakadu-components-2543813221" }),
1149
- /* @__PURE__ */ N.jsx("div", { className: "kakadu-components-840864829", children: /* @__PURE__ */ N.jsx(Le, { iconLeft: _e.times, label: "Close", className: "kakadu-components-3855719072", onClick: e }) })
1149
+ /* @__PURE__ */ N.jsx("div", { className: "kakadu-components-840864829", children: /* @__PURE__ */ N.jsx(Be, { iconLeft: Le.times, label: "Close", className: "kakadu-components-3855719072", onClick: e }) })
1150
1150
  ] });
1151
1151
  }
1152
- function Tt({
1152
+ function we({
1153
1153
  decorators: r,
1154
1154
  children: e
1155
1155
  }) {
@@ -1157,96 +1157,97 @@ function Tt({
1157
1157
  }
1158
1158
  function Dt({
1159
1159
  root: r,
1160
- decorators: e = [],
1161
- maxWidth: t,
1162
- className: a,
1163
- isVisible: u,
1164
- isFullWidth: c = !1,
1165
- shouldCloseOnOutsideClick: n = !0,
1166
- shouldCloseOnEscapePress: b = !0,
1167
- showCloseButton: g = !0,
1168
- onClose: k,
1169
- children: S
1160
+ outerDecorators: e = [],
1161
+ innerDecorators: t = [],
1162
+ maxWidth: a,
1163
+ className: s,
1164
+ isVisible: c,
1165
+ isFullWidth: n = !1,
1166
+ shouldCloseOnOutsideClick: p = !0,
1167
+ shouldCloseOnEscapePress: y = !0,
1168
+ showCloseButton: k = !0,
1169
+ onClose: S,
1170
+ children: D
1170
1171
  }) {
1171
- const D = te(null), R = te(null), [I, j] = re(!1), [x, P] = re(!1), L = J((d) => {
1172
- D.current = d, P(!1);
1173
- }, []), M = te(null), Y = J((d) => {
1174
- d && (M.current = d);
1175
- }, []), [$, G] = re(u ?? !1), K = ne(() => ({
1176
- isVisible: $,
1177
- setInitialFocus: Y,
1178
- close: L
1179
- }), [$, Y, L]);
1172
+ const R = te(null), A = te(null), [P, Y] = re(!1), [C, I] = re(!1), q = J((u) => {
1173
+ R.current = u, I(!1);
1174
+ }, []), V = te(null), $ = J((u) => {
1175
+ u && (V.current = u);
1176
+ }, []), [G, L] = re(c ?? !1), d = ne(() => ({
1177
+ isVisible: G,
1178
+ setInitialFocus: $,
1179
+ close: q
1180
+ }), [G, $, q]);
1180
1181
  H(() => {
1181
- u && (j(!0), G(!0));
1182
- }, [u]), H(() => {
1183
- if (u) {
1184
- const d = setTimeout(() => {
1185
- P(!0);
1182
+ c && (Y(!0), L(!0));
1183
+ }, [c]), H(() => {
1184
+ if (c) {
1185
+ const u = setTimeout(() => {
1186
+ I(!0);
1186
1187
  }, 100);
1187
1188
  return () => {
1188
- clearTimeout(d);
1189
+ clearTimeout(u);
1189
1190
  };
1190
1191
  }
1191
- P(!1);
1192
- }, [u]), H(() => {
1193
- if (I && !x) {
1194
- const d = setTimeout(() => {
1195
- k == null || k(D.current ?? void 0), G(!1);
1192
+ I(!1);
1193
+ }, [c]), H(() => {
1194
+ if (P && !C) {
1195
+ const u = setTimeout(() => {
1196
+ S == null || S(R.current ?? void 0), L(!1);
1196
1197
  }, 370);
1197
1198
  return () => {
1198
- clearTimeout(d);
1199
+ clearTimeout(u);
1199
1200
  };
1200
1201
  }
1201
- }, [I, x, k]), H(() => {
1202
- const d = R.current;
1203
- if (u && n && d) {
1204
- const s = (T) => {
1205
- d === T.target && P(!1);
1202
+ }, [P, C, S]), H(() => {
1203
+ const u = A.current;
1204
+ if (c && p && u) {
1205
+ const T = (O) => {
1206
+ u === O.target && I(!1);
1206
1207
  };
1207
- return d.addEventListener("click", s), () => {
1208
- d.removeEventListener("click", s);
1208
+ return u.addEventListener("click", T), () => {
1209
+ u.removeEventListener("click", T);
1209
1210
  };
1210
1211
  }
1211
- }, [u, n]), H(() => {
1212
- if (!u || !b)
1212
+ }, [c, p]), H(() => {
1213
+ if (!c || !y)
1213
1214
  return;
1214
- const d = (s) => {
1215
- s.key === "Escape" && P(!1);
1215
+ const u = (T) => {
1216
+ T.key === "Escape" && I(!1);
1216
1217
  };
1217
- return window.addEventListener("keydown", d), () => {
1218
- window.removeEventListener("keydown", d);
1218
+ return window.addEventListener("keydown", u), () => {
1219
+ window.removeEventListener("keydown", u);
1219
1220
  };
1220
- }, [u, b]);
1221
- const v = ne(() => ({
1222
- initialFocus: () => M.current ?? void 0,
1221
+ }, [c, y]);
1222
+ const f = ne(() => ({
1223
+ initialFocus: () => V.current ?? void 0,
1223
1224
  onActivate: () => {
1224
- var d;
1225
- return (d = M.current) == null ? void 0 : d.focus();
1225
+ var u;
1226
+ return (u = V.current) == null ? void 0 : u.focus();
1226
1227
  }
1227
- }), []), f = /* @__PURE__ */ N.jsx(Tt, { decorators: e, children: /* @__PURE__ */ N.jsx("div", { style: {
1228
- "--max-width": t ? `${t}px` : void 0
1229
- }, className: pe("kakadu-components-4119461136", x && "kakadu-components-2522346797", a), children: /* @__PURE__ */ N.jsx(ht.FocusTrap, { active: x, focusTrapOptions: v, children: /* @__PURE__ */ N.jsx("div", { ref: R, className: "kakadu-components-3001745367", children: /* @__PURE__ */ N.jsx("div", { className: pe("kakadu-components-3903793117", c && "kakadu-components-2700481558", x && "kakadu-components-2379306144"), children: /* @__PURE__ */ N.jsxs(yt, { value: K, children: [
1230
- g ? /* @__PURE__ */ N.jsx(gt, {}) : null,
1231
- /* @__PURE__ */ N.jsx("div", { className: "kakadu-components-4238836556", children: S })
1232
- ] }) }) }) }) }) });
1233
- return r ? xe(f, r) : f;
1228
+ }), []), m = /* @__PURE__ */ N.jsx(we, { decorators: e, children: /* @__PURE__ */ N.jsx("div", { style: {
1229
+ "--max-width": a ? `${a}px` : void 0
1230
+ }, className: pe("kakadu-components-4119461136", C && "kakadu-components-2522346797", s), children: /* @__PURE__ */ N.jsx(we, { decorators: t, children: /* @__PURE__ */ N.jsx(yt.FocusTrap, { active: C, focusTrapOptions: f, children: /* @__PURE__ */ N.jsx("div", { ref: A, className: "kakadu-components-4011815997", children: /* @__PURE__ */ N.jsx("div", { className: pe("kakadu-components-3324483532", n && "kakadu-components-3799971070", C && "kakadu-components-968755580"), children: /* @__PURE__ */ N.jsxs(mt, { value: d, children: [
1231
+ k ? /* @__PURE__ */ N.jsx(Tt, {}) : null,
1232
+ /* @__PURE__ */ N.jsx("div", { className: "kakadu-components-177997624", children: D })
1233
+ ] }) }) }) }) }) }) });
1234
+ return r ? _e(m, r) : m;
1234
1235
  }
1235
1236
  function Nt(r, e) {
1236
- const [t, a] = re(!1), u = te(void 0), c = J(async () => (a(!0), new Promise((g) => {
1237
- u.current = g;
1238
- })), []), n = J((g) => {
1237
+ const [t, a] = re(!1), s = te(void 0), c = J(async () => (a(!0), new Promise((y) => {
1238
+ s.current = y;
1239
+ })), []), n = J((y) => {
1239
1240
  var k;
1240
- a(!1), (k = u.current) == null || k.call(u, g), u.current = void 0;
1241
- }, []), b = ne(() => /* @__PURE__ */ N.jsx(r, { ...e, isVisible: t, onClose: n }), [r, e, t, n]);
1241
+ a(!1), (k = s.current) == null || k.call(s, y), s.current = void 0;
1242
+ }, []), p = ne(() => /* @__PURE__ */ N.jsx(r, { ...e, isVisible: t, onClose: n }), [r, e, t, n]);
1242
1243
  return ne(() => ({
1243
1244
  isVisible: t,
1244
1245
  show: c,
1245
- modal: b
1246
- }), [t, c, b]);
1246
+ modal: p
1247
+ }), [t, c, p]);
1247
1248
  }
1248
1249
  export {
1249
1250
  Dt as default,
1250
1251
  Nt as useModal,
1251
- mt as useModalContext
1252
+ gt as useModalContext
1252
1253
  };