@australiangreens/ag-internal-components 0.0.69 → 0.0.71

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