@cuemath/leap 2.9.0 → 2.9.1-j1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (422) hide show
  1. package/dist/assets/illustrations/illustrations.js +3 -0
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/assets/line-icons/icons/apple-icon.js +48 -0
  4. package/dist/assets/line-icons/icons/apple-icon.js.map +1 -0
  5. package/dist/assets/line-icons/icons/google-icon.js +42 -0
  6. package/dist/assets/line-icons/icons/google-icon.js.map +1 -0
  7. package/dist/assets/lottie/lottie.js +11 -1
  8. package/dist/assets/lottie/lottie.js.map +1 -1
  9. package/dist/features/auth/account-selector/account-selector-styled.js +26 -0
  10. package/dist/features/auth/account-selector/account-selector-styled.js.map +1 -0
  11. package/dist/features/auth/account-selector/account-selector.js +75 -0
  12. package/dist/features/auth/account-selector/account-selector.js.map +1 -0
  13. package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js +12 -0
  14. package/dist/features/auth/comps/auth-page-layout/auth-page-layout-styles.js.map +1 -0
  15. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +11 -0
  16. package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -0
  17. package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js +24 -0
  18. package/dist/features/auth/comps/auth-static-panel/auth-static-panel.js.map +1 -0
  19. package/dist/features/auth/comps/overlay-loader/overlay-loader-styled.js +29 -0
  20. package/dist/features/auth/comps/overlay-loader/overlay-loader-styled.js.map +1 -0
  21. package/dist/features/auth/comps/overlay-loader/overlay-loader.js +8 -0
  22. package/dist/features/auth/comps/overlay-loader/overlay-loader.js.map +1 -0
  23. package/dist/features/auth/comps/resend-otp/otp-timer/otp-timer.js +26 -0
  24. package/dist/features/auth/comps/resend-otp/otp-timer/otp-timer.js.map +1 -0
  25. package/dist/features/auth/comps/resend-otp/resend-otp.js +41 -0
  26. package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -0
  27. package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper-styled.js +48 -0
  28. package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper-styled.js.map +1 -0
  29. package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js +115 -0
  30. package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -0
  31. package/dist/features/auth/signup/claim-user-account/claim-user-account-styled.js +16 -0
  32. package/dist/features/auth/signup/claim-user-account/claim-user-account-styled.js.map +1 -0
  33. package/dist/features/auth/signup/claim-user-account/claim-user-account.js +71 -0
  34. package/dist/features/auth/signup/claim-user-account/claim-user-account.js.map +1 -0
  35. package/dist/features/auth/signup/custom-input/custom-input-styled.js +38 -0
  36. package/dist/features/auth/signup/custom-input/custom-input-styled.js.map +1 -0
  37. package/dist/features/auth/signup/custom-input/date-picker-input/date-picker-input-styled.js +79 -0
  38. package/dist/features/auth/signup/custom-input/date-picker-input/date-picker-input-styled.js.map +1 -0
  39. package/dist/features/auth/signup/custom-input/date-picker-input/date-picker-input.js +54 -0
  40. package/dist/features/auth/signup/custom-input/date-picker-input/date-picker-input.js.map +1 -0
  41. package/dist/features/auth/signup/custom-input/email-input/email-input.js +30 -0
  42. package/dist/features/auth/signup/custom-input/email-input/email-input.js.map +1 -0
  43. package/dist/features/auth/signup/custom-input/grade-input/grade-input-styled.js +31 -0
  44. package/dist/features/auth/signup/custom-input/grade-input/grade-input-styled.js.map +1 -0
  45. package/dist/features/auth/signup/custom-input/grade-input/grade-input.js +30 -0
  46. package/dist/features/auth/signup/custom-input/grade-input/grade-input.js.map +1 -0
  47. package/dist/features/auth/signup/custom-input/input-wrapper/input-wrapper-styled.js +19 -0
  48. package/dist/features/auth/signup/custom-input/input-wrapper/input-wrapper-styled.js.map +1 -0
  49. package/dist/features/auth/signup/custom-input/input-wrapper/input-wrapper.js +33 -0
  50. package/dist/features/auth/signup/custom-input/input-wrapper/input-wrapper.js.map +1 -0
  51. package/dist/features/auth/signup/custom-input/otp-input/otp-input.js +41 -0
  52. package/dist/features/auth/signup/custom-input/otp-input/otp-input.js.map +1 -0
  53. package/dist/features/auth/signup/custom-input/phone-input/country-selector/country-code-button.js +33 -0
  54. package/dist/features/auth/signup/custom-input/phone-input/country-selector/country-code-button.js.map +1 -0
  55. package/dist/features/auth/signup/custom-input/phone-input/country-selector/country-list-menu.js +28 -0
  56. package/dist/features/auth/signup/custom-input/phone-input/country-selector/country-list-menu.js.map +1 -0
  57. package/dist/features/auth/signup/custom-input/phone-input/phone-input-styled.js +29 -0
  58. package/dist/features/auth/signup/custom-input/phone-input/phone-input-styled.js.map +1 -0
  59. package/dist/features/auth/signup/custom-input/phone-input/phone-input.js +64 -0
  60. package/dist/features/auth/signup/custom-input/phone-input/phone-input.js.map +1 -0
  61. package/dist/features/auth/signup/custom-input/student-password/student-password.js +53 -0
  62. package/dist/features/auth/signup/custom-input/student-password/student-password.js.map +1 -0
  63. package/dist/features/auth/signup/custom-input/student-username/student-username.js +38 -0
  64. package/dist/features/auth/signup/custom-input/student-username/student-username.js.map +1 -0
  65. package/dist/features/auth/signup/signup-constants.js +1022 -0
  66. package/dist/features/auth/signup/signup-constants.js.map +1 -0
  67. package/dist/features/auth/signup/signup-methods/signup-methods.js +58 -0
  68. package/dist/features/auth/signup/signup-methods/signup-methods.js.map +1 -0
  69. package/dist/features/auth/signup/user-type-selector/user-type-card/user-type-card-styled.js +19 -0
  70. package/dist/features/auth/signup/user-type-selector/user-type-card/user-type-card-styled.js.map +1 -0
  71. package/dist/features/auth/signup/user-type-selector/user-type-card/user-type-card.js +61 -0
  72. package/dist/features/auth/signup/user-type-selector/user-type-card/user-type-card.js.map +1 -0
  73. package/dist/features/auth/signup/user-type-selector/user-type-selector-styled.js +24 -0
  74. package/dist/features/auth/signup/user-type-selector/user-type-selector-styled.js.map +1 -0
  75. package/dist/features/auth/signup/user-type-selector/user-type-selector.js +87 -0
  76. package/dist/features/auth/signup/user-type-selector/user-type-selector.js.map +1 -0
  77. package/dist/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/student-actions/student-actions.js +46 -45
  78. package/dist/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/student-actions/student-actions.js.map +1 -1
  79. package/dist/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/teacher-actions/teacher-actions.js +26 -25
  80. package/dist/features/chapters/lpar-chapter/block-section/sheet-item/rewards-n-actions/teacher-actions/teacher-actions.js.map +1 -1
  81. package/dist/features/cue-canvas/cue-canvas-provider.js +8 -9
  82. package/dist/features/cue-canvas/cue-canvas-provider.js.map +1 -1
  83. package/dist/features/sheets/lessons-list/lesson-item/lesson-item-cta-info.js +60 -59
  84. package/dist/features/sheets/lessons-list/lesson-item/lesson-item-cta-info.js.map +1 -1
  85. package/dist/features/sheets/resources-list/resource-item/resource-item.js +90 -89
  86. package/dist/features/sheets/resources-list/resource-item/resource-item.js.map +1 -1
  87. package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/student-actions/student-actions.js +61 -60
  88. package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/student-actions/student-actions.js.map +1 -1
  89. package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions.js +64 -63
  90. package/dist/features/sheets/sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions.js.map +1 -1
  91. package/dist/features/sheets/utils/is-v3-worksheet.js +14 -4
  92. package/dist/features/sheets/utils/is-v3-worksheet.js.map +1 -1
  93. package/dist/features/ui/context-menu/context-menu.js +20 -18
  94. package/dist/features/ui/context-menu/context-menu.js.map +1 -1
  95. package/dist/features/ui/image/image.js +12 -12
  96. package/dist/features/ui/image/image.js.map +1 -1
  97. package/dist/features/ui/lottie-animation/helper.js +6 -5
  98. package/dist/features/ui/lottie-animation/helper.js.map +1 -1
  99. package/dist/features/ui/lottie-animation/lottie-animation.js +37 -28
  100. package/dist/features/ui/lottie-animation/lottie-animation.js.map +1 -1
  101. package/dist/features/ui/text/text.js +29 -27
  102. package/dist/features/ui/text/text.js.map +1 -1
  103. package/dist/index.d.ts +186 -11
  104. package/dist/index.js +406 -373
  105. package/dist/index.js.map +1 -1
  106. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +332 -0
  107. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
  108. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +370 -0
  109. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
  110. package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js +252 -0
  111. package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.js.map +1 -0
  112. package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +24 -0
  113. package/dist/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js.map +1 -0
  114. package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +192 -0
  115. package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +1 -0
  116. package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +19 -0
  117. package/dist/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
  118. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +129 -0
  119. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
  120. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +129 -0
  121. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
  122. package/dist/node_modules/clsx/dist/clsx.js +18 -0
  123. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  124. package/dist/node_modules/date-fns/subYears.js +9 -0
  125. package/dist/node_modules/date-fns/subYears.js.map +1 -0
  126. package/dist/node_modules/react-datepicker/dist/index.es.js +2700 -0
  127. package/dist/node_modules/react-datepicker/dist/index.es.js.map +1 -0
  128. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/addLeadingZeros.js +8 -0
  129. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/addLeadingZeros.js.map +1 -0
  130. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/defaultOptions.js +8 -0
  131. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/defaultOptions.js.map +1 -0
  132. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/formatters.js +518 -0
  133. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/formatters.js.map +1 -0
  134. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/lightFormatters.js +60 -0
  135. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/lightFormatters.js.map +1 -0
  136. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/longFormatters.js +53 -0
  137. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/format/longFormatters.js.map +1 -0
  138. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +19 -0
  139. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js.map +1 -0
  140. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/normalizeDates.js +12 -0
  141. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/normalizeDates.js.map +1 -0
  142. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/protectedTokens.js +21 -0
  143. package/dist/node_modules/react-datepicker/node_modules/date-fns/_lib/protectedTokens.js.map +1 -0
  144. package/dist/node_modules/react-datepicker/node_modules/date-fns/addDays.js +11 -0
  145. package/dist/node_modules/react-datepicker/node_modules/date-fns/addDays.js.map +1 -0
  146. package/dist/node_modules/react-datepicker/node_modules/date-fns/addHours.js +10 -0
  147. package/dist/node_modules/react-datepicker/node_modules/date-fns/addHours.js.map +1 -0
  148. package/dist/node_modules/react-datepicker/node_modules/date-fns/addMilliseconds.js +10 -0
  149. package/dist/node_modules/react-datepicker/node_modules/date-fns/addMilliseconds.js.map +1 -0
  150. package/dist/node_modules/react-datepicker/node_modules/date-fns/addMinutes.js +11 -0
  151. package/dist/node_modules/react-datepicker/node_modules/date-fns/addMinutes.js.map +1 -0
  152. package/dist/node_modules/react-datepicker/node_modules/date-fns/addMonths.js +21 -0
  153. package/dist/node_modules/react-datepicker/node_modules/date-fns/addMonths.js.map +1 -0
  154. package/dist/node_modules/react-datepicker/node_modules/date-fns/addQuarters.js +9 -0
  155. package/dist/node_modules/react-datepicker/node_modules/date-fns/addQuarters.js.map +1 -0
  156. package/dist/node_modules/react-datepicker/node_modules/date-fns/addSeconds.js +9 -0
  157. package/dist/node_modules/react-datepicker/node_modules/date-fns/addSeconds.js.map +1 -0
  158. package/dist/node_modules/react-datepicker/node_modules/date-fns/addWeeks.js +9 -0
  159. package/dist/node_modules/react-datepicker/node_modules/date-fns/addWeeks.js.map +1 -0
  160. package/dist/node_modules/react-datepicker/node_modules/date-fns/addYears.js +9 -0
  161. package/dist/node_modules/react-datepicker/node_modules/date-fns/addYears.js.map +1 -0
  162. package/dist/node_modules/react-datepicker/node_modules/date-fns/constants.js +10 -0
  163. package/dist/node_modules/react-datepicker/node_modules/date-fns/constants.js.map +1 -0
  164. package/dist/node_modules/react-datepicker/node_modules/date-fns/constructFrom.js +9 -0
  165. package/dist/node_modules/react-datepicker/node_modules/date-fns/constructFrom.js.map +1 -0
  166. package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarDays.js +17 -0
  167. package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarDays.js.map +1 -0
  168. package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarMonths.js +14 -0
  169. package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarMonths.js.map +1 -0
  170. package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarQuarters.js +15 -0
  171. package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarQuarters.js.map +1 -0
  172. package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarYears.js +14 -0
  173. package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInCalendarYears.js.map +1 -0
  174. package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInDays.js +23 -0
  175. package/dist/node_modules/react-datepicker/node_modules/date-fns/differenceInDays.js.map +1 -0
  176. package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfDay.js +10 -0
  177. package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfDay.js.map +1 -0
  178. package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfMonth.js +10 -0
  179. package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfMonth.js.map +1 -0
  180. package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfWeek.js +12 -0
  181. package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfWeek.js.map +1 -0
  182. package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfYear.js +10 -0
  183. package/dist/node_modules/react-datepicker/node_modules/date-fns/endOfYear.js.map +1 -0
  184. package/dist/node_modules/react-datepicker/node_modules/date-fns/format.js +60 -0
  185. package/dist/node_modules/react-datepicker/node_modules/date-fns/format.js.map +1 -0
  186. package/dist/node_modules/react-datepicker/node_modules/date-fns/getDate.js +9 -0
  187. package/dist/node_modules/react-datepicker/node_modules/date-fns/getDate.js.map +1 -0
  188. package/dist/node_modules/react-datepicker/node_modules/date-fns/getDay.js +9 -0
  189. package/dist/node_modules/react-datepicker/node_modules/date-fns/getDay.js.map +1 -0
  190. package/dist/node_modules/react-datepicker/node_modules/date-fns/getDayOfYear.js +12 -0
  191. package/dist/node_modules/react-datepicker/node_modules/date-fns/getDayOfYear.js.map +1 -0
  192. package/dist/node_modules/react-datepicker/node_modules/date-fns/getDaysInMonth.js +11 -0
  193. package/dist/node_modules/react-datepicker/node_modules/date-fns/getDaysInMonth.js.map +1 -0
  194. package/dist/node_modules/react-datepicker/node_modules/date-fns/getDefaultOptions.js +9 -0
  195. package/dist/node_modules/react-datepicker/node_modules/date-fns/getDefaultOptions.js.map +1 -0
  196. package/dist/node_modules/react-datepicker/node_modules/date-fns/getHours.js +9 -0
  197. package/dist/node_modules/react-datepicker/node_modules/date-fns/getHours.js.map +1 -0
  198. package/dist/node_modules/react-datepicker/node_modules/date-fns/getISODay.js +10 -0
  199. package/dist/node_modules/react-datepicker/node_modules/date-fns/getISODay.js.map +1 -0
  200. package/dist/node_modules/react-datepicker/node_modules/date-fns/getISOWeek.js +13 -0
  201. package/dist/node_modules/react-datepicker/node_modules/date-fns/getISOWeek.js.map +1 -0
  202. package/dist/node_modules/react-datepicker/node_modules/date-fns/getISOWeekYear.js +16 -0
  203. package/dist/node_modules/react-datepicker/node_modules/date-fns/getISOWeekYear.js.map +1 -0
  204. package/dist/node_modules/react-datepicker/node_modules/date-fns/getMinutes.js +9 -0
  205. package/dist/node_modules/react-datepicker/node_modules/date-fns/getMinutes.js.map +1 -0
  206. package/dist/node_modules/react-datepicker/node_modules/date-fns/getMonth.js +9 -0
  207. package/dist/node_modules/react-datepicker/node_modules/date-fns/getMonth.js.map +1 -0
  208. package/dist/node_modules/react-datepicker/node_modules/date-fns/getQuarter.js +10 -0
  209. package/dist/node_modules/react-datepicker/node_modules/date-fns/getQuarter.js.map +1 -0
  210. package/dist/node_modules/react-datepicker/node_modules/date-fns/getSeconds.js +9 -0
  211. package/dist/node_modules/react-datepicker/node_modules/date-fns/getSeconds.js.map +1 -0
  212. package/dist/node_modules/react-datepicker/node_modules/date-fns/getTime.js +9 -0
  213. package/dist/node_modules/react-datepicker/node_modules/date-fns/getTime.js.map +1 -0
  214. package/dist/node_modules/react-datepicker/node_modules/date-fns/getWeek.js +13 -0
  215. package/dist/node_modules/react-datepicker/node_modules/date-fns/getWeek.js.map +1 -0
  216. package/dist/node_modules/react-datepicker/node_modules/date-fns/getWeekYear.js +18 -0
  217. package/dist/node_modules/react-datepicker/node_modules/date-fns/getWeekYear.js.map +1 -0
  218. package/dist/node_modules/react-datepicker/node_modules/date-fns/getYear.js +9 -0
  219. package/dist/node_modules/react-datepicker/node_modules/date-fns/getYear.js.map +1 -0
  220. package/dist/node_modules/react-datepicker/node_modules/date-fns/isAfter.js +9 -0
  221. package/dist/node_modules/react-datepicker/node_modules/date-fns/isAfter.js.map +1 -0
  222. package/dist/node_modules/react-datepicker/node_modules/date-fns/isBefore.js +9 -0
  223. package/dist/node_modules/react-datepicker/node_modules/date-fns/isBefore.js.map +1 -0
  224. package/dist/node_modules/react-datepicker/node_modules/date-fns/isDate.js +8 -0
  225. package/dist/node_modules/react-datepicker/node_modules/date-fns/isDate.js.map +1 -0
  226. package/dist/node_modules/react-datepicker/node_modules/date-fns/isEqual.js +9 -0
  227. package/dist/node_modules/react-datepicker/node_modules/date-fns/isEqual.js.map +1 -0
  228. package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameDay.js +15 -0
  229. package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameDay.js.map +1 -0
  230. package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameMonth.js +14 -0
  231. package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameMonth.js.map +1 -0
  232. package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameQuarter.js +15 -0
  233. package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameQuarter.js.map +1 -0
  234. package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameYear.js +14 -0
  235. package/dist/node_modules/react-datepicker/node_modules/date-fns/isSameYear.js.map +1 -0
  236. package/dist/node_modules/react-datepicker/node_modules/date-fns/isValid.js +10 -0
  237. package/dist/node_modules/react-datepicker/node_modules/date-fns/isValid.js.map +1 -0
  238. package/dist/node_modules/react-datepicker/node_modules/date-fns/isWithinInterval.js +13 -0
  239. package/dist/node_modules/react-datepicker/node_modules/date-fns/isWithinInterval.js.map +1 -0
  240. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +10 -0
  241. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildFormatLongFn.js.map +1 -0
  242. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +19 -0
  243. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildLocalizeFn.js.map +1 -0
  244. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildMatchFn.js +32 -0
  245. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildMatchFn.js.map +1 -0
  246. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +16 -0
  247. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js.map +1 -0
  248. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +71 -0
  249. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatDistance.js.map +1 -0
  250. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatLong.js +34 -0
  251. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatLong.js.map +1 -0
  252. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +12 -0
  253. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/formatRelative.js.map +1 -0
  254. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/localize.js +156 -0
  255. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/localize.js.map +1 -0
  256. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/match.js +111 -0
  257. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US/_lib/match.js.map +1 -0
  258. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US.js +22 -0
  259. package/dist/node_modules/react-datepicker/node_modules/date-fns/locale/en-US.js.map +1 -0
  260. package/dist/node_modules/react-datepicker/node_modules/date-fns/max.js +15 -0
  261. package/dist/node_modules/react-datepicker/node_modules/date-fns/max.js.map +1 -0
  262. package/dist/node_modules/react-datepicker/node_modules/date-fns/min.js +15 -0
  263. package/dist/node_modules/react-datepicker/node_modules/date-fns/min.js.map +1 -0
  264. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/Parser.js +23 -0
  265. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/Parser.js.map +1 -0
  266. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/Setter.js +42 -0
  267. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/Setter.js.map +1 -0
  268. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/constants.js +50 -0
  269. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/constants.js.map +1 -0
  270. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js +50 -0
  271. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js.map +1 -0
  272. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js +50 -0
  273. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js.map +1 -0
  274. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DateParser.js +62 -0
  275. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DateParser.js.map +1 -0
  276. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js +52 -0
  277. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js.map +1 -0
  278. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayParser.js +46 -0
  279. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayParser.js.map +1 -0
  280. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js +50 -0
  281. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js.map +1 -0
  282. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/EraParser.js +31 -0
  283. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/EraParser.js.map +1 -0
  284. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js +22 -0
  285. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js.map +1 -0
  286. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js +23 -0
  287. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js.map +1 -0
  288. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js +33 -0
  289. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js.map +1 -0
  290. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js +33 -0
  291. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js.map +1 -0
  292. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js +34 -0
  293. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js.map +1 -0
  294. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js +34 -0
  295. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js.map +1 -0
  296. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js +100 -0
  297. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js.map +1 -0
  298. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js +49 -0
  299. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js.map +1 -0
  300. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js +49 -0
  301. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js.map +1 -0
  302. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js +50 -0
  303. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js.map +1 -0
  304. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js +41 -0
  305. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js.map +1 -0
  306. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js +75 -0
  307. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js.map +1 -0
  308. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js +49 -0
  309. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js.map +1 -0
  310. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js +70 -0
  311. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js.map +1 -0
  312. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js +33 -0
  313. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js.map +1 -0
  314. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/MonthParser.js +72 -0
  315. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/MonthParser.js.map +1 -0
  316. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js +71 -0
  317. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js.map +1 -0
  318. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/SecondParser.js +33 -0
  319. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/SecondParser.js.map +1 -0
  320. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js +75 -0
  321. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js.map +1 -0
  322. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js +72 -0
  323. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js.map +1 -0
  324. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js +71 -0
  325. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js.map +1 -0
  326. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js +23 -0
  327. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js.map +1 -0
  328. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js +23 -0
  329. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js.map +1 -0
  330. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/YearParser.js +50 -0
  331. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers/YearParser.js.map +1 -0
  332. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers.js +68 -0
  333. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/parsers.js.map +1 -0
  334. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/utils.js +104 -0
  335. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse/_lib/utils.js.map +1 -0
  336. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse.js +88 -0
  337. package/dist/node_modules/react-datepicker/node_modules/date-fns/parse.js.map +1 -0
  338. package/dist/node_modules/react-datepicker/node_modules/date-fns/parseISO.js +123 -0
  339. package/dist/node_modules/react-datepicker/node_modules/date-fns/parseISO.js.map +1 -0
  340. package/dist/node_modules/react-datepicker/node_modules/date-fns/setDay.js +13 -0
  341. package/dist/node_modules/react-datepicker/node_modules/date-fns/setDay.js.map +1 -0
  342. package/dist/node_modules/react-datepicker/node_modules/date-fns/setHours.js +10 -0
  343. package/dist/node_modules/react-datepicker/node_modules/date-fns/setHours.js.map +1 -0
  344. package/dist/node_modules/react-datepicker/node_modules/date-fns/setISODay.js +12 -0
  345. package/dist/node_modules/react-datepicker/node_modules/date-fns/setISODay.js.map +1 -0
  346. package/dist/node_modules/react-datepicker/node_modules/date-fns/setISOWeek.js +11 -0
  347. package/dist/node_modules/react-datepicker/node_modules/date-fns/setISOWeek.js.map +1 -0
  348. package/dist/node_modules/react-datepicker/node_modules/date-fns/setMinutes.js +10 -0
  349. package/dist/node_modules/react-datepicker/node_modules/date-fns/setMinutes.js.map +1 -0
  350. package/dist/node_modules/react-datepicker/node_modules/date-fns/setMonth.js +14 -0
  351. package/dist/node_modules/react-datepicker/node_modules/date-fns/setMonth.js.map +1 -0
  352. package/dist/node_modules/react-datepicker/node_modules/date-fns/setQuarter.js +11 -0
  353. package/dist/node_modules/react-datepicker/node_modules/date-fns/setQuarter.js.map +1 -0
  354. package/dist/node_modules/react-datepicker/node_modules/date-fns/setSeconds.js +10 -0
  355. package/dist/node_modules/react-datepicker/node_modules/date-fns/setSeconds.js.map +1 -0
  356. package/dist/node_modules/react-datepicker/node_modules/date-fns/setWeek.js +11 -0
  357. package/dist/node_modules/react-datepicker/node_modules/date-fns/setWeek.js.map +1 -0
  358. package/dist/node_modules/react-datepicker/node_modules/date-fns/setYear.js +11 -0
  359. package/dist/node_modules/react-datepicker/node_modules/date-fns/setYear.js.map +1 -0
  360. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfDay.js +10 -0
  361. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfDay.js.map +1 -0
  362. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfISOWeek.js +9 -0
  363. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfISOWeek.js.map +1 -0
  364. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfISOWeekYear.js +12 -0
  365. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfISOWeekYear.js.map +1 -0
  366. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfMonth.js +10 -0
  367. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfMonth.js.map +1 -0
  368. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfQuarter.js +10 -0
  369. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfQuarter.js.map +1 -0
  370. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfWeek.js +12 -0
  371. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfWeek.js.map +1 -0
  372. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfWeekYear.js +14 -0
  373. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfWeekYear.js.map +1 -0
  374. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfYear.js +10 -0
  375. package/dist/node_modules/react-datepicker/node_modules/date-fns/startOfYear.js.map +1 -0
  376. package/dist/node_modules/react-datepicker/node_modules/date-fns/subDays.js +9 -0
  377. package/dist/node_modules/react-datepicker/node_modules/date-fns/subDays.js.map +1 -0
  378. package/dist/node_modules/react-datepicker/node_modules/date-fns/subMonths.js +9 -0
  379. package/dist/node_modules/react-datepicker/node_modules/date-fns/subMonths.js.map +1 -0
  380. package/dist/node_modules/react-datepicker/node_modules/date-fns/subQuarters.js +9 -0
  381. package/dist/node_modules/react-datepicker/node_modules/date-fns/subQuarters.js.map +1 -0
  382. package/dist/node_modules/react-datepicker/node_modules/date-fns/subWeeks.js +9 -0
  383. package/dist/node_modules/react-datepicker/node_modules/date-fns/subWeeks.js.map +1 -0
  384. package/dist/node_modules/react-datepicker/node_modules/date-fns/subYears.js +9 -0
  385. package/dist/node_modules/react-datepicker/node_modules/date-fns/subYears.js.map +1 -0
  386. package/dist/node_modules/react-datepicker/node_modules/date-fns/toDate.js +9 -0
  387. package/dist/node_modules/react-datepicker/node_modules/date-fns/toDate.js.map +1 -0
  388. package/dist/node_modules/react-datepicker/node_modules/date-fns/transpose.js +19 -0
  389. package/dist/node_modules/react-datepicker/node_modules/date-fns/transpose.js.map +1 -0
  390. package/dist/node_modules/uuid/dist/esm-browser/native.js +7 -0
  391. package/dist/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
  392. package/dist/node_modules/uuid/dist/esm-browser/rng.js +3 -2
  393. package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
  394. package/dist/node_modules/uuid/dist/esm-browser/stringify.js +6 -10
  395. package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
  396. package/dist/node_modules/uuid/dist/esm-browser/v4.js +12 -9
  397. package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
  398. package/dist/static/avatar-selected.860ee923.json +1 -0
  399. package/dist/static/circle-cuemath-logo-white.e9fafb91.svg +1 -0
  400. package/dist/static/cuemath-app-qr-code.ba6cc09b.svg +1 -0
  401. package/dist/static/cuemath-app-qr-code.d0912fc7.png +0 -0
  402. package/dist/static/dob.9ce3c15b.json +1 -0
  403. package/dist/static/grade.b3730524.json +1 -0
  404. package/dist/static/key.d6846476.json +1 -0
  405. package/dist/static/mail.c30e8708.json +1 -0
  406. package/dist/static/otp.2d08f874.json +1 -0
  407. package/dist/static/otp.a3029760.json +1 -0
  408. package/dist/static/parent-avatar.772d53e0.json +1 -0
  409. package/dist/static/phone-number.0be312ea.json +1 -0
  410. package/dist/static/phone-number.84f55562.json +1 -0
  411. package/dist/static/student-avatar.524226bd.json +1 -0
  412. package/dist/static/user-type-selector-grid-bg.3c9c8ad6.svg +1 -0
  413. package/dist/static/user-type-selector-grid-bg.3ce8142d.svg +1 -0
  414. package/dist/static/user-type-selector-grid-bg.aad0b059.svg +1 -0
  415. package/dist/static/username.9e034d51.json +1 -0
  416. package/package.json +4 -5
  417. package/dist/library/polypad.js +0 -24965
  418. package/dist/library/polypad.js.map +0 -1
  419. package/dist/node_modules/uuid/dist/esm-browser/regex.js +0 -5
  420. package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
  421. package/dist/node_modules/uuid/dist/esm-browser/validate.js +0 -8
  422. package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
