@cuemath/leap 2.8.61-as13 → 2.8.61-as16
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/closed-eye.js +23 -0
- package/dist/assets/line-icons/icons/closed-eye.js.map +1 -0
- package/dist/features/chapters-v2/comps/node-card/student-actions/student-actions.js +39 -39
- 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 +83 -81
- package/dist/features/chapters-v2/comps/node-card/teacher-actions/teacher-actions.js.map +1 -1
- package/dist/features/chapters-v2/constants/node-constants.js.map +1 -1
- package/dist/features/homework/card-title.js +21 -0
- package/dist/features/homework/card-title.js.map +1 -0
- package/dist/features/homework/homework-card-view.js +133 -0
- package/dist/features/homework/homework-card-view.js.map +1 -0
- package/dist/features/homework/homework-card.js +153 -243
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js +38 -20
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +105 -89
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/styles.js +31 -18
- package/dist/features/homework/styles.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js +51 -52
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js +36 -35
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +33 -32
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js +25 -37
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/index.d.ts +13 -0
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import r from "styled-components";
|
2
|
-
import
|
2
|
+
import n from "../../assets/line-icons/icons/minus2.js";
|
3
3
|
import e from "../ui/layout/flex-view.js";
|
4
|
-
import
|
4
|
+
import i from "../ui/text/text.js";
|
5
5
|
const l = r(e)(({ theme: o }) => `
|
6
6
|
cursor: pointer;
|
7
7
|
width: 24px;
|
@@ -12,13 +12,13 @@ const l = r(e)(({ theme: o }) => `
|
|
12
12
|
border-radius: 50%;
|
13
13
|
background: ${o.colors.WHITE_5};
|
14
14
|
}
|
15
|
-
`), d = r(
|
15
|
+
`), d = r(i)`
|
16
16
|
display: -webkit-box;
|
17
17
|
-webkit-line-clamp: 1;
|
18
18
|
-webkit-box-orient: vertical;
|
19
19
|
overflow: hidden;
|
20
20
|
text-overflow: ellipsis;
|
21
|
-
`,
|
21
|
+
`, u = r(e)(({
|
22
22
|
$shouldopenonright: o,
|
23
23
|
$visible: t
|
24
24
|
}) => `
|
@@ -33,7 +33,7 @@ const l = r(e)(({ theme: o }) => `
|
|
33
33
|
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
|
34
34
|
box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);
|
35
35
|
z-index: 10;
|
36
|
-
`),
|
36
|
+
`), x = r(e)`
|
37
37
|
border: 1px solid ${({ theme: o }) => o.colors.BLACK_T_15};
|
38
38
|
|
39
39
|
&:hover {
|
@@ -45,15 +45,15 @@ const l = r(e)(({ theme: o }) => `
|
|
45
45
|
background-size: cover;
|
46
46
|
background-position: center;
|
47
47
|
overflow: hidden;
|
48
|
-
` : "overflow: hidden;"),
|
48
|
+
` : "overflow: hidden;"), h = r(e)`
|
49
49
|
display: flex;
|
50
50
|
align-items: center;
|
51
51
|
justify-content: center;
|
52
|
-
`,
|
52
|
+
`, w = r(e)`
|
53
53
|
position: absolute;
|
54
54
|
right: -18px;
|
55
55
|
top: -4px;
|
56
|
-
`,
|
56
|
+
`, f = r.img(({ theme: o }) => {
|
57
57
|
const { gutter: t } = o.layout;
|
58
58
|
return `
|
59
59
|
border: 1px solid ${o.colors.BLACK_T_15};
|
@@ -61,11 +61,11 @@ const l = r(e)(({ theme: o }) => `
|
|
61
61
|
height: ${t * 4}px;
|
62
62
|
border-radius: 50%;
|
63
63
|
`;
|
64
|
-
}), g = r(
|
64
|
+
}), g = r(n)`
|
65
65
|
path {
|
66
66
|
stroke: ${({ theme: o }) => o.colors.WHITE};
|
67
67
|
}
|
68
|
-
`, m = r(
|
68
|
+
`, m = r(i)`
|
69
69
|
display: -webkit-box;
|
70
70
|
-webkit-line-clamp: 2;
|
71
71
|
-webkit-box-orient: vertical;
|
@@ -87,29 +87,42 @@ const k = r(e)(({
|
|
87
87
|
path {
|
88
88
|
fill: ${o.colors.WHITE_1};
|
89
89
|
}
|
90
|
-
`), v = r(
|
90
|
+
`), v = r(i)`
|
91
91
|
white-space: nowrap;
|
92
92
|
overflow: hidden;
|
93
93
|
text-overflow: ellipsis;
|
94
|
-
`,
|
94
|
+
`, C = r(e)`
|
95
95
|
position: absolute;
|
96
96
|
z-index: 6;
|
97
97
|
top: calc(100% - 36px);
|
98
98
|
right: 12px;
|
99
99
|
transform-origin: top;
|
100
100
|
transform: scaleY(1);
|
101
|
+
`, $ = r(e)`
|
102
|
+
position: absolute;
|
103
|
+
top: 0;
|
104
|
+
left: 0;
|
105
|
+
width: 100%;
|
106
|
+
height: 100%;
|
107
|
+
opacity: 0.5;
|
108
|
+
`, y = r(e)`
|
109
|
+
position: absolute;
|
110
|
+
right: 42px;
|
111
|
+
top: 24px;
|
101
112
|
`;
|
102
113
|
export {
|
103
|
-
|
104
|
-
|
105
|
-
|
114
|
+
f as BannerImage,
|
115
|
+
w as BannerImageWrapper,
|
116
|
+
$ as BlurContainer,
|
117
|
+
y as BlurFlexView,
|
118
|
+
x as CardContainer,
|
106
119
|
l as CardKebabMenuWrapper,
|
107
|
-
|
120
|
+
u as CardMenuOptionsWrapper,
|
108
121
|
k as CardOptionWrapper,
|
109
122
|
b as CardWrapper,
|
110
123
|
m as HeaderText,
|
111
|
-
|
112
|
-
|
124
|
+
h as IconWrapper,
|
125
|
+
C as MenuWrapper,
|
113
126
|
v as OptionText,
|
114
127
|
g as StyledMinus2Icon,
|
115
128
|
d as SubHeaderText
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../src/features/homework/styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Minus2Icon from '../../assets/line-icons/icons/minus2';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\ninterface ICardWrapperProps {\n $bgImage: string;\n}\ninterface ICardOptionsMenuWrapperProps {\n $visible: boolean;\n $shouldopenonright: boolean;\n}\n\nexport const CardKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n width: 24px;\n height: 24px;\n \n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport const SubHeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const CardMenuOptionsWrapper = styled(FlexView)<ICardOptionsMenuWrapperProps>(({\n $shouldopenonright,\n $visible,\n}) => {\n return `\n cursor: pointer;\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n right: ${$shouldopenonright ? 0 : 'auto'};\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 box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);\n z-index: 10;\n `;\n});\n\nexport const CardContainer = styled(FlexView)`\n border: 1px solid ${({ theme }) => theme.colors.BLACK_T_15};\n\n &:hover {\n border: 1px solid ${({ theme }) => theme.colors.BLACK};\n }\n`;\n\nexport const CardWrapper = styled(FlexView)<ICardWrapperProps>(({ $bgImage }) => {\n if ($bgImage) {\n return `\n background-image: url(${$bgImage});\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n overflow: hidden;\n `;\n }\n\n return 'overflow: hidden;';\n});\n\nexport const IconWrapper = styled(FlexView)`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const BannerImageWrapper = styled(FlexView)`\n position: absolute;\n right: -18px;\n top: -4px;\n`;\n\nexport const BannerImage = styled.img(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n border: 1px solid ${theme.colors.BLACK_T_15};\n width: ${gutter * 4}px;\n height: ${gutter * 4}px;\n border-radius: 50%;\n `;\n});\n\nexport const StyledMinus2Icon = styled(Minus2Icon)`\n path {\n stroke: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const HeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\ninterface ICardOptionWrapperProps {\n $disabled?: boolean;\n}\ninterface ICardOptionsProps {\n $top: number;\n $left: number;\n}\n\nexport const CardOptions = styled(FlexView)<ICardOptionsProps>``;\n\nexport const CardOptionWrapper = styled(FlexView)<ICardOptionWrapperProps>(({\n theme,\n $disabled,\n}) => {\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n \n &:hover {\n background: ${$disabled ? 'transparent' : theme.colors.BLACK};\n };\n \n path {\n fill: ${theme.colors.WHITE_1};\n }\n `;\n});\n\nexport const OptionText = styled(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const MenuWrapper = styled(FlexView)`\n position: absolute;\n z-index: 6;\n top: calc(100% - 36px);\n right: 12px;\n transform-origin: top;\n transform: scaleY(1);\n`;\n"],"names":["CardKebabMenuWrapper","styled","FlexView","theme","SubHeaderText","Text","CardMenuOptionsWrapper","$shouldopenonright","$visible","CardContainer","CardWrapper","$bgImage","IconWrapper","BannerImageWrapper","BannerImage","gutter","StyledMinus2Icon","Minus2Icon","HeaderText","CardOptionWrapper","$disabled","OptionText","MenuWrapper"],"mappings":";;;;AAcO,MAAMA,IAAuBC,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAC,QAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAQWA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC,GAEYC,IAAgBH,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ3BC,IAAyBL,EAAOC,CAAQ,EAAgC,CAAC;AAAA,EACpF,oBAAAK;AAAA,EACA,UAAAC;AACF,MACS;AAAA;AAAA;AAAA;AAAA;AAAA,aAKID,IAAqB,IAAI,MAAM;AAAA;AAAA,wBAEpBC,IAAW,IAAI,CAAC;AAAA,eACzBA,IAAW,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,GAK9B,GAEYC,IAAgBR,EAAOC,CAAQ;AAAA,sBACtB,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,OAAO,UAAU;AAAA;AAAA;AAAA,wBAGpC,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,GAI5CO,IAAcT,EAAOC,CAAQ,EAAqB,CAAC,EAAE,UAAAS,QAC5DA,IACK;AAAA,8BACmBA,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,QAQ7B,mBACR,GAEYC,IAAcX,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,GAM7BW,IAAqBZ,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA,GAMpCY,IAAcb,EAAO,IAAI,CAAC,EAAE,OAAAE,QAAY;AAC7C,QAAA,EAAE,QAAAY,EAAO,IAAIZ,EAAM;AAElB,SAAA;AAAA,wBACeA,EAAM,OAAO,UAAU;AAAA,aAClCY,IAAS,CAAC;AAAA,cACTA,IAAS,CAAC;AAAA;AAAA;AAGxB,CAAC,GAEYC,IAAmBf,EAAOgB,CAAU;AAAA;AAAA,cAEnC,CAAC,EAAE,OAAAd,EAAA,MAAYA,EAAM,OAAO,KAAK;AAAA;AAAA,GAIlCe,IAAajB,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBVJ,EAAOC,CAAQ;AAEnC,MAAMiB,IAAoBlB,EAAOC,CAAQ,EAA2B,CAAC;AAAA,EAC1E,OAAAC;AAAA,EACA,WAAAiB;AACF,MACS;AAAA,cACKA,IAAY,gBAAgB,SAAS;AAAA;AAAA;AAAA,oBAG/BA,IAAY,gBAAgBjB,EAAM,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,cAIpDA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGjC,GAEYkB,IAAapB,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA,GAMxBiB,IAAcrB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../src/features/homework/styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport Minus2Icon from '../../assets/line-icons/icons/minus2';\nimport FlexView from '../ui/layout/flex-view';\nimport Text from '../ui/text/text';\n\ninterface ICardWrapperProps {\n $bgImage: string;\n}\ninterface ICardOptionsMenuWrapperProps {\n $visible: boolean;\n $shouldopenonright: boolean;\n}\n\nexport const CardKebabMenuWrapper = styled(FlexView)(({ theme }) => {\n return `\n cursor: pointer;\n width: 24px;\n height: 24px;\n \n \n &:hover {\n border-radius: 50%;\n background: ${theme.colors.WHITE_5}; \n }\n `;\n});\n\nexport const SubHeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const CardMenuOptionsWrapper = styled(FlexView)<ICardOptionsMenuWrapperProps>(({\n $shouldopenonright,\n $visible,\n}) => {\n return `\n cursor: pointer;\n position: absolute;\n z-index: 6;\n top: calc(100% + 4px);\n right: ${$shouldopenonright ? 0 : 'auto'};\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 box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.4);\n z-index: 10;\n `;\n});\n\nexport const CardContainer = styled(FlexView)`\n border: 1px solid ${({ theme }) => theme.colors.BLACK_T_15};\n\n &:hover {\n border: 1px solid ${({ theme }) => theme.colors.BLACK};\n }\n`;\n\nexport const CardWrapper = styled(FlexView)<ICardWrapperProps>(({ $bgImage }) => {\n if ($bgImage) {\n return `\n background-image: url(${$bgImage});\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n overflow: hidden;\n `;\n }\n\n return 'overflow: hidden;';\n});\n\nexport const IconWrapper = styled(FlexView)`\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const BannerImageWrapper = styled(FlexView)`\n position: absolute;\n right: -18px;\n top: -4px;\n`;\n\nexport const BannerImage = styled.img(({ theme }) => {\n const { gutter } = theme.layout;\n\n return `\n border: 1px solid ${theme.colors.BLACK_T_15};\n width: ${gutter * 4}px;\n height: ${gutter * 4}px;\n border-radius: 50%;\n `;\n});\n\nexport const StyledMinus2Icon = styled(Minus2Icon)`\n path {\n stroke: ${({ theme }) => theme.colors.WHITE};\n }\n`;\n\nexport const HeaderText = styled(Text)`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: break-spaces;\n`;\n\ninterface ICardOptionWrapperProps {\n $disabled?: boolean;\n}\ninterface ICardOptionsProps {\n $top: number;\n $left: number;\n}\n\nexport const CardOptions = styled(FlexView)<ICardOptionsProps>``;\n\nexport const CardOptionWrapper = styled(FlexView)<ICardOptionWrapperProps>(({\n theme,\n $disabled,\n}) => {\n return `\n cursor: ${$disabled ? 'not-allowed' : 'pointer'};\n \n &:hover {\n background: ${$disabled ? 'transparent' : theme.colors.BLACK};\n };\n \n path {\n fill: ${theme.colors.WHITE_1};\n }\n `;\n});\n\nexport const OptionText = styled(Text)`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nexport const MenuWrapper = styled(FlexView)`\n position: absolute;\n z-index: 6;\n top: calc(100% - 36px);\n right: 12px;\n transform-origin: top;\n transform: scaleY(1);\n`;\n\nexport const BlurContainer = styled(FlexView)`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n opacity: 0.5;\n`;\n\nexport const BlurFlexView = styled(FlexView)`\n position: absolute;\n right: 42px;\n top: 24px;\n`;\n"],"names":["CardKebabMenuWrapper","styled","FlexView","theme","SubHeaderText","Text","CardMenuOptionsWrapper","$shouldopenonright","$visible","CardContainer","CardWrapper","$bgImage","IconWrapper","BannerImageWrapper","BannerImage","gutter","StyledMinus2Icon","Minus2Icon","HeaderText","CardOptionWrapper","$disabled","OptionText","MenuWrapper","BlurContainer","BlurFlexView"],"mappings":";;;;AAcO,MAAMA,IAAuBC,EAAOC,CAAQ,EAAE,CAAC,EAAE,OAAAC,QAC/C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAQWA,EAAM,OAAO,OAAO;AAAA;AAAA,GAGvC,GAEYC,IAAgBH,EAAOI,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQ3BC,IAAyBL,EAAOC,CAAQ,EAAgC,CAAC;AAAA,EACpF,oBAAAK;AAAA,EACA,UAAAC;AACF,MACS;AAAA;AAAA;AAAA;AAAA;AAAA,aAKID,IAAqB,IAAI,MAAM;AAAA;AAAA,wBAEpBC,IAAW,IAAI,CAAC;AAAA,eACzBA,IAAW,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA,GAK9B,GAEYC,IAAgBR,EAAOC,CAAQ;AAAA,sBACtB,CAAC,EAAE,OAAAC,EAAA,MAA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;AAAA;AAAA;AAAA,GAS/BsB,IAAevB,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1,41 +1,41 @@
|
|
1
1
|
import { jsxs as t, jsx as e, Fragment as W } from "react/jsx-runtime";
|
2
2
|
import { memo as X, useRef as j, useState as H, useMemo as L, useLayoutEffect as F } from "react";
|
3
|
-
import
|
4
|
-
import
|
3
|
+
import V from "../../../../../assets/line-icons/icons/check2.js";
|
4
|
+
import K from "../../../../ui/arrow-tooltip/arrow-tooltip.js";
|
5
5
|
import v from "../../../../ui/image/image.js";
|
6
6
|
import r from "../../../../ui/layout/flex-view.js";
|
7
7
|
import U from "../../../../ui/separator/separator.js";
|
8
|
-
import
|
8
|
+
import s from "../../../../ui/text/text.js";
|
9
9
|
import Y from "./goals/goal-action-ctas.js";
|
10
10
|
import { GOAL_CATEGORY_BASED_IMAGES as q } from "./milestone-constants.js";
|
11
11
|
import { getRemainingDaysToCompleteGoal as z, getGoalCategoryBasedColorTheme as J, getMilestoneWidgetStatusInfo as Q } from "./milestone-utils.js";
|
12
|
-
import { ChapterProgressSVG as Z, ChapterProgressSVGCircle as
|
12
|
+
import { ChapterProgressSVG as Z, ChapterProgressSVGCircle as u, StyledCheckIconWrapper as ee, MilestoneTitle as te } from "./milestone-widget-styled.js";
|
13
13
|
import re from "./outcome/outcome.js";
|
14
14
|
const ue = X(
|
15
|
-
({ isClassOngoing:
|
15
|
+
({ isClassOngoing: C, isStudentPresent: T, isExpanded: oe, ...x }) => {
|
16
16
|
const {
|
17
|
-
milestone:
|
18
|
-
studentId:
|
17
|
+
milestone: m,
|
18
|
+
studentId: A,
|
19
19
|
studentName: _,
|
20
|
-
teacherName:
|
20
|
+
teacherName: I,
|
21
21
|
parentName: w,
|
22
|
-
userType:
|
23
|
-
courseStream:
|
24
|
-
outcomes:
|
25
|
-
onEdit:
|
26
|
-
onDraftPublish:
|
27
|
-
onAddOutcome:
|
22
|
+
userType: y,
|
23
|
+
courseStream: G,
|
24
|
+
outcomes: i,
|
25
|
+
onEdit: D,
|
26
|
+
onDraftPublish: E,
|
27
|
+
onAddOutcome: b
|
28
28
|
} = x, {
|
29
|
-
milestone_name:
|
30
|
-
milestone_date_ts:
|
31
|
-
milestone_state:
|
29
|
+
milestone_name: g,
|
30
|
+
milestone_date_ts: S,
|
31
|
+
milestone_state: o,
|
32
32
|
goal_category: l,
|
33
|
-
goal_code:
|
34
|
-
progress_stat:
|
35
|
-
} =
|
33
|
+
goal_code: p,
|
34
|
+
progress_stat: k
|
35
|
+
} = m, { completed: h = 0, total: a = 0 } = k || {}, $ = o === "OUTCOME_PENDING", c = h > 0 ? Math.floor((h / a || 1) * 100) : 0, n = j(null), [B, O] = H(!1), { textColor: N, borderColor: f } = J(l), d = Q(o), R = ($ ? d == null ? void 0 : d.progressBackgroundColor : f) || "WHITE_5", M = L(() => typeof p == "string", [p]), P = z(S);
|
36
36
|
return F(() => {
|
37
|
-
|
38
|
-
}, [
|
37
|
+
n.current && n.current.scrollHeight > n.current.clientHeight && O(!0);
|
38
|
+
}, [n]), l ? /* @__PURE__ */ t(
|
39
39
|
r,
|
40
40
|
{
|
41
41
|
$flexDirection: "row",
|
@@ -56,13 +56,13 @@ const ue = X(
|
|
56
56
|
$borderRadiusX: 2,
|
57
57
|
children: [
|
58
58
|
/* @__PURE__ */ t(Z, { width: "64px", height: "64px", children: [
|
59
|
-
/* @__PURE__ */ e(
|
59
|
+
/* @__PURE__ */ e(u, { $progress: 0, r: "31", cx: "32", cy: "32" }),
|
60
60
|
/* @__PURE__ */ e(
|
61
|
-
|
61
|
+
u,
|
62
62
|
{
|
63
63
|
$progressCircle: !0,
|
64
64
|
$progressBackground: "BLACK_1",
|
65
|
-
$progress:
|
65
|
+
$progress: c * 2,
|
66
66
|
r: "31",
|
67
67
|
cx: "32",
|
68
68
|
cy: "32"
|
@@ -78,15 +78,15 @@ const ue = X(
|
|
78
78
|
height: 40
|
79
79
|
}
|
80
80
|
) }),
|
81
|
-
|
81
|
+
c === 100 && /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e(V, { width: 20, height: 20 }) })
|
82
82
|
]
|
83
83
|
}
|
84
84
|
),
|
85
85
|
/* @__PURE__ */ t(r, { $flexGap: 16, children: [
|
86
86
|
/* @__PURE__ */ t(r, { $flexGap: 4, children: [
|
87
87
|
/* @__PURE__ */ t(r, { $flexDirection: "row", $alignItems: "center", $flexGap: 4, children: [
|
88
|
-
/* @__PURE__ */ e(
|
89
|
-
|
88
|
+
/* @__PURE__ */ e(s, { $renderAs: "ac4-black", $color: N, children: l.split("_").join(" ") }),
|
89
|
+
$ && /* @__PURE__ */ e(
|
90
90
|
r,
|
91
91
|
{
|
92
92
|
$flexDirection: "row",
|
@@ -94,64 +94,63 @@ const ue = X(
|
|
94
94
|
$gutter: 4,
|
95
95
|
$alignItems: "center",
|
96
96
|
$background: R,
|
97
|
-
children: /* @__PURE__ */ e(
|
97
|
+
children: /* @__PURE__ */ e(s, { $renderAs: "ac4", $color: "WHITE", children: "Outcome pending" })
|
98
98
|
}
|
99
99
|
),
|
100
|
-
|
100
|
+
o === "DRAFT" && /* @__PURE__ */ e(
|
101
101
|
r,
|
102
102
|
{
|
103
103
|
$flexDirection: "row",
|
104
104
|
$gap: 4,
|
105
105
|
$gutter: 4,
|
106
106
|
$alignItems: "center",
|
107
|
-
$background:
|
108
|
-
children: /* @__PURE__ */ e(
|
107
|
+
$background: f,
|
108
|
+
children: /* @__PURE__ */ e(s, { $renderAs: "ac4", children: "Draft" })
|
109
109
|
}
|
110
110
|
)
|
111
111
|
] }),
|
112
112
|
/* @__PURE__ */ e(
|
113
|
-
|
113
|
+
K,
|
114
114
|
{
|
115
115
|
renderAs: "primary",
|
116
116
|
position: "bottom",
|
117
|
-
tooltipItem:
|
117
|
+
tooltipItem: g,
|
118
118
|
hidden: !B,
|
119
119
|
children: /* @__PURE__ */ e(
|
120
120
|
te,
|
121
121
|
{
|
122
|
-
ref:
|
122
|
+
ref: n,
|
123
123
|
$renderAs: M ? "ah4" : "ah3",
|
124
|
-
children:
|
124
|
+
children: g
|
125
125
|
}
|
126
126
|
)
|
127
127
|
}
|
128
128
|
),
|
129
|
-
|
130
|
-
|
131
|
-
"
|
132
|
-
P
|
129
|
+
o !== "DRAFT" && /* @__PURE__ */ t(s, { $renderAs: "ub3", $color: "BLACK_T_60", children: [
|
130
|
+
!!a && `${c}% complete`,
|
131
|
+
!!a && o === "ACTIVE" && P
|
133
132
|
] })
|
134
133
|
] }),
|
135
|
-
|
134
|
+
i != null && i.length ? /* @__PURE__ */ t(W, { children: [
|
136
135
|
/* @__PURE__ */ e(U, { width: 40, height: 1, background: "BLACK_T_15" }),
|
137
|
-
/* @__PURE__ */ e(re, { outcomes:
|
136
|
+
/* @__PURE__ */ e(re, { outcomes: i })
|
138
137
|
] }) : void 0
|
139
138
|
] })
|
140
139
|
] }),
|
141
|
-
|
140
|
+
y === "TEACHER" && /* @__PURE__ */ e(
|
142
141
|
Y,
|
143
142
|
{
|
144
|
-
milestone:
|
145
|
-
studentId:
|
143
|
+
milestone: m,
|
144
|
+
studentId: A,
|
146
145
|
studentName: _,
|
147
|
-
teacherName:
|
146
|
+
teacherName: I ?? "",
|
148
147
|
parentName: w ?? "",
|
149
|
-
onAddOutcome:
|
150
|
-
isClassOngoing: !!
|
151
|
-
isStudentPresent: !!
|
152
|
-
onDraftPublish:
|
153
|
-
onEdit:
|
154
|
-
courseStream:
|
148
|
+
onAddOutcome: b,
|
149
|
+
isClassOngoing: !!C,
|
150
|
+
isStudentPresent: !!T,
|
151
|
+
onDraftPublish: E,
|
152
|
+
onEdit: D,
|
153
|
+
courseStream: G
|
155
154
|
}
|
156
155
|
)
|
157
156
|
]
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-info.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.tsx"],"sourcesContent":["import type { IMileStoneInfoWrapperProps } from './milestone-widget-types';\n\nimport React, { memo, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport GoalActionCtas from './goals/goal-action-ctas';\nimport { GOAL_CATEGORY_BASED_IMAGES } from './milestone-constants';\nimport {\n getGoalCategoryBasedColorTheme,\n getMilestoneWidgetStatusInfo,\n getRemainingDaysToCompleteGoal,\n} from './milestone-utils';\nimport * as Styled from './milestone-widget-styled';\nimport OutcomeWrapper from './outcome/outcome';\n\nconst MilestoneInfoWrapper: React.FC<IMileStoneInfoWrapperProps> = memo(\n ({ isClassOngoing, isStudentPresent, isExpanded, ...restMilestoneInfoWrapperProps }) => {\n const {\n milestone,\n studentId,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n outcomes,\n onEdit,\n onDraftPublish,\n onAddOutcome,\n } = restMilestoneInfoWrapperProps;\n\n const {\n milestone_name: milestoneName,\n milestone_date_ts: dueDate,\n milestone_state: milestoneState,\n goal_category: goalCategory,\n goal_code: goalCode,\n progress_stat: progressStat,\n } = milestone;\n\n const { completed = 0, total = 0 } = progressStat || {};\n const isOutcomePending = milestoneState === 'OUTCOME_PENDING';\n const progressCompletionPercentage =\n completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const { textColor: goalCategoryTextColor, borderColor } =\n getGoalCategoryBasedColorTheme(goalCategory);\n\n const outcomeStatusInfo = getMilestoneWidgetStatusInfo(milestoneState);\n const backgroundColor =\n (isOutcomePending ? outcomeStatusInfo?.progressBackgroundColor : borderColor) || 'WHITE_5';\n\n const isGoalCreation = useMemo(() => typeof goalCode === 'string', [goalCode]);\n const remainingDays = getRemainingDaysToCompleteGoal(dueDate);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n if (!goalCategory) return null;\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $flexGapX={1}\n >\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView\n $widthX={4}\n $heightX={4}\n $background=\"WHITE_T_38\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $borderRadiusX={2}\n >\n <Styled.ChapterProgressSVG width=\"64px\" height=\"64px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"31\" cx=\"32\" cy=\"32\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground=\"BLACK_1\"\n $progress={progressCompletionPercentage * 2}\n r=\"31\"\n cx=\"32\"\n cy=\"32\"\n />\n </Styled.ChapterProgressSVG>\n\n <FlexView $widthX={4} $heightX={4} $justifyContent=\"center\" $alignItems=\"center\">\n <Image\n src={GOAL_CATEGORY_BASED_IMAGES[goalCategory]}\n withLoader\n width={40}\n height={40}\n />\n </FlexView>\n\n {progressCompletionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </FlexView>\n\n <FlexView $flexGap={16}>\n <FlexView $flexGap={4}>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={4}>\n <Text $renderAs=\"ac4-black\" $color={goalCategoryTextColor}>\n {goalCategory.split('_').join(' ')}\n </Text>\n\n {isOutcomePending && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={backgroundColor}\n >\n <Text $renderAs=\"ac4\" $color=\"WHITE\">\n Outcome pending\n </Text>\n </FlexView>\n )}\n\n {milestoneState === 'DRAFT' && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={borderColor}\n >\n <Text $renderAs=\"ac4\">Draft</Text>\n </FlexView>\n )}\n </FlexView>\n\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={milestoneName}\n hidden={!showTitleTooltip}\n >\n <Styled.MilestoneTitle\n ref={titleTextRef}\n $renderAs={!isGoalCreation ? 'ah3' : 'ah4'}\n >\n {milestoneName}\n </Styled.MilestoneTitle>\n </ArrowTooltip>\n\n {milestoneState !== 'DRAFT' && progressCompletionPercentage > 0 && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {progressCompletionPercentage}% complete{remainingDays}\n </Text>\n )}\n </FlexView>\n\n {outcomes?.length ? (\n <>\n <Separator width={40} height={1} background=\"BLACK_T_15\" />\n <OutcomeWrapper outcomes={outcomes} />\n </>\n ) : undefined}\n </FlexView>\n </FlexView>\n\n {userType === 'TEACHER' && (\n <GoalActionCtas\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n teacherName={teacherName ?? ''}\n parentName={parentName ?? ''}\n onAddOutcome={onAddOutcome}\n isClassOngoing={Boolean(isClassOngoing)}\n isStudentPresent={Boolean(isStudentPresent)}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n courseStream={courseStream}\n />\n )}\n </FlexView>\n );\n },\n);\n\nexport default MilestoneInfoWrapper;\n"],"names":["MilestoneInfoWrapper","memo","isClassOngoing","isStudentPresent","isExpanded","restMilestoneInfoWrapperProps","milestone","studentId","studentName","teacherName","parentName","userType","courseStream","outcomes","onEdit","onDraftPublish","onAddOutcome","milestoneName","dueDate","milestoneState","goalCategory","goalCode","progressStat","completed","total","isOutcomePending","progressCompletionPercentage","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","goalCategoryTextColor","borderColor","getGoalCategoryBasedColorTheme","outcomeStatusInfo","getMilestoneWidgetStatusInfo","backgroundColor","isGoalCreation","useMemo","remainingDays","getRemainingDaysToCompleteGoal","useLayoutEffect","jsxs","FlexView","Styled.ChapterProgressSVG","jsx","Styled.ChapterProgressSVGCircle","Image","GOAL_CATEGORY_BASED_IMAGES","Styled.StyledCheckIconWrapper","Check2Icon","Text","ArrowTooltip","Styled.MilestoneTitle","Fragment","Separator","OutcomeWrapper","GoalActionCtas"],"mappings":";;;;;;;;;;;;;AAoBA,MAAMA,KAA6DC;AAAA,EACjE,CAAC,EAAE,gBAAAC,GAAgB,kBAAAC,GAAkB,YAAAC,IAAY,GAAGC,QAAoC;AAChF,UAAA;AAAA,MACJ,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,aAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,QAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,IACE,IAAAX,GAEE;AAAA,MACJ,gBAAgBY;AAAA,MAChB,mBAAmBC;AAAA,MACnB,iBAAiBC;AAAA,MACjB,eAAeC;AAAA,MACf,WAAWC;AAAA,MACX,eAAeC;AAAA,IACb,IAAAhB,GAEE,EAAE,WAAAiB,IAAY,GAAG,OAAAC,IAAQ,EAAE,IAAIF,KAAgB,IAC/CG,IAAmBN,MAAmB,mBACtCO,IACJH,IAAY,IAAI,KAAK,OAAOA,IAAYC,KAAS,KAAK,GAAG,IAAI,GAEzDG,IAAeC,EAAuB,IAAI,GAC1C,CAACC,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GAExD,EAAE,WAAWC,GAAuB,aAAAC,EAAY,IACpDC,EAA+Bd,CAAY,GAEvCe,IAAoBC,EAA6BjB,CAAc,GAC/DkB,KACHZ,IAAmBU,KAAA,gBAAAA,EAAmB,0BAA0BF,MAAgB,WAE7EK,IAAiBC,EAAQ,MAAM,OAAOlB,KAAa,UAAU,CAACA,CAAQ,CAAC,GACvEmB,IAAgBC,EAA+BvB,CAAO;AAWxD,WATJwB,EAAgB,MAAM;AACp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AAA;AAAA,gBACF;AAAA,gBAECE,MAAmB,WAAWO,IAA+B,uBAC3D0B,GAAK,EAAA,WAAU,OAAM,QAAO,cAC1B,UAAA;AAAA,kBAAA1B;AAAA,kBAA6B;AAAA,kBAAWc;AAAA,gBAAA,GAC3C;AAAA,cAAA,GAEJ;AAAA,cAEC3B,KAAA,QAAAA,EAAU,SAEP,gBAAA8B,EAAAY,GAAA,EAAA,UAAA;AAAA,gBAAA,gBAAAT,EAACU,KAAU,OAAO,IAAI,QAAQ,GAAG,YAAW,cAAa;AAAA,gBACzD,gBAAAV,EAACW,MAAe,UAAA5C,GAAoB;AAAA,cAAA,EACtC,CAAA,IACE;AAAA,YAAA,GACN;AAAA,UAAA,GACF;AAAA,UAECF,MAAa,aACZ,gBAAAmC;AAAA,YAACY;AAAA,YAAA;AAAA,cACC,WAAApD;AAAA,cACA,WAAAC;AAAA,cACA,aAAAC;AAAA,cACA,aAAaC,KAAe;AAAA,cAC5B,YAAYC,KAAc;AAAA,cAC1B,cAAAM;AAAA,cACA,gBAAgB,EAAQd;AAAA,cACxB,kBAAkB,EAAQC;AAAA,cAC1B,gBAAAY;AAAA,cACA,QAAAD;AAAA,cACA,cAAAF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,IA5HoB;AAAA,EAgI5B;AACF;"}
|
1
|
+
{"version":3,"file":"milestone-info.js","sources":["../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-info.tsx"],"sourcesContent":["import type { IMileStoneInfoWrapperProps } from './milestone-widget-types';\n\nimport React, { memo, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport Check2Icon from '../../../../../assets/line-icons/icons/check2';\nimport ArrowTooltip from '../../../../ui/arrow-tooltip/arrow-tooltip';\nimport Image from '../../../../ui/image/image';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Separator from '../../../../ui/separator/separator';\nimport Text from '../../../../ui/text/text';\nimport GoalActionCtas from './goals/goal-action-ctas';\nimport { GOAL_CATEGORY_BASED_IMAGES } from './milestone-constants';\nimport {\n getGoalCategoryBasedColorTheme,\n getMilestoneWidgetStatusInfo,\n getRemainingDaysToCompleteGoal,\n} from './milestone-utils';\nimport * as Styled from './milestone-widget-styled';\nimport OutcomeWrapper from './outcome/outcome';\n\nconst MilestoneInfoWrapper: React.FC<IMileStoneInfoWrapperProps> = memo(\n ({ isClassOngoing, isStudentPresent, isExpanded, ...restMilestoneInfoWrapperProps }) => {\n const {\n milestone,\n studentId,\n studentName,\n teacherName,\n parentName,\n userType,\n courseStream,\n outcomes,\n onEdit,\n onDraftPublish,\n onAddOutcome,\n } = restMilestoneInfoWrapperProps;\n\n const {\n milestone_name: milestoneName,\n milestone_date_ts: dueDate,\n milestone_state: milestoneState,\n goal_category: goalCategory,\n goal_code: goalCode,\n progress_stat: progressStat,\n } = milestone;\n\n const { completed = 0, total = 0 } = progressStat || {};\n const isOutcomePending = milestoneState === 'OUTCOME_PENDING';\n const progressCompletionPercentage =\n completed > 0 ? Math.floor((completed / total || 1) * 100) : 0;\n\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const { textColor: goalCategoryTextColor, borderColor } =\n getGoalCategoryBasedColorTheme(goalCategory);\n\n const outcomeStatusInfo = getMilestoneWidgetStatusInfo(milestoneState);\n const backgroundColor =\n (isOutcomePending ? outcomeStatusInfo?.progressBackgroundColor : borderColor) || 'WHITE_5';\n\n const isGoalCreation = useMemo(() => typeof goalCode === 'string', [goalCode]);\n const remainingDays = getRemainingDaysToCompleteGoal(dueDate);\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n if (!goalCategory) return null;\n\n return (\n <FlexView\n $flexDirection=\"row\"\n $justifyContent=\"space-between\"\n $alignItems=\"center\"\n $flexGapX={1}\n >\n <FlexView $flexDirection=\"row\" $flexGapX={1.5}>\n <FlexView\n $widthX={4}\n $heightX={4}\n $background=\"WHITE_T_38\"\n $position=\"relative\"\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $borderRadiusX={2}\n >\n <Styled.ChapterProgressSVG width=\"64px\" height=\"64px\">\n <Styled.ChapterProgressSVGCircle $progress={0} r=\"31\" cx=\"32\" cy=\"32\" />\n <Styled.ChapterProgressSVGCircle\n $progressCircle\n $progressBackground=\"BLACK_1\"\n $progress={progressCompletionPercentage * 2}\n r=\"31\"\n cx=\"32\"\n cy=\"32\"\n />\n </Styled.ChapterProgressSVG>\n\n <FlexView $widthX={4} $heightX={4} $justifyContent=\"center\" $alignItems=\"center\">\n <Image\n src={GOAL_CATEGORY_BASED_IMAGES[goalCategory]}\n withLoader\n width={40}\n height={40}\n />\n </FlexView>\n\n {progressCompletionPercentage === 100 && (\n <Styled.StyledCheckIconWrapper>\n <Check2Icon width={20} height={20} />\n </Styled.StyledCheckIconWrapper>\n )}\n </FlexView>\n\n <FlexView $flexGap={16}>\n <FlexView $flexGap={4}>\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $flexGap={4}>\n <Text $renderAs=\"ac4-black\" $color={goalCategoryTextColor}>\n {goalCategory.split('_').join(' ')}\n </Text>\n\n {isOutcomePending && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={backgroundColor}\n >\n <Text $renderAs=\"ac4\" $color=\"WHITE\">\n Outcome pending\n </Text>\n </FlexView>\n )}\n\n {milestoneState === 'DRAFT' && (\n <FlexView\n $flexDirection=\"row\"\n $gap={4}\n $gutter={4}\n $alignItems=\"center\"\n $background={borderColor}\n >\n <Text $renderAs=\"ac4\">Draft</Text>\n </FlexView>\n )}\n </FlexView>\n\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={milestoneName}\n hidden={!showTitleTooltip}\n >\n <Styled.MilestoneTitle\n ref={titleTextRef}\n $renderAs={!isGoalCreation ? 'ah3' : 'ah4'}\n >\n {milestoneName}\n </Styled.MilestoneTitle>\n </ArrowTooltip>\n\n {milestoneState !== 'DRAFT' && (\n <Text $renderAs=\"ub3\" $color=\"BLACK_T_60\">\n {!!total && `${progressCompletionPercentage}% complete`}\n {!!total && milestoneState === 'ACTIVE' && remainingDays}\n </Text>\n )}\n </FlexView>\n\n {outcomes?.length ? (\n <>\n <Separator width={40} height={1} background=\"BLACK_T_15\" />\n <OutcomeWrapper outcomes={outcomes} />\n </>\n ) : undefined}\n </FlexView>\n </FlexView>\n\n {userType === 'TEACHER' && (\n <GoalActionCtas\n milestone={milestone}\n studentId={studentId}\n studentName={studentName}\n teacherName={teacherName ?? ''}\n parentName={parentName ?? ''}\n onAddOutcome={onAddOutcome}\n isClassOngoing={Boolean(isClassOngoing)}\n isStudentPresent={Boolean(isStudentPresent)}\n onDraftPublish={onDraftPublish}\n onEdit={onEdit}\n courseStream={courseStream}\n />\n )}\n </FlexView>\n );\n },\n);\n\nexport default MilestoneInfoWrapper;\n"],"names":["MilestoneInfoWrapper","memo","isClassOngoing","isStudentPresent","isExpanded","restMilestoneInfoWrapperProps","milestone","studentId","studentName","teacherName","parentName","userType","courseStream","outcomes","onEdit","onDraftPublish","onAddOutcome","milestoneName","dueDate","milestoneState","goalCategory","goalCode","progressStat","completed","total","isOutcomePending","progressCompletionPercentage","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","goalCategoryTextColor","borderColor","getGoalCategoryBasedColorTheme","outcomeStatusInfo","getMilestoneWidgetStatusInfo","backgroundColor","isGoalCreation","useMemo","remainingDays","getRemainingDaysToCompleteGoal","useLayoutEffect","jsxs","FlexView","Styled.ChapterProgressSVG","jsx","Styled.ChapterProgressSVGCircle","Image","GOAL_CATEGORY_BASED_IMAGES","Styled.StyledCheckIconWrapper","Check2Icon","Text","ArrowTooltip","Styled.MilestoneTitle","Fragment","Separator","OutcomeWrapper","GoalActionCtas"],"mappings":";;;;;;;;;;;;;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,cAAA,GAEJ;AAAA,cAEC3B,KAAA,QAAAA,EAAU,SAEP,gBAAA8B,EAAAY,GAAA,EAAA,UAAA;AAAA,gBAAA,gBAAAT,EAACU,KAAU,OAAO,IAAI,QAAQ,GAAG,YAAW,cAAa;AAAA,gBACzD,gBAAAV,EAACW,MAAe,UAAA5C,GAAoB;AAAA,cAAA,EACtC,CAAA,IACE;AAAA,YAAA,GACN;AAAA,UAAA,GACF;AAAA,UAECF,MAAa,aACZ,gBAAAmC;AAAA,YAACY;AAAA,YAAA;AAAA,cACC,WAAApD;AAAA,cACA,WAAAC;AAAA,cACA,aAAAC;AAAA,cACA,aAAaC,KAAe;AAAA,cAC5B,YAAYC,KAAc;AAAA,cAC1B,cAAAM;AAAA,cACA,gBAAgB,EAAQd;AAAA,cACxB,kBAAkB,EAAQC;AAAA,cAC1B,gBAAAY;AAAA,cACA,QAAAD;AAAA,cACA,cAAAF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,IA7HoB;AAAA,EAiI5B;AACF;"}
|
@@ -8,37 +8,37 @@ import Y from "../../../../milestone-tests/test-list-v2/test-list-container.js";
|
|
8
8
|
import { getGoalCategoryBasedColorTheme as Z } from "../milestone-utils.js";
|
9
9
|
import { NoPlanCardWrapper as ee, TabsWrapper as te, TabsText as oe, TabComponentWrapper as se } from "./milestone-tabs-styled.js";
|
10
10
|
const be = V((h) => {
|
11
|
-
var
|
11
|
+
var f;
|
12
12
|
const {
|
13
|
-
goalCategory:
|
13
|
+
goalCategory: A,
|
14
14
|
isDraftMilestone: r,
|
15
|
-
isGoalCreation:
|
15
|
+
isGoalCreation: I,
|
16
16
|
isMilestoneActive: l,
|
17
17
|
userMilestoneId: e,
|
18
18
|
chapters: c,
|
19
19
|
userType: d,
|
20
20
|
canUpdatePlan: m,
|
21
21
|
studentId: u,
|
22
|
-
milestoneState:
|
23
|
-
milestonePermissions:
|
22
|
+
milestoneState: R,
|
23
|
+
milestonePermissions: $,
|
24
24
|
activeMilestoneId: p,
|
25
|
-
activeTabId:
|
25
|
+
activeTabId: k
|
26
26
|
} = h, {
|
27
|
-
onAddChapter:
|
28
|
-
onAssignResources:
|
29
|
-
onChapterClick:
|
30
|
-
onCreateMilestoneTest:
|
31
|
-
onNodeAttempt:
|
32
|
-
onNodeView:
|
33
|
-
onNodeReview:
|
34
|
-
onNodeReattempt:
|
27
|
+
onAddChapter: M,
|
28
|
+
onAssignResources: x,
|
29
|
+
onChapterClick: P,
|
30
|
+
onCreateMilestoneTest: U,
|
31
|
+
onNodeAttempt: j,
|
32
|
+
onNodeView: w,
|
33
|
+
onNodeReview: E,
|
34
|
+
onNodeReattempt: C,
|
35
35
|
onNodeReset: S,
|
36
36
|
onNodeUnassign: W,
|
37
37
|
onTestPreview: _,
|
38
38
|
onTestReview: y,
|
39
39
|
onTestStart: B,
|
40
40
|
onWidgetTabSelection: a
|
41
|
-
} = h, { visible_tabs:
|
41
|
+
} = h, { visible_tabs: T } = $, { onEvent: g } = J(), { backgroundColor: D } = Z(A, r), b = {
|
42
42
|
chapters: {
|
43
43
|
label: "Chapters",
|
44
44
|
component: /* @__PURE__ */ t(
|
@@ -47,10 +47,10 @@ const be = V((h) => {
|
|
47
47
|
milestoneId: e,
|
48
48
|
chapters: c,
|
49
49
|
userType: d,
|
50
|
-
isGoalCreation:
|
51
|
-
onChapterClick:
|
52
|
-
onAddChapter:
|
53
|
-
canUpdatePlan: !!(
|
50
|
+
isGoalCreation: I,
|
51
|
+
onChapterClick: P,
|
52
|
+
onAddChapter: M,
|
53
|
+
canUpdatePlan: !!(R !== "DRAFT" && m),
|
54
54
|
isMilestoneActive: l
|
55
55
|
}
|
56
56
|
)
|
@@ -67,7 +67,8 @@ const be = V((h) => {
|
|
67
67
|
userMilestoneId: e,
|
68
68
|
userType: d,
|
69
69
|
canUpdatePlan: m,
|
70
|
-
onCreateMilestoneTest:
|
70
|
+
onCreateMilestoneTest: U,
|
71
|
+
onNodeReattempt: C,
|
71
72
|
onTestPreview: _,
|
72
73
|
onTestStart: B,
|
73
74
|
onTestReview: y
|
@@ -85,41 +86,41 @@ const be = V((h) => {
|
|
85
86
|
canUpdatePlan: m,
|
86
87
|
studentId: u,
|
87
88
|
userType: d,
|
88
|
-
onAssignResources:
|
89
|
-
onNodeAttempt:
|
90
|
-
onNodeView:
|
91
|
-
onNodeReview:
|
92
|
-
onNodeReattempt:
|
89
|
+
onAssignResources: x,
|
90
|
+
onNodeAttempt: j,
|
91
|
+
onNodeView: w,
|
92
|
+
onNodeReview: E,
|
93
|
+
onNodeReattempt: C,
|
93
94
|
onNodeReset: S,
|
94
95
|
onNodeUnassign: W
|
95
96
|
}
|
96
97
|
)
|
97
98
|
}
|
98
|
-
}, s = (
|
99
|
-
([o]) => (
|
99
|
+
}, s = (T ?? []).length === 0 ? Object.entries(b) : Object.entries(b).filter(
|
100
|
+
([o]) => (T ?? []).includes(o.toUpperCase())
|
100
101
|
), [i, F] = X(
|
101
|
-
e === p ?
|
102
|
+
e === p ? k : ((f = s == null ? void 0 : s[0]) == null ? void 0 : f[0]) || "chapters"
|
102
103
|
), G = q(
|
103
104
|
(o, n) => {
|
104
105
|
if (p === e && o === i) return null;
|
105
|
-
F(o), a == null || a(e, o),
|
106
|
+
F(o), a == null || a(e, o), g("clicked", {
|
106
107
|
cta: n,
|
107
108
|
milestone_id: e
|
108
109
|
});
|
109
110
|
},
|
110
|
-
[p, e, i, a,
|
111
|
+
[p, e, i, a, g]
|
111
112
|
);
|
112
113
|
return r && c.length === 0 ? /* @__PURE__ */ t(ee, { $gutterX: 2, $background: "WHITE_3", children: /* @__PURE__ */ t(K, { $renderAs: "ab2", $color: "RED", children: "No chapter has been assigned" }) }) : /* @__PURE__ */ L(H, { children: [
|
113
114
|
/* @__PURE__ */ t(te, { $backgroundColor: D, $frames: s.length, children: s.map((o) => {
|
114
|
-
const [n, O] = o, { label:
|
115
|
+
const [n, O] = o, { label: v } = O, N = n === i;
|
115
116
|
return /* @__PURE__ */ t(
|
116
117
|
oe,
|
117
118
|
{
|
118
|
-
$renderAs:
|
119
|
+
$renderAs: N ? "ub3-bold" : "ub3",
|
119
120
|
$align: "center",
|
120
|
-
$selected:
|
121
|
-
onClick: () => G(n,
|
122
|
-
children:
|
121
|
+
$selected: N,
|
122
|
+
onClick: () => G(n, v),
|
123
|
+
children: v
|
123
124
|
},
|
124
125
|
n
|
125
126
|
);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"milestone-tabs.js","sources":["../../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.tsx"],"sourcesContent":["import type { IMilestoneTabConfig, IMilestoneTabsProps } from './milestone-tabs-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useState } from 'react';\n\nimport ChaptersList from '../../../../../chapters/chapters-list/chapters-list';\nimport { useUIContext } from '../../../../../ui/context/context';\nimport Text from '../../../../../ui/text/text';\nimport MilestoneWidgetResources from '../../../../milestone-resources/resources-list/resources-list';\nimport MilestoneTestsList from '../../../../milestone-tests/test-list-v2/test-list-container';\nimport { getGoalCategoryBasedColorTheme } from '../milestone-utils';\nimport * as Styled from './milestone-tabs-styled';\n\nconst MilestoneTabs: FC<IMilestoneTabsProps> = memo(props => {\n const {\n goalCategory,\n isDraftMilestone,\n isGoalCreation,\n isMilestoneActive,\n userMilestoneId,\n chapters,\n userType,\n canUpdatePlan,\n studentId,\n milestoneState,\n milestonePermissions,\n activeMilestoneId,\n activeTabId,\n } = props;\n const {\n onAddChapter,\n onAssignResources,\n onChapterClick,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onTestPreview,\n onTestReview,\n onTestStart,\n onWidgetTabSelection,\n } = props;\n const { visible_tabs: visibleTabs } = milestonePermissions;\n const { onEvent: trackEvent } = useUIContext();\n\n const { backgroundColor } = getGoalCategoryBasedColorTheme(goalCategory, isDraftMilestone);\n\n const TAB_CONFIG: IMilestoneTabConfig = {\n chapters: {\n label: 'Chapters',\n component: (\n <ChaptersList\n milestoneId={userMilestoneId}\n chapters={chapters}\n userType={userType}\n isGoalCreation={isGoalCreation}\n onChapterClick={onChapterClick}\n onAddChapter={onAddChapter}\n canUpdatePlan={Boolean(milestoneState !== 'DRAFT' && canUpdatePlan)}\n isMilestoneActive={isMilestoneActive}\n />\n ),\n },\n tests: {\n label: 'Tests',\n component: (\n <MilestoneTestsList\n isDraftMilestone={isDraftMilestone}\n isChaptersAvailable={chapters.length > 0}\n isMilestoneActive={isMilestoneActive}\n studentId={studentId}\n userMilestoneId={userMilestoneId}\n userType={userType}\n canUpdatePlan={canUpdatePlan}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onTestPreview={onTestPreview}\n onTestStart={onTestStart}\n onTestReview={onTestReview}\n />\n ),\n },\n resources: {\n label: 'Resources',\n component: (\n <MilestoneWidgetResources\n isDraftMilestone={isDraftMilestone}\n isMilestoneActive={isMilestoneActive}\n userMilestoneId={userMilestoneId}\n canUpdatePlan={canUpdatePlan}\n studentId={studentId}\n userType={userType}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n />\n ),\n },\n };\n\n const filteredTabConfig =\n (visibleTabs ?? []).length === 0\n ? Object.entries(TAB_CONFIG)\n : Object.entries(TAB_CONFIG).filter(([tabName]) =>\n (visibleTabs ?? []).includes(tabName.toUpperCase()),\n );\n const [selectedTabName, setSelectedTabName] = useState(\n userMilestoneId === activeMilestoneId ? activeTabId : filteredTabConfig?.[0]?.[0] || 'chapters',\n );\n\n const handleTabChange = useCallback(\n (tabName: keyof IMilestoneTabConfig, ctaLabel: string) => {\n if (activeMilestoneId === userMilestoneId && tabName === selectedTabName) return null;\n\n setSelectedTabName(tabName);\n\n onWidgetTabSelection?.(userMilestoneId, tabName);\n\n trackEvent('clicked', {\n cta: ctaLabel,\n milestone_id: userMilestoneId,\n });\n },\n [activeMilestoneId, userMilestoneId, selectedTabName, onWidgetTabSelection, trackEvent],\n );\n\n if (isDraftMilestone && chapters.length === 0) {\n return (\n <Styled.NoPlanCardWrapper $gutterX={2} $background=\"WHITE_3\">\n <Text $renderAs=\"ab2\" $color=\"RED\">\n No chapter has been assigned\n </Text>\n </Styled.NoPlanCardWrapper>\n );\n }\n\n return (\n <>\n <Styled.TabsWrapper $backgroundColor={backgroundColor} $frames={filteredTabConfig.length}>\n {filteredTabConfig.map(tabConfig => {\n const [tabName, tabInfo] = tabConfig;\n const { label } = tabInfo;\n const isSelected = tabName === selectedTabName;\n\n return (\n <Styled.TabsText\n $renderAs={isSelected ? 'ub3-bold' : 'ub3'}\n $align=\"center\"\n key={tabName}\n $selected={isSelected}\n onClick={() => handleTabChange(tabName as keyof IMilestoneTabConfig, label)}\n >\n {label}\n </Styled.TabsText>\n );\n })}\n </Styled.TabsWrapper>\n\n <Styled.TabComponentWrapper>\n {TAB_CONFIG[selectedTabName as keyof typeof TAB_CONFIG].component}\n </Styled.TabComponentWrapper>\n </>\n );\n});\n\nexport default MilestoneTabs;\n"],"names":["MilestoneTabs","memo","props","goalCategory","isDraftMilestone","isGoalCreation","isMilestoneActive","userMilestoneId","chapters","userType","canUpdatePlan","studentId","milestoneState","milestonePermissions","activeMilestoneId","activeTabId","onAddChapter","onAssignResources","onChapterClick","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onTestPreview","onTestReview","onTestStart","onWidgetTabSelection","visibleTabs","trackEvent","useUIContext","backgroundColor","getGoalCategoryBasedColorTheme","TAB_CONFIG","jsx","ChaptersList","MilestoneTestsList","MilestoneWidgetResources","filteredTabConfig","tabName","selectedTabName","setSelectedTabName","useState","_a","handleTabChange","useCallback","ctaLabel","Styled.NoPlanCardWrapper","Text","jsxs","Fragment","Styled.TabsWrapper","tabCon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,EAAS,SAAS;AAAA,UACvC,mBAAAF;AAAA,UACA,WAAAK;AAAA,UACA,iBAAAJ;AAAA,UACA,UAAAE;AAAA,UACA,eAAAC;AAAA,UACA,uBAAAS;AAAA,UACA,
|
1
|
+
{"version":3,"file":"milestone-tabs.js","sources":["../../../../../../../src/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.tsx"],"sourcesContent":["import type { IMilestoneTabConfig, IMilestoneTabsProps } from './milestone-tabs-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useState } from 'react';\n\nimport ChaptersList from '../../../../../chapters/chapters-list/chapters-list';\nimport { useUIContext } from '../../../../../ui/context/context';\nimport Text from '../../../../../ui/text/text';\nimport MilestoneWidgetResources from '../../../../milestone-resources/resources-list/resources-list';\nimport MilestoneTestsList from '../../../../milestone-tests/test-list-v2/test-list-container';\nimport { getGoalCategoryBasedColorTheme } from '../milestone-utils';\nimport * as Styled from './milestone-tabs-styled';\n\nconst MilestoneTabs: FC<IMilestoneTabsProps> = memo(props => {\n const {\n goalCategory,\n isDraftMilestone,\n isGoalCreation,\n isMilestoneActive,\n userMilestoneId,\n chapters,\n userType,\n canUpdatePlan,\n studentId,\n milestoneState,\n milestonePermissions,\n activeMilestoneId,\n activeTabId,\n } = props;\n const {\n onAddChapter,\n onAssignResources,\n onChapterClick,\n onCreateMilestoneTest,\n onNodeAttempt,\n onNodeView,\n onNodeReview,\n onNodeReattempt,\n onNodeReset,\n onNodeUnassign,\n onTestPreview,\n onTestReview,\n onTestStart,\n onWidgetTabSelection,\n } = props;\n const { visible_tabs: visibleTabs } = milestonePermissions;\n const { onEvent: trackEvent } = useUIContext();\n\n const { backgroundColor } = getGoalCategoryBasedColorTheme(goalCategory, isDraftMilestone);\n\n const TAB_CONFIG: IMilestoneTabConfig = {\n chapters: {\n label: 'Chapters',\n component: (\n <ChaptersList\n milestoneId={userMilestoneId}\n chapters={chapters}\n userType={userType}\n isGoalCreation={isGoalCreation}\n onChapterClick={onChapterClick}\n onAddChapter={onAddChapter}\n canUpdatePlan={Boolean(milestoneState !== 'DRAFT' && canUpdatePlan)}\n isMilestoneActive={isMilestoneActive}\n />\n ),\n },\n tests: {\n label: 'Tests',\n component: (\n <MilestoneTestsList\n isDraftMilestone={isDraftMilestone}\n isChaptersAvailable={chapters.length > 0}\n isMilestoneActive={isMilestoneActive}\n studentId={studentId}\n userMilestoneId={userMilestoneId}\n userType={userType}\n canUpdatePlan={canUpdatePlan}\n onCreateMilestoneTest={onCreateMilestoneTest}\n onNodeReattempt={onNodeReattempt}\n onTestPreview={onTestPreview}\n onTestStart={onTestStart}\n onTestReview={onTestReview}\n />\n ),\n },\n resources: {\n label: 'Resources',\n component: (\n <MilestoneWidgetResources\n isDraftMilestone={isDraftMilestone}\n isMilestoneActive={isMilestoneActive}\n userMilestoneId={userMilestoneId}\n canUpdatePlan={canUpdatePlan}\n studentId={studentId}\n userType={userType}\n onAssignResources={onAssignResources}\n onNodeAttempt={onNodeAttempt}\n onNodeView={onNodeView}\n onNodeReview={onNodeReview}\n onNodeReattempt={onNodeReattempt}\n onNodeReset={onNodeReset}\n onNodeUnassign={onNodeUnassign}\n />\n ),\n },\n };\n\n const filteredTabConfig =\n (visibleTabs ?? []).length === 0\n ? Object.entries(TAB_CONFIG)\n : Object.entries(TAB_CONFIG).filter(([tabName]) =>\n (visibleTabs ?? []).includes(tabName.toUpperCase()),\n );\n const [selectedTabName, setSelectedTabName] = useState(\n userMilestoneId === activeMilestoneId ? activeTabId : filteredTabConfig?.[0]?.[0] || 'chapters',\n );\n\n const handleTabChange = useCallback(\n (tabName: keyof IMilestoneTabConfig, ctaLabel: string) => {\n if (activeMilestoneId === userMilestoneId && tabName === selectedTabName) return null;\n\n setSelectedTabName(tabName);\n\n onWidgetTabSelection?.(userMilestoneId, tabName);\n\n trackEvent('clicked', {\n cta: ctaLabel,\n milestone_id: userMilestoneId,\n });\n },\n [activeMilestoneId, userMilestoneId, selectedTabName, onWidgetTabSelection, trackEvent],\n );\n\n if (isDraftMilestone && chapters.length === 0) {\n return (\n <Styled.NoPlanCardWrapper $gutterX={2} $background=\"WHITE_3\">\n <Text $renderAs=\"ab2\" $color=\"RED\">\n No chapter has been assigned\n </Text>\n </Styled.NoPlanCardWrapper>\n );\n }\n\n return (\n <>\n <Styled.TabsWrapper $backgroundColor={backgroundColor} $frames={filteredTabConfig.length}>\n {filteredTabConfig.map(tabConfig => {\n const [tabName, tabInfo] = tabConfig;\n const { label } = tabInfo;\n const isSelected = tabName === selectedTabName;\n\n return (\n <Styled.TabsText\n $renderAs={isSelected ? 'ub3-bold' : 'ub3'}\n $align=\"center\"\n key={tabName}\n $selected={isSelected}\n onClick={() => handleTabChange(tabName as keyof IMilestoneTabConfig, label)}\n >\n {label}\n </Styled.TabsText>\n );\n })}\n </Styled.TabsWrapper>\n\n <Styled.TabComponentWrapper>\n {TAB_CONFIG[selectedTabName as keyof typeof TAB_CONFIG].component}\n </Styled.TabComponentWrapper>\n </>\n );\n});\n\nexport default MilestoneTabs;\n"],"names":["MilestoneTabs","memo","props","goalCategory","isDraftMilestone","isGoalCreation","isMilestoneActive","userMilestoneId","chapters","userType","canUpdatePlan","studentId","milestoneState","milestonePermissions","activeMilestoneId","activeTabId","onAddChapter","onAssignResources","onChapterClick","onCreateMilestoneTest","onNodeAttempt","onNodeView","onNodeReview","onNodeReattempt","onNodeReset","onNodeUnassign","onTestPreview","onTestReview","onTestStart","onWidgetTabSelection","visibleTabs","trackEvent","useUIContext","backgroundColor","getGoalCategoryBasedColorTheme","TAB_CONFIG","jsx","ChaptersList","MilestoneTestsList","MilestoneWidgetResources","filteredTabConfig","tabName","selectedTabName","setSelectedTabName","useState","_a","handleTabChange","useCallback","ctaLabel","Styled.NoPlanCardWrapper","Text","jsxs","Fragment","Styled.TabsWrapper","tabConfig","tabInfo","label","isSelected","Styled.TabsText","Styled.TabComponentWrapper"],"mappings":";;;;;;;;;AAaM,MAAAA,KAAyCC,EAAK,CAASC,MAAA;;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