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d,GAAAtQ,EAAAI,EAAA,EAACyF,OAAAA,CAAAA,GAEFiH,EACCiB,EAAStE,cAAc,CACrB,GAAAzJ,EAAAI,EAAA,EAAAJ,EAAAsF,EAAA,KAEA,GAAAtF,EAAAC,EAAA,EAACC,MAAAA,CAAItB,IAAKF,EAAEgN,qBAAqB,WAC/B,GAAA1L,EAAAI,EAAA,EAAC+Q,EAAAA,CAASA,CAAAA,CACRvS,IAAK,CACHoD,SAAU,GACV5C,MAAOC,EAAAA,EAASA,CAACC,WAAW,IAGhC,GAAAU,EAAAC,EAAA,EAACI,IAAAA,WAAE,WACQ0N,EAAS5I,IAAI,CAAC,+BACd,IACT,GAAAnF,EAAAC,EAAA,EAACmR,IAAAA,WAEG,KAAEtE,CAAAA,CAAAA,OAAAA,CAAAA,EAAAA,EAAuBmB,IAAI,CAC3B,OAAC,CAAEH,YAAAA,CAAW,CAAE,CAAA/N,SACd+N,IAAgBC,EAASzE,KAAK,KAFhCwD,KAAAA,IAAAA,EAAAA,KAAAA,EAAAA,EAGCwE,wBAAwB,GACzB,EAAgB,EAClBJ,OAAO,CAAC,GAAG,aAOrB,GAAAlR,EAAAI,EAAA,EAACqG,EAAAA,CAAOA,CAAAA,CACNL,KAAM,WACNpB,QAAS,IACPlB,EAA2B,CACzB6C,aAAcoH,EAAS5I,IAAI,CAC3BuB,WAAYqH,EAASvL,EAAE,GAG3B6D,KAAM,GAAArG,EAAAI,EAAA,EAACwG,EAAAA,CAAgBA,CAAAA,CAAChI,IAAK,CAAEoD,SAAU,EAAG,QAnG3C+L,EAAS5I,IAAI,CAwGxB,KAGR,QAIV","sources":["webpack://_N_E/../api/src/utils/getTermNumber.ts","webpack://_N_E/./components/audit/AuditTypePill.tsx","webpack://_N_E/./components/audit/SurveyCard.tsx","webpack://_N_E/./components/displays/Modal/DeleteConfirmationModal.tsx","webpack://_N_E/./components/insights/ChooseWhichTemplateModal.tsx","webpack://_N_E/./components/inputs/ThreeStateHTMLCheckbox.tsx","webpack://_N_E/./components/insights/ResponseCounts.tsx","webpack://_N_E/"],"sourcesContent":["import dayjs from \"dayjs\";\n\nexport const getTermNumber = (start_date: Date | null) => {\n const startMonth = dayjs(start_date).month();\n if (startMonth >= 8) {\n return 1;\n } else if (startMonth >= 4) {\n return 3;\n } else {\n return 2;\n }\n};\n","import { css } from \"@emotion/react\";\nimport { AuditType } from \"@monorepo/api-types\";\nimport { colorVars, getColor } from \"apps/dashboard-client/utils/colorUtils\";\nimport { renderSurveyTypeIcon, surveyTypeNames } from \"../../utils/surveyUtils\";\n\ntype AuditTypePillProps = { auditType: AuditType };\n\nconst s = {\n container: css({\n display: \"flex\",\n alignItems: \"center\",\n columnGap: \"1.2rem\",\n borderRadius: \"20rem\",\n padding: \"0.2rem 1.2rem\",\n }),\n [AuditType.FULL]: css({\n color: colorVars.bluePrimary,\n backgroundColor: getColor(\"bluePrimary\", 0.2),\n }),\n [AuditType.PULSE]: css({\n color: colorVars.orange,\n backgroundColor: getColor(\"orange\", 0.2),\n }),\n [AuditType.BUNDLE]: css({\n color: colorVars.green,\n backgroundColor: getColor(\"green\", 0.2),\n }),\n};\n\nconst AuditTypePill = ({ auditType }: AuditTypePillProps) => {\n return (\n
\n {renderSurveyTypeIcon(auditType, \"2.2rem\")}\n

{surveyTypeNames[auditType]}

\n
\n );\n};\n\nexport default AuditTypePill;\n","import { css } from \"@emotion/react\";\nimport { AuditType, FetchAuditsResponse } from \"@monorepo/api-types\";\nimport React, { useMemo, useState } from \"react\";\nimport dayjs from \"dayjs\";\nimport {\n ArrowDropDownOutlined,\n ArrowDropUpOutlined,\n DeleteOutlined,\n EditOutlined,\n FileCopy,\n FileCopyOutlined,\n} from \"@mui/icons-material\";\nimport { colorVars, getColor } from \"../../utils/colorUtils\";\nimport SurveyProgressDropdown from \"../displays/SurveyProgressDropdown\";\nimport Button from \"../inputs/Button\";\nimport { useRouter } from \"next/router\";\nimport { auditService } from \"@monorepo/api-service\";\nimport DeleteConfirmationModal from \"../displays/Modal/DeleteConfirmationModal\";\nimport { RequestState, tryCatch } from \"@monorepo/components\";\nimport ResponseCounts from \"../insights/ResponseCounts\";\nimport { hasSurveysPermissionsSelector } from \"../../atoms/user.atom\";\nimport { useRecoilValue } from \"recoil\";\nimport { getTermNumber } from \"../../../api/src/utils/getTermNumber\";\nimport AuditTypePill from \"./AuditTypePill\";\nimport NavLink from \"../inputs/NavLink\";\nimport ChooseWhichTemplateModal from \"../insights/ChooseWhichTemplateModal\";\n\ntype SurveyCardProps = FetchAuditsResponse[\"results\"][0] & {\n refetchData: () => void;\n renderOpen?: boolean;\n};\n\nconst s = {\n container: css({\n backgroundColor: \"white\",\n padding: \"2.4rem\",\n height: \"fit-content\",\n borderRadius: 8,\n position: \"relative\",\n display: \"flex\",\n flexDirection: \"column\",\n rowGap: \"3.2rem\",\n }),\n row: css({\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n }),\n deleteButton: css({\n color: colorVars.error,\n backgroundColor: \"transparent\",\n border: \"none\",\n marginLeft: \"auto\",\n display: \"flex\",\n alignItems: \"center\",\n columnGap: \".6rem\",\n cursor: \"pointer\",\n }),\n extendButton: css({\n color: colorVars.bluePrimary,\n }),\n progress: css({\n borderRadius: 8,\n borderWidth: 2,\n borderStyle: \"solid\",\n borderColor: colorVars.gray2,\n }),\n responses: css({\n display: \"flex\",\n flexDirection: \"column\",\n rowGap: \"2.4rem\",\n }),\n breakdown: css({\n display: \"flex\",\n columnGap: \"2rem\",\n justifyContent: \"space-between\",\n rowGap: \"3.2rem\",\n flexWrap: \"wrap\",\n }),\n campaign: css({\n display: \"flex\",\n flexDirection: \"column\",\n rowGap: \"2.4rem\",\n alignItems: \"center\",\n width: \"calc(33% - 2rem)\",\n }),\n header: css({\n display: \"flex\",\n alignItems: \"center\",\n cursor: \"pointer\",\n columnGap: \"3.2rem\",\n rowGap: \"1rem\",\n flexWrap: \"wrap\",\n }),\n weeksLeft: css({\n borderRadius: \"2rem\",\n padding: \"0.6rem 1.6rem\",\n backgroundColor: getColor(\"orange\", 0.2),\n color: colorVars.orange,\n }),\n arrow: css({\n fontSize: \"2.1rem\",\n position: \"absolute\",\n top: \"2.4rem\",\n right: \"2.4rem\",\n cursor: \"pointer\",\n color: colorVars.bluePrimary,\n }),\n countdownMessage: css({\n padding: \".6rem 1.2rem \",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n columnGap: \"1.2rem\",\n borderWidth: 1,\n borderRadius: 20,\n width: \"100%\",\n borderStyle: \"solid\",\n borderColor: colorVars.gray2,\n }),\n};\n\nexport const getSurveyTitle = (start_date: Date | null) => {\n return `Survey Term ${getTermNumber(start_date)}, ${(start_date\n ? dayjs(start_date)\n : dayjs()\n ).format(\"YYYY\")}`;\n};\n\nconst SurveyCard = ({\n start_date,\n id,\n end_date,\n setup_page,\n max_setup_page,\n insights_viewable_at,\n audit_type,\n setup_completed_at,\n survey_campaigns,\n refetchData,\n renderOpen = false,\n}: SurveyCardProps) => {\n const hasSurveysPermission = useRecoilValue(hasSurveysPermissionsSelector);\n const [open, setOpen] = useState(renderOpen);\n const [deleteModalOpen, setDeleteModalOpen] = useState(false);\n const [deleteRequestState, setDeleteRequestState] = useState({\n state: \"idle\",\n });\n const [chooseTemplateModalData, setChooseTemplateModalData] = useState<{\n templateId: number;\n templateName: string;\n } | null>(null);\n\n const surveyTitle = useMemo(() => getSurveyTitle(start_date), [start_date]);\n\n const router = useRouter();\n const setPageClicked = async (page: number) => {\n await auditService.updateAudit({ setup_page: page }, { id });\n return router.push(`/surveys/${id}`);\n };\n\n const weeksLeft = useMemo(\n () => dayjs(end_date).diff(dayjs(), \"day\") / 7,\n\n [end_date]\n );\n const renderCountdown = () => {\n if (weeksLeft < 0) {\n return (\n \n Closed\n

