react-luminus-components 1.1.20 → 1.1.22

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 (42) hide show
  1. package/README.md +2 -0
  2. package/dist/.vite/manifest.json +43 -43
  3. package/dist/{DataKey-Chc9JWBN.js → DataKey-B7CWQXvv.js} +1 -1
  4. package/dist/{DataKey-dhQX8cMa.cjs → DataKey-DVMbPWFY.cjs} +1 -1
  5. package/dist/{SimpleTooltip-CfoOF2bC.cjs → SimpleTooltip-D91sCKFo.cjs} +1 -1
  6. package/dist/{SimpleTooltip-Cs6KsWMk.js → SimpleTooltip-Dk1A5Tpg.js} +2 -2
  7. package/dist/components/Buttons/ContextButton/FileUploadContextButton.d.ts +12 -0
  8. package/dist/components/Buttons/index.d.ts +1 -0
  9. package/dist/components/Dropdown/comps/DropdownDivider/DropdownDivider.d.ts +6 -0
  10. package/dist/components/Dropdown/comps/DropdownItem/FileUploadDropdownItem.d.ts +12 -0
  11. package/dist/components/Dropdown/comps/index.d.ts +2 -0
  12. package/dist/components/Dropdown/index.d.ts +1 -1
  13. package/dist/components/Form/TextInput/TextInput.d.ts +2 -1
  14. package/dist/components/common/Collapse/Collapse.d.ts +14 -2
  15. package/dist/components/common/PromptDialog/PromptDialog.d.ts +3 -0
  16. package/dist/components/common/SimplePicker/SimplePicker.d.ts +2 -1
  17. package/dist/components/common/Typography/Typography.d.ts +1 -1
  18. package/dist/contexts/prompt/PromptContext.d.ts +10 -0
  19. package/dist/contexts/prompt/PromptProvider.d.ts +6 -0
  20. package/dist/contexts.cjs.js +1 -1
  21. package/dist/contexts.es.js +405 -368
  22. package/dist/{hasClass-D2q3Otcv.js → hasClass-DIHyDa4e.js} +237 -233
  23. package/dist/hasClass-DjB0wTmj.cjs +20 -0
  24. package/dist/hooks/index.d.ts +1 -0
  25. package/dist/hooks/usePrompt/usePrompt.d.ts +7 -0
  26. package/dist/hooks.cjs.js +1 -1
  27. package/dist/hooks.es.js +6 -5
  28. package/dist/layout.cjs.js +1 -1
  29. package/dist/layout.es.js +3 -3
  30. package/dist/main.cjs.js +1 -1
  31. package/dist/main.d.ts +2 -2
  32. package/dist/main.es.js +1161 -1119
  33. package/dist/models/texts/ConfirmTexts.d.ts +2 -0
  34. package/dist/style.css +1 -1
  35. package/dist/{useAxios-Ce32mjz9.cjs → useAxios-B4X7zKtj.cjs} +36 -36
  36. package/dist/{useAxios-D-fCu46c.js → useAxios-CHbKHRpj.js} +195 -181
  37. package/dist/useConfirm-CrTJszXF.cjs +1 -0
  38. package/dist/useConfirm-CyietOP-.js +27 -0
  39. package/package.json +1 -1
  40. package/dist/hasClass-Dg19NteG.cjs +0 -20
  41. package/dist/useConfirm-BM62r8mq.cjs +0 -1
  42. package/dist/useConfirm-CTpbtdnu.js +0 -18
@@ -1,116 +1,50 @@
1
- import { j as a, C as tt, L as Ae, I as ot, e as nt, b as st, U as rt, d as y } from "./useAxios-D-fCu46c.js";
2
- import * as g from "react";
3
- import { useState as M, useCallback as m, useMemo as G, useEffect as Ce, forwardRef as at, useRef as N, useImperativeHandle as it, useContext as Le } from "react";
4
- import { P as ge, c as Ee, o as De, s as z, u as Fe, a as lt, b as dt, d as w, l as Te, e as Ne, f as Ie, i as ct, r as Re, h as ut, g as I, j as ft, k as ht, m as mt, n as je, F as $e, p as gt, t as pt, T as vt } from "./hasClass-D2q3Otcv.js";
5
- import { u as yt } from "./useConfirm-CTpbtdnu.js";
6
- import { L as Ct, d as Et, u as wt, q as D } from "./DataKey-Chc9JWBN.js";
1
+ import { j as r, d as x, L as Ce, P as tt, C as ot, I as nt, e as st, b as rt, U as at } from "./useAxios-CHbKHRpj.js";
2
+ import * as v from "react";
3
+ import { forwardRef as it, useState as p, useRef as E, useImperativeHandle as lt, useEffect as re, useCallback as m, useContext as be, useMemo as $ } from "react";
4
+ import { a as dt, u as ct } from "./useConfirm-CyietOP-.js";
5
+ import { P as ve, c as Ee, o as Fe, s as G, u as De, a as ut, b as ft, d as b, l as Re, e as ke, f as Ie, i as ht, r as Se, h as mt, g as W, j as gt, k as pt, m as vt, n as Oe, F as $e, p as yt, t as xt, T as wt } from "./hasClass-DIHyDa4e.js";
6
+ import { d as Ct, u as bt, q as D, L as Et } from "./DataKey-B7CWQXvv.js";
7
7
  import Mt from "react-dom";
