@australiangreens/ag-internal-components 0.0.76 → 0.0.77

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