@local-civics/mgmt-ui 0.1.66 → 0.1.68

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
@@ -32,7 +32,7 @@ function _interopNamespaceDefault(e) {
32
32
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
33
33
  var papa__namespace = /*#__PURE__*/_interopNamespaceDefault(papa);
34
34
 
35
- const useStyles$j = core.createStyles((theme) => ({
35
+ const useStyles$n = core.createStyles((theme) => ({
36
36
  link: {
37
37
  width: 50,
38
38
  height: 50,
@@ -60,7 +60,7 @@ const data$1 = [
60
60
  { icon: icons.IconLambda, label: "Lessons", href: "/lessons" }
61
61
  ];
62
62
  const NavbarLink = ({ icon: Icon, label, active, onClick }) => {
63
- const { classes, cx } = useStyles$j();
63
+ const { classes, cx } = useStyles$n();
64
64
  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 })));
65
65
  };
66
66
  const Navbar = (props) => {
@@ -91,35 +91,35 @@ const Navbar = (props) => {
91
91
  ))));
92
92
  };
93
93
 
94
- var __defProp$5 = Object.defineProperty;
95
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
96
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
97
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
98
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
99
- var __spreadValues$5 = (a, b) => {
94
+ var __defProp$6 = Object.defineProperty;
95
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
96
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
97
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
98
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
99
+ var __spreadValues$6 = (a, b) => {
100
100
  for (var prop in b || (b = {}))
101
- if (__hasOwnProp$5.call(b, prop))
102
- __defNormalProp$5(a, prop, b[prop]);
103
- if (__getOwnPropSymbols$5)
104
- for (var prop of __getOwnPropSymbols$5(b)) {
105
- if (__propIsEnum$5.call(b, prop))
106
- __defNormalProp$5(a, prop, b[prop]);
101
+ if (__hasOwnProp$6.call(b, prop))
102
+ __defNormalProp$6(a, prop, b[prop]);
103
+ if (__getOwnPropSymbols$6)
104
+ for (var prop of __getOwnPropSymbols$6(b)) {
105
+ if (__propIsEnum$6.call(b, prop))
106
+ __defNormalProp$6(a, prop, b[prop]);
107
107
  }
108
108
  return a;
109
109
  };
110
110
  var __objRest$1 = (source, exclude) => {
111
111
  var target = {};
112
112
  for (var prop in source)
113
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
113
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
114
114
  target[prop] = source[prop];
115
- if (source != null && __getOwnPropSymbols$5)
116
- for (var prop of __getOwnPropSymbols$5(source)) {
117
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
115
+ if (source != null && __getOwnPropSymbols$6)
116
+ for (var prop of __getOwnPropSymbols$6(source)) {
117
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
118
118
  target[prop] = source[prop];
119
119
  }
120
120
  return target;
121
121
  };
122
- const useStyles$i = core.createStyles((theme) => ({
122
+ const useStyles$m = core.createStyles((theme) => ({
123
123
  user: {
124
124
  display: "block",
125
125
  width: "100%",
@@ -130,8 +130,8 @@ const useStyles$i = core.createStyles((theme) => ({
130
130
  }));
131
131
  function UserButton(_a) {
132
132
  var _b = _a, { image, name, email, icon } = _b, others = __objRest$1(_b, ["image", "name", "email", "icon"]);
133
- const { classes } = useStyles$i();
134
- 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)));
133
+ const { classes } = useStyles$m();
134
+ return /* @__PURE__ */ React__namespace.createElement(core.Group, __spreadValues$6({ 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)));
135
135
  }
136
136
 
137
137
  const compact = (num) => {
@@ -141,7 +141,7 @@ const compact = (num) => {
141
141
  }).format(num || 0);
142
142
  };
143
143
 
144
- const useStyles$h = core.createStyles((theme, _params, getRef) => {
144
+ const useStyles$l = core.createStyles((theme, _params, getRef) => {
145
145
  const icon = getRef("icon");
146
146
  return {
147
147
  control: {
@@ -194,7 +194,7 @@ const useStyles$h = core.createStyles((theme, _params, getRef) => {
194
194
  };
195
195
  });
196
196
  function LinksGroup({ icon: Icon, href, label, initiallyOpened, links, active, notifications }) {
197
- const { classes, theme, cx } = useStyles$h();
197
+ const { classes, theme, cx } = useStyles$l();
198
198
  const hasLinks = Array.isArray(links) && links.length > 0;
199
199
  const hasActiveLinks = Array.isArray(links) && links.map((l) => !!active && active === `${label}/${l.label}`).reduce((a, b) => a || b, false);
200
200
  const [opened, setOpened] = React.useState(initiallyOpened || hasActiveLinks || false);
@@ -239,26 +239,26 @@ function LinksGroup({ icon: Icon, href, label, initiallyOpened, links, active, n
239
239
  ), hasLinks ? /* @__PURE__ */ React__namespace.createElement(core.Collapse, { in: opened }, items) : null);
240
240
  }
241
241
 
242
- var __defProp$4 = Object.defineProperty;
243
- var __defProps$2 = Object.defineProperties;
244
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
245
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
246
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
247
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
248
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
249
- var __spreadValues$4 = (a, b) => {
242
+ var __defProp$5 = Object.defineProperty;
243
+ var __defProps$3 = Object.defineProperties;
244
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
245
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
246
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
247
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
248
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
249
+ var __spreadValues$5 = (a, b) => {
250
250
  for (var prop in b || (b = {}))
251
- if (__hasOwnProp$4.call(b, prop))
252
- __defNormalProp$4(a, prop, b[prop]);
253
- if (__getOwnPropSymbols$4)
254
- for (var prop of __getOwnPropSymbols$4(b)) {
255
- if (__propIsEnum$4.call(b, prop))
256
- __defNormalProp$4(a, prop, b[prop]);
251
+ if (__hasOwnProp$5.call(b, prop))
252
+ __defNormalProp$5(a, prop, b[prop]);
253
+ if (__getOwnPropSymbols$5)
254
+ for (var prop of __getOwnPropSymbols$5(b)) {
255
+ if (__propIsEnum$5.call(b, prop))
256
+ __defNormalProp$5(a, prop, b[prop]);
257
257
  }
258
258
  return a;
259
259
  };
260
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
261
- const useStyles$g = core.createStyles((theme, _params, getRef) => {
260
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
261
+ const useStyles$k = core.createStyles((theme, _params, getRef) => {
262
262
  const icon = getRef("icon");
263
263
  return {
264
264
  navbar: {
@@ -289,7 +289,7 @@ const useStyles$g = core.createStyles((theme, _params, getRef) => {
289
289
  color: theme.colorScheme === "dark" ? theme.white : theme.black,
290
290
  borderBottom: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[3]}`
291
291
  },
292
- link: __spreadProps$2(__spreadValues$4({}, theme.fn.focusStyles()), {
292
+ link: __spreadProps$3(__spreadValues$5({}, theme.fn.focusStyles()), {
293
293
  display: "flex",
294
294
  alignItems: "center",
295
295
  textDecoration: "none",
@@ -352,7 +352,7 @@ const data = [
352
352
  }
353
353
  ];
354
354
  function NestedNavbar(props) {
355
- const { classes, cx } = useStyles$g();
355
+ const { classes, cx } = useStyles$k();
356
356
  const [burgerOpen, setBurgerOpen] = React__namespace.useState(false);
357
357
  const toggle = () => setBurgerOpen(!burgerOpen);
358
358
  const links = data.map((item) => {
@@ -362,12 +362,12 @@ function NestedNavbar(props) {
362
362
  }
363
363
  return /* @__PURE__ */ React__namespace.createElement(
364
364
  LinksGroup,
365
- __spreadProps$2(__spreadValues$4(__spreadValues$4({
365
+ __spreadProps$3(__spreadValues$5(__spreadValues$5({
366
366
  key: item.label,
367
367
  active: props.active
368
368
  }, item), context), {
369
369
  links: (item.links || []).map((link) => {
370
- return __spreadValues$4(__spreadValues$4({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
370
+ return __spreadValues$5(__spreadValues$5({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
371
371
  })
372
372
  })
373
373
  );
@@ -389,7 +389,7 @@ function NestedNavbar(props) {
389
389
  } }, /* @__PURE__ */ React__namespace.createElement(icons.IconLogout, { className: classes.linkIcon, stroke: 1.5 }), /* @__PURE__ */ React__namespace.createElement("span", null, "Logout"))))));
390
390
  }
391
391
 
392
- const useStyles$f = core.createStyles((theme) => ({
392
+ const useStyles$j = core.createStyles((theme) => ({
393
393
  title: {
394
394
  fontSize: 34,
395
395
  fontWeight: 900,
@@ -430,7 +430,7 @@ const useStyles$f = core.createStyles((theme) => ({
430
430
  }
431
431
  }));
432
432
  const SwitchAccount = (props) => {
433
- const { classes, theme } = useStyles$f();
433
+ const { classes, theme } = useStyles$j();
434
434
  const options = props.accounts.map((a) => {
435
435
  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")));
436
436
  });
@@ -447,7 +447,7 @@ const SwitchAccount = (props) => {
447
447
  );
448
448
  };
449
449
 
450
- const useStyles$e = core.createStyles((theme) => ({
450
+ const useStyles$i = core.createStyles((theme) => ({
451
451
  root: {
452
452
  display: "flex",
453
453
  backgroundImage: `linear-gradient(-60deg, ${theme.colors[theme.primaryColor][4]} 0%, ${theme.colors[theme.primaryColor][7]} 100%)`,
@@ -494,7 +494,7 @@ const useStyles$e = core.createStyles((theme) => ({
494
494
  }
495
495
  }));
496
496
  const StatsGroup = ({ data }) => {
497
- const { classes } = useStyles$e();
497
+ const { classes } = useStyles$i();
498
498
  const stats = data.map((stat) => {
499
499
  const value = (() => {
500
500
  if (stat.unit === "%") {
@@ -513,7 +513,7 @@ const Tabs = (props) => {
513
513
  return /* @__PURE__ */ React__namespace.createElement(core.Tabs, { value: props.value, onTabChange: props.onChange }, /* @__PURE__ */ React__namespace.createElement(core.Tabs.List, null, tabs));
514
514
  };
515
515
 
516
- const useStyles$d = core.createStyles((theme) => ({
516
+ const useStyles$h = core.createStyles((theme) => ({
517
517
  button: {
518
518
  borderTopRightRadius: 0,
519
519
  borderBottomRightRadius: 0,
@@ -527,8 +527,8 @@ const useStyles$d = core.createStyles((theme) => ({
527
527
  borderLeft: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white}`
528
528
  }
529
529
  }));
530
- const SplitButton$2 = (props) => {
531
- const { classes, theme } = useStyles$d();
530
+ const SplitButton$3 = (props) => {
531
+ const { classes, theme } = useStyles$h();
532
532
  const menuIconColor = theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
533
533
  return /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
534
534
  core.Button,
@@ -565,7 +565,7 @@ const SplitButton$2 = (props) => {
565
565
  ))));
566
566
  };
567
567
 
568
- const useStyles$c = core.createStyles((theme) => ({
568
+ const useStyles$g = core.createStyles((theme) => ({
569
569
  wrapper: {
570
570
  display: "flex",
571
571
  alignItems: "center",
@@ -616,7 +616,7 @@ const useStyles$c = core.createStyles((theme) => ({
616
616
  }
617
617
  }));
618
618
  const PlaceholderBanner = (props) => {
619
- const { classes } = useStyles$c();
619
+ const { classes } = useStyles$g();
620
620
  const title = props.title || "Nothing to display";
621
621
  const description = props.description || "We don't have anything to show you here just yet. Add data, check back later, or adjust your search.";
622
622
  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 }));
@@ -630,7 +630,7 @@ function Stack$2(props) {
630
630
  return /* @__PURE__ */ React__namespace.createElement(core.Grid, { grow: true, gutter: "lg", sx: { padding: 20, minWidth: 700 } }, rows);
631
631
  }
632
632
 
633
- function Table$f(props) {
633
+ function Table$g(props) {
634
634
  if (props.items.length === 0) {
635
635
  return /* @__PURE__ */ React__namespace.createElement(
636
636
  PlaceholderBanner,
@@ -669,7 +669,7 @@ function Table$f(props) {
669
669
  ));
670
670
  }
671
671
 
672
- function Table$e(props) {
672
+ function Table$f(props) {
673
673
  if (props.items.length === 0) {
674
674
  return /* @__PURE__ */ React__namespace.createElement(
675
675
  PlaceholderBanner,
@@ -688,7 +688,7 @@ function Table$e(props) {
688
688
  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)));
689
689
  }
690
690
 
691
- const useStyles$b = core.createStyles((theme) => ({
691
+ const useStyles$f = core.createStyles((theme) => ({
692
692
  title: {
693
693
  fontSize: 34,
694
694
  fontWeight: 900,
@@ -701,7 +701,7 @@ const useStyles$b = core.createStyles((theme) => ({
701
701
  }
702
702
  }));
703
703
  const Badge = (props) => {
704
- const { classes } = useStyles$b();
704
+ const { classes } = useStyles$f();
705
705
  const [tab, setTab] = React.useState("lessons");
706
706
  const numberOfStudents = props.students.length;
707
707
  const percentageOfBadgesEarned = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length / numberOfStudents : 0;
@@ -714,7 +714,7 @@ const Badge = (props) => {
714
714
  },
715
715
  "Badges"
716
716
  )), /* @__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(
717
- SplitButton$2,
717
+ SplitButton$3,
718
718
  {
719
719
  href: props.href,
720
720
  onCopyLinkClick: props.onCopyLinkClick,
@@ -752,13 +752,13 @@ const Badge = (props) => {
752
752
  onChange: setTab
753
753
  }
754
754
  ), tab === "lessons" && /* @__PURE__ */ React__namespace.createElement(
755
- Table$e,
755
+ Table$f,
756
756
  {
757
757
  loading: props.loading,
758
758
  items: props.lessons
759
759
  }
760
760
  ), tab === "students" && /* @__PURE__ */ React__namespace.createElement(
761
- Table$f,
761
+ Table$g,
762
762
  {
763
763
  loading: props.loading,
764
764
  items: props.students
@@ -766,7 +766,7 @@ const Badge = (props) => {
766
766
  )))))));
767
767
  };
768
768
 
769
- function Table$d(props) {
769
+ function Table$e(props) {
770
770
  if (props.items.length === 0) {
771
771
  return /* @__PURE__ */ React__namespace.createElement(
772
772
  PlaceholderBanner,
@@ -798,7 +798,7 @@ function Table$d(props) {
798
798
  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)));
799
799
  }
800
800
 
801
- const useStyles$a = core.createStyles((theme) => ({
801
+ const useStyles$e = core.createStyles((theme) => ({
802
802
  title: {
803
803
  fontSize: 34,
804
804
  fontWeight: 900,
@@ -811,7 +811,7 @@ const useStyles$a = core.createStyles((theme) => ({
811
811
  }
812
812
  }));
813
813
  const Badges = (props) => {
814
- const { classes } = useStyles$a();
814
+ const { classes } = useStyles$e();
815
815
  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(
816
816
  core.Autocomplete,
817
817
  {
@@ -820,7 +820,7 @@ const Badges = (props) => {
820
820
  onChange: props.onAutocompleteChange
821
821
  }
822
822
  ), /* @__PURE__ */ React__namespace.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ React__namespace.createElement(core.LoadingOverlay, { visible: props.loading, overlayBlur: 2 }), /* @__PURE__ */ React__namespace.createElement(
823
- Table$d,
823
+ Table$e,
824
824
  {
825
825
  loading: props.loading,
826
826
  items: props.badges
@@ -828,7 +828,7 @@ const Badges = (props) => {
828
828
  ))));
829
829
  };
830
830
 
831
- function Table$c(props) {
831
+ function Table$d(props) {
832
832
  if (props.items.length === 0) {
833
833
  return /* @__PURE__ */ React__namespace.createElement(
834
834
  PlaceholderBanner,
@@ -868,7 +868,7 @@ function relativeTimeFromElapsed(elapsed) {
868
868
  return "";
869
869
  }
870
870
 
871
- function Table$b(props) {
871
+ function Table$c(props) {
872
872
  if (props.items.length === 0) {
873
873
  return /* @__PURE__ */ React__namespace.createElement(
874
874
  PlaceholderBanner,
@@ -884,7 +884,7 @@ function Table$b(props) {
884
884
  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)));
885
885
  }
886
886
 
887
- function Table$a(props) {
887
+ function Table$b(props) {
888
888
  if (props.items.length === 0) {
889
889
  return /* @__PURE__ */ React__namespace.createElement(
890
890
  PlaceholderBanner,
@@ -900,7 +900,7 @@ function Table$a(props) {
900
900
  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)));
901
901
  }
902
902
 
903
- function Table$9(props) {
903
+ function Table$a(props) {
904
904
  if (props.items.length === 0) {
905
905
  return /* @__PURE__ */ React__namespace.createElement(
906
906
  PlaceholderBanner,
@@ -916,7 +916,7 @@ function Table$9(props) {
916
916
  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)));
917
917
  }
918
918
 
919
- function Table$8(props) {
919
+ function Table$9(props) {
920
920
  if (props.items.length === 0) {
921
921
  return /* @__PURE__ */ React__namespace.createElement(
922
922
  PlaceholderBanner,
@@ -983,33 +983,33 @@ const Dashboard = (props) => {
983
983
  onChange: setTab
984
984
  }
985
985
  ), tab === "impact" && /* @__PURE__ */ React__namespace.createElement(
986
- Table$a,
986
+ Table$b,
987
987
  {
988
988
  loading: props.loading,
989
989
  items: props.impacts
990
990
  }
991
991
  ), tab === "reflections" && /* @__PURE__ */ React__namespace.createElement(
992
- Table$b,
992
+ Table$c,
993
993
  {
994
994
  loading: props.loading,
995
995
  items: props.reflections
996
996
  }
997
997
  ), tab === "badges" && /* @__PURE__ */ React__namespace.createElement(
998
- Table$9,
998
+ Table$a,
999
999
  {
1000
1000
  loading: props.loading,
1001
1001
  items: props.badges,
1002
1002
  onClick: props.onBadgeClick
1003
1003
  }
1004
1004
  ), tab === "lessons" && /* @__PURE__ */ React__namespace.createElement(
1005
- Table$8,
1005
+ Table$9,
1006
1006
  {
1007
1007
  loading: props.loading,
1008
1008
  items: props.lessons,
1009
1009
  onClick: props.onLessonClick
1010
1010
  }
1011
1011
  ), tab === "students" && /* @__PURE__ */ React__namespace.createElement(
1012
- Table$c,
1012
+ Table$d,
1013
1013
  {
1014
1014
  loading: props.loading,
1015
1015
  items: props.students,
@@ -1018,7 +1018,7 @@ const Dashboard = (props) => {
1018
1018
  )))))));
1019
1019
  };
1020
1020
 
1021
- const useStyles$9 = core.createStyles((theme) => ({
1021
+ const useStyles$d = core.createStyles((theme) => ({
1022
1022
  button: {
1023
1023
  borderTopRightRadius: 0,
1024
1024
  borderBottomRightRadius: 0,
@@ -1032,8 +1032,8 @@ const useStyles$9 = core.createStyles((theme) => ({
1032
1032
  borderLeft: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white}`
1033
1033
  }
1034
1034
  }));
1035
- const SplitButton$1 = (props) => {
1036
- const { classes, theme } = useStyles$9();
1035
+ const SplitButton$2 = (props) => {
1036
+ const { classes, theme } = useStyles$d();
1037
1037
  const menuIconColor = theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
1038
1038
  const hasMenu = !!props.withClassLink;
1039
1039
  return /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
@@ -1063,7 +1063,7 @@ const SplitButton$1 = (props) => {
1063
1063
  ))));
1064
1064
  };
1065
1065
 
1066
- function Table$7(props) {
1066
+ function Table$8(props) {
1067
1067
  if (props.items.length === 0) {
1068
1068
  return /* @__PURE__ */ React__namespace.createElement(
1069
1069
  PlaceholderBanner,
@@ -1095,26 +1095,26 @@ function Table$7(props) {
1095
1095
  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)));
1096
1096
  }
1097
1097
 
1098
- var __defProp$3 = Object.defineProperty;
1099
- var __defProps$1 = Object.defineProperties;
1100
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
1101
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1102
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1103
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1104
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1105
- var __spreadValues$3 = (a, b) => {
1098
+ var __defProp$4 = Object.defineProperty;
1099
+ var __defProps$2 = Object.defineProperties;
1100
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
1101
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1102
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1103
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1104
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1105
+ var __spreadValues$4 = (a, b) => {
1106
1106
  for (var prop in b || (b = {}))
1107
- if (__hasOwnProp$3.call(b, prop))
1108
- __defNormalProp$3(a, prop, b[prop]);
1109
- if (__getOwnPropSymbols$3)
1110
- for (var prop of __getOwnPropSymbols$3(b)) {
1111
- if (__propIsEnum$3.call(b, prop))
1112
- __defNormalProp$3(a, prop, b[prop]);
1107
+ if (__hasOwnProp$4.call(b, prop))
1108
+ __defNormalProp$4(a, prop, b[prop]);
1109
+ if (__getOwnPropSymbols$4)
1110
+ for (var prop of __getOwnPropSymbols$4(b)) {
1111
+ if (__propIsEnum$4.call(b, prop))
1112
+ __defNormalProp$4(a, prop, b[prop]);
1113
1113
  }
1114
1114
  return a;
1115
1115
  };
1116
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1117
- const useStyles$8 = core.createStyles((theme) => ({
1116
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1117
+ const useStyles$c = core.createStyles((theme) => ({
1118
1118
  title: {
1119
1119
  fontSize: 34,
1120
1120
  fontWeight: 900,
@@ -1147,7 +1147,7 @@ const useStyles$8 = core.createStyles((theme) => ({
1147
1147
  }
1148
1148
  }));
1149
1149
  const Class = (props) => {
1150
- const { classes } = useStyles$8();
1150
+ const { classes } = useStyles$c();
1151
1151
  const form$1 = form.useForm({
1152
1152
  initialValues: {
1153
1153
  classId: "",
@@ -1179,27 +1179,27 @@ const Class = (props) => {
1179
1179
  padding: "xl",
1180
1180
  size: "xl"
1181
1181
  },
1182
- /* @__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(() => {
1182
+ /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton$1, __spreadProps$2(__spreadValues$4({}, 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(() => {
1183
1183
  const values = form$1.values;
1184
1184
  form$1.reset();
1185
1185
  setOpened(false);
1186
1186
  props.onCreateMembers && props.onCreateMembers([values]);
1187
1187
  }) }, /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(
1188
1188
  core.TextInput,
1189
- __spreadValues$3({
1189
+ __spreadValues$4({
1190
1190
  withAsterisk: true,
1191
1191
  label: "Email",
1192
1192
  placeholder: "Email"
1193
1193
  }, form$1.getInputProps("email"))
1194
1194
  ), /* @__PURE__ */ React__namespace.createElement(core.Group, { grow: true }, /* @__PURE__ */ React__namespace.createElement(
1195
1195
  core.TextInput,
1196
- __spreadValues$3({
1196
+ __spreadValues$4({
1197
1197
  label: "Given name",
1198
1198
  placeholder: "Given name"
1199
1199
  }, form$1.getInputProps("givenName"))
1200
1200
  ), /* @__PURE__ */ React__namespace.createElement(
1201
1201
  core.TextInput,
1202
- __spreadValues$3({
1202
+ __spreadValues$4({
1203
1203
  label: "Family name",
1204
1204
  placeholder: "Family name"
1205
1205
  }, form$1.getInputProps("familyName"))
@@ -1213,7 +1213,7 @@ const Class = (props) => {
1213
1213
  },
1214
1214
  "Classes"
1215
1215
  )), /* @__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(
1216
- SplitButton$1,
1216
+ SplitButton$2,
1217
1217
  {
1218
1218
  withClassLink: props.withClassLink,
1219
1219
  onAddMembersClick: () => setOpened(true),
@@ -1222,7 +1222,7 @@ const Class = (props) => {
1222
1222
  ))), /* @__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: [
1223
1223
  {
1224
1224
  title: "# OF STUDENTS",
1225
- value: props.members.length
1225
+ value: props.members.filter((a) => !a.isAdmin).length
1226
1226
  },
1227
1227
  {
1228
1228
  title: "ACCOUNT CREATION",
@@ -1238,7 +1238,7 @@ const Class = (props) => {
1238
1238
  value: props.numberOfLessonsCompleted
1239
1239
  }
1240
1240
  ] }), /* @__PURE__ */ React__namespace.createElement(
1241
- Table$7,
1241
+ Table$8,
1242
1242
  {
1243
1243
  loading: props.loading,
1244
1244
  items: props.members,
@@ -1247,8 +1247,8 @@ const Class = (props) => {
1247
1247
  }
1248
1248
  ))))));
1249
1249
  };
1250
- const DropzoneButton = (props) => {
1251
- const { classes, theme } = useStyles$8();
1250
+ const DropzoneButton$1 = (props) => {
1251
+ const { classes, theme } = useStyles$c();
1252
1252
  const openRef = React__namespace.useRef(null);
1253
1253
  const [loading, setLoading] = React__namespace.useState(false);
1254
1254
  const onDrop = React__namespace.useCallback((acceptedFiles) => {
@@ -1294,7 +1294,7 @@ const DropzoneButton = (props) => {
1294
1294
  } }, "Select file"));
1295
1295
  };
1296
1296
 
1297
- function Table$6(props) {
1297
+ function Table$7(props) {
1298
1298
  if (props.items.length === 0) {
1299
1299
  return /* @__PURE__ */ React__namespace.createElement(
1300
1300
  PlaceholderBanner,
@@ -1318,23 +1318,23 @@ function Table$6(props) {
1318
1318
  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)));
1319
1319
  }
1320
1320
 
1321
- var __defProp$2 = Object.defineProperty;
1322
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1323
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1324
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1325
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1326
- var __spreadValues$2 = (a, b) => {
1321
+ var __defProp$3 = Object.defineProperty;
1322
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1323
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1324
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1325
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1326
+ var __spreadValues$3 = (a, b) => {
1327
1327
  for (var prop in b || (b = {}))
1328
- if (__hasOwnProp$2.call(b, prop))
1329
- __defNormalProp$2(a, prop, b[prop]);
1330
- if (__getOwnPropSymbols$2)
1331
- for (var prop of __getOwnPropSymbols$2(b)) {
1332
- if (__propIsEnum$2.call(b, prop))
1333
- __defNormalProp$2(a, prop, b[prop]);
1328
+ if (__hasOwnProp$3.call(b, prop))
1329
+ __defNormalProp$3(a, prop, b[prop]);
1330
+ if (__getOwnPropSymbols$3)
1331
+ for (var prop of __getOwnPropSymbols$3(b)) {
1332
+ if (__propIsEnum$3.call(b, prop))
1333
+ __defNormalProp$3(a, prop, b[prop]);
1334
1334
  }
1335
1335
  return a;
1336
1336
  };
1337
- const useStyles$7 = core.createStyles((theme) => ({
1337
+ const useStyles$b = core.createStyles((theme) => ({
1338
1338
  title: {
1339
1339
  fontSize: 34,
1340
1340
  fontWeight: 900,
@@ -1347,7 +1347,7 @@ const useStyles$7 = core.createStyles((theme) => ({
1347
1347
  }
1348
1348
  }));
1349
1349
  const Classes = (props) => {
1350
- const { classes } = useStyles$7();
1350
+ const { classes } = useStyles$b();
1351
1351
  const form$1 = form.useForm({
1352
1352
  initialValues: {
1353
1353
  classId: "",
@@ -1377,14 +1377,14 @@ const Classes = (props) => {
1377
1377
  props.onCreateClass && props.onCreateClass(values);
1378
1378
  }) }, /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(
1379
1379
  core.TextInput,
1380
- __spreadValues$2({
1380
+ __spreadValues$3({
1381
1381
  withAsterisk: true,
1382
1382
  label: "Name",
1383
1383
  placeholder: "Class name"
1384
1384
  }, form$1.getInputProps("name"))
1385
1385
  ), /* @__PURE__ */ React__namespace.createElement(
1386
1386
  core.TextInput,
1387
- __spreadValues$2({
1387
+ __spreadValues$3({
1388
1388
  label: "Description",
1389
1389
  placeholder: "A class for my first period English students"
1390
1390
  }, form$1.getInputProps("description"))
@@ -1409,7 +1409,7 @@ const Classes = (props) => {
1409
1409
  onChange: props.onAutocompleteChange
1410
1410
  }
1411
1411
  ), /* @__PURE__ */ React__namespace.createElement(
1412
- Table$6,
1412
+ Table$7,
1413
1413
  {
1414
1414
  loading: props.loading,
1415
1415
  items: props.classes,
@@ -1418,7 +1418,7 @@ const Classes = (props) => {
1418
1418
  ))))));
1419
1419
  };
1420
1420
 
1421
- const useStyles$6 = core.createStyles((theme) => ({
1421
+ const useStyles$a = core.createStyles((theme) => ({
1422
1422
  title: {
1423
1423
  fontSize: 34,
1424
1424
  fontWeight: 900,
@@ -1432,11 +1432,11 @@ const useStyles$6 = core.createStyles((theme) => ({
1432
1432
  }
1433
1433
  }));
1434
1434
  const UserInfo = (props) => {
1435
- const { classes } = useStyles$6();
1435
+ const { classes } = useStyles$a();
1436
1436
  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));
1437
1437
  };
1438
1438
 
1439
- function Table$5(props) {
1439
+ function Table$6(props) {
1440
1440
  if (props.items.length === 0) {
1441
1441
  return /* @__PURE__ */ React__namespace.createElement(
1442
1442
  PlaceholderBanner,
@@ -1467,15 +1467,12 @@ function Table$5(props) {
1467
1467
  }, {
1468
1468
  accessor: "status",
1469
1469
  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"))
1470
- }],
1471
- rowExpansion: {
1472
- content: ({ record }) => /* @__PURE__ */ React__namespace.createElement(Stack$2, { items: record.lessons })
1473
- }
1470
+ }]
1474
1471
  }
1475
1472
  ));
1476
1473
  }
1477
1474
 
1478
- function Table$4(props) {
1475
+ function Table$5(props) {
1479
1476
  if (props.items.length === 0) {
1480
1477
  return /* @__PURE__ */ React__namespace.createElement(
1481
1478
  PlaceholderBanner,
@@ -1491,7 +1488,7 @@ function Table$4(props) {
1491
1488
  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)));
1492
1489
  }
1493
1490
 
1494
- function Table$3(props) {
1491
+ function Table$4(props) {
1495
1492
  if (props.items.length === 0) {
1496
1493
  return /* @__PURE__ */ React__namespace.createElement(
1497
1494
  PlaceholderBanner,
@@ -1553,19 +1550,19 @@ const Student = (props) => {
1553
1550
  onChange: setTab
1554
1551
  }
1555
1552
  ), tab === "badges" && /* @__PURE__ */ React__namespace.createElement(
1556
- Table$5,
1553
+ Table$6,
1557
1554
  {
1558
1555
  loading: props.loading,
1559
1556
  items: props.badges
1560
1557
  }
1561
1558
  ), tab === "answers" && /* @__PURE__ */ React__namespace.createElement(
1562
- Table$4,
1559
+ Table$5,
1563
1560
  {
1564
1561
  loading: props.loading,
1565
1562
  items: props.answers
1566
1563
  }
1567
1564
  ), tab === "reflections" && /* @__PURE__ */ React__namespace.createElement(
1568
- Table$3,
1565
+ Table$4,
1569
1566
  {
1570
1567
  loading: props.loading,
1571
1568
  items: props.reflections
@@ -1573,7 +1570,7 @@ const Student = (props) => {
1573
1570
  ))))));
1574
1571
  };
1575
1572
 
1576
- const useStyles$5 = core.createStyles((theme, props) => {
1573
+ const useStyles$9 = core.createStyles((theme, props) => {
1577
1574
  const from = props.from || "blue";
1578
1575
  const to = props.to || "green";
1579
1576
  return {
@@ -1601,7 +1598,7 @@ const useStyles$5 = core.createStyles((theme, props) => {
1601
1598
  };
1602
1599
  });
1603
1600
  function CardGradient(props) {
1604
- const { classes } = useStyles$5(props);
1601
+ const { classes } = useStyles$9(props);
1605
1602
  const from = props.from || "blue";
1606
1603
  const to = props.to || "green";
1607
1604
  const icon = props.icon || /* @__PURE__ */ React__namespace.createElement(icons.IconColorSwatch, { size: 28, stroke: 1.5 });
@@ -1617,35 +1614,35 @@ function CardGradient(props) {
1617
1614
  ), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xl", weight: 500, mt: "md" }, props.title), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", mt: "sm", color: "dimmed" }, props.description));
1618
1615
  }
1619
1616
 
1620
- var __defProp$1 = Object.defineProperty;
1621
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
1622
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1623
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
1624
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1625
- var __spreadValues$1 = (a, b) => {
1617
+ var __defProp$2 = Object.defineProperty;
1618
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1619
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1620
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1621
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1622
+ var __spreadValues$2 = (a, b) => {
1626
1623
  for (var prop in b || (b = {}))
1627
- if (__hasOwnProp$1.call(b, prop))
1628
- __defNormalProp$1(a, prop, b[prop]);
1629
- if (__getOwnPropSymbols$1)
1630
- for (var prop of __getOwnPropSymbols$1(b)) {
1631
- if (__propIsEnum$1.call(b, prop))
1632
- __defNormalProp$1(a, prop, b[prop]);
1624
+ if (__hasOwnProp$2.call(b, prop))
1625
+ __defNormalProp$2(a, prop, b[prop]);
1626
+ if (__getOwnPropSymbols$2)
1627
+ for (var prop of __getOwnPropSymbols$2(b)) {
1628
+ if (__propIsEnum$2.call(b, prop))
1629
+ __defNormalProp$2(a, prop, b[prop]);
1633
1630
  }
1634
1631
  return a;
1635
1632
  };
1636
1633
  var __objRest = (source, exclude) => {
1637
1634
  var target = {};
1638
1635
  for (var prop in source)
1639
- if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
1636
+ if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
1640
1637
  target[prop] = source[prop];
1641
- if (source != null && __getOwnPropSymbols$1)
1642
- for (var prop of __getOwnPropSymbols$1(source)) {
1643
- if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
1638
+ if (source != null && __getOwnPropSymbols$2)
1639
+ for (var prop of __getOwnPropSymbols$2(source)) {
1640
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
1644
1641
  target[prop] = source[prop];
1645
1642
  }
1646
1643
  return target;
1647
1644
  };
1648
- const useStyles$4 = core.createStyles((theme) => ({
1645
+ const useStyles$8 = core.createStyles((theme) => ({
1649
1646
  card: {
1650
1647
  height: 240,
1651
1648
  backgroundSize: "cover",
@@ -1690,12 +1687,12 @@ const TenantBanner = (_a) => {
1690
1687
  "style",
1691
1688
  "className"
1692
1689
  ]);
1693
- const { classes, cx, theme } = useStyles$4();
1690
+ const { classes, cx, theme } = useStyles$8();
1694
1691
  return /* @__PURE__ */ React__namespace.createElement(
1695
1692
  core.Card,
1696
- __spreadValues$1({
1693
+ __spreadValues$2({
1697
1694
  radius: "md",
1698
- style: __spreadValues$1({ backgroundImage: `url(${image})` }, style),
1695
+ style: __spreadValues$2({ backgroundImage: `url(${image})` }, style),
1699
1696
  className: cx(classes.card, className)
1700
1697
  }, others),
1701
1698
  /* @__PURE__ */ React__namespace.createElement(
@@ -1772,7 +1769,7 @@ const Home = (props) => {
1772
1769
  )))));
1773
1770
  };
1774
1771
 
1775
- function Table$2(props) {
1772
+ function Table$3(props) {
1776
1773
  if (props.items.length === 0) {
1777
1774
  return /* @__PURE__ */ React__namespace.createElement(
1778
1775
  PlaceholderBanner,
@@ -1788,7 +1785,7 @@ function Table$2(props) {
1788
1785
  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)));
1789
1786
  }
1790
1787
 
1791
- const useStyles$3 = core.createStyles((theme) => ({
1788
+ const useStyles$7 = core.createStyles((theme) => ({
1792
1789
  button: {
1793
1790
  borderTopRightRadius: 0,
1794
1791
  borderBottomRightRadius: 0,
@@ -1802,8 +1799,8 @@ const useStyles$3 = core.createStyles((theme) => ({
1802
1799
  borderLeft: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white}`
1803
1800
  }
1804
1801
  }));
1805
- const SplitButton = (props) => {
1806
- const { classes, theme } = useStyles$3();
1802
+ const SplitButton$1 = (props) => {
1803
+ const { classes, theme } = useStyles$7();
1807
1804
  const menuIconColor = theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
1808
1805
  return /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
1809
1806
  core.Button,
@@ -1848,7 +1845,7 @@ function Stack$1(props) {
1848
1845
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { component: reactRouterDom.Link, to: props.href }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 24, sx: { padding: 20, minWidth: 700 } }, rows)));
1849
1846
  }
1850
1847
 
1851
- function Table$1(props) {
1848
+ function Table$2(props) {
1852
1849
  if (props.items.length === 0) {
1853
1850
  return /* @__PURE__ */ React__namespace.createElement(
1854
1851
  PlaceholderBanner,
@@ -1955,7 +1952,7 @@ function Stack(props) {
1955
1952
  }
1956
1953
  const truncateWithEllipses = (text, max) => text.substr(0, max - 1) + (text.length > max ? "&hellip;" : "");
1957
1954
 
1958
- const useStyles$2 = core.createStyles((theme) => ({
1955
+ const useStyles$6 = core.createStyles((theme) => ({
1959
1956
  title: {
1960
1957
  fontSize: 34,
1961
1958
  fontWeight: 900,
@@ -1968,7 +1965,7 @@ const useStyles$2 = core.createStyles((theme) => ({
1968
1965
  }
1969
1966
  }));
1970
1967
  const Lesson = (props) => {
1971
- const { classes } = useStyles$2();
1968
+ const { classes } = useStyles$6();
1972
1969
  const [tab, setTab] = React.useState("question");
1973
1970
  const numberOfStudents = props.students.length;
1974
1971
  const percentageOfLessonsCompleted = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length / numberOfStudents : 0;
@@ -1981,7 +1978,7 @@ const Lesson = (props) => {
1981
1978
  },
1982
1979
  "Lessons"
1983
1980
  )), /* @__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(
1984
- SplitButton,
1981
+ SplitButton$1,
1985
1982
  {
1986
1983
  href: props.href,
1987
1984
  onCopyLinkClick: props.onCopyLinkClick,
@@ -2026,13 +2023,13 @@ const Lesson = (props) => {
2026
2023
  items: props.questions
2027
2024
  }
2028
2025
  ), tab === "reflections" && /* @__PURE__ */ React__namespace.createElement(
2029
- Table$2,
2026
+ Table$3,
2030
2027
  {
2031
2028
  loading: props.loading,
2032
2029
  items: props.reflections
2033
2030
  }
2034
2031
  ), tab === "students" && /* @__PURE__ */ React__namespace.createElement(
2035
- Table$1,
2032
+ Table$2,
2036
2033
  {
2037
2034
  loading: props.loading,
2038
2035
  items: props.students
@@ -2040,7 +2037,7 @@ const Lesson = (props) => {
2040
2037
  )))))));
2041
2038
  };
2042
2039
 
2043
- function Table(props) {
2040
+ function Table$1(props) {
2044
2041
  if (props.items.length === 0) {
2045
2042
  return /* @__PURE__ */ React__namespace.createElement(
2046
2043
  PlaceholderBanner,
@@ -2072,7 +2069,7 @@ function Table(props) {
2072
2069
  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)));
2073
2070
  }
2074
2071
 
2075
- const useStyles$1 = core.createStyles((theme) => ({
2072
+ const useStyles$5 = core.createStyles((theme) => ({
2076
2073
  title: {
2077
2074
  fontSize: 34,
2078
2075
  fontWeight: 900,
@@ -2085,7 +2082,7 @@ const useStyles$1 = core.createStyles((theme) => ({
2085
2082
  }
2086
2083
  }));
2087
2084
  const Lessons = (props) => {
2088
- const { classes } = useStyles$1();
2085
+ const { classes } = useStyles$5();
2089
2086
  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(
2090
2087
  core.Autocomplete,
2091
2088
  {
@@ -2094,7 +2091,7 @@ const Lessons = (props) => {
2094
2091
  onChange: props.onAutocompleteChange
2095
2092
  }
2096
2093
  ), /* @__PURE__ */ React__namespace.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ React__namespace.createElement(core.LoadingOverlay, { visible: props.loading, overlayBlur: 2 }), /* @__PURE__ */ React__namespace.createElement(
2097
- Table,
2094
+ Table$1,
2098
2095
  {
2099
2096
  loading: props.loading,
2100
2097
  items: props.lessons
@@ -2102,6 +2099,385 @@ const Lessons = (props) => {
2102
2099
  ))));
2103
2100
  };
2104
2101
 
2102
+ const useStyles$4 = core.createStyles((theme) => ({
2103
+ title: {
2104
+ fontSize: 22,
2105
+ fontWeight: 900,
2106
+ fontFamily: `Greycliff CF, ${theme.fontFamily}`
2107
+ },
2108
+ controls: {
2109
+ [theme.fn.smallerThan("xs")]: {
2110
+ flexDirection: "column-reverse"
2111
+ }
2112
+ },
2113
+ control: {
2114
+ [theme.fn.smallerThan("xs")]: {
2115
+ width: "100%",
2116
+ textAlign: "center"
2117
+ }
2118
+ }
2119
+ }));
2120
+ function AccessCode(props) {
2121
+ const { classes } = useStyles$4();
2122
+ return /* @__PURE__ */ React__namespace.createElement(core.Container, { mx: "0", px: "0", size: 460, my: 30 }, /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, "Access code"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", size: "sm" }, "Grant access to join your organization"), /* @__PURE__ */ React__namespace.createElement(core.Paper, { withBorder: true, shadow: "md", p: 30, radius: "md", mt: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.TextInput, { value: props.value, readOnly: true }), /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart", mt: "lg", className: classes.controls }, /* @__PURE__ */ React__namespace.createElement(
2123
+ core.Anchor,
2124
+ {
2125
+ component: reactRouterDom.Link,
2126
+ to: props.peopleLink,
2127
+ color: "dimmed",
2128
+ size: "sm",
2129
+ className: classes.control
2130
+ },
2131
+ /* @__PURE__ */ React__namespace.createElement(core.Center, { inline: true }, /* @__PURE__ */ React__namespace.createElement(icons.IconPointer, { size: 12, stroke: 1.5 }), /* @__PURE__ */ React__namespace.createElement(core.Box, { ml: 5 }, "See people in my organization"))
2132
+ ), /* @__PURE__ */ React__namespace.createElement(core.Button, { onClick: props.onCopyCode, className: classes.control }, "Copy code"))));
2133
+ }
2134
+
2135
+ const monthNames = [
2136
+ "January",
2137
+ "February",
2138
+ "March",
2139
+ "April",
2140
+ "May",
2141
+ "June",
2142
+ "July",
2143
+ "August",
2144
+ "September",
2145
+ "October",
2146
+ "November",
2147
+ "December"
2148
+ ];
2149
+ const useStyles$3 = core.createStyles((theme) => ({
2150
+ title: {
2151
+ fontSize: 34,
2152
+ fontWeight: 900,
2153
+ [theme.fn.smallerThan("sm")]: {
2154
+ fontSize: 24
2155
+ }
2156
+ },
2157
+ description: {
2158
+ maxWidth: 600
2159
+ },
2160
+ wrapper: {
2161
+ position: "relative",
2162
+ marginBottom: 30
2163
+ },
2164
+ dropzone: {
2165
+ borderWidth: 1,
2166
+ paddingBottom: 50
2167
+ },
2168
+ icon: {
2169
+ color: theme.colorScheme === "dark" ? theme.colors.dark[3] : theme.colors.gray[4]
2170
+ },
2171
+ control: {
2172
+ position: "absolute",
2173
+ width: 250,
2174
+ left: "calc(50% - 125px)",
2175
+ bottom: -20
2176
+ }
2177
+ }));
2178
+ const Organization = (props) => {
2179
+ const { classes } = useStyles$3();
2180
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__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(
2181
+ core.Badge,
2182
+ {
2183
+ variant: "filled",
2184
+ leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
2185
+ size: "lg"
2186
+ },
2187
+ "Organization"
2188
+ )), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, props.displayName || "Overview"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, props.description || "No description"))), /* @__PURE__ */ React__namespace.createElement(AccessCode, { value: props.accessCode, onCopyCode: props.onCopyAccessCode, peopleLink: props.peopleLink }), /* @__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: [
2189
+ {
2190
+ title: "# OF STUDENTS",
2191
+ value: props.numberOfStudents || 0
2192
+ },
2193
+ {
2194
+ title: "# OF EDUCATORS",
2195
+ value: props.numberOfEducators || 0
2196
+ },
2197
+ {
2198
+ title: `ACTIVE USERS (${monthNames[new Date().getMonth()]})`,
2199
+ value: props.percentageOfAccountsActive,
2200
+ unit: "%"
2201
+ }
2202
+ ] }))))));
2203
+ };
2204
+
2205
+ const useStyles$2 = core.createStyles((theme) => ({
2206
+ button: {
2207
+ borderTopRightRadius: 0,
2208
+ borderBottomRightRadius: 0,
2209
+ marginLeft: 0,
2210
+ marginRight: 0
2211
+ },
2212
+ menuControl: {
2213
+ borderTopLeftRadius: 0,
2214
+ borderBottomLeftRadius: 0,
2215
+ border: 0,
2216
+ borderLeft: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[7] : theme.white}`
2217
+ }
2218
+ }));
2219
+ const SplitButton = (props) => {
2220
+ const { classes, theme } = useStyles$2();
2221
+ const menuIconColor = theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
2222
+ const hasMenu = !!props.withOrganizationLink;
2223
+ return /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
2224
+ core.Button,
2225
+ {
2226
+ className: hasMenu ? classes.button : "",
2227
+ leftIcon: /* @__PURE__ */ React__namespace.createElement(icons.IconPlaylistAdd, { size: 14 }),
2228
+ onClick: props.onAddUsersClick
2229
+ },
2230
+ "Add members"
2231
+ ), hasMenu && /* @__PURE__ */ React__namespace.createElement(core.Menu, { transition: "pop", position: "bottom-end" }, /* @__PURE__ */ React__namespace.createElement(core.Menu.Target, null, /* @__PURE__ */ React__namespace.createElement(
2232
+ core.ActionIcon,
2233
+ {
2234
+ variant: "filled",
2235
+ color: theme.primaryColor,
2236
+ size: 36,
2237
+ className: classes.menuControl
2238
+ },
2239
+ /* @__PURE__ */ React__namespace.createElement(icons.IconChevronDown, { size: 16, stroke: 1.5 })
2240
+ )), /* @__PURE__ */ React__namespace.createElement(core.Menu.Dropdown, null, !!props.withOrganizationLink && /* @__PURE__ */ React__namespace.createElement(
2241
+ core.Menu.Item,
2242
+ {
2243
+ icon: /* @__PURE__ */ React__namespace.createElement(icons.IconClipboardCopy, { size: 16, stroke: 1.5, color: menuIconColor }),
2244
+ onClick: props.onCopyOrganizationLinkClick
2245
+ },
2246
+ "Copy organization link"
2247
+ ))));
2248
+ };
2249
+
2250
+ function Table(props) {
2251
+ if (props.items.length === 0) {
2252
+ return /* @__PURE__ */ React__namespace.createElement(
2253
+ PlaceholderBanner,
2254
+ {
2255
+ title: "No people to display",
2256
+ description: "You have not rostered any people yet.",
2257
+ loading: props.loading,
2258
+ icon: "groups"
2259
+ }
2260
+ );
2261
+ }
2262
+ const openDeleteModal = (student) => modals.openConfirmModal({
2263
+ title: `Delete "${student.givenName && student.familyName ? `${student.givenName} ${student.familyName}` : student.email}"?`,
2264
+ centered: true,
2265
+ children: /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm" }, "Are you sure you want to delete this person? This action is destructive and you will have to contact support to restore your data."),
2266
+ labels: { confirm: "Delete", cancel: "No don't delete them" },
2267
+ confirmProps: { color: "red" },
2268
+ onConfirm: () => props.onDelete && props.onDelete(student)
2269
+ });
2270
+ 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: reactRouterDom.Link, to: 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: 150 }, /* @__PURE__ */ React__namespace.createElement(
2271
+ core.Select,
2272
+ {
2273
+ size: "sm",
2274
+ value: row.isAdmin ? "admin" : row.isGroupAdmin ? "educator" : "student",
2275
+ onChange: (value) => props.onRoleChange && props.onRoleChange(row, value),
2276
+ data: [{ value: "student", label: "Student" }, { value: "educator", label: "Educator" }, { value: "admin", label: "Admin" }]
2277
+ }
2278
+ ))), /* @__PURE__ */ React__namespace.createElement("td", null, row.hasAccount && /* @__PURE__ */ React__namespace.createElement(icons.IconCheck, { color: "green" })), /* @__PURE__ */ React__namespace.createElement("td", null, row.numberOfClasses), /* @__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 }))))));
2279
+ 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, "Account Created?"), /* @__PURE__ */ React__namespace.createElement("th", null, "# of Classes"), /* @__PURE__ */ React__namespace.createElement("th", null, "Last Active"), /* @__PURE__ */ React__namespace.createElement("th", null))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
2280
+ }
2281
+
2282
+ var __defProp$1 = Object.defineProperty;
2283
+ var __defProps$1 = Object.defineProperties;
2284
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
2285
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
2286
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
2287
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
2288
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2289
+ var __spreadValues$1 = (a, b) => {
2290
+ for (var prop in b || (b = {}))
2291
+ if (__hasOwnProp$1.call(b, prop))
2292
+ __defNormalProp$1(a, prop, b[prop]);
2293
+ if (__getOwnPropSymbols$1)
2294
+ for (var prop of __getOwnPropSymbols$1(b)) {
2295
+ if (__propIsEnum$1.call(b, prop))
2296
+ __defNormalProp$1(a, prop, b[prop]);
2297
+ }
2298
+ return a;
2299
+ };
2300
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
2301
+ const useStyles$1 = core.createStyles((theme) => ({
2302
+ title: {
2303
+ fontSize: 34,
2304
+ fontWeight: 900,
2305
+ [theme.fn.smallerThan("sm")]: {
2306
+ fontSize: 24
2307
+ }
2308
+ },
2309
+ description: {
2310
+ maxWidth: 600
2311
+ },
2312
+ wrapper: {
2313
+ position: "relative",
2314
+ marginBottom: 30
2315
+ },
2316
+ dropzone: {
2317
+ borderWidth: 1,
2318
+ paddingBottom: 50
2319
+ },
2320
+ icon: {
2321
+ color: theme.colorScheme === "dark" ? theme.colors.dark[3] : theme.colors.gray[4]
2322
+ },
2323
+ control: {
2324
+ position: "absolute",
2325
+ width: 250,
2326
+ left: "calc(50% - 125px)",
2327
+ bottom: -20
2328
+ }
2329
+ }));
2330
+ const People = (props) => {
2331
+ const { classes } = useStyles$1();
2332
+ const form$1 = form.useForm({
2333
+ initialValues: {
2334
+ userId: "",
2335
+ email: "",
2336
+ givenName: "",
2337
+ familyName: "",
2338
+ avatar: "",
2339
+ role: "",
2340
+ readonly: false,
2341
+ lastActivity: null,
2342
+ hasAccount: false,
2343
+ numberOfClasses: 0,
2344
+ href: "",
2345
+ isAdmin: false,
2346
+ isGroupAdmin: false
2347
+ },
2348
+ validate: {
2349
+ email: (value) => /^\S+@\S+$/.test(value) && props.users.filter((u) => u.email === value).length === 0 ? null : "Invalid email"
2350
+ }
2351
+ });
2352
+ const [opened, setOpened] = React.useState(false);
2353
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
2354
+ core.Drawer,
2355
+ {
2356
+ opened,
2357
+ onClose: () => setOpened(false),
2358
+ title: /* @__PURE__ */ React__namespace.createElement(core.Title, { size: "h5" }, "Add members"),
2359
+ padding: "xl",
2360
+ size: "xl"
2361
+ },
2362
+ /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton, __spreadProps$1(__spreadValues$1({}, 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(() => {
2363
+ const values = form$1.values;
2364
+ form$1.reset();
2365
+ setOpened(false);
2366
+ props.onCreateUsers && props.onCreateUsers([values]);
2367
+ }) }, /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(
2368
+ core.TextInput,
2369
+ __spreadValues$1({
2370
+ withAsterisk: true,
2371
+ label: "Email",
2372
+ placeholder: "Email"
2373
+ }, form$1.getInputProps("email"))
2374
+ ), /* @__PURE__ */ React__namespace.createElement(core.Group, { grow: true }, /* @__PURE__ */ React__namespace.createElement(
2375
+ core.TextInput,
2376
+ __spreadValues$1({
2377
+ label: "Given name",
2378
+ placeholder: "Given name"
2379
+ }, form$1.getInputProps("givenName"))
2380
+ ), /* @__PURE__ */ React__namespace.createElement(
2381
+ core.TextInput,
2382
+ __spreadValues$1({
2383
+ label: "Family name",
2384
+ placeholder: "Family name"
2385
+ }, form$1.getInputProps("familyName"))
2386
+ )), /* @__PURE__ */ React__namespace.createElement(core.Button, { type: "submit", fullWidth: true, mt: "md" }, "Submit"))))
2387
+ ), /* @__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(
2388
+ core.Badge,
2389
+ {
2390
+ variant: "filled",
2391
+ leftSection: /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "blue", size: "xs", radius: "xl", variant: "filled" }, /* @__PURE__ */ React__namespace.createElement(icons.IconArrowLeft, { size: 14 })),
2392
+ size: "lg"
2393
+ },
2394
+ "Organization"
2395
+ )), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, "People"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, "Manage members of your organization")), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "content" }, !props.loading && /* @__PURE__ */ React__namespace.createElement(
2396
+ SplitButton,
2397
+ {
2398
+ withOrganizationLink: props.withOrganizationLink,
2399
+ onAddUsersClick: () => setOpened(true),
2400
+ onCopyOrganizationLinkClick: props.onCopyLinkClick
2401
+ }
2402
+ ))), /* @__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: [
2403
+ {
2404
+ title: "# OF PEOPLE",
2405
+ value: props.users.length
2406
+ },
2407
+ {
2408
+ title: "ACCOUNT CREATION",
2409
+ value: props.percentageOfAccountsCreated,
2410
+ unit: "%"
2411
+ },
2412
+ {
2413
+ title: "PERCENTAGE ROSTERED",
2414
+ unit: "%",
2415
+ value: props.percentageRostered
2416
+ }
2417
+ ] }), /* @__PURE__ */ React__namespace.createElement(
2418
+ core.Autocomplete,
2419
+ {
2420
+ placeholder: "Search for a people in your organization",
2421
+ data: props.users.map((item) => item.email),
2422
+ onChange: props.onAutocompleteChange
2423
+ }
2424
+ ), /* @__PURE__ */ React__namespace.createElement(
2425
+ Table,
2426
+ {
2427
+ loading: props.loading,
2428
+ items: props.users,
2429
+ onDelete: props.onDeleteUser,
2430
+ onRoleChange: props.onChangeUserRole
2431
+ }
2432
+ ))))));
2433
+ };
2434
+ const DropzoneButton = (props) => {
2435
+ const { classes, theme } = useStyles$1();
2436
+ const openRef = React__namespace.useRef(null);
2437
+ const [loading, setLoading] = React__namespace.useState(false);
2438
+ const onDrop = React__namespace.useCallback((acceptedFiles) => {
2439
+ setLoading(true);
2440
+ acceptedFiles.forEach((file) => {
2441
+ papa__namespace.parse(file, {
2442
+ download: true,
2443
+ header: true,
2444
+ dynamicTyping: true,
2445
+ skipEmptyLines: true,
2446
+ worker: true,
2447
+ complete: function(results) {
2448
+ const data = results.data.filter((v) => /^\S+@\S+$/.test(v.email) && props.users.filter((u) => u.email === v.email).length === 0);
2449
+ data.length > 0 && props.onCreateUsers && props.onCreateUsers(data);
2450
+ setLoading(false);
2451
+ props.close();
2452
+ }
2453
+ });
2454
+ });
2455
+ }, []);
2456
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React__namespace.createElement(
2457
+ dropzone.Dropzone,
2458
+ {
2459
+ loading,
2460
+ openRef,
2461
+ onDrop,
2462
+ className: classes.dropzone,
2463
+ radius: "md",
2464
+ accept: [dropzone.MIME_TYPES.csv],
2465
+ maxSize: 5 * 1024 ** 2
2466
+ },
2467
+ /* @__PURE__ */ React__namespace.createElement("div", { style: { pointerEvents: "none" } }, /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "center" }, /* @__PURE__ */ React__namespace.createElement(dropzone.Dropzone.Accept, null, /* @__PURE__ */ React__namespace.createElement(icons.IconDownload, { size: 50, color: theme.colors[theme.primaryColor][6], stroke: 1.5 })), /* @__PURE__ */ React__namespace.createElement(dropzone.Dropzone.Reject, null, /* @__PURE__ */ React__namespace.createElement(icons.IconX, { size: 50, color: theme.colors.red[6], stroke: 1.5 })), /* @__PURE__ */ React__namespace.createElement(dropzone.Dropzone.Idle, null, /* @__PURE__ */ React__namespace.createElement(
2468
+ icons.IconCloudUpload,
2469
+ {
2470
+ size: 50,
2471
+ color: theme.colorScheme === "dark" ? theme.colors.dark[0] : theme.black,
2472
+ stroke: 1.5
2473
+ }
2474
+ ))), /* @__PURE__ */ React__namespace.createElement(core.Text, { align: "center", weight: 700, size: "lg", mt: "xl" }, /* @__PURE__ */ React__namespace.createElement(dropzone.Dropzone.Accept, null, "Drop files here"), /* @__PURE__ */ React__namespace.createElement(dropzone.Dropzone.Reject, null, "Csv file less than 5mb"), /* @__PURE__ */ React__namespace.createElement(dropzone.Dropzone.Idle, null, "Upload multiple")), /* @__PURE__ */ React__namespace.createElement(core.Text, { align: "center", size: "sm", mt: "xs", color: "dimmed" }, "Drag'n'drop files here to upload. We can accept only ", /* @__PURE__ */ React__namespace.createElement("i", null, ".csv"), " files that are less than 5mb in size."))
2475
+ ), /* @__PURE__ */ React__namespace.createElement(core.Button, { className: classes.control, size: "md", radius: "xl", onClick: () => {
2476
+ var _a;
2477
+ return (_a = openRef.current) == null ? void 0 : _a.call(openRef);
2478
+ } }, "Select file"));
2479
+ };
2480
+
2105
2481
  const mycCache = core.createEmotionCache({
2106
2482
  key: "mantine",
2107
2483
  prepend: false
@@ -2334,6 +2710,8 @@ exports.Lesson = Lesson;
2334
2710
  exports.Lessons = Lessons;
2335
2711
  exports.Navbar = Navbar;
2336
2712
  exports.NestedNavbar = NestedNavbar;
2713
+ exports.Organization = Organization;
2714
+ exports.People = People;
2337
2715
  exports.Student = Student;
2338
2716
  exports.SwitchAccount = SwitchAccount;
2339
2717
  //# sourceMappingURL=index.js.map