8
- const xt = ({ children: t }) => {
9
- const [e, o] = M(!1), [n, s] = M(""), r = m((h) => {
10
- o(!0), s(h);
11
- }, []), u = m(() => {
12
- o(!1);
13
- }, []), d = G(() => ({ show: e, text: n, showConfirm: r, hideConfirm: u }), [e, n, r, u]);
14
- return /* @__PURE__ */ a.jsxs(tt.Provider, { value: d, children: [
15
- /* @__PURE__ */ a.jsx(Xt, {}),
16
- t
17
- ] });
18
- }, to = ({ axiosInstance: t, LinkComponent: e, language: o, axiosTexts: n, confirmTexts: s, formValidationTexts: r, homeDashboardTexts: u, formSubmitTexts: d, children: h }) => {
19
- const p = G(() => ({
20
- axiosInstance: t,
21
- LinkComponent: e,
22
- language: o,
23
- axiosTexts: n,
24
- confirmTexts: s,
25
- formValidationTexts: r,
26
- homeDashboardTexts: u,
27
- formSubmitTexts: d
28
- }), [
29
- t,
30
- e,
31
- o,
32
- n,
33
- s,
34
- r,
35
- u,
36
- d
37
- ]);
38
- return /* @__PURE__ */ a.jsx(Ae.Provider, { value: p, children: /* @__PURE__ */ a.jsxs(xt, { children: [
39
- /* @__PURE__ */ a.jsx(ot, {}),
40
- h
41
- ] }) });
42
- }, oo = ({ children: t }) => {
43
- const [e, o] = M(!1), [n] = M(/* @__PURE__ */ new Set()), s = m((d) => {
44
- n.add(d), o(!0);
45
- }, [n]), r = m((d) => {
46
- n.delete(d), n.size === 0 && o(!1);
47
- }, [n]), u = G(() => ({ isLoading: e, startLoading: s, stopLoading: r }), [e, s, r]);
48
- return /* @__PURE__ */ a.jsxs(nt.Provider, { value: u, children: [
49
- e && /* @__PURE__ */ a.jsx(Ct, {}),
50
- t
51
- ] });
52
- }, no = ({ children: t }) => {
53
- const e = st(), o = m(() => {
54
- const c = localStorage.getItem("user") ?? null;
55
- return c ? JSON.parse(c) : null;
56
- }, []), [n, s] = M(o()), r = m(async () => {
57
- let c = null;
58
- return await e.get("/user/detail").then((x) => {
59
- c = x.data;
60
- }).catch(() => {
61
- c = null;
62
- }), localStorage.setItem("user", JSON.stringify(c)), c;
63
- }, [e]), u = m(() => {
64
- localStorage.removeItem("user");
65
- }, []), d = m(async () => {
66
- const c = await r();
67
- return c ? (s(c), !0) : !1;
68
- }, [r]), h = m(() => {
69
- u(), s(null);
70
- }, [u]), p = G(() => ({ user: n, loginUser: d, logoutUser: h }), [n, d, h]);
71
- return Ce(() => {
72
- s(o());
73
- }, [o]), /* @__PURE__ */ a.jsx(rt.Provider, { value: p, children: t });
74
- }, bt = (t) => /* @__PURE__ */ g.forwardRef((e, o) => /* @__PURE__ */ a.jsx("div", {
8
+ const Tt = (t) => /* @__PURE__ */ v.forwardRef((e, o) => /* @__PURE__ */ r.jsx("div", {
75
9
  ...e,
76
10
  ref: o,
77
- className: y(e.className, t)
78
- })), Tt = {
11
+ className: x(e.className, t)
12
+ })), jt = {
79
13
  /** An accessible label indicating the relevant information about the Close Button. */
80
- "aria-label": ge.string,
14
+ "aria-label": ve.string,
81
15
  /** A callback fired after the Close Button is clicked. */
82
- onClick: ge.func,
16
+ onClick: ve.func,
83
17
  /**
84
18
  * Render different color variant for the button.
85
19
  *
86
20
  * Omitting this will render the default dark color.
87
21
  */
88
- variant: ge.oneOf(["white"])
89
- }, we = /* @__PURE__ */ g.forwardRef(({
22
+ variant: ve.oneOf(["white"])
23
+ }, Me = /* @__PURE__ */ v.forwardRef(({
90
24
  className: t,
91
25
  variant: e,
92
26
  "aria-label": o = "Close",
93
27
  ...n
94
- }, s) => /* @__PURE__ */ a.jsx("button", {
28
+ }, s) => /* @__PURE__ */ r.jsx("button", {
95
29
  ref: s,
96
30
  type: "button",
97
- className: y("btn-close", e && `btn-close-${e}`, t),
31
+ className: x("btn-close", e && `btn-close-${e}`, t),
98
32
  "aria-label": o,
99
33
  ...n
100
34
  }));
101
- we.displayName = "CloseButton";
102
- we.propTypes = Tt;
103
- const Nt = we;
104
- var ne;
105
- function ke(t) {
106
- if ((!ne && ne !== 0 || t) && Ee) {
35
+ Me.displayName = "CloseButton";
36
+ Me.propTypes = jt;
37
+ const Nt = Me;
38
+ var se;
39
+ function Be(t) {
40
+ if ((!se && se !== 0 || t) && Ee) {
107
41
  var e = document.createElement("div");
108
- e.style.position = "absolute", e.style.top = "-9999px", e.style.width = "50px", e.style.height = "50px", e.style.overflow = "scroll", document.body.appendChild(e), ne = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
42
+ e.style.position = "absolute", e.style.top = "-9999px", e.style.width = "50px", e.style.height = "50px", e.style.overflow = "scroll", document.body.appendChild(e), se = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
109
43
  }
110
- return ne;
44
+ return se;
111
45
  }
112
- function pe(t) {
113
- t === void 0 && (t = De());
46
+ function ye(t) {
47
+ t === void 0 && (t = Fe());
114
48
  try {
115
49
  var e = t.activeElement;
116
50
  return !e || !e.nodeName ? null : e;
@@ -122,8 +56,8 @@ function Rt(t = document) {
122
56
  const e = t.defaultView;
123
57
  return Math.abs(e.innerWidth - t.documentElement.clientWidth);
124
58
  }
125
- const Oe = Et("modal-open");
126
- class jt {
59
+ const Ae = Ct("modal-open");
60
+ class kt {
127
61
  constructor({
128
62
  ownerDocument: e,
129
63
  handleContainerOverflow: o = !0,
@@ -148,14 +82,14 @@ class jt {
148
82
  e.style = {
149
83
  overflow: s.style.overflow,
150
84
  [n]: s.style[n]
151
- }, e.scrollBarWidth && (o[n] = `${parseInt(z(s, n) || "0", 10) + e.scrollBarWidth}px`), s.setAttribute(Oe, ""), z(s, o);
85
+ }, e.scrollBarWidth && (o[n] = `${parseInt(G(s, n) || "0", 10) + e.scrollBarWidth}px`), s.setAttribute(Ae, ""), G(s, o);
152
86
  }
153
87
  reset() {
154
88
  [...this.modals].forEach((e) => this.remove(e));
155
89
  }
156
90
  removeContainerStyle(e) {
157
91
  const o = this.getElement();
158
- o.removeAttribute(Oe), Object.assign(o.style, e.style);
92
+ o.removeAttribute(Ae), Object.assign(o.style, e.style);
159
93
  }
160
94
  add(e) {
161
95
  let o = this.modals.indexOf(e);
@@ -172,23 +106,23 @@ class jt {
172
106
  return !!this.modals.length && this.modals[this.modals.length - 1] === e;
173
107
  }
174
108
  }
175
- const Me = jt, kt = ["show", "role", "className", "style", "children", "backdrop", "keyboard", "onBackdropClick", "onEscapeKeyDown", "transition", "runTransition", "backdropTransition", "runBackdropTransition", "autoFocus", "enforceFocus", "restoreFocus", "restoreFocusOptions", "renderDialog", "renderBackdrop", "manager", "container", "onShow", "onHide", "onExit", "onExited", "onExiting", "onEnter", "onEntering", "onEntered"];
109
+ const Te = kt, St = ["show", "role", "className", "style", "children", "backdrop", "keyboard", "onBackdropClick", "onEscapeKeyDown", "transition", "runTransition", "backdropTransition", "runBackdropTransition", "autoFocus", "enforceFocus", "restoreFocus", "restoreFocusOptions", "renderDialog", "renderBackdrop", "manager", "container", "onShow", "onHide", "onExit", "onExited", "onExiting", "onEnter", "onEntering", "onEntered"];
176
110
  function Ot(t, e) {
177
111
  if (t == null)
178
112
  return {};
179
- var o = {}, n = Object.keys(t), s, r;
180
- for (r = 0; r < n.length; r++)
181
- s = n[r], !(e.indexOf(s) >= 0) && (o[s] = t[s]);
113
+ var o = {}, n = Object.keys(t), s, a;
114
+ for (a = 0; a < n.length; a++)
115
+ s = n[a], !(e.indexOf(s) >= 0) && (o[s] = t[s]);
182
116
  return o;
183
117
  }
184
- let ve;
185
- function St(t) {
186
- return ve || (ve = new Me({
118
+ let xe;
119
+ function Bt(t) {
120
+ return xe || (xe = new Te({
187
121
  ownerDocument: t == null ? void 0 : t.document
188
- })), ve;
122
+ })), xe;
189
123
  }
190
- function Bt(t) {
191
- const e = Fe(), o = t || St(e), n = N({
124
+ function At(t) {
125
+ const e = De(), o = t || Bt(e), n = E({
192
126
  dialog: null,
193
127
  backdrop: null
194
128
  });
@@ -204,459 +138,562 @@ function Bt(t) {
204
138
  }, [])
205
139
  });
206
140
  }
207
- const We = /* @__PURE__ */ at((t, e) => {
141
+ const We = /* @__PURE__ */ it((t, e) => {
208
142
  let {
209
143
  show: o = !1,
210
144
  role: n = "dialog",
211
145
  className: s,
212
- style: r,
213
- children: u,
214
- backdrop: d = !0,
215
- keyboard: h = !0,
216
- onBackdropClick: p,
217
- onEscapeKeyDown: c,
218
- transition: x,
219
- runTransition: b,
146
+ style: a,
147
+ children: d,
148
+ backdrop: l = !0,
149
+ keyboard: f = !0,
150
+ onBackdropClick: g,
151
+ onEscapeKeyDown: u,
152
+ transition: M,
153
+ runTransition: T,
220
154
  backdropTransition: R,
221
- runBackdropTransition: se,
222
- autoFocus: P = !0,
223
- enforceFocus: re = !0,
224
- restoreFocus: j = !0,
225
- restoreFocusOptions: ae,
226
- renderDialog: V,
227
- renderBackdrop: ie = (l) => /* @__PURE__ */ a.jsx("div", Object.assign({}, l)),
228
- manager: le,
229
- container: de,
230
- onShow: X,
231
- onHide: $ = () => {
155
+ runBackdropTransition: ae,
156
+ autoFocus: V = !0,
157
+ enforceFocus: ie = !0,
158
+ restoreFocus: k = !0,
159
+ restoreFocusOptions: le,
160
+ renderDialog: X,
161
+ renderBackdrop: de = (c) => /* @__PURE__ */ r.jsx("div", Object.assign({}, c)),
162
+ manager: ce,
163
+ container: ue,
164
+ onShow: Y,
165
+ onHide: H = () => {
232
166
  },
233
- onExit: ce,
234
- onExited: W,
235
- onExiting: Y,
236
- onEnter: q,
237
- onEntering: J,
238
- onEntered: Q
239
- } = t, ue = Ot(t, kt);
240
- const C = Fe(), k = lt(de), f = Bt(le), fe = dt(), Z = wt(o), [T, O] = M(!o), v = N(null);
241
- it(e, () => f, [f]), Ee && !Z && o && (v.current = pe(C == null ? void 0 : C.document)), o && T && O(!1);
242
- const E = w(() => {
243
- if (f.add(), S.current = Te(document, "keydown", me), H.current = Te(
167
+ onExit: fe,
168
+ onExited: U,
169
+ onExiting: q,
170
+ onEnter: J,
171
+ onEntering: Q,
172
+ onEntered: Z
173
+ } = t, he = Ot(t, St);
174
+ const w = De(), S = ut(ue), h = At(ce), me = ft(), ee = bt(o), [j, O] = p(!o), y = E(null);
175
+ lt(e, () => h, [h]), Ee && !ee && o && (y.current = ye(w == null ? void 0 : w.document)), o && j && O(!1);
176
+ const C = b(() => {
177
+ if (h.add(), B.current = Re(document, "keydown", pe), _.current = Re(
244
178
  document,
245
179
  "focus",
246
180
  // the timeout is necessary b/c this will run before the new modal is mounted
247
181
  // and so steals focus from it
248
- () => setTimeout(he),
182
+ () => setTimeout(ge),
249
183
  !0
250
- ), X && X(), P) {
251
- var l, oe;
252
- const K = pe((l = (oe = f.dialog) == null ? void 0 : oe.ownerDocument) != null ? l : C == null ? void 0 : C.document);
253
- f.dialog && K && !Ne(f.dialog, K) && (v.current = K, f.dialog.focus());
184
+ ), Y && Y(), V) {
185
+ var c, ne;
186
+ const z = ye((c = (ne = h.dialog) == null ? void 0 : ne.ownerDocument) != null ? c : w == null ? void 0 : w.document);
187
+ h.dialog && z && !ke(h.dialog, z) && (y.current = z, h.dialog.focus());
254
188
  }
255
- }), U = w(() => {
256
- if (f.remove(), S.current == null || S.current(), H.current == null || H.current(), j) {
257
- var l;
258
- (l = v.current) == null || l.focus == null || l.focus(ae), v.current = null;
189
+ }), P = b(() => {
190
+ if (h.remove(), B.current == null || B.current(), _.current == null || _.current(), k) {
191
+ var c;
192
+ (c = y.current) == null || c.focus == null || c.focus(le), y.current = null;
259
193
  }
260
194
  });
261
- Ce(() => {
262
- !o || !k || E();
195
+ re(() => {
196
+ !o || !S || C();
263
197
  }, [
264
198
  o,
265
- k,
199
+ S,
266
200
  /* should never change: */
267
- E
268
- ]), Ce(() => {
269
- T && U();
270
- }, [T, U]), Ie(() => {
271
- U();
201
+ C
202
+ ]), re(() => {
203
+ j && P();
204
+ }, [j, P]), Ie(() => {
205
+ P();
272
206
  });
273
- const he = w(() => {
274
- if (!re || !fe() || !f.isTopModal())
207
+ const ge = b(() => {
208
+ if (!ie || !me() || !h.isTopModal())
275
209
  return;
276
- const l = pe(C == null ? void 0 : C.document);
277
- f.dialog && l && !Ne(f.dialog, l) && f.dialog.focus();
278
- }), ee = w((l) => {
279
- l.target === l.currentTarget && (p == null || p(l), d === !0 && $());
280
- }), me = w((l) => {
281
- h && ct(l) && f.isTopModal() && (c == null || c(l), l.defaultPrevented || $());
282
- }), H = N(), S = N(), te = (...l) => {
283
- O(!0), W == null || W(...l);
210
+ const c = ye(w == null ? void 0 : w.document);
211
+ h.dialog && c && !ke(h.dialog, c) && h.dialog.focus();
212
+ }), te = b((c) => {
213
+ c.target === c.currentTarget && (g == null || g(c), l === !0 && H());
214
+ }), pe = b((c) => {
215
+ f && ht(c) && h.isTopModal() && (u == null || u(c), c.defaultPrevented || H());
216
+ }), _ = E(), B = E(), oe = (...c) => {
217
+ O(!0), U == null || U(...c);
284
218
  };
285
- if (!k)
219
+ if (!S)
286
220
  return null;
287
- const B = Object.assign({
221
+ const A = Object.assign({
288
222
  role: n,
289
- ref: f.setDialogRef,
223
+ ref: h.setDialogRef,
290
224
  // apparently only works on the dialog role element
291
225
  "aria-modal": n === "dialog" ? !0 : void 0
292
- }, ue, {
293
- style: r,
226
+ }, he, {
227
+ style: a,
294
228
  className: s,
295
229
  tabIndex: -1
296
230
  });
297
- let _ = V ? V(B) : /* @__PURE__ */ a.jsx("div", Object.assign({}, B, {
298
- children: /* @__PURE__ */ g.cloneElement(u, {
231
+ let K = X ? X(A) : /* @__PURE__ */ r.jsx("div", Object.assign({}, A, {
232
+ children: /* @__PURE__ */ v.cloneElement(d, {
299
233
  role: "document"
300
234
  })
301
235
  }));
302
- _ = Re(x, b, {
236
+ K = Se(M, T, {
303
237
  unmountOnExit: !0,
304
238
  mountOnEnter: !0,
305
239
  appear: !0,
306
240
  in: !!o,
307
- onExit: ce,
308
- onExiting: Y,
309
- onExited: te,
310
- onEnter: q,
311
- onEntering: J,
312
- onEntered: Q,
313
- children: _
241
+ onExit: fe,
242
+ onExiting: q,
243
+ onExited: oe,
244
+ onEnter: J,
245
+ onEntering: Q,
246
+ onEntered: Z,
247
+ children: K
314
248
  });
315
- let A = null;
316
- return d && (A = ie({
317
- ref: f.setBackdropRef,
318
- onClick: ee
319
- }), A = Re(R, se, {
249
+ let L = null;
250
+ return l && (L = de({
251
+ ref: h.setBackdropRef,
252
+ onClick: te
253
+ }), L = Se(R, ae, {
320
254
  in: !!o,
321
255
  appear: !0,
322
256
  mountOnEnter: !0,
323
257
  unmountOnExit: !0,
324
- children: A
325
- })), /* @__PURE__ */ a.jsx(a.Fragment, {
326
- children: /* @__PURE__ */ Mt.createPortal(/* @__PURE__ */ a.jsxs(a.Fragment, {
327
- children: [A, _]
328
- }), k)
258
+ children: L
259
+ })), /* @__PURE__ */ r.jsx(r.Fragment, {
260
+ children: /* @__PURE__ */ Mt.createPortal(/* @__PURE__ */ r.jsxs(r.Fragment, {
261
+ children: [L, K]
262
+ }), S)
329
263
  });
330
264
  });
331
265
  We.displayName = "Modal";
332
- const At = Object.assign(We, {
333
- Manager: Me
266
+ const Lt = Object.assign(We, {
267
+ Manager: Te
334
268
  });
335
- function Lt(t, e) {
336
- t.classList ? t.classList.add(e) : ut(t, e) || (typeof t.className == "string" ? t.className = t.className + " " + e : t.setAttribute("class", (t.className && t.className.baseVal || "") + " " + e));
269
+ function Ft(t, e) {
270
+ t.classList ? t.classList.add(e) : mt(t, e) || (typeof t.className == "string" ? t.className = t.className + " " + e : t.setAttribute("class", (t.className && t.className.baseVal || "") + " " + e));
337
271
  }
338
- function Se(t, e) {
272
+ function Le(t, e) {
339
273
  return t.replace(new RegExp("(^|\\s)" + e + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
340
274
  }
341
275
  function Dt(t, e) {
342
- t.classList ? t.classList.remove(e) : typeof t.className == "string" ? t.className = Se(t.className, e) : t.setAttribute("class", Se(t.className && t.className.baseVal || "", e));
276
+ t.classList ? t.classList.remove(e) : typeof t.className == "string" ? t.className = Le(t.className, e) : t.setAttribute("class", Le(t.className && t.className.baseVal || "", e));
343
277
  }
344
- const F = {
278
+ const I = {
345
279
  FIXED_CONTENT: ".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",
346
280
  STICKY_CONTENT: ".sticky-top",
347
281
  NAVBAR_TOGGLER: ".navbar-toggler"
348
282
  };
349
- class Ft extends Me {
283
+ class It extends Te {
350
284
  adjustAndStore(e, o, n) {
351
285
  const s = o.style[e];
352
- o.dataset[e] = s, z(o, {
353
- [e]: `${parseFloat(z(o, e)) + n}px`
286
+ o.dataset[e] = s, G(o, {
287
+ [e]: `${parseFloat(G(o, e)) + n}px`
354
288
  });
355
289
  }
356
290
  restore(e, o) {
357
291
  const n = o.dataset[e];
358
- n !== void 0 && (delete o.dataset[e], z(o, {
292
+ n !== void 0 && (delete o.dataset[e], G(o, {
359
293
  [e]: n
360
294
  }));
361
295
  }
362
296
  setContainerStyle(e) {
363
297
  super.setContainerStyle(e);
364
298
  const o = this.getElement();
365
- if (Lt(o, "modal-open"), !e.scrollBarWidth)
299
+ if (Ft(o, "modal-open"), !e.scrollBarWidth)
366
300
  return;
367
301
  const n = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
368
- D(o, F.FIXED_CONTENT).forEach((r) => this.adjustAndStore(n, r, e.scrollBarWidth)), D(o, F.STICKY_CONTENT).forEach((r) => this.adjustAndStore(s, r, -e.scrollBarWidth)), D(o, F.NAVBAR_TOGGLER).forEach((r) => this.adjustAndStore(s, r, e.scrollBarWidth));
302
+ D(o, I.FIXED_CONTENT).forEach((a) => this.adjustAndStore(n, a, e.scrollBarWidth)), D(o, I.STICKY_CONTENT).forEach((a) => this.adjustAndStore(s, a, -e.scrollBarWidth)), D(o, I.NAVBAR_TOGGLER).forEach((a) => this.adjustAndStore(s, a, e.scrollBarWidth));
369
303
  }
370
304
  removeContainerStyle(e) {
371
305
  super.removeContainerStyle(e);
372
306
  const o = this.getElement();
373
307
  Dt(o, "modal-open");
374
308
  const n = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
375
- D(o, F.FIXED_CONTENT).forEach((r) => this.restore(n, r)), D(o, F.STICKY_CONTENT).forEach((r) => this.restore(s, r)), D(o, F.NAVBAR_TOGGLER).forEach((r) => this.restore(s, r));
309
+ D(o, I.FIXED_CONTENT).forEach((a) => this.restore(n, a)), D(o, I.STICKY_CONTENT).forEach((a) => this.restore(s, a)), D(o, I.NAVBAR_TOGGLER).forEach((a) => this.restore(s, a));
376
310
  }
377
311
  }
378
- let ye;
379
- function It(t) {
380
- return ye || (ye = new Ft(t)), ye;
312
+ let we;
313
+ function $t(t) {
314
+ return we || (we = new It(t)), we;
381
315
  }
382
- const Ue = /* @__PURE__ */ g.forwardRef(({
316
+ const He = /* @__PURE__ */ v.forwardRef(({
383
317
  className: t,
384
318
  bsPrefix: e,
385
319
  as: o = "div",
386
320
  ...n
387
- }, s) => (e = I(e, "modal-body"), /* @__PURE__ */ a.jsx(o, {
321
+ }, s) => (e = W(e, "modal-body"), /* @__PURE__ */ r.jsx(o, {
388
322
  ref: s,
389
- className: y(t, e),
323
+ className: x(t, e),
390
324
  ...n
391
325
  })));
392
- Ue.displayName = "ModalBody";
393
- const $t = Ue, Wt = /* @__PURE__ */ g.createContext({
326
+ He.displayName = "ModalBody";
327
+ const Wt = He, Ht = /* @__PURE__ */ v.createContext({
394
328
  // eslint-disable-next-line @typescript-eslint/no-empty-function
395
329
  onHide() {
396
330
  }
397
- }), He = Wt, _e = /* @__PURE__ */ g.forwardRef(({
331
+ }), Ue = Ht, Pe = /* @__PURE__ */ v.forwardRef(({
398
332
  bsPrefix: t,
399
333
  className: e,
400
334
  contentClassName: o,
401
335
  centered: n,
402
336
  size: s,
403
- fullscreen: r,
404
- children: u,
405
- scrollable: d,
406
- ...h
407
- }, p) => {
408
- t = I(t, "modal");
409
- const c = `${t}-dialog`, x = typeof r == "string" ? `${t}-fullscreen-${r}` : `${t}-fullscreen`;
410
- return /* @__PURE__ */ a.jsx("div", {
411
- ...h,
412
- ref: p,
413
- className: y(c, e, s && `${t}-${s}`, n && `${c}-centered`, d && `${c}-scrollable`, r && x),
414
- children: /* @__PURE__ */ a.jsx("div", {
415
- className: y(`${t}-content`, o),
416
- children: u
337
+ fullscreen: a,
338
+ children: d,
339
+ scrollable: l,
340
+ ...f
341
+ }, g) => {
342
+ t = W(t, "modal");
343
+ const u = `${t}-dialog`, M = typeof a == "string" ? `${t}-fullscreen-${a}` : `${t}-fullscreen`;
344
+ return /* @__PURE__ */ r.jsx("div", {
345
+ ...f,
346
+ ref: g,
347
+ className: x(u, e, s && `${t}-${s}`, n && `${u}-centered`, l && `${u}-scrollable`, a && M),
348
+ children: /* @__PURE__ */ r.jsx("div", {
349
+ className: x(`${t}-content`, o),
350
+ children: d
417
351
  })
418
352
  });
419
353
  });
420
- _e.displayName = "ModalDialog";
421
- const Ke = _e, ze = /* @__PURE__ */ g.forwardRef(({
354
+ Pe.displayName = "ModalDialog";
355
+ const _e = Pe, Ke = /* @__PURE__ */ v.forwardRef(({
422
356
  className: t,
423
357
  bsPrefix: e,
424
358
  as: o = "div",
425
359
  ...n
426
- }, s) => (e = I(e, "modal-footer"), /* @__PURE__ */ a.jsx(o, {
360
+ }, s) => (e = W(e, "modal-footer"), /* @__PURE__ */ r.jsx(o, {
427
361
  ref: s,
428
- className: y(t, e),
362
+ className: x(t, e),
429
363
  ...n
430
364
  })));
431
- ze.displayName = "ModalFooter";
432
- const Ut = ze, Ht = /* @__PURE__ */ g.forwardRef(({
365
+ Ke.displayName = "ModalFooter";
366
+ const Ut = Ke, Pt = /* @__PURE__ */ v.forwardRef(({
433
367
  closeLabel: t = "Close",
434
368
  closeVariant: e,
435
369
  closeButton: o = !1,
436
370
  onHide: n,
437
371
  children: s,
438
- ...r
439
- }, u) => {
440
- const d = Le(He), h = w(() => {
441
- d == null || d.onHide(), n == null || n();
372
+ ...a
373
+ }, d) => {
374
+ const l = be(Ue), f = b(() => {
375
+ l == null || l.onHide(), n == null || n();
442
376
  });
443
- return /* @__PURE__ */ a.jsxs("div", {
444
- ref: u,
445
- ...r,
446
- children: [s, o && /* @__PURE__ */ a.jsx(Nt, {
377
+ return /* @__PURE__ */ r.jsxs("div", {
378
+ ref: d,
379
+ ...a,
380
+ children: [s, o && /* @__PURE__ */ r.jsx(Nt, {
447
381
  "aria-label": t,
448
382
  variant: e,
449
- onClick: h
383
+ onClick: f
450
384
  })]
451
385
  });
452
- }), _t = Ht, Ge = /* @__PURE__ */ g.forwardRef(({
386
+ }), _t = Pt, ze = /* @__PURE__ */ v.forwardRef(({
453
387
  bsPrefix: t,
454
388
  className: e,
455
389
  closeLabel: o = "Close",
456
390
  closeButton: n = !1,
457
391
  ...s
458
- }, r) => (t = I(t, "modal-header"), /* @__PURE__ */ a.jsx(_t, {
459
- ref: r,
392
+ }, a) => (t = W(t, "modal-header"), /* @__PURE__ */ r.jsx(_t, {
393
+ ref: a,
460
394
  ...s,
461
- className: y(e, t),
395
+ className: x(e, t),
462
396
  closeLabel: o,
463
397
  closeButton: n
464
398
  })));
465
- Ge.displayName = "ModalHeader";
466
- const Kt = Ge, zt = bt("h4"), Pe = /* @__PURE__ */ g.forwardRef(({
399
+ ze.displayName = "ModalHeader";
400
+ const Kt = ze, zt = Tt("h4"), Ge = /* @__PURE__ */ v.forwardRef(({
467
401
  className: t,
468
402
  bsPrefix: e,
469
403
  as: o = zt,
470
404
  ...n
471
- }, s) => (e = I(e, "modal-title"), /* @__PURE__ */ a.jsx(o, {
405
+ }, s) => (e = W(e, "modal-title"), /* @__PURE__ */ r.jsx(o, {
472
406
  ref: s,
473
- className: y(t, e),
407
+ className: x(t, e),
474
408
  ...n
475
409
  })));
476
- Pe.displayName = "ModalTitle";
477
- const Gt = Pe;
478
- function Pt(t) {
479
- return /* @__PURE__ */ a.jsx($e, {
410
+ Ge.displayName = "ModalTitle";
411
+ const Gt = Ge;
412
+ function Vt(t) {
413
+ return /* @__PURE__ */ r.jsx($e, {
480
414
  ...t,
481
415
  timeout: null
482
416
  });
483
417
  }
484
- function Vt(t) {
485
- return /* @__PURE__ */ a.jsx($e, {
418
+ function Xt(t) {
419
+ return /* @__PURE__ */ r.jsx($e, {
486
420
  ...t,
487
421
  timeout: null
488
422
  });
489
423
  }
490
- const Ve = /* @__PURE__ */ g.forwardRef(({
424
+ const Ve = /* @__PURE__ */ v.forwardRef(({
491
425
  bsPrefix: t,
492
426
  className: e,
493
427
  style: o,
494
428
  dialogClassName: n,
495
429
  contentClassName: s,
496
- children: r,
497
- dialogAs: u = Ke,
498
- "data-bs-theme": d,
499
- "aria-labelledby": h,
500
- "aria-describedby": p,
501
- "aria-label": c,
430
+ children: a,
431
+ dialogAs: d = _e,
432
+ "data-bs-theme": l,
433
+ "aria-labelledby": f,
434
+ "aria-describedby": g,
435
+ "aria-label": u,
502
436
  /* BaseModal props */
503
- show: x = !1,
504
- animation: b = !0,
437
+ show: M = !1,
438
+ animation: T = !0,
505
439
  backdrop: R = !0,
506
- keyboard: se = !0,
507
- onEscapeKeyDown: P,
508
- onShow: re,
509
- onHide: j,
510
- container: ae,
511
- autoFocus: V = !0,
512
- enforceFocus: ie = !0,
513
- restoreFocus: le = !0,
514
- restoreFocusOptions: de,
515
- onEntered: X,
516
- onExit: $,
517
- onExiting: ce,
518
- onEnter: W,
519
- onEntering: Y,
520
- onExited: q,
521
- backdropClassName: J,
522
- manager: Q,
523
- ...ue
524
- }, C) => {
525
- const [k, f] = M({}), [fe, Z] = M(!1), T = N(!1), O = N(!1), v = N(null), [E, U] = ft(), he = ht(C, U), ee = w(j), me = mt();
526
- t = I(t, "modal");
527
- const H = G(() => ({
528
- onHide: ee
529
- }), [ee]);
530
- function S() {
531
- return Q || It({
532
- isRTL: me
440
+ keyboard: ae = !0,
441
+ onEscapeKeyDown: V,
442
+ onShow: ie,
443
+ onHide: k,
444
+ container: le,
445
+ autoFocus: X = !0,
446
+ enforceFocus: de = !0,
447
+ restoreFocus: ce = !0,
448
+ restoreFocusOptions: ue,
449
+ onEntered: Y,
450
+ onExit: H,
451
+ onExiting: fe,
452
+ onEnter: U,
453
+ onEntering: q,
454
+ onExited: J,
455
+ backdropClassName: Q,
456
+ manager: Z,
457
+ ...he
458
+ }, w) => {
459
+ const [S, h] = p({}), [me, ee] = p(!1), j = E(!1), O = E(!1), y = E(null), [C, P] = gt(), ge = pt(w, P), te = b(k), pe = vt();
460
+ t = W(t, "modal");
461
+ const _ = $(() => ({
462
+ onHide: te
463
+ }), [te]);
464
+ function B() {
465
+ return Z || $t({
466
+ isRTL: pe
533
467
  });
534
468
  }
535
- function te(i) {
469
+ function oe(i) {
536
470
  if (!Ee)
537
471
  return;
538
- const L = S().getScrollbarWidth() > 0, be = i.scrollHeight > De(i).documentElement.clientHeight;
539
- f({
540
- paddingRight: L && !be ? ke() : void 0,
541
- paddingLeft: !L && be ? ke() : void 0
472
+ const F = B().getScrollbarWidth() > 0, Ne = i.scrollHeight > Fe(i).documentElement.clientHeight;
473
+ h({
474
+ paddingRight: F && !Ne ? Be() : void 0,
475
+ paddingLeft: !F && Ne ? Be() : void 0
542
476
  });
543
477
  }
544
- const B = w(() => {
545
- E && te(E.dialog);
478
+ const A = b(() => {
479
+ C && oe(C.dialog);
546
480
  });
547
481
  Ie(() => {
548
- je(window, "resize", B), v.current == null || v.current();
482
+ Oe(window, "resize", A), y.current == null || y.current();
549
483
  });
550
- const _ = () => {
551
- T.current = !0;
552
- }, A = (i) => {
553
- T.current && E && i.target === E.dialog && (O.current = !0), T.current = !1;
554
- }, l = () => {
555
- Z(!0), v.current = pt(E.dialog, () => {
556
- Z(!1);
484
+ const K = () => {
485
+ j.current = !0;
486
+ }, L = (i) => {
487
+ j.current && C && i.target === C.dialog && (O.current = !0), j.current = !1;
488
+ }, c = () => {
489
+ ee(!0), y.current = xt(C.dialog, () => {
490
+ ee(!1);
557
491
  });
558
- }, oe = (i) => {
559
- i.target === i.currentTarget && l();
560
- }, K = (i) => {
492
+ }, ne = (i) => {
493
+ i.target === i.currentTarget && c();
494
+ }, z = (i) => {
561
495
  if (R === "static") {
562
- oe(i);
496
+ ne(i);
563
497
  return;
564
498
  }
565
499
  if (O.current || i.target !== i.currentTarget) {
566
500
  O.current = !1;
567
501
  return;
568
502
  }
569
- j == null || j();
503
+ k == null || k();
570
504
  }, Xe = (i) => {
571
- se ? P == null || P(i) : (i.preventDefault(), R === "static" && l());
572
- }, Ye = (i, L) => {
573
- i && te(i), W == null || W(i, L);
505
+ ae ? V == null || V(i) : (i.preventDefault(), R === "static" && c());
506
+ }, Ye = (i, F) => {
507
+ i && oe(i), U == null || U(i, F);
574
508
  }, qe = (i) => {
575
- v.current == null || v.current(), $ == null || $(i);
576
- }, Je = (i, L) => {
577
- Y == null || Y(i, L), gt(window, "resize", B);
509
+ y.current == null || y.current(), H == null || H(i);
510
+ }, Je = (i, F) => {
511
+ q == null || q(i, F), yt(window, "resize", A);
578
512
  }, Qe = (i) => {
579
- i && (i.style.display = ""), q == null || q(i), je(window, "resize", B);
580
- }, Ze = m((i) => /* @__PURE__ */ a.jsx("div", {
513
+ i && (i.style.display = ""), J == null || J(i), Oe(window, "resize", A);
514
+ }, Ze = m((i) => /* @__PURE__ */ r.jsx("div", {
581
515
  ...i,
582
- className: y(`${t}-backdrop`, J, !b && "show")
583
- }), [b, J, t]), xe = {
516
+ className: x(`${t}-backdrop`, Q, !T && "show")
517
+ }), [T, Q, t]), je = {
584
518
  ...o,
585
- ...k
519
+ ...S
586
520
  };
587
- xe.display = "block";
588
- const et = (i) => /* @__PURE__ */ a.jsx("div", {
521
+ je.display = "block";
522
+ const et = (i) => /* @__PURE__ */ r.jsx("div", {
589
523
  role: "dialog",
590
524
  ...i,
591
- style: xe,
592
- className: y(e, t, fe && `${t}-static`, !b && "show"),
593
- onClick: R ? K : void 0,
594
- onMouseUp: A,
595
- "data-bs-theme": d,
596
- "aria-label": c,
597
- "aria-labelledby": h,
598
- "aria-describedby": p,
599
- children: /* @__PURE__ */ a.jsx(u, {
600
- ...ue,
601
- onMouseDown: _,
525
+ style: je,
526
+ className: x(e, t, me && `${t}-static`, !T && "show"),
527
+ onClick: R ? z : void 0,
528
+ onMouseUp: L,
529
+ "data-bs-theme": l,
530
+ "aria-label": u,
531
+ "aria-labelledby": f,
532
+ "aria-describedby": g,
533
+ children: /* @__PURE__ */ r.jsx(d, {
534
+ ...he,
535
+ onMouseDown: K,
602
536
  className: n,
603
537
  contentClassName: s,
604
- children: r
538
+ children: a
605
539
  })
606
540
  });
607
- return /* @__PURE__ */ a.jsx(He.Provider, {
608
- value: H,
609
- children: /* @__PURE__ */ a.jsx(At, {
610
- show: x,
611
- ref: he,
541
+ return /* @__PURE__ */ r.jsx(Ue.Provider, {
542
+ value: _,
543
+ children: /* @__PURE__ */ r.jsx(Lt, {
544
+ show: M,
545
+ ref: ge,
612
546
  backdrop: R,
613
- container: ae,
547
+ container: le,
614
548
  keyboard: !0,
615
- autoFocus: V,
616
- enforceFocus: ie,
617
- restoreFocus: le,
618
- restoreFocusOptions: de,
549
+ autoFocus: X,
550
+ enforceFocus: de,
551
+ restoreFocus: ce,
552
+ restoreFocusOptions: ue,
619
553
  onEscapeKeyDown: Xe,
620
- onShow: re,
621
- onHide: j,
554
+ onShow: ie,
555
+ onHide: k,
622
556
  onEnter: Ye,
623
557
  onEntering: Je,
624
- onEntered: X,
558
+ onEntered: Y,
625
559
  onExit: qe,
626
- onExiting: ce,
560
+ onExiting: fe,
627
561
  onExited: Qe,
628
- manager: S(),
629
- transition: b ? Pt : void 0,
630
- backdropTransition: b ? Vt : void 0,
562
+ manager: B(),
563
+ transition: T ? Vt : void 0,
564
+ backdropTransition: T ? Xt : void 0,
631
565
  renderBackdrop: Ze,
632
566
  renderDialog: et
633
567
  })
634
568
  });
635
569
  });
636
570
  Ve.displayName = "Modal";
637
- const Be = Object.assign(Ve, {
638
- Body: $t,
571
+ const N = Object.assign(Ve, {
572
+ Body: Wt,
639
573
  Header: Kt,
640
574
  Title: Gt,
641
575
  Footer: Ut,
642
- Dialog: Ke,
576
+ Dialog: _e,
643
577
  TRANSITION_DURATION: 300,
644
578
  BACKDROP_TRANSITION_DURATION: 150
645
- }), Xt = () => {
646
- const { confirmTexts: t } = Le(Ae), { onConfirm: e, onCancel: o, text: n, show: s } = yt();
647
- return /* @__PURE__ */ a.jsx(Be, { show: s, size: "sm", centered: !0, onHide: o, children: /* @__PURE__ */ a.jsxs(Be.Body, { children: [
648
- /* @__PURE__ */ a.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ a.jsx(vt, { variant: "h6", children: n }) }),
649
- /* @__PURE__ */ a.jsxs("div", { className: "w-100 d-flex gap-5", children: [
650
- /* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary w-100", onClick: o, children: t.no }),
651
- /* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary w-100 ml", onClick: e, children: t.yes })
579
+ }), Yt = () => {
580
+ const { confirmTexts: t } = be(Ce), { isShown: e, text: o, onFinish: n } = dt(), [s, a] = p(""), d = m(() => {
581
+ n(null);
582
+ }, [n]), l = m(() => {
583
+ n(s);
584
+ }, [n, s]);
585
+ return re(() => {
586
+ e === !0 && a("");
587
+ }, [e]), /* @__PURE__ */ r.jsxs(N, { show: e, size: "sm", centered: !0, onHide: d, children: [
588
+ /* @__PURE__ */ r.jsx(N.Header, { children: /* @__PURE__ */ r.jsx(N.Title, { children: o }) }),
589
+ /* @__PURE__ */ r.jsx(N.Body, { children: /* @__PURE__ */ r.jsx(
590
+ "textarea",
591
+ {
592
+ autoFocus: !0,
593
+ tabIndex: 0,
594
+ value: s,
595
+ onChange: (f) => a(f.currentTarget.value),
596
+ className: "w-100",
597
+ rows: 5
598
+ }
599
+ ) }),
600
+ /* @__PURE__ */ r.jsxs(N.Footer, { children: [
601
+ /* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-secondary", onClick: d, children: t.cancel }),
602
+ /* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-primary ml", onClick: l, children: t.confirm })
603
+ ] })
604
+ ] });
605
+ }, qt = ({ children: t }) => {
606
+ const [e, o] = p(!1), [n, s] = p(""), a = E(() => {
607
+ }), d = m((g) => {
608
+ s(g), o(!0), console.log("showprompt");
609
+ }, []), l = m(() => {
610
+ o(!1);
611
+ }, []), f = $(() => ({ isShown: e, text: n, showPrompt: d, hidePrompt: l, resolveRef: a }), [l, e, d, n, a]);
612
+ return /* @__PURE__ */ r.jsxs(tt.Provider, { value: f, children: [
613
+ t,
614
+ /* @__PURE__ */ r.jsx(Yt, {})
615
+ ] });
616
+ }, Jt = ({ children: t }) => {
617
+ const [e, o] = p(!1), [n, s] = p(""), a = m((f) => {
618
+ o(!0), s(f);
619
+ }, []), d = m(() => {
620
+ o(!1);
621
+ }, []), l = $(() => ({ show: e, text: n, showConfirm: a, hideConfirm: d }), [e, n, a, d]);
622
+ return /* @__PURE__ */ r.jsxs(ot.Provider, { value: l, children: [
623
+ /* @__PURE__ */ r.jsx(Qt, {}),
624
+ t
625
+ ] });
626
+ }, ro = ({ axiosInstance: t, LinkComponent: e, language: o, axiosTexts: n, confirmTexts: s, formValidationTexts: a, homeDashboardTexts: d, formSubmitTexts: l, children: f }) => {
627
+ const g = $(() => ({
628
+ axiosInstance: t,
629
+ LinkComponent: e,
630
+ language: o,
631
+ axiosTexts: n,
632
+ confirmTexts: s,
633
+ formValidationTexts: a,
634
+ homeDashboardTexts: d,
635
+ formSubmitTexts: l
636
+ }), [
637
+ t,
638
+ e,
639
+ o,
640
+ n,
641
+ s,
642
+ a,
643
+ d,
644
+ l
645
+ ]);
646
+ return /* @__PURE__ */ r.jsx(Ce.Provider, { value: g, children: /* @__PURE__ */ r.jsx(Jt, { children: /* @__PURE__ */ r.jsxs(qt, { children: [
647
+ /* @__PURE__ */ r.jsx(nt, {}),
648
+ f
649
+ ] }) }) });
650
+ }, ao = ({ children: t }) => {
651
+ const [e, o] = p(!1), [n] = p(/* @__PURE__ */ new Set()), s = m((l) => {
652
+ n.add(l), o(!0);
653
+ }, [n]), a = m((l) => {
654
+ n.delete(l), n.size === 0 && o(!1);
655
+ }, [n]), d = $(() => ({ isLoading: e, startLoading: s, stopLoading: a }), [e, s, a]);
656
+ return /* @__PURE__ */ r.jsxs(st.Provider, { value: d, children: [
657
+ e && /* @__PURE__ */ r.jsx(Et, {}),
658
+ t
659
+ ] });
660
+ }, io = ({ children: t }) => {
661
+ const e = rt(), o = m(() => {
662
+ const u = localStorage.getItem("user") ?? null;
663
+ return u ? JSON.parse(u) : null;
664
+ }, []), [n, s] = p(o()), a = m(async () => {
665
+ let u = null;
666
+ return await e.get("/user/detail").then((M) => {
667
+ u = M.data;
668
+ }).catch(() => {
669
+ u = null;
670
+ }), localStorage.setItem("user", JSON.stringify(u)), u;
671
+ }, [e]), d = m(() => {
672
+ localStorage.removeItem("user");
673
+ }, []), l = m(async () => {
674
+ const u = await a();
675
+ return u ? (s(u), !0) : !1;
676
+ }, [a]), f = m(() => {
677
+ d(), s(null);
678
+ }, [d]), g = $(() => ({ user: n, loginUser: l, logoutUser: f }), [n, l, f]);
679
+ return re(() => {
680
+ s(o());
681
+ }, [o]), /* @__PURE__ */ r.jsx(at.Provider, { value: g, children: t });
682
+ }, Qt = () => {
683
+ const { confirmTexts: t } = be(Ce), { onConfirm: e, onCancel: o, text: n, show: s } = ct();
684
+ return /* @__PURE__ */ r.jsx(N, { show: s, size: "sm", centered: !0, onHide: o, children: /* @__PURE__ */ r.jsxs(N.Body, { children: [
685
+ /* @__PURE__ */ r.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ r.jsx(wt, { variant: "h6", children: n }) }),
686
+ /* @__PURE__ */ r.jsxs("div", { className: "w-100 d-flex gap-5", children: [
687
+ /* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-secondary w-100", onClick: o, children: t.no }),
688
+ /* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-primary w-100 ml", onClick: e, children: t.yes })
652
689
  ] })
653
690
  ] }) });
654
691
  };
655
692
  export {
656
- nt as LoadingContext,
657
- oo as LoadingProvider,
658
- Ae as LuminusComponentsContext,
659
- to as LuminusComponentsProvider,
660
- rt as UserContext,
661
- no as UserProvider
693
+ st as LoadingContext,
694
+ ao as LoadingProvider,
695
+ Ce as LuminusComponentsContext,
696
+ ro as LuminusComponentsProvider,
697
+ at as UserContext,
698
+ io as UserProvider
662
699
  };