@hhgtech/hhg-components 1.29.358-beta-2 → 1.29.358-beta-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{LastPeriod-a8c94819.js → LastPeriod-7ccfd74f.js} +1 -1
- package/build/{MobileBottomNavigationIcon-777ebefa.js → MobileBottomNavigationIcon-06d5ae04.js} +3 -3
- package/build/{Spinner-ce637760.js → Spinner-257993cc.js} +1 -1
- package/build/{WhatsApp-84166109.js → WhatsApp-a9a36fb4.js} +1 -1
- package/build/adapters.js +19 -19
- package/build/atoms.js +47 -47
- package/build/babyGrowth.js +83 -83
- package/build/cache.js +2 -2
- package/build/care.js +17 -17
- package/build/careBookingSearchBar.js +14 -14
- package/build/careBookingSearchBarV2.js +15 -15
- package/build/components/navigationV2/components/molecules/navigationBar/index.styled.d.ts +0 -2
- package/build/components/navigationV2/hooks/useNavConfig.d.ts +0 -1
- package/build/components/navigationV2/types.d.ts +1 -1
- package/build/components.js +95 -95
- package/build/{constants-18511288.js → constants-0bdc9f25.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-f2187dd0.js → core-8ac8e02d.js} +1 -1
- package/build/{dataTransform-fe34ec8c.js → dataTransform-7e404dc3.js} +1 -1
- package/build/ecom.js +4 -4
- package/build/{editor-3ecfc25d.js → editor-922f2014.js} +11 -11
- package/build/embeddedHeathToolCards_babyGrowth.js +23 -23
- package/build/embeddedHeathToolCards_babyPoop.js +19 -19
- package/build/embeddedHeathToolCards_babyVaccine.js +22 -22
- package/build/embeddedHeathToolCards_bmi_bmi.js +25 -25
- package/build/embeddedHeathToolCards_bmrBmr.js +25 -25
- package/build/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
- package/build/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
- package/build/embeddedHeathToolCards_pwg_pwg.js +26 -26
- package/build/embeddedHeathToolCards_targetHeartRate.js +27 -27
- package/build/esm/{LastPeriod-cf115dcc.js → LastPeriod-4147d211.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-0779397f.js → MobileBottomNavigationIcon-2be4c6e4.js} +3 -3
- package/build/esm/{Spinner-61bc8924.js → Spinner-056dac9a.js} +1 -1
- package/build/esm/{WhatsApp-c44d0b90.js → WhatsApp-12d39054.js} +1 -1
- package/build/esm/adapters.js +19 -19
- package/build/esm/atoms.js +47 -47
- package/build/esm/babyGrowth.js +83 -83
- package/build/esm/cache.js +2 -2
- package/build/esm/care.js +17 -17
- package/build/esm/careBookingSearchBar.js +14 -14
- package/build/esm/careBookingSearchBarV2.js +15 -15
- package/build/esm/components/navigationV2/components/molecules/navigationBar/index.styled.d.ts +0 -2
- package/build/esm/components/navigationV2/hooks/useNavConfig.d.ts +0 -1
- package/build/esm/components/navigationV2/types.d.ts +1 -1
- package/build/esm/components.js +95 -95
- package/build/esm/{constants-782dba05.js → constants-aded2345.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-ca75f054.js → core-610a0713.js} +1 -1
- package/build/esm/{dataTransform-6521f3a6.js → dataTransform-bbbc8727.js} +1 -1
- package/build/esm/ecom.js +4 -4
- package/build/esm/{editor-09d2defd.js → editor-6f385a58.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/healthToolsCardWrapper.js +18 -18
- package/build/esm/healthToolsForm.js +33 -33
- package/build/esm/hooks/useCSSFocusPopupHelper.d.ts +0 -1
- 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-82b32324.js → index-07b1acba.js} +10 -10
- package/build/esm/{index-8e9cc872.js → index-0cc8433c.js} +24 -24
- package/build/esm/{index-1de1575d.js → index-11d5337e.js} +2 -2
- package/build/esm/{index-0837bc58.js → index-142b28ed.js} +6 -6
- package/build/esm/{index-f6690d94.js → index-15db6202.js} +4 -4
- package/build/esm/{index-afa718a7.js → index-16e4de05.js} +3 -3
- package/build/esm/{index-8d560a79.js → index-1a90a3f6.js} +21 -21
- package/build/esm/{index-4056f935.js → index-1d2ff7ef.js} +2 -2
- package/build/esm/{index-df0db71b.js → index-2a8407c4.js} +1 -1
- package/build/esm/{index-3cda8f59.js → index-2b73d4df.js} +17 -17
- package/build/esm/{index-65fea711.js → index-30fd9cd2.js} +18 -18
- package/build/esm/{index-5ddb94e4.js → index-364dffea.js} +2 -2
- package/build/esm/{index-9c3974db.js → index-3910a2e2.js} +3 -3
- package/build/esm/{index-58bb5f33.js → index-4298b53e.js} +2 -2
- package/build/esm/{index-83aa11de.js → index-437e6858.js} +1 -1
- package/build/esm/{index-058436c4.js → index-494af598.js} +18 -18
- package/build/esm/{index-8cbad76d.js → index-53d47678.js} +2 -2
- package/build/esm/{index-588acc44.js → index-54536b84.js} +7 -7
- package/build/esm/{index-86b86a00.js → index-555d837a.js} +1 -1
- package/build/esm/{index-00abc3a4.js → index-576efa85.js} +1 -1
- package/build/esm/{index-42e84c71.js → index-5bb7b666.js} +17 -17
- package/build/esm/{index-ed4991de.js → index-66b3f2a6.js} +1 -1
- package/build/esm/{index-2bfe1955.js → index-671b108f.js} +2 -2
- package/build/esm/{index-4e0298e1.js → index-67b04859.js} +6 -6
- package/build/esm/{index-b9cd45c9.js → index-724a1b27.js} +3 -3
- package/build/esm/{index-6c666af1.js → index-77323900.js} +2 -2
- package/build/esm/{index-627a4f4b.js → index-77b5c11e.js} +13 -13
- package/build/esm/{index-1cb1ea20.js → index-7b616d88.js} +1 -1
- package/build/esm/{index-cff3f861.js → index-7b732ec9.js} +16 -16
- package/build/esm/{index-4b210adb.js → index-7c8f3b35.js} +2 -2
- package/build/esm/{index-17b7c39c.js → index-84607991.js} +2 -2
- package/build/esm/{index-d9a740f5.js → index-856a25a9.js} +16 -16
- package/build/esm/{index-1ae052ae.js → index-877935e3.js} +2 -2
- package/build/esm/{index-08c781ad.js → index-88949c86.js} +13 -13
- package/build/esm/{index-e4ed59c2.js → index-8c6e3c64.js} +6 -6
- package/build/esm/{index-038a0780.js → index-93889bf5.js} +31 -31
- package/build/esm/{index-cddbd3cb.js → index-9a853af3.js} +22 -22
- package/build/esm/{index-f2a58af2.js → index-9adae0cb.js} +42 -69
- package/build/esm/{index-c6d2b2bb.js → index-a1718d63.js} +3 -3
- package/build/esm/{index-317fdb9e.js → index-a260d04e.js} +11 -18
- package/build/esm/{index-021da3d3.js → index-a4b4cee3.js} +6 -6
- package/build/esm/{index-9af47657.js → index-a8c3c677.js} +3 -3
- package/build/esm/{index-7705e2ab.js → index-aa86dec2.js} +13 -13
- package/build/esm/{index-869a5f65.js → index-ac88cfac.js} +6 -6
- package/build/esm/{index-d727ef8e.js → index-afc5ac71.js} +15 -15
- package/build/esm/{index-abdc8795.js → index-b571e750.js} +3 -3
- package/build/esm/{index-5130c494.js → index-bd572333.js} +1 -1
- package/build/esm/{index-48e8eac4.js → index-c303ee5b.js} +2 -2
- package/build/esm/{index-d4f73c3a.js → index-c4417fc2.js} +16 -16
- package/build/esm/{index-609bbec5.js → index-c6694d20.js} +2 -2
- package/build/esm/{index-c22d74c9.js → index-c8105b5a.js} +16 -16
- package/build/esm/{index-e8c7d06c.js → index-cc86d927.js} +1 -1
- package/build/esm/{index-024e389e.js → index-dafbe69f.js} +5 -5
- package/build/esm/{index-acd55fd8.js → index-dc3efcdd.js} +2 -2
- package/build/esm/{index-51d3b1a2.js → index-e27abaf3.js} +13 -13
- package/build/esm/{index-09a55759.js → index-e31e2bce.js} +7 -7
- package/build/esm/{index-df34a710.js → index-e438eba2.js} +2 -2
- package/build/esm/{index-9b5c27f6.js → index-e45ce5b8.js} +32 -32
- package/build/esm/{index-a043265d.js → index-edb08ee4.js} +11 -11
- package/build/esm/{index-2e034192.js → index-ee5aca94.js} +16 -16
- package/build/esm/{index-61e22014.js → index-f8a5aa70.js} +24 -24
- package/build/esm/{index-54e0f691.js → index-fac3aff9.js} +17 -17
- package/build/esm/{index-8ad7c579.js → index-fadeb47f.js} +5 -5
- package/build/esm/{index-06be24ca.js → index-fd80e3fb.js} +1 -1
- package/build/esm/index.js +116 -116
- package/build/esm/interfaces/healthTools.d.ts +0 -1
- package/build/esm/{labelSorting-b03b3a60.js → labelSorting-7822659b.js} +4 -4
- package/build/esm/lead/helpers.d.ts +1 -51
- package/build/esm/lead/index.d.ts +1 -2
- package/build/esm/lead/layouts/lightbox/formContainer.d.ts +2 -1
- package/build/esm/lead/services/index.d.ts +0 -14
- package/build/esm/lead.css +1 -1
- package/build/esm/lead.js +328 -1233
- package/build/esm/{logoIcon-34bb52f9.js → logoIcon-daaec4f0.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 +73 -73
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +16 -16
- package/build/esm/navigation.js +45 -45
- package/build/esm/navigationLogoutPopup.js +9 -9
- package/build/esm/navigationProfileButton.js +23 -23
- package/build/esm/onboardingV2.js +29 -29
- package/build/esm/organisms.js +49 -49
- package/build/esm/{post-7c5a495f.js → post-5eab1c5a.js} +2 -2
- package/build/esm/profileNavigation.js +19 -19
- package/build/esm/progressBar.js +1 -1
- package/build/esm/pwg.js +22 -22
- package/build/esm/ssoV2/api/featureFlag.d.ts +1 -2
- package/build/esm/ssoV2/index.d.ts +0 -1
- package/build/esm/ssoV2/utils.d.ts +0 -6
- package/build/esm/ssoV2.js +56 -50
- package/build/esm/{store-ee79c592.js → store-3c9c167a.js} +4 -4
- package/build/esm/subot.js +42 -43
- package/build/esm/surveyOrPremiumBanner.js +31 -31
- package/build/esm/surveyQuestionCard.js +10 -10
- package/build/esm/{surveyThankyouCard-2dd15fcc.js → surveyThankyouCard-91c1a85d.js} +5 -5
- package/build/esm/together.js +55 -55
- package/build/esm/togetherApiUtils.js +4 -4
- package/build/esm/togetherAtoms.js +30 -30
- package/build/esm/togetherComponentGlobalContext.js +4 -4
- package/build/esm/togetherMolecules.js +50 -50
- package/build/esm/togetherMoleculesCardAuthor.js +28 -28
- package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
- package/build/esm/togetherMoleculesProfileDetail.js +38 -38
- package/build/esm/togetherOrganisms.js +49 -49
- package/build/esm/togetherRichTextEditor.js +17 -17
- package/build/esm/togetherShareBox.js +10 -10
- package/build/esm/{treePopoverMenu-7f1da1b2.js → treePopoverMenu-c3a8e676.js} +19 -19
- package/build/esm/{types-a2e79599.js → types-cdbe1e2f.js} +2 -2
- package/build/esm/types.js +2 -2
- package/build/esm/{useCategory-96e95b37.js → useCategory-841e4ad5.js} +5 -5
- package/build/esm/{useHealthToolCache-95003973.js → useHealthToolCache-e5e3d7b4.js} +1 -1
- package/build/esm/{useMantineLocale-61a713dc.js → useMantineLocale-5d6ca417.js} +6 -6
- package/build/esm/{usePlacesAutocomplete-b79b68b2.js → usePlacesAutocomplete-18305867.js} +1 -1
- package/build/esm/{useScreenSize-0a846318.js → useScreenSize-02f86d84.js} +2 -2
- package/build/esm/useTogetherAuthRequiredAction.js +9 -9
- package/build/esm/{utils-55b98af6.js → utils-a3b9d7d0.js} +2 -2
- package/build/esm/{utils-6770dd94.js → utils-b35eb99e.js} +2 -2
- package/build/esm/{utils-6cb78a7c.js → utils-c0d9723d.js} +3 -3
- package/build/esm/vaccination.js +21 -21
- package/build/footer.js +21 -21
- package/build/gAssets.js +2 -2
- package/build/healthToolsCardWrapper.js +18 -18
- package/build/healthToolsForm.js +33 -33
- package/build/hooks/useCSSFocusPopupHelper.d.ts +0 -1
- package/build/hooks.js +13 -13
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/{index-f783a9c5.js → index-042f34c3.js} +17 -17
- package/build/{index-30fb9508.js → index-094bb00e.js} +17 -17
- package/build/{index-c3d630e5.js → index-0d3f91cf.js} +13 -13
- package/build/{index-aac02f70.js → index-1182e82c.js} +7 -7
- package/build/{index-d3d09dc3.js → index-1a319d43.js} +16 -16
- package/build/{index-00bdc95b.js → index-1cb3a39f.js} +2 -2
- package/build/{index-c9896e49.js → index-1e35e9df.js} +2 -2
- package/build/{index-4c9ecd21.js → index-21c65f60.js} +2 -2
- package/build/{index-f8044024.js → index-2805c84a.js} +6 -6
- package/build/{index-262e097e.js → index-2e9e93c9.js} +13 -13
- package/build/{index-5c3ee7c9.js → index-2ef913ba.js} +16 -16
- package/build/{index-def25549.js → index-3101951e.js} +2 -2
- package/build/{index-0b304d1c.js → index-35773e92.js} +42 -69
- package/build/{index-541b4070.js → index-3700de45.js} +3 -3
- package/build/{index-546e0e88.js → index-38ef37dc.js} +18 -18
- package/build/{index-f0978941.js → index-3a348fbc.js} +16 -16
- package/build/{index-2ff2ede0.js → index-3a58a727.js} +2 -2
- package/build/{index-8e3454ef.js → index-3d2e85dc.js} +2 -2
- package/build/{index-4bed6382.js → index-3d957292.js} +18 -18
- package/build/{index-a237c8c2.js → index-3e7d6cc4.js} +1 -1
- package/build/{index-e37d305b.js → index-40e4afae.js} +21 -21
- package/build/{index-54dddda5.js → index-493523ed.js} +7 -7
- package/build/{index-e1b1535a.js → index-4c8c9745.js} +32 -32
- package/build/{index-9fc631a1.js → index-5a4a5e20.js} +3 -3
- package/build/{index-9c6ac301.js → index-5dda52df.js} +16 -16
- package/build/{index-f0f5ac04.js → index-5f5fa57f.js} +24 -24
- package/build/{index-17af813e.js → index-66f3caf8.js} +24 -24
- package/build/{index-05b9ca78.js → index-68a15657.js} +2 -2
- package/build/{index-69ebebb9.js → index-6e0eb856.js} +17 -17
- package/build/{index-823089fd.js → index-6f7de6e0.js} +11 -18
- package/build/{index-9f6cd4fd.js → index-79c0a9a3.js} +1 -1
- package/build/{index-51cf3755.js → index-7bf79e35.js} +1 -1
- package/build/{index-b83196e3.js → index-7e25d40b.js} +31 -31
- package/build/{index-bb5836f1.js → index-8167a70c.js} +2 -2
- package/build/{index-dfc1fe72.js → index-875caddb.js} +1 -1
- package/build/{index-608d527a.js → index-8ba84075.js} +2 -2
- package/build/{index-cd924c5a.js → index-94772b72.js} +2 -2
- package/build/{index-19ad226f.js → index-94931efa.js} +1 -1
- package/build/{index-c4145c0f.js → index-94ce4d47.js} +5 -5
- package/build/{index-72ee39d9.js → index-973d5dda.js} +6 -6
- package/build/{index-3cca3c12.js → index-a071e634.js} +4 -4
- package/build/{index-e1853b05.js → index-a1e35f0e.js} +11 -11
- package/build/{index-d2279bdd.js → index-a58e746a.js} +13 -13
- package/build/{index-c6a55ea0.js → index-a779c4d4.js} +6 -6
- package/build/{index-ad3adb7f.js → index-adf4747d.js} +3 -3
- package/build/{index-cc75c3dc.js → index-aee6e489.js} +1 -1
- package/build/{index-09a1e5a7.js → index-afc55b28.js} +3 -3
- package/build/{index-de39c886.js → index-b4e35303.js} +2 -2
- package/build/{index-5833f410.js → index-baa94157.js} +3 -3
- package/build/{index-509eb37a.js → index-bda7773d.js} +6 -6
- package/build/{index-a5405974.js → index-c0c4b849.js} +2 -2
- package/build/{index-5f0e6e1c.js → index-cb770834.js} +2 -2
- package/build/{index-8c9cba51.js → index-cb8923b3.js} +1 -1
- package/build/{index-03289e9d.js → index-ce3c1f14.js} +3 -3
- package/build/{index-868af38d.js → index-ce7025ce.js} +5 -5
- package/build/{index-ec74e86f.js → index-d5036718.js} +1 -1
- package/build/{index-669c71fb.js → index-e34bc8f7.js} +13 -13
- package/build/{index-77e6701c.js → index-e8b60709.js} +2 -2
- package/build/{index-ab70e2f6.js → index-eae4cecf.js} +10 -10
- package/build/{index-681dd1de.js → index-eb1d7739.js} +6 -6
- package/build/{index-2aaa3225.js → index-ee27da23.js} +16 -16
- package/build/{index-60452010.js → index-f2ec72dd.js} +22 -22
- package/build/{index-85d31740.js → index-fce3baec.js} +15 -15
- package/build/{index-fbf149ea.js → index-ff76ed2d.js} +1 -1
- package/build/index.js +116 -116
- package/build/interfaces/healthTools.d.ts +0 -1
- package/build/{labelSorting-8535576c.js → labelSorting-92072462.js} +4 -4
- package/build/lead/helpers.d.ts +1 -51
- package/build/lead/index.d.ts +1 -2
- package/build/lead/layouts/lightbox/formContainer.d.ts +2 -1
- package/build/lead/services/index.d.ts +0 -14
- package/build/lead.css +1 -1
- package/build/lead.js +328 -1234
- package/build/{logoIcon-27b0c1ef.js → logoIcon-c3220e78.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 +73 -73
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +16 -16
- package/build/navigation.js +45 -45
- package/build/navigationLogoutPopup.js +9 -9
- package/build/navigationProfileButton.js +23 -23
- package/build/onboardingV2.js +28 -28
- package/build/organisms.js +49 -49
- package/build/{post-085c2816.js → post-11795b83.js} +2 -2
- package/build/profileNavigation.js +19 -19
- package/build/progressBar.js +1 -1
- package/build/pwg.js +22 -22
- package/build/ssoV2/api/featureFlag.d.ts +1 -2
- package/build/ssoV2/index.d.ts +0 -1
- package/build/ssoV2/utils.d.ts +0 -6
- package/build/ssoV2.js +71 -65
- package/build/{store-86413a51.js → store-9eee7801.js} +4 -4
- package/build/subot.js +41 -42
- package/build/surveyOrPremiumBanner.js +31 -31
- package/build/surveyQuestionCard.js +10 -10
- package/build/{surveyThankyouCard-fa11ea1f.js → surveyThankyouCard-e1a87be9.js} +5 -5
- package/build/together.js +55 -55
- package/build/togetherApiUtils.js +4 -4
- package/build/togetherAtoms.js +30 -30
- package/build/togetherComponentGlobalContext.js +4 -4
- package/build/togetherMolecules.js +50 -50
- package/build/togetherMoleculesCardAuthor.js +28 -28
- package/build/togetherMoleculesPostImagePreview.js +11 -11
- package/build/togetherMoleculesProfileDetail.js +38 -38
- package/build/togetherOrganisms.js +49 -49
- package/build/togetherRichTextEditor.js +17 -17
- package/build/togetherShareBox.js +10 -10
- package/build/{treePopoverMenu-ae543b92.js → treePopoverMenu-813ac31d.js} +19 -19
- package/build/{types-5dc1e6e3.js → types-57843da8.js} +2 -2
- package/build/types.js +2 -2
- package/build/{useCategory-c93f5d41.js → useCategory-63720390.js} +5 -5
- package/build/{useHealthToolCache-3a1f8d60.js → useHealthToolCache-ac4cd200.js} +1 -1
- package/build/{useMantineLocale-fbbbe2fc.js → useMantineLocale-63af12b7.js} +6 -6
- package/build/{usePlacesAutocomplete-50b9d0b8.js → usePlacesAutocomplete-4a26eef9.js} +1 -1
- package/build/{useScreenSize-71fb3d5d.js → useScreenSize-0c280791.js} +2 -2
- package/build/useTogetherAuthRequiredAction.js +9 -9
- package/build/{utils-30b4b2b0.js → utils-0e570d56.js} +3 -3
- package/build/{utils-cd47b37e.js → utils-88fbaa85.js} +2 -2
- package/build/{utils-55eb8342.js → utils-db88e1f0.js} +2 -2
- package/build/vaccination.js +21 -21
- package/package.json +3 -3
- package/build/components/mantine/phoneInput/PhoneInput.d.ts +0 -15
- package/build/components/mantine/phoneInput/index.d.ts +0 -1
- package/build/esm/components/mantine/phoneInput/PhoneInput.d.ts +0 -15
- package/build/esm/components/mantine/phoneInput/index.d.ts +0 -1
- package/build/esm/lead/LeadGenForm/LeadGenForm.d.ts +0 -41
- package/build/esm/lead/LeadGenForm/LeadGenForm.styled.d.ts +0 -5
- package/build/esm/lead/LeadGenForm/LeadGenThankYou.d.ts +0 -20
- package/build/esm/lead/LeadGenForm/index.d.ts +0 -1
- package/build/esm/lead/LeadGenForm/textField/index.d.ts +0 -13
- package/build/esm/lead/LeadGenForm/textField/index.styled.d.ts +0 -11
- package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +0 -25
- package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContext.d.ts +0 -25
- package/build/esm/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxWrapper.d.ts +0 -30
- package/build/esm/lead/LeadGenSubscriptionBox/index.d.ts +0 -1
- package/build/esm/utils-38ba72f2.js +0 -56
- package/build/lead/LeadGenForm/LeadGenForm.d.ts +0 -41
- package/build/lead/LeadGenForm/LeadGenForm.styled.d.ts +0 -5
- package/build/lead/LeadGenForm/LeadGenThankYou.d.ts +0 -20
- package/build/lead/LeadGenForm/index.d.ts +0 -1
- package/build/lead/LeadGenForm/textField/index.d.ts +0 -13
- package/build/lead/LeadGenForm/textField/index.styled.d.ts +0 -11
- package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContainer.d.ts +0 -25
- package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxContext.d.ts +0 -25
- package/build/lead/LeadGenSubscriptionBox/LeadGenSubscriptionBoxWrapper.d.ts +0 -30
- package/build/lead/LeadGenSubscriptionBox/index.d.ts +0 -1
- package/build/utils-281a9538.js +0 -62
- /package/build/{BMI_BOYS.percentile.monthly-8ecd4b3b.js → BMI_BOYS.percentile.monthly-183d7678.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-f18e6c90.js → BMI_BOYS.percentile.weekly-fe01dd09.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-76720f40.js → BMI_BOYS.percentile.yearly-19b2c66a.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-87d625ec.js → BMI_BOYS.zscore.monthly-fc1f4846.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-0839d655.js → BMI_BOYS.zscore.weekly-06c174e7.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-e4a8532f.js → BMI_BOYS.zscore.yearly-b268aca6.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-ddc436f1.js → BMI_GIRLS.percentile.monthly-1a611734.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-d09dd7f4.js → BMI_GIRLS.percentile.weekly-fefa6733.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-f9b927e6.js → BMI_GIRLS.percentile.yearly-1959a95b.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-f7d79275.js → BMI_GIRLS.zscore.monthly-ff8697fb.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-764e9229.js → BMI_GIRLS.zscore.weekly-03b1dacc.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-ce598791.js → BMI_GIRLS.zscore.yearly-35f18b18.js} +0 -0
- /package/build/{ChevronDown-1dfec847.js → ChevronDown-9b4d47bc.js} +0 -0
- /package/build/{Close-3cb8f40f.js → Close-7a4b7517.js} +0 -0
- /package/build/{Google-1cf70b3f.js → Google-395d574a.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-6a81319d.js → HEAD CIRCUM_BOYS.percentile.monthly-fd77a2f3.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-91f33e79.js → HEAD CIRCUM_BOYS.percentile.weekly-cb064bfa.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-94173e23.js → HEAD CIRCUM_BOYS.percentile.yearly-71c49c76.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-3b0976ae.js → HEAD CIRCUM_BOYS.zscore.monthly-c556265c.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-9944b64c.js → HEAD CIRCUM_BOYS.zscore.weekly-3ad2d0d2.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-621628ff.js → HEAD CIRCUM_BOYS.zscore.yearly-d1499477.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-0269f294.js → HEAD CIRCUM_GIRLS.percentile.monthly-8db5f10e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-ef2fbfad.js → HEAD CIRCUM_GIRLS.percentile.weekly-8ed4d425.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-46452ad2.js → HEAD CIRCUM_GIRLS.percentile.yearly-64adbb9d.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-14c02ed9.js → HEAD CIRCUM_GIRLS.zscore.monthly-dd9c7d2e.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-57107844.js → HEAD CIRCUM_GIRLS.zscore.weekly-8bd61433.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-ae975d01.js → HEAD CIRCUM_GIRLS.zscore.yearly-017a7d61.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-a9a05f3f.js → HEIGHT_BOYS.percentile.monthly-ad4d6730.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-486d98e9.js → HEIGHT_BOYS.percentile.weekly-07af944c.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-6cd6244b.js → HEIGHT_BOYS.percentile.yearly-d3b603e0.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-6e1da27e.js → HEIGHT_BOYS.zscore.monthly-5b4cea2e.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-62c1a866.js → HEIGHT_BOYS.zscore.weekly-284d292f.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-e3a2c8a7.js → HEIGHT_BOYS.zscore.yearly-0ac9deed.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-931a2667.js → HEIGHT_GIRLS.percentile.monthly-46a28d9f.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-0ee6c6bf.js → HEIGHT_GIRLS.percentile.weekly-a4ebbab5.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-82d4fb8f.js → HEIGHT_GIRLS.percentile.yearly-a712af6c.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-c492842e.js → HEIGHT_GIRLS.zscore.monthly-4a3d25d8.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-8fb350b2.js → HEIGHT_GIRLS.zscore.weekly-53907131.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-6ac447b9.js → HEIGHT_GIRLS.zscore.yearly-84139e09.js} +0 -0
- /package/build/{Locale-b74a18e2.js → Locale-34fa0b01.js} +0 -0
- /package/build/{Visible-f7a39209.js → Visible-43f37801.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-2708353d.js → WEIGHT_BOYS.percentile.monthly-6778e64d.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-4206d8cd.js → WEIGHT_BOYS.percentile.weekly-23c52d7c.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-985ce460.js → WEIGHT_BOYS.percentile.yearly-eac2cc63.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-0d85c928.js → WEIGHT_BOYS.zscore.monthly-1b248f32.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-b25215c1.js → WEIGHT_BOYS.zscore.weekly-a331896d.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-8442399d.js → WEIGHT_BOYS.zscore.yearly-a2c11a66.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-919a8e62.js → WEIGHT_GIRLS.percentile.monthly-041c33fc.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-06e5bf3b.js → WEIGHT_GIRLS.percentile.weekly-c847c193.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-66ddd6bb.js → WEIGHT_GIRLS.percentile.yearly-9de43cee.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-8874953a.js → WEIGHT_GIRLS.zscore.monthly-464e0d7c.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-a053709f.js → WEIGHT_GIRLS.zscore.weekly-f97171fc.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-32874bec.js → WEIGHT_GIRLS.zscore.yearly-d7777a5c.js} +0 -0
- /package/build/{animation-6018abd1.js → animation-0e910b02.js} +0 -0
- /package/build/{constants-297f3adb.js → constants-3ca38c70.js} +0 -0
- /package/build/{constants-5ebc25b8.js → constants-6410e403.js} +0 -0
- /package/build/{constants-5332133a.js → constants-ab24d47f.js} +0 -0
- /package/build/{dataTransform-9ce6f0a0.js → dataTransform-5c161e5f.js} +0 -0
- /package/build/{doctor-19f42a47.js → doctor-c3f479a3.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-559cd34e.js → BMI_BOYS.percentile.monthly-0520a8ac.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-b748074d.js → BMI_BOYS.percentile.weekly-49794473.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-70cb2df6.js → BMI_BOYS.percentile.yearly-8c11e918.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-a4e5965c.js → BMI_BOYS.zscore.monthly-df6ecb3c.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-6a6874de.js → BMI_BOYS.zscore.weekly-b8b935f4.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-eaf47070.js → BMI_BOYS.zscore.yearly-3bc152db.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-8ba5ff72.js → BMI_GIRLS.percentile.monthly-3bb093a2.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-8bdfd8da.js → BMI_GIRLS.percentile.weekly-be9efaaa.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-c8e0dc2c.js → BMI_GIRLS.percentile.yearly-56dfdc67.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-0b7abcbc.js → BMI_GIRLS.zscore.monthly-4f95b2af.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-c2d52b27.js → BMI_GIRLS.zscore.weekly-de16f442.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-802d5790.js → BMI_GIRLS.zscore.yearly-0c0d52df.js} +0 -0
- /package/build/esm/{ChevronDown-4a0e2900.js → ChevronDown-03fcad35.js} +0 -0
- /package/build/esm/{Close-dfe80a9c.js → Close-bf351f60.js} +0 -0
- /package/build/esm/{Google-8db94e87.js → Google-59b0e207.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-1d5aef5e.js → HEAD CIRCUM_BOYS.percentile.monthly-8eb2d545.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-d76dec4e.js → HEAD CIRCUM_BOYS.percentile.weekly-cd5aecca.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-e6d1494e.js → HEAD CIRCUM_BOYS.percentile.yearly-de65819a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-d3687984.js → HEAD CIRCUM_BOYS.zscore.monthly-a2677878.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-70b7fe6d.js → HEAD CIRCUM_BOYS.zscore.weekly-7c753e02.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-4c04d8c6.js → HEAD CIRCUM_BOYS.zscore.yearly-ba916058.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-42fb1f31.js → HEAD CIRCUM_GIRLS.percentile.monthly-dc7fa2da.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-3c7149df.js → HEAD CIRCUM_GIRLS.percentile.weekly-6cf85c72.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-a78160c9.js → HEAD CIRCUM_GIRLS.percentile.yearly-9d1364f4.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-331adb6a.js → HEAD CIRCUM_GIRLS.zscore.monthly-1977d549.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-40f24abf.js → HEAD CIRCUM_GIRLS.zscore.weekly-0fc4eeee.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-b68986e6.js → HEAD CIRCUM_GIRLS.zscore.yearly-386b261e.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-84a6dc37.js → HEIGHT_BOYS.percentile.monthly-705e2b1d.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-5d911254.js → HEIGHT_BOYS.percentile.weekly-ac015729.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-2acebf10.js → HEIGHT_BOYS.percentile.yearly-0247a171.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-20581257.js → HEIGHT_BOYS.zscore.monthly-3fb07762.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-b0264609.js → HEIGHT_BOYS.zscore.weekly-8e519c0d.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-be1e6519.js → HEIGHT_BOYS.zscore.yearly-54e5ad03.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-25d8e2ae.js → HEIGHT_GIRLS.percentile.monthly-1e62e9c0.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-f47301ae.js → HEIGHT_GIRLS.percentile.weekly-2e27d9b3.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-cac216bd.js → HEIGHT_GIRLS.percentile.yearly-f6146fc8.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-24351fa7.js → HEIGHT_GIRLS.zscore.monthly-68be7e21.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-1142b9b3.js → HEIGHT_GIRLS.zscore.weekly-6d68fe78.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-3a97b0e3.js → HEIGHT_GIRLS.zscore.yearly-2d22019b.js} +0 -0
- /package/build/esm/{Locale-0fe839f4.js → Locale-559226db.js} +0 -0
- /package/build/esm/{Visible-78891ff8.js → Visible-3d7a8862.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-cd6c58d1.js → WEIGHT_BOYS.percentile.monthly-30980ace.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-5fc8bcb7.js → WEIGHT_BOYS.percentile.weekly-0f580606.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-4c20a4cb.js → WEIGHT_BOYS.percentile.yearly-b099b1ec.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-0a285cc7.js → WEIGHT_BOYS.zscore.monthly-62e0e893.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-6097b85e.js → WEIGHT_BOYS.zscore.weekly-25dd429e.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-2c2a3f48.js → WEIGHT_BOYS.zscore.yearly-f1d7c781.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-baccddc8.js → WEIGHT_GIRLS.percentile.monthly-c044c53b.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-179346a5.js → WEIGHT_GIRLS.percentile.weekly-222e516a.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-6b081fdc.js → WEIGHT_GIRLS.percentile.yearly-29caad8c.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-ee266cc0.js → WEIGHT_GIRLS.zscore.monthly-f2bb66de.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-95df1c97.js → WEIGHT_GIRLS.zscore.weekly-68f9cb84.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-8b6014dc.js → WEIGHT_GIRLS.zscore.yearly-0564e539.js} +0 -0
- /package/build/esm/{animation-eb0600e7.js → animation-a3e56df8.js} +0 -0
- /package/build/esm/{constants-9675deb2.js → constants-2855671a.js} +0 -0
- /package/build/esm/{constants-7d3c8038.js → constants-736a1361.js} +0 -0
- /package/build/esm/{constants-afd70710.js → constants-a53b1566.js} +0 -0
- /package/build/esm/{dataTransform-e5e66b88.js → dataTransform-8dc43cc8.js} +0 -0
- /package/build/esm/{doctor-1cfe27db.js → doctor-c0de377a.js} +0 -0
- /package/build/esm/{index-3f5277e4.js → index-179f52e7.js} +0 -0
- /package/build/esm/{index-d48c45bb.js → index-2156e840.js} +0 -0
- /package/build/esm/{index-25ecd1e3.js → index-5b1385be.js} +0 -0
- /package/build/esm/{index-d9eea212.js → index-818593cf.js} +0 -0
- /package/build/esm/{index-a9d94c38.js → index-8573c079.js} +0 -0
- /package/build/esm/{index-9b474e8f.js → index-860e1c86.js} +0 -0
- /package/build/esm/{index-02c8be33.js → index-d03a12b1.js} +0 -0
- /package/build/esm/{index-f9c95ed3.js → index-e5d9a393.js} +0 -0
- /package/build/esm/{index-d71d1838.js → index-fac7fdc2.js} +0 -0
- /package/build/esm/{index.styles-7e8e723e.js → index.styles-6c3c23d3.js} +0 -0
- /package/build/esm/{localizeNumberFormat-cdbb31df.js → localizeNumberFormat-8b985517.js} +0 -0
- /package/build/esm/{normalizeLink-7c0d8cfc.js → normalizeLink-0fa73967.js} +0 -0
- /package/build/esm/{number-0d601f08.js → number-aedcb933.js} +0 -0
- /package/build/esm/{other-3c2c2888.js → other-acddb230.js} +0 -0
- /package/build/esm/{paths-a3da84bc.js → paths-4304a015.js} +0 -0
- /package/build/esm/{translationsContext-eadc2f8c.js → translationsContext-d7e74248.js} +0 -0
- /package/build/esm/{tslib.es6-3b3bf6ee.js → tslib.es6-ec147d4e.js} +0 -0
- /package/build/esm/{types-288df4ca.js → types-7f06cd21.js} +0 -0
- /package/build/esm/{useIsInit-7eb2ae3f.js → useIsInit-1ed497e1.js} +0 -0
- /package/build/esm/{useOutsideClick-431c9564.js → useOutsideClick-6a434153.js} +0 -0
- /package/build/esm/{useScrollbarSize-163a0ea0.js → useScrollbarSize-d4d72843.js} +0 -0
- /package/build/esm/{useUniqueId-4f87763e.js → useUniqueId-629ceab2.js} +0 -0
- /package/build/esm/{utils-0499e7df.js → utils-cd21d010.js} +0 -0
- /package/build/{index-4dab1087.js → index-08b60373.js} +0 -0
- /package/build/{index-614f129a.js → index-16ec2ac4.js} +0 -0
- /package/build/{index-e19448b3.js → index-329da60e.js} +0 -0
- /package/build/{index-dd4c59be.js → index-59e8e1de.js} +0 -0
- /package/build/{index-ab4d52ae.js → index-6f04d878.js} +0 -0
- /package/build/{index-10b5f5bc.js → index-799db6c5.js} +0 -0
- /package/build/{index-72e51fe9.js → index-8cf81c7d.js} +0 -0
- /package/build/{index-53b5da60.js → index-a08bddb1.js} +0 -0
- /package/build/{index-c1699b1b.js → index-b412132a.js} +0 -0
- /package/build/{index.styles-d39cba6b.js → index.styles-35f25c8b.js} +0 -0
- /package/build/{localizeNumberFormat-6a4549e3.js → localizeNumberFormat-a54afedd.js} +0 -0
- /package/build/{normalizeLink-8b41f1c2.js → normalizeLink-ad96df83.js} +0 -0
- /package/build/{number-af95ab59.js → number-19607670.js} +0 -0
- /package/build/{other-bff0cdfb.js → other-21a7da43.js} +0 -0
- /package/build/{paths-8b748863.js → paths-fcd6b2b0.js} +0 -0
- /package/build/{translationsContext-413fe085.js → translationsContext-57f66cea.js} +0 -0
- /package/build/{tslib.es6-04a10581.js → tslib.es6-6b1cfb74.js} +0 -0
- /package/build/{types-bddff908.js → types-79fb2f7f.js} +0 -0
- /package/build/{useIsInit-4b8ffdb6.js → useIsInit-d50d9183.js} +0 -0
- /package/build/{useOutsideClick-759d5b83.js → useOutsideClick-93512d0b.js} +0 -0
- /package/build/{useScrollbarSize-9a182d81.js → useScrollbarSize-137f544b.js} +0 -0
- /package/build/{useUniqueId-373f702e.js → useUniqueId-2b3757d6.js} +0 -0
- /package/build/{utils-32810910.js → utils-3477b358.js} +0 -0
package/build/lead.js
CHANGED
|
@@ -2,47 +2,47 @@
|
|
|
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-6b1cfb74.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var core = require('@mantine/core');
|
|
8
8
|
var dayjs = require('dayjs');
|
|
9
9
|
var debounce = require('lodash/debounce');
|
|
10
10
|
var form = require('@mantine/form');
|
|
11
|
-
var index = require('./index-
|
|
12
|
-
var translationsContext = require('./translationsContext-
|
|
11
|
+
var index = require('./index-ff76ed2d.js');
|
|
12
|
+
var translationsContext = require('./translationsContext-57f66cea.js');
|
|
13
13
|
var miscCookieHelper = require('./miscCookieHelper.js');
|
|
14
|
-
var utils$1 = require('./utils-
|
|
15
|
-
var index$1 = require('./index-
|
|
16
|
-
var index$2 = require('./index-
|
|
17
|
-
var index$4 = require('./index-
|
|
18
|
-
var utils = require('./utils-
|
|
19
|
-
|
|
20
|
-
var index$
|
|
21
|
-
require('./index-
|
|
22
|
-
require('./index-
|
|
23
|
-
require('./useMantineLocale-
|
|
24
|
-
var index$5 = require('./index-
|
|
25
|
-
require('./index.styles-
|
|
14
|
+
var utils$1 = require('./utils-3477b358.js');
|
|
15
|
+
var index$1 = require('./index-68a15657.js');
|
|
16
|
+
var index$2 = require('./index-a1e35f0e.js');
|
|
17
|
+
var index$4 = require('./index-2805c84a.js');
|
|
18
|
+
var utils = require('./utils-db88e1f0.js');
|
|
19
|
+
require('@mantine/dates');
|
|
20
|
+
var index$8 = require('./index-c0c4b849.js');
|
|
21
|
+
require('./index-94931efa.js');
|
|
22
|
+
require('./index-8cf81c7d.js');
|
|
23
|
+
require('./useMantineLocale-63af12b7.js');
|
|
24
|
+
var index$5 = require('./index-aee6e489.js');
|
|
25
|
+
require('./index.styles-35f25c8b.js');
|
|
26
26
|
var hooks = require('@mantine/hooks');
|
|
27
|
-
require('./other-
|
|
28
|
-
require('./index-
|
|
29
|
-
var usePlacesAutocomplete = require('./usePlacesAutocomplete-
|
|
30
|
-
var index$3 = require('./index-
|
|
31
|
-
var index$6 = require('./index-
|
|
32
|
-
var styled = require('@emotion/styled');
|
|
27
|
+
require('./other-21a7da43.js');
|
|
28
|
+
require('./index-ce3c1f14.js');
|
|
29
|
+
var usePlacesAutocomplete = require('./usePlacesAutocomplete-4a26eef9.js');
|
|
30
|
+
var index$3 = require('./index-8ba84075.js');
|
|
31
|
+
var index$6 = require('./index-cb770834.js');
|
|
33
32
|
var uuid = require('uuid');
|
|
33
|
+
var index$7 = require('./index-799db6c5.js');
|
|
34
|
+
var index$9 = require('./index-3d2e85dc.js');
|
|
35
|
+
var useScreenSize = require('./useScreenSize-0c280791.js');
|
|
36
|
+
var ReactDOM = require('react-dom');
|
|
34
37
|
var react = require('@emotion/react');
|
|
38
|
+
var styled = require('@emotion/styled');
|
|
35
39
|
var miscTheme = require('./miscTheme.js');
|
|
36
|
-
var
|
|
37
|
-
var index$9 = require('./index-8e3454ef.js');
|
|
38
|
-
var useScreenSize = require('./useScreenSize-71fb3d5d.js');
|
|
39
|
-
var ReactDOM = require('react-dom');
|
|
40
|
-
var Close = require('./Close-3cb8f40f.js');
|
|
40
|
+
var Close = require('./Close-7a4b7517.js');
|
|
41
41
|
require('@hhgtech/icons/other');
|
|
42
42
|
require('@mantine/carousel');
|
|
43
|
-
require('./Locale-
|
|
43
|
+
require('./Locale-34fa0b01.js');
|
|
44
44
|
require('classnames');
|
|
45
|
-
require('./useUniqueId-
|
|
45
|
+
require('./useUniqueId-2b3757d6.js');
|
|
46
46
|
require('./constantsSite.js');
|
|
47
47
|
require('@hhgtech/icons/core');
|
|
48
48
|
require('date-fns/locale');
|
|
@@ -101,7 +101,7 @@ if (sessionStorage.getItem('insider_object')) {
|
|
|
101
101
|
}
|
|
102
102
|
const docLang = document.documentElement.lang;
|
|
103
103
|
// TODO: country code
|
|
104
|
-
const LEAD_LOCALE_DATA
|
|
104
|
+
const LEAD_LOCALE_DATA = {
|
|
105
105
|
'vi-VN': {
|
|
106
106
|
popupLang: 'vi',
|
|
107
107
|
countryCode: 'vn',
|
|
@@ -143,7 +143,7 @@ const LEAD_LOCALE_DATA$1 = {
|
|
|
143
143
|
countryCodeNumber: 91,
|
|
144
144
|
},
|
|
145
145
|
};
|
|
146
|
-
const LEAD_LOCALE = LEAD_LOCALE_DATA
|
|
146
|
+
const LEAD_LOCALE = LEAD_LOCALE_DATA[docLang] || LEAD_LOCALE_DATA['vi-VN'];
|
|
147
147
|
function LEAD_RESET_VAR() {
|
|
148
148
|
// LEAD_CURRENT_URL = location.href.toLowerCase();
|
|
149
149
|
LEAD_CURRENT_URL =
|
|
@@ -164,11 +164,6 @@ const LEAD_TIMEZONE_DATA = {
|
|
|
164
164
|
9: 'Asia/Manila', // Philippines / Filipinos Site
|
|
165
165
|
};
|
|
166
166
|
|
|
167
|
-
const LEADGEN_ACTIONS = {
|
|
168
|
-
SHOW: 'SHOW',
|
|
169
|
-
SCROLL: 'SCROLL',
|
|
170
|
-
TIME: 'TIME',
|
|
171
|
-
};
|
|
172
167
|
const LEADGEN_LAYOUT = {
|
|
173
168
|
LightBoxA: 'LightBoxA',
|
|
174
169
|
LightBoxB: 'LightBoxB',
|
|
@@ -198,10 +193,8 @@ const LEADGEN_BLOCK = {
|
|
|
198
193
|
DropdownBlock: 'DropdownBlock',
|
|
199
194
|
CheckboxBlock: 'CheckboxBlock',
|
|
200
195
|
TncBlock: 'TncBlock',
|
|
201
|
-
TitleBlock: 'TitleBlock',
|
|
202
|
-
SubtitleBlock: 'SubtitleBlock',
|
|
203
196
|
};
|
|
204
|
-
const
|
|
197
|
+
const LEADGEN_BLOCK_IN_FORM = [
|
|
205
198
|
LEADGEN_BLOCK.TextBlock,
|
|
206
199
|
LEADGEN_BLOCK.NumberBlock,
|
|
207
200
|
LEADGEN_BLOCK.DateBlock,
|
|
@@ -217,48 +210,6 @@ const LEADGEN_BLOCK_INPUT = [
|
|
|
217
210
|
LEADGEN_BLOCK.TncBlock,
|
|
218
211
|
];
|
|
219
212
|
const SSO_MAP_LEAD = ['name', 'email', 'birthday', 'phone', 'gender'];
|
|
220
|
-
const LEAD_LOCALE_DATA = {
|
|
221
|
-
'vi-VN': {
|
|
222
|
-
popupLang: 'vi',
|
|
223
|
-
countryCode: 'vn',
|
|
224
|
-
countryCodeNumber: 84,
|
|
225
|
-
},
|
|
226
|
-
'id-ID': {
|
|
227
|
-
popupLang: 'id',
|
|
228
|
-
countryCode: 'id',
|
|
229
|
-
countryCodeNumber: 62,
|
|
230
|
-
},
|
|
231
|
-
'th-TH': {
|
|
232
|
-
popupLang: 'th',
|
|
233
|
-
countryCode: 'th',
|
|
234
|
-
countryCodeNumber: 66,
|
|
235
|
-
},
|
|
236
|
-
'ms-MY': {
|
|
237
|
-
popupLang: 'ms',
|
|
238
|
-
countryCode: 'my',
|
|
239
|
-
countryCodeNumber: 60,
|
|
240
|
-
},
|
|
241
|
-
'zh-TW': {
|
|
242
|
-
popupLang: 'zh',
|
|
243
|
-
countryCode: 'tw',
|
|
244
|
-
countryCodeNumber: 886,
|
|
245
|
-
},
|
|
246
|
-
'km-KH': {
|
|
247
|
-
popupLang: 'km',
|
|
248
|
-
countryCode: 'kh',
|
|
249
|
-
countryCodeNumber: 855,
|
|
250
|
-
},
|
|
251
|
-
'my-MM': {
|
|
252
|
-
popupLang: 'my',
|
|
253
|
-
countryCode: 'mm',
|
|
254
|
-
countryCodeNumber: 95,
|
|
255
|
-
},
|
|
256
|
-
'hi-IN': {
|
|
257
|
-
popupLang: 'hi',
|
|
258
|
-
countryCode: 'in',
|
|
259
|
-
countryCodeNumber: 91,
|
|
260
|
-
},
|
|
261
|
-
};
|
|
262
213
|
const mappingSSOToLead = (userInfoProps) => {
|
|
263
214
|
var _a, _b;
|
|
264
215
|
try {
|
|
@@ -274,7 +225,7 @@ const mappingSSOToLead = (userInfoProps) => {
|
|
|
274
225
|
if (ssoKey === 'birthday') {
|
|
275
226
|
const dob = dayjs__default["default"](initValue, 'YYYY-MM-DD', true);
|
|
276
227
|
if (dob.isValid()) {
|
|
277
|
-
user.birthday = dob
|
|
228
|
+
user.birthday = dob;
|
|
278
229
|
}
|
|
279
230
|
}
|
|
280
231
|
else if (ssoKey === 'gender') {
|
|
@@ -297,46 +248,6 @@ const mappingSSOToLead = (userInfoProps) => {
|
|
|
297
248
|
catch (error) {
|
|
298
249
|
return;
|
|
299
250
|
}
|
|
300
|
-
};
|
|
301
|
-
const formatCampaignDetail = (campaign) => {
|
|
302
|
-
if (!campaign) {
|
|
303
|
-
return {};
|
|
304
|
-
}
|
|
305
|
-
try {
|
|
306
|
-
const { extra_fields, thank_you_image } = campaign || {};
|
|
307
|
-
const { textBlocks: exTextBlocks, imageBlocks: exImageBlocks, listBlockAdded: exListBlockAdded, listBlockThankyou: exListBlockThankyou, actionBlocks: exActionBlocks, } = extra_fields;
|
|
308
|
-
const textBlocks = JSON.parse(exTextBlocks);
|
|
309
|
-
const imageBlocks = JSON.parse(exImageBlocks);
|
|
310
|
-
const listBlockAdded = JSON.parse(exListBlockAdded);
|
|
311
|
-
const listBlockThankyou = JSON.parse(exListBlockThankyou);
|
|
312
|
-
const actionBlocks = JSON.parse(exActionBlocks);
|
|
313
|
-
const ThankYouBlock = {
|
|
314
|
-
image: { src: thank_you_image },
|
|
315
|
-
};
|
|
316
|
-
listBlockThankyou.forEach((block) => {
|
|
317
|
-
const { name, data } = block || {};
|
|
318
|
-
const { value: htmlText, align, newtab, url } = data || {};
|
|
319
|
-
switch (name) {
|
|
320
|
-
case LEADGEN_BLOCK.TitleBlock: {
|
|
321
|
-
ThankYouBlock.title = { htmlText, align };
|
|
322
|
-
}
|
|
323
|
-
case LEADGEN_BLOCK.SubtitleBlock: {
|
|
324
|
-
ThankYouBlock.description = { htmlText, align };
|
|
325
|
-
}
|
|
326
|
-
case LEADGEN_BLOCK.LinkButtonBlock: {
|
|
327
|
-
ThankYouBlock.button = { htmlText, newtab, url };
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
return Object.assign(Object.assign({}, campaign), { extra_fields: Object.assign(Object.assign({}, extra_fields), { textBlocks,
|
|
332
|
-
imageBlocks,
|
|
333
|
-
listBlockAdded,
|
|
334
|
-
listBlockThankyou,
|
|
335
|
-
actionBlocks }), ThankYouBlock });
|
|
336
|
-
}
|
|
337
|
-
catch (error) {
|
|
338
|
-
return {};
|
|
339
|
-
}
|
|
340
251
|
};
|
|
341
252
|
|
|
342
253
|
class Store {
|
|
@@ -347,13 +258,6 @@ class Store {
|
|
|
347
258
|
}
|
|
348
259
|
const leadStore = new Store();
|
|
349
260
|
|
|
350
|
-
const LEADGEN_API_METHOD = {
|
|
351
|
-
GET: 'get',
|
|
352
|
-
POST: 'POST',
|
|
353
|
-
};
|
|
354
|
-
const LEADGEN_API_PATH = {
|
|
355
|
-
V2_CAMPAIGN: 'api/v2/campaign',
|
|
356
|
-
};
|
|
357
261
|
const leadApi = {
|
|
358
262
|
call(_a) {
|
|
359
263
|
var { url, data = undefined } = _a, config = tslib_es6.__rest(_a, ["url", "data"]);
|
|
@@ -457,39 +361,8 @@ const verifyOtpLead = ({ phone, otp, type, }) => {
|
|
|
457
361
|
},
|
|
458
362
|
});
|
|
459
363
|
};
|
|
460
|
-
const campaignGetByCode = (campaign_code) => {
|
|
461
|
-
return leadApi.call({
|
|
462
|
-
url: `${LEADGEN_API_PATH.V2_CAMPAIGN}/${campaign_code}`,
|
|
463
|
-
method: LEADGEN_API_METHOD.GET,
|
|
464
|
-
});
|
|
465
|
-
};
|
|
466
|
-
const campaignPostLead = ({ data }) => {
|
|
467
|
-
return leadApi.call({
|
|
468
|
-
url: 'api/v2/subscription-box',
|
|
469
|
-
method: LEADGEN_API_METHOD.POST,
|
|
470
|
-
data,
|
|
471
|
-
});
|
|
472
|
-
};
|
|
473
|
-
const campaignPostImpression = ({ code, action, title_article, ga_client_id, cookie_id, extra, url, referrer, }) => {
|
|
474
|
-
return leadApi.call({
|
|
475
|
-
url: `api/campaign/${code}/impression`,
|
|
476
|
-
method: LEADGEN_API_METHOD.POST,
|
|
477
|
-
data: {
|
|
478
|
-
action,
|
|
479
|
-
title_article,
|
|
480
|
-
cookie_id,
|
|
481
|
-
ga_client_id,
|
|
482
|
-
url,
|
|
483
|
-
extra,
|
|
484
|
-
referrer,
|
|
485
|
-
},
|
|
486
|
-
});
|
|
487
|
-
};
|
|
488
364
|
const Service = {
|
|
489
365
|
campaignGetById,
|
|
490
|
-
campaignGetByCode,
|
|
491
|
-
campaignPostLead,
|
|
492
|
-
campaignPostImpression,
|
|
493
366
|
validateEmailOrPhoneOnSubot,
|
|
494
367
|
validateEmailOrPhoneOnLeadGen,
|
|
495
368
|
validatePhoneNumberOnLeadGen,
|
|
@@ -1491,1065 +1364,66 @@ const getTranslations = (locale) => {
|
|
|
1491
1364
|
|
|
1492
1365
|
const LeadGenContext = React.createContext({});
|
|
1493
1366
|
|
|
1494
|
-
const
|
|
1495
|
-
const
|
|
1496
|
-
const
|
|
1497
|
-
const [
|
|
1498
|
-
|
|
1499
|
-
const translationContextValue = { locale, values: getTranslations(locale) };
|
|
1367
|
+
const useImageSize = (src) => {
|
|
1368
|
+
const [width, setWidth] = React.useState(16);
|
|
1369
|
+
const [height, setHeight] = React.useState(9);
|
|
1370
|
+
const [loaded, setLoaded] = React.useState(false);
|
|
1371
|
+
// load src image to get its width and height
|
|
1500
1372
|
React.useEffect(() => {
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1373
|
+
setLoaded(false);
|
|
1374
|
+
if (src) {
|
|
1375
|
+
const img = new Image();
|
|
1376
|
+
img.addEventListener('load', () => {
|
|
1377
|
+
setWidth(img.naturalWidth);
|
|
1378
|
+
setHeight(img.naturalHeight);
|
|
1379
|
+
setLoaded(true);
|
|
1380
|
+
});
|
|
1381
|
+
img.addEventListener('error', () => {
|
|
1382
|
+
setWidth(16);
|
|
1383
|
+
setHeight(9);
|
|
1384
|
+
setLoaded(true);
|
|
1510
1385
|
});
|
|
1386
|
+
img.src = src;
|
|
1511
1387
|
}
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1388
|
+
else {
|
|
1389
|
+
setWidth(16);
|
|
1390
|
+
setHeight(9);
|
|
1391
|
+
setLoaded(true);
|
|
1392
|
+
}
|
|
1393
|
+
}, [src]);
|
|
1394
|
+
return {
|
|
1395
|
+
loaded,
|
|
1396
|
+
width,
|
|
1397
|
+
height,
|
|
1398
|
+
};
|
|
1399
|
+
};
|
|
1400
|
+
|
|
1401
|
+
const CloseButton = ({ onClose, containerClassName, svgClassName, }) => (React__default["default"].createElement("button", { onClick: onClose, className: `le-newbuilder-close-button js-modal__close ${containerClassName || ''}` },
|
|
1402
|
+
React__default["default"].createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: svgClassName },
|
|
1403
|
+
React__default["default"].createElement("path", { d: "M9.99981 10.8432L14.0583 14.9017C14.1691 15.0125 14.3083 15.0691 14.476 15.0717C14.6437 15.0743 14.7854 15.0176 14.9013 14.9017C15.0172 14.7858 15.0752 14.6453 15.0752 14.4802C15.0752 14.3151 15.0172 14.1746 14.9013 14.0587L10.8429 10.0002L14.9013 5.9417C15.0121 5.83094 15.0688 5.69172 15.0713 5.52402C15.0739 5.35634 15.0172 5.21456 14.9013 5.09866C14.7854 4.98276 14.6449 4.9248 14.4798 4.9248C14.3147 4.9248 14.1742 4.98276 14.0583 5.09866L9.99981 9.15712L5.94133 5.09866C5.83057 4.98789 5.69135 4.93122 5.52365 4.92866C5.35598 4.92609 5.21419 4.98276 5.09829 5.09866C4.98239 5.21456 4.92444 5.35506 4.92444 5.52018C4.92444 5.6853 4.98239 5.82581 5.09829 5.9417L9.15675 10.0002L5.09829 14.0587C4.98752 14.1694 4.93085 14.3087 4.9283 14.4763C4.92572 14.644 4.98239 14.7858 5.09829 14.9017C5.21419 15.0176 5.3547 15.0756 5.51982 15.0756C5.68493 15.0756 5.82544 15.0176 5.94133 14.9017L9.99981 10.8432Z" }))));
|
|
1404
|
+
|
|
1405
|
+
// url: imageBlocks.imageMobile.data.url
|
|
1406
|
+
// newTab: imageBlocks.imageMobile.data.newtab
|
|
1407
|
+
// imageMobile: campaignShow.image
|
|
1408
|
+
// imageDestkop: campaignShow.image_desktop
|
|
1409
|
+
const CenterTabLayout = ({ popupId, url, newTab, imageDestkop, imageMobile, onClose, onOtherSubmit, }) => {
|
|
1410
|
+
const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
|
|
1411
|
+
const { width: imageDestkopWidth, height: imageDestkopHeight, loaded: imageDestkopLoaded, } = useImageSize(imageDestkop);
|
|
1412
|
+
if (!imageMobileLoaded || !imageDestkopLoaded)
|
|
1521
1413
|
return null;
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
const validateObj = React.useMemo(() => {
|
|
1536
|
-
const InputBlocks = [
|
|
1537
|
-
'TextBlock',
|
|
1538
|
-
'NumberBlock',
|
|
1539
|
-
'EmailBlock',
|
|
1540
|
-
'PhoneBlock',
|
|
1541
|
-
'DateBlock',
|
|
1542
|
-
'CheckboxBlock',
|
|
1543
|
-
'RadioBlock',
|
|
1544
|
-
'DropdownBlock',
|
|
1545
|
-
'PhoneOtpBlock',
|
|
1546
|
-
'WhatsappOtpBlock',
|
|
1547
|
-
'ZaloOtpBlock',
|
|
1548
|
-
'LocationBlock',
|
|
1549
|
-
'TncBlock',
|
|
1550
|
-
];
|
|
1551
|
-
// ALL are required and can skip if not touched yet
|
|
1552
|
-
const withSharedCheck = (name, cb,
|
|
1553
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1554
|
-
block) => {
|
|
1555
|
-
return (value) => {
|
|
1556
|
-
var _a;
|
|
1557
|
-
const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
|
|
1558
|
-
if (!formRef.current.isTouched(name))
|
|
1559
|
-
return;
|
|
1560
|
-
if ((typeof value === 'string' && value.replace(' ', '') === '') ||
|
|
1561
|
-
typeof value === 'undefined' ||
|
|
1562
|
-
value === '' ||
|
|
1563
|
-
(Array.isArray(value) && value.length === 0)) {
|
|
1564
|
-
return isBLockRequired
|
|
1565
|
-
? t('validator.required')
|
|
1566
|
-
: cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1567
|
-
}
|
|
1568
|
-
return cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1569
|
-
};
|
|
1570
|
-
};
|
|
1571
|
-
return listBlockAdded
|
|
1572
|
-
.filter((b) => InputBlocks.includes(b.name))
|
|
1573
|
-
.reduce((r, b) => {
|
|
1574
|
-
var _a;
|
|
1575
|
-
const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
|
|
1576
|
-
if (b.name === 'NumberBlock') {
|
|
1577
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1578
|
-
if (value && isNaN(Number(value))) {
|
|
1579
|
-
return t('validator.number');
|
|
1580
|
-
}
|
|
1581
|
-
}, b) });
|
|
1582
|
-
}
|
|
1583
|
-
else if (b.name === 'EmailBlock') {
|
|
1584
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1585
|
-
if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
1586
|
-
return t('validator.email');
|
|
1587
|
-
}
|
|
1588
|
-
if (!value)
|
|
1589
|
-
return;
|
|
1590
|
-
validatingEmailRef.current = true;
|
|
1591
|
-
setTimeout(() => {
|
|
1592
|
-
formRef.current.setFieldError(b.data.value, 'Validating...');
|
|
1593
|
-
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1594
|
-
email: value,
|
|
1595
|
-
})
|
|
1596
|
-
.then((tKey) => {
|
|
1597
|
-
if (tKey) {
|
|
1598
|
-
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1599
|
-
}
|
|
1600
|
-
else {
|
|
1601
|
-
formRef.current.clearFieldError(b.data.value);
|
|
1602
|
-
}
|
|
1603
|
-
validatingEmailRef.current = false;
|
|
1604
|
-
})
|
|
1605
|
-
.catch((e) => {
|
|
1606
|
-
console.error(e);
|
|
1607
|
-
formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
|
|
1608
|
-
validatingEmailRef.current = false;
|
|
1609
|
-
});
|
|
1610
|
-
}, 200);
|
|
1611
|
-
}, b) });
|
|
1612
|
-
}
|
|
1613
|
-
else if (b.name === 'PhoneBlock' ||
|
|
1614
|
-
b.name === 'PhoneOtpBlock' ||
|
|
1615
|
-
b.name === 'ZaloOtpBlock' ||
|
|
1616
|
-
b.name === 'WhatsappOtpBlock') {
|
|
1617
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1618
|
-
if (value &&
|
|
1619
|
-
window.intlTelInputUtils &&
|
|
1620
|
-
!window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
|
|
1621
|
-
return t('validator.phone');
|
|
1622
|
-
}
|
|
1623
|
-
if (!value)
|
|
1624
|
-
return;
|
|
1625
|
-
validatingPhoneRef.current = true;
|
|
1626
|
-
setTimeout(() => {
|
|
1627
|
-
formRef.current.setFieldError(b.data.value, 'Validating...');
|
|
1628
|
-
if (b.data.singleSubmission) {
|
|
1629
|
-
checkUsedPhoneOnlyWithCache(campaignId, value)
|
|
1630
|
-
.then((tKey) => {
|
|
1631
|
-
if (tKey) {
|
|
1632
|
-
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1633
|
-
}
|
|
1634
|
-
else {
|
|
1635
|
-
formRef.current.clearFieldError(b.data.value);
|
|
1636
|
-
}
|
|
1637
|
-
validatingPhoneRef.current = false;
|
|
1638
|
-
})
|
|
1639
|
-
.catch((err) => {
|
|
1640
|
-
console.error(err);
|
|
1641
|
-
formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
|
|
1642
|
-
validatingPhoneRef.current = false;
|
|
1643
|
-
});
|
|
1644
|
-
}
|
|
1645
|
-
else {
|
|
1646
|
-
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1647
|
-
phone: value,
|
|
1648
|
-
})
|
|
1649
|
-
.then((tKey) => {
|
|
1650
|
-
if (tKey) {
|
|
1651
|
-
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1652
|
-
}
|
|
1653
|
-
else {
|
|
1654
|
-
formRef.current.clearFieldError(b.data.value);
|
|
1655
|
-
}
|
|
1656
|
-
validatingPhoneRef.current = false;
|
|
1657
|
-
})
|
|
1658
|
-
.catch((e) => {
|
|
1659
|
-
console.error(e);
|
|
1660
|
-
formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
|
|
1661
|
-
validatingPhoneRef.current = false;
|
|
1662
|
-
});
|
|
1663
|
-
}
|
|
1664
|
-
}, 200);
|
|
1665
|
-
}, b) });
|
|
1666
|
-
}
|
|
1667
|
-
else if (b.name === 'DateBlock') {
|
|
1668
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1669
|
-
if (value && isNaN(Date.parse(value))) {
|
|
1670
|
-
return t('validator.date');
|
|
1671
|
-
}
|
|
1672
|
-
}, b) });
|
|
1673
|
-
}
|
|
1674
|
-
else if (b.name === 'TncBlock') {
|
|
1675
|
-
return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
|
|
1676
|
-
if (isRequired && !value) {
|
|
1677
|
-
return t('validator.required');
|
|
1678
|
-
}
|
|
1679
|
-
}, b) });
|
|
1680
|
-
}
|
|
1681
|
-
else {
|
|
1682
|
-
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
|
|
1683
|
-
}
|
|
1684
|
-
}, {});
|
|
1685
|
-
}, [listBlockAdded.map((b) => b.name).join(',')]);
|
|
1686
|
-
const form = useLeadForm({
|
|
1687
|
-
validateInputOnChange: true,
|
|
1688
|
-
clearInputErrorOnChange: true,
|
|
1689
|
-
validate: validateObj,
|
|
1690
|
-
initialValues,
|
|
1691
|
-
});
|
|
1692
|
-
const formRef = React.useRef(form);
|
|
1693
|
-
formRef.current = form;
|
|
1694
|
-
return { form, validateObj };
|
|
1695
|
-
};
|
|
1696
|
-
|
|
1697
|
-
const PhoneInput = React.forwardRef((props, ref) => {
|
|
1698
|
-
const { defaultCountry, id: idProps, name, placeholder, label, labelElement, labelProps, description, descriptionProps, withAsterisk, inputMode, inputContainer, inputWrapperOrder, error, className, classNames, style, styles } = props, restProps = tslib_es6.__rest(props, ["defaultCountry", "id", "name", "placeholder", "label", "labelElement", "labelProps", "description", "descriptionProps", "withAsterisk", "inputMode", "inputContainer", "inputWrapperOrder", "error", "className", "classNames", "style", "styles"]);
|
|
1699
|
-
const id = idProps || uuid.v1() + name;
|
|
1700
|
-
return (React__default["default"].createElement(core.Input.Wrapper, { size: "md", label: label, labelElement: labelElement, labelProps: Object.assign({ htmlFor: id }, labelProps), description: description, descriptionProps: descriptionProps, withAsterisk: withAsterisk, inputMode: inputMode, inputContainer: inputContainer, inputWrapperOrder: inputWrapperOrder, error: error, "data-invalid": !!error, className: className, classNames: classNames, style: style, styles: styles },
|
|
1701
|
-
React__default["default"].createElement("div", { className: "mantine-Input-wrapper" },
|
|
1702
|
-
React__default["default"].createElement(index$2.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" })))));
|
|
1703
|
-
});
|
|
1704
|
-
|
|
1705
|
-
const StyledLeadGenFormInner = styled__default["default"].div `
|
|
1706
|
-
display: flex;
|
|
1707
|
-
flex-wrap: wrap;
|
|
1708
|
-
gap: 8px;
|
|
1709
|
-
.leadgen-form_input {
|
|
1710
|
-
width: calc(50% - 4px);
|
|
1711
|
-
}
|
|
1712
|
-
|
|
1713
|
-
.leadgen-form_input_checkbox {
|
|
1714
|
-
width: 100%;
|
|
1715
|
-
}
|
|
1716
|
-
`;
|
|
1717
|
-
|
|
1718
|
-
const cssInputNotShrink$1 = react.css `
|
|
1719
|
-
height: 100% !important;
|
|
1720
|
-
min-height: calc(var(--container-height, 56px) * 22 / 56);
|
|
1721
|
-
color: ${miscTheme.theme.colors.gray800};
|
|
1722
|
-
font-size: var(--input, 16px);
|
|
1723
|
-
line-height: calc(var(--container-height, 56px) * 22 / 56);
|
|
1724
|
-
border: none !important;
|
|
1725
|
-
border-radius: 0 !important;
|
|
1726
|
-
outline: none !important;
|
|
1727
|
-
box-shadow: none !important;
|
|
1728
|
-
padding: 0;
|
|
1729
|
-
cursor: pointer;
|
|
1730
|
-
opacity: 0;
|
|
1731
|
-
|
|
1732
|
-
::placeholder {
|
|
1733
|
-
color: ${miscTheme.theme.colors.gray400};
|
|
1734
|
-
}
|
|
1735
|
-
`;
|
|
1736
|
-
const cssInputShrink$1 = react.css `
|
|
1737
|
-
height: auto !important;
|
|
1738
|
-
cursor: text;
|
|
1739
|
-
opacity: 1;
|
|
1740
|
-
transition: 0.1s ease-in-out all;
|
|
1741
|
-
`;
|
|
1742
|
-
const cssLabelNotShrink$1 = react.css `
|
|
1743
|
-
position: absolute;
|
|
1744
|
-
top: calc(var(--container-height) / 2);
|
|
1745
|
-
left: var(--space-x, 16px);
|
|
1746
|
-
color: ${miscTheme.theme.colors.gray400};
|
|
1747
|
-
font-size: var(--label-not-shrink, 16px);
|
|
1748
|
-
font-weight: 400;
|
|
1749
|
-
line-height: calc(var(--container-height, 56px) * 18 / 56);
|
|
1750
|
-
margin: 0;
|
|
1751
|
-
z-index: 1;
|
|
1752
|
-
cursor: pointer;
|
|
1753
|
-
transform: translateY(-50%);
|
|
1754
|
-
transition: 0.125s ease-in all;
|
|
1755
|
-
`;
|
|
1756
|
-
const cssLabelShrink$1 = react.css `
|
|
1757
|
-
color: ${miscTheme.theme.colors.gray600};
|
|
1758
|
-
font-weight: 600;
|
|
1759
|
-
font-size: var(--label-shrink, 12px);
|
|
1760
|
-
top: calc(var(--container-height) * 7 / 56);
|
|
1761
|
-
transform: none;
|
|
1762
|
-
transition: 0.125s ease-out all;
|
|
1763
|
-
`;
|
|
1764
|
-
const cssWrapperInputNotShrink$1 = react.css `
|
|
1765
|
-
min-height: var(--container-height, 56px);
|
|
1766
|
-
display: flex;
|
|
1767
|
-
align-items: flex-end;
|
|
1768
|
-
border: 1px solid ${miscTheme.theme.colors.gray200};
|
|
1769
|
-
border-radius: 8px;
|
|
1770
|
-
background-color: #fff;
|
|
1771
|
-
padding-inline: var(--space-x, 16px);
|
|
1772
|
-
padding-block: var(--space-y-not-shrink, 16px);
|
|
1773
|
-
cursor: pointer;
|
|
1774
|
-
pointer-events: none;
|
|
1775
|
-
|
|
1776
|
-
&:has(.mantine-Input-rightSection) {
|
|
1777
|
-
padding-right: var(--container-height, 56px);
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1780
|
-
.mantine-Input-icon {
|
|
1781
|
-
display: none;
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1784
|
-
.mantine-NumberInput-control {
|
|
1785
|
-
border-color: ${miscTheme.theme.colors.gray200};
|
|
1786
|
-
}
|
|
1787
|
-
`;
|
|
1788
|
-
const cssWrapperInputShrink$1 = react.css `
|
|
1789
|
-
height: auto;
|
|
1790
|
-
min-height: var(--container-height, 56px);
|
|
1791
|
-
padding-block: var(--space-y-shrink, 7px);
|
|
1792
|
-
cursor: text;
|
|
1793
|
-
pointer-events: auto;
|
|
1794
|
-
`;
|
|
1795
|
-
const cssInputWrapperError$1 = react.css `
|
|
1796
|
-
color: ${miscTheme.theme.colors.red800};
|
|
1797
|
-
font-size: 12px;
|
|
1798
|
-
line-height: 1.5;
|
|
1799
|
-
`;
|
|
1800
|
-
const StyledTextFieldContainer$1 = styled__default["default"].div `
|
|
1801
|
-
--space-x: 16px;
|
|
1802
|
-
--space-y-not-shrink: 16px;
|
|
1803
|
-
--space-y-shrink: 7px;
|
|
1804
|
-
--container-height: 56px;
|
|
1805
|
-
--label-not-shrink: 16px;
|
|
1806
|
-
--label-shrink: 12px;
|
|
1807
|
-
--input: 16px;
|
|
1808
|
-
|
|
1809
|
-
position: relative;
|
|
1810
|
-
min-width: 100px;
|
|
1811
|
-
max-width: 100%;
|
|
1812
|
-
display: inline-block;
|
|
1813
|
-
|
|
1814
|
-
.textField_wrapper {
|
|
1815
|
-
display: inline-block;
|
|
1816
|
-
width: 100%;
|
|
1817
|
-
cursor: pointer;
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
.mantine-InputWrapper-root {
|
|
1821
|
-
&[data-invalid='true'] {
|
|
1822
|
-
.mantine-Input-wrapper {
|
|
1823
|
-
border-color: ${miscTheme.theme.colors.red400};
|
|
1824
|
-
}
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
.mantine-Input-wrapper {
|
|
1828
|
-
&:has([data-invalid]) {
|
|
1829
|
-
border-color: ${miscTheme.theme.colors.red400};
|
|
1830
|
-
}
|
|
1831
|
-
}
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
.mantine-InputWrapper-label {
|
|
1835
|
-
${cssLabelNotShrink$1}
|
|
1836
|
-
}
|
|
1837
|
-
|
|
1838
|
-
.mantine-Input-wrapper {
|
|
1839
|
-
${cssWrapperInputNotShrink$1}
|
|
1840
|
-
|
|
1841
|
-
+ .mantine-Popover-dropdown[data-position="bottom-start"] {
|
|
1842
|
-
left: 0 !important;
|
|
1843
|
-
}
|
|
1844
|
-
+ .mantine-Popover-dropdown[data-position='top-start'] {
|
|
1845
|
-
top: unset !important;
|
|
1846
|
-
left: 0 !important;
|
|
1847
|
-
bottom: 100% !important;
|
|
1848
|
-
}
|
|
1849
|
-
}
|
|
1850
|
-
|
|
1851
|
-
.mantine-Input-input {
|
|
1852
|
-
${cssInputNotShrink$1}
|
|
1853
|
-
}
|
|
1854
|
-
|
|
1855
|
-
&.textField_shrink,
|
|
1856
|
-
&:focus-within {
|
|
1857
|
-
.mantine-InputWrapper-label {
|
|
1858
|
-
${cssLabelShrink$1}
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
.mantine-Input-wrapper {
|
|
1862
|
-
${cssWrapperInputShrink$1}
|
|
1863
|
-
&.mantine-Select-wrapper {
|
|
1864
|
-
.mantine-Select-rightSection {
|
|
1865
|
-
pointer-events: auto !important;
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
|
-
.mantine-Input-input {
|
|
1871
|
-
${cssInputShrink$1}
|
|
1872
|
-
}
|
|
1873
|
-
|
|
1874
|
-
&:has(.PhoneInput) {
|
|
1875
|
-
.mantine-InputWrapper-label {
|
|
1876
|
-
left: var(--space-x, 16px);
|
|
1877
|
-
}
|
|
1878
|
-
.PhoneInput {
|
|
1879
|
-
.PhoneInputInput {
|
|
1880
|
-
opacity: 1;
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
}
|
|
1885
|
-
|
|
1886
|
-
.PhoneInput {
|
|
1887
|
-
--phone-select: 75px;
|
|
1888
|
-
--phone-input-space-x: 8px;
|
|
1889
|
-
width: 100%;
|
|
1890
|
-
opacity: 1;
|
|
1891
|
-
border: none;
|
|
1892
|
-
.PhoneInputCountry {
|
|
1893
|
-
background-color: transparent;
|
|
1894
|
-
border: none;
|
|
1895
|
-
padding: 0;
|
|
1896
|
-
width: var(--phone-select, 75px);
|
|
1897
|
-
}
|
|
1898
|
-
.PhoneInputInput {
|
|
1899
|
-
flex: 1;
|
|
1900
|
-
min-width: 0;
|
|
1901
|
-
line-height: 1.5;
|
|
1902
|
-
outline: none !important;
|
|
1903
|
-
border: none;
|
|
1904
|
-
box-shadow: none;
|
|
1905
|
-
padding: 0 var(--phone-input-space-x, 8px);
|
|
1906
|
-
opacity: 0;
|
|
1907
|
-
color: ${miscTheme.theme.colors.gray800} !important;
|
|
1908
|
-
:focus {
|
|
1909
|
-
color: ${miscTheme.theme.colors.gray800} !important;
|
|
1910
|
-
}
|
|
1911
|
-
}
|
|
1912
|
-
}
|
|
1913
|
-
|
|
1914
|
-
&:has(.PhoneInput) {
|
|
1915
|
-
.mantine-InputWrapper-label {
|
|
1916
|
-
left: calc(
|
|
1917
|
-
var(--space-x, 16px) + var(--phone-select, 75px) +
|
|
1918
|
-
var(--phone-input-space-x, 8px)
|
|
1919
|
-
);
|
|
1920
|
-
}
|
|
1921
|
-
}
|
|
1922
|
-
`;
|
|
1923
|
-
const StyledChoiceFieldContainer$1 = styled__default["default"].div `
|
|
1924
|
-
&.leadgen-form_checkbox,
|
|
1925
|
-
&.leadgen-form_radio {
|
|
1926
|
-
width: 100%;
|
|
1927
|
-
}
|
|
1928
|
-
|
|
1929
|
-
&.leadgen-form_dropdown {
|
|
1930
|
-
width: calc(50% - 12px);
|
|
1931
|
-
}
|
|
1932
|
-
|
|
1933
|
-
.mantine-InputWrapper-root {
|
|
1934
|
-
display: block;
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
|
-
.mantine-InputWrapper-label {
|
|
1938
|
-
margin-bottom: 0.5rem;
|
|
1939
|
-
color: ${miscTheme.theme.colors.gray800};
|
|
1940
|
-
font-size: 16px;
|
|
1941
|
-
font-weight: 400;
|
|
1942
|
-
line-height: 1.5;
|
|
1943
|
-
}
|
|
1944
|
-
|
|
1945
|
-
.mantine-Radio-root,
|
|
1946
|
-
.mantine-Checkbox-root {
|
|
1947
|
-
gap: 8px;
|
|
1948
|
-
min-width: calc(50% - 4px);
|
|
1949
|
-
|
|
1950
|
-
input[type='radio'],
|
|
1951
|
-
input[type='checkbox'] {
|
|
1952
|
-
border-color: ${miscTheme.theme.colors.gray600};
|
|
1953
|
-
width: 18px;
|
|
1954
|
-
height: 18px;
|
|
1955
|
-
}
|
|
1956
|
-
input[type='checkbox'] {
|
|
1957
|
-
border-radius: 4px;
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
&[data-checked='true'] {
|
|
1961
|
-
input[type='radio'],
|
|
1962
|
-
input[type='checkbox'] {
|
|
1963
|
-
border-color: ${miscTheme.theme.colors.primary600};
|
|
1964
|
-
+ svg {
|
|
1965
|
-
color: ${miscTheme.theme.colors.primary600};
|
|
1966
|
-
}
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
input[type='radio'] {
|
|
1970
|
-
background-color: white;
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
|
|
1974
|
-
.mantine-Checkbox-input {
|
|
1975
|
-
&:checked {
|
|
1976
|
-
border-color: ${miscTheme.theme.colors.primary600};
|
|
1977
|
-
}
|
|
1978
|
-
}
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
|
-
.mantine-Radio-inner,
|
|
1982
|
-
.mantine-Checkbox-inner {
|
|
1983
|
-
width: 24px;
|
|
1984
|
-
height: 24px;
|
|
1985
|
-
display: flex;
|
|
1986
|
-
align-items: center;
|
|
1987
|
-
justify-content: center;
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1990
|
-
.mantine-Radio-body,
|
|
1991
|
-
.mantine-Checkbox-body {
|
|
1992
|
-
display: flex;
|
|
1993
|
-
align-items: center;
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
.mantine-Radio-label,
|
|
1997
|
-
.mantine-Checkbox-label {
|
|
1998
|
-
padding-left: 8px;
|
|
1999
|
-
color: ${miscTheme.theme.colors.gray800};
|
|
2000
|
-
font-size: 14px;
|
|
2001
|
-
line-height: 1.4;
|
|
2002
|
-
letter-spacing: -0.2px;
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
.leadgen-choiceContainer {
|
|
2006
|
-
display: flex;
|
|
2007
|
-
flex-wrap: wrap;
|
|
2008
|
-
align-items: flex-start;
|
|
2009
|
-
gap: 8px;
|
|
2010
|
-
}
|
|
2011
|
-
|
|
2012
|
-
.mantine-InputWrapper-error {
|
|
2013
|
-
${cssInputWrapperError$1}
|
|
2014
|
-
}
|
|
2015
|
-
`;
|
|
2016
|
-
|
|
2017
|
-
const TextField$1 = (props) => {
|
|
2018
|
-
const { shrink: shrinkProps, onChangeShrink, className, children } = props, restProps = tslib_es6.__rest(props, ["shrink", "onChangeShrink", "className", "children"]);
|
|
2019
|
-
const containerRef = hooks.useClickOutside(() => {
|
|
2020
|
-
if (shrinkProps) {
|
|
2021
|
-
return;
|
|
2022
|
-
}
|
|
2023
|
-
setShrink(false);
|
|
2024
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(false);
|
|
2025
|
-
});
|
|
2026
|
-
const [shrink, setShrink] = React.useState(shrinkProps);
|
|
2027
|
-
const onClick = React.useCallback((e) => {
|
|
2028
|
-
setShrink(true);
|
|
2029
|
-
onChangeShrink === null || onChangeShrink === void 0 ? void 0 : onChangeShrink(true);
|
|
2030
|
-
if (shrink) {
|
|
2031
|
-
return;
|
|
2032
|
-
}
|
|
2033
|
-
const $textEl = e.currentTarget.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])');
|
|
2034
|
-
const $focusEl = $textEl.item($textEl.length - 1);
|
|
2035
|
-
if ($focusEl) {
|
|
2036
|
-
$focusEl.focus();
|
|
2037
|
-
setTimeout(() => {
|
|
2038
|
-
$focusEl.scrollIntoView({
|
|
2039
|
-
behavior: 'auto',
|
|
2040
|
-
block: 'center',
|
|
2041
|
-
inline: 'start',
|
|
2042
|
-
});
|
|
2043
|
-
}, 100);
|
|
2044
|
-
}
|
|
2045
|
-
}, [shrink]);
|
|
2046
|
-
React.useEffect(() => {
|
|
2047
|
-
setShrink(shrinkProps);
|
|
2048
|
-
}, [shrinkProps]);
|
|
2049
|
-
return (React__default["default"].createElement(StyledTextFieldContainer$1, Object.assign({ shrink: shrink, className: core.clsx(className, 'textField', { textField_shrink: !!shrink }) }, restProps),
|
|
2050
|
-
React__default["default"].createElement("div", { ref: containerRef, onClick: onClick, className: "textField_wrapper" }, children)));
|
|
2051
|
-
};
|
|
2052
|
-
const ChoiceField$1 = (props) => {
|
|
2053
|
-
const { children, className } = props, restProps = tslib_es6.__rest(props, ["children", "className"]);
|
|
2054
|
-
return (React__default["default"].createElement(StyledChoiceFieldContainer$1, Object.assign({ className: core.clsx(className, 'choiceField') }, restProps), children));
|
|
2055
|
-
};
|
|
2056
|
-
|
|
2057
|
-
const libraries = ['places'];
|
|
2058
|
-
const GoogleLocationBlock = (props) => {
|
|
2059
|
-
var _a;
|
|
2060
|
-
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = tslib_es6.__rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
2061
|
-
const [LoadScript, setLoadScript] = React.useState(null);
|
|
2062
|
-
const [value, setValue] = React.useState(defaultValue || valueProps);
|
|
2063
|
-
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]);
|
|
2064
|
-
const onChangeAutocomplete = React.useCallback((s) => {
|
|
2065
|
-
setValue(s);
|
|
2066
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
2067
|
-
}, []);
|
|
2068
|
-
const onClickItem = React.useCallback((item) => {
|
|
2069
|
-
/** For sure get value */
|
|
2070
|
-
setValue(item.value);
|
|
2071
|
-
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
2072
|
-
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
2073
|
-
}, [onChangeProps, predictions]);
|
|
2074
|
-
React.useEffect(() => {
|
|
2075
|
-
setValue(valueProps);
|
|
2076
|
-
}, [valueProps]);
|
|
2077
|
-
React.useEffect(() => {
|
|
2078
|
-
var _a, _b, _c;
|
|
2079
|
-
// only load extra google script when not yet loaded
|
|
2080
|
-
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) {
|
|
2081
|
-
Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@react-google-maps/api')); }).then((m) => {
|
|
2082
|
-
setLoadScript(() => m.LoadScript);
|
|
2083
|
-
});
|
|
2084
|
-
}
|
|
2085
|
-
}, []);
|
|
2086
|
-
return (React__default["default"].createElement(core.Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
2087
|
-
return { value: pred.description, label: pred.description };
|
|
2088
|
-
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: index$7.ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
2089
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2090
|
-
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%' } })),
|
|
2091
|
-
children));
|
|
2092
|
-
} }, restProps)));
|
|
2093
|
-
};
|
|
2094
|
-
|
|
2095
|
-
const LEADGEN_ORDER_INPUT_WRAPPER = [
|
|
2096
|
-
'label',
|
|
2097
|
-
'input',
|
|
2098
|
-
'description',
|
|
2099
|
-
'error',
|
|
2100
|
-
];
|
|
2101
|
-
const LeadGenForm = React.forwardRef((props, ref) => {
|
|
2102
|
-
const { locale, blocks, scrollToErrorField = true, form: formProps, rules: validate, initialValues, onFinish, onFinishFailed, className, style, } = props;
|
|
2103
|
-
const formRef = React.useRef(null);
|
|
2104
|
-
const form$1 = formProps || form.useForm({ initialValues, validate });
|
|
2105
|
-
const middlewareFinish = (values, event) => {
|
|
2106
|
-
onFinish === null || onFinish === void 0 ? void 0 : onFinish(values, event);
|
|
2107
|
-
};
|
|
2108
|
-
const middlewareFinishFailed = (errors, values, events) => {
|
|
2109
|
-
if (scrollToErrorField && errors) {
|
|
2110
|
-
const firstErrorKey = Object.keys(errors)[0];
|
|
2111
|
-
const firstErrorElement = document.querySelector(`[name="${firstErrorKey}"]`);
|
|
2112
|
-
if (firstErrorElement && (firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus)) {
|
|
2113
|
-
setTimeout(() => {
|
|
2114
|
-
firstErrorElement === null || firstErrorElement === void 0 ? void 0 : firstErrorElement.focus();
|
|
2115
|
-
firstErrorElement.scrollIntoView({
|
|
2116
|
-
behavior: 'auto',
|
|
2117
|
-
block: 'center',
|
|
2118
|
-
inline: 'center',
|
|
2119
|
-
});
|
|
2120
|
-
}, 100);
|
|
2121
|
-
}
|
|
2122
|
-
}
|
|
2123
|
-
onFinishFailed === null || onFinishFailed === void 0 ? void 0 : onFinishFailed(errors, values, events);
|
|
2124
|
-
};
|
|
2125
|
-
React.useEffect(() => {
|
|
2126
|
-
(() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
2127
|
-
if (!window.intlTelInputUtils) {
|
|
2128
|
-
yield require('intl-tel-input/build/js/utils');
|
|
2129
|
-
}
|
|
2130
|
-
}))();
|
|
2131
|
-
}, []);
|
|
2132
|
-
React.useImperativeHandle(ref, () => (Object.assign(Object.assign({}, form$1), { submit: () => formRef.current.requestSubmit() })), [form$1, formRef]);
|
|
2133
|
-
if (!blocks || !blocks.length) {
|
|
2134
|
-
return null;
|
|
2135
|
-
}
|
|
2136
|
-
return (React__default["default"].createElement("form", { ref: formRef, onSubmit: form$1.onSubmit(middlewareFinish, middlewareFinishFailed), className: className, style: style },
|
|
2137
|
-
React__default["default"].createElement(StyledLeadGenFormInner, { className: "leadgen-form_inputs" }, blocks.map((block, idx) => {
|
|
2138
|
-
const { id, name: blockName, data } = block;
|
|
2139
|
-
const { placeholder, value: name, required, listQuestion, valueHTML, isSendMailChimp = false, } = data;
|
|
2140
|
-
const formInputProps = form$1.getInputProps(name);
|
|
2141
|
-
const { value, error } = formInputProps;
|
|
2142
|
-
const reactKey = `${id}-${idx}`;
|
|
2143
|
-
switch (blockName) {
|
|
2144
|
-
case LEADGEN_BLOCK.TextBlock: {
|
|
2145
|
-
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2146
|
-
React__default["default"].createElement(core.TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "text", "data-control": "text" }, formInputProps))));
|
|
2147
|
-
}
|
|
2148
|
-
case LEADGEN_BLOCK.NumberBlock: {
|
|
2149
|
-
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2150
|
-
React__default["default"].createElement(core.NumberInput, Object.assign({ name: value, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "number", "data-control": "number" }, formInputProps))));
|
|
2151
|
-
}
|
|
2152
|
-
case LEADGEN_BLOCK.EmailBlock: {
|
|
2153
|
-
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2154
|
-
React__default["default"].createElement(core.TextInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, "data-control": "email" }, formInputProps))));
|
|
2155
|
-
}
|
|
2156
|
-
case LEADGEN_BLOCK.PhoneOtpBlock:
|
|
2157
|
-
case LEADGEN_BLOCK.WhatsappOtpBlock:
|
|
2158
|
-
case LEADGEN_BLOCK.ZaloOtpBlock:
|
|
2159
|
-
case LEADGEN_BLOCK.PhoneBlock: {
|
|
2160
|
-
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2161
|
-
React__default["default"].createElement(PhoneInput, Object.assign({ name: name, spellCheck: false, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, defaultCountry: (locale ? utils.MAPPED_LOCALE[locale] || 'VN' : 'VN'), type: "text", "data-control": "text" }, formInputProps))));
|
|
2162
|
-
}
|
|
2163
|
-
case LEADGEN_BLOCK.LocationBlock: {
|
|
2164
|
-
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2165
|
-
React__default["default"].createElement(GoogleLocationBlock, Object.assign({ name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, locale: locale, "data-control": "text" }, formInputProps))));
|
|
2166
|
-
}
|
|
2167
|
-
case LEADGEN_BLOCK.DateBlock: {
|
|
2168
|
-
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2169
|
-
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: placeholder, placeholder: placeholder, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, type: "default", "data-control": "date" }, formInputProps))));
|
|
2170
|
-
}
|
|
2171
|
-
case LEADGEN_BLOCK.DropdownBlock:
|
|
2172
|
-
return (React__default["default"].createElement(TextField$1, { key: reactKey, shrink: !!value, className: "leadgen-form_input" },
|
|
2173
|
-
React__default["default"].createElement("div", { style: { display: 'none' }, "data-extra": true, "data-name": value, "data-control": 'dropdown' }),
|
|
2174
|
-
React__default["default"].createElement(core.Select, Object.assign({ name: name, withAsterisk: required, label: placeholder, placeholder: placeholder, data: listQuestion.map((l) => ({
|
|
2175
|
-
value: l.value,
|
|
2176
|
-
label: l.placeholder,
|
|
2177
|
-
})) }, formInputProps))));
|
|
2178
|
-
case LEADGEN_BLOCK.CheckboxBlock: {
|
|
2179
|
-
const formInputCheckboxProps = form$1.getInputProps(name, {
|
|
2180
|
-
type: 'checkbox',
|
|
2181
|
-
});
|
|
2182
|
-
return (React__default["default"].createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2183
|
-
isSendMailChimp && (React__default["default"].createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2184
|
-
React__default["default"].createElement(core.Checkbox.Group, Object.assign({ size: "md", withAsterisk: required, label: placeholder, value: value, sx: {
|
|
2185
|
-
display: 'flex',
|
|
2186
|
-
flexDirection: 'column',
|
|
2187
|
-
flexWrap: 'wrap',
|
|
2188
|
-
gap: 8,
|
|
2189
|
-
}, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
|
|
2190
|
-
return (React__default["default"].createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
2191
|
-
} }, formInputCheckboxProps), listQuestion.map((l, _idx) => (React__default["default"].createElement(core.Checkbox, { name: name, key: _idx, value: l.value, label: l.placeholder, "data-control": "checkbox" }))))));
|
|
2192
|
-
}
|
|
2193
|
-
case LEADGEN_BLOCK.RadioBlock: {
|
|
2194
|
-
return (React__default["default"].createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2195
|
-
isSendMailChimp && (React__default["default"].createElement("div", { style: { display: 'none' }, "data-name": name + '-mailchimp' })),
|
|
2196
|
-
React__default["default"].createElement(core.Radio.Group, Object.assign({ size: "md", withAsterisk: required, label: placeholder, value: value, spellCheck: true, inputWrapperOrder: LEADGEN_ORDER_INPUT_WRAPPER, inputContainer: (children) => {
|
|
2197
|
-
return (React__default["default"].createElement("div", { className: "leadgen-choiceContainer" }, children));
|
|
2198
|
-
} }, formInputProps), listQuestion.map((l, _index) => (React__default["default"].createElement(core.Radio, { name: name, key: _index, value: l.value, label: l.placeholder, "data-control": "radio" }))))));
|
|
2199
|
-
}
|
|
2200
|
-
case 'TncBlock':
|
|
2201
|
-
return (React__default["default"].createElement(ChoiceField$1, { className: "leadgen-form_input leadgen-form_input_checkbox", key: reactKey },
|
|
2202
|
-
React__default["default"].createElement(core.Input.Wrapper, { error: error },
|
|
2203
|
-
React__default["default"].createElement(core.Checkbox, Object.assign({ value: value, name: 'TNC-' + id, label: React__default["default"].createElement("p", { className: "lead-modal__tnc-link", dangerouslySetInnerHTML: { __html: valueHTML } }), className: "tnc-block", "data-control": "checkbox" }, formInputProps)))));
|
|
2204
|
-
default: {
|
|
2205
|
-
return null;
|
|
2206
|
-
}
|
|
2207
|
-
}
|
|
2208
|
-
}))));
|
|
2209
|
-
});
|
|
2210
|
-
|
|
2211
|
-
const StyledLeadGenThankYou = styled__default["default"].div `
|
|
2212
|
-
display: flex;
|
|
2213
|
-
gap: 8px;
|
|
2214
|
-
flex-direction: column;
|
|
2215
|
-
padding-block: 24px;
|
|
2216
|
-
|
|
2217
|
-
.leadgen-image {
|
|
2218
|
-
width: 120px;
|
|
2219
|
-
height: 120px;
|
|
2220
|
-
margin-inline: auto;
|
|
2221
|
-
object-fit: contain;
|
|
2222
|
-
object-position: center;
|
|
2223
|
-
text-align: center;
|
|
2224
|
-
}
|
|
2225
|
-
|
|
2226
|
-
.leadgen-title {
|
|
2227
|
-
margin-block: 0;
|
|
2228
|
-
color: ${miscTheme.theme.colors.gray900};
|
|
2229
|
-
font-weight: 700;
|
|
2230
|
-
font-size: 18px;
|
|
2231
|
-
line-height: 28px;
|
|
2232
|
-
letter-spacing: -0.2px;
|
|
2233
|
-
}
|
|
2234
|
-
|
|
2235
|
-
.leadgen-description {
|
|
2236
|
-
margin-block: 0;
|
|
2237
|
-
color: ${miscTheme.theme.colors.gray600};
|
|
2238
|
-
font-weight: 400;
|
|
2239
|
-
font-size: 14px;
|
|
2240
|
-
line-height: 22px;
|
|
2241
|
-
letter-spacing: -0.2px;
|
|
2242
|
-
text-align: center;
|
|
2243
|
-
}
|
|
2244
|
-
|
|
2245
|
-
> [data-align] {
|
|
2246
|
-
&[data-align='right'] {
|
|
2247
|
-
text-align: right;
|
|
2248
|
-
}
|
|
2249
|
-
&[data-align='center'] {
|
|
2250
|
-
text-align: center;
|
|
2251
|
-
}
|
|
2252
|
-
}
|
|
2253
|
-
`;
|
|
2254
|
-
const LeadGenThankYou = ({ image, title, description, showButton = false, button, className, style, }) => {
|
|
2255
|
-
const { src } = image;
|
|
2256
|
-
const { htmlText: titleText, align: titleAlign } = title;
|
|
2257
|
-
const { htmlText: descriptionText, align: descriptionAlign } = description;
|
|
2258
|
-
const { htmlText: buttonText, newtab, url, onClick } = button;
|
|
2259
|
-
return (React__default["default"].createElement(StyledLeadGenThankYou, { className: className, style: style },
|
|
2260
|
-
React__default["default"].createElement("img", { src: src, alt: "", className: "leadgen-thankyou_image leadgen-image" }),
|
|
2261
|
-
React__default["default"].createElement("p", { className: "leadgen-thankyou_title leadgen-title", "data-align": titleAlign }, titleText),
|
|
2262
|
-
React__default["default"].createElement("p", { className: "leadgen-thankyou_description leadgen-description", "data-align": descriptionAlign }, descriptionText),
|
|
2263
|
-
!!buttonText && showButton && (React__default["default"].createElement(core.Button, { component: url ? 'a' : 'button', target: newtab ? '_blank' : undefined, href: url, size: "lg", variant: "filled", className: "leadgen-thankyoue_btn leadgen-btn", onClick: onClick }, buttonText))));
|
|
2264
|
-
};
|
|
2265
|
-
|
|
2266
|
-
const StyledLeadGenSubscriptionBoxBody = styled__default["default"].div `
|
|
2267
|
-
margin-top: 16px;
|
|
2268
|
-
.leadgen-btn {
|
|
2269
|
-
margin-top: 16px;
|
|
2270
|
-
}
|
|
2271
|
-
`;
|
|
2272
|
-
const StyledLeadGenSubscriptionBoxHeaderImage = styled__default["default"].div `
|
|
2273
|
-
margin-top: 3px;
|
|
2274
|
-
margin-right: 20px;
|
|
2275
|
-
width: 44px;
|
|
2276
|
-
height: 44px;
|
|
2277
|
-
|
|
2278
|
-
img {
|
|
2279
|
-
width: 100%;
|
|
2280
|
-
height: 100%;
|
|
2281
|
-
object-fix: contain;
|
|
2282
|
-
onject-position: center;
|
|
2283
|
-
}
|
|
2284
|
-
|
|
2285
|
-
:has(img[src='']) {
|
|
2286
|
-
display: none;
|
|
2287
|
-
}
|
|
2288
|
-
`;
|
|
2289
|
-
const StyledLeadGenSubscriptionBoxHeader = styled__default["default"].div `
|
|
2290
|
-
display: flex;
|
|
2291
|
-
align-items: center;
|
|
2292
|
-
margin-bottom: 16px;
|
|
2293
|
-
.leadgen-title {
|
|
2294
|
-
margin-bottom: 0;
|
|
2295
|
-
flex: 1;
|
|
2296
|
-
min-width: 0;
|
|
2297
|
-
color: ${miscTheme.theme.colors.gray900};
|
|
2298
|
-
font-size: 18px;
|
|
2299
|
-
font-weight: 600;
|
|
2300
|
-
line-height: 1.4;
|
|
2301
|
-
letter-spacing: -0.8px;
|
|
2302
|
-
}
|
|
2303
|
-
`;
|
|
2304
|
-
const StyledLeadGenSubscriptionBox = styled__default["default"].div `
|
|
2305
|
-
padding: 16px;
|
|
2306
|
-
border: 1px solid ${miscTheme.theme.colors.neutral100};
|
|
2307
|
-
border-radius: 12px;
|
|
2308
|
-
margin-inline: auto;
|
|
2309
|
-
.leadgen-form_inputs {
|
|
2310
|
-
.leadgen-form_input {
|
|
2311
|
-
width: 100%;
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2314
|
-
|
|
2315
|
-
.leadgen-form_input {
|
|
2316
|
-
.mantine-Input-wrapper {
|
|
2317
|
-
max-height: 56px;
|
|
2318
|
-
}
|
|
2319
|
-
}
|
|
2320
|
-
|
|
2321
|
-
@media screen and (min-width: 768px) {
|
|
2322
|
-
.leadgen-subscription_box_body {
|
|
2323
|
-
display: flex;
|
|
2324
|
-
> form {
|
|
2325
|
-
flex: 1;
|
|
2326
|
-
min-width: 0;
|
|
2327
|
-
|
|
2328
|
-
.leadgen-form_inputs {
|
|
2329
|
-
.leadgen-form_input {
|
|
2330
|
-
width: calc(50% - 4px);
|
|
2331
|
-
}
|
|
2332
|
-
}
|
|
2333
|
-
}
|
|
2334
|
-
|
|
2335
|
-
.leadgen-btn {
|
|
2336
|
-
margin-top: 0;
|
|
2337
|
-
margin-left: 8px;
|
|
2338
|
-
width: auto;
|
|
2339
|
-
min-height: 56px;
|
|
2340
|
-
}
|
|
2341
|
-
}
|
|
2342
|
-
}
|
|
2343
|
-
`;
|
|
2344
|
-
const LeadGenSubscriptionBoxWithoutMemo = ({ locale, userInfo, siteId, siteDomain, forceCampaign, campaign_code, article_id, subscription_title: subscriptionTitleProps, }) => {
|
|
2345
|
-
var _a, _b, _c;
|
|
2346
|
-
const refContainer = React.useRef(null);
|
|
2347
|
-
const validatingEmailRef = React.useRef(false);
|
|
2348
|
-
const validatingPhoneRef = React.useRef(false);
|
|
2349
|
-
const { image, extra_fields, id: campaign_id, bot_id: campaign_subot_id = [], ThankYouBlock, } = forceCampaign || {};
|
|
2350
|
-
const { textBlocks, listBlockAdded, actionBlocks } = extra_fields || {};
|
|
2351
|
-
const { submitBlock } = actionBlocks || {};
|
|
2352
|
-
const [loading, setLoading] = React.useState(false);
|
|
2353
|
-
const [showThankyou, setShowThankyou] = React.useState(false);
|
|
2354
|
-
const formRef = React.useRef(null);
|
|
2355
|
-
const { form, validateObj } = useLeadFormConfig({
|
|
2356
|
-
listBlockAdded,
|
|
2357
|
-
campaignId: campaign_id,
|
|
2358
|
-
campaign_subot_id,
|
|
2359
|
-
validatingEmailRef,
|
|
2360
|
-
validatingPhoneRef,
|
|
2361
|
-
userInfo,
|
|
2362
|
-
});
|
|
2363
|
-
const subscription_title = React.useMemo(() => { var _a, _b; return subscriptionTitleProps || ((_b = (_a = textBlocks === null || textBlocks === void 0 ? void 0 : textBlocks.titleBlock) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.value); }, [subscriptionTitleProps, (_b = (_a = textBlocks === null || textBlocks === void 0 ? void 0 : textBlocks.titleBlock) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.value]);
|
|
2364
|
-
const { image: thankyouImage, title: thankyouTitle, description: thankyouDescription, button: thankyouButton, } = ThankYouBlock || {};
|
|
2365
|
-
const { apiUrl } = React.useMemo(() => {
|
|
2366
|
-
let apiUrl = leadStore.apiLeadUrl;
|
|
2367
|
-
if (apiUrl.includes('localhost')) {
|
|
2368
|
-
apiUrl = 'https://dev.leadgen.hellobacsi.com/';
|
|
2369
|
-
}
|
|
2370
|
-
return {
|
|
2371
|
-
apiUrl,
|
|
2372
|
-
};
|
|
2373
|
-
}, [siteDomain, siteId]);
|
|
2374
|
-
const url = React.useMemo(() => location.href.toLowerCase() || '', []);
|
|
2375
|
-
const article_title = React.useMemo(() => document.title || '', []);
|
|
2376
|
-
const cookie_id = React.useMemo(() => miscCookieHelper.getCookie('hhg-id') || null, []);
|
|
2377
|
-
const ga_client_id = React.useMemo(() => miscCookieHelper.getCookie('_ga') || null, []);
|
|
2378
|
-
const leadgenImpression = React.useCallback(() => {
|
|
2379
|
-
Service.campaignPostImpression({
|
|
2380
|
-
url,
|
|
2381
|
-
action: LEADGEN_ACTIONS.SCROLL,
|
|
2382
|
-
code: campaign_code,
|
|
2383
|
-
title_article: article_title,
|
|
2384
|
-
cookie_id,
|
|
2385
|
-
ga_client_id,
|
|
2386
|
-
extra: { cookie_id, article_id, subscription_title },
|
|
2387
|
-
});
|
|
2388
|
-
}, [
|
|
2389
|
-
article_id,
|
|
2390
|
-
article_title,
|
|
2391
|
-
cookie_id,
|
|
2392
|
-
ga_client_id,
|
|
2393
|
-
campaign_code,
|
|
2394
|
-
subscription_title,
|
|
2395
|
-
]);
|
|
2396
|
-
const intersectionObserverCallback = React.useCallback((entries) => {
|
|
2397
|
-
entries.forEach((entry) => {
|
|
2398
|
-
const { isIntersecting, target } = entry;
|
|
2399
|
-
if (isIntersecting && target === refContainer.current) {
|
|
2400
|
-
leadgenImpression();
|
|
2401
|
-
}
|
|
2402
|
-
});
|
|
2403
|
-
}, [leadgenImpression]);
|
|
2404
|
-
const IObserver = new IntersectionObserver(intersectionObserverCallback);
|
|
2405
|
-
const middlewareOnSubmit = React.useCallback((value) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
2406
|
-
const newValue = {
|
|
2407
|
-
url,
|
|
2408
|
-
article_title,
|
|
2409
|
-
cookie_id,
|
|
2410
|
-
ga_client_id,
|
|
2411
|
-
article_id,
|
|
2412
|
-
campaign_id,
|
|
2413
|
-
campaign_code,
|
|
2414
|
-
subscription_title: subscription_title,
|
|
2415
|
-
};
|
|
2416
|
-
listBlockAdded.forEach(({ data: { value: k } }) => {
|
|
2417
|
-
newValue[k] = value[k];
|
|
2418
|
-
});
|
|
2419
|
-
setLoading(true);
|
|
2420
|
-
try {
|
|
2421
|
-
const { _data } = (yield Service.campaignPostLead({ data: newValue })) || {};
|
|
2422
|
-
const { model } = _data;
|
|
2423
|
-
if (model && model.id) {
|
|
2424
|
-
setShowThankyou(true);
|
|
2425
|
-
}
|
|
2426
|
-
}
|
|
2427
|
-
catch (error) {
|
|
2428
|
-
console.log('** Error : ', error);
|
|
2429
|
-
}
|
|
2430
|
-
setLoading(false);
|
|
2431
|
-
}), [
|
|
2432
|
-
url,
|
|
2433
|
-
article_id,
|
|
2434
|
-
article_title,
|
|
2435
|
-
cookie_id,
|
|
2436
|
-
ga_client_id,
|
|
2437
|
-
campaign_code,
|
|
2438
|
-
subscription_title,
|
|
2439
|
-
listBlockAdded,
|
|
2440
|
-
]);
|
|
2441
|
-
React.useEffect(() => {
|
|
2442
|
-
if (refContainer.current) {
|
|
2443
|
-
IObserver.observe(refContainer.current);
|
|
2444
|
-
}
|
|
2445
|
-
return () => {
|
|
2446
|
-
IObserver.disconnect();
|
|
2447
|
-
};
|
|
2448
|
-
}, [
|
|
2449
|
-
url,
|
|
2450
|
-
article_id,
|
|
2451
|
-
article_title,
|
|
2452
|
-
ga_client_id,
|
|
2453
|
-
campaign_id,
|
|
2454
|
-
campaign_code,
|
|
2455
|
-
subscription_title,
|
|
2456
|
-
]);
|
|
2457
|
-
return (React__default["default"].createElement("div", { ref: refContainer },
|
|
2458
|
-
React__default["default"].createElement(StyledLeadGenSubscriptionBox, null,
|
|
2459
|
-
showThankyou && (React__default["default"].createElement(LeadGenThankYou, { image: Object.assign(Object.assign({}, thankyouImage), { src: thankyouImage.src || `${apiUrl}admin/img/thanksyou.png` }), title: thankyouTitle, description: thankyouDescription, button: thankyouButton })),
|
|
2460
|
-
!showThankyou && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2461
|
-
React__default["default"].createElement(StyledLeadGenSubscriptionBoxHeader, null,
|
|
2462
|
-
!!image && (React__default["default"].createElement(StyledLeadGenSubscriptionBoxHeaderImage, null,
|
|
2463
|
-
React__default["default"].createElement("img", { src: image, alt: "" }))),
|
|
2464
|
-
React__default["default"].createElement("p", { className: "leadgen-title" }, subscription_title)),
|
|
2465
|
-
React__default["default"].createElement(StyledLeadGenSubscriptionBoxBody, { className: "leadgen-subscription_box_body" },
|
|
2466
|
-
React__default["default"].createElement(LeadGenForm, { ref: formRef, form: form, rules: validateObj, blocks: listBlockAdded, locale: locale, onFinish: middlewareOnSubmit }),
|
|
2467
|
-
React__default["default"].createElement(core.Button, { disabled: loading, loading: loading, variant: "filled", size: "lg", onClick: () => { var _a; return (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit(); }, className: "leadgen-btn leadgen-btn_action", fullWidth: true }, (_c = submitBlock === null || submitBlock === void 0 ? void 0 : submitBlock.data) === null || _c === void 0 ? void 0 : _c.value)))))));
|
|
2468
|
-
};
|
|
2469
|
-
const LeadGenSubscriptionBoxWithMemo = React.memo(LeadGenSubscriptionBoxWithoutMemo);
|
|
2470
|
-
|
|
2471
|
-
const Container = () => {
|
|
2472
|
-
const context = React.useContext(LeadGenSubscriptionBoxContext);
|
|
2473
|
-
const {
|
|
2474
|
-
// apiUrl: apiUrlProps,
|
|
2475
|
-
// apiSubotUrl,
|
|
2476
|
-
campaign_code, article_id, subscription_title, locale, siteId, siteDomain, userInfo, forceCampaign, } = context;
|
|
2477
|
-
if (!forceCampaign || !(forceCampaign === null || forceCampaign === void 0 ? void 0 : forceCampaign.id)) {
|
|
2478
|
-
return null;
|
|
2479
|
-
}
|
|
2480
|
-
return (React__default["default"].createElement(LeadGenSubscriptionBoxWithMemo, { locale: locale, userInfo: userInfo, siteId: siteId, siteDomain: siteDomain, forceCampaign: forceCampaign, campaign_code: campaign_code, article_id: article_id, subscription_title: subscription_title }));
|
|
2481
|
-
};
|
|
2482
|
-
Container.displayName = 'LeadGenSubscriptionBox';
|
|
2483
|
-
const LeadGenSubscriptionBoxContainer = (props) => {
|
|
2484
|
-
const { campaign_code } = props;
|
|
2485
|
-
if (!campaign_code) {
|
|
2486
|
-
return null;
|
|
2487
|
-
}
|
|
2488
|
-
return (React__default["default"].createElement(LeadGenSubscriptionBoxProvider, Object.assign({}, props),
|
|
2489
|
-
React__default["default"].createElement(Container, null)));
|
|
2490
|
-
};
|
|
2491
|
-
const LeadGenSubscriptionBox = LeadGenSubscriptionBoxContainer;
|
|
2492
|
-
|
|
2493
|
-
const useImageSize = (src) => {
|
|
2494
|
-
const [width, setWidth] = React.useState(16);
|
|
2495
|
-
const [height, setHeight] = React.useState(9);
|
|
2496
|
-
const [loaded, setLoaded] = React.useState(false);
|
|
2497
|
-
// load src image to get its width and height
|
|
2498
|
-
React.useEffect(() => {
|
|
2499
|
-
setLoaded(false);
|
|
2500
|
-
if (src) {
|
|
2501
|
-
const img = new Image();
|
|
2502
|
-
img.addEventListener('load', () => {
|
|
2503
|
-
setWidth(img.naturalWidth);
|
|
2504
|
-
setHeight(img.naturalHeight);
|
|
2505
|
-
setLoaded(true);
|
|
2506
|
-
});
|
|
2507
|
-
img.addEventListener('error', () => {
|
|
2508
|
-
setWidth(16);
|
|
2509
|
-
setHeight(9);
|
|
2510
|
-
setLoaded(true);
|
|
2511
|
-
});
|
|
2512
|
-
img.src = src;
|
|
2513
|
-
}
|
|
2514
|
-
else {
|
|
2515
|
-
setWidth(16);
|
|
2516
|
-
setHeight(9);
|
|
2517
|
-
setLoaded(true);
|
|
2518
|
-
}
|
|
2519
|
-
}, [src]);
|
|
2520
|
-
return {
|
|
2521
|
-
loaded,
|
|
2522
|
-
width,
|
|
2523
|
-
height,
|
|
2524
|
-
};
|
|
2525
|
-
};
|
|
2526
|
-
|
|
2527
|
-
const CloseButton = ({ onClose, containerClassName, svgClassName, }) => (React__default["default"].createElement("button", { onClick: onClose, className: `le-newbuilder-close-button js-modal__close ${containerClassName || ''}` },
|
|
2528
|
-
React__default["default"].createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", className: svgClassName },
|
|
2529
|
-
React__default["default"].createElement("path", { d: "M9.99981 10.8432L14.0583 14.9017C14.1691 15.0125 14.3083 15.0691 14.476 15.0717C14.6437 15.0743 14.7854 15.0176 14.9013 14.9017C15.0172 14.7858 15.0752 14.6453 15.0752 14.4802C15.0752 14.3151 15.0172 14.1746 14.9013 14.0587L10.8429 10.0002L14.9013 5.9417C15.0121 5.83094 15.0688 5.69172 15.0713 5.52402C15.0739 5.35634 15.0172 5.21456 14.9013 5.09866C14.7854 4.98276 14.6449 4.9248 14.4798 4.9248C14.3147 4.9248 14.1742 4.98276 14.0583 5.09866L9.99981 9.15712L5.94133 5.09866C5.83057 4.98789 5.69135 4.93122 5.52365 4.92866C5.35598 4.92609 5.21419 4.98276 5.09829 5.09866C4.98239 5.21456 4.92444 5.35506 4.92444 5.52018C4.92444 5.6853 4.98239 5.82581 5.09829 5.9417L9.15675 10.0002L5.09829 14.0587C4.98752 14.1694 4.93085 14.3087 4.9283 14.4763C4.92572 14.644 4.98239 14.7858 5.09829 14.9017C5.21419 15.0176 5.3547 15.0756 5.51982 15.0756C5.68493 15.0756 5.82544 15.0176 5.94133 14.9017L9.99981 10.8432Z" }))));
|
|
2530
|
-
|
|
2531
|
-
// url: imageBlocks.imageMobile.data.url
|
|
2532
|
-
// newTab: imageBlocks.imageMobile.data.newtab
|
|
2533
|
-
// imageMobile: campaignShow.image
|
|
2534
|
-
// imageDestkop: campaignShow.image_desktop
|
|
2535
|
-
const CenterTabLayout = ({ popupId, url, newTab, imageDestkop, imageMobile, onClose, onOtherSubmit, }) => {
|
|
2536
|
-
const { width: imageMobileWidth, height: imageMobileHeight, loaded: imageMobileLoaded, } = useImageSize(imageMobile);
|
|
2537
|
-
const { width: imageDestkopWidth, height: imageDestkopHeight, loaded: imageDestkopLoaded, } = useImageSize(imageDestkop);
|
|
2538
|
-
if (!imageMobileLoaded || !imageDestkopLoaded)
|
|
2539
|
-
return null;
|
|
2540
|
-
return (React__default["default"].createElement("div", { id: popupId, className: "lead-modal-wrapper", "data-popup-url": location.pathname, "data-popup-type": "center_tab" },
|
|
2541
|
-
React__default["default"].createElement("div", { className: "le-center-tab-popup" },
|
|
2542
|
-
React__default["default"].createElement("div", { style: { position: 'relative' } },
|
|
2543
|
-
React__default["default"].createElement("a", { className: "js-popup-other-submit", href: url, target: newTab ? 'blank' : '_parent', onClick: onOtherSubmit },
|
|
2544
|
-
index$8.isVideo(imageMobile) ? (React__default["default"].createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-mobile" },
|
|
2545
|
-
React__default["default"].createElement("source", { src: imageMobile }))) : (React__default["default"].createElement("img", { className: "le-only-mobile", src: imageMobile, style: {
|
|
2546
|
-
aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
|
|
2547
|
-
} })),
|
|
2548
|
-
index$8.isVideo(imageDestkop) ? (React__default["default"].createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-desktop" },
|
|
2549
|
-
React__default["default"].createElement("source", { src: imageDestkop }))) : (React__default["default"].createElement("img", { className: "le-only-desktop", src: imageDestkop, style: {
|
|
2550
|
-
aspectRatio: `${imageDestkopWidth}/${imageDestkopHeight}`,
|
|
2551
|
-
} }))),
|
|
2552
|
-
React__default["default"].createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))));
|
|
1414
|
+
return (React__default["default"].createElement("div", { id: popupId, className: "lead-modal-wrapper", "data-popup-url": location.pathname, "data-popup-type": "center_tab" },
|
|
1415
|
+
React__default["default"].createElement("div", { className: "le-center-tab-popup" },
|
|
1416
|
+
React__default["default"].createElement("div", { style: { position: 'relative' } },
|
|
1417
|
+
React__default["default"].createElement("a", { className: "js-popup-other-submit", href: url, target: newTab ? 'blank' : '_parent', onClick: onOtherSubmit },
|
|
1418
|
+
index$7.isVideo(imageMobile) ? (React__default["default"].createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-mobile" },
|
|
1419
|
+
React__default["default"].createElement("source", { src: imageMobile }))) : (React__default["default"].createElement("img", { className: "le-only-mobile", src: imageMobile, style: {
|
|
1420
|
+
aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
|
|
1421
|
+
} })),
|
|
1422
|
+
index$7.isVideo(imageDestkop) ? (React__default["default"].createElement("video", { loop: true, muted: true, autoPlay: true, className: "le-only-desktop" },
|
|
1423
|
+
React__default["default"].createElement("source", { src: imageDestkop }))) : (React__default["default"].createElement("img", { className: "le-only-desktop", src: imageDestkop, style: {
|
|
1424
|
+
aspectRatio: `${imageDestkopWidth}/${imageDestkopHeight}`,
|
|
1425
|
+
} }))),
|
|
1426
|
+
React__default["default"].createElement(CloseButton, { onClose: onClose, containerClassName: "close-button-top-right" })))));
|
|
2553
1427
|
};
|
|
2554
1428
|
|
|
2555
1429
|
// title: titleText
|
|
@@ -2771,6 +1645,211 @@ const EmptyComponent = ({ onClose, onContinue, }) => {
|
|
|
2771
1645
|
React__default["default"].createElement(core.Button, { onClick: onContinue, size: "lg", variant: "filled", fullWidth: false, className: "leadgen-btn leadgen-btn_empty_again" }, t('lead.empty.submitAgain')))));
|
|
2772
1646
|
};
|
|
2773
1647
|
|
|
1648
|
+
const libraries = ['places'];
|
|
1649
|
+
const GoogleLocationBlock = (props) => {
|
|
1650
|
+
var _a;
|
|
1651
|
+
const { inputWrapperOrder = ['label', 'input', 'description', 'error'], defaultValue, value: valueProps, onChange: onChangeProps, locale } = props, restProps = tslib_es6.__rest(props, ["inputWrapperOrder", "defaultValue", "value", "onChange", "locale"]);
|
|
1652
|
+
const [LoadScript, setLoadScript] = React.useState(null);
|
|
1653
|
+
const [value, setValue] = React.useState(defaultValue || valueProps);
|
|
1654
|
+
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]);
|
|
1655
|
+
const onChangeAutocomplete = React.useCallback((s) => {
|
|
1656
|
+
setValue(s);
|
|
1657
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(s);
|
|
1658
|
+
}, []);
|
|
1659
|
+
const onClickItem = React.useCallback((item) => {
|
|
1660
|
+
/** For sure get value */
|
|
1661
|
+
setValue(item.value);
|
|
1662
|
+
const predCur = predictions === null || predictions === void 0 ? void 0 : predictions.find(({ description }) => description === item.value);
|
|
1663
|
+
onChangeProps === null || onChangeProps === void 0 ? void 0 : onChangeProps(item.value, predCur === null || predCur === void 0 ? void 0 : predCur.rawData);
|
|
1664
|
+
}, [onChangeProps, predictions]);
|
|
1665
|
+
React.useEffect(() => {
|
|
1666
|
+
setValue(valueProps);
|
|
1667
|
+
}, [valueProps]);
|
|
1668
|
+
React.useEffect(() => {
|
|
1669
|
+
var _a, _b, _c;
|
|
1670
|
+
// only load extra google script when not yet loaded
|
|
1671
|
+
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) {
|
|
1672
|
+
Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('@react-google-maps/api')); }).then((m) => {
|
|
1673
|
+
setLoadScript(() => m.LoadScript);
|
|
1674
|
+
});
|
|
1675
|
+
}
|
|
1676
|
+
}, []);
|
|
1677
|
+
return (React__default["default"].createElement(core.Autocomplete, Object.assign({ defaultValue: defaultValue, value: value, onChange: onChangeAutocomplete, data: predictions.map((pred) => {
|
|
1678
|
+
return { value: pred.description, label: pred.description };
|
|
1679
|
+
}), filter: () => true, onItemSubmit: onClickItem, inputWrapperOrder: inputWrapperOrder, zIndex: index$8.ZINDEX_SSO - 9e6 + 2, withinPortal: true, styles: { dropdown: { pointerEvents: 'auto' } }, inputContainer: (children) => {
|
|
1680
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1681
|
+
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%' } })),
|
|
1682
|
+
children));
|
|
1683
|
+
} }, restProps)));
|
|
1684
|
+
};
|
|
1685
|
+
|
|
1686
|
+
// You can give context variables any name
|
|
1687
|
+
const [LeadFormProvider, useLeadFormContext, useLeadForm] = form.createFormContext();
|
|
1688
|
+
const useLeadFormConfig = ({ listBlockAdded = [], validatingPhoneRef, validatingEmailRef, campaignId, campaign_subot_id = [], userInfo, }) => {
|
|
1689
|
+
const { t } = index.useTranslations();
|
|
1690
|
+
const initialValues = React.useMemo(() => mappingSSOToLead(userInfo), [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
1691
|
+
const validateObj = React.useMemo(() => {
|
|
1692
|
+
const InputBlocks = [
|
|
1693
|
+
'TextBlock',
|
|
1694
|
+
'NumberBlock',
|
|
1695
|
+
'EmailBlock',
|
|
1696
|
+
'PhoneBlock',
|
|
1697
|
+
'DateBlock',
|
|
1698
|
+
'CheckboxBlock',
|
|
1699
|
+
'RadioBlock',
|
|
1700
|
+
'DropdownBlock',
|
|
1701
|
+
'PhoneOtpBlock',
|
|
1702
|
+
'WhatsappOtpBlock',
|
|
1703
|
+
'ZaloOtpBlock',
|
|
1704
|
+
'LocationBlock',
|
|
1705
|
+
'TncBlock',
|
|
1706
|
+
];
|
|
1707
|
+
// ALL are required and can skip if not touched yet
|
|
1708
|
+
const withSharedCheck = (name, cb,
|
|
1709
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1710
|
+
block) => {
|
|
1711
|
+
return (value) => {
|
|
1712
|
+
var _a;
|
|
1713
|
+
const isBLockRequired = (_a = block === null || block === void 0 ? void 0 : block.data) === null || _a === void 0 ? void 0 : _a.required;
|
|
1714
|
+
if (!formRef.current.isTouched(name))
|
|
1715
|
+
return;
|
|
1716
|
+
if ((typeof value === 'string' && value.replace(' ', '') === '') ||
|
|
1717
|
+
typeof value === 'undefined' ||
|
|
1718
|
+
value === '' ||
|
|
1719
|
+
(Array.isArray(value) && value.length === 0)) {
|
|
1720
|
+
return isBLockRequired
|
|
1721
|
+
? t('validator.required')
|
|
1722
|
+
: cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1723
|
+
}
|
|
1724
|
+
return cb === null || cb === void 0 ? void 0 : cb(value);
|
|
1725
|
+
};
|
|
1726
|
+
};
|
|
1727
|
+
return listBlockAdded
|
|
1728
|
+
.filter((b) => InputBlocks.includes(b.name))
|
|
1729
|
+
.reduce((r, b) => {
|
|
1730
|
+
var _a;
|
|
1731
|
+
const isRequired = (_a = b.data.required) !== null && _a !== void 0 ? _a : true;
|
|
1732
|
+
if (b.name === 'NumberBlock') {
|
|
1733
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1734
|
+
if (value && isNaN(Number(value))) {
|
|
1735
|
+
return t('validator.number');
|
|
1736
|
+
}
|
|
1737
|
+
}, b) });
|
|
1738
|
+
}
|
|
1739
|
+
else if (b.name === 'EmailBlock') {
|
|
1740
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1741
|
+
if (value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
1742
|
+
return t('validator.email');
|
|
1743
|
+
}
|
|
1744
|
+
if (!value)
|
|
1745
|
+
return;
|
|
1746
|
+
validatingEmailRef.current = true;
|
|
1747
|
+
setTimeout(() => {
|
|
1748
|
+
formRef.current.setFieldError(b.data.value, 'Validating...');
|
|
1749
|
+
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1750
|
+
email: value,
|
|
1751
|
+
})
|
|
1752
|
+
.then((tKey) => {
|
|
1753
|
+
if (tKey) {
|
|
1754
|
+
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1755
|
+
}
|
|
1756
|
+
else {
|
|
1757
|
+
formRef.current.clearFieldError(b.data.value);
|
|
1758
|
+
}
|
|
1759
|
+
validatingEmailRef.current = false;
|
|
1760
|
+
})
|
|
1761
|
+
.catch((e) => {
|
|
1762
|
+
console.error(e);
|
|
1763
|
+
formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
|
|
1764
|
+
validatingEmailRef.current = false;
|
|
1765
|
+
});
|
|
1766
|
+
}, 200);
|
|
1767
|
+
}, b) });
|
|
1768
|
+
}
|
|
1769
|
+
else if (b.name === 'PhoneBlock' ||
|
|
1770
|
+
b.name === 'PhoneOtpBlock' ||
|
|
1771
|
+
b.name === 'ZaloOtpBlock' ||
|
|
1772
|
+
b.name === 'WhatsappOtpBlock') {
|
|
1773
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1774
|
+
if (value &&
|
|
1775
|
+
window.intlTelInputUtils &&
|
|
1776
|
+
!window.intlTelInputUtils.isValidNumber(String(value), LEAD_LOCALE.countryCode)) {
|
|
1777
|
+
return t('validator.phone');
|
|
1778
|
+
}
|
|
1779
|
+
if (!value)
|
|
1780
|
+
return;
|
|
1781
|
+
validatingPhoneRef.current = true;
|
|
1782
|
+
setTimeout(() => {
|
|
1783
|
+
formRef.current.setFieldError(b.data.value, 'Validating...');
|
|
1784
|
+
if (b.data.singleSubmission) {
|
|
1785
|
+
checkUsedPhoneOnlyWithCache(campaignId, value)
|
|
1786
|
+
.then((tKey) => {
|
|
1787
|
+
if (tKey) {
|
|
1788
|
+
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1789
|
+
}
|
|
1790
|
+
else {
|
|
1791
|
+
formRef.current.clearFieldError(b.data.value);
|
|
1792
|
+
}
|
|
1793
|
+
validatingPhoneRef.current = false;
|
|
1794
|
+
})
|
|
1795
|
+
.catch((err) => {
|
|
1796
|
+
console.error(err);
|
|
1797
|
+
formRef.current.setFieldError(b.data.value, err.message || 'Something went wrong');
|
|
1798
|
+
validatingPhoneRef.current = false;
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1801
|
+
else {
|
|
1802
|
+
checkUsedEmailOrPhoneWithCache(campaignId, campaign_subot_id, {
|
|
1803
|
+
phone: value,
|
|
1804
|
+
})
|
|
1805
|
+
.then((tKey) => {
|
|
1806
|
+
if (tKey) {
|
|
1807
|
+
formRef.current.setFieldError(b.data.value, t(tKey));
|
|
1808
|
+
}
|
|
1809
|
+
else {
|
|
1810
|
+
formRef.current.clearFieldError(b.data.value);
|
|
1811
|
+
}
|
|
1812
|
+
validatingPhoneRef.current = false;
|
|
1813
|
+
})
|
|
1814
|
+
.catch((e) => {
|
|
1815
|
+
console.error(e);
|
|
1816
|
+
formRef.current.setFieldError(b.data.value, e.message || 'Something went wrong');
|
|
1817
|
+
validatingPhoneRef.current = false;
|
|
1818
|
+
});
|
|
1819
|
+
}
|
|
1820
|
+
}, 200);
|
|
1821
|
+
}, b) });
|
|
1822
|
+
}
|
|
1823
|
+
else if (b.name === 'DateBlock') {
|
|
1824
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, (value) => {
|
|
1825
|
+
if (value && isNaN(Date.parse(value))) {
|
|
1826
|
+
return t('validator.date');
|
|
1827
|
+
}
|
|
1828
|
+
}, b) });
|
|
1829
|
+
}
|
|
1830
|
+
else if (b.name === 'TncBlock') {
|
|
1831
|
+
return Object.assign(Object.assign({}, r), { [`TNC-` + b.id]: withSharedCheck('TNC-' + b.id, (value) => {
|
|
1832
|
+
if (isRequired && !value) {
|
|
1833
|
+
return t('validator.required');
|
|
1834
|
+
}
|
|
1835
|
+
}, b) });
|
|
1836
|
+
}
|
|
1837
|
+
else {
|
|
1838
|
+
return Object.assign(Object.assign({}, r), { [b.data.value]: withSharedCheck(b.data.value, undefined, b) });
|
|
1839
|
+
}
|
|
1840
|
+
}, {});
|
|
1841
|
+
}, [listBlockAdded.map((b) => b.name).join(',')]);
|
|
1842
|
+
const form = useLeadForm({
|
|
1843
|
+
validateInputOnChange: true,
|
|
1844
|
+
clearInputErrorOnChange: true,
|
|
1845
|
+
validate: validateObj,
|
|
1846
|
+
initialValues,
|
|
1847
|
+
});
|
|
1848
|
+
const formRef = React.useRef(form);
|
|
1849
|
+
formRef.current = form;
|
|
1850
|
+
return { form, validateObj };
|
|
1851
|
+
};
|
|
1852
|
+
|
|
2774
1853
|
const SubtitleBlock = ({ children, align, }) => (React__default["default"].createElement("p", { className: `lead-modal__description ${'le-text-align-' + (align || '')} ${LEAD_CLASS}` }, children));
|
|
2775
1854
|
|
|
2776
1855
|
const cssInputNotShrink = react.css `
|
|
@@ -3089,13 +2168,11 @@ const TextField = (props) => {
|
|
|
3089
2168
|
const $focusEl = $textEl.item($textEl.length - 1);
|
|
3090
2169
|
if ($focusEl) {
|
|
3091
2170
|
$focusEl.focus();
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
});
|
|
3098
|
-
}, 100);
|
|
2171
|
+
$focusEl.scrollIntoView({
|
|
2172
|
+
behavior: 'auto',
|
|
2173
|
+
block: 'center',
|
|
2174
|
+
inline: 'start',
|
|
2175
|
+
});
|
|
3099
2176
|
}
|
|
3100
2177
|
}, [shrink]);
|
|
3101
2178
|
React.useEffect(() => {
|
|
@@ -3229,6 +2306,17 @@ const StyledFormContainer = styled__default["default"].div `
|
|
|
3229
2306
|
flex-direction: column;
|
|
3230
2307
|
}
|
|
3231
2308
|
|
|
2309
|
+
.leadgen-form_inner {
|
|
2310
|
+
display: flex;
|
|
2311
|
+
flex-direction: column;
|
|
2312
|
+
flex: 1;
|
|
2313
|
+
min-height: 0;
|
|
2314
|
+
|
|
2315
|
+
&:has(.leadgen-header) {
|
|
2316
|
+
display: block;
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
|
|
3232
2320
|
.leadgen-form_body {
|
|
3233
2321
|
flex: 1;
|
|
3234
2322
|
min-height: 0;
|
|
@@ -3268,16 +2356,22 @@ const StyledFormContainer = styled__default["default"].div `
|
|
|
3268
2356
|
*
|
|
3269
2357
|
*/
|
|
3270
2358
|
const FormContainer = (_a) => {
|
|
3271
|
-
var { title, titleAlign, description, descriptionAlign, className, style, children, footer } = _a, restProps = tslib_es6.__rest(_a, ["title", "titleAlign", "description", "descriptionAlign", "className", "style", "children", "footer"]);
|
|
2359
|
+
var { title, titleAlign, description, descriptionAlign, className, style, children, header, footer } = _a, restProps = tslib_es6.__rest(_a, ["title", "titleAlign", "description", "descriptionAlign", "className", "style", "children", "header", "footer"]);
|
|
2360
|
+
const HeaderContent = (React__default["default"].createElement("div", { className: "leadgen-form_header" },
|
|
2361
|
+
React__default["default"].createElement("h2", { title: title, className: "leadgen-title", "data-align": titleAlign }, title),
|
|
2362
|
+
!!description && (React__default["default"].createElement("p", { title: description, className: "leadgen-description", "data-align": descriptionAlign, dangerouslySetInnerHTML: { __html: description } }))));
|
|
3272
2363
|
if (!title && !description) {
|
|
3273
2364
|
return null;
|
|
3274
2365
|
}
|
|
3275
2366
|
return (React__default["default"].createElement(StyledFormContainer, Object.assign({ className: core.clsx(className, 'leadgen-form_container'), style: style }, restProps),
|
|
3276
2367
|
React__default["default"].createElement("div", { className: "leadgen-form_wrapper" },
|
|
3277
|
-
React__default["default"].createElement("div", { className: "leadgen-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
2368
|
+
!!header && (React__default["default"].createElement("div", { className: "leadgen-form_scrollable" },
|
|
2369
|
+
header,
|
|
2370
|
+
HeaderContent,
|
|
2371
|
+
React__default["default"].createElement("div", { className: "leadgen-form_body" }, children))),
|
|
2372
|
+
!header && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
2373
|
+
HeaderContent,
|
|
2374
|
+
React__default["default"].createElement("div", { className: "leadgen-form_body" }, children))),
|
|
3281
2375
|
React__default["default"].createElement("div", { className: "leadgen-form_footer" }, footer))));
|
|
3282
2376
|
};
|
|
3283
2377
|
|
|
@@ -3302,7 +2396,7 @@ const HeaderImage = ({ src, ratio = 3 / 2, className, style, }) => {
|
|
|
3302
2396
|
if (!src) {
|
|
3303
2397
|
return null;
|
|
3304
2398
|
}
|
|
3305
|
-
return (React__default["default"].createElement(StyleHeaderImage, { paddingTop: (1 / ratio) * 100, className: core.clsx(className, 'leadgen-header_image'), style: style }, index$
|
|
2399
|
+
return (React__default["default"].createElement(StyleHeaderImage, { paddingTop: (1 / ratio) * 100, className: core.clsx(className, 'leadgen-header_image'), style: style }, index$7.isVideo(src) ? (React__default["default"].createElement("video", { muted: true, autoPlay: true, loop: true, className: "leadgen-header_image_feature leadgen-header_image_video", src: src })) : (React__default["default"].createElement("img", { src: src, draggable: "false", alt: "", className: "leadgen-header_image_feature leadgen-header_image_image" }))));
|
|
3306
2400
|
};
|
|
3307
2401
|
|
|
3308
2402
|
const OtpBlock = ({ otpData, onSuccess, autoSendWhenOpen, }) => {
|
|
@@ -3479,8 +2573,9 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
3479
2573
|
const isDrawer = isLightBoxB && isMobile;
|
|
3480
2574
|
const limitFieldsLightBoxB = isLightBoxB && listBlockAdded.length <= LEADGEN_LIMIT_LIGHTBOXB;
|
|
3481
2575
|
const hasForm = isLightBoxA
|
|
3482
|
-
? listBlockAdded.some((item) =>
|
|
2576
|
+
? listBlockAdded.some((item) => LEADGEN_BLOCK_IN_FORM.some((k) => k === (item === null || item === void 0 ? void 0 : item.name)))
|
|
3483
2577
|
: true;
|
|
2578
|
+
const headerInsideFormContainer = isSlider || isLightBoxA || isFullscreen;
|
|
3484
2579
|
const showHeader = !!imageMobile || !!imageDesktop;
|
|
3485
2580
|
const onlyHeader = !title && !description;
|
|
3486
2581
|
const showButtonClose = !isInline;
|
|
@@ -3604,7 +2699,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
3604
2699
|
const PopupEmpty = showEmpty && (React__default["default"].createElement(EmptyComponent, { onClose: onClose, onContinue: () => setShowEmpty(false) }));
|
|
3605
2700
|
const PopupForm = (React__default["default"].createElement(LeadFormProvider, { form: form },
|
|
3606
2701
|
React__default["default"].createElement("form", { ref: formRef, className: "leadgen-form", onSubmit: middlewareOnSubmit },
|
|
3607
|
-
React__default["default"].createElement(FormContainer, { title: title, titleAlign: titleAlign, description: description, descriptionAlign: descriptionAlign, footer: hasForm ? ButtonSubmit : ButtonLink, "data-hidden-form": !hasForm },
|
|
2702
|
+
React__default["default"].createElement(FormContainer, { title: title, titleAlign: titleAlign, description: description, descriptionAlign: descriptionAlign, header: headerInsideFormContainer && PopupHeader, footer: hasForm ? ButtonSubmit : ButtonLink, "data-hidden-form": !hasForm },
|
|
3608
2703
|
React__default["default"].createElement("div", { className: "leadgen-form_inner" },
|
|
3609
2704
|
React__default["default"].createElement(LightboxFields, { listBlockAdded: listBlockAdded, popupId: popupId, locale: locale, onClose: onClose, onOtherSubmit: onOtherSubmit }))))));
|
|
3610
2705
|
const PopupOtp = showOtpPhone && (React__default["default"].createElement(OtpBlock, { otpData: showOtpPhone, autoSendWhenOpen: false, onSuccess: () => {
|
|
@@ -3615,7 +2710,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
3615
2710
|
const PopupContent = (React__default["default"].createElement("div", { className: core.clsx('leadgen-content', {
|
|
3616
2711
|
'leadgen-content_small': limitFieldsLightBoxB,
|
|
3617
2712
|
}) },
|
|
3618
|
-
PopupHeader,
|
|
2713
|
+
!headerInsideFormContainer && PopupHeader,
|
|
3619
2714
|
!onlyHeader && (React__default["default"].createElement("div", { className: "leadgen-inner" },
|
|
3620
2715
|
PopupThankYou,
|
|
3621
2716
|
!showThankyou && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
@@ -3644,7 +2739,7 @@ const LightboxLayout = ({ popupId, extraFields, onClose: onCloseProp, onOtherSub
|
|
|
3644
2739
|
'leadgen-inline': isInPage,
|
|
3645
2740
|
'leadgen-slider': isSlider,
|
|
3646
2741
|
});
|
|
3647
|
-
const PopupContainer = isDrawer ? (React__default["default"].createElement(index$9.DrawerComponent, { fadeFromIndex: index$
|
|
2742
|
+
const PopupContainer = isDrawer ? (React__default["default"].createElement(index$9.DrawerComponent, { fadeFromIndex: index$8.ZINDEX_SSO - 9e6, open: open, snapPoints: [0.8, 1], activeSnapPoint: snap, setActiveSnapPoint: setSnap, onOpenChange: onOpenChange, overlayClassName: popupContainerClassName, className: "leadgen-drawer" },
|
|
3648
2743
|
PopupWrapper,
|
|
3649
2744
|
React__default["default"].createElement("div", { style: { position: 'absolute', inset: 0, zIndex: snap === 1 ? -1 : 1 }, onClick: () => setSnap(1) }))) : (React__default["default"].createElement("div", { id: popupId, "data-popup-url": currentPath, "data-popup-type": "lightbox-inline", className: popupContainerClassName },
|
|
3650
2745
|
isFullscreen ? (React__default["default"].createElement("img", { className: "le-only-desktop le-fullscreen-img", draggable: false, src: imageBackground || '', style: {
|
|
@@ -3707,7 +2802,7 @@ const SkinLayout = ({ popupId, link, linkText, linkNewTab, onClose, imageMobile,
|
|
|
3707
2802
|
React__default["default"].createElement("aside", { className: "le-only-mobile" },
|
|
3708
2803
|
React__default["default"].createElement("div", { className: "le-skin-mobile" },
|
|
3709
2804
|
React__default["default"].createElement("div", { style: { position: 'relative' } },
|
|
3710
|
-
index$
|
|
2805
|
+
index$7.isVideo(imageMobile) ? (React__default["default"].createElement("video", { muted: true, autoPlay: true, loop: true },
|
|
3711
2806
|
React__default["default"].createElement("source", { src: imageMobile, type: "video/mp4" }))) : (React__default["default"].createElement("img", { src: imageMobile, style: {
|
|
3712
2807
|
width: '100%',
|
|
3713
2808
|
aspectRatio: `${imageMobileWidth}/${imageMobileHeight}`,
|
|
@@ -4504,7 +3599,7 @@ const _LeadGen = ({ apiUrl: apiUrlProp, siteDomain, siteId, locale, apiSubotUrl,
|
|
|
4504
3599
|
}, [showCampaign]);
|
|
4505
3600
|
return (React__default["default"].createElement(LeadGenContext.Provider, { value: { apiUrl, siteDomain, siteId, locale } },
|
|
4506
3601
|
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() },
|
|
4507
|
-
React__default["default"].createElement(core.Box, { sx: { position: 'fixed', zIndex: index$
|
|
3602
|
+
React__default["default"].createElement(core.Box, { sx: { position: 'fixed', zIndex: index$8.ZINDEX_SSO - 9e6 } },
|
|
4508
3603
|
React__default["default"].createElement(core.Transition, { mounted: Boolean(((_a = showCampaign === null || showCampaign === void 0 ? void 0 : showCampaign.extra_fields) === null || _a === void 0 ? void 0 : _a.popupVersion) === '2.1'), transition: "fade", duration: 600, timingFunction: "ease" }, (styles) => {
|
|
4509
3604
|
var _a;
|
|
4510
3605
|
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,
|
|
@@ -4523,4 +3618,3 @@ LeadGen.OtpForm = OtpBlock$1;
|
|
|
4523
3618
|
LeadGen.Close = Close.Close;
|
|
4524
3619
|
|
|
4525
3620
|
exports.LeadGen = LeadGen;
|
|
4526
|
-
exports.LeadGenSubscriptionBox = LeadGenSubscriptionBox;
|