@owp/core 1.26.0 → 1.28.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 (138) 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-DnXhM4Ms.js +918 -0
  5. package/dist/Close-DnXhM4Ms.js.map +1 -0
  6. package/dist/{OwpStoreProvider-CqHkIIUm.js → OwpStoreProvider-B7W25pkq.js} +13 -13
  7. package/dist/OwpStoreProvider-B7W25pkq.js.map +1 -0
  8. package/dist/{OwpUtils-DxEd-Pjo.js → OwpUtils-9lHSCdan.js} +10 -17
  9. package/dist/OwpUtils-9lHSCdan.js.map +1 -0
  10. package/dist/{QuickPanel-DNAisp_R.js → QuickPanel-BOgEYOAw.js} +2 -2
  11. package/dist/{QuickPanel-DNAisp_R.js.map → QuickPanel-BOgEYOAw.js.map} +1 -1
  12. package/dist/context.js +67 -22
  13. package/dist/context.js.map +1 -1
  14. package/dist/hooks.js +45 -42
  15. package/dist/hooks.js.map +1 -1
  16. package/dist/{index-fDrAKBzK.js → index-B8tZAW8i.js} +13558 -15484
  17. package/dist/index-B8tZAW8i.js.map +1 -0
  18. package/dist/index.js +120 -128
  19. package/dist/index.js.map +1 -1
  20. package/dist/{isTypedArray-DPyC49cI.js → isTypedArray-xp-fB7W4.js} +3 -3
  21. package/dist/{isTypedArray-DPyC49cI.js.map → isTypedArray-xp-fB7W4.js.map} +1 -1
  22. package/dist/{lazyLoadedSlices-CsgnywgU.js → lazyLoadedSlices-BAbcXcEU.js} +678 -701
  23. package/dist/lazyLoadedSlices-BAbcXcEU.js.map +1 -0
  24. package/dist/owp-app.css +1 -1
  25. package/dist/store.js +1 -1
  26. package/dist/{toUpper-BhzrnIm3.js → toUpper-CilZrxEa.js} +2 -2
  27. package/dist/{toUpper-BhzrnIm3.js.map → toUpper-CilZrxEa.js.map} +1 -1
  28. package/dist/{treeGridUtil-DaqTz5v3.js → treeGridUtil-_FDvRzzt.js} +2 -2
  29. package/dist/{treeGridUtil-DaqTz5v3.js.map → treeGridUtil-_FDvRzzt.js.map} +1 -1
  30. package/dist/types/components/OwpCommonDialog/OwpCommonDialog.d.ts +1 -26
  31. package/dist/types/components/OwpDialog/OwpDialog.d.ts +32 -6
  32. package/dist/types/components/OwpDialog/index.d.ts +1 -4
  33. package/dist/types/components/{ErrorBoundary/ErrorBoundary.d.ts → OwpErrorBoundary/OwpErrorBoundary.d.ts} +5 -5
  34. package/dist/types/components/OwpErrorBoundary/index.d.ts +1 -0
  35. package/dist/types/components/OwpEventEmitter/OwpEventEmitter.d.ts +27 -0
  36. package/dist/types/components/OwpEventEmitter/index.d.ts +1 -0
  37. package/dist/types/components/OwpLanguageSwitcherSelect/index.d.ts +1 -0
  38. package/dist/types/components/OwpMrtTable/OwpMrtTable.d.ts +7 -3
  39. package/dist/types/components/OwpMrtTable/OwpMrtTableTopToolbar.d.ts +6 -0
  40. package/dist/types/components/OwpNavLinkAdapter/OwpNavLinkAdapter.d.ts +16 -0
  41. package/dist/types/components/OwpNavLinkAdapter/index.d.ts +2 -0
  42. package/dist/types/components/OwpNavigation/horizontal/types/OwpNavHorizontalGroup.d.ts +1 -2
  43. package/dist/types/components/OwpNavigation/horizontal/types/OwpNavHorizontalItem.d.ts +1 -2
  44. package/dist/types/components/OwpNavigation/horizontal/types/OwpNavHorizontalLink.d.ts +1 -2
  45. package/dist/types/components/{shared-components/PageBreadcrumb.d.ts → OwpPageBreadcrumb/OwpPageBreadcrumb.d.ts} +1 -1
  46. package/dist/types/components/OwpPageBreadcrumb/index.d.ts +2 -0
  47. package/dist/types/components/OwpSettings/OwpLayoutConfig.d.ts +1 -1
  48. package/dist/types/components/OwpStyleProvider/OwpStyleProvider.d.ts +18 -0
  49. package/dist/types/components/OwpStyleProvider/index.d.ts +2 -0
  50. package/dist/types/components/OwpTable/OwpTable.d.ts +1 -1
  51. package/dist/types/components/{shared-components/tabs → OwpTabs}/OwpTab.d.ts +1 -1
  52. package/dist/types/components/{shared-components/tabs → OwpTabs}/OwpTabs.d.ts +1 -1
  53. package/dist/types/components/OwpTabs/index.d.ts +2 -0
  54. package/dist/types/components/OwpTreeGrid/OwpTreeGridToolbar.d.ts +1 -1
  55. package/dist/types/components/layouts/shared-components/navigation/store/navigationSlice.d.ts +9 -9
  56. package/dist/types/context/OwpAppProvider.d.ts +5 -3
  57. package/dist/types/context/OwpCoreProvider.d.ts +1 -1
  58. package/dist/types/{store → context}/OwpStoreProvider.d.ts +1 -1
  59. package/dist/types/context/OwpUiProvider.d.ts +17 -0
  60. package/dist/types/context/index.d.ts +2 -0
  61. package/dist/types/hooks/useStorage.d.ts +10 -1
  62. package/dist/types/index.d.ts +7 -17
  63. package/dist/types/store/apiService.d.ts +3 -0
  64. package/dist/types/store/generateReducersFromSlices.d.ts +4 -1
  65. package/dist/types/store/hooks.d.ts +3 -0
  66. package/dist/types/store/index.d.ts +4 -1
  67. package/dist/types/store/lazyLoadedSlices.d.ts +3 -0
  68. package/dist/types/store/middleware.d.ts +3 -0
  69. package/dist/types/store/store.d.ts +3 -0
  70. package/dist/types/store/withSlices.d.ts +2 -2
  71. package/dist/types/utils/common/OwpUtils.d.ts +3 -4
  72. package/dist/types/utils/createDateRangeSearchParams.d.ts +16 -0
  73. package/dist/types/utils/fetchFile.d.ts +12 -0
  74. package/dist/types/utils/getTrimmedValue.d.ts +5 -0
  75. package/dist/types/utils/index.d.ts +4 -0
  76. package/dist/types/utils/sanitizeAuthInputValue.d.ts +10 -0
  77. package/dist/useOwpTranslation-BelpX-fd.js +174 -0
  78. package/dist/useOwpTranslation-BelpX-fd.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-QNcWzx5v.js +195 -0
  82. package/dist/useTreeGridExcelExport-QNcWzx5v.js.map +1 -0
  83. package/dist/utils.js +2068 -2023
  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 +4 -2
  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/OwpAppProvider-F48yHfyI.js +0 -22
  92. package/dist/OwpAppProvider-F48yHfyI.js.map +0 -1
  93. package/dist/OwpStoreProvider-CqHkIIUm.js.map +0 -1
  94. package/dist/OwpUtils-DxEd-Pjo.js.map +0 -1
  95. package/dist/index-fDrAKBzK.js.map +0 -1
  96. package/dist/lazyLoadedSlices-CsgnywgU.js.map +0 -1
  97. package/dist/types/auth/authRoles.d.ts +0 -21
  98. package/dist/types/components/ErrorBoundary/index.d.ts +0 -1
  99. package/dist/types/components/EventEmitter/EventEmitter.d.ts +0 -34
  100. package/dist/types/components/EventEmitter/index.d.ts +0 -1
  101. package/dist/types/components/NavLinkAdapter/NavLinkAdapter.d.ts +0 -18
  102. package/dist/types/components/NavLinkAdapter/index.d.ts +0 -1
  103. package/dist/types/components/OwpButtonDelete/OwpButtonDelete.d.ts +0 -12
  104. package/dist/types/components/OwpButtonDelete/index.d.ts +0 -1
  105. package/dist/types/components/OwpButtonSave/OwpButtonSave.d.ts +0 -12
  106. package/dist/types/components/OwpButtonSave/index.d.ts +0 -1
  107. package/dist/types/components/OwpDialog/owpDialogSlice.d.ts +0 -14
  108. package/dist/types/components/OwpMessage/OwpMessage.d.ts +0 -11
  109. package/dist/types/components/OwpMessage/index.d.ts +0 -4
  110. package/dist/types/components/OwpMessage/owpMessageSlice.d.ts +0 -14
  111. package/dist/types/components/OwpPageSimple/OwpPageSimple.d.ts +0 -55
  112. package/dist/types/components/OwpPageSimple/OwpPageSimpleHeader.d.ts +0 -14
  113. package/dist/types/components/OwpPageSimple/OwpPageSimpleSidebar.d.ts +0 -19
  114. package/dist/types/components/OwpPageSimple/OwpPageSimpleSidebarContent.d.ts +0 -13
  115. package/dist/types/components/OwpPageSimple/index.d.ts +0 -1
  116. package/dist/types/components/OwpTreeView/OwpSlotTreeView.d.ts +0 -27
  117. package/dist/types/components/OwpTreeView/index.d.ts +0 -1
  118. package/dist/types/components/layouts/shared-components/AdjustFontSize.d.ts +0 -8
  119. package/dist/types/components/layouts/shared-components/OwpSettingsViewerDialog.d.ts +0 -8
  120. package/dist/types/components/layouts/shared-components/configurator/Configurator.d.ts +0 -9
  121. package/dist/types/components/layouts/shared-components/configurator/SettingsPanel.d.ts +0 -12
  122. package/dist/types/components/layouts/shared-components/configurator/ThemesPanel.d.ts +0 -12
  123. package/dist/types/components/shared-components/LightDarkModeToggle.d.ts +0 -8
  124. package/dist/types/components/shared-components/PageTitle.d.ts +0 -11
  125. package/dist/types/components/shared-components/data-table/DataTable.d.ts +0 -12
  126. package/dist/types/components/shared-components/data-table/DataTableTopToolbar.d.ts +0 -6
  127. package/dist/types/components/shared-components/index.d.ts +0 -7
  128. package/dist/types/components/withRouter/index.d.ts +0 -1
  129. package/dist/types/components/withRouter/withRouter.d.ts +0 -14
  130. package/dist/types/components/withRouterAndRef/index.d.ts +0 -1
  131. package/dist/types/components/withRouterAndRef/withRouterAndRef.d.ts +0 -14
  132. package/dist/types/store/withReducer.d.ts +0 -5
  133. package/dist/useStorage-B4ZrPct1.js +0 -65
  134. package/dist/useStorage-B4ZrPct1.js.map +0 -1
  135. package/dist/useTreeGridExcelExport-BjyBdpz1.js +0 -360
  136. package/dist/useTreeGridExcelExport-BjyBdpz1.js.map +0 -1
  137. /package/dist/types/components/{layouts/shared-components → OwpLanguageSwitcherSelect}/OwpLanguageSwitcherSelect.d.ts +0 -0
  138. /package/dist/types/components/{shared-components/data-table → OwpMrtTable}/utils/parseFromValuesOrFunc.d.ts +0 -0
