@local-civics/mgmt-ui 0.1.62 → 0.1.64

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/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var notifications = require('@mantine/notifications');
4
- var icons = require('@tabler/icons');
5
3
  var React = require('react');
6
4
  var core = require('@mantine/core');
5
+ var icons = require('@tabler/icons');
6
+ var notifications = require('@mantine/notifications');
7
7
  var mantineDatatable = require('mantine-datatable');
8
8
  var dropzone = require('@mantine/dropzone');
9
9
  var form = require('@mantine/form');
@@ -31,7 +31,422 @@ function _interopNamespaceDefault(e) {
31
31
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
32
32
  var papa__namespace = /*#__PURE__*/_interopNamespaceDefault(papa);
33
33
 
34
+ const useStyles$j = core.createStyles((theme) => ({
35
+ link: {
36
+ width: 50,
37
+ height: 50,
38
+ borderRadius: theme.radius.md,
39
+ display: "flex",
40
+ alignItems: "center",
41
+ justifyContent: "center",
42
+ color: theme.colorScheme === "dark" ? theme.colors.dark[0] : theme.colors.gray[7],
43
+ "&:hover": {
44
+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[0]
45
+ }
46
+ },
47
+ active: {
48
+ "&, &:hover": {
49
+ backgroundColor: theme.fn.variant({ variant: "light", color: theme.primaryColor }).background,
50
+ color: theme.fn.variant({ variant: "light", color: theme.primaryColor }).color
51
+ }
52
+ }
53
+ }));
54
+ const data$1 = [
55
+ { icon: icons.IconHome2, label: "Home", href: "/home" },
56
+ { icon: icons.IconGauge, label: "Dashboard", href: "/dashboard" },
57
+ { icon: icons.IconCategory2, label: "Classes", href: "/classes" },
58
+ { icon: icons.IconAlbum, label: "Badges", href: "/badges" },
59
+ { icon: icons.IconLambda, label: "Lessons", href: "/lessons" }
60
+ ];
61
+ const NavbarLink = ({ icon: Icon, label, active, onClick }) => {
62
+ const { classes, cx } = useStyles$j();
63
+ return /* @__PURE__ */ React__namespace.createElement(core.Tooltip, { label, position: "right", transitionDuration: 0 }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick, className: cx(classes.link, { [classes.active]: active }) }, /* @__PURE__ */ React__namespace.createElement(Icon, { stroke: 1.5 })));
64
+ };
65
+ const Navbar = (props) => {
66
+ const links = data$1.map((link) => /* @__PURE__ */ React__namespace.createElement(
67
+ NavbarLink,
68
+ {
69
+ key: link.label,
70
+ label: link.label,
71
+ icon: link.icon,
72
+ active: link.label === props.active,
73
+ onClick: () => props.navigate(link.href)
74
+ }
75
+ ));
76
+ return /* @__PURE__ */ React__namespace.createElement(core.Navbar, { width: { base: 80 }, p: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Center, null, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { color: "blue", radius: "sm" }, /* @__PURE__ */ React__namespace.createElement("div", { style: { width: 15, marginLeft: "auto", marginRight: "auto" } }, /* @__PURE__ */ React__namespace.createElement(core.Image, { fit: "contain", src: "https://cdn.localcivics.io/brand/l.png" })))), /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { grow: true, mt: 50 }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { justify: "center", spacing: 0 }, links)), /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, null, /* @__PURE__ */ React__namespace.createElement(core.Stack, { justify: "center", spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
77
+ NavbarLink,
78
+ {
79
+ icon: icons.IconSwitchHorizontal,
80
+ label: "Switch accounts",
81
+ onClick: props.onSwitchAccounts
82
+ }
83
+ ), /* @__PURE__ */ React__namespace.createElement(
84
+ NavbarLink,
85
+ {
86
+ icon: icons.IconLogout,
87
+ label: "Logout",
88
+ onClick: props.onLogout
89
+ }
90
+ ))));
91
+ };
92
+
93
+ var __defProp$5 = Object.defineProperty;
94
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
95
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
96
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
97
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
98
+ var __spreadValues$5 = (a, b) => {
99
+ for (var prop in b || (b = {}))
100
+ if (__hasOwnProp$5.call(b, prop))
101
+ __defNormalProp$5(a, prop, b[prop]);
102
+ if (__getOwnPropSymbols$5)
103
+ for (var prop of __getOwnPropSymbols$5(b)) {
104
+ if (__propIsEnum$5.call(b, prop))
105
+ __defNormalProp$5(a, prop, b[prop]);
106
+ }
107
+ return a;
108
+ };
109
+ var __objRest$1 = (source, exclude) => {
110
+ var target = {};
111
+ for (var prop in source)
112
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
113
+ target[prop] = source[prop];
114
+ if (source != null && __getOwnPropSymbols$5)
115
+ for (var prop of __getOwnPropSymbols$5(source)) {
116
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
117
+ target[prop] = source[prop];
118
+ }
119
+ return target;
120
+ };
121
+ const useStyles$i = core.createStyles((theme) => ({
122
+ user: {
123
+ display: "block",
124
+ width: "100%",
125
+ padding: theme.spacing.md,
126
+ cursor: "default",
127
+ color: theme.colorScheme === "dark" ? theme.colors.dark[0] : theme.black
128
+ }
129
+ }));
130
+ function UserButton(_a) {
131
+ var _b = _a, { image, name, email, icon } = _b, others = __objRest$1(_b, ["image", "name", "email", "icon"]);
132
+ const { classes } = useStyles$i();
133
+ return /* @__PURE__ */ React__namespace.createElement(core.Group, __spreadValues$5({ className: classes.user }, others), /* @__PURE__ */ React__namespace.createElement(core.Avatar, { src: image, radius: "xl" }), /* @__PURE__ */ React__namespace.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, name), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", size: "xs" }, email)));
134
+ }
135
+
136
+ const compact = (num) => {
137
+ return Intl.NumberFormat("en-US", {
138
+ notation: "compact",
139
+ maximumFractionDigits: 1
140
+ }).format(num || 0);
141
+ };
142
+
143
+ const useStyles$h = core.createStyles((theme, _params, getRef) => {
144
+ const icon = getRef("icon");
145
+ return {
146
+ control: {
147
+ fontWeight: 500,
148
+ width: "100%",
149
+ padding: `${theme.spacing.xs}px ${theme.spacing.md}px`,
150
+ color: theme.colorScheme === "dark" ? theme.colors.dark[0] : theme.black,
151
+ fontSize: theme.fontSizes.sm,
152
+ "&:hover": {
153
+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.colors.gray[0],
154
+ color: theme.colorScheme === "dark" ? theme.white : theme.black
155
+ }
156
+ },
157
+ controlButton: {
158
+ cursor: "pointer"
159
+ },
160
+ badge: {
161
+ pointerEvents: "none"
162
+ },
163
+ link: {
164
+ fontWeight: 500,
165
+ display: "block",
166
+ textDecoration: "none",
167
+ padding: `${theme.spacing.xs}px ${theme.spacing.md}px`,
168
+ paddingLeft: 31,
169
+ marginLeft: 30,
170
+ fontSize: theme.fontSizes.sm,
171
+ color: theme.colorScheme === "dark" ? theme.colors.dark[0] : theme.colors.gray[7],
172
+ borderLeft: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[3]}`,
173
+ "&:hover": {
174
+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.colors.gray[0],
175
+ color: theme.colorScheme === "dark" ? theme.white : theme.black
176
+ }
177
+ },
178
+ linkActive: {
179
+ "&, &:hover": {
180
+ backgroundColor: theme.fn.variant({ variant: "light", color: theme.primaryColor }).background,
181
+ color: theme.fn.variant({ variant: "light", color: theme.primaryColor }).color,
182
+ [`& .${icon}`]: {
183
+ color: theme.fn.variant({ variant: "light", color: theme.primaryColor }).color
184
+ }
185
+ }
186
+ },
187
+ chevron: {
188
+ transition: "transform 200ms ease"
189
+ },
190
+ linkIcon: {
191
+ ref: icon
192
+ }
193
+ };
194
+ });
195
+ function LinksGroup({ icon: Icon, href, label, initiallyOpened, links, active, notifications }) {
196
+ const { classes, theme, cx } = useStyles$h();
197
+ const hasLinks = Array.isArray(links) && links.length > 0;
198
+ const hasActiveLinks = Array.isArray(links) && links.map((l) => !!active && active === `${label}/${l.label}`).reduce((a, b) => a || b, false);
199
+ const [opened, setOpened] = React.useState(initiallyOpened || hasActiveLinks || false);
200
+ React__namespace.useEffect(() => {
201
+ setOpened(hasActiveLinks);
202
+ }, [hasActiveLinks]);
203
+ const ChevronIcon = theme.dir === "ltr" ? icons.IconChevronRight : icons.IconChevronLeft;
204
+ const items = (hasLinks ? links : []).map((link) => {
205
+ return /* @__PURE__ */ React__namespace.createElement(
206
+ core.Box,
207
+ {
208
+ className: cx(classes.link, { [classes.linkActive]: !!active && active === `${label}/${link.label}` }),
209
+ key: link.label
210
+ },
211
+ /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart", spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(core.Text, { component: "a", href: link.href }, link.label), !!link.notifications && /* @__PURE__ */ React__namespace.createElement(core.Badge, { size: "sm", variant: "filled", className: classes.badge }, compact(link.notifications)))
212
+ );
213
+ });
214
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
215
+ core.Group,
216
+ {
217
+ className: cx(classes.control, {
218
+ [classes.linkActive]: !!active && !hasLinks && label === active,
219
+ [classes.controlButton]: hasLinks
220
+ }),
221
+ onClick: () => setOpened((o) => !o),
222
+ position: "apart",
223
+ spacing: 0
224
+ },
225
+ /* @__PURE__ */ React__namespace.createElement(core.Box, { sx: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React__namespace.createElement(core.ThemeIcon, { variant: "light", size: 30 }, /* @__PURE__ */ React__namespace.createElement(Icon, { className: classes.linkIcon, size: 18 })), /* @__PURE__ */ React__namespace.createElement(core.Box, { ml: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Text, { component: "a", href }, label))),
226
+ !!notifications && /* @__PURE__ */ React__namespace.createElement(core.Badge, { size: "sm", variant: "filled", className: classes.badge }, compact(notifications)),
227
+ hasLinks && /* @__PURE__ */ React__namespace.createElement(
228
+ ChevronIcon,
229
+ {
230
+ className: classes.chevron,
231
+ size: 14,
232
+ stroke: 1.5,
233
+ style: {
234
+ transform: opened ? `rotate(${theme.dir === "rtl" ? -90 : 90}deg)` : "none"
235
+ }
236
+ }
237
+ )
238
+ ), hasLinks ? /* @__PURE__ */ React__namespace.createElement(core.Collapse, { in: opened }, items) : null);
239
+ }
240
+
241
+ var __defProp$4 = Object.defineProperty;
242
+ var __defProps$2 = Object.defineProperties;
243
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
244
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
245
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
246
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
247
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
248
+ var __spreadValues$4 = (a, b) => {
249
+ for (var prop in b || (b = {}))
250
+ if (__hasOwnProp$4.call(b, prop))
251
+ __defNormalProp$4(a, prop, b[prop]);
252
+ if (__getOwnPropSymbols$4)
253
+ for (var prop of __getOwnPropSymbols$4(b)) {
254
+ if (__propIsEnum$4.call(b, prop))
255
+ __defNormalProp$4(a, prop, b[prop]);
256
+ }
257
+ return a;
258
+ };
259
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
260
+ const useStyles$g = core.createStyles((theme, _params, getRef) => {
261
+ const icon = getRef("icon");
262
+ return {
263
+ navbar: {
264
+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.white
265
+ },
266
+ navHeader: {
267
+ [`@media (max-width: ${theme.breakpoints.sm}px)`]: {
268
+ height: 71,
269
+ position: "absolute",
270
+ top: 0
271
+ }
272
+ },
273
+ navBody: {
274
+ [`@media (max-width: ${theme.breakpoints.sm}px)`]: {
275
+ display: "none"
276
+ }
277
+ },
278
+ burger: {
279
+ [theme.fn.largerThan("sm")]: {
280
+ display: "none"
281
+ }
282
+ },
283
+ header: {
284
+ padding: theme.spacing.md,
285
+ paddingTop: 0,
286
+ marginLeft: -theme.spacing.md,
287
+ marginRight: -theme.spacing.md,
288
+ color: theme.colorScheme === "dark" ? theme.white : theme.black,
289
+ borderBottom: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[3]}`
290
+ },
291
+ link: __spreadProps$2(__spreadValues$4({}, theme.fn.focusStyles()), {
292
+ display: "flex",
293
+ alignItems: "center",
294
+ textDecoration: "none",
295
+ fontSize: theme.fontSizes.sm,
296
+ color: theme.colorScheme === "dark" ? theme.colors.dark[1] : theme.colors.gray[7],
297
+ padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`,
298
+ borderRadius: theme.radius.sm,
299
+ fontWeight: 500,
300
+ "&:hover": {
301
+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0],
302
+ color: theme.colorScheme === "dark" ? theme.white : theme.black,
303
+ [`& .${icon}`]: {
304
+ color: theme.colorScheme === "dark" ? theme.white : theme.black
305
+ }
306
+ }
307
+ }),
308
+ linkIcon: {
309
+ ref: icon,
310
+ color: theme.colorScheme === "dark" ? theme.colors.dark[2] : theme.colors.gray[6],
311
+ marginRight: theme.spacing.sm
312
+ },
313
+ links: {
314
+ marginLeft: -theme.spacing.md,
315
+ marginRight: -theme.spacing.md
316
+ },
317
+ user: {
318
+ margin: theme.spacing.md,
319
+ marginLeft: 0,
320
+ marginRight: 0
321
+ },
322
+ linksInner: {
323
+ paddingBottom: theme.spacing.xl
324
+ },
325
+ footer: {
326
+ paddingTop: theme.spacing.md,
327
+ paddingBottom: theme.spacing.md,
328
+ borderTop: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[2]}`
329
+ },
330
+ active: {
331
+ "&, &:hover": {
332
+ backgroundColor: theme.fn.variant({ variant: "light", color: theme.primaryColor }).background,
333
+ color: theme.fn.variant({ variant: "light", color: theme.primaryColor }).color
334
+ }
335
+ }
336
+ };
337
+ });
338
+ const data = [
339
+ { label: "Home", icon: icons.IconHome2 },
340
+ { label: "Dashboard", icon: icons.IconGauge },
341
+ { label: "Classes", icon: icons.IconCategory2 },
342
+ { label: "Badges", icon: icons.IconAlbum },
343
+ { label: "Lessons", icon: icons.IconLambda },
344
+ {
345
+ label: "Organization",
346
+ icon: icons.IconBuilding,
347
+ links: [
348
+ { label: "Overview" },
349
+ { label: "People" }
350
+ ]
351
+ }
352
+ ];
353
+ function NestedNavbar(props) {
354
+ const { classes, cx } = useStyles$g();
355
+ const [burgerOpen, setBurgerOpen] = React__namespace.useState(false);
356
+ const toggle = () => setBurgerOpen(!burgerOpen);
357
+ const links = data.map((item) => {
358
+ const context = props.links[item.label] || { notifications: 0, href: "" };
359
+ if (context.hidden) {
360
+ return null;
361
+ }
362
+ return /* @__PURE__ */ React__namespace.createElement(
363
+ LinksGroup,
364
+ __spreadProps$2(__spreadValues$4(__spreadValues$4({
365
+ key: item.label,
366
+ active: props.active
367
+ }, item), context), {
368
+ links: (item.links || []).map((link) => {
369
+ return __spreadValues$4(__spreadValues$4({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
370
+ })
371
+ })
372
+ );
373
+ });
374
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Navbar, { width: { sm: 300 }, p: "md", className: cx(classes.navbar, { [classes.navHeader]: !burgerOpen }) }, /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { className: classes.header }, /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart" }, /* @__PURE__ */ React__namespace.createElement(core.Center, null, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { color: "blue", radius: "sm" }, /* @__PURE__ */ React__namespace.createElement("div", { style: { width: 15, marginLeft: "auto", marginRight: "auto" } }, /* @__PURE__ */ React__namespace.createElement(core.Image, { fit: "contain", src: "https://cdn.localcivics.io/brand/l.png" })))), /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart" }, /* @__PURE__ */ React__namespace.createElement(core.Code, { sx: { fontWeight: 700 } }, props.version), /* @__PURE__ */ React__namespace.createElement(core.Burger, { opened: burgerOpen, onClick: toggle, className: classes.burger, size: "sm" })))), /* @__PURE__ */ React__namespace.createElement("div", { className: cx({ [classes.navBody]: !burgerOpen }) }, /* @__PURE__ */ React__namespace.createElement(
375
+ UserButton,
376
+ {
377
+ className: classes.user,
378
+ image: props.image,
379
+ name: props.name,
380
+ email: props.email
381
+ }
382
+ ), /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { grow: true, className: classes.links, component: core.ScrollArea }, /* @__PURE__ */ React__namespace.createElement("div", { className: classes.linksInner }, links)), /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { className: classes.footer }, !!props.onSwitchAccounts && /* @__PURE__ */ React__namespace.createElement("a", { href: "#", className: classes.link, onClick: (event) => {
383
+ event.preventDefault();
384
+ props.onSwitchAccounts && props.onSwitchAccounts();
385
+ } }, /* @__PURE__ */ React__namespace.createElement(icons.IconSwitchHorizontal, { className: classes.linkIcon, stroke: 1.5 }), /* @__PURE__ */ React__namespace.createElement("span", null, "Change account")), /* @__PURE__ */ React__namespace.createElement("a", { href: "#", className: classes.link, onClick: (event) => {
386
+ event.preventDefault();
387
+ props.onLogout();
388
+ } }, /* @__PURE__ */ React__namespace.createElement(icons.IconLogout, { className: classes.linkIcon, stroke: 1.5 }), /* @__PURE__ */ React__namespace.createElement("span", null, "Logout"))))));
389
+ }
390
+
34
391
  const useStyles$f = core.createStyles((theme) => ({
392
+ title: {
393
+ fontSize: 34,
394
+ fontWeight: 900,
395
+ [theme.fn.smallerThan("sm")]: {
396
+ fontSize: 24
397
+ }
398
+ },
399
+ description: {
400
+ maxWidth: 600,
401
+ margin: "auto",
402
+ "&::after": {
403
+ content: '""',
404
+ display: "block",
405
+ backgroundColor: theme.fn.primaryColor(),
406
+ width: 45,
407
+ height: 2,
408
+ marginTop: theme.spacing.sm,
409
+ marginLeft: "auto",
410
+ marginRight: "auto"
411
+ }
412
+ },
413
+ card: {
414
+ transition: "box-shadow 150ms ease, transform 100ms ease",
415
+ "&:hover": {
416
+ boxShadow: `${theme.shadows.md} !important`,
417
+ transform: "scale(1.05)"
418
+ }
419
+ },
420
+ cardTitle: {
421
+ "&::after": {
422
+ content: '""',
423
+ display: "block",
424
+ backgroundColor: theme.fn.primaryColor(),
425
+ width: 45,
426
+ height: 2,
427
+ marginTop: theme.spacing.sm
428
+ }
429
+ }
430
+ }));
431
+ const SwitchAccount = (props) => {
432
+ const { classes, theme } = useStyles$f();
433
+ const options = props.accounts.map((a) => {
434
+ return /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: () => props.onClick && props.onClick(a.accountId), key: a.accountId, p: theme.spacing.md }, /* @__PURE__ */ React__namespace.createElement(core.Card, { withBorder: true, shadow: "md", radius: "md", className: classes.card, p: "xl" }, a.isAdmin && /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(icons.IconBatteryEco, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), a.isGroupAdmin && !a.isAdmin && /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(icons.IconBooks, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), !a.isAdmin && !a.isGroupAdmin && /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(icons.IconBackpack, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "lg", weight: 500, className: classes.cardTitle, mt: "md" }, a.name), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", color: "dimmed", mt: "sm" }, a.isAdmin ? "Admin" : a.isGroupAdmin ? "Educator" : "Student")));
435
+ });
436
+ return /* @__PURE__ */ React__namespace.createElement(
437
+ core.Modal,
438
+ {
439
+ centered: true,
440
+ fullScreen: true,
441
+ opened: props.opened,
442
+ onClose: () => props.onClose && props.onClose(),
443
+ size: "sm"
444
+ },
445
+ /* @__PURE__ */ React__namespace.createElement("div", { style: { position: "relative" } }, props.loading && /* @__PURE__ */ React__namespace.createElement(core.Center, { style: { height: 400 } }, /* @__PURE__ */ React__namespace.createElement(core.Loader, null)), !props.loading && /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.SimpleGrid, { cols: 3, spacing: "xl", breakpoints: [{ maxWidth: "md", cols: 1 }] }, options)))
446
+ );
447
+ };
448
+
449
+ const useStyles$e = core.createStyles((theme) => ({
35
450
  root: {
36
451
  display: "flex",
37
452
  backgroundImage: `linear-gradient(-60deg, ${theme.colors[theme.primaryColor][4]} 0%, ${theme.colors[theme.primaryColor][7]} 100%)`,
@@ -78,7 +493,7 @@ const useStyles$f = core.createStyles((theme) => ({
78
493
  }
79
494
  }));
80
495
  const StatsGroup = ({ data }) => {
81
- const { classes } = useStyles$f();
496
+ const { classes } = useStyles$e();
82
497
  const stats = data.map((stat) => {
83
498
  const value = (() => {
84
499
  if (stat.unit === "%") {
@@ -97,7 +512,7 @@ const Tabs = (props) => {
97
512
  return /* @__PURE__ */ React__namespace.createElement(core.Tabs, { value: props.value, onTabChange: props.onChange }, /* @__PURE__ */ React__namespace.createElement(core.Tabs.List, null, tabs));
98
513
  };
99
514
 
100
- const useStyles$e = core.createStyles((theme) => ({
515
+ const useStyles$d = core.createStyles((theme) => ({
101
516
  button: {
102
517
  borderTopRightRadius: 0,
103
518
  borderBottomRightRadius: 0,
@@ -112,14 +527,15 @@ const useStyles$e = core.createStyles((theme) => ({
112
527
  }
113
528
  }));
114
529
  const SplitButton$2 = (props) => {
115
- const { classes, theme } = useStyles$e();
530
+ const { classes, theme } = useStyles$d();
116
531
  const menuIconColor = theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
117
532
  return /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
118
533
  core.Button,
119
534
  {
535
+ component: "a",
536
+ href: props.href,
120
537
  className: classes.button,
121
- variant: "gradient",
122
- onClick: props.onPreviewClick
538
+ variant: "gradient"
123
539
  },
124
540
  "Preview"
125
541
  ), /* @__PURE__ */ React__namespace.createElement(core.Menu, { transition: "pop", position: "bottom-end" }, /* @__PURE__ */ React__namespace.createElement(core.Menu.Target, null, /* @__PURE__ */ React__namespace.createElement(
@@ -148,7 +564,7 @@ const SplitButton$2 = (props) => {
148
564
  ))));
149
565
  };
150
566
 
151
- const useStyles$d = core.createStyles((theme) => ({
567
+ const useStyles$c = core.createStyles((theme) => ({
152
568
  wrapper: {
153
569
  display: "flex",
154
570
  alignItems: "center",
@@ -199,7 +615,7 @@ const useStyles$d = core.createStyles((theme) => ({
199
615
  }
200
616
  }));
201
617
  const PlaceholderBanner = (props) => {
202
- const { classes } = useStyles$d();
618
+ const { classes } = useStyles$c();
203
619
  const title = props.title || "Nothing to display";
204
620
  const description = props.description || "We don't have anything to show you here just yet. Add data, check back later, or adjust your search.";
205
621
  return /* @__PURE__ */ React__namespace.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React__namespace.createElement("div", { className: classes.body }, /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, props.loading ? "Loading..." : title), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", color: "dimmed" }, props.loading ? "Hold on, we're loading your data." : description)), /* @__PURE__ */ React__namespace.createElement(core.Image, { src: `https://cdn.localcivics.io/illustrations/${props.icon}.svg`, className: classes.image }));
@@ -209,7 +625,7 @@ function Stack$2(props) {
209
625
  if (props.items.length === 0) {
210
626
  return null;
211
627
  }
212
- const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 6 }, /* @__PURE__ */ React__namespace.createElement(core.Title, { color: "dark.4", size: "lg" }, row.lessonName)), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 6 }, row.completion >= 1 && /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled" }, "Complete"), row.completion === 0 && !row.isStarted && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "red", variant: "filled" }, "Not started"), row.completion > 0 && row.completion < 1 && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "violet", variant: "filled" }, Math.round((row.completion + Number.EPSILON) * 100), "% Complete"))));
628
+ const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 6 }, /* @__PURE__ */ React__namespace.createElement(core.Text, { component: "a", href: row.href, color: "dark.4", weight: "bold", size: "md" }, row.lessonName)), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 6 }, row.completion >= 1 && /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled" }, "Complete"), row.completion === 0 && !row.isStarted && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "red", variant: "filled" }, "Not started"), row.completion > 0 && row.completion < 1 && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "violet", variant: "filled" }, Math.round((row.completion + Number.EPSILON) * 100), "% Complete"))));
213
629
  return /* @__PURE__ */ React__namespace.createElement(core.Grid, { grow: true, gutter: "lg", sx: { padding: 20, minWidth: 700 } }, rows);
214
630
  }
215
631
 
@@ -225,7 +641,7 @@ function Table$f(props) {
225
641
  }
226
642
  );
227
643
  }
228
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(
644
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(
229
645
  mantineDatatable.DataTable,
230
646
  {
231
647
  verticalSpacing: "sm",
@@ -240,7 +656,7 @@ function Table$f(props) {
240
656
  columns: [{
241
657
  accessor: "name",
242
658
  title: "Student Name",
243
- render: (row) => /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, null, /* @__PURE__ */ React__namespace.createElement(core.Group, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, row.name), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xs", color: "dimmed" }, row.email))))
659
+ render: (row) => /* @__PURE__ */ React__namespace.createElement(core.Group, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, row.name), /* @__PURE__ */ React__namespace.createElement(core.Text, { component: "a", size: "xs", color: "dimmed" }, row.email)))
244
660
  }, {
245
661
  accessor: "status",
246
662
  render: (row) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, !!row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled" }, "Complete"), !row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "red", variant: "filled" }, "Incomplete"))
@@ -266,12 +682,12 @@ function Table$e(props) {
266
682
  }
267
683
  const rows = props.items.map((row) => {
268
684
  const percentageCompletion = Math.round((row.percentageCompletion + Number.EPSILON) * 100);
269
- return /* @__PURE__ */ React__namespace.createElement("tr", { key: row.lessonName }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: () => props.onClick && props.onClick(row) }, row.lessonName)), /* @__PURE__ */ React__namespace.createElement("td", null, percentageCompletion, "%"));
685
+ return /* @__PURE__ */ React__namespace.createElement("tr", { key: row.lessonName }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { href: row.href, component: "a" }, row.lessonName)), /* @__PURE__ */ React__namespace.createElement("td", null, percentageCompletion, "%"));
270
686
  });
271
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Completion"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
687
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Completion"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
272
688
  }
273
689
 
274
- const useStyles$c = core.createStyles((theme) => ({
690
+ const useStyles$b = core.createStyles((theme) => ({
275
691
  title: {
276
692
  fontSize: 34,
277
693
  fontWeight: 900,
@@ -284,22 +700,22 @@ const useStyles$c = core.createStyles((theme) => ({
284
700
  }
285
701
  }));
286
702
  const Badge = (props) => {
287
- const { classes } = useStyles$c();
703
+ const { classes } = useStyles$b();
288
704
  const [tab, setTab] = React.useState("lessons");
289
705
  const numberOfStudents = props.students.length;
290
706
  const percentageOfBadgesEarned = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length / numberOfStudents : 0;
291
- return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(
707
+ return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: props.onBackClick }, /* @__PURE__ */ React__namespace.createElement(
292
708
  core.Badge,
293
709
  {
294
710
  variant: "filled",
295
- leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { onClick: props.onBackClick, color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
711
+ leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
296
712
  size: "lg"
297
713
  },
298
714
  "Badges"
299
- ), /* @__PURE__ */ React__namespace.createElement(core.Group, null, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, props.displayName || "Badge"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, props.description || "No description")), /* @__PURE__ */ React__namespace.createElement(core.Stack, { ml: "auto" }, /* @__PURE__ */ React__namespace.createElement(
715
+ )), /* @__PURE__ */ React__namespace.createElement(core.Group, null, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, props.displayName || "Badge"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, props.description || "No description")), /* @__PURE__ */ React__namespace.createElement(core.Stack, { ml: "auto" }, /* @__PURE__ */ React__namespace.createElement(
300
716
  SplitButton$2,
301
717
  {
302
- onPreviewClick: props.onPreviewClick,
718
+ href: props.href,
303
719
  onCopyLinkClick: props.onCopyLinkClick,
304
720
  onExportDataClick: props.onExportDataClick
305
721
  }
@@ -338,15 +754,13 @@ const Badge = (props) => {
338
754
  Table$e,
339
755
  {
340
756
  loading: props.loading,
341
- items: props.lessons,
342
- onClick: props.onLessonClick
757
+ items: props.lessons
343
758
  }
344
759
  ), tab === "students" && /* @__PURE__ */ React__namespace.createElement(
345
760
  Table$f,
346
761
  {
347
762
  loading: props.loading,
348
- items: props.students,
349
- onClick: props.onUserClick
763
+ items: props.students
350
764
  }
351
765
  )))))));
352
766
  };
@@ -366,6 +780,8 @@ function Table$d(props) {
366
780
  const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.badgeId }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(
367
781
  core.UnstyledButton,
368
782
  {
783
+ component: "a",
784
+ href: row.href,
369
785
  sx: (theme) => ({
370
786
  display: "block",
371
787
  width: "100%",
@@ -374,15 +790,14 @@ function Table$d(props) {
374
790
  "&:hover": {
375
791
  backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[8] : theme.colors.gray[1]
376
792
  }
377
- }),
378
- onClick: () => props.onClick && props.onClick(row)
793
+ })
379
794
  },
380
795
  /* @__PURE__ */ React__namespace.createElement(core.Group, null, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, row.name), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xs", color: "dimmed" }, row.description)))
381
796
  ))));
382
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { horizontalSpacing: 0, verticalSpacing: 0, sx: { minWidth: 700 } }, /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
797
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { horizontalSpacing: 0, verticalSpacing: 0, sx: { minWidth: 700 } }, /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
383
798
  }
384
799
 
385
- const useStyles$b = core.createStyles((theme) => ({
800
+ const useStyles$a = core.createStyles((theme) => ({
386
801
  title: {
387
802
  fontSize: 34,
388
803
  fontWeight: 900,
@@ -395,7 +810,7 @@ const useStyles$b = core.createStyles((theme) => ({
395
810
  }
396
811
  }));
397
812
  const Badges = (props) => {
398
- const { classes } = useStyles$b();
813
+ const { classes } = useStyles$a();
399
814
  return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled", size: "lg" }, "Badges"), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, "Badges and micro-credentials"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, "Project-sized skills acquisition and standards alignment."))), /* @__PURE__ */ React__namespace.createElement(
400
815
  core.Autocomplete,
401
816
  {
@@ -407,8 +822,7 @@ const Badges = (props) => {
407
822
  Table$d,
408
823
  {
409
824
  loading: props.loading,
410
- items: props.badges,
411
- onClick: props.onBadgeClick
825
+ items: props.badges
412
826
  }
413
827
  ))));
414
828
  };
@@ -426,7 +840,7 @@ function Table$c(props) {
426
840
  );
427
841
  }
428
842
  const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.studentName }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: () => props.onViewProfile(row) }, row.studentName)), /* @__PURE__ */ React__namespace.createElement("td", null, row.className)));
429
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Student Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Class Name"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
843
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Student Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Class Name"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
430
844
  }
431
845
 
432
846
  const units = [
@@ -466,7 +880,7 @@ function Table$b(props) {
466
880
  );
467
881
  }
468
882
  const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.studentName + row.lessonName }, /* @__PURE__ */ React__namespace.createElement("td", null, row.studentName), /* @__PURE__ */ React__namespace.createElement("td", null, row.lessonName), /* @__PURE__ */ React__namespace.createElement("td", null, row.reflection), /* @__PURE__ */ React__namespace.createElement("td", null, relativeTimeFromDates(new Date(row.updatedAt)))));