@@ -1,84 +1,85 @@
1
- import { jsxs as $, jsx as e } from "react/jsx-runtime";
2
- import { memo as z, useRef as J, useState as Q, useMemo as Z, useCallback as d, useLayoutEffect as ee } from "react";
3
- import te from "../../../../assets/line-icons/icons/minus2.js";
4
- import oe from "../../../../assets/line-icons/icons/plus2.js";
5
- import re from "../../../../assets/line-icons/icons/redo.js";
1
+ import { jsxs as v, jsx as e } from "react/jsx-runtime";
2
+ import { memo as J, useRef as Q, useState as Z, useMemo as ee, useCallback as d, useLayoutEffect as te } from "react";
3
+ import oe from "../../../../assets/line-icons/icons/minus2.js";
4
+ import re from "../../../../assets/line-icons/icons/plus2.js";
5
+ import ne from "../../../../assets/line-icons/icons/redo.js";
6
6
  import A from "../../../ui/arrow-tooltip/arrow-tooltip.js";
7
- import ne from "../../../ui/context-menu/context-menu.js";
8
- import { useUIContext as ie } from "../../../ui/context/context.js";
9
- import ce from "../../../ui/layout/flex-view.js";
10
- import se from "../../comps/sheet-button/index.js";
11
- import ae from "../../lessons-list/lesson-item/context-menu-helper/target-element.js";
12
- import { SHEETS_ANALYTICS_EVENTS as v } from "../../sheets-analytics-events.js";
13
- import { TEACHER_MENU_OPTIONS as ue } from "../../sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions-constant.js";
7
+ import ie from "../../../ui/context-menu/context-menu.js";
8
+ import { useUIContext as ce } from "../../../ui/context/context.js";
9
+ import se from "../../../ui/layout/flex-view.js";
10
+ import ae from "../../comps/sheet-button/index.js";
11
+ import ue from "../../lessons-list/lesson-item/context-menu-helper/target-element.js";
12
+ import { SHEETS_ANALYTICS_EVENTS as k } from "../../sheets-analytics-events.js";
13
+ import { TEACHER_MENU_OPTIONS as me } from "../../sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions-constant.js";
14
+ import { isV3Worksheet as h } from "../../utils/is-v3-worksheet.js";
14
15
  import le from "./context-menu-helper/menu-element.js";
