@australiangreens/ag-internal-components 0.3.6 → 0.3.8

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,147 +1,147 @@
1
- var et = Object.defineProperty, tt = Object.defineProperties;
2
- var ot = Object.getOwnPropertyDescriptors;
3
- var X = Object.getOwnPropertySymbols;
4
- var ce = Object.prototype.hasOwnProperty, de = Object.prototype.propertyIsEnumerable;
5
- var ee = (e, t, o) => t in e ? et(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, u = (e, t) => {
1
+ var ot = Object.defineProperty, nt = Object.defineProperties;
2
+ var it = Object.getOwnPropertyDescriptors;
3
+ var J = Object.getOwnPropertySymbols;
4
+ var pe = Object.prototype.hasOwnProperty, he = Object.prototype.propertyIsEnumerable;
5
+ var ie = (e, t, o) => t in e ? ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, d = (e, t) => {
6
6
  for (var o in t || (t = {}))
7
- ce.call(t, o) && ee(e, o, t[o]);
8
- if (X)
9
- for (var o of X(t))
10
- de.call(t, o) && ee(e, o, t[o]);
7
+ pe.call(t, o) && ie(e, o, t[o]);
8
+ if (J)
9
+ for (var o of J(t))
10
+ he.call(t, o) && ie(e, o, t[o]);
11
11
  return e;
12
- }, F = (e, t) => tt(e, ot(t));
13
- var ue = (e, t) => {
12
+ }, b = (e, t) => nt(e, it(t));
13
+ var fe = (e, t) => {
14
14
  var o = {};
15
- for (var n in e)
16
- ce.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
17
- if (e != null && X)
18
- for (var n of X(e))
19
- t.indexOf(n) < 0 && de.call(e, n) && (o[n] = e[n]);
15
+ for (var i in e)
16
+ pe.call(e, i) && t.indexOf(i) < 0 && (o[i] = e[i]);
17
+ if (e != null && J)
18
+ for (var i of J(e))
19
+ t.indexOf(i) < 0 && he.call(e, i) && (o[i] = e[i]);
20
20
  return o;
21
21
  };
22
- var pe = (e, t, o) => ee(e, typeof t != "symbol" ? t + "" : t, o);
23
- var P = (e, t, o) => new Promise((n, s) => {
24
- var a = (c) => {
22
+ var me = (e, t, o) => ie(e, typeof t != "symbol" ? t + "" : t, o);
23
+ var N = (e, t, o) => new Promise((i, s) => {
24
+ var a = (l) => {
25
25
  try {
26
- r(o.next(c));
27
- } catch (l) {
28
- s(l);
26
+ r(o.next(l));
27
+ } catch (c) {
28
+ s(c);
29
29
  }
30
- }, p = (c) => {
30
+ }, u = (l) => {
31
31
  try {
32
- r(o.throw(c));
33
- } catch (l) {
34
- s(l);
32
+ r(o.throw(l));
33
+ } catch (c) {
34
+ s(c);
35
35
  }
36
- }, r = (c) => c.done ? n(c.value) : Promise.resolve(c.value).then(a, p);
36
+ }, r = (l) => l.done ? i(l.value) : Promise.resolve(l.value).then(a, u);
37
37
  r((o = o.apply(e, t)).next());
38
38
  });
39
- import { jsxs as m, Fragment as O, jsx as i } from "react/jsx-runtime";
40
- import { useState as G, createElement as ne, useEffect as he, useMemo as nt, createContext as it, useRef as te, useCallback as fe, useContext as rt } from "react";
41
- import { Typography as _, Button as z, Paper as Me, Dialog as Pe, LinearProgress as Ne, DialogTitle as $e, DialogContent as Te, DialogActions as Le, Autocomplete as ie, TextField as re, CircularProgress as se, Box as M, Chip as st, Tooltip as at, Stack as lt, Snackbar as ct, Alert as dt, FormHelperText as ut, useTheme as Z, useMediaQuery as pt, Drawer as ht, Collapse as ft, Avatar as me, Fade as mt, Skeleton as ge, Toolbar as gt, Divider as xe, Container as xt, IconButton as At } from "@mui/material";
42
- import { Cancel as Ct, ArrowDropDown as St, ViewHeadline as vt } from "@mui/icons-material";
43
- import wt from "autosuggest-highlight/match";
44
- import kt from "autosuggest-highlight/parse";
45
- import { useQuery as Oe } from "@tanstack/react-query";
46
- import { useAuth0 as ae } from "@auth0/auth0-react";
47
- import { Buffer as Dt } from "buffer";
48
- import yt from "@mui/material/Skeleton";
49
- import { atom as T, useAtom as W, useSetAtom as Re, useAtomValue as Ae } from "jotai";
50
- import { createHelper as bt } from "souvlaki";
51
- import Ft from "@mui/material/CssBaseline";
52
- import Ce from "@mui/material/Box";
53
- import { useHydrateAtoms as Et } from "jotai/utils";
54
- import { styled as Ue, createTheme as Be, alpha as oe } from "@mui/material/styles";
55
- import Se from "react-avatar";
56
- function _o({ text: e }) {
39
+ import { jsxs as m, Fragment as M, jsx as n } from "react/jsx-runtime";
40
+ import { useState as G, createElement as ae, useEffect as ge, useMemo as rt, createContext as st, useRef as re, useCallback as xe, useContext as at } from "react";
41
+ import { Typography as I, Button as q, Paper as $e, Dialog as Me, LinearProgress as Le, DialogTitle as Oe, DialogContent as Re, DialogActions as Ue, Autocomplete as le, TextField as ce, CircularProgress as te, Box as P, Chip as lt, Tooltip as ct, Stack as dt, Snackbar as ut, Alert as pt, FormHelperText as ht, useTheme as oe, useMediaQuery as ft, Drawer as mt, Collapse as gt, Avatar as Ae, Fade as xt, Skeleton as Ce, Toolbar as At, Divider as Se, Container as Ct, IconButton as St } from "@mui/material";
42
+ import { Cancel as wt, ArrowDropDown as vt, ViewHeadline as Dt } from "@mui/icons-material";
43
+ import kt from "autosuggest-highlight/match";
44
+ import yt from "autosuggest-highlight/parse";
45
+ import { useQuery as Be } from "@tanstack/react-query";
46
+ import { useAuth0 as de } from "@auth0/auth0-react";
47
+ import { Buffer as bt } from "buffer";
48
+ import Ft from "@mui/material/Skeleton";
49
+ import { atom as L, useAtom as W, useSetAtom as He, useAtomValue as we } from "jotai";
50
+ import { createHelper as Et } from "souvlaki";
51
+ import _t from "@mui/material/CssBaseline";
52
+ import ve from "@mui/material/Box";
53
+ import { useHydrateAtoms as It } from "jotai/utils";
54
+ import { styled as We, createTheme as ze, alpha as se } from "@mui/material/styles";
55
+ import De from "react-avatar";
56
+ function To({ text: e }) {
57
57
  const [t, o] = G(0);
58
- return /* @__PURE__ */ m(O, { children: [
59
- /* @__PURE__ */ i(_, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
60
- /* @__PURE__ */ i(_, { variant: "caption", display: "block", children: /* @__PURE__ */ i("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
61
- /* @__PURE__ */ i(
62
- z,
58
+ return /* @__PURE__ */ m(M, { children: [
59
+ /* @__PURE__ */ n(I, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
60
+ /* @__PURE__ */ n(I, { variant: "caption", display: "block", children: /* @__PURE__ */ n("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
61
+ /* @__PURE__ */ n(
62
+ q,
63
63
  {
64
64
  variant: "outlined",
65
- onClick: () => o((n) => n + 1),
65
+ onClick: () => o((i) => i + 1),
66
66
  "aria-label": "Increment",
67
67
  children: "Hello I am a button"
68
68
  }
69
69
  ),
70
70
  /* @__PURE__ */ m("p", { children: [
71
71
  "This is some text: ",
72
- /* @__PURE__ */ i("span", { children: e })
72
+ /* @__PURE__ */ n("span", { children: e })
73
73
  ] }),
74
- /* @__PURE__ */ m(Me, { children: [
74
+ /* @__PURE__ */ m($e, { children: [
75
75
  "This number will incremember when button pressed: ",
76
76
  t
77
77
  ] })
78
78
  ] });
79
79
  }
80
- const He = ({
80
+ const qe = ({
81
81
  isOpen: e,
82
82
  dialogTitle: t,
83
83
  children: o,
84
- maxWidth: n,
84
+ maxWidth: i,
85
85
  primaryButton: s,
86
86
  secondaryButton: a,
87
- additionalButtons: p,
87
+ additionalButtons: u,
88
88
  onClose: r,
89
- sx: c,
90
- "data-testid": l,
89
+ sx: l,
90
+ "data-testid": c,
91
91
  disableCloseOnBackdropOrEscape: x = !1,
92
- isLoading: C = !1
92
+ isLoading: A = !1
93
93
  }) => {
94
- var w, D;
95
- const [v, g] = G(!1);
94
+ var S, y;
95
+ const [D, g] = G(!1);
96
96
  return /* @__PURE__ */ m(
97
- Pe,
97
+ Me,
98
98
  {
99
99
  open: e,
100
- onClose: (f, k) => P(null, null, function* () {
101
- x && (k === "backdropClick" || k === "escapeKeyDown") || v || (a != null && a.onClick ? yield a.onClick() : r());
100
+ onClose: (h, k) => N(null, null, function* () {
101
+ x && (k === "backdropClick" || k === "escapeKeyDown") || D || (a != null && a.onClick ? yield a.onClick() : r());
102
102
  }),
103
103
  fullWidth: !0,
104
- maxWidth: n != null ? n : "xs",
105
- "data-testid": l,
106
- sx: c,
104
+ maxWidth: i != null ? i : "xs",
105
+ "data-testid": c,
106
+ sx: l,
107
107
  children: [
108
- C && /* @__PURE__ */ i(Ne, { sx: { height: "4px", marginBottom: "-4px" } }),
109
- /* @__PURE__ */ i($e, { children: t }),
110
- /* @__PURE__ */ i(Te, { sx: { "& > :last-child": { marginBottom: 0 } }, children: o }),
111
- /* @__PURE__ */ m(Le, { children: [
112
- /* @__PURE__ */ i(
113
- z,
108
+ A && /* @__PURE__ */ n(Le, { sx: { height: "4px", marginBottom: "-4px" } }),
109
+ /* @__PURE__ */ n(Oe, { children: t }),
110
+ /* @__PURE__ */ n(Re, { sx: { "& > :last-child": { marginBottom: 0 } }, children: o }),
111
+ /* @__PURE__ */ m(Ue, { children: [
112
+ /* @__PURE__ */ n(
113
+ q,
114
114
  {
115
- onClick: (w = a == null ? void 0 : a.onClick) != null ? w : r,
115
+ onClick: (S = a == null ? void 0 : a.onClick) != null ? S : r,
116
116
  "data-testid": a == null ? void 0 : a.testId,
117
- disabled: (a == null ? void 0 : a.disabled) || v,
117
+ disabled: (a == null ? void 0 : a.disabled) || D,
118
118
  color: a == null ? void 0 : a.buttonColor,
119
- children: (D = a == null ? void 0 : a.text) != null ? D : "Cancel"
119
+ children: (y = a == null ? void 0 : a.text) != null ? y : "Cancel"
120
120
  }
121
121
  ),
122
- p && p.map((f, k) => {
123
- var y;
124
- return /* @__PURE__ */ i(
125
- z,
122
+ u && u.map((h, k) => {
123
+ var F;
124
+ return /* @__PURE__ */ n(
125
+ q,
126
126
  {
127
- onClick: f == null ? void 0 : f.onClick,
128
- "data-testid": f == null ? void 0 : f.testId,
129
- disabled: (f == null ? void 0 : f.disabled) || v,
130
- color: f == null ? void 0 : f.buttonColor,
131
- children: (y = f.text) != null ? y : `Button ${k}`
127
+ onClick: h == null ? void 0 : h.onClick,
128
+ "data-testid": h == null ? void 0 : h.testId,
129
+ disabled: (h == null ? void 0 : h.disabled) || D,
130
+ color: h == null ? void 0 : h.buttonColor,
131
+ children: (F = h.text) != null ? F : `Button ${k}`
132
132
  },
133
133
  k
134
134
  );
135
135
  }),
136
- s && /* @__PURE__ */ i(
137
- z,
136
+ s && /* @__PURE__ */ n(
137
+ q,
138
138
  {
139
- onClick: () => P(null, null, function* () {
140
- var f;
141
- g(!0), yield (f = s.onClick) == null ? void 0 : f.call(s), g(!1);
139
+ onClick: () => N(null, null, function* () {
140
+ var h;
141
+ g(!0), yield (h = s.onClick) == null ? void 0 : h.call(s), g(!1);
142
142
  }),
143
143
  "data-testid": s.testId,
144
- disabled: s.disabled || v,
144
+ disabled: s.disabled || D,
145
145
  color: s == null ? void 0 : s.buttonColor,
146
146
  children: s.text
147
147
  }
@@ -150,7 +150,7 @@ const He = ({
150
150
  ]
151
151
  }
152
152
  );
153
- }, It = {
153
+ }, Pt = {
154
154
  popper: {
155
155
  modifiers: [
156
156
  {
@@ -161,322 +161,321 @@ const He = ({
161
161
  }
162
162
  ]
163
163
  }
164
- }, We = {
164
+ }, Ge = {
165
165
  right: 2
166
- }, qe = ({
166
+ }, Ve = ({
167
167
  minLength: e,
168
168
  preLoadedOptions: t,
169
169
  lookup: o,
170
- label: n,
170
+ label: i,
171
171
  inputValue: s
172
- }) => Oe({
172
+ }) => Be({
173
173
  queryFn: () => e && s.length < e ? t != null ? t : [] : t ? t.filter(
174
174
  (a) => a.label.toLowerCase().includes(s.toLowerCase())
175
175
  ) : o(s),
176
- queryKey: ["autocomplete", n, s]
176
+ queryKey: ["autocomplete", i, s]
177
177
  });
178
- function Mo({
179
- lookup: e = () => P(null, null, function* () {
178
+ function No({
179
+ lookup: e = () => N(null, null, function* () {
180
180
  }),
181
181
  enableHighlighting: t = !0,
182
182
  onChange: o,
183
- onInputChange: n,
183
+ onInputChange: i,
184
184
  minLength: s = 0,
185
185
  label: a,
186
- value: p,
186
+ value: u,
187
187
  "data-testid": r,
188
- sx: c,
189
- boxSx: l,
188
+ sx: l,
189
+ boxSx: c,
190
190
  textFieldColor: x,
191
- textFieldVariant: C = "filled",
192
- loadingText: v = "Loading...",
193
- noOptionsText: g = "No options",
194
- popupIcon: w = /* @__PURE__ */ i(St, {}),
195
- error: D = !1,
196
- helperText: f = "",
197
- preLoadedOptions: k = void 0,
198
- disablePortal: y = !1,
199
- disableIconFlip: I = !1,
200
- chipToolTipSlotProps: V = It,
201
- isTemplatePlaceholder: N = !1,
202
- placeholderText: E = void 0,
203
- onRightClick: U = () => {
191
+ textFieldVariant: A = "filled",
192
+ textFieldFocused: D,
193
+ textFieldSx: g,
194
+ loadingText: S = "Loading...",
195
+ noOptionsText: y = "No options",
196
+ popupIcon: h = /* @__PURE__ */ n(vt, {}),
197
+ error: k = !1,
198
+ helperText: F = "",
199
+ preLoadedOptions: T = void 0,
200
+ disablePortal: V = !1,
201
+ disableIconFlip: K = !1,
202
+ chipToolTipSlotProps: _ = Pt,
203
+ placeholderText: O = void 0,
204
+ onRightClick: X = () => {
204
205
  },
205
- disableDefaultRightClickBehaviour: L = !1
206
+ disableDefaultRightClickBehaviour: U = !1,
207
+ readOnly: R,
208
+ hideInputEndAdornment: v
206
209
  }) {
207
- const [B, R] = G(""), S = (h, A) => {
208
- const $ = p.filter((j) => j.id !== A);
209
- o($, "delete", h);
210
- }, { data: d, isLoading: b } = qe({
211
- inputValue: B,
210
+ const [C, B] = G(""), Q = (p, w) => {
211
+ const $ = u.filter((ne) => ne.id !== w);
212
+ o($, "delete", p);
213
+ }, { data: f, isLoading: E } = Ve({
214
+ inputValue: C,
212
215
  label: a,
213
216
  lookup: e,
214
217
  minLength: s,
215
- preLoadedOptions: k
216
- }), H = B.length >= s, Je = N ? {
217
- sx: {
218
- "& .MuiFilledInput-root.Mui-focused": {
219
- backgroundColor: "hsla(201, 98%, 41%, 0.08)"
220
- },
221
- "& .MuiOutlinedInput-root.Mui-focused": {
222
- backgroundColor: "hsla(201, 98%, 41%, 0.08)"
223
- }
224
- },
225
- focused: !0
226
- } : {};
218
+ preLoadedOptions: T
219
+ }), H = C.length >= s;
227
220
  return /* @__PURE__ */ m("div", { "data-testid": r, children: [
228
- /* @__PURE__ */ i(
229
- ie,
221
+ /* @__PURE__ */ n(
222
+ le,
230
223
  {
231
- sx: u(u({}, c), I ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
224
+ sx: d(d({}, l), K ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
232
225
  "data-testid": r ? `${r}:Autocomplete` : void 0,
233
- disablePortal: y,
226
+ disablePortal: V,
234
227
  multiple: !0,
235
- getOptionLabel: (h) => typeof h == "string" ? h : h.label,
236
- loading: H ? b : !1,
237
- options: [...p, ...d != null ? d : []],
228
+ getOptionLabel: (p) => typeof p == "string" ? p : p.label,
229
+ loading: H ? E : !1,
230
+ options: [...u, ...f != null ? f : []],
238
231
  filterSelectedOptions: !0,
239
232
  includeInputInList: !0,
240
- value: p,
241
- onChange: (h, A, $) => {
242
- o(A, $, h);
233
+ value: u,
234
+ onChange: (p, w, $) => {
235
+ o(w, $, p);
243
236
  },
244
- onInputChange: (h, A, $) => {
245
- R(A), n && n(p, $, h);
237
+ onInputChange: (p, w, $) => {
238
+ B(w), i && i(u, $, p);
246
239
  },
247
- noOptionsText: H ? g : "Start typing to search",
248
- loadingText: v,
249
- popupIcon: w,
250
- renderInput: (h) => /* @__PURE__ */ i(
251
- re,
252
- u(F(u({}, h), {
240
+ noOptionsText: H ? y : "Start typing to search",
241
+ loadingText: S,
242
+ popupIcon: h,
243
+ renderInput: (p) => /* @__PURE__ */ n(
244
+ ce,
245
+ b(d({}, p), {
253
246
  label: a,
254
247
  fullWidth: !0,
255
- variant: C,
256
- error: D,
257
- helperText: f,
248
+ variant: A,
249
+ error: k,
250
+ helperText: F,
258
251
  slotProps: {
259
- input: F(u({}, h.InputProps), {
260
- endAdornment: N ? void 0 : /* @__PURE__ */ m(O, { children: [
261
- b ? /* @__PURE__ */ i(se, { color: "inherit", size: 20 }) : null,
262
- h.InputProps.endAdornment
252
+ input: b(d({}, p.InputProps), {
253
+ endAdornment: v ? void 0 : /* @__PURE__ */ m(M, { children: [
254
+ E ? /* @__PURE__ */ n(te, { color: "inherit", size: 20 }) : null,
255
+ p.InputProps.endAdornment
263
256
  ] })
264
257
  })
265
258
  },
266
259
  "data-testid": r ? `${r}:Autocomplete:TextField` : void 0,
267
- onKeyDown: (A) => {
268
- (A.key === "Backspace" || A.key === "Delete") && A.stopPropagation();
260
+ onKeyDown: (w) => {
261
+ (w.key === "Backspace" || w.key === "Delete") && w.stopPropagation();
269
262
  },
270
263
  color: x,
271
- placeholder: E != null ? E : N ? "Placeholder field" : void 0
272
- }), Je)
264
+ placeholder: O,
265
+ sx: g,
266
+ focused: D
267
+ })
273
268
  ),
274
269
  renderValue: () => null,
275
- isOptionEqualToValue: (h, A) => h.id === A.id,
276
- renderOption: (h, A, $) => {
270
+ isOptionEqualToValue: (p, w) => p.id === w.id,
271
+ renderOption: (p, w, $) => {
277
272
  if (t) {
278
- const j = wt(A.label, $.inputValue, {
273
+ const ne = kt(w.label, $.inputValue, {
279
274
  insideWords: !0,
280
275
  findAllOccurrences: !0
281
- }), Ze = kt(A.label, j);
282
- return /* @__PURE__ */ ne(
276
+ }), et = yt(w.label, ne);
277
+ return /* @__PURE__ */ ae(
283
278
  "li",
284
- F(u({}, h), {
285
- key: A.id,
286
- "data-testid": r ? `${r}:Autocomplete:option(${A.id.toString()})` : void 0
279
+ b(d({}, p), {
280
+ key: w.id,
281
+ "data-testid": r ? `${r}:Autocomplete:option(${w.id.toString()})` : void 0
287
282
  }),
288
- /* @__PURE__ */ i("div", { children: Ze.map((le, je) => /* @__PURE__ */ i(
283
+ /* @__PURE__ */ n("div", { children: et.map((ue, tt) => /* @__PURE__ */ n(
289
284
  "span",
290
285
  {
291
286
  style: {
292
- fontWeight: le.highlight ? 700 : 400
287
+ fontWeight: ue.highlight ? 700 : 400
293
288
  },
294
- children: le.text
289
+ children: ue.text
295
290
  },
296
- je
291
+ tt
297
292
  )) })
298
293
  );
299
294
  } else
300
- return /* @__PURE__ */ ne(
295
+ return /* @__PURE__ */ ae(
301
296
  "li",
302
- F(u({}, h), {
303
- key: A.id,
304
- "data-testid": r ? `${r}:option(${A.id.toString()})` : void 0
297
+ b(d({}, p), {
298
+ key: w.id,
299
+ "data-testid": r ? `${r}:option(${w.id.toString()})` : void 0
305
300
  }),
306
- A.label
301
+ w.label
307
302
  );
308
303
  },
309
- onMouseDownCapture: (h) => {
310
- h.button === We.right && L && (h.preventDefault(), h.stopPropagation());
304
+ onMouseDownCapture: (p) => {
305
+ p.button === Ge.right && U && (p.preventDefault(), p.stopPropagation());
311
306
  },
312
- onContextMenuCapture: (h) => {
313
- L && (h.preventDefault(), h.stopPropagation()), U(h);
307
+ onContextMenuCapture: (p) => {
308
+ U && (p.preventDefault(), p.stopPropagation()), X(p);
314
309
  },
315
- readOnly: N
310
+ readOnly: R
316
311
  }
317
312
  ),
318
- p.length > 0 && /* @__PURE__ */ i(M, { sx: l, children: p.map((h) => {
319
- var A;
320
- return /* @__PURE__ */ i(
321
- st,
313
+ u.length > 0 && /* @__PURE__ */ n(P, { sx: c, children: u.map((p) => {
314
+ var w;
315
+ return /* @__PURE__ */ n(
316
+ lt,
322
317
  {
323
318
  sx: {
324
319
  marginTop: 1,
325
320
  marginRight: 1,
326
321
  height: "auto"
327
322
  },
328
- label: /* @__PURE__ */ i(
329
- at,
323
+ label: /* @__PURE__ */ n(
324
+ ct,
330
325
  {
331
- title: (A = h.tooltipContent) != null ? A : "",
326
+ title: (w = p.tooltipContent) != null ? w : "",
332
327
  placement: "bottom-start",
333
- slotProps: V,
334
- children: /* @__PURE__ */ i(_, { style: { whiteSpace: "normal" }, children: h.chipLabel ? h.chipLabel : h.label })
328
+ slotProps: _,
329
+ children: /* @__PURE__ */ n(I, { style: { whiteSpace: "normal" }, children: p.chipLabel ? p.chipLabel : p.label })
335
330
  }
336
331
  ),
337
- "data-testid": r ? `${r}:Chip(${h.id.toString()})` : void 0,
338
- onDelete: ($) => S($, h.id),
339
- deleteIcon: /* @__PURE__ */ i(
340
- Ct,
332
+ "data-testid": r ? `${r}:Chip(${p.id.toString()})` : void 0,
333
+ onDelete: ($) => Q($, p.id),
334
+ deleteIcon: /* @__PURE__ */ n(
335
+ wt,
341
336
  {
342
- "data-testid": r ? `${r}:Chip(${h.id.toString()}):deleteIcon` : void 0
337
+ "data-testid": r ? `${r}:Chip(${p.id.toString()}):deleteIcon` : void 0
343
338
  }
344
339
  )
345
340
  },
346
- h.id
341
+ p.id
347
342
  );
348
343
  }) })
349
344
  ] });
350
345
  }
351
- const Po = /MUI: The value provided to.*is invalid/i, No = ({
352
- lookup: e = () => P(null, null, function* () {
346
+ const $o = /MUI: The value provided to.*is invalid/i, Mo = ({
347
+ lookup: e = () => N(null, null, function* () {
353
348
  }),
354
349
  onChange: t,
355
350
  onInputChange: o,
356
- label: n,
351
+ label: i,
357
352
  value: s,
358
353
  sx: a,
359
- textFieldColor: p,
354
+ textFieldColor: u,
360
355
  textFieldVariant: r = "filled",
361
- error: c = !1,
362
- "data-testid": l,
363
- noOptionsText: x = "No options",
364
- minLength: C = 3,
365
- disablePortal: v = !1,
366
- preLoadedOptions: g,
367
- helperText: w = "",
368
- disabled: D,
369
- popupIcon: f,
370
- disableIconFlip: k,
371
- isTemplatePlaceholder: y = !1,
372
- placeholderText: I = void 0,
373
- onRightClick: V = () => {
356
+ textFieldFocused: l,
357
+ textFieldSx: c,
358
+ error: x = !1,
359
+ "data-testid": A,
360
+ loadingText: D = "Loading...",
361
+ noOptionsText: g = "No options",
362
+ minLength: S = 3,
363
+ disablePortal: y = !1,
364
+ preLoadedOptions: h,
365
+ helperText: k = "",
366
+ disabled: F,
367
+ popupIcon: T,
368
+ disableIconFlip: V,
369
+ placeholderText: K = void 0,
370
+ onRightClick: _ = () => {
374
371
  },
375
- disableDefaultRightClickBehaviour: N = !1
372
+ disableDefaultRightClickBehaviour: O = !1,
373
+ readOnly: X,
374
+ hideInputEndAdornment: U
376
375
  }) => {
377
- const [E, U] = G(""), { data: L, isLoading: B } = qe({
378
- inputValue: E,
379
- label: n,
376
+ const [R, v] = G(""), { data: C, isLoading: B } = Ve({
377
+ inputValue: R,
378
+ label: i,
380
379
  lookup: e,
381
- minLength: C != null ? C : 0,
382
- preLoadedOptions: g
383
- }), R = E.length >= C, S = y ? {
384
- sx: {
385
- "& .MuiFilledInput-root.Mui-focused": {
386
- backgroundColor: "hsla(201, 98%, 41%, 0.08)"
387
- },
388
- "& .MuiOutlinedInput-root.Mui-focused": {
389
- backgroundColor: "hsla(201, 98%, 41%, 0.08)"
390
- }
391
- },
392
- focused: !0,
393
- slotProps: { input: { endAdornment: void 0 } }
394
- } : {};
395
- return /* @__PURE__ */ i("div", { "data-testid": l, children: /* @__PURE__ */ i(
396
- lt,
380
+ minLength: S != null ? S : 0,
381
+ preLoadedOptions: h
382
+ }), Q = R.length >= S;
383
+ return /* @__PURE__ */ n("div", { "data-testid": A, children: /* @__PURE__ */ n(
384
+ dt,
397
385
  {
398
386
  direction: "row",
399
387
  spacing: 1,
400
- onMouseDownCapture: (d) => {
401
- d.button === We.right && N && (d.preventDefault(), d.stopPropagation());
388
+ onMouseDownCapture: (f) => {
389
+ f.button === Ge.right && O && (f.preventDefault(), f.stopPropagation());
402
390
  },
403
- onContextMenuCapture: (d) => {
404
- N && (d.preventDefault(), d.stopPropagation()), V(d);
391
+ onContextMenuCapture: (f) => {
392
+ O && (f.preventDefault(), f.stopPropagation()), _(f);
405
393
  },
406
- children: /* @__PURE__ */ i(
407
- ie,
394
+ children: /* @__PURE__ */ n(
395
+ le,
408
396
  {
409
- sx: u(u({}, a), k ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
410
- "data-testid": l ? `${l}:Autocomplete` : void 0,
411
- loading: R ? B : !1,
412
- options: L != null ? L : [],
413
- onChange: (d, b, H) => {
414
- t(d, b, H);
397
+ sx: d(d({}, a), V ? { ".MuiAutocomplete-popupIndicatorOpen": { transform: "rotate(0deg)" } } : {}),
398
+ "data-testid": A ? `${A}:Autocomplete` : void 0,
399
+ loading: Q ? B : !1,
400
+ options: C != null ? C : [],
401
+ onChange: (f, E, H) => {
402
+ t(f, E, H);
415
403
  },
416
- disablePortal: v,
417
- filterOptions: (d) => d,
404
+ disablePortal: y,
405
+ filterOptions: (f) => f,
418
406
  value: s,
419
- noOptionsText: R ? x : "Start typing to search",
420
- getOptionLabel: (d) => d.label,
421
- popupIcon: f,
422
- renderInput: (d) => /* @__PURE__ */ i(
423
- re,
424
- u(F(u({
425
- "data-testid": l ? `${l}:Autocomplete:TextField` : void 0
426
- }, d), {
407
+ noOptionsText: Q ? g : "Start typing to search",
408
+ loadingText: D,
409
+ getOptionLabel: (f) => f.label,
410
+ popupIcon: T,
411
+ renderInput: (f) => /* @__PURE__ */ n(
412
+ ce,
413
+ b(d({
414
+ "data-testid": A ? `${A}:Autocomplete:TextField` : void 0
415
+ }, f), {
427
416
  variant: r,
428
- label: n,
429
- color: p,
430
- error: c,
431
- helperText: w,
432
- placeholder: I != null ? I : y ? "Placeholder field" : void 0
433
- }), S)
417
+ label: i,
418
+ color: u,
419
+ error: x,
420
+ helperText: k,
421
+ slotProps: {
422
+ input: b(d({}, f.InputProps), {
423
+ endAdornment: U ? void 0 : /* @__PURE__ */ m(M, { children: [
424
+ B ? /* @__PURE__ */ n(te, { color: "inherit", size: 20 }) : null,
425
+ f.InputProps.endAdornment
426
+ ] })
427
+ })
428
+ },
429
+ placeholder: K,
430
+ sx: c,
431
+ focused: l
432
+ })
434
433
  ),
435
- isOptionEqualToValue: (d, b) => d.id === b.id,
436
- onInputChange: (d, b, H) => {
437
- U(b), o && o(b, H, d);
434
+ isOptionEqualToValue: (f, E) => f.id === E.id,
435
+ onInputChange: (f, E, H) => {
436
+ v(E), o && o(E, H, f);
438
437
  },
439
- renderOption: (d, b) => /* @__PURE__ */ ne(
438
+ renderOption: (f, E) => /* @__PURE__ */ ae(
440
439
  "li",
441
- F(u({}, d), {
442
- key: b.id,
443
- "data-testid": l ? `${l}:Autocomplete:option(${b.id.toString()})` : void 0
440
+ b(d({}, f), {
441
+ key: E.id,
442
+ "data-testid": A ? `${A}:Autocomplete:option(${E.id.toString()})` : void 0
444
443
  }),
445
- b.label
444
+ E.label
446
445
  ),
447
- disabled: D,
448
- readOnly: y
446
+ disabled: F,
447
+ readOnly: X
449
448
  }
450
449
  )
451
450
  }
452
451
  ) });
453
- }, _t = (e) => {
452
+ }, Tt = (e) => {
454
453
  if (!e)
455
454
  return -1;
456
455
  try {
457
- const o = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), n = decodeURIComponent(
458
- Dt.from(o, "base64").toString("utf8").split("").map(function(a) {
456
+ const o = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), i = decodeURIComponent(
457
+ bt.from(o, "base64").toString("utf8").split("").map(function(a) {
459
458
  return "%" + ("00" + a.charCodeAt(0).toString(16)).slice(-2);
460
459
  }).join("")
461
- ), s = JSON.parse(n);
460
+ ), s = JSON.parse(i);
462
461
  return s != null && s.exp ? s.exp : -1;
463
462
  } catch (t) {
464
463
  return -1;
465
464
  }
466
- }, $o = ({
465
+ }, Lo = ({
467
466
  open: e = !1,
468
467
  closeHandler: t,
469
468
  setAuth0ExpiryTime: o
470
469
  }) => {
471
- const { logout: n, getAccessTokenSilently: s } = ae();
472
- return /* @__PURE__ */ i(
473
- He,
470
+ const { logout: i, getAccessTokenSilently: s } = de();
471
+ return /* @__PURE__ */ n(
472
+ qe,
474
473
  {
475
474
  isOpen: e,
476
475
  primaryButton: {
477
476
  text: "Continue",
478
- onClick: () => P(null, null, function* () {
479
- const l = yield s({ cacheMode: "off" }), x = _t(l) * 1e3;
477
+ onClick: () => N(null, null, function* () {
478
+ const c = yield s({ cacheMode: "off" }), x = Tt(c) * 1e3;
480
479
  o(x), t();
481
480
  }),
482
481
  disabled: !1,
@@ -485,8 +484,8 @@ const Po = /MUI: The value provided to.*is invalid/i, No = ({
485
484
  },
486
485
  secondaryButton: {
487
486
  text: "Log out",
488
- onClick: () => P(null, null, function* () {
489
- n({ logoutParams: { returnTo: `${window.location.origin}` } });
487
+ onClick: () => N(null, null, function* () {
488
+ i({ logoutParams: { returnTo: `${window.location.origin}` } });
490
489
  }),
491
490
  disabled: !1,
492
491
  testId: "PreferencesDialog",
@@ -495,42 +494,42 @@ const Po = /MUI: The value provided to.*is invalid/i, No = ({
495
494
  onClose: t,
496
495
  dialogTitle: "Session expiry",
497
496
  disableCloseOnBackdropOrEscape: !0,
498
- children: /* @__PURE__ */ i("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
497
+ children: /* @__PURE__ */ n("p", { style: { marginBottom: 0 }, children: "Your session is about to time out due to inactivity. Do you want to continue?" })
499
498
  }
500
499
  );
501
500
  };
502
- function Mt(e) {
501
+ function Nt(e) {
503
502
  return "error" in e;
504
503
  }
505
- function Pt(e) {
506
- var n;
507
- const t = e.error, o = (n = e == null ? void 0 : e.error_description) != null ? n : "";
504
+ function $t(e) {
505
+ var i;
506
+ const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
508
507
  return t === "access_denied" && o.startsWith("You do not have the required authorization");
509
508
  }
510
- function Nt(e) {
511
- var n;
512
- const t = e.error, o = (n = e == null ? void 0 : e.error_description) != null ? n : "";
509
+ function Mt(e) {
510
+ var i;
511
+ const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
513
512
  return t === "access_denied" && o.startsWith("User did not authorize the request");
514
513
  }
515
- function $t(e) {
516
- var n;
517
- const t = e.error, o = (n = e == null ? void 0 : e.error_description) != null ? n : "";
514
+ function Lt(e) {
515
+ var i;
516
+ const t = e.error, o = (i = e == null ? void 0 : e.error_description) != null ? i : "";
518
517
  return t === "access_denied" && o.match(/Script.*time.*exceeded/);
519
518
  }
520
- function To({
519
+ function Oo({
521
520
  children: e,
522
521
  appName: t = "the app",
523
522
  throwErrors: o = "none",
524
- disableConsoleLogging: n = !1,
523
+ disableConsoleLogging: i = !1,
525
524
  onError: s = () => {
526
525
  }
527
526
  }) {
528
- var C, v;
529
- const { isAuthenticated: a, isLoading: p, error: r, loginWithRedirect: c, logout: l } = ae();
530
- he(() => {
527
+ var A, D;
528
+ const { isAuthenticated: a, isLoading: u, error: r, loginWithRedirect: l, logout: c } = de();
529
+ ge(() => {
531
530
  r && s(r);
532
531
  }, [r, s]);
533
- const x = nt(
532
+ const x = rt(
534
533
  () => ({
535
534
  appState: {
536
535
  returnTo: `${window.location.pathname}${window.location.search}`
@@ -538,166 +537,166 @@ function To({
538
537
  }),
539
538
  []
540
539
  );
541
- if (he(() => {
542
- p || a || r || c(x);
543
- }, [p, a, r, c, s, x]), r) {
544
- if (n || console.error(
545
- `Error detected in AuthGuard [isAuthenticated=${a},isLoading=${p}]`,
540
+ if (ge(() => {
541
+ u || a || r || l(x);
542
+ }, [u, a, r, l, s, x]), r) {
543
+ if (i || console.error(
544
+ `Error detected in AuthGuard [isAuthenticated=${a},isLoading=${u}]`,
546
545
  r
547
546
  ), o === "all")
548
547
  throw r;
549
- if (Mt(r)) {
550
- let g = "Auth error", w = "An unknown Auth0 error occurred.";
551
- if (Pt(r))
552
- g = "Unauthorised", w = `You are not authorised to access ${t}.`;
553
- else if (Nt(r))
554
- g = "App not authorised", w = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
555
- else if ($t(r))
556
- g = "Auth0 script execution time exceeded", w = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";
548
+ if (Nt(r)) {
549
+ let g = "Auth error", S = "An unknown Auth0 error occurred.";
550
+ if ($t(r))
551
+ g = "Unauthorised", S = `You are not authorised to access ${t}.`;
552
+ else if (Mt(r))
553
+ g = "App not authorised", S = `You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;
554
+ else if (Lt(r))
555
+ g = "Auth0 script execution time exceeded", S = "The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";
557
556
  else if (r.message === "Invalid state") {
558
- const D = localStorage.getItem("auth0_redirect_count");
559
- D ? D && parseInt(D) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(D) + 1)), c(x)) : (localStorage.setItem("auth0_redirect_count", "1"), c(x));
557
+ const y = localStorage.getItem("auth0_redirect_count");
558
+ y ? y && parseInt(y) < 2 && (localStorage.setItem("auth0_redirect_count", String(parseInt(y) + 1)), l(x)) : (localStorage.setItem("auth0_redirect_count", "1"), l(x));
560
559
  } else if (o === "unknown") throw r;
561
- return /* @__PURE__ */ m(Pe, { open: !0, children: [
562
- /* @__PURE__ */ i($e, { children: g }),
563
- /* @__PURE__ */ m(Te, { children: [
564
- /* @__PURE__ */ i(_, { children: w }),
565
- /* @__PURE__ */ i("br", {}),
566
- /* @__PURE__ */ i(_, { variant: "subtitle2", children: "Details from Auth0" }),
567
- /* @__PURE__ */ m(_, { variant: "body2", children: [
560
+ return /* @__PURE__ */ m(Me, { open: !0, children: [
561
+ /* @__PURE__ */ n(Oe, { children: g }),
562
+ /* @__PURE__ */ m(Re, { children: [
563
+ /* @__PURE__ */ n(I, { children: S }),
564
+ /* @__PURE__ */ n("br", {}),
565
+ /* @__PURE__ */ n(I, { variant: "subtitle2", children: "Details from Auth0" }),
566
+ /* @__PURE__ */ m(I, { variant: "body2", children: [
568
567
  "error: ",
569
- (C = r == null ? void 0 : r.error) != null ? C : "N/A"
568
+ (A = r == null ? void 0 : r.error) != null ? A : "N/A"
570
569
  ] }),
571
- /* @__PURE__ */ m(_, { variant: "body2", children: [
570
+ /* @__PURE__ */ m(I, { variant: "body2", children: [
572
571
  "description: ",
573
- (v = r == null ? void 0 : r.error_description) != null ? v : "N/A"
572
+ (D = r == null ? void 0 : r.error_description) != null ? D : "N/A"
574
573
  ] })
575
574
  ] }),
576
- /* @__PURE__ */ m(Le, { children: [
577
- g === "Auth0 script execution time exceeded" && /* @__PURE__ */ i(z, { href: window.location.origin + window.location.pathname, children: "Reload" }),
578
- /* @__PURE__ */ i(z, { onClick: () => l({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
575
+ /* @__PURE__ */ m(Ue, { children: [
576
+ g === "Auth0 script execution time exceeded" && /* @__PURE__ */ n(q, { href: window.location.origin + window.location.pathname, children: "Reload" }),
577
+ /* @__PURE__ */ n(q, { onClick: () => c({ logoutParams: { returnTo: window.location.origin } }), children: "Logout" })
579
578
  ] })
580
579
  ] });
581
580
  } else if (o === "unknown") throw r;
582
581
  }
583
- return a ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ i(O, { children: e })) : /* @__PURE__ */ i(yt, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
582
+ return a ? (localStorage.removeItem("auth0_redirect_count"), /* @__PURE__ */ n(M, { children: e })) : /* @__PURE__ */ n(Ft, { variant: "rectangular", animation: "pulse", height: "100vh", width: "100vw" });
584
583
  }
585
- const Tt = {
584
+ const Ot = {
586
585
  autoHideDuration: 6e3,
587
586
  anchorOrigin: { vertical: "top", horizontal: "center" },
588
587
  // The default is false. If we prefer timer to continue when window loses
589
588
  // focus, change to true
590
589
  disableWindowBlurListener: !1
591
- }, Lt = {
590
+ }, Rt = {
592
591
  shouldClose: (e, t) => t !== "clickaway"
593
- }, ve = {
592
+ }, ke = {
594
593
  message: "",
595
594
  severity: "info",
596
595
  variant: "standard",
597
596
  progressIndicator: void 0
598
597
  // Can use 'circular' or 'linear'
599
- }, we = 100, ke = 2e3, Ot = 2e3, Rt = /* @__PURE__ */ (() => {
598
+ }, ye = 100, be = 2e3, Ut = 2e3, Bt = /* @__PURE__ */ (() => {
600
599
  let e = 0;
601
600
  return () => (e += 1, e);
602
- })(), Ut = {
601
+ })(), Ht = {
603
602
  borderBottomLeftRadius: "0px",
604
603
  borderBottomRightRadius: "0px"
605
- }, Bt = {}, Ht = {}, ze = it(null);
606
- function Wt(a) {
607
- var p = a, {
608
- overrideState: e = Bt,
609
- overrideActions: t = Ht,
610
- shouldClose: o = Lt.shouldClose,
611
- children: n
612
- } = p, s = ue(p, [
604
+ }, Wt = {}, zt = {}, Ke = st(null);
605
+ function qt(a) {
606
+ var u = a, {
607
+ overrideState: e = Wt,
608
+ overrideActions: t = zt,
609
+ shouldClose: o = Rt.shouldClose,
610
+ children: i
611
+ } = u, s = fe(u, [
613
612
  "overrideState",
614
613
  "overrideActions",
615
614
  "shouldClose",
616
615
  "children"
617
616
  ]);
618
617
  var R;
619
- const [{ open: r }, c] = G({ open: !1 }), l = te([]), x = te(Date.now()), C = te(0), v = fe((S) => {
620
- c({ open: S });
621
- }, []), g = fe((S = {}) => {
622
- C.current += 1, l.current.length >= we && Date.now() - x.current >= ke && (x.current = Date.now(), console.error(
623
- `SaladBarProvider: MAX_QUEUE_LENGTH (${we}) hit ${C.current} times in last ${ke}ms)`
624
- ), C.current = 0);
625
- const d = u(F(u({}, ve), {
626
- key: Rt()
627
- }), S);
628
- return l.current.push(d), l.current.length === 1 && c({ open: !0 }), d.key;
629
- }, []), w = (S = "", d = {}) => g(u({ message: S, severity: "success" }, d)), D = (S = "", d = {}) => g(u({ message: S, severity: "info" }, d)), f = (S = "", d = {}) => g(u({ message: S, severity: "warning" }, d)), k = (S = "", d = {}) => g(u({ message: S, severity: "error" }, d)), y = (S) => {
630
- const d = l.current.findIndex((b) => b.key === S);
631
- if (d !== -1)
632
- return d === 0 ? (c({ open: !1 }), l.current[0]) : l.current.splice(d, 1);
633
- }, I = (S, d) => {
634
- o(S, d) && c({ open: !1 });
618
+ const [{ open: r }, l] = G({ open: !1 }), c = re([]), x = re(Date.now()), A = re(0), D = xe((v) => {
619
+ l({ open: v });
620
+ }, []), g = xe((v = {}) => {
621
+ A.current += 1, c.current.length >= ye && Date.now() - x.current >= be && (x.current = Date.now(), console.error(
622
+ `SaladBarProvider: MAX_QUEUE_LENGTH (${ye}) hit ${A.current} times in last ${be}ms)`
623
+ ), A.current = 0);
624
+ const C = d(b(d({}, ke), {
625
+ key: Bt()
626
+ }), v);
627
+ return c.current.push(C), c.current.length === 1 && l({ open: !0 }), C.key;
628
+ }, []), S = (v = "", C = {}) => g(d({ message: v, severity: "success" }, C)), y = (v = "", C = {}) => g(d({ message: v, severity: "info" }, C)), h = (v = "", C = {}) => g(d({ message: v, severity: "warning" }, C)), k = (v = "", C = {}) => g(d({ message: v, severity: "error" }, C)), F = (v) => {
629
+ const C = c.current.findIndex((B) => B.key === v);
630
+ if (C !== -1)
631
+ return C === 0 ? (l({ open: !1 }), c.current[0]) : c.current.splice(C, 1);
632
+ }, T = (v, C) => {
633
+ o(v, C) && l({ open: !1 });
635
634
  }, V = () => {
636
- }, N = () => {
637
- l.current.shift(), l.current.length > 0 && c({ open: !0 });
638
- }, E = (R = l.current[0]) != null ? R : u({}, ve), U = {};
639
- "autoHideDuration" in E && (U.autoHideDuration = E.autoHideDuration);
640
- const L = u(u({}, Tt), s), B = u(u({
635
+ }, K = () => {
636
+ c.current.shift(), c.current.length > 0 && l({ open: !0 });
637
+ }, _ = (R = c.current[0]) != null ? R : d({}, ke), O = {};
638
+ "autoHideDuration" in _ && (O.autoHideDuration = _.autoHideDuration);
639
+ const X = d(d({}, Ot), s), U = d(d({
641
640
  open: r,
642
- setOpen: v,
641
+ setOpen: D,
643
642
  enqueueNotification: g,
644
- enqueueSuccessNotification: w,
645
- enqueueInfoNotification: D,
646
- enqueueWarningNotification: f,
643
+ enqueueSuccessNotification: S,
644
+ enqueueInfoNotification: y,
645
+ enqueueWarningNotification: h,
647
646
  enqueueErrorNotification: k,
648
- removeNotification: y
647
+ removeNotification: F
649
648
  }, e), t);
650
- return /* @__PURE__ */ m(ze.Provider, { value: B, children: [
651
- n,
652
- /* @__PURE__ */ i(
653
- ct,
654
- F(u(u({}, L), U), {
649
+ return /* @__PURE__ */ m(Ke.Provider, { value: U, children: [
650
+ i,
651
+ /* @__PURE__ */ n(
652
+ ut,
653
+ b(d(d({}, X), O), {
655
654
  open: r,
656
- onClose: I,
655
+ onClose: T,
657
656
  TransitionProps: {
658
- onExited: N,
657
+ onExited: K,
659
658
  onExit: V
660
659
  },
661
- sx: { zIndex: Ot },
660
+ sx: { zIndex: Ut },
662
661
  children: /* @__PURE__ */ m("div", { children: [
663
- /* @__PURE__ */ i(
664
- dt,
662
+ /* @__PURE__ */ n(
663
+ pt,
665
664
  {
666
- onClose: (S) => I(S, "closeAlert"),
667
- severity: E.severity,
665
+ onClose: (v) => T(v, "closeAlert"),
666
+ severity: _.severity,
668
667
  variant: "filled",
669
- icon: E.progressIndicator === "circular" ? /* @__PURE__ */ i(se, { size: "1em" }) : void 0,
670
- style: E.progressIndicator === "linear" ? Ut : void 0,
671
- children: E.message
668
+ icon: _.progressIndicator === "circular" ? /* @__PURE__ */ n(te, { size: "1em" }) : void 0,
669
+ style: _.progressIndicator === "linear" ? Ht : void 0,
670
+ children: _.message
672
671
  }
673
672
  ),
674
- E.progressIndicator === "linear" && /* @__PURE__ */ i(Ne, { color: "primary" })
673
+ _.progressIndicator === "linear" && /* @__PURE__ */ n(Le, { color: "primary" })
675
674
  ] })
676
675
  })
677
676
  )
678
677
  ] });
679
678
  }
680
- class Ge extends Error {
679
+ class Xe extends Error {
681
680
  }
682
- pe(Ge, "errorName", "ContextError");
683
- function qt() {
684
- const e = rt(ze);
681
+ me(Xe, "errorName", "ContextError");
682
+ function Gt() {
683
+ const e = at(Ke);
685
684
  if (e === null)
686
- throw new Ge("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
685
+ throw new Xe("Error: Tried to useSaladBar outside of a <SaladBarProvider>");
687
686
  return e;
688
687
  }
689
- const Lo = bt(
690
- (e = { autoHideDuration: 1 }, t = {}, o = {}) => ({ children: n }) => /* @__PURE__ */ i(Wt, F(u({}, e), { overrideState: t, overrideActions: o, children: /* @__PURE__ */ i(O, { children: n }) }))
691
- ), Ve = "domainCode";
692
- var _e;
693
- const De = T(
694
- JSON.parse((_e = localStorage.getItem(Ve)) != null ? _e : '{"domainCode": ""}').domainCode
695
- ), zt = T(
696
- (e) => e(De),
688
+ const Ro = Et(
689
+ (e = { autoHideDuration: 1 }, t = {}, o = {}) => ({ children: i }) => /* @__PURE__ */ n(qt, b(d({}, e), { overrideState: t, overrideActions: o, children: /* @__PURE__ */ n(M, { children: i }) }))
690
+ ), Ye = "domainCode";
691
+ var Ne;
692
+ const Fe = L(
693
+ JSON.parse((Ne = localStorage.getItem(Ye)) != null ? Ne : '{"domainCode": ""}').domainCode
694
+ ), Vt = L(
695
+ (e) => e(Fe),
697
696
  (e, t, o) => {
698
- t(De, o), localStorage.setItem(Ve, JSON.stringify({ domainCode: o }));
697
+ t(Fe, o), localStorage.setItem(Ye, JSON.stringify({ domainCode: o }));
699
698
  }
700
- ), Gt = {
699
+ ), Kt = {
701
700
  act: "ACT",
702
701
  nsw: "NSW",
703
702
  nt: "NT",
@@ -709,102 +708,102 @@ const De = T(
709
708
  ag: "AG",
710
709
  fedmps: "FedMPs",
711
710
  "": ""
712
- }, Ke = (e) => {
711
+ }, Qe = (e) => {
713
712
  var t;
714
- return e === null ? "N/A" : (t = Gt[e]) != null ? t : "";
715
- }, Oo = ({
713
+ return e === null ? "N/A" : (t = Kt[e]) != null ? t : "";
714
+ }, Uo = ({
716
715
  isLoading: e,
717
716
  isOpen: t,
718
717
  onClose: o,
719
- onDomainChange: n,
718
+ onDomainChange: i,
720
719
  domainOptions: s,
721
720
  applicationName: a,
722
- handleLogout: p
721
+ handleLogout: u
723
722
  }) => {
724
- const [r, c] = W(zt), [l, x] = G(r), { enqueueSuccessNotification: C } = qt(), v = s.length === 0, g = !!r && !s.includes(r) && !s.includes(l), w = !r || v || g, D = () => P(null, null, function* () {
725
- l ? (c(l), n == null || n(l), C(`Set organisation to ${l}`), o()) : (c(""), n == null || n(""));
726
- }), f = () => P(null, null, function* () {
727
- r && !v && !g ? (x(r), o()) : w && p();
723
+ const [r, l] = W(Vt), [c, x] = G(r), { enqueueSuccessNotification: A } = Gt(), D = s.length === 0, g = !!r && !s.includes(r) && !s.includes(c), S = !r || D || g, y = () => N(null, null, function* () {
724
+ c ? (l(c), i == null || i(c), A(`Set organisation to ${c}`), o()) : (l(""), i == null || i(""));
725
+ }), h = () => N(null, null, function* () {
726
+ r && !D && !g ? (x(r), o()) : S && u();
728
727
  });
729
728
  let k;
730
- return v ? k = "Unable to retrieve your active organisations. Try logging in again." : g && (k = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ m(
731
- He,
729
+ return D ? k = "Unable to retrieve your active organisations. Try logging in again." : g && (k = "You no longer have any roles in your chosen organisation. Please choose another."), /* @__PURE__ */ m(
730
+ qe,
732
731
  {
733
732
  isOpen: t,
734
733
  dialogTitle: "Select an organisation",
735
734
  primaryButton: {
736
735
  text: "Confirm",
737
- onClick: D,
738
- disabled: !l || v || g,
736
+ onClick: y,
737
+ disabled: !c || D || g,
739
738
  buttonColor: "primary"
740
739
  },
741
740
  secondaryButton: {
742
- text: w ? "Logout" : "Cancel",
743
- onClick: f
741
+ text: S ? "Logout" : "Cancel",
742
+ onClick: h
744
743
  },
745
- onClose: w ? () => {
744
+ onClose: S ? () => {
746
745
  } : o,
747
746
  children: [
748
- /* @__PURE__ */ m(_, { marginBottom: 2, children: [
747
+ /* @__PURE__ */ m(I, { marginBottom: 2, children: [
749
748
  "Select the default organisation that you want to use with the ",
750
749
  a,
751
750
  "."
752
751
  ] }),
753
- /* @__PURE__ */ i(
754
- ie,
752
+ /* @__PURE__ */ n(
753
+ le,
755
754
  {
756
755
  loading: e,
757
756
  multiple: !1,
758
757
  disableClearable: !1,
759
- value: l !== "" ? l : null,
760
- onChange: (y, I) => x(I != null ? I : ""),
761
- getOptionLabel: Ke,
758
+ value: c !== "" ? c : null,
759
+ onChange: (F, T) => x(T != null ? T : ""),
760
+ getOptionLabel: Qe,
762
761
  options: [...s.toSorted()],
763
- renderInput: (y) => /* @__PURE__ */ i(
764
- re,
765
- F(u({}, y), {
762
+ renderInput: (F) => /* @__PURE__ */ n(
763
+ ce,
764
+ b(d({}, F), {
766
765
  variant: "filled",
767
766
  label: "Select organisation",
768
- InputProps: F(u({}, y.InputProps), {
769
- endAdornment: /* @__PURE__ */ m(O, { children: [
770
- e ? /* @__PURE__ */ i(se, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
771
- y.InputProps.endAdornment
767
+ InputProps: b(d({}, F.InputProps), {
768
+ endAdornment: /* @__PURE__ */ m(M, { children: [
769
+ e ? /* @__PURE__ */ n(te, { color: "inherit", size: 20, sx: { marginTop: "-20px" } }) : null,
770
+ F.InputProps.endAdornment
772
771
  ] })
773
772
  })
774
773
  })
775
774
  )
776
775
  }
777
776
  ),
778
- k && /* @__PURE__ */ i(ut, { error: !0, children: k })
777
+ k && /* @__PURE__ */ n(ht, { error: !0, children: k })
779
778
  ]
780
779
  }
781
780
  );
782
- }, Xe = () => {
783
- const e = Z();
784
- return pt(e.breakpoints.down("sm"));
785
- }, Vt = 64, Kt = 72, Xt = 256, J = T(!0), Yt = T(Xt), Qt = T(Kt), ye = T(""), Jt = T(void 0), Zt = T(Vt), jt = T(void 0);
786
- function eo({ links: e }) {
787
- return /* @__PURE__ */ i("div", { children: "LinksMenu not implemented yet" });
781
+ }, Je = () => {
782
+ const e = oe();
783
+ return ft(e.breakpoints.down("sm"));
784
+ }, Xt = 64, Yt = 72, Qt = 256, ee = L(!0), Jt = L(Qt), Zt = L(Yt), Ee = L(""), jt = L(void 0), eo = L(Xt), to = L(void 0);
785
+ function oo({ links: e }) {
786
+ return /* @__PURE__ */ n("div", { children: "LinksMenu not implemented yet" });
788
787
  }
789
- const Y = "Navbar", K = {
790
- root: `${Y}-root`,
791
- menuButton: `${Y}-menuButton`,
792
- hide: `${Y}-hide`,
793
- content: `${Y}-content`
788
+ const Z = "Navbar", Y = {
789
+ root: `${Z}-root`,
790
+ menuButton: `${Z}-menuButton`,
791
+ hide: `${Z}-hide`,
792
+ content: `${Z}-content`
794
793
  // userInfoHolder: `${PREFIX}-userInfoHolder`,
795
794
  // settings: `${PREFIX}-settings`,
796
795
  // pieChartIcon: `${PREFIX}-pieChartIcon`,
797
- }, to = Ue(M, { name: "NavBar" })(({ theme: e }) => ({
798
- [`&.${K.root}`]: {
796
+ }, no = We(P, { name: "NavBar" })(({ theme: e }) => ({
797
+ [`&.${Y.root}`]: {
799
798
  display: "flex"
800
799
  },
801
- [`& .${K.menuButton}`]: {
800
+ [`& .${Y.menuButton}`]: {
802
801
  marginRight: 36
803
802
  },
804
- [`& .${K.hide}`]: {
803
+ [`& .${Y.hide}`]: {
805
804
  display: "none"
806
805
  },
807
- [`& .${K.content}`]: {
806
+ [`& .${Y.content}`]: {
808
807
  flexGrow: 1,
809
808
  padding: e.spacing(3)
810
809
  }
@@ -813,14 +812,14 @@ const Y = "Navbar", K = {
813
812
  // marginTop: '64px',
814
813
  // marginBottom: '16px',
815
814
  // },
816
- })), q = (e, t, o) => e.transitions.create(t, {
815
+ })), z = (e, t, o) => e.transitions.create(t, {
817
816
  easing: e.transitions.easing.sharp,
818
817
  duration: o === "leaving" ? e.transitions.duration.leavingScreen : e.transitions.duration.enteringScreen
819
- }), oo = (e) => {
820
- const t = Z();
821
- return /* @__PURE__ */ i(
822
- ft,
823
- u({
818
+ }), io = (e) => {
819
+ const t = oe();
820
+ return /* @__PURE__ */ n(
821
+ gt,
822
+ d({
824
823
  easing: t.transitions.easing.sharp,
825
824
  timeout: {
826
825
  enter: t.transitions.duration.enteringScreen,
@@ -828,7 +827,7 @@ const Y = "Navbar", K = {
828
827
  }
829
828
  }, e)
830
829
  );
831
- }, Ye = (e) => {
830
+ }, Ze = (e) => {
832
831
  var t, o;
833
832
  return {
834
833
  overflowX: "hidden",
@@ -836,104 +835,104 @@ const Y = "Navbar", K = {
836
835
  backgroundColor: (o = (t = e == null ? void 0 : e.navBar) == null ? void 0 : t.backgroundColor) != null ? o : "white"
837
836
  // Provide default so tests don't need to wrap theme provider
838
837
  };
839
- }, be = (e, t) => u({
838
+ }, _e = (e, t) => d({
840
839
  width: t,
841
- transition: q(e, "width", "entering")
842
- }, Ye(e)), Fe = (e, t) => u({
840
+ transition: z(e, "width", "entering")
841
+ }, Ze(e)), Ie = (e, t) => d({
843
842
  width: t,
844
- transition: q(e, "width", "leaving")
845
- }, Ye(e)), no = Ue(ht, {
843
+ transition: z(e, "width", "leaving")
844
+ }, Ze(e)), ro = We(mt, {
846
845
  shouldForwardProp: (e) => !["widthOpen", "widthClosed", "isSmallScreen"].includes(e)
847
- })(({ theme: e, open: t, widthOpen: o, widthClosed: n, isSmallScreen: s }) => u(u({
846
+ })(({ theme: e, open: t, widthOpen: o, widthClosed: i, isSmallScreen: s }) => d(d({
848
847
  flexShrink: 0,
849
848
  whiteSpace: "nowrap",
850
849
  boxSizing: "border-box",
851
850
  display: "flex",
852
851
  flexDirection: "column"
853
- }, t && F(u({}, be(e, o)), {
852
+ }, t && b(d({}, _e(e, o)), {
854
853
  backgroundColor: "",
855
- "& .MuiDrawer-paper": be(e, o)
856
- })), !t && F(u({}, Fe(e, s ? o : n)), {
854
+ "& .MuiDrawer-paper": _e(e, o)
855
+ })), !t && b(d({}, Ie(e, s ? o : i)), {
857
856
  backgroundColor: "",
858
- "& .MuiDrawer-paper": Fe(e, s ? o : n)
857
+ "& .MuiDrawer-paper": Ie(e, s ? o : i)
859
858
  })));
860
- function Qe(e) {
859
+ function je(e) {
861
860
  return e.replace(
862
861
  /(^|-)([a-z])/g,
863
- (t, o, n) => o === "-" ? " " + n.toUpperCase() : n.toUpperCase()
862
+ (t, o, i) => o === "-" ? " " + i.toUpperCase() : i.toUpperCase()
864
863
  );
865
864
  }
866
- function Ro(e, t, o, n) {
867
- var p;
865
+ function Bo(e, t, o, i) {
866
+ var u;
868
867
  if (!e) return "None";
869
868
  const a = Object.entries(e).filter(
870
- ([r, c]) => r.startsWith("https://greens.org.au/roles/") && c.includes(t)
869
+ ([r, l]) => r.startsWith("https://greens.org.au/roles/") && l.includes(t)
871
870
  ).map(
872
871
  ([r]) => {
873
- var c;
874
- return Qe((c = r.split("/").at(-1)) != null ? c : "");
872
+ var l;
873
+ return je((l = r.split("/").at(-1)) != null ? l : "");
875
874
  }
876
875
  );
877
- return (p = n.find(
878
- (r) => o[r].some((c) => a.includes(c))
879
- )) != null ? p : "None";
876
+ return (u = i.find(
877
+ (r) => o[r].some((l) => a.includes(l))
878
+ )) != null ? u : "None";
880
879
  }
881
- const Uo = (e) => {
882
- const { getIdTokenClaims: t, user: o } = ae();
883
- return Oe({
880
+ const Ho = (e) => {
881
+ const { getIdTokenClaims: t, user: o } = de();
882
+ return Be({
884
883
  queryKey: ["availableDomains", o == null ? void 0 : o.sub],
885
- queryFn: () => P(null, null, function* () {
886
- const n = yield t();
887
- return n ? Object.entries(n).reduce((s, [a, p]) => {
888
- var l;
889
- const r = Qe((l = a.split("/").at(-1)) != null ? l : ""), c = a.startsWith("https://greens.org.au/roles/") && e.includes(r) ? p : [];
890
- return [.../* @__PURE__ */ new Set([...s, ...c])];
884
+ queryFn: () => N(null, null, function* () {
885
+ const i = yield t();
886
+ return i ? Object.entries(i).reduce((s, [a, u]) => {
887
+ var c;
888
+ const r = je((c = a.split("/").at(-1)) != null ? c : ""), l = a.startsWith("https://greens.org.au/roles/") && e.includes(r) ? u : [];
889
+ return [.../* @__PURE__ */ new Set([...s, ...l])];
891
890
  }, []) : [];
892
891
  })
893
892
  });
894
- }, Bo = (e) => Object.values(e).reduce(
893
+ }, Wo = (e) => Object.values(e).reduce(
895
894
  (t, o) => [.../* @__PURE__ */ new Set([...t, ...o])],
896
895
  []
897
- ), Q = {
896
+ ), j = {
898
897
  log: console.warn.bind(console),
899
898
  error: console.error.bind(console),
900
899
  warn: console.warn.bind(console),
901
900
  info: console.info.bind(console),
902
901
  debug: console.debug.bind(console)
903
902
  };
904
- function Ho(e, t) {
903
+ function zo(e, t) {
905
904
  console[e] = (...o) => {
906
- for (const n of t)
907
- if (typeof n == "function") {
908
- if (n(...o)) return;
909
- } else if (n instanceof RegExp && o.length > 0) {
905
+ for (const i of t)
906
+ if (typeof i == "function") {
907
+ if (i(...o)) return;
908
+ } else if (i instanceof RegExp && o.length > 0) {
910
909
  for (const s of o)
911
- if (typeof s == "string" && n.test(s))
910
+ if (typeof s == "string" && i.test(s))
912
911
  return;
913
912
  }
914
- Q[e](o);
913
+ j[e](o);
915
914
  };
916
915
  }
917
- function Wo(e) {
916
+ function qo(e) {
918
917
  if (e)
919
- console[e] = Q[e];
918
+ console[e] = j[e];
920
919
  else
921
- for (const t of Object.keys(Q))
922
- console[t] = Q[t];
920
+ for (const t of Object.keys(j))
921
+ console[t] = j[t];
923
922
  }
924
- function io(e) {
923
+ function so(e) {
925
924
  let t = 0;
926
- for (let o = 0, n = e.length; o < n; o++) {
925
+ for (let o = 0, i = e.length; o < i; o++) {
927
926
  const s = e.charCodeAt(o);
928
927
  t = (t << 5) - t + s, t |= 0;
929
928
  }
930
929
  return t;
931
930
  }
932
- const Ee = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Ie = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
933
- function ro({ user: e, domainCode: t, open: o, useNewAvatar: n = !1 }) {
934
- const s = Z();
931
+ const Pe = ["#A62A21", "#7e3794", "#0B51C1", "#3A6024", "#A81563", "#B3003C"], Te = (e) => e.split(/\s/).map((t) => t.substring(0, 1).toUpperCase()).filter((t) => !!t).slice(0, 2).join("").toUpperCase();
932
+ function ao({ user: e, domainCode: t, open: o, useNewAvatar: i = !1 }) {
933
+ const s = oe();
935
934
  return /* @__PURE__ */ m(
936
- M,
935
+ P,
937
936
  {
938
937
  sx: {
939
938
  paddingTop: 3,
@@ -943,67 +942,67 @@ function ro({ user: e, domainCode: t, open: o, useNewAvatar: n = !1 }) {
943
942
  gap: "0.5rem"
944
943
  },
945
944
  children: [
946
- !n && /* @__PURE__ */ i(
947
- M,
945
+ !i && /* @__PURE__ */ n(
946
+ P,
948
947
  {
949
948
  sx: {
950
949
  width: o ? "5rem" : "2rem",
951
- transition: o ? q(s, ["width", "height"], "entering") : q(s, ["width", "height"], "leaving"),
950
+ transition: o ? z(s, ["width", "height"], "entering") : z(s, ["width", "height"], "leaving"),
952
951
  aspectRatio: 1
953
952
  },
954
- children: e != null && e.name ? /* @__PURE__ */ i(O, { children: /* @__PURE__ */ i(
955
- me,
953
+ children: e != null && e.name ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(
954
+ Ae,
956
955
  {
957
956
  src: e == null ? void 0 : e.picture,
958
957
  sx: {
959
958
  width: "100%",
960
959
  height: "100%",
961
- bgcolor: Ee[Math.abs(io(e == null ? void 0 : e.name)) % Ee.length]
960
+ bgcolor: Pe[Math.abs(so(e == null ? void 0 : e.name)) % Pe.length]
962
961
  },
963
- children: Ie(e == null ? void 0 : e.name)
962
+ children: Te(e == null ? void 0 : e.name)
964
963
  }
965
- ) }) : /* @__PURE__ */ i(me, { sx: { width: "100%", height: "100%" } })
964
+ ) }) : /* @__PURE__ */ n(Ae, { sx: { width: "100%", height: "100%" } })
966
965
  }
967
966
  ),
968
- n && /* @__PURE__ */ i(
969
- M,
967
+ i && /* @__PURE__ */ n(
968
+ P,
970
969
  {
971
970
  sx: {
972
971
  width: o ? "5rem" : "2rem",
973
- transition: o ? q(s, ["width", "height"], "entering") : q(s, ["width", "height"], "leaving"),
972
+ transition: o ? z(s, ["width", "height"], "entering") : z(s, ["width", "height"], "leaving"),
974
973
  aspectRatio: 1
975
974
  },
976
- children: e != null && e.name ? /* @__PURE__ */ i(O, { children: /* @__PURE__ */ m(Se, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: o ? "80" : "32", children: [
975
+ children: e != null && e.name ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ m(De, { src: e == null ? void 0 : e.picture, name: e == null ? void 0 : e.name, round: !0, size: o ? "80" : "32", children: [
977
976
  " ",
978
- Ie(e == null ? void 0 : e.name),
977
+ Te(e == null ? void 0 : e.name),
979
978
  " ",
980
979
  "ab"
981
- ] }) }) : /* @__PURE__ */ i(Se, {})
980
+ ] }) }) : /* @__PURE__ */ n(De, {})
982
981
  }
983
982
  ),
984
- /* @__PURE__ */ i(oo, { sx: { width: "100%" }, in: o, children: /* @__PURE__ */ i(mt, { in: o, children: /* @__PURE__ */ m(M, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
985
- e != null && e.name ? /* @__PURE__ */ i(_, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ i(ge, { animation: !1, width: "50%" }),
986
- t ? /* @__PURE__ */ i(_, { children: Ke(t) }) : /* @__PURE__ */ i(ge, { animation: !1, width: "25%" })
983
+ /* @__PURE__ */ n(io, { sx: { width: "100%" }, in: o, children: /* @__PURE__ */ n(xt, { in: o, children: /* @__PURE__ */ m(P, { width: "100%", display: "flex", flexDirection: "column", alignItems: "center", children: [
984
+ e != null && e.name ? /* @__PURE__ */ n(I, { children: e == null ? void 0 : e.name }) : /* @__PURE__ */ n(Ce, { animation: !1, width: "50%" }),
985
+ t ? /* @__PURE__ */ n(I, { children: Qe(t) }) : /* @__PURE__ */ n(Ce, { animation: !1, width: "25%" })
987
986
  ] }) }) })
988
987
  ]
989
988
  }
990
989
  );
991
990
  }
992
- function so({
991
+ function lo({
993
992
  open: e,
994
993
  widthClosed: t,
995
994
  widthOpen: o,
996
- "data-testid": n,
995
+ "data-testid": i,
997
996
  top: s,
998
997
  middle: a,
999
- bottom: p,
998
+ bottom: u,
1000
999
  user: r,
1001
- domainCode: c,
1002
- useNewAvatar: l = !1
1000
+ domainCode: l,
1001
+ useNewAvatar: c = !1
1003
1002
  }) {
1004
- const x = Xe(), C = Re(J);
1005
- return /* @__PURE__ */ i(to, { className: K.root, "data-testid": n, children: /* @__PURE__ */ m(
1006
- no,
1003
+ const x = Je(), A = He(ee);
1004
+ return /* @__PURE__ */ n(no, { className: Y.root, "data-testid": i, children: /* @__PURE__ */ m(
1005
+ ro,
1007
1006
  {
1008
1007
  open: e,
1009
1008
  widthOpen: o,
@@ -1014,41 +1013,41 @@ function so({
1014
1013
  component: "nav"
1015
1014
  },
1016
1015
  onClose: () => {
1017
- C(!1);
1016
+ A(!1);
1018
1017
  },
1019
1018
  isSmallScreen: x,
1020
1019
  children: [
1021
- !x && /* @__PURE__ */ i(gt, {}),
1022
- s && /* @__PURE__ */ m(M, { flexGrow: "0", children: [
1020
+ !x && /* @__PURE__ */ n(At, {}),
1021
+ s && /* @__PURE__ */ m(P, { flexGrow: "0", children: [
1023
1022
  s,
1024
- /* @__PURE__ */ i(xe, { variant: "middle", sx: { marginY: "0.5rem" } })
1023
+ /* @__PURE__ */ n(Se, { variant: "middle", sx: { marginY: "0.5rem" } })
1025
1024
  ] }),
1026
- /* @__PURE__ */ i(M, { flexGrow: "1", children: Array.isArray(a) ? /* @__PURE__ */ i(eo, { links: a }) : a }),
1027
- /* @__PURE__ */ m(M, { flexGrow: "0", children: [
1028
- /* @__PURE__ */ i(xe, { variant: "middle", sx: { marginY: "0.5rem" } }),
1029
- /* @__PURE__ */ i(ro, { user: r, domainCode: c, open: e, useNewAvatar: l }),
1030
- p && /* @__PURE__ */ i(O, { children: p })
1025
+ /* @__PURE__ */ n(P, { flexGrow: "1", children: Array.isArray(a) ? /* @__PURE__ */ n(oo, { links: a }) : a }),
1026
+ /* @__PURE__ */ m(P, { flexGrow: "0", children: [
1027
+ /* @__PURE__ */ n(Se, { variant: "middle", sx: { marginY: "0.5rem" } }),
1028
+ /* @__PURE__ */ n(ao, { user: r, domainCode: l, open: e, useNewAvatar: c }),
1029
+ u && /* @__PURE__ */ n(M, { children: u })
1031
1030
  ] })
1032
1031
  ]
1033
1032
  }
1034
1033
  ) });
1035
1034
  }
1036
- function ao({
1035
+ function co({
1037
1036
  children: e,
1038
1037
  topBarHeight: t,
1039
1038
  maxWidth: o = !1,
1040
- noPadding: n
1039
+ noPadding: i
1041
1040
  }) {
1042
- return /* @__PURE__ */ i(
1043
- M,
1041
+ return /* @__PURE__ */ n(
1042
+ P,
1044
1043
  {
1045
1044
  sx: {
1046
1045
  overflow: "auto",
1047
1046
  height: `calc(100vh - ${t}px)`,
1048
1047
  flexGrow: 1
1049
1048
  },
1050
- children: n ? /* @__PURE__ */ i(M, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ i(
1051
- xt,
1049
+ children: i ? /* @__PURE__ */ n(P, { component: "main", id: "main-content", height: "inherit", children: e }) : /* @__PURE__ */ n(
1050
+ Ct,
1052
1051
  {
1053
1052
  component: "main",
1054
1053
  id: "main-content",
@@ -1060,18 +1059,18 @@ function ao({
1060
1059
  }
1061
1060
  );
1062
1061
  }
1063
- const lo = "TopBar", co = {
1064
- titleText: `${lo}-titleText`
1062
+ const uo = "TopBar", po = {
1063
+ titleText: `${uo}-titleText`
1065
1064
  };
1066
- function uo({
1065
+ function ho({
1067
1066
  titleText: e = "",
1068
1067
  height: t,
1069
1068
  "data-testid": o,
1070
- middle: n
1069
+ middle: i
1071
1070
  }) {
1072
- const s = Re(J), a = () => s((c) => !c), p = Z(), r = Xe();
1073
- return /* @__PURE__ */ i("header", { "data-testid": o, children: /* @__PURE__ */ m(
1074
- Me,
1071
+ const s = He(ee), a = () => s((l) => !l), u = oe(), r = Je();
1072
+ return /* @__PURE__ */ n("header", { "data-testid": o, children: /* @__PURE__ */ m(
1073
+ $e,
1075
1074
  {
1076
1075
  square: !0,
1077
1076
  elevation: 0,
@@ -1085,85 +1084,85 @@ function uo({
1085
1084
  gap: 2,
1086
1085
  flexShrink: 0,
1087
1086
  height: t,
1088
- zIndex: r ? 0 : p.zIndex.drawer + 101
1087
+ zIndex: r ? 0 : u.zIndex.drawer + 101
1089
1088
  },
1090
1089
  children: [
1091
- /* @__PURE__ */ i(
1092
- At,
1090
+ /* @__PURE__ */ n(
1091
+ St,
1093
1092
  {
1094
1093
  size: "medium",
1095
1094
  color: "inherit",
1096
1095
  sx: { padding: 1.5, marginLeft: "12px" },
1097
1096
  onClick: a,
1098
- children: /* @__PURE__ */ i(vt, { fontSize: "medium" })
1097
+ children: /* @__PURE__ */ n(Dt, { fontSize: "medium" })
1099
1098
  }
1100
1099
  ),
1101
- /* @__PURE__ */ i(_, { className: co.titleText, variant: "h6", component: "h1", children: e }),
1102
- n
1100
+ /* @__PURE__ */ n(I, { className: po.titleText, variant: "h6", component: "h1", children: e }),
1101
+ i
1103
1102
  ]
1104
1103
  }
1105
1104
  ) });
1106
1105
  }
1107
- function qo({
1106
+ function Go({
1108
1107
  children: e,
1109
1108
  initialTitleText: t,
1110
1109
  initialNavBarOpen: o,
1111
- pageContainerProps: n,
1110
+ pageContainerProps: i,
1112
1111
  pageContentDataTestId: s,
1113
1112
  topBarDataTestId: a,
1114
- navBarDataTestId: p,
1113
+ navBarDataTestId: u,
1115
1114
  navBarMiddle: r,
1116
- navBarBottom: c,
1117
- user: l,
1115
+ navBarBottom: l,
1116
+ user: c,
1118
1117
  domainCode: x,
1119
- useNewAvatar: C = !1
1118
+ useNewAvatar: A = !1
1120
1119
  }) {
1121
- Et([
1122
- [J, o != null ? o : !0],
1123
- [ye, t != null ? t : ""]
1120
+ It([
1121
+ [ee, o != null ? o : !0],
1122
+ [Ee, t != null ? t : ""]
1124
1123
  ]);
1125
- const v = Ae(J), [g] = W(Yt), [w] = W(Qt), D = Ae(ye), [f] = W(Zt), [k] = W(Jt), [y] = W(jt);
1126
- return /* @__PURE__ */ m(Ce, { children: [
1127
- /* @__PURE__ */ i(Ft, {}),
1128
- /* @__PURE__ */ i(
1129
- uo,
1124
+ const D = we(ee), [g] = W(Jt), [S] = W(Zt), y = we(Ee), [h] = W(eo), [k] = W(jt), [F] = W(to);
1125
+ return /* @__PURE__ */ m(ve, { children: [
1126
+ /* @__PURE__ */ n(_t, {}),
1127
+ /* @__PURE__ */ n(
1128
+ ho,
1130
1129
  {
1131
- titleText: D,
1130
+ titleText: y,
1132
1131
  "data-testid": a,
1133
- height: f,
1132
+ height: h,
1134
1133
  middle: k
1135
1134
  }
1136
1135
  ),
1137
- /* @__PURE__ */ m(Ce, { sx: { display: "flex" }, children: [
1138
- /* @__PURE__ */ i(
1139
- so,
1136
+ /* @__PURE__ */ m(ve, { sx: { display: "flex" }, children: [
1137
+ /* @__PURE__ */ n(
1138
+ lo,
1140
1139
  {
1141
- open: v,
1142
- top: y,
1140
+ open: D,
1141
+ top: F,
1143
1142
  middle: r,
1144
- bottom: c,
1145
- user: l,
1143
+ bottom: l,
1144
+ user: c,
1146
1145
  domainCode: x,
1147
1146
  widthOpen: g,
1148
- widthClosed: w,
1149
- offsetTop: f,
1150
- "data-testid": p,
1151
- useNewAvatar: C
1147
+ widthClosed: S,
1148
+ offsetTop: h,
1149
+ "data-testid": u,
1150
+ useNewAvatar: A
1152
1151
  }
1153
1152
  ),
1154
- /* @__PURE__ */ i(
1155
- ao,
1156
- F(u({
1153
+ /* @__PURE__ */ n(
1154
+ co,
1155
+ b(d({
1157
1156
  "data-testid": s,
1158
- topBarHeight: f
1159
- }, n), {
1157
+ topBarHeight: h
1158
+ }, i), {
1160
1159
  children: e
1161
1160
  })
1162
1161
  )
1163
1162
  ] })
1164
1163
  ] });
1165
1164
  }
1166
- const zo = Be({
1165
+ const Vo = ze({
1167
1166
  palette: {
1168
1167
  primary: {
1169
1168
  dark: "#00A651",
@@ -1214,7 +1213,7 @@ const zo = Be({
1214
1213
  navBar: {
1215
1214
  backgroundColor: "#E8E8E8"
1216
1215
  }
1217
- }), Go = Be({
1216
+ }), Ko = ze({
1218
1217
  palette: {
1219
1218
  primary: {
1220
1219
  main: "#007236",
@@ -1268,18 +1267,18 @@ const zo = Be({
1268
1267
  styleOverrides: {
1269
1268
  root: ({ theme: e }) => ({
1270
1269
  "&.Mui-selected": {
1271
- backgroundColor: oe(
1270
+ backgroundColor: se(
1272
1271
  e.palette.secondary.main,
1273
1272
  e.palette.action.selectedOpacity
1274
1273
  ),
1275
1274
  "&:hover": {
1276
- backgroundColor: oe(
1275
+ backgroundColor: se(
1277
1276
  e.palette.secondary.main,
1278
1277
  e.palette.action.selectedOpacity
1279
1278
  )
1280
1279
  },
1281
1280
  "&.Mui-focusVisible": {
1282
- backgroundColor: oe(
1281
+ backgroundColor: se(
1283
1282
  e.palette.secondary.main,
1284
1283
  e.palette.action.focusOpacity
1285
1284
  )
@@ -1310,39 +1309,39 @@ const zo = Be({
1310
1309
  }
1311
1310
  });
1312
1311
  export {
1313
- He as AgDialog,
1314
- qo as AppLayout,
1315
- To as AuthGuard,
1316
- ze as Context,
1317
- Ge as ContextError,
1318
- Gt as DOMAIN_CODE_LABELS,
1319
- Oo as DomainCodeDialog,
1320
- _o as ExampleComponent,
1321
- Mo as FetchAutocomplete,
1322
- Po as MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX,
1323
- Wt as SaladBarProvider,
1324
- $o as SessionExpiryDialog,
1325
- No as SingleAutocomplete,
1326
- Ro as determineUserLevelFromClaims,
1327
- zt as domainCodeAtom,
1328
- zo as fed21Theme,
1329
- _t as getAuth0Expiry,
1330
- Ke as getDomainOptionLabel,
1331
- Bo as getValidBusinessRoles,
1332
- Go as internalAgSystemsTheme,
1333
- J as navBarOpenAtom,
1334
- jt as navBarTopAtom,
1335
- Qt as navBarWidthClosedAtom,
1336
- Yt as navBarWidthOpenAtom,
1337
- io as simpleHashCode,
1338
- Ho as suppressConsole,
1339
- ye as titleTextAtom,
1340
- Zt as topBarHeightAtom,
1341
- Jt as topBarMiddleAtom,
1342
- Wo as unsuppressConsole,
1343
- qe as useAutocompleteOptions,
1344
- qt as useSaladBar,
1345
- Uo as useValidDomains,
1346
- Lo as withSaladBarProvider
1312
+ qe as AgDialog,
1313
+ Go as AppLayout,
1314
+ Oo as AuthGuard,
1315
+ Ke as Context,
1316
+ Xe as ContextError,
1317
+ Kt as DOMAIN_CODE_LABELS,
1318
+ Uo as DomainCodeDialog,
1319
+ To as ExampleComponent,
1320
+ No as FetchAutocomplete,
1321
+ $o as MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX,
1322
+ qt as SaladBarProvider,
1323
+ Lo as SessionExpiryDialog,
1324
+ Mo as SingleAutocomplete,
1325
+ Bo as determineUserLevelFromClaims,
1326
+ Vt as domainCodeAtom,
1327
+ Vo as fed21Theme,
1328
+ Tt as getAuth0Expiry,
1329
+ Qe as getDomainOptionLabel,
1330
+ Wo as getValidBusinessRoles,
1331
+ Ko as internalAgSystemsTheme,
1332
+ ee as navBarOpenAtom,
1333
+ to as navBarTopAtom,
1334
+ Zt as navBarWidthClosedAtom,
1335
+ Jt as navBarWidthOpenAtom,
1336
+ so as simpleHashCode,
1337
+ zo as suppressConsole,
1338
+ Ee as titleTextAtom,
1339
+ eo as topBarHeightAtom,
1340
+ jt as topBarMiddleAtom,
1341
+ qo as unsuppressConsole,
1342
+ Ve as useAutocompleteOptions,
1343
+ Gt as useSaladBar,
1344
+ Ho as useValidDomains,
1345
+ Ro as withSaladBarProvider
1347
1346
  };
1348
1347
  //# sourceMappingURL=index.js.map