react-luminus-components 1.2.33 → 1.2.35
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 +59 -61
- package/dist/EventType-Dodj1wMo.cjs +1 -0
- package/dist/EventType-SEEDuisM.js +636 -0
- package/dist/SimpleTooltip-MhGCEWts.js +5 -0
- package/dist/{SimpleTooltip-CjMfPKvQ.cjs → SimpleTooltip-OE_cbcNU.cjs} +1 -1
- package/dist/{UserAvatarToggle-BWDRIIXE.js → UserAvatarToggle-CH7OqxNp.js} +2104 -2001
- package/dist/UserAvatarToggle-rzyVxLmG.cjs +253 -0
- package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +4 -1
- package/dist/components/common/HomeDashboard/comps/WidgetPicker/WidgetPicker.d.ts +11 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +205 -776
- package/dist/dateUtils-CWKBTsx7.cjs +1 -0
- package/dist/dateUtils-Crak7ii9.js +131 -0
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +19 -18
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +42 -42
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +1258 -1303
- package/dist/models/texts/HomeDashboardTexts.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{textUtils-BLtD0zaS.js → textUtils-BbxuIsKq.js} +2 -2
- package/dist/{useConfirm-QOAtP0re.cjs → useConfirm-9zGqmWEb.cjs} +1 -1
- package/dist/{useConfirm-CKDkB8lL.js → useConfirm-B3BI8PzR.js} +11 -11
- package/dist/{useKeyPress-DuxmarzT.js → useKeyPress-CwWcvmEW.js} +2 -2
- package/dist/usePermissions-CO93mmCn.cjs +1 -0
- package/dist/usePermissions-DVO-znuB.js +13 -0
- package/dist/utils/hookForm/hookFormUtils.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +13 -136
- package/package.json +1 -1
- package/dist/EventType-D1zXMD8A.js +0 -63
- package/dist/EventType-DO8vvA6X.cjs +0 -1
- package/dist/SimpleTooltip-cMiObSvf.js +0 -5
- package/dist/Typography-B12JkmMC.js +0 -36
- package/dist/Typography-Plu1Wa0_.cjs +0 -1
- package/dist/UserAvatarToggle-DEb7Klk7.cjs +0 -253
- package/dist/usePermissions-Cg_BMKPX.js +0 -12
- package/dist/usePermissions-zYTcBjf7.cjs +0 -1
package/dist/contexts.es.js
CHANGED
|
@@ -1,721 +1,150 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
onClick: xe.func,
|
|
17
|
-
/**
|
|
18
|
-
* Render different color variant for the button.
|
|
19
|
-
*
|
|
20
|
-
* Omitting this will render the default dark color.
|
|
21
|
-
*/
|
|
22
|
-
variant: xe.oneOf(["white"])
|
|
23
|
-
}, ke = /* @__PURE__ */ R.forwardRef(({
|
|
24
|
-
className: e,
|
|
25
|
-
variant: t,
|
|
26
|
-
"aria-label": n = "Close",
|
|
27
|
-
...o
|
|
28
|
-
}, s) => /* @__PURE__ */ a.jsx("button", {
|
|
29
|
-
ref: s,
|
|
30
|
-
type: "button",
|
|
31
|
-
className: N("btn-close", t && `btn-close-${t}`, e),
|
|
32
|
-
"aria-label": n,
|
|
33
|
-
...o
|
|
34
|
-
}));
|
|
35
|
-
ke.displayName = "CloseButton";
|
|
36
|
-
ke.propTypes = Pt;
|
|
37
|
-
var ce;
|
|
38
|
-
function Ue(e) {
|
|
39
|
-
if ((!ce && ce !== 0 || e) && Se) {
|
|
40
|
-
var t = document.createElement("div");
|
|
41
|
-
t.style.position = "absolute", t.style.top = "-9999px", t.style.width = "50px", t.style.height = "50px", t.style.overflow = "scroll", document.body.appendChild(t), ce = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
42
|
-
}
|
|
43
|
-
return ce;
|
|
44
|
-
}
|
|
45
|
-
function Ne(e) {
|
|
46
|
-
e === void 0 && (e = He());
|
|
47
|
-
try {
|
|
48
|
-
var t = e.activeElement;
|
|
49
|
-
return !t || !t.nodeName ? null : t;
|
|
50
|
-
} catch {
|
|
51
|
-
return e.body;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function Ut(e = document) {
|
|
55
|
-
const t = e.defaultView;
|
|
56
|
-
return Math.abs(t.innerWidth - e.documentElement.clientWidth);
|
|
57
|
-
}
|
|
58
|
-
const Fe = It("modal-open");
|
|
59
|
-
class Me {
|
|
60
|
-
constructor({
|
|
61
|
-
ownerDocument: t,
|
|
62
|
-
handleContainerOverflow: n = !0,
|
|
63
|
-
isRTL: o = !1
|
|
64
|
-
} = {}) {
|
|
65
|
-
this.handleContainerOverflow = n, this.isRTL = o, this.modals = [], this.ownerDocument = t;
|
|
66
|
-
}
|
|
67
|
-
getScrollbarWidth() {
|
|
68
|
-
return Ut(this.ownerDocument);
|
|
69
|
-
}
|
|
70
|
-
getElement() {
|
|
71
|
-
return (this.ownerDocument || document).body;
|
|
72
|
-
}
|
|
73
|
-
setModalAttributes(t) {
|
|
74
|
-
}
|
|
75
|
-
removeModalAttributes(t) {
|
|
76
|
-
}
|
|
77
|
-
setContainerStyle(t) {
|
|
78
|
-
const n = {
|
|
79
|
-
overflow: "hidden"
|
|
80
|
-
}, o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.getElement();
|
|
81
|
-
t.style = {
|
|
82
|
-
overflow: s.style.overflow,
|
|
83
|
-
[o]: s.style[o]
|
|
84
|
-
}, t.scrollBarWidth && (n[o] = `${parseInt(J(s, o) || "0", 10) + t.scrollBarWidth}px`), s.setAttribute(Fe, ""), J(s, n);
|
|
85
|
-
}
|
|
86
|
-
reset() {
|
|
87
|
-
[...this.modals].forEach((t) => this.remove(t));
|
|
88
|
-
}
|
|
89
|
-
removeContainerStyle(t) {
|
|
90
|
-
const n = this.getElement();
|
|
91
|
-
n.removeAttribute(Fe), Object.assign(n.style, t.style);
|
|
92
|
-
}
|
|
93
|
-
add(t) {
|
|
94
|
-
let n = this.modals.indexOf(t);
|
|
95
|
-
return n !== -1 || (n = this.modals.length, this.modals.push(t), this.setModalAttributes(t), n !== 0) || (this.state = {
|
|
96
|
-
scrollBarWidth: this.getScrollbarWidth(),
|
|
97
|
-
style: {}
|
|
98
|
-
}, this.handleContainerOverflow && this.setContainerStyle(this.state)), n;
|
|
99
|
-
}
|
|
100
|
-
remove(t) {
|
|
101
|
-
const n = this.modals.indexOf(t);
|
|
102
|
-
n !== -1 && (this.modals.splice(n, 1), !this.modals.length && this.handleContainerOverflow && this.removeContainerStyle(this.state), this.removeModalAttributes(t));
|
|
103
|
-
}
|
|
104
|
-
isTopModal(t) {
|
|
105
|
-
return !!this.modals.length && this.modals[this.modals.length - 1] === t;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
const Ft = ["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
|
-
function Dt(e, t) {
|
|
110
|
-
if (e == null)
|
|
111
|
-
return {};
|
|
112
|
-
var n = {}, o = Object.keys(e), s, r;
|
|
113
|
-
for (r = 0; r < o.length; r++)
|
|
114
|
-
s = o[r], !(t.indexOf(s) >= 0) && (n[s] = e[s]);
|
|
115
|
-
return n;
|
|
116
|
-
}
|
|
117
|
-
let be;
|
|
118
|
-
function Wt(e) {
|
|
119
|
-
return be || (be = new Me({
|
|
120
|
-
ownerDocument: e == null ? void 0 : e.document
|
|
121
|
-
})), be;
|
|
122
|
-
}
|
|
123
|
-
function Ht(e) {
|
|
124
|
-
const t = Ke(), n = e || Wt(t), o = O({
|
|
125
|
-
dialog: null,
|
|
126
|
-
backdrop: null
|
|
127
|
-
});
|
|
128
|
-
return Object.assign(o.current, {
|
|
129
|
-
add: () => n.add(o.current),
|
|
130
|
-
remove: () => n.remove(o.current),
|
|
131
|
-
isTopModal: () => n.isTopModal(o.current),
|
|
132
|
-
setDialogRef: y((s) => {
|
|
133
|
-
o.current.dialog = s;
|
|
134
|
-
}, []),
|
|
135
|
-
setBackdropRef: y((s) => {
|
|
136
|
-
o.current.backdrop = s;
|
|
137
|
-
}, [])
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
const qe = /* @__PURE__ */ wt((e, t) => {
|
|
141
|
-
let {
|
|
142
|
-
show: n = !1,
|
|
143
|
-
role: o = "dialog",
|
|
144
|
-
className: s,
|
|
145
|
-
style: r,
|
|
146
|
-
children: l,
|
|
147
|
-
backdrop: i = !0,
|
|
148
|
-
keyboard: d = !0,
|
|
149
|
-
onBackdropClick: h,
|
|
150
|
-
onEscapeKeyDown: g,
|
|
151
|
-
transition: f,
|
|
152
|
-
runTransition: m,
|
|
153
|
-
backdropTransition: T,
|
|
154
|
-
runBackdropTransition: fe,
|
|
155
|
-
autoFocus: X = !0,
|
|
156
|
-
enforceFocus: he = !0,
|
|
157
|
-
restoreFocus: j = !0,
|
|
158
|
-
restoreFocusOptions: me,
|
|
159
|
-
renderDialog: Y,
|
|
160
|
-
renderBackdrop: ge = (u) => /* @__PURE__ */ a.jsx("div", Object.assign({}, u)),
|
|
161
|
-
manager: pe,
|
|
162
|
-
container: Ee,
|
|
163
|
-
onShow: Z,
|
|
164
|
-
onHide: $ = () => {
|
|
165
|
-
},
|
|
166
|
-
onExit: ve,
|
|
167
|
-
onExited: G,
|
|
168
|
-
onExiting: ee,
|
|
169
|
-
onEnter: te,
|
|
170
|
-
onEntering: ne,
|
|
171
|
-
onEntered: oe
|
|
172
|
-
} = e, ye = Dt(e, Ft);
|
|
173
|
-
const S = Ke(), L = lt(Ee), p = Ht(pe), Ce = ct(), se = jt(n), [A, _] = C(!n), x = O(null);
|
|
174
|
-
St(t, () => p, [p]), Se && !se && n && (x.current = Ne(S == null ? void 0 : S.document)), n && A && _(!1);
|
|
175
|
-
const k = M(() => {
|
|
176
|
-
if (p.add(), B.current = je(document, "keydown", Re), V.current = je(
|
|
177
|
-
document,
|
|
178
|
-
"focus",
|
|
179
|
-
// the timeout is necessary b/c this will run before the new modal is mounted
|
|
180
|
-
// and so steals focus from it
|
|
181
|
-
() => setTimeout(Te),
|
|
182
|
-
!0
|
|
183
|
-
), Z && Z(), X) {
|
|
184
|
-
var u, ie;
|
|
185
|
-
const Q = Ne((u = (ie = p.dialog) == null ? void 0 : ie.ownerDocument) != null ? u : S == null ? void 0 : S.document);
|
|
186
|
-
p.dialog && Q && !Le(p.dialog, Q) && (x.current = Q, p.dialog.focus());
|
|
187
|
-
}
|
|
188
|
-
}), z = M(() => {
|
|
189
|
-
if (p.remove(), B.current == null || B.current(), V.current == null || V.current(), j) {
|
|
190
|
-
var u;
|
|
191
|
-
(u = x.current) == null || u.focus == null || u.focus(me), x.current = null;
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
b(() => {
|
|
195
|
-
!n || !L || k();
|
|
196
|
-
}, [
|
|
197
|
-
n,
|
|
198
|
-
L,
|
|
199
|
-
/* should never change: */
|
|
200
|
-
k
|
|
201
|
-
]), b(() => {
|
|
202
|
-
A && z();
|
|
203
|
-
}, [A, z]), $e(() => {
|
|
204
|
-
z();
|
|
205
|
-
});
|
|
206
|
-
const Te = M(() => {
|
|
207
|
-
if (!he || !Ce() || !p.isTopModal())
|
|
208
|
-
return;
|
|
209
|
-
const u = Ne(S == null ? void 0 : S.document);
|
|
210
|
-
p.dialog && u && !Le(p.dialog, u) && p.dialog.focus();
|
|
211
|
-
}), re = M((u) => {
|
|
212
|
-
u.target === u.currentTarget && (h == null || h(u), i === !0 && $());
|
|
213
|
-
}), Re = M((u) => {
|
|
214
|
-
d && dt(u) && p.isTopModal() && (g == null || g(u), u.defaultPrevented || $());
|
|
215
|
-
}), V = O(), B = O(), ae = (...u) => {
|
|
216
|
-
_(!0), G == null || G(...u);
|
|
217
|
-
};
|
|
218
|
-
if (!L)
|
|
219
|
-
return null;
|
|
220
|
-
const P = Object.assign({
|
|
221
|
-
role: o,
|
|
222
|
-
ref: p.setDialogRef,
|
|
223
|
-
// apparently only works on the dialog role element
|
|
224
|
-
"aria-modal": o === "dialog" ? !0 : void 0
|
|
225
|
-
}, ye, {
|
|
226
|
-
style: r,
|
|
227
|
-
className: s,
|
|
228
|
-
tabIndex: -1
|
|
229
|
-
});
|
|
230
|
-
let q = Y ? Y(P) : /* @__PURE__ */ a.jsx("div", Object.assign({}, P, {
|
|
231
|
-
children: /* @__PURE__ */ R.cloneElement(l, {
|
|
232
|
-
role: "document"
|
|
233
|
-
})
|
|
234
|
-
}));
|
|
235
|
-
q = _e(f, m, {
|
|
236
|
-
unmountOnExit: !0,
|
|
237
|
-
mountOnEnter: !0,
|
|
238
|
-
appear: !0,
|
|
239
|
-
in: !!n,
|
|
240
|
-
onExit: ve,
|
|
241
|
-
onExiting: ee,
|
|
242
|
-
onExited: ae,
|
|
243
|
-
onEnter: te,
|
|
244
|
-
onEntering: ne,
|
|
245
|
-
onEntered: oe,
|
|
246
|
-
children: q
|
|
247
|
-
});
|
|
248
|
-
let U = null;
|
|
249
|
-
return i && (U = ge({
|
|
250
|
-
ref: p.setBackdropRef,
|
|
251
|
-
onClick: re
|
|
252
|
-
}), U = _e(T, fe, {
|
|
253
|
-
in: !!n,
|
|
254
|
-
appear: !0,
|
|
255
|
-
mountOnEnter: !0,
|
|
256
|
-
unmountOnExit: !0,
|
|
257
|
-
children: U
|
|
258
|
-
})), /* @__PURE__ */ a.jsx(a.Fragment, {
|
|
259
|
-
children: /* @__PURE__ */ _t.createPortal(/* @__PURE__ */ a.jsxs(a.Fragment, {
|
|
260
|
-
children: [U, q]
|
|
261
|
-
}), L)
|
|
262
|
-
});
|
|
263
|
-
});
|
|
264
|
-
qe.displayName = "Modal";
|
|
265
|
-
const Kt = Object.assign(qe, {
|
|
266
|
-
Manager: Me
|
|
267
|
-
});
|
|
268
|
-
function $t(e, t) {
|
|
269
|
-
e.classList ? e.classList.add(t) : ut(e, t) || (typeof e.className == "string" ? e.className = e.className + " " + t : e.setAttribute("class", (e.className && e.className.baseVal || "") + " " + t));
|
|
270
|
-
}
|
|
271
|
-
function De(e, t) {
|
|
272
|
-
return e.replace(new RegExp("(^|\\s)" + t + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
|
|
273
|
-
}
|
|
274
|
-
function Gt(e, t) {
|
|
275
|
-
e.classList ? e.classList.remove(t) : typeof e.className == "string" ? e.className = De(e.className, t) : e.setAttribute("class", De(e.className && e.className.baseVal || "", t));
|
|
276
|
-
}
|
|
277
|
-
const W = {
|
|
278
|
-
FIXED_CONTENT: ".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",
|
|
279
|
-
STICKY_CONTENT: ".sticky-top",
|
|
280
|
-
NAVBAR_TOGGLER: ".navbar-toggler"
|
|
281
|
-
};
|
|
282
|
-
class zt extends Me {
|
|
283
|
-
adjustAndStore(t, n, o) {
|
|
284
|
-
const s = n.style[t];
|
|
285
|
-
n.dataset[t] = s, J(n, {
|
|
286
|
-
[t]: `${parseFloat(J(n, t)) + o}px`
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
restore(t, n) {
|
|
290
|
-
const o = n.dataset[t];
|
|
291
|
-
o !== void 0 && (delete n.dataset[t], J(n, {
|
|
292
|
-
[t]: o
|
|
293
|
-
}));
|
|
294
|
-
}
|
|
295
|
-
setContainerStyle(t) {
|
|
296
|
-
super.setContainerStyle(t);
|
|
297
|
-
const n = this.getElement();
|
|
298
|
-
if ($t(n, "modal-open"), !t.scrollBarWidth)
|
|
299
|
-
return;
|
|
300
|
-
const o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
|
|
301
|
-
D(n, W.FIXED_CONTENT).forEach((r) => this.adjustAndStore(o, r, t.scrollBarWidth)), D(n, W.STICKY_CONTENT).forEach((r) => this.adjustAndStore(s, r, -t.scrollBarWidth)), D(n, W.NAVBAR_TOGGLER).forEach((r) => this.adjustAndStore(s, r, t.scrollBarWidth));
|
|
302
|
-
}
|
|
303
|
-
removeContainerStyle(t) {
|
|
304
|
-
super.removeContainerStyle(t);
|
|
305
|
-
const n = this.getElement();
|
|
306
|
-
Gt(n, "modal-open");
|
|
307
|
-
const o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
|
|
308
|
-
D(n, W.FIXED_CONTENT).forEach((r) => this.restore(o, r)), D(n, W.STICKY_CONTENT).forEach((r) => this.restore(s, r)), D(n, W.NAVBAR_TOGGLER).forEach((r) => this.restore(s, r));
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
let we;
|
|
312
|
-
function Vt(e) {
|
|
313
|
-
return we || (we = new zt(e)), we;
|
|
314
|
-
}
|
|
315
|
-
const Qe = /* @__PURE__ */ R.forwardRef(({
|
|
316
|
-
className: e,
|
|
317
|
-
bsPrefix: t,
|
|
318
|
-
as: n = "div",
|
|
319
|
-
...o
|
|
320
|
-
}, s) => (t = K(t, "modal-body"), /* @__PURE__ */ a.jsx(n, {
|
|
321
|
-
ref: s,
|
|
322
|
-
className: N(e, t),
|
|
323
|
-
...o
|
|
324
|
-
})));
|
|
325
|
-
Qe.displayName = "ModalBody";
|
|
326
|
-
const Je = /* @__PURE__ */ R.createContext({
|
|
327
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
328
|
-
onHide() {
|
|
329
|
-
}
|
|
330
|
-
}), Oe = /* @__PURE__ */ R.forwardRef(({
|
|
331
|
-
bsPrefix: e,
|
|
332
|
-
className: t,
|
|
333
|
-
contentClassName: n,
|
|
334
|
-
centered: o,
|
|
335
|
-
size: s,
|
|
336
|
-
fullscreen: r,
|
|
337
|
-
children: l,
|
|
338
|
-
scrollable: i,
|
|
339
|
-
...d
|
|
340
|
-
}, h) => {
|
|
341
|
-
e = K(e, "modal");
|
|
342
|
-
const g = `${e}-dialog`, f = typeof r == "string" ? `${e}-fullscreen-${r}` : `${e}-fullscreen`;
|
|
343
|
-
return /* @__PURE__ */ a.jsx("div", {
|
|
344
|
-
...d,
|
|
345
|
-
ref: h,
|
|
346
|
-
className: N(g, t, s && `${e}-${s}`, o && `${g}-centered`, i && `${g}-scrollable`, r && f),
|
|
347
|
-
children: /* @__PURE__ */ a.jsx("div", {
|
|
348
|
-
className: N(`${e}-content`, n),
|
|
349
|
-
children: l
|
|
350
|
-
})
|
|
351
|
-
});
|
|
352
|
-
});
|
|
353
|
-
Oe.displayName = "ModalDialog";
|
|
354
|
-
const Xe = /* @__PURE__ */ R.forwardRef(({
|
|
355
|
-
className: e,
|
|
356
|
-
bsPrefix: t,
|
|
357
|
-
as: n = "div",
|
|
358
|
-
...o
|
|
359
|
-
}, s) => (t = K(t, "modal-footer"), /* @__PURE__ */ a.jsx(n, {
|
|
360
|
-
ref: s,
|
|
361
|
-
className: N(e, t),
|
|
362
|
-
...o
|
|
363
|
-
})));
|
|
364
|
-
Xe.displayName = "ModalFooter";
|
|
365
|
-
const qt = /* @__PURE__ */ R.forwardRef(({
|
|
366
|
-
closeLabel: e = "Close",
|
|
367
|
-
closeVariant: t,
|
|
368
|
-
closeButton: n = !1,
|
|
369
|
-
onHide: o,
|
|
370
|
-
children: s,
|
|
371
|
-
...r
|
|
372
|
-
}, l) => {
|
|
373
|
-
const i = H(Je), d = M(() => {
|
|
374
|
-
i == null || i.onHide(), o == null || o();
|
|
375
|
-
});
|
|
376
|
-
return /* @__PURE__ */ a.jsxs("div", {
|
|
377
|
-
ref: l,
|
|
378
|
-
...r,
|
|
379
|
-
children: [s, n && /* @__PURE__ */ a.jsx(ke, {
|
|
380
|
-
"aria-label": e,
|
|
381
|
-
variant: t,
|
|
382
|
-
onClick: d
|
|
383
|
-
})]
|
|
384
|
-
});
|
|
385
|
-
}), Ye = /* @__PURE__ */ R.forwardRef(({
|
|
386
|
-
bsPrefix: e,
|
|
387
|
-
className: t,
|
|
388
|
-
closeLabel: n = "Close",
|
|
389
|
-
closeButton: o = !1,
|
|
390
|
-
...s
|
|
391
|
-
}, r) => (e = K(e, "modal-header"), /* @__PURE__ */ a.jsx(qt, {
|
|
392
|
-
ref: r,
|
|
393
|
-
...s,
|
|
394
|
-
className: N(t, e),
|
|
395
|
-
closeLabel: n,
|
|
396
|
-
closeButton: o
|
|
397
|
-
})));
|
|
398
|
-
Ye.displayName = "ModalHeader";
|
|
399
|
-
const Qt = Bt("h4"), Ze = /* @__PURE__ */ R.forwardRef(({
|
|
400
|
-
className: e,
|
|
401
|
-
bsPrefix: t,
|
|
402
|
-
as: n = Qt,
|
|
403
|
-
...o
|
|
404
|
-
}, s) => (t = K(t, "modal-title"), /* @__PURE__ */ a.jsx(n, {
|
|
405
|
-
ref: s,
|
|
406
|
-
className: N(e, t),
|
|
407
|
-
...o
|
|
408
|
-
})));
|
|
409
|
-
Ze.displayName = "ModalTitle";
|
|
410
|
-
function Jt(e) {
|
|
411
|
-
return /* @__PURE__ */ a.jsx(Ge, {
|
|
412
|
-
...e,
|
|
413
|
-
timeout: null
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
function Xt(e) {
|
|
417
|
-
return /* @__PURE__ */ a.jsx(Ge, {
|
|
418
|
-
...e,
|
|
419
|
-
timeout: null
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
const et = /* @__PURE__ */ R.forwardRef(({
|
|
423
|
-
bsPrefix: e,
|
|
424
|
-
className: t,
|
|
425
|
-
style: n,
|
|
426
|
-
dialogClassName: o,
|
|
427
|
-
contentClassName: s,
|
|
428
|
-
children: r,
|
|
429
|
-
dialogAs: l = Oe,
|
|
430
|
-
"data-bs-theme": i,
|
|
431
|
-
"aria-labelledby": d,
|
|
432
|
-
"aria-describedby": h,
|
|
433
|
-
"aria-label": g,
|
|
434
|
-
/* BaseModal props */
|
|
435
|
-
show: f = !1,
|
|
436
|
-
animation: m = !0,
|
|
437
|
-
backdrop: T = !0,
|
|
438
|
-
keyboard: fe = !0,
|
|
439
|
-
onEscapeKeyDown: X,
|
|
440
|
-
onShow: he,
|
|
441
|
-
onHide: j,
|
|
442
|
-
container: me,
|
|
443
|
-
autoFocus: Y = !0,
|
|
444
|
-
enforceFocus: ge = !0,
|
|
445
|
-
restoreFocus: pe = !0,
|
|
446
|
-
restoreFocusOptions: Ee,
|
|
447
|
-
onEntered: Z,
|
|
448
|
-
onExit: $,
|
|
449
|
-
onExiting: ve,
|
|
450
|
-
onEnter: G,
|
|
451
|
-
onEntering: ee,
|
|
452
|
-
onExited: te,
|
|
453
|
-
backdropClassName: ne,
|
|
454
|
-
manager: oe,
|
|
455
|
-
...ye
|
|
456
|
-
}, S) => {
|
|
457
|
-
const [L, p] = C({}), [Ce, se] = C(!1), A = O(!1), _ = O(!1), x = O(null), [k, z] = ft(), Te = ht(S, z), re = M(j), Re = mt();
|
|
458
|
-
e = K(e, "modal");
|
|
459
|
-
const V = w(() => ({
|
|
460
|
-
onHide: re
|
|
461
|
-
}), [re]);
|
|
462
|
-
function B() {
|
|
463
|
-
return oe || Vt({
|
|
464
|
-
isRTL: Re
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
function ae(c) {
|
|
468
|
-
if (!Se)
|
|
469
|
-
return;
|
|
470
|
-
const F = B().getScrollbarWidth() > 0, Ie = c.scrollHeight > He(c).documentElement.clientHeight;
|
|
471
|
-
p({
|
|
472
|
-
paddingRight: F && !Ie ? Ue() : void 0,
|
|
473
|
-
paddingLeft: !F && Ie ? Ue() : void 0
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
const P = M(() => {
|
|
477
|
-
k && ae(k.dialog);
|
|
478
|
-
});
|
|
479
|
-
$e(() => {
|
|
480
|
-
Be(window, "resize", P), x.current == null || x.current();
|
|
481
|
-
});
|
|
482
|
-
const q = () => {
|
|
483
|
-
A.current = !0;
|
|
484
|
-
}, U = (c) => {
|
|
485
|
-
A.current && k && c.target === k.dialog && (_.current = !0), A.current = !1;
|
|
486
|
-
}, u = () => {
|
|
487
|
-
se(!0), x.current = pt(k.dialog, () => {
|
|
488
|
-
se(!1);
|
|
489
|
-
});
|
|
490
|
-
}, ie = (c) => {
|
|
491
|
-
c.target === c.currentTarget && u();
|
|
492
|
-
}, Q = (c) => {
|
|
493
|
-
if (T === "static") {
|
|
494
|
-
ie(c);
|
|
495
|
-
return;
|
|
496
|
-
}
|
|
497
|
-
if (_.current || c.target !== c.currentTarget) {
|
|
498
|
-
_.current = !1;
|
|
499
|
-
return;
|
|
500
|
-
}
|
|
501
|
-
j == null || j();
|
|
502
|
-
}, tt = (c) => {
|
|
503
|
-
fe ? X == null || X(c) : (c.preventDefault(), T === "static" && u());
|
|
504
|
-
}, nt = (c, F) => {
|
|
505
|
-
c && ae(c), G == null || G(c, F);
|
|
506
|
-
}, ot = (c) => {
|
|
507
|
-
x.current == null || x.current(), $ == null || $(c);
|
|
508
|
-
}, st = (c, F) => {
|
|
509
|
-
ee == null || ee(c, F), gt(window, "resize", P);
|
|
510
|
-
}, rt = (c) => {
|
|
511
|
-
c && (c.style.display = ""), te == null || te(c), Be(window, "resize", P);
|
|
512
|
-
}, at = y((c) => /* @__PURE__ */ a.jsx("div", {
|
|
513
|
-
...c,
|
|
514
|
-
className: N(`${e}-backdrop`, ne, !m && "show")
|
|
515
|
-
}), [m, ne, e]), Ae = {
|
|
516
|
-
...n,
|
|
517
|
-
...L
|
|
518
|
-
};
|
|
519
|
-
Ae.display = "block";
|
|
520
|
-
const it = (c) => /* @__PURE__ */ a.jsx("div", {
|
|
521
|
-
role: "dialog",
|
|
522
|
-
...c,
|
|
523
|
-
style: Ae,
|
|
524
|
-
className: N(t, e, Ce && `${e}-static`, !m && "show"),
|
|
525
|
-
onClick: T ? Q : void 0,
|
|
526
|
-
onMouseUp: U,
|
|
527
|
-
"data-bs-theme": i,
|
|
528
|
-
"aria-label": g,
|
|
529
|
-
"aria-labelledby": d,
|
|
530
|
-
"aria-describedby": h,
|
|
531
|
-
children: /* @__PURE__ */ a.jsx(l, {
|
|
532
|
-
...ye,
|
|
533
|
-
onMouseDown: q,
|
|
534
|
-
className: o,
|
|
535
|
-
contentClassName: s,
|
|
536
|
-
children: r
|
|
537
|
-
})
|
|
538
|
-
});
|
|
539
|
-
return /* @__PURE__ */ a.jsx(Je.Provider, {
|
|
540
|
-
value: V,
|
|
541
|
-
children: /* @__PURE__ */ a.jsx(Kt, {
|
|
542
|
-
show: f,
|
|
543
|
-
ref: Te,
|
|
544
|
-
backdrop: T,
|
|
545
|
-
container: me,
|
|
546
|
-
keyboard: !0,
|
|
547
|
-
autoFocus: Y,
|
|
548
|
-
enforceFocus: ge,
|
|
549
|
-
restoreFocus: pe,
|
|
550
|
-
restoreFocusOptions: Ee,
|
|
551
|
-
onEscapeKeyDown: tt,
|
|
552
|
-
onShow: he,
|
|
553
|
-
onHide: j,
|
|
554
|
-
onEnter: nt,
|
|
555
|
-
onEntering: st,
|
|
556
|
-
onEntered: Z,
|
|
557
|
-
onExit: ot,
|
|
558
|
-
onExiting: ve,
|
|
559
|
-
onExited: rt,
|
|
560
|
-
manager: B(),
|
|
561
|
-
transition: m ? Jt : void 0,
|
|
562
|
-
backdropTransition: m ? Xt : void 0,
|
|
563
|
-
renderBackdrop: at,
|
|
564
|
-
renderDialog: it
|
|
565
|
-
})
|
|
566
|
-
});
|
|
567
|
-
});
|
|
568
|
-
et.displayName = "Modal";
|
|
569
|
-
const I = Object.assign(et, {
|
|
570
|
-
Body: Qe,
|
|
571
|
-
Header: Ye,
|
|
572
|
-
Title: Ze,
|
|
573
|
-
Footer: Xe,
|
|
574
|
-
Dialog: Oe,
|
|
575
|
-
TRANSITION_DURATION: 300,
|
|
576
|
-
BACKDROP_TRANSITION_DURATION: 150
|
|
577
|
-
}), Yt = () => {
|
|
578
|
-
const { confirmTexts: e } = H(ue), { isShown: t, text: n, onFinish: o } = Mt(), { options: s } = H(ze), [r, l] = C(s.defaultValue ?? ""), i = y(() => {
|
|
579
|
-
o(null);
|
|
580
|
-
}, [o]), d = y(() => {
|
|
581
|
-
o(r);
|
|
582
|
-
}, [o, r]);
|
|
583
|
-
b(() => {
|
|
584
|
-
t === !0 && l(s.defaultValue ?? "");
|
|
585
|
-
}, [t, s.defaultValue]);
|
|
586
|
-
const h = w(() => ({
|
|
1
|
+
import { N as T, aj as p, j as a, ak as A, al as L, am as _, L as y, K as d, an as j, ao as O, ap as N, ab as U, ad as k, af as w, aq as M, a1 as K } from "./UserAvatarToggle-CH7OqxNp.js";
|
|
2
|
+
import z, { useContext as S, useState as h, useCallback as x, useEffect as v, useMemo as C, useRef as F, useReducer as G } from "react";
|
|
3
|
+
import { u as B, a as H } from "./useConfirm-B3BI8PzR.js";
|
|
4
|
+
import "react-hook-form";
|
|
5
|
+
import { M as P, L as D, E as m } from "./EventType-SEEDuisM.js";
|
|
6
|
+
const V = () => {
|
|
7
|
+
const { confirmTexts: e } = S(T), { isShown: s, text: t, onFinish: n } = B(), { options: o } = S(p), [r, i] = h(o.defaultValue ?? ""), c = x(() => {
|
|
8
|
+
n(null);
|
|
9
|
+
}, [n]), l = x(() => {
|
|
10
|
+
n(r);
|
|
11
|
+
}, [n, r]);
|
|
12
|
+
v(() => {
|
|
13
|
+
s === !0 && i(o.defaultValue ?? "");
|
|
14
|
+
}, [s, o.defaultValue]);
|
|
15
|
+
const f = C(() => ({
|
|
587
16
|
value: r,
|
|
588
|
-
onChange: (g) =>
|
|
17
|
+
onChange: (g) => i(g.currentTarget.value),
|
|
589
18
|
className: "w-100",
|
|
590
19
|
autoFocus: !0,
|
|
591
20
|
tabIndex: 0
|
|
592
21
|
}), [r]);
|
|
593
|
-
return /* @__PURE__ */ a.jsxs(
|
|
594
|
-
/* @__PURE__ */ a.jsx(
|
|
595
|
-
/* @__PURE__ */ a.jsxs(
|
|
596
|
-
|
|
597
|
-
|
|
22
|
+
return /* @__PURE__ */ a.jsxs(P, { show: s, size: "sm", centered: !0, onHide: c, children: [
|
|
23
|
+
/* @__PURE__ */ a.jsx(P.Header, { children: /* @__PURE__ */ a.jsx(P.Title, { children: t }) }),
|
|
24
|
+
/* @__PURE__ */ a.jsxs(P.Body, { children: [
|
|
25
|
+
o.input === "textarea" ? /* @__PURE__ */ a.jsx("textarea", { ...f, rows: 5 }) : void 0,
|
|
26
|
+
o.input === "input" ? /* @__PURE__ */ a.jsx("input", { ...f, type: o.type }) : void 0
|
|
598
27
|
] }),
|
|
599
|
-
/* @__PURE__ */ a.jsxs(
|
|
600
|
-
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary", onClick:
|
|
601
|
-
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary ml", onClick:
|
|
28
|
+
/* @__PURE__ */ a.jsxs(P.Footer, { children: [
|
|
29
|
+
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary", onClick: c, children: e.cancel }),
|
|
30
|
+
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary ml", onClick: l, disabled: o.required && !r, children: e.confirm })
|
|
602
31
|
] })
|
|
603
32
|
] });
|
|
604
|
-
},
|
|
605
|
-
const [
|
|
606
|
-
}),
|
|
607
|
-
|
|
608
|
-
}, []),
|
|
609
|
-
|
|
610
|
-
}, []), g =
|
|
611
|
-
isShown:
|
|
612
|
-
text:
|
|
613
|
-
showPrompt:
|
|
614
|
-
hidePrompt:
|
|
615
|
-
resolveRef:
|
|
33
|
+
}, $ = ({ children: e }) => {
|
|
34
|
+
const [s, t] = h(!1), [n, o] = h(""), [r, i] = h({ input: "textarea", type: "text" }), c = F(() => {
|
|
35
|
+
}), l = x((u) => {
|
|
36
|
+
o(u), t(!0);
|
|
37
|
+
}, []), f = x(() => {
|
|
38
|
+
t(!1);
|
|
39
|
+
}, []), g = C(() => ({
|
|
40
|
+
isShown: s,
|
|
41
|
+
text: n,
|
|
42
|
+
showPrompt: l,
|
|
43
|
+
hidePrompt: f,
|
|
44
|
+
resolveRef: c,
|
|
616
45
|
options: r,
|
|
617
|
-
setOptions:
|
|
618
|
-
}), [
|
|
619
|
-
return /* @__PURE__ */ a.jsxs(
|
|
46
|
+
setOptions: i
|
|
47
|
+
}), [s, n, l, f, r]);
|
|
48
|
+
return /* @__PURE__ */ a.jsxs(p.Provider, { value: g, children: [
|
|
620
49
|
e,
|
|
621
|
-
/* @__PURE__ */ a.jsx(
|
|
50
|
+
/* @__PURE__ */ a.jsx(V, {})
|
|
622
51
|
] });
|
|
623
|
-
},
|
|
624
|
-
const [
|
|
625
|
-
|
|
626
|
-
}, []),
|
|
627
|
-
|
|
628
|
-
}, []),
|
|
629
|
-
return /* @__PURE__ */ a.jsxs(
|
|
630
|
-
/* @__PURE__ */ a.jsx(
|
|
52
|
+
}, q = ({ children: e }) => {
|
|
53
|
+
const [s, t] = h(!1), [n, o] = h(""), r = x((l) => {
|
|
54
|
+
t(!0), o(l);
|
|
55
|
+
}, []), i = x(() => {
|
|
56
|
+
t(!1);
|
|
57
|
+
}, []), c = C(() => ({ show: s, text: n, showConfirm: r, hideConfirm: i }), [s, n, r, i]);
|
|
58
|
+
return /* @__PURE__ */ a.jsxs(A.Provider, { value: c, children: [
|
|
59
|
+
/* @__PURE__ */ a.jsx(Y, {}),
|
|
631
60
|
e
|
|
632
61
|
] });
|
|
633
|
-
},
|
|
634
|
-
const
|
|
635
|
-
axiosInstance:
|
|
62
|
+
}, oe = ({ cookieDomain: e, axiosInstance: s, LinkComponent: t, NavigateComponent: n, language: o, axiosTexts: r, confirmTexts: i, formValidationTexts: c, homeDashboardTexts: l, formSubmitTexts: f, appSearchTexts: g, customSelectTexts: u, children: E }) => {
|
|
63
|
+
const R = C(() => ({
|
|
64
|
+
axiosInstance: s,
|
|
636
65
|
cookieDomain: e,
|
|
637
|
-
LinkComponent:
|
|
638
|
-
NavigateComponent:
|
|
639
|
-
language:
|
|
66
|
+
LinkComponent: t,
|
|
67
|
+
NavigateComponent: n,
|
|
68
|
+
language: o,
|
|
640
69
|
axiosTexts: r,
|
|
641
|
-
confirmTexts:
|
|
642
|
-
formValidationTexts:
|
|
643
|
-
homeDashboardTexts:
|
|
644
|
-
formSubmitTexts:
|
|
70
|
+
confirmTexts: i,
|
|
71
|
+
formValidationTexts: c,
|
|
72
|
+
homeDashboardTexts: l,
|
|
73
|
+
formSubmitTexts: f,
|
|
645
74
|
appSearchTexts: g,
|
|
646
|
-
customSelectTexts:
|
|
75
|
+
customSelectTexts: u
|
|
647
76
|
}), [
|
|
648
|
-
|
|
77
|
+
s,
|
|
649
78
|
e,
|
|
79
|
+
t,
|
|
650
80
|
n,
|
|
651
81
|
o,
|
|
652
|
-
s,
|
|
653
82
|
r,
|
|
654
|
-
l,
|
|
655
83
|
i,
|
|
656
|
-
|
|
657
|
-
|
|
84
|
+
c,
|
|
85
|
+
l,
|
|
86
|
+
f,
|
|
658
87
|
g,
|
|
659
|
-
|
|
88
|
+
u
|
|
660
89
|
]);
|
|
661
|
-
return /* @__PURE__ */ a.jsx(
|
|
662
|
-
/* @__PURE__ */ a.jsx(
|
|
663
|
-
|
|
90
|
+
return /* @__PURE__ */ a.jsx(T.Provider, { value: R, children: /* @__PURE__ */ a.jsx(q, { children: /* @__PURE__ */ a.jsxs($, { children: [
|
|
91
|
+
/* @__PURE__ */ a.jsx(L, {}),
|
|
92
|
+
E
|
|
664
93
|
] }) }) });
|
|
665
|
-
},
|
|
666
|
-
const [
|
|
667
|
-
|
|
668
|
-
}, [
|
|
669
|
-
|
|
670
|
-
}, [
|
|
671
|
-
return /* @__PURE__ */ a.jsxs(
|
|
672
|
-
|
|
94
|
+
}, re = ({ children: e }) => {
|
|
95
|
+
const [s, t] = h(!1), [n] = h(/* @__PURE__ */ new Set()), o = x((c) => {
|
|
96
|
+
n.add(c), t(!0);
|
|
97
|
+
}, [n]), r = x((c) => {
|
|
98
|
+
n.delete(c), n.size === 0 && t(!1);
|
|
99
|
+
}, [n]), i = C(() => ({ isLoading: s, startLoading: o, stopLoading: r }), [s, o, r]);
|
|
100
|
+
return /* @__PURE__ */ a.jsxs(_.Provider, { value: i, children: [
|
|
101
|
+
s && /* @__PURE__ */ a.jsx(D, {}),
|
|
673
102
|
e
|
|
674
103
|
] });
|
|
675
104
|
};
|
|
676
105
|
/*! @azure/msal-browser v3.14.0 2024-05-07 */
|
|
677
|
-
class
|
|
106
|
+
class Q {
|
|
678
107
|
/**
|
|
679
108
|
* Gets interaction status from event message
|
|
680
109
|
* @param message
|
|
681
110
|
* @param currentStatus
|
|
682
111
|
*/
|
|
683
|
-
static getInteractionStatusFromEvent(
|
|
684
|
-
switch (
|
|
685
|
-
case
|
|
686
|
-
return
|
|
687
|
-
case
|
|
688
|
-
return
|
|
689
|
-
case
|
|
690
|
-
if (
|
|
691
|
-
return
|
|
112
|
+
static getInteractionStatusFromEvent(s, t) {
|
|
113
|
+
switch (s.eventType) {
|
|
114
|
+
case m.LOGIN_START:
|
|
115
|
+
return d.Login;
|
|
116
|
+
case m.SSO_SILENT_START:
|
|
117
|
+
return d.SsoSilent;
|
|
118
|
+
case m.ACQUIRE_TOKEN_START:
|
|
119
|
+
if (s.interactionType === y.Redirect || s.interactionType === y.Popup)
|
|
120
|
+
return d.AcquireToken;
|
|
692
121
|
break;
|
|
693
|
-
case
|
|
694
|
-
return
|
|
695
|
-
case
|
|
696
|
-
return
|
|
697
|
-
case
|
|
698
|
-
case
|
|
699
|
-
if (
|
|
122
|
+
case m.HANDLE_REDIRECT_START:
|
|
123
|
+
return d.HandleRedirect;
|
|
124
|
+
case m.LOGOUT_START:
|
|
125
|
+
return d.Logout;
|
|
126
|
+
case m.SSO_SILENT_SUCCESS:
|
|
127
|
+
case m.SSO_SILENT_FAILURE:
|
|
128
|
+
if (t && t !== d.SsoSilent)
|
|
700
129
|
break;
|
|
701
|
-
return
|
|
702
|
-
case
|
|
703
|
-
if (
|
|
130
|
+
return d.None;
|
|
131
|
+
case m.LOGOUT_END:
|
|
132
|
+
if (t && t !== d.Logout)
|
|
704
133
|
break;
|
|
705
|
-
return
|
|
706
|
-
case
|
|
707
|
-
if (
|
|
134
|
+
return d.None;
|
|
135
|
+
case m.HANDLE_REDIRECT_END:
|
|
136
|
+
if (t && t !== d.HandleRedirect)
|
|
708
137
|
break;
|
|
709
|
-
return
|
|
710
|
-
case
|
|
711
|
-
case
|
|
712
|
-
case
|
|
713
|
-
case
|
|
714
|
-
case
|
|
715
|
-
if (
|
|
716
|
-
if (
|
|
138
|
+
return d.None;
|
|
139
|
+
case m.LOGIN_SUCCESS:
|
|
140
|
+
case m.LOGIN_FAILURE:
|
|
141
|
+
case m.ACQUIRE_TOKEN_SUCCESS:
|
|
142
|
+
case m.ACQUIRE_TOKEN_FAILURE:
|
|
143
|
+
case m.RESTORE_FROM_BFCACHE:
|
|
144
|
+
if (s.interactionType === y.Redirect || s.interactionType === y.Popup) {
|
|
145
|
+
if (t && t !== d.Login && t !== d.AcquireToken)
|
|
717
146
|
break;
|
|
718
|
-
return
|
|
147
|
+
return d.None;
|
|
719
148
|
}
|
|
720
149
|
break;
|
|
721
150
|
}
|
|
@@ -723,166 +152,166 @@ class tn {
|
|
|
723
152
|
}
|
|
724
153
|
}
|
|
725
154
|
/*! @azure/msal-react v2.0.16 2024-05-07 */
|
|
726
|
-
const
|
|
155
|
+
const J = "@azure/msal-react", b = "2.0.16";
|
|
727
156
|
/*! @azure/msal-react v2.0.16 2024-05-07 */
|
|
728
|
-
const
|
|
157
|
+
const I = {
|
|
729
158
|
UNBLOCK_INPROGRESS: "UNBLOCK_INPROGRESS",
|
|
730
159
|
EVENT: "EVENT"
|
|
731
|
-
},
|
|
732
|
-
const { type:
|
|
733
|
-
let
|
|
734
|
-
switch (
|
|
735
|
-
case
|
|
736
|
-
e.inProgress ===
|
|
160
|
+
}, W = (e, s) => {
|
|
161
|
+
const { type: t, payload: n } = s;
|
|
162
|
+
let o = e.inProgress;
|
|
163
|
+
switch (t) {
|
|
164
|
+
case I.UNBLOCK_INPROGRESS:
|
|
165
|
+
e.inProgress === d.Startup && (o = d.None, n.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));
|
|
737
166
|
break;
|
|
738
|
-
case
|
|
739
|
-
const
|
|
740
|
-
|
|
167
|
+
case I.EVENT:
|
|
168
|
+
const i = n.message, c = Q.getInteractionStatusFromEvent(i, e.inProgress);
|
|
169
|
+
c && (n.logger.info(`MsalProvider - ${i.eventType} results in setting inProgress from ${e.inProgress} to ${c}`), o = c);
|
|
741
170
|
break;
|
|
742
171
|
default:
|
|
743
|
-
throw new Error(`Unknown action type: ${
|
|
172
|
+
throw new Error(`Unknown action type: ${t}`);
|
|
744
173
|
}
|
|
745
|
-
const r =
|
|
746
|
-
return
|
|
174
|
+
const r = n.instance.getAllAccounts();
|
|
175
|
+
return o !== e.inProgress && !N(r, e.accounts) ? {
|
|
747
176
|
...e,
|
|
748
|
-
inProgress:
|
|
177
|
+
inProgress: o,
|
|
749
178
|
accounts: r
|
|
750
|
-
} :
|
|
179
|
+
} : o !== e.inProgress ? {
|
|
751
180
|
...e,
|
|
752
|
-
inProgress:
|
|
753
|
-
} :
|
|
181
|
+
inProgress: o
|
|
182
|
+
} : N(r, e.accounts) ? e : {
|
|
754
183
|
...e,
|
|
755
184
|
accounts: r
|
|
756
185
|
};
|
|
757
186
|
};
|
|
758
|
-
function
|
|
759
|
-
|
|
760
|
-
e.initializeWrapperLibrary(
|
|
187
|
+
function X({ instance: e, children: s }) {
|
|
188
|
+
v(() => {
|
|
189
|
+
e.initializeWrapperLibrary(j.React, b);
|
|
761
190
|
}, [e]);
|
|
762
|
-
const
|
|
763
|
-
inProgress:
|
|
191
|
+
const t = C(() => e.getLogger().clone(J, b), [e]), [n, o] = G(W, void 0, () => ({
|
|
192
|
+
inProgress: d.Startup,
|
|
764
193
|
accounts: e.getAllAccounts()
|
|
765
194
|
}));
|
|
766
|
-
|
|
767
|
-
const
|
|
768
|
-
|
|
195
|
+
v(() => {
|
|
196
|
+
const i = e.addEventCallback((c) => {
|
|
197
|
+
o({
|
|
769
198
|
payload: {
|
|
770
199
|
instance: e,
|
|
771
|
-
logger:
|
|
772
|
-
message:
|
|
200
|
+
logger: t,
|
|
201
|
+
message: c
|
|
773
202
|
},
|
|
774
|
-
type:
|
|
203
|
+
type: I.EVENT
|
|
775
204
|
});
|
|
776
205
|
});
|
|
777
|
-
return
|
|
206
|
+
return t.verbose(`MsalProvider - Registered event callback with id: ${i}`), e.initialize().then(() => {
|
|
778
207
|
e.handleRedirectPromise().catch(() => {
|
|
779
208
|
}).finally(() => {
|
|
780
|
-
|
|
209
|
+
o({
|
|
781
210
|
payload: {
|
|
782
211
|
instance: e,
|
|
783
|
-
logger:
|
|
212
|
+
logger: t
|
|
784
213
|
},
|
|
785
|
-
type:
|
|
214
|
+
type: I.UNBLOCK_INPROGRESS
|
|
786
215
|
});
|
|
787
216
|
});
|
|
788
217
|
}).catch(() => {
|
|
789
218
|
}), () => {
|
|
790
|
-
|
|
219
|
+
i && (t.verbose(`MsalProvider - Removing event callback ${i}`), e.removeEventCallback(i));
|
|
791
220
|
};
|
|
792
|
-
}, [e,
|
|
221
|
+
}, [e, t]);
|
|
793
222
|
const r = {
|
|
794
223
|
instance: e,
|
|
795
|
-
inProgress:
|
|
796
|
-
accounts:
|
|
797
|
-
logger:
|
|
224
|
+
inProgress: n.inProgress,
|
|
225
|
+
accounts: n.accounts,
|
|
226
|
+
logger: t
|
|
798
227
|
};
|
|
799
|
-
return
|
|
228
|
+
return z.createElement(O.Provider, { value: r }, s);
|
|
800
229
|
}
|
|
801
|
-
const
|
|
802
|
-
const
|
|
803
|
-
const
|
|
804
|
-
return
|
|
805
|
-
}, []), [
|
|
806
|
-
let
|
|
807
|
-
return await
|
|
808
|
-
|
|
230
|
+
const ae = ({ children: e }) => {
|
|
231
|
+
const s = U(), { msalInstance: t } = S(k), n = x(() => {
|
|
232
|
+
const u = localStorage.getItem("user") ?? null;
|
|
233
|
+
return u ? JSON.parse(u) : null;
|
|
234
|
+
}, []), [o, r] = h(n()), i = x(async (u) => {
|
|
235
|
+
let E = null;
|
|
236
|
+
return await s.get("/user/detail", u ? { headers: { Authorization: `Bearer ${u}` } } : void 0).then((R) => {
|
|
237
|
+
E = R.data;
|
|
809
238
|
}).catch(() => {
|
|
810
|
-
|
|
811
|
-
}), localStorage.setItem("user", JSON.stringify(
|
|
812
|
-
}, [
|
|
239
|
+
E = null;
|
|
240
|
+
}), localStorage.setItem("user", JSON.stringify(E)), E;
|
|
241
|
+
}, [s]), c = x(() => {
|
|
813
242
|
localStorage.removeItem("user");
|
|
814
|
-
}, []),
|
|
815
|
-
const
|
|
816
|
-
return
|
|
817
|
-
}, [
|
|
818
|
-
|
|
819
|
-
}, [
|
|
820
|
-
return
|
|
821
|
-
r(
|
|
822
|
-
}, [
|
|
823
|
-
if (
|
|
824
|
-
const
|
|
825
|
-
if (
|
|
826
|
-
const
|
|
827
|
-
|
|
243
|
+
}, []), l = x(async (u) => {
|
|
244
|
+
const E = await i(u);
|
|
245
|
+
return E ? (r(E), !0) : !1;
|
|
246
|
+
}, [i]), f = x(() => {
|
|
247
|
+
c(), r(null);
|
|
248
|
+
}, [c]), g = C(() => ({ user: o, loginUser: l, logoutUser: f }), [o, l, f]);
|
|
249
|
+
return v(() => {
|
|
250
|
+
r(n());
|
|
251
|
+
}, [n]), v(() => {
|
|
252
|
+
if (t) {
|
|
253
|
+
const u = t.addEventCallback((E) => {
|
|
254
|
+
if (E.eventType === m.ACQUIRE_TOKEN_SUCCESS && E.payload) {
|
|
255
|
+
const R = E.payload;
|
|
256
|
+
l(R.accessToken).catch(() => f());
|
|
828
257
|
}
|
|
829
258
|
});
|
|
830
259
|
return () => {
|
|
831
|
-
|
|
260
|
+
u && t.removeEventCallback(u);
|
|
832
261
|
};
|
|
833
262
|
}
|
|
834
263
|
return () => {
|
|
835
264
|
};
|
|
836
|
-
}, [
|
|
837
|
-
},
|
|
838
|
-
const { cookieDomain:
|
|
265
|
+
}, [t, l, f]), /* @__PURE__ */ a.jsx(w.Provider, { value: g, children: e });
|
|
266
|
+
}, ce = ({ ...e }) => {
|
|
267
|
+
const { cookieDomain: s } = S(T), [, t] = M(["Authorization"]), [n, o] = h(null), r = C(() => ({
|
|
839
268
|
useMsal: e.useMsal ?? !1,
|
|
840
|
-
storedToken: (
|
|
269
|
+
storedToken: (n == null ? void 0 : n.token) ?? null,
|
|
841
270
|
msalInstance: e.useMsal ? e.msalInstance ?? null : null,
|
|
842
271
|
msalScopes: e.useMsal ? e.msalScopes ?? [] : []
|
|
843
|
-
}), [e,
|
|
844
|
-
return
|
|
272
|
+
}), [e, n]);
|
|
273
|
+
return v(() => {
|
|
845
274
|
if (e.useMsal) {
|
|
846
|
-
const
|
|
847
|
-
if (
|
|
848
|
-
const
|
|
849
|
-
e.msalInstance.setActiveAccount(
|
|
850
|
-
const g =
|
|
851
|
-
|
|
275
|
+
const i = e.msalInstance.addEventCallback((c) => {
|
|
276
|
+
if (c.eventType === m.LOGIN_SUCCESS || c.eventType === m.ACQUIRE_TOKEN_SUCCESS && c.payload) {
|
|
277
|
+
const l = c.payload, f = l.account;
|
|
278
|
+
e.msalInstance.setActiveAccount(f);
|
|
279
|
+
const g = l.accessToken, u = l.expiresOn;
|
|
280
|
+
o({ token: g, expiresOn: u });
|
|
852
281
|
}
|
|
853
282
|
});
|
|
854
283
|
return () => {
|
|
855
|
-
|
|
284
|
+
i && e.msalInstance.removeEventCallback(i);
|
|
856
285
|
};
|
|
857
286
|
}
|
|
858
287
|
return () => {
|
|
859
288
|
};
|
|
860
|
-
}, [e]),
|
|
861
|
-
|
|
289
|
+
}, [e]), v(() => {
|
|
290
|
+
n && t("Authorization", n.token, {
|
|
862
291
|
path: "/",
|
|
863
292
|
secure: !0,
|
|
864
293
|
sameSite: "none",
|
|
865
|
-
domain:
|
|
866
|
-
expires:
|
|
294
|
+
domain: s,
|
|
295
|
+
expires: n.expiresOn ?? void 0
|
|
867
296
|
});
|
|
868
|
-
}, [
|
|
869
|
-
},
|
|
870
|
-
const { confirmTexts: e } =
|
|
871
|
-
return /* @__PURE__ */ a.jsx(
|
|
872
|
-
/* @__PURE__ */ a.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ a.jsx(
|
|
297
|
+
}, [n, s, t]), /* @__PURE__ */ a.jsx(k.Provider, { value: r, children: e.useMsal ? /* @__PURE__ */ a.jsx(X, { instance: e.msalInstance, children: e.children }) : e.children });
|
|
298
|
+
}, Y = () => {
|
|
299
|
+
const { confirmTexts: e } = S(T), { onConfirm: s, onCancel: t, text: n, show: o } = H();
|
|
300
|
+
return /* @__PURE__ */ a.jsx(P, { show: o, size: "sm", centered: !0, onHide: t, children: /* @__PURE__ */ a.jsxs(P.Body, { children: [
|
|
301
|
+
/* @__PURE__ */ a.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ a.jsx(K, { variant: "h6", children: n }) }),
|
|
873
302
|
/* @__PURE__ */ a.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
874
|
-
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary w-100", onClick:
|
|
875
|
-
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary w-100 ml", onClick:
|
|
303
|
+
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary w-100", onClick: t, children: e.no }),
|
|
304
|
+
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary w-100 ml", onClick: s, children: e.yes })
|
|
876
305
|
] })
|
|
877
306
|
] }) });
|
|
878
307
|
};
|
|
879
308
|
export {
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
309
|
+
k as AuthContext,
|
|
310
|
+
ce as AuthProvider,
|
|
311
|
+
_ as LoadingContext,
|
|
312
|
+
re as LoadingProvider,
|
|
313
|
+
T as LuminusComponentsContext,
|
|
314
|
+
oe as LuminusComponentsProvider,
|
|
315
|
+
w as UserContext,
|
|
316
|
+
ae as UserProvider
|
|
888
317
|
};
|