@hhgtech/hhg-components 1.29.110 → 1.29.112

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 (502) hide show
  1. package/build/Google-9b60d4e2.js +38 -0
  2. package/build/{LastPeriod-9964beff.js → LastPeriod-816eec4b.js} +1 -1
  3. package/build/{MobileBottomNavigationIcon-47d13939.js → MobileBottomNavigationIcon-03c58545.js} +3 -3
  4. package/build/{Spinner-3cfb77fb.js → Spinner-351c115e.js} +1 -1
  5. package/build/{WhatsApp-d804a21a.js → WhatsApp-5149a1ae.js} +1 -1
  6. package/build/adapters.js +19 -18
  7. package/build/atoms.js +46 -45
  8. package/build/babyGrowth.js +83 -82
  9. package/build/cache.js +2 -2
  10. package/build/care.js +17 -17
  11. package/build/careBookingSearchBar.js +14 -14
  12. package/build/careBookingSearchBarV2.js +15 -15
  13. package/build/components/mantine/index.d.ts +1 -0
  14. package/build/components/mantine/provider/notifications/icons.d.ts +5 -0
  15. package/build/components/mantine/provider/notifications/index.d.ts +6 -0
  16. package/build/components/organisms/navigationProfileButton/index.d.ts +1 -2
  17. package/build/components.js +91 -88
  18. package/build/{constants-b6a27170.js → constants-0e963367.js} +1 -1
  19. package/build/constants.js +4 -3
  20. package/build/constantsDomainLocales.js +1 -1
  21. package/build/constantsRiskScreener.js +2 -2
  22. package/build/constantsSite.js +2 -2
  23. package/build/{core-f7393a4d.js → core-2150b67c.js} +1 -1
  24. package/build/{dataTransform-a9aa9e94.js → dataTransform-82ee6497.js} +1 -1
  25. package/build/ecom.js +4 -4
  26. package/build/{editor-44ca788c.js → editor-68cc692d.js} +11 -11
  27. package/build/embeddedHeathToolCards_babyGrowth.js +23 -22
  28. package/build/embeddedHeathToolCards_babyPoop.js +19 -18
  29. package/build/embeddedHeathToolCards_babyVaccine.js +22 -21
  30. package/build/embeddedHeathToolCards_bmi_bmi.js +26 -25
  31. package/build/embeddedHeathToolCards_bmrBmr.js +26 -25
  32. package/build/embeddedHeathToolCards_dueDate_dueDate.js +22 -21
  33. package/build/embeddedHeathToolCards_ovulation_ovulation.js +22 -21
  34. package/build/embeddedHeathToolCards_pwg_pwg.js +27 -26
  35. package/build/embeddedHeathToolCards_targetHeartRate.js +28 -27
  36. package/build/esm/Google-664b8b3c.js +15 -0
  37. package/build/esm/{LastPeriod-94d47b13.js → LastPeriod-e82eada8.js} +1 -1
  38. package/build/esm/{MobileBottomNavigationIcon-5a2f9cda.js → MobileBottomNavigationIcon-b5f86e9b.js} +3 -3
  39. package/build/esm/{Spinner-adc15177.js → Spinner-7b409f99.js} +1 -1
  40. package/build/esm/{WhatsApp-72259ef3.js → WhatsApp-06d07850.js} +1 -1
  41. package/build/esm/adapters.js +19 -18
  42. package/build/esm/atoms.js +46 -45
  43. package/build/esm/babyGrowth.js +83 -82
  44. package/build/esm/cache.js +2 -2
  45. package/build/esm/care.js +17 -17
  46. package/build/esm/careBookingSearchBar.js +14 -14
  47. package/build/esm/careBookingSearchBarV2.js +15 -15
  48. package/build/esm/components/mantine/index.d.ts +1 -0
  49. package/build/esm/components/mantine/provider/notifications/icons.d.ts +5 -0
  50. package/build/esm/components/mantine/provider/notifications/index.d.ts +6 -0
  51. package/build/esm/components/organisms/navigationProfileButton/index.d.ts +1 -2
  52. package/build/esm/components.js +91 -88
  53. package/build/esm/{constants-62165820.js → constants-d4b472c9.js} +1 -1
  54. package/build/esm/constants.js +3 -3
  55. package/build/esm/constantsDomainLocales.js +1 -1
  56. package/build/esm/constantsRiskScreener.js +2 -2
  57. package/build/esm/constantsSite.js +2 -2
  58. package/build/esm/{core-d6efb3c7.js → core-6e02a76e.js} +1 -1
  59. package/build/esm/{dataTransform-0a6dc377.js → dataTransform-2eea83ec.js} +1 -1
  60. package/build/esm/ecom.js +4 -4
  61. package/build/esm/{editor-9349fc79.js → editor-19b77c92.js} +11 -11
  62. package/build/esm/embeddedHeathToolCards_babyGrowth.js +23 -22
  63. package/build/esm/embeddedHeathToolCards_babyPoop.js +19 -18
  64. package/build/esm/embeddedHeathToolCards_babyVaccine.js +22 -21
  65. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +26 -25
  66. package/build/esm/embeddedHeathToolCards_bmrBmr.js +26 -25
  67. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +22 -21
  68. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +22 -21
  69. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +27 -26
  70. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +28 -27
  71. package/build/esm/{fixedBottomAdBlock-f4baa787.js → fixedBottomAdBlock-e1c726fc.js} +22 -22
  72. package/build/esm/footer.js +21 -20
  73. package/build/esm/gAssets.js +2 -2
  74. package/build/esm/healthToolsCardWrapper.js +18 -17
  75. package/build/esm/healthToolsForm.js +34 -33
  76. package/build/esm/hooks.js +14 -14
  77. package/build/esm/i18n.js +2 -2
  78. package/build/esm/i18nV2.js +2 -2
  79. package/build/esm/{index-aa32f4d3.js → index-0c1028f1.js} +23 -23
  80. package/build/esm/{index-235e6ff6.js → index-0f2e26cf.js} +1 -1
  81. package/build/esm/{index-c2025e5d.js → index-105b0aa5.js} +12 -12
  82. package/build/esm/{index-5221ae6b.js → index-11d9840d.js} +13 -20
  83. package/build/esm/{index-a807d223.js → index-1263b1e9.js} +16 -16
  84. package/build/esm/{index-89f80018.js → index-176e331a.js} +14 -14
  85. package/build/esm/{index-0fde3c88.js → index-350f2e56.js} +36 -37
  86. package/build/esm/{index-8064c18c.js → index-3bc01607.js} +6 -6
  87. package/build/esm/{index-e6dcd686.js → index-410e8044.js} +1 -1
  88. package/build/esm/{index-16cca3e0.js → index-413b89ba.js} +3 -3
  89. package/build/esm/{index-50eafe3e.js → index-447f6ab2.js} +12 -12
  90. package/build/esm/{index-5ded1850.js → index-4a684368.js} +15 -15
  91. package/build/esm/{index-8cfb8ffd.js → index-4d3f7a06.js} +2 -2
  92. package/build/esm/{index-d46bc097.js → index-4ed0b5ba.js} +12 -12
  93. package/build/esm/{index-17fce332.js → index-5224166a.js} +17 -17
  94. package/build/esm/{index-d6ba0b97.js → index-556248c8.js} +3 -3
  95. package/build/esm/{index-15fa6e53.js → index-596950eb.js} +1 -1
  96. package/build/esm/{index-2448ba80.js → index-5b81eb40.js} +3 -3
  97. package/build/esm/{index-7f2d389c.js → index-61e80f3d.js} +1 -1
  98. package/build/esm/{index-a47dc117.js → index-62aab537.js} +5 -5
  99. package/build/esm/{index-43b726db.js → index-72829b7d.js} +2 -2
  100. package/build/esm/{index-16c22540.js → index-7603f707.js} +2 -2
  101. package/build/esm/{index-3e3fcf95.js → index-761a9621.js} +2 -2
  102. package/build/esm/{index-58449963.js → index-76b2761c.js} +7 -7
  103. package/build/esm/{index-14d4175c.js → index-7837ba76.js} +1 -1
  104. package/build/esm/{index-f67d0646.js → index-7e318f23.js} +1 -1
  105. package/build/esm/{index-b9208015.js → index-7f356ed0.js} +15 -15
  106. package/build/esm/{index-0653c377.js → index-8109fa9c.js} +6 -6
  107. package/build/esm/{index-cbf33f76.js → index-82bd111e.js} +2 -2
  108. package/build/esm/{index-2af5a80e.js → index-88d2da07.js} +18 -18
  109. package/build/esm/{index-56a79323.js → index-8a1dc672.js} +3 -3
  110. package/build/esm/{index-35c7265c.js → index-8c9150e8.js} +3 -3
  111. package/build/esm/{index-aa9360c8.js → index-8cdbaf17.js} +4 -4
  112. package/build/esm/{index-33bb2e7a.js → index-8db693ba.js} +1 -1
  113. package/build/esm/{index-e0813672.js → index-99d27908.js} +2 -2
  114. package/build/esm/{index-a5d23469.js → index-a4b02ecd.js} +7 -7
  115. package/build/esm/{index-cf2e8195.js → index-a69a171f.js} +5 -3
  116. package/build/esm/{index-b7a5ae7c.js → index-b76d2fbd.js} +6 -6
  117. package/build/esm/{index-3d5d1e1b.js → index-b823caa1.js} +14 -14
  118. package/build/esm/{index-bc9435ba.js → index-b9ffc8c8.js} +21 -21
  119. package/build/esm/{index-ab3252bc.js → index-bc8a6968.js} +2 -2
  120. package/build/esm/{index-8f6f01e4.js → index-c06316f7.js} +19 -19
  121. package/build/esm/{index-32ef64f3.js → index-c1f707db.js} +2 -2
  122. package/build/esm/{index-37d07df3.js → index-cde43c7c.js} +12 -12
  123. package/build/esm/{index-d46a2e09.js → index-d26cefad.js} +1 -1
  124. package/build/esm/{index-d942cc15.js → index-d370d705.js} +5 -5
  125. package/build/esm/{index-53b37308.js → index-d461be76.js} +15 -15
  126. package/build/esm/{index-5154a719.js → index-d5082d3a.js} +14 -14
  127. package/build/esm/{index-0ab47613.js → index-dabe7dae.js} +20 -20
  128. package/build/esm/{index-b7f5af36.js → index-de16bcda.js} +19 -15
  129. package/build/esm/{index-c072844e.js → index-e2276deb.js} +2 -2
  130. package/build/esm/{index-cdff6bde.js → index-e60fe92a.js} +6 -6
  131. package/build/esm/{index-88d1e9fe.js → index-eb1c3a22.js} +1 -1
  132. package/build/esm/{index-6e7ee277.js → index-ee65889e.js} +16 -16
  133. package/build/esm/{index-e52421fc.js → index-f453280c.js} +16 -16
  134. package/build/esm/{index-5c8ec94d.js → index-f628e3ae.js} +2 -2
  135. package/build/esm/index.js +114 -122
  136. package/build/esm/{index.styles-87407526.js → index.styles-fdecf1c6.js} +1 -1
  137. package/build/esm/interfaces/constants/index.d.ts +1 -0
  138. package/build/esm/{labelSorting-f9f43706.js → labelSorting-fa4b1daf.js} +4 -4
  139. package/build/esm/lead.js +23 -22
  140. package/build/esm/{logoIcon-acc01a57.js → logoIcon-d30efc99.js} +2 -2
  141. package/build/esm/mantine.js +28 -25
  142. package/build/esm/misc.js +19 -18
  143. package/build/esm/miscGetDynamicHealthTool.js +5 -5
  144. package/build/esm/miscGetSocialList.js +8 -8
  145. package/build/esm/miscScreenSizeContext.js +1 -1
  146. package/build/esm/mobileBottomNavigation.js +5 -5
  147. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  148. package/build/esm/molecules.js +68 -67
  149. package/build/esm/moleculesArticleCard.js +6 -6
  150. package/build/esm/moleculesArticleCardV2.js +16 -15
  151. package/build/esm/navigation.js +43 -40
  152. package/build/esm/navigationLogoutPopup.js +9 -9
  153. package/build/esm/navigationProfileButton.js +24 -23
  154. package/build/esm/onboardingV2.js +29 -28
  155. package/build/esm/organisms.js +47 -44
  156. package/build/esm/{post-e5559ad6.js → post-b819ab7d.js} +2 -2
  157. package/build/esm/profileNavigation.js +20 -19
  158. package/build/esm/progressBar.js +1 -1
  159. package/build/esm/pwg.js +22 -21
  160. package/build/esm/ssoV2/api/email.d.ts +1 -1
  161. package/build/esm/ssoV2/api/index.d.ts +14 -11
  162. package/build/esm/ssoV2/api/paths.d.ts +4 -0
  163. package/build/esm/ssoV2/api/phone.d.ts +2 -0
  164. package/build/esm/ssoV2/api/zalo.d.ts +2 -0
  165. package/build/esm/ssoV2/index.d.ts +4 -1
  166. package/build/esm/ssoV2/popupWrapper/collectInfoTextPopup/index.d.ts +1 -1
  167. package/build/esm/ssoV2/popupWrapper/collectInfoTextPopup/modal.d.ts +2 -0
  168. package/build/esm/ssoV2/popupWrapper/confirmClosePopup.d.ts +6 -0
  169. package/build/esm/ssoV2/screens/otp.d.ts +3 -1
  170. package/build/esm/ssoV2/screens/passwordForgotEmail.d.ts +5 -0
  171. package/build/esm/ssoV2/screens/passwordForgotSetup/checkIcons.d.ts +4 -0
  172. package/build/esm/ssoV2/screens/setup/genderIcons.d.ts +3 -0
  173. package/build/esm/ssoV2/ssoStateManager/index.d.ts +2 -0
  174. package/build/esm/ssoV2/ssoStateManager/store.d.ts +7 -0
  175. package/build/esm/ssoV2/stepsManager/index.d.ts +8 -1
  176. package/build/esm/ssoV2.js +2164 -0
  177. package/build/esm/store-4b7ab103.js +10 -0
  178. package/build/esm/subot.js +31 -30
  179. package/build/esm/surveyOrPremiumBanner.js +30 -29
  180. package/build/esm/surveyQuestionCard.js +10 -10
  181. package/build/esm/{surveyThankyouCard-bcf08bf0.js → surveyThankyouCard-5bd56fd2.js} +5 -5
  182. package/build/esm/together.js +51 -50
  183. package/build/esm/togetherApiUtils.js +4 -4
  184. package/build/esm/togetherAtoms.js +31 -30
  185. package/build/esm/togetherComponentGlobalContext.js +4 -4
  186. package/build/esm/togetherMolecules.js +41 -40
  187. package/build/esm/togetherMoleculesCardAuthor.js +24 -24
  188. package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
  189. package/build/esm/togetherMoleculesProfileDetail.js +31 -30
  190. package/build/esm/togetherOrganisms.js +46 -45
  191. package/build/esm/togetherRichTextEditor.js +17 -17
  192. package/build/esm/togetherShareBox.js +10 -10
  193. package/build/esm/{treePopoverMenu-fbc40cab.js → treePopoverMenu-861697c9.js} +18 -18
  194. package/build/esm/{types-f7e921ce.js → types-fb490e23.js} +2 -2
  195. package/build/esm/types.js +2 -2
  196. package/build/esm/{useCategory-e9c58e46.js → useCategory-2bd7f24f.js} +5 -5
  197. package/build/esm/{useHealthToolCache-5dcdf1dd.js → useHealthToolCache-9dbc5c31.js} +1 -1
  198. package/build/esm/useMantineLocale-9b4e6ec5.js +142 -0
  199. package/build/esm/{usePlacesAutocomplete-c6b04bb5.js → usePlacesAutocomplete-73987a44.js} +1 -1
  200. package/build/esm/useTogetherAuthRequiredAction.js +4 -4
  201. package/build/esm/{useTranslations-07b27d99.js → useTranslations-307c6ca4.js} +1 -1
  202. package/build/esm/{utils-017de61e.js → utils-0c30d194.js} +2 -2
  203. package/build/esm/{utils-4e13c960.js → utils-2832a25c.js} +2 -2
  204. package/build/esm/{utils-36b96c58.js → utils-e155b983.js} +3 -3
  205. package/build/esm/vaccination.js +21 -20
  206. package/build/{fixedBottomAdBlock-40e013d6.js → fixedBottomAdBlock-8d2a3d35.js} +22 -22
  207. package/build/footer.js +21 -20
  208. package/build/gAssets.js +2 -2
  209. package/build/healthToolsCardWrapper.js +18 -17
  210. package/build/healthToolsForm.js +34 -33
  211. package/build/hooks.js +14 -14
  212. package/build/i18n.js +1 -1
  213. package/build/i18nV2.js +1 -1
  214. package/build/{index-13fbb425.js → index-0acada13.js} +14 -14
  215. package/build/{index-f77a5513.js → index-107daf19.js} +6 -6
  216. package/build/{index-e77fda5d.js → index-1a0e8ba6.js} +5 -2
  217. package/build/{index-40d370cc.js → index-1b830efc.js} +1 -1
  218. package/build/{index-a6b6b993.js → index-1be8e43d.js} +12 -12
  219. package/build/{index-75bae308.js → index-1d0c001d.js} +2 -2
  220. package/build/{index-45fab631.js → index-1da80644.js} +1 -1
  221. package/build/{index-f5bb3a9d.js → index-1e0cfd00.js} +15 -15
  222. package/build/{index-b1794d6c.js → index-297729cd.js} +2 -2
  223. package/build/{index-4e709717.js → index-2d7d138c.js} +19 -14
  224. package/build/{index-27bfcf07.js → index-36ba1155.js} +1 -1
  225. package/build/{index-f24a8689.js → index-3c269800.js} +1 -1
  226. package/build/{index-8adbdb4f.js → index-3fa0ffe1.js} +7 -7
  227. package/build/{index-f5944a20.js → index-43928a1c.js} +4 -4
  228. package/build/{index-de3d8886.js → index-491d8995.js} +36 -37
  229. package/build/{index-5c8dc1a3.js → index-5568c16b.js} +2 -2
  230. package/build/{index-d7e780fe.js → index-56ff656b.js} +15 -15
  231. package/build/{index-049aece7.js → index-5ac4d936.js} +19 -19
  232. package/build/{index-f3afbbb6.js → index-5d024ad1.js} +1 -1
  233. package/build/{index-830cf23b.js → index-639e08e9.js} +12 -12
  234. package/build/{index-9244359b.js → index-6a30f248.js} +12 -12
  235. package/build/{index-d84ef58d.js → index-73056c59.js} +1 -1
  236. package/build/{index-c0d6ff80.js → index-77a05055.js} +6 -6
  237. package/build/{index-99282efe.js → index-77ba5993.js} +14 -14
  238. package/build/{index-2ce37ad2.js → index-794462d8.js} +16 -16
  239. package/build/{index-19e4fddf.js → index-79d65b66.js} +3 -3
  240. package/build/{index-e7e7b68c.js → index-7c75b350.js} +20 -20
  241. package/build/{index-5b08c63c.js → index-7dc11526.js} +7 -7
  242. package/build/{index-583288bc.js → index-7fd4f33b.js} +1 -1
  243. package/build/{index-8da9d74a.js → index-805fdc96.js} +2 -2
  244. package/build/{index-81bf5c98.js → index-81eda4ad.js} +15 -15
  245. package/build/{index-3d5a2af4.js → index-86654c05.js} +18 -18
  246. package/build/{index-95abe4d4.js → index-9500aae0.js} +2 -2
  247. package/build/{index-28e00c63.js → index-a12ee98b.js} +12 -12
  248. package/build/{index-b0472af7.js → index-a305d4c4.js} +17 -17
  249. package/build/{index-03548c34.js → index-a466379a.js} +1 -1
  250. package/build/{index-b77008b4.js → index-b7af866c.js} +23 -23
  251. package/build/{index-7233bd6d.js → index-bcc3f8e4.js} +2 -2
  252. package/build/{index-986d4587.js → index-c016ab8b.js} +2 -2
  253. package/build/{index-61c24e51.js → index-c37fe95f.js} +5 -5
  254. package/build/{index-1ddced1b.js → index-c5167284.js} +12 -19
  255. package/build/{index-529f2cf6.js → index-c6ba4a32.js} +6 -6
  256. package/build/{index-747fed64.js → index-c8096b0f.js} +2 -2
  257. package/build/{index-28722db9.js → index-c842a19d.js} +2 -2
  258. package/build/{index-e3b79653.js → index-cc82b240.js} +3 -3
  259. package/build/{index-9deaf0f8.js → index-cf490630.js} +3 -3
  260. package/build/{index-a812f053.js → index-d3606e94.js} +16 -16
  261. package/build/{index-f6c7b353.js → index-de4668ca.js} +1 -1
  262. package/build/{index-21598eb4.js → index-df65c321.js} +2 -2
  263. package/build/{index-13ad9534.js → index-e0175328.js} +3 -3
  264. package/build/{index-742fa48b.js → index-e0b2d0a5.js} +14 -14
  265. package/build/{index-8ea79133.js → index-f6ca4391.js} +6 -6
  266. package/build/{index-6192f9c2.js → index-fc991bf5.js} +16 -16
  267. package/build/{index-a80275e1.js → index-fe8b4acd.js} +5 -5
  268. package/build/{index-c63ea941.js → index-fead32d5.js} +3 -3
  269. package/build/{index-45a2a666.js → index-febd43f4.js} +21 -21
  270. package/build/index.js +115 -123
  271. package/build/{index.styles-cf5296fa.js → index.styles-510126b2.js} +1 -1
  272. package/build/interfaces/constants/index.d.ts +1 -0
  273. package/build/{labelSorting-1767b217.js → labelSorting-c4e5aa9d.js} +4 -4
  274. package/build/lead.js +23 -22
  275. package/build/{logoIcon-b6e9ebbc.js → logoIcon-90ab6b4d.js} +2 -2
  276. package/build/mantine.js +25 -21
  277. package/build/misc.js +19 -18
  278. package/build/miscGetDynamicHealthTool.js +5 -5
  279. package/build/miscGetSocialList.js +8 -8
  280. package/build/miscScreenSizeContext.js +1 -1
  281. package/build/mobileBottomNavigation.js +5 -5
  282. package/build/mobileBottomNavigationIcon.js +5 -5
  283. package/build/molecules.js +68 -67
  284. package/build/moleculesArticleCard.js +6 -6
  285. package/build/moleculesArticleCardV2.js +16 -15
  286. package/build/navigation.js +43 -40
  287. package/build/navigationLogoutPopup.js +9 -9
  288. package/build/navigationProfileButton.js +24 -23
  289. package/build/onboardingV2.js +28 -27
  290. package/build/organisms.js +47 -44
  291. package/build/{post-563403e1.js → post-f82b1693.js} +2 -2
  292. package/build/profileNavigation.js +20 -19
  293. package/build/progressBar.js +1 -1
  294. package/build/pwg.js +22 -21
  295. package/build/ssoV2/api/email.d.ts +1 -1
  296. package/build/ssoV2/api/index.d.ts +14 -11
  297. package/build/ssoV2/api/paths.d.ts +4 -0
  298. package/build/ssoV2/api/phone.d.ts +2 -0
  299. package/build/ssoV2/api/zalo.d.ts +2 -0
  300. package/build/ssoV2/index.d.ts +4 -1
  301. package/build/ssoV2/popupWrapper/collectInfoTextPopup/index.d.ts +1 -1
  302. package/build/ssoV2/popupWrapper/collectInfoTextPopup/modal.d.ts +2 -0
  303. package/build/ssoV2/popupWrapper/confirmClosePopup.d.ts +6 -0
  304. package/build/ssoV2/screens/otp.d.ts +3 -1
  305. package/build/ssoV2/screens/passwordForgotEmail.d.ts +5 -0
  306. package/build/ssoV2/screens/passwordForgotSetup/checkIcons.d.ts +4 -0
  307. package/build/ssoV2/screens/setup/genderIcons.d.ts +3 -0
  308. package/build/ssoV2/ssoStateManager/index.d.ts +2 -0
  309. package/build/ssoV2/ssoStateManager/store.d.ts +7 -0
  310. package/build/ssoV2/stepsManager/index.d.ts +8 -1
  311. package/build/ssoV2.js +2194 -0
  312. package/build/store-155b3705.js +12 -0
  313. package/build/subot.js +30 -29
  314. package/build/surveyOrPremiumBanner.js +30 -29
  315. package/build/surveyQuestionCard.js +10 -10
  316. package/build/{surveyThankyouCard-40786ef3.js → surveyThankyouCard-a178b281.js} +5 -5
  317. package/build/together.js +51 -50
  318. package/build/togetherApiUtils.js +4 -4
  319. package/build/togetherAtoms.js +31 -30
  320. package/build/togetherComponentGlobalContext.js +4 -4
  321. package/build/togetherMolecules.js +41 -40
  322. package/build/togetherMoleculesCardAuthor.js +24 -24
  323. package/build/togetherMoleculesPostImagePreview.js +11 -11
  324. package/build/togetherMoleculesProfileDetail.js +31 -30
  325. package/build/togetherOrganisms.js +46 -45
  326. package/build/togetherRichTextEditor.js +17 -17
  327. package/build/togetherShareBox.js +10 -10
  328. package/build/{treePopoverMenu-e0f418f8.js → treePopoverMenu-71f80f09.js} +18 -18
  329. package/build/{types-a5ed4acd.js → types-98c6dde4.js} +2 -2
  330. package/build/types.js +2 -2
  331. package/build/{useCategory-7833d8d9.js → useCategory-52c6274a.js} +5 -5
  332. package/build/{useHealthToolCache-7ef0f9cd.js → useHealthToolCache-e0cc98d5.js} +1 -1
  333. package/build/{useMantineLocale-16175b54.js → useMantineLocale-71ddf2d4.js} +68 -5
  334. package/build/{usePlacesAutocomplete-48ea8506.js → usePlacesAutocomplete-cd58de07.js} +1 -1
  335. package/build/useTogetherAuthRequiredAction.js +4 -4
  336. package/build/{useTranslations-783bc413.js → useTranslations-a02358cc.js} +1 -1
  337. package/build/{utils-dfe2edbf.js → utils-87cccfe9.js} +3 -3
  338. package/build/{utils-3aa5b9de.js → utils-cda87ea9.js} +2 -2
  339. package/build/{utils-17e8be52.js → utils-cfebd7e0.js} +2 -2
  340. package/build/vaccination.js +21 -20
  341. package/package.json +4 -2
  342. package/build/esm/useMantineLocale-e24e123a.js +0 -82
  343. /package/build/{BMI_BOYS.percentile.monthly-31834ca0.js → BMI_BOYS.percentile.monthly-b36790b9.js} +0 -0
  344. /package/build/{BMI_BOYS.percentile.weekly-bb6043c1.js → BMI_BOYS.percentile.weekly-46fe55d8.js} +0 -0
  345. /package/build/{BMI_BOYS.percentile.yearly-cc6cba70.js → BMI_BOYS.percentile.yearly-a10bbdbc.js} +0 -0
  346. /package/build/{BMI_BOYS.zscore.monthly-1b73153b.js → BMI_BOYS.zscore.monthly-8f3d4e3c.js} +0 -0
  347. /package/build/{BMI_BOYS.zscore.weekly-0a4888e3.js → BMI_BOYS.zscore.weekly-293cb3d5.js} +0 -0
  348. /package/build/{BMI_BOYS.zscore.yearly-e7a5067a.js → BMI_BOYS.zscore.yearly-882e57bc.js} +0 -0
  349. /package/build/{BMI_GIRLS.percentile.monthly-de7218fe.js → BMI_GIRLS.percentile.monthly-5a23cad1.js} +0 -0
  350. /package/build/{BMI_GIRLS.percentile.weekly-2d05d7fc.js → BMI_GIRLS.percentile.weekly-b5db6e5a.js} +0 -0
  351. /package/build/{BMI_GIRLS.percentile.yearly-6b402892.js → BMI_GIRLS.percentile.yearly-227e1b96.js} +0 -0
  352. /package/build/{BMI_GIRLS.zscore.monthly-43fb7f4b.js → BMI_GIRLS.zscore.monthly-a67d60cb.js} +0 -0
  353. /package/build/{BMI_GIRLS.zscore.weekly-cca85dfc.js → BMI_GIRLS.zscore.weekly-6eec37ad.js} +0 -0
  354. /package/build/{BMI_GIRLS.zscore.yearly-79aa7d6f.js → BMI_GIRLS.zscore.yearly-bed50a9e.js} +0 -0
  355. /package/build/{ChevronDown-0bb6ebf7.js → ChevronDown-36f1533e.js} +0 -0
  356. /package/build/{Close-fc7a4318.js → Close-9ad765e0.js} +0 -0
  357. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-18fb5aae.js → HEAD CIRCUM_BOYS.percentile.monthly-b3c01059.js} +0 -0
  358. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-ff6fc30b.js → HEAD CIRCUM_BOYS.percentile.weekly-b33c0fb3.js} +0 -0
  359. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-7ada75df.js → HEAD CIRCUM_BOYS.percentile.yearly-fcbbcf50.js} +0 -0
  360. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-a8a584ad.js → HEAD CIRCUM_BOYS.zscore.monthly-5c6e07c9.js} +0 -0
  361. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-78df99bd.js → HEAD CIRCUM_BOYS.zscore.weekly-e2e75ab5.js} +0 -0
  362. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-5a089140.js → HEAD CIRCUM_BOYS.zscore.yearly-67f26a8c.js} +0 -0
  363. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-71447fa2.js → HEAD CIRCUM_GIRLS.percentile.monthly-aac09934.js} +0 -0
  364. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-09041858.js → HEAD CIRCUM_GIRLS.percentile.weekly-2dd51abe.js} +0 -0
  365. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-218785e5.js → HEAD CIRCUM_GIRLS.percentile.yearly-56983be9.js} +0 -0
  366. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-3c0fdcef.js → HEAD CIRCUM_GIRLS.zscore.monthly-5c0a626f.js} +0 -0
  367. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-210cbe5a.js → HEAD CIRCUM_GIRLS.zscore.weekly-710b188b.js} +0 -0
  368. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-51bab3b5.js → HEAD CIRCUM_GIRLS.zscore.yearly-c1077c3d.js} +0 -0
  369. /package/build/{HEIGHT_BOYS.percentile.monthly-42cab1f3.js → HEIGHT_BOYS.percentile.monthly-eea9985d.js} +0 -0
  370. /package/build/{HEIGHT_BOYS.percentile.weekly-ea8a4c57.js → HEIGHT_BOYS.percentile.weekly-1f1cd60d.js} +0 -0
  371. /package/build/{HEIGHT_BOYS.percentile.yearly-6b52f3a2.js → HEIGHT_BOYS.percentile.yearly-e35aded9.js} +0 -0
  372. /package/build/{HEIGHT_BOYS.zscore.monthly-1ff1109c.js → HEIGHT_BOYS.zscore.monthly-7f0f2b1d.js} +0 -0
  373. /package/build/{HEIGHT_BOYS.zscore.weekly-91ac3319.js → HEIGHT_BOYS.zscore.weekly-96ddfba5.js} +0 -0
  374. /package/build/{HEIGHT_BOYS.zscore.yearly-08a54dc1.js → HEIGHT_BOYS.zscore.yearly-f905ad3a.js} +0 -0
  375. /package/build/{HEIGHT_GIRLS.percentile.monthly-374799e5.js → HEIGHT_GIRLS.percentile.monthly-3e68815f.js} +0 -0
  376. /package/build/{HEIGHT_GIRLS.percentile.weekly-f4fb53fc.js → HEIGHT_GIRLS.percentile.weekly-1266c518.js} +0 -0
  377. /package/build/{HEIGHT_GIRLS.percentile.yearly-e3687860.js → HEIGHT_GIRLS.percentile.yearly-60dc6434.js} +0 -0
  378. /package/build/{HEIGHT_GIRLS.zscore.monthly-567531c2.js → HEIGHT_GIRLS.zscore.monthly-fd774734.js} +0 -0
  379. /package/build/{HEIGHT_GIRLS.zscore.weekly-ec4377ed.js → HEIGHT_GIRLS.zscore.weekly-4aa3cba5.js} +0 -0
  380. /package/build/{HEIGHT_GIRLS.zscore.yearly-dfea8277.js → HEIGHT_GIRLS.zscore.yearly-04759ec5.js} +0 -0
  381. /package/build/{Locale-da0ee478.js → Locale-f9dad384.js} +0 -0
  382. /package/build/{Visible-b7f98f50.js → Visible-7e77e84d.js} +0 -0
  383. /package/build/{WEIGHT_BOYS.percentile.monthly-7618b9f6.js → WEIGHT_BOYS.percentile.monthly-1b59f236.js} +0 -0
  384. /package/build/{WEIGHT_BOYS.percentile.weekly-ddb5a122.js → WEIGHT_BOYS.percentile.weekly-7cbe2360.js} +0 -0
  385. /package/build/{WEIGHT_BOYS.percentile.yearly-8e3c3567.js → WEIGHT_BOYS.percentile.yearly-a7489780.js} +0 -0
  386. /package/build/{WEIGHT_BOYS.zscore.monthly-b243c952.js → WEIGHT_BOYS.zscore.monthly-06ab0025.js} +0 -0
  387. /package/build/{WEIGHT_BOYS.zscore.weekly-e9328217.js → WEIGHT_BOYS.zscore.weekly-efb1f97a.js} +0 -0
  388. /package/build/{WEIGHT_BOYS.zscore.yearly-6e5652c7.js → WEIGHT_BOYS.zscore.yearly-f693301f.js} +0 -0
  389. /package/build/{WEIGHT_GIRLS.percentile.monthly-fec10910.js → WEIGHT_GIRLS.percentile.monthly-7cefbd5a.js} +0 -0
  390. /package/build/{WEIGHT_GIRLS.percentile.weekly-11d3a59c.js → WEIGHT_GIRLS.percentile.weekly-7851dfb8.js} +0 -0
  391. /package/build/{WEIGHT_GIRLS.percentile.yearly-cf89f368.js → WEIGHT_GIRLS.percentile.yearly-d0cf0e78.js} +0 -0
  392. /package/build/{WEIGHT_GIRLS.zscore.monthly-2fff3f7b.js → WEIGHT_GIRLS.zscore.monthly-18c996ea.js} +0 -0
  393. /package/build/{WEIGHT_GIRLS.zscore.weekly-8c4f6b7f.js → WEIGHT_GIRLS.zscore.weekly-fdf3bc60.js} +0 -0
  394. /package/build/{WEIGHT_GIRLS.zscore.yearly-b151d214.js → WEIGHT_GIRLS.zscore.yearly-cd506e11.js} +0 -0
  395. /package/build/{animation-60d97a74.js → animation-793c0845.js} +0 -0
  396. /package/build/{constants-36dd380b.js → constants-66fef955.js} +0 -0
  397. /package/build/{constants-cdc1139b.js → constants-b6210e84.js} +0 -0
  398. /package/build/{constants-cd64dee8.js → constants-dcddc193.js} +0 -0
  399. /package/build/{dataTransform-ffd966a9.js → dataTransform-fdf490f9.js} +0 -0
  400. /package/build/{doctor-e94198ef.js → doctor-ee2ddc5d.js} +0 -0
  401. /package/build/esm/{BMI_BOYS.percentile.monthly-2a332a3a.js → BMI_BOYS.percentile.monthly-356bef4f.js} +0 -0
  402. /package/build/esm/{BMI_BOYS.percentile.weekly-c3d892ac.js → BMI_BOYS.percentile.weekly-93905a31.js} +0 -0
  403. /package/build/esm/{BMI_BOYS.percentile.yearly-cdc46283.js → BMI_BOYS.percentile.yearly-8eecbfa8.js} +0 -0
  404. /package/build/esm/{BMI_BOYS.zscore.monthly-66652c80.js → BMI_BOYS.zscore.monthly-ea8c2031.js} +0 -0
  405. /package/build/esm/{BMI_BOYS.zscore.weekly-ab18f061.js → BMI_BOYS.zscore.weekly-2bcd04b3.js} +0 -0
  406. /package/build/esm/{BMI_BOYS.zscore.yearly-0c467eb6.js → BMI_BOYS.zscore.yearly-05c30d0a.js} +0 -0
  407. /package/build/esm/{BMI_GIRLS.percentile.monthly-2429b0cf.js → BMI_GIRLS.percentile.monthly-c5e2700d.js} +0 -0
  408. /package/build/esm/{BMI_GIRLS.percentile.weekly-b9b4c395.js → BMI_GIRLS.percentile.weekly-98b8e613.js} +0 -0
  409. /package/build/esm/{BMI_GIRLS.percentile.yearly-6fb9ad13.js → BMI_GIRLS.percentile.yearly-0923d6e4.js} +0 -0
  410. /package/build/esm/{BMI_GIRLS.zscore.monthly-c9bbc776.js → BMI_GIRLS.zscore.monthly-4721e684.js} +0 -0
  411. /package/build/esm/{BMI_GIRLS.zscore.weekly-5dc0474f.js → BMI_GIRLS.zscore.weekly-ea9771ea.js} +0 -0
  412. /package/build/esm/{BMI_GIRLS.zscore.yearly-e2ef86f8.js → BMI_GIRLS.zscore.yearly-35d08573.js} +0 -0
  413. /package/build/esm/{ChevronDown-02044338.js → ChevronDown-12a9cc68.js} +0 -0
  414. /package/build/esm/{Close-61220f73.js → Close-4423dff1.js} +0 -0
  415. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-fd04fa07.js → HEAD CIRCUM_BOYS.percentile.monthly-b4147260.js} +0 -0
  416. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-528f1994.js → HEAD CIRCUM_BOYS.percentile.weekly-8f703517.js} +0 -0
  417. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-83ba6bf3.js → HEAD CIRCUM_BOYS.percentile.yearly-2541f124.js} +0 -0
  418. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-ed488d96.js → HEAD CIRCUM_BOYS.zscore.monthly-b128eb35.js} +0 -0
  419. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-17cdff23.js → HEAD CIRCUM_BOYS.zscore.weekly-58ad3a0e.js} +0 -0
  420. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-d3dc9d78.js → HEAD CIRCUM_BOYS.zscore.yearly-2189c833.js} +0 -0
  421. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-f56ed0bf.js → HEAD CIRCUM_GIRLS.percentile.monthly-0fdba54a.js} +0 -0
  422. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-942cc7b6.js → HEAD CIRCUM_GIRLS.percentile.weekly-030fa305.js} +0 -0
  423. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-211ea40d.js → HEAD CIRCUM_GIRLS.percentile.yearly-1329de79.js} +0 -0
  424. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-68b579a0.js → HEAD CIRCUM_GIRLS.zscore.monthly-1782f72f.js} +0 -0
  425. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-37cdec10.js → HEAD CIRCUM_GIRLS.zscore.weekly-0efbd6d4.js} +0 -0
  426. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-1cb077e9.js → HEAD CIRCUM_GIRLS.zscore.yearly-79a0d447.js} +0 -0
  427. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-0ace7dd5.js → HEIGHT_BOYS.percentile.monthly-90faded6.js} +0 -0
  428. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-64dbe278.js → HEIGHT_BOYS.percentile.weekly-a8dfd216.js} +0 -0
  429. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-fe232854.js → HEIGHT_BOYS.percentile.yearly-ae998ec7.js} +0 -0
  430. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-32f5b99c.js → HEIGHT_BOYS.zscore.monthly-9cb15df5.js} +0 -0
  431. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-f1bad17d.js → HEIGHT_BOYS.zscore.weekly-53b00809.js} +0 -0
  432. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-bebdef69.js → HEIGHT_BOYS.zscore.yearly-db30656d.js} +0 -0
  433. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-18d1f48d.js → HEIGHT_GIRLS.percentile.monthly-7f5bf7a9.js} +0 -0
  434. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-ee656308.js → HEIGHT_GIRLS.percentile.weekly-97c8ff77.js} +0 -0
  435. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-bd0761eb.js → HEIGHT_GIRLS.percentile.yearly-8f2f6316.js} +0 -0
  436. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-c5680c01.js → HEIGHT_GIRLS.zscore.monthly-76169434.js} +0 -0
  437. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-e4eb9dfb.js → HEIGHT_GIRLS.zscore.weekly-5b711b18.js} +0 -0
  438. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-5b368aea.js → HEIGHT_GIRLS.zscore.yearly-f2f7a8d2.js} +0 -0
  439. /package/build/esm/{Locale-c89fbd16.js → Locale-0a28cd1a.js} +0 -0
  440. /package/build/esm/{Visible-b92c39ca.js → Visible-4a25adb6.js} +0 -0
  441. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-e8772fe0.js → WEIGHT_BOYS.percentile.monthly-91dc4240.js} +0 -0
  442. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-943a8f07.js → WEIGHT_BOYS.percentile.weekly-4a1dee2b.js} +0 -0
  443. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-e0d5b2d1.js → WEIGHT_BOYS.percentile.yearly-7ba7678d.js} +0 -0
  444. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-7ec7bb71.js → WEIGHT_BOYS.zscore.monthly-61be31ee.js} +0 -0
  445. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-77029cdb.js → WEIGHT_BOYS.zscore.weekly-b641e490.js} +0 -0
  446. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-fa652850.js → WEIGHT_BOYS.zscore.yearly-75588f48.js} +0 -0
  447. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-2d420c45.js → WEIGHT_GIRLS.percentile.monthly-946194f0.js} +0 -0
  448. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-7c95da70.js → WEIGHT_GIRLS.percentile.weekly-b287390e.js} +0 -0
  449. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-131a0c7e.js → WEIGHT_GIRLS.percentile.yearly-e96fe906.js} +0 -0
  450. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-bf6a297e.js → WEIGHT_GIRLS.zscore.monthly-60764e0c.js} +0 -0
  451. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-a45a5b31.js → WEIGHT_GIRLS.zscore.weekly-087ddda5.js} +0 -0
  452. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-1673c2b4.js → WEIGHT_GIRLS.zscore.yearly-47c3dd0a.js} +0 -0
  453. /package/build/esm/{animation-b441d9e7.js → animation-76013e0b.js} +0 -0
  454. /package/build/esm/{constants-df4d1c0d.js → constants-ac34ed4f.js} +0 -0
  455. /package/build/esm/{constants-568c2ca4.js → constants-b590605c.js} +0 -0
  456. /package/build/esm/{constants-a84552ab.js → constants-f3968f75.js} +0 -0
  457. /package/build/esm/{dataTransform-1801ffc6.js → dataTransform-bf4d81b8.js} +0 -0
  458. /package/build/esm/{doctor-921f53e7.js → doctor-5b97ae3d.js} +0 -0
  459. /package/build/esm/{index-404735f4.js → index-0a237cbd.js} +0 -0
  460. /package/build/esm/{index-f226ee8e.js → index-147e6cf9.js} +0 -0
  461. /package/build/esm/{index-c7b97299.js → index-1911b6f9.js} +0 -0
  462. /package/build/esm/{index-24541ad3.js → index-865c7727.js} +0 -0
  463. /package/build/esm/{index-9f91a24e.js → index-8c5d00a2.js} +0 -0
  464. /package/build/esm/{index-ece91fe7.js → index-b185e518.js} +0 -0
  465. /package/build/esm/{index-18fc11e8.js → index-f7818a44.js} +0 -0
  466. /package/build/esm/{index-58b02c69.js → index-fd01f1c2.js} +0 -0
  467. /package/build/esm/{localizeNumberFormat-af0711db.js → localizeNumberFormat-40112b76.js} +0 -0
  468. /package/build/esm/{normalizeLink-98741f59.js → normalizeLink-523d95b2.js} +0 -0
  469. /package/build/esm/{number-8cf59b73.js → number-77fa37a8.js} +0 -0
  470. /package/build/esm/{other-5355d55f.js → other-51b10c8a.js} +0 -0
  471. /package/build/esm/{paths-59c509e3.js → paths-8ca580bb.js} +0 -0
  472. /package/build/esm/{routing-f4ff38f2.js → routing-d85d723f.js} +0 -0
  473. /package/build/esm/{translationsContext-4bf4000a.js → translationsContext-b263811e.js} +0 -0
  474. /package/build/esm/{tslib.es6-bb49a9db.js → tslib.es6-2cbcde6f.js} +0 -0
  475. /package/build/esm/{types-f588016e.js → types-96174873.js} +0 -0
  476. /package/build/esm/{useIsInit-93c72c57.js → useIsInit-926c41cb.js} +0 -0
  477. /package/build/esm/{useOutsideClick-1f5614e9.js → useOutsideClick-cbc19979.js} +0 -0
  478. /package/build/esm/{useScrollbarSize-09745987.js → useScrollbarSize-b259fdb7.js} +0 -0
  479. /package/build/esm/{useUniqueId-f32a085b.js → useUniqueId-364a86d4.js} +0 -0
  480. /package/build/esm/{utils-393be1f5.js → utils-a97be8ef.js} +0 -0
  481. /package/build/{index-27ca71a1.js → index-208ac2dd.js} +0 -0
  482. /package/build/{index-919c8bcc.js → index-22c63ba8.js} +0 -0
  483. /package/build/{index-c1400cee.js → index-62ac5059.js} +0 -0
  484. /package/build/{index-f5eaaf0a.js → index-c98537e3.js} +0 -0
  485. /package/build/{index-e14e6c07.js → index-ce6ecbf4.js} +0 -0
  486. /package/build/{index-98868c1d.js → index-da4685a9.js} +0 -0
  487. /package/build/{index-9dcca919.js → index-f716ceb1.js} +0 -0
  488. /package/build/{index-670ba3e3.js → index-ffd436d7.js} +0 -0
  489. /package/build/{localizeNumberFormat-5f29804a.js → localizeNumberFormat-fea20ffb.js} +0 -0
  490. /package/build/{normalizeLink-fab7982c.js → normalizeLink-08a6ae1e.js} +0 -0
  491. /package/build/{number-7485b550.js → number-7962219e.js} +0 -0
  492. /package/build/{other-7842a151.js → other-91c6d8eb.js} +0 -0
  493. /package/build/{paths-76a73441.js → paths-d0b584d8.js} +0 -0
  494. /package/build/{routing-ab1ad38d.js → routing-42da019f.js} +0 -0
  495. /package/build/{translationsContext-531de800.js → translationsContext-6bbd75c6.js} +0 -0
  496. /package/build/{tslib.es6-ba3eff7f.js → tslib.es6-4e4fa04c.js} +0 -0
  497. /package/build/{types-88e52088.js → types-0b45377f.js} +0 -0
  498. /package/build/{useIsInit-24caa63d.js → useIsInit-3ed4b648.js} +0 -0
  499. /package/build/{useOutsideClick-d75084aa.js → useOutsideClick-337c0e28.js} +0 -0
  500. /package/build/{useScrollbarSize-ad4b22ea.js → useScrollbarSize-f842ffb9.js} +0 -0
  501. /package/build/{useUniqueId-fafea8ea.js → useUniqueId-568a2176.js} +0 -0
  502. /package/build/{utils-59b38be2.js → utils-8eb77654.js} +0 -0
