@hhgtech/hhg-components 1.29.362-beta-6 → 1.29.362-beta-7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{InputDate-fd0e82e5.js → InputDate-64d42e12.js} +3 -3
- package/build/{LastPeriod-675b0494.js → LastPeriod-0b4bdb7b.js} +1 -1
- package/build/{MobileBottomNavigationIcon-88da3d18.js → MobileBottomNavigationIcon-6268685b.js} +3 -3
- package/build/{Spinner-c338b48a.js → Spinner-732c257a.js} +1 -1
- package/build/{WhatsApp-60349170.js → WhatsApp-873b091d.js} +1 -1
- package/build/adapters.js +19 -19
- package/build/atoms.js +48 -48
- package/build/babyGrowth.js +83 -83
- package/build/cache.js +2 -2
- package/build/care.js +17 -17
- package/build/careBookingSearchBar.js +14 -14
- package/build/careBookingSearchBarV2.js +15 -15
- package/build/components.js +96 -96
- package/build/{constants-d903206f.js → constants-abcc0371.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-b01c1ac6.js → core-beed5f88.js} +1 -1
- package/build/{dataTransform-394e0d39.js → dataTransform-efdc8b5b.js} +1 -1
- package/build/ecom.js +4 -4
- package/build/{editor-03eeead9.js → editor-ab52b049.js} +11 -11
- package/build/embeddedHeathToolCards_babyGrowth.js +23 -23
- package/build/embeddedHeathToolCards_babyPoop.js +19 -19
- package/build/embeddedHeathToolCards_babyVaccine.js +22 -22
- package/build/embeddedHeathToolCards_bmi_bmi.js +25 -25
- package/build/embeddedHeathToolCards_bmrBmr.js +25 -25
- package/build/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
- package/build/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
- package/build/embeddedHeathToolCards_pwg_pwg.js +26 -26
- package/build/embeddedHeathToolCards_targetHeartRate.js +27 -27
- package/build/esm/{InputDate-a4d6ee35.js → InputDate-16ff69fb.js} +3 -3
- package/build/esm/{LastPeriod-261ee5fa.js → LastPeriod-dac3ccfb.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-b5a1301c.js → MobileBottomNavigationIcon-09f20a81.js} +3 -3
- package/build/esm/{Spinner-d0e7abf8.js → Spinner-47aa89e4.js} +1 -1
- package/build/esm/{WhatsApp-0015ff5e.js → WhatsApp-a86d6d53.js} +1 -1
- package/build/esm/adapters.js +19 -19
- package/build/esm/atoms.js +48 -48
- package/build/esm/babyGrowth.js +83 -83
- package/build/esm/cache.js +2 -2
- package/build/esm/care.js +17 -17
- package/build/esm/careBookingSearchBar.js +14 -14
- package/build/esm/careBookingSearchBarV2.js +15 -15
- package/build/esm/components.js +96 -96
- package/build/esm/{constants-e2fef392.js → constants-f640ae0f.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-1a9e6336.js → core-d9c0671e.js} +1 -1
- package/build/esm/{dataTransform-8522b6e5.js → dataTransform-69716caa.js} +1 -1
- package/build/esm/ecom.js +4 -4
- package/build/esm/{editor-aa7c1e7e.js → editor-7d81f7ef.js} +11 -11
- package/build/esm/embeddedHeathToolCards_babyGrowth.js +23 -23
- package/build/esm/embeddedHeathToolCards_babyPoop.js +19 -19
- package/build/esm/embeddedHeathToolCards_babyVaccine.js +22 -22
- package/build/esm/embeddedHeathToolCards_bmi_bmi.js +25 -25
- package/build/esm/embeddedHeathToolCards_bmrBmr.js +25 -25
- package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +22 -22
- package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +22 -22
- package/build/esm/embeddedHeathToolCards_pwg_pwg.js +26 -26
- package/build/esm/embeddedHeathToolCards_targetHeartRate.js +27 -27
- package/build/esm/footer.js +21 -21
- package/build/esm/gAssets.js +2 -2
- package/build/esm/{healthTools-6d9bc6bb.js → healthTools-465b855e.js} +1 -1
- package/build/esm/healthToolsCardWrapper.js +18 -18
- package/build/esm/healthToolsForm.js +33 -33
- package/build/esm/hooks.js +13 -13
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-43003e56.js → index-0d4e612e.js} +2 -2
- package/build/esm/{index-b824c63e.js → index-13c0ea70.js} +6 -6
- package/build/esm/{index-3d1a057a.js → index-18c8dcde.js} +3 -3
- package/build/esm/{index-271fb414.js → index-1913a930.js} +3 -3
- package/build/esm/{index-c4f0d220.js → index-19f99de5.js} +16 -16
- package/build/esm/{index-69266c15.js → index-1c22d4f9.js} +22 -22
- package/build/esm/{index-cc9c4f8d.js → index-2305e665.js} +24 -24
- package/build/esm/{index-abd67120.js → index-2bcab30b.js} +10 -10
- package/build/esm/{index-0a319369.js → index-2c4ea8ae.js} +1 -1
- package/build/esm/{index-aa78faae.js → index-3672b72f.js} +13 -13
- package/build/esm/{index-8d7414f5.js → index-3af42a84.js} +2 -2
- package/build/esm/{index-2d0027bb.js → index-3c3a3102.js} +7 -7
- package/build/esm/{index-d926a789.js → index-3da1e4b6.js} +17 -17
- package/build/esm/{index-6c0adc97.js → index-432abb58.js} +1 -1
- package/build/esm/{index-b88e063b.js → index-447cd8a4.js} +6 -6
- package/build/esm/{index-c7bef4da.js → index-4497323a.js} +1 -1
- package/build/esm/{index-b8ae41e7.js → index-4eabf61b.js} +1 -1
- package/build/esm/{index-4f679233.js → index-4f111f60.js} +3 -3
- package/build/esm/{index-c75d775a.js → index-50027e5c.js} +13 -13
- package/build/esm/{index-a0e28e14.js → index-5307e0c6.js} +25 -25
- package/build/esm/{index-18855286.js → index-5451485b.js} +11 -11
- package/build/esm/{index-b867b65e.js → index-55ce4171.js} +17 -17
- package/build/esm/{index-ade570f6.js → index-55e275b4.js} +3 -3
- package/build/esm/{index-7eb265fa.js → index-597bbb57.js} +18 -18
- package/build/esm/{index-fdaccc36.js → index-5a86d9b0.js} +5 -5
- package/build/esm/{index-a262027e.js → index-5acde2d7.js} +17 -17
- package/build/esm/{index-5bacde9a.js → index-6037be86.js} +1 -1
- package/build/esm/{index-6e30f84b.js → index-61322bbf.js} +6 -6
- package/build/esm/{index-128b1ed7.js → index-63e8911e.js} +2 -2
- package/build/esm/{index-2dea69ae.js → index-67a5426d.js} +13 -13
- package/build/esm/{index-3b97009b.js → index-68571fd9.js} +6 -6
- package/build/esm/{index-2c25389c.js → index-6bf4911c.js} +2 -2
- package/build/esm/{index-a92da53f.js → index-6cebc2c8.js} +16 -16
- package/build/esm/{index-02a48b88.js → index-6f3bed52.js} +3 -3
- package/build/esm/{index-62833621.js → index-6fb98c8f.js} +2 -2
- package/build/esm/{index-0096a0e9.js → index-7107c883.js} +6 -6
- package/build/esm/{index-e512d075.js → index-75266933.js} +4 -4
- package/build/esm/{index-3e49fab2.js → index-84a00e3b.js} +2 -2
- package/build/esm/{index-7bc63809.js → index-84ca8d60.js} +2 -2
- package/build/esm/{index-a48580cf.js → index-8ee9610b.js} +18 -18
- package/build/esm/{index-c53221d3.js → index-9789a5bb.js} +2 -2
- package/build/esm/{index-1334730d.js → index-9fe435c1.js} +13 -13
- package/build/esm/{index-7bee1da6.js → index-a0f010bf.js} +1 -1
- package/build/esm/{index-c487aa6f.js → index-a111eead.js} +1 -1
- package/build/esm/{index-ae36d803.js → index-a5b8a392.js} +7 -7
- package/build/esm/{index-12bd7a04.js → index-a94fc823.js} +5 -5
- package/build/esm/{index-e2fa8007.js → index-aa3201b9.js} +2 -2
- package/build/esm/{index-1124693a.js → index-ab2833d5.js} +31 -31
- package/build/esm/{index-980b3a3b.js → index-acf2009f.js} +21 -21
- package/build/esm/{index-c502503e.js → index-aefd2493.js} +2 -2
- package/build/esm/{index-1cc1ec84.js → index-b2316ee2.js} +16 -16
- package/build/esm/{index-a3da289d.js → index-b501a228.js} +1 -1
- package/build/esm/{index-a14ad51b.js → index-b6908538.js} +2 -2
- package/build/esm/{index-d76f8524.js → index-c35929d1.js} +16 -16
- package/build/esm/{index-210d3892.js → index-c612c756.js} +32 -32
- package/build/esm/{index-6aee72f8.js → index-cf7511b0.js} +2 -2
- package/build/esm/{index-0157dab8.js → index-d1c3d3f8.js} +16 -16
- package/build/esm/{index-c4070a12.js → index-da8fae13.js} +32 -32
- package/build/esm/{index-9943a900.js → index-db34c7f8.js} +2 -2
- package/build/esm/{index-94fe2230.js → index-ed465943.js} +15 -15
- package/build/esm/{index-e2df7129.js → index-ef63171d.js} +2 -2
- package/build/esm/{index-ed8b1b4d.js → index-f0a7c31c.js} +10 -10
- package/build/esm/{index-929b12bb.js → index-fe975ba7.js} +1 -1
- package/build/esm/{index-d4f98ef0.js → index-fec30d54.js} +3 -3
- package/build/esm/index.js +117 -117
- package/build/esm/{labelSorting-59a03a60.js → labelSorting-df818f96.js} +4 -4
- package/build/esm/lead.js +462 -25
- package/build/esm/{logoIcon-f5fabf8a.js → logoIcon-bcab45ec.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-0bb56712.js → post-12899078.js} +2 -2
- package/build/esm/profileNavigation.js +19 -19
- package/build/esm/progressBar.js +1 -1
- package/build/esm/pwg.js +22 -22
- package/build/esm/ssoV2.js +29 -29
- package/build/esm/{store-2f4a3de8.js → store-74598ce1.js} +4 -4
- package/build/esm/subot.js +36 -36
- package/build/esm/surveyOrPremiumBanner.js +32 -32
- package/build/esm/surveyQuestionCard.js +10 -10
- package/build/esm/{surveyThankyouCard-acd5065b.js → surveyThankyouCard-a99f3769.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-a2c5e10b.js → treePopoverMenu-10382802.js} +19 -19
- package/build/esm/{types-c6f4b649.js → types-cb3acc26.js} +2 -2
- package/build/esm/types.js +2 -2
- package/build/esm/{useCategory-e6c5f3f4.js → useCategory-d4b1c5f2.js} +5 -5
- package/build/esm/{useHealthToolCache-42bb7e54.js → useHealthToolCache-54d80f8c.js} +1 -1
- package/build/esm/{useMantineLocale-86072926.js → useMantineLocale-2c267cf1.js} +6 -6
- package/build/esm/usePlacesAutocomplete-23dbc6fa.js +81 -0
- package/build/esm/{useScreenSize-d5709b35.js → useScreenSize-db569e75.js} +2 -2
- package/build/esm/useTogetherAuthRequiredAction.js +9 -9
- package/build/esm/{utils-3fb29038.js → utils-09f8e5fd.js} +3 -3
- package/build/esm/{utils-fa1cee35.js → utils-30ed34b7.js} +4 -4
- package/build/esm/{utils-80c1ae9d.js → utils-3c0e208c.js} +2 -2
- package/build/esm/{utils-c7536c86.js → utils-cdd60699.js} +2 -2
- package/build/esm/vaccination.js +21 -21
- package/build/footer.js +21 -21
- package/build/gAssets.js +2 -2
- package/build/{healthTools-e42395ee.js → healthTools-77fca866.js} +1 -1
- package/build/healthToolsCardWrapper.js +18 -18
- package/build/healthToolsForm.js +33 -33
- package/build/hooks.js +13 -13
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/{index-8af743c4.js → index-0976cf3a.js} +1 -1
- package/build/{index-34ba141e.js → index-09b30ecf.js} +31 -31
- package/build/{index-14e8a4bf.js → index-0b773c57.js} +2 -2
- package/build/{index-f39711fb.js → index-124981ac.js} +2 -2
- package/build/{index-8b14ab7a.js → index-16e88760.js} +2 -2
- package/build/{index-9becb073.js → index-1ce8cebb.js} +13 -13
- package/build/{index-47c7236c.js → index-2862f470.js} +5 -5
- package/build/{index-7efb4007.js → index-2888aa0d.js} +16 -16
- package/build/{index-0b638588.js → index-2bfcacaa.js} +2 -2
- package/build/{index-e76258d1.js → index-346b78ed.js} +3 -3
- package/build/{index-53b50908.js → index-37a4d328.js} +15 -15
- package/build/{index-d1741909.js → index-37ef911f.js} +1 -1
- package/build/{index-7995fd09.js → index-3a188a9b.js} +16 -16
- package/build/{index-0a086949.js → index-3cd97c88.js} +6 -6
- package/build/{index-c0628923.js → index-3ff902b7.js} +13 -13
- package/build/{index-fad8eaac.js → index-40486d40.js} +5 -5
- package/build/{index-733dea52.js → index-45f52a74.js} +17 -17
- package/build/{index-2fd0440f.js → index-474499d7.js} +24 -24
- package/build/{index-89dfd95d.js → index-4c8fa66a.js} +7 -7
- package/build/{index-37170515.js → index-500d59e0.js} +16 -16
- package/build/{index-2b664d4c.js → index-5ead853f.js} +6 -6
- package/build/{index-a5454694.js → index-61b188dc.js} +32 -32
- package/build/{index-6d023e3f.js → index-64e3c3d3.js} +1 -1
- package/build/{index-f28b96a7.js → index-6570d852.js} +2 -2
- package/build/{index-5475cf4e.js → index-67ac5c04.js} +16 -16
- package/build/{index-28246ee7.js → index-6816ad79.js} +18 -18
- package/build/{index-869029fb.js → index-69f88dca.js} +3 -3
- package/build/{index-c06af6e7.js → index-6e4f9b56.js} +1 -1
- package/build/{index-f518f327.js → index-7056279d.js} +1 -1
- package/build/{index-7f31c1b3.js → index-7573e047.js} +17 -17
- package/build/{index-8bf4db6f.js → index-7d212a91.js} +17 -17
- package/build/{index-e06a7e67.js → index-90e07d5d.js} +22 -22
- package/build/{index-223ee091.js → index-94fedc8f.js} +2 -2
- package/build/{index-2b4a1fa4.js → index-9abf5c76.js} +2 -2
- package/build/{index-341b39a7.js → index-9f69e8f2.js} +1 -1
- package/build/{index-9ab6eff7.js → index-a0d42537.js} +3 -3
- package/build/{index-c3bcf68a.js → index-a1b50a50.js} +2 -2
- package/build/{index-c359d080.js → index-a2e166cb.js} +2 -2
- package/build/{index-868f265e.js → index-a6e60b9e.js} +21 -21
- package/build/{index-3427e121.js → index-aae5daa6.js} +1 -1
- package/build/{index-1aa248b8.js → index-abb4fe75.js} +3 -3
- package/build/{index-deeabe50.js → index-b3798ae1.js} +2 -2
- package/build/{index-ac084a83.js → index-bcab6d5c.js} +18 -18
- package/build/{index-001fada4.js → index-c1a20b50.js} +13 -13
- package/build/{index-a0523f88.js → index-c2a0a243.js} +6 -6
- package/build/{index-669d4781.js → index-c6e943df.js} +10 -10
- package/build/{index-6bbf3de0.js → index-c9ef25e1.js} +13 -13
- package/build/{index-88c05c6d.js → index-ca55e97e.js} +2 -2
- package/build/{index-0e15566a.js → index-d04d8bc2.js} +10 -10
- package/build/{index-eaea1669.js → index-d13230c8.js} +11 -11
- package/build/{index-c80bb596.js → index-d38b9f49.js} +3 -3
- package/build/{index-053f53ad.js → index-d4fcd1d3.js} +2 -2
- package/build/{index-0d2b0272.js → index-d52875ca.js} +25 -25
- package/build/{index-05432eda.js → index-d90027a5.js} +4 -4
- package/build/{index-c984ffbe.js → index-da263b8c.js} +2 -2
- package/build/{index-234dcab6.js → index-da3d5bf5.js} +6 -6
- package/build/{index-b4b29605.js → index-ed8e4b3a.js} +32 -32
- package/build/{index-db5c4f29.js → index-eff9de5a.js} +7 -7
- package/build/{index-7858e63b.js → index-f7c0987b.js} +2 -2
- package/build/{index-97349834.js → index-f8bea6f7.js} +1 -1
- package/build/{index-ab62215d.js → index-f927abb8.js} +3 -3
- package/build/{index-5a251e58.js → index-fbb15ec3.js} +16 -16
- package/build/{index-4e12800c.js → index-fd81e3fa.js} +1 -1
- package/build/{index-b9c21c28.js → index-fdfddf00.js} +6 -6
- package/build/index.js +117 -117
- package/build/{labelSorting-3a57f00a.js → labelSorting-91beddf9.js} +4 -4
- package/build/lead.js +492 -55
- package/build/{logoIcon-1d0cec48.js → logoIcon-f214edfa.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-953ae518.js → post-71039d7e.js} +2 -2
- package/build/profileNavigation.js +19 -19
- package/build/progressBar.js +1 -1
- package/build/pwg.js +22 -22
- package/build/ssoV2.js +27 -27
- package/build/{store-ec082514.js → store-c8fa067a.js} +4 -4
- package/build/subot.js +35 -35
- package/build/surveyOrPremiumBanner.js +32 -32
- package/build/surveyQuestionCard.js +10 -10
- package/build/{surveyThankyouCard-60c65d4f.js → surveyThankyouCard-7b2781bc.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-a5ab646e.js → treePopoverMenu-ef9818ce.js} +19 -19
- package/build/{types-df93deb4.js → types-95e861df.js} +2 -2
- package/build/types.js +2 -2
- package/build/{useCategory-0f8cbb89.js → useCategory-dcc735eb.js} +5 -5
- package/build/{useHealthToolCache-656e214f.js → useHealthToolCache-ab042676.js} +1 -1
- package/build/{useMantineLocale-d3b08d5e.js → useMantineLocale-bfaf810c.js} +6 -6
- package/build/usePlacesAutocomplete-db5d0254.js +85 -0
- package/build/{useScreenSize-c6515eb2.js → useScreenSize-53337b39.js} +2 -2
- package/build/useTogetherAuthRequiredAction.js +9 -9
- package/build/{utils-8cdcde5d.js → utils-665877d3.js} +2 -2
- package/build/{utils-ad1f98b3.js → utils-92bf9062.js} +4 -4
- package/build/{utils-89f1d6d4.js → utils-d8a37749.js} +3 -3
- package/build/{utils-925d1a21.js → utils-fe6c5f1f.js} +2 -2
- package/build/vaccination.js +21 -21
- package/package.json +1 -1
- package/build/esm/usePlacesAutocomplete-a9d55e56.js +0 -520
- package/build/usePlacesAutocomplete-7b83983f.js +0 -528
- /package/build/{BMI_BOYS.percentile.monthly-0c545430.js → BMI_BOYS.percentile.monthly-77d32ede.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-b2abdd52.js → BMI_BOYS.percentile.weekly-34068a3d.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-73da03a1.js → BMI_BOYS.percentile.yearly-3b87566c.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-5bc00bd2.js → BMI_BOYS.zscore.monthly-fd248b60.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-b270dca9.js → BMI_BOYS.zscore.weekly-70ffc0ea.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-e11a3061.js → BMI_BOYS.zscore.yearly-9d8fb3b3.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-f8d3ae24.js → BMI_GIRLS.percentile.monthly-be3ccc40.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-ab748c6a.js → BMI_GIRLS.percentile.weekly-318e81d5.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-002aebb0.js → BMI_GIRLS.percentile.yearly-8cff53b7.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-e261af22.js → BMI_GIRLS.zscore.monthly-eae04f1f.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-d58566a9.js → BMI_GIRLS.zscore.weekly-f2f829e5.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-1147723e.js → BMI_GIRLS.zscore.yearly-0516fac2.js} +0 -0
- /package/build/{ChevronDown-83383af6.js → ChevronDown-df85dca7.js} +0 -0
- /package/build/{Close-8e99232e.js → Close-c4c272a5.js} +0 -0
- /package/build/{Google-d203467c.js → Google-60d29b65.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-211f31d0.js → HEAD CIRCUM_BOYS.percentile.monthly-bf4b9347.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-ad1b91eb.js → HEAD CIRCUM_BOYS.percentile.weekly-bdedbbe6.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-3ef825f4.js → HEAD CIRCUM_BOYS.percentile.yearly-e3f79ff0.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-dd61aed0.js → HEAD CIRCUM_BOYS.zscore.monthly-69264ee8.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-5f4bf7d7.js → HEAD CIRCUM_BOYS.zscore.weekly-231eed82.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-f503bf61.js → HEAD CIRCUM_BOYS.zscore.yearly-79f0540f.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-76db00a2.js → HEAD CIRCUM_GIRLS.percentile.monthly-89357b63.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-60938b9d.js → HEAD CIRCUM_GIRLS.percentile.weekly-5a40c0ea.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-de08eaf6.js → HEAD CIRCUM_GIRLS.percentile.yearly-b57a585c.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-5de26ec2.js → HEAD CIRCUM_GIRLS.zscore.monthly-6f40c001.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-ba767399.js → HEAD CIRCUM_GIRLS.zscore.weekly-c4d1a3dc.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-2d8cafcb.js → HEAD CIRCUM_GIRLS.zscore.yearly-0d13cc51.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-3aa10b4d.js → HEIGHT_BOYS.percentile.monthly-4923dfb7.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-ae1f58fc.js → HEIGHT_BOYS.percentile.weekly-8f73dc29.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-ec9b6a67.js → HEIGHT_BOYS.percentile.yearly-e170e80e.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-2b9abf9e.js → HEIGHT_BOYS.zscore.monthly-fefc9c1b.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-ebc79372.js → HEIGHT_BOYS.zscore.weekly-ada5533a.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-64acc0b1.js → HEIGHT_BOYS.zscore.yearly-d4e83504.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-8a6d5ba4.js → HEIGHT_GIRLS.percentile.monthly-1c3fb2cf.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-94c6540f.js → HEIGHT_GIRLS.percentile.weekly-632d45d3.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-3142b8d2.js → HEIGHT_GIRLS.percentile.yearly-51eae518.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-02aa6416.js → HEIGHT_GIRLS.zscore.monthly-05d5dbc9.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-6c8e7a9f.js → HEIGHT_GIRLS.zscore.weekly-e42ffddc.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-090810af.js → HEIGHT_GIRLS.zscore.yearly-7aa691cb.js} +0 -0
- /package/build/{Locale-3b16bb0e.js → Locale-bc11b358.js} +0 -0
- /package/build/{Visible-71839201.js → Visible-b7757afc.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-ccef0bf9.js → WEIGHT_BOYS.percentile.monthly-2ac98cf5.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-3e37816c.js → WEIGHT_BOYS.percentile.weekly-a3651c26.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-37663922.js → WEIGHT_BOYS.percentile.yearly-2e4b61bc.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-6ca85d8d.js → WEIGHT_BOYS.zscore.monthly-9a264811.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-513cb51e.js → WEIGHT_BOYS.zscore.weekly-1af2c797.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-d4ba37d8.js → WEIGHT_BOYS.zscore.yearly-b04f8ded.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-3459d0c0.js → WEIGHT_GIRLS.percentile.monthly-7848ad4d.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-73376e4d.js → WEIGHT_GIRLS.percentile.weekly-007eb8de.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-39258498.js → WEIGHT_GIRLS.percentile.yearly-d73c397d.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-aee13b23.js → WEIGHT_GIRLS.zscore.monthly-0919302e.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-4f2556e7.js → WEIGHT_GIRLS.zscore.weekly-c23338a0.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-59489de0.js → WEIGHT_GIRLS.zscore.yearly-77e13b21.js} +0 -0
- /package/build/{animation-ee9cffdc.js → animation-13a568d8.js} +0 -0
- /package/build/{constants-be090ce4.js → constants-1c1df5a8.js} +0 -0
- /package/build/{constants-46765397.js → constants-2905564a.js} +0 -0
- /package/build/{constants-c9a1b55d.js → constants-800a381c.js} +0 -0
- /package/build/{dataTransform-577eda33.js → dataTransform-6e9cbf45.js} +0 -0
- /package/build/{doctor-aea52c10.js → doctor-9a0f4b6a.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-421ba7a1.js → BMI_BOYS.percentile.monthly-eef6a636.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-2131d37d.js → BMI_BOYS.percentile.weekly-ceb85dca.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-7d7ac950.js → BMI_BOYS.percentile.yearly-4ed4b90e.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-f8b5a1ee.js → BMI_BOYS.zscore.monthly-e55e9afb.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-1c0b0ccf.js → BMI_BOYS.zscore.weekly-4073dca9.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-cd3e748e.js → BMI_BOYS.zscore.yearly-0a2d322b.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-b67288e2.js → BMI_GIRLS.percentile.monthly-a1a82ce8.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-10e2e494.js → BMI_GIRLS.percentile.weekly-d9f484ed.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-0e593580.js → BMI_GIRLS.percentile.yearly-02e0b5c6.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-230a4308.js → BMI_GIRLS.zscore.monthly-3086a4eb.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-b461adde.js → BMI_GIRLS.zscore.weekly-18b946b1.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-e6ec3a95.js → BMI_GIRLS.zscore.yearly-4b41195a.js} +0 -0
- /package/build/esm/{ChevronDown-6513a253.js → ChevronDown-75af5663.js} +0 -0
- /package/build/esm/{Close-e4e577cb.js → Close-755f3cd6.js} +0 -0
- /package/build/esm/{Google-1a588c29.js → Google-f94ba2eb.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-0c38a166.js → HEAD CIRCUM_BOYS.percentile.monthly-ccf35c97.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-32cae606.js → HEAD CIRCUM_BOYS.percentile.weekly-35cabdd6.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-416f773a.js → HEAD CIRCUM_BOYS.percentile.yearly-f1a8bfd6.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-dbdb6c06.js → HEAD CIRCUM_BOYS.zscore.monthly-f62449ec.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-28568e5a.js → HEAD CIRCUM_BOYS.zscore.weekly-555e72ad.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-446d3462.js → HEAD CIRCUM_BOYS.zscore.yearly-ffb64461.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-7d5e08b6.js → HEAD CIRCUM_GIRLS.percentile.monthly-dbb73d21.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-5a7731cb.js → HEAD CIRCUM_GIRLS.percentile.weekly-93516e21.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-70d17e88.js → HEAD CIRCUM_GIRLS.percentile.yearly-6ae63168.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-6e9b3ea4.js → HEAD CIRCUM_GIRLS.zscore.monthly-ee2360c6.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-578339b4.js → HEAD CIRCUM_GIRLS.zscore.weekly-e6aabacc.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-5d82e048.js → HEAD CIRCUM_GIRLS.zscore.yearly-ea540ad7.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-ceb0c7ee.js → HEIGHT_BOYS.percentile.monthly-67ae92c3.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-43fdcf07.js → HEIGHT_BOYS.percentile.weekly-c388098c.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-5d863523.js → HEIGHT_BOYS.percentile.yearly-43abdda4.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-7a2bbfd1.js → HEIGHT_BOYS.zscore.monthly-7cbd36eb.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-65248000.js → HEIGHT_BOYS.zscore.weekly-dba453b8.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-3de1aa3b.js → HEIGHT_BOYS.zscore.yearly-2a9d7648.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-f5422ca7.js → HEIGHT_GIRLS.percentile.monthly-59ab9a32.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-8de0c176.js → HEIGHT_GIRLS.percentile.weekly-c2840739.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-30774397.js → HEIGHT_GIRLS.percentile.yearly-0d408b89.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-acc7105f.js → HEIGHT_GIRLS.zscore.monthly-ed32bcd7.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-3440fc9e.js → HEIGHT_GIRLS.zscore.weekly-7ffdfcbf.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-5057439c.js → HEIGHT_GIRLS.zscore.yearly-b994474b.js} +0 -0
- /package/build/esm/{Locale-1c96ad9c.js → Locale-f131de60.js} +0 -0
- /package/build/esm/{Visible-93776058.js → Visible-973ad72f.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-bf753079.js → WEIGHT_BOYS.percentile.monthly-fa452031.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-5e9af001.js → WEIGHT_BOYS.percentile.weekly-4d484b6a.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-662fbde6.js → WEIGHT_BOYS.percentile.yearly-640c5c38.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-f0475982.js → WEIGHT_BOYS.zscore.monthly-4d3b328d.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-6aafdeeb.js → WEIGHT_BOYS.zscore.weekly-33bd4dd5.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-5fc306b9.js → WEIGHT_BOYS.zscore.yearly-c61fc388.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-4e5050b6.js → WEIGHT_GIRLS.percentile.monthly-27706de0.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-297c26c6.js → WEIGHT_GIRLS.percentile.weekly-910e041a.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-bb44c22b.js → WEIGHT_GIRLS.percentile.yearly-19634be2.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-715bfa3b.js → WEIGHT_GIRLS.zscore.monthly-32cd08c3.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-56dd1717.js → WEIGHT_GIRLS.zscore.weekly-e4568c26.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-64e721cf.js → WEIGHT_GIRLS.zscore.yearly-f6e304b9.js} +0 -0
- /package/build/esm/{animation-5400167d.js → animation-03accc76.js} +0 -0
- /package/build/esm/{constants-0c376e10.js → constants-78ddad2e.js} +0 -0
- /package/build/esm/{constants-76dc3883.js → constants-bf29e0f0.js} +0 -0
- /package/build/esm/{constants-a937eafe.js → constants-fb73e3ef.js} +0 -0
- /package/build/esm/{dataTransform-fe86c90a.js → dataTransform-e22fb4f9.js} +0 -0
- /package/build/esm/{doctor-ce0b76fd.js → doctor-33c9e25e.js} +0 -0
- /package/build/esm/{index-07890117.js → index-2097a507.js} +0 -0
- /package/build/esm/{index-2da128ed.js → index-25586182.js} +0 -0
- /package/build/esm/{index-56099b5d.js → index-49054ff9.js} +0 -0
- /package/build/esm/{index-85758df5.js → index-87d7e39b.js} +0 -0
- /package/build/esm/{index-fd2310c2.js → index-8d7c8364.js} +0 -0
- /package/build/esm/{index-afbe819e.js → index-b3528a2f.js} +0 -0
- /package/build/esm/{index-d11f9211.js → index-cf541b45.js} +0 -0
- /package/build/esm/{index-8d8b4325.js → index-ddbcb091.js} +0 -0
- /package/build/esm/{index.styles-f6a5d126.js → index.styles-3b4cb44d.js} +0 -0
- /package/build/esm/{localizeNumberFormat-69447a14.js → localizeNumberFormat-2063f26d.js} +0 -0
- /package/build/esm/{normalizeLink-56bb54f7.js → normalizeLink-8a2a5d71.js} +0 -0
- /package/build/esm/{number-49c50e28.js → number-b8f051b4.js} +0 -0
- /package/build/esm/{other-d6efb1d9.js → other-6869ae5e.js} +0 -0
- /package/build/esm/{paths-c7db8f50.js → paths-bbb40f27.js} +0 -0
- /package/build/esm/{translationsContext-290825cb.js → translationsContext-3e444dde.js} +0 -0
- /package/build/esm/{tslib.es6-48e9a62a.js → tslib.es6-666e3cd6.js} +0 -0
- /package/build/esm/{types-54a29c87.js → types-1ba72a05.js} +0 -0
- /package/build/esm/{useIsInit-61aa33bb.js → useIsInit-b49e83d5.js} +0 -0
- /package/build/esm/{useOutsideClick-ca9ebf88.js → useOutsideClick-040db14c.js} +0 -0
- /package/build/esm/{useScrollbarSize-3d6b723e.js → useScrollbarSize-241f3dd8.js} +0 -0
- /package/build/esm/{useUniqueId-46818085.js → useUniqueId-62c78e84.js} +0 -0
- /package/build/esm/{utils-c78aa552.js → utils-2cba8675.js} +0 -0
- /package/build/{index-063dd232.js → index-1eda14d7.js} +0 -0
- /package/build/{index-bb749661.js → index-30cceb74.js} +0 -0
- /package/build/{index-8ded19d5.js → index-471f7ea9.js} +0 -0
- /package/build/{index-e90ccbbb.js → index-82f9a77b.js} +0 -0
- /package/build/{index-2b902706.js → index-cb081b49.js} +0 -0
- /package/build/{index-70e345f1.js → index-cf9f60a1.js} +0 -0
- /package/build/{index-a55c0148.js → index-f40549f7.js} +0 -0
- /package/build/{index-31d8f042.js → index-f446d5f6.js} +0 -0
- /package/build/{index.styles-36d65d5c.js → index.styles-d77f7530.js} +0 -0
- /package/build/{localizeNumberFormat-381406cb.js → localizeNumberFormat-64398792.js} +0 -0
- /package/build/{normalizeLink-2736a2fa.js → normalizeLink-bbd9a1a4.js} +0 -0
- /package/build/{number-9fe1f3c7.js → number-e99f35d4.js} +0 -0
- /package/build/{other-55d7a29c.js → other-0f1056c9.js} +0 -0
- /package/build/{paths-4bfc1cef.js → paths-64d1e0f4.js} +0 -0
- /package/build/{translationsContext-9687dc3f.js → translationsContext-13d01c64.js} +0 -0
- /package/build/{tslib.es6-91e092ae.js → tslib.es6-ac3885bf.js} +0 -0
- /package/build/{types-721d4367.js → types-4ac2b84e.js} +0 -0
- /package/build/{useIsInit-78a4b005.js → useIsInit-b6cb0157.js} +0 -0
- /package/build/{useOutsideClick-155e9c38.js → useOutsideClick-03282050.js} +0 -0
- /package/build/{useScrollbarSize-2fac76a7.js → useScrollbarSize-3b28fc7f.js} +0 -0
- /package/build/{useUniqueId-220be409.js → useUniqueId-ff573dd2.js} +0 -0
- /package/build/{utils-ad823692.js → utils-855dca0f.js} +0 -0
|
@@ -1,520 +0,0 @@
|
|
|
1
|
-
import { v1 } from 'uuid';
|
|
2
|
-
import { getCookie, setCookie } from './miscCookieHelper.js';
|
|
3
|
-
import { a as __awaiter } from './tslib.es6-48e9a62a.js';
|
|
4
|
-
import { useState, useEffect } from 'react';
|
|
5
|
-
|
|
6
|
-
const CAMPAIGN_TARGET_TYPE = { LINKS: 1, TAGS: 2 };
|
|
7
|
-
let LEAD_API = 'https://dev.leadgen.hellobacsi.com/';
|
|
8
|
-
const LEAD_DEVICE_TYPE = {
|
|
9
|
-
MOBILE: 1,
|
|
10
|
-
DESKTOP: 2,
|
|
11
|
-
};
|
|
12
|
-
let LEAD_CLASS = '';
|
|
13
|
-
if (LEAD_API.includes('localhost')) {
|
|
14
|
-
LEAD_API = 'https://dev.leadgen.hellobacsi.com/';
|
|
15
|
-
}
|
|
16
|
-
if (location.hostname.includes('marrybaby.vn')) {
|
|
17
|
-
LEAD_CLASS = 'pink';
|
|
18
|
-
}
|
|
19
|
-
// var LEAD_CURRENT_URL = location.href.toLowerCase();
|
|
20
|
-
let LEAD_CURRENT_URL = 'https://' + location.hostname + location.pathname + location.search;
|
|
21
|
-
LEAD_CURRENT_URL = LEAD_CURRENT_URL.toLowerCase();
|
|
22
|
-
// TODO: set inital object if exists
|
|
23
|
-
if (sessionStorage.getItem('insider_object')) {
|
|
24
|
-
window.insider_object = JSON.parse(sessionStorage.getItem('insider_object'));
|
|
25
|
-
}
|
|
26
|
-
const docLang = document.documentElement.lang;
|
|
27
|
-
// TODO: country code
|
|
28
|
-
const LEAD_LOCALE_DATA = {
|
|
29
|
-
'vi-VN': {
|
|
30
|
-
popupLang: 'vi',
|
|
31
|
-
countryCode: 'vn',
|
|
32
|
-
countryCodeNumber: 84,
|
|
33
|
-
},
|
|
34
|
-
'id-ID': {
|
|
35
|
-
popupLang: 'id',
|
|
36
|
-
countryCode: 'id',
|
|
37
|
-
countryCodeNumber: 62,
|
|
38
|
-
},
|
|
39
|
-
'th-TH': {
|
|
40
|
-
popupLang: 'th',
|
|
41
|
-
countryCode: 'th',
|
|
42
|
-
countryCodeNumber: 66,
|
|
43
|
-
},
|
|
44
|
-
'ms-MY': {
|
|
45
|
-
popupLang: 'ms',
|
|
46
|
-
countryCode: 'my',
|
|
47
|
-
countryCodeNumber: 60,
|
|
48
|
-
},
|
|
49
|
-
'zh-TW': {
|
|
50
|
-
popupLang: 'zh',
|
|
51
|
-
countryCode: 'tw',
|
|
52
|
-
countryCodeNumber: 886,
|
|
53
|
-
},
|
|
54
|
-
'km-KH': {
|
|
55
|
-
popupLang: 'km',
|
|
56
|
-
countryCode: 'kh',
|
|
57
|
-
countryCodeNumber: 855,
|
|
58
|
-
},
|
|
59
|
-
'my-MM': {
|
|
60
|
-
popupLang: 'my',
|
|
61
|
-
countryCode: 'mm',
|
|
62
|
-
countryCodeNumber: 95,
|
|
63
|
-
},
|
|
64
|
-
'hi-IN': {
|
|
65
|
-
popupLang: 'hi',
|
|
66
|
-
countryCode: 'in',
|
|
67
|
-
countryCodeNumber: 91,
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
const LEAD_LOCALE = LEAD_LOCALE_DATA[docLang] || LEAD_LOCALE_DATA['vi-VN'];
|
|
71
|
-
function LEAD_RESET_VAR() {
|
|
72
|
-
// LEAD_CURRENT_URL = location.href.toLowerCase();
|
|
73
|
-
LEAD_CURRENT_URL =
|
|
74
|
-
'https://' + location.hostname + location.pathname + location.search;
|
|
75
|
-
}
|
|
76
|
-
const LEAD_TIMEZONE_DATA = {
|
|
77
|
-
1: 'Asia/Ho_Chi_Minh',
|
|
78
|
-
10: 'Asia/Ho_Chi_Minh',
|
|
79
|
-
11: 'Asia/Ho_Chi_Minh',
|
|
80
|
-
12: 'Asia/Ho_Chi_Minh',
|
|
81
|
-
2: 'Asia/Jakarta',
|
|
82
|
-
3: 'Asia/Bangkok',
|
|
83
|
-
4: 'Asia/Phnom_Penh',
|
|
84
|
-
5: 'Asia/Kuala_Lumpur',
|
|
85
|
-
6: 'Asia/Taipei',
|
|
86
|
-
7: 'Asia/Yangon',
|
|
87
|
-
8: 'Asia/Kolkata',
|
|
88
|
-
9: 'Asia/Manila', // Philippines / Filipinos Site
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// import mockLeadData from './mockLeadData'
|
|
92
|
-
const listCampaignScheduled = [];
|
|
93
|
-
const listCampaignScheduledToActivated = [];
|
|
94
|
-
const listCampaignActiveButExpired = [];
|
|
95
|
-
const listCampaignExcludeSonsored = [];
|
|
96
|
-
const listCampaignDifferentSponsor = [];
|
|
97
|
-
const listCampaignNotDisplayInRangeOfTime = [];
|
|
98
|
-
function isMobile() {
|
|
99
|
-
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent);
|
|
100
|
-
}
|
|
101
|
-
const getShuffleArray = (array) => {
|
|
102
|
-
const newArray = [...array];
|
|
103
|
-
for (let i = newArray.length - 1; i > 0; i--) {
|
|
104
|
-
const j = Math.floor(Math.random() * (i + 1));
|
|
105
|
-
const temp = newArray[i];
|
|
106
|
-
newArray[i] = newArray[j];
|
|
107
|
-
newArray[j] = temp;
|
|
108
|
-
}
|
|
109
|
-
return newArray;
|
|
110
|
-
};
|
|
111
|
-
const getTimeByTimezone = (timeZone = 'UTC') => {
|
|
112
|
-
const date = new Date();
|
|
113
|
-
return new Date(date.toLocaleString('en-US', { timeZone }));
|
|
114
|
-
};
|
|
115
|
-
const parseDateByCampaignTime = (dateStr) => {
|
|
116
|
-
// Format like this: 2023-04-04 00:00:00
|
|
117
|
-
try {
|
|
118
|
-
const [datePart, timePart] = dateStr.split(' ');
|
|
119
|
-
const [year, month, day] = datePart.split('-').map(Number);
|
|
120
|
-
const [hours, minutes, seconds] = timePart.split(':').map(Number);
|
|
121
|
-
/** JavaScript counts months from 0 to 11 */
|
|
122
|
-
return new Date(year, month - 1, day, hours, minutes, seconds);
|
|
123
|
-
}
|
|
124
|
-
catch (err) {
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
const checkCampaignNowInTimeframe = (c) => {
|
|
129
|
-
var _a;
|
|
130
|
-
const siteId = ((_a = c.site) === null || _a === void 0 ? void 0 : _a.id) || 1;
|
|
131
|
-
const startedAtStr = c.started_at;
|
|
132
|
-
const endedAtStr = c.ended_at;
|
|
133
|
-
const startedDate = parseDateByCampaignTime(startedAtStr);
|
|
134
|
-
const endedDate = parseDateByCampaignTime(endedAtStr);
|
|
135
|
-
if (!startedDate || !endedDate) {
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
const timeZone = LEAD_TIMEZONE_DATA[siteId];
|
|
139
|
-
const nowWithTimezoneMs = getTimeByTimezone(timeZone).getTime();
|
|
140
|
-
if (nowWithTimezoneMs <= endedDate.getTime() &&
|
|
141
|
-
nowWithTimezoneMs >= startedDate.getTime()) {
|
|
142
|
-
listCampaignScheduledToActivated.push(c);
|
|
143
|
-
return true;
|
|
144
|
-
}
|
|
145
|
-
return false;
|
|
146
|
-
};
|
|
147
|
-
function checkCampaignActiveButExpireAlready(c) {
|
|
148
|
-
var _a;
|
|
149
|
-
/** Do not setup timeframe for this campaign. No need to check */
|
|
150
|
-
if (c.forever === 1) {
|
|
151
|
-
return true;
|
|
152
|
-
}
|
|
153
|
-
const startedAtStr = c.started_at;
|
|
154
|
-
const endedAtStr = c.ended_at;
|
|
155
|
-
const startedDate = parseDateByCampaignTime(startedAtStr);
|
|
156
|
-
const endedDate = parseDateByCampaignTime(endedAtStr);
|
|
157
|
-
/** Do not setup timeframe for this campaign. No need to check */
|
|
158
|
-
if (!startedDate || !endedDate) {
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
const siteId = ((_a = c.site) === null || _a === void 0 ? void 0 : _a.id) || 1;
|
|
162
|
-
const timeZone = LEAD_TIMEZONE_DATA[siteId];
|
|
163
|
-
const nowWithTimezoneMs = getTimeByTimezone(timeZone).getTime();
|
|
164
|
-
/** Check if this expire already, do not show */
|
|
165
|
-
if (nowWithTimezoneMs > endedDate.getTime()) {
|
|
166
|
-
listCampaignActiveButExpired.push(c);
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
return true;
|
|
170
|
-
}
|
|
171
|
-
function shouldNotDisplayIfExcludeAllSponsors(c) {
|
|
172
|
-
var _a;
|
|
173
|
-
const excludeSponsored = Number((_a = c.rules.find((i) => i.rule == 'exclude_sponsored')) === null || _a === void 0 ? void 0 : _a.value);
|
|
174
|
-
const isSponsored = Boolean(document.querySelector('.hhg-disclaimer-text'));
|
|
175
|
-
if (isSponsored && excludeSponsored) {
|
|
176
|
-
listCampaignExcludeSonsored.push(c);
|
|
177
|
-
return true;
|
|
178
|
-
}
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
|
-
function shouldDisplayWithCurrentSponsor(c) {
|
|
182
|
-
var _a, _b;
|
|
183
|
-
try {
|
|
184
|
-
// TODO: BE will rename `exclude_sponsored_list` later
|
|
185
|
-
const stringOrArray = (_a = c.rules.find((i) => i.rule == 'exclude_sponsored_list')) === null || _a === void 0 ? void 0 : _a.value;
|
|
186
|
-
const whiteListSponsors = stringOrArray instanceof Array ? stringOrArray : JSON.parse(stringOrArray);
|
|
187
|
-
const dataSponsoredId = Number((_b = document
|
|
188
|
-
.querySelector('[data-sponsored-id]')) === null || _b === void 0 ? void 0 : _b.getAttribute('data-sponsored-id'));
|
|
189
|
-
// There is no config for sponsor id and white list, should show as default
|
|
190
|
-
if (!dataSponsoredId ||
|
|
191
|
-
dataSponsoredId <= 0 ||
|
|
192
|
-
whiteListSponsors.length === 0) {
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
// Check the dataSponsoredId exists in the white list or not.
|
|
196
|
-
const isExist = whiteListSponsors.find((s) => s.id == dataSponsoredId);
|
|
197
|
-
if (isExist) {
|
|
198
|
-
return true;
|
|
199
|
-
}
|
|
200
|
-
listCampaignDifferentSponsor.push({ id: c.id, rules: c.rules });
|
|
201
|
-
return false;
|
|
202
|
-
}
|
|
203
|
-
catch (err) {
|
|
204
|
-
// Default is show
|
|
205
|
-
return true;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
const filterFnCampaign = (c) => {
|
|
209
|
-
if (shouldNotDisplayIfExcludeAllSponsors(c)) {
|
|
210
|
-
return false;
|
|
211
|
-
}
|
|
212
|
-
else if (!shouldDisplayWithCurrentSponsor(c)) {
|
|
213
|
-
return false;
|
|
214
|
-
}
|
|
215
|
-
/** Active */
|
|
216
|
-
if (c.formatted_status === 1) {
|
|
217
|
-
return checkCampaignActiveButExpireAlready(c);
|
|
218
|
-
}
|
|
219
|
-
/** Schedule */
|
|
220
|
-
if (c.formatted_status === 0) {
|
|
221
|
-
listCampaignScheduled.push(c);
|
|
222
|
-
return checkCampaignNowInTimeframe(c);
|
|
223
|
-
}
|
|
224
|
-
return false;
|
|
225
|
-
};
|
|
226
|
-
const fillterApprearanceTimeCampaign = (c) => {
|
|
227
|
-
var _a;
|
|
228
|
-
try {
|
|
229
|
-
const isTimeInRange = (currentTime, startTime, endTime) => {
|
|
230
|
-
const startParts = startTime.split(':');
|
|
231
|
-
const endParts = endTime.split(':');
|
|
232
|
-
const startDate = new Date();
|
|
233
|
-
startDate.setHours(Number(startParts[0]), Number(startParts[1]), 0, 0);
|
|
234
|
-
const endDate = new Date();
|
|
235
|
-
endDate.setHours(Number(endParts[0]), Number(endParts[1]), 0, 0);
|
|
236
|
-
return currentTime >= startDate && currentTime <= endDate;
|
|
237
|
-
};
|
|
238
|
-
const rulesApprValue = (_a = c.rules.find((i) => i.rule == 'appearance_time')) === null || _a === void 0 ? void 0 : _a.value;
|
|
239
|
-
const startTime = rulesApprValue.startTime;
|
|
240
|
-
const endTime = rulesApprValue.endTime || '23:59';
|
|
241
|
-
if (!startTime) {
|
|
242
|
-
return true;
|
|
243
|
-
}
|
|
244
|
-
if (isTimeInRange(new Date(), startTime, endTime)) {
|
|
245
|
-
return true;
|
|
246
|
-
}
|
|
247
|
-
listCampaignNotDisplayInRangeOfTime.push(c);
|
|
248
|
-
return false;
|
|
249
|
-
}
|
|
250
|
-
catch (err) {
|
|
251
|
-
return true;
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
let timeoutRef = null;
|
|
255
|
-
let LEAD_SCROLL_EVENT = null;
|
|
256
|
-
function clearPassiveEvent() {
|
|
257
|
-
if (timeoutRef) {
|
|
258
|
-
clearTimeout(timeoutRef);
|
|
259
|
-
timeoutRef = null;
|
|
260
|
-
}
|
|
261
|
-
if (LEAD_SCROLL_EVENT) {
|
|
262
|
-
window.removeEventListener('scroll', LEAD_SCROLL_EVENT);
|
|
263
|
-
LEAD_SCROLL_EVENT = null;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
function checkShowPopup({ leadApi, leadSiteId, leadDomain, onShowPopup, DEBUG_URL, }) {
|
|
267
|
-
// clear previous passive event, check for new condition
|
|
268
|
-
clearPassiveEvent();
|
|
269
|
-
const leadCurrentUrl = DEBUG_URL ||
|
|
270
|
-
('https://' +
|
|
271
|
-
location.hostname +
|
|
272
|
-
location.pathname +
|
|
273
|
-
location.search).toLowerCase();
|
|
274
|
-
fetch(leadApi + 'api/campaign/' + leadSiteId, {
|
|
275
|
-
method: 'POST',
|
|
276
|
-
headers: {
|
|
277
|
-
'Content-Type': 'application/json',
|
|
278
|
-
},
|
|
279
|
-
body: JSON.stringify({
|
|
280
|
-
url: leadCurrentUrl,
|
|
281
|
-
ga_client_id: getCookie('_ga') || null,
|
|
282
|
-
}),
|
|
283
|
-
})
|
|
284
|
-
.then((response) => {
|
|
285
|
-
return response.json();
|
|
286
|
-
// return mockLeadData || response.json()
|
|
287
|
-
})
|
|
288
|
-
.then((data) => {
|
|
289
|
-
var _a, _b, _c, _d;
|
|
290
|
-
LeadLog('List campagin: ', data);
|
|
291
|
-
LEAD_RESET_VAR();
|
|
292
|
-
if (data._status == 1) {
|
|
293
|
-
const campaigns = (((_b = (_a = data._data) === null || _a === void 0 ? void 0 : _a.campaigns) === null || _b === void 0 ? void 0 : _b.filter(filterFnCampaign)) || []).filter(fillterApprearanceTimeCampaign);
|
|
294
|
-
if (!getCookie('hhg-id')) {
|
|
295
|
-
setCookie('hhg-id', v1(), {
|
|
296
|
-
domain: '.' + leadDomain,
|
|
297
|
-
path: '/',
|
|
298
|
-
});
|
|
299
|
-
LeadLog('😍 Set HHG ID cookie');
|
|
300
|
-
}
|
|
301
|
-
// getCookie('hhg-id')
|
|
302
|
-
// TODO: HP-534 Filter desktop
|
|
303
|
-
let campaignsDevice = [];
|
|
304
|
-
if (isMobile()) {
|
|
305
|
-
campaignsDevice = campaigns.filter((c) => c.device_types.some((d) => d.id == LEAD_DEVICE_TYPE.MOBILE));
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
campaignsDevice = campaigns.filter((c) => c.device_types.some((d) => d.id == LEAD_DEVICE_TYPE.DESKTOP));
|
|
309
|
-
}
|
|
310
|
-
LeadLog(`👓 campaignsDevice`, campaignsDevice);
|
|
311
|
-
LeadLog('--listCampaignScheduled', listCampaignScheduled);
|
|
312
|
-
LeadLog('--listCampaignScheduledToActivated', listCampaignScheduledToActivated);
|
|
313
|
-
LeadLog('--listCampaignActiveButExpired', listCampaignActiveButExpired);
|
|
314
|
-
LeadLog('--listCampaignExcludeSonsored', listCampaignExcludeSonsored);
|
|
315
|
-
LeadLog('--listCampaignDifferentSponsor', listCampaignDifferentSponsor);
|
|
316
|
-
LeadLog('--listCampaignNotDisplayInRangeOfTime', listCampaignNotDisplayInRangeOfTime);
|
|
317
|
-
// Check links
|
|
318
|
-
let listLinksObj = campaignsDevice
|
|
319
|
-
.map((i, index) => i.targets
|
|
320
|
-
.filter((i) => i.type == CAMPAIGN_TARGET_TYPE.LINKS)
|
|
321
|
-
.map((i) => (Object.assign(Object.assign({}, i), { campaignIndex: index }))))
|
|
322
|
-
.flat(1);
|
|
323
|
-
// Check list link match current href
|
|
324
|
-
listLinksObj = listLinksObj.filter((i) => {
|
|
325
|
-
var _a;
|
|
326
|
-
const target = new URL(String(i.target).toLowerCase());
|
|
327
|
-
if (i.option == 'exact_match')
|
|
328
|
-
// FOR TEST LOCAL:
|
|
329
|
-
// return Boolean(location.pathname === target.pathname)
|
|
330
|
-
return Boolean(leadCurrentUrl === ((_a = target.href) === null || _a === void 0 ? void 0 : _a.toLowerCase()));
|
|
331
|
-
if (i.option == 'start_with') {
|
|
332
|
-
// FOR TEST LOCAL:
|
|
333
|
-
// if (location.pathname.includes(target.pathname)) {
|
|
334
|
-
if (leadCurrentUrl.includes(String(i.target).toLowerCase())) {
|
|
335
|
-
const listExcluding = i.sub_target
|
|
336
|
-
.filter((i) => i.option == 'excluding')
|
|
337
|
-
.map((i) => { var _a; return (_a = i.value) === null || _a === void 0 ? void 0 : _a.toLowerCase(); });
|
|
338
|
-
return !listExcluding.includes(leadCurrentUrl.split('?')[0]);
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
return false;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
// Check tags
|
|
346
|
-
const listMetaTag = Array.from(document.getElementsByTagName('META')).filter((i) => i.getAttribute('property') == 'article:tag');
|
|
347
|
-
const listTags = listMetaTag.map((i) => i.content);
|
|
348
|
-
let listCampaignHasTag = [];
|
|
349
|
-
let listTagsObj = [];
|
|
350
|
-
if (listTags && listTags.length) {
|
|
351
|
-
listCampaignHasTag = campaignsDevice
|
|
352
|
-
.map((i, index) => i.targets
|
|
353
|
-
.filter((i) => i.type == CAMPAIGN_TARGET_TYPE.TAGS)
|
|
354
|
-
.map((i) => (Object.assign(Object.assign({}, i), { campaignIndex: index }))))
|
|
355
|
-
.flat(1);
|
|
356
|
-
listTagsObj = listCampaignHasTag.filter((i) => listTags.includes(i.target));
|
|
357
|
-
}
|
|
358
|
-
const listCampaginsMatch = [...listLinksObj, ...listTagsObj];
|
|
359
|
-
const cookieKeys = document.cookie
|
|
360
|
-
.split('; ')
|
|
361
|
-
.map((i) => i.split('=')[0]);
|
|
362
|
-
const listCampaignCodeSubmited = cookieKeys.filter((i) => i.includes('lead_submited'));
|
|
363
|
-
LeadLog(`--listCampaignCodeSubmited`, listCampaignCodeSubmited);
|
|
364
|
-
const listCampaignCodeClosed = cookieKeys.filter((i) => i.includes('lead_closed'));
|
|
365
|
-
LeadLog(`--listCampaignCodeClosed`, listCampaignCodeClosed);
|
|
366
|
-
const listCampaignSubmitedClosed = [
|
|
367
|
-
...listCampaignCodeSubmited,
|
|
368
|
-
...listCampaignCodeClosed,
|
|
369
|
-
];
|
|
370
|
-
const listCampaignNoSubmitedClosed = listCampaginsMatch.filter((i) => {
|
|
371
|
-
const hasSubmited = listCampaignSubmitedClosed.some((k) => k.includes(campaignsDevice[i.campaignIndex].code));
|
|
372
|
-
return !hasSubmited;
|
|
373
|
-
});
|
|
374
|
-
const listCampaignValid = getShuffleArray(listCampaignNoSubmitedClosed);
|
|
375
|
-
// .sort(
|
|
376
|
-
// (a, b) =>
|
|
377
|
-
// (listCampaignValid[a.campaignIndex]?.score || 0) -
|
|
378
|
-
// (listCampaignValid[b.campaignIndex]?.score || 0),
|
|
379
|
-
// )
|
|
380
|
-
LeadLog('--listCampaignValid : ', listCampaignValid);
|
|
381
|
-
if (listCampaignValid && listCampaignValid.length) {
|
|
382
|
-
const CAMPAIGN_SHOW = campaignsDevice[listCampaignValid[0].campaignIndex];
|
|
383
|
-
LeadLog(`CAMPAIGN_SHOW`, CAMPAIGN_SHOW);
|
|
384
|
-
const { rules } = CAMPAIGN_SHOW;
|
|
385
|
-
// CHECK RULE TRIGGER POPUP
|
|
386
|
-
const timeoutRule = Number((_c = rules.find((i) => i.rule == 'time')) === null || _c === void 0 ? void 0 : _c.value);
|
|
387
|
-
LeadLog(`timeoutRule`, timeoutRule);
|
|
388
|
-
const scrollRule = Number((_d = rules.find((i) => i.rule == 'scroll')) === null || _d === void 0 ? void 0 : _d.value);
|
|
389
|
-
LeadLog(`scrollRule`, scrollRule);
|
|
390
|
-
let impressionAction = 'TIME';
|
|
391
|
-
if (Number.isInteger(timeoutRule)) {
|
|
392
|
-
impressionAction = 'TIME';
|
|
393
|
-
LeadLog('✨ SHOW AWESOME POPUP AFTER: ', timeoutRule, ' seconds');
|
|
394
|
-
timeoutRef = setTimeout(() => {
|
|
395
|
-
onShowPopup === null || onShowPopup === void 0 ? void 0 : onShowPopup(CAMPAIGN_SHOW, impressionAction);
|
|
396
|
-
}, timeoutRule * 1000);
|
|
397
|
-
}
|
|
398
|
-
if (Number.isInteger(scrollRule)) {
|
|
399
|
-
impressionAction = 'SCROLL';
|
|
400
|
-
LeadLog('✨ SHOW AWESOME AFTER: SCROLL', scrollRule, ' %');
|
|
401
|
-
const $p = document.querySelector(`[data-url="${location.pathname}"]`) ||
|
|
402
|
-
document.querySelector('body');
|
|
403
|
-
const pct = $p.getBoundingClientRect().top;
|
|
404
|
-
const pb = $p.offsetHeight;
|
|
405
|
-
LeadLog(`👓 Element check scroll: `, $p);
|
|
406
|
-
LEAD_SCROLL_EVENT = function leadScollCheckHandler() {
|
|
407
|
-
const wt = window.pageYOffset || document.documentElement.scrollTop;
|
|
408
|
-
let percent = 0;
|
|
409
|
-
if (wt >= pct) {
|
|
410
|
-
percent = Math.round(((wt - pct) / (pb - innerHeight)) * 100);
|
|
411
|
-
}
|
|
412
|
-
LeadLog('---Scroll', percent, scrollRule);
|
|
413
|
-
// TODO: CHECK FOOTER HEIGHT
|
|
414
|
-
if (percent >= scrollRule) {
|
|
415
|
-
window.removeEventListener('scroll', LEAD_SCROLL_EVENT);
|
|
416
|
-
onShowPopup === null || onShowPopup === void 0 ? void 0 : onShowPopup(CAMPAIGN_SHOW, impressionAction);
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
window.addEventListener('scroll', LEAD_SCROLL_EVENT, {
|
|
420
|
-
passive: true,
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
else {
|
|
425
|
-
LeadLog('🚧 No lead campaigns on current URL, tags');
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
})
|
|
429
|
-
.catch((err) => {
|
|
430
|
-
LeadLog(`Lead error: `, err);
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
const LeadLog = (...params) => {
|
|
434
|
-
if (process.env.NODE_ENV !== 'production' ||
|
|
435
|
-
(process.env.NEXT_PUBLIC_DEPLOY_ENV &&
|
|
436
|
-
process.env.NEXT_PUBLIC_DEPLOY_ENV !== 'production') ||
|
|
437
|
-
(typeof localStorage !== 'undefined' &&
|
|
438
|
-
localStorage.getItem('hhg_debug') === 'true')) {
|
|
439
|
-
console.log(...params);
|
|
440
|
-
}
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
const formatAutoCompleteAddress = (addresses) => {
|
|
444
|
-
if (!addresses || addresses.length < 1)
|
|
445
|
-
return [];
|
|
446
|
-
return addresses.map((s) => ({
|
|
447
|
-
placeId: s.place_id,
|
|
448
|
-
description: s.description,
|
|
449
|
-
rawData: s,
|
|
450
|
-
}));
|
|
451
|
-
};
|
|
452
|
-
const IS_SSR = typeof window === 'undefined';
|
|
453
|
-
// https://developers.google.com/maps/faq#languagesupport
|
|
454
|
-
const GOOGLE_API_LANGUAGE = {
|
|
455
|
-
VN: 'vi',
|
|
456
|
-
ID: 'id',
|
|
457
|
-
TH: 'th',
|
|
458
|
-
MY: 'ms',
|
|
459
|
-
TW: 'zh-TW',
|
|
460
|
-
KH: 'km',
|
|
461
|
-
MM: 'my',
|
|
462
|
-
IN: 'hi',
|
|
463
|
-
PH: 'en',
|
|
464
|
-
};
|
|
465
|
-
const GOOGLE_API_KEY = 'AIzaSyD9AbNa4AFwr8eNVs90G1YhQLhfWJ6KncU';
|
|
466
|
-
const googleAutocomplete = (text = '', countrycode = '', languageCountrycode = 'vi') => __awaiter(void 0, void 0, void 0, function* () {
|
|
467
|
-
return new Promise((resolve, reject) => {
|
|
468
|
-
if (!text) {
|
|
469
|
-
return reject('Need valid text input');
|
|
470
|
-
}
|
|
471
|
-
if (IS_SSR) {
|
|
472
|
-
return reject('Need valid window object');
|
|
473
|
-
}
|
|
474
|
-
try {
|
|
475
|
-
new window.google.maps.places.AutocompleteService().getPlacePredictions(Object.assign(Object.assign({ input: text }, (countrycode
|
|
476
|
-
? {
|
|
477
|
-
componentRestrictions: { country: countrycode },
|
|
478
|
-
}
|
|
479
|
-
: {})), { language: GOOGLE_API_LANGUAGE[languageCountrycode] }), resolve);
|
|
480
|
-
}
|
|
481
|
-
catch (e) {
|
|
482
|
-
reject(e);
|
|
483
|
-
}
|
|
484
|
-
});
|
|
485
|
-
});
|
|
486
|
-
const usePlacesAutocomplete = (text = '', countrycode = '', languageCountrycode = '', debounceTimeout = 500) => {
|
|
487
|
-
const [predictions, setPredictions] = useState([]);
|
|
488
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
489
|
-
useEffect(() => {
|
|
490
|
-
let handleDebounce;
|
|
491
|
-
if (text) {
|
|
492
|
-
handleDebounce = window.setTimeout(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
493
|
-
if (!text) {
|
|
494
|
-
setPredictions([]);
|
|
495
|
-
return;
|
|
496
|
-
}
|
|
497
|
-
try {
|
|
498
|
-
setIsLoading(true);
|
|
499
|
-
const nextPredictions = yield googleAutocomplete(text, countrycode, languageCountrycode);
|
|
500
|
-
setPredictions(formatAutoCompleteAddress(nextPredictions));
|
|
501
|
-
}
|
|
502
|
-
catch (e) {
|
|
503
|
-
console.error(e);
|
|
504
|
-
}
|
|
505
|
-
finally {
|
|
506
|
-
setIsLoading(false);
|
|
507
|
-
}
|
|
508
|
-
}), debounceTimeout);
|
|
509
|
-
}
|
|
510
|
-
else if (predictions.length) {
|
|
511
|
-
setPredictions([]);
|
|
512
|
-
}
|
|
513
|
-
return () => {
|
|
514
|
-
window.clearTimeout(handleDebounce);
|
|
515
|
-
};
|
|
516
|
-
}, [text, debounceTimeout, countrycode]);
|
|
517
|
-
return { isLoading, predictions };
|
|
518
|
-
};
|
|
519
|
-
|
|
520
|
-
export { GOOGLE_API_KEY as G, LeadLog as L, GOOGLE_API_LANGUAGE as a, LEAD_LOCALE as b, LEAD_CLASS as c, checkShowPopup as d, clearPassiveEvent as e, usePlacesAutocomplete as u };
|