@australiangreens/ag-internal-components 0.3.2 → 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 +649 -638
- 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
47
|
import { Buffer as Dt } from "buffer";
|
|
48
|
-
import
|
|
49
|
-
import { atom as
|
|
50
|
-
import { createHelper as
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import { useHydrateAtoms as
|
|
54
|
-
import { styled as
|
|
55
|
-
import
|
|
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
56
|
function _o({ text: e }) {
|
|
57
|
-
const [t, o] =
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
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,
|
|
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: (
|
|
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
|
-
children: (y = f.text) != null ? y : `Button ${
|
|
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,179 +161,185 @@ 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)"
|
|
220
|
+
},
|
|
221
|
+
"& .MuiOutlinedInput-root.Mui-focused": {
|
|
222
|
+
backgroundColor: "hsla(201, 98%, 41%, 0.08)"
|
|
219
223
|
}
|
|
220
224
|
},
|
|
221
225
|
focused: !0
|
|
222
226
|
} : {};
|
|
223
|
-
return /* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
|
|
227
|
+
return /* @__PURE__ */ m("div", { "data-testid": r, children: [
|
|
228
|
+
/* @__PURE__ */ i(
|
|
229
|
+
ie,
|
|
226
230
|
{
|
|
227
|
-
sx:
|
|
228
|
-
"data-testid":
|
|
229
|
-
disablePortal:
|
|
231
|
+
sx: u(u({}, c), I ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
232
|
+
"data-testid": r ? `${r}:Autocomplete` : void 0,
|
|
233
|
+
disablePortal: y,
|
|
230
234
|
multiple: !0,
|
|
231
235
|
getOptionLabel: (h) => typeof h == "string" ? h : h.label,
|
|
232
|
-
loading: H ?
|
|
233
|
-
options: [...
|
|
236
|
+
loading: H ? b : !1,
|
|
237
|
+
options: [...p, ...d != null ? d : []],
|
|
234
238
|
filterSelectedOptions: !0,
|
|
235
239
|
includeInputInList: !0,
|
|
236
|
-
value:
|
|
237
|
-
onChange: (h,
|
|
238
|
-
o(
|
|
240
|
+
value: p,
|
|
241
|
+
onChange: (h, A, T) => {
|
|
242
|
+
o(A, T, h);
|
|
239
243
|
},
|
|
240
|
-
onInputChange: (h,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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,
|
|
248
254
|
fullWidth: !0,
|
|
249
|
-
variant:
|
|
250
|
-
error:
|
|
251
|
-
helperText:
|
|
255
|
+
variant: C,
|
|
256
|
+
error: D,
|
|
257
|
+
helperText: f,
|
|
252
258
|
slotProps: {
|
|
253
|
-
input:
|
|
254
|
-
endAdornment: /* @__PURE__ */
|
|
255
|
-
|
|
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,
|
|
256
262
|
h.InputProps.endAdornment
|
|
257
263
|
] })
|
|
258
264
|
})
|
|
259
265
|
},
|
|
260
|
-
"data-testid":
|
|
261
|
-
onKeyDown: (
|
|
262
|
-
(
|
|
266
|
+
"data-testid": r ? `${r}:Autocomplete:TextField` : void 0,
|
|
267
|
+
onKeyDown: (A) => {
|
|
268
|
+
(A.key === "Backspace" || A.key === "Delete") && A.stopPropagation();
|
|
263
269
|
},
|
|
264
|
-
color:
|
|
265
|
-
placeholder:
|
|
266
|
-
}),
|
|
270
|
+
color: x,
|
|
271
|
+
placeholder: E != null ? E : N ? "Placeholder field" : void 0
|
|
272
|
+
}), Je)
|
|
267
273
|
),
|
|
268
274
|
renderValue: () => null,
|
|
269
|
-
isOptionEqualToValue: (h,
|
|
270
|
-
renderOption: (h,
|
|
275
|
+
isOptionEqualToValue: (h, A) => h.id === A.id,
|
|
276
|
+
renderOption: (h, A, T) => {
|
|
271
277
|
if (t) {
|
|
272
|
-
const
|
|
278
|
+
const j = wt(A.label, T.inputValue, {
|
|
273
279
|
insideWords: !0,
|
|
274
280
|
findAllOccurrences: !0
|
|
275
|
-
}),
|
|
276
|
-
return /* @__PURE__ */
|
|
281
|
+
}), Ze = kt(A.label, j);
|
|
282
|
+
return /* @__PURE__ */ ne(
|
|
277
283
|
"li",
|
|
278
|
-
|
|
279
|
-
key:
|
|
280
|
-
"data-testid":
|
|
284
|
+
F(u({}, h), {
|
|
285
|
+
key: A.id,
|
|
286
|
+
"data-testid": r ? `${r}:Autocomplete:option(${A.id.toString()})` : void 0
|
|
281
287
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ i("div", { children: Ze.map((le, je) => /* @__PURE__ */ i(
|
|
283
289
|
"span",
|
|
284
290
|
{
|
|
285
291
|
style: {
|
|
286
|
-
fontWeight:
|
|
292
|
+
fontWeight: le.highlight ? 700 : 400
|
|
287
293
|
},
|
|
288
|
-
children:
|
|
294
|
+
children: le.text
|
|
289
295
|
},
|
|
290
|
-
|
|
296
|
+
je
|
|
291
297
|
)) })
|
|
292
298
|
);
|
|
293
299
|
} else
|
|
294
|
-
return /* @__PURE__ */
|
|
300
|
+
return /* @__PURE__ */ ne(
|
|
295
301
|
"li",
|
|
296
|
-
|
|
297
|
-
key:
|
|
298
|
-
"data-testid":
|
|
302
|
+
F(u({}, h), {
|
|
303
|
+
key: A.id,
|
|
304
|
+
"data-testid": r ? `${r}:option(${A.id.toString()})` : void 0
|
|
299
305
|
}),
|
|
300
|
-
|
|
306
|
+
A.label
|
|
301
307
|
);
|
|
302
308
|
},
|
|
303
|
-
onContextMenu: F,
|
|
304
309
|
onMouseDownCapture: (h) => {
|
|
305
|
-
h.button ===
|
|
310
|
+
h.button === We.right && L && (h.preventDefault(), h.stopPropagation());
|
|
306
311
|
},
|
|
307
312
|
onContextMenuCapture: (h) => {
|
|
308
|
-
|
|
309
|
-
}
|
|
313
|
+
L && (h.preventDefault(), h.stopPropagation()), U(h);
|
|
314
|
+
},
|
|
315
|
+
readOnly: N
|
|
310
316
|
}
|
|
311
317
|
),
|
|
312
|
-
|
|
313
|
-
var
|
|
314
|
-
return /* @__PURE__ */
|
|
315
|
-
|
|
318
|
+
p.length > 0 && /* @__PURE__ */ i(M, { sx: l, children: p.map((h) => {
|
|
319
|
+
var A;
|
|
320
|
+
return /* @__PURE__ */ i(
|
|
321
|
+
st,
|
|
316
322
|
{
|
|
317
323
|
sx: {
|
|
318
324
|
marginTop: 1,
|
|
319
325
|
marginRight: 1,
|
|
320
326
|
height: "auto"
|
|
321
327
|
},
|
|
322
|
-
label: /* @__PURE__ */
|
|
328
|
+
label: /* @__PURE__ */ i(
|
|
323
329
|
at,
|
|
324
330
|
{
|
|
325
|
-
title: (
|
|
331
|
+
title: (A = h.tooltipContent) != null ? A : "",
|
|
326
332
|
placement: "bottom-start",
|
|
327
|
-
slotProps:
|
|
328
|
-
children: /* @__PURE__ */
|
|
333
|
+
slotProps: V,
|
|
334
|
+
children: /* @__PURE__ */ i(_, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
|
|
329
335
|
}
|
|
330
336
|
),
|
|
331
|
-
"data-testid":
|
|
332
|
-
onDelete: (
|
|
333
|
-
deleteIcon: /* @__PURE__ */
|
|
334
|
-
|
|
337
|
+
"data-testid": r ? `${r}:Chip(${h.id.toString()})` : void 0,
|
|
338
|
+
onDelete: (T) => S(T, h.id),
|
|
339
|
+
deleteIcon: /* @__PURE__ */ i(
|
|
340
|
+
Ct,
|
|
335
341
|
{
|
|
336
|
-
"data-testid":
|
|
342
|
+
"data-testid": r ? `${r}:Chip(${h.id.toString()}):deleteIcon` : void 0
|
|
337
343
|
}
|
|
338
344
|
)
|
|
339
345
|
},
|
|
@@ -342,99 +348,104 @@ function Io({
|
|
|
342
348
|
}) })
|
|
343
349
|
] });
|
|
344
350
|
}
|
|
345
|
-
const
|
|
346
|
-
lookup: e = () =>
|
|
351
|
+
const Po = /MUI: The value provided to.*is invalid/i, No = ({
|
|
352
|
+
lookup: e = () => P(null, null, function* () {
|
|
347
353
|
}),
|
|
348
354
|
onChange: t,
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
+
onInputChange: o,
|
|
356
|
+
label: n,
|
|
357
|
+
value: s,
|
|
358
|
+
sx: a,
|
|
359
|
+
textFieldColor: p,
|
|
360
|
+
textFieldVariant: r = "filled",
|
|
361
|
+
error: c = !1,
|
|
355
362
|
"data-testid": l,
|
|
356
|
-
noOptionsText:
|
|
357
|
-
minLength:
|
|
358
|
-
disablePortal:
|
|
359
|
-
preLoadedOptions:
|
|
360
|
-
helperText:
|
|
361
|
-
disabled:
|
|
362
|
-
popupIcon:
|
|
363
|
-
disableIconFlip:
|
|
364
|
-
isPlaceholder:
|
|
365
|
-
|
|
366
|
-
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 = () => {
|
|
367
374
|
},
|
|
368
|
-
disableDefaultRightClickBehaviour:
|
|
375
|
+
disableDefaultRightClickBehaviour: N = !1
|
|
369
376
|
}) => {
|
|
370
|
-
const [
|
|
371
|
-
inputValue:
|
|
372
|
-
label:
|
|
377
|
+
const [E, U] = G(""), { data: L, isLoading: B } = qe({
|
|
378
|
+
inputValue: E,
|
|
379
|
+
label: n,
|
|
373
380
|
lookup: e,
|
|
374
|
-
minLength:
|
|
375
|
-
preLoadedOptions:
|
|
376
|
-
}),
|
|
381
|
+
minLength: C != null ? C : 0,
|
|
382
|
+
preLoadedOptions: g
|
|
383
|
+
}), R = E.length >= C, S = y ? {
|
|
377
384
|
sx: {
|
|
378
385
|
"& .MuiFilledInput-root.Mui-focused": {
|
|
379
386
|
backgroundColor: "hsla(201, 98%, 41%, 0.08)"
|
|
387
|
+
},
|
|
388
|
+
"& .MuiOutlinedInput-root.Mui-focused": {
|
|
389
|
+
backgroundColor: "hsla(201, 98%, 41%, 0.08)"
|
|
380
390
|
}
|
|
381
391
|
},
|
|
382
|
-
focused: !0
|
|
392
|
+
focused: !0,
|
|
393
|
+
slotProps: { input: { endAdornment: void 0 } }
|
|
383
394
|
} : {};
|
|
384
|
-
return /* @__PURE__ */
|
|
385
|
-
|
|
395
|
+
return /* @__PURE__ */ i("div", { "data-testid": l, children: /* @__PURE__ */ i(
|
|
396
|
+
lt,
|
|
386
397
|
{
|
|
387
398
|
direction: "row",
|
|
388
399
|
spacing: 1,
|
|
389
|
-
onContextMenu: I,
|
|
390
400
|
onMouseDownCapture: (d) => {
|
|
391
|
-
d.button ===
|
|
401
|
+
d.button === We.right && N && (d.preventDefault(), d.stopPropagation());
|
|
392
402
|
},
|
|
393
403
|
onContextMenuCapture: (d) => {
|
|
394
|
-
|
|
404
|
+
N && (d.preventDefault(), d.stopPropagation()), V(d);
|
|
395
405
|
},
|
|
396
|
-
children: /* @__PURE__ */
|
|
397
|
-
|
|
406
|
+
children: /* @__PURE__ */ i(
|
|
407
|
+
ie,
|
|
398
408
|
{
|
|
399
|
-
sx:
|
|
409
|
+
sx: u(u({}, a), k ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
|
|
400
410
|
"data-testid": l ? `${l}:Autocomplete` : void 0,
|
|
401
|
-
loading:
|
|
402
|
-
options:
|
|
403
|
-
onChange: (d,
|
|
404
|
-
t(d,
|
|
411
|
+
loading: R ? B : !1,
|
|
412
|
+
options: L != null ? L : [],
|
|
413
|
+
onChange: (d, b, H) => {
|
|
414
|
+
t(d, b, H);
|
|
405
415
|
},
|
|
406
|
-
disablePortal:
|
|
416
|
+
disablePortal: v,
|
|
407
417
|
filterOptions: (d) => d,
|
|
408
|
-
value:
|
|
409
|
-
noOptionsText:
|
|
418
|
+
value: s,
|
|
419
|
+
noOptionsText: R ? x : "Start typing to search",
|
|
410
420
|
getOptionLabel: (d) => d.label,
|
|
411
|
-
popupIcon:
|
|
412
|
-
renderInput: (d) => /* @__PURE__ */
|
|
413
|
-
|
|
414
|
-
|
|
421
|
+
popupIcon: f,
|
|
422
|
+
renderInput: (d) => /* @__PURE__ */ i(
|
|
423
|
+
re,
|
|
424
|
+
u(F(u({
|
|
415
425
|
"data-testid": l ? `${l}:Autocomplete:TextField` : void 0
|
|
416
426
|
}, d), {
|
|
417
|
-
variant:
|
|
418
|
-
label:
|
|
419
|
-
color:
|
|
420
|
-
error:
|
|
421
|
-
helperText:
|
|
422
|
-
placeholder: y
|
|
423
|
-
}),
|
|
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)
|
|
424
434
|
),
|
|
425
|
-
isOptionEqualToValue: (d,
|
|
426
|
-
onInputChange: (d,
|
|
427
|
-
|
|
435
|
+
isOptionEqualToValue: (d, b) => d.id === b.id,
|
|
436
|
+
onInputChange: (d, b, H) => {
|
|
437
|
+
U(b), o && o(b, H, d);
|
|
428
438
|
},
|
|
429
|
-
renderOption: (d,
|
|
439
|
+
renderOption: (d, b) => /* @__PURE__ */ ne(
|
|
430
440
|
"li",
|
|
431
|
-
|
|
432
|
-
key:
|
|
433
|
-
"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
|
|
434
444
|
}),
|
|
435
|
-
|
|
445
|
+
b.label
|
|
436
446
|
),
|
|
437
|
-
disabled:
|
|
447
|
+
disabled: D,
|
|
448
|
+
readOnly: y
|
|
438
449
|
}
|
|
439
450
|
)
|
|
440
451
|
}
|
|
@@ -443,30 +454,30 @@ const To = /MUI: The value provided to.*is invalid/i, Po = ({
|
|
|
443
454
|
if (!e)
|
|
444
455
|
return -1;
|
|
445
456
|
try {
|
|
446
|
-
const o = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"),
|
|
447
|
-
Dt.from(o, "base64").toString("utf8").split("").map(function(
|
|
448
|
-
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);
|
|
449
460
|
}).join("")
|
|
450
|
-
),
|
|
451
|
-
return
|
|
461
|
+
), s = JSON.parse(n);
|
|
462
|
+
return s != null && s.exp ? s.exp : -1;
|
|
452
463
|
} catch (t) {
|
|
453
464
|
return -1;
|
|
454
465
|
}
|
|
455
|
-
},
|
|
466
|
+
}, To = ({
|
|
456
467
|
open: e = !1,
|
|
457
468
|
closeHandler: t,
|
|
458
469
|
setAuth0ExpiryTime: o
|
|
459
470
|
}) => {
|
|
460
|
-
const { logout:
|
|
461
|
-
return /* @__PURE__ */
|
|
462
|
-
|
|
471
|
+
const { logout: n, getAccessTokenSilently: s } = ae();
|
|
472
|
+
return /* @__PURE__ */ i(
|
|
473
|
+
He,
|
|
463
474
|
{
|
|
464
475
|
isOpen: e,
|
|
465
476
|
primaryButton: {
|
|
466
477
|
text: "Continue",
|
|
467
|
-
onClick: () =>
|
|
468
|
-
const
|
|
469
|
-
o(
|
|
478
|
+
onClick: () => P(null, null, function* () {
|
|
479
|
+
const l = yield s({ cacheMode: "off" }), x = _t(l) * 1e3;
|
|
480
|
+
o(x), t();
|
|
470
481
|
}),
|
|
471
482
|
disabled: !1,
|
|
472
483
|
testId: "PreferencesDialog",
|
|
@@ -474,8 +485,8 @@ const To = /MUI: The value provided to.*is invalid/i, Po = ({
|
|
|
474
485
|
},
|
|
475
486
|
secondaryButton: {
|
|
476
487
|
text: "Log out",
|
|
477
|
-
onClick: () =>
|
|
478
|
-
|
|
488
|
+
onClick: () => P(null, null, function* () {
|
|
489
|
+
n({ logoutParams: { returnTo: `${window.location.origin}` } });
|
|
479
490
|
}),
|
|
480
491
|
disabled: !1,
|
|
481
492
|
testId: "PreferencesDialog",
|
|
@@ -484,42 +495,42 @@ const To = /MUI: The value provided to.*is invalid/i, Po = ({
|
|
|
484
495
|
onClose: t,
|
|
485
496
|
dialogTitle: "Session expiry",
|
|
486
497
|
disableCloseOnBackdropOrEscape: !0,
|
|
487
|
-
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?" })
|
|
488
499
|
}
|
|
489
500
|
);
|
|
490
501
|
};
|
|
491
|
-
function
|
|
502
|
+
function Mt(e) {
|
|
492
503
|
return "error" in e;
|
|
493
504
|
}
|
|
494
|
-
function
|
|
495
|
-
var
|
|
496
|
-
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 : "";
|
|
497
508
|
return t === "access_denied" && o.startsWith("You do not have the required authorization");
|
|
498
509
|
}
|
|
499
|
-
function
|
|
500
|
-
var
|
|
501
|
-
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 : "";
|
|
502
513
|
return t === "access_denied" && o.startsWith("User did not authorize the request");
|
|
503
514
|
}
|
|
504
|
-
function
|
|
505
|
-
var
|
|
506
|
-
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 : "";
|
|
507
518
|
return t === "access_denied" && o.match(/Script.*time.*exceeded/);
|
|
508
519
|
}
|
|
509
|
-
function
|
|
520
|
+
function $o({
|
|
510
521
|
children: e,
|
|
511
522
|
appName: t = "the app",
|
|
512
523
|
throwErrors: o = "none",
|
|
513
|
-
disableConsoleLogging:
|
|
514
|
-
onError:
|
|
524
|
+
disableConsoleLogging: n = !1,
|
|
525
|
+
onError: s = () => {
|
|
515
526
|
}
|
|
516
527
|
}) {
|
|
517
|
-
var
|
|
518
|
-
const { isAuthenticated:
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
}, [
|
|
522
|
-
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(
|
|
523
534
|
() => ({
|
|
524
535
|
appState: {
|
|
525
536
|
returnTo: `${window.location.pathname}${window.location.search}`
|
|
@@ -527,166 +538,166 @@ function No({
|
|
|
527
538
|
}),
|
|
528
539
|
[]
|
|
529
540
|
);
|
|
530
|
-
if (
|
|
531
|
-
|
|
532
|
-
}, [
|
|
533
|
-
if (
|
|
534
|
-
`Error detected in AuthGuard [isAuthenticated=${
|
|
535
|
-
|
|
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
|
|
536
547
|
), o === "all")
|
|
537
|
-
throw
|
|
538
|
-
if (
|
|
539
|
-
let
|
|
540
|
-
if (
|
|
541
|
-
|
|
542
|
-
else if (
|
|
543
|
-
|
|
544
|
-
else if (
|
|
545
|
-
|
|
546
|
-
else if (
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
} else if (o === "unknown") throw
|
|
550
|
-
return /* @__PURE__ */
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
-
/* @__PURE__ */
|
|
555
|
-
/* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */
|
|
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") {
|
|
558
|
+
const D = localStorage.getItem("auth0_redirect_count");
|
|
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: [
|
|
557
568
|
"error: ",
|
|
558
|
-
(
|
|
569
|
+
(C = r == null ? void 0 : r.error) != null ? C : "N/A"
|
|
559
570
|
] }),
|
|
560
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ m(_, { variant: "body2", children: [
|
|
561
572
|
"description: ",
|
|
562
|
-
(
|
|
573
|
+
(v = r == null ? void 0 : r.error_description) != null ? v : "N/A"
|
|
563
574
|
] })
|
|
564
575
|
] }),
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
|
|
567
|
-
/* @__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" })
|
|
568
579
|
] })
|
|
569
580
|
] });
|
|
570
|
-
} else if (o === "unknown") throw
|
|
581
|
+
} else if (o === "unknown") throw r;
|
|
571
582
|
}
|
|
572
|
-
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" });
|
|
573
584
|
}
|
|
574
|
-
const
|
|
585
|
+
const $t = {
|
|
575
586
|
autoHideDuration: 6e3,
|
|
576
587
|
anchorOrigin: { vertical: "top", horizontal: "center" },
|
|
577
588
|
// The default is false. If we prefer timer to continue when window loses
|
|
578
589
|
// focus, change to true
|
|
579
590
|
disableWindowBlurListener: !1
|
|
580
|
-
},
|
|
591
|
+
}, Lt = {
|
|
581
592
|
shouldClose: (e, t) => t !== "clickaway"
|
|
582
|
-
},
|
|
593
|
+
}, ve = {
|
|
583
594
|
message: "",
|
|
584
595
|
severity: "info",
|
|
585
596
|
variant: "standard",
|
|
586
597
|
progressIndicator: void 0
|
|
587
598
|
// Can use 'circular' or 'linear'
|
|
588
|
-
},
|
|
599
|
+
}, we = 100, ke = 2e3, Ot = 2e3, Rt = /* @__PURE__ */ (() => {
|
|
589
600
|
let e = 0;
|
|
590
601
|
return () => (e += 1, e);
|
|
591
|
-
})(),
|
|
602
|
+
})(), Ut = {
|
|
592
603
|
borderBottomLeftRadius: "0px",
|
|
593
604
|
borderBottomRightRadius: "0px"
|
|
594
|
-
},
|
|
595
|
-
function
|
|
596
|
-
var
|
|
597
|
-
overrideState: e =
|
|
598
|
-
overrideActions: t =
|
|
599
|
-
shouldClose: o =
|
|
600
|
-
children:
|
|
601
|
-
} =
|
|
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, [
|
|
602
613
|
"overrideState",
|
|
603
614
|
"overrideActions",
|
|
604
615
|
"shouldClose",
|
|
605
616
|
"children"
|
|
606
617
|
]);
|
|
607
|
-
var
|
|
608
|
-
const [{ open:
|
|
609
|
-
|
|
610
|
-
}, []),
|
|
611
|
-
|
|
612
|
-
`SaladBarProvider: MAX_QUEUE_LENGTH (${
|
|
613
|
-
),
|
|
614
|
-
const
|
|
615
|
-
key:
|
|
616
|
-
}),
|
|
617
|
-
return
|
|
618
|
-
}, []),
|
|
619
|
-
const
|
|
620
|
-
if (
|
|
621
|
-
return
|
|
622
|
-
}, I = (
|
|
623
|
-
o(
|
|
624
|
-
},
|
|
625
|
-
},
|
|
626
|
-
|
|
627
|
-
},
|
|
628
|
-
"autoHideDuration" in
|
|
629
|
-
const
|
|
630
|
-
open:
|
|
631
|
-
setOpen:
|
|
632
|
-
enqueueNotification:
|
|
633
|
-
enqueueSuccessNotification:
|
|
634
|
-
enqueueInfoNotification:
|
|
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,
|
|
645
|
+
enqueueInfoNotification: D,
|
|
635
646
|
enqueueWarningNotification: f,
|
|
636
|
-
enqueueErrorNotification:
|
|
647
|
+
enqueueErrorNotification: k,
|
|
637
648
|
removeNotification: y
|
|
638
649
|
}, e), t);
|
|
639
|
-
return /* @__PURE__ */
|
|
640
|
-
|
|
641
|
-
/* @__PURE__ */
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
open:
|
|
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,
|
|
645
656
|
onClose: I,
|
|
646
657
|
TransitionProps: {
|
|
647
|
-
onExited:
|
|
648
|
-
onExit:
|
|
658
|
+
onExited: N,
|
|
659
|
+
onExit: V
|
|
649
660
|
},
|
|
650
|
-
sx: { zIndex:
|
|
651
|
-
children: /* @__PURE__ */
|
|
652
|
-
/* @__PURE__ */
|
|
653
|
-
|
|
661
|
+
sx: { zIndex: Ot },
|
|
662
|
+
children: /* @__PURE__ */ m("div", { children: [
|
|
663
|
+
/* @__PURE__ */ i(
|
|
664
|
+
dt,
|
|
654
665
|
{
|
|
655
|
-
onClose: (
|
|
656
|
-
severity:
|
|
666
|
+
onClose: (S) => I(S, "closeAlert"),
|
|
667
|
+
severity: E.severity,
|
|
657
668
|
variant: "filled",
|
|
658
|
-
icon:
|
|
659
|
-
style:
|
|
660
|
-
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
|
|
661
672
|
}
|
|
662
673
|
),
|
|
663
|
-
|
|
674
|
+
E.progressIndicator === "linear" && /* @__PURE__ */ i(Ne, { color: "primary" })
|
|
664
675
|
] })
|
|
665
676
|
})
|
|
666
677
|
)
|
|
667
678
|
] });
|
|
668
679
|
}
|
|
669
|
-
class
|
|
680
|
+
class Ge extends Error {
|
|
670
681
|
}
|
|
671
|
-
|
|
672
|
-
function
|
|
673
|
-
const e =
|
|
682
|
+
pe(Ge, "errorName", "ContextError");
|
|
683
|
+
function qt() {
|
|
684
|
+
const e = rt(ze);
|
|
674
685
|
if (e === null)
|
|
675
|
-
throw new
|
|
686
|
+
throw new Ge("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
|
|
676
687
|
return e;
|
|
677
688
|
}
|
|
678
|
-
const
|
|
679
|
-
(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 }) }))
|
|
680
691
|
), Ve = "domainCode";
|
|
681
692
|
var _e;
|
|
682
|
-
const De =
|
|
693
|
+
const De = $(
|
|
683
694
|
JSON.parse((_e = localStorage.getItem(Ve)) != null ? _e : '{"domainCode": ""}').domainCode
|
|
684
|
-
),
|
|
695
|
+
), zt = $(
|
|
685
696
|
(e) => e(De),
|
|
686
697
|
(e, t, o) => {
|
|
687
698
|
t(De, o), localStorage.setItem(Ve, JSON.stringify({ domainCode: o }));
|
|
688
699
|
}
|
|
689
|
-
),
|
|
700
|
+
), Gt = {
|
|
690
701
|
act: "ACT",
|
|
691
702
|
nsw: "NSW",
|
|
692
703
|
nt: "NT",
|
|
@@ -698,65 +709,65 @@ const De = M(
|
|
|
698
709
|
ag: "AG",
|
|
699
710
|
fedmps: "FedMPs",
|
|
700
711
|
"": ""
|
|
701
|
-
},
|
|
712
|
+
}, Ke = (e) => {
|
|
702
713
|
var t;
|
|
703
|
-
return e === null ? "N/A" : (t =
|
|
704
|
-
},
|
|
714
|
+
return e === null ? "N/A" : (t = Gt[e]) != null ? t : "";
|
|
715
|
+
}, Oo = ({
|
|
705
716
|
isLoading: e,
|
|
706
717
|
isOpen: t,
|
|
707
718
|
onClose: o,
|
|
708
|
-
onDomainChange:
|
|
709
|
-
domainOptions:
|
|
710
|
-
applicationName:
|
|
711
|
-
handleLogout:
|
|
719
|
+
onDomainChange: n,
|
|
720
|
+
domainOptions: s,
|
|
721
|
+
applicationName: a,
|
|
722
|
+
handleLogout: p
|
|
712
723
|
}) => {
|
|
713
|
-
const [
|
|
714
|
-
|
|
715
|
-
}), f = () =>
|
|
716
|
-
|
|
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();
|
|
717
728
|
});
|
|
718
|
-
let
|
|
719
|
-
return
|
|
720
|
-
|
|
729
|
+
let k;
|
|
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,
|
|
721
732
|
{
|
|
722
733
|
isOpen: t,
|
|
723
734
|
dialogTitle: "Select an organisation",
|
|
724
735
|
primaryButton: {
|
|
725
736
|
text: "Confirm",
|
|
726
|
-
onClick:
|
|
727
|
-
disabled: !
|
|
737
|
+
onClick: D,
|
|
738
|
+
disabled: !l || v || g,
|
|
728
739
|
buttonColor: "primary"
|
|
729
740
|
},
|
|
730
741
|
secondaryButton: {
|
|
731
|
-
text:
|
|
742
|
+
text: w ? "Logout" : "Cancel",
|
|
732
743
|
onClick: f
|
|
733
744
|
},
|
|
734
|
-
onClose:
|
|
745
|
+
onClose: w ? () => {
|
|
735
746
|
} : o,
|
|
736
747
|
children: [
|
|
737
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ m(_, { marginBottom: 2, children: [
|
|
738
749
|
"Select the default organisation that you want to use with the ",
|
|
739
|
-
|
|
750
|
+
a,
|
|
740
751
|
"."
|
|
741
752
|
] }),
|
|
742
|
-
/* @__PURE__ */
|
|
743
|
-
|
|
753
|
+
/* @__PURE__ */ i(
|
|
754
|
+
ie,
|
|
744
755
|
{
|
|
745
756
|
loading: e,
|
|
746
757
|
multiple: !1,
|
|
747
758
|
disableClearable: !1,
|
|
748
|
-
value:
|
|
749
|
-
onChange: (y, I) =>
|
|
750
|
-
getOptionLabel:
|
|
751
|
-
options: [...
|
|
752
|
-
renderInput: (y) => /* @__PURE__ */
|
|
753
|
-
|
|
754
|
-
|
|
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), {
|
|
755
766
|
variant: "filled",
|
|
756
767
|
label: "Select organisation",
|
|
757
|
-
InputProps:
|
|
758
|
-
endAdornment: /* @__PURE__ */
|
|
759
|
-
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,
|
|
760
771
|
y.InputProps.endAdornment
|
|
761
772
|
] })
|
|
762
773
|
})
|
|
@@ -764,36 +775,36 @@ const De = M(
|
|
|
764
775
|
)
|
|
765
776
|
}
|
|
766
777
|
),
|
|
767
|
-
|
|
778
|
+
k && /* @__PURE__ */ i(ut, { error: !0, children: k })
|
|
768
779
|
]
|
|
769
780
|
}
|
|
770
781
|
);
|
|
771
|
-
},
|
|
772
|
-
const e =
|
|
773
|
-
return
|
|
774
|
-
}, Vt = 64,
|
|
775
|
-
function
|
|
776
|
-
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" });
|
|
777
788
|
}
|
|
778
|
-
const
|
|
779
|
-
root: `${
|
|
780
|
-
menuButton: `${
|
|
781
|
-
hide: `${
|
|
782
|
-
content: `${
|
|
789
|
+
const Y = "Navbar", K = {
|
|
790
|
+
root: `${Y}-root`,
|
|
791
|
+
menuButton: `${Y}-menuButton`,
|
|
792
|
+
hide: `${Y}-hide`,
|
|
793
|
+
content: `${Y}-content`
|
|
783
794
|
// userInfoHolder: `${PREFIX}-userInfoHolder`,
|
|
784
795
|
// settings: `${PREFIX}-settings`,
|
|
785
796
|
// pieChartIcon: `${PREFIX}-pieChartIcon`,
|
|
786
|
-
},
|
|
787
|
-
[`&.${
|
|
797
|
+
}, to = Ue(M, { name: "NavBar" })(({ theme: e }) => ({
|
|
798
|
+
[`&.${K.root}`]: {
|
|
788
799
|
display: "flex"
|
|
789
800
|
},
|
|
790
|
-
[`& .${
|
|
801
|
+
[`& .${K.menuButton}`]: {
|
|
791
802
|
marginRight: 36
|
|
792
803
|
},
|
|
793
|
-
[`& .${
|
|
804
|
+
[`& .${K.hide}`]: {
|
|
794
805
|
display: "none"
|
|
795
806
|
},
|
|
796
|
-
[`& .${
|
|
807
|
+
[`& .${K.content}`]: {
|
|
797
808
|
flexGrow: 1,
|
|
798
809
|
padding: e.spacing(3)
|
|
799
810
|
}
|
|
@@ -805,11 +816,11 @@ const X = "Navbar", G = {
|
|
|
805
816
|
})), q = (e, t, o) => e.transitions.create(t, {
|
|
806
817
|
easing: e.transitions.easing.sharp,
|
|
807
818
|
duration: o === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
|
|
808
|
-
}),
|
|
809
|
-
const t =
|
|
810
|
-
return /* @__PURE__ */
|
|
811
|
-
|
|
812
|
-
|
|
819
|
+
}), oo = (e) => {
|
|
820
|
+
const t = Z();
|
|
821
|
+
return /* @__PURE__ */ i(
|
|
822
|
+
ft,
|
|
823
|
+
u({
|
|
813
824
|
easing: t.transitions.easing.sharp,
|
|
814
825
|
timeout: {
|
|
815
826
|
enter: t.transitions.duration.enteringScreen,
|
|
@@ -817,7 +828,7 @@ const X = "Navbar", G = {
|
|
|
817
828
|
}
|
|
818
829
|
}, e)
|
|
819
830
|
);
|
|
820
|
-
},
|
|
831
|
+
}, Ye = (e) => {
|
|
821
832
|
var t, o;
|
|
822
833
|
return {
|
|
823
834
|
overflowX: "hidden",
|
|
@@ -825,104 +836,104 @@ const X = "Navbar", G = {
|
|
|
825
836
|
backgroundColor: (o = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? o : "white"
|
|
826
837
|
// Provide default so tests don't need to wrap theme provider
|
|
827
838
|
};
|
|
828
|
-
},
|
|
839
|
+
}, be = (e, t) => u({
|
|
829
840
|
width: t,
|
|
830
841
|
transition: q(e, "width", "entering")
|
|
831
|
-
},
|
|
842
|
+
}, Ye(e)), Fe = (e, t) => u({
|
|
832
843
|
width: t,
|
|
833
844
|
transition: q(e, "width", "leaving")
|
|
834
|
-
},
|
|
845
|
+
}, Ye(e)), no = Ue(ht, {
|
|
835
846
|
shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
|
|
836
|
-
})(({ theme: e, open: t, widthOpen: o, widthClosed:
|
|
847
|
+
})(({ theme: e, open: t, widthOpen: o, widthClosed: n, isSmallScreen: s }) => u(u({
|
|
837
848
|
flexShrink: 0,
|
|
838
849
|
whiteSpace: "nowrap",
|
|
839
850
|
boxSizing: "border-box",
|
|
840
851
|
display: "flex",
|
|
841
852
|
flexDirection: "column"
|
|
842
|
-
}, t &&
|
|
853
|
+
}, t && F(u({}, be(e, o)), {
|
|
843
854
|
backgroundColor: "",
|
|
844
|
-
"& .MuiDrawer-paper":
|
|
845
|
-
})), !t &&
|
|
855
|
+
"& .MuiDrawer-paper": be(e, o)
|
|
856
|
+
})), !t && F(u({}, Fe(e, s ? o : n)), {
|
|
846
857
|
backgroundColor: "",
|
|
847
|
-
"& .MuiDrawer-paper":
|
|
858
|
+
"& .MuiDrawer-paper": Fe(e, s ? o : n)
|
|
848
859
|
})));
|
|
849
|
-
function
|
|
860
|
+
function Qe(e) {
|
|
850
861
|
return e.replace(
|
|
851
862
|
/(^|-)([a-z])/g,
|
|
852
|
-
(t, o,
|
|
863
|
+
(t, o, n) => o === "-" ? " " + n.toUpperCase() : n.toUpperCase()
|
|
853
864
|
);
|
|
854
865
|
}
|
|
855
|
-
function
|
|
856
|
-
var
|
|
866
|
+
function Ro(e, t, o, n) {
|
|
867
|
+
var p;
|
|
857
868
|
if (!e) return "None";
|
|
858
|
-
const
|
|
859
|
-
([
|
|
869
|
+
const a = Object.entries(e).filter(
|
|
870
|
+
([r, c]) => r.startsWith("https://greens.org.au/roles/") && c.includes(t)
|
|
860
871
|
).map(
|
|
861
|
-
([
|
|
862
|
-
var
|
|
863
|
-
return
|
|
872
|
+
([r]) => {
|
|
873
|
+
var c;
|
|
874
|
+
return Qe((c = r.split("/").at(-1)) != null ? c : "");
|
|
864
875
|
}
|
|
865
876
|
);
|
|
866
|
-
return (
|
|
867
|
-
(
|
|
868
|
-
)) != null ?
|
|
877
|
+
return (p = n.find(
|
|
878
|
+
(r) => o[r].some((c) => a.includes(c))
|
|
879
|
+
)) != null ? p : "None";
|
|
869
880
|
}
|
|
870
|
-
const
|
|
881
|
+
const Uo = (e) => {
|
|
871
882
|
const { getIdTokenClaims: t, user: o } = ae();
|
|
872
|
-
return
|
|
883
|
+
return Oe({
|
|
873
884
|
queryKey: ["availableDomains", o == null ? void 0 : o.sub],
|
|
874
|
-
queryFn: () =>
|
|
875
|
-
const
|
|
876
|
-
return
|
|
877
|
-
var
|
|
878
|
-
const
|
|
879
|
-
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])];
|
|
880
891
|
}, []) : [];
|
|
881
892
|
})
|
|
882
893
|
});
|
|
883
|
-
},
|
|
894
|
+
}, Bo = (e) => Object.values(e).reduce(
|
|
884
895
|
(t, o) => [.../* @__PURE__ */ new Set([...t, ...o])],
|
|
885
896
|
[]
|
|
886
|
-
),
|
|
897
|
+
), Q = {
|
|
887
898
|
log: console.warn.bind(console),
|
|
888
899
|
error: console.error.bind(console),
|
|
889
900
|
warn: console.warn.bind(console),
|
|
890
901
|
info: console.info.bind(console),
|
|
891
902
|
debug: console.debug.bind(console)
|
|
892
903
|
};
|
|
893
|
-
function
|
|
904
|
+
function Ho(e, t) {
|
|
894
905
|
console[e] = (...o) => {
|
|
895
|
-
for (const
|
|
896
|
-
if (typeof
|
|
897
|
-
if (
|
|
898
|
-
} else if (
|
|
899
|
-
for (const
|
|
900
|
-
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))
|
|
901
912
|
return;
|
|
902
913
|
}
|
|
903
|
-
|
|
914
|
+
Q[e](o);
|
|
904
915
|
};
|
|
905
916
|
}
|
|
906
|
-
function
|
|
917
|
+
function Wo(e) {
|
|
907
918
|
if (e)
|
|
908
|
-
console[e] =
|
|
919
|
+
console[e] = Q[e];
|
|
909
920
|
else
|
|
910
|
-
for (const t of Object.keys(
|
|
911
|
-
console[t] =
|
|
921
|
+
for (const t of Object.keys(Q))
|
|
922
|
+
console[t] = Q[t];
|
|
912
923
|
}
|
|
913
|
-
function
|
|
924
|
+
function io(e) {
|
|
914
925
|
let t = 0;
|
|
915
|
-
for (let o = 0,
|
|
916
|
-
const
|
|
917
|
-
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;
|
|
918
929
|
}
|
|
919
930
|
return t;
|
|
920
931
|
}
|
|
921
|
-
const
|
|
922
|
-
function
|
|
923
|
-
const
|
|
924
|
-
return /* @__PURE__ */
|
|
925
|
-
|
|
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,
|
|
926
937
|
{
|
|
927
938
|
sx: {
|
|
928
939
|
paddingTop: 3,
|
|
@@ -932,91 +943,91 @@ function io({ user: e, domainCode: t, open: o, useNewAvatar: i = !1 }) {
|
|
|
932
943
|
gap: "0.5rem"
|
|
933
944
|
},
|
|
934
945
|
children: [
|
|
935
|
-
!
|
|
936
|
-
|
|
946
|
+
!n && /* @__PURE__ */ i(
|
|
947
|
+
M,
|
|
937
948
|
{
|
|
938
949
|
sx: {
|
|
939
950
|
width: o ? "5rem" : "2rem",
|
|
940
|
-
transition: o ? q(
|
|
951
|
+
transition: o ? q(s, ["width", "height"], "entering") : q(s, ["width", "height"], "leaving"),
|
|
941
952
|
aspectRatio: 1
|
|
942
953
|
},
|
|
943
|
-
children: e != null && e.name ? /* @__PURE__ */
|
|
944
|
-
|
|
954
|
+
children: e != null && e.name ? /* @__PURE__ */ i(O, { children: /* @__PURE__ */ i(
|
|
955
|
+
me,
|
|
945
956
|
{
|
|
946
957
|
src: e == null ? void 0 : e.picture,
|
|
947
958
|
sx: {
|
|
948
959
|
width: "100%",
|
|
949
960
|
height: "100%",
|
|
950
|
-
bgcolor:
|
|
961
|
+
bgcolor: Ee[Math.abs(io(e == null ? void 0 : e.name)) % Ee.length]
|
|
951
962
|
},
|
|
952
|
-
children:
|
|
963
|
+
children: Ie(e == null ? void 0 : e.name)
|
|
953
964
|
}
|
|
954
|
-
) }) : /* @__PURE__ */
|
|
965
|
+
) }) : /* @__PURE__ */ i(me, { sx: { width: "100%", height: "100%" } })
|
|
955
966
|
}
|
|
956
967
|
),
|
|
957
|
-
|
|
958
|
-
|
|
968
|
+
n && /* @__PURE__ */ i(
|
|
969
|
+
M,
|
|
959
970
|
{
|
|
960
971
|
sx: {
|
|
961
972
|
width: o ? "5rem" : "2rem",
|
|
962
|
-
transition: o ? q(
|
|
973
|
+
transition: o ? q(s, ["width", "height"], "entering") : q(s, ["width", "height"], "leaving"),
|
|
963
974
|
aspectRatio: 1
|
|
964
975
|
},
|
|
965
|
-
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: [
|
|
966
977
|
" ",
|
|
967
|
-
|
|
978
|
+
Ie(e == null ? void 0 : e.name),
|
|
968
979
|
" ",
|
|
969
980
|
"ab"
|
|
970
|
-
] }) }) : /* @__PURE__ */
|
|
981
|
+
] }) }) : /* @__PURE__ */ i(Se, {})
|
|
971
982
|
}
|
|
972
983
|
),
|
|
973
|
-
/* @__PURE__ */
|
|
974
|
-
e != null && e.name ? /* @__PURE__ */
|
|
975
|
-
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%" })
|
|
976
987
|
] }) }) })
|
|
977
988
|
]
|
|
978
989
|
}
|
|
979
990
|
);
|
|
980
991
|
}
|
|
981
|
-
function
|
|
992
|
+
function so({
|
|
982
993
|
open: e,
|
|
983
994
|
widthClosed: t,
|
|
984
995
|
widthOpen: o,
|
|
985
|
-
"data-testid":
|
|
986
|
-
top:
|
|
987
|
-
middle:
|
|
988
|
-
bottom:
|
|
989
|
-
user:
|
|
990
|
-
domainCode:
|
|
991
|
-
useNewAvatar:
|
|
996
|
+
"data-testid": n,
|
|
997
|
+
top: s,
|
|
998
|
+
middle: a,
|
|
999
|
+
bottom: p,
|
|
1000
|
+
user: r,
|
|
1001
|
+
domainCode: c,
|
|
1002
|
+
useNewAvatar: l = !1
|
|
992
1003
|
}) {
|
|
993
|
-
const
|
|
994
|
-
return /* @__PURE__ */
|
|
995
|
-
|
|
1004
|
+
const x = Xe(), C = Re(J);
|
|
1005
|
+
return /* @__PURE__ */ i(to, { className: K.root, "data-testid": n, children: /* @__PURE__ */ m(
|
|
1006
|
+
no,
|
|
996
1007
|
{
|
|
997
1008
|
open: e,
|
|
998
1009
|
widthOpen: o,
|
|
999
1010
|
widthClosed: t,
|
|
1000
1011
|
anchor: "left",
|
|
1001
|
-
variant:
|
|
1012
|
+
variant: x ? "temporary" : "permanent",
|
|
1002
1013
|
PaperProps: {
|
|
1003
1014
|
component: "nav"
|
|
1004
1015
|
},
|
|
1005
1016
|
onClose: () => {
|
|
1006
|
-
|
|
1017
|
+
C(!1);
|
|
1007
1018
|
},
|
|
1008
|
-
isSmallScreen:
|
|
1019
|
+
isSmallScreen: x,
|
|
1009
1020
|
children: [
|
|
1010
|
-
!
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
/* @__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" } })
|
|
1014
1025
|
] }),
|
|
1015
|
-
/* @__PURE__ */
|
|
1016
|
-
/* @__PURE__ */
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
|
|
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 })
|
|
1020
1031
|
] })
|
|
1021
1032
|
]
|
|
1022
1033
|
}
|
|
@@ -1026,18 +1037,18 @@ function ao({
|
|
|
1026
1037
|
children: e,
|
|
1027
1038
|
topBarHeight: t,
|
|
1028
1039
|
maxWidth: o = !1,
|
|
1029
|
-
noPadding:
|
|
1040
|
+
noPadding: n
|
|
1030
1041
|
}) {
|
|
1031
|
-
return /* @__PURE__ */
|
|
1032
|
-
|
|
1042
|
+
return /* @__PURE__ */ i(
|
|
1043
|
+
M,
|
|
1033
1044
|
{
|
|
1034
1045
|
sx: {
|
|
1035
1046
|
overflow: "auto",
|
|
1036
1047
|
height: `calc(100vh - ${t}px)`,
|
|
1037
1048
|
flexGrow: 1
|
|
1038
1049
|
},
|
|
1039
|
-
children:
|
|
1040
|
-
|
|
1050
|
+
children: n ? /* @__PURE__ */ i(M, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ i(
|
|
1051
|
+
xt,
|
|
1041
1052
|
{
|
|
1042
1053
|
component: "main",
|
|
1043
1054
|
id: "main-content",
|
|
@@ -1049,18 +1060,18 @@ function ao({
|
|
|
1049
1060
|
}
|
|
1050
1061
|
);
|
|
1051
1062
|
}
|
|
1052
|
-
const
|
|
1053
|
-
titleText: `${
|
|
1063
|
+
const lo = "TopBar", co = {
|
|
1064
|
+
titleText: `${lo}-titleText`
|
|
1054
1065
|
};
|
|
1055
|
-
function
|
|
1066
|
+
function uo({
|
|
1056
1067
|
titleText: e = "",
|
|
1057
1068
|
height: t,
|
|
1058
1069
|
"data-testid": o,
|
|
1059
|
-
middle:
|
|
1070
|
+
middle: n
|
|
1060
1071
|
}) {
|
|
1061
|
-
const
|
|
1062
|
-
return /* @__PURE__ */
|
|
1063
|
-
|
|
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,
|
|
1064
1075
|
{
|
|
1065
1076
|
square: !0,
|
|
1066
1077
|
elevation: 0,
|
|
@@ -1074,85 +1085,85 @@ function co({
|
|
|
1074
1085
|
gap: 2,
|
|
1075
1086
|
flexShrink: 0,
|
|
1076
1087
|
height: t,
|
|
1077
|
-
zIndex:
|
|
1088
|
+
zIndex: r ? 0 : p.zIndex.drawer + 101
|
|
1078
1089
|
},
|
|
1079
1090
|
children: [
|
|
1080
|
-
/* @__PURE__ */
|
|
1081
|
-
|
|
1091
|
+
/* @__PURE__ */ i(
|
|
1092
|
+
At,
|
|
1082
1093
|
{
|
|
1083
1094
|
size: "medium",
|
|
1084
1095
|
color: "inherit",
|
|
1085
1096
|
sx: { padding: 1.5, marginLeft: "12px" },
|
|
1086
|
-
onClick:
|
|
1087
|
-
children: /* @__PURE__ */
|
|
1097
|
+
onClick: a,
|
|
1098
|
+
children: /* @__PURE__ */ i(vt, { fontSize: "medium" })
|
|
1088
1099
|
}
|
|
1089
1100
|
),
|
|
1090
|
-
/* @__PURE__ */
|
|
1091
|
-
|
|
1101
|
+
/* @__PURE__ */ i(_, { className: co.titleText, variant: "h6", component: "h1", children: e }),
|
|
1102
|
+
n
|
|
1092
1103
|
]
|
|
1093
1104
|
}
|
|
1094
1105
|
) });
|
|
1095
1106
|
}
|
|
1096
|
-
function
|
|
1107
|
+
function qo({
|
|
1097
1108
|
children: e,
|
|
1098
1109
|
initialTitleText: t,
|
|
1099
1110
|
initialNavBarOpen: o,
|
|
1100
|
-
pageContainerProps:
|
|
1101
|
-
pageContentDataTestId:
|
|
1102
|
-
topBarDataTestId:
|
|
1103
|
-
navBarDataTestId:
|
|
1104
|
-
navBarMiddle:
|
|
1105
|
-
navBarBottom:
|
|
1106
|
-
user:
|
|
1107
|
-
domainCode:
|
|
1108
|
-
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
|
|
1109
1120
|
}) {
|
|
1110
|
-
|
|
1111
|
-
[
|
|
1112
|
-
[
|
|
1121
|
+
Et([
|
|
1122
|
+
[J, o != null ? o : !0],
|
|
1123
|
+
[ye, t != null ? t : ""]
|
|
1113
1124
|
]);
|
|
1114
|
-
const
|
|
1115
|
-
return /* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1117
|
-
/* @__PURE__ */
|
|
1118
|
-
|
|
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,
|
|
1119
1130
|
{
|
|
1120
|
-
titleText:
|
|
1121
|
-
"data-testid":
|
|
1131
|
+
titleText: D,
|
|
1132
|
+
"data-testid": a,
|
|
1122
1133
|
height: f,
|
|
1123
|
-
middle:
|
|
1134
|
+
middle: k
|
|
1124
1135
|
}
|
|
1125
1136
|
),
|
|
1126
|
-
/* @__PURE__ */
|
|
1127
|
-
/* @__PURE__ */
|
|
1128
|
-
|
|
1137
|
+
/* @__PURE__ */ m(Ce, { sx: { display: "flex" }, children: [
|
|
1138
|
+
/* @__PURE__ */ i(
|
|
1139
|
+
so,
|
|
1129
1140
|
{
|
|
1130
|
-
open:
|
|
1141
|
+
open: v,
|
|
1131
1142
|
top: y,
|
|
1132
|
-
middle:
|
|
1133
|
-
bottom:
|
|
1134
|
-
user:
|
|
1135
|
-
domainCode:
|
|
1136
|
-
widthOpen:
|
|
1137
|
-
widthClosed:
|
|
1143
|
+
middle: r,
|
|
1144
|
+
bottom: c,
|
|
1145
|
+
user: l,
|
|
1146
|
+
domainCode: x,
|
|
1147
|
+
widthOpen: g,
|
|
1148
|
+
widthClosed: w,
|
|
1138
1149
|
offsetTop: f,
|
|
1139
|
-
"data-testid":
|
|
1140
|
-
useNewAvatar:
|
|
1150
|
+
"data-testid": p,
|
|
1151
|
+
useNewAvatar: C
|
|
1141
1152
|
}
|
|
1142
1153
|
),
|
|
1143
|
-
/* @__PURE__ */
|
|
1154
|
+
/* @__PURE__ */ i(
|
|
1144
1155
|
ao,
|
|
1145
|
-
|
|
1146
|
-
"data-testid":
|
|
1156
|
+
F(u({
|
|
1157
|
+
"data-testid": s,
|
|
1147
1158
|
topBarHeight: f
|
|
1148
|
-
},
|
|
1159
|
+
}, n), {
|
|
1149
1160
|
children: e
|
|
1150
1161
|
})
|
|
1151
1162
|
)
|
|
1152
1163
|
] })
|
|
1153
1164
|
] });
|
|
1154
1165
|
}
|
|
1155
|
-
const
|
|
1166
|
+
const zo = Be({
|
|
1156
1167
|
palette: {
|
|
1157
1168
|
primary: {
|
|
1158
1169
|
dark: "#00A651",
|
|
@@ -1203,7 +1214,7 @@ const qo = Ue({
|
|
|
1203
1214
|
navBar: {
|
|
1204
1215
|
backgroundColor: "#E8E8E8"
|
|
1205
1216
|
}
|
|
1206
|
-
}),
|
|
1217
|
+
}), Go = Be({
|
|
1207
1218
|
palette: {
|
|
1208
1219
|
primary: {
|
|
1209
1220
|
main: "#007236",
|
|
@@ -1257,18 +1268,18 @@ const qo = Ue({
|
|
|
1257
1268
|
styleOverrides: {
|
|
1258
1269
|
root: ({ theme: e }) => ({
|
|
1259
1270
|
"&.Mui-selected": {
|
|
1260
|
-
backgroundColor:
|
|
1271
|
+
backgroundColor: oe(
|
|
1261
1272
|
e.palette.secondary.main,
|
|
1262
1273
|
e.palette.action.selectedOpacity
|
|
1263
1274
|
),
|
|
1264
1275
|
"&:hover": {
|
|
1265
|
-
backgroundColor:
|
|
1276
|
+
backgroundColor: oe(
|
|
1266
1277
|
e.palette.secondary.main,
|
|
1267
1278
|
e.palette.action.selectedOpacity
|
|
1268
1279
|
)
|
|
1269
1280
|
},
|
|
1270
1281
|
"&.Mui-focusVisible": {
|
|
1271
|
-
backgroundColor:
|
|
1282
|
+
backgroundColor: oe(
|
|
1272
1283
|
e.palette.secondary.main,
|
|
1273
1284
|
e.palette.action.focusOpacity
|
|
1274
1285
|
)
|
|
@@ -1299,39 +1310,39 @@ const qo = Ue({
|
|
|
1299
1310
|
}
|
|
1300
1311
|
});
|
|
1301
1312
|
export {
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
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,
|
|
1309
1320
|
_o as ExampleComponent,
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
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,
|
|
1318
1329
|
_t as getAuth0Expiry,
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
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
|
|
1336
1347
|
};
|
|
1337
1348
|
//# sourceMappingURL=index.js.map
|