package/build/ssoV2.js ADDED
@@ -0,0 +1,2194 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var ReactDOM = require('react-dom');
7
+ var arrow = require('@hhgtech/icons/arrow');
8
+ var core$1 = require('@hhgtech/icons/core');
9
+ var logoIcon = require('./logoIcon-90ab6b4d.js');
10
+ var index$1 = require('./index-36ba1155.js');
11
+ var index = require('./index-805fdc96.js');
12
+ var core = require('@mantine/core');
13
+ var throttle = require('lodash/throttle');
14
+ var index$3 = require('./index-2d7d138c.js');
15
+ require('@mantine/dates');
16
+ var index$4 = require('./index-1a0e8ba6.js');
17
+ require('./index-1b830efc.js');
18
+ require('./index-208ac2dd.js');
19
+ var useMantineLocale = require('./useMantineLocale-71ddf2d4.js');
20
+ var index$2 = require('./index-9500aae0.js');
21
+ var useTranslations = require('./useTranslations-a02358cc.js');
22
+ require('@mantine/hooks');
23
+ var utils$1 = require('./utils-8eb77654.js');
24
+ require('./other-91c6d8eb.js');
25
+ var Locale = require('./Locale-f9dad384.js');
26
+ require('./translationsContext-6bbd75c6.js');
27
+ require('string-format');
28
+ var tslib_es6 = require('./tslib.es6-4e4fa04c.js');
29
+ var constantsIsProduction = require('./constantsIsProduction.js');
30
+ var routing = require('./routing-42da019f.js');
31
+ var miscCookieHelper = require('./miscCookieHelper.js');
32
+ var constantsDomainLocales = require('./constantsDomainLocales.js');
33
+ var Google = require('./Google-9b60d4e2.js');
34
+ var other = require('@hhgtech/icons/other');
35
+ require('./index.styles-510126b2.js');
36
+ var styled = require('@emotion/styled');
37
+ var utils = require('./utils-cfebd7e0.js');
38
+ var form = require('@mantine/form');
39
+ var yup = require('yup');
40
+ var dayjs = require('dayjs');
41
+ var index$5 = require('./index-77a05055.js');
42
+ var store = require('./store-155b3705.js');
43
+ require('./index-7fd4f33b.js');
44
+ require('@mantine/carousel');
45
+ require('./miscTheme.js');
46
+ require('classnames');
47
+ require('./useUniqueId-568a2176.js');
48
+ require('./constantsSite.js');
49
+ require('date-fns/locale');
50
+ require('./constantsRiskScreener.js');
51
+ require('@mantine/notifications');
52
+ require('zustand');
53
+
54
+ function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
55
+
56
+ function _interopNamespace(e) {
57
+ if (e && e.__esModule) return e;
58
+ var n = Object.create(null);
59
+ if (e) {
60
+ Object.keys(e).forEach(function (k) {
61
+ if (k !== 'default') {
62
+ var d = Object.getOwnPropertyDescriptor(e, k);
63
+ Object.defineProperty(n, k, d.get ? d : {
64
+ enumerable: true,
65
+ get: function () { return e[k]; }
66
+ });
67
+ }
68
+ });
69
+ }
70
+ n["default"] = e;
71
+ return Object.freeze(n);
72
+ }
73
+
74
+ var React__default = /*#__PURE__*/_interopDefault(React);
75
+ var throttle__default = /*#__PURE__*/_interopDefault(throttle);
76
+ var styled__default = /*#__PURE__*/_interopDefault(styled);
77
+ var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
78
+ var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
79
+
80
+ const SSOStateContext = React.createContext({
81
+ locale: Locale.LOCALE.Vietnam,
82
+ onClose: () => false,
83
+ source: 'default',
84
+ });
85
+ const SSOStateProvider = ({ children, locale = Locale.LOCALE.Vietnam, onClose, source = 'default', }) => {
86
+ const [openCollectInfoPopup, setOpenCollectInfoPopup] = React__default["default"].useState(false);
87
+ return (React__default["default"].createElement(SSOStateContext.Provider, { value: {
88
+ locale,
89
+ onClose,
90
+ source,
91
+ openCollectInfoPopup,
92
+ setOpenCollectInfoPopup,
93
+ } }, children));
94
+ };
95
+ const useSSOState = () => {
96
+ return React__default["default"].useContext(SSOStateContext);
97
+ };
98
+
99
+ const BackgroundHeader$1 = () => (React__default["default"].createElement("svg", { width: "292", height: "255", viewBox: "0 0 292 255", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: {
100
+ position: 'absolute',
101
+ top: 0,
102
+ left: '50%',
103
+ zIndex: 0,
104
+ transform: 'translateX(-50%)',
105
+ pointerEvents: 'none',
106
+ } },
107
+ React__default["default"].createElement("circle", { opacity: ".2", cx: "146", cy: "109", r: "146", fill: "url(#paint0_linear_908_34610)" }),
108
+ React__default["default"].createElement("circle", { opacity: ".3", cx: "146", cy: "109", r: "85", fill: "url(#paint1_linear_908_34610)" }),
109
+ React__default["default"].createElement("circle", { cx: "146.5", cy: "108.5", r: "47.5", fill: "url(#paint2_linear_908_34610)" }),
110
+ React__default["default"].createElement("circle", { cx: "146.5", cy: "108.5", r: "47", stroke: "url(#paint3_linear_908_34610)" }),
111
+ React__default["default"].createElement("path", { d: "M163.327 94.716c-.522-3.187-7.981-5.714-17.11-5.714s-16.589 2.527-17.111 5.714h-.032v26.428h.032c.522 3.186 7.982 5.714 17.111 5.714 9.128 0 16.588-2.528 17.11-5.714h.032V94.716z", fill: "#545E73" }),
112
+ React__default["default"].createElement("path", { d: "M146.217 118.286c-9.468 0-17.143-2.718-17.143-6.071v8.928h.032c.522 3.187 7.982 5.714 17.111 5.714 9.128 0 16.588-2.527 17.11-5.714h.032v-8.928c0 3.353-7.675 6.071-17.142 6.071", fill: "#2B62CD" }),
113
+ React__default["default"].createElement("path", { d: "M129.074 111.859v.358q.002-.18.032-.358zm34.25 0q.031.178.032.358v-.358z", fill: "#38454F" }),
114
+ React__default["default"].createElement("path", { d: "M146.217 109.714c-9.468 0-17.143-2.719-17.143-6.071v8.928h.032c.522 3.186 7.982 5.714 17.111 5.714 9.128 0 16.588-2.528 17.11-5.714h.032v-8.928c0 3.352-7.675 6.071-17.142 6.071", fill: "#2D87F3" }),
115
+ React__default["default"].createElement("path", { d: "M129.074 103.287v.357q.002-.18.032-.357zm34.25 0q.031.178.032.357v-.357z", fill: "#556080" }),
116
+ React__default["default"].createElement("path", { d: "M146.217 101.145c9.467 0 17.142-2.719 17.142-6.072s-7.675-6.071-17.142-6.071c-9.468 0-17.143 2.718-17.143 6.071s7.675 6.072 17.143 6.072", fill: "#91CAFF" }),
117
+ React__default["default"].createElement("path", { d: "M146.217 101.144c-9.468 0-17.143-2.719-17.143-6.072v8.929h.032c.522 3.186 7.982 5.714 17.111 5.714 9.128 0 16.588-2.528 17.11-5.714h.032v-8.929c0 3.353-7.675 6.072-17.142 6.072", fill: "#45A4FF" }),
118
+ React__default["default"].createElement("path", { d: "M129.074 94.717v.357q.002-.18.032-.357zm34.25 0q.031.177.032.357v-.357z", fill: "#8697CB" }),
119
+ React__default["default"].createElement("path", { d: "M156.36 129.002a8.57 8.57 0 0 0 8.571-8.571 8.571 8.571 0 1 0-8.571 8.571", fill: "#00B16A" }),
120
+ React__default["default"].createElement("path", { d: "M161.054 116.273a.714.714 0 0 0-.995.178l-3.997 5.743-2.82-2.316a.714.714 0 0 0-.906 1.105l3.418 2.806a.72.72 0 0 0 1.04-.144l4.438-6.377a.716.716 0 0 0-.178-.995", fill: "#fff" }),
121
+ React__default["default"].createElement("defs", null,
122
+ React__default["default"].createElement("linearGradient", { id: "paint0_linear_908_34610", x1: "147.5", y1: "141", x2: "36.5", y2: "30", gradientUnits: "userSpaceOnUse" },
123
+ React__default["default"].createElement("stop", { stopColor: "#fff", stopOpacity: "0" }),
124
+ React__default["default"].createElement("stop", { offset: "1", stopColor: "#fff" })),
125
+ React__default["default"].createElement("linearGradient", { id: "paint1_linear_908_34610", x1: "218.376", y1: "63.134", x2: "61", y2: "109", gradientUnits: "userSpaceOnUse" },
126
+ React__default["default"].createElement("stop", { stopColor: "#fff" }),
127
+ React__default["default"].createElement("stop", { offset: "1", stopColor: "#fff", stopOpacity: "0" })),
128
+ React__default["default"].createElement("linearGradient", { id: "paint2_linear_908_34610", x1: "146.5", y1: "61", x2: "146.5", y2: "156", gradientUnits: "userSpaceOnUse" },
129
+ React__default["default"].createElement("stop", { stopColor: "#fff", stopOpacity: ".6" }),
130
+ React__default["default"].createElement("stop", { offset: "1", stopColor: "#fff", stopOpacity: "0" })),
131
+ React__default["default"].createElement("linearGradient", { id: "paint3_linear_908_34610", x1: "178.979", y1: "98.35", x2: "108.338", y2: "98.35", gradientUnits: "userSpaceOnUse" },
132
+ React__default["default"].createElement("stop", { stopColor: "#fff", stopOpacity: "0" }),
133
+ React__default["default"].createElement("stop", { offset: "1", stopColor: "#fff" })))));
134
+
135
+ const CustomerSupportIcon = () => {
136
+ return (React__default["default"].createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
137
+ React__default["default"].createElement("g", { clipPath: "url(#clip0_911_24123)" },
138
+ React__default["default"].createElement("path", { d: "M23.3 16.625c-.042-1.1.166-4.401.166-4.401.073-.27.15-.594.205-.854C25.33 3.783 20.246.75 16 .75c-1.133 0-2.488.413-3.13 1.203a.82.82 0 0 1-.503.307c-2.862.46-4.742 4.183-4.062 8.77q.087.586.23 1.19v.002c.183 1.009.231 3.303.165 4.403-.271 4.482-5.173 8.453-1.985 11.608 8.41 1.974 10.202 2.142 18.57 0 3.187-3.155-1.81-7.122-1.985-11.608", fill: "#9B4E4E" }),
139
+ React__default["default"].createElement("path", { d: "M24.675 14.972a3.2 3.2 0 0 0-.64-.718.25.25 0 1 0-.302.399q.308.261.53.6a1.41 1.41 0 0 1 .177 1.562c-.465.892-1.84 1.63-3.614 2.043q.139.221.264.451c1.85-.457 3.275-1.267 3.794-2.263a1.89 1.89 0 0 0-.21-2.074", fill: "#473049" }),
140
+ React__default["default"].createElement("path", { d: "M18.545 22.798c-.35.41-2.09 4.555-2.535 5.29-.448-.735-2.198-4.89-2.545-5.3.351-.358.597-.808.707-1.297q.096-.405.115-.82c.365.137 3.063.134 3.428-.003v.003q.018.4.11.79c.107.505.357.969.72 1.337", fill: "#FF977B" }),
141
+ React__default["default"].createElement("path", { d: "M17.824 21.46a3.39 3.39 0 0 1-3.652.03q.095-.404.115-.82c.365.138 3.062.135 3.427-.002v.003q.018.4.11.79", fill: "#FF7364" }),
142
+ React__default["default"].createElement("path", { d: "M25.284 28.233c.153.66-.362 1.082-1.08 1.472-.917.5-3.717 1.55-8.205 1.55s-7.287-1.05-8.205-1.55c-.717-.39-1.232-.812-1.08-1.472.048-.187.126-.365.233-.525.535-.84 1.567-2.198 4.2-3.598q.335-.174.692-.33c.075 1.013 2.985.21 2.985.21a.96.96 0 0 1 .57.835c.038.888.168 2.528.615 3.263.445-.735.575-2.375.613-3.263a.96.96 0 0 1 .57-.835s2.907.81 2.985-.202q.347.151.675.322c2.632 1.4 3.665 2.758 4.2 3.598.107.16.185.338.232.525", fill: "#F9E0B4" }),
143
+ React__default["default"].createElement("path", { d: "M22.317 12.023c.359-.006.715.05 1.055.165.785.282 1.33.962 1.2 2.3-.105 1.1-.647 1.752-1.317 2.03-.461.188-.97.217-1.45.085.277-.97.555-3.88.512-4.58m-12.124 4.579a2.26 2.26 0 0 1-1.448-.082c-.672-.28-1.215-.93-1.322-2.033-.123-1.287.375-1.965 1.112-2.265a3 3 0 0 1 1.145-.2c-.042.7.235 3.61.513 4.58", fill: "#4B3956" }),
144
+ React__default["default"].createElement("path", { d: "M22.319 12.021c.04.7-.235 3.61-.513 4.581-.285.996-1.532 3.582-5.285 4.418a2.4 2.4 0 0 1-1.044 0c-3.752-.836-5-3.422-5.284-4.418-.278-.97-.554-3.88-.513-4.58 1.219-.669.668-2.955 1.56-5.057.556-1.307 1.305-1.644 1.722-1.727a.9.9 0 0 0 .533-.338c1.6-2.056 4.794-.95 5.966 1.225 1.066 1.977 1.225 4.918 2.858 5.896", fill: "#FFB497" }),
145
+ React__default["default"].createElement("path", { d: "M20.13 23.118c.067.217.083.446.048.67-.077 1.012-.52 2.735-1.227 2.542-1.018-.277-1.758-2.34-1.758-2.34.518-.23 1.003-.782 1.353-1.192q.068-.086.132-.16a.463.463 0 0 1 .625-.103c.295.153.683.345.828.583m-5.306.872s-.74 2.063-1.758 2.34c-.71.193-1.152-1.537-1.227-2.55a1.5 1.5 0 0 1 .047-.662c.145-.238.533-.43.828-.583a.463.463 0 0 1 .625.103l.125.15c.347.41.837.972 1.36 1.202", fill: "#F7F0DF" }),
146
+ React__default["default"].createElement("path", { d: "M14.94 16.018a.306.306 0 0 0-.3.385 1.414 1.414 0 0 0 2.72 0 .307.307 0 0 0-.3-.385z", fill: "#fff" }),
147
+ React__default["default"].createElement("path", { d: "M12.776 11.492h-.05a.676.676 0 0 0-.675.676v.541c0 .374.302.676.676.676h.049a.676.676 0 0 0 .676-.676v-.54a.676.676 0 0 0-.676-.677m6.448 1.893h.05a.676.676 0 0 0 .675-.676v-.541a.676.676 0 0 0-.676-.676h-.049a.676.676 0 0 0-.676.675v.542c0 .373.303.676.676.676", fill: "#9B4E4E" }),
148
+ React__default["default"].createElement("path", { d: "M16.017 29.117h-.034a.47.47 0 0 0-.471.472v.034c0 .26.21.471.471.471h.034c.26 0 .472-.21.472-.471v-.034a.47.47 0 0 0-.472-.472", fill: "#fff" }),
149
+ React__default["default"].createElement("path", { d: "M16.003 15.2c-.008 0-.69-.01-.69-.402a.25.25 0 0 1 .455-.142 1 1 0 0 0 .235.044.8.8 0 0 0 .229-.044.25.25 0 0 1 .456.142c0 .391-.679.402-.685.402", fill: "#FF7364" }),
150
+ React__default["default"].createElement("path", { d: "M11.532 12.095a.25.25 0 0 1-.225-.36 1.62 1.62 0 0 1 1.338-.752c.396-.017.782.124 1.075.39a.25.25 0 1 1-.333.374 1 1 0 0 0-.742-.264 1.14 1.14 0 0 0-.888.473.25.25 0 0 1-.225.14m-.451-1.716a.25.25 0 0 1-.175-.43c.606-.587 2.632-.888 3.235-.48a.25.25 0 0 1-.281.415c-.37-.253-2.149-.02-2.606.425a.25.25 0 0 1-.173.07m9.387 1.715a.25.25 0 0 1-.226-.14 1.14 1.14 0 0 0-.887-.472 1 1 0 0 0-.742.264.25.25 0 1 1-.332-.373c.293-.267.68-.408 1.075-.391a1.62 1.62 0 0 1 1.337.752.25.25 0 0 1-.225.36m.452-1.715a.25.25 0 0 1-.174-.07c-.457-.444-2.235-.677-2.605-.426a.25.25 0 0 1-.281-.414c.603-.408 2.628-.108 3.234.48a.25.25 0 0 1-.175.43zm2.71 1.175c-.135-.78-.492-2.643-2.005-5.64-.06-.125-.092-.258.005-.355a.254.254 0 0 1 .355.005c.795.817 1.67 2.882 1.9 4.565zM10.163 6.313c-.015.025-1.525 2.925-1.83 4.89l-.028-.173q-.1-.658-.127-1.322C8.54 7.94 9.673 6.16 9.73 6.063a.25.25 0 0 1 .34-.093.25.25 0 0 1 .093.343", fill: "#844040" }),
151
+ React__default["default"].createElement("path", { d: "M23.29 17.917c-1.345.813-3.559 1.331-5.908 1.3a.254.254 0 0 0-.253.247.25.25 0 0 0 .246.253l.23.002c2.522 0 4.831-.603 6.2-1.543a23 23 0 0 1-.516-.259", fill: "#473049" }),
152
+ React__default["default"].createElement("path", { d: "M16.138 20.42c.686 0 1.241-.426 1.241-.952s-.555-.952-1.241-.952-1.242.426-1.242.952.556.952 1.242.952", fill: "#4B3956" })),
153
+ React__default["default"].createElement("defs", null,
154
+ React__default["default"].createElement("clipPath", { id: "clip0_911_24123" },
155
+ React__default["default"].createElement("path", { fill: "#fff", d: "M0 0h32v32H0z" })))));
156
+ };
157
+
158
+ const HealthUpdateIcon = () => {
159
+ return (React__default["default"].createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
160
+ React__default["default"].createElement("path", { d: "M20.69 3.066 4.714 5.456a1.714 1.714 0 0 0-1.442 1.95l3.01 20.106a1.714 1.714 0 0 0 1.948 1.442l15.975-2.39a1.714 1.714 0 0 0 1.441-1.95L22.638 4.507a1.714 1.714 0 0 0-1.949-1.441", fill: "#1B89E5" }),
161
+ React__default["default"].createElement("path", { d: "m4.488 5.49 16.427-2.458 3.13 20.914-16.427 2.458z", fill: "#fff" }),
162
+ React__default["default"].createElement("path", { d: "m13.559 8.067-.567.084a.83.83 0 0 0-.696.942l.02.141a.18.18 0 0 1-.15.203l-.14.021a.83.83 0 0 0-.697.942l.085.568a.83.83 0 0 0 .942.696l.141-.021a.18.18 0 0 1 .203.15l.022.14a.83.83 0 0 0 .942.697l.566-.085a.83.83 0 0 0 .697-.941l-.021-.142a.18.18 0 0 1 .15-.203l.141-.021a.83.83 0 0 0 .697-.943l-.085-.565a.83.83 0 0 0-.942-.697l-.142.022a.18.18 0 0 1-.203-.15l-.02-.142a.83.83 0 0 0-.943-.696m6.553 5.392-9.31 1.393a.32.32 0 0 0 .094.634l9.31-1.393a.32.32 0 1 0-.095-.634m.299 2.303L8.74 17.508a.32.32 0 0 0 .096.634l11.67-1.746a.32.32 0 0 0-.096-.634m-.591 2.436L9.039 19.81a.32.32 0 1 0 .095.634l10.78-1.613a.32.32 0 0 0-.095-.634m-1.084 2.51-9.397 1.406a.32.32 0 0 0 .095.634l9.397-1.407a.32.32 0 1 0-.095-.633m2.318-.347-.828.124a.32.32 0 0 0 .095.634l.828-.124a.32.32 0 0 0-.095-.634", fill: "#78C5EF" }),
163
+ React__default["default"].createElement("path", { d: "m27.358 4.303-.805-.273a1.26 1.26 0 0 0-1.596.789l-4.406 13.013.494 2.544a.442.442 0 0 0 .728.246l1.937-1.72 2.61-7.71.224.075a.583.583 0 0 0 .739-.365l1.357-4.007a2.045 2.045 0 0 0-1.282-2.592", fill: "#36B1F2" }),
164
+ React__default["default"].createElement("path", { d: "M26.32 11.443a.25.25 0 0 1-.236-.33l1.614-4.768a.25.25 0 1 1 .474.16l-1.615 4.768a.25.25 0 0 1-.237.17", fill: "#1B89E5" }),
165
+ React__default["default"].createElement("path", { d: "M17.67 5.535 8.324 6.934a1.15 1.15 0 0 1-1.307-.967l-.098-.654a.44.44 0 0 1 .368-.497l10.754-1.61a.437.437 0 0 1 .498.368l.097.654a1.15 1.15 0 0 1-.967 1.307z", fill: "#3C3854" })));
166
+ };
167
+
168
+ const PersonalizeIcon = () => {
169
+ return (React__default["default"].createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
170
+ React__default["default"].createElement("path", { d: "M31.364 22.343a5 5 0 0 0-1.713-1.477c-.847-.488-1.52-.816-1.638-1.931h-1.761c-.12 1.115-.797 1.443-1.644 1.931a5 5 0 0 0-1.712 1.477c-.33.438-.095.709.331.936.723.386 2.4.827 3.903.827 1.502 0 3.18-.441 3.902-.827.426-.227.662-.498.332-.936", fill: "#F78181" }),
171
+ React__default["default"].createElement("path", { d: "M21.765 14c-.006-3.907-4.11-7.388-7.666-4.77a.4.4 0 0 1-.129.065c-.958.303-1.65 1.213-2.108 2.305-1.408 3.347.2 7.77-.291 11.538h9.938c-.185-2.536.26-6.777.256-9.138", fill: "#FF6671" }),
172
+ React__default["default"].createElement("path", { d: "M5.354 9.745c-3.033 0-5.268 3.012-4.76 6.07.424 2.568 3.008 2.747 3.008 2.747l3.5-.003s2.586-.175 3.012-2.743c.507-3.06-1.728-6.07-4.76-6.07", fill: "#3A417C" }),
173
+ React__default["default"].createElement("path", { d: "M9.073 22.755c-.688.367-2.288.79-3.72.79s-3.03-.423-3.72-.79c-.408-.218-.63-.475-.318-.893.43-.588.99-1.07 1.635-1.407.205-.118.393-.203.563-.283h.002c.503-.235.843-.415.928-1.207h1.822c.085.797.428.975.935 1.21.17.08.355.165.558.28.644.339 1.202.82 1.632 1.407.315.418.09.675-.317.893", fill: "#BF6666" }),
174
+ React__default["default"].createElement("path", { d: "M31.332 22.342a5.04 5.04 0 0 0-1.712-1.477 9 9 0 0 1-.815-.498 3.43 3.43 0 0 1-3.373-.005c-.245.178-.547.325-.855.503a5 5 0 0 0-1.712 1.477c-.33.44-.095.71.33.938.722.385 2.4.827 3.902.827s3.18-.442 3.903-.827c.427-.228.662-.498.332-.938", fill: "#3A417C" }),
175
+ React__default["default"].createElement("path", { d: "M28.232 9.496c-1.05-.28-3.25-.14-3.708 1.205a.46.46 0 0 1-.18.24c-1.035.682-1.353 1.643-.862 3.845h7.298c.738-4.148-1.278-4.95-2.548-5.29", fill: "#FFB45A" }),
176
+ React__default["default"].createElement("path", { d: "M8.402 14.623a.51.51 0 0 1 .229.432 5.9 5.9 0 0 1-.278 1.793c-.262.697-.942 1.882-2.245 2.152a4 4 0 0 1-.757.09 4 4 0 0 1-.76-.09c-1.303-.27-1.98-1.455-2.243-2.152a5.9 5.9 0 0 1-.278-1.793.51.51 0 0 1 .229-.432c.99-.668 2.339-.862 3.052-.86.71-.002 2.06.192 3.051.86", fill: "#CE7A7A" }),
177
+ React__default["default"].createElement("path", { d: "M30.781 14.786a1.2 1.2 0 0 0-.469-.053.45.45 0 0 1-.225-.04c-.956-.438-.852-1.208-.955-1.723-.407-2.036-2.745-1.94-3.408-1.24a.36.36 0 0 1-.19.11c-.87.175-1.371 1.948-1.469 2.68a.24.24 0 0 1-.232.209q-.18 0-.35.057c-.448.157-.572.675-.392 1.157a1.03 1.03 0 0 0 .948.725.255.255 0 0 1 .267.175 3.31 3.31 0 0 0 1.945 2.092 2.13 2.13 0 0 0 1.762 0 3.3 3.3 0 0 0 1.945-2.092.254.254 0 0 1 .267-.175 1.03 1.03 0 0 0 .947-.725c.181-.482.056-1-.391-1.157m-9.271 8.351a5.9 5.9 0 0 0-2.012-1.734c-.995-.573-1.723-.494-1.863-1.803l-2.213-.01c-.14 1.31-.844 1.24-1.839 1.814a5.9 5.9 0 0 0-2.011 1.734c-.388.515-.112.833.389 1.1.849.453 2.82.972 4.584.972s3.726-.519 4.575-.972c.5-.268.777-.586.39-1.1", fill: "#FF9797" }),
178
+ React__default["default"].createElement("path", { d: "M21.51 23.137a5.9 5.9 0 0 0-2.012-1.734c-.995-.573-1.723-.494-1.863-1.803l-2.213-.01c-.14 1.31-.844 1.24-1.839 1.814a5.9 5.9 0 0 0-2.011 1.734c-.388.515-.112.833.389 1.1.849.453 2.82.972 4.584.972s3.726-.519 4.575-.972c.5-.268.777-.586.39-1.1", fill: "#FF9797" }),
179
+ React__default["default"].createElement("path", { d: "M18.682 13.703a3.32 3.32 0 0 1 1.206 3.398 3.63 3.63 0 0 1-2.229 2.489 3.5 3.5 0 0 1-1.118.213 3.5 3.5 0 0 1-1.12-.213 3.63 3.63 0 0 1-2.228-2.49 8.5 8.5 0 0 1-.284-2.55c.137-2.045.975-3.52 2.095-3.245a.25.25 0 0 0 .182-.023c1.377-.755 1.672 1.03 3.496 2.421", fill: "#FFAEAE" }),
180
+ React__default["default"].createElement("path", { d: "M21.12 24.238c-.85.452-2.81.972-4.575.972s-3.735-.52-4.585-.972c-.5-.268-.777-.585-.387-1.1a5.65 5.65 0 0 1 1.735-1.573 6.03 6.03 0 0 0 3.232.788 6.1 6.1 0 0 0 3.253-.775 5.7 5.7 0 0 1 1.717 1.56c.388.515.11.832-.39 1.1", fill: "#5C8EFF" }),
181
+ React__default["default"].createElement("path", { d: "M9.073 22.755c-.688.368-2.288.79-3.72.79s-3.03-.422-3.72-.79c-.408-.217-.63-.475-.318-.892.43-.588.99-1.07 1.635-1.408.205-.117.393-.202.563-.282h.002c.557.318 1.192.47 1.833.44a3.47 3.47 0 0 0 1.852-.438c.17.08.355.165.558.28a4.8 4.8 0 0 1 1.632 1.408c.315.417.09.675-.317.892", fill: "#4856B5" })));
182
+ };
183
+
184
+ const SecurityIcon = () => {
185
+ return (React__default["default"].createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
186
+ React__default["default"].createElement("path", { d: "M16 29.625c1.196 0 2.348-.639 3.327-1.31 5.423-3.715 6.606-5.558 6.995-6.163.436-.68 1.533-2.23 2.73-12.356.33-2.804-1.143-5.19-3.893-6.066a31.65 31.65 0 0 0-18.319 0c-2.75.874-4.222 3.262-3.892 6.067 1.196 10.125 2.293 11.674 2.73 12.355.388.605 1.572 2.448 6.994 6.163.98.671 2.13 1.31 3.328 1.31", fill: "#9DBA22" }),
187
+ React__default["default"].createElement("path", { d: "M25.142 7.18c-2.902-1.307-6.095-1.645-9.143-1.645s-6.241.338-9.143 1.645c-.7.316-1.115.77-1.04 1.365.382 3.052 1.583 11.235 2.192 12.128 1.21 1.777 5.533 4.67 7.267 5.788a1.37 1.37 0 0 0 1.448 0c1.733-1.119 6.056-4.011 7.267-5.788.609-.893 1.81-9.075 2.193-12.128.074-.595-.34-1.049-1.041-1.365", fill: "#BFDF46" }),
188
+ React__default["default"].createElement("path", { d: "M15.798 19.264c-1.522-.418-2.486-1.494-2.992-3.333a9.2 9.2 0 0 1-.177-4.156c.109-.644.715-1.192 1.434-.802q1.159.616 2.377 1.102c2.909 1.205 3.817 4.07 2.732 5.783-.578.912-1.922 1.806-3.375 1.406", fill: "#fff" }),
189
+ React__default["default"].createElement("path", { d: "M20.667 20.13a.3.3 0 0 1-.095-.015c-2.152-.684-4.24-2.662-4.838-4.08a.313.313 0 0 1 .508-.35q.045.045.067.106c.461 1.092 2.311 3.048 4.451 3.728a.313.313 0 0 1-.094.61", fill: "#9DBA22" })));
190
+ };
191
+
192
+ const ServiceIcon = () => {
193
+ return (React__default["default"].createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
194
+ React__default["default"].createElement("g", { clipPath: "url(#clip0_911_3434)" },
195
+ React__default["default"].createElement("path", { d: "M30.466 17.553c.714-.548.988-1.39.611-1.881s-1.261-.444-1.975.104c-.714.549-.988 1.391-.611 1.882s1.261.444 1.975-.105", fill: "#563960" }),
196
+ React__default["default"].createElement("path", { d: "M30.122 7.72a2.2 2.2 0 0 1-.438.37 2.355 2.355 0 0 1-2.787-3.79l.022-.017a2.356 2.356 0 0 1 3.203 3.437", fill: "#E8E2E2" }),
197
+ React__default["default"].createElement("path", { d: "M16.474 3.996c-.544-.568-1.058-1.45-1.082-2.29l-1.395.7a1.394 1.394 0 1 0 1.247 2.491l1.159-.583.259-.14a3 3 0 0 1-.188-.178", fill: "#E5395E" }),
198
+ React__default["default"].createElement("path", { d: "M18.934 2.175a1.39 1.39 0 0 1-.77 1.246l-1.472.738-.256.138a2.52 2.52 0 0 1-1.189-1.331 2 2 0 0 1-.042-1.165l.353-.191 1.358-.68a1.392 1.392 0 0 1 2.018 1.245", fill: "#F9AF2B" }),
199
+ React__default["default"].createElement("path", { d: "M5.507 6.695c-.407.705-1.475.86-2.425.362L2.975 7a3 3 0 0 1-.358-.248c.005-.012 1.05-.635 1.355-1.157.258-.44.25-1.335.268-1.38q.136.058.265.132.132.078.257.168c.795.585 1.128 1.515.745 2.18", fill: "#F44A52" }),
200
+ React__default["default"].createElement("path", { d: "M4.343 5.848a2.9 2.9 0 0 1-1.285 1.197L2.976 7a2.6 2.6 0 0 1-.398-.28c-.692-.587-.965-1.442-.605-2.067.378-.655 1.323-.833 2.215-.463a3 3 0 0 1 .51.28c.029.485-.095.967-.355 1.378", fill: "#E8E2E2" }),
201
+ React__default["default"].createElement("path", { d: "M1.87 17.24a1.12 1.12 0 1 0 0-2.24 1.12 1.12 0 0 0 0 2.24", fill: "#F9AF2B" }),
202
+ React__default["default"].createElement("path", { d: "M30.123 7.72a2.2 2.2 0 0 1-.437.37c0-1.013-1.5-3.058-3.153-3.418q.162-.206.365-.372l.023-.018c1.65.45 3.052 2.16 3.202 3.438", fill: "#C3C7C9" }),
203
+ React__default["default"].createElement("path", { d: "M25.295 17.4v9.637c0 2.13-1.745 3.225-3.855 3.518-2.707.375-8.128.375-10.835 0-2.11-.29-3.855-1.387-3.855-3.517v-9.637a3.86 3.86 0 0 1 1.354-2.93c.229-.194.412-.436.537-.71h14.767c.12.275.303.518.534.71q.16.135.303.29a3.85 3.85 0 0 1 1.05 2.64", fill: "#1B89E5" }),
204
+ React__default["default"].createElement("path", { d: "M16.568 17.151h-1.093a1.58 1.58 0 0 0-1.58 1.58v.272a.34.34 0 0 1-.34.34h-.272a1.58 1.58 0 0 0-1.58 1.58v1.095a1.58 1.58 0 0 0 1.58 1.58h.272a.34.34 0 0 1 .34.34v.272a1.58 1.58 0 0 0 1.58 1.58h1.093a1.58 1.58 0 0 0 1.58-1.58v-.273a.34.34 0 0 1 .34-.34h.274a1.58 1.58 0 0 0 1.58-1.58v-1.092a1.58 1.58 0 0 0-1.58-1.58h-.273a.34.34 0 0 1-.341-.34v-.274a1.58 1.58 0 0 0-1.58-1.58", fill: "#fff" }),
205
+ React__default["default"].createElement("path", { d: "M24.137 13.762H7.907a.47.47 0 0 1-.471-.47v-2.7a2.583 2.583 0 0 1 2.552-2.554c3.017-.1 9.05-.1 12.067 0a2.583 2.583 0 0 1 2.553 2.552v2.7a.473.473 0 0 1-.471.472", fill: "#E8E2E2" })),
206
+ React__default["default"].createElement("defs", null,
207
+ React__default["default"].createElement("clipPath", { id: "clip0_911_3434" },
208
+ React__default["default"].createElement("path", { fill: "#fff", d: "M0 0h32v32H0z" })))));
209
+ };
210
+
211
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
212
+ const getContents = (t) => {
213
+ return [
214
+ {
215
+ label: 'Personalized Experience',
216
+ description: 'Your name, gender, and date of birth help us provide tailored health advice and personalized care plans that fit your unique needs.',
217
+ icon: React__default["default"].createElement(PersonalizeIcon, null),
218
+ },
219
+ {
220
+ label: 'Timely Health Updates',
221
+ description: 'We use your phone number and email to send important notifications, health reminders, and updates on new content to keep you informed.',
222
+ icon: React__default["default"].createElement(HealthUpdateIcon, null),
223
+ },
224
+ {
225
+ label: 'Enhanced Security',
226
+ description: 'We use your phone number and email to send important notifications, health reminders, and updates on new content to keep you informed.',
227
+ icon: React__default["default"].createElement(SecurityIcon, null),
228
+ },
229
+ {
230
+ label: 'Quick Customer Support',
231
+ description: 'We use your phone number and email to send important notifications, health reminders, and updates on new content to keep you informed.',
232
+ icon: React__default["default"].createElement(CustomerSupportIcon, null),
233
+ },
234
+ {
235
+ label: 'Service Improvement',
236
+ description: 'We use your phone number and email to send important notifications, health reminders, and updates on new content to keep you informed.',
237
+ icon: React__default["default"].createElement(ServiceIcon, null),
238
+ },
239
+ ];
240
+ };
241
+ const CollectInfoTextPopup = () => {
242
+ const { openCollectInfoPopup, setOpenCollectInfoPopup } = useSSOState();
243
+ useTranslations.useTranslations();
244
+ const contents = getContents();
245
+ const [mobileDragOffset, setMobileDragOffset] = React.useState(0);
246
+ const dragStartYRef = React.useRef(0);
247
+ const mobileDragOffsetRef = React.useRef(mobileDragOffset);
248
+ mobileDragOffsetRef.current = mobileDragOffset;
249
+ const throttleSetMobileDragOffset = React.useMemo(() => {
250
+ return throttle__default["default"](setMobileDragOffset, 70);
251
+ }, []);
252
+ React.useEffect(() => {
253
+ if (openCollectInfoPopup) {
254
+ setMobileDragOffset(0);
255
+ }
256
+ }, [openCollectInfoPopup]);
257
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
258
+ React__default["default"].createElement("style", { key: mobileDragOffset }, `
259
+ .collect-info-text-popup .mantine-Modal-inner {
260
+ transform: translateY(${Math.round(mobileDragOffset)}px);
261
+ }
262
+ `),
263
+ React__default["default"].createElement(index.Modal, { opened: openCollectInfoPopup, onClose: () => setOpenCollectInfoPopup(false), withCloseButton: false, styles: (theme) => ({
264
+ body: {
265
+ padding: '32px 24px',
266
+ position: 'relative',
267
+ background: 'linear-gradient(180deg, #91CAFF 0%, #CFE8FF 100px, #FFFFFF 200px)',
268
+ [theme.fn.smallerThan('sm')]: {
269
+ height: '100%',
270
+ },
271
+ },
272
+ content: {
273
+ [theme.fn.smallerThan('sm')]: {
274
+ width: '100%',
275
+ height: '100%',
276
+ borderBottomLeftRadius: 0,
277
+ borderBottomRightRadius: 0,
278
+ maxWidth: '100%',
279
+ maxHeight: '100%',
280
+ },
281
+ },
282
+ inner: {
283
+ [theme.fn.smallerThan('sm')]: {
284
+ padding: 0,
285
+ left: 0,
286
+ right: 0,
287
+ top: 120,
288
+ // transform: `translateY(${Math.round(mobileDragOffset)}px)`,
289
+ display: 'block',
290
+ transition: 'transform 70ms',
291
+ },
292
+ },
293
+ }), className: "collect-info-text-popup" },
294
+ React__default["default"].createElement(core.Box, { sx: (theme) => ({
295
+ [theme.fn.largerThan('sm')]: {
296
+ display: 'none',
297
+ },
298
+ padding: 8,
299
+ width: '100%',
300
+ cursor: 'grab',
301
+ display: 'flex',
302
+ justifyContent: 'center',
303
+ position: 'absolute',
304
+ top: 0,
305
+ left: 0,
306
+ }), draggable: true, onDrag: (e) => {
307
+ if (e.clientY <= 5)
308
+ return;
309
+ throttleSetMobileDragOffset(e.clientY - dragStartYRef.current);
310
+ }, onDragStart: (e) => {
311
+ dragStartYRef.current = e.clientY;
312
+ }, onDragEnd: (e) => {
313
+ if (e.clientY - dragStartYRef.current > 100) {
314
+ setMobileDragOffset(window.innerHeight);
315
+ setTimeout(() => {
316
+ setOpenCollectInfoPopup(false);
317
+ }, 100);
318
+ }
319
+ else {
320
+ throttleSetMobileDragOffset(0);
321
+ }
322
+ }, onTouchStart: (e) => {
323
+ dragStartYRef.current = e.touches[0].clientY;
324
+ }, onTouchMove: (e) => {
325
+ if (e.touches[0].clientY < 0)
326
+ return;
327
+ throttleSetMobileDragOffset(e.touches[0].clientY - dragStartYRef.current);
328
+ }, onTouchEnd: (e) => {
329
+ if (e.changedTouches[0].clientY - dragStartYRef.current > 100) {
330
+ setMobileDragOffset(window.innerHeight);
331
+ setTimeout(() => {
332
+ setOpenCollectInfoPopup(false);
333
+ }, 100);
334
+ }
335
+ else {
336
+ throttleSetMobileDragOffset(0);
337
+ }
338
+ } },
339
+ React__default["default"].createElement(core.Box, { sx: {
340
+ border: '1.5px solid #ADB3BC',
341
+ background: 'gray',
342
+ borderRadius: 3,
343
+ width: 44,
344
+ } })),
345
+ React__default["default"].createElement("div", { style: {
346
+ height: 40,
347
+ } },
348
+ React__default["default"].createElement(index$1.Button, { variant: "white", sx: (theme) => ({
349
+ width: 40,
350
+ height: 40,
351
+ padding: 8,
352
+ background: 'white',
353
+ borderRadius: '100%',
354
+ [theme.fn.smallerThan('sm')]: {
355
+ display: 'none',
356
+ },
357
+ }), onClick: () => setOpenCollectInfoPopup(false) },
358
+ React__default["default"].createElement(arrow.ChevronLeft, null))),
359
+ React__default["default"].createElement(BackgroundHeader$1, null),
360
+ React__default["default"].createElement(core.Stack, { pos: "relative", mt: 100, spacing: 8, style: {
361
+ zIndex: 1,
362
+ } },
363
+ React__default["default"].createElement(index$2.Text, { size: "h4" }, "Why We Need Your Information"),
364
+ React__default["default"].createElement(index$3.Accordion, { styles: {
365
+ item: {
366
+ borderBottomColor: '#E4E8EC',
367
+ paddingBottom: 16,
368
+ marginTop: 16,
369
+ },
370
+ control: {
371
+ padding: 0,
372
+ },
373
+ content: {
374
+ padding: 0,
375
+ marginTop: 8,
376
+ },
377
+ } }, contents.map((item, index) => (React__default["default"].createElement(index$3.Accordion.Item, { key: index, value: item.label },
378
+ React__default["default"].createElement(index$3.Accordion.Control, { icon: item.icon },
379
+ React__default["default"].createElement(index$2.Text, { size: "s3", weight: "semiBold" }, item.label)),
380
+ React__default["default"].createElement(index$3.Accordion.Panel, null,
381
+ React__default["default"].createElement(index$2.Text, { size: "p3" }, item.description))))))))));
382
+ };
383
+
384
+ const ConfirmClosePopup = ({ opened, onCancel, onClose, }) => {
385
+ return (React__default["default"].createElement(index.Modal, { opened: opened, onClose: () => onCancel(), withCloseButton: false, styles: (theme) => ({
386
+ body: {
387
+ padding: '32px 24px',
388
+ position: 'relative',
389
+ background: 'linear-gradient(180deg, #91CAFF 0%, #CFE8FF 100px, #FFFFFF 200px)',
390
+ [theme.fn.smallerThan('sm')]: {
391
+ height: '100%',
392
+ },
393
+ },
394
+ content: {
395
+ [theme.fn.smallerThan('sm')]: {
396
+ width: '100%',
397
+ height: '100%',
398
+ borderBottomLeftRadius: 0,
399
+ borderBottomRightRadius: 0,
400
+ maxWidth: '100%',
401
+ maxHeight: '100%',
402
+ },
403
+ },
404
+ inner: {
405
+ [theme.fn.smallerThan('sm')]: {
406
+ padding: 0,
407
+ left: 0,
408
+ right: 0,
409
+ top: 'unset',
410
+ // transform: `translateY(${Math.round(mobileDragOffset)}px)`,
411
+ display: 'block',
412
+ transition: 'transform 70ms',
413
+ },
414
+ },
415
+ }) },
416
+ React__default["default"].createElement(BackgroundHeader, null),
417
+ React__default["default"].createElement(core.Stack, { pos: "relative", mt: 150, spacing: 8, style: {
418
+ zIndex: 1,
419
+ textAlign: 'center',
420
+ } },
421
+ React__default["default"].createElement(index$2.Text, { size: "h4" }, "Are you sure you want to exit?"),
422
+ React__default["default"].createElement(index$2.Text, { size: "p3" }, "You\u2019re just a step away from completing your account setup. Do you really want to leave?")),
423
+ React__default["default"].createElement(core.Stack, { mt: 32, spacing: 8, align: "center" },
424
+ React__default["default"].createElement(index$1.Button, { variant: "primary", size: "lg", onClick: onCancel, w: "50%", radius: 40 },
425
+ React__default["default"].createElement(index$2.Text, { size: "s2", weight: "regular", color: "inherit" }, "Cancel")),
426
+ React__default["default"].createElement(index$1.Button, { variant: "white", size: "lg", onClick: onClose, fullWidth: true },
427
+ React__default["default"].createElement(index$2.Text, { size: "p2", weight: "regular", color: "gray.6" }, "I want to exit now")))));
428
+ };
429
+ const BackgroundHeader = () => (React__default["default"].createElement("svg", { width: "292", height: "255", viewBox: "0 0 292 255", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: {
430
+ position: 'absolute',
431
+ top: 0,
432
+ left: '50%',
433
+ zIndex: 0,
434
+ transform: 'translateX(-50%)',
435
+ pointerEvents: 'none',
436
+ } },
437
+ React__default["default"].createElement("circle", { opacity: ".2", cx: "146", cy: "109", r: "146", fill: "url(#paint0_linear_908_35161)" }),
438
+ React__default["default"].createElement("circle", { opacity: ".3", cx: "146", cy: "109", r: "85", fill: "url(#paint1_linear_908_35161)" }),
439
+ React__default["default"].createElement("circle", { cx: "146.5", cy: "108.5", r: "47.5", fill: "url(#paint2_linear_908_35161)" }),
440
+ React__default["default"].createElement("circle", { cx: "146.5", cy: "108.5", r: "47", stroke: "url(#paint3_linear_908_35161)" }),
441
+ React__default["default"].createElement("path", { d: "m148.68 89.129-13.51-2.087a4.552 4.552 0 0 0-5.17 4.454v35.009a4.55 4.55 0 0 0 1.586 3.395 4.56 4.56 0 0 0 3.594 1.059l13.5-2.087a4.474 4.474 0 0 0 3.82-4.452V93.58a4.48 4.48 0 0 0-3.82-4.451", fill: "#2D87F3" }),
442
+ React__default["default"].createElement("path", { d: "M164.342 108.002a1.43 1.43 0 0 1-.557 1.132l-4.714 3.643a1.07 1.07 0 0 1-1.563-.281 1.1 1.1 0 0 1-.161-.566v-1.224l-5.085-.025a.54.54 0 0 1-.535-.539v-4.322a.54.54 0 0 1 .538-.538l5.088.004-.009-1.214a1.08 1.08 0 0 1 .598-.962 1.07 1.07 0 0 1 1.127.113l4.716 3.648a1.42 1.42 0 0 1 .557 1.131", fill: "#FF6F4D" }),
443
+ React__default["default"].createElement("path", { d: "M164.342 108.002a1.43 1.43 0 0 1-.557 1.132l-4.714 3.643a1.07 1.07 0 0 1-1.563-.281 1.1 1.1 0 0 1-.161-.566v-1.224l-5.085-.025a.54.54 0 0 1-.535-.539v-4.322a.54.54 0 0 1 .538-.538l5.088.004-.009-1.214a1.08 1.08 0 0 1 .598-.962 1.07 1.07 0 0 1 1.127.113l4.716 3.648a1.42 1.42 0 0 1 .557 1.131m-18.248-2.179v4.324a.54.54 0 0 0 .539.539h3.017a.54.54 0 0 0 .538-.539v-4.324a.54.54 0 0 0-.538-.539h-3.017a.54.54 0 0 0-.539.539m-1.616 4.341a.54.54 0 0 1-.539.539h-.977a1.463 1.463 0 0 1-1.462-1.462v-2.478a1.463 1.463 0 0 1 1.462-1.463h.977a.54.54 0 0 1 .539.539z", fill: "#FF6F4D" }),
444
+ React__default["default"].createElement("defs", null,
445
+ React__default["default"].createElement("linearGradient", { id: "paint0_linear_908_35161", x1: "147.5", y1: "141", x2: "36.5", y2: "30", gradientUnits: "userSpaceOnUse" },
446
+ React__default["default"].createElement("stop", { stopColor: "#fff", stopOpacity: "0" }),
447
+ React__default["default"].createElement("stop", { offset: "1", stopColor: "#fff" })),
448
+ React__default["default"].createElement("linearGradient", { id: "paint1_linear_908_35161", x1: "218.376", y1: "63.134", x2: "61", y2: "109", gradientUnits: "userSpaceOnUse" },
449
+ React__default["default"].createElement("stop", { stopColor: "#fff" }),
450
+ React__default["default"].createElement("stop", { offset: "1", stopColor: "#fff", stopOpacity: "0" })),
451
+ React__default["default"].createElement("linearGradient", { id: "paint2_linear_908_35161", x1: "146.5", y1: "61", x2: "146.5", y2: "156", gradientUnits: "userSpaceOnUse" },
452
+ React__default["default"].createElement("stop", { stopColor: "#fff", stopOpacity: ".6" }),
453
+ React__default["default"].createElement("stop", { offset: "1", stopColor: "#fff", stopOpacity: "0" })),
454
+ React__default["default"].createElement("linearGradient", { id: "paint3_linear_908_35161", x1: "178.979", y1: "98.35", x2: "108.338", y2: "98.35", gradientUnits: "userSpaceOnUse" },
455
+ React__default["default"].createElement("stop", { stopColor: "#fff", stopOpacity: "0" }),
456
+ React__default["default"].createElement("stop", { offset: "1", stopColor: "#fff" })))));
457
+
458
+ var SSOStepTypeType;
459
+ (function (SSOStepTypeType) {
460
+ SSOStepTypeType["FIRST"] = "first";
461
+ SSOStepTypeType["EMAIL"] = "email";
462
+ SSOStepTypeType["VERIFY_PHONE"] = "verify_phone";
463
+ SSOStepTypeType["PASSWORD"] = "password";
464
+ SSOStepTypeType["UPDATE_EMAIL"] = "update_email";
465
+ SSOStepTypeType["FORGOT_PASSWORD_PHONE"] = "forgot_password_phone";
466
+ SSOStepTypeType["FORGOT_PASSWORD_SETUP"] = "forgot_password_setup";
467
+ SSOStepTypeType["OTP"] = "otp";
468
+ SSOStepTypeType["SETUP_FULL"] = "setup_full";
469
+ })(SSOStepTypeType || (SSOStepTypeType = {}));
470
+ const SSOStepsContext = React.createContext({
471
+ currentStepIndex: 0,
472
+ steps: [
473
+ {
474
+ type: SSOStepTypeType.FIRST,
475
+ },
476
+ ],
477
+ setSteps: () => false,
478
+ goNext: () => false,
479
+ goBack: () => false,
480
+ addStep: () => false,
481
+ });
482
+ const SSOStepsProvider = ({ children, defaultSteps, }) => {
483
+ const [steps, setSteps] = React.useState(defaultSteps || [
484
+ {
485
+ type: SSOStepTypeType.FIRST,
486
+ },
487
+ ]);
488
+ const [currentStepIndex, setCurrentStepIndex] = React.useState(0);
489
+ const [shareData, setShareData] = React.useState({});
490
+ return (React__default["default"].createElement(SSOStepsContext.Provider, { value: {
491
+ currentStepIndex,
492
+ steps,
493
+ setSteps,
494
+ addStep: (step) => {
495
+ setSteps((s) => [...s, step]);
496
+ },
497
+ goNext: () => {
498
+ setCurrentStepIndex((index) => index + 1);
499
+ },
500
+ goBack: () => {
501
+ setCurrentStepIndex((index) => index - 1);
502
+ // remove step when go back
503
+ setSteps((steps) => steps.slice(0, steps.length - 1));
504
+ },
505
+ shareData,
506
+ setShareData,
507
+ } }, children));
508
+ };
509
+ const useSSOSteps = () => {
510
+ return React__default["default"].useContext(SSOStepsContext);
511
+ };
512
+
513
+ const SSOPopupWrapper = ({ children, opened, onClose, }) => {
514
+ var _a;
515
+ const { steps, goBack } = useSSOSteps();
516
+ const { locale } = useSSOState();
517
+ const showBack = steps.length > 1;
518
+ const showClose = steps.length === 1;
519
+ const showLogo = steps.length === 1;
520
+ const logoType = (_a = index$4.LOCALE_SPECS[locale]) === null || _a === void 0 ? void 0 : _a.LOGO_TYPE;
521
+ const [closeConfirmOpen, setCloseConfirmOpen] = React__default["default"].useState(false);
522
+ const onCloseClick = () => {
523
+ setCloseConfirmOpen(true);
524
+ };
525
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
526
+ React__default["default"].createElement(index.Modal, { opened: opened, onClose: onCloseClick, styles: (theme) => ({
527
+ body: {
528
+ display: 'flex',
529
+ flexDirection: 'column',
530
+ gap: 24,
531
+ padding: '36px 24px',
532
+ position: 'relative',
533
+ background: 'linear-gradient(180deg, #A5D4FF 0%, #FFFFFF 150px)',
534
+ overflow: 'auto',
535
+ [theme.fn.smallerThan('sm')]: {
536
+ height: '100%',
537
+ },
538
+ },
539
+ content: {
540
+ [theme.fn.smallerThan('sm')]: {
541
+ width: '100%',
542
+ height: '100%',
543
+ borderRadius: 0,
544
+ maxWidth: '100%',
545
+ maxHeight: '100%',
546
+ },
547
+ },
548
+ inner: {
549
+ [theme.fn.smallerThan('sm')]: {
550
+ padding: 0,
551
+ left: 0,
552
+ right: 0,
553
+ display: 'block',
554
+ },
555
+ },
556
+ }), withCloseButton: false },
557
+ React__default["default"].createElement("div", { style: {
558
+ height: 40,
559
+ display: 'flex',
560
+ alignItems: 'center',
561
+ justifyContent: 'space-between',
562
+ } },
563
+ showBack && (React__default["default"].createElement(index$1.Button, { variant: "white", style: {
564
+ width: 40,
565
+ height: 40,
566
+ padding: 8,
567
+ background: 'white',
568
+ borderRadius: '100%',
569
+ }, onClick: goBack },
570
+ React__default["default"].createElement(arrow.ChevronLeft, null))),
571
+ showLogo && (React__default["default"].createElement(logoIcon.LogoIcon, { type: logoType, height: 32, width: 'unset' })),
572
+ showClose && (React__default["default"].createElement(index$1.Button, { variant: "white", style: {
573
+ width: 40,
574
+ height: 40,
575
+ padding: 8,
576
+ background: 'white',
577
+ borderRadius: '100%',
578
+ }, onClick: onCloseClick },
579
+ React__default["default"].createElement(core$1.Close, null)))),
580
+ React__default["default"].createElement("div", { style: {
581
+ flex: 1,
582
+ } }, children)),
583
+ React__default["default"].createElement(ConfirmClosePopup, { opened: closeConfirmOpen, onCancel: () => setCloseConfirmOpen(false), onClose: () => {
584
+ setCloseConfirmOpen(false);
585
+ onClose === null || onClose === void 0 ? void 0 : onClose();
586
+ } }),
587
+ React__default["default"].createElement(CollectInfoTextPopup, null)));
588
+ };
589
+
590
+ const SSO_V2_PATHS = {
591
+ LOGIN_BY_SOCIAL: 'member/social-login',
592
+ EMAIL: {
593
+ REGISTER_BY_SEND_OTP: 'login/login-with-email',
594
+ LOGIN_BY_PASSWORD: 'member/login',
595
+ VERIFY_BY_OTP: 'login/email-verify-code',
596
+ SEND_OTP: 'login/email-resend-otp-code', // FOR RESEND OTP IN CASE FAIL
597
+ },
598
+ PHONE: {
599
+ REGISTER_BY_SEND_OTP: 'login/login-with-sms',
600
+ SEND_OTP: 'login/sms/sent-otp',
601
+ VERIFY_BY_OTP: 'login/phone-verify-code',
602
+ LOGIN_BY_PASSWORD: 'member/login-by-phone',
603
+ UPDATE_PHONE_SEND_OTP: 'sms-social/sent-otp',
604
+ UPDATE_PHONE_VERIFY_OTP: 'sms-social/phone-verify-code',
605
+ },
606
+ ZALO: {
607
+ REGISTER_BY_SEND_OTP: 'login/login-with-zalo',
608
+ SEND_OTP: 'login/zalo/sent-otp',
609
+ VERIFY_BY_OTP: 'login/zalo-verify-code',
610
+ UPDATE_PHONE_SEND_OTP: 'sms-social/zalo/sent-otp',
611
+ UPDATE_PHONE_VERIFY_OTP: 'sms-social/zalo-verify-code',
612
+ },
613
+ RESET_PASSWORD: 'login/reset-password',
614
+ CHECK_USER_EXIST: 'member/check-user-exist',
615
+ UPDATE_USER_INFO: 'login/update-first-info',
616
+ };
617
+
618
+ const locale = process.env.UNIFY_LOCALE || 'vi-VN';
619
+ const websiteId = index$4.LOCALE_SPECS[locale].SITE_ID;
620
+ index$4.LOCALE_SPECS[locale].PHONE;
621
+ const allAvailableAreaCodes = Object.keys(index$4.LOCALE_SPECS).map((locale) => index$4.LOCALE_SPECS[locale].PHONE);
622
+ const getSSOV2ApiUrl = (path) => {
623
+ return `${routing.getCurrentSsoUrl(locale)}/api/v2/${path}`;
624
+ };
625
+ const getSSOApiUrl = (path) => {
626
+ return `${routing.getCurrentSsoUrl(locale)}/api/${path}`;
627
+ };
628
+ const BEARER_TOKEN_COOKIE = 'hhg_user_token';
629
+ // NOTICE: RUN ONLY CLIENT SIDE
630
+ const fetchSSOV2Api = (path, options = {}, noAuth) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
631
+ var _a;
632
+ let response;
633
+ const authToken = noAuth
634
+ ? ''
635
+ : (_a = document.cookie
636
+ .split('; ')
637
+ .find((row) => row.startsWith(BEARER_TOKEN_COOKIE))) === null || _a === void 0 ? void 0 : _a.split('=')[1];
638
+ try {
639
+ response = yield fetch(getSSOV2ApiUrl(path), authToken
640
+ ? Object.assign(Object.assign({}, options), { headers: Object.assign({ Authorization: `Bearer ${authToken}` }, options === null || options === void 0 ? void 0 : options.headers) }) : options);
641
+ }
642
+ catch (error) {
643
+ console.error(error);
644
+ return null;
645
+ }
646
+ return response === null || response === void 0 ? void 0 : response.json();
647
+ });
648
+ const fetchSSOApi = (path, options = {}, noAuth) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
649
+ var _b;
650
+ let response;
651
+ const authToken = noAuth
652
+ ? ''
653
+ : (_b = document.cookie
654
+ .split('; ')
655
+ .find((row) => row.startsWith(BEARER_TOKEN_COOKIE))) === null || _b === void 0 ? void 0 : _b.split('=')[1];
656
+ try {
657
+ response = yield fetch(getSSOApiUrl(path), authToken
658
+ ? Object.assign(Object.assign({}, options), { headers: Object.assign({ Authorization: `Bearer ${authToken}` }, options === null || options === void 0 ? void 0 : options.headers) }) : options);
659
+ }
660
+ catch (error) {
661
+ console.error(error);
662
+ return null;
663
+ }
664
+ return response === null || response === void 0 ? void 0 : response.json();
665
+ });
666
+ const resetPassword = (password, confirmPassword) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
667
+ const formData = new FormData();
668
+ formData.append('password', password);
669
+ formData.append('confirm-password', confirmPassword);
670
+ return fetchSSOV2Api(SSO_V2_PATHS.RESET_PASSWORD, {
671
+ method: 'POST',
672
+ body: formData,
673
+ });
674
+ });
675
+ // "email":"kenny_test2201_11@mailinator.com"
676
+ // "phone_number":"906911910"
677
+ const checkUserExist = ({ email, phone, // no +
678
+ }) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
679
+ // "provider": "email",
680
+ // "is_pass": true,
681
+ // "is_status": "Active"
682
+ const formData = new FormData();
683
+ if (email) {
684
+ formData.append('email', email);
685
+ }
686
+ else {
687
+ formData.append('phone_number', phone);
688
+ }
689
+ return fetchSSOV2Api(SSO_V2_PATHS.CHECK_USER_EXIST, {
690
+ method: 'POST',
691
+ body: formData,
692
+ });
693
+ });
694
+ // "name": "Huy Tran 888",
695
+ // "birthday": "1989-04-26",
696
+ // "email":"kenny_test2201_02@mailinator.com", // optional chỉ require khi source là care | ecom
697
+ // "password": "Kenny2103",
698
+ // "confirm_password":"Kenny2103",
699
+ // "phone_number":"906911912", // require khi user register bằng email hoặc social
700
+ // "area_code":"+84", // require khi có phone number
701
+ // "gender": 1,
702
+ // "validate": false, // true validate sau khi validate xong truyền false để update
703
+ // "source": "care" | "ecom" // default sẽ ko require email. nếu source là care sẽ require email. ==> support cho business care
704
+ const updateUserInfo = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
705
+ const formData = new FormData();
706
+ Object.keys(data).forEach((key) => {
707
+ if (typeof data[key] !== 'undefined' && data[key] !== null) {
708
+ formData.append(key, data[key]);
709
+ }
710
+ });
711
+ return fetchSSOV2Api(SSO_V2_PATHS.UPDATE_USER_INFO, {
712
+ method: 'POST',
713
+ body: formData,
714
+ });
715
+ });
716
+ const GoogleAuthClientId = constantsIsProduction.isProduction
717
+ ? '289442006438-040a42cbidr6v5d178f3iqi9q95821r3.apps.googleusercontent.com'
718
+ : '289442006438-cihobuq1h3r4426pur7u0e43fqdnep59.apps.googleusercontent.com';
719
+ const FacebookAppId = '2759888574045636';
720
+ const getUserInfo = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
721
+ return fetchSSOApi('user/profile', {
722
+ method: 'POST',
723
+ });
724
+ });
725
+ const handleAuthSuccess = (res) => {
726
+ (res === null || res === void 0 ? void 0 : res.token) &&
727
+ miscCookieHelper.setCookie(BEARER_TOKEN_COOKIE, res.token, {
728
+ domain: window.location.hostname === 'localhost'
729
+ ? 'localhost'
730
+ : `.${constantsDomainLocales.domainLocales[process.env.UNIFY_LOCALE || 'vi-VN']}`,
731
+ expires: new Date(res.expire_in * 1000).toUTCString(),
732
+ });
733
+ (res === null || res === void 0 ? void 0 : res.refresh_token) &&
734
+ miscCookieHelper.setCookie(index$4.BEARER_REFRESH_TOKEN_COOKIE, res.refresh_token, {
735
+ domain: window.location.hostname === 'localhost'
736
+ ? 'localhost'
737
+ : `.${constantsDomainLocales.domainLocales[process.env.UNIFY_LOCALE || 'vi-VN']}`,
738
+ });
739
+ };
740
+
741
+ const loginByEmailPassword = (email, password) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
742
+ const formData = new FormData();
743
+ formData.append('email', email);
744
+ formData.append('password', password);
745
+ return fetchSSOV2Api(SSO_V2_PATHS.EMAIL.LOGIN_BY_PASSWORD, {
746
+ method: 'POST',
747
+ body: formData,
748
+ headers: {
749
+ Authorization: `Basic aGhnOjEyMzQ1Njc4OUBAIyQhQCQjJSRe`,
750
+ },
751
+ });
752
+ });
753
+ const registerBySendEmailOTP = (email) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
754
+ const formData = new FormData();
755
+ formData.append('email', email);
756
+ formData.append('website_id', websiteId);
757
+ return fetchSSOV2Api(SSO_V2_PATHS.EMAIL.REGISTER_BY_SEND_OTP, {
758
+ method: 'POST',
759
+ body: formData,
760
+ });
761
+ });
762
+ const resendEmailOTP = (email) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
763
+ const formData = new FormData();
764
+ formData.append('email', email);
765
+ return fetchSSOV2Api(SSO_V2_PATHS.EMAIL.SEND_OTP, {
766
+ method: 'POST',
767
+ body: formData,
768
+ });
769
+ });
770
+ const verifyByEmailOTP = (email, otpCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
771
+ const formData = new FormData();
772
+ formData.append('email', email);
773
+ formData.append('code', otpCode);
774
+ return fetchSSOV2Api(SSO_V2_PATHS.EMAIL.VERIFY_BY_OTP, {
775
+ method: 'POST',
776
+ body: formData,
777
+ });
778
+ });
779
+
780
+ const SSOEmailScreen = ({ hidden, }) => {
781
+ const [errMsg, setErrMsg] = React__default["default"].useState('');
782
+ const { addStep, goNext } = useSSOSteps();
783
+ return (React__default["default"].createElement("form", { style: {
784
+ display: hidden ? 'none' : 'block',
785
+ }, onSubmit: (e) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
786
+ var _a, _b, _c, _d;
787
+ e.preventDefault();
788
+ const email = e.currentTarget.email.value;
789
+ const existRes = yield checkUserExist({ email });
790
+ if ((existRes === null || existRes === void 0 ? void 0 : existRes._status) === 1) {
791
+ if ((_a = existRes._data) === null || _a === void 0 ? void 0 : _a.is_pass) {
792
+ // go to password screen
793
+ addStep({
794
+ type: SSOStepTypeType.PASSWORD,
795
+ config: {
796
+ email,
797
+ },
798
+ });
799
+ goNext();
800
+ }
801
+ else {
802
+ let res;
803
+ if (!((_b = existRes._data) === null || _b === void 0 ? void 0 : _b.provider)) {
804
+ res = yield registerBySendEmailOTP(email);
805
+ }
806
+ else {
807
+ res = yield resendEmailOTP(email);
808
+ }
809
+ if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
810
+ setErrMsg(((_c = res._messages) === null || _c === void 0 ? void 0 : _c[0]) || 'API error');
811
+ return;
812
+ }
813
+ // go to register screen
814
+ addStep({
815
+ type: SSOStepTypeType.OTP,
816
+ config: {
817
+ email,
818
+ otpType: 'email',
819
+ afterAction: 'setup',
820
+ },
821
+ });
822
+ goNext();
823
+ }
824
+ }
825
+ else {
826
+ setErrMsg(((_d = existRes._messages) === null || _d === void 0 ? void 0 : _d[0]) || 'api error');
827
+ }
828
+ }) },
829
+ React__default["default"].createElement(core.Stack, { spacing: 8 },
830
+ React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, "Continue with email"),
831
+ React__default["default"].createElement(index$2.Text, { size: "p4" }, "S\u1EED d\u1EE5ng email c\u1EE7a b\u1EA1n \u0111\u1EC3 ti\u1EBFp t\u1EE5c \u0111\u0103ng nh\u1EADp ho\u1EB7c \u0111\u0103ng k\u00FD")),
832
+ React__default["default"].createElement(index$3.Input, { name: "email", placeholder: "Email c\u1EE7a b\u1EA1n", error: errMsg || undefined, type: "email", required: true, mt: 24 }),
833
+ React__default["default"].createElement(index$1.Button, { type: "submit", size: "lg", variant: "primary", fullWidth: true, mt: 16 }, "Verify Your Email")));
834
+ };
835
+
836
+ const splitPhone = (phone) => {
837
+ var _a, _b;
838
+ if (!phone)
839
+ return { areaCode: undefined, phoneNumber: undefined };
840
+ let areaCode = '';
841
+ let phoneNumber = phone;
842
+ if (phone.startsWith('+')) {
843
+ areaCode =
844
+ ((_a = phone.match(new RegExp(`^\\+(${allAvailableAreaCodes
845
+ .map((c) => c.replace('+', ''))
846
+ .join('|')})`))) === null || _a === void 0 ? void 0 : _a[0]) || '';
847
+ phoneNumber = phone.slice(areaCode.length);
848
+ }
849
+ else {
850
+ areaCode =
851
+ ((_b = phone.match(new RegExp(`^(${allAvailableAreaCodes
852
+ .map((c) => c.replace('+', ''))
853
+ .join('|')})`))) === null || _b === void 0 ? void 0 : _b[0]) || '';
854
+ phoneNumber = phone.slice(areaCode.length);
855
+ if (areaCode) {
856
+ areaCode = `+${areaCode}`;
857
+ }
858
+ }
859
+ return { areaCode, phoneNumber };
860
+ };
861
+
862
+ // "phone_number":"906911910",
863
+ // "password":"Kenny2103!"
864
+ const loginByPhonePassword = (phone, password) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
865
+ const formData = new FormData();
866
+ let { phoneNumber } = splitPhone(phone);
867
+ phoneNumber = phoneNumber.startsWith('0')
868
+ ? phoneNumber.substring(1)
869
+ : phoneNumber;
870
+ formData.append('phone_number', phoneNumber);
871
+ formData.append('password', password);
872
+ return fetchSSOV2Api(SSO_V2_PATHS.PHONE.LOGIN_BY_PASSWORD, {
873
+ method: 'POST',
874
+ body: formData,
875
+ headers: {
876
+ Authorization: 'Basic aGhnOjEyMzQ1Njc4OUBAIyQhQCQjJSRe',
877
+ },
878
+ }, true);
879
+ });
880
+ // "phone_number": "906911910",
881
+ // "area_code":"+84",
882
+ const registerBySendPhoneOTP = (phone, areaCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
883
+ const formData = new FormData();
884
+ formData.append('phone_number', phone);
885
+ formData.append('area_code', areaCode);
886
+ formData.append('website_id', websiteId);
887
+ return fetchSSOV2Api(SSO_V2_PATHS.PHONE.REGISTER_BY_SEND_OTP, {
888
+ method: 'POST',
889
+ body: formData,
890
+ });
891
+ });
892
+ // "phone_number": "906911910",
893
+ // "area_code":"+84",
894
+ const resendPhoneOTP = (phone, areaCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
895
+ const formData = new FormData();
896
+ formData.append('phone_number', phone);
897
+ formData.append('area_code', areaCode);
898
+ return fetchSSOV2Api(SSO_V2_PATHS.PHONE.SEND_OTP, {
899
+ method: 'POST',
900
+ body: formData,
901
+ });
902
+ });
903
+ // "otp_code":"212616",
904
+ // "phone_number": "906911910",
905
+ // "area_code":"+84"
906
+ const verifyByPhoneOTP = (phone, areaCode, otpCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
907
+ const formData = new FormData();
908
+ formData.append('phone_number', phone);
909
+ formData.append('area_code', areaCode);
910
+ formData.append('otp_code', otpCode);
911
+ return fetchSSOV2Api(SSO_V2_PATHS.PHONE.VERIFY_BY_OTP, {
912
+ method: 'POST',
913
+ body: formData,
914
+ });
915
+ });
916
+ const resendUpdatePhoneOTP = (phone, areaCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
917
+ const formData = new FormData();
918
+ formData.append('phone_number', phone);
919
+ formData.append('area_code', areaCode);
920
+ return fetchSSOV2Api(SSO_V2_PATHS.PHONE.UPDATE_PHONE_SEND_OTP, {
921
+ method: 'POST',
922
+ body: formData,
923
+ });
924
+ });
925
+ const verifyUpdatePhoneOTP = (areaCode, otpCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
926
+ const formData = new FormData();
927
+ formData.append('otp_code', otpCode);
928
+ formData.append('area_code', areaCode);
929
+ return fetchSSOV2Api(SSO_V2_PATHS.PHONE.UPDATE_PHONE_VERIFY_OTP, {
930
+ method: 'POST',
931
+ body: formData,
932
+ });
933
+ });
934
+
935
+ const loginBySocial = (token, social) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
936
+ const formData = new FormData();
937
+ formData.append('token', token);
938
+ formData.append('social', social);
939
+ formData.append('website_id', websiteId);
940
+ return fetchSSOV2Api(SSO_V2_PATHS.LOGIN_BY_SOCIAL, {
941
+ method: 'POST',
942
+ body: formData,
943
+ headers: {
944
+ Authorization: `Basic aGhnOjEyMzQ1Njc4OUBAIyQhQCQjJSRe`,
945
+ },
946
+ });
947
+ });
948
+
949
+ // "phone_number": "906911910",
950
+ // "area_code":"+84",
951
+ const registerBySendZaloOTP = (phone, areaCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
952
+ const formData = new FormData();
953
+ formData.append('phone_number', phone);
954
+ formData.append('area_code', areaCode);
955
+ formData.append('website_id', websiteId);
956
+ return fetchSSOV2Api(SSO_V2_PATHS.ZALO.REGISTER_BY_SEND_OTP, {
957
+ method: 'POST',
958
+ body: formData,
959
+ });
960
+ });
961
+ // "phone_number": "906911910",
962
+ // "area_code":"+84",
963
+ const resendZaloOTP = (phone, areaCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
964
+ const formData = new FormData();
965
+ formData.append('phone_number', phone);
966
+ formData.append('area_code', areaCode);
967
+ return fetchSSOV2Api(SSO_V2_PATHS.ZALO.SEND_OTP, {
968
+ method: 'POST',
969
+ body: formData,
970
+ });
971
+ });
972
+ // "otp_code":"212616",
973
+ // "phone_number": "906911910",
974
+ // "area_code":"+84"
975
+ const verifyByZaloOTP = (phone, areaCode, otpCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
976
+ const formData = new FormData();
977
+ formData.append('otp_code', otpCode);
978
+ formData.append('phone_number', phone);
979
+ formData.append('area_code', areaCode);
980
+ return fetchSSOV2Api(SSO_V2_PATHS.ZALO.VERIFY_BY_OTP, {
981
+ method: 'POST',
982
+ body: formData,
983
+ });
984
+ });
985
+ const resendUpdatePhoneZaloOTP = (phone, areaCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
986
+ const formData = new FormData();
987
+ formData.append('phone_number', phone);
988
+ formData.append('area_code', areaCode);
989
+ return fetchSSOV2Api(SSO_V2_PATHS.ZALO.UPDATE_PHONE_SEND_OTP, {
990
+ method: 'POST',
991
+ body: formData,
992
+ });
993
+ });
994
+ const verifyUpdatePhoneZaloOTP = (phone, areaCode, otpCode) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
995
+ const formData = new FormData();
996
+ formData.append('phone_number', phone);
997
+ formData.append('otp_code', otpCode);
998
+ formData.append('area_code', areaCode);
999
+ return fetchSSOV2Api(SSO_V2_PATHS.ZALO.UPDATE_PHONE_VERIFY_OTP, {
1000
+ method: 'POST',
1001
+ body: formData,
1002
+ });
1003
+ });
1004
+
1005
+ const CollectInfoText = () => {
1006
+ const { setOpenCollectInfoPopup } = useSSOState();
1007
+ return (React__default["default"].createElement(index$2.Text, { size: "p4", onClick: () => {
1008
+ setOpenCollectInfoPopup(true);
1009
+ }, color: "blue.6", style: {
1010
+ cursor: 'pointer',
1011
+ } },
1012
+ React__default["default"].createElement(other.Info, { size: 16, color: '#2D87F3', style: {
1013
+ verticalAlign: 'sub',
1014
+ } }),
1015
+ ' ',
1016
+ "Why We Need Your Information?"));
1017
+ };
1018
+
1019
+ const MailIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
1020
+ React__default["default"].createElement("g", { clipPath: "url(#clip0_869_25628)" },
1021
+ React__default["default"].createElement("rect", { width: "24", height: "24", rx: "12", fill: "#00B16A" }),
1022
+ React__default["default"].createElement("path", { d: "M15.75 5.625h-7.5C6 5.625 4.5 6.75 4.5 9.375v5.25c0 2.625 1.5 3.75 3.75 3.75h7.5c2.25 0 3.75-1.125 3.75-3.75v-5.25c0-2.625-1.5-3.75-3.75-3.75m.352 4.568-2.347 1.875c-.495.397-1.125.592-1.755.592s-1.267-.195-1.755-.592l-2.347-1.875a.577.577 0 0 1-.09-.795.56.56 0 0 1 .787-.09l2.348 1.874c.57.458 1.537.458 2.107 0l2.348-1.875c.24-.194.6-.157.787.09a.57.57 0 0 1-.082.796", fill: "#fff" })),
1023
+ React__default["default"].createElement("defs", null,
1024
+ React__default["default"].createElement("clipPath", { id: "clip0_869_25628" },
1025
+ React__default["default"].createElement("path", { fill: "#fff", d: "M0 0h24v24H0z" })))));
1026
+
1027
+ const StyledPhone = styled__default["default"](index$3.Phone) `
1028
+ position: relative;
1029
+ .PhoneInputCountry {
1030
+ background: unset;
1031
+ border: none;
1032
+ position: absolute;
1033
+ left: 0;
1034
+ top: 0;
1035
+ height: 100%;
1036
+ padding-right: 0;
1037
+ min-width: 100px;
1038
+ .PhoneInputCountryIcon {
1039
+ min-width: 70px;
1040
+ .PhoneInputCountryIconImg {
1041
+ margin: auto;
1042
+ }
1043
+ }
1044
+ }
1045
+ .PhoneInputInput {
1046
+ border-radius: 8px;
1047
+ border-left-width: 1px;
1048
+ line-height: 46px;
1049
+ padding-left: 105px;
1050
+ }
1051
+ `;
1052
+
1053
+ const SSOFirstScreen = ({ hidden }) => {
1054
+ const [phone, setPhone] = React__default["default"].useState('');
1055
+ const [errMsg, setErrMsg] = React__default["default"].useState('');
1056
+ const { locale, onClose } = useSSOState();
1057
+ const { addStep, goNext, setShareData } = useSSOSteps();
1058
+ const handleLoginBySocial = (credential, provider) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1059
+ var _a, _b, _c, _d;
1060
+ const res = yield loginBySocial(credential, provider);
1061
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
1062
+ handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
1063
+ const userInfo = yield getUserInfo();
1064
+ if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo._status) === 1) {
1065
+ setShareData({
1066
+ authMethod: provider,
1067
+ });
1068
+ if ((_a = userInfo._data) === null || _a === void 0 ? void 0 : _a.is_new) {
1069
+ setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'register' })));
1070
+ addStep({
1071
+ type: SSOStepTypeType.SETUP_FULL,
1072
+ config: {
1073
+ userInfo: userInfo._data,
1074
+ disabledEmail: true,
1075
+ },
1076
+ });
1077
+ goNext();
1078
+ }
1079
+ else if (!((_b = userInfo._data) === null || _b === void 0 ? void 0 : _b.phone_verified)) {
1080
+ setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'verify-phone' })));
1081
+ addStep({
1082
+ type: SSOStepTypeType.VERIFY_PHONE,
1083
+ });
1084
+ goNext();
1085
+ }
1086
+ else {
1087
+ onClose();
1088
+ }
1089
+ }
1090
+ else {
1091
+ setErrMsg(((_c = userInfo === null || userInfo === void 0 ? void 0 : userInfo._messages) === null || _c === void 0 ? void 0 : _c[0]) || 'API error');
1092
+ }
1093
+ }
1094
+ else {
1095
+ setErrMsg(((_d = res === null || res === void 0 ? void 0 : res._messages) === null || _d === void 0 ? void 0 : _d[0]) || 'API error');
1096
+ }
1097
+ });
1098
+ React.useEffect(() => {
1099
+ const script = document.createElement('script');
1100
+ script.src = 'https://accounts.google.com/gsi/client';
1101
+ script.async = true;
1102
+ document.body.appendChild(script);
1103
+ window.googleAuthCallback = (authData) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1104
+ if (authData === null || authData === void 0 ? void 0 : authData.credential) {
1105
+ handleLoginBySocial(authData.credential, 'google');
1106
+ }
1107
+ else {
1108
+ setErrMsg('Google login failed');
1109
+ }
1110
+ });
1111
+ const fbScript = document.createElement('script');
1112
+ fbScript.src = 'https://connect.facebook.net/en_US/sdk.js';
1113
+ fbScript.async = true;
1114
+ document.body.appendChild(fbScript);
1115
+ window.fbAsyncInit = function () {
1116
+ window.FB.init({
1117
+ appId: FacebookAppId,
1118
+ cookie: true,
1119
+ xfbml: true,
1120
+ version: 'v20.0', // Use this Graph API version for this call.
1121
+ });
1122
+ };
1123
+ return () => {
1124
+ document.body.removeChild(script);
1125
+ document.body.removeChild(fbScript);
1126
+ };
1127
+ }, []);
1128
+ const onClickContinueZalo = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1129
+ var _e, _f, _g, _h;
1130
+ const { areaCode, phoneNumber } = splitPhone(phone);
1131
+ const userExist = yield checkUserExist({ phone: phoneNumber });
1132
+ if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
1133
+ setShareData({
1134
+ authMethod: 'phone',
1135
+ });
1136
+ if ((_e = userExist._data) === null || _e === void 0 ? void 0 : _e.is_pass) {
1137
+ setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'login' })));
1138
+ addStep({
1139
+ type: SSOStepTypeType.PASSWORD,
1140
+ config: {
1141
+ phone,
1142
+ },
1143
+ });
1144
+ goNext();
1145
+ }
1146
+ else {
1147
+ let res;
1148
+ if (!((_f = userExist._data) === null || _f === void 0 ? void 0 : _f.provider)) {
1149
+ res = yield registerBySendZaloOTP(phoneNumber, areaCode);
1150
+ }
1151
+ else {
1152
+ res = yield resendZaloOTP(phoneNumber, areaCode);
1153
+ }
1154
+ if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
1155
+ setErrMsg(((_g = res._messages) === null || _g === void 0 ? void 0 : _g[0]) || 'API error');
1156
+ return;
1157
+ }
1158
+ setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'register' })));
1159
+ addStep({
1160
+ type: SSOStepTypeType.OTP,
1161
+ config: {
1162
+ phone,
1163
+ otpType: 'phone-zalo',
1164
+ afterAction: 'setup',
1165
+ },
1166
+ });
1167
+ goNext();
1168
+ }
1169
+ }
1170
+ else {
1171
+ setErrMsg(((_h = userExist === null || userExist === void 0 ? void 0 : userExist._messages) === null || _h === void 0 ? void 0 : _h[0]) || 'API error');
1172
+ }
1173
+ });
1174
+ const onClickContinuePhone = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1175
+ var _j, _k, _l, _m;
1176
+ const { areaCode, phoneNumber } = splitPhone(phone);
1177
+ const userExist = yield checkUserExist({ phone: phoneNumber });
1178
+ if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
1179
+ setShareData({
1180
+ authMethod: 'phone',
1181
+ });
1182
+ if ((_j = userExist._data) === null || _j === void 0 ? void 0 : _j.is_pass) {
1183
+ setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'login' })));
1184
+ addStep({
1185
+ type: SSOStepTypeType.PASSWORD,
1186
+ config: {
1187
+ phone,
1188
+ },
1189
+ });
1190
+ goNext();
1191
+ }
1192
+ else {
1193
+ let res;
1194
+ if (!((_k = userExist._data) === null || _k === void 0 ? void 0 : _k.provider)) {
1195
+ res = yield registerBySendPhoneOTP(phoneNumber, areaCode);
1196
+ }
1197
+ else {
1198
+ res = yield resendPhoneOTP(phoneNumber, areaCode);
1199
+ }
1200
+ if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
1201
+ setErrMsg(((_l = res._messages) === null || _l === void 0 ? void 0 : _l[0]) || 'API error');
1202
+ return;
1203
+ }
1204
+ setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'register' })));
1205
+ addStep({
1206
+ type: SSOStepTypeType.OTP,
1207
+ config: {
1208
+ phone,
1209
+ otpType: 'phone-sms',
1210
+ afterAction: 'setup',
1211
+ },
1212
+ });
1213
+ goNext();
1214
+ }
1215
+ }
1216
+ else {
1217
+ setErrMsg(((_m = userExist === null || userExist === void 0 ? void 0 : userExist._messages) === null || _m === void 0 ? void 0 : _m[0]) || 'API error');
1218
+ }
1219
+ });
1220
+ const onClickEmail = () => {
1221
+ setShareData({
1222
+ authMethod: 'mail',
1223
+ });
1224
+ addStep({
1225
+ type: SSOStepTypeType.EMAIL,
1226
+ });
1227
+ goNext();
1228
+ };
1229
+ return (React__default["default"].createElement("div", { style: {
1230
+ display: hidden ? 'none' : 'flex',
1231
+ flexDirection: 'column',
1232
+ height: '100%',
1233
+ } },
1234
+ React__default["default"].createElement(core.Stack, { spacing: 8 },
1235
+ React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, "Sign in or Sign up"),
1236
+ React__default["default"].createElement(index$2.Text, { size: "p4" }, "Continue with your phone number, email or your socials to log in or sign up.")),
1237
+ React__default["default"].createElement(core.Stack, { mt: 24, spacing: 24 },
1238
+ React__default["default"].createElement(core.Stack, { spacing: 16 },
1239
+ React__default["default"].createElement(index$3.Input.Wrapper, { error: errMsg },
1240
+ React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => setPhone(value), isError: !!errMsg, required: true, name: "phone" })),
1241
+ React__default["default"].createElement(index$1.Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo }, "Continue with Zalo"),
1242
+ React__default["default"].createElement(index$1.Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone }, "Continue with SMS")),
1243
+ React__default["default"].createElement(core.Stack, { spacing: 16, align: "center" },
1244
+ React__default["default"].createElement(index$2.Text, { size: "p4" }, "Or continue with"),
1245
+ React__default["default"].createElement(core.Group, { spacing: 24 },
1246
+ React__default["default"].createElement("div", { style: {
1247
+ position: 'relative',
1248
+ width: 48,
1249
+ height: 48,
1250
+ } },
1251
+ React__default["default"].createElement("div", { id: "g_id_onload", "data-client_id": GoogleAuthClientId, "data-context": "signin", "data-ux_mode": "popup", "data-callback": "googleAuthCallback", "data-auto_prompt": "false" }),
1252
+ React__default["default"].createElement("div", { className: "g_id_signin", "data-type": "icon", "data-shape": "circle", "data-theme": "outline", "data-text": "signin_with", "data-size": "large", style: {
1253
+ transform: 'translate(4px,4px) scale(1.1)',
1254
+ } }),
1255
+ React__default["default"].createElement(index$1.Button, { variant: "white", style: {
1256
+ width: 48,
1257
+ height: 48,
1258
+ padding: 12,
1259
+ background: '#F7F9FC',
1260
+ borderRadius: '100%',
1261
+ position: 'absolute',
1262
+ pointerEvents: 'none',
1263
+ top: 0,
1264
+ left: 0,
1265
+ }, onClick: () => {
1266
+ const googleButton = document.querySelector('.g_id_signin');
1267
+ googleButton === null || googleButton === void 0 ? void 0 : googleButton.dispatchEvent(new Event('click'));
1268
+ } },
1269
+ React__default["default"].createElement(Google.Google, { style: { width: 24, height: 24 } }))),
1270
+ React__default["default"].createElement(index$1.Button, { variant: "white", style: {
1271
+ width: 48,
1272
+ height: 48,
1273
+ padding: 12,
1274
+ background: '#F7F9FC',
1275
+ borderRadius: '100%',
1276
+ }, onClick: () => {
1277
+ window.FB.login(function (response) {
1278
+ var _a;
1279
+ return tslib_es6.__awaiter(this, void 0, void 0, function* () {
1280
+ if ((_a = response === null || response === void 0 ? void 0 : response.authResponse) === null || _a === void 0 ? void 0 : _a.accessToken) {
1281
+ handleLoginBySocial(response.authResponse.accessToken, 'facebook');
1282
+ }
1283
+ else {
1284
+ setErrMsg('Facebook login failed');
1285
+ }
1286
+ });
1287
+ }, { scope: 'public_profile,email' });
1288
+ } },
1289
+ React__default["default"].createElement(Google.Facebook, { style: { width: 24, height: 24 } })),
1290
+ React__default["default"].createElement(index$1.Button, { variant: "white", style: {
1291
+ width: 48,
1292
+ height: 48,
1293
+ padding: 12,
1294
+ background: '#F7F9FC',
1295
+ borderRadius: '100%',
1296
+ }, onClick: onClickEmail },
1297
+ React__default["default"].createElement(MailIcon, null))))),
1298
+ React__default["default"].createElement(core.Stack, { spacing: 24, sx: (theme) => ({
1299
+ marginTop: 56,
1300
+ [theme.fn.smallerThan('sm')]: {
1301
+ marginTop: 'auto',
1302
+ },
1303
+ }) },
1304
+ React__default["default"].createElement(CollectInfoText, null),
1305
+ React__default["default"].createElement(index$2.Text, { size: "p5", color: "gray.6" },
1306
+ "By tapping continue, I confirm that I have read, understand and agree to the",
1307
+ ' ',
1308
+ React__default["default"].createElement("a", { href: "#privacy", target: "_blank", style: {
1309
+ color: '#262626',
1310
+ textDecoration: 'underline',
1311
+ } }, "Privacy Policy"),
1312
+ ' ',
1313
+ "and the",
1314
+ ' ',
1315
+ React__default["default"].createElement("a", { href: "#tos", target: "_blank", style: {
1316
+ color: '#262626',
1317
+ textDecoration: 'underline',
1318
+ } }, "Terms of Service"),
1319
+ ' ',
1320
+ "of Hello Health Group."))));
1321
+ };
1322
+
1323
+ const SSOOTPScreen = ({ hidden, index, }) => {
1324
+ const { onClose } = useSSOState();
1325
+ const { steps, setSteps, addStep, goNext } = useSSOSteps();
1326
+ const [otp, setOtp] = React__default["default"].useState('');
1327
+ const [error, setError] = React__default["default"].useState('');
1328
+ const currentStepIndex = index;
1329
+ const currentStep = steps[currentStepIndex];
1330
+ const { phone, email, otpType, isUpdatePhone, afterAction, setupData } = currentStep.config;
1331
+ const isEmail = otpType === 'email';
1332
+ const sendOTPCode = (checkResend) => {
1333
+ if (checkResend && resendTime > 0)
1334
+ return;
1335
+ // send otp code logic here
1336
+ const { areaCode, phoneNumber } = splitPhone(phone);
1337
+ if (isUpdatePhone) {
1338
+ if (otpType === 'phone-sms') {
1339
+ resendUpdatePhoneOTP(phoneNumber, areaCode);
1340
+ }
1341
+ else if (otpType === 'phone-zalo') {
1342
+ resendUpdatePhoneZaloOTP(phoneNumber, areaCode);
1343
+ }
1344
+ }
1345
+ else {
1346
+ if (otpType === 'phone-sms') {
1347
+ resendPhoneOTP(phoneNumber, areaCode);
1348
+ }
1349
+ else if (otpType === 'phone-zalo') {
1350
+ resendZaloOTP(phoneNumber, areaCode);
1351
+ }
1352
+ else if (otpType === 'email') {
1353
+ resendEmailOTP(email);
1354
+ }
1355
+ }
1356
+ setupResendTimer();
1357
+ };
1358
+ const submitOtp = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1359
+ var _a, _b, _c, _d, _e;
1360
+ const { areaCode, phoneNumber } = splitPhone(phone);
1361
+ // submit otp code logic here
1362
+ if (isUpdatePhone) {
1363
+ let res;
1364
+ if (otpType === 'phone-sms') {
1365
+ res = yield verifyUpdatePhoneOTP(areaCode, otp);
1366
+ }
1367
+ else if (otpType === 'phone-zalo') {
1368
+ res = yield verifyUpdatePhoneZaloOTP(phoneNumber, areaCode, otp);
1369
+ }
1370
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
1371
+ if (afterAction === 'setup') {
1372
+ const userInfo = yield getUserInfo();
1373
+ if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo._status) !== 1) {
1374
+ // log error
1375
+ setError(((_a = userInfo._messages) === null || _a === void 0 ? void 0 : _a[0]) || 'API error');
1376
+ return;
1377
+ }
1378
+ addStep({
1379
+ type: SSOStepTypeType.SETUP_FULL,
1380
+ config: {
1381
+ phone,
1382
+ userInfo: userInfo === null || userInfo === void 0 ? void 0 : userInfo._data,
1383
+ },
1384
+ });
1385
+ goNext();
1386
+ }
1387
+ else if (afterAction === 'submitSetup') {
1388
+ const res = yield updateUserInfo(Object.assign(Object.assign({}, setupData), { validate: '' }));
1389
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
1390
+ handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
1391
+ onClose === null || onClose === void 0 ? void 0 : onClose();
1392
+ }
1393
+ else {
1394
+ // log error
1395
+ setError(((_b = res._messages) === null || _b === void 0 ? void 0 : _b[0]) || 'API error');
1396
+ }
1397
+ }
1398
+ else {
1399
+ onClose === null || onClose === void 0 ? void 0 : onClose();
1400
+ }
1401
+ }
1402
+ else {
1403
+ // log error
1404
+ setError(((_c = res._messages) === null || _c === void 0 ? void 0 : _c[0]) || 'API error');
1405
+ }
1406
+ return;
1407
+ }
1408
+ let res;
1409
+ if (otpType === 'phone-sms') {
1410
+ res = yield verifyByPhoneOTP(phoneNumber, areaCode, otp);
1411
+ }
1412
+ else if (otpType === 'phone-zalo') {
1413
+ res = yield verifyByZaloOTP(phoneNumber, areaCode, otp);
1414
+ }
1415
+ else if (otpType === 'email') {
1416
+ res = yield verifyByEmailOTP(email, otp);
1417
+ }
1418
+ if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
1419
+ setOtp('');
1420
+ // log error
1421
+ setError(((_d = res._messages) === null || _d === void 0 ? void 0 : _d[0]) || 'API error');
1422
+ return;
1423
+ }
1424
+ handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
1425
+ if (afterAction === 'forgot') {
1426
+ addStep({
1427
+ type: SSOStepTypeType.FORGOT_PASSWORD_SETUP,
1428
+ });
1429
+ goNext();
1430
+ }
1431
+ else if (afterAction === 'setup') {
1432
+ const userInfo = yield getUserInfo();
1433
+ if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo._status) !== 1) {
1434
+ // log error
1435
+ setError(((_e = userInfo._messages) === null || _e === void 0 ? void 0 : _e[0]) || 'API error');
1436
+ return;
1437
+ }
1438
+ addStep({
1439
+ type: SSOStepTypeType.SETUP_FULL,
1440
+ config: {
1441
+ phone,
1442
+ userInfo: userInfo === null || userInfo === void 0 ? void 0 : userInfo._data,
1443
+ disabledEmail: isEmail,
1444
+ },
1445
+ });
1446
+ goNext();
1447
+ }
1448
+ else {
1449
+ onClose === null || onClose === void 0 ? void 0 : onClose();
1450
+ }
1451
+ });
1452
+ const swapZaloSms = () => {
1453
+ if (isEmail)
1454
+ return;
1455
+ const { areaCode, phoneNumber } = splitPhone(phone);
1456
+ const newType = otpType === 'phone-sms' ? 'phone-zalo' : 'phone-sms';
1457
+ if (newType === 'phone-sms') {
1458
+ resendPhoneOTP(phoneNumber, areaCode);
1459
+ }
1460
+ else {
1461
+ resendZaloOTP(phoneNumber, areaCode);
1462
+ }
1463
+ setSteps((s) => s.splice(currentStepIndex, 1, Object.assign(Object.assign({}, currentStep), { config: Object.assign(Object.assign({}, currentStep === null || currentStep === void 0 ? void 0 : currentStep.config), { otpType: newType }) })));
1464
+ };
1465
+ const [resendTime, setResendTime] = React__default["default"].useState(30);
1466
+ const setupResendTimer = () => {
1467
+ setResendTime(30);
1468
+ const countdown = () => {
1469
+ setResendTime((t) => {
1470
+ if (t - 1 > 0) {
1471
+ setTimeout(() => countdown(), 1000);
1472
+ }
1473
+ return t - 1;
1474
+ });
1475
+ };
1476
+ countdown();
1477
+ };
1478
+ React.useEffect(() => {
1479
+ setupResendTimer();
1480
+ }, []);
1481
+ return (React__default["default"].createElement("form", { style: {
1482
+ display: hidden ? 'none' : 'block',
1483
+ }, onSubmit: (e) => {
1484
+ e.preventDefault();
1485
+ submitOtp();
1486
+ } },
1487
+ React__default["default"].createElement(core.Stack, { spacing: 8 },
1488
+ React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, isEmail ? 'Verify Email' : 'Verify Phone Number'),
1489
+ React__default["default"].createElement(index$2.Text, { size: "p4" }, isEmail ? (React__default["default"].createElement(React__default["default"].Fragment, null,
1490
+ "Enter the 6-digit OTP sent to your email ",
1491
+ React__default["default"].createElement("b", null, email),
1492
+ ".")) : (React__default["default"].createElement(React__default["default"].Fragment, null,
1493
+ "Enter the 6-digit OTP sent to the phone number ",
1494
+ React__default["default"].createElement("b", null, phone),
1495
+ " via",
1496
+ ' ',
1497
+ React__default["default"].createElement("b", null, otpType === 'phone-sms' ? 'SMS' : 'Zalo App'),
1498
+ ". OTP code will expire in ",
1499
+ React__default["default"].createElement("b", null, "10 mins"))))),
1500
+ React__default["default"].createElement(core.Stack, { mt: 24, spacing: 8 },
1501
+ React__default["default"].createElement(index$3.Input.Wrapper, { error: error },
1502
+ React__default["default"].createElement(index$3.OTP, { value: otp, onChange: (otp) => setOtp(String(otp)) })),
1503
+ React__default["default"].createElement(core.Group, { spacing: 8, align: "center", style: {
1504
+ height: 40,
1505
+ } },
1506
+ React__default["default"].createElement(index$2.Text, { size: "p4" }, "Didn\u2019t receive the code?"),
1507
+ React__default["default"].createElement(index$2.Text, { style: {
1508
+ pointerEvents: resendTime > 0 ? 'none' : 'auto',
1509
+ cursor: resendTime > 0 ? 'not-allowed' : 'pointer',
1510
+ }, size: "s4", color: "blue.6", onClick: () => sendOTPCode(true) },
1511
+ "Resend (",
1512
+ resendTime,
1513
+ ")"))),
1514
+ React__default["default"].createElement(index$1.Button, { type: "submit", size: "lg", variant: "primary", mt: 12, fullWidth: true }, "Continue"),
1515
+ !isEmail && (React__default["default"].createElement(index$1.Button, { size: "lg", variant: "tertiary", mt: 12, onClick: swapZaloSms, fullWidth: true },
1516
+ "Send OTP Code via ",
1517
+ otpType === 'phone-sms' ? 'Zalo App' : 'SMS'))));
1518
+ };
1519
+
1520
+ const SSOPasswordScreen = ({ hidden, index, }) => {
1521
+ var _a, _b;
1522
+ const { onClose } = useSSOState();
1523
+ const [errMsg, setErrMsg] = React__default["default"].useState('');
1524
+ const { steps, addStep, goNext } = useSSOSteps();
1525
+ const thisStep = steps[index];
1526
+ const phone = (_a = thisStep === null || thisStep === void 0 ? void 0 : thisStep.config) === null || _a === void 0 ? void 0 : _a.phone;
1527
+ const email = (_b = thisStep === null || thisStep === void 0 ? void 0 : thisStep.config) === null || _b === void 0 ? void 0 : _b.email;
1528
+ const resetPassword = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1529
+ var _c, _d;
1530
+ if (phone) {
1531
+ addStep({
1532
+ type: SSOStepTypeType.FORGOT_PASSWORD_PHONE,
1533
+ });
1534
+ }
1535
+ else {
1536
+ const existRes = yield checkUserExist({ email });
1537
+ if ((existRes === null || existRes === void 0 ? void 0 : existRes._status) === 1) {
1538
+ let res;
1539
+ if (!((_c = existRes._data) === null || _c === void 0 ? void 0 : _c.provider)) {
1540
+ res = yield registerBySendEmailOTP(email);
1541
+ }
1542
+ else {
1543
+ res = yield resendEmailOTP(email);
1544
+ }
1545
+ if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
1546
+ setErrMsg(((_d = res._messages) === null || _d === void 0 ? void 0 : _d[0]) || 'API error');
1547
+ return;
1548
+ }
1549
+ addStep({
1550
+ type: SSOStepTypeType.OTP,
1551
+ config: {
1552
+ email,
1553
+ otpType: 'email',
1554
+ afterAction: 'forgot',
1555
+ },
1556
+ });
1557
+ }
1558
+ }
1559
+ goNext();
1560
+ });
1561
+ return (React__default["default"].createElement("form", { style: {
1562
+ display: hidden ? 'none' : 'block',
1563
+ }, onSubmit: (e) => {
1564
+ e.preventDefault();
1565
+ const password = e.currentTarget.password.value;
1566
+ // call api to login with email and password, if fail then show error
1567
+ if (phone) {
1568
+ loginByPhonePassword(phone, password)
1569
+ .then((res) => {
1570
+ var _a;
1571
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
1572
+ handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
1573
+ onClose === null || onClose === void 0 ? void 0 : onClose();
1574
+ }
1575
+ else {
1576
+ setErrMsg(((_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0]) || 'API error');
1577
+ }
1578
+ })
1579
+ .catch(() => {
1580
+ setErrMsg('api error');
1581
+ });
1582
+ }
1583
+ else {
1584
+ loginByEmailPassword(email, password)
1585
+ .then((res) => {
1586
+ var _a;
1587
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
1588
+ handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
1589
+ onClose === null || onClose === void 0 ? void 0 : onClose();
1590
+ }
1591
+ else {
1592
+ setErrMsg(((_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0]) || 'API error');
1593
+ }
1594
+ })
1595
+ .catch(() => {
1596
+ setErrMsg('api error');
1597
+ });
1598
+ }
1599
+ } },
1600
+ React__default["default"].createElement(core.Stack, { spacing: 8 },
1601
+ React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" },
1602
+ "Welcome back!",
1603
+ React__default["default"].createElement("br", null),
1604
+ "Enter your password"),
1605
+ React__default["default"].createElement(index$2.Text, { size: "p4" }, "\u0110\u0103ng nh\u1EADp b\u1EB1ng m\u1EADt kh\u1EA9u c\u1EE7a b\u1EA1n.")),
1606
+ React__default["default"].createElement(core.Stack, { mt: 24, spacing: 8 },
1607
+ React__default["default"].createElement(index$3.PasswordInput, { name: "password", placeholder: "Nh\u1EADp m\u1EADt kh\u1EA9u", error: errMsg || undefined }),
1608
+ React__default["default"].createElement(core.Group, { spacing: 8, align: "center", style: {
1609
+ height: 40,
1610
+ } },
1611
+ React__default["default"].createElement(index$2.Text, { size: "p4" }, "Forgot Password?"),
1612
+ React__default["default"].createElement(index$2.Text, { size: "s4", color: "blue.6", style: {
1613
+ cursor: 'pointer',
1614
+ }, onClick: resetPassword }, "Reset"))),
1615
+ React__default["default"].createElement(index$1.Button, { type: "submit", size: "lg", variant: "primary", mt: 12, fullWidth: true }, "Sign In")));
1616
+ };
1617
+
1618
+ const SSOPasswordForgotPhone = ({ hidden, }) => {
1619
+ const [phone, setPhone] = React__default["default"].useState('');
1620
+ const [errMsg, setErrMsg] = React__default["default"].useState('');
1621
+ const { locale } = useSSOState();
1622
+ const { addStep, goNext, setShareData } = useSSOSteps();
1623
+ const onClickContinueZalo = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1624
+ var _a, _b, _c;
1625
+ const { areaCode, phoneNumber } = splitPhone(phone);
1626
+ const userExist = yield checkUserExist({ phone: phoneNumber });
1627
+ if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
1628
+ setShareData({
1629
+ authMethod: 'phone',
1630
+ });
1631
+ let res;
1632
+ if (!((_a = userExist._data) === null || _a === void 0 ? void 0 : _a.provider)) {
1633
+ res = yield registerBySendZaloOTP(phoneNumber, areaCode);
1634
+ }
1635
+ else {
1636
+ res = yield resendZaloOTP(phoneNumber, areaCode);
1637
+ }
1638
+ if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
1639
+ setErrMsg(((_b = res._messages) === null || _b === void 0 ? void 0 : _b[0]) || 'API error');
1640
+ return;
1641
+ }
1642
+ setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'register' })));
1643
+ addStep({
1644
+ type: SSOStepTypeType.OTP,
1645
+ config: {
1646
+ phone,
1647
+ otpType: 'phone-zalo',
1648
+ afterAction: 'forgot',
1649
+ },
1650
+ });
1651
+ goNext();
1652
+ }
1653
+ else {
1654
+ setErrMsg(((_c = userExist === null || userExist === void 0 ? void 0 : userExist._messages) === null || _c === void 0 ? void 0 : _c[0]) || 'API error');
1655
+ }
1656
+ });
1657
+ const onClickContinuePhone = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1658
+ var _d, _e, _f;
1659
+ const { areaCode, phoneNumber } = splitPhone(phone);
1660
+ const userExist = yield checkUserExist({ phone: phoneNumber });
1661
+ if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
1662
+ setShareData({
1663
+ authMethod: 'phone',
1664
+ });
1665
+ let res;
1666
+ if (!((_d = userExist._data) === null || _d === void 0 ? void 0 : _d.provider)) {
1667
+ res = yield registerBySendPhoneOTP(phoneNumber, areaCode);
1668
+ }
1669
+ else {
1670
+ res = yield resendPhoneOTP(phoneNumber, areaCode);
1671
+ }
1672
+ if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
1673
+ setErrMsg(((_e = res._messages) === null || _e === void 0 ? void 0 : _e[0]) || 'API error');
1674
+ return;
1675
+ }
1676
+ setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'register' })));
1677
+ addStep({
1678
+ type: SSOStepTypeType.OTP,
1679
+ config: {
1680
+ phone,
1681
+ otpType: 'phone-sms',
1682
+ afterAction: 'forgot',
1683
+ },
1684
+ });
1685
+ goNext();
1686
+ }
1687
+ else {
1688
+ setErrMsg(((_f = userExist === null || userExist === void 0 ? void 0 : userExist._messages) === null || _f === void 0 ? void 0 : _f[0]) || 'API error');
1689
+ }
1690
+ });
1691
+ return (React__default["default"].createElement("div", { style: {
1692
+ display: hidden ? 'none' : 'block',
1693
+ } },
1694
+ React__default["default"].createElement(core.Stack, { spacing: 8 },
1695
+ React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, "Reset password"),
1696
+ React__default["default"].createElement(index$2.Text, { size: "p4" }, "Please provide the phone number you used to create your account.")),
1697
+ React__default["default"].createElement(core.Stack, { mt: 24, spacing: 16 },
1698
+ React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => setPhone(value), isError: !!errMsg, required: true }),
1699
+ errMsg && (React__default["default"].createElement(index$2.Text, { size: "label2", color: "red.6", mt: -12 }, errMsg)),
1700
+ React__default["default"].createElement(index$1.Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo }, "Continue with Zalo"),
1701
+ React__default["default"].createElement(index$1.Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone }, "Continue with SMS"))));
1702
+ };
1703
+
1704
+ const CheckGrayIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1705
+ React__default["default"].createElement("path", { d: "M7.053 9.43 5.505 7.883a.48.48 0 0 0-.349-.142.47.47 0 0 0-.354.142.48.48 0 0 0-.145.351q0 .207.145.352l1.83 1.83q.18.18.421.18.24 0 .422-.18l3.709-3.71a.48.48 0 0 0 .142-.348.47.47 0 0 0-.142-.354.48.48 0 0 0-.351-.145.48.48 0 0 0-.352.145zm.948 4.903a6.2 6.2 0 0 1-2.47-.498 6.4 6.4 0 0 1-2.012-1.354 6.4 6.4 0 0 1-1.354-2.01A6.2 6.2 0 0 1 1.666 8q0-1.315.499-2.47a6.4 6.4 0 0 1 1.353-2.01 6.4 6.4 0 0 1 2.01-1.354 6.2 6.2 0 0 1 2.47-.5q1.314 0 2.47.5 1.157.498 2.012 1.353t1.354 2.01q.498 1.156.499 2.47 0 1.314-.499 2.47a6.4 6.4 0 0 1-1.354 2.011 6.4 6.4 0 0 1-2.01 1.355 6.2 6.2 0 0 1-2.47.498m-.002-1q2.234 0 3.784-1.55T13.333 8t-1.55-3.783-3.784-1.55-3.783 1.55T2.666 8t1.55 3.783 3.783 1.55", fill: "#8C8C8C" })));
1706
+ const CheckGreenIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1707
+ React__default["default"].createElement("path", { d: "M7.053 9.43 5.505 7.883a.48.48 0 0 0-.349-.142.47.47 0 0 0-.354.142.48.48 0 0 0-.145.351q0 .207.145.352l1.83 1.83q.18.18.421.18.24 0 .422-.18l3.709-3.71a.48.48 0 0 0 .142-.348.47.47 0 0 0-.142-.354.48.48 0 0 0-.351-.145.48.48 0 0 0-.352.145zm.948 4.903a6.2 6.2 0 0 1-2.47-.498 6.4 6.4 0 0 1-2.012-1.354 6.4 6.4 0 0 1-1.354-2.01A6.2 6.2 0 0 1 1.666 8q0-1.315.499-2.47a6.4 6.4 0 0 1 1.353-2.01 6.4 6.4 0 0 1 2.01-1.354 6.2 6.2 0 0 1 2.47-.5q1.314 0 2.47.5 1.157.498 2.012 1.353t1.354 2.01q.498 1.156.499 2.47 0 1.314-.499 2.47a6.4 6.4 0 0 1-1.354 2.011 6.4 6.4 0 0 1-2.01 1.355 6.2 6.2 0 0 1-2.47.498", fill: "#00B16A" })));
1708
+ const CheckRedIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1709
+ React__default["default"].createElement("path", { d: "m8.001 8.703 2.049 2.048q.138.14.348.142a.47.47 0 0 0 .355-.142.48.48 0 0 0 .145-.35.48.48 0 0 0-.145-.352L8.703 8l2.05-2.049a.48.48 0 0 0 .141-.348.47.47 0 0 0-.141-.354.48.48 0 0 0-.352-.145.48.48 0 0 0-.351.145L8.001 7.298l-2.048-2.05a.48.48 0 0 0-.349-.14.47.47 0 0 0-.354.14.48.48 0 0 0-.145.352q0 .207.145.351l2.049 2.05-2.049 2.048a.48.48 0 0 0-.142.348.47.47 0 0 0 .142.354.48.48 0 0 0 .351.145.48.48 0 0 0 .352-.145zm.001 5.63a6.2 6.2 0 0 1-2.47-.498 6.4 6.4 0 0 1-2.011-1.354 6.4 6.4 0 0 1-1.354-2.01A6.2 6.2 0 0 1 1.668 8q0-1.315.499-2.47A6.4 6.4 0 0 1 3.52 3.52a6.4 6.4 0 0 1 2.01-1.354 6.2 6.2 0 0 1 2.47-.5q1.314 0 2.47.5 1.156.498 2.012 1.353.855.855 1.354 2.01.499 1.156.499 2.47t-.499 2.47a6.4 6.4 0 0 1-1.354 2.011 6.4 6.4 0 0 1-2.01 1.355 6.2 6.2 0 0 1-2.47.498", fill: "#F44D2C" })));
1710
+
1711
+ const SSOPasswordWithConfirm = (_a) => {
1712
+ var { form } = _a, props = tslib_es6.__rest(_a, ["form"]);
1713
+ const [atLeast8Chars, setAtLeast8Chars] = React__default["default"].useState(undefined);
1714
+ const [atLeastOneUpper, setAtLeastOneUpper] = React__default["default"].useState(undefined);
1715
+ const password = form.values.password;
1716
+ React.useEffect(() => {
1717
+ if (typeof password === 'undefined')
1718
+ return;
1719
+ setAtLeast8Chars(password.length >= 8);
1720
+ setAtLeastOneUpper(!!password.match(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/));
1721
+ }, [password]);
1722
+ return (React__default["default"].createElement(core.Stack, Object.assign({ spacing: 12 }, props),
1723
+ React__default["default"].createElement(index$3.PasswordInput, Object.assign({ name: "password", placeholder: "Nh\u1EADp m\u1EADt kh\u1EA9u", label: "Password", required: true, withAsterisk: true }, form.getInputProps('password'))),
1724
+ React__default["default"].createElement(core.Stack, { spacing: 8 },
1725
+ React__default["default"].createElement(index$2.Text, { size: "n1" },
1726
+ atLeast8Chars ? (React__default["default"].createElement(CheckGreenIcon, null)) : typeof atLeast8Chars === 'undefined' ? (React__default["default"].createElement(CheckGrayIcon, null)) : (React__default["default"].createElement(CheckRedIcon, null)),
1727
+ ' ',
1728
+ "At least 8 characters."),
1729
+ React__default["default"].createElement(index$2.Text, { size: "n1" },
1730
+ atLeastOneUpper ? (React__default["default"].createElement(CheckGreenIcon, null)) : typeof atLeastOneUpper === 'undefined' ? (React__default["default"].createElement(CheckGrayIcon, null)) : (React__default["default"].createElement(CheckRedIcon, null)),
1731
+ ' ',
1732
+ "At least one uppercase letter, one lowercase letter, and one number.")),
1733
+ React__default["default"].createElement(index$3.PasswordInput, Object.assign({ name: "confirm-password", placeholder: "X\u00E1c nh\u1EADn m\u1EADt kh\u1EA9u", label: "Confirm Password", required: true, withAsterisk: true }, form.getInputProps('confirmPassword')))));
1734
+ };
1735
+
1736
+ const SSOPasswordForgotSetup = ({ hidden }) => {
1737
+ const { steps, goBack, currentStepIndex, addStep, goNext } = useSSOSteps();
1738
+ const form$1 = form.useForm({
1739
+ validate: form.yupResolver(yup__namespace.object().shape({
1740
+ password: yup__namespace
1741
+ .string()
1742
+ .required('Password is required')
1743
+ .min(8, ' ')
1744
+ .max(50, ' ')
1745
+ .matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/, ' '),
1746
+ confirmPassword: yup__namespace
1747
+ .string()
1748
+ .required('Confirm password is required')
1749
+ .test('passwords-match', 'Passwords must match', function (value) {
1750
+ return this.parent.password === value;
1751
+ }),
1752
+ })),
1753
+ });
1754
+ const onSubmit = (values) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1755
+ var _a;
1756
+ const { password, confirmPassword } = values;
1757
+ if (password.length >= 8 &&
1758
+ password.length <= 50 &&
1759
+ password.match(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/) &&
1760
+ password === confirmPassword) {
1761
+ const res = yield resetPassword(password, confirmPassword);
1762
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
1763
+ useMantineLocale.showNotification({
1764
+ type: 'success',
1765
+ message: 'Password has been reset successfully',
1766
+ });
1767
+ // back to login step
1768
+ const foundPasswordIndex = steps.findIndex((step) => step.type === SSOStepTypeType.PASSWORD);
1769
+ const foundPasswordStep = steps.find((step) => step.type === SSOStepTypeType.PASSWORD);
1770
+ const diffIndex = currentStepIndex - foundPasswordIndex;
1771
+ for (let i = 0; i < diffIndex; i++) {
1772
+ goBack();
1773
+ }
1774
+ goBack();
1775
+ addStep(foundPasswordStep);
1776
+ goNext();
1777
+ // onClose?.()
1778
+ }
1779
+ else {
1780
+ // toast error message
1781
+ useMantineLocale.showNotification({
1782
+ type: 'danger',
1783
+ message: ((_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0]) || 'API error',
1784
+ });
1785
+ }
1786
+ }
1787
+ });
1788
+ return (React__default["default"].createElement("form", { style: {
1789
+ display: hidden ? 'none' : 'block',
1790
+ }, onSubmit: form$1.onSubmit(onSubmit) },
1791
+ React__default["default"].createElement(core.Stack, { spacing: 24 },
1792
+ React__default["default"].createElement(core.Stack, { spacing: 8 },
1793
+ React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, "Setup your password"),
1794
+ React__default["default"].createElement(index$2.Text, { size: "p4" }, "Set up your login password and other details to complete the registration process.")),
1795
+ React__default["default"].createElement(SSOPasswordWithConfirm, { form: form$1 }),
1796
+ React__default["default"].createElement(CollectInfoText, null),
1797
+ React__default["default"].createElement(index$1.Button, { type: "submit", size: "lg", variant: "primary", fullWidth: true }, "Save"))));
1798
+ };
1799
+
1800
+ const SSOPhoneVerify = ({ hidden, }) => {
1801
+ const [phone, setPhone] = React__default["default"].useState('');
1802
+ const [errMsg, setErrMsg] = React__default["default"].useState('');
1803
+ const { locale } = useSSOState();
1804
+ const { addStep, goNext } = useSSOSteps();
1805
+ const onClickContinueZalo = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1806
+ var _a, _b, _c;
1807
+ const { areaCode, phoneNumber } = splitPhone(phone);
1808
+ const userExist = yield checkUserExist({ phone: phoneNumber });
1809
+ if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
1810
+ if (((_a = userExist._data) === null || _a === void 0 ? void 0 : _a.is_pass) && ((_b = userExist._data) === null || _b === void 0 ? void 0 : _b.is_status) === 'Active') {
1811
+ addStep({
1812
+ type: SSOStepTypeType.PASSWORD,
1813
+ config: {
1814
+ phone,
1815
+ },
1816
+ });
1817
+ goNext();
1818
+ }
1819
+ else {
1820
+ resendUpdatePhoneZaloOTP(phoneNumber, areaCode);
1821
+ addStep({
1822
+ type: SSOStepTypeType.OTP,
1823
+ config: {
1824
+ phone,
1825
+ otpType: 'phone-zalo',
1826
+ isUpdatePhone: true,
1827
+ afterAction: 'setup',
1828
+ },
1829
+ });
1830
+ goNext();
1831
+ }
1832
+ }
1833
+ else {
1834
+ setErrMsg(((_c = userExist === null || userExist === void 0 ? void 0 : userExist._messages) === null || _c === void 0 ? void 0 : _c[0]) || 'API error');
1835
+ }
1836
+ });
1837
+ const onClickContinuePhone = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1838
+ var _d, _e, _f;
1839
+ const { areaCode, phoneNumber } = splitPhone(phone);
1840
+ const userExist = yield checkUserExist({ phone: phoneNumber });
1841
+ if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
1842
+ if ((_d = userExist._data) === null || _d === void 0 ? void 0 : _d.is_pass) {
1843
+ addStep({
1844
+ type: SSOStepTypeType.PASSWORD,
1845
+ config: {
1846
+ phone,
1847
+ },
1848
+ });
1849
+ goNext();
1850
+ }
1851
+ else {
1852
+ const res = yield resendUpdatePhoneOTP(phoneNumber, areaCode);
1853
+ if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
1854
+ setErrMsg(((_e = res === null || res === void 0 ? void 0 : res._messages) === null || _e === void 0 ? void 0 : _e[0]) || 'API error');
1855
+ return;
1856
+ }
1857
+ addStep({
1858
+ type: SSOStepTypeType.OTP,
1859
+ config: {
1860
+ phone,
1861
+ otpType: 'phone-sms',
1862
+ isUpdatePhone: true,
1863
+ afterAction: 'setup',
1864
+ },
1865
+ });
1866
+ goNext();
1867
+ }
1868
+ }
1869
+ else {
1870
+ setErrMsg(((_f = userExist === null || userExist === void 0 ? void 0 : userExist._messages) === null || _f === void 0 ? void 0 : _f[0]) || 'API error');
1871
+ }
1872
+ });
1873
+ return (React__default["default"].createElement("div", { style: {
1874
+ display: hidden ? 'none' : 'block',
1875
+ } },
1876
+ React__default["default"].createElement(core.Stack, { spacing: 24 },
1877
+ React__default["default"].createElement(core.Stack, { spacing: 8 },
1878
+ React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, "Verify Phone Number"),
1879
+ React__default["default"].createElement(index$2.Text, { size: "p4" }, "Please provide additional information to complete the account registration process.")),
1880
+ React__default["default"].createElement(core.Stack, { spacing: 16 },
1881
+ React__default["default"].createElement(index$3.Input.Wrapper, { error: errMsg },
1882
+ React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => setPhone(value), isError: !!errMsg, required: true, name: "phone" })),
1883
+ React__default["default"].createElement(index$1.Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo }, "Continue with Zalo"),
1884
+ React__default["default"].createElement(index$1.Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone }, "Continue with SMS")),
1885
+ React__default["default"].createElement(CollectInfoText, null))));
1886
+ };
1887
+
1888
+ const FemaleIcon = () => (React__default["default"].createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1889
+ React__default["default"].createElement("path", { d: "M9.907.476C7.828.428 5.535 2.36 4.817 4.593c-1.192 3.7.154 9.554-1.391 13.089l10.542-.056c.649-3.603.786-7.28.41-10.922-.159-1.46-.4-3.184-1.33-4.294C12.02 1.184 11.02.624 10.514.514a2.4 2.4 0 0 0-.607-.038", fill: "#262626" }),
1890
+ React__default["default"].createElement("path", { d: "M14.224 18.144H5.532c-1.44 0-2.196-.447-1.206-1.493a7 7 0 0 1 .531-.502c.537-.457 1.743-1.437 2.57-1.921.513-.3.894-.78 1.068-1.348q.108-.418.143-.847h2.48q.035.43.143.847a2.36 2.36 0 0 0 1.066 1.348c.83.484 2.034 1.464 2.572 1.921q.28.238.532.502c.99 1.046.233 1.493-1.207 1.493", fill: "#FFB497" }),
1891
+ React__default["default"].createElement("path", { d: "M15.841 17.15c.41.686.031 1.06-.556 1.401-.604.35-2.454 1.086-5.407 1.086S5.076 18.9 4.471 18.55c-.587-.34-.965-.715-.555-1.4q.327-.538.76-.985a9.3 9.3 0 0 1 2.64-1.846l2.59 2.726 2.573-2.707a9.3 9.3 0 0 1 2.6 1.827h.003c.287.297.542.628.759.985", fill: "#FC488D" }),
1892
+ React__default["default"].createElement("path", { d: "M6.037 7.275a.95.95 0 0 0-.763-.012c-.442.225-.502.809-.353 1.227.19.538.782 1.076 1.414.871z", fill: "#FFB497" }),
1893
+ React__default["default"].createElement("path", { d: "M6.334 8.688a.23.23 0 0 1-.192-.104.66.66 0 0 0-.514-.249.23.23 0 0 1-.003-.46c.023 0 .6-.005.902.457a.23.23 0 0 1-.193.356m4.929 4.192c-.519.285-1.054.501-1.384.501s-.865-.216-1.383-.501q.108-.418.143-.847h2.481q.034.43.143.847", fill: "#FF977B" }),
1894
+ React__default["default"].createElement("path", { d: "M13.564 6.966c-.181-1.907-1.68-4.121-2.63-3.686a.18.18 0 0 1-.194-.028C9.154 1.846 9.156 6.759 6.035 7.274c.071 2.186.776 3.652 1.512 4.224.667.52 1.781 1.116 2.33 1.116s1.664-.596 2.332-1.116c.77-.6 1.577-2.186 1.355-4.532", fill: "#FCCAAF" }),
1895
+ React__default["default"].createElement("path", { d: "M11.786 7.978a.387.387 0 1 0 0-.775.387.387 0 0 0 0 .775", fill: "#404040" }),
1896
+ React__default["default"].createElement("path", { d: "M11.098 7.092a.85.85 0 0 1 .417-.26c.15-.04.307-.048.46-.022q.218.034.413.136.069.03.143.03l.045-.001a.157.157 0 0 1 .163.153.2.2 0 0 1-.012.065.34.34 0 0 1-.207.188.45.45 0 0 1-.323-.02 1.1 1.1 0 0 0-.287-.072.8.8 0 0 0-.268.014.5.5 0 0 0-.207.104l-.018.015a.23.23 0 0 1-.319-.33m-.157-1.074c.35-.09.711-.116 1.07-.076a2.5 2.5 0 0 1 1.012.349.179.179 0 0 1-.177.31 2.2 2.2 0 0 0-.875-.253 2.5 2.5 0 0 0-.908.113.23.23 0 0 1-.134-.44z", fill: "#262626" }),
1897
+ React__default["default"].createElement("path", { d: "M7.971 7.978a.387.387 0 1 0 0-.775.387.387 0 0 0 0 .775", fill: "#404040" }),
1898
+ React__default["default"].createElement("path", { d: "M8.324 7.409a.5.5 0 0 0-.207-.105.8.8 0 0 0-.268-.014 1.1 1.1 0 0 0-.288.073.45.45 0 0 1-.322.019.34.34 0 0 1-.208-.188.158.158 0 0 1 .15-.217l.047.001q.075 0 .143-.03.195-.102.412-.136c.153-.026.31-.018.46.022a.85.85 0 0 1 .416.26.23.23 0 0 1-.317.33zm.37-.948a2.5 2.5 0 0 0-.907-.113 2.2 2.2 0 0 0-.876.253.179.179 0 0 1-.176-.31h.001a2.5 2.5 0 0 1 1.013-.35c.358-.039.72-.013 1.069.077a.23.23 0 0 1-.11.447l-.01-.003z", fill: "#262626" }),
1899
+ React__default["default"].createElement("path", { d: "M10.887 9.971a.15.15 0 0 0-.19-.094l-.012.005a.2.2 0 0 1-.118.004c-.046-.01-.108-.032-.193-.05a.6.6 0 0 0-.397.053.6.6 0 0 0-.397-.053c-.084.019-.145.041-.192.05a.2.2 0 0 1-.118-.004l-.012-.004a.15.15 0 0 0-.132.265.5.5 0 0 0 .283.082c.092 0 .165-.013.217-.012.053.001.152.115.188.145a.28.28 0 0 0 .36-.033c.02-.024.101-.111.155-.112.054 0 .126.012.218.012a.5.5 0 0 0 .282-.082.15.15 0 0 0 .058-.172", fill: "#F44D2C" }),
1900
+ React__default["default"].createElement("path", { d: "M10.142 8.676a.23.23 0 0 0-.173.078.4.4 0 0 1-.092.015.4.4 0 0 1-.093-.015.23.23 0 0 0-.403.152c0 .32.49.324.496.324.005 0 .494-.004.494-.324a.23.23 0 0 0-.23-.23", fill: "#FF977B" }),
1901
+ React__default["default"].createElement("path", { d: "M10.026 10.691h-.294a.23.23 0 1 0 0 .46h.294a.23.23 0 0 0 0-.46", fill: "#F44D2C" }),
1902
+ React__default["default"].createElement("path", { d: "M11.796 18.906a.45.45 0 0 1-.402-.628c.7-1.683-.73-4.184-.36-6.07a9 9 0 0 0 1.09-.687c.771-.6 1.578-2.186 1.356-4.532-.178-1.869-1.621-4.033-2.574-3.71l-.008.001-.007-.005a.013.013 0 0 1 .001-.016c.267-.299.343-1.113-.318-1.782-.498-.505-.665-.992-.418-.979 1.971.11 4.022 2.014 4.7 4.117.79 2.454.252 5.67.611 8.706.23 1.94 1.62 5.74-3.671 5.585", fill: "#262626" })));
1903
+ const MaleIcon = () => (React__default["default"].createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
1904
+ React__default["default"].createElement("path", { d: "M10.334 16.266c-3.177 0-3.932-2.198-3.444-2.426.155-.073.312-.14.465-.21.487-.136.801-.72.966-1.133s.213-.762.219-.997l.19.37q.102.06.21.107a3.27 3.27 0 0 0 2.789 0c.072-.031.532-.437.599-.477l-.1.498c.005.226.063.286.14.499.222.59.41.89.955 1.138q.226.1.456.205c.153.071.017 2.426-3.445 2.426", fill: "#FF977B" }),
1905
+ React__default["default"].createElement("path", { d: "M17.623 17.018c.503.8.038 1.233-.68 1.63-.74.407-2.994 1.263-6.609 1.263s-5.869-.856-6.61-1.264c-.717-.396-1.182-.83-.68-1.63.43-.685 1.662-2.158 3.845-3.177.155-.073.312-.14.466-.21.695 1.15 2.091 1.4 2.985 1.4s2.286-.25 2.983-1.395q.225.1.456.205c2.183 1.019 3.415 2.492 3.844 3.178", fill: "#2D87F3" }),
1906
+ React__default["default"].createElement("path", { d: "M12.852 12.533c-.72.35-1.573.539-2.447.543a5.8 5.8 0 0 1-2.458-.517c.117-.22.18-.453.188-.688l.003-.002q.143.06.296.107c.617.205 1.29.312 1.972.312a6.3 6.3 0 0 0 2.269-.419l.002.002c.007.226.066.45.175.662", fill: "#FF6F4D" }),
1907
+ React__default["default"].createElement("path", { d: "M14.755 7.579H5.61c-.213-2.439.17-4.883 1.27-5.997a.97.97 0 0 1 .98-.242c.205.066.731.01.906-.234.14-.197.714-.443 1.08-.104a.5.5 0 0 0 .334.127h.003a.52.52 0 0 0 .335-.127c.365-.339.939-.093 1.078.104.176.245.703.3.908.234a.97.97 0 0 1 .98.242c1.1 1.114 1.482 3.558 1.27 5.997", fill: "#404040" }),
1908
+ React__default["default"].createElement("path", { d: "M14.02 6.912a1 1 0 0 1 .728-.007c.5.203.641.795.438 1.417-.2.617-.906 1.045-1.517.826-.179-.587-.062-1.716.351-2.236M6.607 9.147c-.611.219-1.317-.208-1.517-.825-.203-.622-.063-1.214.437-1.417a1 1 0 0 1 .728.007c.612.412.71 1.838.352 2.235", fill: "#FF977B" }),
1909
+ React__default["default"].createElement("path", { d: "M13.887 8.263a.156.156 0 0 1-.125-.25 1.05 1.05 0 0 1 .804-.417.156.156 0 1 1-.003.312h-.001a.73.73 0 0 0-.55.292.16.16 0 0 1-.125.063m-7.498-.008a.16.16 0 0 1-.125-.063.7.7 0 0 0-.545-.282.16.16 0 0 1-.16-.151.156.156 0 0 1 .15-.161 1.02 1.02 0 0 1 .805.408.156.156 0 0 1-.125.25z", fill: "#FF6F4D" }),
1910
+ React__default["default"].createElement("path", { d: "M12.353 3.765c-.545.131-.883.448-2.2.448s-1.656-.317-2.201-.448c-1.02-.247-1.649 2.672-1.647 3.883.001.18.028.696.054 1.2l.029.493q.03.34.152.66c1.108 3.11 6.118 3.096 7.347-.04.002-.085.015-.324.032-.62l.028-.493c.026-.504.053-1.02.053-1.2.002-1.211-.625-4.13-1.647-3.883", fill: "#FFB497" }),
1911
+ React__default["default"].createElement("path", { d: "M12.348 6.946a.359.359 0 1 0-.717 0v.14a.359.359 0 1 0 .717 0zm-4.421.141a.359.359 0 0 0 .718 0v-.14a.359.359 0 1 0-.718 0z", fill: "#595959" }),
1912
+ React__default["default"].createElement("path", { d: "M11.344 6.96a.2.2 0 0 1-.061-.013.15.15 0 0 1-.082-.198c.081-.196.348-.278.557-.312.381-.062.889-.017 1.102.228a.156.156 0 1 1-.236.206c-.1-.116-.446-.174-.772-.132-.24.032-.35.102-.363.13a.16.16 0 0 1-.145.091", fill: "#404040" }),
1913
+ React__default["default"].createElement("path", { d: "M10.137 8.963c-.008 0-.772-.033-.772-.373a.156.156 0 0 1 .305-.048c.147.068.306.105.467.11.163-.005.324-.042.472-.11a.156.156 0 0 1 .305.048c0 .34-.77.373-.777.373", fill: "#FF6F4D" }),
1914
+ React__default["default"].createElement("path", { d: "M11.122 6.393a.157.157 0 0 1-.051-.304c.687-.234 1.688-.344 2.26-.03a.156.156 0 0 1-.15.274c-.463-.254-1.38-.163-2.009.052a.2.2 0 0 1-.05.008m-2.19.572a.16.16 0 0 1-.144-.097c-.013-.027-.123-.097-.363-.129-.325-.043-.672.016-.772.131a.156.156 0 1 1-.236-.205c.214-.245.721-.29 1.103-.228.209.034.475.116.556.311a.156.156 0 0 1-.144.217m.222-.571a.2.2 0 0 1-.05-.009c-.629-.215-1.546-.306-2.009-.051a.156.156 0 1 1-.15-.274c.572-.315 1.572-.206 2.26.03a.156.156 0 0 1-.05.304", fill: "#404040" }),
1915
+ React__default["default"].createElement("path", { d: "m11.12 9.547-.019.001a8 8 0 0 1-1.928 0 .156.156 0 1 0-.037.31c.665.08 1.337.08 2.003 0a.156.156 0 0 0-.019-.31", fill: "#D84023" })));
1916
+
1917
+ // always has name, gender dob
1918
+ const OtherSetup = ({ form, needPhone, needEmail, isEmailDisable, }) => {
1919
+ const { locale = 'vi-VN' } = useSSOState();
1920
+ return (React__default["default"].createElement(core.Stack, { spacing: 12 },
1921
+ needPhone && (React__default["default"].createElement(React__default["default"].Fragment, null,
1922
+ React__default["default"].createElement(index$3.Input.Wrapper, Object.assign({ label: "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i", withAsterisk: true }, form.getInputProps('phone')),
1923
+ React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: form.getInputProps('phone').value, onChange: (value) => {
1924
+ form.setFieldValue('phone', value);
1925
+ }, isError: !!form.getInputProps('phone').error, required: true, name: "phone" })),
1926
+ React__default["default"].createElement(core.Group, { spacing: 24 },
1927
+ React__default["default"].createElement(index$2.Text, { size: "p4" }, "Nh\u1EADn OTP qua"),
1928
+ React__default["default"].createElement(index$3.Radio.Group, Object.assign({ name: "otpMethod", styles: {
1929
+ root: {
1930
+ display: 'flex',
1931
+ flexDirection: 'row',
1932
+ flexWrap: 'wrap',
1933
+ gap: 24,
1934
+ },
1935
+ } }, form.getInputProps('otpMethod')),
1936
+ React__default["default"].createElement(index$3.Radio, { value: "zalo", label: "Zalo", styles: {
1937
+ label: {
1938
+ paddingLeft: 8,
1939
+ },
1940
+ } }),
1941
+ React__default["default"].createElement(index$3.Radio, { value: "sms", label: "SMS", styles: {
1942
+ label: {
1943
+ paddingLeft: 8,
1944
+ },
1945
+ } }))))),
1946
+ needEmail && (React__default["default"].createElement(index$3.Input, Object.assign({ name: "email", type: "email", label: "Email", disabled: isEmailDisable }, form.getInputProps('email')))),
1947
+ React__default["default"].createElement(index$3.Input, Object.assign({ name: "name", label: "Name", withAsterisk: true, required: true, placeholder: "Enter your name" }, form.getInputProps('name'))),
1948
+ React__default["default"].createElement(index$3.Input.Wrapper, Object.assign({ label: "Gender", withAsterisk: true }, form.getInputProps('gender')),
1949
+ React__default["default"].createElement(core.Group, null,
1950
+ React__default["default"].createElement(index$1.Button, { type: "button", styles: {
1951
+ root: {
1952
+ flex: 1,
1953
+ },
1954
+ leftIcon: {
1955
+ marginRight: 8,
1956
+ },
1957
+ inner: {
1958
+ justifyContent: 'start',
1959
+ },
1960
+ }, variant: form.getInputProps('gender').value === 'female'
1961
+ ? 'secondary'
1962
+ : 'tertiary', onClick: () => {
1963
+ form.setFieldValue('gender', 'female');
1964
+ }, leftIcon: React__default["default"].createElement(FemaleIcon, null) }, "Female"),
1965
+ React__default["default"].createElement(index$1.Button, { type: "button", styles: {
1966
+ root: {
1967
+ flex: 1,
1968
+ },
1969
+ leftIcon: {
1970
+ marginRight: 8,
1971
+ },
1972
+ inner: {
1973
+ justifyContent: 'start',
1974
+ },
1975
+ }, variant: form.getInputProps('gender').value === 'male'
1976
+ ? 'secondary'
1977
+ : 'tertiary', onClick: () => {
1978
+ form.setFieldValue('gender', 'male');
1979
+ }, leftIcon: React__default["default"].createElement(MaleIcon, null) }, "Male"))),
1980
+ React__default["default"].createElement(index$5.DatePicker, Object.assign({ name: "dob", label: "Birthday", withAsterisk: true, required: true, placeholder: "Enter your birthday" }, form.getInputProps('dob')))));
1981
+ };
1982
+
1983
+ const SSOSetupScreen = ({ hidden, index, }) => {
1984
+ const { onClose, source } = useSSOState();
1985
+ const { goNext, steps, addStep, shareData } = useSSOSteps();
1986
+ const [errMsg, setErrMsg] = React__default["default"].useState('');
1987
+ const currentStep = steps[index];
1988
+ const config = currentStep === null || currentStep === void 0 ? void 0 : currentStep.config;
1989
+ const userInfo = config === null || config === void 0 ? void 0 : config.userInfo;
1990
+ const needPass = !(userInfo === null || userInfo === void 0 ? void 0 : userInfo.is_pass);
1991
+ const needPhone = !(userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone_verified_at);
1992
+ // const isNew = !!userInfo?.is_new
1993
+ const authMethod = shareData === null || shareData === void 0 ? void 0 : shareData.authMethod;
1994
+ const authFlow = shareData === null || shareData === void 0 ? void 0 : shareData.authFlow;
1995
+ const isEmailDisable = authMethod === 'google' || authMethod === 'mail';
1996
+ const needEmail = authFlow !== 'verify-phone';
1997
+ const form$1 = form.useForm({
1998
+ initialValues: Object.assign(Object.assign({}, (needPhone
1999
+ ? {
2000
+ otpMethod: 'zalo',
2001
+ }
2002
+ : {})), { dob: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.birthday) ? new Date(userInfo.birthday) : undefined, name: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || undefined, email: isEmailDisable ? (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || undefined : undefined }),
2003
+ validateInputOnBlur: true,
2004
+ validate: form.yupResolver(yup__namespace.object().shape(Object.assign(Object.assign(Object.assign(Object.assign({}, (needPass
2005
+ ? {
2006
+ password: yup__namespace
2007
+ .string()
2008
+ .required('Password is required')
2009
+ .min(8, ' ')
2010
+ .max(50, ' ')
2011
+ .matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/, ' '),
2012
+ confirmPassword: yup__namespace
2013
+ .string()
2014
+ .required('Confirm password is required')
2015
+ .test('passwords-match', 'Passwords must match', function (value) {
2016
+ return this.parent.password === value;
2017
+ }),
2018
+ }
2019
+ : {})), (needPhone
2020
+ ? {
2021
+ phone: yup__namespace.string().required('Phone number is required'),
2022
+ otpMethod: yup__namespace
2023
+ .string()
2024
+ .required('OTP method is required')
2025
+ .oneOf(['zalo', 'sms']),
2026
+ }
2027
+ : {})), (needEmail
2028
+ ? {
2029
+ email: yup__namespace.string().email('Invalid email'),
2030
+ }
2031
+ : {})), { gender: yup__namespace
2032
+ .string()
2033
+ .required('Gender is required')
2034
+ .oneOf(['male', 'female']), dob: yup__namespace.date().required('Date of birth is required'), name: yup__namespace.string().required('Name is required') }))),
2035
+ });
2036
+ const onSubmit = (values) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
2037
+ var _a, _b, _c, _d;
2038
+ const { password, confirmPassword, phone, gender, name, dob, otpMethod } = values;
2039
+ const { phoneNumber, areaCode } = splitPhone(phone || '');
2040
+ // validate only, delay set data to after otp
2041
+ const res = yield updateUserInfo({
2042
+ name,
2043
+ birthday: dayjs__default["default"](dob).format('YYYY-MM-DD'),
2044
+ email: values.email,
2045
+ password,
2046
+ confirm_password: confirmPassword,
2047
+ phone_number: phoneNumber,
2048
+ area_code: areaCode,
2049
+ gender: gender === 'male' ? 1 : 0,
2050
+ source,
2051
+ validate: 'true',
2052
+ });
2053
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
2054
+ // if need phone and has phone then start phone verify step, close after done
2055
+ if (needPhone && phone) {
2056
+ const setupData = {
2057
+ name,
2058
+ birthday: dayjs__default["default"](dob).format('YYYY-MM-DD'),
2059
+ email: values.email,
2060
+ password,
2061
+ confirm_password: confirmPassword,
2062
+ phone_number: phoneNumber,
2063
+ area_code: areaCode,
2064
+ gender: gender === 'male' ? 1 : 0,
2065
+ source,
2066
+ };
2067
+ if (otpMethod === 'zalo') {
2068
+ const res = yield resendUpdatePhoneZaloOTP(phoneNumber, areaCode);
2069
+ if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
2070
+ setErrMsg(((_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0]) || 'API error');
2071
+ return;
2072
+ }
2073
+ addStep({
2074
+ type: SSOStepTypeType.OTP,
2075
+ config: {
2076
+ phone,
2077
+ otpType: 'phone-zalo',
2078
+ isUpdatePhone: true,
2079
+ afterAction: 'submitSetup',
2080
+ setupData,
2081
+ },
2082
+ });
2083
+ goNext();
2084
+ }
2085
+ else {
2086
+ const res = yield resendUpdatePhoneOTP(phoneNumber, areaCode);
2087
+ if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
2088
+ setErrMsg(((_b = res === null || res === void 0 ? void 0 : res._messages) === null || _b === void 0 ? void 0 : _b[0]) || 'API error');
2089
+ return;
2090
+ }
2091
+ addStep({
2092
+ type: SSOStepTypeType.OTP,
2093
+ config: {
2094
+ phone,
2095
+ otpType: 'phone-sms',
2096
+ isUpdatePhone: true,
2097
+ afterAction: 'submitSetup',
2098
+ setupData,
2099
+ },
2100
+ });
2101
+ goNext();
2102
+ }
2103
+ }
2104
+ else {
2105
+ // close?
2106
+ const res = yield updateUserInfo({
2107
+ name,
2108
+ birthday: dayjs__default["default"](dob).format('YYYY-MM-DD'),
2109
+ email: values.email,
2110
+ password,
2111
+ confirm_password: confirmPassword,
2112
+ phone_number: phoneNumber,
2113
+ area_code: areaCode,
2114
+ gender: gender === 'male' ? 1 : 0,
2115
+ source,
2116
+ validate: '',
2117
+ });
2118
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
2119
+ handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
2120
+ onClose === null || onClose === void 0 ? void 0 : onClose();
2121
+ }
2122
+ else {
2123
+ setErrMsg(((_c = res._messages) === null || _c === void 0 ? void 0 : _c[0]) || 'API error');
2124
+ return;
2125
+ }
2126
+ }
2127
+ }
2128
+ else {
2129
+ // toast error message
2130
+ setErrMsg(((_d = res._messages) === null || _d === void 0 ? void 0 : _d[0]) || 'API error');
2131
+ }
2132
+ });
2133
+ return (React__default["default"].createElement("form", { style: {
2134
+ display: hidden ? 'none' : 'block',
2135
+ }, onSubmit: form$1.onSubmit(onSubmit) },
2136
+ React__default["default"].createElement(core.Stack, { spacing: 24 },
2137
+ React__default["default"].createElement(core.Stack, { spacing: 8 },
2138
+ React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, "Almost done!"),
2139
+ React__default["default"].createElement(index$2.Text, { size: "p4" }, "Please provide additional information to complete the account registration process.")),
2140
+ needPass && React__default["default"].createElement(SSOPasswordWithConfirm, { form: form$1 }),
2141
+ React__default["default"].createElement(OtherSetup, { needPhone: needPhone, needEmail: needEmail, isEmailDisable: isEmailDisable, form: form$1 }),
2142
+ React__default["default"].createElement(CollectInfoText, null),
2143
+ errMsg && (React__default["default"].createElement(index$2.Text, { color: "red.6", size: "p4" }, errMsg)),
2144
+ React__default["default"].createElement(index$1.Button, { type: "submit", variant: "primary", fullWidth: true }, needPhone ? 'Verify Phone Number' : 'Save'))));
2145
+ };
2146
+
2147
+ const SSOScreenRenderer = () => {
2148
+ const { steps, currentStepIndex } = useSSOSteps();
2149
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, steps.map((step, index) => {
2150
+ const isCurrentStep = index === currentStepIndex;
2151
+ switch (step.type) {
2152
+ case SSOStepTypeType.FIRST:
2153
+ return React__default["default"].createElement(SSOFirstScreen, { key: index, hidden: !isCurrentStep });
2154
+ case SSOStepTypeType.PASSWORD:
2155
+ return (React__default["default"].createElement(SSOPasswordScreen, { key: index, hidden: !isCurrentStep, index: index }));
2156
+ case SSOStepTypeType.FORGOT_PASSWORD_PHONE:
2157
+ return (React__default["default"].createElement(SSOPasswordForgotPhone, { key: index, hidden: !isCurrentStep, index: index }));
2158
+ case SSOStepTypeType.FORGOT_PASSWORD_SETUP:
2159
+ return (React__default["default"].createElement(SSOPasswordForgotSetup, { key: index, hidden: !isCurrentStep }));
2160
+ case SSOStepTypeType.OTP:
2161
+ return (React__default["default"].createElement(SSOOTPScreen, { key: index, hidden: !isCurrentStep, index: index }));
2162
+ case SSOStepTypeType.EMAIL:
2163
+ return (React__default["default"].createElement(SSOEmailScreen, { key: index, hidden: !isCurrentStep, index: index }));
2164
+ case SSOStepTypeType.SETUP_FULL:
2165
+ return (React__default["default"].createElement(SSOSetupScreen, { key: index, hidden: !isCurrentStep, index: index }));
2166
+ case SSOStepTypeType.VERIFY_PHONE:
2167
+ return (React__default["default"].createElement(SSOPhoneVerify, { key: index, hidden: !isCurrentStep, index: index }));
2168
+ default:
2169
+ return React__default["default"].createElement("div", { key: index }, "Not found");
2170
+ }
2171
+ })));
2172
+ };
2173
+
2174
+ const SSOV2 = ({ onClose: onCloseProps, locale, source = 'default', defaultSteps, }) => {
2175
+ const { isOpen, setOpen, returnUrl } = store.useSSOV2Store();
2176
+ if (!isOpen) {
2177
+ return null;
2178
+ }
2179
+ const onClose = (success) => {
2180
+ if (success && returnUrl) {
2181
+ window.location.href = returnUrl;
2182
+ return;
2183
+ }
2184
+ setOpen(false);
2185
+ onCloseProps === null || onCloseProps === void 0 ? void 0 : onCloseProps();
2186
+ };
2187
+ return ReactDOM.createPortal(React__default["default"].createElement(SSOStateProvider, { onClose: onClose, locale: locale, source: source },
2188
+ React__default["default"].createElement(SSOStepsProvider, { defaultSteps: defaultSteps },
2189
+ React__default["default"].createElement(SSOPopupWrapper, { opened: true, onClose: onClose },
2190
+ React__default["default"].createElement(SSOScreenRenderer, null)))), utils$1.getPopupWrapperDom());
2191
+ };
2192
+
2193
+ exports.useSSOV2Store = store.useSSOV2Store;
2194
+ exports.SSOV2 = SSOV2;