@cuemath/leap 3.1.23-beta-0.2 → 3.1.23-j1

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.
Files changed (21) hide show
  1. package/dist/features/auth/login/username-password-form/username-password-form.js +1 -1
  2. package/dist/features/auth/login/username-password-form/username-password-form.js.map +1 -1
  3. package/dist/features/chapters-v2/chapter-details/chapter-details.js +26 -26
  4. package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
  5. package/dist/features/circle-games/sign-up/api/use-validate-username-api/use-username-availability-get.js +10 -0
  6. package/dist/features/circle-games/sign-up/api/use-validate-username-api/use-username-availability-get.js.map +1 -0
  7. package/dist/features/circle-games/sign-up/comp/username-input/constants.js +7 -4
  8. package/dist/features/circle-games/sign-up/comp/username-input/constants.js.map +1 -1
  9. package/dist/features/circle-games/sign-up/comp/username-input/username-input.js +49 -39
  10. package/dist/features/circle-games/sign-up/comp/username-input/username-input.js.map +1 -1
  11. package/dist/features/circle-games/sign-up/dal/validate-username-dal/validate-username-dal.js +20 -25
  12. package/dist/features/circle-games/sign-up/dal/validate-username-dal/validate-username-dal.js.map +1 -1
  13. package/dist/features/trial-session/comps/learning-plan/index.js +59 -56
  14. package/dist/features/trial-session/comps/learning-plan/index.js.map +1 -1
  15. package/dist/features/trial-session/comps/learning-plan/learning-plan-styled.js +24 -16
  16. package/dist/features/trial-session/comps/learning-plan/learning-plan-styled.js.map +1 -1
  17. package/package.json +1 -1
  18. package/dist/features/circle-games/sign-up/api/use-validate-username-api/use-validate-user-api.js +0 -9
  19. package/dist/features/circle-games/sign-up/api/use-validate-username-api/use-validate-user-api.js.map +0 -1
  20. package/dist/features/circle-games/sign-up/dal/validate-username-dal/validate-username-dal-types.js +0 -5
  21. package/dist/features/circle-games/sign-up/dal/validate-username-dal/validate-username-dal-types.js.map +0 -1
@@ -71,7 +71,7 @@ const x = ({
71
71
  )
72
72
  ] }),
73
73
  /* @__PURE__ */ e(a, { heightX: 1.25 }),
74
- /* @__PURE__ */ e(o, { $alignItems: "flex-end", children: /* @__PURE__ */ e(C, { label: "Forgot Password?", onClick: c, color: "WHITE_T_60" }) }),
74
+ /* @__PURE__ */ e(o, { $alignItems: "flex-end", children: /* @__PURE__ */ e(C, { label: "Forgot password?", onClick: c, color: "WHITE_T_60" }) }),
75
75
  /* @__PURE__ */ e(a, { heightX: 2 }),
