@australiangreens/ag-internal-components 0.1.5 → 0.1.7
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/esm/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
var Lt = Object.defineProperty, _t = Object.defineProperties;
|
|
2
2
|
var Mt = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var oe = Object.getOwnPropertySymbols;
|
|
4
|
+
var Oe = Object.prototype.hasOwnProperty, Be = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var he = (e, t, n) => t in e ? Lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, a = (e, t) => {
|
|
6
6
|
for (var n in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var n of
|
|
10
|
-
|
|
7
|
+
Oe.call(t, n) && he(e, n, t[n]);
|
|
8
|
+
if (oe)
|
|
9
|
+
for (var n of oe(t))
|
|
10
|
+
Be.call(t, n) && he(e, n, t[n]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
12
|
+
}, y = (e, t) => _t(e, Mt(t));
|
|
13
13
|
var Ee = (e, t) => {
|
|
14
14
|
var n = {};
|
|
15
15
|
for (var i in e)
|
|
16
|
-
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var i of
|
|
19
|
-
t.indexOf(i) < 0 &&
|
|
16
|
+
Oe.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
|
|
17
|
+
if (e != null && oe)
|
|
18
|
+
for (var i of oe(e))
|
|
19
|
+
t.indexOf(i) < 0 && Be.call(e, i) && (n[i] = e[i]);
|
|
20
20
|
return n;
|
|
21
21
|
};
|
|
22
22
|
var Fe = (e, t, n) => (he(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
@@ -36,9 +36,9 @@ var L = (e, t, n) => new Promise((i, r) => {
|
|
|
36
36
|
}, l = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(s, c);
|
|
37
37
|
l((n = n.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import { jsxs as
|
|
40
|
-
import { useState as E, createContext as Je, useCallback as
|
|
41
|
-
import { Typography as
|
|
39
|
+
import { jsxs as p, Fragment as F, jsx as o } from "react/jsx-runtime";
|
|
40
|
+
import { useState as E, createContext as Je, useCallback as ae, useContext as Ze, useEffect as K, createElement as xe, useMemo as Rt, useRef as ge } from "react";
|
|
41
|
+
import { Typography as O, Button as J, Paper as je, Box as I, Drawer as we, styled as Ae, IconButton as Z, Container as et, useTheme as se, useMediaQuery as Ht, Collapse as Wt, Avatar as Pe, Fade as zt, Skeleton as Ne, Toolbar as Ut, Divider as Le, CssBaseline as Gt, Dialog as tt, LinearProgress as nt, DialogTitle as ot, DialogContent as it, DialogActions as rt, Autocomplete as Se, TextField as be, CircularProgress as De, Chip as Vt, Tooltip as qt, Stack as Xt, Snackbar as Qt, Alert as Yt, FormHelperText as Kt } from "@mui/material";
|
|
42
42
|
import Jt from "@mui/material/CssBaseline";
|
|
43
43
|
import { styled as R, createTheme as at, alpha as fe } from "@mui/material/styles";
|
|
44
44
|
import { AgError as Zt } from "@australiangreens/ag-error";
|
|
@@ -55,13 +55,13 @@ import { useQuery as sn, QueryClient as ln, QueryClientProvider as cn } from "@t
|
|
|
55
55
|
import { useAuth0 as ht } from "@auth0/auth0-react";
|
|
56
56
|
import { Buffer as dn } from "buffer";
|
|
57
57
|
import un from "@mui/material/Skeleton";
|
|
58
|
-
function
|
|
58
|
+
function Oo({ text: e }) {
|
|
59
59
|
const [t, n] = E(0);
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */ o(
|
|
62
|
-
/* @__PURE__ */ o(
|
|
60
|
+
return /* @__PURE__ */ p(F, { children: [
|
|
61
|
+
/* @__PURE__ */ o(O, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
62
|
+
/* @__PURE__ */ o(O, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
63
63
|
/* @__PURE__ */ o(
|
|
64
|
-
|
|
64
|
+
J,
|
|
65
65
|
{
|
|
66
66
|
variant: "outlined",
|
|
67
67
|
onClick: () => n((i) => i + 1),
|
|
@@ -69,11 +69,11 @@ function Bo({ text: e }) {
|
|
|
69
69
|
children: "Hello I am a button"
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ p("p", { children: [
|
|
73
73
|
"This is some text: ",
|
|
74
74
|
/* @__PURE__ */ o("span", { children: e })
|
|
75
75
|
] }),
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ p(je, { children: [
|
|
77
77
|
"This number will incremember when button pressed: ",
|
|
78
78
|
t
|
|
79
79
|
] })
|
|
@@ -141,10 +141,10 @@ const Ct = Je(null), mn = {}, Cn = {}, xn = ({
|
|
|
141
141
|
overrideActions: t = Cn,
|
|
142
142
|
children: n
|
|
143
143
|
}) => {
|
|
144
|
-
const [{ open: i }, r] = E({ open: !0 }), s =
|
|
144
|
+
const [{ open: i }, r] = E({ open: !0 }), s = ae((d) => {
|
|
145
145
|
r({ open: d });
|
|
146
|
-
}, []), c =
|
|
147
|
-
r((d) =>
|
|
146
|
+
}, []), c = ae(() => {
|
|
147
|
+
r((d) => y(a({}, d), { open: !d.open }));
|
|
148
148
|
}, []), l = a(a({
|
|
149
149
|
open: i,
|
|
150
150
|
setOpen: s,
|
|
@@ -158,7 +158,7 @@ const Ct = Je(null), mn = {}, Cn = {}, xn = ({
|
|
|
158
158
|
return e;
|
|
159
159
|
}, wn = (e = {}) => a({
|
|
160
160
|
open: !0
|
|
161
|
-
}, e),
|
|
161
|
+
}, e), Bo = Q(
|
|
162
162
|
(e = wn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(xn, { overrideState: e, overrideActions: t, children: n })
|
|
163
163
|
), Eo = Q(() => ({ children: e }) => /* @__PURE__ */ o(jt, { children: e })), Re = 7, Fo = R(st)(({ theme: e }) => ({
|
|
164
164
|
backgroundColor: "black",
|
|
@@ -242,7 +242,7 @@ function No({
|
|
|
242
242
|
children: t
|
|
243
243
|
}) {
|
|
244
244
|
const { open: n } = vn();
|
|
245
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ p(pn, { className: q.root, "data-testid": e, children: [
|
|
246
246
|
/* @__PURE__ */ o(Jt, {}),
|
|
247
247
|
/* @__PURE__ */ o(
|
|
248
248
|
fn,
|
|
@@ -256,7 +256,7 @@ function No({
|
|
|
256
256
|
)
|
|
257
257
|
] });
|
|
258
258
|
}
|
|
259
|
-
const An = 24, Sn = 64, G = "TopBar",
|
|
259
|
+
const An = 24, Sn = 64, G = "TopBar", B = {
|
|
260
260
|
topStripe: `${G}-topStripe`,
|
|
261
261
|
titleBar: `${G}-titleBar`,
|
|
262
262
|
titleSlider: `${G}-titleSlider`,
|
|
@@ -270,18 +270,18 @@ const An = 24, Sn = 64, G = "TopBar", O = {
|
|
|
270
270
|
var i, r;
|
|
271
271
|
return {
|
|
272
272
|
width: "100%",
|
|
273
|
-
[`& .${
|
|
273
|
+
[`& .${B.topStripe}`]: {
|
|
274
274
|
width: "100%",
|
|
275
275
|
height: `${An}px`,
|
|
276
276
|
backgroundColor: e.palette.primary.main
|
|
277
277
|
},
|
|
278
|
-
[`& .${
|
|
278
|
+
[`& .${B.titleBar}`]: {
|
|
279
279
|
backgroundColor: e.palette.primary.light,
|
|
280
280
|
height: `${Sn}px`,
|
|
281
281
|
padding: e.spacing(0, 3),
|
|
282
282
|
width: "100%"
|
|
283
283
|
},
|
|
284
|
-
[`& .${
|
|
284
|
+
[`& .${B.titleSlider}`]: a(a({
|
|
285
285
|
height: "100%",
|
|
286
286
|
display: "flex",
|
|
287
287
|
alignItems: "center",
|
|
@@ -290,14 +290,14 @@ const An = 24, Sn = 64, G = "TopBar", O = {
|
|
|
290
290
|
easing: e.transitions.easing.sharp,
|
|
291
291
|
duration: e.transitions.duration.leavingScreen
|
|
292
292
|
}),
|
|
293
|
-
[`& .${
|
|
293
|
+
[`& .${B.leftPanelButton}`]: {
|
|
294
294
|
marginRight: e.spacing(2),
|
|
295
295
|
flexGrow: 0
|
|
296
296
|
},
|
|
297
|
-
[`& .${
|
|
297
|
+
[`& .${B.titleText}`]: {
|
|
298
298
|
flexGrow: 1
|
|
299
299
|
},
|
|
300
|
-
[`& .${
|
|
300
|
+
[`& .${B.rightPanelButton}`]: {
|
|
301
301
|
flexGrow: 0
|
|
302
302
|
}
|
|
303
303
|
}, (t == null ? void 0 : t.open) && {
|
|
@@ -321,13 +321,13 @@ function Dn({
|
|
|
321
321
|
rightPanel: n,
|
|
322
322
|
"data-testid": i
|
|
323
323
|
}) {
|
|
324
|
-
return /* @__PURE__ */
|
|
325
|
-
/* @__PURE__ */ o("div", { className:
|
|
326
|
-
/* @__PURE__ */ o("div", { className:
|
|
327
|
-
t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */
|
|
328
|
-
|
|
324
|
+
return /* @__PURE__ */ p(bn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
|
|
325
|
+
/* @__PURE__ */ o("div", { className: B.topStripe }),
|
|
326
|
+
/* @__PURE__ */ o("div", { className: B.titleBar, children: /* @__PURE__ */ p(I, { className: B.titleSlider, children: [
|
|
327
|
+
t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ p(
|
|
328
|
+
Z,
|
|
329
329
|
{
|
|
330
|
-
className:
|
|
330
|
+
className: B.leftPanelButton,
|
|
331
331
|
color: "inherit",
|
|
332
332
|
"aria-label": "Open left side panel",
|
|
333
333
|
onClick: t == null ? void 0 : t.onOpen,
|
|
@@ -339,11 +339,11 @@ function Dn({
|
|
|
339
339
|
]
|
|
340
340
|
}
|
|
341
341
|
),
|
|
342
|
-
/* @__PURE__ */ o(
|
|
343
|
-
n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */
|
|
344
|
-
|
|
342
|
+
/* @__PURE__ */ o(O, { className: B.titleText, variant: "h6", noWrap: !0, children: e }),
|
|
343
|
+
n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ p(
|
|
344
|
+
Z,
|
|
345
345
|
{
|
|
346
|
-
className:
|
|
346
|
+
className: B.rightPanelButton,
|
|
347
347
|
color: "inherit",
|
|
348
348
|
"aria-label": "Open right side panel",
|
|
349
349
|
onClick: n == null ? void 0 : n.onOpen,
|
|
@@ -390,7 +390,7 @@ const xt = 400, kn = Ae(we, {
|
|
|
390
390
|
})
|
|
391
391
|
), yn = Ae(I, {
|
|
392
392
|
shouldForwardProp: (e) => !["anchor"].includes(e)
|
|
393
|
-
})(({ theme: e, anchor: t }) =>
|
|
393
|
+
})(({ theme: e, anchor: t }) => y(a({
|
|
394
394
|
display: "flex",
|
|
395
395
|
alignItems: "center",
|
|
396
396
|
padding: e.spacing(2)
|
|
@@ -420,41 +420,41 @@ function We({
|
|
|
420
420
|
debugOpacity: l = !1,
|
|
421
421
|
headerBoxProps: d = {},
|
|
422
422
|
onOpened: u,
|
|
423
|
-
onClosed:
|
|
424
|
-
"data-testid":
|
|
423
|
+
onClosed: f,
|
|
424
|
+
"data-testid": m,
|
|
425
425
|
navBarOpen: v = !1,
|
|
426
|
-
navBarWidthOpen:
|
|
427
|
-
navBarWidthClosed:
|
|
426
|
+
navBarWidthOpen: h = 0,
|
|
427
|
+
navBarWidthClosed: b = 0
|
|
428
428
|
}) {
|
|
429
|
-
return /* @__PURE__ */
|
|
429
|
+
return /* @__PURE__ */ p(
|
|
430
430
|
kn,
|
|
431
431
|
{
|
|
432
432
|
SlideProps: {
|
|
433
433
|
onEntered: () => u == null ? void 0 : u(),
|
|
434
|
-
onExited: () =>
|
|
434
|
+
onExited: () => f == null ? void 0 : f()
|
|
435
435
|
},
|
|
436
436
|
variant: "persistent",
|
|
437
437
|
anchor: t,
|
|
438
438
|
open: n,
|
|
439
439
|
width: s,
|
|
440
440
|
debugOpacity: l,
|
|
441
|
-
"data-testid":
|
|
441
|
+
"data-testid": m,
|
|
442
442
|
navBarOpen: v,
|
|
443
|
-
navBarWidthOpen:
|
|
444
|
-
navBarWidthClosed:
|
|
443
|
+
navBarWidthOpen: h,
|
|
444
|
+
navBarWidthClosed: b,
|
|
445
445
|
children: [
|
|
446
|
-
/* @__PURE__ */ o(yn,
|
|
447
|
-
/* @__PURE__ */ o(
|
|
448
|
-
c && /* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ o(yn, y(a({ anchor: t }, d), { children: t === "left" ? /* @__PURE__ */ p(F, { children: [
|
|
447
|
+
/* @__PURE__ */ o(O, { variant: "h6", color: "inherit", component: "div", children: r }),
|
|
448
|
+
c && /* @__PURE__ */ p(Z, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
|
|
449
449
|
/* @__PURE__ */ o(ct, { "data-testid": "arrowbackicon" }),
|
|
450
450
|
" "
|
|
451
451
|
] })
|
|
452
|
-
] }) : /* @__PURE__ */
|
|
453
|
-
c && /* @__PURE__ */
|
|
452
|
+
] }) : /* @__PURE__ */ p(F, { children: [
|
|
453
|
+
c && /* @__PURE__ */ p(Z, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
|
|
454
454
|
/* @__PURE__ */ o(lt, {}),
|
|
455
455
|
" "
|
|
456
456
|
] }),
|
|
457
|
-
/* @__PURE__ */ o(
|
|
457
|
+
/* @__PURE__ */ o(O, { variant: "h6", color: "inherit", component: "div", children: r })
|
|
458
458
|
] }) })),
|
|
459
459
|
e
|
|
460
460
|
]
|
|
@@ -491,7 +491,7 @@ const In = R(I, {
|
|
|
491
491
|
paddingTop: e.spacing(3),
|
|
492
492
|
paddingBottom: e.spacing(3)
|
|
493
493
|
// TODO: Remove max width
|
|
494
|
-
})), me = !1, Ce = !1,
|
|
494
|
+
})), me = !1, Ce = !1, ie = {
|
|
495
495
|
titleText: "",
|
|
496
496
|
flavour: "push",
|
|
497
497
|
width: xt,
|
|
@@ -515,11 +515,11 @@ function Lo({
|
|
|
515
515
|
pageContentDataTestId: l,
|
|
516
516
|
topBarDataTestId: d,
|
|
517
517
|
navBarOpen: u,
|
|
518
|
-
navBarWidthOpen:
|
|
519
|
-
navBarWidthClosed:
|
|
518
|
+
navBarWidthOpen: f,
|
|
519
|
+
navBarWidthClosed: m
|
|
520
520
|
}) {
|
|
521
|
-
const [v,
|
|
522
|
-
titleText:
|
|
521
|
+
const [v, h] = E(me), [b, A] = E(Ce), [D, $] = E(me), [T, P] = E(Ce), N = n !== void 0, k = i !== void 0, {
|
|
522
|
+
titleText: S,
|
|
523
523
|
content: H,
|
|
524
524
|
flavour: W,
|
|
525
525
|
open: g,
|
|
@@ -527,53 +527,53 @@ function Lo({
|
|
|
527
527
|
width: x,
|
|
528
528
|
arrowButtons: w,
|
|
529
529
|
startOpen: M,
|
|
530
|
-
onOpened:
|
|
530
|
+
onOpened: ee,
|
|
531
531
|
onClosed: le,
|
|
532
|
-
dataTestId:
|
|
533
|
-
} = n ? a(a({},
|
|
534
|
-
titleText:
|
|
532
|
+
dataTestId: Ot
|
|
533
|
+
} = n ? a(a({}, ie), n) : a({}, ie), {
|
|
534
|
+
titleText: Bt,
|
|
535
535
|
content: Et,
|
|
536
536
|
flavour: ye,
|
|
537
537
|
open: ce,
|
|
538
538
|
onChangeOpen: Ie,
|
|
539
539
|
width: de,
|
|
540
|
-
arrowButtons:
|
|
541
|
-
startOpen:
|
|
540
|
+
arrowButtons: te,
|
|
541
|
+
startOpen: ne,
|
|
542
542
|
onOpened: Ft,
|
|
543
543
|
onClosed: Pt,
|
|
544
544
|
dataTestId: Nt
|
|
545
|
-
} = i ? a(a({},
|
|
545
|
+
} = i ? a(a({}, ie), i) : a({}, ie);
|
|
546
546
|
K(() => {
|
|
547
|
-
M !== me && (
|
|
547
|
+
M !== me && (h(M), $(M));
|
|
548
548
|
}, [M]), K(() => {
|
|
549
|
-
|
|
550
|
-
}, [
|
|
551
|
-
const ue = g === void 0 ? v : g, pe = ce === void 0 ?
|
|
552
|
-
g === void 0 && (
|
|
549
|
+
ne !== Ce && (A(ne), P(ne));
|
|
550
|
+
}, [ne]);
|
|
551
|
+
const ue = g === void 0 ? v : g, pe = ce === void 0 ? b : ce, $e = (z) => {
|
|
552
|
+
g === void 0 && (h(z), r && k && (z ? (A(!1), P(b)) : A(T))), C && C(z);
|
|
553
553
|
}, Te = (z) => {
|
|
554
|
-
ce === void 0 && (
|
|
554
|
+
ce === void 0 && (A(z), r && N && (z ? (h(!1), $(v)) : h(D))), Ie && Ie(z);
|
|
555
555
|
};
|
|
556
|
-
return /* @__PURE__ */
|
|
556
|
+
return /* @__PURE__ */ p(I, { children: [
|
|
557
557
|
N && /* @__PURE__ */ o(
|
|
558
558
|
We,
|
|
559
559
|
{
|
|
560
|
-
"data-testid":
|
|
560
|
+
"data-testid": Ot,
|
|
561
561
|
anchor: "left",
|
|
562
562
|
open: ue,
|
|
563
563
|
onClose: () => $e(!1),
|
|
564
564
|
width: x,
|
|
565
|
-
titleText:
|
|
565
|
+
titleText: S,
|
|
566
566
|
debugOpacity: s,
|
|
567
567
|
showCloseArrow: w === "both" || w === "close",
|
|
568
|
-
onOpened:
|
|
568
|
+
onOpened: ee,
|
|
569
569
|
onClosed: le,
|
|
570
570
|
navBarOpen: u,
|
|
571
|
-
navBarWidthOpen:
|
|
572
|
-
navBarWidthClosed:
|
|
571
|
+
navBarWidthOpen: f,
|
|
572
|
+
navBarWidthClosed: m,
|
|
573
573
|
children: H
|
|
574
574
|
}
|
|
575
575
|
),
|
|
576
|
-
|
|
576
|
+
k && /* @__PURE__ */ o(
|
|
577
577
|
We,
|
|
578
578
|
{
|
|
579
579
|
"data-testid": Nt,
|
|
@@ -581,14 +581,14 @@ function Lo({
|
|
|
581
581
|
open: pe,
|
|
582
582
|
onClose: () => Te(!1),
|
|
583
583
|
width: de,
|
|
584
|
-
titleText:
|
|
584
|
+
titleText: Bt,
|
|
585
585
|
debugOpacity: s,
|
|
586
|
-
showCloseArrow:
|
|
586
|
+
showCloseArrow: te === "both" || te === "close",
|
|
587
587
|
onOpened: Ft,
|
|
588
588
|
onClosed: Pt,
|
|
589
589
|
navBarOpen: u,
|
|
590
|
-
navBarWidthOpen:
|
|
591
|
-
navBarWidthClosed:
|
|
590
|
+
navBarWidthOpen: f,
|
|
591
|
+
navBarWidthClosed: m,
|
|
592
592
|
children: Et
|
|
593
593
|
}
|
|
594
594
|
),
|
|
@@ -604,18 +604,18 @@ function Lo({
|
|
|
604
604
|
onOpen: () => $e(!0),
|
|
605
605
|
showOpenArrow: w === "both" || w === "open"
|
|
606
606
|
}
|
|
607
|
-
} : {}),
|
|
607
|
+
} : {}), k && ye === "push" ? {
|
|
608
608
|
rightPanel: {
|
|
609
609
|
open: pe,
|
|
610
610
|
width: de,
|
|
611
611
|
onOpen: () => Te(!0),
|
|
612
|
-
showOpenArrow:
|
|
612
|
+
showOpenArrow: te === "both" || te === "open"
|
|
613
613
|
}
|
|
614
614
|
} : {})
|
|
615
615
|
),
|
|
616
616
|
/* @__PURE__ */ o(
|
|
617
617
|
In,
|
|
618
|
-
|
|
618
|
+
y(a(a({}, W === "push" ? {
|
|
619
619
|
leftPanel: {
|
|
620
620
|
open: ue,
|
|
621
621
|
width: x
|
|
@@ -626,7 +626,7 @@ function Lo({
|
|
|
626
626
|
width: de
|
|
627
627
|
}
|
|
628
628
|
} : {}), {
|
|
629
|
-
children: /* @__PURE__ */ o($n,
|
|
629
|
+
children: /* @__PURE__ */ o($n, y(a({ "data-testid": l }, c), { children: e }))
|
|
630
630
|
})
|
|
631
631
|
)
|
|
632
632
|
] });
|
|
@@ -634,15 +634,15 @@ function Lo({
|
|
|
634
634
|
const vt = () => {
|
|
635
635
|
const e = se();
|
|
636
636
|
return Ht(e.breakpoints.down("sm"));
|
|
637
|
-
}, Tn = 64,
|
|
637
|
+
}, Tn = 64, On = 72, Bn = 256, j = _(!0), wt = _(Bn), At = _(On), ve = _(""), En = _(void 0), St = _(Tn), bt = _(void 0);
|
|
638
638
|
function Fn({ links: e }) {
|
|
639
639
|
return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
|
|
640
640
|
}
|
|
641
|
-
const
|
|
642
|
-
root: `${
|
|
643
|
-
menuButton: `${
|
|
644
|
-
hide: `${
|
|
645
|
-
content: `${
|
|
641
|
+
const re = "Navbar", Y = {
|
|
642
|
+
root: `${re}-root`,
|
|
643
|
+
menuButton: `${re}-menuButton`,
|
|
644
|
+
hide: `${re}-hide`,
|
|
645
|
+
content: `${re}-content`
|
|
646
646
|
// userInfoHolder: `${PREFIX}-userInfoHolder`,
|
|
647
647
|
// settings: `${PREFIX}-settings`,
|
|
648
648
|
// pieChartIcon: `${PREFIX}-pieChartIcon`,
|
|
@@ -702,10 +702,10 @@ const ie = "Navbar", Y = {
|
|
|
702
702
|
boxSizing: "border-box",
|
|
703
703
|
display: "flex",
|
|
704
704
|
flexDirection: "column"
|
|
705
|
-
}, t &&
|
|
705
|
+
}, t && y(a({}, ze(e, n)), {
|
|
706
706
|
backgroundColor: "",
|
|
707
707
|
"& .MuiDrawer-paper": ze(e, n)
|
|
708
|
-
})), !t &&
|
|
708
|
+
})), !t && y(a({}, Ue(e, r ? n : i)), {
|
|
709
709
|
backgroundColor: "",
|
|
710
710
|
"& .MuiDrawer-paper": Ue(e, r ? n : i)
|
|
711
711
|
})));
|
|
@@ -720,7 +720,7 @@ function _n(e) {
|
|
|
720
720
|
const Ge = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Ve = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
|
|
721
721
|
function Mn({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
|
|
722
722
|
const r = se();
|
|
723
|
-
return /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ p(
|
|
724
724
|
I,
|
|
725
725
|
{
|
|
726
726
|
sx: {
|
|
@@ -761,7 +761,7 @@ function Mn({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
|
|
|
761
761
|
transition: n ? X(r, ["width", "height"], "entering") : X(r, ["width", "height"], "leaving"),
|
|
762
762
|
aspectRatio: 1
|
|
763
763
|
},
|
|
764
|
-
children: e != null && e.name ? /* @__PURE__ */ o(F, { children: /* @__PURE__ */
|
|
764
|
+
children: e != null && e.name ? /* @__PURE__ */ o(F, { children: /* @__PURE__ */ p(Me, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: n ? "80" : "32", children: [
|
|
765
765
|
" ",
|
|
766
766
|
Ve(e == null ? void 0 : e.name),
|
|
767
767
|
" ",
|
|
@@ -769,9 +769,9 @@ function Mn({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
|
|
|
769
769
|
] }) }) : /* @__PURE__ */ o(Me, {})
|
|
770
770
|
}
|
|
771
771
|
),
|
|
772
|
-
/* @__PURE__ */ o(Nn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(zt, { in: n, children: /* @__PURE__ */
|
|
773
|
-
e != null && e.name ? /* @__PURE__ */ o(
|
|
774
|
-
t ? /* @__PURE__ */ o(
|
|
772
|
+
/* @__PURE__ */ o(Nn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(zt, { in: n, children: /* @__PURE__ */ p(I, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
773
|
+
e != null && e.name ? /* @__PURE__ */ o(O, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "50%" }),
|
|
774
|
+
t ? /* @__PURE__ */ o(O, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "25%" })
|
|
775
775
|
] }) }) })
|
|
776
776
|
]
|
|
777
777
|
}
|
|
@@ -789,30 +789,30 @@ function Rn({
|
|
|
789
789
|
domainCode: d,
|
|
790
790
|
useNewAvatar: u = !1
|
|
791
791
|
}) {
|
|
792
|
-
const
|
|
793
|
-
return /* @__PURE__ */ o(Pn, { className: Y.root, "data-testid": i, children: /* @__PURE__ */
|
|
792
|
+
const f = vt(), m = dt(j);
|
|
793
|
+
return /* @__PURE__ */ o(Pn, { className: Y.root, "data-testid": i, children: /* @__PURE__ */ p(
|
|
794
794
|
Ln,
|
|
795
795
|
{
|
|
796
796
|
open: e,
|
|
797
797
|
widthOpen: n,
|
|
798
798
|
widthClosed: t,
|
|
799
799
|
anchor: "left",
|
|
800
|
-
variant:
|
|
800
|
+
variant: f ? "temporary" : "permanent",
|
|
801
801
|
PaperProps: {
|
|
802
802
|
component: "nav"
|
|
803
803
|
},
|
|
804
804
|
onClose: () => {
|
|
805
|
-
|
|
805
|
+
m(!1);
|
|
806
806
|
},
|
|
807
|
-
isSmallScreen:
|
|
807
|
+
isSmallScreen: f,
|
|
808
808
|
children: [
|
|
809
|
-
!
|
|
810
|
-
r && /* @__PURE__ */
|
|
809
|
+
!f && /* @__PURE__ */ o(Ut, {}),
|
|
810
|
+
r && /* @__PURE__ */ p(I, { flexGrow: "0", children: [
|
|
811
811
|
r,
|
|
812
812
|
/* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } })
|
|
813
813
|
] }),
|
|
814
814
|
/* @__PURE__ */ o(I, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ o(Fn, { links: s }) : s }),
|
|
815
|
-
/* @__PURE__ */
|
|
815
|
+
/* @__PURE__ */ p(I, { flexGrow: "0", children: [
|
|
816
816
|
/* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } }),
|
|
817
817
|
/* @__PURE__ */ o(Mn, { user: l, domainCode: d, open: e, useNewAvatar: u }),
|
|
818
818
|
c && /* @__PURE__ */ o(F, { children: c })
|
|
@@ -857,8 +857,8 @@ function Un({
|
|
|
857
857
|
"data-testid": n,
|
|
858
858
|
middle: i
|
|
859
859
|
}) {
|
|
860
|
-
const r = dt(
|
|
861
|
-
return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */
|
|
860
|
+
const r = dt(j), s = () => r((d) => !d), c = se(), l = vt();
|
|
861
|
+
return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ p(
|
|
862
862
|
je,
|
|
863
863
|
{
|
|
864
864
|
square: !0,
|
|
@@ -877,7 +877,7 @@ function Un({
|
|
|
877
877
|
},
|
|
878
878
|
children: [
|
|
879
879
|
/* @__PURE__ */ o(
|
|
880
|
-
|
|
880
|
+
Z,
|
|
881
881
|
{
|
|
882
882
|
size: "medium",
|
|
883
883
|
color: "inherit",
|
|
@@ -886,7 +886,7 @@ function Un({
|
|
|
886
886
|
children: /* @__PURE__ */ o(en, { fontSize: "medium" })
|
|
887
887
|
}
|
|
888
888
|
),
|
|
889
|
-
/* @__PURE__ */ o(
|
|
889
|
+
/* @__PURE__ */ o(O, { className: zn.titleText, variant: "h6", component: "h1", children: e }),
|
|
890
890
|
i
|
|
891
891
|
]
|
|
892
892
|
}
|
|
@@ -903,26 +903,26 @@ function _o({
|
|
|
903
903
|
navBarMiddle: l,
|
|
904
904
|
navBarBottom: d,
|
|
905
905
|
user: u,
|
|
906
|
-
domainCode:
|
|
907
|
-
useNewAvatar:
|
|
906
|
+
domainCode: f,
|
|
907
|
+
useNewAvatar: m = !1
|
|
908
908
|
}) {
|
|
909
909
|
pt([
|
|
910
|
-
[
|
|
910
|
+
[j, n != null ? n : !0],
|
|
911
911
|
[ve, t != null ? t : ""]
|
|
912
912
|
]);
|
|
913
|
-
const v = _e(
|
|
914
|
-
return /* @__PURE__ */
|
|
913
|
+
const v = _e(j), [h] = V(wt), [b] = V(At), A = _e(ve), [D] = V(St), [$] = V(En), [T] = V(bt);
|
|
914
|
+
return /* @__PURE__ */ p(I, { children: [
|
|
915
915
|
/* @__PURE__ */ o(Gt, {}),
|
|
916
916
|
/* @__PURE__ */ o(
|
|
917
917
|
Un,
|
|
918
918
|
{
|
|
919
|
-
titleText:
|
|
919
|
+
titleText: A,
|
|
920
920
|
"data-testid": s,
|
|
921
|
-
height:
|
|
921
|
+
height: D,
|
|
922
922
|
middle: $
|
|
923
923
|
}
|
|
924
924
|
),
|
|
925
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ p(I, { sx: { display: "flex" }, children: [
|
|
926
926
|
/* @__PURE__ */ o(
|
|
927
927
|
Rn,
|
|
928
928
|
{
|
|
@@ -931,19 +931,19 @@ function _o({
|
|
|
931
931
|
middle: l,
|
|
932
932
|
bottom: d,
|
|
933
933
|
user: u,
|
|
934
|
-
domainCode:
|
|
935
|
-
widthOpen:
|
|
936
|
-
widthClosed:
|
|
937
|
-
offsetTop:
|
|
934
|
+
domainCode: f,
|
|
935
|
+
widthOpen: h,
|
|
936
|
+
widthClosed: b,
|
|
937
|
+
offsetTop: D,
|
|
938
938
|
"data-testid": c,
|
|
939
|
-
useNewAvatar:
|
|
939
|
+
useNewAvatar: m
|
|
940
940
|
}
|
|
941
941
|
),
|
|
942
942
|
/* @__PURE__ */ o(
|
|
943
943
|
Hn,
|
|
944
|
-
|
|
944
|
+
y(a({
|
|
945
945
|
"data-testid": r,
|
|
946
|
-
topBarHeight:
|
|
946
|
+
topBarHeight: D
|
|
947
947
|
}, i), {
|
|
948
948
|
children: e
|
|
949
949
|
})
|
|
@@ -962,45 +962,45 @@ const kt = ({
|
|
|
962
962
|
sx: l,
|
|
963
963
|
"data-testid": d,
|
|
964
964
|
disableCloseOnBackdropOrEscape: u = !1,
|
|
965
|
-
isLoading:
|
|
965
|
+
isLoading: f = !1
|
|
966
966
|
}) => {
|
|
967
|
-
var
|
|
968
|
-
const [
|
|
969
|
-
return /* @__PURE__ */
|
|
967
|
+
var h, b;
|
|
968
|
+
const [m, v] = E(!1);
|
|
969
|
+
return /* @__PURE__ */ p(
|
|
970
970
|
tt,
|
|
971
971
|
{
|
|
972
972
|
open: e,
|
|
973
|
-
onClose: (
|
|
974
|
-
u && (
|
|
973
|
+
onClose: (A, D) => L(void 0, null, function* () {
|
|
974
|
+
u && (D === "backdropClick" || D === "escapeKeyDown") || m || (s != null && s.onClick ? yield s.onClick() : c());
|
|
975
975
|
}),
|
|
976
976
|
fullWidth: !0,
|
|
977
977
|
maxWidth: i != null ? i : "xs",
|
|
978
978
|
"data-testid": d,
|
|
979
979
|
sx: l,
|
|
980
980
|
children: [
|
|
981
|
-
|
|
981
|
+
f && /* @__PURE__ */ o(nt, { sx: { height: "4px", marginBottom: "-4px" } }),
|
|
982
982
|
/* @__PURE__ */ o(ot, { children: t }),
|
|
983
983
|
/* @__PURE__ */ o(it, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
|
|
984
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ p(rt, { children: [
|
|
985
985
|
/* @__PURE__ */ o(
|
|
986
|
-
|
|
986
|
+
J,
|
|
987
987
|
{
|
|
988
|
-
onClick: (
|
|
988
|
+
onClick: (h = s == null ? void 0 : s.onClick) != null ? h : c,
|
|
989
989
|
"data-testid": s == null ? void 0 : s.testId,
|
|
990
|
-
disabled: (s == null ? void 0 : s.disabled) ||
|
|
990
|
+
disabled: (s == null ? void 0 : s.disabled) || m,
|
|
991
991
|
color: s == null ? void 0 : s.buttonColor,
|
|
992
|
-
children: (
|
|
992
|
+
children: (b = s == null ? void 0 : s.text) != null ? b : "Cancel"
|
|
993
993
|
}
|
|
994
994
|
),
|
|
995
995
|
r && /* @__PURE__ */ o(
|
|
996
|
-
|
|
996
|
+
J,
|
|
997
997
|
{
|
|
998
998
|
onClick: () => L(void 0, null, function* () {
|
|
999
|
-
var
|
|
1000
|
-
v(!0), yield (
|
|
999
|
+
var A;
|
|
1000
|
+
v(!0), yield (A = r.onClick) == null ? void 0 : A.call(r), v(!1);
|
|
1001
1001
|
}),
|
|
1002
1002
|
"data-testid": r.testId,
|
|
1003
|
-
disabled: r.disabled ||
|
|
1003
|
+
disabled: r.disabled || m,
|
|
1004
1004
|
color: r == null ? void 0 : r.buttonColor,
|
|
1005
1005
|
children: r.text
|
|
1006
1006
|
}
|
|
@@ -1033,27 +1033,27 @@ function Mo({
|
|
|
1033
1033
|
sx: l,
|
|
1034
1034
|
boxSx: d,
|
|
1035
1035
|
textFieldColor: u,
|
|
1036
|
-
textFieldVariant:
|
|
1037
|
-
loadingText:
|
|
1036
|
+
textFieldVariant: f = "filled",
|
|
1037
|
+
loadingText: m = "Loading...",
|
|
1038
1038
|
noOptionsText: v = "No options",
|
|
1039
|
-
popupIcon:
|
|
1040
|
-
error:
|
|
1041
|
-
helperText:
|
|
1042
|
-
preLoadedOptions:
|
|
1039
|
+
popupIcon: h = /* @__PURE__ */ o(nn, {}),
|
|
1040
|
+
error: b = !1,
|
|
1041
|
+
helperText: A = "",
|
|
1042
|
+
preLoadedOptions: D = void 0,
|
|
1043
1043
|
disablePortal: $ = !1,
|
|
1044
1044
|
disableIconFlip: T = !1
|
|
1045
1045
|
}) {
|
|
1046
|
-
const [P, N] = E(""),
|
|
1046
|
+
const [P, N] = E(""), k = (g, C) => {
|
|
1047
1047
|
const x = s.filter((w) => w.id !== C);
|
|
1048
1048
|
n(x, "delete", g);
|
|
1049
|
-
}, { data:
|
|
1049
|
+
}, { data: S, isLoading: H } = yt({
|
|
1050
1050
|
inputValue: P,
|
|
1051
1051
|
label: r,
|
|
1052
1052
|
lookup: e,
|
|
1053
1053
|
minLength: i,
|
|
1054
|
-
preLoadedOptions:
|
|
1054
|
+
preLoadedOptions: D
|
|
1055
1055
|
}), W = P.length >= i;
|
|
1056
|
-
return /* @__PURE__ */
|
|
1056
|
+
return /* @__PURE__ */ p("div", { "data-testid": c, children: [
|
|
1057
1057
|
/* @__PURE__ */ o(
|
|
1058
1058
|
Se,
|
|
1059
1059
|
{
|
|
@@ -1063,7 +1063,7 @@ function Mo({
|
|
|
1063
1063
|
multiple: !0,
|
|
1064
1064
|
getOptionLabel: (g) => typeof g == "string" ? g : g.label,
|
|
1065
1065
|
loading: W ? H : !1,
|
|
1066
|
-
options: [...s, ...
|
|
1066
|
+
options: [...s, ...S != null ? S : []],
|
|
1067
1067
|
filterSelectedOptions: !0,
|
|
1068
1068
|
includeInputInList: !0,
|
|
1069
1069
|
value: s,
|
|
@@ -1072,18 +1072,18 @@ function Mo({
|
|
|
1072
1072
|
},
|
|
1073
1073
|
onInputChange: (g, C) => N(C),
|
|
1074
1074
|
noOptionsText: W ? v : "Start typing to search",
|
|
1075
|
-
loadingText:
|
|
1076
|
-
popupIcon:
|
|
1075
|
+
loadingText: m,
|
|
1076
|
+
popupIcon: h,
|
|
1077
1077
|
renderInput: (g) => /* @__PURE__ */ o(
|
|
1078
1078
|
be,
|
|
1079
|
-
|
|
1079
|
+
y(a({}, g), {
|
|
1080
1080
|
label: r,
|
|
1081
1081
|
fullWidth: !0,
|
|
1082
|
-
variant:
|
|
1083
|
-
error:
|
|
1084
|
-
helperText:
|
|
1085
|
-
InputProps:
|
|
1086
|
-
endAdornment: /* @__PURE__ */
|
|
1082
|
+
variant: f,
|
|
1083
|
+
error: b,
|
|
1084
|
+
helperText: A,
|
|
1085
|
+
InputProps: y(a({}, g.InputProps), {
|
|
1086
|
+
endAdornment: /* @__PURE__ */ p(F, { children: [
|
|
1087
1087
|
H ? /* @__PURE__ */ o(De, { color: "inherit", size: 20 }) : null,
|
|
1088
1088
|
g.InputProps.endAdornment
|
|
1089
1089
|
] })
|
|
@@ -1105,17 +1105,17 @@ function Mo({
|
|
|
1105
1105
|
}), M = an(C.label, w);
|
|
1106
1106
|
return /* @__PURE__ */ xe(
|
|
1107
1107
|
"li",
|
|
1108
|
-
|
|
1108
|
+
y(a({}, g), {
|
|
1109
1109
|
key: C.id,
|
|
1110
1110
|
"data-testid": c ? `${c}:Autocomplete:option(${C.id.toString()})` : void 0
|
|
1111
1111
|
}),
|
|
1112
|
-
/* @__PURE__ */ o("div", { children: M.map((
|
|
1112
|
+
/* @__PURE__ */ o("div", { children: M.map((ee, le) => /* @__PURE__ */ o(
|
|
1113
1113
|
"span",
|
|
1114
1114
|
{
|
|
1115
1115
|
style: {
|
|
1116
|
-
fontWeight:
|
|
1116
|
+
fontWeight: ee.highlight ? 700 : 400
|
|
1117
1117
|
},
|
|
1118
|
-
children:
|
|
1118
|
+
children: ee.text
|
|
1119
1119
|
},
|
|
1120
1120
|
le
|
|
1121
1121
|
)) })
|
|
@@ -1123,7 +1123,7 @@ function Mo({
|
|
|
1123
1123
|
} else
|
|
1124
1124
|
return /* @__PURE__ */ xe(
|
|
1125
1125
|
"li",
|
|
1126
|
-
|
|
1126
|
+
y(a({}, g), {
|
|
1127
1127
|
key: C.id,
|
|
1128
1128
|
"data-testid": c ? `${c}:option(${C.id.toString()})` : void 0
|
|
1129
1129
|
}),
|
|
@@ -1155,11 +1155,11 @@ function Mo({
|
|
|
1155
1155
|
}
|
|
1156
1156
|
]
|
|
1157
1157
|
},
|
|
1158
|
-
children: /* @__PURE__ */ o(
|
|
1158
|
+
children: /* @__PURE__ */ o(O, { style: { whiteSpace: "normal" }, children: g.chipLabel ? g.chipLabel : g.label })
|
|
1159
1159
|
}
|
|
1160
1160
|
),
|
|
1161
1161
|
"data-testid": c ? `${c}:Chip(${g.id.toString()})` : void 0,
|
|
1162
|
-
onDelete: (C) =>
|
|
1162
|
+
onDelete: (C) => k(C, g.id),
|
|
1163
1163
|
deleteIcon: /* @__PURE__ */ o(
|
|
1164
1164
|
tn,
|
|
1165
1165
|
{
|
|
@@ -1183,60 +1183,60 @@ const Ro = ({
|
|
|
1183
1183
|
"data-testid": l,
|
|
1184
1184
|
noOptionsText: d = "No options",
|
|
1185
1185
|
minLength: u = 3,
|
|
1186
|
-
disablePortal:
|
|
1187
|
-
preLoadedOptions:
|
|
1186
|
+
disablePortal: f = !1,
|
|
1187
|
+
preLoadedOptions: m,
|
|
1188
1188
|
helperText: v = "",
|
|
1189
|
-
disabled:
|
|
1190
|
-
popupIcon:
|
|
1191
|
-
disableIconFlip:
|
|
1189
|
+
disabled: h,
|
|
1190
|
+
popupIcon: b,
|
|
1191
|
+
disableIconFlip: A
|
|
1192
1192
|
}) => {
|
|
1193
|
-
const [
|
|
1194
|
-
inputValue:
|
|
1193
|
+
const [D, $] = E(""), { data: T, isLoading: P } = yt({
|
|
1194
|
+
inputValue: D,
|
|
1195
1195
|
label: n,
|
|
1196
1196
|
lookup: e,
|
|
1197
1197
|
minLength: u != null ? u : 0,
|
|
1198
|
-
preLoadedOptions:
|
|
1199
|
-
}), N =
|
|
1198
|
+
preLoadedOptions: m
|
|
1199
|
+
}), N = D.length >= u;
|
|
1200
1200
|
return /* @__PURE__ */ o("div", { "data-testid": l, children: /* @__PURE__ */ o(Xt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
|
|
1201
1201
|
Se,
|
|
1202
1202
|
{
|
|
1203
|
-
sx: a(a({}, r),
|
|
1203
|
+
sx: a(a({}, r), A ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
1204
1204
|
"data-testid": l ? `${l}:Autocomplete` : void 0,
|
|
1205
1205
|
loading: N ? P : !1,
|
|
1206
1206
|
options: T != null ? T : [],
|
|
1207
|
-
onChange: (
|
|
1208
|
-
t(
|
|
1207
|
+
onChange: (k, S) => {
|
|
1208
|
+
t(k, S);
|
|
1209
1209
|
},
|
|
1210
|
-
disablePortal:
|
|
1211
|
-
filterOptions: (
|
|
1210
|
+
disablePortal: f,
|
|
1211
|
+
filterOptions: (k) => k,
|
|
1212
1212
|
value: i,
|
|
1213
1213
|
noOptionsText: N ? d : "Start typing to search",
|
|
1214
|
-
getOptionLabel: (
|
|
1215
|
-
popupIcon:
|
|
1216
|
-
renderInput: (
|
|
1214
|
+
getOptionLabel: (k) => k.label,
|
|
1215
|
+
popupIcon: b,
|
|
1216
|
+
renderInput: (k) => /* @__PURE__ */ o(
|
|
1217
1217
|
be,
|
|
1218
|
-
|
|
1218
|
+
y(a({
|
|
1219
1219
|
"data-testid": l ? `${l}:Autocomplete:TextField` : void 0
|
|
1220
|
-
},
|
|
1220
|
+
}, k), {
|
|
1221
1221
|
variant: c,
|
|
1222
1222
|
label: n,
|
|
1223
1223
|
color: s,
|
|
1224
1224
|
helperText: v
|
|
1225
1225
|
})
|
|
1226
1226
|
),
|
|
1227
|
-
isOptionEqualToValue: (
|
|
1228
|
-
onInputChange: (
|
|
1229
|
-
$(
|
|
1227
|
+
isOptionEqualToValue: (k, S) => k.id === S.id,
|
|
1228
|
+
onInputChange: (k, S) => {
|
|
1229
|
+
$(S);
|
|
1230
1230
|
},
|
|
1231
|
-
renderOption: (
|
|
1231
|
+
renderOption: (k, S) => /* @__PURE__ */ xe(
|
|
1232
1232
|
"li",
|
|
1233
|
-
|
|
1234
|
-
key:
|
|
1235
|
-
"data-testid": l ? `${l}:Autocomplete:option(${
|
|
1233
|
+
y(a({}, k), {
|
|
1234
|
+
key: S.id,
|
|
1235
|
+
"data-testid": l ? `${l}:Autocomplete:option(${S.id.toString()})` : void 0
|
|
1236
1236
|
}),
|
|
1237
|
-
|
|
1237
|
+
S.label
|
|
1238
1238
|
),
|
|
1239
|
-
disabled:
|
|
1239
|
+
disabled: h
|
|
1240
1240
|
}
|
|
1241
1241
|
) }) });
|
|
1242
1242
|
}, Gn = (e) => {
|
|
@@ -1265,8 +1265,8 @@ const Ro = ({
|
|
|
1265
1265
|
return K(() => {
|
|
1266
1266
|
(() => L(void 0, null, function* () {
|
|
1267
1267
|
if (s > 0) {
|
|
1268
|
-
const v = yield r({ cacheMode: "off" }),
|
|
1269
|
-
n(
|
|
1268
|
+
const v = yield r({ cacheMode: "off" }), h = Gn(v) * 1e3;
|
|
1269
|
+
n(h);
|
|
1270
1270
|
}
|
|
1271
1271
|
}))();
|
|
1272
1272
|
}, [s, r, n]), /* @__PURE__ */ o(
|
|
@@ -1320,12 +1320,12 @@ function Wo({
|
|
|
1320
1320
|
onError: r = () => {
|
|
1321
1321
|
}
|
|
1322
1322
|
}) {
|
|
1323
|
-
var
|
|
1323
|
+
var m, v;
|
|
1324
1324
|
const { isAuthenticated: s, isLoading: c, error: l, loginWithRedirect: d, logout: u } = ht();
|
|
1325
1325
|
K(() => {
|
|
1326
1326
|
l && r(l);
|
|
1327
1327
|
}, [l, r]);
|
|
1328
|
-
const
|
|
1328
|
+
const f = Rt(
|
|
1329
1329
|
() => ({
|
|
1330
1330
|
appState: {
|
|
1331
1331
|
returnTo: `${window.location.pathname}${window.location.search}`
|
|
@@ -1334,47 +1334,50 @@ function Wo({
|
|
|
1334
1334
|
[]
|
|
1335
1335
|
);
|
|
1336
1336
|
if (K(() => {
|
|
1337
|
-
c || s || l || d(
|
|
1338
|
-
}, [c, s, l, d, r,
|
|
1337
|
+
c || s || l || d(f);
|
|
1338
|
+
}, [c, s, l, d, r, f]), l) {
|
|
1339
1339
|
if (i || console.error(
|
|
1340
1340
|
`Error detected in AuthGuard [isAuthenticated=${s},isLoading=${c}]`,
|
|
1341
1341
|
l
|
|
1342
1342
|
), n === "all")
|
|
1343
1343
|
throw l;
|
|
1344
1344
|
if (Vn(l)) {
|
|
1345
|
-
let
|
|
1345
|
+
let h = "Auth error", b = "An unknown Auth0 error occurred.";
|
|
1346
1346
|
if (qn(l))
|
|
1347
|
-
|
|
1347
|
+
h = "Unauthorised", b = `You are not authorised to access ${t}.`;
|
|
1348
1348
|
else if (Xn(l))
|
|
1349
|
-
|
|
1349
|
+
h = "App not authorised", b = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
|
|
1350
1350
|
else if (Qn(l))
|
|
1351
|
-
|
|
1352
|
-
else if (
|
|
1351
|
+
h = "Auth0 script execution time exceeded", b = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";
|
|
1352
|
+
else if (l.message === "Invalid state") {
|
|
1353
|
+
const A = localStorage.getItem("auth0_redirect_count");
|
|
1354
|
+
A ? A && parseInt(A) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(A) + 1)), d(f)) : (localStorage.setItem("auth0_redirect_count", "1"), d(f));
|
|
1355
|
+
} else if (n === "unknown")
|
|
1353
1356
|
throw l;
|
|
1354
|
-
return /* @__PURE__ */
|
|
1355
|
-
/* @__PURE__ */ o(ot, { children:
|
|
1356
|
-
/* @__PURE__ */
|
|
1357
|
-
/* @__PURE__ */ o(
|
|
1357
|
+
return /* @__PURE__ */ p(tt, { open: !0, children: [
|
|
1358
|
+
/* @__PURE__ */ o(ot, { children: h }),
|
|
1359
|
+
/* @__PURE__ */ p(it, { children: [
|
|
1360
|
+
/* @__PURE__ */ o(O, { children: b }),
|
|
1358
1361
|
/* @__PURE__ */ o("br", {}),
|
|
1359
|
-
/* @__PURE__ */ o(
|
|
1360
|
-
/* @__PURE__ */
|
|
1362
|
+
/* @__PURE__ */ o(O, { variant: "subtitle2", children: "Details from Auth0" }),
|
|
1363
|
+
/* @__PURE__ */ p(O, { variant: "body2", children: [
|
|
1361
1364
|
"error: ",
|
|
1362
|
-
(
|
|
1365
|
+
(m = l == null ? void 0 : l.error) != null ? m : "N/A"
|
|
1363
1366
|
] }),
|
|
1364
|
-
/* @__PURE__ */
|
|
1367
|
+
/* @__PURE__ */ p(O, { variant: "body2", children: [
|
|
1365
1368
|
"description: ",
|
|
1366
1369
|
(v = l == null ? void 0 : l.error_description) != null ? v : "N/A"
|
|
1367
1370
|
] })
|
|
1368
1371
|
] }),
|
|
1369
|
-
/* @__PURE__ */
|
|
1372
|
+
/* @__PURE__ */ p(rt, { children: [
|
|
1373
|
+
h === "Auth0 script execution time exceeded" && /* @__PURE__ */ o(J, { href: window.location.origin + window.location.pathname, children: "Reload" }),
|
|
1374
|
+
/* @__PURE__ */ o(J, { onClick: () => u({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
|
|
1375
|
+
] })
|
|
1370
1376
|
] });
|
|
1371
|
-
} else if (l.message === "Invalid state") {
|
|
1372
|
-
const p = localStorage.getItem("auth0_redirect_count");
|
|
1373
|
-
p && parseInt(p) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(p) + 1)), d(m));
|
|
1374
1377
|
} else if (n === "unknown")
|
|
1375
1378
|
throw l;
|
|
1376
1379
|
}
|
|
1377
|
-
return s ? /* @__PURE__ */ o(F, { children: e }) : /* @__PURE__ */ o(un, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
|
|
1380
|
+
return s ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ o(F, { children: e })) : /* @__PURE__ */ o(un, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
|
|
1378
1381
|
}
|
|
1379
1382
|
const Yn = {
|
|
1380
1383
|
autoHideDuration: 6e3,
|
|
@@ -1410,62 +1413,62 @@ function no(s) {
|
|
|
1410
1413
|
"children"
|
|
1411
1414
|
]);
|
|
1412
1415
|
var C;
|
|
1413
|
-
const [{ open: l }, d] = E({ open: !1 }), u = ge([]),
|
|
1416
|
+
const [{ open: l }, d] = E({ open: !1 }), u = ge([]), f = ge(Date.now()), m = ge(0), v = ae((x) => {
|
|
1414
1417
|
d({ open: x });
|
|
1415
|
-
}, []),
|
|
1416
|
-
|
|
1417
|
-
`SaladBarProvider: MAX_QUEUE_LENGTH (${Xe}) hit ${
|
|
1418
|
-
),
|
|
1419
|
-
const w = a(
|
|
1418
|
+
}, []), h = ae((x = {}) => {
|
|
1419
|
+
m.current += 1, u.current.length >= Xe && Date.now() - f.current >= Qe && (f.current = Date.now(), console.error(
|
|
1420
|
+
`SaladBarProvider: MAX_QUEUE_LENGTH (${Xe}) hit ${m.current} times in last ${Qe}ms)`
|
|
1421
|
+
), m.current = 0);
|
|
1422
|
+
const w = a(y(a({}, qe), {
|
|
1420
1423
|
key: Zn()
|
|
1421
1424
|
}), x);
|
|
1422
1425
|
return u.current.push(w), u.current.length === 1 && d({ open: !0 }), w.key;
|
|
1423
|
-
}, []),
|
|
1426
|
+
}, []), b = (x = "", w = {}) => h(a({ message: x, severity: "success" }, w)), A = (x = "", w = {}) => h(a({ message: x, severity: "info" }, w)), D = (x = "", w = {}) => h(a({ message: x, severity: "warning" }, w)), $ = (x = "", w = {}) => h(a({ message: x, severity: "error" }, w)), T = (x) => {
|
|
1424
1427
|
const w = u.current.findIndex((M) => M.key === x);
|
|
1425
1428
|
if (w !== -1)
|
|
1426
1429
|
return w === 0 ? (d({ open: !1 }), u.current[0]) : u.current.splice(w, 1);
|
|
1427
1430
|
}, P = (x, w) => {
|
|
1428
1431
|
n(x, w) && d({ open: !1 });
|
|
1429
1432
|
}, N = () => {
|
|
1430
|
-
},
|
|
1433
|
+
}, k = () => {
|
|
1431
1434
|
u.current.shift(), u.current.length > 0 && d({ open: !0 });
|
|
1432
|
-
},
|
|
1433
|
-
"autoHideDuration" in
|
|
1435
|
+
}, S = (C = u.current[0]) != null ? C : a({}, qe), H = {};
|
|
1436
|
+
"autoHideDuration" in S && (H.autoHideDuration = S.autoHideDuration);
|
|
1434
1437
|
const W = a(a({}, Yn), r), g = a(a({
|
|
1435
1438
|
open: l,
|
|
1436
1439
|
setOpen: v,
|
|
1437
|
-
enqueueNotification:
|
|
1438
|
-
enqueueSuccessNotification:
|
|
1439
|
-
enqueueInfoNotification:
|
|
1440
|
-
enqueueWarningNotification:
|
|
1440
|
+
enqueueNotification: h,
|
|
1441
|
+
enqueueSuccessNotification: b,
|
|
1442
|
+
enqueueInfoNotification: A,
|
|
1443
|
+
enqueueWarningNotification: D,
|
|
1441
1444
|
enqueueErrorNotification: $,
|
|
1442
1445
|
removeNotification: T
|
|
1443
1446
|
}, e), t);
|
|
1444
|
-
return /* @__PURE__ */
|
|
1447
|
+
return /* @__PURE__ */ p(It.Provider, { value: g, children: [
|
|
1445
1448
|
i,
|
|
1446
1449
|
/* @__PURE__ */ o(
|
|
1447
1450
|
Qt,
|
|
1448
|
-
|
|
1451
|
+
y(a(a({}, W), H), {
|
|
1449
1452
|
open: l,
|
|
1450
1453
|
onClose: P,
|
|
1451
1454
|
TransitionProps: {
|
|
1452
|
-
onExited:
|
|
1455
|
+
onExited: k,
|
|
1453
1456
|
onExit: N
|
|
1454
1457
|
},
|
|
1455
1458
|
sx: { zIndex: Jn },
|
|
1456
|
-
children: /* @__PURE__ */
|
|
1459
|
+
children: /* @__PURE__ */ p("div", { children: [
|
|
1457
1460
|
/* @__PURE__ */ o(
|
|
1458
1461
|
Yt,
|
|
1459
1462
|
{
|
|
1460
1463
|
onClose: (x) => P(x, "closeAlert"),
|
|
1461
|
-
severity:
|
|
1464
|
+
severity: S.severity,
|
|
1462
1465
|
variant: "filled",
|
|
1463
|
-
icon:
|
|
1464
|
-
style:
|
|
1465
|
-
children:
|
|
1466
|
+
icon: S.progressIndicator === "circular" ? /* @__PURE__ */ o(De, { size: "1em" }) : void 0,
|
|
1467
|
+
style: S.progressIndicator === "linear" ? jn : void 0,
|
|
1468
|
+
children: S.message
|
|
1466
1469
|
}
|
|
1467
1470
|
),
|
|
1468
|
-
|
|
1471
|
+
S.progressIndicator === "linear" && /* @__PURE__ */ o(nt, { color: "primary" })
|
|
1469
1472
|
] })
|
|
1470
1473
|
})
|
|
1471
1474
|
)
|
|
@@ -1478,7 +1481,7 @@ function oo() {
|
|
|
1478
1481
|
return e;
|
|
1479
1482
|
}
|
|
1480
1483
|
const zo = Q(
|
|
1481
|
-
(e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(no,
|
|
1484
|
+
(e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(no, y(a({}, e), { overrideState: t, overrideActions: n, children: i }))
|
|
1482
1485
|
), io = on(), Uo = ({
|
|
1483
1486
|
children: e,
|
|
1484
1487
|
store: t
|
|
@@ -1514,31 +1517,31 @@ const Ye = _(
|
|
|
1514
1517
|
applicationName: r,
|
|
1515
1518
|
handleLogout: s
|
|
1516
1519
|
}) => {
|
|
1517
|
-
const [c, l] = V(Tt), [d, u] = E(c), { enqueueSuccessNotification:
|
|
1518
|
-
d ? (l(d),
|
|
1519
|
-
}),
|
|
1520
|
-
c && !
|
|
1520
|
+
const [c, l] = V(Tt), [d, u] = E(c), { enqueueSuccessNotification: f } = oo(), m = i.length === 0, v = !!c && !i.includes(c) && !i.includes(d), h = !c || m || v, b = () => L(void 0, null, function* () {
|
|
1521
|
+
d ? (l(d), f(`Set organisation to ${d}`), n()) : l("");
|
|
1522
|
+
}), A = () => L(void 0, null, function* () {
|
|
1523
|
+
c && !m && !v ? (u(c), n()) : h && s();
|
|
1521
1524
|
});
|
|
1522
|
-
let
|
|
1523
|
-
return
|
|
1525
|
+
let D;
|
|
1526
|
+
return m ? D = "Unable to retrieve your active organisations. Try logging in again." : v && (D = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ p(
|
|
1524
1527
|
kt,
|
|
1525
1528
|
{
|
|
1526
1529
|
isOpen: t,
|
|
1527
1530
|
dialogTitle: "Select an organisation",
|
|
1528
1531
|
primaryButton: {
|
|
1529
1532
|
text: "Confirm",
|
|
1530
|
-
onClick:
|
|
1531
|
-
disabled: !d ||
|
|
1533
|
+
onClick: b,
|
|
1534
|
+
disabled: !d || m || v,
|
|
1532
1535
|
buttonColor: "primary"
|
|
1533
1536
|
},
|
|
1534
1537
|
secondaryButton: {
|
|
1535
|
-
text:
|
|
1536
|
-
onClick:
|
|
1538
|
+
text: h ? "Logout" : "Cancel",
|
|
1539
|
+
onClick: A
|
|
1537
1540
|
},
|
|
1538
|
-
onClose:
|
|
1541
|
+
onClose: h ? () => {
|
|
1539
1542
|
} : n,
|
|
1540
1543
|
children: [
|
|
1541
|
-
/* @__PURE__ */
|
|
1544
|
+
/* @__PURE__ */ p(O, { marginBottom: 2, children: [
|
|
1542
1545
|
"Select the default organisation that you want to use with the ",
|
|
1543
1546
|
r,
|
|
1544
1547
|
"."
|
|
@@ -1555,11 +1558,11 @@ const Ye = _(
|
|
|
1555
1558
|
options: [...i],
|
|
1556
1559
|
renderInput: ($) => /* @__PURE__ */ o(
|
|
1557
1560
|
be,
|
|
1558
|
-
|
|
1561
|
+
y(a({}, $), {
|
|
1559
1562
|
variant: "filled",
|
|
1560
1563
|
label: "Select organisation",
|
|
1561
|
-
InputProps:
|
|
1562
|
-
endAdornment: /* @__PURE__ */
|
|
1564
|
+
InputProps: y(a({}, $.InputProps), {
|
|
1565
|
+
endAdornment: /* @__PURE__ */ p(F, { children: [
|
|
1563
1566
|
e ? /* @__PURE__ */ o(De, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
|
|
1564
1567
|
$.InputProps.endAdornment
|
|
1565
1568
|
] })
|
|
@@ -1568,7 +1571,7 @@ const Ye = _(
|
|
|
1568
1571
|
)
|
|
1569
1572
|
}
|
|
1570
1573
|
),
|
|
1571
|
-
|
|
1574
|
+
D && /* @__PURE__ */ o(Kt, { error: !0, children: D })
|
|
1572
1575
|
]
|
|
1573
1576
|
}
|
|
1574
1577
|
);
|
|
@@ -1719,7 +1722,7 @@ const Ye = _(
|
|
|
1719
1722
|
}
|
|
1720
1723
|
}), so = {
|
|
1721
1724
|
domainCode: Tt,
|
|
1722
|
-
navBarOpen:
|
|
1725
|
+
navBarOpen: j,
|
|
1723
1726
|
navBarWidthOpen: wt,
|
|
1724
1727
|
navBarWidthClosed: At,
|
|
1725
1728
|
titleText: ve,
|
|
@@ -1753,7 +1756,7 @@ export {
|
|
|
1753
1756
|
It as Context,
|
|
1754
1757
|
ke as ContextError,
|
|
1755
1758
|
Go as DomainCodeDialog,
|
|
1756
|
-
|
|
1759
|
+
Oo as ExampleComponent,
|
|
1757
1760
|
Mo as FetchAutocomplete,
|
|
1758
1761
|
lo as HydrateAtoms,
|
|
1759
1762
|
ft as NAVBAR_WIDTH_CLOSED,
|
|
@@ -1773,7 +1776,7 @@ export {
|
|
|
1773
1776
|
Gn as getAuth0Expiry,
|
|
1774
1777
|
qo as internalAgSystemsTheme,
|
|
1775
1778
|
q as navBarClasses,
|
|
1776
|
-
|
|
1779
|
+
j as navBarOpenAtom,
|
|
1777
1780
|
bt as navBarTopAtom,
|
|
1778
1781
|
At as navBarWidthClosedAtom,
|
|
1779
1782
|
wt as navBarWidthOpenAtom,
|
|
@@ -1785,7 +1788,7 @@ export {
|
|
|
1785
1788
|
oo as useSaladBar,
|
|
1786
1789
|
Xo as withAtomProvider,
|
|
1787
1790
|
Eo as withBrowserRouter,
|
|
1788
|
-
|
|
1791
|
+
Bo as withNavBarProvider,
|
|
1789
1792
|
Qo as withOverrideDefaults,
|
|
1790
1793
|
Yo as withQueryClient,
|
|
1791
1794
|
zo as withSaladBarProvider
|