@cuemath/leap 3.3.28 → 3.3.29-beta.0
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/assets/line-icons/icons/chevron-right.js.map +1 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js +9 -3
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -1
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js +8 -8
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
- package/dist/features/circle-games/sign-up/sign-up.js +6 -6
- package/dist/features/circle-games/sign-up/sign-up.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +17 -17
- package/dist/features/milestone/create/comps/goal-completion-date-selector/goal-completion-date-selector.js +6 -6
- package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js +2 -2
- package/dist/features/milestone/create/milestone-create-helpers.js +13 -7
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/parent-dashboard/api/cancel-subscription.js +9 -0
- package/dist/features/parent-dashboard/api/cancel-subscription.js.map +1 -0
- package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js +20 -0
- package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js.map +1 -0
- package/dist/features/parent-dashboard/comps/billing-information/billing-information.js +96 -0
- package/dist/features/parent-dashboard/comps/billing-information/billing-information.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/next-steps/next-steps-constants.js +1 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps-constants.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/next-steps/next-steps-styled.js +1 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps-styled.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/next-steps/next-steps.js +5 -5
- package/dist/features/parent-dashboard/comps/next-steps/next-steps.js.map +1 -0
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js +28 -22
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js.map +1 -1
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js +34 -0
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js.map +1 -0
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js +137 -0
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js.map +1 -0
- package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js +20 -0
- package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js.map +1 -0
- package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js +19 -0
- package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/session-status/session-status-styled.js +2 -2
- package/dist/features/parent-dashboard/comps/session-status/session-status-styled.js.map +1 -0
- package/dist/features/parent-dashboard/comps/session-status/session-status.js +124 -0
- package/dist/features/parent-dashboard/comps/session-status/session-status.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/session-summary/session-summary-constants.js +2 -2
- package/dist/features/parent-dashboard/comps/session-summary/session-summary-constants.js.map +1 -0
- package/dist/features/parent-dashboard/comps/session-summary/session-summary.js +53 -0
- package/dist/features/parent-dashboard/comps/session-summary/session-summary.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/session-summary/summary-card/summary-card-styled.js +1 -1
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card-styled.js.map +1 -0
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js +63 -0
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js.map +1 -0
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-constants.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/upcoming-sessions/upcoming-sessions-styled.js +1 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-styled.js.map +1 -0
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-types.js.map +1 -0
- package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/upcoming-sessions/upcoming-sessions.js +14 -14
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions.js.map +1 -0
- package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js +1 -1
- package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +48 -46
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js +21 -0
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js +85 -0
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js +23 -0
- package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js +55 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js +59 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js.map +1 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js +93 -0
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js.map +1 -0
- package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js +66 -0
- package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js.map +1 -0
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +3 -3
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +1 -1
- package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js +76 -0
- package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js.map +1 -0
- package/dist/features/parent-dashboard/parent-dashboard-constants.js +45 -4
- package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-types.js +3 -3
- package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-view.js +197 -173
- package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
- package/dist/features/student-details/class-details/class-details-utils.js +6 -6
- package/dist/features/student-username/add/add-student-username-constants.js +6 -0
- package/dist/features/student-username/add/add-student-username-constants.js.map +1 -0
- package/dist/features/student-username/add/add-student-username-helpers.js +6 -0
- package/dist/features/student-username/add/add-student-username-helpers.js.map +1 -0
- package/dist/features/student-username/add/add-student-username-styled.js +10 -0
- package/dist/features/student-username/add/add-student-username-styled.js.map +1 -0
- package/dist/features/student-username/add/add-student-username.js +78 -0
- package/dist/features/student-username/add/add-student-username.js.map +1 -0
- package/dist/features/student-username/add/api/update-username.js +9 -0
- package/dist/features/student-username/add/api/update-username.js.map +1 -0
- package/dist/features/student-username/add/api/username-availability.js +10 -0
- package/dist/features/student-username/add/api/username-availability.js.map +1 -0
- package/dist/features/student-username/add/hooks/use-check-username-availability.js +41 -0
- package/dist/features/student-username/add/hooks/use-check-username-availability.js.map +1 -0
- package/dist/features/trial-session/api/teacher-availability.js +9 -0
- package/dist/features/trial-session/api/teacher-availability.js.map +1 -0
- package/dist/features/trial-session/comps/class-preference/class-preference.js +61 -49
- package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
- package/dist/features/trial-session/comps/class-preference/helpers.js +28 -0
- package/dist/features/trial-session/comps/class-preference/helpers.js.map +1 -0
- package/dist/features/trial-session/comps/navigation-bar/index.js +24 -24
- package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals.js +51 -50
- package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
- package/dist/features/trial-session/comps/session-report/session-report.js +15 -15
- package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +39 -38
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js +5 -0
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js +96 -51
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +70 -63
- package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +43 -44
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -1
- package/dist/features/trial-session/comps/test-prep/test-prep.js +40 -39
- package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
- package/dist/features/trial-session/helper.js +69 -53
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/hooks/use-slide-config-update.js +49 -0
- package/dist/features/trial-session/hooks/use-slide-config-update.js.map +1 -0
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +150 -130
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/trial-session/trial-session-view.js +103 -112
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/features/utils/utils.js +1 -1
- package/dist/features/utils/utils.js.map +1 -1
- package/dist/index.d.ts +77 -77
- package/dist/index.js +310 -309
- package/package.json +2 -3
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-constants.js.map +0 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-styled.js.map +0 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js +0 -29
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js +0 -132
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js +0 -11
- package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js +0 -19
- package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-status/session-status-styled.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-status/session-status.js +0 -127
- package/dist/features/trial-session/comps/pla/session-status/session-status.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js +0 -53
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card-styled.js.map +0 -1
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js +0 -56
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js.map +0 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-constants.js.map +0 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-styled.js.map +0 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types.js.map +0 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js.map +0 -1
- package/dist/node_modules/date-fns/_lib/getRoundingMethod.js +0 -10
- package/dist/node_modules/date-fns/_lib/getRoundingMethod.js.map +0 -1
- package/dist/node_modules/date-fns/differenceInMilliseconds.js +0 -9
- package/dist/node_modules/date-fns/differenceInMilliseconds.js.map +0 -1
- package/dist/node_modules/date-fns/differenceInSeconds.js +0 -11
- package/dist/node_modules/date-fns/differenceInSeconds.js.map +0 -1
- /package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/upcoming-sessions/upcoming-sessions-constants.js +0 -0
- /package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/upcoming-sessions/upcoming-sessions-types.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"milestone-create-helpers.js","sources":["../../../../src/features/milestone/create/milestone-create-helpers.ts"],"sourcesContent":["import type IStudentSchool from '../../../types/models/school';\nimport type { ISectionOption } from '../../ui/section-list/section-list-types';\nimport type { TTestType } from '../types';\nimport type {\n ICurriculumStandards,\n IFormStep,\n IGoalCurriculumMap,\n IMileStoneFormFields,\n IMilestoneConfig,\n IMilestoneFormData,\n IPreferencesCurriculumMap,\n TCourseStream,\n TCurriculumStandardOption,\n TEnrollmentTypes,\n TFormStepNames,\n TGoalCategory,\n TMilestoneFormFlow,\n TPreferenceCategory,\n} from './milestone-create-types';\n\nimport { COUNTRY_MAP } from '../../../constants/country';\nimport {\n getIfGoalCurriculumStandardIsAccessible,\n getStudentEnrollmentSupported,\n} from './comps/chapters-selection-step/utils';\nimport {\n checkEnrollmentAvailable,\n getTestTypeBasedCategory,\n} from './comps/test-type-step/test-type-utils';\nimport { GOAL_EDIT_FLOWS } from './milestone-create-constants';\n\ninterface IGetCurrenStep {\n (\n formStep: IFormStep,\n milestoneFormData: IMilestoneFormData,\n flow: TMilestoneFormFlow,\n ): IFormStep | undefined;\n}\n\ninterface IClearNextFields {\n (\n formStep: IFormStep,\n milestoneFormData: IMilestoneFormData,\n currentStepName: TFormStepNames | undefined,\n shouldStartClearing: boolean,\n fieldsToClear: (keyof IMileStoneFormFields)[],\n ): IMilestoneFormData | undefined;\n}\n\n/**\n * Impure method that Removes specified fields from an object.\n *\n * @param obj The object from which fields are to be removed.\n * @param fieldsList An array of field names to be removed.\n */\nconst clearFields = (obj: Record<string, unknown>, fieldsList: string[]) => {\n fieldsList.forEach(field => {\n obj[field] = undefined;\n });\n};\n\nconst clearNextFields: IClearNextFields = (\n formStep,\n milestoneFormData,\n currentStepName,\n startClearing,\n fieldsToClear = [],\n) => {\n const { isLeafNode, next, reset } = formStep;\n const updatedFormData = { ...milestoneFormData };\n\n if (isLeafNode) {\n clearFields(updatedFormData, [...reset, ...fieldsToClear]);\n\n return updatedFormData;\n }\n\n if (next) {\n let shouldStartClearing = startClearing;\n let nextStep: IFormStep | undefined;\n\n next.every(step => {\n let conditionFulfilled = false;\n\n if (step.when !== undefined) {\n conditionFulfilled = step.when.every(([field, value]) => updatedFormData[field] === value);\n } else conditionFulfilled = true;\n\n if (conditionFulfilled) {\n if (shouldStartClearing) {\n step?.reset?.forEach(field => {\n fieldsToClear.push(field);\n });\n } else if (currentStepName === step?.name) {\n shouldStartClearing = true;\n }\n\n nextStep = step;\n\n return false;\n }\n\n return true;\n });\n if (nextStep) {\n return clearNextFields(\n nextStep,\n updatedFormData,\n currentStepName,\n shouldStartClearing,\n fieldsToClear,\n );\n }\n }\n\n return undefined;\n};\n\nconst getCurrenStep: IGetCurrenStep = (formStep, milestoneFormData, flow) => {\n const { isLeafNode, required, next } = formStep;\n\n if (isLeafNode) {\n return formStep;\n }\n\n const requiredFieldsFilled = required.every(field => milestoneFormData[field] !== undefined);\n\n if (GOAL_EDIT_FLOWS.includes(flow)) {\n const requiredFieldsReviewed = required.every(\n field => milestoneFormData.reviewed[field] === true,\n );\n\n if (!requiredFieldsFilled || !requiredFieldsReviewed) {\n return {\n ...formStep,\n next: undefined,\n };\n }\n } else {\n const requiredFieldsCommitted = required.every(\n field => milestoneFormData.committed[field] === true,\n );\n\n if (!requiredFieldsFilled || !requiredFieldsCommitted) {\n return {\n ...formStep,\n next: undefined,\n };\n }\n }\n\n if (next) {\n let nextStep: IFormStep | undefined;\n\n next.every(step => {\n if (step.when === undefined) {\n nextStep = step;\n\n return false;\n }\n\n const conditionFulfilled = step.when.every(\n ([field, value]) => milestoneFormData[field] === value,\n );\n\n if (conditionFulfilled) {\n nextStep = step;\n\n return false;\n }\n\n return true;\n });\n\n if (nextStep) {\n return getCurrenStep(nextStep, milestoneFormData, flow);\n }\n }\n\n return undefined;\n};\n\ntype TOptions = {\n id: string;\n label: string;\n description?: string;\n};\n\ninterface IGetSchoolTestsFromConfig {\n (config: IMilestoneConfig): TOptions[];\n}\n\nconst getSchoolTestsFromConfig: IGetSchoolTestsFromConfig = config => {\n return config.academic_events.reduce<TOptions[]>((acc, event) => {\n const { id, event_name: eventName, event_type: eventType } = event;\n\n if (eventType === 'SCHOOL_TEST') {\n acc.push({\n id,\n label: eventName,\n });\n }\n\n return acc;\n }, []);\n};\n\ninterface IGetCountriesFromConfig {\n (config: IMilestoneConfig): TOptions[];\n}\n\nconst computeCanIncludeCurrentGoal = (props: {\n currentGoalData: IGoalCurriculumMap;\n enrollmentType: TEnrollmentTypes;\n currentCountryCode?: string;\n grade?: string;\n selectedCategory?: string;\n isTeacherTrainingAccount?: boolean;\n}) => {\n const {\n currentGoalData,\n enrollmentType,\n currentCountryCode,\n grade,\n selectedCategory,\n isTeacherTrainingAccount,\n } = props;\n\n const {\n blocked_countries: blockedCountries,\n available_countries: availableCountries,\n available_grades: availableGrades,\n goal_category: goalCategory,\n available_enrollment_types: availableEnrollmentTypes,\n blocked_enrollment_types: blockedEnrollmentTypes,\n } = currentGoalData;\n\n const isStudentEnrollmentTypeSupported = getStudentEnrollmentSupported(\n blockedEnrollmentTypes,\n availableEnrollmentTypes,\n enrollmentType,\n );\n const isStudentRegionBlocked = blockedCountries.some(\n blockedCountry => blockedCountry === currentCountryCode,\n );\n const isStudentRegionAvailable =\n availableCountries.length > 0\n ? availableCountries.some(availableCountry => availableCountry === currentCountryCode)\n : true;\n\n const isCurrentGradeAvailable = availableGrades.some(gradeInfo => gradeInfo === grade);\n const isGoalCategoryAvailable = selectedCategory === goalCategory;\n\n if (isTeacherTrainingAccount) return isGoalCategoryAvailable && isCurrentGradeAvailable;\n\n return (\n isStudentEnrollmentTypeSupported &&\n !isStudentRegionBlocked &&\n isStudentRegionAvailable &&\n isCurrentGradeAvailable &&\n isGoalCategoryAvailable\n );\n};\n\ninterface IGetCurriculumStandardsFromConfig {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n countryCode: string;\n goalCategory: TGoalCategory;\n courseStream: TCourseStream;\n enrollmentType: TEnrollmentTypes;\n classRatio?: number;\n flow?: TMilestoneFormFlow | null;\n isTeacherTrainingAccount?: boolean;\n },\n ): TCurriculumStandardOption[];\n}\n\nconst getCurriculumStandardsFromConfig: IGetCurriculumStandardsFromConfig = (\n config,\n {\n grade,\n countryCode,\n goalCategory,\n courseStream,\n classRatio,\n enrollmentType,\n flow,\n isTeacherTrainingAccount,\n },\n) => {\n const { goal_curriculum_map: goals, curriculum_standards: curriculumStandards } = config;\n // check if atleast one goal present for the curriculum standard\n\n const filteredGoalCurriculumMap = goals.filter(item => {\n const isSameCourseStream = item.course_stream === courseStream;\n\n if (flow === 'CREATE') {\n return isSameCourseStream && item.is_live;\n }\n\n return isSameCourseStream;\n });\n\n const hasGoalForCurriculumStandards = (standard: ICurriculumStandards) =>\n filteredGoalCurriculumMap.some(goal => {\n // check goal category\n if (goal.goal_category !== goalCategory) return false;\n\n // check grade availability\n if (!goal.available_grades.includes(grade)) return false;\n\n // check goal curriculum standard\n // if goal_curriculum_standard is undefined then it's available for all standard\n if (goal.goal_curriculum_standard && goal.goal_curriculum_standard !== standard.code)\n return false;\n\n if (goalCategory === 'SCHOOL_SUCCESS' && !goal.goal_curriculum_standard) return false;\n\n if (isTeacherTrainingAccount) return true;\n\n if (\n classRatio &&\n goal.available_class_ratios.length > 0 &&\n !goal.available_class_ratios.includes(classRatio)\n )\n return false;\n\n // check country availability\n if (goal.available_countries.length > 0 && !goal.available_countries.includes(countryCode))\n return false;\n\n if (goal.available_countries.length === 0 && goal.blocked_countries.includes(countryCode))\n return false;\n\n return checkEnrollmentAvailable(goal, enrollmentType);\n });\n\n return curriculumStandards\n .filter(hasGoalForCurriculumStandards)\n .map(\n ({\n code,\n name,\n default_in_countries: defaultInCountries,\n recommended_in_countries: recommendedInCountries,\n }) => ({\n id: code,\n label: name,\n isDefault: defaultInCountries.includes(countryCode),\n isRecommended: recommendedInCountries.includes(countryCode),\n }),\n )\n .sort((a, b) => (a.label.toUpperCase() > b.label.toUpperCase() ? 1 : -1));\n};\n\ninterface IGetGoalsFromConfig {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n countryCode: string;\n goalCategory: TGoalCategory;\n curriculumStandard?: string;\n courseStream: TCourseStream;\n enrollmentType: TEnrollmentTypes;\n },\n ): TOptions[];\n}\n\nconst getGoalsFromConfig: IGetGoalsFromConfig = (config, options) => {\n const { goal_curriculum_map: goals } = config;\n const { grade, countryCode, goalCategory, curriculumStandard, courseStream, enrollmentType } =\n options;\n const filteredGoalCurriculumMap = goals.filter(item => item.course_stream === courseStream);\n\n const isEligibleGoal = (goal: IGoalCurriculumMap) => {\n if (goal.goal_category !== goalCategory) return false;\n\n if (curriculumStandard && goal.goal_curriculum_standard !== curriculumStandard) return false;\n\n if (goal.available_countries.length > 0 && !goal.available_countries.includes(countryCode))\n return false;\n\n if (goal.available_countries.length === 0 && goal.blocked_countries.includes(countryCode))\n return false;\n\n if (!goal.available_grades.includes(grade)) return false;\n\n if (!goal.is_live) return false;\n\n return checkEnrollmentAvailable(goal, enrollmentType);\n };\n\n return filteredGoalCurriculumMap\n ?.filter(isEligibleGoal)\n .map(({ goal_code: id, goal_name: label }) => ({\n id,\n label,\n }))\n .sort((a, b) => (a.label.toUpperCase() > b.label.toUpperCase() ? 1 : -1));\n};\n\nconst getGradesFromConfig: IGetCountriesFromConfig = config => {\n return config.grades.reduce<TOptions[]>((acc, grade) => {\n if (grade === '-1' || grade === '0') {\n acc.push({\n id: grade,\n label: grade === '-1' ? `Pre-K` : `KG`,\n });\n } else {\n acc.push({\n id: grade,\n label: `Grade ${grade}`,\n });\n }\n\n return acc;\n }, []);\n};\n\ninterface IGetPreferencesFromConfig {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n preferenceCategory: TPreferenceCategory;\n courseStream: TCourseStream;\n },\n ): TOptions[];\n}\n\nconst getPreferencesFromConfig: IGetPreferencesFromConfig = (config, options) => {\n const { preference_config: preferenceConfig } = config;\n\n const isEligiblePreferences = (preference: IPreferencesCurriculumMap) => {\n const { grade, courseStream, preferenceCategory } = options;\n\n if (preference.course_stream !== courseStream) return false;\n\n if (preference.preference_category !== preferenceCategory) return false;\n\n if (preference.preference_grades.length > 0 && !preference.preference_grades.includes(grade))\n return false;\n\n if (!preference.is_live) return false;\n\n return true;\n };\n\n return preferenceConfig\n ?.filter(isEligiblePreferences)\n .map(\n ({ preference_code: id, preference_name: label, preference_description: description }) => ({\n id,\n label,\n description,\n }),\n );\n};\n\ninterface IGetGradeBasedOnGoalAvailability {\n (\n config: IMilestoneConfig,\n selectedGoalCategory: string,\n courseStream: TCourseStream,\n enrollmentType: TEnrollmentTypes,\n isTeacherTrainingAccount?: boolean,\n ): TOptions[];\n}\n\n//* Grades where goals are available for selected goal category.\nconst getGradesBasedOnGoalAvailability: IGetGradeBasedOnGoalAvailability = (\n config,\n selectedGoalCategory,\n courseStream,\n enrollmentType,\n isTeacherTrainingAccount,\n) => {\n const { goal_curriculum_map: goals } = config;\n\n const grades = getGradesFromConfig(config);\n\n const gradeAvailableGoals = ({ id }: TOptions) => {\n return goals\n .filter(item => item.course_stream === courseStream && item.is_live)\n .some((goalData: IGoalCurriculumMap) => {\n const {\n available_grades: availableGrades,\n goal_category: goalCategory,\n available_enrollment_types: availableEnrollmentTypes,\n blocked_enrollment_types: blockedEnrollmentTypes,\n } = goalData;\n\n const isGoalCategoryAndGradeAvailable =\n goalCategory === selectedGoalCategory && availableGrades.includes(id);\n\n if (isTeacherTrainingAccount) return isGoalCategoryAndGradeAvailable;\n\n // check enrollment type availability\n if (\n availableEnrollmentTypes.length > 0 &&\n !availableEnrollmentTypes.includes(enrollmentType)\n )\n return false;\n\n if (\n availableEnrollmentTypes.length === 0 &&\n blockedEnrollmentTypes.includes(enrollmentType)\n )\n return false;\n\n //* Check for grade availability only for selected goal category\n return isGoalCategoryAndGradeAvailable;\n });\n };\n\n return grades.filter(gradeAvailableGoals);\n};\n\ninterface IGetMajorsFromConfigBasedOnBoardAndGrade {\n (\n config: IMilestoneConfig,\n boardCode: string,\n grade: string,\n courseStream: TCourseStream,\n enrollmentType: TEnrollmentTypes,\n isTeacherTrainingAccount?: boolean,\n ): TOptions[];\n}\n\nconst getMajorsFromConfigBasedOnBoardAndGrade: IGetMajorsFromConfigBasedOnBoardAndGrade = (\n config,\n boardCode,\n grade,\n courseStream,\n enrollmentType,\n isTeacherTrainingAccount,\n) => {\n //* We have US courses for grade 7 & above\n if (grade === 'KG' || Number(grade) < 7) return [];\n\n const { goal_curriculum_map: goalCurriculumMap } = config;\n const filterOnCourseStreamAndEnrollmentType = (goalData: IGoalCurriculumMap) => {\n if (goalData.course_stream !== courseStream && goalData.is_live) return false;\n\n return isTeacherTrainingAccount || checkEnrollmentAvailable(goalData, enrollmentType);\n };\n\n const majorsWithLabelId = goalCurriculumMap\n .filter(filterOnCourseStreamAndEnrollmentType)\n .reduce<TOptions[]>((acc, goalData) => {\n const {\n available_grades: availableGrades,\n goal_curriculum_standard: goalCurriculumStandard,\n program_name: programName,\n program_code: programCode,\n } = goalData;\n\n const isGradeAvailable = availableGrades.some(availableGrade => availableGrade === grade);\n const isBoardAvailable = goalCurriculumStandard === boardCode;\n\n if (isGradeAvailable && isBoardAvailable) {\n acc.push({\n id: programCode,\n label: programName,\n });\n }\n\n return acc;\n }, []);\n\n return majorsWithLabelId;\n};\n\nconst getRegionCodeBasedOnCountryCode = (countryCode: string) => {\n const regionCode = COUNTRY_MAP.find(countryInfo => countryInfo.country_code === countryCode)\n ?.region_code;\n\n return regionCode;\n};\n\nconst generateFormStateWithPrefilledSchoolData = (\n schoolData: IStudentSchool | undefined,\n board: string | undefined,\n grade: string | undefined,\n currentCountryCode: string | undefined,\n): IMilestoneFormData => {\n if (schoolData && grade) {\n const { country_code: countryCode, place_id: placeId } = schoolData;\n\n return {\n committed: {},\n reviewed: {},\n grade: grade,\n schoolInfo: {\n countryCode: countryCode,\n stateCode: '',\n id: placeId,\n },\n region: countryCode,\n board: board ?? undefined,\n };\n }\n\n const regionCode = currentCountryCode\n ? getRegionCodeBasedOnCountryCode(currentCountryCode)\n : undefined;\n\n if (grade) {\n return {\n committed: {},\n reviewed: {},\n grade: grade,\n region: regionCode,\n board: board ?? undefined,\n };\n }\n\n return {\n committed: {},\n reviewed: {},\n };\n};\n\nconst appendSchoolDataToFormState = (\n formData: IMilestoneFormData,\n schoolData: IStudentSchool | undefined,\n board: string | undefined,\n grade: string | undefined,\n): IMilestoneFormData => {\n if (schoolData && grade) {\n const { country_code: countryCode, place_id: placeId } = schoolData;\n\n return {\n ...formData,\n grade: grade,\n schoolInfo: {\n countryCode: countryCode,\n stateCode: '',\n id: placeId,\n },\n board: formData.board ?? board ?? undefined,\n };\n }\n\n return formData;\n};\n\nconst appendPrimaryGoalCategoryToFormState = (\n config: IMilestoneConfig,\n testType: TTestType,\n grade: string | undefined,\n courseStream: TCourseStream,\n enrollmentType: TEnrollmentTypes,\n board?: string | undefined,\n country?: string | undefined,\n flow?: TMilestoneFormFlow | null,\n isTeacherTrainingAccount?: boolean,\n) => {\n const { goal_curriculum_map: goalCurriculumMap } = config;\n const isSchoolSuccessCategory = testType === 'no-test';\n const selectedGoalCategory = getTestTypeBasedCategory(testType);\n\n //TODO: This needs to compensate the course selection for US curriculum grade 8 & above\n const primaryGoalCurriculum = goalCurriculumMap.find(goalInfo => {\n const isCurrentGoalAvailable = computeCanIncludeCurrentGoal({\n currentGoalData: goalInfo,\n grade,\n currentCountryCode: country,\n selectedCategory: selectedGoalCategory,\n enrollmentType,\n isTeacherTrainingAccount,\n });\n\n const { goal_curriculum_standard: goalCurriculumStandard, is_live: isLive } = goalInfo;\n\n const currentBoardAvailable = getIfGoalCurriculumStandardIsAccessible({\n goalCurriculumStandard,\n referenceStandard: board,\n });\n\n const isSameCourse = goalInfo.course_stream === courseStream;\n const canIncludeCurrentGoal = flow === 'CREATE' ? isLive : true;\n\n const isEligiblePrimaryGoal = canIncludeCurrentGoal && isSameCourse && isCurrentGoalAvailable;\n\n if (isTeacherTrainingAccount)\n return isEligiblePrimaryGoal && (isSchoolSuccessCategory ? currentBoardAvailable : true);\n\n if (isSchoolSuccessCategory) {\n return isEligiblePrimaryGoal && currentBoardAvailable;\n }\n\n return isEligiblePrimaryGoal;\n });\n\n return primaryGoalCurriculum;\n};\n\nconst getDefaultBoard = (data: ISectionOption<TCurriculumStandardOption>[]) => {\n let recommendedBoards: TCurriculumStandardOption[] = [];\n let otherBoards: TCurriculumStandardOption[] = [];\n\n // Iterate through the data categories\n for (const category of data) {\n if (category.title === 'recommended') {\n recommendedBoards = category.data;\n } else if (category.title === 'others') {\n otherBoards = category.data;\n }\n }\n\n // 1. Check if any recommended board has isDefault: true\n const defaultBoard = recommendedBoards.find(board => board.isDefault && board.isRecommended);\n\n if (defaultBoard) {\n return defaultBoard.id;\n }\n\n // 2. If no default, return the first recommended board\n if (recommendedBoards.length > 0) {\n return recommendedBoards[0]?.id;\n }\n\n // 3. If no recommended, return the first board from others\n if (otherBoards.length > 0) {\n return otherBoards[0]?.id;\n }\n\n // 4. Return null if no boards are found\n return undefined;\n};\n\nexport {\n appendSchoolDataToFormState,\n appendPrimaryGoalCategoryToFormState,\n clearNextFields,\n generateFormStateWithPrefilledSchoolData,\n getCurrenStep,\n getGradesFromConfig,\n getCurriculumStandardsFromConfig,\n getGoalsFromConfig,\n getGradesBasedOnGoalAvailability,\n getMajorsFromConfigBasedOnBoardAndGrade,\n getSchoolTestsFromConfig,\n getRegionCodeBasedOnCountryCode,\n getDefaultBoard,\n getPreferencesFromConfig,\n};\n"],"names":["clearFields","obj","fieldsList","field","clearNextFields","formStep","milestoneFormData","currentStepName","startClearing","fieldsToClear","isLeafNode","next","reset","updatedFormData","shouldStartClearing","nextStep","step","conditionFulfilled","value","_a","getCurrenStep","flow","required","requiredFieldsFilled","GOAL_EDIT_FLOWS","requiredFieldsReviewed","requiredFieldsCommitted","getSchoolTestsFromConfig","config","acc","event","id","eventName","eventType","computeCanIncludeCurrentGoal","props","currentGoalData","enrollmentType","currentCountryCode","grade","selectedCategory","isTeacherTrainingAccount","blockedCountries","availableCountries","availableGrades","goalCategory","availableEnrollmentTypes","blockedEnrollmentTypes","isStudentEnrollmentTypeSupported","getStudentEnrollmentSupported","isStudentRegionBlocked","blockedCountry","isStudentRegionAvailable","availableCountry","isCurrentGradeAvailable","gradeInfo","isGoalCategoryAvailable","getCurriculumStandardsFromConfig","countryCode","courseStream","classRatio","goals","curriculumStandards","filteredGoalCurriculumMap","item","isSameCourseStream","hasGoalForCurriculumStandards","standard","goal","checkEnrollmentAvailable","code","name","defaultInCountries","recommendedInCountries","a","b","getGoalsFromConfig","options","curriculumStandard","isEligibleGoal","label","getGradesFromConfig","getPreferencesFromConfig","preferenceConfig","isEligiblePreferences","preference","preferenceCategory","description","getGradesBasedOnGoalAvailability","selectedGoalCategory","grades","gradeAvailableGoals","goalData","isGoalCategoryAndGradeAvailable","getMajorsFromConfigBasedOnBoardAndGrade","boardCode","goalCurriculumMap","filterOnCourseStreamAndEnrollmentType","goalCurriculumStandard","programName","programCode","availableGrade","getRegionCodeBasedOnCountryCode","COUNTRY_MAP","countryInfo","generateFormStateWithPrefilledSchoolData","schoolData","board","placeId","regionCode","appendSchoolDataToFormState","formData","appendPrimaryGoalCategoryToFormState","testType","country","isSchoolSuccessCategory","getTestTypeBasedCategory","goalInfo","isCurrentGoalAvailable","isLive","currentBoardAvailable","getIfGoalCurriculumStandardIsAccessible","isSameCourse","isEligibl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qB,MAAWF,GAExEG,IAAwBC,EAAwC;AAAA,MACpE,wBAAAvB;AAAA,MACA,mBAAmBS;AAAA,IAAA,CACpB,GAEKe,IAAeL,EAAS,kBAAkB1D,GAG1CgE,KAFwBtG,MAAS,WAAWkG,IAAS,OAEJG,KAAgBJ;AAEnE,WAAA7E,IACKkF,MAA0BR,IAA0BK,IAAwB,MAEjFL,IACKQ,KAAyBH,IAG3BG;AAAA,EAAA,CACR;AAGH,GAEMC,IAAkB,CAACC,MAAsD;;AAC7E,MAAIC,IAAiD,CAAA,GACjDC,IAA2C,CAAA;AAG/C,aAAWC,KAAYH;AACjB,IAAAG,EAAS,UAAU,gBACrBF,IAAoBE,EAAS,OACpBA,EAAS,UAAU,aAC5BD,IAAcC,EAAS;AAK3B,QAAMC,IAAeH,EAAkB,KAAK,OAASnB,EAAM,aAAaA,EAAM,aAAa;AAE3F,MAAIsB;AACF,WAAOA,EAAa;AAIlB,MAAAH,EAAkB,SAAS;AACtB,YAAA3G,IAAA2G,EAAkB,CAAC,MAAnB,gBAAA3G,EAAsB;AAI3B,MAAA4G,EAAY,SAAS;AAChB,YAAAG,IAAAH,EAAY,CAAC,MAAb,gBAAAG,EAAgB;AAK3B;"}
|
|
1
|
+
{"version":3,"file":"milestone-create-helpers.js","sources":["../../../../src/features/milestone/create/milestone-create-helpers.ts"],"sourcesContent":["import type { LOTTIE } from '../../../assets/lottie/lottie';\nimport type IStudentSchool from '../../../types/models/school';\nimport type { ISectionOption } from '../../ui/section-list/section-list-types';\nimport type { TTestType } from '../types';\nimport type {\n ICurriculumStandards,\n IFormStep,\n IGoalCurriculumMap,\n IMileStoneFormFields,\n IMilestoneConfig,\n IMilestoneFormData,\n IPreferencesCurriculumMap,\n TCourseStream,\n TCurriculumStandardOption,\n TEnrollmentTypes,\n TFormStepNames,\n TGoalCategory,\n TMilestoneFormFlow,\n TPreferenceCategory,\n} from './milestone-create-types';\n\nimport { COUNTRY_MAP } from '../../../constants/country';\nimport {\n getIfGoalCurriculumStandardIsAccessible,\n getStudentEnrollmentSupported,\n} from './comps/chapters-selection-step/utils';\nimport {\n checkEnrollmentAvailable,\n getTestTypeBasedCategory,\n} from './comps/test-type-step/test-type-utils';\nimport { GOAL_EDIT_FLOWS } from './milestone-create-constants';\n\ninterface IGetCurrenStep {\n (\n formStep: IFormStep,\n milestoneFormData: IMilestoneFormData,\n flow: TMilestoneFormFlow,\n ): IFormStep | undefined;\n}\n\ninterface IClearNextFields {\n (\n formStep: IFormStep,\n milestoneFormData: IMilestoneFormData,\n currentStepName: TFormStepNames | undefined,\n shouldStartClearing: boolean,\n fieldsToClear: (keyof IMileStoneFormFields)[],\n ): IMilestoneFormData | undefined;\n}\n\n/**\n * Impure method that Removes specified fields from an object.\n *\n * @param obj The object from which fields are to be removed.\n * @param fieldsList An array of field names to be removed.\n */\nconst clearFields = (obj: Record<string, unknown>, fieldsList: string[]) => {\n fieldsList.forEach(field => {\n obj[field] = undefined;\n });\n};\n\nconst clearNextFields: IClearNextFields = (\n formStep,\n milestoneFormData,\n currentStepName,\n startClearing,\n fieldsToClear = [],\n) => {\n const { isLeafNode, next, reset } = formStep;\n const updatedFormData = { ...milestoneFormData };\n\n if (isLeafNode) {\n clearFields(updatedFormData, [...reset, ...fieldsToClear]);\n\n return updatedFormData;\n }\n\n if (next) {\n let shouldStartClearing = startClearing;\n let nextStep: IFormStep | undefined;\n\n next.every(step => {\n let conditionFulfilled = false;\n\n if (step.when !== undefined) {\n conditionFulfilled = step.when.every(([field, value]) => updatedFormData[field] === value);\n } else conditionFulfilled = true;\n\n if (conditionFulfilled) {\n if (shouldStartClearing) {\n step?.reset?.forEach(field => {\n fieldsToClear.push(field);\n });\n } else if (currentStepName === step?.name) {\n shouldStartClearing = true;\n }\n\n nextStep = step;\n\n return false;\n }\n\n return true;\n });\n if (nextStep) {\n return clearNextFields(\n nextStep,\n updatedFormData,\n currentStepName,\n shouldStartClearing,\n fieldsToClear,\n );\n }\n }\n\n return undefined;\n};\n\nconst getCurrenStep: IGetCurrenStep = (formStep, milestoneFormData, flow) => {\n const { isLeafNode, required, next } = formStep;\n\n if (isLeafNode) {\n return formStep;\n }\n\n const requiredFieldsFilled = required.every(field => milestoneFormData[field] !== undefined);\n\n if (GOAL_EDIT_FLOWS.includes(flow)) {\n const requiredFieldsReviewed = required.every(\n field => milestoneFormData.reviewed[field] === true,\n );\n\n if (!requiredFieldsFilled || !requiredFieldsReviewed) {\n return {\n ...formStep,\n next: undefined,\n };\n }\n } else {\n const requiredFieldsCommitted = required.every(\n field => milestoneFormData.committed[field] === true,\n );\n\n if (!requiredFieldsFilled || !requiredFieldsCommitted) {\n return {\n ...formStep,\n next: undefined,\n };\n }\n }\n\n if (next) {\n let nextStep: IFormStep | undefined;\n\n next.every(step => {\n if (step.when === undefined) {\n nextStep = step;\n\n return false;\n }\n\n const conditionFulfilled = step.when.every(\n ([field, value]) => milestoneFormData[field] === value,\n );\n\n if (conditionFulfilled) {\n nextStep = step;\n\n return false;\n }\n\n return true;\n });\n\n if (nextStep) {\n return getCurrenStep(nextStep, milestoneFormData, flow);\n }\n }\n\n return undefined;\n};\n\ntype TOptions = {\n id: string;\n label: string;\n description?: string;\n lottie?: keyof typeof LOTTIE;\n};\n\ninterface IGetSchoolTestsFromConfig {\n (config: IMilestoneConfig): TOptions[];\n}\n\nconst getSchoolTestsFromConfig: IGetSchoolTestsFromConfig = config => {\n return config.academic_events.reduce<TOptions[]>((acc, event) => {\n const { id, event_name: eventName, event_type: eventType } = event;\n\n if (eventType === 'SCHOOL_TEST') {\n acc.push({\n id,\n label: eventName,\n });\n }\n\n return acc;\n }, []);\n};\n\ninterface IGetCountriesFromConfig {\n (config: IMilestoneConfig): TOptions[];\n}\n\nconst computeCanIncludeCurrentGoal = (props: {\n currentGoalData: IGoalCurriculumMap;\n enrollmentType: TEnrollmentTypes;\n currentCountryCode?: string;\n grade?: string;\n selectedCategory?: string;\n isTeacherTrainingAccount?: boolean;\n}) => {\n const {\n currentGoalData,\n enrollmentType,\n currentCountryCode,\n grade,\n selectedCategory,\n isTeacherTrainingAccount,\n } = props;\n\n const {\n blocked_countries: blockedCountries,\n available_countries: availableCountries,\n available_grades: availableGrades,\n goal_category: goalCategory,\n available_enrollment_types: availableEnrollmentTypes,\n blocked_enrollment_types: blockedEnrollmentTypes,\n } = currentGoalData;\n\n const isStudentEnrollmentTypeSupported = getStudentEnrollmentSupported(\n blockedEnrollmentTypes,\n availableEnrollmentTypes,\n enrollmentType,\n );\n const isStudentRegionBlocked = blockedCountries.some(\n blockedCountry => blockedCountry === currentCountryCode,\n );\n const isStudentRegionAvailable =\n availableCountries.length > 0\n ? availableCountries.some(availableCountry => availableCountry === currentCountryCode)\n : true;\n\n const isCurrentGradeAvailable = availableGrades.some(gradeInfo => gradeInfo === grade);\n const isGoalCategoryAvailable = selectedCategory === goalCategory;\n\n if (isTeacherTrainingAccount) return isGoalCategoryAvailable && isCurrentGradeAvailable;\n\n return (\n isStudentEnrollmentTypeSupported &&\n !isStudentRegionBlocked &&\n isStudentRegionAvailable &&\n isCurrentGradeAvailable &&\n isGoalCategoryAvailable\n );\n};\n\ninterface IGetCurriculumStandardsFromConfig {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n countryCode: string;\n goalCategory: TGoalCategory;\n courseStream: TCourseStream;\n enrollmentType: TEnrollmentTypes;\n classRatio?: number;\n flow?: TMilestoneFormFlow | null;\n isTeacherTrainingAccount?: boolean;\n },\n ): TCurriculumStandardOption[];\n}\n\nconst getCurriculumStandardsFromConfig: IGetCurriculumStandardsFromConfig = (\n config,\n {\n grade,\n countryCode,\n goalCategory,\n courseStream,\n classRatio,\n enrollmentType,\n flow,\n isTeacherTrainingAccount,\n },\n) => {\n const { goal_curriculum_map: goals, curriculum_standards: curriculumStandards } = config;\n // check if atleast one goal present for the curriculum standard\n\n const filteredGoalCurriculumMap = goals.filter(item => {\n const isSameCourseStream = item.course_stream === courseStream;\n\n if (flow === 'CREATE') {\n return isSameCourseStream && item.is_live;\n }\n\n return isSameCourseStream;\n });\n\n const hasGoalForCurriculumStandards = (standard: ICurriculumStandards) =>\n filteredGoalCurriculumMap.some(goal => {\n // check goal category\n if (goal.goal_category !== goalCategory) return false;\n\n // check grade availability\n if (!goal.available_grades.includes(grade)) return false;\n\n // check goal curriculum standard\n // if goal_curriculum_standard is undefined then it's available for all standard\n if (goal.goal_curriculum_standard && goal.goal_curriculum_standard !== standard.code)\n return false;\n\n if (goalCategory === 'SCHOOL_SUCCESS' && !goal.goal_curriculum_standard) return false;\n\n if (isTeacherTrainingAccount) return true;\n\n if (\n classRatio &&\n goal.available_class_ratios.length > 0 &&\n !goal.available_class_ratios.includes(classRatio)\n )\n return false;\n\n // check country availability\n if (goal.available_countries.length > 0 && !goal.available_countries.includes(countryCode))\n return false;\n\n if (goal.available_countries.length === 0 && goal.blocked_countries.includes(countryCode))\n return false;\n\n return checkEnrollmentAvailable(goal, enrollmentType);\n });\n\n return curriculumStandards\n .filter(hasGoalForCurriculumStandards)\n .map(\n ({\n code,\n name,\n default_in_countries: defaultInCountries,\n recommended_in_countries: recommendedInCountries,\n }) => ({\n id: code,\n label: name,\n isDefault: defaultInCountries.includes(countryCode),\n isRecommended: recommendedInCountries.includes(countryCode),\n }),\n )\n .sort((a, b) => (a.label.toUpperCase() > b.label.toUpperCase() ? 1 : -1));\n};\n\ninterface IGetGoalsFromConfig {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n countryCode: string;\n goalCategory: TGoalCategory;\n curriculumStandard?: string;\n courseStream: TCourseStream;\n enrollmentType: TEnrollmentTypes;\n },\n ): TOptions[];\n}\n\nconst getGoalsFromConfig: IGetGoalsFromConfig = (config, options) => {\n const { goal_curriculum_map: goals } = config;\n const { grade, countryCode, goalCategory, curriculumStandard, courseStream, enrollmentType } =\n options;\n const filteredGoalCurriculumMap = goals.filter(item => item.course_stream === courseStream);\n\n const isEligibleGoal = (goal: IGoalCurriculumMap) => {\n if (goal.goal_category !== goalCategory) return false;\n\n if (curriculumStandard && goal.goal_curriculum_standard !== curriculumStandard) return false;\n\n if (goal.available_countries.length > 0 && !goal.available_countries.includes(countryCode))\n return false;\n\n if (goal.available_countries.length === 0 && goal.blocked_countries.includes(countryCode))\n return false;\n\n if (!goal.available_grades.includes(grade)) return false;\n\n if (!goal.is_live) return false;\n\n return checkEnrollmentAvailable(goal, enrollmentType);\n };\n\n return filteredGoalCurriculumMap\n ?.filter(isEligibleGoal)\n .map(({ goal_code: id, goal_name: label }) => ({\n id,\n label,\n }))\n .sort((a, b) => (a.label.toUpperCase() > b.label.toUpperCase() ? 1 : -1));\n};\n\nconst getGradesFromConfig: IGetCountriesFromConfig = config => {\n return config.grades.reduce<TOptions[]>((acc, grade) => {\n if (grade === '-1' || grade === '0') {\n acc.push({\n id: grade,\n label: grade === '-1' ? `Pre-K` : `KG`,\n });\n } else {\n acc.push({\n id: grade,\n label: `Grade ${grade}`,\n });\n }\n\n return acc;\n }, []);\n};\n\ninterface IGetPreferencesFromConfig {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n preferenceCategory: TPreferenceCategory;\n courseStream: TCourseStream;\n },\n ): TOptions[];\n}\n\nconst getPreferencesFromConfig: IGetPreferencesFromConfig = (config, options) => {\n const { preference_config: preferenceConfig } = config;\n\n const isEligiblePreferences = (preference: IPreferencesCurriculumMap) => {\n const { grade, courseStream, preferenceCategory } = options;\n\n if (preference.course_stream !== courseStream) return false;\n\n if (preference.preference_category !== preferenceCategory) return false;\n\n if (preference.preference_grades.length > 0 && !preference.preference_grades.includes(grade))\n return false;\n\n if (!preference.is_live) return false;\n\n return true;\n };\n\n return preferenceConfig\n ?.filter(isEligiblePreferences)\n .map(\n ({\n preference_code: id,\n preference_name: label,\n preference_description: description,\n lottie_key: lottie,\n }) => ({\n id,\n label,\n description,\n lottie: lottie as keyof typeof LOTTIE,\n }),\n );\n};\n\ninterface IGetGradeBasedOnGoalAvailability {\n (\n config: IMilestoneConfig,\n selectedGoalCategory: string,\n courseStream: TCourseStream,\n enrollmentType: TEnrollmentTypes,\n isTeacherTrainingAccount?: boolean,\n ): TOptions[];\n}\n\n//* Grades where goals are available for selected goal category.\nconst getGradesBasedOnGoalAvailability: IGetGradeBasedOnGoalAvailability = (\n config,\n selectedGoalCategory,\n courseStream,\n enrollmentType,\n isTeacherTrainingAccount,\n) => {\n const { goal_curriculum_map: goals } = config;\n\n const grades = getGradesFromConfig(config);\n\n const gradeAvailableGoals = ({ id }: TOptions) => {\n return goals\n .filter(item => item.course_stream === courseStream && item.is_live)\n .some((goalData: IGoalCurriculumMap) => {\n const {\n available_grades: availableGrades,\n goal_category: goalCategory,\n available_enrollment_types: availableEnrollmentTypes,\n blocked_enrollment_types: blockedEnrollmentTypes,\n } = goalData;\n\n const isGoalCategoryAndGradeAvailable =\n goalCategory === selectedGoalCategory && availableGrades.includes(id);\n\n if (isTeacherTrainingAccount) return isGoalCategoryAndGradeAvailable;\n\n // check enrollment type availability\n if (\n availableEnrollmentTypes.length > 0 &&\n !availableEnrollmentTypes.includes(enrollmentType)\n )\n return false;\n\n if (\n availableEnrollmentTypes.length === 0 &&\n blockedEnrollmentTypes.includes(enrollmentType)\n )\n return false;\n\n //* Check for grade availability only for selected goal category\n return isGoalCategoryAndGradeAvailable;\n });\n };\n\n return grades.filter(gradeAvailableGoals);\n};\n\ninterface IGetMajorsFromConfigBasedOnBoardAndGrade {\n (\n config: IMilestoneConfig,\n boardCode: string,\n grade: string,\n courseStream: TCourseStream,\n enrollmentType: TEnrollmentTypes,\n isTeacherTrainingAccount?: boolean,\n ): TOptions[];\n}\n\nconst getMajorsFromConfigBasedOnBoardAndGrade: IGetMajorsFromConfigBasedOnBoardAndGrade = (\n config,\n boardCode,\n grade,\n courseStream,\n enrollmentType,\n isTeacherTrainingAccount,\n) => {\n //* We have US courses for grade 7 & above\n if (grade === 'KG' || Number(grade) < 7) return [];\n\n const { goal_curriculum_map: goalCurriculumMap } = config;\n const filterOnCourseStreamAndEnrollmentType = (goalData: IGoalCurriculumMap) => {\n if (goalData.course_stream !== courseStream && goalData.is_live) return false;\n\n return isTeacherTrainingAccount || checkEnrollmentAvailable(goalData, enrollmentType);\n };\n\n const majorsWithLabelId = goalCurriculumMap\n .filter(filterOnCourseStreamAndEnrollmentType)\n .reduce<TOptions[]>((acc, goalData) => {\n const {\n available_grades: availableGrades,\n goal_curriculum_standard: goalCurriculumStandard,\n program_name: programName,\n program_code: programCode,\n } = goalData;\n\n const isGradeAvailable = availableGrades.some(availableGrade => availableGrade === grade);\n const isBoardAvailable = goalCurriculumStandard === boardCode;\n\n if (isGradeAvailable && isBoardAvailable) {\n acc.push({\n id: programCode,\n label: programName,\n });\n }\n\n return acc;\n }, []);\n\n return majorsWithLabelId;\n};\n\nconst getRegionCodeBasedOnCountryCode = (countryCode: string) => {\n const regionCode = COUNTRY_MAP.find(countryInfo => countryInfo.country_code === countryCode)\n ?.region_code;\n\n return regionCode;\n};\n\nconst generateFormStateWithPrefilledSchoolData = (\n schoolData: IStudentSchool | undefined,\n board: string | undefined,\n grade: string | undefined,\n currentCountryCode: string | undefined,\n): IMilestoneFormData => {\n if (schoolData && grade) {\n const { country_code: countryCode, place_id: placeId } = schoolData;\n\n return {\n committed: {},\n reviewed: {},\n grade: grade,\n schoolInfo: {\n countryCode: countryCode,\n stateCode: '',\n id: placeId,\n },\n region: countryCode,\n board: board ?? undefined,\n };\n }\n\n const regionCode = currentCountryCode\n ? getRegionCodeBasedOnCountryCode(currentCountryCode)\n : undefined;\n\n if (grade) {\n return {\n committed: {},\n reviewed: {},\n grade: grade,\n region: regionCode,\n board: board ?? undefined,\n };\n }\n\n return {\n committed: {},\n reviewed: {},\n };\n};\n\nconst appendSchoolDataToFormState = (\n formData: IMilestoneFormData,\n schoolData: IStudentSchool | undefined,\n board: string | undefined,\n grade: string | undefined,\n): IMilestoneFormData => {\n if (schoolData && grade) {\n const { country_code: countryCode, place_id: placeId } = schoolData;\n\n return {\n ...formData,\n grade: grade,\n schoolInfo: {\n countryCode: countryCode,\n stateCode: '',\n id: placeId,\n },\n board: formData.board ?? board ?? undefined,\n };\n }\n\n return formData;\n};\n\nconst appendPrimaryGoalCategoryToFormState = (\n config: IMilestoneConfig,\n testType: TTestType,\n grade: string | undefined,\n courseStream: TCourseStream,\n enrollmentType: TEnrollmentTypes,\n board?: string | undefined,\n country?: string | undefined,\n flow?: TMilestoneFormFlow | null,\n isTeacherTrainingAccount?: boolean,\n) => {\n const { goal_curriculum_map: goalCurriculumMap } = config;\n const isSchoolSuccessCategory = testType === 'no-test';\n const selectedGoalCategory = getTestTypeBasedCategory(testType);\n\n //TODO: This needs to compensate the course selection for US curriculum grade 8 & above\n const primaryGoalCurriculum = goalCurriculumMap.find(goalInfo => {\n const isCurrentGoalAvailable = computeCanIncludeCurrentGoal({\n currentGoalData: goalInfo,\n grade,\n currentCountryCode: country,\n selectedCategory: selectedGoalCategory,\n enrollmentType,\n isTeacherTrainingAccount,\n });\n\n const { goal_curriculum_standard: goalCurriculumStandard, is_live: isLive } = goalInfo;\n\n const currentBoardAvailable = getIfGoalCurriculumStandardIsAccessible({\n goalCurriculumStandard,\n referenceStandard: board,\n });\n\n const isSameCourse = goalInfo.course_stream === courseStream;\n const canIncludeCurrentGoal = flow === 'CREATE' ? isLive : true;\n\n const isEligiblePrimaryGoal = canIncludeCurrentGoal && isSameCourse && isCurrentGoalAvailable;\n\n if (isTeacherTrainingAccount)\n return isEligiblePrimaryGoal && (isSchoolSuccessCategory ? currentBoardAvailable : true);\n\n if (isSchoolSuccessCategory) {\n return isEligiblePrimaryGoal && currentBoardAvailable;\n }\n\n return isEligiblePrimaryGoal;\n });\n\n return primaryGoalCurriculum;\n};\n\nconst getDefaultBoard = (data: ISectionOption<TCurriculumStandardOption>[]) => {\n let recommendedBoards: TCurriculumStandardOption[] = [];\n let otherBoards: TCurriculumStandardOption[] = [];\n\n // Iterate through the data categories\n for (const category of data) {\n if (category.title === 'recommended') {\n recommendedBoards = category.data;\n } else if (category.title === 'others') {\n otherBoards = category.data;\n }\n }\n\n // 1. Check if any recommended board has isDefault: true\n const defaultBoard = recommendedBoards.find(board => board.isDefault && board.isRecommended);\n\n if (defaultBoard) {\n return defaultBoard.id;\n }\n\n // 2. If no default, return the first recommended board\n if (recommendedBoards.length > 0) {\n return recommendedBoards[0]?.id;\n }\n\n // 3. If no recommended, return the first board from others\n if (otherBoards.length > 0) {\n return otherBoards[0]?.id;\n }\n\n // 4. Return null if no boards are found\n return undefined;\n};\n\nexport {\n appendSchoolDataToFormState,\n appendPrimaryGoalCategoryToFormState,\n clearNextFields,\n generateFormStateWithPrefilledSchoolData,\n getCurrenStep,\n getGradesFromConfig,\n getCurriculumStandardsFromConfig,\n getGoalsFromConfig,\n getGradesBasedOnGoalAvailability,\n getMajorsFromConfigBasedOnBoardAndGrade,\n getSchoolTestsFromConfig,\n getRegionCodeBasedOnCountryCode,\n getDefaultBoard,\n getPreferencesFromConfig,\n};\n"],"names":["clearFields","obj","fieldsList","field","clearNextFields","formStep","milestoneFormData","currentStepName","startClearing","fieldsToClear","isLeafNode","next","reset","updatedFormData","shouldStartClearing","nextStep","step","conditionFulfilled","value","_a","getCurrenStep","flow","required","requiredFieldsFilled","GOAL_EDIT_FLOWS","requiredFieldsReviewed","requiredFieldsCommitted","getSchoolTestsFromConfig","config","acc","event","id","eventName","eventType","computeCanIncludeCurrentGoal","props","currentGoalData","enrollmentType","currentCountryCode","grade","selectedCategory","isTeacherTrainingAccount","blockedCountries","availableCountries","availableGrades","goalCategory","availableEnrollmentTypes","blockedEnrollmentTypes","isStudentEnrollmentTypeSupported","getStudentEnrollmentSupported","isStudentRegionBlocked","blockedCountry","isStudentRegionAvailable","availableCountry","isCurrentGradeAvailable","gradeInfo","isGoalCategoryAvailable","getCurriculumStandardsFromConfig","countryCode","courseStream","classRatio","goals","curriculumStandards","filteredGoalCurriculumMap","item","isSameCourseStream","hasGoalForCurriculumStandards","standard","goal","checkEnrollmentAvailable","code","name","defaultInCountries","recommendedInCountries","a","b","getGoalsFromConfig","options","curriculumStandard","isEligibleGoal","label","getGradesFromConfig","getPreferencesFromConfig","preferenceConfig","isEligiblePreferences","preference","preferenceCategory","description","lottie","getGradesBasedOnGoalAvailability","selectedGoalCategory","grades","gradeAvailableGoals","goalData","isGoalCategoryAndGradeAvailable","getMajorsFromConfigBasedOnBoardAndGrade","boardCode","goalCurriculumMap","filterOnCourseStreamAndEnrollmentType","goalCurriculumStandard","programName","programCode","availableGrade","getRegionCodeBasedOnCountryCode","COUNTRY_MAP","countryInfo","generateFormStateWithPrefilledSchoolData","schoolData","board","placeId","regionCode","appendSchoolDataToFormState","formData","appendPrimaryGoalCategoryToFormState","testType","country","isSchoolSuccessCategory","getTestTypeBasedCategory","goalInfo","isCurrentGoalAvailable","isLive","currentBoardAvailable","getIfGoalCurriculumStandardIsAccessible","isSameCourse","isEligiblePrimaryGoal","getDefaultBoard","data","recommendedBoards","otherBoards","category","defaultBoard","_b"],"mappings":";;;;AAwDA,MAAMA,IAAc,CAACC,GAA8BC,MAAyB;AAC1E,EAAAA,EAAW,QAAQ,CAASC,MAAA;AAC1B,IAAAF,EAAIE,CAAK,IAAI;AAAA,EAAA,CACd;AACH,GAEMC,IAAoC,CACxCC,GACAC,GACAC,GACAC,GACAC,IAAgB,OACb;AACH,QAAM,EAAE,YAAAC,GAAY,MAAAC,GAAM,OAAAC,EAAA,IAAUP,GAC9BQ,IAAkB,EAAE,GAAGP;AAE7B,MAAII;AACF,WAAAV,EAAYa,GAAiB,CAAC,GAAGD,GAAO,GAAGH,CAAa,CAAC,GAElDI;AAGT,MAAIF,GAAM;AACR,QAAIG,IAAsBN,GACtBO;AAyBJ,QAvBAJ,EAAK,MAAM,CAAQK,MAAA;;AACjB,UAAIC,IAAqB;AAMzB,aAJID,EAAK,SAAS,SACKC,IAAAD,EAAK,KAAK,MAAM,CAAC,CAACb,GAAOe,CAAK,MAAML,EAAgBV,CAAK,MAAMe,CAAK,IAC/DD,IAAA,IAExBA,KACEH,KACIK,IAAAH,KAAA,gBAAAA,EAA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3B,MAAA6G,EAAY,SAAS;AAChB,YAAAG,IAAAH,EAAY,CAAC,MAAb,gBAAAG,EAAgB;AAK3B;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createPatchAPI as c } from "@cuemath/rest-api";
|
|
2
|
+
import { BASE_URL_V1 as e } from "../../../constants/api.js";
|
|
3
|
+
const { usePatch: s } = c({
|
|
4
|
+
getURL: (t) => `${e}/students/${t}/cancel-subscription`
|
|
5
|
+
});
|
|
6
|
+
export {
|
|
7
|
+
s as useCancelSubscriptionPatch
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=cancel-subscription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel-subscription.js","sources":["../../../../src/features/parent-dashboard/api/cancel-subscription.ts"],"sourcesContent":["import { createPatchAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V1 } from '../../../constants/api';\n\nconst { usePatch: useCancelSubscriptionPatch } = createPatchAPI({\n getURL: studentId => `${BASE_URL_V1}/students/${studentId}/cancel-subscription`,\n});\n\nexport { useCancelSubscriptionPatch };\n"],"names":["useCancelSubscriptionPatch","createPatchAPI","studentId","BASE_URL_V1"],"mappings":";;AAIA,MAAM,EAAE,UAAUA,EAA2B,IAAIC,EAAe;AAAA,EAC9D,QAAQ,CAAAC,MAAa,GAAGC,CAAW,aAAaD,CAAS;AAC3D,CAAC;"}
|
package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import o from "styled-components";
|
|
2
|
+
import t from "../../../../assets/line-icons/icons/more-vertical.js";
|
|
3
|
+
import e from "../../../ui/layout/flex-view.js";
|
|
4
|
+
const c = o(t)(
|
|
5
|
+
({ theme: r }) => `
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
path {
|
|
8
|
+
stroke: ${r.colors.WHITE};
|
|
9
|
+
}
|
|
10
|
+
`
|
|
11
|
+
), l = o(e)`
|
|
12
|
+
top: 0;
|
|
13
|
+
right: 32px;
|
|
14
|
+
z-index: 100;
|
|
15
|
+
`;
|
|
16
|
+
export {
|
|
17
|
+
l as DropdownMenu,
|
|
18
|
+
c as StyledVerticalMenu
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=billing-information-styled.js.map
|
package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-information-styled.js","sources":["../../../../../src/features/parent-dashboard/comps/billing-information/billing-information-styled.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport MoreVerticalIcon from '../../../../assets/line-icons/icons/more-vertical';\nimport FlexView from '../../../ui/layout/flex-view';\n\nconst StyledVerticalMenu = styled(MoreVerticalIcon)(\n ({ theme }) => `\n cursor: pointer;\n path {\n stroke: ${theme.colors.WHITE};\n }\n `,\n);\n\nconst DropdownMenu = styled(FlexView)`\n top: 0;\n right: 32px;\n z-index: 100;\n`;\n\nexport { StyledVerticalMenu, DropdownMenu };\n"],"names":["StyledVerticalMenu","styled","MoreVerticalIcon","theme","DropdownMenu","FlexView"],"mappings":";;;AAKM,MAAAA,IAAqBC,EAAOC,CAAgB;AAAA,EAChD,CAAC,EAAE,OAAAC,EAAA,MAAY;AAAA;AAAA;AAAA,gBAGDA,EAAM,OAAO,KAAK;AAAA;AAAA;AAGlC,GAEMC,IAAeH,EAAOI,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { memo as E, useState as k, useRef as x, useCallback as m, useEffect as w } from "react";
|
|
3
|
+
import { useTheme as y } from "styled-components";
|
|
4
|
+
import l from "../../../ui/layout/flex-view.js";
|
|
5
|
+
import L from "../../../ui/separator/separator.js";
|
|
6
|
+
import o from "../../../ui/text/text.js";
|
|
7
|
+
import { EDeviceType as M } from "../../../ui/theme/constants.js";
|
|
8
|
+
import { StyledVerticalMenu as _, DropdownMenu as I } from "./billing-information-styled.js";
|
|
9
|
+
const R = E(
|
|
10
|
+
({ billingDetails: $, onViewPaymentMethod: d, onCancelSubscription: u }) => {
|
|
11
|
+
const { device: f } = y(), n = f <= M.MOBILE, [c, t] = k(!1), s = x(null), { amount: p, cycle_frequency: h, next_due_date: b } = $, g = () => t((i) => !i), a = m(() => {
|
|
12
|
+
t(!1), d();
|
|
13
|
+
}, [d]), C = m(() => {
|
|
14
|
+
t(!1), u();
|
|
15
|
+
}, [u]);
|
|
16
|
+
return w(() => {
|
|
17
|
+
function i(A) {
|
|
18
|
+
s.current && !s.current.contains(A.target) && t(!1);
|
|
19
|
+
}
|
|
20
|
+
return c && document.addEventListener("mousedown", i), () => {
|
|
21
|
+
document.removeEventListener("mousedown", i);
|
|
22
|
+
};
|
|
23
|
+
}, [c]), /* @__PURE__ */ e(l, { children: [
|
|
24
|
+
/* @__PURE__ */ r(o, { $renderAs: "ah4-bold", $renderOnMobileAs: "ab1-bold", $color: "WHITE", children: "Billing Information" }),
|
|
25
|
+
/* @__PURE__ */ r(L, { height: 20 }),
|
|
26
|
+
/* @__PURE__ */ e(
|
|
27
|
+
l,
|
|
28
|
+
{
|
|
29
|
+
$flexDirection: "row",
|
|
30
|
+
$justifyContent: "space-between",
|
|
31
|
+
$alignItems: "center",
|
|
32
|
+
$gap: n ? 16 : 24,
|
|
33
|
+
$gutter: n ? 16 : 24,
|
|
34
|
+
$background: "BLACK_2",
|
|
35
|
+
$borderColor: n ? "WHITE" : "BLACK_5",
|
|
36
|
+
onClick: n ? a : void 0,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ e(l, { $flexGap: 12, children: [
|
|
39
|
+
/* @__PURE__ */ e(o, { $renderAs: "ac3-black", $renderOnMobileAs: "ac4-black", $color: "PURPLE_4", children: [
|
|
40
|
+
h,
|
|
41
|
+
" PLAN"
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ e(o, { $renderAs: n ? "ub3" : "ub2", $color: "WHITE", children: [
|
|
44
|
+
"$",
|
|
45
|
+
p,
|
|
46
|
+
" payment due on ",
|
|
47
|
+
b
|
|
48
|
+
] })
|
|
49
|
+
] }),
|
|
50
|
+
n ? null : /* @__PURE__ */ e(l, { $position: "relative", ref: s, children: [
|
|
51
|
+
/* @__PURE__ */ r(_, { height: 24, width: 24, onClick: g }),
|
|
52
|
+
c && /* @__PURE__ */ e(
|
|
53
|
+
I,
|
|
54
|
+
{
|
|
55
|
+
$width: 180,
|
|
56
|
+
$position: "absolute",
|
|
57
|
+
$background: "BLACK_4",
|
|
58
|
+
$borderColor: "BLACK_5",
|
|
59
|
+
$gapX: 1,
|
|
60
|
+
$gutterX: 1,
|
|
61
|
+
$flexGap: 8,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ r(
|
|
64
|
+
o,
|
|
65
|
+
{
|
|
66
|
+
$renderAs: "ub3",
|
|
67
|
+
$cursor: "pointer",
|
|
68
|
+
$color: "WHITE",
|
|
69
|
+
onClick: a,
|
|
70
|
+
children: "View Payment Method"
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ r(
|
|
74
|
+
o,
|
|
75
|
+
{
|
|
76
|
+
$renderAs: "ub3",
|
|
77
|
+
$cursor: "pointer",
|
|
78
|
+
$color: "ORANGE_5",
|
|
79
|
+
onClick: C,
|
|
80
|
+
children: "Cancel Subscription"
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] });
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
export {
|
|
94
|
+
R as default
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=billing-information.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-information.js","sources":["../../../../../src/features/parent-dashboard/comps/billing-information/billing-information.tsx"],"sourcesContent":["import type { FC } from 'react';\n\nimport { memo, useState, useRef, useEffect, useCallback } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport * as Styled from './billing-information-styled';\nimport { type IBillingInformationProps } from './billing-information-types';\n\nconst BillingInformation: FC<IBillingInformationProps> = memo(\n ({ billingDetails, onViewPaymentMethod, onCancelSubscription }) => {\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n const [menuOpen, setMenuOpen] = useState(false);\n const menuRef = useRef<HTMLDivElement>(null);\n\n const { amount, cycle_frequency: cycleFrequency, next_due_date: nextDueDate } = billingDetails;\n\n const toggleMenu = () => setMenuOpen(v => !v);\n\n const handleViewPaymentMethod = useCallback(() => {\n setMenuOpen(false);\n onViewPaymentMethod();\n }, [onViewPaymentMethod]);\n\n const handleCancelSubscription = useCallback(() => {\n setMenuOpen(false);\n onCancelSubscription();\n }, [onCancelSubscription]);\n\n // Close menu on outside click\n useEffect(() => {\n function handleClickOutside(event: MouseEvent) {\n if (menuRef.current && !menuRef.current.contains(event.target as Node)) {\n setMenuOpen(false);\n }\n }\n if (menuOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n }, [menuOpen]);\n\n return (\n <FlexView>\n <Text $renderAs=\"ah4-bold\" $renderOnMobileAs=\"ab1-bold\" $color=\"WHITE\">\n Billing Information\n </Text>\n <Separator height={20} />\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $gap={isMobile ? 16 : 24}\n $gutter={isMobile ? 16 : 24}\n $background=\"BLACK_2\"\n $borderColor={isMobile ? 'WHITE' : 'BLACK_5'}\n onClick={isMobile ? handleViewPaymentMethod : undefined}\n >\n <FlexView $flexGap={12}>\n <Text $renderAs=\"ac3-black\" $renderOnMobileAs=\"ac4-black\" $color=\"PURPLE_4\">\n {cycleFrequency} PLAN\n </Text>\n <Text $renderAs={isMobile ? 'ub3' : 'ub2'} $color=\"WHITE\">\n ${amount} payment due on {nextDueDate}\n </Text>\n </FlexView>\n\n {isMobile ? null : (\n <FlexView $position=\"relative\" ref={menuRef}>\n <Styled.StyledVerticalMenu height={24} width={24} onClick={toggleMenu} />\n {menuOpen && (\n <Styled.DropdownMenu\n $width={180}\n $position=\"absolute\"\n $background=\"BLACK_4\"\n $borderColor=\"BLACK_5\"\n $gapX={1}\n $gutterX={1}\n $flexGap={8}\n >\n <Text\n $renderAs=\"ub3\"\n $cursor=\"pointer\"\n $color=\"WHITE\"\n onClick={handleViewPaymentMethod}\n >\n View Payment Method\n </Text>\n <Text\n $renderAs=\"ub3\"\n $cursor=\"pointer\"\n $color=\"ORANGE_5\"\n onClick={handleCancelSubscription}\n >\n Cancel Subscription\n </Text>\n </Styled.DropdownMenu>\n )}\n </FlexView>\n )}\n </FlexView>\n </FlexView>\n );\n },\n);\n\nexport default BillingInformation;\n"],"names":["BillingInformation","memo","billingDetails","onViewPaymentMethod","onCancelSubscription","device","useTheme","isMobile","EDeviceType","menuOpen","setMenuOpen","useState","menuRef","useRef","amount","cycleFrequency","nextDueDate","toggleMenu","v","handleViewPaymentMethod","useCallback","handleCancelSubscription","useEffect","handleClickOutside","event","FlexView","jsx","Text","Separator","jsxs","Styled.StyledVerticalMenu","Styled.DropdownMenu"],"mappings":";;;;;;;;AAYA,MAAMA,IAAmDC;AAAA,EACvD,CAAC,EAAE,gBAAAC,GAAgB,qBAAAC,GAAqB,sBAAAC,QAA2B;AAC3D,UAAA,EAAE,QAAAC,MAAWC,KACbC,IAAWF,KAAUG,EAAY,QACjC,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAK,GACxCC,IAAUC,EAAuB,IAAI,GAErC,EAAE,QAAAC,GAAQ,iBAAiBC,GAAgB,eAAeC,EAAgB,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A;AAAA,gBAAA;AAAA,gBACtDO;AAAA,gBAAO;AAAA,gBAAiBE;AAAA,cAAA,GAC5B;AAAA,YAAA,GACF;AAAA,YAECT,IAAW,OACV,gBAAAsB,EAACJ,KAAS,WAAU,YAAW,KAAKb,GAClC,UAAA;AAAA,cAAC,gBAAAc,EAAAI,GAAA,EAA0B,QAAQ,IAAI,OAAO,IAAI,SAASb,GAAY;AAAA,cACtER,KACC,gBAAAoB;AAAA,gBAACE;AAAAA,gBAAA;AAAA,kBACC,QAAQ;AAAA,kBACR,WAAU;AAAA,kBACV,aAAY;AAAA,kBACZ,cAAa;AAAA,kBACb,OAAO;AAAA,kBACP,UAAU;AAAA,kBACV,UAAU;AAAA,kBAEV,UAAA;AAAA,oBAAA,gBAAAL;AAAA,sBAACC;AAAA,sBAAA;AAAA,wBACC,WAAU;AAAA,wBACV,SAAQ;AAAA,wBACR,QAAO;AAAA,wBACP,SAASR;AAAA,wBACV,UAAA;AAAA,sBAAA;AAAA,oBAED;AAAA,oBACA,gBAAAO;AAAA,sBAACC;AAAA,sBAAA;AAAA,wBACC,WAAU;AAAA,wBACV,SAAQ;AAAA,wBACR,QAAO;AAAA,wBACP,SAASN;AAAA,wBACV,UAAA;AAAA,sBAAA;AAAA,oBAED;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA,GAEJ;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IACF,EAAA,CAAA;AAAA,EAEJ;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-steps-constants.js","sources":["../../../../../src/features/parent-dashboard/comps/next-steps/next-steps-constants.ts"],"sourcesContent":["import type { INextStep } from './next-steps-types';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\n\nexport const nextStepsData: INextStep[] = [\n {\n title: 'Personalized Sessions',\n description: `Your tutor will align sessions to your child's school curriculum and focus areas.`,\n image: ILLUSTRATIONS.KNOWLEDGE_BLUE,\n textColor: 'BLUE_4',\n },\n {\n title: 'Regular Practice',\n description: `Your child will get homework assignments and daily practice through our app.`,\n image: ILLUSTRATIONS.BOOK_CHECKED_ORANGE,\n textColor: 'ORANGE_4',\n },\n {\n title: 'Parent-tutor Conference',\n description: `We'll schedule a conference after 8 sessions to review progress & adjust approach.`,\n image: ILLUSTRATIONS.HANDSHAKE,\n textColor: 'YELLOW_4',\n },\n];\n"],"names":["nextStepsData","ILLUSTRATIONS"],"mappings":";AAIO,MAAMA,IAA6B;AAAA,EACxC;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAOC,EAAc;AAAA,IACrB,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAOA,EAAc;AAAA,IACrB,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAOA,EAAc;AAAA,IACrB,WAAW;AAAA,EACb;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-steps-styled.js","sources":["../../../../../src/features/parent-dashboard/comps/next-steps/next-steps-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const TextContent = styled(FlexView)(\n ({ theme }) => `\n border-bottom: 1px solid ${theme.colors.BLACK_5};\n\n ${theme.mediaQueries.minWidthTablet} {\n border-bottom: none;\n }\n `,\n);\n\nexport const ListItem = styled(FlexView)(\n ({ theme }) => `\n &:first-child {\n ${TextContent} {\n padding-top: 0;\n }\n }\n &:last-child {\n ${TextContent} {\n padding-bottom: 0;\n border-bottom: none;\n }\n }\n\n ${theme.mediaQueries.minWidthTablet} {\n border-right: 1px solid ${theme.colors.BLACK_5};\n\n &:last-child {\n border-right: none;\n padding-right: 0;\n }\n\n &:first-child {\n padding-left: 0;\n }\n }\n `,\n);\n"],"names":["TextContent","styled","FlexView","theme","ListItem"],"mappings":";;AAIa,MAAAA,IAAcC,EAAOC,CAAQ;AAAA,EACxC,CAAC,EAAE,OAAAC,EAAA,MAAY;AAAA,+BACcA,EAAM,OAAO,OAAO;AAAA;AAAA,MAE7CA,EAAM,aAAa,cAAc;AAAA;AAAA;AAAA;AAIvC,GAEaC,IAAWH,EAAOC,CAAQ;AAAA,EACrC,CAAC,EAAE,OAAAC,EAAA,MAAY;AAAA;AAAA,QAETH,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA,QAKXA,CAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMbG,EAAM,aAAa,cAAc;AAAA,gCACPA,EAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYpD;"}
|
package/dist/features/{trial-session/comps/pla → parent-dashboard/comps}/next-steps/next-steps.js
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { memo as a } from "react";
|
|
3
3
|
import { useTheme as h } from "styled-components";
|
|
4
|
-
import p from "
|
|
5
|
-
import m from "
|
|
6
|
-
import o from "
|
|
7
|
-
import n from "
|
|
8
|
-
import { EDeviceType as $ } from "
|
|
4
|
+
import p from "../../../ui/image/image.js";
|
|
5
|
+
import m from "../../../ui/layout/flex-view.js";
|
|
6
|
+
import o from "../../../ui/separator/separator.js";
|
|
7
|
+
import n from "../../../ui/text/text.js";
|
|
8
|
+
import { EDeviceType as $ } from "../../../ui/theme/constants.js";
|
|
9
9
|
import { nextStepsData as d } from "./next-steps-constants.js";
|
|
10
10
|
import { ListItem as f, TextContent as x } from "./next-steps-styled.js";
|
|
11
11
|
const b = () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-steps.js","sources":["../../../../../src/features/parent-dashboard/comps/next-steps/next-steps.tsx"],"sourcesContent":["import { memo } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport { nextStepsData } from './next-steps-constants';\nimport * as Styled from './next-steps-styled';\n\nconst NextSteps: React.FC = () => {\n const theme = useTheme();\n const isMobile = theme.device <= EDeviceType.MOBILE;\n\n return (\n <FlexView>\n <Text $renderAs=\"ah4-bold\" $renderOnMobileAs=\"ab1-bold\" $color=\"WHITE\">\n What happens next?\n </Text>\n <Separator height={isMobile ? 16 : 20} />\n <FlexView $justifyContent=\"center\" $flexDirection={isMobile ? 'column' : 'row'}>\n {nextStepsData.map(({ title, description, image, textColor }) => (\n <Styled.ListItem\n key={title}\n $flexDirection={isMobile ? 'row' : 'column'}\n $flex={1}\n $gutterX={isMobile ? 0 : 1}\n $flexColumnGapX={isMobile ? 0.75 : 0}\n $alignItems={isMobile ? 'center' : 'normal'}\n >\n <Image\n src={image}\n width={isMobile ? 72 : 80}\n height={isMobile ? 72 : 80}\n withLoader={false}\n />\n {!isMobile && <Separator heightX={0.75} />}\n <Styled.TextContent $flex={1} $gapX={isMobile ? 1 : 0} $justifyContent=\"space-between\">\n <Text $renderAs=\"ac3-black\" $renderOnMobileAs=\"ac4-black\" $color={textColor}>\n {title}\n </Text>\n <Separator height={isMobile ? 10 : 12} />\n <Text $renderAs=\"ub1\" $renderOnMobileAs=\"ub2\" $color=\"WHITE\">\n {description}\n </Text>\n </Styled.TextContent>\n </Styled.ListItem>\n ))}\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(NextSteps);\n"],"names":["NextSteps","isMobile","useTheme","EDeviceType","FlexView","jsx","Text","Separator","nextStepsData","title","description","image","textColor","jsxs","Styled.ListItem","Image","Styled.TextContent","NextSteps$1","memo"],"mappings":";;;;;;;;;;AAWA,MAAMA,IAAsB,MAAM;AAE1B,QAAAC,IADQC,IACS,UAAUC,EAAY;AAE7C,2BACGC,GACC,EAAA,UAAA;AA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
|
@@ -1,44 +1,50 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import { ILLUSTRATIONS as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import { memo as f, useMemo as d } from "react";
|
|
3
|
+
import { ILLUSTRATIONS as p } from "../../../../assets/illustrations/illustrations.js";
|
|
4
|
+
import u from "../../../ui/buttons/button/button.js";
|
|
5
|
+
import $ from "../../../ui/image/image.js";
|
|
6
|
+
import m from "../../../ui/layout/flex-view.js";
|
|
7
7
|
import r from "../../../ui/separator/separator.js";
|
|
8
8
|
import o from "../../../ui/text/text.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { ImageWrapper as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
import g from "../../hooks/use-fetch-parent-home.js";
|
|
10
|
+
import x from "../../hooks/use-parent-home-data.js";
|
|
11
|
+
import { ImageWrapper as A } from "./pla-first-session-introduction-styled.js";
|
|
12
|
+
import { fromUnixTime as S } from "../../../../node_modules/date-fns/fromUnixTime.js";
|
|
13
|
+
import { formatDate as I } from "../../../../node_modules/date-fns/format.js";
|
|
14
|
+
const L = ({
|
|
15
|
+
studentId: i,
|
|
16
|
+
onRunSystemCheck: a
|
|
15
17
|
}) => {
|
|
16
|
-
|
|
17
|
-
const {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
g(i);
|
|
19
|
+
const { nextSessionStart: t, showPLAIntroduction: c, isTrialDone: h } = x(i), n = d(() => {
|
|
20
|
+
if (!t) return "";
|
|
21
|
+
const l = new Date(S(t).getTime());
|
|
22
|
+
return I(l, "EEEE, MMM d 'at' h:mm a");
|
|
23
|
+
}, [t]);
|
|
24
|
+
return /* @__PURE__ */ s(m, { $justifyContent: "center", $alignItems: "center", $height: "100vh", $width: "100%", children: [
|
|
25
|
+
n && c && /* @__PURE__ */ s(m, { children: [
|
|
26
|
+
/* @__PURE__ */ e(o, { $renderAs: "ab1", $color: "BLACK_1", $align: "center", children: `We’re excited for your ${h ? "next" : "first"} session on` }),
|
|
21
27
|
/* @__PURE__ */ e(r, { height: 4 }),
|
|
22
|
-
/* @__PURE__ */ e(o, { $renderAs: "ab1-bold", $align: "center", children:
|
|
28
|
+
/* @__PURE__ */ e(o, { $renderAs: "ab1-bold", $align: "center", children: n })
|
|
23
29
|
] }),
|
|
24
30
|
/* @__PURE__ */ e(r, { heightX: 2.5 }),
|
|
25
|
-
/* @__PURE__ */ e(
|
|
31
|
+
/* @__PURE__ */ e(A, { children: /* @__PURE__ */ e($, { src: p.LEARNING_PUZZLE_BOT, width: "100%" }) }),
|
|
26
32
|
/* @__PURE__ */ e(r, { heightX: 3.5 }),
|
|
27
33
|
/* @__PURE__ */ e(o, { $renderAs: "ab2", $color: "BLACK_1", $align: "center", children: "Let's make sure your device is ready for your child's session." }),
|
|
28
34
|
/* @__PURE__ */ e(r, { heightX: 1 }),
|
|
29
35
|
/* @__PURE__ */ e(
|
|
30
|
-
|
|
36
|
+
u,
|
|
31
37
|
{
|
|
32
38
|
renderAs: "primary",
|
|
33
39
|
label: "Run a system check",
|
|
34
40
|
shape: "square",
|
|
35
41
|
size: "small",
|
|
36
|
-
onClick:
|
|
42
|
+
onClick: a
|
|
37
43
|
}
|
|
38
44
|
)
|
|
39
45
|
] });
|
|
40
|
-
},
|
|
46
|
+
}, j = f(L);
|
|
41
47
|
export {
|
|
42
|
-
|
|
48
|
+
j as default
|
|
43
49
|
};
|
|
44
50
|
//# sourceMappingURL=pla-first-session-introduction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pla-first-session-introduction.js","sources":["../../../../../src/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.tsx"],"sourcesContent":["import type { IFirstSessionIntroductionProps } from './pla-first-session-introduction-types';\n\nimport { memo, type FC } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Button from '../../../ui/buttons/button/button';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport useFetchParentHome from '../../hooks/use-fetch-parent-home';\nimport useParentHomeData from '../../hooks/use-parent-home-data';\nimport * as Styled from './pla-first-session-introduction-styled';\n\nconst PlaFirstSessionIntroduction: FC<IFirstSessionIntroductionProps> = ({\n studentId,\n onRunSystemCheck,\n}) => {\n useFetchParentHome(studentId);\n const {
|
|
1
|
+
{"version":3,"file":"pla-first-session-introduction.js","sources":["../../../../../src/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.tsx"],"sourcesContent":["import type { IFirstSessionIntroductionProps } from './pla-first-session-introduction-types';\n\nimport { format, fromUnixTime } from 'date-fns';\nimport { memo, useMemo, type FC } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Button from '../../../ui/buttons/button/button';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport useFetchParentHome from '../../hooks/use-fetch-parent-home';\nimport useParentHomeData from '../../hooks/use-parent-home-data';\nimport * as Styled from './pla-first-session-introduction-styled';\n\nconst PlaFirstSessionIntroduction: FC<IFirstSessionIntroductionProps> = ({\n studentId,\n onRunSystemCheck,\n}) => {\n useFetchParentHome(studentId);\n const { nextSessionStart, showPLAIntroduction, isTrialDone } = useParentHomeData(studentId);\n\n const formattedNextSessionStart = useMemo(() => {\n if (!nextSessionStart) return '';\n\n const date = new Date(fromUnixTime(nextSessionStart).getTime());\n\n return format(date, \"EEEE, MMM d 'at' h:mm a\");\n }, [nextSessionStart]);\n\n return (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $height=\"100vh\" $width={'100%'}>\n {formattedNextSessionStart && showPLAIntroduction && (\n <FlexView>\n <Text $renderAs=\"ab1\" $color=\"BLACK_1\" $align=\"center\">\n {`We’re excited for your ${isTrialDone ? 'next' : 'first'} session on`}\n </Text>\n <Separator height={4} />\n <Text $renderAs=\"ab1-bold\" $align=\"center\">\n {formattedNextSessionStart}\n </Text>\n </FlexView>\n )}\n <Separator heightX={2.5} />\n <Styled.ImageWrapper>\n <Image src={ILLUSTRATIONS.LEARNING_PUZZLE_BOT} width=\"100%\" />\n </Styled.ImageWrapper>\n <Separator heightX={3.5} />\n <Text $renderAs=\"ab2\" $color=\"BLACK_1\" $align=\"center\">\n Let's make sure your device is ready for your child's session.\n </Text>\n <Separator heightX={1} />\n <Button\n renderAs=\"primary\"\n label=\"Run a system check\"\n shape=\"square\"\n size=\"small\"\n onClick={onRunSystemCheck}\n />\n </FlexView>\n );\n};\n\nexport default memo(PlaFirstSessionIntroduction);\n"],"names":["PlaFirstSessionIntroduction","studentId","onRunSystemCheck","useFetchParentHome","nextSessionStart","showPLAIntroduction","isTrialDone","useParentHomeData","formattedNextSessionStart","useMemo","date","fromUnixTime","format","jsxs","FlexView","jsx","Text","Separator","Styled.ImageWrapper","Image","ILLUSTRATIONS","Button","plaFirstSessionIntroduction","memo"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,IAAkE,CAAC;AAAA,EACvE,WAAAC;AAAA,EACA,kBAAAC;AACF,MAAM;AACJ,EAAAC,EAAmBF,CAAS;AAC5B,QAAM,EAAE,kBAAAG,GAAkB,qBAAAC,GAAqB,aAAAC,EAAY,IAAIC,EAAkBN,CAAS,GAEpFO,IAA4BC,EAAQ,MAAM;AAC1C,QAAA,CAACL,EAAyB,QAAA;AAE9B,UAAMM,IAAO,IAAI,KAAKC,EAAaP,CAAgB,EAAE,SAAS;AAEvD,WAAAQ,EAAOF,GAAM,yBAAyB;AAAA,EAAA,GAC5C,CAACN,CAAgB,CAAC;AAGnB,SAAA,gBAAAS,EAACC,KAAS,iBAAgB,UAAS,aAAY,UAAS,SAAQ,SAAQ,QAAQ,QAC7E,UAAA;AAAA,IAA6BN,KAAAH,uBAC3BS,GACC,EAAA,UAAA;AAAA,MAAC,gBAAAC,EAAAC,GAAA,EAAK,WAAU,OAAM,QAAO,WAAU,QAAO,UAC3C,UAA0B,0BAAAV,IAAc,SAAS,OAAO,eAC3D;AAAA,MACA,gBAAAS,EAACE,GAAU,EAAA,QAAQ,EAAG,CAAA;AAAA,wBACrBD,GAAK,EAAA,WAAU,YAAW,QAAO,UAC/B,UACHR,GAAA;AAAA,IAAA,GACF;AAAA,IAEF,gBAAAO,EAACE,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,IACzB,gBAAAF,EAACG,GAAA,EACC,UAAA,gBAAAH,EAACI,GAAM,EAAA,KAAKC,EAAc,qBAAqB,OAAM,OAAA,CAAO,EAC9D,CAAA;AAAA,IACA,gBAAAL,EAACE,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,IACzB,gBAAAF,EAACC,KAAK,WAAU,OAAM,QAAO,WAAU,QAAO,UAAS,UAEvD,iEAAA,CAAA;AAAA,IACA,gBAAAD,EAACE,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,IACvB,gBAAAF;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,OAAM;AAAA,QACN,OAAM;AAAA,QACN,MAAK;AAAA,QACL,SAASnB;AAAA,MAAA;AAAA,IACX;AAAA,EACF,EAAA,CAAA;AAEJ,GAEeoB,IAAAC,EAAKvB,CAA2B;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useState as R, useRef as m, useCallback as u, useEffect as g } from "react";
|
|
2
|
+
import { COUNTDOWN_INTERVAL as d } from "../session-status-constants.js";
|
|
3
|
+
const C = ({ timeLeft: t, maxHoursToShow: s = 48 }) => {
|
|
4
|
+
const [l, e] = R(0), r = m(null), c = u(() => {
|
|
5
|
+
r.current && (clearInterval(r.current), r.current = null);
|
|
6
|
+
}, []), i = u(
|
|
7
|
+
(a) => {
|
|
8
|
+
const o = Math.floor(Date.now() / 1e3), n = a - o, f = s * 3600;
|
|
9
|
+
return n <= 0 || n > f ? 0 : n;
|
|
10
|
+
},
|
|
11
|
+
[s]
|
|
12
|
+
);
|
|
13
|
+
return g(() => {
|
|
14
|
+
if (!t) {
|
|
15
|
+
c(), e(0);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const a = i(t);
|
|
19
|
+
if (a <= 0) {
|
|
20
|
+
e(0);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
e(a);
|
|
24
|
+
const o = () => {
|
|
25
|
+
const n = i(t);
|
|
26
|
+
n <= 0 ? (c(), e(0)) : e(n);
|
|
27
|
+
};
|
|
28
|
+
return r.current = setInterval(o, d), c;
|
|
29
|
+
}, [t, c, i]), l;
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
C as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=use-countdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-countdown.js","sources":["../../../../../../src/features/parent-dashboard/comps/session-status/hooks/use-countdown.ts"],"sourcesContent":["import { useState, useEffect, useRef, useCallback } from 'react';\n\nimport { COUNTDOWN_INTERVAL } from '../session-status-constants';\n\ninterface IUseCountdownParams {\n timeLeft: number | null;\n maxHoursToShow?: number;\n}\n\nconst useCountdown = ({ timeLeft, maxHoursToShow = 48 }: IUseCountdownParams): number => {\n const [remaining, setRemaining] = useState(0);\n const intervalRef = useRef<NodeJS.Timeout | null>(null);\n\n const clear = useCallback(() => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n }, []);\n\n const calculateRemaining = useCallback(\n (targetTime: number): number => {\n const now = Math.floor(Date.now() / 1000);\n const diff = targetTime - now;\n const maxSeconds = maxHoursToShow * 3600;\n\n if (diff <= 0 || diff > maxSeconds) {\n return 0;\n }\n\n return diff;\n },\n [maxHoursToShow],\n );\n\n useEffect(() => {\n if (!timeLeft) {\n clear();\n setRemaining(0);\n\n return;\n }\n\n const initialRemaining = calculateRemaining(timeLeft);\n\n if (initialRemaining <= 0) {\n setRemaining(0);\n\n return;\n }\n\n setRemaining(initialRemaining);\n\n const tick = () => {\n const currentRemaining = calculateRemaining(timeLeft);\n\n if (currentRemaining <= 0) {\n clear();\n setRemaining(0);\n } else {\n setRemaining(currentRemaining);\n }\n };\n\n intervalRef.current = setInterval(tick, COUNTDOWN_INTERVAL);\n\n return clear;\n }, [timeLeft, clear, calculateRemaining]);\n\n return remaining;\n};\n\nexport default useCountdown;\n"],"names":["useCountdown","timeLeft","maxHoursToShow","remaining","setRemaining","useState","intervalRef","useRef","clear","useCallback","calculateRemaining","targetTime","now","diff","maxSeconds","useEffect","initialRemaining","tick","currentRemaining","COUNTDOWN_INTERVAL"],"mappings":";;AASA,MAAMA,IAAe,CAAC,EAAE,UAAAC,GAAU,gBAAAC,IAAiB,SAAsC;AACvF,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,CAAC,GACtCC,IAAcC,EAA8B,IAAI,GAEhDC,IAAQC,EAAY,MAAM;AAC9B,IAAIH,EAAY,YACd,cAAcA,EAAY,OAAO,GACjCA,EAAY,UAAU;AAAA,EAE1B,GAAG,CAAE,CAAA,GAECI,IAAqBD;AAAA,IACzB,CAACE,MAA+B;AAC9B,YAAMC,IAAM,KAAK,MAAM,KAAK,IAAA,IAAQ,GAAI,GAClCC,IAAOF,IAAaC,GACpBE,IAAaZ,IAAiB;AAEhC,aAAAW,KAAQ,KAAKA,IAAOC,IACf,IAGFD;AAAA,IACT;AAAA,IACA,CAACX,CAAc;AAAA,EAAA;AAGjB,SAAAa,EAAU,MAAM;AACd,QAAI,CAACd,GAAU;AACP,MAAAO,KACNJ,EAAa,CAAC;AAEd;AAAA,IACF;AAEM,UAAAY,IAAmBN,EAAmBT,CAAQ;AAEpD,QAAIe,KAAoB,GAAG;AACzB,MAAAZ,EAAa,CAAC;AAEd;AAAA,IACF;AAEA,IAAAA,EAAaY,CAAgB;AAE7B,UAAMC,IAAO,MAAM;AACX,YAAAC,IAAmBR,EAAmBT,CAAQ;AAEpD,MAAIiB,KAAoB,KAChBV,KACNJ,EAAa,CAAC,KAEdA,EAAac,CAAgB;AAAA,IAC/B;AAGU,WAAAZ,EAAA,UAAU,YAAYW,GAAME,CAAkB,GAEnDX;AAAA,EACN,GAAA,CAACP,GAAUO,GAAOE,CAAkB,CAAC,GAEjCP;AACT;"}
|