@australiangreens/ag-internal-components 0.1.13 → 0.1.14

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
@@ -21,24 +21,24 @@ var Fe = (e, t) => {
21
21
  };
22
22
  var Ne = (e, t, n) => (ge(e, typeof t != "symbol" ? t + "" : t, n), n);
23
23
  var _ = (e, t, n) => new Promise((i, r) => {
24
- var s = (l) => {
24
+ var s = (c) => {
25
25
  try {
26
- c(n.next(l));
27
- } catch (p) {
28
- r(p);
26
+ l(n.next(c));
27
+ } catch (u) {
28
+ r(u);
29
29
  }
30
- }, d = (l) => {
30
+ }, d = (c) => {
31
31
  try {
32
- c(n.throw(l));
33
- } catch (p) {
34
- r(p);
32
+ l(n.throw(c));
33
+ } catch (u) {
34
+ r(u);
35
35
  }
36
- }, c = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(s, d);
37
- c((n = n.apply(e, t)).next());
36
+ }, l = (c) => c.done ? i(c.value) : Promise.resolve(c.value).then(s, d);
37
+ l((n = n.apply(e, t)).next());
38
38
  });
39
- import { jsxs as u, Fragment as N, jsx as o } from "react/jsx-runtime";
39
+ import { jsxs as p, Fragment as N, jsx as o } from "react/jsx-runtime";
40
40
  import { useState as F, createContext as Ze, useCallback as se, useContext as je, useEffect as K, createElement as ve, useMemo as Ht, useRef as fe } from "react";
41
- import { Typography as T, Button as J, Paper as et, Box as k, Drawer as Ae, styled as be, IconButton as Z, Container as tt, useTheme as le, useMediaQuery as Wt, Collapse as Ut, Avatar as Pe, Fade as zt, Skeleton as _e, Toolbar as Gt, Divider as Le, CssBaseline as Vt, Dialog as nt, LinearProgress as ot, DialogTitle as it, DialogContent as rt, DialogActions as at, Autocomplete as Se, TextField as ye, CircularProgress as Ie, Chip as qt, Tooltip as Xt, Stack as Qt, Snackbar as Yt, Alert as Kt, FormHelperText as Jt } from "@mui/material";
41
+ import { Typography as O, Button as J, Paper as et, Box as I, Drawer as Ae, styled as be, IconButton as Z, Container as tt, useTheme as le, useMediaQuery as Wt, Collapse as Ut, Avatar as Pe, Fade as zt, Skeleton as _e, Toolbar as Gt, Divider as Le, CssBaseline as Vt, Dialog as nt, LinearProgress as ot, DialogTitle as it, DialogContent as rt, DialogActions as at, Autocomplete as Se, TextField as ye, CircularProgress as Ie, Chip as qt, Tooltip as Xt, Stack as Qt, Snackbar as Yt, Alert as Kt, FormHelperText as Jt } from "@mui/material";
42
42
  import Zt from "@mui/material/CssBaseline";
43
43
  import { styled as W, createTheme as st, alpha as me } from "@mui/material/styles";
44
44
  import { AgError as jt } from "@australiangreens/ag-error";
@@ -57,9 +57,9 @@ import { Buffer as un } from "buffer";
57
57
  import pn from "@mui/material/Skeleton";
