@owp/core 1.28.0 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/{Close-DnXhM4Ms.js → Close-DnXyQZKh.js} +435 -378
  2. package/dist/Close-DnXyQZKh.js.map +1 -0
  3. package/dist/OwpStoreProvider-Bx5p7ooQ.js +30 -0
  4. package/dist/OwpStoreProvider-Bx5p7ooQ.js.map +1 -0
  5. package/dist/{OwpUtils-9lHSCdan.js → OwpUtils-C81bM1Gz.js} +2 -2
  6. package/dist/OwpUtils-C81bM1Gz.js.map +1 -0
  7. package/dist/{QuickPanel-BOgEYOAw.js → QuickPanel-CO7Tyc8C.js} +2 -2
  8. package/dist/{QuickPanel-BOgEYOAw.js.map → QuickPanel-CO7Tyc8C.js.map} +1 -1
  9. package/dist/colors.js +3 -18
  10. package/dist/colors.js.map +1 -1
  11. package/dist/constants.js +17 -20
  12. package/dist/constants.js.map +1 -1
  13. package/dist/context.js +64 -36
  14. package/dist/context.js.map +1 -1
  15. package/dist/hooks.js +70 -70
  16. package/dist/hooks.js.map +1 -1
  17. package/dist/{index-B8tZAW8i.js → index-KlA5Es4t.js} +11931 -12745
  18. package/dist/index-KlA5Es4t.js.map +1 -0
  19. package/dist/index.js +88 -115
  20. package/dist/{isTypedArray-xp-fB7W4.js → isTypedArray-DPyC49cI.js} +3 -3
  21. package/dist/{isTypedArray-xp-fB7W4.js.map → isTypedArray-DPyC49cI.js.map} +1 -1
  22. package/dist/{lazyLoadedSlices-BAbcXcEU.js → lazyLoadedSlices-DC7yg4GT.js} +885 -845
  23. package/dist/lazyLoadedSlices-DC7yg4GT.js.map +1 -0
  24. package/dist/localStorageKeys-Che0CNci.js +10 -0
  25. package/dist/localStorageKeys-Che0CNci.js.map +1 -0
  26. package/dist/owp-app.css +1 -1
  27. package/dist/owpDark-DAY0F6Ph.js +21 -0
  28. package/dist/owpDark-DAY0F6Ph.js.map +1 -0
  29. package/dist/storageKeys-C6xHFiTo.js +42 -0
  30. package/dist/storageKeys-C6xHFiTo.js.map +1 -0
  31. package/dist/store.js +37 -3
  32. package/dist/store.js.map +1 -1
  33. package/dist/{toUpper-CilZrxEa.js → toUpper-i_I6Tyuv.js} +2 -2
  34. package/dist/{toUpper-CilZrxEa.js.map → toUpper-i_I6Tyuv.js.map} +1 -1
  35. package/dist/treeGrid-DtKg-9uf.js +8 -0
  36. package/dist/treeGrid-DtKg-9uf.js.map +1 -0
  37. package/dist/{treeGridUtil-_FDvRzzt.js → treeGridUtil-WTM_djsN.js} +62 -61
  38. package/dist/{treeGridUtil-_FDvRzzt.js.map → treeGridUtil-WTM_djsN.js.map} +1 -1
  39. package/dist/types/components/OwpErrorBoundary/OwpErrorBoundary.d.ts +1 -1
  40. package/dist/types/components/OwpLayout/OwpLayout.d.ts +1 -1
  41. package/dist/types/components/OwpTable/OwpTable.d.ts +1 -1
  42. package/dist/types/components/OwpTabs/OwpTab.d.ts +1 -1
  43. package/dist/types/components/OwpTabs/OwpTabs.d.ts +1 -1
  44. package/dist/types/components/OwpThemeSelector/SchemePreview.d.ts +1 -1
  45. package/dist/types/components/OwpThemeSelector/ThemePreview.d.ts +1 -1
  46. package/dist/types/components/layouts/shared-components/navigation/store/navigationSlice.d.ts +5 -5
  47. package/dist/types/components/layouts/themeLayoutConfigs.d.ts +1 -1
  48. package/dist/types/context/OwpAppProvider.d.ts +4 -3
  49. package/dist/types/default-settings/OwpDefaultSettings.d.ts +25 -171
  50. package/dist/types/hooks/index.d.ts +1 -0
  51. package/dist/types/hooks/useAccessTokenGuard.d.ts +12 -0
  52. package/dist/types/hooks/useStorage.d.ts +0 -13
  53. package/dist/types/index.d.ts +1 -5
  54. package/dist/types/store/index.d.ts +1 -0
  55. package/dist/types/{components/OwpSettings → store}/owpSettingsSlice.d.ts +1 -456
  56. package/dist/types/{components/OwpSettings/OwpSettings.d.ts → types/OwpSettingsTypes.d.ts} +0 -12
  57. package/dist/types/utils/common/OwpUtils.d.ts +1 -1
  58. package/dist/usePageLockLoading-BUI_3PlR.js +39 -0
  59. package/dist/usePageLockLoading-BUI_3PlR.js.map +1 -0
  60. package/dist/useShortcuts-CCf98L8m.js +241 -0
  61. package/dist/useShortcuts-CCf98L8m.js.map +1 -0
  62. package/dist/useStorage-CuUmH4fD.js +50 -0
  63. package/dist/useStorage-CuUmH4fD.js.map +1 -0
  64. package/dist/useTreeGridExcelExport-N2nOKmkz.js +138 -0
  65. package/dist/useTreeGridExcelExport-N2nOKmkz.js.map +1 -0
  66. package/dist/utils.js +294 -293
  67. package/dist/utils.js.map +1 -1
  68. package/package.json +2 -11
  69. package/dist/Close-DnXhM4Ms.js.map +0 -1
  70. package/dist/OwpStoreProvider-B7W25pkq.js +0 -34
  71. package/dist/OwpStoreProvider-B7W25pkq.js.map +0 -1
  72. package/dist/OwpUtils-9lHSCdan.js.map +0 -1
  73. package/dist/index-B8tZAW8i.js.map +0 -1
  74. package/dist/language-CwsGUe4C.js +0 -5
  75. package/dist/language-CwsGUe4C.js.map +0 -1
  76. package/dist/lazyLoadedSlices-BAbcXcEU.js.map +0 -1
  77. package/dist/storageKeys-DRzte9LZ.js +0 -15
  78. package/dist/storageKeys-DRzte9LZ.js.map +0 -1
  79. package/dist/treeGrid-CjB04cBq.js +0 -35
  80. package/dist/treeGrid-CjB04cBq.js.map +0 -1
  81. package/dist/types/components/OwpSettings/OwpLayoutConfig.d.ts +0 -16
  82. package/dist/types/components/OwpSettings/OwpLayoutConfigs.d.ts +0 -14
  83. package/dist/types/components/OwpSettings/index.d.ts +0 -1
  84. package/dist/types/components/OwpSettings/palette-generator/PalettePreview.d.ts +0 -14
  85. package/dist/types/components/OwpSettings/palette-generator/PaletteSelector.d.ts +0 -15
  86. package/dist/types/components/OwpSettings/palette-generator/SectionPreview.d.ts +0 -12
  87. package/dist/types/store/apiService.d.ts +0 -6
  88. package/dist/useOwpTranslation-BelpX-fd.js +0 -174
  89. package/dist/useOwpTranslation-BelpX-fd.js.map +0 -1
  90. package/dist/useStorage-BA0D8KA7.js +0 -67
  91. package/dist/useStorage-BA0D8KA7.js.map +0 -1
  92. package/dist/useTreeGridExcelExport-QNcWzx5v.js +0 -195
  93. package/dist/useTreeGridExcelExport-QNcWzx5v.js.map +0 -1
  94. /package/dist/types/{components/OwpSettings → types}/ThemeFormConfigTypes.d.ts +0 -0