15
- import { ResourceItemCard as me, ResourceItemTitle as pe, IconButtonWrapper as fe } from "./styled.js";
16
- import { getResourceItemCtaState as de, getResourceItemCtaInfo as he, getResourceItemBackgroundColor as _e } from "./utils.js";
17
- const { UNASSIGN: x, REDO: N } = ue, Oe = z(
16
+ import { ResourceItemCard as pe, ResourceItemTitle as fe, IconButtonWrapper as de } from "./styled.js";
17
+ import { getResourceItemCtaState as he, getResourceItemCtaInfo as we, getResourceItemBackgroundColor as _e } from "./utils.js";
18
+ const { UNASSIGN: x, REDO: N } = me, Me = J(
18
19
  ({
19
20
  sheet: t,
20
- userType: k,
21
- isMilestoneWidget: h,
21
+ userType: O,
22
+ isMilestoneWidget: w,
22
23
  userMilestoneId: _,
23
24
  onUnlock: i,
24
25
  onUnAssignSheet: u,
25
- onReset: l,
26
- onPreview: m,
26
+ onReset: m,
27
+ onPreview: l,
27
28
  onReview: p,
28
29
  onStart: f
29
30
  }) => {
30
- const { onClick: c } = ie(), r = J(null), [O, D] = Q(!1), {
31
- accuracy: w,
32
- permissions: M,
33
- title: b,
34
- sheet_statement: X,
35
- state: C,
31
+ const { onClick: c } = ce(), r = Q(null), [D, M] = Z(!1), {
32
+ accuracy: b,
33
+ permissions: X,
34
+ title: C,
35
+ sheet_statement: j,
36
+ state: E,
36
37
  node_id: o,
37
38
  user_node_id: s,
38
- node_sub_group: j,
39
- node_type: E
39
+ node_sub_group: G,
40
+ node_type: y
40
41
  } = t, {
41
- can_start: y,
42
- can_resume: I,
43
- can_unlock: S,
44
- can_review: G,
45
- can_teacher_review: H,
46
- can_unassign: L,
47
- can_reset: B
48
- } = M, U = typeof w == "number" ? `${w}%` : void 0, n = k === "STUDENT", g = n ? G : H, P = de(C), { label: V, Icon: F } = he(j) || {}, a = Z(
42
+ can_start: I,
43
+ can_resume: S,
44
+ can_unlock: g,
45
+ can_review: H,
46
+ can_teacher_review: L,
47
+ can_unassign: B,
48
+ can_reset: U
49
+ } = X, V = typeof b == "number" ? `${b}%` : void 0, n = O === "STUDENT", R = n ? H : L, P = he(E), { label: W, Icon: F } = we(G) || {}, a = ee(
49
50
  () => ({
50
51
  node_id: o,
51
- node_type: E
52
+ node_type: y
52
53
  }),
53
- [o, E]
54
+ [o, y]
54
55
  ), K = d(() => {
55
56
  c({
56
- analyticsLabel: v.RESOURCE_ASSIGNED,
57
+ analyticsLabel: k.RESOURCE_ASSIGNED,
57
58
  props: a
58
59
  }), i == null || i(o);
59
- }, [i, o, c, a]), W = d(() => {
60
- if (n && (y || I)) {
60
+ }, [i, o, c, a]), Y = d(() => {
61
+ if (n && (I || S)) {
61
62
  if (typeof f == "function") {
62
- f(o, s);
63
+ f(o, h(t), s);
63
64
  return;
64
65
  }
65
66
  throw new Error("No callback is available");
66
67
  }
67
- if (g) {
68
+ if (R) {
68
69
  if (typeof p != "function")
69
70
  throw new Error("onReview must be a function");
70
71
  if (!s)
71
72
  throw new Error("user node id must be present to review the sheet");
72
- p(s, _);
73
+ p(s, h(t, "review"), _);
73
74
  return;
74
75
  }
75
- if (typeof m != "function")
76
+ if (typeof l != "function")
76
77
  throw new Error("onPreview must be a function");
77
- m(t);
78
+ l(t, h(t));
78
79
  }, [
80
+ S,
81
+ R,
79
82
  I,
80
- g,
81
- y,
82
83
  n,
83
84
  o,
84
85
  t,
@@ -86,104 +87,104 @@ const { UNASSIGN: x, REDO: N } = ue, Oe = z(
86
87
  s,
87
88
  f,
88
89
  p,
89
- m
90
- ]), R = d(
91
- (q) => {
92
- switch (q) {
90
+ l
91
+ ]), T = d(
92
+ (z) => {
93
+ switch (z) {
93
94
  case x:
94
95
  if (typeof u != "function")
95
96
  throw new Error("onUnassignSheet must be a function");
96
97
  c({
97
- analyticsLabel: v.RESOURCE_UNASSIGNED,
98
+ analyticsLabel: k.RESOURCE_UNASSIGNED,
98
99
  props: a
99
100
  }), u(t);
100
101
  return;
101
102
  case N:
102
- if (typeof l != "function")
103
+ if (typeof m != "function")
103
104
  throw new Error("onReset must be a function");
104
- l(t);
105
+ m(t);
105
106
  return;
106
107
  }
107
108
  },
108
- [t, u, l, a, c]
109
+ [t, u, m, a, c]
109
110
  );
110
- ee(() => {
111
- r.current && r.current.scrollHeight > r.current.clientHeight && D(!0);
111
+ te(() => {
112
+ r.current && r.current.scrollHeight > r.current.clientHeight && M(!0);
112
113
  }, [r]);
113
- const Y = [
114
+ const q = [
114
115
  {
115
116
  id: "supplementary_resources_unassign",
116
117
  label: "Unassign",
117
- icon: /* @__PURE__ */ e(te, { width: 20, height: 20 }),
118
+ icon: /* @__PURE__ */ e(oe, { width: 20, height: 20 }),
118
119
  option: x,
119
- visible: L,
120
- onClick: R
120
+ visible: B,
121
+ onClick: T
121
122
  },
122
123
  {
123
124
  id: "supplementary_resources_redo",
124
125
  label: "Redo",
125
- icon: /* @__PURE__ */ e(re, {}),
126
+ icon: /* @__PURE__ */ e(ne, {}),
126
127
  option: N,
127
- visible: B,
128
- onClick: R
128
+ visible: U,
129
+ onClick: T
129
130
  }
130
- ], T = _e(
131
- C,
131
+ ], $ = _e(
132
+ E,
132
133
  n,
133
- S,
134
- !!h
134
+ g,
135
+ !!w
135
136
  );
136
- return /* @__PURE__ */ $(
137
- me,
137
+ return /* @__PURE__ */ v(
138
+ pe,
138
139
  {
139
140
  $gapX: 1,
140
141
  $gutterX: 1,
141
142
  $flexGapX: 1.25,
142
- $background: T,
143
+ $background: $,
143
144
  $justifyContent: "space-between",
144
145
  $heightX: 8,
145
- $isMilestoneWidget: h,
146
+ $isMilestoneWidget: w,
146
147
  children: [
147
148
  /* @__PURE__ */ e(
148
149
  A,
149
150
  {
150
151
  renderAs: "primary",
151
152
  position: "bottom",
152
- tooltipItem: b,
153
- hidden: !O,
153
+ tooltipItem: C,
154
+ hidden: !D,
154
155
  widthX: 21.75,
155
- children: /* @__PURE__ */ e(pe, { ref: r, $renderAs: "ab2", $color: "BLACK_T_87", children: b })
156
+ children: /* @__PURE__ */ e(fe, { ref: r, $renderAs: "ab2", $color: "BLACK_T_87", children: C })
156
157
  }
157
158
  ),
158
- /* @__PURE__ */ $(ce, { $flexDirection: "row", $justifyContent: "space-between", $alignItems: "center", children: [
159
- /* @__PURE__ */ e(A, { position: "bottom", tooltipItem: X, renderAs: "secondary", children: /* @__PURE__ */ e(
160
- se,
159
+ /* @__PURE__ */ v(se, { $flexDirection: "row", $justifyContent: "space-between", $alignItems: "center", children: [
160
+ /* @__PURE__ */ e(A, { position: "bottom", tooltipItem: j, renderAs: "secondary", children: /* @__PURE__ */ e(
161
+ ae,
161
162
  {
162
163
  renderAs: "primary",
163
- label: V ?? "",
164
+ label: W ?? "",
164
165
  Icon: F,
165
- backgroundColor: T,
166
+ backgroundColor: $,
166
167
  state: P,
167
168
  hoverActive: !1,
168
- onClick: W,
169
- accuracy: U,
169
+ onClick: Y,
170
+ accuracy: V,
170
171
  widthX: 8.5
171
172
  }
172
173
  ) }),
173
- !n && (S ? /* @__PURE__ */ e(
174
- fe,
174
+ !n && (g ? /* @__PURE__ */ e(
175
+ de,
175
176
  {
176
177
  $flexDirection: "row",
177
178
  $alignItems: "center",
178
179
  $justifyContent: "center",
179
180
  onClick: K,
180
- children: /* @__PURE__ */ e(oe, {})
181
+ children: /* @__PURE__ */ e(re, {})
181
182
  }
182
183
  ) : /* @__PURE__ */ e(
183
- ne,
184
+ ie,
184
185
  {
185
- targetElement: /* @__PURE__ */ e(ae, { invertHover: !0 }),
186
- menuElement: /* @__PURE__ */ e(le, { menuOptions: Y })
186
+ targetElement: /* @__PURE__ */ e(ue, { invertHover: !0 }),
187
+ menuElement: /* @__PURE__ */ e(le, { menuOptions: q })
187
188
  }
188
189
  ))
189
190
  ] })
@@ -193,6 +194,6 @@ const { UNASSIGN: x, REDO: N } = ue, Oe = z(
193
194
  }
194
195
  );
195
196
  export {
196
- Oe as default
197
+ Me as default
197
198
  };
198
199
  //# sourceMappingURL=resource-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resource-item.js","sources":["../../../../../src/features/sheets/resources-list/resource-item/resource-item.tsx"],"sourcesContent":["import type { IMenuOptionsProps } from './context-menu-helper/menu-element-types';\nimport type { IResourceItemProps } from './types';\nimport type { FC } from 'react';\n\nimport { useCallback, useLayoutEffect, useRef, memo, useState, useMemo } from 'react';\n\nimport Minus2Icon from '../../../../assets/line-icons/icons/minus2';\nimport Plus2Icon from '../../../../assets/line-icons/icons/plus2';\nimport RedoIcon from '../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../ui/context-menu/context-menu';\nimport { useUIContext } from '../../../ui/context/context';\nimport FlexView from '../../../ui/layout/flex-view';\nimport SheetButton from '../../comps/sheet-button';\nimport ContextMenuTargetElement from '../../lessons-list/lesson-item/context-menu-helper/target-element';\nimport { SHEETS_ANALYTICS_EVENTS } from '../../sheets-analytics-events';\nimport { TEACHER_MENU_OPTIONS } from '../../sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions-constant';\nimport ContextMenuElement from './context-menu-helper/menu-element';\nimport * as Styled from './styled';\nimport {\n getResourceItemBackgroundColor,\n getResourceItemCtaInfo,\n getResourceItemCtaState,\n} from './utils';\n\nconst { UNASSIGN, REDO } = TEACHER_MENU_OPTIONS;\n\nconst ResourceItem: FC<IResourceItemProps> = memo(\n ({\n sheet,\n userType,\n isMilestoneWidget,\n userMilestoneId,\n onUnlock,\n onUnAssignSheet,\n onReset,\n onPreview,\n onReview,\n onStart,\n }) => {\n const { onClick: trackClick } = useUIContext();\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const {\n accuracy,\n permissions,\n title,\n sheet_statement: sheetStatement,\n state: sheetState,\n node_id: nodeId,\n user_node_id: userNodeId,\n node_sub_group: nodeSubGroup,\n node_type: nodeType,\n } = sheet;\n const {\n can_start: canStart,\n can_resume: canResume,\n can_unlock: canUnlock,\n can_review: canReview,\n can_teacher_review: canTeacherReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n } = permissions;\n\n const sheetAccuracy = typeof accuracy === 'number' ? `${accuracy}%` : undefined;\n const isStudent = userType === 'STUDENT';\n const canReviewSheet = isStudent ? canReview : canTeacherReview;\n\n const ctaState = getResourceItemCtaState(sheetState);\n const { label, Icon } = getResourceItemCtaInfo(nodeSubGroup) || {};\n\n const analyticsProps = useMemo(\n () => ({\n node_id: nodeId,\n node_type: nodeType,\n }),\n [nodeId, nodeType],\n );\n\n const handleAssignSheet = useCallback(() => {\n trackClick({\n analyticsLabel: SHEETS_ANALYTICS_EVENTS.RESOURCE_ASSIGNED,\n props: analyticsProps,\n });\n\n onUnlock?.(nodeId);\n }, [onUnlock, nodeId, trackClick, analyticsProps]);\n\n const handleOnClick = useCallback(() => {\n if (isStudent && (canStart || canResume)) {\n if (typeof onStart === 'function') {\n onStart(nodeId, userNodeId);\n\n return;\n }\n\n throw new Error('No callback is available');\n }\n\n if (canReviewSheet) {\n if (typeof onReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n\n onReview(userNodeId, userMilestoneId);\n\n return;\n }\n\n if (typeof onPreview !== 'function') {\n throw new Error('onPreview must be a function');\n }\n\n onPreview(sheet);\n }, [\n canResume,\n canReviewSheet,\n canStart,\n isStudent,\n nodeId,\n sheet,\n userMilestoneId,\n userNodeId,\n onStart,\n onReview,\n onPreview,\n ]);\n\n const handleMenuOptionClick = useCallback(\n (selectedOption: string) => {\n switch (selectedOption) {\n case UNASSIGN:\n if (typeof onUnAssignSheet !== 'function') {\n throw new Error('onUnassignSheet must be a function');\n }\n\n trackClick({\n analyticsLabel: SHEETS_ANALYTICS_EVENTS.RESOURCE_UNASSIGNED,\n props: analyticsProps,\n });\n\n onUnAssignSheet(sheet);\n\n return;\n\n case REDO:\n if (typeof onReset !== 'function') {\n throw new Error('onReset must be a function');\n }\n\n onReset(sheet);\n\n return;\n }\n },\n [sheet, onUnAssignSheet, onReset, analyticsProps, trackClick],\n );\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n const menuOptions: IMenuOptionsProps[] = [\n {\n id: 'supplementary_resources_unassign',\n label: 'Unassign',\n icon: <Minus2Icon width={20} height={20} />,\n option: UNASSIGN,\n visible: canUnassign,\n onClick: handleMenuOptionClick,\n },\n {\n id: 'supplementary_resources_redo',\n label: 'Redo',\n icon: <RedoIcon />,\n option: REDO,\n visible: canReset,\n onClick: handleMenuOptionClick,\n },\n ];\n\n const backgroundColor = getResourceItemBackgroundColor(\n sheetState,\n isStudent,\n canUnlock,\n !!isMilestoneWidget,\n );\n\n return (\n <Styled.ResourceItemCard\n $gapX={1}\n $gutterX={1}\n $flexGapX={1.25}\n $background={backgroundColor}\n $justifyContent=\"space-between\"\n $heightX={8}\n $isMilestoneWidget={isMilestoneWidget}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={title}\n hidden={!showTitleTooltip}\n widthX={21.75}\n >\n <Styled.ResourceItemTitle ref={titleTextRef} $renderAs=\"ab2\" $color=\"BLACK_T_87\">\n {title}\n </Styled.ResourceItemTitle>\n </ArrowTooltip>\n\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $alignItems=\"center\">\n <ArrowTooltip position=\"bottom\" tooltipItem={sheetStatement} renderAs=\"secondary\">\n <SheetButton\n renderAs=\"primary\"\n label={label ?? ''}\n Icon={Icon}\n backgroundColor={backgroundColor}\n state={ctaState}\n hoverActive={false}\n onClick={handleOnClick}\n accuracy={sheetAccuracy}\n widthX={8.5}\n />\n </ArrowTooltip>\n\n {!isStudent &&\n (canUnlock ? (\n <Styled.IconButtonWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n onClick={handleAssignSheet}\n >\n <Plus2Icon />\n </Styled.IconButtonWrapper>\n ) : (\n <ContextMenu\n targetElement={<ContextMenuTargetElement invertHover />}\n menuElement={<ContextMenuElement menuOptions={menuOptions} />}\n />\n ))}\n </FlexView>\n </Styled.ResourceItemCard>\n );\n },\n);\n\nexport default ResourceItem;\n"],"names":["UNASSIGN","REDO","TEACHER_MENU_OPTIONS","ResourceItem","memo","sheet","userType","isMilestoneWidget","userMilestoneId","onUnlock","onUnAssignSheet","onReset","onPreview","onReview","onStart","trackClick","useUIContext","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","accuracy","permissions","title","sheetStatement","sheetState","nodeId","userNodeId","nodeSubGroup","nodeType","canStart","canResume","canUnlock","canReview","canTeacherReview","canUnassign","canReset","sheetAccuracy","isStudent","canReviewSheet","ctaState","getResourceItemCtaState","label","Icon","getResourceItemCtaInfo","analyticsProps","useMemo","handleAssignSheet","useCallback","SHEETS_ANALYTICS_EVENTS","handleOnClick","handleMenuOptionClick","selectedOption","useLayoutEffect","menuOptions","jsx","Minus2Icon","RedoIcon","backgroundColor","getResourceItemBackgroundColor","jsxs","Styled.ResourceItemCard","ArrowTooltip","Styled.ResourceItemTitle","FlexView","SheetButton","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A,gBAAA+B;AAAA,cAACU;AAAA,cAAA;AAAA,gBACC,UAAS;AAAA,gBACT,OAAOvB,KAAS;AAAA,gBAChB,MAAAC;AAAA,gBACA,iBAAAe;AAAA,gBACA,OAAOlB;AAAA,gBACP,aAAa;AAAA,gBACb,SAASU;AAAA,gBACT,UAAUb;AAAA,gBACV,QAAQ;AAAA,cAAA;AAAA,YAAA,GAEZ;AAAA,YAEC,CAACC,MACCN,IACC,gBAAAuB;AAAA,cAACW;AAAAA,cAAA;AAAA,gBACC,gBAAe;AAAA,gBACf,aAAY;AAAA,gBACZ,iBAAgB;AAAA,gBAChB,SAASnB;AAAA,gBAET,4BAACoB,IAAU,EAAA;AAAA,cAAA;AAAA,YAAA,IAGb,gBAAAZ;AAAA,cAACa;AAAA,cAAA;AAAA,gBACC,eAAe,gBAAAb,EAACc,IAAyB,EAAA,aAAW,GAAC,CAAA;AAAA,gBACrD,aAAc,gBAAAd,EAAAe,IAAA,EAAmB,aAAAhB,EAA0B,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAC7D,GAEN;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
1
+ {"version":3,"file":"resource-item.js","sources":["../../../../../src/features/sheets/resources-list/resource-item/resource-item.tsx"],"sourcesContent":["import type { IMenuOptionsProps } from './context-menu-helper/menu-element-types';\nimport type { IResourceItemProps } from './types';\nimport type { FC } from 'react';\n\nimport { useCallback, useLayoutEffect, useRef, memo, useState, useMemo } from 'react';\n\nimport Minus2Icon from '../../../../assets/line-icons/icons/minus2';\nimport Plus2Icon from '../../../../assets/line-icons/icons/plus2';\nimport RedoIcon from '../../../../assets/line-icons/icons/redo';\nimport ArrowTooltip from '../../../ui/arrow-tooltip/arrow-tooltip';\nimport ContextMenu from '../../../ui/context-menu/context-menu';\nimport { useUIContext } from '../../../ui/context/context';\nimport FlexView from '../../../ui/layout/flex-view';\nimport SheetButton from '../../comps/sheet-button';\nimport ContextMenuTargetElement from '../../lessons-list/lesson-item/context-menu-helper/target-element';\nimport { SHEETS_ANALYTICS_EVENTS } from '../../sheets-analytics-events';\nimport { TEACHER_MENU_OPTIONS } from '../../sheets-list/sheet-item/reward-n-actions/teacher-actions/teacher-actions-constant';\nimport { isV3Worksheet } from '../../utils/is-v3-worksheet';\nimport ContextMenuElement from './context-menu-helper/menu-element';\nimport * as Styled from './styled';\nimport {\n getResourceItemBackgroundColor,\n getResourceItemCtaInfo,\n getResourceItemCtaState,\n} from './utils';\n\nconst { UNASSIGN, REDO } = TEACHER_MENU_OPTIONS;\n\nconst ResourceItem: FC<IResourceItemProps> = memo(\n ({\n sheet,\n userType,\n isMilestoneWidget,\n userMilestoneId,\n onUnlock,\n onUnAssignSheet,\n onReset,\n onPreview,\n onReview,\n onStart,\n }) => {\n const { onClick: trackClick } = useUIContext();\n const titleTextRef = useRef<HTMLDivElement>(null);\n const [showTitleTooltip, setShowTitleTooltip] = useState(false);\n\n const {\n accuracy,\n permissions,\n title,\n sheet_statement: sheetStatement,\n state: sheetState,\n node_id: nodeId,\n user_node_id: userNodeId,\n node_sub_group: nodeSubGroup,\n node_type: nodeType,\n } = sheet;\n const {\n can_start: canStart,\n can_resume: canResume,\n can_unlock: canUnlock,\n can_review: canReview,\n can_teacher_review: canTeacherReview,\n can_unassign: canUnassign,\n can_reset: canReset,\n } = permissions;\n\n const sheetAccuracy = typeof accuracy === 'number' ? `${accuracy}%` : undefined;\n const isStudent = userType === 'STUDENT';\n const canReviewSheet = isStudent ? canReview : canTeacherReview;\n\n const ctaState = getResourceItemCtaState(sheetState);\n const { label, Icon } = getResourceItemCtaInfo(nodeSubGroup) || {};\n\n const analyticsProps = useMemo(\n () => ({\n node_id: nodeId,\n node_type: nodeType,\n }),\n [nodeId, nodeType],\n );\n\n const handleAssignSheet = useCallback(() => {\n trackClick({\n analyticsLabel: SHEETS_ANALYTICS_EVENTS.RESOURCE_ASSIGNED,\n props: analyticsProps,\n });\n\n onUnlock?.(nodeId);\n }, [onUnlock, nodeId, trackClick, analyticsProps]);\n\n const handleOnClick = useCallback(() => {\n if (isStudent && (canStart || canResume)) {\n if (typeof onStart === 'function') {\n onStart(nodeId, isV3Worksheet(sheet), userNodeId);\n\n return;\n }\n\n throw new Error('No callback is available');\n }\n\n if (canReviewSheet) {\n if (typeof onReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n if (!userNodeId) {\n throw new Error('user node id must be present to review the sheet');\n }\n\n onReview(userNodeId, isV3Worksheet(sheet, 'review'), userMilestoneId);\n\n return;\n }\n\n if (typeof onPreview !== 'function') {\n throw new Error('onPreview must be a function');\n }\n\n onPreview(sheet, isV3Worksheet(sheet));\n }, [\n canResume,\n canReviewSheet,\n canStart,\n isStudent,\n nodeId,\n sheet,\n userMilestoneId,\n userNodeId,\n onStart,\n onReview,\n onPreview,\n ]);\n\n const handleMenuOptionClick = useCallback(\n (selectedOption: string) => {\n switch (selectedOption) {\n case UNASSIGN:\n if (typeof onUnAssignSheet !== 'function') {\n throw new Error('onUnassignSheet must be a function');\n }\n\n trackClick({\n analyticsLabel: SHEETS_ANALYTICS_EVENTS.RESOURCE_UNASSIGNED,\n props: analyticsProps,\n });\n\n onUnAssignSheet(sheet);\n\n return;\n\n case REDO:\n if (typeof onReset !== 'function') {\n throw new Error('onReset must be a function');\n }\n\n onReset(sheet);\n\n return;\n }\n },\n [sheet, onUnAssignSheet, onReset, analyticsProps, trackClick],\n );\n\n useLayoutEffect(() => {\n if (\n titleTextRef.current &&\n titleTextRef.current.scrollHeight > titleTextRef.current.clientHeight\n ) {\n setShowTitleTooltip(true);\n }\n }, [titleTextRef]);\n\n const menuOptions: IMenuOptionsProps[] = [\n {\n id: 'supplementary_resources_unassign',\n label: 'Unassign',\n icon: <Minus2Icon width={20} height={20} />,\n option: UNASSIGN,\n visible: canUnassign,\n onClick: handleMenuOptionClick,\n },\n {\n id: 'supplementary_resources_redo',\n label: 'Redo',\n icon: <RedoIcon />,\n option: REDO,\n visible: canReset,\n onClick: handleMenuOptionClick,\n },\n ];\n\n const backgroundColor = getResourceItemBackgroundColor(\n sheetState,\n isStudent,\n canUnlock,\n !!isMilestoneWidget,\n );\n\n return (\n <Styled.ResourceItemCard\n $gapX={1}\n $gutterX={1}\n $flexGapX={1.25}\n $background={backgroundColor}\n $justifyContent=\"space-between\"\n $heightX={8}\n $isMilestoneWidget={isMilestoneWidget}\n >\n <ArrowTooltip\n renderAs=\"primary\"\n position=\"bottom\"\n tooltipItem={title}\n hidden={!showTitleTooltip}\n widthX={21.75}\n >\n <Styled.ResourceItemTitle ref={titleTextRef} $renderAs=\"ab2\" $color=\"BLACK_T_87\">\n {title}\n </Styled.ResourceItemTitle>\n </ArrowTooltip>\n\n <FlexView $flexDirection=\"row\" $justifyContent=\"space-between\" $alignItems=\"center\">\n <ArrowTooltip position=\"bottom\" tooltipItem={sheetStatement} renderAs=\"secondary\">\n <SheetButton\n renderAs=\"primary\"\n label={label ?? ''}\n Icon={Icon}\n backgroundColor={backgroundColor}\n state={ctaState}\n hoverActive={false}\n onClick={handleOnClick}\n accuracy={sheetAccuracy}\n widthX={8.5}\n />\n </ArrowTooltip>\n\n {!isStudent &&\n (canUnlock ? (\n <Styled.IconButtonWrapper\n $flexDirection=\"row\"\n $alignItems=\"center\"\n $justifyContent=\"center\"\n onClick={handleAssignSheet}\n >\n <Plus2Icon />\n </Styled.IconButtonWrapper>\n ) : (\n <ContextMenu\n targetElement={<ContextMenuTargetElement invertHover />}\n menuElement={<ContextMenuElement menuOptions={menuOptions} />}\n />\n ))}\n </FlexView>\n </Styled.ResourceItemCard>\n );\n },\n);\n\nexport default ResourceItem;\n"],"names":["UNASSIGN","REDO","TEACHER_MENU_OPTIONS","ResourceItem","memo","sheet","userType","isMilestoneWidget","userMilestoneId","onUnlock","onUnAssignSheet","onReset","onPreview","onReview","onStart","trackClick","useUIContext","titleTextRef","useRef","showTitleTooltip","setShowTitleTooltip","useState","accuracy","permissions","title","sheetStatement","sheetState","nodeId","userNodeId","nodeSubGroup","nodeType","canStart","canResume","canUnlock","canReview","canTeacherReview","canUnassign","canReset","sheetAccuracy","isStudent","canReviewSheet","ctaState","getResourceItemCtaState","label","Icon","getResourceItemCtaInfo","analyticsProps","useMemo","handleAssignSheet","useCallback","SHEETS_ANALYTICS_EVENTS","handleOnClick","isV3Worksheet","handleMenuOptionClick","selectedOption","useLayoutEffect","menuOptions","jsx","Minus2Icon","RedoIcon","backgroundColor","getResourceItemBackgroundColor","jsxs","Styled.ResourceItemCard","ArrowTooltip","Styled.ResourceItemTitle","FlexView","SheetButton","Styled.IconButtonWrapper","Plus2Icon","ContextMenu","ContextMenuTargetElement","ContextMenuElement"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,MAAM,EAAE,UAAAA,GAAU,MAAAC,EAAS,IAAAC,IAErBC,KAAuCC;AAAA,EAC3C,CAAC;AAAA,IACC,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,MACI;AACJ,UAAM,EAAE,SAASC,EAAW,IAAIC,GAAa,GACvCC,IAAeC,EAAuB,IAAI,GAC1C,CAACC,GAAkBC,CAAmB,IAAIC,EAAS,EAAK,GAExD;AAAA,MACJ,UAAAC;AAAA,MACA,aAAAC;AAAA,MACA,OAAAC;AAAA,MACA,iBAAiBC;AAAA,MACjB,OAAOC;AAAA,MACP,SAASC;AAAA,MACT,cAAcC;AAAA,MACd,gBAAgBC;AAAA,MAChB,WAAWC;AAAA,IACT,IAAAzB,GACE;AAAA,MACJ,WAAW0B;AAAA,MACX,YAAYC;AAAA,MACZ,YAAYC;AAAA,MACZ,YAAYC;AAAA,MACZ,oBAAoBC;AAAA,MACpB,cAAcC;AAAA,MACd,WAAWC;AAAA,IACT,IAAAd,GAEEe,IAAgB,OAAOhB,KAAa,WAAW,GAAGA,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back as I } from "react";
3
- import g from "../../../../../ui/buttons/button/button.js";
4
- import j from "../../../../../ui/context-menu/context-menu.js";
5
- import { useUIContext as U } from "../../../../../ui/context/context.js";
6
- import { NODE_TYPE as V } from "../../../../constants/sheet.js";
7
- import W from "../context-menu-helper/menu-element/menu-element.js";
8
- import Y from "../context-menu-helper/target-element/target-element.js";
9
- import { MENU_OPTIONS as E } from "./student-actions-constant.js";
10
- const K = ({
11
- sheet: v,
1
+ import { jsxs as A, Fragment as g, jsx as s } from "react/jsx-runtime";
2
+ import { useMemo as I, useCallback as C } from "react";
3
+ import V from "../../../../../ui/buttons/button/button.js";
4
+ import W from "../../../../../ui/context-menu/context-menu.js";
5
+ import { useUIContext as j } from "../../../../../ui/context/context.js";
6
+ import { NODE_TYPE as U } from "../../../../constants/sheet.js";
7
+ import { isV3Worksheet as m } from "../../../../utils/is-v3-worksheet.js";
8
+ import Y from "../context-menu-helper/menu-element/menu-element.js";
9
+ import z from "../context-menu-helper/target-element/target-element.js";
10
+ import { MENU_OPTIONS as R } from "./student-actions-constant.js";
11
+ const $ = ({
12
+ sheet: t,
12
13
  isDefocused: o,
13
- isLastSheet: C,
14
- ...N
14
+ isLastSheet: N,
15
+ ...x
15
16
  }) => {
16
- const { teacherId: _, milestoneId: a, section: m, onStart: d, onResume: c, onReattempt: u, onReview: p } = N, { permissions: x, node_id: l, user_node_id: e, node_type: M } = v, {
17
- can_start: r,
18
- can_resume: f,
17
+ const { teacherId: b, milestoneId: d, section: c, onStart: u, onResume: p, onReattempt: l, onReview: f } = x, { permissions: M, node_id: w, user_node_id: e, node_type: T } = t, {
18
+ can_start: i,
19
+ can_resume: E,
19
20
  can_review: h,
20
- can_reattempt: w,
21
- is_review_disabled: R
22
- } = x, t = M === V.DYNAMIC ? e : l, { onEvent: b } = U(), i = y(() => {
23
- const n = {
24
- teacher_id: _,
25
- node_id: l,
21
+ can_reattempt: _,
22
+ is_review_disabled: y
23
+ } = M, n = T === U.DYNAMIC ? e : w, { onEvent: v } = j(), a = I(() => {
24
+ const r = {
25
+ teacher_id: b,
26
+ node_id: w,
26
27
  user_node_id: e
27
28
  };
28
- return a && (n.milestone_id = a), m && (n.section = m), n;
29
- }, [a, l, m, _, e]), T = I(() => {
30
- if (!t)
29
+ return d && (r.milestone_id = d), c && (r.section = c), r;
30
+ }, [d, w, c, b, e]), k = C(() => {
31
+ if (!n)
31
32
  throw new Error("No required id is present to open the sheet.");
32
- if (r && typeof d == "function") {
33
- d(t, e);
33
+ if (i && typeof u == "function") {
34
+ u(n, m(t), e);
34
35
  return;
35
36
  }
36
- if (f && typeof c == "function") {
37
- c(t, e);
37
+ if (E && typeof p == "function") {
38
+ p(n, m(t), e);
38
39
  return;
39
40
  }
40
41
  throw new Error("No callback provided. If provided it must be a function");
41
- }, [f, r, t, c, d, e]), S = I(
42
- (n) => {
43
- if (b("clicked", {
44
- ...i,
45
- cta: n
46
- }), n === E.REVIEW) {
42
+ }, [E, i, n, p, u, t, e]), S = C(
43
+ (r) => {
44
+ if (v("clicked", {
45
+ ...a,
46
+ cta: r
47
+ }), r === R.REVIEW) {
47
48
  if (!e)
48
49
  throw new Error("No required id is present to open the sheet.");
49
- if (typeof p != "function")
50
+ if (typeof f != "function")
50
51
  throw new Error("onReview must be a function");
51
- p(e);
52
+ f(e, m(t, "review"));
52
53
  return;
53
54
  }
54
- if (!t)
55
+ if (!n)
55
56
  throw new Error("No required id is present to open the sheet.");
56
- if (typeof u != "function")
57
+ if (typeof l != "function")
57
58
  throw new Error("onReattempt must be a function");
58
- u(t, e);
59
+ l(n, m(t), e);
59
60
  },
60
- [i, t, u, p, b, e]
61
- ), k = r || f, O = !o && w || h, P = y(
61
+ [a, n, l, f, t, v, e]
62
+ ), O = i || E, P = !o && _ || h, q = I(
62
63
  () => [
63
64
  {
64
65
  show: h,
65
- label: E.REVIEW,
66
- disable: R
66
+ label: R.REVIEW,
67
+ disable: y
67
68
  },
68
69
  {
69
- show: !o && w,
70
- label: E.REATTEMPT
70
+ show: !o && _,
71
+ label: R.REATTEMPT
71
72
  }
72
73
  ],
73
- [w, h, o, R]
74
+ [_, h, o, y]
74
75
  );
75
- return /* @__PURE__ */ q(A, { children: [
76
- k && /* @__PURE__ */ s(
77
- g,
76
+ return /* @__PURE__ */ A(g, { children: [
77
+ O && /* @__PURE__ */ s(
78
+ V,
78
79
  {
79
- label: r ? "Start" : "Resume",
80
+ label: i ? "Start" : "Resume",
80
81
  widthX: 7,
81
82
  renderAs: "primary",
82
83
  size: "xsmall",
83
- onClick: T,
84
+ onClick: k,
84
85
  disabled: o,
85
- analyticsProps: i,
86
+ analyticsProps: a,
86
87
  shape: "square"
87
88
  }
88
89
  ),
89
- O && /* @__PURE__ */ s(
90
- j,
90
+ P && /* @__PURE__ */ s(
91
+ W,
91
92
  {
92
- targetElement: /* @__PURE__ */ s(Y, { analyticsLabel: "Sheet menu", analyticsProps: i }),
93
+ targetElement: /* @__PURE__ */ s(z, { analyticsLabel: "Sheet menu", analyticsProps: a }),
93
94
  menuElement: /* @__PURE__ */ s(
94
- W,
95
+ Y,
95
96
  {
96
- options: P,
97
+ options: q,
97
98
  handleOnMenuOptionSelection: S
98
99
  }
99
100
  ),
100
101
  menuOffset: 10,
101
102
  menuZIndex: 1,
102
- placeTop: C
103
+ placeTop: N
103
104
  }
104
105
  )
105
106
  ] });
106
107
  };
107
108
  export {
108
- K as default
109
+ $ as default
109
110
  };
110
111
  //# sourceMappingURL=student-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"student-actions.js","sources":["../../../../../../../src/features/sheets/sheets-list/sheet-item/reward-n-actions/student-actions/student-actions.tsx"],"sourcesContent":["import type { IRewardNActionsProps, TTrackEventPayloadProps } from '../reward-n-actions-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useMemo } from 'react';\n\nimport Button from '../../../../../ui/buttons/button/button';\nimport ContextMenu from '../../../../../ui/context-menu/context-menu';\nimport { useUIContext } from '../../../../../ui/context/context';\nimport { NODE_TYPE } from '../../../../constants/sheet';\nimport MenuElement from '../context-menu-helper/menu-element/menu-element';\nimport TargetElement from '../context-menu-helper/target-element/target-element';\nimport { MENU_OPTIONS } from './student-actions-constant';\n\nconst StudentActions: FC<IRewardNActionsProps> = ({\n sheet,\n isDefocused,\n isLastSheet,\n ...restStudentActionProps\n}) => {\n const { teacherId, milestoneId, section, onStart, onResume, onReattempt, onReview } =\n restStudentActionProps;\n const { permissions, node_id: nodeId, user_node_id: userNodeId, node_type: nodeType } = sheet;\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_reattempt: canReattempt,\n is_review_disabled: isReviewHidden,\n } = permissions;\n\n const id = nodeType === NODE_TYPE.DYNAMIC ? userNodeId : nodeId;\n\n const { onEvent: trackEvent } = useUIContext();\n\n const analyticsProps = useMemo(() => {\n const payload: TTrackEventPayloadProps = {\n teacher_id: teacherId,\n node_id: nodeId,\n user_node_id: userNodeId,\n };\n\n if (milestoneId) {\n payload.milestone_id = milestoneId;\n }\n\n if (section) {\n payload.section = section;\n }\n\n return payload;\n }, [milestoneId, nodeId, section, teacherId, userNodeId]);\n\n const handleOnPrimaryCtaClick = useCallback(() => {\n if (!id) {\n throw new Error('No required id is present to open the sheet.');\n }\n\n if (canStart && typeof onStart === 'function') {\n onStart(id, userNodeId);\n\n return;\n }\n\n if (canResume && typeof onResume === 'function') {\n onResume(id, userNodeId);\n\n return;\n }\n\n throw new Error('No callback provided. If provided it must be a function');\n }, [canResume, canStart, id, onResume, onStart, userNodeId]);\n\n const handleOnMenuOptionSelection = useCallback(\n (selectedOption: string) => {\n trackEvent('clicked', {\n ...analyticsProps,\n cta: selectedOption,\n });\n if (selectedOption === MENU_OPTIONS.REVIEW) {\n if (!userNodeId) {\n throw new Error('No required id is present to open the sheet.');\n }\n\n if (typeof onReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n onReview(userNodeId);\n\n return;\n }\n\n if (!id) {\n throw new Error('No required id is present to open the sheet.');\n }\n\n if (typeof onReattempt !== 'function') {\n throw new Error('onReattempt must be a function');\n }\n\n onReattempt(id, userNodeId);\n\n return;\n },\n [analyticsProps, id, onReattempt, onReview, trackEvent, userNodeId],\n );\n\n const renderPrimaryCta = canStart || canResume;\n const renderContextMenu = (!isDefocused && canReattempt) || canReview;\n\n const options = useMemo(\n () => [\n {\n show: canReview,\n label: MENU_OPTIONS.REVIEW,\n disable: isReviewHidden,\n },\n {\n show: !isDefocused && canReattempt,\n label: MENU_OPTIONS.REATTEMPT,\n },\n ],\n [canReattempt, canReview, isDefocused, isReviewHidden],\n );\n\n return (\n <>\n {renderPrimaryCta && (\n <Button\n label={canStart ? 'Start' : 'Resume'}\n widthX={7}\n renderAs=\"primary\"\n size=\"xsmall\"\n onClick={handleOnPrimaryCtaClick}\n disabled={isDefocused}\n analyticsProps={analyticsProps}\n shape=\"square\"\n />\n )}\n\n {renderContextMenu && (\n <ContextMenu\n targetElement={\n <TargetElement analyticsLabel=\"Sheet menu\" analyticsProps={analyticsProps} />\n }\n menuElement={\n <MenuElement\n options={options}\n handleOnMenuOptionSelection={handleOnMenuOptionSelection}\n />\n }\n menuOffset={10}\n menuZIndex={1}\n placeTop={isLastSheet}\n />\n )}\n </>\n );\n};\n\nexport default StudentActions;\n"],"names":["StudentActions","sheet","isDefocused","isLastSheet","restStudentActionProps","teacherId","milestoneId","section","onStart","onResume","onReattempt","onReview","permissions","nodeId","userNodeId","nodeType","canStart","canResume","canReview","canReattempt","isReviewHidden","id","NODE_TYPE","trackEvent","useUIContext","analyticsProps","useMemo","payload","handleOnPrimaryCtaClick","useCallback","handleOnMenuOptionSelection","selectedOption","MENU_OPTIONS","renderPrimaryCta","renderContextMenu","options","jsxs","Fragment","jsx","Button","ContextMenu","TargetElement","MenuElement"],"mappings":";;;;;;;;;AAaA,MAAMA,IAA2C,CAAC;AAAA,EAChD,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACE,QAAA,EAAE,WAAAC,GAAW,aAA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AA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"student-actions.js","sources":["../../../../../../../src/features/sheets/sheets-list/sheet-item/reward-n-actions/student-actions/student-actions.tsx"],"sourcesContent":["import type { IRewardNActionsProps, TTrackEventPayloadProps } from '../reward-n-actions-types';\nimport type { FC } from 'react';\n\nimport { useCallback, useMemo } from 'react';\n\nimport Button from '../../../../../ui/buttons/button/button';\nimport ContextMenu from '../../../../../ui/context-menu/context-menu';\nimport { useUIContext } from '../../../../../ui/context/context';\nimport { NODE_TYPE } from '../../../../constants/sheet';\nimport { isV3Worksheet } from '../../../../utils/is-v3-worksheet';\nimport MenuElement from '../context-menu-helper/menu-element/menu-element';\nimport TargetElement from '../context-menu-helper/target-element/target-element';\nimport { MENU_OPTIONS } from './student-actions-constant';\n\nconst StudentActions: FC<IRewardNActionsProps> = ({\n sheet,\n isDefocused,\n isLastSheet,\n ...restStudentActionProps\n}) => {\n const { teacherId, milestoneId, section, onStart, onResume, onReattempt, onReview } =\n restStudentActionProps;\n const { permissions, node_id: nodeId, user_node_id: userNodeId, node_type: nodeType } = sheet;\n\n const {\n can_start: canStart,\n can_resume: canResume,\n can_review: canReview,\n can_reattempt: canReattempt,\n is_review_disabled: isReviewHidden,\n } = permissions;\n\n const id = nodeType === NODE_TYPE.DYNAMIC ? userNodeId : nodeId;\n\n const { onEvent: trackEvent } = useUIContext();\n\n const analyticsProps = useMemo(() => {\n const payload: TTrackEventPayloadProps = {\n teacher_id: teacherId,\n node_id: nodeId,\n user_node_id: userNodeId,\n };\n\n if (milestoneId) {\n payload.milestone_id = milestoneId;\n }\n\n if (section) {\n payload.section = section;\n }\n\n return payload;\n }, [milestoneId, nodeId, section, teacherId, userNodeId]);\n\n const handleOnPrimaryCtaClick = useCallback(() => {\n if (!id) {\n throw new Error('No required id is present to open the sheet.');\n }\n\n if (canStart && typeof onStart === 'function') {\n onStart(id, isV3Worksheet(sheet), userNodeId);\n\n return;\n }\n\n if (canResume && typeof onResume === 'function') {\n onResume(id, isV3Worksheet(sheet), userNodeId);\n\n return;\n }\n\n throw new Error('No callback provided. If provided it must be a function');\n }, [canResume, canStart, id, onResume, onStart, sheet, userNodeId]);\n\n const handleOnMenuOptionSelection = useCallback(\n (selectedOption: string) => {\n trackEvent('clicked', {\n ...analyticsProps,\n cta: selectedOption,\n });\n if (selectedOption === MENU_OPTIONS.REVIEW) {\n if (!userNodeId) {\n throw new Error('No required id is present to open the sheet.');\n }\n\n if (typeof onReview !== 'function') {\n throw new Error('onReview must be a function');\n }\n\n onReview(userNodeId, isV3Worksheet(sheet, 'review'));\n\n return;\n }\n\n if (!id) {\n throw new Error('No required id is present to open the sheet.');\n }\n\n if (typeof onReattempt !== 'function') {\n throw new Error('onReattempt must be a function');\n }\n\n onReattempt(id, isV3Worksheet(sheet), userNodeId);\n\n return;\n },\n [analyticsProps, id, onReattempt, onReview, sheet, trackEvent, userNodeId],\n );\n\n const renderPrimaryCta = canStart || canResume;\n const renderContextMenu = (!isDefocused && canReattempt) || canReview;\n\n const options = useMemo(\n () => [\n {\n show: canReview,\n label: MENU_OPTIONS.REVIEW,\n disable: isReviewHidden,\n },\n {\n show: !isDefocused && canReattempt,\n label: MENU_OPTIONS.REATTEMPT,\n },\n ],\n [canReattempt, canReview, isDefocused, isReviewHidden],\n );\n\n return (\n <>\n {renderPrimaryCta && (\n <Button\n label={canStart ? 'Start' : 'Resume'}\n widthX={7}\n renderAs=\"primary\"\n size=\"xsmall\"\n onClick={handleOnPrimaryCtaClick}\n disabled={isDefocused}\n analyticsProps={analyticsProps}\n shape=\"square\"\n />\n )}\n\n {renderContextMenu && (\n <ContextMenu\n targetElement={\n <TargetElement analyticsLabel=\"Sheet menu\" analyticsProps={analyticsProps} />\n }\n menuElement={\n <MenuElement\n options={options}\n handleOnMenuOptionSelection={handleOnMenuOptionSelection}\n />\n }\n menuOffset={10}\n menuZIndex={1}\n placeTop={isLastSheet}\n />\n )}\n </>\n );\n};\n\nexport default StudentActions;\n"],"names":["StudentActions","sheet","isDefocused","isLastSheet","restStudentActionProps","teacherId","milestoneId","section","onStart","onResume","onReattempt","onReview","permissions","nodeId","userNodeId","nodeType","canStart","canResume","canReview","canReattempt","isReviewHidden","id","NODE_TYPE","trackEvent","useUIContext","analyticsProps","useMemo","payload","handleOnPrimaryCtaClick","useCallback","isV3Worksheet","handleOnMenuOptionSelection","selectedOption","MENU_OPTIONS","renderPrimaryCta","renderContextMenu","options","jsxs","Fragment","jsx","Button","ContextMenu","TargetElement","MenuElement"],"mappings":";;;;;;;;;;AAcA,MAAMA,IAA2C,CAAC;AAAA,EAChD,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACE,QAAA,EAAE,WAAAC,GAAW,aAAAC,GAAa,SAAAC,GAAS,SAAAC,GAAS,UAAAC,GAAU,aAAAC,GAAa,UAAAC,EACvE,IAAAP,GACI,EAAE,aAAAQ,GAAa,SAASC,GAAQ,cAAcC,GAAY,WAAWC,EAAa,IAAAd,GAElF;AAAA,IACJ,WAAWe;AAAA,IACX,YAAYC;AAAA,IACZ,YAAYC;AAAA,IACZ,eAAeC;AAAA,IACf,oBAAoBC;AAAA,EAClB,IAAAR,GAEES,IAAKN,MAAaO,EAAU,UAAUR,IAAaD,GAEnD,EAAE,SAASU,EAAW,IAAIC,EAAa,GAEvCC,IAAiBC,EAAQ,MAAM;AACnC,UAAMC,IAAmC;AAAA,MACvC,YAAYtB;AAAA,MACZ,SAASQ;AAAA,MACT,cAAcC;AAAA,IAAA;AAGhB,WAAIR,MACFqB,EAAQ,eAAerB,IAGrBC,MACFoB,EAAQ,UAAUpB,IAGboB;AAAA,EAAA,GACN,CAACrB,GAAaO,GAAQN,GAASF,GAAWS,CAAU,CAAC,GAElDc,IAA0BC,EAAY,MAAM;AAChD,QAAI,CAACR;AACG,YAAA,IAAI,MAAM,8CAA8C;AAG5D,QAAAL,KAAY,OAAOR,KAAY,YAAY;AAC7C,MAAAA,EAAQa,GAAIS,E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