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