@hhgtech/hhg-components 1.29.359 → 1.29.361-beta-1
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-432ab0af.js → LastPeriod-1e3a4dd6.js} +1 -1
- package/build/{MobileBottomNavigationIcon-38e1bcfd.js → MobileBottomNavigationIcon-5916f647.js} +3 -3
- package/build/{Spinner-763ba3db.js → Spinner-e0f2304c.js} +1 -1
- package/build/{WhatsApp-58d61564.js → WhatsApp-e9a27204.js} +1 -1
- package/build/adapters.js +19 -19
- package/build/atoms.js +47 -47
- 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/mantine/phoneInput/PhoneInput.d.ts +15 -0
- package/build/components/mantine/phoneInput/index.d.ts +1 -0
- package/build/components/navigationV2/components/molecules/navigationBar/index.styled.d.ts +2 -0
- package/build/components/navigationV2/hooks/useNavConfig.d.ts +1 -0
- package/build/components/navigationV2/types.d.ts +1 -1
- package/build/components.js +96 -95
- package/build/{constants-697599b9.js → constants-cb5c4ca3.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-d4e5fe33.js → core-729539d7.js} +1 -1
- package/build/{dataTransform-759387eb.js → dataTransform-e9ed2437.js} +1 -1
- package/build/ecom.js +4 -4
- package/build/{editor-ae62f0df.js → editor-1212f5b8.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-7db229ad.js → LastPeriod-b71490c0.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-3eb0615e.js → MobileBottomNavigationIcon-8d94f4ba.js} +3 -3
- package/build/esm/{Spinner-95fe2ee6.js → Spinner-99c2fbb3.js} +1 -1
- package/build/esm/{WhatsApp-6c96c383.js → WhatsApp-3c65161b.js} +1 -1
- package/build/esm/adapters.js +19 -19
- package/build/esm/atoms.js +47 -47
- 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/mantine/phoneInput/PhoneInput.d.ts +15 -0
- package/build/esm/components/mantine/phoneInput/index.d.ts +1 -0
- package/build/esm/components/navigationV2/components/molecules/navigationBar/index.styled.d.ts +2 -0
- package/build/esm/components/navigationV2/hooks/useNavConfig.d.ts +1 -0
- package/build/esm/components/navigationV2/types.d.ts +1 -1
- package/build/esm/components.js +96 -95
- package/build/esm/{constants-2c8b8584.js → constants-6341499d.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-023cbab7.js → core-d24c8960.js} +1 -1
- package/build/esm/{dataTransform-b02248a7.js → dataTransform-6beebce6.js} +1 -1
- package/build/esm/ecom.js +4 -4
- package/build/esm/{editor-05235340.js → editor-7870b558.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/footer.js +21 -21
- package/build/esm/gAssets.js +2 -2
- package/build/esm/healthTools-8680cb70.js +44 -0
- package/build/esm/healthToolsCardWrapper.js +18 -18
- package/build/esm/healthToolsForm.js +33 -33
- package/build/esm/hooks/useCSSFocusPopupHelper.d.ts +1 -0
- package/build/esm/hooks.js +13 -13
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-140d55a0.js → index-00bc9d15.js} +1 -1
- package/build/esm/{index-39d9acbb.js → index-032bf5cb.js} +24 -24
- package/build/esm/{index-a5dd4905.js → index-062c5976.js} +2 -2
- package/build/esm/{index-598dbe51.js → index-086be20d.js} +31 -31
- package/build/esm/{index-a8fb294e.js → index-0974a308.js} +6 -6
- package/build/esm/{index-ee1f66fb.js → index-10f5873c.js} +2 -2
- package/build/esm/{index-9b74efb6.js → index-1246e4a4.js} +3 -3
- package/build/esm/{index-8b928102.js → index-17775f87.js} +1 -1
- package/build/esm/{index-585c41d6.js → index-1d1047ac.js} +2 -2
- package/build/esm/{index-51085ab9.js → index-1ffb599d.js} +25 -53
- package/build/esm/{index-ba63b603.js → index-2b8cedcb.js} +2 -2
- package/build/esm/{index-75d2baf2.js → index-35515a70.js} +16 -16
- package/build/esm/{index-cb4e3f09.js → index-3df28aa1.js} +7 -7
- package/build/esm/{index-7eec586b.js → index-416d4906.js} +10 -10
- package/build/esm/{index-944111b6.js → index-47f7f864.js} +1 -1
- package/build/esm/{index-8b7f94f5.js → index-49eb323b.js} +3 -3
- package/build/esm/{index-c1eec924.js → index-5b92c467.js} +1 -1
- package/build/esm/{index-37be4c5a.js → index-5c846d71.js} +1 -1
- package/build/esm/{index-de63322a.js → index-5db02d1c.js} +13 -13
- package/build/esm/{index-6de1895c.js → index-63222337.js} +6 -6
- package/build/esm/{index-0cee20dc.js → index-70435256.js} +16 -16
- package/build/esm/{index-17fcc524.js → index-767d3f92.js} +18 -18
- package/build/esm/{index-da71be9b.js → index-7955003f.js} +2 -2
- package/build/esm/{index-a8aa9e50.js → index-84d7459b.js} +1 -1
- package/build/esm/{index-4f443a2e.js → index-86fffcc8.js} +17 -17
- package/build/esm/{index-7fc97fbf.js → index-88daf0a5.js} +16 -16
- package/build/esm/{index-649e2396.js → index-8a6a9b40.js} +6 -6
- package/build/esm/{index-28a01a95.js → index-8ec915a3.js} +11 -11
- package/build/esm/{index-e36e9367.js → index-90a2d72f.js} +2 -2
- package/build/esm/{index-cf5a95bb.js → index-90c0bea0.js} +18 -18
- package/build/esm/{index-637f332a.js → index-94209fbe.js} +3 -3
- package/build/esm/{index-312f02fc.js → index-96226c21.js} +18 -11
- package/build/esm/{index-a04b44ae.js → index-9c3b5959.js} +69 -42
- package/build/esm/{index-62f8e4f4.js → index-9f08c7df.js} +1 -1
- package/build/esm/{index-e5ea0391.js → index-a04a8089.js} +13 -13
- package/build/esm/{index-f679c8e1.js → index-a39f198f.js} +16 -16
- package/build/esm/{index-d87b3e40.js → index-a43b7dd3.js} +3 -3
- package/build/esm/{index-e8cf187b.js → index-a4e847bc.js} +2 -2
- package/build/esm/{index-b69220ed.js → index-a6744510.js} +2 -2
- package/build/esm/{index-f584c485.js → index-a7c56e5d.js} +2 -2
- package/build/esm/{index-c63f2aba.js → index-ad569b96.js} +1 -1
- package/build/esm/{index-79d0785e.js → index-b10ca0ad.js} +16 -16
- package/build/esm/{index-a7690904.js → index-b4f08356.js} +22 -22
- package/build/esm/{index-36f4802f.js → index-bba05381.js} +13 -13
- package/build/esm/{index-31b95ce4.js → index-becd0fee.js} +1 -1
- package/build/esm/{index-de6a481f.js → index-bf09e2d4.js} +2 -2
- package/build/esm/{index-148ab09a.js → index-c0198e4a.js} +17 -17
- package/build/esm/{index-325f7835.js → index-c044e2d8.js} +4 -4
- package/build/esm/{index-cd5b9e28.js → index-c5d9bd94.js} +5 -5
- package/build/esm/{index-edf6f9a7.js → index-c7d8ff21.js} +2 -2
- package/build/esm/{index-e6965235.js → index-cbe15386.js} +17 -17
- package/build/esm/{index-40e3659e.js → index-ce4c988c.js} +5 -5
- package/build/esm/{index-14701e5f.js → index-cef28d7c.js} +6 -6
- package/build/esm/{index-7ea5f40c.js → index-d146d365.js} +2 -2
- package/build/esm/{index-df15f5b9.js → index-d1946a8e.js} +7 -7
- package/build/esm/{index-ca4a34e1.js → index-d2f8052d.js} +32 -32
- package/build/esm/{index-d1053dee.js → index-e011bbd8.js} +2 -2
- package/build/esm/{index-2e0616a7.js → index-e2aff6a8.js} +3 -3
- package/build/esm/{index-4672efa0.js → index-e37b41df.js} +21 -21
- package/build/esm/{index-c653dac3.js → index-e7579fcb.js} +15 -15
- package/build/esm/{index-09af78c1.js → index-ed02b87c.js} +6 -6
- package/build/esm/{index-28323973.js → index-f2dc7079.js} +13 -13
- package/build/esm/{index-b73b1745.js → index-fbcbb083.js} +3 -3
- package/build/esm/{index-5fe7c8ce.js → index-fbfb2e92.js} +2 -2
- package/build/esm/index.js +117 -116
- package/build/esm/interfaces/healthTools.d.ts +12 -0
- package/build/esm/{labelSorting-421928f4.js → labelSorting-9f03dd6c.js} +4 -4
- package/build/esm/lead/LeadGenForm/LeadGenForm.d.ts +41 -0
- package/build/esm/lead/LeadGenForm/LeadGenForm.styled.d.ts +5 -0
- package/build/esm/lead/LeadGenForm/LeadGenThankYou.d.ts +20 -0
- package/build/esm/lead/LeadGenForm/index.d.ts +1 -0
- package/build/esm/lead/LeadGenForm/textField/index.d.ts +13 -0
- package/build/esm/lead/LeadGenForm/textField/index.styled.d.ts +11 -0
- package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +25 -0
- package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContext.d.ts +25 -0
- package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxWrapper.d.ts +30 -0
- package/build/esm/lead/LeadGenSubscriptionBox/index.d.ts +1 -0
- package/build/esm/lead/helpers.d.ts +51 -1
- package/build/esm/lead/index.d.ts +2 -1
- package/build/esm/lead/services/index.d.ts +14 -0
- package/build/esm/lead.js +1347 -425
- package/build/esm/{logoIcon-2c77d727.js → logoIcon-54c7a908.js} +2 -2
- package/build/esm/mantine.js +25 -25
- package/build/esm/misc.js +17 -17
- 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 +74 -73
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +16 -16
- package/build/esm/navigation.js +45 -45
- 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 +49 -49
- package/build/esm/{post-511b6da3.js → post-4a3ff1a0.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/api/featureFlag.d.ts +2 -1
- package/build/esm/ssoV2/index.d.ts +1 -0
- package/build/esm/ssoV2/utils.d.ts +6 -0
- package/build/esm/ssoV2.js +51 -56
- package/build/esm/{store-27025ea3.js → store-129e3fcb.js} +4 -4
- package/build/esm/subot.js +44 -42
- package/build/esm/surveyOrPremiumBanner.js +32 -31
- package/build/esm/surveyQuestionCard.js +10 -10
- package/build/esm/{surveyThankyouCard-b57ba455.js → surveyThankyouCard-7fdbaefb.js} +5 -5
- package/build/esm/together.js +55 -55
- 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 +50 -50
- package/build/esm/togetherMoleculesCardAuthor.js +28 -28
- package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
- package/build/esm/togetherMoleculesProfileDetail.js +38 -38
- package/build/esm/togetherOrganisms.js +49 -49
- package/build/esm/togetherRichTextEditor.js +17 -17
- package/build/esm/togetherShareBox.js +10 -10
- package/build/esm/{treePopoverMenu-c943db3e.js → treePopoverMenu-7dea0335.js} +19 -19
- package/build/esm/{types-5f3f8b88.js → types-d3becc85.js} +2 -2
- package/build/esm/types.js +2 -2
- package/build/esm/{useCategory-68ca3e25.js → useCategory-a751e6bf.js} +5 -5
- package/build/esm/{useHealthToolCache-fb5588e8.js → useHealthToolCache-e5f37e0e.js} +1 -1
- package/build/esm/{useMantineLocale-d842bb84.js → useMantineLocale-55437870.js} +6 -6
- package/build/esm/{usePlacesAutocomplete-c8bdd26a.js → usePlacesAutocomplete-76552e60.js} +1 -1
- package/build/esm/{useScreenSize-fac76c9d.js → useScreenSize-5dfcff9a.js} +2 -2
- package/build/esm/useTogetherAuthRequiredAction.js +9 -9
- package/build/esm/{utils-0714bdfa.js → utils-084b7803.js} +2 -2
- package/build/esm/{utils-2ee21561.js → utils-6fdbff97.js} +2 -2
- package/build/esm/{utils-cb1b1b06.js → utils-ceaf71c3.js} +3 -3
- package/build/esm/utils-fc818da7.js +57 -0
- package/build/esm/vaccination.js +21 -21
- package/build/footer.js +21 -21
- package/build/gAssets.js +2 -2
- package/build/healthTools-9faecef9.js +47 -0
- package/build/healthToolsCardWrapper.js +18 -18
- package/build/healthToolsForm.js +33 -33
- package/build/hooks/useCSSFocusPopupHelper.d.ts +1 -0
- package/build/hooks.js +13 -13
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/{index-1aa0bb20.js → index-0962a6b0.js} +2 -2
- package/build/{index-172f3d7f.js → index-1af4d972.js} +3 -3
- package/build/{index-aa6bd9a2.js → index-217ba3eb.js} +21 -21
- package/build/{index-4a44319a.js → index-24ce1942.js} +6 -6
- package/build/{index-e401e7fe.js → index-2913a22f.js} +11 -11
- package/build/{index-34898a30.js → index-2959b04f.js} +15 -15
- package/build/{index-e9b43b1d.js → index-2b809d10.js} +16 -16
- package/build/{index-516d187f.js → index-2bd8cfe6.js} +3 -3
- package/build/{index-8c9e61eb.js → index-3160778e.js} +18 -11
- package/build/{index-46a2fce8.js → index-36820903.js} +1 -1
- package/build/{index-687821be.js → index-3954cdd0.js} +1 -1
- package/build/{index-4575e877.js → index-3b018bf8.js} +3 -3
- package/build/{index-4ac513ca.js → index-4095bae8.js} +2 -2
- package/build/{index-73fb4b8d.js → index-40fcfd89.js} +3 -3
- package/build/{index-a1db2652.js → index-41572306.js} +13 -13
- package/build/{index-d255bf7a.js → index-43aac258.js} +13 -13
- package/build/{index-563d16b5.js → index-450a27f3.js} +7 -7
- package/build/{index-02577c3f.js → index-4cb6d92f.js} +17 -17
- package/build/{index-9f60bc86.js → index-588a71af.js} +1 -1
- package/build/{index-fec3c6a1.js → index-5ea60ab5.js} +1 -1
- package/build/{index-a287e046.js → index-5f898245.js} +2 -2
- package/build/{index-2c7e9f28.js → index-627013fa.js} +6 -6
- package/build/{index-0268a93b.js → index-678e9f82.js} +2 -2
- package/build/{index-0705b767.js → index-67e41baa.js} +2 -2
- package/build/{index-0bd0f14c.js → index-6b66b710.js} +5 -5
- package/build/{index-e7f371a6.js → index-6bc0c7a2.js} +2 -2
- package/build/{index-1f804ffe.js → index-6e62f595.js} +1 -1
- package/build/{index-43487bf7.js → index-6f508c09.js} +2 -2
- package/build/{index-859a11c6.js → index-710cf66d.js} +2 -2
- package/build/{index-049216da.js → index-732d54c4.js} +36 -64
- package/build/{index-ecea0150.js → index-73f1e2a5.js} +2 -2
- package/build/{index-f8dfa05e.js → index-77cc52a0.js} +31 -31
- package/build/{index-7dfc3749.js → index-7857ab1f.js} +69 -42
- package/build/{index-7119ad58.js → index-7b782643.js} +16 -16
- package/build/{index-874bc841.js → index-7c60ded5.js} +1 -1
- package/build/{index-4c0426ae.js → index-802178e4.js} +6 -6
- package/build/{index-e14b0b46.js → index-82070fc5.js} +2 -2
- package/build/{index-5c0eda01.js → index-865b4577.js} +1 -1
- package/build/{index-800909c1.js → index-8733048c.js} +16 -16
- package/build/{index-affde547.js → index-8b27bc8b.js} +16 -16
- package/build/{index-287ecd6e.js → index-8c4675ad.js} +1 -1
- package/build/{index-c5b60608.js → index-9cb679a6.js} +2 -2
- package/build/{index-c0e3b169.js → index-a1afcde7.js} +13 -13
- package/build/{index-a725bde3.js → index-a3320154.js} +16 -16
- package/build/{index-ad8d7e7b.js → index-a3751eb3.js} +7 -7
- package/build/{index-e58f8880.js → index-adc245ae.js} +3 -3
- package/build/{index-69ef4ab1.js → index-b1f5562e.js} +3 -3
- package/build/{index-c7e56cd9.js → index-b2f7e794.js} +6 -6
- package/build/{index-0c619289.js → index-b4c4e2f6.js} +17 -17
- package/build/{index-2388d84f.js → index-b789cdea.js} +6 -6
- package/build/{index-25da41a4.js → index-be199de9.js} +2 -2
- package/build/{index-8e311a5f.js → index-be46ed0e.js} +24 -24
- package/build/{index-226cbfce.js → index-bee470e8.js} +2 -2
- package/build/{index-add0d6c0.js → index-c02e8354.js} +1 -1
- package/build/{index-882762d6.js → index-c5328c6c.js} +4 -4
- package/build/{index-09086f21.js → index-cc2bed5e.js} +17 -17
- package/build/{index-a115ceab.js → index-d66e037f.js} +32 -32
- package/build/{index-0f868222.js → index-d69b410f.js} +2 -2
- package/build/{index-5756d093.js → index-e2e56d71.js} +13 -13
- package/build/{index-fd2d1bb8.js → index-ef09c144.js} +10 -10
- package/build/{index-1420447f.js → index-f253a38c.js} +5 -5
- package/build/{index-6c13868f.js → index-f71d9ef2.js} +22 -22
- package/build/{index-ebc94a9a.js → index-f8050d0a.js} +18 -18
- package/build/{index-3b8b260b.js → index-fe813a71.js} +18 -18
- package/build/index.js +117 -116
- package/build/interfaces/healthTools.d.ts +12 -0
- package/build/{labelSorting-15db0391.js → labelSorting-7550b906.js} +4 -4
- package/build/lead/LeadGenForm/LeadGenForm.d.ts +41 -0
- package/build/lead/LeadGenForm/LeadGenForm.styled.d.ts +5 -0
- package/build/lead/LeadGenForm/LeadGenThankYou.d.ts +20 -0
- package/build/lead/LeadGenForm/index.d.ts +1 -0
- package/build/lead/LeadGenForm/textField/index.d.ts +13 -0
- package/build/lead/LeadGenForm/textField/index.styled.d.ts +11 -0
- package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +25 -0
- package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContext.d.ts +25 -0
- package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxWrapper.d.ts +30 -0
- package/build/lead/LeadGenSubscriptionBox/index.d.ts +1 -0
- package/build/lead/helpers.d.ts +51 -1
- package/build/lead/index.d.ts +2 -1
- package/build/lead/services/index.d.ts +14 -0
- package/build/lead.js +1350 -427
- package/build/{logoIcon-fdb02772.js → logoIcon-2198a6cf.js} +2 -2
- package/build/mantine.js +22 -22
- package/build/misc.js +17 -17
- 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 +74 -73
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +16 -16
- package/build/navigation.js +45 -45
- package/build/navigationLogoutPopup.js +9 -9
- package/build/navigationProfileButton.js +23 -23
- package/build/onboardingV2.js +28 -28
- package/build/organisms.js +49 -49
- package/build/{post-d04439ff.js → post-2c5aae3d.js} +2 -2
- package/build/profileNavigation.js +19 -19
- package/build/progressBar.js +1 -1
- package/build/pwg.js +22 -22
- package/build/ssoV2/api/featureFlag.d.ts +2 -1
- package/build/ssoV2/index.d.ts +1 -0
- package/build/ssoV2/utils.d.ts +6 -0
- package/build/ssoV2.js +66 -71
- package/build/{store-232f617c.js → store-dd807202.js} +4 -4
- package/build/subot.js +43 -41
- package/build/surveyOrPremiumBanner.js +32 -31
- package/build/surveyQuestionCard.js +10 -10
- package/build/{surveyThankyouCard-13c84ac2.js → surveyThankyouCard-71fd8153.js} +5 -5
- package/build/together.js +55 -55
- package/build/togetherApiUtils.js +4 -4
- package/build/togetherAtoms.js +30 -30
- package/build/togetherComponentGlobalContext.js +4 -4
- package/build/togetherMolecules.js +50 -50
- package/build/togetherMoleculesCardAuthor.js +28 -28
- package/build/togetherMoleculesPostImagePreview.js +11 -11
- package/build/togetherMoleculesProfileDetail.js +38 -38
- package/build/togetherOrganisms.js +49 -49
- package/build/togetherRichTextEditor.js +17 -17
- package/build/togetherShareBox.js +10 -10
- package/build/{treePopoverMenu-478c3d3e.js → treePopoverMenu-c32f6666.js} +19 -19
- package/build/{types-0be265bd.js → types-27d92fe1.js} +2 -2
- package/build/types.js +2 -2
- package/build/{useCategory-543ca902.js → useCategory-db7ef553.js} +5 -5
- package/build/{useHealthToolCache-a41bde03.js → useHealthToolCache-44b62d5b.js} +1 -1
- package/build/{useMantineLocale-70dd26a2.js → useMantineLocale-8146a689.js} +6 -6
- package/build/{usePlacesAutocomplete-5ea8c8b8.js → usePlacesAutocomplete-d46f3a91.js} +1 -1
- package/build/{useScreenSize-7132266a.js → useScreenSize-7b8652ca.js} +2 -2
- package/build/useTogetherAuthRequiredAction.js +9 -9
- package/build/{utils-ff6daaae.js → utils-21fc3d78.js} +2 -2
- package/build/{utils-eb070c44.js → utils-2b62f9f5.js} +2 -2
- package/build/utils-5570c388.js +63 -0
- package/build/{utils-c2fa5271.js → utils-c203ac13.js} +3 -3
- package/build/vaccination.js +21 -21
- package/package.json +3 -3
- /package/build/{BMI_BOYS.percentile.monthly-10f37e5f.js → BMI_BOYS.percentile.monthly-f83d0242.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-a293dcaa.js → BMI_BOYS.percentile.weekly-db859897.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-2bf082d0.js → BMI_BOYS.percentile.yearly-0a039425.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-86f1d45e.js → BMI_BOYS.zscore.monthly-b82f9313.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-efb2b63f.js → BMI_BOYS.zscore.weekly-cf458186.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-8fceb03d.js → BMI_BOYS.zscore.yearly-23633ed6.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-6b372053.js → BMI_GIRLS.percentile.monthly-a195d3e8.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-bb66361d.js → BMI_GIRLS.percentile.weekly-26a0e155.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-018a7d3b.js → BMI_GIRLS.percentile.yearly-72a13496.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-064c0afd.js → BMI_GIRLS.zscore.monthly-71ea5c36.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-52ddf33d.js → BMI_GIRLS.zscore.weekly-c3b5a41d.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-36413152.js → BMI_GIRLS.zscore.yearly-cfc420b0.js} +0 -0
- /package/build/{ChevronDown-a17437ab.js → ChevronDown-ccfd21a6.js} +0 -0
- /package/build/{Close-3327bb64.js → Close-4bdc25d9.js} +0 -0
- /package/build/{Google-086a588c.js → Google-32f6e9ae.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-4f02f400.js → HEAD CIRCUM_BOYS.percentile.monthly-c7425207.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-22ab53c3.js → HEAD CIRCUM_BOYS.percentile.weekly-11bbd192.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-cc52df54.js → HEAD CIRCUM_BOYS.percentile.yearly-85dfe539.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-dac1ccb1.js → HEAD CIRCUM_BOYS.zscore.monthly-7d1301a5.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-08af27db.js → HEAD CIRCUM_BOYS.zscore.weekly-497aa967.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-91bef052.js → HEAD CIRCUM_BOYS.zscore.yearly-9322e349.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-f84b2e9f.js → HEAD CIRCUM_GIRLS.percentile.monthly-13e1c2c2.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-4121f6aa.js → HEAD CIRCUM_GIRLS.percentile.weekly-0940db8b.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-3dae8a29.js → HEAD CIRCUM_GIRLS.percentile.yearly-b91da0f0.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-b176fc39.js → HEAD CIRCUM_GIRLS.zscore.monthly-56cbba76.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-a546a916.js → HEAD CIRCUM_GIRLS.zscore.weekly-ba6755bf.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-be755c9e.js → HEAD CIRCUM_GIRLS.zscore.yearly-35e6a30c.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-47d616cc.js → HEIGHT_BOYS.percentile.monthly-34d3fdc4.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-e060d65b.js → HEIGHT_BOYS.percentile.weekly-a3eaff24.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-6644f4bd.js → HEIGHT_BOYS.percentile.yearly-d2444c3f.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-1f212106.js → HEIGHT_BOYS.zscore.monthly-f8be0c41.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-c13fc3db.js → HEIGHT_BOYS.zscore.weekly-8dbb3814.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-580eaf5e.js → HEIGHT_BOYS.zscore.yearly-1b27b566.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-8ad6547f.js → HEIGHT_GIRLS.percentile.monthly-e43bf4a8.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-0107d04e.js → HEIGHT_GIRLS.percentile.weekly-63128c3e.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-6d3757be.js → HEIGHT_GIRLS.percentile.yearly-8568f0a9.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-60249786.js → HEIGHT_GIRLS.zscore.monthly-2c215347.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-289d84c1.js → HEIGHT_GIRLS.zscore.weekly-15ce8d55.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-2e32a8dc.js → HEIGHT_GIRLS.zscore.yearly-f02101c0.js} +0 -0
- /package/build/{Locale-3ec13cec.js → Locale-bd59384d.js} +0 -0
- /package/build/{Visible-27cf823f.js → Visible-92287ae1.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-b3f3b81e.js → WEIGHT_BOYS.percentile.monthly-3c53ce2b.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-14c8e69a.js → WEIGHT_BOYS.percentile.weekly-0b4dfdc1.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-121f2d6f.js → WEIGHT_BOYS.percentile.yearly-7e0f4e61.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-603e0ba1.js → WEIGHT_BOYS.zscore.monthly-a847e3b8.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-bc074551.js → WEIGHT_BOYS.zscore.weekly-73e11170.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-47181031.js → WEIGHT_BOYS.zscore.yearly-9ac3acb2.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-993be10a.js → WEIGHT_GIRLS.percentile.monthly-ecb9c9d9.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-62fd1063.js → WEIGHT_GIRLS.percentile.weekly-8b2d126a.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-22298a1d.js → WEIGHT_GIRLS.percentile.yearly-80d6691d.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-632bb248.js → WEIGHT_GIRLS.zscore.monthly-2b5cc87c.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-b9d5531f.js → WEIGHT_GIRLS.zscore.weekly-eb17366f.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-53922a8a.js → WEIGHT_GIRLS.zscore.yearly-3813bf19.js} +0 -0
- /package/build/{animation-7c375f00.js → animation-c368926c.js} +0 -0
- /package/build/{constants-9812921e.js → constants-29fd5d65.js} +0 -0
- /package/build/{constants-74b40e24.js → constants-78c956e4.js} +0 -0
- /package/build/{constants-6173f4d3.js → constants-bd2e9a70.js} +0 -0
- /package/build/{dataTransform-2080190f.js → dataTransform-98f1dd92.js} +0 -0
- /package/build/{doctor-db5b3a08.js → doctor-09a95c49.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-b2fbde58.js → BMI_BOYS.percentile.monthly-e380fd79.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-e2a6e321.js → BMI_BOYS.percentile.weekly-55f8a9cf.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-c4f2dba6.js → BMI_BOYS.percentile.yearly-8ef771b4.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-5a02a7e7.js → BMI_BOYS.zscore.monthly-b4cd99ce.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-375a6e09.js → BMI_BOYS.zscore.weekly-2f51eed4.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-908aa5c5.js → BMI_BOYS.zscore.yearly-4388a844.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-45257944.js → BMI_GIRLS.percentile.monthly-79579370.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-b803ab84.js → BMI_GIRLS.percentile.weekly-4325a562.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-4adaee47.js → BMI_GIRLS.percentile.yearly-80cb63c3.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-08fa2e78.js → BMI_GIRLS.zscore.monthly-75a23515.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-8a5a0cc4.js → BMI_GIRLS.zscore.weekly-404ae543.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-12fac94b.js → BMI_GIRLS.zscore.yearly-21af74ac.js} +0 -0
- /package/build/esm/{ChevronDown-b28713eb.js → ChevronDown-8dc4a472.js} +0 -0
- /package/build/esm/{Close-f0b36f29.js → Close-92688f4f.js} +0 -0
- /package/build/esm/{Google-e2f15030.js → Google-cffaa0bb.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-2cbb37c6.js → HEAD CIRCUM_BOYS.percentile.monthly-628a2084.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-f0c10612.js → HEAD CIRCUM_BOYS.percentile.weekly-3abb626a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-49c0ea9e.js → HEAD CIRCUM_BOYS.percentile.yearly-ef24237d.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-24de3e6e.js → HEAD CIRCUM_BOYS.zscore.monthly-7a2680b3.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-3229b49b.js → HEAD CIRCUM_BOYS.zscore.weekly-906eed27.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-ea126dd5.js → HEAD CIRCUM_BOYS.zscore.yearly-24cce7f9.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-10c5c259.js → HEAD CIRCUM_GIRLS.percentile.monthly-392f3c6d.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-97d7a740.js → HEAD CIRCUM_GIRLS.percentile.weekly-85724b5f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-54793546.js → HEAD CIRCUM_GIRLS.percentile.yearly-f5b3ea5f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-1891d83b.js → HEAD CIRCUM_GIRLS.zscore.monthly-51af5ab5.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-d7d67885.js → HEAD CIRCUM_GIRLS.zscore.weekly-05c3f036.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-5383d6e8.js → HEAD CIRCUM_GIRLS.zscore.yearly-72a30df5.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-241818f0.js → HEIGHT_BOYS.percentile.monthly-6e5a2f2d.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-08b28f2f.js → HEIGHT_BOYS.percentile.weekly-efd39949.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-5ef28b77.js → HEIGHT_BOYS.percentile.yearly-0c99b795.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-5b8a92b5.js → HEIGHT_BOYS.zscore.monthly-182ec26e.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-4d2c4988.js → HEIGHT_BOYS.zscore.weekly-ca821dc5.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-e75f9c72.js → HEIGHT_BOYS.zscore.yearly-d4b55d1e.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-674da5df.js → HEIGHT_GIRLS.percentile.monthly-d732f78f.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-fcd5d928.js → HEIGHT_GIRLS.percentile.weekly-1f8ac2b4.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-5fd41c99.js → HEIGHT_GIRLS.percentile.yearly-aab892cd.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-e15897b0.js → HEIGHT_GIRLS.zscore.monthly-966d7757.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-44462497.js → HEIGHT_GIRLS.zscore.weekly-9d6152fe.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-26d6882b.js → HEIGHT_GIRLS.zscore.yearly-beb3f557.js} +0 -0
- /package/build/esm/{Locale-30c9e22b.js → Locale-d2c107b5.js} +0 -0
- /package/build/esm/{Visible-2a078115.js → Visible-04146e00.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-566f8c46.js → WEIGHT_BOYS.percentile.monthly-a0ad8d73.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-313b717d.js → WEIGHT_BOYS.percentile.weekly-1ff70d05.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-273a7590.js → WEIGHT_BOYS.percentile.yearly-b5c7f873.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-3f245a8e.js → WEIGHT_BOYS.zscore.monthly-83b9c79f.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-f8eaba15.js → WEIGHT_BOYS.zscore.weekly-aed9472c.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-b50a16e0.js → WEIGHT_BOYS.zscore.yearly-5c0bafcf.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-150ff816.js → WEIGHT_GIRLS.percentile.monthly-3c54cdc8.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-f0e33f7c.js → WEIGHT_GIRLS.percentile.weekly-a726acfa.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-e83f3340.js → WEIGHT_GIRLS.percentile.yearly-81e7c09b.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-ca8e886a.js → WEIGHT_GIRLS.zscore.monthly-fd6bf4be.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-3422283f.js → WEIGHT_GIRLS.zscore.weekly-8a4e2b0b.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-89cc60fc.js → WEIGHT_GIRLS.zscore.yearly-57ad5159.js} +0 -0
- /package/build/esm/{animation-83e566a1.js → animation-2c87bd05.js} +0 -0
- /package/build/esm/{constants-87be1115.js → constants-25a0420c.js} +0 -0
- /package/build/esm/{constants-e25cf9e6.js → constants-7b1877ec.js} +0 -0
- /package/build/esm/{constants-e51715b9.js → constants-deeb4d52.js} +0 -0
- /package/build/esm/{dataTransform-5f5c268f.js → dataTransform-de91215a.js} +0 -0
- /package/build/esm/{doctor-6e50c41b.js → doctor-e90b52ca.js} +0 -0
- /package/build/esm/{index-b790ab36.js → index-50a50724.js} +0 -0
- /package/build/esm/{index-98b45aee.js → index-6f1aba31.js} +0 -0
- /package/build/esm/{index-33be988b.js → index-7843fb5f.js} +0 -0
- /package/build/esm/{index-87ccfbc3.js → index-a0a30c17.js} +0 -0
- /package/build/esm/{index-1760e6f9.js → index-a8ca5aeb.js} +0 -0
- /package/build/esm/{index-f432114d.js → index-c2209669.js} +0 -0
- /package/build/esm/{index-56453ce7.js → index-d9c00d74.js} +0 -0
- /package/build/esm/{index-aa0cac72.js → index-e74f696a.js} +0 -0
- /package/build/esm/{index-e8ab15d1.js → index-ed8a21dd.js} +0 -0
- /package/build/esm/{index.styles-fc247d2b.js → index.styles-cdf78679.js} +0 -0
- /package/build/esm/{localizeNumberFormat-1070c676.js → localizeNumberFormat-8c01e2ef.js} +0 -0
- /package/build/esm/{normalizeLink-c05fdfc5.js → normalizeLink-f1c2f1a6.js} +0 -0
- /package/build/esm/{number-f96b1839.js → number-643052be.js} +0 -0
- /package/build/esm/{other-0e16ad2c.js → other-c0cc5584.js} +0 -0
- /package/build/esm/{paths-c46294bb.js → paths-4737ee59.js} +0 -0
- /package/build/esm/{translationsContext-e7437900.js → translationsContext-045786e4.js} +0 -0
- /package/build/esm/{tslib.es6-2722ba04.js → tslib.es6-913c164a.js} +0 -0
- /package/build/esm/{types-d3a3bb8d.js → types-08548ac0.js} +0 -0
- /package/build/esm/{useIsInit-30670a8c.js → useIsInit-7fe00a6e.js} +0 -0
- /package/build/esm/{useOutsideClick-3bef7b63.js → useOutsideClick-2c1abf56.js} +0 -0
- /package/build/esm/{useScrollbarSize-5227d3eb.js → useScrollbarSize-4a361956.js} +0 -0
- /package/build/esm/{useUniqueId-ef981bd3.js → useUniqueId-dc775b08.js} +0 -0
- /package/build/esm/{utils-dded2ff0.js → utils-cea86c7b.js} +0 -0
- /package/build/{index-525b6eac.js → index-0e1942ed.js} +0 -0
- /package/build/{index-d97139d4.js → index-175813bc.js} +0 -0
- /package/build/{index-51d7abbd.js → index-4b72e83e.js} +0 -0
- /package/build/{index-df8b9216.js → index-59472ea2.js} +0 -0
- /package/build/{index-5be55f19.js → index-5a138fcc.js} +0 -0
- /package/build/{index-0fb8b8de.js → index-6bfb59f4.js} +0 -0
- /package/build/{index-369a12cb.js → index-bfa5c241.js} +0 -0
- /package/build/{index-7a9ad817.js → index-cc012b11.js} +0 -0
- /package/build/{index-86260dcd.js → index-fdf38e42.js} +0 -0
- /package/build/{index.styles-169c9e74.js → index.styles-89ab190d.js} +0 -0
- /package/build/{localizeNumberFormat-d879a6cd.js → localizeNumberFormat-07e9360c.js} +0 -0
- /package/build/{normalizeLink-13fc5fda.js → normalizeLink-28d21e3a.js} +0 -0
- /package/build/{number-6ffd4d54.js → number-af276dca.js} +0 -0
- /package/build/{other-2ea06ff0.js → other-763dcd40.js} +0 -0
- /package/build/{paths-19a19cad.js → paths-c76a3551.js} +0 -0
- /package/build/{translationsContext-526f0a76.js → translationsContext-98a72507.js} +0 -0
- /package/build/{tslib.es6-4faf0cc4.js → tslib.es6-db3140a3.js} +0 -0
- /package/build/{types-dd7c143c.js → types-95744672.js} +0 -0
- /package/build/{useIsInit-9a0300c1.js → useIsInit-81cd34a6.js} +0 -0
- /package/build/{useOutsideClick-39a8a328.js → useOutsideClick-e738361b.js} +0 -0
- /package/build/{useScrollbarSize-e2a9b904.js → useScrollbarSize-616206df.js} +0 -0
- /package/build/{useUniqueId-57c444e3.js → useUniqueId-cc1feaa4.js} +0 -0
- /package/build/{utils-42cb419c.js → utils-f3cc3b6c.js} +0 -0
package/build/esm/lead.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { _ as __rest, a as __awaiter } from './tslib.es6-
|
|
2
|
-
import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext, useCallback } from 'react';
|
|
3
|
-
import { createStyles, Box,
|
|
1
|
+
import { _ as __rest, a as __awaiter } from './tslib.es6-913c164a.js';
|
|
2
|
+
import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext, forwardRef, useCallback, useImperativeHandle, memo } from 'react';
|
|
3
|
+
import { createStyles, Box, Input as Input$1, clsx, Autocomplete, Checkbox as Checkbox$1, Radio as Radio$1, Select as Select$1, TextInput, NumberInput as NumberInput$1, Button as Button$2, Portal, Transition, Overlay } from '@mantine/core';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import debounce from 'lodash/debounce';
|
|
6
|
-
import { createFormContext } from '@mantine/form';
|
|
7
|
-
import { u as useTranslations } from './index-
|
|
8
|
-
import { T as TranslationsContext } from './translationsContext-
|
|
6
|
+
import { createFormContext, useForm } from '@mantine/form';
|
|
7
|
+
import { u as useTranslations } from './index-00bc9d15.js';
|
|
8
|
+
import { T as TranslationsContext } from './translationsContext-045786e4.js';
|
|
9
9
|
import { getCookie, setCookie } from './miscCookieHelper.js';
|
|
10
|
-
import { b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-
|
|
11
|
-
import { T as Text } from './index-
|
|
12
|
-
import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-
|
|
13
|
-
import { D as DatePicker } from './index-
|
|
14
|
-
import { M as MAPPED_LOCALE } from './utils-
|
|
15
|
-
import '@mantine/dates';
|
|
16
|
-
import { Z as ZINDEX_SSO } from './index-
|
|
17
|
-
import './index-
|
|
18
|
-
import './index-
|
|
19
|
-
import './useMantineLocale-
|
|
20
|
-
import { B as Button$1 } from './index-
|
|
21
|
-
import './index.styles-
|
|
10
|
+
import { b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-cea86c7b.js';
|
|
11
|
+
import { T as Text } from './index-2b8cedcb.js';
|
|
12
|
+
import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-8ec915a3.js';
|
|
13
|
+
import { D as DatePicker } from './index-ed02b87c.js';
|
|
14
|
+
import { M as MAPPED_LOCALE } from './utils-6fdbff97.js';
|
|
15
|
+
import { DateInput } from '@mantine/dates';
|
|
16
|
+
import { Z as ZINDEX_SSO } from './index-1d1047ac.js';
|
|
17
|
+
import './index-ad569b96.js';
|
|
18
|
+
import './index-6f1aba31.js';
|
|
19
|
+
import './useMantineLocale-55437870.js';
|
|
20
|
+
import { B as Button$1 } from './index-becd0fee.js';
|
|
21
|
+
import './index.styles-cdf78679.js';
|
|
22
22
|
import { useClickOutside } from '@mantine/hooks';
|
|
23
|
-
import './other-
|
|
24
|
-
import './index-
|
|
25
|
-
import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-
|
|
26
|
-
import { B as Button } from './index-
|
|
27
|
-
import { H as Heading$1 } from './index-
|
|
23
|
+
import './other-c0cc5584.js';
|
|
24
|
+
import './index-94209fbe.js';
|
|
25
|
+
import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-76552e60.js';
|
|
26
|
+
import { B as Button } from './index-fbfb2e92.js';
|
|
27
|
+
import { H as Heading$1 } from './index-7955003f.js';
|
|
28
|
+
import styled from '@emotion/styled';
|
|
28
29
|
import { v1 } from 'uuid';
|
|
29
|
-
import { i as isVideo } from './index-b790ab36.js';
|
|
30
|
-
import { D as DrawerComponent } from './index-7ea5f40c.js';
|
|
31
|
-
import { u as useScreenSize } from './useScreenSize-fac76c9d.js';
|
|
32
|
-
import { createPortal } from 'react-dom';
|
|
33
30
|
import { css } from '@emotion/react';
|
|
34
|
-
import styled from '@emotion/styled';
|
|
35
31
|
import { theme } from './miscTheme.js';
|
|
36
|
-
import {
|
|
32
|
+
import { i as isVideo } from './index-50a50724.js';
|
|
33
|
+
import { D as DrawerComponent } from './index-d146d365.js';
|
|
34
|
+
import { u as useScreenSize } from './useScreenSize-5dfcff9a.js';
|
|
35
|
+
import { createPortal } from 'react-dom';
|
|
36
|
+
import { C as Close } from './Close-92688f4f.js';
|
|
37
37
|
import '@hhgtech/icons/other';
|
|
38
38
|
import '@mantine/carousel';
|
|
39
|
-
import './Locale-
|
|
39
|
+
import './Locale-d2c107b5.js';
|
|
40
40
|
import 'classnames';
|
|
41
|
-
import './useUniqueId-
|
|
41
|
+
import './useUniqueId-dc775b08.js';
|
|
42
42
|
import './constantsSite.js';
|
|
43
43
|
import '@hhgtech/icons/core';
|
|
44
44
|
import 'date-fns/locale';
|
|
@@ -72,7 +72,7 @@ if (sessionStorage.getItem('insider_object')) {
|
|
|
72
72
|
}
|
|
73
73
|
const docLang = document.documentElement.lang;
|
|
74
74
|
// TODO: country code
|
|
75
|
-
const LEAD_LOCALE_DATA = {
|
|
75
|
+
const LEAD_LOCALE_DATA$1 = {
|
|
76
76
|
'vi-VN': {
|
|
77
77
|
popupLang: 'vi',
|
|
78
78
|
countryCode: 'vn',
|
|
@@ -114,7 +114,7 @@ const LEAD_LOCALE_DATA = {
|
|
|
114
114
|
countryCodeNumber: 91,
|
|
115
115
|
},
|
|
116
116
|
};
|
|
117
|
-
const LEAD_LOCALE = LEAD_LOCALE_DATA[docLang] || LEAD_LOCALE_DATA['vi-VN'];
|
|
117
|
+
const LEAD_LOCALE = LEAD_LOCALE_DATA$1[docLang] || LEAD_LOCALE_DATA$1['vi-VN'];
|
|
118
118
|
function LEAD_RESET_VAR() {
|
|
119
119
|
// LEAD_CURRENT_URL = location.href.toLowerCase();
|
|
120
120
|
LEAD_CURRENT_URL =
|
|
@@ -135,6 +135,11 @@ const LEAD_TIMEZONE_DATA = {
|
|
|
135
135
|
9: 'Asia/Manila', // Philippines / Filipinos Site
|
|
136
136
|
};
|
|
137
137
|
|
|
138
|
+
const LEADGEN_ACTIONS = {
|
|
139
|
+
SHOW: 'SHOW',
|
|
140
|
+
SCROLL: 'SCROLL',
|
|
141
|
+
TIME: 'TIME',
|
|
142
|
+
};
|
|
138
143
|
const LEADGEN_LAYOUT = {
|
|
139
144
|
LightBoxA: 'LightBoxA',
|
|
140
145
|
LightBoxB: 'LightBoxB',
|
|
@@ -164,8 +169,10 @@ const LEADGEN_BLOCK = {
|
|
|
164
169
|
DropdownBlock: 'DropdownBlock',
|
|
165
170
|
CheckboxBlock: 'CheckboxBlock',
|
|
166
171
|
TncBlock: 'TncBlock',
|
|
172
|
+
TitleBlock: 'TitleBlock',
|
|
173
|
+
SubtitleBlock: 'SubtitleBlock',
|
|
167
174
|
};
|
|
168
|
-
const
|
|
175
|
+
const LEADGEN_BLOCK_INPUT = [
|
|
169
176
|
LEADGEN_BLOCK.TextBlock,
|
|
170
177
|
LEADGEN_BLOCK.NumberBlock,
|
|
171
178
|
LEADGEN_BLOCK.DateBlock,
|
|
@@ -181,6 +188,48 @@ const LEADGEN_BLOCK_IN_FORM = [
|
|
|
181
188
|
LEADGEN_BLOCK.TncBlock,
|
|
182
189
|
];
|
|
183
190
|
const SSO_MAP_LEAD = ['name', 'email', 'birthday', 'phone', 'gender'];
|
|
191
|
+
const LEAD_LOCALE_DATA = {
|
|
192
|
+
'vi-VN': {
|
|
193
|
+
popupLang: 'vi',
|
|
194
|
+
countryCode: 'vn',
|
|
195
|
+
countryCodeNumber: 84,
|
|
196
|
+
},
|
|
197
|
+
'id-ID': {
|
|
198
|
+
popupLang: 'id',
|
|
199
|
+
countryCode: 'id',
|
|
200
|
+
countryCodeNumber: 62,
|
|
201
|
+
},
|
|
202
|
+
'th-TH': {
|
|
203
|
+
popupLang: 'th',
|
|
204
|
+
countryCode: 'th',
|
|
205
|
+
countryCodeNumber: 66,
|
|
206
|
+
},
|
|
207
|
+
'ms-MY': {
|
|
208
|
+
popupLang: 'ms',
|
|
209
|
+
countryCode: 'my',
|
|
210
|
+
countryCodeNumber: 60,
|
|
211
|
+
},
|
|
212
|
+
'zh-TW': {
|
|
213
|
+
popupLang: 'zh',
|
|
214
|
+
countryCode: 'tw',
|
|
215
|
+
countryCodeNumber: 886,
|
|
216
|
+
},
|
|
217
|
+
'km-KH': {
|
|
218
|
+
popupLang: 'km',
|
|
219
|
+
countryCode: 'kh',
|
|
220
|
+
countryCodeNumber: 855,
|
|
221
|
+
},
|
|
222
|
+
'my-MM': {
|
|
223
|
+
popupLang: 'my',
|
|
224
|
+
countryCode: 'mm',
|
|
225
|
+
countryCodeNumber: 95,
|
|
226
|
+
},
|
|
227
|
+
'hi-IN': {
|
|
228
|
+
popupLang: 'hi',
|
|
229
|
+
countryCode: 'in',
|
|
230
|
+
countryCodeNumber: 91,
|
|
231
|
+
},
|
|
232
|
+
};
|
|
184
233
|
const mappingSSOToLead = (userInfoProps) => {
|
|
185
234
|
var _a, _b;
|
|
186
235
|
try {
|
|
@@ -196,7 +245,7 @@ const mappingSSOToLead = (userInfoProps) => {
|
|
|
196
245
|
if (ssoKey === 'birthday') {
|
|
197
246
|
const dob = dayjs(initValue, 'YYYY-MM-DD', true);
|
|
198
247
|
if (dob.isValid()) {
|
|
199
|
-
user.birthday = dob;
|
|
248
|
+
user.birthday = dob.toDate();
|
|
200
249
|
}
|
|
201
250
|
}
|
|
202
251
|
else if (ssoKey === 'gender') {
|
|
@@ -219,6 +268,46 @@ const mappingSSOToLead = (userInfoProps) => {
|
|
|
219
268
|
catch (error) {
|
|
220
269
|
return;
|
|
221
270
|
}
|
|
271
|
+
};
|
|
272
|
+
const formatCampaignDetail = (campaign) => {
|
|
273
|
+
if (!campaign) {
|
|
274
|
+
return {};
|
|
275
|
+
}
|
|
276
|
+
try {
|
|
277
|
+
const { extra_fields, thank_you_image } = campaign || {};
|
|
278
|
+
const { textBlocks: exTextBlocks, imageBlocks: exImageBlocks, listBlockAdded: exListBlockAdded, listBlockThankyou: exListBlockThankyou, actionBlocks: exActionBlocks, } = extra_fields;
|
|
279
|
+
const textBlocks = JSON.parse(exTextBlocks);
|
|
280
|
+
const imageBlocks = JSON.parse(exImageBlocks);
|
|
281
|
+
const listBlockAdded = JSON.parse(exListBlockAdded);
|
|
282
|
+
const listBlockThankyou = JSON.parse(exListBlockThankyou);
|
|
283
|
+
const actionBlocks = JSON.parse(exActionBlocks);
|
|
284
|
+
const ThankYouBlock = {
|
|
285
|
+
image: { src: thank_you_image },
|
|
286
|
+
};
|
|
287
|
+
listBlockThankyou.forEach((block) => {
|
|
288
|
+
const { name, data } = block || {};
|
|
289
|
+
const { value: htmlText, align, newtab, url } = data || {};
|
|
290
|
+
switch (name) {
|
|
291
|
+
case LEADGEN_BLOCK.TitleBlock: {
|
|
292
|
+
ThankYouBlock.title = { htmlText, align };
|
|
293
|
+
}
|
|
294
|
+
case LEADGEN_BLOCK.SubtitleBlock: {
|
|
295
|
+
ThankYouBlock.description = { htmlText, align };
|
|
296
|
+
}
|
|
297
|
+
case LEADGEN_BLOCK.LinkButtonBlock: {
|
|
298
|
+
ThankYouBlock.button = { htmlText, newtab, url };
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
return Object.assign(Object.assign({}, campaign), { extra_fields: Object.assign(Object.assign({}, extra_fields), { textBlocks,
|
|
303
|
+
imageBlocks,
|
|
304
|
+
listBlockAdded,
|
|
305
|
+
listBlockThankyou,
|
|
306
|
+
actionBlocks }), ThankYouBlock });
|
|
307
|
+
}
|
|
308
|
+
catch (error) {
|
|
309
|
+
return {};
|
|
310
|
+
}
|
|
222
311
|
};
|
|
223
312
|
|
|
224
313
|
class Store {
|
|
@@ -229,6 +318,13 @@ class Store {
|
|
|
229
318
|
}
|
|
230
319
|
const leadStore = new Store();
|
|
231
320
|
|
|
321
|
+
const LEADGEN_API_METHOD = {
|
|
322
|
+
GET: 'get',
|
|
323
|
+
POST: 'POST',
|
|
324
|
+
};
|
|
325
|
+
const LEADGEN_API_PATH = {
|
|
326
|
+
V2_CAMPAIGN: 'api/v2/campaign',
|
|
327
|
+
};
|
|
232
328
|
const leadApi = {
|
|
233
329
|
call(_a) {
|
|
234
330
|
var { url, data = undefined } = _a, config = __rest(_a, ["url", "data"]);
|
|
@@ -332,8 +428,39 @@ const verifyOtpLead = ({ phone, otp, type, }) => {
|
|
|
332
428
|
},
|
|
333
429
|
});
|
|
334
430
|
};
|
|
431
|
+
const campaignGetByCode = (campaign_code) => {
|
|
432
|
+
return leadApi.call({
|
|
433
|
+
url: `${LEADGEN_API_PATH.V2_CAMPAIGN}/${campaign_code}`,
|
|
434
|
+
method: LEADGEN_API_METHOD.GET,
|
|
435
|
+
});
|
|
436
|
+
};
|
|
437
|
+
const campaignPostLead = ({ data }) => {
|
|
438
|
+
return leadApi.call({
|
|
439
|
+
url: 'api/v2/subscription-box',
|
|
440
|
+
method: LEADGEN_API_METHOD.POST,
|
|
441
|
+
data,
|
|
442
|
+
});
|
|
443
|
+
};
|
|
444
|
+
const campaignPostImpression = ({ code, action, title_article, ga_client_id, cookie_id, extra, url, referrer, }) => {
|
|
445
|
+
return leadApi.call({
|
|
446
|
+
url: `api/campaign/${code}/impression`,
|
|
447
|
+
method: LEADGEN_API_METHOD.POST,
|
|
448
|
+
data: {
|
|
449
|
+
action,
|
|
450
|
+
title_article,
|
|
451
|
+
cookie_id,
|
|
452
|
+
ga_client_id,
|
|
453
|
+
url,
|
|
454
|
+
extra,
|
|
455
|
+
referrer,
|
|
456
|
+
},
|
|
457
|
+
});
|
|
458
|
+
};
|
|
335
459
|
const Service = {
|
|
336
460
|
campaignGetById,
|
|
461
|
+
campaignGetByCode,
|
|
462
|
+
campaignPostLead,
|
|
463
|
+
campaignPostImpression,
|
|
337
464
|
validateEmailOrPhoneOnSubot,
|
|
338
465
|
validateEmailOrPhoneOnLeadGen,
|
|
339
466
|
validatePhoneNumberOnLeadGen,
|
|
@@ -1335,188 +1462,1187 @@ const getTranslations = (locale) => {
|
|
|
1335
1462
|
|
|
1336
1463
|
const LeadGenContext = createContext({});
|
|
1337
1464
|
|
|
1338
|
-
const
|
|
1339
|
-
|
|
1340
|
-
const
|
|
1341
|
-
const [
|
|
1342
|
-
|
|
1465
|
+
const LeadGenSubscriptionBoxContext = createContext({});
|
|
1466
|
+
const LeadGenSubscriptionBoxProvider = (props) => {
|
|
1467
|
+
const { campaign_code, apiUrl: apiUrlProps, apiSubotUrl, locale, forceCampaign: forceCampaignProps, children, } = props;
|
|
1468
|
+
const [forceCampaign, setForceCampaign] = useState(forceCampaignProps);
|
|
1469
|
+
const leadGenSubscriptionBoxValue = useMemo(() => (Object.assign(Object.assign({}, props), { forceCampaign })), [campaign_code, locale, forceCampaign]);
|
|
1470
|
+
const translationContextValue = { locale, values: getTranslations(locale) };
|
|
1343
1471
|
useEffect(() => {
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
img.addEventListener('load', () => {
|
|
1348
|
-
setWidth(img.naturalWidth);
|
|
1349
|
-
setHeight(img.naturalHeight);
|
|
1350
|
-
setLoaded(true);
|
|
1351
|
-
});
|
|
1352
|
-
img.addEventListener('error', () => {
|
|
1353
|
-
setWidth(16);
|
|
1354
|
-
setHeight(9);
|
|
1355
|
-
setLoaded(true);
|
|
1356
|
-
});
|
|
1357
|
-
img.src = src;
|
|
1472
|
+
if (forceCampaignProps) {
|
|
1473
|
+
setForceCampaign(forceCampaignProps);
|
|
1474
|
+
return;
|
|
1358
1475
|
}
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1476
|
+
if (campaign_code) {
|
|
1477
|
+
Service.campaignGetByCode(campaign_code).then((res) => {
|
|
1478
|
+
const { _data } = res || {};
|
|
1479
|
+
const { campaigns } = _data || {};
|
|
1480
|
+
setForceCampaign(formatCampaignDetail(campaigns));
|
|
1481
|
+
});
|
|
1363
1482
|
}
|
|
1364
|
-
}, [
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
};
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
React__default.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: svgClassName },
|
|
1374
|
-
React__default.createElement("path", { d: "M9.99981 10.8432L14.0583 14.9017C14.1691 15.0125 14.3083 15.0691 14.476 15.0717C14.6437 15.0743 14.7854 15.0176 14.9013 14.9017C15.0172 14.7858 15.0752 14.6453 15.0752 14.4802C15.0752 14.3151 15.0172 14.1746 14.9013 14.0587L10.8429 10.0002L14.9013 5.9417C15.0121 5.83094 15.0688 5.69172 15.0713 5.52402C15.0739 5.35634 15.0172 5.21456 14.9013 5.09866C14.7854 4.98276 14.6449 4.9248 14.4798 4.9248C14.3147 4.9248 14.1742 4.98276 14.0583 5.09866L9.99981 9.15712L5.94133 5.09866C5.83057 4.98789 5.69135 4.93122 5.52365 4.92866C5.35598 4.92609 5.21419 4.98276 5.09829 5.09866C4.98239 5.21456 4.92444 5.35506 4.92444 5.52018C4.92444 5.6853 4.98239 5.82581 5.09829 5.9417L9.15675 10.0002L5.09829 14.0587C4.98752 14.1694 4.93085 14.3087 4.9283 14.4763C4.92572 14.644 4.98239 14.7858 5.09829 14.9017C5.21419 15.0176 5.3547 15.0756 5.51982 15.0756C5.68493 15.0756 5.82544 15.0176 5.94133 14.9017L9.99981 10.8432Z" }))));
|
|
1375
|
-
|
|
1376
|
-
// url: imageBlocks.imageMobile.data.url
|
|
1377
|
-
// newTab: imageBlocks.imageMobile.data.newtab
|
|
1378
|
-
// imageMobile: campaignShow.image
|
|
1379
|
-
// imageDestkop: campaignShow.image_desktop
|
|
1380
|
-
const CenterTabLayout = ({ popupId, url, newTab, imageDestkop, imageMobile, onClose, onOtherSubmit, }) => {
|
|
1381
|
-
const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
|
|
1382
|
-
const { width: imageDestkopWidth, height: imageDestkopHeight, loaded: imageDestkopLoaded, } = useImageSize(imageDestkop);
|
|
1383
|
-
if (!imageMobileLoaded || !imageDestkopLoaded)
|
|
1384
|
-
return null;
|
|
1385
|
-
return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper", "data-popup-url": location.pathname, "data-popup-type": "center_tab" },
|
|
1386
|
-
React__default.createElement("div", { className: "le-center-tab-popup" },
|
|
1387
|
-
React__default.createElement("div", { style: { position: 'relative' } },
|
|
1388
|
-
React__default.createElement("a", { className: "js-popup-other-submit", href: url, target: newTab ? 'blank' : '_parent', onClick: onOtherSubmit },
|
|
1389
|
-
isVideo(imageMobile) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-mobile" },
|
|
1390
|
-
React__default.createElement("source", { src: imageMobile }))) : (React__default.createElement("img", { className: "le-only-mobile", src: imageMobile, style: {
|
|
1391
|
-
aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
|
|
1392
|
-
} })),
|
|
1393
|
-
isVideo(imageDestkop) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-desktop" },
|
|
1394
|
-
React__default.createElement("source", { src: imageDestkop }))) : (React__default.createElement("img", { className: "le-only-desktop", src: imageDestkop, style: {
|
|
1395
|
-
aspectRatio: `${imageDestkopWidth}/${imageDestkopHeight}`,
|
|
1396
|
-
} }))),
|
|
1397
|
-
React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))));
|
|
1398
|
-
};
|
|
1399
|
-
|
|
1400
|
-
// title: titleText
|
|
1401
|
-
// titleAlign: textBlocks.titleBlock.data.align
|
|
1402
|
-
// subtitle: textBlocks.subtitleBlock.data.value
|
|
1403
|
-
// subtitleAlign: textBlocks.subtitleBlock.data.align
|
|
1404
|
-
// url: actionBlocks.linkButtonBlock.data.url
|
|
1405
|
-
// urlText: actionBlocks.linkButtonBlock.data.value
|
|
1406
|
-
// newTab: actionBlocks.linkButtonBlock.data.newtab
|
|
1407
|
-
// imageMobile: campaignShow.image
|
|
1408
|
-
// imageDesktop: campaignShow.image_desktop
|
|
1409
|
-
const FloatingLayout = ({ popupId, url, title, urlText, titleAlign, subtitle, subtitleAlign, newTab, imageDesktop, imageMobile, onClose, onOtherSubmit, }) => {
|
|
1410
|
-
const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
|
|
1411
|
-
const { width: imageDesktopWidth, height: imageDesktopHeight, loaded: imageDesktopLoaded, } = useImageSize(imageDesktop);
|
|
1412
|
-
if (!imageMobileLoaded || !imageDesktopLoaded)
|
|
1413
|
-
return null;
|
|
1414
|
-
return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper lead-floating-wrapper", "data-popup-url": location.pathname, "data-popup-type": "floating" },
|
|
1415
|
-
React__default.createElement("aside", { className: "le-only-desktop" },
|
|
1416
|
-
React__default.createElement("div", { className: "le-floating-desktop" },
|
|
1417
|
-
React__default.createElement("div", { className: "le-floating-desktop-wrap", style: { position: 'relative', background: '#fff' } },
|
|
1418
|
-
imageDesktop ? (React__default.createElement("div", null,
|
|
1419
|
-
React__default.createElement("img", { style: {
|
|
1420
|
-
maxWidth: 120,
|
|
1421
|
-
borderTopLeftRadius: 5,
|
|
1422
|
-
borderBottomLeftRadius: 5,
|
|
1423
|
-
aspectRatio: `${imageDesktopWidth}/${imageDesktopHeight}`,
|
|
1424
|
-
}, src: imageDesktop }))) : null,
|
|
1425
|
-
React__default.createElement("div", { style: { padding: 20 } },
|
|
1426
|
-
React__default.createElement("div", { className: `le-floating-desktop-title le-text-align-${titleAlign}` }, title),
|
|
1427
|
-
React__default.createElement("div", { className: `le-floating-desktop-desc le-text-align-${subtitleAlign}` }, subtitle)),
|
|
1428
|
-
React__default.createElement("a", { target: newTab ? 'blank' : '_parent', style: { marginLeft: 35, textDecoration: 'none' }, href: url },
|
|
1429
|
-
React__default.createElement("button", { className: "le-joinbow-floating-btn js-popup-other-submit", onClick: onOtherSubmit }, urlText)),
|
|
1430
|
-
React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))),
|
|
1431
|
-
React__default.createElement("aside", { className: "le-only-mobile" },
|
|
1432
|
-
React__default.createElement("div", { className: "le-floating-mobile" },
|
|
1433
|
-
React__default.createElement("div", { className: "le-floating-mobile-wrap", style: { position: 'relative', background: '#fff' } },
|
|
1434
|
-
React__default.createElement("aside", { style: { display: 'flex', justifyContent: 'space-between' } },
|
|
1435
|
-
React__default.createElement("div", null,
|
|
1436
|
-
React__default.createElement("div", { className: `le-floating-mobile-title le-text-align-${titleAlign}` }, title),
|
|
1437
|
-
React__default.createElement("div", { className: `le-floating-mobile-desc le-text-align-${subtitleAlign}` }, subtitle)),
|
|
1438
|
-
imageMobile ? (React__default.createElement("div", null,
|
|
1439
|
-
React__default.createElement("img", { style: {
|
|
1440
|
-
marginLeft: 15,
|
|
1441
|
-
marginTop: 4,
|
|
1442
|
-
maxWidth: 100,
|
|
1443
|
-
aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
|
|
1444
|
-
}, src: imageMobile }))) : null),
|
|
1445
|
-
React__default.createElement("div", { style: { textAlign: 'center', marginTop: 10 } },
|
|
1446
|
-
React__default.createElement("a", { target: newTab ? 'blank' : '_parent', href: url, style: { textDecoration: 'none' } },
|
|
1447
|
-
React__default.createElement("button", { className: "le-joinbow-floating-btn js-popup-other-submit", onClick: onOtherSubmit }, urlText))),
|
|
1448
|
-
React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" }))))));
|
|
1449
|
-
};
|
|
1450
|
-
|
|
1451
|
-
const ThankyouPopup = ({ title, titleAlign, subtitle, subtitleAlign, link, linkNewTab, linkText, image, }) => {
|
|
1452
|
-
const { width: imageWidth, height: imageHeight, loaded: imageLoaded, } = useImageSize(image);
|
|
1453
|
-
if (!imageLoaded)
|
|
1483
|
+
}, [campaign_code]);
|
|
1484
|
+
useEffect(() => {
|
|
1485
|
+
leadStore.apiLeadUrl = apiUrlProps;
|
|
1486
|
+
leadStore.apiSubotUrl = apiSubotUrl;
|
|
1487
|
+
return () => {
|
|
1488
|
+
setForceCampaign(null);
|
|
1489
|
+
};
|
|
1490
|
+
}, []);
|
|
1491
|
+
if (!forceCampaign || !(forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id)) {
|
|
1454
1492
|
return null;
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
maxHeight: 162,
|
|
1459
|
-
objectFit: 'cover',
|
|
1460
|
-
aspectRatio: `${imageWidth}/${imageHeight}`,
|
|
1461
|
-
}, loading: "lazy" }),
|
|
1462
|
-
title && (React__default.createElement("h1", { className: `le-thankyou-title le-text-align-${titleAlign}` }, title)),
|
|
1463
|
-
subtitle && (React__default.createElement("p", { className: `le-thankyou-subtitle le-text-align-${subtitleAlign}` }, subtitle.split('\n').map((text, idx, list) => {
|
|
1464
|
-
const isShowBr = idx < list.length - 1;
|
|
1465
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
1466
|
-
text,
|
|
1467
|
-
isShowBr && React__default.createElement("br", null)));
|
|
1468
|
-
}))),
|
|
1469
|
-
linkText && (React__default.createElement("div", null,
|
|
1470
|
-
React__default.createElement("a", { href: link, target: linkNewTab ? '_blank' : 'parrent', rel: "noreferrer" },
|
|
1471
|
-
React__default.createElement("button", { className: `lead-modal__btn ${LEAD_CLASS}` }, linkText)))))));
|
|
1493
|
+
}
|
|
1494
|
+
return (React__default.createElement(LeadGenSubscriptionBoxContext.Provider, { value: leadGenSubscriptionBoxValue },
|
|
1495
|
+
React__default.createElement(TranslationsContext.Provider, { value: translationContextValue }, children)));
|
|
1472
1496
|
};
|
|
1473
1497
|
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1498
|
+
// You can give context variables any name
|
|
1499
|
+
const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
|
|
1500
|
+
const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
|
|
1501
|
+
var _a;
|
|
1502
|
+
const { t } = useTranslations();
|
|
1503
|
+
const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
1504
|
+
const LEAD_LOCALE = LEAD_LOCALE_DATA[(_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.lang] ||
|
|
1505
|
+
LEAD_LOCALE_DATA['vi-VN'];
|
|
1506
|
+
const validateObj = useMemo(() => {
|
|
1507
|
+
const InputBlocks = [
|
|
1508
|
+
'TextBlock',
|
|
1509
|
+
'NumberBlock',
|
|
1510
|
+
'EmailBlock',
|
|
1511
|
+
'PhoneBlock',
|
|
1512
|
+
'DateBlock',
|
|
1513
|
+
'CheckboxBlock',
|
|
1514
|
+
'RadioBlock',
|
|
1515
|
+
'DropdownBlock',
|
|
1516
|
+
'PhoneOtpBlock',
|
|
1517
|
+
'WhatsappOtpBlock',
|
|
1518
|
+
'ZaloOtpBlock',
|
|
1519
|
+
'LocationBlock',
|
|
1520
|
+
'TncBlock',
|
|
1521
|
+
];
|
|
1522
|
+
// ALL are required and can skip if not touched yet
|
|
1523
|
+
const withSharedCheck = (name, cb,
|
|
1524
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1525
|
+
block) => {
|
|
1526
|
+
return (value) => {
|
|
1527
|
+
var _a;
|
|
1528
|
+
const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
|
|
1529
|
+
if (!formRef.current.isTouched(name))
|
|
1530
|
+
return;
|
|
1531
|
+
if ((typeof value === 'string' && value.replace(' ', '') === '') ||
|
|
1532
|
+
typeof value === 'undefined' ||
|
|
1533
|
+
value === '' ||
|
|
1534
|
+
(Array.isArray(value) && value.length === 0)) {
|
|
1535
|
+
return isBLockRequired
|
|
1536
|
+
? t('validator.required')
|
|
1537
|
+
: cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1538
|
+
}
|
|
1539
|
+
return cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1540
|
+
};
|
|
1541
|
+
};
|
|
1542
|
+
return listBlockAdded
|
|
1543
|
+
.filter((b) => InputBlocks.includes(b.name))
|
|
1544
|
+
.reduce((r, b) => {
|
|
1545
|
+
var _a;
|
|
1546
|
+
const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
|
|
1547
|
+
if (b.name === 'NumberBlock') {
|
|
1548
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1549
|
+
if (value && isNaN(Number(value))) {
|
|
1550
|
+
return t('validator.number');
|
|
1551
|
+
}
|
|
1552
|
+
}, b) });
|
|
1553
|
+
}
|
|
1554
|
+
else if (b.name === 'EmailBlock') {
|
|
1555
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1556
|
+
if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
1557
|
+
return t('validator.email');
|
|
1558
|
+
}
|
|
1559
|
+
if (!value)
|
|
1560
|
+
return;
|
|
1561
|
+
validatingEmailRef.current = true;
|
|
1562
|
+
setTimeout(() => {
|
|
1563
|
+
formRef.current.setFieldError(b.data.value, 'Validating...');
|
|
1564
|
+
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1565
|
+
email: value,
|
|
1566
|
+
})
|
|
1567
|
+
.then((tKey) => {
|
|
1568
|
+
if (tKey) {
|
|
1569
|
+
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1570
|
+
}
|
|
1571
|
+
else {
|
|
1572
|
+
formRef.current.clearFieldError(b.data.value);
|
|
1573
|
+
}
|
|
1574
|
+
validatingEmailRef.current = false;
|
|
1575
|
+
})
|
|
1576
|
+
.catch((e) => {
|
|
1577
|
+
console.error(e);
|
|
1578
|
+
formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
|
|
1579
|
+
validatingEmailRef.current = false;
|
|
1580
|
+
});
|
|
1581
|
+
}, 200);
|
|
1582
|
+
}, b) });
|
|
1583
|
+
}
|
|
1584
|
+
else if (b.name === 'PhoneBlock' ||
|
|
1585
|
+
b.name === 'PhoneOtpBlock' ||
|
|
1586
|
+
b.name === 'ZaloOtpBlock' ||
|
|
1587
|
+
b.name === 'WhatsappOtpBlock') {
|
|
1588
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1589
|
+
if (value &&
|
|
1590
|
+
window.intlTelInputUtils &&
|
|
1591
|
+
!window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
|
|
1592
|
+
return t('validator.phone');
|
|
1593
|
+
}
|
|
1594
|
+
if (!value)
|
|
1595
|
+
return;
|
|
1596
|
+
validatingPhoneRef.current = true;
|
|
1597
|
+
setTimeout(() => {
|
|
1598
|
+
formRef.current.setFieldError(b.data.value, 'Validating...');
|
|
1599
|
+
if (b.data.singleSubmission) {
|
|
1600
|
+
checkUsedPhoneOnlyWithCache(campaignId, value)
|
|
1601
|
+
.then((tKey) => {
|
|
1602
|
+
if (tKey) {
|
|
1603
|
+
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1604
|
+
}
|
|
1605
|
+
else {
|
|
1606
|
+
formRef.current.clearFieldError(b.data.value);
|
|
1607
|
+
}
|
|
1608
|
+
validatingPhoneRef.current = false;
|
|
1609
|
+
})
|
|
1610
|
+
.catch((err) => {
|
|
1611
|
+
console.error(err);
|
|
1612
|
+
formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
|
|
1613
|
+
validatingPhoneRef.current = false;
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
else {
|
|
1617
|
+
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1618
|
+
phone: value,
|
|
1619
|
+
})
|
|
1620
|
+
.then((tKey) => {
|
|
1621
|
+
if (tKey) {
|
|
1622
|
+
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1623
|
+
}
|
|
1624
|
+
else {
|
|
1625
|
+
formRef.current.clearFieldError(b.data.value);
|
|
1626
|
+
}
|
|
1627
|
+
validatingPhoneRef.current = false;
|
|
1628
|
+
})
|
|
1629
|
+
.catch((e) => {
|
|
1630
|
+
console.error(e);
|
|
1631
|
+
formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
|
|
1632
|
+
validatingPhoneRef.current = false;
|
|
1633
|
+
});
|
|
1634
|
+
}
|
|
1635
|
+
}, 200);
|
|
1636
|
+
}, b) });
|
|
1637
|
+
}
|
|
1638
|
+
else if (b.name === 'DateBlock') {
|
|
1639
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1640
|
+
if (value && isNaN(Date.parse(value))) {
|
|
1641
|
+
return t('validator.date');
|
|
1642
|
+
}
|
|
1643
|
+
}, b) });
|
|
1644
|
+
}
|
|
1645
|
+
else if (b.name === 'TncBlock') {
|
|
1646
|
+
return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
|
|
1647
|
+
if (isRequired && !value) {
|
|
1648
|
+
return t('validator.required');
|
|
1649
|
+
}
|
|
1650
|
+
}, b) });
|
|
1651
|
+
}
|
|
1652
|
+
else {
|
|
1653
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
|
|
1654
|
+
}
|
|
1655
|
+
}, {});
|
|
1656
|
+
}, [listBlockAdded.map((b) => b.name).join(',')]);
|
|
1657
|
+
const form = useLeadForm({
|
|
1658
|
+
validateInputOnChange: true,
|
|
1659
|
+
clearInputErrorOnChange: true,
|
|
1660
|
+
validate: validateObj,
|
|
1661
|
+
initialValues,
|
|
1662
|
+
});
|
|
1663
|
+
const formRef = useRef(form);
|
|
1664
|
+
formRef.current = form;
|
|
1665
|
+
return { form, validateObj };
|
|
1666
|
+
};
|
|
1667
|
+
|
|
1668
|
+
const PhoneInput = forwardRef((props, ref) => {
|
|
1669
|
+
const { defaultCountry, id: idProps, name, placeholder, label, labelElement, labelProps, description, descriptionProps, withAsterisk, inputMode, inputContainer, inputWrapperOrder, error, className, classNames, style, styles } = props, restProps = __rest(props, ["defaultCountry", "id", "name", "placeholder", "label", "labelElement", "labelProps", "description", "descriptionProps", "withAsterisk", "inputMode", "inputContainer", "inputWrapperOrder", "error", "className", "classNames", "style", "styles"]);
|
|
1670
|
+
const id = idProps || v1() + name;
|
|
1671
|
+
return (React__default.createElement(Input$1.Wrapper, { size: "md", label: label, labelElement: labelElement, labelProps: Object.assign({ htmlFor: id }, labelProps), description: description, descriptionProps: descriptionProps, withAsterisk: withAsterisk, inputMode: inputMode, inputContainer: inputContainer, inputWrapperOrder: inputWrapperOrder, error: error, "data-invalid": !!error, className: className, classNames: classNames, style: style, styles: styles },
|
|
1672
|
+
React__default.createElement("div", { className: "mantine-Input-wrapper" },
|
|
1673
|
+
React__default.createElement(Phone, Object.assign({}, restProps, { id: id, ref: ref, name: name, spellCheck: false, placeholder: placeholder, defaultCountry: defaultCountry, className: "mantine-Input-input", type: "tel", "data-control": "tel" })))));
|
|
1674
|
+
});
|
|
1675
|
+
|
|
1676
|
+
const StyledLeadGenFormInner = styled.div `
|
|
1677
|
+
display: flex;
|
|
1678
|
+
flex-wrap: wrap;
|
|
1679
|
+
gap: 8px;
|
|
1680
|
+
.leadgen-form_input {
|
|
1681
|
+
width: calc(50% - 4px);
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
.leadgen-form_input_checkbox {
|
|
1685
|
+
width: 100%;
|
|
1686
|
+
}
|
|
1687
|
+
`;
|
|
1688
|
+
|
|
1689
|
+
const cssInputNotShrink$1 = css `
|
|
1690
|
+
height: 100% !important;
|
|
1691
|
+
min-height: calc(var(--container-height, 56px) * 22 / 56);
|
|
1692
|
+
color: ${theme.colors.gray800};
|
|
1693
|
+
font-size: var(--input, 16px);
|
|
1694
|
+
line-height: calc(var(--container-height, 56px) * 22 / 56);
|
|
1695
|
+
border: none !important;
|
|
1696
|
+
border-radius: 0 !important;
|
|
1697
|
+
outline: none !important;
|
|
1698
|
+
box-shadow: none !important;
|
|
1699
|
+
padding: 0;
|
|
1700
|
+
cursor: pointer;
|
|
1701
|
+
opacity: 0;
|
|
1702
|
+
|
|
1703
|
+
::placeholder {
|
|
1704
|
+
color: ${theme.colors.gray400};
|
|
1705
|
+
}
|
|
1706
|
+
`;
|
|
1707
|
+
const cssInputShrink$1 = css `
|
|
1708
|
+
height: auto !important;
|
|
1709
|
+
cursor: text;
|
|
1710
|
+
opacity: 1;
|
|
1711
|
+
transition: 0.1s ease-in-out all;
|
|
1712
|
+
`;
|
|
1713
|
+
const cssLabelNotShrink$1 = css `
|
|
1714
|
+
position: absolute;
|
|
1715
|
+
top: calc(var(--container-height) / 2);
|
|
1716
|
+
left: var(--space-x, 16px);
|
|
1717
|
+
color: ${theme.colors.gray400};
|
|
1718
|
+
font-size: var(--label-not-shrink, 16px);
|
|
1719
|
+
font-weight: 400;
|
|
1720
|
+
line-height: calc(var(--container-height, 56px) * 18 / 56);
|
|
1721
|
+
margin: 0;
|
|
1722
|
+
z-index: 1;
|
|
1723
|
+
cursor: pointer;
|
|
1724
|
+
transform: translateY(-50%);
|
|
1725
|
+
transition: 0.125s ease-in all;
|
|
1726
|
+
`;
|
|
1727
|
+
const cssLabelShrink$1 = css `
|
|
1728
|
+
color: ${theme.colors.gray600};
|
|
1729
|
+
font-weight: 600;
|
|
1730
|
+
font-size: var(--label-shrink, 12px);
|
|
1731
|
+
top: calc(var(--container-height) * 7 / 56);
|
|
1732
|
+
transform: none;
|
|
1733
|
+
transition: 0.125s ease-out all;
|
|
1734
|
+
`;
|
|
1735
|
+
const cssWrapperInputNotShrink$1 = css `
|
|
1736
|
+
min-height: var(--container-height, 56px);
|
|
1737
|
+
display: flex;
|
|
1738
|
+
align-items: flex-end;
|
|
1739
|
+
border: 1px solid ${theme.colors.gray200};
|
|
1740
|
+
border-radius: 8px;
|
|
1741
|
+
background-color: #fff;
|
|
1742
|
+
padding-inline: var(--space-x, 16px);
|
|
1743
|
+
padding-block: var(--space-y-not-shrink, 16px);
|
|
1744
|
+
cursor: pointer;
|
|
1745
|
+
pointer-events: none;
|
|
1746
|
+
|
|
1747
|
+
&:has(.mantine-Input-rightSection) {
|
|
1748
|
+
padding-right: var(--container-height, 56px);
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
.mantine-Input-icon {
|
|
1752
|
+
display: none;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
.mantine-NumberInput-control {
|
|
1756
|
+
border-color: ${theme.colors.gray200};
|
|
1757
|
+
}
|
|
1758
|
+
`;
|
|
1759
|
+
const cssWrapperInputShrink$1 = css `
|
|
1760
|
+
height: auto;
|
|
1761
|
+
min-height: var(--container-height, 56px);
|
|
1762
|
+
padding-block: var(--space-y-shrink, 7px);
|
|
1763
|
+
cursor: text;
|
|
1764
|
+
pointer-events: auto;
|
|
1765
|
+
`;
|
|
1766
|
+
const cssInputWrapperError$1 = css `
|
|
1767
|
+
color: ${theme.colors.red800};
|
|
1768
|
+
font-size: 12px;
|
|
1769
|
+
line-height: 1.5;
|
|
1770
|
+
`;
|
|
1771
|
+
const StyledTextFieldContainer$1 = styled.div `
|
|
1772
|
+
--space-x: 16px;
|
|
1773
|
+
--space-y-not-shrink: 16px;
|
|
1774
|
+
--space-y-shrink: 7px;
|
|
1775
|
+
--container-height: 56px;
|
|
1776
|
+
--label-not-shrink: 16px;
|
|
1777
|
+
--label-shrink: 12px;
|
|
1778
|
+
--input: 16px;
|
|
1779
|
+
|
|
1780
|
+
position: relative;
|
|
1781
|
+
min-width: 100px;
|
|
1782
|
+
max-width: 100%;
|
|
1783
|
+
display: inline-block;
|
|
1784
|
+
|
|
1785
|
+
.textField_wrapper {
|
|
1786
|
+
display: inline-block;
|
|
1787
|
+
width: 100%;
|
|
1788
|
+
cursor: pointer;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
.mantine-InputWrapper-root {
|
|
1792
|
+
&[data-invalid='true'] {
|
|
1793
|
+
.mantine-Input-wrapper {
|
|
1794
|
+
border-color: ${theme.colors.red400};
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
.mantine-Input-wrapper {
|
|
1799
|
+
&:has([data-invalid]) {
|
|
1800
|
+
border-color: ${theme.colors.red400};
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
.mantine-InputWrapper-label {
|
|
1806
|
+
${cssLabelNotShrink$1}
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
.mantine-Input-wrapper {
|
|
1810
|
+
${cssWrapperInputNotShrink$1}
|
|
1811
|
+
|
|
1812
|
+
+ .mantine-Popover-dropdown[data-position="bottom-start"] {
|
|
1813
|
+
left: 0 !important;
|
|
1814
|
+
}
|
|
1815
|
+
+ .mantine-Popover-dropdown[data-position='top-start'] {
|
|
1816
|
+
top: unset !important;
|
|
1817
|
+
left: 0 !important;
|
|
1818
|
+
bottom: 100% !important;
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
.mantine-Input-input {
|
|
1823
|
+
${cssInputNotShrink$1}
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
&.textField_shrink,
|
|
1827
|
+
&:focus-within {
|
|
1828
|
+
.mantine-InputWrapper-label {
|
|
1829
|
+
${cssLabelShrink$1}
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
.mantine-Input-wrapper {
|
|
1833
|
+
${cssWrapperInputShrink$1}
|
|
1834
|
+
&.mantine-Select-wrapper {
|
|
1835
|
+
.mantine-Select-rightSection {
|
|
1836
|
+
pointer-events: auto !important;
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
.mantine-Input-input {
|
|
1842
|
+
${cssInputShrink$1}
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
&:has(.PhoneInput) {
|
|
1846
|
+
.mantine-InputWrapper-label {
|
|
1847
|
+
left: var(--space-x, 16px);
|
|
1848
|
+
}
|
|
1849
|
+
.PhoneInput {
|
|
1850
|
+
.PhoneInputInput {
|
|
1851
|
+
opacity: 1;
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
.PhoneInput {
|
|
1858
|
+
--phone-select: 75px;
|
|
1859
|
+
--phone-input-space-x: 8px;
|
|
1860
|
+
width: 100%;
|
|
1861
|
+
opacity: 1;
|
|
1862
|
+
border: none;
|
|
1863
|
+
.PhoneInputCountry {
|
|
1864
|
+
background-color: transparent;
|
|
1865
|
+
border: none;
|
|
1866
|
+
padding: 0;
|
|
1867
|
+
width: var(--phone-select, 75px);
|
|
1868
|
+
}
|
|
1869
|
+
.PhoneInputInput {
|
|
1870
|
+
flex: 1;
|
|
1871
|
+
min-width: 0;
|
|
1872
|
+
line-height: 1.5;
|
|
1873
|
+
outline: none !important;
|
|
1874
|
+
border: none;
|
|
1875
|
+
box-shadow: none;
|
|
1876
|
+
padding: 0 var(--phone-input-space-x, 8px);
|
|
1877
|
+
opacity: 0;
|
|
1878
|
+
color: ${theme.colors.gray800} !important;
|
|
1879
|
+
:focus {
|
|
1880
|
+
color: ${theme.colors.gray800} !important;
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
&:has(.PhoneInput) {
|
|
1886
|
+
.mantine-InputWrapper-label {
|
|
1887
|
+
left: calc(
|
|
1888
|
+
var(--space-x, 16px) + var(--phone-select, 75px) +
|
|
1889
|
+
var(--phone-input-space-x, 8px)
|
|
1890
|
+
);
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
`;
|
|
1894
|
+
const StyledChoiceFieldContainer$1 = styled.div `
|
|
1895
|
+
&.leadgen-form_checkbox,
|
|
1896
|
+
&.leadgen-form_radio {
|
|
1897
|
+
width: 100%;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
&.leadgen-form_dropdown {
|
|
1901
|
+
width: calc(50% - 12px);
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
.mantine-InputWrapper-root {
|
|
1905
|
+
display: block;
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
.mantine-InputWrapper-label {
|
|
1909
|
+
margin-bottom: 0.5rem;
|
|
1910
|
+
color: ${theme.colors.gray800};
|
|
1911
|
+
font-size: 16px;
|
|
1912
|
+
font-weight: 400;
|
|
1913
|
+
line-height: 1.5;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
.mantine-Radio-root,
|
|
1917
|
+
.mantine-Checkbox-root {
|
|
1918
|
+
gap: 8px;
|
|
1919
|
+
min-width: calc(50% - 4px);
|
|
1920
|
+
|
|
1921
|
+
input[type='radio'],
|
|
1922
|
+
input[type='checkbox'] {
|
|
1923
|
+
border-color: ${theme.colors.gray600};
|
|
1924
|
+
width: 18px;
|
|
1925
|
+
height: 18px;
|
|
1926
|
+
}
|
|
1927
|
+
input[type='checkbox'] {
|
|
1928
|
+
border-radius: 4px;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
&[data-checked='true'] {
|
|
1932
|
+
input[type='radio'],
|
|
1933
|
+
input[type='checkbox'] {
|
|
1934
|
+
border-color: ${theme.colors.primary600};
|
|
1935
|
+
+ svg {
|
|
1936
|
+
color: ${theme.colors.primary600};
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
input[type='radio'] {
|
|
1941
|
+
background-color: white;
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
.mantine-Checkbox-input {
|
|
1946
|
+
&:checked {
|
|
1947
|
+
border-color: ${theme.colors.primary600};
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
.mantine-Radio-inner,
|
|
1953
|
+
.mantine-Checkbox-inner {
|
|
1954
|
+
width: 24px;
|
|
1955
|
+
height: 24px;
|
|
1956
|
+
display: flex;
|
|
1957
|
+
align-items: center;
|
|
1958
|
+
justify-content: center;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
.mantine-Radio-body,
|
|
1962
|
+
.mantine-Checkbox-body {
|
|
1963
|
+
display: flex;
|
|
1964
|
+
align-items: center;
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
.mantine-Radio-label,
|
|
1968
|
+
.mantine-Checkbox-label {
|
|
1969
|
+
padding-left: 8px;
|
|
1970
|
+
color: ${theme.colors.gray800};
|
|
1971
|
+
font-size: 14px;
|
|
1972
|
+
line-height: 1.4;
|
|
1973
|
+
letter-spacing: -0.2px;
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
.leadgen-choiceContainer {
|
|
1977
|
+
display: flex;
|
|
1978
|
+
flex-wrap: wrap;
|
|
1979
|
+
align-items: flex-start;
|
|
1980
|
+
gap: 8px;
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
.mantine-InputWrapper-error {
|
|
1984
|
+
${cssInputWrapperError$1}
|
|
1985
|
+
}
|
|
1986
|
+
`;
|
|
1987
|
+
|
|
1988
|
+
const TextField$1 = (props) => {
|
|
1989
|
+
const { shrink: shrinkProps, onChangeShrink, className, children } = props, restProps = __rest(props, ["shrink", "onChangeShrink", "className", "children"]);
|
|
1990
|
+
const containerRef = useClickOutside(() => {
|
|
1991
|
+
if (shrinkProps) {
|
|
1992
|
+
return;
|
|
1993
|
+
}
|
|
1994
|
+
setShrink(false);
|
|
1995
|
+
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
|
|
1996
|
+
});
|
|
1997
|
+
const [shrink, setShrink] = useState(shrinkProps);
|
|
1998
|
+
const onClick = useCallback((e) => {
|
|
1999
|
+
setShrink(true);
|
|
2000
|
+
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
2001
|
+
if (shrink) {
|
|
2002
|
+
return;
|
|
2003
|
+
}
|
|
2004
|
+
const $textEl = e.currentTarget.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
|
|
2005
|
+
const $focusEl = $textEl.item($textEl.length - 1);
|
|
2006
|
+
if ($focusEl) {
|
|
2007
|
+
$focusEl.focus();
|
|
2008
|
+
setTimeout(() => {
|
|
2009
|
+
$focusEl.scrollIntoView({
|
|
2010
|
+
behavior: 'auto',
|
|
2011
|
+
block: 'center',
|
|
2012
|
+
inline: 'start',
|
|
2013
|
+
});
|
|
2014
|
+
}, 100);
|
|
2015
|
+
}
|
|
2016
|
+
}, [shrink]);
|
|
2017
|
+
useEffect(() => {
|
|
2018
|
+
setShrink(shrinkProps);
|
|
2019
|
+
}, [shrinkProps]);
|
|
2020
|
+
return (React__default.createElement(StyledTextFieldContainer$1, Object.assign({ shrink: shrink, className: clsx(className, 'textField', { textField_shrink: !!shrink }) }, restProps),
|
|
2021
|
+
React__default.createElement("div", { ref: containerRef, onClick: onClick, className: "textField_wrapper" }, children)));
|
|
2022
|
+
};
|
|
2023
|
+
const ChoiceField$1 = (props) => {
|
|
2024
|
+
const { children, className } = props, restProps = __rest(props, ["children", "className"]);
|
|
2025
|
+
return (React__default.createElement(StyledChoiceFieldContainer$1, Object.assign({ className: clsx(className, 'choiceField') }, restProps), children));
|
|
2026
|
+
};
|
|
2027
|
+
|
|
2028
|
+
const libraries = ['places'];
|
|
2029
|
+
const GoogleLocationBlock = (props) => {
|
|
2030
|
+
var _a;
|
|
2031
|
+
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
2032
|
+
const [LoadScript, setLoadScript] = useState(null);
|
|
2033
|
+
const [value, setValue] = useState(defaultValue || valueProps);
|
|
2034
|
+
const { predictions } = usePlacesAutocomplete(value, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
|
|
2035
|
+
const onChangeAutocomplete = useCallback((s) => {
|
|
2036
|
+
setValue(s);
|
|
2037
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
2038
|
+
}, []);
|
|
2039
|
+
const onClickItem = useCallback((item) => {
|
|
2040
|
+
/** For sure get value */
|
|
2041
|
+
setValue(item.value);
|
|
2042
|
+
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
2043
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
2044
|
+
}, [onChangeProps, predictions]);
|
|
2045
|
+
useEffect(() => {
|
|
2046
|
+
setValue(valueProps);
|
|
2047
|
+
}, [valueProps]);
|
|
2048
|
+
useEffect(() => {
|
|
2049
|
+
var _a, _b, _c;
|
|
2050
|
+
// only load extra google script when not yet loaded
|
|
2051
|
+
if (!((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.AutocompleteService) && !LoadScript) {
|
|
2052
|
+
import('@react-google-maps/api').then((m) => {
|
|
2053
|
+
setLoadScript(() => m.LoadScript);
|
|
2054
|
+
});
|
|
2055
|
+
}
|
|
2056
|
+
}, []);
|
|
2057
|
+
return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
2058
|
+
return { value: pred.description, label: pred.description };
|
|
2059
|
+
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
2060
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
2061
|
+
LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
|
|
2062
|
+
children));
|
|
2063
|
+
} }, restProps)));
|
|
2064
|
+
};
|
|
2065
|
+
|
|
2066
|
+
const LEADGEN_ORDER_INPUT_WRAPPER = [
|
|
2067
|
+
'label',
|
|
2068
|
+
'input',
|
|
2069
|
+
'description',
|
|
2070
|
+
'error',
|
|
2071
|
+
];
|
|
2072
|
+
const LeadGenForm = forwardRef((props, ref) => {
|
|
2073
|
+
const { locale, blocks, scrollToErrorField = true, form: formProps, rules: validate, initialValues, onFinish, onFinishFailed, className, style, } = props;
|
|
2074
|
+
const formRef = useRef(null);
|
|
2075
|
+
const form = formProps || useForm({ initialValues, validate });
|
|
2076
|
+
const middlewareFinish = (values, event) => {
|
|
2077
|
+
onFinish === null || onFinish === void 0 ? void 0 : onFinish(values, event);
|
|
2078
|
+
};
|
|
2079
|
+
const middlewareFinishFailed = (errors, values, events) => {
|
|
2080
|
+
if (scrollToErrorField && errors) {
|
|
2081
|
+
const firstErrorKey = Object.keys(errors)[0];
|
|
2082
|
+
const firstErrorElement = document.querySelector(`[name="${firstErrorKey}"]`);
|
|
2083
|
+
if (firstErrorElement && (firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus)) {
|
|
2084
|
+
setTimeout(() => {
|
|
2085
|
+
firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus();
|
|
2086
|
+
firstErrorElement.scrollIntoView({
|
|
2087
|
+
behavior: 'auto',
|
|
2088
|
+
block: 'center',
|
|
2089
|
+
inline: 'center',
|
|
2090
|
+
});
|
|
2091
|
+
}, 100);
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errors, values, events);
|
|
2095
|
+
};
|
|
2096
|
+
useEffect(() => {
|
|
2097
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
2098
|
+
if (!window.intlTelInputUtils) {
|
|
2099
|
+
yield require('intl-tel-input/build/js/utils');
|
|
2100
|
+
}
|
|
2101
|
+
}))();
|
|
2102
|
+
}, []);
|
|
2103
|
+
useImperativeHandle(ref, () => (Object.assign(Object.assign({}, form), { submit: () => formRef.current.requestSubmit() })), [form, formRef]);
|
|
2104
|
+
if (!blocks || !blocks.length) {
|
|
2105
|
+
return null;
|
|
2106
|
+
}
|
|
2107
|
+
return (React__default.createElement("form", { ref: formRef, onSubmit: form.onSubmit(middlewareFinish, middlewareFinishFailed), className: className, style: style },
|
|
2108
|
+
React__default.createElement(StyledLeadGenFormInner, { className: "leadgen-form_inputs" }, blocks.map((block, idx) => {
|
|
2109
|
+
const { id, name: blockName, data } = block;
|
|
2110
|
+
const { placeholder, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
|
|
2111
|
+
const formInputProps = form.getInputProps(name);
|
|
2112
|
+
const { value, error } = formInputProps;
|
|
2113
|
+
const reactKey = `${id}-${idx}`;
|
|
2114
|
+
switch (blockName) {
|
|
2115
|
+
case LEADGEN_BLOCK.TextBlock: {
|
|
2116
|
+
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2117
|
+
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "text", "data-control": "text" }, formInputProps))));
|
|
2118
|
+
}
|
|
2119
|
+
case LEADGEN_BLOCK.NumberBlock: {
|
|
2120
|
+
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2121
|
+
React__default.createElement(NumberInput$1, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "number", "data-control": "number" }, formInputProps))));
|
|
2122
|
+
}
|
|
2123
|
+
case LEADGEN_BLOCK.EmailBlock: {
|
|
2124
|
+
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2125
|
+
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, "data-control": "email" }, formInputProps))));
|
|
2126
|
+
}
|
|
2127
|
+
case LEADGEN_BLOCK.PhoneOtpBlock:
|
|
2128
|
+
case LEADGEN_BLOCK.WhatsappOtpBlock:
|
|
2129
|
+
case LEADGEN_BLOCK.ZaloOtpBlock:
|
|
2130
|
+
case LEADGEN_BLOCK.PhoneBlock: {
|
|
2131
|
+
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2132
|
+
React__default.createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), type: "text", "data-control": "text" }, formInputProps))));
|
|
2133
|
+
}
|
|
2134
|
+
case LEADGEN_BLOCK.LocationBlock: {
|
|
2135
|
+
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2136
|
+
React__default.createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, locale: locale, "data-control": "text" }, formInputProps))));
|
|
2137
|
+
}
|
|
2138
|
+
case LEADGEN_BLOCK.DateBlock: {
|
|
2139
|
+
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2140
|
+
React__default.createElement(DateInput, Object.assign({ locale: (MAPPED_LOCALE === null || MAPPED_LOCALE === void 0 ? void 0 : MAPPED_LOCALE[locale]) || MAPPED_LOCALE['vi-VN'], valueFormat: "DD/MM/YYYY", name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "default", "data-control": "date" }, formInputProps))));
|
|
2141
|
+
}
|
|
2142
|
+
case LEADGEN_BLOCK.DropdownBlock:
|
|
2143
|
+
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2144
|
+
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
2145
|
+
React__default.createElement(Select$1, Object.assign({ name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, data: listQuestion.map((l) => ({
|
|
2146
|
+
value: l.value,
|
|
2147
|
+
label: l.placeholder,
|
|
2148
|
+
})) }, formInputProps))));
|
|
2149
|
+
case LEADGEN_BLOCK.CheckboxBlock: {
|
|
2150
|
+
const formInputCheckboxProps = form.getInputProps(name, {
|
|
2151
|
+
type: 'checkbox',
|
|
2152
|
+
});
|
|
2153
|
+
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2154
|
+
isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2155
|
+
React__default.createElement(Checkbox$1.Group, Object.assign({ size: "md", withAsterisk: required, label: placeholder, value: value, sx: {
|
|
2156
|
+
display: 'flex',
|
|
2157
|
+
flexDirection: 'column',
|
|
2158
|
+
flexWrap: 'wrap',
|
|
2159
|
+
gap: 8,
|
|
2160
|
+
}, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
|
|
2161
|
+
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
2162
|
+
} }, formInputCheckboxProps), listQuestion.map((l, _idx) => (React__default.createElement(Checkbox$1, { name: name, key: _idx, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
|
|
2163
|
+
}
|
|
2164
|
+
case LEADGEN_BLOCK.RadioBlock: {
|
|
2165
|
+
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2166
|
+
isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2167
|
+
React__default.createElement(Radio$1.Group, Object.assign({ size: "md", withAsterisk: required, label: placeholder, value: value, spellCheck: true, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
|
|
2168
|
+
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
2169
|
+
} }, formInputProps), listQuestion.map((l, _index) => (React__default.createElement(Radio$1, { name: name, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
2170
|
+
}
|
|
2171
|
+
case 'TncBlock':
|
|
2172
|
+
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2173
|
+
React__default.createElement(Input$1.Wrapper, { error: error },
|
|
2174
|
+
React__default.createElement(Checkbox$1, Object.assign({ value: value, name: 'TNC-' + id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, formInputProps)))));
|
|
2175
|
+
default: {
|
|
2176
|
+
return null;
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
}))));
|
|
2180
|
+
});
|
|
2181
|
+
|
|
2182
|
+
const StyledLeadGenThankYou = styled.div `
|
|
2183
|
+
display: flex;
|
|
2184
|
+
gap: 8px;
|
|
2185
|
+
flex-direction: column;
|
|
2186
|
+
padding-block: 24px;
|
|
2187
|
+
|
|
2188
|
+
.leadgen-image {
|
|
2189
|
+
width: 120px;
|
|
2190
|
+
height: 120px;
|
|
2191
|
+
margin-inline: auto;
|
|
2192
|
+
object-fit: contain;
|
|
2193
|
+
object-position: center;
|
|
2194
|
+
text-align: center;
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
.leadgen-title {
|
|
2198
|
+
margin-block: 0;
|
|
2199
|
+
color: ${theme.colors.gray900};
|
|
2200
|
+
font-weight: 700;
|
|
2201
|
+
font-size: 18px;
|
|
2202
|
+
line-height: 28px;
|
|
2203
|
+
letter-spacing: -0.2px;
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
.leadgen-description {
|
|
2207
|
+
margin-block: 0;
|
|
2208
|
+
color: ${theme.colors.gray600};
|
|
2209
|
+
font-weight: 400;
|
|
2210
|
+
font-size: 14px;
|
|
2211
|
+
line-height: 22px;
|
|
2212
|
+
letter-spacing: -0.2px;
|
|
2213
|
+
text-align: center;
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
> [data-align] {
|
|
2217
|
+
&[data-align='right'] {
|
|
2218
|
+
text-align: right;
|
|
2219
|
+
}
|
|
2220
|
+
&[data-align='center'] {
|
|
2221
|
+
text-align: center;
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
`;
|
|
2225
|
+
const LeadGenThankYou = ({ image, title, description, showButton = false, button, className, style, }) => {
|
|
2226
|
+
const { src } = image;
|
|
2227
|
+
const { htmlText: titleText, align: titleAlign } = title;
|
|
2228
|
+
const { htmlText: descriptionText, align: descriptionAlign } = description;
|
|
2229
|
+
const { htmlText: buttonText, newtab, url, onClick } = button;
|
|
2230
|
+
return (React__default.createElement(StyledLeadGenThankYou, { className: className, style: style },
|
|
2231
|
+
React__default.createElement("img", { src: src, alt: "", className: "leadgen-thankyou_image leadgen-image" }),
|
|
2232
|
+
React__default.createElement("p", { className: "leadgen-thankyou_title leadgen-title", "data-align": titleAlign }, titleText),
|
|
2233
|
+
React__default.createElement("p", { className: "leadgen-thankyou_description leadgen-description", "data-align": descriptionAlign }, descriptionText),
|
|
2234
|
+
!!buttonText && showButton && (React__default.createElement(Button$2, { component: url ? 'a' : 'button', target: newtab ? '_blank' : undefined, href: url, size: "lg", variant: "filled", className: "leadgen-thankyoue_btn leadgen-btn", onClick: onClick }, buttonText))));
|
|
2235
|
+
};
|
|
2236
|
+
|
|
2237
|
+
const StyledLeadGenSubscriptionBoxBody = styled.div `
|
|
2238
|
+
margin-top: 16px;
|
|
2239
|
+
.leadgen-btn {
|
|
2240
|
+
margin-top: 16px;
|
|
2241
|
+
}
|
|
2242
|
+
`;
|
|
2243
|
+
const StyledLeadGenSubscriptionBoxHeaderImage = styled.div `
|
|
2244
|
+
margin-top: 3px;
|
|
2245
|
+
margin-right: 20px;
|
|
2246
|
+
width: 44px;
|
|
2247
|
+
height: 44px;
|
|
2248
|
+
|
|
2249
|
+
img {
|
|
2250
|
+
width: 100%;
|
|
2251
|
+
height: 100%;
|
|
2252
|
+
object-fix: contain;
|
|
2253
|
+
onject-position: center;
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
:has(img[src='']) {
|
|
2257
|
+
display: none;
|
|
2258
|
+
}
|
|
2259
|
+
`;
|
|
2260
|
+
const StyledLeadGenSubscriptionBoxHeader = styled.div `
|
|
2261
|
+
display: flex;
|
|
2262
|
+
align-items: center;
|
|
2263
|
+
margin-bottom: 16px;
|
|
2264
|
+
.leadgen-title {
|
|
2265
|
+
margin-bottom: 0;
|
|
2266
|
+
flex: 1;
|
|
2267
|
+
min-width: 0;
|
|
2268
|
+
color: ${theme.colors.gray900};
|
|
2269
|
+
font-size: 18px;
|
|
2270
|
+
font-weight: 600;
|
|
2271
|
+
line-height: 1.4;
|
|
2272
|
+
letter-spacing: -0.8px;
|
|
2273
|
+
}
|
|
2274
|
+
`;
|
|
2275
|
+
const StyledLeadGenSubscriptionBox = styled.div `
|
|
2276
|
+
padding: 16px;
|
|
2277
|
+
border: 1px solid ${theme.colors.neutral100};
|
|
2278
|
+
border-radius: 12px;
|
|
2279
|
+
margin-inline: auto;
|
|
2280
|
+
.leadgen-form_inputs {
|
|
2281
|
+
.leadgen-form_input {
|
|
2282
|
+
width: 100%;
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
.leadgen-form_input {
|
|
2287
|
+
.mantine-Input-wrapper {
|
|
2288
|
+
max-height: 56px;
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
@media screen and (min-width: 768px) {
|
|
2293
|
+
.leadgen-subscription_box_body {
|
|
2294
|
+
display: flex;
|
|
2295
|
+
> form {
|
|
2296
|
+
flex: 1;
|
|
2297
|
+
min-width: 0;
|
|
2298
|
+
|
|
2299
|
+
.leadgen-form_inputs {
|
|
2300
|
+
.leadgen-form_input {
|
|
2301
|
+
width: calc(50% - 4px);
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
.leadgen-btn {
|
|
2307
|
+
margin-top: 0;
|
|
2308
|
+
margin-left: 8px;
|
|
2309
|
+
width: auto;
|
|
2310
|
+
min-height: 56px;
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
`;
|
|
2315
|
+
const LeadGenSubscriptionBoxWithoutMemo = ({ locale, userInfo, siteId, siteDomain, forceCampaign, campaign_code, article_id, subscription_title: subscriptionTitleProps, }) => {
|
|
2316
|
+
var _a, _b, _c;
|
|
2317
|
+
const refContainer = useRef(null);
|
|
2318
|
+
const validatingEmailRef = useRef(false);
|
|
2319
|
+
const validatingPhoneRef = useRef(false);
|
|
2320
|
+
const { image, extra_fields, id: campaign_id, bot_id: campaign_subot_id = [], ThankYouBlock, } = forceCampaign || {};
|
|
2321
|
+
const { textBlocks, listBlockAdded, actionBlocks } = extra_fields || {};
|
|
2322
|
+
const { submitBlock } = actionBlocks || {};
|
|
2323
|
+
const [loading, setLoading] = useState(false);
|
|
2324
|
+
const [showThankyou, setShowThankyou] = useState(false);
|
|
2325
|
+
const formRef = useRef(null);
|
|
2326
|
+
const { form, validateObj } = useLeadFormConfig({
|
|
2327
|
+
listBlockAdded,
|
|
2328
|
+
campaignId: campaign_id,
|
|
2329
|
+
campaign_subot_id,
|
|
2330
|
+
validatingEmailRef,
|
|
2331
|
+
validatingPhoneRef,
|
|
2332
|
+
userInfo,
|
|
2333
|
+
});
|
|
2334
|
+
const subscription_title = useMemo(() => { var _a, _b; return subscriptionTitleProps || ((_b = (_a = textBlocks === null || textBlocks === void 0 ? void 0 : textBlocks.titleBlock) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.value); }, [subscriptionTitleProps, (_b = (_a = textBlocks === null || textBlocks === void 0 ? void 0 : textBlocks.titleBlock) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.value]);
|
|
2335
|
+
const { image: thankyouImage, title: thankyouTitle, description: thankyouDescription, button: thankyouButton, } = ThankYouBlock || {};
|
|
2336
|
+
const { apiUrl } = useMemo(() => {
|
|
2337
|
+
let apiUrl = leadStore.apiLeadUrl;
|
|
2338
|
+
if (apiUrl.includes('localhost')) {
|
|
2339
|
+
apiUrl = 'https://dev.leadgen.hellobacsi.com/';
|
|
2340
|
+
}
|
|
2341
|
+
return {
|
|
2342
|
+
apiUrl,
|
|
2343
|
+
};
|
|
2344
|
+
}, [siteDomain, siteId]);
|
|
2345
|
+
const url = useMemo(() => location.href.toLowerCase() || '', []);
|
|
2346
|
+
const article_title = useMemo(() => document.title || '', []);
|
|
2347
|
+
const cookie_id = useMemo(() => getCookie('hhg-id') || null, []);
|
|
2348
|
+
const ga_client_id = useMemo(() => getCookie('_ga') || null, []);
|
|
2349
|
+
const leadgenImpression = useCallback(() => {
|
|
2350
|
+
Service.campaignPostImpression({
|
|
2351
|
+
url,
|
|
2352
|
+
action: LEADGEN_ACTIONS.SCROLL,
|
|
2353
|
+
code: campaign_code,
|
|
2354
|
+
title_article: article_title,
|
|
2355
|
+
cookie_id,
|
|
2356
|
+
ga_client_id,
|
|
2357
|
+
extra: { cookie_id, article_id, subscription_title },
|
|
2358
|
+
});
|
|
2359
|
+
}, [
|
|
2360
|
+
article_id,
|
|
2361
|
+
article_title,
|
|
2362
|
+
cookie_id,
|
|
2363
|
+
ga_client_id,
|
|
2364
|
+
campaign_code,
|
|
2365
|
+
subscription_title,
|
|
2366
|
+
]);
|
|
2367
|
+
const intersectionObserverCallback = useCallback((entries) => {
|
|
2368
|
+
entries.forEach((entry) => {
|
|
2369
|
+
const { isIntersecting, target } = entry;
|
|
2370
|
+
if (isIntersecting && target === refContainer.current) {
|
|
2371
|
+
leadgenImpression();
|
|
2372
|
+
}
|
|
2373
|
+
});
|
|
2374
|
+
}, [leadgenImpression]);
|
|
2375
|
+
const IObserver = new IntersectionObserver(intersectionObserverCallback);
|
|
2376
|
+
const middlewareOnSubmit = useCallback((value) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2377
|
+
const newValue = {
|
|
2378
|
+
url,
|
|
2379
|
+
article_title,
|
|
2380
|
+
cookie_id,
|
|
2381
|
+
ga_client_id,
|
|
2382
|
+
article_id,
|
|
2383
|
+
campaign_id,
|
|
2384
|
+
campaign_code,
|
|
2385
|
+
subscription_title: subscription_title,
|
|
2386
|
+
};
|
|
2387
|
+
listBlockAdded.forEach(({ data: { value: k } }) => {
|
|
2388
|
+
newValue[k] = value[k];
|
|
2389
|
+
});
|
|
2390
|
+
setLoading(true);
|
|
2391
|
+
try {
|
|
2392
|
+
const { _data } = (yield Service.campaignPostLead({ data: newValue })) || {};
|
|
2393
|
+
const { model } = _data;
|
|
2394
|
+
if (model && model.id) {
|
|
2395
|
+
setShowThankyou(true);
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
catch (error) {
|
|
2399
|
+
console.log('** Error : ', error);
|
|
2400
|
+
}
|
|
2401
|
+
setLoading(false);
|
|
2402
|
+
}), [
|
|
2403
|
+
url,
|
|
2404
|
+
article_id,
|
|
2405
|
+
article_title,
|
|
2406
|
+
cookie_id,
|
|
2407
|
+
ga_client_id,
|
|
2408
|
+
campaign_code,
|
|
2409
|
+
subscription_title,
|
|
2410
|
+
listBlockAdded,
|
|
2411
|
+
]);
|
|
2412
|
+
useEffect(() => {
|
|
2413
|
+
if (refContainer.current) {
|
|
2414
|
+
IObserver.observe(refContainer.current);
|
|
2415
|
+
}
|
|
2416
|
+
return () => {
|
|
2417
|
+
IObserver.disconnect();
|
|
2418
|
+
};
|
|
2419
|
+
}, [
|
|
2420
|
+
url,
|
|
2421
|
+
article_id,
|
|
2422
|
+
article_title,
|
|
2423
|
+
ga_client_id,
|
|
2424
|
+
campaign_id,
|
|
2425
|
+
campaign_code,
|
|
2426
|
+
subscription_title,
|
|
2427
|
+
]);
|
|
2428
|
+
return (React__default.createElement("div", { ref: refContainer },
|
|
2429
|
+
React__default.createElement(StyledLeadGenSubscriptionBox, null,
|
|
2430
|
+
showThankyou && (React__default.createElement(LeadGenThankYou, { image: Object.assign(Object.assign({}, thankyouImage), { src: thankyouImage.src || `${apiUrl}admin/img/thanksyou.png` }), title: thankyouTitle, description: thankyouDescription, button: thankyouButton })),
|
|
2431
|
+
!showThankyou && (React__default.createElement(React__default.Fragment, null,
|
|
2432
|
+
React__default.createElement(StyledLeadGenSubscriptionBoxHeader, null,
|
|
2433
|
+
!!image && (React__default.createElement(StyledLeadGenSubscriptionBoxHeaderImage, null,
|
|
2434
|
+
React__default.createElement("img", { src: image, alt: "" }))),
|
|
2435
|
+
React__default.createElement("p", { className: "leadgen-title" }, subscription_title)),
|
|
2436
|
+
React__default.createElement(StyledLeadGenSubscriptionBoxBody, { className: "leadgen-subscription_box_body" },
|
|
2437
|
+
React__default.createElement(LeadGenForm, { ref: formRef, form: form, rules: validateObj, blocks: listBlockAdded, locale: locale, onFinish: middlewareOnSubmit }),
|
|
2438
|
+
React__default.createElement(Button$2, { disabled: loading, loading: loading, variant: "filled", size: "lg", onClick: () => { var _a; return (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit(); }, className: "leadgen-btn leadgen-btn_action", fullWidth: true }, (_c = submitBlock === null || submitBlock === void 0 ? void 0 : submitBlock.data) === null || _c === void 0 ? void 0 : _c.value)))))));
|
|
2439
|
+
};
|
|
2440
|
+
const LeadGenSubscriptionBoxWithMemo = memo(LeadGenSubscriptionBoxWithoutMemo);
|
|
2441
|
+
|
|
2442
|
+
const Container = () => {
|
|
2443
|
+
const context = useContext(LeadGenSubscriptionBoxContext);
|
|
2444
|
+
const {
|
|
2445
|
+
// apiUrl: apiUrlProps,
|
|
2446
|
+
// apiSubotUrl,
|
|
2447
|
+
campaign_code, article_id, subscription_title, locale, siteId, siteDomain, userInfo, forceCampaign, } = context;
|
|
2448
|
+
if (!forceCampaign || !(forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id)) {
|
|
2449
|
+
return null;
|
|
2450
|
+
}
|
|
2451
|
+
return (React__default.createElement(LeadGenSubscriptionBoxWithMemo, { locale: locale, userInfo: userInfo, siteId: siteId, siteDomain: siteDomain, forceCampaign: forceCampaign, campaign_code: campaign_code, article_id: article_id, subscription_title: subscription_title }));
|
|
2452
|
+
};
|
|
2453
|
+
Container.displayName = 'LeadGenSubscriptionBox';
|
|
2454
|
+
const LeadGenSubscriptionBoxContainer = (props) => {
|
|
2455
|
+
const { campaign_code } = props;
|
|
2456
|
+
if (!campaign_code) {
|
|
2457
|
+
return null;
|
|
2458
|
+
}
|
|
2459
|
+
return (React__default.createElement(LeadGenSubscriptionBoxProvider, Object.assign({}, props),
|
|
2460
|
+
React__default.createElement(Container, null)));
|
|
2461
|
+
};
|
|
2462
|
+
const LeadGenSubscriptionBox = LeadGenSubscriptionBoxContainer;
|
|
2463
|
+
|
|
2464
|
+
const useImageSize = (src) => {
|
|
2465
|
+
const [width, setWidth] = useState(16);
|
|
2466
|
+
const [height, setHeight] = useState(9);
|
|
2467
|
+
const [loaded, setLoaded] = useState(false);
|
|
2468
|
+
// load src image to get its width and height
|
|
2469
|
+
useEffect(() => {
|
|
2470
|
+
setLoaded(false);
|
|
2471
|
+
if (src) {
|
|
2472
|
+
const img = new Image();
|
|
2473
|
+
img.addEventListener('load', () => {
|
|
2474
|
+
setWidth(img.naturalWidth);
|
|
2475
|
+
setHeight(img.naturalHeight);
|
|
2476
|
+
setLoaded(true);
|
|
2477
|
+
});
|
|
2478
|
+
img.addEventListener('error', () => {
|
|
2479
|
+
setWidth(16);
|
|
2480
|
+
setHeight(9);
|
|
2481
|
+
setLoaded(true);
|
|
2482
|
+
});
|
|
2483
|
+
img.src = src;
|
|
2484
|
+
}
|
|
2485
|
+
else {
|
|
2486
|
+
setWidth(16);
|
|
2487
|
+
setHeight(9);
|
|
2488
|
+
setLoaded(true);
|
|
2489
|
+
}
|
|
2490
|
+
}, [src]);
|
|
2491
|
+
return {
|
|
2492
|
+
loaded,
|
|
2493
|
+
width,
|
|
2494
|
+
height,
|
|
2495
|
+
};
|
|
2496
|
+
};
|
|
2497
|
+
|
|
2498
|
+
const CloseButton = ({ onClose, containerClassName, svgClassName, }) => (React__default.createElement("button", { onClick: onClose, className: `le-newbuilder-close-button js-modal__close ${containerClassName || ''}` },
|
|
2499
|
+
React__default.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: svgClassName },
|
|
2500
|
+
React__default.createElement("path", { d: "M9.99981 10.8432L14.0583 14.9017C14.1691 15.0125 14.3083 15.0691 14.476 15.0717C14.6437 15.0743 14.7854 15.0176 14.9013 14.9017C15.0172 14.7858 15.0752 14.6453 15.0752 14.4802C15.0752 14.3151 15.0172 14.1746 14.9013 14.0587L10.8429 10.0002L14.9013 5.9417C15.0121 5.83094 15.0688 5.69172 15.0713 5.52402C15.0739 5.35634 15.0172 5.21456 14.9013 5.09866C14.7854 4.98276 14.6449 4.9248 14.4798 4.9248C14.3147 4.9248 14.1742 4.98276 14.0583 5.09866L9.99981 9.15712L5.94133 5.09866C5.83057 4.98789 5.69135 4.93122 5.52365 4.92866C5.35598 4.92609 5.21419 4.98276 5.09829 5.09866C4.98239 5.21456 4.92444 5.35506 4.92444 5.52018C4.92444 5.6853 4.98239 5.82581 5.09829 5.9417L9.15675 10.0002L5.09829 14.0587C4.98752 14.1694 4.93085 14.3087 4.9283 14.4763C4.92572 14.644 4.98239 14.7858 5.09829 14.9017C5.21419 15.0176 5.3547 15.0756 5.51982 15.0756C5.68493 15.0756 5.82544 15.0176 5.94133 14.9017L9.99981 10.8432Z" }))));
|
|
2501
|
+
|
|
2502
|
+
// url: imageBlocks.imageMobile.data.url
|
|
2503
|
+
// newTab: imageBlocks.imageMobile.data.newtab
|
|
2504
|
+
// imageMobile: campaignShow.image
|
|
2505
|
+
// imageDestkop: campaignShow.image_desktop
|
|
2506
|
+
const CenterTabLayout = ({ popupId, url, newTab, imageDestkop, imageMobile, onClose, onOtherSubmit, }) => {
|
|
2507
|
+
const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
|
|
2508
|
+
const { width: imageDestkopWidth, height: imageDestkopHeight, loaded: imageDestkopLoaded, } = useImageSize(imageDestkop);
|
|
2509
|
+
if (!imageMobileLoaded || !imageDestkopLoaded)
|
|
2510
|
+
return null;
|
|
2511
|
+
return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper", "data-popup-url": location.pathname, "data-popup-type": "center_tab" },
|
|
2512
|
+
React__default.createElement("div", { className: "le-center-tab-popup" },
|
|
2513
|
+
React__default.createElement("div", { style: { position: 'relative' } },
|
|
2514
|
+
React__default.createElement("a", { className: "js-popup-other-submit", href: url, target: newTab ? 'blank' : '_parent', onClick: onOtherSubmit },
|
|
2515
|
+
isVideo(imageMobile) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-mobile" },
|
|
2516
|
+
React__default.createElement("source", { src: imageMobile }))) : (React__default.createElement("img", { className: "le-only-mobile", src: imageMobile, style: {
|
|
2517
|
+
aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
|
|
2518
|
+
} })),
|
|
2519
|
+
isVideo(imageDestkop) ? (React__default.createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-desktop" },
|
|
2520
|
+
React__default.createElement("source", { src: imageDestkop }))) : (React__default.createElement("img", { className: "le-only-desktop", src: imageDestkop, style: {
|
|
2521
|
+
aspectRatio: `${imageDestkopWidth}/${imageDestkopHeight}`,
|
|
2522
|
+
} }))),
|
|
2523
|
+
React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))));
|
|
2524
|
+
};
|
|
2525
|
+
|
|
2526
|
+
// title: titleText
|
|
2527
|
+
// titleAlign: textBlocks.titleBlock.data.align
|
|
2528
|
+
// subtitle: textBlocks.subtitleBlock.data.value
|
|
2529
|
+
// subtitleAlign: textBlocks.subtitleBlock.data.align
|
|
2530
|
+
// url: actionBlocks.linkButtonBlock.data.url
|
|
2531
|
+
// urlText: actionBlocks.linkButtonBlock.data.value
|
|
2532
|
+
// newTab: actionBlocks.linkButtonBlock.data.newtab
|
|
2533
|
+
// imageMobile: campaignShow.image
|
|
2534
|
+
// imageDesktop: campaignShow.image_desktop
|
|
2535
|
+
const FloatingLayout = ({ popupId, url, title, urlText, titleAlign, subtitle, subtitleAlign, newTab, imageDesktop, imageMobile, onClose, onOtherSubmit, }) => {
|
|
2536
|
+
const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
|
|
2537
|
+
const { width: imageDesktopWidth, height: imageDesktopHeight, loaded: imageDesktopLoaded, } = useImageSize(imageDesktop);
|
|
2538
|
+
if (!imageMobileLoaded || !imageDesktopLoaded)
|
|
2539
|
+
return null;
|
|
2540
|
+
return (React__default.createElement("div", { id: popupId, className: "lead-modal-wrapper lead-floating-wrapper", "data-popup-url": location.pathname, "data-popup-type": "floating" },
|
|
2541
|
+
React__default.createElement("aside", { className: "le-only-desktop" },
|
|
2542
|
+
React__default.createElement("div", { className: "le-floating-desktop" },
|
|
2543
|
+
React__default.createElement("div", { className: "le-floating-desktop-wrap", style: { position: 'relative', background: '#fff' } },
|
|
2544
|
+
imageDesktop ? (React__default.createElement("div", null,
|
|
2545
|
+
React__default.createElement("img", { style: {
|
|
2546
|
+
maxWidth: 120,
|
|
2547
|
+
borderTopLeftRadius: 5,
|
|
2548
|
+
borderBottomLeftRadius: 5,
|
|
2549
|
+
aspectRatio: `${imageDesktopWidth}/${imageDesktopHeight}`,
|
|
2550
|
+
}, src: imageDesktop }))) : null,
|
|
2551
|
+
React__default.createElement("div", { style: { padding: 20 } },
|
|
2552
|
+
React__default.createElement("div", { className: `le-floating-desktop-title le-text-align-${titleAlign}` }, title),
|
|
2553
|
+
React__default.createElement("div", { className: `le-floating-desktop-desc le-text-align-${subtitleAlign}` }, subtitle)),
|
|
2554
|
+
React__default.createElement("a", { target: newTab ? 'blank' : '_parent', style: { marginLeft: 35, textDecoration: 'none' }, href: url },
|
|
2555
|
+
React__default.createElement("button", { className: "le-joinbow-floating-btn js-popup-other-submit", onClick: onOtherSubmit }, urlText)),
|
|
2556
|
+
React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))),
|
|
2557
|
+
React__default.createElement("aside", { className: "le-only-mobile" },
|
|
2558
|
+
React__default.createElement("div", { className: "le-floating-mobile" },
|
|
2559
|
+
React__default.createElement("div", { className: "le-floating-mobile-wrap", style: { position: 'relative', background: '#fff' } },
|
|
2560
|
+
React__default.createElement("aside", { style: { display: 'flex', justifyContent: 'space-between' } },
|
|
2561
|
+
React__default.createElement("div", null,
|
|
2562
|
+
React__default.createElement("div", { className: `le-floating-mobile-title le-text-align-${titleAlign}` }, title),
|
|
2563
|
+
React__default.createElement("div", { className: `le-floating-mobile-desc le-text-align-${subtitleAlign}` }, subtitle)),
|
|
2564
|
+
imageMobile ? (React__default.createElement("div", null,
|
|
2565
|
+
React__default.createElement("img", { style: {
|
|
2566
|
+
marginLeft: 15,
|
|
2567
|
+
marginTop: 4,
|
|
2568
|
+
maxWidth: 100,
|
|
2569
|
+
aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
|
|
2570
|
+
}, src: imageMobile }))) : null),
|
|
2571
|
+
React__default.createElement("div", { style: { textAlign: 'center', marginTop: 10 } },
|
|
2572
|
+
React__default.createElement("a", { target: newTab ? 'blank' : '_parent', href: url, style: { textDecoration: 'none' } },
|
|
2573
|
+
React__default.createElement("button", { className: "le-joinbow-floating-btn js-popup-other-submit", onClick: onOtherSubmit }, urlText))),
|
|
2574
|
+
React__default.createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" }))))));
|
|
2575
|
+
};
|
|
2576
|
+
|
|
2577
|
+
const ThankyouPopup = ({ title, titleAlign, subtitle, subtitleAlign, link, linkNewTab, linkText, image, }) => {
|
|
2578
|
+
const { width: imageWidth, height: imageHeight, loaded: imageLoaded, } = useImageSize(image);
|
|
2579
|
+
if (!imageLoaded)
|
|
2580
|
+
return null;
|
|
2581
|
+
return (React__default.createElement("div", { className: "lead-modal__thank-you leadgen-inner_thankyou" },
|
|
2582
|
+
React__default.createElement("div", { style: { width: '100%' } },
|
|
2583
|
+
React__default.createElement("img", { src: image, style: {
|
|
2584
|
+
maxHeight: 162,
|
|
2585
|
+
objectFit: 'cover',
|
|
2586
|
+
aspectRatio: `${imageWidth}/${imageHeight}`,
|
|
2587
|
+
}, loading: "lazy" }),
|
|
2588
|
+
title && (React__default.createElement("h1", { className: `le-thankyou-title le-text-align-${titleAlign}` }, title)),
|
|
2589
|
+
subtitle && (React__default.createElement("p", { className: `le-thankyou-subtitle le-text-align-${subtitleAlign}` }, subtitle.split('\n').map((text, idx, list) => {
|
|
2590
|
+
const isShowBr = idx < list.length - 1;
|
|
2591
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
2592
|
+
text,
|
|
2593
|
+
isShowBr && React__default.createElement("br", null)));
|
|
2594
|
+
}))),
|
|
2595
|
+
linkText && (React__default.createElement("div", null,
|
|
2596
|
+
React__default.createElement("a", { href: link, target: linkNewTab ? '_blank' : 'parrent', rel: "noreferrer" },
|
|
2597
|
+
React__default.createElement("button", { className: `lead-modal__btn ${LEAD_CLASS}` }, linkText)))))));
|
|
2598
|
+
};
|
|
2599
|
+
|
|
2600
|
+
const InlineLayout = ({ content, inlinePosition, }) => {
|
|
2601
|
+
const target = useMemo(() => {
|
|
2602
|
+
if (!inlinePosition)
|
|
2603
|
+
return null;
|
|
2604
|
+
const parents = document.querySelectorAll(`[data-url="${location.pathname}"] .body-content`);
|
|
2605
|
+
const allChildren = Array.from(parents).reduce((r, p) => {
|
|
2606
|
+
return [...r, ...Array.from(p.children)];
|
|
2607
|
+
}, []);
|
|
2608
|
+
if (allChildren === null || allChildren === void 0 ? void 0 : allChildren.length) {
|
|
2609
|
+
// find the third p tag in the body content, some other tags might mix in between
|
|
2610
|
+
const allPTags = allChildren.filter((c) => c.nodeName === 'P');
|
|
2611
|
+
const allH2Tags = allChildren.filter((c) => c.nodeName === 'H2');
|
|
2612
|
+
let target = null;
|
|
2613
|
+
switch (inlinePosition) {
|
|
2614
|
+
case '1th':
|
|
2615
|
+
target = allPTags[0];
|
|
2616
|
+
break;
|
|
2617
|
+
case '2th':
|
|
2618
|
+
target = allPTags[1];
|
|
2619
|
+
break;
|
|
2620
|
+
case '3th':
|
|
2621
|
+
target = allPTags[2];
|
|
2622
|
+
break;
|
|
2623
|
+
case '4th':
|
|
2624
|
+
target = allPTags[3];
|
|
2625
|
+
break;
|
|
2626
|
+
case '5th':
|
|
2627
|
+
target = allPTags[4];
|
|
2628
|
+
break;
|
|
2629
|
+
case '6th':
|
|
2630
|
+
target = allPTags[5];
|
|
2631
|
+
break;
|
|
2632
|
+
case '7th':
|
|
2633
|
+
target = allPTags[6];
|
|
2634
|
+
break;
|
|
2635
|
+
case '8th':
|
|
2636
|
+
target = allPTags[7];
|
|
2637
|
+
break;
|
|
2638
|
+
case '9th':
|
|
2639
|
+
target = allPTags[8];
|
|
2640
|
+
break;
|
|
2641
|
+
case '10th':
|
|
2642
|
+
target = allPTags[9];
|
|
2643
|
+
break;
|
|
2644
|
+
case '11th':
|
|
2645
|
+
target = allPTags[10];
|
|
1520
2646
|
break;
|
|
1521
2647
|
case '12th':
|
|
1522
2648
|
target = allPTags[11];
|
|
@@ -1616,211 +2742,6 @@ const EmptyComponent = ({ onClose, onContinue, }) => {
|
|
|
1616
2742
|
React__default.createElement(Button$2, { onClick: onContinue, size: "lg", variant: "filled", fullWidth: false, className: "leadgen-btn leadgen-btn_empty_again" }, t('lead.empty.submitAgain')))));
|
|
1617
2743
|
};
|
|
1618
2744
|
|
|
1619
|
-
const libraries = ['places'];
|
|
1620
|
-
const GoogleLocationBlock = (props) => {
|
|
1621
|
-
var _a;
|
|
1622
|
-
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
1623
|
-
const [LoadScript, setLoadScript] = useState(null);
|
|
1624
|
-
const [value, setValue] = useState(defaultValue || valueProps);
|
|
1625
|
-
const { predictions } = usePlacesAutocomplete(value, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
|
|
1626
|
-
const onChangeAutocomplete = useCallback((s) => {
|
|
1627
|
-
setValue(s);
|
|
1628
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
1629
|
-
}, []);
|
|
1630
|
-
const onClickItem = useCallback((item) => {
|
|
1631
|
-
/** For sure get value */
|
|
1632
|
-
setValue(item.value);
|
|
1633
|
-
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
1634
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
1635
|
-
}, [onChangeProps, predictions]);
|
|
1636
|
-
useEffect(() => {
|
|
1637
|
-
setValue(valueProps);
|
|
1638
|
-
}, [valueProps]);
|
|
1639
|
-
useEffect(() => {
|
|
1640
|
-
var _a, _b, _c;
|
|
1641
|
-
// only load extra google script when not yet loaded
|
|
1642
|
-
if (!((_c = (_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places) === null || _c === void 0 ? void 0 : _c.AutocompleteService) && !LoadScript) {
|
|
1643
|
-
import('@react-google-maps/api').then((m) => {
|
|
1644
|
-
setLoadScript(() => m.LoadScript);
|
|
1645
|
-
});
|
|
1646
|
-
}
|
|
1647
|
-
}, []);
|
|
1648
|
-
return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
1649
|
-
return { value: pred.description, label: pred.description };
|
|
1650
|
-
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
1651
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
1652
|
-
LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
|
|
1653
|
-
children));
|
|
1654
|
-
} }, restProps)));
|
|
1655
|
-
};
|
|
1656
|
-
|
|
1657
|
-
// You can give context variables any name
|
|
1658
|
-
const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
|
|
1659
|
-
const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
|
|
1660
|
-
const { t } = useTranslations();
|
|
1661
|
-
const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
1662
|
-
const validateObj = useMemo(() => {
|
|
1663
|
-
const InputBlocks = [
|
|
1664
|
-
'TextBlock',
|
|
1665
|
-
'NumberBlock',
|
|
1666
|
-
'EmailBlock',
|
|
1667
|
-
'PhoneBlock',
|
|
1668
|
-
'DateBlock',
|
|
1669
|
-
'CheckboxBlock',
|
|
1670
|
-
'RadioBlock',
|
|
1671
|
-
'DropdownBlock',
|
|
1672
|
-
'PhoneOtpBlock',
|
|
1673
|
-
'WhatsappOtpBlock',
|
|
1674
|
-
'ZaloOtpBlock',
|
|
1675
|
-
'LocationBlock',
|
|
1676
|
-
'TncBlock',
|
|
1677
|
-
];
|
|
1678
|
-
// ALL are required and can skip if not touched yet
|
|
1679
|
-
const withSharedCheck = (name, cb,
|
|
1680
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1681
|
-
block) => {
|
|
1682
|
-
return (value) => {
|
|
1683
|
-
var _a;
|
|
1684
|
-
const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
|
|
1685
|
-
if (!formRef.current.isTouched(name))
|
|
1686
|
-
return;
|
|
1687
|
-
if ((typeof value === 'string' && value.replace(' ', '') === '') ||
|
|
1688
|
-
typeof value === 'undefined' ||
|
|
1689
|
-
value === '' ||
|
|
1690
|
-
(Array.isArray(value) && value.length === 0)) {
|
|
1691
|
-
return isBLockRequired
|
|
1692
|
-
? t('validator.required')
|
|
1693
|
-
: cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1694
|
-
}
|
|
1695
|
-
return cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1696
|
-
};
|
|
1697
|
-
};
|
|
1698
|
-
return listBlockAdded
|
|
1699
|
-
.filter((b) => InputBlocks.includes(b.name))
|
|
1700
|
-
.reduce((r, b) => {
|
|
1701
|
-
var _a;
|
|
1702
|
-
const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
|
|
1703
|
-
if (b.name === 'NumberBlock') {
|
|
1704
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1705
|
-
if (value && isNaN(Number(value))) {
|
|
1706
|
-
return t('validator.number');
|
|
1707
|
-
}
|
|
1708
|
-
}, b) });
|
|
1709
|
-
}
|
|
1710
|
-
else if (b.name === 'EmailBlock') {
|
|
1711
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1712
|
-
if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
1713
|
-
return t('validator.email');
|
|
1714
|
-
}
|
|
1715
|
-
if (!value)
|
|
1716
|
-
return;
|
|
1717
|
-
validatingEmailRef.current = true;
|
|
1718
|
-
setTimeout(() => {
|
|
1719
|
-
formRef.current.setFieldError(b.data.value, 'Validating...');
|
|
1720
|
-
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1721
|
-
email: value,
|
|
1722
|
-
})
|
|
1723
|
-
.then((tKey) => {
|
|
1724
|
-
if (tKey) {
|
|
1725
|
-
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1726
|
-
}
|
|
1727
|
-
else {
|
|
1728
|
-
formRef.current.clearFieldError(b.data.value);
|
|
1729
|
-
}
|
|
1730
|
-
validatingEmailRef.current = false;
|
|
1731
|
-
})
|
|
1732
|
-
.catch((e) => {
|
|
1733
|
-
console.error(e);
|
|
1734
|
-
formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
|
|
1735
|
-
validatingEmailRef.current = false;
|
|
1736
|
-
});
|
|
1737
|
-
}, 200);
|
|
1738
|
-
}, b) });
|
|
1739
|
-
}
|
|
1740
|
-
else if (b.name === 'PhoneBlock' ||
|
|
1741
|
-
b.name === 'PhoneOtpBlock' ||
|
|
1742
|
-
b.name === 'ZaloOtpBlock' ||
|
|
1743
|
-
b.name === 'WhatsappOtpBlock') {
|
|
1744
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1745
|
-
if (value &&
|
|
1746
|
-
window.intlTelInputUtils &&
|
|
1747
|
-
!window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
|
|
1748
|
-
return t('validator.phone');
|
|
1749
|
-
}
|
|
1750
|
-
if (!value)
|
|
1751
|
-
return;
|
|
1752
|
-
validatingPhoneRef.current = true;
|
|
1753
|
-
setTimeout(() => {
|
|
1754
|
-
formRef.current.setFieldError(b.data.value, 'Validating...');
|
|
1755
|
-
if (b.data.singleSubmission) {
|
|
1756
|
-
checkUsedPhoneOnlyWithCache(campaignId, value)
|
|
1757
|
-
.then((tKey) => {
|
|
1758
|
-
if (tKey) {
|
|
1759
|
-
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1760
|
-
}
|
|
1761
|
-
else {
|
|
1762
|
-
formRef.current.clearFieldError(b.data.value);
|
|
1763
|
-
}
|
|
1764
|
-
validatingPhoneRef.current = false;
|
|
1765
|
-
})
|
|
1766
|
-
.catch((err) => {
|
|
1767
|
-
console.error(err);
|
|
1768
|
-
formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
|
|
1769
|
-
validatingPhoneRef.current = false;
|
|
1770
|
-
});
|
|
1771
|
-
}
|
|
1772
|
-
else {
|
|
1773
|
-
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1774
|
-
phone: value,
|
|
1775
|
-
})
|
|
1776
|
-
.then((tKey) => {
|
|
1777
|
-
if (tKey) {
|
|
1778
|
-
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1779
|
-
}
|
|
1780
|
-
else {
|
|
1781
|
-
formRef.current.clearFieldError(b.data.value);
|
|
1782
|
-
}
|
|
1783
|
-
validatingPhoneRef.current = false;
|
|
1784
|
-
})
|
|
1785
|
-
.catch((e) => {
|
|
1786
|
-
console.error(e);
|
|
1787
|
-
formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
|
|
1788
|
-
validatingPhoneRef.current = false;
|
|
1789
|
-
});
|
|
1790
|
-
}
|
|
1791
|
-
}, 200);
|
|
1792
|
-
}, b) });
|
|
1793
|
-
}
|
|
1794
|
-
else if (b.name === 'DateBlock') {
|
|
1795
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1796
|
-
if (value && isNaN(Date.parse(value))) {
|
|
1797
|
-
return t('validator.date');
|
|
1798
|
-
}
|
|
1799
|
-
}, b) });
|
|
1800
|
-
}
|
|
1801
|
-
else if (b.name === 'TncBlock') {
|
|
1802
|
-
return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
|
|
1803
|
-
if (isRequired && !value) {
|
|
1804
|
-
return t('validator.required');
|
|
1805
|
-
}
|
|
1806
|
-
}, b) });
|
|
1807
|
-
}
|
|
1808
|
-
else {
|
|
1809
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
|
|
1810
|
-
}
|
|
1811
|
-
}, {});
|
|
1812
|
-
}, [listBlockAdded.map((b) => b.name).join(',')]);
|
|
1813
|
-
const form = useLeadForm({
|
|
1814
|
-
validateInputOnChange: true,
|
|
1815
|
-
clearInputErrorOnChange: true,
|
|
1816
|
-
validate: validateObj,
|
|
1817
|
-
initialValues,
|
|
1818
|
-
});
|
|
1819
|
-
const formRef = useRef(form);
|
|
1820
|
-
formRef.current = form;
|
|
1821
|
-
return { form, validateObj };
|
|
1822
|
-
};
|
|
1823
|
-
|
|
1824
2745
|
const SubtitleBlock = ({ children, align, }) => (React__default.createElement("p", { className: `lead-modal__description ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
|
|
1825
2746
|
|
|
1826
2747
|
const cssInputNotShrink = css `
|
|
@@ -2139,11 +3060,13 @@ const TextField = (props) => {
|
|
|
2139
3060
|
const $focusEl = $textEl.item($textEl.length - 1);
|
|
2140
3061
|
if ($focusEl) {
|
|
2141
3062
|
$focusEl.focus();
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
3063
|
+
setTimeout(() => {
|
|
3064
|
+
$focusEl.scrollIntoView({
|
|
3065
|
+
behavior: 'auto',
|
|
3066
|
+
block: 'center',
|
|
3067
|
+
inline: 'start',
|
|
3068
|
+
});
|
|
3069
|
+
}, 100);
|
|
2147
3070
|
}
|
|
2148
3071
|
}, [shrink]);
|
|
2149
3072
|
useEffect(() => {
|
|
@@ -2278,10 +3201,9 @@ const StyledFormContainer = styled.div `
|
|
|
2278
3201
|
}
|
|
2279
3202
|
|
|
2280
3203
|
.leadgen-form_inner {
|
|
2281
|
-
display: flex;
|
|
2282
|
-
flex-direction: column;
|
|
2283
3204
|
flex: 1;
|
|
2284
3205
|
min-height: 0;
|
|
3206
|
+
display: flex;
|
|
2285
3207
|
|
|
2286
3208
|
&:has(.leadgen-header) {
|
|
2287
3209
|
display: block;
|
|
@@ -2544,7 +3466,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
2544
3466
|
const isDrawer = isLightBoxB && isMobile;
|
|
2545
3467
|
const limitFieldsLightBoxB = isLightBoxB && listBlockAdded.length <= LEADGEN_LIMIT_LIGHTBOXB;
|
|
2546
3468
|
const hasForm = isLightBoxA
|
|
2547
|
-
? listBlockAdded.some((item) =>
|
|
3469
|
+
? listBlockAdded.some((item) => LEADGEN_BLOCK_INPUT.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
|
|
2548
3470
|
: true;
|
|
2549
3471
|
const headerInsideFormContainer = isSlider || isLightBoxA || isFullscreen;
|
|
2550
3472
|
const showHeader = !!imageMobile || !!imageDesktop;
|
|
@@ -3588,4 +4510,4 @@ LeadGen.Thankyou = Thankyou;
|
|
|
3588
4510
|
LeadGen.OtpForm = OtpBlock$1;
|
|
3589
4511
|
LeadGen.Close = Close;
|
|
3590
4512
|
|
|
3591
|
-
export { LeadGen };
|
|
4513
|
+
export { LeadGen, LeadGenSubscriptionBox };
|