469
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Student Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Reflection"), /* @__PURE__ */ React__namespace.createElement("th", null, "Updated At"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
883
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Student Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Reflection"), /* @__PURE__ */ React__namespace.createElement("th", null, "Updated At"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
470
884
  }
471
885
 
472
886
  function Table$a(props) {
@@ -482,7 +896,7 @@ function Table$a(props) {
482
896
  );
483
897
  }
484
898
  const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.studentName }, /* @__PURE__ */ React__namespace.createElement("td", null, row.studentName), /* @__PURE__ */ React__namespace.createElement("td", null, row.impactStatement)));
485
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Student Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Impact Statement"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
899
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Student Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Impact Statement"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
486
900
  }
487
901
 
488
902
  function Table$9(props) {
@@ -498,7 +912,7 @@ function Table$9(props) {
498
912
  );
499
913
  }
500
914
  const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.badgeId }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: () => props.onClick && props.onClick(row) }, row.name)), /* @__PURE__ */ React__namespace.createElement("td", null, row.description), /* @__PURE__ */ React__namespace.createElement("td", null, Math.round((row.percentageCompletion + Number.EPSILON) * 100), "%")));
501
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Badge Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Description"), /* @__PURE__ */ React__namespace.createElement("th", null, "Completion"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
915
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Badge Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Description"), /* @__PURE__ */ React__namespace.createElement("th", null, "Completion"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
502
916
  }
