@cuemath/leap 3.5.19-as1 → 3.5.19-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/assets/line-icons/icons/change-icon.js +41 -0
- package/dist/assets/line-icons/icons/change-icon.js.map +1 -0
- package/dist/features/timeline/comps/accordion-item/accordion-item.js +39 -51
- package/dist/features/timeline/comps/accordion-item/accordion-item.js.map +1 -1
- package/dist/features/timeline/comps/daily-timeline-items/daily-timeline-items.js +10 -9
- package/dist/features/timeline/comps/daily-timeline-items/daily-timeline-items.js.map +1 -1
- package/dist/features/timeline/comps/no-activity.js +5 -4
- package/dist/features/timeline/comps/no-activity.js.map +1 -1
- package/dist/features/timeline/comps/utils.js +9 -9
- package/dist/features/timeline/comps/utils.js.map +1 -1
- package/dist/features/timeline/daily-timeline-types.js.map +1 -1
- package/dist/features/trial-session/api/course-stream.js.map +1 -1
- 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/confirmation-modal/confirmation-modal-styled.js +68 -0
- package/dist/features/trial-session/comps/confirmation-modal/confirmation-modal-styled.js.map +1 -0
- package/dist/features/trial-session/comps/confirmation-modal/confirmation-modal.js +65 -0
- package/dist/features/trial-session/comps/confirmation-modal/confirmation-modal.js.map +1 -0
- package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js +41 -0
- package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js.map +1 -0
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js +90 -71
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
- package/dist/features/trial-session/comps/worksheet/worksheet.js +27 -23
- package/dist/features/trial-session/comps/worksheet/worksheet.js.map +1 -1
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +26 -25
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/left-panel/index.js +37 -34
- package/dist/features/trial-session/left-panel/index.js.map +1 -1
- package/dist/features/trial-session/left-panel/left-panel-styled.js +7 -4
- package/dist/features/trial-session/left-panel/left-panel-styled.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 +77 -74
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/features/ui/theme/button.js +17 -0
- package/dist/features/ui/theme/button.js.map +1 -1
- package/dist/index.d.ts +31 -54
- package/dist/index.js +735 -733
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/timeline/comps/accordion-item/accordian-item-styled.js +0 -30
- package/dist/features/timeline/comps/accordion-item/accordian-item-styled.js.map +0 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useState as C, useCallback as s, useMemo as A, useEffect as E } from "react";
|
|
2
|
+
import { useTrialSessionContext as M } from "../../../context/use-trial-session-context.js";
|
|
3
|
+
import { TrialPageId as a } from "../../../trial-session-constants.js";
|
|
4
|
+
const g = 500, I = () => {
|
|
5
|
+
const [f, i] = C(!1), { slideConfig: d, formData: m, updateSlideConfig: e } = M(), { id: o } = d, { confirmationModalActive: l } = m || {}, t = s(() => {
|
|
6
|
+
setTimeout(() => {
|
|
7
|
+
i(!1);
|
|
8
|
+
}, g);
|
|
9
|
+
}, []), r = s(() => {
|
|
10
|
+
switch (o) {
|
|
11
|
+
case a.LEARNING_WORKSHEET:
|
|
12
|
+
e({
|
|
13
|
+
id: a.LEARNING_LEVEL,
|
|
14
|
+
confirmationModalActive: !1,
|
|
15
|
+
resetAttempt: !0
|
|
16
|
+
}), t();
|
|
17
|
+
break;
|
|
18
|
+
default:
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}, [o, e, t]), c = s(() => {
|
|
22
|
+
e({ confirmationModalActive: !1 }), t();
|
|
23
|
+
}, [e, t]), u = A(
|
|
24
|
+
() => ({
|
|
25
|
+
[a.LEARNING_WORKSHEET]: {
|
|
26
|
+
title: "Changing the session level will reset current progress. Are you sure?",
|
|
27
|
+
confirmText: "Yes, change session level",
|
|
28
|
+
onConfirm: r,
|
|
29
|
+
onCancel: c
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
[c, r]
|
|
33
|
+
), n = o ? u[o] : void 0;
|
|
34
|
+
return E(() => {
|
|
35
|
+
l && n && i(!0);
|
|
36
|
+
}, [l, n]), { modalConfig: n, openModal: f };
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
I as default
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=use-confirmation-modal.js.map
|
package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-confirmation-modal.js","sources":["../../../../../../src/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useTrialSessionContext } from '../../../context/use-trial-session-context';\nimport { TrialPageId } from '../../../trial-session-constants';\n\nconst ANIMATION_DURATION_MS = 500;\n\ninterface IConfirmationModalConfig {\n title: string;\n confirmText?: string;\n cancelText?: string;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\ninterface IConfirmationModalReturn {\n modalConfig: IConfirmationModalConfig | undefined;\n openModal: boolean;\n}\n\nconst useConfirmationModal = (): IConfirmationModalReturn => {\n const [openModal, setOpenModal] = useState(false);\n const { slideConfig, formData, updateSlideConfig } = useTrialSessionContext();\n const { id } = slideConfig;\n const { confirmationModalActive } = formData || {};\n\n const closeModal = useCallback(() => {\n setTimeout(() => {\n setOpenModal(false);\n }, ANIMATION_DURATION_MS);\n }, []);\n\n const handleConfirm = useCallback(() => {\n switch (id) {\n case TrialPageId.LEARNING_WORKSHEET:\n updateSlideConfig({\n id: TrialPageId.LEARNING_LEVEL,\n confirmationModalActive: false,\n resetAttempt: true,\n });\n closeModal();\n break;\n default:\n return null;\n }\n }, [id, updateSlideConfig, closeModal]);\n\n const handleCancel = useCallback(() => {\n updateSlideConfig({ confirmationModalActive: false });\n closeModal();\n }, [updateSlideConfig, closeModal]);\n\n const modalConfigs: Partial<Record<TrialPageId, IConfirmationModalConfig>> = useMemo(\n () => ({\n [TrialPageId.LEARNING_WORKSHEET]: {\n title: 'Changing the session level will reset current progress. Are you sure?',\n confirmText: 'Yes, change session level',\n onConfirm: handleConfirm,\n onCancel: handleCancel,\n },\n }),\n [handleCancel, handleConfirm],\n );\n\n const modalConfig = id ? modalConfigs[id] : undefined;\n\n useEffect(() => {\n if (confirmationModalActive && modalConfig) setOpenModal(true);\n }, [confirmationModalActive, modalConfig]);\n\n return { modalConfig, openModal };\n};\n\nexport default useConfirmationModal;\n"],"names":["ANIMATION_DURATION_MS","useConfirmationModal","openModal","setOpenModal","useState","slideConfig","formData","updateSlideConfig","useTrialSessionContext","id","confirmationModalActive","closeModal","useCallback","handleConfirm","TrialPageId","handleCancel","modalConfigs","useMemo","modalConfig","useEffect"],"mappings":";;;AAIA,MAAMA,IAAwB,KAexBC,IAAuB,MAAgC;AAC3D,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,EAAE,aAAAC,GAAa,UAAAC,GAAU,mBAAAC,MAAsBC,EAAuB,GACtE,EAAE,IAAAC,EAAO,IAAAJ,GACT,EAAE,yBAAAK,EAAA,IAA4BJ,KAAY,IAE1CK,IAAaC,EAAY,MAAM;AACnC,eAAW,MAAM;AACf,MAAAT,EAAa,EAAK;AAAA,OACjBH,CAAqB;AAAA,EAC1B,GAAG,CAAE,CAAA,GAECa,IAAgBD,EAAY,MAAM;AACtC,YAAQH,GAAI;AAAA,MACV,KAAKK,EAAY;AACG,QAAAP,EAAA;AAAA,UAChB,IAAIO,EAAY;AAAA,UAChB,yBAAyB;AAAA,UACzB,cAAc;AAAA,QAAA,CACf,GACUH;AACX;AAAA,MACF;AACS,eAAA;AAAA,IACX;AAAA,EACC,GAAA,CAACF,GAAIF,GAAmBI,CAAU,CAAC,GAEhCI,IAAeH,EAAY,MAAM;AACnB,IAAAL,EAAA,EAAE,yBAAyB,GAAA,CAAO,GACzCI;EAAA,GACV,CAACJ,GAAmBI,CAAU,CAAC,GAE5BK,IAAuEC;AAAA,IAC3E,OAAO;AAAA,MACL,CAACH,EAAY,kBAAkB,GAAG;AAAA,QAChC,OAAO;AAAA,QACP,aAAa;AAAA,QACb,WAAWD;AAAA,QACX,UAAUE;AAAA,MACZ;AAAA,IAAA;AAAA,IAEF,CAACA,GAAcF,CAAa;AAAA,EAAA,GAGxBK,IAAcT,IAAKO,EAAaP,CAAE,IAAI;AAE5C,SAAAU,EAAU,MAAM;AACV,IAAAT,KAA2BQ,KAAaf,EAAa,EAAI;AAAA,EAAA,GAC5D,CAACO,GAAyBQ,CAAW,CAAC,GAElC,EAAE,aAAAA,GAAa,WAAAhB;AACxB;"}
|
|
@@ -1,52 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import { memo as G, useMemo as C, useCallback as E, useEffect as W } from "react";
|
|
3
3
|
import { ILLUSTRATIONS as _ } from "../../../../assets/illustrations/illustrations.js";
|
|
4
|
-
import { LOTTIE as
|
|
5
|
-
import { COURSE_STREAMS as
|
|
6
|
-
import { getPreferencesFromConfig as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
4
|
+
import { LOTTIE as X } from "../../../../assets/lottie/lottie.js";
|
|
5
|
+
import { COURSE_STREAMS as $, PREFERENCE_CATEGORY as b } from "../../../milestone/constants.js";
|
|
6
|
+
import { getGradesFromConfig as y, getPreferencesFromConfig as A } from "../../../milestone/create/milestone-create-helpers.js";
|
|
7
|
+
import d from "../../../ui/image/image.js";
|
|
8
|
+
import z from "../../../ui/layout/flex-view.js";
|
|
9
9
|
import K from "../../../ui/lottie-animation/lottie-animation.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useTrialSessionContext as
|
|
13
|
-
import { TrialPageId as
|
|
14
|
-
import
|
|
15
|
-
import { studentLevels as
|
|
16
|
-
import { Container as
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
import M from "../../../ui/separator/separator.js";
|
|
11
|
+
import m from "../../../ui/text/text.js";
|
|
12
|
+
import { useTrialSessionContext as j } from "../../context/use-trial-session-context.js";
|
|
13
|
+
import { TrialPageId as U } from "../../trial-session-constants.js";
|
|
14
|
+
import V from "../slide-header/index.js";
|
|
15
|
+
import { studentLevels as q, PREFERENCE_CODE_MAP as Y } from "./student-feedback-constants.js";
|
|
16
|
+
import { Container as J, FeedbackWrapper as Q, BalloonWrapper as Z, Feedback as ee, InlineText as te } from "./student-feedback-styled.js";
|
|
17
|
+
import oe from "../../../ui/inputs/select-input/select-input.js";
|
|
18
|
+
const _e = G(function() {
|
|
19
|
+
const { slideConfig: S, formData: I, milestoneConfig: n, updateSlideConfig: l, updateButtonState: p } = j(), { id: k } = S || {}, { grade: a, personalizedLevel: f = [], personalizedPosition: g = [] } = I || {}, t = k === U.STUDENT_LEVEL, h = t ? g.length > 0 : f.length > 0, w = y(n), x = C(
|
|
20
|
+
() => A(n, {
|
|
21
|
+
grade: a ?? "",
|
|
22
|
+
courseStream: $.MATH,
|
|
23
|
+
preferenceCategory: b.LEVEL
|
|
23
24
|
}),
|
|
24
|
-
[
|
|
25
|
-
),
|
|
26
|
-
() =>
|
|
27
|
-
grade:
|
|
28
|
-
courseStream:
|
|
29
|
-
preferenceCategory:
|
|
25
|
+
[a, n]
|
|
26
|
+
), N = C(
|
|
27
|
+
() => A(n, {
|
|
28
|
+
grade: a ?? "",
|
|
29
|
+
courseStream: $.MATH,
|
|
30
|
+
preferenceCategory: b.POSITION
|
|
30
31
|
}),
|
|
31
|
-
[
|
|
32
|
-
),
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
personalizedPosition: [i],
|
|
36
|
-
personalizedLevel: [U[i]]
|
|
37
|
-
} : { personalizedLevel: [i] };
|
|
38
|
-
m(n);
|
|
32
|
+
[a, n]
|
|
33
|
+
), c = t ? N : x, B = E(
|
|
34
|
+
(o) => {
|
|
35
|
+
l({ grade: o });
|
|
39
36
|
},
|
|
40
|
-
[
|
|
37
|
+
[l]
|
|
38
|
+
), O = E(
|
|
39
|
+
(o) => {
|
|
40
|
+
const s = t ? {
|
|
41
|
+
personalizedPosition: [o],
|
|
42
|
+
personalizedLevel: [Y[o]]
|
|
43
|
+
} : { personalizedLevel: [o] };
|
|
44
|
+
l(s);
|
|
45
|
+
},
|
|
46
|
+
[t, l]
|
|
41
47
|
);
|
|
42
|
-
return
|
|
48
|
+
return W(() => {
|
|
43
49
|
p("right", { isDisabled: !h, isLoading: !1 });
|
|
44
|
-
}, [h, p]), /* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */ e(
|
|
46
|
-
/* @__PURE__ */ e(
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
50
|
+
}, [h, p]), /* @__PURE__ */ i(J, { children: [
|
|
51
|
+
/* @__PURE__ */ e(M, { height: 60 }),
|
|
52
|
+
/* @__PURE__ */ e(V, {}),
|
|
53
|
+
/* @__PURE__ */ i(Q, { $flexGapX: 1, $gapX: 2.25, $gutterX: 3.125, children: [
|
|
54
|
+
/* @__PURE__ */ i(
|
|
55
|
+
Z,
|
|
50
56
|
{
|
|
51
57
|
$flexDirection: "row",
|
|
52
58
|
$justifyContent: "space-between",
|
|
@@ -54,7 +60,7 @@ const Te = P(function() {
|
|
|
54
60
|
$gutterX: 0.75,
|
|
55
61
|
children: [
|
|
56
62
|
/* @__PURE__ */ e(
|
|
57
|
-
|
|
63
|
+
d,
|
|
58
64
|
{
|
|
59
65
|
withLoader: !0,
|
|
60
66
|
src: _.GREEN_BALLOON,
|
|
@@ -64,7 +70,7 @@ const Te = P(function() {
|
|
|
64
70
|
}
|
|
65
71
|
),
|
|
66
72
|
/* @__PURE__ */ e(
|
|
67
|
-
|
|
73
|
+
d,
|
|
68
74
|
{
|
|
69
75
|
withLoader: !0,
|
|
70
76
|
src: _.GREEN_BALLOON,
|
|
@@ -76,70 +82,83 @@ const Te = P(function() {
|
|
|
76
82
|
]
|
|
77
83
|
}
|
|
78
84
|
),
|
|
79
|
-
|
|
85
|
+
t ? null : /* @__PURE__ */ e(
|
|
86
|
+
oe,
|
|
87
|
+
{
|
|
88
|
+
renderAs: "primary",
|
|
89
|
+
value: a,
|
|
90
|
+
options: w,
|
|
91
|
+
shape: "curved",
|
|
92
|
+
size: "small",
|
|
93
|
+
onChange: B,
|
|
94
|
+
theme: "dark",
|
|
95
|
+
width: 107
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
!!(c && c.length > 0) && c.map((o) => {
|
|
80
99
|
var L;
|
|
81
|
-
const { id:
|
|
100
|
+
const { id: s, label: u, lottie: T, description: F } = o, { title: R, description: v, icon: H } = q[u.toLowerCase()] || {}, r = (L = t ? g : f) == null ? void 0 : L.includes(s), P = {
|
|
82
101
|
loop: !1,
|
|
83
|
-
autoplay:
|
|
102
|
+
autoplay: r
|
|
84
103
|
};
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
|
|
104
|
+
return /* @__PURE__ */ i(
|
|
105
|
+
ee,
|
|
87
106
|
{
|
|
88
107
|
$flexDirection: "row",
|
|
89
108
|
$alignItems: "center",
|
|
90
109
|
$justifyContent: "flex-start",
|
|
91
110
|
$flexGapX: 1.25,
|
|
92
|
-
onClick: () =>
|
|
111
|
+
onClick: () => O(s),
|
|
93
112
|
$gutterX: 0.75,
|
|
94
113
|
$gapX: 1,
|
|
95
|
-
$background:
|
|
114
|
+
$background: r ? "BLACK_T_87" : "WHITE_1",
|
|
96
115
|
$borderColor: "BLACK_T_87",
|
|
97
116
|
children: [
|
|
98
|
-
|
|
117
|
+
T ? /* @__PURE__ */ e(
|
|
99
118
|
K,
|
|
100
119
|
{
|
|
101
|
-
src:
|
|
120
|
+
src: X[T],
|
|
102
121
|
height: 64,
|
|
103
122
|
width: 64,
|
|
104
|
-
settings:
|
|
123
|
+
settings: P
|
|
105
124
|
}
|
|
106
|
-
) : /* @__PURE__ */ e(
|
|
107
|
-
/* @__PURE__ */ e(
|
|
125
|
+
) : /* @__PURE__ */ e(d, { withLoader: !0, src: H, height: 64, width: 64, alt: "icon" }),
|
|
126
|
+
/* @__PURE__ */ e(z, { $flex: 1, children: t ? /* @__PURE__ */ i(D, { children: [
|
|
108
127
|
/* @__PURE__ */ e(
|
|
109
|
-
|
|
128
|
+
m,
|
|
110
129
|
{
|
|
111
130
|
className: "feedback-title",
|
|
112
131
|
$renderAs: "ac3-black",
|
|
113
|
-
$color:
|
|
114
|
-
children:
|
|
132
|
+
$color: r ? "WHITE_T_87" : "BLACK_T_87",
|
|
133
|
+
children: u
|
|
115
134
|
}
|
|
116
135
|
),
|
|
117
136
|
/* @__PURE__ */ e(
|
|
118
|
-
|
|
137
|
+
m,
|
|
119
138
|
{
|
|
120
139
|
className: "feedback-desc",
|
|
121
140
|
$renderAs: "ab2",
|
|
122
|
-
$color:
|
|
123
|
-
children:
|
|
141
|
+
$color: r ? "WHITE_T_87" : "BLACK_T_87",
|
|
142
|
+
children: F
|
|
124
143
|
}
|
|
125
144
|
)
|
|
126
|
-
] }) : /* @__PURE__ */
|
|
127
|
-
|
|
145
|
+
] }) : /* @__PURE__ */ i(
|
|
146
|
+
m,
|
|
128
147
|
{
|
|
129
148
|
className: "feedback-title",
|
|
130
149
|
$renderAs: "ac3-black",
|
|
131
|
-
$color:
|
|
150
|
+
$color: r ? "WHITE_T_87" : "BLACK_T_87",
|
|
132
151
|
children: [
|
|
133
|
-
|
|
152
|
+
R,
|
|
134
153
|
":",
|
|
135
154
|
" ",
|
|
136
155
|
/* @__PURE__ */ e(
|
|
137
|
-
|
|
156
|
+
te,
|
|
138
157
|
{
|
|
139
158
|
className: "feedback-desc",
|
|
140
159
|
$renderAs: "ab2",
|
|
141
|
-
$color:
|
|
142
|
-
children:
|
|
160
|
+
$color: r ? "WHITE_T_60" : "BLACK_T_60",
|
|
161
|
+
children: v
|
|
143
162
|
}
|
|
144
163
|
)
|
|
145
164
|
]
|
|
@@ -147,13 +166,13 @@ const Te = P(function() {
|
|
|
147
166
|
) })
|
|
148
167
|
]
|
|
149
168
|
},
|
|
150
|
-
|
|
169
|
+
s
|
|
151
170
|
);
|
|
152
171
|
})
|
|
153
172
|
] })
|
|
154
173
|
] });
|
|
155
174
|
});
|
|
156
175
|
export {
|
|
157
|
-
|
|
176
|
+
_e as default
|
|
158
177
|
};
|
|
159
178
|
//# sourceMappingURL=student-feedback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"student-feedback.js","sources":["../../../../../src/features/trial-session/comps/student-feedback/student-feedback.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { LOTTIE } from '../../../../assets/lottie/lottie';\nimport { COURSE_STREAMS, PREFERENCE_CATEGORY } from '../../../milestone/constants';\nimport { getPreferencesFromConfig } from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TrialPageId } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { PREFERENCE_CODE_MAP, studentLevels } from './student-feedback-constants';\nimport * as Styled from './student-feedback-styled';\n\nconst StudentFeedback = memo(function StudentFeedback() {\n const { slideConfig, formData, milestoneConfig, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n\n const { id: slideId } = slideConfig || {};\n const { grade, personalizedLevel = [], personalizedPosition = [] } = formData || {};\n const isStudentLevel = slideId === TrialPageId.STUDENT_LEVEL;\n const hasRequiredFields = Boolean(\n isStudentLevel ? personalizedPosition.length > 0 : personalizedLevel.length > 0,\n );\n\n const levelList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.LEVEL,\n }),\n [grade, milestoneConfig],\n );\n\n const positionList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.POSITION,\n }),\n [grade, milestoneConfig],\n );\n\n const studentOptions = isStudentLevel ? positionList : levelList;\n\n const handleClick = useCallback(\n (id: string) => {\n const configToUpdate = isStudentLevel\n ? {\n personalizedPosition: [id],\n personalizedLevel: [PREFERENCE_CODE_MAP[id as keyof typeof PREFERENCE_CODE_MAP]],\n }\n : { personalizedLevel: [id] };\n\n updateSlideConfig(configToUpdate);\n },\n [isStudentLevel, updateSlideConfig],\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.FeedbackWrapper $flexGapX={1} $gapX={2.25} $gutterX={3.125}>\n <Styled.BalloonWrapper\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $gutterX={0.75}\n >\n <Image\n withLoader\n src={ILLUSTRATIONS.GREEN_BALLOON}\n width={28}\n height={34}\n alt=\"balloon\"\n />\n <Image\n withLoader\n src={ILLUSTRATIONS.GREEN_BALLOON}\n width={28}\n height={34}\n alt=\"balloon\"\n />\n </Styled.BalloonWrapper>\n {Boolean(studentOptions && studentOptions.length > 0) &&\n studentOptions.map(level => {\n const { id, label, lottie, description: levelDescription } = level;\n const { title, description, icon } = studentLevels[label.toLowerCase()] || {};\n const isSelected = (\n isStudentLevel ? personalizedPosition : personalizedLevel\n )?.includes(id);\n\n const animationSettings = {\n loop: false,\n autoplay: isSelected,\n };\n\n return (\n <Styled.Feedback\n key={id}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"flex-start\"\n $flexGapX={1.25}\n onClick={() => handleClick(id)}\n $gutterX={0.75}\n $gapX={1}\n $background={isSelected ? 'BLACK_T_87' : 'WHITE_1'}\n $borderColor=\"BLACK_T_87\"\n >\n {lottie ? (\n <LottieAnimation\n src={LOTTIE[lottie]}\n height={64}\n width={64}\n settings={animationSettings}\n />\n ) : (\n <Image withLoader src={icon} height={64} width={64} alt=\"icon\" />\n )}\n <FlexView $flex={1}>\n {isStudentLevel ? (\n <>\n <Text\n className=\"feedback-title\"\n $renderAs=\"ac3-black\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {label}\n </Text>\n <Text\n className=\"feedback-desc\"\n $renderAs=\"ab2\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {levelDescription}\n </Text>\n </>\n ) : (\n <Text\n className=\"feedback-title\"\n $renderAs=\"ac3-black\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {title}:{' '}\n <Styled.InlineText\n className=\"feedback-desc\"\n $renderAs=\"ab2\"\n $color={isSelected ? 'WHITE_T_60' : 'BLACK_T_60'}\n >\n {description}\n </Styled.InlineText>\n </Text>\n )}\n </FlexView>\n </Styled.Feedback>\n );\n })}\n </Styled.FeedbackWrapper>\n </Styled.Container>\n );\n});\n\nexport default StudentFeedback;\n"],"names":["StudentFeedback","memo","slideConfig","formData","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","slideId","grade","personalizedLevel","personalizedPosition","isStudentLevel","TrialPageId","hasRequiredFields","levelList","useMemo","getPreferencesFromConfig","COURSE_STREAMS","PREFERENCE_CATEGORY","positionList","studentOptions","handleClick","useCallback","id","configToUpdate","PREFERENCE_CODE_MAP","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.FeedbackWrapper","Styled.BalloonWrapper","Image","ILLUSTRATIONS","level","label","lottie","levelDescription","title","description","icon","studentLevels","isSelected","_a","animationSettings","Styled.Feedback","LottieAnimation","LOTTIE","FlexView","Fragment","Text","Styled.InlineText"],"mappings":";;;;;;;;;;;;;;;;AAiBM,MAAAA,KAAkBC,EAAK,WAA2B;AACtD,QAAM,EAAE,aAAAC,GAAa,UAAAC,GAAU,iBAAAC,GAAiB,mBAAAC,GAAmB,mBAAAC,EAAA,IACjEC,KAEI,EAAE,IAAIC,MAAYN,KAAe,CAAA,GACjC,EAAE,OAAAO,GAAO,mBAAAC,IAAoB,CAAC,GAAG,sBAAAC,IAAuB,GAAO,IAAAR,KAAY,IAC3ES,IAAiBJ,MAAYK,EAAY,eACzCC,IACJF,IAAiBD,EAAqB,SAAS,IAAID,EAAkB,SAAS,GAG1EK,IAAYC;AAAA,IAChB,MACEC,EAAyBb,GAAiB;AAAA,MACxC,OAAOK,KAAS;AAAA,MAChB,cAAcS,EAAe;AAAA,MAC7B,oBAAoBC,EAAoB;AAAA,IAAA,CACzC;AAAA,IACH,CAACV,GAAOL,CAAe;AAAA,EAAA,GAGnBgB,IAAeJ;AAAA,IACnB,MACEC,EAAyBb,GAAiB;AAAA,MACxC,OAAOK,KAAS;AAAA,MAChB,cAAcS,EAAe;AAAA,MAC7B,oBAAoBC,EAAoB;AAAA,IAAA,CACzC;AAAA,IACH,CAACV,GAAOL,CAAe;AAAA,EAAA,GAGnBiB,IAAiBT,IAAiBQ,IAAeL,GAEjDO,IAAcC;AAAA,IAClB,CAACC,MAAe;AACd,YAAMC,IAAiBb,IACnB;AAAA,QACE,sBAAsB,CAACY,CAAE;AAAA,QACzB,mBAAmB,CAACE,EAAoBF,CAAsC,CAAC;AAAA,MAEjF,IAAA,EAAE,mBAAmB,CAACA,CAAE;AAE5B,MAAAnB,EAAkBoB,CAAc;AAAA,IAClC;AAAA,IACA,CAACb,GAAgBP,C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U;AAAA,wBACV,WAAU;AAAA,wBACV,QAAQT,IAAa,eAAe;AAAA,wBAEnC,UAAAH;AAAA,sBAAA;AAAA,oBACH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA,GAGN;AAAA,YAAA;AAAA,UAAA;AAAA,UAvDKlB;AAAA,QAAA;AAAA,MAwDP,CAEH;AAAA,IAAA,GACL;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"student-feedback.js","sources":["../../../../../src/features/trial-session/comps/student-feedback/student-feedback.tsx"],"sourcesContent":["import { memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport { LOTTIE } from '../../../../assets/lottie/lottie';\nimport { COURSE_STREAMS, PREFERENCE_CATEGORY } from '../../../milestone/constants';\nimport {\n getGradesFromConfig,\n getPreferencesFromConfig,\n} from '../../../milestone/create/milestone-create-helpers';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport { TrialPageId } from '../../trial-session-constants';\nimport SlideHeader from '../slide-header';\nimport { PREFERENCE_CODE_MAP, studentLevels } from './student-feedback-constants';\nimport * as Styled from './student-feedback-styled';\nimport SelectInput from '../../../ui/inputs/select-input/select-input';\n\nconst StudentFeedback = memo(function StudentFeedback() {\n const { slideConfig, formData, milestoneConfig, updateSlideConfig, updateButtonState } =\n useTrialSessionContext();\n\n const { id: slideId } = slideConfig || {};\n const { grade, personalizedLevel = [], personalizedPosition = [] } = formData || {};\n const isStudentLevel = slideId === TrialPageId.STUDENT_LEVEL;\n const hasRequiredFields = Boolean(\n isStudentLevel ? personalizedPosition.length > 0 : personalizedLevel.length > 0,\n );\n\n const grades = getGradesFromConfig(milestoneConfig);\n\n const levelList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.LEVEL,\n }),\n [grade, milestoneConfig],\n );\n\n const positionList = useMemo(\n () =>\n getPreferencesFromConfig(milestoneConfig, {\n grade: grade ?? '',\n courseStream: COURSE_STREAMS.MATH,\n preferenceCategory: PREFERENCE_CATEGORY.POSITION,\n }),\n [grade, milestoneConfig],\n );\n\n const studentOptions = isStudentLevel ? positionList : levelList;\n\n const onGradeChange = useCallback(\n (value: string) => {\n updateSlideConfig({ grade: value });\n },\n [updateSlideConfig],\n );\n\n const handleClick = useCallback(\n (id: string) => {\n const configToUpdate = isStudentLevel\n ? {\n personalizedPosition: [id],\n personalizedLevel: [PREFERENCE_CODE_MAP[id as keyof typeof PREFERENCE_CODE_MAP]],\n }\n : { personalizedLevel: [id] };\n\n updateSlideConfig(configToUpdate);\n },\n [isStudentLevel, updateSlideConfig],\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.FeedbackWrapper $flexGapX={1} $gapX={2.25} $gutterX={3.125}>\n <Styled.BalloonWrapper\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $gutterX={0.75}\n >\n <Image\n withLoader\n src={ILLUSTRATIONS.GREEN_BALLOON}\n width={28}\n height={34}\n alt=\"balloon\"\n />\n <Image\n withLoader\n src={ILLUSTRATIONS.GREEN_BALLOON}\n width={28}\n height={34}\n alt=\"balloon\"\n />\n </Styled.BalloonWrapper>\n {isStudentLevel ? null : (\n <SelectInput\n renderAs=\"primary\"\n value={grade}\n options={grades}\n shape=\"curved\"\n size=\"small\"\n onChange={onGradeChange}\n theme=\"dark\"\n width={107}\n />\n )}\n {Boolean(studentOptions && studentOptions.length > 0) &&\n studentOptions.map(level => {\n const { id, label, lottie, description: levelDescription } = level;\n const { title, description, icon } = studentLevels[label.toLowerCase()] || {};\n const isSelected = (\n isStudentLevel ? personalizedPosition : personalizedLevel\n )?.includes(id);\n\n const animationSettings = {\n loop: false,\n autoplay: isSelected,\n };\n\n return (\n <Styled.Feedback\n key={id}\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"flex-start\"\n $flexGapX={1.25}\n onClick={() => handleClick(id)}\n $gutterX={0.75}\n $gapX={1}\n $background={isSelected ? 'BLACK_T_87' : 'WHITE_1'}\n $borderColor=\"BLACK_T_87\"\n >\n {lottie ? (\n <LottieAnimation\n src={LOTTIE[lottie]}\n height={64}\n width={64}\n settings={animationSettings}\n />\n ) : (\n <Image withLoader src={icon} height={64} width={64} alt=\"icon\" />\n )}\n <FlexView $flex={1}>\n {isStudentLevel ? (\n <>\n <Text\n className=\"feedback-title\"\n $renderAs=\"ac3-black\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {label}\n </Text>\n <Text\n className=\"feedback-desc\"\n $renderAs=\"ab2\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {levelDescription}\n </Text>\n </>\n ) : (\n <Text\n className=\"feedback-title\"\n $renderAs=\"ac3-black\"\n $color={isSelected ? 'WHITE_T_87' : 'BLACK_T_87'}\n >\n {title}:{' '}\n <Styled.InlineText\n className=\"feedback-desc\"\n $renderAs=\"ab2\"\n $color={isSelected ? 'WHITE_T_60' : 'BLACK_T_60'}\n >\n {description}\n </Styled.InlineText>\n </Text>\n )}\n </FlexView>\n </Styled.Feedback>\n );\n })}\n </Styled.FeedbackWrapper>\n </Styled.Container>\n );\n});\n\nexport default StudentFeedback;\n"],"names":["StudentFeedback","memo","slideConfig","formData","milestoneConfig","updateSlideConfig","updateButtonState","useTrialSessionContext","slideId","grade","personalizedLevel","personalizedPosition","isStudentLevel","TrialPageId","hasRequiredFields","grades","getGradesFromConfig","levelList","useMemo","getPreferencesFromConfig","COURSE_STREAMS","PREFERENCE_CATEGORY","positionList","studentOptions","onGradeChange","useCallback","value","handleClick","id","configToUpdate","PREFERENCE_CODE_MAP","useEffect","jsxs","Styled.Container","jsx","Separator","SlideHeader","Styled.FeedbackWrapper","Styled.BalloonWrapper","Image","ILLUSTRATIONS","SelectInput","level","label","lottie","levelDescription","title","description","icon","studentLevels","isSelected","_a","animationSettings","Styled.Feedback","LottieAnimation","LOTTIE","FlexView","Fragment","Text","Styled.InlineText"],"mappings":";;;;;;;;;;;;;;;;;AAqBM,MAAAA,KAAkBC,EAAK,WAA2B;AACtD,QAAM,EAAE,aAAAC,GAAa,UAAAC,GAAU,iBAAAC,GAAiB,mBAAAC,GAAmB,mBAAAC,EAAA,IACjEC,KAEI,EAAE,IAAIC,MAAYN,KAAe,CAAA,GACjC,EAAE,OAAAO,GAAO,mBAAAC,IAAoB,CAAC,GAAG,sBAAAC,IAAuB,GAAO,IAAAR,KAAY,IAC3ES,IAAiBJ,MAAYK,EAAY,eACzCC,IACJF,IAAiBD,EAAqB,SAAS,IAAID,EAAkB,SAAS,GAG1EK,IAASC,EAAoBZ,CAAe,GAE5Ca,IAAYC;AAAA,IAChB,MACEC,EAAyBf,GAAiB;AAAA,MACxC,OAAOK,KAAS;AAAA,MAChB,cAAcW,EAAe;AAAA,MAC7B,oBAAoBC,EAAoB;AAAA,IAAA,CACzC;AAAA,IACH,CAACZ,GAAOL,CAAe;AAAA,EAAA,GAGnBkB,IAAeJ;AAAA,IACnB,MACEC,EAAyBf,GAAiB;AAAA,MACxC,OAAOK,KAAS;AAAA,MAChB,cAAcW,EAAe;AAAA,MAC7B,oBAAoBC,EAAoB;AAAA,IAAA,CACzC;AAAA,IACH,CAACZ,GAAOL,CAAe;AAAA,EAAA,GAGnBmB,IAAiBX,IAAiBU,IAAeL,GAEjDO,IAAgBC;AAAA,IACpB,CAACC,MAAkB;AACC,MAAArB,EAAA,EAAE,OAAOqB,EAAA,CAAO;AAAA,IACpC;AAAA,I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,oBACV,WAAU;AAAA,oBACV,QAAQR,IAAa,eAAe;AAAA,oBAEnC,UAAAP;AAAA,kBAAA;AAAA,gBACH;AAAA,gBACA,gBAAAT;AAAA,kBAACwB;AAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,WAAU;AAAA,oBACV,QAAQR,IAAa,eAAe;AAAA,oBAEnC,UAAAL;AAAA,kBAAA;AAAA,gBACH;AAAA,cAAA,EAAA,CACF,IAEA,gBAAAb;AAAA,gBAAC0B;AAAA,gBAAA;AAAA,kBACC,WAAU;AAAA,kBACV,WAAU;AAAA,kBACV,QAAQR,IAAa,eAAe;AAAA,kBAEnC,UAAA;AAAA,oBAAAJ;AAAA,oBAAM;AAAA,oBAAE;AAAA,oBACT,gBAAAZ;AAAA,sBAACyB;AAAAA,sBAAA;AAAA,wBACC,WAAU;AAAA,wBACV,WAAU;AAAA,wBACV,QAAQT,IAAa,eAAe;AAAA,wBAEnC,UAAAH;AAAA,sBAAA;AAAA,oBACH;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA,GAGN;AAAA,YAAA;AAAA,UAAA;AAAA,UAvDKnB;AAAA,QAAA;AAAA,MAwDP,CAEH;AAAA,IAAA,GACL;AAAA,EACF,EAAA,CAAA;AAEJ,CAAC;"}
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useState as A, useCallback as x, useEffect as D } from "react";
|
|
3
3
|
import E from "../../../ui/error/error.js";
|
|
4
|
-
import
|
|
5
|
-
import { useResumeTrialWorksheet as
|
|
6
|
-
import { useTrialSessionContext as
|
|
7
|
-
const
|
|
8
|
-
const { isTeacher: o, studentId:
|
|
9
|
-
if (
|
|
4
|
+
import N from "../../../ui/loader/app-loader/app-loader.js";
|
|
5
|
+
import { useResumeTrialWorksheet as W } from "../../api/trial-nodes.js";
|
|
6
|
+
import { useTrialSessionContext as b } from "../../context/use-trial-session-context.js";
|
|
7
|
+
const R = () => {
|
|
8
|
+
const { isTeacher: o, studentId: r, worksheet: s, formData: c, updateSlideConfig: p, trialHomeData: u } = b(), [l, n] = A(!1), { resetAttempt: e } = c || {}, { demo_info: _ } = u, { region_data: h, course: i } = _ || {}, { opportunity_country: a = "US" } = h || {}, y = (I, m) => {
|
|
9
|
+
if (I && n(!0), m) {
|
|
10
10
|
const {
|
|
11
|
-
user_node_id:
|
|
12
|
-
node_id:
|
|
13
|
-
user_attempt_id:
|
|
14
|
-
node_type:
|
|
15
|
-
} =
|
|
16
|
-
|
|
11
|
+
user_node_id: C,
|
|
12
|
+
node_id: S,
|
|
13
|
+
user_attempt_id: T,
|
|
14
|
+
node_type: k
|
|
15
|
+
} = m;
|
|
16
|
+
p({ userNodeId: C, nodeId: S, attemptId: T, nodeType: k, resetAttempt: !1 });
|
|
17
17
|
}
|
|
18
|
-
}, { patch: d, isProcessing:
|
|
19
|
-
onComplete:
|
|
20
|
-
}),
|
|
21
|
-
o && (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
}, { patch: d, isProcessing: g } = W({
|
|
19
|
+
onComplete: y
|
|
20
|
+
}), t = x(() => {
|
|
21
|
+
o && (n(!1), d(
|
|
22
|
+
r,
|
|
23
|
+
{ country_code: a, course: i },
|
|
24
|
+
{ reset_attempt: typeof e === void 0 || e }
|
|
25
|
+
));
|
|
26
|
+
}, [a, i, o, d, r, e]);
|
|
27
|
+
return D(() => {
|
|
28
|
+
t();
|
|
29
|
+
}, [t]), l ? /* @__PURE__ */ f(E, { height: "100%", onTryAgain: t }) : g || !s ? /* @__PURE__ */ f(N, { height: "100%" }) : s;
|
|
26
30
|
};
|
|
27
31
|
export {
|
|
28
|
-
|
|
32
|
+
R as default
|
|
29
33
|
};
|
|
30
34
|
//# sourceMappingURL=worksheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet.js","sources":["../../../../../src/features/trial-session/comps/worksheet/worksheet.tsx"],"sourcesContent":["import { useCallback, useEffect, useState, type FC } from 'react';\n\nimport type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\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, course } = 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
|
|
1
|
+
{"version":3,"file":"worksheet.js","sources":["../../../../../src/features/trial-session/comps/worksheet/worksheet.tsx"],"sourcesContent":["import { useCallback, useEffect, useState, type FC } from 'react';\n\nimport type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\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, formData, updateSlideConfig, trialHomeData } =\n useTrialSessionContext();\n const [isError, setIserror] = useState<boolean>(false);\n\n const { resetAttempt } = formData || {};\n const { demo_info: demoInfo } = trialHomeData;\n const { region_data: regionData, course } = 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, resetAttempt: false });\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(\n studentId,\n { country_code: countryCode, course },\n { reset_attempt: typeof resetAttempt === undefined || resetAttempt },\n );\n }\n }, [countryCode, course, isTeacher, resumeNode, studentId, resetAttempt]);\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","formData","updateSlideConfig","trialHomeData","useTrialSessionContext","isError","setIserror","useState","resetAttempt","demoInfo","regionData","course","countryCode","onComplete","error","sheetData","userNodeId","nodeId","attemptId","nodeType","resumeNode","isProcessing","useResumeTrialWorksheet","fetchData","useCallback","useEffect","jsx","Error","AppLoader"],"mappings":";;;;;;AAQA,MAAMA,IAAuB,MAAM;AAC3B,QAAA,EAAE,WAAAC,GAAW,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,mBAAAC,GAAmB,eAAAC,MACpEC,KACI,CAACC,GAASC,CAAU,IAAIC,EAAkB,EAAK,GAE/C,EAAE,cAAAC,EAAA,IAAiBP,KAAY,IAC/B,EAAE,WAAWQ,EAAa,IAAAN,GAC1B,EAAE,aAAaO,GAAY,QAAAC,EAAO,IAAIF,KAAY,CAAA,GAClD,EAAE,qBAAqBG,IAAc,KAAK,IAAIF,KAAc,CAAA,GAE5DG,IAAa,CAACC,GAAsBC,MAAsC;AAK9E,QAJID,KACFR,EAAW,EAAI,GAGbS,GAAW;AACP,YAAA;AAAA,QACJ,cAAcC;AAAA,QACd,SAASC;AAAA,QACT,iBAAiBC;AAAA,QACjB,WAAWC;AAAA,MACT,IAAAJ;AAEJ,MAAAb,EAAkB,EAAE,YAAAc,GAAY,QAAAC,GAAQ,WAAAC,GAAW,UAAAC,GAAU,cAAc,IAAO;AAAA,IACpF;AAAA,EAAA,GAGI,EAAE,OAAOC,GAAY,cAAAC,EAAA,IAAiBC,EAAwB;AAAA,IAClE,YAAAT;AAAA,EAAA,CACD,GAEKU,IAAYC,EAAY,MAAM;AAClC,IAAI1B,MACFQ,EAAW,EAAK,GAChBc;AAAA,MACErB;AAAA,MACA,EAAE,cAAca,GAAa,QAAAD,EAAO;AAAA,MACpC,EAAE,eAAe,OAAOH,MAAiB,UAAaA,EAAa;AAAA,IAAA;AAAA,EAEvE,GACC,CAACI,GAAaD,GAAQb,GAAWsB,GAAYrB,GAAWS,CAAY,CAAC;AAMxE,SAJAiB,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEVlB,IACM,gBAAAqB,EAAAC,GAAA,EAAM,QAAO,QAAO,YAAYJ,EAAW,CAAA,IAGjDF,KAAgB,CAACrB,IACZ,gBAAA0B,EAACE,GAAU,EAAA,QAAO,OAAO,CAAA,IAG3B5B;AACT;"}
|
|
@@ -7,7 +7,7 @@ import { usePostTeacherAvailability as re } from "../api/teacher-availability.js
|
|
|
7
7
|
import { usePatchTrialHome as ie } from "../api/trial-home.js";
|
|
8
8
|
import { useTrialSessionContext as ce } from "../context/use-trial-session-context.js";
|
|
9
9
|
import { getFormattedPreferences as V, getWeekdayAndStartTimeFromPreference as le, getFormattedStudentPersonalizedPreference as de } from "../helper.js";
|
|
10
|
-
import { DEFAULT_BUTTON_STATE as
|
|
10
|
+
import { DEFAULT_BUTTON_STATE as p, TrialPageId as t } from "../trial-session-constants.js";
|
|
11
11
|
import W from "../../../node_modules/uuid/dist/esm-browser/v4.js";
|
|
12
12
|
const be = () => {
|
|
13
13
|
const {
|
|
@@ -18,13 +18,13 @@ const be = () => {
|
|
|
18
18
|
teacherId: r,
|
|
19
19
|
studentId: i,
|
|
20
20
|
milestoneConfig: A,
|
|
21
|
-
handleInfoMessage:
|
|
21
|
+
handleInfoMessage: E,
|
|
22
22
|
onTrialInformationUpdate: b,
|
|
23
23
|
trialHomeData: q,
|
|
24
24
|
worksheetNavigationPanel: I
|
|
25
25
|
} = ce(), { nextPage: J, id: u } = Z || {}, { demo_info: Q } = q, { stream: v, region_data: X } = Q, { opportunity_country: T = "US" } = X || {}, { pageId: c } = J || {}, {
|
|
26
|
-
name:
|
|
27
|
-
grade:
|
|
26
|
+
name: h,
|
|
27
|
+
grade: f,
|
|
28
28
|
goals: R,
|
|
29
29
|
curriculum: L,
|
|
30
30
|
studentTimezone: N,
|
|
@@ -44,7 +44,7 @@ const be = () => {
|
|
|
44
44
|
const e = {};
|
|
45
45
|
(c === t.CIRCLE_GAME || c === t.CIRCLE_PUZZLE || c === t.CIRCLE_SKILL) && (e.matchmakingId = W(), e.showCircleGameScreen = !0), n({ id: c, ...e });
|
|
46
46
|
}
|
|
47
|
-
s("both",
|
|
47
|
+
s("both", p), u === t.LEARNING_LEVEL && (b == null || b());
|
|
48
48
|
}, { patch: z } = ie({ onComplete: S }), { patch: x } = ne({
|
|
49
49
|
onComplete: S
|
|
50
50
|
}), { post: F } = ae({
|
|
@@ -56,23 +56,23 @@ const be = () => {
|
|
|
56
56
|
if ((e ?? []).some((a) => !a.is_available)) {
|
|
57
57
|
const ee = (e ?? []).filter((C) => !C.is_available).map((C) => C.reason).join(`
|
|
58
58
|
`);
|
|
59
|
-
|
|
59
|
+
E == null || E({ message: ee, position: "bottom" }), s("both", p);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const _ = V(P, N);
|
|
63
|
+
_.length > 0 ? z("trial-v3-patch", {
|
|
64
64
|
action: "UPDATE_DEMO",
|
|
65
65
|
action_data: {
|
|
66
66
|
trial_details: {
|
|
67
|
-
selected_regular_slots:
|
|
67
|
+
selected_regular_slots: _
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
teacher_id: r,
|
|
71
71
|
student_id: i
|
|
72
|
-
}) : s("both",
|
|
72
|
+
}) : s("both", p);
|
|
73
73
|
},
|
|
74
74
|
[
|
|
75
|
-
|
|
75
|
+
E,
|
|
76
76
|
z,
|
|
77
77
|
P,
|
|
78
78
|
i,
|
|
@@ -84,19 +84,19 @@ const be = () => {
|
|
|
84
84
|
onComplete: Y
|
|
85
85
|
}), B = m(() => {
|
|
86
86
|
var a;
|
|
87
|
-
const [o, e] = ((a =
|
|
87
|
+
const [o, e] = ((a = h == null ? void 0 : h.trim()) == null ? void 0 : a.split(" ")) || [], d = {
|
|
88
88
|
first_name: o,
|
|
89
89
|
last_name: e,
|
|
90
|
-
grade:
|
|
90
|
+
grade: f,
|
|
91
91
|
board: L,
|
|
92
92
|
demo_type: "TRIAL_V3",
|
|
93
93
|
teacher_id: r,
|
|
94
94
|
country_alpha_2: T
|
|
95
95
|
};
|
|
96
|
-
/\d/.test(
|
|
96
|
+
/\d/.test(h || "") ? n({ numberInNameError: !0 }) : (l(), x(i, d));
|
|
97
97
|
}, [
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
h,
|
|
99
|
+
f,
|
|
100
100
|
L,
|
|
101
101
|
r,
|
|
102
102
|
T,
|
|
@@ -113,7 +113,7 @@ const be = () => {
|
|
|
113
113
|
};
|
|
114
114
|
l(), U(d);
|
|
115
115
|
} else
|
|
116
|
-
n({ id: c }), s("both",
|
|
116
|
+
n({ id: c }), s("both", p);
|
|
117
117
|
}, [
|
|
118
118
|
P,
|
|
119
119
|
N,
|
|
@@ -126,7 +126,7 @@ const be = () => {
|
|
|
126
126
|
]), w = m(() => {
|
|
127
127
|
const o = {
|
|
128
128
|
course_stream: v,
|
|
129
|
-
grade:
|
|
129
|
+
grade: f,
|
|
130
130
|
teacher_id: r,
|
|
131
131
|
board: L,
|
|
132
132
|
goals: R
|
|
@@ -138,7 +138,7 @@ const be = () => {
|
|
|
138
138
|
L,
|
|
139
139
|
l,
|
|
140
140
|
R,
|
|
141
|
-
|
|
141
|
+
f,
|
|
142
142
|
F,
|
|
143
143
|
v,
|
|
144
144
|
i,
|
|
@@ -150,30 +150,31 @@ const be = () => {
|
|
|
150
150
|
...D,
|
|
151
151
|
...O,
|
|
152
152
|
...G
|
|
153
|
-
]) }, d = { stream: oe.MATH, studentId: i };
|
|
153
|
+
]), grade: f }, d = { stream: oe.MATH, studentId: i };
|
|
154
154
|
l(), M(e, d);
|
|
155
155
|
}, [
|
|
156
|
+
f,
|
|
157
|
+
i,
|
|
156
158
|
A,
|
|
157
159
|
k,
|
|
158
160
|
y,
|
|
159
161
|
D,
|
|
160
162
|
O,
|
|
161
163
|
G,
|
|
162
|
-
i,
|
|
163
164
|
l,
|
|
164
165
|
M
|
|
165
166
|
]), g = m(
|
|
166
167
|
(o, e) => {
|
|
167
168
|
if (!n) return;
|
|
168
|
-
const d = u === t.STUDENT_PROFILE,
|
|
169
|
+
const d = u === t.STUDENT_PROFILE, _ = u === t.LEARNING_PLAN, a = { numberInNameError: !1 };
|
|
169
170
|
if ((e === t.CIRCLE_GAME || e === t.CIRCLE_PUZZLE || e === t.CIRCLE_SKILL) && (a.matchmakingId = W(), a.showCircleGameScreen = !0), o === "prev" && (n({
|
|
170
171
|
id: e,
|
|
171
172
|
...d && { studentProfile: void 0 },
|
|
172
|
-
...
|
|
173
|
+
..._ && {
|
|
173
174
|
chapterId: void 0
|
|
174
175
|
},
|
|
175
176
|
...a
|
|
176
|
-
}), s("both",
|
|
177
|
+
}), s("both", p)), o === "next")
|
|
177
178
|
switch (u) {
|
|
178
179
|
case t.STUDENT_INFORMATION:
|
|
179
180
|
case t.SCHOOL_GOALS:
|
|
@@ -192,7 +193,7 @@ const be = () => {
|
|
|
192
193
|
n({ id: e, chapterId: void 0, ...a });
|
|
193
194
|
break;
|
|
194
195
|
default:
|
|
195
|
-
n({ id: e, ...a }), s("both",
|
|
196
|
+
n({ id: e, ...a }), s("both", p);
|
|
196
197
|
}
|
|
197
198
|
},
|
|
198
199
|
[
|