58
58
  function Oo({ text: e }) {
59
59
  const [t, n] = F(0);
60
- return /* @__PURE__ */ u(N, { children: [
61
- /* @__PURE__ */ o(T, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
62
- /* @__PURE__ */ o(T, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
60
+ return /* @__PURE__ */ p(N, { children: [
61
+ /* @__PURE__ */ o(O, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
62
+ /* @__PURE__ */ o(O, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
63
63
  /* @__PURE__ */ o(
64
64
  J,
65
65
  {
@@ -69,11 +69,11 @@ function Oo({ text: e }) {
69
69
  children: "Hello I am a button"
70
70
  }
71
71
  ),
72
- /* @__PURE__ */ u("p", { children: [
72
+ /* @__PURE__ */ p("p", { children: [
73
73
  "This is some text: ",
74
74
  /* @__PURE__ */ o("span", { children: e })
75
75
  ] }),
76
- /* @__PURE__ */ u(et, { children: [
76
+ /* @__PURE__ */ p(et, { children: [
77
77
  "This number will incremember when button pressed: ",
78
78
  t
79
79
  ] })
@@ -87,7 +87,7 @@ const ft = 330, mt = 73, z = "Navbar", q = {
87
87
  userInfoHolder: `${z}-userInfoHolder`,
88
88
  settings: `${z}-settings`,
89
89
  pieChartIcon: `${z}-pieChartIcon`
90
- }, hn = W(k, {
90
+ }, hn = W(I, {
91
91
  name: "NavBar"
92
92
  })(({ theme: e }) => ({
93
93
  [`&.${q.root}`]: {
@@ -108,7 +108,7 @@ const ft = 330, mt = 73, z = "Navbar", q = {
108
108
  marginTop: "64px",
109
109
  marginBottom: "16px"
110
110
  }
111
- })), Ct = () => ({
111
+ })), xt = () => ({
112
112
  position: "absolute",
113
113
  height: "100%",
114
114
  overflowX: "hidden",
@@ -118,9 +118,9 @@ const ft = 330, mt = 73, z = "Navbar", q = {
118
118
  // backgroundColor: '#e8e8e8',
119
119
  }), gn = () => a({
120
120
  width: ft
121
- }, Ct()), fn = () => a({
121
+ }, xt()), fn = () => a({
122
122
  width: mt
123
- }, Ct()), mn = W(Ae, {
123
+ }, xt()), mn = W(Ae, {
124
124
  shouldForwardProp: (e) => e !== "open"
125
125
  })(({ theme: e, open: t }) => a(a({
126
126
  width: t ? ft : mt,
@@ -136,23 +136,23 @@ const ft = 330, mt = 73, z = "Navbar", q = {
136
136
  class ke extends jt {
137
137
  }
138
138
  Ne(ke, "errorName", "ContextError");
139
- const xt = Ze(null), Cn = {}, xn = {}, vn = ({
140
- overrideState: e = Cn,
141
- overrideActions: t = xn,
139
+ const Ct = Ze(null), xn = {}, Cn = {}, vn = ({
140
+ overrideState: e = xn,
141
+ overrideActions: t = Cn,
142
142
  children: n
143
143
  }) => {
144
- const [{ open: i }, r] = F({ open: !0 }), s = se((l) => {
145
- r({ open: l });
144
+ const [{ open: i }, r] = F({ open: !0 }), s = se((c) => {
145
+ r({ open: c });
146
146
  }, []), d = se(() => {
147
- r((l) => y(a({}, l), { open: !l.open }));
148
- }, []), c = a(a({
147
+ r((c) => y(a({}, c), { open: !c.open }));
148
+ }, []), l = a(a({
149
149
  open: i,
150
150
  setOpen: s,
151
151
  toggleOpen: d
152
152
  }, e), t);
153
- return /* @__PURE__ */ o(xt.Provider, { value: c, children: n });
153
+ return /* @__PURE__ */ o(Ct.Provider, { value: l, children: n });
154
154
  }, wn = () => {
155
- const e = je(xt);
155
+ const e = je(Ct);
156
156
  if (e === null)
157
157
  throw new ke("Error: Tried to useNavBar outside of a <NavBarProvider>");
158
158
  return e;
@@ -242,7 +242,7 @@ function _o({
242
242
  children: t
243
243
  }) {
244
244
  const { open: n } = wn();
245
- return /* @__PURE__ */ u(hn, { className: q.root, "data-testid": e, children: [
245
+ return /* @__PURE__ */ p(hn, { className: q.root, "data-testid": e, children: [
246
246
  /* @__PURE__ */ o(Zt, {}),
247
247
  /* @__PURE__ */ o(
248
248
  mn,
@@ -321,10 +321,10 @@ function In({
321
321
  rightPanel: n,
322
322
  "data-testid": i
323
323
  }) {
324
- return /* @__PURE__ */ u(yn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
324
+ return /* @__PURE__ */ p(yn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
325
325
  /* @__PURE__ */ o("div", { className: B.topStripe }),
326
- /* @__PURE__ */ o("div", { className: B.titleBar, children: /* @__PURE__ */ u(k, { className: B.titleSlider, children: [
327
- t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ u(
326
+ /* @__PURE__ */ o("div", { className: B.titleBar, children: /* @__PURE__ */ p(I, { className: B.titleSlider, children: [
327
+ t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ p(
328
328
  Z,
329
329
  {
330
330
  className: B.leftPanelButton,
@@ -339,8 +339,8 @@ function In({
339
339
  ]
340
340
  }
341
341
  ),
342
- /* @__PURE__ */ o(T, { className: B.titleText, variant: "h6", noWrap: !0, children: e }),
343
- n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ u(
342
+ /* @__PURE__ */ o(O, { className: B.titleText, variant: "h6", noWrap: !0, children: e }),
343
+ n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ p(
344
344
  Z,
345
345
  {
346
346
  className: B.rightPanelButton,
@@ -388,7 +388,7 @@ const vt = 400, kn = be(Ae, {
388
388
  marginLeft: `${r}px`
389
389
  }))
390
390
  })
391
- ), Dn = be(k, {
391
+ ), $n = be(I, {
392
392
  shouldForwardProp: (e) => !["anchor"].includes(e)
393
393
  })(({ theme: e, anchor: t }) => y(a({
394
394
  display: "flex",
@@ -417,51 +417,51 @@ function Ue({
417
417
  titleText: r = "",
418
418
  width: s = vt,
419
419
  showCloseArrow: d = !0,
420
- debugOpacity: c = !1,
421
- headerBoxProps: l = {},
422
- onOpened: p,
420
+ debugOpacity: l = !1,
421
+ headerBoxProps: c = {},
422
+ onOpened: u,
423
423
  onClosed: g,
424
- "data-testid": m,
424
+ "data-testid": C,
425
425
  navBarOpen: w = !1,
426
426
  navBarWidthOpen: h = 0,
427
- navBarWidthClosed: S = 0
427
+ navBarWidthClosed: b = 0
428
428
  }) {
429
- return /* @__PURE__ */ u(
429
+ return /* @__PURE__ */ p(
430
430
  kn,
431
431
  {
432
432
  SlideProps: {
433
- onEntered: () => p == null ? void 0 : p(),
433
+ onEntered: () => u == null ? void 0 : u(),
434
434
  onExited: () => g == null ? void 0 : g()
435
435
  },
436
436
  variant: "persistent",
437
437
  anchor: t,
438
438
  open: n,
439
439
  width: s,
440
- debugOpacity: c,
441
- "data-testid": m,
440
+ debugOpacity: l,
441
+ "data-testid": C,
442
442
  navBarOpen: w,
443
443
  navBarWidthOpen: h,
444
- navBarWidthClosed: S,
444
+ navBarWidthClosed: b,
445
445
  children: [
446
- /* @__PURE__ */ o(Dn, y(a({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ u(N, { children: [
447
- /* @__PURE__ */ o(T, { variant: "h6", color: "inherit", component: "div", children: r }),
448
- d && /* @__PURE__ */ u(Z, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
446
+ /* @__PURE__ */ o($n, y(a({ anchor: t }, c), { children: t === "left" ? /* @__PURE__ */ p(N, { children: [
447
+ /* @__PURE__ */ o(O, { variant: "h6", color: "inherit", component: "div", children: r }),
448
+ d && /* @__PURE__ */ p(Z, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
449
449
  /* @__PURE__ */ o(dt, { "data-testid": "arrowbackicon" }),
450
450
  " "
451
451
  ] })
452
- ] }) : /* @__PURE__ */ u(N, { children: [
453
- d && /* @__PURE__ */ u(Z, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
452
+ ] }) : /* @__PURE__ */ p(N, { children: [
453
+ d && /* @__PURE__ */ p(Z, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
454
454
  /* @__PURE__ */ o(ct, {}),
455
455
  " "
456
456
  ] }),
457
- /* @__PURE__ */ o(T, { variant: "h6", color: "inherit", component: "div", children: r })
457
+ /* @__PURE__ */ o(O, { variant: "h6", color: "inherit", component: "div", children: r })
458
458
  ] }) })),
459
459
  e
460
460
  ]
461
461
  }
462
462
  );
463
463
  }
464
- const $n = W(k, {
464
+ const Dn = W(I, {
465
465
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
466
466
  name: "PanelAwareMargins"
467
467
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
@@ -491,7 +491,7 @@ const $n = W(k, {
491
491
  paddingTop: e.spacing(3),
492
492
  paddingBottom: e.spacing(3)
493
493
  // TODO: Remove max width
494
- })), Ce = !1, xe = !1, ie = {
494
+ })), xe = !1, Ce = !1, ie = {
495
495
  titleText: "",
496
496
  flavour: "push",
497
497
  width: vt,
@@ -512,18 +512,18 @@ function Lo({
512
512
  sidePanelsAreMutuallyExclusive: r = !0,
513
513
  debugOpacity: s = !1,
514
514
  pageContainerProps: d,
515
- pageContentDataTestId: c,
516
- topBarDataTestId: l,
517
- navBarOpen: p,
515
+ pageContentDataTestId: l,
516
+ topBarDataTestId: c,
517
+ navBarOpen: u,
518
518
  navBarWidthOpen: g,
519
- navBarWidthClosed: m
519
+ navBarWidthClosed: C
520
520
  }) {
521
- const [w, h] = F(Ce), [S, b] = F(xe), [I, $] = F(Ce), [E, O] = F(xe), L = n !== void 0, P = i !== void 0, {
521
+ const [w, h] = F(xe), [b, S] = F(Ce), [$, D] = F(xe), [E, T] = F(Ce), L = n !== void 0, P = i !== void 0, {
522
522
  titleText: v,
523
- content: D,
523
+ content: k,
524
524
  flavour: M,
525
525
  open: f,
526
- onChangeOpen: C,
526
+ onChangeOpen: m,
527
527
  width: x,
528
528
  arrowButtons: A,
529
529
  startOpen: H,
@@ -533,9 +533,9 @@ function Lo({
533
533
  } = n ? a(a({}, ie), n) : a({}, ie), {
534
534
  titleText: Bt,
535
535
  content: Ft,
536
- flavour: De,
536
+ flavour: $e,
537
537
  open: de,
538
- onChangeOpen: $e,
538
+ onChangeOpen: De,
539
539
  width: ue,
540
540
  arrowButtons: te,
541
541
  startOpen: ne,
@@ -544,16 +544,16 @@ function Lo({
544
544
  dataTestId: _t
545
545
  } = i ? a(a({}, ie), i) : a({}, ie);
546
546
  K(() => {
547
- H !== Ce && (h(H), $(H));
547
+ H !== xe && (h(H), D(H));
548
548
  }, [H]), K(() => {
549
- ne !== xe && (b(ne), O(ne));
549
+ ne !== Ce && (S(ne), T(ne));
550
550
  }, [ne]);
551
- const pe = f === void 0 ? w : f, he = de === void 0 ? S : de, Te = (U) => {
552
- f === void 0 && (h(U), r && P && (U ? (b(!1), O(S)) : b(E))), C && C(U);
551
+ const pe = f === void 0 ? w : f, he = de === void 0 ? b : de, Te = (U) => {
552
+ f === void 0 && (h(U), r && P && (U ? (S(!1), T(b)) : S(E))), m && m(U);
553
553
  }, Ee = (U) => {
554
- de === void 0 && (b(U), r && L && (U ? (h(!1), $(w)) : h(I))), $e && $e(U);
554
+ de === void 0 && (S(U), r && L && (U ? (h(!1), D(w)) : h($))), De && De(U);
555
555
  };
556
- return /* @__PURE__ */ u(k, { children: [
556
+ return /* @__PURE__ */ p(I, { children: [
557
557
  L && /* @__PURE__ */ o(
558
558
  Ue,
559
559
  {
@@ -567,10 +567,10 @@ function Lo({
567
567
  showCloseArrow: A === "both" || A === "close",
568
568
  onOpened: ee,
569
569
  onClosed: ce,
570
- navBarOpen: p,
570
+ navBarOpen: u,
571
571
  navBarWidthOpen: g,
572
- navBarWidthClosed: m,
573
- children: D
572
+ navBarWidthClosed: C,
573
+ children: k
574
574
  }
575
575
  ),
576
576
  P && /* @__PURE__ */ o(
@@ -586,9 +586,9 @@ function Lo({
586
586
  showCloseArrow: te === "both" || te === "close",
587
587
  onOpened: Nt,
588
588
  onClosed: Pt,
589
- navBarOpen: p,
589
+ navBarOpen: u,
590
590
  navBarWidthOpen: g,
591
- navBarWidthClosed: m,
591
+ navBarWidthClosed: C,
592
592
  children: Ft
593
593
  }
594
594
  ),
@@ -596,7 +596,7 @@ function Lo({
596
596
  In,
597
597
  a(a({
598
598
  titleText: t,
599
- "data-testid": l
599
+ "data-testid": c
600
600
  }, L && M === "push" ? {
601
601
  leftPanel: {
602
602
  open: pe,
@@ -604,7 +604,7 @@ function Lo({
604
604
  onOpen: () => Te(!0),
605
605
  showOpenArrow: A === "both" || A === "open"
606
606
  }
607
- } : {}), P && De === "push" ? {
607
+ } : {}), P && $e === "push" ? {
608
608
  rightPanel: {
609
609
  open: he,
610
610
  width: ue,
@@ -614,19 +614,19 @@ function Lo({
614
614
  } : {})
615
615
  ),
616
616
  /* @__PURE__ */ o(
617
- $n,
617
+ Dn,
618
618
  y(a(a({}, M === "push" ? {
619
619
  leftPanel: {
620
620
  open: pe,
621
621
  width: x
622
622
  }
623
- } : {}), De === "push" ? {
623
+ } : {}), $e === "push" ? {
624
624
  rightPanel: {
625
625
  open: he,
626
626
  width: ue
627
627
  }
628
628
  } : {}), {
629
- children: /* @__PURE__ */ o(Tn, y(a({ "data-testid": c }, d), { children: e }))
629
+ children: /* @__PURE__ */ o(Tn, y(a({ "data-testid": l }, d), { children: e }))
630
630
  })
631
631
  )
632
632
  ] });
@@ -646,7 +646,7 @@ const re = "Navbar", Y = {
646
646
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
647
647
  // settings: `${PREFIX}-settings`,
648
648
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
649
- }, Pn = W(k, { name: "NavBar" })(({ theme: e }) => ({
649
+ }, Pn = W(I, { name: "NavBar" })(({ theme: e }) => ({
650
650
  [`&.${Y.root}`]: {
651
651
  display: "flex"
652
652
  },
@@ -747,8 +747,8 @@ function Mn(e) {
747
747
  const Ve = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], qe = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
748
748
  function Rn({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
749
749
  const r = le();
750
- return /* @__PURE__ */ u(
751
- k,
750
+ return /* @__PURE__ */ p(
751
+ I,
752
752
  {
753
753
  sx: {
754
754
  paddingTop: 3,
@@ -759,7 +759,7 @@ function Rn({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
759
759
  },
760
760
  children: [
761
761
  !i && /* @__PURE__ */ o(
762
- k,
762
+ I,
763
763
  {
764
764
  sx: {
765
765
  width: n ? "5rem" : "2rem",
@@ -781,14 +781,14 @@ function Rn({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
781
781
  }
782
782
  ),
783
783
  i && /* @__PURE__ */ o(
784
- k,
784
+ I,
785
785
  {
786
786
  sx: {
787
787
  width: n ? "5rem" : "2rem",
788
788
  transition: n ? X(r, ["width", "height"], "entering") : X(r, ["width", "height"], "leaving"),
789
789
  aspectRatio: 1
790
790
  },
791
- children: e != null && e.name ? /* @__PURE__ */ o(N, { children: /* @__PURE__ */ u(Re, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: n ? "80" : "32", children: [
791
+ children: e != null && e.name ? /* @__PURE__ */ o(N, { children: /* @__PURE__ */ p(Re, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: n ? "80" : "32", children: [
792
792
  " ",
793
793
  qe(e == null ? void 0 : e.name),
794
794
  " ",
@@ -796,9 +796,9 @@ function Rn({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
796
796
  ] }) }) : /* @__PURE__ */ o(Re, {})
797
797
  }
798
798
  ),
799
- /* @__PURE__ */ o(_n, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(zt, { in: n, children: /* @__PURE__ */ u(k, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
800
- e != null && e.name ? /* @__PURE__ */ o(T, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ o(_e, { animation: !1, width: "50%" }),
801
- t ? /* @__PURE__ */ o(T, { children: t.toUpperCase() }) : /* @__PURE__ */ o(_e, { animation: !1, width: "25%" })
799
+ /* @__PURE__ */ o(_n, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(zt, { in: n, children: /* @__PURE__ */ p(I, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
800
+ e != null && e.name ? /* @__PURE__ */ o(O, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ o(_e, { animation: !1, width: "50%" }),
801
+ t ? /* @__PURE__ */ o(O, { children: t.toUpperCase() }) : /* @__PURE__ */ o(_e, { animation: !1, width: "25%" })
802
802
  ] }) }) })
803
803
  ]
804
804
  }
@@ -812,12 +812,12 @@ function Hn({
812
812
  top: r,
813
813
  middle: s,
814
814
  bottom: d,
815
- user: c,
816
- domainCode: l,
817
- useNewAvatar: p = !1
815
+ user: l,
816
+ domainCode: c,
817
+ useNewAvatar: u = !1
818
818
  }) {
819
- const g = wt(), m = ut(j);
820
- return /* @__PURE__ */ o(Pn, { className: Y.root, "data-testid": i, children: /* @__PURE__ */ u(
819
+ const g = wt(), C = ut(j);
820
+ return /* @__PURE__ */ o(Pn, { className: Y.root, "data-testid": i, children: /* @__PURE__ */ p(
821
821
  Ln,
822
822
  {
823
823
  open: e,
@@ -829,19 +829,19 @@ function Hn({
829
829
  component: "nav"
830
830
  },
831
831
  onClose: () => {
832
- m(!1);
832
+ C(!1);
833
833
  },
834
834
  isSmallScreen: g,
835
835
  children: [
836
836
  !g && /* @__PURE__ */ o(Gt, {}),
837
- r && /* @__PURE__ */ u(k, { flexGrow: "0", children: [
837
+ r && /* @__PURE__ */ p(I, { flexGrow: "0", children: [
838
838
  r,
839
839
  /* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } })
840
840
  ] }),
841
- /* @__PURE__ */ o(k, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ o(Nn, { links: s }) : s }),
842
- /* @__PURE__ */ u(k, { flexGrow: "0", children: [
841
+ /* @__PURE__ */ o(I, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ o(Nn, { links: s }) : s }),
842
+ /* @__PURE__ */ p(I, { flexGrow: "0", children: [
843
843
  /* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } }),
844
- /* @__PURE__ */ o(Rn, { user: c, domainCode: l, open: e, useNewAvatar: p }),
844
+ /* @__PURE__ */ o(Rn, { user: l, domainCode: c, open: e, useNewAvatar: u }),
845
845
  d && /* @__PURE__ */ o(N, { children: d })
846
846
  ] })
847
847
  ]
@@ -855,14 +855,14 @@ function Wn({
855
855
  noPadding: i
856
856
  }) {
857
857
  return /* @__PURE__ */ o(
858
- k,
858
+ I,
859
859
  {
860
860
  sx: {
861
861
  overflow: "auto",
862
862
  height: `calc(100vh - ${t}px)`,
863
863
  flexGrow: 1
864
864
  },
865
- children: i ? /* @__PURE__ */ o(k, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ o(
865
+ children: i ? /* @__PURE__ */ o(I, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ o(
866
866
  tt,
867
867
  {
868
868
  component: "main",
@@ -884,8 +884,8 @@ function Gn({
884
884
  "data-testid": n,
885
885
  middle: i
886
886
  }) {
887
- const r = ut(j), s = () => r((l) => !l), d = le(), c = wt();
888
- return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ u(
887
+ const r = ut(j), s = () => r((c) => !c), d = le(), l = wt();
888
+ return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ p(
889
889
  et,
890
890
  {
891
891
  square: !0,
@@ -900,7 +900,7 @@ function Gn({
900
900
  gap: 2,
901
901
  flexShrink: 0,
902
902
  height: t,
903
- zIndex: c ? 0 : d.zIndex.drawer + 101
903
+ zIndex: l ? 0 : d.zIndex.drawer + 101
904
904
  },
905
905
  children: [
906
906
  /* @__PURE__ */ o(
@@ -913,7 +913,7 @@ function Gn({
913
913
  children: /* @__PURE__ */ o(tn, { fontSize: "medium" })
914
914
  }
915
915
  ),
916
- /* @__PURE__ */ o(T, { className: zn.titleText, variant: "h6", component: "h1", children: e }),
916
+ /* @__PURE__ */ o(O, { className: zn.titleText, variant: "h6", component: "h1", children: e }),
917
917
  i
918
918
  ]
919
919
  }
@@ -927,50 +927,50 @@ function Ho({
927
927
  pageContentDataTestId: r,
928
928
  topBarDataTestId: s,
929
929
  navBarDataTestId: d,
930
- navBarMiddle: c,
931
- navBarBottom: l,
932
- user: p,
930
+ navBarMiddle: l,
931
+ navBarBottom: c,
932
+ user: u,
933
933
  domainCode: g,
934
- useNewAvatar: m = !1
934
+ useNewAvatar: C = !1
935
935
  }) {
936
936
  ht([
937
937
  [j, n != null ? n : !0],
938
938
  [we, t != null ? t : ""]
939
939
  ]);
940
- const w = Me(j), [h] = V(At), [S] = V(bt), b = Me(we), [I] = V(St), [$] = V(Fn), [E] = V(yt);
941
- return /* @__PURE__ */ u(k, { children: [
940
+ const w = Me(j), [h] = V(At), [b] = V(bt), S = Me(we), [$] = V(St), [D] = V(Fn), [E] = V(yt);
941
+ return /* @__PURE__ */ p(I, { children: [
942
942
  /* @__PURE__ */ o(Vt, {}),
943
943
  /* @__PURE__ */ o(
944
944
  Gn,
945
945
  {
946
- titleText: b,
946
+ titleText: S,
947
947
  "data-testid": s,
948
- height: I,
949
- middle: $
948
+ height: $,
949
+ middle: D
950
950
  }
951
951
  ),
952
- /* @__PURE__ */ u(k, { sx: { display: "flex" }, children: [
952
+ /* @__PURE__ */ p(I, { sx: { display: "flex" }, children: [
953
953
  /* @__PURE__ */ o(
954
954
  Hn,
955
955
  {
956
956
  open: w,
957
957
  top: E,
958
- middle: c,
959
- bottom: l,
960
- user: p,
958
+ middle: l,
959
+ bottom: c,
960
+ user: u,
961
961
  domainCode: g,
962
962
  widthOpen: h,
963
- widthClosed: S,
964
- offsetTop: I,
963
+ widthClosed: b,
964
+ offsetTop: $,
965
965
  "data-testid": d,
966
- useNewAvatar: m
966
+ useNewAvatar: C
967
967
  }
968
968
  ),
969
969
  /* @__PURE__ */ o(
970
970
  Wn,
971
971
  y(a({
972
972
  "data-testid": r,
973
- topBarHeight: I
973
+ topBarHeight: $
974
974
  }, i), {
975
975
  children: e
976
976
  })
@@ -986,48 +986,48 @@ const kt = ({
986
986
  primaryButton: r,
987
987
  secondaryButton: s,
988
988
  onClose: d,
989
- sx: c,
990
- "data-testid": l,
991
- disableCloseOnBackdropOrEscape: p = !1,
989
+ sx: l,
990
+ "data-testid": c,
991
+ disableCloseOnBackdropOrEscape: u = !1,
992
992
  isLoading: g = !1
993
993
  }) => {
994
- var h, S;
995
- const [m, w] = F(!1);
996
- return /* @__PURE__ */ u(
994
+ var h, b;
995
+ const [C, w] = F(!1);
996
+ return /* @__PURE__ */ p(
997
997
  nt,
998
998
  {
999
999
  open: e,
1000
- onClose: (b, I) => _(void 0, null, function* () {
1001
- p && (I === "backdropClick" || I === "escapeKeyDown") || m || (s != null && s.onClick ? yield s.onClick() : d());
1000
+ onClose: (S, $) => _(void 0, null, function* () {
1001
+ u && ($ === "backdropClick" || $ === "escapeKeyDown") || C || (s != null && s.onClick ? yield s.onClick() : d());
1002
1002
  }),
1003
1003
  fullWidth: !0,
1004
1004
  maxWidth: i != null ? i : "xs",
1005
- "data-testid": l,
1006
- sx: c,
1005
+ "data-testid": c,
1006
+ sx: l,
1007
1007
  children: [
1008
1008
  g && /* @__PURE__ */ o(ot, { sx: { height: "4px", marginBottom: "-4px" } }),
1009
1009
  /* @__PURE__ */ o(it, { children: t }),
1010
1010
  /* @__PURE__ */ o(rt, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
1011
- /* @__PURE__ */ u(at, { children: [
1011
+ /* @__PURE__ */ p(at, { children: [
1012
1012
  /* @__PURE__ */ o(
1013
1013
  J,
1014
1014
  {
1015
1015
  onClick: (h = s == null ? void 0 : s.onClick) != null ? h : d,
1016
1016
  "data-testid": s == null ? void 0 : s.testId,
1017
- disabled: (s == null ? void 0 : s.disabled) || m,
1017
+ disabled: (s == null ? void 0 : s.disabled) || C,
1018
1018
  color: s == null ? void 0 : s.buttonColor,
1019
- children: (S = s == null ? void 0 : s.text) != null ? S : "Cancel"
1019
+ children: (b = s == null ? void 0 : s.text) != null ? b : "Cancel"
1020
1020
  }
1021
1021
  ),
1022
1022
  r && /* @__PURE__ */ o(
1023
1023
  J,
1024
1024
  {
1025
1025
  onClick: () => _(void 0, null, function* () {
1026
- var b;
1027
- w(!0), yield (b = r.onClick) == null ? void 0 : b.call(r), w(!1);
1026
+ var S;
1027
+ w(!0), yield (S = r.onClick) == null ? void 0 : S.call(r), w(!1);
1028
1028
  }),
1029
1029
  "data-testid": r.testId,
1030
- disabled: r.disabled || m,
1030
+ disabled: r.disabled || C,
1031
1031
  color: r == null ? void 0 : r.buttonColor,
1032
1032
  children: r.text
1033
1033
  }
@@ -1036,7 +1036,7 @@ const kt = ({
1036
1036
  ]
1037
1037
  }
1038
1038
  );
1039
- }, Dt = ({
1039
+ }, $t = ({
1040
1040
  minLength: e,
1041
1041
  preLoadedOptions: t,
1042
1042
  lookup: n,
@@ -1057,49 +1057,49 @@ function Wo({
1057
1057
  label: r,
1058
1058
  value: s,
1059
1059
  "data-testid": d,
1060
- sx: c,
1061
- boxSx: l,
1062
- textFieldColor: p,
1060
+ sx: l,
1061
+ boxSx: c,
1062
+ textFieldColor: u,
1063
1063
  textFieldVariant: g = "filled",
1064
- loadingText: m = "Loading...",
1064
+ loadingText: C = "Loading...",
1065
1065
  noOptionsText: w = "No options",
1066
1066
  popupIcon: h = /* @__PURE__ */ o(on, {}),
1067
- error: S = !1,
1068
- helperText: b = "",
1069
- preLoadedOptions: I = void 0,
1070
- disablePortal: $ = !1,
1067
+ error: b = !1,
1068
+ helperText: S = "",
1069
+ preLoadedOptions: $ = void 0,
1070
+ disablePortal: D = !1,
1071
1071
  disableIconFlip: E = !1
1072
1072
  }) {
1073
- const [O, L] = F(""), P = (f, C) => {
1074
- const x = s.filter((A) => A.id !== C);
1073
+ const [T, L] = F(""), P = (f, m) => {
1074
+ const x = s.filter((A) => A.id !== m);
1075
1075
  n(x, "delete", f);
1076
- }, { data: v, isLoading: D } = Dt({
1077
- inputValue: O,
1076
+ }, { data: v, isLoading: k } = $t({
1077
+ inputValue: T,
1078
1078
  label: r,
1079
1079
  lookup: e,
1080
1080
  minLength: i,
1081
- preLoadedOptions: I
1082
- }), M = O.length >= i;
1083
- return /* @__PURE__ */ u("div", { "data-testid": d, children: [
1081
+ preLoadedOptions: $
1082
+ }), M = T.length >= i;
1083
+ return /* @__PURE__ */ p("div", { "data-testid": d, children: [
1084
1084
  /* @__PURE__ */ o(
1085
1085
  Se,
1086
1086
  {
1087
- sx: a(a({}, c), E ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1087
+ sx: a(a({}, l), E ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1088
1088
  "data-testid": d ? `${d}:Autocomplete` : void 0,
1089
- disablePortal: $,
1089
+ disablePortal: D,
1090
1090
  multiple: !0,
1091
1091
  getOptionLabel: (f) => typeof f == "string" ? f : f.label,
1092
- loading: M ? D : !1,
1092
+ loading: M ? k : !1,
1093
1093
  options: [...s, ...v != null ? v : []],
1094
1094
  filterSelectedOptions: !0,
1095
1095
  includeInputInList: !0,
1096
1096
  value: s,
1097
- onChange: (f, C, x) => {
1098
- n(C, x, f);
1097
+ onChange: (f, m, x) => {
1098
+ n(m, x, f);
1099
1099
  },
1100
- onInputChange: (f, C) => L(C),
1100
+ onInputChange: (f, m) => L(m),
1101
1101
  noOptionsText: M ? w : "Start typing to search",
1102
- loadingText: m,
1102
+ loadingText: C,
1103
1103
  popupIcon: h,
1104
1104
  renderInput: (f) => /* @__PURE__ */ o(
1105
1105
  ye,
@@ -1107,34 +1107,34 @@ function Wo({
1107
1107
  label: r,
1108
1108
  fullWidth: !0,
1109
1109
  variant: g,
1110
- error: S,
1111
- helperText: b,
1110
+ error: b,
1111
+ helperText: S,
1112
1112
  InputProps: y(a({}, f.InputProps), {
1113
- endAdornment: /* @__PURE__ */ u(N, { children: [
1114
- D ? /* @__PURE__ */ o(Ie, { color: "inherit", size: 20 }) : null,
1113
+ endAdornment: /* @__PURE__ */ p(N, { children: [
1114
+ k ? /* @__PURE__ */ o(Ie, { color: "inherit", size: 20 }) : null,
1115
1115
  f.InputProps.endAdornment
1116
1116
  ] })
1117
1117
  }),
1118
1118
  "data-testid": d ? `${d}:Autocomplete:TextField` : void 0,
1119
- onKeyDown: (C) => {
1120
- (C.key === "Backspace" || C.key === "Delete") && C.stopPropagation();
1119
+ onKeyDown: (m) => {
1120
+ (m.key === "Backspace" || m.key === "Delete") && m.stopPropagation();
1121
1121
  },
1122
- color: p
1122
+ color: u
1123
1123
  })
1124
1124
  ),
1125
1125
  renderTags: () => null,
1126
- isOptionEqualToValue: (f, C) => f.id === C.id,
1127
- renderOption: (f, C, x) => {
1126
+ isOptionEqualToValue: (f, m) => f.id === m.id,
1127
+ renderOption: (f, m, x) => {
1128
1128
  if (t) {
1129
- const A = an(C.label, x.inputValue, {
1129
+ const A = an(m.label, x.inputValue, {
1130
1130
  insideWords: !0,
1131
1131
  findAllOccurrences: !0
1132
- }), H = sn(C.label, A);
1132
+ }), H = sn(m.label, A);
1133
1133
  return /* @__PURE__ */ ve(
1134
1134
  "li",
1135
1135
  y(a({}, f), {
1136
- key: C.id,
1137
- "data-testid": d ? `${d}:Autocomplete:option(${C.id.toString()})` : void 0
1136
+ key: m.id,
1137
+ "data-testid": d ? `${d}:Autocomplete:option(${m.id.toString()})` : void 0
1138
1138
  }),
1139
1139
  /* @__PURE__ */ o("div", { children: H.map((ee, ce) => /* @__PURE__ */ o(
1140
1140
  "span",
@@ -1151,15 +1151,15 @@ function Wo({
1151
1151
  return /* @__PURE__ */ ve(
1152
1152
  "li",
1153
1153
  y(a({}, f), {
1154
- key: C.id,
1155
- "data-testid": d ? `${d}:option(${C.id.toString()})` : void 0
1154
+ key: m.id,
1155
+ "data-testid": d ? `${d}:option(${m.id.toString()})` : void 0
1156
1156
  }),
1157
- C.label
1157
+ m.label
1158
1158
  );
1159
1159
  }
1160
1160
  }
1161
1161
  ),
1162
- s.length > 0 && /* @__PURE__ */ o(k, { sx: l, children: s.map((f) => /* @__PURE__ */ o(
1162
+ s.length > 0 && /* @__PURE__ */ o(I, { sx: c, children: s.map((f) => /* @__PURE__ */ o(
1163
1163
  qt,
1164
1164
  {
1165
1165
  sx: {
@@ -1182,11 +1182,11 @@ function Wo({
1182
1182
  }
1183
1183
  ]
1184
1184
  },
1185
- children: /* @__PURE__ */ o(T, { style: { whiteSpace: "normal" }, children: f.chipLabel ? f.chipLabel : f.label })
1185
+ children: /* @__PURE__ */ o(O, { style: { whiteSpace: "normal" }, children: f.chipLabel ? f.chipLabel : f.label })
1186
1186
  }
1187
1187
  ),
1188
1188
  "data-testid": d ? `${d}:Chip(${f.id.toString()})` : void 0,
1189
- onDelete: (C) => P(C, f.id),
1189
+ onDelete: (m) => P(m, f.id),
1190
1190
  deleteIcon: /* @__PURE__ */ o(
1191
1191
  nn,
1192
1192
  {
@@ -1207,65 +1207,65 @@ const Uo = /MUI: The value provided to.*is invalid/i, zo = ({
1207
1207
  sx: r,
1208
1208
  textFieldColor: s,
1209
1209
  textFieldVariant: d = "filled",
1210
- error: c = !1,
1211
- "data-testid": l,
1212
- noOptionsText: p = "No options",
1210
+ error: l = !1,
1211
+ "data-testid": c,
1212
+ noOptionsText: u = "No options",
1213
1213
  minLength: g = 3,
1214
- disablePortal: m = !1,
1214
+ disablePortal: C = !1,
1215
1215
  preLoadedOptions: w,
1216
1216
  helperText: h = "",
1217
- disabled: S,
1218
- popupIcon: b,
1219
- disableIconFlip: I
1217
+ disabled: b,
1218
+ popupIcon: S,
1219
+ disableIconFlip: $
1220
1220
  }) => {
1221
- const [$, E] = F(""), { data: O, isLoading: L } = Dt({
1222
- inputValue: $,
1221
+ const [D, E] = F(""), { data: T, isLoading: L } = $t({
1222
+ inputValue: D,
1223
1223
  label: n,
1224
1224
  lookup: e,
1225
1225
  minLength: g != null ? g : 0,
1226
1226
  preLoadedOptions: w
1227
- }), P = $.length >= g;
1228
- return /* @__PURE__ */ o("div", { "data-testid": l, children: /* @__PURE__ */ o(Qt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
1227
+ }), P = D.length >= g;
1228
+ return /* @__PURE__ */ o("div", { "data-testid": c, children: /* @__PURE__ */ o(Qt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
1229
1229
  Se,
1230
1230
  {
1231
- sx: a(a({}, r), I ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1232
- "data-testid": l ? `${l}:Autocomplete` : void 0,
1231
+ sx: a(a({}, r), $ ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1232
+ "data-testid": c ? `${c}:Autocomplete` : void 0,
1233
1233
  loading: P ? L : !1,
1234
- options: O != null ? O : [],
1235
- onChange: (v, D, M) => {
1236
- t(v, D, M);
1234
+ options: T != null ? T : [],
1235
+ onChange: (v, k, M) => {
1236
+ t(v, k, M);
1237
1237
  },
1238
- disablePortal: m,
1238
+ disablePortal: C,
1239
1239
  filterOptions: (v) => v,
1240
1240
  value: i,
1241
- noOptionsText: P ? p : "Start typing to search",
1241
+ noOptionsText: P ? u : "Start typing to search",
1242
1242
  getOptionLabel: (v) => v.label,
1243
- popupIcon: b,
1243
+ popupIcon: S,
1244
1244
  renderInput: (v) => /* @__PURE__ */ o(
1245
1245
  ye,
1246
1246
  y(a({
1247
- "data-testid": l ? `${l}:Autocomplete:TextField` : void 0
1247
+ "data-testid": c ? `${c}:Autocomplete:TextField` : void 0
1248
1248
  }, v), {
1249
1249
  variant: d,
1250
1250
  label: n,
1251
1251
  color: s,
1252
- error: c,
1252
+ error: l,
1253
1253
  helperText: h
1254
1254
  })
1255
1255
  ),
1256
- isOptionEqualToValue: (v, D) => v.id === D.id,
1257
- onInputChange: (v, D) => {
1258
- E(D);
1256
+ isOptionEqualToValue: (v, k) => v.id === k.id,
1257
+ onInputChange: (v, k) => {
1258
+ E(k);
1259
1259
  },
1260
- renderOption: (v, D) => /* @__PURE__ */ ve(
1260
+ renderOption: (v, k) => /* @__PURE__ */ ve(
1261
1261
  "li",
1262
1262
  y(a({}, v), {
1263
- key: D.id,
1264
- "data-testid": l ? `${l}:Autocomplete:option(${D.id.toString()})` : void 0
1263
+ key: k.id,
1264
+ "data-testid": c ? `${c}:Autocomplete:option(${k.id.toString()})` : void 0
1265
1265
  }),
1266
- D.label
1266
+ k.label
1267
1267
  ),
1268
- disabled: S
1268
+ disabled: b
1269
1269
  }
1270
1270
  ) }) });
1271
1271
  }, Vn = (e) => {
@@ -1286,9 +1286,9 @@ const Uo = /MUI: The value provided to.*is invalid/i, zo = ({
1286
1286
  closeHandler: t,
1287
1287
  setAuth0ExpiryTime: n
1288
1288
  }) => {
1289
- const { logout: i, getAccessTokenSilently: r } = gt(), [s, d] = F(0), c = () => _(void 0, null, function* () {
1289
+ const { logout: i, getAccessTokenSilently: r } = gt(), [s, d] = F(0), l = () => _(void 0, null, function* () {
1290
1290
  i({ logoutParams: { returnTo: `${window.location.origin}` } });
1291
- }), l = () => _(void 0, null, function* () {
1291
+ }), c = () => _(void 0, null, function* () {
1292
1292
  d(s + 1), t();
1293
1293
  });
1294
1294
  return K(() => {
@@ -1304,14 +1304,14 @@ const Uo = /MUI: The value provided to.*is invalid/i, zo = ({
1304
1304
  isOpen: e,
1305
1305
  primaryButton: {
1306
1306
  text: "Continue",
1307
- onClick: l,
1307
+ onClick: c,
1308
1308
  disabled: !1,
1309
1309
  testId: "PreferencesDialog",
1310
1310
  buttonColor: "secondary"
1311
1311
  },
1312
1312
  secondaryButton: {
1313
1313
  text: "Log out",
1314
- onClick: c,
1314
+ onClick: l,
1315
1315
  disabled: !1,
1316
1316
  testId: "PreferencesDialog",
1317
1317
  buttonColor: "secondary"
@@ -1349,11 +1349,11 @@ function Vo({
1349
1349
  onError: r = () => {
1350
1350
  }
1351
1351
  }) {
1352
- var m, w;
1353
- const { isAuthenticated: s, isLoading: d, error: c, loginWithRedirect: l, logout: p } = gt();
1352
+ var C, w;
1353
+ const { isAuthenticated: s, isLoading: d, error: l, loginWithRedirect: c, logout: u } = gt();
1354
1354
  K(() => {
1355
- c && r(c);
1356
- }, [c, r]);
1355
+ l && r(l);
1356
+ }, [l, r]);
1357
1357
  const g = Ht(
1358
1358
  () => ({
1359
1359
  appState: {
@@ -1363,48 +1363,48 @@ function Vo({
1363
1363
  []
1364
1364
  );
1365
1365
  if (K(() => {
1366
- d || s || c || l(g);
1367
- }, [d, s, c, l, r, g]), c) {
1366
+ d || s || l || c(g);
1367
+ }, [d, s, l, c, r, g]), l) {
1368
1368
  if (i || console.error(
1369
1369
  `Error detected in AuthGuard [isAuthenticated=${s},isLoading=${d}]`,
1370
- c
1370
+ l
1371
1371
  ), n === "all")
1372
- throw c;
1373
- if (qn(c)) {
1374
- let h = "Auth error", S = "An unknown Auth0 error occurred.";
1375
- if (Xn(c))
1376
- h = "Unauthorised", S = `You are not authorised to access ${t}.`;
1377
- else if (Qn(c))
1378
- h = "App not authorised", S = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
1379
- else if (Yn(c))
1380
- h = "Auth0 script execution time exceeded", S = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";
1381
- else if (c.message === "Invalid state") {
1382
- const b = localStorage.getItem("auth0_redirect_count");
1383
- b ? b && parseInt(b) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(b) + 1)), l(g)) : (localStorage.setItem("auth0_redirect_count", "1"), l(g));
1372
+ throw l;
1373
+ if (qn(l)) {
1374
+ let h = "Auth error", b = "An unknown Auth0 error occurred.";
1375
+ if (Xn(l))
1376
+ h = "Unauthorised", b = `You are not authorised to access ${t}.`;
1377
+ else if (Qn(l))
1378
+ h = "App not authorised", b = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
1379
+ else if (Yn(l))
1380
+ h = "Auth0 script execution time exceeded", b = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";
1381
+ else if (l.message === "Invalid state") {
1382
+ const S = localStorage.getItem("auth0_redirect_count");
1383
+ S ? S && parseInt(S) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(S) + 1)), c(g)) : (localStorage.setItem("auth0_redirect_count", "1"), c(g));
1384
1384
  } else if (n === "unknown")
1385
- throw c;
1386
- return /* @__PURE__ */ u(nt, { open: !0, children: [
1385
+ throw l;
1386
+ return /* @__PURE__ */ p(nt, { open: !0, children: [
1387
1387
  /* @__PURE__ */ o(it, { children: h }),
1388
- /* @__PURE__ */ u(rt, { children: [
1389
- /* @__PURE__ */ o(T, { children: S }),
1388
+ /* @__PURE__ */ p(rt, { children: [
1389
+ /* @__PURE__ */ o(O, { children: b }),
1390
1390
  /* @__PURE__ */ o("br", {}),
1391
- /* @__PURE__ */ o(T, { variant: "subtitle2", children: "Details from Auth0" }),
1392
- /* @__PURE__ */ u(T, { variant: "body2", children: [
1391
+ /* @__PURE__ */ o(O, { variant: "subtitle2", children: "Details from Auth0" }),
1392
+ /* @__PURE__ */ p(O, { variant: "body2", children: [
1393
1393
  "error: ",
1394
- (m = c == null ? void 0 : c.error) != null ? m : "N/A"
1394
+ (C = l == null ? void 0 : l.error) != null ? C : "N/A"
1395
1395
  ] }),
1396
- /* @__PURE__ */ u(T, { variant: "body2", children: [
1396
+ /* @__PURE__ */ p(O, { variant: "body2", children: [
1397
1397
  "description: ",
1398
- (w = c == null ? void 0 : c.error_description) != null ? w : "N/A"
1398
+ (w = l == null ? void 0 : l.error_description) != null ? w : "N/A"
1399
1399
  ] })
1400
1400
  ] }),
1401
- /* @__PURE__ */ u(at, { children: [
1401
+ /* @__PURE__ */ p(at, { children: [
1402
1402
  h === "Auth0 script execution time exceeded" && /* @__PURE__ */ o(J, { href: window.location.origin + window.location.pathname, children: "Reload" }),
1403
- /* @__PURE__ */ o(J, { onClick: () => p({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
1403
+ /* @__PURE__ */ o(J, { onClick: () => u({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
1404
1404
  ] })
1405
1405
  ] });
1406
1406
  } else if (n === "unknown")
1407
- throw c;
1407
+ throw l;
1408
1408
  }
1409
1409
  return s ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ o(N, { children: e })) : /* @__PURE__ */ o(pn, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
1410
1410
  }
@@ -1428,7 +1428,7 @@ const Kn = {
1428
1428
  })(), eo = {
1429
1429
  borderBottomLeftRadius: "0px",
1430
1430
  borderBottomRightRadius: "0px"
1431
- }, to = {}, no = {}, $t = Ze(null);
1431
+ }, to = {}, no = {}, Dt = Ze(null);
1432
1432
  function oo(s) {
1433
1433
  var d = s, {
1434
1434
  overrideState: e = to,
@@ -1441,55 +1441,55 @@ function oo(s) {
1441
1441
  "shouldClose",
1442
1442
  "children"
1443
1443
  ]);
1444
- var C;
1445
- const [{ open: c }, l] = F({ open: !1 }), p = fe([]), g = fe(Date.now()), m = fe(0), w = se((x) => {
1446
- l({ open: x });
1444
+ var m;
1445
+ const [{ open: l }, c] = F({ open: !1 }), u = fe([]), g = fe(Date.now()), C = fe(0), w = se((x) => {
1446
+ c({ open: x });
1447
1447
  }, []), h = se((x = {}) => {
1448
- m.current += 1, p.current.length >= Qe && Date.now() - g.current >= Ye && (g.current = Date.now(), console.error(
1449
- `SaladBarProvider: MAX_QUEUE_LENGTH (${Qe}) hit ${m.current} times in last ${Ye}ms)`
1450
- ), m.current = 0);
1448
+ C.current += 1, u.current.length >= Qe && Date.now() - g.current >= Ye && (g.current = Date.now(), console.error(
1449
+ `SaladBarProvider: MAX_QUEUE_LENGTH (${Qe}) hit ${C.current} times in last ${Ye}ms)`
1450
+ ), C.current = 0);
1451
1451
  const A = a(y(a({}, Xe), {
1452
1452
  key: jn()
1453
1453
  }), x);
1454
- return p.current.push(A), p.current.length === 1 && l({ open: !0 }), A.key;
1455
- }, []), S = (x = "", A = {}) => h(a({ message: x, severity: "success" }, A)), b = (x = "", A = {}) => h(a({ message: x, severity: "info" }, A)), I = (x = "", A = {}) => h(a({ message: x, severity: "warning" }, A)), $ = (x = "", A = {}) => h(a({ message: x, severity: "error" }, A)), E = (x) => {
1456
- const A = p.current.findIndex((H) => H.key === x);
1454
+ return u.current.push(A), u.current.length === 1 && c({ open: !0 }), A.key;
1455
+ }, []), b = (x = "", A = {}) => h(a({ message: x, severity: "success" }, A)), S = (x = "", A = {}) => h(a({ message: x, severity: "info" }, A)), $ = (x = "", A = {}) => h(a({ message: x, severity: "warning" }, A)), D = (x = "", A = {}) => h(a({ message: x, severity: "error" }, A)), E = (x) => {
1456
+ const A = u.current.findIndex((H) => H.key === x);
1457
1457
  if (A !== -1)
1458
- return A === 0 ? (l({ open: !1 }), p.current[0]) : p.current.splice(A, 1);
1459
- }, O = (x, A) => {
1460
- n(x, A) && l({ open: !1 });
1458
+ return A === 0 ? (c({ open: !1 }), u.current[0]) : u.current.splice(A, 1);
1459
+ }, T = (x, A) => {
1460
+ n(x, A) && c({ open: !1 });
1461
1461
  }, L = () => {
1462
1462
  }, P = () => {
1463
- p.current.shift(), p.current.length > 0 && l({ open: !0 });
1464
- }, v = (C = p.current[0]) != null ? C : a({}, Xe), D = {};
1465
- "autoHideDuration" in v && (D.autoHideDuration = v.autoHideDuration);
1463
+ u.current.shift(), u.current.length > 0 && c({ open: !0 });
1464
+ }, v = (m = u.current[0]) != null ? m : a({}, Xe), k = {};
1465
+ "autoHideDuration" in v && (k.autoHideDuration = v.autoHideDuration);
1466
1466
  const M = a(a({}, Kn), r), f = a(a({
1467
- open: c,
1467
+ open: l,
1468
1468
  setOpen: w,
1469
1469
  enqueueNotification: h,
1470
- enqueueSuccessNotification: S,
1471
- enqueueInfoNotification: b,
1472
- enqueueWarningNotification: I,
1473
- enqueueErrorNotification: $,
1470
+ enqueueSuccessNotification: b,
1471
+ enqueueInfoNotification: S,
1472
+ enqueueWarningNotification: $,
1473
+ enqueueErrorNotification: D,
1474
1474
  removeNotification: E
1475
1475
  }, e), t);
1476
- return /* @__PURE__ */ u($t.Provider, { value: f, children: [
1476
+ return /* @__PURE__ */ p(Dt.Provider, { value: f, children: [
1477
1477
  i,
1478
1478
  /* @__PURE__ */ o(
1479
1479
  Yt,
1480
- y(a(a({}, M), D), {
1481
- open: c,
1482
- onClose: O,
1480
+ y(a(a({}, M), k), {
1481
+ open: l,
1482
+ onClose: T,
1483
1483
  TransitionProps: {
1484
1484
  onExited: P,
1485
1485
  onExit: L
1486
1486
  },
1487
1487
  sx: { zIndex: Zn },
1488
- children: /* @__PURE__ */ u("div", { children: [
1488
+ children: /* @__PURE__ */ p("div", { children: [
1489
1489
  /* @__PURE__ */ o(
1490
1490
  Kt,
1491
1491
  {
1492
- onClose: (x) => O(x, "closeAlert"),
1492
+ onClose: (x) => T(x, "closeAlert"),
1493
1493
  severity: v.severity,
1494
1494
  variant: "filled",
1495
1495
  icon: v.progressIndicator === "circular" ? /* @__PURE__ */ o(Ie, { size: "1em" }) : void 0,
@@ -1504,7 +1504,7 @@ function oo(s) {
1504
1504
  ] });
1505
1505
  }
1506
1506
  function io() {
1507
- const e = je($t);
1507
+ const e = je(Dt);
1508
1508
  if (e === null)
1509
1509
  throw new ke("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1510
1510
  return e;
@@ -1542,17 +1542,18 @@ const Ke = R(
1542
1542
  isLoading: e,
1543
1543
  isOpen: t,
1544
1544
  onClose: n,
1545
- domainOptions: i,
1546
- applicationName: r,
1547
- handleLogout: s
1545
+ onDomainChange: i,
1546
+ domainOptions: r,
1547
+ applicationName: s,
1548
+ handleLogout: d
1548
1549
  }) => {
1549
- const [d, c] = V(Et), [l, p] = F(d), { enqueueSuccessNotification: g } = io(), m = i.length === 0, w = !!d && !i.includes(d) && !i.includes(l), h = !d || m || w, S = () => _(void 0, null, function* () {
1550
- l ? (c(l), g(`Set organisation to ${l}`), n()) : c("");
1551
- }), b = () => _(void 0, null, function* () {
1552
- d && !m && !w ? (p(d), n()) : h && s();
1550
+ const [l, c] = V(Et), [u, g] = F(l), { enqueueSuccessNotification: C } = io(), w = r.length === 0, h = !!l && !r.includes(l) && !r.includes(u), b = !l || w || h, S = () => _(void 0, null, function* () {
1551
+ u ? (c(u), i == null || i(u), C(`Set organisation to ${u}`), n()) : (c(""), i == null || i(""));
1552
+ }), $ = () => _(void 0, null, function* () {
1553
+ l && !w && !h ? (g(l), n()) : b && d();
1553
1554
  });
1554
- let I;
1555
- return m ? 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__ */ u(
1555
+ let D;
1556
+ return w ? D = "Unable to retrieve your active organisations. Try logging in again." : h && (D = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ p(
1556
1557
  kt,
1557
1558
  {
1558
1559
  isOpen: t,
@@ -1560,19 +1561,19 @@ const Ke = R(
1560
1561
  primaryButton: {
1561
1562
  text: "Confirm",
1562
1563
  onClick: S,
1563
- disabled: !l || m || w,
1564
+ disabled: !u || w || h,
1564
1565
  buttonColor: "primary"
1565
1566
  },
1566
1567
  secondaryButton: {
1567
- text: h ? "Logout" : "Cancel",
1568
- onClick: b
1568
+ text: b ? "Logout" : "Cancel",
1569
+ onClick: $
1569
1570
  },
1570
- onClose: h ? () => {
1571
+ onClose: b ? () => {
1571
1572
  } : n,
1572
1573
  children: [
1573
- /* @__PURE__ */ u(T, { marginBottom: 2, children: [
1574
+ /* @__PURE__ */ p(O, { marginBottom: 2, children: [
1574
1575
  "Select the default organisation that you want to use with the ",
1575
- r,
1576
+ s,
1576
1577
  "."
1577
1578
  ] }),
1578
1579
  /* @__PURE__ */ o(
@@ -1581,26 +1582,26 @@ const Ke = R(
1581
1582
  loading: e,
1582
1583
  multiple: !1,
1583
1584
  disableClearable: !1,
1584
- value: l !== "" ? l : null,
1585
- onChange: ($, E) => p(E != null ? E : ""),
1585
+ value: u !== "" ? u : null,
1586
+ onChange: (E, T) => g(T != null ? T : ""),
1586
1587
  getOptionLabel: so,
1587
- options: [...i],
1588
- renderInput: ($) => /* @__PURE__ */ o(
1588
+ options: [...r],
1589
+ renderInput: (E) => /* @__PURE__ */ o(
1589
1590
  ye,
1590
- y(a({}, $), {
1591
+ y(a({}, E), {
1591
1592
  variant: "filled",
1592
1593
  label: "Select organisation",
1593
- InputProps: y(a({}, $.InputProps), {
1594
- endAdornment: /* @__PURE__ */ u(N, { children: [
1594
+ InputProps: y(a({}, E.InputProps), {
1595
+ endAdornment: /* @__PURE__ */ p(N, { children: [
1595
1596
  e ? /* @__PURE__ */ o(Ie, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1596
- $.InputProps.endAdornment
1597
+ E.InputProps.endAdornment
1597
1598
  ] })
1598
1599
  })
1599
1600
  })
1600
1601
  )
1601
1602
  }
1602
1603
  ),
1603
- I && /* @__PURE__ */ o(Jt, { error: !0, children: I })
1604
+ D && /* @__PURE__ */ o(Jt, { error: !0, children: D })
1604
1605
  ]
1605
1606
  }
1606
1607
  );
@@ -1782,7 +1783,7 @@ export {
1782
1783
  Ho as AppLayout,
1783
1784
  Xo as AtomProvider,
1784
1785
  Vo as AuthGuard,
1785
- $t as Context,
1786
+ Dt as Context,
1786
1787
  ke as ContextError,
1787
1788
  Qo as DomainCodeDialog,
1788
1789
  Oo as ExampleComponent,
@@ -1816,7 +1817,7 @@ export {
1816
1817
  St as topBarHeightAtom,
1817
1818
  Fn as topBarMiddleAtom,
1818
1819
  Ro as unsuppressConsole,
1819
- Dt as useAutocompleteOptions,
1820
+ $t as useAutocompleteOptions,
1820
1821
  wn as useNavBar,
1821
1822
  io as useSaladBar,
1822
1823
  Yo as withAtomProvider,