@konstructio/ui 0.0.12-alpha.1 → 0.0.12-alpha.2

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.
Files changed (58) hide show
  1. package/dist/{Combination-BQYb0Gw7.js → Combination-b348x__d.js} +24 -24
  2. package/dist/{Modal-W2GbkC_F.js → Modal-DZUwNzSW.js} +315 -307
  3. package/dist/components/Alert/Alert.js +58 -0
  4. package/dist/components/Alert/Alert.variants.js +77 -0
  5. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  6. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  7. package/dist/components/AlertDialog/components/index.js +1 -1
  8. package/dist/components/Autocomplete/components/List/List.js +3 -3
  9. package/dist/components/Breadcrumb/Breadcrumb.js +3 -3
  10. package/dist/components/Breadcrumb/components/Item/Item.js +4 -4
  11. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  12. package/dist/components/Button/Button.js +1 -1
  13. package/dist/components/Card/Card.js +3 -3
  14. package/dist/components/Checkbox/Checkbox.js +5 -5
  15. package/dist/components/Divider/Divider.js +10 -0
  16. package/dist/components/Divider/Divider.variants.js +14 -0
  17. package/dist/components/Loading/Loading.js +28 -0
  18. package/dist/components/Loading/Loading.variants.js +20 -0
  19. package/dist/components/Modal/Modal.js +2 -2
  20. package/dist/components/Modal/components/Body/Body.js +1 -1
  21. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  22. package/dist/components/Modal/components/Header/Header.js +1 -1
  23. package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
  24. package/dist/components/Modal/components/index.js +1 -1
  25. package/dist/components/NumberInput/NumberInput.js +1 -1
  26. package/dist/components/ProgressBar/ProgressBar.js +3 -3
  27. package/dist/components/Radio/Radio.js +4 -4
  28. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  29. package/dist/components/Range/Range.js +4 -4
  30. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +3 -3
  31. package/dist/components/Slider/Slider.js +14 -14
  32. package/dist/components/Switch/Switch.js +17 -17
  33. package/dist/components/TagSelect/TagSelect.js +3 -3
  34. package/dist/components/Toast/Toast.js +11 -11
  35. package/dist/components/Tooltip/Tooltip.js +4 -4
  36. package/dist/components/Typography/Typography.js +30 -0
  37. package/dist/components/Typography/Typography.variants.js +36 -0
  38. package/dist/components/index.js +61 -53
  39. package/dist/{index-BVppSRDQ.js → index-3jTPaVvh.js} +9 -9
  40. package/dist/{index-BxeV34ij.js → index-4ecjw_Aj.js} +1 -1
  41. package/dist/{index-CoqDsznq.js → index-B33at13_.js} +3 -3
  42. package/dist/{index-1GLoikpT.js → index-BTeAm7mx.js} +6808 -6809
  43. package/dist/index-B_6_jmOO.js +68 -0
  44. package/dist/{index-BBjak_0p.js → index-BbsJ0VIJ.js} +2 -2
  45. package/dist/{index-CJsYodgi.js → index-C6WtlN_F.js} +9 -9
  46. package/dist/{index-8vgf-x5i.js → index-Cva-e5M4.js} +2 -2
  47. package/dist/{index-D4Q2rMby.js → index-Dj1pom3_.js} +2 -2
  48. package/dist/{index-KEdwcThH.js → index-Z1voPZOH.js} +1 -1
  49. package/dist/index.d.ts +41 -2
  50. package/dist/index.js +76 -68
  51. package/dist/package.json +27 -28
  52. package/dist/plugins/konstruct.js +34 -31
  53. package/dist/plugins/utils/animation.styles.js +162 -0
  54. package/dist/plugins/utils/index.js +7 -0
  55. package/dist/styles.css +1 -1
  56. package/dist/{useBreadcrumb-CojbXFVD.js → useBreadcrumb-BsIeMoR1.js} +47 -47
  57. package/package.json +27 -28
  58. package/dist/index-DoOsnuB6.js +0 -72
@@ -1,15 +1,15 @@
1
1
  import { Body as Cr } from "./components/Modal/components/Body/Body.js";
2
2
  import { Footer as Mr } from "./components/Modal/components/Footer/Footer.js";
3
3
  import { Header as _r } from "./components/Modal/components/Header/Header.js";
4
- import { jsx as M, jsxs as Q } from "react/jsx-runtime";
5
- import { r as kr } from "./index-1GLoikpT.js";
6
- import { R as Lr } from "./index-KEdwcThH.js";
7
- import I, { createContext as Rr, forwardRef as We, useState as Z, useRef as ee, useCallback as R, useEffect as Wr, useMemo as Br, Fragment as Ur, PureComponent as Gr, Children as q, isValidElement as $ } from "react";
4
+ import { jsx as _, jsxs as ee } from "react/jsx-runtime";
5
+ import { r as kr } from "./index-BTeAm7mx.js";
6
+ import { R as Lr } from "./index-Z1voPZOH.js";
7
+ import S, { createContext as Rr, forwardRef as Ue, useState as re, useRef as ne, useCallback as W, useEffect as Wr, useMemo as Br, Fragment as Ur, PureComponent as Gr, Children as K, isValidElement as X } from "react";
8
8
  import { p as l } from "./index-C5psggHV.js";
9
- import { c as se, a as Hr, u as jr, R as Vr } from "./Combination-BQYb0Gw7.js";
10
- import { cn as Ae } from "./utils/index.js";
11
- import { useModal as Be } from "./components/Modal/hooks/useModal.js";
12
- import { modalVariants as qr, buttonCloseVariants as $r } from "./components/Modal/components/Wrapper/Wrapper.variants.js";
9
+ import { c as le, a as Hr, u as jr, R as Vr } from "./Combination-b348x__d.js";
10
+ import { cn as Ce } from "./utils/index.js";
11
+ import { useModal as Ge } from "./components/Modal/hooks/useModal.js";
12
+ import { buttonCloseVariants as qr, modalVariants as $r } from "./components/Modal/components/Wrapper/Wrapper.variants.js";
13
13
  import { X as Kr } from "./x-DU-Zw-L_.js";
14
14
  import { useTheme as Xr } from "./contexts/theme.hook.js";
15
15
  function Yr(e, r) {
@@ -21,16 +21,16 @@ function Yr(e, r) {
21
21
  }
22
22
  return n;
23
23
  }
