@hhgtech/hhg-components 1.28.20 → 1.28.21
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/babyGrowth.js +2 -2
- package/build/cache.js +1 -1
- package/build/care.js +1 -1
- package/build/components.js +1 -1
- package/build/{constants-11a8ea11.js → constants-0d879f21.js} +1 -1
- package/build/{constants-d549bc2a.js → constants-cae8dcfd.js} +1 -1
- package/build/constants.js +1 -1
- package/build/core-42d5ed63.js +1 -0
- package/build/ecom.js +1 -1
- package/build/esm/babyGrowth.js +9 -9
- package/build/esm/cache.js +1 -1
- package/build/esm/care.js +1 -1
- package/build/esm/components.js +1 -1
- package/build/esm/{constants-0080a43c.js → constants-5e4b6aaa.js} +1 -1
- package/build/esm/{constants-cd30a2ef.js → constants-b5814512.js} +2 -2
- package/build/esm/constants.js +1 -1
- package/build/esm/{core-195d1c63.js → core-311d7242.js} +1 -1
- package/build/esm/ecom.js +1 -1
- package/build/esm/footer.js +1 -1
- package/build/esm/gAssets.js +1 -1
- package/build/esm/{getDynamicHealthTool-5a4ef938.js → getDynamicHealthTool-6bf2e69d.js} +1 -1
- package/build/esm/{getSocialList-af3a248b.js → getSocialList-593d72cf.js} +1 -1
- package/build/esm/hooks.js +1 -1
- package/build/esm/i18n.js +1 -1
- package/build/esm/i18nV2.js +1 -1
- package/build/esm/{index-9a001123.js → index-0bc7892c.js} +1 -1
- package/build/esm/{index-f9e1b776.js → index-27f79b14.js} +1 -1
- package/build/esm/index-3fd6d11d.js +1 -0
- package/build/esm/{index-c76b3f54.js → index-43c43315.js} +1 -1
- package/build/esm/index-43ced8c4.js +1 -0
- package/build/esm/index-4bee5ccb.js +1 -0
- package/build/esm/{index-6bdc378c.js → index-603aec16.js} +2 -2
- package/build/esm/{index-d383d324.js → index-620551b5.js} +1 -1
- package/build/esm/{index-fc9f2e23.js → index-727605cf.js} +1 -1
- package/build/esm/{index-a031b23a.js → index-8014dff1.js} +1 -1
- package/build/esm/{index-6d45683b.js → index-9bb14d7f.js} +1 -1
- package/build/esm/{index-1a53fa06.js → index-9cdff468.js} +1 -1
- package/build/esm/{index-faedded8.js → index-bf7e8cb2.js} +1 -1
- package/build/esm/{index-cb79819c.js → index-bfcf3fb0.js} +1 -1
- package/build/esm/{index-e720efb7.js → index-ca4fdb46.js} +1 -1
- package/build/esm/{index-b0a8909d.js → index-e5dce728.js} +6 -6
- package/build/esm/{index-f1588f5b.js → index-f0b1e2fe.js} +1 -1
- package/build/esm/{index-3d3428c5.js → index-f2bbc22b.js} +1 -1
- package/build/esm/{index-b11b8202.js → index-fb027c2b.js} +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/{index.styled-b4ecc267.js → index.styled-02ca5623.js} +1 -1
- package/build/esm/{index.styled-c1cf9add.js → index.styled-39bbc781.js} +1 -1
- package/build/esm/{index.styles-de1b2c0a.js → index.styles-8e66aa69.js} +1 -1
- package/build/esm/lead.js +1 -1
- package/build/esm/mantine.js +1 -1
- package/build/esm/misc.js +1 -1
- package/build/esm/navigation.js +1 -1
- package/build/esm/onboardingV2.js +1 -1
- package/build/esm/pwg.js +2 -2
- package/build/esm/{routing-8c059442.js → routing-cf2d5f19.js} +1 -1
- package/build/esm/together.js +1 -1
- package/build/esm/{types-49648e81.js → types-a4c1b4b0.js} +1 -1
- package/build/esm/{types-f78f69cd.js → types-c18963c9.js} +1 -1
- package/build/esm/types.js +1 -1
- package/build/esm/{useCategory-06b1ac21.js → useCategory-e1c4dd95.js} +1 -1
- package/build/esm/useHealthToolCache-4f4bec7e.js +1 -0
- package/build/esm/{useRafState-16cc2d40.js → useRafState-d6f71b45.js} +1 -1
- package/build/esm/{useTranslations-ac75c3b5.js → useTranslations-0f3e8009.js} +1 -1
- package/build/esm/{utils-6d392ba9.js → utils-5f9f0861.js} +1 -1
- package/build/esm/{utils-0a3162ba.js → utils-c9e60f19.js} +1 -1
- package/build/esm/vaccination.js +1 -1
- package/build/footer.js +1 -1
- package/build/gAssets.js +1 -1
- package/build/getDynamicHealthTool-114ddb03.js +1 -0
- package/build/{getSocialList-8f36380b.js → getSocialList-ada93645.js} +1 -1
- package/build/hooks.js +1 -1
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/{index-7c502568.js → index-106a0aa4.js} +1 -1
- package/build/{index-4228a061.js → index-1df24374.js} +1 -1
- package/build/{index-b1c6a59a.js → index-1fbc51d0.js} +1 -1
- package/build/{index-71f81ed0.js → index-22536346.js} +2 -2
- package/build/{index-e5135864.js → index-29d8f3e7.js} +1 -1
- package/build/{index-1bfac17a.js → index-38dce2a8.js} +1 -1
- package/build/{index-d5a7d94b.js → index-4a6fc7db.js} +1 -1
- package/build/index-562ffe13.js +1 -0
- package/build/index-6c94c4af.js +1 -0
- package/build/{index-67c1d9de.js → index-71c2b110.js} +1 -1
- package/build/{index-39f13000.js → index-75705406.js} +1 -1
- package/build/{index-ecea0cc8.js → index-853b0b56.js} +1 -1
- package/build/index-8844b145.js +1 -0
- package/build/{index-673d33f3.js → index-9e94fdd7.js} +1 -1
- package/build/index-b1f953f6.js +1 -0
- package/build/{index-b2edbbab.js → index-b6de35aa.js} +1 -1
- package/build/{index-1f3e1c8a.js → index-c29cd0ee.js} +1 -1
- package/build/{index-6fc42243.js → index-cef0a00f.js} +1 -1
- package/build/{index-2d99fba2.js → index-eb28658b.js} +11 -11
- package/build/index.js +1 -1
- package/build/{index.styled-2234083c.js → index.styled-0e38b245.js} +1 -1
- package/build/{index.styled-dad14c2f.js → index.styled-24033e81.js} +1 -1
- package/build/{index.styles-9fa8d243.js → index.styles-ad7903c3.js} +5 -5
- package/build/lead.js +1 -1
- package/build/mantine.js +1 -1
- package/build/misc.js +1 -1
- package/build/navigation.js +1 -1
- package/build/onboardingV2.js +1 -1
- package/build/pwg.js +2 -2
- package/build/{routing-fa168f80.js → routing-ec743546.js} +1 -1
- package/build/together.js +1 -1
- package/build/{types-b9baa990.js → types-04be3103.js} +1 -1
- package/build/{types-373205e2.js → types-6f7fce81.js} +1 -1
- package/build/types.js +1 -1
- package/build/{useCategory-e875e5ef.js → useCategory-5cbd3135.js} +1 -1
- package/build/useHealthToolCache-ad666c43.js +1 -0
- package/build/{useRafState-2d6941de.js → useRafState-68615887.js} +1 -1
- package/build/{useTranslations-eca47011.js → useTranslations-fe507352.js} +1 -1
- package/build/{utils-a7a2a02e.js → utils-381adc93.js} +2 -2
- package/build/utils-76a160ce.js +1 -0
- package/build/vaccination.js +1 -1
- package/package.json +1 -1
- package/build/core-488315ac.js +0 -1
- package/build/esm/index-2c2cad0f.js +0 -1
- package/build/esm/index-a4d06ec2.js +0 -1
- package/build/esm/index-e52ff23b.js +0 -1
- package/build/esm/useHealthToolCache-b8f3e0c0.js +0 -1
- package/build/getDynamicHealthTool-18d92dbf.js +0 -1
- package/build/index-a7093aa9.js +0 -1
- package/build/index-c1bb081f.js +0 -1
- package/build/index-cdd5cea4.js +0 -1
- package/build/index-f3bd2d2b.js +0 -1
- package/build/useHealthToolCache-ba802007.js +0 -1
- package/build/utils-547c3928.js +0 -1
- /package/build/{BMI_BOYS.percentile.monthly-03f073a0.js → BMI_BOYS.percentile.monthly-943242cd.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-feb7247f.js → BMI_BOYS.percentile.weekly-348ba55a.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-252394df.js → BMI_BOYS.percentile.yearly-aaa04db9.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-0c0d19f4.js → BMI_BOYS.zscore.monthly-f6d07e3b.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-adc6b49a.js → BMI_BOYS.zscore.weekly-303d8a0e.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-7563dac6.js → BMI_BOYS.zscore.yearly-024c0240.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-71460c6d.js → BMI_GIRLS.percentile.monthly-9e09fab0.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-70dfe2e0.js → BMI_GIRLS.percentile.weekly-4423fb86.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-22316c6d.js → BMI_GIRLS.percentile.yearly-d473af49.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-a6784a6a.js → BMI_GIRLS.zscore.monthly-32c50ad7.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-e21d239b.js → BMI_GIRLS.zscore.weekly-cd164e3d.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-76861a07.js → BMI_GIRLS.zscore.yearly-45434eb3.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-0797e495.js → HEAD CIRCUM_BOYS.percentile.monthly-276b36ea.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-fea33635.js → HEAD CIRCUM_BOYS.percentile.weekly-9e1a3595.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-1dfa3535.js → HEAD CIRCUM_BOYS.percentile.yearly-2d20cea8.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-7be89576.js → HEAD CIRCUM_BOYS.zscore.monthly-33424f91.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-12fb62f3.js → HEAD CIRCUM_BOYS.zscore.weekly-37907536.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-d5fd8c74.js → HEAD CIRCUM_BOYS.zscore.yearly-85993e9b.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-50436709.js → HEAD CIRCUM_GIRLS.percentile.monthly-d1927886.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-9b0fc1a5.js → HEAD CIRCUM_GIRLS.percentile.weekly-ee99ab29.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-4af99b47.js → HEAD CIRCUM_GIRLS.percentile.yearly-4a765f28.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-e925f1cc.js → HEAD CIRCUM_GIRLS.zscore.monthly-3b459cae.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-f7bab5df.js → HEAD CIRCUM_GIRLS.zscore.weekly-e6a11767.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-9769764d.js → HEAD CIRCUM_GIRLS.zscore.yearly-01897cb8.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-dc989d09.js → HEIGHT_BOYS.percentile.monthly-d30bfe74.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-b855097f.js → HEIGHT_BOYS.percentile.weekly-036c0cc0.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-04277bc2.js → HEIGHT_BOYS.percentile.yearly-033a22e5.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-e4cab1c9.js → HEIGHT_BOYS.zscore.monthly-8f647f0d.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-07108f7a.js → HEIGHT_BOYS.zscore.weekly-29ffb508.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-6e1ac886.js → HEIGHT_BOYS.zscore.yearly-d9229c2b.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-69b6f855.js → HEIGHT_GIRLS.percentile.monthly-788585cb.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-fef3d3f0.js → HEIGHT_GIRLS.percentile.weekly-e7e66eea.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-3496d908.js → HEIGHT_GIRLS.percentile.yearly-dc20673b.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-eaf852f5.js → HEIGHT_GIRLS.zscore.monthly-e5830d69.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-6cf025bb.js → HEIGHT_GIRLS.zscore.weekly-ee4eb471.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-3168bc4a.js → HEIGHT_GIRLS.zscore.yearly-2fea76f2.js} +0 -0
- /package/build/{Onboarding-bb42c695.js → Onboarding-30aed79e.js} +0 -0
- /package/build/{Visible-1d62c6ec.js → Visible-d5b3e721.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-2421af67.js → WEIGHT_BOYS.percentile.monthly-3b373855.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-0bbc000a.js → WEIGHT_BOYS.percentile.weekly-40d48d19.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-0c63fd23.js → WEIGHT_BOYS.percentile.yearly-a8ed04d7.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-e97f27d9.js → WEIGHT_BOYS.zscore.monthly-bb4515c9.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-0c946f7e.js → WEIGHT_BOYS.zscore.weekly-e246bbb1.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-0f0c8f12.js → WEIGHT_BOYS.zscore.yearly-f8a1009f.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-5e144548.js → WEIGHT_GIRLS.percentile.monthly-2a4758e2.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-34912d4d.js → WEIGHT_GIRLS.percentile.weekly-945cecc0.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-7a79bf18.js → WEIGHT_GIRLS.percentile.yearly-f388f6eb.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-08afd8ea.js → WEIGHT_GIRLS.zscore.monthly-29e23b56.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-95b1f1a9.js → WEIGHT_GIRLS.zscore.weekly-27bfa598.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-d8c551fe.js → WEIGHT_GIRLS.zscore.yearly-ec81d01f.js} +0 -0
- /package/build/{cookieHelper-fc7ed935.js → cookieHelper-c4eae752.js} +0 -0
- /package/build/{dataTransform-1d461d05.js → dataTransform-7a7971d2.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-a4ddeb58.js → BMI_BOYS.percentile.monthly-6359f2aa.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-dc43ee4b.js → BMI_BOYS.percentile.weekly-fe261546.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-48303233.js → BMI_BOYS.percentile.yearly-dfb86f24.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-079055ec.js → BMI_BOYS.zscore.monthly-32b6f269.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-0128dea5.js → BMI_BOYS.zscore.weekly-01f330ec.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-2242a802.js → BMI_BOYS.zscore.yearly-e5014506.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-efecf947.js → BMI_GIRLS.percentile.monthly-fa928a13.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-399676ad.js → BMI_GIRLS.percentile.weekly-ec63366d.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-761031e4.js → BMI_GIRLS.percentile.yearly-6f7249a8.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-e6c69a0d.js → BMI_GIRLS.zscore.monthly-84f48d9d.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-47ab3dd4.js → BMI_GIRLS.zscore.weekly-d2aa40f9.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-43ef2c8b.js → BMI_GIRLS.zscore.yearly-f7c405d2.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-d489433b.js → HEAD CIRCUM_BOYS.percentile.monthly-9a7d38e3.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-ff0283b9.js → HEAD CIRCUM_BOYS.percentile.weekly-5f8c3bc2.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-996cc9da.js → HEAD CIRCUM_BOYS.percentile.yearly-05cfb1a7.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-7861c8c3.js → HEAD CIRCUM_BOYS.zscore.monthly-e0d54f1f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-e232b292.js → HEAD CIRCUM_BOYS.zscore.weekly-37e62f29.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-66290bdb.js → HEAD CIRCUM_BOYS.zscore.yearly-71b64cf9.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-333ca9f0.js → HEAD CIRCUM_GIRLS.percentile.monthly-e6419ec4.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-6538b6aa.js → HEAD CIRCUM_GIRLS.percentile.weekly-50ff3bb2.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-2b17e98b.js → HEAD CIRCUM_GIRLS.percentile.yearly-58407ac8.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-cd0e93ab.js → HEAD CIRCUM_GIRLS.zscore.monthly-0a3d0392.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-b386b4d4.js → HEAD CIRCUM_GIRLS.zscore.weekly-7704d6f6.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-5f961ae3.js → HEAD CIRCUM_GIRLS.zscore.yearly-20d7b666.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-cdcebb2e.js → HEIGHT_BOYS.percentile.monthly-2265f5e0.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-0f06d78a.js → HEIGHT_BOYS.percentile.weekly-1d6f2675.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-85cbc91d.js → HEIGHT_BOYS.percentile.yearly-a16c60e0.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-4d52aa89.js → HEIGHT_BOYS.zscore.monthly-74f11cf7.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-596a5bec.js → HEIGHT_BOYS.zscore.weekly-4e9ad921.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-bf2b0fcd.js → HEIGHT_BOYS.zscore.yearly-3c84be19.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-9b277d27.js → HEIGHT_GIRLS.percentile.monthly-d69c1bc0.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-a83765dc.js → HEIGHT_GIRLS.percentile.weekly-c98c3719.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-69ff6d3f.js → HEIGHT_GIRLS.percentile.yearly-7d1c2f8f.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-271c9646.js → HEIGHT_GIRLS.zscore.monthly-458a3838.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-a2971a90.js → HEIGHT_GIRLS.zscore.weekly-ee69fddb.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-76d0f3e3.js → HEIGHT_GIRLS.zscore.yearly-4ed7d8c4.js} +0 -0
- /package/build/esm/{Onboarding-68d1528c.js → Onboarding-128f7694.js} +0 -0
- /package/build/esm/{Visible-1216891b.js → Visible-0aff5e0b.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-b63caaeb.js → WEIGHT_BOYS.percentile.monthly-c975b56a.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-8b0468be.js → WEIGHT_BOYS.percentile.weekly-fa671296.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-25e6ed3e.js → WEIGHT_BOYS.percentile.yearly-94ee1ffc.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-48e573b1.js → WEIGHT_BOYS.zscore.monthly-980ad564.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-0617172a.js → WEIGHT_BOYS.zscore.weekly-cfd0319e.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-49394533.js → WEIGHT_BOYS.zscore.yearly-93242e4e.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-6644c39e.js → WEIGHT_GIRLS.percentile.monthly-3701392d.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-0fb28e80.js → WEIGHT_GIRLS.percentile.weekly-f94367f1.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-04742478.js → WEIGHT_GIRLS.percentile.yearly-21712a28.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-2352277a.js → WEIGHT_GIRLS.zscore.monthly-68b0d421.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-624aac3b.js → WEIGHT_GIRLS.zscore.weekly-53eb8866.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-3afc6b20.js → WEIGHT_GIRLS.zscore.yearly-ba9c78d9.js} +0 -0
- /package/build/esm/{cookieHelper-d4751a4b.js → cookieHelper-f08471b0.js} +0 -0
- /package/build/esm/{dataTransform-7d03a95f.js → dataTransform-9a889a57.js} +0 -0
- /package/build/esm/{index-4fa2b97e.js → index-c4775284.js} +0 -0
- /package/build/esm/{index-1323444f.js → index-c93685a5.js} +0 -0
- /package/build/esm/{index-b7d26e74.js → index-fc996fc3.js} +0 -0
- /package/build/esm/{isProduction-664c937a.js → isProduction-526256cd.js} +0 -0
- /package/build/esm/{localizeNumberFormat-a822256d.js → localizeNumberFormat-40d6b54f.js} +0 -0
- /package/build/esm/{normalizeLink-2753e3e1.js → normalizeLink-630cc7e1.js} +0 -0
- /package/build/esm/{number-713a46cb.js → number-2748523d.js} +0 -0
- /package/build/esm/{paths-33ad00d9.js → paths-d658dd02.js} +0 -0
- /package/build/esm/{screenSizeContext-7554eeca.js → screenSizeContext-593881b5.js} +0 -0
- /package/build/esm/{theme-4e8e8b15.js → theme-2b59bc50.js} +0 -0
- /package/build/esm/{translationsContext-c0070e3d.js → translationsContext-04bcf678.js} +0 -0
- /package/build/esm/{tslib.es6-049ed08d.js → tslib.es6-541a264f.js} +0 -0
- /package/build/esm/{types-4b3d239f.js → types-fe0f7019.js} +0 -0
- /package/build/esm/{useIsInit-ef15c1d5.js → useIsInit-6bede063.js} +0 -0
- /package/build/esm/{useOutsideClick-16362daf.js → useOutsideClick-359aeef3.js} +0 -0
- /package/build/esm/{useScrollbarSize-919731c7.js → useScrollbarSize-957c3c67.js} +0 -0
- /package/build/{index-1d04480f.js → index-11d9951e.js} +0 -0
- /package/build/{index-57457176.js → index-867763ec.js} +0 -0
- /package/build/{index-cc40dbe3.js → index-89f9554a.js} +0 -0
- /package/build/{isProduction-830789bd.js → isProduction-201ff7b0.js} +0 -0
- /package/build/{localizeNumberFormat-44032c9f.js → localizeNumberFormat-2080e041.js} +0 -0
- /package/build/{normalizeLink-4dc37aff.js → normalizeLink-3765f193.js} +0 -0
- /package/build/{number-7d2a3705.js → number-1de035c4.js} +0 -0
- /package/build/{paths-147650ff.js → paths-855ff49e.js} +0 -0
- /package/build/{screenSizeContext-a8d24de9.js → screenSizeContext-c2712d14.js} +0 -0
- /package/build/{theme-375fb870.js → theme-8c73ee47.js} +0 -0
- /package/build/{translationsContext-1a83f57b.js → translationsContext-1b861397.js} +0 -0
- /package/build/{tslib.es6-75ace7ba.js → tslib.es6-97edf1e8.js} +0 -0
- /package/build/{types-b8f11f2c.js → types-7692b1e6.js} +0 -0
- /package/build/{useIsInit-239c1042.js → useIsInit-e2e74e93.js} +0 -0
- /package/build/{useOutsideClick-cca08d82.js → useOutsideClick-5f6e71c0.js} +0 -0
- /package/build/{useScrollbarSize-7c7138dc.js → useScrollbarSize-4221e3e3.js} +0 -0
package/build/esm/lead.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as t}from"./tslib.es6-049ed08d.js";import a,{createContext as l,useState as n,useEffect as o,useMemo as i,useRef as r,useContext as s}from"react";import d from"lodash/debounce";import{v1 as c}from"uuid";import{B as m}from"./index-c76b3f54.js";import{CommonGAssets as u}from"./gAssets.js";import{Portal as p,Box as h,Transition as g,Overlay as v}from"@mantine/core";import{T as b}from"./index-d383d324.js";import{H as y}from"./index.styles-de1b2c0a.js";import{S as f,d as k,c as _,R as E,P as w,N as C}from"./index-6bdc378c.js";import"./constants-cd30a2ef.js";import"./Onboarding-68d1528c.js";import"./utils-6d392ba9.js";import{l as N,k as T}from"./screenSizeContext-7554eeca.js";import{D as S}from"./index-faedded8.js";import x from"dayjs";import"styled-components";import{t as O}from"./theme-4e8e8b15.js";import"./index-f9e1b776.js";import"./isProduction-664c937a.js";import{T as P}from"./translationsContext-c0070e3d.js";import"string-format";import"@mantine/hooks";import"./index.styled-b4ecc267.js";import"./index-1323444f.js";import"./useCategory-06b1ac21.js";import{M as B}from"./utils-0a3162ba.js";import"@mantine/dates";import{createFormContext as j}from"@mantine/form";import{u as L}from"./useTranslations-ac75c3b5.js";import{createPortal as $}from"react-dom";import{g as A,s as I}from"./cookieHelper-d4751a4b.js";import"date-fns/locale";import"react-keyed-flatten-children";import"slugify";import"@mantine/carousel";import"classnames";import"lodash/throttle";const D=1,U=2;let H="https://dev.leadgen.hellobacsi.com/";const R=1,M=2;let W="";H.includes("localhost")&&(H="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(W="pink");let F="https://"+location.hostname+location.pathname+location.search;F=F.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));const V={"vi-VN":{popupLang:"vi",countryCode:"vn",countryCodeNumber:84},"id-ID":{popupLang:"id",countryCode:"id",countryCodeNumber:62},"th-TH":{popupLang:"th",countryCode:"th",countryCodeNumber:66},"ms-MY":{popupLang:"ms",countryCode:"my",countryCodeNumber:60},"zh-TW":{popupLang:"zh",countryCode:"tw",countryCodeNumber:886},"km-KH":{popupLang:"km",countryCode:"kh",countryCodeNumber:855},"my-MM":{popupLang:"my",countryCode:"mm",countryCodeNumber:95},"hi-IN":{popupLang:"hi",countryCode:"in",countryCodeNumber:91}},q=V[document.documentElement.lang]||V["vi-VN"];const J={1:"Asia/Ho_Chi_Minh",10:"Asia/Ho_Chi_Minh",11:"Asia/Ho_Chi_Minh",12:"Asia/Ho_Chi_Minh",2:"Asia/Jakarta",3:"Asia/Bangkok",4:"Asia/Phnom_Penh",5:"Asia/Kuala_Lumpur",6:"Asia/Taipei",7:"Asia/Yangon",8:"Asia/Kolkata",9:"Asia/Manila"};var Y={"validator.required":"This field is required.","validator.remote":"Please fix this field.","validator.email":"Please enter a valid email address.","validator.phone":"Please input correct phone number.","validator.url":"Please enter a valid URL.","validator.date":"Please enter a valid date.","validator.dateISO":"Please enter a valid date (ISO).","validator.number":"Please enter a valid number.","validator.digits":"Please enter only digits.","validator.creditcard":"Please enter a valid credit card number.","validator.equalTo":"Please enter the same value again.","validator.accept":"Please enter a value with a valid extension.","validator.maxlength":"jQuery.validator.format('Please enter no more than {0} characters.","validator.minlength":"jQuery.validator.format('Please enter at least {0} characters.","validator.rangelength":"jQuery.validator.format('Please enter a value between {0} and {1} characters long.","validator.range":"jQuery.validator.format('Please enter a value between {0} and {1}.","validator.max":"jQuery.validator.format('Please enter a value less than or equal to {0}.","validator.min":"jQuery.validator.format('Please enter a value greater than or equal to {0}.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"};const z={"en-PH":Y,"vi-VN":{"validator.required":"Vui lòng điền mục này","validator.email":"Vui lòng điền email có thật.","validator.number":"Vui lòng điền số có thật","validator.digits":"Vui lòng chỉ điền số","validator.maxlength":"Vui lòng điền dưới {0} số","validator.minlength":"Vui lòng điền hơn {0} số","validator.remote":"Hãy sửa cho đúng.","validator.url":"Hãy nhập URL.","validator.date":"Hãy nhập ngày.","validator.dateISO":"Hãy nhập ngày (ISO).","validator.creditcard":"Hãy nhập số thẻ tín dụng.","validator.equalTo":"Hãy nhập thêm lần nữa.","validator.extension":"Phần mở rộng không đúng.","validator.rangelength":"Hãy nhập từ {0} đến {1} kí tự.","validator.range":"Hãy nhập từ {0} đến {1}.","validator.max":"Hãy nhập từ {0} trở xuống.","validator.min":"Hãy nhập từ {0} trở lên.","validator.phone":"Nhập đúng định dạng số điện thoại","validator.emailUsed":"Email này đã được sử dụng cho chiến dịch.","validator.phoneUsed":"Số điện thoại này đã được sử dụng cho chiến dịch.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"hi-IN":{"validator.required":"इस क्षेत्र की आवश्यकता है।","validator.email":"कृपया एक मान्य ईमेल पता दर्ज करें","validator.number":"कृपया एक वैध संख्या दर्ज करें","validator.digits":"कृपया केवल अंक दर्ज करें","validator.maxlength":"कृपया {0} अक्षर से अधिक दर्ज न करें","validator.minlength":"कृपया कम से कम {0} अक्षर दर्ज करें","validator.phone":"कृपया एक वैध संख्या दर्ज करें","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"id-ID":{"validator.required":"Kolom ini wajib diisi","validator.email":"Tolong daftarkan email yang valid","validator.number":"Tolong daftarkan nomor telepon yang valid","validator.digits":"Tolong masukkan angka saja","validator.maxlength":"Jangan memasukkan lebih dari {0} karakter","validator.minlength":"Tolong ketik sedikitnya {0} karakter","validator.phone":"Tolong daftarkan nomor telepon yang valid","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"ms-MY":{"validator.required":"Bahagian ini wajib diisi.","validator.email":"Sila masukkan alamat emel yang sah.","validator.number":"Sila masukkan no telefon yang sah.","validator.digits":"Sila masukkan nombor digit sahaja.","validator.maxlength":"Sila masukkan tidak lebih dari {0} aksara","validator.minlength":"Sila masukkan sekurang-kurangnya {0} aksara","validator.phone":"Sila masukkan no telefon yang sah.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"my-MM":{"validator.required":"ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်","validator.email":"မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ","validator.number":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.digits":"နံပါတ်များသာဖြည့်ပါ","validator.maxlength":"ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ","validator.minlength":"ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ","validator.phone":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"km-KH":{"validator.required":"ព័ត៌មានចាំបាច់ដែលត្រូវបំពេញ","validator.email":"សូមវាយអាសយដ្ឋានអ៊ីម៉ែលឲ្យបានត្រឹមត្រូវ","validator.number":"សូមវាយបញ្ចូលលេខឲ្យបានត្រឹមត្រូវ","validator.digits":"វាយបញ្ចូលបានតែលេខប៉ុណ្ណោះ","validator.maxlength":"សូមវាយបញ្ចូលកុំឲ្យលើស {0} តួអក្សរ","validator.minlength":"សូមវាយបញ្ចូលតិចបំផុត {0} តួអក្ស","validator.phone":"សូមវាយបញ្ចូលលេខឲ្យបានត្រឹមត្រូវ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"zh-TW":{"validator.required":"此為必填欄位","validator.email":"請填入有效的 email 地址","validator.number":"請填入有效的電話號碼","validator.digits":"此欄位僅能輸入數字","validator.maxlength":"請輸入少於 {0} 位數","validator.minlength":"請輸入至少 {0} 位數","validator.phone":"請填入有效的電話號碼","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"th-TH":{"validator.required":"ต้องระบุข้อมูลในช่องนี้","validator.email":"กรุณาใส่อีเมล์ที่ถูกต้อง","validator.number":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.digits":"กรุณาส่เฉพาะตัวเลข","validator.maxlength":"กรุณาใส่ตัวเลขมากกว่า {0} หลัก","validator.minlength":"กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก","validator.phone":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"tl-PH":Y},G=e=>{const t=z[e];return t||z["en-PH"]},K=l({}),Q=e=>{const[t,a]=n(16),[l,i]=n(9),[r,s]=n(!1);return o((()=>{if(s(!1),e){const t=new Image;t.addEventListener("load",(()=>{a(t.naturalWidth),i(t.naturalHeight),s(!0)})),t.addEventListener("error",(()=>{a(16),i(9),s(!0)})),t.src=e}else a(16),i(9),s(!0)}),[e]),{loaded:r,width:t,height:l}},X=({onClose:e,containerClassName:t,svgClassName:l})=>a.createElement("button",{onClick:e,className:`le-newbuilder-close-button js-modal__close ${t||""}`},a.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",className:l},a.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"white"}),a.createElement("path",{d:"M16 17.05L10.925 22.125C10.7917 22.2584 10.621 22.329 10.413 22.337C10.2044 22.3457 10.025 22.275 9.87502 22.125C9.72502 21.975 9.65002 21.8 9.65002 21.6C9.65002 21.4 9.72502 21.225 9.87502 21.075L14.95 16L9.87502 10.925C9.74169 10.7917 9.67102 10.6207 9.66302 10.412C9.65436 10.204 9.72502 10.025 9.87502 9.87502C10.025 9.72502 10.2 9.65002 10.4 9.65002C10.6 9.65002 10.775 9.72502 10.925 9.87502L16 14.95L21.075 9.87502C21.2084 9.74169 21.3794 9.67069 21.588 9.66202C21.796 9.65402 21.975 9.72502 22.125 9.87502C22.275 10.025 22.35 10.2 22.35 10.4C22.35 10.6 22.275 10.775 22.125 10.925L17.05 16L22.125 21.075C22.2584 21.2084 22.329 21.379 22.337 21.587C22.3457 21.7957 22.275 21.975 22.125 22.125C21.975 22.275 21.8 22.35 21.6 22.35C21.4 22.35 21.225 22.275 21.075 22.125L16 17.05Z",fill:"#595959"}))),Z=({popupId:e,url:t,newTab:l,imageDestkop:n,imageMobile:o,onClose:i,onOtherSubmit:r})=>{const{width:s,height:d,loaded:c}=Q(o),{width:m,height:u,loaded:p}=Q(n);return c&&p?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"center_tab"},a.createElement("div",{className:"le-center-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{className:"js-popup-other-submit",href:t,target:l?"blank":"_parent",onClick:r},a.createElement("img",{className:"le-only-mobile",src:o,style:{aspectRatio:`${s}/${d}`}}),a.createElement("img",{className:"le-only-desktop",src:n,style:{aspectRatio:`${m}/${u}`}})),a.createElement(X,{onClose:i,containerClassName:"close-button-top-right"})))):null},ee=({popupId:e,url:t,title:l,urlText:n,titleAlign:o,subtitle:i,subtitleAlign:r,newTab:s,imageDesktop:d,imageMobile:c,onClose:m,onOtherSubmit:u})=>{const{width:p,height:h,loaded:g}=Q(c),{width:v,height:b,loaded:y}=Q(d);return g&&y?a.createElement("div",{id:e,className:"lead-modal-wrapper lead-floating-wrapper","data-popup-url":location.pathname,"data-popup-type":"floating"},a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-floating-desktop"},a.createElement("div",{className:"le-floating-desktop-wrap",style:{position:"relative",background:"#fff"}},d?a.createElement("div",null,a.createElement("img",{style:{maxWidth:120,borderTopLeftRadius:5,borderBottomLeftRadius:5,aspectRatio:`${v}/${b}`},src:d})):null,a.createElement("div",{style:{padding:20}},a.createElement("div",{className:`le-floating-desktop-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-desktop-desc le-text-align-${r}`},i)),a.createElement("a",{target:s?"blank":"_parent",style:{marginLeft:35,textDecoration:"none"},href:t},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n)),a.createElement(X,{onClose:m,containerClassName:"close-button-top-right"})))),a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-floating-mobile"},a.createElement("div",{className:"le-floating-mobile-wrap",style:{position:"relative",background:"#fff"}},a.createElement("aside",{style:{display:"flex",justifyContent:"space-between"}},a.createElement("div",null,a.createElement("div",{className:`le-floating-mobile-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-mobile-desc le-text-align-${r}`},i)),c?a.createElement("div",null,a.createElement("img",{style:{marginLeft:15,marginTop:4,maxWidth:100,aspectRatio:`${p}/${h}`},src:c})):null),a.createElement("div",{style:{textAlign:"center",marginTop:10}},a.createElement("a",{target:s?"blank":"_parent",href:t,style:{textDecoration:"none"}},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n))),a.createElement(X,{onClose:m,containerClassName:"close-button-top-right"}))))):null};const te=new class{constructor(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},ae={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${te.apiLeadUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},le={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${te.apiSubotUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},ne=({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),le.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},oe=({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),ae.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},ie=({phone:e,type:t})=>ae.call({url:"phone"===t?"api/sms/otp":"api/sms/whatsapp_otp",method:"post",data:{phone_number:"phone"===t?e.replace("+",""):e}}),re=({phone:e,otp:t,type:a})=>ae.call({url:"phone"===a?"api/sms/verify":"api/sms/whatsapp_verify",method:"post",data:{otp_code:t,phone_number:"phone"===a?e.replace("+",""):e}}),se="undefined"==typeof window,de={VN:"vi",ID:"id",TH:"th",MY:"ms",TW:"zh-TW",KH:"km",MM:"my",IN:"hi",PH:"en"},ce=(e="",a="",l="",i=500)=>{const[r,s]=n([]),[d,c]=n(!1);return o((()=>{let n;return e?n=window.setTimeout((()=>t(void 0,void 0,void 0,(function*(){var n;if(e)try{c(!0);const o=yield((e="",a="",l="vi")=>t(void 0,void 0,void 0,(function*(){return new Promise(((t,n)=>{if(!e)return n("Need valid text input");if(se)return n("Need valid window object");try{(new window.google.maps.places.AutocompleteService).getPlacePredictions(Object.assign(Object.assign({input:e},a?{componentRestrictions:{country:a}}:{}),{language:de[l]}),t)}catch(e){n(e)}}))})))(e,a,l);s(!(n=o)||n.length<1?[]:n.map((e=>({placeId:e.place_id,description:e.description}))))}catch(e){console.error(e)}finally{c(!1)}else s([])}))),i):r.length&&s([]),()=>{window.clearTimeout(n)}}),[e,i,a]),{isLoading:d,predictions:r}},me={email:{},phone:{}},ue=(e,a,l)=>t(void 0,void 0,void 0,(function*(){const n="email"in l?"email":"phone",o="email"in l?l.email:l.phone,i="email"in l?"validator.emailUsed":"validator.phoneUsed";if(me[n][o]){if(me[n][o].value)return i;if(!me[n][o].value&&me[n][o].expire>Date.now())return""}const r=yield((e,a,l)=>t(void 0,void 0,void 0,(function*(){const t="email"in l?"email":"phone",n="email"in l?l.email:l.phone,o="email"in l?"validator.emailUsed":"validator.phoneUsed",i=yield oe({campaign_id:[e],[t]:n});return"SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode||a.length&&"CheckSuBotLeadTool_ERR_001"===(yield ne({bot_id:a,[t]:n}))._errorCode?o:void 0})))(e,a,l);return me[n][o]=r?{value:!0}:{value:!1,expire:Date.now()+6e4},r})),[pe,he,ge]=j(),ve=["places"],be=({name:e,placeholder:t,locale:l})=>{var s;const d=he(),[c,m]=n(""),[u,p]=n(""),{predictions:h}=ce(c,"","tl-PH"===l?"en":null===(s=null==l?void 0:l.split("-"))||void 0===s?void 0:s[0]),[g,v]=n(null),[b,y]=n(!1),k=r(Math.random().toString(36).substring(7)),_=i((()=>{const e=h.map((e=>({value:e.description,label:e.description}))),t=e.find((e=>e.value===u));return!u||t?e:[{value:u,label:u}].concat(e)}),[h,u]);return o((()=>{var e,t,a;(null===(a=null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.places)||void 0===a?void 0:a.AutocompleteService)?y(!0):import("@react-google-maps/api").then((e=>{v((()=>e.LoadScript)),setTimeout((()=>{y(!0)}),200)}))}),[]),b?a.createElement(a.Fragment,null,g&&a.createElement(g,{googleMapsApiKey:"AIzaSyD9AbNa4AFwr8eNVs90G1YhQLhfWJ6KncU",libraries:ve,loadingElement:a.createElement(a.Fragment,null)}),a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":e,"data-control":"text"}),a.createElement(f,Object.assign({className:"lead-modal__form-control",label:t,placeholder:t,withAsterisk:!0,name:e,data:_,searchValue:c,onSearchChange:e=>{m(e)},filter:()=>!0,clearable:!0,searchable:!0,onChange:e=>p(e||""),icon:a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},a.createElement("path",{d:"M9.99999 9.79167C10.4028 9.79167 10.7467 9.64944 11.0317 9.365C11.3161 9.08 11.4583 8.73611 11.4583 8.33333C11.4583 7.93056 11.3161 7.58667 11.0317 7.30167C10.7467 7.01722 10.4028 6.875 9.99999 6.875C9.59721 6.875 9.25332 7.01722 8.96832 7.30167C8.68388 7.58667 8.54166 7.93056 8.54166 8.33333C8.54166 8.73611 8.68388 9.08 8.96832 9.365C9.25332 9.64944 9.59721 9.79167 9.99999 9.79167ZM9.99999 17.875C9.90277 17.875 9.80555 17.8611 9.70832 17.8333C9.6111 17.8056 9.52082 17.7569 9.43749 17.6875C7.46527 15.8958 5.98971 14.2361 5.01082 12.7083C4.03138 11.1806 3.54166 9.77778 3.54166 8.5C3.54166 6.48611 4.1911 4.87833 5.48999 3.67667C6.78832 2.47556 8.29166 1.875 9.99999 1.875C11.7083 1.875 13.2119 2.47556 14.5108 3.67667C15.8092 4.87833 16.4583 6.48611 16.4583 8.5C16.4583 9.77778 15.9689 11.1806 14.99 12.7083C14.0105 14.2361 12.5347 15.8958 10.5625 17.6875C10.4792 17.7569 10.3889 17.8056 10.2917 17.8333C10.1944 17.8611 10.0972 17.875 9.99999 17.875Z",fill:"#8C8C8C"})),autoComplete:"no-auto-complete-"+k.current,rightSection:a.createElement(a.Fragment,null)},d.getInputProps(e)))):a.createElement("div",{style:{height:73}})},ye=({children:e,align:t})=>a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${W}`},e),fe=({children:e,align:t})=>a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${W}`},e),ke=({listBlockAdded:e,popupId:t,locale:l,onClose:n,onOtherSubmit:o})=>{const i=he();return a.createElement(a.Fragment,null,e.map(((e,r)=>{const{name:s="",data:d={}}=e||{},{placeholder:c,value:u,align:p,listQuestion:h,isSendMailChimp:g=!1,newtab:v,url:b}=d;switch(s){case"TitleBlock":return a.createElement(fe,{key:r,align:p},u);case"SubtitleBlock":return a.createElement(ye,{key:r,align:p},u);case"TextBlock":return a.createElement(_,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"text",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"text",name:u},i.getInputProps(u)));case"NumberBlock":return a.createElement(C,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"number",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"number",name:u},i.getInputProps(u)));case"EmailBlock":return a.createElement(_,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"email",name:u},i.getInputProps(u)));case"PhoneOtpBlock":case"WhatsappOtpBlock":case"PhoneBlock":{const e=t+"-"+u+"-"+r;return a.createElement(_.Wrapper,Object.assign({size:"md",withAsterisk:!0,key:r,label:c,className:"lead-modal__form-control",labelProps:{htmlFor:e}},i.getInputProps(u)),a.createElement(w,{name:u,spellCheck:!1,type:"tel",placeholder:c,onChange:e=>{i.setFieldValue(u,e)},id:e,defaultCountry:l&&B[l]||"VN","data-control":"tel"}))}case"LocationBlock":return a.createElement(be,{key:r,name:u,placeholder:c,locale:l});case"DateBlock":return a.createElement(a.Fragment,null,a.createElement(S,Object.assign({withAsterisk:!0,key:r,type:"default",name:u,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"date"},i.getInputProps(u))),a.createElement("input",{type:"hidden",name:u,"data-control":"date"}));case"LinkButtonBlock":return a.createElement("div",{key:r},a.createElement("a",{target:v?"blank":"parrent",href:b,style:{textDecoration:"none"}},a.createElement(m,{type:"button",size:"md",className:`lead-modal__btn ${W}`,onClick:()=>{null==n||n(),null==o||o()}},u)));case"CheckboxBlock":return a.createElement(a.Fragment,null,g&&a.createElement("div",{style:{display:"none"},"data-name":u+"-mailchimp"}),a.createElement(k.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md",sx:{display:"flex",flexDirection:"column",gap:8}},i.getInputProps(u)),h.map(((e,t)=>a.createElement(k,{name:u,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})))));case"RadioBlock":return a.createElement(a.Fragment,null,g&&a.createElement(_,{type:"hidden",name:u+"-mailchimp",value:g}),a.createElement(E.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(u)),h.map(((e,t)=>a.createElement(E,{name:u,key:t,value:e.value,label:e.placeholder,"data-control":"radio"})))));case"DropdownBlock":return a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":u,"data-control":"dropdown"}),a.createElement(f,Object.assign({key:r,className:"lead-modal__form-control",label:c,withAsterisk:!0,name:u,data:h.map((e=>({value:e.value,label:e.placeholder})))},i.getInputProps(u))));case"TncBlock":const s=i.getInputProps("TNC-"+e.id);return a.createElement(a.Fragment,null,a.createElement(k,Object.assign({name:"TNC-"+e.id,key:e.id,label:a.createElement("p",{className:"lead-modal__tnc-link",dangerouslySetInnerHTML:{__html:d.valueHTML}}),className:"tnc-block","data-control":"checkbox"},s,{error:s.error?a.createElement(a.Fragment,null):void 0})))}return null})))},_e=({otpData:e,onSuccess:l,autoSendWhenOpen:i})=>{const{t:s}=L(),d=e.phone,c=e.type,[u,p]=n(""),[h,g]=n(!1),[v,f]=n(i?0:60),k=r(null),[E,w]=n(),[C,N]=n(""),T=r(),[S,x]=n(!1);o((()=>{t(void 0,void 0,void 0,(function*(){var e;if(!T.current){const e=yield import("react-phone-number-input");T.current=e.formatPhoneNumberIntl}N((null===(e=T.current)||void 0===e?void 0:e.call(T,d))||d)}))}),[d]);const P=()=>t(void 0,void 0,void 0,(function*(){var e;if(!d)return;const t=yield ie({phone:d,type:c}),a=null===(e=null==t?void 0:t._messages)||void 0===e?void 0:e[0];"Send sms successfully"===a||"Send WhatsApp successfully"===a?(f(60),setTimeout((()=>{k.current&&(k.current.focus(),k.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===a?l():w(a||"Something went wrong!")}));return o((()=>{setTimeout((()=>{v>0&&f((e=>e-1))}),1e3)}),[v]),o((()=>{i&&!v&&P()}),[]),a.createElement(a.Fragment,null,a.createElement("form",{onSubmit:e=>{e.preventDefault(),t(void 0,void 0,void 0,(function*(){if(!d||!u)return;x(!0);const e=yield re({phone:d,otp:u,type:c}),t=null==e?void 0:e._messages[0];"Verify successfully"===t||"Verify WhatsApp OTP sucess"===t||"This phone number was verified"===t?l():w(t||"something Wrong"),x(!1)}))},className:"lead-phone-otp-form"},a.createElement(y,{tag:"h3",fontWeight:"bold",style:{marginBottom:4}},s("lead.otp.title")),a.createElement(b,{size:"p1",color:O.colors.gray600},s("lead.otp.desc",{phone:C})),a.createElement(_,{ref:k,name:"_"+name+"-otp",spellCheck:!1,type:"number",placeholder:"Enter OTP",className:"lead-modal__form-control",label:"Phone OTP","data-control":"otp",withAsterisk:!0,pattern:"[0-9]*",value:u,maxLength:6,onChange:e=>{g(!0),p(e),w(h&&!e?"OTP is required":void 0)},error:h?E:void 0}),a.createElement(m,{size:"md",color:"primary",className:`lead-modal__btn ${W}`,disabled:!u,isLoading:S},s("lead.otp.verify")),a.createElement(m,{type:"button",size:"md",color:"transparent",className:`lead-modal__btn lead-phone-otp-button ${W}`,onClick:()=>{P()},disabled:!!v},s("lead.otp.resend",{timer:v?` (${v}s)`:""}))))},Ee=({title:e,titleAlign:t,subtitle:l,subtitleAlign:n,link:o,linkNewTab:i,linkText:r,image:s})=>{const{width:d,height:c,loaded:m}=Q(s);return m?a.createElement("div",{className:"lead-modal__thank-you"},a.createElement("div",{style:{width:"100%"}},a.createElement("img",{src:s,style:{maxHeight:162,objectFit:"cover",aspectRatio:`${d}/${c}`},loading:"lazy"}),e&&a.createElement("h1",{className:`le-thankyou-title le-text-align-${t}`},e),l&&a.createElement("p",{className:`le-thankyou-subtitle le-text-align-${n}`},l),r&&a.createElement("div",null,a.createElement("a",{href:o,target:i?"_blank":"parrent",rel:"noreferrer"},a.createElement("button",{className:`lead-modal__btn ${W}`},r))))):null},we=({content:e,inlinePosition:t})=>{const a=i((()=>{if(!t)return null;const e=document.querySelectorAll(`[data-url="${location.pathname}"] .body-content`),a=Array.from(e).reduce(((e,t)=>[...e,...Array.from(t.children)]),[]);if(null==a?void 0:a.length){const e=a.filter((e=>"P"===e.nodeName)),l=a.filter((e=>"H2"===e.nodeName));let n=null;switch(t){case"1th":n=e[0];break;case"2th":n=e[1];break;case"3th":n=e[2];break;case"4th":n=e[3];break;case"5th":n=e[4];break;case"6th":n=e[5];break;case"7th":n=e[6];break;case"8th":n=e[7];break;case"9th":n=e[8];break;case"10th":n=e[9];break;case"11th":n=e[10];break;case"12th":n=e[11];break;case"lastP":n=e[e.length-1];break;case"1thH2":n=l[0];break;case"2thH2":n=l[1];break;case"3thH2":n=l[2];break;case"4thH2":n=l[3];break;case"5thH2":n=l[4];break;case"6thH2":n=l[5];break;case"7thH2":n=l[6];break;case"8thH2":n=l[7];break;case"9thH2":n=l[8];break;case"10thH2":n=l[9];break;case"lastH2":n=l[l.length-1]}if(n){if(n.parentElement.querySelector(".inline-lead-wrapper"))return n.parentElement.querySelector(".inline-lead-wrapper");{const e=document.createElement("div");return e.classList.add("inline-lead-wrapper"),n.nextElementSibling?n.parentElement.insertBefore(e,n.nextElementSibling):n.parentElement.appendChild(e),e}}}}),[t]);return t&&a?$(e,a):null},Ce=({content:e})=>{const t=i((()=>{const e=Array.from(document.querySelectorAll(".hc2-sidebar-with-ads,.page-main-col .right-col.f-right,.hhg-lead-sidebar"));return e.forEach((e=>{if(e.querySelector(".sidebar-lead-modal-wrapper"))return;const t=document.createElement("div");t.classList.add("sidebar-lead-modal-wrapper"),e.prepend(t)})),e.map((e=>e.querySelector(".sidebar-lead-modal-wrapper")))}),[]);return a.createElement(a.Fragment,null,t.map((t=>$(e,N(t,"sidebar-lead-modal-wrapper")))))},Ne=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:s,imageMobile:d,imageDesktop:c,imageOverlayMobile:p,imageOverlayDesktop:h,imageBackground:g,currentLayout:v,title:b,onSubmit:y,showThankyou:f,campaignId:k,campaign_subot_id:_,locale:E})=>{var w,C,N;const T=JSON.parse(t.listBlockAdded),S=JSON.parse(t.actionBlocks),x=JSON.parse(t.textBlocks),O=S.submitBlock.data.url,P=S.submitBlock.data.text,B=S.submitBlock.data.text2,j=S.submitBlock.data.value,$=location.pathname,A=v.includes("Inline")||"Sidebar"===v,I="Slider"===v,[D,U]=n(!0),[H,R]=n(null),[M,F]=n(!1),V=r(),J=()=>{H?R(null):null==l||l()};if(window.innerWidth<769&&["Fullscreen","Slider"].includes(v))return console.log("😎 Not show fullscreen, slider on mobile "),null;o((()=>{(v.includes("LightBox")||"Fullscreen"==v)&&document.body.classList.add("noscroll"),window.intlTelInputUtils||require("intl-tel-input/build/js/utils"),me.email={},me.phone={}}),[]);const Y=r(!1),z=r(!1),{form:G,validateObj:K}=(({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:n=[]})=>{const{t:o}=L(),s=i((()=>{const i=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","WhatsappOtpBlock","LocationBlock","TncBlock"],r=(e,t)=>a=>{if(c.current.isTouched(e))return void 0===a||""===a||Array.isArray(a)&&0===a.length?o("validator.required"):null==t?void 0:t(a)};return e.filter((e=>i.includes(e.name))).reduce(((e,i)=>"NumberBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(isNaN(Number(e)))return o("validator.number")}))}):"EmailBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return o("validator.email");a.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),ue(l,n,{email:e}).then((e=>{e?c.current.setFieldError(i.data.value,o(e)):c.current.clearFieldError(i.data.value),a.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(i.data.value,e.message||"Something went wrong"),a.current=!1}))}),200)}))}):"PhoneBlock"===i.name||"PhoneOtpBlock"===i.name||"WhatsappOtpBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),q.countryCode))return o("validator.phone");t.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),ue(l,n,{phone:e}).then((e=>{e?c.current.setFieldError(i.data.value,o(e)):c.current.clearFieldError(i.data.value),t.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(i.data.value,e.message||"Something went wrong"),t.current=!1}))}),200)}))}):"DateBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(isNaN(Date.parse(e)))return o("validator.date")}))}):"TncBlock"===i.name?Object.assign(Object.assign({},e),{["TNC-"+i.id]:r("TNC-"+i.id)}):Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value)})),{})}),[e.map((e=>e.name)).join(",")]),d=ge({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:s}),c=r(d);return c.current=d,{form:d,validateObj:s}})({listBlockAdded:T,validatingPhoneRef:Y,validatingEmailRef:z,campaignId:k,campaign_subot_id:_}),{width:Z,height:ee,loaded:te}=Q(g),{width:ae,height:le,loaded:ne}=Q(d),{width:oe,height:re,loaded:se}=Q(c),de=ne&&se&&("Fullscreen"!=v||te),ce=a.createElement(a.Fragment,null,a.createElement("style",{dangerouslySetInnerHTML:{__html:`\n .le-newbuilder-overlay {\n background-repeat: no-repeat;\n background-size: cover;\n }\n ${p?`\n .le-newbuilder-overlay {\n background: url(${p}) ;\n }`:""}\n ${h?`\n @media screen and (min-width:768px) {\n .le-newbuilder-overlay {\n background: url(${h}) ;\n }\n }`:""}`}}),a.createElement("div",{id:e,"data-popup-url":$,"data-popup-type":"lightbox-inline",className:`lead-modal lead-modal-wrapper modal--animate-scale ${A?"le-buider-inline":""} ${I?"le-buider-slider":""}`},"Fullscreen"==v?a.createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:g||"",style:{aspectRatio:`${Z}/${ee}`}}):null,a.createElement("div",{className:`lead-modal__wrapper le-newbuilder-wrap-${v}`},a.createElement("div",{className:`lead-modal__content le-newbuilder-${v}`},f?a.createElement(Ee,{title:f.title,titleAlign:f.titleAlign,subtitle:f.subtitle,subtitleAlign:f.subtitleAlign,link:f.link,linkNewTab:f.linkNewTab,linkText:f.linkText,image:f.image}):a.createElement(a.Fragment,null,a.createElement("header",{className:"lead-modal__header"},H?a.createElement("img",{src:u.getAssetPath("lead-otp-thumb.png"),draggable:"false",alt:"",style:{width:"100%",minHeight:"150px",backgroundColor:"#f2f2f2"},loading:"lazy"}):a.createElement(a.Fragment,null,["LightBoxA","InlineA","Sidebar","Slider"].includes(v)?d?a.createElement("img",{draggable:"false",className:"lead-modal__image lead-modal-image-cover",src:d,style:{aspectRatio:`${ae}/${le}`},alt:""}):null:a.createElement(a.Fragment,null,c?a.createElement("img",{draggable:"false",className:"le-only-desktop lead-modal__image lead-modal-image-cover",style:{objectFit:"cover",aspectRatio:`${oe}/${re}`},src:c,alt:""}):null,d?a.createElement("img",{draggable:"false",className:"le-only-mobile lead-modal__image lead-modal-image-cover",src:d,alt:"",style:{aspectRatio:`${ae}/${le}`}}):null))),H&&a.createElement(_e,{otpData:H,autoSendWhenOpen:!1,onSuccess:()=>{R(null),null==y||y(V.current,G.values)}}),a.createElement("div",{"data-hidden":!!H,className:"lead-modal__body le-newbuilder-overlay"},a.createElement(pe,{form:G},a.createElement("form",{ref:V,className:`lead-modal__form ${e}`,onSubmit:e=>{e.preventDefault(),G.setTouched(Object.keys(K).reduce(((e,t)=>(e[t]=!0,e)),{})),z.current||Y.current||setTimeout((()=>{G.onSubmit((e=>{var t,a,l,n,o,i;if(Object.keys(G.errors).length)return;let r=null;if(T.findIndex((e=>"PhoneOtpBlock"===e.name))>-1){const n=null===(a=null===(t=T.find((e=>"PhoneOtpBlock"===e.name)))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;(null===(l=e[n])||void 0===l?void 0:l.startsWith("+"))&&(r={phone:e[n],type:"phone"})}if(T.findIndex((e=>"WhatsappOtpBlock"===e.name))>-1){const t=null===(o=null===(n=T.find((e=>"WhatsappOtpBlock"===e.name)))||void 0===n?void 0:n.data)||void 0===o?void 0:o.value;(null===(i=e[t])||void 0===i?void 0:i.startsWith("+"))&&(r={phone:e[t],type:"whatsapp"})}if(r)return F(!0),void ie(r).then((t=>{var a;"This phone number was verified"!==(null===(a=null==t?void 0:t._messages)||void 0===a?void 0:a[0])?R(r):null==y||y(V.current,e)})).finally((()=>{F(!1)}));null==y||y(V.current,e)}))(e)}),100)}},a.createElement("div",{style:{marginBottom:20}},a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(null===(w=x.titleBlock.data)||void 0===w?void 0:w.align)} ${W}`},b),a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(null===(C=x.titleBlock.data)||void 0===C?void 0:C.align)} ${W}`},x.subtitleBlock.data.value)),a.createElement("div",{className:"lead-modal__form-control-wrapper"},a.createElement(ke,{listBlockAdded:T,popupId:e,locale:E,onClose:J,onOtherSubmit:s})),(null===(N=null==S?void 0:S.submitBlock)||void 0===N?void 0:N.isHide)?null:a.createElement(a.Fragment,null,a.createElement("div",{className:`lead-modal__checkbox-wrapper ${W}`},a.createElement("div",{className:"lead-modal__checkbox"},a.createElement("input",{id:"lead-term-checkbox",className:`lead-modal__checkbox__input ${W}`,type:"checkbox","aria-label":"Checkbox label",checked:D,onChange:e=>U(e.currentTarget.checked)}),a.createElement("div",{className:"lead-modal__checkbox__control","aria-hidden":"true"})),a.createElement("label",{htmlFor:"checkbox",className:"lead-modal__checkbox__label"},P," ",a.createElement("span",{style:{fontWeight:"bold"}},a.createElement("a",{target:"blank",href:O||"https://hellobacsi.com/chinh-sach",rel:"noopener noreferrer",style:{textDecoration:"none"}},B)))),a.createElement(m,{size:"md",id:"lead-submit",type:"submit",className:`lead-modal__btn ${W}`,disabled:!D,isLoading:M},j))))))),!v.includes("Inline")&&a.createElement(X,{onClose:J,containerClassName:"close-button-top-right"}))));return de?v.includes("LightBox")||"Fullscreen"==v||"Slider"==v?ce:"Sidebar"==v?a.createElement(Ce,{content:ce}):v.includes("Inline")?a.createElement(we,{content:ce,inlinePosition:t.popupInlinePosition}):null:null},Te=({popupId:e,link:t,linkText:l,linkNewTab:n,onClose:o,imageMobile:i,imageDesktop:r,currentLayout:s,onOtherSubmit:d})=>{const c=location.pathname,{width:m,height:u,loaded:p}=Q(i),{width:h,height:g,loaded:v}=Q(r);return p&&v?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":c,"data-popup-type":"skin_ab"},"SkinA"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-skin-a-desktop"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:r,style:{aspectRatio:`${h}/${g}`}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn js-popup-other-submit"},l)),a.createElement(X,{onClose:o,containerClassName:"close-button-top-right"})))):"SkinB"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:""},a.createElement("div",{style:{position:"relative",zIndex:1e4}},a.createElement("img",{src:r,style:{width:"100%",aspectRatio:`${h}/${g}`}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"100%"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(X,{containerClassName:"close-button-top-right",onClose:o})))):null,a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-skin-mobile"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:i,style:{width:"100%",aspectRatio:`${m}/${u}`}}),a.createElement("a",{style:{position:"absolute",top:"82%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",maxWidth:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(X,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:o}))))):null},Se=({popupId:e,url:t,newTab:l,image:n,onClose:o,onOtherSubmit:i})=>{const{width:r,height:s,loaded:d}=Q(n);return d?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"tab"},a.createElement("div",{className:"le-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{href:t,target:l?"blank":"_parent",onClick:i},a.createElement("img",{className:"js-popup-other-submit",src:n,style:{aspectRatio:`${r}/${s}`}})),a.createElement(X,{onClose:o,containerClassName:"close-button-top-right"})))):null},xe=[],Oe=[],Pe=[],Be=[],je=[],Le=[];const $e=(e="UTC")=>{const t=new Date;return new Date(t.toLocaleString("en-US",{timeZone:e}))},Ae=e=>{try{const[t,a]=e.split(" "),[l,n,o]=t.split("-").map(Number),[i,r,s]=a.split(":").map(Number);return new Date(l,n-1,o,i,r,s)}catch(e){return null}};const Ie=e=>!function(e){var t;const a=Number(null===(t=e.rules.find((e=>"exclude_sponsored"==e.rule)))||void 0===t?void 0:t.value);return!(!Boolean(document.querySelector(".hhg-disclaimer-text"))||!a||(Be.push(e),0))}(e)&&(!!function(e){var t,a;try{const l=null===(t=e.rules.find((e=>"exclude_sponsored_list"==e.rule)))||void 0===t?void 0:t.value,n=l instanceof Array?l:JSON.parse(l),o=Number(null===(a=document.querySelector("[data-sponsored-id]"))||void 0===a?void 0:a.getAttribute("data-sponsored-id"));return!o||o<=0||0===n.length||(!!n.find((e=>e.id==o))||(je.push({id:e.id,rules:e.rules}),!1))}catch(e){return!0}}(e)&&(1===e.formatted_status?function(e){var t;if(1===e.forever)return!0;const a=e.started_at,l=e.ended_at,n=Ae(a),o=Ae(l);if(!n||!o)return!0;const i=(null===(t=e.site)||void 0===t?void 0:t.id)||1;return!($e(J[i]).getTime()>o.getTime()&&(Pe.push(e),1))}(e):0===e.formatted_status&&(xe.push(e),(e=>{var t;const a=(null===(t=e.site)||void 0===t?void 0:t.id)||1,l=e.started_at,n=e.ended_at,o=Ae(l),i=Ae(n);if(!o||!i)return!1;const r=$e(J[a]).getTime();return r<=i.getTime()&&r>=o.getTime()&&(Oe.push(e),!0)})(e)))),De=e=>{var t;try{const a=(e,t,a)=>{const l=t.split(":"),n=a.split(":"),o=new Date;o.setHours(Number(l[0]),Number(l[1]),0,0);const i=new Date;return i.setHours(Number(n[0]),Number(n[1]),0,0),e>=o&&e<=i},l=null===(t=e.rules.find((e=>"appearance_time"==e.rule)))||void 0===t?void 0:t.value,n=l.startTime,o=l.endTime||"23:59";return!n||(!!a(new Date,n,o)||(Le.push(e),!1))}catch(e){return!0}};let Ue=null;function He({leadApi:e,leadSiteId:t,leadDomain:a,onShowPopup:l,DEBUG_URL:n}){const o=n||("https://"+location.hostname+location.pathname+location.search).toLowerCase();fetch(e+"api/campaign/"+t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:o,ga_client_id:A("_ga")||null})}).then((e=>e.json())).then((e=>{var t,n,i,r;if(Re("List campagin: ",e),F="https://"+location.hostname+location.pathname+location.search,1==e._status){const s=((null===(n=null===(t=e._data)||void 0===t?void 0:t.campaigns)||void 0===n?void 0:n.filter(Ie))||[]).filter(De);A("hhg-id")||(I("hhg-id",c(),{domain:"."+a,path:"/"}),Re("😍 Set HHG ID cookie"));let d=[];d=/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)?s.filter((e=>e.device_types.some((e=>e.id==R)))):s.filter((e=>e.device_types.some((e=>e.id==M)))),Re("👓 campaignsDevice",d),Re("--listCampaignScheduled",xe),Re("--listCampaignScheduledToActivated",Oe),Re("--listCampaignActiveButExpired",Pe),Re("--listCampaignExcludeSonsored",Be),Re("--listCampaignDifferentSponsor",je),Re("--listCampaignNotDisplayInRangeOfTime",Le);let m=d.map(((e,t)=>e.targets.filter((e=>e.type==D)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1);m=m.filter((e=>{var t;const a=new URL(String(e.target).toLowerCase());if("exact_match"==e.option)return Boolean(o===(null===(t=a.href)||void 0===t?void 0:t.toLowerCase()));if("start_with"==e.option){if(o.includes(String(e.target).toLowerCase())){const t=e.sub_target.filter((e=>"excluding"==e.option)).map((e=>{var t;return null===(t=e.value)||void 0===t?void 0:t.toLowerCase()}));return!t.includes(o.split("?")[0])}return!1}}));const u=Array.from(document.getElementsByTagName("META")).filter((e=>"article:tag"==e.getAttribute("property"))).map((e=>e.content));let p=[],h=[];u&&u.length&&(p=d.map(((e,t)=>e.targets.filter((e=>e.type==U)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1),h=p.filter((e=>u.includes(e.target))));const g=[...m,...h],v=document.cookie.split("; ").map((e=>e.split("=")[0])),b=v.filter((e=>e.includes("lead_submited")));Re("--listCampaignCodeSubmited",b);const y=v.filter((e=>e.includes("lead_closed")));Re("--listCampaignCodeClosed",y);const f=[...b,...y],k=(e=>{const t=[...e];for(let e=t.length-1;e>0;e--){const a=Math.floor(Math.random()*(e+1)),l=t[e];t[e]=t[a],t[a]=l}return t})(g.filter((e=>!f.some((t=>t.includes(d[e.campaignIndex].code))))));if(Re("--listCampaignValid : ",k),k&&k.length){const e=d[k[0].campaignIndex];Re("CAMPAIGN_SHOW",e);const{rules:t}=e,a=Number(null===(i=t.find((e=>"time"==e.rule)))||void 0===i?void 0:i.value);Re("timeoutRule",a);const n=Number(null===(r=t.find((e=>"scroll"==e.rule)))||void 0===r?void 0:r.value);Re("scrollRule",n);let o="TIME";if(Number.isInteger(a)&&(o="TIME",Re("✨ SHOW AWESOME POPUP AFTER: ",a," seconds"),Ue&&clearTimeout(Ue),Ue=setTimeout((()=>{null==l||l(e,o)}),1e3*a)),Number.isInteger(n)){o="SCROLL",Re("✨ SHOW AWESOME AFTER: SCROLL",n," %");const t=document.querySelector(`[data-url="${location.pathname}"]`)||document.querySelector("body"),a=t.getBoundingClientRect().top,i=t.offsetHeight;Re("👓 Element check scroll: ",t);const r=function(){const t=window.pageYOffset||document.documentElement.scrollTop;let s=0;t>=a&&(s=Math.round((t-a)/(i-innerHeight)*100)),Re("---Scroll",s,n),s>=n&&(window.removeEventListener("scroll",r),null==l||l(e,o))};window.addEventListener("scroll",r,{passive:!0})}}else Re("🚧 No lead campaigns on current URL, tags")}})).catch((e=>{Re("Lead error: ",e)}))}const Re=(...e)=>{("production"!==process.env.NODE_ENV||process.env.NEXT_PUBLIC_DEPLOY_ENV&&"production"!==process.env.NEXT_PUBLIC_DEPLOY_ENV||"undefined"!=typeof localStorage&&"true"===localStorage.getItem("hhg_debug"))&&console.log(...e)};const Me=({campaign:e,action:t,onSubmit:l,onClose:n,showThankyou:i,locale:d})=>{var m,u;const{apiUrl:p,siteDomain:h}=s(K);o((()=>{const e=A("_ga")||null;fetch(`${p}api/campaign/${y}/impression`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,url:location.href.toLowerCase(),title_article:document.title,cookie_id:A("hhg-id"),ga_client_id:e})})}),[]);const{extra_fields:g,image:v,image_desktop:b,code:y,image_background:f,image_overlay_mobile:k,image_overlay_desktop:_}=e||{},{currentLayout:E}=g,w=g.imageBlocks?JSON.parse(g.imageBlocks):{},C=JSON.parse(g.actionBlocks),N=JSON.parse(g.textBlocks);let T=(null===(u=null===(m=null==N?void 0:N.titleBlock)||void 0===m?void 0:m.data)||void 0===u?void 0:u.value)||"";const S={1:{},2:{},3:{}},x=r("lead-modal-"+c()),O=function(e="Xin chao {{category_2}} extra"){if(e.includes("{{category_")){const t=11,a=e.search("{{category_");return+e.charAt(t+a)}return null}(T);if(O){Re("⚡️ Has categoryLevel",O);const e=Array.from(document.getElementsByTagName("META")),t=e.find((e=>e.name===`content_category_${O}`)),a=e.find((e=>e.name===`content_category_en_${O}`));if(!t||!a)return Re("⚡️ No META TAG for categoryLevel, not show popup",O),null;S[O]={value:t.content,value_en:a.content},T=T.replace(`{{category_${O}}}`,t.content),Re("⚡️ Set categoryData ",O)}else Re("⚡️ No categoryLevel",O);const P=()=>{var t,a,l,o;if(Re("👌 Other submit click"),document.body.classList.remove("noscroll"),E.includes("Skin")){const e=document.querySelector("#masthead");e&&(e.style.top="0px !important;")}const i=Number(null!==(a=null===(t=e.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value)&&void 0!==a?a:7),r=Number(null!==(o=null===(l=e.rules.find((e=>"show_again_after_submit"==e.rule)))||void 0===l?void 0:l.value)&&void 0!==o?o:0);0===r&&(Re("⛔ Popup never show again!"),I(`lead_submited_${y}`,`target_${g.popupVersion}`,{domain:"."+h,path:"/"})),1==r&&(Re(`⌛ Popup will show again after ${i} days!`),I(`lead_submited_${y}`,`target_${g.popupVersion}`,{domain:"."+h,days:i,path:"/"}));const s=A("_ga")||null,d={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:A("hhg-id"),ga_client_id:s};O&&(d.category=S[O].value_en),fetch(`${p}api/campaign/${y}/lead`,{method:"POST",body:JSON.stringify(d),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then((e=>e.json())).then((e=>{"error"===e.status&&Re(e)})).catch((e=>{Re("Error:",e)})),null==n||n()};return"CenterTab"===E?a.createElement(Z,{popupId:x.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,imageMobile:v,imageDestkop:b,onClose:n,onOtherSubmit:P}):"Tab"===E?a.createElement(Se,{popupId:x.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,image:v,onClose:n,onOtherSubmit:P}):"Floating"===E?a.createElement(ee,{popupId:x.current,title:T,titleAlign:N.titleBlock.data.align,subtitle:N.subtitleBlock.data.value,subtitleAlign:N.subtitleBlock.data.align,url:C.linkButtonBlock.data.url,urlText:C.linkButtonBlock.data.value,newTab:C.linkButtonBlock.data.newtab,imageMobile:v,imageDesktop:b,onClose:n,onOtherSubmit:P}):E.includes("LightBox")||E.includes("Inline")||"Fullscreen"==E||"Sidebar"==E||"Slider"==E?a.createElement(Ne,{popupId:x.current,extraFields:g,onClose:n,onOtherSubmit:P,imageMobile:v,imageDesktop:b,imageBackground:f,currentLayout:E,title:T,onSubmit:(e,t)=>l(e,t,O,S),key:E,imageOverlayDesktop:_,imageOverlayMobile:k,showThankyou:i,campaignId:e.id,campaign_subot_id:e.bot_id||[],locale:d}):E.includes("Skin")?a.createElement(Te,{popupId:x.current,link:C.linkButtonBlock.data.url,linkNewTab:!!C.linkButtonBlock.data.newtab,linkText:C.linkButtonBlock.data.value,onClose:n,onOtherSubmit:P,imageMobile:v,imageDesktop:b,currentLayout:E}):null},We=({apiUrl:e,siteDomain:l,siteId:s,locale:c,apiSubotUrl:m,DEBUG_URL:u})=>{var b;const y=r(),f=r(Date.now()),{apiUrl:k}=i((()=>{let t=e;return t.includes("localhost")&&(t="https://dev.leadgen.hellobacsi.com/"),{apiUrl:t}}),[e,l,s]),[_,E]=n(null),[w,C]=n(""),[N,S]=n(null);o((()=>{te.apiLeadUrl=k,te.apiSubotUrl=m}),[k,m]);const O=(e,t)=>{E(e),C(t)},B=()=>{var e,t;if(!_)return;Re(`👋👋👋 CLOSE POPUP ${_.code} 👋👋👋`);const a=Number(null===(e=_.rules.find((e=>"show_again_after_exit"==e.rule)))||void 0===e?void 0:e.value),n=Number(null===(t=_.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value);0==a&&I(`lead_closed_${_.code}`,`target_${null==_?void 0:_.extra_fields.popupVersion}`,n?{domain:"."+l,days:n,path:"/"}:{domain:"."+l,path:"/"}),document.body.classList.remove("noscroll"),fetch(`${k}api/campaign/${_.code}/popup_exit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"CLICK",url:location.href.toLowerCase(),title_article:document.title,cookie_id:A("hhg-id"),duration:Math.ceil((Date.now()-f.current)/1e3)})}),E(null),S(null)};o((()=>{if(window.next){const e=d((e=>{Re("--🌻 routeChangeComplete",e,Date.now());const t=location.pathname;B(),document.querySelectorAll(`[data-popup-url="${t}"]`).length?Re("🔥 This URL page has show popup!"):(Re("--Process checkShowPopup"),He({leadApi:k,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:u})),y.current&&window.removeEventListener("scroll",y.current)}),500);window.next.router.events.on("routeChangeComplete",e)}He({leadApi:k,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:u})}),[]);const j=(e,a,n,o)=>t(void 0,void 0,void 0,(function*(){var t,i,r,s,d,c,m,u,p,h,g;if(!a)return;Re("submitHandler",n,o);const v=Object.keys(a).map((e=>({name:e,value:String(a[e])}))),b=A("_ga")||null;window.intlTelInputUtils||(yield require("intl-tel-input/build/js/utils"));const y={url:location.href.toLowerCase(),title_article:document.title,meta:v.map((t=>{var a,l;const n=(null===(a=e.querySelector(`*[name="${t.name}"][data-control]`))||void 0===a?void 0:a.getAttribute("data-control"))||(null===(l=e.querySelector(`*[data-extra][data-name="${t.name}"]`))||void 0===l?void 0:l.getAttribute("data-control"))||"text",o="tel"===n?window.intlTelInputUtils.formatNumber(String(t.value),null==q?void 0:q.countryCodeNumber,2).replace(/\s+/g,""):"date"===n?x(t.value).format("YYYY-MM-DD"):t.value;return{key:t.name,value:o,control:n}})),cookie_id:A("hhg-id"),ga_client_id:b};n&&o[n].value_en&&(y.category=o[n].value_en);const f=Number((null===(i=null===(t=_.rules)||void 0===t?void 0:t.find((e=>"days_to_show_again"===e.rule)))||void 0===i?void 0:i.value)||7),E=Number((null===(s=null===(r=_.rules)||void 0===r?void 0:r.find((e=>"show_again_after_submit"===e.rule)))||void 0===s?void 0:s.value)||0);if(0==E&&(Re("⛔ Popup never show again!"),I(`lead_submited_${_.code}`,`target_${null==_?void 0:_.extra_fields.targetType}`,{domain:"."+l,path:"/"})),1==E&&(Re(`⌛ Popup will show again after ${f} days!`),I(`lead_submited_${_.code}`,`target_${null==_?void 0:_.extra_fields.targetType}`,{domain:"."+l,days:f,path:"/"})),fetch(`${k}api/campaign/${_.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)}),"notshow"==(null==_?void 0:_.extra_fields.popupShowThankYou))return B(),void document.body.classList.remove("noscroll");let w=!0;const C=_.thank_you_image||`${k}admin/img/thanksyou.png`;let N,T,O=(null==_?void 0:_.extra_fields.popupThankyouTitle)||"Thank you.",P=(null==_?void 0:_.extra_fields.popupThankyouDesc)||"We appreciate your time!",j="",L="",$="";if("2.1"==(null==_?void 0:_.extra_fields.popupVersion)){const e=_.extra_fields,t=JSON.parse(e.listBlockThankyou),a=t.find((e=>"TitleBlock"==e.name)),l=t.find((e=>"SubtitleBlock"==e.name)),n=t.find((e=>"LinkButtonBlock"==e.name));O=(null===(d=null==a?void 0:a.data)||void 0===d?void 0:d.value)||"",j=(null===(c=null==a?void 0:a.data)||void 0===c?void 0:c.align)||"",P=(null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.value)||"",L=(null===(u=null==l?void 0:l.data)||void 0===u?void 0:u.align)||"",N=(null===(p=null==n?void 0:n.data)||void 0===p?void 0:p.value)||"",T=(null===(h=null==n?void 0:n.data)||void 0===h?void 0:h.newtab)||!1,$=(null===(g=null==n?void 0:n.data)||void 0===g?void 0:g.url)||"";const o=_.extra_fields.currentLayout;["SkinA","SkinB","Floating","Tab","CenterTab"].includes(o)&&(w=!1)}S(w?{title:O,titleAlign:j,subtitle:P,subtitleAlign:L,link:$,linkNewTab:T,linkText:N,image:C}:null),sessionStorage.getItem("insider_object")?window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")):window.insider_object={user:{email:"",phone_number:"",gdpr_optin:!0,sms_optin:!0,email_optin:!0}},v.map((e=>{const t=e.name,a=e.value;"tel"==t?window.insider_object.user.phone_number=a:"email"==t&&(window.insider_object.user.email=a)})),sessionStorage.setItem("insider_object",JSON.stringify(window.insider_object))}));return o((()=>{_&&(f.current=Date.now())}),[_]),a.createElement(K.Provider,{value:{apiUrl:k,siteDomain:l,siteId:s,locale:c}},a.createElement(P.Provider,{value:{locale:c,values:G(c)}},a.createElement(p,{target:T()},a.createElement(h,{sx:{position:"fixed",zIndex:9999999999}},a.createElement(g,{mounted:Boolean("2.1"===(null===(b=null==_?void 0:_.extra_fields)||void 0===b?void 0:b.popupVersion)),transition:"fade",duration:600,timingFunction:"ease"},(e=>{var t;return a.createElement(h,{style:e},"2.1"===(null===(t=null==_?void 0:_.extra_fields)||void 0===t?void 0:t.popupVersion)&&a.createElement(a.Fragment,null,!!_.extra_fields.currentLayout&&!_.extra_fields.currentLayout.includes("Inline")&&!_.extra_fields.currentLayout.includes("Sidebar")&&a.createElement(v,{color:"#000",opacity:.5,center:!0,zIndex:400,pos:"fixed",onClick:()=>B()}),a.createElement(Me,{campaign:_,action:w,onSubmit:j,onClose:B,showThankyou:N,locale:c})))}))))))};export{We as LeadGen};
|
|
1
|
+
import{_ as e,a as t}from"./tslib.es6-541a264f.js";import a,{createContext as l,useState as n,useEffect as o,useMemo as i,useRef as r,useContext as s}from"react";import d from"lodash/debounce";import{v1 as c}from"uuid";import{B as m}from"./index-43c43315.js";import{CommonGAssets as u}from"./gAssets.js";import{Portal as p,Box as h,Transition as g,Overlay as v}from"@mantine/core";import{T as b}from"./index-620551b5.js";import{H as y}from"./index.styles-8e66aa69.js";import{S as f,d as k,c as _,R as E,P as w,N as C}from"./index-603aec16.js";import"./constants-b5814512.js";import"./Onboarding-128f7694.js";import"./utils-5f9f0861.js";import{l as N,k as T}from"./screenSizeContext-593881b5.js";import{D as S}from"./index-bf7e8cb2.js";import x from"dayjs";import"styled-components";import{t as O}from"./theme-2b59bc50.js";import"./index-27f79b14.js";import"./isProduction-526256cd.js";import{T as P}from"./translationsContext-04bcf678.js";import"string-format";import"@mantine/hooks";import"./index.styled-02ca5623.js";import"./index-c93685a5.js";import"./useCategory-e1c4dd95.js";import{M as B}from"./utils-c9e60f19.js";import"@mantine/dates";import{createFormContext as j}from"@mantine/form";import{u as L}from"./useTranslations-0f3e8009.js";import{createPortal as $}from"react-dom";import{g as A,s as I}from"./cookieHelper-f08471b0.js";import"date-fns/locale";import"react-keyed-flatten-children";import"slugify";import"@mantine/carousel";import"classnames";import"lodash/throttle";const D=1,U=2;let H="https://dev.leadgen.hellobacsi.com/";const R=1,M=2;let W="";H.includes("localhost")&&(H="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(W="pink");let F="https://"+location.hostname+location.pathname+location.search;F=F.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));const V={"vi-VN":{popupLang:"vi",countryCode:"vn",countryCodeNumber:84},"id-ID":{popupLang:"id",countryCode:"id",countryCodeNumber:62},"th-TH":{popupLang:"th",countryCode:"th",countryCodeNumber:66},"ms-MY":{popupLang:"ms",countryCode:"my",countryCodeNumber:60},"zh-TW":{popupLang:"zh",countryCode:"tw",countryCodeNumber:886},"km-KH":{popupLang:"km",countryCode:"kh",countryCodeNumber:855},"my-MM":{popupLang:"my",countryCode:"mm",countryCodeNumber:95},"hi-IN":{popupLang:"hi",countryCode:"in",countryCodeNumber:91}},q=V[document.documentElement.lang]||V["vi-VN"];const J={1:"Asia/Ho_Chi_Minh",10:"Asia/Ho_Chi_Minh",11:"Asia/Ho_Chi_Minh",12:"Asia/Ho_Chi_Minh",2:"Asia/Jakarta",3:"Asia/Bangkok",4:"Asia/Phnom_Penh",5:"Asia/Kuala_Lumpur",6:"Asia/Taipei",7:"Asia/Yangon",8:"Asia/Kolkata",9:"Asia/Manila"};var Y={"validator.required":"This field is required.","validator.remote":"Please fix this field.","validator.email":"Please enter a valid email address.","validator.phone":"Please input correct phone number.","validator.url":"Please enter a valid URL.","validator.date":"Please enter a valid date.","validator.dateISO":"Please enter a valid date (ISO).","validator.number":"Please enter a valid number.","validator.digits":"Please enter only digits.","validator.creditcard":"Please enter a valid credit card number.","validator.equalTo":"Please enter the same value again.","validator.accept":"Please enter a value with a valid extension.","validator.maxlength":"jQuery.validator.format('Please enter no more than {0} characters.","validator.minlength":"jQuery.validator.format('Please enter at least {0} characters.","validator.rangelength":"jQuery.validator.format('Please enter a value between {0} and {1} characters long.","validator.range":"jQuery.validator.format('Please enter a value between {0} and {1}.","validator.max":"jQuery.validator.format('Please enter a value less than or equal to {0}.","validator.min":"jQuery.validator.format('Please enter a value greater than or equal to {0}.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"};const z={"en-PH":Y,"vi-VN":{"validator.required":"Vui lòng điền mục này","validator.email":"Vui lòng điền email có thật.","validator.number":"Vui lòng điền số có thật","validator.digits":"Vui lòng chỉ điền số","validator.maxlength":"Vui lòng điền dưới {0} số","validator.minlength":"Vui lòng điền hơn {0} số","validator.remote":"Hãy sửa cho đúng.","validator.url":"Hãy nhập URL.","validator.date":"Hãy nhập ngày.","validator.dateISO":"Hãy nhập ngày (ISO).","validator.creditcard":"Hãy nhập số thẻ tín dụng.","validator.equalTo":"Hãy nhập thêm lần nữa.","validator.extension":"Phần mở rộng không đúng.","validator.rangelength":"Hãy nhập từ {0} đến {1} kí tự.","validator.range":"Hãy nhập từ {0} đến {1}.","validator.max":"Hãy nhập từ {0} trở xuống.","validator.min":"Hãy nhập từ {0} trở lên.","validator.phone":"Nhập đúng định dạng số điện thoại","validator.emailUsed":"Email này đã được sử dụng cho chiến dịch.","validator.phoneUsed":"Số điện thoại này đã được sử dụng cho chiến dịch.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"hi-IN":{"validator.required":"इस क्षेत्र की आवश्यकता है।","validator.email":"कृपया एक मान्य ईमेल पता दर्ज करें","validator.number":"कृपया एक वैध संख्या दर्ज करें","validator.digits":"कृपया केवल अंक दर्ज करें","validator.maxlength":"कृपया {0} अक्षर से अधिक दर्ज न करें","validator.minlength":"कृपया कम से कम {0} अक्षर दर्ज करें","validator.phone":"कृपया एक वैध संख्या दर्ज करें","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"id-ID":{"validator.required":"Kolom ini wajib diisi","validator.email":"Tolong daftarkan email yang valid","validator.number":"Tolong daftarkan nomor telepon yang valid","validator.digits":"Tolong masukkan angka saja","validator.maxlength":"Jangan memasukkan lebih dari {0} karakter","validator.minlength":"Tolong ketik sedikitnya {0} karakter","validator.phone":"Tolong daftarkan nomor telepon yang valid","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"ms-MY":{"validator.required":"Bahagian ini wajib diisi.","validator.email":"Sila masukkan alamat emel yang sah.","validator.number":"Sila masukkan no telefon yang sah.","validator.digits":"Sila masukkan nombor digit sahaja.","validator.maxlength":"Sila masukkan tidak lebih dari {0} aksara","validator.minlength":"Sila masukkan sekurang-kurangnya {0} aksara","validator.phone":"Sila masukkan no telefon yang sah.","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"my-MM":{"validator.required":"ဒီနေရာမှာ ဖြည့်ဖို့ လိုအပ်ပါတယ်","validator.email":"မှန်ကန်သော အီးမေးလ်လိပ်စာထည့်သွင်းပါ","validator.number":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.digits":"နံပါတ်များသာဖြည့်ပါ","validator.maxlength":"ကျေးဇူးပြု၍ {0} ထပ်မပိုသော ဂဏန်းများသာဖြည့်ပါ","validator.minlength":"ကျေးဇူးပြု၍ အနည်းဆုံး {0} ဂဏန်းဖြည့်ပါ","validator.phone":"မှန်ကန်သော ဖုန်းနံပါတ်ထည့်သွင်းပါ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"km-KH":{"validator.required":"ព័ត៌មានចាំបាច់ដែលត្រូវបំពេញ","validator.email":"សូមវាយអាសយដ្ឋានអ៊ីម៉ែលឲ្យបានត្រឹមត្រូវ","validator.number":"សូមវាយបញ្ចូលលេខឲ្យបានត្រឹមត្រូវ","validator.digits":"វាយបញ្ចូលបានតែលេខប៉ុណ្ណោះ","validator.maxlength":"សូមវាយបញ្ចូលកុំឲ្យលើស {0} តួអក្សរ","validator.minlength":"សូមវាយបញ្ចូលតិចបំផុត {0} តួអក្ស","validator.phone":"សូមវាយបញ្ចូលលេខឲ្យបានត្រឹមត្រូវ","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"zh-TW":{"validator.required":"此為必填欄位","validator.email":"請填入有效的 email 地址","validator.number":"請填入有效的電話號碼","validator.digits":"此欄位僅能輸入數字","validator.maxlength":"請輸入少於 {0} 位數","validator.minlength":"請輸入至少 {0} 位數","validator.phone":"請填入有效的電話號碼","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"th-TH":{"validator.required":"ต้องระบุข้อมูลในช่องนี้","validator.email":"กรุณาใส่อีเมล์ที่ถูกต้อง","validator.number":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.digits":"กรุณาส่เฉพาะตัวเลข","validator.maxlength":"กรุณาใส่ตัวเลขมากกว่า {0} หลัก","validator.minlength":"กรุณาใส่ตัวเลขอย่างน้อย {0} หลัก","validator.phone":"กรุณาใส่ตัวเลขที่ถูกต้อง","validator.emailUsed":"Email already in use for this campaign.","validator.phoneUsed":"Your phone number already in use for this campaign.","lead.otp.title":"Enter OTP","lead.otp.desc":"We have sent an OTP to your mobile number {phone}","lead.otp.verify":"Verify","lead.otp.resend":"Resend OTP{timer}"},"tl-PH":Y},G=e=>{const t=z[e];return t||z["en-PH"]},K=l({}),Q=e=>{const[t,a]=n(16),[l,i]=n(9),[r,s]=n(!1);return o((()=>{if(s(!1),e){const t=new Image;t.addEventListener("load",(()=>{a(t.naturalWidth),i(t.naturalHeight),s(!0)})),t.addEventListener("error",(()=>{a(16),i(9),s(!0)})),t.src=e}else a(16),i(9),s(!0)}),[e]),{loaded:r,width:t,height:l}},X=({onClose:e,containerClassName:t,svgClassName:l})=>a.createElement("button",{onClick:e,className:`le-newbuilder-close-button js-modal__close ${t||""}`},a.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",className:l},a.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"white"}),a.createElement("path",{d:"M16 17.05L10.925 22.125C10.7917 22.2584 10.621 22.329 10.413 22.337C10.2044 22.3457 10.025 22.275 9.87502 22.125C9.72502 21.975 9.65002 21.8 9.65002 21.6C9.65002 21.4 9.72502 21.225 9.87502 21.075L14.95 16L9.87502 10.925C9.74169 10.7917 9.67102 10.6207 9.66302 10.412C9.65436 10.204 9.72502 10.025 9.87502 9.87502C10.025 9.72502 10.2 9.65002 10.4 9.65002C10.6 9.65002 10.775 9.72502 10.925 9.87502L16 14.95L21.075 9.87502C21.2084 9.74169 21.3794 9.67069 21.588 9.66202C21.796 9.65402 21.975 9.72502 22.125 9.87502C22.275 10.025 22.35 10.2 22.35 10.4C22.35 10.6 22.275 10.775 22.125 10.925L17.05 16L22.125 21.075C22.2584 21.2084 22.329 21.379 22.337 21.587C22.3457 21.7957 22.275 21.975 22.125 22.125C21.975 22.275 21.8 22.35 21.6 22.35C21.4 22.35 21.225 22.275 21.075 22.125L16 17.05Z",fill:"#595959"}))),Z=({popupId:e,url:t,newTab:l,imageDestkop:n,imageMobile:o,onClose:i,onOtherSubmit:r})=>{const{width:s,height:d,loaded:c}=Q(o),{width:m,height:u,loaded:p}=Q(n);return c&&p?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"center_tab"},a.createElement("div",{className:"le-center-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{className:"js-popup-other-submit",href:t,target:l?"blank":"_parent",onClick:r},a.createElement("img",{className:"le-only-mobile",src:o,style:{aspectRatio:`${s}/${d}`}}),a.createElement("img",{className:"le-only-desktop",src:n,style:{aspectRatio:`${m}/${u}`}})),a.createElement(X,{onClose:i,containerClassName:"close-button-top-right"})))):null},ee=({popupId:e,url:t,title:l,urlText:n,titleAlign:o,subtitle:i,subtitleAlign:r,newTab:s,imageDesktop:d,imageMobile:c,onClose:m,onOtherSubmit:u})=>{const{width:p,height:h,loaded:g}=Q(c),{width:v,height:b,loaded:y}=Q(d);return g&&y?a.createElement("div",{id:e,className:"lead-modal-wrapper lead-floating-wrapper","data-popup-url":location.pathname,"data-popup-type":"floating"},a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-floating-desktop"},a.createElement("div",{className:"le-floating-desktop-wrap",style:{position:"relative",background:"#fff"}},d?a.createElement("div",null,a.createElement("img",{style:{maxWidth:120,borderTopLeftRadius:5,borderBottomLeftRadius:5,aspectRatio:`${v}/${b}`},src:d})):null,a.createElement("div",{style:{padding:20}},a.createElement("div",{className:`le-floating-desktop-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-desktop-desc le-text-align-${r}`},i)),a.createElement("a",{target:s?"blank":"_parent",style:{marginLeft:35,textDecoration:"none"},href:t},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n)),a.createElement(X,{onClose:m,containerClassName:"close-button-top-right"})))),a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-floating-mobile"},a.createElement("div",{className:"le-floating-mobile-wrap",style:{position:"relative",background:"#fff"}},a.createElement("aside",{style:{display:"flex",justifyContent:"space-between"}},a.createElement("div",null,a.createElement("div",{className:`le-floating-mobile-title le-text-align-${o}`},l),a.createElement("div",{className:`le-floating-mobile-desc le-text-align-${r}`},i)),c?a.createElement("div",null,a.createElement("img",{style:{marginLeft:15,marginTop:4,maxWidth:100,aspectRatio:`${p}/${h}`},src:c})):null),a.createElement("div",{style:{textAlign:"center",marginTop:10}},a.createElement("a",{target:s?"blank":"_parent",href:t,style:{textDecoration:"none"}},a.createElement("button",{className:"le-joinbow-floating-btn js-popup-other-submit",onClick:u},n))),a.createElement(X,{onClose:m,containerClassName:"close-button-top-right"}))))):null};const te=new class{constructor(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},ae={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${te.apiLeadUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},le={call(t){var{url:a,data:l}=t,n=e(t,["url","data"]);return n.body=JSON.stringify(l),n.headers={"Content-Type":"application/json"},fetch(`${te.apiSubotUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},ne=({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),le.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},oe=({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),ae.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},ie=({phone:e,type:t})=>ae.call({url:"phone"===t?"api/sms/otp":"api/sms/whatsapp_otp",method:"post",data:{phone_number:"phone"===t?e.replace("+",""):e}}),re=({phone:e,otp:t,type:a})=>ae.call({url:"phone"===a?"api/sms/verify":"api/sms/whatsapp_verify",method:"post",data:{otp_code:t,phone_number:"phone"===a?e.replace("+",""):e}}),se="undefined"==typeof window,de={VN:"vi",ID:"id",TH:"th",MY:"ms",TW:"zh-TW",KH:"km",MM:"my",IN:"hi",PH:"en"},ce=(e="",a="",l="",i=500)=>{const[r,s]=n([]),[d,c]=n(!1);return o((()=>{let n;return e?n=window.setTimeout((()=>t(void 0,void 0,void 0,(function*(){var n;if(e)try{c(!0);const o=yield((e="",a="",l="vi")=>t(void 0,void 0,void 0,(function*(){return new Promise(((t,n)=>{if(!e)return n("Need valid text input");if(se)return n("Need valid window object");try{(new window.google.maps.places.AutocompleteService).getPlacePredictions(Object.assign(Object.assign({input:e},a?{componentRestrictions:{country:a}}:{}),{language:de[l]}),t)}catch(e){n(e)}}))})))(e,a,l);s(!(n=o)||n.length<1?[]:n.map((e=>({placeId:e.place_id,description:e.description}))))}catch(e){console.error(e)}finally{c(!1)}else s([])}))),i):r.length&&s([]),()=>{window.clearTimeout(n)}}),[e,i,a]),{isLoading:d,predictions:r}},me={email:{},phone:{}},ue=(e,a,l)=>t(void 0,void 0,void 0,(function*(){const n="email"in l?"email":"phone",o="email"in l?l.email:l.phone,i="email"in l?"validator.emailUsed":"validator.phoneUsed";if(me[n][o]){if(me[n][o].value)return i;if(!me[n][o].value&&me[n][o].expire>Date.now())return""}const r=yield((e,a,l)=>t(void 0,void 0,void 0,(function*(){const t="email"in l?"email":"phone",n="email"in l?l.email:l.phone,o="email"in l?"validator.emailUsed":"validator.phoneUsed",i=yield oe({campaign_id:[e],[t]:n});return"SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode||a.length&&"CheckSuBotLeadTool_ERR_001"===(yield ne({bot_id:a,[t]:n}))._errorCode?o:void 0})))(e,a,l);return me[n][o]=r?{value:!0}:{value:!1,expire:Date.now()+6e4},r})),[pe,he,ge]=j(),ve=["places"],be=({name:e,placeholder:t,locale:l})=>{var s;const d=he(),[c,m]=n(""),[u,p]=n(""),{predictions:h}=ce(c,"","tl-PH"===l?"en":null===(s=null==l?void 0:l.split("-"))||void 0===s?void 0:s[0]),[g,v]=n(null),[b,y]=n(!1),k=r(Math.random().toString(36).substring(7)),_=i((()=>{const e=h.map((e=>({value:e.description,label:e.description}))),t=e.find((e=>e.value===u));return!u||t?e:[{value:u,label:u}].concat(e)}),[h,u]);return o((()=>{var e,t,a;(null===(a=null===(t=null===(e=null===window||void 0===window?void 0:window.google)||void 0===e?void 0:e.maps)||void 0===t?void 0:t.places)||void 0===a?void 0:a.AutocompleteService)?y(!0):import("@react-google-maps/api").then((e=>{v((()=>e.LoadScript)),setTimeout((()=>{y(!0)}),200)}))}),[]),b?a.createElement(a.Fragment,null,g&&a.createElement(g,{googleMapsApiKey:"AIzaSyD9AbNa4AFwr8eNVs90G1YhQLhfWJ6KncU",libraries:ve,loadingElement:a.createElement(a.Fragment,null)}),a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":e,"data-control":"text"}),a.createElement(f,Object.assign({className:"lead-modal__form-control",label:t,placeholder:t,withAsterisk:!0,name:e,data:_,searchValue:c,onSearchChange:e=>{m(e)},filter:()=>!0,clearable:!0,searchable:!0,onChange:e=>p(e||""),icon:a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},a.createElement("path",{d:"M9.99999 9.79167C10.4028 9.79167 10.7467 9.64944 11.0317 9.365C11.3161 9.08 11.4583 8.73611 11.4583 8.33333C11.4583 7.93056 11.3161 7.58667 11.0317 7.30167C10.7467 7.01722 10.4028 6.875 9.99999 6.875C9.59721 6.875 9.25332 7.01722 8.96832 7.30167C8.68388 7.58667 8.54166 7.93056 8.54166 8.33333C8.54166 8.73611 8.68388 9.08 8.96832 9.365C9.25332 9.64944 9.59721 9.79167 9.99999 9.79167ZM9.99999 17.875C9.90277 17.875 9.80555 17.8611 9.70832 17.8333C9.6111 17.8056 9.52082 17.7569 9.43749 17.6875C7.46527 15.8958 5.98971 14.2361 5.01082 12.7083C4.03138 11.1806 3.54166 9.77778 3.54166 8.5C3.54166 6.48611 4.1911 4.87833 5.48999 3.67667C6.78832 2.47556 8.29166 1.875 9.99999 1.875C11.7083 1.875 13.2119 2.47556 14.5108 3.67667C15.8092 4.87833 16.4583 6.48611 16.4583 8.5C16.4583 9.77778 15.9689 11.1806 14.99 12.7083C14.0105 14.2361 12.5347 15.8958 10.5625 17.6875C10.4792 17.7569 10.3889 17.8056 10.2917 17.8333C10.1944 17.8611 10.0972 17.875 9.99999 17.875Z",fill:"#8C8C8C"})),autoComplete:"no-auto-complete-"+k.current,rightSection:a.createElement(a.Fragment,null)},d.getInputProps(e)))):a.createElement("div",{style:{height:73}})},ye=({children:e,align:t})=>a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${W}`},e),fe=({children:e,align:t})=>a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${W}`},e),ke=({listBlockAdded:e,popupId:t,locale:l,onClose:n,onOtherSubmit:o})=>{const i=he();return a.createElement(a.Fragment,null,e.map(((e,r)=>{const{name:s="",data:d={}}=e||{},{placeholder:c,value:u,align:p,listQuestion:h,isSendMailChimp:g=!1,newtab:v,url:b}=d;switch(s){case"TitleBlock":return a.createElement(fe,{key:r,align:p},u);case"SubtitleBlock":return a.createElement(ye,{key:r,align:p},u);case"TextBlock":return a.createElement(_,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"text",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"text",name:u},i.getInputProps(u)));case"NumberBlock":return a.createElement(C,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,type:"number",placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"number",name:u},i.getInputProps(u)));case"EmailBlock":return a.createElement(_,Object.assign({key:r,withAsterisk:!0,spellCheck:!1,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"email",name:u},i.getInputProps(u)));case"PhoneOtpBlock":case"WhatsappOtpBlock":case"PhoneBlock":{const e=t+"-"+u+"-"+r;return a.createElement(_.Wrapper,Object.assign({size:"md",withAsterisk:!0,key:r,label:c,className:"lead-modal__form-control",labelProps:{htmlFor:e}},i.getInputProps(u)),a.createElement(w,{name:u,spellCheck:!1,type:"tel",placeholder:c,onChange:e=>{i.setFieldValue(u,e)},id:e,defaultCountry:l&&B[l]||"VN","data-control":"tel"}))}case"LocationBlock":return a.createElement(be,{key:r,name:u,placeholder:c,locale:l});case"DateBlock":return a.createElement(a.Fragment,null,a.createElement(S,Object.assign({withAsterisk:!0,key:r,type:"default",name:u,placeholder:c,className:"lead-modal__form-control",label:c,"data-control":"date"},i.getInputProps(u))),a.createElement("input",{type:"hidden",name:u,"data-control":"date"}));case"LinkButtonBlock":return a.createElement("div",{key:r},a.createElement("a",{target:v?"blank":"parrent",href:b,style:{textDecoration:"none"}},a.createElement(m,{type:"button",size:"md",className:`lead-modal__btn ${W}`,onClick:()=>{null==n||n(),null==o||o()}},u)));case"CheckboxBlock":return a.createElement(a.Fragment,null,g&&a.createElement("div",{style:{display:"none"},"data-name":u+"-mailchimp"}),a.createElement(k.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md",sx:{display:"flex",flexDirection:"column",gap:8}},i.getInputProps(u)),h.map(((e,t)=>a.createElement(k,{name:u,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})))));case"RadioBlock":return a.createElement(a.Fragment,null,g&&a.createElement(_,{type:"hidden",name:u+"-mailchimp",value:g}),a.createElement(E.Group,Object.assign({withAsterisk:!0,className:"lead-modal__form-control",key:r,label:c,size:"md"},i.getInputProps(u)),h.map(((e,t)=>a.createElement(E,{name:u,key:t,value:e.value,label:e.placeholder,"data-control":"radio"})))));case"DropdownBlock":return a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"none"},"data-extra":!0,"data-name":u,"data-control":"dropdown"}),a.createElement(f,Object.assign({key:r,className:"lead-modal__form-control",label:c,withAsterisk:!0,name:u,data:h.map((e=>({value:e.value,label:e.placeholder})))},i.getInputProps(u))));case"TncBlock":const s=i.getInputProps("TNC-"+e.id);return a.createElement(a.Fragment,null,a.createElement(k,Object.assign({name:"TNC-"+e.id,key:e.id,label:a.createElement("p",{className:"lead-modal__tnc-link",dangerouslySetInnerHTML:{__html:d.valueHTML}}),className:"tnc-block","data-control":"checkbox"},s,{error:s.error?a.createElement(a.Fragment,null):void 0})))}return null})))},_e=({otpData:e,onSuccess:l,autoSendWhenOpen:i})=>{const{t:s}=L(),d=e.phone,c=e.type,[u,p]=n(""),[h,g]=n(!1),[v,f]=n(i?0:60),k=r(null),[E,w]=n(),[C,N]=n(""),T=r(),[S,x]=n(!1);o((()=>{t(void 0,void 0,void 0,(function*(){var e;if(!T.current){const e=yield import("react-phone-number-input");T.current=e.formatPhoneNumberIntl}N((null===(e=T.current)||void 0===e?void 0:e.call(T,d))||d)}))}),[d]);const P=()=>t(void 0,void 0,void 0,(function*(){var e;if(!d)return;const t=yield ie({phone:d,type:c}),a=null===(e=null==t?void 0:t._messages)||void 0===e?void 0:e[0];"Send sms successfully"===a||"Send WhatsApp successfully"===a?(f(60),setTimeout((()=>{k.current&&(k.current.focus(),k.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===a?l():w(a||"Something went wrong!")}));return o((()=>{setTimeout((()=>{v>0&&f((e=>e-1))}),1e3)}),[v]),o((()=>{i&&!v&&P()}),[]),a.createElement(a.Fragment,null,a.createElement("form",{onSubmit:e=>{e.preventDefault(),t(void 0,void 0,void 0,(function*(){if(!d||!u)return;x(!0);const e=yield re({phone:d,otp:u,type:c}),t=null==e?void 0:e._messages[0];"Verify successfully"===t||"Verify WhatsApp OTP sucess"===t||"This phone number was verified"===t?l():w(t||"something Wrong"),x(!1)}))},className:"lead-phone-otp-form"},a.createElement(y,{tag:"h3",fontWeight:"bold",style:{marginBottom:4}},s("lead.otp.title")),a.createElement(b,{size:"p1",color:O.colors.gray600},s("lead.otp.desc",{phone:C})),a.createElement(_,{ref:k,name:"_"+name+"-otp",spellCheck:!1,type:"number",placeholder:"Enter OTP",className:"lead-modal__form-control",label:"Phone OTP","data-control":"otp",withAsterisk:!0,pattern:"[0-9]*",value:u,maxLength:6,onChange:e=>{g(!0),p(e),w(h&&!e?"OTP is required":void 0)},error:h?E:void 0}),a.createElement(m,{size:"md",color:"primary",className:`lead-modal__btn ${W}`,disabled:!u,isLoading:S},s("lead.otp.verify")),a.createElement(m,{type:"button",size:"md",color:"transparent",className:`lead-modal__btn lead-phone-otp-button ${W}`,onClick:()=>{P()},disabled:!!v},s("lead.otp.resend",{timer:v?` (${v}s)`:""}))))},Ee=({title:e,titleAlign:t,subtitle:l,subtitleAlign:n,link:o,linkNewTab:i,linkText:r,image:s})=>{const{width:d,height:c,loaded:m}=Q(s);return m?a.createElement("div",{className:"lead-modal__thank-you"},a.createElement("div",{style:{width:"100%"}},a.createElement("img",{src:s,style:{maxHeight:162,objectFit:"cover",aspectRatio:`${d}/${c}`},loading:"lazy"}),e&&a.createElement("h1",{className:`le-thankyou-title le-text-align-${t}`},e),l&&a.createElement("p",{className:`le-thankyou-subtitle le-text-align-${n}`},l),r&&a.createElement("div",null,a.createElement("a",{href:o,target:i?"_blank":"parrent",rel:"noreferrer"},a.createElement("button",{className:`lead-modal__btn ${W}`},r))))):null},we=({content:e,inlinePosition:t})=>{const a=i((()=>{if(!t)return null;const e=document.querySelectorAll(`[data-url="${location.pathname}"] .body-content`),a=Array.from(e).reduce(((e,t)=>[...e,...Array.from(t.children)]),[]);if(null==a?void 0:a.length){const e=a.filter((e=>"P"===e.nodeName)),l=a.filter((e=>"H2"===e.nodeName));let n=null;switch(t){case"1th":n=e[0];break;case"2th":n=e[1];break;case"3th":n=e[2];break;case"4th":n=e[3];break;case"5th":n=e[4];break;case"6th":n=e[5];break;case"7th":n=e[6];break;case"8th":n=e[7];break;case"9th":n=e[8];break;case"10th":n=e[9];break;case"11th":n=e[10];break;case"12th":n=e[11];break;case"lastP":n=e[e.length-1];break;case"1thH2":n=l[0];break;case"2thH2":n=l[1];break;case"3thH2":n=l[2];break;case"4thH2":n=l[3];break;case"5thH2":n=l[4];break;case"6thH2":n=l[5];break;case"7thH2":n=l[6];break;case"8thH2":n=l[7];break;case"9thH2":n=l[8];break;case"10thH2":n=l[9];break;case"lastH2":n=l[l.length-1]}if(n){if(n.parentElement.querySelector(".inline-lead-wrapper"))return n.parentElement.querySelector(".inline-lead-wrapper");{const e=document.createElement("div");return e.classList.add("inline-lead-wrapper"),n.nextElementSibling?n.parentElement.insertBefore(e,n.nextElementSibling):n.parentElement.appendChild(e),e}}}}),[t]);return t&&a?$(e,a):null},Ce=({content:e})=>{const t=i((()=>{const e=Array.from(document.querySelectorAll(".hc2-sidebar-with-ads,.page-main-col .right-col.f-right,.hhg-lead-sidebar"));return e.forEach((e=>{if(e.querySelector(".sidebar-lead-modal-wrapper"))return;const t=document.createElement("div");t.classList.add("sidebar-lead-modal-wrapper"),e.prepend(t)})),e.map((e=>e.querySelector(".sidebar-lead-modal-wrapper")))}),[]);return a.createElement(a.Fragment,null,t.map((t=>$(e,N(t,"sidebar-lead-modal-wrapper")))))},Ne=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:s,imageMobile:d,imageDesktop:c,imageOverlayMobile:p,imageOverlayDesktop:h,imageBackground:g,currentLayout:v,title:b,onSubmit:y,showThankyou:f,campaignId:k,campaign_subot_id:_,locale:E})=>{var w,C,N;const T=JSON.parse(t.listBlockAdded),S=JSON.parse(t.actionBlocks),x=JSON.parse(t.textBlocks),O=S.submitBlock.data.url,P=S.submitBlock.data.text,B=S.submitBlock.data.text2,j=S.submitBlock.data.value,$=location.pathname,A=v.includes("Inline")||"Sidebar"===v,I="Slider"===v,[D,U]=n(!0),[H,R]=n(null),[M,F]=n(!1),V=r(),J=()=>{H?R(null):null==l||l()};if(window.innerWidth<769&&["Fullscreen","Slider"].includes(v))return console.log("😎 Not show fullscreen, slider on mobile "),null;o((()=>{(v.includes("LightBox")||"Fullscreen"==v)&&document.body.classList.add("noscroll"),window.intlTelInputUtils||require("intl-tel-input/build/js/utils"),me.email={},me.phone={}}),[]);const Y=r(!1),z=r(!1),{form:G,validateObj:K}=(({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:n=[]})=>{const{t:o}=L(),s=i((()=>{const i=["TextBlock","NumberBlock","EmailBlock","PhoneBlock","DateBlock","CheckboxBlock","RadioBlock","DropdownBlock","PhoneOtpBlock","WhatsappOtpBlock","LocationBlock","TncBlock"],r=(e,t)=>a=>{if(c.current.isTouched(e))return void 0===a||""===a||Array.isArray(a)&&0===a.length?o("validator.required"):null==t?void 0:t(a)};return e.filter((e=>i.includes(e.name))).reduce(((e,i)=>"NumberBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(isNaN(Number(e)))return o("validator.number")}))}):"EmailBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return o("validator.email");a.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),ue(l,n,{email:e}).then((e=>{e?c.current.setFieldError(i.data.value,o(e)):c.current.clearFieldError(i.data.value),a.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(i.data.value,e.message||"Something went wrong"),a.current=!1}))}),200)}))}):"PhoneBlock"===i.name||"PhoneOtpBlock"===i.name||"WhatsappOtpBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(window.intlTelInputUtils&&!window.intlTelInputUtils.isValidNumber(String(e),q.countryCode))return o("validator.phone");t.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),ue(l,n,{phone:e}).then((e=>{e?c.current.setFieldError(i.data.value,o(e)):c.current.clearFieldError(i.data.value),t.current=!1})).catch((e=>{console.error(e),c.current.setFieldError(i.data.value,e.message||"Something went wrong"),t.current=!1}))}),200)}))}):"DateBlock"===i.name?Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value,(e=>{if(isNaN(Date.parse(e)))return o("validator.date")}))}):"TncBlock"===i.name?Object.assign(Object.assign({},e),{["TNC-"+i.id]:r("TNC-"+i.id)}):Object.assign(Object.assign({},e),{[i.data.value]:r(i.data.value)})),{})}),[e.map((e=>e.name)).join(",")]),d=ge({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:s}),c=r(d);return c.current=d,{form:d,validateObj:s}})({listBlockAdded:T,validatingPhoneRef:Y,validatingEmailRef:z,campaignId:k,campaign_subot_id:_}),{width:Z,height:ee,loaded:te}=Q(g),{width:ae,height:le,loaded:ne}=Q(d),{width:oe,height:re,loaded:se}=Q(c),de=ne&&se&&("Fullscreen"!=v||te),ce=a.createElement(a.Fragment,null,a.createElement("style",{dangerouslySetInnerHTML:{__html:`\n .le-newbuilder-overlay {\n background-repeat: no-repeat;\n background-size: cover;\n }\n ${p?`\n .le-newbuilder-overlay {\n background: url(${p}) ;\n }`:""}\n ${h?`\n @media screen and (min-width:768px) {\n .le-newbuilder-overlay {\n background: url(${h}) ;\n }\n }`:""}`}}),a.createElement("div",{id:e,"data-popup-url":$,"data-popup-type":"lightbox-inline",className:`lead-modal lead-modal-wrapper modal--animate-scale ${A?"le-buider-inline":""} ${I?"le-buider-slider":""}`},"Fullscreen"==v?a.createElement("img",{className:"le-only-desktop le-fullscreen-img",draggable:!1,src:g||"",style:{aspectRatio:`${Z}/${ee}`}}):null,a.createElement("div",{className:`lead-modal__wrapper le-newbuilder-wrap-${v}`},a.createElement("div",{className:`lead-modal__content le-newbuilder-${v}`},f?a.createElement(Ee,{title:f.title,titleAlign:f.titleAlign,subtitle:f.subtitle,subtitleAlign:f.subtitleAlign,link:f.link,linkNewTab:f.linkNewTab,linkText:f.linkText,image:f.image}):a.createElement(a.Fragment,null,a.createElement("header",{className:"lead-modal__header"},H?a.createElement("img",{src:u.getAssetPath("lead-otp-thumb.png"),draggable:"false",alt:"",style:{width:"100%",minHeight:"150px",backgroundColor:"#f2f2f2"},loading:"lazy"}):a.createElement(a.Fragment,null,["LightBoxA","InlineA","Sidebar","Slider"].includes(v)?d?a.createElement("img",{draggable:"false",className:"lead-modal__image lead-modal-image-cover",src:d,style:{aspectRatio:`${ae}/${le}`},alt:""}):null:a.createElement(a.Fragment,null,c?a.createElement("img",{draggable:"false",className:"le-only-desktop lead-modal__image lead-modal-image-cover",style:{objectFit:"cover",aspectRatio:`${oe}/${re}`},src:c,alt:""}):null,d?a.createElement("img",{draggable:"false",className:"le-only-mobile lead-modal__image lead-modal-image-cover",src:d,alt:"",style:{aspectRatio:`${ae}/${le}`}}):null))),H&&a.createElement(_e,{otpData:H,autoSendWhenOpen:!1,onSuccess:()=>{R(null),null==y||y(V.current,G.values)}}),a.createElement("div",{"data-hidden":!!H,className:"lead-modal__body le-newbuilder-overlay"},a.createElement(pe,{form:G},a.createElement("form",{ref:V,className:`lead-modal__form ${e}`,onSubmit:e=>{e.preventDefault(),G.setTouched(Object.keys(K).reduce(((e,t)=>(e[t]=!0,e)),{})),z.current||Y.current||setTimeout((()=>{G.onSubmit((e=>{var t,a,l,n,o,i;if(Object.keys(G.errors).length)return;let r=null;if(T.findIndex((e=>"PhoneOtpBlock"===e.name))>-1){const n=null===(a=null===(t=T.find((e=>"PhoneOtpBlock"===e.name)))||void 0===t?void 0:t.data)||void 0===a?void 0:a.value;(null===(l=e[n])||void 0===l?void 0:l.startsWith("+"))&&(r={phone:e[n],type:"phone"})}if(T.findIndex((e=>"WhatsappOtpBlock"===e.name))>-1){const t=null===(o=null===(n=T.find((e=>"WhatsappOtpBlock"===e.name)))||void 0===n?void 0:n.data)||void 0===o?void 0:o.value;(null===(i=e[t])||void 0===i?void 0:i.startsWith("+"))&&(r={phone:e[t],type:"whatsapp"})}if(r)return F(!0),void ie(r).then((t=>{var a;"This phone number was verified"!==(null===(a=null==t?void 0:t._messages)||void 0===a?void 0:a[0])?R(r):null==y||y(V.current,e)})).finally((()=>{F(!1)}));null==y||y(V.current,e)}))(e)}),100)}},a.createElement("div",{style:{marginBottom:20}},a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(null===(w=x.titleBlock.data)||void 0===w?void 0:w.align)} ${W}`},b),a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(null===(C=x.titleBlock.data)||void 0===C?void 0:C.align)} ${W}`},x.subtitleBlock.data.value)),a.createElement("div",{className:"lead-modal__form-control-wrapper"},a.createElement(ke,{listBlockAdded:T,popupId:e,locale:E,onClose:J,onOtherSubmit:s})),(null===(N=null==S?void 0:S.submitBlock)||void 0===N?void 0:N.isHide)?null:a.createElement(a.Fragment,null,a.createElement("div",{className:`lead-modal__checkbox-wrapper ${W}`},a.createElement("div",{className:"lead-modal__checkbox"},a.createElement("input",{id:"lead-term-checkbox",className:`lead-modal__checkbox__input ${W}`,type:"checkbox","aria-label":"Checkbox label",checked:D,onChange:e=>U(e.currentTarget.checked)}),a.createElement("div",{className:"lead-modal__checkbox__control","aria-hidden":"true"})),a.createElement("label",{htmlFor:"checkbox",className:"lead-modal__checkbox__label"},P," ",a.createElement("span",{style:{fontWeight:"bold"}},a.createElement("a",{target:"blank",href:O||"https://hellobacsi.com/chinh-sach",rel:"noopener noreferrer",style:{textDecoration:"none"}},B)))),a.createElement(m,{size:"md",id:"lead-submit",type:"submit",className:`lead-modal__btn ${W}`,disabled:!D,isLoading:M},j))))))),!v.includes("Inline")&&a.createElement(X,{onClose:J,containerClassName:"close-button-top-right"}))));return de?v.includes("LightBox")||"Fullscreen"==v||"Slider"==v?ce:"Sidebar"==v?a.createElement(Ce,{content:ce}):v.includes("Inline")?a.createElement(we,{content:ce,inlinePosition:t.popupInlinePosition}):null:null},Te=({popupId:e,link:t,linkText:l,linkNewTab:n,onClose:o,imageMobile:i,imageDesktop:r,currentLayout:s,onOtherSubmit:d})=>{const c=location.pathname,{width:m,height:u,loaded:p}=Q(i),{width:h,height:g,loaded:v}=Q(r);return p&&v?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":c,"data-popup-type":"skin_ab"},"SkinA"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:"le-skin-a-desktop"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:r,style:{aspectRatio:`${h}/${g}`}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn js-popup-other-submit"},l)),a.createElement(X,{onClose:o,containerClassName:"close-button-top-right"})))):"SkinB"==s?a.createElement("aside",{className:"le-only-desktop"},a.createElement("div",{className:""},a.createElement("div",{style:{position:"relative",zIndex:1e4}},a.createElement("img",{src:r,style:{width:"100%",aspectRatio:`${h}/${g}`}}),a.createElement("a",{style:{position:"absolute",top:"75%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",width:"100%"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(X,{containerClassName:"close-button-top-right",onClose:o})))):null,a.createElement("aside",{className:"le-only-mobile"},a.createElement("div",{className:"le-skin-mobile"},a.createElement("div",{style:{position:"relative"}},a.createElement("img",{src:i,style:{width:"100%",aspectRatio:`${m}/${u}`}}),a.createElement("a",{style:{position:"absolute",top:"82%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center",maxWidth:"calc(100% - 15px)"},href:t,target:n?"blank":"_parent"},a.createElement("button",{onClick:d,className:"le-joinbow-btn-mobile js-popup-other-submit"},l)),a.createElement(X,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:o}))))):null},Se=({popupId:e,url:t,newTab:l,image:n,onClose:o,onOtherSubmit:i})=>{const{width:r,height:s,loaded:d}=Q(n);return d?a.createElement("div",{id:e,className:"lead-modal-wrapper","data-popup-url":location.pathname,"data-popup-type":"tab"},a.createElement("div",{className:"le-tab-popup"},a.createElement("div",{style:{position:"relative"}},a.createElement("a",{href:t,target:l?"blank":"_parent",onClick:i},a.createElement("img",{className:"js-popup-other-submit",src:n,style:{aspectRatio:`${r}/${s}`}})),a.createElement(X,{onClose:o,containerClassName:"close-button-top-right"})))):null},xe=[],Oe=[],Pe=[],Be=[],je=[],Le=[];const $e=(e="UTC")=>{const t=new Date;return new Date(t.toLocaleString("en-US",{timeZone:e}))},Ae=e=>{try{const[t,a]=e.split(" "),[l,n,o]=t.split("-").map(Number),[i,r,s]=a.split(":").map(Number);return new Date(l,n-1,o,i,r,s)}catch(e){return null}};const Ie=e=>!function(e){var t;const a=Number(null===(t=e.rules.find((e=>"exclude_sponsored"==e.rule)))||void 0===t?void 0:t.value);return!(!Boolean(document.querySelector(".hhg-disclaimer-text"))||!a||(Be.push(e),0))}(e)&&(!!function(e){var t,a;try{const l=null===(t=e.rules.find((e=>"exclude_sponsored_list"==e.rule)))||void 0===t?void 0:t.value,n=l instanceof Array?l:JSON.parse(l),o=Number(null===(a=document.querySelector("[data-sponsored-id]"))||void 0===a?void 0:a.getAttribute("data-sponsored-id"));return!o||o<=0||0===n.length||(!!n.find((e=>e.id==o))||(je.push({id:e.id,rules:e.rules}),!1))}catch(e){return!0}}(e)&&(1===e.formatted_status?function(e){var t;if(1===e.forever)return!0;const a=e.started_at,l=e.ended_at,n=Ae(a),o=Ae(l);if(!n||!o)return!0;const i=(null===(t=e.site)||void 0===t?void 0:t.id)||1;return!($e(J[i]).getTime()>o.getTime()&&(Pe.push(e),1))}(e):0===e.formatted_status&&(xe.push(e),(e=>{var t;const a=(null===(t=e.site)||void 0===t?void 0:t.id)||1,l=e.started_at,n=e.ended_at,o=Ae(l),i=Ae(n);if(!o||!i)return!1;const r=$e(J[a]).getTime();return r<=i.getTime()&&r>=o.getTime()&&(Oe.push(e),!0)})(e)))),De=e=>{var t;try{const a=(e,t,a)=>{const l=t.split(":"),n=a.split(":"),o=new Date;o.setHours(Number(l[0]),Number(l[1]),0,0);const i=new Date;return i.setHours(Number(n[0]),Number(n[1]),0,0),e>=o&&e<=i},l=null===(t=e.rules.find((e=>"appearance_time"==e.rule)))||void 0===t?void 0:t.value,n=l.startTime,o=l.endTime||"23:59";return!n||(!!a(new Date,n,o)||(Le.push(e),!1))}catch(e){return!0}};let Ue=null;function He({leadApi:e,leadSiteId:t,leadDomain:a,onShowPopup:l,DEBUG_URL:n}){const o=n||("https://"+location.hostname+location.pathname+location.search).toLowerCase();fetch(e+"api/campaign/"+t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:o,ga_client_id:A("_ga")||null})}).then((e=>e.json())).then((e=>{var t,n,i,r;if(Re("List campagin: ",e),F="https://"+location.hostname+location.pathname+location.search,1==e._status){const s=((null===(n=null===(t=e._data)||void 0===t?void 0:t.campaigns)||void 0===n?void 0:n.filter(Ie))||[]).filter(De);A("hhg-id")||(I("hhg-id",c(),{domain:"."+a,path:"/"}),Re("😍 Set HHG ID cookie"));let d=[];d=/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)?s.filter((e=>e.device_types.some((e=>e.id==R)))):s.filter((e=>e.device_types.some((e=>e.id==M)))),Re("👓 campaignsDevice",d),Re("--listCampaignScheduled",xe),Re("--listCampaignScheduledToActivated",Oe),Re("--listCampaignActiveButExpired",Pe),Re("--listCampaignExcludeSonsored",Be),Re("--listCampaignDifferentSponsor",je),Re("--listCampaignNotDisplayInRangeOfTime",Le);let m=d.map(((e,t)=>e.targets.filter((e=>e.type==D)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1);m=m.filter((e=>{var t;const a=new URL(String(e.target).toLowerCase());if("exact_match"==e.option)return Boolean(o===(null===(t=a.href)||void 0===t?void 0:t.toLowerCase()));if("start_with"==e.option){if(o.includes(String(e.target).toLowerCase())){const t=e.sub_target.filter((e=>"excluding"==e.option)).map((e=>{var t;return null===(t=e.value)||void 0===t?void 0:t.toLowerCase()}));return!t.includes(o.split("?")[0])}return!1}}));const u=Array.from(document.getElementsByTagName("META")).filter((e=>"article:tag"==e.getAttribute("property"))).map((e=>e.content));let p=[],h=[];u&&u.length&&(p=d.map(((e,t)=>e.targets.filter((e=>e.type==U)).map((e=>Object.assign(Object.assign({},e),{campaignIndex:t}))))).flat(1),h=p.filter((e=>u.includes(e.target))));const g=[...m,...h],v=document.cookie.split("; ").map((e=>e.split("=")[0])),b=v.filter((e=>e.includes("lead_submited")));Re("--listCampaignCodeSubmited",b);const y=v.filter((e=>e.includes("lead_closed")));Re("--listCampaignCodeClosed",y);const f=[...b,...y],k=(e=>{const t=[...e];for(let e=t.length-1;e>0;e--){const a=Math.floor(Math.random()*(e+1)),l=t[e];t[e]=t[a],t[a]=l}return t})(g.filter((e=>!f.some((t=>t.includes(d[e.campaignIndex].code))))));if(Re("--listCampaignValid : ",k),k&&k.length){const e=d[k[0].campaignIndex];Re("CAMPAIGN_SHOW",e);const{rules:t}=e,a=Number(null===(i=t.find((e=>"time"==e.rule)))||void 0===i?void 0:i.value);Re("timeoutRule",a);const n=Number(null===(r=t.find((e=>"scroll"==e.rule)))||void 0===r?void 0:r.value);Re("scrollRule",n);let o="TIME";if(Number.isInteger(a)&&(o="TIME",Re("✨ SHOW AWESOME POPUP AFTER: ",a," seconds"),Ue&&clearTimeout(Ue),Ue=setTimeout((()=>{null==l||l(e,o)}),1e3*a)),Number.isInteger(n)){o="SCROLL",Re("✨ SHOW AWESOME AFTER: SCROLL",n," %");const t=document.querySelector(`[data-url="${location.pathname}"]`)||document.querySelector("body"),a=t.getBoundingClientRect().top,i=t.offsetHeight;Re("👓 Element check scroll: ",t);const r=function(){const t=window.pageYOffset||document.documentElement.scrollTop;let s=0;t>=a&&(s=Math.round((t-a)/(i-innerHeight)*100)),Re("---Scroll",s,n),s>=n&&(window.removeEventListener("scroll",r),null==l||l(e,o))};window.addEventListener("scroll",r,{passive:!0})}}else Re("🚧 No lead campaigns on current URL, tags")}})).catch((e=>{Re("Lead error: ",e)}))}const Re=(...e)=>{("production"!==process.env.NODE_ENV||process.env.NEXT_PUBLIC_DEPLOY_ENV&&"production"!==process.env.NEXT_PUBLIC_DEPLOY_ENV||"undefined"!=typeof localStorage&&"true"===localStorage.getItem("hhg_debug"))&&console.log(...e)};const Me=({campaign:e,action:t,onSubmit:l,onClose:n,showThankyou:i,locale:d})=>{var m,u;const{apiUrl:p,siteDomain:h}=s(K);o((()=>{const e=A("_ga")||null;fetch(`${p}api/campaign/${y}/impression`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,url:location.href.toLowerCase(),title_article:document.title,cookie_id:A("hhg-id"),ga_client_id:e})})}),[]);const{extra_fields:g,image:v,image_desktop:b,code:y,image_background:f,image_overlay_mobile:k,image_overlay_desktop:_}=e||{},{currentLayout:E}=g,w=g.imageBlocks?JSON.parse(g.imageBlocks):{},C=JSON.parse(g.actionBlocks),N=JSON.parse(g.textBlocks);let T=(null===(u=null===(m=null==N?void 0:N.titleBlock)||void 0===m?void 0:m.data)||void 0===u?void 0:u.value)||"";const S={1:{},2:{},3:{}},x=r("lead-modal-"+c()),O=function(e="Xin chao {{category_2}} extra"){if(e.includes("{{category_")){const t=11,a=e.search("{{category_");return+e.charAt(t+a)}return null}(T);if(O){Re("⚡️ Has categoryLevel",O);const e=Array.from(document.getElementsByTagName("META")),t=e.find((e=>e.name===`content_category_${O}`)),a=e.find((e=>e.name===`content_category_en_${O}`));if(!t||!a)return Re("⚡️ No META TAG for categoryLevel, not show popup",O),null;S[O]={value:t.content,value_en:a.content},T=T.replace(`{{category_${O}}}`,t.content),Re("⚡️ Set categoryData ",O)}else Re("⚡️ No categoryLevel",O);const P=()=>{var t,a,l,o;if(Re("👌 Other submit click"),document.body.classList.remove("noscroll"),E.includes("Skin")){const e=document.querySelector("#masthead");e&&(e.style.top="0px !important;")}const i=Number(null!==(a=null===(t=e.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value)&&void 0!==a?a:7),r=Number(null!==(o=null===(l=e.rules.find((e=>"show_again_after_submit"==e.rule)))||void 0===l?void 0:l.value)&&void 0!==o?o:0);0===r&&(Re("⛔ Popup never show again!"),I(`lead_submited_${y}`,`target_${g.popupVersion}`,{domain:"."+h,path:"/"})),1==r&&(Re(`⌛ Popup will show again after ${i} days!`),I(`lead_submited_${y}`,`target_${g.popupVersion}`,{domain:"."+h,days:i,path:"/"}));const s=A("_ga")||null,d={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:A("hhg-id"),ga_client_id:s};O&&(d.category=S[O].value_en),fetch(`${p}api/campaign/${y}/lead`,{method:"POST",body:JSON.stringify(d),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then((e=>e.json())).then((e=>{"error"===e.status&&Re(e)})).catch((e=>{Re("Error:",e)})),null==n||n()};return"CenterTab"===E?a.createElement(Z,{popupId:x.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,imageMobile:v,imageDestkop:b,onClose:n,onOtherSubmit:P}):"Tab"===E?a.createElement(Se,{popupId:x.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,image:v,onClose:n,onOtherSubmit:P}):"Floating"===E?a.createElement(ee,{popupId:x.current,title:T,titleAlign:N.titleBlock.data.align,subtitle:N.subtitleBlock.data.value,subtitleAlign:N.subtitleBlock.data.align,url:C.linkButtonBlock.data.url,urlText:C.linkButtonBlock.data.value,newTab:C.linkButtonBlock.data.newtab,imageMobile:v,imageDesktop:b,onClose:n,onOtherSubmit:P}):E.includes("LightBox")||E.includes("Inline")||"Fullscreen"==E||"Sidebar"==E||"Slider"==E?a.createElement(Ne,{popupId:x.current,extraFields:g,onClose:n,onOtherSubmit:P,imageMobile:v,imageDesktop:b,imageBackground:f,currentLayout:E,title:T,onSubmit:(e,t)=>l(e,t,O,S),key:E,imageOverlayDesktop:_,imageOverlayMobile:k,showThankyou:i,campaignId:e.id,campaign_subot_id:e.bot_id||[],locale:d}):E.includes("Skin")?a.createElement(Te,{popupId:x.current,link:C.linkButtonBlock.data.url,linkNewTab:!!C.linkButtonBlock.data.newtab,linkText:C.linkButtonBlock.data.value,onClose:n,onOtherSubmit:P,imageMobile:v,imageDesktop:b,currentLayout:E}):null},We=({apiUrl:e,siteDomain:l,siteId:s,locale:c,apiSubotUrl:m,DEBUG_URL:u})=>{var b;const y=r(),f=r(Date.now()),{apiUrl:k}=i((()=>{let t=e;return t.includes("localhost")&&(t="https://dev.leadgen.hellobacsi.com/"),{apiUrl:t}}),[e,l,s]),[_,E]=n(null),[w,C]=n(""),[N,S]=n(null);o((()=>{te.apiLeadUrl=k,te.apiSubotUrl=m}),[k,m]);const O=(e,t)=>{E(e),C(t)},B=()=>{var e,t;if(!_)return;Re(`👋👋👋 CLOSE POPUP ${_.code} 👋👋👋`);const a=Number(null===(e=_.rules.find((e=>"show_again_after_exit"==e.rule)))||void 0===e?void 0:e.value),n=Number(null===(t=_.rules.find((e=>"days_to_show_again"==e.rule)))||void 0===t?void 0:t.value);0==a&&I(`lead_closed_${_.code}`,`target_${null==_?void 0:_.extra_fields.popupVersion}`,n?{domain:"."+l,days:n,path:"/"}:{domain:"."+l,path:"/"}),document.body.classList.remove("noscroll"),fetch(`${k}api/campaign/${_.code}/popup_exit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"CLICK",url:location.href.toLowerCase(),title_article:document.title,cookie_id:A("hhg-id"),duration:Math.ceil((Date.now()-f.current)/1e3)})}),E(null),S(null)};o((()=>{if(window.next){const e=d((e=>{Re("--🌻 routeChangeComplete",e,Date.now());const t=location.pathname;B(),document.querySelectorAll(`[data-popup-url="${t}"]`).length?Re("🔥 This URL page has show popup!"):(Re("--Process checkShowPopup"),He({leadApi:k,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:u})),y.current&&window.removeEventListener("scroll",y.current)}),500);window.next.router.events.on("routeChangeComplete",e)}He({leadApi:k,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:u})}),[]);const j=(e,a,n,o)=>t(void 0,void 0,void 0,(function*(){var t,i,r,s,d,c,m,u,p,h,g;if(!a)return;Re("submitHandler",n,o);const v=Object.keys(a).map((e=>({name:e,value:String(a[e])}))),b=A("_ga")||null;window.intlTelInputUtils||(yield require("intl-tel-input/build/js/utils"));const y={url:location.href.toLowerCase(),title_article:document.title,meta:v.map((t=>{var a,l;const n=(null===(a=e.querySelector(`*[name="${t.name}"][data-control]`))||void 0===a?void 0:a.getAttribute("data-control"))||(null===(l=e.querySelector(`*[data-extra][data-name="${t.name}"]`))||void 0===l?void 0:l.getAttribute("data-control"))||"text",o="tel"===n?window.intlTelInputUtils.formatNumber(String(t.value),null==q?void 0:q.countryCodeNumber,2).replace(/\s+/g,""):"date"===n?x(t.value).format("YYYY-MM-DD"):t.value;return{key:t.name,value:o,control:n}})),cookie_id:A("hhg-id"),ga_client_id:b};n&&o[n].value_en&&(y.category=o[n].value_en);const f=Number((null===(i=null===(t=_.rules)||void 0===t?void 0:t.find((e=>"days_to_show_again"===e.rule)))||void 0===i?void 0:i.value)||7),E=Number((null===(s=null===(r=_.rules)||void 0===r?void 0:r.find((e=>"show_again_after_submit"===e.rule)))||void 0===s?void 0:s.value)||0);if(0==E&&(Re("⛔ Popup never show again!"),I(`lead_submited_${_.code}`,`target_${null==_?void 0:_.extra_fields.targetType}`,{domain:"."+l,path:"/"})),1==E&&(Re(`⌛ Popup will show again after ${f} days!`),I(`lead_submited_${_.code}`,`target_${null==_?void 0:_.extra_fields.targetType}`,{domain:"."+l,days:f,path:"/"})),fetch(`${k}api/campaign/${_.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)}),"notshow"==(null==_?void 0:_.extra_fields.popupShowThankYou))return B(),void document.body.classList.remove("noscroll");let w=!0;const C=_.thank_you_image||`${k}admin/img/thanksyou.png`;let N,T,O=(null==_?void 0:_.extra_fields.popupThankyouTitle)||"Thank you.",P=(null==_?void 0:_.extra_fields.popupThankyouDesc)||"We appreciate your time!",j="",L="",$="";if("2.1"==(null==_?void 0:_.extra_fields.popupVersion)){const e=_.extra_fields,t=JSON.parse(e.listBlockThankyou),a=t.find((e=>"TitleBlock"==e.name)),l=t.find((e=>"SubtitleBlock"==e.name)),n=t.find((e=>"LinkButtonBlock"==e.name));O=(null===(d=null==a?void 0:a.data)||void 0===d?void 0:d.value)||"",j=(null===(c=null==a?void 0:a.data)||void 0===c?void 0:c.align)||"",P=(null===(m=null==l?void 0:l.data)||void 0===m?void 0:m.value)||"",L=(null===(u=null==l?void 0:l.data)||void 0===u?void 0:u.align)||"",N=(null===(p=null==n?void 0:n.data)||void 0===p?void 0:p.value)||"",T=(null===(h=null==n?void 0:n.data)||void 0===h?void 0:h.newtab)||!1,$=(null===(g=null==n?void 0:n.data)||void 0===g?void 0:g.url)||"";const o=_.extra_fields.currentLayout;["SkinA","SkinB","Floating","Tab","CenterTab"].includes(o)&&(w=!1)}S(w?{title:O,titleAlign:j,subtitle:P,subtitleAlign:L,link:$,linkNewTab:T,linkText:N,image:C}:null),sessionStorage.getItem("insider_object")?window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")):window.insider_object={user:{email:"",phone_number:"",gdpr_optin:!0,sms_optin:!0,email_optin:!0}},v.map((e=>{const t=e.name,a=e.value;"tel"==t?window.insider_object.user.phone_number=a:"email"==t&&(window.insider_object.user.email=a)})),sessionStorage.setItem("insider_object",JSON.stringify(window.insider_object))}));return o((()=>{_&&(f.current=Date.now())}),[_]),a.createElement(K.Provider,{value:{apiUrl:k,siteDomain:l,siteId:s,locale:c}},a.createElement(P.Provider,{value:{locale:c,values:G(c)}},a.createElement(p,{target:T()},a.createElement(h,{sx:{position:"fixed",zIndex:9999999999}},a.createElement(g,{mounted:Boolean("2.1"===(null===(b=null==_?void 0:_.extra_fields)||void 0===b?void 0:b.popupVersion)),transition:"fade",duration:600,timingFunction:"ease"},(e=>{var t;return a.createElement(h,{style:e},"2.1"===(null===(t=null==_?void 0:_.extra_fields)||void 0===t?void 0:t.popupVersion)&&a.createElement(a.Fragment,null,!!_.extra_fields.currentLayout&&!_.extra_fields.currentLayout.includes("Inline")&&!_.extra_fields.currentLayout.includes("Sidebar")&&a.createElement(v,{color:"#000",opacity:.5,center:!0,zIndex:400,pos:"fixed",onClick:()=>B()}),a.createElement(Me,{campaign:_,action:w,onSubmit:j,onClose:B,showThankyou:N,locale:c})))}))))))};export{We as LeadGen};
|
package/build/esm/mantine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as i,l as u,m as f}from"./index-
|
|
1
|
+
import{k as i,l as u,m as f}from"./index-603aec16.js";export{o as Accordion,A as Anchor,b as AspectRatio,a as Avatar,n as Breadcrumbs,B as Button,p as Carousel,g as CentralCarousel,d as Checkbox,e as ChipButton,c as Input,M as MAPPED_LOCALE,O as OTP,P as Phone,s as Popover,R as Radio,S as Select,T as Tabs,q as emotionCache,r as getHeadingStyles,m as getMantineThemeOverride,t as themeColors,l as useMantineLocale}from"./index-603aec16.js";export{D as DatePicker}from"./index-bf7e8cb2.js";import{T as x}from"./index-620551b5.js";export{O as OTHER_THEME_CONFIG,T as Text}from"./index-620551b5.js";export{I as Indicator}from"./index-4bee5ccb.js";import h,{useMemo as j}from"react";export{M as Modal}from"./index-727605cf.js";import{_ as v}from"./tslib.es6-541a264f.js";import{Badge as E,Spoiler as y,LoadingOverlay as C,MantineProvider as H,clsx as w,Title as N,Text as k,Button as L}from"@mantine/core";import{t as z}from"./theme-2b59bc50.js";import{u as _}from"./useTranslations-0f3e8009.js";export{S as Slider}from"./index-0bc7892c.js";export{S as Switch}from"./index-c4775284.js";import"@mantine/hooks";import"./gAssets.js";import"./index-27f79b14.js";import"date-fns/locale";import"./Onboarding-128f7694.js";import"./isProduction-526256cd.js";import"dayjs";import"./screenSizeContext-593881b5.js";import"styled-components";import"lodash/throttle";import"@mantine/carousel";import"classnames";import"@mantine/dates";import"./translationsContext-04bcf678.js";import"string-format";import"./index-43c43315.js";const F=e=>h.createElement(i,Object.assign({minRows:2,maxRows:4},e)),G=e=>{var{color:t=z.colors.primaryBase,styles:s}=e,a=v(e,["color","styles"]);return h.createElement(E,Object.assign({variant:"filled",color:t,styles:Object.assign({root:{borderRadius:"2px",background:t,textTransform:"unset"}},s)},a))},J=e=>{var{children:t,line:s,lineHeight:a,trackingAttributes:o,maxHeight:r,customExpandFn:i}=e,n=v(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);const{t:c}=_(),l=j((()=>r||(s&&a?s*a:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0))),[]);t||console.error("[HHG-Comp]:[Spoiler] Please provide children");const m=j((()=>o?{"data-event-category":o.dataEventCategory,"data-event-action":o.dataEventAction,"data-event-label":o.dataEventLabel}:{}),[o]);return h.createElement(y,Object.assign({showLabel:h.createElement(x,Object.assign({size:"p3",color:z.colors.primaryBase},m,{onClick:i}),c("articlePage.readMore")),hideLabel:h.createElement(x,Object.assign({size:"p3",color:z.colors.primaryBase},m),c("articlePage.showLess"))},n,{maxHeight:l}),t)};const U=e=>(function(e=!1){h.useEffect((()=>{if(e){const e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}}),[e])}(e.visible),h.createElement(C,Object.assign({loaderProps:{color:z.colors.primaryBase}},e))),V=e=>{var{children:t,locale:s,template:a="hb"}=e,o=v(e,["children","locale","template"]);return u(s),h.createElement(H,Object.assign({theme:f(s,a)},o),t)};var Y="MON6sfi",Z="pS-tJD7",K="s3tJ9-5",Q="fNsZr1b",W="uuxV74v",X="YohjTDU";function $(e){const{icon:t,title:s,description:a,button:o,buttonProps:r,style:i,className:n}=e,c=r||{},{size:l="lg",variant:m="outline"}=c,d=v(c,["size","variant"]),p=t;return h.createElement("div",{className:w("result",Y,n),style:i},p&&h.createElement("div",{className:w("resultIconContainer",Z)},h.createElement(p,{className:w("resultIcon",K)})),h.createElement(N,{order:3,size:"h3",className:w("resultTitle",Q)},s),h.createElement(k,{className:w("resultDescription",W)},a),o&&h.createElement(L,Object.assign({},d,{size:l,variant:m,className:w("resultButton",X,d.className)}),o))}export{G as Badge,U as LoadingOverlay,V as MantineProvider,$ as Result,J as Spoiler,F as TextArea};
|
package/build/esm/misc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as ageGenerate,c as convertLocalizedStringToNumber,l as localizeNumberFormat}from"./localizeNumberFormat-
|
|
1
|
+
export{a as ageGenerate,c as convertLocalizedStringToNumber,l as localizeNumberFormat}from"./localizeNumberFormat-40d6b54f.js";export{B as Breakpoints,M as MediaQueries,S as ScreenSizeContext,q as ScreenSizeContextProvider,h as fadeIn,i as formatUrlWithPageParam,j as getBoundariesFromMediaQueryKey,k as getPopupWrapperDom,p as getWindowSizeGroups,l as getWrapperDomWithSelector,m as makeParams,o as safeEncodeURI,a as slideInDown,b as slideInLeft,c as slideInRight,s as slideInUp,e as slideOutDown,f as slideOutLeft,g as slideOutRight,d as slideOutUp,n as startCase,t as toggleNoScroll}from"./screenSizeContext-593881b5.js";export{d as deleteCookie,g as getCookie,s as setCookie}from"./cookieHelper-f08471b0.js";import"react";import"styled-components";export{M as MBTheme,t as theme}from"./theme-2b59bc50.js";export{a as abbreviateNumber}from"./number-2748523d.js";export{d as getCareApiDomain,g as getCurrentBaseUrl,a as getCurrentSsoUrl,c as getDiscoverApiDomain,b as getTogetherApiDomain}from"./routing-cf2d5f19.js";export{f as formatHealthTool,g as getDynamicHealthTool,a as getDynamicHealthToolWithCache}from"./getDynamicHealthTool-6bf2e69d.js";export{g as getSocialList}from"./getSocialList-593d72cf.js";export{f as formatPill}from"./dataTransform-9a889a57.js";import"dayjs";import"lodash/throttle";import"./index-27f79b14.js";import"date-fns/locale";import"./Onboarding-128f7694.js";import"./isProduction-526256cd.js";import"./tslib.es6-541a264f.js";import"./core-311d7242.js";import"./normalizeLink-630cc7e1.js";import"./gAssets.js";
|
package/build/esm/navigation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./tslib.es6-
|
|
1
|
+
import"./tslib.es6-541a264f.js";import"react";import"./core-311d7242.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-ca4fdb46.js";import"./index-27f79b14.js";import"./normalizeLink-630cc7e1.js";import"./routing-cf2d5f19.js";import"./index-9cdff468.js";import"./isProduction-526256cd.js";import"./index-603aec16.js";import"@mantine/core";import"@mantine/hooks";import"./theme-2b59bc50.js";import"./gAssets.js";import"date-fns/locale";import"./Onboarding-128f7694.js";import"dayjs";import"./screenSizeContext-593881b5.js";import"styled-components";import"lodash/throttle";import"@mantine/carousel";import"./index-620551b5.js";import"./useTranslations-0f3e8009.js";import"./translationsContext-04bcf678.js";import"string-format";import"classnames";import"./index-3fd6d11d.js";import"./utils-5f9f0861.js";import"@mantine/dates";import"./constants-5e4b6aaa.js";import"./index.styles-8e66aa69.js";import"./constants-b5814512.js";import"react-keyed-flatten-children";import"./cookieHelper-f08471b0.js";import"slugify";import"./index-43c43315.js";import"./index.styled-02ca5623.js";import"./index-c93685a5.js";import"lodash/debounce";import"./useCategory-e1c4dd95.js";import"./index-4bee5ccb.js";import"./useIsInit-6bede063.js";import"dayjs/plugin/relativeTime";import"./index-fc996fc3.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{createContext as t,forwardRef as n,useContext as r,useImperativeHandle as o,useState as a,useRef as i,useEffect as l,useMemo as s,Fragment as m}from"react";import{_ as d,a as c}from"./tslib.es6-
|
|
1
|
+
import e,{createContext as t,forwardRef as n,useContext as r,useImperativeHandle as o,useState as a,useRef as i,useEffect as l,useMemo as s,Fragment as m}from"react";import{_ as d,a as c}from"./tslib.es6-541a264f.js";import{Box as p,Input as u,Grid as g,Title as b,Container as h,Flex as E,rem as f,Stack as L,AspectRatio as v}from"@mantine/core";import{P as y,c as C,R as x,O as w,d as S,u as j,B as P}from"./index-603aec16.js";import{D as O}from"./index-bf7e8cb2.js";import{T as k,I as F}from"./index-620551b5.js";import"dayjs";import{M as z,k as B}from"./screenSizeContext-593881b5.js";import N from"styled-components";import{t as T}from"./theme-2b59bc50.js";import{L as I}from"./index-27f79b14.js";import"./isProduction-526256cd.js";import"./Onboarding-128f7694.js";import{CommonGAssets as D}from"./gAssets.js";import{u as A}from"./useTranslations-0f3e8009.js";import{useInterval as Z,useCounter as _}from"@mantine/hooks";import{A as V}from"./index-f2bbc22b.js";import"lodash/debounce";import"./useCategory-e1c4dd95.js";import{V as q}from"./Visible-0aff5e0b.js";import{createFormContext as $,yupResolver as H}from"@mantine/form";import{M as W,h as U}from"./utils-c9e60f19.js";export{M as MAPPED_LOCALE}from"./utils-c9e60f19.js";import{H as Y}from"./index.styles-8e66aa69.js";import"./constants-b5814512.js";import{L as R}from"./utils-5f9f0861.js";import"@mantine/dates";import"./index.styled-02ca5623.js";import"./index-c93685a5.js";import*as G from"yup";import{createPortal as K}from"react-dom";import"./translationsContext-04bcf678.js";import"string-format";import J from"lodash/throttle";import{B as Q}from"./index-43c43315.js";import{T as X}from"./index-43ced8c4.js";import{format as ee}from"date-fns";import te from"react-keyed-flatten-children";import"@mantine/carousel";import"classnames";import"date-fns/locale";import"./cookieHelper-f08471b0.js";import"slugify";const ne=t({currentStep:0,setCurrentStep:()=>!1,setMaxStep:()=>!1,nextStep:()=>!1,prevStep:()=>!1,isMarryBaby:!1,siteType:"helloSites",sharedData:{},setSharedData:()=>!1}),[re,oe,ae]=$(),ie=N(p)`
|
|
2
2
|
.phone-input {
|
|
3
3
|
width: 100%;
|
|
4
4
|
margin-bottom: 32px;
|
package/build/esm/pwg.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useMemo as t,useState as r,useRef as a}from"react";import{M as o,a as l}from"./index-
|
|
1
|
+
import e,{useMemo as t,useState as r,useRef as a}from"react";import{M as o,a as l}from"./index-f0b1e2fe.js";import{T as n}from"./index-620551b5.js";import{P as i}from"./index-fb027c2b.js";import{u as s}from"./useTranslations-0f3e8009.js";import{t as c}from"./theme-2b59bc50.js";import{ResponsiveContainer as m,AreaChart as d,CartesianGrid as p,Tooltip as g,XAxis as y,YAxis as u,Area as b,ReferenceDot as h}from"recharts";import{C as f}from"./index-c93685a5.js";import{a as x}from"./useOutsideClick-359aeef3.js";import E from"styled-components";import{_ as k}from"./tslib.es6-541a264f.js";import"./index.styled-02ca5623.js";import"@mantine/core";import"dayjs";import"./screenSizeContext-593881b5.js";import"lodash/throttle";import"./index-27f79b14.js";import"date-fns/locale";import"./Onboarding-128f7694.js";import"./isProduction-526256cd.js";import"./gAssets.js";import"./index-603aec16.js";import"@mantine/hooks";import"@mantine/carousel";import"classnames";import"./index-43ced8c4.js";import"@mantine/dates";import"./translationsContext-04bcf678.js";import"string-format";const w=t=>{const{x:r,y:a,payload:o,activeWeek:l}=t;return l===o.value?e.createElement("g",{transform:`translate(${r},${a})`},e.createElement("circle",{r:12,fill:"marryBaby"===t.siteType?c.mbColors.pink:c.colors.primaryBase}),e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:c.colors.white,fontFamily:"Inter",fontWeight:"600",fontSize:"12px"},o.value)):e.createElement("g",{transform:`translate(${r},${a})`},e.createElement("text",{textAnchor:"middle",alignmentBaseline:"central",fill:c.colors.gray600,fontFamily:"Inter",fontWeight:"400",fontSize:"12px"},o.value))},v=E.div`
|
|
2
2
|
/* position: absolute; */
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -55,7 +55,7 @@ import e,{useMemo as t,useState as r,useRef as a}from"react";import{M as o,a as
|
|
|
55
55
|
align-items: center;
|
|
56
56
|
gap: 4px;
|
|
57
57
|
}
|
|
58
|
-
`,T=[{name:"overweight",backgroundColor:c.colors.yellow50,color:c.colors.yellow900},{name:"underweight",backgroundColor:c.colors.yellow50,color:c.colors.yellow900},{name:"healthy",backgroundColor:c.colors.green50,color:c.colors.green900}],B=r=>{var a,o,l,i,s;const{payload:m,active:d}=r,p=null===(a=null==m?void 0:m[0])||void 0===a?void 0:a.payload;if(!p||!p.toolTipLabel||!d)return null;const{backgroundColor:g,color:y}=t((()=>T.find((e=>e.name===p.status))),[null==p?void 0:p.status]);return e.createElement(v,null,e.createElement("div",null,null===(o=p.toolTipLabel)||void 0===o?void 0:o[0]," ",null===(l=p.toolTipLabel)||void 0===l?void 0:l[1]),e.createElement("div",null,(null===(i=p.toolTipLabel)||void 0===i?void 0:i[2])&&e.createElement(n,{as:"span",size:"s3",color:c.colors.gray800,weight:"semiBold"},null===(s=p.toolTipLabel)||void 0===s?void 0:s[2]),e.createElement("div",{className:"risk",style:{backgroundColor:g}},e.createElement(n,{size:"n1",color:y},p.translatedStatus))))},W=({weightByWeek:e,weightBefore:t,toolTipLabel:r,status:a,activeWeek:o,t:l})=>{const n=l(`bmi.result.${a}`);return e.map((e=>Object.assign({name:e.week,min:t+e.min,difference:e.max-e.min,max:t+e.max},e.week===o?{toolTipLabel:r,translatedStatus:n,status:a}:{})))},z=({weightBefore:l,weightByWeek:i,activeWeek:E,currentWeight:k,toolTipLabel:v=[],status:C,withLine:T=!1,siteType:z})=>{const{t:S}=s(),L="marryBaby"===z,O=t((()=>W({weightByWeek:i,weightBefore:l,toolTipLabel:v,status:C,activeWeek:E,t:S})),[i,l,v,C,E]),[F,I]=r(!1),M=a(null);return
|
|
58
|
+
`,T=[{name:"overweight",backgroundColor:c.colors.yellow50,color:c.colors.yellow900},{name:"underweight",backgroundColor:c.colors.yellow50,color:c.colors.yellow900},{name:"healthy",backgroundColor:c.colors.green50,color:c.colors.green900}],B=r=>{var a,o,l,i,s;const{payload:m,active:d}=r,p=null===(a=null==m?void 0:m[0])||void 0===a?void 0:a.payload;if(!p||!p.toolTipLabel||!d)return null;const{backgroundColor:g,color:y}=t((()=>T.find((e=>e.name===p.status))),[null==p?void 0:p.status]);return e.createElement(v,null,e.createElement("div",null,null===(o=p.toolTipLabel)||void 0===o?void 0:o[0]," ",null===(l=p.toolTipLabel)||void 0===l?void 0:l[1]),e.createElement("div",null,(null===(i=p.toolTipLabel)||void 0===i?void 0:i[2])&&e.createElement(n,{as:"span",size:"s3",color:c.colors.gray800,weight:"semiBold"},null===(s=p.toolTipLabel)||void 0===s?void 0:s[2]),e.createElement("div",{className:"risk",style:{backgroundColor:g}},e.createElement(n,{size:"n1",color:y},p.translatedStatus))))},W=({weightByWeek:e,weightBefore:t,toolTipLabel:r,status:a,activeWeek:o,t:l})=>{const n=l(`bmi.result.${a}`);return e.map((e=>Object.assign({name:e.week,min:t+e.min,difference:e.max-e.min,max:t+e.max},e.week===o?{toolTipLabel:r,translatedStatus:n,status:a}:{})))},z=({weightBefore:l,weightByWeek:i,activeWeek:E,currentWeight:k,toolTipLabel:v=[],status:C,withLine:T=!1,siteType:z})=>{const{t:S}=s(),L="marryBaby"===z,O=t((()=>W({weightByWeek:i,weightBefore:l,toolTipLabel:v,status:C,activeWeek:E,t:S})),[i,l,v,C,E]),[F,I]=r(!1),M=a(null);return x(M,(()=>I(!1))),e.createElement(j,null,L?e.createElement(o,{type:"bodytext-3",color:c.mbColors.dark}," ",S("babyGrowth.weight")," ",S("pregnancyWeightGain.weightInput.desc")):e.createElement(n,{size:"n1",color:c.colors.gray500},S("babyGrowth.weight")," ",S("pregnancyWeightGain.weightInput.desc")),Array.isArray(O)&&O.length>0&&e.createElement(j,null,e.createElement(m,{height:388,className:"chart"},e.createElement(d,{data:O,margin:{top:16,right:0,left:0}},e.createElement(p,{stroke:c.colors.neutral100}),e.createElement(g,{trigger:"click",content:t=>e.createElement(B,Object.assign({active:!T&&F&&void 0!==E&&void 0!==k},t))}),e.createElement(y,{type:"number",scale:"linear",ticks:Array.from({length:40},((e,t)=>t+1)),dataKey:"name",tickLine:!1,tickMargin:12,tick:t=>e.createElement(w,Object.assign({},t,{activeWeek:E,siteType:z})),domain:["dataMin","dataMax"],interval:"preserveStartEnd",tickCount:1,allowDecimals:!1}),e.createElement(u,{domain:[e=>Math.max(e,l-10||e),e=>Math.max(e,l+20||e)],type:"number",scale:"auto",interval:"preserveStartEnd",tickLine:!1,tickMargin:7,width:45,tickCount:10,allowDecimals:!0,tickFormatter:e=>String(Math.round(100*(e+Number.EPSILON))/100),tick:{fontFamily:"Inter",fontWeight:400,fontSize:12,color:c.colors.gray600}}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"min",stackId:"1",stroke:"transparent",fill:"transparent"}),e.createElement(b,{connectNulls:!0,type:"monotone",dataKey:"difference",stackId:"1",stroke:"transparent",fill:L?c.mbColors.tonePink:c.colors.primary100}),void 0!==E&&void 0!==k&&e.createElement(h,{onClick:()=>I(!0),x:0===E?1:E,y:k,r:4,shape:e.createElement(f,{ref:M,r:4}),fill:L?c.mbColors.pink:c.colors.primaryBase,stroke:L?c.mbColors.pink:c.colors.primaryBase}))),e.createElement("div",{className:"custom-chart-label"},e.createElement("i",null),L?e.createElement(o,{type:"bodytext-3",color:c.mbColors.dark},S("pregnancy.week")):e.createElement(n,{size:"n1",color:c.colors.gray500},S("pregnancy.week")))))},S=t=>{var{color:r}=t,a=k(t,["color"]);return e.createElement("svg",Object.assign({width:"8",height:"8",viewBox:"0 0 8 8",fill:"none"},a),e.createElement("circle",{cx:"4",cy:"4",r:"4",fill:r||c.colors.primaryBase}))},L=({idealWeight:t,siteType:r})=>{const{t:a}=s(),l="marryBaby"===r;return e.createElement(C,null,e.createElement("div",null,l?e.createElement(e.Fragment,null,e.createElement(S,{color:c.mbColors.lightPink}),e.createElement(o,{type:"bodytext-3",color:c.mbColors.dark},a("pregnancyTool.weightSuggested")," ",e.createElement(n,{size:"n1",color:c.colors.gray800,weight:"bold",as:"span"},t))):e.createElement(e.Fragment,null,e.createElement(S,{color:c.colors.primary100}),e.createElement(n,{size:"n1",color:c.colors.gray600},e.createElement(n,{size:"n1",as:"span"},a("pregnancyTool.weightSuggested")," "),e.createElement(n,{size:"n1",color:c.colors.gray800,weight:"bold",as:"span"},t)))),e.createElement("div",null,l?e.createElement(e.Fragment,null,e.createElement(S,{color:c.mbColors.pink}),e.createElement(o,{type:"bodytext-3",color:c.mbColors.dark},a("pwg.placeholder.weight"))):e.createElement(e.Fragment,null,e.createElement(S,null),e.createElement(n,{size:"n1",color:c.colors.gray600},a("pwg.placeholder.weight")))))},O=E.div`
|
|
59
59
|
display: flex;
|
|
60
60
|
flex-direction: column;
|
|
61
61
|
align-items: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e}from"./index-
|
|
1
|
+
import{d as e}from"./index-27f79b14.js";import{i as s}from"./isProduction-526256cd.js";const t=(t,o)=>{if("undefined"!=typeof window)return window.location.origin;const r="development"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return r?"http://localhost:3000":`https://${!r&&!s?o?"fe.":"discover.":o?"www.":""}${e[o?"vi-VN_MB":t]}`},o=(t,o)=>process.env.UNIFY_SSO_API||`https://${s?"id.":"staging-id."}${e[o?"vi-VN_MB":t]}`,r=()=>process.env.UNIFY_INTERNAL_TOGETHER_API||process.env.UNIFY_TOGETHER_API||`https://${s?"together.":"staging-together."}hellohealthgroup.com`,n=t=>process.env.UNIFY_DISCOVER_API||`https://${s?"wp.":"staging."}${e[t]}`,i=()=>process.env.UNIFY_INTERNAL_CARE_API||process.env.UNIFY_CARE_API||`https://${s?"health-care.":"service-health-care."}hellohealthgroup.com`;export{o as a,r as b,n as c,i as d,t as g};
|
package/build/esm/together.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{f as CardAuthor,C as CardReactions,L as LabelSortPin,e as LabelSorting,o as PopoverMenu,g as PopupDoctor,P as PopupExpert,i as PopupFrame,h as PopupHospital,k as PostContent,m as ProfileDetail,l as ProfileDetailModal,j as ShareBox,S as SharePopup,p as SourceList,n as TabNameInProfileDetail,d as TagTopic,T as TogetherAuthConfigContext,c as TogetherAuthConfigContextProvider,u as useTogetherAuthRequiredAction}from"./index.styled-
|
|
1
|
+
export{f as CardAuthor,C as CardReactions,L as LabelSortPin,e as LabelSorting,o as PopoverMenu,g as PopupDoctor,P as PopupExpert,i as PopupFrame,h as PopupHospital,k as PostContent,m as ProfileDetail,l as ProfileDetailModal,j as ShareBox,S as SharePopup,p as SourceList,n as TabNameInProfileDetail,d as TagTopic,T as TogetherAuthConfigContext,c as TogetherAuthConfigContextProvider,u as useTogetherAuthRequiredAction}from"./index.styled-39bbc781.js";export{d as TogetherDataTransforms,U as UserAvatar}from"./index-9cdff468.js";export{C as CardLink,i as CardPost,j as CardPostPopoverMore,k as CardReply,l as CardReplyPopover,a as CreateNewPostContent,b as CreatePostDescription,c as CreatePostTitle,d as ImagePreviewPopup,I as InputCommentBar,L as LabelPin,P as PopupDanger,f as PostImagePreview,e as PostSingleImageViewPopup,h as SkipQuestionOfExpertBtn,g as SocialLinkPreview,S as SubmitReportForm,t as TogetherTypes,T as TopicSelectList,V as VerifiedTag}from"./types-a4c1b4b0.js";export{D as DefaultComponentGlobalContextData,G as GlobalData,b as TogetherComponentGlobalContext,d as TogetherComponentGlobalContextProvider,c as TogetherConstants}from"./index.styles-8e66aa69.js";import"react";import"./index-603aec16.js";import"./tslib.es6-541a264f.js";import"@mantine/core";import"@mantine/hooks";import"./theme-2b59bc50.js";import"./gAssets.js";import"./index-27f79b14.js";import"date-fns/locale";import"./Onboarding-128f7694.js";import"./isProduction-526256cd.js";import"dayjs";import"./screenSizeContext-593881b5.js";import"styled-components";import"lodash/throttle";import"@mantine/carousel";import"./index-620551b5.js";import"./useTranslations-0f3e8009.js";import"./translationsContext-04bcf678.js";import"string-format";import"classnames";import"@mantine/dates";import"./number-2748523d.js";import"date-fns";import"./index-43c43315.js";import"./index-9bb14d7f.js";import"./constants-b5814512.js";import"./routing-cf2d5f19.js";import"dayjs/plugin/relativeTime";import"./paths-d658dd02.js";import"lodash/debounce";import"./useCategory-e1c4dd95.js";import"./index-727605cf.js";import"innertext";import"./cookieHelper-f08471b0.js";import"react-contenteditable";import"react-dom";import"./utils-5f9f0861.js";import"./index.styled-02ca5623.js";import"./index-c93685a5.js";import"react-keyed-flatten-children";import"slugify";
|