@cuemath/leap 2.8.51 → 2.8.52-link.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/features/trial-session/api/trial-nodes.js +6 -5
- package/dist/features/trial-session/api/trial-nodes.js.map +1 -1
- package/dist/features/trial-session/comps/school-goals/school-goals.js +54 -54
- package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +41 -41
- package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
- package/dist/features/trial-session/comps/student-info/student-info.js +35 -35
- package/dist/features/trial-session/comps/student-info/student-info.js.map +1 -1
- package/dist/features/trial-session/comps/test-prep/test-prep.js +45 -42
- package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
- package/dist/features/trial-session/comps/worksheet/worksheet.js +23 -23
- package/dist/features/trial-session/comps/worksheet/worksheet.js.map +1 -1
- package/dist/features/trial-session/helper.js +52 -52
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/package.json +1 -1
@@ -1,9 +1,10 @@
|
|
1
|
-
import { createPatchAPI as
|
2
|
-
import { BASE_URL_V2 as
|
3
|
-
|
4
|
-
|
1
|
+
import { createPatchAPI as r } from "@cuemath/rest-api";
|
2
|
+
import { BASE_URL_V2 as o } from "../../../constants/api.js";
|
3
|
+
import { stringify as s } from "../../../helpers/query-string.js";
|
4
|
+
const { usePatch: u } = r({
|
5
|
+
getURL: (e, t) => `${o}/students/${e}/nodes/trial/resume/?${s(t)}`
|
5
6
|
});
|
6
7
|
export {
|
7
|
-
|
8
|
+
u as useResumeTrialWorksheet
|
8
9
|
};
|
9
10
|
//# sourceMappingURL=trial-nodes.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"trial-nodes.js","sources":["../../../../src/features/trial-session/api/trial-nodes.ts"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../types/models/worksheet';\n\nimport { createPatchAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V2 } from '../../../constants/api';\n\nconst { usePatch: useResumeTrialWorksheet } = createPatchAPI<\n IResumeWorksheetModel,\n Record<string, unknown>\n>({\n getURL: studentId
|
1
|
+
{"version":3,"file":"trial-nodes.js","sources":["../../../../src/features/trial-session/api/trial-nodes.ts"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../types/models/worksheet';\n\nimport { createPatchAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL_V2 } from '../../../constants/api';\nimport { stringify } from '../../../helpers/query-string';\n\nconst { usePatch: useResumeTrialWorksheet } = createPatchAPI<\n IResumeWorksheetModel,\n Record<string, unknown>\n>({\n getURL: (studentId, query) =>\n `${BASE_URL_V2}/students/${studentId}/nodes/trial/resume/?${stringify(query)}`,\n});\n\nexport { useResumeTrialWorksheet };\n"],"names":["useResumeTrialWorksheet","createPatchAPI","studentId","query","BASE_URL_V2","stringify"],"mappings":";;;AAOA,MAAM,EAAE,UAAUA,EAAwB,IAAIC,EAG5C;AAAA,EACA,QAAQ,CAACC,GAAWC,MAClB,GAAGC,CAAW,aAAaF,CAAS,wBAAwBG,EAAUF,CAAK,CAAC;AAChF,CAAC;"}
|
@@ -1,43 +1,43 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { memo as
|
1
|
+
import { jsx as A } from "react/jsx-runtime";
|
2
|
+
import { memo as B, useMemo as C, useCallback as s, useEffect as S } from "react";
|
3
3
|
import { GOAL_CATEGORY as m } from "../../../milestone/constants.js";
|
4
|
-
import { getCategorizedCurriculumStandards as
|
5
|
-
import { getGradesFromConfig as
|
6
|
-
import { epochTimestampAfterOneYear as
|
7
|
-
import { useTrialSessionContext as
|
8
|
-
import { updateGoalInFormData as
|
9
|
-
import
|
10
|
-
const
|
4
|
+
import { getCategorizedCurriculumStandards as Y } from "../../../milestone/create/comps/class-details-step/class-details-utils.js";
|
5
|
+
import { getGradesFromConfig as j, getGoalsFromConfig as q } from "../../../milestone/create/milestone-create-helpers.js";
|
6
|
+
import { epochTimestampAfterOneYear as G } from "../../../utils/utils.js";
|
7
|
+
import { useTrialSessionContext as v } from "../../context/use-trial-session-context.js";
|
8
|
+
import { updateGoalInFormData as O } from "../../helper.js";
|
9
|
+
import w from "./school-goals-view.js";
|
10
|
+
const X = B(() => {
|
11
11
|
const {
|
12
12
|
milestoneConfig: r,
|
13
|
-
formData:
|
13
|
+
formData: L,
|
14
14
|
updateSlideConfig: n,
|
15
|
-
updateButtonState:
|
16
|
-
onRemoveOptionalSlides:
|
17
|
-
trialHomeData:
|
18
|
-
} =
|
19
|
-
() =>
|
20
|
-
countryCode:
|
15
|
+
updateButtonState: f,
|
16
|
+
onRemoveOptionalSlides: g,
|
17
|
+
trialHomeData: E
|
18
|
+
} = v(), { name: p, grade: e, goals: a, curriculum: i } = L || {}, { demo_info: U } = E, { stream: c, region_data: y } = U || {}, { opportunity_country: u = "US" } = y || {}, H = j(r), N = C(
|
19
|
+
() => Y(r, {
|
20
|
+
countryCode: u,
|
21
21
|
grade: e ?? "",
|
22
22
|
goalCategory: m.SCHOOL_SUCCESS,
|
23
|
-
courseStream:
|
23
|
+
courseStream: c,
|
24
24
|
enrollmentType: "ONLINE"
|
25
25
|
}),
|
26
|
-
[r, e,
|
27
|
-
),
|
28
|
-
() =>
|
29
|
-
countryCode:
|
26
|
+
[r, u, e, c]
|
27
|
+
), d = C(
|
28
|
+
() => q(r, {
|
29
|
+
countryCode: u,
|
30
30
|
grade: e ?? "",
|
31
31
|
goalCategory: m.SCHOOL_SUCCESS,
|
32
|
-
courseStream:
|
33
|
-
curriculumStandard:
|
32
|
+
courseStream: c,
|
33
|
+
curriculumStandard: i,
|
34
34
|
enrollmentType: "ONLINE"
|
35
35
|
}),
|
36
|
-
[r, e,
|
37
|
-
), { goal_code:
|
36
|
+
[r, u, e, c, i]
|
37
|
+
), { goal_code: _ } = C(
|
38
38
|
() => (a == null ? void 0 : a.find((o) => o.goal_category === m.SCHOOL_SUCCESS)) ?? {},
|
39
39
|
[a]
|
40
|
-
), h = !!(
|
40
|
+
), h = !!(p && e && i && _), t = s(
|
41
41
|
(o, l) => {
|
42
42
|
n({
|
43
43
|
[o]: l,
|
@@ -45,57 +45,57 @@ const Q = x(() => {
|
|
45
45
|
});
|
46
46
|
},
|
47
47
|
[n]
|
48
|
-
),
|
48
|
+
), T = s((o) => t("name", o.target.value), [t]), D = s(
|
49
49
|
(o, l) => {
|
50
|
-
const { label:
|
50
|
+
const { label: F } = l, x = O(a, m.SCHOOL_SUCCESS, {
|
51
51
|
goal_code: o,
|
52
|
-
milestone_name:
|
53
|
-
milestone_date_ts:
|
52
|
+
milestone_name: F,
|
53
|
+
milestone_date_ts: G()
|
54
54
|
});
|
55
|
-
n({ goals:
|
55
|
+
n({ goals: x });
|
56
56
|
},
|
57
57
|
[a, n]
|
58
|
-
),
|
58
|
+
), I = s(
|
59
59
|
(o) => t("curriculum", o),
|
60
60
|
[t]
|
61
|
-
),
|
61
|
+
), b = s(
|
62
62
|
(o) => {
|
63
63
|
t("grade", o), t("curriculum", "");
|
64
64
|
},
|
65
65
|
[t]
|
66
66
|
);
|
67
|
-
return
|
68
|
-
|
69
|
-
}, [h,
|
70
|
-
e && (
|
71
|
-
}, [e]),
|
72
|
-
const o =
|
67
|
+
return S(() => {
|
68
|
+
f("right", { isDisabled: !h, isLoading: !1 });
|
69
|
+
}, [h, f]), S(() => {
|
70
|
+
e && (g == null || g(e));
|
71
|
+
}, [e]), S(() => {
|
72
|
+
const o = d.length === 1 ? d[0] : void 0;
|
73
73
|
if (o) {
|
74
|
-
const l =
|
74
|
+
const l = O(a, m.SCHOOL_SUCCESS, {
|
75
75
|
goal_code: o.id ?? "",
|
76
76
|
milestone_name: o.label ?? "",
|
77
|
-
milestone_date_ts:
|
77
|
+
milestone_date_ts: G()
|
78
78
|
});
|
79
79
|
n({ goals: l });
|
80
80
|
}
|
81
|
-
}, [
|
82
|
-
|
81
|
+
}, [d]), /* @__PURE__ */ A(
|
82
|
+
w,
|
83
83
|
{
|
84
|
-
name:
|
84
|
+
name: p,
|
85
85
|
grade: e,
|
86
|
-
curriculum:
|
87
|
-
grades:
|
88
|
-
curriculumStandards:
|
89
|
-
goalsList:
|
90
|
-
selectedGoal:
|
91
|
-
onNameChange:
|
92
|
-
onGoalChange:
|
93
|
-
onGradeChange:
|
94
|
-
onCurriculumChange:
|
86
|
+
curriculum: i,
|
87
|
+
grades: H,
|
88
|
+
curriculumStandards: N,
|
89
|
+
goalsList: d,
|
90
|
+
selectedGoal: _,
|
91
|
+
onNameChange: T,
|
92
|
+
onGoalChange: D,
|
93
|
+
onGradeChange: b,
|
94
|
+
onCurriculumChange: I
|
95
95
|
}
|
96
96
|
);
|
97
97
|
});
|
98
98
|
export {
|
99
|
-
|
99
|
+
X as default
|
100
100
|
};
|
101
101
|
//# sourceMappingURL=school-goals.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"school-goals.js","sources":["../../../../../src/features/trial-session/comps/school-goals/school-goals.tsx"],"sourcesContent":["import type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getCategorizedCurriculumStandards } from '../../../milestone/create/comps/class-details-step/class-details-utils';\nimport {\n getGoalsFromConfig,\n getGradesFromConfig,\n} from '../../../milestone/create/milestone-create-helpers';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { updateGoalInFormData } from '../../helper';\nimport SchoolGoalsView from './school-goals-view';\n\nconst SchoolGoals = memo(() => {\n const {\n milestoneConfig,\n formData,\n updateSlideConfig,\n updateButtonState,\n onRemoveOptionalSlides,\n trialHomeData,\n } = useTrialSessionContext();\n const { name, grade, goals, curriculum } = formData || {};\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream } = demoInfo || {};\n const grades = getGradesFromConfig(milestoneConfig);\n\n const curriculumStandards = useMemo(\n () =>\n getCategorizedCurriculumStandards(milestoneConfig, {\n countryCode
|
1
|
+
{"version":3,"file":"school-goals.js","sources":["../../../../../src/features/trial-session/comps/school-goals/school-goals.tsx"],"sourcesContent":["import type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\n\nimport { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getCategorizedCurriculumStandards } from '../../../milestone/create/comps/class-details-step/class-details-utils';\nimport {\n getGoalsFromConfig,\n getGradesFromConfig,\n} from '../../../milestone/create/milestone-create-helpers';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { updateGoalInFormData } from '../../helper';\nimport SchoolGoalsView from './school-goals-view';\n\nconst SchoolGoals = memo(() => {\n const {\n milestoneConfig,\n formData,\n updateSlideConfig,\n updateButtonState,\n onRemoveOptionalSlides,\n trialHomeData,\n } = useTrialSessionContext();\n const { name, grade, goals, curriculum } = formData || {};\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n const grades = getGradesFromConfig(milestoneConfig);\n\n const curriculumStandards = useMemo(\n () =>\n getCategorizedCurriculumStandards(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.SCHOOL_SUCCESS,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n }),\n [milestoneConfig, countryCode, grade, stream],\n );\n\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.SCHOOL_SUCCESS,\n courseStream: stream,\n curriculumStandard: curriculum,\n enrollmentType: 'ONLINE',\n }),\n [milestoneConfig, countryCode, grade, stream, curriculum],\n );\n\n const { goal_code: selectedGoal } = useMemo(\n () => goals?.find(goal => goal.goal_category === GOAL_CATEGORY.SCHOOL_SUCCESS) ?? {},\n [goals],\n );\n\n const hasRequiredFields = Boolean(name && grade && curriculum && selectedGoal);\n\n const updateStudentInformation = useCallback(\n (key: string, value: string) => {\n updateSlideConfig({\n [key]: value,\n ...(key === 'grade' || key === 'curriculum' ? { goals: [] } : {}),\n });\n },\n [updateSlideConfig],\n );\n\n const handleNameChange = useCallback<\n NonNullable<React.InputHTMLAttributes<HTMLInputElement>['onChange']>\n >(event => updateStudentInformation('name', event.target.value), [updateStudentInformation]);\n\n const handleGoalChange = useCallback(\n (value: string, option: ISelectOption<string | number>) => {\n const { label } = option;\n\n const updatedGoals = updateGoalInFormData(goals, GOAL_CATEGORY.SCHOOL_SUCCESS, {\n goal_code: value,\n milestone_name: label,\n milestone_date_ts: epochTimestampAfterOneYear(),\n });\n\n updateSlideConfig({ goals: updatedGoals });\n },\n [goals, updateSlideConfig],\n );\n\n const handleCurriculumChange = useCallback(\n (value: string) => updateStudentInformation('curriculum', value),\n [updateStudentInformation],\n );\n\n const handleGradeChange = useCallback(\n (value: string) => {\n updateStudentInformation('grade', value);\n updateStudentInformation('curriculum', '');\n },\n [updateStudentInformation],\n );\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\n\n useEffect(() => {\n if (grade) {\n onRemoveOptionalSlides?.(grade);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [grade]);\n\n useEffect(() => {\n // If there is only one goal in the list, set it as the selected goal\n // and update the form data with the goal code, milestone name, and date\n const defaultGoal = goalsList.length === 1 ? goalsList[0] : undefined;\n\n if (defaultGoal) {\n const goalToUpdate = updateGoalInFormData(goals, GOAL_CATEGORY.SCHOOL_SUCCESS, {\n goal_code: defaultGoal.id ?? '',\n milestone_name: defaultGoal.label ?? '',\n milestone_date_ts: epochTimestampAfterOneYear(),\n });\n\n updateSlideConfig({ goals: goalToUpdate });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [goalsList]);\n\n return (\n <SchoolGoalsView\n name={name}\n grade={grade}\n curriculum={curriculum}\n grades={grades}\n curriculumStandards={curriculumStandards}\n goalsList={goalsList}\n selectedGoal={selectedGoal}\n onNameChange={handleNameChange}\n onGoalChange={handleGoalChange}\n onGradeChange={handleGradeChange}\n onCurriculumChange={handleCurriculumChange}\n />\n );\n});\n\nexport default SchoolGoals;\n"],"names":["SchoolGoals","memo","milestoneConfig","formData","updateSlideConfig","updateButtonState","onRemoveOptionalSlides","trialHomeData","useTrialSessionContext","name","grade","goals","curriculum","demoInfo","stream","regionData","countryCode","grades","getGradesFromConfig","curriculumStandards","useMemo","getCategorizedCurriculumStandards","GOAL_CATEGORY","goalsList","getGoalsFromConfig","selectedGoal","goal","hasRequiredFields","updateStudentInformation","useCallback","key","value","handleNameChange","event","handleGoalChange","option","label","updatedGoals","updateGoalInFormData","epochTimestampAfterOneYear","handleCurriculumChange","handleGradeChange","useEffect","defaultGoal","goalToUpdate","jsx","SchoolGoalsView"],"mappings":";;;;;;;;;AAeM,MAAAA,IAAcC,EAAK,MAAM;AACvB,QAAA;AAAA,IACJ,iBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,eAAAC;AAAA,MACEC,EAAuB,GACrB,EAAE,MAAAC,GAAM,OAAAC,GAAO,OAAAC,GAAO,YAAAC,EAAW,IAAIT,KAAY,IAEjD,EAAE,WAAWU,EAAa,IAAAN,GAC1B,EAAE,QAAAO,GAAQ,aAAaC,EAAW,IAAIF,KAAY,CAAA,GAClD,EAAE,qBAAqBG,IAAc,KAAK,IAAID,KAAc,CAAA,GAC5DE,IAASC,EAAoBhB,CAAe,GAE5CiB,IAAsBC;AAAA,IAC1B,MACEC,EAAkCnB,GAAiB;AAAA,MACjD,aAAAc;AAAA,MACA,OAAON,KAAS;AAAA,MAChB,cAAcY,EAAc;AAAA,M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o as
|
3
|
-
import { GIF as
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
2
|
+
import { memo as y, useMemo as c, useCallback as G } from "react";
|
3
|
+
import { GIF as S } from "../../../../assets/gif/gif.js";
|
4
4
|
import { GOAL_CATEGORY as r } from "../../../milestone/constants.js";
|
5
|
-
import { getGoalsFromConfig as
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import { epochTimestampAfterOneYear as
|
11
|
-
import { useTrialSessionContext as
|
12
|
-
import { updateGoalInFormData as
|
13
|
-
import
|
14
|
-
import { Container as
|
15
|
-
const
|
16
|
-
const { formData:
|
17
|
-
() =>
|
18
|
-
countryCode:
|
5
|
+
import { getGoalsFromConfig as b } from "../../../milestone/create/milestone-create-helpers.js";
|
6
|
+
import x from "../../../ui/image/image.js";
|
7
|
+
import H from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
|
8
|
+
import p from "../../../ui/separator/separator.js";
|
9
|
+
import L from "../../../ui/text/text.js";
|
10
|
+
import { epochTimestampAfterOneYear as R } from "../../../utils/utils.js";
|
11
|
+
import { useTrialSessionContext as A } from "../../context/use-trial-session-context.js";
|
12
|
+
import { updateGoalInFormData as M } from "../../helper.js";
|
13
|
+
import D from "../slide-header/index.js";
|
14
|
+
import { Container as j, ContentWrapper as k, ImageWrapper as w, InputContainer as O } from "./student-enrichment-styled.js";
|
15
|
+
const Z = y(() => {
|
16
|
+
const { formData: d, milestoneConfig: n, updateSlideConfig: a, trialHomeData: f } = A(), { grade: i, goals: e } = d || {}, { demo_info: g } = f, { stream: m, region_data: h } = g || {}, { opportunity_country: s = "US" } = h || {}, u = c(
|
17
|
+
() => b(n, {
|
18
|
+
countryCode: s,
|
19
19
|
grade: i ?? "",
|
20
20
|
goalCategory: r.ENRICHMENT,
|
21
21
|
courseStream: m,
|
22
22
|
enrollmentType: "ONLINE"
|
23
23
|
}),
|
24
|
-
[n, i, m]
|
25
|
-
), { goal_code:
|
24
|
+
[n, s, i, m]
|
25
|
+
), { goal_code: C } = c(
|
26
26
|
() => (e == null ? void 0 : e.find((t) => t.goal_category === r.ENRICHMENT)) ?? {},
|
27
27
|
[e]
|
28
|
-
),
|
29
|
-
(t,
|
28
|
+
), E = G(
|
29
|
+
(t, I) => {
|
30
30
|
if (!t) {
|
31
|
-
const
|
32
|
-
(
|
31
|
+
const T = e == null ? void 0 : e.filter(
|
32
|
+
($) => $.goal_category !== r.ENRICHMENT
|
33
33
|
);
|
34
|
-
a({ goals:
|
34
|
+
a({ goals: T });
|
35
35
|
return;
|
36
36
|
}
|
37
|
-
const { label:
|
37
|
+
const { label: N } = I, _ = M(e, r.ENRICHMENT, {
|
38
38
|
goal_code: t,
|
39
|
-
milestone_name:
|
40
|
-
milestone_date_ts:
|
39
|
+
milestone_name: N,
|
40
|
+
milestone_date_ts: R()
|
41
41
|
});
|
42
|
-
a({ goals:
|
42
|
+
a({ goals: _ });
|
43
43
|
},
|
44
44
|
[e, a]
|
45
45
|
);
|
46
|
-
return /* @__PURE__ */
|
47
|
-
/* @__PURE__ */ o(
|
48
|
-
/* @__PURE__ */ o(
|
49
|
-
/* @__PURE__ */
|
50
|
-
/* @__PURE__ */ o(
|
46
|
+
return /* @__PURE__ */ l(j, { children: [
|
47
|
+
/* @__PURE__ */ o(p, { height: 60 }),
|
48
|
+
/* @__PURE__ */ o(D, {}),
|
49
|
+
/* @__PURE__ */ l(k, { $width: 750, $flexDirection: "row", $justifyContent: "center", children: [
|
50
|
+
/* @__PURE__ */ o(w, { children: /* @__PURE__ */ o(x, { withLoader: !0, height: 402, width: 302, src: S.ENRICHMENT, className: "image" }) }),
|
51
51
|
/* @__PURE__ */ o(
|
52
|
-
|
52
|
+
O,
|
53
53
|
{
|
54
54
|
$flexGap: 24,
|
55
55
|
$justifyContent: "center",
|
@@ -58,26 +58,26 @@ const Q = _(() => {
|
|
58
58
|
$gapX: 2.5,
|
59
59
|
$gutterX: 2.5,
|
60
60
|
children: /* @__PURE__ */ o(
|
61
|
-
|
61
|
+
H,
|
62
62
|
{
|
63
63
|
renderAs: "primary",
|
64
64
|
label: "Select a Goal",
|
65
|
-
value:
|
66
|
-
options:
|
65
|
+
value: C,
|
66
|
+
options: u,
|
67
67
|
shape: "borderLess",
|
68
68
|
theme: "dark",
|
69
|
-
onChange:
|
69
|
+
onChange: E,
|
70
70
|
isTransparent: !0
|
71
71
|
}
|
72
72
|
)
|
73
73
|
}
|
74
74
|
)
|
75
75
|
] }),
|
76
|
-
/* @__PURE__ */ o(
|
77
|
-
/* @__PURE__ */ o(
|
76
|
+
/* @__PURE__ */ o(p, { heightX: 1 }),
|
77
|
+
/* @__PURE__ */ o(L, { $renderAs: "ub3", $align: "center", children: "This is optional and can be skipped." })
|
78
78
|
] });
|
79
79
|
});
|
80
80
|
export {
|
81
|
-
|
81
|
+
Z as default
|
82
82
|
};
|
83
83
|
//# sourceMappingURL=student-enrichment.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"student-enrichment.js","sources":["../../../../../src/features/trial-session/comps/student-enrichment/student-enrichment.tsx"],"sourcesContent":["import type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\n\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { GIF } from '../../../../assets/gif/gif';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getGoalsFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { updateGoalInFormData } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './student-enrichment-styled';\n\nconst StudentEnrichment = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, trialHomeData } = useTrialSessionContext();\n const { grade, goals } = formData || {};\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream } = demoInfo || {};\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode
|
1
|
+
{"version":3,"file":"student-enrichment.js","sources":["../../../../../src/features/trial-session/comps/student-enrichment/student-enrichment.tsx"],"sourcesContent":["import type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\n\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { GIF } from '../../../../assets/gif/gif';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getGoalsFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { updateGoalInFormData } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './student-enrichment-styled';\n\nconst StudentEnrichment = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, trialHomeData } = useTrialSessionContext();\n const { grade, goals } = formData || {};\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.ENRICHMENT,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n }),\n [milestoneConfig, countryCode, grade, stream],\n );\n\n const { goal_code: selectedGoal } = useMemo(\n () => goals?.find(goal => goal.goal_category === GOAL_CATEGORY.ENRICHMENT) ?? {},\n [goals],\n );\n\n const handleGoalChange = useCallback(\n (value: string, option: ISelectOption<string | number>) => {\n if (!value) {\n const goalsWithoutEnrichment = goals?.filter(\n goal => goal.goal_category !== GOAL_CATEGORY.ENRICHMENT,\n );\n\n updateSlideConfig({ goals: goalsWithoutEnrichment });\n\n return;\n }\n\n const { label } = option;\n\n const updatedGoals = updateGoalInFormData(goals, GOAL_CATEGORY.ENRICHMENT, {\n goal_code: value,\n milestone_name: label,\n milestone_date_ts: epochTimestampAfterOneYear(),\n });\n\n updateSlideConfig({ goals: updatedGoals });\n },\n [goals, updateSlideConfig],\n );\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $width={750} $flexDirection=\"row\" $justifyContent=\"center\">\n <Styled.ImageWrapper>\n <Image withLoader height={402} width={302} src={GIF.ENRICHMENT} className=\"image\" />\n </Styled.ImageWrapper>\n <Styled.InputContainer\n $flexGap={24}\n $justifyContent=\"center\"\n $background=\"PURPLE_1\"\n $borderColor=\"BLACK_1\"\n $gapX={2.5}\n $gutterX={2.5}\n >\n <SearchableSelectInput\n renderAs=\"primary\"\n label=\"Select a Goal\"\n value={selectedGoal}\n options={goalsList}\n shape=\"borderLess\"\n theme=\"dark\"\n onChange={handleGoalChange}\n isTransparent\n />\n </Styled.InputContainer>\n </Styled.ContentWrapper>\n <Separator heightX={1} />\n <Text $renderAs=\"ub3\" $align=\"center\">\n This is optional and can be skipped.\n </Text>\n </Styled.Container>\n );\n});\n\nexport default StudentEnrichment;\n"],"names":["StudentEnrichment","memo","formData","milestoneConfig","updateSlideConfig","trialHomeData","useTrialSessionContext","grade","goals","demoInfo","stream","regionData","countryCode","goalsList","useMemo","getGoalsFromConfig","GOAL_CATEGORY","selectedGoal","goal","handleGoalChange","useCallback","value","option","goalsWithoutEnrichment","label","updatedGoals","updateGoalInFormData","epochTimestampAfterOneYear","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.ContentWrapper","Styled.ImageWrapper","Image","GIF","Styled.InputContainer","SearchableSelectInput","Text"],"mappings":";;;;;;;;;;;;;;AAiBM,MAAAA,IAAoBC,EAAK,MAAM;AACnC,QAAM,EAAE,UAAAC,GAAU,iBAAAC,GAAiB,mBAAA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Q,GAAI,CAAA;AAAA,sBACtBC,GAAY,EAAA;AAAA,IACb,gBAAAJ,EAACK,GAAA,EAAsB,QAAQ,KAAK,gBAAe,OAAM,iBAAgB,UACvE,UAAA;AAAA,MAAA,gBAAAH,EAACI,GAAA,EACC,UAAC,gBAAAJ,EAAAK,GAAA,EAAM,YAAU,IAAC,QAAQ,KAAK,OAAO,KAAK,KAAKC,EAAI,YAAY,WAAU,QAAQ,CAAA,GACpF;AAAA,MACA,gBAAAN;AAAA,QAACO;AAAAA,QAAA;AAAA,UACC,UAAU;AAAA,UACV,iBAAgB;AAAA,UAChB,aAAY;AAAA,UACZ,cAAa;AAAA,UACb,OAAO;AAAA,UACP,UAAU;AAAA,UAEV,UAAA,gBAAAP;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,UAAS;AAAA,cACT,OAAM;AAAA,cACN,OAAOrB;AAAA,cACP,SAASJ;AAAA,cACT,OAAM;AAAA,cACN,OAAM;AAAA,cACN,UAAUM;AAAA,cACV,eAAa;AAAA,YAAA;AAAA,UACf;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,IACA,gBAAAW,EAACC,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,sBACtBQ,GAAK,EAAA,WAAU,OAAM,QAAO,UAAS,UAEtC,wCAAA;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -1,22 +1,22 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
3
|
-
import { ILLUSTRATIONS as
|
4
|
-
import { GOAL_CATEGORY as
|
5
|
-
import { getCategorizedCurriculumStandards as
|
6
|
-
import { getGradesFromConfig as
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import { useTrialSessionContext as
|
13
|
-
import
|
14
|
-
import { Container as
|
15
|
-
const
|
16
|
-
const { formData: c, milestoneConfig:
|
17
|
-
countryCode:
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
2
|
+
import { memo as T, useCallback as t, useEffect as x } from "react";
|
3
|
+
import { ILLUSTRATIONS as y } from "../../../../assets/illustrations/illustrations.js";
|
4
|
+
import { GOAL_CATEGORY as E } from "../../../milestone/constants.js";
|
5
|
+
import { getCategorizedCurriculumStandards as O } from "../../../milestone/create/comps/class-details-step/class-details-utils.js";
|
6
|
+
import { getGradesFromConfig as B } from "../../../milestone/create/milestone-create-helpers.js";
|
7
|
+
import G from "../../../ui/image/image.js";
|
8
|
+
import U from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
|
9
|
+
import $ from "../../../ui/inputs/select-input/select-input.js";
|
10
|
+
import D from "../../../ui/inputs/text-input/text-input.js";
|
11
|
+
import H from "../../../ui/separator/separator.js";
|
12
|
+
import { useTrialSessionContext as N } from "../../context/use-trial-session-context.js";
|
13
|
+
import W from "../slide-header/index.js";
|
14
|
+
import { Container as k, StudentInfoWrapper as v, ImageWrapper as R, InformationWrapper as j } from "./student-info-styled.js";
|
15
|
+
const re = T(() => {
|
16
|
+
const { formData: c, milestoneConfig: m, updateSlideConfig: a, updateButtonState: s, trialHomeData: f } = N(), { name: d, grade: n, curriculum: l } = c || {}, g = B(m), { demo_info: h } = f, { stream: C, region_data: S } = h || {}, { opportunity_country: I = "US" } = S || {}, L = O(m, {
|
17
|
+
countryCode: I,
|
18
18
|
grade: n ?? "",
|
19
|
-
goalCategory:
|
19
|
+
goalCategory: E.SCHOOL_SUCCESS,
|
20
20
|
courseStream: C,
|
21
21
|
enrollmentType: "ONLINE"
|
22
22
|
}), u = !!(d && n && l), o = t(
|
@@ -24,23 +24,23 @@ const Z = _(() => {
|
|
24
24
|
a(e === "grade" ? { [e]: p, goals: [] } : { [e]: p });
|
25
25
|
},
|
26
26
|
[a]
|
27
|
-
),
|
27
|
+
), b = t((e) => o("name", e.target.value), [o]), _ = t(
|
28
28
|
(e) => o("grade", e),
|
29
29
|
[o]
|
30
|
-
),
|
30
|
+
), A = t(
|
31
31
|
(e) => o("curriculum", e),
|
32
32
|
[o]
|
33
33
|
);
|
34
|
-
return
|
34
|
+
return x(() => {
|
35
35
|
s("right", { isDisabled: !u, isLoading: !1 });
|
36
|
-
}, [u, s]), /* @__PURE__ */
|
37
|
-
/* @__PURE__ */ r(
|
38
|
-
/* @__PURE__ */ r(
|
39
|
-
/* @__PURE__ */
|
40
|
-
/* @__PURE__ */ r(
|
41
|
-
/* @__PURE__ */
|
36
|
+
}, [u, s]), /* @__PURE__ */ i(k, { children: [
|
37
|
+
/* @__PURE__ */ r(H, { height: 60 }),
|
38
|
+
/* @__PURE__ */ r(W, {}),
|
39
|
+
/* @__PURE__ */ i(v, { $background: "BLUE_4", $borderColor: "BLACK_T_87", children: [
|
40
|
+
/* @__PURE__ */ r(R, { children: /* @__PURE__ */ r(G, { withLoader: !1, src: y.BLUE_CLIP, width: 261, height: 31 }) }),
|
41
|
+
/* @__PURE__ */ i(j, { $flexGapX: 2.75, $background: "WHITE_1", $borderColor: "BLACK_T_87", children: [
|
42
42
|
/* @__PURE__ */ r(
|
43
|
-
|
43
|
+
D,
|
44
44
|
{
|
45
45
|
renderAs: "primary",
|
46
46
|
label: "Student name",
|
@@ -48,32 +48,32 @@ const Z = _(() => {
|
|
48
48
|
type: "text",
|
49
49
|
name: "name",
|
50
50
|
shape: "borderLess",
|
51
|
-
onChange:
|
51
|
+
onChange: b
|
52
52
|
}
|
53
53
|
),
|
54
54
|
/* @__PURE__ */ r(
|
55
|
-
|
55
|
+
U,
|
56
56
|
{
|
57
57
|
renderAs: "primary",
|
58
58
|
label: "Grade",
|
59
59
|
value: n,
|
60
60
|
options: g,
|
61
61
|
shape: "borderLess",
|
62
|
-
onChange:
|
62
|
+
onChange: _,
|
63
63
|
theme: "dark"
|
64
64
|
}
|
65
65
|
),
|
66
66
|
/* @__PURE__ */ r(
|
67
|
-
|
67
|
+
$,
|
68
68
|
{
|
69
69
|
renderAs: "primary",
|
70
70
|
label: "Curriculum",
|
71
71
|
value: l,
|
72
|
-
options:
|
72
|
+
options: L,
|
73
73
|
shape: "borderLess",
|
74
74
|
renderOptionsAs: "section-list",
|
75
75
|
theme: "dark",
|
76
|
-
onChange:
|
76
|
+
onChange: A
|
77
77
|
}
|
78
78
|
)
|
79
79
|
] })
|
@@ -81,6 +81,6 @@ const Z = _(() => {
|
|
81
81
|
] });
|
82
82
|
});
|
83
83
|
export {
|
84
|
-
|
84
|
+
re as default
|
85
85
|
};
|
86
86
|
//# sourceMappingURL=student-info.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"student-info.js","sources":["../../../../../src/features/trial-session/comps/student-info/student-info.tsx"],"sourcesContent":["import { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getCategorizedCurriculumStandards } from '../../../milestone/create/comps/class-details-step/class-details-utils';\nimport { getGradesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport Separator from '../../../ui/separator/separator';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './student-info-styled';\n\nconst StudentInformation = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, updateButtonState, trialHomeData } =\n useTrialSessionContext();\n\n const { name, grade, curriculum } = formData || {};\n const grades = getGradesFromConfig(milestoneConfig);\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream } = demoInfo || {};\n const curriculumStandards = getCategorizedCurriculumStandards(milestoneConfig, {\n countryCode
|
1
|
+
{"version":3,"file":"student-info.js","sources":["../../../../../src/features/trial-session/comps/student-info/student-info.tsx"],"sourcesContent":["import { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getCategorizedCurriculumStandards } from '../../../milestone/create/comps/class-details-step/class-details-utils';\nimport { getGradesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport Separator from '../../../ui/separator/separator';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './student-info-styled';\n\nconst StudentInformation = memo(() => {\n const { formData, milestoneConfig, updateSlideConfig, updateButtonState, trialHomeData } =\n useTrialSessionContext();\n\n const { name, grade, curriculum } = formData || {};\n const grades = getGradesFromConfig(milestoneConfig);\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const curriculumStandards = getCategorizedCurriculumStandards(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.SCHOOL_SUCCESS,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n });\n const hasRequiredFields = Boolean(name && grade && curriculum);\n\n const updateStudentInformation = useCallback(\n (key: string, value: string) => {\n if (key === 'grade') {\n // reset goals as well if grade changes\n updateSlideConfig({ [key]: value, goals: [] });\n } else {\n updateSlideConfig({ [key]: value });\n }\n },\n [updateSlideConfig],\n );\n\n const handleNameChange = useCallback<\n NonNullable<React.InputHTMLAttributes<HTMLInputElement>['onChange']>\n >(event => updateStudentInformation('name', event.target.value), [updateStudentInformation]);\n\n const handleGradeChange = useCallback(\n (value: string) => updateStudentInformation('grade', value),\n [updateStudentInformation],\n );\n\n const handleCurriculumChange = useCallback(\n (value: string) => updateStudentInformation('curriculum', value),\n [updateStudentInformation],\n );\n\n useEffect(() => {\n updateButtonState('right', { isDisabled: !hasRequiredFields, isLoading: false });\n }, [hasRequiredFields, updateButtonState]);\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.StudentInfoWrapper $background=\"BLUE_4\" $borderColor=\"BLACK_T_87\">\n <Styled.ImageWrapper>\n <Image withLoader={false} src={ILLUSTRATIONS.BLUE_CLIP} width={261} height={31} />\n </Styled.ImageWrapper>\n <Styled.InformationWrapper $flexGapX={2.75} $background=\"WHITE_1\" $borderColor=\"BLACK_T_87\">\n <TextInput\n renderAs=\"primary\"\n label=\"Student name\"\n value={name}\n type=\"text\"\n name=\"name\"\n shape=\"borderLess\"\n onChange={handleNameChange}\n />\n <SearchableSelectInput\n renderAs=\"primary\"\n label=\"Grade\"\n value={grade}\n options={grades}\n shape=\"borderLess\"\n onChange={handleGradeChange}\n theme=\"dark\"\n />\n <SelectInput\n renderAs=\"primary\"\n label=\"Curriculum\"\n value={curriculum}\n options={curriculumStandards}\n shape=\"borderLess\"\n renderOptionsAs=\"section-list\"\n theme=\"dark\"\n onChange={handleCurriculumChange}\n />\n </Styled.InformationWrapper>\n </Styled.StudentInfoWrapper>\n </Styled.Container>\n );\n});\n\nexport default StudentInformation;\n"],"names":["StudentInformation","memo","formData","milestoneConfig","updateSlideConfig","updateButtonState","trialHomeData","useTrialSessionContext","name","grade","curriculum","grades","getGradesFromConfig","demoInfo","stream","regionData","countryCode","curriculumStandards","getCategorizedCurriculumStandards","GOAL_CATEGORY","hasRequiredFields","updateStudentInformation","useCallback","key","value","handleNameChange","event","handleGradeChange","handleCurriculumChange","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.StudentInfoWrapper","Styled.ImageWrapper","Image","ILLUSTRATIONS","Styled.InformationWrapper","TextInput","SearchableSelectInput","SelectInput"],"mappings":";;;;;;;;;;;;;;AAeM,MAAAA,KAAqBC,EAAK,MAAM;AACpC,QAAM,EAAE,UAAAC,GAAU,iBAAAC,GAAiB,mBAAAC,GAAmB,mBAAAC,GAAmB,eAAAC,EAAA,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A;AAAA,sBACZC,GAAA,EAA0B,aAAY,UAAS,cAAa,cAC3D,UAAA;AAAA,MAAA,gBAAAH,EAACI,GAAA,EACC,UAAA,gBAAAJ,EAACK,KAAM,YAAY,IAAO,KAAKC,EAAc,WAAW,OAAO,KAAK,QAAQ,GAAI,CAAA,GAClF;AAAA,MACA,gBAAAR,EAACS,GAAA,EAA0B,WAAW,MAAM,aAAY,WAAU,cAAa,cAC7E,UAAA;AAAA,QAAA,gBAAAP;AAAA,UAACQ;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAOhC;AAAA,YACP,MAAK;AAAA,YACL,MAAK;AAAA,YACL,OAAM;AAAA,YACN,UAAUiB;AAAA,UAAA;AAAA,QACZ;AAAA,QACA,gBAAAO;AAAA,UAACS;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAOhC;AAAA,YACP,SAASE;AAAA,YACT,OAAM;AAAA,YACN,UAAUgB;AAAA,YACV,OAAM;AAAA,UAAA;AAAA,QACR;AAAA,QACA,gBAAAK;AAAA,UAACU;AAAA,UAAA;AAAA,YACC,UAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAOhC;AAAA,YACP,SAASO;AAAA,YACT,OAAM;AAAA,YACN,iBAAgB;AAAA,YAChB,OAAM;AAAA,YACN,UAAUW;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA,GACF;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -1,49 +1,52 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { memo as
|
3
|
-
import { GIF as
|
1
|
+
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
2
|
+
import { memo as y, useMemo as $, useCallback as b } from "react";
|
3
|
+
import { GIF as G } from "../../../../assets/gif/gif.js";
|
4
4
|
import { GOAL_CATEGORY as r } from "../../../milestone/constants.js";
|
5
|
-
import { getGoalsFromConfig as
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import { epochTimestampAfterOneYear as
|
11
|
-
import { useTrialSessionContext as
|
12
|
-
import { updateGoalInFormData as
|
13
|
-
import
|
14
|
-
import { Container as
|
15
|
-
const
|
16
|
-
const { milestoneConfig:
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
5
|
+
import { getGoalsFromConfig as I } from "../../../milestone/create/milestone-create-helpers.js";
|
6
|
+
import x from "../../../ui/image/image.js";
|
7
|
+
import L from "../../../ui/inputs/searchable-select-input/searchable-select-input.js";
|
8
|
+
import p from "../../../ui/separator/separator.js";
|
9
|
+
import A from "../../../ui/text/text.js";
|
10
|
+
import { epochTimestampAfterOneYear as R } from "../../../utils/utils.js";
|
11
|
+
import { useTrialSessionContext as D } from "../../context/use-trial-session-context.js";
|
12
|
+
import { updateGoalInFormData as j } from "../../helper.js";
|
13
|
+
import k from "../slide-header/index.js";
|
14
|
+
import { Container as O, ContentWrapper as w, ImageWrapper as F, InputContainer as N } from "./test-prep-styled.js";
|
15
|
+
const Z = y(() => {
|
16
|
+
const { milestoneConfig: n, formData: c, updateSlideConfig: a, trialHomeData: d } = D(), { demo_info: f } = d, { stream: i, region_data: g } = f || {}, { opportunity_country: m = "US" } = g || {}, { grade: s, goals: e } = c || {}, u = $(
|
17
|
+
() => I(n, {
|
18
|
+
countryCode: m,
|
19
|
+
grade: s ?? "",
|
20
|
+
goalCategory: r.TEST_PREP,
|
21
|
+
courseStream: i,
|
22
|
+
enrollmentType: "ONLINE"
|
23
|
+
}),
|
24
|
+
[m, s, n, i]
|
25
|
+
), { goal_code: h } = (e == null ? void 0 : e.find((t) => t.goal_category === r.TEST_PREP)) ?? {}, T = b(
|
26
|
+
(t, _) => {
|
24
27
|
if (!t) {
|
25
|
-
const
|
26
|
-
(
|
28
|
+
const E = e == null ? void 0 : e.filter(
|
29
|
+
(P) => P.goal_category !== r.TEST_PREP
|
27
30
|
);
|
28
|
-
a({ goals:
|
31
|
+
a({ goals: E });
|
29
32
|
return;
|
30
33
|
}
|
31
|
-
const { label:
|
34
|
+
const { label: C } = _, S = j(e, r.TEST_PREP, {
|
32
35
|
goal_code: t,
|
33
|
-
milestone_name:
|
34
|
-
milestone_date_ts:
|
36
|
+
milestone_name: C,
|
37
|
+
milestone_date_ts: R()
|
35
38
|
});
|
36
|
-
a({ goals:
|
39
|
+
a({ goals: S });
|
37
40
|
},
|
38
41
|
[e, a]
|
39
42
|
);
|
40
|
-
return /* @__PURE__ */
|
41
|
-
/* @__PURE__ */ o(
|
42
|
-
/* @__PURE__ */ o(
|
43
|
-
/* @__PURE__ */
|
44
|
-
/* @__PURE__ */ o(
|
43
|
+
return /* @__PURE__ */ l(O, { children: [
|
44
|
+
/* @__PURE__ */ o(p, { height: 60 }),
|
45
|
+
/* @__PURE__ */ o(k, {}),
|
46
|
+
/* @__PURE__ */ l(w, { $flexDirection: "row", $justifyContent: "center", children: [
|
47
|
+
/* @__PURE__ */ o(F, { children: /* @__PURE__ */ o(x, { withLoader: !0, height: 402, width: 302, src: G.TEST_PREP, className: "image" }) }),
|
45
48
|
/* @__PURE__ */ o(
|
46
|
-
|
49
|
+
N,
|
47
50
|
{
|
48
51
|
$flexGap: 40,
|
49
52
|
$justifyContent: "center",
|
@@ -52,26 +55,26 @@ const M = E(() => {
|
|
52
55
|
$gapX: 2.5,
|
53
56
|
$gutterX: 2.5,
|
54
57
|
children: /* @__PURE__ */ o(
|
55
|
-
|
58
|
+
L,
|
56
59
|
{
|
57
60
|
renderAs: "primary",
|
58
61
|
label: "Select a Test",
|
59
|
-
value:
|
60
|
-
options:
|
62
|
+
value: h,
|
63
|
+
options: u,
|
61
64
|
shape: "borderLess",
|
62
65
|
theme: "dark",
|
63
|
-
onChange:
|
66
|
+
onChange: T,
|
64
67
|
isTransparent: !0
|
65
68
|
}
|
66
69
|
)
|
67
70
|
}
|
68
71
|
)
|
69
72
|
] }),
|
70
|
-
/* @__PURE__ */ o(
|
71
|
-
/* @__PURE__ */ o(
|
73
|
+
/* @__PURE__ */ o(p, { heightX: 1 }),
|
74
|
+
/* @__PURE__ */ o(A, { $renderAs: "ub3", $align: "center", children: "This is optional and can be skipped." })
|
72
75
|
] });
|
73
76
|
});
|
74
77
|
export {
|
75
|
-
|
78
|
+
Z as default
|
76
79
|
};
|
77
80
|
//# sourceMappingURL=test-prep.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"test-prep.js","sources":["../../../../../src/features/trial-session/comps/test-prep/test-prep.tsx"],"sourcesContent":["import type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\n\nimport { memo, useCallback } from 'react';\n\nimport { GIF } from '../../../../assets/gif/gif';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getGoalsFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { updateGoalInFormData } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './test-prep-styled';\n\nconst TestPrep = memo(() => {\n const { milestoneConfig, formData, updateSlideConfig, trialHomeData } = useTrialSessionContext();\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream } = demoInfo || {};\n const { grade, goals } = formData || {};\n const goalsList = getGoalsFromConfig(milestoneConfig, {\n
|
1
|
+
{"version":3,"file":"test-prep.js","sources":["../../../../../src/features/trial-session/comps/test-prep/test-prep.tsx"],"sourcesContent":["import type { ISelectOption } from '../../../ui/inputs/base-select-input/base-select-input-types';\n\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { GIF } from '../../../../assets/gif/gif';\nimport { GOAL_CATEGORY } from '../../../milestone/constants';\nimport { getGoalsFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport SearchableSelectInput from '../../../ui/inputs/searchable-select-input/searchable-select-input';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { epochTimestampAfterOneYear } from '../../../utils/utils';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { updateGoalInFormData } from '../../helper';\nimport SlideHeader from '../slide-header';\nimport * as Styled from './test-prep-styled';\n\nconst TestPrep = memo(() => {\n const { milestoneConfig, formData, updateSlideConfig, trialHomeData } = useTrialSessionContext();\n\n const { demo_info: demoInfo } = trialHomeData;\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n const { grade, goals } = formData || {};\n\n const goalsList = useMemo(\n () =>\n getGoalsFromConfig(milestoneConfig, {\n countryCode,\n grade: grade ?? '',\n goalCategory: GOAL_CATEGORY.TEST_PREP,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n }),\n [countryCode, grade, milestoneConfig, stream],\n );\n\n const { goal_code: selectedGoal } =\n goals?.find(goal => goal.goal_category === GOAL_CATEGORY.TEST_PREP) ?? {};\n\n const handleGoalChange = useCallback(\n (value: string, option: ISelectOption<string | number>) => {\n if (!value) {\n const goalsWithoutTestPrep = goals?.filter(\n goal => goal.goal_category !== GOAL_CATEGORY.TEST_PREP,\n );\n\n updateSlideConfig({ goals: goalsWithoutTestPrep });\n\n return;\n }\n\n const { label } = option;\n\n const updatedGoals = updateGoalInFormData(goals, GOAL_CATEGORY.TEST_PREP, {\n goal_code: value,\n milestone_name: label,\n milestone_date_ts: epochTimestampAfterOneYear(),\n });\n\n updateSlideConfig({ goals: updatedGoals });\n },\n [goals, updateSlideConfig],\n );\n\n return (\n <Styled.Container>\n <Separator height={60} />\n <SlideHeader />\n <Styled.ContentWrapper $flexDirection=\"row\" $justifyContent=\"center\">\n <Styled.ImageWrapper>\n <Image withLoader height={402} width={302} src={GIF.TEST_PREP} className=\"image\" />\n </Styled.ImageWrapper>\n <Styled.InputContainer\n $flexGap={40}\n $justifyContent=\"center\"\n $background=\"BLUE_1\"\n $borderColor=\"BLACK_1\"\n $gapX={2.5}\n $gutterX={2.5}\n >\n <SearchableSelectInput\n renderAs=\"primary\"\n label=\"Select a Test\"\n value={selectedGoal}\n options={goalsList}\n shape=\"borderLess\"\n theme=\"dark\"\n onChange={handleGoalChange}\n isTransparent\n />\n </Styled.InputContainer>\n </Styled.ContentWrapper>\n <Separator heightX={1} />\n <Text $renderAs=\"ub3\" $align=\"center\">\n This is optional and can be skipped.\n </Text>\n </Styled.Container>\n );\n});\n\nexport default TestPrep;\n"],"names":["TestPrep","memo","milestoneConfig","formData","updateSlideConfig","trialHomeData","useTrialSessionContext","demoInfo","stream","regionData","countryCode","grade","goals","goalsList","useMemo","getGoalsFromConfig","GOAL_CATEGORY","selectedGoal","goal","handleGoalChange","useCallback","value","option","goalsWithoutTestPrep","label","updatedGoals","updateGoalInFormData","epochTimestampAfterOneYear","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.ContentWrapper","Styled.ImageWrapper","Image","GIF","Styled.InputContainer","SearchableSelectInput","Text"],"mappings":";;;;;;;;;;;;;;AAiBM,MAAAA,IAAWC,EAAK,MAAM;AAC1B,QAAM,EAAE,iBAAAC,GAAiB,UAAAC,GAAU,mBAAAC,GAAmB,eAAAC,EAAA,IAAkBC,KAElE,EAAE,WAAWC,EAAa,IAAAF,GAC1B,EAAE,QAAAG,GAAQ,aAAaC,EAAW,IAAIF,KAAY,CAAA,GAClD,EAAE,qBAAqBG,IAAc,KAAK,IAAID,KAAc,CAAA,GAC5D,EAAE,OAAAE,GAAO,OAAAC,MAAUT,KAAY,CAAA,GAE/BU,IAAYC;AAAA,IAChB,MACEC,EAAmBb,GAAiB;AAAA,MAClC,aAAAQ;AAAA,MACA,OAAOC,KAAS;AAAA,MAChB,cAAcK,EAAc;AAAA,MAC5B,cAAcR;AAAA,MACd,gBAAgB;AAAA,IAAA,CACjB;AAAA,IAC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ACT,OAAM;AAAA,cACN,OAAOrB;AAAA,cACP,SAASJ;AAAA,cACT,OAAM;AAAA,cACN,OAAM;AAAA,cACN,UAAUM;AAAA,cACV,eAAa;AAAA,YAAA;AAAA,UACf;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,IACA,gBAAAW,EAACC,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,sBACtBQ,GAAK,EAAA,WAAU,OAAM,QAAO,UAAS,UAEtC,wCAAA;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
@@ -1,30 +1,30 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { useState as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import { useResumeTrialWorksheet as
|
6
|
-
import { useTrialSessionContext as
|
7
|
-
const
|
8
|
-
const { isTeacher: o, studentId:
|
9
|
-
if (
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
2
|
+
import { useState as S, useCallback as T, useEffect as k } from "react";
|
3
|
+
import x from "../../../ui/error/error.js";
|
4
|
+
import E from "../../../ui/loader/app-loader/app-loader.js";
|
5
|
+
import { useResumeTrialWorksheet as A } from "../../api/trial-nodes.js";
|
6
|
+
import { useTrialSessionContext as D } from "../../context/use-trial-session-context.js";
|
7
|
+
const L = () => {
|
8
|
+
const { isTeacher: o, studentId: t, worksheet: r, updateSlideConfig: u, trialHomeData: c } = D(), [f, s] = S(!1), { demo_info: m } = c, { region_data: p } = m || {}, { opportunity_country: n = "US" } = p || {}, l = (h, d) => {
|
9
|
+
if (h && s(!0), d) {
|
10
10
|
const {
|
11
|
-
user_node_id:
|
12
|
-
node_id:
|
13
|
-
user_attempt_id:
|
14
|
-
node_type:
|
15
|
-
} =
|
16
|
-
|
11
|
+
user_node_id: g,
|
12
|
+
node_id: y,
|
13
|
+
user_attempt_id: I,
|
14
|
+
node_type: C
|
15
|
+
} = d;
|
16
|
+
u({ userNodeId: g, nodeId: y, attemptId: I, nodeType: C });
|
17
17
|
}
|
18
|
-
}, { patch: i, isProcessing:
|
19
|
-
onComplete:
|
20
|
-
}), e =
|
21
|
-
o && (s(!1), i(
|
22
|
-
}, [o, i,
|
23
|
-
return
|
18
|
+
}, { patch: i, isProcessing: _ } = A({
|
19
|
+
onComplete: l
|
20
|
+
}), e = T(() => {
|
21
|
+
o && (s(!1), i(t, { country_code: n }));
|
22
|
+
}, [n, o, i, t]);
|
23
|
+
return k(() => {
|
24
24
|
e();
|
25
|
-
}, [e]),
|
25
|
+
}, [e]), f ? /* @__PURE__ */ a(x, { height: "100%", onTryAgain: e }) : _ || !r ? /* @__PURE__ */ a(E, { height: "100%" }) : r;
|
26
26
|
};
|
27
27
|
export {
|
28
|
-
|
28
|
+
L as default
|
29
29
|
};
|
30
30
|
//# sourceMappingURL=worksheet.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"worksheet.js","sources":["../../../../../src/features/trial-session/comps/worksheet/worksheet.tsx"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport Error from '../../../ui/error/error';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport { useResumeTrialWorksheet } from '../../api/trial-nodes';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\n\nconst SessionWorksheet: FC = () => {\n const { isTeacher, studentId, worksheet, updateSlideConfig }
|
1
|
+
{"version":3,"file":"worksheet.js","sources":["../../../../../src/features/trial-session/comps/worksheet/worksheet.tsx"],"sourcesContent":["import type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport type { FC } from 'react';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport Error from '../../../ui/error/error';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport { useResumeTrialWorksheet } from '../../api/trial-nodes';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\n\nconst SessionWorksheet: FC = () => {\n const { isTeacher, studentId, worksheet, updateSlideConfig, trialHomeData } =\n useTrialSessionContext();\n const [isError, setIserror] = useState<boolean>(false);\n\n const { demo_info: demoInfo } = trialHomeData;\n const { region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const onComplete = (error: string | null, sheetData?: IResumeWorksheetModel) => {\n if (error) {\n setIserror(true);\n }\n\n if (sheetData) {\n const {\n user_node_id: userNodeId,\n node_id: nodeId,\n user_attempt_id: attemptId,\n node_type: nodeType,\n } = sheetData;\n\n updateSlideConfig({ userNodeId, nodeId, attemptId, nodeType });\n }\n };\n\n const { patch: resumeNode, isProcessing } = useResumeTrialWorksheet({\n onComplete,\n });\n\n const fetchData = useCallback(() => {\n if (isTeacher) {\n setIserror(false);\n resumeNode(studentId, { country_code: countryCode });\n }\n }, [countryCode, isTeacher, resumeNode, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isError) {\n return <Error height=\"100%\" onTryAgain={fetchData} />;\n }\n\n if (isProcessing || !worksheet) {\n return <AppLoader height=\"100%\" />;\n }\n\n return worksheet;\n};\n\nexport default SessionWorksheet;\n"],"names":["SessionWorksheet","isTeacher","studentId","worksheet","updateSlideConfig","trialHomeData","useTrialSessionContext","isError","setIserror","useState","demoInfo","regionData","countryCode","onComplete","error","sheetData","userNodeId","nodeId","attemptId","nodeType","resumeNode","isProcessing","useResumeTrialWorksheet","fetchData","useCallback","useEffect","jsx","Error","AppLoader"],"mappings":";;;;;;AAUA,MAAMA,IAAuB,MAAM;AACjC,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,WAAAC,GAAW,mBAAAC,GAAmB,eAAAC,EAAA,IAC1DC,KACI,CAACC,GAASC,CAAU,IAAIC,EAAkB,EAAK,GAE/C,EAAE,WAAWC,EAAa,IAAAL,GAC1B,EAAE,aAAaM,MAAeD,KAAY,CAAA,GAC1C,EAAE,qBAAqBE,IAAc,KAAK,IAAID,KAAc,CAAA,GAE5DE,IAAa,CAACC,GAAsBC,MAAsC;AAK9E,QAJID,KACFN,EAAW,EAAI,GAGbO,GAAW;AACP,YAAA;AAAA,QACJ,cAAcC;AAAA,QACd,SAASC;AAAA,QACT,iBAAiBC;AAAA,QACjB,WAAWC;AAAA,MACT,IAAAJ;AAEJ,MAAAX,EAAkB,EAAE,YAAAY,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,EAAU,CAAA;AAAA,IAC/D;AAAA,EAAA,GAGI,EAAE,OAAOC,GAAY,cAAAC,EAAA,IAAiBC,EAAwB;AAAA,IAClE,YAAAT;AAAA,EAAA,CACD,GAEKU,IAAYC,EAAY,MAAM;AAClC,IAAIvB,MACFO,EAAW,EAAK,GAChBY,EAAWlB,GAAW,EAAE,cAAcU,EAAa,CAAA;AAAA,KAEpD,CAACA,GAAaX,GAAWmB,GAAYlB,CAAS,CAAC;AAMlD,SAJAuB,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEVhB,IACM,gBAAAmB,EAAAC,GAAA,EAAM,QAAO,QAAO,YAAYJ,EAAW,CAAA,IAGjDF,KAAgB,CAAClB,IACZ,gBAAAuB,EAACE,GAAU,EAAA,QAAO,OAAO,CAAA,IAG3BzB;AACT;"}
|
@@ -1,80 +1,80 @@
|
|
1
|
-
import { DAYS as
|
2
|
-
import { getOffsetBetweenTimezone as
|
3
|
-
import { GOAL_CATEGORY as
|
4
|
-
import { getGoalsFromConfig as
|
5
|
-
import { TrialPageId as
|
6
|
-
const
|
7
|
-
const e =
|
8
|
-
if (
|
9
|
-
const
|
10
|
-
...
|
1
|
+
import { DAYS as N } from "../../constants/date-time.js";
|
2
|
+
import { getOffsetBetweenTimezone as y, convertEpochToDateTime as O, getTimeUnits as x, convertToMilliseconds as D } from "../../helpers/date-time.js";
|
3
|
+
import { GOAL_CATEGORY as h } from "../milestone/constants.js";
|
4
|
+
import { getGoalsFromConfig as R } from "../milestone/create/milestone-create-helpers.js";
|
5
|
+
import { TrialPageId as a, TEACHER_TIMEZONE as L } from "./trial-session-constants.js";
|
6
|
+
const U = (c, t, r) => {
|
7
|
+
const e = c ? [...c] : [], s = e == null ? void 0 : e.findIndex((d) => d.goal_category === t);
|
8
|
+
if (s === -1) {
|
9
|
+
const d = {
|
10
|
+
...r,
|
11
11
|
goal_category: t,
|
12
12
|
publish: !1
|
13
13
|
};
|
14
|
-
e.push(
|
14
|
+
e.push(d);
|
15
15
|
} else
|
16
|
-
e[
|
17
|
-
...e[
|
18
|
-
...
|
16
|
+
e[s] = {
|
17
|
+
...e[s],
|
18
|
+
...r
|
19
19
|
};
|
20
20
|
return e;
|
21
|
-
},
|
21
|
+
}, $ = (c, t) => {
|
22
22
|
if (!t) return [];
|
23
|
-
const
|
24
|
-
return
|
25
|
-
const { selectedDay:
|
23
|
+
const r = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0), e = y(L, t), s = r + e, { day: d = "" } = O(s, t), m = N.indexOf(d);
|
24
|
+
return c.length > 0 ? c.filter((f) => f.selectedDay && f.selectedTime).map((f) => {
|
25
|
+
const { selectedDay: P, selectedTime: u } = f, { hours: i, minutes: o, period: g } = x(u), T = (N.indexOf(P) - m + 7) % 7;
|
26
26
|
return {
|
27
|
-
id:
|
28
|
-
value: `${
|
27
|
+
id: r + e + D({ days: T, hours: i, minutes: o }),
|
28
|
+
value: `${P}, ${u} - ${i + 1}:${o < 10 ? "0" : ""}${o} ${g}`
|
29
29
|
// Formatted the value string as required
|
30
30
|
};
|
31
31
|
}) : [];
|
32
|
-
},
|
33
|
-
milestoneConfigData:
|
32
|
+
}, b = ({
|
33
|
+
milestoneConfigData: c,
|
34
34
|
trialHomeData: t,
|
35
|
-
grade:
|
35
|
+
grade: r
|
36
36
|
}) => {
|
37
|
-
var
|
38
|
-
const { student: e, demo_info:
|
39
|
-
countryCode:
|
40
|
-
grade:
|
41
|
-
goalCategory:
|
42
|
-
courseStream:
|
37
|
+
var I;
|
38
|
+
const { student: e, demo_info: s } = t, { grade: d } = e || {}, { stream: m, region_data: f } = s || {}, { opportunity_country: P = "US" } = f || {}, u = (l) => R(c, {
|
39
|
+
countryCode: P,
|
40
|
+
grade: r || d || "",
|
41
|
+
goalCategory: l,
|
42
|
+
courseStream: m,
|
43
43
|
enrollmentType: "ONLINE"
|
44
|
-
}),
|
45
|
-
if ((
|
44
|
+
}), i = u(h.TEST_PREP), o = u(h.ENRICHMENT);
|
45
|
+
if ((i == null ? void 0 : i.length) > 0 && (o == null ? void 0 : o.length) > 0)
|
46
46
|
return t;
|
47
|
-
const
|
48
|
-
var
|
49
|
-
return ((
|
50
|
-
})(),
|
51
|
-
if (
|
52
|
-
const
|
53
|
-
|
47
|
+
const g = { ...t }, p = Object.fromEntries(g.pages.map((l) => [l.id, l])), T = (() => {
|
48
|
+
var l, _, n, E;
|
49
|
+
return ((_ = (l = p[a.SCHOOL_GOALS]) == null ? void 0 : l.nextPage) == null ? void 0 : _.pageId) === a.TEST_PREP && i.length === 0 ? a.SCHOOL_GOALS : i.length > 0 && ((E = (n = p[a.TEST_PREP]) == null ? void 0 : n.nextPage) == null ? void 0 : E.pageId) === a.STUDENT_ENRICHMENT && o.length === 0 ? a.TEST_PREP : null;
|
50
|
+
})(), S = T ? (I = p[(o == null ? void 0 : o.length) === 0 ? a.STUDENT_ENRICHMENT : a.TEST_PREP]) == null ? void 0 : I.nextPage : null;
|
51
|
+
if (S && T) {
|
52
|
+
const l = (n) => i.length === 0 && n === a.TEST_PREP || o.length === 0 && n === a.STUDENT_ENRICHMENT, _ = g.pages.filter((n) => !l(n.id));
|
53
|
+
g.pages = _.map((n) => {
|
54
54
|
var E;
|
55
|
-
return n.id ===
|
55
|
+
return n.id === T ? { ...n, nextPage: S } : n.id === S.pageId ? {
|
56
56
|
...n,
|
57
57
|
prevPage: {
|
58
|
-
buttonLabel: ((E = T
|
59
|
-
pageId:
|
58
|
+
buttonLabel: ((E = p[T]) == null ? void 0 : E.navigationLabel) ?? "",
|
59
|
+
pageId: T
|
60
60
|
}
|
61
61
|
} : n;
|
62
62
|
});
|
63
63
|
}
|
64
|
-
return
|
65
|
-
},
|
64
|
+
return g;
|
65
|
+
}, F = (c, t) => {
|
66
66
|
var e;
|
67
|
-
const { preference_config:
|
68
|
-
return t.length > 0 ? ((e =
|
69
|
-
preference_code:
|
70
|
-
preference_name:
|
71
|
-
preference_category:
|
67
|
+
const { preference_config: r } = c;
|
68
|
+
return t.length > 0 ? ((e = r == null ? void 0 : r.filter((s) => t.includes(s.preference_code))) == null ? void 0 : e.map(({ preference_code: s, preference_name: d, preference_category: m }) => ({
|
69
|
+
preference_code: s,
|
70
|
+
preference_name: d,
|
71
|
+
preference_category: m
|
72
72
|
}))) || [] : [];
|
73
73
|
};
|
74
74
|
export {
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
75
|
+
b as filterAndUpdateSlideNavigation,
|
76
|
+
$ as getFormattedPreferences,
|
77
|
+
F as getFormattedStudentPersonalizedPreference,
|
78
|
+
U as updateGoalInFormData
|
79
79
|
};
|
80
80
|
//# sourceMappingURL=helper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helper.js","sources":["../../../src/features/trial-session/helper.ts"],"sourcesContent":["import type { IMilestoneConfig } from '../milestone/create/milestone-create-types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type { ITrialHomeData, TGoals } from './trial-session-types';\n\nimport { DAYS } from '../../constants/date-time';\nimport {\n convertEpochToDateTime,\n convertToMilliseconds,\n getOffsetBetweenTimezone,\n getTimeUnits,\n} from '../../helpers/date-time';\nimport { GOAL_CATEGORY } from '../milestone/constants';\nimport { getGoalsFromConfig } from '../milestone/create/milestone-create-helpers';\nimport { TEACHER_TIMEZONE, TrialPageId } from './trial-session-constants';\n\nconst updateGoalInFormData = (goals: TGoals[] | undefined, goalCategory: string, data: TGoals) => {\n const updateGoals = goals ? [...goals] : [];\n const goalIndex = updateGoals?.findIndex(goal => goal.goal_category === goalCategory);\n\n if (goalIndex === -1) {\n const schoolSuccessGoal = {\n ...data,\n goal_category: goalCategory,\n publish: false,\n };\n\n updateGoals.push(schoolSuccessGoal);\n } else {\n updateGoals[goalIndex] = {\n ...updateGoals[goalIndex],\n ...data,\n };\n }\n\n return updateGoals;\n};\n\nconst getFormattedPreferences = (preferences: TPreference[], studentTimezone?: string) => {\n if (!studentTimezone) return [];\n\n const todayTimestamp = new Date().setHours(0, 0, 0, 0); // Set the current date to midnight.\n const timestampOffset = getOffsetBetweenTimezone(TEACHER_TIMEZONE, studentTimezone); // Offset between the teacher's and student's timezone.\n const studentTimestamp = todayTimestamp + timestampOffset; // Adjusting the current date to the student's timezone.\n const { day: today = '' } = convertEpochToDateTime(studentTimestamp, studentTimezone); // Current day at student's timezone.\n const currentDayIndex = DAYS.indexOf(today); // Current day index.\n\n return preferences.length > 0\n ? preferences\n .filter(preference => preference.selectedDay && preference.selectedTime)\n .map(preference => {\n const { selectedDay, selectedTime } = preference;\n // Extracting hours, minutes, and period from the selected time.\n const { hours, minutes, period } = getTimeUnits(selectedTime);\n\n // Calculating the index of the selected day in the DAYS array.\n const selectedDayIndex = DAYS.indexOf(selectedDay);\n const dayDifference = (selectedDayIndex - currentDayIndex + 7) % 7;\n\n // Calculate the epoch timestamp for the selected day and time in the student's timezone.\n const epochTimestamp =\n todayTimestamp +\n timestampOffset +\n convertToMilliseconds({ days: dayDifference, hours, minutes });\n\n return {\n id: epochTimestamp,\n value: `${selectedDay}, ${selectedTime} - ${hours + 1}:${\n minutes < 10 ? '0' : ''\n }${minutes} ${period}`, // Formatted the value string as required\n };\n })\n : [];\n};\n\nconst filterAndUpdateSlideNavigation = ({\n milestoneConfigData,\n trialHomeData,\n grade,\n}: {\n milestoneConfigData: IMilestoneConfig;\n trialHomeData: ITrialHomeData;\n grade?: string;\n}) => {\n const { student, demo_info: demoInfo } = trialHomeData;\n const { grade: studentGrade } = student || {};\n const { stream } = demoInfo || {};\n\n const getGoals = (goalCategory: keyof typeof GOAL_CATEGORY) =>\n getGoalsFromConfig(milestoneConfigData, {\n countryCode: 'US',\n grade: grade || studentGrade || '',\n goalCategory,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n });\n\n const testPrepGoals = getGoals(GOAL_CATEGORY.TEST_PREP);\n const enrichmentGoals = getGoals(GOAL_CATEGORY.ENRICHMENT);\n\n if (testPrepGoals?.length > 0 && enrichmentGoals?.length > 0) {\n return trialHomeData;\n }\n\n const updatedTrialHomeData = { ...trialHomeData };\n\n const pagesMap = Object.fromEntries(updatedTrialHomeData.pages.map(page => [page.id, page]));\n\n //slide whose nextPage reference needs to be updated\n const slideIdToUpdate = (() => {\n if (\n pagesMap[TrialPageId.SCHOOL_GOALS]?.nextPage?.pageId === TrialPageId.TEST_PREP &&\n testPrepGoals.length === 0\n ) {\n return TrialPageId.SCHOOL_GOALS;\n }\n\n if (\n testPrepGoals.length > 0 &&\n pagesMap[TrialPageId.TEST_PREP]?.nextPage?.pageId === TrialPageId.STUDENT_ENRICHMENT &&\n enrichmentGoals.length === 0\n ) {\n return TrialPageId.TEST_PREP;\n }\n\n return null;\n })();\n\n // the new next page reference for slideIdToUpdate\n const updatedNextPageInfo = slideIdToUpdate\n ? pagesMap[\n enrichmentGoals?.length === 0 ? TrialPageId.STUDENT_ENRICHMENT : TrialPageId.TEST_PREP\n ]?.nextPage\n : null;\n\n // updating the nextPage and prevPage references\n if (updatedNextPageInfo && slideIdToUpdate) {\n const shouldRemoveSlide = (slideId: TrialPageId) =>\n (testPrepGoals.length === 0 && slideId === TrialPageId.TEST_PREP) ||\n (enrichmentGoals.length === 0 && slideId === TrialPageId.STUDENT_ENRICHMENT);\n\n const filteredSlides = updatedTrialHomeData.pages.filter(page => !shouldRemoveSlide(page.id));\n\n updatedTrialHomeData.pages = filteredSlides.map(page => {\n if (page.id === slideIdToUpdate) {\n return { ...page, nextPage: updatedNextPageInfo };\n }\n\n if (page.id === updatedNextPageInfo.pageId) {\n return {\n ...page,\n prevPage: {\n buttonLabel: pagesMap[slideIdToUpdate]?.navigationLabel ?? '',\n pageId: slideIdToUpdate,\n },\n };\n }\n\n return page;\n });\n }\n\n return updatedTrialHomeData;\n};\n\nconst getFormattedStudentPersonalizedPreference = (\n config: IMilestoneConfig,\n selectedCodes: string[],\n) => {\n const { preference_config: preferenceConfig } = config;\n\n if (selectedCodes.length > 0) {\n return (\n preferenceConfig\n ?.filter(pref => selectedCodes.includes(pref.preference_code))\n ?.map(({ preference_code, preference_name, preference_category }) => ({\n preference_code,\n preference_name,\n preference_category,\n })) || []\n );\n }\n\n return [];\n};\n\nexport {\n filterAndUpdateSlideNavigation,\n updateGoalInFormData,\n getFormattedPreferences,\n getFormattedStudentPersonalizedPreference,\n};\n"],"names":["updateGoalInFormData","goals","goalCategory","data","updateGoals","goalIndex","goal","schoolSuccessGoal","getFormattedPreferences","preferences","studentTimezone","todayTimestamp","timestampOffset","getOffsetBetweenTimezone","TEACHER_TIMEZONE","studentTimestamp","today","convertEpochToDateTime","currentDayIndex","DAYS","preference","selectedDay","selectedTime","hours","minutes","period","getTimeUnits","dayDifference","convertToMilliseconds","filterAndUpdateSlideNavigation","milestoneConfigData","trialHomeData","grade","student","demoInfo","studentGrade","stream","getGoals","getGoalsFromConfig","testPrepGoals","GOAL_CATEGORY","enrichmentGoals","updatedTrialHomeData","pagesMap","page","slideIdToUpdate","_b","_a","TrialPageId","_d","_c","updatedNextPageInfo","shouldRemoveSlide","slideId","filteredSlides","getFormattedStudentPersonalizedPreference","config","selectedCodes","preferenceConfig","pref","preference_code","preference_name","preference_category"],"mappings":";;;;;AAeA,MAAMA,IAAuB,CAACC,GAA6BC,GAAsBC,MAAiB;AAChG,QAAMC,IAAcH,IAAQ,CAAC,GAAGA,CAAK,IAAI,CAAA,GACnCI,IAAYD,KAAA,gBAAAA,EAAa,UAAU,CAAQE,MAAAA,EAAK,kBAAkBJ;AAExE,MAAIG,MAAc,IAAI;AACpB,UAAME,IAAoB;AAAA,MACxB,GAAGJ;AAAA,MACH,eAAeD;AAAA,MACf,SAAS;AAAA,IAAA;AAGX,IAAAE,EAAY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UO,EAAoB,IAG9CP,EAAK,OAAOO,EAAoB,SAC3B;AAAA,QACL,GAAGP;AAAA,QACH,UAAU;AAAA,UACR,eAAaG,IAAAJ,EAASE,CAAe,MAAxB,gBAAAE,EAA2B,oBAAmB;AAAA,UAC3D,QAAQF;AAAA,QACV;AAAA,MAAA,IAIGD;AAAA,IAAA,CACR;AAAA,EACH;AAEO,SAAAF;AACT,GAEMa,IAA4C,CAChDC,GACAC,MACG;;AACG,QAAA,EAAE,mBAAmBC,EAAqB,IAAAF;AAE5C,SAAAC,EAAc,SAAS,MAEvBV,IAAAW,KAAA,gBAAAA,EACI,OAAO,CAAQC,MAAAF,EAAc,SAASE,EAAK,eAAe,OAD9D,gBAAAZ,EAEI,IAAI,CAAC,EAAE,iBAAAa,GAAiB,iBAAAC,GAAiB,qBAAAC,SAA2B;AAAA,IACpE,iBAAAF;AAAA,IACA,iBAAAC;AAAA,IACA,qBAAAC;AAAA,EAAA,QACK,CAAA,IAIN;AACT;"}
|
1
|
+
{"version":3,"file":"helper.js","sources":["../../../src/features/trial-session/helper.ts"],"sourcesContent":["import type { IMilestoneConfig } from '../milestone/create/milestone-create-types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type { ITrialHomeData, TGoals } from './trial-session-types';\n\nimport { DAYS } from '../../constants/date-time';\nimport {\n convertEpochToDateTime,\n convertToMilliseconds,\n getOffsetBetweenTimezone,\n getTimeUnits,\n} from '../../helpers/date-time';\nimport { GOAL_CATEGORY } from '../milestone/constants';\nimport { getGoalsFromConfig } from '../milestone/create/milestone-create-helpers';\nimport { TEACHER_TIMEZONE, TrialPageId } from './trial-session-constants';\n\nconst updateGoalInFormData = (goals: TGoals[] | undefined, goalCategory: string, data: TGoals) => {\n const updateGoals = goals ? [...goals] : [];\n const goalIndex = updateGoals?.findIndex(goal => goal.goal_category === goalCategory);\n\n if (goalIndex === -1) {\n const schoolSuccessGoal = {\n ...data,\n goal_category: goalCategory,\n publish: false,\n };\n\n updateGoals.push(schoolSuccessGoal);\n } else {\n updateGoals[goalIndex] = {\n ...updateGoals[goalIndex],\n ...data,\n };\n }\n\n return updateGoals;\n};\n\nconst getFormattedPreferences = (preferences: TPreference[], studentTimezone?: string) => {\n if (!studentTimezone) return [];\n\n const todayTimestamp = new Date().setHours(0, 0, 0, 0); // Set the current date to midnight.\n const timestampOffset = getOffsetBetweenTimezone(TEACHER_TIMEZONE, studentTimezone); // Offset between the teacher's and student's timezone.\n const studentTimestamp = todayTimestamp + timestampOffset; // Adjusting the current date to the student's timezone.\n const { day: today = '' } = convertEpochToDateTime(studentTimestamp, studentTimezone); // Current day at student's timezone.\n const currentDayIndex = DAYS.indexOf(today); // Current day index.\n\n return preferences.length > 0\n ? preferences\n .filter(preference => preference.selectedDay && preference.selectedTime)\n .map(preference => {\n const { selectedDay, selectedTime } = preference;\n // Extracting hours, minutes, and period from the selected time.\n const { hours, minutes, period } = getTimeUnits(selectedTime);\n\n // Calculating the index of the selected day in the DAYS array.\n const selectedDayIndex = DAYS.indexOf(selectedDay);\n const dayDifference = (selectedDayIndex - currentDayIndex + 7) % 7;\n\n // Calculate the epoch timestamp for the selected day and time in the student's timezone.\n const epochTimestamp =\n todayTimestamp +\n timestampOffset +\n convertToMilliseconds({ days: dayDifference, hours, minutes });\n\n return {\n id: epochTimestamp,\n value: `${selectedDay}, ${selectedTime} - ${hours + 1}:${\n minutes < 10 ? '0' : ''\n }${minutes} ${period}`, // Formatted the value string as required\n };\n })\n : [];\n};\n\nconst filterAndUpdateSlideNavigation = ({\n milestoneConfigData,\n trialHomeData,\n grade,\n}: {\n milestoneConfigData: IMilestoneConfig;\n trialHomeData: ITrialHomeData;\n grade?: string;\n}) => {\n const { student, demo_info: demoInfo } = trialHomeData;\n const { grade: studentGrade } = student || {};\n const { stream, region_data: regionData } = demoInfo || {};\n const { opportunity_country: countryCode = 'US' } = regionData || {};\n\n const getGoals = (goalCategory: keyof typeof GOAL_CATEGORY) =>\n getGoalsFromConfig(milestoneConfigData, {\n countryCode,\n grade: grade || studentGrade || '',\n goalCategory,\n courseStream: stream,\n enrollmentType: 'ONLINE',\n });\n\n const testPrepGoals = getGoals(GOAL_CATEGORY.TEST_PREP);\n const enrichmentGoals = getGoals(GOAL_CATEGORY.ENRICHMENT);\n\n if (testPrepGoals?.length > 0 && enrichmentGoals?.length > 0) {\n return trialHomeData;\n }\n\n const updatedTrialHomeData = { ...trialHomeData };\n\n const pagesMap = Object.fromEntries(updatedTrialHomeData.pages.map(page => [page.id, page]));\n\n //slide whose nextPage reference needs to be updated\n const slideIdToUpdate = (() => {\n if (\n pagesMap[TrialPageId.SCHOOL_GOALS]?.nextPage?.pageId === TrialPageId.TEST_PREP &&\n testPrepGoals.length === 0\n ) {\n return TrialPageId.SCHOOL_GOALS;\n }\n\n if (\n testPrepGoals.length > 0 &&\n pagesMap[TrialPageId.TEST_PREP]?.nextPage?.pageId === TrialPageId.STUDENT_ENRICHMENT &&\n enrichmentGoals.length === 0\n ) {\n return TrialPageId.TEST_PREP;\n }\n\n return null;\n })();\n\n // the new next page reference for slideIdToUpdate\n const updatedNextPageInfo = slideIdToUpdate\n ? pagesMap[\n enrichmentGoals?.length === 0 ? TrialPageId.STUDENT_ENRICHMENT : TrialPageId.TEST_PREP\n ]?.nextPage\n : null;\n\n // updating the nextPage and prevPage references\n if (updatedNextPageInfo && slideIdToUpdate) {\n const shouldRemoveSlide = (slideId: TrialPageId) =>\n (testPrepGoals.length === 0 && slideId === TrialPageId.TEST_PREP) ||\n (enrichmentGoals.length === 0 && slideId === TrialPageId.STUDENT_ENRICHMENT);\n\n const filteredSlides = updatedTrialHomeData.pages.filter(page => !shouldRemoveSlide(page.id));\n\n updatedTrialHomeData.pages = filteredSlides.map(page => {\n if (page.id === slideIdToUpdate) {\n return { ...page, nextPage: updatedNextPageInfo };\n }\n\n if (page.id === updatedNextPageInfo.pageId) {\n return {\n ...page,\n prevPage: {\n buttonLabel: pagesMap[slideIdToUpdate]?.navigationLabel ?? '',\n pageId: slideIdToUpdate,\n },\n };\n }\n\n return page;\n });\n }\n\n return updatedTrialHomeData;\n};\n\nconst getFormattedStudentPersonalizedPreference = (\n config: IMilestoneConfig,\n selectedCodes: string[],\n) => {\n const { preference_config: preferenceConfig } = config;\n\n if (selectedCodes.length > 0) {\n return (\n preferenceConfig\n ?.filter(pref => selectedCodes.includes(pref.preference_code))\n ?.map(({ preference_code, preference_name, preference_category }) => ({\n preference_code,\n preference_name,\n preference_category,\n })) || []\n );\n }\n\n return [];\n};\n\nexport {\n filterAndUpdateSlideNavigation,\n updateGoalInFormData,\n getFormattedPreferences,\n getFormattedStudentPersonalizedPreference,\n};\n"],"names":["updateGoalInFormData","goals","goalCategory","data","updateGoals","goalIndex","goal","schoolSuccessGoal","getFormattedPreferences","preferences","studentTimezone","todayTimestamp","timestampOffset","getOffsetBetweenTimezone","TEACHER_TIMEZONE","studentTimestamp","today","convertEpochToDateTime","currentDayIndex","DAYS","preference","selectedDay","selectedTime","hours","minutes","period","getTimeUnits","dayDifference","convertToMilliseconds","filterAndUpdateSlideNavigation","milestoneConfigData","trialHomeData","grade","student","demoInfo","studentGrade","stream","regionData","countryCode","getGoals","getGoalsFromConfig","testPrepGoals","GOAL_CATEGORY","enrichmentGoals","updatedTrialHomeData","pagesMap","page","slideIdToUpdate","_b","_a","TrialPageId","_d","_c","updatedNextPageInfo","shouldRemoveSlide","slideId","filteredSlides","getFormattedStudentPersonalizedPreference","config","selectedCodes","preferenceConfig","pref","preference_code","preference_name","preference_category"],"mappings":";;;;;AAeA,MAAMA,IAAuB,CAACC,GAA6BC,GAAsBC,MAAiB;AAChG,QAAMC,IAAcH,IAAQ,CAAC,GAAGA,CAAK,IAAI,CAAA,GACnCI,IAAYD,KAAA,gBAAAA,EAAa,UAAU,CAAQE,MAAAA,EAAK,kBAAkBJ;AAExE,MAAIG,MAAc,IAAI;AACpB,UAAME,IAAoB;AAAA,MACxB,GAAGJ;AAAA,MACH,eAAeD;AAAA,MACf,SAAS;AAAA,IAAA;AA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AA,QAAQY,EAAe,IAAI,CAAQV,MAAA;;AAClD,aAAAA,EAAK,OAAOC,IACP,EAAE,GAAGD,GAAM,UAAUO,EAAoB,IAG9CP,EAAK,OAAOO,EAAoB,SAC3B;AAAA,QACL,GAAGP;AAAA,QACH,UAAU;AAAA,UACR,eAAaG,IAAAJ,EAASE,CAAe,MAAxB,gBAAAE,EAA2B,oBAAmB;AAAA,UAC3D,QAAQF;AAAA,QACV;AAAA,MAAA,IAIGD;AAAA,IAAA,CACR;AAAA,EACH;AAEO,SAAAF;AACT,GAEMa,IAA4C,CAChDC,GACAC,MACG;;AACG,QAAA,EAAE,mBAAmBC,EAAqB,IAAAF;AAE5C,SAAAC,EAAc,SAAS,MAEvBV,IAAAW,KAAA,gBAAAA,EACI,OAAO,CAAQC,MAAAF,EAAc,SAASE,EAAK,eAAe,OAD9D,gBAAAZ,EAEI,IAAI,CAAC,EAAE,iBAAAa,GAAiB,iBAAAC,GAAiB,qBAAAC,SAA2B;AAAA,IACpE,iBAAAF;AAAA,IACA,iBAAAC;AAAA,IACA,qBAAAC;AAAA,EAAA,QACK,CAAA,IAIN;AACT;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"trial-session-types.js","sources":["../../../src/features/trial-session/trial-session-types.ts"],"sourcesContent":["import type { TNodeTypes } from '../../types/models/worksheet';\nimport type { IInfoMessage } from '../circle-games/games/web-view/web-view-types';\nimport type { IMilestoneConfig, TCourseStream } from '../milestone/create/milestone-create-types';\nimport type { IAvatarLayer } from '../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type {\n ITrialCircleConfig,\n ITrialCircleGameParams,\n} from './comps/trial-circle-game/trial-circle-game-types';\nimport type { TrialPageId } from './trial-session-constants';\nimport type { Dispatch, SetStateAction } from 'react';\n\nexport type TSlideId = TrialPageId;\n\nexport enum EClassTimeAlertLevel {\n FIVE_MIN = '5min',\n FIFTEEN_MIN = '15min',\n}\ninterface IButtonConfig {\n buttonLabel: string;\n pageId: string;\n}\n\nexport interface ISolution {\n media?: string;\n media_type?: 'image' | 'video';\n text?: string;\n}\n\nexport type TDegreeInformation = { degree_name?: string; field_of_study?: string };\n\nexport interface ITeacherProfileDetails {\n lower_grade: string;\n higher_grade: string;\n header_image: string;\n years_of_experience: number;\n number_of_students_taught: number;\n countries: string[];\n degree: TDegreeInformation;\n}\n\nexport interface ISlide {\n id: TrialPageId;\n renderAs: 'split' | 'full';\n renderAVIn: 'left' | 'right';\n header: string;\n subHeader?: string;\n prevPage?: IButtonConfig;\n nextPage?: IButtonConfig;\n cues?: string[];\n dos?: string[];\n donts?: string[];\n navigationLabel?: string;\n slideTag?: string;\n teacher_profile?: ITeacherProfileDetails;\n solutions?: ISolution[];\n enableSessionPerk?: boolean;\n}\n\nexport interface TGoals {\n goal_code?: string;\n milestone_date_ts?: number;\n goal_category?: string;\n milestone_name?: string;\n publish?: boolean;\n}\n\nexport interface ITrialSessionFormFields {\n id: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n goals?: TGoals[];\n studentProfile?: {\n profileSummary?: string;\n dummyProfileImageIndex?: number;\n summaryFetched?: boolean;\n summaryFetchFailed?: boolean;\n };\n userNodeId?: string;\n nodeId?: string;\n nodeType?: TNodeTypes;\n attemptId?: string;\n preferences?: TPreference[];\n personalizedLevel?: string[];\n personalizedFocus?: string[];\n personalizedBehaviors?: string[];\n isCircleGamePlayed?: boolean;\n isCirclePuzzleSolved?: boolean;\n isCircleSkillCompleted?: boolean;\n studentTimezone?: string;\n showCircleGameScreen?: boolean;\n accuracyStr?: string;\n totalTimeTaken?: number;\n chapterId?: string;\n matchmakingId?: string;\n}\n\nexport interface IButtonState {\n isDisabled: boolean;\n isLoading: boolean;\n}\n\nexport interface ITrialHomeData {\n pages: ISlide[];\n demo_info: {\n student_classroom_id: string;\n stream: TCourseStream;\n };\n parent: {\n name: string;\n };\n student: {\n grade: string;\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n teacher: {\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n circle_trial_game_config: ITrialCircleConfig;\n}\n\nexport interface IClassTimeAlertConfig {\n alertLevel: EClassTimeAlertLevel | null;\n isVisible: boolean;\n onComplete: () => void;\n}\n\nexport interface ITrialSessionProps {\n countryCode?: string;\n classStartedOn?: Date;\n height?: string | number;\n userType: TUserTypes;\n studentId: string;\n teacherId: string;\n teacherClassroomId: string;\n teacherPanel?: JSX.Element;\n studentPanel?: JSX.Element;\n formData?: ITrialSessionFormFields;\n onFormDataChange?: Dispatch<SetStateAction<ITrialSessionFormFields | undefined>>;\n worksheet?: JSX.Element;\n worksheetNavigationPanel?: JSX.Element;\n questionsRatingPanel?: JSX.Element;\n studentAbsentInClass?: boolean;\n openEndClassModal?: () => void;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n classTimeAlertConfig?: IClassTimeAlertConfig;\n classDuration?: number;\n}\n\nexport interface ITrialSessionContext\n extends Pick<\n ITrialSessionProps,\n | 'classStartedOn'\n | 'formData'\n | 'teacherPanel'\n | 'studentId'\n | 'teacherId'\n | 'studentPanel'\n | 'worksheet'\n | 'worksheetNavigationPanel'\n | 'questionsRatingPanel'\n | 'openEndClassModal'\n | 'studentAbsentInClass'\n | 'classDuration'\n | 'classTimeAlertConfig'\n > {\n buttonState: { left: IButtonState; right: IButtonState };\n isTeacher: boolean;\n milestoneConfig: IMilestoneConfig;\n slideConfig: ISlide;\n updateButtonState: (\n btnNavDir: 'left' | 'right' | 'both',\n currentState: IButtonState | { left: IButtonState; right: IButtonState },\n ) => void;\n updateSlideConfig: (config: Partial<ITrialSessionFormFields>) => void;\n trialHomeData: ITrialHomeData;\n onTrialInformationUpdate?: () => void;\n circleGames: ITrialCircleGameParams;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n\nexport interface ITrialSessionViewProps extends ITrialSessionProps {\n trialHomeData: ITrialHomeData;\n milestoneConfig: IMilestoneConfig;\n studentTimezone?: string;\n onStudentTimezoneUpdate?: () => void;\n onTrialInformationUpdate?: () => void;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n"],"names":["EClassTimeAlertLevel"],"mappings":"
|
1
|
+
{"version":3,"file":"trial-session-types.js","sources":["../../../src/features/trial-session/trial-session-types.ts"],"sourcesContent":["import type { TNodeTypes } from '../../types/models/worksheet';\nimport type { IInfoMessage } from '../circle-games/games/web-view/web-view-types';\nimport type { IMilestoneConfig, TCourseStream } from '../milestone/create/milestone-create-types';\nimport type { IAvatarLayer } from '../ui/avatar/avatar-types';\nimport type { TUserTypes } from '../ui/types';\nimport type { TPreference } from './comps/class-preference/class-preference-types';\nimport type {\n ITrialCircleConfig,\n ITrialCircleGameParams,\n} from './comps/trial-circle-game/trial-circle-game-types';\nimport type { TrialPageId } from './trial-session-constants';\nimport type { Dispatch, SetStateAction } from 'react';\n\nexport type TSlideId = TrialPageId;\n\nexport type TRegionData = {\n opportunity_country: string;\n};\n\nexport enum EClassTimeAlertLevel {\n FIVE_MIN = '5min',\n FIFTEEN_MIN = '15min',\n}\ninterface IButtonConfig {\n buttonLabel: string;\n pageId: string;\n}\n\nexport interface ISolution {\n media?: string;\n media_type?: 'image' | 'video';\n text?: string;\n}\n\nexport type TDegreeInformation = { degree_name?: string; field_of_study?: string };\n\nexport interface ITeacherProfileDetails {\n lower_grade: string;\n higher_grade: string;\n header_image: string;\n years_of_experience: number;\n number_of_students_taught: number;\n countries: string[];\n degree: TDegreeInformation;\n}\n\nexport interface ISlide {\n id: TrialPageId;\n renderAs: 'split' | 'full';\n renderAVIn: 'left' | 'right';\n header: string;\n subHeader?: string;\n prevPage?: IButtonConfig;\n nextPage?: IButtonConfig;\n cues?: string[];\n dos?: string[];\n donts?: string[];\n navigationLabel?: string;\n slideTag?: string;\n teacher_profile?: ITeacherProfileDetails;\n solutions?: ISolution[];\n enableSessionPerk?: boolean;\n}\n\nexport interface TGoals {\n goal_code?: string;\n milestone_date_ts?: number;\n goal_category?: string;\n milestone_name?: string;\n publish?: boolean;\n}\n\nexport interface ITrialSessionFormFields {\n id: string;\n name?: string;\n grade?: string;\n curriculum?: string;\n goals?: TGoals[];\n studentProfile?: {\n profileSummary?: string;\n dummyProfileImageIndex?: number;\n summaryFetched?: boolean;\n summaryFetchFailed?: boolean;\n };\n userNodeId?: string;\n nodeId?: string;\n nodeType?: TNodeTypes;\n attemptId?: string;\n preferences?: TPreference[];\n personalizedLevel?: string[];\n personalizedFocus?: string[];\n personalizedBehaviors?: string[];\n isCircleGamePlayed?: boolean;\n isCirclePuzzleSolved?: boolean;\n isCircleSkillCompleted?: boolean;\n studentTimezone?: string;\n showCircleGameScreen?: boolean;\n accuracyStr?: string;\n totalTimeTaken?: number;\n chapterId?: string;\n matchmakingId?: string;\n}\n\nexport interface IButtonState {\n isDisabled: boolean;\n isLoading: boolean;\n}\n\nexport interface ITrialHomeData {\n pages: ISlide[];\n demo_info: {\n student_classroom_id: string;\n stream: TCourseStream;\n region_data: TRegionData;\n };\n parent: {\n name: string;\n };\n student: {\n grade: string;\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n teacher: {\n name: string;\n circle_username: string;\n user_avatar: IAvatarLayer[];\n };\n circle_trial_game_config: ITrialCircleConfig;\n}\n\nexport interface IClassTimeAlertConfig {\n alertLevel: EClassTimeAlertLevel | null;\n isVisible: boolean;\n onComplete: () => void;\n}\n\nexport interface ITrialSessionProps {\n countryCode?: string;\n classStartedOn?: Date;\n height?: string | number;\n userType: TUserTypes;\n studentId: string;\n teacherId: string;\n teacherClassroomId: string;\n teacherPanel?: JSX.Element;\n studentPanel?: JSX.Element;\n formData?: ITrialSessionFormFields;\n onFormDataChange?: Dispatch<SetStateAction<ITrialSessionFormFields | undefined>>;\n worksheet?: JSX.Element;\n worksheetNavigationPanel?: JSX.Element;\n questionsRatingPanel?: JSX.Element;\n studentAbsentInClass?: boolean;\n openEndClassModal?: () => void;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n classTimeAlertConfig?: IClassTimeAlertConfig;\n classDuration?: number;\n}\n\nexport interface ITrialSessionContext\n extends Pick<\n ITrialSessionProps,\n | 'classStartedOn'\n | 'formData'\n | 'teacherPanel'\n | 'studentId'\n | 'teacherId'\n | 'studentPanel'\n | 'worksheet'\n | 'worksheetNavigationPanel'\n | 'questionsRatingPanel'\n | 'openEndClassModal'\n | 'studentAbsentInClass'\n | 'classDuration'\n | 'classTimeAlertConfig'\n > {\n buttonState: { left: IButtonState; right: IButtonState };\n isTeacher: boolean;\n milestoneConfig: IMilestoneConfig;\n slideConfig: ISlide;\n updateButtonState: (\n btnNavDir: 'left' | 'right' | 'both',\n currentState: IButtonState | { left: IButtonState; right: IButtonState },\n ) => void;\n updateSlideConfig: (config: Partial<ITrialSessionFormFields>) => void;\n trialHomeData: ITrialHomeData;\n onTrialInformationUpdate?: () => void;\n circleGames: ITrialCircleGameParams;\n trialGameUrl: string;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n\nexport interface ITrialSessionViewProps extends ITrialSessionProps {\n trialHomeData: ITrialHomeData;\n milestoneConfig: IMilestoneConfig;\n studentTimezone?: string;\n onStudentTimezoneUpdate?: () => void;\n onTrialInformationUpdate?: () => void;\n handleInfoMessage: (message: IInfoMessage) => void;\n onRemoveOptionalSlides?: (grade?: string) => void;\n}\n"],"names":["EClassTimeAlertLevel"],"mappings":"AAmBY,IAAAA,sBAAAA,OACVA,EAAA,WAAW,QACXA,EAAA,cAAc,SAFJA,IAAAA,KAAA,CAAA,CAAA;"}
|