@australiangreens/ag-internal-components 0.0.83 → 0.0.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,25 +1,25 @@
1
- var Ft = Object.defineProperty, Pt = Object.defineProperties;
2
- var Nt = Object.getOwnPropertyDescriptors;
1
+ var Pt = Object.defineProperty, Nt = Object.defineProperties;
2
+ var Lt = Object.getOwnPropertyDescriptors;
3
3
  var j = Object.getOwnPropertySymbols;
4
- var Ie = Object.prototype.hasOwnProperty, Te = Object.prototype.propertyIsEnumerable;
5
- var ue = (e, t, n) => t in e ? Ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, s = (e, t) => {
4
+ var Te = Object.prototype.hasOwnProperty, Oe = Object.prototype.propertyIsEnumerable;
5
+ var pe = (e, t, n) => t in e ? Pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, s = (e, t) => {
6
6
  for (var n in t || (t = {}))
7
- Ie.call(t, n) && ue(e, n, t[n]);
7
+ Te.call(t, n) && pe(e, n, t[n]);
8
8
  if (j)
9
9
  for (var n of j(t))
10
- Te.call(t, n) && ue(e, n, t[n]);
10
+ Oe.call(t, n) && pe(e, n, t[n]);
11
11
  return e;
12
- }, S = (e, t) => Pt(e, Nt(t));
13
- var Oe = (e, t) => {
12
+ }, S = (e, t) => Nt(e, Lt(t));
13
+ var Ee = (e, t) => {
14
14
  var n = {};
15
15
  for (var i in e)
16
- Ie.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
16
+ Te.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
17
17
  if (e != null && j)
18
18
  for (var i of j(e))
19
- t.indexOf(i) < 0 && Te.call(e, i) && (n[i] = e[i]);
19
+ t.indexOf(i) < 0 && Oe.call(e, i) && (n[i] = e[i]);
20
20
  return n;
21
21
  };
22
- var Ee = (e, t, n) => (ue(e, typeof t != "symbol" ? t + "" : t, n), n);
22
+ var Be = (e, t, n) => (pe(e, typeof t != "symbol" ? t + "" : t, n), n);
23
23
  var P = (e, t, n) => new Promise((i, r) => {
24
24
  var a = (l) => {
25
25
  try {
@@ -37,22 +37,22 @@ var P = (e, t, n) => new Promise((i, r) => {
37
37
  d((n = n.apply(e, t)).next());
38
38
  });
39
39
  import { jsxs as p, Fragment as _, jsx as o } from "react/jsx-runtime";
40
- import { useState as E, createContext as Xe, useCallback as ne, useContext as Qe, createElement as me, useEffect as oe, useRef as pe } from "react";
41
- import { Typography as F, Button as ie, Paper as Ye, Box as $, Drawer as xe, Dialog as Ke, DialogTitle as Je, DialogContent as Ze, DialogActions as je, Autocomplete as ve, TextField as we, CircularProgress as Ae, Chip as Lt, Tooltip as _t, Stack as Mt, styled as be, IconButton as Q, Container as et, useTheme as ae, useMediaQuery as Rt, Collapse as Ht, Avatar as Be, Fade as Wt, Skeleton as Fe, Toolbar as zt, Divider as Pe, CssBaseline as Ut, Snackbar as Gt, Alert as Vt, LinearProgress as qt, FormHelperText as Xt } from "@mui/material";
40
+ import { useState as E, createContext as Qe, useCallback as ne, useContext as Ye, createElement as Ce, useEffect as oe, useRef as he } from "react";
41
+ import { Typography as F, Button as ie, Paper as Ke, Box as I, Drawer as ve, Dialog as Je, LinearProgress as Ze, DialogTitle as je, DialogContent as et, DialogActions as tt, Autocomplete as we, TextField as Ae, CircularProgress as be, Chip as _t, Tooltip as Mt, Stack as Rt, styled as Se, IconButton as Q, Container as nt, useTheme as ae, useMediaQuery as Ht, Collapse as Wt, Avatar as Fe, Fade as zt, Skeleton as Pe, Toolbar as Ut, Divider as Ne, CssBaseline as Gt, Snackbar as Vt, Alert as qt, FormHelperText as Xt } from "@mui/material";
42
42
  import Qt from "@mui/material/CssBaseline";
43
- import { styled as W, createTheme as tt, alpha as he } from "@mui/material/styles";
43
+ import { styled as R, createTheme as ot, alpha as ge } from "@mui/material/styles";
44
44
  import { AgError as Yt } from "@australiangreens/ag-error";
45
45
  import { createHelper as K } from "souvlaki";
46
- import nt from "@mui/material/List";
47
- import { Cancel as Kt, ArrowDropDown as Jt, ArrowForward as ot, ArrowBack as it, ViewHeadline as Zt } from "@mui/icons-material";
46
+ import it from "@mui/material/List";
47
+ import { Cancel as Kt, ArrowDropDown as Jt, ArrowForward as rt, ArrowBack as at, ViewHeadline as Zt } from "@mui/icons-material";
48
48
  import jt from "autosuggest-highlight/match";
49
49
  import en from "autosuggest-highlight/parse";
50
50
  import { useQuery as tn, QueryClient as nn, QueryClientProvider as on } from "@tanstack/react-query";
51
- import { useAuth0 as rt } from "@auth0/auth0-react";
51
+ import { useAuth0 as st } from "@auth0/auth0-react";
52
52
  import { Buffer as rn } from "buffer";
53
53
  import an from "@mui/material/Skeleton";
54
- import { atom as M, useSetAtom as at, useAtomValue as Ne, useAtom as V, getDefaultStore as sn, Provider as st } from "jotai";
55
- import { useHydrateAtoms as lt } from "jotai/utils";
54
+ import { atom as M, useSetAtom as lt, useAtomValue as Le, useAtom as V, getDefaultStore as sn, Provider as ct } from "jotai";
55
+ import { useHydrateAtoms as dt } from "jotai/utils";
56
56
  function Do({ text: e }) {
57
57
  const [t, n] = E(0);
58
58
  return /* @__PURE__ */ p(_, { children: [
@@ -71,13 +71,13 @@ function Do({ text: e }) {
71
71
  "This is some text: ",
72
72
  /* @__PURE__ */ o("span", { children: e })
73
73
  ] }),
74
- /* @__PURE__ */ p(Ye, { children: [
74
+ /* @__PURE__ */ p(Ke, { children: [
75
75
  "This number will incremember when button pressed: ",
76
76
  t
77
77
  ] })
78
78
  ] });
79
79
  }
80
- const ct = 330, dt = 73, U = "Navbar", q = {
80
+ const ut = 330, pt = 73, U = "Navbar", q = {
81
81
  root: `${U}-root`,
82
82
  menuButton: `${U}-menuButton`,
83
83
  hide: `${U}-hide`,
@@ -85,7 +85,7 @@ const ct = 330, dt = 73, U = "Navbar", q = {
85
85
  userInfoHolder: `${U}-userInfoHolder`,
86
86
  settings: `${U}-settings`,
87
87
  pieChartIcon: `${U}-pieChartIcon`
88
- }, ln = W($, {
88
+ }, ln = R(I, {
89
89
  name: "NavBar"
90
90
  })(({ theme: e }) => ({
91
91
  [`&.${q.root}`]: {
@@ -106,7 +106,7 @@ const ct = 330, dt = 73, U = "Navbar", q = {
106
106
  marginTop: "64px",
107
107
  marginBottom: "16px"
108
108
  }
109
- })), ut = () => ({
109
+ })), ht = () => ({
110
110
  position: "absolute",
111
111
  height: "100%",
112
112
  overflowX: "hidden",
@@ -115,13 +115,13 @@ const ct = 330, dt = 73, U = "Navbar", q = {
115
115
  backgroundColor: "black"
116
116
  // backgroundColor: '#e8e8e8',
117
117
  }), cn = () => s({
118
- width: ct
119
- }, ut()), dn = () => s({
120
- width: dt
121
- }, ut()), un = W(xe, {
118
+ width: ut
119
+ }, ht()), dn = () => s({
120
+ width: pt
121
+ }, ht()), un = R(ve, {
122
122
  shouldForwardProp: (e) => e !== "open"
123
123
  })(({ theme: e, open: t }) => s(s({
124
- width: t ? ct : dt,
124
+ width: t ? ut : pt,
125
125
  flexShrink: 0,
126
126
  whiteSpace: "nowrap",
127
127
  boxSizing: "border-box",
@@ -131,10 +131,10 @@ const ct = 330, dt = 73, U = "Navbar", q = {
131
131
  }), !t && {
132
132
  "& .MuiDrawer-paper": dn()
133
133
  }));
134
- class Se extends Yt {
134
+ class ke extends Yt {
135
135
  }
136
- Ee(Se, "errorName", "ContextError");
137
- const pt = Xe(null), pn = {}, hn = {}, gn = ({
136
+ Be(ke, "errorName", "ContextError");
137
+ const gt = Qe(null), pn = {}, hn = {}, gn = ({
138
138
  overrideState: e = pn,
139
139
  overrideActions: t = hn,
140
140
  children: n
@@ -148,17 +148,17 @@ const pt = Xe(null), pn = {}, hn = {}, gn = ({
148
148
  setOpen: a,
149
149
  toggleOpen: c
150
150
  }, e), t);
151
- return /* @__PURE__ */ o(pt.Provider, { value: d, children: n });
151
+ return /* @__PURE__ */ o(gt.Provider, { value: d, children: n });
152
152
  }, fn = () => {
153
- const e = Qe(pt);
153
+ const e = Ye(gt);
154
154
  if (e === null)
155
- throw new Se("Error: Tried to useNavBar outside of a <NavBarProvider>");
155
+ throw new ke("Error: Tried to useNavBar outside of a <NavBarProvider>");
156
156
  return e;
157
157
  }, mn = (e = {}) => s({
158
158
  open: !0
159
159
  }, e), yo = K(
160
160
  (e = mn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(gn, { overrideState: e, overrideActions: t, children: n })
161
- ), Le = 7, $o = W(nt)(({ theme: e }) => ({
161
+ ), _e = 7, $o = R(it)(({ theme: e }) => ({
162
162
  backgroundColor: "black",
163
163
  color: "white",
164
164
  "& .MuiListItem-root": {
@@ -167,7 +167,7 @@ const pt = Xe(null), pn = {}, hn = {}, gn = ({
167
167
  "& .MuiListItemButton-root": {
168
168
  " .MuiListItemIcon-root": {
169
169
  color: "white",
170
- padding: `${Le}px`
170
+ padding: `${_e}px`
171
171
  },
172
172
  // Focus state
173
173
  "&.Mui-focusVisible": {
@@ -178,7 +178,7 @@ const pt = Xe(null), pn = {}, hn = {}, gn = ({
178
178
  borderLeftStyle: "solid",
179
179
  borderLeftWidth: "7px",
180
180
  borderLeftColor: e.palette.primary.main,
181
- paddingLeft: `calc(${e.spacing(2)} - ${Le}px)`
181
+ paddingLeft: `calc(${e.spacing(2)} - ${_e}px)`
182
182
  },
183
183
  // Hover state
184
184
  "&:hover": {
@@ -196,7 +196,7 @@ const pt = Xe(null), pn = {}, hn = {}, gn = ({
196
196
  // '&.Mui-selected.Mui-focusVisible:hover': {
197
197
  // },
198
198
  }
199
- })), _e = 7, Io = W(nt)(({ theme: e }) => ({
199
+ })), Me = 7, Io = R(it)(({ theme: e }) => ({
200
200
  backgroundColor: "#e8e8e8",
201
201
  color: "inherit",
202
202
  "& .MuiListItem-root": {
@@ -205,7 +205,7 @@ const pt = Xe(null), pn = {}, hn = {}, gn = ({
205
205
  "& .MuiListItemButton-root": {
206
206
  " .MuiListItemIcon-root": {
207
207
  color: "inherit",
208
- padding: `${_e}px`
208
+ padding: `${Me}px`
209
209
  },
210
210
  // Focus state
211
211
  "&.Mui-focusVisible": {
@@ -216,7 +216,7 @@ const pt = Xe(null), pn = {}, hn = {}, gn = ({
216
216
  borderLeftStyle: "solid",
217
217
  borderLeftWidth: "7px",
218
218
  borderLeftColor: e.palette.primary.main,
219
- paddingLeft: `calc(${e.spacing(2)} - ${_e}px)`
219
+ paddingLeft: `calc(${e.spacing(2)} - ${Me}px)`
220
220
  },
221
221
  // Hover state
222
222
  "&:hover": {
@@ -254,7 +254,7 @@ function To({
254
254
  )
255
255
  ] });
256
256
  }
257
- const ht = ({
257
+ const ft = ({
258
258
  isOpen: e,
259
259
  dialogTitle: t,
260
260
  children: n,
@@ -264,44 +264,46 @@ const ht = ({
264
264
  onClose: c,
265
265
  sx: d,
266
266
  "data-testid": l,
267
- disableCloseOnBackdropOrEscape: u = !1
267
+ disableCloseOnBackdropOrEscape: u = !1,
268
+ isLoading: w = !1
268
269
  }) => {
269
- var w, g;
270
- const [m, x] = E(!1);
270
+ var g, k;
271
+ const [C, A] = E(!1);
271
272
  return /* @__PURE__ */ p(
272
- Ke,
273
+ Je,
273
274
  {
274
275
  open: e,
275
- onClose: (k, b) => P(void 0, null, function* () {
276
- u && (b === "backdropClick" || b === "escapeKeyDown") || m || (a != null && a.onClick ? yield a.onClick() : c());
276
+ onClose: (b, D) => P(void 0, null, function* () {
277
+ u && (D === "backdropClick" || D === "escapeKeyDown") || C || (a != null && a.onClick ? yield a.onClick() : c());
277
278
  }),
278
279
  fullWidth: !0,
279
280
  maxWidth: i != null ? i : "xs",
280
281
  "data-testid": l,
281
282
  sx: d,
282
283
  children: [
283
- /* @__PURE__ */ o(Je, { children: t }),
284
- /* @__PURE__ */ o(Ze, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
285
- /* @__PURE__ */ p(je, { children: [
284
+ w && /* @__PURE__ */ o(Ze, { sx: { height: "4px", marginBottom: "-4px" } }),
285
+ /* @__PURE__ */ o(je, { children: t }),
286
+ /* @__PURE__ */ o(et, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
287
+ /* @__PURE__ */ p(tt, { children: [
286
288
  /* @__PURE__ */ o(
287
289
  ie,
288
290
  {
289
- onClick: (w = a == null ? void 0 : a.onClick) != null ? w : c,
291
+ onClick: (g = a == null ? void 0 : a.onClick) != null ? g : c,
290
292
  "data-testid": a == null ? void 0 : a.testId,
291
- disabled: (a == null ? void 0 : a.disabled) || m,
293
+ disabled: (a == null ? void 0 : a.disabled) || C,
292
294
  color: a == null ? void 0 : a.buttonColor,
293
- children: (g = a == null ? void 0 : a.text) != null ? g : "Cancel"
295
+ children: (k = a == null ? void 0 : a.text) != null ? k : "Cancel"
294
296
  }
295
297
  ),
296
298
  r && /* @__PURE__ */ o(
297
299
  ie,
298
300
  {
299
301
  onClick: () => P(void 0, null, function* () {
300
- var k;
301
- x(!0), yield (k = r.onClick) == null ? void 0 : k.call(r), x(!1);
302
+ var b;
303
+ A(!0), yield (b = r.onClick) == null ? void 0 : b.call(r), A(!1);
302
304
  }),
303
305
  "data-testid": r.testId,
304
- disabled: r.disabled || m,
306
+ disabled: r.disabled || C,
305
307
  color: r == null ? void 0 : r.buttonColor,
306
308
  children: r.text
307
309
  }
@@ -310,7 +312,7 @@ const ht = ({
310
312
  ]
311
313
  }
312
314
  );
313
- }, gt = ({
315
+ }, mt = ({
314
316
  minLength: e,
315
317
  preLoadedOptions: t,
316
318
  lookup: n,
@@ -332,36 +334,37 @@ function Oo({
332
334
  value: a,
333
335
  "data-testid": c,
334
336
  sx: d,
335
- textFieldColor: l,
336
- textFieldVariant: u = "filled",
337
- loadingText: m = "Loading...",
338
- noOptionsText: x = "No options",
339
- popupIcon: w = /* @__PURE__ */ o(Jt, {}),
340
- error: g = !1,
341
- helperText: k = "",
342
- preLoadedOptions: b = void 0,
343
- disablePortal: I = !1
337
+ boxSx: l,
338
+ textFieldColor: u,
339
+ textFieldVariant: w = "filled",
340
+ loadingText: C = "Loading...",
341
+ noOptionsText: A = "No options",
342
+ popupIcon: g = /* @__PURE__ */ o(Jt, {}),
343
+ error: k = !1,
344
+ helperText: b = "",
345
+ preLoadedOptions: D = void 0,
346
+ disablePortal: $ = !1
344
347
  }) {
345
- const [D, A] = E(""), y = (h, f) => {
346
- const B = a.filter((L) => L.id !== f);
348
+ const [x, y] = E(""), H = (h, f) => {
349
+ const B = a.filter((m) => m.id !== f);
347
350
  n(B, "delete", h);
348
- }, { data: N, isLoading: R } = gt({
349
- inputValue: D,
351
+ }, { data: N, isLoading: T } = mt({
352
+ inputValue: x,
350
353
  label: r,
351
354
  lookup: e,
352
355
  minLength: i,
353
- preLoadedOptions: b
354
- }), T = D.length >= i;
356
+ preLoadedOptions: D
357
+ }), W = x.length >= i;
355
358
  return /* @__PURE__ */ p("div", { "data-testid": c, children: [
356
359
  /* @__PURE__ */ o(
357
- ve,
360
+ we,
358
361
  {
359
362
  sx: d,
360
363
  "data-testid": c ? `${c}:Autocomplete` : void 0,
361
- disablePortal: I,
364
+ disablePortal: $,
362
365
  multiple: !0,
363
366
  getOptionLabel: (h) => typeof h == "string" ? h : h.label,
364
- loading: T ? R : !1,
367
+ loading: W ? T : !1,
365
368
  options: [...a, ...N != null ? N : []],
366
369
  filterSelectedOptions: !0,
367
370
  includeInputInList: !0,
@@ -369,21 +372,21 @@ function Oo({
369
372
  onChange: (h, f, B) => {
370
373
  n(f, B, h);
371
374
  },
372
- onInputChange: (h, f) => A(f),
373
- noOptionsText: T ? x : "Start typing to search",
374
- loadingText: m,
375
- popupIcon: w,
375
+ onInputChange: (h, f) => y(f),
376
+ noOptionsText: W ? A : "Start typing to search",
377
+ loadingText: C,
378
+ popupIcon: g,
376
379
  renderInput: (h) => /* @__PURE__ */ o(
377
- we,
380
+ Ae,
378
381
  S(s({}, h), {
379
382
  label: r,
380
383
  fullWidth: !0,
381
- variant: u,
382
- error: g,
383
- helperText: k,
384
+ variant: w,
385
+ error: k,
386
+ helperText: b,
384
387
  InputProps: S(s({}, h.InputProps), {
385
388
  endAdornment: /* @__PURE__ */ p(_, { children: [
386
- R ? /* @__PURE__ */ o(Ae, { color: "inherit", size: 20 }) : null,
389
+ T ? /* @__PURE__ */ o(be, { color: "inherit", size: 20 }) : null,
387
390
  h.InputProps.endAdornment
388
391
  ] })
389
392
  }),
@@ -391,36 +394,36 @@ function Oo({
391
394
  onKeyDown: (f) => {
392
395
  (f.key === "Backspace" || f.key === "Delete") && f.stopPropagation();
393
396
  },
394
- color: l
397
+ color: u
395
398
  })
396
399
  ),
397
400
  renderTags: () => null,
398
401
  isOptionEqualToValue: (h, f) => h.id === f.id,
399
402
  renderOption: (h, f, B) => {
400
403
  if (t) {
401
- const L = jt(f.label, B.inputValue, {
404
+ const m = jt(f.label, B.inputValue, {
402
405
  insideWords: !0,
403
406
  findAllOccurrences: !0
404
- }), v = en(f.label, L);
405
- return /* @__PURE__ */ me(
407
+ }), v = en(f.label, m);
408
+ return /* @__PURE__ */ Ce(
406
409
  "li",
407
410
  S(s({}, h), {
408
411
  key: f.id,
409
412
  "data-testid": c ? `${c}:Autocomplete:option(${f.id.toString()})` : void 0
410
413
  }),
411
- /* @__PURE__ */ o("div", { children: v.map((C, H) => /* @__PURE__ */ o(
414
+ /* @__PURE__ */ o("div", { children: v.map((L, se) => /* @__PURE__ */ o(
412
415
  "span",
413
416
  {
414
417
  style: {
415
- fontWeight: C.highlight ? 700 : 400
418
+ fontWeight: L.highlight ? 700 : 400
416
419
  },
417
- children: C.text
420
+ children: L.text
418
421
  },
419
- H
422
+ se
420
423
  )) })
421
424
  );
422
425
  } else
423
- return /* @__PURE__ */ me(
426
+ return /* @__PURE__ */ Ce(
424
427
  "li",
425
428
  S(s({}, h), {
426
429
  key: f.id,
@@ -431,8 +434,8 @@ function Oo({
431
434
  }
432
435
  }
433
436
  ),
434
- a.length > 0 && /* @__PURE__ */ o($, { children: a.map((h) => /* @__PURE__ */ o(
435
- Lt,
437
+ a.length > 0 && /* @__PURE__ */ o(I, { sx: l, children: a.map((h) => /* @__PURE__ */ o(
438
+ _t,
436
439
  {
437
440
  sx: {
438
441
  marginTop: 1,
@@ -440,7 +443,7 @@ function Oo({
440
443
  height: "auto"
441
444
  },
442
445
  label: /* @__PURE__ */ o(
443
- _t,
446
+ Mt,
444
447
  {
445
448
  title: h.tooltipContent || "",
446
449
  placement: "bottom-start",
@@ -458,7 +461,7 @@ function Oo({
458
461
  }
459
462
  ),
460
463
  "data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
461
- onDelete: (f) => y(f, h.id),
464
+ onDelete: (f) => H(f, h.id),
462
465
  deleteIcon: /* @__PURE__ */ o(
463
466
  Kt,
464
467
  {
@@ -482,50 +485,50 @@ const Eo = ({
482
485
  "data-testid": d,
483
486
  noOptionsText: l = "No options",
484
487
  minLength: u = 3,
485
- disablePortal: m = !1,
486
- preLoadedOptions: x,
487
- helperText: w = ""
488
+ disablePortal: w = !1,
489
+ preLoadedOptions: C,
490
+ helperText: A = ""
488
491
  }) => {
489
- const [g, k] = E(""), { data: b, isLoading: I } = gt({
492
+ const [g, k] = E(""), { data: b, isLoading: D } = mt({
490
493
  inputValue: g,
491
494
  label: n,
492
495
  lookup: e,
493
496
  minLength: u != null ? u : 0,
494
- preLoadedOptions: x
495
- }), D = g.length >= u;
496
- return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(Mt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
497
- ve,
497
+ preLoadedOptions: C
498
+ }), $ = g.length >= u;
499
+ return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(Rt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
500
+ we,
498
501
  {
499
502
  sx: r,
500
503
  "data-testid": d ? `${d}:Autocomplete` : void 0,
501
- loading: D ? I : !1,
504
+ loading: $ ? D : !1,
502
505
  options: b != null ? b : [],
503
- onChange: (A, y) => {
504
- t(A, y);
506
+ onChange: (x, y) => {
507
+ t(x, y);
505
508
  },
506
- disablePortal: m,
507
- filterOptions: (A) => A,
509
+ disablePortal: w,
510
+ filterOptions: (x) => x,
508
511
  value: i,
509
- noOptionsText: D ? l : "Start typing to search",
510
- getOptionLabel: (A) => A.label,
511
- renderInput: (A) => /* @__PURE__ */ o(
512
- we,
512
+ noOptionsText: $ ? l : "Start typing to search",
513
+ getOptionLabel: (x) => x.label,
514
+ renderInput: (x) => /* @__PURE__ */ o(
515
+ Ae,
513
516
  S(s({
514
517
  "data-testid": d ? `${d}:Autocomplete:TextField` : void 0
515
- }, A), {
518
+ }, x), {
516
519
  variant: c,
517
520
  label: n,
518
521
  color: a,
519
- helperText: w
522
+ helperText: A
520
523
  })
521
524
  ),
522
- isOptionEqualToValue: (A, y) => A.id === y.id,
523
- onInputChange: (A, y) => {
525
+ isOptionEqualToValue: (x, y) => x.id === y.id,
526
+ onInputChange: (x, y) => {
524
527
  k(y);
525
528
  },
526
- renderOption: (A, y) => /* @__PURE__ */ me(
529
+ renderOption: (x, y) => /* @__PURE__ */ Ce(
527
530
  "li",
528
- S(s({}, A), {
531
+ S(s({}, x), {
529
532
  key: y.id,
530
533
  "data-testid": d ? `${d}:Autocomplete:option(${y.id.toString()})` : void 0
531
534
  }),
@@ -551,7 +554,7 @@ const Eo = ({
551
554
  closeHandler: t,
552
555
  setAuth0ExpiryTime: n
553
556
  }) => {
554
- const { logout: i, getAccessTokenSilently: r } = rt(), [a, c] = E(0), d = () => P(void 0, null, function* () {
557
+ const { logout: i, getAccessTokenSilently: r } = st(), [a, c] = E(0), d = () => P(void 0, null, function* () {
555
558
  i({ logoutParams: { returnTo: `${window.location.origin}` } });
556
559
  }), l = () => P(void 0, null, function* () {
557
560
  c(a + 1), t();
@@ -559,12 +562,12 @@ const Eo = ({
559
562
  return oe(() => {
560
563
  (() => P(void 0, null, function* () {
561
564
  if (a > 0) {
562
- const w = yield r({ cacheMode: "off" }), g = Cn(w) * 1e3;
565
+ const A = yield r({ cacheMode: "off" }), g = Cn(A) * 1e3;
563
566
  n(g);
564
567
  }
565
568
  }))();
566
569
  }, [a, r, n]), /* @__PURE__ */ o(
567
- ht,
570
+ ft,
568
571
  {
569
572
  isOpen: e,
570
573
  primaryButton: {
@@ -608,7 +611,7 @@ function Fo({
608
611
  children: e,
609
612
  appName: t = "the app"
610
613
  }) {
611
- const { isAuthenticated: n, isLoading: i, error: r, loginWithRedirect: a, logout: c } = rt();
614
+ const { isAuthenticated: n, isLoading: i, error: r, loginWithRedirect: a, logout: c } = st();
612
615
  if (oe(() => {
613
616
  if (i || n || r)
614
617
  return;
@@ -620,10 +623,10 @@ function Fo({
620
623
  a(d);
621
624
  }, [i, n, r, a]), r && xn(r)) {
622
625
  let d = "Auth error", l = "An unknown Auth0 error occurred.";
623
- return wn(r) ? (d = "Unauthorised", l = `You are not authorised to access ${t}.`) : An(r) ? (d = "App not authorised", l = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`) : vn(r) && (d = "Unauthorised", l = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */ p(Ke, { open: !0, children: [
624
- /* @__PURE__ */ o(Je, { children: d }),
625
- /* @__PURE__ */ o(Ze, { children: /* @__PURE__ */ o(F, { children: l }) }),
626
- /* @__PURE__ */ o(je, { children: /* @__PURE__ */ o(ie, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
626
+ return wn(r) ? (d = "Unauthorised", l = `You are not authorised to access ${t}.`) : An(r) ? (d = "App not authorised", l = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`) : vn(r) && (d = "Unauthorised", l = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */ p(Je, { open: !0, children: [
627
+ /* @__PURE__ */ o(je, { children: d }),
628
+ /* @__PURE__ */ o(et, { children: /* @__PURE__ */ o(F, { children: l }) }),
629
+ /* @__PURE__ */ o(tt, { children: /* @__PURE__ */ o(ie, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
627
630
  ] });
628
631
  }
629
632
  return n ? /* @__PURE__ */ o(_, { children: e }) : /* @__PURE__ */ o(an, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
@@ -635,7 +638,7 @@ const bn = 24, Sn = 64, G = "TopBar", O = {
635
638
  titleText: `${G}-titleText`,
636
639
  leftPanelButton: `${G}-leftPanelButton`,
637
640
  rightPanelButton: `${G}-leftPanelButton`
638
- }, kn = be("div", {
641
+ }, kn = Se("div", {
639
642
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
640
643
  name: G
641
644
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -695,7 +698,7 @@ function Dn({
695
698
  }) {
696
699
  return /* @__PURE__ */ p(kn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
697
700
  /* @__PURE__ */ o("div", { className: O.topStripe }),
698
- /* @__PURE__ */ o("div", { className: O.titleBar, children: /* @__PURE__ */ p($, { className: O.titleSlider, children: [
701
+ /* @__PURE__ */ o("div", { className: O.titleBar, children: /* @__PURE__ */ p(I, { className: O.titleSlider, children: [
699
702
  t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ p(
700
703
  Q,
701
704
  {
@@ -707,7 +710,7 @@ function Dn({
707
710
  size: "large",
708
711
  children: [
709
712
  " ",
710
- /* @__PURE__ */ o(ot, {})
713
+ /* @__PURE__ */ o(rt, {})
711
714
  ]
712
715
  }
713
716
  ),
@@ -723,14 +726,14 @@ function Dn({
723
726
  size: "large",
724
727
  children: [
725
728
  " ",
726
- /* @__PURE__ */ o(it, {})
729
+ /* @__PURE__ */ o(at, {})
727
730
  ]
728
731
  }
729
732
  )
730
733
  ] }) })
731
734
  ] });
732
735
  }
733
- const ft = 400, yn = be(xe, {
736
+ const Ct = 400, yn = Se(ve, {
734
737
  shouldForwardProp: (e) => (
735
738
  // Note we do want anchor to be forwarded to the Drawer component
736
739
  ![
@@ -760,7 +763,7 @@ const ft = 400, yn = be(xe, {
760
763
  marginLeft: `${r}px`
761
764
  }))
762
765
  })
763
- ), $n = be($, {
766
+ ), $n = Se(I, {
764
767
  shouldForwardProp: (e) => !["anchor"].includes(e)
765
768
  })(({ theme: e, anchor: t }) => S(s({
766
769
  display: "flex",
@@ -780,21 +783,21 @@ const ft = 400, yn = be(xe, {
780
783
  marginRight: t === "right" ? e.spacing(2) : 0
781
784
  }
782
785
  }));
783
- function Me({
786
+ function Re({
784
787
  children: e,
785
788
  anchor: t = "left",
786
789
  open: n,
787
790
  onClose: i = () => {
788
791
  },
789
792
  titleText: r = "",
790
- width: a = ft,
793
+ width: a = Ct,
791
794
  showCloseArrow: c = !0,
792
795
  debugOpacity: d = !1,
793
796
  headerBoxProps: l = {},
794
797
  onOpened: u,
795
- onClosed: m,
796
- "data-testid": x,
797
- navBarOpen: w = !1,
798
+ onClosed: w,
799
+ "data-testid": C,
800
+ navBarOpen: A = !1,
798
801
  navBarWidthOpen: g = 0,
799
802
  navBarWidthClosed: k = 0
800
803
  }) {
@@ -803,27 +806,27 @@ function Me({
803
806
  {
804
807
  SlideProps: {
805
808
  onEntered: () => u == null ? void 0 : u(),
806
- onExited: () => m == null ? void 0 : m()
809
+ onExited: () => w == null ? void 0 : w()
807
810
  },
808
811
  variant: "persistent",
809
812
  anchor: t,
810
813
  open: n,
811
814
  width: a,
812
815
  debugOpacity: d,
813
- "data-testid": x,
814
- navBarOpen: w,
816
+ "data-testid": C,
817
+ navBarOpen: A,
815
818
  navBarWidthOpen: g,
816
819
  navBarWidthClosed: k,
817
820
  children: [
818
821
  /* @__PURE__ */ o($n, S(s({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ p(_, { children: [
819
822
  /* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", children: r }),
820
823
  c && /* @__PURE__ */ p(Q, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
821
- /* @__PURE__ */ o(it, { "data-testid": "arrowbackicon" }),
824
+ /* @__PURE__ */ o(at, { "data-testid": "arrowbackicon" }),
822
825
  " "
823
826
  ] })
824
827
  ] }) : /* @__PURE__ */ p(_, { children: [
825
828
  c && /* @__PURE__ */ p(Q, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
826
- /* @__PURE__ */ o(ot, {}),
829
+ /* @__PURE__ */ o(rt, {}),
827
830
  " "
828
831
  ] }),
829
832
  /* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", children: r })
@@ -833,7 +836,7 @@ function Me({
833
836
  }
834
837
  );
835
838
  }
836
- const In = W($, {
839
+ const In = R(I, {
837
840
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
838
841
  name: "PanelAwareMargins"
839
842
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -856,17 +859,17 @@ const In = W($, {
856
859
  }),
857
860
  marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
858
861
  });
859
- }), Tn = W(et, {
862
+ }), Tn = R(nt, {
860
863
  name: "PageContainer"
861
864
  })(({ theme: e }) => ({
862
865
  // Horizontal padding comes from the Container's gutter
863
866
  paddingTop: e.spacing(3),
864
867
  paddingBottom: e.spacing(3)
865
868
  // TODO: Remove max width
866
- })), ge = !1, fe = !1, ee = {
869
+ })), fe = !1, me = !1, ee = {
867
870
  titleText: "",
868
871
  flavour: "push",
869
- width: ft,
872
+ width: Ct,
870
873
  arrowButtons: "both",
871
874
  startOpen: !1,
872
875
  open: void 0,
@@ -887,81 +890,81 @@ function Po({
887
890
  pageContentDataTestId: d,
888
891
  topBarDataTestId: l,
889
892
  navBarOpen: u,
890
- navBarWidthOpen: m,
891
- navBarWidthClosed: x
893
+ navBarWidthOpen: w,
894
+ navBarWidthClosed: C
892
895
  }) {
893
- const [w, g] = E(ge), [k, b] = E(fe), [I, D] = E(ge), [A, y] = E(fe), N = n !== void 0, R = i !== void 0, {
896
+ const [A, g] = E(fe), [k, b] = E(me), [D, $] = E(fe), [x, y] = E(me), H = n !== void 0, N = i !== void 0, {
894
897
  titleText: T,
895
- content: h,
896
- flavour: f,
897
- open: B,
898
- onChangeOpen: L,
899
- width: v,
900
- arrowButtons: C,
901
- startOpen: H,
902
- onOpened: Dt,
903
- onClosed: yt,
904
- dataTestId: $t
898
+ content: W,
899
+ flavour: h,
900
+ open: f,
901
+ onChangeOpen: B,
902
+ width: m,
903
+ arrowButtons: v,
904
+ startOpen: L,
905
+ onOpened: se,
906
+ onClosed: $t,
907
+ dataTestId: It
905
908
  } = n ? s(s({}, ee), n) : s({}, ee), {
906
- titleText: It,
907
- content: Tt,
908
- flavour: ke,
909
- open: se,
910
- onChangeOpen: De,
911
- width: le,
909
+ titleText: Tt,
910
+ content: Ot,
911
+ flavour: De,
912
+ open: le,
913
+ onChangeOpen: ye,
914
+ width: ce,
912
915
  arrowButtons: J,
913
916
  startOpen: Z,
914
- onOpened: Ot,
915
- onClosed: Et,
916
- dataTestId: Bt
917
+ onOpened: Et,
918
+ onClosed: Bt,
919
+ dataTestId: Ft
917
920
  } = i ? s(s({}, ee), i) : s({}, ee);
918
921
  oe(() => {
919
- H !== ge && (g(H), D(H));
920
- }, [H]), oe(() => {
921
- Z !== fe && (b(Z), y(Z));
922
+ L !== fe && (g(L), $(L));
923
+ }, [L]), oe(() => {
924
+ Z !== me && (b(Z), y(Z));
922
925
  }, [Z]);
923
- const ce = B === void 0 ? w : B, de = se === void 0 ? k : se, ye = (z) => {
924
- B === void 0 && (g(z), r && R && (z ? (b(!1), y(k)) : b(A))), L && L(z);
925
- }, $e = (z) => {
926
- se === void 0 && (b(z), r && N && (z ? (g(!1), D(w)) : g(I))), De && De(z);
926
+ const de = f === void 0 ? A : f, ue = le === void 0 ? k : le, $e = (z) => {
927
+ f === void 0 && (g(z), r && N && (z ? (b(!1), y(k)) : b(x))), B && B(z);
928
+ }, Ie = (z) => {
929
+ le === void 0 && (b(z), r && H && (z ? (g(!1), $(A)) : g(D))), ye && ye(z);
927
930
  };
928
- return /* @__PURE__ */ p($, { children: [
929
- N && /* @__PURE__ */ o(
930
- Me,
931
+ return /* @__PURE__ */ p(I, { children: [
932
+ H && /* @__PURE__ */ o(
933
+ Re,
931
934
  {
932
- "data-testid": $t,
935
+ "data-testid": It,
933
936
  anchor: "left",
934
- open: ce,
935
- onClose: () => ye(!1),
936
- width: v,
937
+ open: de,
938
+ onClose: () => $e(!1),
939
+ width: m,
937
940
  titleText: T,
938
941
  debugOpacity: a,
939
- showCloseArrow: C === "both" || C === "close",
940
- onOpened: Dt,
941
- onClosed: yt,
942
+ showCloseArrow: v === "both" || v === "close",
943
+ onOpened: se,
944
+ onClosed: $t,
942
945
  navBarOpen: u,
943
- navBarWidthOpen: m,
944
- navBarWidthClosed: x,
945
- children: h
946
+ navBarWidthOpen: w,
947
+ navBarWidthClosed: C,
948
+ children: W
946
949
  }
947
950
  ),
948
- R && /* @__PURE__ */ o(
949
- Me,
951
+ N && /* @__PURE__ */ o(
952
+ Re,
950
953
  {
951
- "data-testid": Bt,
954
+ "data-testid": Ft,
952
955
  anchor: "right",
953
- open: de,
954
- onClose: () => $e(!1),
955
- width: le,
956
- titleText: It,
956
+ open: ue,
957
+ onClose: () => Ie(!1),
958
+ width: ce,
959
+ titleText: Tt,
957
960
  debugOpacity: a,
958
961
  showCloseArrow: J === "both" || J === "close",
959
- onOpened: Ot,
960
- onClosed: Et,
962
+ onOpened: Et,
963
+ onClosed: Bt,
961
964
  navBarOpen: u,
962
- navBarWidthOpen: m,
963
- navBarWidthClosed: x,
964
- children: Tt
965
+ navBarWidthOpen: w,
966
+ navBarWidthClosed: C,
967
+ children: Ot
965
968
  }
966
969
  ),
967
970
  /* @__PURE__ */ o(
@@ -969,33 +972,33 @@ function Po({
969
972
  s(s({
970
973
  titleText: t,
971
974
  "data-testid": l
972
- }, N && f === "push" ? {
975
+ }, H && h === "push" ? {
973
976
  leftPanel: {
974
- open: ce,
975
- width: v,
976
- onOpen: () => ye(!0),
977
- showOpenArrow: C === "both" || C === "open"
978
- }
979
- } : {}), R && ke === "push" ? {
980
- rightPanel: {
981
977
  open: de,
982
- width: le,
978
+ width: m,
983
979
  onOpen: () => $e(!0),
980
+ showOpenArrow: v === "both" || v === "open"
981
+ }
982
+ } : {}), N && De === "push" ? {
983
+ rightPanel: {
984
+ open: ue,
985
+ width: ce,
986
+ onOpen: () => Ie(!0),
984
987
  showOpenArrow: J === "both" || J === "open"
985
988
  }
986
989
  } : {})
987
990
  ),
988
991
  /* @__PURE__ */ o(
989
992
  In,
990
- S(s(s({}, f === "push" ? {
993
+ S(s(s({}, h === "push" ? {
991
994
  leftPanel: {
992
- open: ce,
993
- width: v
995
+ open: de,
996
+ width: m
994
997
  }
995
- } : {}), ke === "push" ? {
998
+ } : {}), De === "push" ? {
996
999
  rightPanel: {
997
- open: de,
998
- width: le
1000
+ open: ue,
1001
+ width: ce
999
1002
  }
1000
1003
  } : {}), {
1001
1004
  children: /* @__PURE__ */ o(Tn, S(s({ "data-testid": d }, c), { children: e }))
@@ -1003,10 +1006,10 @@ function Po({
1003
1006
  )
1004
1007
  ] });
1005
1008
  }
1006
- const mt = () => {
1009
+ const xt = () => {
1007
1010
  const e = ae();
1008
- return Rt(e.breakpoints.down("sm"));
1009
- }, On = 64, En = 72, Bn = 256, Y = M(!0), Ct = M(Bn), xt = M(En), Ce = M(""), Fn = M(void 0), vt = M(On), wt = M(void 0);
1011
+ return Ht(e.breakpoints.down("sm"));
1012
+ }, On = 64, En = 72, Bn = 256, Y = M(!0), vt = M(Bn), wt = M(En), xe = M(""), Fn = M(void 0), At = M(On), bt = M(void 0);
1010
1013
  function Pn({ links: e }) {
1011
1014
  return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
1012
1015
  }
@@ -1018,7 +1021,7 @@ const te = "Navbar", X = {
1018
1021
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
1019
1022
  // settings: `${PREFIX}-settings`,
1020
1023
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
1021
- }, Nn = W($, { name: "NavBar" })(({ theme: e }) => ({
1024
+ }, Nn = R(I, { name: "NavBar" })(({ theme: e }) => ({
1022
1025
  [`&.${X.root}`]: {
1023
1026
  display: "flex"
1024
1027
  },
@@ -1043,7 +1046,7 @@ const te = "Navbar", X = {
1043
1046
  }), Ln = (e) => {
1044
1047
  const t = ae();
1045
1048
  return /* @__PURE__ */ o(
1046
- Ht,
1049
+ Wt,
1047
1050
  s({
1048
1051
  easing: t.transitions.easing.sharp,
1049
1052
  timeout: {
@@ -1052,7 +1055,7 @@ const te = "Navbar", X = {
1052
1055
  }
1053
1056
  }, e)
1054
1057
  );
1055
- }, At = (e) => {
1058
+ }, St = (e) => {
1056
1059
  var t, n;
1057
1060
  return {
1058
1061
  overflowX: "hidden",
@@ -1060,13 +1063,13 @@ const te = "Navbar", X = {
1060
1063
  backgroundColor: (n = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? n : "white"
1061
1064
  // Provide default so tests don't need to wrap theme provider
1062
1065
  };
1063
- }, Re = (e, t) => s({
1066
+ }, He = (e, t) => s({
1064
1067
  width: t,
1065
1068
  transition: re(e, "width", "entering")
1066
- }, At(e)), He = (e, t) => s({
1069
+ }, St(e)), We = (e, t) => s({
1067
1070
  width: t,
1068
1071
  transition: re(e, "width", "leaving")
1069
- }, At(e)), _n = W(xe, {
1072
+ }, St(e)), _n = R(ve, {
1070
1073
  shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
1071
1074
  })(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => s(s({
1072
1075
  flexShrink: 0,
@@ -1074,12 +1077,12 @@ const te = "Navbar", X = {
1074
1077
  boxSizing: "border-box",
1075
1078
  display: "flex",
1076
1079
  flexDirection: "column"
1077
- }, t && S(s({}, Re(e, n)), {
1080
+ }, t && S(s({}, He(e, n)), {
1078
1081
  backgroundColor: "",
1079
- "& .MuiDrawer-paper": Re(e, n)
1080
- })), !t && S(s({}, He(e, r ? n : i)), {
1082
+ "& .MuiDrawer-paper": He(e, n)
1083
+ })), !t && S(s({}, We(e, r ? n : i)), {
1081
1084
  backgroundColor: "",
1082
- "& .MuiDrawer-paper": He(e, r ? n : i)
1085
+ "& .MuiDrawer-paper": We(e, r ? n : i)
1083
1086
  })));
1084
1087
  function Mn(e) {
1085
1088
  let t = 0;
@@ -1089,11 +1092,11 @@ function Mn(e) {
1089
1092
  }
1090
1093
  return t;
1091
1094
  }
1092
- const We = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Rn = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
1095
+ const ze = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Rn = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
1093
1096
  function Hn({ user: e, domainCode: t, open: n }) {
1094
1097
  const i = ae();
1095
1098
  return /* @__PURE__ */ p(
1096
- $,
1099
+ I,
1097
1100
  {
1098
1101
  sx: {
1099
1102
  paddingTop: 3,
@@ -1104,7 +1107,7 @@ function Hn({ user: e, domainCode: t, open: n }) {
1104
1107
  },
1105
1108
  children: [
1106
1109
  /* @__PURE__ */ o(
1107
- $,
1110
+ I,
1108
1111
  {
1109
1112
  sx: {
1110
1113
  width: n ? "5rem" : "2rem",
@@ -1112,22 +1115,22 @@ function Hn({ user: e, domainCode: t, open: n }) {
1112
1115
  aspectRatio: 1
1113
1116
  },
1114
1117
  children: e != null && e.name ? /* @__PURE__ */ o(
1115
- Be,
1118
+ Fe,
1116
1119
  {
1117
1120
  src: e == null ? void 0 : e.picture,
1118
1121
  sx: {
1119
1122
  width: "100%",
1120
1123
  height: "100%",
1121
- bgcolor: We[Math.abs(Mn(e.name)) % We.length]
1124
+ bgcolor: ze[Math.abs(Mn(e.name)) % ze.length]
1122
1125
  },
1123
1126
  children: Rn(e.name)
1124
1127
  }
1125
- ) : /* @__PURE__ */ o(Be, { sx: { width: "100%", height: "100%" } })
1128
+ ) : /* @__PURE__ */ o(Fe, { sx: { width: "100%", height: "100%" } })
1126
1129
  }
1127
1130
  ),
1128
- /* @__PURE__ */ o(Ln, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Wt, { in: n, children: /* @__PURE__ */ p($, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
1129
- e != null && e.name ? /* @__PURE__ */ o(F, { children: e.name }) : /* @__PURE__ */ o(Fe, { animation: !1, width: "50%" }),
1130
- t ? /* @__PURE__ */ o(F, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Fe, { animation: !1, width: "25%" })
1131
+ /* @__PURE__ */ o(Ln, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(zt, { in: n, children: /* @__PURE__ */ p(I, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
1132
+ e != null && e.name ? /* @__PURE__ */ o(F, { children: e.name }) : /* @__PURE__ */ o(Pe, { animation: !1, width: "50%" }),
1133
+ t ? /* @__PURE__ */ o(F, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Pe, { animation: !1, width: "25%" })
1131
1134
  ] }) }) })
1132
1135
  ]
1133
1136
  }
@@ -1144,7 +1147,7 @@ function Wn({
1144
1147
  user: d,
1145
1148
  domainCode: l
1146
1149
  }) {
1147
- const u = mt(), m = at(Y);
1150
+ const u = xt(), w = lt(Y);
1148
1151
  return /* @__PURE__ */ o(Nn, { className: X.root, "data-testid": i, children: /* @__PURE__ */ p(
1149
1152
  _n,
1150
1153
  {
@@ -1157,18 +1160,18 @@ function Wn({
1157
1160
  component: "nav"
1158
1161
  },
1159
1162
  onClose: () => {
1160
- m(!1);
1163
+ w(!1);
1161
1164
  },
1162
1165
  isSmallScreen: u,
1163
1166
  children: [
1164
- !u && /* @__PURE__ */ o(zt, {}),
1165
- r && /* @__PURE__ */ p($, { flexGrow: "0", children: [
1167
+ !u && /* @__PURE__ */ o(Ut, {}),
1168
+ r && /* @__PURE__ */ p(I, { flexGrow: "0", children: [
1166
1169
  r,
1167
- /* @__PURE__ */ o(Pe, { variant: "middle", sx: { marginY: "0.5rem" } })
1170
+ /* @__PURE__ */ o(Ne, { variant: "middle", sx: { marginY: "0.5rem" } })
1168
1171
  ] }),
1169
- /* @__PURE__ */ o($, { flexGrow: "1", children: Array.isArray(a) ? /* @__PURE__ */ o(Pn, { links: a }) : a }),
1170
- /* @__PURE__ */ p($, { flexGrow: "0", children: [
1171
- /* @__PURE__ */ o(Pe, { variant: "middle", sx: { marginY: "0.5rem" } }),
1172
+ /* @__PURE__ */ o(I, { flexGrow: "1", children: Array.isArray(a) ? /* @__PURE__ */ o(Pn, { links: a }) : a }),
1173
+ /* @__PURE__ */ p(I, { flexGrow: "0", children: [
1174
+ /* @__PURE__ */ o(Ne, { variant: "middle", sx: { marginY: "0.5rem" } }),
1172
1175
  /* @__PURE__ */ o(Hn, { user: d, domainCode: l, open: e }),
1173
1176
  c && /* @__PURE__ */ o(_, { children: c })
1174
1177
  ] })
@@ -1182,7 +1185,7 @@ function zn({
1182
1185
  maxWidth: n = !1
1183
1186
  }) {
1184
1187
  return /* @__PURE__ */ o(
1185
- $,
1188
+ I,
1186
1189
  {
1187
1190
  sx: {
1188
1191
  overflow: "auto",
@@ -1192,7 +1195,7 @@ function zn({
1192
1195
  flexGrow: 1
1193
1196
  },
1194
1197
  children: /* @__PURE__ */ o(
1195
- et,
1198
+ nt,
1196
1199
  {
1197
1200
  component: "main",
1198
1201
  id: "main-content",
@@ -1213,9 +1216,9 @@ function Vn({
1213
1216
  "data-testid": n,
1214
1217
  middle: i
1215
1218
  }) {
1216
- const r = at(Y), a = () => r((l) => !l), c = ae(), d = mt();
1219
+ const r = lt(Y), a = () => r((l) => !l), c = ae(), d = xt();
1217
1220
  return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ p(
1218
- Ye,
1221
+ Ke,
1219
1222
  {
1220
1223
  square: !0,
1221
1224
  elevation: 0,
@@ -1259,35 +1262,35 @@ function No({
1259
1262
  navBarMiddle: d,
1260
1263
  navBarBottom: l,
1261
1264
  user: u,
1262
- domainCode: m
1265
+ domainCode: w
1263
1266
  }) {
1264
- lt([
1267
+ dt([
1265
1268
  [Y, n != null ? n : !0],
1266
- [Ce, t != null ? t : ""]
1269
+ [xe, t != null ? t : ""]
1267
1270
  ]);
1268
- const x = Ne(Y), [w] = V(Ct), [g] = V(xt), k = Ne(Ce), [b] = V(vt), [I] = V(Fn), [D] = V(wt);
1269
- return /* @__PURE__ */ p($, { children: [
1270
- /* @__PURE__ */ o(Ut, {}),
1271
+ const C = Le(Y), [A] = V(vt), [g] = V(wt), k = Le(xe), [b] = V(At), [D] = V(Fn), [$] = V(bt);
1272
+ return /* @__PURE__ */ p(I, { children: [
1273
+ /* @__PURE__ */ o(Gt, {}),
1271
1274
  /* @__PURE__ */ o(
1272
1275
  Vn,
1273
1276
  {
1274
1277
  titleText: k,
1275
1278
  "data-testid": a,
1276
1279
  height: b,
1277
- middle: I
1280
+ middle: D
1278
1281
  }
1279
1282
  ),
1280
- /* @__PURE__ */ p($, { sx: { display: "flex" }, children: [
1283
+ /* @__PURE__ */ p(I, { sx: { display: "flex" }, children: [
1281
1284
  /* @__PURE__ */ o(
1282
1285
  Wn,
1283
1286
  {
1284
- open: x,
1285
- top: D,
1287
+ open: C,
1288
+ top: $,
1286
1289
  middle: d,
1287
1290
  bottom: l,
1288
1291
  user: u,
1289
- domainCode: m,
1290
- widthOpen: w,
1292
+ domainCode: w,
1293
+ widthOpen: A,
1291
1294
  widthClosed: g,
1292
1295
  offsetTop: b,
1293
1296
  "data-testid": c
@@ -1313,97 +1316,97 @@ const qn = {
1313
1316
  disableWindowBlurListener: !1
1314
1317
  }, Xn = {
1315
1318
  shouldClose: (e, t) => t !== "clickaway"
1316
- }, ze = {
1319
+ }, Ue = {
1317
1320
  message: "",
1318
1321
  severity: "info",
1319
1322
  variant: "standard",
1320
1323
  progressIndicator: void 0
1321
1324
  // Can use 'circular' or 'linear'
1322
- }, Ue = 100, Ge = 2e3, Qn = 2e3, Yn = (() => {
1325
+ }, Ge = 100, Ve = 2e3, Qn = 2e3, Yn = (() => {
1323
1326
  let e = 0;
1324
1327
  return () => (e += 1, e);
1325
1328
  })(), Kn = {
1326
1329
  borderBottomLeftRadius: "0px",
1327
1330
  borderBottomRightRadius: "0px"
1328
- }, Jn = {}, Zn = {}, bt = Xe(null);
1331
+ }, Jn = {}, Zn = {}, kt = Qe(null);
1329
1332
  function jn(a) {
1330
1333
  var c = a, {
1331
1334
  overrideState: e = Jn,
1332
1335
  overrideActions: t = Zn,
1333
1336
  shouldClose: n = Xn.shouldClose,
1334
1337
  children: i
1335
- } = c, r = Oe(c, [
1338
+ } = c, r = Ee(c, [
1336
1339
  "overrideState",
1337
1340
  "overrideActions",
1338
1341
  "shouldClose",
1339
1342
  "children"
1340
1343
  ]);
1341
- var L;
1342
- const [{ open: d }, l] = E({ open: !1 }), u = pe([]), m = pe(Date.now()), x = pe(0), w = ne((v) => {
1343
- l({ open: v });
1344
- }, []), g = ne((v = {}) => {
1345
- x.current += 1, u.current.length >= Ue && Date.now() - m.current >= Ge && (m.current = Date.now(), console.error(
1346
- `SaladBarProvider: MAX_QUEUE_LENGTH (${Ue}) hit ${x.current} times in last ${Ge}ms)`
1347
- ), x.current = 0);
1348
- const C = s(S(s({}, ze), {
1344
+ var B;
1345
+ const [{ open: d }, l] = E({ open: !1 }), u = he([]), w = he(Date.now()), C = he(0), A = ne((m) => {
1346
+ l({ open: m });
1347
+ }, []), g = ne((m = {}) => {
1348
+ C.current += 1, u.current.length >= Ge && Date.now() - w.current >= Ve && (w.current = Date.now(), console.error(
1349
+ `SaladBarProvider: MAX_QUEUE_LENGTH (${Ge}) hit ${C.current} times in last ${Ve}ms)`
1350
+ ), C.current = 0);
1351
+ const v = s(S(s({}, Ue), {
1349
1352
  key: Yn()
1350
- }), v);
1351
- return u.current.push(C), u.current.length === 1 && l({ open: !0 }), C.key;
1352
- }, []), k = (v = "", C = {}) => g(s({ message: v, severity: "success" }, C)), b = (v = "", C = {}) => g(s({ message: v, severity: "info" }, C)), I = (v = "", C = {}) => g(s({ message: v, severity: "warning" }, C)), D = (v = "", C = {}) => g(s({ message: v, severity: "error" }, C)), A = (v) => {
1353
- const C = u.current.findIndex((H) => H.key === v);
1354
- if (C !== -1)
1355
- return C === 0 ? (l({ open: !1 }), u.current[0]) : u.current.splice(C, 1);
1356
- }, y = (v, C) => {
1357
- n(v, C) && l({ open: !1 });
1353
+ }), m);
1354
+ return u.current.push(v), u.current.length === 1 && l({ open: !0 }), v.key;
1355
+ }, []), k = (m = "", v = {}) => g(s({ message: m, severity: "success" }, v)), b = (m = "", v = {}) => g(s({ message: m, severity: "info" }, v)), D = (m = "", v = {}) => g(s({ message: m, severity: "warning" }, v)), $ = (m = "", v = {}) => g(s({ message: m, severity: "error" }, v)), x = (m) => {
1356
+ const v = u.current.findIndex((L) => L.key === m);
1357
+ if (v !== -1)
1358
+ return v === 0 ? (l({ open: !1 }), u.current[0]) : u.current.splice(v, 1);
1359
+ }, y = (m, v) => {
1360
+ n(m, v) && l({ open: !1 });
1361
+ }, H = () => {
1358
1362
  }, N = () => {
1359
- }, R = () => {
1360
1363
  u.current.shift(), u.current.length > 0 && l({ open: !0 });
1361
- }, T = (L = u.current[0]) != null ? L : s({}, ze), h = {};
1362
- "autoHideDuration" in T && (h.autoHideDuration = T.autoHideDuration);
1363
- const f = s(s({}, qn), r), B = s(s({
1364
+ }, T = (B = u.current[0]) != null ? B : s({}, Ue), W = {};
1365
+ "autoHideDuration" in T && (W.autoHideDuration = T.autoHideDuration);
1366
+ const h = s(s({}, qn), r), f = s(s({
1364
1367
  open: d,
1365
- setOpen: w,
1368
+ setOpen: A,
1366
1369
  enqueueNotification: g,
1367
1370
  enqueueSuccessNotification: k,
1368
1371
  enqueueInfoNotification: b,
1369
- enqueueWarningNotification: I,
1370
- enqueueErrorNotification: D,
1371
- removeNotification: A
1372
+ enqueueWarningNotification: D,
1373
+ enqueueErrorNotification: $,
1374
+ removeNotification: x
1372
1375
  }, e), t);
1373
- return /* @__PURE__ */ p(bt.Provider, { value: B, children: [
1376
+ return /* @__PURE__ */ p(kt.Provider, { value: f, children: [
1374
1377
  i,
1375
1378
  /* @__PURE__ */ o(
1376
- Gt,
1377
- S(s(s({}, f), h), {
1379
+ Vt,
1380
+ S(s(s({}, h), W), {
1378
1381
  open: d,
1379
1382
  onClose: y,
1380
1383
  TransitionProps: {
1381
- onExited: R,
1382
- onExit: N
1384
+ onExited: N,
1385
+ onExit: H
1383
1386
  },
1384
1387
  sx: { zIndex: Qn },
1385
1388
  children: /* @__PURE__ */ p("div", { children: [
1386
1389
  /* @__PURE__ */ o(
1387
- Vt,
1390
+ qt,
1388
1391
  {
1389
- onClose: (v) => y(v, "closeAlert"),
1392
+ onClose: (m) => y(m, "closeAlert"),
1390
1393
  severity: T.severity,
1391
1394
  variant: "filled",
1392
- icon: T.progressIndicator === "circular" ? /* @__PURE__ */ o(Ae, { size: "1em" }) : void 0,
1395
+ icon: T.progressIndicator === "circular" ? /* @__PURE__ */ o(be, { size: "1em" }) : void 0,
1393
1396
  style: T.progressIndicator === "linear" ? Kn : void 0,
1394
1397
  children: T.message
1395
1398
  }
1396
1399
  ),
1397
- T.progressIndicator === "linear" && /* @__PURE__ */ o(qt, { color: "primary" })
1400
+ T.progressIndicator === "linear" && /* @__PURE__ */ o(Ze, { color: "primary" })
1398
1401
  ] })
1399
1402
  })
1400
1403
  )
1401
1404
  ] });
1402
1405
  }
1403
1406
  function eo() {
1404
- const e = Qe(bt);
1407
+ const e = Ye(kt);
1405
1408
  if (e === null)
1406
- throw new Se("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1409
+ throw new ke("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1407
1410
  return e;
1408
1411
  }
1409
1412
  const Lo = K(
@@ -1411,14 +1414,14 @@ const Lo = K(
1411
1414
  ), to = sn(), _o = ({
1412
1415
  children: e,
1413
1416
  store: t
1414
- }) => /* @__PURE__ */ o(st, { store: t != null ? t : to, children: e }), St = "domainCode";
1415
- var qe;
1416
- const Ve = M(
1417
- JSON.parse((qe = localStorage.getItem(St)) != null ? qe : '{"domainCode": ""}').domainCode
1418
- ), kt = M(
1419
- (e) => e(Ve),
1417
+ }) => /* @__PURE__ */ o(ct, { store: t != null ? t : to, children: e }), Dt = "domainCode";
1418
+ var Xe;
1419
+ const qe = M(
1420
+ JSON.parse((Xe = localStorage.getItem(Dt)) != null ? Xe : '{"domainCode": ""}').domainCode
1421
+ ), yt = M(
1422
+ (e) => e(qe),
1420
1423
  (e, t, n) => {
1421
- t(Ve, n), localStorage.setItem(St, JSON.stringify({ domainCode: n }));
1424
+ t(qe, n), localStorage.setItem(Dt, JSON.stringify({ domainCode: n }));
1422
1425
  }
1423
1426
  ), no = {
1424
1427
  act: "ACT",
@@ -1443,21 +1446,21 @@ const Ve = M(
1443
1446
  applicationName: r,
1444
1447
  handleLogout: a
1445
1448
  }) => {
1446
- const [c, d] = V(kt), [l, u] = E(c), { enqueueSuccessNotification: m } = eo(), x = i.length === 0, w = !!c && !i.includes(c) && !i.includes(l), g = !c || x || w, k = () => P(void 0, null, function* () {
1447
- l ? (d(l), m(`Set domain to ${l}`), n()) : d("");
1449
+ const [c, d] = V(yt), [l, u] = E(c), { enqueueSuccessNotification: w } = eo(), C = i.length === 0, A = !!c && !i.includes(c) && !i.includes(l), g = !c || C || A, k = () => P(void 0, null, function* () {
1450
+ l ? (d(l), w(`Set domain to ${l}`), n()) : d("");
1448
1451
  }), b = () => P(void 0, null, function* () {
1449
- c && !x && !w ? (u(c), n()) : g && a();
1452
+ c && !C && !A ? (u(c), n()) : g && a();
1450
1453
  });
1451
- let I;
1452
- return x ? I = "Unable to retrieve your active organisations. Try logging in again." : w && (I = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ p(
1453
- ht,
1454
+ let D;
1455
+ return C ? D = "Unable to retrieve your active organisations. Try logging in again." : A && (D = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ p(
1456
+ ft,
1454
1457
  {
1455
1458
  isOpen: t,
1456
1459
  dialogTitle: "Select an organisation",
1457
1460
  primaryButton: {
1458
1461
  text: "Confirm",
1459
1462
  onClick: k,
1460
- disabled: !l || x || w,
1463
+ disabled: !l || C || A,
1461
1464
  buttonColor: "primary"
1462
1465
  },
1463
1466
  secondaryButton: {
@@ -1473,35 +1476,35 @@ const Ve = M(
1473
1476
  "."
1474
1477
  ] }),
1475
1478
  /* @__PURE__ */ o(
1476
- ve,
1479
+ we,
1477
1480
  {
1478
1481
  loading: e,
1479
1482
  multiple: !1,
1480
1483
  disableClearable: !1,
1481
1484
  value: l !== "" ? l : null,
1482
- onChange: (D, A) => u(A != null ? A : ""),
1485
+ onChange: ($, x) => u(x != null ? x : ""),
1483
1486
  getOptionLabel: oo,
1484
1487
  options: [...i],
1485
- renderInput: (D) => /* @__PURE__ */ o(
1486
- we,
1487
- S(s({}, D), {
1488
+ renderInput: ($) => /* @__PURE__ */ o(
1489
+ Ae,
1490
+ S(s({}, $), {
1488
1491
  variant: "filled",
1489
1492
  label: "Select organisation",
1490
- InputProps: S(s({}, D.InputProps), {
1493
+ InputProps: S(s({}, $.InputProps), {
1491
1494
  endAdornment: /* @__PURE__ */ p(_, { children: [
1492
- e ? /* @__PURE__ */ o(Ae, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1493
- D.InputProps.endAdornment
1495
+ e ? /* @__PURE__ */ o(be, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1496
+ $.InputProps.endAdornment
1494
1497
  ] })
1495
1498
  })
1496
1499
  })
1497
1500
  )
1498
1501
  }
1499
1502
  ),
1500
- I && /* @__PURE__ */ o(Xt, { error: !0, children: I })
1503
+ D && /* @__PURE__ */ o(Xt, { error: !0, children: D })
1501
1504
  ]
1502
1505
  }
1503
1506
  );
1504
- }, Ro = tt({
1507
+ }, Ro = ot({
1505
1508
  palette: {
1506
1509
  primary: {
1507
1510
  dark: "#00A651",
@@ -1552,7 +1555,7 @@ const Ve = M(
1552
1555
  navBar: {
1553
1556
  backgroundColor: "#E8E8E8"
1554
1557
  }
1555
- }), Ho = tt({
1558
+ }), Ho = ot({
1556
1559
  palette: {
1557
1560
  primary: {
1558
1561
  main: "#007236",
@@ -1606,18 +1609,18 @@ const Ve = M(
1606
1609
  styleOverrides: {
1607
1610
  root: ({ theme: e }) => ({
1608
1611
  "&.Mui-selected": {
1609
- backgroundColor: he(
1612
+ backgroundColor: ge(
1610
1613
  e.palette.secondary.main,
1611
1614
  e.palette.action.selectedOpacity
1612
1615
  ),
1613
1616
  "&:hover": {
1614
- backgroundColor: he(
1617
+ backgroundColor: ge(
1615
1618
  e.palette.secondary.main,
1616
1619
  e.palette.action.selectedOpacity
1617
1620
  )
1618
1621
  },
1619
1622
  "&.Mui-focusVisible": {
1620
- backgroundColor: he(
1623
+ backgroundColor: ge(
1621
1624
  e.palette.secondary.main,
1622
1625
  e.palette.action.focusOpacity
1623
1626
  )
@@ -1644,17 +1647,17 @@ const Ve = M(
1644
1647
  backgroundColor: "#E8E8E8"
1645
1648
  }
1646
1649
  }), io = {
1647
- domainCode: kt,
1650
+ domainCode: yt,
1648
1651
  navBarOpen: Y,
1649
- navBarWidthOpen: Ct,
1650
- navBarWidthClosed: xt,
1651
- titleText: Ce,
1652
- topBarHeight: vt,
1653
- navBarTop: wt
1654
- }, Wo = K(() => ({ children: e }) => /* @__PURE__ */ o(st, { children: e })), ro = ({
1652
+ navBarWidthOpen: vt,
1653
+ navBarWidthClosed: wt,
1654
+ titleText: xe,
1655
+ topBarHeight: At,
1656
+ navBarTop: bt
1657
+ }, Wo = K(() => ({ children: e }) => /* @__PURE__ */ o(ct, { children: e })), ro = ({
1655
1658
  initialValues: e,
1656
1659
  children: t
1657
- }) => (lt(e), /* @__PURE__ */ o(_, { children: t })), zo = K(
1660
+ }) => (dt(e), /* @__PURE__ */ o(_, { children: t })), zo = K(
1658
1661
  (e) => ({ children: t }) => /* @__PURE__ */ o(
1659
1662
  ro,
1660
1663
  {
@@ -1672,18 +1675,18 @@ const Ve = M(
1672
1675
  return /* @__PURE__ */ o(on, { client: t, children: e });
1673
1676
  });
1674
1677
  export {
1675
- ht as AgDialog,
1678
+ ft as AgDialog,
1676
1679
  No as AppLayout,
1677
1680
  _o as AtomProvider,
1678
1681
  Fo as AuthGuard,
1679
- bt as Context,
1680
- Se as ContextError,
1682
+ kt as Context,
1683
+ ke as ContextError,
1681
1684
  Mo as DomainCodeDialog,
1682
1685
  Do as ExampleComponent,
1683
1686
  Oo as FetchAutocomplete,
1684
1687
  ro as HydrateAtoms,
1685
- dt as NAVBAR_WIDTH_CLOSED,
1686
- ct as NAVBAR_WIDTH_OPENED,
1688
+ pt as NAVBAR_WIDTH_CLOSED,
1689
+ ut as NAVBAR_WIDTH_OPENED,
1687
1690
  To as NavBar,
1688
1691
  $o as NavBarDarkStyledList,
1689
1692
  Io as NavBarLightStyledList,
@@ -1694,19 +1697,19 @@ export {
1694
1697
  Eo as SingleAutocomplete,
1695
1698
  to as atomStore,
1696
1699
  mn as buildNavBarState,
1697
- kt as domainCodeAtom,
1700
+ yt as domainCodeAtom,
1698
1701
  Ro as fed21Theme,
1699
1702
  Cn as getAuth0Expiry,
1700
1703
  Ho as internalAgSystemsTheme,
1701
1704
  q as navBarClasses,
1702
1705
  Y as navBarOpenAtom,
1703
- wt as navBarTopAtom,
1704
- xt as navBarWidthClosedAtom,
1705
- Ct as navBarWidthOpenAtom,
1706
- Ce as titleTextAtom,
1707
- vt as topBarHeightAtom,
1706
+ bt as navBarTopAtom,
1707
+ wt as navBarWidthClosedAtom,
1708
+ vt as navBarWidthOpenAtom,
1709
+ xe as titleTextAtom,
1710
+ At as topBarHeightAtom,
1708
1711
  Fn as topBarMiddleAtom,
1709
- gt as useAutocompleteOptions,
1712
+ mt as useAutocompleteOptions,
1710
1713
  fn as useNavBar,
1711
1714
  eo as useSaladBar,
1712
1715
  Wo as withAtomProvider,