@cuemath/web-utils 1.0.0-beta.14 → 1.0.0

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 (237) hide show
  1. package/.husky/pre-commit +0 -1
  2. package/dist/cookie/index.d.ts +1 -1
  3. package/dist/cookie/index.js +2 -3
  4. package/dist/cookie/index.js.map +1 -1
  5. package/dist/growth-source/index.d.ts +6 -0
  6. package/dist/growth-source/index.js +151 -0
  7. package/dist/growth-source/index.js.map +1 -0
  8. package/dist/growth-source/types.d.ts +25 -0
  9. package/dist/growth-source/types.js +3 -0
  10. package/dist/growth-source/types.js.map +1 -0
  11. package/dist/index.d.ts +1 -6
  12. package/dist/index.js +1 -6
  13. package/dist/index.js.map +1 -1
  14. package/package.json +3 -7
  15. package/src/cookie/index.ts +10 -4
  16. package/src/growth-source/index.ts +191 -0
  17. package/src/growth-source/types.ts +33 -0
  18. package/src/index.ts +1 -6
  19. package/.eslintignore +0 -2
  20. package/.huskyrc +0 -5
  21. package/.lintstagedrc.yml +0 -5
  22. package/dist/constants/country/index.d.ts +0 -2
  23. package/dist/constants/country/index.js +0 -7
  24. package/dist/constants/country/index.js.map +0 -1
  25. package/dist/constants/country/iso-country-code.d.ts +0 -248
  26. package/dist/constants/country/iso-country-code.js +0 -252
  27. package/dist/constants/country/iso-country-code.js.map +0 -1
  28. package/dist/constants/date-time/index.d.ts +0 -17
  29. package/dist/constants/date-time/index.js +0 -42
  30. package/dist/constants/date-time/index.js.map +0 -1
  31. package/dist/constants/date-time/international-timezones.d.ts +0 -7
  32. package/dist/constants/date-time/international-timezones.js +0 -155
  33. package/dist/constants/date-time/international-timezones.js.map +0 -1
  34. package/dist/constants/e-cna/index.d.ts +0 -41
  35. package/dist/constants/e-cna/index.js +0 -45
  36. package/dist/constants/e-cna/index.js.map +0 -1
  37. package/dist/constants/index.d.ts +0 -2
  38. package/dist/constants/index.js +0 -19
  39. package/dist/constants/index.js.map +0 -1
  40. package/dist/country/index.d.ts +0 -1
  41. package/dist/country/index.js +0 -13
  42. package/dist/country/index.js.map +0 -1
  43. package/dist/date-time-helper/e-cna.d.ts +0 -32
  44. package/dist/date-time-helper/e-cna.js +0 -153
  45. package/dist/date-time-helper/e-cna.js.map +0 -1
  46. package/dist/date-time-helper/index.d.ts +0 -54
  47. package/dist/date-time-helper/index.js +0 -290
  48. package/dist/date-time-helper/index.js.map +0 -1
  49. package/dist/e-cna/flow/aggregator.d.ts +0 -473
  50. package/dist/e-cna/flow/aggregator.js +0 -17
  51. package/dist/e-cna/flow/aggregator.js.map +0 -1
  52. package/dist/e-cna/flow/index.d.ts +0 -1
  53. package/dist/e-cna/flow/index.js +0 -18
  54. package/dist/e-cna/flow/index.js.map +0 -1
  55. package/dist/e-cna/flow/variants/default.d.ts +0 -734
  56. package/dist/e-cna/flow/variants/default.js +0 -95
  57. package/dist/e-cna/flow/variants/default.js.map +0 -1
  58. package/dist/e-cna/flow/variants/index.d.ts +0 -1
  59. package/dist/e-cna/flow/variants/index.js +0 -18
  60. package/dist/e-cna/flow/variants/index.js.map +0 -1
  61. package/dist/e-cna/index.d.ts +0 -43
  62. package/dist/e-cna/index.js +0 -221
  63. package/dist/e-cna/index.js.map +0 -1
  64. package/dist/e-cna/slides/child_hobbies/index.d.ts +0 -1
  65. package/dist/e-cna/slides/child_hobbies/index.js +0 -18
  66. package/dist/e-cna/slides/child_hobbies/index.js.map +0 -1
  67. package/dist/e-cna/slides/child_hobbies/variants.d.ts +0 -22
  68. package/dist/e-cna/slides/child_hobbies/variants.js +0 -26
  69. package/dist/e-cna/slides/child_hobbies/variants.js.map +0 -1
  70. package/dist/e-cna/slides/child_info/index.d.ts +0 -1
  71. package/dist/e-cna/slides/child_info/index.js +0 -18
  72. package/dist/e-cna/slides/child_info/index.js.map +0 -1
  73. package/dist/e-cna/slides/child_info/variants.d.ts +0 -17
  74. package/dist/e-cna/slides/child_info/variants.js +0 -22
  75. package/dist/e-cna/slides/child_info/variants.js.map +0 -1
  76. package/dist/e-cna/slides/child_personality/index.d.ts +0 -1
  77. package/dist/e-cna/slides/child_personality/index.js +0 -18
  78. package/dist/e-cna/slides/child_personality/index.js.map +0 -1
  79. package/dist/e-cna/slides/child_personality/variants.d.ts +0 -12
  80. package/dist/e-cna/slides/child_personality/variants.js +0 -16
  81. package/dist/e-cna/slides/child_personality/variants.js.map +0 -1
  82. package/dist/e-cna/slides/curriculum/index.d.ts +0 -1
  83. package/dist/e-cna/slides/curriculum/index.js +0 -18
  84. package/dist/e-cna/slides/curriculum/index.js.map +0 -1
  85. package/dist/e-cna/slides/curriculum/variants.d.ts +0 -12
  86. package/dist/e-cna/slides/curriculum/variants.js +0 -17
  87. package/dist/e-cna/slides/curriculum/variants.js.map +0 -1
  88. package/dist/e-cna/slides/grade/index.d.ts +0 -1
  89. package/dist/e-cna/slides/grade/index.js +0 -18
  90. package/dist/e-cna/slides/grade/index.js.map +0 -1
  91. package/dist/e-cna/slides/grade/variants.d.ts +0 -14
  92. package/dist/e-cna/slides/grade/variants.js +0 -31
  93. package/dist/e-cna/slides/grade/variants.js.map +0 -1
  94. package/dist/e-cna/slides/index.d.ts +0 -19
  95. package/dist/e-cna/slides/index.js +0 -36
  96. package/dist/e-cna/slides/index.js.map +0 -1
  97. package/dist/e-cna/slides/intro/index.d.ts +0 -1
  98. package/dist/e-cna/slides/intro/index.js +0 -18
  99. package/dist/e-cna/slides/intro/index.js.map +0 -1
  100. package/dist/e-cna/slides/intro/variants.d.ts +0 -7
  101. package/dist/e-cna/slides/intro/variants.js +0 -11
  102. package/dist/e-cna/slides/intro/variants.js.map +0 -1
  103. package/dist/e-cna/slides/key_need_l1/index.d.ts +0 -1
  104. package/dist/e-cna/slides/key_need_l1/index.js +0 -18
  105. package/dist/e-cna/slides/key_need_l1/index.js.map +0 -1
  106. package/dist/e-cna/slides/key_need_l1/variants.d.ts +0 -26
  107. package/dist/e-cna/slides/key_need_l1/variants.js +0 -57
  108. package/dist/e-cna/slides/key_need_l1/variants.js.map +0 -1
  109. package/dist/e-cna/slides/key_need_l2/index.d.ts +0 -1
  110. package/dist/e-cna/slides/key_need_l2/index.js +0 -18
  111. package/dist/e-cna/slides/key_need_l2/index.js.map +0 -1
  112. package/dist/e-cna/slides/key_need_l2/variants.d.ts +0 -67
  113. package/dist/e-cna/slides/key_need_l2/variants.js +0 -139
  114. package/dist/e-cna/slides/key_need_l2/variants.js.map +0 -1
  115. package/dist/e-cna/slides/key_need_l3/index.d.ts +0 -1
  116. package/dist/e-cna/slides/key_need_l3/index.js +0 -18
  117. package/dist/e-cna/slides/key_need_l3/index.js.map +0 -1
  118. package/dist/e-cna/slides/key_need_l3/variants.d.ts +0 -11
  119. package/dist/e-cna/slides/key_need_l3/variants.js +0 -15
  120. package/dist/e-cna/slides/key_need_l3/variants.js.map +0 -1
  121. package/dist/e-cna/slides/math-perception/index.d.ts +0 -1
  122. package/dist/e-cna/slides/math-perception/index.js +0 -18
  123. package/dist/e-cna/slides/math-perception/index.js.map +0 -1
  124. package/dist/e-cna/slides/math-perception/variants.d.ts +0 -15
  125. package/dist/e-cna/slides/math-perception/variants.js +0 -32
  126. package/dist/e-cna/slides/math-perception/variants.js.map +0 -1
  127. package/dist/e-cna/slides/other_curriculum/index.d.ts +0 -1
  128. package/dist/e-cna/slides/other_curriculum/index.js +0 -18
  129. package/dist/e-cna/slides/other_curriculum/index.js.map +0 -1
  130. package/dist/e-cna/slides/other_curriculum/variants.d.ts +0 -12
  131. package/dist/e-cna/slides/other_curriculum/variants.js +0 -17
  132. package/dist/e-cna/slides/other_curriculum/variants.js.map +0 -1
  133. package/dist/e-cna/slides/school_performance_5_12/index.d.ts +0 -1
  134. package/dist/e-cna/slides/school_performance_5_12/index.js +0 -18
  135. package/dist/e-cna/slides/school_performance_5_12/index.js.map +0 -1
  136. package/dist/e-cna/slides/school_performance_5_12/variants.d.ts +0 -15
  137. package/dist/e-cna/slides/school_performance_5_12/variants.js +0 -26
  138. package/dist/e-cna/slides/school_performance_5_12/variants.js.map +0 -1
  139. package/dist/e-cna/slides/school_performance_kg_4/index.d.ts +0 -1
  140. package/dist/e-cna/slides/school_performance_kg_4/index.js +0 -18
  141. package/dist/e-cna/slides/school_performance_kg_4/index.js.map +0 -1
  142. package/dist/e-cna/slides/school_performance_kg_4/variants.d.ts +0 -14
  143. package/dist/e-cna/slides/school_performance_kg_4/variants.js +0 -28
  144. package/dist/e-cna/slides/school_performance_kg_4/variants.js.map +0 -1
  145. package/dist/e-cna/slides/secondary_needs/index.d.ts +0 -1
  146. package/dist/e-cna/slides/secondary_needs/index.js +0 -18
  147. package/dist/e-cna/slides/secondary_needs/index.js.map +0 -1
  148. package/dist/e-cna/slides/secondary_needs/variants.d.ts +0 -14
  149. package/dist/e-cna/slides/secondary_needs/variants.js +0 -28
  150. package/dist/e-cna/slides/secondary_needs/variants.js.map +0 -1
  151. package/dist/e-cna/slides/signup/index.d.ts +0 -1
  152. package/dist/e-cna/slides/signup/index.js +0 -18
  153. package/dist/e-cna/slides/signup/index.js.map +0 -1
  154. package/dist/e-cna/slides/signup/variants.d.ts +0 -7
  155. package/dist/e-cna/slides/signup/variants.js +0 -11
  156. package/dist/e-cna/slides/signup/variants.js.map +0 -1
  157. package/dist/e-cna/slides/signup_refer/index.d.ts +0 -1
  158. package/dist/e-cna/slides/signup_refer/index.js +0 -18
  159. package/dist/e-cna/slides/signup_refer/index.js.map +0 -1
  160. package/dist/e-cna/slides/signup_refer/variants.d.ts +0 -12
  161. package/dist/e-cna/slides/signup_refer/variants.js +0 -20
  162. package/dist/e-cna/slides/signup_refer/variants.js.map +0 -1
  163. package/dist/e-cna/slides/slot_pick/index.d.ts +0 -1
  164. package/dist/e-cna/slides/slot_pick/index.js +0 -18
  165. package/dist/e-cna/slides/slot_pick/index.js.map +0 -1
  166. package/dist/e-cna/slides/slot_pick/variants.d.ts +0 -12
  167. package/dist/e-cna/slides/slot_pick/variants.js +0 -16
  168. package/dist/e-cna/slides/slot_pick/variants.js.map +0 -1
  169. package/dist/e-cna/slides/teacher_intro/index.d.ts +0 -1
  170. package/dist/e-cna/slides/teacher_intro/index.js +0 -18
  171. package/dist/e-cna/slides/teacher_intro/index.js.map +0 -1
  172. package/dist/e-cna/slides/teacher_intro/variants.d.ts +0 -78
  173. package/dist/e-cna/slides/teacher_intro/variants.js +0 -116
  174. package/dist/e-cna/slides/teacher_intro/variants.js.map +0 -1
  175. package/dist/e-cna/utils/index.d.ts +0 -4
  176. package/dist/e-cna/utils/index.js +0 -28
  177. package/dist/e-cna/utils/index.js.map +0 -1
  178. package/dist/local-storage/index.d.ts +0 -13
  179. package/dist/local-storage/index.js +0 -172
  180. package/dist/local-storage/index.js.map +0 -1
  181. package/dist/object/index.d.ts +0 -6
  182. package/dist/object/index.js +0 -24
  183. package/dist/object/index.js.map +0 -1
  184. package/src/constants/country/index.ts +0 -2
  185. package/src/constants/country/iso-country-code.ts +0 -248
  186. package/src/constants/date-time/index.ts +0 -43
  187. package/src/constants/date-time/international-timezones.ts +0 -157
  188. package/src/constants/e-cna/index.ts +0 -55
  189. package/src/constants/index.ts +0 -2
  190. package/src/country/index.ts +0 -9
  191. package/src/date-time-helper/e-cna.ts +0 -205
  192. package/src/date-time-helper/index.ts +0 -365
  193. package/src/e-cna/flow/aggregator.ts +0 -12
  194. package/src/e-cna/flow/index.ts +0 -1
  195. package/src/e-cna/flow/variants/default.ts +0 -113
  196. package/src/e-cna/flow/variants/index.ts +0 -1
  197. package/src/e-cna/index.ts +0 -249
  198. package/src/e-cna/slides/child_hobbies/index.ts +0 -1
  199. package/src/e-cna/slides/child_hobbies/variants.ts +0 -24
  200. package/src/e-cna/slides/child_info/index.ts +0 -1
  201. package/src/e-cna/slides/child_info/variants.ts +0 -18
  202. package/src/e-cna/slides/child_personality/index.ts +0 -1
  203. package/src/e-cna/slides/child_personality/variants.ts +0 -12
  204. package/src/e-cna/slides/curriculum/index.ts +0 -1
  205. package/src/e-cna/slides/curriculum/variants.ts +0 -14
  206. package/src/e-cna/slides/grade/index.ts +0 -1
  207. package/src/e-cna/slides/grade/variants.ts +0 -29
  208. package/src/e-cna/slides/index.ts +0 -19
  209. package/src/e-cna/slides/intro/index.ts +0 -1
  210. package/src/e-cna/slides/intro/variants.ts +0 -7
  211. package/src/e-cna/slides/key_need_l1/index.ts +0 -1
  212. package/src/e-cna/slides/key_need_l1/variants.ts +0 -57
  213. package/src/e-cna/slides/key_need_l2/index.ts +0 -1
  214. package/src/e-cna/slides/key_need_l2/variants.ts +0 -143
  215. package/src/e-cna/slides/key_need_l3/index.ts +0 -1
  216. package/src/e-cna/slides/key_need_l3/variants.ts +0 -13
  217. package/src/e-cna/slides/math-perception/index.ts +0 -1
  218. package/src/e-cna/slides/math-perception/variants.ts +0 -30
  219. package/src/e-cna/slides/other_curriculum/index.ts +0 -1
  220. package/src/e-cna/slides/other_curriculum/variants.ts +0 -14
  221. package/src/e-cna/slides/school_performance_5_12/index.ts +0 -1
  222. package/src/e-cna/slides/school_performance_5_12/variants.ts +0 -23
  223. package/src/e-cna/slides/school_performance_kg_4/index.ts +0 -1
  224. package/src/e-cna/slides/school_performance_kg_4/variants.ts +0 -25
  225. package/src/e-cna/slides/secondary_needs/index.ts +0 -1
  226. package/src/e-cna/slides/secondary_needs/variants.ts +0 -26
  227. package/src/e-cna/slides/signup/index.ts +0 -1
  228. package/src/e-cna/slides/signup/variants.ts +0 -7
  229. package/src/e-cna/slides/signup_refer/index.ts +0 -1
  230. package/src/e-cna/slides/signup_refer/variants.ts +0 -16
  231. package/src/e-cna/slides/slot_pick/index.ts +0 -1
  232. package/src/e-cna/slides/slot_pick/variants.ts +0 -12
  233. package/src/e-cna/slides/teacher_intro/index.ts +0 -1
  234. package/src/e-cna/slides/teacher_intro/variants.ts +0 -114
  235. package/src/e-cna/utils/index.ts +0 -32
  236. package/src/local-storage/index.ts +0 -186
  237. package/src/object/index.ts +0 -26
