@hhgtech/hhg-components 1.28.67 → 1.28.69
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-48c9471d.js +688 -0
- package/build/BMI_BOYS.percentile.weekly-4965852e.js +182 -0
- package/build/BMI_BOYS.percentile.yearly-0f7cc8f4.js +83 -0
- package/build/BMI_BOYS.zscore.monthly-5bb8a433.js +440 -0
- package/build/BMI_BOYS.zscore.weekly-3d56f80f.js +118 -0
- package/build/BMI_BOYS.zscore.yearly-57081f24.js +55 -0
- package/build/BMI_GIRLS.percentile.monthly-95859cd9.js +688 -0
- package/build/BMI_GIRLS.percentile.weekly-009cf4df.js +182 -0
- package/build/BMI_GIRLS.percentile.yearly-4436947b.js +83 -0
- package/build/BMI_GIRLS.zscore.monthly-689b4eee.js +440 -0
- package/build/BMI_GIRLS.zscore.weekly-dff693df.js +118 -0
- package/build/BMI_GIRLS.zscore.yearly-05ef5f4f.js +55 -0
- package/build/ChevronDown-275f1ab5.js +29 -0
- package/build/HEAD CIRCUM_BOYS.percentile.monthly-55c580a7.js +688 -0
- package/build/HEAD CIRCUM_BOYS.percentile.weekly-e30f4a42.js +182 -0
- package/build/HEAD CIRCUM_BOYS.percentile.yearly-2378a5f0.js +83 -0
- package/build/HEAD CIRCUM_BOYS.zscore.monthly-102d5559.js +440 -0
- package/build/HEAD CIRCUM_BOYS.zscore.weekly-7b0f1ba8.js +118 -0
- package/build/HEAD CIRCUM_BOYS.zscore.yearly-e9237d31.js +55 -0
- package/build/HEAD CIRCUM_GIRLS.percentile.monthly-1ddda8b3.js +688 -0
- package/build/HEAD CIRCUM_GIRLS.percentile.weekly-843147ea.js +182 -0
- package/build/HEAD CIRCUM_GIRLS.percentile.yearly-9b51c237.js +83 -0
- package/build/HEAD CIRCUM_GIRLS.zscore.monthly-3f1b233c.js +440 -0
- package/build/HEAD CIRCUM_GIRLS.zscore.weekly-9e14d3fe.js +118 -0
- package/build/HEAD CIRCUM_GIRLS.zscore.yearly-d924f5ae.js +55 -0
- package/build/HEIGHT_BOYS.percentile.monthly-15538920.js +688 -0
- package/build/HEIGHT_BOYS.percentile.weekly-10bd0277.js +182 -0
- package/build/HEIGHT_BOYS.percentile.yearly-8e678d38.js +237 -0
- package/build/HEIGHT_BOYS.zscore.monthly-2c110da9.js +440 -0
- package/build/HEIGHT_BOYS.zscore.weekly-288b7733.js +118 -0
- package/build/HEIGHT_BOYS.zscore.yearly-42f6f9f7.js +153 -0
- package/build/HEIGHT_GIRLS.percentile.monthly-04abe7d2.js +688 -0
- package/build/HEIGHT_GIRLS.percentile.weekly-9653b16c.js +182 -0
- package/build/HEIGHT_GIRLS.percentile.yearly-9efacd67.js +237 -0
- package/build/HEIGHT_GIRLS.zscore.monthly-c64a97b2.js +440 -0
- package/build/HEIGHT_GIRLS.zscore.weekly-3302dd83.js +118 -0
- package/build/HEIGHT_GIRLS.zscore.yearly-ebe5114f.js +153 -0
- package/build/Subot-5fc40fb5.js +217 -0
- package/build/Visible-5c5d57cf.js +29 -0
- package/build/WEIGHT_BOYS.percentile.monthly-5e11e7a0.js +688 -0
- package/build/WEIGHT_BOYS.percentile.weekly-68ae2578.js +182 -0
- package/build/WEIGHT_BOYS.percentile.yearly-030c06a4.js +138 -0
- package/build/WEIGHT_BOYS.zscore.monthly-d22c7b57.js +440 -0
- package/build/WEIGHT_BOYS.zscore.weekly-d8d901e6.js +118 -0
- package/build/WEIGHT_BOYS.zscore.yearly-c311a084.js +90 -0
- package/build/WEIGHT_GIRLS.percentile.monthly-5c44f8eb.js +688 -0
- package/build/WEIGHT_GIRLS.percentile.weekly-faa98671.js +182 -0
- package/build/WEIGHT_GIRLS.percentile.yearly-560b862e.js +138 -0
- package/build/WEIGHT_GIRLS.zscore.monthly-5365ba1a.js +440 -0
- package/build/WEIGHT_GIRLS.zscore.weekly-0d9dc521.js +118 -0
- package/build/WEIGHT_GIRLS.zscore.yearly-5a3c4e43.js +90 -0
- package/build/adapters.js +36 -1
- package/build/{esm/animation-0340efb3.js → animation-eb4e500b.js} +32 -10
- package/build/babyGrowth.js +913 -47
- package/build/cache.js +13 -1
- package/build/care.js +38 -1
- package/build/components/navigationV2/hooks/useNavConfig.d.ts +1 -3
- package/build/components.js +186 -1
- package/build/constants-8b8bc19f.js +255 -0
- package/build/constants-ae18ce18.js +935 -0
- package/build/constants.js +43 -1
- package/build/cookieHelper-5c9f4bb8.js +43 -0
- package/build/core-2aa8d86c.js +51 -0
- package/build/dataTransform-089f414c.js +66 -0
- package/build/ecom.js +745 -1
- package/build/esm/BMI_BOYS.percentile.monthly-de5dce68.js +686 -0
- package/build/esm/BMI_BOYS.percentile.weekly-9d3990b6.js +180 -0
- package/build/esm/BMI_BOYS.percentile.yearly-98b9114a.js +81 -0
- package/build/esm/BMI_BOYS.zscore.monthly-394646f0.js +438 -0
- package/build/esm/BMI_BOYS.zscore.weekly-c669ea51.js +116 -0
- package/build/esm/BMI_BOYS.zscore.yearly-771ef6b6.js +53 -0
- package/build/esm/BMI_GIRLS.percentile.monthly-1ff3d499.js +686 -0
- package/build/esm/BMI_GIRLS.percentile.weekly-211d2f27.js +180 -0
- package/build/esm/BMI_GIRLS.percentile.yearly-206fdcff.js +81 -0
- package/build/esm/BMI_GIRLS.zscore.monthly-b1137e36.js +438 -0
- package/build/esm/BMI_GIRLS.zscore.weekly-63ed3cd6.js +116 -0
- package/build/esm/BMI_GIRLS.zscore.yearly-221d187c.js +53 -0
- package/build/esm/ChevronDown-9a8ece61.js +7 -0
- package/build/esm/HEAD CIRCUM_BOYS.percentile.monthly-4c37847c.js +686 -0
- package/build/esm/HEAD CIRCUM_BOYS.percentile.weekly-8f6ea38a.js +180 -0
- package/build/esm/HEAD CIRCUM_BOYS.percentile.yearly-6c12a99a.js +81 -0
- package/build/esm/HEAD CIRCUM_BOYS.zscore.monthly-c531b497.js +438 -0
- package/build/esm/HEAD CIRCUM_BOYS.zscore.weekly-6cafba00.js +116 -0
- package/build/esm/HEAD CIRCUM_BOYS.zscore.yearly-fe8114a0.js +53 -0
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.monthly-25ce0d36.js +686 -0
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.weekly-5d3f2862.js +180 -0
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.yearly-2b709ca5.js +81 -0
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.monthly-e8617bae.js +438 -0
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.weekly-f3252d67.js +116 -0
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.yearly-5b62d41f.js +53 -0
- package/build/esm/HEIGHT_BOYS.percentile.monthly-63d2cf96.js +686 -0
- package/build/esm/HEIGHT_BOYS.percentile.weekly-8ea5102d.js +180 -0
- package/build/esm/HEIGHT_BOYS.percentile.yearly-8107b77b.js +235 -0
- package/build/esm/HEIGHT_BOYS.zscore.monthly-641cdfa3.js +438 -0
- package/build/esm/HEIGHT_BOYS.zscore.weekly-86da0362.js +116 -0
- package/build/esm/HEIGHT_BOYS.zscore.yearly-060f6e79.js +151 -0
- package/build/esm/HEIGHT_GIRLS.percentile.monthly-fb987d37.js +686 -0
- package/build/esm/HEIGHT_GIRLS.percentile.weekly-82655dc0.js +180 -0
- package/build/esm/HEIGHT_GIRLS.percentile.yearly-a63b8456.js +235 -0
- package/build/esm/HEIGHT_GIRLS.zscore.monthly-77d676a3.js +438 -0
- package/build/esm/HEIGHT_GIRLS.zscore.weekly-c0387a4e.js +116 -0
- package/build/esm/HEIGHT_GIRLS.zscore.yearly-41203c20.js +151 -0
- package/build/esm/Subot-3289bd8e.js +212 -0
- package/build/esm/Visible-a3d436dd.js +7 -0
- package/build/esm/WEIGHT_BOYS.percentile.monthly-50802d8b.js +686 -0
- package/build/esm/WEIGHT_BOYS.percentile.weekly-4d72ddd6.js +180 -0
- package/build/esm/WEIGHT_BOYS.percentile.yearly-20a29844.js +136 -0
- package/build/esm/WEIGHT_BOYS.zscore.monthly-729e6614.js +438 -0
- package/build/esm/WEIGHT_BOYS.zscore.weekly-90352f48.js +116 -0
- package/build/esm/WEIGHT_BOYS.zscore.yearly-fe1871cc.js +88 -0
- package/build/esm/WEIGHT_GIRLS.percentile.monthly-e6afb2e0.js +686 -0
- package/build/esm/WEIGHT_GIRLS.percentile.weekly-b66d3016.js +180 -0
- package/build/esm/WEIGHT_GIRLS.percentile.yearly-a55622c5.js +136 -0
- package/build/esm/WEIGHT_GIRLS.zscore.monthly-2cdcbe75.js +438 -0
- package/build/esm/WEIGHT_GIRLS.zscore.weekly-d5be31d5.js +116 -0
- package/build/esm/WEIGHT_GIRLS.zscore.yearly-99e8d3a7.js +88 -0
- package/build/esm/adapters.js +26 -1
- package/build/{animation-d5d9ef32.js → esm/animation-3d5edc39.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/navigationV2/hooks/useNavConfig.d.ts +1 -3
- package/build/esm/components.js +88 -1
- package/build/esm/constants-2a6d2434.js +932 -0
- package/build/esm/constants-b77ffe3d.js +238 -0
- package/build/esm/constants.js +4 -1
- package/build/esm/cookieHelper-d314282c.js +39 -0
- package/build/esm/core-8c73d133.js +47 -0
- package/build/esm/dataTransform-8ecfc046.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-f4497aa5.js +44 -0
- package/build/esm/getSocialList-a5b8462e.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-12fa4985.js +8 -0
- package/build/esm/index-1e59f99a.js +152 -0
- package/build/esm/index-32e53dac.js +1936 -0
- package/build/esm/index-3474401a.js +149 -0
- package/build/esm/index-34899aa3.js +17 -0
- package/build/esm/index-350e8f5b.js +124 -0
- package/build/esm/index-41bf860a.js +151 -0
- package/build/esm/index-4aa8e518.js +116 -0
- package/build/esm/index-4fe2b03f.js +32 -0
- package/build/esm/index-6ea6484e.js +29 -0
- package/build/esm/index-717401ee.js +184 -0
- package/build/esm/index-7af5242a.js +24 -0
- package/build/esm/index-7b8c85cd.js +8302 -0
- package/build/esm/index-81f295b7.js +23 -0
- package/build/esm/index-8858383e.js +52 -0
- package/build/esm/index-8f52dcf3.js +33 -0
- package/build/esm/index-9ea7e838.js +33 -0
- package/build/esm/index-aabac2aa.js +3241 -0
- package/build/esm/index-b9b2c417.js +837 -0
- package/build/esm/index-c2da5293.js +12 -0
- package/build/esm/index-c56d60db.js +370 -0
- package/build/esm/index-c5d7f692.js +24 -0
- package/build/esm/index-cc93e010.js +53 -0
- package/build/esm/index-d7f046db.js +5 -0
- package/build/esm/index-d8177667.js +14 -0
- package/build/esm/index-da139dda.js +615 -0
- package/build/esm/index-e612be9c.js +905 -0
- package/build/esm/index-f3d0592b.js +71 -0
- package/build/esm/index.js +190 -1
- package/build/{index.styled-0a1fb891.js → esm/index.styled-9c9db9cc.js} +17 -5
- package/build/esm/index.styles-5add27c5.js +1303 -0
- package/build/esm/isProduction-0ea904dd.js +27 -0
- package/build/esm/lead.js +2140 -1
- package/build/esm/localizeNumberFormat-2ac3773e.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-d1c9617e.js +12 -0
- package/build/esm/number-0c126a39.js +38 -0
- package/build/esm/onboardingV2.js +860 -34
- package/build/esm/paths-a8204db4.js +14 -0
- package/build/esm/pwg.js +208 -7
- package/build/esm/routing-2474f896.js +40 -0
- package/build/esm/subot.js +4553 -134
- package/build/esm/theme-e74db08c.js +186 -0
- package/build/esm/together.js +52 -1
- package/build/esm/translationsContext-ad3e25de.js +5 -0
- package/build/esm/tslib.es6-1b1533a9.js +38 -0
- package/build/esm/types-06f00b3d.js +8015 -0
- package/build/esm/types-15e34418.js +3432 -0
- package/build/esm/types-ba190c26.js +21 -0
- package/build/esm/types.js +1 -1
- package/build/esm/unifyEnv.js +42 -1
- package/build/esm/useCategory-2c87152d.js +292 -0
- package/build/esm/useHealthToolCache-29d22ddb.js +17 -0
- package/build/esm/useIsInit-8a2fc8e5.js +11 -0
- package/build/esm/useOutsideClick-c8a7ff20.js +45 -0
- package/build/esm/usePlacesAutocomplete-63e04e8e.js +80 -0
- package/build/esm/useScrollbarSize-51ce1374.js +57 -0
- package/build/esm/useTranslations-4f1db486.js +26 -0
- package/build/esm/useUniqueId-3638402f.js +41 -0
- package/build/esm/utils-2c484c05.js +132 -0
- package/build/esm/utils-3a2a47d9.js +22 -0
- package/build/esm/utils-6d7b88da.js +367 -0
- package/build/esm/utils-70718e9c.js +1124 -0
- package/build/esm/vaccination.js +868 -40
- package/build/footer.js +39 -1
- package/build/gAssets.js +14 -1
- package/build/getDynamicHealthTool-114a1e27.js +48 -0
- package/build/getSocialList-4713441d.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-020e6908.js +39 -0
- package/build/index-0da9b2e8.js +59 -0
- package/build/index-11468c00.js +157 -0
- package/build/index-117448a5.js +133 -0
- package/build/index-12c07f71.js +18 -0
- package/build/index-1a105e87.js +123 -0
- package/build/index-1baaedb0.js +55 -0
- package/build/index-32d38318.js +7 -0
- package/build/index-38582ee0.js +8373 -0
- package/build/index-3e5fc2d6.js +1994 -0
- package/build/index-3eef6bed.js +853 -0
- package/build/index-4035e658.js +159 -0
- package/build/index-488d71ae.js +30 -0
- package/build/index-5553f9e1.js +930 -0
- package/build/index-5fa68e45.js +380 -0
- package/build/index-7b467209.js +39 -0
- package/build/index-81cb1142.js +77 -0
- package/build/index-84ab5b89.js +38 -0
- package/build/index-8a95d709.js +30 -0
- package/build/index-9da9f0c3.js +35 -0
- package/build/index-af91c83e.js +20 -0
- package/build/index-b6aea85e.js +191 -0
- package/build/index-bc4f4c33.js +156 -0
- package/build/index-c604d6bb.js +624 -0
- package/build/index-d330735e.js +30 -0
- package/build/index-d8a7efaf.js +14 -0
- package/build/index-e2e81fa2.js +23 -0
- package/build/index-e3d896b3.js +3261 -0
- package/build/index.js +436 -1
- package/build/{esm/index.styled-14b65c9e.js → index.styled-5628b3e7.js} +25 -5
- package/build/index.styles-b822bf42.js +1342 -0
- package/build/isProduction-5ce3a388.js +29 -0
- package/build/lead.js +2168 -1
- package/build/localizeNumberFormat-f5f50987.js +31 -0
- package/build/mantine.js +154 -1
- package/build/misc.js +70 -1
- package/build/navigation.js +61 -1
- package/build/normalizeLink-6f7b85d8.js +15 -0
- package/build/number-79fe92e1.js +40 -0
- package/build/onboardingV2.js +892 -34
- package/build/paths-a5643d9e.js +16 -0
- package/build/pwg.js +217 -7
- package/build/routing-191a9a00.js +46 -0
- package/build/subot.js +4592 -134
- package/build/theme-fa910869.js +189 -0
- package/build/together.js +112 -1
- package/build/translationsContext-950334bf.js +7 -0
- package/build/tslib.es6-65e312a5.js +41 -0
- package/build/types-0f117a9f.js +8084 -0
- package/build/types-1fedb3d1.js +3446 -0
- package/build/types-52a4e888.js +24 -0
- package/build/types.js +56 -1
- package/build/unifyEnv.js +46 -1
- package/build/useCategory-cfc702f5.js +299 -0
- package/build/useHealthToolCache-43a7014d.js +19 -0
- package/build/useIsInit-89535012.js +13 -0
- package/build/useOutsideClick-c6813964.js +49 -0
- package/build/usePlacesAutocomplete-297de092.js +84 -0
- package/build/useScrollbarSize-0fa31aa7.js +64 -0
- package/build/useTranslations-e1853417.js +32 -0
- package/build/useUniqueId-11369116.js +44 -0
- package/build/utils-52113753.js +384 -0
- package/build/utils-64bd0c42.js +143 -0
- package/build/utils-661411f6.js +1171 -0
- package/build/utils-e1513cbc.js +25 -0
- package/build/vaccination.js +891 -40
- package/package.json +4 -5
- package/build/BMI_BOYS.percentile.monthly-c56b0165.js +0 -1
- package/build/BMI_BOYS.percentile.weekly-64287e04.js +0 -1
- package/build/BMI_BOYS.percentile.yearly-8db65d54.js +0 -1
- package/build/BMI_BOYS.zscore.monthly-f12389cd.js +0 -1
- package/build/BMI_BOYS.zscore.weekly-fff37a57.js +0 -1
- package/build/BMI_BOYS.zscore.yearly-a19b57eb.js +0 -1
- package/build/BMI_GIRLS.percentile.monthly-a4b36d7d.js +0 -1
- package/build/BMI_GIRLS.percentile.weekly-b6089202.js +0 -1
- package/build/BMI_GIRLS.percentile.yearly-0d340818.js +0 -1
- package/build/BMI_GIRLS.zscore.monthly-fd5b57c0.js +0 -1
- package/build/BMI_GIRLS.zscore.weekly-d4577f50.js +0 -1
- package/build/BMI_GIRLS.zscore.yearly-e40b8a7d.js +0 -1
- package/build/ChevronDown-602ce39e.js +0 -1
- package/build/HEAD CIRCUM_BOYS.percentile.monthly-2e4c5776.js +0 -1
- package/build/HEAD CIRCUM_BOYS.percentile.weekly-fc5728a5.js +0 -1
- package/build/HEAD CIRCUM_BOYS.percentile.yearly-6bfab277.js +0 -1
- package/build/HEAD CIRCUM_BOYS.zscore.monthly-6af7ce44.js +0 -1
- package/build/HEAD CIRCUM_BOYS.zscore.weekly-9adb819b.js +0 -1
- package/build/HEAD CIRCUM_BOYS.zscore.yearly-9a6cdbcf.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.percentile.monthly-e7bfe9c6.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.percentile.weekly-9f17e019.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.percentile.yearly-8a59f541.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.zscore.monthly-b7ddb16c.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.zscore.weekly-72701c55.js +0 -1
- package/build/HEAD CIRCUM_GIRLS.zscore.yearly-dd94bded.js +0 -1
- package/build/HEIGHT_BOYS.percentile.monthly-b890068c.js +0 -1
- package/build/HEIGHT_BOYS.percentile.weekly-a1aa5130.js +0 -1
- package/build/HEIGHT_BOYS.percentile.yearly-5727d920.js +0 -1
- package/build/HEIGHT_BOYS.zscore.monthly-13b70aa6.js +0 -1
- package/build/HEIGHT_BOYS.zscore.weekly-3e1d7f23.js +0 -1
- package/build/HEIGHT_BOYS.zscore.yearly-a956102d.js +0 -1
- package/build/HEIGHT_GIRLS.percentile.monthly-da5ec01b.js +0 -1
- package/build/HEIGHT_GIRLS.percentile.weekly-e6205d32.js +0 -1
- package/build/HEIGHT_GIRLS.percentile.yearly-caefa502.js +0 -1
- package/build/HEIGHT_GIRLS.zscore.monthly-102ba473.js +0 -1
- package/build/HEIGHT_GIRLS.zscore.weekly-db4f710b.js +0 -1
- package/build/HEIGHT_GIRLS.zscore.yearly-36465920.js +0 -1
- package/build/Subot-4751194d.js +0 -1
- package/build/Visible-9497c463.js +0 -1
- package/build/WEIGHT_BOYS.percentile.monthly-554d0361.js +0 -1
- package/build/WEIGHT_BOYS.percentile.weekly-8e5334b8.js +0 -1
- package/build/WEIGHT_BOYS.percentile.yearly-536e1ccb.js +0 -1
- package/build/WEIGHT_BOYS.zscore.monthly-01eccee1.js +0 -1
- package/build/WEIGHT_BOYS.zscore.weekly-ee8f2c6b.js +0 -1
- package/build/WEIGHT_BOYS.zscore.yearly-0aea2749.js +0 -1
- package/build/WEIGHT_GIRLS.percentile.monthly-7abf9d06.js +0 -1
- package/build/WEIGHT_GIRLS.percentile.weekly-f9b6e963.js +0 -1
- package/build/WEIGHT_GIRLS.percentile.yearly-254865a5.js +0 -1
- package/build/WEIGHT_GIRLS.zscore.monthly-909f7417.js +0 -1
- package/build/WEIGHT_GIRLS.zscore.weekly-e62cd084.js +0 -1
- package/build/WEIGHT_GIRLS.zscore.yearly-8d6e5405.js +0 -1
- package/build/constants-00e06f68.js +0 -108
- package/build/constants-51251306.js +0 -1
- package/build/cookieHelper-7d519a72.js +0 -1
- package/build/core-ba3af3e2.js +0 -1
- package/build/dataTransform-1805eae3.js +0 -1
- package/build/esm/BMI_BOYS.percentile.monthly-6272f835.js +0 -1
- package/build/esm/BMI_BOYS.percentile.weekly-80d18f47.js +0 -1
- package/build/esm/BMI_BOYS.percentile.yearly-a7e5b5f6.js +0 -1
- package/build/esm/BMI_BOYS.zscore.monthly-d3658f97.js +0 -1
- package/build/esm/BMI_BOYS.zscore.weekly-6e6708dc.js +0 -1
- package/build/esm/BMI_BOYS.zscore.yearly-b8400c9d.js +0 -1
- package/build/esm/BMI_GIRLS.percentile.monthly-98586b46.js +0 -1
- package/build/esm/BMI_GIRLS.percentile.weekly-7c1511b0.js +0 -1
- package/build/esm/BMI_GIRLS.percentile.yearly-ea667f90.js +0 -1
- package/build/esm/BMI_GIRLS.zscore.monthly-3a4fd1a6.js +0 -1
- package/build/esm/BMI_GIRLS.zscore.weekly-cc1de097.js +0 -1
- package/build/esm/BMI_GIRLS.zscore.yearly-6dd1a364.js +0 -1
- package/build/esm/ChevronDown-4e59cac6.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.percentile.monthly-bd0965ae.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.percentile.weekly-db1053f7.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.percentile.yearly-cd38b622.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.zscore.monthly-d7f88a95.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.zscore.weekly-76f7db79.js +0 -1
- package/build/esm/HEAD CIRCUM_BOYS.zscore.yearly-3ce70f8e.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.monthly-b2e678ae.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.weekly-8e2664bb.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.percentile.yearly-f5c075a9.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.monthly-6f87849e.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.weekly-48da0aaa.js +0 -1
- package/build/esm/HEAD CIRCUM_GIRLS.zscore.yearly-4eea437b.js +0 -1
- package/build/esm/HEIGHT_BOYS.percentile.monthly-d1a8cc8e.js +0 -1
- package/build/esm/HEIGHT_BOYS.percentile.weekly-2b6cfe6c.js +0 -1
- package/build/esm/HEIGHT_BOYS.percentile.yearly-9e78afc3.js +0 -1
- package/build/esm/HEIGHT_BOYS.zscore.monthly-5292d78a.js +0 -1
- package/build/esm/HEIGHT_BOYS.zscore.weekly-fbdee645.js +0 -1
- package/build/esm/HEIGHT_BOYS.zscore.yearly-c11a8f1b.js +0 -1
- package/build/esm/HEIGHT_GIRLS.percentile.monthly-8e11e2dc.js +0 -1
- package/build/esm/HEIGHT_GIRLS.percentile.weekly-dc3965cb.js +0 -1
- package/build/esm/HEIGHT_GIRLS.percentile.yearly-490f7b4e.js +0 -1
- package/build/esm/HEIGHT_GIRLS.zscore.monthly-e3531c32.js +0 -1
- package/build/esm/HEIGHT_GIRLS.zscore.weekly-36a16a66.js +0 -1
- package/build/esm/HEIGHT_GIRLS.zscore.yearly-61736bba.js +0 -1
- package/build/esm/Subot-4642c5bf.js +0 -1
- package/build/esm/Visible-ff7d225c.js +0 -1
- package/build/esm/WEIGHT_BOYS.percentile.monthly-0cfe7ecd.js +0 -1
- package/build/esm/WEIGHT_BOYS.percentile.weekly-89802113.js +0 -1
- package/build/esm/WEIGHT_BOYS.percentile.yearly-0eb40972.js +0 -1
- package/build/esm/WEIGHT_BOYS.zscore.monthly-7f8c5a15.js +0 -1
- package/build/esm/WEIGHT_BOYS.zscore.weekly-3dcfa8ce.js +0 -1
- package/build/esm/WEIGHT_BOYS.zscore.yearly-98ce1ea0.js +0 -1
- package/build/esm/WEIGHT_GIRLS.percentile.monthly-df98e335.js +0 -1
- package/build/esm/WEIGHT_GIRLS.percentile.weekly-63fff42a.js +0 -1
- package/build/esm/WEIGHT_GIRLS.percentile.yearly-8db8cdd0.js +0 -1
- package/build/esm/WEIGHT_GIRLS.zscore.monthly-15c83c6d.js +0 -1
- package/build/esm/WEIGHT_GIRLS.zscore.weekly-747a55ec.js +0 -1
- package/build/esm/WEIGHT_GIRLS.zscore.yearly-197dc52d.js +0 -1
- package/build/esm/constants-6ecfa77c.js +0 -1
- package/build/esm/constants-f7c80032.js +0 -108
- package/build/esm/cookieHelper-4f089e3c.js +0 -1
- package/build/esm/core-80112758.js +0 -1
- package/build/esm/dataTransform-0fa341bb.js +0 -1
- package/build/esm/getDynamicHealthTool-a4c9d6dd.js +0 -1
- package/build/esm/getSocialList-4e48deba.js +0 -1
- package/build/esm/index-13dc1f44.js +0 -1
- package/build/esm/index-13e62563.js +0 -137
- package/build/esm/index-1e7ad007.js +0 -1
- package/build/esm/index-24557f2b.js +0 -1
- package/build/esm/index-252cb964.js +0 -1
- package/build/esm/index-2e99f941.js +0 -1
- package/build/esm/index-3452fed2.js +0 -1
- package/build/esm/index-3aff939b.js +0 -1
- package/build/esm/index-459e0362.js +0 -1
- package/build/esm/index-45dcd965.js +0 -1
- package/build/esm/index-486b71cd.js +0 -1
- package/build/esm/index-5408f5a4.js +0 -113
- package/build/esm/index-5e1af23a.js +0 -1
- package/build/esm/index-79ef3a30.js +0 -1
- package/build/esm/index-7c77273a.js +0 -1
- package/build/esm/index-823fd7c0.js +0 -117
- package/build/esm/index-8c77d7e0.js +0 -1
- package/build/esm/index-93e5b4f3.js +0 -1
- package/build/esm/index-9c7b9011.js +0 -2748
- package/build/esm/index-9e5956c2.js +0 -1
- package/build/esm/index-a83aad1c.js +0 -375
- package/build/esm/index-b7cc3ca2.js +0 -1
- package/build/esm/index-bf11f9e9.js +0 -50
- package/build/esm/index-ce3d38fd.js +0 -1
- package/build/esm/index-d27a0e25.js +0 -1
- package/build/esm/index-e21276e3.js +0 -1
- package/build/esm/index-f9514788.js +0 -177
- package/build/esm/index-fd04ccb7.js +0 -1430
- package/build/esm/index.styles-94af560f.js +0 -817
- package/build/esm/isProduction-00695d80.js +0 -1
- package/build/esm/localizeNumberFormat-8355a44f.js +0 -1
- package/build/esm/normalizeLink-1c194268.js +0 -1
- package/build/esm/number-1347eb7b.js +0 -1
- package/build/esm/paths-749b4b53.js +0 -1
- package/build/esm/routing-2b284b30.js +0 -1
- package/build/esm/theme-3db3c9a8.js +0 -1
- package/build/esm/translationsContext-6d2efd65.js +0 -1
- package/build/esm/tslib.es6-266309d1.js +0 -1
- package/build/esm/types-6d397125.js +0 -3004
- package/build/esm/types-850814a7.js +0 -785
- package/build/esm/types-d3da37d2.js +0 -1
- package/build/esm/useCategory-f5f74749.js +0 -1
- package/build/esm/useHealthToolCache-f1488032.js +0 -1
- package/build/esm/useIsInit-9661c5f5.js +0 -1
- package/build/esm/useOutsideClick-0704b383.js +0 -1
- package/build/esm/usePlacesAutocomplete-0733ec49.js +0 -1
- package/build/esm/useScrollbarSize-90b179a5.js +0 -1
- package/build/esm/useTranslations-df1b3bb8.js +0 -1
- package/build/esm/useUniqueId-03fbaecd.js +0 -1
- package/build/esm/utils-3d2e3f0f.js +0 -141
- package/build/esm/utils-5b4e60da.js +0 -1
- package/build/esm/utils-970ce0c0.js +0 -8
- package/build/esm/utils-b87ec473.js +0 -1
- package/build/getDynamicHealthTool-31f44ca1.js +0 -1
- package/build/getSocialList-29c0a6e8.js +0 -1
- package/build/index-1714c81c.js +0 -2748
- package/build/index-238813a4.js +0 -375
- package/build/index-2438163d.js +0 -1430
- package/build/index-29d302f4.js +0 -137
- package/build/index-3184ae4e.js +0 -1
- package/build/index-34b6bd24.js +0 -1
- package/build/index-35192783.js +0 -1
- package/build/index-41d684a8.js +0 -50
- package/build/index-4a8c8ce6.js +0 -1
- package/build/index-58e0d49f.js +0 -1
- package/build/index-64d2f812.js +0 -1
- package/build/index-85c621a2.js +0 -113
- package/build/index-90f4bc02.js +0 -1
- package/build/index-9a845847.js +0 -117
- package/build/index-9ed509d1.js +0 -1
- package/build/index-aa495d24.js +0 -1
- package/build/index-ad5cf64d.js +0 -1
- package/build/index-b21a1d96.js +0 -1
- package/build/index-b320255d.js +0 -1
- package/build/index-b9af15da.js +0 -1
- package/build/index-bd4b31bf.js +0 -1
- package/build/index-bf81cb71.js +0 -1
- package/build/index-c3cbb8f3.js +0 -1
- package/build/index-d25afe2f.js +0 -1
- package/build/index-e7c1ff53.js +0 -177
- package/build/index-ed8656f9.js +0 -1
- package/build/index-f6217f73.js +0 -1
- package/build/index-f7088d57.js +0 -1
- package/build/index.styles-2ecb9c85.js +0 -817
- package/build/isProduction-28d96804.js +0 -1
- package/build/localizeNumberFormat-22b2d7aa.js +0 -1
- package/build/normalizeLink-594ccff1.js +0 -1
- package/build/number-cf06dcc0.js +0 -1
- package/build/paths-ed72ecb8.js +0 -1
- package/build/routing-f2edd0d0.js +0 -1
- package/build/theme-f2b8aad7.js +0 -1
- package/build/translationsContext-4c4c33c4.js +0 -1
- package/build/tslib.es6-ceb091fd.js +0 -1
- package/build/types-49f0543a.js +0 -785
- package/build/types-5b303b71.js +0 -1
- package/build/types-bfd12e24.js +0 -3004
- package/build/useCategory-94d60dab.js +0 -1
- package/build/useHealthToolCache-7307d240.js +0 -1
- package/build/useIsInit-c3cf1925.js +0 -1
- package/build/useOutsideClick-15fef824.js +0 -1
- package/build/usePlacesAutocomplete-6ab0181b.js +0 -1
- package/build/useScrollbarSize-ab332673.js +0 -1
- package/build/useTranslations-233c68bc.js +0 -1
- package/build/useUniqueId-46834e18.js +0 -1
- package/build/utils-13ea4f2f.js +0 -8
- package/build/utils-45e691a3.js +0 -1
- package/build/utils-bee8be92.js +0 -141
- package/build/utils-d5766c73.js +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// You can include shared interfaces/types in a separate file
|
|
2
|
+
// and then use them in any component by importing them. For
|
|
3
|
+
// example, to import the interface below do:
|
|
4
|
+
//
|
|
5
|
+
var GenderLabel;
|
|
6
|
+
(function (GenderLabel) {
|
|
7
|
+
GenderLabel["MALE"] = "gender.male";
|
|
8
|
+
GenderLabel["FEMALE"] = "gender.female";
|
|
9
|
+
GenderLabel["OTHER"] = "gender.other";
|
|
10
|
+
})(GenderLabel || (GenderLabel = {}));
|
|
11
|
+
const DATE_FORMAT_API = 'yyyy-MM-dd';
|
|
12
|
+
const DATE_FORMAT = 'dd-MM-yyyy';
|
|
13
|
+
|
|
14
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
15
|
+
__proto__: null,
|
|
16
|
+
get GenderLabel () { return GenderLabel; },
|
|
17
|
+
DATE_FORMAT_API: DATE_FORMAT_API,
|
|
18
|
+
DATE_FORMAT: DATE_FORMAT
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export { DATE_FORMAT as D, types as t };
|
package/build/esm/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BabyGrowthChartDuration,B as BabyGrowthChartType,b as BabyGrowthResultTab,E as ELEMENT_CONTROL_INPUT_TYPE,F as FULL_KEY_ADDRESS,G as Gender,L as LOCALE,f as NodeActionType,d as NodeFinalTypes,e as NodeIntentType,g as NodeMultipleOptions,N as NodePosition,c as NodeType,O as OnboardingStep,S as SubotType}from
|
|
1
|
+
export { a as BabyGrowthChartDuration, B as BabyGrowthChartType, b as BabyGrowthResultTab, E as ELEMENT_CONTROL_INPUT_TYPE, F as FULL_KEY_ADDRESS, G as Gender, L as LOCALE, f as NodeActionType, d as NodeFinalTypes, e as NodeIntentType, g as NodeMultipleOptions, N as NodePosition, c as NodeType, O as OnboardingStep, S as SubotType } from './Subot-3289bd8e.js';
|
package/build/esm/unifyEnv.js
CHANGED
|
@@ -1 +1,42 @@
|
|
|
1
|
-
function
|
|
1
|
+
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, }) {
|
|
2
|
+
if (DISCOVER_API)
|
|
3
|
+
process.env.UNIFY_DISCOVER_API = DISCOVER_API;
|
|
4
|
+
if (INTERNAL_DISCOVER_API)
|
|
5
|
+
process.env.UNIFY_INTERNAL_DISCOVER_API = INTERNAL_DISCOVER_API;
|
|
6
|
+
if (TOGETHER_API)
|
|
7
|
+
process.env.UNIFY_TOGETHER_API = TOGETHER_API;
|
|
8
|
+
if (INTERNAL_TOGETHER_API)
|
|
9
|
+
process.env.UNIFY_INTERNAL_TOGETHER_API = INTERNAL_TOGETHER_API;
|
|
10
|
+
if (CARE_API)
|
|
11
|
+
process.env.UNIFY_CARE_API = CARE_API;
|
|
12
|
+
if (INTERNAL_CARE_API)
|
|
13
|
+
process.env.UNIFY_INTERNAL_CARE_API = INTERNAL_CARE_API;
|
|
14
|
+
if (SIDIS_TEMPLATE_API)
|
|
15
|
+
process.env.UNIFY_SIDIS_TEMPLATE_API = SIDIS_TEMPLATE_API;
|
|
16
|
+
if (SIDIS_API)
|
|
17
|
+
process.env.UNIFY_SIDIS_API = SIDIS_API;
|
|
18
|
+
if (SIDIS_API_GET)
|
|
19
|
+
process.env.UNIFY_SIDIS_API_GET = SIDIS_API_GET;
|
|
20
|
+
if (SSO_API)
|
|
21
|
+
process.env.UNIFY_SSO_API = SSO_API;
|
|
22
|
+
if (LOCALE)
|
|
23
|
+
process.env.UNIFY_LOCALE = LOCALE;
|
|
24
|
+
if (DEPLOY_ENV)
|
|
25
|
+
process.env.UNIFY_DEPLOY_ENV = DEPLOY_ENV;
|
|
26
|
+
if (LEAD_API)
|
|
27
|
+
process.env.UNIFY_LEAD_API = LEAD_API;
|
|
28
|
+
if (SUBOT_API)
|
|
29
|
+
process.env.UNIFY_SUBOT_API = SUBOT_API;
|
|
30
|
+
if (INTERNAL_SUBOT_API)
|
|
31
|
+
process.env.UNIFY_INTERNAL_SUBOT_API = INTERNAL_SUBOT_API;
|
|
32
|
+
if (SUBOT_URL)
|
|
33
|
+
process.env.UNIFY_SUBOT_URL = SUBOT_URL;
|
|
34
|
+
if (PREMIUM_URL)
|
|
35
|
+
process.env.UNIFY_PREMIUM_URL = PREMIUM_URL;
|
|
36
|
+
if (VACCINATION_TOOL_API)
|
|
37
|
+
process.env.UNIFY_VACCINATION_TOOL_API = VACCINATION_TOOL_API;
|
|
38
|
+
if (String(LOGGING_ENABLED))
|
|
39
|
+
process.env.UNIFY_LOGGING_ENABLED = String(LOGGING_ENABLED);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { setupUnifyEnv };
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { a as __awaiter } from './tslib.es6-1b1533a9.js';
|
|
2
|
+
import { useRef, useEffect, useState, useCallback, useMemo } from 'react';
|
|
3
|
+
import { g as getCookie } from './cookieHelper-d314282c.js';
|
|
4
|
+
import { u as useInitialMount } from './useUniqueId-3638402f.js';
|
|
5
|
+
import { L as LOCALE } from './Subot-3289bd8e.js';
|
|
6
|
+
import { u as useTranslations } from './useTranslations-4f1db486.js';
|
|
7
|
+
|
|
8
|
+
function normalizeAndHash(string) {
|
|
9
|
+
const utf8 = new TextEncoder().encode(string.trim().toLowerCase());
|
|
10
|
+
return crypto.subtle.digest('SHA-256', utf8).then((hashBuffer) => {
|
|
11
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
12
|
+
const hashHex = hashArray
|
|
13
|
+
.map((bytes) => bytes.toString(16).padStart(2, '0'))
|
|
14
|
+
.join('');
|
|
15
|
+
return hashHex;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const FbDataLayerStoreKey = 'fbDataLayer_userInfo';
|
|
19
|
+
const IPStoreKey = 'fbClientIp';
|
|
20
|
+
const useFbDataLayer = (userInfo) => {
|
|
21
|
+
const savedIpRef = useRef('');
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
+
var _a, _b, _c, _d, _e;
|
|
25
|
+
if (!savedIpRef.current) {
|
|
26
|
+
let userIp = yield fetch('https://api.ipify.org').then((res) => res.text());
|
|
27
|
+
if (!userIp) {
|
|
28
|
+
userIp = yield fetch('https://icanhazip.com').then((res) => res.text());
|
|
29
|
+
}
|
|
30
|
+
savedIpRef.current = userIp;
|
|
31
|
+
}
|
|
32
|
+
(_b = (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.setItem) === null || _b === void 0 ? void 0 : _b.call(_a, IPStoreKey, JSON.stringify({
|
|
33
|
+
client_ip_address: ((_c = savedIpRef.current) === null || _c === void 0 ? void 0 : _c.replace('\n', '')) || '',
|
|
34
|
+
client_user_agent: navigator.userAgent || '',
|
|
35
|
+
}));
|
|
36
|
+
if (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) {
|
|
37
|
+
const [em, ph, db, ge, ct, fn] = yield Promise.all([
|
|
38
|
+
userInfo.email ? normalizeAndHash(userInfo.email) : null,
|
|
39
|
+
userInfo.phone ? normalizeAndHash(userInfo.phone) : null,
|
|
40
|
+
userInfo.birthday
|
|
41
|
+
? normalizeAndHash(userInfo.birthday.split('-').join(''))
|
|
42
|
+
: null,
|
|
43
|
+
userInfo.gender ? 'm' : 'f',
|
|
44
|
+
userInfo.city_name
|
|
45
|
+
? normalizeAndHash(userInfo.city_name).then((n) => n.replace(/\s/g, ''))
|
|
46
|
+
: null,
|
|
47
|
+
userInfo.name ? normalizeAndHash(userInfo.name) : null,
|
|
48
|
+
]);
|
|
49
|
+
({
|
|
50
|
+
fbc: getCookie('_fbc') || '',
|
|
51
|
+
fbp: getCookie('_fbp') || '',
|
|
52
|
+
});
|
|
53
|
+
const localData = {
|
|
54
|
+
user_id: userInfo.id,
|
|
55
|
+
};
|
|
56
|
+
if (fn) {
|
|
57
|
+
localData['fn'] = fn;
|
|
58
|
+
}
|
|
59
|
+
if (em) {
|
|
60
|
+
localData['em'] = em;
|
|
61
|
+
}
|
|
62
|
+
if (ph) {
|
|
63
|
+
localData['ph'] = ph;
|
|
64
|
+
}
|
|
65
|
+
if (db) {
|
|
66
|
+
localData['db'] = db;
|
|
67
|
+
}
|
|
68
|
+
if (ct) {
|
|
69
|
+
localData['ct'] = ct;
|
|
70
|
+
}
|
|
71
|
+
(_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));
|
|
72
|
+
// ;(async function waitFbq() {
|
|
73
|
+
// // check for the generic script
|
|
74
|
+
// // easiest check to prevent race condition
|
|
75
|
+
// if (window.fbq) {
|
|
76
|
+
// window.fbq('trackCustom', 'FB Conversion', {
|
|
77
|
+
// action_source: 'website',
|
|
78
|
+
// event_source_url: window.location.href,
|
|
79
|
+
// user_data: [userData],
|
|
80
|
+
// })
|
|
81
|
+
// } else {
|
|
82
|
+
// timeout = setTimeout(waitFbq, 1000)
|
|
83
|
+
// }
|
|
84
|
+
// })()
|
|
85
|
+
}
|
|
86
|
+
}))();
|
|
87
|
+
return () => {
|
|
88
|
+
};
|
|
89
|
+
}, [userInfo]);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/** src: https://www.benmvp.com/blog/8-helpful-custom-react-hooks/
|
|
93
|
+
* know the PREVIOUS + DIFFERENT value of props or state. */
|
|
94
|
+
const usePrevious = (value) => {
|
|
95
|
+
// use refs to keep track of both the previous &
|
|
96
|
+
// current values
|
|
97
|
+
const prevRef = useRef();
|
|
98
|
+
const curRef = useRef(value);
|
|
99
|
+
const isInitialMount = useInitialMount();
|
|
100
|
+
// after the initial render, if the value passed in
|
|
101
|
+
// differs from the `curRef`, then we know that the
|
|
102
|
+
// value we're tracking actually changed. we can
|
|
103
|
+
// update the refs. otherwise if the `curRef` &
|
|
104
|
+
// value are the same, something else caused the
|
|
105
|
+
// re-render and we should *not* update `prevRef`.
|
|
106
|
+
if (!isInitialMount && curRef.current !== value) {
|
|
107
|
+
prevRef.current = curRef.current;
|
|
108
|
+
curRef.current = value;
|
|
109
|
+
}
|
|
110
|
+
return prevRef.current;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/** src: https://www.benmvp.com/blog/8-helpful-custom-react-hooks/
|
|
114
|
+
* delay State update till next animation frame. Similar to debounce but shorter */
|
|
115
|
+
const useRafState = (initialState) => {
|
|
116
|
+
// this is the actual state
|
|
117
|
+
const [state, setState] = useState(initialState);
|
|
118
|
+
// keep track of the `requestAnimationFrame` request ID
|
|
119
|
+
// across renders and successive calls to `useRafState`
|
|
120
|
+
const requestId = useRef(0);
|
|
121
|
+
// the actual state setter we'll return.
|
|
122
|
+
// using `useCallback` so that it's memoized
|
|
123
|
+
// just like `setState`
|
|
124
|
+
const setRafState = useCallback((value) => {
|
|
125
|
+
// cancel active request before making next one.
|
|
126
|
+
// this is debouncing.
|
|
127
|
+
cancelAnimationFrame(requestId.current);
|
|
128
|
+
// create new request to set state on animation frame
|
|
129
|
+
requestId.current = requestAnimationFrame(() => {
|
|
130
|
+
setState(value);
|
|
131
|
+
});
|
|
132
|
+
}, []);
|
|
133
|
+
// cancel any active request when component unmounts
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
return () => cancelAnimationFrame(requestId.current);
|
|
136
|
+
});
|
|
137
|
+
return [state, setRafState];
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const PREGNANCY_SLUG = {
|
|
141
|
+
'vi-VN': 'mang-thai',
|
|
142
|
+
'id-ID': 'kehamilan',
|
|
143
|
+
'ms-MY': 'kehamilan',
|
|
144
|
+
'km-KH': 'ពពោះ',
|
|
145
|
+
'en-PH': 'pregnancy',
|
|
146
|
+
'tl-PH': 'pregnancy',
|
|
147
|
+
'th-TH': 'การตั้งครรภ์',
|
|
148
|
+
'my-MM': 'pregnancy',
|
|
149
|
+
'zh-TW': 'pregnancy',
|
|
150
|
+
'hi-IN': 'pregnancy',
|
|
151
|
+
};
|
|
152
|
+
// NOTE: this is temporary mapping on 13/02/2023, can be outdated due to changes from content team in the future
|
|
153
|
+
const MAPPED_CATEGORY_SLUGS = {
|
|
154
|
+
[LOCALE.Vietnam]: {
|
|
155
|
+
sexualWellness: 'suc-khoe-tinh-duc',
|
|
156
|
+
health: 'suc-khoe',
|
|
157
|
+
healthyEating: 'an-uong-lanh-manh',
|
|
158
|
+
skinHealth: 'da-lieu',
|
|
159
|
+
healthyHabit: 'thoi-quen-lanh-manh',
|
|
160
|
+
drug: 'thuoc',
|
|
161
|
+
womensHealth: 'suc-khoe-phu-nu',
|
|
162
|
+
fitness: 'the-duc-the-thao',
|
|
163
|
+
pregnancy: 'mang-thai',
|
|
164
|
+
parenting: 'nuoi-day-con',
|
|
165
|
+
diabetes: 'tieu-duong-dai-thao-duong',
|
|
166
|
+
healthyMind: 'tam-ly-tam-than',
|
|
167
|
+
},
|
|
168
|
+
[LOCALE.Indonesia]: {
|
|
169
|
+
pregnancy: 'kehamilan',
|
|
170
|
+
parenting: 'parenting',
|
|
171
|
+
health: 'sehat',
|
|
172
|
+
diabetes: 'diabetes',
|
|
173
|
+
womensHealth: 'wanita',
|
|
174
|
+
drug: 'obat-suplemen',
|
|
175
|
+
sexualWellness: '',
|
|
176
|
+
healthyEating: '',
|
|
177
|
+
skinHealth: '',
|
|
178
|
+
},
|
|
179
|
+
[LOCALE.Malaysia]: {
|
|
180
|
+
pregnancy: 'kehamilan',
|
|
181
|
+
parenting: 'keibubapaan',
|
|
182
|
+
health: 'kesihatan',
|
|
183
|
+
diabetes: 'kencing-manis',
|
|
184
|
+
womensHealth: 'kesihatan-wanita',
|
|
185
|
+
drug: 'ubat',
|
|
186
|
+
sexualWellness: '',
|
|
187
|
+
healthyEating: '',
|
|
188
|
+
skinHealth: '',
|
|
189
|
+
},
|
|
190
|
+
[LOCALE.Cambodia]: {
|
|
191
|
+
pregnancy: '%e1%9e%96%e1%9e%96%e1%9f%84%e1%9f%87',
|
|
192
|
+
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',
|
|
193
|
+
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',
|
|
194
|
+
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',
|
|
195
|
+
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',
|
|
196
|
+
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',
|
|
197
|
+
sexualWellness: '',
|
|
198
|
+
healthyEating: '',
|
|
199
|
+
skinHealth: '',
|
|
200
|
+
},
|
|
201
|
+
[LOCALE.PhilippinesEnglish]: {
|
|
202
|
+
pregnancy: 'pregnancy',
|
|
203
|
+
parenting: 'parenting',
|
|
204
|
+
health: 'health',
|
|
205
|
+
diabetes: 'diabetes',
|
|
206
|
+
womensHealth: 'womens-health',
|
|
207
|
+
drug: 'drugs-supplements',
|
|
208
|
+
sexualWellness: '',
|
|
209
|
+
healthyEating: '',
|
|
210
|
+
skinHealth: '',
|
|
211
|
+
},
|
|
212
|
+
[LOCALE.PhilippinesTagalog]: {
|
|
213
|
+
pregnancy: 'pagbubuntis',
|
|
214
|
+
parenting: 'pagiging-magulang',
|
|
215
|
+
health: 'kalusugan',
|
|
216
|
+
diabetes: 'diabetes-fil',
|
|
217
|
+
womensHealth: 'kalusugan-kababaihan',
|
|
218
|
+
drug: 'drugs-at-supplements',
|
|
219
|
+
sexualWellness: '',
|
|
220
|
+
healthyEating: '',
|
|
221
|
+
skinHealth: '',
|
|
222
|
+
},
|
|
223
|
+
[LOCALE.Thailand]: {
|
|
224
|
+
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',
|
|
225
|
+
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',
|
|
226
|
+
health: '%e0%b8%aa%e0%b8%b8%e0%b8%82%e0%b8%a0%e0%b8%b2%e0%b8%9e',
|
|
227
|
+
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',
|
|
228
|
+
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',
|
|
229
|
+
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',
|
|
230
|
+
sexualWellness: '',
|
|
231
|
+
healthyEating: '',
|
|
232
|
+
skinHealth: '',
|
|
233
|
+
},
|
|
234
|
+
[LOCALE.Myanmar]: {
|
|
235
|
+
pregnancy: 'pregnancy',
|
|
236
|
+
parenting: 'parenting',
|
|
237
|
+
health: 'health',
|
|
238
|
+
diabetes: 'diabetes',
|
|
239
|
+
womensHealth: 'womens-health',
|
|
240
|
+
drug: 'drugs-az',
|
|
241
|
+
sexualWellness: '',
|
|
242
|
+
healthyEating: '',
|
|
243
|
+
skinHealth: '',
|
|
244
|
+
},
|
|
245
|
+
[LOCALE.Taiwan]: {
|
|
246
|
+
pregnancy: 'pregnancy',
|
|
247
|
+
parenting: 'parenting',
|
|
248
|
+
health: 'health',
|
|
249
|
+
diabetes: 'diabetes',
|
|
250
|
+
womensHealth: 'womens-health',
|
|
251
|
+
drug: 'drugs-supplement',
|
|
252
|
+
sexualWellness: '',
|
|
253
|
+
healthyEating: '',
|
|
254
|
+
skinHealth: '',
|
|
255
|
+
},
|
|
256
|
+
[LOCALE.India]: {
|
|
257
|
+
pregnancy: 'pregnancy',
|
|
258
|
+
parenting: 'parenting',
|
|
259
|
+
health: 'health',
|
|
260
|
+
diabetes: 'diabetes',
|
|
261
|
+
womensHealth: 'womens-health',
|
|
262
|
+
diabetesEn: 'en-diabetes',
|
|
263
|
+
drug: 'dawaai',
|
|
264
|
+
sexualWellness: '',
|
|
265
|
+
healthyEating: '',
|
|
266
|
+
skinHealth: '',
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
function getCategoryFromURL(url, categories) {
|
|
270
|
+
const urlParts = url.split('/');
|
|
271
|
+
for (const key in categories) {
|
|
272
|
+
const keyword = categories[key];
|
|
273
|
+
if (urlParts.includes(keyword)) {
|
|
274
|
+
return key;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return null; // Return null if no matching key is found
|
|
278
|
+
}
|
|
279
|
+
const useCategory = (asPath) => {
|
|
280
|
+
const { locale } = useTranslations();
|
|
281
|
+
const isPregnancy = useMemo(() => decodeURI(asPath.replace(/\//gi, '')).includes(PREGNANCY_SLUG[locale]), []);
|
|
282
|
+
const isParenting = useMemo(() => {
|
|
283
|
+
var _a;
|
|
284
|
+
return decodeURI(asPath.replace(/\//gi, '')).includes((_a = MAPPED_CATEGORY_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.parenting);
|
|
285
|
+
}, []);
|
|
286
|
+
const type = useMemo(() => {
|
|
287
|
+
return getCategoryFromURL(asPath, MAPPED_CATEGORY_SLUGS[locale]);
|
|
288
|
+
}, [asPath, locale]);
|
|
289
|
+
return { isPregnancy, isParenting, type };
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
export { MAPPED_CATEGORY_SLUGS as M, PREGNANCY_SLUG as P, usePrevious as a, useRafState as b, useCategory as c, useFbDataLayer as u };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { a as __awaiter } from './tslib.es6-1b1533a9.js';
|
|
2
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
3
|
+
import { a as getDynamicHealthToolWithCache } from './getDynamicHealthTool-f4497aa5.js';
|
|
4
|
+
|
|
5
|
+
const useHealthToolsCache = (locale) => {
|
|
6
|
+
const [allTools, setAllTools] = useState([]);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
9
|
+
const allHealthTools = yield getDynamicHealthToolWithCache(locale);
|
|
10
|
+
setAllTools(allHealthTools);
|
|
11
|
+
}))();
|
|
12
|
+
}, [getDynamicHealthToolWithCache, locale]);
|
|
13
|
+
const getHealthToolLink = useCallback((type) => { var _a; return ((_a = allTools.find((tool) => tool.template === type)) === null || _a === void 0 ? void 0 : _a.link) || ''; }, [allTools]);
|
|
14
|
+
return { allTools, getHealthToolLink };
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { useHealthToolsCache as u };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useEffect, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
const callbacks = new Map();
|
|
4
|
+
const handleClick = (e) => {
|
|
5
|
+
for (const [ref, callback] of callbacks) {
|
|
6
|
+
if (ref.current && !ref.current.contains(e.target)) {
|
|
7
|
+
callback(e);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const initSharedOutSideClickListener = () => {
|
|
12
|
+
document.addEventListener('mousedown', handleClick, {
|
|
13
|
+
passive: true,
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
/** require the use of initSharedOutSideClickListener once, anywhere globally */
|
|
17
|
+
const useSharedOutsideClick = (ref, callback) => {
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
callbacks.set(ref, callback);
|
|
20
|
+
return () => {
|
|
21
|
+
callbacks.delete(ref);
|
|
22
|
+
};
|
|
23
|
+
}, [ref, callback]);
|
|
24
|
+
};
|
|
25
|
+
const useOutsideClick = (ref, callback) => {
|
|
26
|
+
const handleClick = useCallback((e) => {
|
|
27
|
+
var _a;
|
|
28
|
+
// If the click target is a descendant of the ref, ignore it
|
|
29
|
+
if ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// Otherwise, invoke the callback
|
|
33
|
+
callback(e);
|
|
34
|
+
}, []);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
document.addEventListener('mousedown', handleClick, {
|
|
37
|
+
passive: true,
|
|
38
|
+
});
|
|
39
|
+
return () => {
|
|
40
|
+
document.removeEventListener('mousedown', handleClick);
|
|
41
|
+
};
|
|
42
|
+
}, [handleClick]);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export { useOutsideClick as a, initSharedOutSideClickListener as i, useSharedOutsideClick as u };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { a as __awaiter } from './tslib.es6-1b1533a9.js';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
const formatAutoCompleteAddress = (addresses) => {
|
|
5
|
+
if (!addresses || addresses.length < 1)
|
|
6
|
+
return [];
|
|
7
|
+
return addresses.map((s) => ({
|
|
8
|
+
placeId: s.place_id,
|
|
9
|
+
description: s.description,
|
|
10
|
+
}));
|
|
11
|
+
};
|
|
12
|
+
const IS_SSR = typeof window === 'undefined';
|
|
13
|
+
// https://developers.google.com/maps/faq#languagesupport
|
|
14
|
+
const GOOGLE_API_LANGUAGE = {
|
|
15
|
+
VN: 'vi',
|
|
16
|
+
ID: 'id',
|
|
17
|
+
TH: 'th',
|
|
18
|
+
MY: 'ms',
|
|
19
|
+
TW: 'zh-TW',
|
|
20
|
+
KH: 'km',
|
|
21
|
+
MM: 'my',
|
|
22
|
+
IN: 'hi',
|
|
23
|
+
PH: 'en',
|
|
24
|
+
};
|
|
25
|
+
const GOOGLE_API_KEY = 'AIzaSyD9AbNa4AFwr8eNVs90G1YhQLhfWJ6KncU';
|
|
26
|
+
const googleAutocomplete = (text = '', countrycode = '', languageCountrycode = 'vi') => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
28
|
+
if (!text) {
|
|
29
|
+
return reject('Need valid text input');
|
|
30
|
+
}
|
|
31
|
+
if (IS_SSR) {
|
|
32
|
+
return reject('Need valid window object');
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
new window.google.maps.places.AutocompleteService().getPlacePredictions(Object.assign(Object.assign({ input: text }, (countrycode
|
|
36
|
+
? {
|
|
37
|
+
componentRestrictions: { country: countrycode },
|
|
38
|
+
}
|
|
39
|
+
: {})), { language: GOOGLE_API_LANGUAGE[languageCountrycode] }), resolve);
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
reject(e);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
const usePlacesAutocomplete = (text = '', countrycode = '', languageCountrycode = '', debounceTimeout = 500) => {
|
|
47
|
+
const [predictions, setPredictions] = useState([]);
|
|
48
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
let handleDebounce;
|
|
51
|
+
if (text) {
|
|
52
|
+
handleDebounce = window.setTimeout(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
+
if (!text) {
|
|
54
|
+
setPredictions([]);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
setIsLoading(true);
|
|
59
|
+
const nextPredictions = yield googleAutocomplete(text, countrycode, languageCountrycode);
|
|
60
|
+
setPredictions(formatAutoCompleteAddress(nextPredictions));
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
console.error(e);
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
setIsLoading(false);
|
|
67
|
+
}
|
|
68
|
+
}), debounceTimeout);
|
|
69
|
+
}
|
|
70
|
+
else if (predictions.length) {
|
|
71
|
+
setPredictions([]);
|
|
72
|
+
}
|
|
73
|
+
return () => {
|
|
74
|
+
window.clearTimeout(handleDebounce);
|
|
75
|
+
};
|
|
76
|
+
}, [text, debounceTimeout, countrycode]);
|
|
77
|
+
return { isLoading, predictions };
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { GOOGLE_API_KEY as G, GOOGLE_API_LANGUAGE as a, usePlacesAutocomplete as u };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useState, useRef, useEffect } from 'react';
|
|
2
|
+
import debounce from 'lodash/debounce';
|
|
3
|
+
|
|
4
|
+
const MEASURE_ELEMENT_CLASS = 'measure-scrollbar-size';
|
|
5
|
+
const useScrollbarSize = (trigger = true) => {
|
|
6
|
+
const [dimensions, setDimensions] = useState({ height: 0, width: 0 });
|
|
7
|
+
const element = useRef(null);
|
|
8
|
+
// initialize resize event handler and state when mounted
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!trigger || typeof window === 'undefined') {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const getElement = () => {
|
|
14
|
+
if (!element.current) {
|
|
15
|
+
// element was not created yet -- initialize
|
|
16
|
+
element.current = document.createElement('div');
|
|
17
|
+
element.current.classList.add(MEASURE_ELEMENT_CLASS);
|
|
18
|
+
element.current.style.width = '99px';
|
|
19
|
+
element.current.style.height = '99px';
|
|
20
|
+
element.current.style.overflow = 'scroll';
|
|
21
|
+
element.current.style.position = 'absolute';
|
|
22
|
+
element.current.style.top = '-9999px';
|
|
23
|
+
element.current.setAttribute('aria-hidden', 'true');
|
|
24
|
+
element.current.setAttribute('role', 'presentation');
|
|
25
|
+
}
|
|
26
|
+
return element.current;
|
|
27
|
+
};
|
|
28
|
+
const updateState = () => {
|
|
29
|
+
const { offsetHeight, clientHeight, offsetWidth, clientWidth } = getElement();
|
|
30
|
+
const scrollbarHeight = offsetHeight - clientHeight;
|
|
31
|
+
const scrollbarWidth = offsetWidth - clientWidth;
|
|
32
|
+
setDimensions((currentDimensions) => {
|
|
33
|
+
const { height, width } = currentDimensions;
|
|
34
|
+
return height !== scrollbarHeight || width !== scrollbarWidth
|
|
35
|
+
? { height: scrollbarHeight, width: scrollbarWidth }
|
|
36
|
+
: currentDimensions;
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
const handleResize = debounce(updateState, 100);
|
|
40
|
+
// initialize
|
|
41
|
+
window.addEventListener('resize', handleResize, {
|
|
42
|
+
passive: true,
|
|
43
|
+
});
|
|
44
|
+
document.body.appendChild(getElement());
|
|
45
|
+
updateState();
|
|
46
|
+
const elementToRemove = getElement();
|
|
47
|
+
// cleanup
|
|
48
|
+
return () => {
|
|
49
|
+
handleResize.cancel();
|
|
50
|
+
window.removeEventListener('resize', handleResize);
|
|
51
|
+
document.body.removeChild(elementToRemove);
|
|
52
|
+
};
|
|
53
|
+
}, [trigger]);
|
|
54
|
+
return dimensions;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { MEASURE_ELEMENT_CLASS as M, useScrollbarSize as u };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useContext, useMemo } from 'react';
|
|
2
|
+
import { T as TranslationsContext } from './translationsContext-ad3e25de.js';
|
|
3
|
+
import formatString from 'string-format';
|
|
4
|
+
|
|
5
|
+
function useTranslations() {
|
|
6
|
+
const { values, locale } = useContext(TranslationsContext) || {
|
|
7
|
+
locale: 'en-PH',
|
|
8
|
+
};
|
|
9
|
+
return useMemo(() => ({
|
|
10
|
+
t(k, option) {
|
|
11
|
+
if (!values) {
|
|
12
|
+
console.error('[useTranslations] t method called before translation values are loaded');
|
|
13
|
+
return k;
|
|
14
|
+
}
|
|
15
|
+
if (values[k]) {
|
|
16
|
+
return option ? formatString(values[k] || k, option) : values[k] || k;
|
|
17
|
+
}
|
|
18
|
+
console.warn(`[useTranslations] Missing translation for key ${k} and locale ${locale}`);
|
|
19
|
+
return option ? formatString(k, option) : k;
|
|
20
|
+
},
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
locale,
|
|
23
|
+
}), [values, locale]);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { useTranslations as u };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
/** src: https://www.benmvp.com/blog/8-helpful-custom-react-hooks/
|
|
4
|
+
* check if we are at first mount */
|
|
5
|
+
const useInitialMount = () => {
|
|
6
|
+
// refs exist across component re-renders, so
|
|
7
|
+
// we can use it to store a value for the
|
|
8
|
+
// subsequent renders. We're tracking if it's
|
|
9
|
+
// the first render, which is initially `true`
|
|
10
|
+
const isFirst = useRef(true);
|
|
11
|
+
// the very first render, the ref will be
|
|
12
|
+
// `true`. but we immediately set it to `false`
|
|
13
|
+
// so that every render after will be `false`
|
|
14
|
+
if (isFirst.current) {
|
|
15
|
+
isFirst.current = false;
|
|
16
|
+
// return true the very first render
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
// return false every following render
|
|
20
|
+
return false;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
let GLOBAL_ID = 0;
|
|
24
|
+
/** src: https://www.benmvp.com/blog/8-helpful-custom-react-hooks/
|
|
25
|
+
* Generate Unique ID for both server and client side. Format: hhg-gen-id{number}
|
|
26
|
+
* This depend on render order, assuming that the order is the same on server and client.
|
|
27
|
+
*/
|
|
28
|
+
const useUniqueId = () => {
|
|
29
|
+
const idRef = useRef('');
|
|
30
|
+
const isInitialMount = useInitialMount();
|
|
31
|
+
// generate the ID for the first render
|
|
32
|
+
// and store in the ref to remain for
|
|
33
|
+
// subsequent renders
|
|
34
|
+
if (isInitialMount) {
|
|
35
|
+
GLOBAL_ID += 1;
|
|
36
|
+
idRef.current = `hhg-gen-id${GLOBAL_ID}`;
|
|
37
|
+
}
|
|
38
|
+
return idRef.current;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { useUniqueId as a, useInitialMount as u };
|