503
917
 
504
918
  function Table$8(props) {
@@ -514,7 +928,7 @@ function Table$8(props) {
514
928
  );
515
929
  }
516
930
  const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.lessonId }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: () => props.onClick && props.onClick(row) }, row.name)), /* @__PURE__ */ React__namespace.createElement("td", null, row.description), /* @__PURE__ */ React__namespace.createElement("td", null, Math.round((row.percentageCompletion + Number.EPSILON) * 100), "%")));
517
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Description"), /* @__PURE__ */ React__namespace.createElement("th", null, "Completion"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
931
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Description"), /* @__PURE__ */ React__namespace.createElement("th", null, "Completion"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
518
932
  }
519
933
 
520
934
  const Dashboard = (props) => {
@@ -603,7 +1017,7 @@ const Dashboard = (props) => {
603
1017
  )))))));
604
1018
  };
605
1019
 
606
- const useStyles$a = core.createStyles((theme) => ({
1020
+ const useStyles$9 = core.createStyles((theme) => ({
607
1021
  button: {
608
1022
  borderTopRightRadius: 0,
609
1023
  borderBottomRightRadius: 0,
@@ -618,7 +1032,7 @@ const useStyles$a = core.createStyles((theme) => ({
618
1032
  }
619
1033
  }));
620
1034
  const SplitButton$1 = (props) => {
621
- const { classes, theme } = useStyles$a();
1035
+ const { classes, theme } = useStyles$9();
622
1036
  const menuIconColor = theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
623
1037
  const hasMenu = !!props.withClassLink;
624
1038
  return /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
@@ -626,9 +1040,9 @@ const SplitButton$1 = (props) => {
626
1040
  {
627
1041
  className: hasMenu ? classes.button : "",
628
1042
  leftIcon: /* @__PURE__ */ React__namespace.createElement(icons.IconPlaylistAdd, { size: 14 }),
629
- onClick: props.onAddStudentsClick
1043
+ onClick: props.onAddMembersClick
630
1044
  },
631
- "Add students"
1045
+ "Add members"
632
1046
  ), hasMenu && /* @__PURE__ */ React__namespace.createElement(core.Menu, { transition: "pop", position: "bottom-end" }, /* @__PURE__ */ React__namespace.createElement(core.Menu.Target, null, /* @__PURE__ */ React__namespace.createElement(
633
1047
  core.ActionIcon,
634
1048
  {
@@ -653,7 +1067,7 @@ function Table$7(props) {
653
1067
  return /* @__PURE__ */ React__namespace.createElement(
654
1068
  PlaceholderBanner,
655
1069
  {
656
- title: "No students to display",
1070
+ title: "No members to display",
657
1071
  description: "You have not rostered any students yet.",
658
1072
  loading: props.loading,
659
1073
  icon: "groups"
@@ -668,13 +1082,21 @@ function Table$7(props) {
668
1082
  confirmProps: { color: "red" },
669
1083
  onConfirm: () => props.onDelete && props.onDelete(student)
670
1084
  });
671
- const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.email }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: () => props.onViewProfile && props.onViewProfile(row) }, /* @__PURE__ */ React__namespace.createElement(core.Group, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, row.givenName && row.familyName ? `${row.givenName} ${row.familyName}` : row.email), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xs", color: "dimmed" }, row.email))))), /* @__PURE__ */ React__namespace.createElement("td", null, row.badgesEarned), /* @__PURE__ */ React__namespace.createElement("td", null, row.lessonsCompleted), /* @__PURE__ */ React__namespace.createElement("td", null, row.hasAccount && /* @__PURE__ */ React__namespace.createElement(icons.IconCheck, { color: "green" })), /* @__PURE__ */ React__namespace.createElement("td", null, row.lastActivity ? relativeTimeFromDates(row.lastActivity) : ""), /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0, position: "right" }, !row.readonly && !!props.onDelete && /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "red" }, /* @__PURE__ */ React__namespace.createElement(icons.IconTrash, { onClick: () => openDeleteModal(row), size: 16, stroke: 1.5 }))))));
672
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea, null, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Student Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Badges Earned"), /* @__PURE__ */ React__namespace.createElement("th", null, "Lessons Completed"), /* @__PURE__ */ React__namespace.createElement("th", null, "Account Created?"), /* @__PURE__ */ React__namespace.createElement("th", null, "Last Active"), /* @__PURE__ */ React__namespace.createElement("th", null))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1085
+ const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.email }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { component: "a", href: row.href }, /* @__PURE__ */ React__namespace.createElement(core.Group, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, row.givenName && row.familyName ? `${row.givenName} ${row.familyName}` : row.email), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xs", color: "dimmed" }, row.email))))), /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Box, { maw: 100 }, /* @__PURE__ */ React__namespace.createElement(
1086
+ core.Select,
1087
+ {
1088
+ size: "sm",
1089
+ value: row.isAdmin ? "admin" : "member",
1090
+ onChange: (value) => props.onRoleChange && props.onRoleChange(row, value),
1091
+ data: [{ value: "member", label: "Member" }, { value: "admin", label: "Admin" }]
1092
+ }
1093
+ ))), /* @__PURE__ */ React__namespace.createElement("td", null, row.badgesEarned), /* @__PURE__ */ React__namespace.createElement("td", null, row.lessonsCompleted), /* @__PURE__ */ React__namespace.createElement("td", null, row.hasAccount && /* @__PURE__ */ React__namespace.createElement(icons.IconCheck, { color: "green" })), /* @__PURE__ */ React__namespace.createElement("td", null, row.lastActivity ? relativeTimeFromDates(row.lastActivity) : ""), /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0, position: "right" }, !row.readonly && !!props.onDelete && /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "red" }, /* @__PURE__ */ React__namespace.createElement(icons.IconTrash, { onClick: () => openDeleteModal(row), size: 16, stroke: 1.5 }))))));
1094
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea, null, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Role"), /* @__PURE__ */ React__namespace.createElement("th", null, "Badges Earned"), /* @__PURE__ */ React__namespace.createElement("th", null, "Lessons Completed"), /* @__PURE__ */ React__namespace.createElement("th", null, "Account Created?"), /* @__PURE__ */ React__namespace.createElement("th", null, "Last Active"), /* @__PURE__ */ React__namespace.createElement("th", null))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
673
1095
  }
