@local-civics/mgmt-ui 0.1.196 → 0.1.198

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.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useState, useMemo } from 'react';
3
- import { createStyles, Group, Avatar, Text, Box, Badge as Badge$1, ThemeIcon, Collapse, Navbar as Navbar$1, Center, Image, Code, Burger, ScrollArea, Modal, Loader, Container, Button, Title, UnstyledButton, Card, SimpleGrid, Tabs as Tabs$1, Stack as Stack$5, Grid, ActionIcon, LoadingOverlay, Select, Table as Table$l, Autocomplete, Drawer, Divider, TextInput, Tooltip, Paper, Overlay, Anchor, Menu, Checkbox, createEmotionCache, MantineProvider, AppShell } from '@mantine/core';
4
- import { IconChevronRight, IconChevronLeft, IconVideo, IconSwitchHorizontal, IconLogout, IconHome2, IconGauge, IconCategory2, IconRoute, IconAlbum, IconLambda, IconClipboard, IconBuilding, IconBatteryEco, IconBooks, IconBackpack, IconClipboardCopy, IconTableExport, IconArrowLeft, IconPlaylistAdd, IconCheck, IconTrash, IconDownload, IconX, IconCloudUpload, IconChevronUp, IconChevronDown, IconSelector, IconInfoCircle, IconColorSwatch, IconPointer, IconScribble, IconSchool, IconPodium, IconBriefcase, IconPresentation, IconNews, IconTools, IconBrandInstagram, IconBrandLinkedin, IconBrandFacebook } from '@tabler/icons';
3
+ import { createStyles, Group, Avatar, Text, Box, Badge as Badge$1, ThemeIcon, Collapse, Navbar as Navbar$1, Center, Image, Code, Burger, ScrollArea, Modal, Loader, Container, Button, Title, UnstyledButton, Card, SimpleGrid, Tabs as Tabs$1, Stack as Stack$5, Grid, ActionIcon, LoadingOverlay, Select, Table as Table$l, Autocomplete, Drawer, Divider, TextInput, Tooltip, Paper, Overlay, Anchor, Menu, Checkbox, createEmotionCache, MantineProvider, AppShell, Accordion } from '@mantine/core';
4
+ import { IconChevronRight, IconChevronLeft, IconVideo, IconSwitchHorizontal, IconLogout, IconHome2, IconGauge, IconCategory2, IconRoute, IconAlbum, IconLambda, IconClipboard, IconBuilding, IconBatteryEco, IconBooks, IconBackpack, IconClipboardCopy, IconTableExport, IconArrowLeft, IconPlaylistAdd, IconCheck, IconTrash, IconDownload, IconX, IconCloudUpload, IconInfoCircle, IconColorSwatch, IconPointer, IconChevronDown, IconScribble, IconSchool, IconPodium, IconBriefcase, IconPresentation, IconNews, IconTools, IconBrandInstagram, IconBrandLinkedin, IconBrandFacebook } from '@tabler/icons';
5
5
  import { Link } from 'react-router-dom';
6
6
  import { showNotification, NotificationsProvider } from '@mantine/notifications';
7
7
  export { showNotification, updateNotification } from '@mantine/notifications';
@@ -14,35 +14,35 @@ import AvatarInit from 'avatar-initials';
14
14
  import { Chart } from 'react-charts';
15
15
  import { useUncontrolled } from '@mantine/hooks';
16
16
 
