@australiangreens/ag-internal-components 0.0.78 → 0.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,62 +1,64 @@
1
- var Ot = Object.defineProperty, $t = Object.defineProperties;
2
- var yt = Object.getOwnPropertyDescriptors;
3
- var Z = Object.getOwnPropertySymbols;
4
- var Oe = Object.prototype.hasOwnProperty, $e = Object.prototype.propertyIsEnumerable;
5
- var ce = (e, t, n) => t in e ? Ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, r = (e, t) => {
1
+ var Ft = Object.defineProperty, Et = Object.defineProperties;
2
+ var Pt = Object.getOwnPropertyDescriptors;
3
+ var j = Object.getOwnPropertySymbols;
4
+ var Te = Object.prototype.hasOwnProperty, ye = Object.prototype.propertyIsEnumerable;
5
+ var de = (e, t, n) => t in e ? Ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, a = (e, t) => {
6
6
  for (var n in t || (t = {}))
7
- Oe.call(t, n) && ce(e, n, t[n]);
8
- if (Z)
9
- for (var n of Z(t))
10
- $e.call(t, n) && ce(e, n, t[n]);
7
+ Te.call(t, n) && de(e, n, t[n]);
8
+ if (j)
9
+ for (var n of j(t))
10
+ ye.call(t, n) && de(e, n, t[n]);
11
11
  return e;
12
- }, S = (e, t) => $t(e, yt(t));
13
- var ye = (e, t) => {
12
+ }, b = (e, t) => Et(e, Pt(t));
13
+ var Oe = (e, t) => {
14
14
  var n = {};
15
15
  for (var i in e)
16
- Oe.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
17
- if (e != null && Z)
18
- for (var i of Z(e))
19
- t.indexOf(i) < 0 && $e.call(e, i) && (n[i] = e[i]);
16
+ Te.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
17
+ if (e != null && j)
18
+ for (var i of j(e))
19
+ t.indexOf(i) < 0 && ye.call(e, i) && (n[i] = e[i]);
20
20
  return n;
21
21
  };
22
- var Te = (e, t, n) => (ce(e, typeof t != "symbol" ? t + "" : t, n), n);
23
- var z = (e, t, n) => new Promise((i, a) => {
24
- var s = (c) => {
22
+ var Fe = (e, t, n) => (de(e, typeof t != "symbol" ? t + "" : t, n), n);
23
+ var z = (e, t, n) => new Promise((i, r) => {
24
+ var s = (l) => {
25
25
  try {
26
- p(n.next(c));
27
- } catch (d) {
28
- a(d);
26
+ d(n.next(l));
27
+ } catch (u) {
28
+ r(u);
29
29
  }
30
- }, l = (c) => {
30
+ }, c = (l) => {
31
31
  try {
32
- p(n.throw(c));
33
- } catch (d) {
34
- a(d);
32
+ d(n.throw(l));
33
+ } catch (u) {
34
+ r(u);
35
35
  }
36
- }, p = (c) => c.done ? i(c.value) : Promise.resolve(c.value).then(s, l);
37
- p((n = n.apply(e, t)).next());
36
+ }, d = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(s, c);
37
+ d((n = n.apply(e, t)).next());
38
38
  });
39
- import { jsxs as h, Fragment as _, jsx as o } from "react/jsx-runtime";
40
- import { useState as E, createContext as Xe, useCallback as ne, useContext as Qe, createElement as ge, useEffect as Ee, useRef as de } from "react";
41
- import { Typography as F, Button as fe, Paper as Ke, Box as I, Drawer as Ce, Dialog as Tt, DialogTitle as Et, DialogContent as Ft, DialogActions as Nt, Autocomplete as ve, TextField as xe, CircularProgress as we, Chip as Pt, Tooltip as Bt, Stack as Lt, styled as be, IconButton as Q, Container as je, useTheme as ie, useMediaQuery as Mt, Collapse as _t, Avatar as Fe, Fade as Ht, Skeleton as Ne, Toolbar as Rt, Divider as Pe, CssBaseline as Wt, Snackbar as zt, Alert as Gt, LinearProgress as Vt, FormHelperText as Ut } from "@mui/material";
39
+ import { jsxs as p, Fragment as B, jsx as o } from "react/jsx-runtime";
40
+ import { useState as F, createContext as Xe, useCallback as ne, useContext as Qe, createElement as fe, useEffect as me, useRef as ue } from "react";
41
+ import { Typography as E, Button as oe, Paper as Ke, Box as $, Drawer as ve, Dialog as Ye, DialogTitle as Je, DialogContent as Ze, DialogActions as je, Autocomplete as xe, TextField as we, CircularProgress as Ae, Chip as Nt, Tooltip as Bt, Stack as Lt, styled as Se, IconButton as Q, Container as et, useTheme as re, useMediaQuery as _t, Collapse as Mt, Avatar as Ee, Fade as Rt, Skeleton as Pe, Toolbar as Ht, Divider as Ne, CssBaseline as Wt, Snackbar as zt, Alert as Ut, LinearProgress as Gt, FormHelperText as Vt } from "@mui/material";
42
42
  import qt from "@mui/material/CssBaseline";
43
- import { styled as H, createTheme as Je, alpha as pe } from "@mui/material/styles";
43
+ import { styled as R, createTheme as tt, alpha as pe } from "@mui/material/styles";
44
44
  import { AgError as Xt } from "@australiangreens/ag-error";
45
- import { createHelper as j } from "souvlaki";
46
- import Ye from "@mui/material/List";
47
- import { Cancel as Qt, ArrowDropDown as Kt, ArrowForward as Ze, ArrowBack as et, ViewHeadline as jt } from "@mui/icons-material";
45
+ import { createHelper as Y } from "souvlaki";
46
+ import nt from "@mui/material/List";
47
+ import { Cancel as Qt, ArrowDropDown as Kt, ArrowForward as ot, ArrowBack as it, ViewHeadline as Yt } from "@mui/icons-material";
48
48
  import Jt from "autosuggest-highlight/match";
49
- import Yt from "autosuggest-highlight/parse";
50
- import { useQuery as Zt, QueryClient as en, QueryClientProvider as tn } from "@tanstack/react-query";
51
- import { atom as B, useSetAtom as tt, useAtomValue as Be, useAtom as U, getDefaultStore as nn, Provider as nt } from "jotai";
52
- import { useHydrateAtoms as ot } from "jotai/utils";
53
- function go({ text: e }) {
54
- const [t, n] = E(0);
55
- return /* @__PURE__ */ h(_, { children: [
56
- /* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
57
- /* @__PURE__ */ o(F, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
49
+ import Zt from "autosuggest-highlight/parse";
50
+ import { useQuery as jt, QueryClient as en, QueryClientProvider as tn } from "@tanstack/react-query";
51
+ import { useAuth0 as nn } from "@auth0/auth0-react";
52
+ import on from "@mui/material/Skeleton";
53
+ import { atom as L, useSetAtom as rt, useAtomValue as Be, useAtom as V, getDefaultStore as rn, Provider as at } from "jotai";
54
+ import { useHydrateAtoms as st } from "jotai/utils";
55
+ function So({ text: e }) {
56
+ const [t, n] = F(0);
57
+ return /* @__PURE__ */ p(B, { children: [
58
+ /* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
59
+ /* @__PURE__ */ o(E, { variant: "caption", display: "block", children: /* @__PURE__ */ o("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
58
60
  /* @__PURE__ */ o(
59
- fe,
61
+ oe,
60
62
  {
61
63
  variant: "outlined",
62
64
  onClick: () => n((i) => i + 1),
@@ -64,25 +66,25 @@ function go({ text: e }) {
64
66
  children: "Hello I am a button"
65
67
  }
66
68
  ),
67
- /* @__PURE__ */ h("p", { children: [
69
+ /* @__PURE__ */ p("p", { children: [
68
70
  "This is some text: ",
69
71
  /* @__PURE__ */ o("span", { children: e })
70
72
  ] }),
71
- /* @__PURE__ */ h(Ke, { children: [
73
+ /* @__PURE__ */ p(Ke, { children: [
72
74
  "This number will incremember when button pressed: ",
73
75
  t
74
76
  ] })
75
77
  ] });
76
78
  }
77
- const it = 330, rt = 73, G = "Navbar", q = {
78
- root: `${G}-root`,
79
- menuButton: `${G}-menuButton`,
80
- hide: `${G}-hide`,
81
- content: `${G}-content`,
82
- userInfoHolder: `${G}-userInfoHolder`,
83
- settings: `${G}-settings`,
84
- pieChartIcon: `${G}-pieChartIcon`
85
- }, on = H(I, {
79
+ const lt = 330, ct = 73, U = "Navbar", q = {
80
+ root: `${U}-root`,
81
+ menuButton: `${U}-menuButton`,
82
+ hide: `${U}-hide`,
83
+ content: `${U}-content`,
84
+ userInfoHolder: `${U}-userInfoHolder`,
85
+ settings: `${U}-settings`,
86
+ pieChartIcon: `${U}-pieChartIcon`
87
+ }, an = R($, {
86
88
  name: "NavBar"
87
89
  })(({ theme: e }) => ({
88
90
  [`&.${q.root}`]: {
@@ -103,7 +105,7 @@ const it = 330, rt = 73, G = "Navbar", q = {
103
105
  marginTop: "64px",
104
106
  marginBottom: "16px"
105
107
  }
106
- })), at = () => ({
108
+ })), dt = () => ({
107
109
  position: "absolute",
108
110
  height: "100%",
109
111
  overflowX: "hidden",
@@ -111,51 +113,51 @@ const it = 330, rt = 73, G = "Navbar", q = {
111
113
  color: "white",
112
114
  backgroundColor: "black"
113
115
  // backgroundColor: '#e8e8e8',
114
- }), rn = () => r({
115
- width: it
116
- }, at()), an = () => r({
117
- width: rt
118
- }, at()), sn = H(Ce, {
116
+ }), sn = () => a({
117
+ width: lt
118
+ }, dt()), ln = () => a({
119
+ width: ct
120
+ }, dt()), cn = R(ve, {
119
121
  shouldForwardProp: (e) => e !== "open"
120
- })(({ theme: e, open: t }) => r(r({
121
- width: t ? it : rt,
122
+ })(({ theme: e, open: t }) => a(a({
123
+ width: t ? lt : ct,
122
124
  flexShrink: 0,
123
125
  whiteSpace: "nowrap",
124
126
  boxSizing: "border-box",
125
127
  zIndex: e.zIndex.drawer + 100
126
128
  }, t && {
127
- "& .MuiDrawer-paper": rn()
129
+ "& .MuiDrawer-paper": sn()
128
130
  }), !t && {
129
- "& .MuiDrawer-paper": an()
131
+ "& .MuiDrawer-paper": ln()
130
132
  }));
131
- class Ae extends Xt {
133
+ class be extends Xt {
132
134
  }
133
- Te(Ae, "errorName", "ContextError");
134
- const st = Xe(null), ln = {}, cn = {}, dn = ({
135
- overrideState: e = ln,
136
- overrideActions: t = cn,
135
+ Fe(be, "errorName", "ContextError");
136
+ const ut = Xe(null), dn = {}, un = {}, pn = ({
137
+ overrideState: e = dn,
138
+ overrideActions: t = un,
137
139
  children: n
138
140
  }) => {
139
- const [{ open: i }, a] = E({ open: !0 }), s = ne((c) => {
140
- a({ open: c });
141
- }, []), l = ne(() => {
142
- a((c) => S(r({}, c), { open: !c.open }));
143
- }, []), p = r(r({
141
+ const [{ open: i }, r] = F({ open: !0 }), s = ne((l) => {
142
+ r({ open: l });
143
+ }, []), c = ne(() => {
144
+ r((l) => b(a({}, l), { open: !l.open }));
145
+ }, []), d = a(a({
144
146
  open: i,
145
147
  setOpen: s,
146
- toggleOpen: l
148
+ toggleOpen: c
147
149
  }, e), t);
148
- return /* @__PURE__ */ o(st.Provider, { value: p, children: n });
149
- }, pn = () => {
150
- const e = Qe(st);
150
+ return /* @__PURE__ */ o(ut.Provider, { value: d, children: n });
151
+ }, hn = () => {
152
+ const e = Qe(ut);
151
153
  if (e === null)
152
- throw new Ae("Error: Tried to useNavBar outside of a <NavBarProvider>");
154
+ throw new be("Error: Tried to useNavBar outside of a <NavBarProvider>");
153
155
  return e;
154
- }, un = (e = {}) => r({
156
+ }, gn = (e = {}) => a({
155
157
  open: !0
156
- }, e), fo = j(
157
- (e = un(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(dn, { overrideState: e, overrideActions: t, children: n })
158
- ), Le = 7, mo = H(Ye)(({ theme: e }) => ({
158
+ }, e), bo = Y(
159
+ (e = gn(), t = {}) => ({ children: n }) => /* @__PURE__ */ o(pn, { overrideState: e, overrideActions: t, children: n })
160
+ ), Le = 7, ko = R(nt)(({ theme: e }) => ({
159
161
  backgroundColor: "black",
160
162
  color: "white",
161
163
  "& .MuiListItem-root": {
@@ -193,7 +195,7 @@ const st = Xe(null), ln = {}, cn = {}, dn = ({
193
195
  // '&.Mui-selected.Mui-focusVisible:hover': {
194
196
  // },
195
197
  }
196
- })), Me = 7, Co = H(Ye)(({ theme: e }) => ({
198
+ })), _e = 7, Do = R(nt)(({ theme: e }) => ({
197
199
  backgroundColor: "#e8e8e8",
198
200
  color: "inherit",
199
201
  "& .MuiListItem-root": {
@@ -202,7 +204,7 @@ const st = Xe(null), ln = {}, cn = {}, dn = ({
202
204
  "& .MuiListItemButton-root": {
203
205
  " .MuiListItemIcon-root": {
204
206
  color: "inherit",
205
- padding: `${Me}px`
207
+ padding: `${_e}px`
206
208
  },
207
209
  // Focus state
208
210
  "&.Mui-focusVisible": {
@@ -213,7 +215,7 @@ const st = Xe(null), ln = {}, cn = {}, dn = ({
213
215
  borderLeftStyle: "solid",
214
216
  borderLeftWidth: "7px",
215
217
  borderLeftColor: e.palette.primary.main,
216
- paddingLeft: `calc(${e.spacing(2)} - ${Me}px)`
218
+ paddingLeft: `calc(${e.spacing(2)} - ${_e}px)`
217
219
  },
218
220
  // Hover state
219
221
  "&:hover": {
@@ -232,15 +234,15 @@ const st = Xe(null), ln = {}, cn = {}, dn = ({
232
234
  // },
233
235
  }
234
236
  }));
235
- function vo({
237
+ function $o({
236
238
  "data-testid": e,
237
239
  children: t
238
240
  }) {
239
- const { open: n } = pn();
240
- return /* @__PURE__ */ h(on, { className: q.root, "data-testid": e, children: [
241
+ const { open: n } = hn();
242
+ return /* @__PURE__ */ p(an, { className: q.root, "data-testid": e, children: [
241
243
  /* @__PURE__ */ o(qt, {}),
242
244
  /* @__PURE__ */ o(
243
- sn,
245
+ cn,
244
246
  {
245
247
  variant: "permanent",
246
248
  anchor: "left",
@@ -251,159 +253,159 @@ function vo({
251
253
  )
252
254
  ] });
253
255
  }
254
- const hn = ({
256
+ const fn = ({
255
257
  isOpen: e,
256
258
  dialogTitle: t,
257
259
  children: n,
258
260
  maxWidth: i,
259
- primaryButton: a,
261
+ primaryButton: r,
260
262
  secondaryButton: s,
261
- onClose: l,
262
- sx: p,
263
- "data-testid": c,
264
- disableCloseOnBackdropOrEscape: d = !1
263
+ onClose: c,
264
+ sx: d,
265
+ "data-testid": l,
266
+ disableCloseOnBackdropOrEscape: u = !1
265
267
  }) => {
266
- var b, m;
267
- const [v, w] = E(!1);
268
- return /* @__PURE__ */ h(
269
- Tt,
268
+ var A, m;
269
+ const [v, w] = F(!1);
270
+ return /* @__PURE__ */ p(
271
+ Ye,
270
272
  {
271
273
  open: e,
272
- onClose: (A, D) => z(void 0, null, function* () {
273
- d && (D === "backdropClick" || D === "escapeKeyDown") || v || (s != null && s.onClick ? yield s.onClick() : l());
274
+ onClose: (S, k) => z(void 0, null, function* () {
275
+ u && (k === "backdropClick" || k === "escapeKeyDown") || v || (s != null && s.onClick ? yield s.onClick() : c());
274
276
  }),
275
277
  fullWidth: !0,
276
278
  maxWidth: i != null ? i : "xs",
277
- "data-testid": c,
278
- sx: p,
279
+ "data-testid": l,
280
+ sx: d,
279
281
  children: [
280
- /* @__PURE__ */ o(Et, { children: t }),
281
- /* @__PURE__ */ o(Ft, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
282
- /* @__PURE__ */ h(Nt, { children: [
282
+ /* @__PURE__ */ o(Je, { children: t }),
283
+ /* @__PURE__ */ o(Ze, { sx: { "& > :last-child": { marginBottom: 0 } }, children: n }),
284
+ /* @__PURE__ */ p(je, { children: [
283
285
  /* @__PURE__ */ o(
284
- fe,
286
+ oe,
285
287
  {
286
- onClick: (b = s == null ? void 0 : s.onClick) != null ? b : l,
288
+ onClick: (A = s == null ? void 0 : s.onClick) != null ? A : c,
287
289
  "data-testid": s == null ? void 0 : s.testId,
288
290
  disabled: (s == null ? void 0 : s.disabled) || v,
289
291
  color: s == null ? void 0 : s.buttonColor,
290
292
  children: (m = s == null ? void 0 : s.text) != null ? m : "Cancel"
291
293
  }
292
294
  ),
293
- a && /* @__PURE__ */ o(
294
- fe,
295
+ r && /* @__PURE__ */ o(
296
+ oe,
295
297
  {
296
298
  onClick: () => z(void 0, null, function* () {
297
- var A;
298
- w(!0), yield (A = a.onClick) == null ? void 0 : A.call(a), w(!1);
299
+ var S;
300
+ w(!0), yield (S = r.onClick) == null ? void 0 : S.call(r), w(!1);
299
301
  }),
300
- "data-testid": a.testId,
301
- disabled: a.disabled || v,
302
- color: a == null ? void 0 : a.buttonColor,
303
- children: a.text
302
+ "data-testid": r.testId,
303
+ disabled: r.disabled || v,
304
+ color: r == null ? void 0 : r.buttonColor,
305
+ children: r.text
304
306
  }
305
307
  )
306
308
  ] })
307
309
  ]
308
310
  }
309
311
  );
310
- }, lt = ({
312
+ }, pt = ({
311
313
  minLength: e,
312
314
  preLoadedOptions: t,
313
315
  lookup: n,
314
316
  label: i,
315
- inputValue: a
316
- }) => Zt({
317
- queryFn: () => e && a.length < e ? t != null ? t : [] : t ? t.filter(
318
- (s) => s.label.toLowerCase().includes(a.toLowerCase())
319
- ) : n(a),
320
- queryKey: ["autocomplete", i, a]
317
+ inputValue: r
318
+ }) => jt({
319
+ queryFn: () => e && r.length < e ? t != null ? t : [] : t ? t.filter(
320
+ (s) => s.label.toLowerCase().includes(r.toLowerCase())
321
+ ) : n(r),
322
+ queryKey: ["autocomplete", i, r]
321
323
  });
322
- function xo({
324
+ function Io({
323
325
  lookup: e = () => z(this, null, function* () {
324
326
  }),
325
327
  enableHighlighting: t = !0,
326
328
  onChange: n,
327
329
  minLength: i = 0,
328
- label: a,
330
+ label: r,
329
331
  value: s,
330
- "data-testid": l,
331
- sx: p,
332
- textFieldColor: c,
333
- textFieldVariant: d = "filled",
332
+ "data-testid": c,
333
+ sx: d,
334
+ textFieldColor: l,
335
+ textFieldVariant: u = "filled",
334
336
  loadingText: v = "Loading...",
335
337
  noOptionsText: w = "No options",
336
- popupIcon: b = /* @__PURE__ */ o(Kt, {}),
338
+ popupIcon: A = /* @__PURE__ */ o(Kt, {}),
337
339
  error: m = !1,
338
- helperText: A = "",
339
- preLoadedOptions: D = void 0,
340
- disablePortal: O = !1
340
+ helperText: S = "",
341
+ preLoadedOptions: k = void 0,
342
+ disablePortal: I = !1
341
343
  }) {
342
- const [g, k] = E(""), R = (u, f) => {
343
- const T = s.filter((P) => P.id !== f);
344
- n(T, "delete", u);
345
- }, { data: N, isLoading: L } = lt({
344
+ const [g, D] = F(""), H = (h, f) => {
345
+ const O = s.filter((N) => N.id !== f);
346
+ n(O, "delete", h);
347
+ }, { data: P, isLoading: _ } = pt({
346
348
  inputValue: g,
347
- label: a,
349
+ label: r,
348
350
  lookup: e,
349
351
  minLength: i,
350
- preLoadedOptions: D
351
- }), $ = g.length >= i;
352
- return /* @__PURE__ */ h("div", { "data-testid": l, children: [
352
+ preLoadedOptions: k
353
+ }), T = g.length >= i;
354
+ return /* @__PURE__ */ p("div", { "data-testid": c, children: [
353
355
  /* @__PURE__ */ o(
354
- ve,
356
+ xe,
355
357
  {
356
- sx: p,
357
- "data-testid": l ? `${l}:Autocomplete` : void 0,
358
- disablePortal: O,
358
+ sx: d,
359
+ "data-testid": c ? `${c}:Autocomplete` : void 0,
360
+ disablePortal: I,
359
361
  multiple: !0,
360
- getOptionLabel: (u) => typeof u == "string" ? u : u.label,
361
- loading: $ ? L : !1,
362
- options: [...s, ...N != null ? N : []],
362
+ getOptionLabel: (h) => typeof h == "string" ? h : h.label,
363
+ loading: T ? _ : !1,
364
+ options: [...s, ...P != null ? P : []],
363
365
  filterSelectedOptions: !0,
364
366
  includeInputInList: !0,
365
367
  value: s,
366
- onChange: (u, f, T) => {
367
- n(f, T, u);
368
+ onChange: (h, f, O) => {
369
+ n(f, O, h);
368
370
  },
369
- onInputChange: (u, f) => k(f),
370
- noOptionsText: $ ? w : "Start typing to search",
371
+ onInputChange: (h, f) => D(f),
372
+ noOptionsText: T ? w : "Start typing to search",
371
373
  loadingText: v,
372
- popupIcon: b,
373
- renderInput: (u) => /* @__PURE__ */ o(
374
- xe,
375
- S(r({}, u), {
376
- label: a,
374
+ popupIcon: A,
375
+ renderInput: (h) => /* @__PURE__ */ o(
376
+ we,
377
+ b(a({}, h), {
378
+ label: r,
377
379
  fullWidth: !0,
378
- variant: d,
380
+ variant: u,
379
381
  error: m,
380
- helperText: A,
381
- InputProps: S(r({}, u.InputProps), {
382
- endAdornment: /* @__PURE__ */ h(_, { children: [
383
- L ? /* @__PURE__ */ o(we, { color: "inherit", size: 20 }) : null,
384
- u.InputProps.endAdornment
382
+ helperText: S,
383
+ InputProps: b(a({}, h.InputProps), {
384
+ endAdornment: /* @__PURE__ */ p(B, { children: [
385
+ _ ? /* @__PURE__ */ o(Ae, { color: "inherit", size: 20 }) : null,
386
+ h.InputProps.endAdornment
385
387
  ] })
386
388
  }),
387
- "data-testid": l ? `${l}:Autocomplete:TextField` : void 0,
389
+ "data-testid": c ? `${c}:Autocomplete:TextField` : void 0,
388
390
  onKeyDown: (f) => {
389
391
  (f.key === "Backspace" || f.key === "Delete") && f.stopPropagation();
390
392
  },
391
- color: c
393
+ color: l
392
394
  })
393
395
  ),
394
396
  renderTags: () => null,
395
- isOptionEqualToValue: (u, f) => u.id === f.id,
396
- renderOption: (u, f, T) => {
397
+ isOptionEqualToValue: (h, f) => h.id === f.id,
398
+ renderOption: (h, f, O) => {
397
399
  if (t) {
398
- const P = Jt(f.label, T.inputValue, {
400
+ const N = Jt(f.label, O.inputValue, {
399
401
  insideWords: !0,
400
402
  findAllOccurrences: !0
401
- }), x = Yt(f.label, P);
402
- return /* @__PURE__ */ ge(
403
+ }), x = Zt(f.label, N);
404
+ return /* @__PURE__ */ fe(
403
405
  "li",
404
- S(r({}, u), {
406
+ b(a({}, h), {
405
407
  key: f.id,
406
- "data-testid": l ? `${l}:Autocomplete:option(${f.id.toString()})` : void 0
408
+ "data-testid": c ? `${c}:Autocomplete:option(${f.id.toString()})` : void 0
407
409
  }),
408
410
  /* @__PURE__ */ o("div", { children: x.map((C, M) => /* @__PURE__ */ o(
409
411
  "span",
@@ -417,19 +419,19 @@ function xo({
417
419
  )) })
418
420
  );
419
421
  } else
420
- return /* @__PURE__ */ ge(
422
+ return /* @__PURE__ */ fe(
421
423
  "li",
422
- S(r({}, u), {
424
+ b(a({}, h), {
423
425
  key: f.id,
424
- "data-testid": l ? `${l}:option(${f.id.toString()})` : void 0
426
+ "data-testid": c ? `${c}:option(${f.id.toString()})` : void 0
425
427
  }),
426
428
  f.label
427
429
  );
428
430
  }
429
431
  }
430
432
  ),
431
- s.length > 0 && /* @__PURE__ */ o(I, { children: s.map((u) => /* @__PURE__ */ o(
432
- Pt,
433
+ s.length > 0 && /* @__PURE__ */ o($, { children: s.map((h) => /* @__PURE__ */ o(
434
+ Nt,
433
435
  {
434
436
  sx: {
435
437
  marginTop: 1,
@@ -439,7 +441,7 @@ function xo({
439
441
  label: /* @__PURE__ */ o(
440
442
  Bt,
441
443
  {
442
- title: u.tooltipContent || "",
444
+ title: h.tooltipContent || "",
443
445
  placement: "bottom-start",
444
446
  PopperProps: {
445
447
  modifiers: [
@@ -451,109 +453,150 @@ function xo({
451
453
  }
452
454
  ]
453
455
  },
454
- children: /* @__PURE__ */ o(F, { style: { whiteSpace: "normal" }, children: u.chipLabel ? u.chipLabel : u.label })
456
+ children: /* @__PURE__ */ o(E, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
455
457
  }
456
458
  ),
457
- "data-testid": l ? `${l}:Chip(${u.id.toString()})` : void 0,
458
- onDelete: (f) => R(f, u.id),
459
+ "data-testid": c ? `${c}:Chip(${h.id.toString()})` : void 0,
460
+ onDelete: (f) => H(f, h.id),
459
461
  deleteIcon: /* @__PURE__ */ o(
460
462
  Qt,
461
463
  {
462
- "data-testid": l ? `${l}:Chip(${u.id.toString()}):deleteIcon` : void 0
464
+ "data-testid": c ? `${c}:Chip(${h.id.toString()}):deleteIcon` : void 0
463
465
  }
464
466
  )
465
467
  },
466
- u.id
468
+ h.id
467
469
  )) })
468
470
  ] });
469
471
  }
470
- const wo = ({
472
+ const To = ({
471
473
  lookup: e = () => z(void 0, null, function* () {
472
474
  }),
473
475
  onChange: t,
474
476
  label: n,
475
477
  value: i,
476
- sx: a,
478
+ sx: r,
477
479
  textFieldColor: s,
478
- textFieldVariant: l = "filled",
479
- "data-testid": p,
480
- noOptionsText: c = "No options",
481
- minLength: d = 3,
480
+ textFieldVariant: c = "filled",
481
+ "data-testid": d,
482
+ noOptionsText: l = "No options",
483
+ minLength: u = 3,
482
484
  disablePortal: v = !1,
483
485
  preLoadedOptions: w
484
486
  }) => {
485
- const [b, m] = E(""), { data: A, isLoading: D } = lt({
486
- inputValue: b,
487
+ const [A, m] = F(""), { data: S, isLoading: k } = pt({
488
+ inputValue: A,
487
489
  label: n,
488
490
  lookup: e,
489
- minLength: d != null ? d : 0,
491
+ minLength: u != null ? u : 0,
490
492
  preLoadedOptions: w
491
- }), O = b.length >= d;
492
- return /* @__PURE__ */ o("div", { "data-testid": p, children: /* @__PURE__ */ o(Lt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
493
- ve,
493
+ }), I = A.length >= u;
494
+ return /* @__PURE__ */ o("div", { "data-testid": d, children: /* @__PURE__ */ o(Lt, { direction: "row", spacing: 1, children: /* @__PURE__ */ o(
495
+ xe,
494
496
  {
495
- sx: a,
496
- "data-testid": p ? `${p}:Autocomplete` : void 0,
497
- loading: O ? D : !1,
498
- options: A != null ? A : [],
499
- onChange: (g, k) => {
500
- t(g, k);
497
+ sx: r,
498
+ "data-testid": d ? `${d}:Autocomplete` : void 0,
499
+ loading: I ? k : !1,
500
+ options: S != null ? S : [],
501
+ onChange: (g, D) => {
502
+ t(g, D);
501
503
  },
502
504
  disablePortal: v,
503
505
  filterOptions: (g) => g,
504
506
  value: i,
505
- noOptionsText: O ? c : "Start typing to search",
507
+ noOptionsText: I ? l : "Start typing to search",
506
508
  getOptionLabel: (g) => g.label,
507
509
  renderInput: (g) => /* @__PURE__ */ o(
508
- xe,
509
- S(r({
510
- "data-testid": p ? `${p}:Autocomplete:TextField` : void 0
510
+ we,
511
+ b(a({
512
+ "data-testid": d ? `${d}:Autocomplete:TextField` : void 0
511
513
  }, g), {
512
- variant: l,
514
+ variant: c,
513
515
  label: n,
514
516
  color: s
515
517
  })
516
518
  ),
517
- isOptionEqualToValue: (g, k) => g.id === k.id,
518
- onInputChange: (g, k) => {
519
- m(k);
519
+ isOptionEqualToValue: (g, D) => g.id === D.id,
520
+ onInputChange: (g, D) => {
521
+ m(D);
520
522
  },
521
- renderOption: (g, k) => /* @__PURE__ */ ge(
523
+ renderOption: (g, D) => /* @__PURE__ */ fe(
522
524
  "li",
523
- S(r({}, g), {
524
- key: k.id,
525
- "data-testid": p ? `${p}:Autocomplete:option(${k.id.toString()})` : void 0
525
+ b(a({}, g), {
526
+ key: D.id,
527
+ "data-testid": d ? `${d}:Autocomplete:option(${D.id.toString()})` : void 0
526
528
  }),
527
- k.label
529
+ D.label
528
530
  )
529
531
  }
530
532
  ) }) });
531
- }, gn = 24, fn = 64, V = "TopBar", y = {
532
- topStripe: `${V}-topStripe`,
533
- titleBar: `${V}-titleBar`,
534
- titleSlider: `${V}-titleSlider`,
535
- titleText: `${V}-titleText`,
536
- leftPanelButton: `${V}-leftPanelButton`,
537
- rightPanelButton: `${V}-leftPanelButton`
538
- }, mn = be("div", {
533
+ };
534
+ function mn(e) {
535
+ return "error" in e;
536
+ }
537
+ function Cn(e) {
538
+ return e.error === "access_denied";
539
+ }
540
+ function vn(e) {
541
+ var i;
542
+ const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
543
+ return t === "access_denied" && n.startsWith("You do not have the required authorization");
544
+ }
545
+ function xn(e) {
546
+ var i;
547
+ const t = e.error, n = (i = e == null ? void 0 : e.error_description) != null ? i : "";
548
+ return t === "access_denied" && n.startsWith("User did not authorize the request");
549
+ }
550
+ function yo({
551
+ children: e,
552
+ appName: t = "the app"
553
+ }) {
554
+ const { isAuthenticated: n, isLoading: i, error: r, loginWithRedirect: s, logout: c } = nn();
555
+ if (me(() => {
556
+ if (i || n || r)
557
+ return;
558
+ const d = {
559
+ appState: {
560
+ returnTo: `${window.location.pathname}${window.location.search}`
561
+ }
562
+ };
563
+ s(d);
564
+ }, [i, n, r, s]), r && mn(r)) {
565
+ let d = "Auth error", l = "An unknown Auth0 error occurred.";
566
+ return vn(r) ? (d = "Unauthorised", l = `You are not authorised to access ${t}.`) : xn(r) ? (d = "App not authorised", l = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`) : Cn(r) && (d = "Unauthorised", l = "Authorisation with auth0 failed for an unknown reason."), /* @__PURE__ */ p(Ye, { open: !0, children: [
567
+ /* @__PURE__ */ o(Je, { children: d }),
568
+ /* @__PURE__ */ o(Ze, { children: /* @__PURE__ */ o(E, { children: l }) }),
569
+ /* @__PURE__ */ o(je, { children: /* @__PURE__ */ o(oe, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" }) })
570
+ ] });
571
+ }
572
+ return n ? /* @__PURE__ */ o(B, { children: e }) : /* @__PURE__ */ o(on, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
573
+ }
574
+ const wn = 24, An = 64, G = "TopBar", y = {
575
+ topStripe: `${G}-topStripe`,
576
+ titleBar: `${G}-titleBar`,
577
+ titleSlider: `${G}-titleSlider`,
578
+ titleText: `${G}-titleText`,
579
+ leftPanelButton: `${G}-leftPanelButton`,
580
+ rightPanelButton: `${G}-leftPanelButton`
581
+ }, Sn = Se("div", {
539
582
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
540
- name: V
583
+ name: G
541
584
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
542
- var i, a;
585
+ var i, r;
543
586
  return {
544
587
  width: "100%",
545
588
  [`& .${y.topStripe}`]: {
546
589
  width: "100%",
547
- height: `${gn}px`,
590
+ height: `${wn}px`,
548
591
  backgroundColor: e.palette.primary.main
549
592
  },
550
593
  [`& .${y.titleBar}`]: {
551
594
  backgroundColor: e.palette.primary.light,
552
- height: `${fn}px`,
595
+ height: `${An}px`,
553
596
  padding: e.spacing(0, 3),
554
597
  width: "100%"
555
598
  },
556
- [`& .${y.titleSlider}`]: r(r({
599
+ [`& .${y.titleSlider}`]: a(a({
557
600
  height: "100%",
558
601
  display: "flex",
559
602
  alignItems: "center",
@@ -583,20 +626,20 @@ const wo = ({
583
626
  easing: e.transitions.easing.easeOut,
584
627
  duration: e.transitions.duration.enteringScreen
585
628
  }),
586
- marginRight: `${(a = n == null ? void 0 : n.width) != null ? a : 0}px`
629
+ marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
587
630
  })
588
631
  };
589
632
  });
590
- function Cn({
633
+ function bn({
591
634
  titleText: e = "",
592
635
  leftPanel: t,
593
636
  rightPanel: n,
594
637
  "data-testid": i
595
638
  }) {
596
- return /* @__PURE__ */ h(mn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
639
+ return /* @__PURE__ */ p(Sn, { leftPanel: t, rightPanel: n, "data-testid": i, children: [
597
640
  /* @__PURE__ */ o("div", { className: y.topStripe }),
598
- /* @__PURE__ */ o("div", { className: y.titleBar, children: /* @__PURE__ */ h(I, { className: y.titleSlider, children: [
599
- t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ h(
641
+ /* @__PURE__ */ o("div", { className: y.titleBar, children: /* @__PURE__ */ p($, { className: y.titleSlider, children: [
642
+ t !== void 0 && !t.open && t.showOpenArrow && /* @__PURE__ */ p(
600
643
  Q,
601
644
  {
602
645
  className: y.leftPanelButton,
@@ -607,12 +650,12 @@ function Cn({
607
650
  size: "large",
608
651
  children: [
609
652
  " ",
610
- /* @__PURE__ */ o(Ze, {})
653
+ /* @__PURE__ */ o(ot, {})
611
654
  ]
612
655
  }
613
656
  ),
614
- /* @__PURE__ */ o(F, { className: y.titleText, variant: "h6", noWrap: !0, children: e }),
615
- n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ h(
657
+ /* @__PURE__ */ o(E, { className: y.titleText, variant: "h6", noWrap: !0, children: e }),
658
+ n !== void 0 && !n.open && n.showOpenArrow && /* @__PURE__ */ p(
616
659
  Q,
617
660
  {
618
661
  className: y.rightPanelButton,
@@ -623,14 +666,14 @@ function Cn({
623
666
  size: "large",
624
667
  children: [
625
668
  " ",
626
- /* @__PURE__ */ o(et, {})
669
+ /* @__PURE__ */ o(it, {})
627
670
  ]
628
671
  }
629
672
  )
630
673
  ] }) })
631
674
  ] });
632
675
  }
633
- const ct = 400, vn = be(Ce, {
676
+ const ht = 400, kn = Se(ve, {
634
677
  shouldForwardProp: (e) => (
635
678
  // Note we do want anchor to be forwarded to the Drawer component
636
679
  ![
@@ -644,9 +687,9 @@ const ct = 400, vn = be(Ce, {
644
687
  ),
645
688
  name: "SidePanelDrawer"
646
689
  })(
647
- ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: i, navBarWidthOpen: a, navBarWidthClosed: s }) => ({
690
+ ({ width: e, debugOpacity: t = !1, anchor: n, navBarOpen: i, navBarWidthOpen: r, navBarWidthClosed: s }) => ({
648
691
  width: e,
649
- "& .MuiDrawer-paper": r(r({
692
+ "& .MuiDrawer-paper": a(a({
650
693
  position: "absolute",
651
694
  width: e,
652
695
  boxSizing: "border-box",
@@ -654,15 +697,15 @@ const ct = 400, vn = be(Ce, {
654
697
  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)"
655
698
  }, t && {
656
699
  opacity: "50%"
657
- }), n === "left" && r({
700
+ }), n === "left" && a({
658
701
  marginLeft: `${s}px`
659
702
  }, i && {
660
- marginLeft: `${a}px`
703
+ marginLeft: `${r}px`
661
704
  }))
662
705
  })
663
- ), xn = be(I, {
706
+ ), Dn = Se($, {
664
707
  shouldForwardProp: (e) => !["anchor"].includes(e)
665
- })(({ theme: e, anchor: t }) => S(r({
708
+ })(({ theme: e, anchor: t }) => b(a({
666
709
  display: "flex",
667
710
  alignItems: "center",
668
711
  padding: e.spacing(2)
@@ -680,65 +723,65 @@ const ct = 400, vn = be(Ce, {
680
723
  marginRight: t === "right" ? e.spacing(2) : 0
681
724
  }
682
725
  }));
683
- function _e({
726
+ function Me({
684
727
  children: e,
685
728
  anchor: t = "left",
686
729
  open: n,
687
730
  onClose: i = () => {
688
731
  },
689
- titleText: a = "",
690
- width: s = ct,
691
- showCloseArrow: l = !0,
692
- debugOpacity: p = !1,
693
- headerBoxProps: c = {},
694
- onOpened: d,
732
+ titleText: r = "",
733
+ width: s = ht,
734
+ showCloseArrow: c = !0,
735
+ debugOpacity: d = !1,
736
+ headerBoxProps: l = {},
737
+ onOpened: u,
695
738
  onClosed: v,
696
739
  "data-testid": w,
697
- navBarOpen: b = !1,
740
+ navBarOpen: A = !1,
698
741
  navBarWidthOpen: m = 0,
699
- navBarWidthClosed: A = 0
742
+ navBarWidthClosed: S = 0
700
743
  }) {
701
- return /* @__PURE__ */ h(
702
- vn,
744
+ return /* @__PURE__ */ p(
745
+ kn,
703
746
  {
704
747
  SlideProps: {
705
- onEntered: () => d == null ? void 0 : d(),
748
+ onEntered: () => u == null ? void 0 : u(),
706
749
  onExited: () => v == null ? void 0 : v()
707
750
  },
708
751
  variant: "persistent",
709
752
  anchor: t,
710
753
  open: n,
711
754
  width: s,
712
- debugOpacity: p,
755
+ debugOpacity: d,
713
756
  "data-testid": w,
714
- navBarOpen: b,
757
+ navBarOpen: A,
715
758
  navBarWidthOpen: m,
716
- navBarWidthClosed: A,
759
+ navBarWidthClosed: S,
717
760
  children: [
718
- /* @__PURE__ */ o(xn, S(r({ anchor: t }, c), { children: t === "left" ? /* @__PURE__ */ h(_, { children: [
719
- /* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", children: a }),
720
- l && /* @__PURE__ */ h(Q, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
721
- /* @__PURE__ */ o(et, { "data-testid": "arrowbackicon" }),
761
+ /* @__PURE__ */ o(Dn, b(a({ anchor: t }, l), { children: t === "left" ? /* @__PURE__ */ p(B, { children: [
762
+ /* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", children: r }),
763
+ c && /* @__PURE__ */ p(Q, { onClick: i, size: "large", "aria-label": "Close left side panel", children: [
764
+ /* @__PURE__ */ o(it, { "data-testid": "arrowbackicon" }),
722
765
  " "
723
766
  ] })
724
- ] }) : /* @__PURE__ */ h(_, { children: [
725
- l && /* @__PURE__ */ h(Q, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
726
- /* @__PURE__ */ o(Ze, {}),
767
+ ] }) : /* @__PURE__ */ p(B, { children: [
768
+ c && /* @__PURE__ */ p(Q, { onClick: i, size: "large", "aria-label": "Close right side panel", children: [
769
+ /* @__PURE__ */ o(ot, {}),
727
770
  " "
728
771
  ] }),
729
- /* @__PURE__ */ o(F, { variant: "h6", color: "inherit", component: "div", children: a })
772
+ /* @__PURE__ */ o(E, { variant: "h6", color: "inherit", component: "div", children: r })
730
773
  ] }) })),
731
774
  e
732
775
  ]
733
776
  }
734
777
  );
735
778
  }
736
- const wn = H(I, {
779
+ const $n = R($, {
737
780
  shouldForwardProp: (e) => !["leftPanel", "rightPanel"].includes(e),
738
781
  name: "PanelAwareMargins"
739
782
  })(({ theme: e, leftPanel: t, rightPanel: n }) => {
740
- var i, a;
741
- return r(r({
783
+ var i, r;
784
+ return a(a({
742
785
  transition: e.transitions.create("margin", {
743
786
  easing: e.transitions.easing.sharp,
744
787
  duration: e.transitions.duration.leavingScreen
@@ -754,160 +797,160 @@ const wn = H(I, {
754
797
  easing: e.transitions.easing.easeOut,
755
798
  duration: e.transitions.duration.enteringScreen
756
799
  }),
757
- marginRight: `${(a = n == null ? void 0 : n.width) != null ? a : 0}px`
800
+ marginRight: `${(r = n == null ? void 0 : n.width) != null ? r : 0}px`
758
801
  });
759
- }), bn = H(je, {
802
+ }), In = R(et, {
760
803
  name: "PageContainer"
761
804
  })(({ theme: e }) => ({
762
805
  // Horizontal padding comes from the Container's gutter
763
806
  paddingTop: e.spacing(3),
764
807
  paddingBottom: e.spacing(3)
765
808
  // TODO: Remove max width
766
- })), ue = !1, he = !1, ee = {
809
+ })), he = !1, ge = !1, ee = {
767
810
  titleText: "",
768
811
  flavour: "push",
769
- width: ct,
812
+ width: ht,
770
813
  arrowButtons: "both",
771
814
  startOpen: !1,
772
815
  open: void 0,
773
816
  onChangeOpen: void 0,
774
- content: /* @__PURE__ */ o(_, {}),
817
+ content: /* @__PURE__ */ o(B, {}),
775
818
  onOpened: void 0,
776
819
  onClosed: void 0,
777
820
  dataTestId: void 0
778
821
  };
779
- function bo({
822
+ function Oo({
780
823
  children: e,
781
824
  titleText: t = "",
782
825
  leftPanel: n,
783
826
  rightPanel: i,
784
- sidePanelsAreMutuallyExclusive: a = !0,
827
+ sidePanelsAreMutuallyExclusive: r = !0,
785
828
  debugOpacity: s = !1,
786
- pageContainerProps: l,
787
- pageContentDataTestId: p,
788
- topBarDataTestId: c,
789
- navBarOpen: d,
829
+ pageContainerProps: c,
830
+ pageContentDataTestId: d,
831
+ topBarDataTestId: l,
832
+ navBarOpen: u,
790
833
  navBarWidthOpen: v,
791
834
  navBarWidthClosed: w
792
835
  }) {
793
- const [b, m] = E(ue), [A, D] = E(he), [O, g] = E(ue), [k, R] = E(he), N = n !== void 0, L = i !== void 0, {
794
- titleText: $,
795
- content: u,
836
+ const [A, m] = F(he), [S, k] = F(ge), [I, g] = F(he), [D, H] = F(ge), P = n !== void 0, _ = i !== void 0, {
837
+ titleText: T,
838
+ content: h,
796
839
  flavour: f,
797
- open: T,
798
- onChangeOpen: P,
840
+ open: O,
841
+ onChangeOpen: N,
799
842
  width: x,
800
843
  arrowButtons: C,
801
844
  startOpen: M,
802
- onOpened: xt,
803
- onClosed: wt,
804
- dataTestId: bt
805
- } = n ? r(r({}, ee), n) : r({}, ee), {
806
- titleText: At,
807
- content: St,
808
- flavour: Se,
809
- open: re,
845
+ onOpened: bt,
846
+ onClosed: kt,
847
+ dataTestId: Dt
848
+ } = n ? a(a({}, ee), n) : a({}, ee), {
849
+ titleText: $t,
850
+ content: It,
851
+ flavour: ke,
852
+ open: ae,
810
853
  onChangeOpen: De,
811
- width: ae,
854
+ width: se,
812
855
  arrowButtons: J,
813
- startOpen: Y,
814
- onOpened: Dt,
815
- onClosed: kt,
816
- dataTestId: It
817
- } = i ? r(r({}, ee), i) : r({}, ee);
818
- Ee(() => {
819
- M !== ue && (m(M), g(M));
820
- }, [M]), Ee(() => {
821
- Y !== he && (D(Y), R(Y));
822
- }, [Y]);
823
- const se = T === void 0 ? b : T, le = re === void 0 ? A : re, ke = (W) => {
824
- T === void 0 && (m(W), a && L && (W ? (D(!1), R(A)) : D(k))), P && P(W);
856
+ startOpen: Z,
857
+ onOpened: Tt,
858
+ onClosed: yt,
859
+ dataTestId: Ot
860
+ } = i ? a(a({}, ee), i) : a({}, ee);
861
+ me(() => {
862
+ M !== he && (m(M), g(M));
863
+ }, [M]), me(() => {
864
+ Z !== ge && (k(Z), H(Z));
865
+ }, [Z]);
866
+ const le = O === void 0 ? A : O, ce = ae === void 0 ? S : ae, $e = (W) => {
867
+ O === void 0 && (m(W), r && _ && (W ? (k(!1), H(S)) : k(D))), N && N(W);
825
868
  }, Ie = (W) => {
826
- re === void 0 && (D(W), a && N && (W ? (m(!1), g(b)) : m(O))), De && De(W);
869
+ ae === void 0 && (k(W), r && P && (W ? (m(!1), g(A)) : m(I))), De && De(W);
827
870
  };
828
- return /* @__PURE__ */ h(I, { children: [
829
- N && /* @__PURE__ */ o(
830
- _e,
871
+ return /* @__PURE__ */ p($, { children: [
872
+ P && /* @__PURE__ */ o(
873
+ Me,
831
874
  {
832
- "data-testid": bt,
875
+ "data-testid": Dt,
833
876
  anchor: "left",
834
- open: se,
835
- onClose: () => ke(!1),
877
+ open: le,
878
+ onClose: () => $e(!1),
836
879
  width: x,
837
- titleText: $,
880
+ titleText: T,
838
881
  debugOpacity: s,
839
882
  showCloseArrow: C === "both" || C === "close",
840
- onOpened: xt,
841
- onClosed: wt,
842
- navBarOpen: d,
883
+ onOpened: bt,
884
+ onClosed: kt,
885
+ navBarOpen: u,
843
886
  navBarWidthOpen: v,
844
887
  navBarWidthClosed: w,
845
- children: u
888
+ children: h
846
889
  }
847
890
  ),
848
- L && /* @__PURE__ */ o(
849
- _e,
891
+ _ && /* @__PURE__ */ o(
892
+ Me,
850
893
  {
851
- "data-testid": It,
894
+ "data-testid": Ot,
852
895
  anchor: "right",
853
- open: le,
896
+ open: ce,
854
897
  onClose: () => Ie(!1),
855
- width: ae,
856
- titleText: At,
898
+ width: se,
899
+ titleText: $t,
857
900
  debugOpacity: s,
858
901
  showCloseArrow: J === "both" || J === "close",
859
- onOpened: Dt,
860
- onClosed: kt,
861
- navBarOpen: d,
902
+ onOpened: Tt,
903
+ onClosed: yt,
904
+ navBarOpen: u,
862
905
  navBarWidthOpen: v,
863
906
  navBarWidthClosed: w,
864
- children: St
907
+ children: It
865
908
  }
866
909
  ),
867
910
  /* @__PURE__ */ o(
868
- Cn,
869
- r(r({
911
+ bn,
912
+ a(a({
870
913
  titleText: t,
871
- "data-testid": c
872
- }, N && f === "push" ? {
914
+ "data-testid": l
915
+ }, P && f === "push" ? {
873
916
  leftPanel: {
874
- open: se,
917
+ open: le,
875
918
  width: x,
876
- onOpen: () => ke(!0),
919
+ onOpen: () => $e(!0),
877
920
  showOpenArrow: C === "both" || C === "open"
878
921
  }
879
- } : {}), L && Se === "push" ? {
922
+ } : {}), _ && ke === "push" ? {
880
923
  rightPanel: {
881
- open: le,
882
- width: ae,
924
+ open: ce,
925
+ width: se,
883
926
  onOpen: () => Ie(!0),
884
927
  showOpenArrow: J === "both" || J === "open"
885
928
  }
886
929
  } : {})
887
930
  ),
888
931
  /* @__PURE__ */ o(
889
- wn,
890
- S(r(r({}, f === "push" ? {
932
+ $n,
933
+ b(a(a({}, f === "push" ? {
891
934
  leftPanel: {
892
- open: se,
935
+ open: le,
893
936
  width: x
894
937
  }
895
- } : {}), Se === "push" ? {
938
+ } : {}), ke === "push" ? {
896
939
  rightPanel: {
897
- open: le,
898
- width: ae
940
+ open: ce,
941
+ width: se
899
942
  }
900
943
  } : {}), {
901
- children: /* @__PURE__ */ o(bn, S(r({ "data-testid": p }, l), { children: e }))
944
+ children: /* @__PURE__ */ o(In, b(a({ "data-testid": d }, c), { children: e }))
902
945
  })
903
946
  )
904
947
  ] });
905
948
  }
906
- const dt = () => {
907
- const e = ie();
908
- return Mt(e.breakpoints.down("sm"));
909
- }, An = 64, Sn = 64, Dn = 256, K = B(!0), pt = B(Dn), ut = B(Sn), me = B(""), kn = B(void 0), ht = B(An), gt = B(void 0);
910
- function In({ links: e }) {
949
+ const gt = () => {
950
+ const e = re();
951
+ return _t(e.breakpoints.down("sm"));
952
+ }, Tn = 64, yn = 64, On = 256, K = L(!0), ft = L(On), mt = L(yn), Ce = L(""), Fn = L(void 0), Ct = L(Tn), vt = L(void 0);
953
+ function En({ links: e }) {
911
954
  return /* @__PURE__ */ o("div", { children: "LinksMenu not implemented yet" });
912
955
  }
913
956
  const te = "Navbar", X = {
@@ -918,7 +961,7 @@ const te = "Navbar", X = {
918
961
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
919
962
  // settings: `${PREFIX}-settings`,
920
963
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
921
- }, On = H(I, { name: "NavBar" })(({ theme: e }) => ({
964
+ }, Pn = R($, { name: "NavBar" })(({ theme: e }) => ({
922
965
  [`&.${X.root}`]: {
923
966
  display: "flex"
924
967
  },
@@ -937,14 +980,14 @@ const te = "Navbar", X = {
937
980
  // marginTop: '64px',
938
981
  // marginBottom: '16px',
939
982
  // },
940
- })), oe = (e, t, n) => e.transitions.create(t, {
983
+ })), ie = (e, t, n) => e.transitions.create(t, {
941
984
  easing: e.transitions.easing.sharp,
942
985
  duration: n === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
943
- }), $n = (e) => {
944
- const t = ie();
986
+ }), Nn = (e) => {
987
+ const t = re();
945
988
  return /* @__PURE__ */ o(
946
- _t,
947
- r({
989
+ Mt,
990
+ a({
948
991
  easing: t.transitions.easing.sharp,
949
992
  timeout: {
950
993
  enter: t.transitions.duration.enteringScreen,
@@ -952,7 +995,7 @@ const te = "Navbar", X = {
952
995
  }
953
996
  }, e)
954
997
  );
955
- }, ft = (e) => {
998
+ }, xt = (e) => {
956
999
  var t, n;
957
1000
  return {
958
1001
  overflowX: "hidden",
@@ -960,40 +1003,40 @@ const te = "Navbar", X = {
960
1003
  backgroundColor: (n = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? n : "white"
961
1004
  // Provide default so tests don't need to wrap theme provider
962
1005
  };
963
- }, He = (e, t) => r({
1006
+ }, Re = (e, t) => a({
964
1007
  width: t,
965
- transition: oe(e, "width", "entering")
966
- }, ft(e)), Re = (e, t) => r({
1008
+ transition: ie(e, "width", "entering")
1009
+ }, xt(e)), He = (e, t) => a({
967
1010
  width: t,
968
- transition: oe(e, "width", "leaving")
969
- }, ft(e)), yn = H(Ce, {
1011
+ transition: ie(e, "width", "leaving")
1012
+ }, xt(e)), Bn = R(ve, {
970
1013
  shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
971
- })(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: a }) => r(r({
1014
+ })(({ theme: e, open: t, widthOpen: n, widthClosed: i, isSmallScreen: r }) => a(a({
972
1015
  flexShrink: 0,
973
1016
  whiteSpace: "nowrap",
974
1017
  boxSizing: "border-box",
975
1018
  display: "flex",
976
1019
  flexDirection: "column"
977
- }, t && S(r({}, He(e, n)), {
1020
+ }, t && b(a({}, Re(e, n)), {
978
1021
  backgroundColor: "",
979
- "& .MuiDrawer-paper": He(e, n)
980
- })), !t && S(r({}, Re(e, a ? n : i)), {
1022
+ "& .MuiDrawer-paper": Re(e, n)
1023
+ })), !t && b(a({}, He(e, r ? n : i)), {
981
1024
  backgroundColor: "",
982
- "& .MuiDrawer-paper": Re(e, a ? n : i)
1025
+ "& .MuiDrawer-paper": He(e, r ? n : i)
983
1026
  })));
984
- function Tn(e) {
1027
+ function Ln(e) {
985
1028
  let t = 0;
986
1029
  for (let n = 0, i = e.length; n < i; n++) {
987
- const a = e.charCodeAt(n);
988
- t = (t << 5) - t + a, t |= 0;
1030
+ const r = e.charCodeAt(n);
1031
+ t = (t << 5) - t + r, t |= 0;
989
1032
  }
990
1033
  return t;
991
1034
  }
992
- const We = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], En = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
993
- function Fn({ user: e, domainCode: t, open: n }) {
994
- const i = ie();
995
- return /* @__PURE__ */ h(
996
- I,
1035
+ const We = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], _n = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
1036
+ function Mn({ user: e, domainCode: t, open: n }) {
1037
+ const i = re();
1038
+ return /* @__PURE__ */ p(
1039
+ $,
997
1040
  {
998
1041
  sx: {
999
1042
  paddingTop: 3,
@@ -1004,85 +1047,85 @@ function Fn({ user: e, domainCode: t, open: n }) {
1004
1047
  },
1005
1048
  children: [
1006
1049
  /* @__PURE__ */ o(
1007
- I,
1050
+ $,
1008
1051
  {
1009
1052
  sx: {
1010
1053
  width: n ? "5rem" : "2rem",
1011
- transition: n ? oe(i, ["width", "height"], "entering") : oe(i, ["width", "height"], "leaving"),
1054
+ transition: n ? ie(i, ["width", "height"], "entering") : ie(i, ["width", "height"], "leaving"),
1012
1055
  aspectRatio: 1
1013
1056
  },
1014
1057
  children: e != null && e.name ? /* @__PURE__ */ o(
1015
- Fe,
1058
+ Ee,
1016
1059
  {
1017
1060
  src: e == null ? void 0 : e.picture,
1018
1061
  sx: {
1019
1062
  width: "100%",
1020
1063
  height: "100%",
1021
- bgcolor: We[Math.abs(Tn(e.name)) % We.length]
1064
+ bgcolor: We[Math.abs(Ln(e.name)) % We.length]
1022
1065
  },
1023
- children: En(e.name)
1066
+ children: _n(e.name)
1024
1067
  }
1025
- ) : /* @__PURE__ */ o(Fe, { sx: { width: "100%", height: "100%" } })
1068
+ ) : /* @__PURE__ */ o(Ee, { sx: { width: "100%", height: "100%" } })
1026
1069
  }
1027
1070
  ),
1028
- /* @__PURE__ */ o($n, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Ht, { in: n, children: /* @__PURE__ */ h(I, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
1029
- e != null && e.name ? /* @__PURE__ */ o(F, { children: e.name }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "50%" }),
1030
- t ? /* @__PURE__ */ o(F, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Ne, { animation: !1, width: "25%" })
1071
+ /* @__PURE__ */ o(Nn, { sx: { width: "100%" }, in: n, children: /* @__PURE__ */ o(Rt, { in: n, children: /* @__PURE__ */ p($, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
1072
+ e != null && e.name ? /* @__PURE__ */ o(E, { children: e.name }) : /* @__PURE__ */ o(Pe, { animation: !1, width: "50%" }),
1073
+ t ? /* @__PURE__ */ o(E, { children: t.toUpperCase() }) : /* @__PURE__ */ o(Pe, { animation: !1, width: "25%" })
1031
1074
  ] }) }) })
1032
1075
  ]
1033
1076
  }
1034
1077
  );
1035
1078
  }
1036
- function Nn({
1079
+ function Rn({
1037
1080
  open: e,
1038
1081
  widthClosed: t,
1039
1082
  widthOpen: n,
1040
1083
  "data-testid": i,
1041
- top: a,
1084
+ top: r,
1042
1085
  middle: s,
1043
- bottom: l,
1044
- user: p,
1045
- domainCode: c
1086
+ bottom: c,
1087
+ user: d,
1088
+ domainCode: l
1046
1089
  }) {
1047
- const d = dt(), v = tt(K);
1048
- return /* @__PURE__ */ o(On, { className: X.root, "data-testid": i, children: /* @__PURE__ */ h(
1049
- yn,
1090
+ const u = gt(), v = rt(K);
1091
+ return /* @__PURE__ */ o(Pn, { className: X.root, "data-testid": i, children: /* @__PURE__ */ p(
1092
+ Bn,
1050
1093
  {
1051
1094
  open: e,
1052
1095
  widthOpen: n,
1053
1096
  widthClosed: t,
1054
1097
  anchor: "left",
1055
- variant: d ? "temporary" : "permanent",
1098
+ variant: u ? "temporary" : "permanent",
1056
1099
  PaperProps: {
1057
1100
  component: "nav"
1058
1101
  },
1059
1102
  onClose: () => {
1060
1103
  v(!1);
1061
1104
  },
1062
- isSmallScreen: d,
1105
+ isSmallScreen: u,
1063
1106
  children: [
1064
- !d && /* @__PURE__ */ o(Rt, {}),
1065
- a && /* @__PURE__ */ h(I, { flexGrow: "0", children: [
1066
- a,
1067
- /* @__PURE__ */ o(Pe, { variant: "middle" })
1107
+ !u && /* @__PURE__ */ o(Ht, {}),
1108
+ r && /* @__PURE__ */ p($, { flexGrow: "0", children: [
1109
+ r,
1110
+ /* @__PURE__ */ o(Ne, { variant: "middle" })
1068
1111
  ] }),
1069
- /* @__PURE__ */ o(I, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ o(In, { links: s }) : s }),
1070
- /* @__PURE__ */ h(I, { flexGrow: "0", children: [
1071
- /* @__PURE__ */ o(Pe, { variant: "middle" }),
1072
- /* @__PURE__ */ o(Fn, { user: p, domainCode: c, open: e }),
1073
- l && /* @__PURE__ */ o(_, { children: l })
1112
+ /* @__PURE__ */ o($, { flexGrow: "1", children: Array.isArray(s) ? /* @__PURE__ */ o(En, { links: s }) : s }),
1113
+ /* @__PURE__ */ p($, { flexGrow: "0", children: [
1114
+ /* @__PURE__ */ o(Ne, { variant: "middle" }),
1115
+ /* @__PURE__ */ o(Mn, { user: d, domainCode: l, open: e }),
1116
+ c && /* @__PURE__ */ o(B, { children: c })
1074
1117
  ] })
1075
1118
  ]
1076
1119
  }
1077
1120
  ) });
1078
1121
  }
1079
- function Pn({
1122
+ function Hn({
1080
1123
  children: e,
1081
1124
  topBarHeight: t,
1082
1125
  maxWidth: n = !1
1083
1126
  }) {
1084
1127
  return /* @__PURE__ */ o(
1085
- I,
1128
+ $,
1086
1129
  {
1087
1130
  sx: {
1088
1131
  overflow: "auto",
@@ -1092,7 +1135,7 @@ function Pn({
1092
1135
  flexGrow: 1
1093
1136
  },
1094
1137
  children: /* @__PURE__ */ o(
1095
- je,
1138
+ et,
1096
1139
  {
1097
1140
  component: "main",
1098
1141
  id: "main-content",
@@ -1104,17 +1147,17 @@ function Pn({
1104
1147
  }
1105
1148
  );
1106
1149
  }
1107
- const Bn = "TopBar", Ln = {
1108
- titleText: `${Bn}-titleText`
1150
+ const Wn = "TopBar", zn = {
1151
+ titleText: `${Wn}-titleText`
1109
1152
  };
1110
- function Mn({
1153
+ function Un({
1111
1154
  titleText: e = "",
1112
1155
  height: t,
1113
1156
  "data-testid": n,
1114
1157
  middle: i
1115
1158
  }) {
1116
- const a = tt(K), s = () => a((c) => !c), l = ie(), p = dt();
1117
- return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ h(
1159
+ const r = rt(K), s = () => r((l) => !l), c = re(), d = gt();
1160
+ return /* @__PURE__ */ o("header", { "data-testid": n, children: /* @__PURE__ */ p(
1118
1161
  Ke,
1119
1162
  {
1120
1163
  square: !0,
@@ -1129,66 +1172,66 @@ function Mn({
1129
1172
  gap: 2,
1130
1173
  flexShrink: 0,
1131
1174
  height: t,
1132
- zIndex: p ? 0 : l.zIndex.drawer + 1
1175
+ zIndex: d ? 0 : c.zIndex.drawer + 1
1133
1176
  },
1134
1177
  children: [
1135
- /* @__PURE__ */ o(Q, { size: "medium", color: "inherit", sx: { padding: 1.5 }, onClick: s, children: /* @__PURE__ */ o(jt, { fontSize: "medium" }) }),
1136
- /* @__PURE__ */ o(F, { className: Ln.titleText, variant: "h6", children: e }),
1178
+ /* @__PURE__ */ o(Q, { size: "medium", color: "inherit", sx: { padding: 1.5 }, onClick: s, children: /* @__PURE__ */ o(Yt, { fontSize: "medium" }) }),
1179
+ /* @__PURE__ */ o(E, { className: zn.titleText, variant: "h6", children: e }),
1137
1180
  i
1138
1181
  ]
1139
1182
  }
1140
1183
  ) });
1141
1184
  }
1142
- function Ao({
1185
+ function Fo({
1143
1186
  children: e,
1144
1187
  initialTitleText: t,
1145
1188
  initialNavBarOpen: n,
1146
1189
  pageContainerProps: i,
1147
- pageContentDataTestId: a,
1190
+ pageContentDataTestId: r,
1148
1191
  topBarDataTestId: s,
1149
- navBarDataTestId: l,
1150
- navBarMiddle: p,
1151
- navBarBottom: c,
1152
- user: d,
1192
+ navBarDataTestId: c,
1193
+ navBarMiddle: d,
1194
+ navBarBottom: l,
1195
+ user: u,
1153
1196
  domainCode: v
1154
1197
  }) {
1155
- ot([
1198
+ st([
1156
1199
  [K, n != null ? n : !0],
1157
- [me, t != null ? t : ""]
1200
+ [Ce, t != null ? t : ""]
1158
1201
  ]);
1159
- const w = Be(K), [b] = U(pt), [m] = U(ut), A = Be(me), [D] = U(ht), [O] = U(kn), [g] = U(gt);
1160
- return /* @__PURE__ */ h(I, { children: [
1202
+ const w = Be(K), [A] = V(ft), [m] = V(mt), S = Be(Ce), [k] = V(Ct), [I] = V(Fn), [g] = V(vt);
1203
+ return /* @__PURE__ */ p($, { children: [
1161
1204
  /* @__PURE__ */ o(Wt, {}),
1162
1205
  /* @__PURE__ */ o(
1163
- Mn,
1206
+ Un,
1164
1207
  {
1165
- titleText: A,
1208
+ titleText: S,
1166
1209
  "data-testid": s,
1167
- height: D,
1168
- middle: O
1210
+ height: k,
1211
+ middle: I
1169
1212
  }
1170
1213
  ),
1171
- /* @__PURE__ */ h(I, { sx: { display: "flex" }, children: [
1214
+ /* @__PURE__ */ p($, { sx: { display: "flex" }, children: [
1172
1215
  /* @__PURE__ */ o(
1173
- Nn,
1216
+ Rn,
1174
1217
  {
1175
1218
  open: w,
1176
1219
  top: g,
1177
- middle: p,
1178
- bottom: c,
1179
- user: d,
1220
+ middle: d,
1221
+ bottom: l,
1222
+ user: u,
1180
1223
  domainCode: v,
1181
- widthOpen: b,
1224
+ widthOpen: A,
1182
1225
  widthClosed: m,
1183
- offsetTop: D,
1184
- "data-testid": l
1226
+ offsetTop: k,
1227
+ "data-testid": c
1185
1228
  }
1186
1229
  ),
1187
1230
  /* @__PURE__ */ o(
1188
- Pn,
1189
- S(r({
1190
- "data-testid": a,
1191
- topBarHeight: D
1231
+ Hn,
1232
+ b(a({
1233
+ "data-testid": r,
1234
+ topBarHeight: k
1192
1235
  }, i), {
1193
1236
  children: e
1194
1237
  })
@@ -1196,13 +1239,13 @@ function Ao({
1196
1239
  ] })
1197
1240
  ] });
1198
1241
  }
1199
- const _n = {
1242
+ const Gn = {
1200
1243
  autoHideDuration: 6e3,
1201
1244
  anchorOrigin: { vertical: "top", horizontal: "center" },
1202
1245
  // The default is false. If we prefer timer to continue when window loses
1203
1246
  // focus, change to true
1204
1247
  disableWindowBlurListener: !1
1205
- }, Hn = {
1248
+ }, Vn = {
1206
1249
  shouldClose: (e, t) => t !== "clickaway"
1207
1250
  }, ze = {
1208
1251
  message: "",
@@ -1210,108 +1253,108 @@ const _n = {
1210
1253
  variant: "standard",
1211
1254
  progressIndicator: void 0
1212
1255
  // Can use 'circular' or 'linear'
1213
- }, Ge = 100, Ve = 2e3, Rn = 2e3, Wn = (() => {
1256
+ }, Ue = 100, Ge = 2e3, qn = 2e3, Xn = (() => {
1214
1257
  let e = 0;
1215
1258
  return () => (e += 1, e);
1216
- })(), zn = {
1259
+ })(), Qn = {
1217
1260
  borderBottomLeftRadius: "0px",
1218
1261
  borderBottomRightRadius: "0px"
1219
- }, Gn = {}, Vn = {}, mt = Xe(null);
1220
- function Un(s) {
1221
- var l = s, {
1222
- overrideState: e = Gn,
1223
- overrideActions: t = Vn,
1224
- shouldClose: n = Hn.shouldClose,
1262
+ }, Kn = {}, Yn = {}, wt = Xe(null);
1263
+ function Jn(s) {
1264
+ var c = s, {
1265
+ overrideState: e = Kn,
1266
+ overrideActions: t = Yn,
1267
+ shouldClose: n = Vn.shouldClose,
1225
1268
  children: i
1226
- } = l, a = ye(l, [
1269
+ } = c, r = Oe(c, [
1227
1270
  "overrideState",
1228
1271
  "overrideActions",
1229
1272
  "shouldClose",
1230
1273
  "children"
1231
1274
  ]);
1232
- var P;
1233
- const [{ open: p }, c] = E({ open: !1 }), d = de([]), v = de(Date.now()), w = de(0), b = ne((x) => {
1234
- c({ open: x });
1275
+ var N;
1276
+ const [{ open: d }, l] = F({ open: !1 }), u = ue([]), v = ue(Date.now()), w = ue(0), A = ne((x) => {
1277
+ l({ open: x });
1235
1278
  }, []), m = ne((x = {}) => {
1236
- w.current += 1, d.current.length >= Ge && Date.now() - v.current >= Ve && (v.current = Date.now(), console.error(
1237
- `SaladBarProvider: MAX_QUEUE_LENGTH (${Ge}) hit ${w.current} times in last ${Ve}ms)`
1279
+ w.current += 1, u.current.length >= Ue && Date.now() - v.current >= Ge && (v.current = Date.now(), console.error(
1280
+ `SaladBarProvider: MAX_QUEUE_LENGTH (${Ue}) hit ${w.current} times in last ${Ge}ms)`
1238
1281
  ), w.current = 0);
1239
- const C = r(S(r({}, ze), {
1240
- key: Wn()
1282
+ const C = a(b(a({}, ze), {
1283
+ key: Xn()
1241
1284
  }), x);
1242
- return d.current.push(C), d.current.length === 1 && c({ open: !0 }), C.key;
1243
- }, []), A = (x = "", C = {}) => m(r({ message: x, severity: "success" }, C)), D = (x = "", C = {}) => m(r({ message: x, severity: "info" }, C)), O = (x = "", C = {}) => m(r({ message: x, severity: "warning" }, C)), g = (x = "", C = {}) => m(r({ message: x, severity: "error" }, C)), k = (x) => {
1244
- const C = d.current.findIndex((M) => M.key === x);
1285
+ return u.current.push(C), u.current.length === 1 && l({ open: !0 }), C.key;
1286
+ }, []), S = (x = "", C = {}) => m(a({ message: x, severity: "success" }, C)), k = (x = "", C = {}) => m(a({ message: x, severity: "info" }, C)), I = (x = "", C = {}) => m(a({ message: x, severity: "warning" }, C)), g = (x = "", C = {}) => m(a({ message: x, severity: "error" }, C)), D = (x) => {
1287
+ const C = u.current.findIndex((M) => M.key === x);
1245
1288
  if (C !== -1)
1246
- return C === 0 ? (c({ open: !1 }), d.current[0]) : d.current.splice(C, 1);
1247
- }, R = (x, C) => {
1248
- n(x, C) && c({ open: !1 });
1249
- }, N = () => {
1250
- }, L = () => {
1251
- d.current.shift(), d.current.length > 0 && c({ open: !0 });
1252
- }, $ = (P = d.current[0]) != null ? P : r({}, ze), u = {};
1253
- "autoHideDuration" in $ && (u.autoHideDuration = $.autoHideDuration);
1254
- const f = r(r({}, _n), a), T = r(r({
1255
- open: p,
1256
- setOpen: b,
1289
+ return C === 0 ? (l({ open: !1 }), u.current[0]) : u.current.splice(C, 1);
1290
+ }, H = (x, C) => {
1291
+ n(x, C) && l({ open: !1 });
1292
+ }, P = () => {
1293
+ }, _ = () => {
1294
+ u.current.shift(), u.current.length > 0 && l({ open: !0 });
1295
+ }, T = (N = u.current[0]) != null ? N : a({}, ze), h = {};
1296
+ "autoHideDuration" in T && (h.autoHideDuration = T.autoHideDuration);
1297
+ const f = a(a({}, Gn), r), O = a(a({
1298
+ open: d,
1299
+ setOpen: A,
1257
1300
  enqueueNotification: m,
1258
- enqueueSuccessNotification: A,
1259
- enqueueInfoNotification: D,
1260
- enqueueWarningNotification: O,
1301
+ enqueueSuccessNotification: S,
1302
+ enqueueInfoNotification: k,
1303
+ enqueueWarningNotification: I,
1261
1304
  enqueueErrorNotification: g,
1262
- removeNotification: k
1305
+ removeNotification: D
1263
1306
  }, e), t);
1264
- return /* @__PURE__ */ h(mt.Provider, { value: T, children: [
1307
+ return /* @__PURE__ */ p(wt.Provider, { value: O, children: [
1265
1308
  i,
1266
1309
  /* @__PURE__ */ o(
1267
1310
  zt,
1268
- S(r(r({}, f), u), {
1269
- open: p,
1270
- onClose: R,
1311
+ b(a(a({}, f), h), {
1312
+ open: d,
1313
+ onClose: H,
1271
1314
  TransitionProps: {
1272
- onExited: L,
1273
- onExit: N
1315
+ onExited: _,
1316
+ onExit: P
1274
1317
  },
1275
- sx: { zIndex: Rn },
1276
- children: /* @__PURE__ */ h("div", { children: [
1318
+ sx: { zIndex: qn },
1319
+ children: /* @__PURE__ */ p("div", { children: [
1277
1320
  /* @__PURE__ */ o(
1278
- Gt,
1321
+ Ut,
1279
1322
  {
1280
- onClose: (x) => R(x, "closeAlert"),
1281
- severity: $.severity,
1323
+ onClose: (x) => H(x, "closeAlert"),
1324
+ severity: T.severity,
1282
1325
  variant: "filled",
1283
- icon: $.progressIndicator === "circular" ? /* @__PURE__ */ o(we, { size: "1em" }) : void 0,
1284
- style: $.progressIndicator === "linear" ? zn : void 0,
1285
- children: $.message
1326
+ icon: T.progressIndicator === "circular" ? /* @__PURE__ */ o(Ae, { size: "1em" }) : void 0,
1327
+ style: T.progressIndicator === "linear" ? Qn : void 0,
1328
+ children: T.message
1286
1329
  }
1287
1330
  ),
1288
- $.progressIndicator === "linear" && /* @__PURE__ */ o(Vt, { color: "primary" })
1331
+ T.progressIndicator === "linear" && /* @__PURE__ */ o(Gt, { color: "primary" })
1289
1332
  ] })
1290
1333
  })
1291
1334
  )
1292
1335
  ] });
1293
1336
  }
1294
- function qn() {
1295
- const e = Qe(mt);
1337
+ function Zn() {
1338
+ const e = Qe(wt);
1296
1339
  if (e === null)
1297
- throw new Ae("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1340
+ throw new be("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
1298
1341
  return e;
1299
1342
  }
1300
- const So = j(
1301
- (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(Un, S(r({}, e), { overrideState: t, overrideActions: n, children: i }))
1302
- ), Xn = nn(), Do = ({
1343
+ const Eo = Y(
1344
+ (e = { autoHideDuration: 1 }, t = {}, n = {}) => ({ children: i }) => /* @__PURE__ */ o(Jn, b(a({}, e), { overrideState: t, overrideActions: n, children: i }))
1345
+ ), jn = rn(), Po = ({
1303
1346
  children: e,
1304
1347
  store: t
1305
- }) => /* @__PURE__ */ o(nt, { store: t != null ? t : Xn, children: e }), Ct = "domainCode";
1348
+ }) => /* @__PURE__ */ o(at, { store: t != null ? t : jn, children: e }), At = "domainCode";
1306
1349
  var qe;
1307
- const Ue = B(
1308
- JSON.parse((qe = localStorage.getItem(Ct)) != null ? qe : '{"domainCode": ""}').domainCode
1309
- ), vt = B(
1310
- (e) => e(Ue),
1350
+ const Ve = L(
1351
+ JSON.parse((qe = localStorage.getItem(At)) != null ? qe : '{"domainCode": ""}').domainCode
1352
+ ), St = L(
1353
+ (e) => e(Ve),
1311
1354
  (e, t, n) => {
1312
- t(Ue, n), localStorage.setItem(Ct, JSON.stringify({ domainCode: n }));
1355
+ t(Ve, n), localStorage.setItem(At, JSON.stringify({ domainCode: n }));
1313
1356
  }
1314
- ), Qn = {
1357
+ ), eo = {
1315
1358
  act: "ACT",
1316
1359
  nsw: "NSW",
1317
1360
  nt: "NT",
@@ -1323,64 +1366,64 @@ const Ue = B(
1323
1366
  ag: "AG",
1324
1367
  fedmps: "Fedmps",
1325
1368
  "": ""
1326
- }, Kn = (e) => {
1369
+ }, to = (e) => {
1327
1370
  var t;
1328
- return e === null ? "N/A" : (t = Qn[e]) != null ? t : "";
1329
- }, ko = ({
1371
+ return e === null ? "N/A" : (t = eo[e]) != null ? t : "";
1372
+ }, No = ({
1330
1373
  isLoading: e,
1331
1374
  isOpen: t,
1332
1375
  onClose: n,
1333
1376
  domainOptions: i,
1334
- applicationName: a,
1377
+ applicationName: r,
1335
1378
  handleLogout: s
1336
1379
  }) => {
1337
- const [l, p] = U(vt), [c, d] = E(l), { enqueueSuccessNotification: v } = qn(), w = i.length === 0, b = !!l && !i.includes(l) && !i.includes(c), m = !l || w || b, A = () => z(void 0, null, function* () {
1338
- c ? (p(c), v(`Set domain to ${c}`), n()) : p("");
1339
- }), D = () => z(void 0, null, function* () {
1340
- l && !w && !b ? (d(l), n()) : m && s();
1380
+ const [c, d] = V(St), [l, u] = F(c), { enqueueSuccessNotification: v } = Zn(), w = i.length === 0, A = !!c && !i.includes(c) && !i.includes(l), m = !c || w || A, S = () => z(void 0, null, function* () {
1381
+ l ? (d(l), v(`Set domain to ${l}`), n()) : d("");
1382
+ }), k = () => z(void 0, null, function* () {
1383
+ c && !w && !A ? (u(c), n()) : m && s();
1341
1384
  });
1342
- let O;
1343
- return w ? O = "Unable to retrieve your active organisations. Try logging in again." : b && (O = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ h(
1344
- hn,
1385
+ let I;
1386
+ return w ? I = "Unable to retrieve your active organisations. Try logging in again." : A && (I = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ p(
1387
+ fn,
1345
1388
  {
1346
1389
  isOpen: t,
1347
1390
  dialogTitle: "Select an organisation",
1348
1391
  primaryButton: {
1349
1392
  text: "Confirm",
1350
- onClick: A,
1351
- disabled: !c || w || b,
1393
+ onClick: S,
1394
+ disabled: !l || w || A,
1352
1395
  buttonColor: "primary"
1353
1396
  },
1354
1397
  secondaryButton: {
1355
1398
  text: m ? "Logout" : "Cancel",
1356
- onClick: D
1399
+ onClick: k
1357
1400
  },
1358
1401
  onClose: m ? () => {
1359
1402
  } : n,
1360
1403
  children: [
1361
- /* @__PURE__ */ h(F, { marginBottom: 2, children: [
1404
+ /* @__PURE__ */ p(E, { marginBottom: 2, children: [
1362
1405
  "Select the default organisation that you want to use with the ",
1363
- a,
1406
+ r,
1364
1407
  "."
1365
1408
  ] }),
1366
1409
  /* @__PURE__ */ o(
1367
- ve,
1410
+ xe,
1368
1411
  {
1369
1412
  loading: e,
1370
1413
  multiple: !1,
1371
1414
  disableClearable: !1,
1372
- value: c !== "" ? c : null,
1373
- onChange: (g, k) => d(k != null ? k : ""),
1374
- getOptionLabel: Kn,
1415
+ value: l !== "" ? l : null,
1416
+ onChange: (g, D) => u(D != null ? D : ""),
1417
+ getOptionLabel: to,
1375
1418
  options: [...i],
1376
1419
  renderInput: (g) => /* @__PURE__ */ o(
1377
- xe,
1378
- S(r({}, g), {
1420
+ we,
1421
+ b(a({}, g), {
1379
1422
  variant: "filled",
1380
1423
  label: "Select organisation",
1381
- InputProps: S(r({}, g.InputProps), {
1382
- endAdornment: /* @__PURE__ */ h(_, { children: [
1383
- e ? /* @__PURE__ */ o(we, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1424
+ InputProps: b(a({}, g.InputProps), {
1425
+ endAdornment: /* @__PURE__ */ p(B, { children: [
1426
+ e ? /* @__PURE__ */ o(Ae, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
1384
1427
  g.InputProps.endAdornment
1385
1428
  ] })
1386
1429
  })
@@ -1388,11 +1431,11 @@ const Ue = B(
1388
1431
  )
1389
1432
  }
1390
1433
  ),
1391
- O && /* @__PURE__ */ o(Ut, { error: !0, children: O })
1434
+ I && /* @__PURE__ */ o(Vt, { error: !0, children: I })
1392
1435
  ]
1393
1436
  }
1394
1437
  );
1395
- }, Io = Je({
1438
+ }, Bo = tt({
1396
1439
  palette: {
1397
1440
  primary: {
1398
1441
  dark: "#00A651",
@@ -1443,7 +1486,7 @@ const Ue = B(
1443
1486
  navBar: {
1444
1487
  backgroundColor: "#E8E8E8"
1445
1488
  }
1446
- }), Oo = Je({
1489
+ }), Lo = tt({
1447
1490
  palette: {
1448
1491
  primary: {
1449
1492
  main: "#007236",
@@ -1534,73 +1577,74 @@ const Ue = B(
1534
1577
  navBar: {
1535
1578
  backgroundColor: "#E8E8E8"
1536
1579
  }
1537
- }), jn = {
1538
- domainCode: vt,
1580
+ }), no = {
1581
+ domainCode: St,
1539
1582
  navBarOpen: K,
1540
- navBarWidthOpen: pt,
1541
- navBarWidthClosed: ut,
1542
- titleText: me,
1543
- topBarHeight: ht,
1544
- navBarTop: gt
1545
- }, $o = j(() => ({ children: e }) => /* @__PURE__ */ o(nt, { children: e })), Jn = ({
1583
+ navBarWidthOpen: ft,
1584
+ navBarWidthClosed: mt,
1585
+ titleText: Ce,
1586
+ topBarHeight: Ct,
1587
+ navBarTop: vt
1588
+ }, _o = Y(() => ({ children: e }) => /* @__PURE__ */ o(at, { children: e })), oo = ({
1546
1589
  initialValues: e,
1547
1590
  children: t
1548
- }) => (ot(e), /* @__PURE__ */ o(_, { children: t })), yo = j(
1591
+ }) => (st(e), /* @__PURE__ */ o(B, { children: t })), Mo = Y(
1549
1592
  (e) => ({ children: t }) => /* @__PURE__ */ o(
1550
- Jn,
1593
+ oo,
1551
1594
  {
1552
1595
  initialValues: Object.entries(e).map(
1553
1596
  ([n, i]) => [
1554
- jn[n],
1597
+ no[n],
1555
1598
  i
1556
1599
  ]
1557
1600
  ),
1558
1601
  children: t
1559
1602
  }
1560
1603
  )
1561
- ), To = j(() => ({ children: e }) => {
1604
+ ), Ro = Y(() => ({ children: e }) => {
1562
1605
  const t = new en();
1563
1606
  return /* @__PURE__ */ o(tn, { client: t, children: e });
1564
1607
  });
1565
1608
  export {
1566
- hn as AgDialog,
1567
- Ao as AppLayout,
1568
- Do as AtomProvider,
1569
- mt as Context,
1570
- Ae as ContextError,
1571
- ko as DomainCodeDialog,
1572
- go as ExampleComponent,
1573
- xo as FetchAutocomplete,
1574
- Jn as HydrateAtoms,
1575
- rt as NAVBAR_WIDTH_CLOSED,
1576
- it as NAVBAR_WIDTH_OPENED,
1577
- vo as NavBar,
1578
- mo as NavBarDarkStyledList,
1579
- Co as NavBarLightStyledList,
1580
- dn as NavBarProvider,
1581
- bo as PageLayout,
1582
- Un as SaladBarProvider,
1583
- wo as SingleAutocomplete,
1584
- Xn as atomStore,
1585
- un as buildNavBarState,
1586
- vt as domainCodeAtom,
1587
- Io as fed21Theme,
1588
- Oo as internalAgSystemsTheme,
1609
+ fn as AgDialog,
1610
+ Fo as AppLayout,
1611
+ Po as AtomProvider,
1612
+ yo as AuthGuard,
1613
+ wt as Context,
1614
+ be as ContextError,
1615
+ No as DomainCodeDialog,
1616
+ So as ExampleComponent,
1617
+ Io as FetchAutocomplete,
1618
+ oo as HydrateAtoms,
1619
+ ct as NAVBAR_WIDTH_CLOSED,
1620
+ lt as NAVBAR_WIDTH_OPENED,
1621
+ $o as NavBar,
1622
+ ko as NavBarDarkStyledList,
1623
+ Do as NavBarLightStyledList,
1624
+ pn as NavBarProvider,
1625
+ Oo as PageLayout,
1626
+ Jn as SaladBarProvider,
1627
+ To as SingleAutocomplete,
1628
+ jn as atomStore,
1629
+ gn as buildNavBarState,
1630
+ St as domainCodeAtom,
1631
+ Bo as fed21Theme,
1632
+ Lo as internalAgSystemsTheme,
1589
1633
  q as navBarClasses,
1590
1634
  K as navBarOpenAtom,
1591
- gt as navBarTopAtom,
1592
- ut as navBarWidthClosedAtom,
1593
- pt as navBarWidthOpenAtom,
1594
- me as titleTextAtom,
1595
- ht as topBarHeightAtom,
1596
- kn as topBarMiddleAtom,
1597
- lt as useAutocompleteOptions,
1598
- pn as useNavBar,
1599
- qn as useSaladBar,
1600
- $o as withAtomProvider,
1601
- fo as withNavBarProvider,
1602
- yo as withOverrideDefaults,
1603
- To as withQueryClient,
1604
- So as withSaladBarProvider
1635
+ vt as navBarTopAtom,
1636
+ mt as navBarWidthClosedAtom,
1637
+ ft as navBarWidthOpenAtom,
1638
+ Ce as titleTextAtom,
1639
+ Ct as topBarHeightAtom,
1640
+ Fn as topBarMiddleAtom,
1641
+ pt as useAutocompleteOptions,
1642
+ hn as useNavBar,
1643
+ Zn as useSaladBar,
1644
+ _o as withAtomProvider,
1645
+ bo as withNavBarProvider,
1646
+ Mo as withOverrideDefaults,
1647
+ Ro as withQueryClient,
1648
+ Eo as withSaladBarProvider
1605
1649
  };
1606
1650
  //# sourceMappingURL=index.js.map