@hhgtech/hhg-components 1.29.396 → 1.29.397-beta-2
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/{InputDate-87c0ebb8.js → InputDate-e33113ea.js} +17 -7
- package/build/{LastPeriod-fea79cc1.js → LastPeriod-2ee621b1.js} +1 -1
- package/build/{MobileBottomNavigationIcon-6033022a.js → MobileBottomNavigationIcon-39675530.js} +3 -3
- package/build/{Spinner-6fc329d5.js → Spinner-43b4920c.js} +1 -1
- package/build/{WhatsApp-c66b98f0.js → WhatsApp-034abcc2.js} +1 -1
- package/build/adapters.js +19 -19
- package/build/atoms.js +48 -48
- 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/atoms/drawerComponent/index.d.ts +7 -0
- package/build/components.js +97 -97
- package/build/{constants-5aaf7ea1.js → constants-48b2f9c5.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-adb66af1.js → core-0fd29c89.js} +1 -1
- package/build/{dataTransform-f81e2533.js → dataTransform-cf5c6a05.js} +1 -1
- package/build/ecom.js +4 -4
- package/build/{editor-16ae9ec5.js → editor-600c9813.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/{InputDate-95582cb9.js → InputDate-97a34326.js} +17 -7
- package/build/esm/{LastPeriod-6bd7ad93.js → LastPeriod-8fe0b338.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-b87f8b35.js → MobileBottomNavigationIcon-45cd7c50.js} +3 -3
- package/build/esm/{Spinner-a9620d7f.js → Spinner-52b252bc.js} +1 -1
- package/build/esm/{WhatsApp-9e19b7fb.js → WhatsApp-bd81d381.js} +1 -1
- package/build/esm/adapters.js +19 -19
- package/build/esm/atoms.js +48 -48
- 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/atoms/drawerComponent/index.d.ts +7 -0
- package/build/esm/components.js +97 -97
- package/build/esm/{constants-a5b1bd3d.js → constants-0e620f93.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-b54de4ea.js → core-ab74e11b.js} +1 -1
- package/build/esm/{dataTransform-192c6c28.js → dataTransform-830b510d.js} +1 -1
- package/build/esm/ecom.js +4 -4
- package/build/esm/{editor-c3bfd985.js → editor-e7589eba.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-4f489b7e.js → healthTools-ff73dcec.js} +1 -1
- package/build/esm/healthToolsCardWrapper.js +18 -18
- package/build/esm/healthToolsForm.js +33 -33
- package/build/esm/hooks.js +13 -13
- package/build/esm/i18n/translationKeys.d.ts +1 -1
- package/build/esm/i18n-values/en-PH.js +2 -1
- package/build/esm/i18n-values/hi-IN.js +2 -1
- package/build/esm/i18n-values/id-ID.js +4 -3
- package/build/esm/i18n-values/km-KH.js +2 -1
- package/build/esm/i18n-values/ms-MY.js +2 -1
- package/build/esm/i18n-values/my-MM.js +4 -3
- package/build/esm/i18n-values/th-TH.js +4 -3
- package/build/esm/i18n-values/tl-PH.js +2 -1
- package/build/esm/i18n-values/vi-VN.js +2 -1
- package/build/esm/i18n-values/vi-VN_MB.js +2 -1
- package/build/esm/i18n-values/zh-CN.js +2 -1
- package/build/esm/i18n-values/zh-TW.js +2 -1
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-2b657776.js → index-063e8a74.js} +18 -18
- package/build/esm/{index-d39d14e2.js → index-068fded1.js} +2 -2
- package/build/esm/{index-4ae1a48c.js → index-14a10741.js} +2 -2
- package/build/esm/{index-46ad822c.js → index-14ef035a.js} +1 -1
- package/build/esm/{index-d75c3fb7.js → index-168f7ea6.js} +22 -22
- package/build/esm/{index-4f901e4d.js → index-1cda1254.js} +1 -1
- package/build/esm/{index-b3bde8eb.js → index-1cec3e80.js} +13 -13
- package/build/esm/{index-02a71e66.js → index-1d9505c7.js} +31 -31
- package/build/esm/{index-f7ac6a0a.js → index-1f97417f.js} +11 -11
- package/build/esm/{index-5aebff86.js → index-22e4bdb1.js} +16 -16
- package/build/esm/{index-aacbc3ef.js → index-23b4d11a.js} +3 -3
- package/build/esm/{index-608aa404.js → index-2a7c4909.js} +10 -10
- package/build/esm/{index-3b1aa0b8.js → index-2d9d4031.js} +3 -3
- package/build/esm/{index-33750331.js → index-2e4c90eb.js} +1 -1
- package/build/esm/{index-b0f23553.js → index-39f5f3f8.js} +7 -7
- package/build/esm/{index-496904b6.js → index-3c0e8d32.js} +25 -25
- package/build/esm/{index-3e5d8e7a.js → index-3cd3dd81.js} +13 -13
- package/build/esm/{index-670e69cb.js → index-3f774ef6.js} +2 -2
- package/build/esm/{index-3076c7d5.js → index-40937087.js} +2 -2
- package/build/esm/{index-b951a466.js → index-41283831.js} +2 -2
- package/build/esm/{index-9c40bee4.js → index-46f8d11f.js} +7 -7
- package/build/esm/{index-d34c5e3d.js → index-49189fec.js} +4 -4
- package/build/esm/{index-c539556e.js → index-51d866d8.js} +16 -16
- package/build/esm/{index-bf6ed587.js → index-63f75702.js} +2 -2
- package/build/esm/{index-a9f213a6.js → index-674ddb28.js} +1 -1
- package/build/esm/{index-8d285723.js → index-7c49bd47.js} +1 -1
- package/build/esm/{index-df117190.js → index-8692606b.js} +2 -2
- package/build/esm/{index-c23bc927.js → index-876848a9.js} +6 -6
- package/build/esm/{index-2892eb0a.js → index-8dd61dae.js} +3 -3
- package/build/esm/{index-169105b8.js → index-8ee8d2ce.js} +6 -6
- package/build/esm/{index-2bad4106.js → index-948b1b6e.js} +17 -17
- package/build/esm/{index-adbe75fa.js → index-98f6d229.js} +1 -1
- package/build/esm/{index-c3285710.js → index-9e3a8e08.js} +2 -2
- package/build/esm/{index-45101bb7.js → index-a3cbd99e.js} +17 -17
- package/build/esm/{index-fb95233f.js → index-a91bc19f.js} +13 -13
- package/build/esm/{index-33433fc2.js → index-aa59fb6c.js} +8 -8
- package/build/esm/{index-2f78ddf9.js → index-abdbe376.js} +5 -5
- package/build/esm/{index-3851a867.js → index-ae0b4237.js} +1 -1
- package/build/esm/{index-47f3dddb.js → index-b07560d2.js} +17 -17
- package/build/esm/{index-912e5964.js → index-b183054b.js} +231 -147
- package/build/esm/{index-d17b8e2c.js → index-b1d5df06.js} +16 -16
- package/build/esm/{index-11c03693.js → index-b5abdb96.js} +13 -13
- package/build/esm/{index-119711b9.js → index-b6b1c85a.js} +2 -2
- package/build/esm/{index-ec1bb54b.js → index-b6d59f31.js} +1 -1
- package/build/esm/{index-f122e041.js → index-b826847d.js} +17 -17
- package/build/esm/{index-f5c1e2c9.js → index-bc1d75a3.js} +6 -6
- package/build/esm/{index-c3f0d9a6.js → index-bd908023.js} +3 -3
- package/build/esm/{index-c60ec065.js → index-c1c4c96d.js} +3 -3
- package/build/esm/{index-1f219095.js → index-ca5a444f.js} +2 -2
- package/build/esm/{index-59bd98a3.js → index-cb60690a.js} +6 -6
- package/build/esm/{index-376d494b.js → index-ceb63508.js} +15 -15
- package/build/esm/{index-8bb32149.js → index-d0401747.js} +2 -2
- package/build/esm/{index-ed2b3f2f.js → index-d69b0732.js} +1 -1
- package/build/esm/{index-bcfaa0e6.js → index-db72bbbc.js} +31 -31
- package/build/esm/{index-ba156e99.js → index-dc2dc9a4.js} +2 -2
- package/build/esm/{index-140dcfdc.js → index-deab8fd7.js} +21 -21
- package/build/esm/{index-f89a38f9.js → index-e4c411d3.js} +24 -24
- package/build/esm/{index-cb56f721.js → index-e76c889f.js} +6 -6
- package/build/esm/{index-f437bfc4.js → index-eaef056c.js} +16 -16
- package/build/esm/{index-5f7999af.js → index-ef9db35e.js} +3 -3
- package/build/esm/{index-5f64e4d5.js → index-f4c603a4.js} +2 -2
- package/build/esm/{index-03e245b2.js → index-f7eb0295.js} +18 -18
- package/build/esm/{index-e0d52f7d.js → index-fdc57073.js} +5 -5
- package/build/esm/{index-f8c6adf5.js → index-fe45b3b2.js} +4 -4
- package/build/esm/{index-a03cc137.js → index-ff8bbc49.js} +2 -2
- package/build/esm/index.js +118 -118
- package/build/esm/{labelSorting-71895de3.js → labelSorting-2b739626.js} +4 -4
- package/build/esm/lead/LeadGen.helpers.d.ts +14 -14
- package/build/esm/lead/LeadGen.type.d.ts +19 -0
- package/build/esm/lead/LeadGenForm/LeadGenEmpty.d.ts +8 -0
- package/build/esm/lead/LeadGenForm/LeadGenForm.helpers.d.ts +1 -1
- package/build/esm/lead/LeadGenLightBoxB/LeadGenLightBoxB.styled.d.ts +262 -0
- package/build/esm/lead/components/context.d.ts +3 -2
- package/build/esm/lead/components/index.d.ts +3 -2
- package/build/esm/lead/icons/NoData.d.ts +3 -0
- package/build/esm/lead/icons/index.d.ts +5 -0
- package/build/esm/lead/layouts/lightbox/index.d.ts +8 -4
- package/build/esm/lead/leadGenContext.d.ts +7 -0
- package/build/esm/lead/newLeadPopup.d.ts +5 -3
- package/build/esm/lead/services/index.d.ts +2 -1
- package/build/esm/lead/utils/formatFormData.d.ts +6 -0
- package/build/esm/lead/utils/formatTrackingData.d.ts +14 -0
- package/build/esm/lead.css +1 -1
- package/build/esm/lead.js +733 -290
- package/build/esm/{logoIcon-5b62cfe4.js → logoIcon-11260461.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 -74
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +16 -16
- package/build/esm/navigation.js +46 -46
- 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 +50 -50
- package/build/esm/{post-0526421c.js → post-9c34a6dc.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.js +52 -40
- package/build/esm/{store-99ea3c78.js → store-80f4f7f8.js} +3 -3
- package/build/esm/subot.js +36 -36
- package/build/esm/surveyOrPremiumBanner.js +33 -33
- package/build/esm/surveyQuestionCard.js +10 -10
- package/build/esm/{surveyThankyouCard-d85babb0.js → surveyThankyouCard-fa757262.js} +5 -5
- package/build/esm/together/components/molecules/createNewPostContentV2/index.styled.d.ts +7 -0
- package/build/esm/together/utils/index.d.ts +1 -0
- package/build/esm/together.js +56 -56
- 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 +51 -51
- package/build/esm/togetherMoleculesCardAuthor.js +28 -28
- package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
- package/build/esm/togetherMoleculesProfileDetail.js +39 -39
- package/build/esm/togetherOrganisms.js +50 -50
- package/build/esm/togetherRichTextEditor.js +17 -17
- package/build/esm/togetherShareBox.js +10 -10
- package/build/esm/{translationsProvider-81221859.js → translationsProvider-3f9be49a.js} +1 -1
- package/build/esm/{treePopoverMenu-01379a96.js → treePopoverMenu-1c839233.js} +19 -19
- package/build/esm/{types-106c6788.js → types-4ee0a522.js} +2 -2
- package/build/esm/types.js +2 -2
- package/build/esm/{useCategory-0dcc4c18.js → useCategory-ddba2c99.js} +5 -5
- package/build/esm/{useHealthToolCache-3040ff0e.js → useHealthToolCache-77f8f895.js} +1 -1
- package/build/esm/{useMantineLocale-a938a312.js → useMantineLocale-743b796e.js} +6 -6
- package/build/esm/{usePlacesAutocomplete-b70b7ce0.js → usePlacesAutocomplete-b1423f5f.js} +1 -1
- package/build/esm/{useScreenSize-fb33da04.js → useScreenSize-1c0d4539.js} +2 -2
- package/build/esm/useTogetherAuthRequiredAction.js +10 -10
- package/build/esm/{utils-b033a48d.js → utils-314e4bcc.js} +2 -2
- package/build/esm/{utils-8307e0f2.js → utils-32b692c1.js} +5 -5
- package/build/esm/{utils-1628a5f4.js → utils-6a3d57dc.js} +2 -2
- package/build/esm/{utils-58628779.js → utils-98978433.js} +3 -3
- package/build/esm/vaccination.js +21 -21
- package/build/footer.js +21 -21
- package/build/gAssets.js +2 -2
- package/build/{healthTools-ef3f356e.js → healthTools-e4719df1.js} +1 -1
- package/build/healthToolsCardWrapper.js +18 -18
- package/build/healthToolsForm.js +33 -33
- package/build/hooks.js +13 -13
- package/build/i18n/translationKeys.d.ts +1 -1
- package/build/i18n-values/en-PH.js +2 -1
- package/build/i18n-values/hi-IN.js +2 -1
- package/build/i18n-values/id-ID.js +4 -3
- package/build/i18n-values/km-KH.js +2 -1
- package/build/i18n-values/ms-MY.js +2 -1
- package/build/i18n-values/my-MM.js +4 -3
- package/build/i18n-values/th-TH.js +4 -3
- package/build/i18n-values/tl-PH.js +2 -1
- package/build/i18n-values/vi-VN.js +2 -1
- package/build/i18n-values/vi-VN_MB.js +2 -1
- package/build/i18n-values/zh-CN.js +2 -1
- package/build/i18n-values/zh-TW.js +2 -1
- package/build/i18n.js +2 -2
- package/build/i18nV2.js +1 -1
- package/build/{index-afc8b11a.js → index-033a4e2e.js} +17 -17
- package/build/{index-c65f351d.js → index-09045eff.js} +1 -1
- package/build/{index-c6008b7f.js → index-0ac461f6.js} +13 -13
- package/build/{index-489453d0.js → index-1129566a.js} +1 -1
- package/build/{index-421eca75.js → index-13dd14f6.js} +1 -1
- package/build/{index-d75ddba4.js → index-2378522a.js} +5 -5
- package/build/{index-2dc187b5.js → index-2782799d.js} +1 -1
- package/build/{index-a7b14ca9.js → index-279dc48a.js} +8 -8
- package/build/{index-de153206.js → index-281ce543.js} +3 -3
- package/build/{index-2ad920e4.js → index-2bb196f2.js} +4 -4
- package/build/{index-35d14d51.js → index-37108022.js} +2 -2
- package/build/{index-daac6272.js → index-3f77a076.js} +230 -146
- package/build/{index-010e7c77.js → index-465ef5ee.js} +11 -11
- package/build/{index-d79537c0.js → index-48758d18.js} +16 -16
- package/build/{index-4108e3bd.js → index-4bc6a639.js} +7 -7
- package/build/{index-75a9eb0b.js → index-4c873456.js} +31 -31
- package/build/{index-32ff35c0.js → index-4d3b64eb.js} +17 -17
- package/build/{index-41864bfb.js → index-4f5fc1a3.js} +2 -2
- package/build/{index-789b8839.js → index-541ed031.js} +18 -18
- package/build/{index-4eadb6ba.js → index-577675c6.js} +17 -17
- package/build/{index-4c7f641f.js → index-598ff32d.js} +13 -13
- package/build/{index-7d75fcfc.js → index-5c2c0cee.js} +13 -13
- package/build/{index-32de8260.js → index-5c6ba899.js} +16 -16
- package/build/{index-4969f8b1.js → index-60590dd0.js} +18 -18
- package/build/{index-67083665.js → index-664ee78b.js} +4 -4
- package/build/{index-3e936ef5.js → index-701f15cd.js} +2 -2
- package/build/{index-4c660f74.js → index-719815fd.js} +1 -1
- package/build/{index-0d40fbb1.js → index-725826ff.js} +6 -6
- package/build/{index-c9f1f650.js → index-76f0e003.js} +2 -2
- package/build/{index-c32c7d30.js → index-78932d24.js} +15 -15
- package/build/{index-4371c483.js → index-79ec744e.js} +10 -10
- package/build/{index-31054a1b.js → index-7c6b905b.js} +24 -24
- package/build/{index-5f147d35.js → index-7f913c7c.js} +22 -22
- package/build/{index-e8b11e75.js → index-87a72c6e.js} +6 -6
- package/build/{index-559e5501.js → index-8af18dde.js} +3 -3
- package/build/{index-f7e54e43.js → index-922c3d5e.js} +6 -6
- package/build/{index-452f1eb5.js → index-962e3a74.js} +1 -1
- package/build/{index-db8fadeb.js → index-99d933e8.js} +3 -3
- package/build/{index-a8d0cfdb.js → index-9b94b7e4.js} +2 -2
- package/build/{index-55f0a158.js → index-a8db4c10.js} +16 -16
- package/build/{index-61953c36.js → index-aba4b5a5.js} +2 -2
- package/build/{index-0579b04b.js → index-abafa35f.js} +2 -2
- package/build/{index-6ee435b6.js → index-ac84391e.js} +17 -17
- package/build/{index-6eed2bd0.js → index-b3d57aee.js} +6 -6
- package/build/{index-02dab628.js → index-b44e32fe.js} +1 -1
- package/build/{index-46a9a7d0.js → index-b724d484.js} +3 -3
- package/build/{index-d9e7c442.js → index-c19bbf2d.js} +7 -7
- package/build/{index-112ee36d.js → index-c2019669.js} +3 -3
- package/build/{index-f3df9d5a.js → index-c7a0f796.js} +2 -2
- package/build/{index-d60f043e.js → index-ca05a46a.js} +31 -31
- package/build/{index-d139926a.js → index-ce252381.js} +2 -2
- package/build/{index-47f90fa7.js → index-d2d2cecf.js} +21 -21
- package/build/{index-594452e3.js → index-d3257094.js} +2 -2
- package/build/{index-3e9a3e81.js → index-d84987ce.js} +2 -2
- package/build/{index-643c6e04.js → index-de678122.js} +1 -1
- package/build/{index-e9a7b940.js → index-e15c2dc3.js} +13 -13
- package/build/{index-55a8b4bd.js → index-e551a051.js} +2 -2
- package/build/{index-7e08e497.js → index-efa49427.js} +5 -5
- package/build/{index-155eb40c.js → index-f051d236.js} +3 -3
- package/build/{index-680ab921.js → index-f3e44e6e.js} +25 -25
- package/build/{index-02559d27.js → index-f483bcc0.js} +2 -2
- package/build/{index-0c5952a5.js → index-f547e3a8.js} +2 -2
- package/build/{index-9f32ab48.js → index-f811ea08.js} +16 -16
- package/build/{index-a44a04cc.js → index-f9b0d7e1.js} +6 -6
- package/build/{index-073c424b.js → index-fb05d8ef.js} +1 -1
- package/build/index.js +118 -118
- package/build/{labelSorting-fdf79870.js → labelSorting-7cc0a416.js} +4 -4
- package/build/lead/LeadGen.helpers.d.ts +14 -14
- package/build/lead/LeadGen.type.d.ts +19 -0
- package/build/lead/LeadGenForm/LeadGenEmpty.d.ts +8 -0
- package/build/lead/LeadGenForm/LeadGenForm.helpers.d.ts +1 -1
- package/build/lead/LeadGenLightBoxB/LeadGenLightBoxB.styled.d.ts +262 -0
- package/build/lead/components/context.d.ts +3 -2
- package/build/lead/components/index.d.ts +3 -2
- package/build/lead/icons/NoData.d.ts +3 -0
- package/build/lead/icons/index.d.ts +5 -0
- package/build/lead/layouts/lightbox/index.d.ts +8 -4
- package/build/lead/leadGenContext.d.ts +7 -0
- package/build/lead/newLeadPopup.d.ts +5 -3
- package/build/lead/services/index.d.ts +2 -1
- package/build/lead/utils/formatFormData.d.ts +6 -0
- package/build/lead/utils/formatTrackingData.d.ts +14 -0
- package/build/lead.css +1 -1
- package/build/lead.js +733 -290
- package/build/{logoIcon-4722afa4.js → logoIcon-0aab8615.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 -74
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +16 -16
- package/build/navigation.js +46 -46
- package/build/navigationLogoutPopup.js +9 -9
- package/build/navigationProfileButton.js +23 -23
- package/build/onboardingV2.js +28 -28
- package/build/organisms.js +50 -50
- package/build/{post-0950ef7f.js → post-cb9e9756.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.js +50 -38
- package/build/{store-b11d784b.js → store-894af75e.js} +3 -3
- package/build/subot.js +35 -35
- package/build/surveyOrPremiumBanner.js +33 -33
- package/build/surveyQuestionCard.js +10 -10
- package/build/{surveyThankyouCard-2b36d7a8.js → surveyThankyouCard-f9528162.js} +5 -5
- package/build/together/components/molecules/createNewPostContentV2/index.styled.d.ts +7 -0
- package/build/together/utils/index.d.ts +1 -0
- package/build/together.js +56 -56
- package/build/togetherApiUtils.js +4 -4
- package/build/togetherAtoms.js +30 -30
- package/build/togetherComponentGlobalContext.js +4 -4
- package/build/togetherMolecules.js +51 -51
- package/build/togetherMoleculesCardAuthor.js +28 -28
- package/build/togetherMoleculesPostImagePreview.js +11 -11
- package/build/togetherMoleculesProfileDetail.js +39 -39
- package/build/togetherOrganisms.js +50 -50
- package/build/togetherRichTextEditor.js +17 -17
- package/build/togetherShareBox.js +10 -10
- package/build/{translationsProvider-90d21e5c.js → translationsProvider-9663d99f.js} +1 -1
- package/build/{treePopoverMenu-b79c47b2.js → treePopoverMenu-f64cd35a.js} +19 -19
- package/build/{types-7acb1092.js → types-55364ec5.js} +2 -2
- package/build/types.js +2 -2
- package/build/{useCategory-7e682543.js → useCategory-49b9d1e5.js} +5 -5
- package/build/{useHealthToolCache-ea23d86b.js → useHealthToolCache-d2b2a561.js} +1 -1
- package/build/{useMantineLocale-ec184683.js → useMantineLocale-dd2f34b2.js} +6 -6
- package/build/{usePlacesAutocomplete-b1cef70f.js → usePlacesAutocomplete-a0bc6b33.js} +1 -1
- package/build/{useScreenSize-03555d45.js → useScreenSize-082efdef.js} +2 -2
- package/build/useTogetherAuthRequiredAction.js +10 -10
- package/build/{utils-ebffddc8.js → utils-564618fc.js} +3 -3
- package/build/{utils-2d61d335.js → utils-6a42f384.js} +2 -2
- package/build/{utils-bd12e381.js → utils-cd398445.js} +2 -2
- package/build/{utils-406b2205.js → utils-f8d0e212.js} +5 -5
- package/build/vaccination.js +21 -21
- package/package.json +1 -1
- /package/build/{BMI_BOYS.percentile.monthly-8c9db15a.js → BMI_BOYS.percentile.monthly-aed4c395.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-a689769b.js → BMI_BOYS.percentile.weekly-df7a4cb6.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-e1ebccf8.js → BMI_BOYS.percentile.yearly-fa04bbed.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-7e63d878.js → BMI_BOYS.zscore.monthly-da7971d4.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-07720b7b.js → BMI_BOYS.zscore.weekly-7da57b1c.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-f7db7131.js → BMI_BOYS.zscore.yearly-cabbe1e6.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-201cb258.js → BMI_GIRLS.percentile.monthly-9a92dd03.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-0ece140c.js → BMI_GIRLS.percentile.weekly-01fbc66e.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-468fe324.js → BMI_GIRLS.percentile.yearly-a9c04bf1.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-cf26ac1d.js → BMI_GIRLS.zscore.monthly-1bdd4e7d.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-7b93dc72.js → BMI_GIRLS.zscore.weekly-6301419c.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-f874af51.js → BMI_GIRLS.zscore.yearly-8acfe89c.js} +0 -0
- /package/build/{ChevronDown-bff6582f.js → ChevronDown-bda46b11.js} +0 -0
- /package/build/{Close-539a8ab1.js → Close-fc90716e.js} +0 -0
- /package/build/{Google-550c0f4d.js → Google-f44fe10a.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-5a4e8b87.js → HEAD CIRCUM_BOYS.percentile.monthly-c93716ca.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-1f55d2ba.js → HEAD CIRCUM_BOYS.percentile.weekly-e517f709.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-e1ef2dc7.js → HEAD CIRCUM_BOYS.percentile.yearly-076f86e8.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-165874ce.js → HEAD CIRCUM_BOYS.zscore.monthly-303b315b.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-9cc6d575.js → HEAD CIRCUM_BOYS.zscore.weekly-adcb4120.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-90ed27d1.js → HEAD CIRCUM_BOYS.zscore.yearly-d70086b1.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-875f0106.js → HEAD CIRCUM_GIRLS.percentile.monthly-5a4fa4b3.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-647840ea.js → HEAD CIRCUM_GIRLS.percentile.weekly-a214f067.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-17885f9f.js → HEAD CIRCUM_GIRLS.percentile.yearly-f1667b6f.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-fcc741aa.js → HEAD CIRCUM_GIRLS.zscore.monthly-2fed9fba.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-d8557fdd.js → HEAD CIRCUM_GIRLS.zscore.weekly-d54ad466.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-cda06d21.js → HEAD CIRCUM_GIRLS.zscore.yearly-f716b4ac.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-23de96e5.js → HEIGHT_BOYS.percentile.monthly-368452bf.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-d7fdaee3.js → HEIGHT_BOYS.percentile.weekly-48806a0e.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-539c0d26.js → HEIGHT_BOYS.percentile.yearly-64093644.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-ec859f90.js → HEIGHT_BOYS.zscore.monthly-9c827b8c.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-d73df3e0.js → HEIGHT_BOYS.zscore.weekly-13e2f4a7.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-13c44198.js → HEIGHT_BOYS.zscore.yearly-27416f37.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-846127be.js → HEIGHT_GIRLS.percentile.monthly-50078db3.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-7103bf04.js → HEIGHT_GIRLS.percentile.weekly-17fe006c.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-ba7949c5.js → HEIGHT_GIRLS.percentile.yearly-fc730a5a.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-2b71db1d.js → HEIGHT_GIRLS.zscore.monthly-d31bb768.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-ff81a4fc.js → HEIGHT_GIRLS.zscore.weekly-c28e1b73.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-c29cf18e.js → HEIGHT_GIRLS.zscore.yearly-b15b301d.js} +0 -0
- /package/build/{Locale-7978c9cc.js → Locale-45dd34ef.js} +0 -0
- /package/build/{Visible-516f027e.js → Visible-43ff0f99.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-88977b50.js → WEIGHT_BOYS.percentile.monthly-aa4faa37.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-98331f0b.js → WEIGHT_BOYS.percentile.weekly-9e3985f9.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-e7945da5.js → WEIGHT_BOYS.percentile.yearly-5c1531e8.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-c04658e6.js → WEIGHT_BOYS.zscore.monthly-f8a573b3.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-98b9b101.js → WEIGHT_BOYS.zscore.weekly-57946822.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-a220a344.js → WEIGHT_BOYS.zscore.yearly-79f85228.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-051c5ec2.js → WEIGHT_GIRLS.percentile.monthly-f52ed1ae.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-f58b6b99.js → WEIGHT_GIRLS.percentile.weekly-bfaa2032.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-4b5240ec.js → WEIGHT_GIRLS.percentile.yearly-52108143.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-e01b1eac.js → WEIGHT_GIRLS.zscore.monthly-bba9f319.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-a708b96b.js → WEIGHT_GIRLS.zscore.weekly-a828a38d.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-6ed95997.js → WEIGHT_GIRLS.zscore.yearly-bd75f24a.js} +0 -0
- /package/build/{animation-6a6f59d2.js → animation-346f6567.js} +0 -0
- /package/build/{constants-6502967a.js → constants-695a8459.js} +0 -0
- /package/build/{constants-11de5f84.js → constants-9e1bb8dd.js} +0 -0
- /package/build/{constants-709311e0.js → constants-e935e2b1.js} +0 -0
- /package/build/{dataTransform-c89de3b2.js → dataTransform-332b9281.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-2d868e0c.js → BMI_BOYS.percentile.monthly-41869bfa.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-ac1b69d6.js → BMI_BOYS.percentile.weekly-79c6b442.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-602fbd5f.js → BMI_BOYS.percentile.yearly-c414bcdc.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-7893698e.js → BMI_BOYS.zscore.monthly-c2f41ce8.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-c46ff024.js → BMI_BOYS.zscore.weekly-a7379f51.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-232bcb49.js → BMI_BOYS.zscore.yearly-6ad2f4e9.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-e3867d77.js → BMI_GIRLS.percentile.monthly-24167e4f.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-e632c7b9.js → BMI_GIRLS.percentile.weekly-a6b28c0e.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-5c5b660b.js → BMI_GIRLS.percentile.yearly-fe410132.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-cffd34cd.js → BMI_GIRLS.zscore.monthly-cc0b527f.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-1419f794.js → BMI_GIRLS.zscore.weekly-703ee282.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-bd701532.js → BMI_GIRLS.zscore.yearly-10dc88fd.js} +0 -0
- /package/build/esm/{ChevronDown-3b3c3b11.js → ChevronDown-ae36066b.js} +0 -0
- /package/build/esm/{Close-c214dfa7.js → Close-e5b1fae1.js} +0 -0
- /package/build/esm/{Google-afd75689.js → Google-201077dd.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-bae7c034.js → HEAD CIRCUM_BOYS.percentile.monthly-2952ad36.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-55e5bf84.js → HEAD CIRCUM_BOYS.percentile.weekly-be7ef203.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-f2bdc060.js → HEAD CIRCUM_BOYS.percentile.yearly-f93e5926.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-77f983fe.js → HEAD CIRCUM_BOYS.zscore.monthly-bfea6999.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-811b1a1b.js → HEAD CIRCUM_BOYS.zscore.weekly-e8e5652b.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-6fed0fd8.js → HEAD CIRCUM_BOYS.zscore.yearly-36c74ac2.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-0c53afce.js → HEAD CIRCUM_GIRLS.percentile.monthly-abb0e008.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-9e9e04f5.js → HEAD CIRCUM_GIRLS.percentile.weekly-726781df.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-ee3dd4ff.js → HEAD CIRCUM_GIRLS.percentile.yearly-9dfdd63f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-bf037d95.js → HEAD CIRCUM_GIRLS.zscore.monthly-6c50df8a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-3cfe94a6.js → HEAD CIRCUM_GIRLS.zscore.weekly-1b2c1c8f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-229833dd.js → HEAD CIRCUM_GIRLS.zscore.yearly-29c177a7.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-deb1db57.js → HEIGHT_BOYS.percentile.monthly-287f61c1.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-0f0eb34e.js → HEIGHT_BOYS.percentile.weekly-c53e9e16.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-af19ac11.js → HEIGHT_BOYS.percentile.yearly-bded1987.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-c77f2195.js → HEIGHT_BOYS.zscore.monthly-27dc8a9a.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-ea779b14.js → HEIGHT_BOYS.zscore.weekly-09034137.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-60bfb51f.js → HEIGHT_BOYS.zscore.yearly-5032f40e.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-9f813296.js → HEIGHT_GIRLS.percentile.monthly-5cb20732.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-31a888f2.js → HEIGHT_GIRLS.percentile.weekly-6a0809ac.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-f5b633ab.js → HEIGHT_GIRLS.percentile.yearly-d8eae9ba.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-84fbd8ad.js → HEIGHT_GIRLS.zscore.monthly-5ccaa5e3.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-8563c02b.js → HEIGHT_GIRLS.zscore.weekly-d0bbaad6.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-d508d9c2.js → HEIGHT_GIRLS.zscore.yearly-fb32b52e.js} +0 -0
- /package/build/esm/{Locale-ce7c9574.js → Locale-36f525a4.js} +0 -0
- /package/build/esm/{Visible-2b74bc97.js → Visible-b3e126f1.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-bcab94ad.js → WEIGHT_BOYS.percentile.monthly-45cf8ed9.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-edc41c40.js → WEIGHT_BOYS.percentile.weekly-f0f9967e.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-1484930e.js → WEIGHT_BOYS.percentile.yearly-ec6f1086.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-9db45a44.js → WEIGHT_BOYS.zscore.monthly-601e12ef.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-1a71c413.js → WEIGHT_BOYS.zscore.weekly-a7c43483.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-c2bc9e67.js → WEIGHT_BOYS.zscore.yearly-3f4b7905.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-2e1c85e0.js → WEIGHT_GIRLS.percentile.monthly-8015b521.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-74360200.js → WEIGHT_GIRLS.percentile.weekly-71f690a7.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-f34f0558.js → WEIGHT_GIRLS.percentile.yearly-bd314f37.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-059ac703.js → WEIGHT_GIRLS.zscore.monthly-5b4acdbb.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-e1fb2fd8.js → WEIGHT_GIRLS.zscore.weekly-e2ade50d.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-77eb5efd.js → WEIGHT_GIRLS.zscore.yearly-664b750d.js} +0 -0
- /package/build/esm/{animation-27d62e38.js → animation-25f71398.js} +0 -0
- /package/build/esm/{constants-224a9c9d.js → constants-5d7623d2.js} +0 -0
- /package/build/esm/{constants-ca7208a4.js → constants-7dde25d9.js} +0 -0
- /package/build/esm/{constants-3cb473c5.js → constants-a8d9f8cd.js} +0 -0
- /package/build/esm/{dataTransform-7141f77c.js → dataTransform-aaed4225.js} +0 -0
- /package/build/esm/{index-2e9997c5.js → index-00ea7e85.js} +0 -0
- /package/build/esm/{index-725acd8e.js → index-681f65b5.js} +0 -0
- /package/build/esm/{index-e31e78b8.js → index-8c0aaa1e.js} +0 -0
- /package/build/esm/{index-6ef9420b.js → index-afcb24a3.js} +0 -0
- /package/build/esm/{index-6f28b547.js → index-bec699b5.js} +0 -0
- /package/build/esm/{index-16a5ad99.js → index-dd182a34.js} +0 -0
- /package/build/esm/{index-8ca926b3.js → index-f057e9f8.js} +0 -0
- /package/build/esm/{index-243017fd.js → index-f61760fa.js} +0 -0
- /package/build/esm/{index.styles-d2bdab8c.js → index.styles-a0ab78ac.js} +0 -0
- /package/build/esm/lead/layouts/{ emptyIcon.d.ts → emptyIcon.d.ts} +0 -0
- /package/build/esm/{localizeNumberFormat-7fbc5ef2.js → localizeNumberFormat-c4475b0a.js} +0 -0
- /package/build/esm/{normalizeLink-2e955111.js → normalizeLink-d7e0adc5.js} +0 -0
- /package/build/esm/{number-2c21651a.js → number-5b0b7db4.js} +0 -0
- /package/build/esm/{other-9f3029ec.js → other-98acd3e1.js} +0 -0
- /package/build/esm/{paths-badc1b3b.js → paths-5ad78bcc.js} +0 -0
- /package/build/esm/{translationsContext-8059f988.js → translationsContext-2d991fbb.js} +0 -0
- /package/build/esm/{tslib.es6-920542f4.js → tslib.es6-1ede97d6.js} +0 -0
- /package/build/esm/{types-d19dcc16.js → types-5b342856.js} +0 -0
- /package/build/esm/{useIsInit-80a86f68.js → useIsInit-baa49de2.js} +0 -0
- /package/build/esm/{useOutsideClick-ee68528a.js → useOutsideClick-19e0b295.js} +0 -0
- /package/build/esm/{useScrollbarSize-a550eea1.js → useScrollbarSize-ad5dec06.js} +0 -0
- /package/build/esm/{useUniqueId-c8370483.js → useUniqueId-2e6f52ac.js} +0 -0
- /package/build/esm/{utils-2369b642.js → utils-2a5bbdbd.js} +0 -0
- /package/build/{index-8223092b.js → index-376652ed.js} +0 -0
- /package/build/{index-6f22b55e.js → index-5729bb0c.js} +0 -0
- /package/build/{index-6625747d.js → index-64b3b777.js} +0 -0
- /package/build/{index-c895266c.js → index-6f5b78c2.js} +0 -0
- /package/build/{index-55b1bfa8.js → index-a40e5d39.js} +0 -0
- /package/build/{index-6d1e1360.js → index-ab051ca5.js} +0 -0
- /package/build/{index-1f64a5dc.js → index-b819919a.js} +0 -0
- /package/build/{index-a200e69c.js → index-e80282a3.js} +0 -0
- /package/build/{index.styles-e555d060.js → index.styles-d28edcfc.js} +0 -0
- /package/build/lead/layouts/{ emptyIcon.d.ts → emptyIcon.d.ts} +0 -0
- /package/build/{localizeNumberFormat-cbba4877.js → localizeNumberFormat-e5ec975f.js} +0 -0
- /package/build/{normalizeLink-4008bb97.js → normalizeLink-17ace8d1.js} +0 -0
- /package/build/{number-2bb6487c.js → number-837d066b.js} +0 -0
- /package/build/{other-3d614c90.js → other-a019e7d8.js} +0 -0
- /package/build/{paths-e0e4a30a.js → paths-3db5283b.js} +0 -0
- /package/build/{translationsContext-ae3c7cbc.js → translationsContext-8794b411.js} +0 -0
- /package/build/{tslib.es6-bd4b6f69.js → tslib.es6-bee6f032.js} +0 -0
- /package/build/{types-160c4161.js → types-56ea1c8b.js} +0 -0
- /package/build/{useIsInit-6ed13d1d.js → useIsInit-5fb94791.js} +0 -0
- /package/build/{useOutsideClick-0864ce66.js → useOutsideClick-e36eae8d.js} +0 -0
- /package/build/{useScrollbarSize-7c9c913d.js → useScrollbarSize-99ddf0f5.js} +0 -0
- /package/build/{useUniqueId-3ad4fe36.js → useUniqueId-aec0ca63.js} +0 -0
- /package/build/{utils-e56bcd6e.js → utils-f4e8f545.js} +0 -0
package/build/esm/lead.js
CHANGED
|
@@ -1,52 +1,53 @@
|
|
|
1
|
-
import { _ as __rest, a as __awaiter } from './tslib.es6-
|
|
1
|
+
import { _ as __rest, a as __awaiter } from './tslib.es6-1ede97d6.js';
|
|
2
2
|
import React__default, { createContext, useMemo, useEffect, useRef, useState, useContext, useCallback, forwardRef, useImperativeHandle, memo, useLayoutEffect } from 'react';
|
|
3
|
-
import { createStyles, Box, Button as Button$1, Input as Input$1,
|
|
4
|
-
import dayjs from 'dayjs';
|
|
3
|
+
import { createStyles, Box, Button as Button$1, Input as Input$1, Autocomplete, clsx, Checkbox as Checkbox$1, Radio as Radio$1, Select as Select$1, TextInput, NumberInput as NumberInput$1, Portal, Transition, Overlay } from '@mantine/core';
|
|
5
4
|
import debounce from 'lodash/debounce';
|
|
6
5
|
import { createFormContext, useForm } from '@mantine/form';
|
|
7
|
-
import
|
|
6
|
+
import dayjs from 'dayjs';
|
|
7
|
+
import { B as BEARER_TOKEN_COOKIE } from './index-49189fec.js';
|
|
8
8
|
import { getCookie, setCookie } from './miscCookieHelper.js';
|
|
9
|
-
import { u as useTranslations } from './index-
|
|
10
|
-
import { T as TranslationsContext } from './translationsContext-
|
|
11
|
-
import { M as MediaQueries, b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-
|
|
12
|
-
import { T as Text } from './index-
|
|
13
|
-
import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-
|
|
14
|
-
import { D as DatePicker } from './index-
|
|
15
|
-
import { B as Button } from './index-
|
|
16
|
-
import './index.styles-
|
|
9
|
+
import { u as useTranslations } from './index-674ddb28.js';
|
|
10
|
+
import { T as TranslationsContext } from './translationsContext-2d991fbb.js';
|
|
11
|
+
import { M as MediaQueries, b as getWrapperDomWithSelector, a as getPopupWrapperDom } from './utils-2a5bbdbd.js';
|
|
12
|
+
import { T as Text } from './index-dc2dc9a4.js';
|
|
13
|
+
import { S as Select, d as Checkbox, I as Input, R as Radio, P as Phone, N as NumberInput, O as OTP } from './index-1f97417f.js';
|
|
14
|
+
import { D as DatePicker } from './index-bc1d75a3.js';
|
|
15
|
+
import { B as Button } from './index-ae0b4237.js';
|
|
16
|
+
import './index.styles-a0ab78ac.js';
|
|
17
17
|
import { useClickOutside } from '@mantine/hooks';
|
|
18
|
-
import './useMantineLocale-
|
|
19
|
-
import { C as COMMON_DATE_TRANSLATE_KEY } from './index-
|
|
20
|
-
import './index-
|
|
21
|
-
import { Z as ZINDEX_SSO, I as ISO_FORMAT } from './index-
|
|
22
|
-
import './other-
|
|
23
|
-
import './index-
|
|
24
|
-
import { M as MAPPED_LOCALE } from './utils-
|
|
18
|
+
import './useMantineLocale-743b796e.js';
|
|
19
|
+
import { C as COMMON_DATE_TRANSLATE_KEY } from './index-d69b0732.js';
|
|
20
|
+
import './index-dd182a34.js';
|
|
21
|
+
import { Z as ZINDEX_SSO, I as ISO_FORMAT } from './index-40937087.js';
|
|
22
|
+
import './other-98acd3e1.js';
|
|
23
|
+
import './index-2d9d4031.js';
|
|
24
|
+
import { M as MAPPED_LOCALE } from './utils-314e4bcc.js';
|
|
25
25
|
import { DateInput } from '@mantine/dates';
|
|
26
|
-
import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-
|
|
27
|
-
import { H as Heading$1 } from './index-
|
|
28
|
-
import { t as translationsMap$1 } from './translationsProvider-
|
|
29
|
-
import { L as LOCALE } from './Locale-
|
|
26
|
+
import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY } from './usePlacesAutocomplete-b1423f5f.js';
|
|
27
|
+
import { H as Heading$1 } from './index-068fded1.js';
|
|
28
|
+
import { t as translationsMap$1 } from './translationsProvider-3f9be49a.js';
|
|
29
|
+
import { L as LOCALE } from './Locale-36f525a4.js';
|
|
30
30
|
import { v1 } from 'uuid';
|
|
31
31
|
import { parsePhoneNumber } from 'react-phone-number-input';
|
|
32
32
|
import styled from '@emotion/styled';
|
|
33
33
|
import { theme } from './miscTheme.js';
|
|
34
34
|
import { css } from '@emotion/react';
|
|
35
|
-
import { T as TogetherComponentGlobalContext } from './utils-
|
|
36
|
-
import { i as isVideo } from './index-
|
|
37
|
-
import { u as useScreenSize } from './useScreenSize-
|
|
35
|
+
import { T as TogetherComponentGlobalContext } from './utils-98978433.js';
|
|
36
|
+
import { i as isVideo } from './index-00ea7e85.js';
|
|
37
|
+
import { u as useScreenSize } from './useScreenSize-1c0d4539.js';
|
|
38
|
+
import { motion } from 'framer-motion';
|
|
38
39
|
import { createPortal } from 'react-dom';
|
|
39
|
-
import { B as Button$2 } from './index-
|
|
40
|
-
import { I as InputDate } from './InputDate-
|
|
41
|
-
import { D as DrawerComponent } from './index-
|
|
42
|
-
import { C as Close } from './Close-
|
|
40
|
+
import { B as Button$2 } from './index-63f75702.js';
|
|
41
|
+
import { I as InputDate } from './InputDate-97a34326.js';
|
|
42
|
+
import { D as DrawerComponent } from './index-41283831.js';
|
|
43
|
+
import { C as Close } from './Close-e5b1fae1.js';
|
|
43
44
|
import './constantsIsProduction.js';
|
|
44
|
-
import './normalizeLink-
|
|
45
|
+
import './normalizeLink-d7e0adc5.js';
|
|
45
46
|
import './constantsDomainLocales.js';
|
|
46
47
|
import '@hhgtech/icons/other';
|
|
47
48
|
import '@mantine/carousel';
|
|
48
49
|
import 'classnames';
|
|
49
|
-
import './useUniqueId-
|
|
50
|
+
import './useUniqueId-2e6f52ac.js';
|
|
50
51
|
import './constantsSite.js';
|
|
51
52
|
import '@hhgtech/icons/core';
|
|
52
53
|
import '@mantine/notifications';
|
|
@@ -63,11 +64,11 @@ import './i18n-values/tl-PH.js';
|
|
|
63
64
|
import './i18n-values/vi-VN.js';
|
|
64
65
|
import './i18n-values/vi-VN_MB.js';
|
|
65
66
|
import './i18n-values/zh-TW.js';
|
|
66
|
-
import './index-
|
|
67
|
+
import './index-bec699b5.js';
|
|
67
68
|
import 'slugify';
|
|
68
69
|
import 'string-format';
|
|
69
70
|
import './togetherApiPaths.js';
|
|
70
|
-
import './constants-
|
|
71
|
+
import './constants-7dde25d9.js';
|
|
71
72
|
import 'vaul';
|
|
72
73
|
|
|
73
74
|
const LeadGenComponentContext = createContext({});
|
|
@@ -162,20 +163,21 @@ const LEADGEN_ACTIONS = {
|
|
|
162
163
|
SCROLL: 'SCROLL',
|
|
163
164
|
TIME: 'TIME',
|
|
164
165
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
166
|
+
var LEADGEN_LAYOUT;
|
|
167
|
+
(function (LEADGEN_LAYOUT) {
|
|
168
|
+
LEADGEN_LAYOUT["LightBoxA"] = "LightBoxA";
|
|
169
|
+
LEADGEN_LAYOUT["LightBoxB"] = "LightBoxB";
|
|
170
|
+
LEADGEN_LAYOUT["SkinA"] = "SkinA";
|
|
171
|
+
LEADGEN_LAYOUT["SkinB"] = "SkinB";
|
|
172
|
+
LEADGEN_LAYOUT["Floating"] = "Floating";
|
|
173
|
+
LEADGEN_LAYOUT["Tab"] = "Tab";
|
|
174
|
+
LEADGEN_LAYOUT["InlineA"] = "InlineA";
|
|
175
|
+
LEADGEN_LAYOUT["InlineB"] = "InlineB";
|
|
176
|
+
LEADGEN_LAYOUT["CenterTab"] = "CenterTab";
|
|
177
|
+
LEADGEN_LAYOUT["Sidebar"] = "Sidebar";
|
|
178
|
+
LEADGEN_LAYOUT["Fullscreen"] = "Fullscreen";
|
|
179
|
+
LEADGEN_LAYOUT["Slider"] = "Slider";
|
|
180
|
+
})(LEADGEN_LAYOUT || (LEADGEN_LAYOUT = {}));
|
|
179
181
|
const LEADGEN_BLOCK = {
|
|
180
182
|
TextBlock: 'TextBlock',
|
|
181
183
|
NumberBlock: 'NumberBlock',
|
|
@@ -359,6 +361,18 @@ const formatCampaignDetail = (campaign) => {
|
|
|
359
361
|
}
|
|
360
362
|
};
|
|
361
363
|
|
|
364
|
+
const formatLeadGenFormValue = (values = {}, blocks) => {
|
|
365
|
+
const newValues = {};
|
|
366
|
+
for (const block of blocks) {
|
|
367
|
+
const { data } = block || {};
|
|
368
|
+
const { value: fieldName } = data || {};
|
|
369
|
+
if (fieldName in values) {
|
|
370
|
+
newValues[fieldName] = values[fieldName];
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return newValues;
|
|
374
|
+
};
|
|
375
|
+
|
|
362
376
|
class Store {
|
|
363
377
|
constructor() {
|
|
364
378
|
this.apiSsoUrl = 'https://staging-id.hellobacsi.com/';
|
|
@@ -512,9 +526,9 @@ const getCampaignByCode = (campaign_code) => {
|
|
|
512
526
|
method: METHOD.GET,
|
|
513
527
|
});
|
|
514
528
|
};
|
|
515
|
-
const getSubscriptionBoxInfo = ({ category, site, }) => {
|
|
529
|
+
const getSubscriptionBoxInfo = ({ category, site, slug, }) => {
|
|
516
530
|
return leadApi.call({
|
|
517
|
-
url: `${LEADGEN_API_PATH.V2_SUBSCRIPTION_INFO}?category=${category}&site=${site}`,
|
|
531
|
+
url: `${LEADGEN_API_PATH.V2_SUBSCRIPTION_INFO}?category=${category}&site=${site}&slug=${slug}`,
|
|
518
532
|
method: METHOD.GET,
|
|
519
533
|
});
|
|
520
534
|
};
|
|
@@ -661,7 +675,7 @@ const clearCacheUsedEmailOrPhone = () => {
|
|
|
661
675
|
const [LeadFormProvider$1, useLeadFormContext$1, useLeadForm$1] = createFormContext();
|
|
662
676
|
const useLeadFormConfig$1 = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
|
|
663
677
|
const { t } = useTranslations();
|
|
664
|
-
const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
678
|
+
const initialValues = useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
665
679
|
useEffect(() => {
|
|
666
680
|
if (!window.intlTelInputUtils) {
|
|
667
681
|
require('intl-tel-input/build/js/utils');
|
|
@@ -977,15 +991,15 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
977
991
|
case 'TextBlock':
|
|
978
992
|
return (React__default.createElement(Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "text", placeholder: placeholder, className: cx('leadgen-control', classes.control),
|
|
979
993
|
// onChangeRaw={(e) => inputOnChange('text', e)}
|
|
980
|
-
label: placeholder, "data-control": "text", name: value }, form.getInputProps(value))));
|
|
994
|
+
label: placeholder, "data-control": "text", "data-lead-control": name, name: value }, form.getInputProps(value))));
|
|
981
995
|
case 'NumberBlock':
|
|
982
996
|
return (React__default.createElement(NumberInput, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "number", placeholder: placeholder, className: cx('leadgen-control', classes.control),
|
|
983
997
|
// onChange={(e) => inputOnChange('number', e)}
|
|
984
|
-
label: placeholder, "data-control": "number", name: value }, form.getInputProps(value))));
|
|
998
|
+
label: placeholder, "data-control": "number", "data-lead-control": name, name: value }, form.getInputProps(value))));
|
|
985
999
|
case 'EmailBlock':
|
|
986
1000
|
return (React__default.createElement(Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false,
|
|
987
1001
|
// type="email"
|
|
988
|
-
placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "email", name: value }, form.getInputProps(value))));
|
|
1002
|
+
placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "email", "data-lead-control": name, name: value }, form.getInputProps(value))));
|
|
989
1003
|
case 'PhoneOtpBlock':
|
|
990
1004
|
case 'WhatsappOtpBlock':
|
|
991
1005
|
case 'ZaloOtpBlock':
|
|
@@ -1000,14 +1014,14 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1000
1014
|
form.setFieldValue(value, v);
|
|
1001
1015
|
},
|
|
1002
1016
|
// onBlur={(e) => inputOnBlur('tel', e)}
|
|
1003
|
-
id: id, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel" })));
|
|
1017
|
+
id: id, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name })));
|
|
1004
1018
|
}
|
|
1005
1019
|
case 'LocationBlock': {
|
|
1006
1020
|
return (React__default.createElement(LocationBlock, { key: index, name: value, placeholder: placeholder, locale: locale, required: required }));
|
|
1007
1021
|
}
|
|
1008
1022
|
case 'DateBlock':
|
|
1009
1023
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1010
|
-
React__default.createElement(DatePicker, Object.assign({ withAsterisk: required, key: index, type: "default", name: value, placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "date", popoverProps: popoverProps }, form.getInputProps(value))),
|
|
1024
|
+
React__default.createElement(DatePicker, Object.assign({ withAsterisk: required, key: index, type: "default", name: value, placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "date", "data-lead-control": name, popoverProps: popoverProps }, form.getInputProps(value))),
|
|
1011
1025
|
React__default.createElement("input", { type: "hidden", name: value, "data-control": "date" })));
|
|
1012
1026
|
case 'LinkButtonBlock':
|
|
1013
1027
|
return (React__default.createElement("div", { key: index },
|
|
@@ -1025,14 +1039,14 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1025
1039
|
display: 'flex',
|
|
1026
1040
|
flexDirection: 'column',
|
|
1027
1041
|
gap: 8,
|
|
1028
|
-
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
|
|
1042
|
+
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox", "data-lead-control": name }))))));
|
|
1029
1043
|
case 'RadioBlock':
|
|
1030
1044
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1031
1045
|
isSendMailChimp && (React__default.createElement(Input, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
|
|
1032
|
-
React__default.createElement(Radio.Group, Object.assign({ withAsterisk: required, className: cx('leadgen-control', classes.control), key: index, label: placeholder, size: "md" }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
1046
|
+
React__default.createElement(Radio.Group, Object.assign({ withAsterisk: required, className: cx('leadgen-control', classes.control), key: index, label: placeholder, size: "md" }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio", "data-lead-control": name }))))));
|
|
1033
1047
|
case 'DropdownBlock':
|
|
1034
1048
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1035
|
-
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
1049
|
+
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown', "data-lead-control": name }),
|
|
1036
1050
|
React__default.createElement(Select, Object.assign({ key: index, className: cx('leadgen-control', classes.control), label: placeholder, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
|
|
1037
1051
|
value: l.value,
|
|
1038
1052
|
label: l.placeholder,
|
|
@@ -1040,7 +1054,7 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1040
1054
|
case 'TncBlock':
|
|
1041
1055
|
const tncInputProps = form.getInputProps('TNC-' + b.id);
|
|
1042
1056
|
return (React__default.createElement(React__default.Fragment, null,
|
|
1043
|
-
React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + b.id, key: b.id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, tncInputProps, { error: tncInputProps.error ? tncInputProps.error : undefined }))));
|
|
1057
|
+
React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + b.id, key: b.id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox", "data-lead-control": name }, tncInputProps, { error: tncInputProps.error ? tncInputProps.error : undefined }))));
|
|
1044
1058
|
}
|
|
1045
1059
|
return null;
|
|
1046
1060
|
})));
|
|
@@ -1073,7 +1087,9 @@ const Heading = (_a) => {
|
|
|
1073
1087
|
const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps, submitProps, }) => {
|
|
1074
1088
|
var _a;
|
|
1075
1089
|
const { primaryColor } = useContext(LeadGenContext$1);
|
|
1076
|
-
const { listBlockAdded, leadFormConfig: { form, validateObj }, validatingEmailRef, validatingPhoneRef,
|
|
1090
|
+
const { listBlockAdded, leadFormConfig: { form, validateObj }, validatingEmailRef, validatingPhoneRef,
|
|
1091
|
+
// formRef,
|
|
1092
|
+
setFormRef, onClose, onOtherSubmit, actionBlocks, locale, setShowOtpPhone, onSubmit, } = useContext(LeadGenComponentContext);
|
|
1077
1093
|
const { classes, cx } = useStyles$1(undefined, {
|
|
1078
1094
|
name: 'LeadGen__FormComponent',
|
|
1079
1095
|
styles,
|
|
@@ -1134,7 +1150,7 @@ const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps,
|
|
|
1134
1150
|
var _a;
|
|
1135
1151
|
const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
|
|
1136
1152
|
if (respMessage === 'This phone number was verified') {
|
|
1137
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
1153
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
1138
1154
|
return;
|
|
1139
1155
|
}
|
|
1140
1156
|
setShowOtpPhone(newShowOtpPhone);
|
|
@@ -1144,7 +1160,7 @@ const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps,
|
|
|
1144
1160
|
});
|
|
1145
1161
|
return;
|
|
1146
1162
|
}
|
|
1147
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
1163
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
1148
1164
|
})(e);
|
|
1149
1165
|
}, 100);
|
|
1150
1166
|
};
|
|
@@ -1314,10 +1330,13 @@ const OtpBlockComponent = ({ otpData, onSuccess, autoSendWhenOpen, className, st
|
|
|
1314
1330
|
};
|
|
1315
1331
|
const OtpBlock$1 = (_a) => {
|
|
1316
1332
|
var rest = __rest(_a, []);
|
|
1317
|
-
const { showOtpPhone, setShowOtpPhone, onSubmit,
|
|
1333
|
+
const { showOtpPhone, setShowOtpPhone, onSubmit,
|
|
1334
|
+
// formRef,
|
|
1335
|
+
// leadFormConfig: { form },
|
|
1336
|
+
} = useContext(LeadGenComponentContext);
|
|
1318
1337
|
return showOtpPhone ? (React__default.createElement(OtpBlockComponent, Object.assign({ otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
|
|
1319
1338
|
setShowOtpPhone(null);
|
|
1320
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
1339
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
1321
1340
|
} }, rest))) : null;
|
|
1322
1341
|
};
|
|
1323
1342
|
|
|
@@ -2066,6 +2085,7 @@ const LeadGenContextProvider = (props) => {
|
|
|
2066
2085
|
Service.getSubscriptionBoxInfo({
|
|
2067
2086
|
category: categoryId,
|
|
2068
2087
|
site: site_domain,
|
|
2088
|
+
slug: location === null || location === void 0 ? void 0 : location.pathname,
|
|
2069
2089
|
}).then((res) => {
|
|
2070
2090
|
const { _data } = res || {};
|
|
2071
2091
|
const { item, campaign_code } = _data || {};
|
|
@@ -2119,7 +2139,7 @@ const [LeadFormProvider, useLeadFormContext, useLeadForm] = createFormContext();
|
|
|
2119
2139
|
const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, format, }) => {
|
|
2120
2140
|
var _a;
|
|
2121
2141
|
const { t } = useTranslations();
|
|
2122
|
-
const initialValues = useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
2142
|
+
const initialValues = useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
2123
2143
|
const LEAD_LOCALE = LEAD_LOCALE_DATA[(_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.lang] ||
|
|
2124
2144
|
LEAD_LOCALE_DATA['vi-VN'];
|
|
2125
2145
|
const validateObj = useMemo(() => {
|
|
@@ -2281,7 +2301,7 @@ const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validating
|
|
|
2281
2301
|
}, {});
|
|
2282
2302
|
}, [listBlockAdded.map((b) => b.name).join(','), format]);
|
|
2283
2303
|
const form = useLeadForm({
|
|
2284
|
-
validateInputOnChange:
|
|
2304
|
+
validateInputOnChange: false,
|
|
2285
2305
|
validateInputOnBlur: true,
|
|
2286
2306
|
clearInputErrorOnChange: true,
|
|
2287
2307
|
validate: validateObj,
|
|
@@ -2354,15 +2374,14 @@ const StyledLeadGenSubscriptionBoxBody = styled.div `
|
|
|
2354
2374
|
}
|
|
2355
2375
|
`;
|
|
2356
2376
|
const StyledLeadGenSubscriptionBoxHeaderImage = styled.div `
|
|
2357
|
-
margin-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
height: 44px;
|
|
2377
|
+
margin-left: 24px;
|
|
2378
|
+
width: 68px;
|
|
2379
|
+
height: 68px;
|
|
2361
2380
|
|
|
2362
2381
|
img {
|
|
2363
2382
|
width: 100%;
|
|
2364
2383
|
height: 100%;
|
|
2365
|
-
object-
|
|
2384
|
+
object-fit: contain;
|
|
2366
2385
|
onject-position: center;
|
|
2367
2386
|
}
|
|
2368
2387
|
|
|
@@ -2379,22 +2398,21 @@ const StyledLeadGenSubscriptionBoxHeader = styled.div `
|
|
|
2379
2398
|
flex: 1;
|
|
2380
2399
|
min-width: 0;
|
|
2381
2400
|
color: ${theme.colors.gray900};
|
|
2382
|
-
font-size:
|
|
2401
|
+
font-size: 17px;
|
|
2383
2402
|
font-weight: 400;
|
|
2384
2403
|
line-height: 1.4;
|
|
2385
2404
|
letter-spacing: -0.4px;
|
|
2386
2405
|
}
|
|
2387
|
-
|
|
2388
|
-
${MediaQueries.mbUp} {
|
|
2389
|
-
.leadgen-title {
|
|
2390
|
-
font-size: 18px;
|
|
2391
|
-
letter-spacing: -0.8px;
|
|
2392
|
-
}
|
|
2393
|
-
}
|
|
2394
2406
|
`;
|
|
2395
2407
|
const StyledLeadGenSubscriptionBox = styled.div `
|
|
2396
2408
|
padding: 16px;
|
|
2397
2409
|
border: 1px solid ${theme.colors.neutral100};
|
|
2410
|
+
background: linear-gradient(
|
|
2411
|
+
180.71deg,
|
|
2412
|
+
#7bc2ff -18.54%,
|
|
2413
|
+
#e3f2ff 17.12%,
|
|
2414
|
+
#ffffff 99.25%
|
|
2415
|
+
);
|
|
2398
2416
|
border-radius: 12px;
|
|
2399
2417
|
margin-inline: auto;
|
|
2400
2418
|
.leadgen-form_inputs {
|
|
@@ -2428,6 +2446,7 @@ const StyledLeadGenSubscriptionBox = styled.div `
|
|
|
2428
2446
|
margin-left: 8px;
|
|
2429
2447
|
width: auto;
|
|
2430
2448
|
min-height: 56px;
|
|
2449
|
+
font-size: 16px;
|
|
2431
2450
|
}
|
|
2432
2451
|
}
|
|
2433
2452
|
}
|
|
@@ -2467,16 +2486,64 @@ const PhoneInput = forwardRef((props, ref) => {
|
|
|
2467
2486
|
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" })))));
|
|
2468
2487
|
});
|
|
2469
2488
|
|
|
2470
|
-
const
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2489
|
+
const NoData = ({ className, style }) => {
|
|
2490
|
+
return (React__default.createElement("svg", { width: "64", height: "55", viewBox: "0 0 64 55", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, style: style },
|
|
2491
|
+
React__default.createElement("path", { d: "M32.6226 54.0001C46.2852 54.0001 57.3652 43.0033 57.3652 29.4239C57.3652 15.8446 46.2852 4.84778 32.6226 4.84778C18.9599 4.84778 7.87988 15.8446 7.87988 29.4239C7.87988 43.0033 18.9599 54.0001 32.6226 54.0001Z", fill: "#E6EAF5" }),
|
|
2492
|
+
React__default.createElement("path", { d: "M51.5751 26.2165V41.2537C51.5751 44.3778 49.0342 46.9187 45.8684 46.9187H19.4596C16.3355 46.9187 13.7946 44.4195 13.7529 41.2954C13.7529 41.2537 13.7529 41.2537 13.7529 41.2121V26.2165C13.7529 26.1748 13.7529 26.1748 13.7529 26.1332C13.7529 26.0498 13.7529 25.9665 13.7946 25.8832C13.8362 25.7583 13.8779 25.675 13.9195 25.55L21.0008 12.0123C21.2507 11.4708 21.7922 11.1792 22.3754 11.1792H42.911C43.4941 11.1792 43.994 11.4708 44.2856 12.0123L51.3668 25.55C51.4085 25.6333 51.4501 25.7583 51.4918 25.8832C51.5751 25.9665 51.5751 26.0915 51.5751 26.2165Z", fill: "#D5DDEA" }),
|
|
2493
|
+
React__default.createElement("path", { d: "M51.5751 26.2164V42.7949C51.5751 45.0859 49.7423 46.9187 47.4096 46.9187H17.9184C15.6274 46.9187 13.7529 45.0859 13.7529 42.7949V26.1331C13.7529 26.0498 13.7529 25.9665 13.7946 25.8832H23.2918C24.708 25.8832 25.8743 27.0078 25.8743 28.4658C25.8743 29.1739 26.1659 29.8404 26.6241 30.2986C27.124 30.7984 27.7071 31.0483 28.4569 31.0483H36.9127C38.329 31.0483 39.4953 29.9237 39.4953 28.4658C39.4953 27.7576 39.7869 27.0912 40.2451 26.633C40.7449 26.1331 41.3281 25.8832 42.0362 25.8832H51.4918C51.5751 25.9665 51.5751 26.0915 51.5751 26.2164Z", fill: "url(#paint0_linear_2578_27197)" }),
|
|
2494
|
+
React__default.createElement("path", { d: "M56.7342 17.6773C57.6774 17.6773 58.442 16.9126 58.442 15.9694C58.442 15.0262 57.6774 14.2616 56.7342 14.2616C55.791 14.2616 55.0264 15.0262 55.0264 15.9694C55.0264 16.9126 55.791 17.6773 56.7342 17.6773Z", fill: "#EAEEF9" }),
|
|
2495
|
+
React__default.createElement("path", { d: "M55.0257 12.1373C55.6698 12.1373 56.192 11.6152 56.192 10.971C56.192 10.3269 55.6698 9.80469 55.0257 9.80469C54.3816 9.80469 53.8594 10.3269 53.8594 10.971C53.8594 11.6152 54.3816 12.1373 55.0257 12.1373Z", fill: "#EAEEF9" }),
|
|
2496
|
+
React__default.createElement("path", { d: "M7.79034 15.9694C8.43449 15.9694 8.95667 15.4472 8.95667 14.803C8.95667 14.1589 8.43449 13.6367 7.79034 13.6367C7.1462 13.6367 6.62402 14.1589 6.62402 14.803C6.62402 15.4472 7.1462 15.9694 7.79034 15.9694Z", fill: "#EAEEF9" }),
|
|
2497
|
+
React__default.createElement("path", { d: "M5.16603 41.6286C6.36229 41.6286 7.33205 40.6588 7.33205 39.4625C7.33205 38.2663 6.36229 37.2965 5.16603 37.2965C3.96976 37.2965 3 38.2663 3 39.4625C3 40.6588 3.96976 41.6286 5.16603 41.6286Z", fill: "#EAEEF9" }),
|
|
2498
|
+
React__default.createElement("path", { d: "M43.0864 6.16785C43.6301 12.1024 43.9019 13.4615 42.6711 18.8361C42.2708 20.0309 41.8705 21.3396 41.0128 22.25C39.812 23.6725 37.6392 24.2984 35.8666 23.8432C34.0368 23.388 32.5501 21.7948 32.2071 19.8602C31.9212 18.6654 32.3214 17.2429 33.3507 16.5032C34.4371 15.8204 35.981 15.9911 36.8958 16.8446C37.9251 17.6981 38.3254 19.0068 38.2682 20.2585C38.211 21.5103 37.7536 22.7621 37.1246 23.8432C35.7027 26.5014 35.1173 26.4916 32.2071 30.8575", stroke: "#ABB5CC", strokeMiterlimit: "10", strokeDasharray: "4 4" }),
|
|
2499
|
+
React__default.createElement("path", { d: "M46.2749 3.95757C46.0575 4.75059 45.1881 5.03896 44.3187 4.53431C43.3769 4.10176 42.7249 3.74129 42.8698 3.02037C43.0871 2.29945 43.9565 2.22735 44.9708 2.15526C46.2024 2.01108 46.4198 3.16455 46.2749 3.95757Z", fill: "#DAE2EB" }),
|
|
2500
|
+
React__default.createElement("path", { d: "M39.2479 4.67842C39.6102 5.32726 40.6245 5.75981 41.3489 5.11098C42.1459 4.39005 42.7979 3.88541 42.4357 3.16448C42.0734 2.51565 41.4938 2.73193 40.2622 2.87611C39.2479 3.09239 38.8132 3.9575 39.2479 4.67842Z", fill: "#DAE2EB" }),
|
|
2501
|
+
React__default.createElement("path", { d: "M42.4358 2.01104C42.9429 1.93895 43.4501 2.22732 43.595 2.65987C43.6674 2.80406 43.7399 3.02034 43.7399 3.16452C43.8848 4.17381 43.5225 5.03892 42.9429 5.11102C42.2909 5.2552 41.6389 4.53428 41.5664 3.59707C41.5664 3.3087 41.5664 3.16452 41.5664 2.94824C41.6389 2.4436 41.9286 2.08313 42.4358 2.01104C42.5082 2.01104 42.4358 2.01104 42.4358 2.01104Z", fill: "#989FB0" }),
|
|
2502
|
+
React__default.createElement("path", { d: "M27.9127 37.0298C28.4405 37.0298 28.8684 36.6019 28.8684 36.0741C28.8684 35.5463 28.4405 35.1184 27.9127 35.1184C27.3849 35.1184 26.957 35.5463 26.957 36.0741C26.957 36.6019 27.3849 37.0298 27.9127 37.0298Z", fill: "#989FB0" }),
|
|
2503
|
+
React__default.createElement("path", { d: "M37.4186 37.0298C37.9464 37.0298 38.3742 36.6019 38.3742 36.0741C38.3742 35.5463 37.9464 35.1184 37.4186 35.1184C36.8908 35.1184 36.4629 35.5463 36.4629 36.0741C36.4629 36.6019 36.8908 37.0298 37.4186 37.0298Z", fill: "#989FB0" }),
|
|
2504
|
+
React__default.createElement("path", { d: "M34.2147 43.3063H31.2186C30.7536 43.3063 30.3662 42.9188 30.3662 42.4539C30.3662 41.989 30.7536 41.6016 31.2186 41.6016H34.1889C34.6538 41.6016 35.0413 41.989 35.0413 42.4539C35.0671 42.9188 34.6797 43.3063 34.2147 43.3063Z", fill: "#989FB0" }),
|
|
2505
|
+
React__default.createElement("defs", null,
|
|
2506
|
+
React__default.createElement("linearGradient", { id: "paint0_linear_2578_27197", x1: "32.6517", y1: "25.3966", x2: "32.6517", y2: "47.1455", gradientUnits: "userSpaceOnUse" },
|
|
2507
|
+
React__default.createElement("stop", { stopColor: "#FDFEFF" }),
|
|
2508
|
+
React__default.createElement("stop", { offset: "0.9964", stopColor: "#ECF0F5" })))));
|
|
2509
|
+
};
|
|
2510
|
+
|
|
2511
|
+
const libraries = ['places'];
|
|
2512
|
+
const GoogleLocationBlock = (props) => {
|
|
2513
|
+
var _a;
|
|
2514
|
+
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
2515
|
+
const [LoadScript, setLoadScript] = useState(null);
|
|
2516
|
+
const [value, setValue] = useState(defaultValue || valueProps);
|
|
2517
|
+
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]);
|
|
2518
|
+
const onChangeAutocomplete = useCallback((s) => {
|
|
2519
|
+
setValue(s);
|
|
2520
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
2521
|
+
}, []);
|
|
2522
|
+
const onClickItem = useCallback((item) => {
|
|
2523
|
+
/** For sure get value */
|
|
2524
|
+
setValue(item.value);
|
|
2525
|
+
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
2526
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
2527
|
+
}, [onChangeProps, predictions]);
|
|
2528
|
+
useEffect(() => {
|
|
2529
|
+
setValue(valueProps);
|
|
2530
|
+
}, [valueProps]);
|
|
2531
|
+
useEffect(() => {
|
|
2532
|
+
var _a, _b, _c;
|
|
2533
|
+
// only load extra google script when not yet loaded
|
|
2534
|
+
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) {
|
|
2535
|
+
import('@react-google-maps/api').then((m) => {
|
|
2536
|
+
setLoadScript(() => m.LoadScript);
|
|
2537
|
+
});
|
|
2477
2538
|
}
|
|
2478
|
-
}
|
|
2479
|
-
return
|
|
2539
|
+
}, []);
|
|
2540
|
+
return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
2541
|
+
return { value: pred.description, label: pred.description };
|
|
2542
|
+
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
2543
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
2544
|
+
LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
|
|
2545
|
+
children));
|
|
2546
|
+
} }, restProps)));
|
|
2480
2547
|
};
|
|
2481
2548
|
|
|
2482
2549
|
const StyledLeadGenFormInner = styled.div `
|
|
@@ -2815,17 +2882,22 @@ const TextField$1 = (props) => {
|
|
|
2815
2882
|
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
|
|
2816
2883
|
});
|
|
2817
2884
|
const [shrink, setShrink] = useState(shrinkProps);
|
|
2885
|
+
const focusInput = (target) => {
|
|
2886
|
+
const $textEl = target.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
|
|
2887
|
+
const $focusEl = $textEl.item($textEl.length - 1);
|
|
2888
|
+
if ($focusEl) {
|
|
2889
|
+
$focusEl.focus({ preventScroll: true });
|
|
2890
|
+
}
|
|
2891
|
+
};
|
|
2818
2892
|
const onClick = useCallback((e) => {
|
|
2819
|
-
setShrink(true);
|
|
2820
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
2821
2893
|
if (shrink) {
|
|
2894
|
+
e.preventDefault();
|
|
2895
|
+
focusInput(e.currentTarget);
|
|
2822
2896
|
return;
|
|
2823
2897
|
}
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
$focusEl.focus();
|
|
2828
|
-
}
|
|
2898
|
+
setShrink(true);
|
|
2899
|
+
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
2900
|
+
focusInput(e.currentTarget);
|
|
2829
2901
|
}, [shrink]);
|
|
2830
2902
|
useEffect(() => {
|
|
2831
2903
|
setShrink(shrinkProps);
|
|
@@ -2838,44 +2910,6 @@ const ChoiceField$1 = (props) => {
|
|
|
2838
2910
|
return (React__default.createElement(StyledChoiceFieldContainer$1, Object.assign({ className: clsx(className, 'choiceField') }, restProps), children));
|
|
2839
2911
|
};
|
|
2840
2912
|
|
|
2841
|
-
const libraries = ['places'];
|
|
2842
|
-
const GoogleLocationBlock = (props) => {
|
|
2843
|
-
var _a;
|
|
2844
|
-
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = __rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
2845
|
-
const [LoadScript, setLoadScript] = useState(null);
|
|
2846
|
-
const [value, setValue] = useState(defaultValue || valueProps);
|
|
2847
|
-
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]);
|
|
2848
|
-
const onChangeAutocomplete = useCallback((s) => {
|
|
2849
|
-
setValue(s);
|
|
2850
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
2851
|
-
}, []);
|
|
2852
|
-
const onClickItem = useCallback((item) => {
|
|
2853
|
-
/** For sure get value */
|
|
2854
|
-
setValue(item.value);
|
|
2855
|
-
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
2856
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
2857
|
-
}, [onChangeProps, predictions]);
|
|
2858
|
-
useEffect(() => {
|
|
2859
|
-
setValue(valueProps);
|
|
2860
|
-
}, [valueProps]);
|
|
2861
|
-
useEffect(() => {
|
|
2862
|
-
var _a, _b, _c;
|
|
2863
|
-
// only load extra google script when not yet loaded
|
|
2864
|
-
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) {
|
|
2865
|
-
import('@react-google-maps/api').then((m) => {
|
|
2866
|
-
setLoadScript(() => m.LoadScript);
|
|
2867
|
-
});
|
|
2868
|
-
}
|
|
2869
|
-
}, []);
|
|
2870
|
-
return (React__default.createElement(Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
2871
|
-
return { value: pred.description, label: pred.description };
|
|
2872
|
-
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
2873
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
2874
|
-
LoadScript && (React__default.createElement(LoadScript, { googleMapsApiKey: GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default.createElement(React__default.Fragment, null), style: { width: '100%' } })),
|
|
2875
|
-
children));
|
|
2876
|
-
} }, restProps)));
|
|
2877
|
-
};
|
|
2878
|
-
|
|
2879
2913
|
const LeadGenForm = forwardRef((props, ref) => {
|
|
2880
2914
|
const { locale, blocks, scrollToErrorField = true, form: formProps, rules: validate, initialValues, onFinish, onFinishFailed, className, style, } = props;
|
|
2881
2915
|
const formRef = useRef(null);
|
|
@@ -2929,52 +2963,73 @@ const LeadGenForm = forwardRef((props, ref) => {
|
|
|
2929
2963
|
return (React__default.createElement("form", { ref: formRef, onSubmit: form.onSubmit(middlewareFinish, middlewareFinishFailed), className: className, style: style },
|
|
2930
2964
|
React__default.createElement(StyledLeadGenFormInner, { className: "leadgen-form_inputs" }, blocks.map((block, idx) => {
|
|
2931
2965
|
const { id, name: blockName, data } = block;
|
|
2932
|
-
const { placeholder, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
|
|
2966
|
+
const { placeholder: label, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
|
|
2933
2967
|
const formInputProps = form.getInputProps(name);
|
|
2934
2968
|
const { value, error } = formInputProps;
|
|
2935
2969
|
const reactKey = `${id}-${idx}`;
|
|
2936
2970
|
switch (blockName) {
|
|
2937
2971
|
case LEADGEN_BLOCK.TextBlock: {
|
|
2938
2972
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2939
|
-
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label:
|
|
2973
|
+
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "text", "data-control": "text" }, formInputProps))));
|
|
2940
2974
|
}
|
|
2941
2975
|
case LEADGEN_BLOCK.NumberBlock: {
|
|
2942
2976
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2943
|
-
React__default.createElement(NumberInput$1, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label:
|
|
2977
|
+
React__default.createElement(NumberInput$1, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "number", "data-control": "number" }, formInputProps))));
|
|
2944
2978
|
}
|
|
2945
2979
|
case LEADGEN_BLOCK.EmailBlock: {
|
|
2946
2980
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2947
|
-
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label:
|
|
2981
|
+
React__default.createElement(TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, "data-control": "email" }, formInputProps))));
|
|
2948
2982
|
}
|
|
2949
2983
|
case LEADGEN_BLOCK.PhoneOtpBlock:
|
|
2950
2984
|
case LEADGEN_BLOCK.WhatsappOtpBlock:
|
|
2951
2985
|
case LEADGEN_BLOCK.ZaloOtpBlock:
|
|
2952
2986
|
case LEADGEN_BLOCK.PhoneBlock: {
|
|
2953
2987
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2954
|
-
React__default.createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label:
|
|
2988
|
+
React__default.createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), type: "text", "data-control": "tel" }, formInputProps))));
|
|
2955
2989
|
}
|
|
2956
2990
|
case LEADGEN_BLOCK.LocationBlock: {
|
|
2957
2991
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2958
|
-
React__default.createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label:
|
|
2992
|
+
React__default.createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, locale: locale, "data-control": "text" }, formInputProps))));
|
|
2959
2993
|
}
|
|
2960
2994
|
case LEADGEN_BLOCK.DateBlock: {
|
|
2961
2995
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2962
|
-
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:
|
|
2996
|
+
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: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "default", "data-control": "date" }, formInputProps))));
|
|
2963
2997
|
}
|
|
2964
2998
|
case LEADGEN_BLOCK.DropdownBlock:
|
|
2965
2999
|
return (React__default.createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2966
3000
|
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
2967
|
-
React__default.createElement(Select$1, Object.assign({ name: name, withAsterisk: required, label:
|
|
3001
|
+
React__default.createElement(Select$1, Object.assign({ name: name, withAsterisk: required, label: label, placeholder: " ", searchable: true, data: listQuestion.map((l) => ({
|
|
2968
3002
|
value: l.value,
|
|
2969
3003
|
label: l.placeholder,
|
|
2970
|
-
}))
|
|
3004
|
+
})), nothingFound: React__default.createElement(NoData, null), styles: {
|
|
3005
|
+
item: {
|
|
3006
|
+
paddingBlock: 12,
|
|
3007
|
+
paddingInline: 10,
|
|
3008
|
+
fontSize: 16,
|
|
3009
|
+
lineHeight: 1.5,
|
|
3010
|
+
},
|
|
3011
|
+
nothingFound: {
|
|
3012
|
+
fontSize: 54,
|
|
3013
|
+
paddingBlock: 30,
|
|
3014
|
+
},
|
|
3015
|
+
itemsWrapper: {
|
|
3016
|
+
padding: 6,
|
|
3017
|
+
},
|
|
3018
|
+
dropdown: {
|
|
3019
|
+
'.mantine-ScrollArea-scrollbar[data-orientation="vertical"]': {
|
|
3020
|
+
'--radix-scroll-area-thumb-width': '6px',
|
|
3021
|
+
width: 'var(--radix-scroll-area-thumb-width)',
|
|
3022
|
+
paddingInline: 0,
|
|
3023
|
+
},
|
|
3024
|
+
},
|
|
3025
|
+
}, maxDropdownHeight: 192 }, formInputProps))));
|
|
2971
3026
|
case LEADGEN_BLOCK.CheckboxBlock: {
|
|
2972
3027
|
const formInputCheckboxProps = form.getInputProps(name, {
|
|
2973
3028
|
type: 'checkbox',
|
|
2974
3029
|
});
|
|
2975
3030
|
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2976
3031
|
isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2977
|
-
React__default.createElement(Checkbox$1.Group, Object.assign({ size: "md", withAsterisk: required, label:
|
|
3032
|
+
React__default.createElement(Checkbox$1.Group, Object.assign({ size: "md", withAsterisk: required, label: label, value: value, sx: {
|
|
2978
3033
|
display: 'flex',
|
|
2979
3034
|
flexDirection: 'column',
|
|
2980
3035
|
flexWrap: 'wrap',
|
|
@@ -2986,7 +3041,7 @@ const LeadGenForm = forwardRef((props, ref) => {
|
|
|
2986
3041
|
case LEADGEN_BLOCK.RadioBlock: {
|
|
2987
3042
|
return (React__default.createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2988
3043
|
isSendMailChimp && (React__default.createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2989
|
-
React__default.createElement(Radio$1.Group, Object.assign({ size: "md", withAsterisk: required, label:
|
|
3044
|
+
React__default.createElement(Radio$1.Group, Object.assign({ size: "md", withAsterisk: required, label: label, value: value, spellCheck: true, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
|
|
2990
3045
|
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
2991
3046
|
} }, formInputProps), listQuestion.map((l, _index) => (React__default.createElement(Radio$1, { name: name, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
2992
3047
|
}
|
|
@@ -3021,8 +3076,8 @@ const LeadGenSubscriptionBoxA = (props) => {
|
|
|
3021
3076
|
}, [title]);
|
|
3022
3077
|
return (React__default.createElement(StyledLeadGenSubscriptionBoxA, { className: "subcription_box_A" },
|
|
3023
3078
|
React__default.createElement(StyledLeadGenSubscriptionBoxHeader, { className: "leadgen-subscription_box_header" },
|
|
3024
|
-
|
|
3025
|
-
|
|
3079
|
+
titleComp,
|
|
3080
|
+
imageComp),
|
|
3026
3081
|
React__default.createElement(StyledLeadGenSubscriptionBoxBody, { className: "leadgen-subscription_box_body" },
|
|
3027
3082
|
React__default.createElement(LeadGenForm, { ref: formRef, form: form, rules: rules, blocks: blocks, locale: locale, onFinish: onFinish, className: "leadgen-subscription_box_form" }),
|
|
3028
3083
|
React__default.createElement(Button$1, { disabled: loading, loading: loading, variant: "filled", size: "lg", onClick: () => {
|
|
@@ -3605,6 +3660,182 @@ const useViewportDimensions = () => {
|
|
|
3605
3660
|
return useMemo(() => (Object.assign({}, dimensions)), [dimensions.height, dimensions.width]);
|
|
3606
3661
|
};
|
|
3607
3662
|
|
|
3663
|
+
const StyledLeadGenLightBoxBFooter = styled.div `
|
|
3664
|
+
padding-top: calc(var(--spacing-y, 20px) * 8 / 20);
|
|
3665
|
+
padding-inline: var(--spacing-x, 20px);
|
|
3666
|
+
padding-bottom: var(--spacing-y, 20px);
|
|
3667
|
+
`;
|
|
3668
|
+
const StyledLeadGenLightBoxBBody = styled.div `
|
|
3669
|
+
flex: 1;
|
|
3670
|
+
min-height: 0;
|
|
3671
|
+
overflow: auto;
|
|
3672
|
+
padding-inline: var(--spacing-y, 20px);
|
|
3673
|
+
padding-block: calc(var(--spacing-x, 20px) * 8 / 20);
|
|
3674
|
+
&::-webkit-scrollbar {
|
|
3675
|
+
width: 6px;
|
|
3676
|
+
height: 6px;
|
|
3677
|
+
}
|
|
3678
|
+
|
|
3679
|
+
&::-webkit-scrollbar-track {
|
|
3680
|
+
background-color: transparent;
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
&::-webkit-scrollbar-thumb {
|
|
3684
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
3685
|
+
border-radius: 6px;
|
|
3686
|
+
}
|
|
3687
|
+
`;
|
|
3688
|
+
const StyledLeadGenLightBoxBHeader = styled.div `
|
|
3689
|
+
display: flex;
|
|
3690
|
+
padding-top: var(--spacing-y, 20px);
|
|
3691
|
+
padding-inline: var(--spacing-x, 20px);
|
|
3692
|
+
padding-bottom: calc(var(--spacing-y, 20px) * 8 / 20);
|
|
3693
|
+
`;
|
|
3694
|
+
const StyledLeadGenLightBoxBWrapper = styled.div `
|
|
3695
|
+
height: 100%;
|
|
3696
|
+
display: flex;
|
|
3697
|
+
flex-direction: column;
|
|
3698
|
+
`;
|
|
3699
|
+
const StyledLeadGenLightBoxB = styled.div `
|
|
3700
|
+
--spacing-x: 20px;
|
|
3701
|
+
--spacing-y: 20px;
|
|
3702
|
+
--close-width: 24px;
|
|
3703
|
+
--close-height: 24px;
|
|
3704
|
+
|
|
3705
|
+
// For old version, Wrap every thing in children
|
|
3706
|
+
&[data-type='LightBoxB_typeA'] {
|
|
3707
|
+
height: 100%;
|
|
3708
|
+
width: 100%;
|
|
3709
|
+
.leadgen-wrapper,
|
|
3710
|
+
.leadgen-inner,
|
|
3711
|
+
.leadgen-form {
|
|
3712
|
+
height: 100%;
|
|
3713
|
+
}
|
|
3714
|
+
.leadgen-content {
|
|
3715
|
+
height: 100%;
|
|
3716
|
+
display: flex;
|
|
3717
|
+
flex-direction: column;
|
|
3718
|
+
}
|
|
3719
|
+
.leadgen-header {
|
|
3720
|
+
display: none;
|
|
3721
|
+
}
|
|
3722
|
+
.leadgen-title {
|
|
3723
|
+
padding-right: calc(var(--close-width, 24px) * 50 / 24);
|
|
3724
|
+
}
|
|
3725
|
+
.leadgen-description {
|
|
3726
|
+
display: none;
|
|
3727
|
+
}
|
|
3728
|
+
.leadgen-body {
|
|
3729
|
+
flex: 1;
|
|
3730
|
+
min-height: 0;
|
|
3731
|
+
}
|
|
3732
|
+
|
|
3733
|
+
.leadgen-close_btn {
|
|
3734
|
+
top: var(--spacing-y, 20px);
|
|
3735
|
+
right: var(--spacing-x, 20px);
|
|
3736
|
+
width: var(--close-width, 24px) !important;
|
|
3737
|
+
height: var(--close-height, 24px);
|
|
3738
|
+
box-shadow: none;
|
|
3739
|
+
font-size: 24px;
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3742
|
+
.leadgen-empty_footer {
|
|
3743
|
+
.leadgen-btn {
|
|
3744
|
+
flex: 1;
|
|
3745
|
+
min-width: 0;
|
|
3746
|
+
}
|
|
3747
|
+
}
|
|
3748
|
+
|
|
3749
|
+
.leadgen-form_body {
|
|
3750
|
+
overflow: auto;
|
|
3751
|
+
animation: scrolling forwards;
|
|
3752
|
+
animation-timeline: scroll(self);
|
|
3753
|
+
}
|
|
3754
|
+
@keyframes scrolling {
|
|
3755
|
+
0%,
|
|
3756
|
+
to {
|
|
3757
|
+
border-bottom: 1px solid ${theme.colors.neutral100};
|
|
3758
|
+
}
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3761
|
+
`;
|
|
3762
|
+
const StyledMotionContainer = styled(motion.div) `
|
|
3763
|
+
position: fixed;
|
|
3764
|
+
inset: 0;
|
|
3765
|
+
z-index: ${ZINDEX_SSO + 1};
|
|
3766
|
+
background-color: #fff;
|
|
3767
|
+
`;
|
|
3768
|
+
|
|
3769
|
+
const PREFIX_CLS = 'LightBoxB_typeA';
|
|
3770
|
+
const DURATION = 1000 * 0.5;
|
|
3771
|
+
const DRAWER_STYLE = {
|
|
3772
|
+
visible: {
|
|
3773
|
+
opacity: 1,
|
|
3774
|
+
translateY: '0px',
|
|
3775
|
+
transitionProperty: 'translate',
|
|
3776
|
+
transitionDuration: '0.25s',
|
|
3777
|
+
},
|
|
3778
|
+
hidden: {
|
|
3779
|
+
opacity: 0,
|
|
3780
|
+
translateY: '100%',
|
|
3781
|
+
transitionProperty: 'translate',
|
|
3782
|
+
transitionDuration: '0.25s',
|
|
3783
|
+
},
|
|
3784
|
+
};
|
|
3785
|
+
const LeadGenLightBoxBTypeA = (props) => {
|
|
3786
|
+
const { visible, onVisible, icon, title, buttonText, blocks, children } = props, restProps = __rest(props, ["visible", "onVisible", "icon", "title", "buttonText", "blocks", "children"]);
|
|
3787
|
+
const formRef = useRef();
|
|
3788
|
+
const [open, setOpen] = useState(visible);
|
|
3789
|
+
const { height } = useViewportDimensions();
|
|
3790
|
+
usePreventScroll();
|
|
3791
|
+
const onOpenChange = useCallback((open) => {
|
|
3792
|
+
if (!open) {
|
|
3793
|
+
// Wait for duration of animation
|
|
3794
|
+
setTimeout(() => {
|
|
3795
|
+
onVisible === null || onVisible === void 0 ? void 0 : onVisible(open);
|
|
3796
|
+
}, DURATION);
|
|
3797
|
+
return;
|
|
3798
|
+
}
|
|
3799
|
+
onVisible === null || onVisible === void 0 ? void 0 : onVisible(open);
|
|
3800
|
+
}, [onVisible]);
|
|
3801
|
+
const iconComp = useMemo(() => {
|
|
3802
|
+
if (!icon) {
|
|
3803
|
+
return null;
|
|
3804
|
+
}
|
|
3805
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
3806
|
+
}, [icon]);
|
|
3807
|
+
const titleComp = useMemo(() => {
|
|
3808
|
+
if (!title) {
|
|
3809
|
+
return null;
|
|
3810
|
+
}
|
|
3811
|
+
return title;
|
|
3812
|
+
}, [title]);
|
|
3813
|
+
const childrenComp = useMemo(() => {
|
|
3814
|
+
if (children) {
|
|
3815
|
+
return children;
|
|
3816
|
+
}
|
|
3817
|
+
return (React__default.createElement(StyledLeadGenLightBoxBWrapper, { className: `${PREFIX_CLS}_wrapper lightboxB_wrapper` },
|
|
3818
|
+
React__default.createElement(StyledLeadGenLightBoxBHeader, { className: `${PREFIX_CLS}_header lightboxB_header` },
|
|
3819
|
+
React__default.createElement("div", { className: "lightBoxB_header_icon" }, iconComp),
|
|
3820
|
+
React__default.createElement("div", { className: "lightBoxB_header_title" }, titleComp),
|
|
3821
|
+
React__default.createElement("div", { className: "lightBoxB_header_close", onClick: () => onOpenChange(false) },
|
|
3822
|
+
React__default.createElement(CloseButton, null))),
|
|
3823
|
+
React__default.createElement(StyledLeadGenLightBoxBBody, { className: `${PREFIX_CLS}_body lightboxB_body` },
|
|
3824
|
+
React__default.createElement(LeadGenForm, Object.assign({ ref: formRef, blocks: blocks }, restProps))),
|
|
3825
|
+
React__default.createElement(StyledLeadGenLightBoxBFooter, { className: `${PREFIX_CLS}_footer lightboxB_footer` },
|
|
3826
|
+
React__default.createElement(Button, { onClick: () => { var _a; return (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit(); } }, buttonText))));
|
|
3827
|
+
}, [children, onOpenChange]);
|
|
3828
|
+
useEffect(() => {
|
|
3829
|
+
setOpen(visible);
|
|
3830
|
+
}, [visible]);
|
|
3831
|
+
return (React__default.createElement(StyledMotionContainer, { animate: open ? 'visible' : 'hidden', variants: DRAWER_STYLE },
|
|
3832
|
+
React__default.createElement(StyledLeadGenLightBoxB, { "data-type": "LightBoxB_typeA", style: height ? { maxHeight: height } : undefined }, childrenComp)));
|
|
3833
|
+
};
|
|
3834
|
+
|
|
3835
|
+
const LeadGenLightBoxB = (props) => {
|
|
3836
|
+
return React__default.createElement(LeadGenLightBoxBTypeA, Object.assign({}, props));
|
|
3837
|
+
};
|
|
3838
|
+
|
|
3608
3839
|
const ThankyouPopup = ({ title, titleAlign, subtitle, subtitleAlign, link, linkNewTab, linkText, image, }) => {
|
|
3609
3840
|
const { primaryColor } = useContext(LeadGenContext$1);
|
|
3610
3841
|
const { width: imageWidth, height: imageHeight, loaded: imageLoaded, } = useImageSize(image);
|
|
@@ -3974,6 +4205,7 @@ const StyledTextFieldContainer = styled.div `
|
|
|
3974
4205
|
outline: none !important;
|
|
3975
4206
|
border: none;
|
|
3976
4207
|
box-shadow: none;
|
|
4208
|
+
font-size: var(--input, 15px);
|
|
3977
4209
|
padding: 0 var(--phone-input-space-x, 8px);
|
|
3978
4210
|
opacity: 0;
|
|
3979
4211
|
color: ${theme.colors.gray800} !important;
|
|
@@ -4093,17 +4325,22 @@ const TextField = (props) => {
|
|
|
4093
4325
|
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
|
|
4094
4326
|
});
|
|
4095
4327
|
const [shrink, setShrink] = useState(shrinkProps);
|
|
4328
|
+
const focusInput = (target) => {
|
|
4329
|
+
const $textEl = target.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
|
|
4330
|
+
const $focusEl = $textEl.item($textEl.length - 1);
|
|
4331
|
+
if ($focusEl) {
|
|
4332
|
+
$focusEl.focus({ preventScroll: true });
|
|
4333
|
+
}
|
|
4334
|
+
};
|
|
4096
4335
|
const onClick = useCallback((e) => {
|
|
4097
|
-
setShrink(true);
|
|
4098
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
4099
4336
|
if (shrink) {
|
|
4337
|
+
e.preventDefault();
|
|
4338
|
+
focusInput(e.currentTarget);
|
|
4100
4339
|
return;
|
|
4101
4340
|
}
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
$focusEl.focus();
|
|
4106
|
-
}
|
|
4341
|
+
setShrink(true);
|
|
4342
|
+
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
4343
|
+
focusInput(e.currentTarget);
|
|
4107
4344
|
}, [shrink]);
|
|
4108
4345
|
useEffect(() => {
|
|
4109
4346
|
setShrink(shrinkProps);
|
|
@@ -4130,7 +4367,7 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4130
4367
|
return (React__default.createElement(React__default.Fragment, null, listBlockAdded.map((b, index) => {
|
|
4131
4368
|
var _a;
|
|
4132
4369
|
const { name = '', data = {}, id } = b || {};
|
|
4133
|
-
const { placeholder, value, align, listQuestion, isSendMailChimp = false, newtab, url, } = data;
|
|
4370
|
+
const { placeholder: label, value, align, listQuestion, isSendMailChimp = false, newtab, url, } = data;
|
|
4134
4371
|
const required = (_a = data.required) !== null && _a !== void 0 ? _a : true;
|
|
4135
4372
|
const formValue = (formValues === null || formValues === void 0 ? void 0 : formValues[value]) || null;
|
|
4136
4373
|
switch (name) {
|
|
@@ -4140,23 +4377,23 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4140
4377
|
return (React__default.createElement(SubtitleBlock, { key: index, align: align }, value));
|
|
4141
4378
|
case 'TextBlock':
|
|
4142
4379
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4143
|
-
React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false, type: "text", placeholder:
|
|
4380
|
+
React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false, type: "text", placeholder: " ",
|
|
4144
4381
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4145
4382
|
// onChangeRaw={(e) => inputOnChange('text', e)}
|
|
4146
|
-
label:
|
|
4383
|
+
label: label, "data-control": "text", "data-lead-control": 'TextBlock', inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value), { name: value }))));
|
|
4147
4384
|
case 'NumberBlock':
|
|
4148
4385
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4149
|
-
React__default.createElement(NumberInput$1, Object.assign({ withAsterisk: required, spellCheck: false, type: "number", placeholder:
|
|
4386
|
+
React__default.createElement(NumberInput$1, Object.assign({ withAsterisk: required, spellCheck: false, type: "number", placeholder: " ",
|
|
4150
4387
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4151
4388
|
// onChange={(e) => inputOnChange('number', e)}
|
|
4152
|
-
label:
|
|
4389
|
+
label: label, "data-control": "number", "data-lead-control": name, name: value, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
|
|
4153
4390
|
case 'EmailBlock':
|
|
4154
4391
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4155
4392
|
React__default.createElement(TextInput, Object.assign({ withAsterisk: required, spellCheck: false,
|
|
4156
4393
|
// type="email"
|
|
4157
|
-
placeholder:
|
|
4394
|
+
placeholder: " ",
|
|
4158
4395
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4159
|
-
label:
|
|
4396
|
+
label: label, "data-control": "email", "data-lead-control": name, name: value, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
|
|
4160
4397
|
case 'PhoneOtpBlock':
|
|
4161
4398
|
case 'WhatsappOtpBlock':
|
|
4162
4399
|
case 'ZaloOtpBlock':
|
|
@@ -4166,20 +4403,20 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4166
4403
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: clsx('lead-modal__form-control leadgen-form_field', {
|
|
4167
4404
|
'leadgen-form_field_error': !!error,
|
|
4168
4405
|
}) },
|
|
4169
|
-
React__default.createElement(Input$1.Wrapper, { size: "md", withAsterisk: required, label:
|
|
4406
|
+
React__default.createElement(Input$1.Wrapper, { size: "md", withAsterisk: required, label: label, "data-invalid": !!error, labelProps: { htmlFor: htmlForId }, inputWrapperOrder: ['label', 'input', 'description', 'error'], error: error },
|
|
4170
4407
|
React__default.createElement("div", { className: "mantine-Input-wrapper" },
|
|
4171
|
-
React__default.createElement(Phone, Object.assign({ className: "mantine-Input-input", name: value, spellCheck: false, type: "tel", placeholder:
|
|
4408
|
+
React__default.createElement(Phone, Object.assign({ className: "mantine-Input-input", name: value, spellCheck: false, type: "tel", placeholder: " ",
|
|
4172
4409
|
// onBlur={(e) => inputOnBlur('tel', e)}
|
|
4173
|
-
id: htmlForId, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel" }, formPhoneInputWrapper))))));
|
|
4410
|
+
id: htmlForId, defaultCountry: (locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name }, formPhoneInputWrapper))))));
|
|
4174
4411
|
}
|
|
4175
4412
|
case 'LocationBlock': {
|
|
4176
4413
|
return (React__default.createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4177
|
-
React__default.createElement(GoogleLocationBlock, Object.assign({ withAsterisk: required, name: value, placeholder:
|
|
4414
|
+
React__default.createElement(GoogleLocationBlock, Object.assign({ withAsterisk: required, name: value, placeholder: " ", label: label, "data-control": "text", "data-lead-control": name, locale: locale, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
|
|
4178
4415
|
}
|
|
4179
4416
|
case 'DateBlock': {
|
|
4180
4417
|
const _c = form.getInputProps(value), { error } = _c, formInputProps = __rest(_c, ["error"]);
|
|
4181
|
-
return (React__default.createElement(Input$1.Wrapper, { key: index, size: "md", withAsterisk: required, label:
|
|
4182
|
-
React__default.createElement(InputDate, Object.assign({ name: value, error: Boolean(error), locale: locale, "data-extra": true, "data-name": value, "data-control": "date", className: "leadgen-form_field_date", labelTuples: labelTuples }, formInputProps))));
|
|
4418
|
+
return (React__default.createElement(Input$1.Wrapper, { key: index, size: "md", withAsterisk: required, label: label, "data-invalid": !!error, inputWrapperOrder: ['label', 'input', 'description', 'error'], error: error, className: "lead-modal__form-control leadgen-form_field" },
|
|
4419
|
+
React__default.createElement(InputDate, Object.assign({ name: value, error: Boolean(error), locale: locale, "data-extra": true, "data-name": value, "data-control": "date", "data-lead-control": name, className: "leadgen-form_field_date", labelTuples: labelTuples }, formInputProps))));
|
|
4183
4420
|
}
|
|
4184
4421
|
case 'LinkButtonBlock':
|
|
4185
4422
|
return (React__default.createElement("div", { key: index },
|
|
@@ -4195,38 +4432,59 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4195
4432
|
}, "data-name": value + '-mailchimp' })),
|
|
4196
4433
|
React__default.createElement(Checkbox.Group, Object.assign({ withAsterisk: required,
|
|
4197
4434
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4198
|
-
label:
|
|
4435
|
+
label: label, size: "md", sx: {
|
|
4199
4436
|
display: 'flex',
|
|
4200
4437
|
flexDirection: 'column',
|
|
4201
4438
|
flexWrap: 'wrap',
|
|
4202
4439
|
gap: 8,
|
|
4203
4440
|
}, inputWrapperOrder: ['label', 'input', 'description', 'error'], inputContainer: (children) => {
|
|
4204
4441
|
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
4205
|
-
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
|
|
4442
|
+
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox", "data-lead-control": name }))))));
|
|
4206
4443
|
case 'RadioBlock':
|
|
4207
4444
|
return (React__default.createElement(ChoiceField, { className: "leadgen-form_radio", key: index },
|
|
4208
4445
|
isSendMailChimp && (React__default.createElement(Input$1, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
|
|
4209
4446
|
React__default.createElement(Radio.Group, Object.assign({ withAsterisk: required,
|
|
4210
4447
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4211
|
-
label:
|
|
4448
|
+
label: label, size: "md", inputWrapperOrder: ['label', 'input', 'description', 'error'], inputContainer: (children) => {
|
|
4212
4449
|
return (React__default.createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
4213
|
-
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
4450
|
+
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default.createElement(Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio", "data-lead-control": name }))))));
|
|
4214
4451
|
case 'DropdownBlock':
|
|
4215
|
-
return (React__default.createElement(TextField, { shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field", key: index },
|
|
4216
|
-
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
4452
|
+
return (React__default.createElement(TextField, { shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field DropdownBlock", key: index },
|
|
4453
|
+
React__default.createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown', "data-lead-control": name }),
|
|
4217
4454
|
React__default.createElement(Select
|
|
4218
4455
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4219
4456
|
, Object.assign({
|
|
4220
4457
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4221
|
-
label:
|
|
4458
|
+
label: label, placeholder: " ", searchable: true, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
|
|
4222
4459
|
value: l.value,
|
|
4223
4460
|
label: l.placeholder,
|
|
4224
|
-
}))
|
|
4461
|
+
})), nothingFound: React__default.createElement(NoData, null), styles: {
|
|
4462
|
+
item: {
|
|
4463
|
+
paddingBlock: 12,
|
|
4464
|
+
paddingInline: 10,
|
|
4465
|
+
fontSize: 16,
|
|
4466
|
+
lineHeight: 1.5,
|
|
4467
|
+
},
|
|
4468
|
+
nothingFound: {
|
|
4469
|
+
fontSize: 54,
|
|
4470
|
+
paddingBlock: 30,
|
|
4471
|
+
},
|
|
4472
|
+
itemsWrapper: {
|
|
4473
|
+
padding: 6,
|
|
4474
|
+
},
|
|
4475
|
+
dropdown: {
|
|
4476
|
+
'.mantine-ScrollArea-scrollbar[data-orientation="vertical"]': {
|
|
4477
|
+
'--radix-scroll-area-thumb-width': '6px',
|
|
4478
|
+
width: 'var(--radix-scroll-area-thumb-width)',
|
|
4479
|
+
paddingInline: 0,
|
|
4480
|
+
},
|
|
4481
|
+
},
|
|
4482
|
+
}, maxDropdownHeight: 192 }, form.getInputProps(value)))));
|
|
4225
4483
|
case 'TncBlock':
|
|
4226
4484
|
const _d = form.getInputProps(`TNC-${id}`), { error } = _d, tncInputProps = __rest(_d, ["error"]);
|
|
4227
4485
|
return (React__default.createElement(ChoiceField, { className: "leadgen-form_checkbox", key: id },
|
|
4228
4486
|
React__default.createElement(Input$1.Wrapper, { error: error },
|
|
4229
|
-
React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, tncInputProps)))));
|
|
4487
|
+
React__default.createElement(Checkbox, Object.assign({ name: 'TNC-' + id, label: React__default.createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox", "data-lead-control": name }, tncInputProps)))));
|
|
4230
4488
|
}
|
|
4231
4489
|
return null;
|
|
4232
4490
|
})));
|
|
@@ -4474,7 +4732,9 @@ const LEADGEN_SHOW_HEADER = [
|
|
|
4474
4732
|
LEADGEN_LAYOUT.Sidebar,
|
|
4475
4733
|
LEADGEN_LAYOUT.Slider,
|
|
4476
4734
|
];
|
|
4477
|
-
const
|
|
4735
|
+
// const CAMPAGE_CODE_LIST_APPLY_NEW_UI = ['ri3lkoxcetjoj39', 'u0adw7hw8kw7t89']
|
|
4736
|
+
const CAMPAGE_CODE_LIST_APPLY_NEW_UI = ['ri3lkoxcetjoj39'];
|
|
4737
|
+
const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSubmit, imageMobile, imageDesktop, imageOverlayMobile, imageOverlayDesktop, imageBackground, currentLayout, title, onSubmit, onUnmount, showThankyou, campaignId, campaignCode, campaign_subot_id, locale, showEmpty, setShowEmpty, userInfo, }) => {
|
|
4478
4738
|
var _a, _b;
|
|
4479
4739
|
const { primaryColor } = useContext(LeadGenContext$1);
|
|
4480
4740
|
const { isMobile } = useScreenSize();
|
|
@@ -4482,17 +4742,25 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4482
4742
|
const [showOtpPhone, setShowOtpPhone] = useState(null);
|
|
4483
4743
|
const [isSubmitLoading, setIsSubmitLoading] = useState(false);
|
|
4484
4744
|
const [snap, setSnap] = useState(0.8);
|
|
4745
|
+
const isTrackedForm = useRef(false);
|
|
4485
4746
|
const formRef = useRef();
|
|
4747
|
+
const [lastFormRef, setLastFormRef] = useState();
|
|
4486
4748
|
const onClose = () => {
|
|
4487
4749
|
if (showOtpPhone) {
|
|
4488
4750
|
setShowOtpPhone(null);
|
|
4489
4751
|
}
|
|
4490
4752
|
else {
|
|
4491
|
-
onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp(
|
|
4753
|
+
onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp({
|
|
4754
|
+
formValues: form.values,
|
|
4755
|
+
formActiveTime: formActiveTime.current,
|
|
4756
|
+
formRef: formRef.current,
|
|
4757
|
+
listBlockAdded,
|
|
4758
|
+
});
|
|
4492
4759
|
}
|
|
4493
4760
|
};
|
|
4494
4761
|
const { height } = useViewportDimensions();
|
|
4495
4762
|
usePreventScroll();
|
|
4763
|
+
const formActiveTime = useRef(0);
|
|
4496
4764
|
const textBlocks = JSON.parse(extraFields.textBlocks);
|
|
4497
4765
|
const listBlockAdded = JSON.parse(extraFields.listBlockAdded);
|
|
4498
4766
|
const actionBlocks = JSON.parse(extraFields.actionBlocks);
|
|
@@ -4509,6 +4777,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4509
4777
|
const isFullscreen = currentLayout === LEADGEN_LAYOUT.Fullscreen;
|
|
4510
4778
|
const isInPage = isInline || isSidebar;
|
|
4511
4779
|
const isDrawer = isLightBoxB && isMobile;
|
|
4780
|
+
const isNewUI = useMemo(() => CAMPAGE_CODE_LIST_APPLY_NEW_UI.includes(campaignCode), [campaignCode]);
|
|
4512
4781
|
const limitFieldsLightBoxB = isLightBoxB && listBlockAdded.length <= LEADGEN_LIMIT_LIGHTBOXB;
|
|
4513
4782
|
const hasForm = isLightBoxA
|
|
4514
4783
|
? listBlockAdded.some((item) => LEADGEN_BLOCK_INPUT.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
|
|
@@ -4517,6 +4786,17 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4517
4786
|
const showHeader = !!imageMobile || !!imageDesktop;
|
|
4518
4787
|
const onlyHeader = !title && !description;
|
|
4519
4788
|
const showButtonClose = !isInline;
|
|
4789
|
+
const validatingPhoneRef = useRef(false);
|
|
4790
|
+
const validatingEmailRef = useRef(false);
|
|
4791
|
+
const { form, validateObj } = useLeadFormConfig({
|
|
4792
|
+
listBlockAdded,
|
|
4793
|
+
validatingPhoneRef,
|
|
4794
|
+
validatingEmailRef,
|
|
4795
|
+
campaignId,
|
|
4796
|
+
campaign_subot_id,
|
|
4797
|
+
userInfo,
|
|
4798
|
+
format: (_a = (ISO_FORMAT[locale] || ISO_FORMAT['vi-VN'])) === null || _a === void 0 ? void 0 : _a.dateFormat,
|
|
4799
|
+
});
|
|
4520
4800
|
if (window.innerWidth < 769 &&
|
|
4521
4801
|
LEADGEN_LAYOUT_NOT_SHOW_IN_MOBILE.includes(currentLayout)) {
|
|
4522
4802
|
console.log('😎 Not show fullscreen, slider on mobile ');
|
|
@@ -4531,17 +4811,33 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4531
4811
|
}
|
|
4532
4812
|
clearCacheUsedEmailOrPhone();
|
|
4533
4813
|
}, []);
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4814
|
+
useEffect(() => {
|
|
4815
|
+
formRef.current && setLastFormRef(formRef.current);
|
|
4816
|
+
}, [formRef.current]);
|
|
4817
|
+
useEffect(() => {
|
|
4818
|
+
const handleBeforeUnload = () => {
|
|
4819
|
+
!isTrackedForm.current &&
|
|
4820
|
+
!showThankyou &&
|
|
4821
|
+
(onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount({
|
|
4822
|
+
formValues: form.values,
|
|
4823
|
+
formActiveTime: formActiveTime.current,
|
|
4824
|
+
formRef: lastFormRef,
|
|
4825
|
+
listBlockAdded,
|
|
4826
|
+
}));
|
|
4827
|
+
};
|
|
4828
|
+
window.addEventListener('beforeunload', handleBeforeUnload);
|
|
4829
|
+
return () => window.removeEventListener('beforeunload', handleBeforeUnload);
|
|
4830
|
+
}, [lastFormRef, form.values, showThankyou]);
|
|
4831
|
+
useEffect(() => {
|
|
4832
|
+
let intervalId = null;
|
|
4833
|
+
if (isLightBox && !showThankyou) {
|
|
4834
|
+
intervalId = setInterval(() => {
|
|
4835
|
+
formActiveTime.current += 1;
|
|
4836
|
+
// console.log({ formActiveTime: formActiveTime.current })
|
|
4837
|
+
}, 1000);
|
|
4838
|
+
}
|
|
4839
|
+
return () => clearInterval(intervalId);
|
|
4840
|
+
}, [showThankyou]);
|
|
4545
4841
|
const listBlockAddedRequired = useMemo(() => leadGenFieldRequired(listBlockAdded), listBlockAdded);
|
|
4546
4842
|
const disabledButtonSubmit = useMemo(() => {
|
|
4547
4843
|
if (listBlockAddedRequired.length) {
|
|
@@ -4551,10 +4847,46 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4551
4847
|
}, [...listBlockAddedRequired.map((k) => form.values[k])]);
|
|
4552
4848
|
const onFocus = (e) => {
|
|
4553
4849
|
e.preventDefault();
|
|
4554
|
-
|
|
4555
|
-
const
|
|
4556
|
-
|
|
4557
|
-
|
|
4850
|
+
function scrollIntoView() {
|
|
4851
|
+
const $Input = e.target;
|
|
4852
|
+
const $TextField = $Input.closest('.leadgen-form_field');
|
|
4853
|
+
const scrollIntoView = {
|
|
4854
|
+
block: 'center',
|
|
4855
|
+
behavior: 'auto',
|
|
4856
|
+
};
|
|
4857
|
+
if ($TextField.classList.contains('DropdownBlock')) {
|
|
4858
|
+
scrollIntoView.block = 'start';
|
|
4859
|
+
const tfOffsetTop = ($TextField === null || $TextField === void 0 ? void 0 : $TextField.offsetTop) || 0;
|
|
4860
|
+
const tfHeight = $TextField.clientHeight;
|
|
4861
|
+
const $ScrollableElement = getParentScroll($TextField);
|
|
4862
|
+
if ($ScrollableElement) {
|
|
4863
|
+
// https://hhgdev.atlassian.net/browse/EL-682
|
|
4864
|
+
const scrollHeight = $ScrollableElement.scrollHeight;
|
|
4865
|
+
if (scrollHeight - (tfOffsetTop + tfHeight) < 192) {
|
|
4866
|
+
scrollIntoView.block = 'end';
|
|
4867
|
+
}
|
|
4868
|
+
}
|
|
4869
|
+
}
|
|
4870
|
+
if (isMobile) {
|
|
4871
|
+
window.scrollTo(0, 0);
|
|
4872
|
+
}
|
|
4873
|
+
$TextField.scrollIntoView(scrollIntoView);
|
|
4874
|
+
}
|
|
4875
|
+
let time = 0;
|
|
4876
|
+
function requestFrame(timestamp) {
|
|
4877
|
+
if (time === 0) {
|
|
4878
|
+
time = timestamp;
|
|
4879
|
+
}
|
|
4880
|
+
if (timestamp - time <= 250) {
|
|
4881
|
+
requestAnimationFrame(requestFrame);
|
|
4882
|
+
}
|
|
4883
|
+
else {
|
|
4884
|
+
scrollIntoView();
|
|
4885
|
+
}
|
|
4886
|
+
}
|
|
4887
|
+
if (isMobile) {
|
|
4888
|
+
requestAnimationFrame(requestFrame);
|
|
4889
|
+
}
|
|
4558
4890
|
};
|
|
4559
4891
|
const middlewareOnSubmit = (e) => {
|
|
4560
4892
|
e.preventDefault();
|
|
@@ -4611,7 +4943,12 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4611
4943
|
var _a;
|
|
4612
4944
|
const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
|
|
4613
4945
|
if (respMessage === 'This phone number was verified') {
|
|
4614
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
4946
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
4947
|
+
formValues: v,
|
|
4948
|
+
formActiveTime: formActiveTime.current,
|
|
4949
|
+
formRef: formRef.current,
|
|
4950
|
+
listBlockAdded,
|
|
4951
|
+
});
|
|
4615
4952
|
return;
|
|
4616
4953
|
}
|
|
4617
4954
|
setShowOtpPhone(newShowOtpPhone);
|
|
@@ -4621,7 +4958,12 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4621
4958
|
});
|
|
4622
4959
|
return;
|
|
4623
4960
|
}
|
|
4624
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
4961
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
4962
|
+
formValues: v,
|
|
4963
|
+
formActiveTime: formActiveTime.current,
|
|
4964
|
+
formRef: formRef.current,
|
|
4965
|
+
listBlockAdded,
|
|
4966
|
+
});
|
|
4625
4967
|
})(e);
|
|
4626
4968
|
}, 100);
|
|
4627
4969
|
};
|
|
@@ -4667,7 +5009,12 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4667
5009
|
React__default.createElement(LightboxFields, { listBlockAdded: listBlockAdded, popupId: popupId, locale: locale, onClose: onClose, onOtherSubmit: onOtherSubmit }))))));
|
|
4668
5010
|
const PopupOtp = showOtpPhone && (React__default.createElement(OtpBlock, { otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
|
|
4669
5011
|
setShowOtpPhone(null);
|
|
4670
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
5012
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
5013
|
+
formValues: form.values,
|
|
5014
|
+
formActiveTime: formActiveTime.current,
|
|
5015
|
+
formRef: formRef.current,
|
|
5016
|
+
listBlockAdded,
|
|
5017
|
+
});
|
|
4671
5018
|
} }));
|
|
4672
5019
|
const PopupThankYou = showThankyou && (React__default.createElement(ThankyouPopup, { title: showThankyou.title, titleAlign: showThankyou.titleAlign, subtitle: showThankyou.subtitle, subtitleAlign: showThankyou.subtitleAlign, link: showThankyou.link, linkNewTab: showThankyou.linkNewTab, linkText: showThankyou.linkText, image: showThankyou.image }));
|
|
4673
5020
|
const PopupContent = (React__default.createElement("div", { className: clsx('leadgen-content', {
|
|
@@ -4702,18 +5049,13 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4702
5049
|
'leadgen-inline': isInPage,
|
|
4703
5050
|
'leadgen-slider': isSlider,
|
|
4704
5051
|
});
|
|
4705
|
-
const PopupContainer = isDrawer ? (
|
|
4706
|
-
// <LeadGenLightBoxB
|
|
4707
|
-
// form={form}
|
|
4708
|
-
// loading={isSubmitLoading}
|
|
4709
|
-
// visible={open}
|
|
4710
|
-
// onVisible={() => onOpenChange(false)}
|
|
4711
|
-
// >
|
|
4712
|
-
// {PopupWrapper}
|
|
4713
|
-
// </LeadGenLightBoxB>
|
|
4714
|
-
React__default.createElement(DrawerComponent, { fadeFromIndex: ZINDEX_SSO - 9e6, open: open, snapPoints: [0.8, 1], activeSnapPoint: snap, setActiveSnapPoint: setSnap, onOpenChange: onOpenChange, overlayClassName: popupContainerClassName, className: "leadgen-drawer" },
|
|
5052
|
+
const PopupContainer = isDrawer ? (isNewUI ? (React__default.createElement(LeadGenLightBoxB, { form: form, loading: isSubmitLoading, visible: open, onVisible: () => onOpenChange(false) }, PopupWrapper)) : (React__default.createElement(DrawerComponent, { fadeFromIndex: ZINDEX_SSO - 9e6, open: open, snapPoints: [0.8, 1], activeSnapPoint: snap, setActiveSnapPoint: setSnap, onOpenChange: onOpenChange, overlayClassName: popupContainerClassName, className: "leadgen-drawer" },
|
|
4715
5053
|
PopupWrapper,
|
|
4716
|
-
React__default.createElement("div", { style: {
|
|
5054
|
+
React__default.createElement("div", { style: {
|
|
5055
|
+
position: 'absolute',
|
|
5056
|
+
inset: 0,
|
|
5057
|
+
zIndex: snap === 1 ? -1 : 1,
|
|
5058
|
+
}, onClick: () => setSnap(1) })))) : (React__default.createElement("div", { id: popupId, "data-popup-url": currentPath, "data-popup-type": "lightbox-inline", className: popupContainerClassName, style: isMobile ? { maxHeight: height } : undefined },
|
|
4717
5059
|
isFullscreen ? (React__default.createElement("img", { className: "le-only-desktop le-fullscreen-img", draggable: false, src: imageBackground || '', style: {
|
|
4718
5060
|
aspectRatio: `${imageBackgroundWidth}/${imageBackgroundHeight}`,
|
|
4719
5061
|
} })) : null,
|
|
@@ -4820,7 +5162,7 @@ function getCategoryLevel(t = 'Xin chao {{category_2}} extra') {
|
|
|
4820
5162
|
return null;
|
|
4821
5163
|
}
|
|
4822
5164
|
}
|
|
4823
|
-
const NewLeadPopup = ({ campaign, action, onSubmit, onClose, showThankyou, locale, showEmpty, setShowEmpty, userInfo, }) => {
|
|
5165
|
+
const NewLeadPopup = ({ campaign, action, onSubmit, onClose, onUnmount, showThankyou, locale, showEmpty, setShowEmpty, userInfo, }) => {
|
|
4824
5166
|
var _a, _b;
|
|
4825
5167
|
const { apiUrl, siteDomain } = useContext(LeadGenContext$1);
|
|
4826
5168
|
useEffect(() => {
|
|
@@ -4939,7 +5281,7 @@ const NewLeadPopup = ({ campaign, action, onSubmit, onClose, showThankyou, local
|
|
|
4939
5281
|
currentLayout == 'Fullscreen' ||
|
|
4940
5282
|
currentLayout == 'Sidebar' ||
|
|
4941
5283
|
currentLayout == 'Slider') {
|
|
4942
|
-
return (React__default.createElement(LightboxLayout, { popupId: popupIdRef.current, extraFields: extra_fields, onClose: onClose, onOtherSubmit: onOtherSubmit, imageMobile: image, imageDesktop: image_desktop, imageBackground: image_background, currentLayout: currentLayout, title: titleText, onSubmit: (
|
|
5284
|
+
return (React__default.createElement(LightboxLayout, { popupId: popupIdRef.current, extraFields: extra_fields, onClose: onClose, onOtherSubmit: onOtherSubmit, onUnmount: onUnmount, imageMobile: image, imageDesktop: image_desktop, imageBackground: image_background, currentLayout: currentLayout, title: titleText, onSubmit: (params) => onSubmit(params, categoryLevel, categoryData), key: currentLayout, imageOverlayDesktop: image_overlay_desktop, imageOverlayMobile: image_overlay_mobile, showThankyou: showThankyou, campaignId: campaign.id, campaignCode: campaign.code, campaign_subot_id: campaign.bot_id || [], locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo }));
|
|
4943
5285
|
}
|
|
4944
5286
|
else if (currentLayout.includes('Skin')) {
|
|
4945
5287
|
return (React__default.createElement(SkinLayout, { popupId: popupIdRef.current, link: actionBlocks.linkButtonBlock.data.url, linkNewTab: !!actionBlocks.linkButtonBlock.data.newtab, linkText: actionBlocks.linkButtonBlock.data.value, onClose: onClose, onOtherSubmit: onOtherSubmit, imageMobile: image, imageDesktop: image_desktop, currentLayout: currentLayout }));
|
|
@@ -4947,9 +5289,74 @@ const NewLeadPopup = ({ campaign, action, onSubmit, onClose, showThankyou, local
|
|
|
4947
5289
|
return null;
|
|
4948
5290
|
};
|
|
4949
5291
|
|
|
5292
|
+
const numberFormatType = 2; // i18n.phonenumbers.PhoneNumberFormat.NATIONAL
|
|
5293
|
+
const formatFormData = (currentForm, formData) => {
|
|
5294
|
+
return Object.keys(formData)
|
|
5295
|
+
.filter((key) => !!formData[key])
|
|
5296
|
+
.map((name) => {
|
|
5297
|
+
var _a, _b, _c, _d;
|
|
5298
|
+
const value = String(formData[name]);
|
|
5299
|
+
const control = ((_a = currentForm
|
|
5300
|
+
.querySelector(`*[name="${name}"][data-control]`)) === null || _a === void 0 ? void 0 : _a.getAttribute('data-control')) ||
|
|
5301
|
+
((_b = currentForm
|
|
5302
|
+
.querySelector(`*[data-extra][data-name="${name}"]`)) === null || _b === void 0 ? void 0 : _b.getAttribute('data-control')) ||
|
|
5303
|
+
'text';
|
|
5304
|
+
const leadControl = ((_c = currentForm
|
|
5305
|
+
.querySelector(`*[name="${name}"][data-lead-control]`)) === null || _c === void 0 ? void 0 : _c.getAttribute('data-lead-control')) ||
|
|
5306
|
+
((_d = currentForm
|
|
5307
|
+
.querySelector(`*[data-extra][data-name="${name}"]`)) === null || _d === void 0 ? void 0 : _d.getAttribute('data-lead-control')) ||
|
|
5308
|
+
'text';
|
|
5309
|
+
const formatedValue = control === 'tel'
|
|
5310
|
+
? window.intlTelInputUtils
|
|
5311
|
+
.formatNumber(String(value), LEAD_LOCALE === null || LEAD_LOCALE === void 0 ? void 0 : LEAD_LOCALE.countryCodeNumber, numberFormatType)
|
|
5312
|
+
.replace(/\s+/g, '')
|
|
5313
|
+
: control === 'date'
|
|
5314
|
+
? dayjs(value).format('YYYY-MM-DD')
|
|
5315
|
+
: value;
|
|
5316
|
+
return {
|
|
5317
|
+
key: name,
|
|
5318
|
+
value: formatedValue,
|
|
5319
|
+
control,
|
|
5320
|
+
leadControl,
|
|
5321
|
+
// is_sent_mailchimp: currentForm.querySelector(
|
|
5322
|
+
// `div[data-name="${i.name}-mailchimp"]`,
|
|
5323
|
+
// )
|
|
5324
|
+
// ? 'true'
|
|
5325
|
+
// : 'false',
|
|
5326
|
+
};
|
|
5327
|
+
});
|
|
5328
|
+
};
|
|
5329
|
+
|
|
5330
|
+
const formatTrackingData = (params) => {
|
|
5331
|
+
const { formParams = {}, currentLayout, commonData } = params;
|
|
5332
|
+
const { formValues, formActiveTime, listBlockAdded } = formParams;
|
|
5333
|
+
const listFieldHasValue = [];
|
|
5334
|
+
const data = Object.assign(Object.assign({ template_type: currentLayout, time_on_form: [LEADGEN_LAYOUT.LightBoxA, LEADGEN_LAYOUT.LightBoxB].includes(currentLayout)
|
|
5335
|
+
? formActiveTime
|
|
5336
|
+
: 0 }, commonData), { data_input: formValues.map((control) => {
|
|
5337
|
+
listFieldHasValue.push(control.leadControl);
|
|
5338
|
+
return {
|
|
5339
|
+
field_name: control.key,
|
|
5340
|
+
component_type: control.leadControl,
|
|
5341
|
+
value: control.value,
|
|
5342
|
+
};
|
|
5343
|
+
}), data_not_input: listBlockAdded
|
|
5344
|
+
.map((item) => {
|
|
5345
|
+
const leadControlName = item.name;
|
|
5346
|
+
if (!listFieldHasValue.includes(leadControlName)) {
|
|
5347
|
+
return {
|
|
5348
|
+
field_name: item.data.value,
|
|
5349
|
+
component_type: leadControlName,
|
|
5350
|
+
};
|
|
5351
|
+
}
|
|
5352
|
+
})
|
|
5353
|
+
.filter(Boolean) });
|
|
5354
|
+
return data;
|
|
5355
|
+
};
|
|
5356
|
+
|
|
4950
5357
|
// mount css
|
|
4951
5358
|
const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor, apiSubotUrl, DEBUG_URL, forceCampaign, children, extraPayloadValues = [], excludeExitRulesHandler, userInfo, onClose: onCloseProps, onSubmit: onSubmitProps, }) => {
|
|
4952
|
-
var _a;
|
|
5359
|
+
var _a, _b;
|
|
4953
5360
|
const scrollEventHandlerRef = useRef();
|
|
4954
5361
|
const leadStartTimeRef = useRef(Date.now());
|
|
4955
5362
|
const { apiUrl } = useMemo(() => {
|
|
@@ -4965,6 +5372,7 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
4965
5372
|
const [action, setAction] = useState('');
|
|
4966
5373
|
const [showThankyou, setShowThankyou] = useState(null);
|
|
4967
5374
|
const [showEmpty, setShowEmpty] = useState(false);
|
|
5375
|
+
const currentLayout = useMemo(() => showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.currentLayout, [showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.currentLayout]);
|
|
4968
5376
|
useEffect(() => {
|
|
4969
5377
|
if (forceCampaign) {
|
|
4970
5378
|
setShowCampaign(forceCampaign);
|
|
@@ -4987,14 +5395,15 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
4987
5395
|
setAction('HIDE');
|
|
4988
5396
|
onCloseProps === null || onCloseProps === void 0 ? void 0 : onCloseProps();
|
|
4989
5397
|
};
|
|
4990
|
-
const onClose = () => {
|
|
4991
|
-
var
|
|
5398
|
+
const onClose = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5399
|
+
var _c, _d;
|
|
5400
|
+
const { formRef, listBlockAdded, formValues: formDataObj } = params;
|
|
4992
5401
|
if (!showCampaign)
|
|
4993
5402
|
return;
|
|
4994
5403
|
LeadLog(`👋👋👋 CLOSE POPUP ${showCampaign.code} 👋👋👋`);
|
|
4995
5404
|
if (!excludeExitRulesHandler) {
|
|
4996
|
-
const showAfterExit = Number((
|
|
4997
|
-
const expiresDay = Number((
|
|
5405
|
+
const showAfterExit = Number((_c = showCampaign.rules.find((rule) => rule.rule == 'show_again_after_exit')) === null || _c === void 0 ? void 0 : _c.value);
|
|
5406
|
+
const expiresDay = Number((_d = showCampaign.rules.find((rule) => rule.rule == 'days_to_show_again')) === null || _d === void 0 ? void 0 : _d.value);
|
|
4998
5407
|
if (showAfterExit == 0) {
|
|
4999
5408
|
if (!expiresDay) {
|
|
5000
5409
|
setCookie(`lead_closed_${showCampaign.code}`, `target_${showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.popupVersion}`, { domain: '.' + siteDomain, path: '/' });
|
|
@@ -5004,21 +5413,56 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5004
5413
|
}
|
|
5005
5414
|
}
|
|
5006
5415
|
}
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5416
|
+
yield Promise.all([
|
|
5417
|
+
fetch(`${apiUrl}api/campaign/${showCampaign.code}/popup_exit`, {
|
|
5418
|
+
method: 'POST',
|
|
5419
|
+
headers: {
|
|
5420
|
+
'Content-Type': 'application/json',
|
|
5421
|
+
},
|
|
5422
|
+
body: JSON.stringify({
|
|
5423
|
+
action: 'CLICK',
|
|
5424
|
+
url: location.href.toLowerCase(),
|
|
5425
|
+
title_article: document.title,
|
|
5426
|
+
cookie_id: getCookie('hhg-id'),
|
|
5427
|
+
duration: Math.ceil((Date.now() - leadStartTimeRef.current) / 1000),
|
|
5428
|
+
}),
|
|
5018
5429
|
}),
|
|
5019
|
-
|
|
5430
|
+
!showThankyou &&
|
|
5431
|
+
trackingCompletionForm({
|
|
5432
|
+
commonData: {
|
|
5433
|
+
cookie_id: getCookie('hhg-id'),
|
|
5434
|
+
ga_client_id: getCookie('_ga') || null,
|
|
5435
|
+
country_code: locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN',
|
|
5436
|
+
status: 'in_progress',
|
|
5437
|
+
campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id,
|
|
5438
|
+
total_fields: listBlockAdded.length,
|
|
5439
|
+
},
|
|
5440
|
+
currentLayout,
|
|
5441
|
+
formParams: Object.assign(Object.assign({}, params), { formValues: formatFormData(formRef, formDataObj) }),
|
|
5442
|
+
}),
|
|
5443
|
+
]);
|
|
5020
5444
|
onCloseBase();
|
|
5021
|
-
};
|
|
5445
|
+
});
|
|
5446
|
+
const onUnmount = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5447
|
+
const { formRef, listBlockAdded, formValues: formDataObj } = params;
|
|
5448
|
+
if ([LEADGEN_LAYOUT.InlineA, LEADGEN_LAYOUT.InlineB].includes(currentLayout) &&
|
|
5449
|
+
Object.keys(formDataObj).length === 0)
|
|
5450
|
+
return;
|
|
5451
|
+
const data = formatTrackingData({
|
|
5452
|
+
commonData: {
|
|
5453
|
+
cookie_id: getCookie('hhg-id'),
|
|
5454
|
+
ga_client_id: getCookie('_ga') || null,
|
|
5455
|
+
country_code: locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN',
|
|
5456
|
+
status: 'in_progress',
|
|
5457
|
+
campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id,
|
|
5458
|
+
total_fields: listBlockAdded.length,
|
|
5459
|
+
},
|
|
5460
|
+
currentLayout,
|
|
5461
|
+
formParams: Object.assign(Object.assign({}, params), { formValues: formatFormData(formRef, formDataObj) }),
|
|
5462
|
+
});
|
|
5463
|
+
const blob = new Blob([JSON.stringify(data)], { type: 'application/json' });
|
|
5464
|
+
navigator.sendBeacon(`${apiUrl}api/collection/tracking-completion`, blob);
|
|
5465
|
+
});
|
|
5022
5466
|
useEffect(() => {
|
|
5023
5467
|
if (forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.code)
|
|
5024
5468
|
return;
|
|
@@ -5057,69 +5501,55 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5057
5501
|
DEBUG_URL,
|
|
5058
5502
|
});
|
|
5059
5503
|
}, []);
|
|
5060
|
-
const
|
|
5061
|
-
|
|
5504
|
+
const trackingCompletionForm = useCallback((params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5505
|
+
const { currentLayout, formParams } = params;
|
|
5506
|
+
const { formValues } = formParams;
|
|
5507
|
+
if ([LEADGEN_LAYOUT.InlineA, LEADGEN_LAYOUT.InlineB].includes(currentLayout) &&
|
|
5508
|
+
Object.keys(formValues).length === 0)
|
|
5509
|
+
return;
|
|
5510
|
+
const data = formatTrackingData(params);
|
|
5511
|
+
return fetch(`${apiUrl}api/collection/tracking-completion`, {
|
|
5512
|
+
method: 'POST',
|
|
5513
|
+
headers: {
|
|
5514
|
+
'Content-Type': 'application/json',
|
|
5515
|
+
},
|
|
5516
|
+
body: JSON.stringify(data),
|
|
5517
|
+
});
|
|
5518
|
+
}), [(_a = showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields) === null || _a === void 0 ? void 0 : _a.currentLayout]);
|
|
5519
|
+
const onSubmit = (params, categoryLevel, categoryData) => __awaiter(void 0, void 0, void 0, function* () {
|
|
5520
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
5521
|
+
const { formRef, listBlockAdded, formValues: formDataObj } = params;
|
|
5062
5522
|
if (!formDataObj || Object.values(formDataObj).every((v) => !Boolean(v))) {
|
|
5063
5523
|
setShowEmpty(true);
|
|
5064
5524
|
return;
|
|
5065
5525
|
}
|
|
5066
5526
|
LeadLog('submitHandler', categoryLevel, categoryData);
|
|
5067
|
-
const
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5527
|
+
const formatedFormData = formatFormData(formRef, formDataObj);
|
|
5528
|
+
const formData = formatedFormData.map(({ key, value, control }) => ({
|
|
5529
|
+
key,
|
|
5530
|
+
value,
|
|
5531
|
+
control,
|
|
5072
5532
|
}));
|
|
5073
5533
|
console.log('** RYAN index.tsx 218 formData : ', formData);
|
|
5074
|
-
const numberFormatType = 2; // i18n.phonenumbers.PhoneNumberFormat.NATIONAL
|
|
5075
5534
|
// Get ga_client_id from cookies
|
|
5076
5535
|
const gaCookie = getCookie('_ga') || null;
|
|
5077
5536
|
if (!window.intlTelInputUtils) {
|
|
5078
5537
|
yield require('intl-tel-input/build/js/utils');
|
|
5079
5538
|
}
|
|
5080
|
-
const
|
|
5081
|
-
url: location.href.toLowerCase(),
|
|
5082
|
-
title_article: document.title,
|
|
5083
|
-
meta: [
|
|
5084
|
-
...formData.map((i) => {
|
|
5085
|
-
var _a, _b;
|
|
5086
|
-
const control = ((_a = currentForm
|
|
5087
|
-
.querySelector(`*[name="${i.name}"][data-control]`)) === null || _a === void 0 ? void 0 : _a.getAttribute('data-control')) ||
|
|
5088
|
-
((_b = currentForm
|
|
5089
|
-
.querySelector(`*[data-extra][data-name="${i.name}"]`)) === null || _b === void 0 ? void 0 : _b.getAttribute('data-control')) ||
|
|
5090
|
-
'text';
|
|
5091
|
-
const value = control === 'tel'
|
|
5092
|
-
? window.intlTelInputUtils
|
|
5093
|
-
.formatNumber(String(i.value), LEAD_LOCALE === null || LEAD_LOCALE === void 0 ? void 0 : LEAD_LOCALE.countryCodeNumber, numberFormatType)
|
|
5094
|
-
.replace(/\s+/g, '')
|
|
5095
|
-
: control === 'date'
|
|
5096
|
-
? dayjs(i.value).format('YYYY-MM-DD')
|
|
5097
|
-
: i.value;
|
|
5098
|
-
return {
|
|
5099
|
-
key: i.name,
|
|
5100
|
-
value,
|
|
5101
|
-
control,
|
|
5102
|
-
// is_sent_mailchimp: currentForm.querySelector(
|
|
5103
|
-
// `div[data-name="${i.name}-mailchimp"]`,
|
|
5104
|
-
// )
|
|
5105
|
-
// ? 'true'
|
|
5106
|
-
// : 'false',
|
|
5107
|
-
};
|
|
5108
|
-
}),
|
|
5109
|
-
...extraPayloadValues,
|
|
5110
|
-
],
|
|
5539
|
+
const commonData = {
|
|
5111
5540
|
cookie_id: getCookie('hhg-id'),
|
|
5112
5541
|
ga_client_id: gaCookie,
|
|
5113
5542
|
};
|
|
5543
|
+
const data = Object.assign({ url: location.href.toLowerCase(), title_article: document.title, meta: [...formData, ...extraPayloadValues] }, commonData);
|
|
5114
5544
|
// categoryLevel
|
|
5115
5545
|
if (categoryLevel) {
|
|
5116
5546
|
if (categoryData[categoryLevel].value_en) {
|
|
5117
5547
|
data['category'] = categoryData[categoryLevel].value_en;
|
|
5118
5548
|
}
|
|
5119
5549
|
}
|
|
5120
|
-
const expiresDay = Number(((
|
|
5550
|
+
const expiresDay = Number(((_f = (_e = showCampaign.rules) === null || _e === void 0 ? void 0 : _e.find((r) => r.rule === 'days_to_show_again')) === null || _f === void 0 ? void 0 : _f.value) ||
|
|
5121
5551
|
7);
|
|
5122
|
-
const showAgain = Number(((
|
|
5552
|
+
const showAgain = Number(((_h = (_g = showCampaign.rules) === null || _g === void 0 ? void 0 : _g.find((r) => r.rule === 'show_again_after_submit')) === null || _h === void 0 ? void 0 : _h.value) || 0);
|
|
5123
5553
|
if (showAgain == 0) {
|
|
5124
5554
|
LeadLog('⛔ Popup never show again!');
|
|
5125
5555
|
setCookie(`lead_submited_${showCampaign.code}`, `target_${showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.targetType}`, { domain: '.' + siteDomain, path: '/' });
|
|
@@ -5128,13 +5558,20 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5128
5558
|
LeadLog(`⌛ Popup will show again after ${expiresDay} days!`);
|
|
5129
5559
|
setCookie(`lead_submited_${showCampaign.code}`, `target_${showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.targetType}`, { domain: '.' + siteDomain, days: expiresDay, path: '/' });
|
|
5130
5560
|
}
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5561
|
+
yield Promise.all([
|
|
5562
|
+
fetch(`${apiUrl}api/campaign/${showCampaign.code}/lead`, {
|
|
5563
|
+
method: 'POST',
|
|
5564
|
+
headers: {
|
|
5565
|
+
'Content-Type': 'application/json',
|
|
5566
|
+
},
|
|
5567
|
+
body: JSON.stringify(data),
|
|
5568
|
+
}),
|
|
5569
|
+
trackingCompletionForm({
|
|
5570
|
+
commonData: Object.assign(Object.assign({}, commonData), { country_code: locale ? MAPPED_LOCALE[locale] || 'VN' : 'VN', status: 'complete', campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id, total_fields: listBlockAdded.length }),
|
|
5571
|
+
currentLayout,
|
|
5572
|
+
formParams: Object.assign(Object.assign({}, params), { formValues: formatedFormData }),
|
|
5573
|
+
}),
|
|
5574
|
+
]);
|
|
5138
5575
|
onSubmitProps === null || onSubmitProps === void 0 ? void 0 : onSubmitProps(formDataObj);
|
|
5139
5576
|
if ((showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.popupShowThankYou) == 'notshow') {
|
|
5140
5577
|
onClose();
|
|
@@ -5153,15 +5590,15 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5153
5590
|
const titleBlock = listBlockThankyou.find((i) => i.name == 'TitleBlock');
|
|
5154
5591
|
const subtitleBlock = listBlockThankyou.find((i) => i.name == 'SubtitleBlock');
|
|
5155
5592
|
const linkButtonBlock = listBlockThankyou.find((i) => i.name == 'LinkButtonBlock');
|
|
5156
|
-
thankTitle = ((
|
|
5157
|
-
titleAlign = ((
|
|
5158
|
-
thankDesc = ((
|
|
5159
|
-
descAlign = ((
|
|
5160
|
-
linkText = ((
|
|
5161
|
-
linkNewTab = ((
|
|
5162
|
-
linkUrl = ((
|
|
5593
|
+
thankTitle = ((_j = titleBlock === null || titleBlock === void 0 ? void 0 : titleBlock.data) === null || _j === void 0 ? void 0 : _j.value) || '';
|
|
5594
|
+
titleAlign = ((_k = titleBlock === null || titleBlock === void 0 ? void 0 : titleBlock.data) === null || _k === void 0 ? void 0 : _k.align) || '';
|
|
5595
|
+
thankDesc = ((_l = subtitleBlock === null || subtitleBlock === void 0 ? void 0 : subtitleBlock.data) === null || _l === void 0 ? void 0 : _l.value) || '';
|
|
5596
|
+
descAlign = ((_m = subtitleBlock === null || subtitleBlock === void 0 ? void 0 : subtitleBlock.data) === null || _m === void 0 ? void 0 : _m.align) || '';
|
|
5597
|
+
linkText = ((_o = linkButtonBlock === null || linkButtonBlock === void 0 ? void 0 : linkButtonBlock.data) === null || _o === void 0 ? void 0 : _o.value) || '';
|
|
5598
|
+
linkNewTab = ((_p = linkButtonBlock === null || linkButtonBlock === void 0 ? void 0 : linkButtonBlock.data) === null || _p === void 0 ? void 0 : _p.newtab) || false;
|
|
5599
|
+
linkUrl = ((_q = linkButtonBlock === null || linkButtonBlock === void 0 ? void 0 : linkButtonBlock.data) === null || _q === void 0 ? void 0 : _q.url) || '';
|
|
5163
5600
|
// ALWAYS SHOW THANK YOU ON COMPOUND COMP
|
|
5164
|
-
// const curLayout =
|
|
5601
|
+
// const curLayout = currentLayout
|
|
5165
5602
|
// TODO: newbuilder thank you
|
|
5166
5603
|
// List layout not show thanks you
|
|
5167
5604
|
// if (
|
|
@@ -5200,7 +5637,7 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5200
5637
|
}
|
|
5201
5638
|
// Submit Inisder Obj
|
|
5202
5639
|
formData.map((data) => {
|
|
5203
|
-
const name = data.
|
|
5640
|
+
const name = data.key;
|
|
5204
5641
|
const value = data.value;
|
|
5205
5642
|
if (name == 'tel') {
|
|
5206
5643
|
window.insider_object.user.phone_number = value;
|
|
@@ -5218,16 +5655,22 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5218
5655
|
leadStartTimeRef.current = Date.now();
|
|
5219
5656
|
}
|
|
5220
5657
|
}, [showCampaign]);
|
|
5221
|
-
return (React__default.createElement(LeadGenContext$1.Provider, { value: {
|
|
5658
|
+
return (React__default.createElement(LeadGenContext$1.Provider, { value: {
|
|
5659
|
+
primaryColor,
|
|
5660
|
+
apiUrl,
|
|
5661
|
+
siteDomain,
|
|
5662
|
+
siteId,
|
|
5663
|
+
locale,
|
|
5664
|
+
} },
|
|
5222
5665
|
React__default.createElement(TranslationsContext.Provider, { value: { locale, values: getTranslations(locale) } }, children ? (React__default.createElement(Component, { campaign: showCampaign, onSubmit: onSubmit, onClose: onClose, showThankyou: showThankyou, setShowThankyou: setShowThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo }, children)) : (React__default.createElement(Portal, { target: getPopupWrapperDom() },
|
|
5223
5666
|
React__default.createElement(Box, { sx: { position: 'fixed', zIndex: ZINDEX_SSO - 9e6 } },
|
|
5224
|
-
React__default.createElement(Transition, { mounted: Boolean(((
|
|
5667
|
+
React__default.createElement(Transition, { mounted: Boolean(((_b = showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields) === null || _b === void 0 ? void 0 : _b.popupVersion) === '2.1'), transition: "fade", duration: 600, timingFunction: "ease", exitDuration: 200 }, (styles) => {
|
|
5225
5668
|
var _a;
|
|
5226
5669
|
return (React__default.createElement(Box, { style: styles }, ((_a = showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields) === null || _a === void 0 ? void 0 : _a.popupVersion) === '2.1' && (React__default.createElement(React__default.Fragment, null,
|
|
5227
|
-
!!
|
|
5228
|
-
!
|
|
5229
|
-
!
|
|
5230
|
-
React__default.createElement(NewLeadPopup, { campaign: showCampaign, action: action, onSubmit: onSubmit, onClose: onClose, showThankyou: showThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo })))));
|
|
5670
|
+
!!currentLayout &&
|
|
5671
|
+
!currentLayout.includes('Inline') &&
|
|
5672
|
+
!currentLayout.includes('Sidebar') && (React__default.createElement(Overlay, { color: "#000", opacity: 0.6, center: true, zIndex: 400, pos: 'fixed', onClick: () => onClose() })),
|
|
5673
|
+
React__default.createElement(NewLeadPopup, { campaign: showCampaign, action: action, onSubmit: onSubmit, onClose: onClose, onUnmount: onUnmount, showThankyou: showThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo })))));
|
|
5231
5674
|
})))))));
|
|
5232
5675
|
};
|
|
5233
5676
|
const LeadGen = _LeadGen;
|