@@ -0,0 +1,918 @@
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) {
23
+ return typeof e == "number" || e instanceof Number;
24
+ }
25
+ r(Me, "isNumber");
26
+ const Ue = Ht(
27
+ ({
28
+ title: e,
29
+ children: t,
30
+ canCancel: n = !0,
31
+ canConfirm: i = !0,
32
+ onConfirm: o,
33
+ onCancel: l,
34
+ onClose: s,
35
+ useSubmit: a,
36
+ actions: c,
37
+ contentProps: f,
38
+ ...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(
41
+ i ? T.exists("button.cancel") ? "button.cancel" : "Button.취소" : "Button.닫기",
42
+ { defaultValue: i ? "취소" : "닫기" }
43
+ );
44
+ return /* @__PURE__ */ yt(
45
+ Qt,
46
+ {
47
+ ref: _,
48
+ fullWidth: !0,
49
+ component: a ? "form" : void 0,
50
+ onClose: /* @__PURE__ */ r((G, k) => {
51
+ k !== "backdropClick" && (s == null || s(G, k));
52
+ }, "onClose"),
53
+ ...y,
54
+ 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(
60
+ bt,
61
+ {
62
+ variant: "outlined",
63
+ onClick: /* @__PURE__ */ r(() => {
64
+ if (typeof l == "function") {
65
+ l();
66
+ return;
67
+ }
68
+ s == null || s({}, "escapeKeyDown");
69
+ }, "onClick"),
70
+ children: m
71
+ }
72
+ ),
73
+ i && /* @__PURE__ */ K(
74
+ bt,
75
+ {
76
+ variant: "contained",
77
+ color: "secondary",
78
+ type: a ? "submit" : "button",
79
+ onClick: /* @__PURE__ */ r(() => {
80
+ if (!a) {
81
+ if (typeof o == "function") {
82
+ o();
83
+ return;
84
+ }
85
+ s == null || s({}, "escapeKeyDown");
86
+ }
87
+ }, "onClick"),
88
+ children: A
89
+ }
90
+ )
91
+ ] })
92
+ ]
93
+ }
94
+ );
95
+ }
96
+ );
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) {
100
+ return function() {
101
+ return t || e((t = { exports: {} }).exports, t), t.exports;
102
+ };
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) {
105
+ return t[c];
106
+ }).bind(null, a), enumerable: !(i = fn(t, a)) || i.enumerable });
107
+ 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) {
111
+ (function(n, i) {
112
+ 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
+ })(e, function(n) {
114
+ var i = /* @__PURE__ */ r(function(T) {
115
+ return function(A) {
116
+ var m = T(A);
117
+ return A.add(m), m;
118
+ };
119
+ }, "r"), o = /* @__PURE__ */ r(function(T) {
120
+ return function(A, m) {
121
+ return T.set(A, m), m;
122
+ };
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) {
124
+ return function(m) {
125
+ var G = A.get(m), k = G === void 0 ? m.size : G < a ? G + 1 : 0;
126
+ if (!m.has(k)) return T(m, k);
127
+ if (m.size < s) {
128
+ for (; m.has(k); ) k = Math.floor(Math.random() * a);
129
+ return T(m, k);
130
+ }
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);
133
+ return T(m, k);
134
+ };
135
+ }, "s"), f = /* @__PURE__ */ new WeakMap(), y = o(f), _ = c(y, f), V = i(_);
136
+ n.addUniqueNumber = V, n.generateUniqueNumber = _;
137
+ });
138
+ });
139
+ function te(e) {
140
+ if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
141
+ return e;
142
+ }
143
+ 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);
146
+ }
147
+ r(Ot, "je");
148
+ function ge(e, t) {
149
+ if (!Ot(e, t)) throw new TypeError("Cannot call a class as a function");
150
+ }
151
+ r(ge, "z");
152
+ function Ge(e, t) {
153
+ return Ge = Object.setPrototypeOf || function(n, i) {
154
+ return n.__proto__ = i, n;
155
+ }, Ge(e, t);
156
+ }
157
+ r(Ge, "De");
158
+ function Mt(e, t) {
159
+ 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);
161
+ }
162
+ r(Mt, "Ke");
163
+ function b(e, t, n) {
164
+ return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
165
+ }
166
+ r(b, "h");
167
+ function Pe(e) {
168
+ return Pe = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) {
169
+ return t.__proto__ || Object.getPrototypeOf(t);
170
+ }, Pe(e);
171
+ }
172
+ r(Pe, "be");
173
+ function En() {
174
+ if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
175
+ if (typeof Proxy == "function") return !0;
176
+ try {
177
+ return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
178
+ })), !0;
179
+ } catch {
180
+ return !1;
181
+ }
182
+ }
183
+ r(En, "Pt");
184
+ function Pt(e) {
185
+ "@swc/helpers - typeof";
186
+ return e && typeof Symbol < "u" && e.constructor === Symbol ? "symbol" : typeof e;
187
+ }
188
+ r(Pt, "Ne");
189
+ function bn(e, t) {
190
+ return t && (Pt(t) === "object" || typeof t == "function") ? t : te(e);
191
+ }
192
+ r(bn, "kt");
193
+ function Rt(e) {
194
+ var t = En();
195
+ return function() {
196
+ var n = Pe(e), i;
197
+ if (t) {
198
+ var o = Pe(this).constructor;
199
+ i = Reflect.construct(n, arguments, o);
200
+ } else i = n.apply(this, arguments);
201
+ return bn(this, i);
202
+ };
203
+ }
204
+ r(Rt, "Ze");
205
+ var wn = function(e) {
206
+ Mt(n, e);
207
+ var t = Rt(n);
208
+ function n() {
209
+ return ge(this, n), t.apply(this, arguments);
210
+ }
211
+ return r(n, "t"), n;
212
+ }(Xt);
213
+ (function(e) {
214
+ Mt(n, e);
215
+ var t = Rt(n);
216
+ function n(i) {
217
+ ge(this, n);
218
+ var o;
219
+ 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
+ }
221
+ return r(n, "t"), n;
222
+ })(wn);
223
+ function Be(e, t) {
224
+ (t == null || t > e.length) && (t = e.length);
225
+ for (var n = 0, i = new Array(t); n < t; n++) i[n] = e[n];
226
+ return i;
227
+ }
228
+ r(Be, "Ee");
229
+ function Tn(e) {
230
+ if (Array.isArray(e)) return Be(e);
231
+ }
232
+ r(Tn, "At");
233
+ function An(e) {
234
+ if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
235
+ }
236
+ r(An, "Rt");
237
+ function In() {
238
+ throw new TypeError(`Invalid attempt to spread non-iterable instance.
239
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
240
+ }
241
+ r(In, "Mt");
242
+ function kn(e, t) {
243
+ if (e) {
244
+ if (typeof e == "string") return Be(e, t);
245
+ var n = Object.prototype.toString.call(e).slice(8, -1);
246
+ 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);
248
+ }
249
+ }
250
+ r(kn, "Ct");
251
+ function j(e) {
252
+ return Tn(e) || An(e) || kn(e) || In();
253
+ }
254
+ r(j, "O");
255
+ function Ln(e, t) {
256
+ for (var n = 0; n < t.length; n++) {
257
+ var i = t[n];
258
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
259
+ }
260
+ }
261
+ r(Ln, "jt");
262
+ function Fe(e, t, n) {
263
+ return t && Ln(e.prototype, t), e;
264
+ }
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;
270
+ }
271
+ r(Sn, "Jt");
272
+ var ue = {}, On = function() {
273
+ 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);
275
+ }
276
+ return r(e, "e"), Fe(e, [{ key: "onStorage", value: /* @__PURE__ */ r(function(t) {
277
+ if (t.storageArea === window.localStorage && t.key.substring(0, this.name.length) === this.name && t.newValue !== null) {
278
+ var n = JSON.parse(t.newValue);
279
+ this.mc.port2.postMessage(n);
280
+ }
281
+ }, "value") }, { key: "postMessage", value: /* @__PURE__ */ r(function(t) {
282
+ var n = this;
283
+ if (this.closed) throw new Error("InvalidStateError");
284
+ 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() {
286
+ window.localStorage.removeItem(o);
287
+ }, 500), ue[this.name].forEach(function(l) {
288
+ l !== n && l.mc.port2.postMessage(JSON.parse(i));
289
+ });
290
+ }, "value") }, { key: "close", value: /* @__PURE__ */ r(function() {
291
+ if (!this.closed) {
292
+ this.closed = !0, this.mc.port1.close(), this.mc.port2.close(), window.removeEventListener("storage", this.onStorage);
293
+ var t = ue[this.name].indexOf(this);
294
+ ue[this.name].splice(t, 1);
295
+ }
296
+ }, "value") }, { key: "onmessage", get: /* @__PURE__ */ r(function() {
297
+ return this.mc.port1.onmessage;
298
+ }, "get"), set: /* @__PURE__ */ r(function(t) {
299
+ this.mc.port1.onmessage = t;
300
+ }, "set") }, { key: "onmessageerror", get: /* @__PURE__ */ r(function() {
301
+ return this.mc.port1.onmessageerror;
302
+ }, "get"), set: /* @__PURE__ */ r(function(t) {
303
+ this.mc.port1.onmessageerror = t;
304
+ }, "set") }, { key: "addEventListener", value: /* @__PURE__ */ r(function(t, n) {
305
+ return this.mc.port1.addEventListener(t, n);
306
+ }, "value") }, { key: "removeEventListener", value: /* @__PURE__ */ r(function(t, n) {
307
+ return this.mc.port1.removeEventListener(t, n);
308
+ }, "value") }, { key: "dispatchEvent", value: /* @__PURE__ */ r(function(t) {
309
+ return this.mc.port1.dispatchEvent(t);
310
+ }, "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) {
313
+ try {
314
+ var a = e[l](s), c = a.value;
315
+ } catch (f) {
316
+ n(f);
317
+ return;
318
+ }
319
+ a.done ? t(c) : Promise.resolve(c).then(i, o);
320
+ }
321
+ r(wt, "Xt");
322
+ function Pn(e) {
323
+ return function() {
324
+ var t = this, n = arguments;
325
+ return new Promise(function(i, o) {
326
+ var l = e.apply(t, n);
327
+ function s(c) {
328
+ wt(l, i, o, s, a, "next", c);
329
+ }
330
+ r(s, "s");
331
+ function a(c) {
332
+ wt(l, i, o, s, a, "throw", c);
333
+ }
334
+ r(a, "a"), s(void 0);
335
+ });
336
+ };
337
+ }
338
+ r(Pn, "$t");
339
+ function Rn(e, t) {
340
+ var n = /* @__PURE__ */ r(function(f) {
341
+ return function(y) {
342
+ return i([f, y]);
343
+ };
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]) {
349
+ case 0:
350
+ case 1:
351
+ a = f;
352
+ break;
353
+ case 4:
354
+ return o.label++, { value: f[1], done: !1 };
355
+ case 5:
356
+ o.label++, s = f[1], f = [0];
357
+ continue;
358
+ case 7:
359
+ f = o.ops.pop(), o.trys.pop();
360
+ continue;
361
+ default:
362
+ if (a = o.trys, !(a = a.length > 0 && a[a.length - 1]) && (f[0] === 6 || f[0] === 2)) {
363
+ o = 0;
364
+ continue;
365
+ }
366
+ if (f[0] === 3 && (!a || f[1] > a[0] && f[1] < a[3])) {
367
+ o.label = f[1];
368
+ break;
369
+ }
370
+ if (f[0] === 6 && o.label < a[1]) {
371
+ o.label = a[1], a = f;
372
+ break;
373
+ }
374
+ if (a && o.label < a[2]) {
375
+ o.label = a[2], o.ops.push(f);
376
+ break;
377
+ }
378
+ a[2] && o.ops.pop(), o.trys.pop();
379
+ continue;
380
+ }
381
+ f = t.call(e, o);
382
+ } catch (y) {
383
+ f = [6, y], s = 0;
384
+ } finally {
385
+ l = a = 0;
386
+ }
387
+ if (f[0] & 5) throw f[1];
388
+ return { value: f[0] ? f[1] : void 0, done: !0 };
389
+ }, "o"), o = { label: 0, sent: /* @__PURE__ */ r(function() {
390
+ if (a[0] & 1) throw a[1];
391
+ return a[1];
392
+ }, "sent"), trys: [], ops: [] }, l, s, a, c;
393
+ return c = { next: n(0), throw: n(1), return: n(2) }, typeof Symbol == "function" && (c[Symbol.iterator] = function() {
394
+ return this;
395
+ }), c;
396
+ }
397
+ r(Rn, "Ve");
398
+ function Cn() {
399
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
400
+ return new Promise(function(t) {
401
+ return N.setTimeout(t, e);
402
+ });
403
+ }
404
+ r(Cn, "Kt");
405
+ function Ct() {
406
+ return Math.random().toString(36).substring(2);
407
+ }
408
+ r(Ct, "Ge");
409
+ var v;
410
+ (function(e) {
411
+ 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() {
414
+ 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);
416
+ }
417
+ return r(e, "e"), Fe(e, [{ key: "apply", value: /* @__PURE__ */ r(function() {
418
+ var t = this;
419
+ return Pn(function() {
420
+ var n, i;
421
+ return Rn(this, function(o) {
422
+ switch (o.label) {
423
+ case 0:
424
+ if (t.isLeader) return [2, !1];
425
+ if (t.isDead) return [2, !1];
426
+ 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));
430
+ }, "n"), t.channel.addEventListener("message", i), o.label = 1;
431
+ case 1:
432
+ return o.trys.push([1, 3, , 4]), t.sendAction(v.APPLY), [4, Cn(t.options.responseTime)];
433
+ case 2:
434
+ return o.sent(), t.channel.removeEventListener("message", i), t.isApplying = !1, n ? t.reApply ? [2, t.apply()] : [2, !1] : (t.assumeLead(), [2, !0]);
435
+ case 3:
436
+ return o.sent(), [2, !1];
437
+ case 4:
438
+ return [2];
439
+ }
440
+ });
441
+ })();
442
+ }, "value") }, { key: "awaitLeadership", value: /* @__PURE__ */ r(function() {
443
+ var t = this;
444
+ if (this.isLeader) return Promise.resolve();
445
+ var n = !1, i = null;
446
+ return new Promise(function(o) {
447
+ var l = /* @__PURE__ */ r(function() {
448
+ if (!n) {
449
+ n = !0;
450
+ try {
451
+ N.clearInterval(i);
452
+ } catch {
453
+ }
454
+ var a = t.intervals.indexOf(i);
455
+ a >= 0 && t.intervals.splice(a, 1), t.channel.removeEventListener("message", s), o();
456
+ }
457
+ }, "s");
458
+ i = N.setInterval(function() {
459
+ t.apply().then(function() {
460
+ t.isLeader && l();
461
+ });
462
+ }, t.options.fallbackInterval), t.intervals.push(i);
463
+ var s = /* @__PURE__ */ r(function(a) {
464
+ var c = a.data.action;
465
+ c === v.CLOSE && t.apply().then(function() {
466
+ t.isLeader && l();
467
+ });
468
+ }, "a");
469
+ t.channel.addEventListener("message", s);
470
+ });
471
+ }, "value") }, { key: "sendAction", value: /* @__PURE__ */ r(function(t) {
472
+ this.channel.postMessage({ action: t, token: this.token });
473
+ }, "value") }, { key: "assumeLead", value: /* @__PURE__ */ r(function() {
474
+ var t = this;
475
+ this.isLeader = !0;
476
+ var n = /* @__PURE__ */ r(function(i) {
477
+ var o = i.data.action;
478
+ o === v.APPLY && t.sendAction(v.TELL);
479
+ }, "o");
480
+ return this.channel.addEventListener("message", n), this.listeners.push(n), this.sendAction(v.TELL);
481
+ }, "value") }, { key: "waitForLeadership", value: /* @__PURE__ */ r(function() {
482
+ return this.deferred ? this.deferred : (this.deferred = this.awaitLeadership(), this.deferred);
483
+ }, "value") }, { key: "close", value: /* @__PURE__ */ r(function() {
484
+ var t = this;
485
+ if (!this.isDead) {
486
+ this.isDead = !0, this.isLeader = !1, this.sendAction(v.CLOSE);
487
+ try {
488
+ this.listeners.forEach(function(n) {
489
+ return t.channel.removeEventListener("message", n);
490
+ }), this.intervals.forEach(function(n) {
491
+ return N.clearInterval(n);
492
+ });
493
+ } catch {
494
+ }
495
+ }
496
+ }, "value") }]), e;
497
+ }(), M;
498
+ (function(e) {
499
+ e[e.PROMPTED = 0] = "PROMPTED", e[e.ACTIVE = 1] = "ACTIVE", e[e.IDLE = 2] = "IDLE";
500
+ })(M || (M = {}));
501
+ var xn = function() {
502
+ function e(t) {
503
+ 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);
505
+ var i = t.channelName;
506
+ if (this.options = t, this.channel = new Mn(i), this.registry.set(this.token, M.ACTIVE), t.leaderElection) {
507
+ var o = { fallbackInterval: 2e3, responseTime: 100 };
508
+ this.elector = new Dn(this.channel, o), this.elector.waitForLeadership();
509
+ }
510
+ this.channel.addEventListener("message", function(l) {
511
+ var s = l.data, a = s.action, c = s.token, f = s.data;
512
+ switch (a) {
513
+ case v.REGISTER:
514
+ n.registry.set(c, M.IDLE);
515
+ break;
516
+ case v.DEREGISTER:
517
+ n.registry.delete(c);
518
+ break;
519
+ case v.IDLE:
520
+ n.idle(c);
521
+ break;
522
+ case v.ACTIVE:
523
+ n.active(c);
524
+ break;
525
+ case v.PROMPT:
526
+ n.prompt(c);
527
+ break;
528
+ case v.START:
529
+ n.start(c);
530
+ break;
531
+ case v.RESET:
532
+ n.reset(c);
533
+ break;
534
+ case v.ACTIVATE:
535
+ n.activate(c);
536
+ break;
537
+ case v.PAUSE:
538
+ n.pause(c);
539
+ break;
540
+ case v.RESUME:
541
+ n.resume(c);
542
+ break;
543
+ case v.MESSAGE:
544
+ n.options.onMessage(f);
545
+ break;
546
+ }
547
+ }), this.send(v.REGISTER);
548
+ }
549
+ return r(e, "e"), Fe(e, [{ key: "isLeader", get: /* @__PURE__ */ r(function() {
550
+ if (!this.elector) throw new Error('❌ Leader election is not enabled. To Enable it set the "leaderElection" property to true.');
551
+ return this.elector.isLeader;
552
+ }, "get") }, { key: "prompt", value: /* @__PURE__ */ r(function() {
553
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
554
+ this.registry.set(t, M.PROMPTED);
555
+ var n = j(this.registry.values()).every(function(i) {
556
+ return i === M.PROMPTED;
557
+ });
558
+ t === this.token && this.send(v.PROMPT), n && this.options.onPrompt();
559
+ }, "value") }, { key: "idle", value: /* @__PURE__ */ r(function() {
560
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
561
+ this.registry.set(t, M.IDLE);
562
+ var n = j(this.registry.values()).every(function(i) {
563
+ return i === M.IDLE;
564
+ });
565
+ t === this.token && this.send(v.IDLE), !this.allIdle && n && (this.allIdle = !0, this.options.onIdle());
566
+ }, "value") }, { key: "active", value: /* @__PURE__ */ r(function() {
567
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.token;
568
+ this.allIdle = !1, this.registry.set(t, M.ACTIVE);
569
+ var n = j(this.registry.values()).some(function(i) {
570
+ return i === M.ACTIVE;
571
+ });
572
+ t === this.token && this.send(v.ACTIVE), n && this.options.onActive(), this.isLastActive = t === this.token;
573
+ }, "value") }, { key: "start", value: /* @__PURE__ */ r(function() {
574
+ 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;
576
+ }, "value") }, { key: "reset", value: /* @__PURE__ */ r(function() {
577
+ 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;
579
+ }, "value") }, { key: "activate", value: /* @__PURE__ */ r(function() {
580
+ 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;
582
+ }, "value") }, { key: "pause", value: /* @__PURE__ */ r(function() {
583
+ 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);
585
+ }, "value") }, { key: "resume", value: /* @__PURE__ */ r(function() {
586
+ 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);
588
+ }, "value") }, { key: "message", value: /* @__PURE__ */ r(function(t) {
589
+ try {
590
+ this.channel.postMessage({ action: v.MESSAGE, token: this.token, data: t });
591
+ } catch {
592
+ }
593
+ }, "value") }, { key: "send", value: /* @__PURE__ */ r(function(t) {
594
+ try {
595
+ this.channel.postMessage({ action: t, token: this.token });
596
+ } catch {
597
+ }
598
+ }, "value") }, { key: "close", value: /* @__PURE__ */ r(function() {
599
+ this.options.leaderElection && this.elector.close(), this.send(v.DEREGISTER), this.channel.close();
600
+ }, "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) {
603
+ var n = /* @__PURE__ */ r(function() {
604
+ for (var o = arguments.length, l = new Array(o), s = 0; s < o; s++) l[s] = arguments[s];
605
+ i && clearTimeout(i), i = setTimeout(function() {
606
+ e.apply(void 0, j(l)), i = null;
607
+ }, t);
608
+ }, "t"), i;
609
+ return n.cancel = function() {
610
+ clearTimeout(i);
611
+ }, n;
612
+ }
613
+ r(_n, "tr");
614
+ function Ve(e, t) {
615
+ var n = 0;
616
+ return function() {
617
+ for (var i = arguments.length, o = new Array(i), l = 0; l < i; l++) o[l] = arguments[l];
618
+ var s = (/* @__PURE__ */ new Date()).getTime();
619
+ if (!(s - n < t)) return n = s, e.apply(void 0, j(o));
620
+ };
621
+ }
622
+ r(Ve, "Fe");
623
+ var E = /* @__PURE__ */ r(function() {
624
+ return Date.now();
625
+ }, "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);
634
+ w(function() {
635
+ 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
+ if (n >= ae) throw new Error("❌ The value for the timeout property must fit in a 32 bit signed integer, ".concat(ae, "."));
637
+ if (o >= ae) throw new Error("❌ The value for the promptTimeout property must fit in a 32 bit signed integer, ".concat(ae, "."));
638
+ if (s >= ae) throw new Error("❌ The value for the promptBeforeIdle property must fit in a 32 bit signed integer, ".concat(ae, "."));
639
+ 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();
643
+ }
644
+ }, [n, o, s, U, B]);
645
+ var at = d(Te);
646
+ 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);
650
+ w(function() {
651
+ D.current = B, !Y.current && (B ? Oe() : U || ee());
652
+ }, [B]);
653
+ var pe = d(G);
654
+ w(function() {
655
+ pe.current = G;
656
+ }, [G]);
657
+ var Ie = d(ye);
658
+ w(function() {
659
+ Ie.current = ye;
660
+ }, [ye]);
661
+ var ke = d(Ee);
662
+ w(function() {
663
+ ke.current = Ee;
664
+ }, [Ee]);
665
+ var re = d(be);
666
+ w(function() {
667
+ re.current = be;
668
+ }, [be]);
669
+ var Le = d(we);
670
+ w(function() {
671
+ Le.current = we;
672
+ }, [we]);
673
+ var ie = d(se);
674
+ w(function() {
675
+ ie.current = se;
676
+ }, [se]);
677
+ var $ = Kt(function() {
678
+ var u = /* @__PURE__ */ r(function(S, oe) {
679
+ return Le.current(S, oe);
680
+ }, "i");
681
+ return ce > 0 ? _n(u, ce) : le > 0 ? Ve(u, le) : u;
682
+ }, [le, ce]), ct = d();
683
+ w(function() {
684
+ ne && he && (ct.current = Ve(function() {
685
+ h.current.active();
686
+ }, he));
687
+ }, [ne, he]);
688
+ var x = /* @__PURE__ */ r(function() {
689
+ q.current !== null && (N.clearTimeout(q.current), q.current = null);
690
+ }, "N"), Z = /* @__PURE__ */ r(function(u) {
691
+ 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);
697
+ }, "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) {
700
+ var S = !p.current;
701
+ 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);
706
+ return;
707
+ }
708
+ h.current ? h.current.idle() : ft();
709
+ return;
710
+ }
711
+ h.current ? h.current.active() : De(u);
712
+ }, "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);
716
+ return;
717
+ }
718
+ var S = E() - R.current;
719
+ if (p.current && !Te || !p.current && S >= C.current) {
720
+ xe(u);
721
+ return;
722
+ }
723
+ J.current = !1, P.current = 0, F.current = 0, Z(), ne && he && ct.current();
724
+ }
725
+ }, "He"), Se = d(je);
726
+ w(function() {
727
+ 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]);
730
+ 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 });
733
+ }), ve.current = !0));
734
+ }, "H"), Q = /* @__PURE__ */ r(function() {
735
+ 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 });
738
+ }), ve.current = !1);
739
+ }, "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() {
746
+ 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() {
749
+ 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() {
754
+ return p.current;
755
+ }, [p]), jt = g(function() {
756
+ 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);
766
+ 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() {
772
+ 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() {
778
+ return p.current ? Math.round(E() - L.current + de.current) : Math.round(de.current);
779
+ }, [L, de]), Ut = g(function() {
780
+ var u = Math.round(vt() - pt());
781
+ return u >= 0 ? u : 0;
782
+ }, [L, W]), Ft = g(function() {
783
+ var u = Math.round(mt() - gt());
784
+ return u >= 0 ? u : 0;
785
+ }, [L, W]);
786
+ w(function() {
787
+ if (ce > 0 && le > 0) throw new Error("❌ onAction can either be throttled or debounced, not both.");
788
+ V && Sn(V);
789
+ var u = /* @__PURE__ */ r(function() {
790
+ h.current && h.current.close(), $.cancel && $.cancel(), x(), Q(!0);
791
+ }, "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);
794
+ };
795
+ }, []), w(function() {
796
+ h.current && h.current.close(), ne ? h.current = new xn({ channelName: tt, leaderElection: it, onPrompt: /* @__PURE__ */ r(function() {
797
+ lt();
798
+ }, "onPrompt"), onIdle: /* @__PURE__ */ r(function() {
799
+ ft();
800
+ }, "onIdle"), onActive: /* @__PURE__ */ r(function() {
801
+ De();
802
+ }, "onActive"), onMessage: /* @__PURE__ */ r(function(u) {
803
+ 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) {
809
+ 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;
811
+ fe ? ee() : H();
812
+ }
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) {
817
+ G = u, pe.current = u;
818
+ }, "setOnPresenceChange"), setOnPrompt: /* @__PURE__ */ r(function(u) {
819
+ ye = u, Ie.current = u;
820
+ }, "setOnPrompt"), setOnIdle: /* @__PURE__ */ r(function(u) {
821
+ Ee = u, ke.current = u;
822
+ }, "setOnIdle"), setOnActive: /* @__PURE__ */ r(function(u) {
823
+ be = u, re.current = u;
824
+ }, "setOnActive"), setOnAction: /* @__PURE__ */ r(function(u) {
825
+ we = u, Le.current = u;
826
+ }, "setOnAction"), setOnMessage: /* @__PURE__ */ r(function(u) {
827
+ se = u, ie.current = u;
828
+ }, "setOnMessage") };
829
+ return O;
830
+ }
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,
842
+ events: [
843
+ "mousemove",
844
+ "keydown",
845
+ "wheel",
846
+ "DOMMouseScroll",
847
+ "mousewheel",
848
+ "mousedown",
849
+ "touchstart",
850
+ "touchmove",
851
+ "MSPointerDown",
852
+ "MSPointerMove",
853
+ "visibilitychange"
854
+ ],
855
+ throttle: 500
856
+ });
857
+ w(() => {
858
+ const m = setInterval(() => {
859
+ f(_());
860
+ }, 500);
861
+ return () => {
862
+ clearInterval(m);
863
+ };
864
+ }, [_]);
865
+ const T = g(() => {
866
+ a(!1), V();
867
+ }, [V]), A = g(async () => {
868
+ y.current || (y.current = !0, f(null), a(!1), await o({
869
+ title: i("Message.로그인 페이지로 이동합니다.", {
870
+ defaultValue: "로그인 페이지로 이동합니다."
871
+ })
872
+ }), l(), t(At));
873
+ }, [o, t, l, i]);
874
+ return w(() => {
875
+ if (n === At) {
876
+ a(!1);
877
+ return;
878
+ }
879
+ if (!s && Me(c) && c > 0 && c <= Tt) {
880
+ a(!0);
881
+ return;
882
+ }
883
+ if (s && Me(c) && c > Tt) {
884
+ T();
885
+ return;
886
+ }
887
+ Me(c) && c <= 0 && A();
888
+ }, [s, c, n, T, A]), /* @__PURE__ */ K(
889
+ Ue,
890
+ {
891
+ title: i("Title.로그인 연장", { defaultValue: "로그인 연장" }),
892
+ canConfirm: !1,
893
+ open: s,
894
+ onClose: /* @__PURE__ */ r(() => T(), "onClose"),
895
+ maxWidth: "xs",
896
+ fullWidth: !0,
897
+ children: /* @__PURE__ */ K(nn, { variant: "h6", children: i("Message.자동 로그아웃 남은 시간 안내", {
898
+ defaultValue: "{{seconds}}초 후 로그인 페이지로 이동합니다.",
899
+ seconds: Un(c)
900
+ }) })
901
+ }
902
+ );
903
+ }
904
+ r(er, "OwpAutoLogoutDialog");
905
+ const tr = cn(/* @__PURE__ */ qt.jsx("path", {
906
+ 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
+ }), "Close");
908
+ 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
917
+ };
918
+ //# sourceMappingURL=Close-DnXhM4Ms.js.map