@hhgtech/hhg-components 1.28.39 → 1.28.41
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/components/organisms/bookingSearchBarV2/searchInputs/index.d.ts +2 -1
- package/build/care.js +1 -1
- package/build/components/molecules/dropdown/index.styled.d.ts +1 -1
- package/build/components.js +1 -1
- package/build/{constants-57d89069.js → constants-55a2b4cb.js} +1 -1
- package/build/{constants-82348c13.js → constants-d67df371.js} +1 -1
- package/build/constants.js +1 -1
- package/build/{core-081bdce5.js → core-3dfeee83.js} +1 -1
- package/build/ecom.js +1 -1
- package/build/esm/babyGrowth.js +4 -4
- package/build/esm/cache.js +1 -1
- package/build/esm/care/components/organisms/bookingSearchBarV2/searchInputs/index.d.ts +2 -1
- package/build/esm/care.js +1 -1
- package/build/esm/components/molecules/dropdown/index.styled.d.ts +1 -1
- package/build/esm/components.js +1 -1
- package/build/esm/{constants-0d46ae1d.js → constants-8dc38f9e.js} +1 -1
- package/build/esm/{constants-039f36fe.js → constants-fe146bd1.js} +1 -1
- package/build/esm/constants.js +1 -1
- package/build/esm/{core-3c0d6b0f.js → core-a3b3b447.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-d874b77f.js → getDynamicHealthTool-781262ca.js} +1 -1
- package/build/esm/{getSocialList-5ea15cba.js → getSocialList-f4d07c8e.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-434197c4.js → index-00d3e532.js} +1 -1
- package/build/esm/{index-14839883.js → index-27df5763.js} +1 -1
- package/build/esm/{index-282bbb6d.js → index-2e1d6359.js} +1 -1
- package/build/esm/{index-20b84b31.js → index-53b0f26d.js} +1 -1
- package/build/esm/{index-7d0179b5.js → index-5d380017.js} +1 -1
- package/build/esm/{index-6795099e.js → index-5f2067d5.js} +1 -1
- package/build/esm/index-68094777.js +1 -0
- package/build/esm/{index-1be91706.js → index-70655f2a.js} +1 -1
- package/build/esm/{index-8db07311.js → index-76a540e6.js} +1 -1
- package/build/esm/{index-fa32b4d8.js → index-8118170d.js} +1 -1
- package/build/esm/{index-e17cd802.js → index-81be61aa.js} +1 -1
- package/build/esm/{index-f1ff7dac.js → index-8680e894.js} +1 -1
- package/build/esm/index-8951aade.js +1 -0
- package/build/esm/{index-1ac72931.js → index-8b7c8eb1.js} +1 -1
- package/build/esm/{index-dff74895.js → index-a954e49f.js} +1 -1
- package/build/esm/{index-5ecfac85.js → index-ad6cd88d.js} +1 -1
- package/build/esm/{index-0e6dbcc0.js → index-b735052e.js} +1 -1
- package/build/esm/{index-5761cc3d.js → index-b98d1a30.js} +1 -1
- package/build/esm/{index-8dfb1724.js → index-bed044a7.js} +1 -1
- package/build/esm/{index-622dbaca.js → index-d51eb02e.js} +1 -1
- package/build/esm/{index-c70696a6.js → index-dd278d18.js} +7 -7
- package/build/esm/{index-3d1ca95c.js → index-fc00d32b.js} +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/{index.styled-e26007df.js → index.styled-2daeb250.js} +6 -6
- package/build/esm/{index.styled-ede7c10d.js → index.styled-5882c35f.js} +1 -1
- package/build/esm/{index.styled-90fe28c0.js → index.styled-6252f77a.js} +1 -1
- package/build/esm/{index.styled-a1854a4a.js → index.styled-886c957e.js} +76 -76
- package/build/esm/{index.styles-95837b62.js → index.styles-874ee5cd.js} +5 -5
- 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 +9 -9
- package/build/esm/pwg.js +3 -3
- package/build/esm/{routing-7c32cdb3.js → routing-be087f5b.js} +1 -1
- package/build/esm/subot.js +1 -1
- package/build/esm/together.js +1 -1
- package/build/esm/{types-d466572e.js → types-1267dbbc.js} +1 -1
- package/build/esm/{types-c5a3b173.js → types-94add167.js} +7 -7
- package/build/esm/types.js +1 -1
- package/build/esm/{useCategory-702b6604.js → useCategory-440b7f9a.js} +1 -1
- package/build/esm/useHealthToolCache-1f203ca0.js +1 -0
- package/build/esm/{usePlacesAutocomplete-d14c4671.js → usePlacesAutocomplete-8e10c310.js} +1 -1
- package/build/esm/{useRafState-1ba3edb3.js → useRafState-4a14b267.js} +1 -1
- package/build/esm/{useTranslations-51dc4ab8.js → useTranslations-6b1653a2.js} +1 -1
- package/build/esm/{utils-b2a0d664.js → utils-1e95a4d1.js} +1 -1
- package/build/esm/{utils-8849cc57.js → utils-ab72b62f.js} +1 -1
- package/build/esm/vaccination.js +11 -11
- package/build/footer.js +1 -1
- package/build/gAssets.js +1 -1
- package/build/getDynamicHealthTool-398ca351.js +1 -0
- package/build/{getSocialList-55a29d3a.js → getSocialList-30296f8a.js} +1 -1
- package/build/hooks.js +1 -1
- package/build/i18n.js +1 -1
- package/build/i18nV2.js +1 -1
- package/build/index-0a124e5f.js +1 -0
- package/build/{index-e23393d6.js → index-11eb8c8c.js} +1 -1
- package/build/{index-cbb25109.js → index-19ab75f5.js} +10 -10
- package/build/{index-543b2956.js → index-1b06cb3e.js} +1 -1
- package/build/{index-80a776c5.js → index-1f4a8940.js} +1 -1
- package/build/{index-5a09ea5b.js → index-5cb3e60f.js} +1 -1
- package/build/{index-511b99c0.js → index-5d9cc019.js} +1 -1
- package/build/{index-e4732cde.js → index-77319653.js} +1 -1
- package/build/index-8673af8a.js +1 -0
- package/build/{index-dd161fb0.js → index-95cd2806.js} +1 -1
- package/build/{index-557f79d9.js → index-9d548edc.js} +1 -1
- package/build/{index-1cc9c0e2.js → index-a25f5546.js} +1 -1
- package/build/{index-505a6231.js → index-a74cf615.js} +3 -3
- package/build/{index-9686d73a.js → index-aeb0ae12.js} +1 -1
- package/build/{index-192c3976.js → index-b0fae554.js} +1 -1
- package/build/{index-70fc6801.js → index-b9a7f78c.js} +1 -1
- package/build/{index-5537eb8b.js → index-bb56ac1b.js} +1 -1
- package/build/{index-8a4e8200.js → index-be8bd1aa.js} +1 -1
- package/build/{index-f20a3b0b.js → index-dd2f12d8.js} +1 -1
- package/build/{index-566d616e.js → index-e2e01405.js} +1 -1
- package/build/{index-cda192d8.js → index-ef0f4c83.js} +1 -1
- package/build/{index-2744bd7d.js → index-f7640569.js} +1 -1
- package/build/index.js +1 -1
- package/build/{index.styled-95722c0d.js → index.styled-4108cde2.js} +1 -1
- package/build/{index.styled-edaa5fca.js → index.styled-44a88d2d.js} +1 -1
- package/build/index.styled-56b27702.js +50 -0
- package/build/{index.styled-bf702a00.js → index.styled-d9e7dba1.js} +1 -1
- package/build/{index.styles-eee657e0.js → index.styles-d3b67125.js} +1 -1
- 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-d19d8856.js → routing-1e951b79.js} +1 -1
- package/build/subot.js +1 -1
- package/build/together.js +1 -1
- package/build/{types-e7648820.js → types-eeedddb1.js} +9 -9
- package/build/{types-ec42e31c.js → types-f3bf297f.js} +1 -1
- package/build/types.js +1 -1
- package/build/{useCategory-15d34903.js → useCategory-eea8836a.js} +1 -1
- package/build/{useHealthToolCache-af770568.js → useHealthToolCache-cf34e8b1.js} +1 -1
- package/build/{usePlacesAutocomplete-24621567.js → usePlacesAutocomplete-ce74a3d9.js} +1 -1
- package/build/{useRafState-80bb67ea.js → useRafState-05392c62.js} +1 -1
- package/build/{useTranslations-2e112ad4.js → useTranslations-7f12251c.js} +1 -1
- package/build/{utils-6f3d330e.js → utils-00a7b97a.js} +1 -1
- package/build/utils-86f4b1f3.js +1 -0
- package/build/vaccination.js +1 -1
- package/package.json +1 -1
- package/build/esm/index-65d31851.js +0 -1
- package/build/esm/index-c7136b2d.js +0 -1
- package/build/esm/useHealthToolCache-1290f2b9.js +0 -1
- package/build/getDynamicHealthTool-12e2540d.js +0 -1
- package/build/index-86314983.js +0 -1
- package/build/index-b983594e.js +0 -1
- package/build/index.styled-7c52b155.js +0 -50
- package/build/utils-a167e7a3.js +0 -1
- /package/build/{BMI_BOYS.percentile.monthly-1abf1841.js → BMI_BOYS.percentile.monthly-a0d59c80.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-a8aff425.js → BMI_BOYS.percentile.weekly-e1b9c439.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-c73321bb.js → BMI_BOYS.percentile.yearly-8b8cc180.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-69a99c2a.js → BMI_BOYS.zscore.monthly-6b9e2b9d.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-f990fa6a.js → BMI_BOYS.zscore.weekly-0266f3d0.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-ed65c22b.js → BMI_BOYS.zscore.yearly-0a6c0714.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-4c7cb156.js → BMI_GIRLS.percentile.monthly-b92651f5.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-d570954a.js → BMI_GIRLS.percentile.weekly-642d38d3.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-61a85bc5.js → BMI_GIRLS.percentile.yearly-29d10559.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-f20b70e4.js → BMI_GIRLS.zscore.monthly-8ecfee03.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-178a1989.js → BMI_GIRLS.zscore.weekly-7eb8315e.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-88ad18e5.js → BMI_GIRLS.zscore.yearly-75127200.js} +0 -0
- /package/build/{ChevronDown-3037c172.js → ChevronDown-2eede824.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-56a4402b.js → HEAD CIRCUM_BOYS.percentile.monthly-90eb2bd6.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-ccf3c87f.js → HEAD CIRCUM_BOYS.percentile.weekly-4aed1c5b.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-2b9916f6.js → HEAD CIRCUM_BOYS.percentile.yearly-694366d9.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-bc3fdf65.js → HEAD CIRCUM_BOYS.zscore.monthly-dde69bd2.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-a3275cbb.js → HEAD CIRCUM_BOYS.zscore.weekly-14591739.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-424de02b.js → HEAD CIRCUM_BOYS.zscore.yearly-5731ed20.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-31cf5774.js → HEAD CIRCUM_GIRLS.percentile.monthly-f361d369.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-56bc87df.js → HEAD CIRCUM_GIRLS.percentile.weekly-9fd785d7.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-d495ae77.js → HEAD CIRCUM_GIRLS.percentile.yearly-9c7b567a.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-389b52dc.js → HEAD CIRCUM_GIRLS.zscore.monthly-4a6f37b4.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-545c913f.js → HEAD CIRCUM_GIRLS.zscore.weekly-ccff7ad3.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-25153e42.js → HEAD CIRCUM_GIRLS.zscore.yearly-c083a5da.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-a0167766.js → HEIGHT_BOYS.percentile.monthly-eec60602.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-fe6c86b4.js → HEIGHT_BOYS.percentile.weekly-013e3c41.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-b5f70609.js → HEIGHT_BOYS.percentile.yearly-a93bc668.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-69050519.js → HEIGHT_BOYS.zscore.monthly-95bd39db.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-086ed503.js → HEIGHT_BOYS.zscore.weekly-230c4ec5.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-ea1fd110.js → HEIGHT_BOYS.zscore.yearly-92bd30b0.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-04393cf7.js → HEIGHT_GIRLS.percentile.monthly-1dcdcb29.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-309dd221.js → HEIGHT_GIRLS.percentile.weekly-836fe160.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-3fe7b9fc.js → HEIGHT_GIRLS.percentile.yearly-2c506c97.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-a274d11d.js → HEIGHT_GIRLS.zscore.monthly-72e99c05.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-832a2702.js → HEIGHT_GIRLS.zscore.weekly-679708d2.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-e1250f72.js → HEIGHT_GIRLS.zscore.yearly-5e1ed085.js} +0 -0
- /package/build/{Subot-b76ccc9c.js → Subot-6070090a.js} +0 -0
- /package/build/{Visible-a902bc5d.js → Visible-97fdcb84.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-6aee36d0.js → WEIGHT_BOYS.percentile.monthly-b186f11d.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-84a9ddf3.js → WEIGHT_BOYS.percentile.weekly-29e9e425.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-6a5235a6.js → WEIGHT_BOYS.percentile.yearly-c6acc443.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-7b87e89a.js → WEIGHT_BOYS.zscore.monthly-74db320f.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-7dc34a8b.js → WEIGHT_BOYS.zscore.weekly-d0e93c78.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-8cde12c0.js → WEIGHT_BOYS.zscore.yearly-fe926c67.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-c1117e84.js → WEIGHT_GIRLS.percentile.monthly-d295e838.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-5da1d720.js → WEIGHT_GIRLS.percentile.weekly-c0cfc1ec.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-a23ec4ec.js → WEIGHT_GIRLS.percentile.yearly-425bc702.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-2f26e279.js → WEIGHT_GIRLS.zscore.monthly-b276e14a.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-8b0a38e9.js → WEIGHT_GIRLS.zscore.weekly-6259a761.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-8bad89fe.js → WEIGHT_GIRLS.zscore.yearly-61d76228.js} +0 -0
- /package/build/{cookieHelper-edf24fec.js → cookieHelper-50f349a8.js} +0 -0
- /package/build/{dataTransform-e2f61d60.js → dataTransform-57927b35.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-b9ab85f0.js → BMI_BOYS.percentile.monthly-e4505b15.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-ef82192f.js → BMI_BOYS.percentile.weekly-b013d877.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-183654c8.js → BMI_BOYS.percentile.yearly-9c039626.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-6eda6e64.js → BMI_BOYS.zscore.monthly-a7b0ea3d.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-2e5db2e4.js → BMI_BOYS.zscore.weekly-b82813b8.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-89b97ccc.js → BMI_BOYS.zscore.yearly-db29f80a.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-c2dca76b.js → BMI_GIRLS.percentile.monthly-7e170f4c.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-3db696ed.js → BMI_GIRLS.percentile.weekly-dc3cd239.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-d3831386.js → BMI_GIRLS.percentile.yearly-2b2f9527.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-9cef6f5e.js → BMI_GIRLS.zscore.monthly-f966c405.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-78f3bce3.js → BMI_GIRLS.zscore.weekly-dd6e2237.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-50c1c22d.js → BMI_GIRLS.zscore.yearly-c7c05089.js} +0 -0
- /package/build/esm/{ChevronDown-38081c52.js → ChevronDown-48e13c4f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-768e0230.js → HEAD CIRCUM_BOYS.percentile.monthly-de572089.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-68c28fef.js → HEAD CIRCUM_BOYS.percentile.weekly-22fde075.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-79c477be.js → HEAD CIRCUM_BOYS.percentile.yearly-acf497dc.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-c22a6bb8.js → HEAD CIRCUM_BOYS.zscore.monthly-5e0383bb.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-fa0c45de.js → HEAD CIRCUM_BOYS.zscore.weekly-cbffaac5.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-fd828878.js → HEAD CIRCUM_BOYS.zscore.yearly-e8f566d5.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-0e370871.js → HEAD CIRCUM_GIRLS.percentile.monthly-70692043.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-f4708552.js → HEAD CIRCUM_GIRLS.percentile.weekly-38c30ebd.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-dfb103cf.js → HEAD CIRCUM_GIRLS.percentile.yearly-b60f18aa.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-3ee0be1b.js → HEAD CIRCUM_GIRLS.zscore.monthly-c4979e55.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-44bcc793.js → HEAD CIRCUM_GIRLS.zscore.weekly-45f350f3.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-a1027497.js → HEAD CIRCUM_GIRLS.zscore.yearly-cecec861.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-02e472da.js → HEIGHT_BOYS.percentile.monthly-df51d068.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-0680ad0c.js → HEIGHT_BOYS.percentile.weekly-dccf4b38.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-6f8aae30.js → HEIGHT_BOYS.percentile.yearly-8a701ad8.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-c4cd5e14.js → HEIGHT_BOYS.zscore.monthly-dfc95b22.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-44a38e55.js → HEIGHT_BOYS.zscore.weekly-c75310ec.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-07fc5764.js → HEIGHT_BOYS.zscore.yearly-967076a6.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-747f685b.js → HEIGHT_GIRLS.percentile.monthly-e130c053.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-f8a8a438.js → HEIGHT_GIRLS.percentile.weekly-b22650c5.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-19c6a95d.js → HEIGHT_GIRLS.percentile.yearly-62993fa6.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-a70d26ec.js → HEIGHT_GIRLS.zscore.monthly-602da367.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-80c3120b.js → HEIGHT_GIRLS.zscore.weekly-053b19bc.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-55b48c0f.js → HEIGHT_GIRLS.zscore.yearly-c8ee8767.js} +0 -0
- /package/build/esm/{Subot-f581f4df.js → Subot-36ac5f94.js} +0 -0
- /package/build/esm/{Visible-773a840f.js → Visible-fa814ffe.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-c7365e22.js → WEIGHT_BOYS.percentile.monthly-642abc40.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-5d62ee47.js → WEIGHT_BOYS.percentile.weekly-26521de2.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-90eef9c4.js → WEIGHT_BOYS.percentile.yearly-b3cc9f47.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-39cb41e2.js → WEIGHT_BOYS.zscore.monthly-8ec285f3.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-1fd3816a.js → WEIGHT_BOYS.zscore.weekly-3d07dba8.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-91994e22.js → WEIGHT_BOYS.zscore.yearly-99e6bf03.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-8803f9b5.js → WEIGHT_GIRLS.percentile.monthly-afe58712.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-ec6c8a49.js → WEIGHT_GIRLS.percentile.weekly-154459dc.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-0e9334c7.js → WEIGHT_GIRLS.percentile.yearly-ad483573.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-031167a3.js → WEIGHT_GIRLS.zscore.monthly-c9363f7d.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-36d7530c.js → WEIGHT_GIRLS.zscore.weekly-736b742e.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-93c90f87.js → WEIGHT_GIRLS.zscore.yearly-d1a28c31.js} +0 -0
- /package/build/esm/{cookieHelper-1491c7ea.js → cookieHelper-bf1be72d.js} +0 -0
- /package/build/esm/{dataTransform-9bceddac.js → dataTransform-c10d68f3.js} +0 -0
- /package/build/esm/{index-2f243424.js → index-0e3fc8b7.js} +0 -0
- /package/build/esm/{index-0797d3cb.js → index-bc94a926.js} +0 -0
- /package/build/esm/{index-bbf78608.js → index-f4b93c10.js} +0 -0
- /package/build/esm/{isProduction-d8d94564.js → isProduction-f464a698.js} +0 -0
- /package/build/esm/{localizeNumberFormat-3657ce11.js → localizeNumberFormat-079a6b93.js} +0 -0
- /package/build/esm/{normalizeLink-7259b86a.js → normalizeLink-15cf45d1.js} +0 -0
- /package/build/esm/{number-a14a26d2.js → number-42359818.js} +0 -0
- /package/build/esm/{paths-80d2b4f2.js → paths-7c55394d.js} +0 -0
- /package/build/esm/{screenSizeContext-f9a53919.js → screenSizeContext-c38ade0a.js} +0 -0
- /package/build/esm/{theme-9d69f1a2.js → theme-57e98706.js} +0 -0
- /package/build/esm/{translationsContext-a929820e.js → translationsContext-b6ff3279.js} +0 -0
- /package/build/esm/{tslib.es6-7b491686.js → tslib.es6-98b62e2b.js} +0 -0
- /package/build/esm/{types-c4843c87.js → types-8c6df085.js} +0 -0
- /package/build/esm/{useIsInit-36546b9c.js → useIsInit-6b7cbee2.js} +0 -0
- /package/build/esm/{useOutsideClick-78141983.js → useOutsideClick-878679f9.js} +0 -0
- /package/build/esm/{useScrollbarSize-30b1bee4.js → useScrollbarSize-3959071b.js} +0 -0
- /package/build/{index-af3f2c07.js → index-435fff10.js} +0 -0
- /package/build/{index-0251e5f0.js → index-5e5d6e08.js} +0 -0
- /package/build/{index-ff51ac26.js → index-f2286b64.js} +0 -0
- /package/build/{isProduction-fa856154.js → isProduction-f6daa4d4.js} +0 -0
- /package/build/{localizeNumberFormat-118c54b5.js → localizeNumberFormat-41f06af6.js} +0 -0
- /package/build/{normalizeLink-b898d874.js → normalizeLink-7a96ca0b.js} +0 -0
- /package/build/{number-e86b559d.js → number-1963bb93.js} +0 -0
- /package/build/{paths-bbbcac69.js → paths-d3a2028a.js} +0 -0
- /package/build/{screenSizeContext-478cce5e.js → screenSizeContext-1a577828.js} +0 -0
- /package/build/{theme-1481c80b.js → theme-c252ab3b.js} +0 -0
- /package/build/{translationsContext-e83c75a5.js → translationsContext-8f763486.js} +0 -0
- /package/build/{tslib.es6-524ea691.js → tslib.es6-a447d75e.js} +0 -0
- /package/build/{types-5ceae17e.js → types-51f2e864.js} +0 -0
- /package/build/{useIsInit-b0daf2cf.js → useIsInit-8be47ce0.js} +0 -0
- /package/build/{useOutsideClick-abc52969.js → useOutsideClick-99a300bf.js} +0 -0
- /package/build/{useScrollbarSize-251ab8f8.js → useScrollbarSize-af06cacb.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./theme-
|
|
1
|
+
import{t as e}from"./theme-57e98706.js";import t,{css as o}from"styled-components";import{M as r,s as a,e as i,b as n,f as s,c as l,g as c,a as d,d as p}from"./screenSizeContext-c38ade0a.js";import"dayjs";import u,{useState as g,forwardRef as m,createContext as h,useEffect as _,Fragment as b}from"react";import"./index-27df5763.js";import{i as E}from"./isProduction-f464a698.js";import"./Subot-36ac5f94.js";import"./gAssets.js";import{_ as T,a as f}from"./tslib.es6-98b62e2b.js";import{createStyles as v,rem as x}from"@mantine/core";import{L as w}from"./constants-fe146bd1.js";import y from"react-keyed-flatten-children";import{g as O}from"./cookieHelper-bf1be72d.js";import A from"slugify";import I from"string-format";const L=t.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
|
|
4
4
|
> div {
|
|
@@ -166,7 +166,7 @@ import{t as e}from"./theme-9d69f1a2.js";import t,{css as o}from"styled-component
|
|
|
166
166
|
height: 16px;
|
|
167
167
|
width: 16px;
|
|
168
168
|
}
|
|
169
|
-
`;var D="xzO2I0N";const G=v((()=>({root:{}}))),M=e=>{var t,{as:o,tag:r,className:a,children:i,title:n,color:s,style:l,fontWeight:c,dataEventCategory:d,dataEventAction:p,dataEventLabel:g}=e,m=
|
|
169
|
+
`;var D="xzO2I0N";const G=v((()=>({root:{}}))),M=e=>{var t,{as:o,tag:r,className:a,children:i,title:n,color:s,style:l,fontWeight:c,dataEventCategory:d,dataEventAction:p,dataEventLabel:g}=e,m=T(e,["as","tag","className","children","title","color","style","fontWeight","dataEventCategory","dataEventAction","dataEventLabel"]);const h=o||r,{theme:_}=G(void 0,{name:"Heading"});return u.createElement(h,Object.assign({title:n,style:Object.assign({"--custom-heading-color":s||("mb"===(null===(t=null==_?void 0:_.other)||void 0===t?void 0:t.template)?_.colors.gray[9]:_.colors.gray[8])},l),"data-tag":r,"data-font-weight":c||void 0,"data-event-category":d,"data-event-action":p,"data-event-label":g,className:`${D} ${a||""}`},m),i)},U=t.div`
|
|
170
170
|
display: flex;
|
|
171
171
|
align-items: center;
|
|
172
172
|
justify-content: space-between;
|
|
@@ -342,7 +342,7 @@ import{t as e}from"./theme-9d69f1a2.js";import t,{css as o}from"styled-component
|
|
|
342
342
|
display: inline-flex;
|
|
343
343
|
cursor: default;
|
|
344
344
|
transform: translateY(-50%);
|
|
345
|
-
`,V=u.forwardRef(((e,t)=>{var{name:o,errorMessage:r,autoComplete:a="off",defaultValue:i,actionIcon:n,displayIcon:s,isDeleteAction:l,onActionClick:c,label:d,placeholder:p,className:m,onChange:h,onKeyPress:_,isDisabled:b,CustomInput:E,size:
|
|
345
|
+
`,V=u.forwardRef(((e,t)=>{var{name:o,errorMessage:r,autoComplete:a="off",defaultValue:i,actionIcon:n,displayIcon:s,isDeleteAction:l,onActionClick:c,label:d,placeholder:p,className:m,onChange:h,onKeyPress:_,isDisabled:b,CustomInput:E,size:f,style:v,autoFocus:x,type:y="text",isNumerousKeyboard:O=!1,onFocus:A,enterKeyHint:I,nativeOnChange:L}=e,S=T(e,["name","errorMessage","autoComplete","defaultValue","actionIcon","displayIcon","isDeleteAction","onActionClick","label","placeholder","className","onChange","onKeyPress","isDisabled","CustomInput","size","style","autoFocus","type","isNumerousKeyboard","onFocus","enterKeyHint","nativeOnChange"]);const[R,k]=g(i);return u.createElement(z,{"data-size":f,className:m,"data-has-action-icon":!!n||void 0,"data-has-display-icon":!!s||void 0,"data-has-error":r&&r.length>0||void 0,style:v},d&&u.createElement(w,{size:"label2",htmlFor:o,className:"inputLabel"},d),u.createElement("div",{style:{position:"relative"}},E||u.createElement("input",Object.assign({id:o,name:o,placeholder:p,onChange:null!=L?L:e=>{return t=e.target.value,k(t),void h(t);var t},onKeyPress:_,type:y,"aria-label":y,disabled:b,value:R,autoComplete:a,ref:t,autoFocus:x,inputMode:O||"number"===y?"numeric":y,pattern:O?"[0-9]*":".*",onFocus:A,enterKeyHint:I},S)),s&&u.createElement(K,{className:"displayIcon"},s),n&&u.createElement(F,{className:"actionIcon",onClick:()=>{var e;l&&(k(""),null===(e=t.current)||void 0===e||e.focus()),c&&c()}},n)),r&&r.length>0&&u.createElement(j,{className:"errorLabel"},r))}));V.displayName="PureInput";const Y=t.div`
|
|
346
346
|
--padding-horizontal: 8px;
|
|
347
347
|
--pading-vertical: 2px;
|
|
348
348
|
display: flex;
|
|
@@ -371,7 +371,7 @@ import{t as e}from"./theme-9d69f1a2.js";import t,{css as o}from"styled-component
|
|
|
371
371
|
&:active {
|
|
372
372
|
background: ${e.colors.primary50};
|
|
373
373
|
}
|
|
374
|
-
`,W=(e,t)=>m(((o,r)=>{var{className:a}=o,i=
|
|
374
|
+
`,W=(e,t)=>m(((o,r)=>{var{className:a}=o,i=T(o,["className"]);return u.createElement(e,Object.assign({ref:r,className:`${t} ${a||""}`},i))})),X="24px",q="hhgcomp-toggle-icon",J=W(t.span`
|
|
375
375
|
position: relative;
|
|
376
376
|
display: block;
|
|
377
377
|
width: 40px;
|
|
@@ -624,4 +624,4 @@ import{t as e}from"./theme-9d69f1a2.js";import t,{css as o}from"styled-component
|
|
|
624
624
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
625
625
|
* MIT Licensed
|
|
626
626
|
*/
|
|
627
|
-
var ue=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var o={},r=(t||{}).decode||_e,a=0;for(;a<e.length;){var i=e.indexOf("=",a);if(-1===i)break;var n=e.indexOf(";",a);if(-1===n)n=e.length;else if(n<i){a=e.lastIndexOf(";",i-1)+1;continue}var s=e.slice(a,i).trim();if(void 0===o[s]){var l=e.slice(i+1,n).trim();34===l.charCodeAt(0)&&(l=l.slice(1,-1)),o[s]=Ee(l,r)}a=n+1}return o},ge=function(e,t,o){var r=o||{},a=r.encode||be;if("function"!=typeof a)throw new TypeError("option encode is invalid");if(!he.test(e))throw new TypeError("argument name is invalid");var i=a(t);if(i&&!he.test(i))throw new TypeError("argument val is invalid");var n=e+"="+i;if(null!=r.maxAge){var s=r.maxAge-0;if(isNaN(s)||!isFinite(s))throw new TypeError("option maxAge is invalid");n+="; Max-Age="+Math.floor(s)}if(r.domain){if(!he.test(r.domain))throw new TypeError("option domain is invalid");n+="; Domain="+r.domain}if(r.path){if(!he.test(r.path))throw new TypeError("option path is invalid");n+="; Path="+r.path}if(r.expires){var l=r.expires;if(!function(e){return"[object Date]"===me.call(e)||e instanceof Date}(l)||isNaN(l.valueOf()))throw new TypeError("option expires is invalid");n+="; Expires="+l.toUTCString()}r.httpOnly&&(n+="; HttpOnly");r.secure&&(n+="; Secure");if(r.priority){switch("string"==typeof r.priority?r.priority.toLowerCase():r.priority){case"low":n+="; Priority=Low";break;case"medium":n+="; Priority=Medium";break;case"high":n+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:n+="; SameSite=Strict";break;case"lax":n+="; SameSite=Lax";break;case"strict":n+="; SameSite=Strict";break;case"none":n+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return n},me=Object.prototype.toString,he=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function _e(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function be(e){return encodeURIComponent(e)}function Ee(e,t){try{return t(e)}catch(t){return e}}var fe={parse:ue,serialize:ge};const Te={BASE_API_PATH:"/",PROFILE:"profile?website_url={website_url}",SEARCH_USER:"profile/search?website_url={website_url}&name={name}",FETCH_PREVIEW:"fetch/preview?website_url={website_url}",FETCH_POST_OR_TOPIC:"fetch/{slug}?website_url={website_url}&community_slug={communitySlug}",POST:{LIST:"post?website_url={website_url}&slug={slug}&pin={pin}&page={page}&community_id={communityId}&topic_id={topicId}&sort_by={sort}&id={id}",DETAIL_BY_ID_OR_SLUG:"post/{idSlug}?website_url={website_url}",CREATE:"post/create?website_url={website_url}",LIKE:"post/{id}/like?website_url={website_url}",DELETE:"post/{id}/delete?website_url={website_url}",REPORT:"post/{id}/report?website_url={website_url}",UPDATE:"post/{id}/update?website_url={website_url}",FOLLOW:"post/{id}/follow?website_url={website_url}",CREATE_ARTICLE_COMMENT:"article-comment/create?website_url={website_url}"},COMMENT:{LIST:"comment?website_url={website_url}&post_id={postId}&page={page}&sort_by={sort}&items_per_page={perPage}&_without_reply={withoutReply}",CREATE:"comment/create?website_url={website_url}",REPLY:"comment/reply?website_url={website_url}",DELETE:"comment/{id}/delete?website_url={website_url}",LIKE:"comment/{id}/like?website_url={website_url}",UNLIKE:"comment/{id}/unlike?website_url={website_url}",IMAGE_UPLOAD:"comment/image/upload?website_url={website_url}"},COMMUNITY:{LIST:"community?website_url={website_url}&page={page}",DETAIL_BY_ID_OR_SLUG:"community/{idSlug}?website_url={website_url}",JOIN:"community/join?website_url={website_url}",LEAVE:"community/leave?website_url={website_url}"},TOPIC:{LIST:"topic?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}&page={page}",DETAIL_BY_ID_OR_SLUG:"topic/{idSlug}?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}",HEALTH_TOOLS:"tools?topic_id={topicId}&website_url={website_url}",SUBOTS:"subots?topic_id={topicId}&website_url={website_url}",SUGGESTED_POSTS:"suggested-posts?topic_id={topicId}&website_url={website_url}&page={page}",JOIN:"topic/join?website_url={website_url}",LEAVE:"topic/leave?website_url={website_url}"},BOOKMARK:{LIST:"bookmark?user_id={userId}&website_url={website_url}",CREATE:"bookmark/create?website_url={website_url}",DELETE:"bookmark/delete?website_url={website_url}"},UPLOAD_IMAGE:"auth/comment/image/upload?website_url={website_url}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info",USER:{DETAIL:"profile/user/detail?website_url={website_url}&user_id={id}",COUNT_TABS:"profile/user/counting?website_url={website_url}&user_id={id}&total_post={post}&total_comment={comment}&total_community={community}&total_reply={reply}&total_question={question}",LIST_POST:"profile/user/posts?website_url={website_url}&user_id={id}&is_anonymous={isAnonymous}&paging=none",LIST_QUESTION_NEED_REPLY:"questions/no-reply?website_url={website_url}",LIST_QUESTION:"question/{id}?website_url={website_url}&is_reply={isReply}&is_question={isQuestion}&is_ignore={isIgnore}&group_by={groupBy}",SKIP_QUESTION:"questions/ignore?website_url={website_url}&question_id={id}",LIST_ANSWERS:"replied/{id}?website_url={website_url}&paging=1&items_per_page={pageSize}"},HEALTH_TOOL:{CREATE:"health-profile/{type}/create?website_url={website_url}",GET_STATUS:"health-profile/get-status-for-user?website_url={website_url}"}},ve={GET_DOCTOR_INFO:"api/doctors/{doctorId}?site={website_url}",GET_HOSPITAL_INFO:"api/hospital/branch/{hospital_branch_id}?site={website_url}"},xe={BASE_API_PATH:"/",GET_SEARCH_ARTICLES:"search?s={keyword}&page={page}",GET_ALL_CATEGORIES:"categories?type=all",GET_HOMEPAGE_POSTS:"home/trending-post?type={type}",GET_HOMEPAGE_LATEST_POSTS:"articles?page=1&_islatest=1",GET_ARTICLE_DETAIL:"article/{slug}?skip_ids={skipIds}&_isrelated={isRelated}",GET_CATEGORY_DETAIL:"category/{slug}",GET_CATEGORY_OR_ARTICLE_DETAIL:"fetch/{fullSlug}",GET_PREVIEW_ARTICLE:"fetch/{fullSlug}?preview_nonce={nonce}&preview=true",GET_ARTICLE_OF_CATEGORY:"articles?category_id={categoryId}&page={currentPage}",GET_PAGE_STATIC:"page/{slug}",GET_ALL_HEALTH_TOOLS:"healthtools",GET_ALL_MARRYBABY_HEALTH_TOOLS:"health-tools",GET_HEALTH_TOOLS_BY_CATEGORY:"healthtools?_hasgroup=1",GET_AUTHOR:"author/{slug}",GET_ALL_EXPERTS:"experts",GET_ALL_EXPERTS_PAGING:"experts?page={page}",GET_EXPERT:"expert/{slug}",GET_EXPERT_POST:"expert/article?page={page}",POST_ARTICLE_FEEDBACK:"article/feedback/{id}",GET_AZ_DRUGS:"category/a-z/{category}",GET_HOMEPAGE_MEDICAL_REVIEWED:"home/medical-reviewed",GET_ARTICLES_BY_IDS:"articles?ids={ids}",GET_ARTICLE_OF_CATEGORY_NO_EXPLAINERS:"articles?category_id={categoryId}&page={currentPage}&skip_ids={ids}",GET_EXPERT_OF_CATEGORY:"category/expert/?id={id}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info",GET_DUE_DATE_ALL_WEEKS:"health-tools/due-date-calculator/all",GET_DUE_DATE_SUGGESTED_ARTICLES:"health-tools/due-date-calculator/result?from_week={from}&to_week={to}",GET_PROFILE:"user/profile",GET_ADMIN_PROFILE:"GET_ADMIN_PROFILE",GET_FEATURE:"feature",POST_NEW_FEATURE:"feature/update",CREATE_BOOKMARK:"bookmark/create",DELETE_BOOKMARK:"bookmark/delete",DELETE_ALL_BOOKMARK:"bookmark/delete-all",GET_ALL_BOOKMARK:"bookmark",SSO_USER_PROFILE:"user",SSO_USER_BOOKMARKS:"user/bookmarks",SSO_USER_PASSWORD:"user/settings/password",SSO_USER_EMAIL:"user/settings/update-email",SSO_CLOSE_ACCOUNT:"user/settings/close-account",SSO_HELP:"user/settings/help",GET_HEALTH_TOOL_OVULATION_INFO:"health-tools/ovulation-calculator/info",GET_HEALTH_TOOL_OVULATION_SUGGESTED_ARTICLES:"health-tools/ovulation-calculator/result?method={method}",GET_HEALTH_TOOL_BMI_INFO:"health-tools/bmi-calculator/info",GET_HEALTH_TOOL_BMI_RESULT:"health-tools/bmi-calculator/result?gender={gender}&bmi={bmi}&age={age}",GET_HEALTH_TOOL_BMR_INFO:"health-tools/bmr-calculator/info",GET_HEALTH_TOOL_BMR_RESULT:"health-tools/bmr-calculator/result?kcals={kcals}&gender={gender}&age={age}",GET_HEALTH_TOOL_PWG_INFO:"health-tools/preweight-gain-calculator/info",GET_HEALTH_TOOL_THR_INFO:"health-tools/target-heart-rate/info",GET_HEALTH_TOOL_BABY_GROWTH_INFO:"health-tools/baby-growth-tracking/info",POST_UPDATE_LOCATION:"tracking/geo/",GET_SIDIS_DUE_DATE:"frontend/tools/due_date",GET_SIDIS_OVULATION:"frontend/tools/ovulation",GET_SIDIS_BMI:"frontend/tools/bmi",GET_SIDIS_BMR:"frontend/tools/bmr",POST_LOGOUT:"user/logout",OVULATION_CREATE_EVENT:"ovulation/event?method={method}&day={day}&cycle={cycle}&period={period}&token={token}&user_id={user_id}",GET_ALL_SPOTLIGHT:"spotlights?per_page={perPage}&order_by={orderBy}",SSO_UPDATE_FIRST_TIME_BOOKMARK:"bookmark/update-first-time",POST_COMMENT_NOTIFICATION:"comment/notification",GET_ABOUT_US_DATA:"about",POST_LEAD_IMPRESSION:"campaign/{campaignCode}/impression",POST_LEAD_POPUP_EXIT:"campaign/{campaignCode}/popup_exit",POST_LEAD_LEAD:"campaign/{campaignCode}/lead",POST_SSO_VERIFY_TOKEN:"verify-id-token",GET_LANDING_PAGE_FIRST_NODE:"landing_page/bot",GET_LANDING_PAGE_NEXT_NODE:"landing_page/messages",POST_LANDING_PAGE_IMPRESSION:"landing_page/impressions",POST_LANDING_PAGE_CLICK:"landing_page/clicks",FETCH_URL_DATA:"preview",GET_SPOTLIGHT_LANDING:"spotlight/{slug}",GET_FOOTER_INFO:"footer",CHECK_SSO_EMAIL:"member/check-email",GET_HOMEPAGE_SITEWIDE_BANNER:"home/sitewide-banner",GET_DYNAMIC_FOOTER:"menu/footer",GET_EXPERTS:"experts?page={page}&number={perPage}&s={search}",GET_EXPERT_BY_ID:"expert/{id}"},we={SEARCH_USER:"admin/profile/search?website_url={website_url}&name={name}",COMMENT:{IMAGE_UPLOAD:"admin/comment/image/upload?website_url={website_url}"}},ye={locale:"vi-VN",env:{isMarryBaby:!1,togetherBasePath:"/community"},router:{basePath:"",asPath:"/"}},Oe=h({data:ye,action:{pushNotifications:e=>e,sanitizeFunction:e=>e},formatMessage:()=>null});let Ae=ye;const Ie=({locale:e="vi-VN",children:t,userInfo:o,router:r,env:a={isMarryBaby:!1,togetherBasePath:"/community"},sanitizeFunction:i=(e=>e),pushNotifications:n=(()=>!1),formatMessage:s})=>{const[l,c]=g();return Ae={userInfo:o,locale:e,togetherUserId:l,router:r,env:a},_((()=>{(null==o?void 0:o.id)&&ot(Ye(Te.PROFILE,{_locale:e}),"GET").then((e=>{var t;c(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.id)}))}),[null==o?void 0:o.id]),u.createElement(Oe.Provider,{value:{data:{userInfo:o,locale:e,togetherUserId:l,router:r,env:a},action:{pushNotifications:n,sanitizeFunction:i},formatMessage:s}},t)},Le="DD/MM/YYYY",Se="/images/avatar.jpg",Re="/images/default-image.jpg",ke={DUE_DATE:"DUE_DATE",BMI:"BMI",BMR:"BMR",OVULATION:"OVULATION",IFRAME:"IFRAME",PWG:"PWG",THR:"THR",BGC:"BGC"},$e={"id-ID":{"kalkulator-bmi":ke.BMI,"kebutuhan-kalori":ke.BMR,"kalkulator-hari-perkiraan-lahir":ke.DUE_DATE,"kalkulator-masa-subur-2":ke.OVULATION,"kalkulator-kenaikan-berat-badan-ibu-hamil":ke.PWG,"kalkulator-detak-jantung-saat-olahraga":ke.THR},"ms-MY":{"kalkulator-bmi":ke.BMI,"kalkulator-bmr":ke.BMR,"kalkulator-tarikh-bersalin":ke.DUE_DATE,"kalkulator-kesuburan":ke.OVULATION,"kalkulator-tambah-berat-badan-hamil":ke.PWG,"target-heart-rate-calculator":ke.THR},"vi-VN":{"cach-tinh-chi-so-bmi":ke.BMI,"tinh-chi-so-bmr":ke.BMR,"cong-cu-tinh-ngay-du-sinh":ke.DUE_DATE,"tinh-ngay-rung-trung":ke.OVULATION,"cong-cu-tinh-can-nang-khi-mang-thai":ke.PWG,"cong-cu-do-nhip-tim":ke.THR},"zh-TW":{"bmi-calculator":ke.BMI,"bmr-calculator":ke.BMR,"due-date-calculator":ke.DUE_DATE,"ovulation-calculator":ke.OVULATION,"pregnancy-weight-gain-calculator":ke.PWG,"target-heart-rate-calculator":ke.THR},"en-PH":{"bmi-calculator":ke.BMI,"bmr-calculator":ke.BMR,"due-date-calculator":ke.DUE_DATE,"ovulation-calculator":ke.OVULATION,"pregnancy-weight-gain-calculator":ke.PWG,"target-heart-rate-calculator":ke.THR},"th-TH":{"เครื่องคำนวณหา-ค่าดัชนี":ke.BMI,"เครื่องคำนวณอัตราการเผาผลาญพลังงาน-bmr":ke.BMR,"เครื่องมือคำนวณกำหนดคลอด":ke.DUE_DATE,"เครื่องคำนวณการตกไข่-ovulation-calculat":ke.OVULATION,"เครื่องคำนวณน้ำหนักตัว":ke.PWG,"เครื่องวัดอัตราการเต้น":ke.THR},"hi-IN":{"bmi-calculator-en":ke.BMI,"bmi-calculator":ke.BMI,"bmr-calculator":ke.BMR,"delivery-date-calculator":ke.DUE_DATE,"ovulation-calculator":ke.OVULATION,"pregnancy-weight-gain-calculator":ke.PWG,"target-heart-rate-calculator":ke.THR},"km-KH":{"គណនា-bmi":ke.BMI,"គណនា-bmr":ke.BMR,"គណនាថ្ងៃសម្រាលកូន":ke.DUE_DATE,"គណនាថ្ងៃមេជីវិតញីទុំធ្លាក់":ke.OVULATION,"គណនាទម្ងន់ស្ត្រីពពោះ":ke.PWG,"គណនារកចង្វាក់បេះដូងល្អ":ke.THR},"my-MM":{"bmi-calculator":ke.BMI,"bmr-calculator":ke.BMR,"due-date-calendar":ke.DUE_DATE,"ovulation-calculator":ke.OVULATION,"pregnaancy-weight-calculator":ke.PWG,"target-heartrate":ke.THR,"pregnancy-weight-calculator":ke.PWG,"target-heart-rate":ke.THR}},Pe="hhg_user_token",Ne="together_admin_token",Ce={adBlock:48,articleAdContainer:47,headerContainerHome:99,headerContainerPopup:200,headerContainerPopupSUbLevel:300,menuSearchInputPopup:5,menuSearchInputDisplayIcon:6,menuSearchPopup:200},De="hhg-id",Ge={report_scam:{label:"morePopover.report.scam",reportReasonText:"morePopover.report.scam"},report_sex:{label:"morePopover.report.sex",reportReasonText:"morePopover.report.sex"},report_offensive:{label:"morePopover.report.offensive",reportReasonText:"morePopover.report.offensive"},report_violence:{label:"morePopover.report.violence",reportReasonText:"morePopover.report.violence"},report_prohibited:{label:"morePopover.report.prohibited",reportReasonText:"morePopover.report.prohibited"},report_spam:{label:"morePopover.report.spam",reportReasonText:"morePopover.report.spam"},report_falseNews:{label:"morePopover.report.falseNews",reportReasonText:"morePopover.report.falseNews"},report_other:{label:"morePopover.report.other",reportReasonText:"morePopover.report.other"}},Me=20,Ue={"en-PH":{ALL:"all",HOSPITAL:"hospital",SERVICE:"service",DOCTOR:"doctor",SEARCH:"search",SPECIALTIES:"specialties",CURRENT:"current-location"},"vi-VN":{ALL:"tat-ca",HOSPITAL:"benh-vien",SERVICE:"dich-vu",DOCTOR:"bac-si",SEARCH:"tim-kiem",SPECIALTIES:"chuyen-khoa",CURRENT:"vi-tri-hien-tai"},"id-ID":{ALL:"semua",HOSPITAL:"rumah-sakit",SERVICE:"layanan",DOCTOR:"dokter",SEARCH:"cari",SPECIALTIES:"spesialisasi",CURRENT:"posisi-saya-saat-ini"}};var Be=Object.freeze({__proto__:null,POST_DATE_FORMAT:"dd/MM/yyyy",NORMAL_DATE_FORMAT:"YYYY-MM-DD",DUE_DATE_FORMAT:Le,DEFAULT_AVATAR_IMG:Se,DEFAULT_RESULT_IMG:"/images/default.png",DEFAULT_IMG:Re,BMI_LEVELS:["underweight","healthy","overweight","obese_level_1","obese_level_2"],BMR_LEVELS:["low","normal","high"],CORAL_TOKEN_COOKE:"coral_together_user_token",HEALTH_TOOL_TYPE:ke,LOCALE_HEALTH_TOOLS:$e,BEARER_TOKEN_COOKIE:Pe,TOGETHER_DISCLAIMER_COOKIE:"hhg_together_disclaimer",BEARER_ADMIN_TOKEN_COOKIE:Ne,Z_INDEX:Ce,BmrActiveLevels:[{value:"sedentary",icon:"bmr-sedentary",name:"bmr.activeLevel.sedentary",description:"bmr.activeLevel.sedentary.description"},{value:"lightly-active",icon:"bmr-light",name:"bmr.activeLevel.lightlyActive",description:"bmr.activeLevel.lightlyActive.description"},{value:"moderately-active",icon:"bmr-moderately",name:"bmr.activeLevel.moderatelyActive",description:"bmr.activeLevel.moderatelyActive.description"},{value:"intensely-active",icon:"bmr-intensively",name:"bmr.activeLevel.intenselyActive",description:"bmr.activeLevel.intenselyActive.description"},{value:"extremely-active",icon:"bmr-extremely",name:"bmr.activeLevel.extremelyActive",description:"bmr.activeLevel.extremelyActive.description"}],LEAD_CAMPAIGN_CODE:"lmoct7xfr5sv4fv",LEAD_TOKEN_COOKIE:De,GA_TOKEN_COOKIE:"_ga",GOOGLE_CALENDAR_AUTH_CLIENT_ID:"1038242799566-esoq4ij201ve5qfp266nbca44scpo3c6.apps.googleusercontent.com",FIND_CARE_IFRAME_URL:"https://www.appsheet.com/start/4ba34ebe-3cb6-4c16-8dd4-d074025a5bb6#appName=DependentDropdowns-2711103&group=%5B%5D&page=card&sort=%5B%5D&table=Menu&view=Menu",REPORT_REASON_MAP:Ge,MB_SOCIAL_LINKS:{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/marry.baby.vn",INSTAGRAM:"https://www.instagram.com/marrybaby.vn/",TWITTER:"",YOUTUBE:"https://www.youtube.com/channel/UCeZybTkY1VzJ3N7LvPGdKbg",ZALO:"http://zalo.me/806483414530291942"},INTERNAL_ROLES:["admin","moderator","local-admin"],EXTERNAL_ROLES:["ambassador","expert","sponsor","guide","influencer"],INTERNAL_PROFILE_ROLES:["moderator","local-admin"],EXTERNAL_PROFILE_ROLES:["expert","ambassador","sponsor"],RoleDataMap:{moderator:{text:"Moderator",fid:"cardAuthor.moderator",background:"#fe921d"},admin:{text:"Admin",fid:"cardAuthor.admin",background:"#2b62cd"},"local-admin":{text:"Local admin",fid:"cardAuthor.localAdmin",background:"#2b62cd"},expert:{text:"Expert",fid:"cardAuthor.expert",background:"#ff6f4d"},sponsor:{text:"Sponsor",fid:"cardAuthor.sponsor",background:"#00c7e6"},ambassador:{text:"Ambassador",fid:"cardAuthor.ambassador",background:"#00CB8A"}},MAX_IMAGE_UPLOADS:20,LOCALISED_SLUGS:Ue});const He={"vi-VN":"hellobacsi.com","id-ID":"hellosehat.com","ms-MY":"hellodoktor.com","km-KH":"hellokrupet.com","en-PH":"hellodoctor.com.ph","th-TH":"hellokhunmor.com","my-MM":"hellosayarwon.com","zh-TW":"helloyishi.com.tw","hi-IN":"helloswasthya.com"},ze={"vi-VN":"marrybaby.vn"},je=process.env.NEXT_PUBLIC_DEPLOY_LOCALE||"vi-VN",Fe=e=>{const{env:{isMarryBaby:t}}=Ae;return`https://${t?ze[e]:He[e]}`},Ke=e=>{const t=e.indexOf("?");return t>=0?e.slice(0,t+1)+e.slice(t+1).replace(/[^=&]+=(&|$)/g,"").replace(/&$/,""):e},Ve=e=>{const{env:{isMarryBaby:t}}=Ae;if("undefined"!=typeof window)return window.location.origin;const o="staging"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return"development"===process.env.NEXT_PUBLIC_DEPLOY_ENV?"http://localhost:3000":`https://${o?t?"fe.":"discover.":t?"www.":""}${He[e]}`},Ye=(e,t,o,r)=>{let a="";o&&(a=Object.keys(o).map((e=>e+"="+o[e])).join("&"));const{togetherBaseApiUrl:i=""}=(null==Ae?void 0:Ae.env)||{};let n=I(e,Object.assign(Object.assign({},(null==t?void 0:t._locale)?{website_url:Fe(String(t._locale))}:{}),t));n+=`${n.includes("?")?"&":"?"}${a}`;return(r||i)+"api/v1/"+Ke(n)},We=(e,t,o)=>{const{discoverBaseApiUrl:r="",discoverBaseProdApiUrl:a=""}=(null==Ae?void 0:Ae.env)||{};return(!E&&o?a:r)+"wp-json/api/"+Ke(I(e,Object.assign({},t)))},Xe=(e,t,o)=>{const{marryBabyApiUrl:r="",marryBabyProdApiUrl:a=""}=(null==Ae?void 0:Ae.env)||{};return(o&&!E?a:r)+"wp-json/api/"+Ke(I(e,Object.assign({},t)))},qe=(e,t)=>{const{careBaseApiUrl:o=""}=(null==Ae?void 0:Ae.env)||{};return(o||"https://service-health-care.hellohealthgroup.com/")+Ke(I(e,Object.assign({},t)))},Je=(e,t)=>{const{premiumBaseApiUrl:o=""}=(null==Ae?void 0:Ae.env)||{};return(o||"https://premium-content-stag.hellohealthgroup.com/")+Ke(I(e,Object.assign({},t)))},Qe=(e,t)=>{const{publicSSO:o=""}=(null==Ae?void 0:Ae.env)||{};return(o||"https://staging-id.hellobacsi.com/")+"api/"+Ke(I(e,Object.assign({},t)))},Ze=e=>((null==e?void 0:e.data)&&(e.data instanceof FormData?e.body=e.data:"object"==typeof e.data&&(e.body=JSON.stringify(e.data)),delete e.data),e),et=(e,t,o,r=!1)=>T(void 0,void 0,void 0,(function*(){var a,i,n,s;try{const a=yield fetch(r?e:(s=e,encodeURI(s).replace(/%5B/g,"[").replace(/%5D/g,"]")),Object.assign(Object.assign({method:t},Ze(o)),{headers:Object.assign({},null==o?void 0:o.headers)})).then((e=>e.json()));if(a)return a}catch(t){return console.log(t),console.log({url:e,status:null===(a=null==t?void 0:t.response)||void 0===a?void 0:a.status,statusText:null===(i=null==t?void 0:t.response)||void 0===i?void 0:i.statusText}),(null===(n=null==t?void 0:t.response)||void 0===n?void 0:n.data)||null}return null})),tt=(e,t="GET",o,r)=>T(void 0,void 0,void 0,(function*(){var a,i,n,s,l,c;try{const s="string"==typeof e?e:e.url,l="string"==typeof e?e:e.backupUrl,c=fe.parse(r||""),d=c[Pe]||O(Pe);if(!d||!d.length)return et(l||s,t,o);try{const e=yield fetch(s,Object.assign(Object.assign({method:t},Ze(o)),{headers:Object.assign({Authorization:"Bearer "+d},null==o?void 0:o.headers)})).then((e=>e.json()));if(null===(a=null==e?void 0:e.messages)||void 0===a?void 0:a.find((e=>"Unauthenticated"===(null==e?void 0:e.toLowerCase()))))return et(l||s,t,o);if(e)return e}catch(e){return console.log({status:null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.status,statusText:null===(n=null==e?void 0:e.response)||void 0===n?void 0:n.statusText}),et(l||s,t,o)}}catch(e){return console.log({status:null===(s=null==e?void 0:e.response)||void 0===s?void 0:s.status,statusText:null===(l=null==e?void 0:e.response)||void 0===l?void 0:l.statusText}),(null===(c=null==e?void 0:e.response)||void 0===c?void 0:c.data)||null}return null})),ot=(e,t,o,r)=>T(void 0,void 0,void 0,(function*(){try{const a=fe.parse(r||""),i=a[Pe]||O(Pe);if(i&&i.length){const r=yield fetch(e,Object.assign(Object.assign({method:t},Ze(o)),{headers:Object.assign({Authorization:"Bearer "+i},null==o?void 0:o.headers)})).then((e=>e.json()));if(r)return r}}catch(e){return null}return null})),rt=(e,t,o,r)=>T(void 0,void 0,void 0,(function*(){try{const a=fe.parse(r||""),i=a[Ne]||O(Ne);if(i&&i.length){const r=yield fetch(e,Object.assign(Object.assign({method:t},Ze(o)),{headers:Object.assign({Authorization:"Bearer "+i},null==o?void 0:o.headers)})).then((e=>e.json()));if(r)return r}}catch(e){return null}return null}));function at(e,t,o){const r=new RegExp("([?&])"+t+"=.*?(&|$)","i"),a=-1!==e.indexOf("?")?"&":"?";return e.match(r)?e.replace(r,"$1"+t+"="+o+"$2"):e+a+t+"="+o}const it=(e,t,o="/community")=>{const r=e||("undefined"!=typeof window?window.location.href:"/");let a="undefined"!=typeof window?window.location.origin:"";a||e&&(e.startsWith("http://")||e.startsWith("https://"))&&(a=e.split("/").slice(0,3).join("/"));return((e,t)=>{const{publicSSO:o}=Ae.env,r=e||window.location.href;return t&&Object.keys(t).map((e=>{at(r,e,t[e])})),at(r,"source","communities"),o?`${o}?returnUrl=${encodeURIComponent(r.toString())}`:r})(`${a}${o}/on-boarding?return=${encodeURIComponent(r)}`,t)},nt=(e,t,o,r)=>o&&t?`${o}-${t}`:`${A(e||"",{lower:!0,locale:r||je})}-${t}`,st=({name:e,id:t,locale:o})=>{var r;return`/care/${null===(r=Ue[o||"vi-VN"])||void 0===r?void 0:r.DOCTOR}/${nt(e,t)}`},lt=({name:e,id:t,slug:o,locale:r})=>{var a;return`/care/${null===(a=Ue[r||"vi-VN"])||void 0===a?void 0:a.HOSPITAL}/${nt(e,t,o)}`};var ct=v((e=>({root:{},wrapper:{gap:x(8)},groupErr:{fontSize:x(14)},itemRoot:{flexGrow:1,width:"50%",'&[data-checked="true"]':{".mantine-Radio-label":{borderColor:e.fn.primaryColor()}}},itemLabelWrapper:{padding:0,width:"100%"},itemLabel:{position:"relative",padding:`${x(6)} ${x(16)}`,border:`1px solid ${e.colors.gray[2]}`,borderRadius:x(4),cursor:"pointer",'&[data-disabled="true"]':{background:e.colors.gray[1],color:`${e.colors.gray[4]} !important`,img:{opacity:.5}},img:{height:x(26)}},itemInner:{display:"none"}})));export{we as $,Fe as A,Qe as B,R as C,ye as D,ae as E,ie as F,Ae as G,M as H,ne as I,se as J,le as K,W as L,ce as M,et as N,qe as O,V as P,Pe as Q,it as R,pe as S,te as T,Ve as U,ve as V,He as W,lt as X,st as Y,We as Z,xe as _,de as a,rt as a0,Xe as a1,Ce as a2,Re as a3,Me as a4,Se as a5,Ge as a6,tt as a7,ze as a8,fe as a9,je as aa,De as ab,Oe as b,Be as c,Ie as d,L as e,S as f,k as g,$ as h,P as i,N as j,C as k,U as l,B as m,H as n,Y as o,Z as p,J as q,Q as r,oe as s,Le as t,ct as u,ke as v,ot as w,Ye as x,Te as y,Je as z};
|
|
627
|
+
var ue=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var o={},r=(t||{}).decode||_e,a=0;for(;a<e.length;){var i=e.indexOf("=",a);if(-1===i)break;var n=e.indexOf(";",a);if(-1===n)n=e.length;else if(n<i){a=e.lastIndexOf(";",i-1)+1;continue}var s=e.slice(a,i).trim();if(void 0===o[s]){var l=e.slice(i+1,n).trim();34===l.charCodeAt(0)&&(l=l.slice(1,-1)),o[s]=Ee(l,r)}a=n+1}return o},ge=function(e,t,o){var r=o||{},a=r.encode||be;if("function"!=typeof a)throw new TypeError("option encode is invalid");if(!he.test(e))throw new TypeError("argument name is invalid");var i=a(t);if(i&&!he.test(i))throw new TypeError("argument val is invalid");var n=e+"="+i;if(null!=r.maxAge){var s=r.maxAge-0;if(isNaN(s)||!isFinite(s))throw new TypeError("option maxAge is invalid");n+="; Max-Age="+Math.floor(s)}if(r.domain){if(!he.test(r.domain))throw new TypeError("option domain is invalid");n+="; Domain="+r.domain}if(r.path){if(!he.test(r.path))throw new TypeError("option path is invalid");n+="; Path="+r.path}if(r.expires){var l=r.expires;if(!function(e){return"[object Date]"===me.call(e)||e instanceof Date}(l)||isNaN(l.valueOf()))throw new TypeError("option expires is invalid");n+="; Expires="+l.toUTCString()}r.httpOnly&&(n+="; HttpOnly");r.secure&&(n+="; Secure");if(r.priority){switch("string"==typeof r.priority?r.priority.toLowerCase():r.priority){case"low":n+="; Priority=Low";break;case"medium":n+="; Priority=Medium";break;case"high":n+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:n+="; SameSite=Strict";break;case"lax":n+="; SameSite=Lax";break;case"strict":n+="; SameSite=Strict";break;case"none":n+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return n},me=Object.prototype.toString,he=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function _e(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function be(e){return encodeURIComponent(e)}function Ee(e,t){try{return t(e)}catch(t){return e}}var Te={parse:ue,serialize:ge};const fe={BASE_API_PATH:"/",PROFILE:"profile?website_url={website_url}",SEARCH_USER:"profile/search?website_url={website_url}&name={name}",FETCH_PREVIEW:"fetch/preview?website_url={website_url}",FETCH_POST_OR_TOPIC:"fetch/{slug}?website_url={website_url}&community_slug={communitySlug}",POST:{LIST:"post?website_url={website_url}&slug={slug}&pin={pin}&page={page}&community_id={communityId}&topic_id={topicId}&sort_by={sort}&id={id}",DETAIL_BY_ID_OR_SLUG:"post/{idSlug}?website_url={website_url}",CREATE:"post/create?website_url={website_url}",LIKE:"post/{id}/like?website_url={website_url}",DELETE:"post/{id}/delete?website_url={website_url}",REPORT:"post/{id}/report?website_url={website_url}",UPDATE:"post/{id}/update?website_url={website_url}",FOLLOW:"post/{id}/follow?website_url={website_url}",CREATE_ARTICLE_COMMENT:"article-comment/create?website_url={website_url}"},COMMENT:{LIST:"comment?website_url={website_url}&post_id={postId}&page={page}&sort_by={sort}&items_per_page={perPage}&_without_reply={withoutReply}",CREATE:"comment/create?website_url={website_url}",REPLY:"comment/reply?website_url={website_url}",DELETE:"comment/{id}/delete?website_url={website_url}",LIKE:"comment/{id}/like?website_url={website_url}",UNLIKE:"comment/{id}/unlike?website_url={website_url}",IMAGE_UPLOAD:"comment/image/upload?website_url={website_url}"},COMMUNITY:{LIST:"community?website_url={website_url}&page={page}",DETAIL_BY_ID_OR_SLUG:"community/{idSlug}?website_url={website_url}",JOIN:"community/join?website_url={website_url}",LEAVE:"community/leave?website_url={website_url}"},TOPIC:{LIST:"topic?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}&page={page}",DETAIL_BY_ID_OR_SLUG:"topic/{idSlug}?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}",HEALTH_TOOLS:"tools?topic_id={topicId}&website_url={website_url}",SUBOTS:"subots?topic_id={topicId}&website_url={website_url}",SUGGESTED_POSTS:"suggested-posts?topic_id={topicId}&website_url={website_url}&page={page}",JOIN:"topic/join?website_url={website_url}",LEAVE:"topic/leave?website_url={website_url}"},BOOKMARK:{LIST:"bookmark?user_id={userId}&website_url={website_url}",CREATE:"bookmark/create?website_url={website_url}",DELETE:"bookmark/delete?website_url={website_url}"},UPLOAD_IMAGE:"auth/comment/image/upload?website_url={website_url}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info",USER:{DETAIL:"profile/user/detail?website_url={website_url}&user_id={id}",COUNT_TABS:"profile/user/counting?website_url={website_url}&user_id={id}&total_post={post}&total_comment={comment}&total_community={community}&total_reply={reply}&total_question={question}",LIST_POST:"profile/user/posts?website_url={website_url}&user_id={id}&is_anonymous={isAnonymous}&paging=none",LIST_QUESTION_NEED_REPLY:"questions/no-reply?website_url={website_url}",LIST_QUESTION:"question/{id}?website_url={website_url}&is_reply={isReply}&is_question={isQuestion}&is_ignore={isIgnore}&group_by={groupBy}",SKIP_QUESTION:"questions/ignore?website_url={website_url}&question_id={id}",LIST_ANSWERS:"replied/{id}?website_url={website_url}&paging=1&items_per_page={pageSize}"},HEALTH_TOOL:{CREATE:"health-profile/{type}/create?website_url={website_url}",GET_STATUS:"health-profile/get-status-for-user?website_url={website_url}"}},ve={GET_DOCTOR_INFO:"api/doctors/{doctorId}?site={website_url}",GET_HOSPITAL_INFO:"api/hospital/branch/{hospital_branch_id}?site={website_url}"},xe={BASE_API_PATH:"/",GET_SEARCH_ARTICLES:"search?s={keyword}&page={page}",GET_ALL_CATEGORIES:"categories?type=all",GET_HOMEPAGE_POSTS:"home/trending-post?type={type}",GET_HOMEPAGE_LATEST_POSTS:"articles?page=1&_islatest=1",GET_ARTICLE_DETAIL:"article/{slug}?skip_ids={skipIds}&_isrelated={isRelated}",GET_CATEGORY_DETAIL:"category/{slug}",GET_CATEGORY_OR_ARTICLE_DETAIL:"fetch/{fullSlug}",GET_PREVIEW_ARTICLE:"fetch/{fullSlug}?preview_nonce={nonce}&preview=true",GET_ARTICLE_OF_CATEGORY:"articles?category_id={categoryId}&page={currentPage}",GET_PAGE_STATIC:"page/{slug}",GET_ALL_HEALTH_TOOLS:"healthtools",GET_ALL_MARRYBABY_HEALTH_TOOLS:"health-tools",GET_HEALTH_TOOLS_BY_CATEGORY:"healthtools?_hasgroup=1",GET_AUTHOR:"author/{slug}",GET_ALL_EXPERTS:"experts",GET_ALL_EXPERTS_PAGING:"experts?page={page}",GET_EXPERT:"expert/{slug}",GET_EXPERT_POST:"expert/article?page={page}",POST_ARTICLE_FEEDBACK:"article/feedback/{id}",GET_AZ_DRUGS:"category/a-z/{category}",GET_HOMEPAGE_MEDICAL_REVIEWED:"home/medical-reviewed",GET_ARTICLES_BY_IDS:"articles?ids={ids}",GET_ARTICLE_OF_CATEGORY_NO_EXPLAINERS:"articles?category_id={categoryId}&page={currentPage}&skip_ids={ids}",GET_EXPERT_OF_CATEGORY:"category/expert/?id={id}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info",GET_DUE_DATE_ALL_WEEKS:"health-tools/due-date-calculator/all",GET_DUE_DATE_SUGGESTED_ARTICLES:"health-tools/due-date-calculator/result?from_week={from}&to_week={to}",GET_PROFILE:"user/profile",GET_ADMIN_PROFILE:"GET_ADMIN_PROFILE",GET_FEATURE:"feature",POST_NEW_FEATURE:"feature/update",CREATE_BOOKMARK:"bookmark/create",DELETE_BOOKMARK:"bookmark/delete",DELETE_ALL_BOOKMARK:"bookmark/delete-all",GET_ALL_BOOKMARK:"bookmark",SSO_USER_PROFILE:"user",SSO_USER_BOOKMARKS:"user/bookmarks",SSO_USER_PASSWORD:"user/settings/password",SSO_USER_EMAIL:"user/settings/update-email",SSO_CLOSE_ACCOUNT:"user/settings/close-account",SSO_HELP:"user/settings/help",GET_HEALTH_TOOL_OVULATION_INFO:"health-tools/ovulation-calculator/info",GET_HEALTH_TOOL_OVULATION_SUGGESTED_ARTICLES:"health-tools/ovulation-calculator/result?method={method}",GET_HEALTH_TOOL_BMI_INFO:"health-tools/bmi-calculator/info",GET_HEALTH_TOOL_BMI_RESULT:"health-tools/bmi-calculator/result?gender={gender}&bmi={bmi}&age={age}",GET_HEALTH_TOOL_BMR_INFO:"health-tools/bmr-calculator/info",GET_HEALTH_TOOL_BMR_RESULT:"health-tools/bmr-calculator/result?kcals={kcals}&gender={gender}&age={age}",GET_HEALTH_TOOL_PWG_INFO:"health-tools/preweight-gain-calculator/info",GET_HEALTH_TOOL_THR_INFO:"health-tools/target-heart-rate/info",GET_HEALTH_TOOL_BABY_GROWTH_INFO:"health-tools/baby-growth-tracking/info",POST_UPDATE_LOCATION:"tracking/geo/",GET_SIDIS_DUE_DATE:"frontend/tools/due_date",GET_SIDIS_OVULATION:"frontend/tools/ovulation",GET_SIDIS_BMI:"frontend/tools/bmi",GET_SIDIS_BMR:"frontend/tools/bmr",POST_LOGOUT:"user/logout",OVULATION_CREATE_EVENT:"ovulation/event?method={method}&day={day}&cycle={cycle}&period={period}&token={token}&user_id={user_id}",GET_ALL_SPOTLIGHT:"spotlights?per_page={perPage}&order_by={orderBy}",SSO_UPDATE_FIRST_TIME_BOOKMARK:"bookmark/update-first-time",POST_COMMENT_NOTIFICATION:"comment/notification",GET_ABOUT_US_DATA:"about",POST_LEAD_IMPRESSION:"campaign/{campaignCode}/impression",POST_LEAD_POPUP_EXIT:"campaign/{campaignCode}/popup_exit",POST_LEAD_LEAD:"campaign/{campaignCode}/lead",POST_SSO_VERIFY_TOKEN:"verify-id-token",GET_LANDING_PAGE_FIRST_NODE:"landing_page/bot",GET_LANDING_PAGE_NEXT_NODE:"landing_page/messages",POST_LANDING_PAGE_IMPRESSION:"landing_page/impressions",POST_LANDING_PAGE_CLICK:"landing_page/clicks",FETCH_URL_DATA:"preview",GET_SPOTLIGHT_LANDING:"spotlight/{slug}",GET_FOOTER_INFO:"footer",CHECK_SSO_EMAIL:"member/check-email",GET_HOMEPAGE_SITEWIDE_BANNER:"home/sitewide-banner",GET_DYNAMIC_FOOTER:"menu/footer",GET_EXPERTS:"experts?page={page}&number={perPage}&s={search}",GET_EXPERT_BY_ID:"expert/{id}"},we={SEARCH_USER:"admin/profile/search?website_url={website_url}&name={name}",COMMENT:{IMAGE_UPLOAD:"admin/comment/image/upload?website_url={website_url}"}},ye={locale:"vi-VN",env:{isMarryBaby:!1,togetherBasePath:"/community"},router:{basePath:"",asPath:"/"}},Oe=h({data:ye,action:{pushNotifications:e=>e,sanitizeFunction:e=>e},formatMessage:()=>null});let Ae=ye;const Ie=({locale:e="vi-VN",children:t,userInfo:o,router:r,env:a={isMarryBaby:!1,togetherBasePath:"/community"},sanitizeFunction:i=(e=>e),pushNotifications:n=(()=>!1),formatMessage:s})=>{const[l,c]=g();return Ae={userInfo:o,locale:e,togetherUserId:l,router:r,env:a},_((()=>{(null==o?void 0:o.id)&&ot(Ye(fe.PROFILE,{_locale:e}),"GET").then((e=>{var t;c(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.id)}))}),[null==o?void 0:o.id]),u.createElement(Oe.Provider,{value:{data:{userInfo:o,locale:e,togetherUserId:l,router:r,env:a},action:{pushNotifications:n,sanitizeFunction:i},formatMessage:s}},t)},Le="DD/MM/YYYY",Se="/images/avatar.jpg",Re="/images/default-image.jpg",ke={DUE_DATE:"DUE_DATE",BMI:"BMI",BMR:"BMR",OVULATION:"OVULATION",IFRAME:"IFRAME",PWG:"PWG",THR:"THR",BGC:"BGC"},$e={"id-ID":{"kalkulator-bmi":ke.BMI,"kebutuhan-kalori":ke.BMR,"kalkulator-hari-perkiraan-lahir":ke.DUE_DATE,"kalkulator-masa-subur-2":ke.OVULATION,"kalkulator-kenaikan-berat-badan-ibu-hamil":ke.PWG,"kalkulator-detak-jantung-saat-olahraga":ke.THR},"ms-MY":{"kalkulator-bmi":ke.BMI,"kalkulator-bmr":ke.BMR,"kalkulator-tarikh-bersalin":ke.DUE_DATE,"kalkulator-kesuburan":ke.OVULATION,"kalkulator-tambah-berat-badan-hamil":ke.PWG,"target-heart-rate-calculator":ke.THR},"vi-VN":{"cach-tinh-chi-so-bmi":ke.BMI,"tinh-chi-so-bmr":ke.BMR,"cong-cu-tinh-ngay-du-sinh":ke.DUE_DATE,"tinh-ngay-rung-trung":ke.OVULATION,"cong-cu-tinh-can-nang-khi-mang-thai":ke.PWG,"cong-cu-do-nhip-tim":ke.THR},"zh-TW":{"bmi-calculator":ke.BMI,"bmr-calculator":ke.BMR,"due-date-calculator":ke.DUE_DATE,"ovulation-calculator":ke.OVULATION,"pregnancy-weight-gain-calculator":ke.PWG,"target-heart-rate-calculator":ke.THR},"en-PH":{"bmi-calculator":ke.BMI,"bmr-calculator":ke.BMR,"due-date-calculator":ke.DUE_DATE,"ovulation-calculator":ke.OVULATION,"pregnancy-weight-gain-calculator":ke.PWG,"target-heart-rate-calculator":ke.THR},"th-TH":{"เครื่องคำนวณหา-ค่าดัชนี":ke.BMI,"เครื่องคำนวณอัตราการเผาผลาญพลังงาน-bmr":ke.BMR,"เครื่องมือคำนวณกำหนดคลอด":ke.DUE_DATE,"เครื่องคำนวณการตกไข่-ovulation-calculat":ke.OVULATION,"เครื่องคำนวณน้ำหนักตัว":ke.PWG,"เครื่องวัดอัตราการเต้น":ke.THR},"hi-IN":{"bmi-calculator-en":ke.BMI,"bmi-calculator":ke.BMI,"bmr-calculator":ke.BMR,"delivery-date-calculator":ke.DUE_DATE,"ovulation-calculator":ke.OVULATION,"pregnancy-weight-gain-calculator":ke.PWG,"target-heart-rate-calculator":ke.THR},"km-KH":{"គណនា-bmi":ke.BMI,"គណនា-bmr":ke.BMR,"គណនាថ្ងៃសម្រាលកូន":ke.DUE_DATE,"គណនាថ្ងៃមេជីវិតញីទុំធ្លាក់":ke.OVULATION,"គណនាទម្ងន់ស្ត្រីពពោះ":ke.PWG,"គណនារកចង្វាក់បេះដូងល្អ":ke.THR},"my-MM":{"bmi-calculator":ke.BMI,"bmr-calculator":ke.BMR,"due-date-calendar":ke.DUE_DATE,"ovulation-calculator":ke.OVULATION,"pregnaancy-weight-calculator":ke.PWG,"target-heartrate":ke.THR,"pregnancy-weight-calculator":ke.PWG,"target-heart-rate":ke.THR}},Pe="hhg_user_token",Ne="together_admin_token",Ce={adBlock:48,articleAdContainer:47,headerContainerHome:99,headerContainerPopup:200,headerContainerPopupSUbLevel:300,menuSearchInputPopup:5,menuSearchInputDisplayIcon:6,menuSearchPopup:200},De="hhg-id",Ge={report_scam:{label:"morePopover.report.scam",reportReasonText:"morePopover.report.scam"},report_sex:{label:"morePopover.report.sex",reportReasonText:"morePopover.report.sex"},report_offensive:{label:"morePopover.report.offensive",reportReasonText:"morePopover.report.offensive"},report_violence:{label:"morePopover.report.violence",reportReasonText:"morePopover.report.violence"},report_prohibited:{label:"morePopover.report.prohibited",reportReasonText:"morePopover.report.prohibited"},report_spam:{label:"morePopover.report.spam",reportReasonText:"morePopover.report.spam"},report_falseNews:{label:"morePopover.report.falseNews",reportReasonText:"morePopover.report.falseNews"},report_other:{label:"morePopover.report.other",reportReasonText:"morePopover.report.other"}},Me=20,Ue={"en-PH":{ALL:"all",HOSPITAL:"hospital",SERVICE:"service",DOCTOR:"doctor",SEARCH:"search",SPECIALTIES:"specialties",CURRENT:"current-location"},"vi-VN":{ALL:"tat-ca",HOSPITAL:"benh-vien",SERVICE:"dich-vu",DOCTOR:"bac-si",SEARCH:"tim-kiem",SPECIALTIES:"chuyen-khoa",CURRENT:"vi-tri-hien-tai"},"id-ID":{ALL:"semua",HOSPITAL:"rumah-sakit",SERVICE:"layanan",DOCTOR:"dokter",SEARCH:"cari",SPECIALTIES:"spesialisasi",CURRENT:"posisi-saya-saat-ini"}};var Be=Object.freeze({__proto__:null,POST_DATE_FORMAT:"dd/MM/yyyy",NORMAL_DATE_FORMAT:"YYYY-MM-DD",DUE_DATE_FORMAT:Le,DEFAULT_AVATAR_IMG:Se,DEFAULT_RESULT_IMG:"/images/default.png",DEFAULT_IMG:Re,BMI_LEVELS:["underweight","healthy","overweight","obese_level_1","obese_level_2"],BMR_LEVELS:["low","normal","high"],CORAL_TOKEN_COOKE:"coral_together_user_token",HEALTH_TOOL_TYPE:ke,LOCALE_HEALTH_TOOLS:$e,BEARER_TOKEN_COOKIE:Pe,TOGETHER_DISCLAIMER_COOKIE:"hhg_together_disclaimer",BEARER_ADMIN_TOKEN_COOKIE:Ne,Z_INDEX:Ce,BmrActiveLevels:[{value:"sedentary",icon:"bmr-sedentary",name:"bmr.activeLevel.sedentary",description:"bmr.activeLevel.sedentary.description"},{value:"lightly-active",icon:"bmr-light",name:"bmr.activeLevel.lightlyActive",description:"bmr.activeLevel.lightlyActive.description"},{value:"moderately-active",icon:"bmr-moderately",name:"bmr.activeLevel.moderatelyActive",description:"bmr.activeLevel.moderatelyActive.description"},{value:"intensely-active",icon:"bmr-intensively",name:"bmr.activeLevel.intenselyActive",description:"bmr.activeLevel.intenselyActive.description"},{value:"extremely-active",icon:"bmr-extremely",name:"bmr.activeLevel.extremelyActive",description:"bmr.activeLevel.extremelyActive.description"}],LEAD_CAMPAIGN_CODE:"lmoct7xfr5sv4fv",LEAD_TOKEN_COOKIE:De,GA_TOKEN_COOKIE:"_ga",GOOGLE_CALENDAR_AUTH_CLIENT_ID:"1038242799566-esoq4ij201ve5qfp266nbca44scpo3c6.apps.googleusercontent.com",FIND_CARE_IFRAME_URL:"https://www.appsheet.com/start/4ba34ebe-3cb6-4c16-8dd4-d074025a5bb6#appName=DependentDropdowns-2711103&group=%5B%5D&page=card&sort=%5B%5D&table=Menu&view=Menu",REPORT_REASON_MAP:Ge,MB_SOCIAL_LINKS:{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/marry.baby.vn",INSTAGRAM:"https://www.instagram.com/marrybaby.vn/",TWITTER:"",YOUTUBE:"https://www.youtube.com/channel/UCeZybTkY1VzJ3N7LvPGdKbg",ZALO:"http://zalo.me/806483414530291942"},INTERNAL_ROLES:["admin","moderator","local-admin"],EXTERNAL_ROLES:["ambassador","expert","sponsor","guide","influencer"],INTERNAL_PROFILE_ROLES:["moderator","local-admin"],EXTERNAL_PROFILE_ROLES:["expert","ambassador","sponsor"],RoleDataMap:{moderator:{text:"Moderator",fid:"cardAuthor.moderator",background:"#fe921d"},admin:{text:"Admin",fid:"cardAuthor.admin",background:"#2b62cd"},"local-admin":{text:"Local admin",fid:"cardAuthor.localAdmin",background:"#2b62cd"},expert:{text:"Expert",fid:"cardAuthor.expert",background:"#ff6f4d"},sponsor:{text:"Sponsor",fid:"cardAuthor.sponsor",background:"#00c7e6"},ambassador:{text:"Ambassador",fid:"cardAuthor.ambassador",background:"#00CB8A"}},MAX_IMAGE_UPLOADS:20,LOCALISED_SLUGS:Ue});const He={"vi-VN":"hellobacsi.com","id-ID":"hellosehat.com","ms-MY":"hellodoktor.com","km-KH":"hellokrupet.com","en-PH":"hellodoctor.com.ph","th-TH":"hellokhunmor.com","my-MM":"hellosayarwon.com","zh-TW":"helloyishi.com.tw","hi-IN":"helloswasthya.com"},ze={"vi-VN":"marrybaby.vn"},je=process.env.NEXT_PUBLIC_DEPLOY_LOCALE||"vi-VN",Fe=e=>{const{env:{isMarryBaby:t}}=Ae;return`https://${t?ze[e]:He[e]}`},Ke=e=>{const t=e.indexOf("?");return t>=0?e.slice(0,t+1)+e.slice(t+1).replace(/[^=&]+=(&|$)/g,"").replace(/&$/,""):e},Ve=e=>{const{env:{isMarryBaby:t}}=Ae;if("undefined"!=typeof window)return window.location.origin;const o="staging"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return"development"===process.env.NEXT_PUBLIC_DEPLOY_ENV?"http://localhost:3000":`https://${o?t?"fe.":"discover.":t?"www.":""}${He[e]}`},Ye=(e,t,o,r)=>{let a="";o&&(a=Object.keys(o).map((e=>e+"="+o[e])).join("&"));const{togetherBaseApiUrl:i=""}=(null==Ae?void 0:Ae.env)||{};let n=I(e,Object.assign(Object.assign({},(null==t?void 0:t._locale)?{website_url:Fe(String(t._locale))}:{}),t));n+=`${n.includes("?")?"&":"?"}${a}`;return(r||i)+"api/v1/"+Ke(n)},We=(e,t,o)=>{const{discoverBaseApiUrl:r="",discoverBaseProdApiUrl:a=""}=(null==Ae?void 0:Ae.env)||{};return(!E&&o?a:r)+"wp-json/api/"+Ke(I(e,Object.assign({},t)))},Xe=(e,t,o)=>{const{marryBabyApiUrl:r="",marryBabyProdApiUrl:a=""}=(null==Ae?void 0:Ae.env)||{};return(o&&!E?a:r)+"wp-json/api/"+Ke(I(e,Object.assign({},t)))},qe=(e,t)=>{const{careBaseApiUrl:o=""}=(null==Ae?void 0:Ae.env)||{};return(o||"https://service-health-care.hellohealthgroup.com/")+Ke(I(e,Object.assign({},t)))},Je=(e,t)=>{const{premiumBaseApiUrl:o=""}=(null==Ae?void 0:Ae.env)||{};return(o||"https://premium-content-stag.hellohealthgroup.com/")+Ke(I(e,Object.assign({},t)))},Qe=(e,t)=>{const{publicSSO:o=""}=(null==Ae?void 0:Ae.env)||{};return(o||"https://staging-id.hellobacsi.com/")+"api/"+Ke(I(e,Object.assign({},t)))},Ze=e=>((null==e?void 0:e.data)&&(e.data instanceof FormData?e.body=e.data:"object"==typeof e.data&&(e.body=JSON.stringify(e.data)),delete e.data),e),et=(e,t,o,r=!1)=>f(void 0,void 0,void 0,(function*(){var a,i,n,s;try{const a=yield fetch(r?e:(s=e,encodeURI(s).replace(/%5B/g,"[").replace(/%5D/g,"]")),Object.assign(Object.assign({method:t},Ze(o)),{headers:Object.assign({},null==o?void 0:o.headers)})).then((e=>e.json()));if(a)return a}catch(t){return console.log(t),console.log({url:e,status:null===(a=null==t?void 0:t.response)||void 0===a?void 0:a.status,statusText:null===(i=null==t?void 0:t.response)||void 0===i?void 0:i.statusText}),(null===(n=null==t?void 0:t.response)||void 0===n?void 0:n.data)||null}return null})),tt=(e,t="GET",o,r)=>f(void 0,void 0,void 0,(function*(){var a,i,n,s,l,c;try{const s="string"==typeof e?e:e.url,l="string"==typeof e?e:e.backupUrl,c=Te.parse(r||""),d=c[Pe]||O(Pe);if(!d||!d.length)return et(l||s,t,o);try{const e=yield fetch(s,Object.assign(Object.assign({method:t},Ze(o)),{headers:Object.assign({Authorization:"Bearer "+d},null==o?void 0:o.headers)})).then((e=>e.json()));if(null===(a=null==e?void 0:e.messages)||void 0===a?void 0:a.find((e=>"Unauthenticated"===(null==e?void 0:e.toLowerCase()))))return et(l||s,t,o);if(e)return e}catch(e){return console.log({status:null===(i=null==e?void 0:e.response)||void 0===i?void 0:i.status,statusText:null===(n=null==e?void 0:e.response)||void 0===n?void 0:n.statusText}),et(l||s,t,o)}}catch(e){return console.log({status:null===(s=null==e?void 0:e.response)||void 0===s?void 0:s.status,statusText:null===(l=null==e?void 0:e.response)||void 0===l?void 0:l.statusText}),(null===(c=null==e?void 0:e.response)||void 0===c?void 0:c.data)||null}return null})),ot=(e,t,o,r)=>f(void 0,void 0,void 0,(function*(){try{const a=Te.parse(r||""),i=a[Pe]||O(Pe);if(i&&i.length){const r=yield fetch(e,Object.assign(Object.assign({method:t},Ze(o)),{headers:Object.assign({Authorization:"Bearer "+i},null==o?void 0:o.headers)})).then((e=>e.json()));if(r)return r}}catch(e){return null}return null})),rt=(e,t,o,r)=>f(void 0,void 0,void 0,(function*(){try{const a=Te.parse(r||""),i=a[Ne]||O(Ne);if(i&&i.length){const r=yield fetch(e,Object.assign(Object.assign({method:t},Ze(o)),{headers:Object.assign({Authorization:"Bearer "+i},null==o?void 0:o.headers)})).then((e=>e.json()));if(r)return r}}catch(e){return null}return null}));function at(e,t,o){const r=new RegExp("([?&])"+t+"=.*?(&|$)","i"),a=-1!==e.indexOf("?")?"&":"?";return e.match(r)?e.replace(r,"$1"+t+"="+o+"$2"):e+a+t+"="+o}const it=(e,t,o="/community")=>{const r=e||("undefined"!=typeof window?window.location.href:"/");let a="undefined"!=typeof window?window.location.origin:"";a||e&&(e.startsWith("http://")||e.startsWith("https://"))&&(a=e.split("/").slice(0,3).join("/"));return((e,t)=>{const{publicSSO:o}=Ae.env,r=e||window.location.href;return t&&Object.keys(t).map((e=>{at(r,e,t[e])})),at(r,"source","communities"),o?`${o}?returnUrl=${encodeURIComponent(r.toString())}`:r})(`${a}${o}/on-boarding?return=${encodeURIComponent(r)}`,t)},nt=(e,t,o,r)=>o&&t?`${o}-${t}`:`${A(e||"",{lower:!0,locale:r||je})}-${t}`,st=({name:e,id:t,locale:o})=>{var r;return`/care/${null===(r=Ue[o||"vi-VN"])||void 0===r?void 0:r.DOCTOR}/${nt(e,t)}`},lt=({name:e,id:t,slug:o,locale:r})=>{var a;return`/care/${null===(a=Ue[r||"vi-VN"])||void 0===a?void 0:a.HOSPITAL}/${nt(e,t,o)}`};var ct=v((e=>({root:{},wrapper:{gap:x(8)},groupErr:{fontSize:x(14)},itemRoot:{flexGrow:1,width:"50%",'&[data-checked="true"]':{".mantine-Radio-label":{borderColor:e.fn.primaryColor()}}},itemLabelWrapper:{padding:0,width:"100%"},itemLabel:{position:"relative",padding:`${x(6)} ${x(16)}`,border:`1px solid ${e.colors.gray[2]}`,borderRadius:x(4),cursor:"pointer",'&[data-disabled="true"]':{background:e.colors.gray[1],color:`${e.colors.gray[4]} !important`,img:{opacity:.5}},img:{height:x(26)}},itemInner:{display:"none"}})));export{we as $,Fe as A,Qe as B,R as C,ye as D,ae as E,ie as F,Ae as G,M as H,ne as I,se as J,le as K,W as L,ce as M,et as N,qe as O,V as P,Pe as Q,it as R,pe as S,te as T,Ve as U,ve as V,He as W,lt as X,st as Y,We as Z,xe as _,de as a,rt as a0,Xe as a1,Ce as a2,Re as a3,Me as a4,Se as a5,Ge as a6,tt as a7,ze as a8,Te as a9,je as aa,De as ab,Oe as b,Be as c,Ie as d,L as e,S as f,k as g,$ as h,P as i,N as j,C as k,U as l,B as m,H as n,Y as o,Z as p,J as q,Q as r,oe as s,Le as t,ct as u,ke as v,ot as w,Ye as x,fe as y,Je as z};
|
package/build/esm/lead.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as t}from"./tslib.es6-7b491686.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-5ecfac85.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-fa32b4d8.js";import"@linaria/react";import{S as f,d as y,c as k,R as _,P as E,N as w}from"./index-8dfb1724.js";import{H as C}from"./index.styles-95837b62.js";import"./constants-039f36fe.js";import"./Subot-f581f4df.js";import"./utils-8849cc57.js";import{l as N,k as T}from"./screenSizeContext-f9a53919.js";import{D as S}from"./index-1be91706.js";import x from"dayjs";import"styled-components";import{t as O}from"./theme-9d69f1a2.js";import"./index-14839883.js";import"./isProduction-d8d94564.js";import{T as P}from"./translationsContext-a929820e.js";import"string-format";import"@mantine/hooks";import"./index.styled-90fe28c0.js";import"./index-2f243424.js";import"./useCategory-702b6604.js";import{M as B}from"./utils-b2a0d664.js";import"@mantine/dates";import{u as j,G as L}from"./usePlacesAutocomplete-d14c4671.js";import{createFormContext as $}from"@mantine/form";import{u as A}from"./useTranslations-51dc4ab8.js";import{createPortal as I}from"react-dom";import{g as D,s as U}from"./cookieHelper-1491c7ea.js";import"date-fns/locale";import"@mantine/carousel";import"classnames";import"react-keyed-flatten-children";import"slugify";import"lodash/throttle";const R=1,H=2;let M="https://dev.leadgen.hellobacsi.com/";const F=1,W=2;let V="";M.includes("localhost")&&(M="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(V="pink");let q="https://"+location.hostname+location.pathname+location.search;q=q.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));const J={"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}},Y=J[document.documentElement.lang]||J["vi-VN"];const z={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 G={"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 K={"en-PH":G,"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":G},Q=e=>{const t=K[e];return t||K["en-PH"]},X=l({}),Z=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}},ee=({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"}))),te=({popupId:e,url:t,newTab:l,imageDestkop:n,imageMobile:o,onClose:i,onOtherSubmit:r})=>{const{width:s,height:d,loaded:c}=Z(o),{width:m,height:u,loaded:p}=Z(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(ee,{onClose:i,containerClassName:"close-button-top-right"})))):null},ae=({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}=Z(c),{width:v,height:b,loaded:f}=Z(d);return g&&f?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(ee,{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(ee,{onClose:m,containerClassName:"close-button-top-right"}))))):null};const le=new class{constructor(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},ne={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(`${le.apiLeadUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},oe={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(`${le.apiSubotUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},ie=({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),oe.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},re=({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),ne.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},se=({phone:e,type:t})=>ne.call({url:"phone"===t?"api/sms/otp":"api/sms/whatsapp_otp",method:"post",data:{phone_number:"phone"===t?e.replace("+",""):e}}),de=({phone:e,otp:t,type:a})=>ne.call({url:"phone"===a?"api/sms/verify":"api/sms/whatsapp_verify",method:"post",data:{otp_code:t,phone_number:"phone"===a?e.replace("+",""):e}}),ce={email:{},phone:{}},me=(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(ce[n][o]){if(ce[n][o].value)return i;if(!ce[n][o].value&&ce[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 re({campaign_id:[e],[t]:n});return"SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode||a.length&&"CheckSuBotLeadTool_ERR_001"===(yield ie({bot_id:a,[t]:n}))._errorCode?o:void 0})))(e,a,l);return ce[n][o]=r?{value:!0}:{value:!1,expire:Date.now()+6e4},r})),[ue,pe,he]=$(),ge=["places"],ve=({name:e,placeholder:t,locale:l})=>{var s;const d=pe(),[c,m]=n(""),[u,p]=n(""),{predictions:h}=j(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:L,libraries:ge,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}})},be=({children:e,align:t})=>a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${V}`},e),fe=({children:e,align:t})=>a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${V}`},e),ye=({listBlockAdded:e,popupId:t,locale:l,onClose:n,onOtherSubmit:o})=>{const i=pe();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(be,{key:r,align:p},u);case"TextBlock":return a.createElement(k,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(w,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(k,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(k.Wrapper,Object.assign({size:"md",withAsterisk:!0,key:r,label:c,className:"lead-modal__form-control",labelProps:{htmlFor:e}},i.getInputProps(u)),a.createElement(E,{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(ve,{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 ${V}`,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(y.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(y,{name:u,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})))));case"RadioBlock":return a.createElement(a.Fragment,null,g&&a.createElement(k,{type:"hidden",name:u+"-mailchimp",value:g}),a.createElement(_.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(_,{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(y,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})))},ke=({otpData:e,onSuccess:l,autoSendWhenOpen:i})=>{const{t:s}=A(),d=e.phone,c=e.type,[u,p]=n(""),[h,g]=n(!1),[v,f]=n(i?0:60),y=r(null),[_,E]=n(),[w,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 se({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((()=>{y.current&&(y.current.focus(),y.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===a?l():E(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 de({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():E(t||"something Wrong"),x(!1)}))},className:"lead-phone-otp-form"},a.createElement(C,{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:w})),a.createElement(k,{ref:y,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),E(h&&!e?"OTP is required":void 0)},error:h?_:void 0}),a.createElement(m,{size:"md",color:"primary",className:`lead-modal__btn ${V}`,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 ${V}`,onClick:()=>{P()},disabled:!!v},s("lead.otp.resend",{timer:v?` (${v}s)`:""}))))},_e=({title:e,titleAlign:t,subtitle:l,subtitleAlign:n,link:o,linkNewTab:i,linkText:r,image:s})=>{const{width:d,height:c,loaded:m}=Z(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 ${V}`},r))))):null},Ee=({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?I(e,a):null},we=({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=>I(e,N(t,"sidebar-lead-modal-wrapper")))))},Ce=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:s,imageMobile:d,imageDesktop:c,imageOverlayMobile:p,imageOverlayDesktop:h,imageBackground:g,currentLayout:v,title:b,onSubmit:f,showThankyou:y,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,L=location.pathname,$=v.includes("Inline")||"Sidebar"===v,I="Slider"===v,[D,U]=n(!0),[R,H]=n(null),[M,F]=n(!1),W=r(),q=()=>{R?H(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"),ce.email={},ce.phone={}}),[]);const J=r(!1),z=r(!1),{form:G,validateObj:K}=(({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:n=[]})=>{const{t:o}=A(),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..."),me(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),Y.countryCode))return o("validator.phone");t.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),me(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=he({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:s}),c=r(d);return c.current=d,{form:d,validateObj:s}})({listBlockAdded:T,validatingPhoneRef:J,validatingEmailRef:z,campaignId:k,campaign_subot_id:_}),{width:Q,height:X,loaded:te}=Z(g),{width:ae,height:le,loaded:ne}=Z(d),{width:oe,height:ie,loaded:re}=Z(c),de=ne&&re&&("Fullscreen"!=v||te),pe=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":L,"data-popup-type":"lightbox-inline",className:`lead-modal lead-modal-wrapper modal--animate-scale ${$?"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:`${Q}/${X}`}}):null,a.createElement("div",{className:`lead-modal__wrapper le-newbuilder-wrap-${v}`},a.createElement("div",{className:`lead-modal__content le-newbuilder-${v}`},y?a.createElement(_e,{title:y.title,titleAlign:y.titleAlign,subtitle:y.subtitle,subtitleAlign:y.subtitleAlign,link:y.link,linkNewTab:y.linkNewTab,linkText:y.linkText,image:y.image}):a.createElement(a.Fragment,null,a.createElement("header",{className:"lead-modal__header"},R?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}/${ie}`},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))),R&&a.createElement(ke,{otpData:R,autoSendWhenOpen:!1,onSuccess:()=>{H(null),null==f||f(W.current,G.values)}}),a.createElement("div",{"data-hidden":!!R,className:"lead-modal__body le-newbuilder-overlay"},a.createElement(ue,{form:G},a.createElement("form",{ref:W,className:`lead-modal__form ${e}`,onSubmit:e=>{e.preventDefault(),G.setTouched(Object.keys(K).reduce(((e,t)=>(e[t]=!0,e)),{})),z.current||J.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 se(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])?H(r):null==f||f(W.current,e)})).finally((()=>{F(!1)}));null==f||f(W.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)} ${V}`},b),a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(null===(C=x.titleBlock.data)||void 0===C?void 0:C.align)} ${V}`},x.subtitleBlock.data.value)),a.createElement("div",{className:"lead-modal__form-control-wrapper"},a.createElement(ye,{listBlockAdded:T,popupId:e,locale:E,onClose:q,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 ${V}`},a.createElement("div",{className:"lead-modal__checkbox"},a.createElement("input",{id:"lead-term-checkbox",className:`lead-modal__checkbox__input ${V}`,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 ${V}`,disabled:!D,isLoading:M},j))))))),!v.includes("Inline")&&a.createElement(ee,{onClose:q,containerClassName:"close-button-top-right"}))));return de?v.includes("LightBox")||"Fullscreen"==v||"Slider"==v?pe:"Sidebar"==v?a.createElement(we,{content:pe}):v.includes("Inline")?a.createElement(Ee,{content:pe,inlinePosition:t.popupInlinePosition}):null:null},Ne=({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}=Z(i),{width:h,height:g,loaded:v}=Z(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(ee,{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(ee,{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(ee,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:o}))))):null},Te=({popupId:e,url:t,newTab:l,image:n,onClose:o,onOtherSubmit:i})=>{const{width:r,height:s,loaded:d}=Z(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(ee,{onClose:o,containerClassName:"close-button-top-right"})))):null},Se=[],xe=[],Oe=[],Pe=[],Be=[],je=[];const Le=(e="UTC")=>{const t=new Date;return new Date(t.toLocaleString("en-US",{timeZone:e}))},$e=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 Ae=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||(Pe.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))||(Be.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=$e(a),o=$e(l);if(!n||!o)return!0;const i=(null===(t=e.site)||void 0===t?void 0:t.id)||1;return!(Le(z[i]).getTime()>o.getTime()&&(Oe.push(e),1))}(e):0===e.formatted_status&&(Se.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=$e(l),i=$e(n);if(!o||!i)return!1;const r=Le(z[a]).getTime();return r<=i.getTime()&&r>=o.getTime()&&(xe.push(e),!0)})(e)))),Ie=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)||(je.push(e),!1))}catch(e){return!0}};let De=null;function Ue({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:D("_ga")||null})}).then((e=>e.json())).then((e=>{var t,n,i,r;if(Re("List campagin: ",e),q="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(Ae))||[]).filter(Ie);D("hhg-id")||(U("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==F)))):s.filter((e=>e.device_types.some((e=>e.id==W)))),Re("👓 campaignsDevice",d),Re("--listCampaignScheduled",Se),Re("--listCampaignScheduledToActivated",xe),Re("--listCampaignActiveButExpired",Oe),Re("--listCampaignExcludeSonsored",Pe),Re("--listCampaignDifferentSponsor",Be),Re("--listCampaignNotDisplayInRangeOfTime",je);let m=d.map(((e,t)=>e.targets.filter((e=>e.type==R)).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==H)).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 f=v.filter((e=>e.includes("lead_closed")));Re("--listCampaignCodeClosed",f);const y=[...b,...f],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=>!y.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"),De&&clearTimeout(De),De=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 He=({campaign:e,action:t,onSubmit:l,onClose:n,showThankyou:i,locale:d})=>{var m,u;const{apiUrl:p,siteDomain:h}=s(X);o((()=>{const e=D("_ga")||null;fetch(`${p}api/campaign/${f}/impression`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,url:location.href.toLowerCase(),title_article:document.title,cookie_id:D("hhg-id"),ga_client_id:e})})}),[]);const{extra_fields:g,image:v,image_desktop:b,code:f,image_background:y,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!"),U(`lead_submited_${f}`,`target_${g.popupVersion}`,{domain:"."+h,path:"/"})),1==r&&(Re(`⌛ Popup will show again after ${i} days!`),U(`lead_submited_${f}`,`target_${g.popupVersion}`,{domain:"."+h,days:i,path:"/"}));const s=D("_ga")||null,d={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:D("hhg-id"),ga_client_id:s};O&&(d.category=S[O].value_en),fetch(`${p}api/campaign/${f}/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(te,{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(Te,{popupId:x.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,image:v,onClose:n,onOtherSubmit:P}):"Floating"===E?a.createElement(ae,{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(Ce,{popupId:x.current,extraFields:g,onClose:n,onOtherSubmit:P,imageMobile:v,imageDesktop:b,imageBackground:y,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(Ne,{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},Me=({apiUrl:e,siteDomain:l,siteId:s,locale:c,apiSubotUrl:m,DEBUG_URL:u})=>{var b;const f=r(),y=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((()=>{le.apiLeadUrl=k,le.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&&U(`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:D("hhg-id"),duration:Math.ceil((Date.now()-y.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"),Ue({leadApi:k,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:u})),f.current&&window.removeEventListener("scroll",f.current)}),500);window.next.router.events.on("routeChangeComplete",e)}Ue({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=D("_ga")||null;window.intlTelInputUtils||(yield require("intl-tel-input/build/js/utils"));const f={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==Y?void 0:Y.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:D("hhg-id"),ga_client_id:b};n&&o[n].value_en&&(f.category=o[n].value_en);const y=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!"),U(`lead_submited_${_.code}`,`target_${null==_?void 0:_.extra_fields.targetType}`,{domain:"."+l,path:"/"})),1==E&&(Re(`⌛ Popup will show again after ${y} days!`),U(`lead_submited_${_.code}`,`target_${null==_?void 0:_.extra_fields.targetType}`,{domain:"."+l,days:y,path:"/"})),fetch(`${k}api/campaign/${_.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}),"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((()=>{_&&(y.current=Date.now())}),[_]),a.createElement(X.Provider,{value:{apiUrl:k,siteDomain:l,siteId:s,locale:c}},a.createElement(P.Provider,{value:{locale:c,values:Q(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(He,{campaign:_,action:w,onSubmit:j,onClose:B,showThankyou:N,locale:c})))}))))))};export{Me as LeadGen};
|
|
1
|
+
import{_ as e,a as t}from"./tslib.es6-98b62e2b.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-ad6cd88d.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-8118170d.js";import"@linaria/react";import{S as f,d as y,c as k,R as _,P as E,N as w}from"./index-bed044a7.js";import{H as C}from"./index.styles-874ee5cd.js";import"./constants-fe146bd1.js";import"./Subot-36ac5f94.js";import"./utils-ab72b62f.js";import{l as N,k as T}from"./screenSizeContext-c38ade0a.js";import{D as S}from"./index-70655f2a.js";import x from"dayjs";import"styled-components";import{t as O}from"./theme-57e98706.js";import"./index-27df5763.js";import"./isProduction-f464a698.js";import{T as P}from"./translationsContext-b6ff3279.js";import"string-format";import"@mantine/hooks";import"./index.styled-6252f77a.js";import"./index-0e3fc8b7.js";import"./useCategory-440b7f9a.js";import{M as B}from"./utils-1e95a4d1.js";import"@mantine/dates";import{u as j,G as L}from"./usePlacesAutocomplete-8e10c310.js";import{createFormContext as $}from"@mantine/form";import{u as A}from"./useTranslations-6b1653a2.js";import{createPortal as I}from"react-dom";import{g as D,s as U}from"./cookieHelper-bf1be72d.js";import"date-fns/locale";import"@mantine/carousel";import"classnames";import"react-keyed-flatten-children";import"slugify";import"lodash/throttle";const R=1,H=2;let M="https://dev.leadgen.hellobacsi.com/";const F=1,W=2;let V="";M.includes("localhost")&&(M="https://dev.leadgen.hellobacsi.com/"),location.hostname.includes("marrybaby.vn")&&(V="pink");let q="https://"+location.hostname+location.pathname+location.search;q=q.toLowerCase(),sessionStorage.getItem("insider_object")&&(window.insider_object=JSON.parse(sessionStorage.getItem("insider_object")));const J={"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}},Y=J[document.documentElement.lang]||J["vi-VN"];const z={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 G={"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 K={"en-PH":G,"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":G},Q=e=>{const t=K[e];return t||K["en-PH"]},X=l({}),Z=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}},ee=({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"}))),te=({popupId:e,url:t,newTab:l,imageDestkop:n,imageMobile:o,onClose:i,onOtherSubmit:r})=>{const{width:s,height:d,loaded:c}=Z(o),{width:m,height:u,loaded:p}=Z(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(ee,{onClose:i,containerClassName:"close-button-top-right"})))):null},ae=({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}=Z(c),{width:v,height:b,loaded:f}=Z(d);return g&&f?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(ee,{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(ee,{onClose:m,containerClassName:"close-button-top-right"}))))):null};const le=new class{constructor(){this.apiLeadUrl="https://dev.leadgen.hellobacsi.com/",this.apiSubotUrl="https://staging-service-subot.hellohealthgroup.com/"}},ne={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(`${le.apiLeadUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},oe={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(`${le.apiSubotUrl}${a}`,n).then((e=>e.json())).catch((()=>({})))}},ie=({bot_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),oe.call({url:"frontend/api/subot-campaign/check",method:"post",data:{bot_id:e,email:t,phone:l}})},re=({campaign_id:e,email:t,phone:a})=>{let l=a;return l&&l.startsWith("0")&&(l=l.substring(1)),ne.call({url:"api/subot-campaign/check",method:"post",data:{campaign_id:e,email:t,phone:l}})},se=({phone:e,type:t})=>ne.call({url:"phone"===t?"api/sms/otp":"api/sms/whatsapp_otp",method:"post",data:{phone_number:"phone"===t?e.replace("+",""):e}}),de=({phone:e,otp:t,type:a})=>ne.call({url:"phone"===a?"api/sms/verify":"api/sms/whatsapp_verify",method:"post",data:{otp_code:t,phone_number:"phone"===a?e.replace("+",""):e}}),ce={email:{},phone:{}},me=(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(ce[n][o]){if(ce[n][o].value)return i;if(!ce[n][o].value&&ce[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 re({campaign_id:[e],[t]:n});return"SubmitLeadWithBotId_ERR_001"===i._errorCode||"SubmitLeadWithBotId_ERR_002"===i._errorCode||a.length&&"CheckSuBotLeadTool_ERR_001"===(yield ie({bot_id:a,[t]:n}))._errorCode?o:void 0})))(e,a,l);return ce[n][o]=r?{value:!0}:{value:!1,expire:Date.now()+6e4},r})),[ue,pe,he]=$(),ge=["places"],ve=({name:e,placeholder:t,locale:l})=>{var s;const d=pe(),[c,m]=n(""),[u,p]=n(""),{predictions:h}=j(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:L,libraries:ge,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}})},be=({children:e,align:t})=>a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(t||"")} ${V}`},e),fe=({children:e,align:t})=>a.createElement("h2",{className:`lead-modal__title ${"le-text-align-"+(t||"")} ${V}`},e),ye=({listBlockAdded:e,popupId:t,locale:l,onClose:n,onOtherSubmit:o})=>{const i=pe();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(be,{key:r,align:p},u);case"TextBlock":return a.createElement(k,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(w,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(k,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(k.Wrapper,Object.assign({size:"md",withAsterisk:!0,key:r,label:c,className:"lead-modal__form-control",labelProps:{htmlFor:e}},i.getInputProps(u)),a.createElement(E,{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(ve,{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 ${V}`,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(y.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(y,{name:u,key:t,value:e.value,label:e.placeholder,"data-control":"checkbox"})))));case"RadioBlock":return a.createElement(a.Fragment,null,g&&a.createElement(k,{type:"hidden",name:u+"-mailchimp",value:g}),a.createElement(_.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(_,{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(y,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})))},ke=({otpData:e,onSuccess:l,autoSendWhenOpen:i})=>{const{t:s}=A(),d=e.phone,c=e.type,[u,p]=n(""),[h,g]=n(!1),[v,f]=n(i?0:60),y=r(null),[_,E]=n(),[w,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 se({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((()=>{y.current&&(y.current.focus(),y.current.scrollIntoView({block:"center"}))}),100)):"This phone number was verified"===a?l():E(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 de({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():E(t||"something Wrong"),x(!1)}))},className:"lead-phone-otp-form"},a.createElement(C,{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:w})),a.createElement(k,{ref:y,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),E(h&&!e?"OTP is required":void 0)},error:h?_:void 0}),a.createElement(m,{size:"md",color:"primary",className:`lead-modal__btn ${V}`,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 ${V}`,onClick:()=>{P()},disabled:!!v},s("lead.otp.resend",{timer:v?` (${v}s)`:""}))))},_e=({title:e,titleAlign:t,subtitle:l,subtitleAlign:n,link:o,linkNewTab:i,linkText:r,image:s})=>{const{width:d,height:c,loaded:m}=Z(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 ${V}`},r))))):null},Ee=({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?I(e,a):null},we=({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=>I(e,N(t,"sidebar-lead-modal-wrapper")))))},Ce=({popupId:e,extraFields:t,onClose:l,onOtherSubmit:s,imageMobile:d,imageDesktop:c,imageOverlayMobile:p,imageOverlayDesktop:h,imageBackground:g,currentLayout:v,title:b,onSubmit:f,showThankyou:y,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,L=location.pathname,$=v.includes("Inline")||"Sidebar"===v,I="Slider"===v,[D,U]=n(!0),[R,H]=n(null),[M,F]=n(!1),W=r(),q=()=>{R?H(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"),ce.email={},ce.phone={}}),[]);const J=r(!1),z=r(!1),{form:G,validateObj:K}=(({listBlockAdded:e=[],validatingPhoneRef:t,validatingEmailRef:a,campaignId:l,campaign_subot_id:n=[]})=>{const{t:o}=A(),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..."),me(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),Y.countryCode))return o("validator.phone");t.current=!0,setTimeout((()=>{c.current.setFieldError(i.data.value,"Validating..."),me(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=he({validateInputOnChange:!0,clearInputErrorOnChange:!0,validate:s}),c=r(d);return c.current=d,{form:d,validateObj:s}})({listBlockAdded:T,validatingPhoneRef:J,validatingEmailRef:z,campaignId:k,campaign_subot_id:_}),{width:Q,height:X,loaded:te}=Z(g),{width:ae,height:le,loaded:ne}=Z(d),{width:oe,height:ie,loaded:re}=Z(c),de=ne&&re&&("Fullscreen"!=v||te),pe=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":L,"data-popup-type":"lightbox-inline",className:`lead-modal lead-modal-wrapper modal--animate-scale ${$?"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:`${Q}/${X}`}}):null,a.createElement("div",{className:`lead-modal__wrapper le-newbuilder-wrap-${v}`},a.createElement("div",{className:`lead-modal__content le-newbuilder-${v}`},y?a.createElement(_e,{title:y.title,titleAlign:y.titleAlign,subtitle:y.subtitle,subtitleAlign:y.subtitleAlign,link:y.link,linkNewTab:y.linkNewTab,linkText:y.linkText,image:y.image}):a.createElement(a.Fragment,null,a.createElement("header",{className:"lead-modal__header"},R?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}/${ie}`},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))),R&&a.createElement(ke,{otpData:R,autoSendWhenOpen:!1,onSuccess:()=>{H(null),null==f||f(W.current,G.values)}}),a.createElement("div",{"data-hidden":!!R,className:"lead-modal__body le-newbuilder-overlay"},a.createElement(ue,{form:G},a.createElement("form",{ref:W,className:`lead-modal__form ${e}`,onSubmit:e=>{e.preventDefault(),G.setTouched(Object.keys(K).reduce(((e,t)=>(e[t]=!0,e)),{})),z.current||J.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 se(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])?H(r):null==f||f(W.current,e)})).finally((()=>{F(!1)}));null==f||f(W.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)} ${V}`},b),a.createElement("p",{className:`lead-modal__description ${"le-text-align-"+(null===(C=x.titleBlock.data)||void 0===C?void 0:C.align)} ${V}`},x.subtitleBlock.data.value)),a.createElement("div",{className:"lead-modal__form-control-wrapper"},a.createElement(ye,{listBlockAdded:T,popupId:e,locale:E,onClose:q,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 ${V}`},a.createElement("div",{className:"lead-modal__checkbox"},a.createElement("input",{id:"lead-term-checkbox",className:`lead-modal__checkbox__input ${V}`,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 ${V}`,disabled:!D,isLoading:M},j))))))),!v.includes("Inline")&&a.createElement(ee,{onClose:q,containerClassName:"close-button-top-right"}))));return de?v.includes("LightBox")||"Fullscreen"==v||"Slider"==v?pe:"Sidebar"==v?a.createElement(we,{content:pe}):v.includes("Inline")?a.createElement(Ee,{content:pe,inlinePosition:t.popupInlinePosition}):null:null},Ne=({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}=Z(i),{width:h,height:g,loaded:v}=Z(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(ee,{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(ee,{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(ee,{containerClassName:"close-button-top-right",svgClassName:"le-mobile-btn",onClose:o}))))):null},Te=({popupId:e,url:t,newTab:l,image:n,onClose:o,onOtherSubmit:i})=>{const{width:r,height:s,loaded:d}=Z(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(ee,{onClose:o,containerClassName:"close-button-top-right"})))):null},Se=[],xe=[],Oe=[],Pe=[],Be=[],je=[];const Le=(e="UTC")=>{const t=new Date;return new Date(t.toLocaleString("en-US",{timeZone:e}))},$e=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 Ae=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||(Pe.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))||(Be.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=$e(a),o=$e(l);if(!n||!o)return!0;const i=(null===(t=e.site)||void 0===t?void 0:t.id)||1;return!(Le(z[i]).getTime()>o.getTime()&&(Oe.push(e),1))}(e):0===e.formatted_status&&(Se.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=$e(l),i=$e(n);if(!o||!i)return!1;const r=Le(z[a]).getTime();return r<=i.getTime()&&r>=o.getTime()&&(xe.push(e),!0)})(e)))),Ie=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)||(je.push(e),!1))}catch(e){return!0}};let De=null;function Ue({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:D("_ga")||null})}).then((e=>e.json())).then((e=>{var t,n,i,r;if(Re("List campagin: ",e),q="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(Ae))||[]).filter(Ie);D("hhg-id")||(U("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==F)))):s.filter((e=>e.device_types.some((e=>e.id==W)))),Re("👓 campaignsDevice",d),Re("--listCampaignScheduled",Se),Re("--listCampaignScheduledToActivated",xe),Re("--listCampaignActiveButExpired",Oe),Re("--listCampaignExcludeSonsored",Pe),Re("--listCampaignDifferentSponsor",Be),Re("--listCampaignNotDisplayInRangeOfTime",je);let m=d.map(((e,t)=>e.targets.filter((e=>e.type==R)).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==H)).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 f=v.filter((e=>e.includes("lead_closed")));Re("--listCampaignCodeClosed",f);const y=[...b,...f],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=>!y.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"),De&&clearTimeout(De),De=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 He=({campaign:e,action:t,onSubmit:l,onClose:n,showThankyou:i,locale:d})=>{var m,u;const{apiUrl:p,siteDomain:h}=s(X);o((()=>{const e=D("_ga")||null;fetch(`${p}api/campaign/${f}/impression`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,url:location.href.toLowerCase(),title_article:document.title,cookie_id:D("hhg-id"),ga_client_id:e})})}),[]);const{extra_fields:g,image:v,image_desktop:b,code:f,image_background:y,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!"),U(`lead_submited_${f}`,`target_${g.popupVersion}`,{domain:"."+h,path:"/"})),1==r&&(Re(`⌛ Popup will show again after ${i} days!`),U(`lead_submited_${f}`,`target_${g.popupVersion}`,{domain:"."+h,days:i,path:"/"}));const s=D("_ga")||null,d={url:location.href.toLowerCase(),title_article:document.title,meta:[],cookie_id:D("hhg-id"),ga_client_id:s};O&&(d.category=S[O].value_en),fetch(`${p}api/campaign/${f}/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(te,{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(Te,{popupId:x.current,url:w.imageMobile.data.url,newTab:w.imageMobile.data.newtab,image:v,onClose:n,onOtherSubmit:P}):"Floating"===E?a.createElement(ae,{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(Ce,{popupId:x.current,extraFields:g,onClose:n,onOtherSubmit:P,imageMobile:v,imageDesktop:b,imageBackground:y,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(Ne,{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},Me=({apiUrl:e,siteDomain:l,siteId:s,locale:c,apiSubotUrl:m,DEBUG_URL:u})=>{var b;const f=r(),y=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((()=>{le.apiLeadUrl=k,le.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&&U(`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:D("hhg-id"),duration:Math.ceil((Date.now()-y.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"),Ue({leadApi:k,leadDomain:l,leadSiteId:s,onShowPopup:O,DEBUG_URL:u})),f.current&&window.removeEventListener("scroll",f.current)}),500);window.next.router.events.on("routeChangeComplete",e)}Ue({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=D("_ga")||null;window.intlTelInputUtils||(yield require("intl-tel-input/build/js/utils"));const f={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==Y?void 0:Y.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:D("hhg-id"),ga_client_id:b};n&&o[n].value_en&&(f.category=o[n].value_en);const y=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!"),U(`lead_submited_${_.code}`,`target_${null==_?void 0:_.extra_fields.targetType}`,{domain:"."+l,path:"/"})),1==E&&(Re(`⌛ Popup will show again after ${y} days!`),U(`lead_submited_${_.code}`,`target_${null==_?void 0:_.extra_fields.targetType}`,{domain:"."+l,days:y,path:"/"})),fetch(`${k}api/campaign/${_.code}/lead`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}),"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((()=>{_&&(y.current=Date.now())}),[_]),a.createElement(X.Provider,{value:{apiUrl:k,siteDomain:l,siteId:s,locale:c}},a.createElement(P.Provider,{value:{locale:c,values:Q(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(He,{campaign:_,action:w,onSubmit:j,onClose:B,showThankyou:N,locale:c})))}))))))};export{Me as LeadGen};
|
package/build/esm/mantine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as u,l as f,m as x}from"./index-
|
|
1
|
+
import{k as u,l as f,m as x}from"./index-bed044a7.js";export{o as Accordion,A as Anchor,b as AspectRatio,a as Avatar,n as Breadcrumbs,B as Button,p as Carousel,i 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-bed044a7.js";export{D as DatePicker}from"./index-70655f2a.js";import{T as h}from"./index-8118170d.js";export{O as OTHER_THEME_CONFIG,T as Text}from"./index-8118170d.js";export{I as Indicator}from"./index-68094777.js";import g,{useMemo as j}from"react";export{M as Modal}from"./index-d51eb02e.js";import{_ as v}from"./tslib.es6-98b62e2b.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-57e98706.js";import{u as _}from"./useTranslations-6b1653a2.js";export{S as Slider}from"./index-fc00d32b.js";export{S as Switch}from"./index-bc94a926.js";import"@mantine/hooks";import"./gAssets.js";import"./index-27df5763.js";import"date-fns/locale";import"./Subot-36ac5f94.js";import"./isProduction-f464a698.js";import"dayjs";import"./screenSizeContext-c38ade0a.js";import"styled-components";import"lodash/throttle";import"@mantine/carousel";import"classnames";import"@mantine/dates";import"./translationsContext-b6ff3279.js";import"string-format";import"./index-ad6cd88d.js";const F=e=>g.createElement(u,Object.assign({minRows:2,maxRows:4},e)),G=e=>{var{color:t=z.colors.primaryBase,styles:a}=e,s=v(e,["color","styles"]);return g.createElement(E,Object.assign({variant:"filled",color:t,styles:Object.assign({root:{borderRadius:"2px",background:t,textTransform:"unset"}},a)},s))},J=e=>{var{children:t,line:a,lineHeight:s,trackingAttributes:o,maxHeight:r,customExpandFn:i}=e,n=v(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);const{t:l}=_(),c=j((()=>r||(a&&s?a*s:(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 g.createElement(y,Object.assign({showLabel:g.createElement(h,Object.assign({size:"p3",color:z.colors.primaryBase},m,{onClick:i}),l("articlePage.readMore")),hideLabel:g.createElement(h,Object.assign({size:"p3",color:z.colors.primaryBase},m),l("articlePage.showLess"))},n,{maxHeight:c}),t)};const U=e=>(function(e=!1){g.useEffect((()=>{if(e){const e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}}),[e])}(e.visible),g.createElement(C,Object.assign({loaderProps:{color:z.colors.primaryBase}},e))),V=e=>{var{children:t,locale:a,template:s="hb"}=e,o=v(e,["children","locale","template"]);return f(a),g.createElement(H,Object.assign({theme:x(a,s)},o),t)};var Y="MON6sfi",Z="pS-tJD7",K="s3tJ9-5",Q="fNsZr1b",W="uuxV74v",X="YohjTDU";function $(e){const{icon:t,title:a,description:s,button:o,buttonProps:r,style:i,className:n}=e,l=r||{},{size:c="lg",variant:m="outline"}=l,d=v(l,["size","variant"]),p=t;return g.createElement("div",{className:w("result",Y,n),style:i},p&&g.createElement("div",{className:w("resultIconContainer",Z)},g.createElement(p,{className:w("resultIcon",K)})),g.createElement(N,{order:3,size:"h3",className:w("resultTitle",Q)},a),g.createElement(k,{className:w("resultDescription",W)},s),o&&g.createElement(L,Object.assign({},d,{size:c,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-079a6b93.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-c38ade0a.js";export{d as deleteCookie,g as getCookie,s as setCookie}from"./cookieHelper-bf1be72d.js";import"react";import"styled-components";export{M as MBTheme,t as theme}from"./theme-57e98706.js";export{a as abbreviateNumber}from"./number-42359818.js";export{d as getCareApiDomain,g as getCurrentBaseUrl,a as getCurrentSsoUrl,c as getDiscoverApiDomain,b as getTogetherApiDomain}from"./routing-be087f5b.js";export{f as formatHealthTool,g as getDynamicHealthTool,a as getDynamicHealthToolWithCache}from"./getDynamicHealthTool-781262ca.js";export{g as getSocialList}from"./getSocialList-f4d07c8e.js";export{f as formatPill}from"./dataTransform-c10d68f3.js";import"dayjs";import"lodash/throttle";import"./index-27df5763.js";import"date-fns/locale";import"./Subot-36ac5f94.js";import"./isProduction-f464a698.js";import"./tslib.es6-98b62e2b.js";import"./core-a3b3b447.js";import"./normalizeLink-15cf45d1.js";import"./gAssets.js";
|
package/build/esm/navigation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./tslib.es6-
|
|
1
|
+
import"./tslib.es6-98b62e2b.js";import"react";import"./core-a3b3b447.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-00d3e532.js";import"./index-27df5763.js";import"./normalizeLink-15cf45d1.js";import"./routing-be087f5b.js";import"./index-8b7c8eb1.js";import"./index.styled-886c957e.js";import"./isProduction-f464a698.js";import"./index-bed044a7.js";import"@mantine/core";import"@mantine/hooks";import"./theme-57e98706.js";import"./gAssets.js";import"date-fns/locale";import"./Subot-36ac5f94.js";import"dayjs";import"./screenSizeContext-c38ade0a.js";import"styled-components";import"lodash/throttle";import"@mantine/carousel";import"./index-8118170d.js";import"./useTranslations-6b1653a2.js";import"./translationsContext-b6ff3279.js";import"string-format";import"classnames";import"./index-2e1d6359.js";import"@linaria/react";import"./utils-ab72b62f.js";import"@mantine/dates";import"./constants-8dc38f9e.js";import"lodash/debounce";import"./useCategory-440b7f9a.js";import"./ChevronDown-48e13c4f.js";import"./index-ad6cd88d.js";import"./constants-fe146bd1.js";import"./index.styles-874ee5cd.js";import"react-keyed-flatten-children";import"./cookieHelper-bf1be72d.js";import"slugify";import"./index-68094777.js";import"./useIsInit-6b7cbee2.js";import"./index.styled-6252f77a.js";import"./index-0e3fc8b7.js";import"./index-f4b93c10.js";import"dayjs/plugin/relativeTime";
|