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