@local-civics/mgmt-ui 0.1.39 → 0.1.40
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/components/banners/PlaceholderBanner/PlaceholderBanner.d.ts +2 -1
- package/dist/components/banners/PlaceholderBanner/component.stories.d.ts +0 -1
- package/dist/components/banners/TenantBanner/TenantBanner.d.ts +2 -3
- package/dist/components/cards/CardGradient.d.ts +10 -0
- package/dist/{pages/Groups → components/cards}/component.stories.d.ts +3 -4
- package/dist/components/data/LineChart/LineChart.d.ts +0 -1
- package/dist/components/data/StatsGrid/StatsGrid.d.ts +0 -1
- package/dist/components/data/StatsGroup/StatsGroup.d.ts +1 -2
- package/dist/components/navigation/Navbar/Navbar.d.ts +0 -1
- package/dist/components/navigation/Navbar/component.stories.d.ts +0 -1
- package/dist/components/navigation/Tabs/Tabs.d.ts +0 -1
- package/dist/components/users/UserInfo/UserInfo.d.ts +2 -7
- package/dist/index.d.ts +3 -3
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/dist/pages/Badge/Badge.d.ts +10 -8
- package/dist/pages/Badge/LessonTable.d.ts +31 -0
- package/dist/pages/Badge/Table.d.ts +0 -1
- package/dist/pages/Badge/component.stories.d.ts +4 -1
- package/dist/pages/Badges/Badges.d.ts +0 -1
- package/dist/pages/Badges/Table.d.ts +0 -1
- package/dist/pages/Badges/component.stories.d.ts +0 -1
- package/dist/pages/Class/Class.d.ts +27 -0
- package/dist/pages/{Group → Class}/Table.d.ts +7 -7
- package/dist/pages/Class/component.stories.d.ts +18 -0
- package/dist/pages/Classes/Classes.d.ts +21 -0
- package/dist/pages/{Groups → Classes}/Table.d.ts +2 -3
- package/dist/pages/Classes/component.stories.d.ts +18 -0
- package/dist/pages/Dashboard/BadgeTable.d.ts +32 -0
- package/dist/pages/Dashboard/Dashboard.d.ts +27 -8
- package/dist/pages/Dashboard/ImpactTable.d.ts +28 -0
- package/dist/pages/Dashboard/LessonTable.d.ts +32 -0
- package/dist/pages/Dashboard/StudentTable.d.ts +31 -0
- package/dist/pages/Dashboard/component.stories.d.ts +4 -1
- package/dist/pages/Home/Home.d.ts +11 -22
- package/dist/pages/Home/component.stories.d.ts +0 -1
- package/dist/pages/Lesson/Lesson.d.ts +11 -8
- package/dist/pages/Lesson/QuestionStack.d.ts +30 -0
- package/dist/pages/Lesson/ReflectionTable.d.ts +29 -0
- package/dist/pages/Lesson/Table.d.ts +0 -1
- package/dist/pages/Lesson/component.stories.d.ts +4 -1
- package/dist/pages/Lessons/Lessons.d.ts +0 -1
- package/dist/pages/Lessons/Table.d.ts +0 -1
- package/dist/pages/Lessons/component.stories.d.ts +0 -1
- package/dist/pages/Student/AnswerTable.d.ts +29 -0
- package/dist/pages/Student/BadgeTable.d.ts +30 -0
- package/dist/pages/Student/ReflectionTable.d.ts +29 -0
- package/dist/pages/Student/Student.d.ts +26 -0
- package/dist/pages/Student/component.stories.d.ts +18 -0
- package/dist/shells/App/SwitchAccount/SwitchAccount.d.ts +0 -1
- package/dist/shells/App/SwitchAccount/component.stories.d.ts +0 -1
- package/dist/shells/App/component.stories.d.ts +0 -1
- package/package.json +2 -1
- package/dist/components/data/Timeline/Timeline.d.ts +0 -22
- package/dist/pages/Group/Group.d.ts +0 -26
- package/dist/pages/GroupUser/GroupUser.d.ts +0 -28
- package/dist/pages/Groups/Groups.d.ts +0 -22
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
/**
|
|
3
2
|
* PlaceholderBannerIcon
|
|
4
3
|
*/
|
|
@@ -9,5 +8,7 @@ export type PlaceholderBannerIcon = "badges" | "lessons" | "dashboard" | "groups
|
|
|
9
8
|
export type PlaceholderBannerProps = {
|
|
10
9
|
loading: boolean;
|
|
11
10
|
icon: PlaceholderBannerIcon;
|
|
11
|
+
title?: string;
|
|
12
|
+
description?: string;
|
|
12
13
|
};
|
|
13
14
|
export declare const PlaceholderBanner: (props: PlaceholderBannerProps) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type CardGradientProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
from?: string;
|
|
8
|
+
to?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function CardGradient(props: CardGradientProps): JSX.Element;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GroupsProps } from "./Groups";
|
|
3
1
|
import { Story } from "@storybook/react";
|
|
2
|
+
import { CardGradient, CardGradientProps } from "./CardGradient";
|
|
4
3
|
/**
|
|
5
4
|
* Storybook component configuration
|
|
6
5
|
*/
|
|
7
6
|
declare const _default: {
|
|
8
7
|
title: string;
|
|
9
|
-
component:
|
|
8
|
+
component: typeof CardGradient;
|
|
10
9
|
};
|
|
11
10
|
export default _default;
|
|
12
11
|
/**
|
|
13
12
|
* Component stories
|
|
14
13
|
*/
|
|
15
|
-
export declare const Component: Story<
|
|
14
|
+
export declare const Component: Story<CardGradientProps>;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export type UserInfoProps = {
|
|
3
2
|
variant?: "compact";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
familyName: string;
|
|
7
|
-
email: string;
|
|
8
|
-
job: string;
|
|
9
|
-
quote: string;
|
|
3
|
+
name: string;
|
|
4
|
+
impactStatement: string;
|
|
10
5
|
};
|
|
11
6
|
/**
|
|
12
7
|
* UserInfo
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ export * from './hooks/notifications';
|
|
|
2
2
|
export * from './pages/Badge/Badge';
|
|
3
3
|
export * from './pages/Badges/Badges';
|
|
4
4
|
export * from './pages/Dashboard/Dashboard';
|
|
5
|
-
export * from './pages/
|
|
6
|
-
export * from './pages/
|
|
7
|
-
export * from './pages/
|
|
5
|
+
export * from './pages/Class/Class';
|
|
6
|
+
export * from './pages/Classes/Classes';
|
|
7
|
+
export * from './pages/Student/Student';
|
|
8
8
|
export * from './pages/Home/Home';
|
|
9
9
|
export * from './pages/Lesson/Lesson';
|
|
10
10
|
export * from './pages/Lessons/Lessons';
|
package/dist/index.es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NotificationsProvider as e}from"@mantine/notifications";export{showNotification,updateNotification}from"@mantine/notifications";import{jsxs as i,jsx as n,Fragment as r}from"react/jsx-runtime";import{IconArrowLeft as t,IconCategory2 as o,IconInfoCircle as l,IconCalendar as a,IconTrash as c,IconPlaylistAdd as s,IconDownload as d,IconX as m,IconCloudUpload as h,IconBadges as u,IconSchool as p,IconActivityHeartbeat as g,IconTimelineEvent as f,IconSwitchHorizontal as v,IconLogout as y,IconHome2 as b,IconGauge as k,IconAlbum as C,IconLambda as z,IconBrandInstagram as x,IconBrandLinkedin as S,IconBrandFacebook as w}from"@tabler/icons";import{createStyles as N,Title as D,Text as L,Image as T,UnstyledButton as B,Group as W,Avatar as A,Badge as I,ScrollArea as F,Table as R,Container as O,Stack as P,Grid as j,ActionIcon as E,Button as G,Divider as M,Select as H,LoadingOverlay as V,Autocomplete as U,Paper as _,Tooltip as q,Drawer as Y,TextInput as K,Anchor as $,Timeline as J,Blockquote as Q,Card as Z,Overlay as X,createEmotionCache as ee,MantineProvider as ie,Modal as ne,Navbar as re,Center as te,AppShell as oe,Loader as le}from"@mantine/core";import{DateRangePicker as ae}from"@mantine/dates";import ce from"dayjs";import{ResponsiveContainer as se,LineChart as de,XAxis as me,YAxis as he,CartesianGrid as ue,Tooltip as pe,Line as ge}from"recharts";import*as fe from"react";import{useState as ve,useRef as ye}from"react";import{Dropzone as be,MIME_TYPES as ke}from"@mantine/dropzone";import{useForm as Ce}from"@mantine/form";import*as ze from"papaparse";import{openConfirmModal as xe,ModalsProvider as Se}from"@mantine/modals";var we=function(){return we=Object.assign||function(e){for(var i,n=1,r=arguments.length;n<r;n++)for(var t in i=arguments[n])Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t]);return e},we.apply(this,arguments)};function Ne(e,i,n){if(n||2===arguments.length)for(var r,t=0,o=i.length;t<o;t++)!r&&t in i||(r||(r=Array.prototype.slice.call(i,0,t)),r[t]=i[t]);return e.concat(r||Array.prototype.slice.call(i))}var De=N((function(e){var i,n,r;return{wrapper:(i={display:"flex",alignItems:"center",padding:2*e.spacing.xl,borderRadius:e.radius.md,backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.white,border:"1px solid ".concat("dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[3])},i["@media (max-width: ".concat(e.breakpoints.sm,"px)")]={flexDirection:"column-reverse",padding:e.spacing.xl},i),image:(n={maxWidth:"40%"},n["@media (max-width: ".concat(e.breakpoints.sm,"px)")]={maxWidth:"100%"},n),body:(r={paddingRight:4*e.spacing.xl},r["@media (max-width: ".concat(e.breakpoints.sm,"px)")]={paddingRight:0,marginTop:e.spacing.xl},r),title:{color:"dark"===e.colorScheme?e.white:e.black,fontFamily:"Greycliff CF, ".concat(e.fontFamily),lineHeight:1,marginBottom:e.spacing.md},controls:{display:"flex",marginTop:e.spacing.xl},inputWrapper:{width:"100%",flex:"1"},input:{borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:0},control:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}})),Le=function(e){var r=De().classes;return i("div",we({className:r.wrapper},{children:[i("div",we({className:r.body},{children:[n(D,we({className:r.title},{children:e.loading?"Loading...":"Nothing to display"})),n(L,we({size:"sm",color:"dimmed"},{children:e.loading?"Hold on, we're loading your data.":"We don't have anything to show you here just yet. Add data, check back later, or adjust your search."}))]})),n(T,{src:"https://cdn.localcivics.io/illustrations/".concat(e.icon,".svg"),className:r.image})]}))};function Te(e){if(0===e.items.length)return n(Le,{loading:e.loading,icon:"badges"});var r=e.items.map((function(r){return i("tr",{children:[n("td",{children:n(B,we({onClick:function(){return e.onClick&&e.onClick(r)}},{children:i(W,we({spacing:"sm"},{children:[n(A,{size:40,src:r.avatar,radius:40}),i("div",{children:[n(L,we({size:"sm",weight:500},{children:r.name})),n(L,we({size:"xs",color:"dimmed"},{children:r.email}))]})]}))}))}),i("td",{children:[!!r.isComplete&&n(I,we({variant:"filled"},{children:"Complete"})),!r.isComplete&&n(I,we({color:"red",variant:"filled"},{children:"Incomplete"}))]})]},r.name)}));return n(F.Autosize,we({maxHeight:500},{children:i(R,we({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[n("thead",{children:i("tr",{children:[n("th",{children:"Name"}),n("th",{children:"Status"})]})}),n("tbody",{children:r})]}))}))}var Be=N((function(e){var i;return{title:(i={fontSize:34,fontWeight:900},i[e.fn.smallerThan("sm")]={fontSize:24},i),description:{maxWidth:600}}})),We=function(e){var r=Be().classes;return n(O,we({size:"lg",py:"xl"},{children:i(P,we({spacing:"md"},{children:[n(j,{children:i(j.Col,we({sm:"auto"},{children:[n(I,we({variant:"filled",leftSection:n(E,we({onClick:e.onBackClick,color:"blue",size:"xs",radius:"xl",variant:"filled"},{children:n(t,{size:14})})),size:"lg"},{children:"Badges"})),i(W,{children:[i(P,we({spacing:0},{children:[n(D,we({order:2,className:r.title,mt:"md"},{children:e.displayName||"Badge"})),n(L,we({color:"dimmed",className:r.description,mt:"sm"},{children:e.description||"No description"}))]})),i(P,we({spacing:"xs",ml:"auto"},{children:[n(G,we({variant:"gradient",onClick:e.onPreviewClick},{children:"Preview"})),n(M,{label:"or",labelPosition:"center",my:"xs",variant:"dashed"}),n(H,{size:"sm",placeholder:"Select a group",nothingFound:"No options",value:e.groupId,onChange:e.onGroupChange,icon:n(o,{}),data:e.groups.map((function(e){return{value:e.groupId,label:e.name}}))})]}))]})]}))}),n("div",{children:i("div",we({style:{position:"relative"}},{children:[n(V,{visible:e.loading,overlayBlur:2}),n(Te,{loading:e.loading,items:e.users,onClick:e.onUserClick})]}))})]}))}))};function Ae(e){if(0===e.items.length)return n(Le,{loading:e.loading,icon:"badges"});var r=e.items.map((function(r){return n("tr",{children:n("td",{children:n(B,we({sx:function(e){return{display:"block",width:"100%",padding:e.spacing.md,color:"dark"===e.colorScheme?e.colors.dark[0]:e.black,"&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[1]}}},onClick:function(){return e.onClick&&e.onClick(r)}},{children:n(W,{children:i("div",{children:[n(L,we({size:"sm",weight:500},{children:r.name})),n(L,we({size:"xs",color:"dimmed"},{children:r.description}))]})})}))})},r.badgeId)}));return n(F.Autosize,we({maxHeight:500},{children:n(R,we({horizontalSpacing:0,verticalSpacing:0,sx:{minWidth:700}},{children:n("tbody",{children:r})}))}))}var Ie=N((function(e){var i;return{title:(i={fontSize:34,fontWeight:900},i[e.fn.smallerThan("sm")]={fontSize:24},i),description:{maxWidth:600}}})),Fe=function(e){var r=Ie().classes;return n(O,we({size:"lg",py:"xl"},{children:i(P,we({spacing:"md"},{children:[n(j,{children:i(j.Col,we({sm:"auto"},{children:[n(I,we({variant:"filled",size:"lg"},{children:"Badges"})),n(D,we({order:2,className:r.title,mt:"md"},{children:"Badges and micro-credentials"})),n(L,we({color:"dimmed",className:r.description,mt:"sm"},{children:"Project-sized skills acquisition and standards alignment."}))]}))}),n(U,{placeholder:"Search for a badge that fits your needs",data:e.badges.map((function(e){return e.name})),onChange:e.onAutocompleteChange}),i("div",we({style:{position:"relative"}},{children:[n(V,{visible:e.loading,overlayBlur:2}),n(Ae,{loading:e.loading,items:e.badges,onClick:e.onBadgeClick})]}))]}))}))},Re=N((function(e){return{axis:{fontSize:"12px",fontFamily:"Greycliff CF, ".concat(e.fontFamily)}}})),Oe=function(e){var r=Re().theme,t=Pe(e.points);return 0===t.length?n(Le,{icon:"dashboard",loading:!1}):n(_,we({p:"lg",withBorder:!0},{children:i(P,we({spacing:40},{children:[i(W,we({spacing:0},{children:[n(D,we({weight:500,color:"gray",size:"h5",mb:0},{children:"Daily Lesson Completion"})),n(q,we({label:"Shows aggregated performance history for period"},{children:n(E,{children:n(l,{color:"#3b82f6",size:14})})}))]})),n(se,we({width:"100%",height:300},{children:i(de,we({width:730,height:250,data:t,margin:{top:10,right:30,left:0,bottom:0}},{children:[n("defs",{children:i("linearGradient",we({id:"colorBlue",x1:"0",y1:"0",x2:"0",y2:"1"},{children:[n("stop",{offset:"5%",stopColor:"#3b82f6",stopOpacity:.4}),n("stop",{offset:"95%",stopColor:"#3b82f6",stopOpacity:0})]}))}),n(me,{style:{fontSize:14,fontFamily:r.fontFamily},tick:{fontSize:12,fontFamily:r.fontFamily},axisLine:!1,tickLine:!1,interval:Math.floor(t.length/7),dataKey:"time",tickFormatter:function(e){return ce(e).format("MMM D")}}),n(he,{style:{fontSize:14,fontFamily:r.fontFamily},dataKey:"total",tick:{fontSize:12,fontFamily:r.fontFamily},axisLine:!1,tickLine:!1}),n(ue,{horizontal:!0,vertical:!1}),n(pe,{contentStyle:{fontWeight:700,fontSize:12,fontFamily:r.fontFamily},labelStyle:{fontSize:12,fontFamily:r.fontFamily}}),n(ge,{type:"monotone",dataKey:"total",stroke:"#8884d8",strokeWidth:2})]}))}))]}))}))},Pe=function(e){var i,n,r=(i=e.map((function(e){return we(we({},e),{day:ce(e.time).format("YYYY-MM-DD")})})),n="day",i.reduce((function(e,i){return(e[i[n]]=e[i[n]]||[]).push(i),e}),{})),t=[];return Object.keys(r).forEach((function(e){t.push({time:e,total:r[e].length})})),t.sort((function(e,i){return e.time<i.time?-1:1}))},je=function(e){return n(O,we({size:"lg",py:"xl"},{children:i(P,{children:[i(j,{children:[i(j.Col,we({sm:"auto"},{children:[n(D,we({size:"h3"},{children:"Dashboard"})),n(L,we({color:"dimmed",size:"sm",mt:"md"},{children:"View core metrics and extract insights."}))]})),n(j.Col,we({sm:2.5},{children:n(ae,{placeholder:"Select a date",allowSingleDateInRange:!0,value:e.dateRange,onChange:e.onDateRangeChange,icon:n(a,{size:16})})}))]}),n(P,{children:i("div",we({style:{position:"relative"}},{children:[n(V,{visible:e.loading,overlayBlur:2}),n(Oe,{points:e.points})]}))})]})}))},Ee=[{unit:"year",ms:31536e6},{unit:"month",ms:2628e6},{unit:"day",ms:864e5},{unit:"hour",ms:36e5},{unit:"minute",ms:6e4},{unit:"second",ms:1e3}],Ge=new Intl.RelativeTimeFormat("en",{numeric:"auto"});function Me(e,i){return void 0===i&&(i=new Date),e?function(e){for(var i=0,n=Ee;i<n.length;i++){var r=n[i],t=r.unit,o=r.ms;if(Math.abs(e)>=o||"second"===t)return Ge.format(Math.round(e/o),t)}return""}(e.getTime()-i.getTime()):""}var He=[{value:"Member",label:"Member"},{value:"Admin",label:"Admin"}];function Ve(e){if(0===e.items.length)return n(Le,{loading:e.loading,icon:"groups"});var r=e.items.map((function(r){return i("tr",{children:[n("td",{children:n(B,we({onClick:function(){return e.onViewProfile&&e.onViewProfile(r)}},{children:i(W,we({spacing:"sm"},{children:[n(A,{size:40,src:r.avatar,radius:40}),i("div",{children:[n(L,we({size:"sm",weight:500},{children:r.givenName&&r.familyName?"".concat(r.givenName," ").concat(r.familyName):r.email})),n(L,we({size:"xs",color:"dimmed"},{children:r.email}))]})]}))}))}),n("td",{children:n(H,{data:Ne([],He,!0).map((function(e){return r.readonly?we(we({},e),{disabled:e.value!==r.role}):e})),defaultValue:r.role,variant:"unstyled",onChange:function(i){return!r.readonly&&e.onChangeRole&&e.onChangeRole(r,i)}})}),n("td",{children:r.lastActivity?Me(r.lastActivity):""}),n("td",{children:n(W,we({noWrap:!0,spacing:0,position:"right"},{children:!r.readonly&&n(E,we({color:"red"},{children:n(c,{onClick:function(){return xe({title:'Delete "'.concat((i=r).givenName&&i.familyName?"".concat(i.givenName," ").concat(i.familyName):i.email,'"?'),centered:!0,children:n(L,we({size:"sm"},{children:"Are you sure you want to delete this person? This action is destructive and you will have to contact support to restore your data."})),labels:{confirm:"Delete",cancel:"No don't delete them"},confirmProps:{color:"red"},onConfirm:function(){return e.onDelete&&e.onDelete(i)}});var i},size:16,stroke:1.5})}))}))})]},r.email)}));return n(F,{children:i(R,we({verticalSpacing:20,sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[n("thead",{children:i("tr",{children:[n("th",{children:"Member"}),n("th",{children:"Role"}),n("th",{children:"Last active"}),n("th",{})]})}),n("tbody",{children:r})]}))})}var Ue=N((function(e){var i;return{title:(i={fontSize:34,fontWeight:900},i[e.fn.smallerThan("sm")]={fontSize:24},i),description:{maxWidth:600},wrapper:{position:"relative",marginBottom:30},dropzone:{borderWidth:1,paddingBottom:50},icon:{color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[4]},control:{position:"absolute",width:250,left:"calc(50% - 125px)",bottom:-20}}})),_e=function(e){var o=Ue().classes,l=Ce({initialValues:{groupId:"",userId:"",email:"",givenName:"",familyName:"",avatar:"",role:"",readonly:!1,lastActivity:null},validate:{email:function(i){return/^\S+@\S+$/.test(i)&&0===e.users.filter((function(e){return e.email===i})).length?null:"Invalid email"}}}),a=ve(!1),c=a[0],d=a[1];return i(r,{children:[n(Y,we({opened:c,onClose:function(){return d(!1)},title:n(D,we({size:"h5"},{children:"Add people"})),padding:"xl",size:"xl"},{children:i(P,we({spacing:"md"},{children:[n(qe,we({},e,{close:function(){return d(!1)}})),n(M,{label:"or",labelPosition:"center",my:"md",variant:"dashed"}),n("form",we({onSubmit:l.onSubmit((function(){var i=l.values;l.reset(),d(!1),e.onCreateUsers&&e.onCreateUsers([i])}))},{children:i(P,{children:[n(K,we({withAsterisk:!0,label:"Email",placeholder:"Email"},l.getInputProps("email"))),i(W,we({grow:!0},{children:[n(K,we({label:"Given name",placeholder:"Given name"},l.getInputProps("givenName"))),n(K,we({label:"Family name",placeholder:"Family name"},l.getInputProps("familyName")))]})),n(G,we({type:"submit",fullWidth:!0,mt:"md"},{children:"Submit"}))]})}))]}))})),n(O,we({size:"lg",py:"xl"},{children:i(P,we({spacing:"md"},{children:[i(j,{children:[i(j.Col,we({sm:"auto"},{children:[n(I,we({variant:"filled",leftSection:n(E,we({onClick:e.onBackClick,color:"blue",size:"xs",radius:"xl",variant:"filled"},{children:n(t,{size:14})})),size:"lg"},{children:"Groups"})),n(D,we({order:2,className:o.title,mt:"md"},{children:e.displayName||"Group"})),n(L,we({color:"dimmed",className:o.description,mt:"sm"},{children:e.description||"No description"}))]})),n(j.Col,we({sm:"content"},{children:!e.loading&&n(G,we({onClick:function(){return d(!0)},leftIcon:n(s,{size:14})},{children:"Add people"}))}))]}),i("div",we({style:{position:"relative"}},{children:[n(V,{visible:e.loading,overlayBlur:2}),n(Ve,{loading:e.loading,items:e.users,onDelete:e.onDeleteUser,onChangeRole:e.onRoleChange,onViewProfile:function(i){return e.onUserClick(i)}})]}))]}))}))]})},qe=function(e){var r=Ue(),t=r.classes,o=r.theme,l=fe.useRef(null),a=fe.useState(!1),c=a[0],s=a[1],u=fe.useCallback((function(i){s(!0),i.forEach((function(i){ze.parse(i,{download:!0,header:!0,dynamicTyping:!0,skipEmptyLines:!0,worker:!0,complete:function(i){var n=i.data.filter((function(i){return/^\S+@\S+$/.test(i.email)&&0===e.users.filter((function(e){return e.email===i.email})).length}));n.length>0&&e.onCreateUsers&&e.onCreateUsers(n),s(!1),e.close()}})}))}),[]);return i("div",we({className:t.wrapper},{children:[n(be,we({loading:c,openRef:l,onDrop:u,className:t.dropzone,radius:"md",accept:[ke.csv],maxSize:5*Math.pow(1024,2)},{children:i("div",we({style:{pointerEvents:"none"}},{children:[i(W,we({position:"center"},{children:[n(be.Accept,{children:n(d,{size:50,color:o.colors[o.primaryColor][6],stroke:1.5})}),n(be.Reject,{children:n(m,{size:50,color:o.colors.red[6],stroke:1.5})}),n(be.Idle,{children:n(h,{size:50,color:"dark"===o.colorScheme?o.colors.dark[0]:o.black,stroke:1.5})})]})),i(L,we({align:"center",weight:700,size:"lg",mt:"xl"},{children:[n(be.Accept,{children:"Drop files here"}),n(be.Reject,{children:"Csv file less than 5mb"}),n(be.Idle,{children:"Upload multiple"})]})),i(L,we({align:"center",size:"sm",mt:"xs",color:"dimmed"},{children:["Drag'n'drop files here to upload. We can accept only ",n("i",{children:".csv"})," files that are less than 5mb in size."]}))]}))})),n(G,we({className:t.control,size:"md",radius:"xl",onClick:function(){var e;return null===(e=l.current)||void 0===e?void 0:e.call(l)}},{children:"Select file"}))]}))};function Ye(e){if(0===e.items.length)return n(Le,{loading:e.loading,icon:"groups"});var r=e.items.map((function(r){return i("tr",{children:[n("td",{children:n(B,we({onClick:function(){return e.onClick(r)}},{children:n(L,we({size:14},{children:r.name}))}))}),n("td",{children:n(L,we({size:14},{children:r.description}))}),n("td",{children:n(W,we({noWrap:!0,spacing:0,position:"right"},{children:n(E,we({color:"red"},{children:n(c,{onClick:function(){return xe({title:'Delete "'.concat((i=r).name,'"?'),centered:!0,children:n(L,we({size:"sm"},{children:"Are you sure you want to delete this group? This action is destructive and you will have to contact support to restore your data."})),labels:{confirm:"Delete group",cancel:"No don't delete it"},confirmProps:{color:"red"},onConfirm:function(){return e.onDeleteGroup(i)}});var i},size:16,stroke:1.5})}))}))})]},r.groupId)}));return n(F.Autosize,we({maxHeight:300},{children:i(R,we({verticalSpacing:20,sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[n("thead",{children:i("tr",{children:[n("th",{children:"Name"}),n("th",{children:"Description"}),n("th",{})]})}),n("tbody",{children:r})]}))}))}var Ke=N((function(e){var i;return{title:(i={fontSize:34,fontWeight:900},i[e.fn.smallerThan("sm")]={fontSize:24},i),description:{maxWidth:600}}})),$e=function(e){var t=Ke().classes,o=Ce({initialValues:{groupId:"",name:"",description:""},validate:{name:function(e){return e.length<=6?"Name should include at least 6 characters":null}}}),a=ve(!1),c=a[0],d=a[1];return i(r,{children:[n(Y,we({opened:c,onClose:function(){return d(!1)},title:i(W,we({spacing:0},{children:[n(D,we({size:"h5"},{children:"Create a group"})),n(q,we({label:"Groups settings cannot be modified once created"},{children:n(E,{children:n(l,{color:"#3b82f6",size:14})})}))]})),padding:"xl",size:"xl"},{children:i("form",we({onSubmit:o.onSubmit((function(){var i=o.values;o.reset(),d(!1),e.onCreateGroup&&e.onCreateGroup(i)}))},{children:[i(P,{children:[n(K,we({withAsterisk:!0,label:"Name",placeholder:"Group name"},o.getInputProps("name"))),n(K,we({label:"Description",placeholder:"A group for my first period class"},o.getInputProps("description")))]}),n(G,we({type:"submit",fullWidth:!0,mt:"md"},{children:"Submit"}))]}))})),n(O,we({size:"lg",py:"xl"},{children:i(P,we({spacing:"md"},{children:[i(j,{children:[i(j.Col,we({sm:"auto"},{children:[n(I,we({variant:"filled",size:"lg"},{children:"Groups"})),n(D,we({order:2,className:t.title,mt:"md"},{children:"Organize people into groups"})),n(L,we({color:"dimmed",className:t.description,mt:"sm"},{children:"A group can be a class, team, or other functioning organizations."}))]})),n(j.Col,we({sm:"content"},{children:!e.loading&&n(G,we({onClick:function(){return d(!0)},leftIcon:n(s,{size:14})},{children:"Create group"}))}))]}),i("div",we({style:{position:"relative"}},{children:[n(V,{visible:e.loading,overlayBlur:2}),n(Ye,{loading:e.loading,items:e.groups,onDeleteGroup:e.onDeleteGroup,onClick:e.onGroupClick})]}))]}))}))]})},Je=N((function(e){var i,n;return{root:(i={display:"flex",backgroundImage:"linear-gradient(-60deg, ".concat(e.colors[e.primaryColor][4]," 0%, ").concat(e.colors[e.primaryColor][7]," 100%)"),padding:1.5*e.spacing.xl,borderRadius:e.radius.md},i[e.fn.smallerThan("sm")]={flexDirection:"column"},i),title:{color:e.white,textTransform:"uppercase",fontWeight:700,fontSize:e.fontSizes.sm},count:{color:e.white,fontSize:32,lineHeight:1,fontWeight:700,marginBottom:e.spacing.md,fontFamily:"Greycliff CF, ".concat(e.fontFamily)},description:{color:e.colors[e.primaryColor][0],fontSize:e.fontSizes.sm,marginTop:5},stat:{flex:1,"& + &":(n={paddingLeft:e.spacing.xl,marginLeft:e.spacing.xl,borderLeft:"1px solid ".concat(e.colors[e.primaryColor][3])},n[e.fn.smallerThan("sm")]={paddingLeft:0,marginLeft:0,borderLeft:0,paddingTop:e.spacing.xl,marginTop:e.spacing.xl,borderTop:"1px solid ".concat(e.colors[e.primaryColor][3])},n)}}})),Qe=function(e){var r=e.data,t=Je().classes,o=r.map((function(e){return i("div",we({className:t.stat},{children:[n(L,we({className:t.count},{children:e.value.toLocaleString()})),n(L,we({className:t.title},{children:e.title})),!!e.diff&&n(L,we({className:t.description},{children:"".concat(e.diff,"% ").concat(e.diff<0?"decrease":"increase"," compared to last period")}))]}),e.title)}));return n("div",we({className:t.root},{children:o}))},Ze={BadgeCompleted:n(u,{size:12}),BadgeStarted:n(u,{size:12}),LessonCompleted:n(p,{size:12}),LessonStarted:n(p,{size:12}),ProblemSolved:n(g,{size:12})},Xe=function(e){var r,t=ye(null),o=ve({x:0,y:0}),l=o[0],a=o[1];fe.useEffect((function(){t.current&&l.y===t.current.scrollHeight-t.current.offsetHeight&&e.onScrollBottom&&e.onScrollBottom()}),[l.y]);var c=e.items.map((function(e){var t=e.name.split(/(?=[A-Z])/),o=2===t.length?"".concat(t[0]," ").concat(t[1].toLowerCase()):e.name,l=t[0]===r?"dashed":"solid";r=t[0];var a=e.link?n($,we({color:"dark",unstyled:!0,href:e.link},{children:o})):o;return i(J.Item,we({bullet:ei(e.name),lineVariant:l,title:a},{children:[n(L,we({color:"dimmed",size:"sm"},{children:e.description})),n(L,we({size:"xs",mt:4},{children:Me(new Date(e.time))}))]}),e.key)}));return n(F.Autosize,we({maxHeight:300,onScrollPositionChange:a,viewportRef:t},{children:n(J,we({ml:"lg",active:1,bulletSize:24,lineWidth:2},{children:c}))}))},ei=function(e){var i=Ze[e];return i||n(f,{size:12})},ii=N((function(e){var i;return{title:(i={fontSize:34,fontWeight:900,marginTop:16},i[e.fn.smallerThan("sm")]={fontSize:24},i),description:{maxWidth:600}}})),ni=function(e){var t=ii().classes,o=e.givenName?[e.givenName,e.familyName].join(" ").trim():e.email,l=e.givenName?e.givenName:"Me";return"compact"===e.variant?i(r,{children:[n(D,we({className:t.title},{children:o})),n(L,we({color:"dimmed",className:t.description,mt:"xs"},{children:e.quote}))]}):i(r,{children:[i(_,we({radius:"md",withBorder:!0,p:"lg",sx:function(e){return{backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.white}}},{children:[n(A,{src:e.avatar,size:135,radius:120,mx:"auto"}),n(L,we({align:"center",size:"lg",weight:500,mt:"md"},{children:o})),i(L,we({align:"center",color:"dimmed",size:"sm"},{children:[e.email," • ",e.job]}))]})),n(Q,we({mt:"xl",color:"blue",cite:"– ".concat(l)},{children:e.quote}))]})},ri=function(e){return n(O,we({size:"lg",py:"xl"},{children:i(P,we({spacing:"md"},{children:[n(j,{children:i(j.Col,we({sm:"auto"},{children:[n(I,we({variant:"filled",leftSection:n(E,we({onClick:e.onBackClick,color:"blue",size:"xs",radius:"xl",variant:"filled"},{children:n(t,{size:14})})),size:"lg"},{children:"Users"})),n(ni,{variant:"compact",givenName:e.givenName,familyName:e.familyName,avatar:e.avatarURL,email:e.email,quote:e.impactStatement,job:e.job})]}))}),i("div",we({style:{position:"relative"}},{children:[n(V,{visible:e.loading,overlayBlur:2}),i(P,we({spacing:"lg"},{children:[n(Qe,{data:[{title:"PROBLEMS SOLVED",value:e.problemsSolved,diff:e.problemsSolvedDiff},{title:"LESSONS COMPLETED",value:e.lessonsCompleted,diff:e.lessonsCompletedDiff},{title:"BADGES EARNED",value:e.badgesCompleted,diff:e.badgesCompletedDiff}]}),n(Xe,{onScrollBottom:e.onScrollBottom,items:e.events})]}))]}))]}))}))},ti=N((function(e){return{card:{height:240,backgroundSize:"cover",backgroundPosition:"center"},content:{position:"absolute",padding:e.spacing.xl,zIndex:1,top:0,bottom:0,right:0,left:0},action:{position:"absolute",bottom:e.spacing.xl,right:e.spacing.xl},title:{color:e.white,marginBottom:e.spacing.xs/2},description:{color:e.white,maxWidth:220}}})),oi=function(e){var r=e.title,t=e.description,o=e.image,l=e.action,a=e.style,c=e.className,s=function(e,i){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&i.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)i.indexOf(r[t])<0&&Object.prototype.propertyIsEnumerable.call(e,r[t])&&(n[r[t]]=e[r[t]])}return n}(e,["title","description","image","action","style","className"]),d=ti(),m=d.classes,h=d.cx,u=d.theme;return i(Z,we({radius:"md",style:we({backgroundImage:"url(".concat(o,")")},a),className:h(m.card,c)},s,{children:[n(X,{gradient:"linear-gradient(105deg, ".concat(u.black," 20%, #312f2f 50%, ").concat(u.colors.gray[4]," 100%)"),opacity:.55,zIndex:0}),i("div",we({className:m.content},{children:[n(L,we({size:"lg",weight:700,className:m.title},{children:r})),n(L,we({size:"sm",className:m.description},{children:t})),n(G,we({className:m.action,variant:"white",color:"dark",component:"a",size:"xs",href:l.link,target:"_blank"},{children:l.label}))]}))]}))},li=function(e){return n(O,we({size:"lg"},{children:i(P,we({spacing:"lg"},{children:[i(j,we({gutter:"md"},{children:[n(j.Col,we({md:6},{children:n(ni,{variant:"compact",givenName:e.givenName,familyName:e.familyName,avatar:e.avatarURL,email:e.email,quote:e.impactStatement,job:e.job})})),n(j.Col,we({md:6},{children:n(oi,{title:e.tenantName,description:e.tenantDescription,image:e.tenantImage,action:{label:"Visit website",link:e.tenantWebsite}})}))]})),n(Qe,{data:[{title:"PROBLEMS SOLVED",value:e.problemsSolved,diff:e.problemsSolvedDiff},{title:"LESSONS COMPLETED",value:e.lessonsCompleted,diff:e.lessonsCompletedDiff},{title:"BADGES EARNED",value:e.badgesCompleted,diff:e.badgesCompletedDiff}]}),n(Xe,{onScrollBottom:e.onScrollBottom,items:e.events})]}))}))};function ai(e){if(0===e.items.length)return n(Le,{loading:e.loading,icon:"lessons"});var r=e.items.map((function(r){return i("tr",{children:[n("td",{children:n(B,we({onClick:function(){return e.onClick&&e.onClick(r)}},{children:i(W,we({spacing:"sm"},{children:[n(A,{size:40,src:r.avatar,radius:40}),i("div",{children:[n(L,we({size:"sm",weight:500},{children:r.name})),n(L,we({size:"xs",color:"dimmed"},{children:r.email}))]})]}))}))}),i("td",{children:[!!r.isComplete&&n(I,we({variant:"filled"},{children:"Complete"})),!r.isComplete&&!r.isStarted&&n(I,we({color:"red",variant:"filled"},{children:"Not started"})),!r.isComplete&&!!r.isStarted&&n(I,we({color:"violet",variant:"filled"},{children:"In progress"}))]})]},r.name)}));return n(F.Autosize,we({maxHeight:500},{children:i(R,we({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[n("thead",{children:i("tr",{children:[n("th",{children:"Name"}),n("th",{children:"Status"})]})}),n("tbody",{children:r})]}))}))}var ci=N((function(e){var i;return{title:(i={fontSize:34,fontWeight:900},i[e.fn.smallerThan("sm")]={fontSize:24},i),description:{maxWidth:600}}})),si=function(e){var r=ci().classes;return n(O,we({size:"lg",py:"xl"},{children:i(P,we({spacing:"md"},{children:[n(j,{children:i(j.Col,we({sm:"auto"},{children:[n(I,we({variant:"filled",leftSection:n(E,we({onClick:e.onBackClick,color:"blue",size:"xs",radius:"xl",variant:"filled"},{children:n(t,{size:14})})),size:"lg"},{children:"Lessons"})),i(W,{children:[i(P,we({spacing:0},{children:[n(D,we({order:2,className:r.title,mt:"md"},{children:e.displayName||"Lesson"})),n(L,we({color:"dimmed",className:r.description,mt:"sm"},{children:e.description||"No description"}))]})),i(P,we({spacing:"xs",ml:"auto"},{children:[n(G,we({variant:"gradient",onClick:e.onPreviewClick},{children:"Preview"})),n(M,{label:"or",labelPosition:"center",my:"xs",variant:"dashed"}),n(H,{size:"sm",placeholder:"Select a group",nothingFound:"No options",value:e.groupId,onChange:e.onGroupChange,icon:n(o,{}),data:e.groups.map((function(e){return{value:e.groupId,label:e.name}}))})]}))]})]}))}),n("div",{children:i("div",we({style:{position:"relative"}},{children:[n(V,{visible:e.loading,overlayBlur:2}),n(ai,{loading:e.loading,items:e.users,onClick:e.onUserClick})]}))})]}))}))};function di(e){if(0===e.items.length)return n(Le,{loading:e.loading,icon:"lessons"});var r=e.items.map((function(r){return n("tr",{children:n("td",{children:n(B,we({sx:function(e){return{display:"block",width:"100%",padding:e.spacing.md,color:"dark"===e.colorScheme?e.colors.dark[0]:e.black,"&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[1]}}},onClick:function(){return e.onClick&&e.onClick(r)}},{children:n(W,{children:i("div",{children:[n(L,we({size:"sm",weight:500},{children:r.name})),n(L,we({size:"xs",color:"dimmed"},{children:r.description}))]})})}))})},r.lessonId)}));return n(F.Autosize,we({maxHeight:500},{children:n(R,we({horizontalSpacing:0,verticalSpacing:0,sx:{minWidth:700}},{children:n("tbody",{children:r})}))}))}var mi=N((function(e){var i;return{title:(i={fontSize:34,fontWeight:900},i[e.fn.smallerThan("sm")]={fontSize:24},i),description:{maxWidth:600}}})),hi=function(e){var r=mi().classes;return n(O,we({size:"lg",py:"xl"},{children:i(P,we({spacing:"md"},{children:[n(j,{children:i(j.Col,we({sm:"auto"},{children:[n(I,we({variant:"filled",size:"lg"},{children:"Lessons"})),n(D,we({order:2,className:r.title,mt:"md"},{children:"Lessons"})),n(L,we({color:"dimmed",className:r.description,mt:"sm"},{children:"Well crafted units of instruction."}))]}))}),n(U,{placeholder:"Search for a lesson that fits your needs",data:e.lessons.map((function(e){return e.name})),onChange:e.onAutocompleteChange}),i("div",we({style:{position:"relative"}},{children:[n(V,{visible:e.loading,overlayBlur:2}),n(di,{loading:e.loading,items:e.lessons,onClick:e.onLessonClick})]}))]}))}))},ui=ee({key:"mantine",prepend:!1}),pi=function(i){return n(ie,we({withNormalizeCSS:!0,withGlobalStyles:!0,emotionCache:ui,theme:{loader:"bars"}},{children:n(e,we({limit:i.notificationLimit||5},{children:n(Se,{children:i.children})}))}))},gi=function(e){var r=Ce({initialValues:{active:e.account}});return n(ne,we({centered:!0,opened:e.opened,onClose:function(){return e.onClose&&e.onClose()},size:"sm",title:n(D,we({size:"h5"},{children:"Accounts"}))},{children:i("form",we({onSubmit:r.onSubmit((function(){e.onChange&&e.onChange(r.values.active)}))},{children:[n(H,we({required:!0,placeholder:"Select an account",defaultValue:e.account,data:e.accounts.map((function(e){return{value:e.accountId,label:e.name}}))},r.getInputProps("active"))),n(G,we({type:"submit",fullWidth:!0,mt:"xl"},{children:"Switch"}))]}))}))},fi=N((function(e){return{link:{width:50,height:50,borderRadius:e.radius.md,display:"flex",alignItems:"center",justifyContent:"center",color:"dark"===e.colorScheme?e.colors.dark[0]:e.colors.gray[7],"&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]}},active:{"&, &:hover":{backgroundColor:e.fn.variant({variant:"light",color:e.primaryColor}).background,color:e.fn.variant({variant:"light",color:e.primaryColor}).color}}}})),vi=[{icon:b,label:"Home",href:"/home"},{icon:k,label:"Dashboard",href:"/dashboard"},{icon:o,label:"Groups",href:"/groups"},{icon:C,label:"Badges",href:"/badges"},{icon:z,label:"Lessons",href:"/lessons"}],yi=function(e){var i,r=e.icon,t=e.label,o=e.active,l=e.onClick,a=fi(),c=a.classes,s=a.cx;return n(q,we({label:t,position:"right",transitionDuration:0},{children:n(B,we({onClick:l,className:s(c.link,(i={},i[c.active]=o,i))},{children:n(r,{stroke:1.5})}))}))},bi=function(e){var r=vi.map((function(i){return n(yi,{label:i.label,icon:i.icon,active:i.label===e.active,onClick:function(){return e.navigate(i.href)}},i.label)}));return i(re,we({width:{base:80},p:"md"},{children:[n(te,{children:n(A,we({color:"blue",radius:"sm"},{children:n("div",we({style:{width:15,marginLeft:"auto",marginRight:"auto"}},{children:n(T,{fit:"contain",src:"https://cdn.localcivics.io/brand/l.png"})}))}))}),n(re.Section,we({grow:!0,mt:50},{children:n(P,we({justify:"center",spacing:0},{children:r}))})),n(re.Section,{children:i(P,we({justify:"center",spacing:0},{children:[n(yi,{icon:v,label:"Switch accounts",onClick:e.onSwitchAccounts}),n(yi,{icon:y,label:"Logout",onClick:e.onLogout})]}))})]}))},ki=N((function(e){var i,n,r,t,o,l;return{footer:{paddingTop:2*e.spacing.xl,paddingBottom:2*e.spacing.xl,paddingLeft:3*e.spacing.xl,backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.colors.gray[0],borderTop:"1px solid ".concat("dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[2])},logo:(i={maxWidth:200},i[e.fn.smallerThan("sm")]={display:"flex",flexDirection:"column",alignItems:"center"},i),description:(n={marginTop:5},n[e.fn.smallerThan("sm")]={marginTop:e.spacing.xs,textAlign:"center"},n),inner:(r={display:"flex",justifyContent:"space-between"},r[e.fn.smallerThan("sm")]={flexDirection:"column",alignItems:"center"},r),groups:(t={display:"flex",flexWrap:"wrap"},t[e.fn.smallerThan("sm")]={display:"none"},t),wrapper:{width:160},link:{display:"block",color:"dark"===e.colorScheme?e.colors.dark[1]:e.colors.gray[6],fontSize:e.fontSizes.sm,paddingTop:3,paddingBottom:3,"&:hover":{textDecoration:"underline"}},title:{fontSize:e.fontSizes.md,fontWeight:700,fontFamily:"Greycliff CF, ".concat(e.fontFamily),marginBottom:e.spacing.xs/2,color:"dark"===e.colorScheme?e.white:e.black},afterFooter:(o={display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:e.spacing.xl,paddingTop:e.spacing.xl,paddingBottom:e.spacing.xl,borderTop:"1px solid ".concat("dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[2])},o[e.fn.smallerThan("sm")]={flexDirection:"column"},o),social:(l={},l[e.fn.smallerThan("sm")]={marginTop:e.spacing.xs},l)}})),Ci=function(e){var t=ki().classes,o=zi(e.account,e.accounts,e.onAccountChange);return i(oe,we({padding:"xs",navbar:n(bi,{active:e.navbar.props.active,navigate:e.navbar.props.navigate,onLogout:e.navbar.props.onLogout,onSwitchAccounts:function(){return o.setChangeModalOpen(!0)}}),footer:n(r,{children:!o.opened&&i("footer",we({className:t.footer},{children:[i(O,we({className:t.inner},{children:[i("div",we({className:t.logo},{children:[i(W,we({spacing:"xs"},{children:[n("div",we({style:{width:15}},{children:n(T,{fit:"contain",src:"https://cdn.localcivics.io/brand/l.png"})})),n(D,we({color:"dimmed",size:"h5"},{children:"Local Civics"}))]})),n(L,we({size:"xs",color:"dimmed",className:t.description},{children:"We connect students to powerful civic learning experiences."}))]})),n("div",we({className:t.groups},{children:i("div",we({className:t.wrapper},{children:[n(L,we({className:t.link,component:"a",href:"https://www.localcivics.io",target:"_blank"},{children:"About"})),n(L,we({className:t.link,component:"a",href:"https://www.localcivics.io/terms-of-service",target:"_blank"},{children:"Terms"})),n(L,we({className:t.link,component:"a",href:"https://www.localcivics.io/privacy-policy",target:"_blank"},{children:"Privacy"})),n(L,we({className:t.link,component:"a",href:"https://localcivics.notion.site/Help-Center-b52300f587b64fc0a61f512686e7626d",target:"_blank"},{children:"FAQ"}))]}))}))]})),i(O,we({className:t.afterFooter},{children:[i(L,we({color:"dimmed",size:"sm"},{children:["© ",(new Date).getFullYear()," Local Civics. All rights reserved."]})),i(W,we({spacing:0,className:t.social,position:"right",noWrap:!0},{children:[n(E,we({component:"a",target:"_blank",href:"https://www.instagram.com/localcivics/",size:"lg"},{children:n(x,{size:18,stroke:1.5})})),n(E,we({component:"a",target:"_blank",href:"https://www.linkedin.com/company/localcivics",size:"lg"},{children:n(S,{size:18,stroke:1.5})})),n(E,we({component:"a",target:"_blank",href:"https://www.facebook.com/localcivics/",size:"lg"},{children:n(w,{size:18,stroke:1.5})}))]}))]}))]}))}),styles:function(e){return{main:{backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[0]}}}},{children:[i("div",we({style:{position:"relative"}},{children:[(e.loading||o.opened)&&n(te,we({style:{height:400}},{children:n(le,{})})),!e.loading&&!o.opened&&e.page]})),n(gi,{opened:o.opened,account:o.account,accounts:o.accounts,onChange:o.onAccountChange,onClose:function(){return o.setChangeModalOpen(!1)}})]}))},zi=function(e,i,n){var r=JSON.stringify(i),t=ve(!1),o=t[0],l=t[1],a=ve(e),c=a[0],s=a[1];return fe.useEffect((function(){s(e)}),[e,r]),{opened:o,account:c,accounts:i,setChangeModalOpen:l,onAccountChange:function(e){s(e),l(!1),n(e)}}};export{pi as AdminProvider,Ci as App,We as Badge,Fe as Badges,je as Dashboard,_e as Group,ri as GroupUser,$e as Groups,li as Home,si as Lesson,hi as Lessons,bi as Navbar,gi as SwitchAccount};
|
|
1
|
+
import{NotificationsProvider as e}from"@mantine/notifications";export{showNotification,updateNotification}from"@mantine/notifications";import{jsxs as n,jsx as i,Fragment as t}from"react/jsx-runtime";import{IconArrowLeft as r,IconCategory2 as l,IconCheck as o,IconTrash as a,IconPlaylistAdd as c,IconDownload as s,IconX as d,IconCloudUpload as h,IconInfoCircle as m,IconColorSwatch as u,IconSwitchHorizontal as g,IconLogout as p,IconHome2 as f,IconGauge as v,IconAlbum as b,IconLambda as y,IconBrandInstagram as C,IconBrandLinkedin as k,IconBrandFacebook as x}from"@tabler/icons";import*as N from"react";import{useState as S}from"react";import{createStyles as z,Text as w,Tabs as O,Title as T,Image as L,UnstyledButton as A,Group as B,Avatar as I,Badge as W,ScrollArea as E,Table as P,Container as D,Stack as H,Grid as j,ActionIcon as R,Button as M,LoadingOverlay as F,Select as q,Autocomplete as V,Drawer as G,Divider as U,TextInput as _,Tooltip as Y,Paper as $,ThemeIcon as J,Card as Q,Overlay as K,createEmotionCache as X,MantineProvider as Z,Modal as ee,Navbar as ne,Center as ie,AppShell as te,Loader as re}from"@mantine/core";import{Dropzone as le,MIME_TYPES as oe}from"@mantine/dropzone";import{useForm as ae}from"@mantine/form";import*as ce from"papaparse";import{openConfirmModal as se,ModalsProvider as de}from"@mantine/modals";import{Chart as he}from"react-charts";var me=function(){return me=Object.assign||function(e){for(var n,i=1,t=arguments.length;i<t;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},me.apply(this,arguments)};var ue=z((function(e){var n,i;return{root:(n={display:"flex",backgroundImage:"linear-gradient(-60deg, ".concat(e.colors[e.primaryColor][4]," 0%, ").concat(e.colors[e.primaryColor][7]," 100%)"),padding:1.5*e.spacing.xl,borderRadius:e.radius.md},n[e.fn.smallerThan("sm")]={flexDirection:"column"},n),title:{color:e.white,textTransform:"uppercase",fontWeight:700,fontSize:e.fontSizes.sm},count:{color:e.white,fontSize:32,lineHeight:1,fontWeight:700,marginBottom:e.spacing.md,fontFamily:"Greycliff CF, ".concat(e.fontFamily)},description:{color:e.colors[e.primaryColor][0],fontSize:e.fontSizes.sm,marginTop:5},stat:{flex:1,"& + &":(i={paddingLeft:e.spacing.xl,marginLeft:e.spacing.xl,borderLeft:"1px solid ".concat(e.colors[e.primaryColor][3])},i[e.fn.smallerThan("sm")]={paddingLeft:0,marginLeft:0,borderLeft:0,paddingTop:e.spacing.xl,marginTop:e.spacing.xl,borderTop:"1px solid ".concat(e.colors[e.primaryColor][3])},i)}}})),ge=function(e){var t=e.data,r=ue().classes,l=t.map((function(e){var t="%"===e.unit?Math.round(100*(e.value+Number.EPSILON)):e.value;return n("div",me({className:r.stat},{children:[n(w,me({className:r.count},{children:[t.toLocaleString(),e.unit]})),i(w,me({className:r.title},{children:e.title}))]}),e.title)}));return i("div",me({className:r.root},{children:l}))},pe=function(e){var n,t=null===(n=e.data)||void 0===n?void 0:n.map((function(e){return i(O.Tab,me({value:e.value},{children:e.label||e.value}),e.value)}));return i(O,me({value:e.value,onTabChange:e.onChange},{children:i(O.List,{children:t})}))},fe=z((function(e){var n,i,t;return{wrapper:(n={display:"flex",alignItems:"center",padding:2*e.spacing.xl,borderRadius:e.radius.md,backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.white,border:"1px solid ".concat("dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[3])},n["@media (max-width: ".concat(e.breakpoints.sm,"px)")]={flexDirection:"column-reverse",padding:e.spacing.xl},n),image:(i={maxWidth:"40%"},i["@media (max-width: ".concat(e.breakpoints.sm,"px)")]={maxWidth:"100%"},i),body:(t={paddingRight:4*e.spacing.xl},t["@media (max-width: ".concat(e.breakpoints.sm,"px)")]={paddingRight:0,marginTop:e.spacing.xl},t),title:{color:"dark"===e.colorScheme?e.white:e.black,fontFamily:"Greycliff CF, ".concat(e.fontFamily),lineHeight:1,marginBottom:e.spacing.md},controls:{display:"flex",marginTop:e.spacing.xl},inputWrapper:{width:"100%",flex:"1"},input:{borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:0},control:{borderTopLeftRadius:0,borderBottomLeftRadius:0}}})),ve=function(e){var t=fe().classes,r=e.title||"Nothing to display",l=e.description||"We don't have anything to show you here just yet. Add data, check back later, or adjust your search.";return n("div",me({className:t.wrapper},{children:[n("div",me({className:t.body},{children:[i(T,me({className:t.title},{children:e.loading?"Loading...":r})),i(w,me({size:"sm",color:"dimmed"},{children:e.loading?"Hold on, we're loading your data.":l}))]})),i(L,{src:"https://cdn.localcivics.io/illustrations/".concat(e.icon,".svg"),className:t.image})]}))};function be(e){if(0===e.items.length)return i(ve,{title:"No badges to display",description:"There has not been any badge progress just yet.",loading:e.loading,icon:"badges"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick&&e.onClick(t)}},{children:n(B,me({spacing:"sm"},{children:[t.avatar&&i(I,{size:40,src:t.avatar,radius:40}),n("div",{children:[i(w,me({size:"sm",weight:500},{children:t.name})),i(w,me({size:"xs",color:"dimmed"},{children:t.email}))]})]}))}))}),n("td",{children:[!!t.isComplete&&i(W,me({variant:"filled"},{children:"Complete"})),!t.isComplete&&i(W,me({color:"red",variant:"filled"},{children:"Incomplete"}))]})]},t.name)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Student Name"}),i("th",{children:"Badge Status"})]})}),i("tbody",{children:t})]}))}))}function ye(e){if(0===e.items.length)return i(ve,{title:"No lessons to display",description:"There are not lessons in badge.",loading:e.loading,icon:"badges"});var t=e.items.map((function(t){var r=Math.round(100*(t.percentageCompletion+Number.EPSILON));return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick&&e.onClick(t)}},{children:t.lessonName}))}),n("td",{children:[r,"%"]})]},t.lessonName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Lesson Name"}),i("th",{children:"Lesson Completion"})]})}),i("tbody",{children:t})]}))}))}var Ce=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600}}})),ke=function(e){var t=Ce().classes,o=S("lessons"),a=o[0],c=o[1],s=e.students.length,d=s>0?e.students.filter((function(e){return e.isComplete})).length/s:0;return i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[i(j,{children:n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",leftSection:i(R,me({onClick:e.onBackClick,color:"blue",size:"xs",radius:"xl",variant:"filled"},{children:i(r,{size:14})})),size:"lg"},{children:"Badges"})),n(B,{children:[n(H,me({spacing:0},{children:[i(T,me({order:2,className:t.title,mt:"md"},{children:e.displayName||"Badge"})),i(w,me({color:"dimmed",className:t.description,mt:"sm"},{children:e.description||"No description"}))]})),i(H,me({ml:"auto"},{children:i(M,me({variant:"gradient",onClick:e.onPreviewClick},{children:"Preview"}))}))]})]}))}),i("div",{children:n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),n(H,{children:[i(ge,{data:[{title:"BADGE COMPLETION",value:d,unit:"%"}]}),n(H,me({spacing:0},{children:[i(pe,{value:a,data:[{label:"By lesson",value:"lessons"},{label:"By student",value:"students"}],onChange:c}),"lessons"===a&&i(ye,{loading:e.loading,items:e.lessons,onClick:e.onLessonClick}),"students"===a&&n(H,me({mt:10},{children:[i(q,{clearable:!0,clearButtonLabel:"Clear class selection",size:"sm",placeholder:"Select a class",nothingFound:"No options",value:e.classId,onChange:e.onClassChange,icon:i(l,{}),data:e.classes.map((function(e){return{value:e.classId,label:e.name}}))}),i(be,{loading:e.loading,items:e.students,onClick:e.onUserClick})]}))]}))]})]}))})]}))}))};function xe(e){if(0===e.items.length)return i(ve,{title:"No badges to display",description:"We don't have any badges to show you just yet.",loading:e.loading,icon:"badges"});var t=e.items.map((function(t){return i("tr",{children:i("td",{children:i(A,me({sx:function(e){return{display:"block",width:"100%",padding:e.spacing.md,color:"dark"===e.colorScheme?e.colors.dark[0]:e.black,"&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[1]}}},onClick:function(){return e.onClick&&e.onClick(t)}},{children:i(B,{children:n("div",{children:[i(w,me({size:"sm",weight:500},{children:t.name})),i(w,me({size:"xs",color:"dimmed"},{children:t.description}))]})})}))})},t.badgeId)}));return i(E.Autosize,me({maxHeight:500},{children:i(P,me({horizontalSpacing:0,verticalSpacing:0,sx:{minWidth:700}},{children:i("tbody",{children:t})}))}))}var Ne=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600}}})),Se=function(e){var t=Ne().classes;return i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[i(j,{children:n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",size:"lg"},{children:"Badges"})),i(T,me({order:2,className:t.title,mt:"md"},{children:"Badges and micro-credentials"})),i(w,me({color:"dimmed",className:t.description,mt:"sm"},{children:"Project-sized skills acquisition and standards alignment."}))]}))}),i(V,{placeholder:"Search for a badge that fits your needs",data:e.badges.map((function(e){return e.name})),onChange:e.onAutocompleteChange}),n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),i(xe,{loading:e.loading,items:e.badges,onClick:e.onBadgeClick})]}))]}))}))};function ze(e){if(0===e.items.length)return i(ve,{title:"No students to display",description:"You don't have any students yet, add them and revisit.",loading:e.loading,icon:"groups"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onViewProfile(t)}},{children:t.studentName}))}),i("td",{children:t.className})]},t.studentName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Student Name"}),i("th",{children:"Class Name"})]})}),i("tbody",{children:t})]}))}))}function we(e){if(0===e.items.length)return i(ve,{title:"No reflections to display",description:"There has not been any lesson progress just yet.",loading:e.loading,icon:"lessons"});var t=e.items.map((function(e){return n("tr",{children:[i("td",{children:e.studentName}),i("td",{children:e.reflection}),i("td",{children:e.rating.toLocaleString()})]},e.studentName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Student Name"}),i("th",{children:"Reflection"}),i("th",{children:"Rating"})]})}),i("tbody",{children:t})]}))}))}function Oe(e){if(0===e.items.length)return i(ve,{title:"No impact statements to display",description:"There are no students with impact statements yet.",loading:e.loading,icon:"kindergarten"});var t=e.items.map((function(e){return n("tr",{children:[i("td",{children:e.studentName}),i("td",{children:e.impactStatement})]},e.studentName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Student Name"}),i("th",{children:"Impact Statement"})]})}),i("tbody",{children:t})]}))}))}function Te(e){if(0===e.items.length)return i(ve,{title:"No badges to display",description:"We don't have any badges to show you just yet.",loading:e.loading,icon:"badges"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({sx:function(e){return{display:"block",width:"100%",padding:e.spacing.md,color:"dark"===e.colorScheme?e.colors.dark[0]:e.black,"&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[1]}}},onClick:function(){return e.onClick&&e.onClick(t)}},{children:i(B,{children:n("div",{children:[i(w,me({size:"sm",weight:500},{children:t.name})),i(w,me({size:"xs",color:"dimmed"},{children:t.description}))]})})}))}),i("td",{children:t.description}),n("td",{children:[Math.round(100*(t.percentageCompletion+Number.EPSILON)),"%"]})]},t.badgeId)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Badge Name"}),i("th",{children:"Description"}),i("th",{children:"Completion"})]})}),i("tbody",{children:t})]}))}))}function Le(e){if(0===e.items.length)return i(ve,{title:"No lessons to display",description:"We don't have any lessons to show you just yet.",loading:e.loading,icon:"lessons"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({sx:function(e){return{display:"block",width:"100%",padding:e.spacing.md,color:"dark"===e.colorScheme?e.colors.dark[0]:e.black,"&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[1]}}},onClick:function(){return e.onClick&&e.onClick(t)}},{children:i(B,{children:n("div",{children:[i(w,me({size:"sm",weight:500},{children:t.name})),i(w,me({size:"xs",color:"dimmed"},{children:t.description}))]})})}))}),i("td",{children:t.description}),n("td",{children:[Math.round(100*(t.percentageCompletion+Number.EPSILON)),"%"]})]},t.lessonId)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Lesson Name"}),i("th",{children:"Description"}),i("th",{children:"Completion"})]})}),i("tbody",{children:t})]}))}))}var Ae=function(e){var t=S("students"),r=t[0],o=t[1];return i(D,me({size:"lg",py:"xl"},{children:n(H,{children:[n(H,me({spacing:0},{children:[i(T,me({size:"h3"},{children:"Dashboard"})),i(w,me({color:"dimmed",size:"sm",mt:"md"},{children:"Fast-track learning for your students."}))]})),i(H,{children:n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),n(H,me({spacing:"sm"},{children:[i(ge,{data:[{title:"# OF STUDENTS",value:e.students.length},{title:"ACCOUNT CREATION",value:e.percentageOfAccountsCreated,unit:"%"},{title:"BADGE COMPLETION",value:e.percentageOfBadgesEarned,unit:"%"},{title:"LESSON COMPLETION",value:e.percentageOfLessonsCompleted,unit:"%"}]}),n(H,me({spacing:0},{children:[i(pe,{value:r,data:[{label:"My students",value:"students"},{label:"Impact statements",value:"impact"},{label:"Reflections",value:"reflections"},{label:"Badges",value:"badges"},{label:"Lessons",value:"lessons"}],onChange:o}),"impact"===r&&i(Oe,{loading:e.loading,items:e.impacts}),"reflections"===r&&i(we,{loading:e.loading,items:e.reflections}),"badges"===r&&i(Te,{loading:e.loading,items:e.badges,onClick:e.onBadgeClick}),"lessons"===r&&i(Le,{loading:e.loading,items:e.lessons,onClick:e.onLessonClick}),"students"===r&&n(H,me({mt:10},{children:[i(q,{clearable:!0,clearButtonLabel:"Clear class selection",size:"sm",placeholder:"Select a class",nothingFound:"No options",value:e.classId,onChange:e.onClassChange,icon:i(l,{}),data:e.classes.map((function(e){return{value:e.classId,label:e.name}}))}),i(ze,{loading:e.loading,items:e.students,onViewProfile:e.onViewStudentProfile})]}))]}))]}))]}))})]})}))},Be=[{unit:"year",ms:31536e6},{unit:"month",ms:2628e6},{unit:"day",ms:864e5},{unit:"hour",ms:36e5},{unit:"minute",ms:6e4},{unit:"second",ms:1e3}],Ie=new Intl.RelativeTimeFormat("en",{numeric:"auto"});function We(e,n){return void 0===n&&(n=new Date),e?function(e){for(var n=0,i=Be;n<i.length;n++){var t=i[n],r=t.unit,l=t.ms;if(Math.abs(e)>=l||"second"===r)return Ie.format(Math.round(e/l),r)}return""}(e.getTime()-n.getTime()):""}function Ee(e){if(0===e.items.length)return i(ve,{title:"No students to display",description:"You have not rostered any students yet.",loading:e.loading,icon:"groups"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onViewProfile&&e.onViewProfile(t)}},{children:n(B,me({spacing:"sm"},{children:[i(I,{size:40,src:t.avatar,radius:40}),n("div",{children:[i(w,me({size:"sm",weight:500},{children:t.givenName&&t.familyName?"".concat(t.givenName," ").concat(t.familyName):t.email})),i(w,me({size:"xs",color:"dimmed"},{children:t.email}))]})]}))}))}),i("td",{children:t.badgesEarned}),i("td",{children:t.lessonsCompleted}),i("td",{children:t.hasAccount&&i(o,{color:"green"})}),i("td",{children:t.lastActivity?We(t.lastActivity):""}),i("td",{children:i(B,me({noWrap:!0,spacing:0,position:"right"},{children:!t.readonly&&!!e.onDelete&&i(R,me({color:"red"},{children:i(a,{onClick:function(){return se({title:'Delete "'.concat((n=t).givenName&&n.familyName?"".concat(n.givenName," ").concat(n.familyName):n.email,'"?'),centered:!0,children:i(w,me({size:"sm"},{children:"Are you sure you want to delete this person? This action is destructive and you will have to contact support to restore your data."})),labels:{confirm:"Delete",cancel:"No don't delete them"},confirmProps:{color:"red"},onConfirm:function(){return e.onDelete&&e.onDelete(n)}});var n},size:16,stroke:1.5})}))}))})]},t.email)}));return i(E,{children:n(P,me({verticalSpacing:20,sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Student Name"}),i("th",{children:"Badges Earned"}),i("th",{children:"Lessons Completed"}),i("th",{children:"Account Created?"}),i("th",{children:"Last Active"}),i("th",{})]})}),i("tbody",{children:t})]}))})}var Pe=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600},wrapper:{position:"relative",marginBottom:30},dropzone:{borderWidth:1,paddingBottom:50},icon:{color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[4]},control:{position:"absolute",width:250,left:"calc(50% - 125px)",bottom:-20}}})),De=function(e){var l=Pe().classes,o=ae({initialValues:{classId:"",studentId:"",email:"",givenName:"",familyName:"",avatar:"",role:"",readonly:!1,lastActivity:null,hasAccount:!1,lessonsCompleted:0,badgesEarned:0},validate:{email:function(n){return/^\S+@\S+$/.test(n)&&0===e.students.filter((function(e){return e.email===n})).length?null:"Invalid email"}}}),a=S(!1),s=a[0],d=a[1];return n(t,{children:[i(G,me({opened:s,onClose:function(){return d(!1)},title:i(T,me({size:"h5"},{children:"Add students"})),padding:"xl",size:"xl"},{children:n(H,me({spacing:"md"},{children:[i(He,me({},e,{close:function(){return d(!1)}})),i(U,{label:"or",labelPosition:"center",my:"md",variant:"dashed"}),i("form",me({onSubmit:o.onSubmit((function(){var n=o.values;o.reset(),d(!1),e.onCreateStudents&&e.onCreateStudents([n])}))},{children:n(H,{children:[i(_,me({withAsterisk:!0,label:"Email",placeholder:"Email"},o.getInputProps("email"))),n(B,me({grow:!0},{children:[i(_,me({label:"Given name",placeholder:"Given name"},o.getInputProps("givenName"))),i(_,me({label:"Family name",placeholder:"Family name"},o.getInputProps("familyName")))]})),i(M,me({type:"submit",fullWidth:!0,mt:"md"},{children:"Submit"}))]})}))]}))})),i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[n(j,{children:[n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",leftSection:i(R,me({onClick:e.onBackClick,color:"blue",size:"xs",radius:"xl",variant:"filled"},{children:i(r,{size:14})})),size:"lg"},{children:"Classes"})),i(T,me({order:2,className:l.title,mt:"md"},{children:e.displayName||"Class"})),i(w,me({color:"dimmed",className:l.description,mt:"sm"},{children:e.description||"No description"}))]})),i(j.Col,me({sm:"content"},{children:!e.loading&&i(M,me({onClick:function(){return d(!0)},leftIcon:i(c,{size:14})},{children:"Add students"}))}))]}),n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),n(H,me({spacing:"sm"},{children:[i(ge,{data:[{title:"# OF STUDENTS",value:e.students.length},{title:"ACCOUNT CREATION",value:e.percentageOfAccountsCreated,unit:"%"},{title:"BADGE COMPLETION",value:e.percentageOfBadgesEarned,unit:"%"},{title:"LESSON COMPLETION",value:e.percentageOfLessonsCompleted,unit:"%"}]}),i(Ee,{loading:e.loading,items:e.students,onDelete:e.onDeleteStudent,onViewProfile:function(n){return e.onStudentClick(n)}})]}))]}))]}))}))]})},He=function(e){var t=Pe(),r=t.classes,l=t.theme,o=N.useRef(null),a=N.useState(!1),c=a[0],m=a[1],u=N.useCallback((function(n){m(!0),n.forEach((function(n){ce.parse(n,{download:!0,header:!0,dynamicTyping:!0,skipEmptyLines:!0,worker:!0,complete:function(n){var i=n.data.filter((function(n){return/^\S+@\S+$/.test(n.email)&&0===e.students.filter((function(e){return e.email===n.email})).length}));i.length>0&&e.onCreateStudents&&e.onCreateStudents(i),m(!1),e.close()}})}))}),[]);return n("div",me({className:r.wrapper},{children:[i(le,me({loading:c,openRef:o,onDrop:u,className:r.dropzone,radius:"md",accept:[oe.csv],maxSize:5*Math.pow(1024,2)},{children:n("div",me({style:{pointerEvents:"none"}},{children:[n(B,me({position:"center"},{children:[i(le.Accept,{children:i(s,{size:50,color:l.colors[l.primaryColor][6],stroke:1.5})}),i(le.Reject,{children:i(d,{size:50,color:l.colors.red[6],stroke:1.5})}),i(le.Idle,{children:i(h,{size:50,color:"dark"===l.colorScheme?l.colors.dark[0]:l.black,stroke:1.5})})]})),n(w,me({align:"center",weight:700,size:"lg",mt:"xl"},{children:[i(le.Accept,{children:"Drop files here"}),i(le.Reject,{children:"Csv file less than 5mb"}),i(le.Idle,{children:"Upload multiple"})]})),n(w,me({align:"center",size:"sm",mt:"xs",color:"dimmed"},{children:["Drag'n'drop files here to upload. We can accept only ",i("i",{children:".csv"})," files that are less than 5mb in size."]}))]}))})),i(M,me({className:r.control,size:"md",radius:"xl",onClick:function(){var e;return null===(e=o.current)||void 0===e?void 0:e.call(o)}},{children:"Select file"}))]}))};function je(e){if(0===e.items.length)return i(ve,{title:"No classes to display",description:"You don't have any classes yet. Try creating one first...",loading:e.loading,icon:"groups"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick(t)}},{children:i(w,me({size:14},{children:t.name}))}))}),i("td",{children:i(w,me({size:14},{children:t.description}))}),i("td",{children:i(B,me({noWrap:!0,spacing:0,position:"right"},{children:i(R,me({color:"red"},{children:i(a,{onClick:function(){return se({title:'Delete "'.concat((n=t).name,'"?'),centered:!0,children:i(w,me({size:"sm"},{children:"Are you sure you want to delete this class? This action is destructive and you will have to contact support to restore your data."})),labels:{confirm:"Delete class",cancel:"No don't delete it"},confirmProps:{color:"red"},onConfirm:function(){return e.onDeleteClass(n)}});var n},size:16,stroke:1.5})}))}))})]},t.classId)}));return i(E.Autosize,me({maxHeight:300},{children:n(P,me({verticalSpacing:20,sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Class Name"}),i("th",{children:"Description"}),i("th",{})]})}),i("tbody",{children:t})]}))}))}var Re=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600}}})),Me=function(e){var r=Re().classes,l=ae({initialValues:{classId:"",name:"",description:""},validate:{name:function(e){return e.length<=6?"Name should include at least 6 characters":null}}}),o=S(!1),a=o[0],s=o[1];return n(t,{children:[i(G,me({opened:a,onClose:function(){return s(!1)},title:n(B,me({spacing:0},{children:[i(T,me({size:"h5"},{children:"Create a class"})),i(Y,me({label:"Classes settings cannot be modified once created"},{children:i(R,{children:i(m,{color:"#3b82f6",size:14})})}))]})),padding:"xl",size:"xl"},{children:n("form",me({onSubmit:l.onSubmit((function(){var n=l.values;l.reset(),s(!1),e.onCreateClass&&e.onCreateClass(n)}))},{children:[n(H,{children:[i(_,me({withAsterisk:!0,label:"Name",placeholder:"Class name"},l.getInputProps("name"))),i(_,me({label:"Description",placeholder:"A class for my first period English students"},l.getInputProps("description")))]}),i(M,me({type:"submit",fullWidth:!0,mt:"md"},{children:"Submit"}))]}))})),i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[n(j,{children:[n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",size:"lg"},{children:"Classes"})),i(T,me({order:2,className:r.title,mt:"md"},{children:"Organize students into classes"})),i(w,me({color:"dimmed",className:r.description,mt:"sm"},{children:"A class can be for a specific period of time, grade, team, or other cohorts."}))]})),i(j.Col,me({sm:"content"},{children:!e.loading&&i(M,me({onClick:function(){return s(!0)},leftIcon:i(c,{size:14})},{children:"Create class"}))}))]}),n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),n(H,me({spacing:"sm"},{children:[i(ge,{data:[{title:"# OF CLASSES",value:e.classes.length}]}),i(je,{loading:e.loading,items:e.classes,onDeleteClass:e.onDeleteClass,onClick:e.onClassClick})]}))]}))]}))}))]})},Fe=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900,marginTop:16},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600}}})),qe=function(e){var r=Fe().classes;return n(t,{children:[i(T,me({className:r.title},{children:e.name})),i(w,me({color:"dimmed",className:r.description,mt:"xs"},{children:e.impactStatement}))]})};function Ve(e){if(0===e.items.length)return i(ve,{title:"No badges to display",description:"There has not been any badge progress just yet.",loading:e.loading,icon:"badges"});var t=e.items.map((function(e){return n("tr",{children:[i("td",{children:e.badgeName}),n("td",{children:[!!e.isComplete&&i(W,me({variant:"filled"},{children:"Complete"})),!e.isComplete&&i(W,me({color:"red",variant:"filled"},{children:"Incomplete"}))]})]},e.badgeName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Badge Name"}),i("th",{children:"Status"})]})}),i("tbody",{children:t})]}))}))}function Ge(e){if(0===e.items.length)return i(ve,{title:"No answers to display",description:"There has not been any lesson progress just yet.",loading:e.loading,icon:"lessons"});var t=e.items.map((function(e){return n("tr",{children:[i("td",{children:e.lessonName}),i("td",{children:e.questionName}),i("td",{children:e.answer.join(",")})]},e.questionName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Lesson Name"}),i("th",{children:"Question"}),i("th",{children:"Answer"})]})}),i("tbody",{children:t})]}))}))}function Ue(e){if(0===e.items.length)return i(ve,{title:"No reflections to display",description:"There has not been any lesson progress just yet.",loading:e.loading,icon:"lessons"});var t=e.items.map((function(e){return n("tr",{children:[i("td",{children:e.lessonName}),i("td",{children:e.reflection}),i("td",{children:e.rating.toLocaleString()})]},e.lessonName)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Lesson Name"}),i("th",{children:"Reflection"}),i("th",{children:"Rating"})]})}),i("tbody",{children:t})]}))}))}var _e=function(e){var t=S("badges"),l=t[0],o=t[1],a=e.badges.length,c=a>0?e.badges.filter((function(e){return e.isComplete})).length/a:0;return i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[i(j,me({gutter:"md"},{children:n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",leftSection:i(R,me({onClick:e.onBackClick,color:"blue",size:"xs",radius:"xl",variant:"filled"},{children:i(r,{size:14})})),size:"lg"},{children:"Users"})),i(qe,{variant:"compact",name:e.name,impactStatement:e.impactStatement})]}))})),n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),n(H,me({spacing:"lg"},{children:[i(ge,{data:[{title:"PROBLEMS SOLVED",value:e.numberOfProblemsSolved},{title:"LESSON COMPLETION",value:e.percentageOfLessonsCompleted,unit:"%"},{title:"BADGE COMPLETION",value:c,unit:"%"}]}),n(H,me({spacing:0},{children:[i(pe,{value:l,data:[{label:"My badges",value:"badges"},{label:"My answers",value:"answers"},{label:"My reflections",value:"reflections"}],onChange:o}),"badges"===l&&i(Ve,{loading:e.loading,items:e.badges,onClick:e.onBadgeClick}),"answers"===l&&i(Ge,{loading:e.loading,items:e.answers}),"reflections"===l&&i(Ue,{loading:e.loading,items:e.reflections})]}))]}))]}))]}))}))},Ye=z((function(e,n){var i=n.from||"blue",t=n.to||"green";return{card:{position:"relative",cursor:"pointer",overflow:"hidden",transition:"transform 150ms ease, box-shadow 100ms ease",padding:e.spacing.xl,paddingLeft:2*e.spacing.xl,"&:hover":{boxShadow:e.shadows.md,transform:"scale(1.02)"},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:0,width:6,backgroundImage:e.fn.linearGradient(0,e.colors[i][6],e.colors[t][6])}}}}));function $e(e){var t=Ye(e).classes,r=e.from||"blue",l=e.to||"green",o=e.icon||i(u,{size:28,stroke:1.5});return n($,me({withBorder:!0,radius:"md",className:t.card,onClick:e.onClick},{children:[i(J,me({size:"xl",radius:"md",variant:"gradient",gradient:{deg:0,from:r,to:l}},{children:o})),i(w,me({size:"xl",weight:500,mt:"md"},{children:e.title})),i(w,me({size:"sm",mt:"sm",color:"dimmed"},{children:e.description}))]}))}var Je=z((function(e){return{card:{height:240,backgroundSize:"cover",backgroundPosition:"center"},content:{position:"absolute",padding:e.spacing.xl,zIndex:1,top:0,bottom:0,right:0,left:0},action:{position:"absolute",bottom:e.spacing.xl,right:e.spacing.xl},title:{color:e.white,marginBottom:e.spacing.xs/2},description:{color:e.white,maxWidth:220}}})),Qe=function(e){var t=e.title,r=e.description,l=e.image,o=e.action,a=e.style,c=e.className,s=function(e,n){var i={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(i[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)n.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(i[t[r]]=e[t[r]])}return i}(e,["title","description","image","action","style","className"]),d=Je(),h=d.classes,m=d.cx,u=d.theme;return n(Q,me({radius:"md",style:me({backgroundImage:"url(".concat(l,")")},a),className:m(h.card,c)},s,{children:[i(K,{gradient:"linear-gradient(105deg, ".concat(u.black," 20%, #312f2f 50%, ").concat(u.colors.gray[4]," 100%)"),opacity:.55,zIndex:0}),n("div",me({className:h.content},{children:[i(w,me({size:"lg",weight:700,className:h.title},{children:t})),i(w,me({size:"sm",className:h.description},{children:r})),i(M,me({className:h.action,variant:"white",color:"dark",component:"a",size:"xs",href:o.link,target:"_blank"},{children:o.label}))]}))]}))},Ke=function(e){return i(D,me({size:"lg"},{children:n(H,me({spacing:"lg"},{children:[n(j,me({gutter:"md"},{children:[i(j.Col,me({md:6},{children:i(qe,{variant:"compact",name:e.name,impactStatement:e.impactStatement})})),i(j.Col,me({md:6},{children:i(Qe,{title:e.organization.name,description:e.organization.description,image:e.organization.image,action:{label:"Visit website",link:e.organization.website}})}))]})),n(j,me({gutter:"md"},{children:[i(j.Col,{children:i($e,{title:"Dashboard",description:"Track class performance across core areas of focus.",onClick:e.onDashboardClick})}),i(j.Col,{children:i($e,{title:"Classes",description:"Organize students into classes.",onClick:e.onClassesClick})}),i(j.Col,{children:i($e,{title:"Lessons",description:"Explore units of instruction and/or see corresponding class progress.",onClick:e.onLessonsClick})}),i(j.Col,{children:i($e,{title:"Badges",description:"Project-sized skills acquisition and standards alignment.",onClick:e.onBadgesClick})})]}))]}))}))};function Xe(e){if(0===e.items.length)return i(ve,{title:"No students to display",description:"You don't have any student data yet for this lesson",loading:e.loading,icon:"lessons"});var t=e.items.map((function(t){return n("tr",{children:[i("td",{children:i(A,me({onClick:function(){return e.onClick&&e.onClick(t)}},{children:n(B,me({spacing:"sm"},{children:[i(I,{size:40,src:t.avatar,radius:40}),n("div",{children:[i(w,me({size:"sm",weight:500},{children:t.name})),i(w,me({size:"xs",color:"dimmed"},{children:t.email}))]})]}))}))}),n("td",{children:[!!t.isComplete&&i(W,me({variant:"filled"},{children:"Complete"})),!t.isComplete&&!t.isStarted&&i(W,me({color:"red",variant:"filled"},{children:"Not started"})),!t.isComplete&&!!t.isStarted&&i(W,me({color:"violet",variant:"filled"},{children:"In progress"}))]})]},t.name)}));return i(E.Autosize,me({maxHeight:500},{children:n(P,me({verticalSpacing:"sm",sx:{minWidth:700},highlightOnHover:!0,striped:!0},{children:[i("thead",{children:n("tr",{children:[i("th",{children:"Lesson Name"}),i("th",{children:"Status"})]})}),i("tbody",{children:t})]}))}))}function Ze(e){var t=N.useMemo((function(){return{position:"left",getValue:function(e){return e.primary}}}),[]),r=N.useMemo((function(){return[{position:"bottom",getValue:function(e){return e.secondary}}]}),[]);if(0===e.items.length)return i(ve,{title:"No questions to display",description:"There are no questions in this lesson.",loading:e.loading,icon:"lessons"});var l=e.items.map((function(e){if(e.chart){var l={},o=e.choices||[];return o.forEach((function(e){l[e]=0})),e.answers.forEach((function(e){return e.forEach((function(e){e in l&&(l[e]=l[e]?l[e]+1:1)}))})),i(Q,me({withBorder:!0,p:"xl",radius:"md"},{children:n(H,me({spacing:4},{children:[i(T,me({size:"lg"},{children:e.question})),n(w,me({size:"sm"},{children:[e.answers.length," answers"]})),i("div",me({style:{background:"white",height:"300px",width:"100%",position:"relative"}},{children:i(he,{options:{data:[{label:"",data:o.map((function(e){return{primary:e,secondary:l[e]}}))}],primaryAxis:t,secondaryAxes:r}})}))]}))}),e.question)}return i(Q,me({withBorder:!0,p:"xl",radius:"md"},{children:n(H,me({spacing:4},{children:[i(T,me({size:"lg"},{children:e.question})),n(w,me({size:"sm"},{children:[e.answers.length," answers"]})),i(E.Autosize,me({maxHeight:500},{children:i(H,me({spacing:4},{children:e.answers.map((function(e){var n=e.join("\n");return i(Q,me({p:5,radius:0,bg:"gray.0"},{children:i(w,{children:n})}),n)}))}))}))]}))}),e.question)}));return i(H,me({py:4,spacing:10,sx:{minWidth:700}},{children:l}))}var en=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600}}})),nn=function(e){var t=en().classes,o=S("question"),a=o[0],c=o[1],s=e.students.length,d=s>0?e.students.filter((function(e){return e.isComplete})).length/s:0;return i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[i(j,{children:n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",leftSection:i(R,me({onClick:e.onBackClick,color:"blue",size:"xs",radius:"xl",variant:"filled"},{children:i(r,{size:14})})),size:"lg"},{children:"Lessons"})),n(B,{children:[n(H,me({spacing:0},{children:[i(T,me({order:2,className:t.title,mt:"md"},{children:e.displayName||"Lesson"})),i(w,me({color:"dimmed",className:t.description,mt:"sm"},{children:e.description||"No description"}))]})),i(H,me({ml:"auto"},{children:i(M,me({variant:"gradient",onClick:e.onPreviewClick},{children:"Preview"}))}))]})]}))}),i("div",{children:n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),n(H,{children:[i(ge,{data:[{title:"LESSON COMPLETION",value:d,unit:"%"}]}),n(H,me({spacing:0},{children:[i(pe,{value:a,data:[{label:"By question",value:"question"},{label:"By reflection",value:"reflections"},{label:"By student",value:"students"}],onChange:c}),"question"===a&&i(Ze,{loading:e.loading,items:e.questions}),"reflections"===a&&i(we,{loading:e.loading,items:e.reflections}),"students"===a&&n(H,me({mt:10},{children:[i(q,{clearable:!0,clearButtonLabel:"Clear class selection",size:"sm",placeholder:"Select a class",nothingFound:"No options",value:e.classId,onChange:e.onClassChange,icon:i(l,{}),data:e.classes.map((function(e){return{value:e.classId,label:e.name}}))}),i(Xe,{loading:e.loading,items:e.students,onClick:e.onUserClick})]}))]}))]})]}))})]}))}))};function tn(e){if(0===e.items.length)return i(ve,{title:"No lessons to display",description:"We don't have any lessons to show you just yet.",loading:e.loading,icon:"lessons"});var t=e.items.map((function(t){return i("tr",{children:i("td",{children:i(A,me({sx:function(e){return{display:"block",width:"100%",padding:e.spacing.md,color:"dark"===e.colorScheme?e.colors.dark[0]:e.black,"&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[1]}}},onClick:function(){return e.onClick&&e.onClick(t)}},{children:i(B,{children:n("div",{children:[i(w,me({size:"sm",weight:500},{children:t.name})),i(w,me({size:"xs",color:"dimmed"},{children:t.description}))]})})}))})},t.lessonId)}));return i(E.Autosize,me({maxHeight:500},{children:i(P,me({horizontalSpacing:0,verticalSpacing:0,sx:{minWidth:700}},{children:i("tbody",{children:t})}))}))}var rn=z((function(e){var n;return{title:(n={fontSize:34,fontWeight:900},n[e.fn.smallerThan("sm")]={fontSize:24},n),description:{maxWidth:600}}})),ln=function(e){var t=rn().classes;return i(D,me({size:"lg",py:"xl"},{children:n(H,me({spacing:"md"},{children:[i(j,{children:n(j.Col,me({sm:"auto"},{children:[i(W,me({variant:"filled",size:"lg"},{children:"Lessons"})),i(T,me({order:2,className:t.title,mt:"md"},{children:"Lessons"})),i(w,me({color:"dimmed",className:t.description,mt:"sm"},{children:"Explore units of instruction and/or see corresponding class progress."}))]}))}),i(V,{placeholder:"Search for a lesson that fits your needs",data:e.lessons.map((function(e){return e.name})),onChange:e.onAutocompleteChange}),n("div",me({style:{position:"relative"}},{children:[i(F,{visible:e.loading,overlayBlur:2}),i(tn,{loading:e.loading,items:e.lessons,onClick:e.onLessonClick})]}))]}))}))},on=X({key:"mantine",prepend:!1}),an=function(n){return i(Z,me({withNormalizeCSS:!0,withGlobalStyles:!0,emotionCache:on,theme:{loader:"bars"}},{children:i(e,me({limit:n.notificationLimit||5},{children:i(de,{children:n.children})}))}))},cn=function(e){var t=ae({initialValues:{active:e.account}});return i(ee,me({centered:!0,opened:e.opened,onClose:function(){return e.onClose&&e.onClose()},size:"sm",title:i(T,me({size:"h5"},{children:"Accounts"}))},{children:n("form",me({onSubmit:t.onSubmit((function(){e.onChange&&e.onChange(t.values.active)}))},{children:[i(q,me({required:!0,placeholder:"Select an account",defaultValue:e.account,data:e.accounts.map((function(e){return{value:e.accountId,label:e.name}}))},t.getInputProps("active"))),i(M,me({type:"submit",fullWidth:!0,mt:"xl"},{children:"Switch"}))]}))}))},sn=z((function(e){return{link:{width:50,height:50,borderRadius:e.radius.md,display:"flex",alignItems:"center",justifyContent:"center",color:"dark"===e.colorScheme?e.colors.dark[0]:e.colors.gray[7],"&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]}},active:{"&, &:hover":{backgroundColor:e.fn.variant({variant:"light",color:e.primaryColor}).background,color:e.fn.variant({variant:"light",color:e.primaryColor}).color}}}})),dn=[{icon:f,label:"Home",href:"/home"},{icon:v,label:"Dashboard",href:"/dashboard"},{icon:l,label:"Classes",href:"/classes"},{icon:b,label:"Badges",href:"/badges"},{icon:y,label:"Lessons",href:"/lessons"}],hn=function(e){var n,t=e.icon,r=e.label,l=e.active,o=e.onClick,a=sn(),c=a.classes,s=a.cx;return i(Y,me({label:r,position:"right",transitionDuration:0},{children:i(A,me({onClick:o,className:s(c.link,(n={},n[c.active]=l,n))},{children:i(t,{stroke:1.5})}))}))},mn=function(e){var t=dn.map((function(n){return i(hn,{label:n.label,icon:n.icon,active:n.label===e.active,onClick:function(){return e.navigate(n.href)}},n.label)}));return n(ne,me({width:{base:80},p:"md"},{children:[i(ie,{children:i(I,me({color:"blue",radius:"sm"},{children:i("div",me({style:{width:15,marginLeft:"auto",marginRight:"auto"}},{children:i(L,{fit:"contain",src:"https://cdn.localcivics.io/brand/l.png"})}))}))}),i(ne.Section,me({grow:!0,mt:50},{children:i(H,me({justify:"center",spacing:0},{children:t}))})),i(ne.Section,{children:n(H,me({justify:"center",spacing:0},{children:[i(hn,{icon:g,label:"Switch accounts",onClick:e.onSwitchAccounts}),i(hn,{icon:p,label:"Logout",onClick:e.onLogout})]}))})]}))},un=z((function(e){var n,i,t,r,l,o;return{footer:{paddingTop:2*e.spacing.xl,paddingBottom:2*e.spacing.xl,paddingLeft:3*e.spacing.xl,backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.colors.gray[0],borderTop:"1px solid ".concat("dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[2])},logo:(n={maxWidth:200},n[e.fn.smallerThan("sm")]={display:"flex",flexDirection:"column",alignItems:"center"},n),description:(i={marginTop:5},i[e.fn.smallerThan("sm")]={marginTop:e.spacing.xs,textAlign:"center"},i),inner:(t={display:"flex",justifyContent:"space-between"},t[e.fn.smallerThan("sm")]={flexDirection:"column",alignItems:"center"},t),groups:(r={display:"flex",flexWrap:"wrap"},r[e.fn.smallerThan("sm")]={display:"none"},r),wrapper:{width:160},link:{display:"block",color:"dark"===e.colorScheme?e.colors.dark[1]:e.colors.gray[6],fontSize:e.fontSizes.sm,paddingTop:3,paddingBottom:3,"&:hover":{textDecoration:"underline"}},title:{fontSize:e.fontSizes.md,fontWeight:700,fontFamily:"Greycliff CF, ".concat(e.fontFamily),marginBottom:e.spacing.xs/2,color:"dark"===e.colorScheme?e.white:e.black},afterFooter:(l={display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:e.spacing.xl,paddingTop:e.spacing.xl,paddingBottom:e.spacing.xl,borderTop:"1px solid ".concat("dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[2])},l[e.fn.smallerThan("sm")]={flexDirection:"column"},l),social:(o={},o[e.fn.smallerThan("sm")]={marginTop:e.spacing.xs},o)}})),gn=function(e){var r=un().classes,l=pn(e.account,e.accounts,e.onAccountChange);return n(te,me({padding:"xs",navbar:i(mn,{active:e.navbar.props.active,navigate:e.navbar.props.navigate,onLogout:e.navbar.props.onLogout,onSwitchAccounts:function(){return l.setChangeModalOpen(!0)}}),footer:i(t,{children:!l.opened&&n("footer",me({className:r.footer},{children:[n(D,me({className:r.inner},{children:[n("div",me({className:r.logo},{children:[n(B,me({spacing:"xs"},{children:[i("div",me({style:{width:15}},{children:i(L,{fit:"contain",src:"https://cdn.localcivics.io/brand/l.png"})})),i(T,me({color:"dimmed",size:"h5"},{children:"Local Civics"}))]})),i(w,me({size:"xs",color:"dimmed",className:r.description},{children:"We connect students to powerful civic learning experiences."}))]})),i("div",me({className:r.groups},{children:n("div",me({className:r.wrapper},{children:[i(w,me({className:r.link,component:"a",href:"https://www.localcivics.io",target:"_blank"},{children:"About"})),i(w,me({className:r.link,component:"a",href:"https://www.localcivics.io/terms-of-service",target:"_blank"},{children:"Terms"})),i(w,me({className:r.link,component:"a",href:"https://www.localcivics.io/privacy-policy",target:"_blank"},{children:"Privacy"})),i(w,me({className:r.link,component:"a",href:"https://localcivics.notion.site/Help-Center-b52300f587b64fc0a61f512686e7626d",target:"_blank"},{children:"Help Center"}))]}))}))]})),n(D,me({className:r.afterFooter},{children:[n(w,me({color:"dimmed",size:"sm"},{children:["© ",(new Date).getFullYear()," Local Civics. All rights reserved."]})),n(B,me({spacing:0,className:r.social,position:"right",noWrap:!0},{children:[i(R,me({component:"a",target:"_blank",href:"https://www.instagram.com/localcivics/",size:"lg"},{children:i(C,{size:18,stroke:1.5})})),i(R,me({component:"a",target:"_blank",href:"https://www.linkedin.com/company/localcivics",size:"lg"},{children:i(k,{size:18,stroke:1.5})})),i(R,me({component:"a",target:"_blank",href:"https://www.facebook.com/localcivics/",size:"lg"},{children:i(x,{size:18,stroke:1.5})}))]}))]}))]}))}),styles:function(e){return{main:{backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[0]}}}},{children:[n("div",me({style:{position:"relative"}},{children:[(e.loading||l.opened)&&i(ie,me({style:{height:400}},{children:i(re,{})})),!e.loading&&!l.opened&&e.page]})),i(cn,{opened:l.opened,account:l.account,accounts:l.accounts,onChange:l.onAccountChange,onClose:function(){return l.setChangeModalOpen(!1)}})]}))},pn=function(e,n,i){var t=JSON.stringify(n),r=S(!1),l=r[0],o=r[1],a=S(e),c=a[0],s=a[1];return N.useEffect((function(){s(e)}),[e,t]),{opened:l,account:c,accounts:n,setChangeModalOpen:o,onAccountChange:function(e){s(e),o(!1),i(e)}}};export{an as AdminProvider,gn as App,ke as Badge,Se as Badges,De as Class,Me as Classes,Ae as Dashboard,Ke as Home,nn as Lesson,ln as Lessons,mn as Navbar,_e as Student,cn as SwitchAccount};
|