@@ -1,50 +1,43 @@
1
- var Yt = Object.defineProperty;
2
- var r = (e, t) => Yt(e, "name", { value: t, configurable: !0 });
3
- import { j as K, a as yt, b as qt } from "./emotion-react-jsx-runtime.browser.esm-Cb9H5d3i.js";
4
- import { u as It } from "./useStorage-BA0D8KA7.js";
5
- import { createContext as kt, useContext as zt, useRef as d, useLayoutEffect as Wt, forwardRef as Ht, useEffect as w, useCallback as g, useMemo as Kt, Component as Xt, useState as Et } from "react";
6
- import { DialogContent as $t, DialogActions as Zt, Dialog as Qt, DialogTitle as en, Box as tn, Button as bt, Typography as nn } from "@mui/material";
7
- import { useTranslation as rn } from "react-i18next";
8
- import { a as on, u as un } from "./useOwpTranslation-BelpX-fd.js";
9
- import { useNavigate as an, useLocation as sn } from "react-router-dom";
10
- import { createSvgIcon as cn } from "@mui/material/utils";
11
- const Lt = kt(void 0), $n = /* @__PURE__ */ r(({ configs: e, slots: t, children: n, env: i }) => {
12
- const o = d({ ...e, env: i, slots: t }), { setEnv: l } = It();
13
- return Wt(() => {
14
- l(i ?? {});
15
- }, [i, l]), /* @__PURE__ */ K(Lt.Provider, { value: o.current, children: n });
16
- }, "OwpAppProvider"), Zn = /* @__PURE__ */ r(() => {
17
- const e = zt(Lt);
18
- if (e === void 0)
19
- throw new Error("useOwpAppContext must be used within a OwpAppProvider");
20
- return e;
21
- }, "useOwpAppContext");
22
- function Me(e) {
1
+ var Jt = Object.defineProperty;
2
+ var r = (e, t) => Jt(e, "name", { value: t, configurable: !0 });
3
+ import { a as ge, j as P, b as qt } from "./emotion-react-jsx-runtime.browser.esm-Cb9H5d3i.js";
4
+ import { DialogContent as Yt, DialogActions as Wt, Dialog as $t, DialogTitle as Ht, Box as Kt, Button as bt, Typography as It } from "@mui/material";
5
+ import { forwardRef as Xt, createContext as Zt, useRef as v, useEffect as w, useCallback as g, useMemo as Qt, Component as en, useState as Ge } from "react";
6
+ import { useTranslation as tn } from "react-i18next";
7
+ import { n as kt, d as nn, q as rn } from "./useShortcuts-CCf98L8m.js";
8
+ import { u as on } from "./useStorage-CuUmH4fD.js";
9
+ import { useNavigate as un, useLocation as an } from "react-router-dom";
10
+ import sn from "@mui/material/Box";
11
+ import cn from "@mui/material/Typography";
12
+ import ln from "@mui/material/Backdrop";
13
+ import fn from "@mui/material/CircularProgress";
14
+ import { createSvgIcon as hn } from "@mui/material/utils";
15
+ function Pe(e) {
23
16
  return typeof e == "number" || e instanceof Number;
24
17
  }
25
- r(Me, "isNumber");
26
- const Ue = Ht(
18
+ r(Pe, "isNumber");
19
+ const Fe = Xt(
27
20
  ({
28
21
  title: e,
29
22
  children: t,
30
23
  canCancel: n = !0,
31
24
  canConfirm: i = !0,
32
25
  onConfirm: o,
33
- onCancel: l,
26
+ onCancel: h,
34
27
  onClose: s,
35
28
  useSubmit: a,
36
29
  actions: c,
37
- contentProps: f,
30
+ contentProps: l,
38
31
  ...y
39
- }, _) => {
40
- const { t: V, i18n: T } = rn("owp"), A = (y == null ? void 0 : y.confirmText) ?? V(T.exists("button.save") ? "button.save" : "Button.저장", { defaultValue: "저장" }), m = (y == null ? void 0 : y.cancelText) ?? V(
32
+ }, V) => {
33
+ const { t: B, i18n: T } = tn("owp"), A = (y == null ? void 0 : y.confirmText) ?? B(T.exists("button.save") ? "button.save" : "Button.저장", { defaultValue: "저장" }), m = (y == null ? void 0 : y.cancelText) ?? B(
41
34
  i ? T.exists("button.cancel") ? "button.cancel" : "Button.취소" : "Button.닫기",
42
35
  { defaultValue: i ? "취소" : "닫기" }
43
36
  );
44
- return /* @__PURE__ */ yt(
45
- Qt,
37
+ return /* @__PURE__ */ ge(
38
+ $t,
46
39
  {
47
- ref: _,
40
+ ref: V,
48
41
  fullWidth: !0,
49
42
  component: a ? "form" : void 0,
50
43
  onClose: /* @__PURE__ */ r((G, k) => {
@@ -52,17 +45,17 @@ const Ue = Ht(
52
45
  }, "onClose"),
53
46
  ...y,
54
47
  children: [
55
- e && /* @__PURE__ */ K(en, { children: e }),
56
- /* @__PURE__ */ K($t, { dividers: !0, ...f, children: t }),
57
- /* @__PURE__ */ yt(Zt, { children: [
58
- c && /* @__PURE__ */ K(tn, { className: "flex w-full items-start", children: c }),
59
- n && /* @__PURE__ */ K(
48
+ e && /* @__PURE__ */ P(Ht, { children: e }),
49
+ /* @__PURE__ */ P(Yt, { dividers: !0, ...l, children: t }),
50
+ /* @__PURE__ */ ge(Wt, { children: [
51
+ c && /* @__PURE__ */ P(Kt, { className: "flex w-full items-start", children: c }),
52
+ n && /* @__PURE__ */ P(
60
53
  bt,
61
54
  {
62
55
  variant: "outlined",
63
56
  onClick: /* @__PURE__ */ r(() => {
64
- if (typeof l == "function") {
65
- l();
57
+ if (typeof h == "function") {
58
+ h();
66
59
  return;
67
60
  }
68
61
  s == null || s({}, "escapeKeyDown");
@@ -70,7 +63,7 @@ const Ue = Ht(
70
63
  children: m
71
64
  }
72
65
  ),
73
- i && /* @__PURE__ */ K(
66
+ i && /* @__PURE__ */ P(
74
67
  bt,
75
68
  {
76
69
  variant: "contained",
@@ -94,20 +87,20 @@ const Ue = Ht(
94
87
  );
95
88
  }
96
89
  );
97
- Ue.displayName = "OwpDialog";
98
- const Qn = Ue;
99
- var ln = Object.create, St = Object.defineProperty, fn = Object.getOwnPropertyDescriptor, hn = Object.getOwnPropertyNames, dn = Object.getPrototypeOf, vn = Object.prototype.hasOwnProperty, mn = /* @__PURE__ */ r(function(e, t) {
90
+ Fe.displayName = "OwpDialog";
91
+ const or = Fe;
92
+ var dn = Object.create, Lt = Object.defineProperty, vn = Object.getOwnPropertyDescriptor, mn = Object.getOwnPropertyNames, pn = Object.getPrototypeOf, gn = Object.prototype.hasOwnProperty, yn = /* @__PURE__ */ r(function(e, t) {
100
93
  return function() {
101
94
  return t || e((t = { exports: {} }).exports, t), t.exports;
102
95
  };
103
- }, "yr"), pn = /* @__PURE__ */ r(function(e, t, n, i) {
104
- if (t && typeof t == "object" || typeof t == "function") for (var o = hn(t), l = 0, s = o.length, a; l < s; l++) a = o[l], !vn.call(e, a) && a !== n && St(e, a, { get: (function(c) {
96
+ }, "yr"), En = /* @__PURE__ */ r(function(e, t, n, i) {
97
+ if (t && typeof t == "object" || typeof t == "function") for (var o = mn(t), h = 0, s = o.length, a; h < s; h++) a = o[h], !gn.call(e, a) && a !== n && Lt(e, a, { get: (function(c) {
105
98
  return t[c];
106
- }).bind(null, a), enumerable: !(i = fn(t, a)) || i.enumerable });
99
+ }).bind(null, a), enumerable: !(i = vn(t, a)) || i.enumerable });
107
100
  return e;
108
- }, "gr"), gn = /* @__PURE__ */ r(function(e, t, n) {
109
- return n = e != null ? ln(dn(e)) : {}, pn(!e || !e.__esModule ? St(n, "default", { value: e, enumerable: !0 }) : n, e);
110
- }, "wr"), yn = mn(function(e, t) {
101
+ }, "gr"), bn = /* @__PURE__ */ r(function(e, t, n) {
102
+ return n = e != null ? dn(pn(e)) : {}, En(!e || !e.__esModule ? Lt(n, "default", { value: e, enumerable: !0 }) : n, e);
103
+ }, "wr"), wn = yn(function(e, t) {
111
104
  (function(n, i) {
112
105
  typeof e == "object" && typeof t < "u" ? i(e) : typeof define == "function" && define.amd ? define(["exports"], i) : (n = typeof globalThis < "u" ? globalThis : n || self, i(n.fastUniqueNumbers = {}));
113
106
  })(e, function(n) {
@@ -120,7 +113,7 @@ var ln = Object.create, St = Object.defineProperty, fn = Object.getOwnPropertyDe
120
113
  return function(A, m) {
121
114
  return T.set(A, m), m;
122
115
  };
123
- }, "t"), l = Number.MAX_SAFE_INTEGER === void 0 ? 9007199254740991 : Number.MAX_SAFE_INTEGER, s = 536870912, a = s * 2, c = /* @__PURE__ */ r(function(T, A) {
116
+ }, "t"), h = Number.MAX_SAFE_INTEGER === void 0 ? 9007199254740991 : Number.MAX_SAFE_INTEGER, s = 536870912, a = s * 2, c = /* @__PURE__ */ r(function(T, A) {
124
117
  return function(m) {
125
118
  var G = A.get(m), k = G === void 0 ? m.size : G < a ? G + 1 : 0;
126
119
  if (!m.has(k)) return T(m, k);
@@ -128,12 +121,12 @@ var ln = Object.create, St = Object.defineProperty, fn = Object.getOwnPropertyDe
128
121
  for (; m.has(k); ) k = Math.floor(Math.random() * a);
129
122
  return T(m, k);
130
123
  }
131
- if (m.size > l) throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");
132
- for (; m.has(k); ) k = Math.floor(Math.random() * l);
124
+ if (m.size > h) throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");
125
+ for (; m.has(k); ) k = Math.floor(Math.random() * h);
133
126
  return T(m, k);
134
127
  };
135
- }, "s"), f = /* @__PURE__ */ new WeakMap(), y = o(f), _ = c(y, f), V = i(_);
136
- n.addUniqueNumber = V, n.generateUniqueNumber = _;
128
+ }, "s"), l = /* @__PURE__ */ new WeakMap(), y = o(l), V = c(y, l), B = i(V);
129
+ n.addUniqueNumber = B, n.generateUniqueNumber = V;
137
130
  });
138
131
  });
139
132
  function te(e) {
@@ -141,36 +134,36 @@ function te(e) {
141
134
  return e;
142
135
  }
143
136
  r(te, "Y");
144
- function Ot(e, t) {
145
- return t != null && typeof Symbol < "u" && t[Symbol.hasInstance] ? !!t[Symbol.hasInstance](e) : Ot(e, t);
137
+ function St(e, t) {
138
+ return t != null && typeof Symbol < "u" && t[Symbol.hasInstance] ? !!t[Symbol.hasInstance](e) : St(e, t);
146
139
  }
147
- r(Ot, "je");
148
- function ge(e, t) {
149
- if (!Ot(e, t)) throw new TypeError("Cannot call a class as a function");
140
+ r(St, "je");
141
+ function ye(e, t) {
142
+ if (!St(e, t)) throw new TypeError("Cannot call a class as a function");
150
143
  }
151
- r(ge, "z");
152
- function Ge(e, t) {
153
- return Ge = Object.setPrototypeOf || function(n, i) {
144
+ r(ye, "z");
145
+ function Ue(e, t) {
146
+ return Ue = Object.setPrototypeOf || function(n, i) {
154
147
  return n.__proto__ = i, n;
155
- }, Ge(e, t);
148
+ }, Ue(e, t);
156
149
  }
157
- r(Ge, "De");
158
- function Mt(e, t) {
150
+ r(Ue, "De");
151
+ function Ot(e, t) {
159
152
  if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
160
- e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), t && Ge(e, t);
153
+ e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), t && Ue(e, t);
161
154
  }
162
- r(Mt, "Ke");
155
+ r(Ot, "Ke");
163
156
  function b(e, t, n) {
164
157
  return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
165
158
  }
166
159
  r(b, "h");
167
- function Pe(e) {
168
- return Pe = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) {
160
+ function Re(e) {
161
+ return Re = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) {
169
162
  return t.__proto__ || Object.getPrototypeOf(t);
170
- }, Pe(e);
163
+ }, Re(e);
171
164
  }
172
- r(Pe, "be");
173
- function En() {
165
+ r(Re, "be");
166
+ function Tn() {
174
167
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
175
168
  if (typeof Proxy == "function") return !0;
176
169
  try {
@@ -180,100 +173,100 @@ function En() {
180
173
  return !1;
181
174
  }
182
175
  }
183
- r(En, "Pt");
184
- function Pt(e) {
176
+ r(Tn, "Pt");
177
+ function Mt(e) {
185
178
  "@swc/helpers - typeof";
186
179
  return e && typeof Symbol < "u" && e.constructor === Symbol ? "symbol" : typeof e;
187
180
  }
188
- r(Pt, "Ne");
189
- function bn(e, t) {
190
- return t && (Pt(t) === "object" || typeof t == "function") ? t : te(e);
181
+ r(Mt, "Ne");
182
+ function An(e, t) {
183
+ return t && (Mt(t) === "object" || typeof t == "function") ? t : te(e);
191
184
  }
192
- r(bn, "kt");
193
- function Rt(e) {
194
- var t = En();
185
+ r(An, "kt");
186
+ function Pt(e) {
187
+ var t = Tn();
195
188
  return function() {
196
- var n = Pe(e), i;
189
+ var n = Re(e), i;
197
190
  if (t) {
198
- var o = Pe(this).constructor;
191
+ var o = Re(this).constructor;
199
192
  i = Reflect.construct(n, arguments, o);
200
193
  } else i = n.apply(this, arguments);
201
- return bn(this, i);
194
+ return An(this, i);
202
195
  };
203
196
  }
204
- r(Rt, "Ze");
205
- var wn = function(e) {
206
- Mt(n, e);
207
- var t = Rt(n);
197
+ r(Pt, "Ze");
198
+ var In = function(e) {
199
+ Ot(n, e);
200
+ var t = Pt(n);
208
201
  function n() {
209
- return ge(this, n), t.apply(this, arguments);
202
+ return ye(this, n), t.apply(this, arguments);
210
203
  }
211
204
  return r(n, "t"), n;
212
- }(Xt);
205
+ }(en);
213
206
  (function(e) {
214
- Mt(n, e);
215
- var t = Rt(n);
207
+ Ot(n, e);
208
+ var t = Pt(n);
216
209
  function n(i) {
217
- ge(this, n);
210
+ ye(this, n);
218
211
  var o;
219
212
  return o = t.call(this, i), o.onPresenceChange && i.setOnPresenceChange(o.onPresenceChange.bind(te(o))), o.onPrompt && i.setOnPrompt(o.onPrompt.bind(te(o))), o.onIdle && i.setOnIdle(o.onIdle.bind(te(o))), o.onActive && i.setOnActive(o.onActive.bind(te(o))), o.onAction && i.setOnAction(o.onAction.bind(te(o))), o.onMessage && i.setOnMessage(o.onMessage.bind(te(o))), o;
220
213
  }
221
214
  return r(n, "t"), n;
222
- })(wn);
223
- function Be(e, t) {
215
+ })(In);
216
+ function ze(e, t) {
224
217
  (t == null || t > e.length) && (t = e.length);
225
218
  for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
226
219
  return i;
227
220
  }
228
- r(Be, "Ee");
229
- function Tn(e) {
230
- if (Array.isArray(e)) return Be(e);
221
+ r(ze, "Ee");
222
+ function kn(e) {
223
+ if (Array.isArray(e)) return ze(e);
231
224
  }
232
- r(Tn, "At");
233
- function An(e) {
225
+ r(kn, "At");
226
+ function Ln(e) {
234
227
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
235
228
  }
236
- r(An, "Rt");
237
- function In() {
229
+ r(Ln, "Rt");
230
+ function Sn() {
238
231
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
239
232
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
240
233
  }
241
- r(In, "Mt");
242
- function kn(e, t) {
234
+ r(Sn, "Mt");
235
+ function On(e, t) {
243
236
  if (e) {
244
- if (typeof e == "string") return Be(e, t);
237
+ if (typeof e == "string") return ze(e, t);
245
238
  var n = Object.prototype.toString.call(e).slice(8, -1);
246
239
  if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(n);
247
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Be(e, t);
240
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ze(e, t);
248
241
  }
249
242
  }
250
- r(kn, "Ct");
243
+ r(On, "Ct");
251
244
  function j(e) {
252
- return Tn(e) || An(e) || kn(e) || In();
245
+ return kn(e) || Ln(e) || On(e) || Sn();
253
246
  }
254
247
  r(j, "O");
255
- function Ln(e, t) {
248
+ function Mn(e, t) {
256
249
  for (var n = 0; n < t.length; n++) {
257
250
  var i = t[n];
258
251
  i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
259
252
  }
260
253
  }
261
- r(Ln, "jt");
262
- function Fe(e, t, n) {
263
- return t && Ln(e.prototype, t), e;
254
+ r(Mn, "jt");
255
+ function Je(e, t, n) {
256
+ return t && Mn(e.prototype, t), e;
264
257
  }
265
- r(Fe, "ce");
266
- gn(yn());
267
- var z = (typeof window > "u" || typeof window > "u" ? "undefined" : Pt(window)) === "object", N = { setTimeout: z ? setTimeout.bind(window) : setTimeout, clearTimeout: z ? clearTimeout.bind(window) : clearTimeout, setInterval: z ? setInterval.bind(window) : setInterval, clearInterval: z ? clearInterval.bind(window) : clearInterval };
268
- function Sn(e) {
269
- N.setTimeout = e.setTimeout, N.clearTimeout = e.clearTimeout, N.setInterval = e.setInterval, N.clearInterval = e.clearInterval;
258
+ r(Je, "ce");
259
+ bn(wn());
260
+ var W = (typeof window > "u" || typeof window > "u" ? "undefined" : Mt(window)) === "object", _ = { setTimeout: W ? setTimeout.bind(window) : setTimeout, clearTimeout: W ? clearTimeout.bind(window) : clearTimeout, setInterval: W ? setInterval.bind(window) : setInterval, clearInterval: W ? clearInterval.bind(window) : clearInterval };
261
+ function Pn(e) {
262
+ _.setTimeout = e.setTimeout, _.clearTimeout = e.clearTimeout, _.setInterval = e.setInterval, _.clearInterval = e.clearInterval;
270
263
  }
271
- r(Sn, "Jt");
272
- var ue = {}, On = function() {
264
+ r(Pn, "Jt");
265
+ var ue = {}, Rn = function() {
273
266
  function e(t) {
274
- ge(this, e), b(this, "name", void 0), b(this, "closed", !1), b(this, "mc", new MessageChannel()), this.name = t, ue[t] = ue[t] || [], ue[t].push(this), this.mc.port1.start(), this.mc.port2.start(), this.onStorage = this.onStorage.bind(this), window.addEventListener("storage", this.onStorage);
267
+ ye(this, e), b(this, "name", void 0), b(this, "closed", !1), b(this, "mc", new MessageChannel()), this.name = t, ue[t] = ue[t] || [], ue[t].push(this), this.mc.port1.start(), this.mc.port2.start(), this.onStorage = this.onStorage.bind(this), window.addEventListener("storage", this.onStorage);
275
268
  }
276
- return r(e, "e"), Fe(e, [{ key: "onStorage", value: /* @__PURE__ */ r(function(t) {
269
+ return r(e, "e"), Je(e, [{ key: "onStorage", value: /* @__PURE__ */ r(function(t) {
277
270
  if (t.storageArea === window.localStorage && t.key.substring(0, this.name.length) === this.name && t.newValue !== null) {
278
271
  var n = JSON.parse(t.newValue);
279
272
  this.mc.port2.postMessage(n);
@@ -282,10 +275,10 @@ var ue = {}, On = function() {
282
275
  var n = this;
283
276
  if (this.closed) throw new Error("InvalidStateError");
284
277
  var i = JSON.stringify(t), o = "".concat(this.name, ":").concat(String(Date.now())).concat(String(Math.random()));
285
- window.localStorage.setItem(o, i), N.setTimeout(function() {
278
+ window.localStorage.setItem(o, i), _.setTimeout(function() {
286
279
  window.localStorage.removeItem(o);
287
- }, 500), ue[this.name].forEach(function(l) {
288
- l !== n && l.mc.port2.postMessage(JSON.parse(i));
280
+ }, 500), ue[this.name].forEach(function(h) {
281
+ h !== n && h.mc.port2.postMessage(JSON.parse(i));
289
282
  });
290
283
  }, "value") }, { key: "close", value: /* @__PURE__ */ r(function() {
291
284
  if (!this.closed) {
@@ -308,128 +301,128 @@ var ue = {}, On = function() {
308
301
  }, "value") }, { key: "dispatchEvent", value: /* @__PURE__ */ r(function(t) {
309
302
  return this.mc.port1.dispatchEvent(t);
310
303
  }, "value") }]), e;
311
- }(), Mn = typeof window > "u" ? void 0 : typeof window.BroadcastChannel == "function" ? window.BroadcastChannel : On;
312
- function wt(e, t, n, i, o, l, s) {
304
+ }(), xn = typeof window > "u" ? void 0 : typeof window.BroadcastChannel == "function" ? window.BroadcastChannel : Rn;
305
+ function wt(e, t, n, i, o, h, s) {
313
306
  try {
314
- var a = e[l](s), c = a.value;
315
- } catch (f) {
316
- n(f);
307
+ var a = e[h](s), c = a.value;
308
+ } catch (l) {
309
+ n(l);
317
310
  return;
318
311
  }
319
312
  a.done ? t(c) : Promise.resolve(c).then(i, o);
320
313
  }
321
314
  r(wt, "Xt");
322
- function Pn(e) {
315
+ function Cn(e) {
323
316
  return function() {
324
317
  var t = this, n = arguments;
325
318
  return new Promise(function(i, o) {
326
- var l = e.apply(t, n);
319
+ var h = e.apply(t, n);
327
320
  function s(c) {
328
- wt(l, i, o, s, a, "next", c);
321
+ wt(h, i, o, s, a, "next", c);
329
322
  }
330
323
  r(s, "s");
331
324
  function a(c) {
332
- wt(l, i, o, s, a, "throw", c);
325
+ wt(h, i, o, s, a, "throw", c);
333
326
  }
334
327
  r(a, "a"), s(void 0);
335
328
  });
336
329
  };
337
330
  }
338
- r(Pn, "$t");
339
- function Rn(e, t) {
340
- var n = /* @__PURE__ */ r(function(f) {
331
+ r(Cn, "$t");
332
+ function Dn(e, t) {
333
+ var n = /* @__PURE__ */ r(function(l) {
341
334
  return function(y) {
342
- return i([f, y]);
335
+ return i([l, y]);
343
336
  };
344
- }, "t"), i = /* @__PURE__ */ r(function(f) {
345
- if (l) throw new TypeError("Generator is already executing.");
346
- for (; c && (c = 0, f[0] && (o = 0)), o; ) try {
347
- if (l = 1, s && (a = f[0] & 2 ? s.return : f[0] ? s.throw || ((a = s.return) && a.call(s), 0) : s.next) && !(a = a.call(s, f[1])).done) return a;
348
- switch (s = 0, a && (f = [f[0] & 2, a.value]), f[0]) {
337
+ }, "t"), i = /* @__PURE__ */ r(function(l) {
338
+ if (h) throw new TypeError("Generator is already executing.");
339
+ for (; c && (c = 0, l[0] && (o = 0)), o; ) try {
340
+ if (h = 1, s && (a = l[0] & 2 ? s.return : l[0] ? s.throw || ((a = s.return) && a.call(s), 0) : s.next) && !(a = a.call(s, l[1])).done) return a;
341
+ switch (s = 0, a && (l = [l[0] & 2, a.value]), l[0]) {
349
342
  case 0:
350
343
  case 1:
351
- a = f;
344
+ a = l;
352
345
  break;
353
346
  case 4:
354
- return o.label++, { value: f[1], done: !1 };
347
+ return o.label++, { value: l[1], done: !1 };
355
348
  case 5:
356
- o.label++, s = f[1], f = [0];
349
+ o.label++, s = l[1], l = [0];
357
350
  continue;
358
351
  case 7:
359
- f = o.ops.pop(), o.trys.pop();
352
+ l = o.ops.pop(), o.trys.pop();
360
353
  continue;
361
354
  default:
362
- if (a = o.trys, !(a = a.length > 0 && a[a.length - 1]) && (f[0] === 6 || f[0] === 2)) {
355
+ if (a = o.trys, !(a = a.length > 0 && a[a.length - 1]) && (l[0] === 6 || l[0] === 2)) {
363
356
  o = 0;
364
357
  continue;
365
358
  }
366
- if (f[0] === 3 && (!a || f[1] > a[0] && f[1] < a[3])) {
367
- o.label = f[1];
359
+ if (l[0] === 3 && (!a || l[1] > a[0] && l[1] < a[3])) {
360
+ o.label = l[1];
368
361
  break;
369
362
  }
370
- if (f[0] === 6 && o.label < a[1]) {
371
- o.label = a[1], a = f;
363
+ if (l[0] === 6 && o.label < a[1]) {
364
+ o.label = a[1], a = l;
372
365
  break;
373
366
  }
374
367
  if (a && o.label < a[2]) {
375
- o.label = a[2], o.ops.push(f);
368
+ o.label = a[2], o.ops.push(l);
376
369
  break;
377
370
  }
378
371
  a[2] && o.ops.pop(), o.trys.pop();
379
372
  continue;
380
373
  }
381
- f = t.call(e, o);
374
+ l = t.call(e, o);
382
375
  } catch (y) {
383
- f = [6, y], s = 0;
376
+ l = [6, y], s = 0;
384
377
  } finally {
385
- l = a = 0;
378
+ h = a = 0;
386
379
  }
387
- if (f[0] & 5) throw f[1];
388
- return { value: f[0] ? f[1] : void 0, done: !0 };
380
+ if (l[0] & 5) throw l[1];
381
+ return { value: l[0] ? l[1] : void 0, done: !0 };
389
382
  }, "o"), o = { label: 0, sent: /* @__PURE__ */ r(function() {
390
383
  if (a[0] & 1) throw a[1];
391
384
  return a[1];
392
- }, "sent"), trys: [], ops: [] }, l, s, a, c;
385
+ }, "sent"), trys: [], ops: [] }, h, s, a, c;
393
386
  return c = { next: n(0), throw: n(1), return: n(2) }, typeof Symbol == "function" && (c[Symbol.iterator] = function() {
394
387
  return this;
395
388
  }), c;
396
389
  }
397
- r(Rn, "Ve");
398
- function Cn() {
390
+ r(Dn, "Ve");
391
+ function Nn() {
399
392
  var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
400
393
  return new Promise(function(t) {
401
- return N.setTimeout(t, e);
394
+ return _.setTimeout(t, e);
402
395
  });
403
396
  }
404
- r(Cn, "Kt");
405
- function Ct() {
397
+ r(Nn, "Kt");
398
+ function Rt() {
406
399
  return Math.random().toString(36).substring(2);
407
400
  }
408
- r(Ct, "Ge");
409
- var v;
401
+ r(Rt, "Ge");
402
+ var d;
410
403
  (function(e) {
411
404
  e[e.APPLY = 0] = "APPLY", e[e.TELL = 1] = "TELL", e[e.CLOSE = 2] = "CLOSE", e[e.REGISTER = 3] = "REGISTER", e[e.DEREGISTER = 4] = "DEREGISTER", e[e.IDLE = 5] = "IDLE", e[e.ACTIVE = 6] = "ACTIVE", e[e.PROMPT = 7] = "PROMPT", e[e.START = 8] = "START", e[e.RESET = 9] = "RESET", e[e.ACTIVATE = 10] = "ACTIVATE", e[e.PAUSE = 11] = "PAUSE", e[e.RESUME = 12] = "RESUME", e[e.MESSAGE = 13] = "MESSAGE";
412
- })(v || (v = {}));
413
- var Dn = function() {
405
+ })(d || (d = {}));
406
+ var jn = function() {
414
407
  function e(t, n) {
415
- ge(this, e), b(this, "options", void 0), b(this, "channel", void 0), b(this, "token", Ct()), b(this, "isLeader", !1), b(this, "isDead", !1), b(this, "isApplying", !1), b(this, "reApply", !1), b(this, "intervals", []), b(this, "listeners", []), b(this, "deferred", void 0), this.channel = t, this.options = n, this.apply = this.apply.bind(this), this.awaitLeadership = this.awaitLeadership.bind(this), this.sendAction = this.sendAction.bind(this);
408
+ ye(this, e), b(this, "options", void 0), b(this, "channel", void 0), b(this, "token", Rt()), b(this, "isLeader", !1), b(this, "isDead", !1), b(this, "isApplying", !1), b(this, "reApply", !1), b(this, "intervals", []), b(this, "listeners", []), b(this, "deferred", void 0), this.channel = t, this.options = n, this.apply = this.apply.bind(this), this.awaitLeadership = this.awaitLeadership.bind(this), this.sendAction = this.sendAction.bind(this);
416
409
  }
417
- return r(e, "e"), Fe(e, [{ key: "apply", value: /* @__PURE__ */ r(function() {
410
+ return r(e, "e"), Je(e, [{ key: "apply", value: /* @__PURE__ */ r(function() {
418
411
  var t = this;
419
- return Pn(function() {
412
+ return Cn(function() {
420
413
  var n, i;
421
- return Rn(this, function(o) {
414
+ return Dn(this, function(o) {
422
415
  switch (o.label) {
423
416
  case 0:
424
417
  if (t.isLeader) return [2, !1];
425
418
  if (t.isDead) return [2, !1];
426
419
  if (t.isApplying) return t.reApply = !0, [2, !1];
427
- t.isApplying = !0, n = !1, i = /* @__PURE__ */ r(function(l) {
428
- var s = l.data, a = s.token, c = s.action;
429
- a !== t.token && (c === v.APPLY && a > t.token && (n = !0), c === v.TELL && (n = !0));
420
+ t.isApplying = !0, n = !1, i = /* @__PURE__ */ r(function(h) {
421
+ var s = h.data, a = s.token, c = s.action;
422
+ a !== t.token && (c === d.APPLY && a > t.token && (n = !0), c === d.TELL && (n = !0));
430
423
  }, "n"), t.channel.addEventListener("message", i), o.label = 1;
431
424
  case 1:
432
- return o.trys.push([1, 3, , 4]), t.sendAction(v.APPLY), [4, Cn(t.options.responseTime)];
425
+ return o.trys.push([1, 3, , 4]), t.sendAction(d.APPLY), [4, Nn(t.options.responseTime)];
433
426
  case 2:
434
427
  return o.sent(), t.channel.removeEventListener("message", i), t.isApplying = !1, n ? t.reApply ? [2, t.apply()] : [2, !1] : (t.assumeLead(), [2, !0]);
435
428
  case 3:
@@ -444,26 +437,26 @@ var Dn = function() {
444
437
  if (this.isLeader) return Promise.resolve();
445
438
  var n = !1, i = null;
446
439
  return new Promise(function(o) {
447
- var l = /* @__PURE__ */ r(function() {
440
+ var h = /* @__PURE__ */ r(function() {
448
441
  if (!n) {
449
442
  n = !0;
450
443
  try {
451
- N.clearInterval(i);
444
+ _.clearInterval(i);
452
445
  } catch {
453
446
  }
454
447
  var a = t.intervals.indexOf(i);
455
448
  a >= 0 && t.intervals.splice(a, 1), t.channel.removeEventListener("message", s), o();
456
449
  }
457
450
  }, "s");
458
- i = N.setInterval(function() {
451
+ i = _.setInterval(function() {
459
452
  t.apply().then(function() {
460
- t.isLeader && l();
453
+ t.isLeader && h();
461
454
  });
462
455
  }, t.options.fallbackInterval), t.intervals.push(i);
463
456
  var s = /* @__PURE__ */ r(function(a) {
464
457
  var c = a.data.action;
465
- c === v.CLOSE && t.apply().then(function() {
466
- t.isLeader && l();
458
+ c === d.CLOSE && t.apply().then(function() {
459
+ t.isLeader && h();
467
460
  });
468
461
  }, "a");
469
462
  t.channel.addEventListener("message", s);
@@ -475,20 +468,20 @@ var Dn = function() {
475
468
  this.isLeader = !0;
476
469
  var n = /* @__PURE__ */ r(function(i) {
477
470
  var o = i.data.action;
478
- o === v.APPLY && t.sendAction(v.TELL);
471
+ o === d.APPLY && t.sendAction(d.TELL);
479
472
  }, "o");
480
- return this.channel.addEventListener("message", n), this.listeners.push(n), this.sendAction(v.TELL);
473
+ return this.channel.addEventListener("message", n), this.listeners.push(n), this.sendAction(d.TELL);
481
474
  }, "value") }, { key: "waitForLeadership", value: /* @__PURE__ */ r(function() {
482
475
  return this.deferred ? this.deferred : (this.deferred = this.awaitLeadership(), this.deferred);
483
476
  }, "value") }, { key: "close", value: /* @__PURE__ */ r(function() {
484
477
  var t = this;
485
478
  if (!this.isDead) {
486
- this.isDead = !0, this.isLeader = !1, this.sendAction(v.CLOSE);
479
+ this.isDead = !0, this.isLeader = !1, this.sendAction(d.CLOSE);
487
480
  try {
488
481
  this.listeners.forEach(function(n) {
489
482
  return t.channel.removeEventListener("message", n);
490
483
  }), this.intervals.forEach(function(n) {
491
- return N.clearInterval(n);
484
+ return _.clearInterval(n);
492
485
  });
493
486
  } catch {
494
487
  }
@@ -498,55 +491,55 @@ var Dn = function() {
498
491
  (function(e) {
499
492
  e[e.PROMPTED = 0] = "PROMPTED", e[e.ACTIVE = 1] = "ACTIVE", e[e.IDLE = 2] = "IDLE";
500
493
  })(M || (M = {}));
501
- var xn = function() {
494
+ var _n = function() {
502
495
  function e(t) {
503
496
  var n = this;
504
- ge(this, e), b(this, "channel", void 0), b(this, "options", void 0), b(this, "elector", void 0), b(this, "token", Ct()), b(this, "registry", /* @__PURE__ */ new Map()), b(this, "allIdle", !1), b(this, "isLastActive", !1);
497
+ ye(this, e), b(this, "channel", void 0), b(this, "options", void 0), b(this, "elector", void 0), b(this, "token", Rt()), b(this, "registry", /* @__PURE__ */ new Map()), b(this, "allIdle", !1), b(this, "isLastActive", !1);
505
498
  var i = t.channelName;
506
- if (this.options = t, this.channel = new Mn(i), this.registry.set(this.token, M.ACTIVE), t.leaderElection) {
499
+ if (this.options = t, this.channel = new xn(i), this.registry.set(this.token, M.ACTIVE), t.leaderElection) {
507
500
  var o = { fallbackInterval: 2e3, responseTime: 100 };
508
- this.elector = new Dn(this.channel, o), this.elector.waitForLeadership();
501
+ this.elector = new jn(this.channel, o), this.elector.waitForLeadership();
509
502
  }
510
- this.channel.addEventListener("message", function(l) {
511
- var s = l.data, a = s.action, c = s.token, f = s.data;
503
+ this.channel.addEventListener("message", function(h) {
504
+ var s = h.data, a = s.action, c = s.token, l = s.data;
512
505
  switch (a) {
513
- case v.REGISTER:
506
+ case d.REGISTER:
514
507
  n.registry.set(c, M.IDLE);
515
508
  break;
516
- case v.DEREGISTER:
509
+ case d.DEREGISTER:
517
510
  n.registry.delete(c);
518
511
  break;
519
- case v.IDLE:
512
+ case d.IDLE:
520
513
  n.idle(c);
521
514
  break;
522
- case v.ACTIVE:
515
+ case d.ACTIVE:
523
516
  n.active(c);
524
517
  break;
525
- case v.PROMPT:
518
+ case d.PROMPT:
526
519
  n.prompt(c);
527
520
  break;
528
- case v.START:
521
+ case d.START:
529
522
  n.start(c);
530
523
  break;
531
- case v.RESET:
524
+ case d.RESET:
532
525
  n.reset(c);
533
526
  break;
534
- case v.ACTIVATE:
527
+ case d.ACTIVATE:
535
528
  n.activate(c);
536
529
  break;
537
- case v.PAUSE:
530
+ case d.PAUSE:
538
531
  n.pause(c);
539
532
  break;
540
- case v.RESUME:
533
+ case d.RESUME:
541
534
  n.resume(c);
542
535
  break;
543
- case v.MESSAGE:
544
- n.options.onMessage(f);
536
+ case d.MESSAGE:
537
+ n.options.onMessage(l);
545
538
  break;
546
539
  }
547
- }), this.send(v.REGISTER);
540
+ }), this.send(d.REGISTER);
548
541
  }
549
- return r(e, "e"), Fe(e, [{ key: "isLeader", get: /* @__PURE__ */ r(function() {
542
+ return r(e, "e"), Je(e, [{ key: "isLeader", get: /* @__PURE__ */ r(function() {
550
543
  if (!this.elector) throw new Error('❌ Leader election is not enabled. To Enable it set the "leaderElection" property to true.');
551
544
  return this.elector.isLeader;
552
545
  }, "get") }, { key: "prompt", value: /* @__PURE__ */ r(function() {
@@ -555,39 +548,39 @@ var xn = function() {
555
548
  var n = j(this.registry.values()).every(function(i) {
556
549
  return i === M.PROMPTED;
557
550
  });
558
- t === this.token && this.send(v.PROMPT), n && this.options.onPrompt();
551
+ t === this.token && this.send(d.PROMPT), n && this.options.onPrompt();
559
552
  }, "value") }, { key: "idle", value: /* @__PURE__ */ r(function() {
560
553
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
561
554
  this.registry.set(t, M.IDLE);
562
555
  var n = j(this.registry.values()).every(function(i) {
563
556
  return i === M.IDLE;
564
557
  });
565
- t === this.token && this.send(v.IDLE), !this.allIdle && n && (this.allIdle = !0, this.options.onIdle());
558
+ t === this.token && this.send(d.IDLE), !this.allIdle && n && (this.allIdle = !0, this.options.onIdle());
566
559
  }, "value") }, { key: "active", value: /* @__PURE__ */ r(function() {
567
560
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
568
561
  this.allIdle = !1, this.registry.set(t, M.ACTIVE);
569
562
  var n = j(this.registry.values()).some(function(i) {
570
563
  return i === M.ACTIVE;
571
564
  });
572
- t === this.token && this.send(v.ACTIVE), n && this.options.onActive(), this.isLastActive = t === this.token;
565
+ t === this.token && this.send(d.ACTIVE), n && this.options.onActive(), this.isLastActive = t === this.token;
573
566
  }, "value") }, { key: "start", value: /* @__PURE__ */ r(function() {
574
567
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
575
- this.allIdle = !1, this.registry.set(t, M.ACTIVE), t === this.token ? this.send(v.START) : this.options.start(!0), this.isLastActive = t === this.token;
568
+ this.allIdle = !1, this.registry.set(t, M.ACTIVE), t === this.token ? this.send(d.START) : this.options.start(!0), this.isLastActive = t === this.token;
576
569
  }, "value") }, { key: "reset", value: /* @__PURE__ */ r(function() {
577
570
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
578
- this.allIdle = !1, this.registry.set(t, M.ACTIVE), t === this.token ? this.send(v.RESET) : this.options.reset(!0), this.isLastActive = t === this.token;
571
+ this.allIdle = !1, this.registry.set(t, M.ACTIVE), t === this.token ? this.send(d.RESET) : this.options.reset(!0), this.isLastActive = t === this.token;
579
572
  }, "value") }, { key: "activate", value: /* @__PURE__ */ r(function() {
580
573
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
581
- this.allIdle = !1, this.registry.set(t, M.ACTIVE), t === this.token ? this.send(v.ACTIVATE) : this.options.activate(!0), this.isLastActive = t === this.token;
574
+ this.allIdle = !1, this.registry.set(t, M.ACTIVE), t === this.token ? this.send(d.ACTIVATE) : this.options.activate(!0), this.isLastActive = t === this.token;
582
575
  }, "value") }, { key: "pause", value: /* @__PURE__ */ r(function() {
583
576
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
584
- t === this.token ? this.send(v.PAUSE) : this.options.pause(!0);
577
+ t === this.token ? this.send(d.PAUSE) : this.options.pause(!0);
585
578
  }, "value") }, { key: "resume", value: /* @__PURE__ */ r(function() {
586
579
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
587
- t === this.token ? this.send(v.RESUME) : this.options.resume(!0);
580
+ t === this.token ? this.send(d.RESUME) : this.options.resume(!0);
588
581
  }, "value") }, { key: "message", value: /* @__PURE__ */ r(function(t) {
589
582
  try {
590
- this.channel.postMessage({ action: v.MESSAGE, token: this.token, data: t });
583
+ this.channel.postMessage({ action: d.MESSAGE, token: this.token, data: t });
591
584
  } catch {
592
585
  }
593
586
  }, "value") }, { key: "send", value: /* @__PURE__ */ r(function(t) {
@@ -596,249 +589,249 @@ var xn = function() {
596
589
  } catch {
597
590
  }
598
591
  }, "value") }, { key: "close", value: /* @__PURE__ */ r(function() {
599
- this.options.leaderElection && this.elector.close(), this.send(v.DEREGISTER), this.channel.close();
592
+ this.options.leaderElection && this.elector.close(), this.send(d.DEREGISTER), this.channel.close();
600
593
  }, "value") }]), e;
601
- }(), jn = z ? document : null, Nn = ["mousemove", "keydown", "wheel", "DOMMouseScroll", "mousewheel", "mousedown", "touchstart", "touchmove", "MSPointerDown", "MSPointerMove", "visibilitychange", "focus"];
602
- function _n(e, t) {
594
+ }(), Vn = W ? document : null, Bn = ["mousemove", "keydown", "wheel", "DOMMouseScroll", "mousewheel", "mousedown", "touchstart", "touchmove", "MSPointerDown", "MSPointerMove", "visibilitychange", "focus"];
595
+ function Gn(e, t) {
603
596
  var n = /* @__PURE__ */ r(function() {
604
- for (var o = arguments.length, l = new Array(o), s = 0; s < o; s++) l[s] = arguments[s];
597
+ for (var o = arguments.length, h = new Array(o), s = 0; s < o; s++) h[s] = arguments[s];
605
598
  i && clearTimeout(i), i = setTimeout(function() {
606
- e.apply(void 0, j(l)), i = null;
599
+ e.apply(void 0, j(h)), i = null;
607
600
  }, t);
608
601
  }, "t"), i;
609
602
  return n.cancel = function() {
610
603
  clearTimeout(i);
611
604
  }, n;
612
605
  }
613
- r(_n, "tr");
614
- function Ve(e, t) {
606
+ r(Gn, "tr");
607
+ function Be(e, t) {
615
608
  var n = 0;
616
609
  return function() {
617
- for (var i = arguments.length, o = new Array(i), l = 0; l < i; l++) o[l] = arguments[l];
610
+ for (var i = arguments.length, o = new Array(i), h = 0; h < i; h++) o[h] = arguments[h];
618
611
  var s = (/* @__PURE__ */ new Date()).getTime();
619
612
  if (!(s - n < t)) return n = s, e.apply(void 0, j(o));
620
613
  };
621
614
  }
622
- r(Ve, "Fe");
615
+ r(Be, "Fe");
623
616
  var E = /* @__PURE__ */ r(function() {
624
617
  return Date.now();
625
618
  }, "g"), ae = 2147483647;
626
- function Vn() {
627
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.timeout, n = t === void 0 ? 1e3 * 60 * 20 : t, i = e.promptTimeout, o = i === void 0 ? 0 : i, l = e.promptBeforeIdle, s = l === void 0 ? 0 : l, a = e.element, c = a === void 0 ? jn : a, f = e.events, y = f === void 0 ? Nn : f, _ = e.timers, V = _ === void 0 ? void 0 : _, T = e.immediateEvents, A = T === void 0 ? [] : T, m = e.onPresenceChange, G = m === void 0 ? function() {
628
- } : m, k = e.onPrompt, ye = k === void 0 ? function() {
629
- } : k, Je = e.onIdle, Ee = Je === void 0 ? function() {
630
- } : Je, Ye = e.onActive, be = Ye === void 0 ? function() {
631
- } : Ye, qe = e.onAction, we = qe === void 0 ? function() {
632
- } : qe, ze = e.onMessage, se = ze === void 0 ? function() {
633
- } : ze, We = e.debounce, ce = We === void 0 ? 0 : We, He = e.throttle, le = He === void 0 ? 0 : He, Ke = e.eventsThrottle, Re = Ke === void 0 ? 200 : Ke, Xe = e.startOnMount, fe = Xe === void 0 ? !0 : Xe, $e = e.startManually, U = $e === void 0 ? !1 : $e, Ze = e.stopOnIdle, Te = Ze === void 0 ? !1 : Ze, Qe = e.crossTab, ne = Qe === void 0 ? !1 : Qe, et = e.name, tt = et === void 0 ? "idle-timer" : et, nt = e.syncTimers, he = nt === void 0 ? 0 : nt, rt = e.leaderElection, it = rt === void 0 ? !1 : rt, ot = e.disabled, B = ot === void 0 ? !1 : ot, ut = d(E()), Ae = d(E()), L = d(null), R = d(null), W = d(0), de = d(0), F = d(0), P = d(0), p = d(!1), I = d(!1), J = d(!1), Y = d(!0), ve = d(!1), q = d(null), h = d(null), C = d(n), X = d(0);
619
+ function Un() {
620
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.timeout, n = t === void 0 ? 1e3 * 60 * 20 : t, i = e.promptTimeout, o = i === void 0 ? 0 : i, h = e.promptBeforeIdle, s = h === void 0 ? 0 : h, a = e.element, c = a === void 0 ? Vn : a, l = e.events, y = l === void 0 ? Bn : l, V = e.timers, B = V === void 0 ? void 0 : V, T = e.immediateEvents, A = T === void 0 ? [] : T, m = e.onPresenceChange, G = m === void 0 ? function() {
621
+ } : m, k = e.onPrompt, Ee = k === void 0 ? function() {
622
+ } : k, qe = e.onIdle, be = qe === void 0 ? function() {
623
+ } : qe, Ye = e.onActive, we = Ye === void 0 ? function() {
624
+ } : Ye, We = e.onAction, Te = We === void 0 ? function() {
625
+ } : We, $e = e.onMessage, se = $e === void 0 ? function() {
626
+ } : $e, He = e.debounce, ce = He === void 0 ? 0 : He, Ke = e.throttle, le = Ke === void 0 ? 0 : Ke, Xe = e.eventsThrottle, xe = Xe === void 0 ? 200 : Xe, Ze = e.startOnMount, fe = Ze === void 0 ? !0 : Ze, Qe = e.startManually, z = Qe === void 0 ? !1 : Qe, et = e.stopOnIdle, Ae = et === void 0 ? !1 : et, tt = e.crossTab, ne = tt === void 0 ? !1 : tt, nt = e.name, rt = nt === void 0 ? "idle-timer" : nt, it = e.syncTimers, he = it === void 0 ? 0 : it, ot = e.leaderElection, ut = ot === void 0 ? !1 : ot, at = e.disabled, U = at === void 0 ? !1 : at, st = v(E()), Ie = v(E()), L = v(null), x = v(null), $ = v(0), de = v(0), F = v(0), R = v(0), p = v(!1), I = v(!1), J = v(!1), q = v(!0), ve = v(!1), Y = v(null), f = v(null), C = v(n), K = v(0);
634
627
  w(function() {
635
628
  if (o && console.warn("⚠️ IdleTimer -- The `promptTimeout` property has been deprecated in favor of `promptBeforeIdle`. It will be removed in the next major release."), s && o) throw new Error("❌ Both promptTimeout and promptBeforeIdle can not be set. The promptTimeout property will be deprecated in a future version.");
636
629
  if (n >= ae) throw new Error("❌ The value for the timeout property must fit in a 32 bit signed integer, ".concat(ae, "."));
637
630
  if (o >= ae) throw new Error("❌ The value for the promptTimeout property must fit in a 32 bit signed integer, ".concat(ae, "."));
638
631
  if (s >= ae) throw new Error("❌ The value for the promptBeforeIdle property must fit in a 32 bit signed integer, ".concat(ae, "."));
639
632
  if (s >= n) throw new Error("❌ The value for the promptBeforeIdle property must be less than the timeout property, ".concat(n, "."));
640
- if (s ? (C.current = n - s, X.current = s) : (C.current = n, X.current = o), !Y.current) {
641
- if (U || B) return;
642
- p.current && (re.current(null, O), h.current && h.current.active()), ee();
633
+ if (s ? (C.current = n - s, K.current = s) : (C.current = n, K.current = o), !q.current) {
634
+ if (z || U) return;
635
+ p.current && (re.current(null, O), f.current && f.current.active()), ee();
643
636
  }
644
- }, [n, o, s, U, B]);
645
- var at = d(Te);
637
+ }, [n, o, s, z, U]);
638
+ var ct = v(Ae);
646
639
  w(function() {
647
- at.current = Te;
648
- }, [Te]);
649
- var st = d(A), me = d(c), Ce = d(j(new Set(j(y).concat(j(A))).values())), D = d(B);
640
+ ct.current = Ae;
641
+ }, [Ae]);
642
+ var lt = v(A), me = v(c), Ce = v(j(new Set(j(y).concat(j(A))).values())), D = v(U);
650
643
  w(function() {
651
- D.current = B, !Y.current && (B ? Oe() : U || ee());
652
- }, [B]);
653
- var pe = d(G);
644
+ D.current = U, !q.current && (U ? Me() : z || ee());
645
+ }, [U]);
646
+ var pe = v(G);
654
647
  w(function() {
655
648
  pe.current = G;
656
649
  }, [G]);
657
- var Ie = d(ye);
658
- w(function() {
659
- Ie.current = ye;
660
- }, [ye]);
661
- var ke = d(Ee);
650
+ var ke = v(Ee);
662
651
  w(function() {
663
652
  ke.current = Ee;
664
653
  }, [Ee]);
665
- var re = d(be);
654
+ var Le = v(be);
666
655
  w(function() {
667
- re.current = be;
656
+ Le.current = be;
668
657
  }, [be]);
669
- var Le = d(we);
658
+ var re = v(we);
670
659
  w(function() {
671
- Le.current = we;
660
+ re.current = we;
672
661
  }, [we]);
673
- var ie = d(se);
662
+ var Se = v(Te);
663
+ w(function() {
664
+ Se.current = Te;
665
+ }, [Te]);
666
+ var ie = v(se);
674
667
  w(function() {
675
668
  ie.current = se;
676
669
  }, [se]);
677
- var $ = Kt(function() {
670
+ var X = Qt(function() {
678
671
  var u = /* @__PURE__ */ r(function(S, oe) {
679
- return Le.current(S, oe);
672
+ return Se.current(S, oe);
680
673
  }, "i");
681
- return ce > 0 ? _n(u, ce) : le > 0 ? Ve(u, le) : u;
682
- }, [le, ce]), ct = d();
674
+ return ce > 0 ? Gn(u, ce) : le > 0 ? Be(u, le) : u;
675
+ }, [le, ce]), ft = v();
683
676
  w(function() {
684
- ne && he && (ct.current = Ve(function() {
685
- h.current.active();
677
+ ne && he && (ft.current = Be(function() {
678
+ f.current.active();
686
679
  }, he));
687
680
  }, [ne, he]);
688
- var x = /* @__PURE__ */ r(function() {
689
- q.current !== null && (N.clearTimeout(q.current), q.current = null);
681
+ var N = /* @__PURE__ */ r(function() {
682
+ Y.current !== null && (_.clearTimeout(Y.current), Y.current = null);
690
683
  }, "N"), Z = /* @__PURE__ */ r(function(u) {
691
684
  var S = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
692
- x(), q.current = N.setTimeout(xe, u || C.current), S && (R.current = E());
693
- }, "Z"), lt = /* @__PURE__ */ r(function(u) {
694
- !I.current && !p.current && (Ie.current(u, O), pe.current({ type: "active", prompted: !0 }, O)), P.current = 0, F.current = E(), I.current = !0, Z(X.current, !1);
695
- }, "wt"), ft = /* @__PURE__ */ r(function() {
696
- x(), p.current || (ke.current(null, O), pe.current({ type: "idle" }, O)), p.current = !0, L.current = E(), at.current ? Q() : I.current && (F.current = 0, I.current = !1);
685
+ N(), Y.current = _.setTimeout(Ne, u || C.current), S && (x.current = E());
686
+ }, "Z"), ht = /* @__PURE__ */ r(function(u) {
687
+ !I.current && !p.current && (ke.current(u, O), pe.current({ type: "active", prompted: !0 }, O)), R.current = 0, F.current = E(), I.current = !0, Z(K.current, !1);
688
+ }, "wt"), dt = /* @__PURE__ */ r(function() {
689
+ N(), p.current || (Le.current(null, O), pe.current({ type: "idle" }, O)), p.current = !0, L.current = E(), ct.current ? Q() : I.current && (F.current = 0, I.current = !1);
697
690
  }, "bt"), De = /* @__PURE__ */ r(function(u) {
698
- x(), (p.current || I.current) && (re.current(u, O), pe.current({ type: "active", prompted: !1 }, O)), I.current = !1, F.current = 0, p.current = !1, W.current += E() - L.current, de.current += E() - L.current, H(), Z();
699
- }, "ze"), xe = /* @__PURE__ */ r(function(u) {
691
+ N(), (p.current || I.current) && (re.current(u, O), pe.current({ type: "active", prompted: !1 }, O)), I.current = !1, F.current = 0, p.current = !1, $.current += E() - L.current, de.current += E() - L.current, H(), Z();
692
+ }, "ze"), Ne = /* @__PURE__ */ r(function(u) {
700
693
  var S = !p.current;
701
694
  if (S) {
702
- $.cancel && $.cancel();
703
- var oe = E() - R.current, Jt = C.current + X.current < oe;
704
- if (!Jt && X.current > 0 && !I.current) {
705
- h.current ? h.current.prompt() : lt(u);
695
+ X.cancel && X.cancel();
696
+ var oe = E() - x.current, Ft = C.current + K.current < oe;
697
+ if (!Ft && K.current > 0 && !I.current) {
698
+ f.current ? f.current.prompt() : ht(u);
706
699
  return;
707
700
  }
708
- h.current ? h.current.idle() : ft();
701
+ f.current ? f.current.idle() : dt();
709
702
  return;
710
703
  }
711
- h.current ? h.current.active() : De(u);
704
+ f.current ? f.current.active() : De(u);
712
705
  }, "Je"), je = /* @__PURE__ */ r(function(u) {
713
- if (!fe && !R.current && (R.current = E(), re.current(null, O)), $(u, O), !I.current) {
714
- if (x(), !p.current && st.current.includes(u.type)) {
715
- xe(u);
706
+ if (!fe && !x.current && (x.current = E(), re.current(null, O)), X(u, O), !I.current) {
707
+ if (N(), !p.current && lt.current.includes(u.type)) {
708
+ Ne(u);
716
709
  return;
717
710
  }
718
- var S = E() - R.current;
719
- if (p.current && !Te || !p.current && S >= C.current) {
720
- xe(u);
711
+ var S = E() - x.current;
712
+ if (p.current && !Ae || !p.current && S >= C.current) {
713
+ Ne(u);
721
714
  return;
722
715
  }
723
- J.current = !1, P.current = 0, F.current = 0, Z(), ne && he && ct.current();
716
+ J.current = !1, R.current = 0, F.current = 0, Z(), ne && he && ft.current();
724
717
  }
725
- }, "He"), Se = d(je);
718
+ }, "He"), Oe = v(je);
726
719
  w(function() {
727
720
  var u = ve.current;
728
- u && Q(), Re > 0 ? Se.current = Ve(je, Re) : Se.current = je, u && H();
729
- }, [Re, le, ce, Le, ne, he]);
721
+ u && Q(), xe > 0 ? Oe.current = Be(je, xe) : Oe.current = je, u && H();
722
+ }, [xe, le, ce, Se, ne, he]);
730
723
  var H = /* @__PURE__ */ r(function() {
731
- z && me.current && (ve.current || (Ce.current.forEach(function(u) {
732
- me.current.addEventListener(u, Se.current, { capture: !0, passive: !0 });
724
+ W && me.current && (ve.current || (Ce.current.forEach(function(u) {
725
+ me.current.addEventListener(u, Oe.current, { capture: !0, passive: !0 });
733
726
  }), ve.current = !0));
734
727
  }, "H"), Q = /* @__PURE__ */ r(function() {
735
728
  var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
736
- z && me.current && (ve.current || u) && (Ce.current.forEach(function(S) {
737
- me.current.removeEventListener(S, Se.current, { capture: !0 });
729
+ W && me.current && (ve.current || u) && (Ce.current.forEach(function(S) {
730
+ me.current.removeEventListener(S, Oe.current, { capture: !0 });
738
731
  }), ve.current = !1);
739
732
  }, "ee"), ee = g(function(u) {
740
- return D.current ? !1 : (x(), H(), p.current = !1, I.current = !1, J.current = !1, P.current = 0, F.current = 0, h.current && !u && h.current.start(), Z(), !0);
741
- }, [q, p, D, C, h]), Ne = g(function(u) {
742
- return D.current ? !1 : (x(), H(), Ae.current = E(), W.current += E() - L.current, de.current += E() - L.current, W.current = 0, p.current = !1, I.current = !1, J.current = !1, P.current = 0, F.current = 0, h.current && !u && h.current.reset(), U || Z(), !0);
743
- }, [q, p, C, U, D, h]), ht = g(function(u) {
744
- return D.current ? !1 : (x(), H(), (p.current || I.current) && De(), p.current = !1, I.current = !1, J.current = !1, P.current = 0, F.current = 0, Ae.current = E(), h.current && !u && h.current.activate(), Z(), !0);
745
- }, [q, p, I, D, C, h]), Oe = g(function() {
733
+ return D.current ? !1 : (N(), H(), p.current = !1, I.current = !1, J.current = !1, R.current = 0, F.current = 0, f.current && !u && f.current.start(), Z(), !0);
734
+ }, [Y, p, D, C, f]), _e = g(function(u) {
735
+ return D.current ? !1 : (N(), H(), Ie.current = E(), $.current += E() - L.current, de.current += E() - L.current, $.current = 0, p.current = !1, I.current = !1, J.current = !1, R.current = 0, F.current = 0, f.current && !u && f.current.reset(), z || Z(), !0);
736
+ }, [Y, p, C, z, D, f]), vt = g(function(u) {
737
+ return D.current ? !1 : (N(), H(), (p.current || I.current) && De(), p.current = !1, I.current = !1, J.current = !1, R.current = 0, F.current = 0, Ie.current = E(), f.current && !u && f.current.activate(), Z(), !0);
738
+ }, [Y, p, I, D, C, f]), Me = g(function() {
746
739
  var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
747
- return D.current || J.current ? !1 : (P.current = dt(), J.current = !0, Q(), x(), h.current && !u && h.current.pause(), !0);
748
- }, [q, D, h]), _e = g(function() {
740
+ return D.current || J.current ? !1 : (R.current = mt(), J.current = !0, Q(), N(), f.current && !u && f.current.pause(), !0);
741
+ }, [Y, D, f]), Ve = g(function() {
749
742
  var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
750
- return D.current || !J.current ? !1 : (J.current = !1, I.current || H(), p.current || Z(P.current), F.current && (F.current = E()), h.current && !u && h.current.resume(), !0);
751
- }, [q, C, D, P, h]), Dt = g(function(u, S) {
752
- return h.current ? (S && ie.current(u, O), h.current.message(u)) : S && ie.current(u, O), !0;
753
- }, [se]), xt = g(function() {
743
+ return D.current || !J.current ? !1 : (J.current = !1, I.current || H(), p.current || Z(R.current), F.current && (F.current = E()), f.current && !u && f.current.resume(), !0);
744
+ }, [Y, C, D, R, f]), Ct = g(function(u, S) {
745
+ return f.current ? (S && ie.current(u, O), f.current.message(u)) : S && ie.current(u, O), !0;
746
+ }, [se]), Dt = g(function() {
754
747
  return p.current;
755
- }, [p]), jt = g(function() {
748
+ }, [p]), Nt = g(function() {
756
749
  return I.current;
757
- }, [I]), Nt = g(function() {
758
- return h.current ? h.current.isLeader : null;
759
- }, [h]), _t = g(function() {
760
- return h.current ? h.current.isLastActive : null;
761
- }, [h]), Vt = g(function() {
762
- return h.current ? h.current.token : null;
763
- }, [h]), dt = g(function() {
764
- if (J.current) return P.current;
765
- var u = P.current ? P.current : X.current + C.current, S = R.current ? E() - R.current : 0, oe = Math.floor(u - S);
750
+ }, [I]), jt = g(function() {
751
+ return f.current ? f.current.isLeader : null;
752
+ }, [f]), _t = g(function() {
753
+ return f.current ? f.current.isLastActive : null;
754
+ }, [f]), Vt = g(function() {
755
+ return f.current ? f.current.token : null;
756
+ }, [f]), mt = g(function() {
757
+ if (J.current) return R.current;
758
+ var u = R.current ? R.current : K.current + C.current, S = x.current ? E() - x.current : 0, oe = Math.floor(u - S);
766
759
  return oe < 0 ? 0 : Math.abs(oe);
767
- }, [C, X, I, P, R]), vt = g(function() {
768
- return Math.round(E() - Ae.current);
769
- }, [Ae]), mt = g(function() {
770
- return Math.round(E() - ut.current);
771
- }, [ut]), Gt = g(function() {
760
+ }, [C, K, I, R, x]), pt = g(function() {
761
+ return Math.round(E() - Ie.current);
762
+ }, [Ie]), gt = g(function() {
763
+ return Math.round(E() - st.current);
764
+ }, [st]), Bt = g(function() {
772
765
  return L.current ? new Date(L.current) : null;
773
- }, [L]), Bt = g(function() {
774
- return R.current ? new Date(R.current) : null;
775
- }, [R]), pt = g(function() {
776
- return p.current ? Math.round(E() - L.current + W.current) : Math.round(W.current);
777
- }, [L, W]), gt = g(function() {
766
+ }, [L]), Gt = g(function() {
767
+ return x.current ? new Date(x.current) : null;
768
+ }, [x]), yt = g(function() {
769
+ return p.current ? Math.round(E() - L.current + $.current) : Math.round($.current);
770
+ }, [L, $]), Et = g(function() {
778
771
  return p.current ? Math.round(E() - L.current + de.current) : Math.round(de.current);
779
772
  }, [L, de]), Ut = g(function() {
780
- var u = Math.round(vt() - pt());
773
+ var u = Math.round(pt() - yt());
781
774
  return u >= 0 ? u : 0;
782
- }, [L, W]), Ft = g(function() {
783
- var u = Math.round(mt() - gt());
775
+ }, [L, $]), zt = g(function() {
776
+ var u = Math.round(gt() - Et());
784
777
  return u >= 0 ? u : 0;
785
- }, [L, W]);
778
+ }, [L, $]);
786
779
  w(function() {
787
780
  if (ce > 0 && le > 0) throw new Error("❌ onAction can either be throttled or debounced, not both.");
788
- V && Sn(V);
781
+ B && Pn(B);
789
782
  var u = /* @__PURE__ */ r(function() {
790
- h.current && h.current.close(), $.cancel && $.cancel(), x(), Q(!0);
783
+ f.current && f.current.close(), X.cancel && X.cancel(), N(), Q(!0);
791
784
  }, "i");
792
- return z && window.addEventListener("beforeunload", u), function() {
793
- z && window.removeEventListener("beforeunload", u), h.current && h.current.close(), $.cancel && $.cancel(), x(), Q(!0);
785
+ return W && window.addEventListener("beforeunload", u), function() {
786
+ W && window.removeEventListener("beforeunload", u), f.current && f.current.close(), X.cancel && X.cancel(), N(), Q(!0);
794
787
  };
795
788
  }, []), w(function() {
796
- h.current && h.current.close(), ne ? h.current = new xn({ channelName: tt, leaderElection: it, onPrompt: /* @__PURE__ */ r(function() {
797
- lt();
789
+ f.current && f.current.close(), ne ? f.current = new _n({ channelName: rt, leaderElection: ut, onPrompt: /* @__PURE__ */ r(function() {
790
+ ht();
798
791
  }, "onPrompt"), onIdle: /* @__PURE__ */ r(function() {
799
- ft();
792
+ dt();
800
793
  }, "onIdle"), onActive: /* @__PURE__ */ r(function() {
801
794
  De();
802
795
  }, "onActive"), onMessage: /* @__PURE__ */ r(function(u) {
803
796
  ie.current(u, O);
804
- }, "onMessage"), start: ee, reset: Ne, activate: ht, pause: Oe, resume: _e }) : h.current = null;
805
- }, [ne, tt, it, Ie, ke, re, ie, ee, Ne, Oe, _e]), w(function() {
806
- Y.current || (x(), Q(!0)), !(U || B) && (fe ? ee() : H());
807
- }, [U, fe, B, Y]), w(function() {
808
- if (!Y.current) {
797
+ }, "onMessage"), start: ee, reset: _e, activate: vt, pause: Me, resume: Ve }) : f.current = null;
798
+ }, [ne, rt, ut, ke, Le, re, ie, ee, _e, Me, Ve]), w(function() {
799
+ q.current || (N(), Q(!0)), !(z || U) && (fe ? ee() : H());
800
+ }, [z, fe, U, q]), w(function() {
801
+ if (!q.current) {
809
802
  var u = j(new Set(j(y).concat(j(A))).values());
810
- if (Q(), Ce.current = u, me.current = c, st.current = A, U || B) return;
803
+ if (Q(), Ce.current = u, me.current = c, lt.current = A, z || U) return;
811
804
  fe ? ee() : H();
812
805
  }
813
- }, [c, JSON.stringify(y), JSON.stringify(A), Y, B, U, fe]), w(function() {
814
- Y.current && (Y.current = !1);
815
- }, [Y]);
816
- var O = { message: Dt, start: ee, reset: Ne, activate: ht, pause: Oe, resume: _e, isIdle: xt, isPrompted: jt, isLeader: Nt, isLastActiveTab: _t, getTabId: Vt, getRemainingTime: dt, getElapsedTime: vt, getTotalElapsedTime: mt, getLastIdleTime: Gt, getLastActiveTime: Bt, getIdleTime: pt, getTotalIdleTime: gt, getActiveTime: Ut, getTotalActiveTime: Ft, setOnPresenceChange: /* @__PURE__ */ r(function(u) {
806
+ }, [c, JSON.stringify(y), JSON.stringify(A), q, U, z, fe]), w(function() {
807
+ q.current && (q.current = !1);
808
+ }, [q]);
809
+ var O = { message: Ct, start: ee, reset: _e, activate: vt, pause: Me, resume: Ve, isIdle: Dt, isPrompted: Nt, isLeader: jt, isLastActiveTab: _t, getTabId: Vt, getRemainingTime: mt, getElapsedTime: pt, getTotalElapsedTime: gt, getLastIdleTime: Bt, getLastActiveTime: Gt, getIdleTime: yt, getTotalIdleTime: Et, getActiveTime: Ut, getTotalActiveTime: zt, setOnPresenceChange: /* @__PURE__ */ r(function(u) {
817
810
  G = u, pe.current = u;
818
811
  }, "setOnPresenceChange"), setOnPrompt: /* @__PURE__ */ r(function(u) {
819
- ye = u, Ie.current = u;
820
- }, "setOnPrompt"), setOnIdle: /* @__PURE__ */ r(function(u) {
821
812
  Ee = u, ke.current = u;
813
+ }, "setOnPrompt"), setOnIdle: /* @__PURE__ */ r(function(u) {
814
+ be = u, Le.current = u;
822
815
  }, "setOnIdle"), setOnActive: /* @__PURE__ */ r(function(u) {
823
- be = u, re.current = u;
816
+ we = u, re.current = u;
824
817
  }, "setOnActive"), setOnAction: /* @__PURE__ */ r(function(u) {
825
- we = u, Le.current = u;
818
+ Te = u, Se.current = u;
826
819
  }, "setOnAction"), setOnMessage: /* @__PURE__ */ r(function(u) {
827
820
  se = u, ie.current = u;
828
821
  }, "setOnMessage") };
829
822
  return O;
830
823
  }
831
- r(Vn, "Te");
832
- var Gn = kt(null);
833
- Gn.Consumer;
834
- const Tt = 6e4, Bn = 36e5, At = "/auth/login";
835
- function Un(e) {
836
- return Me(e) ? Math.floor(e / 1e3) : "";
837
- }
838
- r(Un, "millisToSeconds");
839
- function er({ timeout: e }) {
840
- const t = an(), { pathname: n } = sn(), { t: i } = on(), { confirmInfo: o } = un(), { resetStorage: l } = It(), [s, a] = Et(!1), [c, f] = Et(null), y = d(!1), { getRemainingTime: _, reset: V } = Vn({
841
- timeout: e ?? Bn,
824
+ r(Un, "Te");
825
+ var zn = Zt(null);
826
+ zn.Consumer;
827
+ const Tt = 6e4, Fn = 36e5, At = "/auth/login";
828
+ function Jn(e) {
829
+ return Pe(e) ? Math.floor(e / 1e3) : "";
830
+ }
831
+ r(Jn, "millisToSeconds");
832
+ function ur({ timeout: e }) {
833
+ const t = un(), { pathname: n } = an(), { t: i } = kt(), { confirmInfo: o } = nn(), { resetStorage: h } = on(), [s, a] = Ge(!1), [c, l] = Ge(null), y = v(!1), { getRemainingTime: V, reset: B } = Un({
834
+ timeout: e ?? Fn,
842
835
  events: [
843
836
  "mousemove",
844
837
  "keydown",
@@ -856,37 +849,37 @@ function er({ timeout: e }) {
856
849
  });
857
850
  w(() => {
858
851
  const m = setInterval(() => {
859
- f(_());
852
+ l(V());
860
853
  }, 500);
861
854
  return () => {
862
855
  clearInterval(m);
863
856
  };
864
- }, [_]);
857
+ }, [V]);
865
858
  const T = g(() => {
866
- a(!1), V();
867
- }, [V]), A = g(async () => {
868
- y.current || (y.current = !0, f(null), a(!1), await o({
859
+ a(!1), B();
860
+ }, [B]), A = g(async () => {
861
+ y.current || (y.current = !0, l(null), a(!1), await o({
869
862
  title: i("Message.로그인 페이지로 이동합니다.", {
870
863
  defaultValue: "로그인 페이지로 이동합니다."
871
864
  })
872
- }), l(), t(At));
873
- }, [o, t, l, i]);
865
+ }), h(), t(At));
866
+ }, [o, t, h, i]);
874
867
  return w(() => {
875
868
  if (n === At) {
876
869
  a(!1);
877
870
  return;
878
871
  }
879
- if (!s && Me(c) && c > 0 && c <= Tt) {
872
+ if (!s && Pe(c) && c > 0 && c <= Tt) {
880
873
  a(!0);
881
874
  return;
882
875
  }
883
- if (s && Me(c) && c > Tt) {
876
+ if (s && Pe(c) && c > Tt) {
884
877
  T();
885
878
  return;
886
879
  }
887
- Me(c) && c <= 0 && A();
888
- }, [s, c, n, T, A]), /* @__PURE__ */ K(
889
- Ue,
880
+ Pe(c) && c <= 0 && A();
881
+ }, [s, c, n, T, A]), /* @__PURE__ */ P(
882
+ Fe,
890
883
  {
891
884
  title: i("Title.로그인 연장", { defaultValue: "로그인 연장" }),
892
885
  canConfirm: !1,
@@ -894,25 +887,89 @@ function er({ timeout: e }) {
894
887
  onClose: /* @__PURE__ */ r(() => T(), "onClose"),
895
888
  maxWidth: "xs",
896
889
  fullWidth: !0,
897
- children: /* @__PURE__ */ K(nn, { variant: "h6", children: i("Message.자동 로그아웃 남은 시간 안내", {
890
+ children: /* @__PURE__ */ P(It, { variant: "h6", children: i("Message.자동 로그아웃 남은 시간 안내", {
898
891
  defaultValue: "{{seconds}}초 후 로그인 페이지로 이동합니다.",
899
- seconds: Un(c)
892
+ seconds: Jn(c)
900
893
  }) })
901
894
  }
902
895
  );
903
896
  }
904
- r(er, "OwpAutoLogoutDialog");
905
- const tr = cn(/* @__PURE__ */ qt.jsx("path", {
897
+ r(ur, "OwpAutoLogoutDialog");
898
+ function xt(e) {
899
+ var t, n, i = "";
900
+ if (typeof e == "string" || typeof e == "number") i += e;
901
+ else if (typeof e == "object") if (Array.isArray(e)) {
902
+ var o = e.length;
903
+ for (t = 0; t < o; t++) e[t] && (n = xt(e[t])) && (i && (i += " "), i += n);
904
+ } else for (n in e) e[n] && (i && (i += " "), i += n);
905
+ return i;
906
+ }
907
+ r(xt, "r");
908
+ function qn() {
909
+ for (var e, t, n = 0, i = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = xt(e)) && (i && (i += " "), i += t);
910
+ return i;
911
+ }
912
+ r(qn, "clsx");
913
+ function ar(e) {
914
+ const { delay: t = 0, className: n } = e, [i, o] = Ge(!t);
915
+ return rn(() => {
916
+ o(!0);
917
+ }, t), /* @__PURE__ */ ge(
918
+ "div",
919
+ {
920
+ className: qn(
921
+ n,
922
+ "flex flex-1 h-full w-full self-center flex-col items-center justify-center p-24",
923
+ i ? "" : "hidden"
924
+ ),
925
+ children: [
926
+ /* @__PURE__ */ P(cn, { className: "-mb-16 text-md font-medium sm:text-xl", color: "text.secondary" }),
927
+ /* @__PURE__ */ ge(
928
+ sn,
929
+ {
930
+ id: "spinner",
931
+ sx: {
932
+ "& > div": {
933
+ backgroundColor: "palette.secondary.main"
934
+ }
935
+ },
936
+ children: [
937
+ /* @__PURE__ */ P("div", { className: "bounce1" }),
938
+ /* @__PURE__ */ P("div", { className: "bounce2" }),
939
+ /* @__PURE__ */ P("div", { className: "bounce3" })
940
+ ]
941
+ }
942
+ )
943
+ ]
944
+ }
945
+ );
946
+ }
947
+ r(ar, "OwpLoading");
948
+ const sr = /* @__PURE__ */ r(({ loading: e, title: t }) => {
949
+ const { t: n } = kt(), i = t ?? n("Common.로딩 중...");
950
+ return /* @__PURE__ */ ge(
951
+ ln,
952
+ {
953
+ className: "flex flex-1 flex-col space-y-12",
954
+ sx: /* @__PURE__ */ r((o) => ({ color: "#fff", zIndex: o.zIndex.tooltip + 1 }), "sx"),
955
+ open: !!e,
956
+ children: [
957
+ /* @__PURE__ */ P(fn, { color: "inherit" }),
958
+ i && /* @__PURE__ */ P(It, { variant: "h6", children: i })
959
+ ]
960
+ }
961
+ );
962
+ }, "OwpPageLockLoading"), cr = hn(/* @__PURE__ */ qt.jsx("path", {
906
963
  d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
907
964
  }), "Close");
908
965
  export {
909
- tr as C,
910
- $n as O,
911
- er as a,
912
- Lt as b,
913
- Ue as c,
914
- Qn as d,
915
- Me as i,
916
- Zn as u
966
+ cr as C,
967
+ ar as O,
968
+ sr as a,
969
+ ur as b,
970
+ qn as c,
971
+ Fe as d,
972
+ or as e,
973
+ Pe as i
917
974
  };
918
- //# sourceMappingURL=Close-DnXhM4Ms.js.map
975
+ //# sourceMappingURL=Close-DnXyQZKh.js.map