674
1096
 
675
1097
  var __defProp$3 = Object.defineProperty;
676
- var __defProps = Object.defineProperties;
677
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
1098
+ var __defProps$1 = Object.defineProperties;
1099
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
678
1100
  var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
679
1101
  var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
680
1102
  var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
@@ -690,8 +1112,8 @@ var __spreadValues$3 = (a, b) => {
690
1112
  }
691
1113
  return a;
692
1114
  };
693
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
694
- const useStyles$9 = core.createStyles((theme) => ({
1115
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1116
+ const useStyles$8 = core.createStyles((theme) => ({
695
1117
  title: {
696
1118
  fontSize: 34,
697
1119
  fontWeight: 900,
@@ -702,6 +1124,9 @@ const useStyles$9 = core.createStyles((theme) => ({
702
1124
  description: {
703
1125
  maxWidth: 600
704
1126
  },
1127
+ autocomplete: {
1128
+ maxWidth: 400
1129
+ },
705
1130
  wrapper: {
706
1131
  position: "relative",
707
1132
  marginBottom: 30
@@ -721,11 +1146,11 @@ const useStyles$9 = core.createStyles((theme) => ({
721
1146
  }
722
1147
  }));
723
1148
  const Class = (props) => {
724
- const { classes } = useStyles$9();
1149
+ const { classes } = useStyles$8();
725
1150
  const form$1 = form.useForm({
726
1151
  initialValues: {
727
1152
  classId: "",
728
- studentId: "",
1153
+ userId: "",
729
1154
  email: "",
730
1155
  givenName: "",
731
1156
  familyName: "",
@@ -735,10 +1160,12 @@ const Class = (props) => {
735
1160
  lastActivity: null,
736
1161
  hasAccount: false,
737
1162
  lessonsCompleted: 0,
738
- badgesEarned: 0
1163
+ badgesEarned: 0,
1164
+ href: "",
1165
+ isAdmin: false
739
1166
  },
740
1167
  validate: {
741
- email: (value) => /^\S+@\S+$/.test(value) && props.students.filter((u) => u.email === value).length === 0 ? null : "Invalid email"
1168
+ email: (value) => /^\S+@\S+$/.test(value) && props.members.filter((u) => u.email === value).length === 0 ? null : "Invalid email"
742
1169
  }
743
1170
  });
744
1171
  const [opened, setOpened] = React.useState(false);
@@ -747,15 +1174,15 @@ const Class = (props) => {
747
1174
  {
748
1175
  opened,
749
1176
  onClose: () => setOpened(false),
750
- title: /* @__PURE__ */ React__namespace.createElement(core.Title, { size: "h5" }, "Add students"),
1177
+ title: /* @__PURE__ */ React__namespace.createElement(core.Title, { size: "h5" }, "Add members"),
751
1178
  padding: "xl",
752
1179
  size: "xl"
753
1180
  },
754
- /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton, __spreadProps(__spreadValues$3({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React__namespace.createElement(core.Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React__namespace.createElement("form", { onSubmit: form$1.onSubmit(() => {
1181
+ /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton, __spreadProps$1(__spreadValues$3({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React__namespace.createElement(core.Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React__namespace.createElement("form", { onSubmit: form$1.onSubmit(() => {
755
1182
  const values = form$1.values;
756
1183
  form$1.reset();
757
1184
  setOpened(false);
758
- props.onCreateStudents && props.onCreateStudents([values]);
1185
+ props.onCreateMembers && props.onCreateMembers([values]);
759
1186
  }) }, /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(
760
1187
  core.TextInput,
761
1188
  __spreadValues$3({
@@ -776,25 +1203,25 @@ const Class = (props) => {
776
1203
  placeholder: "Family name"
777
1204
  }, form$1.getInputProps("familyName"))
778
1205
  )), /* @__PURE__ */ React__namespace.createElement(core.Button, { type: "submit", fullWidth: true, mt: "md" }, "Submit"))))
779
- ), /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(
1206
+ ), /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: props.onBackClick }, /* @__PURE__ */ React__namespace.createElement(
780
1207
  core.Badge,
781
1208
  {
782
1209
  variant: "filled",
783
- leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { onClick: props.onBackClick, color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
1210
+ leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
784
1211
  size: "lg"
785
1212
  },
786
1213
  "Classes"
787
- ), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, props.displayName || "Class"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, props.description || "No description")), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "content" }, !props.loading && /* @__PURE__ */ React__namespace.createElement(
1214
+ )), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, props.displayName || "Class"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, props.description || "No description")), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "content" }, !props.loading && /* @__PURE__ */ React__namespace.createElement(
788
1215
  SplitButton$1,
789
1216
  {
790
1217
  withClassLink: props.withClassLink,
791
- onAddStudentsClick: () => setOpened(true),
1218
+ onAddMembersClick: () => setOpened(true),
792
1219
  onCopyClassLinkClick: props.onCopyLinkClick
793
1220
  }
794
1221
  ))), /* @__PURE__ */ React__namespace.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ React__namespace.createElement(core.LoadingOverlay, { visible: props.loading, overlayBlur: 2 }), /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(StatsGroup, { data: [
795
1222
  {
796
1223
  title: "# OF STUDENTS",
797
- value: props.students.length
1224
+ value: props.members.length
798
1225
  },
799
1226
  {
800
1227
  title: "ACCOUNT CREATION",
@@ -813,14 +1240,14 @@ const Class = (props) => {
813
1240
  Table$7,
814
1241
  {
815
1242
  loading: props.loading,
816
- items: props.students,
817
- onDelete: props.onDeleteStudent,
818
- onViewProfile: (student) => props.onStudentClick(student)
1243
+ items: props.members,
1244
+ onDelete: props.onDeleteMember,
1245
+ onRoleChange: props.onChangeUserRole
819
1246
  }
820
1247
  ))))));
821
1248
  };
822
1249
  const DropzoneButton = (props) => {
823
- const { classes, theme } = useStyles$9();
1250
+ const { classes, theme } = useStyles$8();
824
1251
  const openRef = React__namespace.useRef(null);
825
1252
  const [loading, setLoading] = React__namespace.useState(false);
826
1253
  const onDrop = React__namespace.useCallback((acceptedFiles) => {
@@ -833,8 +1260,8 @@ const DropzoneButton = (props) => {
833
1260
  skipEmptyLines: true,
834
1261
  worker: true,
835
1262
  complete: function(results) {
836
- const data = results.data.filter((v) => /^\S+@\S+$/.test(v.email) && props.students.filter((u) => u.email === v.email).length === 0);
837
- data.length > 0 && props.onCreateStudents && props.onCreateStudents(data);
1263
+ const data = results.data.filter((v) => /^\S+@\S+$/.test(v.email) && props.members.filter((u) => u.email === v.email).length === 0);
1264
+ data.length > 0 && props.onCreateMembers && props.onCreateMembers(data);
838
1265
  setLoading(false);
839
1266
  props.close();
840
1267
  }
@@ -886,8 +1313,8 @@ function Table$6(props) {
886
1313
  confirmProps: { color: "red" },
887
1314
  onConfirm: () => props.onDeleteClass(group)
888
1315
  });
889
- const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.classId }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: () => props.onClick(row) }, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14 }, row.name))), /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14 }, row.description)), /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0, position: "right" }, /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "red" }, /* @__PURE__ */ React__namespace.createElement(icons.IconTrash, { onClick: () => openDeleteModal(row), size: 16, stroke: 1.5 }))))));
890
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 300 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Class Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Description"), /* @__PURE__ */ React__namespace.createElement("th", null))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1316
+ const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.classId }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { component: "a", href: row.href }, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14 }, row.name))), /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14 }, row.description)), /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14 }, row.numberOfStudents || 0)), /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0, position: "right" }, /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "red" }, /* @__PURE__ */ React__namespace.createElement(icons.IconTrash, { onClick: () => openDeleteModal(row), size: 16, stroke: 1.5 }))))));
1317
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Class Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Description"), /* @__PURE__ */ React__namespace.createElement("th", null, "# of Students"), /* @__PURE__ */ React__namespace.createElement("th", null))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
891
1318
  }
