@cuemath/leap 2.8.61-as12 → 2.8.61-as15
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/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/homework/homework-card.js +206 -199
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-styled.js +0 -1
- 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 +86 -82
- package/dist/features/homework/hw-card-list/hw-card-list.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 +3 -0
- package/package.json +1 -1
@@ -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","tabConfig","tabInfo","label","isSelected","Styled.TabsText","Styled.TabComponentWrapper"],"mappings":";;;;;;;;;AAaM,MAAAA,KAAyCC,EAAK,CAASC,MAAA;;AACrD,QAAA;AAAA,IACJ,cAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,aAAAC;AAAA,EACE,IAAAb,GACE;AAAA,IACJ,cAAAc;AAAA,IACA,mBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,sBAAAC;AAAA,EACE,IAAA3B,GACE,EAAE,cAAc4B,EAAgB,IAAAjB,GAChC,EAAE,SAASkB,EAAW,IAAIC,EAAa,GAEvC,EAAE,iBAAAC,EAAoB,IAAAC,EAA+B/B,GAAcC,CAAgB,GAEnF+B,IAAkC;AAAA,IACtC,UAAU;AAAA,MACR,OAAO;AAAA,MACP,WACE,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,aAAa9B;AAAA,UACb,UAAAC;AAAA,UACA,UAAAC;AAAA,UACA,gBAAAJ;AAAA,UACA,gBAAAa;AAAA,UACA,cAAAF;AAAA,UACA,eAAe,GAAQJ,MAAmB,WAAWF;AAAA,UACrD,mBAAAJ;AAAA,QAAA;AAAA,MACF;AAAA,IAEJ;AAAA,IACA,OAAO;AAAA,MACL,OAAO;AAAA,MACP,WACE,gBAAA8B;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,kBAAAlC;AAAA,UACA,qBAAqBI,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":"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"}
|
@@ -1,19 +1,19 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { h as
|
3
|
-
import { memo as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import { MILESTONE_WIDGET_MIN_HEIGHT as
|
9
|
-
import { TESTS_CREATION_ANALYTICS_EVENTS as
|
10
|
-
import { TestSheetItemWrapper as
|
11
|
-
const
|
1
|
+
import { jsxs as C, jsx as t } from "react/jsx-runtime";
|
2
|
+
import { h as S } from "../../../../node_modules/humanize-plus/dist/humanize.js";
|
3
|
+
import { memo as x } from "react";
|
4
|
+
import A from "../../../../assets/line-icons/icons/plus2.js";
|
5
|
+
import N from "../../../homework/homework-card.js";
|
6
|
+
import w from "../../../ui/buttons/icon-button/icon-button.js";
|
7
|
+
import O from "../../../ui/layout/flex-view.js";
|
8
|
+
import { MILESTONE_WIDGET_MIN_HEIGHT as g } from "../../constants.js";
|
9
|
+
import { TESTS_CREATION_ANALYTICS_EVENTS as j } from "../tests-creation/tests-creation-analytics-events.js";
|
10
|
+
import { TestSheetItemWrapper as y, IconContainer as H, IconButtonCover as M } from "./test-list-view-styled.js";
|
11
|
+
const R = (e) => {
|
12
12
|
const o = /* @__PURE__ */ new Set();
|
13
13
|
return e == null || e.forEach((r) => {
|
14
14
|
o.add(r.chapter_name);
|
15
15
|
}), Array.from(o).join(", ");
|
16
|
-
},
|
16
|
+
}, V = x(
|
17
17
|
({
|
18
18
|
milestoneId: e,
|
19
19
|
studentId: o,
|
@@ -22,49 +22,50 @@ const j = (e) => {
|
|
22
22
|
onCreateNewTest: m,
|
23
23
|
isMilestoneActive: c,
|
24
24
|
canUpdatedPlan: d,
|
25
|
-
...
|
26
|
-
}) => /* @__PURE__ */
|
27
|
-
|
25
|
+
...l
|
26
|
+
}) => /* @__PURE__ */ C(
|
27
|
+
O,
|
28
28
|
{
|
29
|
-
$height:
|
29
|
+
$height: g,
|
30
30
|
$position: "relative",
|
31
31
|
$justifyContent: "space-between",
|
32
32
|
children: [
|
33
|
-
/* @__PURE__ */ t(
|
33
|
+
/* @__PURE__ */ t(y, { children: r.map((s, a) => {
|
34
34
|
const {
|
35
|
-
items:
|
36
|
-
node_id:
|
37
|
-
sheet_time:
|
35
|
+
items: p,
|
36
|
+
node_id: T,
|
37
|
+
sheet_time: h,
|
38
38
|
total_questions: n,
|
39
|
-
worksheet_id:
|
40
|
-
|
39
|
+
worksheet_id: u,
|
40
|
+
is_timed: _
|
41
|
+
} = s, f = Math.ceil((h || 0) / 60), I = R(p), E = _ ? `${f} Mins` : "", $ = `${n ? `${n} ${S.pluralize(n, "Question")}` : ""} ${E}`;
|
41
42
|
return /* @__PURE__ */ t(
|
42
|
-
|
43
|
+
N,
|
43
44
|
{
|
44
45
|
userType: i,
|
45
46
|
header: I,
|
46
|
-
subHeader:
|
47
|
+
subHeader: $,
|
47
48
|
nodeData: s,
|
48
49
|
renderAs: "milestone",
|
49
50
|
shouldOpenOnRight: (a + 1) % 3 === 0,
|
50
|
-
...
|
51
|
+
...l
|
51
52
|
},
|
52
|
-
`${
|
53
|
+
`${u}_${T}_${a}`
|
53
54
|
);
|
54
55
|
}) }),
|
55
56
|
i === "TEACHER" && d && /* @__PURE__ */ t(
|
56
|
-
|
57
|
+
H,
|
57
58
|
{
|
58
59
|
$flexDirection: "row",
|
59
60
|
$justifyContent: "flex-end",
|
60
61
|
$gapX: 1,
|
61
62
|
$gutterX: 1,
|
62
|
-
children: /* @__PURE__ */ t(
|
63
|
-
|
63
|
+
children: /* @__PURE__ */ t(M, { children: /* @__PURE__ */ t(
|
64
|
+
w,
|
64
65
|
{
|
65
|
-
Icon:
|
66
|
+
Icon: A,
|
66
67
|
renderAs: "secondary",
|
67
|
-
analyticsLabel:
|
68
|
+
analyticsLabel: j.CUSTOM_TEST_CREATION_STARTED,
|
68
69
|
onClick: m,
|
69
70
|
disabled: !c,
|
70
71
|
analyticsProps: {
|
@@ -79,6 +80,6 @@ const j = (e) => {
|
|
79
80
|
)
|
80
81
|
);
|
81
82
|
export {
|
82
|
-
|
83
|
+
V as default
|
83
84
|
};
|
84
85
|
//# sourceMappingURL=test-list-view.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"test-list-view.js","sources":["../../../../../src/features/milestone/milestone-tests/test-list-v2/test-list-view.tsx"],"sourcesContent":["import type { TNodeDataTestItemsDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { ITestSheetsList } from './types';\nimport type { FC } from 'react';\n\nimport { pluralize } from 'humanize-plus';\nimport { memo } from 'react';\n\nimport Plus2Icon from '../../../../assets/line-icons/icons/plus2';\nimport HomeworkCard from '../../../homework/homework-card';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { MILESTONE_WIDGET_MIN_HEIGHT } from '../../constants';\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../tests-creation/tests-creation-analytics-events';\nimport * as Styled from './test-list-view-styled';\n\nconst getTopicNameFromItems = (items?: TNodeDataTestItemsDataProps[]) => {\n const topics = new Set<string>();\n\n items?.forEach(item => {\n topics.add(item.chapter_name);\n });\n\n return Array.from(topics).join(', ');\n};\n\nconst TestSheetsList: FC<ITestSheetsList> = memo(\n ({\n milestoneId,\n studentId,\n sheets,\n userType,\n onCreateNewTest,\n isMilestoneActive,\n canUpdatedPlan,\n ...sheetCallbacks\n }) => {\n return (\n <FlexView\n $height={MILESTONE_WIDGET_MIN_HEIGHT}\n $position=\"relative\"\n $justifyContent=\"space-between\"\n >\n <Styled.TestSheetItemWrapper>\n {sheets.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n sheet_time: sheetTime,\n total_questions: totalQuestions,\n worksheet_id: worksheetId,\n } = sheet;\n const totalSheetTime = Math.ceil((sheetTime || 0) / 60);\n const testChapterName = getTopicNameFromItems(items);\n const
|
1
|
+
{"version":3,"file":"test-list-view.js","sources":["../../../../../src/features/milestone/milestone-tests/test-list-v2/test-list-view.tsx"],"sourcesContent":["import type { TNodeDataTestItemsDataProps } from '../../../chapters-v2/comps/node-card/node-card-types';\nimport type { ITestSheetsList } from './types';\nimport type { FC } from 'react';\n\nimport { pluralize } from 'humanize-plus';\nimport { memo } from 'react';\n\nimport Plus2Icon from '../../../../assets/line-icons/icons/plus2';\nimport HomeworkCard from '../../../homework/homework-card';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport { MILESTONE_WIDGET_MIN_HEIGHT } from '../../constants';\nimport { TESTS_CREATION_ANALYTICS_EVENTS } from '../tests-creation/tests-creation-analytics-events';\nimport * as Styled from './test-list-view-styled';\n\nconst getTopicNameFromItems = (items?: TNodeDataTestItemsDataProps[]) => {\n const topics = new Set<string>();\n\n items?.forEach(item => {\n topics.add(item.chapter_name);\n });\n\n return Array.from(topics).join(', ');\n};\n\nconst TestSheetsList: FC<ITestSheetsList> = memo(\n ({\n milestoneId,\n studentId,\n sheets,\n userType,\n onCreateNewTest,\n isMilestoneActive,\n canUpdatedPlan,\n ...sheetCallbacks\n }) => {\n return (\n <FlexView\n $height={MILESTONE_WIDGET_MIN_HEIGHT}\n $position=\"relative\"\n $justifyContent=\"space-between\"\n >\n <Styled.TestSheetItemWrapper>\n {sheets.map((sheet, idx) => {\n const {\n items,\n node_id: nodeId,\n sheet_time: sheetTime,\n total_questions: totalQuestions,\n worksheet_id: worksheetId,\n is_timed: isTimed,\n } = sheet;\n const totalSheetTime = Math.ceil((sheetTime || 0) / 60);\n const testChapterName = getTopicNameFromItems(items);\n const sheetTimeText = isTimed ? `${totalSheetTime} Mins` : '';\n const totalQuestionsText = totalQuestions\n ? `${totalQuestions} ${pluralize(totalQuestions, 'Question')}`\n : '';\n const subHeader = `${totalQuestionsText} ${sheetTimeText}`;\n\n return (\n <HomeworkCard\n key={`${worksheetId}_${nodeId}_${idx}`}\n userType={userType}\n header={testChapterName}\n subHeader={subHeader}\n nodeData={sheet}\n renderAs=\"milestone\"\n shouldOpenOnRight={(idx + 1) % 3 === 0}\n {...sheetCallbacks}\n />\n );\n })}\n </Styled.TestSheetItemWrapper>\n\n {userType === 'TEACHER' && canUpdatedPlan && (\n <Styled.IconContainer\n $flexDirection=\"row\"\n $justifyContent=\"flex-end\"\n $gapX={1}\n $gutterX={1}\n >\n <Styled.IconButtonCover>\n <IconButton\n Icon={Plus2Icon}\n renderAs=\"secondary\"\n analyticsLabel={TESTS_CREATION_ANALYTICS_EVENTS.CUSTOM_TEST_CREATION_STARTED}\n onClick={onCreateNewTest}\n disabled={!isMilestoneActive}\n analyticsProps={{\n milestone_id: milestoneId,\n }}\n />\n </Styled.IconButtonCover>\n </Styled.IconContainer>\n )}\n </FlexView>\n );\n },\n);\n\nexport default TestSheetsList;\n"],"names":["getTopicNameFromItems","items","topics","item","TestSheetsList","memo","milestoneId","studentId","sheets","userType","onCreateNewTest","isMilestoneActive","canUpdatedPlan","sheetCallbacks","jsxs","FlexView","MILESTONE_WIDGET_MIN_HEIGHT","jsx","Styled.TestSheetItemWrapper","sheet","idx","nodeId","sheetTime","totalQuestions","worksheetId","isTimed","totalSheetTime","testChapterName","sheetTimeText","subHeader","pluralize","HomeworkCard","Styled.IconContainer","Styled.IconButtonCover","IconButton","Plus2Icon","TESTS_CREATION_ANALYTICS_EVENTS"],"mappings":";;;;;;;;;;AAeA,MAAMA,IAAwB,CAACC,MAA0C;AACjE,QAAAC,wBAAa;AAEnB,SAAAD,KAAA,QAAAA,EAAO,QAAQ,CAAQE,MAAA;AACd,IAAAD,EAAA,IAAIC,EAAK,YAAY;AAAA,EAAA,IAGvB,MAAM,KAAKD,CAAM,EAAE,KAAK,IAAI;AACrC,GAEME,IAAsCC;AAAA,EAC1C,CAAC;AAAA,IACC,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,MAGD,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAASC;AAAA,MACT,WAAU;AAAA,MACV,iBAAgB;AAAA,MAEhB,UAAA;AAAA,QAAA,gBAAAC,EAACC,GAAA,EACE,YAAO,IAAI,CAACC,GAAOC,MAAQ;AACpB,gBAAA;AAAA,YACJ,OAAAnB;AAAA,YACA,SAASoB;AAAA,YACT,YAAYC;AAAA,YACZ,iBAAiBC;AAAA,YACjB,cAAcC;AAAA,YACd,UAAUC;AAAA,UACR,IAAAN,GACEO,IAAiB,KAAK,MAAMJ,KAAa,KAAK,EAAE,GAChDK,IAAkB3B,EAAsBC,CAAK,GAC7C2B,IAAgBH,IAAU,GAAGC,CAAc,UAAU,IAIrDG,IAAY,GAHSN,IACvB,GAAGA,CAAc,IAAIO,EAAU,UAAAP,GAAgB,UAAU,CAAC,KAC1D,EACmC,IAAIK,CAAa;AAGtD,iBAAA,gBAAAX;AAAA,YAACc;AAAA,YAAA;AAAA,cAEC,UAAAtB;AAAA,cACA,QAAQkB;AAAA,cACR,WAAAE;AAAA,cACA,UAAUV;AAAA,cACV,UAAS;AAAA,cACT,oBAAoBC,IAAM,KAAK,MAAM;AAAA,cACpC,GAAGP;AAAA,YAAA;AAAA,YAPC,GAAGW,CAAW,IAAIH,CAAM,IAAID,CAAG;AAAA,UAAA;AAAA,QAUzC,CAAA,GACH;AAAA,QAECX,MAAa,aAAaG,KACzB,gBAAAK;AAAA,UAACe;AAAAA,UAAA;AAAA,YACC,gBAAe;AAAA,YACf,iBAAgB;AAAA,YAChB,OAAO;AAAA,YACP,UAAU;AAAA,YAEV,UAAA,gBAAAf,EAACgB,GAAA,EACC,UAAA,gBAAAhB;AAAA,cAACiB;AAAA,cAAA;AAAA,gBACC,MAAMC;AAAA,gBACN,UAAS;AAAA,gBACT,gBAAgBC,EAAgC;AAAA,gBAChD,SAAS1B;AAAA,gBACT,UAAU,CAACC;AAAA,gBACX,gBAAgB;AAAA,kBACd,cAAcL;AAAA,gBAChB;AAAA,cAAA;AAAA,YAAA,GAEJ;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAKV;"}
|
@@ -1,51 +1,39 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { h as
|
3
|
-
import { memo as
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
const
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
2
|
+
import { h as f } from "../../../node_modules/humanize-plus/dist/humanize.js";
|
3
|
+
import { memo as $ } from "react";
|
4
|
+
import x from "styled-components";
|
5
|
+
import _ from "../../homework/homework-card.js";
|
6
|
+
import g from "../../ui/layout/flex-view.js";
|
7
|
+
const w = x.div`
|
8
8
|
display: grid;
|
9
9
|
grid-template-columns: repeat(3, 200px);
|
10
10
|
grid-gap: 32px;
|
11
11
|
justify-content: center;
|
12
12
|
padding: 32px 0;
|
13
|
-
`,
|
13
|
+
`, R = ({ sheets: r, userType: n, ...m }) => /* @__PURE__ */ t(g, { children: /* @__PURE__ */ t(w, { children: r.map((o, s) => {
|
14
14
|
const {
|
15
|
-
|
16
|
-
|
15
|
+
title: d,
|
16
|
+
node_id: a,
|
17
|
+
worksheet_id: p,
|
18
|
+
is_timed: l,
|
19
|
+
sheet_time: c,
|
17
20
|
total_questions: e
|
18
|
-
} =
|
19
|
-
|
20
|
-
|
21
|
-
case "MASTERY":
|
22
|
-
case "DYNAMIC":
|
23
|
-
return `${typeof e == "number" ? `${e} ${p.pluralize(e, "Question")}, ${t ? `${t / 60} min` : ""}` : ""}`;
|
24
|
-
case "PUZZLE_EASY":
|
25
|
-
case "PUZZLE_HARD":
|
26
|
-
case "PUZZLE_MEDIUM":
|
27
|
-
case "PUZZLE":
|
28
|
-
return "";
|
29
|
-
default:
|
30
|
-
return "";
|
31
|
-
}
|
32
|
-
}, _ = ({ sheets: r, userType: t, ...o }) => /* @__PURE__ */ s(f, { children: /* @__PURE__ */ s(h, { children: r.map((e, n) => {
|
33
|
-
const { title: i, node_id: a, worksheet_id: d } = e, m = E(e);
|
34
|
-
return /* @__PURE__ */ s(
|
35
|
-
l,
|
21
|
+
} = o, u = Math.ceil((c || 0) / 60), i = e ? `${e} ${f.pluralize(e, "Question")}` : "", h = l ? `${i} ${u} Mins` : i;
|
22
|
+
return /* @__PURE__ */ t(
|
23
|
+
_,
|
36
24
|
{
|
37
|
-
header:
|
38
|
-
subHeader:
|
39
|
-
userType:
|
40
|
-
nodeData:
|
25
|
+
header: d,
|
26
|
+
subHeader: h,
|
27
|
+
userType: n,
|
28
|
+
nodeData: o,
|
41
29
|
renderAs: "milestone",
|
42
|
-
shouldOpenOnRight: (
|
43
|
-
...
|
30
|
+
shouldOpenOnRight: (s + 1) % 3 === 0,
|
31
|
+
...m
|
44
32
|
},
|
45
|
-
`${
|
33
|
+
`${p}_${a}_${s}`
|
46
34
|
);
|
47
|
-
}) }) }),
|
35
|
+
}) }) }), j = $(R);
|
48
36
|
export {
|
49
|
-
|
37
|
+
j as default
|
50
38
|
};
|
51
39
|
//# sourceMappingURL=resource-list.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resource-list.js","sources":["../../../../src/features/sheet-v2/resource-list/resource-list.tsx"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"file":"resource-list.js","sources":["../../../../src/features/sheet-v2/resource-list/resource-list.tsx"],"sourcesContent":["import type { IResourcesListProps } from './types';\nimport type { FC } from 'react';\n\nimport { pluralize } from 'humanize-plus';\nimport { memo } from 'react';\nimport styled from 'styled-components';\n\nimport HomeworkCard from '../../homework/homework-card';\nimport FlexView from '../../ui/layout/flex-view';\n\nconst ResourceItemListWrapper = styled.div`\n display: grid;\n grid-template-columns: repeat(3, 200px);\n grid-gap: 32px;\n justify-content: center;\n padding: 32px 0;\n`;\n\nconst ResourcesList: FC<IResourcesListProps> = ({ sheets, userType, ...sheetCallBacks }) => (\n <FlexView>\n <ResourceItemListWrapper>\n {sheets.map((sheet, idx) => {\n const {\n title,\n node_id: nodeId,\n worksheet_id: worksheetId,\n is_timed: isTimed,\n sheet_time: sheetTime,\n total_questions: totalQuestions,\n } = sheet;\n const totalSheetTime = Math.ceil((sheetTime || 0) / 60);\n const totalQuestionsText = totalQuestions\n ? `${totalQuestions} ${pluralize(totalQuestions, 'Question')}`\n : '';\n const subHeader = isTimed\n ? `${totalQuestionsText} ${totalSheetTime} Mins`\n : totalQuestionsText;\n\n return (\n <HomeworkCard\n key={`${worksheetId}_${nodeId}_${idx}`}\n header={title}\n subHeader={subHeader}\n userType={userType}\n nodeData={sheet}\n renderAs=\"milestone\"\n shouldOpenOnRight={(idx + 1) % 3 === 0}\n {...sheetCallBacks}\n />\n );\n })}\n </ResourceItemListWrapper>\n </FlexView>\n);\n\nexport default memo(ResourcesList);\n"],"names":["ResourceItemListWrapper","styled","ResourcesList","sheets","userType","sheetCallBacks","jsx","FlexView","sheet","idx","title","nodeId","worksheetId","isTimed","sheetTime","totalQuestions","totalSheetTime","totalQuestionsText","pluralize","subHeader","HomeworkCard","ResourcesList$1","memo"],"mappings":";;;;;;AAUA,MAAMA,IAA0BC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQjCC,IAAyC,CAAC,EAAE,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAe,MACnF,gBAAAC,EAAAC,GAAA,EACC,4BAACP,GACE,EAAA,UAAAG,EAAO,IAAI,CAACK,GAAOC,MAAQ;AACpB,QAAA;AAAA,IACJ,OAAAC;AAAA,IACA,SAASC;AAAA,IACT,cAAcC;AAAA,IACd,UAAUC;AAAA,IACV,YAAYC;AAAA,IACZ,iBAAiBC;AAAA,EACf,IAAAP,GACEQ,IAAiB,KAAK,MAAMF,KAAa,KAAK,EAAE,GAChDG,IAAqBF,IACvB,GAAGA,CAAc,IAAIG,EAAU,UAAAH,GAAgB,UAAU,CAAC,KAC1D,IACEI,IAAYN,IACd,GAAGI,CAAkB,IAAID,CAAc,UACvCC;AAGF,SAAA,gBAAAX;AAAA,IAACc;AAAA,IAAA;AAAA,MAEC,QAAQV;AAAA,MACR,WAAAS;AAAA,MACA,UAAAf;AAAA,MACA,UAAUI;AAAA,MACV,UAAS;AAAA,MACT,oBAAoBC,IAAM,KAAK,MAAM;AAAA,MACpC,GAAGJ;AAAA,IAAA;AAAA,IAPC,GAAGO,CAAW,IAAID,CAAM,IAAIF,CAAG;AAAA,EAAA;AAU1C,CAAC,GACH,EACF,CAAA,GAGaY,IAAAC,EAAKpB,CAAa;"}
|
package/dist/index.d.ts
CHANGED
@@ -2184,6 +2184,8 @@ export declare interface INodeDataProps {
|
|
2184
2184
|
unlocked_on_ts: number | null;
|
2185
2185
|
items?: TNodeDataTestItemsDataProps[];
|
2186
2186
|
user_milestone_id?: string;
|
2187
|
+
user_attempt_id: string | null;
|
2188
|
+
subtext: string | null;
|
2187
2189
|
}
|
2188
2190
|
|
2189
2191
|
declare interface INodePermissions {
|
@@ -2993,6 +2995,7 @@ declare interface ITestsListProps {
|
|
2993
2995
|
isDraftMilestone?: boolean;
|
2994
2996
|
isChaptersAvailable?: boolean;
|
2995
2997
|
canUpdatePlan?: boolean;
|
2998
|
+
onNodeReattempt?: (sheetData: INodeDataProps, milestoneId?: string) => void;
|
2996
2999
|
onTestPreview?: (sheetData: INodeDataProps, milestoneId: string) => void;
|
2997
3000
|
onTestStart?: (sheetData: INodeDataProps) => void;
|
2998
3001
|
onTestReview?: (sheetData: INodeDataProps, milestoneId: string) => void;
|