@australiangreens/ag-internal-components 0.3.1 → 0.3.2

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