892
1319
 
893
1320
  var __defProp$2 = Object.defineProperty;
@@ -906,7 +1333,7 @@ var __spreadValues$2 = (a, b) => {
906
1333
  }
907
1334
  return a;
908
1335
  };
909
- const useStyles$8 = core.createStyles((theme) => ({
1336
+ const useStyles$7 = core.createStyles((theme) => ({
910
1337
  title: {
911
1338
  fontSize: 34,
912
1339
  fontWeight: 900,
@@ -919,12 +1346,14 @@ const useStyles$8 = core.createStyles((theme) => ({
919
1346
  }
920
1347
  }));
921
1348
  const Classes = (props) => {
922
- const { classes } = useStyles$8();
1349
+ const { classes } = useStyles$7();
923
1350
  const form$1 = form.useForm({
924
1351
  initialValues: {
925
1352
  classId: "",
926
1353
  name: "",
927
- description: ""
1354
+ description: "",
1355
+ href: "",
1356
+ numberOfStudents: 0
928
1357
  },
929
1358
  validate: {
930
1359
  name: (val) => val.length <= 6 ? "Name should include at least 6 characters" : null
@@ -959,7 +1388,7 @@ const Classes = (props) => {
959
1388
  placeholder: "A class for my first period English students"
960
1389
  }, form$1.getInputProps("description"))
961
1390
  )), /* @__PURE__ */ React__namespace.createElement(core.Button, { type: "submit", fullWidth: true, mt: "md" }, "Submit"))
962
- ), /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled", size: "lg" }, "Classes"), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, "Organize students into classes"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, "A class can be for a specific period of time, grade, team, or other cohorts.")), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "content" }, !props.loading && /* @__PURE__ */ React__namespace.createElement(
1391
+ ), /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled", size: "lg" }, "Classes"), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, "Organize people into classes"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, "A class can be for a specific period of time, grade, team, or other cohorts.")), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "content" }, !props.loading && /* @__PURE__ */ React__namespace.createElement(
963
1392
  core.Button,
964
1393
  {
965
1394
  onClick: () => setOpened(true),
@@ -972,17 +1401,23 @@ const Classes = (props) => {
972
1401
  value: props.classes.length
973
1402
  }
974
1403
  ] }), /* @__PURE__ */ React__namespace.createElement(
1404
+ core.Autocomplete,
1405
+ {
1406
+ placeholder: "Search for classes",
1407
+ data: props.classes.map((item) => item.name),
1408
+ onChange: props.onAutocompleteChange
1409
+ }
1410
+ ), /* @__PURE__ */ React__namespace.createElement(
975
1411
  Table$6,
976
1412
  {
977
1413
  loading: props.loading,
978
1414
  items: props.classes,
979
- onDeleteClass: props.onDeleteClass,
980
- onClick: props.onClassClick
1415
+ onDeleteClass: props.onDeleteClass
981
1416
  }
982
1417
  ))))));