24
- function B() {
25
- return B = Object.assign ? Object.assign.bind() : function(e) {
24
+ function U() {
25
+ return U = Object.assign ? Object.assign.bind() : function(e) {
26
26
  for (var r = 1; r < arguments.length; r++) {
27
27
  var n = arguments[r];
28
28
  for (var t in n) ({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
29
29
  }
30
30
  return e;
31
- }, B.apply(null, arguments);
31
+ }, U.apply(null, arguments);
32
32
  }
33
- var ue = "data-focus-lock", Ue = "data-focus-lock-disabled", zr = "data-no-focus-lock", Jr = "data-autofocus-inside", Qr = "data-no-autofocus", re = {
33
+ var ie = "data-focus-lock", He = "data-focus-lock-disabled", zr = "data-no-focus-lock", Jr = "data-autofocus-inside", Qr = "data-no-autofocus", te = {
34
34
  width: "1px",
35
35
  height: "0px",
36
36
  padding: 0,
@@ -38,95 +38,95 @@ var ue = "data-focus-lock", Ue = "data-focus-lock-disabled", zr = "data-no-focus
38
38
  position: "fixed",
39
39
  top: "1px",
40
40
  left: "1px"
41
- }, Ge = se({}, function(e) {
41
+ }, je = le({}, function(e) {
42
42
  var r = e.target, n = e.currentTarget;
43
43
  return {
44
44
  target: r,
45
45
  currentTarget: n
46
46
  };
47
- }), He = se(), Zr = se(), en = Hr({
47
+ }), Ve = le(), Zr = le(), en = Hr({
48
48
  async: !0,
49
49
  ssr: typeof document < "u"
50
- }), rn = /* @__PURE__ */ Rr(void 0), nn = [], de = /* @__PURE__ */ We(function(r, n) {
51
- var t, o = Z(), u = o[0], i = o[1], c = ee(), v = ee(!1), f = ee(null), b = Z({}), s = b[1], a = r.children, m = r.disabled, d = m === void 0 ? !1 : m, p = r.noFocusGuards, F = p === void 0 ? !1 : p, E = r.persistentFocus, y = E === void 0 ? !1 : E, h = r.crossFrame, x = h === void 0 ? !0 : h, S = r.autoFocus, X = S === void 0 ? !0 : S, lr = r.allowTextSelection, vr = r.group, mr = r.className, pr = r.whiteList, br = r.hasPositiveIndices, xe = r.shards, Y = xe === void 0 ? nn : xe, we = r.as, Ie = we === void 0 ? "div" : we, Ne = r.lockProps, yr = Ne === void 0 ? {} : Ne, hr = r.sideCar, Se = r.returnFocus, V = Se === void 0 ? !1 : Se, gr = r.focusOptions, z = r.onActivation, J = r.onDeactivation, Fr = Z({}), Er = Fr[0], Or = R(function(w) {
52
- var D = w.captureFocusRestore;
50
+ }), rn = /* @__PURE__ */ Rr(void 0), nn = [], ve = /* @__PURE__ */ Ue(function(r, n) {
51
+ var t, o = re(), u = o[0], i = o[1], c = ne(), v = ne(!1), f = ne(null), b = re({}), s = b[1], a = r.children, p = r.disabled, d = p === void 0 ? !1 : p, m = r.noFocusGuards, F = m === void 0 ? !1 : m, x = r.persistentFocus, y = x === void 0 ? !1 : x, h = r.crossFrame, O = h === void 0 ? !0 : h, w = r.autoFocus, D = w === void 0 ? !0 : w, q = r.allowTextSelection, z = r.group, mr = r.className, pr = r.whiteList, br = r.hasPositiveIndices, Ie = r.shards, J = Ie === void 0 ? nn : Ie, Se = r.as, Ne = Se === void 0 ? "div" : Se, Te = r.lockProps, yr = Te === void 0 ? {} : Te, hr = r.sideCar, Pe = r.returnFocus, $ = Pe === void 0 ? !1 : Pe, Fr = r.focusOptions, Q = r.onActivation, Z = r.onDeactivation, gr = re({}), xr = gr[0], Or = W(function(I) {
52
+ var C = I.captureFocusRestore;
53
53
  if (!f.current) {
54
- var C, P = (C = document) == null ? void 0 : C.activeElement;
55
- f.current = P, P !== document.body && (f.current = D(P));
54
+ var M, T = (M = document) == null ? void 0 : M.activeElement;
55
+ f.current = T, T !== document.body && (f.current = C(T));
56
56
  }
57
- c.current && z && z(c.current), v.current = !0, s();
58
- }, [z]), xr = R(function() {
59
- v.current = !1, J && J(c.current), s();
60
- }, [J]), wr = R(function(w) {
61
- var D = f.current;
62
- if (D) {
63
- var C = (typeof D == "function" ? D() : D) || document.body, P = typeof V == "function" ? V(C) : V;
64
- if (P) {
65
- var Te = typeof P == "object" ? P : void 0;
66
- f.current = null, w ? Promise.resolve().then(function() {
67
- return C.focus(Te);
68
- }) : C.focus(Te);
57
+ c.current && Q && Q(c.current), v.current = !0, s();
58
+ }, [Q]), Er = W(function() {
59
+ v.current = !1, Z && Z(c.current), s();
60
+ }, [Z]), wr = W(function(I) {
61
+ var C = f.current;
62
+ if (C) {
63
+ var M = (typeof C == "function" ? C() : C) || document.body, T = typeof $ == "function" ? $(M) : $;
64
+ if (T) {
65
+ var De = typeof T == "object" ? T : void 0;
66
+ f.current = null, I ? Promise.resolve().then(function() {
67
+ return M.focus(De);
68
+ }) : M.focus(De);
69
69
  }
70
70
  }
71
- }, [V]), Ir = R(function(w) {
72
- v.current && Ge.useMedium(w);
73
- }, []), Nr = He.useMedium, Sr = R(function(w) {
74
- c.current !== w && (c.current = w, i(w));
71
+ }, [$]), Ir = W(function(I) {
72
+ v.current && je.useMedium(I);
73
+ }, []), Sr = Ve.useMedium, Nr = W(function(I) {
74
+ c.current !== I && (c.current = I, i(I));
75
75
  }, []);
76
- process.env.NODE_ENV !== "production" && (typeof lr < "u" && console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"), Wr(function() {
77
- !c.current && typeof Ie != "string" && console.error("FocusLock: could not obtain ref to internal node");
76
+ process.env.NODE_ENV !== "production" && (typeof q < "u" && console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"), Wr(function() {
77
+ !c.current && typeof Ne != "string" && console.error("FocusLock: could not obtain ref to internal node");
78
78
  }, []));
79
- var Pr = B((t = {}, t[Ue] = d && "disabled", t[ue] = vr, t), yr), Pe = F !== !0, Tr = Pe && F !== "tail", Ar = jr([n, Sr]), Dr = Br(function() {
79
+ var Tr = U((t = {}, t[He] = d && "disabled", t[ie] = z, t), yr), Ae = F !== !0, Pr = Ae && F !== "tail", Ar = jr([n, Nr]), Dr = Br(function() {
80
80
  return {
81
81
  observed: c,
82
- shards: Y,
82
+ shards: J,
83
83
  enabled: !d,
84
84
  active: v.current
85
85
  };
86
- }, [d, v.current, Y, u]);
87
- return /* @__PURE__ */ I.createElement(Ur, null, Pe && [
88
- /* @__PURE__ */ I.createElement("div", {
86
+ }, [d, v.current, J, u]);
87
+ return /* @__PURE__ */ S.createElement(Ur, null, Ae && [
88
+ /* @__PURE__ */ S.createElement("div", {
89
89
  key: "guard-first",
90
90
  "data-focus-guard": !0,
91
91
  tabIndex: d ? -1 : 0,
92
- style: re
92
+ style: te
93
93
  }),
94
- br ? /* @__PURE__ */ I.createElement("div", {
94
+ br ? /* @__PURE__ */ S.createElement("div", {
95
95
  key: "guard-nearest",
96
96
  "data-focus-guard": !0,
97
97
  tabIndex: d ? -1 : 1,
98
- style: re
98
+ style: te
99
99
  }) : null
100
- ], !d && /* @__PURE__ */ I.createElement(hr, {
101
- id: Er,
100
+ ], !d && /* @__PURE__ */ S.createElement(hr, {
101
+ id: xr,
102
102
  sideCar: en,
103
103
  observed: u,
104
104
  disabled: d,
105
105
  persistentFocus: y,
106
- crossFrame: x,
107
- autoFocus: X,
106
+ crossFrame: O,
107
+ autoFocus: D,
108
108
  whiteList: pr,
109
- shards: Y,
109
+ shards: J,
110
110
  onActivation: Or,
111
- onDeactivation: xr,
111
+ onDeactivation: Er,
112
112
  returnFocus: wr,
113
- focusOptions: gr,
113
+ focusOptions: Fr,
114
114
  noFocusGuards: F
115
- }), /* @__PURE__ */ I.createElement(Ie, B({
115
+ }), /* @__PURE__ */ S.createElement(Ne, U({
116
116
  ref: Ar
117
- }, Pr, {
117
+ }, Tr, {
118
118
  className: mr,
119
- onBlur: Nr,
119
+ onBlur: Sr,
120
120
  onFocus: Ir
121
- }), /* @__PURE__ */ I.createElement(rn.Provider, {
121
+ }), /* @__PURE__ */ S.createElement(rn.Provider, {
122
122
  value: Dr
123
- }, a)), Tr && /* @__PURE__ */ I.createElement("div", {
123
+ }, a)), Pr && /* @__PURE__ */ S.createElement("div", {
124
124
  "data-focus-guard": !0,
125
125
  tabIndex: d ? -1 : 0,
126
- style: re
126
+ style: te
127
127
  }));
128
128
  });
129
- de.propTypes = process.env.NODE_ENV !== "production" ? {
129
+ ve.propTypes = process.env.NODE_ENV !== "production" ? {
130
130
  children: l.node,
131
131
  disabled: l.bool,
132
132
  returnFocus: l.oneOfType([l.bool, l.object, l.func]),
@@ -147,35 +147,35 @@ de.propTypes = process.env.NODE_ENV !== "production" ? {
147
147
  onDeactivation: l.func,
148
148
  sideCar: l.any.isRequired
149
149
  } : {};
150
- function ae(e, r) {
151
- return ae = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, t) {
150
+ function ce(e, r) {
151
+ return ce = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, t) {
152
152
  return n.__proto__ = t, n;
153
- }, ae(e, r);
153
+ }, ce(e, r);
154
154
  }
155
155
  function tn(e, r) {
156
- e.prototype = Object.create(r.prototype), e.prototype.constructor = e, ae(e, r);
156
+ e.prototype = Object.create(r.prototype), e.prototype.constructor = e, ce(e, r);
157
157
  }
158
- function U(e) {
158
+ function G(e) {
159
159
  "@babel/helpers - typeof";
160
- return U = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
160
+ return G = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
161
161
  return typeof r;
162
162
  } : function(r) {
163
163
  return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
164
- }, U(e);
164
+ }, G(e);
165
165
  }
166
166
  function on(e, r) {
167
- if (U(e) != "object" || !e) return e;
167
+ if (G(e) != "object" || !e) return e;
168
168
  var n = e[Symbol.toPrimitive];
169
169
  if (n !== void 0) {
170
- var t = n.call(e, r || "default");
171
- if (U(t) != "object") return t;
170
+ var t = n.call(e, r);
171
+ if (G(t) != "object") return t;
172
172
  throw new TypeError("@@toPrimitive must return a primitive value.");
173
173
  }
174
174
  return (r === "string" ? String : Number)(e);
175
175
  }
176
176
  function un(e) {
177
177
  var r = on(e, "string");
178
- return U(r) == "symbol" ? r : r + "";
178
+ return G(r) == "symbol" ? r : r + "";
179
179
  }
180
180
  function an(e, r, n) {
181
181
  return (r = un(r)) in e ? Object.defineProperty(e, r, {
@@ -218,71 +218,71 @@ function cn(e, r) {
218
218
  }, s.componentDidUpdate = function() {
219
219
  c();
220
220
  }, s.componentWillUnmount = function() {
221
- var m = u.indexOf(this);
222
- u.splice(m, 1), c();
221
+ var p = u.indexOf(this);
222
+ u.splice(p, 1), c();
223
223
  }, s.render = function() {
224
- return /* @__PURE__ */ I.createElement(o, this.props);
224
+ return /* @__PURE__ */ S.createElement(o, this.props);
225
225
  }, b;
226
226
  }(Gr);
227
227
  return an(v, "displayName", "SideEffect(" + n(o) + ")"), v;
228
228
  };
229
229
  }
230
- var O = function(e) {
230
+ var E = function(e) {
231
231
  for (var r = Array(e.length), n = 0; n < e.length; ++n)
232
232
  r[n] = e[n];
233
233
  return r;
234
234
  }, A = function(e) {
235
235
  return Array.isArray(e) ? e : [e];
236
- }, je = function(e) {
236
+ }, qe = function(e) {
237
237
  return Array.isArray(e) ? e[0] : e;
238
238
  }, fn = function(e) {
239
239
  if (e.nodeType !== Node.ELEMENT_NODE)
240
240
  return !1;
241
241
  var r = window.getComputedStyle(e, null);
242
242
  return !r || !r.getPropertyValue ? !1 : r.getPropertyValue("display") === "none" || r.getPropertyValue("visibility") === "hidden";
243
- }, Ve = function(e) {
243
+ }, $e = function(e) {
244
244
  return e.parentNode && e.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? (
245
245
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
246
246
  e.parentNode.host
247
247
  ) : e.parentNode;
248
- }, qe = function(e) {
248
+ }, Ke = function(e) {
249
249
  return e === document || e && e.nodeType === Node.DOCUMENT_NODE;
250
250
  }, sn = function(e) {
251
251
  return e.hasAttribute("inert");
252
252
  }, dn = function(e, r) {
253
- return !e || qe(e) || !fn(e) && !sn(e) && r(Ve(e));
254
- }, $e = function(e, r) {
253
+ return !e || Ke(e) || !fn(e) && !sn(e) && r($e(e));
254
+ }, Xe = function(e, r) {
255
255
  var n = e.get(r);
256
256
  if (n !== void 0)
257
257
  return n;
258
- var t = dn(r, $e.bind(void 0, e));
258
+ var t = dn(r, Xe.bind(void 0, e));
259
259
  return e.set(r, t), t;
260
260
  }, ln = function(e, r) {
261
- return e && !qe(e) ? pn(e) ? r(Ve(e)) : !1 : !0;
262
- }, Ke = function(e, r) {
261
+ return e && !Ke(e) ? pn(e) ? r($e(e)) : !1 : !0;
262
+ }, Ye = function(e, r) {
263
263
  var n = e.get(r);
264
264
  if (n !== void 0)
265
265
  return n;
266
- var t = ln(r, Ke.bind(void 0, e));
266
+ var t = ln(r, Ye.bind(void 0, e));
267
267
  return e.set(r, t), t;
268
- }, Xe = function(e) {
268
+ }, ze = function(e) {
269
269
  return e.dataset;
270
270
  }, vn = function(e) {
271
271
  return e.tagName === "BUTTON";
272
- }, Ye = function(e) {
272
+ }, Je = function(e) {
273
273
  return e.tagName === "INPUT";
274
- }, ze = function(e) {
275
- return Ye(e) && e.type === "radio";
274
+ }, Qe = function(e) {
275
+ return Je(e) && e.type === "radio";
276
276
  }, mn = function(e) {
277
- return !((Ye(e) || vn(e)) && (e.type === "hidden" || e.disabled));
277
+ return !((Je(e) || vn(e)) && (e.type === "hidden" || e.disabled));
278
278
  }, pn = function(e) {
279
279
  var r = e.getAttribute(Qr);
280
280
  return ![!0, "true", ""].includes(r);
281
- }, le = function(e) {
281
+ }, me = function(e) {
282
282
  var r;
283
- return !!(e && (!((r = Xe(e)) === null || r === void 0) && r.focusGuard));
284
- }, ie = function(e) {
285
- return !le(e);
283
+ return !!(e && (!((r = ze(e)) === null || r === void 0) && r.focusGuard));
284
+ }, fe = function(e) {
285
+ return !me(e);
286
286
  }, bn = function(e) {
287
287
  return !!e;
288
288
  }, yn = function(e, r) {
@@ -296,8 +296,8 @@ var O = function(e) {
296
296
  return o || u;
297
297
  }, hn = function(e) {
298
298
  return e.tabIndex < 0 && !e.hasAttribute("tabindex") ? 0 : e.tabIndex;
299
- }, ve = function(e, r, n) {
300
- return O(e).map(function(t, o) {
299
+ }, pe = function(e, r, n) {
300
+ return E(e).map(function(t, o) {
301
301
  var u = hn(t);
302
302
  return {
303
303
  node: t,
@@ -307,7 +307,7 @@ var O = function(e) {
307
307
  }).filter(function(t) {
308
308
  return !r || t.tabIndex >= 0;
309
309
  }).sort(yn);
310
- }, gn = [
310
+ }, Fn = [
311
311
  "button:enabled",
312
312
  "select:enabled",
313
313
  "textarea:enabled",
@@ -325,58 +325,58 @@ var O = function(e) {
325
325
  "[tabindex]",
326
326
  "[contenteditable]",
327
327
  "[autofocus]"
328
- ], me = gn.join(","), Fn = "".concat(me, ", [data-focus-guard]"), Je = function(e, r) {
329
- return O((e.shadowRoot || e).children).reduce(function(n, t) {
330
- return n.concat(t.matches(r ? Fn : me) ? [t] : [], Je(t));
328
+ ], be = Fn.join(","), gn = "".concat(be, ", [data-focus-guard]"), Ze = function(e, r) {
329
+ return E((e.shadowRoot || e).children).reduce(function(n, t) {
330
+ return n.concat(t.matches(r ? gn : be) ? [t] : [], Ze(t));
331
331
  }, []);
332
- }, En = function(e, r) {
332
+ }, xn = function(e, r) {
333
333
  var n;
334
- return e instanceof HTMLIFrameElement && (!((n = e.contentDocument) === null || n === void 0) && n.body) ? L([e.contentDocument.body], r) : [e];
335
- }, L = function(e, r) {
334
+ return e instanceof HTMLIFrameElement && (!((n = e.contentDocument) === null || n === void 0) && n.body) ? R([e.contentDocument.body], r) : [e];
335
+ }, R = function(e, r) {
336
336
  return e.reduce(function(n, t) {
337
- var o, u = Je(t, r), i = (o = []).concat.apply(o, u.map(function(c) {
338
- return En(c, r);
337
+ var o, u = Ze(t, r), i = (o = []).concat.apply(o, u.map(function(c) {
338
+ return xn(c, r);
339
339
  }));
340
340
  return n.concat(
341
341
  // add all tabbables inside and within shadow DOMs in DOM order
342
342
  i,
343
343
  // add if node is tabbable itself
344
- t.parentNode ? O(t.parentNode.querySelectorAll(me)).filter(function(c) {
344
+ t.parentNode ? E(t.parentNode.querySelectorAll(be)).filter(function(c) {
345
345
  return c === t;
346
346
  }) : []
347
347
  );
348
348
  }, []);
349
349
  }, On = function(e) {
350
350
  var r = e.querySelectorAll("[".concat(Jr, "]"));
351
- return O(r).map(function(n) {
352
- return L([n]);
351
+ return E(r).map(function(n) {
352
+ return R([n]);
353
353
  }).reduce(function(n, t) {
354
354
  return n.concat(t);
355
355
  }, []);
356
- }, pe = function(e, r) {
357
- return O(e).filter(function(n) {
358
- return $e(r, n);
356
+ }, ye = function(e, r) {
357
+ return E(e).filter(function(n) {
358
+ return Xe(r, n);
359
359
  }).filter(function(n) {
360
360
  return mn(n);
361
361
  });
362
- }, De = function(e, r) {
363
- return r === void 0 && (r = /* @__PURE__ */ new Map()), O(e).filter(function(n) {
364
- return Ke(r, n);
362
+ }, Me = function(e, r) {
363
+ return r === void 0 && (r = /* @__PURE__ */ new Map()), E(e).filter(function(n) {
364
+ return Ye(r, n);
365
365
  });
366
- }, be = function(e, r, n) {
367
- return ve(pe(L(e, n), r), !0, n);
368
- }, G = function(e, r) {
369
- return ve(pe(L(e), r), !1);
370
- }, xn = function(e, r) {
371
- return pe(On(e), r);
372
- }, T = function(e, r) {
373
- return e.shadowRoot ? T(e.shadowRoot, r) : Object.getPrototypeOf(e).contains !== void 0 && Object.getPrototypeOf(e).contains.call(e, r) ? !0 : O(e.children).some(function(n) {
366
+ }, he = function(e, r, n) {
367
+ return pe(ye(R(e, n), r), !0, n);
368
+ }, H = function(e, r) {
369
+ return pe(ye(R(e), r), !1);
370
+ }, En = function(e, r) {
371
+ return ye(On(e), r);
372
+ }, P = function(e, r) {
373
+ return e.shadowRoot ? P(e.shadowRoot, r) : Object.getPrototypeOf(e).contains !== void 0 && Object.getPrototypeOf(e).contains.call(e, r) ? !0 : E(e.children).some(function(n) {
374
374
  var t;
375
375
  if (n instanceof HTMLIFrameElement) {
376
376
  var o = (t = n.contentDocument) === null || t === void 0 ? void 0 : t.body;
377
- return o ? T(o, r) : !1;
377
+ return o ? P(o, r) : !1;
378
378
  }
379
- return T(n, r);
379
+ return P(n, r);
380
380
  });
381
381
  }, wn = function(e) {
382
382
  for (var r = /* @__PURE__ */ new Set(), n = e.length, t = 0; t < n; t += 1)
@@ -387,13 +387,13 @@ var O = function(e) {
387
387
  return e.filter(function(i, c) {
388
388
  return !r.has(c);
389
389
  });
390
- }, Qe = function(e) {
391
- return e.parentNode ? Qe(e.parentNode) : e;
392
- }, ye = function(e) {
390
+ }, er = function(e) {
391
+ return e.parentNode ? er(e.parentNode) : e;
392
+ }, Fe = function(e) {
393
393
  var r = A(e);
394
394
  return r.filter(Boolean).reduce(function(n, t) {
395
- var o = t.getAttribute(ue);
396
- return n.push.apply(n, o ? wn(O(Qe(t).querySelectorAll("[".concat(ue, '="').concat(o, '"]:not([').concat(Ue, '="disabled"])')))) : [t]), n;
395
+ var o = t.getAttribute(ie);
396
+ return n.push.apply(n, o ? wn(E(er(t).querySelectorAll("[".concat(ie, '="').concat(o, '"]:not([').concat(He, '="disabled"])')))) : [t]), n;
397
397
  }, []);
398
398
  }, In = function(e) {
399
399
  try {
@@ -401,76 +401,84 @@ var O = function(e) {
401
401
  } catch {
402
402
  return;
403
403
  }
404
- }, H = function(e) {
404
+ }, j = function(e) {
405
405
  if (e === void 0 && (e = document), !(!e || !e.activeElement)) {
406
406
  var r = e.activeElement;
407
- return r.shadowRoot ? H(r.shadowRoot) : r instanceof HTMLIFrameElement && In(function() {
407
+ return r.shadowRoot ? j(r.shadowRoot) : r instanceof HTMLIFrameElement && In(function() {
408
408
  return r.contentWindow.document;
409
- }) ? H(r.contentWindow.document) : r;
409
+ }) ? j(r.contentWindow.document) : r;
410
410
  }
411
- }, Nn = function(e, r) {
412
- return e === r;
413
411
  }, Sn = function(e, r) {
414
- return !!O(e.querySelectorAll("iframe")).some(function(n) {
415
- return Nn(n, r);
412
+ return e === r;
413
+ }, Nn = function(e, r) {
414
+ return !!E(e.querySelectorAll("iframe")).some(function(n) {
415
+ return Sn(n, r);
416
416
  });
417
- }, Ze = function(e, r) {
418
- return r === void 0 && (r = H(je(e).ownerDocument)), !r || r.dataset && r.dataset.focusGuard ? !1 : ye(e).some(function(n) {
419
- return T(n, r) || Sn(n, r);
417
+ }, rr = function(e, r) {
418
+ return r === void 0 && (r = j(qe(e).ownerDocument)), !r || r.dataset && r.dataset.focusGuard ? !1 : Fe(e).some(function(n) {
419
+ return P(n, r) || Nn(n, r);
420
420
  });
421
- }, Pn = function(e) {
421
+ }, Tn = function(e) {
422
422
  e === void 0 && (e = document);
423
- var r = H(e);
424
- return r ? O(e.querySelectorAll("[".concat(zr, "]"))).some(function(n) {
425
- return T(n, r);
423
+ var r = j(e);
424
+ return r ? E(e.querySelectorAll("[".concat(zr, "]"))).some(function(n) {
425
+ return P(n, r);
426
426
  }) : !1;
427
- }, Tn = function(e, r) {
428
- return r.filter(ze).filter(function(n) {
427
+ }, Pn = function(e, r) {
428
+ return r.filter(Qe).filter(function(n) {
429
429
  return n.name === e.name;
430
430
  }).filter(function(n) {
431
431
  return n.checked;
432
432
  })[0] || e;
433
- }, he = function(e, r) {
434
- return ze(e) && e.name ? Tn(e, r) : e;
433
+ }, ge = function(e, r) {
434
+ return Qe(e) && e.name ? Pn(e, r) : e;
435
435
  }, An = function(e) {
436
436
  var r = /* @__PURE__ */ new Set();
437
437
  return e.forEach(function(n) {
438
- return r.add(he(n, e));
438
+ return r.add(ge(n, e));
439
439
  }), e.filter(function(n) {
440
440
  return r.has(n);
441
441
  });
442
- }, Ce = function(e) {
443
- return e[0] && e.length > 1 ? he(e[0], e) : e[0];
444
- }, Me = function(e, r) {
445
- return e.indexOf(he(r, e));
446
- }, ce = "NEW_FOCUS", Dn = function(e, r, n, t, o) {
447
- var u = e.length, i = e[0], c = e[u - 1], v = le(t);
442
+ }, _e = function(e) {
443
+ return e[0] && e.length > 1 ? ge(e[0], e) : e[0];
444
+ }, ke = function(e, r) {
445
+ return e.indexOf(ge(r, e));
446
+ }, se = "NEW_FOCUS", Dn = function(e, r, n, t, o) {
447
+ var u = e.length, i = e[0], c = e[u - 1], v = me(t);
448
448
  if (!(t && e.indexOf(t) >= 0)) {
449
449
  var f = t !== void 0 ? n.indexOf(t) : -1, b = o ? n.indexOf(o) : f, s = o ? e.indexOf(o) : -1;
450
450
  if (f === -1)
451
- return s !== -1 ? s : ce;
451
+ return s !== -1 ? s : se;
452
452
  if (s === -1)
453
- return ce;
454
- var a = f - b, m = n.indexOf(i), d = n.indexOf(c), p = An(n), F = t !== void 0 ? p.indexOf(t) : -1, E = F - (o ? p.indexOf(o) : f);
453
+ return se;
454
+ var a = f - b, p = n.indexOf(i), d = n.indexOf(c), m = An(n), F = t !== void 0 ? m.indexOf(t) : -1, x = o ? m.indexOf(o) : F, y = m.filter(function(z) {
455
+ return z.tabIndex >= 0;
456
+ }), h = t !== void 0 ? y.indexOf(t) : -1, O = o ? y.indexOf(o) : h, w = h >= 0 && O >= 0 ? (
457
+ // old/new are tabbables, measure distance in tabbable space
458
+ O - h
459
+ ) : (
460
+ // or else measure in focusable space
461
+ x - F
462
+ );
455
463
  if (!a && s >= 0 || r.length === 0)
456
464
  return s;
457
- var y = Me(e, r[0]), h = Me(e, r[r.length - 1]);
458
- if (f <= m && v && Math.abs(a) > 1)
459
- return h;
465
+ var D = ke(e, r[0]), q = ke(e, r[r.length - 1]);
466
+ if (f <= p && v && Math.abs(a) > 1)
467
+ return q;
460
468
  if (f >= d && v && Math.abs(a) > 1)
461
- return y;
462
- if (a && Math.abs(E) > 1)
469
+ return D;
470
+ if (a && Math.abs(w) > 1)
463
471
  return s;
464
- if (f <= m)
465
- return h;
472
+ if (f <= p)
473
+ return q;
466
474
  if (f > d)
467
- return y;
475
+ return D;
468
476
  if (a)
469
477
  return Math.abs(a) > 1 ? s : (u + s + a) % u;
470
478
  }
471
479
  }, Cn = function(e) {
472
480
  return function(r) {
473
- var n, t = (n = Xe(r)) === null || n === void 0 ? void 0 : n.autofocus;
481
+ var n, t = (n = ze(r)) === null || n === void 0 ? void 0 : n.autofocus;
474
482
  return (
475
483
  // @ts-expect-error
476
484
  r.autofocus || //
@@ -478,32 +486,32 @@ var O = function(e) {
478
486
  e.indexOf(r) >= 0
479
487
  );
480
488
  };
481
- }, _e = function(e, r, n) {
489
+ }, Le = function(e, r, n) {
482
490
  var t = e.map(function(u) {
483
491
  var i = u.node;
484
492
  return i;
485
- }), o = De(t.filter(Cn(n)));
486
- return o && o.length ? Ce(o) : Ce(De(r));
487
- }, fe = function(e, r) {
488
- return r === void 0 && (r = []), r.push(e), e.parentNode && fe(e.parentNode.host || e.parentNode, r), r;
489
- }, ne = function(e, r) {
490
- for (var n = fe(e), t = fe(r), o = 0; o < n.length; o += 1) {
493
+ }), o = Me(t.filter(Cn(n)));
494
+ return o && o.length ? _e(o) : _e(Me(r));
495
+ }, de = function(e, r) {
496
+ return r === void 0 && (r = []), r.push(e), e.parentNode && de(e.parentNode.host || e.parentNode, r), r;
497
+ }, oe = function(e, r) {
498
+ for (var n = de(e), t = de(r), o = 0; o < n.length; o += 1) {
491
499
  var u = n[o];
492
500
  if (t.indexOf(u) >= 0)
493
501
  return u;
494
502
  }
495
503
  return !1;
496
- }, er = function(e, r, n) {
504
+ }, nr = function(e, r, n) {
497
505
  var t = A(e), o = A(r), u = t[0], i = !1;
498
506
  return o.filter(Boolean).forEach(function(c) {
499
- i = ne(i || c, c) || i, n.filter(Boolean).forEach(function(v) {
500
- var f = ne(u, v);
501
- f && (!i || T(f, i) ? i = f : i = ne(f, i));
507
+ i = oe(i || c, c) || i, n.filter(Boolean).forEach(function(v) {
508
+ var f = oe(u, v);
509
+ f && (!i || P(f, i) ? i = f : i = oe(f, i));
502
510
  });
503
511
  }), i;
504
- }, ke = function(e, r) {
512
+ }, Re = function(e, r) {
505
513
  return e.reduce(function(n, t) {
506
- return n.concat(xn(t, r));
514
+ return n.concat(En(t, r));
507
515
  }, []);
508
516
  }, Mn = function(e, r) {
509
517
  var n = /* @__PURE__ */ new Map();
@@ -513,63 +521,63 @@ var O = function(e) {
513
521
  return n.get(t);
514
522
  }).filter(bn);
515
523
  }, _n = function(e, r) {
516
- var n = H(A(e).length > 0 ? document : je(e).ownerDocument), t = ye(e).filter(ie), o = er(n || e, e, t), u = /* @__PURE__ */ new Map(), i = G(t, u), c = i.filter(function(d) {
517
- var p = d.node;
518
- return ie(p);
524
+ var n = j(A(e).length > 0 ? document : qe(e).ownerDocument), t = Fe(e).filter(fe), o = nr(n || e, e, t), u = /* @__PURE__ */ new Map(), i = H(t, u), c = i.filter(function(d) {
525
+ var m = d.node;
526
+ return fe(m);
519
527
  });
520
528
  if (c[0]) {
521
- var v = G([o], u).map(function(d) {
522
- var p = d.node;
523
- return p;
529
+ var v = H([o], u).map(function(d) {
530
+ var m = d.node;
531
+ return m;
524
532
  }), f = Mn(v, c), b = f.map(function(d) {
525
- var p = d.node;
526
- return p;
533
+ var m = d.node;
534
+ return m;
527
535
  }), s = f.filter(function(d) {
528
- var p = d.tabIndex;
529
- return p >= 0;
536
+ var m = d.tabIndex;
537
+ return m >= 0;
530
538
  }).map(function(d) {
531
- var p = d.node;
532
- return p;
539
+ var m = d.node;
540
+ return m;
533
541
  }), a = Dn(b, s, v, n, r);
534
- if (a === ce) {
535
- var m = (
542
+ if (a === se) {
543
+ var p = (
536
544
  // first try only tabbable, and the fallback to all focusable, as long as at least one element should be picked for focus
537
- _e(i, s, ke(t, u)) || _e(i, b, ke(t, u))
545
+ Le(i, s, Re(t, u)) || Le(i, b, Re(t, u))
538
546
  );
539
- if (m)
540
- return { node: m };
547
+ if (p)
548
+ return { node: p };
541
549
  console.warn("focus-lock: cannot find any node to move focus into");
542
550
  return;
543
551
  }
544
552
  return a === void 0 ? a : f[a];
545
553
  }
546
554
  }, kn = function(e) {
547
- var r = ye(e).filter(ie), n = er(e, e, r), t = ve(L([n], !0), !0, !0), o = L(r, !1);
555
+ var r = Fe(e).filter(fe), n = nr(e, e, r), t = pe(R([n], !0), !0, !0), o = R(r, !1);
548
556
  return t.map(function(u) {
549
557
  var i = u.node, c = u.index;
550
558
  return {
551
559
  node: i,
552
560
  index: c,
553
561
  lockItem: o.indexOf(i) >= 0,
554
- guard: le(i)
562
+ guard: me(i)
555
563
  };
556
564
  });
557
- }, ge = function(e, r) {
565
+ }, xe = function(e, r) {
558
566
  e && ("focus" in e && e.focus(r), "contentWindow" in e && e.contentWindow && e.contentWindow.focus());
559
- }, te = 0, oe = !1, rr = function(e, r, n) {
567
+ }, ue = 0, ae = !1, tr = function(e, r, n) {
560
568
  n === void 0 && (n = {});
561
569
  var t = _n(e, r);
562
- if (!oe && t) {
563
- if (te > 2) {
564
- console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"), oe = !0, setTimeout(function() {
565
- oe = !1;
570
+ if (!ae && t) {
571
+ if (ue > 2) {
572
+ console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"), ae = !0, setTimeout(function() {
573
+ ae = !1;
566
574
  }, 1);
567
575
  return;
568
576
  }
569
- te++, ge(t.node, n.focusOptions), te--;
577
+ ue++, xe(t.node, n.focusOptions), ue--;
570
578
  }
571
579
  };
572
- function W(e) {
580
+ function B(e) {
573
581
  if (!e)
574
582
  return null;
575
583
  if (typeof WeakRef > "u")
@@ -586,13 +594,13 @@ var Ln = function(e) {
586
594
  return null;
587
595
  for (var r = [], n = e; n && n !== document.body; )
588
596
  r.push({
589
- current: W(n),
590
- parent: W(n.parentElement),
591
- left: W(n.previousElementSibling),
592
- right: W(n.nextElementSibling)
597
+ current: B(n),
598
+ parent: B(n.parentElement),
599
+ left: B(n.previousElementSibling),
600
+ right: B(n.nextElementSibling)
593
601
  }), n = n.parentElement;
594
602
  return {
595
- element: W(e),
603
+ element: B(e),
596
604
  stack: r,
597
605
  ownerDocument: e.ownerDocument
598
606
  };
@@ -602,29 +610,29 @@ var Ln = function(e) {
602
610
  for (var i = e.stack, c = e.ownerDocument, v = /* @__PURE__ */ new Map(), f = 0, b = i; f < b.length; f++) {
603
611
  var s = b[f], a = (r = s.parent) === null || r === void 0 ? void 0 : r.call(s);
604
612
  if (a && c.contains(a)) {
605
- for (var m = (n = s.left) === null || n === void 0 ? void 0 : n.call(s), d = s.current(), p = a.contains(d) ? d : void 0, F = (t = s.right) === null || t === void 0 ? void 0 : t.call(s), E = be([a], v), y = (
613
+ for (var p = (n = s.left) === null || n === void 0 ? void 0 : n.call(s), d = s.current(), m = a.contains(d) ? d : void 0, F = (t = s.right) === null || t === void 0 ? void 0 : t.call(s), x = he([a], v), y = (
606
614
  // that is element itself
607
- (u = (o = p ?? // or something in it's place
608
- (m == null ? void 0 : m.nextElementSibling)) !== null && o !== void 0 ? o : (
615
+ (u = (o = m ?? // or something in it's place
616
+ (p == null ? void 0 : p.nextElementSibling)) !== null && o !== void 0 ? o : (
609
617
  // or somebody to the right, still close enough
610
618
  F
611
619
  )) !== null && u !== void 0 ? u : (
612
620
  // or somebody to the left, something?
613
- m
621
+ p
614
622
  )
615
623
  ); y; ) {
616
- for (var h = 0, x = E; h < x.length; h++) {
617
- var S = x[h];
618
- if (y != null && y.contains(S.node))
619
- return S.node;
624
+ for (var h = 0, O = x; h < O.length; h++) {
625
+ var w = O[h];
626
+ if (y != null && y.contains(w.node))
627
+ return w.node;
620
628
  }
621
629
  y = y.nextElementSibling;
622
630
  }
623
- if (E.length)
624
- return E[0].node;
631
+ if (x.length)
632
+ return x[0].node;
625
633
  }
626
634
  }
627
- }, nr = function(e) {
635
+ }, or = function(e) {
628
636
  var r = Ln(e);
629
637
  return function() {
630
638
  return Rn(r);
@@ -634,10 +642,10 @@ var Ln = function(e) {
634
642
  return console.error("no element or scope given"), {};
635
643
  var t = A(r);
636
644
  if (t.every(function(i) {
637
- return !T(i, e);
645
+ return !P(i, e);
638
646
  }))
639
647
  return console.error("Active element is not contained in the scope"), {};
640
- var o = n ? be(t, /* @__PURE__ */ new Map()) : G(t, /* @__PURE__ */ new Map()), u = o.findIndex(function(i) {
648
+ var o = n ? he(t, /* @__PURE__ */ new Map()) : H(t, /* @__PURE__ */ new Map()), u = o.findIndex(function(i) {
641
649
  var c = i.node;
642
650
  return c === e;
643
651
  });
@@ -649,7 +657,7 @@ var Ln = function(e) {
649
657
  last: o[o.length - 1]
650
658
  };
651
659
  }, Bn = function(e, r) {
652
- var n = r ? be(A(e), /* @__PURE__ */ new Map()) : G(A(e), /* @__PURE__ */ new Map());
660
+ var n = r ? he(A(e), /* @__PURE__ */ new Map()) : H(A(e), /* @__PURE__ */ new Map());
653
661
  return {
654
662
  first: n[0],
655
663
  last: n[n.length - 1]
@@ -660,55 +668,55 @@ var Ln = function(e) {
660
668
  cycle: !0,
661
669
  onlyTabbable: !0
662
670
  }, e);
663
- }, tr = function(e, r, n) {
671
+ }, ur = function(e, r, n) {
664
672
  r === void 0 && (r = {});
665
673
  var t = Un(r), o = Wn(e, t.scope, t.onlyTabbable);
666
674
  if (o) {
667
675
  var u = n(o, t.cycle);
668
- u && ge(u.node, t.focusOptions);
676
+ u && xe(u.node, t.focusOptions);
669
677
  }
670
678
  }, Gn = function(e, r) {
671
- r === void 0 && (r = {}), tr(e, r, function(n, t) {
679
+ r === void 0 && (r = {}), ur(e, r, function(n, t) {
672
680
  var o = n.next, u = n.first;
673
681
  return o || t && u;
674
682
  });
675
683
  }, Hn = function(e, r) {
676
- r === void 0 && (r = {}), tr(e, r, function(n, t) {
684
+ r === void 0 && (r = {}), ur(e, r, function(n, t) {
677
685
  var o = n.prev, u = n.last;
678
686
  return o || t && u;
679
687
  });
680
- }, or = function(e, r, n) {
688
+ }, ar = function(e, r, n) {
681
689
  var t, o = Bn(e, (t = r.onlyTabbable) !== null && t !== void 0 ? t : !0), u = o[n];
682
- u && ge(u.node, r.focusOptions);
690
+ u && xe(u.node, r.focusOptions);
683
691
  }, jn = function(e, r) {
684
- r === void 0 && (r = {}), or(e, r, "first");
692
+ r === void 0 && (r = {}), ar(e, r, "first");
685
693
  }, Vn = function(e, r) {
686
- r === void 0 && (r = {}), or(e, r, "last");
694
+ r === void 0 && (r = {}), ar(e, r, "last");
687
695
  };
688
- function Fe(e) {
696
+ function Oe(e) {
689
697
  setTimeout(e, 1);
690
698
  }
691
699
  var qn = function(r) {
692
700
  return r && "current" in r ? r.current : r;
693
- }, ur = function() {
701
+ }, ir = function() {
694
702
  return document && document.activeElement === document.body;
695
703
  }, $n = function() {
696
- return ur() || Pn();
697
- }, _ = null, g = null, Le = function() {
704
+ return ir() || Tn();
705
+ }, k = null, g = null, We = function() {
698
706
  return null;
699
- }, k = null, j = !1, Ee = !1, Kn = function() {
707
+ }, L = null, V = !1, Ee = !1, Kn = function() {
700
708
  return !0;
701
709
  }, Xn = function(r) {
702
- return (_.whiteList || Kn)(r);
710
+ return (k.whiteList || Kn)(r);
703
711
  }, Yn = function(r, n) {
704
- k = {
712
+ L = {
705
713
  observerNode: r,
706
714
  portaledElement: n
707
715
  };
708
716
  }, zn = function(r) {
709
- return k && k.portaledElement === r;
717
+ return L && L.portaledElement === r;
710
718
  };
711
- function Re(e, r, n, t) {
719
+ function Be(e, r, n, t) {
712
720
  var o = null, u = e;
713
721
  do {
714
722
  var i = t[u];
@@ -724,75 +732,75 @@ function Re(e, r, n, t) {
724
732
  o && (o.node.tabIndex = 0);
725
733
  }
726
734
  var Jn = function(r) {
727
- return r ? !!j : j === "meanwhile";
735
+ return r ? !!V : V === "meanwhile";
728
736
  }, Qn = function e(r, n, t) {
729
737
  return n && (n.host === r && (!n.activeElement || t.contains(n.activeElement)) || n.parentNode && e(r, n.parentNode, t));
730
738
  }, Zn = function(r, n) {
731
739
  return n.some(function(t) {
732
740
  return Qn(r, t, t);
733
741
  });
734
- }, ar = function(r) {
735
- return G(r, /* @__PURE__ */ new Map());
742
+ }, cr = function(r) {
743
+ return H(r, /* @__PURE__ */ new Map());
736
744
  }, et = function(r) {
737
- return !ar([r.parentNode]).some(function(n) {
745
+ return !cr([r.parentNode]).some(function(n) {
738
746
  return n.node === r;
739
747
  });
740
- }, K = function() {
748
+ }, Y = function() {
741
749
  var r = !1;
742
- if (_) {
743
- var n = _, t = n.observed, o = n.persistentFocus, u = n.autoFocus, i = n.shards, c = n.crossFrame, v = n.focusOptions, f = n.noFocusGuards, b = t || k && k.portaledElement;
744
- if (ur() && g && g !== document.body && (!document.body.contains(g) || et(g))) {
745
- var s = Le();
750
+ if (k) {
751
+ var n = k, t = n.observed, o = n.persistentFocus, u = n.autoFocus, i = n.shards, c = n.crossFrame, v = n.focusOptions, f = n.noFocusGuards, b = t || L && L.portaledElement;
752
+ if (ir() && g && g !== document.body && (!document.body.contains(g) || et(g))) {
753
+ var s = We();
746
754
  s && s.focus();
747
755
  }
748
756
  var a = document && document.activeElement;
749
757
  if (b) {
750
- var m = [b].concat(i.map(qn).filter(Boolean)), d = function() {
758
+ var p = [b].concat(i.map(qn).filter(Boolean)), d = function() {
751
759
  if (!Jn(c) || !f || !g || Ee)
752
760
  return !1;
753
- var h = ar(m), x = h.findIndex(function(S) {
754
- var X = S.node;
755
- return X === g;
761
+ var h = cr(p), O = h.findIndex(function(w) {
762
+ var D = w.node;
763
+ return D === g;
756
764
  });
757
- return x === 0 || x === h.length - 1;
765
+ return O === 0 || O === h.length - 1;
758
766
  };
759
- if ((!a || Xn(a)) && (o || d() || !$n() || !g && u) && (b && !(Ze(m) || a && Zn(a, m) || zn(a)) && (document && !g && a && !u ? (a.blur && a.blur(), document.body.focus()) : (r = rr(m, g, {
767
+ if ((!a || Xn(a)) && (o || d() || !$n() || !g && u) && (b && !(rr(p) || a && Zn(a, p) || zn(a)) && (document && !g && a && !u ? (a.blur && a.blur(), document.body.focus()) : (r = tr(p, g, {
760
768
  focusOptions: v
761
- }), k = {})), g = document && document.activeElement, g !== document.body && (Le = nr(g)), j = !1), document && a !== document.activeElement && document.querySelector("[data-focus-auto-guard]")) {
762
- var p = document && document.activeElement, F = kn(m), E = F.map(function(y) {
769
+ }), L = {})), g = document && document.activeElement, g !== document.body && (We = or(g)), V = !1), document && a !== document.activeElement && document.querySelector("[data-focus-auto-guard]")) {
770
+ var m = document && document.activeElement, F = kn(p), x = F.map(function(y) {
763
771
  var h = y.node;
764
772
  return h;
765
- }).indexOf(p);
766
- E > -1 && (F.filter(function(y) {
767
- var h = y.guard, x = y.node;
768
- return h && x.dataset.focusAutoGuard;
773
+ }).indexOf(m);
774
+ x > -1 && (F.filter(function(y) {
775
+ var h = y.guard, O = y.node;
776
+ return h && O.dataset.focusAutoGuard;
769
777
  }).forEach(function(y) {
770
778
  var h = y.node;
771
779
  return h.removeAttribute("tabIndex");
772
- }), Re(E, F.length, 1, F), Re(E, -1, -1, F));
780
+ }), Be(x, F.length, 1, F), Be(x, -1, -1, F));
773
781
  }
774
782
  }
775
783
  }
776
784
  return r;
777
- }, ir = function(r) {
778
- K() && r && (r.stopPropagation(), r.preventDefault());
779
- }, Oe = function() {
780
- return Fe(K);
785
+ }, fr = function(r) {
786
+ Y() && r && (r.stopPropagation(), r.preventDefault());
787
+ }, we = function() {
788
+ return Oe(Y);
781
789
  }, rt = function(r) {
782
790
  var n = r.target, t = r.currentTarget;
783
791
  t.contains(n) || Yn(t, n);
784
792
  }, nt = function() {
785
793
  return null;
786
- }, cr = function() {
794
+ }, sr = function() {
787
795
  Ee = !0;
788
- }, fr = function() {
789
- Ee = !1, j = "just", Fe(function() {
790
- j = "meanwhile";
796
+ }, dr = function() {
797
+ Ee = !1, V = "just", Oe(function() {
798
+ V = "meanwhile";
791
799
  });
792
800
  }, tt = function() {
793
- document.addEventListener("focusin", ir), document.addEventListener("focusout", Oe), window.addEventListener("focus", cr), window.addEventListener("blur", fr);
801
+ document.addEventListener("focusin", fr), document.addEventListener("focusout", we), window.addEventListener("focus", sr), window.addEventListener("blur", dr);
794
802
  }, ot = function() {
795
- document.removeEventListener("focusin", ir), document.removeEventListener("focusout", Oe), window.removeEventListener("focus", cr), window.removeEventListener("blur", fr);
803
+ document.removeEventListener("focusin", fr), document.removeEventListener("focusout", we), window.removeEventListener("focus", sr), window.removeEventListener("blur", dr);
796
804
  };
797
805
  function ut(e) {
798
806
  return e.filter(function(r) {
@@ -800,56 +808,56 @@ function ut(e) {
800
808
  return !n;
801
809
  });
802
810
  }
803
- var sr = {
804
- moveFocusInside: rr,
805
- focusInside: Ze,
811
+ var lr = {
812
+ moveFocusInside: tr,
813
+ focusInside: rr,
806
814
  focusNextElement: Gn,
807
815
  focusPrevElement: Hn,
808
816
  focusFirstElement: jn,
809
817
  focusLastElement: Vn,
810
- captureFocusRestore: nr
818
+ captureFocusRestore: or
811
819
  };
812
820
  function at(e) {
813
821
  var r = e.slice(-1)[0];
814
- r && !_ && tt();
815
- var n = _, t = n && r && r.id === n.id;
816
- _ = r, n && !t && (n.onDeactivation(), e.filter(function(o) {
822
+ r && !k && tt();
823
+ var n = k, t = n && r && r.id === n.id;
824
+ k = r, n && !t && (n.onDeactivation(), e.filter(function(o) {
817
825
  var u = o.id;
818
826
  return u === n.id;
819
- }).length || n.returnFocus(!r)), r ? (g = null, (!t || n.observed !== r.observed) && r.onActivation(sr), K(), Fe(K)) : (ot(), g = null);
827
+ }).length || n.returnFocus(!r)), r ? (g = null, (!t || n.observed !== r.observed) && r.onActivation(lr), Y(), Oe(Y)) : (ot(), g = null);
820
828
  }
821
- Ge.assignSyncMedium(rt);
822
- He.assignMedium(Oe);
829
+ je.assignSyncMedium(rt);
830
+ Ve.assignMedium(we);
823
831
  Zr.assignMedium(function(e) {
824
- return e(sr);
832
+ return e(lr);
825
833
  });
826
834
  const it = cn(ut, at)(nt);
827
- var dr = /* @__PURE__ */ We(function(r, n) {
828
- return /* @__PURE__ */ I.createElement(de, B({
835
+ var vr = /* @__PURE__ */ Ue(function(r, n) {
836
+ return /* @__PURE__ */ S.createElement(ve, U({
829
837
  sideCar: it,
830
838
  ref: n
831
839
  }, r));
832
- }), ct = de.propTypes || {}, ft = Yr(ct, ["sideCar"]);
833
- dr.propTypes = process.env.NODE_ENV !== "production" ? ft : {};
840
+ }), ct = ve.propTypes || {}, ft = Yr(ct, ["sideCar"]);
841
+ vr.propTypes = process.env.NODE_ENV !== "production" ? ft : {};
834
842
  const st = ({
835
843
  children: e,
836
844
  theme: r,
837
845
  className: n,
838
846
  buttonCloseClassName: t
839
847
  }) => {
840
- const { content: o, onClose: u, closeBtnRef: i } = Be(), { theme: c } = Xr(), v = q.toArray(e).find(
841
- (a) => $(a) && a.type === N.Header
842
- ), f = q.toArray(e).find(
843
- (a) => $(a) && a.type === N.Body
844
- ), b = q.toArray(e).find(
845
- (a) => $(a) && a.type === N.Footer
846
- ), s = q.toArray(e).filter(
847
- (a) => !$(a) || ![N.Header, N.Body, N.Footer].includes(
848
+ const { content: o, onClose: u, closeBtnRef: i } = Ge(), { theme: c } = Xr(), v = K.toArray(e).find(
849
+ (a) => X(a) && a.type === N.Header
850
+ ), f = K.toArray(e).find(
851
+ (a) => X(a) && a.type === N.Body
852
+ ), b = K.toArray(e).find(
853
+ (a) => X(a) && a.type === N.Footer
854
+ ), s = K.toArray(e).filter(
855
+ (a) => !X(a) || ![N.Header, N.Body, N.Footer].includes(
848
856
  a.type
849
857
  )
850
858
  );
851
- return /* @__PURE__ */ M(dr, { returnFocus: !0, children: /* @__PURE__ */ M(Vr, { children: /* @__PURE__ */ Q("div", { className: "fixed inset-0 grid place-content-center", children: [
852
- /* @__PURE__ */ M(
859
+ return /* @__PURE__ */ _(vr, { returnFocus: !0, children: /* @__PURE__ */ _(Vr, { children: /* @__PURE__ */ ee("div", { className: "fixed inset-0 grid place-content-center", children: [
860
+ /* @__PURE__ */ _(
853
861
  "div",
854
862
  {
855
863
  className: "absolute inset-0 bg-black opacity-75",
@@ -857,11 +865,11 @@ const st = ({
857
865
  role: "presentation"
858
866
  }
859
867
  ),
860
- /* @__PURE__ */ Q(
868
+ /* @__PURE__ */ ee(
861
869
  "div",
862
870
  {
863
- className: Ae(
864
- qr({
871
+ className: Ce(
872
+ $r({
865
873
  className: n,
866
874
  theme: r ?? c
867
875
  })
@@ -870,20 +878,20 @@ const st = ({
870
878
  "aria-modal": "true",
871
879
  children: [
872
880
  v,
873
- /* @__PURE__ */ Q(
881
+ /* @__PURE__ */ ee(
874
882
  "button",
875
883
  {
876
884
  ref: i,
877
- className: Ae(
878
- $r({
885
+ className: Ce(
886
+ qr({
879
887
  className: t,
880
888
  theme: r ?? c
881
889
  })
882
890
  ),
883
891
  onClick: u,
884
892
  children: [
885
- /* @__PURE__ */ M(Kr, {}),
886
- /* @__PURE__ */ M(Lr, { children: "Dismiss modal" })
893
+ /* @__PURE__ */ _(Kr, {}),
894
+ /* @__PURE__ */ _(Lr, { children: "Dismiss modal" })
887
895
  ]
888
896
  }
889
897
  ),
@@ -894,8 +902,8 @@ const st = ({
894
902
  )
895
903
  ] }) }) });
896
904
  }, N = ({ ...e }) => {
897
- const { isOpen: r } = Be();
898
- return r ? kr.createPortal(/* @__PURE__ */ M(st, { ...e }), document.body) : null;
905
+ const { isOpen: r } = Ge();
906
+ return r ? kr.createPortal(/* @__PURE__ */ _(st, { ...e }), document.body) : null;
899
907
  };
900
908
  N.Header = _r;
901
909
  N.Body = Cr;