@australiangreens/ag-internal-components 0.3.1 → 0.3.3

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