@cuemath/leap 3.3.29-beta.0 → 3.3.29

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 (182) hide show
  1. package/dist/assets/line-icons/icons/chevron-right.js.map +1 -1
  2. package/dist/features/auth/pla-signup/pla-analytics-events.js +3 -9
  3. package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
  4. package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -1
  5. package/dist/features/auth/signup/custom-input-field/custom-input-field.js +8 -8
  6. package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
  7. package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js +43 -34
  8. package/dist/features/chapters-v2/chapter-details/block-sections/block-sections.js.map +1 -1
  9. package/dist/features/chapters-v2/chapter-details/chapter-details.js +140 -101
  10. package/dist/features/chapters-v2/chapter-details/chapter-details.js.map +1 -1
  11. package/dist/features/chapters-v2/utils/index.js +20 -16
  12. package/dist/features/chapters-v2/utils/index.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/hooks/use-chapter-page-journey/use-download-block-journey.js +86 -0
  17. package/dist/features/journey/hooks/use-chapter-page-journey/use-download-block-journey.js.map +1 -0
  18. package/dist/features/journey/hooks/use-chapter-page-journey/use-download-node-journey.js +140 -0
  19. package/dist/features/journey/hooks/use-chapter-page-journey/use-download-node-journey.js.map +1 -0
  20. package/dist/features/journey/journey-id/journey-id-student.js +1 -1
  21. package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
  22. package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
  23. package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
  24. package/dist/features/journey/mocks/chapter-page-journey-mock-data.js +400 -0
  25. package/dist/features/journey/mocks/chapter-page-journey-mock-data.js.map +1 -1
  26. package/dist/features/milestone/create/comps/goal-completion-date-selector/goal-completion-date-selector.js +6 -6
  27. package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js +2 -2
  28. package/dist/features/milestone/create/milestone-create-helpers.js +7 -13
  29. package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
  30. package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js +22 -28
  31. package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js.map +1 -1
  32. package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js +1 -1
  33. package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js.map +1 -1
  34. package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +46 -48
  35. package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
  36. package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +3 -3
  37. package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +1 -1
  38. package/dist/features/parent-dashboard/parent-dashboard-constants.js +4 -45
  39. package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +1 -1
  40. package/dist/features/parent-dashboard/parent-dashboard-types.js +3 -3
  41. package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
  42. package/dist/features/parent-dashboard/parent-dashboard-view.js +173 -197
  43. package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
  44. package/dist/features/student-details/class-details/class-details-utils.js +6 -6
  45. package/dist/features/trial-session/comps/class-preference/class-preference.js +49 -61
  46. package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
  47. package/dist/features/trial-session/comps/navigation-bar/index.js +24 -24
  48. package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
  49. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps-constants.js +1 -1
  50. package/dist/features/trial-session/comps/pla/next-steps/next-steps-constants.js.map +1 -0
  51. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps-styled.js +1 -1
  52. package/dist/features/trial-session/comps/pla/next-steps/next-steps-styled.js.map +1 -0
  53. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps.js +5 -5
  54. package/dist/features/trial-session/comps/pla/next-steps/next-steps.js.map +1 -0
  55. package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js +29 -0
  56. package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js.map +1 -0
  57. package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js +132 -0
  58. package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js.map +1 -0
  59. package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js +11 -0
  60. package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js.map +1 -0
  61. package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js +19 -0
  62. package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js.map +1 -0
  63. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/session-status/session-status-styled.js +2 -2
  64. package/dist/features/trial-session/comps/pla/session-status/session-status-styled.js.map +1 -0
  65. package/dist/features/trial-session/comps/pla/session-status/session-status.js +127 -0
  66. package/dist/features/trial-session/comps/pla/session-status/session-status.js.map +1 -0
  67. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/session-summary/session-summary-constants.js +2 -2
  68. package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js.map +1 -0
  69. package/dist/features/trial-session/comps/pla/session-summary/session-summary.js +53 -0
  70. package/dist/features/trial-session/comps/pla/session-summary/session-summary.js.map +1 -0
  71. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/session-summary/summary-card/summary-card-styled.js +1 -1
  72. package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card-styled.js.map +1 -0
  73. package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js +56 -0
  74. package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js.map +1 -0
  75. package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-constants.js.map +1 -0
  76. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-styled.js +1 -1
  77. package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-styled.js.map +1 -0
  78. package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types.js.map +1 -0
  79. package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions.js +14 -14
  80. package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js.map +1 -0
  81. package/dist/features/trial-session/comps/school-goals/school-goals.js +50 -51
  82. package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
  83. package/dist/features/trial-session/comps/session-report/session-report.js +15 -15
  84. package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
  85. package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +38 -39
  86. package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
  87. package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js +0 -5
  88. package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js.map +1 -1
  89. package/dist/features/trial-session/comps/student-feedback/student-feedback.js +51 -96
  90. package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
  91. package/dist/features/trial-session/comps/student-profile/student-profile.js +63 -70
  92. package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
  93. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +44 -43
  94. package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -1
  95. package/dist/features/trial-session/comps/test-prep/test-prep.js +39 -40
  96. package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
  97. package/dist/features/trial-session/helper.js +53 -69
  98. package/dist/features/trial-session/helper.js.map +1 -1
  99. package/dist/features/trial-session/hooks/use-trial-session-navigation.js +130 -150
  100. package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
  101. package/dist/features/trial-session/trial-session-types.js.map +1 -1
  102. package/dist/features/trial-session/trial-session-view.js +112 -103
  103. package/dist/features/trial-session/trial-session-view.js.map +1 -1
  104. package/dist/features/utils/utils.js +1 -1
  105. package/dist/features/utils/utils.js.map +1 -1
  106. package/dist/index.d.ts +83 -77
  107. package/dist/index.js +309 -310
  108. package/dist/node_modules/date-fns/_lib/getRoundingMethod.js +10 -0
  109. package/dist/node_modules/date-fns/_lib/getRoundingMethod.js.map +1 -0
  110. package/dist/node_modules/date-fns/differenceInMilliseconds.js +9 -0
  111. package/dist/node_modules/date-fns/differenceInMilliseconds.js.map +1 -0
  112. package/dist/node_modules/date-fns/differenceInSeconds.js +11 -0
  113. package/dist/node_modules/date-fns/differenceInSeconds.js.map +1 -0
  114. package/package.json +3 -2
  115. package/dist/features/parent-dashboard/api/cancel-subscription.js +0 -9
  116. package/dist/features/parent-dashboard/api/cancel-subscription.js.map +0 -1
  117. package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js +0 -20
  118. package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js.map +0 -1
  119. package/dist/features/parent-dashboard/comps/billing-information/billing-information.js +0 -96
  120. package/dist/features/parent-dashboard/comps/billing-information/billing-information.js.map +0 -1
  121. package/dist/features/parent-dashboard/comps/next-steps/next-steps-constants.js.map +0 -1
  122. package/dist/features/parent-dashboard/comps/next-steps/next-steps-styled.js.map +0 -1
  123. package/dist/features/parent-dashboard/comps/next-steps/next-steps.js.map +0 -1
  124. package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js +0 -34
  125. package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js.map +0 -1
  126. package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js +0 -137
  127. package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js.map +0 -1
  128. package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js +0 -20
  129. package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js.map +0 -1
  130. package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js +0 -19
  131. package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js.map +0 -1
  132. package/dist/features/parent-dashboard/comps/session-status/session-status-styled.js.map +0 -1
  133. package/dist/features/parent-dashboard/comps/session-status/session-status.js +0 -124
  134. package/dist/features/parent-dashboard/comps/session-status/session-status.js.map +0 -1
  135. package/dist/features/parent-dashboard/comps/session-summary/session-summary-constants.js.map +0 -1
  136. package/dist/features/parent-dashboard/comps/session-summary/session-summary.js +0 -53
  137. package/dist/features/parent-dashboard/comps/session-summary/session-summary.js.map +0 -1
  138. package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card-styled.js.map +0 -1
  139. package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js +0 -63
  140. package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js.map +0 -1
  141. package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-constants.js.map +0 -1
  142. package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-styled.js.map +0 -1
  143. package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-types.js.map +0 -1
  144. package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions.js.map +0 -1
  145. package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js +0 -21
  146. package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js.map +0 -1
  147. package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js +0 -85
  148. package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js.map +0 -1
  149. package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js +0 -23
  150. package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js.map +0 -1
  151. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js +0 -55
  152. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js.map +0 -1
  153. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js +0 -59
  154. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js.map +0 -1
  155. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js +0 -93
  156. package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js.map +0 -1
  157. package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js +0 -66
  158. package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js.map +0 -1
  159. package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js +0 -76
  160. package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js.map +0 -1
  161. package/dist/features/student-username/add/add-student-username-constants.js +0 -6
  162. package/dist/features/student-username/add/add-student-username-constants.js.map +0 -1
  163. package/dist/features/student-username/add/add-student-username-helpers.js +0 -6
  164. package/dist/features/student-username/add/add-student-username-helpers.js.map +0 -1
  165. package/dist/features/student-username/add/add-student-username-styled.js +0 -10
  166. package/dist/features/student-username/add/add-student-username-styled.js.map +0 -1
  167. package/dist/features/student-username/add/add-student-username.js +0 -78
  168. package/dist/features/student-username/add/add-student-username.js.map +0 -1
  169. package/dist/features/student-username/add/api/update-username.js +0 -9
  170. package/dist/features/student-username/add/api/update-username.js.map +0 -1
  171. package/dist/features/student-username/add/api/username-availability.js +0 -10
  172. package/dist/features/student-username/add/api/username-availability.js.map +0 -1
  173. package/dist/features/student-username/add/hooks/use-check-username-availability.js +0 -41
  174. package/dist/features/student-username/add/hooks/use-check-username-availability.js.map +0 -1
  175. package/dist/features/trial-session/api/teacher-availability.js +0 -9
  176. package/dist/features/trial-session/api/teacher-availability.js.map +0 -1
  177. package/dist/features/trial-session/comps/class-preference/helpers.js +0 -28
  178. package/dist/features/trial-session/comps/class-preference/helpers.js.map +0 -1
  179. package/dist/features/trial-session/hooks/use-slide-config-update.js +0 -49
  180. package/dist/features/trial-session/hooks/use-slide-config-update.js.map +0 -1
  181. /package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-constants.js +0 -0
  182. /package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-types.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,5 +1,5 @@
