@australiangreens/ag-internal-components 0.1.24 → 0.1.26
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/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +392 -373
- package/dist/esm/index.js.map +1 -1
- package/dist/utils/auth.d.ts +7 -0
- package/dist/utils/auth.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/utils/determineUserLevel.d.ts +0 -4
- package/dist/utils/determineUserLevel.d.ts.map +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var nt = Object.defineProperty, it = Object.defineProperties;
|
|
2
|
+
var rt = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var G = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var j = (e, t, o) => t in e ?
|
|
4
|
+
var ue = Object.prototype.hasOwnProperty, pe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var j = (e, t, o) => t in e ? nt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, d = (e, t) => {
|
|
6
6
|
for (var o in t || (t = {}))
|
|
7
|
-
|
|
7
|
+
ue.call(t, o) && j(e, o, t[o]);
|
|
8
8
|
if (G)
|
|
9
9
|
for (var o of G(t))
|
|
10
|
-
|
|
10
|
+
pe.call(t, o) && j(e, o, t[o]);
|
|
11
11
|
return e;
|
|
12
|
-
}, D = (e, t) =>
|
|
13
|
-
var
|
|
12
|
+
}, D = (e, t) => it(e, rt(t));
|
|
13
|
+
var he = (e, t) => {
|
|
14
14
|
var o = {};
|
|
15
15
|
for (var i in e)
|
|
16
|
-
|
|
16
|
+
ue.call(e, i) && t.indexOf(i) < 0 && (o[i] = e[i]);
|
|
17
17
|
if (e != null && G)
|
|
18
18
|
for (var i of G(e))
|
|
19
|
-
t.indexOf(i) < 0 &&
|
|
19
|
+
t.indexOf(i) < 0 && pe.call(e, i) && (o[i] = e[i]);
|
|
20
20
|
return o;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
22
|
+
var fe = (e, t, o) => j(e, typeof t != "symbol" ? t + "" : t, o);
|
|
23
|
+
var N = (e, t, o) => new Promise((i, r) => {
|
|
24
|
+
var a = (l) => {
|
|
25
25
|
try {
|
|
26
|
-
|
|
26
|
+
s(o.next(l));
|
|
27
27
|
} catch (u) {
|
|
28
28
|
r(u);
|
|
29
29
|
}
|
|
30
30
|
}, c = (l) => {
|
|
31
31
|
try {
|
|
32
|
-
|
|
32
|
+
s(o.throw(l));
|
|
33
33
|
} catch (u) {
|
|
34
34
|
r(u);
|
|
35
35
|
}
|
|
36
|
-
},
|
|
37
|
-
|
|
36
|
+
}, s = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(a, c);
|
|
37
|
+
s((o = o.apply(e, t)).next());
|
|
38
38
|
});
|
|
39
|
-
import { jsxs as m, Fragment as
|
|
40
|
-
import { useState as T, createContext as
|
|
41
|
-
import { Typography as
|
|
42
|
-
import
|
|
43
|
-
import { styled as z, createTheme as
|
|
39
|
+
import { jsxs as m, Fragment as L, jsx as n } from "react/jsx-runtime";
|
|
40
|
+
import { useState as T, createContext as _e, useCallback as K, useContext as Me, createElement as oe, useEffect as ne, useMemo as at, useRef as ee } from "react";
|
|
41
|
+
import { Typography as _, Button as W, Paper as Te, Box as F, Drawer as Be, useTheme as J, useMediaQuery as st, Collapse as lt, Avatar as me, Fade as ct, Skeleton as ge, Toolbar as dt, Divider as xe, Container as ut, IconButton as pt, CssBaseline as ht, Dialog as Le, LinearProgress as Pe, DialogTitle as Re, DialogContent as Oe, DialogActions as He, Autocomplete as ie, TextField as re, CircularProgress as ae, Chip as ft, Tooltip as mt, Stack as gt, Snackbar as xt, Alert as vt, FormHelperText as Ct } from "@mui/material";
|
|
42
|
+
import At from "@mui/material/CssBaseline";
|
|
43
|
+
import { styled as z, createTheme as Ue, alpha as te } from "@mui/material/styles";
|
|
44
44
|
import { createHelper as se } from "souvlaki";
|
|
45
|
-
import { BrowserRouter as
|
|
46
|
-
import
|
|
47
|
-
import { ViewHeadline as
|
|
48
|
-
import { atom as M, useSetAtom as
|
|
49
|
-
import { useHydrateAtoms as
|
|
45
|
+
import { BrowserRouter as wt } from "react-router-dom";
|
|
46
|
+
import We from "@mui/material/List";
|
|
47
|
+
import { ViewHeadline as St, Cancel as bt, ArrowDropDown as kt } from "@mui/icons-material";
|
|
48
|
+
import { atom as M, useSetAtom as ze, useAtomValue as ve, useAtom as O } from "jotai";
|
|
49
|
+
import { useHydrateAtoms as yt } from "jotai/utils";
|
|
50
50
|
import Ce from "react-avatar";
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import { Buffer as
|
|
56
|
-
import
|
|
51
|
+
import { useAuth0 as le } from "@auth0/auth0-react";
|
|
52
|
+
import { useQuery as Ve } from "@tanstack/react-query";
|
|
53
|
+
import Dt from "autosuggest-highlight/match";
|
|
54
|
+
import It from "autosuggest-highlight/parse";
|
|
55
|
+
import { Buffer as $t } from "buffer";
|
|
56
|
+
import Ft from "@mui/material/Skeleton";
|
|
57
57
|
function Uo({ text: e }) {
|
|
58
58
|
const [t, o] = T(0);
|
|
59
|
-
return /* @__PURE__ */ m(
|
|
60
|
-
/* @__PURE__ */ n(
|
|
61
|
-
/* @__PURE__ */ n(
|
|
59
|
+
return /* @__PURE__ */ m(L, { children: [
|
|
60
|
+
/* @__PURE__ */ n(_, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
|
|
61
|
+
/* @__PURE__ */ n(_, { variant: "caption", display: "block", children: /* @__PURE__ */ n("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
|
|
62
62
|
/* @__PURE__ */ n(
|
|
63
63
|
W,
|
|
64
64
|
{
|
|
@@ -72,42 +72,42 @@ function Uo({ text: e }) {
|
|
|
72
72
|
"This is some text: ",
|
|
73
73
|
/* @__PURE__ */ n("span", { children: e })
|
|
74
74
|
] }),
|
|
75
|
-
/* @__PURE__ */ m(
|
|
75
|
+
/* @__PURE__ */ m(Te, { children: [
|
|
76
76
|
"This number will incremember when button pressed: ",
|
|
77
77
|
t
|
|
78
78
|
] })
|
|
79
79
|
] });
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
root: `${
|
|
83
|
-
menuButton: `${
|
|
84
|
-
hide: `${
|
|
85
|
-
content: `${
|
|
86
|
-
userInfoHolder: `${
|
|
87
|
-
settings: `${
|
|
88
|
-
pieChartIcon: `${
|
|
89
|
-
}, Et = z(
|
|
81
|
+
const qe = 330, Ge = 73, B = "Navbar", H = {
|
|
82
|
+
root: `${B}-root`,
|
|
83
|
+
menuButton: `${B}-menuButton`,
|
|
84
|
+
hide: `${B}-hide`,
|
|
85
|
+
content: `${B}-content`,
|
|
86
|
+
userInfoHolder: `${B}-userInfoHolder`,
|
|
87
|
+
settings: `${B}-settings`,
|
|
88
|
+
pieChartIcon: `${B}-pieChartIcon`
|
|
89
|
+
}, Et = z(F, {
|
|
90
90
|
name: "NavBar"
|
|
91
91
|
})(({ theme: e }) => ({
|
|
92
|
-
[`&.${
|
|
92
|
+
[`&.${H.root}`]: {
|
|
93
93
|
display: "flex"
|
|
94
94
|
},
|
|
95
|
-
[`& .${
|
|
95
|
+
[`& .${H.menuButton}`]: {
|
|
96
96
|
marginRight: 36
|
|
97
97
|
},
|
|
98
|
-
[`& .${
|
|
98
|
+
[`& .${H.hide}`]: {
|
|
99
99
|
display: "none"
|
|
100
100
|
},
|
|
101
|
-
[`& .${
|
|
101
|
+
[`& .${H.content}`]: {
|
|
102
102
|
flexGrow: 1,
|
|
103
103
|
padding: e.spacing(3)
|
|
104
104
|
},
|
|
105
|
-
[`& .${
|
|
105
|
+
[`& .${H.userInfoHolder}`]: {
|
|
106
106
|
height: "148px",
|
|
107
107
|
marginTop: "64px",
|
|
108
108
|
marginBottom: "16px"
|
|
109
109
|
}
|
|
110
|
-
})),
|
|
110
|
+
})), Xe = () => ({
|
|
111
111
|
position: "absolute",
|
|
112
112
|
height: "100%",
|
|
113
113
|
overflowX: "hidden",
|
|
@@ -115,51 +115,51 @@ const Ve = 330, qe = 73, L = "Navbar", O = {
|
|
|
115
115
|
color: "white",
|
|
116
116
|
backgroundColor: "black"
|
|
117
117
|
// backgroundColor: '#e8e8e8',
|
|
118
|
-
}),
|
|
119
|
-
width: Ve
|
|
120
|
-
}, Ge()), Nt = () => d({
|
|
118
|
+
}), Nt = () => d({
|
|
121
119
|
width: qe
|
|
122
|
-
},
|
|
120
|
+
}, Xe()), _t = () => d({
|
|
121
|
+
width: Ge
|
|
122
|
+
}, Xe()), Mt = z(Be, {
|
|
123
123
|
shouldForwardProp: (e) => e !== "open"
|
|
124
124
|
})(({ theme: e, open: t }) => d(d({
|
|
125
|
-
width: t ?
|
|
125
|
+
width: t ? qe : Ge,
|
|
126
126
|
flexShrink: 0,
|
|
127
127
|
whiteSpace: "nowrap",
|
|
128
128
|
boxSizing: "border-box",
|
|
129
129
|
zIndex: e.zIndex.drawer + 100
|
|
130
130
|
}, t && {
|
|
131
|
-
"& .MuiDrawer-paper": Ft()
|
|
132
|
-
}), !t && {
|
|
133
131
|
"& .MuiDrawer-paper": Nt()
|
|
132
|
+
}), !t && {
|
|
133
|
+
"& .MuiDrawer-paper": _t()
|
|
134
134
|
}));
|
|
135
|
-
class
|
|
135
|
+
class ce extends Error {
|
|
136
136
|
}
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
overrideState: e =
|
|
140
|
-
overrideActions: t =
|
|
137
|
+
fe(ce, "errorName", "ContextError");
|
|
138
|
+
const Ye = _e(null), Tt = {}, Bt = {}, Lt = ({
|
|
139
|
+
overrideState: e = Tt,
|
|
140
|
+
overrideActions: t = Bt,
|
|
141
141
|
children: o
|
|
142
142
|
}) => {
|
|
143
|
-
const [{ open: i }, r] = T({ open: !0 }),
|
|
143
|
+
const [{ open: i }, r] = T({ open: !0 }), a = K((l) => {
|
|
144
144
|
r({ open: l });
|
|
145
145
|
}, []), c = K(() => {
|
|
146
146
|
r((l) => D(d({}, l), { open: !l.open }));
|
|
147
|
-
}, []),
|
|
147
|
+
}, []), s = d(d({
|
|
148
148
|
open: i,
|
|
149
|
-
setOpen:
|
|
149
|
+
setOpen: a,
|
|
150
150
|
toggleOpen: c
|
|
151
151
|
}, e), t);
|
|
152
|
-
return /* @__PURE__ */ n(
|
|
153
|
-
},
|
|
154
|
-
const e =
|
|
152
|
+
return /* @__PURE__ */ n(Ye.Provider, { value: s, children: o });
|
|
153
|
+
}, Pt = () => {
|
|
154
|
+
const e = Me(Ye);
|
|
155
155
|
if (e === null)
|
|
156
|
-
throw new
|
|
156
|
+
throw new ce("Error: Tried to useNavBar outside of a <NavBarProvider>");
|
|
157
157
|
return e;
|
|
158
|
-
},
|
|
158
|
+
}, Rt = (e = {}) => d({
|
|
159
159
|
open: !0
|
|
160
160
|
}, e), Wo = se(
|
|
161
|
-
(e =
|
|
162
|
-
), zo = se(() => ({ children: e }) => /* @__PURE__ */ n(
|
|
161
|
+
(e = Rt(), t = {}) => ({ children: o }) => /* @__PURE__ */ n(Lt, { overrideState: e, overrideActions: t, children: o })
|
|
162
|
+
), zo = se(() => ({ children: e }) => /* @__PURE__ */ n(wt, { children: e })), Ae = 7, Vo = z(We)(({ theme: e }) => ({
|
|
163
163
|
backgroundColor: "black",
|
|
164
164
|
color: "white",
|
|
165
165
|
"& .MuiListItem-root": {
|
|
@@ -168,7 +168,7 @@ const Xe = Ne(null), Mt = {}, Tt = {}, Lt = ({
|
|
|
168
168
|
"& .MuiListItemButton-root": {
|
|
169
169
|
" .MuiListItemIcon-root": {
|
|
170
170
|
color: "white",
|
|
171
|
-
padding: `${
|
|
171
|
+
padding: `${Ae}px`
|
|
172
172
|
},
|
|
173
173
|
// Focus state
|
|
174
174
|
"&.Mui-focusVisible": {
|
|
@@ -179,7 +179,7 @@ const Xe = Ne(null), Mt = {}, Tt = {}, Lt = ({
|
|
|
179
179
|
borderLeftStyle: "solid",
|
|
180
180
|
borderLeftWidth: "7px",
|
|
181
181
|
borderLeftColor: e.palette.primary.main,
|
|
182
|
-
paddingLeft: `calc(${e.spacing(2)} - ${
|
|
182
|
+
paddingLeft: `calc(${e.spacing(2)} - ${Ae}px)`
|
|
183
183
|
},
|
|
184
184
|
// Hover state
|
|
185
185
|
"&:hover": {
|
|
@@ -197,7 +197,7 @@ const Xe = Ne(null), Mt = {}, Tt = {}, Lt = ({
|
|
|
197
197
|
// '&.Mui-selected.Mui-focusVisible:hover': {
|
|
198
198
|
// },
|
|
199
199
|
}
|
|
200
|
-
})),
|
|
200
|
+
})), we = 7, qo = z(We)(({ theme: e }) => ({
|
|
201
201
|
backgroundColor: "#e8e8e8",
|
|
202
202
|
color: "inherit",
|
|
203
203
|
"& .MuiListItem-root": {
|
|
@@ -206,7 +206,7 @@ const Xe = Ne(null), Mt = {}, Tt = {}, Lt = ({
|
|
|
206
206
|
"& .MuiListItemButton-root": {
|
|
207
207
|
" .MuiListItemIcon-root": {
|
|
208
208
|
color: "inherit",
|
|
209
|
-
padding: `${
|
|
209
|
+
padding: `${we}px`
|
|
210
210
|
},
|
|
211
211
|
// Focus state
|
|
212
212
|
"&.Mui-focusVisible": {
|
|
@@ -217,7 +217,7 @@ const Xe = Ne(null), Mt = {}, Tt = {}, Lt = ({
|
|
|
217
217
|
borderLeftStyle: "solid",
|
|
218
218
|
borderLeftWidth: "7px",
|
|
219
219
|
borderLeftColor: e.palette.primary.main,
|
|
220
|
-
paddingLeft: `calc(${e.spacing(2)} - ${
|
|
220
|
+
paddingLeft: `calc(${e.spacing(2)} - ${we}px)`
|
|
221
221
|
},
|
|
222
222
|
// Hover state
|
|
223
223
|
"&:hover": {
|
|
@@ -240,11 +240,11 @@ function Go({
|
|
|
240
240
|
"data-testid": e,
|
|
241
241
|
children: t
|
|
242
242
|
}) {
|
|
243
|
-
const { open: o } =
|
|
244
|
-
return /* @__PURE__ */ m(Et, { className:
|
|
245
|
-
/* @__PURE__ */ n(
|
|
243
|
+
const { open: o } = Pt();
|
|
244
|
+
return /* @__PURE__ */ m(Et, { className: H.root, "data-testid": e, children: [
|
|
245
|
+
/* @__PURE__ */ n(At, {}),
|
|
246
246
|
/* @__PURE__ */ n(
|
|
247
|
-
|
|
247
|
+
Mt,
|
|
248
248
|
{
|
|
249
249
|
variant: "permanent",
|
|
250
250
|
anchor: "left",
|
|
@@ -255,11 +255,11 @@ function Go({
|
|
|
255
255
|
)
|
|
256
256
|
] });
|
|
257
257
|
}
|
|
258
|
-
const
|
|
258
|
+
const Ke = () => {
|
|
259
259
|
const e = J();
|
|
260
|
-
return
|
|
261
|
-
},
|
|
262
|
-
function
|
|
260
|
+
return st(e.breakpoints.down("sm"));
|
|
261
|
+
}, Ot = 64, Ht = 72, Ut = 256, Q = M(!0), Wt = M(Ut), zt = M(Ht), Se = M(""), Vt = M(void 0), qt = M(Ot), Gt = M(void 0);
|
|
262
|
+
function Xt({ links: e }) {
|
|
263
263
|
return /* @__PURE__ */ n("div", { children: "LinksMenu not implemented yet" });
|
|
264
264
|
}
|
|
265
265
|
const X = "Navbar", q = {
|
|
@@ -270,7 +270,7 @@ const X = "Navbar", q = {
|
|
|
270
270
|
// userInfoHolder: `${PREFIX}-userInfoHolder`,
|
|
271
271
|
// settings: `${PREFIX}-settings`,
|
|
272
272
|
// pieChartIcon: `${PREFIX}-pieChartIcon`,
|
|
273
|
-
},
|
|
273
|
+
}, Yt = z(F, { name: "NavBar" })(({ theme: e }) => ({
|
|
274
274
|
[`&.${q.root}`]: {
|
|
275
275
|
display: "flex"
|
|
276
276
|
},
|
|
@@ -292,10 +292,10 @@ const X = "Navbar", q = {
|
|
|
292
292
|
})), U = (e, t, o) => e.transitions.create(t, {
|
|
293
293
|
easing: e.transitions.easing.sharp,
|
|
294
294
|
duration: o === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
|
|
295
|
-
}),
|
|
295
|
+
}), Kt = (e) => {
|
|
296
296
|
const t = J();
|
|
297
297
|
return /* @__PURE__ */ n(
|
|
298
|
-
|
|
298
|
+
lt,
|
|
299
299
|
d({
|
|
300
300
|
easing: t.transitions.easing.sharp,
|
|
301
301
|
timeout: {
|
|
@@ -304,7 +304,7 @@ const X = "Navbar", q = {
|
|
|
304
304
|
}
|
|
305
305
|
}, e)
|
|
306
306
|
);
|
|
307
|
-
},
|
|
307
|
+
}, Qe = (e) => {
|
|
308
308
|
var t, o;
|
|
309
309
|
return {
|
|
310
310
|
overflowX: "hidden",
|
|
@@ -312,13 +312,13 @@ const X = "Navbar", q = {
|
|
|
312
312
|
backgroundColor: (o = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? o : "white"
|
|
313
313
|
// Provide default so tests don't need to wrap theme provider
|
|
314
314
|
};
|
|
315
|
-
},
|
|
315
|
+
}, be = (e, t) => d({
|
|
316
316
|
width: t,
|
|
317
317
|
transition: U(e, "width", "entering")
|
|
318
|
-
},
|
|
318
|
+
}, Qe(e)), ke = (e, t) => d({
|
|
319
319
|
width: t,
|
|
320
320
|
transition: U(e, "width", "leaving")
|
|
321
|
-
},
|
|
321
|
+
}, Qe(e)), Qt = z(Be, {
|
|
322
322
|
shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
|
|
323
323
|
})(({ theme: e, open: t, widthOpen: o, widthClosed: i, isSmallScreen: r }) => d(d({
|
|
324
324
|
flexShrink: 0,
|
|
@@ -326,20 +326,58 @@ const X = "Navbar", q = {
|
|
|
326
326
|
boxSizing: "border-box",
|
|
327
327
|
display: "flex",
|
|
328
328
|
flexDirection: "column"
|
|
329
|
-
}, t && D(d({},
|
|
329
|
+
}, t && D(d({}, be(e, o)), {
|
|
330
330
|
backgroundColor: "",
|
|
331
|
-
"& .MuiDrawer-paper":
|
|
331
|
+
"& .MuiDrawer-paper": be(e, o)
|
|
332
332
|
})), !t && D(d({}, ke(e, r ? o : i)), {
|
|
333
333
|
backgroundColor: "",
|
|
334
334
|
"& .MuiDrawer-paper": ke(e, r ? o : i)
|
|
335
|
-
})))
|
|
335
|
+
})));
|
|
336
|
+
function Je(e) {
|
|
337
|
+
return e.replace(
|
|
338
|
+
/(^|-)([a-z])/g,
|
|
339
|
+
(t, o, i) => o === "-" ? " " + i.toUpperCase() : i.toUpperCase()
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
function Xo(e, t, o, i) {
|
|
343
|
+
var c;
|
|
344
|
+
if (!e) return "None";
|
|
345
|
+
const a = Object.entries(e).filter(
|
|
346
|
+
([s, l]) => s.startsWith("https://greens.org.au/roles/") && l.includes(t)
|
|
347
|
+
).map(
|
|
348
|
+
([s]) => {
|
|
349
|
+
var l;
|
|
350
|
+
return Je((l = s.split("/").at(-1)) != null ? l : "");
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
return (c = i.find(
|
|
354
|
+
(s) => o[s].some((l) => a.includes(l))
|
|
355
|
+
)) != null ? c : "None";
|
|
356
|
+
}
|
|
357
|
+
const Yo = (e) => {
|
|
358
|
+
const { getIdTokenClaims: t, user: o } = le();
|
|
359
|
+
return Ve({
|
|
360
|
+
queryKey: ["availableDomains", o == null ? void 0 : o.sub],
|
|
361
|
+
queryFn: () => N(void 0, null, function* () {
|
|
362
|
+
const i = yield t();
|
|
363
|
+
return i ? Object.entries(i).reduce((r, [a, c]) => {
|
|
364
|
+
var u;
|
|
365
|
+
const s = Je((u = a.split("/").at(-1)) != null ? u : ""), l = a.startsWith("https://greens.org.au/roles/") && e.includes(s) ? c : [];
|
|
366
|
+
return [.../* @__PURE__ */ new Set([...r, ...l])];
|
|
367
|
+
}, []) : [];
|
|
368
|
+
})
|
|
369
|
+
});
|
|
370
|
+
}, Ko = (e) => Object.values(e).reduce(
|
|
371
|
+
(t, o) => [.../* @__PURE__ */ new Set([...t, ...o])],
|
|
372
|
+
[]
|
|
373
|
+
), Y = {
|
|
336
374
|
log: console.warn.bind(console),
|
|
337
375
|
error: console.error.bind(console),
|
|
338
376
|
warn: console.warn.bind(console),
|
|
339
377
|
info: console.info.bind(console),
|
|
340
378
|
debug: console.debug.bind(console)
|
|
341
379
|
};
|
|
342
|
-
function
|
|
380
|
+
function Qo(e, t) {
|
|
343
381
|
console[e] = (...o) => {
|
|
344
382
|
for (const i of t)
|
|
345
383
|
if (typeof i == "function") {
|
|
@@ -352,34 +390,13 @@ function Xo(e, t) {
|
|
|
352
390
|
Y[e](o);
|
|
353
391
|
};
|
|
354
392
|
}
|
|
355
|
-
function
|
|
393
|
+
function Jo(e) {
|
|
356
394
|
if (e)
|
|
357
395
|
console[e] = Y[e];
|
|
358
396
|
else
|
|
359
397
|
for (const t of Object.keys(Y))
|
|
360
398
|
console[t] = Y[t];
|
|
361
399
|
}
|
|
362
|
-
function Qt(e) {
|
|
363
|
-
return e.replace(
|
|
364
|
-
/(^|-)([a-z])/g,
|
|
365
|
-
(t, o, i) => o === "-" ? " " + i.toUpperCase() : i.toUpperCase()
|
|
366
|
-
);
|
|
367
|
-
}
|
|
368
|
-
function Ko(e, t, o, i) {
|
|
369
|
-
var c;
|
|
370
|
-
if (!e) return "None";
|
|
371
|
-
const s = Object.entries(e).filter(
|
|
372
|
-
([a, l]) => a.startsWith("https://greens.org.au/roles/") && l.includes(t)
|
|
373
|
-
).map(
|
|
374
|
-
([a]) => {
|
|
375
|
-
var l;
|
|
376
|
-
return Qt((l = a.split("/").at(-1)) != null ? l : "");
|
|
377
|
-
}
|
|
378
|
-
);
|
|
379
|
-
return (c = i.find(
|
|
380
|
-
(a) => o[a].some((l) => s.includes(l))
|
|
381
|
-
)) != null ? c : "None";
|
|
382
|
-
}
|
|
383
400
|
function Jt(e) {
|
|
384
401
|
let t = 0;
|
|
385
402
|
for (let o = 0, i = e.length; o < i; o++) {
|
|
@@ -388,11 +405,11 @@ function Jt(e) {
|
|
|
388
405
|
}
|
|
389
406
|
return t;
|
|
390
407
|
}
|
|
391
|
-
const
|
|
408
|
+
const ye = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], De = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
|
|
392
409
|
function Zt({ user: e, domainCode: t, open: o, useNewAvatar: i = !1 }) {
|
|
393
410
|
const r = J();
|
|
394
411
|
return /* @__PURE__ */ m(
|
|
395
|
-
|
|
412
|
+
F,
|
|
396
413
|
{
|
|
397
414
|
sx: {
|
|
398
415
|
paddingTop: 3,
|
|
@@ -403,46 +420,46 @@ function Zt({ user: e, domainCode: t, open: o, useNewAvatar: i = !1 }) {
|
|
|
403
420
|
},
|
|
404
421
|
children: [
|
|
405
422
|
!i && /* @__PURE__ */ n(
|
|
406
|
-
|
|
423
|
+
F,
|
|
407
424
|
{
|
|
408
425
|
sx: {
|
|
409
426
|
width: o ? "5rem" : "2rem",
|
|
410
427
|
transition: o ? U(r, ["width", "height"], "entering") : U(r, ["width", "height"], "leaving"),
|
|
411
428
|
aspectRatio: 1
|
|
412
429
|
},
|
|
413
|
-
children: e != null && e.name ? /* @__PURE__ */ n(
|
|
414
|
-
|
|
430
|
+
children: e != null && e.name ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(
|
|
431
|
+
me,
|
|
415
432
|
{
|
|
416
433
|
src: e == null ? void 0 : e.picture,
|
|
417
434
|
sx: {
|
|
418
435
|
width: "100%",
|
|
419
436
|
height: "100%",
|
|
420
|
-
bgcolor:
|
|
437
|
+
bgcolor: ye[Math.abs(Jt(e == null ? void 0 : e.name)) % ye.length]
|
|
421
438
|
},
|
|
422
|
-
children:
|
|
439
|
+
children: De(e == null ? void 0 : e.name)
|
|
423
440
|
}
|
|
424
|
-
) }) : /* @__PURE__ */ n(
|
|
441
|
+
) }) : /* @__PURE__ */ n(me, { sx: { width: "100%", height: "100%" } })
|
|
425
442
|
}
|
|
426
443
|
),
|
|
427
444
|
i && /* @__PURE__ */ n(
|
|
428
|
-
|
|
445
|
+
F,
|
|
429
446
|
{
|
|
430
447
|
sx: {
|
|
431
448
|
width: o ? "5rem" : "2rem",
|
|
432
449
|
transition: o ? U(r, ["width", "height"], "entering") : U(r, ["width", "height"], "leaving"),
|
|
433
450
|
aspectRatio: 1
|
|
434
451
|
},
|
|
435
|
-
children: e != null && e.name ? /* @__PURE__ */ n(
|
|
452
|
+
children: e != null && e.name ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ m(Ce, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: o ? "80" : "32", children: [
|
|
436
453
|
" ",
|
|
437
|
-
|
|
454
|
+
De(e == null ? void 0 : e.name),
|
|
438
455
|
" ",
|
|
439
456
|
"ab"
|
|
440
457
|
] }) }) : /* @__PURE__ */ n(Ce, {})
|
|
441
458
|
}
|
|
442
459
|
),
|
|
443
|
-
/* @__PURE__ */ n(
|
|
444
|
-
e != null && e.name ? /* @__PURE__ */ n(
|
|
445
|
-
t ? /* @__PURE__ */ n(
|
|
460
|
+
/* @__PURE__ */ n(Kt, { sx: { width: "100%" }, in: o, children: /* @__PURE__ */ n(ct, { in: o, children: /* @__PURE__ */ m(F, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
|
|
461
|
+
e != null && e.name ? /* @__PURE__ */ n(_, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ n(ge, { animation: !1, width: "50%" }),
|
|
462
|
+
t ? /* @__PURE__ */ n(_, { children: t.toUpperCase() }) : /* @__PURE__ */ n(ge, { animation: !1, width: "25%" })
|
|
446
463
|
] }) }) })
|
|
447
464
|
]
|
|
448
465
|
}
|
|
@@ -454,15 +471,15 @@ function jt({
|
|
|
454
471
|
widthOpen: o,
|
|
455
472
|
"data-testid": i,
|
|
456
473
|
top: r,
|
|
457
|
-
middle:
|
|
474
|
+
middle: a,
|
|
458
475
|
bottom: c,
|
|
459
|
-
user:
|
|
476
|
+
user: s,
|
|
460
477
|
domainCode: l,
|
|
461
478
|
useNewAvatar: u = !1
|
|
462
479
|
}) {
|
|
463
|
-
const g =
|
|
464
|
-
return /* @__PURE__ */ n(
|
|
465
|
-
|
|
480
|
+
const g = Ke(), S = ze(Q);
|
|
481
|
+
return /* @__PURE__ */ n(Yt, { className: q.root, "data-testid": i, children: /* @__PURE__ */ m(
|
|
482
|
+
Qt,
|
|
466
483
|
{
|
|
467
484
|
open: e,
|
|
468
485
|
widthOpen: o,
|
|
@@ -477,16 +494,16 @@ function jt({
|
|
|
477
494
|
},
|
|
478
495
|
isSmallScreen: g,
|
|
479
496
|
children: [
|
|
480
|
-
!g && /* @__PURE__ */ n(
|
|
481
|
-
r && /* @__PURE__ */ m(
|
|
497
|
+
!g && /* @__PURE__ */ n(dt, {}),
|
|
498
|
+
r && /* @__PURE__ */ m(F, { flexGrow: "0", children: [
|
|
482
499
|
r,
|
|
483
|
-
/* @__PURE__ */ n(
|
|
500
|
+
/* @__PURE__ */ n(xe, { variant: "middle", sx: { marginY: "0.5rem" } })
|
|
484
501
|
] }),
|
|
485
|
-
/* @__PURE__ */ n(
|
|
486
|
-
/* @__PURE__ */ m(
|
|
487
|
-
/* @__PURE__ */ n(
|
|
488
|
-
/* @__PURE__ */ n(Zt, { user:
|
|
489
|
-
c && /* @__PURE__ */ n(
|
|
502
|
+
/* @__PURE__ */ n(F, { flexGrow: "1", children: Array.isArray(a) ? /* @__PURE__ */ n(Xt, { links: a }) : a }),
|
|
503
|
+
/* @__PURE__ */ m(F, { flexGrow: "0", children: [
|
|
504
|
+
/* @__PURE__ */ n(xe, { variant: "middle", sx: { marginY: "0.5rem" } }),
|
|
505
|
+
/* @__PURE__ */ n(Zt, { user: s, domainCode: l, open: e, useNewAvatar: u }),
|
|
506
|
+
c && /* @__PURE__ */ n(L, { children: c })
|
|
490
507
|
] })
|
|
491
508
|
]
|
|
492
509
|
}
|
|
@@ -499,15 +516,15 @@ function eo({
|
|
|
499
516
|
noPadding: i
|
|
500
517
|
}) {
|
|
501
518
|
return /* @__PURE__ */ n(
|
|
502
|
-
|
|
519
|
+
F,
|
|
503
520
|
{
|
|
504
521
|
sx: {
|
|
505
522
|
overflow: "auto",
|
|
506
523
|
height: `calc(100vh - ${t}px)`,
|
|
507
524
|
flexGrow: 1
|
|
508
525
|
},
|
|
509
|
-
children: i ? /* @__PURE__ */ n(
|
|
510
|
-
|
|
526
|
+
children: i ? /* @__PURE__ */ n(F, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ n(
|
|
527
|
+
ut,
|
|
511
528
|
{
|
|
512
529
|
component: "main",
|
|
513
530
|
id: "main-content",
|
|
@@ -528,9 +545,9 @@ function no({
|
|
|
528
545
|
"data-testid": o,
|
|
529
546
|
middle: i
|
|
530
547
|
}) {
|
|
531
|
-
const r =
|
|
548
|
+
const r = ze(Q), a = () => r((l) => !l), c = J(), s = Ke();
|
|
532
549
|
return /* @__PURE__ */ n("header", { "data-testid": o, children: /* @__PURE__ */ m(
|
|
533
|
-
|
|
550
|
+
Te,
|
|
534
551
|
{
|
|
535
552
|
square: !0,
|
|
536
553
|
elevation: 0,
|
|
@@ -544,67 +561,67 @@ function no({
|
|
|
544
561
|
gap: 2,
|
|
545
562
|
flexShrink: 0,
|
|
546
563
|
height: t,
|
|
547
|
-
zIndex:
|
|
564
|
+
zIndex: s ? 0 : c.zIndex.drawer + 101
|
|
548
565
|
},
|
|
549
566
|
children: [
|
|
550
567
|
/* @__PURE__ */ n(
|
|
551
|
-
|
|
568
|
+
pt,
|
|
552
569
|
{
|
|
553
570
|
size: "medium",
|
|
554
571
|
color: "inherit",
|
|
555
572
|
sx: { padding: 1.5, marginLeft: "12px" },
|
|
556
|
-
onClick:
|
|
557
|
-
children: /* @__PURE__ */ n(
|
|
573
|
+
onClick: a,
|
|
574
|
+
children: /* @__PURE__ */ n(St, { fontSize: "medium" })
|
|
558
575
|
}
|
|
559
576
|
),
|
|
560
|
-
/* @__PURE__ */ n(
|
|
577
|
+
/* @__PURE__ */ n(_, { className: oo.titleText, variant: "h6", component: "h1", children: e }),
|
|
561
578
|
i
|
|
562
579
|
]
|
|
563
580
|
}
|
|
564
581
|
) });
|
|
565
582
|
}
|
|
566
|
-
function
|
|
583
|
+
function Zo({
|
|
567
584
|
children: e,
|
|
568
585
|
initialTitleText: t,
|
|
569
586
|
initialNavBarOpen: o,
|
|
570
587
|
pageContainerProps: i,
|
|
571
588
|
pageContentDataTestId: r,
|
|
572
|
-
topBarDataTestId:
|
|
589
|
+
topBarDataTestId: a,
|
|
573
590
|
navBarDataTestId: c,
|
|
574
|
-
navBarMiddle:
|
|
591
|
+
navBarMiddle: s,
|
|
575
592
|
navBarBottom: l,
|
|
576
593
|
user: u,
|
|
577
594
|
domainCode: g,
|
|
578
595
|
useNewAvatar: S = !1
|
|
579
596
|
}) {
|
|
580
|
-
|
|
597
|
+
yt([
|
|
581
598
|
[Q, o != null ? o : !0],
|
|
582
|
-
[
|
|
599
|
+
[Se, t != null ? t : ""]
|
|
583
600
|
]);
|
|
584
|
-
const A =
|
|
585
|
-
return /* @__PURE__ */ m(
|
|
586
|
-
/* @__PURE__ */ n(
|
|
601
|
+
const A = ve(Q), [f] = O(Wt), [b] = O(zt), y = ve(Se), [p] = O(qt), [k] = O(Vt), [I] = O(Gt);
|
|
602
|
+
return /* @__PURE__ */ m(F, { children: [
|
|
603
|
+
/* @__PURE__ */ n(ht, {}),
|
|
587
604
|
/* @__PURE__ */ n(
|
|
588
605
|
no,
|
|
589
606
|
{
|
|
590
607
|
titleText: y,
|
|
591
|
-
"data-testid":
|
|
608
|
+
"data-testid": a,
|
|
592
609
|
height: p,
|
|
593
|
-
middle:
|
|
610
|
+
middle: k
|
|
594
611
|
}
|
|
595
612
|
),
|
|
596
|
-
/* @__PURE__ */ m(
|
|
613
|
+
/* @__PURE__ */ m(F, { sx: { display: "flex" }, children: [
|
|
597
614
|
/* @__PURE__ */ n(
|
|
598
615
|
jt,
|
|
599
616
|
{
|
|
600
617
|
open: A,
|
|
601
618
|
top: I,
|
|
602
|
-
middle:
|
|
619
|
+
middle: s,
|
|
603
620
|
bottom: l,
|
|
604
621
|
user: u,
|
|
605
622
|
domainCode: g,
|
|
606
623
|
widthOpen: f,
|
|
607
|
-
widthClosed:
|
|
624
|
+
widthClosed: b,
|
|
608
625
|
offsetTop: p,
|
|
609
626
|
"data-testid": c,
|
|
610
627
|
useNewAvatar: S
|
|
@@ -622,49 +639,49 @@ function Qo({
|
|
|
622
639
|
] })
|
|
623
640
|
] });
|
|
624
641
|
}
|
|
625
|
-
const
|
|
642
|
+
const Ze = ({
|
|
626
643
|
isOpen: e,
|
|
627
644
|
dialogTitle: t,
|
|
628
645
|
children: o,
|
|
629
646
|
maxWidth: i,
|
|
630
647
|
primaryButton: r,
|
|
631
|
-
secondaryButton:
|
|
648
|
+
secondaryButton: a,
|
|
632
649
|
additionalButtons: c,
|
|
633
|
-
onClose:
|
|
650
|
+
onClose: s,
|
|
634
651
|
sx: l,
|
|
635
652
|
"data-testid": u,
|
|
636
653
|
disableCloseOnBackdropOrEscape: g = !1,
|
|
637
654
|
isLoading: S = !1
|
|
638
655
|
}) => {
|
|
639
|
-
var
|
|
656
|
+
var b, y;
|
|
640
657
|
const [A, f] = T(!1);
|
|
641
658
|
return /* @__PURE__ */ m(
|
|
642
659
|
Le,
|
|
643
660
|
{
|
|
644
661
|
open: e,
|
|
645
|
-
onClose: (p,
|
|
646
|
-
g && (
|
|
662
|
+
onClose: (p, k) => N(void 0, null, function* () {
|
|
663
|
+
g && (k === "backdropClick" || k === "escapeKeyDown") || A || (a != null && a.onClick ? yield a.onClick() : s());
|
|
647
664
|
}),
|
|
648
665
|
fullWidth: !0,
|
|
649
666
|
maxWidth: i != null ? i : "xs",
|
|
650
667
|
"data-testid": u,
|
|
651
668
|
sx: l,
|
|
652
669
|
children: [
|
|
653
|
-
S && /* @__PURE__ */ n(
|
|
654
|
-
/* @__PURE__ */ n(
|
|
655
|
-
/* @__PURE__ */ n(
|
|
670
|
+
S && /* @__PURE__ */ n(Pe, { sx: { height: "4px", marginBottom: "-4px" } }),
|
|
671
|
+
/* @__PURE__ */ n(Re, { children: t }),
|
|
672
|
+
/* @__PURE__ */ n(Oe, { sx: { "& > :last-child": { marginBottom: 0 } }, children: o }),
|
|
656
673
|
/* @__PURE__ */ m(He, { children: [
|
|
657
674
|
/* @__PURE__ */ n(
|
|
658
675
|
W,
|
|
659
676
|
{
|
|
660
|
-
onClick: (
|
|
661
|
-
"data-testid":
|
|
662
|
-
disabled: (
|
|
663
|
-
color:
|
|
664
|
-
children: (y =
|
|
677
|
+
onClick: (b = a == null ? void 0 : a.onClick) != null ? b : s,
|
|
678
|
+
"data-testid": a == null ? void 0 : a.testId,
|
|
679
|
+
disabled: (a == null ? void 0 : a.disabled) || A,
|
|
680
|
+
color: a == null ? void 0 : a.buttonColor,
|
|
681
|
+
children: (y = a == null ? void 0 : a.text) != null ? y : "Cancel"
|
|
665
682
|
}
|
|
666
683
|
),
|
|
667
|
-
c && c.map((p,
|
|
684
|
+
c && c.map((p, k) => {
|
|
668
685
|
var I;
|
|
669
686
|
return /* @__PURE__ */ n(
|
|
670
687
|
W,
|
|
@@ -673,15 +690,15 @@ const Qe = ({
|
|
|
673
690
|
"data-testid": p == null ? void 0 : p.testId,
|
|
674
691
|
disabled: (p == null ? void 0 : p.disabled) || A,
|
|
675
692
|
color: p == null ? void 0 : p.buttonColor,
|
|
676
|
-
children: (I = p.text) != null ? I : `Button ${
|
|
693
|
+
children: (I = p.text) != null ? I : `Button ${k}`
|
|
677
694
|
},
|
|
678
|
-
|
|
695
|
+
k
|
|
679
696
|
);
|
|
680
697
|
}),
|
|
681
698
|
r && /* @__PURE__ */ n(
|
|
682
699
|
W,
|
|
683
700
|
{
|
|
684
|
-
onClick: () =>
|
|
701
|
+
onClick: () => N(void 0, null, function* () {
|
|
685
702
|
var p;
|
|
686
703
|
f(!0), yield (p = r.onClick) == null ? void 0 : p.call(r), f(!1);
|
|
687
704
|
}),
|
|
@@ -695,68 +712,68 @@ const Qe = ({
|
|
|
695
712
|
]
|
|
696
713
|
}
|
|
697
714
|
);
|
|
698
|
-
},
|
|
715
|
+
}, je = ({
|
|
699
716
|
minLength: e,
|
|
700
717
|
preLoadedOptions: t,
|
|
701
718
|
lookup: o,
|
|
702
719
|
label: i,
|
|
703
720
|
inputValue: r
|
|
704
|
-
}) =>
|
|
721
|
+
}) => Ve({
|
|
705
722
|
queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
|
|
706
|
-
(
|
|
723
|
+
(a) => a.label.toLowerCase().includes(r.toLowerCase())
|
|
707
724
|
) : o(r),
|
|
708
725
|
queryKey: ["autocomplete", i, r]
|
|
709
726
|
});
|
|
710
|
-
function
|
|
711
|
-
lookup: e = () =>
|
|
727
|
+
function jo({
|
|
728
|
+
lookup: e = () => N(this, null, function* () {
|
|
712
729
|
}),
|
|
713
730
|
enableHighlighting: t = !0,
|
|
714
731
|
onChange: o,
|
|
715
732
|
minLength: i = 0,
|
|
716
733
|
label: r,
|
|
717
|
-
value:
|
|
734
|
+
value: a,
|
|
718
735
|
"data-testid": c,
|
|
719
|
-
sx:
|
|
736
|
+
sx: s,
|
|
720
737
|
boxSx: l,
|
|
721
738
|
textFieldColor: u,
|
|
722
739
|
textFieldVariant: g = "filled",
|
|
723
740
|
loadingText: S = "Loading...",
|
|
724
741
|
noOptionsText: A = "No options",
|
|
725
|
-
popupIcon: f = /* @__PURE__ */ n(
|
|
726
|
-
error:
|
|
742
|
+
popupIcon: f = /* @__PURE__ */ n(kt, {}),
|
|
743
|
+
error: b = !1,
|
|
727
744
|
helperText: y = "",
|
|
728
745
|
preLoadedOptions: p = void 0,
|
|
729
|
-
disablePortal:
|
|
746
|
+
disablePortal: k = !1,
|
|
730
747
|
disableIconFlip: I = !1
|
|
731
748
|
}) {
|
|
732
|
-
const [
|
|
733
|
-
const
|
|
734
|
-
o(
|
|
735
|
-
}, { data: x, isLoading: $ } =
|
|
736
|
-
inputValue:
|
|
749
|
+
const [E, V] = T(""), P = (h, v) => {
|
|
750
|
+
const C = a.filter((w) => w.id !== v);
|
|
751
|
+
o(C, "delete", h);
|
|
752
|
+
}, { data: x, isLoading: $ } = je({
|
|
753
|
+
inputValue: E,
|
|
737
754
|
label: r,
|
|
738
755
|
lookup: e,
|
|
739
756
|
minLength: i,
|
|
740
757
|
preLoadedOptions: p
|
|
741
|
-
}), R =
|
|
758
|
+
}), R = E.length >= i;
|
|
742
759
|
return /* @__PURE__ */ m("div", { "data-testid": c, children: [
|
|
743
760
|
/* @__PURE__ */ n(
|
|
744
761
|
ie,
|
|
745
762
|
{
|
|
746
|
-
sx: d(d({},
|
|
763
|
+
sx: d(d({}, s), I ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
747
764
|
"data-testid": c ? `${c}:Autocomplete` : void 0,
|
|
748
|
-
disablePortal:
|
|
765
|
+
disablePortal: k,
|
|
749
766
|
multiple: !0,
|
|
750
767
|
getOptionLabel: (h) => typeof h == "string" ? h : h.label,
|
|
751
768
|
loading: R ? $ : !1,
|
|
752
|
-
options: [...
|
|
769
|
+
options: [...a, ...x != null ? x : []],
|
|
753
770
|
filterSelectedOptions: !0,
|
|
754
771
|
includeInputInList: !0,
|
|
755
|
-
value:
|
|
756
|
-
onChange: (h,
|
|
757
|
-
o(
|
|
772
|
+
value: a,
|
|
773
|
+
onChange: (h, v, C) => {
|
|
774
|
+
o(v, C, h);
|
|
758
775
|
},
|
|
759
|
-
onInputChange: (h,
|
|
776
|
+
onInputChange: (h, v) => V(v),
|
|
760
777
|
noOptionsText: R ? A : "Start typing to search",
|
|
761
778
|
loadingText: S,
|
|
762
779
|
popupIcon: f,
|
|
@@ -766,60 +783,60 @@ function Jo({
|
|
|
766
783
|
label: r,
|
|
767
784
|
fullWidth: !0,
|
|
768
785
|
variant: g,
|
|
769
|
-
error:
|
|
786
|
+
error: b,
|
|
770
787
|
helperText: y,
|
|
771
788
|
InputProps: D(d({}, h.InputProps), {
|
|
772
|
-
endAdornment: /* @__PURE__ */ m(
|
|
789
|
+
endAdornment: /* @__PURE__ */ m(L, { children: [
|
|
773
790
|
$ ? /* @__PURE__ */ n(ae, { color: "inherit", size: 20 }) : null,
|
|
774
791
|
h.InputProps.endAdornment
|
|
775
792
|
] })
|
|
776
793
|
}),
|
|
777
794
|
"data-testid": c ? `${c}:Autocomplete:TextField` : void 0,
|
|
778
|
-
onKeyDown: (
|
|
779
|
-
(
|
|
795
|
+
onKeyDown: (v) => {
|
|
796
|
+
(v.key === "Backspace" || v.key === "Delete") && v.stopPropagation();
|
|
780
797
|
},
|
|
781
798
|
color: u
|
|
782
799
|
})
|
|
783
800
|
),
|
|
784
801
|
renderTags: () => null,
|
|
785
|
-
isOptionEqualToValue: (h,
|
|
786
|
-
renderOption: (h,
|
|
802
|
+
isOptionEqualToValue: (h, v) => h.id === v.id,
|
|
803
|
+
renderOption: (h, v, C) => {
|
|
787
804
|
if (t) {
|
|
788
|
-
const w =
|
|
805
|
+
const w = Dt(v.label, C.inputValue, {
|
|
789
806
|
insideWords: !0,
|
|
790
807
|
findAllOccurrences: !0
|
|
791
|
-
}), Z =
|
|
808
|
+
}), Z = It(v.label, w);
|
|
792
809
|
return /* @__PURE__ */ oe(
|
|
793
810
|
"li",
|
|
794
811
|
D(d({}, h), {
|
|
795
|
-
key:
|
|
796
|
-
"data-testid": c ? `${c}:Autocomplete:option(${
|
|
812
|
+
key: v.id,
|
|
813
|
+
"data-testid": c ? `${c}:Autocomplete:option(${v.id.toString()})` : void 0
|
|
797
814
|
}),
|
|
798
|
-
/* @__PURE__ */ n("div", { children: Z.map((
|
|
815
|
+
/* @__PURE__ */ n("div", { children: Z.map((de, ot) => /* @__PURE__ */ n(
|
|
799
816
|
"span",
|
|
800
817
|
{
|
|
801
818
|
style: {
|
|
802
|
-
fontWeight:
|
|
819
|
+
fontWeight: de.highlight ? 700 : 400
|
|
803
820
|
},
|
|
804
|
-
children:
|
|
821
|
+
children: de.text
|
|
805
822
|
},
|
|
806
|
-
|
|
823
|
+
ot
|
|
807
824
|
)) })
|
|
808
825
|
);
|
|
809
826
|
} else
|
|
810
827
|
return /* @__PURE__ */ oe(
|
|
811
828
|
"li",
|
|
812
829
|
D(d({}, h), {
|
|
813
|
-
key:
|
|
814
|
-
"data-testid": c ? `${c}:option(${
|
|
830
|
+
key: v.id,
|
|
831
|
+
"data-testid": c ? `${c}:option(${v.id.toString()})` : void 0
|
|
815
832
|
}),
|
|
816
|
-
|
|
833
|
+
v.label
|
|
817
834
|
);
|
|
818
835
|
}
|
|
819
836
|
}
|
|
820
837
|
),
|
|
821
|
-
|
|
822
|
-
|
|
838
|
+
a.length > 0 && /* @__PURE__ */ n(F, { sx: l, children: a.map((h) => /* @__PURE__ */ n(
|
|
839
|
+
ft,
|
|
823
840
|
{
|
|
824
841
|
sx: {
|
|
825
842
|
marginTop: 1,
|
|
@@ -827,7 +844,7 @@ function Jo({
|
|
|
827
844
|
height: "auto"
|
|
828
845
|
},
|
|
829
846
|
label: /* @__PURE__ */ n(
|
|
830
|
-
|
|
847
|
+
mt,
|
|
831
848
|
{
|
|
832
849
|
title: h.tooltipContent || "",
|
|
833
850
|
placement: "bottom-start",
|
|
@@ -841,13 +858,13 @@ function Jo({
|
|
|
841
858
|
}
|
|
842
859
|
]
|
|
843
860
|
},
|
|
844
|
-
children: /* @__PURE__ */ n(
|
|
861
|
+
children: /* @__PURE__ */ n(_, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
|
|
845
862
|
}
|
|
846
863
|
),
|
|
847
864
|
"data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
|
|
848
|
-
onDelete: (
|
|
865
|
+
onDelete: (v) => P(v, h.id),
|
|
849
866
|
deleteIcon: /* @__PURE__ */ n(
|
|
850
|
-
|
|
867
|
+
bt,
|
|
851
868
|
{
|
|
852
869
|
"data-testid": c ? `${c}:Chip(${h.id.toString()}):deleteIcon` : void 0
|
|
853
870
|
}
|
|
@@ -857,40 +874,40 @@ function Jo({
|
|
|
857
874
|
)) })
|
|
858
875
|
] });
|
|
859
876
|
}
|
|
860
|
-
const
|
|
861
|
-
lookup: e = () =>
|
|
877
|
+
const en = /MUI: The value provided to.*is invalid/i, tn = ({
|
|
878
|
+
lookup: e = () => N(void 0, null, function* () {
|
|
862
879
|
}),
|
|
863
880
|
onChange: t,
|
|
864
881
|
label: o,
|
|
865
882
|
value: i,
|
|
866
883
|
sx: r,
|
|
867
|
-
textFieldColor:
|
|
884
|
+
textFieldColor: a,
|
|
868
885
|
textFieldVariant: c = "filled",
|
|
869
|
-
error:
|
|
886
|
+
error: s = !1,
|
|
870
887
|
"data-testid": l,
|
|
871
888
|
noOptionsText: u = "No options",
|
|
872
889
|
minLength: g = 3,
|
|
873
890
|
disablePortal: S = !1,
|
|
874
891
|
preLoadedOptions: A,
|
|
875
892
|
helperText: f = "",
|
|
876
|
-
disabled:
|
|
893
|
+
disabled: b,
|
|
877
894
|
popupIcon: y,
|
|
878
895
|
disableIconFlip: p
|
|
879
896
|
}) => {
|
|
880
|
-
const [
|
|
881
|
-
inputValue:
|
|
897
|
+
const [k, I] = T(""), { data: E, isLoading: V } = je({
|
|
898
|
+
inputValue: k,
|
|
882
899
|
label: o,
|
|
883
900
|
lookup: e,
|
|
884
901
|
minLength: g != null ? g : 0,
|
|
885
902
|
preLoadedOptions: A
|
|
886
|
-
}), P =
|
|
887
|
-
return /* @__PURE__ */ n("div", { "data-testid": l, children: /* @__PURE__ */ n(
|
|
903
|
+
}), P = k.length >= g;
|
|
904
|
+
return /* @__PURE__ */ n("div", { "data-testid": l, children: /* @__PURE__ */ n(gt, { direction: "row", spacing: 1, children: /* @__PURE__ */ n(
|
|
888
905
|
ie,
|
|
889
906
|
{
|
|
890
907
|
sx: d(d({}, r), p ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
891
908
|
"data-testid": l ? `${l}:Autocomplete` : void 0,
|
|
892
909
|
loading: P ? V : !1,
|
|
893
|
-
options:
|
|
910
|
+
options: E != null ? E : [],
|
|
894
911
|
onChange: (x, $, R) => {
|
|
895
912
|
t(x, $, R);
|
|
896
913
|
},
|
|
@@ -907,8 +924,8 @@ const Zo = /MUI: The value provided to.*is invalid/i, jo = ({
|
|
|
907
924
|
}, x), {
|
|
908
925
|
variant: c,
|
|
909
926
|
label: o,
|
|
910
|
-
color:
|
|
911
|
-
error:
|
|
927
|
+
color: a,
|
|
928
|
+
error: s,
|
|
912
929
|
helperText: f
|
|
913
930
|
})
|
|
914
931
|
),
|
|
@@ -924,7 +941,7 @@ const Zo = /MUI: The value provided to.*is invalid/i, jo = ({
|
|
|
924
941
|
}),
|
|
925
942
|
$.label
|
|
926
943
|
),
|
|
927
|
-
disabled:
|
|
944
|
+
disabled: b
|
|
928
945
|
}
|
|
929
946
|
) }) });
|
|
930
947
|
}, io = (e) => {
|
|
@@ -932,33 +949,33 @@ const Zo = /MUI: The value provided to.*is invalid/i, jo = ({
|
|
|
932
949
|
return -1;
|
|
933
950
|
try {
|
|
934
951
|
const o = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
|
|
935
|
-
|
|
936
|
-
return "%" + ("00" +
|
|
952
|
+
$t.from(o, "base64").toString("utf8").split("").map(function(a) {
|
|
953
|
+
return "%" + ("00" + a.charCodeAt(0).toString(16)).slice(-2);
|
|
937
954
|
}).join("")
|
|
938
955
|
), r = JSON.parse(i);
|
|
939
956
|
return r != null && r.exp ? r.exp : -1;
|
|
940
957
|
} catch (t) {
|
|
941
958
|
return -1;
|
|
942
959
|
}
|
|
943
|
-
},
|
|
960
|
+
}, on = ({
|
|
944
961
|
open: e = !1,
|
|
945
962
|
closeHandler: t,
|
|
946
963
|
setAuth0ExpiryTime: o
|
|
947
964
|
}) => {
|
|
948
|
-
const { logout: i, getAccessTokenSilently: r } =
|
|
965
|
+
const { logout: i, getAccessTokenSilently: r } = le(), [a, c] = T(0), s = () => N(void 0, null, function* () {
|
|
949
966
|
i({ logoutParams: { returnTo: `${window.location.origin}` } });
|
|
950
|
-
}), l = () =>
|
|
951
|
-
c(
|
|
967
|
+
}), l = () => N(void 0, null, function* () {
|
|
968
|
+
c(a + 1), t();
|
|
952
969
|
});
|
|
953
970
|
return ne(() => {
|
|
954
|
-
|
|
955
|
-
if (
|
|
971
|
+
N(void 0, null, function* () {
|
|
972
|
+
if (a > 0) {
|
|
956
973
|
const A = yield r({ cacheMode: "off" }), f = io(A) * 1e3;
|
|
957
974
|
o(f);
|
|
958
975
|
}
|
|
959
976
|
});
|
|
960
|
-
}, [
|
|
961
|
-
|
|
977
|
+
}, [a, r, o]), /* @__PURE__ */ n(
|
|
978
|
+
Ze,
|
|
962
979
|
{
|
|
963
980
|
isOpen: e,
|
|
964
981
|
primaryButton: {
|
|
@@ -970,7 +987,7 @@ const Zo = /MUI: The value provided to.*is invalid/i, jo = ({
|
|
|
970
987
|
},
|
|
971
988
|
secondaryButton: {
|
|
972
989
|
text: "Log out",
|
|
973
|
-
onClick:
|
|
990
|
+
onClick: s,
|
|
974
991
|
disabled: !1,
|
|
975
992
|
testId: "PreferencesDialog",
|
|
976
993
|
buttonColor: "secondary"
|
|
@@ -1000,7 +1017,7 @@ function lo(e) {
|
|
|
1000
1017
|
const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
|
|
1001
1018
|
return t === "access_denied" && o.match(/Script.*time.*exceeded/);
|
|
1002
1019
|
}
|
|
1003
|
-
function
|
|
1020
|
+
function nn({
|
|
1004
1021
|
children: e,
|
|
1005
1022
|
appName: t = "the app",
|
|
1006
1023
|
throwErrors: o = "none",
|
|
@@ -1009,11 +1026,11 @@ function tn({
|
|
|
1009
1026
|
}
|
|
1010
1027
|
}) {
|
|
1011
1028
|
var S, A;
|
|
1012
|
-
const { isAuthenticated:
|
|
1029
|
+
const { isAuthenticated: a, isLoading: c, error: s, loginWithRedirect: l, logout: u } = le();
|
|
1013
1030
|
ne(() => {
|
|
1014
|
-
|
|
1015
|
-
}, [
|
|
1016
|
-
const g =
|
|
1031
|
+
s && r(s);
|
|
1032
|
+
}, [s, r]);
|
|
1033
|
+
const g = at(
|
|
1017
1034
|
() => ({
|
|
1018
1035
|
appState: {
|
|
1019
1036
|
returnTo: `${window.location.pathname}${window.location.search}`
|
|
@@ -1022,38 +1039,38 @@ function tn({
|
|
|
1022
1039
|
[]
|
|
1023
1040
|
);
|
|
1024
1041
|
if (ne(() => {
|
|
1025
|
-
c ||
|
|
1026
|
-
}, [c,
|
|
1042
|
+
c || a || s || l(g);
|
|
1043
|
+
}, [c, a, s, l, r, g]), s) {
|
|
1027
1044
|
if (i || console.error(
|
|
1028
|
-
`Error detected in AuthGuard [isAuthenticated=${
|
|
1029
|
-
|
|
1045
|
+
`Error detected in AuthGuard [isAuthenticated=${a},isLoading=${c}]`,
|
|
1046
|
+
s
|
|
1030
1047
|
), o === "all")
|
|
1031
|
-
throw
|
|
1032
|
-
if (ro(
|
|
1033
|
-
let f = "Auth error",
|
|
1034
|
-
if (ao(
|
|
1035
|
-
f = "Unauthorised",
|
|
1036
|
-
else if (so(
|
|
1037
|
-
f = "App not authorised",
|
|
1038
|
-
else if (lo(
|
|
1039
|
-
f = "Auth0 script execution time exceeded",
|
|
1040
|
-
else if (
|
|
1048
|
+
throw s;
|
|
1049
|
+
if (ro(s)) {
|
|
1050
|
+
let f = "Auth error", b = "An unknown Auth0 error occurred.";
|
|
1051
|
+
if (ao(s))
|
|
1052
|
+
f = "Unauthorised", b = `You are not authorised to access ${t}.`;
|
|
1053
|
+
else if (so(s))
|
|
1054
|
+
f = "App not authorised", b = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
|
|
1055
|
+
else if (lo(s))
|
|
1056
|
+
f = "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.";
|
|
1057
|
+
else if (s.message === "Invalid state") {
|
|
1041
1058
|
const y = localStorage.getItem("auth0_redirect_count");
|
|
1042
1059
|
y ? y && parseInt(y) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(y) + 1)), l(g)) : (localStorage.setItem("auth0_redirect_count", "1"), l(g));
|
|
1043
|
-
} else if (o === "unknown") throw
|
|
1060
|
+
} else if (o === "unknown") throw s;
|
|
1044
1061
|
return /* @__PURE__ */ m(Le, { open: !0, children: [
|
|
1045
|
-
/* @__PURE__ */ n(
|
|
1046
|
-
/* @__PURE__ */ m(
|
|
1047
|
-
/* @__PURE__ */ n(
|
|
1062
|
+
/* @__PURE__ */ n(Re, { children: f }),
|
|
1063
|
+
/* @__PURE__ */ m(Oe, { children: [
|
|
1064
|
+
/* @__PURE__ */ n(_, { children: b }),
|
|
1048
1065
|
/* @__PURE__ */ n("br", {}),
|
|
1049
|
-
/* @__PURE__ */ n(
|
|
1050
|
-
/* @__PURE__ */ m(
|
|
1066
|
+
/* @__PURE__ */ n(_, { variant: "subtitle2", children: "Details from Auth0" }),
|
|
1067
|
+
/* @__PURE__ */ m(_, { variant: "body2", children: [
|
|
1051
1068
|
"error: ",
|
|
1052
|
-
(S =
|
|
1069
|
+
(S = s == null ? void 0 : s.error) != null ? S : "N/A"
|
|
1053
1070
|
] }),
|
|
1054
|
-
/* @__PURE__ */ m(
|
|
1071
|
+
/* @__PURE__ */ m(_, { variant: "body2", children: [
|
|
1055
1072
|
"description: ",
|
|
1056
|
-
(A =
|
|
1073
|
+
(A = s == null ? void 0 : s.error_description) != null ? A : "N/A"
|
|
1057
1074
|
] })
|
|
1058
1075
|
] }),
|
|
1059
1076
|
/* @__PURE__ */ m(He, { children: [
|
|
@@ -1061,9 +1078,9 @@ function tn({
|
|
|
1061
1078
|
/* @__PURE__ */ n(W, { onClick: () => u({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
|
|
1062
1079
|
] })
|
|
1063
1080
|
] });
|
|
1064
|
-
} else if (o === "unknown") throw
|
|
1081
|
+
} else if (o === "unknown") throw s;
|
|
1065
1082
|
}
|
|
1066
|
-
return
|
|
1083
|
+
return a ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ n(L, { children: e })) : /* @__PURE__ */ n(Ft, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
|
|
1067
1084
|
}
|
|
1068
1085
|
const co = {
|
|
1069
1086
|
autoHideDuration: 6e3,
|
|
@@ -1073,70 +1090,70 @@ const co = {
|
|
|
1073
1090
|
disableWindowBlurListener: !1
|
|
1074
1091
|
}, uo = {
|
|
1075
1092
|
shouldClose: (e, t) => t !== "clickaway"
|
|
1076
|
-
},
|
|
1093
|
+
}, Ie = {
|
|
1077
1094
|
message: "",
|
|
1078
1095
|
severity: "info",
|
|
1079
1096
|
variant: "standard",
|
|
1080
1097
|
progressIndicator: void 0
|
|
1081
1098
|
// Can use 'circular' or 'linear'
|
|
1082
|
-
},
|
|
1099
|
+
}, $e = 100, Fe = 2e3, po = 2e3, ho = /* @__PURE__ */ (() => {
|
|
1083
1100
|
let e = 0;
|
|
1084
1101
|
return () => (e += 1, e);
|
|
1085
1102
|
})(), fo = {
|
|
1086
1103
|
borderBottomLeftRadius: "0px",
|
|
1087
1104
|
borderBottomRightRadius: "0px"
|
|
1088
|
-
}, mo = {}, go = {},
|
|
1089
|
-
function xo(
|
|
1090
|
-
var c =
|
|
1105
|
+
}, mo = {}, go = {}, et = _e(null);
|
|
1106
|
+
function xo(a) {
|
|
1107
|
+
var c = a, {
|
|
1091
1108
|
overrideState: e = mo,
|
|
1092
1109
|
overrideActions: t = go,
|
|
1093
1110
|
shouldClose: o = uo.shouldClose,
|
|
1094
1111
|
children: i
|
|
1095
|
-
} = c, r =
|
|
1112
|
+
} = c, r = he(c, [
|
|
1096
1113
|
"overrideState",
|
|
1097
1114
|
"overrideActions",
|
|
1098
1115
|
"shouldClose",
|
|
1099
1116
|
"children"
|
|
1100
1117
|
]);
|
|
1101
|
-
var
|
|
1102
|
-
const [{ open:
|
|
1103
|
-
l({ open:
|
|
1104
|
-
}, []), f = K((
|
|
1105
|
-
S.current += 1, u.current.length >=
|
|
1106
|
-
`SaladBarProvider: MAX_QUEUE_LENGTH (${
|
|
1118
|
+
var v;
|
|
1119
|
+
const [{ open: s }, l] = T({ open: !1 }), u = ee([]), g = ee(Date.now()), S = ee(0), A = K((C) => {
|
|
1120
|
+
l({ open: C });
|
|
1121
|
+
}, []), f = K((C = {}) => {
|
|
1122
|
+
S.current += 1, u.current.length >= $e && Date.now() - g.current >= Fe && (g.current = Date.now(), console.error(
|
|
1123
|
+
`SaladBarProvider: MAX_QUEUE_LENGTH (${$e}) hit ${S.current} times in last ${Fe}ms)`
|
|
1107
1124
|
), S.current = 0);
|
|
1108
|
-
const w = d(D(d({},
|
|
1125
|
+
const w = d(D(d({}, Ie), {
|
|
1109
1126
|
key: ho()
|
|
1110
|
-
}),
|
|
1127
|
+
}), C);
|
|
1111
1128
|
return u.current.push(w), u.current.length === 1 && l({ open: !0 }), w.key;
|
|
1112
|
-
}, []),
|
|
1113
|
-
const w = u.current.findIndex((Z) => Z.key ===
|
|
1129
|
+
}, []), b = (C = "", w = {}) => f(d({ message: C, severity: "success" }, w)), y = (C = "", w = {}) => f(d({ message: C, severity: "info" }, w)), p = (C = "", w = {}) => f(d({ message: C, severity: "warning" }, w)), k = (C = "", w = {}) => f(d({ message: C, severity: "error" }, w)), I = (C) => {
|
|
1130
|
+
const w = u.current.findIndex((Z) => Z.key === C);
|
|
1114
1131
|
if (w !== -1)
|
|
1115
1132
|
return w === 0 ? (l({ open: !1 }), u.current[0]) : u.current.splice(w, 1);
|
|
1116
|
-
},
|
|
1117
|
-
o(
|
|
1133
|
+
}, E = (C, w) => {
|
|
1134
|
+
o(C, w) && l({ open: !1 });
|
|
1118
1135
|
}, V = () => {
|
|
1119
1136
|
}, P = () => {
|
|
1120
1137
|
u.current.shift(), u.current.length > 0 && l({ open: !0 });
|
|
1121
|
-
}, x = (
|
|
1138
|
+
}, x = (v = u.current[0]) != null ? v : d({}, Ie), $ = {};
|
|
1122
1139
|
"autoHideDuration" in x && ($.autoHideDuration = x.autoHideDuration);
|
|
1123
1140
|
const R = d(d({}, co), r), h = d(d({
|
|
1124
|
-
open:
|
|
1141
|
+
open: s,
|
|
1125
1142
|
setOpen: A,
|
|
1126
1143
|
enqueueNotification: f,
|
|
1127
|
-
enqueueSuccessNotification:
|
|
1144
|
+
enqueueSuccessNotification: b,
|
|
1128
1145
|
enqueueInfoNotification: y,
|
|
1129
1146
|
enqueueWarningNotification: p,
|
|
1130
|
-
enqueueErrorNotification:
|
|
1147
|
+
enqueueErrorNotification: k,
|
|
1131
1148
|
removeNotification: I
|
|
1132
1149
|
}, e), t);
|
|
1133
|
-
return /* @__PURE__ */ m(
|
|
1150
|
+
return /* @__PURE__ */ m(et.Provider, { value: h, children: [
|
|
1134
1151
|
i,
|
|
1135
1152
|
/* @__PURE__ */ n(
|
|
1136
|
-
|
|
1153
|
+
xt,
|
|
1137
1154
|
D(d(d({}, R), $), {
|
|
1138
|
-
open:
|
|
1139
|
-
onClose:
|
|
1155
|
+
open: s,
|
|
1156
|
+
onClose: E,
|
|
1140
1157
|
TransitionProps: {
|
|
1141
1158
|
onExited: P,
|
|
1142
1159
|
onExit: V
|
|
@@ -1144,9 +1161,9 @@ function xo(s) {
|
|
|
1144
1161
|
sx: { zIndex: po },
|
|
1145
1162
|
children: /* @__PURE__ */ m("div", { children: [
|
|
1146
1163
|
/* @__PURE__ */ n(
|
|
1147
|
-
|
|
1164
|
+
vt,
|
|
1148
1165
|
{
|
|
1149
|
-
onClose: (
|
|
1166
|
+
onClose: (C) => E(C, "closeAlert"),
|
|
1150
1167
|
severity: x.severity,
|
|
1151
1168
|
variant: "filled",
|
|
1152
1169
|
icon: x.progressIndicator === "circular" ? /* @__PURE__ */ n(ae, { size: "1em" }) : void 0,
|
|
@@ -1154,28 +1171,28 @@ function xo(s) {
|
|
|
1154
1171
|
children: x.message
|
|
1155
1172
|
}
|
|
1156
1173
|
),
|
|
1157
|
-
x.progressIndicator === "linear" && /* @__PURE__ */ n(
|
|
1174
|
+
x.progressIndicator === "linear" && /* @__PURE__ */ n(Pe, { color: "primary" })
|
|
1158
1175
|
] })
|
|
1159
1176
|
})
|
|
1160
1177
|
)
|
|
1161
1178
|
] });
|
|
1162
1179
|
}
|
|
1163
|
-
function
|
|
1164
|
-
const e =
|
|
1180
|
+
function vo() {
|
|
1181
|
+
const e = Me(et);
|
|
1165
1182
|
if (e === null)
|
|
1166
|
-
throw new
|
|
1183
|
+
throw new ce("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
|
|
1167
1184
|
return e;
|
|
1168
1185
|
}
|
|
1169
|
-
const
|
|
1186
|
+
const rn = se(
|
|
1170
1187
|
(e = { autoHideDuration: 1 }, t = {}, o = {}) => ({ children: i }) => /* @__PURE__ */ n(xo, D(d({}, e), { overrideState: t, overrideActions: o, children: i }))
|
|
1171
|
-
),
|
|
1172
|
-
var
|
|
1188
|
+
), tt = "domainCode";
|
|
1189
|
+
var Ne;
|
|
1173
1190
|
const Ee = M(
|
|
1174
|
-
JSON.parse((
|
|
1175
|
-
),
|
|
1191
|
+
JSON.parse((Ne = localStorage.getItem(tt)) != null ? Ne : '{"domainCode": ""}').domainCode
|
|
1192
|
+
), Co = M(
|
|
1176
1193
|
(e) => e(Ee),
|
|
1177
1194
|
(e, t, o) => {
|
|
1178
|
-
t(Ee, o), localStorage.setItem(
|
|
1195
|
+
t(Ee, o), localStorage.setItem(tt, JSON.stringify({ domainCode: o }));
|
|
1179
1196
|
}
|
|
1180
1197
|
), Ao = {
|
|
1181
1198
|
act: "ACT",
|
|
@@ -1192,23 +1209,23 @@ const Ee = M(
|
|
|
1192
1209
|
}, wo = (e) => {
|
|
1193
1210
|
var t;
|
|
1194
1211
|
return e === null ? "N/A" : (t = Ao[e]) != null ? t : "";
|
|
1195
|
-
},
|
|
1212
|
+
}, an = ({
|
|
1196
1213
|
isLoading: e,
|
|
1197
1214
|
isOpen: t,
|
|
1198
1215
|
onClose: o,
|
|
1199
1216
|
onDomainChange: i,
|
|
1200
1217
|
domainOptions: r,
|
|
1201
|
-
applicationName:
|
|
1218
|
+
applicationName: a,
|
|
1202
1219
|
handleLogout: c
|
|
1203
1220
|
}) => {
|
|
1204
|
-
const [
|
|
1221
|
+
const [s, l] = O(Co), [u, g] = T(s), { enqueueSuccessNotification: S } = vo(), A = r.length === 0, f = !!s && !r.includes(s) && !r.includes(u), b = !s || A || f, y = () => N(void 0, null, function* () {
|
|
1205
1222
|
u ? (l(u), i == null || i(u), S(`Set organisation to ${u}`), o()) : (l(""), i == null || i(""));
|
|
1206
|
-
}), p = () =>
|
|
1207
|
-
|
|
1223
|
+
}), p = () => N(void 0, null, function* () {
|
|
1224
|
+
s && !A && !f ? (g(s), o()) : b && c();
|
|
1208
1225
|
});
|
|
1209
|
-
let
|
|
1210
|
-
return A ?
|
|
1211
|
-
|
|
1226
|
+
let k;
|
|
1227
|
+
return A ? k = "Unable to retrieve your active organisations. Try logging in again." : f && (k = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ m(
|
|
1228
|
+
Ze,
|
|
1212
1229
|
{
|
|
1213
1230
|
isOpen: t,
|
|
1214
1231
|
dialogTitle: "Select an organisation",
|
|
@@ -1219,15 +1236,15 @@ const Ee = M(
|
|
|
1219
1236
|
buttonColor: "primary"
|
|
1220
1237
|
},
|
|
1221
1238
|
secondaryButton: {
|
|
1222
|
-
text:
|
|
1239
|
+
text: b ? "Logout" : "Cancel",
|
|
1223
1240
|
onClick: p
|
|
1224
1241
|
},
|
|
1225
|
-
onClose:
|
|
1242
|
+
onClose: b ? () => {
|
|
1226
1243
|
} : o,
|
|
1227
1244
|
children: [
|
|
1228
|
-
/* @__PURE__ */ m(
|
|
1245
|
+
/* @__PURE__ */ m(_, { marginBottom: 2, children: [
|
|
1229
1246
|
"Select the default organisation that you want to use with the ",
|
|
1230
|
-
|
|
1247
|
+
a,
|
|
1231
1248
|
"."
|
|
1232
1249
|
] }),
|
|
1233
1250
|
/* @__PURE__ */ n(
|
|
@@ -1237,7 +1254,7 @@ const Ee = M(
|
|
|
1237
1254
|
multiple: !1,
|
|
1238
1255
|
disableClearable: !1,
|
|
1239
1256
|
value: u !== "" ? u : null,
|
|
1240
|
-
onChange: (I,
|
|
1257
|
+
onChange: (I, E) => g(E != null ? E : ""),
|
|
1241
1258
|
getOptionLabel: wo,
|
|
1242
1259
|
options: [...r],
|
|
1243
1260
|
renderInput: (I) => /* @__PURE__ */ n(
|
|
@@ -1246,7 +1263,7 @@ const Ee = M(
|
|
|
1246
1263
|
variant: "filled",
|
|
1247
1264
|
label: "Select organisation",
|
|
1248
1265
|
InputProps: D(d({}, I.InputProps), {
|
|
1249
|
-
endAdornment: /* @__PURE__ */ m(
|
|
1266
|
+
endAdornment: /* @__PURE__ */ m(L, { children: [
|
|
1250
1267
|
e ? /* @__PURE__ */ n(ae, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
|
|
1251
1268
|
I.InputProps.endAdornment
|
|
1252
1269
|
] })
|
|
@@ -1255,11 +1272,11 @@ const Ee = M(
|
|
|
1255
1272
|
)
|
|
1256
1273
|
}
|
|
1257
1274
|
),
|
|
1258
|
-
|
|
1275
|
+
k && /* @__PURE__ */ n(Ct, { error: !0, children: k })
|
|
1259
1276
|
]
|
|
1260
1277
|
}
|
|
1261
1278
|
);
|
|
1262
|
-
},
|
|
1279
|
+
}, sn = Ue({
|
|
1263
1280
|
palette: {
|
|
1264
1281
|
primary: {
|
|
1265
1282
|
dark: "#00A651",
|
|
@@ -1310,7 +1327,7 @@ const Ee = M(
|
|
|
1310
1327
|
navBar: {
|
|
1311
1328
|
backgroundColor: "#E8E8E8"
|
|
1312
1329
|
}
|
|
1313
|
-
}),
|
|
1330
|
+
}), ln = Ue({
|
|
1314
1331
|
palette: {
|
|
1315
1332
|
primary: {
|
|
1316
1333
|
main: "#007236",
|
|
@@ -1406,46 +1423,48 @@ const Ee = M(
|
|
|
1406
1423
|
}
|
|
1407
1424
|
});
|
|
1408
1425
|
export {
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1426
|
+
Ze as AgDialog,
|
|
1427
|
+
Zo as AppLayout,
|
|
1428
|
+
nn as AuthGuard,
|
|
1429
|
+
et as Context,
|
|
1430
|
+
ce as ContextError,
|
|
1431
|
+
an as DomainCodeDialog,
|
|
1415
1432
|
Uo as ExampleComponent,
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1433
|
+
jo as FetchAutocomplete,
|
|
1434
|
+
en as MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX,
|
|
1435
|
+
Ge as NAVBAR_WIDTH_CLOSED,
|
|
1436
|
+
qe as NAVBAR_WIDTH_OPENED,
|
|
1420
1437
|
Go as NavBar,
|
|
1421
1438
|
Vo as NavBarDarkStyledList,
|
|
1422
1439
|
qo as NavBarLightStyledList,
|
|
1423
1440
|
Lt as NavBarProvider,
|
|
1424
1441
|
xo as SaladBarProvider,
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1442
|
+
on as SessionExpiryDialog,
|
|
1443
|
+
tn as SingleAutocomplete,
|
|
1444
|
+
Rt as buildNavBarState,
|
|
1445
|
+
Xo as determineUserLevelFromClaims,
|
|
1446
|
+
Co as domainCodeAtom,
|
|
1447
|
+
sn as fed21Theme,
|
|
1431
1448
|
io as getAuth0Expiry,
|
|
1432
|
-
|
|
1433
|
-
|
|
1449
|
+
Ko as getValidBusinessRoles,
|
|
1450
|
+
ln as internalAgSystemsTheme,
|
|
1451
|
+
H as navBarClasses,
|
|
1434
1452
|
Q as navBarOpenAtom,
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1453
|
+
Gt as navBarTopAtom,
|
|
1454
|
+
zt as navBarWidthClosedAtom,
|
|
1455
|
+
Wt as navBarWidthOpenAtom,
|
|
1438
1456
|
Jt as simpleHashCode,
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1457
|
+
Qo as suppressConsole,
|
|
1458
|
+
Se as titleTextAtom,
|
|
1459
|
+
qt as topBarHeightAtom,
|
|
1460
|
+
Vt as topBarMiddleAtom,
|
|
1461
|
+
Jo as unsuppressConsole,
|
|
1462
|
+
je as useAutocompleteOptions,
|
|
1463
|
+
Pt as useNavBar,
|
|
1464
|
+
vo as useSaladBar,
|
|
1465
|
+
Yo as useValidDomains,
|
|
1447
1466
|
zo as withBrowserRouter,
|
|
1448
1467
|
Wo as withNavBarProvider,
|
|
1449
|
-
|
|
1468
|
+
rn as withSaladBarProvider
|
|
1450
1469
|
};
|
|
1451
1470
|
//# sourceMappingURL=index.js.map
|