@hhgtech/hhg-components 1.29.187 → 1.29.188
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.
- package/build/{LastPeriod-1f5ddf78.js → LastPeriod-6a71e5be.js} +1 -1
- package/build/{MobileBottomNavigationIcon-6dfb585f.js → MobileBottomNavigationIcon-4532fe90.js} +3 -3
- package/build/{Spinner-383edff8.js → Spinner-3e1ae5b7.js} +1 -1
- package/build/{WhatsApp-a2f20d23.js → WhatsApp-b18d81fa.js} +1 -1
- package/build/adapters.js +19 -19
- package/build/atoms.js +46 -46
- package/build/babyGrowth.js +83 -83
- package/build/cache.js +2 -2
- package/build/care.js +17 -17
- package/build/careBookingSearchBar.js +14 -14
- package/build/careBookingSearchBarV2.js +15 -15
- package/build/components.js +89 -89
- package/build/{constants-d5926a6d.js → constants-27e22207.js} +1 -1
- package/build/constants.js +3 -3
- package/build/constantsDomainLocales.js +1 -1
- package/build/constantsRiskScreener.js +2 -2
- package/build/constantsSite.js +2 -2
- package/build/{core-71d21f23.js → core-506eb877.js} +1 -1
- package/build/{dataTransform-d31b72b7.js → dataTransform-0b9863c9.js} +1 -1
- package/build/ecom.js +4 -4
- package/build/{editor-fd1226b7.js → editor-dac59f93.js} +11 -11
- package/build/embeddedHeathToolCards_babyGrowth.js +23 -23
- package/build/embeddedHeathToolCards_babyPoop.js +19 -19
- package/build/embeddedHeathToolCards_babyVaccine.js +22 -22
- package/build/embeddedHeathToolCards_bmi_bmi.js +25 -25
- package/build/embeddedHeathToolCards_bmrBmr.js +25 -25
- package/build/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
- package/build/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
- package/build/embeddedHeathToolCards_pwg_pwg.js +26 -26
- package/build/embeddedHeathToolCards_targetHeartRate.js +27 -27
- package/build/esm/{LastPeriod-0beec7cf.js → LastPeriod-84b25b86.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-bb191817.js → MobileBottomNavigationIcon-efcee5e7.js} +3 -3
- package/build/esm/{Spinner-a0f73734.js → Spinner-990324d5.js} +1 -1
- package/build/esm/{WhatsApp-1ca6c83e.js → WhatsApp-903114b1.js} +1 -1
- package/build/esm/adapters.js +19 -19
- package/build/esm/atoms.js +46 -46
- package/build/esm/babyGrowth.js +83 -83
- package/build/esm/cache.js +2 -2
- package/build/esm/care.js +17 -17
- package/build/esm/careBookingSearchBar.js +14 -14
- package/build/esm/careBookingSearchBarV2.js +15 -15
- package/build/esm/components.js +89 -89
- package/build/esm/{constants-9e2cf7e4.js → constants-7229f2ae.js} +1 -1
- package/build/esm/constants.js +3 -3
- package/build/esm/constantsDomainLocales.js +1 -1
- package/build/esm/constantsRiskScreener.js +2 -2
- package/build/esm/constantsSite.js +2 -2
- package/build/esm/{core-90e6c5d2.js → core-5999ca9a.js} +1 -1
- package/build/esm/{dataTransform-b25919ba.js → dataTransform-0930df8f.js} +1 -1
- package/build/esm/ecom.js +4 -4
- package/build/esm/{editor-0301b771.js → editor-cdf8b819.js} +11 -11
- package/build/esm/embeddedHeathToolCards_babyGrowth.js +23 -23
- package/build/esm/embeddedHeathToolCards_babyPoop.js +19 -19
- package/build/esm/embeddedHeathToolCards_babyVaccine.js +22 -22
- package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -25
- package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -25
- package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
- package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
- package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -26
- package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -27
- package/build/esm/{fixedBottomAdBlock-541237a0.js → fixedBottomAdBlock-d4bff8d8.js} +23 -23
- package/build/esm/footer.js +21 -21
- package/build/esm/gAssets.js +2 -2
- package/build/esm/healthToolsCardWrapper.js +18 -18
- package/build/esm/healthToolsForm.js +33 -33
- package/build/esm/hooks.js +13 -13
- package/build/esm/i18n/translationKeys.d.ts +1 -1
- package/build/esm/i18n-values/en-PH.js +1 -0
- package/build/esm/i18n-values/hi-IN.js +1 -0
- package/build/esm/i18n-values/id-ID.js +1 -0
- package/build/esm/i18n-values/km-KH.js +1 -0
- package/build/esm/i18n-values/ms-MY.js +2 -1
- package/build/esm/i18n-values/my-MM.js +1 -0
- package/build/esm/i18n-values/th-TH.js +1 -0
- package/build/esm/i18n-values/tl-PH.js +1 -0
- package/build/esm/i18n-values/vi-VN.js +1 -0
- package/build/esm/i18n-values/vi-VN_MB.js +1 -0
- package/build/esm/i18n-values/zh-TW.js +1 -0
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-6b3f0a76.js → index-05b19d4c.js} +13 -13
- package/build/esm/{index-ae2a6975.js → index-0741962a.js} +1 -1
- package/build/esm/{index-8cac666f.js → index-09c15953.js} +2 -2
- package/build/esm/{index-90298f87.js → index-0aed77bd.js} +32 -32
- package/build/esm/{index-ab9145d9.js → index-0ceaf802.js} +24 -24
- package/build/esm/{index-cb260d78.js → index-10ac45ad.js} +16 -16
- package/build/esm/{index-84f27339.js → index-11356d9c.js} +5 -5
- package/build/esm/{index-4a4e2edd.js → index-11720abf.js} +1 -1
- package/build/esm/{index-a7b92530.js → index-143e7d7f.js} +18 -18
- package/build/esm/{index-32eb44f8.js → index-16aa0665.js} +1 -1
- package/build/esm/{index-2a82a182.js → index-18373462.js} +12 -12
- package/build/esm/{index-0ad7908d.js → index-1d538518.js} +1 -1
- package/build/esm/{index-4a3da6d0.js → index-223ae052.js} +3 -3
- package/build/esm/{index-8450b44e.js → index-3ac9af4e.js} +16 -16
- package/build/esm/{index-118c2c8e.js → index-3d03b664.js} +2 -2
- package/build/esm/{index-26abcfb3.js → index-3eeedef7.js} +23 -23
- package/build/esm/{index-df20ded2.js → index-47912177.js} +17 -17
- package/build/esm/{index-3cf88628.js → index-4e7902f4.js} +10 -10
- package/build/esm/{index-aa1db366.js → index-52d215a5.js} +1 -1
- package/build/esm/{index-f24d5e3e.js → index-57ede743.js} +3 -3
- package/build/esm/{index-4492f1d7.js → index-59a115be.js} +2 -2
- package/build/esm/{index-130cea71.js → index-5c2af451.js} +3 -3
- package/build/esm/{index-23b93c11.js → index-60508cb9.js} +2 -2
- package/build/esm/{index-4b1088c5.js → index-62fa940d.js} +13 -13
- package/build/esm/{index-09320cf0.js → index-65b3271f.js} +13 -13
- package/build/esm/{index-c26ff0ab.js → index-6a555c42.js} +2 -2
- package/build/esm/{index-293eff9e.js → index-6f337a5f.js} +4 -4
- package/build/esm/{index-cb1f0c6b.js → index-713cab8f.js} +1 -1
- package/build/esm/{index-b8ca9f2a.js → index-75073625.js} +3 -3
- package/build/esm/{index-5e1dd183.js → index-83fd2ef1.js} +6 -6
- package/build/esm/{index-d359e562.js → index-842413f3.js} +5 -5
- package/build/esm/{index-dc96306e.js → index-846e3a62.js} +16 -16
- package/build/esm/{index-8e2bed29.js → index-87698349.js} +2 -2
- package/build/esm/{index-7f6bbe6a.js → index-886662ca.js} +2 -2
- package/build/esm/{index-e8b7b5c6.js → index-8a39ef19.js} +30 -30
- package/build/esm/{index-e64f8d68.js → index-9048db90.js} +6 -6
- package/build/esm/{index-29dcf47d.js → index-9312f46a.js} +1 -1
- package/build/esm/{index-96fd2259.js → index-9ad0326d.js} +2 -2
- package/build/esm/{index-5c2aab2a.js → index-9b4abb1c.js} +18 -18
- package/build/esm/{index-8b6d2388.js → index-9cce954f.js} +1 -1
- package/build/esm/{index-ebe0e7c8.js → index-a02223d2.js} +1 -1
- package/build/esm/{index-20ed3ed2.js → index-a0d69f6b.js} +17 -17
- package/build/esm/{index-0c750a56.js → index-a8b1b6bd.js} +15 -15
- package/build/esm/{index-d500bb08.js → index-ada11144.js} +3 -3
- package/build/esm/{index-374e2020.js → index-b2e52796.js} +20 -20
- package/build/esm/{index-e00b877e.js → index-b6ce58f8.js} +2 -2
- package/build/esm/{index-575d314b.js → index-bb02584c.js} +2 -2
- package/build/esm/{index-cc05bfff.js → index-bd025a93.js} +21 -21
- package/build/esm/{index-c5fbd48f.js → index-be9a5097.js} +7 -7
- package/build/esm/{index-f8334799.js → index-c0ae42ba.js} +15 -15
- package/build/esm/{index-31e655fa.js → index-c6f9b686.js} +7 -7
- package/build/esm/{index-ddaf8567.js → index-c833a666.js} +16 -16
- package/build/esm/{index-22323d02.js → index-d673a38f.js} +6 -6
- package/build/esm/{index-0a3e06f4.js → index-db766810.js} +13 -13
- package/build/esm/{index-c992ec38.js → index-dc2c6c95.js} +3 -3
- package/build/esm/{index-7d1aa6a5.js → index-f1c36e99.js} +17 -17
- package/build/esm/{index-9ee1596f.js → index-f42c3988.js} +1 -1
- package/build/esm/{index-96f13ce8.js → index-f45377cb.js} +6 -6
- package/build/esm/{index-15f27ddc.js → index-f56800e7.js} +2 -2
- package/build/esm/{index-fc065970.js → index-fc5b8c7e.js} +2 -2
- package/build/esm/index.js +111 -111
- package/build/esm/{index.styles-9d9404ae.js → index.styles-29eadbd0.js} +1 -1
- package/build/esm/{labelSorting-4c8fe568.js → labelSorting-4551b654.js} +4 -4
- package/build/esm/lead.js +23 -23
- package/build/esm/{logoIcon-fec701e8.js → logoIcon-19b961db.js} +2 -2
- package/build/esm/mantine.js +25 -25
- package/build/esm/misc.js +16 -16
- package/build/esm/miscGetDynamicHealthTool.js +4 -4
- package/build/esm/miscGetSocialList.js +8 -8
- package/build/esm/miscScreenSizeContext.js +1 -1
- package/build/esm/mobileBottomNavigation.js +5 -5
- package/build/esm/mobileBottomNavigationIcon.js +5 -5
- package/build/esm/molecules.js +68 -68
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +16 -16
- package/build/esm/navigation.js +40 -40
- package/build/esm/navigationLogoutPopup.js +9 -9
- package/build/esm/navigationProfileButton.js +23 -23
- package/build/esm/onboardingV2.js +29 -29
- package/build/esm/organisms.js +44 -44
- package/build/esm/{post-5dae360a.js → post-ae80b684.js} +2 -2
- package/build/esm/profileNavigation.js +19 -19
- package/build/esm/progressBar.js +1 -1
- package/build/esm/pwg.js +22 -22
- package/build/esm/ssoV2/screens/passwordForgotSetup/passwordWithConfirm.d.ts +2 -1
- package/build/esm/ssoV2/screens/setup/otherSetup.d.ts +2 -1
- package/build/esm/ssoV2.js +718 -583
- package/build/esm/{store-0e3bf0dd.js → store-c01b5c45.js} +8 -7
- package/build/esm/subot.js +33 -33
- package/build/esm/surveyOrPremiumBanner.js +30 -30
- package/build/esm/surveyQuestionCard.js +10 -10
- package/build/esm/{surveyThankyouCard-324f9430.js → surveyThankyouCard-620fe949.js} +5 -5
- package/build/esm/together.js +52 -52
- package/build/esm/togetherApiUtils.js +4 -4
- package/build/esm/togetherAtoms.js +30 -30
- package/build/esm/togetherComponentGlobalContext.js +4 -4
- package/build/esm/togetherMolecules.js +47 -47
- package/build/esm/togetherMoleculesCardAuthor.js +27 -27
- package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
- package/build/esm/togetherMoleculesProfileDetail.js +37 -37
- package/build/esm/togetherOrganisms.js +47 -47
- package/build/esm/togetherRichTextEditor.js +17 -17
- package/build/esm/togetherShareBox.js +10 -10
- package/build/esm/{treePopoverMenu-12714698.js → treePopoverMenu-f3115d5b.js} +18 -18
- package/build/esm/{types-a176854b.js → types-bc6727c8.js} +2 -2
- package/build/esm/types.js +2 -2
- package/build/esm/{useCategory-718135b7.js → useCategory-6c157810.js} +5 -5
- package/build/esm/{useHealthToolCache-4fe136f9.js → useHealthToolCache-a9d40553.js} +1 -1
- package/build/esm/{useMantineLocale-9516e7f9.js → useMantineLocale-d89aa467.js} +5 -5
- package/build/esm/{usePlacesAutocomplete-c468e48e.js → usePlacesAutocomplete-699dbe75.js} +1 -1
- package/build/esm/useTogetherAuthRequiredAction.js +9 -9
- package/build/esm/{utils-71febd08.js → utils-719afb2e.js} +2 -2
- package/build/esm/{utils-e8fc6daf.js → utils-a8196146.js} +2 -2
- package/build/esm/{utils-0ee5e9e8.js → utils-f694c42f.js} +3 -3
- package/build/esm/vaccination.js +21 -21
- package/build/{fixedBottomAdBlock-8059d1a0.js → fixedBottomAdBlock-9a0e6073.js} +23 -23
- package/build/footer.js +21 -21
- package/build/gAssets.js +2 -2
- package/build/healthToolsCardWrapper.js +18 -18
- package/build/healthToolsForm.js +33 -33
- package/build/hooks.js +13 -13
- package/build/i18n/translationKeys.d.ts +1 -1
- package/build/i18n-values/en-PH.js +1 -0
- package/build/i18n-values/hi-IN.js +1 -0
- package/build/i18n-values/id-ID.js +1 -0
- package/build/i18n-values/km-KH.js +1 -0
- package/build/i18n-values/ms-MY.js +2 -1
- package/build/i18n-values/my-MM.js +1 -0
- package/build/i18n-values/th-TH.js +1 -0
- package/build/i18n-values/tl-PH.js +1 -0
- package/build/i18n-values/vi-VN.js +1 -0
- package/build/i18n-values/vi-VN_MB.js +1 -0
- package/build/i18n-values/zh-TW.js +1 -0
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/{index-95a27c5d.js → index-136529fb.js} +20 -20
- package/build/{index-27c6b9f3.js → index-20be1b8e.js} +2 -2
- package/build/{index-a13b4608.js → index-23f8a297.js} +6 -6
- package/build/{index-b83c3457.js → index-2448dac3.js} +1 -1
- package/build/{index-ce6508a1.js → index-2d5465c5.js} +17 -17
- package/build/{index-db7a4a46.js → index-30a885a2.js} +3 -3
- package/build/{index-73ffa450.js → index-392a4520.js} +2 -2
- package/build/{index-7e780e5f.js → index-3a6ab9f1.js} +12 -12
- package/build/{index-63894945.js → index-3b6d0a4b.js} +32 -32
- package/build/{index-99d412ab.js → index-4319ed3d.js} +2 -2
- package/build/{index-20fa2236.js → index-48237a4e.js} +1 -1
- package/build/{index-5b48f735.js → index-4b5ce355.js} +2 -2
- package/build/{index-90b1277d.js → index-4f2da132.js} +1 -1
- package/build/{index-ae02be4b.js → index-50db7f9d.js} +13 -13
- package/build/{index-5dbcabd8.js → index-53b20fbf.js} +18 -18
- package/build/{index-ff993564.js → index-53edf7f0.js} +2 -2
- package/build/{index-ce54d8e8.js → index-587ae6fc.js} +1 -1
- package/build/{index-5b21efe3.js → index-59c8d894.js} +30 -30
- package/build/{index-40d85ef8.js → index-62a66842.js} +1 -1
- package/build/{index-8d08525f.js → index-63efab40.js} +6 -6
- package/build/{index-2917eb83.js → index-6501aba4.js} +16 -16
- package/build/{index-78cf34da.js → index-66903a6d.js} +2 -2
- package/build/{index-046cdb75.js → index-67cc8e40.js} +7 -7
- package/build/{index-8ef4d4dd.js → index-6ead4e94.js} +21 -21
- package/build/{index-ef92ecdc.js → index-6f33dc52.js} +5 -5
- package/build/{index-d76e71b2.js → index-7b63ccf0.js} +2 -2
- package/build/{index-6d43398a.js → index-8423e154.js} +23 -23
- package/build/{index-d38bbbd5.js → index-873ed879.js} +1 -1
- package/build/{index-07554ee2.js → index-8770e725.js} +5 -5
- package/build/{index-3e6f2bea.js → index-8b4c9bac.js} +3 -3
- package/build/{index-e91c93dd.js → index-8c45dd73.js} +6 -6
- package/build/{index-baa3cb40.js → index-8d418481.js} +3 -3
- package/build/{index-f1743080.js → index-94b19bde.js} +1 -1
- package/build/{index-24511c91.js → index-9924041d.js} +1 -1
- package/build/{index-3b84fd74.js → index-9aa342d6.js} +16 -16
- package/build/{index-2800a005.js → index-9bf9c0c3.js} +16 -16
- package/build/{index-db450b8c.js → index-9fa3445d.js} +17 -17
- package/build/{index-33534235.js → index-a6c5c579.js} +13 -13
- package/build/{index-55b48b2b.js → index-a6cc2f7c.js} +13 -13
- package/build/{index-b9bb6c7c.js → index-a779f18f.js} +16 -16
- package/build/{index-6a2937b9.js → index-a791e6ed.js} +15 -15
- package/build/{index-2449c149.js → index-abd798b4.js} +2 -2
- package/build/{index-da512bdd.js → index-b27d9ae9.js} +2 -2
- package/build/{index-f1deef47.js → index-b31cc517.js} +6 -6
- package/build/{index-853ae758.js → index-b7a02d94.js} +1 -1
- package/build/{index-a9901b92.js → index-b87cb307.js} +13 -13
- package/build/{index-ac6de9ad.js → index-b9686acb.js} +24 -24
- package/build/{index-ddf93882.js → index-caf657f0.js} +4 -4
- package/build/{index-7d41114e.js → index-ccf665ff.js} +17 -17
- package/build/{index-02d529c4.js → index-cd093912.js} +3 -3
- package/build/{index-16a23c4b.js → index-d0e0b40c.js} +2 -2
- package/build/{index-8c1cef90.js → index-d4f17e2e.js} +7 -7
- package/build/{index-4d29fcc9.js → index-d8fb2584.js} +10 -10
- package/build/{index-858a2155.js → index-e2ba19dc.js} +3 -3
- package/build/{index-12bf8e75.js → index-e3f12f8b.js} +15 -15
- package/build/{index-6d4c0731.js → index-e51cabfe.js} +1 -1
- package/build/{index-ab526852.js → index-e619f26e.js} +18 -18
- package/build/{index-5378831d.js → index-ef455213.js} +2 -2
- package/build/{index-474ff0ab.js → index-f24c98ff.js} +2 -2
- package/build/{index-3ecc913a.js → index-f629251e.js} +3 -3
- package/build/index.js +111 -111
- package/build/{index.styles-bac5c293.js → index.styles-ce54c619.js} +1 -1
- package/build/{labelSorting-0d8d4fab.js → labelSorting-57c9c711.js} +4 -4
- package/build/lead.js +23 -23
- package/build/{logoIcon-4275e2ee.js → logoIcon-e3454ad7.js} +2 -2
- package/build/mantine.js +21 -21
- package/build/misc.js +16 -16
- package/build/miscGetDynamicHealthTool.js +4 -4
- package/build/miscGetSocialList.js +8 -8
- package/build/miscScreenSizeContext.js +1 -1
- package/build/mobileBottomNavigation.js +5 -5
- package/build/mobileBottomNavigationIcon.js +5 -5
- package/build/molecules.js +68 -68
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +16 -16
- package/build/navigation.js +40 -40
- package/build/navigationLogoutPopup.js +9 -9
- package/build/navigationProfileButton.js +23 -23
- package/build/onboardingV2.js +28 -28
- package/build/organisms.js +44 -44
- package/build/{post-ffe4ccf0.js → post-ebb40235.js} +2 -2
- package/build/profileNavigation.js +19 -19
- package/build/progressBar.js +1 -1
- package/build/pwg.js +22 -22
- package/build/ssoV2/screens/passwordForgotSetup/passwordWithConfirm.d.ts +2 -1
- package/build/ssoV2/screens/setup/otherSetup.d.ts +2 -1
- package/build/ssoV2.js +716 -581
- package/build/{store-40beac07.js → store-eb3db02c.js} +8 -7
- package/build/subot.js +32 -32
- package/build/surveyOrPremiumBanner.js +30 -30
- package/build/surveyQuestionCard.js +10 -10
- package/build/{surveyThankyouCard-471da14c.js → surveyThankyouCard-ff2f48ca.js} +5 -5
- package/build/together.js +52 -52
- package/build/togetherApiUtils.js +4 -4
- package/build/togetherAtoms.js +30 -30
- package/build/togetherComponentGlobalContext.js +4 -4
- package/build/togetherMolecules.js +47 -47
- package/build/togetherMoleculesCardAuthor.js +27 -27
- package/build/togetherMoleculesPostImagePreview.js +11 -11
- package/build/togetherMoleculesProfileDetail.js +37 -37
- package/build/togetherOrganisms.js +47 -47
- package/build/togetherRichTextEditor.js +17 -17
- package/build/togetherShareBox.js +10 -10
- package/build/{treePopoverMenu-94db16c9.js → treePopoverMenu-171add54.js} +18 -18
- package/build/{types-76a7d4e8.js → types-8f314fb8.js} +2 -2
- package/build/types.js +2 -2
- package/build/{useCategory-708aee4d.js → useCategory-e4e78006.js} +5 -5
- package/build/{useHealthToolCache-ced0bfc1.js → useHealthToolCache-128435ba.js} +1 -1
- package/build/{useMantineLocale-48e8eb6a.js → useMantineLocale-007ccab8.js} +5 -5
- package/build/{usePlacesAutocomplete-80f5d411.js → usePlacesAutocomplete-c451c38a.js} +1 -1
- package/build/useTogetherAuthRequiredAction.js +9 -9
- package/build/{utils-b03a64c1.js → utils-20e377ff.js} +2 -2
- package/build/{utils-be4757fd.js → utils-379e7279.js} +3 -3
- package/build/{utils-f7c5ea01.js → utils-a9c8fcd4.js} +2 -2
- package/build/vaccination.js +21 -21
- package/package.json +1 -1
- /package/build/{BMI_BOYS.percentile.monthly-e4513929.js → BMI_BOYS.percentile.monthly-554402f6.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-be963b08.js → BMI_BOYS.percentile.weekly-5accdab8.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-ded25305.js → BMI_BOYS.percentile.yearly-8927c0b7.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-c32f1226.js → BMI_BOYS.zscore.monthly-c32e4540.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-76745bbd.js → BMI_BOYS.zscore.weekly-d74eca40.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-8f1c9fee.js → BMI_BOYS.zscore.yearly-2916859f.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-2b836209.js → BMI_GIRLS.percentile.monthly-f938866d.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-7682b921.js → BMI_GIRLS.percentile.weekly-14b55147.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-78eef266.js → BMI_GIRLS.percentile.yearly-f3083b81.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-a8e1ab8b.js → BMI_GIRLS.zscore.monthly-6dd24bd6.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-738c8470.js → BMI_GIRLS.zscore.weekly-28451888.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-02c15a3e.js → BMI_GIRLS.zscore.yearly-3c519c16.js} +0 -0
- /package/build/{ChevronDown-bbfcbd87.js → ChevronDown-ea4140e2.js} +0 -0
- /package/build/{Close-517a91c4.js → Close-e871e5ea.js} +0 -0
- /package/build/{Google-52f5af1b.js → Google-98731b6c.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-3c7a89b9.js → HEAD CIRCUM_BOYS.percentile.monthly-4d9fd96e.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-eb24061d.js → HEAD CIRCUM_BOYS.percentile.weekly-50d795dd.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-b9f379c4.js → HEAD CIRCUM_BOYS.percentile.yearly-d91a1dce.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-5f408f6e.js → HEAD CIRCUM_BOYS.zscore.monthly-ff578f6c.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-5f0619ed.js → HEAD CIRCUM_BOYS.zscore.weekly-8c30f992.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-f466d74a.js → HEAD CIRCUM_BOYS.zscore.yearly-600e4599.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-a54bafe8.js → HEAD CIRCUM_GIRLS.percentile.monthly-207f0aee.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-afa7cafa.js → HEAD CIRCUM_GIRLS.percentile.weekly-bd2d67b5.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-827f9111.js → HEAD CIRCUM_GIRLS.percentile.yearly-436b4066.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-d922c7bb.js → HEAD CIRCUM_GIRLS.zscore.monthly-e965b777.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-6234df1d.js → HEAD CIRCUM_GIRLS.zscore.weekly-75e4a995.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-d3aead2a.js → HEAD CIRCUM_GIRLS.zscore.yearly-1d77c810.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-b9da212f.js → HEIGHT_BOYS.percentile.monthly-5508d1a9.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-df732ffa.js → HEIGHT_BOYS.percentile.weekly-b914f451.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-38b97a72.js → HEIGHT_BOYS.percentile.yearly-2e1143f4.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-299efd0d.js → HEIGHT_BOYS.zscore.monthly-17af58d2.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-0a680f60.js → HEIGHT_BOYS.zscore.weekly-939b7816.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-04f5bb56.js → HEIGHT_BOYS.zscore.yearly-808a3c32.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-86ce47a8.js → HEIGHT_GIRLS.percentile.monthly-71faf8ec.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-87e9c07b.js → HEIGHT_GIRLS.percentile.weekly-60e14a04.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-6d7886a0.js → HEIGHT_GIRLS.percentile.yearly-c269e45b.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-7633350a.js → HEIGHT_GIRLS.zscore.monthly-cae4a2c9.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-69b7cdb2.js → HEIGHT_GIRLS.zscore.weekly-adfc265f.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-223c2399.js → HEIGHT_GIRLS.zscore.yearly-408dfc54.js} +0 -0
- /package/build/{Locale-f7f03ebc.js → Locale-8e589472.js} +0 -0
- /package/build/{Visible-1974b647.js → Visible-d2564bc1.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-f53de12f.js → WEIGHT_BOYS.percentile.monthly-586fe627.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-5501bf5f.js → WEIGHT_BOYS.percentile.weekly-c6ff4005.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-efd2ce79.js → WEIGHT_BOYS.percentile.yearly-e96c07e6.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-dacf86cb.js → WEIGHT_BOYS.zscore.monthly-28013af2.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-04bd9e0d.js → WEIGHT_BOYS.zscore.weekly-b689cb29.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-f00de0ae.js → WEIGHT_BOYS.zscore.yearly-7ebff255.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-39ccbe36.js → WEIGHT_GIRLS.percentile.monthly-f2d86102.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-a19f4dea.js → WEIGHT_GIRLS.percentile.weekly-9ea35cac.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-45a1cde0.js → WEIGHT_GIRLS.percentile.yearly-c5c8b8ae.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-ff9d5c34.js → WEIGHT_GIRLS.zscore.monthly-67100cc7.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-5d0d7256.js → WEIGHT_GIRLS.zscore.weekly-dccd551b.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-70fd1d50.js → WEIGHT_GIRLS.zscore.yearly-5be116be.js} +0 -0
- /package/build/{animation-3ab9b09b.js → animation-ace3639c.js} +0 -0
- /package/build/{constants-6f5dcaa8.js → constants-04b55b51.js} +0 -0
- /package/build/{constants-2c42beaf.js → constants-56b9a4c4.js} +0 -0
- /package/build/{constants-d5425e28.js → constants-c846ef9b.js} +0 -0
- /package/build/{dataTransform-6abf7695.js → dataTransform-c0185566.js} +0 -0
- /package/build/{doctor-8007b5c4.js → doctor-b649b02f.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-91bffff3.js → BMI_BOYS.percentile.monthly-7232b38e.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-3bd76db2.js → BMI_BOYS.percentile.weekly-8f5c9469.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-7d09f91d.js → BMI_BOYS.percentile.yearly-09f5390c.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-edaa2fd0.js → BMI_BOYS.zscore.monthly-68060fc0.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-7697f15e.js → BMI_BOYS.zscore.weekly-0ae9769c.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-2a8080e3.js → BMI_BOYS.zscore.yearly-24c93ccd.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-f23e498f.js → BMI_GIRLS.percentile.monthly-721e6b54.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-0d2a8aa6.js → BMI_GIRLS.percentile.weekly-abd1231a.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-4a3c09c0.js → BMI_GIRLS.percentile.yearly-fa1b5ea0.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-1fdff88e.js → BMI_GIRLS.zscore.monthly-d533e7b2.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-1e293897.js → BMI_GIRLS.zscore.weekly-26d70825.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-86af97d1.js → BMI_GIRLS.zscore.yearly-996e4c80.js} +0 -0
- /package/build/esm/{ChevronDown-635295f5.js → ChevronDown-8d75a053.js} +0 -0
- /package/build/esm/{Close-8b8ba510.js → Close-7324a458.js} +0 -0
- /package/build/esm/{Google-61e99a72.js → Google-e9a0164b.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-e3249af6.js → HEAD CIRCUM_BOYS.percentile.monthly-91db3bcd.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-11051d5d.js → HEAD CIRCUM_BOYS.percentile.weekly-fcdaa100.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-e7493a7f.js → HEAD CIRCUM_BOYS.percentile.yearly-171f259a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-692e688c.js → HEAD CIRCUM_BOYS.zscore.monthly-7cd46960.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-e6999588.js → HEAD CIRCUM_BOYS.zscore.weekly-d780b979.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-7df3afe5.js → HEAD CIRCUM_BOYS.zscore.yearly-dc3800c1.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-51b82c60.js → HEAD CIRCUM_GIRLS.percentile.monthly-22e8c2fc.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-af5e0528.js → HEAD CIRCUM_GIRLS.percentile.weekly-705d806e.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-f0f89e89.js → HEAD CIRCUM_GIRLS.percentile.yearly-40015a8d.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-355558eb.js → HEAD CIRCUM_GIRLS.zscore.monthly-9ce2a230.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-cea6092e.js → HEAD CIRCUM_GIRLS.zscore.weekly-36485328.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-2ba22f0e.js → HEAD CIRCUM_GIRLS.zscore.yearly-286373e5.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-1e67dd70.js → HEIGHT_BOYS.percentile.monthly-e84e9d0b.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-285867e4.js → HEIGHT_BOYS.percentile.weekly-724ce36b.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-92340993.js → HEIGHT_BOYS.percentile.yearly-5c27be61.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-689be31e.js → HEIGHT_BOYS.zscore.monthly-6ad245ff.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-3360d8a7.js → HEIGHT_BOYS.zscore.weekly-c1e3c10d.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-aeb08b84.js → HEIGHT_BOYS.zscore.yearly-6cc90554.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-2097e103.js → HEIGHT_GIRLS.percentile.monthly-2b95b9ad.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-8ee7cd79.js → HEIGHT_GIRLS.percentile.weekly-dbb8d5b0.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-9ded5077.js → HEIGHT_GIRLS.percentile.yearly-0248f67b.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-16d4b538.js → HEIGHT_GIRLS.zscore.monthly-3c1706b7.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-468664ba.js → HEIGHT_GIRLS.zscore.weekly-98a4e57b.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-ec6ab79a.js → HEIGHT_GIRLS.zscore.yearly-b757f7b6.js} +0 -0
- /package/build/esm/{Locale-8d44445f.js → Locale-90e9a3c9.js} +0 -0
- /package/build/esm/{Visible-2667dc49.js → Visible-5cd57939.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-fe8207fa.js → WEIGHT_BOYS.percentile.monthly-a320ba80.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-8b046e3f.js → WEIGHT_BOYS.percentile.weekly-d690dfd8.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-151d76ee.js → WEIGHT_BOYS.percentile.yearly-13d33e83.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-27b35521.js → WEIGHT_BOYS.zscore.monthly-c90087bc.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-0e05f57b.js → WEIGHT_BOYS.zscore.weekly-5220c234.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-07961936.js → WEIGHT_BOYS.zscore.yearly-10611b21.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-7e80fc0c.js → WEIGHT_GIRLS.percentile.monthly-e3e3f8e5.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-c9670404.js → WEIGHT_GIRLS.percentile.weekly-7c6df609.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-3edc1492.js → WEIGHT_GIRLS.percentile.yearly-76ec0ce1.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-edc88455.js → WEIGHT_GIRLS.zscore.monthly-e32cad1f.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-18f55612.js → WEIGHT_GIRLS.zscore.weekly-452ce352.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-dc452b25.js → WEIGHT_GIRLS.zscore.yearly-e6f4c062.js} +0 -0
- /package/build/esm/{animation-96a13abb.js → animation-4f461af5.js} +0 -0
- /package/build/esm/{constants-cedf6314.js → constants-21fa310e.js} +0 -0
- /package/build/esm/{constants-cba1e163.js → constants-a2b4a41c.js} +0 -0
- /package/build/esm/{constants-2d45a9d9.js → constants-bc758df2.js} +0 -0
- /package/build/esm/{dataTransform-ec83e3f6.js → dataTransform-0877e41c.js} +0 -0
- /package/build/esm/{doctor-8f08052b.js → doctor-2b91fc17.js} +0 -0
- /package/build/esm/{index-ae2aff3a.js → index-0ad4d4a8.js} +0 -0
- /package/build/esm/{index-cec3f424.js → index-0bfab592.js} +0 -0
- /package/build/esm/{index-a3e800f4.js → index-2350bd05.js} +0 -0
- /package/build/esm/{index-66e76212.js → index-3c30b2d7.js} +0 -0
- /package/build/esm/{index-5d6f27b3.js → index-619b04de.js} +0 -0
- /package/build/esm/{index-34dddec0.js → index-863dc32d.js} +0 -0
- /package/build/esm/{index-44b27a73.js → index-872d2e92.js} +0 -0
- /package/build/esm/{index-250f0afd.js → index-bf2c8341.js} +0 -0
- /package/build/esm/{localizeNumberFormat-c8d3f14e.js → localizeNumberFormat-59bb213a.js} +0 -0
- /package/build/esm/{normalizeLink-aa88d767.js → normalizeLink-76ffb98c.js} +0 -0
- /package/build/esm/{other-54672859.js → other-1ccded8c.js} +0 -0
- /package/build/esm/{paths-a823a6b3.js → paths-f51a5898.js} +0 -0
- /package/build/esm/{translationsContext-45d92bdb.js → translationsContext-08e9c793.js} +0 -0
- /package/build/esm/{tslib.es6-a95a1380.js → tslib.es6-fabffebd.js} +0 -0
- /package/build/esm/{types-d01bd430.js → types-3a8181aa.js} +0 -0
- /package/build/esm/{useIsInit-35630f84.js → useIsInit-c767b6d8.js} +0 -0
- /package/build/esm/{useOutsideClick-55d2f9fc.js → useOutsideClick-9d6bcb0b.js} +0 -0
- /package/build/esm/{useScrollbarSize-08b20042.js → useScrollbarSize-1541f8d1.js} +0 -0
- /package/build/esm/{useUniqueId-4904bb63.js → useUniqueId-7a3045f0.js} +0 -0
- /package/build/esm/{utils-40ab4114.js → utils-a1df0ee3.js} +0 -0
- /package/build/{index-1c8de619.js → index-042d164d.js} +0 -0
- /package/build/{index-c0e9b08a.js → index-0f40af3c.js} +0 -0
- /package/build/{index-39de83bb.js → index-0fa569ad.js} +0 -0
- /package/build/{index-c084a9e1.js → index-4c3af476.js} +0 -0
- /package/build/{index-091d8bb0.js → index-56ee99d1.js} +0 -0
- /package/build/{index-7f0cbc70.js → index-c16a5b0a.js} +0 -0
- /package/build/{index-c78a2dca.js → index-dab38afb.js} +0 -0
- /package/build/{index-e34ec724.js → index-ee625fd2.js} +0 -0
- /package/build/{localizeNumberFormat-1fb5cda2.js → localizeNumberFormat-39d7d2cf.js} +0 -0
- /package/build/{normalizeLink-d35d8d15.js → normalizeLink-399db560.js} +0 -0
- /package/build/{other-18de93d8.js → other-050b910e.js} +0 -0
- /package/build/{paths-987c6bc6.js → paths-4f1d5463.js} +0 -0
- /package/build/{translationsContext-0b5b6d26.js → translationsContext-51eda546.js} +0 -0
- /package/build/{tslib.es6-d836fe39.js → tslib.es6-a2ac1e35.js} +0 -0
- /package/build/{types-8c7e8cb0.js → types-fa3b5ef9.js} +0 -0
- /package/build/{useIsInit-e13fef8a.js → useIsInit-b0ce5dd2.js} +0 -0
- /package/build/{useOutsideClick-0a222a3c.js → useOutsideClick-5149ba07.js} +0 -0
- /package/build/{useScrollbarSize-b71d789f.js → useScrollbarSize-436dae58.js} +0 -0
- /package/build/{useUniqueId-9b4de13d.js → useUniqueId-86ea2151.js} +0 -0
- /package/build/{utils-ae52e1c9.js → utils-1d4e8507.js} +0 -0
package/build/ssoV2.js
CHANGED
|
@@ -2,51 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('./tslib.es6-
|
|
5
|
+
var tslib_es6 = require('./tslib.es6-a2ac1e35.js');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var index$5 = require('./index-
|
|
7
|
+
var index$5 = require('./index-3a6ab9f1.js');
|
|
8
8
|
var arrow = require('@hhgtech/icons/arrow');
|
|
9
9
|
var core$1 = require('@hhgtech/icons/core');
|
|
10
|
-
var logoIcon = require('./logoIcon-
|
|
11
|
-
var index$3 = require('./index-
|
|
12
|
-
var index$1 = require('./index-
|
|
10
|
+
var logoIcon = require('./logoIcon-e3454ad7.js');
|
|
11
|
+
var index$3 = require('./index-b7a02d94.js');
|
|
12
|
+
var index$1 = require('./index-7b63ccf0.js');
|
|
13
13
|
var core = require('@mantine/core');
|
|
14
14
|
require('@mantine/dates');
|
|
15
|
-
var index$4 = require('./index-
|
|
16
|
-
require('./index-
|
|
17
|
-
require('./index-
|
|
18
|
-
var useMantineLocale = require('./useMantineLocale-
|
|
19
|
-
var index$2 = require('./index-
|
|
20
|
-
var index = require('./index-
|
|
15
|
+
var index$4 = require('./index-b27d9ae9.js');
|
|
16
|
+
require('./index-9924041d.js');
|
|
17
|
+
require('./index-56ee99d1.js');
|
|
18
|
+
var useMantineLocale = require('./useMantineLocale-007ccab8.js');
|
|
19
|
+
var index$2 = require('./index-abd798b4.js');
|
|
20
|
+
var index = require('./index-4f2da132.js');
|
|
21
21
|
require('@mantine/hooks');
|
|
22
|
-
require('./utils-
|
|
23
|
-
require('./other-
|
|
24
|
-
require('./index-
|
|
25
|
-
var Locale = require('./Locale-
|
|
26
|
-
var store = require('./store-
|
|
27
|
-
var Google = require('./Google-
|
|
22
|
+
require('./utils-1d4e8507.js');
|
|
23
|
+
require('./other-050b910e.js');
|
|
24
|
+
require('./index-30a885a2.js');
|
|
25
|
+
var Locale = require('./Locale-8e589472.js');
|
|
26
|
+
var store = require('./store-eb3db02c.js');
|
|
27
|
+
var Google = require('./Google-98731b6c.js');
|
|
28
28
|
var styled = require('@emotion/styled');
|
|
29
|
-
var utils = require('./utils-
|
|
29
|
+
var utils = require('./utils-a9c8fcd4.js');
|
|
30
30
|
var constantsDomainLocales = require('./constantsDomainLocales.js');
|
|
31
31
|
var form = require('@mantine/form');
|
|
32
32
|
var yup = require('yup');
|
|
33
33
|
var dayjs = require('dayjs');
|
|
34
|
-
var index$6 = require('./index-
|
|
34
|
+
var index$6 = require('./index-b31cc517.js');
|
|
35
35
|
require('@hhgtech/icons/other');
|
|
36
|
-
require('./index.styles-
|
|
36
|
+
require('./index.styles-ce54c619.js');
|
|
37
37
|
require('@mantine/carousel');
|
|
38
38
|
require('./miscTheme.js');
|
|
39
|
-
require('./index-
|
|
39
|
+
require('./index-48237a4e.js');
|
|
40
40
|
require('classnames');
|
|
41
|
-
require('./useUniqueId-
|
|
41
|
+
require('./useUniqueId-86ea2151.js');
|
|
42
42
|
require('./constantsSite.js');
|
|
43
43
|
require('date-fns/locale');
|
|
44
44
|
require('./constantsRiskScreener.js');
|
|
45
45
|
require('./constantsIsProduction.js');
|
|
46
46
|
require('@mantine/notifications');
|
|
47
|
-
require('./translationsContext-
|
|
47
|
+
require('./translationsContext-51eda546.js');
|
|
48
48
|
require('zustand');
|
|
49
|
-
require('./normalizeLink-
|
|
49
|
+
require('./normalizeLink-399db560.js');
|
|
50
50
|
require('./miscCookieHelper.js');
|
|
51
51
|
|
|
52
52
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -374,6 +374,7 @@ const getErrorTextFromCode = (t, code) => {
|
|
|
374
374
|
|
|
375
375
|
const SSOEmailScreen = ({ hidden, }) => {
|
|
376
376
|
const { t } = index.useTranslations();
|
|
377
|
+
const [loading, setLoading] = React__default["default"].useState(false);
|
|
377
378
|
const [errMsg, setErrMsg] = React__default["default"].useState('');
|
|
378
379
|
const { addStep, goNext, setShareData } = store.useSSOSteps();
|
|
379
380
|
return (React__default["default"].createElement("form", { style: {
|
|
@@ -381,65 +382,73 @@ const SSOEmailScreen = ({ hidden, }) => {
|
|
|
381
382
|
}, onSubmit: (e) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
382
383
|
var _a, _b, _c;
|
|
383
384
|
e.preventDefault();
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
setShareData({
|
|
394
|
-
authMethod: 'mail',
|
|
395
|
-
authFlow: 'login',
|
|
396
|
-
});
|
|
397
|
-
// go to password screen
|
|
398
|
-
addStep({
|
|
399
|
-
type: store.SSOStepTypeType.PASSWORD,
|
|
400
|
-
config: {
|
|
401
|
-
email,
|
|
402
|
-
},
|
|
403
|
-
});
|
|
404
|
-
goNext();
|
|
405
|
-
}
|
|
406
|
-
else {
|
|
407
|
-
let res;
|
|
408
|
-
setShareData({
|
|
409
|
-
authMethod: 'mail',
|
|
410
|
-
authFlow: 'register',
|
|
411
|
-
});
|
|
412
|
-
if (!((_c = existRes._data) === null || _c === void 0 ? void 0 : _c.provider)) {
|
|
413
|
-
res = yield registerBySendEmailOTP(email);
|
|
385
|
+
setLoading(true);
|
|
386
|
+
try {
|
|
387
|
+
const email = e.currentTarget.email.value;
|
|
388
|
+
const existRes = yield store.checkUserExist({ email });
|
|
389
|
+
if ((existRes === null || existRes === void 0 ? void 0 : existRes._status) === 1) {
|
|
390
|
+
const provider = (_a = existRes._data) === null || _a === void 0 ? void 0 : _a.provider;
|
|
391
|
+
if (provider === 'google' || provider === 'facebook') {
|
|
392
|
+
setErrMsg(t('ssov2.useOtherMethod.email'));
|
|
393
|
+
return setLoading(false);
|
|
414
394
|
}
|
|
415
|
-
|
|
416
|
-
|
|
395
|
+
if ((_b = existRes._data) === null || _b === void 0 ? void 0 : _b.is_pass) {
|
|
396
|
+
setShareData({
|
|
397
|
+
authMethod: 'mail',
|
|
398
|
+
authFlow: 'login',
|
|
399
|
+
});
|
|
400
|
+
// go to password screen
|
|
401
|
+
addStep({
|
|
402
|
+
type: store.SSOStepTypeType.PASSWORD,
|
|
403
|
+
config: {
|
|
404
|
+
email,
|
|
405
|
+
},
|
|
406
|
+
});
|
|
407
|
+
goNext();
|
|
417
408
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
409
|
+
else {
|
|
410
|
+
let res;
|
|
411
|
+
setShareData({
|
|
412
|
+
authMethod: 'mail',
|
|
413
|
+
authFlow: 'register',
|
|
414
|
+
});
|
|
415
|
+
if (!((_c = existRes._data) === null || _c === void 0 ? void 0 : _c.provider)) {
|
|
416
|
+
res = yield registerBySendEmailOTP(email);
|
|
417
|
+
}
|
|
418
|
+
else {
|
|
419
|
+
res = yield resendEmailOTP(email);
|
|
420
|
+
}
|
|
421
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
422
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
423
|
+
return setLoading(false);
|
|
424
|
+
}
|
|
425
|
+
// go to register screen
|
|
426
|
+
addStep({
|
|
427
|
+
type: store.SSOStepTypeType.OTP,
|
|
428
|
+
config: {
|
|
429
|
+
email,
|
|
430
|
+
otpType: 'email',
|
|
431
|
+
afterAction: 'setup',
|
|
432
|
+
},
|
|
433
|
+
});
|
|
434
|
+
goNext();
|
|
421
435
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
config: {
|
|
426
|
-
email,
|
|
427
|
-
otpType: 'email',
|
|
428
|
-
afterAction: 'setup',
|
|
429
|
-
},
|
|
430
|
-
});
|
|
431
|
-
goNext();
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
setErrMsg(getErrorTextFromCode(t, existRes === null || existRes === void 0 ? void 0 : existRes.code));
|
|
432
439
|
}
|
|
433
440
|
}
|
|
434
|
-
|
|
435
|
-
|
|
441
|
+
catch (e) {
|
|
442
|
+
console.error(e);
|
|
443
|
+
setErrMsg(getErrorTextFromCode(t, ''));
|
|
436
444
|
}
|
|
445
|
+
setLoading(false);
|
|
437
446
|
}) },
|
|
438
447
|
React__default["default"].createElement(core.Stack, { spacing: 8 },
|
|
439
448
|
React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, t('ssov2.email.title')),
|
|
440
449
|
React__default["default"].createElement(index$2.Text, { size: "p4" }, t('ssov2.email.description'))),
|
|
441
|
-
React__default["default"].createElement(index$5.Input, { name: "email", placeholder: "Email c\u1EE7a b\u1EA1n", error: errMsg || undefined, type: "email", required: true, mt: 24 }),
|
|
442
|
-
React__default["default"].createElement(index$3.Button, { type: "submit", size: "lg", variant: "primary", fullWidth: true, mt: 16 }, t('ssov2.email.button'))));
|
|
450
|
+
React__default["default"].createElement(index$5.Input, { name: "email", placeholder: "Email c\u1EE7a b\u1EA1n", error: errMsg || undefined, type: "email", required: true, mt: 24, disabled: loading, onChange: () => setErrMsg('') }),
|
|
451
|
+
React__default["default"].createElement(index$3.Button, { type: "submit", size: "lg", variant: "primary", fullWidth: true, mt: 16, disabled: loading, loading: loading }, t('ssov2.email.button'))));
|
|
443
452
|
};
|
|
444
453
|
|
|
445
454
|
const splitPhone = (phone) => {
|
|
@@ -652,6 +661,8 @@ const SSOFirstScreen = ({ hidden }) => {
|
|
|
652
661
|
const { locale, onClose } = useSSOState();
|
|
653
662
|
const { addStep, goNext, setShareData } = store.useSSOSteps();
|
|
654
663
|
const { t } = index.useTranslations();
|
|
664
|
+
const [loading, setLoading] = React__default["default"].useState(false);
|
|
665
|
+
const [loadingOverlay, setLoadingOverlay] = React__default["default"].useState(false);
|
|
655
666
|
const handleLoginBySocial = (credential, provider) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
656
667
|
var _c, _d, _e;
|
|
657
668
|
const res = yield loginBySocial(credential, provider);
|
|
@@ -739,17 +750,18 @@ const SSOFirstScreen = ({ hidden }) => {
|
|
|
739
750
|
}, []);
|
|
740
751
|
const onClickContinueZalo = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
741
752
|
var _f, _g;
|
|
753
|
+
setLoading(true);
|
|
742
754
|
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
743
755
|
if (!areaCode || !phoneNumber || !phone) {
|
|
744
756
|
setErrMsg(t('ssov2.validate.phone.required'));
|
|
745
|
-
return;
|
|
757
|
+
return setLoading(false);
|
|
746
758
|
}
|
|
747
759
|
const userExist = yield store.checkUserExist({ phone: phoneNumber });
|
|
748
760
|
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
749
761
|
const provider = (_f = userExist._data) === null || _f === void 0 ? void 0 : _f.provider;
|
|
750
762
|
if (provider === 'google' || provider === 'facebook') {
|
|
751
763
|
setErrMsg(t('ssov2.useOtherMethod.phone'));
|
|
752
|
-
return;
|
|
764
|
+
return setLoading(false);
|
|
753
765
|
}
|
|
754
766
|
setShareData({
|
|
755
767
|
authMethod: 'phone',
|
|
@@ -774,7 +786,7 @@ const SSOFirstScreen = ({ hidden }) => {
|
|
|
774
786
|
}
|
|
775
787
|
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
776
788
|
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
777
|
-
return;
|
|
789
|
+
return setLoading(false);
|
|
778
790
|
}
|
|
779
791
|
setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'register' })));
|
|
780
792
|
addStep({
|
|
@@ -791,20 +803,22 @@ const SSOFirstScreen = ({ hidden }) => {
|
|
|
791
803
|
else {
|
|
792
804
|
setErrMsg(getErrorTextFromCode(t, userExist === null || userExist === void 0 ? void 0 : userExist.code));
|
|
793
805
|
}
|
|
806
|
+
setLoading(false);
|
|
794
807
|
});
|
|
795
808
|
const onClickContinuePhone = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
796
809
|
var _h, _j;
|
|
810
|
+
setLoading(true);
|
|
797
811
|
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
798
812
|
if (!areaCode || !phoneNumber || !phone) {
|
|
799
813
|
setErrMsg(t('ssov2.validate.phone.required'));
|
|
800
|
-
return;
|
|
814
|
+
return setLoading(false);
|
|
801
815
|
}
|
|
802
816
|
const userExist = yield store.checkUserExist({ phone: phoneNumber });
|
|
803
817
|
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
804
818
|
const provider = (_h = userExist._data) === null || _h === void 0 ? void 0 : _h.provider;
|
|
805
819
|
if (provider === 'google' || provider === 'facebook') {
|
|
806
820
|
setErrMsg(t('ssov2.useOtherMethod.phone'));
|
|
807
|
-
return;
|
|
821
|
+
return setLoading(false);
|
|
808
822
|
}
|
|
809
823
|
setShareData({
|
|
810
824
|
authMethod: 'phone',
|
|
@@ -829,7 +843,7 @@ const SSOFirstScreen = ({ hidden }) => {
|
|
|
829
843
|
}
|
|
830
844
|
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
831
845
|
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
832
|
-
return;
|
|
846
|
+
return setLoading(false);
|
|
833
847
|
}
|
|
834
848
|
setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'register' })));
|
|
835
849
|
addStep({
|
|
@@ -846,6 +860,7 @@ const SSOFirstScreen = ({ hidden }) => {
|
|
|
846
860
|
else {
|
|
847
861
|
setErrMsg(getErrorTextFromCode(t, userExist === null || userExist === void 0 ? void 0 : userExist.code));
|
|
848
862
|
}
|
|
863
|
+
setLoading(false);
|
|
849
864
|
});
|
|
850
865
|
const onClickEmail = () => {
|
|
851
866
|
setShareData({
|
|
@@ -858,26 +873,39 @@ const SSOFirstScreen = ({ hidden }) => {
|
|
|
858
873
|
goNext();
|
|
859
874
|
};
|
|
860
875
|
const onTriggerGoogleLogin = () => {
|
|
876
|
+
setLoadingOverlay(true);
|
|
861
877
|
const client = window.google.accounts.oauth2.initTokenClient({
|
|
862
878
|
client_id: store.GoogleAuthClientId,
|
|
863
879
|
scope: 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile openid',
|
|
864
880
|
ux_mode: 'popup',
|
|
865
|
-
callback: (response) => {
|
|
866
|
-
|
|
881
|
+
callback: (response) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
882
|
+
if (response.access_token) {
|
|
883
|
+
yield handleLoginBySocial(response.access_token, 'google');
|
|
884
|
+
}
|
|
885
|
+
else {
|
|
886
|
+
setErrMsg(t('ssov2.error.googleLogin'));
|
|
887
|
+
}
|
|
888
|
+
setLoadingOverlay(false);
|
|
889
|
+
}),
|
|
890
|
+
error_callback: () => {
|
|
891
|
+
setErrMsg(t('ssov2.error.googleLogin'));
|
|
892
|
+
setLoadingOverlay(false);
|
|
867
893
|
},
|
|
868
894
|
});
|
|
869
895
|
client === null || client === void 0 ? void 0 : client.requestAccessToken();
|
|
870
896
|
};
|
|
871
897
|
const onTriggerFacebookLogin = () => {
|
|
898
|
+
setLoadingOverlay(true);
|
|
872
899
|
window.FB.login(function (response) {
|
|
873
900
|
var _a;
|
|
874
901
|
return tslib_es6.__awaiter(this, void 0, void 0, function* () {
|
|
875
902
|
if ((_a = response === null || response === void 0 ? void 0 : response.authResponse) === null || _a === void 0 ? void 0 : _a.accessToken) {
|
|
876
|
-
handleLoginBySocial(response.authResponse.accessToken, 'facebook');
|
|
903
|
+
yield handleLoginBySocial(response.authResponse.accessToken, 'facebook');
|
|
877
904
|
}
|
|
878
905
|
else {
|
|
879
906
|
setErrMsg(t('ssov2.error.facebookLogin'));
|
|
880
907
|
}
|
|
908
|
+
setLoadingOverlay(false);
|
|
881
909
|
});
|
|
882
910
|
}, { scope: 'public_profile,email,user_gender,user_birthday' });
|
|
883
911
|
};
|
|
@@ -886,15 +914,20 @@ const SSOFirstScreen = ({ hidden }) => {
|
|
|
886
914
|
flexDirection: 'column',
|
|
887
915
|
height: '100%',
|
|
888
916
|
} },
|
|
917
|
+
React__default["default"].createElement(core.LoadingOverlay, { visible: loadingOverlay, zIndex: 1000, overlayBlur: 1 }),
|
|
889
918
|
React__default["default"].createElement(core.Stack, { spacing: 8 },
|
|
890
919
|
React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, t('ssov2.first.title')),
|
|
891
920
|
React__default["default"].createElement(index$2.Text, { size: "p4" }, t('ssov2.first.description'))),
|
|
892
921
|
React__default["default"].createElement(core.Stack, { mt: 24, spacing: 24 },
|
|
893
922
|
React__default["default"].createElement(core.Stack, { spacing: 16 },
|
|
894
|
-
React__default["default"].createElement(
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
923
|
+
React__default["default"].createElement("form", { onSubmit: (e) => {
|
|
924
|
+
e.preventDefault();
|
|
925
|
+
onClickContinueZalo();
|
|
926
|
+
} },
|
|
927
|
+
React__default["default"].createElement(index$5.Input.Wrapper, { error: errMsg },
|
|
928
|
+
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", disabled: loading }))),
|
|
929
|
+
React__default["default"].createElement(index$3.Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, loading: loading, disabled: loading }, t('ssov2.button.continueZalo')),
|
|
930
|
+
React__default["default"].createElement(index$3.Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone, loading: loading, disabled: loading }, t('ssov2.button.continueSMS'))),
|
|
898
931
|
React__default["default"].createElement(core.Stack, { spacing: 16, align: "center" },
|
|
899
932
|
React__default["default"].createElement(index$2.Text, { size: "p4" }, t('ssov2.orContinueWith')),
|
|
900
933
|
React__default["default"].createElement(core.Group, { spacing: 24 },
|
|
@@ -969,6 +1002,7 @@ const SSOOTPScreen = ({ hidden, index: index$1, }) => {
|
|
|
969
1002
|
const { t } = index.useTranslations();
|
|
970
1003
|
const { onClose } = useSSOState();
|
|
971
1004
|
const { steps, setSteps, addStep, goNext } = store.useSSOSteps();
|
|
1005
|
+
const [loading, setLoading] = React__default["default"].useState(false);
|
|
972
1006
|
const [otp, setOtp] = React__default["default"].useState('');
|
|
973
1007
|
const [error, setError] = React__default["default"].useState('');
|
|
974
1008
|
const currentStepIndex = index$1;
|
|
@@ -979,197 +1013,225 @@ const SSOOTPScreen = ({ hidden, index: index$1, }) => {
|
|
|
979
1013
|
if (checkResend && resendTime > 0)
|
|
980
1014
|
return;
|
|
981
1015
|
// send otp code logic here
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
if (otpType === 'phone-sms') {
|
|
994
|
-
res = yield resendPhoneOTP(phoneNumber, areaCode);
|
|
995
|
-
}
|
|
996
|
-
else if (otpType === 'phone-zalo') {
|
|
997
|
-
res = yield resendZaloOTP(phoneNumber, areaCode);
|
|
1016
|
+
setLoading(true);
|
|
1017
|
+
try {
|
|
1018
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
1019
|
+
let res;
|
|
1020
|
+
if (isUpdatePhone) {
|
|
1021
|
+
if (otpType === 'phone-sms') {
|
|
1022
|
+
res = yield resendUpdatePhoneOTP(phoneNumber, areaCode);
|
|
1023
|
+
}
|
|
1024
|
+
else if (otpType === 'phone-zalo') {
|
|
1025
|
+
res = yield resendUpdatePhoneZaloOTP(phoneNumber, areaCode);
|
|
1026
|
+
}
|
|
998
1027
|
}
|
|
999
|
-
else
|
|
1000
|
-
|
|
1028
|
+
else {
|
|
1029
|
+
if (otpType === 'phone-sms') {
|
|
1030
|
+
res = yield resendPhoneOTP(phoneNumber, areaCode);
|
|
1031
|
+
}
|
|
1032
|
+
else if (otpType === 'phone-zalo') {
|
|
1033
|
+
res = yield resendZaloOTP(phoneNumber, areaCode);
|
|
1034
|
+
}
|
|
1035
|
+
else if (otpType === 'email') {
|
|
1036
|
+
res = yield resendEmailOTP(email);
|
|
1037
|
+
}
|
|
1038
|
+
else if (otpType === 'update-email') {
|
|
1039
|
+
res = yield resendUpdateEmailOTP();
|
|
1040
|
+
}
|
|
1001
1041
|
}
|
|
1002
|
-
|
|
1003
|
-
|
|
1042
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
1043
|
+
// log error
|
|
1044
|
+
setError(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1045
|
+
return setLoading(false);
|
|
1004
1046
|
}
|
|
1047
|
+
setupResendTimer();
|
|
1005
1048
|
}
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
setError(getErrorTextFromCode(t,
|
|
1009
|
-
return;
|
|
1049
|
+
catch (e) {
|
|
1050
|
+
console.error(e);
|
|
1051
|
+
setError(getErrorTextFromCode(t, ''));
|
|
1010
1052
|
}
|
|
1011
|
-
|
|
1053
|
+
setLoading(false);
|
|
1012
1054
|
});
|
|
1013
1055
|
const submitOtp = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1014
1056
|
var _a, _b;
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1057
|
+
if (!otp || otp.length < 6) {
|
|
1058
|
+
setError(t('ssov2.validate.otp.required'));
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
1061
|
+
setLoading(true);
|
|
1062
|
+
try {
|
|
1063
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
1064
|
+
// submit otp code logic here
|
|
1065
|
+
if (isUpdatePhone) {
|
|
1066
|
+
let res;
|
|
1067
|
+
if (otpType === 'phone-sms') {
|
|
1068
|
+
res = yield verifyUpdatePhoneOTP(areaCode, otp);
|
|
1069
|
+
}
|
|
1070
|
+
else if (otpType === 'phone-zalo') {
|
|
1071
|
+
res = yield verifyUpdatePhoneZaloOTP(phoneNumber, areaCode, otp);
|
|
1072
|
+
}
|
|
1073
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
1074
|
+
if (afterAction === 'setup') {
|
|
1075
|
+
const userInfo = yield store.getUserInfo();
|
|
1076
|
+
if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo._status) !== 1) {
|
|
1077
|
+
// log error
|
|
1078
|
+
setError(getErrorTextFromCode(t, userInfo === null || userInfo === void 0 ? void 0 : userInfo.code));
|
|
1079
|
+
return setLoading(false);
|
|
1080
|
+
}
|
|
1081
|
+
// check if really need setup
|
|
1082
|
+
const noNeedSetup = ((_a = userInfo === null || userInfo === void 0 ? void 0 : userInfo._data) === null || _a === void 0 ? void 0 : _a.id) &&
|
|
1083
|
+
userInfo._data.phone &&
|
|
1084
|
+
userInfo._data.phone_verified_at &&
|
|
1085
|
+
userInfo._data.email &&
|
|
1086
|
+
// userInfo._data.email_verified_at &&
|
|
1087
|
+
!userInfo._data.email.includes('@hhg.com') &&
|
|
1088
|
+
userInfo._data.name &&
|
|
1089
|
+
userInfo._data.birthday &&
|
|
1090
|
+
(typeof userInfo._data.gender === 'number' ||
|
|
1091
|
+
typeof userInfo._data.gender === 'string');
|
|
1092
|
+
if (noNeedSetup) {
|
|
1093
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
1094
|
+
return;
|
|
1095
|
+
}
|
|
1096
|
+
addStep({
|
|
1097
|
+
type: store.SSOStepTypeType.SETUP_FULL,
|
|
1098
|
+
config: {
|
|
1099
|
+
phone,
|
|
1100
|
+
userInfo: userInfo === null || userInfo === void 0 ? void 0 : userInfo._data,
|
|
1101
|
+
},
|
|
1102
|
+
});
|
|
1103
|
+
goNext();
|
|
1032
1104
|
}
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
typeof userInfo._data.gender === 'string');
|
|
1044
|
-
if (noNeedSetup) {
|
|
1045
|
-
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
1046
|
-
return;
|
|
1105
|
+
else if (afterAction === 'submitSetup') {
|
|
1106
|
+
const res = yield store.updateUserInfo(Object.assign(Object.assign({}, setupData), { validate: '' }));
|
|
1107
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
1108
|
+
store.handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
|
|
1109
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
1110
|
+
}
|
|
1111
|
+
else {
|
|
1112
|
+
// log error
|
|
1113
|
+
setError(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1114
|
+
}
|
|
1047
1115
|
}
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
},
|
|
1054
|
-
});
|
|
1055
|
-
goNext();
|
|
1056
|
-
}
|
|
1057
|
-
else if (afterAction === 'submitSetup') {
|
|
1058
|
-
const res = yield store.updateUserInfo(Object.assign(Object.assign({}, setupData), { validate: '' }));
|
|
1059
|
-
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
1060
|
-
store.handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
|
|
1061
|
-
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
1116
|
+
else if (afterAction === 'update-email') {
|
|
1117
|
+
addStep({
|
|
1118
|
+
type: store.SSOStepTypeType.UPDATE_EMAIL,
|
|
1119
|
+
});
|
|
1120
|
+
goNext();
|
|
1062
1121
|
}
|
|
1063
1122
|
else {
|
|
1064
|
-
|
|
1065
|
-
setError(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1123
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
1066
1124
|
}
|
|
1067
1125
|
}
|
|
1068
|
-
else if (afterAction === 'update-email') {
|
|
1069
|
-
addStep({
|
|
1070
|
-
type: store.SSOStepTypeType.UPDATE_EMAIL,
|
|
1071
|
-
});
|
|
1072
|
-
goNext();
|
|
1073
|
-
}
|
|
1074
1126
|
else {
|
|
1075
|
-
|
|
1127
|
+
// log error
|
|
1128
|
+
setError(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1076
1129
|
}
|
|
1130
|
+
return setLoading(false);
|
|
1077
1131
|
}
|
|
1078
|
-
|
|
1132
|
+
let res;
|
|
1133
|
+
if (otpType === 'phone-sms') {
|
|
1134
|
+
res = yield verifyByPhoneOTP(phoneNumber, areaCode, otp);
|
|
1135
|
+
}
|
|
1136
|
+
else if (otpType === 'phone-zalo') {
|
|
1137
|
+
res = yield verifyByZaloOTP(phoneNumber, areaCode, otp);
|
|
1138
|
+
}
|
|
1139
|
+
else if (otpType === 'email') {
|
|
1140
|
+
res = yield verifyByEmailOTP(email, otp);
|
|
1141
|
+
}
|
|
1142
|
+
else if (otpType === 'update-email') {
|
|
1143
|
+
res = yield verifyUpdateEmailOTP(otp);
|
|
1144
|
+
}
|
|
1145
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
1146
|
+
setOtp('');
|
|
1079
1147
|
// log error
|
|
1080
1148
|
setError(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1149
|
+
return setLoading(false);
|
|
1081
1150
|
}
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
res = yield verifyByEmailOTP(email, otp);
|
|
1093
|
-
}
|
|
1094
|
-
else if (otpType === 'update-email') {
|
|
1095
|
-
res = yield verifyUpdateEmailOTP(otp);
|
|
1096
|
-
}
|
|
1097
|
-
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
1098
|
-
setOtp('');
|
|
1099
|
-
// log error
|
|
1100
|
-
setError(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1101
|
-
return;
|
|
1102
|
-
}
|
|
1103
|
-
store.handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
|
|
1104
|
-
// if (otpType === 'update-email') {
|
|
1105
|
-
// onClose?.(true)
|
|
1106
|
-
// return
|
|
1107
|
-
// }
|
|
1108
|
-
if (afterAction === 'forgot') {
|
|
1109
|
-
addStep({
|
|
1110
|
-
type: store.SSOStepTypeType.FORGOT_PASSWORD_SETUP,
|
|
1111
|
-
});
|
|
1112
|
-
goNext();
|
|
1113
|
-
}
|
|
1114
|
-
else if (afterAction === 'setup') {
|
|
1115
|
-
const userInfo = yield store.getUserInfo();
|
|
1116
|
-
if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo._status) !== 1) {
|
|
1117
|
-
// log error
|
|
1118
|
-
setError(getErrorTextFromCode(t, userInfo === null || userInfo === void 0 ? void 0 : userInfo.code));
|
|
1119
|
-
return;
|
|
1151
|
+
store.handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
|
|
1152
|
+
// if (otpType === 'update-email') {
|
|
1153
|
+
// onClose?.(true)
|
|
1154
|
+
// return
|
|
1155
|
+
// }
|
|
1156
|
+
if (afterAction === 'forgot') {
|
|
1157
|
+
addStep({
|
|
1158
|
+
type: store.SSOStepTypeType.FORGOT_PASSWORD_SETUP,
|
|
1159
|
+
});
|
|
1160
|
+
goNext();
|
|
1120
1161
|
}
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
userInfo.
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
userInfo._data.
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1162
|
+
else if (afterAction === 'setup') {
|
|
1163
|
+
const userInfo = yield store.getUserInfo();
|
|
1164
|
+
if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo._status) !== 1) {
|
|
1165
|
+
// log error
|
|
1166
|
+
setError(getErrorTextFromCode(t, userInfo === null || userInfo === void 0 ? void 0 : userInfo.code));
|
|
1167
|
+
return setLoading(false);
|
|
1168
|
+
}
|
|
1169
|
+
// check if really need setup
|
|
1170
|
+
const noNeedSetup = ((_b = userInfo === null || userInfo === void 0 ? void 0 : userInfo._data) === null || _b === void 0 ? void 0 : _b.id) &&
|
|
1171
|
+
userInfo._data.phone &&
|
|
1172
|
+
userInfo._data.phone_verified_at &&
|
|
1173
|
+
userInfo._data.email &&
|
|
1174
|
+
// userInfo._data.email_verified_at &&
|
|
1175
|
+
!userInfo._data.email.includes('@hhg.com') &&
|
|
1176
|
+
userInfo._data.name &&
|
|
1177
|
+
userInfo._data.birthday &&
|
|
1178
|
+
(typeof userInfo._data.gender === 'number' ||
|
|
1179
|
+
typeof userInfo._data.gender === 'string');
|
|
1180
|
+
if (noNeedSetup) {
|
|
1181
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
1182
|
+
return setLoading(false);
|
|
1183
|
+
}
|
|
1184
|
+
addStep({
|
|
1185
|
+
type: store.SSOStepTypeType.SETUP_FULL,
|
|
1186
|
+
config: {
|
|
1187
|
+
phone,
|
|
1188
|
+
userInfo: userInfo === null || userInfo === void 0 ? void 0 : userInfo._data,
|
|
1189
|
+
},
|
|
1190
|
+
});
|
|
1191
|
+
goNext();
|
|
1192
|
+
}
|
|
1193
|
+
else if (afterAction === 'update-email') {
|
|
1194
|
+
addStep({
|
|
1195
|
+
type: store.SSOStepTypeType.UPDATE_EMAIL,
|
|
1196
|
+
});
|
|
1197
|
+
goNext();
|
|
1198
|
+
}
|
|
1199
|
+
else {
|
|
1133
1200
|
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
1134
|
-
return;
|
|
1135
1201
|
}
|
|
1136
|
-
addStep({
|
|
1137
|
-
type: store.SSOStepTypeType.SETUP_FULL,
|
|
1138
|
-
config: {
|
|
1139
|
-
phone,
|
|
1140
|
-
userInfo: userInfo === null || userInfo === void 0 ? void 0 : userInfo._data,
|
|
1141
|
-
},
|
|
1142
|
-
});
|
|
1143
|
-
goNext();
|
|
1144
|
-
}
|
|
1145
|
-
else if (afterAction === 'update-email') {
|
|
1146
|
-
addStep({
|
|
1147
|
-
type: store.SSOStepTypeType.UPDATE_EMAIL,
|
|
1148
|
-
});
|
|
1149
|
-
goNext();
|
|
1150
1202
|
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1203
|
+
catch (e) {
|
|
1204
|
+
console.error(e);
|
|
1205
|
+
setError(getErrorTextFromCode(t, ''));
|
|
1153
1206
|
}
|
|
1207
|
+
setLoading(false);
|
|
1154
1208
|
});
|
|
1155
1209
|
const swapZaloSms = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1156
1210
|
if (isEmail)
|
|
1157
1211
|
return;
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
res
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1212
|
+
setLoading(true);
|
|
1213
|
+
try {
|
|
1214
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
1215
|
+
const newType = otpType === 'phone-sms' ? 'phone-zalo' : 'phone-sms';
|
|
1216
|
+
let res;
|
|
1217
|
+
if (newType === 'phone-sms') {
|
|
1218
|
+
res = yield resendPhoneOTP(phoneNumber, areaCode);
|
|
1219
|
+
}
|
|
1220
|
+
else {
|
|
1221
|
+
res = yield resendZaloOTP(phoneNumber, areaCode);
|
|
1222
|
+
}
|
|
1223
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
1224
|
+
setError(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1225
|
+
return setLoading(false);
|
|
1226
|
+
}
|
|
1227
|
+
setSteps((s) => s.map((step, i) => i === currentStepIndex
|
|
1228
|
+
? Object.assign(Object.assign({}, step), { config: Object.assign(Object.assign({}, step.config), { otpType: newType }) }) : step));
|
|
1166
1229
|
}
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1230
|
+
catch (e) {
|
|
1231
|
+
console.error(e);
|
|
1232
|
+
setError(getErrorTextFromCode(t, ''));
|
|
1170
1233
|
}
|
|
1171
|
-
|
|
1172
|
-
? Object.assign(Object.assign({}, step), { config: Object.assign(Object.assign({}, step.config), { otpType: newType }) }) : step));
|
|
1234
|
+
setLoading(false);
|
|
1173
1235
|
});
|
|
1174
1236
|
const [resendTime, setResendTime] = React__default["default"].useState(30);
|
|
1175
1237
|
const setupResendTimer = () => {
|
|
@@ -1211,7 +1273,10 @@ const SSOOTPScreen = ({ hidden, index: index$1, }) => {
|
|
|
1211
1273
|
} }))),
|
|
1212
1274
|
React__default["default"].createElement(core.Stack, { mt: 24, spacing: 8 },
|
|
1213
1275
|
React__default["default"].createElement(index$5.Input.Wrapper, { error: error },
|
|
1214
|
-
React__default["default"].createElement(index$5.OTP, { value: otp, onChange: (otp) =>
|
|
1276
|
+
React__default["default"].createElement(index$5.OTP, { value: otp, onChange: (otp) => {
|
|
1277
|
+
setOtp(String(otp));
|
|
1278
|
+
setError('');
|
|
1279
|
+
} })),
|
|
1215
1280
|
React__default["default"].createElement(core.Group, { spacing: 8, align: "center", style: {
|
|
1216
1281
|
height: 40,
|
|
1217
1282
|
} },
|
|
@@ -1222,8 +1287,8 @@ const SSOOTPScreen = ({ hidden, index: index$1, }) => {
|
|
|
1222
1287
|
}, size: "s4", color: "blue.6", onClick: () => sendOTPCode(true) }, t('ssov2.otp.resendText', {
|
|
1223
1288
|
count: resendTime,
|
|
1224
1289
|
})))),
|
|
1225
|
-
React__default["default"].createElement(index$3.Button, { type: "submit", size: "lg", variant: "primary", mt: 12, fullWidth: true }, t('ssov2.button.continue')),
|
|
1226
|
-
!isEmail && (React__default["default"].createElement(index$3.Button, { size: "lg", variant: "tertiary", mt: 12, onClick: swapZaloSms, fullWidth: true }, t('ssov2.otp.sendVia', {
|
|
1290
|
+
React__default["default"].createElement(index$3.Button, { type: "submit", size: "lg", variant: "primary", mt: 12, fullWidth: true, disabled: loading, loading: loading }, t('ssov2.button.continue')),
|
|
1291
|
+
!isEmail && (React__default["default"].createElement(index$3.Button, { size: "lg", variant: "tertiary", mt: 12, onClick: swapZaloSms, fullWidth: true, disabled: loading, loading: loading }, t('ssov2.otp.sendVia', {
|
|
1227
1292
|
method: otpType === 'phone-sms' ? 'Zalo' : 'SMS',
|
|
1228
1293
|
})))));
|
|
1229
1294
|
};
|
|
@@ -1233,42 +1298,51 @@ const SSOPasswordScreen = ({ hidden, index: index$1, }) => {
|
|
|
1233
1298
|
const { t } = index.useTranslations();
|
|
1234
1299
|
const { onClose } = useSSOState();
|
|
1235
1300
|
const [errMsg, setErrMsg] = React__default["default"].useState('');
|
|
1301
|
+
const [loading, setLoading] = React__default["default"].useState(false);
|
|
1236
1302
|
const { steps, addStep, goNext, setShareData } = store.useSSOSteps();
|
|
1237
1303
|
const thisStep = steps[index$1];
|
|
1238
1304
|
const phone = (_a = thisStep === null || thisStep === void 0 ? void 0 : thisStep.config) === null || _a === void 0 ? void 0 : _a.phone;
|
|
1239
1305
|
const email = (_b = thisStep === null || thisStep === void 0 ? void 0 : thisStep.config) === null || _b === void 0 ? void 0 : _b.email;
|
|
1240
1306
|
const resetPassword = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1241
1307
|
var _c;
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
});
|
|
1246
|
-
}
|
|
1247
|
-
else {
|
|
1248
|
-
const existRes = yield store.checkUserExist({ email });
|
|
1249
|
-
if ((existRes === null || existRes === void 0 ? void 0 : existRes._status) === 1) {
|
|
1250
|
-
let res;
|
|
1251
|
-
if (!((_c = existRes._data) === null || _c === void 0 ? void 0 : _c.provider)) {
|
|
1252
|
-
res = yield registerBySendEmailOTP(email);
|
|
1253
|
-
}
|
|
1254
|
-
else {
|
|
1255
|
-
res = yield resendEmailOTP(email);
|
|
1256
|
-
}
|
|
1257
|
-
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
1258
|
-
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1259
|
-
return;
|
|
1260
|
-
}
|
|
1308
|
+
setLoading(true);
|
|
1309
|
+
try {
|
|
1310
|
+
if (phone) {
|
|
1261
1311
|
addStep({
|
|
1262
|
-
type: store.SSOStepTypeType.
|
|
1263
|
-
config: {
|
|
1264
|
-
email,
|
|
1265
|
-
otpType: 'email',
|
|
1266
|
-
afterAction: 'forgot',
|
|
1267
|
-
},
|
|
1312
|
+
type: store.SSOStepTypeType.FORGOT_PASSWORD_PHONE,
|
|
1268
1313
|
});
|
|
1269
1314
|
}
|
|
1315
|
+
else {
|
|
1316
|
+
const existRes = yield store.checkUserExist({ email });
|
|
1317
|
+
if ((existRes === null || existRes === void 0 ? void 0 : existRes._status) === 1) {
|
|
1318
|
+
let res;
|
|
1319
|
+
if (!((_c = existRes._data) === null || _c === void 0 ? void 0 : _c.provider)) {
|
|
1320
|
+
res = yield registerBySendEmailOTP(email);
|
|
1321
|
+
}
|
|
1322
|
+
else {
|
|
1323
|
+
res = yield resendEmailOTP(email);
|
|
1324
|
+
}
|
|
1325
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
1326
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1327
|
+
return setLoading(false);
|
|
1328
|
+
}
|
|
1329
|
+
addStep({
|
|
1330
|
+
type: store.SSOStepTypeType.OTP,
|
|
1331
|
+
config: {
|
|
1332
|
+
email,
|
|
1333
|
+
otpType: 'email',
|
|
1334
|
+
afterAction: 'forgot',
|
|
1335
|
+
},
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
goNext();
|
|
1270
1340
|
}
|
|
1271
|
-
|
|
1341
|
+
catch (e) {
|
|
1342
|
+
setErrMsg(getErrorTextFromCode(t, ''));
|
|
1343
|
+
console.error(e);
|
|
1344
|
+
}
|
|
1345
|
+
setLoading(false);
|
|
1272
1346
|
});
|
|
1273
1347
|
const onAuthSuccess = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1274
1348
|
var _d, _e;
|
|
@@ -1291,39 +1365,32 @@ const SSOPasswordScreen = ({ hidden, index: index$1, }) => {
|
|
|
1291
1365
|
});
|
|
1292
1366
|
return (React__default["default"].createElement("form", { style: {
|
|
1293
1367
|
display: hidden ? 'none' : 'block',
|
|
1294
|
-
}, onSubmit: (e) => {
|
|
1368
|
+
}, onSubmit: (e) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1295
1369
|
e.preventDefault();
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1370
|
+
setLoading(true);
|
|
1371
|
+
try {
|
|
1372
|
+
const password = e.currentTarget.password.value;
|
|
1373
|
+
// call api to login with email and password, if fail then show error
|
|
1374
|
+
let res;
|
|
1375
|
+
if (phone) {
|
|
1376
|
+
res = yield loginByPhonePassword(phone, password);
|
|
1377
|
+
}
|
|
1378
|
+
else {
|
|
1379
|
+
res = yield loginByEmailPassword(email, password);
|
|
1380
|
+
}
|
|
1381
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
1382
|
+
yield onAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
|
|
1383
|
+
}
|
|
1384
|
+
else {
|
|
1385
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1386
|
+
}
|
|
1311
1387
|
}
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
1316
|
-
onAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
|
|
1317
|
-
}
|
|
1318
|
-
else {
|
|
1319
|
-
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1320
|
-
}
|
|
1321
|
-
})
|
|
1322
|
-
.catch(() => {
|
|
1323
|
-
setErrMsg(getErrorTextFromCode(t, ''));
|
|
1324
|
-
});
|
|
1388
|
+
catch (e) {
|
|
1389
|
+
setErrMsg(getErrorTextFromCode(t, ''));
|
|
1390
|
+
console.error(e);
|
|
1325
1391
|
}
|
|
1326
|
-
|
|
1392
|
+
setLoading(false);
|
|
1393
|
+
}) },
|
|
1327
1394
|
React__default["default"].createElement(core.Stack, { spacing: 8 },
|
|
1328
1395
|
React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" },
|
|
1329
1396
|
t('ssov2.password.title1'),
|
|
@@ -1331,7 +1398,7 @@ const SSOPasswordScreen = ({ hidden, index: index$1, }) => {
|
|
|
1331
1398
|
t('ssov2.password.title2')),
|
|
1332
1399
|
React__default["default"].createElement(index$2.Text, { size: "p4" }, t('ssov2.password.description'))),
|
|
1333
1400
|
React__default["default"].createElement(core.Stack, { mt: 24, spacing: 8 },
|
|
1334
|
-
React__default["default"].createElement(index$5.PasswordInput, { name: "password", placeholder: "Nh\u1EADp m\u1EADt kh\u1EA9u", error: errMsg || undefined, onChange: () => setErrMsg('') }),
|
|
1401
|
+
React__default["default"].createElement(index$5.PasswordInput, { name: "password", placeholder: "Nh\u1EADp m\u1EADt kh\u1EA9u", error: errMsg || undefined, onChange: () => setErrMsg(''), disabled: loading, required: true }),
|
|
1335
1402
|
React__default["default"].createElement(core.Group, { spacing: 8, align: "center", style: {
|
|
1336
1403
|
height: 40,
|
|
1337
1404
|
} },
|
|
@@ -1339,90 +1406,107 @@ const SSOPasswordScreen = ({ hidden, index: index$1, }) => {
|
|
|
1339
1406
|
React__default["default"].createElement(index$2.Text, { size: "s4", color: "blue.6", style: {
|
|
1340
1407
|
cursor: 'pointer',
|
|
1341
1408
|
}, onClick: resetPassword }, t('ssov2.password.reset')))),
|
|
1342
|
-
React__default["default"].createElement(index$3.Button, { type: "submit", size: "lg", variant: "primary", mt: 12, fullWidth: true }, t('ssov2.password.signIn'))));
|
|
1409
|
+
React__default["default"].createElement(index$3.Button, { type: "submit", size: "lg", variant: "primary", mt: 12, fullWidth: true, disabled: loading, loading: loading }, t('ssov2.password.signIn'))));
|
|
1343
1410
|
};
|
|
1344
1411
|
|
|
1345
1412
|
const SSOPasswordForgotPhone = ({ hidden, }) => {
|
|
1346
1413
|
const { t } = index.useTranslations();
|
|
1347
1414
|
const [phone, setPhone] = React__default["default"].useState('');
|
|
1348
1415
|
const [errMsg, setErrMsg] = React__default["default"].useState('');
|
|
1416
|
+
const [loading, setLoading] = React__default["default"].useState(false);
|
|
1349
1417
|
const { locale } = useSSOState();
|
|
1350
1418
|
const { addStep, goNext, setShareData } = store.useSSOSteps();
|
|
1351
1419
|
const onClickContinueZalo = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1352
1420
|
var _a;
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
1360
|
-
setShareData({
|
|
1361
|
-
authMethod: 'phone',
|
|
1362
|
-
});
|
|
1363
|
-
let res;
|
|
1364
|
-
if (!((_a = userExist._data) === null || _a === void 0 ? void 0 : _a.provider)) {
|
|
1365
|
-
res = yield registerBySendZaloOTP(phoneNumber, areaCode);
|
|
1421
|
+
setLoading(true);
|
|
1422
|
+
try {
|
|
1423
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
1424
|
+
if (!areaCode || !phoneNumber || !phone) {
|
|
1425
|
+
setErrMsg(t('ssov2.validate.phone.required'));
|
|
1426
|
+
return setLoading(false);
|
|
1366
1427
|
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1428
|
+
const userExist = yield store.checkUserExist({ phone: phoneNumber });
|
|
1429
|
+
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
1430
|
+
setShareData({
|
|
1431
|
+
authMethod: 'phone',
|
|
1432
|
+
});
|
|
1433
|
+
let res;
|
|
1434
|
+
if (!((_a = userExist._data) === null || _a === void 0 ? void 0 : _a.provider)) {
|
|
1435
|
+
res = yield registerBySendZaloOTP(phoneNumber, areaCode);
|
|
1436
|
+
}
|
|
1437
|
+
else {
|
|
1438
|
+
res = yield resendZaloOTP(phoneNumber, areaCode);
|
|
1439
|
+
}
|
|
1440
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
1441
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1442
|
+
return setLoading(false);
|
|
1443
|
+
}
|
|
1444
|
+
setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'register' })));
|
|
1445
|
+
addStep({
|
|
1446
|
+
type: store.SSOStepTypeType.OTP,
|
|
1447
|
+
config: {
|
|
1448
|
+
phone,
|
|
1449
|
+
otpType: 'phone-zalo',
|
|
1450
|
+
afterAction: 'forgot',
|
|
1451
|
+
},
|
|
1452
|
+
});
|
|
1453
|
+
goNext();
|
|
1369
1454
|
}
|
|
1370
|
-
|
|
1371
|
-
setErrMsg(getErrorTextFromCode(t,
|
|
1372
|
-
return;
|
|
1455
|
+
else {
|
|
1456
|
+
setErrMsg(getErrorTextFromCode(t, userExist === null || userExist === void 0 ? void 0 : userExist.code));
|
|
1373
1457
|
}
|
|
1374
|
-
setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'register' })));
|
|
1375
|
-
addStep({
|
|
1376
|
-
type: store.SSOStepTypeType.OTP,
|
|
1377
|
-
config: {
|
|
1378
|
-
phone,
|
|
1379
|
-
otpType: 'phone-zalo',
|
|
1380
|
-
afterAction: 'forgot',
|
|
1381
|
-
},
|
|
1382
|
-
});
|
|
1383
|
-
goNext();
|
|
1384
1458
|
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1459
|
+
catch (e) {
|
|
1460
|
+
console.error(e);
|
|
1461
|
+
setErrMsg(getErrorTextFromCode(t, ''));
|
|
1387
1462
|
}
|
|
1463
|
+
setLoading(false);
|
|
1388
1464
|
});
|
|
1389
1465
|
const onClickContinuePhone = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1390
1466
|
var _b;
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
1398
|
-
setShareData({
|
|
1399
|
-
authMethod: 'phone',
|
|
1400
|
-
});
|
|
1401
|
-
let res;
|
|
1402
|
-
if (!((_b = userExist._data) === null || _b === void 0 ? void 0 : _b.provider)) {
|
|
1403
|
-
res = yield registerBySendPhoneOTP(phoneNumber, areaCode);
|
|
1467
|
+
setLoading(true);
|
|
1468
|
+
try {
|
|
1469
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
1470
|
+
if (!areaCode || !phoneNumber || !phone) {
|
|
1471
|
+
setErrMsg(t('ssov2.validate.phone.required'));
|
|
1472
|
+
return setLoading(false);
|
|
1404
1473
|
}
|
|
1405
|
-
|
|
1406
|
-
|
|
1474
|
+
const userExist = yield store.checkUserExist({ phone: phoneNumber });
|
|
1475
|
+
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
1476
|
+
setShareData({
|
|
1477
|
+
authMethod: 'phone',
|
|
1478
|
+
});
|
|
1479
|
+
let res;
|
|
1480
|
+
if (!((_b = userExist._data) === null || _b === void 0 ? void 0 : _b.provider)) {
|
|
1481
|
+
res = yield registerBySendPhoneOTP(phoneNumber, areaCode);
|
|
1482
|
+
}
|
|
1483
|
+
else {
|
|
1484
|
+
res = yield resendPhoneOTP(phoneNumber, areaCode);
|
|
1485
|
+
}
|
|
1486
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
1487
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1488
|
+
return setLoading(false);
|
|
1489
|
+
}
|
|
1490
|
+
setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'register' })));
|
|
1491
|
+
addStep({
|
|
1492
|
+
type: store.SSOStepTypeType.OTP,
|
|
1493
|
+
config: {
|
|
1494
|
+
phone,
|
|
1495
|
+
otpType: 'phone-sms',
|
|
1496
|
+
afterAction: 'forgot',
|
|
1497
|
+
},
|
|
1498
|
+
});
|
|
1499
|
+
goNext();
|
|
1407
1500
|
}
|
|
1408
|
-
|
|
1409
|
-
setErrMsg(getErrorTextFromCode(t,
|
|
1410
|
-
return;
|
|
1501
|
+
else {
|
|
1502
|
+
setErrMsg(getErrorTextFromCode(t, userExist === null || userExist === void 0 ? void 0 : userExist.code));
|
|
1411
1503
|
}
|
|
1412
|
-
setShareData((a) => (Object.assign(Object.assign({}, a), { authFlow: 'register' })));
|
|
1413
|
-
addStep({
|
|
1414
|
-
type: store.SSOStepTypeType.OTP,
|
|
1415
|
-
config: {
|
|
1416
|
-
phone,
|
|
1417
|
-
otpType: 'phone-sms',
|
|
1418
|
-
afterAction: 'forgot',
|
|
1419
|
-
},
|
|
1420
|
-
});
|
|
1421
|
-
goNext();
|
|
1422
1504
|
}
|
|
1423
|
-
|
|
1424
|
-
|
|
1505
|
+
catch (e) {
|
|
1506
|
+
console.error(e);
|
|
1507
|
+
setErrMsg(getErrorTextFromCode(t, ''));
|
|
1425
1508
|
}
|
|
1509
|
+
setLoading(false);
|
|
1426
1510
|
});
|
|
1427
1511
|
return (React__default["default"].createElement("div", { style: {
|
|
1428
1512
|
display: hidden ? 'none' : 'block',
|
|
@@ -1431,10 +1515,10 @@ const SSOPasswordForgotPhone = ({ hidden, }) => {
|
|
|
1431
1515
|
React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, t('ssov2.resetPassword.title')),
|
|
1432
1516
|
React__default["default"].createElement(index$2.Text, { size: "p4" }, t('ssov2.resetPassword.description'))),
|
|
1433
1517
|
React__default["default"].createElement(core.Stack, { mt: 24, spacing: 16 },
|
|
1434
|
-
React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => setPhone(value), isError: !!errMsg, required: true }),
|
|
1518
|
+
React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => setPhone(value), isError: !!errMsg, required: true, disabled: loading }),
|
|
1435
1519
|
errMsg && (React__default["default"].createElement(index$2.Text, { size: "label2", color: "red.6", mt: -12 }, errMsg)),
|
|
1436
|
-
React__default["default"].createElement(index$3.Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo }, t('ssov2.button.continueZalo')),
|
|
1437
|
-
React__default["default"].createElement(index$3.Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone }, t('ssov2.button.continueSMS')))));
|
|
1520
|
+
React__default["default"].createElement(index$3.Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, disabled: loading, loading: loading }, t('ssov2.button.continueZalo')),
|
|
1521
|
+
React__default["default"].createElement(index$3.Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone, disabled: loading, loading: loading }, t('ssov2.button.continueSMS')))));
|
|
1438
1522
|
};
|
|
1439
1523
|
|
|
1440
1524
|
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" },
|
|
@@ -1445,7 +1529,7 @@ const CheckRedIcon = () => (React__default["default"].createElement("svg", { wid
|
|
|
1445
1529
|
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" })));
|
|
1446
1530
|
|
|
1447
1531
|
const SSOPasswordWithConfirm = (_a) => {
|
|
1448
|
-
var { form } = _a, props = tslib_es6.__rest(_a, ["form"]);
|
|
1532
|
+
var { form, loading } = _a, props = tslib_es6.__rest(_a, ["form", "loading"]);
|
|
1449
1533
|
const { t } = index.useTranslations();
|
|
1450
1534
|
const [atLeast8Chars, setAtLeast8Chars] = React__default["default"].useState(undefined);
|
|
1451
1535
|
const [atLeastOneUpper, setAtLeastOneUpper] = React__default["default"].useState(undefined);
|
|
@@ -1457,7 +1541,10 @@ const SSOPasswordWithConfirm = (_a) => {
|
|
|
1457
1541
|
setAtLeastOneUpper(!!password.match(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/));
|
|
1458
1542
|
}, [password]);
|
|
1459
1543
|
return (React__default["default"].createElement(core.Stack, Object.assign({ spacing: 12 }, props),
|
|
1460
|
-
React__default["default"].createElement(index$5.PasswordInput, Object.assign({ name: "password", placeholder: t('ssov2.passwordForgotSetup.field.password.placeholder'), label: t('ssov2.passwordForgotSetup.field.password.label'), required: true, withAsterisk: true }, form.getInputProps('password'))
|
|
1544
|
+
React__default["default"].createElement(index$5.PasswordInput, Object.assign({ name: "password", placeholder: t('ssov2.passwordForgotSetup.field.password.placeholder'), label: t('ssov2.passwordForgotSetup.field.password.label'), required: true, withAsterisk: true }, form.getInputProps('password'), { onBlur: (e) => {
|
|
1545
|
+
form.getInputProps('password').onBlur(e);
|
|
1546
|
+
form.values.confirmPassword && form.validateField('confirmPassword');
|
|
1547
|
+
}, disabled: loading })),
|
|
1461
1548
|
React__default["default"].createElement(core.Stack, { spacing: 8 },
|
|
1462
1549
|
React__default["default"].createElement(index$2.Text, { size: "n1" },
|
|
1463
1550
|
atLeast8Chars ? (React__default["default"].createElement(CheckGreenIcon, null)) : typeof atLeast8Chars === 'undefined' ? (React__default["default"].createElement(CheckGrayIcon, null)) : (React__default["default"].createElement(CheckRedIcon, null)),
|
|
@@ -1467,11 +1554,13 @@ const SSOPasswordWithConfirm = (_a) => {
|
|
|
1467
1554
|
atLeastOneUpper ? (React__default["default"].createElement(CheckGreenIcon, null)) : typeof atLeastOneUpper === 'undefined' ? (React__default["default"].createElement(CheckGrayIcon, null)) : (React__default["default"].createElement(CheckRedIcon, null)),
|
|
1468
1555
|
' ',
|
|
1469
1556
|
t('ssov2.passwordForgotSetup.field.password.atLeastOneUpper'))),
|
|
1470
|
-
React__default["default"].createElement(index$5.PasswordInput, Object.assign({ name: "confirm-password", placeholder: t('ssov2.passwordForgotSetup.field.passwordConfirm.placeholder'), label: t('ssov2.passwordForgotSetup.field.passwordConfirm.label'), required: true, withAsterisk: true }, form.getInputProps('confirmPassword')))));
|
|
1557
|
+
React__default["default"].createElement(index$5.PasswordInput, Object.assign({ name: "confirm-password", placeholder: t('ssov2.passwordForgotSetup.field.passwordConfirm.placeholder'), label: t('ssov2.passwordForgotSetup.field.passwordConfirm.label'), required: true, withAsterisk: true, disabled: loading }, form.getInputProps('confirmPassword')))));
|
|
1471
1558
|
};
|
|
1472
1559
|
|
|
1473
1560
|
const SSOPasswordForgotSetup = ({ hidden }) => {
|
|
1474
1561
|
const { t } = index.useTranslations();
|
|
1562
|
+
const [loading, setLoading] = React__default["default"].useState(false);
|
|
1563
|
+
const [errMsg, setErrMsg] = React__default["default"].useState('');
|
|
1475
1564
|
const { steps, setSteps, goBack, currentStepIndex, addStep, goNext } = store.useSSOSteps();
|
|
1476
1565
|
const form$1 = form.useForm({
|
|
1477
1566
|
validate: form.yupResolver(yup__namespace.object().shape({
|
|
@@ -1490,43 +1579,48 @@ const SSOPasswordForgotSetup = ({ hidden }) => {
|
|
|
1490
1579
|
})),
|
|
1491
1580
|
});
|
|
1492
1581
|
const onSubmit = (values) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
password
|
|
1496
|
-
password.
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1582
|
+
setLoading(true);
|
|
1583
|
+
try {
|
|
1584
|
+
const { password, confirmPassword } = values;
|
|
1585
|
+
if (password.length >= 8 &&
|
|
1586
|
+
password.length <= 50 &&
|
|
1587
|
+
password.match(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/) &&
|
|
1588
|
+
password === confirmPassword) {
|
|
1589
|
+
const res = yield store.resetPassword(password, confirmPassword);
|
|
1590
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
1591
|
+
useMantineLocale.showNotification({
|
|
1592
|
+
type: 'success',
|
|
1593
|
+
message: 'Password has been reset successfully',
|
|
1594
|
+
});
|
|
1595
|
+
// back to login step
|
|
1596
|
+
const foundPasswordIndex = steps.findIndex((step) => step.type === store.SSOStepTypeType.PASSWORD);
|
|
1597
|
+
const foundPasswordStep = steps.find((step) => step.type === store.SSOStepTypeType.PASSWORD);
|
|
1598
|
+
if (foundPasswordIndex === -1 || !foundPasswordStep) {
|
|
1599
|
+
// reset to first step
|
|
1600
|
+
setSteps((s) => [s[0]]);
|
|
1601
|
+
}
|
|
1602
|
+
else {
|
|
1603
|
+
const diffIndex = currentStepIndex - foundPasswordIndex;
|
|
1604
|
+
for (let i = 0; i < diffIndex; i++) {
|
|
1605
|
+
goBack();
|
|
1606
|
+
}
|
|
1514
1607
|
goBack();
|
|
1608
|
+
addStep(foundPasswordStep);
|
|
1609
|
+
goNext();
|
|
1515
1610
|
}
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1611
|
+
// onClose?.()
|
|
1612
|
+
}
|
|
1613
|
+
else {
|
|
1614
|
+
// toast error message
|
|
1615
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1519
1616
|
}
|
|
1520
|
-
// onClose?.()
|
|
1521
|
-
}
|
|
1522
|
-
else {
|
|
1523
|
-
// toast error message
|
|
1524
|
-
useMantineLocale.showNotification({
|
|
1525
|
-
type: 'danger',
|
|
1526
|
-
message: getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code),
|
|
1527
|
-
});
|
|
1528
1617
|
}
|
|
1529
1618
|
}
|
|
1619
|
+
catch (e) {
|
|
1620
|
+
console.error(e);
|
|
1621
|
+
setErrMsg(getErrorTextFromCode(t, e === null || e === void 0 ? void 0 : e.code));
|
|
1622
|
+
}
|
|
1623
|
+
setLoading(false);
|
|
1530
1624
|
});
|
|
1531
1625
|
return (React__default["default"].createElement("form", { style: {
|
|
1532
1626
|
display: hidden ? 'none' : 'block',
|
|
@@ -1535,83 +1629,101 @@ const SSOPasswordForgotSetup = ({ hidden }) => {
|
|
|
1535
1629
|
React__default["default"].createElement(core.Stack, { spacing: 8 },
|
|
1536
1630
|
React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, t('ssov2.passwordForgotSetup.title')),
|
|
1537
1631
|
React__default["default"].createElement(index$2.Text, { size: "p4" }, t('ssov2.passwordForgotSetup.description'))),
|
|
1538
|
-
React__default["default"].createElement(SSOPasswordWithConfirm, { form: form$1 }),
|
|
1539
|
-
React__default["default"].createElement(index$
|
|
1632
|
+
React__default["default"].createElement(SSOPasswordWithConfirm, { form: form$1, loading: loading }),
|
|
1633
|
+
errMsg && (React__default["default"].createElement(index$2.Text, { size: "label2", color: "red.6", mt: -12 }, errMsg)),
|
|
1634
|
+
React__default["default"].createElement(index$3.Button, { type: "submit", size: "lg", variant: "primary", fullWidth: true, disabled: loading, loading: loading }, t('ssov2.button.save')))));
|
|
1540
1635
|
};
|
|
1541
1636
|
|
|
1542
1637
|
const SSOPhoneVerify = ({ hidden, index: index$1, }) => {
|
|
1543
1638
|
const { t } = index.useTranslations();
|
|
1544
1639
|
const [phone, setPhone] = React__default["default"].useState('');
|
|
1640
|
+
const [loading, setLoading] = React__default["default"].useState(false);
|
|
1545
1641
|
const [errMsg, setErrMsg] = React__default["default"].useState('');
|
|
1546
1642
|
const { locale } = useSSOState();
|
|
1547
1643
|
const { addStep, goNext, steps } = store.useSSOSteps();
|
|
1548
1644
|
const currentStep = steps[index$1];
|
|
1549
1645
|
const { afterAction } = (currentStep === null || currentStep === void 0 ? void 0 : currentStep.config) || {};
|
|
1550
1646
|
const onClickContinueZalo = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
if (
|
|
1561
|
-
|
|
1562
|
-
|
|
1647
|
+
setLoading(true);
|
|
1648
|
+
try {
|
|
1649
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
1650
|
+
if (!areaCode || !phoneNumber || !phone) {
|
|
1651
|
+
setErrMsg(t('ssov2.validate.phone.required'));
|
|
1652
|
+
return setLoading(false);
|
|
1653
|
+
}
|
|
1654
|
+
const userExist = yield store.checkUserExist({ phone: phoneNumber });
|
|
1655
|
+
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
1656
|
+
if (!userExist._data) {
|
|
1657
|
+
const res = yield resendUpdatePhoneZaloOTP(phoneNumber, areaCode);
|
|
1658
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
1659
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1660
|
+
return setLoading(false);
|
|
1661
|
+
}
|
|
1662
|
+
addStep({
|
|
1663
|
+
type: store.SSOStepTypeType.OTP,
|
|
1664
|
+
config: {
|
|
1665
|
+
phone,
|
|
1666
|
+
otpType: 'phone-zalo',
|
|
1667
|
+
isUpdatePhone: true,
|
|
1668
|
+
afterAction: afterAction || 'setup',
|
|
1669
|
+
},
|
|
1670
|
+
});
|
|
1671
|
+
goNext();
|
|
1672
|
+
}
|
|
1673
|
+
else {
|
|
1674
|
+
setErrMsg(t('ssov2.phone.alreadyUsed'));
|
|
1563
1675
|
}
|
|
1564
|
-
addStep({
|
|
1565
|
-
type: store.SSOStepTypeType.OTP,
|
|
1566
|
-
config: {
|
|
1567
|
-
phone,
|
|
1568
|
-
otpType: 'phone-zalo',
|
|
1569
|
-
isUpdatePhone: true,
|
|
1570
|
-
afterAction: afterAction || 'setup',
|
|
1571
|
-
},
|
|
1572
|
-
});
|
|
1573
|
-
goNext();
|
|
1574
1676
|
}
|
|
1575
1677
|
else {
|
|
1576
|
-
setErrMsg(t
|
|
1678
|
+
setErrMsg(getErrorTextFromCode(t, userExist === null || userExist === void 0 ? void 0 : userExist.code));
|
|
1577
1679
|
}
|
|
1578
1680
|
}
|
|
1579
|
-
|
|
1580
|
-
|
|
1681
|
+
catch (e) {
|
|
1682
|
+
console.log(e);
|
|
1683
|
+
setErrMsg(getErrorTextFromCode(t, ''));
|
|
1581
1684
|
}
|
|
1685
|
+
setLoading(false);
|
|
1582
1686
|
});
|
|
1583
1687
|
const onClickContinuePhone = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
if (
|
|
1594
|
-
|
|
1595
|
-
|
|
1688
|
+
setLoading(true);
|
|
1689
|
+
try {
|
|
1690
|
+
const { areaCode, phoneNumber } = splitPhone(phone);
|
|
1691
|
+
if (!areaCode || !phoneNumber || !phone) {
|
|
1692
|
+
setErrMsg(t('ssov2.validate.phone.required'));
|
|
1693
|
+
return setLoading(false);
|
|
1694
|
+
}
|
|
1695
|
+
const userExist = yield store.checkUserExist({ phone: phoneNumber });
|
|
1696
|
+
if ((userExist === null || userExist === void 0 ? void 0 : userExist._status) === 1) {
|
|
1697
|
+
if (!userExist._data) {
|
|
1698
|
+
const res = yield resendUpdatePhoneOTP(phoneNumber, areaCode);
|
|
1699
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
1700
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1701
|
+
return setLoading(false);
|
|
1702
|
+
}
|
|
1703
|
+
addStep({
|
|
1704
|
+
type: store.SSOStepTypeType.OTP,
|
|
1705
|
+
config: {
|
|
1706
|
+
phone,
|
|
1707
|
+
otpType: 'phone-sms',
|
|
1708
|
+
isUpdatePhone: true,
|
|
1709
|
+
afterAction: afterAction || 'setup',
|
|
1710
|
+
},
|
|
1711
|
+
});
|
|
1712
|
+
goNext();
|
|
1713
|
+
}
|
|
1714
|
+
else {
|
|
1715
|
+
setErrMsg(t('ssov2.phone.alreadyUsed'));
|
|
1596
1716
|
}
|
|
1597
|
-
addStep({
|
|
1598
|
-
type: store.SSOStepTypeType.OTP,
|
|
1599
|
-
config: {
|
|
1600
|
-
phone,
|
|
1601
|
-
otpType: 'phone-sms',
|
|
1602
|
-
isUpdatePhone: true,
|
|
1603
|
-
afterAction: afterAction || 'setup',
|
|
1604
|
-
},
|
|
1605
|
-
});
|
|
1606
|
-
goNext();
|
|
1607
1717
|
}
|
|
1608
1718
|
else {
|
|
1609
|
-
setErrMsg(t
|
|
1719
|
+
setErrMsg(getErrorTextFromCode(t, userExist === null || userExist === void 0 ? void 0 : userExist.code));
|
|
1610
1720
|
}
|
|
1611
1721
|
}
|
|
1612
|
-
|
|
1613
|
-
|
|
1722
|
+
catch (e) {
|
|
1723
|
+
console.log(e);
|
|
1724
|
+
setErrMsg(getErrorTextFromCode(t, ''));
|
|
1614
1725
|
}
|
|
1726
|
+
setLoading(false);
|
|
1615
1727
|
});
|
|
1616
1728
|
return (React__default["default"].createElement("div", { style: {
|
|
1617
1729
|
display: hidden ? 'none' : 'block',
|
|
@@ -1622,9 +1734,12 @@ const SSOPhoneVerify = ({ hidden, index: index$1, }) => {
|
|
|
1622
1734
|
React__default["default"].createElement(index$2.Text, { size: "p4" }, t('ssov2.phoneVerify.description'))),
|
|
1623
1735
|
React__default["default"].createElement(core.Stack, { spacing: 16 },
|
|
1624
1736
|
React__default["default"].createElement(index$5.Input.Wrapper, { error: errMsg },
|
|
1625
|
-
React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) =>
|
|
1626
|
-
|
|
1627
|
-
|
|
1737
|
+
React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: phone, onChange: (value) => {
|
|
1738
|
+
setPhone(value);
|
|
1739
|
+
setErrMsg('');
|
|
1740
|
+
}, isError: !!errMsg, required: true, name: "phone", disabled: loading })),
|
|
1741
|
+
React__default["default"].createElement(index$3.Button, { size: "lg", variant: "primary", onClick: onClickContinueZalo, disabled: loading, loading: loading }, t('ssov2.button.continueZalo')),
|
|
1742
|
+
React__default["default"].createElement(index$3.Button, { size: "lg", variant: "secondary", onClick: onClickContinuePhone, disabled: loading, loading: loading }, t('ssov2.button.continueSMS'))))));
|
|
1628
1743
|
};
|
|
1629
1744
|
|
|
1630
1745
|
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" },
|
|
@@ -1657,7 +1772,7 @@ const MaleIcon = () => (React__default["default"].createElement("svg", { width:
|
|
|
1657
1772
|
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" })));
|
|
1658
1773
|
|
|
1659
1774
|
// always has name, gender dob
|
|
1660
|
-
const OtherSetup = ({ form, needPhone, needEmail, isEmailDisable, }) => {
|
|
1775
|
+
const OtherSetup = ({ form, needPhone, needEmail, isEmailDisable, loading, }) => {
|
|
1661
1776
|
const { t } = index.useTranslations();
|
|
1662
1777
|
const { locale = 'vi-VN' } = useSSOState();
|
|
1663
1778
|
const { setupSource } = store.useSSOV2Store();
|
|
@@ -1666,7 +1781,7 @@ const OtherSetup = ({ form, needPhone, needEmail, isEmailDisable, }) => {
|
|
|
1666
1781
|
React__default["default"].createElement(index$5.Input.Wrapper, Object.assign({ label: t('ssov2.setup.field.phone.label'), withAsterisk: true }, form.getInputProps('phone')),
|
|
1667
1782
|
React__default["default"].createElement(StyledPhone, { defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), value: form.getInputProps('phone').value, onChange: (value) => {
|
|
1668
1783
|
form.setFieldValue('phone', value);
|
|
1669
|
-
}, isError: !!form.getInputProps('phone').error, required: true, name: "phone" })),
|
|
1784
|
+
}, isError: !!form.getInputProps('phone').error, required: true, name: "phone", disabled: loading })),
|
|
1670
1785
|
React__default["default"].createElement(core.Group, { spacing: 24 },
|
|
1671
1786
|
React__default["default"].createElement(index$2.Text, { size: "p4" }, t('ssov2.setup.field.otp.label')),
|
|
1672
1787
|
React__default["default"].createElement(index$5.Radio.Group, Object.assign({ name: "otpMethod", styles: {
|
|
@@ -1681,14 +1796,14 @@ const OtherSetup = ({ form, needPhone, needEmail, isEmailDisable, }) => {
|
|
|
1681
1796
|
label: {
|
|
1682
1797
|
paddingLeft: 8,
|
|
1683
1798
|
},
|
|
1684
|
-
} }),
|
|
1799
|
+
}, disabled: loading }),
|
|
1685
1800
|
React__default["default"].createElement(index$5.Radio, { value: "sms", label: "SMS", styles: {
|
|
1686
1801
|
label: {
|
|
1687
1802
|
paddingLeft: 8,
|
|
1688
1803
|
},
|
|
1689
|
-
} }))))),
|
|
1690
|
-
needEmail && (React__default["default"].createElement(index$5.Input, Object.assign({ name: "email", type: "email", label: t('ssov2.setup.field.email.label'), disabled: isEmailDisable, required: setupSource === 'care' ? true : false, withAsterisk: setupSource === 'care' ? true : false }, form.getInputProps('email')))),
|
|
1691
|
-
React__default["default"].createElement(index$5.Input, Object.assign({ name: "name", label: t('ssov2.setup.field.name.label'), withAsterisk: true, required: true, placeholder: t('ssov2.setup.field.name.placeholder') }, form.getInputProps('name'))),
|
|
1804
|
+
}, disabled: loading }))))),
|
|
1805
|
+
needEmail && (React__default["default"].createElement(index$5.Input, Object.assign({ name: "email", type: "email", label: t('ssov2.setup.field.email.label'), disabled: isEmailDisable || loading, required: setupSource === 'care' ? true : false, withAsterisk: setupSource === 'care' ? true : false }, form.getInputProps('email')))),
|
|
1806
|
+
React__default["default"].createElement(index$5.Input, Object.assign({ name: "name", label: t('ssov2.setup.field.name.label'), withAsterisk: true, required: true, placeholder: t('ssov2.setup.field.name.placeholder'), disabled: loading }, form.getInputProps('name'))),
|
|
1692
1807
|
React__default["default"].createElement(index$5.Input.Wrapper, Object.assign({ label: t('ssov2.setup.field.gender.label'), withAsterisk: true }, form.getInputProps('gender')),
|
|
1693
1808
|
React__default["default"].createElement(core.Group, null,
|
|
1694
1809
|
React__default["default"].createElement(index$3.Button, { type: "button", styles: {
|
|
@@ -1705,7 +1820,7 @@ const OtherSetup = ({ form, needPhone, needEmail, isEmailDisable, }) => {
|
|
|
1705
1820
|
? 'secondary'
|
|
1706
1821
|
: 'tertiary', onClick: () => {
|
|
1707
1822
|
form.setFieldValue('gender', 'female');
|
|
1708
|
-
}, leftIcon: React__default["default"].createElement(FemaleIcon, null) }, t('ssov2.setup.field.gender.female')),
|
|
1823
|
+
}, leftIcon: React__default["default"].createElement(FemaleIcon, null), disabled: loading }, t('ssov2.setup.field.gender.female')),
|
|
1709
1824
|
React__default["default"].createElement(index$3.Button, { type: "button", styles: {
|
|
1710
1825
|
root: {
|
|
1711
1826
|
flex: 1,
|
|
@@ -1720,8 +1835,8 @@ const OtherSetup = ({ form, needPhone, needEmail, isEmailDisable, }) => {
|
|
|
1720
1835
|
? 'secondary'
|
|
1721
1836
|
: 'tertiary', onClick: () => {
|
|
1722
1837
|
form.setFieldValue('gender', 'male');
|
|
1723
|
-
}, leftIcon: React__default["default"].createElement(MaleIcon, null) }, t('ssov2.setup.field.gender.male')))),
|
|
1724
|
-
React__default["default"].createElement(index$6.DatePicker, Object.assign({ name: "dob", label: t('ssov2.setup.field.dob.label'), withAsterisk: true, required: true, placeholder: t('ssov2.setup.field.dob.placeholder'), maxDate: new Date() }, form.getInputProps('dob')))));
|
|
1838
|
+
}, leftIcon: React__default["default"].createElement(MaleIcon, null), disabled: loading }, t('ssov2.setup.field.gender.male')))),
|
|
1839
|
+
React__default["default"].createElement(index$6.DatePicker, Object.assign({ name: "dob", label: t('ssov2.setup.field.dob.label'), withAsterisk: true, required: true, placeholder: t('ssov2.setup.field.dob.placeholder'), maxDate: new Date(), disabled: loading }, form.getInputProps('dob')))));
|
|
1725
1840
|
};
|
|
1726
1841
|
|
|
1727
1842
|
const SSOSetupScreen = ({ hidden, index: index$1, }) => {
|
|
@@ -1731,6 +1846,7 @@ const SSOSetupScreen = ({ hidden, index: index$1, }) => {
|
|
|
1731
1846
|
const { goNext, steps, addStep, shareData } = store.useSSOSteps();
|
|
1732
1847
|
const { setupSource } = store.useSSOV2Store();
|
|
1733
1848
|
const [errMsg, setErrMsg] = React__default["default"].useState('');
|
|
1849
|
+
const [loading, setLoading] = React__default["default"].useState(false);
|
|
1734
1850
|
const currentStep = steps[index$1];
|
|
1735
1851
|
const config = currentStep === null || currentStep === void 0 ? void 0 : currentStep.config;
|
|
1736
1852
|
const userInfo = config === null || config === void 0 ? void 0 : config.userInfo;
|
|
@@ -1809,100 +1925,108 @@ const SSOSetupScreen = ({ hidden, index: index$1, }) => {
|
|
|
1809
1925
|
.oneOf(['male', 'female'], t('ssov2.validate.gender.oneOf')), dob: yup__namespace.date().required(t('ssov2.validate.dob.required')), name: yup__namespace.string().required(t('ssov2.validate.name.required')) }))),
|
|
1810
1926
|
});
|
|
1811
1927
|
const onSubmit = (values) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
if (
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
if (
|
|
1844
|
-
|
|
1845
|
-
|
|
1928
|
+
setLoading(true);
|
|
1929
|
+
try {
|
|
1930
|
+
const { password, confirmPassword, phone, gender, name, dob, otpMethod } = values;
|
|
1931
|
+
const { phoneNumber, areaCode } = splitPhone(phone || configPhone || '');
|
|
1932
|
+
// validate only, delay set data to after otp
|
|
1933
|
+
const res = yield store.updateUserInfo({
|
|
1934
|
+
name,
|
|
1935
|
+
birthday: dayjs__default["default"](dob).format('YYYY-MM-DD'),
|
|
1936
|
+
email: values.email || undefined,
|
|
1937
|
+
password,
|
|
1938
|
+
confirm_password: confirmPassword,
|
|
1939
|
+
phone_number: phoneNumber || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone),
|
|
1940
|
+
area_code: areaCode || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code) || '84',
|
|
1941
|
+
gender: gender === 'male' ? 1 : 0,
|
|
1942
|
+
source: setupSource,
|
|
1943
|
+
validate: 'true',
|
|
1944
|
+
});
|
|
1945
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
1946
|
+
// if need phone and has phone then start phone verify step, close after done
|
|
1947
|
+
if (needPhone) {
|
|
1948
|
+
const setupData = {
|
|
1949
|
+
name,
|
|
1950
|
+
birthday: dayjs__default["default"](dob).format('YYYY-MM-DD'),
|
|
1951
|
+
email: values.email || undefined,
|
|
1952
|
+
password,
|
|
1953
|
+
confirm_password: confirmPassword,
|
|
1954
|
+
phone_number: phoneNumber || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone),
|
|
1955
|
+
area_code: areaCode || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code) || '84',
|
|
1956
|
+
gender: gender === 'male' ? 1 : 0,
|
|
1957
|
+
source: setupSource,
|
|
1958
|
+
};
|
|
1959
|
+
if (otpMethod === 'zalo') {
|
|
1960
|
+
const res = yield resendUpdatePhoneZaloOTP(phoneNumber, areaCode);
|
|
1961
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
1962
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1963
|
+
return setLoading(false);
|
|
1964
|
+
}
|
|
1965
|
+
addStep({
|
|
1966
|
+
type: store.SSOStepTypeType.OTP,
|
|
1967
|
+
config: {
|
|
1968
|
+
phone,
|
|
1969
|
+
otpType: 'phone-zalo',
|
|
1970
|
+
isUpdatePhone: true,
|
|
1971
|
+
afterAction: 'submitSetup',
|
|
1972
|
+
setupData,
|
|
1973
|
+
},
|
|
1974
|
+
});
|
|
1975
|
+
goNext();
|
|
1976
|
+
}
|
|
1977
|
+
else {
|
|
1978
|
+
const res = yield resendUpdatePhoneOTP(phoneNumber, areaCode);
|
|
1979
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
1980
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1981
|
+
return setLoading(false);
|
|
1982
|
+
}
|
|
1983
|
+
addStep({
|
|
1984
|
+
type: store.SSOStepTypeType.OTP,
|
|
1985
|
+
config: {
|
|
1986
|
+
phone,
|
|
1987
|
+
otpType: 'phone-sms',
|
|
1988
|
+
isUpdatePhone: true,
|
|
1989
|
+
afterAction: 'submitSetup',
|
|
1990
|
+
setupData,
|
|
1991
|
+
},
|
|
1992
|
+
});
|
|
1993
|
+
goNext();
|
|
1846
1994
|
}
|
|
1847
|
-
addStep({
|
|
1848
|
-
type: store.SSOStepTypeType.OTP,
|
|
1849
|
-
config: {
|
|
1850
|
-
phone,
|
|
1851
|
-
otpType: 'phone-zalo',
|
|
1852
|
-
isUpdatePhone: true,
|
|
1853
|
-
afterAction: 'submitSetup',
|
|
1854
|
-
setupData,
|
|
1855
|
-
},
|
|
1856
|
-
});
|
|
1857
|
-
goNext();
|
|
1858
1995
|
}
|
|
1859
1996
|
else {
|
|
1860
|
-
|
|
1861
|
-
|
|
1997
|
+
// close?
|
|
1998
|
+
const res = yield store.updateUserInfo({
|
|
1999
|
+
name,
|
|
2000
|
+
birthday: dayjs__default["default"](dob).format('YYYY-MM-DD'),
|
|
2001
|
+
email: values.email || undefined,
|
|
2002
|
+
password,
|
|
2003
|
+
confirm_password: confirmPassword,
|
|
2004
|
+
phone_number: phoneNumber || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone),
|
|
2005
|
+
area_code: areaCode || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code),
|
|
2006
|
+
gender: gender === 'male' ? 1 : 0,
|
|
2007
|
+
source: setupSource,
|
|
2008
|
+
validate: '',
|
|
2009
|
+
});
|
|
2010
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
2011
|
+
store.handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
|
|
2012
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
2013
|
+
}
|
|
2014
|
+
else {
|
|
1862
2015
|
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1863
|
-
return;
|
|
2016
|
+
return setLoading(false);
|
|
1864
2017
|
}
|
|
1865
|
-
addStep({
|
|
1866
|
-
type: store.SSOStepTypeType.OTP,
|
|
1867
|
-
config: {
|
|
1868
|
-
phone,
|
|
1869
|
-
otpType: 'phone-sms',
|
|
1870
|
-
isUpdatePhone: true,
|
|
1871
|
-
afterAction: 'submitSetup',
|
|
1872
|
-
setupData,
|
|
1873
|
-
},
|
|
1874
|
-
});
|
|
1875
|
-
goNext();
|
|
1876
2018
|
}
|
|
1877
2019
|
}
|
|
1878
2020
|
else {
|
|
1879
|
-
//
|
|
1880
|
-
|
|
1881
|
-
name,
|
|
1882
|
-
birthday: dayjs__default["default"](dob).format('YYYY-MM-DD'),
|
|
1883
|
-
email: values.email || undefined,
|
|
1884
|
-
password,
|
|
1885
|
-
confirm_password: confirmPassword,
|
|
1886
|
-
phone_number: phoneNumber || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone),
|
|
1887
|
-
area_code: areaCode || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code),
|
|
1888
|
-
gender: gender === 'male' ? 1 : 0,
|
|
1889
|
-
source: setupSource,
|
|
1890
|
-
validate: '',
|
|
1891
|
-
});
|
|
1892
|
-
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
1893
|
-
store.handleAuthSuccess(res === null || res === void 0 ? void 0 : res._data);
|
|
1894
|
-
onClose === null || onClose === void 0 ? void 0 : onClose(true);
|
|
1895
|
-
}
|
|
1896
|
-
else {
|
|
1897
|
-
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1898
|
-
return;
|
|
1899
|
-
}
|
|
2021
|
+
// toast error message
|
|
2022
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
1900
2023
|
}
|
|
1901
2024
|
}
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
setErrMsg(getErrorTextFromCode(t,
|
|
2025
|
+
catch (e) {
|
|
2026
|
+
console.error(e);
|
|
2027
|
+
setErrMsg(getErrorTextFromCode(t, ''));
|
|
1905
2028
|
}
|
|
2029
|
+
setLoading(false);
|
|
1906
2030
|
});
|
|
1907
2031
|
return (React__default["default"].createElement("form", { style: {
|
|
1908
2032
|
display: hidden ? 'none' : 'block',
|
|
@@ -1911,10 +2035,10 @@ const SSOSetupScreen = ({ hidden, index: index$1, }) => {
|
|
|
1911
2035
|
React__default["default"].createElement(core.Stack, { spacing: 8 },
|
|
1912
2036
|
React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, t('ssov2.setup.title')),
|
|
1913
2037
|
React__default["default"].createElement(index$2.Text, { size: "p4" }, t('ssov2.setup.description'))),
|
|
1914
|
-
needPass && React__default["default"].createElement(SSOPasswordWithConfirm, { form: form$1 }),
|
|
1915
|
-
React__default["default"].createElement(OtherSetup, { needPhone: needPhone, needEmail: needEmail, isEmailDisable: isEmailDisable, form: form$1 }),
|
|
2038
|
+
needPass && (React__default["default"].createElement(SSOPasswordWithConfirm, { form: form$1, loading: loading })),
|
|
2039
|
+
React__default["default"].createElement(OtherSetup, { needPhone: needPhone, needEmail: needEmail, isEmailDisable: isEmailDisable, form: form$1, loading: loading }),
|
|
1916
2040
|
errMsg && (React__default["default"].createElement(index$2.Text, { color: "red.6", size: "p4" }, errMsg)),
|
|
1917
|
-
React__default["default"].createElement(index$3.Button, { type: "submit", variant: "primary", fullWidth: true }, needPhone
|
|
2041
|
+
React__default["default"].createElement(index$3.Button, { type: "submit", variant: "primary", fullWidth: true, loading: loading, disabled: loading }, needPhone
|
|
1918
2042
|
? t('ssov2.setup.button.veriyPhone')
|
|
1919
2043
|
: authFlow === 'register'
|
|
1920
2044
|
? t('ssov2.setup.button.createAccount')
|
|
@@ -1925,46 +2049,57 @@ const SSOUpdateEmailScreen = ({ hidden, }) => {
|
|
|
1925
2049
|
const { t } = index.useTranslations();
|
|
1926
2050
|
const [errMsg, setErrMsg] = React__default["default"].useState('');
|
|
1927
2051
|
const { addStep, goNext, setShareData } = store.useSSOSteps();
|
|
2052
|
+
const [loading, setLoading] = React__default["default"].useState(false);
|
|
1928
2053
|
return (React__default["default"].createElement("form", { style: {
|
|
1929
2054
|
display: hidden ? 'none' : 'block',
|
|
1930
2055
|
}, onSubmit: (e) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1931
2056
|
e.preventDefault();
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
2057
|
+
if (loading)
|
|
2058
|
+
return;
|
|
2059
|
+
setLoading(true);
|
|
2060
|
+
try {
|
|
2061
|
+
const email = e.currentTarget.email.value;
|
|
2062
|
+
const existRes = yield store.checkUserExist({ email });
|
|
2063
|
+
if ((existRes === null || existRes === void 0 ? void 0 : existRes._status) === 1) {
|
|
2064
|
+
if (!existRes._data) {
|
|
2065
|
+
setShareData({
|
|
2066
|
+
authMethod: 'mail',
|
|
2067
|
+
authFlow: 'verify-mail',
|
|
2068
|
+
});
|
|
2069
|
+
const res = yield initSendUpdateEmailOtp(email);
|
|
2070
|
+
if ((res === null || res === void 0 ? void 0 : res._status) !== 1) {
|
|
2071
|
+
setErrMsg(getErrorTextFromCode(t, res === null || res === void 0 ? void 0 : res.code));
|
|
2072
|
+
return setLoading(false);
|
|
2073
|
+
}
|
|
2074
|
+
addStep({
|
|
2075
|
+
type: store.SSOStepTypeType.OTP,
|
|
2076
|
+
config: {
|
|
2077
|
+
email,
|
|
2078
|
+
otpType: 'update-email',
|
|
2079
|
+
afterAction: 'setup',
|
|
2080
|
+
},
|
|
2081
|
+
});
|
|
2082
|
+
goNext();
|
|
2083
|
+
}
|
|
2084
|
+
else {
|
|
2085
|
+
setErrMsg(t('ssov2.email.alreadyUsed'));
|
|
1944
2086
|
}
|
|
1945
|
-
addStep({
|
|
1946
|
-
type: store.SSOStepTypeType.OTP,
|
|
1947
|
-
config: {
|
|
1948
|
-
email,
|
|
1949
|
-
otpType: 'update-email',
|
|
1950
|
-
afterAction: 'setup',
|
|
1951
|
-
},
|
|
1952
|
-
});
|
|
1953
|
-
goNext();
|
|
1954
2087
|
}
|
|
1955
2088
|
else {
|
|
1956
|
-
setErrMsg(t
|
|
2089
|
+
setErrMsg(getErrorTextFromCode(t, existRes === null || existRes === void 0 ? void 0 : existRes.code));
|
|
1957
2090
|
}
|
|
1958
2091
|
}
|
|
1959
|
-
|
|
1960
|
-
setErrMsg(getErrorTextFromCode(t,
|
|
2092
|
+
catch (e) {
|
|
2093
|
+
setErrMsg(getErrorTextFromCode(t, ''));
|
|
2094
|
+
console.error(e);
|
|
1961
2095
|
}
|
|
2096
|
+
setLoading(false);
|
|
1962
2097
|
}) },
|
|
1963
2098
|
React__default["default"].createElement(core.Stack, { spacing: 8 },
|
|
1964
2099
|
React__default["default"].createElement(index$2.Text, { size: "s1", weight: "semiBold" }, t('ssov2.updateEmail.title')),
|
|
1965
2100
|
React__default["default"].createElement(index$2.Text, { size: "p4" }, t('ssov2.updateEmail.description'))),
|
|
1966
|
-
React__default["default"].createElement(index$5.Input, { name: "email", placeholder: "Email c\u1EE7a b\u1EA1n", error: errMsg || undefined, type: "email", required: true, mt: 24 }),
|
|
1967
|
-
React__default["default"].createElement(index$3.Button, { type: "submit", size: "lg", variant: "primary", fullWidth: true, mt: 16 }, t('ssov2.updateEmail.button'))));
|
|
2101
|
+
React__default["default"].createElement(index$5.Input, { name: "email", placeholder: "Email c\u1EE7a b\u1EA1n", error: errMsg || undefined, type: "email", required: true, mt: 24, onChange: () => setErrMsg(''), disabled: loading }),
|
|
2102
|
+
React__default["default"].createElement(index$3.Button, { type: "submit", size: "lg", variant: "primary", fullWidth: true, mt: 16, loading: loading, disabled: loading }, t('ssov2.updateEmail.button'))));
|
|
1968
2103
|
};
|
|
1969
2104
|
|
|
1970
2105
|
const SSOScreenRenderer = () => {
|