983
1418
  };
984
1419
 
985
- const useStyles$7 = core.createStyles((theme) => ({
1420
+ const useStyles$6 = core.createStyles((theme) => ({
986
1421
  title: {
987
1422
  fontSize: 34,
988
1423
  fontWeight: 900,
@@ -996,7 +1431,7 @@ const useStyles$7 = core.createStyles((theme) => ({
996
1431
  }
997
1432
  }));
998
1433
  const UserInfo = (props) => {
999
- const { classes } = useStyles$7();
1434
+ const { classes } = useStyles$6();
1000
1435
  return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, props.name), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "xs" }, props.impactStatement));
1001
1436
  };
1002
1437
 
@@ -1012,8 +1447,31 @@ function Table$5(props) {
1012
1447
  }
1013
1448
  );
1014
1449
  }
1015
- const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.badgeName }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: () => props.onClick(row) }, row.badgeName)), /* @__PURE__ */ React__namespace.createElement("td", null, !!row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled" }, "Complete"), !row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "red", variant: "filled" }, "Incomplete"))));
1016
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Badge Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Status"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1450
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(
1451
+ mantineDatatable.DataTable,
1452
+ {
1453
+ verticalSpacing: "sm",
1454
+ sx: { minWidth: 700 },
1455
+ withBorder: false,
1456
+ borderRadius: "sm",
1457
+ withColumnBorders: true,
1458
+ striped: true,
1459
+ highlightOnHover: true,
1460
+ records: props.items,
1461
+ idAccessor: "badgeId",
1462
+ columns: [{
1463
+ accessor: "name",
1464
+ title: "Badge Name",
1465
+ render: (row) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Text, null, row.badgeName))
1466
+ }, {
1467
+ accessor: "status",
1468
+ render: (row) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, !!row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled" }, "Complete"), !row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "red", variant: "filled" }, "Incomplete"))
1469
+ }],
1470
+ rowExpansion: {
1471
+ content: ({ record }) => /* @__PURE__ */ React__namespace.createElement(Stack$2, { items: record.lessons })
1472
+ }
1473
+ }
1474
+ ));
1017
1475
  }
1018
1476
 
1019
1477
  function Table$4(props) {
@@ -1028,8 +1486,8 @@ function Table$4(props) {
1028
1486
  }
1029
1487
  );
1030
1488
  }
1031
- const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.questionName }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: () => props.onClick(row) }, row.lessonName)), /* @__PURE__ */ React__namespace.createElement("td", null, row.questionName), /* @__PURE__ */ React__namespace.createElement("td", null, row.answer.join(","))));
1032
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Question"), /* @__PURE__ */ React__namespace.createElement("th", null, "Answer"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1489
+ const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.questionName }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { component: "a", href: row.href }, row.lessonName)), /* @__PURE__ */ React__namespace.createElement("td", null, row.questionName), /* @__PURE__ */ React__namespace.createElement("td", null, row.answer.join(","))));
1490
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Question"), /* @__PURE__ */ React__namespace.createElement("th", null, "Answer"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1033
1491
  }
1034
1492
 
1035
1493
  function Table$3(props) {
@@ -1044,23 +1502,23 @@ function Table$3(props) {
1044
1502
  }
1045
1503
  );
1046
1504
  }
1047
- const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.lessonName }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: () => props.onClick(row) }, row.lessonName)), /* @__PURE__ */ React__namespace.createElement("td", null, row.reflection), /* @__PURE__ */ React__namespace.createElement("td", null, row.rating.toLocaleString())));
1048
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Reflection"), /* @__PURE__ */ React__namespace.createElement("th", null, "Rating"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1505
+ const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.lessonName }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { component: "a", href: row.href }, row.lessonName)), /* @__PURE__ */ React__namespace.createElement("td", null, row.reflection), /* @__PURE__ */ React__namespace.createElement("td", null, row.rating.toLocaleString())));
1506
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Reflection"), /* @__PURE__ */ React__namespace.createElement("th", null, "Rating"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1049
1507
  }
1050
1508
 
1051
1509
  const Student = (props) => {
1052
1510
  const [tab, setTab] = React.useState("badges");
1053
1511
  const numberOfBadges = props.badges.length;
1054
1512
  const percentageOfBadgesEarned = numberOfBadges > 0 ? props.badges.filter((b) => b.isComplete).length / numberOfBadges : 0;
1055
- return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, { gutter: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(
1513
+ return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, { gutter: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: props.onBackClick }, /* @__PURE__ */ React__namespace.createElement(
1056
1514
  core.Badge,
1057
1515
  {
1058
1516
  variant: "filled",
1059
- leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { onClick: props.onBackClick, color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
1517
+ leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
1060
1518
  size: "lg"
1061
1519
  },
1062
1520
  "Students"
1063
- ), /* @__PURE__ */ React__namespace.createElement(
1521
+ )), /* @__PURE__ */ React__namespace.createElement(
1064
1522
  UserInfo,
1065
1523
  {
1066
1524
  variant: "compact",
@@ -1097,27 +1555,24 @@ const Student = (props) => {
1097
1555
  Table$5,
1098
1556
  {
1099
1557
  loading: props.loading,
1100
- items: props.badges,
1101
- onClick: props.onBadgeClick
1558
+ items: props.badges
1102
1559
  }
1103
1560
  ), tab === "answers" && /* @__PURE__ */ React__namespace.createElement(
1104
1561
  Table$4,
1105
1562
  {
1106
1563
  loading: props.loading,
1107
- items: props.answers,
1108
- onClick: props.onAnswerClick
1564
+ items: props.answers
1109
1565
  }
1110
1566
  ), tab === "reflections" && /* @__PURE__ */ React__namespace.createElement(
1111
1567
  Table$3,
1112
1568
  {
1113
1569
  loading: props.loading,
1114
- items: props.reflections,
1115
- onClick: props.onReflectionClick
1570
+ items: props.reflections
1116
1571
  }
1117
1572
  ))))));
1118
1573
  };
1119
1574
 
