@hhgtech/hhg-components 1.29.397 → 1.29.398
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-cb61c874.js → InputDate-7293a7d5.js} +17 -7
- package/build/{LastPeriod-d8ddca7e.js → LastPeriod-c332f6ca.js} +1 -1
- package/build/{MobileBottomNavigationIcon-d0bf4f2f.js → MobileBottomNavigationIcon-a0e0d067.js} +3 -3
- package/build/{Spinner-09c645f2.js → Spinner-e6760de8.js} +1 -1
- package/build/{WhatsApp-bd0758b4.js → WhatsApp-d2adb7d2.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-cc117e43.js → constants-d10138de.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-854a9835.js → core-31ec3ad5.js} +1 -1
- package/build/{dataTransform-1a7310bf.js → dataTransform-c27c2a27.js} +1 -1
- package/build/ecom.js +4 -4
- package/build/{editor-2ec97fb8.js → editor-5d3e68f9.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-3de0b6eb.js → InputDate-68b47acd.js} +17 -7
- package/build/esm/{LastPeriod-c00e7236.js → LastPeriod-1013b943.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-1dc5526b.js → MobileBottomNavigationIcon-183acd4b.js} +3 -3
- package/build/esm/{Spinner-37ae77a1.js → Spinner-4304f874.js} +1 -1
- package/build/esm/{WhatsApp-6cf1cba2.js → WhatsApp-b7d6f7b3.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-8391efd4.js → constants-6044ea5d.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-7ced398e.js → core-539da565.js} +1 -1
- package/build/esm/{dataTransform-33dce2b7.js → dataTransform-bc13fe24.js} +1 -1
- package/build/esm/ecom.js +4 -4
- package/build/esm/{editor-225465e9.js → editor-dd92fd9c.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-e8b13544.js → healthTools-f5840b42.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.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-0af646e0.js → index-042554be.js} +13 -13
- package/build/esm/{index-6c00503e.js → index-05b05125.js} +2 -2
- package/build/esm/{index-dbfb26ed.js → index-0d777cad.js} +1 -1
- package/build/esm/{index-599f32ab.js → index-1144ac03.js} +31 -31
- package/build/esm/{index-cff26977.js → index-14b25d0e.js} +17 -17
- package/build/esm/{index-0b5c7bb3.js → index-25f12126.js} +5 -5
- package/build/esm/{index-aee74f37.js → index-289f16a0.js} +1 -1
- package/build/esm/{index-cfd3d75e.js → index-2ba735e4.js} +8 -8
- package/build/esm/{index-db5af859.js → index-2e5a9229.js} +2 -2
- package/build/esm/{index-bf06494d.js → index-33dd8004.js} +6 -6
- package/build/esm/{index-42d18aba.js → index-38a191b8.js} +1 -1
- package/build/esm/{index-190c6d36.js → index-3a9b8590.js} +11 -11
- package/build/esm/{index-b902c3fb.js → index-3b1bb241.js} +16 -16
- package/build/esm/{index-c4507a0c.js → index-3f4d46bd.js} +3 -3
- package/build/esm/{index-9050f4e9.js → index-4428c38c.js} +2 -2
- package/build/esm/{index-847f9ab6.js → index-4519d1af.js} +18 -18
- package/build/esm/{index-0914bea0.js → index-4658492d.js} +4 -4
- package/build/esm/{index-d4867431.js → index-486c8bf0.js} +6 -6
- package/build/esm/{index-3d569636.js → index-4938042a.js} +3 -3
- package/build/esm/{index-fa37e358.js → index-4d4d1844.js} +3 -3
- package/build/esm/{index-c07bd09a.js → index-4d846a96.js} +2 -2
- package/build/esm/{index-98c2852d.js → index-56de01a0.js} +18 -18
- package/build/esm/{index-f340ae87.js → index-59b97276.js} +2 -2
- package/build/esm/{index-27607593.js → index-5a48050a.js} +6 -6
- package/build/esm/{index-aac78899.js → index-5b928f9c.js} +6 -6
- package/build/esm/{index-92bb90c9.js → index-6dd768ec.js} +3 -3
- package/build/esm/{index-113f57fd.js → index-6eb4548a.js} +1 -1
- package/build/esm/{index-18957b53.js → index-6f536c14.js} +16 -16
- package/build/esm/{index-a09019fd.js → index-73d25095.js} +2 -2
- package/build/esm/{index-023a138f.js → index-76d7bb85.js} +32 -32
- package/build/esm/{index-e5026fe0.js → index-79ba863f.js} +3 -3
- package/build/esm/{index-ce42020e.js → index-79d07e4f.js} +1 -1
- package/build/esm/{index-b2ad799b.js → index-7ae4368e.js} +13 -13
- package/build/esm/{index-54d05e87.js → index-7d7148fc.js} +5 -5
- package/build/esm/{index-4a08219a.js → index-82787a35.js} +1 -1
- package/build/esm/{index-dede8436.js → index-832f9284.js} +16 -16
- package/build/esm/{index-52b415e3.js → index-89b6d71d.js} +1 -1
- package/build/esm/{index-02da49e4.js → index-8b3e8848.js} +6 -6
- package/build/esm/{index-f1ce4d65.js → index-8c8190fd.js} +13 -13
- package/build/esm/{index-f37b2f4c.js → index-92acaf71.js} +13 -13
- package/build/esm/{index-e160727d.js → index-9669581a.js} +2 -2
- package/build/esm/{index-50f9d5f5.js → index-9b16ee87.js} +7 -7
- package/build/esm/{index-4c04e5bc.js → index-9beb4e5f.js} +21 -21
- package/build/esm/{index-711160fd.js → index-9f4130d1.js} +2 -2
- package/build/esm/{index-bad504c6.js → index-a5715a79.js} +25 -25
- package/build/esm/{index-4a02282f.js → index-a5aebe8b.js} +2 -2
- package/build/esm/{index-864940b7.js → index-aa1969be.js} +7 -7
- package/build/esm/{index-7132e119.js → index-ac9c82c4.js} +1 -1
- package/build/esm/{index-c07c34ee.js → index-af96b594.js} +22 -22
- package/build/esm/{index-cb24aaef.js → index-b183680b.js} +10 -10
- package/build/esm/{index-9e52e7ff.js → index-b63fee83.js} +2 -2
- package/build/esm/{index-4e6b231b.js → index-c2a09372.js} +24 -24
- package/build/esm/{index-110695a5.js → index-c6c9fcb2.js} +2 -2
- package/build/esm/{index-8ecb1332.js → index-c6f1e3a8.js} +17 -17
- package/build/esm/{index-12c25215.js → index-c78d289b.js} +1 -1
- package/build/esm/{index-448c4373.js → index-cd7c392e.js} +17 -17
- package/build/esm/{index-e7780c40.js → index-d70292d6.js} +17 -17
- package/build/esm/{index-8c21ead4.js → index-de6e0e44.js} +3 -3
- package/build/esm/{index-756725c2.js → index-e415940d.js} +2 -2
- package/build/esm/{index-33f4508d.js → index-e531e7f8.js} +15 -15
- package/build/esm/{index-7ee37015.js → index-ee2a13b4.js} +4 -4
- package/build/esm/{index-0527b881.js → index-f5fdebe1.js} +16 -16
- package/build/esm/{index-b462e743.js → index-f6ed5564.js} +31 -31
- package/build/esm/{index-48ba9a23.js → index-f830af41.js} +2 -2
- package/build/esm/{index-3fbf9806.js → index-f87e9815.js} +2 -2
- package/build/esm/index.js +118 -118
- package/build/esm/{labelSorting-76adca0e.js → labelSorting-ce3a057c.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 +756 -292
- package/build/esm/{logoIcon-acedf6f6.js → logoIcon-55002c55.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-a58ebf7c.js → post-21741a62.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.js +30 -30
- package/build/esm/{store-94edb3b3.js → store-064f9dd1.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-a6a24b46.js → surveyThankyouCard-b4931fac.js} +5 -5
- 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-e2245dc2.js → translationsProvider-aba6c5ae.js} +1 -1
- package/build/esm/{treePopoverMenu-7502dc2c.js → treePopoverMenu-137c00a8.js} +19 -19
- package/build/esm/{types-e0d98e14.js → types-65a5795c.js} +2 -2
- package/build/esm/types.js +2 -2
- package/build/esm/{useCategory-f0c930aa.js → useCategory-c109d09b.js} +5 -5
- package/build/esm/{useHealthToolCache-4b8a204f.js → useHealthToolCache-629025ab.js} +1 -1
- package/build/esm/{useMantineLocale-36230243.js → useMantineLocale-d49a5fcf.js} +6 -6
- package/build/esm/{usePlacesAutocomplete-cbc980ee.js → usePlacesAutocomplete-8adbb1b0.js} +1 -1
- package/build/esm/{useScreenSize-2bbf367e.js → useScreenSize-bd45f615.js} +2 -2
- package/build/esm/useTogetherAuthRequiredAction.js +10 -10
- package/build/esm/{utils-dbc9c0f0.js → utils-0a79cd26.js} +2 -2
- package/build/esm/{utils-539deb75.js → utils-6b5d6b23.js} +5 -5
- package/build/esm/{utils-966f2cee.js → utils-9c224b30.js} +3 -3
- package/build/esm/{utils-2bee2fb4.js → utils-c5989bfe.js} +2 -2
- package/build/esm/vaccination.js +21 -21
- package/build/footer.js +21 -21
- package/build/gAssets.js +2 -2
- package/build/{healthTools-955e57bd.js → healthTools-9a9ae036.js} +1 -1
- package/build/healthToolsCardWrapper.js +18 -18
- package/build/healthToolsForm.js +33 -33
- package/build/hooks.js +13 -13
- package/build/i18n.js +2 -2
- package/build/i18nV2.js +1 -1
- package/build/{index-457ee264.js → index-0072a85c.js} +6 -6
- package/build/{index-11233691.js → index-03928531.js} +2 -2
- package/build/{index-86f8e22b.js → index-08167b2b.js} +1 -1
- package/build/{index-789a2c8f.js → index-0abe5728.js} +8 -8
- package/build/{index-62ee4445.js → index-0ae569d7.js} +24 -24
- package/build/{index-ab17d0f2.js → index-0bd417e7.js} +16 -16
- package/build/{index-a0cbffda.js → index-0e171a79.js} +13 -13
- package/build/{index-8e775085.js → index-12e03326.js} +2 -2
- package/build/{index-e151865b.js → index-135e4121.js} +21 -21
- package/build/{index-b82cddb5.js → index-167a012a.js} +3 -3
- package/build/{index-3a100f96.js → index-168e2397.js} +25 -25
- package/build/{index-6250307d.js → index-1a4c489b.js} +15 -15
- package/build/{index-fa7b3e87.js → index-1c8761e6.js} +3 -3
- package/build/{index-37b80834.js → index-29aff1f4.js} +4 -4
- package/build/{index-7e6e1cab.js → index-2a396c24.js} +10 -10
- package/build/{index-9757b60e.js → index-2afc5140.js} +1 -1
- package/build/{index-539696ad.js → index-2d09100c.js} +3 -3
- package/build/{index-c7da40e0.js → index-2d688d0f.js} +6 -6
- package/build/{index-5142eef5.js → index-340f3b95.js} +2 -2
- package/build/{index-7a234e75.js → index-354eb840.js} +31 -31
- package/build/{index-26279472.js → index-36a83255.js} +2 -2
- package/build/{index-8df6fefb.js → index-3c1720cc.js} +17 -17
- package/build/{index-2c5a8ca9.js → index-3f0821fe.js} +31 -31
- package/build/{index-ea84a11b.js → index-41368d4c.js} +4 -4
- package/build/{index-111cd51c.js → index-48bdaedf.js} +6 -6
- package/build/{index-c6b097b8.js → index-4d40bf5a.js} +3 -3
- package/build/{index-e180bceb.js → index-512ae9f6.js} +17 -17
- package/build/{index-4a829a3d.js → index-55f1c1f9.js} +3 -3
- package/build/{index-e36c3713.js → index-565375e2.js} +7 -7
- package/build/{index-1676c1f6.js → index-56d0de84.js} +6 -6
- package/build/{index-3a3bd736.js → index-59514549.js} +2 -2
- package/build/{index-1afb5492.js → index-61e559ec.js} +17 -17
- package/build/{index-cbc87e7c.js → index-70859e34.js} +13 -13
- package/build/{index-aafaafd3.js → index-730e99b5.js} +18 -18
- package/build/{index-4985c02f.js → index-7e6e618d.js} +2 -2
- package/build/{index-27815146.js → index-825e6829.js} +1 -1
- package/build/{index-aa7f2f8e.js → index-844b98be.js} +2 -2
- package/build/{index-d896c731.js → index-8558ec2f.js} +2 -2
- package/build/{index-88a9a7b0.js → index-8939bf9c.js} +1 -1
- package/build/{index-b5f73835.js → index-8a02a860.js} +16 -16
- package/build/{index-28ed74f1.js → index-8a8e561b.js} +5 -5
- package/build/{index-a6161efc.js → index-953badaa.js} +2 -2
- package/build/{index-7fc05b9e.js → index-9c7a4154.js} +3 -3
- package/build/{index-70de9850.js → index-a318773b.js} +1 -1
- package/build/{index-c826f710.js → index-a9b103a9.js} +2 -2
- package/build/{index-c70382d7.js → index-af006454.js} +2 -2
- package/build/{index-ba1dfbb6.js → index-afcc0259.js} +11 -11
- package/build/{index-cbadd61d.js → index-b6fb060c.js} +1 -1
- package/build/{index-08fcf3aa.js → index-c07d2d77.js} +5 -5
- package/build/{index-aaecebaa.js → index-c7c46170.js} +13 -13
- package/build/{index-ec35690d.js → index-ce46e31e.js} +32 -32
- package/build/{index-501b45c2.js → index-d30bdcb4.js} +6 -6
- package/build/{index-f9e32d5a.js → index-d67fceb0.js} +2 -2
- package/build/{index-605608ab.js → index-d6f4f97a.js} +22 -22
- package/build/{index-0e634110.js → index-d95bccb3.js} +2 -2
- package/build/{index-2fa7fa9c.js → index-d9aad601.js} +17 -17
- package/build/{index-cec7c2e9.js → index-d9bb50f1.js} +1 -1
- package/build/{index-45465636.js → index-da3375cd.js} +1 -1
- package/build/{index-1712dc69.js → index-de218006.js} +7 -7
- package/build/{index-b106675e.js → index-de39e4e3.js} +1 -1
- package/build/{index-58052fd7.js → index-e5853c26.js} +2 -2
- package/build/{index-cd397653.js → index-ef48261e.js} +13 -13
- package/build/{index-546f0d5e.js → index-effa1855.js} +16 -16
- package/build/{index-95ae1af5.js → index-f46df1a9.js} +18 -18
- package/build/{index-861663fa.js → index-ffa4b652.js} +16 -16
- package/build/index.js +118 -118
- package/build/{labelSorting-f89451d4.js → labelSorting-58107918.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 +756 -292
- package/build/{logoIcon-dfd6c2a2.js → logoIcon-1e4041fd.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-9c853116.js → post-58a46ff4.js} +2 -2
- package/build/profileNavigation.js +19 -19
- package/build/progressBar.js +1 -1
- package/build/pwg.js +22 -22
- package/build/ssoV2.js +28 -28
- package/build/{store-c0cc1ed3.js → store-f5ee5314.js} +3 -3
- package/build/subot.js +35 -35
- package/build/surveyOrPremiumBanner.js +33 -33
- package/build/surveyQuestionCard.js +10 -10
- package/build/{surveyThankyouCard-b094b0cc.js → surveyThankyouCard-15f03e84.js} +5 -5
- 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-56928a3c.js → translationsProvider-81557d0c.js} +1 -1
- package/build/{treePopoverMenu-08beab6b.js → treePopoverMenu-08c5c9b2.js} +19 -19
- package/build/{types-75b58469.js → types-98a5c14a.js} +2 -2
- package/build/types.js +2 -2
- package/build/{useCategory-6ae322de.js → useCategory-e8fa61da.js} +5 -5
- package/build/{useHealthToolCache-f6d33c9b.js → useHealthToolCache-9412c03f.js} +1 -1
- package/build/{useMantineLocale-3e2ab14d.js → useMantineLocale-ea75e18c.js} +6 -6
- package/build/{usePlacesAutocomplete-06298b2c.js → usePlacesAutocomplete-05dd8d97.js} +1 -1
- package/build/{useScreenSize-bf9fd1ec.js → useScreenSize-37357d5a.js} +2 -2
- package/build/useTogetherAuthRequiredAction.js +10 -10
- package/build/{utils-a06acd51.js → utils-33525210.js} +3 -3
- package/build/{utils-3b31e8c3.js → utils-8155988a.js} +5 -5
- package/build/{utils-cac21f95.js → utils-be721609.js} +2 -2
- package/build/{utils-b8b39ab6.js → utils-f65a7b4c.js} +2 -2
- package/build/vaccination.js +21 -21
- package/package.json +1 -1
- /package/build/{BMI_BOYS.percentile.monthly-9f152c2a.js → BMI_BOYS.percentile.monthly-e9d6da5d.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-97d3222c.js → BMI_BOYS.percentile.weekly-336d078a.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-5f0acf05.js → BMI_BOYS.percentile.yearly-18314803.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-a2e1063e.js → BMI_BOYS.zscore.monthly-dac95ca2.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-0fba0d7f.js → BMI_BOYS.zscore.weekly-535a6549.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-8a0ed23b.js → BMI_BOYS.zscore.yearly-6e55fd11.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-e761fac3.js → BMI_GIRLS.percentile.monthly-ab7b595e.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-30c96d04.js → BMI_GIRLS.percentile.weekly-3393c06f.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-f8abc794.js → BMI_GIRLS.percentile.yearly-fff9ffc9.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-4cc8b26d.js → BMI_GIRLS.zscore.monthly-e11a8a67.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-5daade4d.js → BMI_GIRLS.zscore.weekly-1541d907.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-dc817f11.js → BMI_GIRLS.zscore.yearly-793f0fbc.js} +0 -0
- /package/build/{ChevronDown-8e7e32c9.js → ChevronDown-8956e637.js} +0 -0
- /package/build/{Close-d03cb628.js → Close-0537055c.js} +0 -0
- /package/build/{Google-a9a0c01a.js → Google-2a973273.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-8af7454e.js → HEAD CIRCUM_BOYS.percentile.monthly-bf839b5a.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-e31113cd.js → HEAD CIRCUM_BOYS.percentile.weekly-c6a3a757.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-d2ec1246.js → HEAD CIRCUM_BOYS.percentile.yearly-9ceae021.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-64736415.js → HEAD CIRCUM_BOYS.zscore.monthly-6cb17be7.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-3085e7bc.js → HEAD CIRCUM_BOYS.zscore.weekly-8775bd19.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-ca16e1b1.js → HEAD CIRCUM_BOYS.zscore.yearly-fce9ed1e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-76e8d246.js → HEAD CIRCUM_GIRLS.percentile.monthly-1ca7a5d7.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-55d95d81.js → HEAD CIRCUM_GIRLS.percentile.weekly-c3b2518e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-d1c5a180.js → HEAD CIRCUM_GIRLS.percentile.yearly-c7583b8d.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-adfc2acd.js → HEAD CIRCUM_GIRLS.zscore.monthly-64f57a2e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-6b316c6e.js → HEAD CIRCUM_GIRLS.zscore.weekly-7e1ddb24.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-7d7c487c.js → HEAD CIRCUM_GIRLS.zscore.yearly-477e080d.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-9c3b903f.js → HEIGHT_BOYS.percentile.monthly-036b4e8f.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-29c1833b.js → HEIGHT_BOYS.percentile.weekly-d4b87839.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-db218a30.js → HEIGHT_BOYS.percentile.yearly-78821b1f.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-64e999d1.js → HEIGHT_BOYS.zscore.monthly-11664791.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-773bdf94.js → HEIGHT_BOYS.zscore.weekly-2d176624.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-82dc5bd6.js → HEIGHT_BOYS.zscore.yearly-b533c589.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-b4b00b8e.js → HEIGHT_GIRLS.percentile.monthly-9869cd87.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-7e3dc1c6.js → HEIGHT_GIRLS.percentile.weekly-36f37eb1.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-c696c874.js → HEIGHT_GIRLS.percentile.yearly-cd9b68c4.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-1e3efa55.js → HEIGHT_GIRLS.zscore.monthly-4c65243e.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-4c8a6df2.js → HEIGHT_GIRLS.zscore.weekly-9d5e6573.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-b201f9f6.js → HEIGHT_GIRLS.zscore.yearly-ad9853a8.js} +0 -0
- /package/build/{Locale-d6ed6fd5.js → Locale-66ad336c.js} +0 -0
- /package/build/{Visible-8cb29e3b.js → Visible-5a501cd8.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-28b8b791.js → WEIGHT_BOYS.percentile.monthly-80a0f465.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-cb8c252d.js → WEIGHT_BOYS.percentile.weekly-cf1b0f8e.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-642524f9.js → WEIGHT_BOYS.percentile.yearly-6aa641c3.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-29c479ba.js → WEIGHT_BOYS.zscore.monthly-75ce2fdc.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-79388d42.js → WEIGHT_BOYS.zscore.weekly-96262ef1.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-04ab41ac.js → WEIGHT_BOYS.zscore.yearly-9bd2c801.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-6e66b039.js → WEIGHT_GIRLS.percentile.monthly-3f63b7cf.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-1300e791.js → WEIGHT_GIRLS.percentile.weekly-4e85dff0.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-1015a28c.js → WEIGHT_GIRLS.percentile.yearly-443ca26d.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-d2e917af.js → WEIGHT_GIRLS.zscore.monthly-c73ca5dc.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-02c0d2bd.js → WEIGHT_GIRLS.zscore.weekly-41352a94.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-af8b3d14.js → WEIGHT_GIRLS.zscore.yearly-64df9e19.js} +0 -0
- /package/build/{animation-ea19bb57.js → animation-cdf25d12.js} +0 -0
- /package/build/{constants-4f94e6fd.js → constants-4e9bf295.js} +0 -0
- /package/build/{constants-52aef66c.js → constants-b3aaa418.js} +0 -0
- /package/build/{constants-86bdcc53.js → constants-ba121eb3.js} +0 -0
- /package/build/{dataTransform-44b74b9e.js → dataTransform-f5740593.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-075f5d48.js → BMI_BOYS.percentile.monthly-63a5ae1b.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-e566b297.js → BMI_BOYS.percentile.weekly-4a247fed.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-968ff034.js → BMI_BOYS.percentile.yearly-84e8d91c.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-1f7b53a2.js → BMI_BOYS.zscore.monthly-8e2e871d.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-f8e35173.js → BMI_BOYS.zscore.weekly-82e70b41.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-32275a4d.js → BMI_BOYS.zscore.yearly-b0ec4bdf.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-efe5bd3e.js → BMI_GIRLS.percentile.monthly-a49eaea0.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-e328b638.js → BMI_GIRLS.percentile.weekly-579f818d.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-1963bfcd.js → BMI_GIRLS.percentile.yearly-8b0fac00.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-458782d1.js → BMI_GIRLS.zscore.monthly-338e2bcd.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-ef8b1961.js → BMI_GIRLS.zscore.weekly-dc3ef118.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-f32a5313.js → BMI_GIRLS.zscore.yearly-e5681614.js} +0 -0
- /package/build/esm/{ChevronDown-e4cc466e.js → ChevronDown-f964bd0d.js} +0 -0
- /package/build/esm/{Close-f335d7d5.js → Close-f5a756a1.js} +0 -0
- /package/build/esm/{Google-a40ce59d.js → Google-addd3663.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-88877c38.js → HEAD CIRCUM_BOYS.percentile.monthly-817ee315.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-ae47f376.js → HEAD CIRCUM_BOYS.percentile.weekly-a92e4518.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-d2873655.js → HEAD CIRCUM_BOYS.percentile.yearly-7433629a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-ab04bb64.js → HEAD CIRCUM_BOYS.zscore.monthly-0a4641dc.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-42be0c33.js → HEAD CIRCUM_BOYS.zscore.weekly-a58924b1.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-9e0f7356.js → HEAD CIRCUM_BOYS.zscore.yearly-38b37ee5.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-28147114.js → HEAD CIRCUM_GIRLS.percentile.monthly-d42541f0.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-ec14a371.js → HEAD CIRCUM_GIRLS.percentile.weekly-ddec9d24.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-b2227c73.js → HEAD CIRCUM_GIRLS.percentile.yearly-5f280e48.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-9e2dc52c.js → HEAD CIRCUM_GIRLS.zscore.monthly-17886eea.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-ca8a02b2.js → HEAD CIRCUM_GIRLS.zscore.weekly-379a7203.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-ea07af92.js → HEAD CIRCUM_GIRLS.zscore.yearly-a6edf3d4.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-9c0fddf3.js → HEIGHT_BOYS.percentile.monthly-a3cc1e6b.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-7049e16b.js → HEIGHT_BOYS.percentile.weekly-0fee74a3.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-73f5111e.js → HEIGHT_BOYS.percentile.yearly-086168e7.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-cdb3f14b.js → HEIGHT_BOYS.zscore.monthly-3914c428.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-6705f40a.js → HEIGHT_BOYS.zscore.weekly-dc0d16d6.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-3cb76051.js → HEIGHT_BOYS.zscore.yearly-65e667b5.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-209b4861.js → HEIGHT_GIRLS.percentile.monthly-6600e1cf.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-7dd27242.js → HEIGHT_GIRLS.percentile.weekly-f0e775e9.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-54be350a.js → HEIGHT_GIRLS.percentile.yearly-834643aa.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-3a4a1089.js → HEIGHT_GIRLS.zscore.monthly-a35515dd.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-731251d8.js → HEIGHT_GIRLS.zscore.weekly-3b944a81.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-749a8061.js → HEIGHT_GIRLS.zscore.yearly-edb79d1a.js} +0 -0
- /package/build/esm/{Locale-c05b4162.js → Locale-127396b7.js} +0 -0
- /package/build/esm/{Visible-ce15dc3e.js → Visible-d695fd54.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-ae9baf0d.js → WEIGHT_BOYS.percentile.monthly-c82fccbd.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-ea249e46.js → WEIGHT_BOYS.percentile.weekly-ecbe9bea.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-e8066fa4.js → WEIGHT_BOYS.percentile.yearly-d9b94df8.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-d4af506c.js → WEIGHT_BOYS.zscore.monthly-76eefabe.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-4ebd43b1.js → WEIGHT_BOYS.zscore.weekly-fafaf3cd.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-9c5344f6.js → WEIGHT_BOYS.zscore.yearly-77293365.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-de2f6755.js → WEIGHT_GIRLS.percentile.monthly-220cfd9c.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-1eaa454c.js → WEIGHT_GIRLS.percentile.weekly-73e24632.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-ac8d51e9.js → WEIGHT_GIRLS.percentile.yearly-f78e098e.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-f4d1616e.js → WEIGHT_GIRLS.zscore.monthly-65ece450.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-169c1e67.js → WEIGHT_GIRLS.zscore.weekly-3bb85417.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-279d9930.js → WEIGHT_GIRLS.zscore.yearly-ab5d7299.js} +0 -0
- /package/build/esm/{animation-7e1886f4.js → animation-35a2e4c9.js} +0 -0
- /package/build/esm/{constants-d33263b5.js → constants-8e673a53.js} +0 -0
- /package/build/esm/{constants-82f3d21d.js → constants-a3ead723.js} +0 -0
- /package/build/esm/{constants-ecd7b299.js → constants-a737de55.js} +0 -0
- /package/build/esm/{dataTransform-51d2a647.js → dataTransform-bd486a48.js} +0 -0
- /package/build/esm/{index-85f20c91.js → index-04bf24c6.js} +0 -0
- /package/build/esm/{index-7beff254.js → index-0bac4f0f.js} +0 -0
- /package/build/esm/{index-7fa44c0e.js → index-41c72982.js} +0 -0
- /package/build/esm/{index-59fcd11e.js → index-5d31a658.js} +0 -0
- /package/build/esm/{index-f2b664b2.js → index-793f925b.js} +0 -0
- /package/build/esm/{index-83b79fc6.js → index-8dc9ce91.js} +0 -0
- /package/build/esm/{index-743926ea.js → index-d0597f4c.js} +0 -0
- /package/build/esm/{index-2bf9e0c7.js → index-f0fc31db.js} +0 -0
- /package/build/esm/{index.styles-ee329278.js → index.styles-042da966.js} +0 -0
- /package/build/esm/lead/layouts/{ emptyIcon.d.ts → emptyIcon.d.ts} +0 -0
- /package/build/esm/{localizeNumberFormat-3d282054.js → localizeNumberFormat-14b4ff14.js} +0 -0
- /package/build/esm/{normalizeLink-c1b5cc6b.js → normalizeLink-e55a2c2f.js} +0 -0
- /package/build/esm/{number-5016cef5.js → number-56c4d23b.js} +0 -0
- /package/build/esm/{other-a43016d1.js → other-4278dddd.js} +0 -0
- /package/build/esm/{paths-bec5b0c5.js → paths-23446838.js} +0 -0
- /package/build/esm/{translationsContext-a275465e.js → translationsContext-73f752de.js} +0 -0
- /package/build/esm/{tslib.es6-30e6f9a9.js → tslib.es6-c0c3ad7a.js} +0 -0
- /package/build/esm/{types-0216b206.js → types-8ea1f9be.js} +0 -0
- /package/build/esm/{useIsInit-46e41f1c.js → useIsInit-25891504.js} +0 -0
- /package/build/esm/{useOutsideClick-dfa1a3dd.js → useOutsideClick-dae7c00c.js} +0 -0
- /package/build/esm/{useScrollbarSize-853656f8.js → useScrollbarSize-33b9d9d5.js} +0 -0
- /package/build/esm/{useUniqueId-3e15eabc.js → useUniqueId-5504b112.js} +0 -0
- /package/build/esm/{utils-1a28819a.js → utils-fc3e7d3c.js} +0 -0
- /package/build/{index-0acde5e3.js → index-5841c247.js} +0 -0
- /package/build/{index-46396ba3.js → index-67f58a4a.js} +0 -0
- /package/build/{index-62e98f6e.js → index-6bf0f2c2.js} +0 -0
- /package/build/{index-66735537.js → index-7c94b390.js} +0 -0
- /package/build/{index-0324e04f.js → index-93653fad.js} +0 -0
- /package/build/{index-b1053088.js → index-9ad615a6.js} +0 -0
- /package/build/{index-681fd02b.js → index-ceed5380.js} +0 -0
- /package/build/{index-be96a59c.js → index-e80694fb.js} +0 -0
- /package/build/{index.styles-31ab4468.js → index.styles-a188e8d1.js} +0 -0
- /package/build/lead/layouts/{ emptyIcon.d.ts → emptyIcon.d.ts} +0 -0
- /package/build/{localizeNumberFormat-e66a05f7.js → localizeNumberFormat-91bc9dfa.js} +0 -0
- /package/build/{normalizeLink-83d9a351.js → normalizeLink-0e61510b.js} +0 -0
- /package/build/{number-21785cfd.js → number-0ba526f0.js} +0 -0
- /package/build/{other-9e4ceb9d.js → other-cf7f35bd.js} +0 -0
- /package/build/{paths-9daec102.js → paths-c227371d.js} +0 -0
- /package/build/{translationsContext-43dbcf8f.js → translationsContext-7ecd64ff.js} +0 -0
- /package/build/{tslib.es6-df8551a2.js → tslib.es6-dbf5123e.js} +0 -0
- /package/build/{types-3325c59c.js → types-34bae4f4.js} +0 -0
- /package/build/{useIsInit-6023b3a5.js → useIsInit-6341eedb.js} +0 -0
- /package/build/{useOutsideClick-2401a2e4.js → useOutsideClick-d55a2e7b.js} +0 -0
- /package/build/{useScrollbarSize-68754034.js → useScrollbarSize-144f1bbc.js} +0 -0
- /package/build/{useUniqueId-27b130fe.js → useUniqueId-0e1c7117.js} +0 -0
- /package/build/{utils-1438d0cf.js → utils-a4bc0709.js} +0 -0
package/build/lead.js
CHANGED
|
@@ -2,55 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var tslib_es6 = require('./tslib.es6-
|
|
5
|
+
var tslib_es6 = require('./tslib.es6-dbf5123e.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var core = require('@mantine/core');
|
|
8
|
-
var dayjs = require('dayjs');
|
|
9
8
|
var debounce = require('lodash/debounce');
|
|
10
9
|
var form = require('@mantine/form');
|
|
11
|
-
var
|
|
10
|
+
var dayjs = require('dayjs');
|
|
11
|
+
var index = require('./index-29aff1f4.js');
|
|
12
12
|
var miscCookieHelper = require('./miscCookieHelper.js');
|
|
13
|
-
var index$1 = require('./index-
|
|
14
|
-
var translationsContext = require('./translationsContext-
|
|
15
|
-
var utils$1 = require('./utils-
|
|
16
|
-
var index$2 = require('./index-
|
|
17
|
-
var index$3 = require('./index-
|
|
18
|
-
var index$5 = require('./index-
|
|
19
|
-
var index$4 = require('./index-
|
|
20
|
-
require('./index.styles-
|
|
13
|
+
var index$1 = require('./index-a318773b.js');
|
|
14
|
+
var translationsContext = require('./translationsContext-7ecd64ff.js');
|
|
15
|
+
var utils$1 = require('./utils-a4bc0709.js');
|
|
16
|
+
var index$2 = require('./index-a9b103a9.js');
|
|
17
|
+
var index$3 = require('./index-afcc0259.js');
|
|
18
|
+
var index$5 = require('./index-48bdaedf.js');
|
|
19
|
+
var index$4 = require('./index-8939bf9c.js');
|
|
20
|
+
require('./index.styles-a188e8d1.js');
|
|
21
21
|
var hooks = require('@mantine/hooks');
|
|
22
|
-
require('./useMantineLocale-
|
|
23
|
-
var index$9 = require('./index-
|
|
24
|
-
require('./index-
|
|
25
|
-
var index$7 = require('./index-
|
|
26
|
-
require('./other-
|
|
27
|
-
require('./index-
|
|
28
|
-
var utils = require('./utils-
|
|
22
|
+
require('./useMantineLocale-ea75e18c.js');
|
|
23
|
+
var index$9 = require('./index-b6fb060c.js');
|
|
24
|
+
require('./index-93653fad.js');
|
|
25
|
+
var index$7 = require('./index-12e03326.js');
|
|
26
|
+
require('./other-cf7f35bd.js');
|
|
27
|
+
require('./index-167a012a.js');
|
|
28
|
+
var utils = require('./utils-f65a7b4c.js');
|
|
29
29
|
var dates = require('@mantine/dates');
|
|
30
|
-
var usePlacesAutocomplete = require('./usePlacesAutocomplete-
|
|
31
|
-
var index$6 = require('./index-
|
|
32
|
-
var translationsProvider = require('./translationsProvider-
|
|
33
|
-
var Locale = require('./Locale-
|
|
30
|
+
var usePlacesAutocomplete = require('./usePlacesAutocomplete-05dd8d97.js');
|
|
31
|
+
var index$6 = require('./index-59514549.js');
|
|
32
|
+
var translationsProvider = require('./translationsProvider-81557d0c.js');
|
|
33
|
+
var Locale = require('./Locale-66ad336c.js');
|
|
34
34
|
var uuid = require('uuid');
|
|
35
35
|
var PhoneInputBase = require('react-phone-number-input');
|
|
36
36
|
var styled = require('@emotion/styled');
|
|
37
37
|
var miscTheme = require('./miscTheme.js');
|
|
38
38
|
var react = require('@emotion/react');
|
|
39
|
-
var togetherComponentGlobalContext = require('./utils-
|
|
40
|
-
var index$8 = require('./index-
|
|
41
|
-
var useScreenSize = require('./useScreenSize-
|
|
39
|
+
var togetherComponentGlobalContext = require('./utils-33525210.js');
|
|
40
|
+
var index$8 = require('./index-e80694fb.js');
|
|
41
|
+
var useScreenSize = require('./useScreenSize-37357d5a.js');
|
|
42
|
+
var framerMotion = require('framer-motion');
|
|
42
43
|
var ReactDOM = require('react-dom');
|
|
43
|
-
var index$a = require('./index-
|
|
44
|
-
var InputDate = require('./InputDate-
|
|
45
|
-
var index$b = require('./index-
|
|
46
|
-
var Close = require('./Close-
|
|
44
|
+
var index$a = require('./index-953badaa.js');
|
|
45
|
+
var InputDate = require('./InputDate-7293a7d5.js');
|
|
46
|
+
var index$b = require('./index-03928531.js');
|
|
47
|
+
var Close = require('./Close-0537055c.js');
|
|
47
48
|
require('./constantsIsProduction.js');
|
|
48
|
-
require('./normalizeLink-
|
|
49
|
+
require('./normalizeLink-0e61510b.js');
|
|
49
50
|
require('./constantsDomainLocales.js');
|
|
50
51
|
require('@hhgtech/icons/other');
|
|
51
52
|
require('@mantine/carousel');
|
|
52
53
|
require('classnames');
|
|
53
|
-
require('./useUniqueId-
|
|
54
|
+
require('./useUniqueId-0e1c7117.js');
|
|
54
55
|
require('./constantsSite.js');
|
|
55
56
|
require('@hhgtech/icons/core');
|
|
56
57
|
require('@mantine/notifications');
|
|
@@ -67,11 +68,11 @@ require('./i18n-values/tl-PH.js');
|
|
|
67
68
|
require('./i18n-values/vi-VN.js');
|
|
68
69
|
require('./i18n-values/vi-VN_MB.js');
|
|
69
70
|
require('./i18n-values/zh-TW.js');
|
|
70
|
-
require('./index-
|
|
71
|
+
require('./index-7c94b390.js');
|
|
71
72
|
require('slugify');
|
|
72
73
|
require('string-format');
|
|
73
74
|
require('./togetherApiPaths.js');
|
|
74
|
-
require('./constants-
|
|
75
|
+
require('./constants-ba121eb3.js');
|
|
75
76
|
require('vaul');
|
|
76
77
|
|
|
77
78
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -95,8 +96,8 @@ function _interopNamespace(e) {
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
98
|
-
var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
|
|
99
99
|
var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
100
|
+
var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
|
|
100
101
|
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
101
102
|
|
|
102
103
|
const LeadGenComponentContext = React.createContext({});
|
|
@@ -191,20 +192,21 @@ const LEADGEN_ACTIONS = {
|
|
|
191
192
|
SCROLL: 'SCROLL',
|
|
192
193
|
TIME: 'TIME',
|
|
193
194
|
};
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
195
|
+
var LEADGEN_LAYOUT;
|
|
196
|
+
(function (LEADGEN_LAYOUT) {
|
|
197
|
+
LEADGEN_LAYOUT["LightBoxA"] = "LightBoxA";
|
|
198
|
+
LEADGEN_LAYOUT["LightBoxB"] = "LightBoxB";
|
|
199
|
+
LEADGEN_LAYOUT["SkinA"] = "SkinA";
|
|
200
|
+
LEADGEN_LAYOUT["SkinB"] = "SkinB";
|
|
201
|
+
LEADGEN_LAYOUT["Floating"] = "Floating";
|
|
202
|
+
LEADGEN_LAYOUT["Tab"] = "Tab";
|
|
203
|
+
LEADGEN_LAYOUT["InlineA"] = "InlineA";
|
|
204
|
+
LEADGEN_LAYOUT["InlineB"] = "InlineB";
|
|
205
|
+
LEADGEN_LAYOUT["CenterTab"] = "CenterTab";
|
|
206
|
+
LEADGEN_LAYOUT["Sidebar"] = "Sidebar";
|
|
207
|
+
LEADGEN_LAYOUT["Fullscreen"] = "Fullscreen";
|
|
208
|
+
LEADGEN_LAYOUT["Slider"] = "Slider";
|
|
209
|
+
})(LEADGEN_LAYOUT || (LEADGEN_LAYOUT = {}));
|
|
208
210
|
const LEADGEN_BLOCK = {
|
|
209
211
|
TextBlock: 'TextBlock',
|
|
210
212
|
NumberBlock: 'NumberBlock',
|
|
@@ -388,6 +390,18 @@ const formatCampaignDetail = (campaign) => {
|
|
|
388
390
|
}
|
|
389
391
|
};
|
|
390
392
|
|
|
393
|
+
const formatLeadGenFormValue = (values = {}, blocks) => {
|
|
394
|
+
const newValues = {};
|
|
395
|
+
for (const block of blocks) {
|
|
396
|
+
const { data } = block || {};
|
|
397
|
+
const { value: fieldName } = data || {};
|
|
398
|
+
if (fieldName in values) {
|
|
399
|
+
newValues[fieldName] = values[fieldName];
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return newValues;
|
|
403
|
+
};
|
|
404
|
+
|
|
391
405
|
class Store {
|
|
392
406
|
constructor() {
|
|
393
407
|
this.apiSsoUrl = 'https://staging-id.hellobacsi.com/';
|
|
@@ -541,9 +555,9 @@ const getCampaignByCode = (campaign_code) => {
|
|
|
541
555
|
method: METHOD.GET,
|
|
542
556
|
});
|
|
543
557
|
};
|
|
544
|
-
const getSubscriptionBoxInfo = ({ category, site, }) => {
|
|
558
|
+
const getSubscriptionBoxInfo = ({ category, site, slug, }) => {
|
|
545
559
|
return leadApi.call({
|
|
546
|
-
url: `${LEADGEN_API_PATH.V2_SUBSCRIPTION_INFO}?category=${category}&site=${site}`,
|
|
560
|
+
url: `${LEADGEN_API_PATH.V2_SUBSCRIPTION_INFO}?category=${category}&site=${site}&slug=${slug}`,
|
|
547
561
|
method: METHOD.GET,
|
|
548
562
|
});
|
|
549
563
|
};
|
|
@@ -690,7 +704,7 @@ const clearCacheUsedEmailOrPhone = () => {
|
|
|
690
704
|
const [LeadFormProvider$1, useLeadFormContext$1, useLeadForm$1] = form.createFormContext();
|
|
691
705
|
const useLeadFormConfig$1 = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
|
|
692
706
|
const { t } = index$1.useTranslations();
|
|
693
|
-
const initialValues = React.useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
707
|
+
const initialValues = React.useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
694
708
|
React.useEffect(() => {
|
|
695
709
|
if (!window.intlTelInputUtils) {
|
|
696
710
|
require('intl-tel-input/build/js/utils');
|
|
@@ -1006,15 +1020,15 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1006
1020
|
case 'TextBlock':
|
|
1007
1021
|
return (React__default["default"].createElement(index$3.Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "text", placeholder: placeholder, className: cx('leadgen-control', classes.control),
|
|
1008
1022
|
// onChangeRaw={(e) => inputOnChange('text', e)}
|
|
1009
|
-
label: placeholder, "data-control": "text", name: value }, form.getInputProps(value))));
|
|
1023
|
+
label: placeholder, "data-control": "text", "data-lead-control": name, name: value }, form.getInputProps(value))));
|
|
1010
1024
|
case 'NumberBlock':
|
|
1011
1025
|
return (React__default["default"].createElement(index$3.NumberInput, Object.assign({ key: index, withAsterisk: required, spellCheck: false, type: "number", placeholder: placeholder, className: cx('leadgen-control', classes.control),
|
|
1012
1026
|
// onChange={(e) => inputOnChange('number', e)}
|
|
1013
|
-
label: placeholder, "data-control": "number", name: value }, form.getInputProps(value))));
|
|
1027
|
+
label: placeholder, "data-control": "number", "data-lead-control": name, name: value }, form.getInputProps(value))));
|
|
1014
1028
|
case 'EmailBlock':
|
|
1015
1029
|
return (React__default["default"].createElement(index$3.Input, Object.assign({ key: index, withAsterisk: required, spellCheck: false,
|
|
1016
1030
|
// type="email"
|
|
1017
|
-
placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "email", name: value }, form.getInputProps(value))));
|
|
1031
|
+
placeholder: placeholder, className: cx('leadgen-control', classes.control), label: placeholder, "data-control": "email", "data-lead-control": name, name: value }, form.getInputProps(value))));
|
|
1018
1032
|
case 'PhoneOtpBlock':
|
|
1019
1033
|
case 'WhatsappOtpBlock':
|
|
1020
1034
|
case 'ZaloOtpBlock':
|
|
@@ -1029,14 +1043,14 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1029
1043
|
form.setFieldValue(value, v);
|
|
1030
1044
|
},
|
|
1031
1045
|
// onBlur={(e) => inputOnBlur('tel', e)}
|
|
1032
|
-
id: id, defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel" })));
|
|
1046
|
+
id: id, defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name })));
|
|
1033
1047
|
}
|
|
1034
1048
|
case 'LocationBlock': {
|
|
1035
1049
|
return (React__default["default"].createElement(LocationBlock, { key: index, name: value, placeholder: placeholder, locale: locale, required: required }));
|
|
1036
1050
|
}
|
|
1037
1051
|
case 'DateBlock':
|
|
1038
1052
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1039
|
-
React__default["default"].createElement(index$5.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))),
|
|
1053
|
+
React__default["default"].createElement(index$5.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))),
|
|
1040
1054
|
React__default["default"].createElement("input", { type: "hidden", name: value, "data-control": "date" })));
|
|
1041
1055
|
case 'LinkButtonBlock':
|
|
1042
1056
|
return (React__default["default"].createElement("div", { key: index },
|
|
@@ -1054,14 +1068,14 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1054
1068
|
display: 'flex',
|
|
1055
1069
|
flexDirection: 'column',
|
|
1056
1070
|
gap: 8,
|
|
1057
|
-
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default["default"].createElement(index$3.Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
|
|
1071
|
+
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default["default"].createElement(index$3.Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox", "data-lead-control": name }))))));
|
|
1058
1072
|
case 'RadioBlock':
|
|
1059
1073
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1060
1074
|
isSendMailChimp && (React__default["default"].createElement(index$3.Input, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
|
|
1061
|
-
React__default["default"].createElement(index$3.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["default"].createElement(index$3.Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
1075
|
+
React__default["default"].createElement(index$3.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["default"].createElement(index$3.Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio", "data-lead-control": name }))))));
|
|
1062
1076
|
case 'DropdownBlock':
|
|
1063
1077
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1064
|
-
React__default["default"].createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
1078
|
+
React__default["default"].createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown', "data-lead-control": name }),
|
|
1065
1079
|
React__default["default"].createElement(index$3.Select, Object.assign({ key: index, className: cx('leadgen-control', classes.control), label: placeholder, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
|
|
1066
1080
|
value: l.value,
|
|
1067
1081
|
label: l.placeholder,
|
|
@@ -1069,7 +1083,7 @@ const Fields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmit, style
|
|
|
1069
1083
|
case 'TncBlock':
|
|
1070
1084
|
const tncInputProps = form.getInputProps('TNC-' + b.id);
|
|
1071
1085
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1072
|
-
React__default["default"].createElement(index$3.Checkbox, Object.assign({ name: 'TNC-' + b.id, key: b.id, label: React__default["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 }))));
|
|
1086
|
+
React__default["default"].createElement(index$3.Checkbox, Object.assign({ name: 'TNC-' + b.id, key: b.id, label: React__default["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 }))));
|
|
1073
1087
|
}
|
|
1074
1088
|
return null;
|
|
1075
1089
|
})));
|
|
@@ -1102,7 +1116,9 @@ const Heading = (_a) => {
|
|
|
1102
1116
|
const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps, submitProps, }) => {
|
|
1103
1117
|
var _a;
|
|
1104
1118
|
const { primaryColor } = React.useContext(LeadGenContext$1);
|
|
1105
|
-
const { listBlockAdded, leadFormConfig: { form, validateObj }, validatingEmailRef, validatingPhoneRef,
|
|
1119
|
+
const { listBlockAdded, leadFormConfig: { form, validateObj }, validatingEmailRef, validatingPhoneRef,
|
|
1120
|
+
// formRef,
|
|
1121
|
+
setFormRef, onClose, onOtherSubmit, actionBlocks, locale, setShowOtpPhone, onSubmit, } = React.useContext(LeadGenComponentContext);
|
|
1106
1122
|
const { classes, cx } = useStyles$1(undefined, {
|
|
1107
1123
|
name: 'LeadGen__FormComponent',
|
|
1108
1124
|
styles,
|
|
@@ -1163,7 +1179,7 @@ const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps,
|
|
|
1163
1179
|
var _a;
|
|
1164
1180
|
const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
|
|
1165
1181
|
if (respMessage === 'This phone number was verified') {
|
|
1166
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
1182
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
1167
1183
|
return;
|
|
1168
1184
|
}
|
|
1169
1185
|
setShowOtpPhone(newShowOtpPhone);
|
|
@@ -1173,7 +1189,7 @@ const FormComponent = ({ styles, className, classNames, fillInfo, popoverProps,
|
|
|
1173
1189
|
});
|
|
1174
1190
|
return;
|
|
1175
1191
|
}
|
|
1176
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
1192
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
1177
1193
|
})(e);
|
|
1178
1194
|
}, 100);
|
|
1179
1195
|
};
|
|
@@ -1343,10 +1359,13 @@ const OtpBlockComponent = ({ otpData, onSuccess, autoSendWhenOpen, className, st
|
|
|
1343
1359
|
};
|
|
1344
1360
|
const OtpBlock$1 = (_a) => {
|
|
1345
1361
|
var rest = tslib_es6.__rest(_a, []);
|
|
1346
|
-
const { showOtpPhone, setShowOtpPhone, onSubmit,
|
|
1362
|
+
const { showOtpPhone, setShowOtpPhone, onSubmit,
|
|
1363
|
+
// formRef,
|
|
1364
|
+
// leadFormConfig: { form },
|
|
1365
|
+
} = React.useContext(LeadGenComponentContext);
|
|
1347
1366
|
return showOtpPhone ? (React__default["default"].createElement(OtpBlockComponent, Object.assign({ otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
|
|
1348
1367
|
setShowOtpPhone(null);
|
|
1349
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
1368
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
1350
1369
|
} }, rest))) : null;
|
|
1351
1370
|
};
|
|
1352
1371
|
|
|
@@ -2095,6 +2114,7 @@ const LeadGenContextProvider = (props) => {
|
|
|
2095
2114
|
Service.getSubscriptionBoxInfo({
|
|
2096
2115
|
category: categoryId,
|
|
2097
2116
|
site: site_domain,
|
|
2117
|
+
slug: location === null || location === void 0 ? void 0 : location.pathname,
|
|
2098
2118
|
}).then((res) => {
|
|
2099
2119
|
const { _data } = res || {};
|
|
2100
2120
|
const { item, campaign_code } = _data || {};
|
|
@@ -2148,7 +2168,7 @@ const [LeadFormProvider, useLeadFormContext, useLeadForm] = form.createFormConte
|
|
|
2148
2168
|
const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, format, }) => {
|
|
2149
2169
|
var _a;
|
|
2150
2170
|
const { t } = index$1.useTranslations();
|
|
2151
|
-
const initialValues = React.useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
2171
|
+
const initialValues = React.useMemo(() => formatLeadGenFormValue(mappingSSOToLead(userInfo), listBlockAdded), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
2152
2172
|
const LEAD_LOCALE = LEAD_LOCALE_DATA[(_a = document === null || document === void 0 ? void 0 : document.documentElement) === null || _a === void 0 ? void 0 : _a.lang] ||
|
|
2153
2173
|
LEAD_LOCALE_DATA['vi-VN'];
|
|
2154
2174
|
const validateObj = React.useMemo(() => {
|
|
@@ -2310,7 +2330,7 @@ const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validating
|
|
|
2310
2330
|
}, {});
|
|
2311
2331
|
}, [listBlockAdded.map((b) => b.name).join(','), format]);
|
|
2312
2332
|
const form = useLeadForm({
|
|
2313
|
-
validateInputOnChange:
|
|
2333
|
+
validateInputOnChange: false,
|
|
2314
2334
|
validateInputOnBlur: true,
|
|
2315
2335
|
clearInputErrorOnChange: true,
|
|
2316
2336
|
validate: validateObj,
|
|
@@ -2383,15 +2403,14 @@ const StyledLeadGenSubscriptionBoxBody = styled__default["default"].div `
|
|
|
2383
2403
|
}
|
|
2384
2404
|
`;
|
|
2385
2405
|
const StyledLeadGenSubscriptionBoxHeaderImage = styled__default["default"].div `
|
|
2386
|
-
margin-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
height: 44px;
|
|
2406
|
+
margin-left: 8px;
|
|
2407
|
+
width: 80px;
|
|
2408
|
+
height: 68px;
|
|
2390
2409
|
|
|
2391
2410
|
img {
|
|
2392
2411
|
width: 100%;
|
|
2393
2412
|
height: 100%;
|
|
2394
|
-
object-
|
|
2413
|
+
object-fit: contain;
|
|
2395
2414
|
onject-position: center;
|
|
2396
2415
|
}
|
|
2397
2416
|
|
|
@@ -2401,29 +2420,39 @@ const StyledLeadGenSubscriptionBoxHeaderImage = styled__default["default"].div `
|
|
|
2401
2420
|
`;
|
|
2402
2421
|
const StyledLeadGenSubscriptionBoxHeader = styled__default["default"].div `
|
|
2403
2422
|
display: flex;
|
|
2404
|
-
align-items:
|
|
2423
|
+
align-items: start;
|
|
2405
2424
|
margin-bottom: 16px;
|
|
2406
2425
|
.leadgen-title {
|
|
2407
2426
|
margin-bottom: 0;
|
|
2408
2427
|
flex: 1;
|
|
2409
2428
|
min-width: 0;
|
|
2410
|
-
color: ${miscTheme.theme.colors.
|
|
2411
|
-
font-size:
|
|
2429
|
+
color: ${miscTheme.theme.colors.gray600};
|
|
2430
|
+
font-size: 17px;
|
|
2412
2431
|
font-weight: 400;
|
|
2413
|
-
line-height:
|
|
2432
|
+
line-height: 24px;
|
|
2414
2433
|
letter-spacing: -0.4px;
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2434
|
+
b {
|
|
2435
|
+
color: #111111;
|
|
2436
|
+
font-weight: 700;
|
|
2437
|
+
}
|
|
2438
|
+
${utils$1.MediaQueries.mbUp} {
|
|
2439
|
+
font-size: 20px;
|
|
2440
|
+
line-height: 28px;
|
|
2441
|
+
b {
|
|
2442
|
+
font-weight: 500;
|
|
2443
|
+
}
|
|
2421
2444
|
}
|
|
2422
2445
|
}
|
|
2423
2446
|
`;
|
|
2424
2447
|
const StyledLeadGenSubscriptionBox = styled__default["default"].div `
|
|
2425
2448
|
padding: 16px;
|
|
2426
2449
|
border: 1px solid ${miscTheme.theme.colors.neutral100};
|
|
2450
|
+
background: linear-gradient(
|
|
2451
|
+
180.71deg,
|
|
2452
|
+
#7bc2ff -18.54%,
|
|
2453
|
+
#e3f2ff 17.12%,
|
|
2454
|
+
#ffffff 99.25%
|
|
2455
|
+
);
|
|
2427
2456
|
border-radius: 12px;
|
|
2428
2457
|
margin-inline: auto;
|
|
2429
2458
|
.leadgen-form_inputs {
|
|
@@ -2457,6 +2486,7 @@ const StyledLeadGenSubscriptionBox = styled__default["default"].div `
|
|
|
2457
2486
|
margin-left: 8px;
|
|
2458
2487
|
width: auto;
|
|
2459
2488
|
min-height: 56px;
|
|
2489
|
+
font-size: 16px;
|
|
2460
2490
|
}
|
|
2461
2491
|
}
|
|
2462
2492
|
}
|
|
@@ -2496,16 +2526,64 @@ const PhoneInput = React.forwardRef((props, ref) => {
|
|
|
2496
2526
|
React__default["default"].createElement(index$3.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" })))));
|
|
2497
2527
|
});
|
|
2498
2528
|
|
|
2499
|
-
const
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2529
|
+
const NoData = ({ className, style }) => {
|
|
2530
|
+
return (React__default["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 },
|
|
2531
|
+
React__default["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" }),
|
|
2532
|
+
React__default["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" }),
|
|
2533
|
+
React__default["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)" }),
|
|
2534
|
+
React__default["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" }),
|
|
2535
|
+
React__default["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" }),
|
|
2536
|
+
React__default["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" }),
|
|
2537
|
+
React__default["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" }),
|
|
2538
|
+
React__default["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" }),
|
|
2539
|
+
React__default["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" }),
|
|
2540
|
+
React__default["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" }),
|
|
2541
|
+
React__default["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" }),
|
|
2542
|
+
React__default["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" }),
|
|
2543
|
+
React__default["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" }),
|
|
2544
|
+
React__default["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" }),
|
|
2545
|
+
React__default["default"].createElement("defs", null,
|
|
2546
|
+
React__default["default"].createElement("linearGradient", { id: "paint0_linear_2578_27197", x1: "32.6517", y1: "25.3966", x2: "32.6517", y2: "47.1455", gradientUnits: "userSpaceOnUse" },
|
|
2547
|
+
React__default["default"].createElement("stop", { stopColor: "#FDFEFF" }),
|
|
2548
|
+
React__default["default"].createElement("stop", { offset: "0.9964", stopColor: "#ECF0F5" })))));
|
|
2549
|
+
};
|
|
2550
|
+
|
|
2551
|
+
const libraries = ['places'];
|
|
2552
|
+
const GoogleLocationBlock = (props) => {
|
|
2553
|
+
var _a;
|
|
2554
|
+
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = tslib_es6.__rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
2555
|
+
const [LoadScript, setLoadScript] = React.useState(null);
|
|
2556
|
+
const [value, setValue] = React.useState(defaultValue || valueProps);
|
|
2557
|
+
const { predictions } = usePlacesAutocomplete.usePlacesAutocomplete(value, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
|
|
2558
|
+
const onChangeAutocomplete = React.useCallback((s) => {
|
|
2559
|
+
setValue(s);
|
|
2560
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
2561
|
+
}, []);
|
|
2562
|
+
const onClickItem = React.useCallback((item) => {
|
|
2563
|
+
/** For sure get value */
|
|
2564
|
+
setValue(item.value);
|
|
2565
|
+
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
2566
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
2567
|
+
}, [onChangeProps, predictions]);
|
|
2568
|
+
React.useEffect(() => {
|
|
2569
|
+
setValue(valueProps);
|
|
2570
|
+
}, [valueProps]);
|
|
2571
|
+
React.useEffect(() => {
|
|
2572
|
+
var _a, _b, _c;
|
|
2573
|
+
// only load extra google script when not yet loaded
|
|
2574
|
+
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) {
|
|
2575
|
+
Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@react-google-maps/api')); }).then((m) => {
|
|
2576
|
+
setLoadScript(() => m.LoadScript);
|
|
2577
|
+
});
|
|
2506
2578
|
}
|
|
2507
|
-
}
|
|
2508
|
-
return
|
|
2579
|
+
}, []);
|
|
2580
|
+
return (React__default["default"].createElement(core.Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
2581
|
+
return { value: pred.description, label: pred.description };
|
|
2582
|
+
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: index$7.ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
2583
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2584
|
+
LoadScript && (React__default["default"].createElement(LoadScript, { googleMapsApiKey: usePlacesAutocomplete.GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default["default"].createElement(React__default["default"].Fragment, null), style: { width: '100%' } })),
|
|
2585
|
+
children));
|
|
2586
|
+
} }, restProps)));
|
|
2509
2587
|
};
|
|
2510
2588
|
|
|
2511
2589
|
const StyledLeadGenFormInner = styled__default["default"].div `
|
|
@@ -2844,17 +2922,22 @@ const TextField$1 = (props) => {
|
|
|
2844
2922
|
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
|
|
2845
2923
|
});
|
|
2846
2924
|
const [shrink, setShrink] = React.useState(shrinkProps);
|
|
2925
|
+
const focusInput = (target) => {
|
|
2926
|
+
const $textEl = target.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
|
|
2927
|
+
const $focusEl = $textEl.item($textEl.length - 1);
|
|
2928
|
+
if ($focusEl) {
|
|
2929
|
+
$focusEl.focus({ preventScroll: true });
|
|
2930
|
+
}
|
|
2931
|
+
};
|
|
2847
2932
|
const onClick = React.useCallback((e) => {
|
|
2848
|
-
setShrink(true);
|
|
2849
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
2850
2933
|
if (shrink) {
|
|
2934
|
+
e.preventDefault();
|
|
2935
|
+
focusInput(e.currentTarget);
|
|
2851
2936
|
return;
|
|
2852
2937
|
}
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
$focusEl.focus();
|
|
2857
|
-
}
|
|
2938
|
+
setShrink(true);
|
|
2939
|
+
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
2940
|
+
focusInput(e.currentTarget);
|
|
2858
2941
|
}, [shrink]);
|
|
2859
2942
|
React.useEffect(() => {
|
|
2860
2943
|
setShrink(shrinkProps);
|
|
@@ -2867,44 +2950,6 @@ const ChoiceField$1 = (props) => {
|
|
|
2867
2950
|
return (React__default["default"].createElement(StyledChoiceFieldContainer$1, Object.assign({ className: core.clsx(className, 'choiceField') }, restProps), children));
|
|
2868
2951
|
};
|
|
2869
2952
|
|
|
2870
|
-
const libraries = ['places'];
|
|
2871
|
-
const GoogleLocationBlock = (props) => {
|
|
2872
|
-
var _a;
|
|
2873
|
-
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = tslib_es6.__rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
2874
|
-
const [LoadScript, setLoadScript] = React.useState(null);
|
|
2875
|
-
const [value, setValue] = React.useState(defaultValue || valueProps);
|
|
2876
|
-
const { predictions } = usePlacesAutocomplete.usePlacesAutocomplete(value, '', locale === 'tl-PH' ? 'en' : (_a = locale === null || locale === void 0 ? void 0 : locale.split('-')) === null || _a === void 0 ? void 0 : _a[0]);
|
|
2877
|
-
const onChangeAutocomplete = React.useCallback((s) => {
|
|
2878
|
-
setValue(s);
|
|
2879
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
2880
|
-
}, []);
|
|
2881
|
-
const onClickItem = React.useCallback((item) => {
|
|
2882
|
-
/** For sure get value */
|
|
2883
|
-
setValue(item.value);
|
|
2884
|
-
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
2885
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
2886
|
-
}, [onChangeProps, predictions]);
|
|
2887
|
-
React.useEffect(() => {
|
|
2888
|
-
setValue(valueProps);
|
|
2889
|
-
}, [valueProps]);
|
|
2890
|
-
React.useEffect(() => {
|
|
2891
|
-
var _a, _b, _c;
|
|
2892
|
-
// only load extra google script when not yet loaded
|
|
2893
|
-
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) {
|
|
2894
|
-
Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@react-google-maps/api')); }).then((m) => {
|
|
2895
|
-
setLoadScript(() => m.LoadScript);
|
|
2896
|
-
});
|
|
2897
|
-
}
|
|
2898
|
-
}, []);
|
|
2899
|
-
return (React__default["default"].createElement(core.Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
2900
|
-
return { value: pred.description, label: pred.description };
|
|
2901
|
-
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: index$7.ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
2902
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2903
|
-
LoadScript && (React__default["default"].createElement(LoadScript, { googleMapsApiKey: usePlacesAutocomplete.GOOGLE_API_KEY, libraries: libraries, loadingElement: React__default["default"].createElement(React__default["default"].Fragment, null), style: { width: '100%' } })),
|
|
2904
|
-
children));
|
|
2905
|
-
} }, restProps)));
|
|
2906
|
-
};
|
|
2907
|
-
|
|
2908
2953
|
const LeadGenForm = React.forwardRef((props, ref) => {
|
|
2909
2954
|
const { locale, blocks, scrollToErrorField = true, form: formProps, rules: validate, initialValues, onFinish, onFinishFailed, className, style, } = props;
|
|
2910
2955
|
const formRef = React.useRef(null);
|
|
@@ -2958,52 +3003,73 @@ const LeadGenForm = React.forwardRef((props, ref) => {
|
|
|
2958
3003
|
return (React__default["default"].createElement("form", { ref: formRef, onSubmit: form$1.onSubmit(middlewareFinish, middlewareFinishFailed), className: className, style: style },
|
|
2959
3004
|
React__default["default"].createElement(StyledLeadGenFormInner, { className: "leadgen-form_inputs" }, blocks.map((block, idx) => {
|
|
2960
3005
|
const { id, name: blockName, data } = block;
|
|
2961
|
-
const { placeholder, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
|
|
3006
|
+
const { placeholder: label, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
|
|
2962
3007
|
const formInputProps = form$1.getInputProps(name);
|
|
2963
3008
|
const { value, error } = formInputProps;
|
|
2964
3009
|
const reactKey = `${id}-${idx}`;
|
|
2965
3010
|
switch (blockName) {
|
|
2966
3011
|
case LEADGEN_BLOCK.TextBlock: {
|
|
2967
3012
|
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2968
|
-
React__default["default"].createElement(core.TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label:
|
|
3013
|
+
React__default["default"].createElement(core.TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "text", "data-control": "text" }, formInputProps))));
|
|
2969
3014
|
}
|
|
2970
3015
|
case LEADGEN_BLOCK.NumberBlock: {
|
|
2971
3016
|
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2972
|
-
React__default["default"].createElement(core.NumberInput, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label:
|
|
3017
|
+
React__default["default"].createElement(core.NumberInput, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "number", "data-control": "number" }, formInputProps))));
|
|
2973
3018
|
}
|
|
2974
3019
|
case LEADGEN_BLOCK.EmailBlock: {
|
|
2975
3020
|
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2976
|
-
React__default["default"].createElement(core.TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label:
|
|
3021
|
+
React__default["default"].createElement(core.TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, "data-control": "email" }, formInputProps))));
|
|
2977
3022
|
}
|
|
2978
3023
|
case LEADGEN_BLOCK.PhoneOtpBlock:
|
|
2979
3024
|
case LEADGEN_BLOCK.WhatsappOtpBlock:
|
|
2980
3025
|
case LEADGEN_BLOCK.ZaloOtpBlock:
|
|
2981
3026
|
case LEADGEN_BLOCK.PhoneBlock: {
|
|
2982
3027
|
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2983
|
-
React__default["default"].createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label:
|
|
3028
|
+
React__default["default"].createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), type: "text", "data-control": "tel" }, formInputProps))));
|
|
2984
3029
|
}
|
|
2985
3030
|
case LEADGEN_BLOCK.LocationBlock: {
|
|
2986
3031
|
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2987
|
-
React__default["default"].createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label:
|
|
3032
|
+
React__default["default"].createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label: label, placeholder: " ", inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, locale: locale, "data-control": "text" }, formInputProps))));
|
|
2988
3033
|
}
|
|
2989
3034
|
case LEADGEN_BLOCK.DateBlock: {
|
|
2990
3035
|
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2991
|
-
React__default["default"].createElement(dates.DateInput, Object.assign({ locale: (utils.MAPPED_LOCALE === null || utils.MAPPED_LOCALE === void 0 ? void 0 : utils.MAPPED_LOCALE[locale]) || utils.MAPPED_LOCALE['vi-VN'], valueFormat: "DD/MM/YYYY", name: name, withAsterisk: required, label:
|
|
3036
|
+
React__default["default"].createElement(dates.DateInput, Object.assign({ locale: (utils.MAPPED_LOCALE === null || utils.MAPPED_LOCALE === void 0 ? void 0 : utils.MAPPED_LOCALE[locale]) || utils.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))));
|
|
2992
3037
|
}
|
|
2993
3038
|
case LEADGEN_BLOCK.DropdownBlock:
|
|
2994
3039
|
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2995
3040
|
React__default["default"].createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
2996
|
-
React__default["default"].createElement(core.Select, Object.assign({ name: name, withAsterisk: required, label:
|
|
3041
|
+
React__default["default"].createElement(core.Select, Object.assign({ name: name, withAsterisk: required, label: label, placeholder: " ", searchable: true, data: listQuestion.map((l) => ({
|
|
2997
3042
|
value: l.value,
|
|
2998
3043
|
label: l.placeholder,
|
|
2999
|
-
}))
|
|
3044
|
+
})), nothingFound: React__default["default"].createElement(NoData, null), styles: {
|
|
3045
|
+
item: {
|
|
3046
|
+
paddingBlock: 12,
|
|
3047
|
+
paddingInline: 10,
|
|
3048
|
+
fontSize: 16,
|
|
3049
|
+
lineHeight: 1.5,
|
|
3050
|
+
},
|
|
3051
|
+
nothingFound: {
|
|
3052
|
+
fontSize: 54,
|
|
3053
|
+
paddingBlock: 30,
|
|
3054
|
+
},
|
|
3055
|
+
itemsWrapper: {
|
|
3056
|
+
padding: 6,
|
|
3057
|
+
},
|
|
3058
|
+
dropdown: {
|
|
3059
|
+
'.mantine-ScrollArea-scrollbar[data-orientation="vertical"]': {
|
|
3060
|
+
'--radix-scroll-area-thumb-width': '6px',
|
|
3061
|
+
width: 'var(--radix-scroll-area-thumb-width)',
|
|
3062
|
+
paddingInline: 0,
|
|
3063
|
+
},
|
|
3064
|
+
},
|
|
3065
|
+
}, maxDropdownHeight: 192 }, formInputProps))));
|
|
3000
3066
|
case LEADGEN_BLOCK.CheckboxBlock: {
|
|
3001
3067
|
const formInputCheckboxProps = form$1.getInputProps(name, {
|
|
3002
3068
|
type: 'checkbox',
|
|
3003
3069
|
});
|
|
3004
3070
|
return (React__default["default"].createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
3005
3071
|
isSendMailChimp && (React__default["default"].createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
3006
|
-
React__default["default"].createElement(core.Checkbox.Group, Object.assign({ size: "md", withAsterisk: required, label:
|
|
3072
|
+
React__default["default"].createElement(core.Checkbox.Group, Object.assign({ size: "md", withAsterisk: required, label: label, value: value, sx: {
|
|
3007
3073
|
display: 'flex',
|
|
3008
3074
|
flexDirection: 'column',
|
|
3009
3075
|
flexWrap: 'wrap',
|
|
@@ -3015,7 +3081,7 @@ const LeadGenForm = React.forwardRef((props, ref) => {
|
|
|
3015
3081
|
case LEADGEN_BLOCK.RadioBlock: {
|
|
3016
3082
|
return (React__default["default"].createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
3017
3083
|
isSendMailChimp && (React__default["default"].createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
3018
|
-
React__default["default"].createElement(core.Radio.Group, Object.assign({ size: "md", withAsterisk: required, label:
|
|
3084
|
+
React__default["default"].createElement(core.Radio.Group, Object.assign({ size: "md", withAsterisk: required, label: label, value: value, spellCheck: true, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
|
|
3019
3085
|
return (React__default["default"].createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
3020
3086
|
} }, formInputProps), listQuestion.map((l, _index) => (React__default["default"].createElement(core.Radio, { name: name, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
3021
3087
|
}
|
|
@@ -3050,8 +3116,8 @@ const LeadGenSubscriptionBoxA = (props) => {
|
|
|
3050
3116
|
}, [title]);
|
|
3051
3117
|
return (React__default["default"].createElement(StyledLeadGenSubscriptionBoxA, { className: "subcription_box_A" },
|
|
3052
3118
|
React__default["default"].createElement(StyledLeadGenSubscriptionBoxHeader, { className: "leadgen-subscription_box_header" },
|
|
3053
|
-
|
|
3054
|
-
|
|
3119
|
+
titleComp,
|
|
3120
|
+
imageComp),
|
|
3055
3121
|
React__default["default"].createElement(StyledLeadGenSubscriptionBoxBody, { className: "leadgen-subscription_box_body" },
|
|
3056
3122
|
React__default["default"].createElement(LeadGenForm, { ref: formRef, form: form, rules: rules, blocks: blocks, locale: locale, onFinish: onFinish, className: "leadgen-subscription_box_form" }),
|
|
3057
3123
|
React__default["default"].createElement(core.Button, { disabled: loading, loading: loading, variant: "filled", size: "lg", onClick: () => {
|
|
@@ -3634,6 +3700,182 @@ const useViewportDimensions = () => {
|
|
|
3634
3700
|
return React.useMemo(() => (Object.assign({}, dimensions)), [dimensions.height, dimensions.width]);
|
|
3635
3701
|
};
|
|
3636
3702
|
|
|
3703
|
+
const StyledLeadGenLightBoxBFooter = styled__default["default"].div `
|
|
3704
|
+
padding-top: calc(var(--spacing-y, 20px) * 8 / 20);
|
|
3705
|
+
padding-inline: var(--spacing-x, 20px);
|
|
3706
|
+
padding-bottom: var(--spacing-y, 20px);
|
|
3707
|
+
`;
|
|
3708
|
+
const StyledLeadGenLightBoxBBody = styled__default["default"].div `
|
|
3709
|
+
flex: 1;
|
|
3710
|
+
min-height: 0;
|
|
3711
|
+
overflow: auto;
|
|
3712
|
+
padding-inline: var(--spacing-y, 20px);
|
|
3713
|
+
padding-block: calc(var(--spacing-x, 20px) * 8 / 20);
|
|
3714
|
+
&::-webkit-scrollbar {
|
|
3715
|
+
width: 6px;
|
|
3716
|
+
height: 6px;
|
|
3717
|
+
}
|
|
3718
|
+
|
|
3719
|
+
&::-webkit-scrollbar-track {
|
|
3720
|
+
background-color: transparent;
|
|
3721
|
+
}
|
|
3722
|
+
|
|
3723
|
+
&::-webkit-scrollbar-thumb {
|
|
3724
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
3725
|
+
border-radius: 6px;
|
|
3726
|
+
}
|
|
3727
|
+
`;
|
|
3728
|
+
const StyledLeadGenLightBoxBHeader = styled__default["default"].div `
|
|
3729
|
+
display: flex;
|
|
3730
|
+
padding-top: var(--spacing-y, 20px);
|
|
3731
|
+
padding-inline: var(--spacing-x, 20px);
|
|
3732
|
+
padding-bottom: calc(var(--spacing-y, 20px) * 8 / 20);
|
|
3733
|
+
`;
|
|
3734
|
+
const StyledLeadGenLightBoxBWrapper = styled__default["default"].div `
|
|
3735
|
+
height: 100%;
|
|
3736
|
+
display: flex;
|
|
3737
|
+
flex-direction: column;
|
|
3738
|
+
`;
|
|
3739
|
+
const StyledLeadGenLightBoxB = styled__default["default"].div `
|
|
3740
|
+
--spacing-x: 20px;
|
|
3741
|
+
--spacing-y: 20px;
|
|
3742
|
+
--close-width: 24px;
|
|
3743
|
+
--close-height: 24px;
|
|
3744
|
+
|
|
3745
|
+
// For old version, Wrap every thing in children
|
|
3746
|
+
&[data-type='LightBoxB_typeA'] {
|
|
3747
|
+
height: 100%;
|
|
3748
|
+
width: 100%;
|
|
3749
|
+
.leadgen-wrapper,
|
|
3750
|
+
.leadgen-inner,
|
|
3751
|
+
.leadgen-form {
|
|
3752
|
+
height: 100%;
|
|
3753
|
+
}
|
|
3754
|
+
.leadgen-content {
|
|
3755
|
+
height: 100%;
|
|
3756
|
+
display: flex;
|
|
3757
|
+
flex-direction: column;
|
|
3758
|
+
}
|
|
3759
|
+
.leadgen-header {
|
|
3760
|
+
display: none;
|
|
3761
|
+
}
|
|
3762
|
+
.leadgen-title {
|
|
3763
|
+
padding-right: calc(var(--close-width, 24px) * 50 / 24);
|
|
3764
|
+
}
|
|
3765
|
+
.leadgen-description {
|
|
3766
|
+
display: none;
|
|
3767
|
+
}
|
|
3768
|
+
.leadgen-body {
|
|
3769
|
+
flex: 1;
|
|
3770
|
+
min-height: 0;
|
|
3771
|
+
}
|
|
3772
|
+
|
|
3773
|
+
.leadgen-close_btn {
|
|
3774
|
+
top: var(--spacing-y, 20px);
|
|
3775
|
+
right: var(--spacing-x, 20px);
|
|
3776
|
+
width: var(--close-width, 24px) !important;
|
|
3777
|
+
height: var(--close-height, 24px);
|
|
3778
|
+
box-shadow: none;
|
|
3779
|
+
font-size: 24px;
|
|
3780
|
+
}
|
|
3781
|
+
|
|
3782
|
+
.leadgen-empty_footer {
|
|
3783
|
+
.leadgen-btn {
|
|
3784
|
+
flex: 1;
|
|
3785
|
+
min-width: 0;
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
|
|
3789
|
+
.leadgen-form_body {
|
|
3790
|
+
overflow: auto;
|
|
3791
|
+
animation: scrolling forwards;
|
|
3792
|
+
animation-timeline: scroll(self);
|
|
3793
|
+
}
|
|
3794
|
+
@keyframes scrolling {
|
|
3795
|
+
0%,
|
|
3796
|
+
to {
|
|
3797
|
+
border-bottom: 1px solid ${miscTheme.theme.colors.neutral100};
|
|
3798
|
+
}
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
`;
|
|
3802
|
+
const StyledMotionContainer = styled__default["default"](framerMotion.motion.div) `
|
|
3803
|
+
position: fixed;
|
|
3804
|
+
inset: 0;
|
|
3805
|
+
z-index: ${index$7.ZINDEX_SSO + 1};
|
|
3806
|
+
background-color: #fff;
|
|
3807
|
+
`;
|
|
3808
|
+
|
|
3809
|
+
const PREFIX_CLS = 'LightBoxB_typeA';
|
|
3810
|
+
const DURATION = 1000 * 0.5;
|
|
3811
|
+
const DRAWER_STYLE = {
|
|
3812
|
+
visible: {
|
|
3813
|
+
opacity: 1,
|
|
3814
|
+
translateY: '0px',
|
|
3815
|
+
transitionProperty: 'translate',
|
|
3816
|
+
transitionDuration: '0.25s',
|
|
3817
|
+
},
|
|
3818
|
+
hidden: {
|
|
3819
|
+
opacity: 0,
|
|
3820
|
+
translateY: '100%',
|
|
3821
|
+
transitionProperty: 'translate',
|
|
3822
|
+
transitionDuration: '0.25s',
|
|
3823
|
+
},
|
|
3824
|
+
};
|
|
3825
|
+
const LeadGenLightBoxBTypeA = (props) => {
|
|
3826
|
+
const { visible, onVisible, icon, title, buttonText, blocks, children } = props, restProps = tslib_es6.__rest(props, ["visible", "onVisible", "icon", "title", "buttonText", "blocks", "children"]);
|
|
3827
|
+
const formRef = React.useRef();
|
|
3828
|
+
const [open, setOpen] = React.useState(visible);
|
|
3829
|
+
const { height } = useViewportDimensions();
|
|
3830
|
+
usePreventScroll();
|
|
3831
|
+
const onOpenChange = React.useCallback((open) => {
|
|
3832
|
+
if (!open) {
|
|
3833
|
+
// Wait for duration of animation
|
|
3834
|
+
setTimeout(() => {
|
|
3835
|
+
onVisible === null || onVisible === void 0 ? void 0 : onVisible(open);
|
|
3836
|
+
}, DURATION);
|
|
3837
|
+
return;
|
|
3838
|
+
}
|
|
3839
|
+
onVisible === null || onVisible === void 0 ? void 0 : onVisible(open);
|
|
3840
|
+
}, [onVisible]);
|
|
3841
|
+
const iconComp = React.useMemo(() => {
|
|
3842
|
+
if (!icon) {
|
|
3843
|
+
return null;
|
|
3844
|
+
}
|
|
3845
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
3846
|
+
}, [icon]);
|
|
3847
|
+
const titleComp = React.useMemo(() => {
|
|
3848
|
+
if (!title) {
|
|
3849
|
+
return null;
|
|
3850
|
+
}
|
|
3851
|
+
return title;
|
|
3852
|
+
}, [title]);
|
|
3853
|
+
const childrenComp = React.useMemo(() => {
|
|
3854
|
+
if (children) {
|
|
3855
|
+
return children;
|
|
3856
|
+
}
|
|
3857
|
+
return (React__default["default"].createElement(StyledLeadGenLightBoxBWrapper, { className: `${PREFIX_CLS}_wrapper lightboxB_wrapper` },
|
|
3858
|
+
React__default["default"].createElement(StyledLeadGenLightBoxBHeader, { className: `${PREFIX_CLS}_header lightboxB_header` },
|
|
3859
|
+
React__default["default"].createElement("div", { className: "lightBoxB_header_icon" }, iconComp),
|
|
3860
|
+
React__default["default"].createElement("div", { className: "lightBoxB_header_title" }, titleComp),
|
|
3861
|
+
React__default["default"].createElement("div", { className: "lightBoxB_header_close", onClick: () => onOpenChange(false) },
|
|
3862
|
+
React__default["default"].createElement(CloseButton, null))),
|
|
3863
|
+
React__default["default"].createElement(StyledLeadGenLightBoxBBody, { className: `${PREFIX_CLS}_body lightboxB_body` },
|
|
3864
|
+
React__default["default"].createElement(LeadGenForm, Object.assign({ ref: formRef, blocks: blocks }, restProps))),
|
|
3865
|
+
React__default["default"].createElement(StyledLeadGenLightBoxBFooter, { className: `${PREFIX_CLS}_footer lightboxB_footer` },
|
|
3866
|
+
React__default["default"].createElement(index$4.Button, { onClick: () => { var _a; return (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit(); } }, buttonText))));
|
|
3867
|
+
}, [children, onOpenChange]);
|
|
3868
|
+
React.useEffect(() => {
|
|
3869
|
+
setOpen(visible);
|
|
3870
|
+
}, [visible]);
|
|
3871
|
+
return (React__default["default"].createElement(StyledMotionContainer, { animate: open ? 'visible' : 'hidden', variants: DRAWER_STYLE },
|
|
3872
|
+
React__default["default"].createElement(StyledLeadGenLightBoxB, { "data-type": "LightBoxB_typeA", style: height ? { maxHeight: height } : undefined }, childrenComp)));
|
|
3873
|
+
};
|
|
3874
|
+
|
|
3875
|
+
const LeadGenLightBoxB = (props) => {
|
|
3876
|
+
return React__default["default"].createElement(LeadGenLightBoxBTypeA, Object.assign({}, props));
|
|
3877
|
+
};
|
|
3878
|
+
|
|
3637
3879
|
const ThankyouPopup = ({ title, titleAlign, subtitle, subtitleAlign, link, linkNewTab, linkText, image, }) => {
|
|
3638
3880
|
const { primaryColor } = React.useContext(LeadGenContext$1);
|
|
3639
3881
|
const { width: imageWidth, height: imageHeight, loaded: imageLoaded, } = useImageSize(image);
|
|
@@ -4003,6 +4245,7 @@ const StyledTextFieldContainer = styled__default["default"].div `
|
|
|
4003
4245
|
outline: none !important;
|
|
4004
4246
|
border: none;
|
|
4005
4247
|
box-shadow: none;
|
|
4248
|
+
font-size: var(--input, 15px);
|
|
4006
4249
|
padding: 0 var(--phone-input-space-x, 8px);
|
|
4007
4250
|
opacity: 0;
|
|
4008
4251
|
color: ${miscTheme.theme.colors.gray800} !important;
|
|
@@ -4122,17 +4365,22 @@ const TextField = (props) => {
|
|
|
4122
4365
|
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
|
|
4123
4366
|
});
|
|
4124
4367
|
const [shrink, setShrink] = React.useState(shrinkProps);
|
|
4368
|
+
const focusInput = (target) => {
|
|
4369
|
+
const $textEl = target.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
|
|
4370
|
+
const $focusEl = $textEl.item($textEl.length - 1);
|
|
4371
|
+
if ($focusEl) {
|
|
4372
|
+
$focusEl.focus({ preventScroll: true });
|
|
4373
|
+
}
|
|
4374
|
+
};
|
|
4125
4375
|
const onClick = React.useCallback((e) => {
|
|
4126
|
-
setShrink(true);
|
|
4127
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
4128
4376
|
if (shrink) {
|
|
4377
|
+
e.preventDefault();
|
|
4378
|
+
focusInput(e.currentTarget);
|
|
4129
4379
|
return;
|
|
4130
4380
|
}
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
$focusEl.focus();
|
|
4135
|
-
}
|
|
4381
|
+
setShrink(true);
|
|
4382
|
+
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
4383
|
+
focusInput(e.currentTarget);
|
|
4136
4384
|
}, [shrink]);
|
|
4137
4385
|
React.useEffect(() => {
|
|
4138
4386
|
setShrink(shrinkProps);
|
|
@@ -4159,7 +4407,7 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4159
4407
|
return (React__default["default"].createElement(React__default["default"].Fragment, null, listBlockAdded.map((b, index) => {
|
|
4160
4408
|
var _a;
|
|
4161
4409
|
const { name = '', data = {}, id } = b || {};
|
|
4162
|
-
const { placeholder, value, align, listQuestion, isSendMailChimp = false, newtab, url, } = data;
|
|
4410
|
+
const { placeholder: label, value, align, listQuestion, isSendMailChimp = false, newtab, url, } = data;
|
|
4163
4411
|
const required = (_a = data.required) !== null && _a !== void 0 ? _a : true;
|
|
4164
4412
|
const formValue = (formValues === null || formValues === void 0 ? void 0 : formValues[value]) || null;
|
|
4165
4413
|
switch (name) {
|
|
@@ -4169,23 +4417,23 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4169
4417
|
return (React__default["default"].createElement(SubtitleBlock, { key: index, align: align }, value));
|
|
4170
4418
|
case 'TextBlock':
|
|
4171
4419
|
return (React__default["default"].createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4172
|
-
React__default["default"].createElement(core.TextInput, Object.assign({ withAsterisk: required, spellCheck: false, type: "text", placeholder:
|
|
4420
|
+
React__default["default"].createElement(core.TextInput, Object.assign({ withAsterisk: required, spellCheck: false, type: "text", placeholder: " ",
|
|
4173
4421
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4174
4422
|
// onChangeRaw={(e) => inputOnChange('text', e)}
|
|
4175
|
-
label:
|
|
4423
|
+
label: label, "data-control": "text", "data-lead-control": 'TextBlock', inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value), { name: value }))));
|
|
4176
4424
|
case 'NumberBlock':
|
|
4177
4425
|
return (React__default["default"].createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4178
|
-
React__default["default"].createElement(core.NumberInput, Object.assign({ withAsterisk: required, spellCheck: false, type: "number", placeholder:
|
|
4426
|
+
React__default["default"].createElement(core.NumberInput, Object.assign({ withAsterisk: required, spellCheck: false, type: "number", placeholder: " ",
|
|
4179
4427
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4180
4428
|
// onChange={(e) => inputOnChange('number', e)}
|
|
4181
|
-
label:
|
|
4429
|
+
label: label, "data-control": "number", "data-lead-control": name, name: value, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
|
|
4182
4430
|
case 'EmailBlock':
|
|
4183
4431
|
return (React__default["default"].createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4184
4432
|
React__default["default"].createElement(core.TextInput, Object.assign({ withAsterisk: required, spellCheck: false,
|
|
4185
4433
|
// type="email"
|
|
4186
|
-
placeholder:
|
|
4434
|
+
placeholder: " ",
|
|
4187
4435
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4188
|
-
label:
|
|
4436
|
+
label: label, "data-control": "email", "data-lead-control": name, name: value, inputWrapperOrder: ['label', 'input', 'description', 'error'] }, form.getInputProps(value)))));
|
|
4189
4437
|
case 'PhoneOtpBlock':
|
|
4190
4438
|
case 'WhatsappOtpBlock':
|
|
4191
4439
|
case 'ZaloOtpBlock':
|
|
@@ -4195,20 +4443,20 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4195
4443
|
return (React__default["default"].createElement(TextField, { key: index, shrink: !!formValue, className: core.clsx('lead-modal__form-control leadgen-form_field', {
|
|
4196
4444
|
'leadgen-form_field_error': !!error,
|
|
4197
4445
|
}) },
|
|
4198
|
-
React__default["default"].createElement(core.Input.Wrapper, { size: "md", withAsterisk: required, label:
|
|
4446
|
+
React__default["default"].createElement(core.Input.Wrapper, { size: "md", withAsterisk: required, label: label, "data-invalid": !!error, labelProps: { htmlFor: htmlForId }, inputWrapperOrder: ['label', 'input', 'description', 'error'], error: error },
|
|
4199
4447
|
React__default["default"].createElement("div", { className: "mantine-Input-wrapper" },
|
|
4200
|
-
React__default["default"].createElement(index$3.Phone, Object.assign({ className: "mantine-Input-input", name: value, spellCheck: false, type: "tel", placeholder:
|
|
4448
|
+
React__default["default"].createElement(index$3.Phone, Object.assign({ className: "mantine-Input-input", name: value, spellCheck: false, type: "tel", placeholder: " ",
|
|
4201
4449
|
// onBlur={(e) => inputOnBlur('tel', e)}
|
|
4202
|
-
id: htmlForId, defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel" }, formPhoneInputWrapper))))));
|
|
4450
|
+
id: htmlForId, defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), "data-control": "tel", "data-lead-control": name }, formPhoneInputWrapper))))));
|
|
4203
4451
|
}
|
|
4204
4452
|
case 'LocationBlock': {
|
|
4205
4453
|
return (React__default["default"].createElement(TextField, { key: index, shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field" },
|
|
4206
|
-
React__default["default"].createElement(GoogleLocationBlock, Object.assign({ withAsterisk: required, name: value, placeholder:
|
|
4454
|
+
React__default["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)))));
|
|
4207
4455
|
}
|
|
4208
4456
|
case 'DateBlock': {
|
|
4209
4457
|
const _c = form.getInputProps(value), { error } = _c, formInputProps = tslib_es6.__rest(_c, ["error"]);
|
|
4210
|
-
return (React__default["default"].createElement(core.Input.Wrapper, { key: index, size: "md", withAsterisk: required, label:
|
|
4211
|
-
React__default["default"].createElement(InputDate.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))));
|
|
4458
|
+
return (React__default["default"].createElement(core.Input.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" },
|
|
4459
|
+
React__default["default"].createElement(InputDate.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))));
|
|
4212
4460
|
}
|
|
4213
4461
|
case 'LinkButtonBlock':
|
|
4214
4462
|
return (React__default["default"].createElement("div", { key: index },
|
|
@@ -4224,38 +4472,59 @@ const LightboxFields = ({ listBlockAdded, popupId, locale, onClose, onOtherSubmi
|
|
|
4224
4472
|
}, "data-name": value + '-mailchimp' })),
|
|
4225
4473
|
React__default["default"].createElement(index$3.Checkbox.Group, Object.assign({ withAsterisk: required,
|
|
4226
4474
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4227
|
-
label:
|
|
4475
|
+
label: label, size: "md", sx: {
|
|
4228
4476
|
display: 'flex',
|
|
4229
4477
|
flexDirection: 'column',
|
|
4230
4478
|
flexWrap: 'wrap',
|
|
4231
4479
|
gap: 8,
|
|
4232
4480
|
}, inputWrapperOrder: ['label', 'input', 'description', 'error'], inputContainer: (children) => {
|
|
4233
4481
|
return (React__default["default"].createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
4234
|
-
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default["default"].createElement(index$3.Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
|
|
4482
|
+
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default["default"].createElement(index$3.Checkbox, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "checkbox", "data-lead-control": name }))))));
|
|
4235
4483
|
case 'RadioBlock':
|
|
4236
4484
|
return (React__default["default"].createElement(ChoiceField, { className: "leadgen-form_radio", key: index },
|
|
4237
4485
|
isSendMailChimp && (React__default["default"].createElement(core.Input, { type: "hidden", name: value + '-mailchimp', value: isSendMailChimp })),
|
|
4238
4486
|
React__default["default"].createElement(index$3.Radio.Group, Object.assign({ withAsterisk: required,
|
|
4239
4487
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4240
|
-
label:
|
|
4488
|
+
label: label, size: "md", inputWrapperOrder: ['label', 'input', 'description', 'error'], inputContainer: (children) => {
|
|
4241
4489
|
return (React__default["default"].createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
4242
|
-
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default["default"].createElement(index$3.Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
4490
|
+
} }, form.getInputProps(value)), listQuestion.map((l, _index) => (React__default["default"].createElement(index$3.Radio, { name: value, key: _index, value: l.value, label: l.placeholder, "data-control": "radio", "data-lead-control": name }))))));
|
|
4243
4491
|
case 'DropdownBlock':
|
|
4244
|
-
return (React__default["default"].createElement(TextField, { shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field", key: index },
|
|
4245
|
-
React__default["default"].createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
4492
|
+
return (React__default["default"].createElement(TextField, { shrink: !!formValue, className: "lead-modal__form-control leadgen-form_field DropdownBlock", key: index },
|
|
4493
|
+
React__default["default"].createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown', "data-lead-control": name }),
|
|
4246
4494
|
React__default["default"].createElement(index$3.Select
|
|
4247
4495
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4248
4496
|
, Object.assign({
|
|
4249
4497
|
// className="lead-modal__form-control leadgen-form_field"
|
|
4250
|
-
label:
|
|
4498
|
+
label: label, placeholder: " ", searchable: true, withAsterisk: required, name: value, data: listQuestion.map((l) => ({
|
|
4251
4499
|
value: l.value,
|
|
4252
4500
|
label: l.placeholder,
|
|
4253
|
-
}))
|
|
4501
|
+
})), nothingFound: React__default["default"].createElement(NoData, null), styles: {
|
|
4502
|
+
item: {
|
|
4503
|
+
paddingBlock: 12,
|
|
4504
|
+
paddingInline: 10,
|
|
4505
|
+
fontSize: 16,
|
|
4506
|
+
lineHeight: 1.5,
|
|
4507
|
+
},
|
|
4508
|
+
nothingFound: {
|
|
4509
|
+
fontSize: 54,
|
|
4510
|
+
paddingBlock: 30,
|
|
4511
|
+
},
|
|
4512
|
+
itemsWrapper: {
|
|
4513
|
+
padding: 6,
|
|
4514
|
+
},
|
|
4515
|
+
dropdown: {
|
|
4516
|
+
'.mantine-ScrollArea-scrollbar[data-orientation="vertical"]': {
|
|
4517
|
+
'--radix-scroll-area-thumb-width': '6px',
|
|
4518
|
+
width: 'var(--radix-scroll-area-thumb-width)',
|
|
4519
|
+
paddingInline: 0,
|
|
4520
|
+
},
|
|
4521
|
+
},
|
|
4522
|
+
}, maxDropdownHeight: 192 }, form.getInputProps(value)))));
|
|
4254
4523
|
case 'TncBlock':
|
|
4255
4524
|
const _d = form.getInputProps(`TNC-${id}`), { error } = _d, tncInputProps = tslib_es6.__rest(_d, ["error"]);
|
|
4256
4525
|
return (React__default["default"].createElement(ChoiceField, { className: "leadgen-form_checkbox", key: id },
|
|
4257
4526
|
React__default["default"].createElement(core.Input.Wrapper, { error: error },
|
|
4258
|
-
React__default["default"].createElement(index$3.Checkbox, Object.assign({ name: 'TNC-' + id, label: React__default["default"].createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, tncInputProps)))));
|
|
4527
|
+
React__default["default"].createElement(index$3.Checkbox, Object.assign({ name: 'TNC-' + id, label: React__default["default"].createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: data.valueHTML } }), className: "tnc-block", "data-control": "checkbox", "data-lead-control": name }, tncInputProps)))));
|
|
4259
4528
|
}
|
|
4260
4529
|
return null;
|
|
4261
4530
|
})));
|
|
@@ -4503,7 +4772,9 @@ const LEADGEN_SHOW_HEADER = [
|
|
|
4503
4772
|
LEADGEN_LAYOUT.Sidebar,
|
|
4504
4773
|
LEADGEN_LAYOUT.Slider,
|
|
4505
4774
|
];
|
|
4506
|
-
const
|
|
4775
|
+
// const CAMPAGE_CODE_LIST_APPLY_NEW_UI = ['ri3lkoxcetjoj39', 'u0adw7hw8kw7t89']
|
|
4776
|
+
const CAMPAGE_CODE_LIST_APPLY_NEW_UI = ['ri3lkoxcetjoj39'];
|
|
4777
|
+
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, }) => {
|
|
4507
4778
|
var _a, _b;
|
|
4508
4779
|
const { primaryColor } = React.useContext(LeadGenContext$1);
|
|
4509
4780
|
const { isMobile } = useScreenSize.useScreenSize();
|
|
@@ -4511,17 +4782,25 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4511
4782
|
const [showOtpPhone, setShowOtpPhone] = React.useState(null);
|
|
4512
4783
|
const [isSubmitLoading, setIsSubmitLoading] = React.useState(false);
|
|
4513
4784
|
const [snap, setSnap] = React.useState(0.8);
|
|
4785
|
+
const isTrackedForm = React.useRef(false);
|
|
4514
4786
|
const formRef = React.useRef();
|
|
4787
|
+
const [lastFormRef, setLastFormRef] = React.useState();
|
|
4515
4788
|
const onClose = () => {
|
|
4516
4789
|
if (showOtpPhone) {
|
|
4517
4790
|
setShowOtpPhone(null);
|
|
4518
4791
|
}
|
|
4519
4792
|
else {
|
|
4520
|
-
onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp(
|
|
4793
|
+
onCloseProp === null || onCloseProp === void 0 ? void 0 : onCloseProp({
|
|
4794
|
+
formValues: form.values,
|
|
4795
|
+
formActiveTime: formActiveTime.current,
|
|
4796
|
+
formRef: formRef.current,
|
|
4797
|
+
listBlockAdded,
|
|
4798
|
+
});
|
|
4521
4799
|
}
|
|
4522
4800
|
};
|
|
4523
4801
|
const { height } = useViewportDimensions();
|
|
4524
4802
|
usePreventScroll();
|
|
4803
|
+
const formActiveTime = React.useRef(0);
|
|
4525
4804
|
const textBlocks = JSON.parse(extraFields.textBlocks);
|
|
4526
4805
|
const listBlockAdded = JSON.parse(extraFields.listBlockAdded);
|
|
4527
4806
|
const actionBlocks = JSON.parse(extraFields.actionBlocks);
|
|
@@ -4538,6 +4817,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4538
4817
|
const isFullscreen = currentLayout === LEADGEN_LAYOUT.Fullscreen;
|
|
4539
4818
|
const isInPage = isInline || isSidebar;
|
|
4540
4819
|
const isDrawer = isLightBoxB && isMobile;
|
|
4820
|
+
const isNewUI = React.useMemo(() => CAMPAGE_CODE_LIST_APPLY_NEW_UI.includes(campaignCode), [campaignCode]);
|
|
4541
4821
|
const limitFieldsLightBoxB = isLightBoxB && listBlockAdded.length <= LEADGEN_LIMIT_LIGHTBOXB;
|
|
4542
4822
|
const hasForm = isLightBoxA
|
|
4543
4823
|
? listBlockAdded.some((item) => LEADGEN_BLOCK_INPUT.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
|
|
@@ -4546,6 +4826,17 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4546
4826
|
const showHeader = !!imageMobile || !!imageDesktop;
|
|
4547
4827
|
const onlyHeader = !title && !description;
|
|
4548
4828
|
const showButtonClose = !isInline;
|
|
4829
|
+
const validatingPhoneRef = React.useRef(false);
|
|
4830
|
+
const validatingEmailRef = React.useRef(false);
|
|
4831
|
+
const { form, validateObj } = useLeadFormConfig({
|
|
4832
|
+
listBlockAdded,
|
|
4833
|
+
validatingPhoneRef,
|
|
4834
|
+
validatingEmailRef,
|
|
4835
|
+
campaignId,
|
|
4836
|
+
campaign_subot_id,
|
|
4837
|
+
userInfo,
|
|
4838
|
+
format: (_a = (index$7.ISO_FORMAT[locale] || index$7.ISO_FORMAT['vi-VN'])) === null || _a === void 0 ? void 0 : _a.dateFormat,
|
|
4839
|
+
});
|
|
4549
4840
|
if (window.innerWidth < 769 &&
|
|
4550
4841
|
LEADGEN_LAYOUT_NOT_SHOW_IN_MOBILE.includes(currentLayout)) {
|
|
4551
4842
|
console.log('😎 Not show fullscreen, slider on mobile ');
|
|
@@ -4560,17 +4851,33 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4560
4851
|
}
|
|
4561
4852
|
clearCacheUsedEmailOrPhone();
|
|
4562
4853
|
}, []);
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4854
|
+
React.useEffect(() => {
|
|
4855
|
+
formRef.current && setLastFormRef(formRef.current);
|
|
4856
|
+
}, [formRef.current]);
|
|
4857
|
+
React.useEffect(() => {
|
|
4858
|
+
const handleBeforeUnload = () => {
|
|
4859
|
+
!isTrackedForm.current &&
|
|
4860
|
+
!showThankyou &&
|
|
4861
|
+
(onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount({
|
|
4862
|
+
formValues: form.values,
|
|
4863
|
+
formActiveTime: formActiveTime.current,
|
|
4864
|
+
formRef: lastFormRef,
|
|
4865
|
+
listBlockAdded,
|
|
4866
|
+
}));
|
|
4867
|
+
};
|
|
4868
|
+
window.addEventListener('beforeunload', handleBeforeUnload);
|
|
4869
|
+
return () => window.removeEventListener('beforeunload', handleBeforeUnload);
|
|
4870
|
+
}, [lastFormRef, form.values, showThankyou]);
|
|
4871
|
+
React.useEffect(() => {
|
|
4872
|
+
let intervalId = null;
|
|
4873
|
+
if (isLightBox && !showThankyou) {
|
|
4874
|
+
intervalId = setInterval(() => {
|
|
4875
|
+
formActiveTime.current += 1;
|
|
4876
|
+
// console.log({ formActiveTime: formActiveTime.current })
|
|
4877
|
+
}, 1000);
|
|
4878
|
+
}
|
|
4879
|
+
return () => clearInterval(intervalId);
|
|
4880
|
+
}, [showThankyou]);
|
|
4574
4881
|
const listBlockAddedRequired = React.useMemo(() => leadGenFieldRequired(listBlockAdded), listBlockAdded);
|
|
4575
4882
|
const disabledButtonSubmit = React.useMemo(() => {
|
|
4576
4883
|
if (listBlockAddedRequired.length) {
|
|
@@ -4580,10 +4887,46 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4580
4887
|
}, [...listBlockAddedRequired.map((k) => form.values[k])]);
|
|
4581
4888
|
const onFocus = (e) => {
|
|
4582
4889
|
e.preventDefault();
|
|
4583
|
-
|
|
4584
|
-
const
|
|
4585
|
-
|
|
4586
|
-
|
|
4890
|
+
function scrollIntoView() {
|
|
4891
|
+
const $Input = e.target;
|
|
4892
|
+
const $TextField = $Input.closest('.leadgen-form_field');
|
|
4893
|
+
const scrollIntoView = {
|
|
4894
|
+
block: 'center',
|
|
4895
|
+
behavior: 'auto',
|
|
4896
|
+
};
|
|
4897
|
+
if ($TextField.classList.contains('DropdownBlock')) {
|
|
4898
|
+
scrollIntoView.block = 'start';
|
|
4899
|
+
const tfOffsetTop = ($TextField === null || $TextField === void 0 ? void 0 : $TextField.offsetTop) || 0;
|
|
4900
|
+
const tfHeight = $TextField.clientHeight;
|
|
4901
|
+
const $ScrollableElement = getParentScroll($TextField);
|
|
4902
|
+
if ($ScrollableElement) {
|
|
4903
|
+
// https://hhgdev.atlassian.net/browse/EL-682
|
|
4904
|
+
const scrollHeight = $ScrollableElement.scrollHeight;
|
|
4905
|
+
if (scrollHeight - (tfOffsetTop + tfHeight) < 192) {
|
|
4906
|
+
scrollIntoView.block = 'end';
|
|
4907
|
+
}
|
|
4908
|
+
}
|
|
4909
|
+
}
|
|
4910
|
+
if (isMobile) {
|
|
4911
|
+
window.scrollTo(0, 0);
|
|
4912
|
+
}
|
|
4913
|
+
$TextField.scrollIntoView(scrollIntoView);
|
|
4914
|
+
}
|
|
4915
|
+
let time = 0;
|
|
4916
|
+
function requestFrame(timestamp) {
|
|
4917
|
+
if (time === 0) {
|
|
4918
|
+
time = timestamp;
|
|
4919
|
+
}
|
|
4920
|
+
if (timestamp - time <= 250) {
|
|
4921
|
+
requestAnimationFrame(requestFrame);
|
|
4922
|
+
}
|
|
4923
|
+
else {
|
|
4924
|
+
scrollIntoView();
|
|
4925
|
+
}
|
|
4926
|
+
}
|
|
4927
|
+
if (isMobile) {
|
|
4928
|
+
requestAnimationFrame(requestFrame);
|
|
4929
|
+
}
|
|
4587
4930
|
};
|
|
4588
4931
|
const middlewareOnSubmit = (e) => {
|
|
4589
4932
|
e.preventDefault();
|
|
@@ -4640,7 +4983,12 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4640
4983
|
var _a;
|
|
4641
4984
|
const respMessage = (_a = res === null || res === void 0 ? void 0 : res._messages) === null || _a === void 0 ? void 0 : _a[0];
|
|
4642
4985
|
if (respMessage === 'This phone number was verified') {
|
|
4643
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
4986
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
4987
|
+
formValues: v,
|
|
4988
|
+
formActiveTime: formActiveTime.current,
|
|
4989
|
+
formRef: formRef.current,
|
|
4990
|
+
listBlockAdded,
|
|
4991
|
+
});
|
|
4644
4992
|
return;
|
|
4645
4993
|
}
|
|
4646
4994
|
setShowOtpPhone(newShowOtpPhone);
|
|
@@ -4650,7 +4998,12 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4650
4998
|
});
|
|
4651
4999
|
return;
|
|
4652
5000
|
}
|
|
4653
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
5001
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
5002
|
+
formValues: v,
|
|
5003
|
+
formActiveTime: formActiveTime.current,
|
|
5004
|
+
formRef: formRef.current,
|
|
5005
|
+
listBlockAdded,
|
|
5006
|
+
});
|
|
4654
5007
|
})(e);
|
|
4655
5008
|
}, 100);
|
|
4656
5009
|
};
|
|
@@ -4696,7 +5049,12 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4696
5049
|
React__default["default"].createElement(LightboxFields, { listBlockAdded: listBlockAdded, popupId: popupId, locale: locale, onClose: onClose, onOtherSubmit: onOtherSubmit }))))));
|
|
4697
5050
|
const PopupOtp = showOtpPhone && (React__default["default"].createElement(OtpBlock, { otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
|
|
4698
5051
|
setShowOtpPhone(null);
|
|
4699
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(
|
|
5052
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit({
|
|
5053
|
+
formValues: form.values,
|
|
5054
|
+
formActiveTime: formActiveTime.current,
|
|
5055
|
+
formRef: formRef.current,
|
|
5056
|
+
listBlockAdded,
|
|
5057
|
+
});
|
|
4700
5058
|
} }));
|
|
4701
5059
|
const PopupThankYou = showThankyou && (React__default["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 }));
|
|
4702
5060
|
const PopupContent = (React__default["default"].createElement("div", { className: core.clsx('leadgen-content', {
|
|
@@ -4731,18 +5089,13 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
4731
5089
|
'leadgen-inline': isInPage,
|
|
4732
5090
|
'leadgen-slider': isSlider,
|
|
4733
5091
|
});
|
|
4734
|
-
const PopupContainer = isDrawer ? (
|
|
4735
|
-
// <LeadGenLightBoxB
|
|
4736
|
-
// form={form}
|
|
4737
|
-
// loading={isSubmitLoading}
|
|
4738
|
-
// visible={open}
|
|
4739
|
-
// onVisible={() => onOpenChange(false)}
|
|
4740
|
-
// >
|
|
4741
|
-
// {PopupWrapper}
|
|
4742
|
-
// </LeadGenLightBoxB>
|
|
4743
|
-
React__default["default"].createElement(index$b.DrawerComponent, { fadeFromIndex: index$7.ZINDEX_SSO - 9e6, open: open, snapPoints: [0.8, 1], activeSnapPoint: snap, setActiveSnapPoint: setSnap, onOpenChange: onOpenChange, overlayClassName: popupContainerClassName, className: "leadgen-drawer" },
|
|
5092
|
+
const PopupContainer = isDrawer ? (isNewUI ? (React__default["default"].createElement(LeadGenLightBoxB, { form: form, loading: isSubmitLoading, visible: open, onVisible: () => onOpenChange(false) }, PopupWrapper)) : (React__default["default"].createElement(index$b.DrawerComponent, { fadeFromIndex: index$7.ZINDEX_SSO - 9e6, open: open, snapPoints: [0.8, 1], activeSnapPoint: snap, setActiveSnapPoint: setSnap, onOpenChange: onOpenChange, overlayClassName: popupContainerClassName, className: "leadgen-drawer" },
|
|
4744
5093
|
PopupWrapper,
|
|
4745
|
-
React__default["default"].createElement("div", { style: {
|
|
5094
|
+
React__default["default"].createElement("div", { style: {
|
|
5095
|
+
position: 'absolute',
|
|
5096
|
+
inset: 0,
|
|
5097
|
+
zIndex: snap === 1 ? -1 : 1,
|
|
5098
|
+
}, onClick: () => setSnap(1) })))) : (React__default["default"].createElement("div", { id: popupId, "data-popup-url": currentPath, "data-popup-type": "lightbox-inline", className: popupContainerClassName, style: isMobile ? { maxHeight: height } : undefined },
|
|
4746
5099
|
isFullscreen ? (React__default["default"].createElement("img", { className: "le-only-desktop le-fullscreen-img", draggable: false, src: imageBackground || '', style: {
|
|
4747
5100
|
aspectRatio: `${imageBackgroundWidth}/${imageBackgroundHeight}`,
|
|
4748
5101
|
} })) : null,
|
|
@@ -4849,7 +5202,7 @@ function getCategoryLevel(t = 'Xin chao {{category_2}} extra') {
|
|
|
4849
5202
|
return null;
|
|
4850
5203
|
}
|
|
4851
5204
|
}
|
|
4852
|
-
const NewLeadPopup = ({ campaign, action, onSubmit, onClose, showThankyou, locale, showEmpty, setShowEmpty, userInfo, }) => {
|
|
5205
|
+
const NewLeadPopup = ({ campaign, action, onSubmit, onClose, onUnmount, showThankyou, locale, showEmpty, setShowEmpty, userInfo, }) => {
|
|
4853
5206
|
var _a, _b;
|
|
4854
5207
|
const { apiUrl, siteDomain } = React.useContext(LeadGenContext$1);
|
|
4855
5208
|
React.useEffect(() => {
|
|
@@ -4968,7 +5321,7 @@ const NewLeadPopup = ({ campaign, action, onSubmit, onClose, showThankyou, local
|
|
|
4968
5321
|
currentLayout == 'Fullscreen' ||
|
|
4969
5322
|
currentLayout == 'Sidebar' ||
|
|
4970
5323
|
currentLayout == 'Slider') {
|
|
4971
|
-
return (React__default["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: (
|
|
5324
|
+
return (React__default["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 }));
|
|
4972
5325
|
}
|
|
4973
5326
|
else if (currentLayout.includes('Skin')) {
|
|
4974
5327
|
return (React__default["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 }));
|
|
@@ -4976,9 +5329,84 @@ const NewLeadPopup = ({ campaign, action, onSubmit, onClose, showThankyou, local
|
|
|
4976
5329
|
return null;
|
|
4977
5330
|
};
|
|
4978
5331
|
|
|
5332
|
+
const numberFormatType = 2; // i18n.phonenumbers.PhoneNumberFormat.NATIONAL
|
|
5333
|
+
const formatFormData = (currentForm, formData) => {
|
|
5334
|
+
return Object.keys(formData)
|
|
5335
|
+
.filter((key) => !!formData[key])
|
|
5336
|
+
.map((name) => {
|
|
5337
|
+
var _a, _b, _c, _d;
|
|
5338
|
+
const value = String(formData[name]);
|
|
5339
|
+
const control = ((_a = currentForm
|
|
5340
|
+
.querySelector(`*[name="${name}"][data-control]`)) === null || _a === void 0 ? void 0 : _a.getAttribute('data-control')) ||
|
|
5341
|
+
((_b = currentForm
|
|
5342
|
+
.querySelector(`*[data-extra][data-name="${name}"]`)) === null || _b === void 0 ? void 0 : _b.getAttribute('data-control')) ||
|
|
5343
|
+
'text';
|
|
5344
|
+
const leadControl = ((_c = currentForm
|
|
5345
|
+
.querySelector(`*[name="${name}"][data-lead-control]`)) === null || _c === void 0 ? void 0 : _c.getAttribute('data-lead-control')) ||
|
|
5346
|
+
((_d = currentForm
|
|
5347
|
+
.querySelector(`*[data-extra][data-name="${name}"]`)) === null || _d === void 0 ? void 0 : _d.getAttribute('data-lead-control')) ||
|
|
5348
|
+
'text';
|
|
5349
|
+
const formatedValue = control === 'tel'
|
|
5350
|
+
? window.intlTelInputUtils
|
|
5351
|
+
.formatNumber(String(value), LEAD_LOCALE === null || LEAD_LOCALE === void 0 ? void 0 : LEAD_LOCALE.countryCodeNumber, numberFormatType)
|
|
5352
|
+
.replace(/\s+/g, '')
|
|
5353
|
+
: control === 'date'
|
|
5354
|
+
? dayjs__default["default"](value).format('YYYY-MM-DD')
|
|
5355
|
+
: value;
|
|
5356
|
+
return {
|
|
5357
|
+
key: name,
|
|
5358
|
+
value: formatedValue,
|
|
5359
|
+
control,
|
|
5360
|
+
leadControl,
|
|
5361
|
+
// is_sent_mailchimp: currentForm.querySelector(
|
|
5362
|
+
// `div[data-name="${i.name}-mailchimp"]`,
|
|
5363
|
+
// )
|
|
5364
|
+
// ? 'true'
|
|
5365
|
+
// : 'false',
|
|
5366
|
+
};
|
|
5367
|
+
});
|
|
5368
|
+
};
|
|
5369
|
+
|
|
5370
|
+
const formatTrackingData = (params) => {
|
|
5371
|
+
const { formParams = {}, currentLayout, commonData } = params;
|
|
5372
|
+
const { formValues, formActiveTime, listBlockAdded } = formParams;
|
|
5373
|
+
const listFieldHasValue = [];
|
|
5374
|
+
const data = Object.assign(Object.assign({ template_type: currentLayout, time_on_form: [LEADGEN_LAYOUT.LightBoxA, LEADGEN_LAYOUT.LightBoxB].includes(currentLayout)
|
|
5375
|
+
? formActiveTime
|
|
5376
|
+
: 0 }, commonData), { data_input: formValues
|
|
5377
|
+
.map((control) => {
|
|
5378
|
+
const findIndex = listBlockAdded.findIndex((i) => {
|
|
5379
|
+
const compareVal = control.key.startsWith('TNC-')
|
|
5380
|
+
? `TNC-${i.id}`
|
|
5381
|
+
: i.data.value;
|
|
5382
|
+
return compareVal == control.key;
|
|
5383
|
+
});
|
|
5384
|
+
if (findIndex > -1) {
|
|
5385
|
+
const curLeadControl = listBlockAdded[findIndex].name;
|
|
5386
|
+
listFieldHasValue.push(listBlockAdded[findIndex].data.value);
|
|
5387
|
+
return {
|
|
5388
|
+
field_name: control.key,
|
|
5389
|
+
component_type: curLeadControl,
|
|
5390
|
+
value: control.value,
|
|
5391
|
+
};
|
|
5392
|
+
}
|
|
5393
|
+
})
|
|
5394
|
+
.filter(Boolean), data_not_input: listBlockAdded
|
|
5395
|
+
.map((item) => {
|
|
5396
|
+
if (!listFieldHasValue.includes(item.data.value)) {
|
|
5397
|
+
return {
|
|
5398
|
+
field_name: item.data.value,
|
|
5399
|
+
component_type: item.name,
|
|
5400
|
+
};
|
|
5401
|
+
}
|
|
5402
|
+
})
|
|
5403
|
+
.filter(Boolean) });
|
|
5404
|
+
return data;
|
|
5405
|
+
};
|
|
5406
|
+
|
|
4979
5407
|
// mount css
|
|
4980
5408
|
const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor, apiSubotUrl, DEBUG_URL, forceCampaign, children, extraPayloadValues = [], excludeExitRulesHandler, userInfo, onClose: onCloseProps, onSubmit: onSubmitProps, }) => {
|
|
4981
|
-
var _a;
|
|
5409
|
+
var _a, _b;
|
|
4982
5410
|
const scrollEventHandlerRef = React.useRef();
|
|
4983
5411
|
const leadStartTimeRef = React.useRef(Date.now());
|
|
4984
5412
|
const { apiUrl } = React.useMemo(() => {
|
|
@@ -4994,6 +5422,7 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
4994
5422
|
const [action, setAction] = React.useState('');
|
|
4995
5423
|
const [showThankyou, setShowThankyou] = React.useState(null);
|
|
4996
5424
|
const [showEmpty, setShowEmpty] = React.useState(false);
|
|
5425
|
+
const currentLayout = React.useMemo(() => showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.currentLayout, [showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.currentLayout]);
|
|
4997
5426
|
React.useEffect(() => {
|
|
4998
5427
|
if (forceCampaign) {
|
|
4999
5428
|
setShowCampaign(forceCampaign);
|
|
@@ -5016,14 +5445,15 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5016
5445
|
setAction('HIDE');
|
|
5017
5446
|
onCloseProps === null || onCloseProps === void 0 ? void 0 : onCloseProps();
|
|
5018
5447
|
};
|
|
5019
|
-
const onClose = () => {
|
|
5020
|
-
var
|
|
5448
|
+
const onClose = (params) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
5449
|
+
var _c, _d;
|
|
5450
|
+
const { formRef, listBlockAdded, formValues: formDataObj } = params || {};
|
|
5021
5451
|
if (!showCampaign)
|
|
5022
5452
|
return;
|
|
5023
5453
|
LeadLog(`👋👋👋 CLOSE POPUP ${showCampaign.code} 👋👋👋`);
|
|
5024
5454
|
if (!excludeExitRulesHandler) {
|
|
5025
|
-
const showAfterExit = Number((
|
|
5026
|
-
const expiresDay = Number((
|
|
5455
|
+
const showAfterExit = Number((_c = showCampaign.rules.find((rule) => rule.rule == 'show_again_after_exit')) === null || _c === void 0 ? void 0 : _c.value);
|
|
5456
|
+
const expiresDay = Number((_d = showCampaign.rules.find((rule) => rule.rule == 'days_to_show_again')) === null || _d === void 0 ? void 0 : _d.value);
|
|
5027
5457
|
if (showAfterExit == 0) {
|
|
5028
5458
|
if (!expiresDay) {
|
|
5029
5459
|
miscCookieHelper.setCookie(`lead_closed_${showCampaign.code}`, `target_${showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.popupVersion}`, { domain: '.' + siteDomain, path: '/' });
|
|
@@ -5033,21 +5463,56 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5033
5463
|
}
|
|
5034
5464
|
}
|
|
5035
5465
|
}
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5466
|
+
yield Promise.all([
|
|
5467
|
+
fetch(`${apiUrl}api/campaign/${showCampaign.code}/popup_exit`, {
|
|
5468
|
+
method: 'POST',
|
|
5469
|
+
headers: {
|
|
5470
|
+
'Content-Type': 'application/json',
|
|
5471
|
+
},
|
|
5472
|
+
body: JSON.stringify({
|
|
5473
|
+
action: 'CLICK',
|
|
5474
|
+
url: location.href.toLowerCase(),
|
|
5475
|
+
title_article: document.title,
|
|
5476
|
+
cookie_id: miscCookieHelper.getCookie('hhg-id'),
|
|
5477
|
+
duration: Math.ceil((Date.now() - leadStartTimeRef.current) / 1000),
|
|
5478
|
+
}),
|
|
5047
5479
|
}),
|
|
5048
|
-
|
|
5480
|
+
!showThankyou &&
|
|
5481
|
+
trackingCompletionForm({
|
|
5482
|
+
commonData: {
|
|
5483
|
+
cookie_id: miscCookieHelper.getCookie('hhg-id'),
|
|
5484
|
+
ga_client_id: miscCookieHelper.getCookie('_ga') || null,
|
|
5485
|
+
country_code: locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN',
|
|
5486
|
+
status: 'in_progress',
|
|
5487
|
+
campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id,
|
|
5488
|
+
total_fields: listBlockAdded.length,
|
|
5489
|
+
},
|
|
5490
|
+
currentLayout,
|
|
5491
|
+
formParams: Object.assign(Object.assign({}, params), { formValues: formatFormData(formRef, formDataObj) }),
|
|
5492
|
+
}),
|
|
5493
|
+
]);
|
|
5049
5494
|
onCloseBase();
|
|
5050
|
-
};
|
|
5495
|
+
});
|
|
5496
|
+
const onUnmount = (params) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
5497
|
+
const { formRef, listBlockAdded, formValues: formDataObj } = params || {};
|
|
5498
|
+
if ([LEADGEN_LAYOUT.InlineA, LEADGEN_LAYOUT.InlineB].includes(currentLayout) &&
|
|
5499
|
+
Object.keys(formDataObj).length === 0)
|
|
5500
|
+
return;
|
|
5501
|
+
const data = formatTrackingData({
|
|
5502
|
+
commonData: {
|
|
5503
|
+
cookie_id: miscCookieHelper.getCookie('hhg-id'),
|
|
5504
|
+
ga_client_id: miscCookieHelper.getCookie('_ga') || null,
|
|
5505
|
+
country_code: locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN',
|
|
5506
|
+
status: 'in_progress',
|
|
5507
|
+
campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id,
|
|
5508
|
+
total_fields: listBlockAdded.length,
|
|
5509
|
+
},
|
|
5510
|
+
currentLayout,
|
|
5511
|
+
formParams: Object.assign(Object.assign({}, params), { formValues: formatFormData(formRef, formDataObj) }),
|
|
5512
|
+
});
|
|
5513
|
+
const blob = new Blob([JSON.stringify(data)], { type: 'application/json' });
|
|
5514
|
+
navigator.sendBeacon(`${apiUrl}api/collection/tracking-completion`, blob);
|
|
5515
|
+
});
|
|
5051
5516
|
React.useEffect(() => {
|
|
5052
5517
|
if (forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.code)
|
|
5053
5518
|
return;
|
|
@@ -5086,69 +5551,55 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5086
5551
|
DEBUG_URL,
|
|
5087
5552
|
});
|
|
5088
5553
|
}, []);
|
|
5089
|
-
const
|
|
5090
|
-
|
|
5554
|
+
const trackingCompletionForm = React.useCallback((params) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
5555
|
+
const { currentLayout, formParams } = params || {};
|
|
5556
|
+
const { formValues } = formParams;
|
|
5557
|
+
if ([LEADGEN_LAYOUT.InlineA, LEADGEN_LAYOUT.InlineB].includes(currentLayout) &&
|
|
5558
|
+
Object.keys(formValues).length === 0)
|
|
5559
|
+
return;
|
|
5560
|
+
const data = formatTrackingData(params);
|
|
5561
|
+
return fetch(`${apiUrl}api/collection/tracking-completion`, {
|
|
5562
|
+
method: 'POST',
|
|
5563
|
+
headers: {
|
|
5564
|
+
'Content-Type': 'application/json',
|
|
5565
|
+
},
|
|
5566
|
+
body: JSON.stringify(data),
|
|
5567
|
+
});
|
|
5568
|
+
}), [(_a = showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields) === null || _a === void 0 ? void 0 : _a.currentLayout]);
|
|
5569
|
+
const onSubmit = (params, categoryLevel, categoryData) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
5570
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
5571
|
+
const { formRef, listBlockAdded, formValues: formDataObj } = params || {};
|
|
5091
5572
|
if (!formDataObj || Object.values(formDataObj).every((v) => !Boolean(v))) {
|
|
5092
5573
|
setShowEmpty(true);
|
|
5093
5574
|
return;
|
|
5094
5575
|
}
|
|
5095
5576
|
LeadLog('submitHandler', categoryLevel, categoryData);
|
|
5096
|
-
const
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5577
|
+
const formatedFormData = formatFormData(formRef, formDataObj);
|
|
5578
|
+
const formData = formatedFormData.map(({ key, value, control }) => ({
|
|
5579
|
+
key,
|
|
5580
|
+
value,
|
|
5581
|
+
control,
|
|
5101
5582
|
}));
|
|
5102
5583
|
console.log('** RYAN index.tsx 218 formData : ', formData);
|
|
5103
|
-
const numberFormatType = 2; // i18n.phonenumbers.PhoneNumberFormat.NATIONAL
|
|
5104
5584
|
// Get ga_client_id from cookies
|
|
5105
5585
|
const gaCookie = miscCookieHelper.getCookie('_ga') || null;
|
|
5106
5586
|
if (!window.intlTelInputUtils) {
|
|
5107
5587
|
yield require('intl-tel-input/build/js/utils');
|
|
5108
5588
|
}
|
|
5109
|
-
const
|
|
5110
|
-
url: location.href.toLowerCase(),
|
|
5111
|
-
title_article: document.title,
|
|
5112
|
-
meta: [
|
|
5113
|
-
...formData.map((i) => {
|
|
5114
|
-
var _a, _b;
|
|
5115
|
-
const control = ((_a = currentForm
|
|
5116
|
-
.querySelector(`*[name="${i.name}"][data-control]`)) === null || _a === void 0 ? void 0 : _a.getAttribute('data-control')) ||
|
|
5117
|
-
((_b = currentForm
|
|
5118
|
-
.querySelector(`*[data-extra][data-name="${i.name}"]`)) === null || _b === void 0 ? void 0 : _b.getAttribute('data-control')) ||
|
|
5119
|
-
'text';
|
|
5120
|
-
const value = control === 'tel'
|
|
5121
|
-
? window.intlTelInputUtils
|
|
5122
|
-
.formatNumber(String(i.value), LEAD_LOCALE === null || LEAD_LOCALE === void 0 ? void 0 : LEAD_LOCALE.countryCodeNumber, numberFormatType)
|
|
5123
|
-
.replace(/\s+/g, '')
|
|
5124
|
-
: control === 'date'
|
|
5125
|
-
? dayjs__default["default"](i.value).format('YYYY-MM-DD')
|
|
5126
|
-
: i.value;
|
|
5127
|
-
return {
|
|
5128
|
-
key: i.name,
|
|
5129
|
-
value,
|
|
5130
|
-
control,
|
|
5131
|
-
// is_sent_mailchimp: currentForm.querySelector(
|
|
5132
|
-
// `div[data-name="${i.name}-mailchimp"]`,
|
|
5133
|
-
// )
|
|
5134
|
-
// ? 'true'
|
|
5135
|
-
// : 'false',
|
|
5136
|
-
};
|
|
5137
|
-
}),
|
|
5138
|
-
...extraPayloadValues,
|
|
5139
|
-
],
|
|
5589
|
+
const commonData = {
|
|
5140
5590
|
cookie_id: miscCookieHelper.getCookie('hhg-id'),
|
|
5141
5591
|
ga_client_id: gaCookie,
|
|
5142
5592
|
};
|
|
5593
|
+
const data = Object.assign({ url: location.href.toLowerCase(), title_article: document.title, meta: [...formData, ...extraPayloadValues] }, commonData);
|
|
5143
5594
|
// categoryLevel
|
|
5144
5595
|
if (categoryLevel) {
|
|
5145
5596
|
if (categoryData[categoryLevel].value_en) {
|
|
5146
5597
|
data['category'] = categoryData[categoryLevel].value_en;
|
|
5147
5598
|
}
|
|
5148
5599
|
}
|
|
5149
|
-
const expiresDay = Number(((
|
|
5600
|
+
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) ||
|
|
5150
5601
|
7);
|
|
5151
|
-
const showAgain = Number(((
|
|
5602
|
+
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);
|
|
5152
5603
|
if (showAgain == 0) {
|
|
5153
5604
|
LeadLog('⛔ Popup never show again!');
|
|
5154
5605
|
miscCookieHelper.setCookie(`lead_submited_${showCampaign.code}`, `target_${showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.targetType}`, { domain: '.' + siteDomain, path: '/' });
|
|
@@ -5157,13 +5608,20 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5157
5608
|
LeadLog(`⌛ Popup will show again after ${expiresDay} days!`);
|
|
5158
5609
|
miscCookieHelper.setCookie(`lead_submited_${showCampaign.code}`, `target_${showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.targetType}`, { domain: '.' + siteDomain, days: expiresDay, path: '/' });
|
|
5159
5610
|
}
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5611
|
+
yield Promise.all([
|
|
5612
|
+
fetch(`${apiUrl}api/campaign/${showCampaign.code}/lead`, {
|
|
5613
|
+
method: 'POST',
|
|
5614
|
+
headers: {
|
|
5615
|
+
'Content-Type': 'application/json',
|
|
5616
|
+
},
|
|
5617
|
+
body: JSON.stringify(data),
|
|
5618
|
+
}),
|
|
5619
|
+
trackingCompletionForm({
|
|
5620
|
+
commonData: Object.assign(Object.assign({}, commonData), { country_code: locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN', status: 'complete', campaign_id: showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.id, total_fields: listBlockAdded.length }),
|
|
5621
|
+
currentLayout,
|
|
5622
|
+
formParams: Object.assign(Object.assign({}, params), { formValues: formatedFormData }),
|
|
5623
|
+
}),
|
|
5624
|
+
]);
|
|
5167
5625
|
onSubmitProps === null || onSubmitProps === void 0 ? void 0 : onSubmitProps(formDataObj);
|
|
5168
5626
|
if ((showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields.popupShowThankYou) == 'notshow') {
|
|
5169
5627
|
onClose();
|
|
@@ -5182,15 +5640,15 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5182
5640
|
const titleBlock = listBlockThankyou.find((i) => i.name == 'TitleBlock');
|
|
5183
5641
|
const subtitleBlock = listBlockThankyou.find((i) => i.name == 'SubtitleBlock');
|
|
5184
5642
|
const linkButtonBlock = listBlockThankyou.find((i) => i.name == 'LinkButtonBlock');
|
|
5185
|
-
thankTitle = ((
|
|
5186
|
-
titleAlign = ((
|
|
5187
|
-
thankDesc = ((
|
|
5188
|
-
descAlign = ((
|
|
5189
|
-
linkText = ((
|
|
5190
|
-
linkNewTab = ((
|
|
5191
|
-
linkUrl = ((
|
|
5643
|
+
thankTitle = ((_j = titleBlock === null || titleBlock === void 0 ? void 0 : titleBlock.data) === null || _j === void 0 ? void 0 : _j.value) || '';
|
|
5644
|
+
titleAlign = ((_k = titleBlock === null || titleBlock === void 0 ? void 0 : titleBlock.data) === null || _k === void 0 ? void 0 : _k.align) || '';
|
|
5645
|
+
thankDesc = ((_l = subtitleBlock === null || subtitleBlock === void 0 ? void 0 : subtitleBlock.data) === null || _l === void 0 ? void 0 : _l.value) || '';
|
|
5646
|
+
descAlign = ((_m = subtitleBlock === null || subtitleBlock === void 0 ? void 0 : subtitleBlock.data) === null || _m === void 0 ? void 0 : _m.align) || '';
|
|
5647
|
+
linkText = ((_o = linkButtonBlock === null || linkButtonBlock === void 0 ? void 0 : linkButtonBlock.data) === null || _o === void 0 ? void 0 : _o.value) || '';
|
|
5648
|
+
linkNewTab = ((_p = linkButtonBlock === null || linkButtonBlock === void 0 ? void 0 : linkButtonBlock.data) === null || _p === void 0 ? void 0 : _p.newtab) || false;
|
|
5649
|
+
linkUrl = ((_q = linkButtonBlock === null || linkButtonBlock === void 0 ? void 0 : linkButtonBlock.data) === null || _q === void 0 ? void 0 : _q.url) || '';
|
|
5192
5650
|
// ALWAYS SHOW THANK YOU ON COMPOUND COMP
|
|
5193
|
-
// const curLayout =
|
|
5651
|
+
// const curLayout = currentLayout
|
|
5194
5652
|
// TODO: newbuilder thank you
|
|
5195
5653
|
// List layout not show thanks you
|
|
5196
5654
|
// if (
|
|
@@ -5229,7 +5687,7 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5229
5687
|
}
|
|
5230
5688
|
// Submit Inisder Obj
|
|
5231
5689
|
formData.map((data) => {
|
|
5232
|
-
const name = data.
|
|
5690
|
+
const name = data.key;
|
|
5233
5691
|
const value = data.value;
|
|
5234
5692
|
if (name == 'tel') {
|
|
5235
5693
|
window.insider_object.user.phone_number = value;
|
|
@@ -5247,16 +5705,22 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, primaryColor
|
|
|
5247
5705
|
leadStartTimeRef.current = Date.now();
|
|
5248
5706
|
}
|
|
5249
5707
|
}, [showCampaign]);
|
|
5250
|
-
return (React__default["default"].createElement(LeadGenContext$1.Provider, { value: {
|
|
5708
|
+
return (React__default["default"].createElement(LeadGenContext$1.Provider, { value: {
|
|
5709
|
+
primaryColor,
|
|
5710
|
+
apiUrl,
|
|
5711
|
+
siteDomain,
|
|
5712
|
+
siteId,
|
|
5713
|
+
locale,
|
|
5714
|
+
} },
|
|
5251
5715
|
React__default["default"].createElement(translationsContext.TranslationsContext.Provider, { value: { locale, values: getTranslations(locale) } }, children ? (React__default["default"].createElement(Component, { campaign: showCampaign, onSubmit: onSubmit, onClose: onClose, showThankyou: showThankyou, setShowThankyou: setShowThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo }, children)) : (React__default["default"].createElement(core.Portal, { target: utils$1.getPopupWrapperDom() },
|
|
5252
5716
|
React__default["default"].createElement(core.Box, { sx: { position: 'fixed', zIndex: index$7.ZINDEX_SSO - 9e6 } },
|
|
5253
|
-
React__default["default"].createElement(core.Transition, { mounted: Boolean(((
|
|
5717
|
+
React__default["default"].createElement(core.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) => {
|
|
5254
5718
|
var _a;
|
|
5255
5719
|
return (React__default["default"].createElement(core.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["default"].createElement(React__default["default"].Fragment, null,
|
|
5256
|
-
!!
|
|
5257
|
-
!
|
|
5258
|
-
!
|
|
5259
|
-
React__default["default"].createElement(NewLeadPopup, { campaign: showCampaign, action: action, onSubmit: onSubmit, onClose: onClose, showThankyou: showThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo })))));
|
|
5720
|
+
!!currentLayout &&
|
|
5721
|
+
!currentLayout.includes('Inline') &&
|
|
5722
|
+
!currentLayout.includes('Sidebar') && (React__default["default"].createElement(core.Overlay, { color: "#000", opacity: 0.6, center: true, zIndex: 400, pos: 'fixed', onClick: () => onClose() })),
|
|
5723
|
+
React__default["default"].createElement(NewLeadPopup, { campaign: showCampaign, action: action, onSubmit: onSubmit, onClose: onClose, onUnmount: onUnmount, showThankyou: showThankyou, locale: locale, showEmpty: showEmpty, setShowEmpty: setShowEmpty, userInfo: userInfo })))));
|
|
5260
5724
|
})))))));
|
|
5261
5725
|
};
|
|
5262
5726
|
const LeadGen = _LeadGen;
|