17
- var __defProp$e = Object.defineProperty;
18
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
19
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
20
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
21
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
22
- var __spreadValues$e = (a, b) => {
17
+ var __defProp$f = Object.defineProperty;
18
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
19
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
20
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
21
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
22
+ var __spreadValues$f = (a, b) => {
23
23
  for (var prop in b || (b = {}))
24
- if (__hasOwnProp$e.call(b, prop))
25
- __defNormalProp$e(a, prop, b[prop]);
26
- if (__getOwnPropSymbols$e)
27
- for (var prop of __getOwnPropSymbols$e(b)) {
28
- if (__propIsEnum$e.call(b, prop))
29
- __defNormalProp$e(a, prop, b[prop]);
24
+ if (__hasOwnProp$f.call(b, prop))
25
+ __defNormalProp$f(a, prop, b[prop]);
26
+ if (__getOwnPropSymbols$f)
27
+ for (var prop of __getOwnPropSymbols$f(b)) {
28
+ if (__propIsEnum$f.call(b, prop))
29
+ __defNormalProp$f(a, prop, b[prop]);
30
30
  }
31
31
  return a;
32
32
  };
33
33
  var __objRest$2 = (source, exclude) => {
34
34
  var target = {};
35
35
  for (var prop in source)
36
- if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
36
+ if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
37
37
  target[prop] = source[prop];
38
- if (source != null && __getOwnPropSymbols$e)
39
- for (var prop of __getOwnPropSymbols$e(source)) {
40
- if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
38
+ if (source != null && __getOwnPropSymbols$f)
39
+ for (var prop of __getOwnPropSymbols$f(source)) {
40
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
41
41
  target[prop] = source[prop];
42
42
  }
43
43
  return target;
44
44
  };
45
- const useStyles$w = createStyles((theme) => ({
45
+ const useStyles$v = createStyles((theme) => ({
46
46
  user: {
47
47
  display: "block",
48
48
  width: "100%",
@@ -53,8 +53,8 @@ const useStyles$w = createStyles((theme) => ({
53
53
  }));
54
54
  function UserButton(_a) {
55
55
  var _b = _a, { image, name, email, icon } = _b, others = __objRest$2(_b, ["image", "name", "email", "icon"]);
56
- const { classes } = useStyles$w();
57
- return /* @__PURE__ */ React.createElement(Group, __spreadValues$e({ className: classes.user }, others), /* @__PURE__ */ React.createElement(Avatar, { src: image, radius: "xl" }), /* @__PURE__ */ React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React.createElement(Text, { size: "sm", weight: 500 }, name), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", size: "xs" }, email)));
56
+ const { classes } = useStyles$v();
57
+ return /* @__PURE__ */ React.createElement(Group, __spreadValues$f({ className: classes.user }, others), /* @__PURE__ */ React.createElement(Avatar, { src: image, radius: "xl" }), /* @__PURE__ */ React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React.createElement(Text, { size: "sm", weight: 500 }, name), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", size: "xs" }, email)));
58
58
  }
59
59
 
60
60
  const compact = (num) => {
@@ -64,7 +64,7 @@ const compact = (num) => {
64
64
  }).format(num || 0);
65
65
  };
66
66
 
67
- const useStyles$v = createStyles((theme, _params, getRef) => {
67
+ const useStyles$u = createStyles((theme, _params, getRef) => {
68
68
  const icon = getRef("icon");
69
69
  return {
70
70
  control: {
@@ -117,7 +117,7 @@ const useStyles$v = createStyles((theme, _params, getRef) => {
117
117
  };
118
118
  });
119
119
  function LinksGroup({ icon: Icon, href, label, initiallyOpened, links, active, notifications }) {
120
- const { classes, theme, cx } = useStyles$v();
120
+ const { classes, theme, cx } = useStyles$u();
121
121
  const hasLinks = Array.isArray(links) && links.length > 0;
122
122
  const hasActiveLinks = Array.isArray(links) && links.map((l) => !!active && active === `${label}/${l.label}`).reduce((a, b) => a || b, false);
123
123
  const [opened, setOpened] = useState(initiallyOpened || hasActiveLinks || false);
@@ -162,26 +162,26 @@ function LinksGroup({ icon: Icon, href, label, initiallyOpened, links, active, n
162
162
  ), hasLinks ? /* @__PURE__ */ React.createElement(Collapse, { in: opened }, items) : null);
163
163
  }
164
164
 
165
- var __defProp$d = Object.defineProperty;
166
- var __defProps$9 = Object.defineProperties;
167
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
168
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
169
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
170
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
171
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
172
- var __spreadValues$d = (a, b) => {
165
+ var __defProp$e = Object.defineProperty;
166
+ var __defProps$a = Object.defineProperties;
167
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
168
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
169
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
170
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
171
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
172
+ var __spreadValues$e = (a, b) => {
173
173
  for (var prop in b || (b = {}))
174
- if (__hasOwnProp$d.call(b, prop))
175
- __defNormalProp$d(a, prop, b[prop]);
176
- if (__getOwnPropSymbols$d)
177
- for (var prop of __getOwnPropSymbols$d(b)) {
178
- if (__propIsEnum$d.call(b, prop))
179
- __defNormalProp$d(a, prop, b[prop]);
174
+ if (__hasOwnProp$e.call(b, prop))
175
+ __defNormalProp$e(a, prop, b[prop]);
176
+ if (__getOwnPropSymbols$e)
177
+ for (var prop of __getOwnPropSymbols$e(b)) {
178
+ if (__propIsEnum$e.call(b, prop))
179
+ __defNormalProp$e(a, prop, b[prop]);
180
180
  }
181
181
  return a;
182
182
  };
183
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
184
- const useStyles$u = createStyles((theme, _params, getRef) => {
183
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
184
+ const useStyles$t = createStyles((theme, _params, getRef) => {
185
185
  const icon = getRef("icon");
186
186
  return {
187
187
  navbar: {
@@ -212,7 +212,7 @@ const useStyles$u = createStyles((theme, _params, getRef) => {
212
212
  color: theme.colorScheme === "dark" ? theme.white : theme.black,
213
213
  borderBottom: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[3]}`
214
214
  },
215
- link: __spreadProps$9(__spreadValues$d({}, theme.fn.focusStyles()), {
215
+ link: __spreadProps$a(__spreadValues$e({}, theme.fn.focusStyles()), {
216
216
  display: "flex",
217
217
  alignItems: "center",
218
218
  textDecoration: "none",
@@ -282,7 +282,7 @@ const TRIAL_PAGES = [
282
282
  "Badges"
283
283
  ];
284
284
  function Navbar(props) {
285
- const { classes, cx } = useStyles$u();
285
+ const { classes, cx } = useStyles$t();
286
286
  const [burgerOpen, setBurgerOpen] = React.useState(false);
287
287
  const toggle = () => setBurgerOpen(!burgerOpen);
288
288
  const links = data.map((item) => {
@@ -295,12 +295,12 @@ function Navbar(props) {
295
295
  }
296
296
  return /* @__PURE__ */ React.createElement(
297
297
  LinksGroup,
298
- __spreadProps$9(__spreadValues$d(__spreadValues$d({
298
+ __spreadProps$a(__spreadValues$e(__spreadValues$e({
299
299
  key: item.label,
300
300
  active: props.active
301
301
  }, item), context), {
302
302
  links: (item.links || []).map((link) => {
303
- return __spreadValues$d(__spreadValues$d({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
303
+ return __spreadValues$e(__spreadValues$e({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
304
304
  })
305
305
  })
306
306
  );
@@ -325,7 +325,7 @@ function Navbar(props) {
325
325
  } }, /* @__PURE__ */ React.createElement(IconLogout, { className: classes.linkIcon, stroke: 1.5 }), /* @__PURE__ */ React.createElement("span", null, "Logout"))))));
326
326
  }
327
327
 
328
- const useStyles$t = createStyles((theme) => ({
328
+ const useStyles$s = createStyles((theme) => ({
329
329
  inner: {
330
330
  paddingTop: theme.spacing.xl,
331
331
  paddingBottom: theme.spacing.xl * 4
@@ -361,7 +361,7 @@ const useStyles$t = createStyles((theme) => ({
361
361
  }
362
362
  }));
363
363
  const GettingStarted = (props) => {
364
- const { classes } = useStyles$t();
364
+ const { classes } = useStyles$s();
365
365
  return /* @__PURE__ */ React.createElement(
366
366
  Modal,
367
367
  {
@@ -375,7 +375,7 @@ const GettingStarted = (props) => {
375
375
  );
376
376
  };
377
377
 
378
- const useStyles$s = createStyles((theme) => ({
378
+ const useStyles$r = createStyles((theme) => ({
379
379
  title: {
380
380
  fontSize: 34,
381
381
  fontWeight: 900,
@@ -416,7 +416,7 @@ const useStyles$s = createStyles((theme) => ({
416
416
  }
417
417
  }));
418
418
  const SwitchAccount = (props) => {
419
- const { classes, theme } = useStyles$s();
419
+ const { classes, theme } = useStyles$r();
420
420
  const options = props.accounts.map((a) => {
421
421
  return /* @__PURE__ */ React.createElement(UnstyledButton, { onClick: () => props.onClick && props.onClick(a.accountId), key: a.accountId, p: theme.spacing.md }, /* @__PURE__ */ React.createElement(Card, { withBorder: true, shadow: "md", radius: "md", className: classes.card, p: "xl" }, a.isAdmin && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconBatteryEco, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), a.isGroupAdmin && !a.isAdmin && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconBooks, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), !a.isAdmin && !a.isGroupAdmin && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconBackpack, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), /* @__PURE__ */ React.createElement(Text, { size: "lg", weight: 500, className: classes.cardTitle, mt: "md" }, a.name), /* @__PURE__ */ React.createElement(Text, { size: "sm", color: "dimmed", mt: "sm" }, a.isAdmin ? "Admin" : a.isGroupAdmin ? "Educator" : "Student")));
422
422
  });
@@ -433,7 +433,7 @@ const SwitchAccount = (props) => {
433
433
  );
434
434
  };
435
435
 
436
- const useStyles$r = createStyles((theme) => ({
436
+ const useStyles$q = createStyles((theme) => ({
437
437
  root: {
438
438
  display: "flex",
439
439
  backgroundImage: `linear-gradient(-60deg, ${theme.colors[theme.primaryColor][4]} 0%, ${theme.colors[theme.primaryColor][7]} 100%)`,
@@ -477,7 +477,7 @@ const useStyles$r = createStyles((theme) => ({
477
477
  }
478
478
  }));
479
479
  const StatsGroup = ({ data, footer }) => {
480
- const { classes } = useStyles$r();
480
+ const { classes } = useStyles$q();
481
481
  const stats = data.map((stat) => {
482
482
  const value = (() => {
483
483
  if (stat.unit === "%") {
@@ -497,7 +497,7 @@ const Tabs = (props) => {
497
497
  return /* @__PURE__ */ React.createElement(Tabs$1, { value: props.value, onTabChange: props.onChange }, /* @__PURE__ */ React.createElement(Tabs$1.List, null, tabs));
498
498
  };
499
499
 
500
- const useStyles$q = createStyles((theme) => ({
500
+ const useStyles$p = createStyles((theme) => ({
501
501
  button: {
502
502
  borderTopRightRadius: 0,
503
503
  borderBottomRightRadius: 0,
@@ -512,7 +512,7 @@ const useStyles$q = createStyles((theme) => ({
512
512
  }
513
513
  }));
514
514
  const SplitButton$5 = (props) => {
515
- const { classes, theme } = useStyles$q();
515
+ const { classes, theme } = useStyles$p();
516
516
  theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
517
517
  return /* @__PURE__ */ React.createElement(Stack$5, { spacing: "sm" }, /* @__PURE__ */ React.createElement(
518
518
  Button,
@@ -540,7 +540,7 @@ const SplitButton$5 = (props) => {
540
540
  ));
541
541
  };
542
542
 
543
- const useStyles$p = createStyles((theme) => ({
543
+ const useStyles$o = createStyles((theme) => ({
544
544
  wrapper: {
545
545
  display: "flex",
546
546
  alignItems: "center",
@@ -591,7 +591,7 @@ const useStyles$p = createStyles((theme) => ({
591
591
  }
592
592
  }));
593
593
  const PlaceholderBanner = (props) => {
594
- const { classes } = useStyles$p();
594
+ const { classes } = useStyles$o();
595
595
  const title = props.title || "Nothing to display";
596
596
  const description = props.description || "We don't have anything to show you here just yet. Add data, check back later, or adjust your search.";
597
597
  return /* @__PURE__ */ React.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React.createElement("div", { className: classes.body }, /* @__PURE__ */ React.createElement(Title, { className: classes.title }, props.loading ? "Loading..." : title), /* @__PURE__ */ React.createElement(Text, { size: "sm", color: "dimmed" }, props.loading ? "Hold on, we're loading your data." : description)), /* @__PURE__ */ React.createElement(Image, { src: `https://cdn.localcivics.io/illustrations/${props.icon}.svg`, className: classes.image }));
@@ -643,28 +643,28 @@ function useSortableData(items, config = { key: "", direction: null }) {
643
643
  return { items: sortedItems, requestSort, sortConfig };
644
644
  }
645
645
 
646
- var __defProp$c = Object.defineProperty;
647
- var __defProps$8 = Object.defineProperties;
648
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
649
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
650
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
651
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
652
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
653
- var __spreadValues$c = (a, b) => {
646
+ var __defProp$d = Object.defineProperty;
647
+ var __defProps$9 = Object.defineProperties;
648
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
649
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
650
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
651
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
652
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
653
+ var __spreadValues$d = (a, b) => {
654
654
  for (var prop in b || (b = {}))
655
- if (__hasOwnProp$c.call(b, prop))
656
- __defNormalProp$c(a, prop, b[prop]);
657
- if (__getOwnPropSymbols$c)
658
- for (var prop of __getOwnPropSymbols$c(b)) {
659
- if (__propIsEnum$c.call(b, prop))
660
- __defNormalProp$c(a, prop, b[prop]);
655
+ if (__hasOwnProp$d.call(b, prop))
656
+ __defNormalProp$d(a, prop, b[prop]);
657
+ if (__getOwnPropSymbols$d)
658
+ for (var prop of __getOwnPropSymbols$d(b)) {
659
+ if (__propIsEnum$d.call(b, prop))
660
+ __defNormalProp$d(a, prop, b[prop]);
661
661
  }
662
662
  return a;
663
663
  };
664
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
664
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
665
665
  function Table$k(props) {
666
666
  const preparedItems = React.useMemo(() => {
667
- return props.items.map((item) => __spreadProps$8(__spreadValues$c({}, item), {
667
+ return props.items.map((item) => __spreadProps$9(__spreadValues$d({}, item), {
668
668
  status: item.isComplete ? 1 : 0
669
669
  }));
670
670
  }, [props.items]);
@@ -761,7 +761,7 @@ function Table$j(props) {
761
761
  ));
762
762
  }
763
763
 
764
- const useStyles$o = createStyles((theme) => ({
764
+ const useStyles$n = createStyles((theme) => ({
765
765
  title: {
766
766
  fontSize: 34,
767
767
  fontWeight: 900,
@@ -774,7 +774,7 @@ const useStyles$o = createStyles((theme) => ({
774
774
  }
775
775
  }));
776
776
  const Badge = (props) => {
777
- const { classes } = useStyles$o();
777
+ const { classes } = useStyles$n();
778
778
  const [tab, setTab] = useState("lessons");
779
779
  const numberOfStudents = props.students.length;
780
780
  const numberOfBadges = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length : 0;
@@ -872,7 +872,7 @@ function Table$i(props) {
872
872
  return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(Table$l, { horizontalSpacing: 0, verticalSpacing: 0, sx: { minWidth: 700 } }, /* @__PURE__ */ React.createElement("tbody", null, rows)));
873
873
  }
874
874
 
875
- const useStyles$n = createStyles((theme) => ({
875
+ const useStyles$m = createStyles((theme) => ({
876
876
  title: {
877
877
  fontSize: 34,
878
878
  fontWeight: 900,
@@ -885,7 +885,7 @@ const useStyles$n = createStyles((theme) => ({
885
885
  }
886
886
  }));
887
887
  const Badges = (props) => {
888
- const { classes } = useStyles$n();
888
+ const { classes } = useStyles$m();
889
889
  return /* @__PURE__ */ React.createElement(Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(Grid, null, /* @__PURE__ */ React.createElement(Grid.Col, { sm: "auto" }, /* @__PURE__ */ React.createElement(Badge$1, { variant: "filled", size: "lg" }, "Badges"), /* @__PURE__ */ React.createElement(Title, { order: 2, className: classes.title, mt: "md" }, "Badges and micro-credentials"), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", className: classes.description, mt: "sm" }, "Key milestones that reflect skill development, micro-credentials, or academic progress"))), /* @__PURE__ */ React.createElement(
890
890
  Autocomplete,
891
891
  {
@@ -1115,28 +1115,28 @@ const SplitButton$4 = (props) => {
1115
1115
  ));
1116
1116
  };
1117
1117
 
1118
- var __defProp$b = Object.defineProperty;
1119
- var __defProps$7 = Object.defineProperties;
1120
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
1121
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1122
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1123
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
1124
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1125
- var __spreadValues$b = (a, b) => {
1118
+ var __defProp$c = Object.defineProperty;
1119
+ var __defProps$8 = Object.defineProperties;
1120
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
1121
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
1122
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
1123
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
1124
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1125
+ var __spreadValues$c = (a, b) => {
1126
1126
  for (var prop in b || (b = {}))
1127
- if (__hasOwnProp$b.call(b, prop))
1128
- __defNormalProp$b(a, prop, b[prop]);
1129
- if (__getOwnPropSymbols$b)
1130
- for (var prop of __getOwnPropSymbols$b(b)) {
1131
- if (__propIsEnum$b.call(b, prop))
1132
- __defNormalProp$b(a, prop, b[prop]);
1127
+ if (__hasOwnProp$c.call(b, prop))
1128
+ __defNormalProp$c(a, prop, b[prop]);
1129
+ if (__getOwnPropSymbols$c)
1130
+ for (var prop of __getOwnPropSymbols$c(b)) {
1131
+ if (__propIsEnum$c.call(b, prop))
1132
+ __defNormalProp$c(a, prop, b[prop]);
1133
1133
  }
1134
1134
  return a;
1135
1135
  };
1136
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
1136
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
1137
1137
  function Table$c(props) {
1138
1138
  const preparedItems = React.useMemo(() => {
1139
- return props.items.map((item) => __spreadProps$7(__spreadValues$b({}, item), {
1139
+ return props.items.map((item) => __spreadProps$8(__spreadValues$c({}, item), {
1140
1140
  fullName: item.givenName && item.familyName ? `${item.givenName} ${item.familyName}`.toLowerCase() : item.email.toLowerCase()
1141
1141
  }));
1142
1142
  }, [props.items]);
@@ -1233,26 +1233,26 @@ function Table$c(props) {
1233
1233
  ));
1234
1234
  }
1235
1235
 
1236
- var __defProp$a = Object.defineProperty;
1237
- var __defProps$6 = Object.defineProperties;
1238
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
1239
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1240
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1241
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1242
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1243
- var __spreadValues$a = (a, b) => {
1236
+ var __defProp$b = Object.defineProperty;
1237
+ var __defProps$7 = Object.defineProperties;
1238
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
1239
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1240
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1241
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
1242
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1243
+ var __spreadValues$b = (a, b) => {
1244
1244
  for (var prop in b || (b = {}))
1245
- if (__hasOwnProp$a.call(b, prop))
1246
- __defNormalProp$a(a, prop, b[prop]);
1247
- if (__getOwnPropSymbols$a)
1248
- for (var prop of __getOwnPropSymbols$a(b)) {
1249
- if (__propIsEnum$a.call(b, prop))
1250
- __defNormalProp$a(a, prop, b[prop]);
1245
+ if (__hasOwnProp$b.call(b, prop))
1246
+ __defNormalProp$b(a, prop, b[prop]);
1247
+ if (__getOwnPropSymbols$b)
1248
+ for (var prop of __getOwnPropSymbols$b(b)) {
1249
+ if (__propIsEnum$b.call(b, prop))
1250
+ __defNormalProp$b(a, prop, b[prop]);
1251
1251
  }
1252
1252
  return a;
1253
1253
  };
1254
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1255
- const useStyles$m = createStyles((theme) => ({
1254
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
1255
+ const useStyles$l = createStyles((theme) => ({
1256
1256
  title: {
1257
1257
  fontSize: 34,
1258
1258
  fontWeight: 900,
@@ -1285,7 +1285,7 @@ const useStyles$m = createStyles((theme) => ({
1285
1285
  }
1286
1286
  }));
1287
1287
  const Class = (props) => {
1288
- const { classes } = useStyles$m();
1288
+ const { classes } = useStyles$l();
1289
1289
  const form = useForm({
1290
1290
  initialValues: {
1291
1291
  classId: "",
@@ -1317,27 +1317,27 @@ const Class = (props) => {
1317
1317
  padding: "xl",
1318
1318
  size: "xl"
1319
1319
  },
1320
- /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(DropzoneButton$1, __spreadProps$6(__spreadValues$a({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React.createElement(Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React.createElement("form", { onSubmit: form.onSubmit(() => {
1320
+ /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(DropzoneButton$1, __spreadProps$7(__spreadValues$b({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React.createElement(Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React.createElement("form", { onSubmit: form.onSubmit(() => {
1321
1321
  const values = form.values;
1322
1322
  form.reset();
1323
1323
  setOpened(false);
1324
1324
  props.onCreateMembers && props.onCreateMembers([values]);
1325
1325
  }) }, /* @__PURE__ */ React.createElement(Stack$5, null, /* @__PURE__ */ React.createElement(
1326
1326
  TextInput,
1327
- __spreadValues$a({
1327
+ __spreadValues$b({
1328
1328
  withAsterisk: true,
1329
1329
  label: "Email",
1330
1330
  placeholder: "Email"
1331
1331
  }, form.getInputProps("email"))
1332
1332
  ), /* @__PURE__ */ React.createElement(Group, { grow: true }, /* @__PURE__ */ React.createElement(
1333
1333
  TextInput,
1334
- __spreadValues$a({
1334
+ __spreadValues$b({
1335
1335
  label: "Given name",
1336
1336
  placeholder: "Given name"
1337
1337
  }, form.getInputProps("givenName"))
1338
1338
  ), /* @__PURE__ */ React.createElement(
1339
1339
  TextInput,
1340
- __spreadValues$a({
1340
+ __spreadValues$b({
1341
1341
  label: "Family name",
1342
1342
  placeholder: "Family name"
1343
1343
  }, form.getInputProps("familyName"))
@@ -1386,7 +1386,7 @@ const Class = (props) => {
1386
1386
  ))))));
1387
1387
  };
1388
1388
  const DropzoneButton$1 = (props) => {
1389
- const { classes, theme } = useStyles$m();
1389
+ const { classes, theme } = useStyles$l();
1390
1390
  const openRef = React.useRef(null);
1391
1391
  const [loading, setLoading] = React.useState(false);
1392
1392
  const onDrop = React.useCallback((acceptedFiles) => {
@@ -1432,21 +1432,6 @@ const DropzoneButton$1 = (props) => {
1432
1432
  } }, "Select file"));
1433
1433
  };
1434
1434
 
1435
- const useStyles$l = createStyles((theme) => ({
1436
- th: { padding: "0 !important" },
1437
- control: {
1438
- width: "100%",
1439
- padding: `${theme.spacing.xs}px ${theme.spacing.md}px`,
1440
- "&:hover": {
1441
- backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0]
1442
- }
1443
- }
1444
- }));
1445
- function Th({ children, reversed, sorted, onSort }) {
1446
- const { classes } = useStyles$l();
1447
- const Icon = sorted ? reversed ? IconChevronUp : IconChevronDown : IconSelector;
1448
- return /* @__PURE__ */ React.createElement("th", { className: classes.th }, /* @__PURE__ */ React.createElement(UnstyledButton, { onClick: onSort, className: classes.control }, /* @__PURE__ */ React.createElement(Group, { position: "apart", noWrap: true, spacing: "xs" }, /* @__PURE__ */ React.createElement(Text, { weight: 500, size: "sm", sx: { whiteSpace: "nowrap" } }, children), /* @__PURE__ */ React.createElement(Center, null, /* @__PURE__ */ React.createElement(Icon, { size: 14, stroke: 1.5 })))));
1449
- }
1450
1435
  function Table$b(props) {
1451
1436
  const { items: sortedItems, requestSort, sortConfig } = useSortableData(props.items);
1452
1437
  if (props.items.length === 0) {
@@ -1468,39 +1453,64 @@ function Table$b(props) {
1468
1453
  confirmProps: { color: "red" },
1469
1454
  onConfirm: () => props.onDeleteClass(group)
1470
1455
  });
1471
- const rows = sortedItems.map((row) => /* @__PURE__ */ React.createElement("tr", { key: row.classId }, /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(UnstyledButton, { component: Link, to: row.href }, /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.name))), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.description)), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.numberOfStudents || 0)), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Group, { noWrap: true, spacing: 0, position: "right" }, /* @__PURE__ */ React.createElement(ActionIcon, { color: "red" }, /* @__PURE__ */ React.createElement(IconTrash, { onClick: () => openDeleteModal(row), size: 16, stroke: 1.5 }))))));
1472
- return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(Table$l, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement(
1473
- Th,
1474
- {
1475
- sorted: sortConfig.key === "name",
1476
- reversed: sortConfig.direction === "desc",
1477
- onSort: () => requestSort("name")
1478
- },
1479
- "Class Name"
1480
- ), /* @__PURE__ */ React.createElement("th", { style: { padding: "7px 16px" } }, /* @__PURE__ */ React.createElement(Text, { weight: 500, size: "sm" }, "Description")), /* @__PURE__ */ React.createElement(
1481
- Th,
1456
+ const sortStatus = {
1457
+ columnAccessor: sortConfig.key,
1458
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
1459
+ };
1460
+ return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(
1461
+ DataTable,
1482
1462
  {
1483
- sorted: sortConfig.key === "numberOfStudents",
1484
- reversed: sortConfig.direction === "desc",
1485
- onSort: () => requestSort("numberOfStudents")
1486
- },
1487
- "# of Students"
1488
- ), /* @__PURE__ */ React.createElement("th", null))), /* @__PURE__ */ React.createElement("tbody", null, rows)));
1463
+ withBorder: false,
1464
+ borderRadius: "sm",
1465
+ verticalSpacing: "sm",
1466
+ sx: { minWidth: 700 },
1467
+ highlightOnHover: true,
1468
+ striped: true,
1469
+ records: sortedItems,
1470
+ idAccessor: "classId",
1471
+ sortStatus,
1472
+ onSortStatusChange: (status) => requestSort(status.columnAccessor),
1473
+ columns: [
1474
+ {
1475
+ accessor: "name",
1476
+ title: "Class Name",
1477
+ sortable: true,
1478
+ render: (row) => /* @__PURE__ */ React.createElement(UnstyledButton, { component: Link, to: row.href }, /* @__PURE__ */ React.createElement(Text, { size: 14, weight: 500 }, row.name))
1479
+ },
1480
+ {
1481
+ accessor: "description",
1482
+ title: "Description",
1483
+ render: (row) => /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.description)
1484
+ },
1485
+ {
1486
+ accessor: "numberOfStudents",
1487
+ title: "# of Students",
1488
+ sortable: true,
1489
+ render: (row) => /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.numberOfStudents || 0)
1490
+ },
1491
+ {
1492
+ accessor: "actions",
1493
+ title: "",
1494
+ render: (row) => /* @__PURE__ */ React.createElement(Group, { noWrap: true, spacing: 0, position: "right" }, /* @__PURE__ */ React.createElement(ActionIcon, { color: "red", onClick: () => openDeleteModal(row) }, /* @__PURE__ */ React.createElement(IconTrash, { size: 16, stroke: 1.5 })))
1495
+ }
1496
+ ]
1497
+ }
1498
+ ));
1489
1499
  }
1490
1500
 
1491
- var __defProp$9 = Object.defineProperty;
1492
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1493
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1494
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1495
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1496
- var __spreadValues$9 = (a, b) => {
1501
+ var __defProp$a = Object.defineProperty;
1502
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1503
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1504
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1505
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1506
+ var __spreadValues$a = (a, b) => {
1497
1507
  for (var prop in b || (b = {}))
1498
- if (__hasOwnProp$9.call(b, prop))
1499
- __defNormalProp$9(a, prop, b[prop]);
1500
- if (__getOwnPropSymbols$9)
1501
- for (var prop of __getOwnPropSymbols$9(b)) {
1502
- if (__propIsEnum$9.call(b, prop))
1503
- __defNormalProp$9(a, prop, b[prop]);
1508
+ if (__hasOwnProp$a.call(b, prop))
1509
+ __defNormalProp$a(a, prop, b[prop]);
1510
+ if (__getOwnPropSymbols$a)
1511
+ for (var prop of __getOwnPropSymbols$a(b)) {
1512
+ if (__propIsEnum$a.call(b, prop))
1513
+ __defNormalProp$a(a, prop, b[prop]);
1504
1514
  }
1505
1515
  return a;
1506
1516
  };
@@ -1547,14 +1557,14 @@ const Classes = (props) => {
1547
1557
  props.onCreateClass && props.onCreateClass(values);
1548
1558
  }) }, /* @__PURE__ */ React.createElement(Stack$5, null, /* @__PURE__ */ React.createElement(
1549
1559
  TextInput,
1550
- __spreadValues$9({
1560
+ __spreadValues$a({
1551
1561
  withAsterisk: true,
1552
1562
  label: "Name",
1553
1563
  placeholder: "Class name"
1554
1564
  }, form.getInputProps("name"))
1555
1565
  ), /* @__PURE__ */ React.createElement(
1556
1566
  TextInput,
1557
- __spreadValues$9({
1567
+ __spreadValues$a({
1558
1568
  label: "Description",
1559
1569
  placeholder: "A class for my first period English students"
1560
1570
  }, form.getInputProps("description"))
@@ -1784,30 +1794,30 @@ function CardGradient(props) {
1784
1794
  ), /* @__PURE__ */ React.createElement(Text, { size: "xl", weight: 500, mt: "md" }, props.title), /* @__PURE__ */ React.createElement(Text, { size: "sm", mt: "sm", color: "dimmed" }, props.description));
1785
1795
  }
1786
1796
 
1787
- var __defProp$8 = Object.defineProperty;
1788
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1789
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1790
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1791
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1792
- var __spreadValues$8 = (a, b) => {
1797
+ var __defProp$9 = Object.defineProperty;
1798
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1799
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1800
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1801
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1802
+ var __spreadValues$9 = (a, b) => {
1793
1803
  for (var prop in b || (b = {}))
1794
- if (__hasOwnProp$8.call(b, prop))
1795
- __defNormalProp$8(a, prop, b[prop]);
1796
- if (__getOwnPropSymbols$8)
1797
- for (var prop of __getOwnPropSymbols$8(b)) {
1798
- if (__propIsEnum$8.call(b, prop))
1799
- __defNormalProp$8(a, prop, b[prop]);
1804
+ if (__hasOwnProp$9.call(b, prop))
1805
+ __defNormalProp$9(a, prop, b[prop]);
1806
+ if (__getOwnPropSymbols$9)
1807
+ for (var prop of __getOwnPropSymbols$9(b)) {
1808
+ if (__propIsEnum$9.call(b, prop))
1809
+ __defNormalProp$9(a, prop, b[prop]);
1800
1810
  }
1801
1811
  return a;
1802
1812
  };
1803
1813
  var __objRest$1 = (source, exclude) => {
1804
1814
  var target = {};
1805
1815
  for (var prop in source)
1806
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
1816
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
1807
1817
  target[prop] = source[prop];
1808
- if (source != null && __getOwnPropSymbols$8)
1809
- for (var prop of __getOwnPropSymbols$8(source)) {
1810
- if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
1818
+ if (source != null && __getOwnPropSymbols$9)
1819
+ for (var prop of __getOwnPropSymbols$9(source)) {
1820
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
1811
1821
  target[prop] = source[prop];
1812
1822
  }
1813
1823
  return target;
@@ -1874,9 +1884,9 @@ const TenantBanner = (_a) => {
1874
1884
  };
1875
1885
  return /* @__PURE__ */ React.createElement(
1876
1886
  Card,
1877
- __spreadValues$8({
1887
+ __spreadValues$9({
1878
1888
  radius: "md",
1879
- style: __spreadValues$8({ backgroundImage: `url(${image})` }, style),
1889
+ style: __spreadValues$9({ backgroundImage: `url(${image})` }, style),
1880
1890
  className: cx(classes.card, className)
1881
1891
  }, others),
1882
1892
  /* @__PURE__ */ React.createElement(
@@ -2049,31 +2059,36 @@ function Stack$3(props) {
2049
2059
  return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(UnstyledButton, { component: Link, to: props.href }, /* @__PURE__ */ React.createElement(Stack$5, { spacing: 24, sx: { padding: 20, minWidth: 700 } }, rows)));
2050
2060
  }
2051
2061
 
2052
- var __defProp$7 = Object.defineProperty;
2053
- var __defProps$5 = Object.defineProperties;
2054
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2055
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
2056
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
2057
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
2058
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2059
- var __spreadValues$7 = (a, b) => {
2062
+ var __defProp$8 = Object.defineProperty;
2063
+ var __defProps$6 = Object.defineProperties;
2064
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
2065
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
2066
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
2067
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
2068
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2069
+ var __spreadValues$8 = (a, b) => {
2060
2070
  for (var prop in b || (b = {}))
2061
- if (__hasOwnProp$7.call(b, prop))
2062
- __defNormalProp$7(a, prop, b[prop]);
2063
- if (__getOwnPropSymbols$7)
2064
- for (var prop of __getOwnPropSymbols$7(b)) {
2065
- if (__propIsEnum$7.call(b, prop))
2066
- __defNormalProp$7(a, prop, b[prop]);
2071
+ if (__hasOwnProp$8.call(b, prop))
2072
+ __defNormalProp$8(a, prop, b[prop]);
2073
+ if (__getOwnPropSymbols$8)
2074
+ for (var prop of __getOwnPropSymbols$8(b)) {
2075
+ if (__propIsEnum$8.call(b, prop))
2076
+ __defNormalProp$8(a, prop, b[prop]);
2067
2077
  }
2068
2078
  return a;
2069
2079
  };
2070
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2080
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
2071
2081
  function Table$6(props) {
2072
2082
  const preparedItems = React.useMemo(() => {
2073
- return props.items.map((item) => __spreadProps$5(__spreadValues$7({}, item), {
2083
+ return props.items.map((item) => __spreadProps$6(__spreadValues$8({}, item), {
2074
2084
  status: item.isComplete ? 2 : item.isStarted ? 1 : 0
2075
2085
  }));
2076
2086
  }, [props.items]);
2087
+ const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
2088
+ const sortStatus = {
2089
+ columnAccessor: sortConfig.key,
2090
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
2091
+ };
2077
2092
  if (props.items.length === 0) {
2078
2093
  return /* @__PURE__ */ React.createElement(
2079
2094
  PlaceholderBanner,
@@ -2085,11 +2100,6 @@ function Table$6(props) {
2085
2100
  }
2086
2101
  );
2087
2102
  }
2088
- const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
2089
- const sortStatus = {
2090
- columnAccessor: sortConfig.key,
2091
- direction: sortConfig.direction === "desc" ? "desc" : "asc"
2092
- };
2093
2103
  return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(
2094
2104
  DataTable,
2095
2105
  {
@@ -2557,25 +2567,25 @@ function Table$4(props) {
2557
2567
  return /* @__PURE__ */ React.createElement(ScrollArea, null, /* @__PURE__ */ React.createElement(Table$l, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement("th", null, "Name"), /* @__PURE__ */ React.createElement("th", null, "Role"), /* @__PURE__ */ React.createElement("th", null, "Account Created?"), /* @__PURE__ */ React.createElement("th", null, "# of Classes"), /* @__PURE__ */ React.createElement("th", null, "Last Active"), /* @__PURE__ */ React.createElement("th", null))), /* @__PURE__ */ React.createElement("tbody", null, rows)));
2558
2568
  }
2559
2569
 
2560
- var __defProp$6 = Object.defineProperty;
2561
- var __defProps$4 = Object.defineProperties;
2562
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
2563
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
2564
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
2565
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
2566
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2567
- var __spreadValues$6 = (a, b) => {
2570
+ var __defProp$7 = Object.defineProperty;
2571
+ var __defProps$5 = Object.defineProperties;
2572
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2573
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
2574
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
2575
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
2576
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2577
+ var __spreadValues$7 = (a, b) => {
2568
2578
  for (var prop in b || (b = {}))
2569
- if (__hasOwnProp$6.call(b, prop))
2570
- __defNormalProp$6(a, prop, b[prop]);
2571
- if (__getOwnPropSymbols$6)
2572
- for (var prop of __getOwnPropSymbols$6(b)) {
2573
- if (__propIsEnum$6.call(b, prop))
2574
- __defNormalProp$6(a, prop, b[prop]);
2579
+ if (__hasOwnProp$7.call(b, prop))
2580
+ __defNormalProp$7(a, prop, b[prop]);
2581
+ if (__getOwnPropSymbols$7)
2582
+ for (var prop of __getOwnPropSymbols$7(b)) {
2583
+ if (__propIsEnum$7.call(b, prop))
2584
+ __defNormalProp$7(a, prop, b[prop]);
2575
2585
  }
2576
2586
  return a;
2577
2587
  };
2578
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
2588
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2579
2589
  const useStyles$a = createStyles((theme) => ({
2580
2590
  title: {
2581
2591
  fontSize: 34,
@@ -2637,27 +2647,27 @@ const People = (props) => {
2637
2647
  padding: "xl",
2638
2648
  size: "xl"
2639
2649
  },
2640
- /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(DropzoneButton, __spreadProps$4(__spreadValues$6({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React.createElement(Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React.createElement("form", { onSubmit: form.onSubmit(() => {
2650
+ /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(DropzoneButton, __spreadProps$5(__spreadValues$7({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React.createElement(Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React.createElement("form", { onSubmit: form.onSubmit(() => {
2641
2651
  const values = form.values;
2642
2652
  form.reset();
2643
2653
  setOpened(false);
2644
2654
  props.onCreateUsers && props.onCreateUsers([values]);
2645
2655
  }) }, /* @__PURE__ */ React.createElement(Stack$5, null, /* @__PURE__ */ React.createElement(
2646
2656
  TextInput,
2647
- __spreadValues$6({
2657
+ __spreadValues$7({
2648
2658
  withAsterisk: true,
2649
2659
  label: "Email",
2650
2660
  placeholder: "Email"
2651
2661
  }, form.getInputProps("email"))
2652
2662
  ), /* @__PURE__ */ React.createElement(Group, { grow: true }, /* @__PURE__ */ React.createElement(
2653
2663
  TextInput,
2654
- __spreadValues$6({
2664
+ __spreadValues$7({
2655
2665
  label: "Given name",
2656
2666
  placeholder: "Given name"
2657
2667
  }, form.getInputProps("givenName"))
2658
2668
  ), /* @__PURE__ */ React.createElement(
2659
2669
  TextInput,
2660
- __spreadValues$6({
2670
+ __spreadValues$7({
2661
2671
  label: "Family name",
2662
2672
  placeholder: "Family name"
2663
2673
  }, form.getInputProps("familyName"))
@@ -2843,24 +2853,24 @@ const StartAnonymousLesson = (props) => {
2843
2853
  ))))));
2844
2854
  };
2845
2855
 
2846
- var __defProp$5 = Object.defineProperty;
2847
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
2848
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
2849
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
2850
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2851
- var __spreadValues$5 = (a, b) => {
2856
+ var __defProp$6 = Object.defineProperty;
2857
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
2858
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
2859
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
2860
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2861
+ var __spreadValues$6 = (a, b) => {
2852
2862
  for (var prop in b || (b = {}))
2853
- if (__hasOwnProp$5.call(b, prop))
2854
- __defNormalProp$5(a, prop, b[prop]);
2855
- if (__getOwnPropSymbols$5)
2856
- for (var prop of __getOwnPropSymbols$5(b)) {
2857
- if (__propIsEnum$5.call(b, prop))
2858
- __defNormalProp$5(a, prop, b[prop]);
2863
+ if (__hasOwnProp$6.call(b, prop))
2864
+ __defNormalProp$6(a, prop, b[prop]);
2865
+ if (__getOwnPropSymbols$6)
2866
+ for (var prop of __getOwnPropSymbols$6(b)) {
2867
+ if (__propIsEnum$6.call(b, prop))
2868
+ __defNormalProp$6(a, prop, b[prop]);
2859
2869
  }
2860
2870
  return a;
2861
2871
  };
2862
2872
  const BadgeGrid = (props) => {
2863
- const badges = props.badges.map((b) => /* @__PURE__ */ React.createElement(TaskCard, __spreadValues$5({ key: b.title }, b)));
2873
+ const badges = props.badges.map((b) => /* @__PURE__ */ React.createElement(TaskCard, __spreadValues$6({ key: b.title }, b)));
2864
2874
  return /* @__PURE__ */ React.createElement(SimpleGrid, { cols: 4, breakpoints: [{ maxWidth: "sm", cols: 1 }, { maxWidth: "md", cols: 3 }] }, badges);
2865
2875
  };
2866
2876
  function TaskCard(props) {
@@ -2924,33 +2934,33 @@ const TrialHome = (props) => {
2924
2934
  )), /* @__PURE__ */ React.createElement(Title, { maw: 500, mb: 20, mt: 20, className: classes.title }, "Based on the tags you selected, check out these lessons to get started with your students!"), /* @__PURE__ */ React.createElement(BadgeGrid, { onAssign: props.onAssign, badges: props.badges })));
2925
2935
  };
2926
2936
 
2927
- var __defProp$4 = Object.defineProperty;
2928
- var __defProps$3 = Object.defineProperties;
2929
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
2930
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
2931
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
2932
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
2933
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2934
- var __spreadValues$4 = (a, b) => {
2937
+ var __defProp$5 = Object.defineProperty;
2938
+ var __defProps$4 = Object.defineProperties;
2939
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
2940
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
2941
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
2942
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
2943
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2944
+ var __spreadValues$5 = (a, b) => {
2935
2945
  for (var prop in b || (b = {}))
2936
- if (__hasOwnProp$4.call(b, prop))
2937
- __defNormalProp$4(a, prop, b[prop]);
2938
- if (__getOwnPropSymbols$4)
2939
- for (var prop of __getOwnPropSymbols$4(b)) {
2940
- if (__propIsEnum$4.call(b, prop))
2941
- __defNormalProp$4(a, prop, b[prop]);
2946
+ if (__hasOwnProp$5.call(b, prop))
2947
+ __defNormalProp$5(a, prop, b[prop]);
2948
+ if (__getOwnPropSymbols$5)
2949
+ for (var prop of __getOwnPropSymbols$5(b)) {
2950
+ if (__propIsEnum$5.call(b, prop))
2951
+ __defNormalProp$5(a, prop, b[prop]);
2942
2952
  }
2943
2953
  return a;
2944
2954
  };
2945
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
2955
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
2946
2956
  var __objRest = (source, exclude) => {
2947
2957
  var target = {};
2948
2958
  for (var prop in source)
2949
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
2959
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
2950
2960
  target[prop] = source[prop];
2951
- if (source != null && __getOwnPropSymbols$4)
2952
- for (var prop of __getOwnPropSymbols$4(source)) {
2953
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
2961
+ if (source != null && __getOwnPropSymbols$5)
2962
+ for (var prop of __getOwnPropSymbols$5(source)) {
2963
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
2954
2964
  target[prop] = source[prop];
2955
2965
  }
2956
2966
  return target;
@@ -3000,7 +3010,7 @@ function ImageCheckbox(_a) {
3000
3010
  const { classes, cx } = useStyles$7({ checked: value });
3001
3011
  return /* @__PURE__ */ React.createElement(
3002
3012
  UnstyledButton,
3003
- __spreadProps$3(__spreadValues$4({}, others), {
3013
+ __spreadProps$4(__spreadValues$5({}, others), {
3004
3014
  onClick: () => handleChange(!value),
3005
3015
  className: cx(classes.button, className)
3006
3016
  }),
@@ -3021,7 +3031,7 @@ function ImageCheckbox(_a) {
3021
3031
  function SelectGrid(props) {
3022
3032
  const items = props.items.map((item) => /* @__PURE__ */ React.createElement(
3023
3033
  ImageCheckbox,
3024
- __spreadProps$3(__spreadValues$4({}, item), {
3034
+ __spreadProps$4(__spreadValues$5({}, item), {
3025
3035
  key: item.title,
3026
3036
  onChange: (checked) => props.onChange(item.title, checked)
3027
3037
  })
@@ -3039,25 +3049,25 @@ function SelectGrid(props) {
3039
3049
  );
3040
3050
  }
3041
3051
 
3042
- var __defProp$3 = Object.defineProperty;
3043
- var __defProps$2 = Object.defineProperties;
3044
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
3045
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
3046
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
3047
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
3048
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3049
- var __spreadValues$3 = (a, b) => {
3052
+ var __defProp$4 = Object.defineProperty;
3053
+ var __defProps$3 = Object.defineProperties;
3054
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
3055
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
3056
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
3057
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
3058
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3059
+ var __spreadValues$4 = (a, b) => {
3050
3060
  for (var prop in b || (b = {}))
3051
- if (__hasOwnProp$3.call(b, prop))
3052
- __defNormalProp$3(a, prop, b[prop]);
3053
- if (__getOwnPropSymbols$3)
3054
- for (var prop of __getOwnPropSymbols$3(b)) {
3055
- if (__propIsEnum$3.call(b, prop))
3056
- __defNormalProp$3(a, prop, b[prop]);
3061
+ if (__hasOwnProp$4.call(b, prop))
3062
+ __defNormalProp$4(a, prop, b[prop]);
3063
+ if (__getOwnPropSymbols$4)
3064
+ for (var prop of __getOwnPropSymbols$4(b)) {
3065
+ if (__propIsEnum$4.call(b, prop))
3066
+ __defNormalProp$4(a, prop, b[prop]);
3057
3067
  }
3058
3068
  return a;
3059
3069
  };
3060
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
3070
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
3061
3071
  const useStyles$6 = createStyles((theme) => ({
3062
3072
  wrapper: {
3063
3073
  minHeight: "100%",
@@ -3167,7 +3177,7 @@ const TrialRegistration = (props) => {
3167
3177
  label: "School/Organization Name",
3168
3178
  placeholder: "What's the name of your school?",
3169
3179
  data: props.organizations.map((o) => {
3170
- return __spreadProps$2(__spreadValues$3({}, o), { value: o.displayName });
3180
+ return __spreadProps$3(__spreadValues$4({}, o), { value: o.displayName });
3171
3181
  }),
3172
3182
  onItemSubmit: (item) => setOrganization({ organizationId: item.organizationId, displayName: item.displayName }),
3173
3183
  onChange: (next) => {
@@ -3179,7 +3189,7 @@ const TrialRegistration = (props) => {
3179
3189
  SelectGrid,
3180
3190
  {
3181
3191
  items: OPTIONS,
3182
- onChange: (e, checked) => setInterests(__spreadProps$2(__spreadValues$3({}, interests), { [e]: checked }))
3192
+ onChange: (e, checked) => setInterests(__spreadProps$3(__spreadValues$4({}, interests), { [e]: checked }))
3183
3193
  }
3184
3194
  ), /* @__PURE__ */ React.createElement(Group, { position: "right", mt: "md" }, /* @__PURE__ */ React.createElement(
3185
3195
  Button,
@@ -3217,25 +3227,25 @@ const AdminProvider = (props) => {
3217
3227
  );
3218
3228
  };
3219
3229
 
3220
- var __defProp$2 = Object.defineProperty;
3221
- var __defProps$1 = Object.defineProperties;
3222
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
3223
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
3224
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
3225
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
3226
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3227
- var __spreadValues$2 = (a, b) => {
3230
+ var __defProp$3 = Object.defineProperty;
3231
+ var __defProps$2 = Object.defineProperties;
3232
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
3233
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
3234
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
3235
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
3236
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3237
+ var __spreadValues$3 = (a, b) => {
3228
3238
  for (var prop in b || (b = {}))
3229
- if (__hasOwnProp$2.call(b, prop))
3230
- __defNormalProp$2(a, prop, b[prop]);
3231
- if (__getOwnPropSymbols$2)
3232
- for (var prop of __getOwnPropSymbols$2(b)) {
3233
- if (__propIsEnum$2.call(b, prop))
3234
- __defNormalProp$2(a, prop, b[prop]);
3239
+ if (__hasOwnProp$3.call(b, prop))
3240
+ __defNormalProp$3(a, prop, b[prop]);
3241
+ if (__getOwnPropSymbols$3)
3242
+ for (var prop of __getOwnPropSymbols$3(b)) {
3243
+ if (__propIsEnum$3.call(b, prop))
3244
+ __defNormalProp$3(a, prop, b[prop]);
3235
3245
  }
3236
3246
  return a;
3237
3247
  };
3238
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
3248
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
3239
3249
  const useStyles$5 = createStyles((theme, props) => ({
3240
3250
  footer: {
3241
3251
  paddingTop: theme.spacing.md,
@@ -3331,7 +3341,7 @@ const App = (props) => {
3331
3341
  padding: "xs",
3332
3342
  navbar: props.navbar && /* @__PURE__ */ React.createElement(
3333
3343
  Navbar,
3334
- __spreadProps$1(__spreadValues$2({}, props.navbar.props), {
3344
+ __spreadProps$2(__spreadValues$3({}, props.navbar.props), {
3335
3345
  onSwitchAccounts: account.accounts && account.accounts.length > 1 ? () => account.setChangeModalOpen(true) : void 0
3336
3346
  })
3337
3347
  ),
@@ -3524,25 +3534,25 @@ function Stack$1(props) {
3524
3534
  return /* @__PURE__ */ React.createElement(Grid, { grow: true, gutter: "lg", sx: { padding: 20, minWidth: 700 } }, rows);
3525
3535
  }
3526
3536
 
3527
- var __defProp$1 = Object.defineProperty;
3528
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
3529
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
3530
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
3531
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3532
- var __spreadValues$1 = (a, b) => {
3537
+ var __defProp$2 = Object.defineProperty;
3538
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
3539
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
3540
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
3541
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3542
+ var __spreadValues$2 = (a, b) => {
3533
3543
  for (var prop in b || (b = {}))
3534
- if (__hasOwnProp$1.call(b, prop))
3535
- __defNormalProp$1(a, prop, b[prop]);
3536
- if (__getOwnPropSymbols$1)
3537
- for (var prop of __getOwnPropSymbols$1(b)) {
3538
- if (__propIsEnum$1.call(b, prop))
3539
- __defNormalProp$1(a, prop, b[prop]);
3544
+ if (__hasOwnProp$2.call(b, prop))
3545
+ __defNormalProp$2(a, prop, b[prop]);
3546
+ if (__getOwnPropSymbols$2)
3547
+ for (var prop of __getOwnPropSymbols$2(b)) {
3548
+ if (__propIsEnum$2.call(b, prop))
3549
+ __defNormalProp$2(a, prop, b[prop]);
3540
3550
  }
3541
3551
  return a;
3542
3552
  };
3543
3553
  function Table$2(props) {
3544
3554
  const preparedItems = React.useMemo(() => {
3545
- return (props.items || []).map((item) => __spreadValues$1(__spreadValues$1({}, item), item.categoryPoints));
3555
+ return (props.items || []).map((item) => __spreadValues$2(__spreadValues$2({}, item), item.categoryPoints));
3546
3556
  }, [props.items]);
3547
3557
  const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
3548
3558
  if (props.loading && props.items.length === 0) {
@@ -3798,9 +3808,10 @@ const SplitButton = (props) => {
3798
3808
  };
3799
3809
 
3800
3810
  function Stack(props) {
3801
- if (!props.items.length)
3811
+ const { items, hideBadge, hideLesson } = props;
3812
+ if (!items.length)
3802
3813
  return null;
3803
- return /* @__PURE__ */ React.createElement(Grid, { gutter: "md", sx: { padding: 20, minWidth: 700 } }, /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "Link")), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "Badge")), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "Lesson")), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "Question")), props.items.map((row, i) => /* @__PURE__ */ React.createElement(React.Fragment, { key: i }, /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(
3814
+ return /* @__PURE__ */ React.createElement(Grid, { gutter: "md", sx: { padding: 20, minWidth: 700 } }, /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "Link")), !hideBadge && /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, { weight: "bold" }, "Badge")), !hideLesson && /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, { weight: "bold" }, "Lesson")), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "Question")), items.map((row, i) => /* @__PURE__ */ React.createElement(React.Fragment, { key: i }, /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(
3804
3815
  Button,
3805
3816
  {
3806
3817
  component: "a",
@@ -3811,33 +3822,33 @@ function Stack(props) {
3811
3822
  variant: "light"
3812
3823
  },
3813
3824
  "View File"
3814
- )), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, null, row.badgeName)), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, null, row.lessonName)), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, null, row.question)))));
3825
+ )), !hideBadge && /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, null, row.badgeName)), !hideLesson && /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, null, row.lessonName)), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, null, row.question)))));
3815
3826
  }
3816
3827
 
3817
- var __defProp = Object.defineProperty;
3818
- var __defProps = Object.defineProperties;
3819
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3820
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3821
- var __hasOwnProp = Object.prototype.hasOwnProperty;
3822
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
3823
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3824
- var __spreadValues = (a, b) => {
3828
+ var __defProp$1 = Object.defineProperty;
3829
+ var __defProps$1 = Object.defineProperties;
3830
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
3831
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
3832
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
3833
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
3834
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3835
+ var __spreadValues$1 = (a, b) => {
3825
3836
  for (var prop in b || (b = {}))
3826
- if (__hasOwnProp.call(b, prop))
3827
- __defNormalProp(a, prop, b[prop]);
3828
- if (__getOwnPropSymbols)
3829
- for (var prop of __getOwnPropSymbols(b)) {
3830
- if (__propIsEnum.call(b, prop))
3831
- __defNormalProp(a, prop, b[prop]);
3837
+ if (__hasOwnProp$1.call(b, prop))
3838
+ __defNormalProp$1(a, prop, b[prop]);
3839
+ if (__getOwnPropSymbols$1)
3840
+ for (var prop of __getOwnPropSymbols$1(b)) {
3841
+ if (__propIsEnum$1.call(b, prop))
3842
+ __defNormalProp$1(a, prop, b[prop]);
3832
3843
  }
3833
3844
  return a;
3834
3845
  };
3835
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
3846
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
3836
3847
  function Table(props) {
3837
3848
  const preparedItems = React.useMemo(() => {
3838
3849
  return props.items.map((item) => {
3839
3850
  var _a;
3840
- return __spreadProps(__spreadValues({}, item), {
3851
+ return __spreadProps$1(__spreadValues$1({}, item), {
3841
3852
  submissionCount: ((_a = item.submissions) == null ? void 0 : _a.length) || 0
3842
3853
  });
3843
3854
  });
@@ -3884,12 +3895,66 @@ function Table(props) {
3884
3895
  render: (row) => row.submissions.length
3885
3896
  }],
3886
3897
  rowExpansion: {
3887
- content: ({ record }) => /* @__PURE__ */ React.createElement(Stack, { items: record.submissions })
3898
+ content: ({ record }) => /* @__PURE__ */ React.createElement(
3899
+ Stack,
3900
+ {
3901
+ items: record.submissions,
3902
+ hideBadge: props.hideBadge,
3903
+ hideLesson: props.hideLesson
3904
+ }
3905
+ )
3888
3906
  }
3889
3907
  }
3890
3908
  ));
3891
3909
  }
3892
3910
 
3911
+ var __defProp = Object.defineProperty;
3912
+ var __defProps = Object.defineProperties;
3913
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3914
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3915
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
3916
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
3917
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3918
+ var __spreadValues = (a, b) => {
3919
+ for (var prop in b || (b = {}))
3920
+ if (__hasOwnProp.call(b, prop))
3921
+ __defNormalProp(a, prop, b[prop]);
3922
+ if (__getOwnPropSymbols)
3923
+ for (var prop of __getOwnPropSymbols(b)) {
3924
+ if (__propIsEnum.call(b, prop))
3925
+ __defNormalProp(a, prop, b[prop]);
3926
+ }
3927
+ return a;
3928
+ };
3929
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
3930
+ const useFilteredStudents = (students) => {
3931
+ return React.useMemo(() => {
3932
+ const byBadge = (badgeId) => students.map((s) => __spreadProps(__spreadValues({}, s), {
3933
+ submissions: (s.submissions || []).filter(
3934
+ (sub) => sub.badgeId === badgeId
3935
+ )
3936
+ })).filter((s) => s.submissions.length);
3937
+ const byLesson = (lessonName) => students.map((s) => __spreadProps(__spreadValues({}, s), {
3938
+ submissions: (s.submissions || []).filter(
3939
+ (sub) => sub.lessonName === lessonName
3940
+ )
3941
+ })).filter((s) => s.submissions.length);
3942
+ const byPathway = (pathwayId, badges) => {
3943
+ const validBadgeIds = badges.filter(
3944
+ (b) => Array.isArray(b.categories) && b.categories.some(
3945
+ (c) => c.startsWith(pathwayId)
3946
+ )
3947
+ ).map((b) => b.badgeId);
3948
+ return students.map((s) => __spreadProps(__spreadValues({}, s), {
3949
+ submissions: (s.submissions || []).filter(
3950
+ (sub) => validBadgeIds.includes(sub.badgeId)
3951
+ )
3952
+ })).filter((s) => s.submissions.length);
3953
+ };
3954
+ return { byBadge, byLesson, byPathway };
3955
+ }, [students]);
3956
+ };
3957
+
3893
3958
  const useStyles = createStyles((theme) => ({
3894
3959
  title: {
3895
3960
  fontSize: 34,
@@ -3902,6 +3967,43 @@ const useStyles = createStyles((theme) => ({
3902
3967
  maxWidth: 600
3903
3968
  }
3904
3969
  }));
3970
+ const BadgeTable = ({ badges, students, loading }) => {
3971
+ const { byBadge } = useFilteredStudents(students);
3972
+ return /* @__PURE__ */ React.createElement(Accordion, null, badges.map((b) => /* @__PURE__ */ React.createElement(Accordion.Item, { key: b.badgeId, value: b.badgeId }, /* @__PURE__ */ React.createElement(Accordion.Control, null, b.displayName), /* @__PURE__ */ React.createElement(Accordion.Panel, null, /* @__PURE__ */ React.createElement(
3973
+ Table,
3974
+ {
3975
+ loading,
3976
+ items: byBadge(b.badgeId),
3977
+ hideBadge: true
3978
+ }
3979
+ )))));
3980
+ };
3981
+ const LessonTableWrapper = ({ lessons, students, loading }) => {
3982
+ const { byLesson } = useFilteredStudents(students);
3983
+ return /* @__PURE__ */ React.createElement(Accordion, null, lessons.map((l) => /* @__PURE__ */ React.createElement(Accordion.Item, { key: l.lessonId, value: l.lessonId }, /* @__PURE__ */ React.createElement(Accordion.Control, null, l.lessonName), /* @__PURE__ */ React.createElement(Accordion.Panel, null, /* @__PURE__ */ React.createElement(
3984
+ Table,
3985
+ {
3986
+ loading,
3987
+ items: byLesson(l.lessonName),
3988
+ hideLesson: true
3989
+ }
3990
+ )))));
3991
+ };
3992
+ const PathwayTable = ({
3993
+ pathways,
3994
+ badges,
3995
+ students,
3996
+ loading
3997
+ }) => {
3998
+ const { byPathway } = useFilteredStudents(students);
3999
+ return /* @__PURE__ */ React.createElement(Accordion, null, pathways.map((p) => /* @__PURE__ */ React.createElement(Accordion.Item, { key: p.pathwayId, value: p.pathwayId }, /* @__PURE__ */ React.createElement(Accordion.Control, null, /* @__PURE__ */ React.createElement("strong", null, p.title), /* @__PURE__ */ React.createElement("div", null, p.description)), /* @__PURE__ */ React.createElement(Accordion.Panel, null, /* @__PURE__ */ React.createElement(
4000
+ Table,
4001
+ {
4002
+ loading,
4003
+ items: byPathway(p.pathwayId, badges)
4004
+ }
4005
+ )))));
4006
+ };
3905
4007
  const FileLocker = (props) => {
3906
4008
  const { classes } = useStyles();
3907
4009
  const [tab, setTab] = useState("students");
@@ -3967,8 +4069,30 @@ const FileLocker = (props) => {
3967
4069
  loading: props.loading,
3968
4070
  items: props.students
3969
4071
  }
4072
+ ), tab === "pathways" && /* @__PURE__ */ React.createElement(
4073
+ PathwayTable,
4074
+ {
4075
+ pathways: props.pathways || [],
4076
+ badges: props.badges || [],
4077
+ students: props.students,
4078
+ loading: props.loading
4079
+ }
4080
+ ), tab === "badges" && /* @__PURE__ */ React.createElement(
4081
+ BadgeTable,
4082
+ {
4083
+ badges: props.badges || [],
4084
+ students: props.students,
4085
+ loading: props.loading
4086
+ }
4087
+ ), tab === "lessons" && /* @__PURE__ */ React.createElement(
4088
+ LessonTableWrapper,
4089
+ {
4090
+ lessons: props.lessons,
4091
+ students: props.students,
4092
+ loading: props.loading
4093
+ }
3970
4094
  )))))));
3971
4095
  };
3972
4096
 
3973
- export { AdminProvider, App, Badge, Badges, Class, Classes, Dashboard, FileLocker, GettingStarted, Home, Lesson, Lessons, Navbar, Organization, Pathway, Pathways, People, StartAnonymousLesson, Student, SwitchAccount, TrialHome, TrialRegistration };
4097
+ export { AdminProvider, App, Badge, Badges, Class, Classes, Dashboard, FileLocker, GettingStarted, Home, Lesson, Lessons, Navbar, Organization, Pathway, PathwayTable, Pathways, People, StartAnonymousLesson, Student, SwitchAccount, TrialHome, TrialRegistration };
3974
4098
  //# sourceMappingURL=index.mjs.map