1120
- const useStyles$6 = core.createStyles((theme, props) => {
1575
+ const useStyles$5 = core.createStyles((theme, props) => {
1121
1576
  const from = props.from || "blue";
1122
1577
  const to = props.to || "green";
1123
1578
  return {
@@ -1145,7 +1600,7 @@ const useStyles$6 = core.createStyles((theme, props) => {
1145
1600
  };
1146
1601
  });
1147
1602
  function CardGradient(props) {
1148
- const { classes } = useStyles$6(props);
1603
+ const { classes } = useStyles$5(props);
1149
1604
  const from = props.from || "blue";
1150
1605
  const to = props.to || "green";
1151
1606
  const icon = props.icon || /* @__PURE__ */ React__namespace.createElement(icons.IconColorSwatch, { size: 28, stroke: 1.5 });
@@ -1189,7 +1644,7 @@ var __objRest = (source, exclude) => {
1189
1644
  }
1190
1645
  return target;
1191
1646
  };
1192
- const useStyles$5 = core.createStyles((theme) => ({
1647
+ const useStyles$4 = core.createStyles((theme) => ({
1193
1648
  card: {
1194
1649
  height: 240,
1195
1650
  backgroundSize: "cover",
@@ -1234,7 +1689,7 @@ const TenantBanner = (_a) => {
1234
1689
  "style",
1235
1690
  "className"
1236
1691
  ]);
1237
- const { classes, cx, theme } = useStyles$5();
1692
+ const { classes, cx, theme } = useStyles$4();
1238
1693
  return /* @__PURE__ */ React__namespace.createElement(
1239
1694
  core.Card,
1240
1695
  __spreadValues$1({
@@ -1296,7 +1751,7 @@ const Home = (props) => {
1296
1751
  CardGradient,
1297
1752
  {
1298
1753
  title: "Classes",
1299
- description: "Organize students into classes.",
1754
+ description: "Organize people into classes.",
1300
1755
  onClick: props.onClassesClick
1301
1756
  }
1302
1757
  )), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, null, /* @__PURE__ */ React__namespace.createElement(
@@ -1329,10 +1784,10 @@ function Table$2(props) {
1329
1784
  );
1330
1785
  }
1331
1786
  const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.studentName }, /* @__PURE__ */ React__namespace.createElement("td", null, row.studentName), /* @__PURE__ */ React__namespace.createElement("td", null, row.reflection), /* @__PURE__ */ React__namespace.createElement("td", null, row.rating.toLocaleString())));
1332
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Student Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Reflection"), /* @__PURE__ */ React__namespace.createElement("th", null, "Rating"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1787
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Student Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Reflection"), /* @__PURE__ */ React__namespace.createElement("th", null, "Rating"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1333
1788
  }
1334
1789
 
1335
- const useStyles$4 = core.createStyles((theme) => ({
1790
+ const useStyles$3 = core.createStyles((theme) => ({
1336
1791
  button: {
1337
1792
  borderTopRightRadius: 0,
1338
1793
  borderBottomRightRadius: 0,
@@ -1347,14 +1802,15 @@ const useStyles$4 = core.createStyles((theme) => ({
1347
1802
  }
1348
1803
  }));
1349
1804
  const SplitButton = (props) => {
1350
- const { classes, theme } = useStyles$4();
1805
+ const { classes, theme } = useStyles$3();
1351
1806
  const menuIconColor = theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
1352
1807
  return /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
1353
1808
  core.Button,
1354
1809
  {
1810
+ component: "a",
1811
+ href: props.href,
1355
1812
  className: classes.button,
1356
- variant: "gradient",
1357
- onClick: props.onPreviewClick
1813
+ variant: "gradient"
1358
1814
  },
1359
1815
  "Preview"
1360
1816
  ), /* @__PURE__ */ React__namespace.createElement(core.Menu, { transition: "pop", position: "bottom-end" }, /* @__PURE__ */ React__namespace.createElement(core.Menu.Target, null, /* @__PURE__ */ React__namespace.createElement(
@@ -1388,7 +1844,7 @@ function Stack$1(props) {
1388
1844
  return null;
1389
1845
  }
1390
1846
  const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0, key: row.questionName }, /* @__PURE__ */ React__namespace.createElement(core.Title, { color: "dark.4", size: "lg" }, row.questionName), /* @__PURE__ */ React__namespace.createElement(core.Text, null, row.answer.join(",") || "No answer.")));
1391
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 24, sx: { padding: 20, minWidth: 700 } }, rows));
1847
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { component: "a", href: props.href }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 24, sx: { padding: 20, minWidth: 700 } }, rows)));
1392
1848
  }
1393
1849
 
1394
1850
  function Table$1(props) {
@@ -1403,7 +1859,7 @@ function Table$1(props) {
1403
1859
  }
1404
1860
  );
1405
1861
  }
1406
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(
1862
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(
1407
1863
  mantineDatatable.DataTable,
1408
1864
  {
1409
1865
  verticalSpacing: "sm",
@@ -1424,7 +1880,7 @@ function Table$1(props) {
1424
1880
  render: (row) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, !!row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled" }, "Complete"), !row.isComplete && !row.isStarted && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "red", variant: "filled" }, "Not started"), !row.isComplete && !!row.isStarted && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "violet", variant: "filled" }, "In progress"))
1425
1881
  }],
1426
1882
  rowExpansion: {
1427
- content: ({ record }) => /* @__PURE__ */ React__namespace.createElement(Stack$1, { items: record.answers })
1883
+ content: ({ record }) => /* @__PURE__ */ React__namespace.createElement(Stack$1, { href: record.href, items: record.answers })
1428
1884
  }
1429
1885
  }
1430
1886
  ));
@@ -1489,7 +1945,7 @@ function Stack(props) {
1489
1945
  }
1490
1946
  ))));
1491
1947
  }
1492
- return /* @__PURE__ */ React__namespace.createElement(core.Card, { key: row.question, withBorder: true, p: "xl", radius: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 4 }, /* @__PURE__ */ React__namespace.createElement(core.Title, { size: "lg" }, row.question), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm" }, row.answers.length, " answers"), /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 4 }, row.answers.map((a) => {
1948
+ return /* @__PURE__ */ React__namespace.createElement(core.Card, { key: row.question, withBorder: true, p: "xl", radius: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 4 }, /* @__PURE__ */ React__namespace.createElement(core.Title, { size: "lg" }, row.question), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm" }, row.answers.length, " answers"), /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 4 }, row.answers.map((a) => {
1493
1949
  const answerText = a.join("\n");
1494
1950
  return /* @__PURE__ */ React__namespace.createElement(core.Card, { key: answerText, p: 5, radius: 0, bg: "gray.0" }, /* @__PURE__ */ React__namespace.createElement(core.Text, null, answerText));
1495
1951
  })))));
@@ -1498,7 +1954,7 @@ function Stack(props) {
1498
1954
  }
1499
1955
  const truncateWithEllipses = (text, max) => text.substr(0, max - 1) + (text.length > max ? "&hellip;" : "");
1500
1956
 
1501
- const useStyles$3 = core.createStyles((theme) => ({
1957
+ const useStyles$2 = core.createStyles((theme) => ({
1502
1958
  title: {
1503
1959
  fontSize: 34,
1504
1960
  fontWeight: 900,
@@ -1511,22 +1967,22 @@ const useStyles$3 = core.createStyles((theme) => ({
1511
1967
  }
1512
1968
  }));
1513
1969
  const Lesson = (props) => {
1514
- const { classes } = useStyles$3();
1970
+ const { classes } = useStyles$2();
1515
1971
  const [tab, setTab] = React.useState("question");
1516
1972
  const numberOfStudents = props.students.length;
1517
1973
  const percentageOfLessonsCompleted = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length / numberOfStudents : 0;
1518
- return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(
1974
+ return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: props.onBackClick }, /* @__PURE__ */ React__namespace.createElement(
1519
1975
  core.Badge,
1520
1976
  {
1521
1977
  variant: "filled",
1522
- leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { onClick: props.onBackClick, color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
1978
+ leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
1523
1979
  size: "lg"
1524
1980
  },
1525
1981
  "Lessons"
1526
- ), /* @__PURE__ */ React__namespace.createElement(core.Group, null, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, props.displayName || "Lesson"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, props.description || "No description")), /* @__PURE__ */ React__namespace.createElement(core.Stack, { ml: "auto" }, /* @__PURE__ */ React__namespace.createElement(
1982
+ )), /* @__PURE__ */ React__namespace.createElement(core.Group, null, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, props.displayName || "Lesson"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, props.description || "No description")), /* @__PURE__ */ React__namespace.createElement(core.Stack, { ml: "auto" }, /* @__PURE__ */ React__namespace.createElement(
1527
1983
  SplitButton,
1528
1984
  {
1529
- onPreviewClick: props.onPreviewClick,
1985
+ href: props.href,
1530
1986
  onCopyLinkClick: props.onCopyLinkClick,
1531
1987
  onExportDataClick: props.onExportDataClick
1532
1988
  }
@@ -1578,8 +2034,7 @@ const Lesson = (props) => {
1578
2034
  Table$1,
1579
2035
  {
1580
2036
  loading: props.loading,
1581
- items: props.students,
1582
- onClick: props.onUserClick
2037
+ items: props.students
1583
2038
  }
1584
2039
  )))))));
1585
2040
  };
@@ -1599,6 +2054,8 @@ function Table(props) {
1599
2054
  const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.lessonId }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(
1600
2055
  core.UnstyledButton,
1601
2056
  {
2057
+ component: "a",
2058
+ href: row.href,
1602
2059
  sx: (theme) => ({
1603
2060
  display: "block",
1604
2061
  width: "100%",
@@ -1607,15 +2064,14 @@ function Table(props) {
1607
2064
  "&:hover": {
1608
2065
  backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[8] : theme.colors.gray[1]
1609
2066
  }
1610
- }),
1611
- onClick: () => props.onClick && props.onClick(row)
2067
+ })
1612
2068
  },
1613
2069
  /* @__PURE__ */ React__namespace.createElement(core.Group, null, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, row.name), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xs", color: "dimmed" }, row.description)))
1614
2070
  ))));
1615
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 500 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { horizontalSpacing: 0, verticalSpacing: 0, sx: { minWidth: 700 } }, /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
2071
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { horizontalSpacing: 0, verticalSpacing: 0, sx: { minWidth: 700 } }, /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1616
2072
  }
1617
2073
 
