react-luminus-components 1.2.116 → 1.2.118
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.
- package/dist/.vite/manifest.json +44 -44
- package/dist/{NoInputContainer-Dnr4Gmhz.cjs → NoInputContainer-BxMb-BuJ.cjs} +45 -45
- package/dist/{NoInputContainer-BrMG0XaD.js → NoInputContainer-Cl1VEez2.js} +1089 -1083
- package/dist/{PrimaryButton-B-rsu4mH.js → PrimaryButton-Dvh3Xiid.js} +1 -1
- package/dist/{PrimaryButton-BWsmVaS4.cjs → PrimaryButton-Jg-rT_fb.cjs} +1 -1
- package/dist/SimpleTooltip-CMrJHfcY.js +5 -0
- package/dist/{SimpleTooltip-C7etGi3z.cjs → SimpleTooltip-DA3RCxkm.cjs} +1 -1
- package/dist/contexts/user/UserContext.d.ts +2 -1
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +202 -187
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +20 -20
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +3 -3
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +521 -533
- package/dist/models/index.d.ts +2 -0
- package/dist/models/types/LoginState.d.ts +7 -0
- package/dist/models/types/UserLoginState.d.ts +7 -0
- package/dist/{useConfirm-Bc_hxaIH.js → useConfirm-BiFAJsnv.js} +5 -5
- package/dist/{useConfirm-zF4wI5M1.cjs → useConfirm-qcfEqXzH.cjs} +1 -1
- package/dist/{usePermissions-mjkkUVuj.cjs → usePermissions-BUCijjhX.cjs} +1 -1
- package/dist/{usePermissions-CvxtD-vS.js → usePermissions-C1W9RoyV.js} +1 -1
- package/package.json +1 -1
- package/dist/SimpleTooltip-iJa3SqpB.js +0 -5
package/dist/contexts.es.js
CHANGED
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import V, { useState as h, useCallback as f, useMemo as
|
|
1
|
+
import { j as a, am as G, Q as p, an as b, ao as M, ap as D, M as L, L as l, aq as F, ar as z, as as j, a4 as H, a8 as w, a9 as K, ab as T, aa as B, at as q } from "./NoInputContainer-Cl1VEez2.js";
|
|
2
|
+
import V, { useState as h, useCallback as f, useMemo as P, useContext as R, useEffect as v, useRef as $, useReducer as Q } from "react";
|
|
3
3
|
import "./latinize-BQrinury.js";
|
|
4
4
|
import "react-hook-form";
|
|
5
|
-
import { u as J, a as W } from "./useConfirm-
|
|
6
|
-
import { M as C, b as X, P as
|
|
5
|
+
import { u as J, a as W } from "./useConfirm-BiFAJsnv.js";
|
|
6
|
+
import { M as C, b as X, P as _, L as Y, E as u } from "./PrimaryButton-Dvh3Xiid.js";
|
|
7
7
|
const Z = ({ children: e }) => {
|
|
8
|
-
const [
|
|
9
|
-
|
|
10
|
-
}, []),
|
|
11
|
-
|
|
12
|
-
}, []),
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */
|
|
8
|
+
const [n, t] = h(!1), [o, s] = h(""), r = f((d) => {
|
|
9
|
+
t(!0), s(d);
|
|
10
|
+
}, []), c = f(() => {
|
|
11
|
+
t(!1);
|
|
12
|
+
}, []), i = P(() => ({ show: n, text: o, showConfirm: r, hideConfirm: c }), [n, o, r, c]);
|
|
13
|
+
return /* @__PURE__ */ a.jsxs(G.Provider, { value: i, children: [
|
|
14
|
+
/* @__PURE__ */ a.jsx(ae, {}),
|
|
15
15
|
e
|
|
16
16
|
] });
|
|
17
17
|
}, ee = () => {
|
|
18
|
-
const { confirmTexts: e } =
|
|
18
|
+
const { confirmTexts: e } = R(p), { isShown: n, text: t, onFinish: o } = J(), { options: s } = R(b), [r, c] = h(s.defaultValue ?? ""), i = f(() => {
|
|
19
19
|
o(null);
|
|
20
|
-
}, [o]), d = f((
|
|
21
|
-
|
|
22
|
-
}, [o,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
const m =
|
|
20
|
+
}, [o]), d = f((E) => {
|
|
21
|
+
E.preventDefault(), !(s.required && !r) && o(r);
|
|
22
|
+
}, [o, s.required, r]);
|
|
23
|
+
v(() => {
|
|
24
|
+
n === !0 && c(s.defaultValue ?? "");
|
|
25
|
+
}, [n, s.defaultValue]);
|
|
26
|
+
const m = P(() => ({
|
|
27
27
|
value: r,
|
|
28
|
-
onChange: (
|
|
28
|
+
onChange: (E) => c(E.currentTarget.value),
|
|
29
29
|
className: "w-100",
|
|
30
30
|
autoFocus: !0,
|
|
31
31
|
tabIndex: 0
|
|
32
32
|
}), [r]);
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
return /* @__PURE__ */ a.jsxs(C, { show: n, size: "sm", centered: !0, onHide: i, children: [
|
|
34
|
+
/* @__PURE__ */ a.jsx(C.Header, { className: "justify-content-center", children: /* @__PURE__ */ a.jsx(C.Title, { children: t }) }),
|
|
35
|
+
/* @__PURE__ */ a.jsxs("form", { onSubmit: d, children: [
|
|
36
|
+
/* @__PURE__ */ a.jsxs(C.Body, { children: [
|
|
37
|
+
s.input === "textarea" ? /* @__PURE__ */ a.jsx("textarea", { ...m, rows: 5 }) : void 0,
|
|
38
|
+
s.input === "input" ? /* @__PURE__ */ a.jsx(X, { ...m, type: s.type }) : void 0
|
|
39
39
|
] }),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ a.jsxs(C.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
41
|
+
/* @__PURE__ */ a.jsx(_, { variant: "outlined", color: "secondary", onClick: i, className: "flex-grow-1", children: e.cancel }),
|
|
42
|
+
/* @__PURE__ */ a.jsx(_, { color: "primary", disabled: s.required && !r, type: "submit", className: "flex-grow-1", children: e.confirm })
|
|
43
43
|
] })
|
|
44
44
|
] })
|
|
45
45
|
] });
|
|
46
|
-
},
|
|
47
|
-
const [
|
|
48
|
-
}), d = f((
|
|
49
|
-
|
|
46
|
+
}, te = ({ children: e }) => {
|
|
47
|
+
const [n, t] = h(!1), [o, s] = h(""), [r, c] = h({ input: "textarea", type: "text" }), i = $(() => {
|
|
48
|
+
}), d = f((S) => {
|
|
49
|
+
s(S), t(!0);
|
|
50
50
|
}, []), m = f(() => {
|
|
51
|
-
|
|
52
|
-
}, []),
|
|
53
|
-
isShown:
|
|
51
|
+
t(!1);
|
|
52
|
+
}, []), E = P(() => ({
|
|
53
|
+
isShown: n,
|
|
54
54
|
text: o,
|
|
55
55
|
showPrompt: d,
|
|
56
56
|
hidePrompt: m,
|
|
57
|
-
resolveRef:
|
|
57
|
+
resolveRef: i,
|
|
58
58
|
options: r,
|
|
59
|
-
setOptions:
|
|
60
|
-
}), [
|
|
61
|
-
return /* @__PURE__ */
|
|
59
|
+
setOptions: c
|
|
60
|
+
}), [n, o, d, m, r]);
|
|
61
|
+
return /* @__PURE__ */ a.jsxs(b.Provider, { value: E, children: [
|
|
62
62
|
e,
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ a.jsx(ee, {})
|
|
64
64
|
] });
|
|
65
|
-
},
|
|
66
|
-
const
|
|
67
|
-
axiosOptions:
|
|
65
|
+
}, fe = ({ cookieDomain: e, axiosOptions: n, LinkComponent: t, NavigateComponent: o, language: s, axiosTexts: r, confirmTexts: c, formValidationTexts: i, homeDashboardTexts: d, formSubmitTexts: m, appSearchTexts: E, customSelectTexts: S, errorBoundaryTexts: y, widgetTexts: I, children: N }) => {
|
|
66
|
+
const A = P(() => ({
|
|
67
|
+
axiosOptions: n,
|
|
68
68
|
cookieDomain: e,
|
|
69
|
-
LinkComponent:
|
|
69
|
+
LinkComponent: t,
|
|
70
70
|
NavigateComponent: o,
|
|
71
|
-
language:
|
|
71
|
+
language: s,
|
|
72
72
|
axiosTexts: r,
|
|
73
|
-
confirmTexts:
|
|
74
|
-
formValidationTexts:
|
|
73
|
+
confirmTexts: c,
|
|
74
|
+
formValidationTexts: i,
|
|
75
75
|
homeDashboardTexts: d,
|
|
76
76
|
formSubmitTexts: m,
|
|
77
|
-
appSearchTexts:
|
|
78
|
-
customSelectTexts:
|
|
79
|
-
errorBoundaryTexts:
|
|
80
|
-
widgetTexts:
|
|
77
|
+
appSearchTexts: E,
|
|
78
|
+
customSelectTexts: S,
|
|
79
|
+
errorBoundaryTexts: y,
|
|
80
|
+
widgetTexts: I
|
|
81
81
|
}), [
|
|
82
|
-
s,
|
|
83
|
-
e,
|
|
84
82
|
n,
|
|
85
|
-
|
|
83
|
+
e,
|
|
86
84
|
t,
|
|
85
|
+
o,
|
|
86
|
+
s,
|
|
87
87
|
r,
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
c,
|
|
89
|
+
i,
|
|
90
90
|
d,
|
|
91
91
|
m,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
E,
|
|
93
|
+
S,
|
|
94
|
+
y,
|
|
95
|
+
I
|
|
96
96
|
]);
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
97
|
+
return /* @__PURE__ */ a.jsx(p.Provider, { value: A, children: /* @__PURE__ */ a.jsx(Z, { children: /* @__PURE__ */ a.jsxs(te, { children: [
|
|
98
|
+
/* @__PURE__ */ a.jsx(M, {}),
|
|
99
|
+
N
|
|
100
100
|
] }) }) });
|
|
101
|
-
},
|
|
102
|
-
const [
|
|
103
|
-
o.add(
|
|
104
|
-
}, [o]), r = f((
|
|
105
|
-
o.delete(
|
|
106
|
-
}, [o]),
|
|
107
|
-
return /* @__PURE__ */
|
|
108
|
-
|
|
101
|
+
}, Ee = ({ children: e }) => {
|
|
102
|
+
const [n, t] = h(!1), [o] = h(/* @__PURE__ */ new Set()), s = f((i) => {
|
|
103
|
+
o.add(i), t(!0);
|
|
104
|
+
}, [o]), r = f((i) => {
|
|
105
|
+
o.delete(i), o.size === 0 && t(!1);
|
|
106
|
+
}, [o]), c = P(() => ({ isLoading: n, startLoading: s, stopLoading: r }), [n, s, r]);
|
|
107
|
+
return /* @__PURE__ */ a.jsxs(D.Provider, { value: c, children: [
|
|
108
|
+
n && /* @__PURE__ */ a.jsx(Y, {}),
|
|
109
109
|
e
|
|
110
110
|
] });
|
|
111
111
|
};
|
|
112
112
|
/*! @azure/msal-browser v3.14.0 2024-05-07 */
|
|
113
|
-
class
|
|
113
|
+
class se {
|
|
114
114
|
/**
|
|
115
115
|
* Gets interaction status from event message
|
|
116
116
|
* @param message
|
|
117
117
|
* @param currentStatus
|
|
118
118
|
*/
|
|
119
|
-
static getInteractionStatusFromEvent(
|
|
120
|
-
switch (
|
|
119
|
+
static getInteractionStatusFromEvent(n, t) {
|
|
120
|
+
switch (n.eventType) {
|
|
121
121
|
case u.LOGIN_START:
|
|
122
|
-
return
|
|
122
|
+
return l.Login;
|
|
123
123
|
case u.SSO_SILENT_START:
|
|
124
|
-
return
|
|
124
|
+
return l.SsoSilent;
|
|
125
125
|
case u.ACQUIRE_TOKEN_START:
|
|
126
|
-
if (
|
|
127
|
-
return
|
|
126
|
+
if (n.interactionType === L.Redirect || n.interactionType === L.Popup)
|
|
127
|
+
return l.AcquireToken;
|
|
128
128
|
break;
|
|
129
129
|
case u.HANDLE_REDIRECT_START:
|
|
130
|
-
return
|
|
130
|
+
return l.HandleRedirect;
|
|
131
131
|
case u.LOGOUT_START:
|
|
132
|
-
return
|
|
132
|
+
return l.Logout;
|
|
133
133
|
case u.SSO_SILENT_SUCCESS:
|
|
134
134
|
case u.SSO_SILENT_FAILURE:
|
|
135
|
-
if (
|
|
135
|
+
if (t && t !== l.SsoSilent)
|
|
136
136
|
break;
|
|
137
|
-
return
|
|
137
|
+
return l.None;
|
|
138
138
|
case u.LOGOUT_END:
|
|
139
|
-
if (
|
|
139
|
+
if (t && t !== l.Logout)
|
|
140
140
|
break;
|
|
141
|
-
return
|
|
141
|
+
return l.None;
|
|
142
142
|
case u.HANDLE_REDIRECT_END:
|
|
143
|
-
if (
|
|
143
|
+
if (t && t !== l.HandleRedirect)
|
|
144
144
|
break;
|
|
145
|
-
return
|
|
145
|
+
return l.None;
|
|
146
146
|
case u.LOGIN_SUCCESS:
|
|
147
147
|
case u.LOGIN_FAILURE:
|
|
148
148
|
case u.ACQUIRE_TOKEN_SUCCESS:
|
|
149
149
|
case u.ACQUIRE_TOKEN_FAILURE:
|
|
150
150
|
case u.RESTORE_FROM_BFCACHE:
|
|
151
|
-
if (
|
|
152
|
-
if (
|
|
151
|
+
if (n.interactionType === L.Redirect || n.interactionType === L.Popup) {
|
|
152
|
+
if (t && t !== l.Login && t !== l.AcquireToken)
|
|
153
153
|
break;
|
|
154
|
-
return
|
|
154
|
+
return l.None;
|
|
155
155
|
}
|
|
156
156
|
break;
|
|
157
157
|
}
|
|
@@ -159,176 +159,191 @@ class te {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
/*! @azure/msal-react v2.0.16 2024-05-07 */
|
|
162
|
-
const
|
|
162
|
+
const ne = "@azure/msal-react", k = "2.0.16";
|
|
163
163
|
/*! @azure/msal-react v2.0.16 2024-05-07 */
|
|
164
|
-
const
|
|
164
|
+
const O = {
|
|
165
165
|
UNBLOCK_INPROGRESS: "UNBLOCK_INPROGRESS",
|
|
166
166
|
EVENT: "EVENT"
|
|
167
|
-
}, oe = (e,
|
|
168
|
-
const { type:
|
|
169
|
-
let
|
|
170
|
-
switch (
|
|
171
|
-
case
|
|
172
|
-
e.inProgress ===
|
|
167
|
+
}, oe = (e, n) => {
|
|
168
|
+
const { type: t, payload: o } = n;
|
|
169
|
+
let s = e.inProgress;
|
|
170
|
+
switch (t) {
|
|
171
|
+
case O.UNBLOCK_INPROGRESS:
|
|
172
|
+
e.inProgress === l.Startup && (s = l.None, o.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));
|
|
173
173
|
break;
|
|
174
|
-
case
|
|
175
|
-
const
|
|
176
|
-
|
|
174
|
+
case O.EVENT:
|
|
175
|
+
const c = o.message, i = se.getInteractionStatusFromEvent(c, e.inProgress);
|
|
176
|
+
i && (o.logger.info(`MsalProvider - ${c.eventType} results in setting inProgress from ${e.inProgress} to ${i}`), s = i);
|
|
177
177
|
break;
|
|
178
178
|
default:
|
|
179
|
-
throw new Error(`Unknown action type: ${
|
|
179
|
+
throw new Error(`Unknown action type: ${t}`);
|
|
180
180
|
}
|
|
181
181
|
const r = o.instance.getAllAccounts();
|
|
182
|
-
return
|
|
182
|
+
return s !== e.inProgress && !j(r, e.accounts) ? {
|
|
183
183
|
...e,
|
|
184
|
-
inProgress:
|
|
184
|
+
inProgress: s,
|
|
185
185
|
accounts: r
|
|
186
|
-
} :
|
|
186
|
+
} : s !== e.inProgress ? {
|
|
187
187
|
...e,
|
|
188
|
-
inProgress:
|
|
189
|
-
} :
|
|
188
|
+
inProgress: s
|
|
189
|
+
} : j(r, e.accounts) ? e : {
|
|
190
190
|
...e,
|
|
191
191
|
accounts: r
|
|
192
192
|
};
|
|
193
193
|
};
|
|
194
|
-
function re({ instance: e, children:
|
|
195
|
-
|
|
196
|
-
e.initializeWrapperLibrary(
|
|
194
|
+
function re({ instance: e, children: n }) {
|
|
195
|
+
v(() => {
|
|
196
|
+
e.initializeWrapperLibrary(F.React, k);
|
|
197
197
|
}, [e]);
|
|
198
|
-
const
|
|
199
|
-
inProgress:
|
|
198
|
+
const t = P(() => e.getLogger().clone(ne, k), [e]), [o, s] = Q(oe, void 0, () => ({
|
|
199
|
+
inProgress: l.Startup,
|
|
200
200
|
accounts: e.getAllAccounts()
|
|
201
201
|
}));
|
|
202
|
-
|
|
203
|
-
const
|
|
204
|
-
|
|
202
|
+
v(() => {
|
|
203
|
+
const c = e.addEventCallback((i) => {
|
|
204
|
+
s({
|
|
205
205
|
payload: {
|
|
206
206
|
instance: e,
|
|
207
|
-
logger:
|
|
208
|
-
message:
|
|
207
|
+
logger: t,
|
|
208
|
+
message: i
|
|
209
209
|
},
|
|
210
|
-
type:
|
|
210
|
+
type: O.EVENT
|
|
211
211
|
});
|
|
212
212
|
});
|
|
213
|
-
return
|
|
213
|
+
return t.verbose(`MsalProvider - Registered event callback with id: ${c}`), e.initialize().then(() => {
|
|
214
214
|
e.handleRedirectPromise().catch(() => {
|
|
215
215
|
}).finally(() => {
|
|
216
|
-
|
|
216
|
+
s({
|
|
217
217
|
payload: {
|
|
218
218
|
instance: e,
|
|
219
|
-
logger:
|
|
219
|
+
logger: t
|
|
220
220
|
},
|
|
221
|
-
type:
|
|
221
|
+
type: O.UNBLOCK_INPROGRESS
|
|
222
222
|
});
|
|
223
223
|
});
|
|
224
224
|
}).catch(() => {
|
|
225
225
|
}), () => {
|
|
226
|
-
|
|
226
|
+
c && (t.verbose(`MsalProvider - Removing event callback ${c}`), e.removeEventCallback(c));
|
|
227
227
|
};
|
|
228
|
-
}, [e,
|
|
228
|
+
}, [e, t]);
|
|
229
229
|
const r = {
|
|
230
230
|
instance: e,
|
|
231
231
|
inProgress: o.inProgress,
|
|
232
232
|
accounts: o.accounts,
|
|
233
|
-
logger:
|
|
233
|
+
logger: t
|
|
234
234
|
};
|
|
235
|
-
return V.createElement(
|
|
235
|
+
return V.createElement(z.Provider, { value: r }, n);
|
|
236
236
|
}
|
|
237
|
-
const
|
|
238
|
-
const
|
|
237
|
+
const ge = ({ children: e }) => {
|
|
238
|
+
const n = H(), { msalInstance: t } = R(w), { getToken: o } = K(), [s, r] = h(null), c = f(async () => {
|
|
239
239
|
const g = await o();
|
|
240
|
-
g &&
|
|
240
|
+
g && r(g);
|
|
241
241
|
}, [o]);
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}, [
|
|
245
|
-
const
|
|
242
|
+
v(() => {
|
|
243
|
+
c();
|
|
244
|
+
}, [c]);
|
|
245
|
+
const d = f(() => {
|
|
246
246
|
const g = localStorage.getItem("user") ?? null;
|
|
247
247
|
return g ? JSON.parse(g ?? "") : null;
|
|
248
|
-
}, []), [
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
248
|
+
}, [])(), [m, E] = h({
|
|
249
|
+
state: d ? T.LOGGED_IN : T.LOGGED_OUT,
|
|
250
|
+
user: d
|
|
251
|
+
}), S = f(async (g) => {
|
|
252
|
+
let x = null;
|
|
253
|
+
return await n.get("/user/detail", g ? { headers: { Authorization: `Bearer ${g}` } } : void 0).then((U) => {
|
|
254
|
+
x = U.data;
|
|
252
255
|
}).catch(() => {
|
|
253
|
-
|
|
254
|
-
}),
|
|
255
|
-
}, [
|
|
256
|
-
localStorage.removeItem("user"),
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
256
|
+
x = null;
|
|
257
|
+
}), x;
|
|
258
|
+
}, [n]), y = f(() => {
|
|
259
|
+
localStorage.removeItem("user"), E({
|
|
260
|
+
state: T.LOGGED_OUT,
|
|
261
|
+
user: null
|
|
262
|
+
});
|
|
263
|
+
}, []), I = f(async (g) => {
|
|
264
|
+
E({
|
|
265
|
+
state: T.LOGGING_IN,
|
|
266
|
+
user: null
|
|
267
|
+
});
|
|
268
|
+
const x = await S(g);
|
|
269
|
+
return x ? (E({
|
|
270
|
+
state: T.LOGGED_IN,
|
|
271
|
+
user: x
|
|
272
|
+
}), localStorage.setItem("user", JSON.stringify(x)), !0) : (E({
|
|
273
|
+
state: T.LOGIN_FAILED,
|
|
274
|
+
user: null
|
|
275
|
+
}), !1);
|
|
276
|
+
}, [S]), N = f(() => {
|
|
277
|
+
y();
|
|
278
|
+
}, [y]), A = P(() => ({
|
|
279
|
+
user: m.user,
|
|
280
|
+
userLoginState: m,
|
|
281
|
+
loginUser: I,
|
|
282
|
+
logoutUser: N
|
|
283
|
+
}), [m, I, N]);
|
|
284
|
+
return v(() => {
|
|
285
|
+
if (t) {
|
|
286
|
+
const g = t.addEventCallback((x) => {
|
|
287
|
+
if (x.eventType === u.LOGIN_SUCCESS && x.payload) {
|
|
288
|
+
const U = x.payload;
|
|
289
|
+
r(U.accessToken);
|
|
275
290
|
}
|
|
276
291
|
});
|
|
277
292
|
return () => {
|
|
278
|
-
g &&
|
|
293
|
+
g && t.removeEventCallback(g);
|
|
279
294
|
};
|
|
280
295
|
}
|
|
281
296
|
return () => {
|
|
282
297
|
};
|
|
283
|
-
}, [
|
|
284
|
-
|
|
285
|
-
}, [
|
|
286
|
-
},
|
|
287
|
-
const { cookieDomain:
|
|
298
|
+
}, [t, I, N]), v(() => {
|
|
299
|
+
s && I(s).catch(() => N());
|
|
300
|
+
}, [s, I, N]), /* @__PURE__ */ a.jsx(B.Provider, { value: A, children: e });
|
|
301
|
+
}, xe = ({ ...e }) => {
|
|
302
|
+
const { cookieDomain: n } = R(p), [, t] = q(["Authorization"]), o = P(() => ({
|
|
288
303
|
useMsal: e.useMsal ?? !1,
|
|
289
304
|
msalInstance: e.useMsal ? e.msalInstance ?? null : null,
|
|
290
305
|
msalScopes: e.useMsal ? e.msalScopes ?? [] : []
|
|
291
306
|
}), [e]);
|
|
292
|
-
return
|
|
307
|
+
return v(() => {
|
|
293
308
|
if (e.useMsal) {
|
|
294
|
-
const
|
|
309
|
+
const s = e.msalInstance.addEventCallback((r) => {
|
|
295
310
|
if (r.eventType === u.LOGIN_SUCCESS || r.eventType === u.ACQUIRE_TOKEN_SUCCESS && r.payload) {
|
|
296
|
-
const
|
|
297
|
-
e.msalInstance.setActiveAccount(
|
|
298
|
-
const d =
|
|
299
|
-
|
|
311
|
+
const c = r.payload, i = c.account;
|
|
312
|
+
e.msalInstance.setActiveAccount(i);
|
|
313
|
+
const d = c.accessToken, m = c.expiresOn;
|
|
314
|
+
t("Authorization", d, {
|
|
300
315
|
path: "/",
|
|
301
316
|
secure: !0,
|
|
302
317
|
sameSite: "none",
|
|
303
|
-
domain:
|
|
318
|
+
domain: n,
|
|
304
319
|
expires: m ?? void 0
|
|
305
320
|
});
|
|
306
321
|
}
|
|
307
322
|
});
|
|
308
323
|
return () => {
|
|
309
|
-
|
|
324
|
+
s && e.msalInstance.removeEventCallback(s);
|
|
310
325
|
};
|
|
311
326
|
}
|
|
312
327
|
return () => {
|
|
313
328
|
};
|
|
314
|
-
}, [e,
|
|
329
|
+
}, [e, t, n]), /* @__PURE__ */ a.jsx(w.Provider, { value: o, children: e.useMsal ? /* @__PURE__ */ a.jsx(re, { instance: e.msalInstance, children: e.children }) : e.children });
|
|
315
330
|
}, ae = () => {
|
|
316
|
-
const { confirmTexts: e } =
|
|
317
|
-
return /* @__PURE__ */
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */
|
|
331
|
+
const { confirmTexts: e } = R(p), { onConfirm: n, onCancel: t, text: o, show: s } = W();
|
|
332
|
+
return /* @__PURE__ */ a.jsxs(C, { show: s, size: "sm", centered: !0, onHide: t, children: [
|
|
333
|
+
/* @__PURE__ */ a.jsx(C.Header, { className: "justify-content-center", children: /* @__PURE__ */ a.jsx(C.Title, { children: o }) }),
|
|
334
|
+
/* @__PURE__ */ a.jsx(C.Body, { children: /* @__PURE__ */ a.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
335
|
+
/* @__PURE__ */ a.jsx(_, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: t, children: e.no }),
|
|
336
|
+
/* @__PURE__ */ a.jsx(_, { type: "button", color: "primary", onClick: n, className: "w-100 ml", children: e.yes })
|
|
322
337
|
] }) })
|
|
323
338
|
] });
|
|
324
339
|
};
|
|
325
340
|
export {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
341
|
+
w as AuthContext,
|
|
342
|
+
xe as AuthProvider,
|
|
343
|
+
D as LoadingContext,
|
|
344
|
+
Ee as LoadingProvider,
|
|
345
|
+
p as LuminusComponentsContext,
|
|
346
|
+
fe as LuminusComponentsProvider,
|
|
332
347
|
B as UserContext,
|
|
333
|
-
|
|
348
|
+
ge as UserProvider
|
|
334
349
|
};
|