@cuemath/leap 3.3.30 → 3.3.31-m

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 (162) hide show
  1. package/dist/assets/line-icons/icons/chevron-right.js.map +1 -1
  2. package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +34 -43
  3. package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
  4. package/dist/features/chapters-v2/chapter-details/chapter-details.js +101 -140
  5. package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
  6. package/dist/features/chapters-v2/utils/index.js +16 -20
  7. package/dist/features/chapters-v2/utils/index.js.map +1 -1
  8. package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js +6 -6
  9. package/dist/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.js.map +1 -1
  10. package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +21 -20
  11. package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
  12. package/dist/features/circle-games/games/web-view/web-view-types.js.map +1 -1
  13. package/dist/features/circle-games/sign-up/sign-up.js +6 -6
  14. package/dist/features/circle-games/sign-up/sign-up.js.map +1 -1
  15. package/dist/features/homework/hw-card-list/hw-card-list-view.js +17 -17
  16. package/dist/features/journey/journey-id/journey-id-student.js +1 -1
  17. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  18. package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
  19. package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
  20. package/dist/features/journey/mocks/chapter-page-journey-mock-data.js +0 -400
  21. package/dist/features/journey/mocks/chapter-page-journey-mock-data.js.map +1 -1
  22. package/dist/features/milestone/create/comps/goal-completion-date-selector/goal-completion-date-selector.js +6 -6
  23. package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js +2 -2
  24. package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js +22 -28
  25. package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js.map +1 -1
  26. package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js +1 -1
  27. package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js.map +1 -1
  28. package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +44 -44
  29. package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
  30. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js +12 -0
  31. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary-styled.js.map +1 -0
  32. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js +17 -16
  33. package/dist/features/parent-dashboard/modals/student-profile-summary/student-profile-summary.js.map +1 -1
  34. package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js +8 -4
  35. package/dist/features/parent-dashboard/modals/trial-report/trial-report-styled.js.map +1 -1
  36. package/dist/features/parent-dashboard/parent-dashboard-constants.js +4 -44
  37. package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +1 -1
  38. package/dist/features/parent-dashboard/parent-dashboard-types.js +3 -3
  39. package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
  40. package/dist/features/parent-dashboard/parent-dashboard-view.js +175 -174
  41. package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
  42. package/dist/features/stickers/sticker-selector/hooks/use-handle-sticker-send.js +25 -0
  43. package/dist/features/stickers/sticker-selector/hooks/use-handle-sticker-send.js.map +1 -0
  44. package/dist/features/stickers/sticker-selector/hooks/use-stickers-journey/use-stickers-journey.js +72 -0
  45. package/dist/features/stickers/sticker-selector/hooks/use-stickers-journey/use-stickers-journey.js.map +1 -0
  46. package/dist/features/stickers/sticker-selector/sticker-selector.js +58 -57
  47. package/dist/features/stickers/sticker-selector/sticker-selector.js.map +1 -1
  48. package/dist/features/stickers/stickers-effects/comps/sticker-with-fallback.js +34 -0
  49. package/dist/features/stickers/stickers-effects/comps/sticker-with-fallback.js.map +1 -0
  50. package/dist/features/stickers/stickers-effects/constants.js +26 -0
  51. package/dist/features/stickers/stickers-effects/constants.js.map +1 -0
  52. package/dist/features/stickers/stickers-effects/context/sticker-provider.js +28 -0
  53. package/dist/features/stickers/stickers-effects/context/sticker-provider.js.map +1 -0
  54. package/dist/features/stickers/stickers-effects/hooks/use-stickers.js +12 -0
  55. package/dist/features/stickers/stickers-effects/hooks/use-stickers.js.map +1 -0
  56. package/dist/features/stickers/stickers-effects/stickers-effects-helper.js.map +1 -1
  57. package/dist/features/stickers/stickers-effects/stickers-effects-styled.js +32 -17
  58. package/dist/features/stickers/stickers-effects/stickers-effects-styled.js.map +1 -1
  59. package/dist/features/stickers/stickers-effects/stickers-effects-types.js +6 -0
  60. package/dist/features/stickers/stickers-effects/stickers-effects-types.js.map +1 -0
  61. package/dist/features/stickers/stickers-effects/stickers-effects.js +40 -56
  62. package/dist/features/stickers/stickers-effects/stickers-effects.js.map +1 -1
  63. package/dist/features/student-details/class-details/class-details-utils.js +6 -6
  64. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps-constants.js +1 -1
  65. package/dist/features/trial-session/comps/pla/next-steps/next-steps-constants.js.map +1 -0
  66. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps-styled.js +1 -1
  67. package/dist/features/trial-session/comps/pla/next-steps/next-steps-styled.js.map +1 -0
  68. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps.js +5 -5
  69. package/dist/features/trial-session/comps/pla/next-steps/next-steps.js.map +1 -0
  70. package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js +29 -0
  71. package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js.map +1 -0
  72. package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js +132 -0
  73. package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js.map +1 -0
  74. package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js +11 -0
  75. package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js.map +1 -0
  76. package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js +19 -0
  77. package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js.map +1 -0
  78. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/session-status/session-status-styled.js +2 -2
  79. package/dist/features/trial-session/comps/pla/session-status/session-status-styled.js.map +1 -0
  80. package/dist/features/trial-session/comps/pla/session-status/session-status.js +127 -0
  81. package/dist/features/trial-session/comps/pla/session-status/session-status.js.map +1 -0
  82. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/session-summary/session-summary-constants.js +2 -2
  83. package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js.map +1 -0
  84. package/dist/features/trial-session/comps/pla/session-summary/session-summary.js +53 -0
  85. package/dist/features/trial-session/comps/pla/session-summary/session-summary.js.map +1 -0
  86. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/session-summary/summary-card/summary-card-styled.js +1 -1
  87. package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card-styled.js.map +1 -0
  88. package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js +56 -0
  89. package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js.map +1 -0
  90. package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-constants.js.map +1 -0
  91. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-styled.js +1 -1
  92. package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-styled.js.map +1 -0
  93. package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types.js.map +1 -0
  94. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions.js +14 -14
  95. package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js.map +1 -0
  96. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +44 -43
  97. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -1
  98. package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js +61 -60
  99. package/dist/features/trial-session/comps/trial-circle-game/trial-circle-game.js.map +1 -1
  100. package/dist/features/trial-session/trial-session-types.js.map +1 -1
  101. package/dist/features/trial-session/trial-session-view.js +73 -71
  102. package/dist/features/trial-session/trial-session-view.js.map +1 -1
  103. package/dist/features/ui/modals/modal-styled.js +13 -45
  104. package/dist/features/ui/modals/modal-styled.js.map +1 -1
  105. package/dist/features/ui/modals/modal.js +31 -31
  106. package/dist/features/ui/modals/modal.js.map +1 -1
  107. package/dist/index.d.ts +143 -54
  108. package/dist/index.js +337 -320
  109. package/dist/index.js.map +1 -1
  110. package/dist/node_modules/date-fns/_lib/getRoundingMethod.js +10 -0
  111. package/dist/node_modules/date-fns/_lib/getRoundingMethod.js.map +1 -0
  112. package/dist/node_modules/date-fns/differenceInMilliseconds.js +9 -0
  113. package/dist/node_modules/date-fns/differenceInMilliseconds.js.map +1 -0
  114. package/dist/node_modules/date-fns/differenceInSeconds.js +11 -0
  115. package/dist/node_modules/date-fns/differenceInSeconds.js.map +1 -0
  116. package/dist/node_modules/query-string/base.js +1 -1
  117. package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +1 -0
  118. package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
  119. package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
  120. package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
  121. package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
  122. package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
  123. package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
  124. package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
  125. package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
  126. package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
  127. package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
  128. package/package.json +1 -1
  129. package/dist/features/journey/hooks/use-chapter-page-journey/use-download-block-journey.js +0 -86
  130. package/dist/features/journey/hooks/use-chapter-page-journey/use-download-block-journey.js.map +0 -1
  131. package/dist/features/journey/hooks/use-chapter-page-journey/use-download-node-journey.js +0 -140
  132. package/dist/features/journey/hooks/use-chapter-page-journey/use-download-node-journey.js.map +0 -1
  133. package/dist/features/parent-dashboard/comps/next-steps/next-steps-constants.js.map +0 -1
  134. package/dist/features/parent-dashboard/comps/next-steps/next-steps-styled.js.map +0 -1
  135. package/dist/features/parent-dashboard/comps/next-steps/next-steps.js.map +0 -1
  136. package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js +0 -34
  137. package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js.map +0 -1
  138. package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js +0 -137
  139. package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js.map +0 -1
  140. package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js +0 -20
  141. package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js.map +0 -1
  142. package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js +0 -19
  143. package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js.map +0 -1
  144. package/dist/features/parent-dashboard/comps/session-status/session-status-styled.js.map +0 -1
  145. package/dist/features/parent-dashboard/comps/session-status/session-status.js +0 -124
  146. package/dist/features/parent-dashboard/comps/session-status/session-status.js.map +0 -1
  147. package/dist/features/parent-dashboard/comps/session-summary/session-summary-constants.js.map +0 -1
  148. package/dist/features/parent-dashboard/comps/session-summary/session-summary.js +0 -53
  149. package/dist/features/parent-dashboard/comps/session-summary/session-summary.js.map +0 -1
  150. package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card-styled.js.map +0 -1
  151. package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js +0 -63
  152. package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js.map +0 -1
  153. package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-constants.js.map +0 -1
  154. package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-styled.js.map +0 -1
  155. package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-types.js.map +0 -1
  156. package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions.js.map +0 -1
  157. package/dist/node_modules/decode-uri-component/index.js.map +0 -1
  158. package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
  159. package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
  160. /package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-constants.js +0 -0
  161. /package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-types.js +0 -0
  162. /package/dist/node_modules/{decode-uri-component → query-string/node_modules/decode-uri-component}/index.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"chevron-right.js","sources":["../../../../src/assets/line-icons/icons/chevron-right.tsx"],"sourcesContent":["import React from 'react';\n\ninterface IconProps extends React.SVGProps<SVGSVGElement> {}\n\nconst ChevronRight: React.FC<IconProps> = props => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16.666 12.6C13.3155 12.6 10.5993 15.3161 10.5993 18.6666H9.39935C9.39935 15.6827 11.1979 13.1188 13.77 12C11.1979 10.8811 9.39935 8.31722 9.39935 5.33329H10.5993C10.5993 8.68382 13.3155 11.4 16.666 11.4V12.6Z\"\n fill=\"currentColor\"\n fillOpacity=\"1\"\n />\n </svg>\n);\n\nexport default ChevronRight;\n"],"names":["ChevronRight","props","jsx","ChevronRightIcon"],"mappings":";AAIA,MAAMA,IAAoC,CACxCC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,GAAE;AAAA,QACF,MAAK;AAAA,QACL,aAAY;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AACF,GAGFC,IAAeH;"}
