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