@australiangreens/ag-internal-components 0.0.80 → 0.0.82

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