76
76
  /* @__PURE__ */ e(o, { $justifyContent: "center", children: /* @__PURE__ */ e(
77
77
  w,
@@ -1 +1 @@
1
- {"version":3,"file":"username-password-form.js","sources":["../../../../../src/features/auth/login/username-password-form/username-password-form.tsx"],"sourcesContent":["import type { IUsernamePasswordFormProps } from './username-password-form-types';\n\nimport { type ChangeEvent, type FC, memo, useCallback } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport InputStatusIcon from '../../comps/input-status-icon/input-status-icon';\nimport * as Styled from '../login-styled';\n\nconst UsernamePasswordForm: FC<IUsernamePasswordFormProps> = ({\n username,\n password,\n errors,\n isLoading,\n onChange,\n onSubmit,\n onForgotPassword,\n}) => {\n const isSubmitDisabled = isLoading || !username.trim() || !password.trim();\n\n const handleUsernameChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('username', e.target.value);\n },\n [onChange],\n );\n\n const handlePasswordChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('password', e.target.value);\n },\n [onChange],\n );\n\n return (\n <Styled.Container\n $gutterX={1.5}\n $gapX={1.5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"BLACK_2\"\n >\n <Styled.FormContainer onSubmit={onSubmit}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <TextInput\n renderAs={errors.username ? 'error-dark' : 'primary-dark'}\n autoFocus\n autoComplete=\"username\"\n label=\"Username\"\n value={username}\n width=\"100%\"\n onChange={handleUsernameChange}\n required\n shape=\"borderLess\"\n errorMessage={errors.username}\n />\n <Separator height={36} />\n <TextInput\n type=\"password\"\n renderAs={errors.password ? 'error-dark' : 'primary-dark'}\n autoComplete=\"password\"\n label=\"Password\"\n value={password}\n width=\"100%\"\n onChange={handlePasswordChange}\n required\n shape=\"borderLess\"\n errorMessage={errors.password}\n siblingElement={<InputStatusIcon isError={!!errors.password} />}\n />\n </FlexView>\n <Separator heightX={1.25} />\n <FlexView $alignItems=\"flex-end\">\n <TextButton label=\"Forgot Password?\" onClick={onForgotPassword} color=\"WHITE_T_60\" />\n </FlexView>\n <Separator heightX={2} />\n <FlexView $justifyContent=\"center\">\n <Button\n size=\"small\"\n renderAs=\"secondary-dark\"\n type=\"submit\"\n label=\"Log in\"\n width=\"100%\"\n busy={isLoading}\n disabled={isSubmitDisabled}\n />\n </FlexView>\n </Styled.FormContainer>\n </Styled.Container>\n );\n};\n\nexport default memo(UsernamePasswordForm);\n"],"names":["UsernamePasswordForm","username","password","errors","isLoading","onChange","onSubmit","onForgotPassword","isSubmitDisabled","handleUsernameChange","useCallback","e","handlePasswordChange","jsx","Styled.Container","jsxs","Styled.FormContainer","FlexView","TextInput","Separator","InputStatusIcon","TextButton","Button","usernamePasswordForm","memo"],"mappings":";;;;;;;;;AAYA,MAAMA,IAAuD,CAAC;AAAA,EAC5D,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AACF,MAAM;AACE,QAAAC,IAAmBJ,KAAa,CAACH,EAAS,UAAU,CAACC,EAAS,QAE9DO,IAAuBC;AAAA,IAC3B,CAACC,MAAqC;AAC3B,MAAAN,EAAA,YAAYM,EAAE,OAAO,KAAK;AAAA,IACrC;AAAA,IACA,CAACN,CAAQ;AAAA,EAAA,GAGLO,IAAuBF;AAAA,IAC3B,CAAC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,SAASd,GAAkB,OAAM,aAAa,CAAA,GACrF;AAAA,QACA,gBAAAM,EAACM,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,QACvB,gBAAAN,EAACI,GAAS,EAAA,iBAAgB,UACxB,UAAA,gBAAAJ;AAAA,UAACS;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,UAAS;AAAA,YACT,MAAK;AAAA,YACL,OAAM;AAAA,YACN,OAAM;AAAA,YACN,MAAMlB;AAAA,YACN,UAAUI;AAAA,UAAA;AAAA,QAAA,GAEd;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,GAEee,IAAAC,EAAKxB,CAAoB;"}
1
+ {"version":3,"file":"username-password-form.js","sources":["../../../../../src/features/auth/login/username-password-form/username-password-form.tsx"],"sourcesContent":["import type { IUsernamePasswordFormProps } from './username-password-form-types';\n\nimport { type ChangeEvent, type FC, memo, useCallback } from 'react';\n\nimport Button from '../../../ui/buttons/button/button';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport TextInput from '../../../ui/inputs/text-input/text-input';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport InputStatusIcon from '../../comps/input-status-icon/input-status-icon';\nimport * as Styled from '../login-styled';\n\nconst UsernamePasswordForm: FC<IUsernamePasswordFormProps> = ({\n username,\n password,\n errors,\n isLoading,\n onChange,\n onSubmit,\n onForgotPassword,\n}) => {\n const isSubmitDisabled = isLoading || !username.trim() || !password.trim();\n\n const handleUsernameChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('username', e.target.value);\n },\n [onChange],\n );\n\n const handlePasswordChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange('password', e.target.value);\n },\n [onChange],\n );\n\n return (\n <Styled.Container\n $gutterX={1.5}\n $gapX={1.5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $background=\"BLACK_2\"\n >\n <Styled.FormContainer onSubmit={onSubmit}>\n <FlexView $alignItems=\"center\" $justifyContent=\"center\">\n <TextInput\n renderAs={errors.username ? 'error-dark' : 'primary-dark'}\n autoFocus\n autoComplete=\"username\"\n label=\"Username\"\n value={username}\n width=\"100%\"\n onChange={handleUsernameChange}\n required\n shape=\"borderLess\"\n errorMessage={errors.username}\n />\n <Separator height={36} />\n <TextInput\n type=\"password\"\n renderAs={errors.password ? 'error-dark' : 'primary-dark'}\n autoComplete=\"password\"\n label=\"Password\"\n value={password}\n width=\"100%\"\n onChange={handlePasswordChange}\n required\n shape=\"borderLess\"\n errorMessage={errors.password}\n siblingElement={<InputStatusIcon isError={!!errors.password} />}\n />\n </FlexView>\n <Separator heightX={1.25} />\n <FlexView $alignItems=\"flex-end\">\n <TextButton label=\"Forgot password?\" onClick={onForgotPassword} color=\"WHITE_T_60\" />\n </FlexView>\n <Separator heightX={2} />\n <FlexView $justifyContent=\"center\">\n <Button\n size=\"small\"\n renderAs=\"secondary-dark\"\n type=\"submit\"\n label=\"Log in\"\n width=\"100%\"\n busy={isLoading}\n disabled={isSubmitDisabled}\n />\n </FlexView>\n </Styled.FormContainer>\n </Styled.Container>\n );\n};\n\nexport default memo(UsernamePasswordForm);\n"],"names":["UsernamePasswordForm","username","password","errors","isLoading","onChange","onSubmit","onForgotPassword","isSubmitDisabled","handleUsernameChange","useCallback","e","handlePasswordChange","jsx","Styled.Container","jsxs","Styled.FormContainer","FlexView","TextInput","Separator","InputStatusIcon","TextButton","Button","usernamePasswordForm","memo"],"mappings":";;;;;;;;;AAYA,MAAMA,IAAuD,CAAC;AAAA,EAC5D,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AACF,MAAM;AACE,QAAAC,IAAmBJ,KAAa,CAACH,EAAS,UAAU,CAACC,EAAS,QAE9DO,IAAuBC;AAAA,IAC3B,CAACC,MAAqC;AAC3B,MAAAN,EAAA,YAAYM,EAAE,O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B,gBAAAN,EAAAI,GAAA,EAAS,aAAY,YACpB,UAAC,gBAAAJ,EAAAQ,GAAA,EAAW,OAAM,oBAAmB,SAASd,GAAkB,OAAM,aAAa,CAAA,GACrF;AAAA,QACA,gBAAAM,EAACM,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,QACvB,gBAAAN,EAACI,GAAS,EAAA,iBAAgB,UACxB,UAAA,gBAAAJ;AAAA,UAACS;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,UAAS;AAAA,YACT,MAAK;AAAA,YACL,OAAM;AAAA,YACN,OAAM;AAAA,YACN,MAAMlB;AAAA,YACN,UAAUI;AAAA,UAAA;AAAA,QAAA,GAEd;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,GAEee,IAAAC,EAAKxB,CAAoB;"}
@@ -1,4 +1,4 @@
1
- import { jsxs as m, jsx as t, Fragment as _ } from "react/jsx-runtime";
1
+ import { jsxs as m, jsx as r, Fragment as _ } from "react/jsx-runtime";
2
2
  import { memo as v, useCallback as D, useEffect as p } from "react";
3
3
  import { ILLUSTRATIONS as E } from "../../../assets/illustrations/illustrations.js";
4
4
  import L from "../../../assets/line-icons/icons/back2.js";
@@ -12,31 +12,31 @@ import { useGetChapterDetails as F } from "../api/chapter.js";
12
12
  import O from "./block-sections/block-sections.js";
13
13
  import W from "./chapter-banner/chapter-banner.js";
14
14
  import { ContentWrapper as X, BackButtonContainer as z, BackButtonWrapper as G, LoaderWrapper as V } from "./chapter-details-styled.js";
15
- const q = v((g) => {
15
+ const q = v((f) => {
16
16
  const {
17
17
  userChapterId: n,
18
18
  studentId: i,
19
19
  userType: a,
20
- onBlockSkipUnskip: f,
20
+ onBlockSkipUnskip: g,
21
21
  onNodeAttempt: u,
22
22
  onNodeAssignAsHomework: k,
23
23
  onNodeMarkAsDone: C,
24
24
  onNodeReattempt: y,
25
25
  onNodeReview: A,
26
26
  onNodeView: B,
27
- onExit: N,
28
- onNodeUnassign: $,
27
+ onExit: $,
28
+ onNodeUnassign: N,
29
29
  onNodeUnlock: S,
30
- onNodeSkipUnSkip: w,
30
+ onNodeSkipUnSkip: x,
31
31
  startChapterPageJourney: s,
32
- chapterPageRef: x,
33
- bannerRef: I,
32
+ chapterPageRef: I,
33
+ bannerRef: w,
34
34
  coreBlocksRef: R,
35
35
  canStartJourney: c
36
- } = g, { isJourneyActive: l } = P(), {
36
+ } = f, { isJourneyActive: l } = P(), {
37
37
  get: d,
38
38
  data: e,
39
- isProcessing: r,
39
+ isProcessing: t,
40
40
  isProcessingFailed: b,
41
41
  isStale: h
42
42
  } = F(), o = D(() => {
@@ -60,10 +60,10 @@ const q = v((g) => {
60
60
  n,
61
61
  a
62
62
  ]), p(() => {
63
- !r && h && o();
64
- }, [o, r, h]), b ? /* @__PURE__ */ m(j, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
65
- /* @__PURE__ */ t(J, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
66
- /* @__PURE__ */ t(
63
+ !t && h && o();
64
+ }, [o, t, h]), b ? /* @__PURE__ */ m(j, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
65
+ /* @__PURE__ */ r(J, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
66
+ /* @__PURE__ */ r(
67
67
  T,
68
68
  {
69
69
  widthX: 14,
@@ -74,44 +74,44 @@ const q = v((g) => {
74
74
  onClick: o
75
75
  }
76
76
  )
77
- ] }) : !e && r ? /* @__PURE__ */ t(H, { height: "80vh" }) : /* @__PURE__ */ m(
77
+ ] }) : !e && t ? /* @__PURE__ */ r(H, { height: "80vh" }) : /* @__PURE__ */ m(
78
78
  X,
79
79
  {
80
- ref: x,
80
+ ref: I,
81
81
  $widthX: 50,
82
- $disablePointerEvents: r,
82
+ $disablePointerEvents: t,
83
83
  $justifyContent: "center",
84
84
  $alignItems: "center",
85
85
  children: [
86
- a === "TEACHER" && /* @__PURE__ */ t(z, { $height: "100%", className: "goal-widget-chapter-item", children: /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(
86
+ a === "TEACHER" && /* @__PURE__ */ r(z, { $height: "100%", children: /* @__PURE__ */ r(G, { children: /* @__PURE__ */ r(
87
87
  U,
88
88
  {
89
89
  Icon: L,
90
90
  renderAs: "secondary-gray",
91
91
  analyticsLabel: "chapter_page_exit",
92
92
  size: "xsmall",
93
- onClick: N
93
+ onClick: $
94
94
  }
95
95
  ) }) }),
96
- r && /* @__PURE__ */ t(V, { children: /* @__PURE__ */ t("img", { src: E.LOADER_1, alt: "loader" }) }),
96
+ t && /* @__PURE__ */ r(V, { children: /* @__PURE__ */ r("img", { src: E.LOADER_1, alt: "loader" }) }),
97
97
  e && /* @__PURE__ */ m(_, { children: [
98
- /* @__PURE__ */ t(
98
+ /* @__PURE__ */ r(
99
99
  W,
100
100
  {
101
101
  title: e.name,
102
102
  imageHue: e.image_hue,
103
103
  imageUrl: e.image_url,
104
104
  progressStats: e == null ? void 0 : e.progress_stat,
105
- bannerRef: I
105
+ bannerRef: w
106
106
  }
107
107
  ),
108
- /* @__PURE__ */ t(
108
+ /* @__PURE__ */ r(
109
109
  O,
110
110
  {
111
111
  imageHue: e.image_hue,
112
112
  userType: a,
113
113
  blocks: e.blocks,
114
- onBlockSkipUnskip: f,
114
+ onBlockSkipUnskip: g,
115
115
  onNodeAttempt: u,
116
116
  onNodeAssignAsHomework: k,
117
117
  onNodeMarkAsDone: C,
@@ -119,9 +119,9 @@ const q = v((g) => {
119
119
  onNodeReview: A,
120
120
  onNodeView: B,
121
121
  coreBlocksRef: R,
122
- onNodeUnassign: $,
122
+ onNodeUnassign: N,
123
123
  onNodeUnlock: S,
124
- onNodeSkipUnSkip: w
124
+ onNodeSkipUnSkip: x
125
125
  }
126
126
  )
127
127
  ] })
@@ -1 +1 @@
1
- {"version":3,"file":"chapter-details.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n onNodeUnassign,\n onNodeUnlock,\n onNodeSkipUnSkip,\n startChapterPageJourney,\n chapterPageRef,\n bannerRef,\n coreBlocksRef,\n canStartJourney,\n } = props;\n const { isJourneyActive } = useJourney();\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n useEffect(() => {\n if (chapterDetails && canStartJourney && !isJourneyActive && startChapterPageJourney) {\n startChapterPageJourney({\n chapterDetails: chapterDetails,\n userChapterId,\n studentId,\n userType,\n });\n }\n }, [\n canStartJourney,\n chapterDetails,\n isJourneyActive,\n startChapterPageJourney,\n studentId,\n userChapterId,\n userType,\n ]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"80vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n ref={chapterPageRef}\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\" className=\"goal-widget-chapter-item\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <>\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n bannerRef={bannerRef}\n />\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n coreBlocksRef={coreBlocksRef}\n onNodeUnassign={onNodeUnassign}\n onNodeUnlock={onNodeUnlock}\n onNodeSkipUnSkip={onNodeSkipUnSkip}\n />\n </>\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAssignAsHomework","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","onNodeUnassign","onNodeUnlock","onNodeSkipUnSkip","startChapterPageJourney","chapterPageRef","bannerRef","coreBlocksRef","canStartJourney","isJourneyActive","useJourney","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","Fragment","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAMA,IAAsCC,EAAK,CAASC,MAAA;AAClD,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,EACE,IAAAnB,GACE,EAAE,iBAAAoB,MAAoBC,KACtB;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,MACEC,EAAqB,GAEnBC,IAAsBC,EAAY,MAAM;AAC5C,IAAAP,EAAkBrB,GAAe,QAAW,EAAE,WAAAC,EAAW,CAAA;AAAA,EACxD,GAAA,CAACoB,GAA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AAA,YACN,UAAS;AAAA,YACT,gBAAe;AAAA,YACf,MAAK;AAAA,YACL,SAAS9B;AAAA,UAAA;AAAA,WAEb,EACF,CAAA;AAAA,QAGDa,KACC,gBAAAS,EAACS,GAAA,EACC,UAAA,gBAAAT,EAAC,OAAI,EAAA,KAAKU,EAAc,UAAU,KAAI,SAAA,CAAS,EACjD,CAAA;AAAA,QAGDpB,KAEG,gBAAAQ,EAAAa,GAAA,EAAA,UAAA;AAAA,UAAA,gBAAAX;AAAA,YAACY;AAAA,YAAA;AAAA,cACC,OAAOtB,EAAe;AAAA,cACtB,UAAUA,EAAe;AAAA,cACzB,UAAUA,EAAe;AAAA,cACzB,eAAeA,KAAA,gBAAAA,EAAgB;AAAA,cAC/B,WAAAN;AAAA,YAAA;AAAA,UACF;AAAA,UACA,gBAAAgB;AAAA,YAACa;AAAA,YAAA;AAAA,cACC,UAAUvB,EAAe;AAAA,cACzB,UAAApB;AAAA,cACA,QAAQoB,EAAe;AAAA,cACvB,mBAAAnB;AAAA,cACA,eAAAC;AAAA,cACA,wBAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,eAAAQ;AAAA,cACA,gBAAAN;AAAA,cACA,cAAAC;AAAA,cACA,kBAAAC;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC,GAEDiC,KAAejD;"}
1
+ {"version":3,"file":"chapter-details.js","sources":["../../../../src/features/chapters-v2/chapter-details/chapter-details.tsx"],"sourcesContent":["import type { IChapterDetails } from './chapter-details-types';\nimport type { FC } from 'react';\n\nimport { memo, useCallback, useEffect } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport { useJourney } from '../../journey/use-journey/use-journey';\nimport Button from '../../ui/buttons/button/button';\nimport IconButton from '../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../ui/layout/flex-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport Text from '../../ui/text/text';\nimport { useGetChapterDetails } from '../api/chapter';\nimport BlockSections from './block-sections/block-sections';\nimport ChapterBanner from './chapter-banner/chapter-banner';\nimport * as Styled from './chapter-details-styled';\n\nconst ChapterDetails: FC<IChapterDetails> = memo(props => {\n const {\n userChapterId,\n studentId,\n userType,\n onBlockSkipUnskip,\n onNodeAttempt,\n onNodeAssignAsHomework,\n onNodeMarkAsDone,\n onNodeReattempt,\n onNodeReview,\n onNodeView,\n onExit,\n onNodeUnassign,\n onNodeUnlock,\n onNodeSkipUnSkip,\n startChapterPageJourney,\n chapterPageRef,\n bannerRef,\n coreBlocksRef,\n canStartJourney,\n } = props;\n const { isJourneyActive } = useJourney();\n const {\n get: getChapterDetails,\n data: chapterDetails,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = useGetChapterDetails();\n\n const fetchChapterDetails = useCallback(() => {\n getChapterDetails(userChapterId, undefined, { studentId });\n }, [getChapterDetails, userChapterId, studentId]);\n\n useEffect(() => {\n fetchChapterDetails();\n }, [fetchChapterDetails]);\n\n useEffect(() => {\n if (chapterDetails && canStartJourney && !isJourneyActive && startChapterPageJourney) {\n startChapterPageJourney({\n chapterDetails: chapterDetails,\n userChapterId,\n studentId,\n userType,\n });\n }\n }, [\n canStartJourney,\n chapterDetails,\n isJourneyActive,\n startChapterPageJourney,\n studentId,\n userChapterId,\n userType,\n ]);\n\n useEffect(() => {\n if (!isProcessing && isStale) {\n fetchChapterDetails();\n }\n }, [fetchChapterDetails, isProcessing, isStale]);\n\n if (isProcessingFailed) {\n return (\n <FlexView $flexGapX={1.5} $height=\"100vh\" $justifyContent=\"center\" $alignItems=\"center\">\n <Text $renderAs=\"h6\">Oops! Something went wrong. Please try again later.</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapterDetails}\n />\n </FlexView>\n );\n }\n\n if (!chapterDetails && isProcessing) {\n return <AppLoader height=\"80vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n ref={chapterPageRef}\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n >\n {userType === 'TEACHER' && (\n <Styled.BackButtonContainer $height=\"100%\">\n <Styled.BackButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"secondary-gray\"\n analyticsLabel=\"chapter_page_exit\"\n size=\"xsmall\"\n onClick={onExit}\n />\n </Styled.BackButtonWrapper>\n </Styled.BackButtonContainer>\n )}\n\n {isProcessing && (\n <Styled.LoaderWrapper>\n <img src={ILLUSTRATIONS.LOADER_1} alt=\"loader\" />\n </Styled.LoaderWrapper>\n )}\n\n {chapterDetails && (\n <>\n <ChapterBanner\n title={chapterDetails.name}\n imageHue={chapterDetails.image_hue}\n imageUrl={chapterDetails.image_url}\n progressStats={chapterDetails?.progress_stat}\n bannerRef={bannerRef}\n />\n <BlockSections\n imageHue={chapterDetails.image_hue}\n userType={userType}\n blocks={chapterDetails.blocks}\n onBlockSkipUnskip={onBlockSkipUnskip}\n onNodeAttempt={onNodeAttempt}\n onNodeAssignAsHomework={onNodeAssignAsHomework}\n onNodeMarkAsDone={onNodeMarkAsDone}\n onNodeReattempt={onNodeReattempt}\n onNodeReview={onNodeReview}\n onNodeView={onNodeView}\n coreBlocksRef={coreBlocksRef}\n onNodeUnassign={onNodeUnassign}\n onNodeUnlock={onNodeUnlock}\n onNodeSkipUnSkip={onNodeSkipUnSkip}\n />\n </>\n )}\n </Styled.ContentWrapper>\n );\n});\n\nexport default ChapterDetails;\n"],"names":["ChapterDetails","memo","props","userChapterId","studentId","userType","onBlockSkipUnskip","onNodeAttempt","onNodeAssignAsHomework","onNodeMarkAsDone","onNodeReattempt","onNodeReview","onNodeView","onExit","onNodeUnassign","onNodeUnlock","onNodeSkipUnSkip","startChapterPageJourney","chapterPageRef","bannerRef","coreBlocksRef","canStartJourney","isJourneyActive","useJourney","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","Fragment","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAMA,IAAsCC,EAAK,CAASC,MAAA;AAClD,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,wBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,EACE,IAAAnB,GACE,EAAE,iBAAAoB,MAAoBC,KACtB;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,MACEC,EAAqB,GAEnBC,IAAsBC,EAAY,MAAM;AAC5C,IAAAP,EAAkBrB,GAAe,QAAW,EAAE,WAAAC,EAAW,CAAA;AAAA,EACxD,GAAA,CAACoB,GAAmBrB,GAAeC,CAAS,CAAC;AA+BhD,SA7BA4B,EAAU,MAAM;AACM,IAAAF;EAAA,GACnB,CAACA,CAAmB,CAAC,GAExBE,EAAU,MAAM;AACd,IAAIP,KAAkBJ,KAAmB,CAACC,KAAmBL,KACnCA,EAAA;AAAA,MACtB,gBAAAQ;AAAA,MACA,eAAAtB;AAAA,MACA,WAAAC;AAAA,M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AAQ,EAAAa,GAAA,EAAA,UAAA;AAAA,UAAA,gBAAAX;AAAA,YAACY;AAAA,YAAA;AAAA,cACC,OAAOtB,EAAe;AAAA,cACtB,UAAUA,EAAe;AAAA,cACzB,UAAUA,EAAe;AAAA,cACzB,eAAeA,KAAA,gBAAAA,EAAgB;AAAA,cAC/B,WAAAN;AAAA,YAAA;AAAA,UACF;AAAA,UACA,gBAAAgB;AAAA,YAACa;AAAA,YAAA;AAAA,cACC,UAAUvB,EAAe;AAAA,cACzB,UAAApB;AAAA,cACA,QAAQoB,EAAe;AAAA,cACvB,mBAAAnB;AAAA,cACA,eAAAC;AAAA,cACA,wBAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,eAAAQ;AAAA,cACA,gBAAAN;AAAA,cACA,cAAAC;AAAA,cACA,kBAAAC;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC,GAEDiC,KAAejD;"}
@@ -0,0 +1,10 @@
1
+ import { createGetAPI as t } from "@cuemath/rest-api";
2
+ import * as r from "../../../../../node_modules/query-string/base.js";
3
+ import { BASE_URL_V1 as a } from "../../../../../constants/api.js";
4
+ const { useGet: s } = t({
5
+ getURL: (i, e) => `${a}/available-username?${r.stringify(e)}`
6
+ });
7
+ export {
8
+ s as useUsernameAvailabilityGet
9
+ };
10
+ //# sourceMappingURL=use-username-availability-get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-username-availability-get.js","sources":["../../../../../../src/features/circle-games/sign-up/api/use-validate-username-api/use-username-availability-get.ts"],"sourcesContent":["import type {\n IUsernameAvailabilityData,\n IUsernameAvailabilityParam,\n} from './use-username-availability-get-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\nimport querystring from 'query-string';\n\nimport { BASE_URL_V1 } from '../../../../../constants/api';\n\nconst { useGet: useUsernameAvailabilityGet } = createGetAPI<\n IUsernameAvailabilityData,\n IUsernameAvailabilityParam\n>({\n getURL: (_, queryParams) =>\n `${BASE_URL_V1}/available-username?${querystring.stringify(queryParams)}`,\n});\n\nexport { useUsernameAvailabilityGet };\n"],"names":["useUsernameAvailabilityGet","createGetAPI","_","queryParams","BASE_URL_V1","querystring"],"mappings":";;;AAUA,MAAM,EAAE,QAAQA,EAA2B,IAAIC,EAG7C;AAAA,EACA,QAAQ,CAACC,GAAGC,MACV,GAAGC,CAAW,uBAAuBC,EAAY,UAAUF,CAAW,CAAC;AAC3E,CAAC;"}
@@ -1,12 +1,15 @@
1
- const e = 25, s = {
1
+ const e = 25, E = 3, s = {
2
2
  SOMETHING_WENT_WRONG: `Something went wrong,
3
3
  please try again later`,
4
- USERNAME_ALEADY_EXISTS: "This user_name is already taken",
4
+ USERNAME_ALREADY_EXISTS: "This username is already taken",
5
5
  USERNAME_NOT_ALLOWED: `This username is not allowed,
6
- please try something else`
6
+ please try something else`,
7
+ USERNAME_MIN_LENGTH: `Username must be at least
8
+ 3 characters long`
7
9
  };
8
10
  export {
9
11
  s as ErrorMessage,
10
- e as USERNAME_MAX_LENGTH
12
+ e as USERNAME_MAX_LENGTH,
13
+ E as USERNAME_MIN_LENGTH
11
14
  };
12
15
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/sign-up/comp/username-input/constants.ts"],"sourcesContent":["export const USERNAME_MAX_LENGTH = 25;\n\nexport const ErrorMessage = {\n SOMETHING_WENT_WRONG: 'Something went wrong,\\nplease try again later',\n USERNAME_ALEADY_EXISTS: 'This user_name is already taken',\n USERNAME_NOT_ALLOWED: 'This username is not allowed,\\nplease try something else',\n};\n"],"names":["USERNAME_MAX_LENGTH","ErrorMessage"],"mappings":"AAAO,MAAMA,IAAsB,IAEtBC,IAAe;AAAA,EAC1B,sBAAsB;AAAA;AAAA,EACtB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA;AACxB;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/sign-up/comp/username-input/constants.ts"],"sourcesContent":["export const USERNAME_MAX_LENGTH = 25;\nexport const USERNAME_MIN_LENGTH = 3;\n\nexport const ErrorMessage = {\n SOMETHING_WENT_WRONG: 'Something went wrong,\\nplease try again later',\n USERNAME_ALREADY_EXISTS: 'This username is already taken',\n USERNAME_NOT_ALLOWED: 'This username is not allowed,\\nplease try something else',\n USERNAME_MIN_LENGTH: `Username must be at least \\n${USERNAME_MIN_LENGTH} characters long`,\n};\n"],"names":["USERNAME_MAX_LENGTH","USERNAME_MIN_LENGTH","ErrorMessage"],"mappings":"AAAO,MAAMA,IAAsB,IACtBC,IAAsB,GAEtBC,IAAe;AAAA,EAC1B,sBAAsB;AAAA;AAAA,EACtB,yBAAyB;AAAA,EACzB,sBAAsB;AAAA;AAAA,EACtB,qBAAqB;AAAA;AACvB;"}
@@ -1,48 +1,58 @@
1
- import { jsx as E } from "react/jsx-runtime";
2
- import U from "../../../../../node_modules/lodash.debounce/index.js";
3
- import { useRef as h } from "react";
4
- import { getTheme as f } from "../../../../ui/theme/get-theme.js";
5
- import { useValidateUsernameDal as A } from "../../dal/validate-username-dal/validate-username-dal.js";
6
- import { ErrorCode as T } from "../../dal/validate-username-dal/validate-username-dal-types.js";
7
- import { InputWrapper as x } from "../input-wrapper/input-wrapper.js";
8
- import { USERNAME_MAX_LENGTH as t, ErrorMessage as n } from "./constants.js";
9
- import { Input as M } from "./username-input-styled.js";
10
- const V = ({
11
- circleUsername: _,
12
- username: s,
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { useCallback as l } from "react";
3
+ import { getTheme as g } from "../../../../ui/theme/get-theme.js";
4
+ import { useValidateUsernameDal as h } from "../../dal/validate-username-dal/validate-username-dal.js";
5
+ import { InputWrapper as M } from "../input-wrapper/input-wrapper.js";
6
+ import { USERNAME_MIN_LENGTH as T, ErrorMessage as r, USERNAME_MAX_LENGTH as n } from "./constants.js";
7
+ import { Input as U } from "./username-input-styled.js";
8
+ const D = ({
9
+ circleUsername: s,
10
+ username: m,
13
11
  error: i,
14
- isEdit: u,
15
- showSpinner: l,
12
+ isEdit: c,
13
+ showSpinner: p,
16
14
  setError: o,
17
- setUsername: a,
18
- setShowSpinner: m
15
+ setUsername: u,
16
+ setShowSpinner: a
19
17
  }) => {
20
- const c = `Only letters, _ , & digits allowed.
21
- Upto ${t} characters.`, d = (e) => {
22
- var p;
23
- let r = "";
24
- e ? e.isValid ? r = "" : (r = n.USERNAME_ALEADY_EXISTS, ((p = e.errorCode) == null ? void 0 : p.toString()) === T.USERNAME_NOT_ALLOWED && (r = n.USERNAME_NOT_ALLOWED)) : r = n.SOMETHING_WENT_WRONG, o(r);
25
- }, { validateUsernameExists: N } = A(d), R = h(
26
- U(async (e) => {
27
- let r = "";
28
- a(e), r || (u && _ === e ? r = "" : N(e)), o(r), m(!1);
29
- }, 400)
30
- ), g = (e) => {
31
- /^[a-z0-9_]*$/.test(e) && (o(""), !(e.length > t) && (m(!0), a(e), R.current(e)));
32
- };
33
- return /* @__PURE__ */ E(
34
- x,
18
+ const E = `Only letters, _ , & digits allowed.
19
+ Upto ${n} characters.`, R = l(
20
+ (e) => {
21
+ let t = "";
22
+ a(!1), e ? e.is_valid || (t = r.USERNAME_ALREADY_EXISTS) : t = r.SOMETHING_WENT_WRONG, o(t);
23
+ },
24
+ [o, a]
25
+ ), { validateUsernameExists: _ } = h(R), N = l(
26
+ (e) => {
27
+ if (o(""), u(e), !(c && s === e)) {
28
+ if (e.length < T) {
29
+ o(r.USERNAME_MIN_LENGTH);
30
+ return;
31
+ }
32
+ a(!0), _(e);
33
+ }
34
+ },
35
+ [s, c, o, a, u, _]
36
+ ), d = l(
37
+ (e) => {
38
+ const t = e.target.value;
39
+ !/^[a-z0-9_]*$/.test(t) || t.length > n || N(t);
40
+ },
41
+ [N]
42
+ );
43
+ return /* @__PURE__ */ f(
44
+ M,
35
45
  {
36
- showSpinner: l,
37
- helperText: s.length >= t ? c : i || c,
38
- children: /* @__PURE__ */ E(
39
- M,
46
+ showSpinner: p,
47
+ helperText: m.length >= n ? E : i || E,
48
+ children: /* @__PURE__ */ f(
49
+ U,
40
50
  {
41
- value: s,
42
- onChange: (e) => g(e.target.value),
51
+ value: m,
52
+ onChange: d,
43
53
  autoFocus: !0,
44
54
  placeholder: "loopy_circle",
45
- color: i ? f().colors.RED : l ? "" : f().colors.GREEN_4,
55
+ color: i ? g().colors.RED : p ? "" : g().colors.GREEN_4,
46
56
  autoCapitalize: "none"
47
57
  }
48
58
  )
@@ -50,6 +60,6 @@ Upto ${t} characters.`, d = (e) => {
50
60
  );
51
61
  };
52
62
  export {
53
- V as UsernameInput
63
+ D as UsernameInput
54
64
  };
55
65
  //# sourceMappingURL=username-input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"username-input.js","sources":["../../../../../../src/features/circle-games/sign-up/comp/username-input/username-input.tsx"],"sourcesContent":["import type { UsernameInputProps } from './username-input.types';\n\nimport debounce from 'lodash.debounce';\nimport { useRef } from 'react';\n\nimport { getTheme } from '../../../../ui/theme/get-theme';\nimport { useValidateUsernameDal } from '../../dal/validate-username-dal/validate-username-dal';\nimport {\n ErrorCode,\n type IValidateUsernameResponseDal,\n} from '../../dal/validate-username-dal/validate-username-dal-types';\nimport { InputWrapper } from '../input-wrapper/input-wrapper';\nimport { ErrorMessage, USERNAME_MAX_LENGTH } from './constants';\nimport * as S from './username-input-styled';\n\nexport const UsernameInput = ({\n circleUsername,\n username,\n error,\n isEdit,\n showSpinner,\n setError,\n setUsername,\n setShowSpinner,\n}: UsernameInputProps) => {\n const helperText = `Only letters, _ , & digits allowed.\\nUpto ${USERNAME_MAX_LENGTH} characters.`;\n\n const handleUsernameValidationResponse = (data: IValidateUsernameResponseDal | null) => {\n let err = '';\n\n if (data) {\n if (!data.isValid) {\n err = ErrorMessage.USERNAME_ALEADY_EXISTS;\n if (data.errorCode?.toString() === ErrorCode.USERNAME_NOT_ALLOWED) {\n err = ErrorMessage.USERNAME_NOT_ALLOWED;\n }\n } else {\n err = '';\n }\n } else {\n err = ErrorMessage.SOMETHING_WENT_WRONG;\n }\n\n setError(err);\n };\n\n const { validateUsernameExists } = useValidateUsernameDal(handleUsernameValidationResponse);\n\n const validateUserName = useRef(\n debounce(async (value: string) => {\n let err = '';\n\n setUsername(value);\n\n if (!err) {\n // by pass when new username is same as existing username in edit mode\n if (isEdit && circleUsername === value) {\n err = '';\n } else {\n validateUsernameExists(value);\n }\n }\n setError(err);\n setShowSpinner(false);\n }, 400),\n );\n\n const handleUsername = (value: string) => {\n const usernameRegex = /^[a-z0-9_]*$/; // only letters, numbers and underscore\n\n if (!usernameRegex.test(value)) {\n return;\n }\n setError('');\n\n if (value.length > USERNAME_MAX_LENGTH) {\n return;\n }\n setShowSpinner(true);\n setUsername(value);\n validateUserName.current(value);\n };\n\n return (\n <InputWrapper\n showSpinner={showSpinner}\n helperText={username.length >= USERNAME_MAX_LENGTH ? helperText : error || helperText}\n >\n <S.Input\n value={username}\n onChange={event => handleUsername(event.target.value)}\n autoFocus={true}\n placeholder={'loopy_circle'}\n color={error ? getTheme().colors.RED : showSpinner ? '' : getTheme().colors.GREEN_4}\n autoCapitalize=\"none\"\n />\n </InputWrapper>\n );\n};\n"],"names":["UsernameInput","circleUsername","username","error","isEdit","showSpinner","setError","setUsername","setShowSpinner","helperText","USERNAME_MAX_LENGTH","handleUsernameValidationResponse","data","err","ErrorMessage","_a","ErrorCode","validateUsernameExists","useValidateUsernameDal","validateUserName","useRef","debounce","value","handleUsername","jsx","InputWrapper","S.Input","event","getTheme"],"mappings":";;;;;;;;;AAeO,MAAMA,IAAgB,CAAC;AAAA,EAC5B,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AACF,MAA0B;AACxB,QAAMC,IAAa;AAAA,OAA6CC,CAAmB,gBAE7EC,IAAmC,CAACC,MAA8C;;AACtF,QAAIC,IAAM;AAEV,IAAID,IACGA,EAAK,UAMFC,IAAA,MALNA,IAAMC,EAAa,0BACfC,IAAAH,EAAK,cAAL,gBAAAG,EAAgB,gBAAeC,EAAU,yBAC3CH,IAAMC,EAAa,yBAMvBD,IAAMC,EAAa,sBAGrBR,EAASO,CAAG;AAAA,EAAA,GAGR,EAAE,wBAAAI,EAAA,IAA2BC,EAAuBP,CAAgC,GAEpFQ,IAAmBC;AAAA,IACvBC,EAAS,OAAOC,MAAkB;AAChC,UAAIT,IAAM;AAEV,MAAAN,EAAYe,CAAK,GAEZT,MAECT,KAAUH,MAAmBqB,IACzBT,IAAA,KAENI,EAAuBK,CAAK,IAGhChB,EAASO,CAAG,GACZL,EAAe,EAAK;AAAA,OACnB,GAAG;AAAA,EAAA,GAGFe,IAAiB,CAACD,MAAkB;AAGxC,IAFsB,eAEH,KAAKA,CAAK,MAG7BhB,EAAS,EAAE,GAEP,EAAAgB,EAAM,SAASZ,OAGnBF,EAAe,EAAI,GACnBD,EAAYe,CAAK,GACjBH,EAAiB,QAAQG,CAAK;AAAA,EAAA;AAI9B,SAAA,gBAAAE;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,aAAApB;AAAA,MACA,YAAYH,EAAS,UAAUQ,IAAsBD,IAAaN,KAASM;AAAA,MAE3E,UAAA,gBAAAe;AAAA,QAACE;AAAAA,QAAA;AAAA,UACC,OAAOxB;AAAA,UACP,UAAU,CAAAyB,MAASJ,EAAeI,EAAM,OAAO,KAAK;AAAA,UACpD,WAAW;AAAA,UACX,aAAa;AAAA,UACb,OAAOxB,IAAQyB,EAAW,EAAA,OAAO,MAAMvB,IAAc,KAAKuB,IAAW,OAAO;AAAA,UAC5E,gBAAe;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"username-input.js","sources":["../../../../../../src/features/circle-games/sign-up/comp/username-input/username-input.tsx"],"sourcesContent":["import type { IUsernameAvailabilityData } from '../../api/use-validate-username-api/use-username-availability-get-types';\nimport type { UsernameInputProps } from './username-input.types';\n\nimport { useCallback } from 'react';\n\nimport { getTheme } from '../../../../ui/theme/get-theme';\nimport { useValidateUsernameDal } from '../../dal/validate-username-dal/validate-username-dal';\nimport { InputWrapper } from '../input-wrapper/input-wrapper';\nimport { ErrorMessage, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH } from './constants';\nimport * as S from './username-input-styled';\n\nexport const UsernameInput = ({\n circleUsername,\n username,\n error,\n isEdit,\n showSpinner,\n setError,\n setUsername,\n setShowSpinner,\n}: UsernameInputProps) => {\n const helperText = `Only letters, _ , & digits allowed.\\nUpto ${USERNAME_MAX_LENGTH} characters.`;\n\n const handleUsernameValidationResponse = useCallback(\n (data?: IUsernameAvailabilityData) => {\n let err = '';\n\n setShowSpinner(false);\n\n if (data) {\n if (!data.is_valid) {\n err = ErrorMessage.USERNAME_ALREADY_EXISTS;\n }\n } else {\n err = ErrorMessage.SOMETHING_WENT_WRONG;\n }\n\n setError(err);\n },\n [setError, setShowSpinner],\n );\n\n const { validateUsernameExists } = useValidateUsernameDal(handleUsernameValidationResponse);\n\n const validateUserName = useCallback(\n (value: string) => {\n setError('');\n setUsername(value);\n if (isEdit && circleUsername === value) return;\n\n if (value.length < USERNAME_MIN_LENGTH) {\n setError(ErrorMessage.USERNAME_MIN_LENGTH);\n\n return;\n }\n setShowSpinner(true);\n validateUsernameExists(value);\n },\n [circleUsername, isEdit, setError, setShowSpinner, setUsername, validateUsernameExists],\n );\n\n const handleUsernameChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = event.target.value;\n const usernameRegex = /^[a-z0-9_]*$/; // only letters, numbers and underscore\n\n if (!usernameRegex.test(value) || value.length > USERNAME_MAX_LENGTH) {\n return;\n }\n validateUserName(value);\n },\n [validateUserName],\n );\n\n return (\n <InputWrapper\n showSpinner={showSpinner}\n helperText={username.length >= USERNAME_MAX_LENGTH ? helperText : error || helperText}\n >\n <S.Input\n value={username}\n onChange={handleUsernameChange}\n autoFocus={true}\n placeholder={'loopy_circle'}\n color={error ? getTheme().colors.RED : showSpinner ? '' : getTheme().colors.GREEN_4}\n autoCapitalize=\"none\"\n />\n </InputWrapper>\n );\n};\n"],"names":["UsernameInput","circleUsername","username","error","isEdit","showSpinner","setError","setUsername","setShowSpinner","helperText","USERNAME_MAX_LENGTH","handleUsernameValidationResponse","useCallback","data","err","ErrorMessage","validateUsernameExists","useValidateUsernameDal","validateUserName","value","USERNAME_MIN_LENGTH","handleUsernameChange","event","jsx","InputWrapper","S.Input","getTheme"],"mappings":";;;;;;;AAWO,MAAMA,IAAgB,CAAC;AAAA,EAC5B,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AACF,MAA0B;AACxB,QAAMC,IAAa;AAAA,OAA6CC,CAAmB,gBAE7EC,IAAmCC;AAAA,IACvC,CAACC,MAAqC;AACpC,UAAIC,IAAM;AAEV,MAAAN,EAAe,EAAK,GAEhBK,IACGA,EAAK,aACRC,IAAMC,EAAa,2BAGrBD,IAAMC,EAAa,sBAGrBT,EAASQ,CAAG;AAAA,IACd;AAAA,IACA,CAACR,GAAUE,CAAc;AAAA,EAAA,GAGrB,EAAE,wBAAAQ,EAAA,IAA2BC,EAAuBN,CAAgC,GAEpFO,IAAmBN;AAAA,IACvB,CAACO,MAAkB;AAGb,UAFJb,EAAS,EAAE,GACXC,EAAYY,CAAK,GACb,EAAAf,KAAUH,MAAmBkB,IAE7B;AAAA,YAAAA,EAAM,SAASC,GAAqB;AACtC,UAAAd,EAASS,EAAa,mBAAmB;AAEzC;AAAA,QACF;AACA,QAAAP,EAAe,EAAI,GACnBQ,EAAuBG,CAAK;AAAA;AAAA,IAC9B;AAAA,IACA,CAAClB,GAAgBG,GAAQE,GAAUE,GAAgBD,GAAaS,CAAsB;AAAA,EAAA,GAGlFK,IAAuBT;AAAA,IAC3B,CAACU,MAA+C;AACxC,YAAAH,IAAQG,EAAM,OAAO;AAG3B,MAAI,CAFkB,eAEH,KAAKH,CAAK,KAAKA,EAAM,SAAST,KAGjDQ,EAAiBC,CAAK;AAAA,IACxB;AAAA,IACA,CAACD,CAAgB;AAAA,EAAA;AAIjB,SAAA,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,aAAAnB;AAAA,MACA,YAAYH,EAAS,UAAUQ,IAAsBD,IAAaN,KAASM;AAAA,MAE3E,UAAA,gBAAAc;AAAA,QAACE;AAAAA,QAAA;AAAA,UACC,OAAOvB;AAAA,UACP,UAAUmB;AAAA,UACV,WAAW;AAAA,UACX,aAAa;AAAA,UACb,OAAOlB,IAAQuB,EAAW,EAAA,OAAO,MAAMrB,IAAc,KAAKqB,IAAW,OAAO;AAAA,UAC5E,gBAAe;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,30 +1,25 @@
1
- import { useState as m } from "react";
2
- import { useValidateUserName as n } from "../../api/use-validate-username-api/use-validate-user-api.js";
3
- const _ = (t) => {
4
- const [i, l] = m(null), {
5
- post: r,
6
- isProcessing: o,
7
- ...d
8
- } = n({
9
- onComplete(a, e) {
10
- let s = null;
11
- e && (s = {
12
- isValid: e.is_valid,
13
- errorCode: e.error_code,
14
- message: e.message
15
- }), t(s);
16
- }
17
- });
18
- return {
19
- validateUsernameExists: (a) => {
20
- l(null), r({ username: a, action: "validate_user_name_v2" });
21
- },
22
- isValid: i,
23
- isProcessing: o,
24
- ...d
1
+ import m from "../../../../../node_modules/lodash.debounce/index.js";
2
+ import { useMemo as n, useEffect as c } from "react";
3
+ import { useUsernameAvailabilityGet as l } from "../../api/use-validate-username-api/use-username-availability-get.js";
4
+ const U = (s) => {
5
+ const {
6
+ get: i,
7
+ data: e,
8
+ isProcessed: t,
9
+ isProcessingFailed: a
10
+ } = l(), r = n(
11
+ () => m((o) => {
12
+ i("", { username: o });
13
+ }, 400),
14
+ [i]
15
+ );
16
+ return c(() => {
17
+ (t && e || a) && s(e);
18
+ }, [e, t, a, s]), {
19
+ validateUsernameExists: r
25
20
  };
26
21
  };
27
22
  export {
28
- _ as useValidateUsernameDal
23
+ U as useValidateUsernameDal
29
24
  };
30
25
  //# sourceMappingURL=validate-username-dal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-username-dal.js","sources":["../../../../../../src/features/circle-games/sign-up/dal/validate-username-dal/validate-username-dal.ts"],"sourcesContent":["import type { ErrorCode, IValidateUsernameResponseDal } from './validate-username-dal-types';\n\nimport { useState } from 'react';\n\nimport { useValidateUserName } from '../../api/use-validate-username-api/use-validate-user-api';\n\nexport const useValidateUsernameDal = (\n onCompleted: (data: IValidateUsernameResponseDal | null) => void,\n) => {\n const [isValid, setIsValid] = useState<boolean | null>(null);\n\n const {\n post: validateUsername,\n isProcessing,\n ...rest\n } = useValidateUserName({\n onComplete(_, response) {\n let data: IValidateUsernameResponseDal | null = null;\n\n if (response) {\n data = {\n isValid: response.is_valid,\n errorCode: response.error_code as ErrorCode,\n message: response.message,\n };\n }\n\n onCompleted(data);\n },\n });\n\n const validateUsernameExists = (username: string) => {\n setIsValid(null);\n validateUsername({ username: username, action: 'validate_user_name_v2' });\n };\n\n return {\n validateUsernameExists,\n isValid,\n isProcessing,\n ...rest,\n };\n};\n"],"names":["useValidateUsernameDal","onCompleted","isValid","setIsValid","useState","validateUsername","isProcessing","rest","useValidateUserName","_","response","data","username"],"mappings":";;AAMa,MAAAA,IAAyB,CACpCC,MACG;AACH,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAyB,IAAI,GAErD;AAAA,IACJ,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,GAAGC;AAAA,MACDC,EAAoB;AAAA,IACtB,WAAWC,GAAGC,GAAU;AACtB,UAAIC,IAA4C;AAEhD,MAAID,MACKC,IAAA;AAAA,QACL,SAASD,EAAS;AAAA,QAClB,WAAWA,EAAS;AAAA,QACpB,SAASA,EAAS;AAAA,MAAA,IAItBT,EAAYU,CAAI;AAAA,IAClB;AAAA,EAAA,CACD;AAOM,SAAA;AAAA,IACL,wBAN6B,CAACC,MAAqB;AACnD,MAAAT,EAAW,IAAI,GACfE,EAAiB,EAAE,UAAAO,GAAoB,QAAQ,wBAAyB,CAAA;AAAA,IAAA;AAAA,IAKxE,SAAAV;AAAA,IACA,cAAAI;AAAA,IACA,GAAGC;AAAA,EAAA;AAEP;"}
1
+ {"version":3,"file":"validate-username-dal.js","sources":["../../../../../../src/features/circle-games/sign-up/dal/validate-username-dal/validate-username-dal.ts"],"sourcesContent":["import type { IUsernameAvailabilityData } from '../../api/use-validate-username-api/use-username-availability-get-types';\n\nimport debounce from 'lodash.debounce';\nimport { useEffect, useMemo } from 'react';\n\nimport { useUsernameAvailabilityGet } from '../../api/use-validate-username-api/use-username-availability-get';\n\nexport const useValidateUsernameDal = (onCompleted: (data?: IUsernameAvailabilityData) => void) => {\n const {\n get: getUsernameAvailability,\n data,\n isProcessed,\n isProcessingFailed,\n } = useUsernameAvailabilityGet();\n\n const validateUsernameExists = useMemo(\n () =>\n debounce((username: string) => {\n getUsernameAvailability('', { username });\n }, 400),\n [getUsernameAvailability],\n );\n\n useEffect(() => {\n if ((isProcessed && data) || isProcessingFailed) {\n onCompleted(data);\n }\n }, [data, isProcessed, isProcessingFailed, onCompleted]);\n\n return {\n validateUsernameExists,\n };\n};\n"],"names":["useValidateUsernameDal","onCompleted","getUsernameAvailability","data","isProcessed","isProcessingFailed","useUsernameAvailabilityGet","validateUsernameExists","useMemo","debounce","username","useEffect"],"mappings":";;;AAOa,MAAAA,IAAyB,CAACC,MAA4D;AAC3F,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAAC;AAAA,IACA,aAAAC;AAAA,IACA,oBAAAC;AAAA,MACEC,EAA2B,GAEzBC,IAAyBC;AAAA,IAC7B,MACEC,EAAS,CAACC,MAAqB;AACL,MAAAR,EAAA,IAAI,EAAE,UAAAQ,EAAA,CAAU;AAAA,OACvC,GAAG;AAAA,IACR,CAACR,CAAuB;AAAA,EAAA;AAG1B,SAAAS,EAAU,MAAM;AACT,KAAAP,KAAeD,KAASE,MAC3BJ,EAAYE,CAAI;AAAA,KAEjB,CAACA,GAAMC,GAAaC,GAAoBJ,CAAW,CAAC,GAEhD;AAAA,IACL,wBAAAM;AAAA,EAAA;AAEJ;"}
@@ -1,32 +1,32 @@
1
- import { jsx as t, jsxs as N, Fragment as O } from "react/jsx-runtime";
2
- import w from "../../../../node_modules/lodash.throttle/index.js";
3
- import { useRef as g, useCallback as l, useMemo as F, useEffect as h } from "react";
4
- import j from "../../../chapters-v2/chapter-details/chapter-details.js";
5
- import { useGetChapterData as G } from "../../../chapters/api/chapter.js";
1
+ import { jsx as t, jsxs as A, Fragment as w } from "react/jsx-runtime";
2
+ import B from "../../../../node_modules/lodash.throttle/index.js";
3
+ import { useRef as g, useCallback as s, useMemo as F, useEffect as h } from "react";
4
+ import { useGetChapterData as j } from "../../../chapters/api/chapter.js";
5
+ import G from "../../../chapters/chapter/chapter.js";
6
6
  import H from "../../../milestone/milestone-list-container/milestone-list-container.js";
7
7
  import M from "../../../ui/buttons/button/button.js";
8
- import X from "../../../ui/layout/flex-view.js";
9
- import B from "../../../ui/loader/app-loader/app-loader.js";
8
+ import W from "../../../ui/layout/flex-view.js";
9
+ import X from "../../../ui/loader/app-loader/app-loader.js";
10
10
  import U from "../../../ui/text/text.js";
11
- import { useTrialSessionContext as W } from "../../context/use-trial-session-context.js";
12
- import { Container as q, Wrapper as z, ChapterWrapper as V } from "./learning-plan-styled.js";
13
- import { useLearningPlanScrollSync as J } from "./use-learning-plan-scroll-sync.js";
14
- const ae = () => {
15
- const { trialHomeData: L, studentId: n, formData: y, isTeacher: r, updateSlideConfig: i } = W(), {
16
- demo_info: { student_classroom_id: T, stream: I }
17
- } = L || {}, { name: D = "", chapterId: c } = y || {}, o = g(null), a = g([]), u = g(!1), {
18
- publishScrollEvents: d,
19
- closeChannel: E,
20
- scrollPoints: s
21
- } = J(T), {
22
- get: P,
11
+ import { useTrialSessionContext as q } from "../../context/use-trial-session-context.js";
12
+ import { Container as z, Wrapper as V, BackIconWrapper as J, BackIcon as K, ChapterWrapper as Q } from "./learning-plan-styled.js";
13
+ import { useLearningPlanScrollSync as Y } from "./use-learning-plan-scroll-sync.js";
14
+ const he = () => {
15
+ const { trialHomeData: L, studentId: l, teacherId: y, formData: $, isTeacher: r, updateSlideConfig: c } = q(), {
16
+ demo_info: { student_classroom_id: T, stream: b }
17
+ } = L || {}, { name: R = "", chapterId: i } = $ || {}, o = g(null), a = g([]), d = g(!1), {
18
+ publishScrollEvents: u,
19
+ closeChannel: P,
20
+ scrollPoints: n
21
+ } = Y(T), {
22
+ get: v,
23
23
  data: m,
24
- isProcessing: R,
25
- isProcessingFailed: $,
24
+ isProcessing: E,
25
+ isProcessingFailed: D,
26
26
  error: f
27
- } = G(), C = l(() => {
28
- c && n && P(c, void 0, {
29
- studentId: n
27
+ } = j(), C = s(() => {
28
+ i && l && v(i, void 0, {
29
+ studentId: l
30
30
  }).then(() => {
31
31
  const e = o.current;
32
32
  e == null || e.scrollTo({
@@ -34,29 +34,29 @@ const ae = () => {
34
34
  behavior: "smooth"
35
35
  });
36
36
  });
37
- }, [P, n, c]), b = l(
37
+ }, [v, l, i]), _ = s(
38
38
  (e) => {
39
- i({
39
+ c({
40
40
  chapterId: e.id
41
41
  });
42
42
  },
43
- [i]
44
- ), x = l(() => {
45
- i({
43
+ [c]
44
+ ), x = s(() => {
45
+ c({
46
46
  chapterId: void 0
47
47
  });
48
- }, [i]), v = l(() => {
49
- a.current.length === 0 || u.current || (u.current = !0, d && d({
48
+ }, [c]), I = s(() => {
49
+ a.current.length === 0 || d.current || (d.current = !0, u && u({
50
50
  eventName: "TRIAL_SESSION_GOAL_PLAN_SCROLL",
51
51
  eventPayload: {
52
52
  scrollPoints: a.current
53
53
  }
54
- }), a.current = [], u.current = !1);
55
- }, [d]), A = F(() => w(v, 500), [v]), S = l(() => {
54
+ }), a.current = [], d.current = !1);
55
+ }, [u]), k = F(() => B(I, 500), [I]), S = s(() => {
56
56
  var p;
57
57
  const e = ((p = o.current) == null ? void 0 : p.scrollTop) || 0;
58
- a.current.push(e), A();
59
- }, [A]);
58
+ a.current.push(e), k();
59
+ }, [k]);
60
60
  return h(() => {
61
61
  C();
62
62
  }, [C]), h(() => {
@@ -68,18 +68,18 @@ const ae = () => {
68
68
  }
69
69
  }, [r, m, S]), h(() => {
70
70
  const e = o.current;
71
- if (s && Array.isArray(s) && !r && e) {
71
+ if (n && Array.isArray(n) && !r && e) {
72
72
  const p = Math.floor(
73
- s.reduce((k, _) => k + _, 0) / s.length
73
+ n.reduce((N, O) => N + O, 0) / n.length
74
74
  );
75
75
  e.scrollTo({
76
76
  top: p,
77
77
  behavior: "smooth"
78
78
  });
79
79
  }
80
- }, [s, r]), h(() => () => {
81
- E();
82
- }, [E]), R ? /* @__PURE__ */ t(B, { height: "100%" }) : $ ? /* @__PURE__ */ N(X, { $height: "100%", $flexGapX: 1.5, $alignItems: "center", $justifyContent: "center", children: [
80
+ }, [n, r]), h(() => () => {
81
+ P();
82
+ }, [P]), E ? /* @__PURE__ */ t(X, { height: "100%" }) : D ? /* @__PURE__ */ A(W, { $height: "100%", $flexGapX: 1.5, $alignItems: "center", $justifyContent: "center", children: [
83
83
  /* @__PURE__ */ t(U, { $renderAs: "h6", children: (f == null ? void 0 : f.message) || "Oops! Something went wrong." }),
84
84
  /* @__PURE__ */ t(
85
85
  M,
@@ -92,37 +92,40 @@ const ae = () => {
92
92
  onClick: C
93
93
  }
94
94
  )
95
- ] }) : /* @__PURE__ */ t(q, { ref: o, $isScrollable: r, children: /* @__PURE__ */ t(
96
- z,
95
+ ] }) : /* @__PURE__ */ t(z, { ref: o, $isScrollable: r, children: /* @__PURE__ */ t(
96
+ V,
97
97
  {
98
98
  $clickable: r,
99
99
  $gutterX: 2,
100
100
  $isScrollable: r,
101
101
  id: "milestone-list-element-container",
102
- children: c && m ? /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(V, { children: /* @__PURE__ */ t(
103
- j,
104
- {
105
- userChapterId: m.id,
106
- studentId: n,
107
- userType: r ? "TEACHER" : "STUDENT",
108
- onExit: x
109
- }
110
- ) }) }) : /* @__PURE__ */ t(
102
+ children: i && m ? /* @__PURE__ */ A(w, { children: [
103
+ /* @__PURE__ */ t(J, { children: /* @__PURE__ */ t(K, { $clickable: r, onClick: x }) }),
104
+ /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(
105
+ G,
106
+ {
107
+ user_type: r ? "TEACHER" : "STUDENT",
108
+ teacherId: y,
109
+ ...m,
110
+ loading: E
111
+ }
112
+ ) })
113
+ ] }) : /* @__PURE__ */ t(
111
114
  H,
112
115
  {
113
116
  userType: r ? "TEACHER" : "STUDENT",
114
- studentName: D,
115
- studentId: n,
117
+ studentName: R,
118
+ studentId: l,
116
119
  studentClassroomId: T,
117
120
  milestoneType: "DRAFT",
118
- onChapterClick: b,
119
- courseStream: I
121
+ onChapterClick: _,
122
+ courseStream: b
120
123
  }
121
124
  )
122
125
  }
123
126
  ) });
124
127
  };
125
128
  export {
126
- ae as default
129
+ he as default
127
130
  };
128
131
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/features/trial-session/comps/learning-plan/index.tsx"],"sourcesContent":["import type { IChapterDataProps } from '../../../chapters/chapter/chapter-types';\n\nimport throttle from 'lodash.throttle';\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport ChapterDetails from '../../../chapters-v2/chapter-details/chapter-details';\nimport { useGetChapterData } from '../../../chapters/api/chapter';\nimport MilestoneList from '../../../milestone/milestone-list-container/milestone-list-container';\nimport Button from '../../../ui/buttons/button/button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport * as Styled from './learning-plan-styled';\nimport { useLearningPlanScrollSync } from './use-learning-plan-scroll-sync';\n\nconst LearningPlan: React.FC = () => {\n const { trialHomeData, studentId, formData, isTeacher, updateSlideConfig } =\n useTrialSessionContext();\n const {\n demo_info: { student_classroom_id: studentClassroomId, stream },\n } = trialHomeData || {};\n const { name = '', chapterId } = formData || {};\n\n const containerRef = useRef<HTMLDivElement>(null);\n const scrollPointsRef = useRef<number[]>([]);\n const isSendingScrollPointsRef = useRef(false);\n\n const {\n publishScrollEvents,\n closeChannel,\n scrollPoints: receivedScrollPoints,\n } = useLearningPlanScrollSync(studentClassroomId);\n\n const {\n get: getChapterData,\n data: chapterData,\n isProcessing,\n isProcessingFailed,\n error,\n } = useGetChapterData();\n\n const fetchChapter = useCallback(() => {\n if (chapterId && studentId) {\n getChapterData(chapterId, undefined, {\n studentId,\n }).then(() => {\n const scrollElement = containerRef.current;\n\n scrollElement?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n });\n }\n }, [getChapterData, studentId, chapterId]);\n\n const handleOnChapterClick = useCallback(\n (chapter: IChapterDataProps) => {\n updateSlideConfig({\n chapterId: chapter.id,\n });\n },\n [updateSlideConfig],\n );\n\n const handleOnBackIconClick = useCallback(() => {\n updateSlideConfig({\n chapterId: undefined,\n });\n }, [updateSlideConfig]);\n\n const sendScrollPoints = useCallback(() => {\n if (scrollPointsRef.current.length === 0 || isSendingScrollPointsRef.current) return;\n\n isSendingScrollPointsRef.current = true;\n\n if (publishScrollEvents) {\n publishScrollEvents({\n eventName: 'TRIAL_SESSION_GOAL_PLAN_SCROLL',\n eventPayload: {\n scrollPoints: scrollPointsRef.current,\n },\n });\n }\n\n scrollPointsRef.current = [];\n isSendingScrollPointsRef.current = false;\n }, [publishScrollEvents]);\n\n const throttleSend = useMemo(() => throttle(sendScrollPoints, 500), [sendScrollPoints]);\n\n const handleScroll = useCallback(() => {\n const scrollPoint = containerRef.current?.scrollTop || 0;\n\n scrollPointsRef.current.push(scrollPoint);\n\n throttleSend();\n }, [throttleSend]);\n\n useEffect(() => {\n fetchChapter();\n }, [fetchChapter]);\n\n useEffect(() => {\n if (containerRef.current) {\n if ((chapterData && isTeacher) || isTeacher) {\n const scrollElement = containerRef.current;\n\n scrollElement.addEventListener('scroll', handleScroll);\n\n return () => {\n if (scrollElement) {\n scrollElement.removeEventListener('scroll', handleScroll);\n }\n };\n }\n }\n }, [isTeacher, chapterData, handleScroll]);\n\n useEffect(() => {\n const scrollElement = containerRef.current;\n\n if (\n receivedScrollPoints &&\n Array.isArray(receivedScrollPoints) &&\n !isTeacher &&\n scrollElement\n ) {\n const averageScroll = Math.floor(\n receivedScrollPoints.reduce((a, b) => a + b, 0) / receivedScrollPoints.length,\n );\n\n scrollElement.scrollTo({\n top: averageScroll,\n behavior: 'smooth',\n });\n }\n }, [receivedScrollPoints, isTeacher]);\n\n useEffect(() => {\n return () => {\n closeChannel();\n };\n }, [closeChannel]);\n\n if (isProcessing) {\n return <AppLoader height=\"100%\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $height=\"100%\" $flexGapX={1.5} $alignItems=\"center\" $justifyContent=\"center\">\n <Text $renderAs=\"h6\">{error?.message || 'Oops! Something went wrong.'}</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapter}\n />\n </FlexView>\n );\n }\n\n return (\n <Styled.Container ref={containerRef} $isScrollable={isTeacher}>\n <Styled.Wrapper\n $clickable={isTeacher}\n $gutterX={2}\n $isScrollable={isTeacher}\n id=\"milestone-list-element-container\"\n >\n {chapterId && chapterData ? (\n <>\n <Styled.ChapterWrapper>\n <ChapterDetails\n userChapterId={chapterData.id}\n studentId={studentId}\n userType={isTeacher ? 'TEACHER' : 'STUDENT'}\n onExit={handleOnBackIconClick}\n />\n </Styled.ChapterWrapper>\n </>\n ) : (\n <MilestoneList\n userType={isTeacher ? 'TEACHER' : 'STUDENT'}\n studentName={name}\n studentId={studentId}\n studentClassroomId={studentClassroomId}\n milestoneType=\"DRAFT\"\n onChapterClick={handleOnChapterClick}\n courseStream={stream}\n />\n )}\n </Styled.Wrapper>\n </Styled.Container>\n );\n};\n\nexport default LearningPlan;\n"],"names":["LearningPlan","trialHomeData","studentId","formData","isTeacher","updateSlideConfig","useTrialSessionContext","studentClassroomId","stream","name","chapterId","containerRef","useRef","scrollPointsRef","isSendingScrollPointsRef","publishScrollEvents","closeChannel","receivedScrollPoints","useLearningPlanScrollSync","getChapterData","chapterData","isProcessing","isProcessingFailed","error","useGetChapterData","fetchChapter","useCallback","scrollElement","handleOnChapterClick","chapter","handleOnBackIconClick","sendScrollPoints","throttleSend","useMemo","throttle","handleScroll","scrollPoint","_a","useEffect","averageScroll","a","b","jsx","AppLoader","jsxs","FlexView","Text","Button","Styled.Container","Styled.Wrapper","Fragment","Styled.ChapterWrapper","ChapterDetails","MilestoneList"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,KAAyB,MAAM;AACnC,QAAM,EAAE,eAAAC,GAAe,WAAAC,GAAW,UAAAC,GAAU,WAAAC,GAAW,mBAAAC,EAAA,IACrDC,KACI;AAAA,IACJ,WAAW,EAAE,sBAAsBC,GAAoB,QAAAC,EAAO;AAAA,EAAA,IAC5DP,KAAiB,CAAA,GACf,EAAE,MAAAQ,IAAO,IAAI,WAAAC,EAAU,IAAIP,KAAY,CAAA,GAEvCQ,IAAeC,EAAuB,IAAI,GAC1CC,IAAkBD,EAAiB,CAAA,CAAE,GACrCE,IAA2BF,EAAO,EAAK,GAEvC;AAAA,IACJ,qBAAAG;AAAA,IACA,cAAAC;AAAA,IACA,cAAcC;AAAA,EAAA,IACZC,EAA0BX,CAAkB,GAE1C;AAAA,IACJ,KAAKY;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,OAAAC;AAAA,MACEC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IAAA;AAAA,MACC,YAAY7C;AAAA,MACZ,UAAU;AAAA,MACV,eAAeA;AAAA,MACf,IAAG;AAAA,MAEF,eAAagB,IACZ,gBAAAsB,EAAAQ,GAAA,EACE,UAAC,gBAAAR,EAAAS,GAAA,EACC,UAAA,gBAAAT;AAAA,QAACU;AAAA,QAAA;AAAA,UACC,eAAehC,EAAY;AAAA,UAC3B,WAAAlB;AAAA,UACA,UAAUE,IAAY,YAAY;AAAA,UAClC,QAAQ0B;AAAA,QAAA;AAAA,MAAA,EAEZ,CAAA,EACF,CAAA,IAEA,gBAAAY;AAAA,QAACW;AAAAA,QAAA;AAAA,UACC,UAAUjD,IAAY,YAAY;AAAA,UAClC,aAAaK;AAAA,UACb,WAAAP;AAAA,UACA,oBAAAK;AAAA,UACA,eAAc;AAAA,UACd,gBAAgBqB;AAAA,UAChB,cAAcpB;AAAA,QAAA;AAAA,MAChB;AAAA,IAAA;AAAA,EAGN,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/features/trial-session/comps/learning-plan/index.tsx"],"sourcesContent":["import type { IChapterDataProps } from '../../../chapters/chapter/chapter-types';\n\nimport throttle from 'lodash.throttle';\nimport React, { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { useGetChapterData } from '../../../chapters/api/chapter';\nimport Chapter from '../../../chapters/chapter/chapter';\nimport MilestoneList from '../../../milestone/milestone-list-container/milestone-list-container';\nimport Button from '../../../ui/buttons/button/button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Text from '../../../ui/text/text';\nimport { useTrialSessionContext } from '../../context/use-trial-session-context';\nimport * as Styled from './learning-plan-styled';\nimport { useLearningPlanScrollSync } from './use-learning-plan-scroll-sync';\n\nconst LearningPlan: React.FC = () => {\n const { trialHomeData, studentId, teacherId, formData, isTeacher, updateSlideConfig } =\n useTrialSessionContext();\n const {\n demo_info: { student_classroom_id: studentClassroomId, stream },\n } = trialHomeData || {};\n const { name = '', chapterId } = formData || {};\n\n const containerRef = useRef<HTMLDivElement>(null);\n const scrollPointsRef = useRef<number[]>([]);\n const isSendingScrollPointsRef = useRef(false);\n\n const {\n publishScrollEvents,\n closeChannel,\n scrollPoints: receivedScrollPoints,\n } = useLearningPlanScrollSync(studentClassroomId);\n\n const {\n get: getChapterData,\n data: chapterData,\n isProcessing,\n isProcessingFailed,\n error,\n } = useGetChapterData();\n\n const fetchChapter = useCallback(() => {\n if (chapterId && studentId) {\n getChapterData(chapterId, undefined, {\n studentId,\n }).then(() => {\n const scrollElement = containerRef.current;\n\n scrollElement?.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n });\n }\n }, [getChapterData, studentId, chapterId]);\n\n const handleOnChapterClick = useCallback(\n (chapter: IChapterDataProps) => {\n updateSlideConfig({\n chapterId: chapter.id,\n });\n },\n [updateSlideConfig],\n );\n\n const handleOnBackIconClick = useCallback(() => {\n updateSlideConfig({\n chapterId: undefined,\n });\n }, [updateSlideConfig]);\n\n const sendScrollPoints = useCallback(() => {\n if (scrollPointsRef.current.length === 0 || isSendingScrollPointsRef.current) return;\n\n isSendingScrollPointsRef.current = true;\n\n if (publishScrollEvents) {\n publishScrollEvents({\n eventName: 'TRIAL_SESSION_GOAL_PLAN_SCROLL',\n eventPayload: {\n scrollPoints: scrollPointsRef.current,\n },\n });\n }\n\n scrollPointsRef.current = [];\n isSendingScrollPointsRef.current = false;\n }, [publishScrollEvents]);\n\n const throttleSend = useMemo(() => throttle(sendScrollPoints, 500), [sendScrollPoints]);\n\n const handleScroll = useCallback(() => {\n const scrollPoint = containerRef.current?.scrollTop || 0;\n\n scrollPointsRef.current.push(scrollPoint);\n\n throttleSend();\n }, [throttleSend]);\n\n useEffect(() => {\n fetchChapter();\n }, [fetchChapter]);\n\n useEffect(() => {\n if (containerRef.current) {\n if ((chapterData && isTeacher) || isTeacher) {\n const scrollElement = containerRef.current;\n\n scrollElement.addEventListener('scroll', handleScroll);\n\n return () => {\n if (scrollElement) {\n scrollElement.removeEventListener('scroll', handleScroll);\n }\n };\n }\n }\n }, [isTeacher, chapterData, handleScroll]);\n\n useEffect(() => {\n const scrollElement = containerRef.current;\n\n if (\n receivedScrollPoints &&\n Array.isArray(receivedScrollPoints) &&\n !isTeacher &&\n scrollElement\n ) {\n const averageScroll = Math.floor(\n receivedScrollPoints.reduce((a, b) => a + b, 0) / receivedScrollPoints.length,\n );\n\n scrollElement.scrollTo({\n top: averageScroll,\n behavior: 'smooth',\n });\n }\n }, [receivedScrollPoints, isTeacher]);\n\n useEffect(() => {\n return () => {\n closeChannel();\n };\n }, [closeChannel]);\n\n if (isProcessing) {\n return <AppLoader height=\"100%\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $height=\"100%\" $flexGapX={1.5} $alignItems=\"center\" $justifyContent=\"center\">\n <Text $renderAs=\"h6\">{error?.message || 'Oops! Something went wrong.'}</Text>\n <Button\n widthX={14}\n size=\"small\"\n shape=\"square\"\n renderAs=\"primary\"\n label=\"Try again\"\n onClick={fetchChapter}\n />\n </FlexView>\n );\n }\n\n return (\n <Styled.Container ref={containerRef} $isScrollable={isTeacher}>\n <Styled.Wrapper\n $clickable={isTeacher}\n $gutterX={2}\n $isScrollable={isTeacher}\n id=\"milestone-list-element-container\"\n >\n {chapterId && chapterData ? (\n <>\n <Styled.BackIconWrapper>\n <Styled.BackIcon $clickable={isTeacher} onClick={handleOnBackIconClick} />\n </Styled.BackIconWrapper>\n\n <Styled.ChapterWrapper>\n <Chapter\n user_type={isTeacher ? 'TEACHER' : 'STUDENT'}\n teacherId={teacherId}\n {...chapterData}\n loading={isProcessing}\n />\n </Styled.ChapterWrapper>\n </>\n ) : (\n <MilestoneList\n userType={isTeacher ? 'TEACHER' : 'STUDENT'}\n studentName={name}\n studentId={studentId}\n studentClassroomId={studentClassroomId}\n milestoneType=\"DRAFT\"\n onChapterClick={handleOnChapterClick}\n courseStream={stream}\n />\n )}\n </Styled.Wrapper>\n </Styled.Container>\n );\n};\n\nexport default LearningPlan;\n"],"names":["LearningPlan","trialHomeData","studentId","teacherId","formData","isTeacher","updateSlideConfig","useTrialSessionContext","studentClassroomId","stream","name","chapterId","containerRef","useRef","scrollPointsRef","isSendingScrollPointsRef","publishScrollEvents","closeChannel","receivedScrollPoints","useLearningPlanScrollSync","getChapterData","chapterData","isProcessing","isProcessingFailed","error","useGetChapterData","fetchChapter","useCallback","scrollElement","handleOnChapterClick","chapter","handleOnBackIconClick","sendScrollPoints","throttleSend","useMemo","throttle","handleScroll","scrollPoint","_a","useEffect","averageScroll","a","b","jsx","AppLoader","jsxs","FlexView","Text","Button","Styled.Container","Styled.Wrapper","Fragment","Styled.BackIconWrapper","Styled.BackIcon","Styled.ChapterWrapper","Chapter","MilestoneList"],"mappings":";;;;;;;;;;;;;AAgBA,MAAMA,KAAyB,MAAM;AAC7B,QAAA,EAAE,eAAAC,GAAe,WAAAC,GAAW,WAAAC,GAAW,UAAAC,GAAU,WAAAC,GAAW,mBAAAC,MAChEC,KACI;AAAA,IACJ,WAAW,EAAE,sBAAsBC,GAAoB,QAAAC,EAAO;AAAA,EAAA,IAC5DR,KAAiB,CAAA,GACf,EAAE,MAAAS,IAAO,IAAI,WAAAC,EAAU,IAAIP,KAAY,CAAA,GAEvCQ,IAAeC,EAAuB,IAAI,GAC1CC,IAAkBD,EAAiB,CAAA,CAAE,GACrCE,IAA2BF,EAAO,EAAK,GAEvC;AAAA,IACJ,qBAAAG;AAAA,IACA,cAAAC;AAAA,IACA,cAAcC;AAAA,EAAA,IACZC,EAA0BX,CAAkB,GAE1C;AAAA,IACJ,KAAKY;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,OAAAC;AAAA,MACEC,EAAkB,GAEhBC,IAAeC,EAAY,MAAM;AACrC,IAAIhB,KAAaT,KACfkB,EAAeT,GAAW,QAAW;AAAA,MACnC,WAAAT;AAAA,IAAA,CACD,EAAE,KAAK,MAAM;AACZ,Y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AAA,QAAC,gBAAAR,EAAAS,GAAA,EACC,UAAC,gBAAAT,EAAAU,GAAA,EAAgB,YAAYhD,GAAW,SAAS0B,EAAA,CAAuB,EAC1E,CAAA;AAAA,QAEA,gBAAAY,EAACW,GAAA,EACC,UAAA,gBAAAX;AAAA,UAACY;AAAA,UAAA;AAAA,YACC,WAAWlD,IAAY,YAAY;AAAA,YACnC,WAAAF;AAAA,YACC,GAAGkB;AAAA,YACJ,SAASC;AAAA,UAAA;AAAA,QAAA,GAEb;AAAA,MAAA,EAAA,CACF,IAEA,gBAAAqB;AAAA,QAACa;AAAAA,QAAA;AAAA,UACC,UAAUnD,IAAY,YAAY;AAAA,UAClC,aAAaK;AAAA,UACb,WAAAR;AAAA,UACA,oBAAAM;AAAA,UACA,eAAc;AAAA,UACd,gBAAgBqB;AAAA,UAChB,cAAcpB;AAAA,QAAA;AAAA,MAChB;AAAA,IAAA;AAAA,EAGN,EAAA,CAAA;AAEJ;"}
@@ -1,48 +1,56 @@
1
- import t from "styled-components";
1
+ import o from "styled-components";
2
2
  import p from "../../../../assets/line-icons/icons/back2.js";
3
- import r from "../../../ui/layout/flex-view.js";
4
- const l = t.div(({ $isScrollable: o }) => `
3
+ import n from "../../../ui/layout/flex-view.js";
4
+ const c = o.div(({ $isScrollable: t }) => `
5
5
  overflow-y: auto;
6
- pointer-events: ${o ? "auto" : "none"};
7
- `), u = t(r)(({ $clickable: o, $isScrollable: e }) => `
6
+ pointer-events: ${t ? "auto" : "none"};
7
+ `), l = o(n)(({ $clickable: t, $isScrollable: e }) => `
8
8
  & > * {
9
9
  pointer-events: ${e ? "auto" : "none"};
10
10
  }
11
11
 
12
12
  cursor: not-allowed;
13
13
 
14
- ${o && `
14
+ ${t && `
15
15
  & .goal-widget-chapter-item {
16
16
  pointer-events: auto;
17
17
  }
18
18
  `}
19
19
 
20
20
  `);
21
- t(r)`
21
+ o(n)`
22
22
  position: relative;
23
23
  overflow: auto;
24
24
  `;
25
- const c = t(r)`
25
+ const u = o(n)`
26
26
  & > * {
27
27
  pointer-events: none;
28
28
  }
29
29
 
30
30
  cursor: not-allowed;
31
- `;
32
- t(p)(({ theme: o, $clickable: e }) => {
33
- const { gutter: n } = o.layout;
31
+ `, d = o.div`
32
+ position: absolute;
33
+ left: 0;
34
+ top: 0;
35
+ z-index: 1;
36
+ padding: 16px;
37
+ height: 100%;
38
+ `, v = o(p)(({ theme: t, $clickable: e }) => {
39
+ const { gutter: r } = t.layout;
34
40
  return `
35
41
  position: sticky;
36
42
  top: 16px;
37
43
  left: 24px;
38
- width: ${n * 2.5}px;
39
- height: ${n * 2.5}px;
44
+ width: ${r * 2.5}px;
45
+ height: ${r * 2.5}px;
40
46
  cursor: ${e ? "pointer" : "not-allowed"};
41
47
  `;
42
48
  });
43
49
  export {
44
- c as ChapterWrapper,
45
- l as Container,
46
- u as Wrapper
50
+ v as BackIcon,
51
+ d as BackIconWrapper,
52
+ u as ChapterWrapper,
53
+ c as Container,
54
+ l as Wrapper
47
55
  };
48
56
  //# sourceMappingURL=learning-plan-styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"learning-plan-styled.js","sources":["../../../../../src/features/trial-session/comps/learning-plan/learning-plan-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport Back2Icon from '../../../../assets/line-icons/icons/back2';\nimport FlexView from '../../../ui/layout/flex-view';\n\ninterface IStyledContainer {\n $isScrollable?: boolean;\n}\n\nconst Container = styled.div<IStyledContainer>(({ $isScrollable }) => {\n return `\n overflow-y: auto;\n pointer-events: ${$isScrollable ? 'auto' : 'none'};\n `;\n});\n\ninterface IWrapper {\n $clickable: boolean;\n $isScrollable?: boolean;\n}\n\nconst Wrapper = styled(FlexView)<IWrapper>(({ $clickable, $isScrollable }) => {\n return `\n & > * {\n pointer-events: ${$isScrollable ? 'auto' : 'none'};\n }\n \n cursor: not-allowed;\n\n ${\n $clickable &&\n `\n & .goal-widget-chapter-item {\n pointer-events: auto;\n }\n `\n }\n\n `;\n});\n\nconst ChapterContainer = styled(FlexView)`\n position: relative;\n overflow: auto;\n`;\n\nconst ChapterWrapper = styled(FlexView)`\n & > * {\n pointer-events: none;\n }\n\n cursor: not-allowed;\n`;\n\nconst BackIcon = styled(Back2Icon)<IWrapper>(({ theme, $clickable }) => {\n const { gutter } = theme.layout;\n\n return `\n position: sticky;\n top: 16px;\n left: 24px;\n width: ${gutter * 2.5}px;\n height: ${gutter * 2.5}px;\n cursor: ${$clickable ? 'pointer' : 'not-allowed'};\n `;\n});\n\nexport { Container, Wrapper, BackIcon, ChapterContainer, ChapterWrapper };\n"],"names":["Container","styled","$isScrollable","Wrapper","FlexView","$clickable","ChapterWrapper","Back2Icon","theme","gutter"],"mappings":";;;AASA,MAAMA,IAAYC,EAAO,IAAsB,CAAC,EAAE,eAAAC,QACzC;AAAA;AAAA,sBAEaA,IAAgB,SAAS,MAAM;AAAA,GAEpD,GAOKC,IAAUF,EAAOG,CAAQ,EAAY,CAAC,EAAE,YAAAC,GAAY,eAAAH,QACjD;AAAA;AAAA,wBAEeA,IAAgB,SAAS,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,MAMjDG,KACA;AAAA;AAAA;AAAA;AAAA,KAKF;AAAA;AAAA,GAGH;AAEwBJ,EAAOG,CAAQ;AAAA;AAAA;AAAA;AAKlC,MAAAE,IAAiBL,EAAOG,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQrBH,EAAOM,CAAS,EAAY,CAAC,EAAE,OAAAC,GAAO,YAAAH,QAAiB;AAChE,QAAA,EAAE,QAAAI,EAAO,IAAID,EAAM;AAElB,SAAA;AAAA;AAAA;AAAA;AAAA,aAIIC,IAAS,GAAG;AAAA,cACXA,IAAS,GAAG;AAAA,cACZJ,IAAa,YAAY,aAAa;AAAA;AAEpD,CAAC;"}
1
+ {"version":3,"file":"learning-plan-styled.js","sources":["../../../../../src/features/trial-session/comps/learning-plan/learning-plan-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport Back2Icon from '../../../../assets/line-icons/icons/back2';\nimport FlexView from '../../../ui/layout/flex-view';\n\ninterface IStyledContainer {\n $isScrollable?: boolean;\n}\n\nconst Container = styled.div<IStyledContainer>(({ $isScrollable }) => {\n return `\n overflow-y: auto;\n pointer-events: ${$isScrollable ? 'auto' : 'none'};\n `;\n});\n\ninterface IWrapper {\n $clickable: boolean;\n $isScrollable?: boolean;\n}\n\nconst Wrapper = styled(FlexView)<IWrapper>(({ $clickable, $isScrollable }) => {\n return `\n & > * {\n pointer-events: ${$isScrollable ? 'auto' : 'none'};\n }\n \n cursor: not-allowed;\n\n ${\n $clickable &&\n `\n & .goal-widget-chapter-item {\n pointer-events: auto;\n }\n `\n }\n\n `;\n});\n\nconst ChapterContainer = styled(FlexView)`\n position: relative;\n overflow: auto;\n`;\n\nconst ChapterWrapper = styled(FlexView)`\n & > * {\n pointer-events: none;\n }\n\n cursor: not-allowed;\n`;\n\nconst BackIconWrapper = styled.div`\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1;\n padding: 16px;\n height: 100%;\n`;\n\nconst BackIcon = styled(Back2Icon)<IWrapper>(({ theme, $clickable }) => {\n const { gutter } = theme.layout;\n\n return `\n position: sticky;\n top: 16px;\n left: 24px;\n width: ${gutter * 2.5}px;\n height: ${gutter * 2.5}px;\n cursor: ${$clickable ? 'pointer' : 'not-allowed'};\n `;\n});\n\nexport { Container, Wrapper, BackIconWrapper, BackIcon, ChapterContainer, ChapterWrapper };\n"],"names":["Container","styled","$isScrollable","Wrapper","FlexView","$clickable","ChapterWrapper","BackIconWrapper","BackIcon","Back2Icon","theme","gutter"],"mappings":";;;AASA,MAAMA,IAAYC,EAAO,IAAsB,CAAC,EAAE,eAAAC,QACzC;AAAA;AAAA,sBAEaA,IAAgB,SAAS,MAAM;AAAA,GAEpD,GAOKC,IAAUF,EAAOG,CAAQ,EAAY,CAAC,EAAE,YAAAC,GAAY,eAAAH,QACjD;AAAA;AAAA,wBAEeA,IAAgB,SAAS,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,MAMjDG,KACA;AAAA;AAAA;AAAA;AAAA,KAKF;AAAA;AAAA,GAGH;AAEwBJ,EAAOG,CAAQ;AAAA;AAAA;AAAA;AAKlC,MAAAE,IAAiBL,EAAOG,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQhCG,IAAkBN,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASzBO,IAAWP,EAAOQ,CAAS,EAAY,CAAC,EAAE,OAAAC,GAAO,YAAAL,QAAiB;AAChE,QAAA,EAAE,QAAAM,EAAO,IAAID,EAAM;AAElB,SAAA;AAAA;AAAA;AAAA;AAAA,aAIIC,IAAS,GAAG;AAAA,cACXA,IAAS,GAAG;AAAA,cACZN,IAAa,YAAY,aAAa;AAAA;AAEpD,CAAC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/leap",
3
- "version": "3.1.23-beta-0.2",
3
+ "version": "3.1.23-j1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,9 +0,0 @@
1
- import { createPostAPI as e } from "@cuemath/rest-api";
2
- import { BASE_URL as o } from "../constants.js";
3
- const { usePost: s } = e({
4
- getURL: () => `${o}/profile`
5
- });
6
- export {
7
- s as useValidateUserName
8
- };
9
- //# sourceMappingURL=use-validate-user-api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-validate-user-api.js","sources":["../../../../../../src/features/circle-games/sign-up/api/use-validate-username-api/use-validate-user-api.ts"],"sourcesContent":["import type {\n IValidateUsernamePayload,\n IValidateUsernameResponse,\n} from './use-validate-user-api-types';\n\nimport { createPostAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL } from '../constants';\n\nexport const { usePost: useValidateUserName } = createPostAPI<\n IValidateUsernameResponse,\n IValidateUsernamePayload\n>({\n getURL: () => `${BASE_URL}/profile`,\n});\n"],"names":["useValidateUserName","createPostAPI","BASE_URL"],"mappings":";;AASO,MAAM,EAAE,SAASA,EAAoB,IAAIC,EAG9C;AAAA,EACA,QAAQ,MAAM,GAAGC,CAAQ;AAC3B,CAAC;"}
@@ -1,5 +0,0 @@
1
- var S = /* @__PURE__ */ ((E) => (E.USERNAME_EXISTS = "40022", E.USERNAME_NOT_ALLOWED = "40023", E))(S || {});
2
- export {
3
- S as ErrorCode
4
- };
5
- //# sourceMappingURL=validate-username-dal-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate-username-dal-types.js","sources":["../../../../../../src/features/circle-games/sign-up/dal/validate-username-dal/validate-username-dal-types.ts"],"sourcesContent":["export enum ErrorCode {\n USERNAME_EXISTS = '40022',\n USERNAME_NOT_ALLOWED = '40023',\n}\nexport interface IValidateUsernameResponseDal {\n isValid: boolean;\n errorCode: `${ErrorCode}` | null;\n message: string;\n}\n"],"names":["ErrorCode"],"mappings":"AAAY,IAAAA,sBAAAA,OACVA,EAAA,kBAAkB,SAClBA,EAAA,uBAAuB,SAFbA,IAAAA,KAAA,CAAA,CAAA;"}