@cuemath/leap 3.0.13-gs1 → 3.0.14
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/chapters-v2/comps/node-card/node-card-styled.js +32 -68
- package/dist/features/chapters-v2/comps/node-card/node-card-styled.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +95 -97
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js.map +1 -1
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js +96 -100
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-context.js +5 -8
- package/dist/features/cue-canvas/cue-canvas-context.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-core.js +75 -50
- package/dist/features/cue-canvas/cue-canvas-core.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas-provider.js +14 -16
- package/dist/features/cue-canvas/cue-canvas-provider.js.map +1 -1
- package/dist/features/cue-canvas/cue-canvas.js +13 -13
- package/dist/features/cue-canvas/cue-canvas.js.map +1 -1
- package/dist/features/cue-canvas/cue-cavas-styled.js +9 -8
- package/dist/features/cue-canvas/cue-cavas-styled.js.map +1 -1
- package/dist/features/cue-canvas/hooks/use-cue-canvas-actions.js +10 -14
- package/dist/features/cue-canvas/hooks/use-cue-canvas-actions.js.map +1 -1
- package/dist/features/ui/theme/tab.js +26 -0
- package/dist/features/ui/theme/tab.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +34 -34
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/index.d.ts +9 -7
- package/package.json +1 -1
- package/dist/features/ui/border-path-animation/border-path-animation-styled.js +0 -51
- package/dist/features/ui/border-path-animation/border-path-animation-styled.js.map +0 -1
- package/dist/features/ui/border-path-animation/border-path-animation.js +0 -108
- package/dist/features/ui/border-path-animation/border-path-animation.js.map +0 -1
@@ -1,20 +1,14 @@
|
|
1
1
|
import t from "styled-components";
|
2
|
-
import
|
3
|
-
import
|
2
|
+
import a from "../../../../assets/line-icons/icons/important.js";
|
3
|
+
import s from "../../../../assets/line-icons/icons/lock2.js";
|
4
4
|
import e from "../../../ui/layout/flex-view.js";
|
5
|
-
import
|
6
|
-
const
|
7
|
-
|
8
|
-
theme: r,
|
9
|
-
$disabled: n,
|
10
|
-
$isSheetLocked: a
|
11
|
-
}) => {
|
12
|
-
const { BLACK_1: p, BLACK: s, BLACK_T_15: i } = r.colors;
|
5
|
+
import d from "../../../ui/text/text.js";
|
6
|
+
const b = t(e)(({ theme: o, $disabled: r }) => {
|
7
|
+
const { BLACK: i, BLACK_T_15: n } = o.colors;
|
13
8
|
return `
|
14
|
-
cursor: ${
|
9
|
+
cursor: ${r ? "not-allowed" : "pointer"};
|
15
10
|
position: relative;
|
16
|
-
border-image: linear-gradient(to right, ${
|
17
|
-
${o && `outline: 1px solid ${i};`};
|
11
|
+
border-image: linear-gradient(to right, ${n} 0%, ${n} 100%);
|
18
12
|
|
19
13
|
.node-card-border {
|
20
14
|
position: absolute;
|
@@ -27,43 +21,13 @@ const m = t(e)(({
|
|
27
21
|
background: transparent;
|
28
22
|
}
|
29
23
|
|
30
|
-
.node-card-border > .border-path {
|
31
|
-
fill: none;
|
32
|
-
stroke: ${i};
|
33
|
-
stroke-width: 1.5;
|
34
|
-
}
|
35
|
-
|
36
|
-
.node-card-border > .border-path-animation {
|
37
|
-
fill: none;
|
38
|
-
stroke: ${s};
|
39
|
-
stroke-width: 1.5;
|
40
|
-
//* view box size 170 + 56 + 170 + 56 = 452
|
41
|
-
//* 452 / 2 = 226
|
42
|
-
stroke-dasharray: 226 226;
|
43
|
-
stroke-dashoffset: 0;
|
44
|
-
|
45
|
-
animation: dashmove 6s linear infinite;
|
46
|
-
}
|
47
|
-
|
48
|
-
@keyframes dashmove {
|
49
|
-
to {
|
50
|
-
stroke-dashoffset: -900;
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
24
|
&:hover {
|
55
|
-
${!
|
56
|
-
|
57
|
-
|
58
|
-
stroke-dasharray: 452;
|
59
|
-
animation: none;
|
60
|
-
}
|
61
|
-
`}
|
62
|
-
|
63
|
-
${o && !a && `outline: 1px solid ${s};`};
|
25
|
+
${!r && `
|
26
|
+
outline: 1px solid ${i};
|
27
|
+
`}
|
64
28
|
}
|
65
29
|
`;
|
66
|
-
}),
|
30
|
+
}), h = t(a)(({ theme: o }) => {
|
67
31
|
const { layout: r } = o;
|
68
32
|
return `
|
69
33
|
width: ${r.gutter * 0.75}px;
|
@@ -72,16 +36,16 @@ const m = t(e)(({
|
|
72
36
|
top: -2.5px;
|
73
37
|
right: -2.5px;
|
74
38
|
`;
|
75
|
-
}),
|
39
|
+
}), m = t(e)(({ $bgImage: o }) => `
|
76
40
|
background-image: url(${o});
|
77
41
|
|
78
42
|
& .context-menu {
|
79
43
|
justify-self: flex-end;
|
80
44
|
margin-left: auto;
|
81
45
|
}
|
82
|
-
`),
|
46
|
+
`), f = t(e)`
|
83
47
|
border-radius: 50%;
|
84
|
-
`,
|
48
|
+
`, $ = t(e)(() => `
|
85
49
|
position: relative;
|
86
50
|
padding: 12px 8px 12px 12px;
|
87
51
|
`), I = t(e)(({ $top: o, $right: r }) => `
|
@@ -90,43 +54,43 @@ const m = t(e)(({
|
|
90
54
|
right: ${r ?? 0}px;
|
91
55
|
z-index: 3;
|
92
56
|
`);
|
93
|
-
t(
|
57
|
+
t(s)(({}) => `
|
94
58
|
width: 28px;
|
95
59
|
height: 28px;
|
96
60
|
`);
|
97
|
-
const
|
61
|
+
const w = t(e)(({
|
98
62
|
theme: o,
|
99
63
|
$paddingRight: r,
|
100
|
-
$paddingLeft:
|
64
|
+
$paddingLeft: i
|
101
65
|
}) => {
|
102
|
-
const { BLACK_1:
|
66
|
+
const { BLACK_1: n, WHITE_1: p } = o.colors;
|
103
67
|
return `
|
104
68
|
position: absolute;
|
105
69
|
top: -10px;
|
106
70
|
right: -10px;
|
107
71
|
padding: 0px;
|
108
|
-
padding-left: ${
|
72
|
+
padding-left: ${i}px;
|
109
73
|
padding-right: ${r}px;
|
110
|
-
background: ${
|
74
|
+
background: ${n};
|
111
75
|
|
112
76
|
path {
|
113
77
|
fill: ${p};
|
114
78
|
}
|
115
79
|
`;
|
116
|
-
}),
|
80
|
+
}), W = t(d)(() => `
|
117
81
|
display: -webkit-box;
|
118
82
|
-webkit-box-orient: vertical;
|
119
83
|
-webkit-line-clamp: 2;
|
120
84
|
text-overflow: ellipsis;
|
121
85
|
overflow: hidden;
|
122
|
-
`),
|
86
|
+
`), k = t(e)(({ theme: o }) => `
|
123
87
|
cursor: pointer;
|
124
88
|
|
125
89
|
&:hover {
|
126
90
|
border-radius: 50%;
|
127
91
|
background: ${o.colors.WHITE_5};
|
128
92
|
}
|
129
|
-
`),
|
93
|
+
`), C = t(e)(({ theme: o, $visible: r }) => `
|
130
94
|
cursor: pointer;
|
131
95
|
|
132
96
|
position: absolute;
|
@@ -145,15 +109,15 @@ const v = t(e)(({
|
|
145
109
|
}
|
146
110
|
`);
|
147
111
|
export {
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
112
|
+
f as IconWrapper,
|
113
|
+
w as InProgressIconWrapper,
|
114
|
+
b as NodeCardContainer,
|
115
|
+
$ as NodeCardContentWrapper,
|
116
|
+
m as NodeCardInfoWrapper,
|
117
|
+
W as NodeCardTitle,
|
118
|
+
k as NodeKebabMenuWrapper,
|
119
|
+
C as NodeMenuOptionsWrapper,
|
156
120
|
I as SheetTagWrapper,
|
157
|
-
|
121
|
+
h as StyledImportantIcon
|
158
122
|
};
|
159
123
|
//# sourceMappingURL=node-card-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-card-styled.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport ImportantIcon from '../../../../assets/line-icons/icons/important';\nimport Lock2Icon from '../../../../assets/line-icons/icons/lock2';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ninterface INodeCardContainer {\n $
|
1
|
+
{"version":3,"file":"node-card-styled.js","sources":["../../../../../src/features/chapters-v2/comps/node-card/node-card-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport ImportantIcon from '../../../../assets/line-icons/icons/important';\nimport Lock2Icon from '../../../../assets/line-icons/icons/lock2';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Text from '../../../ui/text/text';\n\ninterface INodeCardContainer {\n $disabled: boolean;\n $isSheetLocked?: boolean;\n}\n\nconst NodeCardContainer = styled(FlexView)<INodeCardContainer>(({ theme, $disabled }) => {\n const { BLACK, BLACK_T_15 } = theme.colors;\n\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n position: relative;\n border-image: linear-gradient(to right, ${BLACK_T_15} 0%, ${BLACK_T_15} 100%);\n\n .node-card-border {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n width: 100%;\n height: 100%;\n pointer-events: none;\n background: transparent;\n }\n\n &:hover {\n ${\n !$disabled &&\n `\n outline: 1px solid ${BLACK};\n `\n } \n }\n `;\n});\n\nconst StyledImportantIcon = styled(ImportantIcon)(({ theme }) => {\n const { layout } = theme;\n\n return `\n width: ${layout.gutter * 0.75}px;\n height: ${layout.gutter * 0.75}px;\n position: absolute;\n top: -2.5px;\n right: -2.5px;\n `;\n});\n\ninterface INodeCardInfoWrapper {\n $bgImage: string;\n}\n\nconst NodeCardInfoWrapper = styled(FlexView)<INodeCardInfoWrapper>(({ $bgImage }) => {\n return `\n background-image: url(${$bgImage});\n\n & .context-menu {\n justify-self: flex-end;\n margin-left: auto;\n }\n `;\n});\n\nconst IconWrapper = styled(FlexView)`\n border-radius: 50%;\n`;\n\nconst NodeCardContentWrapper = styled(FlexView)(() => {\n return `\n position: relative;\n padding: 12px 8px 12px 12px;\n `;\n});\n\ninterface ISheetTagWrapper {\n $top?: number;\n $right?: number;\n}\n\nconst SheetTagWrapper = styled(FlexView)<ISheetTagWrapper>(({ $top, $right }) => {\n return `\n position: absolute;\n top: ${$top ?? 0}px;\n right: ${$right ?? 0}px;\n z-index: 3;\n`;\n});\n\nconst StyledLockIcon = styled(Lock2Icon)(({}) => {\n return `\n width: 28px;\n height: 28px;\n `;\n});\n\nconst InProgressIconWrapper = styled(FlexView)<{ $paddingRight: number; $paddingLeft: number }>(({\n theme,\n $paddingRight,\n $paddingLeft,\n}) => {\n const { BLACK_1, WHITE_1 } = theme.colors;\n\n return `\n position: absolute;\n top: -10px;\n right: -10px;\n padding: 0px;\n padding-left: ${$paddingLeft}px;\n padding-right: ${$paddingRight}px;\n background: ${BLACK_1};\n\n path {\n fill: ${WHITE_1};\n }\n `;\n});\n\nconst NodeCardTitle = styled(Text)(() => {\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n text-overflow: ellipsis;\n overflow: hidden;\n `;\n});\n\nconst NodeKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\ninterface INodeOptionsMenuWrapper {\n $visible: boolean;\n}\n\nconst NodeMenuOptionsWrapper = styled(FlexView)<INodeOptionsMenuWrapper>(({ theme, $visible }) => {\n return `\n cursor: pointer;\n\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n left: 0;\n\n transform-origin: top;\n transform: scaleY(${$visible ? 1 : 0});\n opacity: ${$visible ? 1 : 0};\n transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;\n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport {\n NodeCardContainer,\n StyledImportantIcon,\n NodeCardInfoWrapper,\n IconWrapper,\n NodeCardContentWrapper,\n SheetTagWrapper,\n StyledLockIcon,\n InProgressIconWrapper,\n NodeCardTitle,\n NodeKebabMenuWrapper,\n NodeMenuOptionsWrapper,\n};\n"],"names":["NodeCardContainer","styled","FlexView","theme","$disabled","BLACK","BLACK_T_15","StyledImportantIcon","ImportantIcon","layout","NodeCardInfoWrapper","$bgImage","IconWrapper","NodeCardContentWrapper","SheetTagWrapper","$top","$right","Lock2Icon","InProgressIconWrapper","$paddingRight","$paddingLeft","BLACK_1","WHITE_1","NodeCardTitle","Text","NodeKebabMenuWrapper","NodeMenuOptionsWrapper","$visible"],"mappings":";;;;;AAYM,MAAAA,IAAoBC,EAAOC,CAAQ,EAAsB,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgB;AACvF,QAAM,EAAE,OAAAC,GAAO,YAAAC,MAAeH,EAAM;AAE7B,SAAA;AAAA,cACKC,IAAY,gBAAgB,SAAS;AAAA;AAAA,8CAELE,CAAU,QAAQA,CAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAelE,CAACF,KACD;AAAA,+BACuBC,CAAK;AAAA,SAE9B;AAAA;AAAA;AAGN,CAAC,GAEKE,IAAsBN,EAAOO,CAAa,EAAE,CAAC,EAAE,OAAAL,QAAY;AACzD,QAAA,EAAE,QAAAM,EAAW,IAAAN;AAEZ,SAAA;AAAA,aACIM,EAAO,SAAS,IAAI;AAAA,cACnBA,EAAO,SAAS,IAAI;AAAA;AAAA;AAAA;AAAA;AAKlC,CAAC,GAMKC,IAAsBT,EAAOC,CAAQ,EAAwB,CAAC,EAAE,UAAAS,QAC7D;AAAA,4BACmBA,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAOnC,GAEKC,IAAcX,EAAOC,CAAQ;AAAA;AAAA,GAI7BW,IAAyBZ,EAAOC,CAAQ,EAAE,MACvC;AAAA;AAAA;AAAA,GAIR,GAOKY,IAAkBb,EAAOC,CAAQ,EAAoB,CAAC,EAAE,MAAAa,GAAM,QAAAC,QAC3D;AAAA;AAAA,SAEAD,KAAQ,CAAC;AAAA,WACPC,KAAU,CAAC;AAAA;AAAA,CAGrB;AAEsBf,EAAOgB,CAAS,EAAE,CAAC,OACjC;AAAA;AAAA;AAAA,GAIR;AAED,MAAMC,IAAwBjB,EAAOC,CAAQ,EAAmD,CAAC;AAAA,EAC/F,OAAAC;AAAA,EACA,eAAAgB;AAAA,EACA,cAAAC;AACF,MAAM;AACJ,QAAM,EAAE,SAAAC,GAAS,SAAAC,MAAYnB,EAAM;AAE5B,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAKWiB,CAAY;AAAA,qBACXD,CAAa;AAAA,kBAChBE,CAAO;AAAA;AAAA;AAAA,cAGXC,CAAO;AAAA;AAAA;AAGrB,CAAC,GAEKC,IAAgBtB,EAAOuB,CAAI,EAAE,MAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAOR,GAEKC,IAAuBxB,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAC,QACxC;AAAA;AAAA;AAAA;AAAA;AAAA,oBAKWA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC,GAMKuB,IAAyBzB,EAAOC,CAAQ,EAA2B,CAAC,EAAE,OAAAC,GAAO,UAAAwB,QAC1E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASeA,IAAW,IAAI,CAAC;AAAA,eACzBA,IAAW,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,oBAKXxB,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC;"}
|
@@ -1,128 +1,127 @@
|
|
1
|
-
import { jsx as e, jsxs as
|
2
|
-
import { memo as
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import
|
15
|
-
import
|
16
|
-
|
17
|
-
const le = { renderer: "canvas", autoplay: !1 }, Le = z((A) => {
|
1
|
+
import { jsx as e, jsxs as d, Fragment as K } from "react/jsx-runtime";
|
2
|
+
import { memo as X, useRef as j, useCallback as m } from "react";
|
3
|
+
import G from "../../../../../assets/line-icons/icons/eye2.js";
|
4
|
+
import z from "../../../../../assets/line-icons/icons/redo.js";
|
5
|
+
import F from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
6
|
+
import P from "../../../../ui/context-menu/context-menu.js";
|
7
|
+
import Y from "../../../../ui/lottie-animation/lottie-animation.js";
|
8
|
+
import Z from "../../../../ui/text/text.js";
|
9
|
+
import { BLOCK_TYPE as q } from "../../../constants/block-constants.js";
|
10
|
+
import { NODE_CARD_STATES as J } from "../../../constants/node-constants.js";
|
11
|
+
import { getNodeTypeBasedBgImage as Q } from "../../../utils/index.js";
|
12
|
+
import { getNodeCardBasedIcon as U } from "../../../utils/node-card-utils.js";
|
13
|
+
import { NodeCardContainer as V, NodeCardInfoWrapper as ee, IconWrapper as te, StyledImportantIcon as re, NodeCardContentWrapper as ne, NodeCardTitle as oe } from "../node-card-styled.js";
|
14
|
+
import ae from "../node-card-tags.js";
|
15
|
+
import ie from "../node-menu-options/node-menu-options.js";
|
16
|
+
const ce = { renderer: "canvas", autoplay: !1 }, ye = X((O) => {
|
18
17
|
const {
|
19
18
|
nodeData: t,
|
20
|
-
imageHue:
|
21
|
-
blockType:
|
19
|
+
imageHue: b,
|
20
|
+
blockType: y,
|
22
21
|
onNodeAttempt: a,
|
23
22
|
onNodeReattempt: i,
|
24
|
-
onNodeReview:
|
25
|
-
onNodeView:
|
26
|
-
isStudent:
|
27
|
-
} =
|
23
|
+
onNodeReview: c,
|
24
|
+
onNodeView: r,
|
25
|
+
isStudent: A
|
26
|
+
} = O, {
|
28
27
|
accuracy: L,
|
29
|
-
attempt_location:
|
30
|
-
node_type:
|
31
|
-
card_header:
|
32
|
-
title:
|
33
|
-
state:
|
34
|
-
is_optional:
|
35
|
-
sheet_statement:
|
36
|
-
permissions:
|
37
|
-
marked_as_completed:
|
28
|
+
attempt_location: S,
|
29
|
+
node_type: l,
|
30
|
+
card_header: E,
|
31
|
+
title: T,
|
32
|
+
state: C,
|
33
|
+
is_optional: x,
|
34
|
+
sheet_statement: $,
|
35
|
+
permissions: R,
|
36
|
+
marked_as_completed: g,
|
37
|
+
user_attempt_id: _
|
38
38
|
} = t, {
|
39
|
-
can_review:
|
40
|
-
can_start:
|
41
|
-
can_resume:
|
42
|
-
can_reset:
|
43
|
-
} =
|
44
|
-
(
|
45
|
-
switch (
|
39
|
+
can_review: s,
|
40
|
+
can_start: p,
|
41
|
+
can_resume: u,
|
42
|
+
can_reset: I
|
43
|
+
} = R, v = y === q.GOAL, o = C === J.LOCKED, w = S === "INCLASS", f = !(p || u) && (I || s), h = j(null), B = Q(l), { lottie: M } = U(l), k = m(
|
44
|
+
(n) => {
|
45
|
+
switch (n) {
|
46
46
|
case "node-card-review":
|
47
|
-
|
47
|
+
s && _ ? c == null || c(t) : r == null || r(t);
|
48
48
|
return;
|
49
49
|
case "node-card-reattempt":
|
50
50
|
i == null || i(t);
|
51
51
|
return;
|
52
52
|
default:
|
53
|
-
throw new Error(`No callback function for ${
|
53
|
+
throw new Error(`No callback function for ${n}`);
|
54
54
|
}
|
55
55
|
},
|
56
|
-
[t, i,
|
57
|
-
),
|
58
|
-
f ||
|
56
|
+
[s, t, i, c, r, _]
|
57
|
+
), W = m(() => {
|
58
|
+
f || o || (p || u ? a == null || a(t) : g && (r == null || r(t)));
|
59
59
|
}, [
|
60
|
-
h,
|
61
60
|
u,
|
61
|
+
p,
|
62
62
|
t,
|
63
63
|
a,
|
64
|
-
|
64
|
+
r,
|
65
65
|
f,
|
66
|
-
|
67
|
-
|
68
|
-
]),
|
69
|
-
var
|
70
|
-
|
71
|
-
}, [
|
72
|
-
var
|
73
|
-
(
|
74
|
-
}, []),
|
66
|
+
o,
|
67
|
+
g
|
68
|
+
]), N = m(() => {
|
69
|
+
var n;
|
70
|
+
o || (n = h.current) == null || n.play();
|
71
|
+
}, [o]), D = m(() => {
|
72
|
+
var n;
|
73
|
+
(n = h.current) == null || n.stop();
|
74
|
+
}, []), H = [
|
75
75
|
{
|
76
76
|
id: "node-card-review",
|
77
77
|
label: "Review",
|
78
|
-
icon:
|
79
|
-
disabled: !
|
78
|
+
icon: G,
|
79
|
+
disabled: !s,
|
80
80
|
onClick: k
|
81
81
|
},
|
82
82
|
{
|
83
83
|
id: "node-card-reattempt",
|
84
84
|
label: "Reattempt",
|
85
|
-
icon:
|
86
|
-
disabled: !
|
85
|
+
icon: z,
|
86
|
+
disabled: !I,
|
87
87
|
onClick: k
|
88
88
|
}
|
89
89
|
];
|
90
90
|
return /* @__PURE__ */ e(
|
91
|
-
|
91
|
+
P,
|
92
92
|
{
|
93
93
|
targetElement: /* @__PURE__ */ e(
|
94
|
-
|
94
|
+
V,
|
95
95
|
{
|
96
|
-
$
|
97
|
-
$
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
q,
|
96
|
+
$background: `${b}_2`,
|
97
|
+
$disabled: o,
|
98
|
+
onClick: W,
|
99
|
+
children: /* @__PURE__ */ d(
|
100
|
+
F,
|
102
101
|
{
|
103
102
|
renderAs: "primary",
|
104
|
-
tooltipItem:
|
103
|
+
tooltipItem: $,
|
105
104
|
position: "bottom",
|
106
105
|
zIndex: 5,
|
107
|
-
hidden:
|
106
|
+
hidden: !$,
|
108
107
|
parentWidth: "100%",
|
109
108
|
widthX: 11.25,
|
110
109
|
children: [
|
111
|
-
/* @__PURE__ */
|
112
|
-
|
110
|
+
/* @__PURE__ */ d(
|
111
|
+
ee,
|
113
112
|
{
|
114
113
|
$flexDirection: "row",
|
115
114
|
$alignItems: "center",
|
116
115
|
$heightX: 3.5,
|
117
|
-
$bgImage:
|
116
|
+
$bgImage: B,
|
118
117
|
$gutterX: 0.78125,
|
119
118
|
$flexGap: 8.5,
|
120
|
-
$opacity:
|
121
|
-
onMouseEnter:
|
122
|
-
onMouseLeave:
|
119
|
+
$opacity: o ? 0.5 : 1,
|
120
|
+
onMouseEnter: N,
|
121
|
+
onMouseLeave: D,
|
123
122
|
children: [
|
124
|
-
/* @__PURE__ */
|
125
|
-
|
123
|
+
/* @__PURE__ */ d(
|
124
|
+
te,
|
126
125
|
{
|
127
126
|
$width: 31,
|
128
127
|
$height: 31,
|
@@ -132,42 +131,41 @@ const le = { renderer: "canvas", autoplay: !1 }, Le = z((A) => {
|
|
132
131
|
$justifyContent: "center",
|
133
132
|
children: [
|
134
133
|
/* @__PURE__ */ e(
|
135
|
-
|
134
|
+
Y,
|
136
135
|
{
|
137
|
-
src:
|
138
|
-
ref:
|
139
|
-
settings:
|
136
|
+
src: M,
|
137
|
+
ref: h,
|
138
|
+
settings: ce
|
140
139
|
}
|
141
140
|
),
|
142
|
-
!
|
141
|
+
!x && /* @__PURE__ */ e(re, {})
|
143
142
|
]
|
144
143
|
}
|
145
144
|
),
|
146
|
-
/* @__PURE__ */
|
147
|
-
|
145
|
+
/* @__PURE__ */ d(Z, { $renderAs: "ac4-black", $color: "BLACK", children: [
|
146
|
+
E,
|
148
147
|
" ",
|
149
|
-
|
150
|
-
] })
|
151
|
-
b && /* @__PURE__ */ e(J, { borderColor: "BLACK_1", borderWidth: 1 })
|
148
|
+
w && "• CW"
|
149
|
+
] })
|
152
150
|
]
|
153
151
|
}
|
154
152
|
),
|
155
153
|
/* @__PURE__ */ e(
|
156
|
-
|
154
|
+
ae,
|
157
155
|
{
|
158
|
-
nodeType:
|
159
|
-
state:
|
156
|
+
nodeType: l,
|
157
|
+
state: C,
|
160
158
|
accuracy: L,
|
161
|
-
isStudent:
|
159
|
+
isStudent: A
|
162
160
|
}
|
163
161
|
),
|
164
|
-
!
|
165
|
-
|
162
|
+
!v && /* @__PURE__ */ e(ne, { $background: "WHITE_1", $heightX: 4, children: /* @__PURE__ */ e(
|
163
|
+
oe,
|
166
164
|
{
|
167
165
|
$renderAs: "ab3",
|
168
166
|
$color: "BLACK_1",
|
169
|
-
$opacity:
|
170
|
-
children:
|
167
|
+
$opacity: o ? 0.5 : 1,
|
168
|
+
children: T
|
171
169
|
}
|
172
170
|
) })
|
173
171
|
]
|
@@ -179,11 +177,11 @@ const le = { renderer: "canvas", autoplay: !1 }, Le = z((A) => {
|
|
179
177
|
menuWidth: "100%",
|
180
178
|
menuZIndex: 6,
|
181
179
|
menuOffset: 2,
|
182
|
-
menuElement: f ? /* @__PURE__ */ e(
|
180
|
+
menuElement: f ? /* @__PURE__ */ e(ie, { options: H }) : /* @__PURE__ */ e(K, {})
|
183
181
|
}
|
184
182
|
);
|
185
183
|
});
|
186
184
|
export {
|
187
|
-
|
185
|
+
ye as default
|
188
186
|
};
|
189
187
|
//# sourceMappingURL=student-actions.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"student-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/student-actions/student-actions.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\n\nimport { memo, useCallback, useRef, type FC } from 'react';\n\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport BorderPathAnimation from '../../../../ui/border-path-animation/border-path-animation';\nimport ContextMenu from '../../../../ui/context-menu/context-menu';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst renderSettings = { renderer: 'canvas', autoplay: false };\n\nconst StudentActions: FC<Omit<INodeCardProps, 'userType'>> = memo(props => {\n const {\n nodeData,\n imageHue,\n blockType,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n isStudent,\n } = props;\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n marked_as_completed: teacherMarkedAsCompleted,\n } = nodeData;\n const {\n can_review: canReview,\n can_start: canStart,\n can_resume: canResume,\n can_reset: canReset,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const sheetNotStarted = state === NODE_CARD_STATES.NOT_STARTED;\n const sheetInProgress = state === NODE_CARD_STATES.IN_PROGRESS;\n const inClassSheet = attemptLocation === 'INCLASS';\n const canStartOrResume = canStart || canResume;\n\n const showCardAnimation = !isOptional && (sheetInProgress || sheetNotStarted);\n const renderOptions = !canStartOrResume && (canReset || canReview);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-review':\n teacherMarkedAsCompleted ? onNodeView?.(nodeData) : onNodeReview?.(nodeData);\n\n return;\n\n case 'node-card-reattempt':\n onNodeReattempt?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [nodeData, onNodeReattempt, onNodeReview, onNodeView, teacherMarkedAsCompleted],\n );\n\n const handleOnNodeCardClick = useCallback(() => {\n if (renderOptions || sheetLocked) return;\n\n if (canStart || canResume) {\n onNodeAttempt?.(nodeData);\n } else if (teacherMarkedAsCompleted) {\n onNodeView?.(nodeData);\n }\n }, [\n canResume,\n canStart,\n nodeData,\n onNodeAttempt,\n onNodeView,\n renderOptions,\n sheetLocked,\n teacherMarkedAsCompleted,\n ]);\n\n const handleOnMouseEnter = useCallback(() => {\n if (sheetLocked) return;\n animationRef.current?.play();\n }, [sheetLocked]);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-review',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <ContextMenu\n targetElement={\n <Styled.NodeCardContainer\n $showOutline={!showCardAnimation}\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={!sheetStatement}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $opacity={sheetLocked ? 0.5 : 1}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <LottieAnimation\n src={nodeCardLottie}\n ref={animationRef}\n settings={renderSettings}\n />\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\">\n {cardHeader} {inClassSheet && `• CW`}\n </Text>\n {showCardAnimation && <BorderPathAnimation borderColor=\"BLACK_1\" borderWidth={1} />}\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n isStudent={isStudent}\n />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper $background=\"WHITE_1\" $heightX={4}>\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n }\n startLeft\n menuWidth=\"100%\"\n menuZIndex={6}\n menuOffset={2}\n menuElement={renderOptions ? <NodeMenuOptions options={menuOptions} /> : <></>}\n />\n );\n});\n\nexport default StudentActions;\n"],"names":["renderSettings","StudentActions","memo","props","nodeData","imageHue","blockType","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeView","isStudent","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","teacherMarkedAsCompleted","canReview","canStart","canResume","canReset","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","sheetNotStarted","sheetInProgress","inClassSheet","canStartOrResume","showCardAnimation","renderOptions","animationRef","useRef","nodeBgImage","getNodeTypeBasedBgImage","nodeCardLottie","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnNodeCardClick","handleOnMouseEnter","_a","handleOnMouseLeave","menuOptions","Eye2Icon","RedoIcon","jsx","ContextMenu","Styled.NodeCardContainer","jsxs","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","BorderPathAnimation","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","NodeMenuOptions","Fragment"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAMA,KAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GAEvDC,KAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,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AAY;AAAA,MACZ,YAAY;AAAA,MACZ,aAAamB,IAAgB,gBAAAiB,EAACc,MAAgB,SAASjB,EAAA,CAAa,IAAO,gBAAAG,EAAAe,GAAA,EAAA;AAAA,IAAA;AAAA,EAAA;AAGjF,CAAC;"}
|
1
|
+
{"version":3,"file":"student-actions.js","sources":["../../../../../../src/features/chapters-v2/comps/node-card/student-actions/student-actions.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../../ui/lottie-animation/types';\nimport type { INodeCardProps } from '../node-card-types';\nimport type { INodeMenuOption } from '../node-menu-options/node-menu-options-types';\n\nimport { memo, useCallback, useRef, type FC } from 'react';\n\nimport Eye2Icon from '../../../../../assets/line-icons/icons/eye2';\nimport RedoIcon from '../../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../../ui/context-menu/context-menu';\nimport LottieAnimation from '../../../../ui/lottie-animation/lottie-animation';\nimport Text from '../../../../ui/text/text';\nimport { BLOCK_TYPE } from '../../../constants/block-constants';\nimport { NODE_CARD_STATES } from '../../../constants/node-constants';\nimport { getNodeTypeBasedBgImage } from '../../../utils';\nimport { getNodeCardBasedIcon } from '../../../utils/node-card-utils';\nimport * as Styled from '../node-card-styled';\nimport NodeCardTags from '../node-card-tags';\nimport NodeMenuOptions from '../node-menu-options/node-menu-options';\n\nconst renderSettings = { renderer: 'canvas', autoplay: false };\n\nconst StudentActions: FC<Omit<INodeCardProps, 'userType'>> = memo(props => {\n const {\n nodeData,\n imageHue,\n blockType,\n onNodeAttempt,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n isStudent,\n } = props;\n const {\n accuracy,\n attempt_location: attemptLocation,\n node_type: nodeType,\n card_header: cardHeader,\n title,\n state,\n is_optional: isOptional,\n sheet_statement: sheetStatement,\n permissions,\n marked_as_completed: teacherMarkedAsCompleted,\n user_attempt_id: userAttemptId,\n } = nodeData;\n const {\n can_review: canReview,\n can_start: canStart,\n can_resume: canResume,\n can_reset: canReset,\n } = permissions;\n\n const isGoalBlock = blockType === BLOCK_TYPE.GOAL;\n const sheetLocked = state === NODE_CARD_STATES.LOCKED;\n const inClassSheet = attemptLocation === 'INCLASS';\n const canStartOrResume = canStart || canResume;\n\n const renderOptions = !canStartOrResume && (canReset || canReview);\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const nodeBgImage = getNodeTypeBasedBgImage(nodeType);\n const { lottie: nodeCardLottie } = getNodeCardBasedIcon(nodeType);\n\n const handleOnMenuOptionClick = useCallback(\n (optionId: string) => {\n switch (optionId) {\n case 'node-card-review':\n if (canReview && userAttemptId) {\n onNodeReview?.(nodeData);\n } else {\n onNodeView?.(nodeData);\n }\n\n return;\n\n case 'node-card-reattempt':\n onNodeReattempt?.(nodeData);\n\n return;\n\n default:\n throw new Error(`No callback function for ${optionId}`);\n }\n },\n [canReview, nodeData, onNodeReattempt, onNodeReview, onNodeView, userAttemptId],\n );\n\n const handleOnNodeCardClick = useCallback(() => {\n if (renderOptions || sheetLocked) return;\n\n if (canStart || canResume) {\n onNodeAttempt?.(nodeData);\n } else if (teacherMarkedAsCompleted) {\n onNodeView?.(nodeData);\n }\n }, [\n canResume,\n canStart,\n nodeData,\n onNodeAttempt,\n onNodeView,\n renderOptions,\n sheetLocked,\n teacherMarkedAsCompleted,\n ]);\n\n const handleOnMouseEnter = useCallback(() => {\n if (sheetLocked) return;\n animationRef.current?.play();\n }, [sheetLocked]);\n\n const handleOnMouseLeave = useCallback(() => {\n animationRef.current?.stop();\n }, []);\n\n const menuOptions: INodeMenuOption[] = [\n {\n id: 'node-card-review',\n label: 'Review',\n icon: Eye2Icon,\n disabled: !canReview,\n onClick: handleOnMenuOptionClick,\n },\n {\n id: 'node-card-reattempt',\n label: 'Reattempt',\n icon: RedoIcon,\n disabled: !canReset,\n onClick: handleOnMenuOptionClick,\n },\n ];\n\n return (\n <ContextMenu\n targetElement={\n <Styled.NodeCardContainer\n $background={`${imageHue}_2`}\n $disabled={sheetLocked}\n onClick={handleOnNodeCardClick}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n tooltipItem={sheetStatement}\n position=\"bottom\"\n zIndex={5}\n hidden={!sheetStatement}\n parentWidth=\"100%\"\n widthX={11.25}\n >\n <Styled.NodeCardInfoWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $heightX={3.5}\n $bgImage={nodeBgImage}\n $gutterX={0.78125}\n $flexGap={8.5}\n $opacity={sheetLocked ? 0.5 : 1}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n >\n <Styled.IconWrapper\n $width={31}\n $height={31}\n $background=\"WHITE_1\"\n $position=\"relative\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n <LottieAnimation\n src={nodeCardLottie}\n ref={animationRef}\n settings={renderSettings}\n />\n {!isOptional && <Styled.StyledImportantIcon />}\n </Styled.IconWrapper>\n\n <Text $renderAs=\"ac4-black\" $color=\"BLACK\">\n {cardHeader} {inClassSheet && `• CW`}\n </Text>\n </Styled.NodeCardInfoWrapper>\n\n <NodeCardTags\n nodeType={nodeType}\n state={state}\n accuracy={accuracy}\n isStudent={isStudent}\n />\n\n {!isGoalBlock && (\n <Styled.NodeCardContentWrapper $background=\"WHITE_1\" $heightX={4}>\n <Styled.NodeCardTitle\n $renderAs=\"ab3\"\n $color=\"BLACK_1\"\n $opacity={sheetLocked ? 0.5 : 1}\n >\n {title}\n </Styled.NodeCardTitle>\n </Styled.NodeCardContentWrapper>\n )}\n </ArrowTooltip>\n </Styled.NodeCardContainer>\n }\n startLeft\n menuWidth=\"100%\"\n menuZIndex={6}\n menuOffset={2}\n menuElement={renderOptions ? <NodeMenuOptions options={menuOptions} /> : <></>}\n />\n );\n});\n\nexport default StudentActions;\n"],"names":["renderSettings","StudentActions","memo","props","nodeData","imageHue","blockType","onNodeAttempt","onNodeReattempt","onNodeReview","onNodeView","isStudent","accuracy","attemptLocation","nodeType","cardHeader","title","state","isOptional","sheetStatement","permissions","teacherMarkedAsCompleted","userAttemptId","canReview","canStart","canResume","canReset","isGoalBlock","BLOCK_TYPE","sheetLocked","NODE_CARD_STATES","inClassSheet","renderOptions","animationRef","useRef","nodeBgImage","getNodeTypeBasedBgImage","nodeCardLottie","getNodeCardBasedIcon","handleOnMenuOptionClick","useCallback","optionId","handleOnNodeCardClick","handleOnMouseEnter","_a","handleOnMouseLeave","menuOptions","Eye2Icon","RedoIcon","jsx","ContextMenu","Styled.NodeCardContainer","jsxs","ArrowTooltip","Styled.NodeCardInfoWrapper","Styled.IconWrapper","LottieAnimation","Styled.StyledImportantIcon","Text","NodeCardTags","Styled.NodeCardContentWrapper","Styled.NodeCardTitle","NodeMenuOptions","Fragment"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAMA,KAAiB,EAAE,UAAU,UAAU,UAAU,GAAM,GAEvDC,KAAuDC,EAAK,CAASC,MAAA;AACnE,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,EACE,IAAAR,GACE;AAAA,IACJ,UAAAS;AAAA,IACA,kBAAkBC;AAAA,IAClB,WAAWC;AAAA,IACX,aAAaC;AAAA,IACb,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAaC;AAAA,IACb,iBAAiBC;AAAA,IACjB,aAAAC;AAAA,IACA,qBAAqBC;AAAA,IACrB,iBAAiBC;AAAA,EACf,IAAAlB,GACE;AAAA,IACJ,YAAYmB;AAAA,IACZ,WAAWC;AAAA,IACX,YAAYC;AAAA,IACZ,WAAWC;AAAA,EACT,IAAAN,GAEEO,IAAcrB,MAAcsB,EAAW,MACvCC,IAAcZ,MAAUa,EAAiB,QACzCC,IAAelB,MAAoB,WAGnCmB,IAAgB,EAFGR,KAAYC,OAEOC,KAAYH,IAClDU,IAAeC,EAAmC,IAAI,GACtDC,I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