\n );\n } else if (weeksLeft < 3) {\n return (\n

\n {Math.floor(weeksLeft + 1)} week\n {Math.floor(weeksLeft + 1) > 1 ? \"s\" : \"\"} left\n

\n );\n } else return <>;\n };\n\n const renderCountdownMessages = (auditType: AuditType) => {\n if (weeksLeft < 0) {\n return (\n
\n

\n \n Your survey is now closed.\n {\" \"}\n Send an email to let your participants know.\n

\n \n true}\n icon={}\n />\n \n
\n );\n } else if (Math.floor(weeksLeft) === 0 && auditType !== AuditType.PULSE) {\n return (\n
\n

\n Your survey closes in 1 week. Please send a reminder email to each\n of your participant groups using the links below.\n

\n
\n );\n } else return <>;\n };\n\n const handleDeleteAudit = () =>\n tryCatch(setDeleteRequestState, async () => {\n await auditService.deleteAudit({ id });\n setDeleteModalOpen(false);\n refetchData();\n });\n\n return (\n \n \n
\n
setOpen(!open)}>\n

{surveyTitle}

\n {start_date && end_date && (\n

\n {dayjs(start_date).format(\"DD/MM/YYYY\")} -{\" \"}\n {dayjs(end_date).format(\"DD/MM/YYYY\")}\n

\n )}\n \n {renderCountdown()}\n {open ? (\n \n ) : (\n \n )}\n
\n
\n {start_date && end_date && (\n
\n

Start date: {dayjs(start_date).format(\"DD/MM/YYYY\")}

\n

End date: {dayjs(end_date).format(\"DD/MM/YYYY\")}

\n
\n )}\n {!setup_completed_at && hasSurveysPermission.edit && (\n setDeleteModalOpen(true)}\n >\n \n

Delete

\n \n )}\n {setup_completed_at &&\n weeksLeft >= 0 &&\n audit_type.name !== AuditType.PULSE &&\n hasSurveysPermission.edit && (\n router.push(`/surveys/extend/${id}`)}\n >\n \n

Extend survey

\n \n )}\n
\n\n {!setup_completed_at ? (\n
\n \n {hasSurveysPermission.edit && (\n router.push(`/surveys/${id}`)}\n customCss={css({ margin: \"1.2rem\" })}\n />\n )}\n
\n ) : (\n
\n

Responses

\n\n {renderCountdownMessages(audit_type.name as AuditType)}\n {audit_type.name === AuditType.PULSE ? (\n \n

\n {survey_campaigns[0].survey_executions.length} response\n {survey_campaigns[0].survey_executions.length === 1\n ? \"\"\n : \"s\"}\n

\n \n setChooseTemplateModalData({\n templateId: survey_campaigns[0].id,\n templateName: \"ALL\",\n })\n }\n icon={}\n />\n\n setChooseTemplateModalData(null)}\n templateId={chooseTemplateModalData?.templateId}\n templateName={chooseTemplateModalData?.templateName}\n />\n
\n ) : (\n \n )}\n router.push(`/insights?auditId=${id}`)}\n />\n
\n )}\n \n \n );\n};\n\nexport default SurveyCard;\n","import { css } from \"@emotion/react\";\nimport { RequestState } from \"@monorepo/components\";\nimport { Modal } from \"@mui/material\";\nimport { Dispatch, SetStateAction } from \"react\";\nimport Button, { ButtonType } from \"../../inputs/Button\";\nimport ErrorMessage from \"apps/survey-client/components/displays/ErrorMessage\";\nimport ModalDialog from \"./ModalDialog\";\n\ntype DeleteConfirmationModalProps = {\n onConfirm: () => void;\n requestState: RequestState;\n open: boolean;\n setOpen: Dispatch>;\n title: string;\n content: string;\n};\n\nconst s = {\n container: css({\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n rowGap: \"2.4rem\",\n padding: \"1.6rem 2.4rem\",\n }),\n buttons: css({\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n }),\n};\n\nconst DeleteConfirmationModal = ({\n onConfirm,\n requestState,\n open,\n setOpen,\n title,\n content,\n}: DeleteConfirmationModalProps) => {\n return (\n setOpen(false)} open={open}>\n \n
\n

{title}

\n

{content}

\n
\n setOpen(false)}\n text={\"Cancel\"}\n type={ButtonType.CANCEL}\n />\n \n
\n\n {requestState.state === \"error\" && (\n \n )}\n
\n
\n
\n );\n};\n\nexport default DeleteConfirmationModal;\n","import { css } from \"@emotion/react\";\nimport { Modal } from \"@mui/material\";\nimport Button, { ButtonType } from \"../inputs/Button\";\nimport { auditService } from \"@monorepo/api-service\";\nimport ModalDialog from \"../displays/Modal/ModalDialog\";\n\ntype ChooseWhichTemplateModalProps = {\n open: boolean;\n onClose: () => void;\n templateName?: string;\n templateId?: number;\n};\n\nconst s = {\n container: css({\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n rowGap: \"2.4rem\",\n padding: \"1.6rem 2.4rem\",\n }),\n buttons: css({\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n }),\n};\n\nconst ChooseWhichTemplateModal = ({\n open,\n onClose,\n templateName,\n templateId,\n}: ChooseWhichTemplateModalProps) => {\n async function handleDownloadTemplate(type: \"INTRO\" | \"REMINDER\") {\n if (!templateName || !templateId) {\n return;\n }\n await auditService.downloadEmailTemplate(\n { id: templateId },\n { type },\n `Survey ${\n type === \"INTRO\" ? \"link\" : \"reminder\"\n } ${templateName} template.pdf`\n );\n onClose();\n }\n return (\n \n \n
\n

Which email template would you like to download?

\n
\n handleDownloadTemplate(\"INTRO\")}\n text={\"Survey Link Email\"}\n type={ButtonType.PRIMARY}\n />\n handleDownloadTemplate(\"REMINDER\")}\n text={\"Survey Reminder Email\"}\n type={ButtonType.SECONDARY}\n />\n
\n
\n
\n
\n );\n};\n\nexport default ChooseWhichTemplateModal;\n","import {\n DetailedHTMLProps,\n InputHTMLAttributes,\n useEffect,\n useRef,\n} from \"react\";\n\ninterface Props\n extends DetailedHTMLProps<\n InputHTMLAttributes,\n HTMLInputElement\n > {\n /**\n * If `true`, the checkbox is checked. If `false`, the checkbox is not\n * checked. If left undefined, the checkbox is uncontrolled.\n * @see https://reactjs.org/docs/glossary.html#controlled-vs-uncontrolled-components\n */\n checked?: boolean;\n\n /**\n * If `true`, the checkbox gives an appearance of being in an indetermined\n * state.\n */\n indeterminate?: boolean;\n\n /**\n * Do not pass in a `type` prop. We force the input to be type \"checkbox\".\n */\n type?: never;\n}\n\nconst Checkbox = ({ indeterminate = false, type, ...inputProps }: Props) => {\n // We need our own internal ref to ensure that it is (a) actually defined,\n // and (b) an object ref rather than a callback ref.\n const internalRef = useRef(null);\n\n // We use an effect here to update the `indeterminate` IDL attribute on the\n // input element whenever the prop value changes.\n useEffect(() => {\n if (internalRef.current) {\n internalRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate]);\n\n return ;\n};\n\nexport default Checkbox;\n","import { css } from \"@emotion/react\";\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport {\n AuditWithResponses,\n FetchAuditInsightsResponse,\n Stakeholder,\n} from \"@monorepo/api-types\";\nimport { colorVars, getColor } from \"apps/dashboard-client/utils/colorUtils\";\nimport { survey_executions } from \"@prisma/client\";\nimport { CircularProgress } from \"@mui/material\";\nimport {\n ArrowDropDown,\n ArrowDropUp,\n FileCopyOutlined,\n ShowChart,\n} from \"@mui/icons-material\";\nimport { Label, Pie, PieChart } from \"recharts\";\nimport ThreeStateHTMLCheckbox from \"../inputs/ThreeStateHTMLCheckbox\";\nimport { useWindowSize } from \"@monorepo/components\";\nimport NavLink from \"../inputs/NavLink\";\nimport ExplainerBox from \"./ExplainerBox\";\nimport ChooseWhichTemplateModal from \"./ChooseWhichTemplateModal\";\nimport ComparisonIndicator from \"./ComparisonIndicator\";\nimport { numberWithPolarity } from \"../../utils/numberFormatting\";\n\ntype ResponseCountsProps = {\n surveyCampaigns: AuditWithResponses[\"survey_campaigns\"];\n topSurveyResponseRates?: FetchAuditInsightsResponse[\"topSurveyResponseRates\"];\n previousSurveyCampaigns?: AuditWithResponses[\"survey_campaigns\"];\n deprecatedPreviousSurveyResponses?: Record[] | null;\n};\n\nconst RESPONSE_GROUPS = [\n {\n name: \"Students\",\n color: colorVars.green,\n\n topResponseRate: 0.97,\n stakeholders: [\n {\n value: Stakeholder.STUDENTS,\n name: \"Aged 11+\",\n color: \"#028665\",\n hideComparison: true,\n },\n {\n value: Stakeholder.STUDENTS_OLDER,\n name: \"Aged 13+\",\n color: colorVars.green,\n hideComparison: true,\n },\n {\n value: Stakeholder.STUDENTS_YOUNGER,\n name: \"Primary\",\n color: \"#2DFFCA\",\n hideComparison: true,\n },\n ],\n },\n {\n name: \"Staff\",\n color: \"#8562BF\",\n topResponseRate: 0.75,\n stakeholders: [\n {\n value: Stakeholder.FACULTY,\n name: \"Teachers & Teaching Assistants\",\n color: \"#FC68FF\",\n hideComparison: true,\n },\n {\n value: Stakeholder.FACULTY_WIDER,\n name: \"Wider staff [not student facing]\",\n color: \"#F0433D\",\n hideComparison: true,\n },\n {\n value: Stakeholder.SUPPORT_STAFF,\n name: \"Support staff [student facing]\",\n color: \"#C069E9\",\n hideComparison: true,\n },\n ],\n },\n\n {\n name: \"School Leaders (Governors / Trustees & SLT)\",\n color: \"#FFE500\",\n topResponseRate: 1,\n stakeholders: [\n {\n value: Stakeholder.GOVERNORS,\n name: \"Governors & Trustees\",\n color: \"#FFE500\",\n hideComparison: true,\n },\n {\n value: Stakeholder.SLT,\n name: \"Senior Leadership Team\",\n color: \"#6000FF\",\n hideComparison: true,\n },\n ],\n },\n {\n name: \"Parents / guardians / carers\",\n color: colorVars.orange,\n topResponseRate: 0.61,\n stakeholders: [\n {\n value: Stakeholder.FAMILY,\n name: \"Parents/Guardians/Carers\",\n color: colorVars.orange,\n },\n ],\n },\n];\n\nexport type Row = {\n name: string;\n color: string;\n topResponseRate: number;\n subGroups: (AuditWithResponses[\"survey_campaigns\"][0] & {\n name: string;\n value: string;\n color: string;\n hideComparison?: boolean;\n })[];\n expectedResponses: number;\n responseCount: number;\n previousResponseCount: number;\n};\n\nconst getProgressStyle = (color: string) =>\n css({\n \".MuiCircularProgress-root\": {\n color,\n },\n \".MuiCircularProgress-progress\": {\n stroke: color,\n },\n width: 64,\n position: \"relative\",\n });\n\nconst getFinishedExecutions = (\n executions: survey_executions[],\n DEPRECATED_survey_execution_count: number | null\n) =>\n DEPRECATED_survey_execution_count ||\n executions.filter((exec) => !!exec.finished_at).length;\n\nconst s = {\n container: css({\n display: \"grid\",\n gridTemplateColumns: \"26rem 1fr\",\n columnGap: \"6.4rem\",\n }),\n graph: css({\n display: \"flex\",\n flexDirection: \"column\",\n rowGap: \"2.4rem\",\n alignItems: \"center\",\n }),\n table: css({ display: \"flex\", flexDirection: \"column\" }),\n row: css({\n display: \"grid\",\n borderTopWidth: \"1px\",\n borderTopStyle: \"solid\",\n borderTopColor: colorVars.gray2,\n padding: \"1.6rem 0\",\n columnGap: \"3.2rem\",\n alignItems: \"center\",\n gridTemplateColumns: \"1.2rem 18rem 10rem 12rem 1fr\",\n }),\n responseCount: css({\n display: \"flex\",\n alignItems: \"center\",\n columnGap: \".6rem\",\n }),\n header: css({ display: \"flex\", alignItems: \"center\", columnGap: \".6rem\" }),\n groupName: css({\n display: \"flex\",\n alignItems: \"center\",\n columnGap: \"1rem\",\n }),\n colorLegend: css({\n width: \"1.4rem\",\n flexShrink: 0,\n height: \"1.4rem\",\n borderRadius: \"50%\",\n }),\n wrapText: css({\n whiteSpace: \"pre-wrap\",\n textWrap: \"wrap\",\n }),\n percentageNumber: css({\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n }),\n topSurveyResponseRate: css({\n borderRadius: 8,\n backgroundColor: getColor(\"bluePrimary\", 0.1),\n display: \"flex\",\n padding: \"1.2rem\",\n columnGap: \"1.2rem\",\n alignItems: \"center\",\n }),\n};\ntype SubGroup = AuditWithResponses[\"survey_campaigns\"][0] & {\n name: string;\n value: string;\n color: string;\n};\nconst ResponseCounts = ({\n surveyCampaigns,\n topSurveyResponseRates,\n previousSurveyCampaigns,\n deprecatedPreviousSurveyResponses,\n}: ResponseCountsProps) => {\n const [expandedRows, setExpandedRows] = useState(\n RESPONSE_GROUPS.filter((group) => group.stakeholders.length > 1).map(\n ({ name }) => name\n )\n );\n const [visiblePieSegments, setVisiblePieSegments] = useState<\n Record\n >({\n Students: true,\n \"Aged 11+\": true,\n \"Aged 13+\": true,\n Primary: true,\n Staff: true,\n \"Teachers & Teaching Assistants\": true,\n \"Wider staff [not student facing]\": true,\n \"Support staff [student facing]\": true,\n \"Senior Leadership Team\": true,\n \"School Leaders (Governors / Trustees & SLT)\": true,\n \"Parents / guardians / carers\": true,\n \"Governors & Trustees\": true,\n });\n const [dataInPieChart, setDataInPieChart] = useState<\n {\n name: string;\n fill: string;\n value: number;\n }[]\n >([]);\n const [chooseTemplateModalData, setChooseTemplateModalData] = useState<{\n templateId: number;\n templateName: string;\n } | null>(null);\n const { width } = useWindowSize();\n\n const getPreviousResponseCount = (subGroup: SubGroup) => {\n if (deprecatedPreviousSurveyResponses) {\n return deprecatedPreviousSurveyResponses.filter(\n ({ stakeholder }) => stakeholder === subGroup.value\n ).length;\n } else if (previousSurveyCampaigns) {\n const previousSubGroup = previousSurveyCampaigns?.find(\n (campaign) =>\n campaign.survey_template.stakeholder.name === subGroup.value\n );\n return previousSubGroup\n ? getFinishedExecutions(\n previousSubGroup.survey_executions,\n previousSubGroup.DEPRECATED_survey_execution_count\n )\n : 0;\n }\n return 0;\n };\n\n const rows: Row[] = useMemo(() => {\n return RESPONSE_GROUPS.map((group) => {\n const subGroups: SubGroup[] = [];\n group.stakeholders.forEach((stakeholder) => {\n const stakeholderCampaign = surveyCampaigns.find(\n (campaign) =>\n campaign.survey_template.stakeholder.name === stakeholder.value\n );\n if (stakeholderCampaign) {\n subGroups.push({ ...stakeholderCampaign, ...stakeholder });\n }\n });\n const responseCount = subGroups.reduce(\n (acc, cur) =>\n acc +\n getFinishedExecutions(\n cur.survey_executions,\n cur.DEPRECATED_survey_execution_count\n ),\n 0\n );\n const previousResponseCount = subGroups.reduce(\n (acc, cur) => acc + getPreviousResponseCount(cur),\n 0\n );\n const expectedResponses =\n subGroups.reduce(\n (acc, cur) => acc + (cur.expected_responses_aggregated || 0),\n 0\n ) ||\n subGroups.reduce((acc, cur) => acc + (cur.expected_responses || 0), 0);\n return {\n ...group,\n subGroups,\n responseCount,\n previousResponseCount,\n expectedResponses,\n };\n });\n }, [\n surveyCampaigns,\n previousSurveyCampaigns,\n deprecatedPreviousSurveyResponses,\n ]);\n\n const totalResponses = useMemo(\n () => rows.reduce((acc, cur) => acc + cur.responseCount, 0),\n [rows]\n );\n const totalExpectedResponses = useMemo(\n () => rows.reduce((acc, cur) => acc + cur.expectedResponses, 0),\n [rows]\n );\n\n const totalPreviousResponses = useMemo(\n () => rows.reduce((acc, cur) => acc + cur.previousResponseCount, 0),\n [rows]\n );\n\n useEffect(() => {\n const dataToDisplay: { value: number; fill: string; name: string }[] = [];\n rows.forEach((row) => {\n if (expandedRows.includes(row.name)) {\n row.subGroups.forEach((subGroup) => {\n if (visiblePieSegments[subGroup.name]) {\n dataToDisplay.push({\n value: subGroup.survey_executions.length,\n name: subGroup.name,\n fill: subGroup.color,\n });\n }\n });\n } else {\n if (visiblePieSegments[row.name]) {\n dataToDisplay.push({\n value: row.responseCount,\n name: row.name,\n fill: row.color,\n });\n }\n }\n });\n setDataInPieChart(dataToDisplay);\n }, [rows, visiblePieSegments, expandedRows]);\n\n const toggleExpandedRow = (name: string) => {\n if (expandedRows.includes(name)) {\n return setExpandedRows((rows) => rows.filter((row) => row !== name));\n } else {\n return setExpandedRows((rows) => [...rows, name]);\n }\n };\n\n const toggleChildRowsVisible = (childRows: { name: string }[]) => {\n const allToggled = childRows.every(({ name }) => visiblePieSegments[name]);\n if (allToggled) {\n const update = childRows.reduce(\n (acc, cur) => ({ ...acc, [cur.name]: false }),\n {}\n );\n setVisiblePieSegments((data) => ({ ...data, ...update }));\n } else {\n const update = childRows.reduce(\n (acc, cur) => ({ ...acc, [cur.name]: true }),\n {}\n );\n setVisiblePieSegments((data) => ({ ...data, ...update }));\n }\n };\n return (\n \n setChooseTemplateModalData(null)}\n templateId={chooseTemplateModalData?.templateId}\n templateName={chooseTemplateModalData?.templateName}\n />\n
\n 1350 ? 260 : 160}\n height={width > 1350 ? 260 : 160}\n >\n 1350 ? 100 : 60}\n outerRadius={width > 1350 ? 130 : 80}\n >\n \n }\n >\n \n \n {totalPreviousResponses !== 0 && (\n \n )}\n
\n
\n
\n \n To view the percentage breakdown of a specific stakeholder\n group, simply untick every other stakeholder group. This will\n adjust the chart to only show the proportions of the selected\n stakeholder group.\n
\n
\n Click the down arrows next to students, staff and senior leaders\n to see response rate breakdown within each group.\n \n }\n />\n

Group

\n

Responses

\n

\n Percentage{\" \"}\n \n

\n {!topSurveyResponseRates && (\n

Email Reminder Templates

\n )}\n
\n {rows\n .filter((row) => row.subGroups.length > 0)\n .map((row) => {\n const percentage =\n (row.responseCount /\n (row.expectedResponses || row.responseCount || 1)) *\n 100;\n return (\n <>\n
\n visiblePieSegments[group.name]\n )\n : visiblePieSegments[row.name]\n }\n indeterminate={\n expandedRows.includes(row.name) &&\n row.subGroups.some(\n (group) => visiblePieSegments[group.name]\n ) &&\n row.subGroups.some(\n (group) => !visiblePieSegments[group.name]\n )\n }\n onChange={() =>\n expandedRows.includes(row.name)\n ? toggleChildRowsVisible(row.subGroups)\n : setVisiblePieSegments((data) => ({\n ...data,\n [row.name]: !data[row.name],\n }))\n }\n css={{ height: \"1.2rem\", margin: 0, width: \"1.2rem\" }}\n />\n 1 && { cursor: \"pointer\" },\n ]}\n onClick={() =>\n row.subGroups.length > 1 && toggleExpandedRow(row.name)\n }\n >\n {row.subGroups.length > 1 &&\n (expandedRows.includes(row.name) ? (\n \n ) : (\n \n ))}\n \n

\n
\n \n {row.responseCount}\n {row.previousResponseCount !== 0 && (\n \n )}\n

\n\n {row.expectedResponses ? (\n
\n \n\n \n {percentage.toFixed(0)}%\n

\n
\n ) : (\n \n )}\n\n {topSurveyResponseRates && (\n
\n \n

\n Highest {row.name} response across IL schools:{\" \"}\n \n {(\n Math.max(\n row.subGroups.reduce(\n (acc, cur) =>\n acc +\n (Number(\n topSurveyResponseRates.find(\n ({ stakeholder }) =>\n stakeholder === cur.value\n )?.top_survey_response_rate\n ) || 0),\n 0\n ) / row.subGroups.length,\n row.topResponseRate\n ) * 100\n ).toFixed(0)}\n %\n \n

\n
\n )}\n {row.subGroups.length <= 1 && !topSurveyResponseRates && (\n \n setChooseTemplateModalData({\n templateId: row.subGroups[0].id,\n templateName: row.name,\n })\n }\n icon={}\n />\n )}\n
\n {expandedRows.includes(row.name) &&\n row.subGroups.map((subGroup) => {\n const responseCount = getFinishedExecutions(\n subGroup.survey_executions,\n subGroup.DEPRECATED_survey_execution_count\n );\n const previousResponseCount =\n getPreviousResponseCount(subGroup);\n const percentage = (\n (responseCount / (subGroup.expected_responses || 1)) *\n 100\n ).toFixed(0);\n return (\n \n \n setVisiblePieSegments((data) => ({\n ...data,\n [subGroup.name]: !data[subGroup.name],\n }))\n }\n checked={visiblePieSegments[subGroup.name]}\n css={{ height: \"1.2rem\", margin: 0, width: \"1.2rem\" }}\n />\n
\n \n

\n
\n \n {responseCount}\n {previousResponseCount !== 0 && (\n \n )}\n

\n\n {subGroup.expected_responses ? (\n

\n {percentage}%\n

\n ) : (\n \n )}\n {topSurveyResponseRates ? (\n subGroup.hideComparison ? (\n <>\n ) : (\n
\n \n

\n Highest {subGroup.name} response across IL\n schools:{\" \"}\n \n {(\n ((topSurveyResponseRates.find(\n ({ stakeholder }) =>\n stakeholder === subGroup.value\n )?.top_survey_response_rate ||\n 0) as number) * 100\n ).toFixed(0)}\n %\n \n

\n
\n )\n ) : (\n \n setChooseTemplateModalData({\n templateName: subGroup.name,\n templateId: subGroup.id,\n })\n }\n icon={}\n />\n )}\n \n );\n })}\n \n );\n })}\n \n \n );\n};\n\nfunction CustomLabel(props: any) {\n const { cx, cy } = props.viewBox;\n return (\n <>\n \n \n Total responses\n \n \n \n \n {props.totalResponses} / {props.totalExpectedResponses}\n \n \n \n );\n}\nexport default ResponseCounts;\n"],"names":["getTermNumber","startMonth","dayjs","start_date","month","s","container","css","display","alignItems","columnGap","borderRadius","padding","AuditType","FULL","color","colorVars","bluePrimary","backgroundColor","getColor","PULSE","orange","BUNDLE","green","audit_AuditTypePill","auditType","param","emotion_react_jsx_runtime_browser_esm","BX","div","renderSurveyTypeIcon","tZ","p","surveyTypeNames","height","position","flexDirection","rowGap","row","justifyContent","deleteButton","error","border","marginLeft","cursor","extendButton","progress","borderWidth","borderStyle","borderColor","gray2","responses","breakdown","flexWrap","campaign","width","header","weeksLeft","arrow","fontSize","top","right","countdownMessage","getSurveyTitle","concat","format","audit_SurveyCard","id","end_date","setup_page","max_setup_page","insights_viewable_at","audit_type","setup_completed_at","survey_campaigns","refetchData","renderOpen","hasSurveysPermission","useRecoilValue","hasSurveysPermissionsSelector","open","setOpen","useState","deleteModalOpen","setDeleteModalOpen","deleteRequestState","setDeleteRequestState","state","chooseTemplateModalData","setChooseTemplateModalData","surveyTitle","useMemo","router","useRouter","setPageClicked","page","auditService","push","diff","overflow","DeleteConfirmationModal","onConfirm","tryCatch","requestState","title","content","data-cy","onClick","h3","AuditTypePill","name","Math","floor","HY","ArrowDropUpOutlined","ArrowDropDownOutlined","edit","button","DeleteOutlined","EditOutlined","span","a","href","process","target","textDecoration","Button","text","icon","FileCopy","survey_executions","length","NavLink","templateId","templateName","FileCopyOutlined","ChooseWhichTemplateModal","onClose","ResponseCounts","surveyCampaigns","isBefore","disabled","SurveyProgressDropdown","maxPage","setPage","customCss","margin","buttons","__webpack_exports__","Z","_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__","Modal","ModalDialog","role","textAlign","type","ButtonType","CANCEL","loading","DELETE","ErrorMessage","message","handleDownloadTemplate","PRIMARY","SECONDARY","ThreeStateHTMLCheckbox","indeterminate","inputProps","internalRef","useRef","useEffect","current","input","ref","RESPONSE_GROUPS","topResponseRate","stakeholders","value","Stakeholder","STUDENTS","hideComparison","STUDENTS_OLDER","STUDENTS_YOUNGER","FACULTY","FACULTY_WIDER","SUPPORT_STAFF","GOVERNORS","SLT","FAMILY","getProgressStyle","stroke","getFinishedExecutions","executions","DEPRECATED_survey_execution_count","filter","exec","finished_at","gridTemplateColumns","graph","table","borderTopWidth","borderTopStyle","borderTopColor","responseCount","groupName","colorLegend","flexShrink","wrapText","whiteSpace","textWrap","percentageNumber","left","transform","topSurveyResponseRate","CustomLabel","props","cx","cy","viewBox","x","y","fill","textSecondary","className","textAnchor","dominantBaseline","tspan","fontFamily","alignmentBaseline","textPrimary","totalResponses","totalExpectedResponses","insights_ResponseCounts","topSurveyResponseRates","previousSurveyCampaigns","deprecatedPreviousSurveyResponses","expandedRows","setExpandedRows","group","map","visiblePieSegments","setVisiblePieSegments","Students","Primary","Staff","dataInPieChart","setDataInPieChart","useWindowSize","getPreviousResponseCount","stakeholder","subGroup","previousSubGroup","find","survey_template","rows","subGroups","forEach","stakeholderCampaign","reduce","acc","cur","previousResponseCount","expectedResponses","expected_responses_aggregated","expected_responses","totalPreviousResponses","dataToDisplay","includes","toggleExpandedRow","toggleChildRowsVisible","childRows","every","update","data","PieChart","Pie","dataKey","nameKey","labelLine","innerRadius","outerRadius","Label","ComparisonIndicator","difference","numberWithPolarity","numberValue","borderTop","ExplainerBox","br","percentage","checked","some","onChange","ArrowDropUp","ArrowDropDown","dangerouslySetInnerHTML","__html","CircularProgress","size","variant","Number","toFixed","ShowChart","b","max","top_survey_response_rate","paddingLeft"],"sourceRoot":""}