@@ -1,249 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { CUE_COUNTRY_CODE_KEY, SLIDE_TYPES } from '../constants';
3
- import { getCookie } from '../cookie';
4
- import { getTimezone, dateByTimezone, getCurrentTimestamp } from '../date-time-helper';
5
-
6
- const showCallModalURL: string[] = [
7
- SLIDE_TYPES.INTRO,
8
- SLIDE_TYPES.QUESTION,
9
- SLIDE_TYPES.SLOT_PICK,
10
- SLIDE_TYPES.PARENT_STUDENT_DETAILS,
11
- ];
12
- const ignoreCallModalURL: string[] = ['otp_enabled'];
13
- const ECNA = '#/e-cna/';
14
-
15
- export const timeSlots = {
16
- now: 'Now',
17
- anytime: 'Anytime',
18
- today: 'Today',
19
- tomorrow: 'Tomorrow',
20
- };
21
-
22
- export const ecnaSlideTypeName = {
23
- CLASS_CONFIRMED: SLIDE_TYPES.CLASS_CONFIRMED,
24
- };
25
-
26
- export const getSlideDetails = (path: string) => {
27
- const hash = path?.split('#')[1] || '';
28
- const href = hash?.split('/') || [];
29
-
30
- const slideType = href?.[2];
31
- let slideId: string | number = href?.[3];
32
-
33
- if (slideType === ecnaSlideTypeName.CLASS_CONFIRMED) {
34
- slideId = 16;
35
- }
36
-
37
- if (slideId === 'curriculum') {
38
- slideId = 17;
39
- }
40
-
41
- return {
42
- slideType,
43
- slideId,
44
- };
45
- };
46
-
47
- export function handleModalClose(
48
- path: string,
49
- // actions: any
50
- ) {
51
- // const { slideType, slideId } = getSlideDetails(path);
52
-
53
- // parentAnalytics.ecnaModalClosed(
54
- // slideType === SLIDE_TYPES.QUESTION ? questionsData[slideId]?.questionID : slideType,
55
- // );
56
-
57
- if (!path) {
58
- return 'close';
59
- }
60
-
61
- const filteredData = showCallModalURL.filter(key => path.includes(`${ECNA}${key}`));
62
- const noCallfilteredData = ignoreCallModalURL.filter(key => path.includes(key));
63
-
64
- if (filteredData.length && !noCallfilteredData.length) {
65
- setTimeout(() => {
66
- // const isMobileView = (window && window.innerWidth <= 767) || false;
67
- // Router.pushRoute(`${ECNA}exit-parent/`);
68
- // openEcnaModal({ actions, isMobileView });
69
- }, 500);
70
- } else {
71
- // Router.pushRoute('#');
72
- }
73
-
74
- return 'close';
75
- }
76
-
77
- // export function openEcnaModal({ actions, isMobileView, type, id }): void {
78
- // actions.openModal(
79
- // 'e-cna-form',
80
- // {
81
- // size: 'custom',
82
- // width: '624px',
83
- // height: isMobileView && window ? 'auto' : '548px',
84
- // style: {
85
- // backgroundColor: `${COLORS.WILD_SAND}`,
86
- // padding: '0px',
87
- // },
88
- // outSideCloseButton: true,
89
- // blocking: !isMobileView,
90
- // handleModalClose: (path, modalActions) => handleModalClose(path, modalActions),
91
- // enableTransform: !isMobileView,
92
- // },
93
- // {
94
- // type,
95
- // id,
96
- // },
97
- // );
98
- // }
99
-
100
- // export const handleOpenEcnaModal = ({ actions, isMobileView, type, id }) => {
101
- // openEcnaModal({ actions, isMobileView, type, id });
102
- // };
103
-
104
- const getTime = (baseTime: number, requiredTime: number) => {
105
- return baseTime + requiredTime * 60 * 60;
106
- };
107
-
108
- const getTimeFormat = (reqtime: number, format = 'ha') => {
109
- const timezone = getTimezone();
110
-
111
- return dateByTimezone(reqtime, timezone, format);
112
- };
113
-
114
- const getTitle = (noOfDaysFromToday: number, requiredDay: number) => {
115
- if (noOfDaysFromToday === 0) {
116
- return timeSlots.today;
117
- }
118
-
119
- if (noOfDaysFromToday === 1) {
120
- return timeSlots.tomorrow;
121
- }
122
-
123
- const timezone = getTimezone();
124
-
125
- return dateByTimezone(requiredDay, timezone, 'DD/MM/YYYY');
126
- };
127
-
128
- export const getSlots = (noOfDaysFromToday = 0, slotDetails = []) => {
129
- const dateCon = new Date();
130
- const requiredDay = dateCon.setDate(dateCon.getDate() + noOfDaysFromToday);
131
-
132
- dateCon.setHours(0, 0, 0, 0); // making time 12am
133
- const baseTime = dateCon.getTime() / 1000;
134
- const currentTime = getCurrentTimestamp();
135
-
136
- const tabSlots = slotDetails?.map(({ from, to, custom }) => {
137
- // 'Now' slot condition. Keeping it for future usage
138
- // if (custom === timeSlots.now) {
139
- // return ({
140
- // key: custom,
141
- // label: custom,
142
- // slot: { from: currentTime }
143
- // })
144
- // }
145
-
146
- const anyTimeStamp = getTime(baseTime, 20); // 8pm timestamp. choosen randomly
147
-
148
- if (custom === timeSlots.anytime) {
149
- return {
150
- key: anyTimeStamp,
151
- label: custom,
152
- slot: { from: '', to: anyTimeStamp },
153
- };
154
- }
155
-
156
- const fromTime = getTime(baseTime, from);
157
- const toTime = getTime(baseTime, to);
158
- const fromTimeFormat = getTimeFormat(fromTime * 1000);
159
- const toTimeFormat = getTimeFormat(toTime * 1000);
160
- const isDisabled = currentTime - toTime > 0;
161
-
162
- return {
163
- key: `${fromTime}${toTime}`,
164
- label: `${fromTimeFormat} - ${toTimeFormat}`,
165
- disabled: isDisabled,
166
- slot: { from: fromTime, to: toTime },
167
- };
168
- });
169
-
170
- const data = { title: getTitle(noOfDaysFromToday, requiredDay), slots: tabSlots };
171
-
172
- return data;
173
- };
174
-
175
- export const getOrigin = () => {
176
- const { origin = '' } =
177
- typeof window !== 'undefined' && window.location ? window.location : {};
178
-
179
- return origin;
180
- };
181
-
182
- export const getQueryField = (asPath: string, field: string) => {
183
- let searchParams: any = asPath?.split('?') || [];
184
-
185
- searchParams = searchParams.length > 2 ? searchParams[2] : searchParams[1];
186
- const params = new URLSearchParams(searchParams);
187
-
188
- return params.get(field) || '';
189
- };
190
-
191
- // export const FadeIn = keyframes`
192
- // from {
193
- // opacity: 0;
194
- // transform: translateX(480px);
195
-
196
- // }
197
- // to {
198
- // opacity: 1;
199
- // transform: translateX(0);
200
- // }
201
- // `;
202
-
203
- export const getCounsellorSpelling = () => {
204
- const cueCountryCode = getCookie('cue_country_code');
205
-
206
- return cueCountryCode === 'US' ? 'Counselor' : 'Counsellor';
207
- };
208
-
209
- // export const uniqueTimeZones = [
210
- // ...new Map(timezones.map(item => [item.value, item])).values(),
211
- // ];
212
-
213
- // export let countrySpecificTimezones = uniqueTimeZones.filter(uniqueTimezone => {
214
- // const countryCode = getCookie('cue_country_code');
215
-
216
- // if (countryCode) {
217
- // return countryTimezones?.countries?.[getCookie('cue_country_code')]?.zones?.find(
218
- // countryTimezone => {
219
- // return countryTimezone === uniqueTimezone?.id;
220
- // },
221
- // );
222
- // }
223
-
224
- // return uniqueTimezone;
225
- // });
226
-
227
- export const isOtpRequired = (cueCountryCode: string) => {
228
- const noOtpCountrycodes = ['AU', 'NZ', 'SG'];
229
-
230
- return !(noOtpCountrycodes.findIndex(key => key === cueCountryCode) > -1);
231
- };
232
-
233
- export const getUrlWithoutHash = (asPath: string) => {
234
- return asPath?.includes('#') ? asPath.split('#')[0] : asPath;
235
- };
236
-
237
- export const showLaptopQuestion = () => {
238
- const cueCountryCode = getCookie(CUE_COUNTRY_CODE_KEY);
239
-
240
- return cueCountryCode === 'IN';
241
- };
242
-
243
- export const nonROWCountries: string[] = ['IN', 'US', 'CA'];
244
-
245
- export const isROWCountry = (countryCode: string) => {
246
- return !nonROWCountries.includes(countryCode);
247
- };
248
-
249
- export * from './flow';
@@ -1 +0,0 @@
1
- export * from './variants';
@@ -1,24 +0,0 @@
1
- export const child_hobbies = {
2
- DEFAULT: {
3
- id: 15,
4
- questionID: 'child_hobbies',
5
- type: 'freeFlowingText',
6
- question: 'What do they enjoy doing outside of school?',
7
- description:
8
- 'Tell us what your child has fun doing and has shown strong interests in.',
9
- questionUUID: 'ea6a29f3-c6b6-4932-b606-e828070fd6fe',
10
- placeholderText: 'Loves reading fiction novels, Harry Potter is the favourite',
11
- nextSlide: 'slot_pick',
12
- },
13
- WITH_ECNA: {
14
- id: 15,
15
- questionID: 'child_hobbies',
16
- type: 'freeFlowingText',
17
- question: 'What do they enjoy doing outside of school?',
18
- description:
19
- 'Tell us what your child has fun doing and has shown strong interests in.',
20
- questionUUID: 'ea6a29f3-c6b6-4932-b606-e828070fd6fe',
21
- placeholderText: 'Loves reading fiction novels, Harry Potter is the favourite',
22
- nextSlide: 'child_info',
23
- },
24
- };
@@ -1 +0,0 @@
1
- export * from './variants';
@@ -1,18 +0,0 @@
1
- export const child_info = {
2
- DEFAULT: {
3
- id: 'child_info',
4
- questionID: 'child_info',
5
- nextSlide:'loader' // if non-ecna + cred match
6
- },
7
- LOADER: {
8
- id: 'loader',
9
- questionID: 'loader',
10
- nextSlide:'teacher_unavailability' // if non-ecna + cred match
11
- },
12
- CHILD_INFO: {
13
- id: 'child_info',
14
- questionID: 'child_info',
15
- nextSlide: 'loader',// if ecna
16
- // nextSlide:'teacher-unavailability' // if non-ecna + cred match
17
- }
18
- }
@@ -1 +0,0 @@
1
- export * from './variants';
@@ -1,12 +0,0 @@
1
- export const child_personality = {
2
- DEFAULT: {
3
- id: 14,
4
- questionID: 'child_personality',
5
- type: 'freeFlowingText',
6
- question: "We'd like to know a little more about your child's personality.",
7
- description: 'This helps us better understand their math needs.',
8
- defaultNextquestionID: 'child_hobbies',
9
- questionUUID: 'ea6d4fd6-a819-45dd-8c6b-484db63265f3',
10
- placeholderText: "Too fidgety, can't sit & focus continuously",
11
- },
12
- };
@@ -1 +0,0 @@
1
- export * from './variants';
@@ -1,14 +0,0 @@
1
- import { QUESTION_ID } from "../../../constants";
2
-
3
- export const curriculum ={
4
- DEFAULT: {
5
- id: 17,
6
- questionID: QUESTION_ID.OTHER_CURRICULUM,
7
- type: 'freeFlowingText',
8
- question: 'Please enter the curriculum followed at your child’s school',
9
- description: 'This information will help us find the right tutor for your child.',
10
- placeholderText: 'Child’s school curriculum',
11
- questionUUID: 'ea8f4ed7-4214-4dcd-a818-701bf1843626',
12
- textAreaHeight: '44px',
13
- },
14
- }
@@ -1 +0,0 @@
1
- export * from './variants';
@@ -1,29 +0,0 @@
1
- import { SLIDE_TYPES } from "../../../constants";
2
-
3
- export const grade = {
4
- DEFAULT: {
5
- id: 1,
6
- questionID: SLIDE_TYPES.STUDENT_GRADE,
7
- type: 'options_grid',
8
- question: 'What grade is your child in?',
9
- description:
10
- "We'll use this information to surface the right recommendations in the next few questions.",
11
- options: [
12
- { value: '10' },
13
- { value: '11' },
14
- { value: '12' },
15
- { value: '7' },
16
- { value: '8' },
17
- { value: '9' },
18
- { value: '4' },
19
- { value: '5' },
20
- { value: '6' },
21
- { value: '1' },
22
- { value: '2' },
23
- { value: '3' },
24
- { value: 'KG' },
25
- ], // Options
26
- defaultNextquestionID: 'math_perception',
27
- questionUUID: '3d8688bf-ad00-4cbf-a5f9-ba9cac27af46',
28
- },
29
- };
@@ -1,19 +0,0 @@
1
- export * from './intro';
2
- export * from './grade';
3
- export * from './key_need_l1';
4
- export * from './key_need_l2';
5
- export * from './math-perception';
6
- export * from './school_performance_5_12';
7
- export * from './school_performance_kg_4';
8
- export * from './child_hobbies';
9
- export * from './child_personality';
10
- export * from './key_need_l3';
11
- export * from './other_curriculum';
12
- export * from './secondary_needs';
13
- export * from './secondary_needs';
14
- export * from './signup_refer';
15
- export * from './signup';
16
- export * from './slot_pick';
17
- export * from './teacher_intro';
18
- export * from './curriculum';
19
- export * from './child_info'
@@ -1 +0,0 @@
1
- export * from './variants';
@@ -1,7 +0,0 @@
1
- export const intro = {
2
- DEFAULT: {
3
- id: 'intro',
4
- questionID: 'intro',
5
- nextSlide: 'question/grade',
6
- }
7
- };
@@ -1 +0,0 @@
1
- export * from './variants';
@@ -1,57 +0,0 @@
1
- const getPrimaryKeyNeeds = () => {
2
- return [
3
- {
4
- value:
5
- "I'd like them to build strong math foundation and get support for schoolwork.",
6
- nextQuestionID: 'strong_math_foundation',
7
- },
8
- {
9
- value: "I'd like them to be faster at calculations / Mental math.",
10
- nextQuestionID: 'mental_math',
11
- },
12
- {
13
- value: "I'd like them to bridge learning gaps from previous and current grades.",
14
- nextQuestionID: 'learning_gaps',
15
- },
16
- {
17
- value: 'I want my child to practice math regulalry.',
18
- nextQuestionID: 'more_practice',
19
- },
20
- {
21
- value: "I'd like them to develop interest and start enjoying math without fear.",
22
- nextQuestionID: 'develop_interest',
23
- },
24
- {
25
- value: 'I want my child to practice advanced and competitive math.',
26
- nextQuestionID: 'advanced_and_competitive_maths',
27
- },
28
- ];
29
- };
30
-
31
- export const key_need_l1 = {
32
- DEFAULT: {
33
- id: 5,
34
- questionID: 'key_need_l1',
35
- type: 'options_thin',
36
- question: 'What does your child need the most help with?',
37
- description:
38
- "We'd like you choose the most important one! It's okay if there are other things, it helps us drill down to the main problem to solve!",
39
- get options() {
40
- return getPrimaryKeyNeeds();
41
- },
42
- questionUUID: '7d4f13a2-c5ec-4711-bd26-507f22fd81ae',
43
- },
44
- ECNA: {
45
- id: 5,
46
- questionID: 'key_need_l1',
47
- type: 'options_thin',
48
- question: 'What does your child need the most help with?',
49
- description:
50
- "We'd like you choose the most important one! It's okay if there are other things, it helps us drill down to the main problem to solve!",
51
- get options() {
52
- return getPrimaryKeyNeeds();
53
- },
54
- questionUUID: '7d4f13a2-c5ec-4711-bd26-507f22fd81ae',
55
- // defaultNextquestionID: 'child_info',
56
- },
57
- };
@@ -1 +0,0 @@
1
- export * from './variants';
@@ -1,143 +0,0 @@
1
- import { isK4Student, isK6Student } from '../../utils';
2
-
3
- const getPrimaryNeedSubcategoryOptions = (questionID: string) => {
4
- const mentalMathOptions = [
5
- { value: 'Calculate without using pen and paper' },
6
- {
7
- value: 'Calculate faster in exams',
8
- },
9
- {
10
- value: 'Calculate faster in practical situations',
11
- },
12
- ];
13
-
14
- const strongMathFoundationOptions = [
15
- { value: 'Apply concepts in real life', nextQuestionID: 'secondary_needs' },
16
- {
17
- value: 'Learn and remember concepts',
18
- nextQuestionID: 'secondary_needs',
19
- },
20
- {
21
- value: 'Score better in school exams',
22
- nextQuestionID: 'secondary_needs',
23
- },
24
- {
25
- value: 'Develop logical and analytical thinking',
26
- nextQuestionID: 'secondary_needs',
27
- },
28
- {
29
- value: 'Get help in school homework',
30
- nextQuestionID: 'secondary_needs',
31
- },
32
- {
33
- value: 'Help with specific topic or type of problem',
34
- nextQuestionID: 'key_need_l3',
35
- },
36
- ];
37
-
38
- if (!isK4Student() && !isK6Student()) {
39
- return questionID === 'mentalMath' ? mentalMathOptions : strongMathFoundationOptions;
40
- }
41
-
42
- switch (questionID) {
43
- case 'mentalMath':
44
- return mentalMathOptions.filter(option => !option.value.includes('exam'));
45
- case 'strongMathFoundation':
46
- return strongMathFoundationOptions.filter(option => !option.value.includes('exam'));
47
- default:
48
- return strongMathFoundationOptions;
49
- }
50
- };
51
-
52
- const getDevelopInterestOptions = () => {
53
- const interestOptions = [
54
- { value: 'Practice math in fun way' },
55
- { value: "Shouldn't lose interest in math over time" },
56
- { value: 'Should be confident before the exam' },
57
- { value: 'Improve their focus and concentration' },
58
- ];
59
-
60
- if (!isK4Student() && !isK6Student()) {
61
- return interestOptions;
62
- }
63
-
64
- return interestOptions.filter(option => !option.value.includes('exam'));
65
- };
66
-
67
- export const key_need_l2 = {
68
- STRONG_MATH_FOUNDATION: {
69
- id: 6,
70
- questionID: 'key_need_l2',
71
- type: 'options_thin',
72
- question: 'What specific help do you need with strong math foundation?',
73
- get options() {
74
- return getPrimaryNeedSubcategoryOptions('strongMathFoundation');
75
- },
76
- questionUUID: '5fbee82c-e4dc-47cf-b89c-00162b4656bb',
77
- },
78
- MENTAL_MATH: {
79
- id: 7,
80
- questionID: 'key_need_l2',
81
- type: 'options_thin',
82
- question: 'What specific help do you need with mental math?',
83
- get options() {
84
- return getPrimaryNeedSubcategoryOptions('mentalMath');
85
- },
86
- defaultNextquestionID: 'secondary_needs',
87
- questionUUID: 'f3b0b498-38e4-49b7-8a6f-3d6522db2b41',
88
- },
89
- LEARNING_GAPS: {
90
- id: 8,
91
- questionID: 'key_need_l2',
92
- type: 'options_thin',
93
- question: 'What specific help is needed with learning gaps?',
94
- options: [
95
- { value: 'Brigde learning gaps from previous grades' },
96
- {
97
- value: 'Brigde learning gaps from current grade',
98
- },
99
- ],
100
- defaultNextquestionID: 'secondary_needs',
101
- questionUUID: '5895fe89-feee-45a8-a7a6-014295ca37f3',
102
- },
103
- MORE_PRACTICE: {
104
- id: 9,
105
- questionID: 'key_need_l2',
106
- type: 'options_thin',
107
- question: 'What specific help is needed with more practice?',
108
- options: [
109
- { value: 'Learn and remember concepts' },
110
- {
111
- value: 'Avoid silly mistakes',
112
- },
113
- ],
114
- defaultNextquestionID: 'secondary_needs',
115
- questionUUID: '40d92855-1ab1-4dc1-a3cb-cdcca1ad2e8d',
116
- },
117
- DEVELOP_INTEREST: {
118
- id: 10,
119
- questionID: 'key_need_l2',
120
- type: 'options_thin',
121
- question: 'What specific help is needed to develop interest in math?',
122
- get options() {
123
- return getDevelopInterestOptions();
124
- },
125
- defaultNextquestionID: 'secondary_needs',
126
- questionUUID: '7ec57e7c-c50a-4f5b-b897-069116f21a40',
127
- },
128
- ADVANCE_AND_COMPETITIVE_MATHS: {
129
- id: 11,
130
- questionID: 'key_need_l2',
131
- type: 'options_thin',
132
- question: 'What specific help is needed with advance & competitive math?',
133
- options: [
134
- { value: 'Practice difficult level worksheets of same grade' },
135
- { value: 'Practice worksheets of higher grades' },
136
- {
137
- value: 'Prepare for competitive exams like math olympiad',
138
- },
139
- ],
140
- defaultNextquestionID: 'secondary_needs',
141
- questionUUID: '316ec3ec-1d5e-4fc5-82df-248bf93931d1',
142
- },
143
- };
@@ -1 +0,0 @@
1
- export * from './variants';
@@ -1,13 +0,0 @@
1
- export const key_need_l3 = {
2
- DEFAULT: {
3
- id: 12,
4
- questionID: 'key_need_l3',
5
- type: 'freeFlowingText',
6
- question:
7
- 'Please mention the specific topic or type of problem your child needs help with.',
8
- defaultNextquestionID: 13,
9
- questionUUID: 'd50d0e6c-8dd0-444f-bb34-aa6a5d40d6e9',
10
- placeholderText:
11
- 'He is slow in calculating maths mentally, mostly discounts and percentages',
12
- },
13
- };
@@ -1 +0,0 @@
1
- export * from './variants';
@@ -1,30 +0,0 @@
1
- import { getPerformanceQuestionAccordingToGrade } from '../../utils';
2
-
3
- export const math_perception = {
4
- DEFAULT: {
5
- id: 2,
6
- questionID: 'math_perception',
7
- description:
8
- "It's okay to be anxious, glad or sad about math. We'd like to know so we can be mindful about their needs!",
9
- type: 'options',
10
- question: 'How does your child feel about math?',
11
- options: [
12
- {
13
- value: 'ANXIOUS',
14
- logo: '/static/e-cna-form/anxious-emoji.svg',
15
- },
16
- {
17
- value: 'COMFORTABLE',
18
- logo: '/static/e-cna-form/comfortable-emoji.svg',
19
- },
20
- {
21
- value: 'LOVES IT',
22
- logo: '/static/e-cna-form/loves-it-emoji.svg',
23
- },
24
- ],
25
- get defaultNextquestionID() {
26
- return getPerformanceQuestionAccordingToGrade();
27
- },
28
- questionUUID: 'fbb26cf1-1480-4e99-b1e2-3d015bd9c334',
29
- },
30
- };
@@ -1 +0,0 @@
1
- export * from './variants';
@@ -1,14 +0,0 @@
1
- import { QUESTION_ID } from '../../../constants';
2
-
3
- export const other_curriculum = {
4
- DEFAULT: {
5
- id: 17,
6
- questionID: QUESTION_ID.OTHER_CURRICULUM,
7
- type: 'freeFlowingText',
8
- question: 'Please enter the curriculum followed at your child’s school',
9
- description: 'This information will help us find the right tutor for your child.',
10
- placeholderText: 'Child’s school curriculum',
11
- questionUUID: 'ea8f4ed7-4214-4dcd-a818-701bf1843626',
12
- textAreaHeight: '44px',
13
- },
14
- };
@@ -1 +0,0 @@
1
- export * from './variants';