@australiangreens/ag-internal-components 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -2,14 +2,14 @@ var Lt = Object.defineProperty, _t = Object.defineProperties;
2
2
  var Mt = Object.getOwnPropertyDescriptors;
3
3
  var ne = Object.getOwnPropertySymbols;
4
4
  var Be = Object.prototype.hasOwnProperty, Oe = Object.prototype.propertyIsEnumerable;
5
- var he = (e, t, n) => t in e ? Lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, a = (e, t) => {
5
+ var he = (e, t, n) => t in e ? Lt(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
7
  Be.call(t, n) && he(e, n, t[n]);
8
8
  if (ne)
9
9
  for (var n of ne(t))
10
10
  Oe.call(t, n) && he(e, n, t[n]);
11
11
  return e;
12
- }, D = (e, t) => _t(e, Mt(t));
12
+ }, y = (e, t) => _t(e, Mt(t));
13
13
  var Ee = (e, t) => {
14
14
  var n = {};
15
15
  for (var i in e)
@@ -21,24 +21,24 @@ var Ee = (e, t) => {
21
21
  };
22
22
  var Fe = (e, t, n) => (he(e, typeof t != "symbol" ? t + "" : t, n), n);
23
23
  var L = (e, t, n) => new Promise((i, r) => {
24
- var s = (d) => {
24
+ var l = (a) => {
25
25
  try {
26
- l(n.next(d));
27
- } catch (p) {
28
- r(p);
26
+ p(n.next(a));
27
+ } catch (d) {
28
+ r(d);
29
29
  }
30
- }, c = (d) => {
30
+ }, c = (a) => {
31
31
  try {
32
- l(n.throw(d));
33
- } catch (p) {
34
- r(p);
32
+ p(n.throw(a));
33
+ } catch (d) {
34
+ r(d);
35
35
  }
36
- }, l = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(s, c);
37
- l((n = n.apply(e, t)).next());
36
+ }, p = (a) => a.done ? i(a.value) : Promise.resolve(a.value).then(l, c);
37
+ p((n = n.apply(e, t)).next());
38
38
  });
39
39
  import { jsxs as u, Fragment as F, jsx as o } from "react/jsx-runtime";
40
40
  import { useState as E, createContext as Je, useCallback as re, useContext as Ze, useEffect as K, createElement as xe, useRef as ge } from "react";
41
- import { Typography as B, Button as ae, Paper as je, Box as y, Drawer as we, styled as Ae, IconButton as J, Container as et, useTheme as se, useMediaQuery as Rt, Collapse as Ht, Avatar as Pe, Fade as Wt, Skeleton as Ne, Toolbar as zt, Divider as Le, CssBaseline as Ut, Dialog as tt, LinearProgress as nt, DialogTitle as ot, DialogContent as it, DialogActions as rt, Autocomplete as Se, TextField as be, CircularProgress as De, Chip as Gt, Tooltip as Vt, Stack as qt, Snackbar as Xt, Alert as Qt, FormHelperText as Yt } from "@mui/material";
41
+ import { Typography as B, Button as ae, Paper as je, Box as $, Drawer as we, styled as Ae, IconButton as J, Container as et, useTheme as se, useMediaQuery as Rt, Collapse as Ht, Avatar as Pe, Fade as Wt, Skeleton as Ne, Toolbar as zt, Divider as Le, CssBaseline as Ut, Dialog as tt, LinearProgress as nt, DialogTitle as ot, DialogContent as it, DialogActions as rt, Autocomplete as Se, TextField as be, CircularProgress as ke, Chip as Gt, Tooltip as Vt, Stack as qt, Snackbar as Xt, Alert as Qt, FormHelperText as Yt } from "@mui/material";
42
42
  import Kt from "@mui/material/CssBaseline";
43
43
  import { styled as R, createTheme as at, alpha as fe } from "@mui/material/styles";
44
44
  import { AgError as Jt } from "@australiangreens/ag-error";
@@ -87,7 +87,7 @@ const gt = 330, ft = 73, U = "Navbar", q = {
87
87
  userInfoHolder: `${U}-userInfoHolder`,
88
88
  settings: `${U}-settings`,
89
89
  pieChartIcon: `${U}-pieChartIcon`
90
- }, pn = R(y, {
90
+ }, pn = R($, {
91
91
  name: "NavBar"
92
92
  })(({ theme: e }) => ({
93
93
  [`&.${q.root}`]: {
@@ -116,13 +116,13 @@ const gt = 330, ft = 73, U = "Navbar", q = {
116
116
  color: "white",
117
117
  backgroundColor: "black"
118
118
  // backgroundColor: '#e8e8e8',
119
- }), un = () => a({
119
+ }), un = () => s({
120
120
  width: gt
121
- }, mt()), hn = () => a({
121
+ }, mt()), hn = () => s({
122
122
  width: ft
123
123
  }, mt()), gn = R(we, {
124
124
  shouldForwardProp: (e) => e !== "open"
125
- })(({ theme: e, open: t }) => a(a({
125
+ })(({ theme: e, open: t }) => s(s({
126
126
  width: t ? gt : ft,
127
127
  flexShrink: 0,
128
128
  whiteSpace: "nowrap",
@@ -133,30 +133,30 @@ const gt = 330, ft = 73, U = "Navbar", q = {
133
133
  }), !t && {
134
134
  "& .MuiDrawer-paper": hn()
135
135
  }));
136
- class ke extends Jt {
136
+ class De extends Jt {
137
137
  }
138
- Fe(ke, "errorName", "ContextError");
138
+ Fe(De, "errorName", "ContextError");
139
139
  const Ct = Je(null), fn = {}, mn = {}, Cn = ({
140
140
  overrideState: e = fn,
141
141
  overrideActions: t = mn,
142
142
  children: n
143
143
  }) => {
144
- const [{ open: i }, r] = E({ open: !0 }), s = re((d) => {
145
- r({ open: d });
144
+ const [{ open: i }, r] = E({ open: !0 }), l = re((a) => {
145
+ r({ open: a });
146
146
  }, []), c = re(() => {
147
- r((d) => D(a({}, d), { open: !d.open }));
148
- }, []), l = a(a({
147
+ r((a) => y(s({}, a), { open: !a.open }));
148
+ }, []), p = s(s({
149
149
  open: i,
150
- setOpen: s,
150
+ setOpen: l,
151
151
  toggleOpen: c
152
152
  }, e), t);
153
- return /* @__PURE__ */ o(Ct.Provider, { value: l, children: n });
153
+ return /* @__PURE__ */ o(Ct.Provider, { value: p, children: n });
154
154
  }, xn = () => {
155
155
  const e = Ze(Ct);
156
156
  if (e === null)
157
- throw new ke("Error: Tried to useNavBar outside of a <NavBarProvider>");
157
+ throw new De("Error: Tried to useNavBar outside of a <NavBarProvider>");
158
158
  return e;
159
- }, vn = (e = {}) => a({
159
+ }, vn = (e = {}) => s({
160
160
  open: !0
161
161
  }, e), Bo = Q(
162
162
  (e = vn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(Cn, { overrideState: e, overrideActions: t, children: n })
@@ -281,7 +281,7 @@ const wn = 24, An = 64, G = "TopBar", O = {
281
281
  padding: e.spacing(0, 3),
282
282
  width: "100%"
283
283
  },
284
- [`& .${O.titleSlider}`]: a(a({
284
+ [`& .${O.titleSlider}`]: s(s({
285
285
  height: "100%",
286
286
  display: "flex",
287
287
  alignItems: "center",
@@ -323,7 +323,7 @@ function bn({
323
323
  }) {
324
324
  return /* @__PURE__ */ u(Sn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
325
325
  /* @__PURE__ */ o("div", { className: O.topStripe }),
326
- /* @__PURE__ */ o("div", { className: O.titleBar, children: /* @__PURE__ */ u(y, { className: O.titleSlider, children: [
326
+ /* @__PURE__ */ o("div", { className: O.titleBar, children: /* @__PURE__ */ u($, { className: O.titleSlider, children: [
327
327
  t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ u(
328
328
  J,
329
329
  {
@@ -358,7 +358,7 @@ function bn({
358
358
  ] }) })
359
359
  ] });
360
360
  }
361
- const xt = 400, Dn = Ae(we, {
361
+ const xt = 400, kn = Ae(we, {
362
362
  shouldForwardProp: (e) => (
363
363
  // Note we do want anchor to be forwarded to the Drawer component
364
364
  ![
@@ -372,9 +372,9 @@ const xt = 400, Dn = Ae(we, {
372
372
  ),
373
373
  name: "SidePanelDrawer"
374
374
  })(
375
- ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: i, navBarWidthOpen: r, navBarWidthClosed: s }) => ({
375
+ ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: i, navBarWidthOpen: r, navBarWidthClosed: l }) => ({
376
376
  width: e,
377
- "& .MuiDrawer-paper": a(a({
377
+ "& .MuiDrawer-paper": s(s({
378
378
  position: "absolute",
379
379
  width: e,
380
380
  boxSizing: "border-box",
@@ -382,15 +382,15 @@ const xt = 400, Dn = Ae(we, {
382
382
  boxShadow: "0px 4px 5px rgba(0, 0, 0, 0.14), 0px 1px 10px rgba(0, 0, 0, 0.12), 0px 2px 4px rgba(0, 0, 0, 0.2)"
383
383
  }, t && {
384
384
  opacity: "50%"
385
- }), n === "left" && a({
386
- marginLeft: `${s}px`
385
+ }), n === "left" && s({
386
+ marginLeft: `${l}px`
387
387
  }, i && {
388
388
  marginLeft: `${r}px`
389
389
  }))
390
390
  })
391
- ), kn = Ae(y, {
391
+ ), Dn = Ae($, {
392
392
  shouldForwardProp: (e) => !["anchor"].includes(e)
393
- })(({ theme: e, anchor: t }) => D(a({
393
+ })(({ theme: e, anchor: t }) => y(s({
394
394
  display: "flex",
395
395
  alignItems: "center",
396
396
  padding: e.spacing(2)
@@ -415,35 +415,35 @@ function We({
415
415
  onClose: i = () => {
416
416
  },
417
417
  titleText: r = "",
418
- width: s = xt,
418
+ width: l = xt,
419
419
  showCloseArrow: c = !0,
420
- debugOpacity: l = !1,
421
- headerBoxProps: d = {},
422
- onOpened: p,
423
- onClosed: C,
420
+ debugOpacity: p = !1,
421
+ headerBoxProps: a = {},
422
+ onOpened: d,
423
+ onClosed: m,
424
424
  "data-testid": f,
425
- navBarOpen: m = !1,
426
- navBarWidthOpen: h = 0,
427
- navBarWidthClosed: $ = 0
425
+ navBarOpen: w = !1,
426
+ navBarWidthOpen: g = 0,
427
+ navBarWidthClosed: S = 0
428
428
  }) {
429
429
  return /* @__PURE__ */ u(
430
- Dn,
430
+ kn,
431
431
  {
432
432
  SlideProps: {
433
- onEntered: () => p == null ? void 0 : p(),
434
- onExited: () => C == null ? void 0 : C()
433
+ onEntered: () => d == null ? void 0 : d(),
434
+ onExited: () => m == null ? void 0 : m()
435
435
  },
436
436
  variant: "persistent",
437
437
  anchor: t,
438
438
  open: n,
439
- width: s,
440
- debugOpacity: l,
439
+ width: l,
440
+ debugOpacity: p,
441
441
  "data-testid": f,
442
- navBarOpen: m,
443
- navBarWidthOpen: h,
444
- navBarWidthClosed: $,
442
+ navBarOpen: w,
443
+ navBarWidthOpen: g,
444
+ navBarWidthClosed: S,
445
445
  children: [
446
- /* @__PURE__ */ o(kn, D(a({ anchor: t }, d), { children: t === "left" ? /* @__PURE__ */ u(F, { children: [
446
+ /* @__PURE__ */ o(Dn, y(s({ anchor: t }, a), { children: t === "left" ? /* @__PURE__ */ u(F, { children: [
447
447
  /* @__PURE__ */ o(B, { variant: "h6", color: "inherit", component: "div", children: r }),
448
448
  c && /* @__PURE__ */ u(J, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
449
449
  /* @__PURE__ */ o(ct, { "data-testid": "arrowbackicon" }),
@@ -461,12 +461,12 @@ function We({
461
461
  }
462
462
  );
463
463
  }
464
- const yn = R(y, {
464
+ const yn = R($, {
465
465
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
466
466
  name: "PanelAwareMargins"
467
467
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
468
468
  var i, r;
469
- return a(a({
469
+ return s(s({
470
470
  transition: e.transitions.create("margin", {
471
471
  easing: e.transitions.easing.sharp,
472
472
  duration: e.transitions.duration.leavingScreen
@@ -510,27 +510,27 @@ function No({
510
510
  leftPanel: n,
511
511
  rightPanel: i,
512
512
  sidePanelsAreMutuallyExclusive: r = !0,
513
- debugOpacity: s = !1,
513
+ debugOpacity: l = !1,
514
514
  pageContainerProps: c,
515
- pageContentDataTestId: l,
516
- topBarDataTestId: d,
517
- navBarOpen: p,
518
- navBarWidthOpen: C,
515
+ pageContentDataTestId: p,
516
+ topBarDataTestId: a,
517
+ navBarOpen: d,
518
+ navBarWidthOpen: m,
519
519
  navBarWidthClosed: f
520
520
  }) {
521
- const [m, h] = E(me), [$, k] = E(Ce), [S, I] = E(me), [T, P] = E(Ce), N = n !== void 0, b = i !== void 0, {
522
- titleText: A,
521
+ const [w, g] = E(me), [S, C] = E(Ce), [k, I] = E(me), [T, P] = E(Ce), N = n !== void 0, D = i !== void 0, {
522
+ titleText: b,
523
523
  content: H,
524
524
  flavour: W,
525
- open: g,
525
+ open: h,
526
526
  onChangeOpen: x,
527
527
  width: v,
528
- arrowButtons: w,
528
+ arrowButtons: A,
529
529
  startOpen: M,
530
530
  onOpened: j,
531
531
  onClosed: le,
532
532
  dataTestId: Bt
533
- } = n ? a(a({}, oe), n) : a({}, oe), {
533
+ } = n ? s(s({}, oe), n) : s({}, oe), {
534
534
  titleText: Ot,
535
535
  content: Et,
536
536
  flavour: ye,
@@ -542,18 +542,18 @@ function No({
542
542
  onOpened: Ft,
543
543
  onClosed: Pt,
544
544
  dataTestId: Nt
545
- } = i ? a(a({}, oe), i) : a({}, oe);
545
+ } = i ? s(s({}, oe), i) : s({}, oe);
546
546
  K(() => {
547
- M !== me && (h(M), I(M));
547
+ M !== me && (g(M), I(M));
548
548
  }, [M]), K(() => {
549
- te !== Ce && (k(te), P(te));
549
+ te !== Ce && (C(te), P(te));
550
550
  }, [te]);
551
- const pe = g === void 0 ? m : g, ue = ce === void 0 ? $ : ce, Ie = (z) => {
552
- g === void 0 && (h(z), r && b && (z ? (k(!1), P($)) : k(T))), x && x(z);
551
+ const pe = h === void 0 ? w : h, ue = ce === void 0 ? S : ce, Ie = (z) => {
552
+ h === void 0 && (g(z), r && D && (z ? (C(!1), P(S)) : C(T))), x && x(z);
553
553
  }, Te = (z) => {
554
- ce === void 0 && (k(z), r && N && (z ? (h(!1), I(m)) : h(S))), $e && $e(z);
554
+ ce === void 0 && (C(z), r && N && (z ? (g(!1), I(w)) : g(k))), $e && $e(z);
555
555
  };
556
- return /* @__PURE__ */ u(y, { children: [
556
+ return /* @__PURE__ */ u($, { children: [
557
557
  N && /* @__PURE__ */ o(
558
558
  We,
559
559
  {
@@ -562,18 +562,18 @@ function No({
562
562
  open: pe,
563
563
  onClose: () => Ie(!1),
564
564
  width: v,
565
- titleText: A,
566
- debugOpacity: s,
567
- showCloseArrow: w === "both" || w === "close",
565
+ titleText: b,
566
+ debugOpacity: l,
567
+ showCloseArrow: A === "both" || A === "close",
568
568
  onOpened: j,
569
569
  onClosed: le,
570
- navBarOpen: p,
571
- navBarWidthOpen: C,
570
+ navBarOpen: d,
571
+ navBarWidthOpen: m,
572
572
  navBarWidthClosed: f,
573
573
  children: H
574
574
  }
575
575
  ),
576
- b && /* @__PURE__ */ o(
576
+ D && /* @__PURE__ */ o(
577
577
  We,
578
578
  {
579
579
  "data-testid": Nt,
@@ -582,29 +582,29 @@ function No({
582
582
  onClose: () => Te(!1),
583
583
  width: de,
584
584
  titleText: Ot,
585
- debugOpacity: s,
585
+ debugOpacity: l,
586
586
  showCloseArrow: ee === "both" || ee === "close",
587
587
  onOpened: Ft,
588
588
  onClosed: Pt,
589
- navBarOpen: p,
590
- navBarWidthOpen: C,
589
+ navBarOpen: d,
590
+ navBarWidthOpen: m,
591
591
  navBarWidthClosed: f,
592
592
  children: Et
593
593
  }
594
594
  ),
595
595
  /* @__PURE__ */ o(
596
596
  bn,
597
- a(a({
597
+ s(s({
598
598
  titleText: t,
599
- "data-testid": d
599
+ "data-testid": a
600
600
  }, N && W === "push" ? {
601
601
  leftPanel: {
602
602
  open: pe,
603
603
  width: v,
604
604
  onOpen: () => Ie(!0),
605
- showOpenArrow: w === "both" || w === "open"
605
+ showOpenArrow: A === "both" || A === "open"
606
606
  }
607
- } : {}), b && ye === "push" ? {
607
+ } : {}), D && ye === "push" ? {
608
608
  rightPanel: {
609
609
  open: ue,
610
610
  width: de,
@@ -615,7 +615,7 @@ function No({
615
615
  ),
616
616
  /* @__PURE__ */ o(
617
617
  yn,
618
- D(a(a({}, W === "push" ? {
618
+ y(s(s({}, W === "push" ? {
619
619
  leftPanel: {
620
620
  open: pe,
621
621
  width: v
@@ -626,7 +626,7 @@ function No({
626
626
  width: de
627
627
  }
628
628
  } : {}), {
629
- children: /* @__PURE__ */ o($n, D(a({ "data-testid": l }, c), { children: e }))
629
+ children: /* @__PURE__ */ o($n, y(s({ "data-testid": p }, c), { children: e }))
630
630
  })
631
631
  )
632
632
  ] });
@@ -646,7 +646,7 @@ const ie = "Navbar", Y = {
646
646
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
647
647
  // settings: `${PREFIX}-settings`,
648
648
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
649
- }, Fn = R(y, { name: "NavBar" })(({ theme: e }) => ({
649
+ }, Fn = R($, { name: "NavBar" })(({ theme: e }) => ({
650
650
  [`&.${Y.root}`]: {
651
651
  display: "flex"
652
652
  },
@@ -672,7 +672,7 @@ const ie = "Navbar", Y = {
672
672
  const t = se();
673
673
  return /* @__PURE__ */ o(
674
674
  Ht,
675
- a({
675
+ s({
676
676
  easing: t.transitions.easing.sharp,
677
677
  timeout: {
678
678
  enter: t.transitions.duration.enteringScreen,
@@ -680,7 +680,7 @@ const ie = "Navbar", Y = {
680
680
  }
681
681
  }, e)
682
682
  );
683
- }, Dt = (e) => {
683
+ }, kt = (e) => {
684
684
  var t, n;
685
685
  return {
686
686
  overflowX: "hidden",
@@ -688,24 +688,24 @@ const ie = "Navbar", Y = {
688
688
  backgroundColor: (n = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? n : "white"
689
689
  // Provide default so tests don't need to wrap theme provider
690
690
  };
691
- }, ze = (e, t) => a({
691
+ }, ze = (e, t) => s({
692
692
  width: t,
693
693
  transition: X(e, "width", "entering")
694
- }, Dt(e)), Ue = (e, t) => a({
694
+ }, kt(e)), Ue = (e, t) => s({
695
695
  width: t,
696
696
  transition: X(e, "width", "leaving")
697
- }, Dt(e)), Nn = R(we, {
697
+ }, kt(e)), Nn = R(we, {
698
698
  shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
699
- })(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => a(a({
699
+ })(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => s(s({
700
700
  flexShrink: 0,
701
701
  whiteSpace: "nowrap",
702
702
  boxSizing: "border-box",
703
703
  display: "flex",
704
704
  flexDirection: "column"
705
- }, t && D(a({}, ze(e, n)), {
705
+ }, t && y(s({}, ze(e, n)), {
706
706
  backgroundColor: "",
707
707
  "& .MuiDrawer-paper": ze(e, n)
708
- })), !t && D(a({}, Ue(e, r ? n : i)), {
708
+ })), !t && y(s({}, Ue(e, r ? n : i)), {
709
709
  backgroundColor: "",
710
710
  "& .MuiDrawer-paper": Ue(e, r ? n : i)
711
711
  })));
@@ -721,7 +721,7 @@ const Ge = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], V
721
721
  function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
722
722
  const r = se();
723
723
  return /* @__PURE__ */ u(
724
- y,
724
+ $,
725
725
  {
726
726
  sx: {
727
727
  paddingTop: 3,
@@ -732,7 +732,7 @@ function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
732
732
  },
733
733
  children: [
734
734
  !i && /* @__PURE__ */ o(
735
- y,
735
+ $,
736
736
  {
737
737
  sx: {
738
738
  width: n ? "5rem" : "2rem",
@@ -754,7 +754,7 @@ function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
754
754
  }
755
755
  ),
756
756
  i && /* @__PURE__ */ o(
757
- y,
757
+ $,
758
758
  {
759
759
  sx: {
760
760
  width: n ? "5rem" : "2rem",
@@ -769,7 +769,7 @@ function _n({ user: e, domainCode: t, open: n, useNewAvatar: i = !1 }) {
769
769
  ] }) }) : /* @__PURE__ */ o(Me, {})
770
770
  }
771
771
  ),
772
- /* @__PURE__ */ o(Pn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Wt, { in: n, children: /* @__PURE__ */ u(y, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
772
+ /* @__PURE__ */ o(Pn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Wt, { in: n, children: /* @__PURE__ */ u($, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
773
773
  e != null && e.name ? /* @__PURE__ */ o(B, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "50%" }),
774
774
  t ? /* @__PURE__ */ o(B, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "25%" })
775
775
  ] }) }) })
@@ -783,13 +783,13 @@ function Mn({
783
783
  widthOpen: n,
784
784
  "data-testid": i,
785
785
  top: r,
786
- middle: s,
786
+ middle: l,
787
787
  bottom: c,
788
- user: l,
789
- domainCode: d,
790
- useNewAvatar: p = !1
788
+ user: p,
789
+ domainCode: a,
790
+ useNewAvatar: d = !1
791
791
  }) {
792
- const C = vt(), f = dt(Z);
792
+ const m = vt(), f = dt(Z);
793
793
  return /* @__PURE__ */ o(Fn, { className: Y.root, "data-testid": i, children: /* @__PURE__ */ u(
794
794
  Nn,
795
795
  {
@@ -797,24 +797,24 @@ function Mn({
797
797
  widthOpen: n,
798
798
  widthClosed: t,
799
799
  anchor: "left",
800
- variant: C ? "temporary" : "permanent",
800
+ variant: m ? "temporary" : "permanent",
801
801
  PaperProps: {
802
802
  component: "nav"
803
803
  },
804
804
  onClose: () => {
805
805
  f(!1);
806
806
  },
807
- isSmallScreen: C,
807
+ isSmallScreen: m,
808
808
  children: [
809
- !C && /* @__PURE__ */ o(zt, {}),
810
- r && /* @__PURE__ */ u(y, { flexGrow: "0", children: [
809
+ !m && /* @__PURE__ */ o(zt, {}),
810
+ r && /* @__PURE__ */ u($, { flexGrow: "0", children: [
811
811
  r,
812
812
  /* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } })
813
813
  ] }),
814
- /* @__PURE__ */ o(y, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ o(En, { links: s }) : s }),
815
- /* @__PURE__ */ u(y, { flexGrow: "0", children: [
814
+ /* @__PURE__ */ o($, { flexGrow: "1", children: Array.isArray(l) ? /* @__PURE__ */ o(En, { links: l }) : l }),
815
+ /* @__PURE__ */ u($, { flexGrow: "0", children: [
816
816
  /* @__PURE__ */ o(Le, { variant: "middle", sx: { marginY: "0.5rem" } }),
817
- /* @__PURE__ */ o(_n, { user: l, domainCode: d, open: e, useNewAvatar: p }),
817
+ /* @__PURE__ */ o(_n, { user: p, domainCode: a, open: e, useNewAvatar: d }),
818
818
  c && /* @__PURE__ */ o(F, { children: c })
819
819
  ] })
820
820
  ]
@@ -828,14 +828,14 @@ function Rn({
828
828
  noPadding: i
829
829
  }) {
830
830
  return /* @__PURE__ */ o(
831
- y,
831
+ $,
832
832
  {
833
833
  sx: {
834
834
  overflow: "auto",
835
835
  height: `calc(100vh - ${t}px)`,
836
836
  flexGrow: 1
837
837
  },
838
- children: i ? /* @__PURE__ */ o(y, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ o(
838
+ children: i ? /* @__PURE__ */ o($, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ o(
839
839
  et,
840
840
  {
841
841
  component: "main",
@@ -857,7 +857,7 @@ function zn({
857
857
  "data-testid": n,
858
858
  middle: i
859
859
  }) {
860
- const r = dt(Z), s = () => r((d) => !d), c = se(), l = vt();
860
+ const r = dt(Z), l = () => r((a) => !a), c = se(), p = vt();
861
861
  return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ u(
862
862
  je,
863
863
  {
@@ -873,7 +873,7 @@ function zn({
873
873
  gap: 2,
874
874
  flexShrink: 0,
875
875
  height: t,
876
- zIndex: l ? 0 : c.zIndex.drawer + 1
876
+ zIndex: p ? 0 : c.zIndex.drawer + 1
877
877
  },
878
878
  children: [
879
879
  /* @__PURE__ */ o(
@@ -882,7 +882,7 @@ function zn({
882
882
  size: "medium",
883
883
  color: "inherit",
884
884
  sx: { padding: 1.5, marginLeft: "12px" },
885
- onClick: s,
885
+ onClick: l,
886
886
  children: /* @__PURE__ */ o(jt, { fontSize: "medium" })
887
887
  }
888
888
  ),
@@ -898,52 +898,52 @@ function Lo({
898
898
  initialNavBarOpen: n,
899
899
  pageContainerProps: i,
900
900
  pageContentDataTestId: r,
901
- topBarDataTestId: s,
901
+ topBarDataTestId: l,
902
902
  navBarDataTestId: c,
903
- navBarMiddle: l,
904
- navBarBottom: d,
905
- user: p,
906
- domainCode: C,
903
+ navBarMiddle: p,
904
+ navBarBottom: a,
905
+ user: d,
906
+ domainCode: m,
907
907
  useNewAvatar: f = !1
908
908
  }) {
909
909
  ut([
910
910
  [Z, n != null ? n : !0],
911
911
  [ve, t != null ? t : ""]
912
912
  ]);
913
- const m = _e(Z), [h] = V(wt), [$] = V(At), k = _e(ve), [S] = V(St), [I] = V(On), [T] = V(bt);
914
- return /* @__PURE__ */ u(y, { children: [
913
+ const w = _e(Z), [g] = V(wt), [S] = V(At), C = _e(ve), [k] = V(St), [I] = V(On), [T] = V(bt);
914
+ return /* @__PURE__ */ u($, { children: [
915
915
  /* @__PURE__ */ o(Ut, {}),
916
916
  /* @__PURE__ */ o(
917
917
  zn,
918
918
  {
919
- titleText: k,
920
- "data-testid": s,
921
- height: S,
919
+ titleText: C,
920
+ "data-testid": l,
921
+ height: k,
922
922
  middle: I
923
923
  }
924
924
  ),
925
- /* @__PURE__ */ u(y, { sx: { display: "flex" }, children: [
925
+ /* @__PURE__ */ u($, { sx: { display: "flex" }, children: [
926
926
  /* @__PURE__ */ o(
927
927
  Mn,
928
928
  {
929
- open: m,
929
+ open: w,
930
930
  top: T,
931
- middle: l,
932
- bottom: d,
933
- user: p,
934
- domainCode: C,
935
- widthOpen: h,
936
- widthClosed: $,
937
- offsetTop: S,
931
+ middle: p,
932
+ bottom: a,
933
+ user: d,
934
+ domainCode: m,
935
+ widthOpen: g,
936
+ widthClosed: S,
937
+ offsetTop: k,
938
938
  "data-testid": c,
939
939
  useNewAvatar: f
940
940
  }
941
941
  ),
942
942
  /* @__PURE__ */ o(
943
943
  Rn,
944
- D(a({
944
+ y(s({
945
945
  "data-testid": r,
946
- topBarHeight: S
946
+ topBarHeight: k
947
947
  }, i), {
948
948
  children: e
949
949
  })
@@ -951,53 +951,53 @@ function Lo({
951
951
  ] })
952
952
  ] });
953
953
  }
954
- const kt = ({
954
+ const Dt = ({
955
955
  isOpen: e,
956
956
  dialogTitle: t,
957
957
  children: n,
958
958
  maxWidth: i,
959
959
  primaryButton: r,
960
- secondaryButton: s,
960
+ secondaryButton: l,
961
961
  onClose: c,
962
- sx: l,
963
- "data-testid": d,
964
- disableCloseOnBackdropOrEscape: p = !1,
965
- isLoading: C = !1
962
+ sx: p,
963
+ "data-testid": a,
964
+ disableCloseOnBackdropOrEscape: d = !1,
965
+ isLoading: m = !1
966
966
  }) => {
967
- var h, $;
968
- const [f, m] = E(!1);
967
+ var g, S;
968
+ const [f, w] = E(!1);
969
969
  return /* @__PURE__ */ u(
970
970
  tt,
971
971
  {
972
972
  open: e,
973
- onClose: (k, S) => L(void 0, null, function* () {
974
- p && (S === "backdropClick" || S === "escapeKeyDown") || f || (s != null && s.onClick ? yield s.onClick() : c());
973
+ onClose: (C, k) => L(void 0, null, function* () {
974
+ d && (k === "backdropClick" || k === "escapeKeyDown") || f || (l != null && l.onClick ? yield l.onClick() : c());
975
975
  }),
976
976
  fullWidth: !0,
977
977
  maxWidth: i != null ? i : "xs",
978
- "data-testid": d,
979
- sx: l,
978
+ "data-testid": a,
979
+ sx: p,
980
980
  children: [
981
- C && /* @__PURE__ */ o(nt, { sx: { height: "4px", marginBottom: "-4px" } }),
981
+ m && /* @__PURE__ */ o(nt, { sx: { height: "4px", marginBottom: "-4px" } }),
982
982
  /* @__PURE__ */ o(ot, { children: t }),
983
983
  /* @__PURE__ */ o(it, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
984
984
  /* @__PURE__ */ u(rt, { children: [
985
985
  /* @__PURE__ */ o(
986
986
  ae,
987
987
  {
988
- onClick: (h = s == null ? void 0 : s.onClick) != null ? h : c,
989
- "data-testid": s == null ? void 0 : s.testId,
990
- disabled: (s == null ? void 0 : s.disabled) || f,
991
- color: s == null ? void 0 : s.buttonColor,
992
- children: ($ = s == null ? void 0 : s.text) != null ? $ : "Cancel"
988
+ onClick: (g = l == null ? void 0 : l.onClick) != null ? g : c,
989
+ "data-testid": l == null ? void 0 : l.testId,
990
+ disabled: (l == null ? void 0 : l.disabled) || f,
991
+ color: l == null ? void 0 : l.buttonColor,
992
+ children: (S = l == null ? void 0 : l.text) != null ? S : "Cancel"
993
993
  }
994
994
  ),
995
995
  r && /* @__PURE__ */ o(
996
996
  ae,
997
997
  {
998
998
  onClick: () => L(void 0, null, function* () {
999
- var k;
1000
- m(!0), yield (k = r.onClick) == null ? void 0 : k.call(r), m(!1);
999
+ var C;
1000
+ w(!0), yield (C = r.onClick) == null ? void 0 : C.call(r), w(!1);
1001
1001
  }),
1002
1002
  "data-testid": r.testId,
1003
1003
  disabled: r.disabled || f,
@@ -1017,7 +1017,7 @@ const kt = ({
1017
1017
  inputValue: r
1018
1018
  }) => an({
1019
1019
  queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
1020
- (s) => s.label.toLowerCase().includes(r.toLowerCase())
1020
+ (l) => l.label.toLowerCase().includes(r.toLowerCase())
1021
1021
  ) : n(r),
1022
1022
  queryKey: ["autocomplete", i, r]
1023
1023
  });
@@ -1028,84 +1028,84 @@ function _o({
1028
1028
  onChange: n,
1029
1029
  minLength: i = 0,
1030
1030
  label: r,
1031
- value: s,
1031
+ value: l,
1032
1032
  "data-testid": c,
1033
- sx: l,
1034
- boxSx: d,
1035
- textFieldColor: p,
1036
- textFieldVariant: C = "filled",
1033
+ sx: p,
1034
+ boxSx: a,
1035
+ textFieldColor: d,
1036
+ textFieldVariant: m = "filled",
1037
1037
  loadingText: f = "Loading...",
1038
- noOptionsText: m = "No options",
1039
- popupIcon: h = /* @__PURE__ */ o(tn, {}),
1040
- error: $ = !1,
1041
- helperText: k = "",
1042
- preLoadedOptions: S = void 0,
1038
+ noOptionsText: w = "No options",
1039
+ popupIcon: g = /* @__PURE__ */ o(tn, {}),
1040
+ error: S = !1,
1041
+ helperText: C = "",
1042
+ preLoadedOptions: k = void 0,
1043
1043
  disablePortal: I = !1,
1044
1044
  disableIconFlip: T = !1
1045
1045
  }) {
1046
- const [P, N] = E(""), b = (g, x) => {
1047
- const v = s.filter((w) => w.id !== x);
1048
- n(v, "delete", g);
1049
- }, { data: A, isLoading: H } = yt({
1046
+ const [P, N] = E(""), D = (h, x) => {
1047
+ const v = l.filter((A) => A.id !== x);
1048
+ n(v, "delete", h);
1049
+ }, { data: b, isLoading: H } = yt({
1050
1050
  inputValue: P,
1051
1051
  label: r,
1052
1052
  lookup: e,
1053
1053
  minLength: i,
1054
- preLoadedOptions: S
1054
+ preLoadedOptions: k
1055
1055
  }), W = P.length >= i;
1056
1056
  return /* @__PURE__ */ u("div", { "data-testid": c, children: [
1057
1057
  /* @__PURE__ */ o(
1058
1058
  Se,
1059
1059
  {
1060
- sx: a(a({}, l), T ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1060
+ sx: s(s({}, p), T ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1061
1061
  "data-testid": c ? `${c}:Autocomplete` : void 0,
1062
1062
  disablePortal: I,
1063
1063
  multiple: !0,
1064
- getOptionLabel: (g) => typeof g == "string" ? g : g.label,
1064
+ getOptionLabel: (h) => typeof h == "string" ? h : h.label,
1065
1065
  loading: W ? H : !1,
1066
- options: [...s, ...A != null ? A : []],
1066
+ options: [...l, ...b != null ? b : []],
1067
1067
  filterSelectedOptions: !0,
1068
1068
  includeInputInList: !0,
1069
- value: s,
1070
- onChange: (g, x, v) => {
1071
- n(x, v, g);
1069
+ value: l,
1070
+ onChange: (h, x, v) => {
1071
+ n(x, v, h);
1072
1072
  },
1073
- onInputChange: (g, x) => N(x),
1074
- noOptionsText: W ? m : "Start typing to search",
1073
+ onInputChange: (h, x) => N(x),
1074
+ noOptionsText: W ? w : "Start typing to search",
1075
1075
  loadingText: f,
1076
- popupIcon: h,
1077
- renderInput: (g) => /* @__PURE__ */ o(
1076
+ popupIcon: g,
1077
+ renderInput: (h) => /* @__PURE__ */ o(
1078
1078
  be,
1079
- D(a({}, g), {
1079
+ y(s({}, h), {
1080
1080
  label: r,
1081
1081
  fullWidth: !0,
1082
- variant: C,
1083
- error: $,
1084
- helperText: k,
1085
- InputProps: D(a({}, g.InputProps), {
1082
+ variant: m,
1083
+ error: S,
1084
+ helperText: C,
1085
+ InputProps: y(s({}, h.InputProps), {
1086
1086
  endAdornment: /* @__PURE__ */ u(F, { children: [
1087
- H ? /* @__PURE__ */ o(De, { color: "inherit", size: 20 }) : null,
1088
- g.InputProps.endAdornment
1087
+ H ? /* @__PURE__ */ o(ke, { color: "inherit", size: 20 }) : null,
1088
+ h.InputProps.endAdornment
1089
1089
  ] })
1090
1090
  }),
1091
1091
  "data-testid": c ? `${c}:Autocomplete:TextField` : void 0,
1092
1092
  onKeyDown: (x) => {
1093
1093
  (x.key === "Backspace" || x.key === "Delete") && x.stopPropagation();
1094
1094
  },
1095
- color: p
1095
+ color: d
1096
1096
  })
1097
1097
  ),
1098
1098
  renderTags: () => null,
1099
- isOptionEqualToValue: (g, x) => g.id === x.id,
1100
- renderOption: (g, x, v) => {
1099
+ isOptionEqualToValue: (h, x) => h.id === x.id,
1100
+ renderOption: (h, x, v) => {
1101
1101
  if (t) {
1102
- const w = on(x.label, v.inputValue, {
1102
+ const A = on(x.label, v.inputValue, {
1103
1103
  insideWords: !0,
1104
1104
  findAllOccurrences: !0
1105
- }), M = rn(x.label, w);
1105
+ }), M = rn(x.label, A);
1106
1106
  return /* @__PURE__ */ xe(
1107
1107
  "li",
1108
- D(a({}, g), {
1108
+ y(s({}, h), {
1109
1109
  key: x.id,
1110
1110
  "data-testid": c ? `${c}:Autocomplete:option(${x.id.toString()})` : void 0
1111
1111
  }),
@@ -1123,7 +1123,7 @@ function _o({
1123
1123
  } else
1124
1124
  return /* @__PURE__ */ xe(
1125
1125
  "li",
1126
- D(a({}, g), {
1126
+ y(s({}, h), {
1127
1127
  key: x.id,
1128
1128
  "data-testid": c ? `${c}:option(${x.id.toString()})` : void 0
1129
1129
  }),
@@ -1132,7 +1132,7 @@ function _o({
1132
1132
  }
1133
1133
  }
1134
1134
  ),
1135
- s.length > 0 && /* @__PURE__ */ o(y, { sx: d, children: s.map((g) => /* @__PURE__ */ o(
1135
+ l.length > 0 && /* @__PURE__ */ o($, { sx: a, children: l.map((h) => /* @__PURE__ */ o(
1136
1136
  Gt,
1137
1137
  {
1138
1138
  sx: {
@@ -1143,7 +1143,7 @@ function _o({
1143
1143
  label: /* @__PURE__ */ o(
1144
1144
  Vt,
1145
1145
  {
1146
- title: g.tooltipContent || "",
1146
+ title: h.tooltipContent || "",
1147
1147
  placement: "bottom-start",
1148
1148
  PopperProps: {
1149
1149
  modifiers: [
@@ -1155,19 +1155,19 @@ function _o({
1155
1155
  }
1156
1156
  ]
1157
1157
  },
1158
- children: /* @__PURE__ */ o(B, { style: { whiteSpace: "normal" }, children: g.chipLabel ? g.chipLabel : g.label })
1158
+ children: /* @__PURE__ */ o(B, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
1159
1159
  }
1160
1160
  ),
1161
- "data-testid": c ? `${c}:Chip(${g.id.toString()})` : void 0,
1162
- onDelete: (x) => b(x, g.id),
1161
+ "data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
1162
+ onDelete: (x) => D(x, h.id),
1163
1163
  deleteIcon: /* @__PURE__ */ o(
1164
1164
  en,
1165
1165
  {
1166
- "data-testid": c ? `${c}:Chip(${g.id.toString()}):deleteIcon` : void 0
1166
+ "data-testid": c ? `${c}:Chip(${h.id.toString()}):deleteIcon` : void 0
1167
1167
  }
1168
1168
  )
1169
1169
  },
1170
- g.id
1170
+ h.id
1171
1171
  )) })
1172
1172
  ] });
1173
1173
  }
@@ -1178,65 +1178,65 @@ const Mo = ({
1178
1178
  label: n,
1179
1179
  value: i,
1180
1180
  sx: r,
1181
- textFieldColor: s,
1181
+ textFieldColor: l,
1182
1182
  textFieldVariant: c = "filled",
1183
- "data-testid": l,
1184
- noOptionsText: d = "No options",
1185
- minLength: p = 3,
1186
- disablePortal: C = !1,
1183
+ "data-testid": p,
1184
+ noOptionsText: a = "No options",
1185
+ minLength: d = 3,
1186
+ disablePortal: m = !1,
1187
1187
  preLoadedOptions: f,
1188
- helperText: m = "",
1189
- disabled: h,
1190
- popupIcon: $,
1191
- disableIconFlip: k
1188
+ helperText: w = "",
1189
+ disabled: g,
1190
+ popupIcon: S,
1191
+ disableIconFlip: C
1192
1192
  }) => {
1193
- const [S, I] = E(""), { data: T, isLoading: P } = yt({
1194
- inputValue: S,
1193
+ const [k, I] = E(""), { data: T, isLoading: P } = yt({
1194
+ inputValue: k,
1195
1195
  label: n,
1196
1196
  lookup: e,
1197
- minLength: p != null ? p : 0,
1197
+ minLength: d != null ? d : 0,
1198
1198
  preLoadedOptions: f
1199
- }), N = S.length >= p;
1200
- return /* @__PURE__ */ o("div", { "data-testid": l, children: /* @__PURE__ */ o(qt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
1199
+ }), N = k.length >= d;
1200
+ return /* @__PURE__ */ o("div", { "data-testid": p, children: /* @__PURE__ */ o(qt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
1201
1201
  Se,
1202
1202
  {
1203
- sx: a(a({}, r), k ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1204
- "data-testid": l ? `${l}:Autocomplete` : void 0,
1203
+ sx: s(s({}, r), C ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
1204
+ "data-testid": p ? `${p}:Autocomplete` : void 0,
1205
1205
  loading: N ? P : !1,
1206
1206
  options: T != null ? T : [],
1207
- onChange: (b, A) => {
1208
- t(b, A);
1207
+ onChange: (D, b) => {
1208
+ t(D, b);
1209
1209
  },
1210
- disablePortal: C,
1211
- filterOptions: (b) => b,
1210
+ disablePortal: m,
1211
+ filterOptions: (D) => D,
1212
1212
  value: i,
1213
- noOptionsText: N ? d : "Start typing to search",
1214
- getOptionLabel: (b) => b.label,
1215
- popupIcon: $,
1216
- renderInput: (b) => /* @__PURE__ */ o(
1213
+ noOptionsText: N ? a : "Start typing to search",
1214
+ getOptionLabel: (D) => D.label,
1215
+ popupIcon: S,
1216
+ renderInput: (D) => /* @__PURE__ */ o(
1217
1217
  be,
1218
- D(a({
1219
- "data-testid": l ? `${l}:Autocomplete:TextField` : void 0
1220
- }, b), {
1218
+ y(s({
1219
+ "data-testid": p ? `${p}:Autocomplete:TextField` : void 0
1220
+ }, D), {
1221
1221
  variant: c,
1222
1222
  label: n,
1223
- color: s,
1224
- helperText: m
1223
+ color: l,
1224
+ helperText: w
1225
1225
  })
1226
1226
  ),
1227
- isOptionEqualToValue: (b, A) => b.id === A.id,
1228
- onInputChange: (b, A) => {
1229
- I(A);
1227
+ isOptionEqualToValue: (D, b) => D.id === b.id,
1228
+ onInputChange: (D, b) => {
1229
+ I(b);
1230
1230
  },
1231
- renderOption: (b, A) => /* @__PURE__ */ xe(
1231
+ renderOption: (D, b) => /* @__PURE__ */ xe(
1232
1232
  "li",
1233
- D(a({}, b), {
1234
- key: A.id,
1235
- "data-testid": l ? `${l}:Autocomplete:option(${A.id.toString()})` : void 0
1233
+ y(s({}, D), {
1234
+ key: b.id,
1235
+ "data-testid": p ? `${p}:Autocomplete:option(${b.id.toString()})` : void 0
1236
1236
  }),
1237
- A.label
1237
+ b.label
1238
1238
  ),
1239
- disabled: h
1239
+ disabled: g
1240
1240
  }
1241
1241
  ) }) });
1242
1242
  }, Un = (e) => {
@@ -1244,8 +1244,8 @@ const Mo = ({
1244
1244
  return -1;
1245
1245
  try {
1246
1246
  const n = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
1247
- cn.from(n, "base64").toString("utf8").split("").map(function(s) {
1248
- return "%" + ("00" + s.charCodeAt(0).toString(16)).slice(-2);
1247
+ cn.from(n, "base64").toString("utf8").split("").map(function(l) {
1248
+ return "%" + ("00" + l.charCodeAt(0).toString(16)).slice(-2);
1249
1249
  }).join("")
1250
1250
  ), r = JSON.parse(i);
1251
1251
  return r != null && r.exp ? r.exp : -1;
@@ -1257,32 +1257,32 @@ const Mo = ({
1257
1257
  closeHandler: t,
1258
1258
  setAuth0ExpiryTime: n
1259
1259
  }) => {
1260
- const { logout: i, getAccessTokenSilently: r } = ht(), [s, c] = E(0), l = () => L(void 0, null, function* () {
1260
+ const { logout: i, getAccessTokenSilently: r } = ht(), [l, c] = E(0), p = () => L(void 0, null, function* () {
1261
1261
  i({ logoutParams: { returnTo: `${window.location.origin}` } });
1262
- }), d = () => L(void 0, null, function* () {
1263
- c(s + 1), t();
1262
+ }), a = () => L(void 0, null, function* () {
1263
+ c(l + 1), t();
1264
1264
  });
1265
1265
  return K(() => {
1266
1266
  (() => L(void 0, null, function* () {
1267
- if (s > 0) {
1268
- const m = yield r({ cacheMode: "off" }), h = Un(m) * 1e3;
1269
- n(h);
1267
+ if (l > 0) {
1268
+ const w = yield r({ cacheMode: "off" }), g = Un(w) * 1e3;
1269
+ n(g);
1270
1270
  }
1271
1271
  }))();
1272
- }, [s, r, n]), /* @__PURE__ */ o(
1273
- kt,
1272
+ }, [l, r, n]), /* @__PURE__ */ o(
1273
+ Dt,
1274
1274
  {
1275
1275
  isOpen: e,
1276
1276
  primaryButton: {
1277
1277
  text: "Continue",
1278
- onClick: d,
1278
+ onClick: a,
1279
1279
  disabled: !1,
1280
1280
  testId: "PreferencesDialog",
1281
1281
  buttonColor: "secondary"
1282
1282
  },
1283
1283
  secondaryButton: {
1284
1284
  text: "Log out",
1285
- onClick: l,
1285
+ onClick: p,
1286
1286
  disabled: !1,
1287
1287
  testId: "PreferencesDialog",
1288
1288
  buttonColor: "secondary"
@@ -1318,58 +1318,63 @@ function Ho({
1318
1318
  throwErrors: n = "none",
1319
1319
  disableConsoleLogging: i = !1,
1320
1320
  onError: r = () => {
1321
- }
1321
+ },
1322
+ withPopup: l = !1
1322
1323
  }) {
1323
- var C, f;
1324
- const { isAuthenticated: s, isLoading: c, error: l, loginWithRedirect: d, logout: p } = ht();
1324
+ var w, g;
1325
+ const { isAuthenticated: c, isLoading: p, error: a, loginWithRedirect: d, loginWithPopup: m, logout: f } = ht();
1325
1326
  if (K(() => {
1326
- l && r(l);
1327
- }, [l, r]), K(() => {
1328
- if (c || s || l)
1327
+ a && r(a);
1328
+ }, [a, r]), K(() => {
1329
+ if (p || c || a)
1329
1330
  return;
1330
- const m = {
1331
+ const S = {
1331
1332
  appState: {
1332
1333
  returnTo: `${window.location.pathname}${window.location.search}`
1333
1334
  }
1334
1335
  };
1335
- d(m);
1336
- }, [c, s, l, d, r]), l) {
1336
+ if (l) {
1337
+ const C = document.createElement("button");
1338
+ C.onclick = () => m(), C.click(), C.remove();
1339
+ } else
1340
+ d(S);
1341
+ }, [p, c, a, d, r, l, m]), a) {
1337
1342
  if (i || console.error(
1338
- `Error detected in AuthGuard [isAuthenticated=${s},isLoading=${c}]`,
1339
- l
1343
+ `Error detected in AuthGuard [isAuthenticated=${c},isLoading=${p}]`,
1344
+ a
1340
1345
  ), n === "all")
1341
- throw l;
1342
- if (Gn(l)) {
1343
- let m = "Auth error", h = "An unknown Auth0 error occurred.";
1344
- if (Vn(l))
1345
- m = "Unauthorised", h = `You are not authorised to access ${t}.`;
1346
- else if (qn(l))
1347
- m = "App not authorised", h = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
1348
- else if (Xn(l))
1349
- m = "Auth0 script execution time exceeded", h = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute.";
1346
+ throw a;
1347
+ if (Gn(a)) {
1348
+ let S = "Auth error", C = "An unknown Auth0 error occurred.";
1349
+ if (Vn(a))
1350
+ S = "Unauthorised", C = `You are not authorised to access ${t}.`;
1351
+ else if (qn(a))
1352
+ S = "App not authorised", C = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
1353
+ else if (Xn(a))
1354
+ S = "Auth0 script execution time exceeded", C = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute.";
1350
1355
  else if (n === "unknown")
1351
- throw l;
1356
+ throw a;
1352
1357
  return /* @__PURE__ */ u(tt, { open: !0, children: [
1353
- /* @__PURE__ */ o(ot, { children: m }),
1358
+ /* @__PURE__ */ o(ot, { children: S }),
1354
1359
  /* @__PURE__ */ u(it, { children: [
1355
- /* @__PURE__ */ o(B, { children: h }),
1360
+ /* @__PURE__ */ o(B, { children: C }),
1356
1361
  /* @__PURE__ */ o("br", {}),
1357
1362
  /* @__PURE__ */ o(B, { variant: "subtitle2", children: "Details from Auth0" }),
1358
1363
  /* @__PURE__ */ u(B, { variant: "body2", children: [
1359
1364
  "error: ",
1360
- (C = l == null ? void 0 : l.error) != null ? C : "N/A"
1365
+ (w = a == null ? void 0 : a.error) != null ? w : "N/A"
1361
1366
  ] }),
1362
1367
  /* @__PURE__ */ u(B, { variant: "body2", children: [
1363
1368
  "description: ",
1364
- (f = l == null ? void 0 : l.error_description) != null ? f : "N/A"
1369
+ (g = a == null ? void 0 : a.error_description) != null ? g : "N/A"
1365
1370
  ] })
1366
1371
  ] }),
1367
- /* @__PURE__ */ o(rt, { children: /* @__PURE__ */ o(ae, { onClick: () => p({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
1372
+ /* @__PURE__ */ o(rt, { children: /* @__PURE__ */ o(ae, { onClick: () => f({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
1368
1373
  ] });
1369
1374
  } else if (n === "unknown")
1370
- throw l;
1375
+ throw a;
1371
1376
  }
1372
- return s ? /* @__PURE__ */ o(F, { children: e }) : /* @__PURE__ */ o(dn, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
1377
+ return c ? /* @__PURE__ */ o(F, { children: e }) : /* @__PURE__ */ o(dn, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
1373
1378
  }
1374
1379
  const Qn = {
1375
1380
  autoHideDuration: 6e3,
@@ -1392,8 +1397,8 @@ const Qn = {
1392
1397
  borderBottomLeftRadius: "0px",
1393
1398
  borderBottomRightRadius: "0px"
1394
1399
  }, jn = {}, eo = {}, $t = Je(null);
1395
- function to(s) {
1396
- var c = s, {
1400
+ function to(l) {
1401
+ var c = l, {
1397
1402
  overrideState: e = jn,
1398
1403
  overrideActions: t = eo,
1399
1404
  shouldClose: n = Yn.shouldClose,
@@ -1405,46 +1410,46 @@ function to(s) {
1405
1410
  "children"
1406
1411
  ]);
1407
1412
  var x;
1408
- const [{ open: l }, d] = E({ open: !1 }), p = ge([]), C = ge(Date.now()), f = ge(0), m = re((v) => {
1409
- d({ open: v });
1410
- }, []), h = re((v = {}) => {
1411
- f.current += 1, p.current.length >= Xe && Date.now() - C.current >= Qe && (C.current = Date.now(), console.error(
1413
+ const [{ open: p }, a] = E({ open: !1 }), d = ge([]), m = ge(Date.now()), f = ge(0), w = re((v) => {
1414
+ a({ open: v });
1415
+ }, []), g = re((v = {}) => {
1416
+ f.current += 1, d.current.length >= Xe && Date.now() - m.current >= Qe && (m.current = Date.now(), console.error(
1412
1417
  `SaladBarProvider: MAX_QUEUE_LENGTH (${Xe}) hit ${f.current} times in last ${Qe}ms)`
1413
1418
  ), f.current = 0);
1414
- const w = a(D(a({}, qe), {
1419
+ const A = s(y(s({}, qe), {
1415
1420
  key: Jn()
1416
1421
  }), v);
1417
- return p.current.push(w), p.current.length === 1 && d({ open: !0 }), w.key;
1418
- }, []), $ = (v = "", w = {}) => h(a({ message: v, severity: "success" }, w)), k = (v = "", w = {}) => h(a({ message: v, severity: "info" }, w)), S = (v = "", w = {}) => h(a({ message: v, severity: "warning" }, w)), I = (v = "", w = {}) => h(a({ message: v, severity: "error" }, w)), T = (v) => {
1419
- const w = p.current.findIndex((M) => M.key === v);
1420
- if (w !== -1)
1421
- return w === 0 ? (d({ open: !1 }), p.current[0]) : p.current.splice(w, 1);
1422
- }, P = (v, w) => {
1423
- n(v, w) && d({ open: !1 });
1422
+ return d.current.push(A), d.current.length === 1 && a({ open: !0 }), A.key;
1423
+ }, []), S = (v = "", A = {}) => g(s({ message: v, severity: "success" }, A)), C = (v = "", A = {}) => g(s({ message: v, severity: "info" }, A)), k = (v = "", A = {}) => g(s({ message: v, severity: "warning" }, A)), I = (v = "", A = {}) => g(s({ message: v, severity: "error" }, A)), T = (v) => {
1424
+ const A = d.current.findIndex((M) => M.key === v);
1425
+ if (A !== -1)
1426
+ return A === 0 ? (a({ open: !1 }), d.current[0]) : d.current.splice(A, 1);
1427
+ }, P = (v, A) => {
1428
+ n(v, A) && a({ open: !1 });
1424
1429
  }, N = () => {
1425
- }, b = () => {
1426
- p.current.shift(), p.current.length > 0 && d({ open: !0 });
1427
- }, A = (x = p.current[0]) != null ? x : a({}, qe), H = {};
1428
- "autoHideDuration" in A && (H.autoHideDuration = A.autoHideDuration);
1429
- const W = a(a({}, Qn), r), g = a(a({
1430
- open: l,
1431
- setOpen: m,
1432
- enqueueNotification: h,
1433
- enqueueSuccessNotification: $,
1434
- enqueueInfoNotification: k,
1435
- enqueueWarningNotification: S,
1430
+ }, D = () => {
1431
+ d.current.shift(), d.current.length > 0 && a({ open: !0 });
1432
+ }, b = (x = d.current[0]) != null ? x : s({}, qe), H = {};
1433
+ "autoHideDuration" in b && (H.autoHideDuration = b.autoHideDuration);
1434
+ const W = s(s({}, Qn), r), h = s(s({
1435
+ open: p,
1436
+ setOpen: w,
1437
+ enqueueNotification: g,
1438
+ enqueueSuccessNotification: S,
1439
+ enqueueInfoNotification: C,
1440
+ enqueueWarningNotification: k,
1436
1441
  enqueueErrorNotification: I,
1437
1442
  removeNotification: T
1438
1443
  }, e), t);
1439
- return /* @__PURE__ */ u($t.Provider, { value: g, children: [
1444
+ return /* @__PURE__ */ u($t.Provider, { value: h, children: [
1440
1445
  i,
1441
1446
  /* @__PURE__ */ o(
1442
1447
  Xt,
1443
- D(a(a({}, W), H), {
1444
- open: l,
1448
+ y(s(s({}, W), H), {
1449
+ open: p,
1445
1450
  onClose: P,
1446
1451
  TransitionProps: {
1447
- onExited: b,
1452
+ onExited: D,
1448
1453
  onExit: N
1449
1454
  },
1450
1455
  sx: { zIndex: Kn },
@@ -1453,14 +1458,14 @@ function to(s) {
1453
1458
  Qt,
1454
1459
  {
1455
1460
  onClose: (v) => P(v, "closeAlert"),
1456
- severity: A.severity,
1461
+ severity: b.severity,
1457
1462
  variant: "filled",
1458
- icon: A.progressIndicator === "circular" ? /* @__PURE__ */ o(De, { size: "1em" }) : void 0,
1459
- style: A.progressIndicator === "linear" ? Zn : void 0,
1460
- children: A.message
1463
+ icon: b.progressIndicator === "circular" ? /* @__PURE__ */ o(ke, { size: "1em" }) : void 0,
1464
+ style: b.progressIndicator === "linear" ? Zn : void 0,
1465
+ children: b.message
1461
1466
  }
1462
1467
  ),
1463
- A.progressIndicator === "linear" && /* @__PURE__ */ o(nt, { color: "primary" })
1468
+ b.progressIndicator === "linear" && /* @__PURE__ */ o(nt, { color: "primary" })
1464
1469
  ] })
1465
1470
  })
1466
1471
  )
@@ -1469,11 +1474,11 @@ function to(s) {
1469
1474
  function no() {
1470
1475
  const e = Ze($t);
1471
1476
  if (e === null)
1472
- throw new ke("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1477
+ throw new De("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1473
1478
  return e;
1474
1479
  }
1475
1480
  const Wo = Q(
1476
- (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(to, D(a({}, e), { overrideState: t, overrideActions: n, children: i }))
1481
+ (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(to, y(s({}, e), { overrideState: t, overrideActions: n, children: i }))
1477
1482
  ), oo = nn(), zo = ({
1478
1483
  children: e,
1479
1484
  store: t
@@ -1507,30 +1512,30 @@ const Ye = _(
1507
1512
  onClose: n,
1508
1513
  domainOptions: i,
1509
1514
  applicationName: r,
1510
- handleLogout: s
1515
+ handleLogout: l
1511
1516
  }) => {
1512
- const [c, l] = V(Tt), [d, p] = E(c), { enqueueSuccessNotification: C } = no(), f = i.length === 0, m = !!c && !i.includes(c) && !i.includes(d), h = !c || f || m, $ = () => L(void 0, null, function* () {
1513
- d ? (l(d), C(`Set organisation to ${d}`), n()) : l("");
1514
- }), k = () => L(void 0, null, function* () {
1515
- c && !f && !m ? (p(c), n()) : h && s();
1517
+ const [c, p] = V(Tt), [a, d] = E(c), { enqueueSuccessNotification: m } = no(), f = i.length === 0, w = !!c && !i.includes(c) && !i.includes(a), g = !c || f || w, S = () => L(void 0, null, function* () {
1518
+ a ? (p(a), m(`Set organisation to ${a}`), n()) : p("");
1519
+ }), C = () => L(void 0, null, function* () {
1520
+ c && !f && !w ? (d(c), n()) : g && l();
1516
1521
  });
1517
- let S;
1518
- return f ? S = "Unable to retrieve your active organisations. Try logging in again." : m && (S = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ u(
1519
- kt,
1522
+ let k;
1523
+ return f ? k = "Unable to retrieve your active organisations. Try logging in again." : w && (k = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ u(
1524
+ Dt,
1520
1525
  {
1521
1526
  isOpen: t,
1522
1527
  dialogTitle: "Select an organisation",
1523
1528
  primaryButton: {
1524
1529
  text: "Confirm",
1525
- onClick: $,
1526
- disabled: !d || f || m,
1530
+ onClick: S,
1531
+ disabled: !a || f || w,
1527
1532
  buttonColor: "primary"
1528
1533
  },
1529
1534
  secondaryButton: {
1530
- text: h ? "Logout" : "Cancel",
1531
- onClick: k
1535
+ text: g ? "Logout" : "Cancel",
1536
+ onClick: C
1532
1537
  },
1533
- onClose: h ? () => {
1538
+ onClose: g ? () => {
1534
1539
  } : n,
1535
1540
  children: [
1536
1541
  /* @__PURE__ */ u(B, { marginBottom: 2, children: [
@@ -1544,18 +1549,18 @@ const Ye = _(
1544
1549
  loading: e,
1545
1550
  multiple: !1,
1546
1551
  disableClearable: !1,
1547
- value: d !== "" ? d : null,
1548
- onChange: (I, T) => p(T != null ? T : ""),
1552
+ value: a !== "" ? a : null,
1553
+ onChange: (I, T) => d(T != null ? T : ""),
1549
1554
  getOptionLabel: ro,
1550
1555
  options: [...i],
1551
1556
  renderInput: (I) => /* @__PURE__ */ o(
1552
1557
  be,
1553
- D(a({}, I), {
1558
+ y(s({}, I), {
1554
1559
  variant: "filled",
1555
1560
  label: "Select organisation",
1556
- InputProps: D(a({}, I.InputProps), {
1561
+ InputProps: y(s({}, I.InputProps), {
1557
1562
  endAdornment: /* @__PURE__ */ u(F, { children: [
1558
- e ? /* @__PURE__ */ o(De, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1563
+ e ? /* @__PURE__ */ o(ke, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1559
1564
  I.InputProps.endAdornment
1560
1565
  ] })
1561
1566
  })
@@ -1563,7 +1568,7 @@ const Ye = _(
1563
1568
  )
1564
1569
  }
1565
1570
  ),
1566
- S && /* @__PURE__ */ o(Yt, { error: !0, children: S })
1571
+ k && /* @__PURE__ */ o(Yt, { error: !0, children: k })
1567
1572
  ]
1568
1573
  }
1569
1574
  );
@@ -1741,12 +1746,12 @@ const Ye = _(
1741
1746
  return /* @__PURE__ */ o(ln, { client: t, children: e });
1742
1747
  });
1743
1748
  export {
1744
- kt as AgDialog,
1749
+ Dt as AgDialog,
1745
1750
  Lo as AppLayout,
1746
1751
  zo as AtomProvider,
1747
1752
  Ho as AuthGuard,
1748
1753
  $t as Context,
1749
- ke as ContextError,
1754
+ De as ContextError,
1750
1755
  Uo as DomainCodeDialog,
1751
1756
  To as ExampleComponent,
1752
1757
  _o as FetchAutocomplete,