1
+ {"version":3,"file":"chevron-right.js","sources":["../../../../src/assets/line-icons/icons/chevron-right.tsx"],"sourcesContent":["import React from 'react';\n\ninterface IconProps extends React.SVGProps<SVGSVGElement> {}\n\nconst ChevronRight: React.FC<IconProps> = props => (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16.666 12.6C13.3155 12.6 10.5993 15.3161 10.5993 18.6666H9.39935C9.39935 15.6827 11.1979 13.1188 13.77 12C11.1979 10.8811 9.39935 8.31722 9.39935 5.33329H10.5993C10.5993 8.68382 13.3155 11.4 16.666 11.4V12.6Z\"\n fill=\"currentColor\"\n fillOpacity=\"1\"\n />\n </svg>\n);\n\nexport default ChevronRight;\n"],"names":["ChevronRight","props","jsx","ChevronRight$1"],"mappings":";AAIA,MAAMA,IAAoC,CACxCC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,OAAM;AAAA,IACL,GAAGD;AAAA,IAEJ,UAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,UAAS;AAAA,QACT,GAAE;AAAA,QACF,MAAK;AAAA,QACL,aAAY;AAAA,MAAA;AAAA,IACd;AAAA,EAAA;AACF,GAGFC,IAAeH;"}
@@ -1,62 +1,53 @@
1
- import { jsxs as O, jsx as c } from "react/jsx-runtime";
2
- import { memo as y, useMemo as D } from "react";
3
- import { BLOCK_TYPE as G, SECTION_CODE as I } from "../../constants/block-constants.js";
4
- import u from "./block-section-view.js";
5
- import { ChapterDetailsWrapper as L } from "./block-sections-styled.js";
6
- const { SAT_MOCK_TEST: _, GOAL: w } = G, { GOALS: N, READINESS: x } = I, F = y((h) => {
7
- const {
8
- blocks: t,
9
- imageHue: i,
10
- userType: r,
11
- coreBlocksRef: S,
12
- challengeBlockRef: C,
13
- downloadBlockRef: E,
14
- downloadCoreBlockRef: g,
15
- ...d
16
- } = h;
17
- let a = 0, k = !1, f = !1;
18
- const { goalBlocks: p, nonGoalBlocks: B } = D(
1
+ import { jsxs as T, jsx as c } from "react/jsx-runtime";
2
+ import { memo as b, useMemo as A } from "react";
3
+ import { BLOCK_TYPE as C, SECTION_CODE as g } from "../../constants/block-constants.js";
4
+ import m from "./block-section-view.js";
5
+ import { ChapterDetailsWrapper as R } from "./block-sections-styled.js";
6
+ const { SAT_MOCK_TEST: u, GOAL: y } = C, { GOALS: G, READINESS: I } = g, v = b((_) => {
7
+ const { blocks: t, imageHue: n, userType: i, coreBlocksRef: B, blockSectionRef: S, ...r } = _;
8
+ let p = 0, k = !1;
9
+ const { goalBlocks: d, nonGoalBlocks: a } = A(
19
10
  () => t.reduce(
20
- (o, e) => (e.section_code === N || e.section_code === x || e.block_type === _ ? o.goalBlocks.push(e) : o.nonGoalBlocks.push(e), o),
11
+ (o, e) => (e.section_code === G || e.section_code === I || e.block_type === u ? o.goalBlocks.push(e) : o.nonGoalBlocks.push(e), o),
21
12
  { goalBlocks: [], nonGoalBlocks: [] }
22
13
  ),
23
14
  [t]
24
15
  );
25
- return /* @__PURE__ */ O(
26
- L,
16
+ return /* @__PURE__ */ T(
17
+ R,
27
18
  {
28
19
  $width: "100%",
29
- $background: B.length ? "WHITE_3" : "WHITE_1",
20
+ $background: a.length ? "WHITE_3" : "WHITE_1",
30
21
  children: [
31
- /* @__PURE__ */ c("div", { ref: S, children: p.map((o, e) => {
32
- const { block_type: l, block_id: s, permissions: n, sheets: A } = o;
33
- let m = 0;
34
- const R = e === p.length - 1, T = A.find((b) => b.node_type === "PDF");
35
- return (l === w || l === _) && (n.can_un_skip || (a += 1), m = a), /* @__PURE__ */ c(
36
- u,
22
+ /* @__PURE__ */ c("div", { ref: B, children: d.map((o, e) => {
23
+ const { block_type: l, block_id: s, permissions: E } = o;
24
+ let f = 0;
25
+ const h = e === d.length - 1;
26
+ return (l === y || l === u) && (E.can_un_skip || (p += 1), f = p), /* @__PURE__ */ c(
27
+ m,
37
28
  {
38
29
  blockData: o,
39
- userType: r,
40
- isLastBlock: R,
41
- lessonIdx: m,
42
- imageHue: i,
30
+ userType: i,
31
+ isLastBlock: h,
32
+ lessonIdx: f,
33
+ imageHue: n,
43
34
  isGoalBlock: !0,
44
- ...d,
45
- blockSectionRef: T ? g : void 0
35
+ ...r,
36
+ blockSectionRef: void 0
46
37
  },
47
38
  s
48
39
  );
49
40
  }) }),
50
- B.map((o) => {
51
- const { block_id: e, block_type: l } = o, s = l === "CHALLENGE_ARENA" && !k, n = l === "DOWNLOADS" && !f;
52
- return s && (k = !0), n && (f = !0), /* @__PURE__ */ c(
53
- u,
41
+ a.map((o) => {
42
+ const { block_id: e, block_type: l } = o, s = l === "CHALLENGE_ARENA" && !k;
43
+ return s && (k = !0), /* @__PURE__ */ c(
44
+ m,
54
45
  {
55
46
  blockData: o,
56
- userType: r,
57
- imageHue: i,
58
- ...d,
59
- blockSectionRef: s ? C : n ? E : void 0
47
+ userType: i,
48
+ imageHue: n,
49
+ ...r,
50
+ blockSectionRef: s ? S : void 0
60
51
  },
61
52
  e
62
53
  );
@@ -66,6 +57,6 @@ const { SAT_MOCK_TEST: _, GOAL: w } = G, { GOALS: N, READINESS: x } = I, F = y((
66
57
  );
67
58
  });
68
59
  export {
69
- F as default
60
+ v as default
70
61
  };
71
62
  //# sourceMappingURL=block-sections.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"block-sections.js","sources":["../../../../../src/features/chapters-v2/chapter-details/block-sections/block-sections.tsx"],"sourcesContent":["import type { IBlockSectionsProps } from './block-sections-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport { BLOCK_TYPE, SECTION_CODE } from '../../constants/block-constants';\nimport BlockSectionView from './block-section-view';\nimport * as Styled from './block-sections-styled';\n\nconst { SAT_MOCK_TEST, GOAL } = BLOCK_TYPE;\nconst { GOALS, READINESS } = SECTION_CODE;\n\nconst BlockSections: FC<IBlockSectionsProps> = memo(props => {\n const {\n blocks,\n imageHue,\n userType,\n coreBlocksRef,\n challengeBlockRef,\n downloadBlockRef,\n downloadCoreBlockRef,\n ...blockSectionCallBacks\n } = props;\n\n let lessonCount = 0;\n let addChallengeArenaRef = false;\n let addDownloadBlockRef = false;\n\n const { goalBlocks, nonGoalBlocks } = useMemo(\n () =>\n blocks.reduce(\n (acc, block) => {\n if (\n block.section_code === GOALS ||\n block.section_code === READINESS ||\n block.block_type === SAT_MOCK_TEST\n ) {\n acc.goalBlocks.push(block);\n } else {\n acc.nonGoalBlocks.push(block);\n }\n\n return acc;\n },\n { goalBlocks: [] as typeof blocks, nonGoalBlocks: [] as typeof blocks },\n ),\n [blocks],\n );\n\n return (\n <Styled.ChapterDetailsWrapper\n $width=\"100%\"\n $background={!nonGoalBlocks.length ? `WHITE_1` : 'WHITE_3'}\n >\n <div ref={coreBlocksRef}>\n {goalBlocks.map((blockData, idx) => {\n const { block_type: blockType, block_id: blockId, permissions, sheets } = blockData;\n let lessonIdx = 0;\n\n const isLastBlock = idx === goalBlocks.length - 1;\n\n const hasPDFNode = sheets.find(sheet => sheet.node_type === 'PDF');\n\n if (blockType === GOAL || blockType === SAT_MOCK_TEST) {\n if (!permissions.can_un_skip) {\n lessonCount += 1;\n }\n\n lessonIdx = lessonCount;\n }\n\n return (\n <BlockSectionView\n blockData={blockData}\n userType={userType}\n isLastBlock={isLastBlock}\n key={blockId}\n lessonIdx={lessonIdx}\n imageHue={imageHue}\n isGoalBlock\n {...blockSectionCallBacks}\n blockSectionRef={hasPDFNode ? downloadCoreBlockRef : undefined}\n />\n );\n })}\n </div>\n\n {nonGoalBlocks.map(blockData => {\n const { block_id: blockId, block_type: blockType } = blockData;\n\n // Apply blockSectionRef only to the first CHALLENGE_ARENA block\n const isChallengeArenaBlock = blockType === 'CHALLENGE_ARENA' && !addChallengeArenaRef;\n\n const isDownloadBlock = blockType === 'DOWNLOADS' && !addDownloadBlockRef;\n\n if (isChallengeArenaBlock) {\n addChallengeArenaRef = true;\n }\n\n if (isDownloadBlock) {\n addDownloadBlockRef = true;\n }\n\n return (\n <BlockSectionView\n key={blockId}\n blockData={blockData}\n userType={userType}\n imageHue={imageHue}\n {...blockSectionCallBacks}\n blockSectionRef={\n isChallengeArenaBlock\n ? challengeBlockRef\n : isDownloadBlock\n ? downloadBlockRef\n : undefined\n }\n />\n );\n })}\n </Styled.ChapterDetailsWrapper>\n );\n});\n\nexport default BlockSections;\n"],"names":["SAT_MOCK_TEST","GOAL","BLOCK_TYPE","GOALS","READINESS","SECTION_CODE","BlockSections","memo","props","blocks","imageHue","userType","coreBlocksRef","challengeBlockRef","downloadBlockRef","downloadCoreBlockRef","blockSectionCallBacks","lessonCount","addChallengeArenaRef","addDownloadBlockRef","goalBlocks","nonGoalBlocks","useMemo","acc","block","jsxs","Styled.ChapterDetailsWrapper","jsx","blockData","idx","blockType","blockId","permissions","sheets","lessonIdx","isLastBlock","hasPDFNode","sheet","BlockSectionView","isChallengeArenaBlock","isDownloadBlock"],"mappings":";;;;;AASA,MAAM,EAAE,eAAAA,GAAe,MAAAC,EAAS,IAAAC,GAC1B,EAAE,OAAAC,GAAO,WAAAC,EAAc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AxB;AAAA,cACA,aAAW;AAAA,cACV,GAAGM;AAAA,cACJ,iBAAiBoB,IAAarB,IAAuB;AAAA,YAAA;AAAA,YALhDgB;AAAA,UAAA;AAAA,QAQV,CAAA,GACH;AAAA,QAECV,EAAc,IAAI,CAAaO,MAAA;AAC9B,gBAAM,EAAE,UAAUG,GAAS,YAAYD,MAAcF,GAG/CW,IAAwBT,MAAc,qBAAqB,CAACZ,GAE5DsB,IAAkBV,MAAc,eAAe,CAACX;AAEtD,iBAAIoB,MACqBrB,IAAA,KAGrBsB,MACoBrB,IAAA,KAItB,gBAAAQ;AAAA,YAACW;AAAA,YAAA;AAAA,cAEC,WAAAV;AAAA,cACA,UAAAjB;AAAA,cACA,UAAAD;AAAA,cACC,GAAGM;AAAA,cACJ,iBACEuB,IACI1B,IACA2B,IACE1B,IACA;AAAA,YAAA;AAAA,YAVHiB;AAAA,UAAA;AAAA,QAYP,CAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
1
+ {"version":3,"file":"block-sections.js","sources":["../../../../../src/features/chapters-v2/chapter-details/block-sections/block-sections.tsx"],"sourcesContent":["import type { IBlockSectionsProps } from './block-sections-types';\nimport type { FC } from 'react';\n\nimport { memo, useMemo } from 'react';\n\nimport { BLOCK_TYPE, SECTION_CODE } from '../../constants/block-constants';\nimport BlockSectionView from './block-section-view';\nimport * as Styled from './block-sections-styled';\n\nconst { SAT_MOCK_TEST, GOAL } = BLOCK_TYPE;\nconst { GOALS, READINESS } = SECTION_CODE;\n\nconst BlockSections: FC<IBlockSectionsProps> = memo(props => {\n const { blocks, imageHue, userType, coreBlocksRef, blockSectionRef, ...blockSectionCallBacks } =\n props;\n\n let lessonCount = 0;\n let addChallengeArenaRef = false;\n\n const { goalBlocks, nonGoalBlocks } = useMemo(\n () =>\n blocks.reduce(\n (acc, block) => {\n if (\n block.section_code === GOALS ||\n block.section_code === READINESS ||\n block.block_type === SAT_MOCK_TEST\n ) {\n acc.goalBlocks.push(block);\n } else {\n acc.nonGoalBlocks.push(block);\n }\n\n return acc;\n },\n { goalBlocks: [] as typeof blocks, nonGoalBlocks: [] as typeof blocks },\n ),\n [blocks],\n );\n\n return (\n <Styled.ChapterDetailsWrapper\n $width=\"100%\"\n $background={!nonGoalBlocks.length ? `WHITE_1` : 'WHITE_3'}\n >\n <div ref={coreBlocksRef}>\n {goalBlocks.map((blockData, idx) => {\n const { block_type: blockType, block_id: blockId, permissions } = blockData;\n let lessonIdx = 0;\n\n const isLastBlock = idx === goalBlocks.length - 1;\n\n if (blockType === GOAL || blockType === SAT_MOCK_TEST) {\n if (!permissions.can_un_skip) {\n lessonCount += 1;\n }\n\n lessonIdx = lessonCount;\n }\n\n return (\n <BlockSectionView\n blockData={blockData}\n userType={userType}\n isLastBlock={isLastBlock}\n key={blockId}\n lessonIdx={lessonIdx}\n imageHue={imageHue}\n isGoalBlock\n {...blockSectionCallBacks}\n blockSectionRef={undefined}\n />\n );\n })}\n </div>\n\n {nonGoalBlocks.map(blockData => {\n const { block_id: blockId, block_type: blockType } = blockData;\n\n // Apply blockSectionRef only to the first CHALLENGE_ARENA block\n const shouldApplyRef = blockType === 'CHALLENGE_ARENA' && !addChallengeArenaRef;\n\n if (shouldApplyRef) {\n addChallengeArenaRef = true;\n }\n\n return (\n <BlockSectionView\n key={blockId}\n blockData={blockData}\n userType={userType}\n imageHue={imageHue}\n {...blockSectionCallBacks}\n blockSectionRef={shouldApplyRef ? blockSectionRef : undefined}\n />\n );\n })}\n </Styled.ChapterDetailsWrapper>\n );\n});\n\nexport default BlockSections;\n"],"names":["SAT_MOCK_TEST","GOAL","BLOCK_TYPE","GOALS","READINESS","SECTION_CODE","BlockSections","memo","props","blocks","imageHue","userType","coreBlocksRef","blockSectionRef","blockSectionCallBacks","lessonCount","addChallengeArenaRef","goalBlocks","nonGoalBlocks","useMemo","acc","block","jsxs","Styled.ChapterDetailsWrapper","jsx","blockData","idx","blockType","blockId","permissions","lessonIdx","isLastBlock","BlockSection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,iBAAiB;AAAA,YAAA;AAAA,YALZc;AAAA,UAAA;AAAA,QAQV,CAAA,GACH;AAAA,QAECV,EAAc,IAAI,CAAaO,MAAA;AAC9B,gBAAM,EAAE,UAAUG,GAAS,YAAYD,MAAcF,GAG/CQ,IAAiBN,MAAc,qBAAqB,CAACX;AAE3D,iBAAIiB,MACqBjB,IAAA,KAIvB,gBAAAQ;AAAA,YAACQ;AAAA,YAAA;AAAA,cAEC,WAAAP;AAAA,cACA,UAAAd;AAAA,cACA,UAAAD;AAAA,cACC,GAAGI;AAAA,cACJ,iBAAiBmB,IAAiBpB,IAAkB;AAAA,YAAA;AAAA,YAL/Ce;AAAA,UAAA;AAAA,QAMP,CAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
@@ -1,187 +1,148 @@
1
- import { jsxs as p, jsx as o, Fragment as z } from "react/jsx-runtime";
2
- import { memo as G, useCallback as M, useEffect as f, useMemo as h } from "react";
3
- import { ILLUSTRATIONS as V } from "../../../assets/illustrations/illustrations.js";
4
- import q from "../../../assets/line-icons/icons/back2.js";
5
- import { useChallengeArenaJourney as K } from "../../journey/hooks/use-chapter-page-journey/use-challenge-arena-journey.js";
6
- import { useDownloadBlockJourney as Q } from "../../journey/hooks/use-chapter-page-journey/use-download-block-journey.js";
7
- import { useDownloadNodeJourney as Y } from "../../journey/hooks/use-chapter-page-journey/use-download-node-journey.js";
8
- import { useJourney as Z } from "../../journey/use-journey/use-journey.js";
9
- import ee from "../../ui/buttons/button/button.js";
10
- import oe from "../../ui/buttons/icon-button/icon-button.js";
11
- import te from "../../ui/layout/flex-view.js";
12
- import re from "../../ui/loader/app-loader/app-loader.js";
13
- import ne from "../../ui/text/text.js";
14
- import { useGetChapterDetails as ae } from "../api/chapter.js";
15
- import { getHasDownloadBlock as ie, getHasNonDownloadBlockWithPdfNode as se } from "../utils/index.js";
16
- import le from "./block-sections/block-sections.js";
17
- import ce from "./chapter-banner/chapter-banner.js";
18
- import { ContentWrapper as de, BackButtonContainer as me, BackButtonWrapper as pe, LoaderWrapper as fe } from "./chapter-details-styled.js";
19
- const he = G((S) => {
1
+ import { jsxs as c, jsx as t, Fragment as E } from "react/jsx-runtime";
2
+ import { memo as L, useCallback as P, useEffect as p } from "react";
3
+ import { ILLUSTRATIONS as T } from "../../../assets/illustrations/illustrations.js";
4
+ import U from "../../../assets/line-icons/icons/back2.js";
5
+ import { useChallengeArenaJourney as j } from "../../journey/hooks/use-chapter-page-journey/use-challenge-arena-journey.js";
6
+ import { useJourney as H } from "../../journey/use-journey/use-journey.js";
7
+ import F from "../../ui/buttons/button/button.js";
8
+ import O from "../../ui/buttons/icon-button/icon-button.js";
9
+ import W from "../../ui/layout/flex-view.js";
10
+ import X from "../../ui/loader/app-loader/app-loader.js";
11
+ import z from "../../ui/text/text.js";
12
+ import { useGetChapterDetails as G } from "../api/chapter.js";
13
+ import V from "./block-sections/block-sections.js";
14
+ import q from "./chapter-banner/chapter-banner.js";
15
+ import { ContentWrapper as M, BackButtonContainer as K, BackButtonWrapper as Q, LoaderWrapper as Y } from "./chapter-details-styled.js";
16
+ const Z = L((u) => {
20
17
  const {
21
- userChapterId: s,
22
- studentId: l,
23
- userType: t,
24
- onBlockSkipUnskip: J,
25
- onNodeAttempt: A,
26
- onNodeAssignAsHomework: b,
27
- onNodeMarkAsDone: $,
28
- onNodeReattempt: x,
29
- onNodeReview: I,
30
- onNodeView: v,
31
- onExit: P,
32
- onNodeUnassign: _,
33
- onNodeUnlock: E,
34
- onNodeSkipUnSkip: H,
35
- startChapterPageJourney: m,
36
- onBlockReset: L,
37
- chapterPageRef: T,
38
- bannerRef: U,
39
- coreBlocksRef: W,
40
- canStartJourney: r,
41
- canStartChallengeArenaJourney: u,
42
- canStartDownloadNodeJourney: c,
43
- canStartDownloadBlockJourney: n
44
- } = S, { isJourneyActive: g } = Z(), {
45
- get: k,
18
+ userChapterId: a,
19
+ studentId: i,
20
+ userType: r,
21
+ onBlockSkipUnskip: k,
22
+ onNodeAttempt: C,
23
+ onNodeAssignAsHomework: y,
24
+ onNodeMarkAsDone: A,
25
+ onNodeReattempt: B,
26
+ onNodeReview: S,
27
+ onNodeView: $,
28
+ onExit: N,
29
+ onNodeUnassign: x,
30
+ onNodeUnlock: R,
31
+ onNodeSkipUnSkip: w,
32
+ startChapterPageJourney: s,
33
+ onBlockReset: I,
34
+ chapterPageRef: b,
35
+ bannerRef: J,
36
+ coreBlocksRef: _,
37
+ canStartJourney: l,
38
+ canStartChallengeArenaJourney: h
39
+ } = u, { isJourneyActive: m } = H(), {
40
+ get: g,
46
41
  data: e,
47
- isProcessing: a,
48
- isProcessingFailed: j,
49
- isStale: y
50
- } = ae(), i = M(() => {
51
- k(s, void 0, { studentId: l });
52
- }, [k, s, l]);
53
- f(() => {
54
- i();
55
- }, [i]);
56
- const { blockSectionRef: F, startJourney: B } = K(), {
57
- blockSectionRef: w,
58
- downloadCoreBlockRef: O,
59
- startJourney: C
60
- } = Y(), { blockSectionRef: N, startJourney: R } = Q(), D = h(
61
- () => e && ie(e.blocks),
62
- [e]
63
- ), d = h(
64
- () => e && se(e.blocks),
65
- [e]
66
- ), X = h(
67
- () => c && d ? w : n ? N : void 0,
68
- [
69
- c,
70
- n,
71
- d,
72
- w,
73
- N
74
- ]
75
- );
76
- return f(() => {
77
- e && !g && (r && m && m({
78
- chapterDetails: e,
79
- userChapterId: s,
80
- studentId: l,
81
- userType: t
82
- }), !r && u && B({
83
- chapterDetails: e,
84
- userType: t
85
- }), !r && c && d && C({
42
+ isProcessing: o,
43
+ isProcessingFailed: v,
44
+ isStale: d
45
+ } = G(), n = P(() => {
46
+ g(a, void 0, { studentId: i });
47
+ }, [g, a, i]);
48
+ p(() => {
49
+ n();
50
+ }, [n]);
51
+ const { blockSectionRef: D, startJourney: f } = j();
52
+ return p(() => {
53
+ e && l && !m && s && s({
86
54
  chapterDetails: e,
87
- userType: t,
88
- canStartDownloadBlockJourney: n
89
- }), !r && n && D && R({
55
+ userChapterId: a,
56
+ studentId: i,
57
+ userType: r
58
+ }), e && !l && h && !m && f({
90
59
  chapterDetails: e,
91
- userType: t
92
- }));
60
+ userType: r
61
+ });
93
62
  }, [
94
- u,
95
- r,
63
+ h,
64
+ l,
96
65
  e,
97
- g,
98
- B,
99
66
  m,
100
- R,
101
- C,
102
- l,
67
+ f,
103
68
  s,
104
- t,
105
- d,
106
- D,
107
- c,
108
- n
109
- ]), f(() => {
110
- !a && y && i();
111
- }, [i, a, y]), j ? /* @__PURE__ */ p(te, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
112
- /* @__PURE__ */ o(ne, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
113
- /* @__PURE__ */ o(
114
- ee,
69
+ i,
70
+ a,
71
+ r
72
+ ]), p(() => {
73
+ !o && d && n();
74
+ }, [n, o, d]), v ? /* @__PURE__ */ c(W, { $flexGapX: 1.5, $height: "100vh", $justifyContent: "center", $alignItems: "center", children: [
75
+ /* @__PURE__ */ t(z, { $renderAs: "h6", children: "Oops! Something went wrong. Please try again later." }),
76
+ /* @__PURE__ */ t(
77
+ F,
115
78
  {
116
79
  widthX: 14,
117
80
  size: "small",
118
81
  shape: "square",
119
82
  renderAs: "primary",
120
83
  label: "Try again",
121
- onClick: i
84
+ onClick: n
122
85
  }
123
86
  )
124
- ] }) : !e && a ? /* @__PURE__ */ o(re, { height: "100vh" }) : /* @__PURE__ */ p(
125
- de,
87
+ ] }) : !e && o ? /* @__PURE__ */ t(X, { height: "100vh" }) : /* @__PURE__ */ c(
88
+ M,
126
89
  {
127
- ref: T,
90
+ ref: b,
128
91
  $widthX: 50,
129
- $disablePointerEvents: a,
92
+ $disablePointerEvents: o,
130
93
  $justifyContent: "center",
131
94
  $alignItems: "center",
132
95
  $height: "max-content",
133
96
  children: [
134
- t === "TEACHER" && /* @__PURE__ */ o(me, { $height: "100%", className: "goal-widget-chapter-item", children: /* @__PURE__ */ o(pe, { children: /* @__PURE__ */ o(
135
- oe,
97
+ r === "TEACHER" && /* @__PURE__ */ t(K, { $height: "100%", className: "goal-widget-chapter-item", children: /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(
98
+ O,
136
99
  {
137
- Icon: q,
100
+ Icon: U,
138
101
  renderAs: "secondary-gray",
139
102
  analyticsLabel: "chapter_page_exit",
140
103
  size: "xsmall",
141
- onClick: P
104
+ onClick: N
142
105
  }
143
106
  ) }) }),
144
- a && /* @__PURE__ */ o(fe, { children: /* @__PURE__ */ o("img", { src: V.LOADER_1, alt: "loader" }) }),
145
- e && /* @__PURE__ */ p(z, { children: [
146
- /* @__PURE__ */ o(
147
- ce,
107
+ o && /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t("img", { src: T.LOADER_1, alt: "loader" }) }),
108
+ e && /* @__PURE__ */ c(E, { children: [
109
+ /* @__PURE__ */ t(
110
+ q,
148
111
  {
149
112
  title: e.name,
150
113
  imageHue: e.image_hue,
151
114
  imageUrl: e.image_url,
152
115
  progressStats: e == null ? void 0 : e.progress_stat,
153
- bannerRef: U
116
+ bannerRef: J
154
117
  }
155
118
  ),
156
- /* @__PURE__ */ o(
157
- le,
119
+ /* @__PURE__ */ t(
120
+ V,
158
121
  {
159
122
  imageHue: e.image_hue,
160
- userType: t,
123
+ userType: r,
161
124
  blocks: e.blocks,
162
- onBlockSkipUnskip: J,
163
- onNodeAttempt: A,
164
- onNodeAssignAsHomework: b,
165
- onNodeMarkAsDone: $,
166
- onNodeReattempt: x,
167
- onNodeReview: I,
168
- onNodeView: v,
169
- coreBlocksRef: W,
170
- challengeBlockRef: F,
171
- downloadCoreBlockRef: O,
172
- downloadBlockRef: X,
173
- onNodeUnassign: _,
174
- onNodeUnlock: E,
175
- onNodeSkipUnSkip: H,
176
- onBlockReset: L
125
+ onBlockSkipUnskip: k,
126
+ onNodeAttempt: C,
127
+ onNodeAssignAsHomework: y,
128
+ onNodeMarkAsDone: A,
129
+ onNodeReattempt: B,
130
+ onNodeReview: S,
131
+ onNodeView: $,
132
+ coreBlocksRef: _,
133
+ blockSectionRef: D,
134
+ onNodeUnassign: x,
135
+ onNodeUnlock: R,
136
+ onNodeSkipUnSkip: w,
137
+ onBlockReset: I
177
138
  }
178
139
  )
179
140
  ] })
180
141
  ]
181
142
  }
182
143
  );
183
- }), Pe = he;
144
+ }), fe = Z;
184
145
  export {
185
- Pe as default
146
+ fe as default
186
147
  };
187
148
  //# sourceMappingURL=chapter-details.js.map
@@ -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, useMemo } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\nimport Back2Icon from '../../../assets/line-icons/icons/back2';\nimport { useChallengeArenaJourney } from '../../journey/hooks/use-chapter-page-journey/use-challenge-arena-journey';\nimport { useDownloadBlockJourney } from '../../journey/hooks/use-chapter-page-journey/use-download-block-journey';\nimport { useDownloadNodeJourney } from '../../journey/hooks/use-chapter-page-journey/use-download-node-journey';\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 { getHasDownloadBlock, getHasNonDownloadBlockWithPdfNode } from '../utils';\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 onBlockReset,\n chapterPageRef,\n bannerRef,\n coreBlocksRef,\n canStartJourney,\n canStartChallengeArenaJourney,\n canStartDownloadNodeJourney,\n canStartDownloadBlockJourney,\n } = props;\n\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 const { blockSectionRef: challengeBlockRef, startJourney: startChallengeArenaJourney } =\n useChallengeArenaJourney();\n\n const {\n blockSectionRef: downloadBlockRef,\n downloadCoreBlockRef,\n startJourney: startDownloadNodeJourney,\n } = useDownloadNodeJourney();\n\n const { blockSectionRef: downloadBlockSectionRef, startJourney: startDownloadBlockJourney } =\n useDownloadBlockJourney();\n\n const hasDownloadBlock = useMemo(\n () => chapterDetails && getHasDownloadBlock(chapterDetails.blocks),\n [chapterDetails],\n );\n const hasNonDownloadBlockWithPdfNode = useMemo(\n () => chapterDetails && getHasNonDownloadBlockWithPdfNode(chapterDetails.blocks),\n [chapterDetails],\n );\n\n const activeDownloadBlockRef = useMemo(\n () =>\n canStartDownloadNodeJourney && hasNonDownloadBlockWithPdfNode\n ? downloadBlockRef\n : canStartDownloadBlockJourney\n ? downloadBlockSectionRef\n : undefined,\n [\n canStartDownloadNodeJourney,\n canStartDownloadBlockJourney,\n hasNonDownloadBlockWithPdfNode,\n downloadBlockRef,\n downloadBlockSectionRef,\n ],\n );\n\n useEffect(() => {\n if (chapterDetails && !isJourneyActive) {\n if (canStartJourney && startChapterPageJourney) {\n startChapterPageJourney({\n chapterDetails: chapterDetails,\n userChapterId,\n studentId,\n userType,\n });\n }\n\n if (!canStartJourney && canStartChallengeArenaJourney) {\n startChallengeArenaJourney({\n chapterDetails,\n userType,\n });\n }\n\n if (!canStartJourney && canStartDownloadNodeJourney && hasNonDownloadBlockWithPdfNode) {\n startDownloadNodeJourney({\n chapterDetails,\n userType,\n canStartDownloadBlockJourney,\n });\n }\n\n if (!canStartJourney && canStartDownloadBlockJourney && hasDownloadBlock) {\n startDownloadBlockJourney({\n chapterDetails,\n userType,\n });\n }\n }\n }, [\n canStartChallengeArenaJourney,\n canStartJourney,\n chapterDetails,\n isJourneyActive,\n startChallengeArenaJourney,\n startChapterPageJourney,\n startDownloadBlockJourney,\n startDownloadNodeJourney,\n studentId,\n userChapterId,\n userType,\n hasNonDownloadBlockWithPdfNode,\n hasDownloadBlock,\n canStartDownloadNodeJourney,\n canStartDownloadBlockJourney,\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=\"100vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n ref={chapterPageRef}\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"max-content\"\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 challengeBlockRef={challengeBlockRef}\n downloadCoreBlockRef={downloadCoreBlockRef}\n downloadBlockRef={activeDownloadBlockRef}\n onNodeUnassign={onNodeUnassign}\n onNodeUnlock={onNodeUnlock}\n onNodeSkipUnSkip={onNodeSkipUnSkip}\n onBlockReset={onBlockReset}\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","onBlockReset","chapterPageRef","bannerRef","coreBlocksRef","canStartJourney","canStartChallengeArenaJourney","canStartDownloadNodeJourney","canStartDownloadBlockJourney","isJourneyActive","useJourney","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","challengeBlockRef","startChallengeArenaJourney","useChallengeArenaJourney","downloadBlockRef","downloadCoreBlockRef","startDownloadNodeJourney","useDownloadNodeJourney","downloadBlockSectionRef","startDownloadBlockJourney","useDownloadBlockJourney","hasDownloadBlock","useMemo","getHasDownloadBlock","hasNonDownloadBlockWithPdfNode","getHasNonDownloadBlockWithPdfNode","activeDownloadBlockRef","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","Fragment","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,MAAMA,KAAsCC,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,cAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,+BAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,8BAAAC;AAAA,EACE,IAAAvB,GAEE,EAAE,iBAAAwB,MAAoBC,KACtB;AAAA,IACJ,KAAKC;AAAA,IACL,MAAMC;AAAA,IACN,cAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,SAAAC;AAAA,MACEC,GAAqB,GAEnBC,IAAsBC,EAAY,MAAM;AAC5C,IAAAP,EAAkBzB,GAAe,QAAW,EAAE,WAAAC,EAAW,CAAA;AAAA,EACxD,GAAA,CAACwB,GAAmBzB,GAAeC,CAAS,CAAC;AAEhD,EAAAgC,EAAU,MAAM;AACM,IAAAF;EAAA,GACnB,CAACA,CAAmB,CAAC;AAExB,QAAM,EAAE,iBAAiBG,GAAmB,cAAcC,EAAA,IACxDC,KAEI;AAAA,IACJ,iBAAiBC;AAAA,IACjB,sBAAAC;AAAA,IAC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KAAA,gBAAAA,EAAgB;AAAA,cAC/B,WAAAT;AAAA,YAAA;AAAA,UACF;AAAA,UACA,gBAAAmC;AAAA,YAACa;AAAA,YAAA;AAAA,cACC,UAAUvC,EAAe;AAAA,cACzB,UAAAxB;AAAA,cACA,QAAQwB,EAAe;AAAA,cACvB,mBAAAvB;AAAA,cACA,eAAAC;AAAA,cACA,wBAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,eAAAS;AAAA,cACA,mBAAAgB;AAAA,cACA,sBAAAI;AAAA,cACA,kBAAkBW;AAAA,cAClB,gBAAAtC;AAAA,cACA,cAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,cAAAE;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC,GAEDmD,KAAerE;"}
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 { useChallengeArenaJourney } from '../../journey/hooks/use-chapter-page-journey/use-challenge-arena-journey';\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 onBlockReset,\n chapterPageRef,\n bannerRef,\n coreBlocksRef,\n canStartJourney,\n canStartChallengeArenaJourney,\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 const { blockSectionRef, startJourney: startChallengeArenaJourney } = useChallengeArenaJourney();\n\n useEffect(() => {\n if (chapterDetails && canStartJourney && !isJourneyActive && startChapterPageJourney) {\n startChapterPageJourney({\n chapterDetails: chapterDetails,\n userChapterId,\n studentId,\n userType,\n });\n }\n\n if (chapterDetails && !canStartJourney && canStartChallengeArenaJourney && !isJourneyActive) {\n startChallengeArenaJourney({\n chapterDetails,\n userType,\n });\n }\n }, [\n canStartChallengeArenaJourney,\n canStartJourney,\n chapterDetails,\n isJourneyActive,\n startChallengeArenaJourney,\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=\"100vh\" />;\n }\n\n return (\n <Styled.ContentWrapper\n ref={chapterPageRef}\n $widthX={50}\n $disablePointerEvents={isProcessing}\n $justifyContent=\"center\"\n $alignItems=\"center\"\n $height=\"max-content\"\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 blockSectionRef={blockSectionRef}\n onNodeUnassign={onNodeUnassign}\n onNodeUnlock={onNodeUnlock}\n onNodeSkipUnSkip={onNodeSkipUnSkip}\n onBlockReset={onBlockReset}\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","onBlockReset","chapterPageRef","bannerRef","coreBlocksRef","canStartJourney","canStartChallengeArenaJourney","isJourneyActive","useJourney","getChapterDetails","chapterDetails","isProcessing","isProcessingFailed","isStale","useGetChapterDetails","fetchChapterDetails","useCallback","useEffect","blockSectionRef","startChallengeArenaJourney","useChallengeArenaJourney","jsxs","FlexView","jsx","Text","Button","AppLoader","Styled.ContentWrapper","Styled.BackButtonContainer","Styled.BackButtonWrapper","IconButton","Back2Icon","Styled.LoaderWrapper","ILLUSTRATIONS","Fragment","ChapterBanner","BlockSections","ChapterDetails$1"],"mappings":";;;;;;;;;;;;;;;AAmBA,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,cAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,+BAAAC;AAAA,EACE,IAAArB,GACE,EAAE,iBAAAsB,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,EAAkBvB,GAAe,QAAW,EAAE,WAAAC,EAAW,CAAA;AAAA,EACxD,GAAA,CAACsB,GAAmBvB,GAAeC,CAAS,CAAC;AAEhD,EAAA8B,EAAU,MAAM;AACM,IAAAF;EAAA,GACnB,CAACA,CAAmB,CAAC;AAExB,QAAM,EAAE,iBAAAG,GAAiB,cA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UAAA,gBAAAL,EAACM,GAAA,EACC,UAAA,gBAAAN;AAAA,UAACO;AAAA,UAAA;AAAA,YACC,MAAMC;AAAA,YACN,UAAS;AAAA,YACT,gBAAe;AAAA,YACf,MAAK;AAAA,YACL,SAASnC;AAAA,UAAA;AAAA,WAEb,EACF,CAAA;AAAA,QAGDe,KACC,gBAAAY,EAACS,GAAA,EACC,UAAA,gBAAAT,EAAC,OAAI,EAAA,KAAKU,EAAc,UAAU,KAAI,SAAA,CAAS,EACjD,CAAA;AAAA,QAGDvB,KAEG,gBAAAW,EAAAa,GAAA,EAAA,UAAA;AAAA,UAAA,gBAAAX;AAAA,YAACY;AAAA,YAAA;AAAA,cACC,OAAOzB,EAAe;AAAA,cACtB,UAAUA,EAAe;AAAA,cACzB,UAAUA,EAAe;AAAA,cACzB,eAAeA,KAAA,gBAAAA,EAAgB;AAAA,cAC/B,WAAAP;AAAA,YAAA;AAAA,UACF;AAAA,UACA,gBAAAoB;AAAA,YAACa;AAAA,YAAA;AAAA,cACC,UAAU1B,EAAe;AAAA,cACzB,UAAAtB;AAAA,cACA,QAAQsB,EAAe;AAAA,cACvB,mBAAArB;AAAA,cACA,eAAAC;AAAA,cACA,wBAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,iBAAAC;AAAA,cACA,cAAAC;AAAA,cACA,YAAAC;AAAA,cACA,eAAAS;AAAA,cACA,iBAAAc;AAAA,cACA,gBAAArB;AAAA,cACA,cAAAC;AAAA,cACA,kBAAAC;AAAA,cACA,cAAAE;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC,GAEDoC,KAAetD;"}
@@ -1,9 +1,9 @@
1
1
  import { ILLUSTRATIONS as e } from "../../../assets/illustrations/illustrations.js";
2
- const S = (E) => {
2
+ const A = (E) => {
3
3
  if (!E) return 0;
4
- const { mandatory: _ } = E, { completed: t, total: c } = _;
5
- return c === 0 ? 0 : Math.floor(t / c * 100);
6
- }, A = (E) => {
4
+ const { mandatory: c } = E, { completed: S, total: _ } = c;
5
+ return _ === 0 ? 0 : Math.floor(S / _ * 100);
6
+ }, r = (E) => {
7
7
  switch (E) {
8
8
  case "LEVEL2":
9
9
  case "LEVEL3":
@@ -52,24 +52,20 @@ const S = (E) => {
52
52
  default:
53
53
  return e.NODE_PROJECT_BG;
54
54
  }
55
- }, r = ({
55
+ }, t = ({
56
56
  isSkipped: E,
57
- sheetsLength: _,
58
- isGoalBlock: t,
59
- lessonIdx: c,
60
- isSatMockTestBlock: a
57
+ sheetsLength: c,
58
+ isGoalBlock: S,
59
+ lessonIdx: _,
60
+ isSatMockTestBlock: T
61
61
  }) => {
62
- if (!t && !a) return `(${_})`;
63
- if (!(E || !c))
64
- return `${c}`;
65
- }, T = (E) => E.some(
66
- (_) => _.block_type !== "DOWNLOADS" && _.sheets.some((t) => t.node_type === "PDF")
67
- ), N = (E) => E.some((_) => _.block_type === "DOWNLOADS");
62
+ if (!S && !T) return `(${c})`;
63
+ if (!(E || !_))
64
+ return `${_}`;
65
+ };
68
66
  export {
69
- S as getChapterCompletionPercentage,
70
- N as getHasDownloadBlock,
71
- T as getHasNonDownloadBlockWithPdfNode,
72
- A as getNodeTypeBasedBgImage,
73
- r as getSheetNLessonCount
67
+ A as getChapterCompletionPercentage,
68
+ r as getNodeTypeBasedBgImage,
69
+ t as getSheetNLessonCount
74
70
  };
75
71
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/features/chapters-v2/utils/index.ts"],"sourcesContent":["import type {\n IChapterBlockData,\n IChapterProgressStats,\n} from '../chapter-details/chapter-details-types';\nimport type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\n// This function calculates the completion percentage of a chapter based on progress stats.\n// If no progress stats are provided, it returns 0.\n// It uses the `mandatory` field from the progress stats to determine the completed and total items.\n// It returns an integer representing the percentage of completion, rounded down to the nearest whole number.\nconst getChapterCompletionPercentage = (progressStats: IChapterProgressStats | null) => {\n if (!progressStats) return 0;\n\n const { mandatory } = progressStats;\n const { completed, total } = mandatory;\n\n if (total === 0) {\n return 0;\n }\n\n const percentage = Math.floor((completed / total) * 100);\n\n return percentage;\n};\n\nconst getNodeTypeBasedBgImage = (nodeType: INodeDataProps['node_type']) => {\n switch (nodeType) {\n case 'LEVEL2':\n case 'LEVEL3':\n case 'HIDDEN_BASIC':\n return ILLUSTRATIONS.NODE_TEST_PREP_BG;\n case 'LEARNING':\n case 'SAT_MATH_LEARNING':\n case 'SAT_ENGLISH_LEARNING':\n return ILLUSTRATIONS.NODE_LEARN_BG;\n case 'RECAP':\n case 'REMEDIAL':\n case 'REVISION':\n case 'PPT_BASIC':\n case 'SAT_MATH_RECAP':\n case 'SAT_ENGLISH_RECAP':\n return ILLUSTRATIONS.NODE_RECAP_BG;\n\n case 'DYNAMIC':\n case 'ASSESSMENT':\n case 'CHAPTER_ASSESSMENT':\n case 'DIAGNOSTIC':\n case 'TURING_ASSESSMENT':\n return ILLUSTRATIONS.NODE_CUSTOM_TEST_BG;\n\n case 'PRACTICE':\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'MASTERY':\n case 'TURING_PRACTICE':\n case 'SAT_MATH_ASSESSMENT':\n case 'SAT_ENGLISH_ASSESSMENT':\n return ILLUSTRATIONS.NODE_PRACTICE_BG;\n\n case 'PUZZLE':\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n return ILLUSTRATIONS.NODE_PUZZLE_BG;\n\n case 'TURING_SUBJECTIVE':\n return ILLUSTRATIONS.NODE_SUBJECTIVE_BG;\n\n case 'TURING_BASIC':\n case 'PYTHON_BASIC':\n case 'PYTHON_VISUAL':\n return ILLUSTRATIONS.NODE_ACTIVITY_BG;\n\n case 'VIDEO':\n return ILLUSTRATIONS.NODE_VIDEO_BG;\n\n case 'PDF':\n return ILLUSTRATIONS.NODE_DOWNLOAD_BG;\n\n default:\n return ILLUSTRATIONS.NODE_PROJECT_BG;\n }\n};\n\ninterface IGetSheetNLessonCountParams {\n isSkipped: boolean;\n sheetsLength: number;\n isGoalBlock?: boolean;\n lessonIdx?: number;\n isSatMockTestBlock?: boolean;\n}\n\nconst getSheetNLessonCount = ({\n isSkipped,\n sheetsLength,\n isGoalBlock,\n lessonIdx,\n isSatMockTestBlock,\n}: IGetSheetNLessonCountParams) => {\n if (!isGoalBlock && !isSatMockTestBlock) return `(${sheetsLength})`;\n\n if (isSkipped || !lessonIdx) return undefined;\n\n return `${lessonIdx}`;\n};\n\nconst getHasNonDownloadBlockWithPdfNode = (blocks: IChapterBlockData[]) => {\n return blocks.some(\n blockInfo =>\n blockInfo.block_type !== 'DOWNLOADS' &&\n blockInfo.sheets.some(sheetInfo => sheetInfo.node_type === 'PDF'),\n );\n};\n\nconst getHasDownloadBlock = (blocks: IChapterBlockData[]) => {\n return blocks.some(blockInfo => blockInfo.block_type === 'DOWNLOADS');\n};\n\nexport {\n getChapterCompletionPercentage,\n getNodeTypeBasedBgImage,\n getSheetNLessonCount,\n getHasNonDownloadBlockWithPdfNode,\n getHasDownloadBlock,\n};\n"],"names":["getChapterCompletionPercentage","progressStats","mandatory","completed","total","getNodeTypeBasedBgImage","nodeType","ILLUSTRATIONS","getSheetNLessonCount","isSkipped","sheetsLength","isGoalBlock","lessonIdx","isSatMockTestBlock","getHasNonDownloadBlockWithPdfNode","blocks","blockInfo","sheetInfo","getHasDownloadBlock"],"mappings":";AAYM,MAAAA,IAAiC,CAACC,MAAgD;AAClF,MAAA,CAACA,EAAsB,QAAA;AAErB,QAAA,EAAE,WAAAC,EAAc,IAAAD,GAChB,EAAE,WAAAE,GAAW,OAAAC,EAAU,IAAAF;AAE7B,SAAIE,MAAU,IACL,IAGU,KAAK,MAAOD,IAAYC,IAAS,GAAG;AAGzD,GAEMC,IAA0B,CAACC,MAA0C;AACzE,UAAQA,GAAU;AAAA,IACh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,CAAaC,MAAAA,EAAU,eAAe,WAAW;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/features/chapters-v2/utils/index.ts"],"sourcesContent":["import type { IChapterProgressStats } from '../chapter-details/chapter-details-types';\nimport type { INodeDataProps } from '../comps/node-card/node-card-types';\n\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\n// This function calculates the completion percentage of a chapter based on progress stats.\n// If no progress stats are provided, it returns 0.\n// It uses the `mandatory` field from the progress stats to determine the completed and total items.\n// It returns an integer representing the percentage of completion, rounded down to the nearest whole number.\nconst getChapterCompletionPercentage = (progressStats: IChapterProgressStats | null) => {\n if (!progressStats) return 0;\n\n const { mandatory } = progressStats;\n const { completed, total } = mandatory;\n\n if (total === 0) {\n return 0;\n }\n\n const percentage = Math.floor((completed / total) * 100);\n\n return percentage;\n};\n\nconst getNodeTypeBasedBgImage = (nodeType: INodeDataProps['node_type']) => {\n switch (nodeType) {\n case 'LEVEL2':\n case 'LEVEL3':\n case 'HIDDEN_BASIC':\n return ILLUSTRATIONS.NODE_TEST_PREP_BG;\n case 'LEARNING':\n case 'SAT_MATH_LEARNING':\n case 'SAT_ENGLISH_LEARNING':\n return ILLUSTRATIONS.NODE_LEARN_BG;\n case 'RECAP':\n case 'REMEDIAL':\n case 'REVISION':\n case 'PPT_BASIC':\n case 'SAT_MATH_RECAP':\n case 'SAT_ENGLISH_RECAP':\n return ILLUSTRATIONS.NODE_RECAP_BG;\n\n case 'DYNAMIC':\n case 'ASSESSMENT':\n case 'CHAPTER_ASSESSMENT':\n case 'DIAGNOSTIC':\n case 'TURING_ASSESSMENT':\n return ILLUSTRATIONS.NODE_CUSTOM_TEST_BG;\n\n case 'PRACTICE':\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'MASTERY':\n case 'TURING_PRACTICE':\n case 'SAT_MATH_ASSESSMENT':\n case 'SAT_ENGLISH_ASSESSMENT':\n return ILLUSTRATIONS.NODE_PRACTICE_BG;\n\n case 'PUZZLE':\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n return ILLUSTRATIONS.NODE_PUZZLE_BG;\n\n case 'TURING_SUBJECTIVE':\n return ILLUSTRATIONS.NODE_SUBJECTIVE_BG;\n\n case 'TURING_BASIC':\n case 'PYTHON_BASIC':\n case 'PYTHON_VISUAL':\n return ILLUSTRATIONS.NODE_ACTIVITY_BG;\n\n case 'VIDEO':\n return ILLUSTRATIONS.NODE_VIDEO_BG;\n\n case 'PDF':\n return ILLUSTRATIONS.NODE_DOWNLOAD_BG;\n\n default:\n return ILLUSTRATIONS.NODE_PROJECT_BG;\n }\n};\n\ninterface IGetSheetNLessonCountParams {\n isSkipped: boolean;\n sheetsLength: number;\n isGoalBlock?: boolean;\n lessonIdx?: number;\n isSatMockTestBlock?: boolean;\n}\n\nconst getSheetNLessonCount = ({\n isSkipped,\n sheetsLength,\n isGoalBlock,\n lessonIdx,\n isSatMockTestBlock,\n}: IGetSheetNLessonCountParams) => {\n if (!isGoalBlock && !isSatMockTestBlock) return `(${sheetsLength})`;\n\n if (isSkipped || !lessonIdx) return undefined;\n\n return `${lessonIdx}`;\n};\n\nexport { getChapterCompletionPercentage, getNodeTypeBasedBgImage, getSheetNLessonCount };\n"],"names":["getChapterCompletionPercentage","progressStats","mandatory","completed","total","getNodeTypeBasedBgImage","nodeType","ILLUSTRATIONS","getSheetNLessonCount","isSkipped","sheetsLength","isGoalBlock","lessonIdx","isSatMockTestBlock"],"mappings":";AASM,MAAAA,IAAiC,CAACC,MAAgD;AAClF,MAAA,CAACA,EAAsB,QAAA;AAErB,QAAA,EAAE,WAAAC,EAAc,IAAAD,GAChB,EAAE,WAAAE,GAAW,OAAAC,EAAU,IAAAF;AAE7B,SAAIE,MAAU,IACL,IAGU,KAAK,MAAOD,IAAYC,IAAS,GAAG;AAGzD,GAEMC,IAA0B,CAACC,MAA0C;AACzE,UAAQA,GAAU;AAAA,IAChB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOC,EAAc;AAAA,IACvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IACvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB,KAAK;AACH,aAAOA,EAAc;AAAA,IAEvB;AACE,aAAOA,EAAc;AAAA,EACzB;AACF,GAUMC,IAAuB,CAAC;AAAA,EAC5B,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,oBAAAC;AACF,MAAmC;AACjC,MAAI,CAACF,KAAe,CAACE,EAAoB,QAAO,IAAIH,CAAY;AAE5D,MAAA,EAAAD,KAAa,CAACG;AAElB,WAAO,GAAGA,CAAS;AACrB;"}
@@ -1,10 +1,10 @@
1
- import { createGetAPI as i } from "@cuemath/rest-api";
2
- import { BASE_URL as r } from "./constants.js";
3
- const { useGet: a, invalidate: c } = i({
4
- getURL: (o, { user_id: e, grade: t }) => `${r}/circle-home/?intelenrollment_id=${e}&grade=${t}`
1
+ import { createGetAPI as r } from "@cuemath/rest-api";
2
+ import { BASE_URL as i } from "./constants.js";
3
+ const { useGet: n, invalidate: a } = r({
4
+ getURL: (c, { user_id: e, country_code: t, grade: o }) => `${i}/circle-home/?intelenrollment_id=${e}&country_code=${t}&grade=${o}`
5
5
  });
6
6
  export {
7
- c as invalidateCircleHomeAPI,
8
- a as useGetCircleHomeAPI
7
+ a as invalidateCircleHomeAPI,
8
+ n as useGetCircleHomeAPI
9
9
  };
10
10
  //# sourceMappingURL=get-circle-home-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-circle-home-api.js","sources":["../../../../../../src/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.ts"],"sourcesContent":["import type {\n IGetCircleHomeResponseModel,\n IGetCircleHomePayloadModel,\n} from './get-circle-home-api-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL } from './constants';\n\nexport const { useGet: useGetCircleHomeAPI, invalidate: invalidateCircleHomeAPI } = createGetAPI<\n IGetCircleHomeResponseModel,\n IGetCircleHomePayloadModel\n>({\n getURL: (_, { user_id, grade }) =>\n `${BASE_URL}/circle-home/?intelenrollment_id=${user_id}&grade=${grade}`,\n});\n"],"names":["useGetCircleHomeAPI","invalidateCircleHomeAPI","createGetAPI","_","user_id","grade","BASE_URL"],"mappings":";;AASO,MAAM,EAAE,QAAQA,GAAqB,YAAYC,EAAA,IAA4BC,EAGlF;AAAA,EACA,QAAQ,CAACC,GAAG,EAAE,SAAAC,GAAS,OAAAC,EACrB,MAAA,GAAGC,CAAQ,oCAAoCF,CAAO,UAAUC,CAAK;AACzE,CAAC;"}
1
+ {"version":3,"file":"get-circle-home-api.js","sources":["../../../../../../src/features/circle-games/game-launcher/api/get-content-for-today/get-circle-home-api.ts"],"sourcesContent":["import type {\n IGetCircleHomeResponseModel,\n IGetCircleHomePayloadModel,\n} from './get-circle-home-api-types';\n\nimport { createGetAPI } from '@cuemath/rest-api';\n\nimport { BASE_URL } from './constants';\n\nexport const { useGet: useGetCircleHomeAPI, invalidate: invalidateCircleHomeAPI } = createGetAPI<\n IGetCircleHomeResponseModel,\n IGetCircleHomePayloadModel\n>({\n getURL: (_, { user_id, country_code, grade }) =>\n `${BASE_URL}/circle-home/?intelenrollment_id=${user_id}&country_code=${country_code}&grade=${grade}`,\n});\n"],"names":["useGetCircleHomeAPI","invalidateCircleHomeAPI","createGetAPI","_","user_id","country_code","grade","BASE_URL"],"mappings":";;AASO,MAAM,EAAE,QAAQA,GAAqB,YAAYC,EAAA,IAA4BC,EAGlF;AAAA,EACA,QAAQ,CAACC,GAAG,EAAE,SAAAC,GAAS,cAAAC,GAAc,OAAAC,EAAA,MACnC,GAAGC,CAAQ,oCAAoCH,CAAO,iBAAiBC,CAAY,UAAUC,CAAK;AACtG,CAAC;"}