1618
- const useStyles$2 = core.createStyles((theme) => ({
2074
+ const useStyles$1 = core.createStyles((theme) => ({
1619
2075
  title: {
1620
2076
  fontSize: 34,
1621
2077
  fontWeight: 900,
@@ -1628,7 +2084,7 @@ const useStyles$2 = core.createStyles((theme) => ({
1628
2084
  }
1629
2085
  }));
1630
2086
  const Lessons = (props) => {
1631
- const { classes } = useStyles$2();
2087
+ const { classes } = useStyles$1();
1632
2088
  return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled", size: "lg" }, "Lessons"), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, "Lessons"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, "Explore units of instruction and/or see corresponding class progress."))), /* @__PURE__ */ React__namespace.createElement(
1633
2089
  core.Autocomplete,
1634
2090
  {
@@ -1640,8 +2096,7 @@ const Lessons = (props) => {
1640
2096
  Table,
1641
2097
  {
1642
2098
  loading: props.loading,
1643
- items: props.lessons,
1644
- onClick: props.onLessonClick
2099
+ items: props.lessons
1645
2100
  }
1646
2101
  ))));
1647
2102
  };
@@ -1651,10 +2106,23 @@ const mycCache = core.createEmotionCache({
1651
2106
  prepend: false
1652
2107
  });
1653
2108
  const AdminProvider = (props) => {
1654
- return /* @__PURE__ */ React__namespace.createElement(core.MantineProvider, { withNormalizeCSS: true, withGlobalStyles: true, emotionCache: mycCache, theme: { loader: "bars" } }, /* @__PURE__ */ React__namespace.createElement(notifications.NotificationsProvider, { limit: props.notificationLimit || 5 }, /* @__PURE__ */ React__namespace.createElement(modals.ModalsProvider, null, props.children)));
2109
+ return /* @__PURE__ */ React__namespace.createElement(
2110
+ core.MantineProvider,
2111
+ {
2112
+ theme: {
2113
+ loader: "bars"
2114
+ },
2115
+ withNormalizeCSS: true,
2116
+ withGlobalStyles: true,
2117
+ emotionCache: mycCache
2118
+ },
2119
+ /* @__PURE__ */ React__namespace.createElement(notifications.NotificationsProvider, { limit: props.notificationLimit || 5 }, /* @__PURE__ */ React__namespace.createElement(modals.ModalsProvider, null, props.children))
2120
+ );
1655
2121
  };
1656
2122
 
1657
2123
  var __defProp = Object.defineProperty;
2124
+ var __defProps = Object.defineProperties;
2125
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
1658
2126
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
1659
2127
  var __hasOwnProp = Object.prototype.hasOwnProperty;
1660
2128
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -1670,103 +2138,19 @@ var __spreadValues = (a, b) => {
1670
2138
  }
1671
2139
  return a;
1672
2140
  };
1673
- const SwitchAccount = (props) => {
1674
- const form$1 = form.useForm({
1675
- initialValues: {
1676
- active: props.account
1677
- }
1678
- });
1679
- return /* @__PURE__ */ React__namespace.createElement(
1680
- core.Modal,
1681
- {
1682
- centered: true,
1683
- opened: props.opened,
1684
- onClose: () => props.onClose && props.onClose(),
1685
- size: "sm",
1686
- title: /* @__PURE__ */ React__namespace.createElement(core.Title, { size: "h5" }, "Accounts")
1687
- },
1688
- /* @__PURE__ */ React__namespace.createElement("form", { onSubmit: form$1.onSubmit(() => {
1689
- props.onChange && props.onChange(form$1.values.active);
1690
- }) }, /* @__PURE__ */ React__namespace.createElement(
1691
- core.Select,
1692
- __spreadValues({
1693
- required: true,
1694
- placeholder: "Select an account",
1695
- defaultValue: props.account,
1696
- data: props.accounts.map((a) => {
1697
- return { value: a.accountId, label: a.name };
1698
- })
1699
- }, form$1.getInputProps("active"))
1700
- ), /* @__PURE__ */ React__namespace.createElement(core.Button, { type: "submit", fullWidth: true, mt: "xl" }, "Switch"))
1701
- );
1702
- };
1703
-
1704
- const useStyles$1 = core.createStyles((theme) => ({
1705
- link: {
1706
- width: 50,
1707
- height: 50,
1708
- borderRadius: theme.radius.md,
1709
- display: "flex",
1710
- alignItems: "center",
1711
- justifyContent: "center",
1712
- color: theme.colorScheme === "dark" ? theme.colors.dark[0] : theme.colors.gray[7],
1713
- "&:hover": {
1714
- backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[0]
1715
- }
1716
- },
1717
- active: {
1718
- "&, &:hover": {
1719
- backgroundColor: theme.fn.variant({ variant: "light", color: theme.primaryColor }).background,
1720
- color: theme.fn.variant({ variant: "light", color: theme.primaryColor }).color
1721
- }
1722
- }
1723
- }));
1724
- const data = [
1725
- { icon: icons.IconHome2, label: "Home", href: "/home" },
1726
- { icon: icons.IconGauge, label: "Dashboard", href: "/dashboard" },
1727
- { icon: icons.IconCategory2, label: "Classes", href: "/classes" },
1728
- { icon: icons.IconAlbum, label: "Badges", href: "/badges" },
1729
- { icon: icons.IconLambda, label: "Lessons", href: "/lessons" }
1730
- ];
1731
- const NavbarLink = ({ icon: Icon, label, active, onClick }) => {
1732
- const { classes, cx } = useStyles$1();
1733
- return /* @__PURE__ */ React__namespace.createElement(core.Tooltip, { label, position: "right", transitionDuration: 0 }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick, className: cx(classes.link, { [classes.active]: active }) }, /* @__PURE__ */ React__namespace.createElement(Icon, { stroke: 1.5 })));
1734
- };
1735
- const Navbar = (props) => {
1736
- const links = data.map((link) => /* @__PURE__ */ React__namespace.createElement(
1737
- NavbarLink,
1738
- {
1739
- key: link.label,
1740
- label: link.label,
1741
- icon: link.icon,
1742
- active: link.label === props.active,
1743
- onClick: () => props.navigate(link.href)
1744
- }
1745
- ));
1746
- return /* @__PURE__ */ React__namespace.createElement(core.Navbar, { width: { base: 80 }, p: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Center, null, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { color: "blue", radius: "sm" }, /* @__PURE__ */ React__namespace.createElement("div", { style: { width: 15, marginLeft: "auto", marginRight: "auto" } }, /* @__PURE__ */ React__namespace.createElement(core.Image, { fit: "contain", src: "https://cdn.localcivics.io/brand/l.png" })))), /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, { grow: true, mt: 50 }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { justify: "center", spacing: 0 }, links)), /* @__PURE__ */ React__namespace.createElement(core.Navbar.Section, null, /* @__PURE__ */ React__namespace.createElement(core.Stack, { justify: "center", spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
1747
- NavbarLink,
1748
- {
1749
- icon: icons.IconSwitchHorizontal,
1750
- label: "Switch accounts",
1751
- onClick: props.onSwitchAccounts
1752
- }
1753
- ), /* @__PURE__ */ React__namespace.createElement(
1754
- NavbarLink,
1755
- {
1756
- icon: icons.IconLogout,
1757
- label: "Logout",
1758
- onClick: props.onLogout
1759
- }
1760
- ))));
1761
- };
1762
-
2141
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
1763
2142
  const useStyles = core.createStyles((theme) => ({
1764
2143
  footer: {
1765
- paddingTop: theme.spacing.xl * 2,
1766
- paddingBottom: theme.spacing.xl * 2,
1767
- paddingLeft: theme.spacing.xl * 3,
2144
+ paddingTop: theme.spacing.md,
2145
+ paddingBottom: theme.spacing.md,
2146
+ paddingLeft: theme.spacing.md,
1768
2147
  backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0],
1769
- borderTop: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[2]}`
2148
+ borderTop: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[5] : theme.colors.gray[2]}`,
2149
+ [theme.fn.largerThan("sm")]: {
2150
+ paddingTop: theme.spacing.xl * 2,
2151
+ paddingBottom: theme.spacing.xl * 2,
2152
+ paddingLeft: theme.spacing.xl * 13
2153
+ }
1770
2154
  },
1771
2155
  logo: {
1772
2156
  maxWidth: 200,
@@ -1844,13 +2228,10 @@ const App = (props) => {
1844
2228
  {
1845
2229
  padding: "xs",
1846
2230
  navbar: /* @__PURE__ */ React__namespace.createElement(
1847
- Navbar,
1848
- {
1849
- active: props.navbar.props.active,
1850
- navigate: props.navbar.props.navigate,
1851
- onLogout: props.navbar.props.onLogout,
2231
+ NestedNavbar,
2232
+ __spreadProps(__spreadValues({}, props.navbar.props), {
1852
2233
  onSwitchAccounts: () => account.setChangeModalOpen(true)
1853
- }
2234
+ })
1854
2235
  ),
1855
2236
  footer: /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, !account.opened && /* @__PURE__ */ React__namespace.createElement("footer", { className: classes.footer }, /* @__PURE__ */ React__namespace.createElement(core.Container, { className: classes.inner }, /* @__PURE__ */ React__namespace.createElement("div", { className: classes.logo }, /* @__PURE__ */ React__namespace.createElement(core.Group, { spacing: "xs" }, /* @__PURE__ */ React__namespace.createElement("div", { style: { width: 15 } }, /* @__PURE__ */ React__namespace.createElement(core.Image, { fit: "contain", src: "https://cdn.localcivics.io/brand/l.png" })), /* @__PURE__ */ React__namespace.createElement(core.Title, { color: "dimmed", size: "h5" }, "Local Civics")), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xs", color: "dimmed", className: classes.description }, "We connect students to powerful civic learning experiences.")), /* @__PURE__ */ React__namespace.createElement("div", { className: classes.groups }, /* @__PURE__ */ React__namespace.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React__namespace.createElement(
1856
2237
  core.Text,
@@ -1898,9 +2279,10 @@ const App = (props) => {
1898
2279
  SwitchAccount,
1899
2280
  {
1900
2281
  opened: account.opened,
2282
+ loading: account.loading,
1901
2283
  account: account.account,
1902
2284
  accounts: account.accounts,
1903
- onChange: account.onAccountChange,
2285
+ onClick: account.onAccountChange,
1904
2286
  onClose: () => account.setChangeModalOpen(false)
1905
2287
  }
1906
2288
  )
@@ -1910,6 +2292,7 @@ const useAccount = (account, accounts, onAccountChange) => {
1910
2292
  const accountsKey = JSON.stringify(accounts);
1911
2293
  const [changeModalOpen, setChangeModalOpen] = React.useState(false);
1912
2294
  const [active, setActive] = React.useState(account);
2295
+ const [loading, setLoading] = React.useState(false);
1913
2296
  React__namespace.useEffect(() => {
1914
2297
  setActive(account);
1915
2298
  }, [account, accountsKey]);
@@ -1917,11 +2300,15 @@ const useAccount = (account, accounts, onAccountChange) => {
1917
2300
  opened: changeModalOpen,
1918
2301
  account: active,
1919
2302
  accounts,
2303
+ loading,
1920
2304
  setChangeModalOpen,
1921
2305
  onAccountChange: (account2) => {
1922
- setActive(account2);
1923
- setChangeModalOpen(false);
1924
- onAccountChange(account2);
2306
+ setLoading(true);
2307
+ onAccountChange(account2).then(() => {
2308
+ setActive(account2);
2309
+ setLoading(false);
2310
+ setChangeModalOpen(false);
2311
+ });
1925
2312
  }
1926
2313
  };
1927
2314
  };
@@ -1945,6 +2332,7 @@ exports.Home = Home;
1945
2332
  exports.Lesson = Lesson;
1946
2333
  exports.Lessons = Lessons;
1947
2334
  exports.Navbar = Navbar;
2335
+ exports.NestedNavbar = NestedNavbar;
1948
2336
  exports.Student = Student;
1949
2337
  exports.SwitchAccount = SwitchAccount;
1950
2338
  //# sourceMappingURL=index.js.map