@hhgtech/hhg-components 1.28.68 → 1.28.70
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/BMI_BOYS.percentile.monthly-ec484e1d.js +688 -0
- package/build/BMI_BOYS.percentile.weekly-ffc6b5a3.js +182 -0
- package/build/BMI_BOYS.percentile.yearly-5d5dc6e9.js +83 -0
- package/build/BMI_BOYS.zscore.monthly-b8e9eb67.js +440 -0
- package/build/BMI_BOYS.zscore.weekly-b3a3fe35.js +118 -0
- package/build/BMI_BOYS.zscore.yearly-1049cff4.js +55 -0
- package/build/BMI_GIRLS.percentile.monthly-d29f1886.js +688 -0
- package/build/BMI_GIRLS.percentile.weekly-10dd3bc1.js +182 -0
- package/build/BMI_GIRLS.percentile.yearly-a4a14fb6.js +83 -0
- package/build/BMI_GIRLS.zscore.monthly-3b5b1c91.js +440 -0
- package/build/BMI_GIRLS.zscore.weekly-d8d9d85b.js +118 -0
- package/build/BMI_GIRLS.zscore.yearly-ad43326e.js +55 -0
- package/build/ChevronDown-ec7af49f.js +29 -0
- package/build/HEAD CIRCUM_BOYS.percentile.monthly-e28549df.js +688 -0
- package/build/HEAD CIRCUM_BOYS.percentile.weekly-7e0bbc5c.js +182 -0
- package/build/HEAD CIRCUM_BOYS.percentile.yearly-16d85faf.js +83 -0
- package/build/HEAD CIRCUM_BOYS.zscore.monthly-2905143d.js +440 -0
- package/build/HEAD CIRCUM_BOYS.zscore.weekly-c884eb7a.js +118 -0
- package/build/HEAD CIRCUM_BOYS.zscore.yearly-1d2e8236.js +55 -0
- package/build/HEAD CIRCUM_GIRLS.percentile.monthly-ad2221f6.js +688 -0
- package/build/HEAD CIRCUM_GIRLS.percentile.weekly-a0f66bc1.js +182 -0
- package/build/HEAD CIRCUM_GIRLS.percentile.yearly-ccd016aa.js +83 -0
- package/build/HEAD CIRCUM_GIRLS.zscore.monthly-0fd4416c.js +440 -0
- package/build/HEAD CIRCUM_GIRLS.zscore.weekly-9c6eb011.js +118 -0
- package/build/HEAD CIRCUM_GIRLS.zscore.yearly-bbb354f1.js +55 -0
- package/build/HEIGHT_BOYS.percentile.monthly-a0f41c2e.js +688 -0
- package/build/HEIGHT_BOYS.percentile.weekly-7bc2b867.js +182 -0
- package/build/HEIGHT_BOYS.percentile.yearly-7c2f34c6.js +237 -0
- package/build/HEIGHT_BOYS.zscore.monthly-54789026.js +440 -0
- package/build/HEIGHT_BOYS.zscore.weekly-b1360897.js +118 -0
- package/build/HEIGHT_BOYS.zscore.yearly-d5eb559f.js +153 -0
- package/build/HEIGHT_GIRLS.percentile.monthly-6f7fef3f.js +688 -0
- package/build/HEIGHT_GIRLS.percentile.weekly-fb6605ac.js +182 -0
- package/build/HEIGHT_GIRLS.percentile.yearly-19052b79.js +237 -0
- package/build/HEIGHT_GIRLS.zscore.monthly-26c2a368.js +440 -0
- package/build/HEIGHT_GIRLS.zscore.weekly-305a8f9b.js +118 -0
- package/build/HEIGHT_GIRLS.zscore.yearly-f89639ce.js +153 -0
- package/build/Subot-cc39f8f4.js +217 -0
- package/build/Visible-4860305e.js +29 -0
- package/build/WEIGHT_BOYS.percentile.monthly-7763fdac.js +688 -0
- package/build/WEIGHT_BOYS.percentile.weekly-68c7793a.js +182 -0
- package/build/WEIGHT_BOYS.percentile.yearly-425ea795.js +138 -0
- package/build/WEIGHT_BOYS.zscore.monthly-09fbb556.js +440 -0
- package/build/WEIGHT_BOYS.zscore.weekly-5b55a950.js +118 -0
- package/build/WEIGHT_BOYS.zscore.yearly-a8492c27.js +90 -0
- package/build/WEIGHT_GIRLS.percentile.monthly-104461c2.js +688 -0
- package/build/WEIGHT_GIRLS.percentile.weekly-49d203bd.js +182 -0
- package/build/WEIGHT_GIRLS.percentile.yearly-f6f1c4ad.js +138 -0
- package/build/WEIGHT_GIRLS.zscore.monthly-ba6ce356.js +440 -0
- package/build/WEIGHT_GIRLS.zscore.weekly-c4c81f65.js +118 -0
- package/build/WEIGHT_GIRLS.zscore.yearly-e1085364.js +90 -0
- package/build/adapters.js +36 -1
- package/build/{esm/animation-a158bfd1.js → animation-4eb246c7.js} +32 -10
- package/build/babyGrowth.js +913 -47
- package/build/cache.js +13 -1
- package/build/care.js +38 -1
- package/build/components.js +186 -1
- package/build/constants-3864d668.js +935 -0
- package/build/constants-fc94e094.js +255 -0
- package/build/constants.js +43 -1
- package/build/cookieHelper-5530e215.js +43 -0
- package/build/core-04836b33.js +51 -0
- package/build/dataTransform-9b71cb70.js +66 -0
- package/build/ecom.js +745 -1
- package/build/esm/BMI_BOYS.percentile.monthly-6b3461e1.js +686 -0
- package/build/esm/BMI_BOYS.percentile.weekly-38412483.js +180 -0
- package/build/esm/BMI_BOYS.percentile.yearly-e8ca2213.js +81 -0
- package/build/esm/BMI_BOYS.zscore.monthly-2f32a201.js +438 -0
- package/build/esm/BMI_BOYS.zscore.weekly-8a24d204.js +116 -0
- package/build/esm/BMI_BOYS.zscore.yearly-b332a59e.js +53 -0
- package/build/esm/BMI_GIRLS.percentile.monthly-c9ac489f.js +686 -0
- package/build/esm/BMI_GIRLS.percentile.weekly-082d024f.js +180 -0
- package/build/esm/BMI_GIRLS.percentile.yearly-57a69990.js +81 -0
- package/build/esm/BMI_GIRLS.zscore.monthly-541623fd.js +438 -0
- package/build/esm/BMI_GIRLS.zscore.weekly-31b589ac.js +116 -0
- package/build/esm/BMI_GIRLS.zscore.yearly-9b283c7c.js +53 -0
- package/build/esm/ChevronDown-0ed72d46.js +7 -0
- package/build/esm/HEAD CIRCUM_BOYS.percentile.monthly-2eb54be3.js +686 -0
- package/build/esm/HEAD CIRCUM_BOYS.percentile.weekly-10259bd1.js +180 -0
- package/build/esm/HEAD CIRCUM_BOYS.percentile.yearly-fff4845f.js +81 -0
- package/build/esm/HEAD CIRCUM_BOYS.zscore.monthly-5ccfaf6a.js +438 -0
- package/build/esm/HEAD CIRCUM_BOYS.zscore.weekly-dc789dde.js +116 -0
- package/build/esm/HEAD CIRCUM_BOYS.zscore.yearly-5049a9b7.js +53 -0
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.monthly-58902be4.js +686 -0
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.weekly-c79eb8aa.js +180 -0
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.yearly-6ecfd9f9.js +81 -0
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.monthly-91b64b57.js +438 -0
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.weekly-ec7b5e8d.js +116 -0
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.yearly-43686573.js +53 -0
- package/build/esm/HEIGHT_BOYS.percentile.monthly-2c2ec339.js +686 -0
- package/build/esm/HEIGHT_BOYS.percentile.weekly-023fd92c.js +180 -0
- package/build/esm/HEIGHT_BOYS.percentile.yearly-64408f6e.js +235 -0
- package/build/esm/HEIGHT_BOYS.zscore.monthly-4c4c0583.js +438 -0
- package/build/esm/HEIGHT_BOYS.zscore.weekly-73d758dd.js +116 -0
- package/build/esm/HEIGHT_BOYS.zscore.yearly-63b0ee31.js +151 -0
- package/build/esm/HEIGHT_GIRLS.percentile.monthly-220a156b.js +686 -0
- package/build/esm/HEIGHT_GIRLS.percentile.weekly-39ed86d3.js +180 -0
- package/build/esm/HEIGHT_GIRLS.percentile.yearly-f6f9beda.js +235 -0
- package/build/esm/HEIGHT_GIRLS.zscore.monthly-98da19db.js +438 -0
- package/build/esm/HEIGHT_GIRLS.zscore.weekly-b46182b8.js +116 -0
- package/build/esm/HEIGHT_GIRLS.zscore.yearly-e17c3753.js +151 -0
- package/build/esm/Subot-73dd692f.js +212 -0
- package/build/esm/Visible-b2077c55.js +7 -0
- package/build/esm/WEIGHT_BOYS.percentile.monthly-43751c6a.js +686 -0
- package/build/esm/WEIGHT_BOYS.percentile.weekly-65778018.js +180 -0
- package/build/esm/WEIGHT_BOYS.percentile.yearly-68c4f38f.js +136 -0
- package/build/esm/WEIGHT_BOYS.zscore.monthly-847746a9.js +438 -0
- package/build/esm/WEIGHT_BOYS.zscore.weekly-a1f2fe34.js +116 -0
- package/build/esm/WEIGHT_BOYS.zscore.yearly-119adddc.js +88 -0
- package/build/esm/WEIGHT_GIRLS.percentile.monthly-4c5ceb09.js +686 -0
- package/build/esm/WEIGHT_GIRLS.percentile.weekly-ddff2e29.js +180 -0
- package/build/esm/WEIGHT_GIRLS.percentile.yearly-5a344597.js +136 -0
- package/build/esm/WEIGHT_GIRLS.zscore.monthly-a6917c8a.js +438 -0
- package/build/esm/WEIGHT_GIRLS.zscore.weekly-5b74c62e.js +116 -0
- package/build/esm/WEIGHT_GIRLS.zscore.yearly-8507cd6a.js +88 -0
- package/build/esm/adapters.js +26 -1
- package/build/{animation-ea278d9a.js → esm/animation-bdb3ff49.js} +22 -10
- package/build/esm/babyGrowth.js +883 -47
- package/build/esm/cache.js +3 -1
- package/build/esm/care.js +26 -1
- package/build/esm/components.js +88 -1
- package/build/esm/constants-bf79fcda.js +238 -0
- package/build/esm/constants-da0dfbf1.js +932 -0
- package/build/esm/constants.js +4 -1
- package/build/esm/cookieHelper-8ee29f1a.js +39 -0
- package/build/esm/core-23d12cc0.js +47 -0
- package/build/esm/dataTransform-1495a226.js +56 -0
- package/build/esm/ecom.js +737 -1
- package/build/esm/footer.js +31 -1
- package/build/esm/gAssets.js +5 -1
- package/build/esm/getDynamicHealthTool-a43e5baa.js +44 -0
- package/build/esm/getSocialList-961c0579.js +66 -0
- package/build/esm/hooks.js +21 -1
- package/build/esm/i18n-values/en-PH.js +600 -1
- package/build/esm/i18n-values/hi-IN.js +600 -1
- package/build/esm/i18n-values/id-ID.js +600 -1
- package/build/esm/i18n-values/km-KH.js +600 -1
- package/build/esm/i18n-values/ms-MY.js +602 -1
- package/build/esm/i18n-values/my-MM.js +600 -1
- package/build/esm/i18n-values/th-TH.js +600 -1
- package/build/esm/i18n-values/tl-PH.js +600 -1
- package/build/esm/i18n-values/vi-VN.js +607 -1
- package/build/esm/i18n-values/vi-VN_MB.js +607 -1
- package/build/esm/i18n-values/zh-TW.js +600 -1
- package/build/esm/i18n.js +55 -1
- package/build/esm/i18nV2.js +18 -1
- package/build/esm/index-01e95463.js +1936 -0
- package/build/esm/index-0b1da466.js +8 -0
- package/build/esm/index-191e851e.js +33 -0
- package/build/esm/index-2a68f8b2.js +24 -0
- package/build/esm/index-355c0d8a.js +17 -0
- package/build/esm/index-552efa5f.js +8302 -0
- package/build/esm/index-652f4b90.js +116 -0
- package/build/esm/index-70eeb14d.js +24 -0
- package/build/esm/index-852bb5ca.js +905 -0
- package/build/esm/index-9622b7d8.js +23 -0
- package/build/esm/index-9d3bbec1.js +124 -0
- package/build/esm/index-a23ed47f.js +53 -0
- package/build/esm/index-a3806b2a.js +14 -0
- package/build/esm/index-a5ac9bab.js +32 -0
- package/build/esm/index-a8506e24.js +152 -0
- package/build/esm/index-aa97bf26.js +33 -0
- package/build/esm/index-bd89745e.js +151 -0
- package/build/esm/index-bf14ddf1.js +184 -0
- package/build/esm/index-c28b5670.js +3241 -0
- package/build/esm/index-cc7415a3.js +837 -0
- package/build/esm/index-d1d2e96b.js +29 -0
- package/build/esm/index-d57cd8e6.js +615 -0
- package/build/esm/index-e183dc84.js +71 -0
- package/build/esm/index-ebb8bd0e.js +149 -0
- package/build/esm/index-ec1cc2ea.js +52 -0
- package/build/esm/index-f1227130.js +370 -0
- package/build/esm/index-f5f8c84b.js +5 -0
- package/build/esm/index-fb17aef5.js +12 -0
- package/build/esm/index.js +190 -1
- package/build/{index.styled-625bfdc7.js → esm/index.styled-385c2908.js} +17 -5
- package/build/esm/index.styles-31411b37.js +1303 -0
- package/build/esm/isProduction-9081cff7.js +27 -0
- package/build/esm/lead.js +2140 -1
- package/build/esm/localizeNumberFormat-d3e4f990.js +23 -0
- package/build/esm/mantine.js +113 -1
- package/build/esm/misc.js +22 -1
- package/build/esm/navigation.js +51 -1
- package/build/esm/normalizeLink-139f9dfd.js +12 -0
- package/build/esm/number-f0945de9.js +38 -0
- package/build/esm/onboardingV2.js +860 -34
- package/build/esm/paths-4eadd090.js +14 -0
- package/build/esm/pwg.js +208 -7
- package/build/esm/routing-b5780749.js +40 -0
- package/build/esm/subot.js +4553 -134
- package/build/esm/theme-7522724d.js +186 -0
- package/build/esm/together.js +52 -1
- package/build/esm/translationsContext-62ed87ff.js +5 -0
- package/build/esm/tslib.es6-f79929c2.js +38 -0
- package/build/esm/types-0757e895.js +8015 -0
- package/build/esm/types-40018b94.js +3432 -0
- package/build/esm/types-d32df09b.js +21 -0
- package/build/esm/types.js +1 -1
- package/build/esm/unifyEnv.js +42 -1
- package/build/esm/useCategory-e00a99e3.js +292 -0
- package/build/esm/useHealthToolCache-3ab5f2b6.js +17 -0
- package/build/esm/useIsInit-18a571ff.js +11 -0
- package/build/esm/useOutsideClick-8a0c90ee.js +45 -0
- package/build/esm/usePlacesAutocomplete-d9cfd28e.js +80 -0
- package/build/esm/useScrollbarSize-ee04fb14.js +57 -0
- package/build/esm/useTranslations-d53557b4.js +26 -0
- package/build/esm/useUniqueId-fc42d583.js +41 -0
- package/build/esm/utils-2af1561c.js +367 -0
- package/build/esm/utils-5e5da593.js +22 -0
- package/build/esm/utils-72693be6.js +1124 -0
- package/build/esm/utils-f7ab8c32.js +132 -0
- package/build/esm/vaccination.js +868 -40
- package/build/footer.js +39 -1
- package/build/gAssets.js +14 -1
- package/build/getDynamicHealthTool-b66c50c2.js +48 -0
- package/build/getSocialList-0c2f74e9.js +72 -0
- package/build/hooks.js +44 -1
- package/build/i18n-values/en-PH.js +611 -1
- package/build/i18n-values/hi-IN.js +611 -1
- package/build/i18n-values/id-ID.js +611 -1
- package/build/i18n-values/km-KH.js +611 -1
- package/build/i18n-values/ms-MY.js +613 -1
- package/build/i18n-values/my-MM.js +611 -1
- package/build/i18n-values/th-TH.js +611 -1
- package/build/i18n-values/tl-PH.js +611 -1
- package/build/i18n-values/vi-VN.js +618 -1
- package/build/i18n-values/vi-VN_MB.js +618 -1
- package/build/i18n-values/zh-TW.js +611 -1
- package/build/i18n.js +64 -1
- package/build/i18nV2.js +26 -1
- package/build/index-13da9bbd.js +8373 -0
- package/build/index-165c76af.js +30 -0
- package/build/index-2d4e4a2c.js +30 -0
- package/build/index-3540ce3f.js +380 -0
- package/build/index-473e8c3c.js +39 -0
- package/build/index-48b608d8.js +123 -0
- package/build/index-4d393920.js +191 -0
- package/build/index-51cda470.js +39 -0
- package/build/index-5e3660ec.js +14 -0
- package/build/index-69a38997.js +930 -0
- package/build/index-7144e07a.js +38 -0
- package/build/index-72944b3e.js +853 -0
- package/build/index-78055ee8.js +3261 -0
- package/build/index-95dd817d.js +1994 -0
- package/build/index-9625ab6c.js +7 -0
- package/build/index-970717a9.js +156 -0
- package/build/index-97f95550.js +23 -0
- package/build/index-a00da8f4.js +59 -0
- package/build/index-a69b48c2.js +20 -0
- package/build/index-add37f18.js +624 -0
- package/build/index-b0333d49.js +30 -0
- package/build/index-be2d90cb.js +35 -0
- package/build/index-bef45e43.js +55 -0
- package/build/index-c7dc021b.js +157 -0
- package/build/index-cd1375cc.js +18 -0
- package/build/index-d3d46009.js +159 -0
- package/build/index-e592738b.js +77 -0
- package/build/index-ed5f7bf2.js +133 -0
- package/build/index.js +436 -1
- package/build/{esm/index.styled-ac7ac0fc.js → index.styled-97b37364.js} +25 -5
- package/build/index.styles-2434bd17.js +1342 -0
- package/build/isProduction-4f301fa7.js +29 -0
- package/build/lead.js +2168 -1
- package/build/localizeNumberFormat-84d686f7.js +31 -0
- package/build/mantine.js +154 -1
- package/build/misc.js +70 -1
- package/build/navigation.js +61 -1
- package/build/normalizeLink-cc2af392.js +15 -0
- package/build/number-29e6fe47.js +40 -0
- package/build/onboardingV2.js +892 -34
- package/build/paths-da1bc0ab.js +16 -0
- package/build/pwg.js +217 -7
- package/build/routing-b27d22a5.js +46 -0
- package/build/subot.js +4592 -134
- package/build/theme-30426d81.js +189 -0
- package/build/together.js +112 -1
- package/build/translationsContext-7e9f4617.js +7 -0
- package/build/tslib.es6-abc17c4d.js +41 -0
- package/build/types-52edc091.js +24 -0
- package/build/types-72f2c593.js +8084 -0
- package/build/types-b7c4f1cc.js +3446 -0
- package/build/types.js +56 -1
- package/build/unifyEnv.js +46 -1
- package/build/useCategory-c53c40ba.js +299 -0
- package/build/useHealthToolCache-d358ef43.js +19 -0
- package/build/useIsInit-447f599e.js +13 -0
- package/build/useOutsideClick-44f3b64d.js +49 -0
- package/build/usePlacesAutocomplete-f63f4097.js +84 -0
- package/build/useScrollbarSize-3e11e4b6.js +64 -0
- package/build/useTranslations-64bdaca7.js +32 -0
- package/build/useUniqueId-27dee48b.js +44 -0
- package/build/utils-2b307237.js +25 -0
- package/build/utils-386fbc52.js +1171 -0
- package/build/utils-5c554121.js +384 -0
- package/build/utils-d8cae1f5.js +143 -0
- package/build/vaccination.js +891 -40
- package/package.json +4 -5
- package/build/BMI_BOYS.percentile.monthly-8cc875f7.js +0 -1
- package/build/BMI_BOYS.percentile.weekly-b45b05e3.js +0 -1
- package/build/BMI_BOYS.percentile.yearly-e4f1d19c.js +0 -1
- package/build/BMI_BOYS.zscore.monthly-e51737eb.js +0 -1
- package/build/BMI_BOYS.zscore.weekly-4080c0d5.js +0 -1
- package/build/BMI_BOYS.zscore.yearly-703e5747.js +0 -1
- package/build/BMI_GIRLS.percentile.monthly-ac5a001d.js +0 -1
- package/build/BMI_GIRLS.percentile.weekly-6a6f4703.js +0 -1
- package/build/BMI_GIRLS.percentile.yearly-8eb7e8e5.js +0 -1
- package/build/BMI_GIRLS.zscore.monthly-c2763465.js +0 -1
- package/build/BMI_GIRLS.zscore.weekly-7438d8b6.js +0 -1
- package/build/BMI_GIRLS.zscore.yearly-a56ffb0c.js +0 -1
- package/build/ChevronDown-81b50697.js +0 -1
- package/build/HEAD CIRCUM_BOYS.percentile.monthly-cccf9306.js +0 -1
- package/build/HEAD CIRCUM_BOYS.percentile.weekly-85fc8a7e.js +0 -1
- package/build/HEAD CIRCUM_BOYS.percentile.yearly-d22ad913.js +0 -1
- package/build/HEAD CIRCUM_BOYS.zscore.monthly-4db20906.js +0 -1
- package/build/HEAD CIRCUM_BOYS.zscore.weekly-1a4dc975.js +0 -1
- package/build/HEAD CIRCUM_BOYS.zscore.yearly-a2bcdd3a.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.percentile.monthly-13e127f5.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.percentile.weekly-95a7695c.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.percentile.yearly-852dc893.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.zscore.monthly-9865857d.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.zscore.weekly-9bdf4dda.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.zscore.yearly-ac24fb2f.js +0 -1
- package/build/HEIGHT_BOYS.percentile.monthly-691b0568.js +0 -1
- package/build/HEIGHT_BOYS.percentile.weekly-520bd6ac.js +0 -1
- package/build/HEIGHT_BOYS.percentile.yearly-9093722e.js +0 -1
- package/build/HEIGHT_BOYS.zscore.monthly-84db220e.js +0 -1
- package/build/HEIGHT_BOYS.zscore.weekly-ce0c52d1.js +0 -1
- package/build/HEIGHT_BOYS.zscore.yearly-dab7d4e0.js +0 -1
- package/build/HEIGHT_GIRLS.percentile.monthly-7f42e4cd.js +0 -1
- package/build/HEIGHT_GIRLS.percentile.weekly-79ca42e5.js +0 -1
- package/build/HEIGHT_GIRLS.percentile.yearly-4e11d0f8.js +0 -1
- package/build/HEIGHT_GIRLS.zscore.monthly-74be7929.js +0 -1
- package/build/HEIGHT_GIRLS.zscore.weekly-a47a1d90.js +0 -1
- package/build/HEIGHT_GIRLS.zscore.yearly-f4984496.js +0 -1
- package/build/Subot-b0700a95.js +0 -1
- package/build/Visible-0267024a.js +0 -1
- package/build/WEIGHT_BOYS.percentile.monthly-08b33be0.js +0 -1
- package/build/WEIGHT_BOYS.percentile.weekly-65a4fa70.js +0 -1
- package/build/WEIGHT_BOYS.percentile.yearly-f3b46cc5.js +0 -1
- package/build/WEIGHT_BOYS.zscore.monthly-d1191a6a.js +0 -1
- package/build/WEIGHT_BOYS.zscore.weekly-61c60cf9.js +0 -1
- package/build/WEIGHT_BOYS.zscore.yearly-0d89c866.js +0 -1
- package/build/WEIGHT_GIRLS.percentile.monthly-221c1ba4.js +0 -1
- package/build/WEIGHT_GIRLS.percentile.weekly-fbd203a6.js +0 -1
- package/build/WEIGHT_GIRLS.percentile.yearly-36a909c2.js +0 -1
- package/build/WEIGHT_GIRLS.zscore.monthly-09b6ae5b.js +0 -1
- package/build/WEIGHT_GIRLS.zscore.weekly-7ada849a.js +0 -1
- package/build/WEIGHT_GIRLS.zscore.yearly-5115a509.js +0 -1
- package/build/constants-47b9b5ff.js +0 -108
- package/build/constants-8d5fe5b9.js +0 -1
- package/build/cookieHelper-effc4373.js +0 -1
- package/build/core-fc6dbe08.js +0 -1
- package/build/dataTransform-ad721ec5.js +0 -1
- package/build/esm/BMI_BOYS.percentile.monthly-2aa26d5a.js +0 -1
- package/build/esm/BMI_BOYS.percentile.weekly-838f6b27.js +0 -1
- package/build/esm/BMI_BOYS.percentile.yearly-e77609d7.js +0 -1
- package/build/esm/BMI_BOYS.zscore.monthly-2657168d.js +0 -1
- package/build/esm/BMI_BOYS.zscore.weekly-d3c18887.js +0 -1
- package/build/esm/BMI_BOYS.zscore.yearly-3759a54e.js +0 -1
- package/build/esm/BMI_GIRLS.percentile.monthly-f3e35273.js +0 -1
- package/build/esm/BMI_GIRLS.percentile.weekly-7936ee97.js +0 -1
- package/build/esm/BMI_GIRLS.percentile.yearly-757b0bc4.js +0 -1
- package/build/esm/BMI_GIRLS.zscore.monthly-d9760b61.js +0 -1
- package/build/esm/BMI_GIRLS.zscore.weekly-a58e0db1.js +0 -1
- package/build/esm/BMI_GIRLS.zscore.yearly-92413c27.js +0 -1
- package/build/esm/ChevronDown-e7d44dc3.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.percentile.monthly-c50f125e.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.percentile.weekly-29038598.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.percentile.yearly-32c4e2be.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.zscore.monthly-cd04e4b1.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.zscore.weekly-6b63745c.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.zscore.yearly-3a5be78c.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.monthly-c7996a02.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.weekly-553c94d5.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.yearly-97f86688.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.monthly-a442f7cc.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.weekly-cdd37afd.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.yearly-50d9daff.js +0 -1
- package/build/esm/HEIGHT_BOYS.percentile.monthly-53580c1f.js +0 -1
- package/build/esm/HEIGHT_BOYS.percentile.weekly-60514fb8.js +0 -1
- package/build/esm/HEIGHT_BOYS.percentile.yearly-d6b456a7.js +0 -1
- package/build/esm/HEIGHT_BOYS.zscore.monthly-21bd1444.js +0 -1
- package/build/esm/HEIGHT_BOYS.zscore.weekly-2a4e7aa0.js +0 -1
- package/build/esm/HEIGHT_BOYS.zscore.yearly-7f68c522.js +0 -1
- package/build/esm/HEIGHT_GIRLS.percentile.monthly-d5d7448a.js +0 -1
- package/build/esm/HEIGHT_GIRLS.percentile.weekly-c3c18801.js +0 -1
- package/build/esm/HEIGHT_GIRLS.percentile.yearly-3491901c.js +0 -1
- package/build/esm/HEIGHT_GIRLS.zscore.monthly-9f15dd03.js +0 -1
- package/build/esm/HEIGHT_GIRLS.zscore.weekly-81319284.js +0 -1
- package/build/esm/HEIGHT_GIRLS.zscore.yearly-8a7db57c.js +0 -1
- package/build/esm/Subot-fcd7c77c.js +0 -1
- package/build/esm/Visible-66d0e6f3.js +0 -1
- package/build/esm/WEIGHT_BOYS.percentile.monthly-0f5ea175.js +0 -1
- package/build/esm/WEIGHT_BOYS.percentile.weekly-88f50098.js +0 -1
- package/build/esm/WEIGHT_BOYS.percentile.yearly-63383bc3.js +0 -1
- package/build/esm/WEIGHT_BOYS.zscore.monthly-bf93eec1.js +0 -1
- package/build/esm/WEIGHT_BOYS.zscore.weekly-fe0600be.js +0 -1
- package/build/esm/WEIGHT_BOYS.zscore.yearly-4212bebb.js +0 -1
- package/build/esm/WEIGHT_GIRLS.percentile.monthly-6cc8cf8c.js +0 -1
- package/build/esm/WEIGHT_GIRLS.percentile.weekly-05d66e6d.js +0 -1
- package/build/esm/WEIGHT_GIRLS.percentile.yearly-b8c1af06.js +0 -1
- package/build/esm/WEIGHT_GIRLS.zscore.monthly-8c9195d5.js +0 -1
- package/build/esm/WEIGHT_GIRLS.zscore.weekly-4ef9aeee.js +0 -1
- package/build/esm/WEIGHT_GIRLS.zscore.yearly-0ccaeb51.js +0 -1
- package/build/esm/constants-046883ea.js +0 -1
- package/build/esm/constants-1e65de37.js +0 -108
- package/build/esm/cookieHelper-e37e6893.js +0 -1
- package/build/esm/core-7a237cdc.js +0 -1
- package/build/esm/dataTransform-f4476a6b.js +0 -1
- package/build/esm/getDynamicHealthTool-e095ea8b.js +0 -1
- package/build/esm/getSocialList-5f74d2b2.js +0 -1
- package/build/esm/index-006bca17.js +0 -1
- package/build/esm/index-068a9606.js +0 -137
- package/build/esm/index-0d0e5f45.js +0 -1
- package/build/esm/index-1e29d7b0.js +0 -1
- package/build/esm/index-2b572b4f.js +0 -1
- package/build/esm/index-318d4230.js +0 -117
- package/build/esm/index-39174b30.js +0 -1
- package/build/esm/index-3bfcc95c.js +0 -1
- package/build/esm/index-3c612859.js +0 -1
- package/build/esm/index-4004c359.js +0 -113
- package/build/esm/index-41f67971.js +0 -177
- package/build/esm/index-42a8c7e8.js +0 -1430
- package/build/esm/index-461eded2.js +0 -2748
- package/build/esm/index-575f65cb.js +0 -1
- package/build/esm/index-7f4008ff.js +0 -1
- package/build/esm/index-81dbde00.js +0 -375
- package/build/esm/index-99348fe5.js +0 -1
- package/build/esm/index-9b8a2194.js +0 -1
- package/build/esm/index-9d529405.js +0 -1
- package/build/esm/index-a445a873.js +0 -1
- package/build/esm/index-ab99f4fa.js +0 -1
- package/build/esm/index-b7782e6c.js +0 -1
- package/build/esm/index-b7a87c5c.js +0 -50
- package/build/esm/index-c737fbcc.js +0 -1
- package/build/esm/index-dfe2918d.js +0 -1
- package/build/esm/index-e7dea007.js +0 -1
- package/build/esm/index-eab0e39a.js +0 -1
- package/build/esm/index-fa743e14.js +0 -1
- package/build/esm/index.styles-d0b249c6.js +0 -817
- package/build/esm/isProduction-819e0c5c.js +0 -1
- package/build/esm/localizeNumberFormat-87b8adfd.js +0 -1
- package/build/esm/normalizeLink-86ab5a4c.js +0 -1
- package/build/esm/number-087a7e5f.js +0 -1
- package/build/esm/paths-838a5528.js +0 -1
- package/build/esm/routing-c85cbf05.js +0 -1
- package/build/esm/theme-691eca44.js +0 -1
- package/build/esm/translationsContext-f8842fe7.js +0 -1
- package/build/esm/tslib.es6-1ab8a2bb.js +0 -1
- package/build/esm/types-2d76a291.js +0 -3004
- package/build/esm/types-81267cf7.js +0 -1
- package/build/esm/types-e02aa1d1.js +0 -785
- package/build/esm/useCategory-16048c77.js +0 -1
- package/build/esm/useHealthToolCache-b2ecca8b.js +0 -1
- package/build/esm/useIsInit-c9c6a218.js +0 -1
- package/build/esm/useOutsideClick-9787ba70.js +0 -1
- package/build/esm/usePlacesAutocomplete-1966a8e8.js +0 -1
- package/build/esm/useScrollbarSize-2cadb783.js +0 -1
- package/build/esm/useTranslations-06f29a74.js +0 -1
- package/build/esm/useUniqueId-8d28d0f0.js +0 -1
- package/build/esm/utils-21a3e198.js +0 -1
- package/build/esm/utils-581f9d39.js +0 -8
- package/build/esm/utils-8845cf64.js +0 -141
- package/build/esm/utils-9188a853.js +0 -1
- package/build/getDynamicHealthTool-110fd918.js +0 -1
- package/build/getSocialList-eca125e9.js +0 -1
- package/build/index-06e0154a.js +0 -177
- package/build/index-07abd94a.js +0 -1
- package/build/index-0c773078.js +0 -117
- package/build/index-170f5567.js +0 -1
- package/build/index-19ccb0c7.js +0 -1
- package/build/index-219cacd2.js +0 -1
- package/build/index-2c0386df.js +0 -50
- package/build/index-2ce34495.js +0 -1
- package/build/index-3f31aa06.js +0 -1
- package/build/index-686fe563.js +0 -1
- package/build/index-6c8c7fa5.js +0 -1
- package/build/index-76c307b4.js +0 -375
- package/build/index-78e20b2b.js +0 -1
- package/build/index-853a455f.js +0 -1
- package/build/index-9834ba3a.js +0 -1
- package/build/index-9c1259e4.js +0 -1
- package/build/index-9eed92e6.js +0 -1
- package/build/index-a046b313.js +0 -137
- package/build/index-ae78fa34.js +0 -113
- package/build/index-c4552011.js +0 -1
- package/build/index-d0a7d5e2.js +0 -1
- package/build/index-d59720e6.js +0 -1
- package/build/index-de63ce4e.js +0 -1
- package/build/index-e363ea7e.js +0 -1
- package/build/index-e4952f3b.js +0 -2748
- package/build/index-e9919dca.js +0 -1430
- package/build/index-f124e061.js +0 -1
- package/build/index-fc3d21c5.js +0 -1
- package/build/index.styles-e56f16e2.js +0 -817
- package/build/isProduction-b8d43f53.js +0 -1
- package/build/localizeNumberFormat-7b0e4009.js +0 -1
- package/build/normalizeLink-eb3980aa.js +0 -1
- package/build/number-03c2dc35.js +0 -1
- package/build/paths-38b399e5.js +0 -1
- package/build/routing-fa35242c.js +0 -1
- package/build/theme-58404344.js +0 -1
- package/build/translationsContext-6a4e467c.js +0 -1
- package/build/tslib.es6-f82cfdbc.js +0 -1
- package/build/types-006c0884.js +0 -785
- package/build/types-48100068.js +0 -3004
- package/build/types-b4886ab8.js +0 -1
- package/build/useCategory-5efbe937.js +0 -1
- package/build/useHealthToolCache-4085d047.js +0 -1
- package/build/useIsInit-cde99e17.js +0 -1
- package/build/useOutsideClick-8d455bb1.js +0 -1
- package/build/usePlacesAutocomplete-fa0acdc7.js +0 -1
- package/build/useScrollbarSize-3593573d.js +0 -1
- package/build/useTranslations-d91f297f.js +0 -1
- package/build/useUniqueId-76286c45.js +0 -1
- package/build/utils-6c4e6bc4.js +0 -8
- package/build/utils-dd2fab54.js +0 -141
- package/build/utils-e1f42597.js +0 -1
- package/build/utils-fade3897.js +0 -1
package/build/types.js
CHANGED
|
@@ -1 +1,56 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Subot = require('./Subot-cc39f8f4.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'BabyGrowthChartDuration', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return Subot.BabyGrowthChartDuration; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, 'BabyGrowthChartType', {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return Subot.BabyGrowthChartType; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, 'BabyGrowthResultTab', {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return Subot.BabyGrowthResultTab; }
|
|
20
|
+
});
|
|
21
|
+
exports.ELEMENT_CONTROL_INPUT_TYPE = Subot.ELEMENT_CONTROL_INPUT_TYPE;
|
|
22
|
+
exports.FULL_KEY_ADDRESS = Subot.FULL_KEY_ADDRESS;
|
|
23
|
+
Object.defineProperty(exports, 'Gender', {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return Subot.Gender; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, 'LOCALE', {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return Subot.LOCALE; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, 'NodeActionType', {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return Subot.NodeActionType; }
|
|
34
|
+
});
|
|
35
|
+
exports.NodeFinalTypes = Subot.NodeFinalTypes;
|
|
36
|
+
Object.defineProperty(exports, 'NodeIntentType', {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () { return Subot.NodeIntentType; }
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, 'NodeMultipleOptions', {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () { return Subot.NodeMultipleOptions; }
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, 'NodePosition', {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () { return Subot.NodePosition; }
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, 'NodeType', {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () { return Subot.NodeType; }
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, 'OnboardingStep', {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () { return Subot.OnboardingStep; }
|
|
55
|
+
});
|
|
56
|
+
exports.SubotType = Subot.SubotType;
|
package/build/unifyEnv.js
CHANGED
|
@@ -1 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function setupUnifyEnv({ DISCOVER_API, INTERNAL_DISCOVER_API, TOGETHER_API, INTERNAL_TOGETHER_API, CARE_API, INTERNAL_CARE_API, SIDIS_TEMPLATE_API, SIDIS_API, SIDIS_API_GET, SSO_API, LOCALE, DEPLOY_ENV, LEAD_API, SUBOT_API, INTERNAL_SUBOT_API, SUBOT_URL, PREMIUM_URL, VACCINATION_TOOL_API, LOGGING_ENABLED, }) {
|
|
6
|
+
if (DISCOVER_API)
|
|
7
|
+
process.env.UNIFY_DISCOVER_API = DISCOVER_API;
|
|
8
|
+
if (INTERNAL_DISCOVER_API)
|
|
9
|
+
process.env.UNIFY_INTERNAL_DISCOVER_API = INTERNAL_DISCOVER_API;
|
|
10
|
+
if (TOGETHER_API)
|
|
11
|
+
process.env.UNIFY_TOGETHER_API = TOGETHER_API;
|
|
12
|
+
if (INTERNAL_TOGETHER_API)
|
|
13
|
+
process.env.UNIFY_INTERNAL_TOGETHER_API = INTERNAL_TOGETHER_API;
|
|
14
|
+
if (CARE_API)
|
|
15
|
+
process.env.UNIFY_CARE_API = CARE_API;
|
|
16
|
+
if (INTERNAL_CARE_API)
|
|
17
|
+
process.env.UNIFY_INTERNAL_CARE_API = INTERNAL_CARE_API;
|
|
18
|
+
if (SIDIS_TEMPLATE_API)
|
|
19
|
+
process.env.UNIFY_SIDIS_TEMPLATE_API = SIDIS_TEMPLATE_API;
|
|
20
|
+
if (SIDIS_API)
|
|
21
|
+
process.env.UNIFY_SIDIS_API = SIDIS_API;
|
|
22
|
+
if (SIDIS_API_GET)
|
|
23
|
+
process.env.UNIFY_SIDIS_API_GET = SIDIS_API_GET;
|
|
24
|
+
if (SSO_API)
|
|
25
|
+
process.env.UNIFY_SSO_API = SSO_API;
|
|
26
|
+
if (LOCALE)
|
|
27
|
+
process.env.UNIFY_LOCALE = LOCALE;
|
|
28
|
+
if (DEPLOY_ENV)
|
|
29
|
+
process.env.UNIFY_DEPLOY_ENV = DEPLOY_ENV;
|
|
30
|
+
if (LEAD_API)
|
|
31
|
+
process.env.UNIFY_LEAD_API = LEAD_API;
|
|
32
|
+
if (SUBOT_API)
|
|
33
|
+
process.env.UNIFY_SUBOT_API = SUBOT_API;
|
|
34
|
+
if (INTERNAL_SUBOT_API)
|
|
35
|
+
process.env.UNIFY_INTERNAL_SUBOT_API = INTERNAL_SUBOT_API;
|
|
36
|
+
if (SUBOT_URL)
|
|
37
|
+
process.env.UNIFY_SUBOT_URL = SUBOT_URL;
|
|
38
|
+
if (PREMIUM_URL)
|
|
39
|
+
process.env.UNIFY_PREMIUM_URL = PREMIUM_URL;
|
|
40
|
+
if (VACCINATION_TOOL_API)
|
|
41
|
+
process.env.UNIFY_VACCINATION_TOOL_API = VACCINATION_TOOL_API;
|
|
42
|
+
if (String(LOGGING_ENABLED))
|
|
43
|
+
process.env.UNIFY_LOGGING_ENABLED = String(LOGGING_ENABLED);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports.setupUnifyEnv = setupUnifyEnv;
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-abc17c4d.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var cookieHelper = require('./cookieHelper-5530e215.js');
|
|
6
|
+
var useUniqueId = require('./useUniqueId-27dee48b.js');
|
|
7
|
+
var Subot = require('./Subot-cc39f8f4.js');
|
|
8
|
+
var useTranslations = require('./useTranslations-64bdaca7.js');
|
|
9
|
+
|
|
10
|
+
function normalizeAndHash(string) {
|
|
11
|
+
const utf8 = new TextEncoder().encode(string.trim().toLowerCase());
|
|
12
|
+
return crypto.subtle.digest('SHA-256', utf8).then((hashBuffer) => {
|
|
13
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
14
|
+
const hashHex = hashArray
|
|
15
|
+
.map((bytes) => bytes.toString(16).padStart(2, '0'))
|
|
16
|
+
.join('');
|
|
17
|
+
return hashHex;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const FbDataLayerStoreKey = 'fbDataLayer_userInfo';
|
|
21
|
+
const IPStoreKey = 'fbClientIp';
|
|
22
|
+
const useFbDataLayer = (userInfo) => {
|
|
23
|
+
const savedIpRef = React.useRef('');
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
(() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
+
var _a, _b, _c, _d, _e;
|
|
27
|
+
if (!savedIpRef.current) {
|
|
28
|
+
let userIp = yield fetch('https://api.ipify.org').then((res) => res.text());
|
|
29
|
+
if (!userIp) {
|
|
30
|
+
userIp = yield fetch('https://icanhazip.com').then((res) => res.text());
|
|
31
|
+
}
|
|
32
|
+
savedIpRef.current = userIp;
|
|
33
|
+
}
|
|
34
|
+
(_b = (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.setItem) === null || _b === void 0 ? void 0 : _b.call(_a, IPStoreKey, JSON.stringify({
|
|
35
|
+
client_ip_address: ((_c = savedIpRef.current) === null || _c === void 0 ? void 0 : _c.replace('\n', '')) || '',
|
|
36
|
+
client_user_agent: navigator.userAgent || '',
|
|
37
|
+
}));
|
|
38
|
+
if (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) {
|
|
39
|
+
const [em, ph, db, ge, ct, fn] = yield Promise.all([
|
|
40
|
+
userInfo.email ? normalizeAndHash(userInfo.email) : null,
|
|
41
|
+
userInfo.phone ? normalizeAndHash(userInfo.phone) : null,
|
|
42
|
+
userInfo.birthday
|
|
43
|
+
? normalizeAndHash(userInfo.birthday.split('-').join(''))
|
|
44
|
+
: null,
|
|
45
|
+
userInfo.gender ? 'm' : 'f',
|
|
46
|
+
userInfo.city_name
|
|
47
|
+
? normalizeAndHash(userInfo.city_name).then((n) => n.replace(/\s/g, ''))
|
|
48
|
+
: null,
|
|
49
|
+
userInfo.name ? normalizeAndHash(userInfo.name) : null,
|
|
50
|
+
]);
|
|
51
|
+
({
|
|
52
|
+
fbc: cookieHelper.getCookie('_fbc') || '',
|
|
53
|
+
fbp: cookieHelper.getCookie('_fbp') || '',
|
|
54
|
+
});
|
|
55
|
+
const localData = {
|
|
56
|
+
user_id: userInfo.id,
|
|
57
|
+
};
|
|
58
|
+
if (fn) {
|
|
59
|
+
localData['fn'] = fn;
|
|
60
|
+
}
|
|
61
|
+
if (em) {
|
|
62
|
+
localData['em'] = em;
|
|
63
|
+
}
|
|
64
|
+
if (ph) {
|
|
65
|
+
localData['ph'] = ph;
|
|
66
|
+
}
|
|
67
|
+
if (db) {
|
|
68
|
+
localData['db'] = db;
|
|
69
|
+
}
|
|
70
|
+
if (ct) {
|
|
71
|
+
localData['ct'] = ct;
|
|
72
|
+
}
|
|
73
|
+
(_e = (_d = window.localStorage) === null || _d === void 0 ? void 0 : _d.setItem) === null || _e === void 0 ? void 0 : _e.call(_d, FbDataLayerStoreKey, JSON.stringify(localData));
|
|
74
|
+
// ;(async function waitFbq() {
|
|
75
|
+
// // check for the generic script
|
|
76
|
+
// // easiest check to prevent race condition
|
|
77
|
+
// if (window.fbq) {
|
|
78
|
+
// window.fbq('trackCustom', 'FB Conversion', {
|
|
79
|
+
// action_source: 'website',
|
|
80
|
+
// event_source_url: window.location.href,
|
|
81
|
+
// user_data: [userData],
|
|
82
|
+
// })
|
|
83
|
+
// } else {
|
|
84
|
+
// timeout = setTimeout(waitFbq, 1000)
|
|
85
|
+
// }
|
|
86
|
+
// })()
|
|
87
|
+
}
|
|
88
|
+
}))();
|
|
89
|
+
return () => {
|
|
90
|
+
};
|
|
91
|
+
}, [userInfo]);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/** src: https://www.benmvp.com/blog/8-helpful-custom-react-hooks/
|
|
95
|
+
* know the PREVIOUS + DIFFERENT value of props or state. */
|
|
96
|
+
const usePrevious = (value) => {
|
|
97
|
+
// use refs to keep track of both the previous &
|
|
98
|
+
// current values
|
|
99
|
+
const prevRef = React.useRef();
|
|
100
|
+
const curRef = React.useRef(value);
|
|
101
|
+
const isInitialMount = useUniqueId.useInitialMount();
|
|
102
|
+
// after the initial render, if the value passed in
|
|
103
|
+
// differs from the `curRef`, then we know that the
|
|
104
|
+
// value we're tracking actually changed. we can
|
|
105
|
+
// update the refs. otherwise if the `curRef` &
|
|
106
|
+
// value are the same, something else caused the
|
|
107
|
+
// re-render and we should *not* update `prevRef`.
|
|
108
|
+
if (!isInitialMount && curRef.current !== value) {
|
|
109
|
+
prevRef.current = curRef.current;
|
|
110
|
+
curRef.current = value;
|
|
111
|
+
}
|
|
112
|
+
return prevRef.current;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/** src: https://www.benmvp.com/blog/8-helpful-custom-react-hooks/
|
|
116
|
+
* delay State update till next animation frame. Similar to debounce but shorter */
|
|
117
|
+
const useRafState = (initialState) => {
|
|
118
|
+
// this is the actual state
|
|
119
|
+
const [state, setState] = React.useState(initialState);
|
|
120
|
+
// keep track of the `requestAnimationFrame` request ID
|
|
121
|
+
// across renders and successive calls to `useRafState`
|
|
122
|
+
const requestId = React.useRef(0);
|
|
123
|
+
// the actual state setter we'll return.
|
|
124
|
+
// using `useCallback` so that it's memoized
|
|
125
|
+
// just like `setState`
|
|
126
|
+
const setRafState = React.useCallback((value) => {
|
|
127
|
+
// cancel active request before making next one.
|
|
128
|
+
// this is debouncing.
|
|
129
|
+
cancelAnimationFrame(requestId.current);
|
|
130
|
+
// create new request to set state on animation frame
|
|
131
|
+
requestId.current = requestAnimationFrame(() => {
|
|
132
|
+
setState(value);
|
|
133
|
+
});
|
|
134
|
+
}, []);
|
|
135
|
+
// cancel any active request when component unmounts
|
|
136
|
+
React.useEffect(() => {
|
|
137
|
+
return () => cancelAnimationFrame(requestId.current);
|
|
138
|
+
});
|
|
139
|
+
return [state, setRafState];
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const PREGNANCY_SLUG = {
|
|
143
|
+
'vi-VN': 'mang-thai',
|
|
144
|
+
'id-ID': 'kehamilan',
|
|
145
|
+
'ms-MY': 'kehamilan',
|
|
146
|
+
'km-KH': 'ពពោះ',
|
|
147
|
+
'en-PH': 'pregnancy',
|
|
148
|
+
'tl-PH': 'pregnancy',
|
|
149
|
+
'th-TH': 'การตั้งครรภ์',
|
|
150
|
+
'my-MM': 'pregnancy',
|
|
151
|
+
'zh-TW': 'pregnancy',
|
|
152
|
+
'hi-IN': 'pregnancy',
|
|
153
|
+
};
|
|
154
|
+
// NOTE: this is temporary mapping on 13/02/2023, can be outdated due to changes from content team in the future
|
|
155
|
+
const MAPPED_CATEGORY_SLUGS = {
|
|
156
|
+
[Subot.LOCALE.Vietnam]: {
|
|
157
|
+
sexualWellness: 'suc-khoe-tinh-duc',
|
|
158
|
+
health: 'suc-khoe',
|
|
159
|
+
healthyEating: 'an-uong-lanh-manh',
|
|
160
|
+
skinHealth: 'da-lieu',
|
|
161
|
+
healthyHabit: 'thoi-quen-lanh-manh',
|
|
162
|
+
drug: 'thuoc',
|
|
163
|
+
womensHealth: 'suc-khoe-phu-nu',
|
|
164
|
+
fitness: 'the-duc-the-thao',
|
|
165
|
+
pregnancy: 'mang-thai',
|
|
166
|
+
parenting: 'nuoi-day-con',
|
|
167
|
+
diabetes: 'tieu-duong-dai-thao-duong',
|
|
168
|
+
healthyMind: 'tam-ly-tam-than',
|
|
169
|
+
},
|
|
170
|
+
[Subot.LOCALE.Indonesia]: {
|
|
171
|
+
pregnancy: 'kehamilan',
|
|
172
|
+
parenting: 'parenting',
|
|
173
|
+
health: 'sehat',
|
|
174
|
+
diabetes: 'diabetes',
|
|
175
|
+
womensHealth: 'wanita',
|
|
176
|
+
drug: 'obat-suplemen',
|
|
177
|
+
sexualWellness: '',
|
|
178
|
+
healthyEating: '',
|
|
179
|
+
skinHealth: '',
|
|
180
|
+
},
|
|
181
|
+
[Subot.LOCALE.Malaysia]: {
|
|
182
|
+
pregnancy: 'kehamilan',
|
|
183
|
+
parenting: 'keibubapaan',
|
|
184
|
+
health: 'kesihatan',
|
|
185
|
+
diabetes: 'kencing-manis',
|
|
186
|
+
womensHealth: 'kesihatan-wanita',
|
|
187
|
+
drug: 'ubat',
|
|
188
|
+
sexualWellness: '',
|
|
189
|
+
healthyEating: '',
|
|
190
|
+
skinHealth: '',
|
|
191
|
+
},
|
|
192
|
+
[Subot.LOCALE.Cambodia]: {
|
|
193
|
+
pregnancy: '%e1%9e%96%e1%9e%96%e1%9f%84%e1%9f%87',
|
|
194
|
+
parenting: '%e1%9e%85%e1%9e%b7%e1%9e%89%e1%9f%92%e1%9e%85%e1%9e%b9%e1%9e%98%e1%9e%80%e1%9e%bc%e1%9e%93',
|
|
195
|
+
health: '%e1%9e%9f%e1%9e%bb%e1%9e%81%e1%9e%97%e1%9e%b6%e1%9e%96%e1%9e%91%e1%9e%bc%e1%9e%91%e1%9f%85',
|
|
196
|
+
diabetes: '%e1%9e%87%e1%9f%86%e1%9e%84%e1%9e%ba%e1%9e%91%e1%9e%b9%e1%9e%80%e1%9e%93%e1%9f%84%e1%9e%98%e1%9e%95%e1%9f%92%e1%9e%a2%e1%9f%82%e1%9e%98',
|
|
197
|
+
womensHealth: '%e1%9e%9f%e1%9e%bb%e1%9e%81%e1%9e%97%e1%9e%b6%e1%9e%96%e1%9e%9f%e1%9f%92%e1%9e%8f%e1%9f%92%e1%9e%9a%e1%9e%b8',
|
|
198
|
+
drug: '%e1%9e%b1%e1%9e%9f%e1%9e%90%e1%9e%93%e1%9e%b7%e1%9e%84%e1%9e%a2%e1%9e%b6%e1%9e%a0%e1%9e%b6%e1%9e%9a%e1%9e%94%e1%9f%86%e1%9e%94%e1%9f%89%e1%9e%93',
|
|
199
|
+
sexualWellness: '',
|
|
200
|
+
healthyEating: '',
|
|
201
|
+
skinHealth: '',
|
|
202
|
+
},
|
|
203
|
+
[Subot.LOCALE.PhilippinesEnglish]: {
|
|
204
|
+
pregnancy: 'pregnancy',
|
|
205
|
+
parenting: 'parenting',
|
|
206
|
+
health: 'health',
|
|
207
|
+
diabetes: 'diabetes',
|
|
208
|
+
womensHealth: 'womens-health',
|
|
209
|
+
drug: 'drugs-supplements',
|
|
210
|
+
sexualWellness: '',
|
|
211
|
+
healthyEating: '',
|
|
212
|
+
skinHealth: '',
|
|
213
|
+
},
|
|
214
|
+
[Subot.LOCALE.PhilippinesTagalog]: {
|
|
215
|
+
pregnancy: 'pagbubuntis',
|
|
216
|
+
parenting: 'pagiging-magulang',
|
|
217
|
+
health: 'kalusugan',
|
|
218
|
+
diabetes: 'diabetes-fil',
|
|
219
|
+
womensHealth: 'kalusugan-kababaihan',
|
|
220
|
+
drug: 'drugs-at-supplements',
|
|
221
|
+
sexualWellness: '',
|
|
222
|
+
healthyEating: '',
|
|
223
|
+
skinHealth: '',
|
|
224
|
+
},
|
|
225
|
+
[Subot.LOCALE.Thailand]: {
|
|
226
|
+
pregnancy: '%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87%e0%b8%84%e0%b8%a3%e0%b8%a3%e0%b8%a0%e0%b9%8c',
|
|
227
|
+
parenting: '%e0%b8%9e%e0%b9%88%e0%b8%ad%e0%b9%81%e0%b8%a1%e0%b9%88%e0%b9%80%e0%b8%a5%e0%b8%b5%e0%b9%89%e0%b8%a2%e0%b8%87%e0%b8%a5%e0%b8%b9%e0%b8%81',
|
|
228
|
+
health: '%e0%b8%aa%e0%b8%b8%e0%b8%82%e0%b8%a0%e0%b8%b2%e0%b8%9e',
|
|
229
|
+
diabetes: '%e0%b9%82%e0%b8%a3%e0%b8%84%e0%b9%80%e0%b8%9a%e0%b8%b2%e0%b8%ab%e0%b8%a7%e0%b8%b2%e0%b8%99',
|
|
230
|
+
womensHealth: '%e0%b8%aa%e0%b8%b8%e0%b8%82%e0%b8%a0%e0%b8%b2%e0%b8%9e%e0%b8%ab%e0%b8%8d%e0%b8%b4%e0%b8%87',
|
|
231
|
+
drug: '%e0%b8%a2%e0%b8%b2%e0%b9%81%e0%b8%a5%e0%b8%b0%e0%b8%ad%e0%b8%b2%e0%b8%ab%e0%b8%b2%e0%b8%a3%e0%b9%80%e0%b8%aa%e0%b8%a3%e0%b8%b4%e0%b8%a1',
|
|
232
|
+
sexualWellness: '',
|
|
233
|
+
healthyEating: '',
|
|
234
|
+
skinHealth: '',
|
|
235
|
+
},
|
|
236
|
+
[Subot.LOCALE.Myanmar]: {
|
|
237
|
+
pregnancy: 'pregnancy',
|
|
238
|
+
parenting: 'parenting',
|
|
239
|
+
health: 'health',
|
|
240
|
+
diabetes: 'diabetes',
|
|
241
|
+
womensHealth: 'womens-health',
|
|
242
|
+
drug: 'drugs-az',
|
|
243
|
+
sexualWellness: '',
|
|
244
|
+
healthyEating: '',
|
|
245
|
+
skinHealth: '',
|
|
246
|
+
},
|
|
247
|
+
[Subot.LOCALE.Taiwan]: {
|
|
248
|
+
pregnancy: 'pregnancy',
|
|
249
|
+
parenting: 'parenting',
|
|
250
|
+
health: 'health',
|
|
251
|
+
diabetes: 'diabetes',
|
|
252
|
+
womensHealth: 'womens-health',
|
|
253
|
+
drug: 'drugs-supplement',
|
|
254
|
+
sexualWellness: '',
|
|
255
|
+
healthyEating: '',
|
|
256
|
+
skinHealth: '',
|
|
257
|
+
},
|
|
258
|
+
[Subot.LOCALE.India]: {
|
|
259
|
+
pregnancy: 'pregnancy',
|
|
260
|
+
parenting: 'parenting',
|
|
261
|
+
health: 'health',
|
|
262
|
+
diabetes: 'diabetes',
|
|
263
|
+
womensHealth: 'womens-health',
|
|
264
|
+
diabetesEn: 'en-diabetes',
|
|
265
|
+
drug: 'dawaai',
|
|
266
|
+
sexualWellness: '',
|
|
267
|
+
healthyEating: '',
|
|
268
|
+
skinHealth: '',
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
function getCategoryFromURL(url, categories) {
|
|
272
|
+
const urlParts = url.split('/');
|
|
273
|
+
for (const key in categories) {
|
|
274
|
+
const keyword = categories[key];
|
|
275
|
+
if (urlParts.includes(keyword)) {
|
|
276
|
+
return key;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return null; // Return null if no matching key is found
|
|
280
|
+
}
|
|
281
|
+
const useCategory = (asPath) => {
|
|
282
|
+
const { locale } = useTranslations.useTranslations();
|
|
283
|
+
const isPregnancy = React.useMemo(() => decodeURI(asPath.replace(/\//gi, '')).includes(PREGNANCY_SLUG[locale]), []);
|
|
284
|
+
const isParenting = React.useMemo(() => {
|
|
285
|
+
var _a;
|
|
286
|
+
return decodeURI(asPath.replace(/\//gi, '')).includes((_a = MAPPED_CATEGORY_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.parenting);
|
|
287
|
+
}, []);
|
|
288
|
+
const type = React.useMemo(() => {
|
|
289
|
+
return getCategoryFromURL(asPath, MAPPED_CATEGORY_SLUGS[locale]);
|
|
290
|
+
}, [asPath, locale]);
|
|
291
|
+
return { isPregnancy, isParenting, type };
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
exports.MAPPED_CATEGORY_SLUGS = MAPPED_CATEGORY_SLUGS;
|
|
295
|
+
exports.PREGNANCY_SLUG = PREGNANCY_SLUG;
|
|
296
|
+
exports.useCategory = useCategory;
|
|
297
|
+
exports.useFbDataLayer = useFbDataLayer;
|
|
298
|
+
exports.usePrevious = usePrevious;
|
|
299
|
+
exports.useRafState = useRafState;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-abc17c4d.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var getDynamicHealthTool = require('./getDynamicHealthTool-b66c50c2.js');
|
|
6
|
+
|
|
7
|
+
const useHealthToolsCache = (locale) => {
|
|
8
|
+
const [allTools, setAllTools] = React.useState([]);
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
(() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
+
const allHealthTools = yield getDynamicHealthTool.getDynamicHealthToolWithCache(locale);
|
|
12
|
+
setAllTools(allHealthTools);
|
|
13
|
+
}))();
|
|
14
|
+
}, [getDynamicHealthTool.getDynamicHealthToolWithCache, locale]);
|
|
15
|
+
const getHealthToolLink = React.useCallback((type) => { var _a; return ((_a = allTools.find((tool) => tool.template === type)) === null || _a === void 0 ? void 0 : _a.link) || ''; }, [allTools]);
|
|
16
|
+
return { allTools, getHealthToolLink };
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.useHealthToolsCache = useHealthToolsCache;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
const callbacks = new Map();
|
|
6
|
+
const handleClick = (e) => {
|
|
7
|
+
for (const [ref, callback] of callbacks) {
|
|
8
|
+
if (ref.current && !ref.current.contains(e.target)) {
|
|
9
|
+
callback(e);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const initSharedOutSideClickListener = () => {
|
|
14
|
+
document.addEventListener('mousedown', handleClick, {
|
|
15
|
+
passive: true,
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
/** require the use of initSharedOutSideClickListener once, anywhere globally */
|
|
19
|
+
const useSharedOutsideClick = (ref, callback) => {
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
callbacks.set(ref, callback);
|
|
22
|
+
return () => {
|
|
23
|
+
callbacks.delete(ref);
|
|
24
|
+
};
|
|
25
|
+
}, [ref, callback]);
|
|
26
|
+
};
|
|
27
|
+
const useOutsideClick = (ref, callback) => {
|
|
28
|
+
const handleClick = React.useCallback((e) => {
|
|
29
|
+
var _a;
|
|
30
|
+
// If the click target is a descendant of the ref, ignore it
|
|
31
|
+
if ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// Otherwise, invoke the callback
|
|
35
|
+
callback(e);
|
|
36
|
+
}, []);
|
|
37
|
+
React.useEffect(() => {
|
|
38
|
+
document.addEventListener('mousedown', handleClick, {
|
|
39
|
+
passive: true,
|
|
40
|
+
});
|
|
41
|
+
return () => {
|
|
42
|
+
document.removeEventListener('mousedown', handleClick);
|
|
43
|
+
};
|
|
44
|
+
}, [handleClick]);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.initSharedOutSideClickListener = initSharedOutSideClickListener;
|
|
48
|
+
exports.useOutsideClick = useOutsideClick;
|
|
49
|
+
exports.useSharedOutsideClick = useSharedOutsideClick;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-abc17c4d.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
const formatAutoCompleteAddress = (addresses) => {
|
|
7
|
+
if (!addresses || addresses.length < 1)
|
|
8
|
+
return [];
|
|
9
|
+
return addresses.map((s) => ({
|
|
10
|
+
placeId: s.place_id,
|
|
11
|
+
description: s.description,
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
const IS_SSR = typeof window === 'undefined';
|
|
15
|
+
// https://developers.google.com/maps/faq#languagesupport
|
|
16
|
+
const GOOGLE_API_LANGUAGE = {
|
|
17
|
+
VN: 'vi',
|
|
18
|
+
ID: 'id',
|
|
19
|
+
TH: 'th',
|
|
20
|
+
MY: 'ms',
|
|
21
|
+
TW: 'zh-TW',
|
|
22
|
+
KH: 'km',
|
|
23
|
+
MM: 'my',
|
|
24
|
+
IN: 'hi',
|
|
25
|
+
PH: 'en',
|
|
26
|
+
};
|
|
27
|
+
const GOOGLE_API_KEY = 'AIzaSyD9AbNa4AFwr8eNVs90G1YhQLhfWJ6KncU';
|
|
28
|
+
const googleAutocomplete = (text = '', countrycode = '', languageCountrycode = 'vi') => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
|
+
if (!text) {
|
|
31
|
+
return reject('Need valid text input');
|
|
32
|
+
}
|
|
33
|
+
if (IS_SSR) {
|
|
34
|
+
return reject('Need valid window object');
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
new window.google.maps.places.AutocompleteService().getPlacePredictions(Object.assign(Object.assign({ input: text }, (countrycode
|
|
38
|
+
? {
|
|
39
|
+
componentRestrictions: { country: countrycode },
|
|
40
|
+
}
|
|
41
|
+
: {})), { language: GOOGLE_API_LANGUAGE[languageCountrycode] }), resolve);
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
reject(e);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
const usePlacesAutocomplete = (text = '', countrycode = '', languageCountrycode = '', debounceTimeout = 500) => {
|
|
49
|
+
const [predictions, setPredictions] = React.useState([]);
|
|
50
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
51
|
+
React.useEffect(() => {
|
|
52
|
+
let handleDebounce;
|
|
53
|
+
if (text) {
|
|
54
|
+
handleDebounce = window.setTimeout(() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
+
if (!text) {
|
|
56
|
+
setPredictions([]);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
setIsLoading(true);
|
|
61
|
+
const nextPredictions = yield googleAutocomplete(text, countrycode, languageCountrycode);
|
|
62
|
+
setPredictions(formatAutoCompleteAddress(nextPredictions));
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
console.error(e);
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
setIsLoading(false);
|
|
69
|
+
}
|
|
70
|
+
}), debounceTimeout);
|
|
71
|
+
}
|
|
72
|
+
else if (predictions.length) {
|
|
73
|
+
setPredictions([]);
|
|
74
|
+
}
|
|
75
|
+
return () => {
|
|
76
|
+
window.clearTimeout(handleDebounce);
|
|
77
|
+
};
|
|
78
|
+
}, [text, debounceTimeout, countrycode]);
|
|
79
|
+
return { isLoading, predictions };
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
exports.GOOGLE_API_KEY = GOOGLE_API_KEY;
|
|
83
|
+
exports.GOOGLE_API_LANGUAGE = GOOGLE_API_LANGUAGE;
|
|
84
|
+
exports.usePlacesAutocomplete = usePlacesAutocomplete;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var debounce = require('lodash/debounce');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
7
|
+
|
|
8
|
+
var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
9
|
+
|
|
10
|
+
const MEASURE_ELEMENT_CLASS = 'measure-scrollbar-size';
|
|
11
|
+
const useScrollbarSize = (trigger = true) => {
|
|
12
|
+
const [dimensions, setDimensions] = React.useState({ height: 0, width: 0 });
|
|
13
|
+
const element = React.useRef(null);
|
|
14
|
+
// initialize resize event handler and state when mounted
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
if (!trigger || typeof window === 'undefined') {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const getElement = () => {
|
|
20
|
+
if (!element.current) {
|
|
21
|
+
// element was not created yet -- initialize
|
|
22
|
+
element.current = document.createElement('div');
|
|
23
|
+
element.current.classList.add(MEASURE_ELEMENT_CLASS);
|
|
24
|
+
element.current.style.width = '99px';
|
|
25
|
+
element.current.style.height = '99px';
|
|
26
|
+
element.current.style.overflow = 'scroll';
|
|
27
|
+
element.current.style.position = 'absolute';
|
|
28
|
+
element.current.style.top = '-9999px';
|
|
29
|
+
element.current.setAttribute('aria-hidden', 'true');
|
|
30
|
+
element.current.setAttribute('role', 'presentation');
|
|
31
|
+
}
|
|
32
|
+
return element.current;
|
|
33
|
+
};
|
|
34
|
+
const updateState = () => {
|
|
35
|
+
const { offsetHeight, clientHeight, offsetWidth, clientWidth } = getElement();
|
|
36
|
+
const scrollbarHeight = offsetHeight - clientHeight;
|
|
37
|
+
const scrollbarWidth = offsetWidth - clientWidth;
|
|
38
|
+
setDimensions((currentDimensions) => {
|
|
39
|
+
const { height, width } = currentDimensions;
|
|
40
|
+
return height !== scrollbarHeight || width !== scrollbarWidth
|
|
41
|
+
? { height: scrollbarHeight, width: scrollbarWidth }
|
|
42
|
+
: currentDimensions;
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
const handleResize = debounce__default["default"](updateState, 100);
|
|
46
|
+
// initialize
|
|
47
|
+
window.addEventListener('resize', handleResize, {
|
|
48
|
+
passive: true,
|
|
49
|
+
});
|
|
50
|
+
document.body.appendChild(getElement());
|
|
51
|
+
updateState();
|
|
52
|
+
const elementToRemove = getElement();
|
|
53
|
+
// cleanup
|
|
54
|
+
return () => {
|
|
55
|
+
handleResize.cancel();
|
|
56
|
+
window.removeEventListener('resize', handleResize);
|
|
57
|
+
document.body.removeChild(elementToRemove);
|
|
58
|
+
};
|
|
59
|
+
}, [trigger]);
|
|
60
|
+
return dimensions;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
exports.MEASURE_ELEMENT_CLASS = MEASURE_ELEMENT_CLASS;
|
|
64
|
+
exports.useScrollbarSize = useScrollbarSize;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var translationsContext = require('./translationsContext-7e9f4617.js');
|
|
5
|
+
var formatString = require('string-format');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var formatString__default = /*#__PURE__*/_interopDefault(formatString);
|
|
10
|
+
|
|
11
|
+
function useTranslations() {
|
|
12
|
+
const { values, locale } = React.useContext(translationsContext.TranslationsContext) || {
|
|
13
|
+
locale: 'en-PH',
|
|
14
|
+
};
|
|
15
|
+
return React.useMemo(() => ({
|
|
16
|
+
t(k, option) {
|
|
17
|
+
if (!values) {
|
|
18
|
+
console.error('[useTranslations] t method called before translation values are loaded');
|
|
19
|
+
return k;
|
|
20
|
+
}
|
|
21
|
+
if (values[k]) {
|
|
22
|
+
return option ? formatString__default["default"](values[k] || k, option) : values[k] || k;
|
|
23
|
+
}
|
|
24
|
+
console.warn(`[useTranslations] Missing translation for key ${k} and locale ${locale}`);
|
|
25
|
+
return option ? formatString__default["default"](k, option) : k;
|
|
26
|
+
},
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
locale,
|
|
29
|
+
}), [values, locale]);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
exports.useTranslations = useTranslations;
|