1
1
  import { PLUGINS as _ } from "../../../node_modules/@cuemath/analytics-v2/dist/constants.js";
2
- var t = /* @__PURE__ */ ((e) => (e.START_SIGNUP_CTA_CLICKED = "start_signup_cta_clicked", e.ECNA_STEP_VIEWED = "ecna_step_viewed", e.ECNA_RESPONSE_RECORDED_DEBUG = "ecna_response_recorded_debug", e.PARENT_SIGNUP_CTA_CLICKED = "parent_signup_cta_clicked", e.PARENT_SIGNUP_SUCCESSFUL = "parent_signup_successful", e.PARENT_SIGNUP_FAILED = "parent_signup_failed", e.STUDENT_SIGNUP_SUCCESSFUL = "signup_successful", e.STUDENT_SIGNUP_FAILED = "signup_failed", e.SIGNUP_OTP_ENTERED = "signup_otp_entered", e.SIGNUP_OTP_VERIFIED = "signup_otp_verified", e.SIGNUP_OTP_FAILED = "signup_otp_failed", e.SLOTS_SHOWN = "slots_shown", e.SLOT_DATE_SELECTED = "slot_date_selected", e.SLOT_TIME_SELECTED = "slot_time_selected", e.TUTOR_CHANGE_REASON_SELECTED = "tutor_change_reason_selected", e.SUBSCRIPTION_INTENT_FAILED = "subscription_intent_failed", e.SUBSCRIPTION_INTENT_CREATED = "subscription_intent_created", e.STRIPE_PAYMENT_ELEMENT_READY = "stripe_payment_element_ready", e.STRIPE_PAYMENT_FAILED = "stripe_payment_failed", e.STRIPE_PAYMENT_SUCCESS = "stripe_payment_success", e.PAYMENT_PLAN_SELECTED = "payment_plan_selected", e))(t || {});
2
+ var s = /* @__PURE__ */ ((e) => (e.START_SIGNUP_CTA_CLICKED = "start_signup_cta_clicked", e.ECNA_STEP_VIEWED = "ecna_step_viewed", e.ECNA_RESPONSE_RECORDED_DEBUG = "ecna_response_recorded_debug", e.PARENT_SIGNUP_CTA_CLICKED = "parent_signup_cta_clicked", e.PARENT_SIGNUP_SUCCESSFUL = "parent_signup_successful", e.PARENT_SIGNUP_FAILED = "parent_signup_failed", e.STUDENT_SIGNUP_SUCCESSFUL = "signup_successful", e.STUDENT_SIGNUP_FAILED = "signup_failed", e.SIGNUP_OTP_ENTERED = "signup_otp_entered", e.SIGNUP_OTP_VERIFIED = "signup_otp_verified", e.SIGNUP_OTP_FAILED = "signup_otp_failed", e.SLOTS_SHOWN = "slots_shown", e.SLOT_DATE_SELECTED = "slot_date_selected", e.SLOT_TIME_SELECTED = "slot_time_selected", e.TUTOR_CHANGE_REASON_SELECTED = "tutor_change_reason_selected", e))(s || {});
3
3
  const n = {
4
4
  start_signup_cta_clicked: [_.MIXPANEL],
5
5
  ecna_step_viewed: [_.MIXPANEL],
@@ -15,16 +15,10 @@ const n = {
15
15
  slots_shown: [_.MIXPANEL],
16
16
  slot_date_selected: [_.MIXPANEL],
17
17
  slot_time_selected: [_.MIXPANEL],
18
- tutor_change_reason_selected: [_.MIXPANEL],
19
- subscription_intent_failed: [_.MIXPANEL],
20
- subscription_intent_created: [_.MIXPANEL],
21
- stripe_payment_element_ready: [_.MIXPANEL],
22
- stripe_payment_failed: [_.MIXPANEL],
23
- stripe_payment_success: [_.MIXPANEL],
24
- payment_plan_selected: [_.MIXPANEL]
18
+ tutor_change_reason_selected: [_.MIXPANEL]
25
19
  };
26
20
  export {
27
- t as PLA_ANALYTICS_EVENTS,
21
+ s as PLA_ANALYTICS_EVENTS,
28
22
  n as PLA_ANALYTICS_WHITELIST_EVENTS
29
23
  };
30
24
  //# sourceMappingURL=pla-analytics-events.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pla-analytics-events.js","sources":["../../../../src/features/auth/pla-signup/pla-analytics-events.ts"],"sourcesContent":["import { PLUGINS } from '@cuemath/analytics-v2/dist/constants';\n\nexport enum PLA_ANALYTICS_EVENTS {\n START_SIGNUP_CTA_CLICKED = 'start_signup_cta_clicked',\n ECNA_STEP_VIEWED = 'ecna_step_viewed',\n ECNA_RESPONSE_RECORDED_DEBUG = 'ecna_response_recorded_debug',\n PARENT_SIGNUP_CTA_CLICKED = 'parent_signup_cta_clicked',\n PARENT_SIGNUP_SUCCESSFUL = 'parent_signup_successful',\n PARENT_SIGNUP_FAILED = 'parent_signup_failed',\n STUDENT_SIGNUP_SUCCESSFUL = 'signup_successful',\n STUDENT_SIGNUP_FAILED = 'signup_failed',\n SIGNUP_OTP_ENTERED = 'signup_otp_entered',\n SIGNUP_OTP_VERIFIED = 'signup_otp_verified',\n SIGNUP_OTP_FAILED = 'signup_otp_failed',\n SLOTS_SHOWN = 'slots_shown',\n SLOT_DATE_SELECTED = 'slot_date_selected',\n SLOT_TIME_SELECTED = 'slot_time_selected',\n TUTOR_CHANGE_REASON_SELECTED = 'tutor_change_reason_selected',\n SUBSCRIPTION_INTENT_FAILED = 'subscription_intent_failed',\n SUBSCRIPTION_INTENT_CREATED = 'subscription_intent_created',\n STRIPE_PAYMENT_ELEMENT_READY = 'stripe_payment_element_ready',\n STRIPE_PAYMENT_FAILED = 'stripe_payment_failed',\n STRIPE_PAYMENT_SUCCESS = 'stripe_payment_success',\n PAYMENT_PLAN_SELECTED = 'payment_plan_selected',\n}\n\nexport const PLA_ANALYTICS_WHITELIST_EVENTS = {\n [PLA_ANALYTICS_EVENTS.START_SIGNUP_CTA_CLICKED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.ECNA_STEP_VIEWED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.ECNA_RESPONSE_RECORDED_DEBUG]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_CTA_CLICKED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_SUCCESSFUL]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STUDENT_SIGNUP_SUCCESSFUL]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STUDENT_SIGNUP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_ENTERED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_VERIFIED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOTS_SHOWN]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOT_DATE_SELECTED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOT_TIME_SELECTED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.TUTOR_CHANGE_REASON_SELECTED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SUBSCRIPTION_INTENT_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SUBSCRIPTION_INTENT_CREATED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STRIPE_PAYMENT_ELEMENT_READY]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STRIPE_PAYMENT_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STRIPE_PAYMENT_SUCCESS]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PAYMENT_PLAN_SELECTED]: [PLUGINS.MIXPANEL],\n};\n"],"names":["PLA_ANALYTICS_EVENTS","PLA_ANALYTICS_WHITELIST_EVENTS","PLUGINS"],"mappings":";AAEY,IAAAA,sBAAAA,OACVA,EAAA,2BAA2B,4BAC3BA,EAAA,mBAAmB,oBACnBA,EAAA,+BAA+B,gCAC/BA,EAAA,4BAA4B,6BAC5BA,EAAA,2BAA2B,4BAC3BA,EAAA,uBAAuB,wBACvBA,EAAA,4BAA4B,qBAC5BA,EAAA,wBAAwB,iBACxBA,EAAA,qBAAqB,sBACrBA,EAAA,sBAAsB,uBACtBA,EAAA,oBAAoB,qBACpBA,EAAA,cAAc,eACdA,EAAA,qBAAqB,sBACrBA,EAAA,qBAAqB,sBACrBA,EAAA,+BAA+B,gCAC/BA,EAAA,6BAA6B,8BAC7BA,EAAA,8BAA8B,+BAC9BA,EAAA,+BAA+B,gCAC/BA,EAAA,wBAAwB,yBACxBA,EAAA,yBAAyB,0BACzBA,EAAA,wBAAwB,yBArBdA,IAAAA,KAAA,CAAA,CAAA;AAwBL,MAAMC,IAAiC;AAAA,EAC3C,0BAAgD,CAACC,EAAQ,QAAQ;AAAA,EACjE,kBAAwC,CAACA,EAAQ,QAAQ;AAAA,EACzD,8BAAoD,CAACA,EAAQ,QAAQ;AAAA,EACrE,2BAAiD,CAACA,EAAQ,QAAQ;AAAA,EAClE,0BAAgD,CAACA,EAAQ,QAAQ;AAAA,EACjE,sBAA4C,CAACA,EAAQ,QAAQ;AAAA,EAC7D,mBAAiD,CAACA,EAAQ,QAAQ;AAAA,EAClE,eAA6C,CAACA,EAAQ,QAAQ;AAAA,EAC9D,oBAA0C,CAACA,EAAQ,QAAQ;AAAA,EAC3D,qBAA2C,CAACA,EAAQ,QAAQ;AAAA,EAC5D,mBAAyC,CAACA,EAAQ,QAAQ;AAAA,EAC1D,aAAmC,CAACA,EAAQ,QAAQ;AAAA,EACpD,oBAA0C,CAACA,EAAQ,QAAQ;AAAA,EAC3D,oBAA0C,CAACA,EAAQ,QAAQ;AAAA,EAC3D,8BAAoD,CAACA,EAAQ,QAAQ;AAAA,EACrE,4BAAkD,CAACA,EAAQ,QAAQ;AAAA,EACnE,6BAAmD,CAACA,EAAQ,QAAQ;AAAA,EACpE,8BAAoD,CAACA,EAAQ,QAAQ;AAAA,EACrE,uBAA6C,CAACA,EAAQ,QAAQ;AAAA,EAC9D,wBAA8C,CAACA,EAAQ,QAAQ;AAAA,EAC/D,uBAA6C,CAACA,EAAQ,QAAQ;AACjE;"}
1
+ {"version":3,"file":"pla-analytics-events.js","sources":["../../../../src/features/auth/pla-signup/pla-analytics-events.ts"],"sourcesContent":["import { PLUGINS } from '@cuemath/analytics-v2/dist/constants';\n\nexport enum PLA_ANALYTICS_EVENTS {\n START_SIGNUP_CTA_CLICKED = 'start_signup_cta_clicked',\n ECNA_STEP_VIEWED = 'ecna_step_viewed',\n ECNA_RESPONSE_RECORDED_DEBUG = 'ecna_response_recorded_debug',\n PARENT_SIGNUP_CTA_CLICKED = 'parent_signup_cta_clicked',\n PARENT_SIGNUP_SUCCESSFUL = 'parent_signup_successful',\n PARENT_SIGNUP_FAILED = 'parent_signup_failed',\n STUDENT_SIGNUP_SUCCESSFUL = 'signup_successful',\n STUDENT_SIGNUP_FAILED = 'signup_failed',\n SIGNUP_OTP_ENTERED = 'signup_otp_entered',\n SIGNUP_OTP_VERIFIED = 'signup_otp_verified',\n SIGNUP_OTP_FAILED = 'signup_otp_failed',\n SLOTS_SHOWN = 'slots_shown',\n SLOT_DATE_SELECTED = 'slot_date_selected',\n SLOT_TIME_SELECTED = 'slot_time_selected',\n TUTOR_CHANGE_REASON_SELECTED = 'tutor_change_reason_selected',\n}\n\nexport const PLA_ANALYTICS_WHITELIST_EVENTS = {\n [PLA_ANALYTICS_EVENTS.START_SIGNUP_CTA_CLICKED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.ECNA_STEP_VIEWED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.ECNA_RESPONSE_RECORDED_DEBUG]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_CTA_CLICKED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_SUCCESSFUL]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.PARENT_SIGNUP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STUDENT_SIGNUP_SUCCESSFUL]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.STUDENT_SIGNUP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_ENTERED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_VERIFIED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SIGNUP_OTP_FAILED]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOTS_SHOWN]: [PLUGINS.MIXPANEL],\n [PLA_ANALYTICS_EVENTS.SLOT_DATE_SELECTED]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AQ;AAAA,EAC3D,8BAAoD,CAACA,EAAQ,QAAQ;AACxE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"circular-step-wrapper.js","sources":["../../../../../src/features/auth/signup/circular-step-wrapper/circular-step-wrapper.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../ui/lottie-animation/types';\nimport type { ICircularStepRef, ICircularStepWrapperProps } from './circular-step-wrapper-types';\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n memo,\n type Ref,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Back2Icon from '../../../../assets/line-icons/icons/back2';\nimport Next2Icon from '../../../../assets/line-icons/icons/next2';\nimport AnimatedArc from '../../../ui/animated-arc/animated-arc';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport * as Styled from './circular-step-wrapper-styled';\n\nconst animationSettings = {\n autoplay: false,\n loop: false,\n renderer: 'canvas',\n rendererSettings: {\n preserveAspectRatio: 'xMidYMin slice',\n },\n};\n\nconst CircularStepWrapper = forwardRef<ICircularStepRef, ICircularStepWrapperProps>(\n (\n {\n children,\n onGoBack,\n onNext,\n label,\n showNext,\n showPrevious,\n animation,\n introFrames,\n outroFrames,\n isNextLoading,\n progressAngle,\n footerElement,\n isNextDisabled,\n animationSrcMobile,\n },\n ref: Ref<ICircularStepRef>,\n ) => {\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const [containerHeight, setContainerHeight] = useState<number | undefined>();\n const [showContent, setShowContent] = useState(false);\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n const onLottieRender = useCallback(() => {\n if (animation && animationRef.current) {\n animationRef.current.playSegments(introFrames, true);\n setShowContent(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [animation]);\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, [animation]);\n\n useImperativeHandle(ref, () => ({\n playOutroAndFadeOut: async () => {\n return new Promise<void>(resolve => {\n const handleComplete = () => {\n resolve();\n animationRef.current?.removeEventListener('complete', handleComplete);\n };\n\n animationRef.current?.playSegments(outroFrames, true);\n timeoutRef.current = setTimeout(() => setShowContent(false), 400);\n animationRef.current?.addEventListener('complete', handleComplete);\n });\n },\n }));\n\n useLayoutEffect(() => {\n if (containerRef.current) {\n setContainerHeight(containerRef.current.offsetHeight);\n }\n }, []);\n\n return (\n <Styled.Container\n $flex={1}\n $flexDirection=\"column\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $width=\"100%\"\n $height=\"100%\"\n ref={containerRef}\n >\n {containerHeight && (\n <LottieAnimation\n width={1280}\n height={containerHeight}\n src={isMobile ? animationSrcMobile ?? animation : animation}\n ref={animationRef}\n onRender={onLottieRender}\n settings={animationSettings}\n />\n )}\n <Styled.CircularStepContainer\n $width={isMobile ? 290 : 400}\n $height={isMobile ? 290 : 400}\n $background=\"REAL_BLACK\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {progressAngle && (\n <AnimatedArc\n radius={isMobile ? 145 : 200}\n strokeWidth={2}\n color=\"WHITE\"\n targetAngle={progressAngle}\n mode=\"fade\"\n duration={1}\n />\n )}\n <Styled.ContentWrapper $isVisible={showContent} $width=\"100%\">\n {label && (\n <FlexView $gutterX={isMobile ? 1.5 : 3.5}>\n <Text $renderAs=\"ab2\" $color=\"WHITE\" $align=\"center\">\n {label}\n </Text>\n <Separator heightX={1} />\n </FlexView>\n )}\n <Styled.InputContainer>{children}</Styled.InputContainer>\n </Styled.ContentWrapper>\n </Styled.CircularStepContainer>\n {footerElement && (\n <Styled.FooterWrapper $alignItems=\"center\" $justifyContent=\"center\">\n {footerElement}\n </Styled.FooterWrapper>\n )}\n {showPrevious && (\n <Styled.PrevButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"black-dark\"\n analyticsLabel=\"Prev\"\n onClick={onGoBack}\n disabled={isNextLoading}\n size=\"small\"\n />\n </Styled.PrevButtonWrapper>\n )}\n {showNext && (\n <Styled.NextButtonWrapper>\n <IconButton\n size=\"small\"\n Icon={Next2Icon}\n renderAs=\"secondary-dark\"\n analyticsLabel=\"Next\"\n onClick={onNext}\n busy={isNextLoading}\n disabled={isNextLoading || isNextDisabled}\n />\n </Styled.NextButtonWrapper>\n )}\n </Styled.Container>\n );\n },\n);\n\nexport default memo(CircularStepWrapper);\n"],"names":["animationSettings","CircularStepWrapper","forwardRef","children","onGoBack","onNext","label","showNext","showPrevious","animation","introFrames","outroFrames","isNextLoading","progressAngle","footerElement","isNextDisabled","animationSrcMobile","ref","animationRef","useRef","containerRef","containerHeight","setContainerHeight","useState","showContent","setShowContent","timeoutRef","device","useTheme","isMobile","EDeviceType","onLottieRender","useCallback","useEffect","useImperativeHandle","resolve","handleComplete","_a","_b","useLayoutEffect","jsxs","Styled.Container","jsx","LottieAnimation","Styled.CircularStepContainer","AnimatedArc","Styled.ContentWrapper","FlexView","Text","Separator","Styled.InputContainer","Styled.FooterWrapper","Styled.PrevButtonWrapper","IconButton","Back2Icon","Styled.NextButtonWrapper","Next2Icon","CircularStepWrapper$1","memo"],"mappings":";;;;;;;;;;;;;AA2BA,MAAMA,KAAoB;AAAA,EACxB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBAAkB;AAAA,IAChB,qBAAqB;AAAA,EACvB;AACF,GAEMC,KAAsBC;AAAA,EAC1B,CACE;AAAA,IACE,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAA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AACU,IAAA,EACC,UAAA,gBAAAV;AAAA,YAACW;AAAA,YAAA;AAAA,cACC,MAAMC;AAAA,cACN,UAAS;AAAA,cACT,gBAAe;AAAA,cACf,SAASlD;AAAA,cACT,UAAUQ;AAAA,cACV,MAAK;AAAA,YAAA;AAAA,UAAA,GAET;AAAA,UAEDL,KACC,gBAAAmC,EAACa,IAAA,EACC,UAAA,gBAAAb;AAAA,YAACW;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,MAAMG;AAAA,cACN,UAAS;AAAA,cACT,gBAAe;AAAA,cACf,SAASnD;AAAA,cACT,MAAMO;AAAA,cACN,UAAUA,KAAiBG;AAAA,YAAA;AAAA,UAAA,GAE/B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF,GAEe0C,KAAAC,EAAKzD,EAAmB;"}
1
+ {"version":3,"file":"circular-step-wrapper.js","sources":["../../../../../src/features/auth/signup/circular-step-wrapper/circular-step-wrapper.tsx"],"sourcesContent":["import type { ILottieAnimationRef } from '../../../ui/lottie-animation/types';\nimport type { ICircularStepRef, ICircularStepWrapperProps } from './circular-step-wrapper-types';\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n memo,\n type Ref,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport Back2Icon from '../../../../assets/line-icons/icons/back2';\nimport Next2Icon from '../../../../assets/line-icons/icons/next2';\nimport AnimatedArc from '../../../ui/animated-arc/animated-arc';\nimport IconButton from '../../../ui/buttons/icon-button/icon-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport LottieAnimation from '../../../ui/lottie-animation/lottie-animation';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport * as Styled from './circular-step-wrapper-styled';\n\nconst animationSettings = {\n autoplay: false,\n loop: false,\n renderer: 'canvas',\n rendererSettings: {\n preserveAspectRatio: 'xMidYMin slice',\n },\n};\n\nconst CircularStepWrapper = forwardRef<ICircularStepRef, ICircularStepWrapperProps>(\n (\n {\n children,\n onGoBack,\n onNext,\n label,\n showNext,\n showPrevious,\n animation,\n introFrames,\n outroFrames,\n isNextLoading,\n progressAngle,\n footerElement,\n isNextDisabled,\n animationSrcMobile,\n },\n ref: Ref<ICircularStepRef>,\n ) => {\n const animationRef = useRef<ILottieAnimationRef | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const [containerHeight, setContainerHeight] = useState<number | undefined>();\n const [showContent, setShowContent] = useState(false);\n const timeoutRef = useRef<NodeJS.Timeout | null>(null);\n const { device } = useTheme();\n const isMobile = device <= EDeviceType.MOBILE;\n\n const onLottieRender = useCallback(() => {\n if (animation && animationRef.current) {\n animationRef.current.playSegments(introFrames, true);\n setShowContent(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [animation]);\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, [animation]);\n\n useImperativeHandle(ref, () => ({\n playOutroAndFadeOut: async () => {\n return new Promise<void>(resolve => {\n const handleComplete = () => {\n resolve();\n animationRef.current?.removeEventListener('complete', handleComplete);\n };\n\n animationRef.current?.playSegments(outroFrames, true);\n timeoutRef.current = setTimeout(() => setShowContent(false), 400);\n animationRef.current?.addEventListener('complete', handleComplete);\n });\n },\n }));\n\n useLayoutEffect(() => {\n if (containerRef.current) {\n setContainerHeight(containerRef.current.offsetHeight);\n }\n }, []);\n\n return (\n <Styled.Container\n $flex={1}\n $flexDirection=\"column\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $width=\"100%\"\n $height=\"100%\"\n ref={containerRef}\n >\n {containerHeight && (\n <LottieAnimation\n width={1280}\n height={containerHeight}\n src={isMobile ? animationSrcMobile ?? animation : animation}\n ref={animationRef}\n onRender={onLottieRender}\n settings={animationSettings}\n />\n )}\n <Styled.CircularStepContainer\n $width={isMobile ? 290 : 400}\n $height={isMobile ? 290 : 400}\n $background=\"REAL_BLACK\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n >\n {progressAngle && (\n <AnimatedArc\n radius={isMobile ? 145 : 200}\n strokeWidth={2}\n color=\"WHITE\"\n targetAngle={progressAngle}\n mode=\"fade\"\n duration={1}\n />\n )}\n <Styled.ContentWrapper $isVisible={showContent} $width=\"100%\">\n {label && (\n <FlexView $gutterX={isMobile ? 1.5 : 3.5}>\n <Text $renderAs=\"ab2\" $color=\"WHITE\" $align=\"center\">\n {label}\n </Text>\n <Separator heightX={1} />\n </FlexView>\n )}\n <Styled.InputContainer>{children}</Styled.InputContainer>\n </Styled.ContentWrapper>\n </Styled.CircularStepContainer>\n {footerElement && (\n <Styled.FooterWrapper $alignItems=\"center\" $justifyContent=\"center\">\n {footerElement}\n </Styled.FooterWrapper>\n )}\n {showPrevious && (\n <Styled.PrevButtonWrapper>\n <IconButton\n Icon={Back2Icon}\n renderAs=\"black-dark\"\n analyticsLabel=\"Prev\"\n onClick={onGoBack}\n disabled={isNextLoading}\n size=\"small\"\n />\n </Styled.PrevButtonWrapper>\n )}\n {showNext && (\n <Styled.NextButtonWrapper>\n <IconButton\n size=\"small\"\n Icon={Next2Icon}\n renderAs=\"secondary-dark\"\n analyticsLabel=\"Next\"\n onClick={onNext}\n busy={isNextLoading}\n disabled={isNextLoading || isNextDisabled}\n />\n </Styled.NextButtonWrapper>\n )}\n </Styled.Container>\n );\n },\n);\n\nexport default memo(CircularStepWrapper);\n"],"names":["animationSettings","CircularStepWrapper","forwardRef","children","onGoBack","onNext","label","showNext","showPrevious","animation","introFrames","outroFrames","isNextLoading","progressAngle","footerElement","isNextDisabled","animationSrcMobile","ref","animationRef","useRef","containerRef","containerHeight","setContainerHeight","useState","showContent","setShowContent","timeoutRef","device","useTheme","isMobile","EDeviceType","onLottieRender","useCallback","useEffect","useImperativeHandle","resolve","handleComplete","_a","_b","useLayoutEffect","jsxs","Styled.Container","jsx","LottieAnimation","Styled.CircularStepContainer","AnimatedArc","Styled.ContentWrapper","FlexView","Text","Separator","Styled.InputContainer","Styled.FooterWrapper","Styled.PrevButtonWrapper","IconButton","Back2Icon","Styled.NextButtonWrapper","Next2Icon","circularStepWrapper","memo"],"mappings":";;;;;;;;;;;;;AA2BA,MAAMA,KAAoB;AAAA,EACxB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AAAA,EACV,kBAAkB;AAAA,IAChB,qBAAqB;AAAA,EACvB;AACF,GAEMC,KAAsBC;AAAA,EAC1B,CACE;AAAA,IACE,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,KAEFC,MACG;AACG,UAAAC,IAAeC,EAAmC,IAAI,GACtDC,IAAeD,EAAuB,IAAI,GAC1C,CAACE,GAAiBC,CAAkB,IAAIC,EAA6B,GACrE,CAACC,GAAaC,CAAc,IAAIF,EAAS,EAAK,GAC9CG,IAAaP,EAA8B,IAAI,GAC/C,EAAE,QAAAQ,MAAWC,KACbC,IAAWF,KAAUG,EAAY,QAEjCC,IAAiBC,EAAY,MAAM;AACnC,MAAAvB,KAAaS,EAAa,YACfA,EAAA,QAAQ,aAAaR,GAAa,EAAI,GACnDe,EAAe,EAAI;AAAA,IACrB,GAEC,CAAChB,CAAS,CAAC;AAEd,WAAAwB,EAAU,MACD,MAAM;AACX,MAAIP,EAAW,WACb,aAAaA,EAAW,OAAO;AAAA,IACjC,GAED,CAACjB,CAAS,CAAC,GAEdyB,EAAoBjB,GAAK,OAAO;AAAA,MAC9B,qBAAqB,YACZ,IAAI,QAAc,CAAWkB,MAAA;;AAClC,cAAMC,IAAiB,MAAM;;AACnB,UAAAD,MACKE,IAAAn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AlB,KACE,gBAAAkC,EAAAO,GAAA,EAAS,UAAUlB,IAAW,MAAM,KACnC,UAAA;AAAA,oBAAA,gBAAAa,EAACM,KAAK,WAAU,OAAM,QAAO,SAAQ,QAAO,UACzC,UACH1C,EAAA,CAAA;AAAA,oBACA,gBAAAoC,EAACO,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,kBAAA,GACzB;AAAA,kBAED,gBAAAP,EAAAQ,GAAA,EAAuB,UAAA/C,GAAS;AAAA,gBAAA,GACnC;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,UACCW,uBACEqC,IAAA,EAAqB,aAAY,UAAS,iBAAgB,UACxD,UACHrC,GAAA;AAAA,UAEDN,KACC,gBAAAkC,EAACU,IAAA,EACC,UAAA,gBAAAV;AAAA,YAACW;AAAA,YAAA;AAAA,cACC,MAAMC;AAAA,cACN,UAAS;AAAA,cACT,gBAAe;AAAA,cACf,SAASlD;AAAA,cACT,UAAUQ;AAAA,cACV,MAAK;AAAA,YAAA;AAAA,UAAA,GAET;AAAA,UAEDL,KACC,gBAAAmC,EAACa,IAAA,EACC,UAAA,gBAAAb;AAAA,YAACW;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,MAAMG;AAAA,cACN,UAAS;AAAA,cACT,gBAAe;AAAA,cACf,SAASnD;AAAA,cACT,MAAMO;AAAA,cACN,UAAUA,KAAiBG;AAAA,YAAA;AAAA,UAAA,GAE/B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF,GAEe0C,KAAAC,EAAKzD,EAAmB;"}
@@ -13,12 +13,12 @@ const q = ({
13
13
  error: u,
14
14
  helperText: b,
15
15
  onEnter: n,
16
- isLoading: $,
16
+ isLoading: D,
17
17
  isValid: h,
18
18
  type: t = "text",
19
- placeholder: D,
20
- actionElement: F,
21
- maxLength: R,
19
+ placeholder: F,
20
+ actionElement: R,
21
+ maxLength: $,
22
22
  width: E,
23
23
  textTransform: P,
24
24
  textAlign: v = "center",
@@ -56,8 +56,8 @@ const q = ({
56
56
  X,
57
57
  {
58
58
  helperText: u || b,
59
- isLoading: $,
60
- actionElement: F,
59
+ isLoading: D,
60
+ actionElement: R,
61
61
  children: /* @__PURE__ */ K(
62
62
  B,
63
63
  {
@@ -75,13 +75,13 @@ const q = ({
75
75
  value: r,
76
76
  onChange: G,
77
77
  autoFocus: !0,
78
- placeholder: D,
78
+ placeholder: F,
79
79
  color: z,
80
80
  autoCapitalize: "none",
81
81
  textTransform: P,
82
82
  type: y,
83
83
  onKeyDown: k,
84
- maxLength: R,
84
+ maxLength: $,
85
85
  align: v,
86
86
  fontSize: j
87
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"custom-input-field.js","sources":["../../../../../src/features/auth/signup/custom-input-field/custom-input-field.tsx"],"sourcesContent":["import type { ICustomInputFieldProps } from './custom-input-field-types';\n\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n memo,\n type FC,\n type KeyboardEvent,\n type ChangeEvent,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport PhoneCountrySelector from './country-selector/country-selector';\nimport * as Styled from './custom-input-field-styled';\nimport InputWrapper from './input-wrapper/input-wrapper';\nimport PasswordToggleIcon from './password-toggle/password-toggle';\n\nconst CustomInputField: FC<ICustomInputFieldProps> = ({\n value,\n onChange,\n error,\n helperText,\n onEnter,\n isLoading,\n isValid,\n type = 'text',\n placeholder,\n actionElement,\n maxLength,\n width,\n textTransform,\n textAlign = 'center',\n selectedCountry,\n onCountryChange,\n autoSize = false,\n}) => {\n const theme = useTheme();\n const isMobile = theme.device <= EDeviceType.MOBILE;\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\n const [fontSize, setFontSize] = useState(isMobile ? 24 : 32);\n const inputRef = useRef<HTMLInputElement>(null);\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n onEnter?.();\n }\n },\n [onEnter],\n );\n\n const inputType = useMemo(() => {\n if (type === 'password') return isPasswordVisible ? 'text' : 'password';\n\n if (type === 'phone') return 'number';\n\n return type;\n }, [type, isPasswordVisible]);\n\n const inputColor = useMemo(() => {\n if (error) return theme.colors.RED;\n\n if (isValid) return theme.colors.GREEN_4;\n\n return theme.colors.WHITE;\n }, [error, isValid, theme.colors]);\n\n const measureTextWidth = useCallback((text: string, font: string): number => {\n if (!canvasRef.current) {\n canvasRef.current = document.createElement('canvas');\n }\n\n const context = canvasRef.current.getContext('2d');\n\n if (!context) return 0;\n\n context.font = font;\n\n return context.measureText(text).width;\n }, []);\n\n useEffect(() => {\n if (!inputRef.current || !value || !autoSize) {\n return;\n }\n\n if (isMobile) {\n setFontSize(24);\n\n return;\n }\n\n const inputWidth = inputRef.current.clientWidth;\n\n const font32 = \"32px 'Athletics-Light'\";\n\n const textWidth32 = measureTextWidth(value, font32);\n\n if (textWidth32 > inputWidth) {\n setFontSize(24);\n } else {\n setFontSize(32);\n }\n }, [value, measureTextWidth, autoSize, isMobile]);\n\n useEffect(() => {\n return () => {\n canvasRef.current = null;\n };\n }, []);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => onChange(event.target.value),\n [onChange],\n );\n\n return (\n <InputWrapper\n helperText={error || helperText}\n isLoading={isLoading}\n actionElement={actionElement}\n >\n <FlexView\n $width={width ?? '100%'}\n $flex={1}\n $alignItems=\"center\"\n $flexDirection=\"row\"\n $flexGapX={0.5}\n >\n {type === 'phone' && (\n <PhoneCountrySelector onChange={onCountryChange} value={selectedCountry} />\n )}\n <Styled.CustomInput\n ref={inputRef}\n value={value}\n onChange={handleChange}\n autoFocus\n placeholder={placeholder}\n color={inputColor}\n autoCapitalize=\"none\"\n textTransform={textTransform}\n type={inputType}\n onKeyDown={handleKeyDown}\n maxLength={maxLength}\n align={textAlign}\n fontSize={fontSize}\n />\n {type === 'password' && (\n <PasswordToggleIcon\n isVisible={isPasswordVisible}\n onToggle={() => setIsPasswordVisible(prev => !prev)}\n />\n )}\n </FlexView>\n </InputWrapper>\n );\n};\n\nexport default memo(CustomInputField);\n"],"names":["CustomInputField","value","onChange","error","helperText","onEnter","isLoading","isValid","type","placeholder","actionElement","maxLength","width","textTransform","textAlign","selectedCountry","onCountryChange","autoSize","theme","useTheme","isMobile","EDeviceType","isPasswordVisible","setIsPasswordVisible","useState","fontSize","setFontSize","inputRef","useRef","canvasRef","handleKeyDown","useCallback","event","inputType","useMemo","inputColor","measureTextWidth","text","font","context","useEffect","inputWidth","handleChange","jsx","InputWrapper","jsxs","FlexView","PhoneCountrySelector","Styled.CustomInput","PasswordToggleIcon","prev","CustomInputField$1","memo"],"mappings":";;;;;;;;;AAsBA,MAAMA,IAA+C,CAAC;AAAA,EACpD,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC,IAAW;AACb,MAAM;AACJ,QAAMC,IAAQC,KACRC,IAAWF,EAAM,UAAUG,EAAY,QACvC,CAACC,GAAmBC,CAAoB,IAAIC,EAAS,EAAK,GAC1D,CAACC,GAAUC,CAAW,IAAIF,EAASJ,IAAW,KAAK,EAAE,GACrDO,IAAWC,EAAyB,IAAI,GACxCC,IAAYD,EAAiC,IAAI,GAEjDE,IAAgBC;AAAA,IACpB,CAACC,MAA2C;AACtC,MAAAA,EAAM,QAAQ,YACN3B,KAAA,QAAAA;AAAA,IAEd;AAAA,IACA,CAACA,CAAO;AAAA,EAAA,GAGJ4B,IAAYC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AAY;AAAA,UACZ,gBAAe;AAAA,UACf,WAAW;AAAA,UAEV,UAAA;AAAA,YAAAJ,MAAS,WACP,gBAAAmC,EAAAI,GAAA,EAAqB,UAAU/B,GAAiB,OAAOD,GAAiB;AAAA,YAE3E,gBAAA4B;AAAA,cAACK;AAAAA,cAAA;AAAA,gBACC,KAAKrB;AAAA,gBACL,OAAA1B;AAAA,gBACA,UAAUyC;AAAA,gBACV,WAAS;AAAA,gBACT,aAAAjC;AAAA,gBACA,OAAO0B;AAAA,gBACP,gBAAe;AAAA,gBACf,eAAAtB;AAAA,gBACA,MAAMoB;AAAA,gBACN,WAAWH;AAAA,gBACX,WAAAnB;AAAA,gBACA,OAAOG;AAAA,gBACP,UAAAW;AAAA,cAAA;AAAA,YACF;AAAA,YACCjB,MAAS,cACR,gBAAAmC;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,WAAW3B;AAAA,gBACX,UAAU,MAAMC,EAAqB,CAAA2B,MAAQ,CAACA,CAAI;AAAA,cAAA;AAAA,YACpD;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeC,KAAAC,EAAKpD,CAAgB;"}
1
+ {"version":3,"file":"custom-input-field.js","sources":["../../../../../src/features/auth/signup/custom-input-field/custom-input-field.tsx"],"sourcesContent":["import type { ICustomInputFieldProps } from './custom-input-field-types';\n\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n memo,\n type FC,\n type KeyboardEvent,\n type ChangeEvent,\n} from 'react';\nimport { useTheme } from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport PhoneCountrySelector from './country-selector/country-selector';\nimport * as Styled from './custom-input-field-styled';\nimport InputWrapper from './input-wrapper/input-wrapper';\nimport PasswordToggleIcon from './password-toggle/password-toggle';\n\nconst CustomInputField: FC<ICustomInputFieldProps> = ({\n value,\n onChange,\n error,\n helperText,\n onEnter,\n isLoading,\n isValid,\n type = 'text',\n placeholder,\n actionElement,\n maxLength,\n width,\n textTransform,\n textAlign = 'center',\n selectedCountry,\n onCountryChange,\n autoSize = false,\n}) => {\n const theme = useTheme();\n const isMobile = theme.device <= EDeviceType.MOBILE;\n const [isPasswordVisible, setIsPasswordVisible] = useState(false);\n const [fontSize, setFontSize] = useState(isMobile ? 24 : 32);\n const inputRef = useRef<HTMLInputElement>(null);\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n onEnter?.();\n }\n },\n [onEnter],\n );\n\n const inputType = useMemo(() => {\n if (type === 'password') return isPasswordVisible ? 'text' : 'password';\n\n if (type === 'phone') return 'number';\n\n return type;\n }, [type, isPasswordVisible]);\n\n const inputColor = useMemo(() => {\n if (error) return theme.colors.RED;\n\n if (isValid) return theme.colors.GREEN_4;\n\n return theme.colors.WHITE;\n }, [error, isValid, theme.colors]);\n\n const measureTextWidth = useCallback((text: string, font: string): number => {\n if (!canvasRef.current) {\n canvasRef.current = document.createElement('canvas');\n }\n\n const context = canvasRef.current.getContext('2d');\n\n if (!context) return 0;\n\n context.font = font;\n\n return context.measureText(text).width;\n }, []);\n\n useEffect(() => {\n if (!inputRef.current || !value || !autoSize) {\n return;\n }\n\n if (isMobile) {\n setFontSize(24);\n\n return;\n }\n\n const inputWidth = inputRef.current.clientWidth;\n\n const font32 = \"32px 'Athletics-Light'\";\n\n const textWidth32 = measureTextWidth(value, font32);\n\n if (textWidth32 > inputWidth) {\n setFontSize(24);\n } else {\n setFontSize(32);\n }\n }, [value, measureTextWidth, autoSize, isMobile]);\n\n useEffect(() => {\n return () => {\n canvasRef.current = null;\n };\n }, []);\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => onChange(event.target.value),\n [onChange],\n );\n\n return (\n <InputWrapper\n helperText={error || helperText}\n isLoading={isLoading}\n actionElement={actionElement}\n >\n <FlexView\n $width={width ?? '100%'}\n $flex={1}\n $alignItems=\"center\"\n $flexDirection=\"row\"\n $flexGapX={0.5}\n >\n {type === 'phone' && (\n <PhoneCountrySelector onChange={onCountryChange} value={selectedCountry} />\n )}\n <Styled.CustomInput\n ref={inputRef}\n value={value}\n onChange={handleChange}\n autoFocus\n placeholder={placeholder}\n color={inputColor}\n autoCapitalize=\"none\"\n textTransform={textTransform}\n type={inputType}\n onKeyDown={handleKeyDown}\n maxLength={maxLength}\n align={textAlign}\n fontSize={fontSize}\n />\n {type === 'password' && (\n <PasswordToggleIcon\n isVisible={isPasswordVisible}\n onToggle={() => setIsPasswordVisible(prev => !prev)}\n />\n )}\n </FlexView>\n </InputWrapper>\n );\n};\n\nexport default memo(CustomInputField);\n"],"names":["CustomInputField","value","onChange","error","helperText","onEnter","isLoading","isValid","type","placeholder","actionElement","maxLength","width","textTransform","textAlign","selectedCountry","onCountryChange","autoSize","theme","useTheme","isMobile","EDeviceType","isPasswordVisible","setIsPasswordVisible","useState","fontSize","setFontSize","inputRef","useRef","canvasRef","handleKeyDown","useCallback","event","inputType","useMemo","inputColor","measureTextWidth","text","font","context","useEffect","inputWidth","handleChange","jsx","InputWrapper","jsxs","FlexView","PhoneCountrySelector","Styled.CustomInput","PasswordToggleIcon","prev","customInputField","memo"],"mappings":";;;;;;;;;AAsBA,MAAMA,IAA+C,CAAC;AAAA,EACpD,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC,IAAW;AACb,MAAM;AACJ,QAAMC,IAAQC,KACRC,IAAWF,EAAM,UAAUG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Ma,IAAeX;AAAA,IACnB,CAACC,MAAyC9B,EAAS8B,EAAM,OAAO,KAAK;AAAA,IACrE,CAAC9B,CAAQ;AAAA,EAAA;AAIT,SAAA,gBAAAyC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAYzC,KAASC;AAAA,MACrB,WAAAE;AAAA,MACA,eAAAI;AAAA,MAEA,UAAA,gBAAAmC;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,QAAQlC,KAAS;AAAA,UACjB,OAAO;AAAA,UACP,aAAY;AAAA,UACZ,gBAAe;AAAA,UACf,WAAW;AAAA,UAEV,UAAA;AAAA,YAAAJ,MAAS,WACP,gBAAAmC,EAAAI,GAAA,EAAqB,UAAU/B,GAAiB,OAAOD,GAAiB;AAAA,YAE3E,gBAAA4B;AAAA,cAACK;AAAAA,cAAA;AAAA,gBACC,KAAKrB;AAAA,gBACL,OAAA1B;AAAA,gBACA,UAAUyC;AAAA,gBACV,WAAS;AAAA,gBACT,aAAAjC;AAAA,gBACA,OAAO0B;AAAA,gBACP,gBAAe;AAAA,gBACf,eAAAtB;AAAA,gBACA,MAAMoB;AAAA,gBACN,WAAWH;AAAA,gBACX,WAAAnB;AAAA,gBACA,OAAOG;AAAA,gBACP,UAAAW;AAAA,cAAA;AAAA,YACF;AAAA,YACCjB,MAAS,cACR,gBAAAmC;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,WAAW3B;AAAA,gBACX,UAAU,MAAMC,EAAqB,CAAA2B,MAAQ,CAACA,CAAI;AAAA,cAAA;AAAA,YACpD;AAAA,UAAA;AAAA,QAAA;AAAA,MAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,GAEeC,KAAAC,EAAKpD,CAAgB;"}
@@ -1,53 +1,62 @@
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(
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(
10
19
  () => t.reduce(
11
- (o, e) => (e.section_code === G || e.section_code === I || e.block_type === u ? o.goalBlocks.push(e) : o.nonGoalBlocks.push(e), o),
20
+ (o, e) => (e.section_code === N || e.section_code === x || e.block_type === _ ? o.goalBlocks.push(e) : o.nonGoalBlocks.push(e), o),
12
21
  { goalBlocks: [], nonGoalBlocks: [] }
13
22
  ),
14
23
  [t]
15
24
  );
16
- return /* @__PURE__ */ T(
17
- R,
25
+ return /* @__PURE__ */ O(
26
+ L,
18
27
  {
19
28
  $width: "100%",
20
- $background: a.length ? "WHITE_3" : "WHITE_1",
29
+ $background: B.length ? "WHITE_3" : "WHITE_1",
21
30
  children: [
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,
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,
28
37
  {
29
38
  blockData: o,
30
- userType: i,
31
- isLastBlock: h,
32
- lessonIdx: f,
33
- imageHue: n,
39
+ userType: r,
40
+ isLastBlock: R,
41
+ lessonIdx: m,
42
+ imageHue: i,
34
43
  isGoalBlock: !0,
35
- ...r,
36
- blockSectionRef: void 0
44
+ ...d,
45
+ blockSectionRef: T ? g : void 0
37
46
  },
38
47
  s
39
48
  );
40
49
  }) }),
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,
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,
45
54
  {
46
55
  blockData: o,
47
- userType: i,
48
- imageHue: n,
49
- ...r,
50
- blockSectionRef: s ? S : void 0
56
+ userType: r,
57
+ imageHue: i,
58
+ ...d,
59
+ blockSectionRef: s ? C : n ? E : void 0
51
60
  },
52
61
  e
53
62
  );
@@ -57,6 +66,6 @@ const { SAT_MOCK_TEST: u, GOAL: y } = C, { GOALS: G, READINESS: I } = g, v = b((
57
66
  );
58
67
  });
59
68
  export {
60
- v as default
69
+ F as default
61
70
  };
62
71
  //# 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 { 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","BlockSectionView","shouldApplyRef"],"mappings":";;;;;AASA,MAAM,EAAE,eAAAA,GAAe,MAAAC,EAAS,IAAAC,GAC1B,EAAE,OAAAC,GAAO,WAAAC,EAAc,IAAAC,GAEvBC,IAAyCC,EAAK,CAASC,MAAA;AACrD,QAAA,EAAE,QAAAC,GAAQ,UAAAC,GAAU,UAAAC,GAAU,eAAAC,GAAe,iBAAAC,GAAiB,GAAGC,EACrE,IAAAN;AAEF,MAAIO,IAAc,GACdC,IAAuB;AAErB,QAAA,EAAE,YAAAC,GAAY,eAAAC,EAAA,IAAkBC;AAAA,IACpC,MACEV,EAAO;AAAA,MACL,CAACW,GAAKC,OAEFA,EAAM,iBAAiBlB,KACvBkB,EAAM,iBAAiBjB,KACvBiB,EAAM,eAAerB,IAEjBoB,EAAA,WAAW,KAAKC,CAAK,IAErBD,EAAA,cAAc,KAAKC,CAAK,GAGvBD;AAAA,MAET,EAAE,YAAY,CAAA,GAAqB,eAAe,GAAoB;AAAA,IACxE;AAAA,IACF,CAACX,CAAM;AAAA,EAAA;AAIP,SAAA,gBAAAa;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,aAAcL,EAAc,SAAqB,YAAZ;AAAA,MAErC,UAAA;AAAA,QAAA,gBAAAM,EAAC,SAAI,KAAKZ,GACP,YAAW,IAAI,CAACa,GAAWC,MAAQ;AAClC,gBAAM,EAAE,YAAYC,GAAW,UAAUC,GAAS,aAAAC,EAAgB,IAAAJ;AAClE,cAAIK,IAAY;AAEV,gBAAAC,IAAcL,MAAQT,EAAW,SAAS;AAE5C,kBAAAU,MAAc1B,KAAQ0B,MAAc3B,OACjC6B,EAAY,gBACAd,KAAA,IAGLe,IAAAf,IAIZ,gBAAAS;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,WAAAP;AAAA,cACA,UAAAd;AAAA,cACA,aAAAoB;AAAA,cAEA,WAAAD;AAAA,cACA,UAAApB;AAAA,cACA,aAAW;AAAA,cACV,GAAGI;AAAA,cACJ,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
+ {"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,IAAAC,GAEvBC,IAAyCC,EAAK,CAASC,MAAA;AACrD,QAAA;AAAA,IACJ,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAAR;AAEJ,MAAIS,IAAc,GACdC,IAAuB,IACvBC,IAAsB;AAEpB,QAAA,EAAE,YAAAC,GAAY,eAAAC,EAAA,IAAkBC;AAAA,IACpC,MACEb,EAAO;AAAA,MACL,CAACc,GAAKC,OAEFA,EAAM,iBAAiBrB,KACvBqB,EAAM,iBAAiBpB,KAC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AAAjB;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,148 +1,187 @@
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) => {
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) => {
17
20
  const {
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,
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,
41
46
  data: e,
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({
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({
54
86
  chapterDetails: e,
55
- userChapterId: a,
56
- studentId: i,
57
- userType: r
58
- }), e && !l && h && !m && f({
87
+ userType: t,
88
+ canStartDownloadBlockJourney: n
89
+ }), !r && n && D && R({
59
90
  chapterDetails: e,
60
- userType: r
61
- });
91
+ userType: t
92
+ }));
62
93
  }, [
63
- h,
64
- l,
94
+ u,
95
+ r,
65
96
  e,
97
+ g,
98
+ B,
66
99
  m,
67
- f,
100
+ R,
101
+ C,
102
+ l,
68
103
  s,
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,
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,
78
115
  {
79
116
  widthX: 14,
80
117
  size: "small",
81
118
  shape: "square",
82
119
  renderAs: "primary",
83
120
  label: "Try again",
84
- onClick: n
121
+ onClick: i
85
122
  }
86
123
  )
87
- ] }) : !e && o ? /* @__PURE__ */ t(X, { height: "100vh" }) : /* @__PURE__ */ c(
88
- M,
124
+ ] }) : !e && a ? /* @__PURE__ */ o(re, { height: "100vh" }) : /* @__PURE__ */ p(
125
+ de,
89
126
  {
90
- ref: b,
127
+ ref: T,
91
128
  $widthX: 50,
92
- $disablePointerEvents: o,
129
+ $disablePointerEvents: a,
93
130
  $justifyContent: "center",
94
131
  $alignItems: "center",
95
132
  $height: "max-content",
96
133
  children: [
97
- r === "TEACHER" && /* @__PURE__ */ t(K, { $height: "100%", className: "goal-widget-chapter-item", children: /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(
98
- O,
134
+ t === "TEACHER" && /* @__PURE__ */ o(me, { $height: "100%", className: "goal-widget-chapter-item", children: /* @__PURE__ */ o(pe, { children: /* @__PURE__ */ o(
135
+ oe,
99
136
  {
100
- Icon: U,
137
+ Icon: q,
101
138
  renderAs: "secondary-gray",
102
139
  analyticsLabel: "chapter_page_exit",
103
140
  size: "xsmall",
104
- onClick: N
141
+ onClick: P
105
142
  }
106
143
  ) }) }),
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,
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,
111
148
  {
112
149
  title: e.name,
113
150
  imageHue: e.image_hue,
114
151
  imageUrl: e.image_url,
115
152
  progressStats: e == null ? void 0 : e.progress_stat,
116
- bannerRef: J
153
+ bannerRef: U
117
154
  }
118
155
  ),
119
- /* @__PURE__ */ t(
120
- V,
156
+ /* @__PURE__ */ o(
157
+ le,
121
158
  {
122
159
  imageHue: e.image_hue,
123
- userType: r,
160
+ userType: t,
124
161
  blocks: e.blocks,
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
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
138
177
  }
139
178
  )
140
179
  ] })
141
180
  ]
142
181
  }
143
182
  );
144
- }), fe = Z;
183
+ }), Pe = he;
145
184
  export {
146
- fe as default
185
+ Pe as default
147
186
  };
148
187
  //# sourceMappingURL=chapter-details.js.map