@hhgtech/hhg-components 1.29.532 → 1.29.533-beta-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{InputDate-f44138a5.js → InputDate-e26b9cb7.js} +5 -5
- package/build/{LastPeriod-1e613fcb.js → LastPeriod-cd45c531.js} +1 -1
- package/build/{MobileBottomNavigationIcon-b7c0293d.js → MobileBottomNavigationIcon-2eb327b4.js} +3 -3
- package/build/{SiteWideBanner-83b05580.js → SiteWideBanner-319a88f6.js} +234 -85
- package/build/{Spinner-a3dd0a36.js → Spinner-457c3f74.js} +1 -1
- package/build/{WhatsApp-6e913391.js → WhatsApp-7923a1b7.js} +1 -1
- package/build/adapters.js +20 -20
- package/build/atoms.js +51 -51
- package/build/babyGrowth.js +86 -86
- package/build/cache.js +2 -2
- package/build/care/components/organisms/bookingSearchBarV3/SearchResultContent.d.ts +13 -0
- package/build/care/components/organisms/bookingSearchBarV3/constants.d.ts +4 -0
- package/build/care/components/organisms/bookingSearchBarV3/index.d.ts +42 -0
- package/build/care/components/organisms/bookingSearchBarV3/index.styled.d.ts +16 -0
- package/build/care/components/organisms/bookingSearchBarV3/reducer.d.ts +166 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchInputs/ModalSearchResult.d.ts +8 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchInputs/index.d.ts +35 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchInputs/index.styled.d.ts +17 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchLocation/CustomSelectItem.d.ts +9 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchLocation/index.d.ts +16 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchLocation/index.styled.d.ts +21 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchResult/icons.d.ts +5 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchResult/index.d.ts +22 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchResult/index.styled.d.ts +21 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.d.ts +12 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.styled.d.ts +16 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchSpecialty/CustomSelectItem.d.ts +9 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.d.ts +15 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.styled.d.ts +13 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchTag/index.d.ts +17 -0
- package/build/care/components/organisms/bookingSearchBarV3/searchTag/index.styled.d.ts +13 -0
- package/build/care/components/organisms/bookingSearchBarV3/tabSearch/index.d.ts +11 -0
- package/build/care/components/organisms/bookingSearchBarV3/tabSearch/index.styled.d.ts +8 -0
- package/build/care/components/organisms/bookingSearchBarV3/types.d.ts +17 -0
- package/build/care/components/organisms/bookingSearchBarV3/useSearchBarApi.d.ts +21 -0
- package/build/care/index.d.ts +1 -0
- package/build/care.js +23 -22
- package/build/careBookingSearchBar.js +14 -14
- package/build/careBookingSearchBarV2.js +19 -19
- package/build/components/atoms/inputMB/index.styled.d.ts +3 -3
- package/build/components/mantine/theme/text.d.ts +15 -1
- package/build/components/molecules/index.d.ts +1 -1
- package/build/components/molecules/productDetail/generalInfo/GeneralInfo.d.ts +2 -1
- package/build/components/molecules/productDetail/generalInfo/index.styled.d.ts +19 -0
- package/build/components/molecules/videoItem/constants.d.ts +2 -0
- package/build/components/molecules/videoItem/index.d.ts +2 -2
- package/build/components/molecules/videoItem/shorts/index.d.ts +1 -1
- package/build/components/molecules/videoItem/shorts/index.styles.d.ts +1 -0
- package/build/components/molecules/videoItem/types.d.ts +4 -0
- package/build/components/molecules/videoItem/utils.d.ts +7 -0
- package/build/components/molecules/videoItem/video/index.d.ts +1 -1
- package/build/components/navigationV2/constants.d.ts +2 -0
- package/build/components/navigationV2/index.d.ts +1 -0
- package/build/components.js +107 -106
- package/build/constants-24591878.js +26 -0
- package/build/{constants-9939ab70.js → constants-5450ed41.js} +2 -2
- package/build/{constants-d8e60c3b.js → constants-8a226813.js} +1 -1
- package/build/constants.js +3 -3
- package/build/constantsDomainLocales.js +1 -1
- package/build/constantsRiskScreener.js +2 -2
- package/build/constantsSite.js +2 -2
- package/build/{core-b67a4def.js → core-f99d82fb.js} +1 -1
- package/build/{dataTransform-91a5ec36.js → dataTransform-47354a08.js} +1 -1
- package/build/ecom.js +5 -5
- package/build/{editor-64be9f18.js → editor-74e71c32.js} +11 -11
- package/build/embeddedHeathToolCards_babyGrowth.js +25 -25
- package/build/embeddedHeathToolCards_babyPoop.js +22 -22
- package/build/embeddedHeathToolCards_babyVaccine.js +24 -24
- package/build/embeddedHeathToolCards_bmi_bmi.js +27 -27
- package/build/embeddedHeathToolCards_bmrBmr.js +27 -27
- package/build/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
- package/build/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
- package/build/embeddedHeathToolCards_pwg_pwg.js +28 -28
- package/build/embeddedHeathToolCards_targetHeartRate.js +29 -29
- package/build/esm/{InputDate-7a1e6c32.js → InputDate-05bc7502.js} +5 -5
- package/build/esm/{LastPeriod-ac7bc68b.js → LastPeriod-d645f8fa.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-8e45374b.js → MobileBottomNavigationIcon-941a8266.js} +3 -3
- package/build/esm/{SiteWideBanner-fbb357d4.js → SiteWideBanner-7c89eb0c.js} +235 -86
- package/build/esm/{Spinner-4a0a16d7.js → Spinner-05b810cc.js} +1 -1
- package/build/esm/{WhatsApp-eff465a1.js → WhatsApp-0e32e710.js} +1 -1
- package/build/esm/adapters.js +20 -20
- package/build/esm/atoms.js +51 -51
- package/build/esm/babyGrowth.js +86 -86
- package/build/esm/cache.js +2 -2
- package/build/esm/care/components/organisms/bookingSearchBarV3/SearchResultContent.d.ts +13 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/constants.d.ts +4 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/index.d.ts +42 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/index.styled.d.ts +16 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/reducer.d.ts +166 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/ModalSearchResult.d.ts +8 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/index.d.ts +35 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchInputs/index.styled.d.ts +17 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/CustomSelectItem.d.ts +9 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/index.d.ts +16 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchLocation/index.styled.d.ts +21 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/icons.d.ts +5 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/index.d.ts +22 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchResult/index.styled.d.ts +21 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.d.ts +12 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchResultSpecialties/index.styled.d.ts +16 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/CustomSelectItem.d.ts +9 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.d.ts +15 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchSpecialty/index.styled.d.ts +13 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchTag/index.d.ts +17 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/searchTag/index.styled.d.ts +13 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/tabSearch/index.d.ts +11 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/tabSearch/index.styled.d.ts +8 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/types.d.ts +17 -0
- package/build/esm/care/components/organisms/bookingSearchBarV3/useSearchBarApi.d.ts +21 -0
- package/build/esm/care/index.d.ts +1 -0
- package/build/esm/care.js +22 -22
- package/build/esm/careBookingSearchBar.js +14 -14
- package/build/esm/careBookingSearchBarV2.js +19 -19
- package/build/esm/components/atoms/inputMB/index.styled.d.ts +3 -3
- package/build/esm/components/mantine/theme/text.d.ts +15 -1
- package/build/esm/components/molecules/index.d.ts +1 -1
- package/build/esm/components/molecules/productDetail/generalInfo/GeneralInfo.d.ts +2 -1
- package/build/esm/components/molecules/productDetail/generalInfo/index.styled.d.ts +19 -0
- package/build/esm/components/molecules/videoItem/constants.d.ts +2 -0
- package/build/esm/components/molecules/videoItem/index.d.ts +2 -2
- package/build/esm/components/molecules/videoItem/shorts/index.d.ts +1 -1
- package/build/esm/components/molecules/videoItem/shorts/index.styles.d.ts +1 -0
- package/build/esm/components/molecules/videoItem/types.d.ts +4 -0
- package/build/esm/components/molecules/videoItem/utils.d.ts +7 -0
- package/build/esm/components/molecules/videoItem/video/index.d.ts +1 -1
- package/build/esm/components/navigationV2/constants.d.ts +2 -0
- package/build/esm/components/navigationV2/index.d.ts +1 -0
- package/build/esm/components.js +107 -106
- package/build/esm/{constants-92625e47.js → constants-03714c7e.js} +1 -1
- package/build/esm/{constants-01997487.js → constants-9194bfe5.js} +2 -2
- package/build/esm/constants-f42847a4.js +21 -0
- package/build/esm/constants.js +3 -3
- package/build/esm/constantsDomainLocales.js +1 -1
- package/build/esm/constantsRiskScreener.js +2 -2
- package/build/esm/constantsSite.js +2 -2
- package/build/esm/{core-e29868ec.js → core-6abdf8d0.js} +1 -1
- package/build/esm/{dataTransform-6e98ea13.js → dataTransform-513198eb.js} +1 -1
- package/build/esm/ecom.js +5 -5
- package/build/esm/{editor-dfd89741.js → editor-45b768b8.js} +11 -11
- package/build/esm/embeddedHeathToolCards_babyGrowth.js +25 -25
- package/build/esm/embeddedHeathToolCards_babyPoop.js +22 -22
- package/build/esm/embeddedHeathToolCards_babyVaccine.js +24 -24
- package/build/esm/embeddedHeathToolCards_bmi_bmi.js +27 -27
- package/build/esm/embeddedHeathToolCards_bmrBmr.js +27 -27
- package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
- package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
- package/build/esm/embeddedHeathToolCards_pwg_pwg.js +28 -28
- package/build/esm/embeddedHeathToolCards_targetHeartRate.js +29 -29
- package/build/esm/footer.js +22 -22
- package/build/esm/gAssets.js +2 -2
- package/build/esm/{healthTools-25e01c7f.js → healthTools-e9d8e3f5.js} +1 -1
- package/build/esm/healthToolsCardWrapper.js +20 -20
- package/build/esm/healthToolsForm.js +35 -35
- package/build/esm/hooks.js +14 -14
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-9351c606.js → index-032eadac.js} +1 -1
- package/build/esm/{index-acacb902.js → index-038af1ec.js} +6 -6
- package/build/esm/{index-48c9e0de.js → index-098487ec.js} +14 -0
- package/build/esm/{index-1c2e7003.js → index-192758bd.js} +25 -25
- package/build/esm/{index-0ece7544.js → index-1aebdee9.js} +3 -3
- package/build/esm/{index-f1076114.js → index-1d2cd200.js} +5 -5
- package/build/esm/{index-f9bb3e38.js → index-28f55c7c.js} +2 -2
- package/build/esm/{index-cc4cfda6.js → index-314ef50f.js} +24 -24
- package/build/esm/{index-df5f9470.js → index-33141d80.js} +7 -7
- package/build/esm/{index-bf0aa642.js → index-34d21427.js} +3 -3
- package/build/esm/{index-8e9636e8.js → index-36734b35.js} +32 -32
- package/build/esm/{index-3415e87b.js → index-3c223867.js} +4 -4
- package/build/esm/{index-d484fd93.js → index-40f4488b.js} +6 -6
- package/build/esm/{index-709c1b4a.js → index-43af2123.js} +3 -2
- package/build/esm/{index-d668c9bf.js → index-45f53fb6.js} +22 -22
- package/build/esm/{index-21c64d8b.js → index-4b1ee530.js} +3 -3
- package/build/esm/{index-7ca534bc.js → index-4ca41125.js} +14 -14
- package/build/esm/{index-8aafe9e7.js → index-505b3994.js} +2 -2
- package/build/esm/{index-f87ee75d.js → index-50a2593d.js} +17 -17
- package/build/esm/{index-13d4d948.js → index-5121bfff.js} +6 -6
- package/build/esm/{index-b27394f7.js → index-55618a95.js} +49 -42
- package/build/esm/{index-6b3bccdf.js → index-56c17ad3.js} +8 -8
- package/build/esm/{index-1ca1501b.js → index-5b781b1e.js} +3 -3
- package/build/esm/{index-6a3ab061.js → index-609df880.js} +14 -14
- package/build/esm/{index-09e43a17.js → index-66653ef8.js} +2 -2
- package/build/esm/{index-2dfedb07.js → index-69fb88d1.js} +2 -2
- package/build/esm/{index-4e66e774.js → index-6b88e3c6.js} +4 -4
- package/build/esm/{index-f1961b13.js → index-700c50e4.js} +13 -13
- package/build/esm/{index-7dc47646.js → index-737eb40e.js} +16 -16
- package/build/esm/{index-2f629759.js → index-77179a51.js} +3 -3
- package/build/esm/{index-39781a98.js → index-77cf65fa.js} +2 -2
- package/build/esm/{index-06320955.js → index-7a563e82.js} +2 -2
- package/build/esm/{index-9dbc9cb4.js → index-7bd170e1.js} +21 -21
- package/build/esm/{index-0cf821f5.js → index-7cdbf913.js} +16 -16
- package/build/esm/{index-f78e44b7.js → index-84111ea5.js} +16 -16
- package/build/esm/{index-bf6850a0.js → index-8b31d952.js} +14 -14
- package/build/esm/{index-fc82208c.js → index-9681c915.js} +11 -11
- package/build/esm/{index-0666caa3.js → index-9698198d.js} +15 -15
- package/build/esm/{index-b710a31d.js → index-a1e76985.js} +7 -7
- package/build/esm/{index-bea2c496.js → index-a282baa1.js} +3 -3
- package/build/esm/{index-d10125f1.js → index-a6ed627b.js} +15 -15
- package/build/esm/{index-a1d9132d.js → index-a89f3931.js} +19 -19
- package/build/esm/{index-fa17f83f.js → index-aa69f1a9.js} +1 -1
- package/build/esm/{index-42db16aa.js → index-b26de0d6.js} +9 -9
- package/build/esm/{index-b9aaced9.js → index-b7bf9955.js} +6 -6
- package/build/esm/{index-913e49d4.js → index-b89ba068.js} +2 -2
- package/build/esm/{index-e262c835.js → index-bb13a6ff.js} +1 -1
- package/build/esm/{index-6a515ea4.js → index-beda55c1.js} +13 -13
- package/build/esm/{index-e8ecc796.js → index-bf3862b2.js} +2 -2
- package/build/esm/{index-8beef085.js → index-bf50095c.js} +2 -2
- package/build/esm/{index-6b962737.js → index-c37ef324.js} +2 -2
- package/build/esm/{index-28bce418.js → index-c651a487.js} +2 -2
- package/build/esm/{index-fa9b756f.js → index-c8883599.js} +3 -3
- package/build/esm/{index-5d735bf7.js → index-c8da944c.js} +5 -5
- package/build/esm/{index-10dc44c5.js → index-ccfa9c9e.js} +3 -3
- package/build/esm/{index-e85e1ced.js → index-d23fe2ae.js} +2 -2
- package/build/esm/{index-d5050a14.js → index-d6f6b595.js} +9 -9
- package/build/esm/{index-72bb84ba.js → index-db36636a.js} +2 -2
- package/build/esm/{index-e49a1561.js → index-dbaa0063.js} +1 -1
- package/build/esm/{index-8fd5f916.js → index-dd15ecc1.js} +15 -15
- package/build/esm/{index-09bab845.js → index-e66ed1d0.js} +3 -3
- package/build/esm/{index-dfd9ab20.js → index-e720265b.js} +1 -1
- package/build/esm/{index-ed84dcb0.js → index-e7d01b29.js} +16 -16
- package/build/esm/{index-760d69ce.js → index-e8e03414.js} +3 -3
- package/build/esm/{index-827c3318.js → index-e910bd48.js} +18 -18
- package/build/esm/{index-6621664d.js → index-ea04724c.js} +1 -1
- package/build/esm/{index-e92b6590.js → index-ec92fddf.js} +2 -2
- package/build/esm/{index-327386d7.js → index-ee931564.js} +1 -1
- package/build/esm/{index-c7ca71f6.js → index-f4e242fa.js} +2 -2
- package/build/esm/{index-21a74fc8.js → index-f8858b48.js} +18 -18
- package/build/esm/{index-a1fff0d0.js → index-f892d3d1.js} +32 -32
- package/build/esm/index-fa6d14f9.js +1942 -0
- package/build/esm/index.js +127 -126
- package/build/esm/interfaces/constants/index.d.ts +2 -1
- package/build/esm/{labelSorting-821e9c2e.js → labelSorting-3374e5dd.js} +4 -4
- package/build/esm/lead.js +38 -37
- package/build/esm/{logoIcon-6c43fd83.js → logoIcon-e72124bf.js} +2 -2
- package/build/esm/mantine.js +27 -27
- package/build/esm/misc.js +19 -19
- package/build/esm/miscGetDynamicHealthTool.js +4 -4
- package/build/esm/miscGetSocialList.js +8 -8
- package/build/esm/miscScreenSizeContext.js +1 -1
- package/build/esm/mobileBottomNavigation.js +5 -5
- package/build/esm/mobileBottomNavigationIcon.js +5 -5
- package/build/esm/molecules.js +80 -79
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +17 -17
- package/build/esm/navigation.js +50 -49
- package/build/esm/navigationLogoutPopup.js +11 -11
- package/build/esm/navigationProfileButton.js +27 -27
- package/build/esm/onboardingV2.js +30 -30
- package/build/esm/organisms.js +63 -62
- package/build/esm/{post-f232a5fe.js → post-b9081b6c.js} +2 -2
- package/build/esm/profileNavigation.js +20 -20
- package/build/esm/progressBar.js +1 -1
- package/build/esm/pwg.js +23 -23
- package/build/esm/ssoV2.js +31 -31
- package/build/esm/{store-64df7581.js → store-0efd0c32.js} +3 -3
- package/build/esm/subot.js +47 -47
- package/build/esm/surveyOrPremiumBanner.js +34 -34
- package/build/esm/surveyQuestionCard.js +11 -11
- package/build/esm/{surveyThankyouCard-3847eb4d.js → surveyThankyouCard-6bc1296c.js} +5 -5
- package/build/esm/together.js +57 -57
- package/build/esm/togetherApiUtils.js +6 -6
- package/build/esm/togetherAtoms.js +31 -31
- package/build/esm/togetherComponentGlobalContext.js +6 -6
- package/build/esm/togetherMolecules.js +52 -52
- package/build/esm/togetherMoleculesCardAuthor.js +29 -29
- package/build/esm/togetherMoleculesPostImagePreview.js +13 -13
- package/build/esm/togetherMoleculesProfileDetail.js +40 -40
- package/build/esm/togetherOrganisms.js +51 -51
- package/build/esm/togetherRichTextEditor.js +20 -20
- package/build/esm/togetherShareBox.js +12 -12
- package/build/esm/{transform-fb2e76dd.js → transform-e3324fc6.js} +176 -65
- package/build/esm/{translationsProvider-2bd4c215.js → translationsProvider-c3122056.js} +1 -1
- package/build/esm/{treePopoverMenu-257c17c1.js → treePopoverMenu-e4ef777f.js} +19 -19
- package/build/esm/types.js +2 -2
- package/build/esm/{useCartCareService-d2eb4371.js → useCartCareService-3386d953.js} +1 -1
- package/build/esm/{useHealthToolCache-3fea4309.js → useHealthToolCache-0154ed13.js} +1 -1
- package/build/esm/{usePhoneValidator-9e60043e.js → usePhoneValidator-016ffb49.js} +5 -5
- package/build/esm/{usePlacesAutocomplete-523fe3bd.js → usePlacesAutocomplete-fc18fe0b.js} +1 -1
- package/build/esm/useTogetherAuthRequiredAction.js +10 -10
- package/build/esm/{utils-80f04d90.js → utils-08850e2c.js} +2 -2
- package/build/esm/{utils-1eca9722.js → utils-08c6ca6b.js} +5 -5
- package/build/esm/{utils-642156b1.js → utils-35709853.js} +2 -2
- package/build/esm/{utils-b6f19c3b.js → utils-b9be89c5.js} +5 -22
- package/build/esm/{utils-56f99032.js → utils-bf6be335.js} +3 -3
- package/build/esm/vaccination.js +22 -22
- package/build/footer.js +22 -22
- package/build/gAssets.js +2 -2
- package/build/{healthTools-36407269.js → healthTools-64ac0d85.js} +1 -1
- package/build/healthToolsCardWrapper.js +20 -20
- package/build/healthToolsForm.js +35 -35
- package/build/hooks.js +14 -14
- package/build/i18n.js +2 -2
- package/build/i18nV2.js +1 -1
- package/build/{index-5ad16fac.js → index-033a2c74.js} +2 -2
- package/build/{index-e61a4996.js → index-05584917.js} +1 -1
- package/build/{index-ecc2a79e.js → index-05b88dc9.js} +8 -8
- package/build/{index-60e7b18a.js → index-071ec1a3.js} +14 -14
- package/build/{index-209d7c78.js → index-09386ed8.js} +2 -2
- package/build/{index-056c51bb.js → index-09fd8980.js} +5 -5
- package/build/{index-ed457185.js → index-0b7946fd.js} +15 -15
- package/build/{index-6ce426ff.js → index-0e728a4a.js} +17 -17
- package/build/{index-2cdaaeb1.js → index-12a51438.js} +1 -1
- package/build/{index-8272f80c.js → index-18aa507c.js} +14 -14
- package/build/{index-d3b126e0.js → index-19afb248.js} +18 -18
- package/build/{index-896c4fdf.js → index-1da55ae0.js} +19 -19
- package/build/{index-9427863b.js → index-29ff8541.js} +24 -24
- package/build/{index-20115ada.js → index-2e7d74db.js} +9 -9
- package/build/{index-92d93e22.js → index-34208f1c.js} +6 -6
- package/build/{index-af134c30.js → index-39f51a03.js} +5 -5
- package/build/{index-fc5a1a81.js → index-3cc1179c.js} +1 -1
- package/build/{index-a4dec003.js → index-45add758.js} +2 -2
- package/build/{index-ca833e03.js → index-4974123a.js} +32 -32
- package/build/{index-2f052e2d.js → index-49f0461d.js} +2 -2
- package/build/{index-03093b46.js → index-4a61e65a.js} +16 -16
- package/build/{index-b57dfe26.js → index-4c82634e.js} +2 -2
- package/build/{index-07df8d1a.js → index-51a82282.js} +6 -6
- package/build/{index-d0ca8b4b.js → index-536ade52.js} +1 -1
- package/build/{index-bc0cda88.js → index-5396ca8d.js} +2 -2
- package/build/{index-b45ce592.js → index-58e03ec6.js} +6 -6
- package/build/{index-5eeb8c86.js → index-595868df.js} +6 -6
- package/build/{index-8b9288fa.js → index-59fd3ae8.js} +16 -16
- package/build/{index-437f6f96.js → index-5c45a485.js} +16 -16
- package/build/{index-553e5780.js → index-5e7145a3.js} +13 -13
- package/build/{index-68b84419.js → index-5f02f5bd.js} +2 -2
- package/build/{index-64884964.js → index-64193798.js} +14 -0
- package/build/{index-005dacc4.js → index-6d4bebc1.js} +13 -13
- package/build/{index-469fb7ee.js → index-72c3ab83.js} +3 -3
- package/build/{index-23b9dda4.js → index-73ada0e1.js} +21 -21
- package/build/{index-11713c70.js → index-7ab66545.js} +4 -4
- package/build/{index-40fc038d.js → index-87792f4e.js} +32 -32
- package/build/{index-83bf8bdd.js → index-890f8156.js} +14 -14
- package/build/{index-e3fbe03b.js → index-8a1fd475.js} +2 -2
- package/build/{index-8d2da5c8.js → index-8de4a62b.js} +15 -15
- package/build/{index-c41c78b4.js → index-90014322.js} +1 -1
- package/build/{index-84b8d1b5.js → index-9056ad7f.js} +3 -3
- package/build/{index-2d2fe2b1.js → index-91b97b89.js} +51 -44
- package/build/{index-95974e52.js → index-9834e87e.js} +7 -7
- package/build/{index-045d07b8.js → index-9acc5d73.js} +2 -2
- package/build/{index-180f198b.js → index-9b18a1ad.js} +3 -3
- package/build/{index-53f0c004.js → index-9cb93149.js} +1 -1
- package/build/{index-28e4c1b4.js → index-a0ee6bdf.js} +7 -7
- package/build/{index-e25a9f88.js → index-a2d8cbb4.js} +3 -3
- package/build/{index-e44a59ef.js → index-a8246d0e.js} +3 -3
- package/build/{index-bd4529db.js → index-a9cc1302.js} +18 -18
- package/build/{index-bfb42a57.js → index-acde8f90.js} +3 -3
- package/build/{index-8a6d8e0f.js → index-b599e025.js} +2 -2
- package/build/{index-be31a034.js → index-b8ad684b.js} +2 -2
- package/build/{index-bf508cf7.js → index-bd38fa40.js} +25 -25
- package/build/{index-62173c62.js → index-be6f2bc1.js} +2 -2
- package/build/{index-c4bd61bf.js → index-c368d6cf.js} +3 -3
- package/build/{index-9ca6ef5f.js → index-c776170e.js} +4 -4
- package/build/{index-a88b48a8.js → index-c8909b7a.js} +3 -3
- package/build/{index-519ab49d.js → index-ca913647.js} +1 -1
- package/build/{index-3d9ec0d4.js → index-ccd0fdf4.js} +3 -3
- package/build/{index-176f4b92.js → index-cd11a5f6.js} +11 -11
- package/build/{index-d7bd3994.js → index-ce89dc9e.js} +16 -16
- package/build/{index-aa2bd3fb.js → index-d3a82aa8.js} +2 -2
- package/build/{index-fbf91f6c.js → index-d4613c07.js} +22 -22
- package/build/{index-7abd825b.js → index-d6eb4a5e.js} +2 -2
- package/build/{index-cb7b6b9a.js → index-dbef812e.js} +9 -9
- package/build/{index-9d1df679.js → index-dd3e36cc.js} +3 -2
- package/build/{index-9a07e542.js → index-e3299cf4.js} +3 -3
- package/build/index-f1ed4dfb.js +1951 -0
- package/build/{index-8662633c.js → index-f66d26d3.js} +15 -15
- package/build/{index-3496fb31.js → index-fe0d9598.js} +2 -2
- package/build/index.js +128 -126
- package/build/interfaces/constants/index.d.ts +2 -1
- package/build/{labelSorting-ad062311.js → labelSorting-2c119957.js} +4 -4
- package/build/lead.js +38 -37
- package/build/{logoIcon-6cf01cd6.js → logoIcon-727fd474.js} +2 -2
- package/build/mantine.js +25 -25
- package/build/misc.js +19 -19
- package/build/miscGetDynamicHealthTool.js +4 -4
- package/build/miscGetSocialList.js +8 -8
- package/build/miscScreenSizeContext.js +1 -1
- package/build/mobileBottomNavigation.js +5 -5
- package/build/mobileBottomNavigationIcon.js +5 -5
- package/build/molecules.js +80 -79
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +17 -17
- package/build/navigation.js +50 -49
- package/build/navigationLogoutPopup.js +11 -11
- package/build/navigationProfileButton.js +27 -27
- package/build/onboardingV2.js +29 -29
- package/build/organisms.js +63 -62
- package/build/{post-28b52569.js → post-4d261a5f.js} +2 -2
- package/build/profileNavigation.js +20 -20
- package/build/progressBar.js +1 -1
- package/build/pwg.js +23 -23
- package/build/ssoV2.js +29 -29
- package/build/{store-94ba5496.js → store-4d647c29.js} +3 -3
- package/build/subot.js +46 -46
- package/build/surveyOrPremiumBanner.js +34 -34
- package/build/surveyQuestionCard.js +11 -11
- package/build/{surveyThankyouCard-2bcbb412.js → surveyThankyouCard-d9d50f52.js} +5 -5
- package/build/together.js +57 -57
- package/build/togetherApiUtils.js +6 -6
- package/build/togetherAtoms.js +31 -31
- package/build/togetherComponentGlobalContext.js +6 -6
- package/build/togetherMolecules.js +52 -52
- package/build/togetherMoleculesCardAuthor.js +29 -29
- package/build/togetherMoleculesPostImagePreview.js +13 -13
- package/build/togetherMoleculesProfileDetail.js +40 -40
- package/build/togetherOrganisms.js +51 -51
- package/build/togetherRichTextEditor.js +20 -20
- package/build/togetherShareBox.js +12 -12
- package/build/{transform-c1ac3269.js → transform-2ac47572.js} +176 -65
- package/build/{translationsProvider-7e672d7f.js → translationsProvider-0961410b.js} +1 -1
- package/build/{treePopoverMenu-d39f297a.js → treePopoverMenu-3b792c70.js} +19 -19
- package/build/types.js +2 -2
- package/build/{useCartCareService-5ab73f7a.js → useCartCareService-ac8c5ff6.js} +1 -1
- package/build/{useHealthToolCache-fe16d6a1.js → useHealthToolCache-fb13f617.js} +1 -1
- package/build/{usePhoneValidator-0a642ae3.js → usePhoneValidator-d1f390b6.js} +5 -5
- package/build/{usePlacesAutocomplete-d4340873.js → usePlacesAutocomplete-e841579f.js} +1 -1
- package/build/useTogetherAuthRequiredAction.js +10 -10
- package/build/{utils-329af250.js → utils-9c3fe1d7.js} +5 -5
- package/build/{utils-ac946c7c.js → utils-c15a3a0b.js} +2 -2
- package/build/{utils-930ae326.js → utils-d027a66e.js} +2 -2
- package/build/{utils-08c47f05.js → utils-d952517b.js} +6 -24
- package/build/{utils-b0e7bd61.js → utils-d9f815a9.js} +3 -3
- package/build/vaccination.js +22 -22
- package/package.json +1 -1
- package/build/esm/index-cd0bbcbf.js +0 -31
- package/build/index-da025a8e.js +0 -38
- /package/build/{BMI_BOYS.percentile.monthly-eb75ded7.js → BMI_BOYS.percentile.monthly-e3082bee.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-8ed82736.js → BMI_BOYS.percentile.weekly-b715eaa8.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-2bf39ff4.js → BMI_BOYS.percentile.yearly-4665a4e5.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-c59815ce.js → BMI_BOYS.zscore.monthly-7e83dc64.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-43ebdf38.js → BMI_BOYS.zscore.weekly-e33c5a8f.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-9a66e6fe.js → BMI_BOYS.zscore.yearly-30ad1f57.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-024aca63.js → BMI_GIRLS.percentile.monthly-0ba9f602.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-197e644b.js → BMI_GIRLS.percentile.weekly-bfcba562.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-bd03b9ce.js → BMI_GIRLS.percentile.yearly-8993bc33.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-7e63c31a.js → BMI_GIRLS.zscore.monthly-2efbdabc.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-5cb44eaf.js → BMI_GIRLS.zscore.weekly-2b091127.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-2a98ab1c.js → BMI_GIRLS.zscore.yearly-9ac42c5d.js} +0 -0
- /package/build/{ChevronDown-0008ad7d.js → ChevronDown-bcabc32a.js} +0 -0
- /package/build/{Close-90c21063.js → Close-a13b17ab.js} +0 -0
- /package/build/{Google-8306cb76.js → Google-56a5abbd.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-e7d42012.js → HEAD CIRCUM_BOYS.percentile.monthly-27c7e539.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-2a4973fc.js → HEAD CIRCUM_BOYS.percentile.weekly-6053857b.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-a9df65a8.js → HEAD CIRCUM_BOYS.percentile.yearly-35d810f9.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-def06bda.js → HEAD CIRCUM_BOYS.zscore.monthly-da30fcec.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-628b60ee.js → HEAD CIRCUM_BOYS.zscore.weekly-f8990c90.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-2131b328.js → HEAD CIRCUM_BOYS.zscore.yearly-ade07911.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-c96b9b82.js → HEAD CIRCUM_GIRLS.percentile.monthly-57811bc5.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-51c95353.js → HEAD CIRCUM_GIRLS.percentile.weekly-4d2c6504.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-4bd70a5d.js → HEAD CIRCUM_GIRLS.percentile.yearly-5a6e9697.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-c82e39fa.js → HEAD CIRCUM_GIRLS.zscore.monthly-667d5b35.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-ef11351b.js → HEAD CIRCUM_GIRLS.zscore.weekly-dc6ef28f.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-9229d695.js → HEAD CIRCUM_GIRLS.zscore.yearly-f36a14ac.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-c78280a5.js → HEIGHT_BOYS.percentile.monthly-0f006ba4.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-f2df7c01.js → HEIGHT_BOYS.percentile.weekly-5189de85.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-00c0d708.js → HEIGHT_BOYS.percentile.yearly-275ea444.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-c79b00e5.js → HEIGHT_BOYS.zscore.monthly-78aaca36.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-45b9318c.js → HEIGHT_BOYS.zscore.weekly-f31f5f67.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-c26dd552.js → HEIGHT_BOYS.zscore.yearly-8727712e.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-632f50ae.js → HEIGHT_GIRLS.percentile.monthly-2187fc5a.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-6159caf4.js → HEIGHT_GIRLS.percentile.weekly-249c38b0.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-0c3609e5.js → HEIGHT_GIRLS.percentile.yearly-844d9140.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-e82ffc32.js → HEIGHT_GIRLS.zscore.monthly-3592b190.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-b7a87bb1.js → HEIGHT_GIRLS.zscore.weekly-650b086a.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-ba07d850.js → HEIGHT_GIRLS.zscore.yearly-6ebc0132.js} +0 -0
- /package/build/{Locale-23981f35.js → Locale-ff16c145.js} +0 -0
- /package/build/{Visible-15215e0c.js → Visible-6b874894.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-0e74b080.js → WEIGHT_BOYS.percentile.monthly-9b3e149b.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-1dae453e.js → WEIGHT_BOYS.percentile.weekly-fd175d46.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-4031a9c9.js → WEIGHT_BOYS.percentile.yearly-485ac0d5.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-6a9888cf.js → WEIGHT_BOYS.zscore.monthly-7e540646.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-79c4948a.js → WEIGHT_BOYS.zscore.weekly-d11f4b68.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-ee08ee06.js → WEIGHT_BOYS.zscore.yearly-da55a30e.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-9d15e0c2.js → WEIGHT_GIRLS.percentile.monthly-3990f99c.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-77bdebbc.js → WEIGHT_GIRLS.percentile.weekly-b7cb9dc7.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-f77b17ec.js → WEIGHT_GIRLS.percentile.yearly-f45ee214.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-b00fc4c0.js → WEIGHT_GIRLS.zscore.monthly-72e77798.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-aea7fafc.js → WEIGHT_GIRLS.zscore.weekly-d4ae961d.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-9658a62a.js → WEIGHT_GIRLS.zscore.yearly-7e9a0991.js} +0 -0
- /package/build/{ageGenerate-6ffae569.js → ageGenerate-db85587d.js} +0 -0
- /package/build/{animation-b54cdd8f.js → animation-7acf0edb.js} +0 -0
- /package/build/{constants-4eec0c49.js → constants-265b92b4.js} +0 -0
- /package/build/{constants-17808666.js → constants-dd387796.js} +0 -0
- /package/build/{context-ad31d80e.js → context-3c888756.js} +0 -0
- /package/build/{dataTransform-650b3963.js → dataTransform-081310ce.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-d7cce91c.js → BMI_BOYS.percentile.monthly-b5976a7c.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-d91b50bb.js → BMI_BOYS.percentile.weekly-9229b7b3.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-2a065ef3.js → BMI_BOYS.percentile.yearly-4da881bd.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-398c4bac.js → BMI_BOYS.zscore.monthly-ed195662.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-b6389ceb.js → BMI_BOYS.zscore.weekly-de6b6fc0.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-18f86f43.js → BMI_BOYS.zscore.yearly-3b0d8e3e.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-65e695d9.js → BMI_GIRLS.percentile.monthly-99507db5.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-3883be61.js → BMI_GIRLS.percentile.weekly-8d1f5cf4.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-12a2d679.js → BMI_GIRLS.percentile.yearly-d6d6c053.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-90837dc2.js → BMI_GIRLS.zscore.monthly-c0603b8a.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-6794b97d.js → BMI_GIRLS.zscore.weekly-24b7d5e6.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-bb66712a.js → BMI_GIRLS.zscore.yearly-d12f83be.js} +0 -0
- /package/build/esm/{ChevronDown-e8eda3d5.js → ChevronDown-fab3e09e.js} +0 -0
- /package/build/esm/{Close-e84d5ed4.js → Close-25ad16e1.js} +0 -0
- /package/build/esm/{Google-54183a38.js → Google-44de8f8e.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-3b6f92b3.js → HEAD CIRCUM_BOYS.percentile.monthly-55e86891.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-67712976.js → HEAD CIRCUM_BOYS.percentile.weekly-fb86f35a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-a6ddb7b9.js → HEAD CIRCUM_BOYS.percentile.yearly-7ff74373.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-4b4cf579.js → HEAD CIRCUM_BOYS.zscore.monthly-9fe0d92c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-0d723018.js → HEAD CIRCUM_BOYS.zscore.weekly-8133ba2e.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-3f5040f8.js → HEAD CIRCUM_BOYS.zscore.yearly-d2b9d02c.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-e8aa17ec.js → HEAD CIRCUM_GIRLS.percentile.monthly-ebedd8fa.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-6a07fb80.js → HEAD CIRCUM_GIRLS.percentile.weekly-6ffbf04a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-17cbca59.js → HEAD CIRCUM_GIRLS.percentile.yearly-8e3d6aa5.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-413a23b0.js → HEAD CIRCUM_GIRLS.zscore.monthly-54510a71.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-90f760a8.js → HEAD CIRCUM_GIRLS.zscore.weekly-a939119f.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-729af742.js → HEAD CIRCUM_GIRLS.zscore.yearly-88e95b79.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-5371ae2a.js → HEIGHT_BOYS.percentile.monthly-150e530d.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-356633ec.js → HEIGHT_BOYS.percentile.weekly-972e3fe2.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-0aef78e6.js → HEIGHT_BOYS.percentile.yearly-9a350f6e.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-7ecd4c3e.js → HEIGHT_BOYS.zscore.monthly-b9f570e7.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-9ca95795.js → HEIGHT_BOYS.zscore.weekly-201eca61.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-b4fbc889.js → HEIGHT_BOYS.zscore.yearly-3d87d0e6.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-48355f70.js → HEIGHT_GIRLS.percentile.monthly-fa817f0e.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-637333d7.js → HEIGHT_GIRLS.percentile.weekly-69fff7e2.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-89995969.js → HEIGHT_GIRLS.percentile.yearly-2bbdc13c.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-0a27498a.js → HEIGHT_GIRLS.zscore.monthly-6880aae4.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-5b614a5c.js → HEIGHT_GIRLS.zscore.weekly-bd46906d.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-05bee6e6.js → HEIGHT_GIRLS.zscore.yearly-523d32ee.js} +0 -0
- /package/build/esm/{Locale-6237ebe4.js → Locale-b45f64dd.js} +0 -0
- /package/build/esm/{Visible-07cde34f.js → Visible-ebd41ca6.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-e7b29d80.js → WEIGHT_BOYS.percentile.monthly-2dfb20eb.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-21d36db0.js → WEIGHT_BOYS.percentile.weekly-204e67b7.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-6ee38f89.js → WEIGHT_BOYS.percentile.yearly-323a1074.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-eb1b34de.js → WEIGHT_BOYS.zscore.monthly-6115b5c4.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-57186f85.js → WEIGHT_BOYS.zscore.weekly-4c82f3d6.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-a8704f4b.js → WEIGHT_BOYS.zscore.yearly-ea398b61.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-87e07e0b.js → WEIGHT_GIRLS.percentile.monthly-dacef48c.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-9396d3fa.js → WEIGHT_GIRLS.percentile.weekly-a926d543.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-757c47ba.js → WEIGHT_GIRLS.percentile.yearly-d3106648.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-0e133beb.js → WEIGHT_GIRLS.zscore.monthly-0d01fb50.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-29132fe3.js → WEIGHT_GIRLS.zscore.weekly-34d36470.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-5eb38ecd.js → WEIGHT_GIRLS.zscore.yearly-93de58f7.js} +0 -0
- /package/build/esm/{ageGenerate-224f7d3d.js → ageGenerate-c7c163e8.js} +0 -0
- /package/build/esm/{animation-c287d73b.js → animation-4ef3beec.js} +0 -0
- /package/build/esm/{constants-f3f310d2.js → constants-d5db76c9.js} +0 -0
- /package/build/esm/{constants-056a3269.js → constants-eae66c7c.js} +0 -0
- /package/build/esm/{context-2498a8f0.js → context-e32c6b73.js} +0 -0
- /package/build/esm/{dataTransform-8c20c0ba.js → dataTransform-9912f08b.js} +0 -0
- /package/build/esm/{index-69ecd64f.js → index-1150677c.js} +0 -0
- /package/build/esm/{index-9c086cfe.js → index-2dd84602.js} +0 -0
- /package/build/esm/{index-12605605.js → index-40a681f5.js} +0 -0
- /package/build/esm/{index-18d9b44e.js → index-53adafa8.js} +0 -0
- /package/build/esm/{index-4906b926.js → index-a7780581.js} +0 -0
- /package/build/esm/{index-5ee11169.js → index-d3f9239b.js} +0 -0
- /package/build/esm/{index-55b838de.js → index-e7af3889.js} +0 -0
- /package/build/esm/{index-a031fe16.js → index-ef534160.js} +0 -0
- /package/build/esm/{index.styles-f25c06a1.js → index.styles-9e934a7f.js} +0 -0
- /package/build/esm/{localizeNumberFormat-e26ca2c8.js → localizeNumberFormat-dead6783.js} +0 -0
- /package/build/esm/{normalizeLink-6fc795db.js → normalizeLink-6e0feafd.js} +0 -0
- /package/build/esm/{number-f225de0f.js → number-c75052c8.js} +0 -0
- /package/build/esm/{paths-3b8ab138.js → paths-7124d91e.js} +0 -0
- /package/build/esm/{shared-3def0599.js → shared-46020226.js} +0 -0
- /package/build/esm/{translationsContext-5539c952.js → translationsContext-e21176c1.js} +0 -0
- /package/build/esm/{tslib.es6-1cd753c3.js → tslib.es6-f2b7e9c3.js} +0 -0
- /package/build/esm/{types-f99ecfbf.js → types-2e56bd87.js} +0 -0
- /package/build/esm/{types-13f41421.js → types-ae414a10.js} +0 -0
- /package/build/esm/{useOutsideClick-9fb1183e.js → useOutsideClick-ec049cb9.js} +0 -0
- /package/build/esm/{useScrollbarSize-653fe21a.js → useScrollbarSize-b55c7657.js} +0 -0
- /package/build/esm/{useUniqueId-31d41470.js → useUniqueId-5c2a2bfb.js} +0 -0
- /package/build/esm/{utils-f93704dc.js → utils-7250305e.js} +0 -0
- /package/build/esm/{utils-58ed5b66.js → utils-bf532564.js} +0 -0
- /package/build/{index-79d990e5.js → index-2efa27f5.js} +0 -0
- /package/build/{index-c1fd826e.js → index-38da85cf.js} +0 -0
- /package/build/{index-18f29c69.js → index-47f0e858.js} +0 -0
- /package/build/{index-b4aae532.js → index-5061c733.js} +0 -0
- /package/build/{index-58261cf1.js → index-b2f04a2f.js} +0 -0
- /package/build/{index-cdaefdd3.js → index-bab1ced1.js} +0 -0
- /package/build/{index-21fa50cd.js → index-bc86773b.js} +0 -0
- /package/build/{index-4bea9959.js → index-e0665030.js} +0 -0
- /package/build/{index.styles-052a3b95.js → index.styles-3a84d863.js} +0 -0
- /package/build/{localizeNumberFormat-e8804fd2.js → localizeNumberFormat-3c81287b.js} +0 -0
- /package/build/{normalizeLink-3f586564.js → normalizeLink-8845e2c9.js} +0 -0
- /package/build/{number-108ef76d.js → number-6781231b.js} +0 -0
- /package/build/{paths-e405e716.js → paths-350c134d.js} +0 -0
- /package/build/{shared-cfda3e6a.js → shared-b9d9f426.js} +0 -0
- /package/build/{translationsContext-dd655b46.js → translationsContext-5627662a.js} +0 -0
- /package/build/{tslib.es6-04bb6e9a.js → tslib.es6-c317a4f4.js} +0 -0
- /package/build/{types-2030d630.js → types-0a84788a.js} +0 -0
- /package/build/{types-dfdb38e9.js → types-5a78e2e2.js} +0 -0
- /package/build/{useOutsideClick-a663c31f.js → useOutsideClick-1069fc6f.js} +0 -0
- /package/build/{useScrollbarSize-e4209d68.js → useScrollbarSize-8268e4ed.js} +0 -0
- /package/build/{useUniqueId-540bffa6.js → useUniqueId-48f7bbc2.js} +0 -0
- /package/build/{utils-8d82a825.js → utils-4c3d9336.js} +0 -0
- /package/build/{utils-5e745d8e.js → utils-52a54da5.js} +0 -0
|
@@ -0,0 +1,1951 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var core$1 = require('@hhgtech/icons/core');
|
|
5
|
+
var core = require('@mantine/core');
|
|
6
|
+
var hooks = require('@mantine/hooks');
|
|
7
|
+
var utils$1 = require('./utils-d027a66e.js');
|
|
8
|
+
var useOutsideClick = require('./useOutsideClick-1069fc6f.js');
|
|
9
|
+
var index$1 = require('./index-3cc1179c.js');
|
|
10
|
+
var debounce = require('lodash/debounce');
|
|
11
|
+
var constants = require('./constants-dd387796.js');
|
|
12
|
+
var styled = require('@emotion/styled');
|
|
13
|
+
var miscTheme = require('./miscTheme.js');
|
|
14
|
+
var utils = require('./utils-52a54da5.js');
|
|
15
|
+
var index = require('./index-b2f04a2f.js');
|
|
16
|
+
var index$2 = require('./index-5f02f5bd.js');
|
|
17
|
+
var ChevronDown = require('./ChevronDown-bcabc32a.js');
|
|
18
|
+
var tslib_es6 = require('./tslib.es6-c317a4f4.js');
|
|
19
|
+
var arrow = require('@hhgtech/icons/arrow');
|
|
20
|
+
var index$3 = require('./index-d6eb4a5e.js');
|
|
21
|
+
var paths = require('./paths-350c134d.js');
|
|
22
|
+
var index$4 = require('./index-c368d6cf.js');
|
|
23
|
+
|
|
24
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
25
|
+
|
|
26
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
27
|
+
var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
28
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
29
|
+
|
|
30
|
+
const StyledSearchBarWrapper = styled__default["default"].div ``;
|
|
31
|
+
const StyleWrapperContainer = styled__default["default"].div `
|
|
32
|
+
background-color: ${miscTheme.theme.colors.neutral50};
|
|
33
|
+
padding-bottom: 1px;
|
|
34
|
+
${utils.MediaQueries.mbDown} {
|
|
35
|
+
padding: 0;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
const StyleSearchInputContainer = styled__default["default"](index.Container) `
|
|
39
|
+
padding: 0 16px;
|
|
40
|
+
|
|
41
|
+
${utils.MediaQueries.mbDown} {
|
|
42
|
+
padding: 0;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
const StyleSearchContent = styled__default["default"].div `
|
|
46
|
+
padding: 24px 56px;
|
|
47
|
+
border-radius: 16px;
|
|
48
|
+
background-color: ${miscTheme.theme.colors.white};
|
|
49
|
+
box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
|
|
50
|
+
0px 0px 2px 0px rgba(0, 0, 0, 0.06), 0px 4px 8px 0px rgba(0, 0, 0, 0.04);
|
|
51
|
+
|
|
52
|
+
${utils.MediaQueries.mbDown} {
|
|
53
|
+
padding: 16px;
|
|
54
|
+
border-radius: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.flex-search-input {
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
${utils.MediaQueries.mbDown} {
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
const SEARCH_KEYWORD_MIN_LENGTH = {
|
|
66
|
+
'en-PH': 3,
|
|
67
|
+
'tl-PH': 2,
|
|
68
|
+
'id-ID': 3,
|
|
69
|
+
'vi-VN': 2,
|
|
70
|
+
'zh-TW': 0,
|
|
71
|
+
'ms-MY': 2,
|
|
72
|
+
'th-TH': 2,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const initialState = {
|
|
76
|
+
isMobile: false,
|
|
77
|
+
isDebug: false,
|
|
78
|
+
navigateTo: null,
|
|
79
|
+
geoLocationPermission: 'unset',
|
|
80
|
+
geoLocationCoordinates: null,
|
|
81
|
+
focused: 'none',
|
|
82
|
+
focusedSpecialty: 'none',
|
|
83
|
+
searchLocationKeywords: '',
|
|
84
|
+
searchSpecialtyKeywords: '',
|
|
85
|
+
searchKeywords: '',
|
|
86
|
+
selectedLocation: null,
|
|
87
|
+
selectedSpecialty: null,
|
|
88
|
+
defaultCity: null,
|
|
89
|
+
initialCities: [],
|
|
90
|
+
cities: [],
|
|
91
|
+
searchResults: {},
|
|
92
|
+
initialSearchResults: {},
|
|
93
|
+
isLoadingCities: false,
|
|
94
|
+
isLoadingSearchResults: false,
|
|
95
|
+
isMobileModalOpened: false,
|
|
96
|
+
initialSelectedCity: null,
|
|
97
|
+
autoCompleteDisabled: false,
|
|
98
|
+
inputSearchPlaceholder: '',
|
|
99
|
+
locale: 'vi-VN',
|
|
100
|
+
allSpecialties: [],
|
|
101
|
+
popularKeys: [],
|
|
102
|
+
};
|
|
103
|
+
var ActionTypes;
|
|
104
|
+
(function (ActionTypes) {
|
|
105
|
+
ActionTypes["NavigateTo"] = "navigate to url";
|
|
106
|
+
ActionTypes["ClickOutsideInputLocation"] = "click outside input location";
|
|
107
|
+
ActionTypes["ClickOutsideInputSearch"] = "click outside input search";
|
|
108
|
+
ActionTypes["ClickOutsideInputSearchSpecialty"] = "click outside input search specialty";
|
|
109
|
+
ActionTypes["ClickOutsideInputSpecialty"] = "click outside input specialty";
|
|
110
|
+
ActionTypes["SelectCurrentLocation"] = "select current location";
|
|
111
|
+
ActionTypes["FocusInputLocation"] = "focus input location";
|
|
112
|
+
ActionTypes["FocusInputSearch"] = "focus input search";
|
|
113
|
+
ActionTypes["FocusInputSearchSpecialty"] = "focus input search specialty";
|
|
114
|
+
ActionTypes["ChangeInputLocation"] = "change input location";
|
|
115
|
+
ActionTypes["ChangeInputSearch"] = "change input search";
|
|
116
|
+
ActionTypes["ClearInputLocation"] = "clear input location";
|
|
117
|
+
ActionTypes["ClearInputSearch"] = "clear input search";
|
|
118
|
+
ActionTypes["SelectLocation"] = "select location";
|
|
119
|
+
ActionTypes["SelectSpecialty"] = "select specialty";
|
|
120
|
+
ActionTypes["FetchCitiesStart"] = "fetch cities start";
|
|
121
|
+
ActionTypes["FetchCitiesFinish"] = "fetch cities finish";
|
|
122
|
+
ActionTypes["FetchSearchResultsStart"] = "fetch search results start";
|
|
123
|
+
ActionTypes["FetchSearchResultsComplete"] = "fetch search results complete";
|
|
124
|
+
ActionTypes["FetchSearchResultsFinish"] = "fetch search results finish";
|
|
125
|
+
ActionTypes["FetchCitiesByGeoIpComplete"] = "fetch cities by geo IP finish";
|
|
126
|
+
ActionTypes["FetchCitiesByKeywordComplete"] = "fetch cities by keyword finish";
|
|
127
|
+
ActionTypes["DisplayInitialCities"] = "display initial cities";
|
|
128
|
+
ActionTypes["DisplayInitialSearchResults"] = "display initial search results";
|
|
129
|
+
ActionTypes["UpdateInitialSearchResults"] = "update initial search results";
|
|
130
|
+
ActionTypes["GrantGeoLocationPermission"] = "grant geolocation permission";
|
|
131
|
+
ActionTypes["DenyGeoLocationPermission"] = "deny geolocation permission";
|
|
132
|
+
ActionTypes["OpenMobileModal"] = "open mobile modal";
|
|
133
|
+
ActionTypes["CloseMobileModal"] = "close mobile modal";
|
|
134
|
+
ActionTypes["UpdateInitialSearchValue"] = "update initial search value";
|
|
135
|
+
ActionTypes["SelectSearchResult"] = "select search result";
|
|
136
|
+
ActionTypes["SetInputSearchPlaceholder"] = "set input search placeholder";
|
|
137
|
+
ActionTypes["FocusInputSpecialty"] = "focus input specialty";
|
|
138
|
+
ActionTypes["FetchAllSpecialties"] = "fetch all specialty";
|
|
139
|
+
ActionTypes["FetchPopularKeys"] = "fetch popular key by type";
|
|
140
|
+
})(ActionTypes || (ActionTypes = {}));
|
|
141
|
+
function resetSearchLocationKeywords(state) {
|
|
142
|
+
const { selectedLocation, searchLocationKeywords } = state;
|
|
143
|
+
if (selectedLocation && searchLocationKeywords !== selectedLocation.name) {
|
|
144
|
+
return Object.assign(Object.assign({}, state), { searchLocationKeywords: selectedLocation.name });
|
|
145
|
+
}
|
|
146
|
+
return state;
|
|
147
|
+
}
|
|
148
|
+
function reducer(state, action) {
|
|
149
|
+
var _a, _b;
|
|
150
|
+
if (state.isDebug) {
|
|
151
|
+
console.log('bookingSearchBarV3', { action, state });
|
|
152
|
+
}
|
|
153
|
+
switch (action.type) {
|
|
154
|
+
case ActionTypes.NavigateTo:
|
|
155
|
+
return Object.assign(Object.assign({}, state), { navigateTo: action.payload, focused: 'none', isMobileModalOpened: false });
|
|
156
|
+
case ActionTypes.ClickOutsideInputLocation: {
|
|
157
|
+
if (state.focused !== 'location') {
|
|
158
|
+
return state;
|
|
159
|
+
}
|
|
160
|
+
return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
|
|
161
|
+
}
|
|
162
|
+
case ActionTypes.ClickOutsideInputSpecialty: {
|
|
163
|
+
if (state.focused !== 'specialty') {
|
|
164
|
+
return state;
|
|
165
|
+
}
|
|
166
|
+
return resetSearchLocationKeywords(Object.assign(Object.assign({}, state), { focused: 'none' }));
|
|
167
|
+
}
|
|
168
|
+
case ActionTypes.ClickOutsideInputSearch: {
|
|
169
|
+
if (state.focused !== 'search') {
|
|
170
|
+
return state;
|
|
171
|
+
}
|
|
172
|
+
return Object.assign(Object.assign({}, state), { focused: 'none' });
|
|
173
|
+
}
|
|
174
|
+
case ActionTypes.ClickOutsideInputSearchSpecialty: {
|
|
175
|
+
if (state.focusedSpecialty !== 'search') {
|
|
176
|
+
return state;
|
|
177
|
+
}
|
|
178
|
+
return Object.assign(Object.assign({}, state), { focusedSpecialty: 'none' });
|
|
179
|
+
}
|
|
180
|
+
case ActionTypes.FocusInputLocation: {
|
|
181
|
+
const nextState = Object.assign(Object.assign({}, state), { focused: 'location' });
|
|
182
|
+
if (((_a = state.selectedLocation) === null || _a === void 0 ? void 0 : _a.id) === constants.ID_OPTION_CURRENT_LOCATION) {
|
|
183
|
+
nextState.searchLocationKeywords = '';
|
|
184
|
+
}
|
|
185
|
+
return nextState;
|
|
186
|
+
}
|
|
187
|
+
case ActionTypes.FocusInputSpecialty: {
|
|
188
|
+
const nextState = Object.assign(Object.assign({}, state), { focused: 'specialty' });
|
|
189
|
+
if (((_b = state.selectedLocation) === null || _b === void 0 ? void 0 : _b.id) === constants.ID_OPTION_CURRENT_LOCATION) {
|
|
190
|
+
nextState.searchLocationKeywords = '';
|
|
191
|
+
}
|
|
192
|
+
return nextState;
|
|
193
|
+
}
|
|
194
|
+
case ActionTypes.FocusInputSearch:
|
|
195
|
+
const nextState = Object.assign(Object.assign({}, state), { focused: 'search' });
|
|
196
|
+
if (state.isMobile) {
|
|
197
|
+
return resetSearchLocationKeywords(nextState);
|
|
198
|
+
}
|
|
199
|
+
return nextState;
|
|
200
|
+
case ActionTypes.FocusInputSearchSpecialty: {
|
|
201
|
+
const nextState = Object.assign(Object.assign({}, state), { focusedSpecialty: 'search' });
|
|
202
|
+
return nextState;
|
|
203
|
+
}
|
|
204
|
+
case ActionTypes.ChangeInputLocation:
|
|
205
|
+
return Object.assign(Object.assign({}, state), { searchLocationKeywords: action.payload });
|
|
206
|
+
case ActionTypes.ChangeInputSearch: {
|
|
207
|
+
const keyword = action.payload;
|
|
208
|
+
return Object.assign(Object.assign({}, state), { searchKeywords: keyword, isLoadingSearchResults: keyword.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] });
|
|
209
|
+
}
|
|
210
|
+
case ActionTypes.SelectCurrentLocation:
|
|
211
|
+
return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name });
|
|
212
|
+
case ActionTypes.ClearInputLocation:
|
|
213
|
+
return Object.assign(Object.assign({}, state), { focused: 'location', cities: state.initialCities, searchLocationKeywords: '' });
|
|
214
|
+
case ActionTypes.ClearInputSearch:
|
|
215
|
+
return Object.assign(Object.assign({}, state), { focused: 'search', searchKeywords: '' });
|
|
216
|
+
case ActionTypes.SelectLocation:
|
|
217
|
+
return Object.assign(Object.assign({}, state), { focused: 'none', selectedLocation: action.payload, searchLocationKeywords: action.payload.name, searchResults: {} });
|
|
218
|
+
case ActionTypes.SelectSpecialty:
|
|
219
|
+
return Object.assign(Object.assign({}, state), { focused: 'none', selectedSpecialty: action.payload, searchResults: {} });
|
|
220
|
+
case ActionTypes.SelectSearchResult:
|
|
221
|
+
return Object.assign(Object.assign({}, state), { searchKeywords: action.payload.name, isMobileModalOpened: false, focused: 'none', navigateTo: action.payload.url });
|
|
222
|
+
case ActionTypes.FetchCitiesStart:
|
|
223
|
+
return Object.assign(Object.assign({}, state), { isLoadingCities: true });
|
|
224
|
+
case ActionTypes.FetchCitiesFinish:
|
|
225
|
+
return Object.assign(Object.assign({}, state), { isLoadingCities: false });
|
|
226
|
+
case ActionTypes.FetchSearchResultsStart:
|
|
227
|
+
return Object.assign(Object.assign({}, state), { isLoadingSearchResults: true });
|
|
228
|
+
case ActionTypes.FetchSearchResultsFinish:
|
|
229
|
+
return Object.assign(Object.assign({}, state), { isLoadingSearchResults: false });
|
|
230
|
+
case ActionTypes.FetchSearchResultsComplete: {
|
|
231
|
+
const nextState = Object.assign(Object.assign({}, state), { searchResults: Object.assign(Object.assign({}, state.searchResults), { [action.payload.key]: action.payload.searches }) });
|
|
232
|
+
return nextState;
|
|
233
|
+
}
|
|
234
|
+
case ActionTypes.FetchCitiesByGeoIpComplete: {
|
|
235
|
+
let { cities } = action.payload;
|
|
236
|
+
const { default: defaultCity } = action.payload;
|
|
237
|
+
cities = cities.filter((c) => c.id !== defaultCity.id);
|
|
238
|
+
if (defaultCity) {
|
|
239
|
+
cities.unshift(defaultCity);
|
|
240
|
+
}
|
|
241
|
+
if (state.initialSelectedCity &&
|
|
242
|
+
!cities.find((c) => c.id === state.initialSelectedCity.id)) {
|
|
243
|
+
cities.unshift(state.initialSelectedCity);
|
|
244
|
+
}
|
|
245
|
+
const nextState = Object.assign(Object.assign({}, state), { defaultCity, initialCities: cities, cities });
|
|
246
|
+
if (state.geoLocationPermission === 'denied' &&
|
|
247
|
+
!state.initialSelectedCity) {
|
|
248
|
+
nextState.selectedLocation = defaultCity;
|
|
249
|
+
nextState.searchLocationKeywords = defaultCity.name;
|
|
250
|
+
}
|
|
251
|
+
return nextState;
|
|
252
|
+
}
|
|
253
|
+
case ActionTypes.FetchCitiesByKeywordComplete:
|
|
254
|
+
return Object.assign(Object.assign({}, state), { cities: action.payload });
|
|
255
|
+
case ActionTypes.DisplayInitialCities:
|
|
256
|
+
return Object.assign(Object.assign({}, state), { cities: state.initialCities });
|
|
257
|
+
case ActionTypes.DisplayInitialSearchResults: {
|
|
258
|
+
const trimmed = state.searchKeywords.trim();
|
|
259
|
+
const minLen = SEARCH_KEYWORD_MIN_LENGTH[state.locale];
|
|
260
|
+
const shouldShowEmpty = trimmed.length > 0 && trimmed.length <= minLen;
|
|
261
|
+
return Object.assign(Object.assign({}, state), { searchResults: shouldShowEmpty ? {} : state.initialSearchResults, isLoadingSearchResults: false });
|
|
262
|
+
}
|
|
263
|
+
case ActionTypes.UpdateInitialSearchResults:
|
|
264
|
+
return Object.assign(Object.assign({}, state), { initialSearchResults: Object.assign(Object.assign({}, state.initialSearchResults), { [action.payload.key]: action.payload.searches }) });
|
|
265
|
+
case ActionTypes.GrantGeoLocationPermission:
|
|
266
|
+
return Object.assign(Object.assign({}, state), { geoLocationPermission: 'granted', geoLocationCoordinates: action.payload });
|
|
267
|
+
case ActionTypes.DenyGeoLocationPermission:
|
|
268
|
+
return Object.assign(Object.assign({}, state), { geoLocationPermission: 'denied', geoLocationCoordinates: null });
|
|
269
|
+
case ActionTypes.OpenMobileModal:
|
|
270
|
+
return Object.assign(Object.assign({}, state), { isMobileModalOpened: true });
|
|
271
|
+
case ActionTypes.CloseMobileModal:
|
|
272
|
+
return Object.assign(Object.assign({}, state), { isMobileModalOpened: false });
|
|
273
|
+
case ActionTypes.UpdateInitialSearchValue:
|
|
274
|
+
return Object.assign(Object.assign({}, state), { searchKeywords: action.payload });
|
|
275
|
+
case ActionTypes.SetInputSearchPlaceholder:
|
|
276
|
+
return Object.assign(Object.assign({}, state), { inputSearchPlaceholder: action.payload });
|
|
277
|
+
case ActionTypes.FetchAllSpecialties:
|
|
278
|
+
return Object.assign(Object.assign({}, state), { allSpecialties: action.payload });
|
|
279
|
+
case ActionTypes.FetchPopularKeys:
|
|
280
|
+
return Object.assign(Object.assign({}, state), { popularKeys: action.payload });
|
|
281
|
+
default:
|
|
282
|
+
return state;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const StyleSearchInputsWrapper = styled__default["default"].div `
|
|
287
|
+
flex: 1;
|
|
288
|
+
position: relative;
|
|
289
|
+
|
|
290
|
+
${utils.MediaQueries.mbDown} {
|
|
291
|
+
width: 100%;
|
|
292
|
+
}
|
|
293
|
+
`;
|
|
294
|
+
const StyleSearchBarContainer = styled__default["default"].div `
|
|
295
|
+
background: #f7f9fc;
|
|
296
|
+
border-radius: 12px;
|
|
297
|
+
height: 48px;
|
|
298
|
+
display: flex;
|
|
299
|
+
align-items: center;
|
|
300
|
+
padding: 4px 12px 4px 4px;
|
|
301
|
+
gap: 16px;
|
|
302
|
+
|
|
303
|
+
${utils.MediaQueries.mbDown} {
|
|
304
|
+
height: 48px;
|
|
305
|
+
width: 100%;
|
|
306
|
+
}
|
|
307
|
+
`;
|
|
308
|
+
const StyleSearchIconWrapper = styled__default["default"].div `
|
|
309
|
+
display: flex;
|
|
310
|
+
align-items: center;
|
|
311
|
+
flex-shrink: 0;
|
|
312
|
+
color: #8c8c8c;
|
|
313
|
+
|
|
314
|
+
svg {
|
|
315
|
+
width: 18px;
|
|
316
|
+
height: 18px;
|
|
317
|
+
}
|
|
318
|
+
`;
|
|
319
|
+
const StyleResultWrapper = styled__default["default"].div `
|
|
320
|
+
position: absolute;
|
|
321
|
+
top: calc(100% + 2px);
|
|
322
|
+
width: 100%;
|
|
323
|
+
border-radius: 4px;
|
|
324
|
+
background: ${miscTheme.theme.colors.white};
|
|
325
|
+
box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
|
|
326
|
+
z-index: 10;
|
|
327
|
+
|
|
328
|
+
${utils.MediaQueries.mbDown} {
|
|
329
|
+
width: calc(100% + 64px);
|
|
330
|
+
left: -32px;
|
|
331
|
+
}
|
|
332
|
+
`;
|
|
333
|
+
|
|
334
|
+
const StyledSearchResultWrapper = styled__default["default"].div ``;
|
|
335
|
+
styled__default["default"].div `
|
|
336
|
+
display: flex;
|
|
337
|
+
justify-content: space-between;
|
|
338
|
+
align-item: center;
|
|
339
|
+
padding: 9px 14px 9px 22px;
|
|
340
|
+
background: #f7f9fc;
|
|
341
|
+
|
|
342
|
+
.title {
|
|
343
|
+
color: ${miscTheme.theme.colors.gray800};
|
|
344
|
+
font-size: 14px;
|
|
345
|
+
font-weight: 600;
|
|
346
|
+
line-height: 22px;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.btn-see-all {
|
|
350
|
+
color: ${miscTheme.theme.colors.blue600};
|
|
351
|
+
font-size: 14px;
|
|
352
|
+
line-height: 22px;
|
|
353
|
+
cursor: pointer;
|
|
354
|
+
}
|
|
355
|
+
`;
|
|
356
|
+
const StyleResultBody = styled__default["default"].div `
|
|
357
|
+
padding: 10px 16px;
|
|
358
|
+
max-height: 400px;
|
|
359
|
+
overflow: auto;
|
|
360
|
+
`;
|
|
361
|
+
const StyleResultItem = styled__default["default"].div `
|
|
362
|
+
display: flex;
|
|
363
|
+
gap: 12px;
|
|
364
|
+
align-items: center;
|
|
365
|
+
cursor: pointer;
|
|
366
|
+
|
|
367
|
+
${utils.MediaQueries.mbUp} {
|
|
368
|
+
&:hover {
|
|
369
|
+
background-color: ${miscTheme.theme.colors.blue50};
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.image-item {
|
|
374
|
+
flex: 0 0 48px;
|
|
375
|
+
width: 48px;
|
|
376
|
+
height: 48px;
|
|
377
|
+
border-radius: 50%;
|
|
378
|
+
|
|
379
|
+
img {
|
|
380
|
+
object-fit: contain;
|
|
381
|
+
width: 100%;
|
|
382
|
+
height: 100%;
|
|
383
|
+
border-radius: 50%;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
.infor {
|
|
387
|
+
overflow: hidden;
|
|
388
|
+
padding: 12px 0;
|
|
389
|
+
flex: 1;
|
|
390
|
+
border-bottom: 1px solid ${miscTheme.theme.colors.neutral100};
|
|
391
|
+
.title {
|
|
392
|
+
color: ${miscTheme.theme.colors.gray800};
|
|
393
|
+
font-size: 16px;
|
|
394
|
+
font-weight: 600;
|
|
395
|
+
line-height: 24px;
|
|
396
|
+
}
|
|
397
|
+
.description {
|
|
398
|
+
overflow: hidden;
|
|
399
|
+
color: ${miscTheme.theme.colors.gray600};
|
|
400
|
+
text-overflow: ellipsis;
|
|
401
|
+
white-space: nowrap;
|
|
402
|
+
font-size: 12px;
|
|
403
|
+
line-height: 18px;
|
|
404
|
+
display: flex;
|
|
405
|
+
gap: 8px;
|
|
406
|
+
align-items: center;
|
|
407
|
+
margin-top: 5px;
|
|
408
|
+
|
|
409
|
+
svg {
|
|
410
|
+
flex: 0 0 16px;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.sub-description {
|
|
414
|
+
overflow: hidden;
|
|
415
|
+
white-space: nowrap;
|
|
416
|
+
text-overflow: ellipsis;
|
|
417
|
+
flex: 1;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
&.last-item {
|
|
423
|
+
.infor {
|
|
424
|
+
border-bottom: none;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
`;
|
|
428
|
+
styled__default["default"].div `
|
|
429
|
+
padding: 0 16px 16px;
|
|
430
|
+
|
|
431
|
+
.search-detail-btn {
|
|
432
|
+
color: ${miscTheme.theme.colors.blue600};
|
|
433
|
+
font-size: 14px;
|
|
434
|
+
line-height: 22px;
|
|
435
|
+
cursor: pointer;
|
|
436
|
+
}
|
|
437
|
+
`;
|
|
438
|
+
|
|
439
|
+
const SearchResult = ({ state, type, results,
|
|
440
|
+
// location,
|
|
441
|
+
isLoading, typeInformation,
|
|
442
|
+
// clientSlug = '',
|
|
443
|
+
dispatch, }) => {
|
|
444
|
+
const { t } = index$1.useTranslations();
|
|
445
|
+
const { selectedLocation } = state;
|
|
446
|
+
const typeSlug = React.useMemo(() => typeInformation[type].slug, [typeInformation, type]);
|
|
447
|
+
const handleOnClick = (item) => {
|
|
448
|
+
let url = '';
|
|
449
|
+
switch (type) {
|
|
450
|
+
case 'service':
|
|
451
|
+
url = `/${selectedLocation.slug}/${typeSlug}/${item.slug}`;
|
|
452
|
+
break;
|
|
453
|
+
case 'doctor':
|
|
454
|
+
case 'hospital':
|
|
455
|
+
url = `/${typeSlug}/${item.slug}-${item.id}`;
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
if (url) {
|
|
459
|
+
dispatch({
|
|
460
|
+
type: ActionTypes.NavigateTo,
|
|
461
|
+
payload: url,
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
// const handleSeeAll = () => {
|
|
466
|
+
// let url = `/${selectedLocation.slug}/${typeSlug}`
|
|
467
|
+
// const slugClientUrl = MAPPING_CLIENT_WITH_SLUG[locale][clientSlug]
|
|
468
|
+
// if (slugClientUrl) {
|
|
469
|
+
// url += `/${slugClientUrl}`
|
|
470
|
+
// }
|
|
471
|
+
// if (
|
|
472
|
+
// (type === 'doctor' || type === 'hospital') &&
|
|
473
|
+
// state.selectedSpecialty.id > 0
|
|
474
|
+
// ) {
|
|
475
|
+
// url += `?specialtyId=${state.selectedSpecialty.id}`
|
|
476
|
+
// }
|
|
477
|
+
// if (url) {
|
|
478
|
+
// dispatch({ type: ActionTypes.NavigateTo, payload: url })
|
|
479
|
+
// }
|
|
480
|
+
// }
|
|
481
|
+
if (results === null)
|
|
482
|
+
return null;
|
|
483
|
+
return (React__default["default"].createElement(StyledSearchResultWrapper, null,
|
|
484
|
+
React__default["default"].createElement(StyleResultBody, { className: "search-results__body" },
|
|
485
|
+
isLoading && (React__default["default"].createElement("div", { className: "skeleton-result" }, Array(3)
|
|
486
|
+
.fill(undefined)
|
|
487
|
+
.map((_, i) => (React__default["default"].createElement(StyleResultItem, { key: type + 'loading' + i, className: i === 2 ? 'last-item' : '' },
|
|
488
|
+
React__default["default"].createElement("div", { className: "image-item" },
|
|
489
|
+
React__default["default"].createElement(core.Skeleton, { height: 48, circle: true, mb: "xl", animate: true })),
|
|
490
|
+
React__default["default"].createElement("div", { className: "infor" },
|
|
491
|
+
React__default["default"].createElement("div", { className: "title" },
|
|
492
|
+
React__default["default"].createElement(core.Skeleton, { height: 8, mt: 10, radius: "xl", animate: true })),
|
|
493
|
+
React__default["default"].createElement("div", { className: "description" },
|
|
494
|
+
React__default["default"].createElement("div", { className: "sub-description" },
|
|
495
|
+
React__default["default"].createElement(core.Skeleton, { height: 8, mt: 10, radius: "xl", width: "80%", animate: true }))))))))),
|
|
496
|
+
!isLoading && results && results.length > 0 && (React__default["default"].createElement(React__default["default"].Fragment, null, results.map((item, index) => {
|
|
497
|
+
var _a, _b;
|
|
498
|
+
const isLastItem = (results.length > 4 && index === 3) ||
|
|
499
|
+
(results.length <= 4 && index === results.length - 1);
|
|
500
|
+
let subDescription = '';
|
|
501
|
+
if (type === 'hospital') {
|
|
502
|
+
subDescription = (item === null || item === void 0 ? void 0 : item.address) || '';
|
|
503
|
+
}
|
|
504
|
+
if (type === 'doctor') {
|
|
505
|
+
subDescription = ((_a = item === null || item === void 0 ? void 0 : item.specialties) === null || _a === void 0 ? void 0 : _a.join(', ')) || '';
|
|
506
|
+
}
|
|
507
|
+
if (type === 'service') {
|
|
508
|
+
subDescription = ((_b = item === null || item === void 0 ? void 0 : item.hospital_branch) === null || _b === void 0 ? void 0 : _b.name) || '';
|
|
509
|
+
}
|
|
510
|
+
if (index >= 4) {
|
|
511
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
512
|
+
}
|
|
513
|
+
return (React__default["default"].createElement(StyleResultItem, { key: item.id, className: core.clsx(isLastItem ? 'last-item' : '', 'result-item'), onClick: () => handleOnClick(item) },
|
|
514
|
+
React__default["default"].createElement("div", { className: "image-item" },
|
|
515
|
+
React__default["default"].createElement("img", { src: item.logo || item.avatar, alt: item.name })),
|
|
516
|
+
React__default["default"].createElement("div", { className: "infor" },
|
|
517
|
+
React__default["default"].createElement("div", { className: "title" }, item.name),
|
|
518
|
+
React__default["default"].createElement("div", { className: "description" },
|
|
519
|
+
typeInformation[type].icon,
|
|
520
|
+
React__default["default"].createElement("div", { className: "sub-description" }, subDescription)))));
|
|
521
|
+
}))),
|
|
522
|
+
!isLoading && (results === null || results === void 0 ? void 0 : results.length) === 0 && (React__default["default"].createElement(index$2.Text, { size: "sm", color: miscTheme.theme.colors.gray400, className: "noresult-block" }, t('booking.searchBar.noResults'))))));
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
const SearchResultContent = ({ state, type, isLoading, clientSlug, typeInformation, dispatch, }) => {
|
|
526
|
+
var _a;
|
|
527
|
+
if (state.focused !== 'search')
|
|
528
|
+
return null;
|
|
529
|
+
return (React__default["default"].createElement(SearchResult, { type: type, state: state, results: ((_a = state.searchResults) === null || _a === void 0 ? void 0 : _a[type]) || null, location: state.selectedLocation.name, dispatch: dispatch, isLoading: isLoading, typeInformation: typeInformation, clientSlug: clientSlug }));
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
const StyleSearchSpecialtyWrapper = styled__default["default"].div `
|
|
533
|
+
position: relative;
|
|
534
|
+
flex-shrink: 0;
|
|
535
|
+
|
|
536
|
+
${utils.MediaQueries.mbDown} {
|
|
537
|
+
width: 100%;
|
|
538
|
+
display: flex;
|
|
539
|
+
flex-direction: column;
|
|
540
|
+
gap: 12px;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
&.compact {
|
|
544
|
+
${utils.MediaQueries.mbDown} {
|
|
545
|
+
width: auto;
|
|
546
|
+
display: block;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
`;
|
|
550
|
+
const StyleDropdownPanel = styled__default["default"].div `
|
|
551
|
+
position: absolute;
|
|
552
|
+
top: calc(100% + 4px);
|
|
553
|
+
left: 0;
|
|
554
|
+
min-width: 264px;
|
|
555
|
+
background: white;
|
|
556
|
+
border-radius: 12px;
|
|
557
|
+
box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04),
|
|
558
|
+
0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04);
|
|
559
|
+
z-index: 10;
|
|
560
|
+
overflow: hidden;
|
|
561
|
+
|
|
562
|
+
&.mobile {
|
|
563
|
+
min-width: 280px;
|
|
564
|
+
}
|
|
565
|
+
`;
|
|
566
|
+
const StyledSpecialtyItem = styled__default["default"].div `
|
|
567
|
+
cursor: pointer;
|
|
568
|
+
padding: 12px 16px;
|
|
569
|
+
display: flex;
|
|
570
|
+
align-items: center;
|
|
571
|
+
gap: 12px;
|
|
572
|
+
outline: none;
|
|
573
|
+
|
|
574
|
+
.image-item {
|
|
575
|
+
display: flex;
|
|
576
|
+
align-items: center;
|
|
577
|
+
justify-content: center;
|
|
578
|
+
width: 24px;
|
|
579
|
+
height: 24px;
|
|
580
|
+
flex-shrink: 0;
|
|
581
|
+
|
|
582
|
+
img {
|
|
583
|
+
width: 100%;
|
|
584
|
+
height: 100%;
|
|
585
|
+
object-fit: contain;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
svg {
|
|
589
|
+
width: 24px;
|
|
590
|
+
height: 24px;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.item-label {
|
|
595
|
+
font-size: 15px;
|
|
596
|
+
font-weight: 400;
|
|
597
|
+
line-height: 24px;
|
|
598
|
+
letter-spacing: -0.3px;
|
|
599
|
+
color: ${miscTheme.theme.colors.gray800};
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
&:hover {
|
|
603
|
+
background-color: ${miscTheme.theme.colors.neutral50};
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
&.selected {
|
|
607
|
+
background-color: ${miscTheme.theme.colors.neutral50};
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
&:last-child {
|
|
611
|
+
border-bottom-left-radius: 12px;
|
|
612
|
+
border-bottom-right-radius: 12px;
|
|
613
|
+
}
|
|
614
|
+
`;
|
|
615
|
+
|
|
616
|
+
const DoctorIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
617
|
+
React__default["default"].createElement("path", { d: "M8.983 14.333q-1.666 0-2.833-1.166Q4.983 12 4.983 10.333v-.366a3.48 3.48 0 0 1-2.258-1.2 3.57 3.57 0 0 1-.909-2.434V3.1a.58.58 0 0 1 .175-.425.58.58 0 0 1 .425-.175h1.4v-.167a.486.486 0 0 1 .5-.5q.217 0 .36.142a.5.5 0 0 1 .14.358v1.334a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V3.5h-1v2.833q0 1.1.784 1.884Q4.383 9 5.483 9t1.883-.783.784-1.884V3.5h-1v.167a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V2.333a.486.486 0 0 1 .5-.5q.217 0 .358.142a.5.5 0 0 1 .142.358V2.5h1.4a.58.58 0 0 1 .425.175.58.58 0 0 1 .175.425v3.233q0 1.4-.908 2.434a3.5 3.5 0 0 1-2.259 1.2v.366q0 1.25.875 2.126a2.9 2.9 0 0 0 2.125.874q1.25 0 2.125-.874a2.9 2.9 0 0 0 .875-2.126V9.25a1.74 1.74 0 0 1-.858-.609 1.6 1.6 0 0 1-.342-1.008q0-.716.5-1.216t1.2-.5q.716 0 1.217.5.5.5.5 1.216 0 .567-.342 1.008t-.875.609v1.083q0 1.667-1.167 2.834-1.166 1.166-2.833 1.166m3.5-6q.3 0 .509-.208a.67.67 0 0 0 .208-.492q0-.3-.208-.508a.7.7 0 0 0-.509-.208q-.3 0-.5.208a.7.7 0 0 0-.2.508q0 .284.2.492t.5.208", fill: "#595959" })));
|
|
618
|
+
const ServiceIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
619
|
+
React__default["default"].createElement("path", { d: "M6.868 9.265v.974q0 .405.284.69.284.283.69.283t.69-.284.284-.69v-.973h.973q.405 0 .69-.284a.94.94 0 0 0 .284-.689.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284h-.973v-.974a.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284.94.94 0 0 0-.689.284.94.94 0 0 0-.285.69v.974h-.973a.94.94 0 0 0-.69.283.94.94 0 0 0-.284.69q0 .405.284.69.285.284.69.284zm-3.46 4.868q-.581 0-.994-.413A1.36 1.36 0 0 1 2 12.725v-6.65a1.4 1.4 0 0 1 .563-1.127l4.434-3.333q.369-.282.844-.282.474 0 .846.282l4.434 3.333q.264.193.413.493.15.3.15.633v6.651q0 .58-.414.995a1.36 1.36 0 0 1-.994.413zm0-1.168h8.868q.105 0 .172-.068a.23.23 0 0 0 .068-.172v-6.65a.2.2 0 0 0-.027-.11.3.3 0 0 0-.07-.085L7.983 2.554a.2.2 0 0 0-.142-.052.2.2 0 0 0-.142.052L3.266 5.88a.3.3 0 0 0-.071.086.2.2 0 0 0-.027.108v6.651q0 .105.068.172a.23.23 0 0 0 .172.068", fill: "#595959" })));
|
|
620
|
+
const HospitalIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
621
|
+
React__default["default"].createElement("path", { d: "M8 8q.55 0 .941-.392.393-.391.392-.941 0-.55-.392-.942A1.28 1.28 0 0 0 8 5.333q-.55 0-.942.392a1.28 1.28 0 0 0-.391.942q0 .55.391.941Q7.45 8 8 8m0 4.9q2.032-1.866 3.017-3.392Q12 7.983 12 6.8q0-1.817-1.158-2.975Q9.682 2.667 8 2.667T5.158 3.825Q4 4.983 4 6.8q0 1.184.983 2.708Q5.966 11.034 8 12.9m0 1.517a.8.8 0 0 1-.5-.183q-2.433-2.151-3.633-3.992T2.667 6.8q0-2.5 1.608-3.983Q5.883 1.332 8 1.333q2.116 0 3.725 1.484T13.333 6.8q0 1.6-1.2 3.442-1.2 1.841-3.633 3.991a.8.8 0 0 1-.5.184", fill: "#8C8C8C" })));
|
|
622
|
+
const SpecialtyIcon = () => (React__default["default"].createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16" },
|
|
623
|
+
React__default["default"].createElement("path", { d: "M3.833.5a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667M10.5.5c-.92 0-1.667.746-1.667 1.667V5.5c0 .92.746 1.667 1.667 1.667h3.333c.921 0 1.667-.746 1.667-1.667V2.167C15.5 1.246 14.754.5 13.833.5zM3.833 8.833a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667m8.334 0a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667", fill: "#9AA2AC" })));
|
|
624
|
+
|
|
625
|
+
const SearchSpecialty = ({ state, isMobile, onSpecialtyClick, dispatch, isCompact = false, }) => {
|
|
626
|
+
const { t, locale } = index$1.useTranslations();
|
|
627
|
+
const inputSpecialtyWrapperRef = React.useRef(null);
|
|
628
|
+
const searchInputRef = React.useRef(null);
|
|
629
|
+
const slugs = React.useMemo(() => constants.LOCALIZED_SLUGS[locale], [locale]);
|
|
630
|
+
const [searchValue, setSearchValue] = React.useState('');
|
|
631
|
+
const [opened, { close, toggle }] = hooks.useDisclosure(false);
|
|
632
|
+
useOutsideClick.useOutsideClick(inputSpecialtyWrapperRef, () => {
|
|
633
|
+
close();
|
|
634
|
+
setSearchValue('');
|
|
635
|
+
dispatch({ type: ActionTypes.ClickOutsideInputSpecialty });
|
|
636
|
+
});
|
|
637
|
+
const specialtyData = React.useMemo(() => [
|
|
638
|
+
{
|
|
639
|
+
name: t('booking.searchBar.allSpecialties'),
|
|
640
|
+
id: -1,
|
|
641
|
+
thumbnail: '',
|
|
642
|
+
total_doctor: 0,
|
|
643
|
+
slug: slugs.SPECIALTIES,
|
|
644
|
+
},
|
|
645
|
+
...state.allSpecialties,
|
|
646
|
+
], [state.allSpecialties, t, slugs.SPECIALTIES]);
|
|
647
|
+
const filteredData = React.useMemo(() => {
|
|
648
|
+
if (!searchValue.trim())
|
|
649
|
+
return specialtyData;
|
|
650
|
+
return specialtyData.filter((s) => s.name.toLowerCase().includes(searchValue.toLowerCase().trim()));
|
|
651
|
+
}, [specialtyData, searchValue]);
|
|
652
|
+
const selectedLabel = React.useMemo(() => {
|
|
653
|
+
if (!state.selectedSpecialty)
|
|
654
|
+
return '';
|
|
655
|
+
return state.selectedSpecialty.name;
|
|
656
|
+
}, [state.selectedSpecialty]);
|
|
657
|
+
const handleSelect = React.useCallback((item) => {
|
|
658
|
+
onSpecialtyClick({
|
|
659
|
+
id: item.id,
|
|
660
|
+
name: item.name,
|
|
661
|
+
slug: item.slug,
|
|
662
|
+
thumbnail: item.thumbnail || '',
|
|
663
|
+
total_doctor: 0,
|
|
664
|
+
});
|
|
665
|
+
close();
|
|
666
|
+
setSearchValue('');
|
|
667
|
+
}, [onSpecialtyClick, close]);
|
|
668
|
+
const handleToggle = React.useCallback(() => {
|
|
669
|
+
toggle();
|
|
670
|
+
if (opened) {
|
|
671
|
+
setSearchValue('');
|
|
672
|
+
}
|
|
673
|
+
}, [toggle, opened]);
|
|
674
|
+
return (React__default["default"].createElement(StyleSearchSpecialtyWrapper, { ref: inputSpecialtyWrapperRef, className: isCompact ? 'compact' : '' },
|
|
675
|
+
React__default["default"].createElement(core.Box, { onClick: handleToggle, className: opened ? 'dropdown-trigger-open' : '', sx: {
|
|
676
|
+
cursor: 'pointer',
|
|
677
|
+
position: 'relative',
|
|
678
|
+
width: isCompact ? (isMobile ? 96 : 160) : '100%',
|
|
679
|
+
flexShrink: 0,
|
|
680
|
+
} },
|
|
681
|
+
React__default["default"].createElement(core.Input, { readOnly: true, value: selectedLabel, placeholder: t('booking.searchPopup.specialties'), rightSection: React__default["default"].createElement(ChevronDown.ChevronDown, { style: { width: 20, height: 20 } }), styles: Object.assign({ input: {
|
|
682
|
+
cursor: 'pointer',
|
|
683
|
+
outline: 'none',
|
|
684
|
+
'&:focus': {
|
|
685
|
+
outline: 'none',
|
|
686
|
+
},
|
|
687
|
+
'&:not(.mantine-Textarea-input)': {
|
|
688
|
+
height: isCompact ? 40 : isMobile ? 40 : 46,
|
|
689
|
+
fontSize: isCompact ? core.rem(14) : isMobile ? core.rem(14) : core.rem(16),
|
|
690
|
+
paddingLeft: isCompact ? 12 : 16,
|
|
691
|
+
paddingRight: 30,
|
|
692
|
+
background: isCompact ? 'white' : 'transparent',
|
|
693
|
+
border: isCompact
|
|
694
|
+
? `1px solid ${miscTheme.theme.colors.gray200}`
|
|
695
|
+
: 'none',
|
|
696
|
+
borderRadius: 8,
|
|
697
|
+
letterSpacing: '-0.2px',
|
|
698
|
+
color: miscTheme.theme.colors.gray800,
|
|
699
|
+
textOverflow: 'ellipsis',
|
|
700
|
+
overflow: 'hidden',
|
|
701
|
+
whiteSpace: 'nowrap',
|
|
702
|
+
},
|
|
703
|
+
}, rightSection: {
|
|
704
|
+
width: 30,
|
|
705
|
+
pointerEvents: 'none',
|
|
706
|
+
} }, (!isCompact && {
|
|
707
|
+
wrapper: {
|
|
708
|
+
position: 'relative',
|
|
709
|
+
'&:after': {
|
|
710
|
+
content: '""',
|
|
711
|
+
width: '1px',
|
|
712
|
+
height: '20px',
|
|
713
|
+
backgroundColor: miscTheme.theme.colors.neutral100,
|
|
714
|
+
position: 'absolute',
|
|
715
|
+
right: 0,
|
|
716
|
+
top: '50%',
|
|
717
|
+
transform: 'translateY(-50%)',
|
|
718
|
+
},
|
|
719
|
+
},
|
|
720
|
+
})) })),
|
|
721
|
+
opened && (React__default["default"].createElement(StyleDropdownPanel, { className: isMobile ? 'mobile' : '' },
|
|
722
|
+
React__default["default"].createElement(core.Box, { sx: { padding: '12px 12px 8px' } },
|
|
723
|
+
React__default["default"].createElement(core.Input, { ref: searchInputRef, icon: React__default["default"].createElement(core$1.Search, { size: 18, color: miscTheme.theme.colors.gray300 }), placeholder: t('booking.searchBar.placeholder.specialty'), value: searchValue, onChange: (e) => setSearchValue(e.target.value), size: "md", styles: {
|
|
724
|
+
input: {
|
|
725
|
+
height: 40,
|
|
726
|
+
fontSize: core.rem(15),
|
|
727
|
+
paddingLeft: 36,
|
|
728
|
+
'&::placeholder': {
|
|
729
|
+
color: miscTheme.theme.colors.gray400,
|
|
730
|
+
},
|
|
731
|
+
},
|
|
732
|
+
icon: {
|
|
733
|
+
width: 36,
|
|
734
|
+
},
|
|
735
|
+
} })),
|
|
736
|
+
React__default["default"].createElement(core.ScrollArea.Autosize, { mah: 300 }, filteredData.length === 0 ? (React__default["default"].createElement(core.Box, { sx: {
|
|
737
|
+
padding: '12px 16px',
|
|
738
|
+
color: miscTheme.theme.colors.gray400,
|
|
739
|
+
fontSize: 14,
|
|
740
|
+
} }, t('common.noResult'))) : (filteredData.map((specialty) => {
|
|
741
|
+
var _a, _b;
|
|
742
|
+
return (React__default["default"].createElement(StyledSpecialtyItem, { key: specialty.id, tabIndex: 0, role: "option", "aria-selected": ((_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id) === specialty.id, className: ((_b = state.selectedSpecialty) === null || _b === void 0 ? void 0 : _b.id) === specialty.id
|
|
743
|
+
? 'selected'
|
|
744
|
+
: '', onClick: () => handleSelect(specialty), onKeyDown: (e) => {
|
|
745
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
746
|
+
e.preventDefault();
|
|
747
|
+
handleSelect(specialty);
|
|
748
|
+
}
|
|
749
|
+
} },
|
|
750
|
+
React__default["default"].createElement("div", { className: "image-item" }, specialty.thumbnail ? (React__default["default"].createElement("img", { src: specialty.thumbnail, alt: specialty.name })) : (React__default["default"].createElement(SpecialtyIcon, null))),
|
|
751
|
+
React__default["default"].createElement("span", { className: "item-label" }, specialty.name)));
|
|
752
|
+
})))))));
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
const SearchInputs = React.forwardRef(({ state, type, isMobile, isLoading, initalSearchValue, typeInformation, debouncedFetchSearchResults, trackingAttributes, hideSpecialtySelection = false, clientSlug = '', onSearch, onFocusInput, onEnterSearch, dispatch, onlyShowSearchBox, onChangeSpecialty, }, ref) => {
|
|
756
|
+
const { t } = index$1.useTranslations();
|
|
757
|
+
const inputSearchWrapperRef = React.useRef(null);
|
|
758
|
+
const internalInputRef = React.useRef(null);
|
|
759
|
+
React.useImperativeHandle(ref, () => ({
|
|
760
|
+
focus: () => {
|
|
761
|
+
var _a;
|
|
762
|
+
(_a = internalInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
763
|
+
},
|
|
764
|
+
}));
|
|
765
|
+
const gaAttributes = React.useMemo(() => {
|
|
766
|
+
if (trackingAttributes) {
|
|
767
|
+
return {
|
|
768
|
+
'data-event-category': trackingAttributes.dataEventCategory,
|
|
769
|
+
'data-event-action': trackingAttributes.dataEventAction,
|
|
770
|
+
'data-event-label': trackingAttributes.dataEventLabel,
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
else {
|
|
774
|
+
return {};
|
|
775
|
+
}
|
|
776
|
+
}, [trackingAttributes]);
|
|
777
|
+
const placeholderSearch = React.useMemo(() => {
|
|
778
|
+
if (type === 'doctor')
|
|
779
|
+
return t('booking.searchBar.placeholder.doctor');
|
|
780
|
+
if (type === 'service')
|
|
781
|
+
return t('booking.searchBar.placeholder.service');
|
|
782
|
+
if (type === 'hospital')
|
|
783
|
+
return t('booking.searchBar.placeholder.hospital');
|
|
784
|
+
if (type === 'specialty')
|
|
785
|
+
return t('booking.searchBar.placeholder.specialty');
|
|
786
|
+
return '';
|
|
787
|
+
}, [type, t]);
|
|
788
|
+
const showSpecialtyInSearchBar = type !== 'specialty' &&
|
|
789
|
+
type !== 'service' &&
|
|
790
|
+
!hideSpecialtySelection &&
|
|
791
|
+
!onlyShowSearchBox;
|
|
792
|
+
const styleInputUnstyled = React.useMemo(() => ({
|
|
793
|
+
input: {
|
|
794
|
+
border: 'none',
|
|
795
|
+
background: 'transparent',
|
|
796
|
+
height: '100%',
|
|
797
|
+
fontSize: core.rem(16),
|
|
798
|
+
color: miscTheme.theme.colors.gray800,
|
|
799
|
+
padding: '0',
|
|
800
|
+
'&::placeholder': {
|
|
801
|
+
color: miscTheme.theme.colors.gray400,
|
|
802
|
+
},
|
|
803
|
+
'&:focus': {
|
|
804
|
+
outline: 'none',
|
|
805
|
+
boxShadow: 'none',
|
|
806
|
+
},
|
|
807
|
+
[isMobile ? '@media (max-width: 767px)' : '']: isMobile
|
|
808
|
+
? {
|
|
809
|
+
fontSize: core.rem(16),
|
|
810
|
+
}
|
|
811
|
+
: {},
|
|
812
|
+
},
|
|
813
|
+
wrapper: {
|
|
814
|
+
flex: 1,
|
|
815
|
+
},
|
|
816
|
+
}), [isMobile]);
|
|
817
|
+
useOutsideClick.useOutsideClick(inputSearchWrapperRef, () => {
|
|
818
|
+
!isMobile && dispatch({ type: ActionTypes.ClickOutsideInputSearch });
|
|
819
|
+
});
|
|
820
|
+
const handleSearchInputChange = React.useCallback(function handleSearchInputChange(value) {
|
|
821
|
+
dispatch({ type: ActionTypes.ChangeInputSearch, payload: value });
|
|
822
|
+
if (typeof onSearch === 'function') {
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale] ||
|
|
826
|
+
initalSearchValue ||
|
|
827
|
+
value.trim().length === 0) {
|
|
828
|
+
debouncedFetchSearchResults(value.trim(), state, type, clientSlug);
|
|
829
|
+
}
|
|
830
|
+
}, [
|
|
831
|
+
dispatch,
|
|
832
|
+
state,
|
|
833
|
+
type,
|
|
834
|
+
initalSearchValue,
|
|
835
|
+
debouncedFetchSearchResults,
|
|
836
|
+
clientSlug,
|
|
837
|
+
onSearch,
|
|
838
|
+
]);
|
|
839
|
+
const handleSpecialtyClick = React.useCallback(function handleSpecialtyClick(specialty) {
|
|
840
|
+
var _a;
|
|
841
|
+
dispatch({ type: ActionTypes.SelectSpecialty, payload: specialty });
|
|
842
|
+
onChangeSpecialty === null || onChangeSpecialty === void 0 ? void 0 : onChangeSpecialty(specialty);
|
|
843
|
+
!isMobile && ((_a = internalInputRef.current) === null || _a === void 0 ? void 0 : _a.focus());
|
|
844
|
+
}, [dispatch, onChangeSpecialty]);
|
|
845
|
+
const inputOnKeyDown = React.useCallback((e) => {
|
|
846
|
+
if (e.key === 'Enter') {
|
|
847
|
+
e.stopPropagation();
|
|
848
|
+
e.preventDefault();
|
|
849
|
+
onEnterSearch && onEnterSearch();
|
|
850
|
+
}
|
|
851
|
+
}, [onEnterSearch]);
|
|
852
|
+
return (React__default["default"].createElement(StyleSearchInputsWrapper, { ref: inputSearchWrapperRef },
|
|
853
|
+
React__default["default"].createElement(StyleSearchBarContainer, null,
|
|
854
|
+
showSpecialtyInSearchBar && (React__default["default"].createElement(SearchSpecialty, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchSearchResults: debouncedFetchSearchResults, onSpecialtyClick: handleSpecialtyClick, isCompact: true })),
|
|
855
|
+
React__default["default"].createElement(StyleSearchIconWrapper, null,
|
|
856
|
+
React__default["default"].createElement(core$1.Search, null)),
|
|
857
|
+
React__default["default"].createElement(core.Input, Object.assign({ ref: internalInputRef, variant: "unstyled", size: isMobile ? 'md' : 'lg', placeholder: placeholderSearch, styles: styleInputUnstyled, value: state.searchKeywords, name: "search-results", autoComplete: "off", onFocus: () => {
|
|
858
|
+
dispatch({ type: ActionTypes.FocusInputSearch });
|
|
859
|
+
onFocusInput === null || onFocusInput === void 0 ? void 0 : onFocusInput();
|
|
860
|
+
}, onChange: (event) => {
|
|
861
|
+
handleSearchInputChange(event.target.value);
|
|
862
|
+
}, onKeyDown: inputOnKeyDown }, gaAttributes))),
|
|
863
|
+
!isMobile && type !== 'specialty' && (React__default["default"].createElement(StyleResultWrapper, null,
|
|
864
|
+
React__default["default"].createElement(SearchResultContent, { type: type, state: state, dispatch: dispatch, isLoading: isLoading, typeInformation: typeInformation, clientSlug: clientSlug })))));
|
|
865
|
+
});
|
|
866
|
+
SearchInputs.displayName = 'SearchInputs';
|
|
867
|
+
|
|
868
|
+
const ModalSearchResult = (_a) => {
|
|
869
|
+
var { searchInputEle, closeModal, children } = _a, props = tslib_es6.__rest(_a, ["searchInputEle", "closeModal", "children"]);
|
|
870
|
+
const theme = core.useMantineTheme();
|
|
871
|
+
return (React__default["default"].createElement(index$3.Modal, Object.assign({}, props, { zIndex: 310, fullScreen: true, styles: {
|
|
872
|
+
content: {
|
|
873
|
+
borderRadius: 0,
|
|
874
|
+
height: '100%',
|
|
875
|
+
'.search-results__body': { padding: 0 },
|
|
876
|
+
'.result-item': {
|
|
877
|
+
paddingLeft: 16,
|
|
878
|
+
paddingRight: 16,
|
|
879
|
+
},
|
|
880
|
+
'.noresult-block': {
|
|
881
|
+
padding: 16,
|
|
882
|
+
},
|
|
883
|
+
'.skeleton-result': {
|
|
884
|
+
padding: 16,
|
|
885
|
+
},
|
|
886
|
+
},
|
|
887
|
+
header: { display: 'none' },
|
|
888
|
+
} }),
|
|
889
|
+
React__default["default"].createElement(core.Stack, { spacing: 16, sx: { paddingTop: 16 } },
|
|
890
|
+
React__default["default"].createElement(core.Flex, { align: 'center', gap: 12 },
|
|
891
|
+
React__default["default"].createElement(arrow.ArrowLeft, { size: 28, onClick: closeModal, color: theme.fn.primaryColor() }),
|
|
892
|
+
React__default["default"].createElement(core.Box, { sx: { width: '100%' } }, searchInputEle)),
|
|
893
|
+
children)));
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
const StyleSearchLocationWrapper = styled__default["default"].div `
|
|
897
|
+
position: relative;
|
|
898
|
+
width: 240px;
|
|
899
|
+
flex-shrink: 0;
|
|
900
|
+
|
|
901
|
+
${utils.MediaQueries.mbDown} {
|
|
902
|
+
width: 100%;
|
|
903
|
+
}
|
|
904
|
+
`;
|
|
905
|
+
styled__default["default"].div `
|
|
906
|
+
position: absolute;
|
|
907
|
+
top: calc(100% + 2px);
|
|
908
|
+
width: 100%;
|
|
909
|
+
border-radius: 4px;
|
|
910
|
+
background: ${miscTheme.theme.colors.white};
|
|
911
|
+
box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1);
|
|
912
|
+
z-index: 10;
|
|
913
|
+
|
|
914
|
+
${utils.MediaQueries.mbDown} {
|
|
915
|
+
width: calc(100% + 64px);
|
|
916
|
+
left: -32px;
|
|
917
|
+
}
|
|
918
|
+
`;
|
|
919
|
+
const StyledLocationItem = styled__default["default"].div `
|
|
920
|
+
position: relative;
|
|
921
|
+
cursor: pointer;
|
|
922
|
+
padding: 12px 18px;
|
|
923
|
+
display: flex;
|
|
924
|
+
align-items: center;
|
|
925
|
+
gap: 14px;
|
|
926
|
+
overflow: hidden;
|
|
927
|
+
|
|
928
|
+
& + li::before {
|
|
929
|
+
content: '';
|
|
930
|
+
position: absolute;
|
|
931
|
+
left: 18px;
|
|
932
|
+
right: 18px;
|
|
933
|
+
top: 0;
|
|
934
|
+
height: 1px;
|
|
935
|
+
background-color: ${miscTheme.theme.colors.neutral100};
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
&:not([data-is-denied='true']):hover {
|
|
939
|
+
background-color: ${miscTheme.theme.colors.neutral50};
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
&:last-child:hover {
|
|
943
|
+
border-bottom-right-radius: 6px;
|
|
944
|
+
border-bottom-left-radius: 6px;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
&:first-child:hover {
|
|
948
|
+
border-top-right-radius: 6px;
|
|
949
|
+
border-top-left-radius: 6px;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
&[data-is-denied='true'] {
|
|
953
|
+
cursor: not-allowed;
|
|
954
|
+
}
|
|
955
|
+
`;
|
|
956
|
+
const StyledPinIcon = styled__default["default"](utils$1.PinIcon) `
|
|
957
|
+
width: 12px;
|
|
958
|
+
height: 18px;
|
|
959
|
+
flex: 0 0 12px;
|
|
960
|
+
`;
|
|
961
|
+
|
|
962
|
+
const CustomSelectItem = React.forwardRef((_a, ref) => {
|
|
963
|
+
var { label, value } = _a, others = tslib_es6.__rest(_a, ["label", "value"]);
|
|
964
|
+
return (React__default["default"].createElement("div", Object.assign({ ref: ref }, others),
|
|
965
|
+
React__default["default"].createElement(StyledLocationItem, { key: value, role: "button", tabIndex: 0, "aria-label": `Select ${label} as location`, className: "location-item" },
|
|
966
|
+
React__default["default"].createElement(StyledPinIcon, { color: miscTheme.theme.colors.neutral400 }),
|
|
967
|
+
React__default["default"].createElement(core.Text, { size: "md" }, label))));
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
const SearchLocation = ({ state, debouncedFetchCitiesByKeyword, selectedLocation, trackingAttributes, onLocationClick, dispatch, }) => {
|
|
971
|
+
var _a;
|
|
972
|
+
const { t, locale } = index$1.useTranslations();
|
|
973
|
+
const inputLocationWrapperRef = React.useRef(null);
|
|
974
|
+
const citiesData = React.useMemo(() => {
|
|
975
|
+
var _a;
|
|
976
|
+
return [
|
|
977
|
+
{
|
|
978
|
+
name: t('booking.searchBar.allLocations'),
|
|
979
|
+
id: constants.ID_OPTION_ALL_LOCATION,
|
|
980
|
+
slug: (_a = constants.LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
|
|
981
|
+
},
|
|
982
|
+
...state.cities,
|
|
983
|
+
];
|
|
984
|
+
}, [state.cities, t, locale]);
|
|
985
|
+
const gaAttributes = React.useMemo(() => {
|
|
986
|
+
if (trackingAttributes) {
|
|
987
|
+
return {
|
|
988
|
+
'data-event-category': trackingAttributes.dataEventCategory,
|
|
989
|
+
'data-event-action': trackingAttributes.dataEventAction,
|
|
990
|
+
'data-event-label': trackingAttributes.dataEventLabel,
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
return {};
|
|
994
|
+
}, [trackingAttributes]);
|
|
995
|
+
const handleSearchLocationInputChange = React.useCallback(function handleSearchLocationInputChange(value) {
|
|
996
|
+
dispatch({ type: ActionTypes.ChangeInputLocation, payload: value });
|
|
997
|
+
if (value.trim().length > SEARCH_KEYWORD_MIN_LENGTH[state.locale]) {
|
|
998
|
+
debouncedFetchCitiesByKeyword(value.trim());
|
|
999
|
+
}
|
|
1000
|
+
else {
|
|
1001
|
+
debouncedFetchCitiesByKeyword.cancel();
|
|
1002
|
+
dispatch({ type: ActionTypes.DisplayInitialCities });
|
|
1003
|
+
}
|
|
1004
|
+
}, [debouncedFetchCitiesByKeyword, dispatch, state.locale]);
|
|
1005
|
+
useOutsideClick.useOutsideClick(inputLocationWrapperRef, () => {
|
|
1006
|
+
dispatch({ type: ActionTypes.ClickOutsideInputLocation });
|
|
1007
|
+
});
|
|
1008
|
+
const stateValue = (_a = selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.id) !== null && _a !== void 0 ? _a : null;
|
|
1009
|
+
const defaultValue = stateValue === null ? undefined : String(stateValue);
|
|
1010
|
+
return (React__default["default"].createElement(StyleSearchLocationWrapper, { ref: inputLocationWrapperRef },
|
|
1011
|
+
React__default["default"].createElement(core.Select, Object.assign({ key: defaultValue !== null && defaultValue !== void 0 ? defaultValue : 'no-selected-location', defaultValue: defaultValue, placeholder: t('booking.searchBar.allLocations'), searchable: true, onSearchChange: (value) => {
|
|
1012
|
+
handleSearchLocationInputChange(value);
|
|
1013
|
+
}, onFocus: () => {
|
|
1014
|
+
dispatch({ type: ActionTypes.DisplayInitialCities });
|
|
1015
|
+
}, onDropdownClose: () => {
|
|
1016
|
+
debouncedFetchCitiesByKeyword.cancel();
|
|
1017
|
+
dispatch({ type: ActionTypes.DisplayInitialCities });
|
|
1018
|
+
}, nothingFound: t('common.noResult'), maxDropdownHeight: 340, dropdownPosition: "bottom", icon: React__default["default"].createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
1019
|
+
React__default["default"].createElement("path", { d: "M9.99908 10.8332C11.2264 10.8332 12.2213 9.83764 12.2213 8.61097C12.2213 7.3843 11.2264 6.38875 9.99908 6.38875C8.77174 6.38875 7.77686 7.3843 7.77686 8.61097C7.77686 9.83764 8.77174 10.8332 9.99908 10.8332Z", stroke: "#111111", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
1020
|
+
React__default["default"].createElement("path", { d: "M9.99919 18.0554C11.7584 17.4999 16.6659 13.611 16.6659 8.61097C16.6659 4.93097 13.6811 1.94431 9.99919 1.94431C6.3173 1.94431 3.33252 4.93097 3.33252 8.61097C3.33252 13.611 8.23996 17.4999 9.99919 18.0554Z", stroke: "#111111", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })), rightSection: React__default["default"].createElement(ChevronDown.ChevronDown, { style: { width: 20, height: 20 } }) }, gaAttributes, { styles: () => ({
|
|
1021
|
+
item: {
|
|
1022
|
+
padding: 0,
|
|
1023
|
+
'&[data-selected]': {
|
|
1024
|
+
'&, &:hover': {
|
|
1025
|
+
backgroundColor: '#F7F9FC',
|
|
1026
|
+
color: 'inherit',
|
|
1027
|
+
},
|
|
1028
|
+
'.location-item': {
|
|
1029
|
+
'&::after': {
|
|
1030
|
+
content: utils$1.checkMarkIconUrl,
|
|
1031
|
+
top: '50%',
|
|
1032
|
+
right: 19,
|
|
1033
|
+
position: 'absolute',
|
|
1034
|
+
transform: 'translateY(-50%)',
|
|
1035
|
+
},
|
|
1036
|
+
},
|
|
1037
|
+
},
|
|
1038
|
+
'&[data-hovered]': {
|
|
1039
|
+
backgroundColor: 'transparent',
|
|
1040
|
+
},
|
|
1041
|
+
},
|
|
1042
|
+
root: {
|
|
1043
|
+
width: '100%',
|
|
1044
|
+
},
|
|
1045
|
+
wrapper: {
|
|
1046
|
+
width: '100%',
|
|
1047
|
+
},
|
|
1048
|
+
input: {
|
|
1049
|
+
'&:not(.mantine-Textarea-input)': {
|
|
1050
|
+
height: 48,
|
|
1051
|
+
fontSize: core.rem(15),
|
|
1052
|
+
fontWeight: 400,
|
|
1053
|
+
letterSpacing: '-0.3px',
|
|
1054
|
+
color: miscTheme.theme.colors.gray1000,
|
|
1055
|
+
paddingLeft: 44,
|
|
1056
|
+
paddingRight: 40,
|
|
1057
|
+
background: 'white',
|
|
1058
|
+
border: `1px solid ${miscTheme.theme.colors.gray200}`,
|
|
1059
|
+
borderRadius: 12,
|
|
1060
|
+
},
|
|
1061
|
+
},
|
|
1062
|
+
icon: {
|
|
1063
|
+
width: 44,
|
|
1064
|
+
paddingLeft: 12,
|
|
1065
|
+
},
|
|
1066
|
+
rightSection: {
|
|
1067
|
+
width: 40,
|
|
1068
|
+
paddingRight: 12,
|
|
1069
|
+
},
|
|
1070
|
+
itemsWrapper: {
|
|
1071
|
+
padding: 0,
|
|
1072
|
+
},
|
|
1073
|
+
dropdown: {
|
|
1074
|
+
left: '0 !important',
|
|
1075
|
+
border: 0,
|
|
1076
|
+
marginTop: 4,
|
|
1077
|
+
borderRadius: 12,
|
|
1078
|
+
overflow: 'hidden',
|
|
1079
|
+
boxShadow: '0px 0px 1px 0px rgba(0, 0, 0, 0.04), 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04)',
|
|
1080
|
+
'& ::-webkit-scrollbar': {
|
|
1081
|
+
width: '6px',
|
|
1082
|
+
height: '6px',
|
|
1083
|
+
},
|
|
1084
|
+
},
|
|
1085
|
+
}), itemComponent: CustomSelectItem, filter: () => true, onChange: (value) => {
|
|
1086
|
+
if (value == null)
|
|
1087
|
+
return;
|
|
1088
|
+
const city = citiesData.find((i) => String(i.id) === value);
|
|
1089
|
+
if (!city)
|
|
1090
|
+
return;
|
|
1091
|
+
onLocationClick(city);
|
|
1092
|
+
debouncedFetchCitiesByKeyword.cancel();
|
|
1093
|
+
dispatch({ type: ActionTypes.DisplayInitialCities });
|
|
1094
|
+
setTimeout(() => {
|
|
1095
|
+
var _a, _b;
|
|
1096
|
+
(_b = (_a = inputLocationWrapperRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === null || _b === void 0 ? void 0 : _b.blur();
|
|
1097
|
+
}, 0);
|
|
1098
|
+
}, data: citiesData.map((city) => ({
|
|
1099
|
+
value: String(city.id),
|
|
1100
|
+
label: city.name,
|
|
1101
|
+
city,
|
|
1102
|
+
})) }))));
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
const StyleSpecialtiesWrapper = styled__default["default"].div `
|
|
1106
|
+
display: flex;
|
|
1107
|
+
flex-wrap: wrap;
|
|
1108
|
+
row-gap: 8px;
|
|
1109
|
+
column-gap: 20px;
|
|
1110
|
+
${utils.MediaQueries.mbDown} {
|
|
1111
|
+
margin-top: 12px;
|
|
1112
|
+
}
|
|
1113
|
+
`;
|
|
1114
|
+
const StyleSpecialtyItem = styled__default["default"].div `
|
|
1115
|
+
display: flex;
|
|
1116
|
+
align-items: center;
|
|
1117
|
+
border-radius: 8px;
|
|
1118
|
+
border: 1px solid ${miscTheme.theme.colors.neutral100};
|
|
1119
|
+
background: ${miscTheme.theme.colors.white};
|
|
1120
|
+
padding: 8px 12px 8px 8px;
|
|
1121
|
+
flex: 0 0 calc(33.3% - 13px);
|
|
1122
|
+
gap: 12px;
|
|
1123
|
+
cursor: pointer;
|
|
1124
|
+
|
|
1125
|
+
&:hover {
|
|
1126
|
+
background: ${miscTheme.theme.colors.blue50};
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
${utils.MediaQueries.tdDown} {
|
|
1130
|
+
flex: 0 0 calc(50% - 10px);
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
${utils.MediaQueries.mbDown} {
|
|
1134
|
+
flex: 0 0 100%;
|
|
1135
|
+
border: none;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
.image-item {
|
|
1139
|
+
display: flex;
|
|
1140
|
+
align-items: center;
|
|
1141
|
+
width: 40px;
|
|
1142
|
+
height: 40px;
|
|
1143
|
+
|
|
1144
|
+
img {
|
|
1145
|
+
width: 100%;
|
|
1146
|
+
object-fit: cover;
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
.infor {
|
|
1151
|
+
flex: 1;
|
|
1152
|
+
.title {
|
|
1153
|
+
color: ${miscTheme.theme.colors.gray800};
|
|
1154
|
+
font-size: 14px;
|
|
1155
|
+
font-style: normal;
|
|
1156
|
+
font-weight: 400;
|
|
1157
|
+
line-height: 22px;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
.description {
|
|
1161
|
+
color: ${miscTheme.theme.colors.gray600};
|
|
1162
|
+
font-size: 12px;
|
|
1163
|
+
font-weight: 400;
|
|
1164
|
+
line-height: 18px;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
`;
|
|
1168
|
+
const StyleDivider = styled__default["default"](core.Divider) `
|
|
1169
|
+
margin: 24px 0 !important;
|
|
1170
|
+
`;
|
|
1171
|
+
const StyleShowMore = styled__default["default"].div `
|
|
1172
|
+
display: flex;
|
|
1173
|
+
justify-content: center;
|
|
1174
|
+
margin-top: 24px;
|
|
1175
|
+
.show-more {
|
|
1176
|
+
border-radius: 4px;
|
|
1177
|
+
border: 1px solid ${miscTheme.theme.colors.neutral200};
|
|
1178
|
+
padding: 12px 16px;
|
|
1179
|
+
cursor: pointer;
|
|
1180
|
+
display: inline-block;
|
|
1181
|
+
color: ${miscTheme.theme.colors.gray800};
|
|
1182
|
+
font-size: 16px;
|
|
1183
|
+
font-weight: 600;
|
|
1184
|
+
line-height: 24px;
|
|
1185
|
+
|
|
1186
|
+
${utils.MediaQueries.mbDown} {
|
|
1187
|
+
width: 100%;
|
|
1188
|
+
text-align: center;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
`;
|
|
1192
|
+
|
|
1193
|
+
const SearchResultSpecialties = ({ state, isMobile, specialties, isLoading, dispatch, }) => {
|
|
1194
|
+
const { t, locale } = index$1.useTranslations();
|
|
1195
|
+
const { selectedLocation } = state;
|
|
1196
|
+
const slugs = React.useMemo(() => constants.LOCALIZED_SLUGS[locale], [locale]);
|
|
1197
|
+
const handleOnClick = (specialtySlug) => {
|
|
1198
|
+
let url = '';
|
|
1199
|
+
if (specialtySlug === constants.SLUG_VACIN_ID) {
|
|
1200
|
+
url = `/${selectedLocation.slug}/${slugs.HOSPITAL}/${constants.CLIENT_KEY.GSK}/`;
|
|
1201
|
+
dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
|
|
1202
|
+
}
|
|
1203
|
+
else {
|
|
1204
|
+
url = `/${selectedLocation.slug}/${slugs.DOCTOR}/${specialtySlug}`;
|
|
1205
|
+
}
|
|
1206
|
+
dispatch({ type: ActionTypes.NavigateTo, payload: url });
|
|
1207
|
+
};
|
|
1208
|
+
const handleShowMore = () => {
|
|
1209
|
+
const url = `/${slugs.SPECIALTIES}`;
|
|
1210
|
+
dispatch({ type: ActionTypes.NavigateTo, payload: url });
|
|
1211
|
+
};
|
|
1212
|
+
const showSeeMore = React.useMemo(() => {
|
|
1213
|
+
return (specialties.length >= 9 ||
|
|
1214
|
+
state.searchKeywords.trim().length <=
|
|
1215
|
+
SEARCH_KEYWORD_MIN_LENGTH[state.locale]);
|
|
1216
|
+
}, [state.searchKeywords, specialties]);
|
|
1217
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1218
|
+
!isMobile && React__default["default"].createElement(StyleDivider, { color: "#E4E8EC" }),
|
|
1219
|
+
React__default["default"].createElement(StyleSpecialtiesWrapper, null,
|
|
1220
|
+
specialties.length > 0 && !isLoading && (React__default["default"].createElement(React__default["default"].Fragment, null, specialties.map((specialty, index) => {
|
|
1221
|
+
if (index >= 9) {
|
|
1222
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
1223
|
+
}
|
|
1224
|
+
return (React__default["default"].createElement(StyleSpecialtyItem, { key: specialty.id, onClick: () => handleOnClick(specialty.slug) },
|
|
1225
|
+
React__default["default"].createElement("div", { className: "image-item" },
|
|
1226
|
+
React__default["default"].createElement("img", { src: specialty.thumbnail, alt: specialty.name })),
|
|
1227
|
+
React__default["default"].createElement("div", { className: "infor" },
|
|
1228
|
+
React__default["default"].createElement("div", { className: "title" }, specialty.name))));
|
|
1229
|
+
}))),
|
|
1230
|
+
specialties.length === 0 && !isLoading && (React__default["default"].createElement(index$2.Text, { size: "sm", color: miscTheme.theme.colors.gray400 }, t('booking.searchBar.noResults'))),
|
|
1231
|
+
isLoading &&
|
|
1232
|
+
Array(6)
|
|
1233
|
+
.fill(undefined)
|
|
1234
|
+
.map((_, i) => (React__default["default"].createElement(StyleSpecialtyItem, { key: 'loading' + i },
|
|
1235
|
+
React__default["default"].createElement("div", { className: "image-item" },
|
|
1236
|
+
React__default["default"].createElement(core.Skeleton, { height: 40, animate: true })),
|
|
1237
|
+
React__default["default"].createElement("div", { className: "infor" },
|
|
1238
|
+
React__default["default"].createElement("div", { className: "title" },
|
|
1239
|
+
React__default["default"].createElement(core.Skeleton, { height: 20, radius: "sm", animate: true }))))))),
|
|
1240
|
+
showSeeMore && (React__default["default"].createElement(StyleShowMore, null,
|
|
1241
|
+
React__default["default"].createElement("div", { className: "show-more", onClick: handleShowMore }, t('home.seeAll'))))));
|
|
1242
|
+
};
|
|
1243
|
+
|
|
1244
|
+
const StyleSearchTagWrapper = styled__default["default"].div `
|
|
1245
|
+
display: flex;
|
|
1246
|
+
gap: 5px;
|
|
1247
|
+
margin-top: 16px;
|
|
1248
|
+
flex-wrap: wrap;
|
|
1249
|
+
`;
|
|
1250
|
+
const StyleTagItem = styled__default["default"].div `
|
|
1251
|
+
color: ${miscTheme.theme.colors.gray600};
|
|
1252
|
+
font-size: 14px;
|
|
1253
|
+
font-weight: 600;
|
|
1254
|
+
line-height: 22px;
|
|
1255
|
+
padding: 4px 12px;
|
|
1256
|
+
background: ${miscTheme.theme.colors.white};
|
|
1257
|
+
border-radius: 32px;
|
|
1258
|
+
cursor: pointer;
|
|
1259
|
+
border: 1px solid ${miscTheme.theme.colors.white};
|
|
1260
|
+
margin-bottom: 5px;
|
|
1261
|
+
border-color: ${miscTheme.theme.colors.neutral100};
|
|
1262
|
+
background: #f7f9fc;
|
|
1263
|
+
|
|
1264
|
+
&.view-all {
|
|
1265
|
+
border-radius: 32px;
|
|
1266
|
+
border-color: ${miscTheme.theme.colors.blue50};
|
|
1267
|
+
background: ${miscTheme.theme.colors.blue50};
|
|
1268
|
+
color: ${miscTheme.theme.colors.blue600};
|
|
1269
|
+
|
|
1270
|
+
&:hover {
|
|
1271
|
+
border-color: ${miscTheme.theme.colors.blue50};
|
|
1272
|
+
background: ${miscTheme.theme.colors.blue50};
|
|
1273
|
+
color: ${miscTheme.theme.colors.blue600};
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
&:hover {
|
|
1278
|
+
border-color: ${miscTheme.theme.colors.neutral100};
|
|
1279
|
+
background: #f7f9fc;
|
|
1280
|
+
}
|
|
1281
|
+
`;
|
|
1282
|
+
const StyleTagLabel = styled__default["default"].div `
|
|
1283
|
+
color: ${miscTheme.theme.colors.gray600};
|
|
1284
|
+
font-size: 14px;
|
|
1285
|
+
font-weight: 600;
|
|
1286
|
+
line-height: 22px;
|
|
1287
|
+
padding: 4px 0;
|
|
1288
|
+
background: ${miscTheme.theme.colors.white};
|
|
1289
|
+
border-radius: 32px;
|
|
1290
|
+
border: 1px solid ${miscTheme.theme.colors.white};
|
|
1291
|
+
margin-bottom: 5px;
|
|
1292
|
+
margin-right: 7px;
|
|
1293
|
+
`;
|
|
1294
|
+
|
|
1295
|
+
const SearchTag = ({ state, type, typeInformation, dispatch }) => {
|
|
1296
|
+
const { t } = index$1.useTranslations();
|
|
1297
|
+
const { selectedLocation } = state;
|
|
1298
|
+
const typeSlug = React.useMemo(() => typeInformation[type].slug, [typeInformation, type]);
|
|
1299
|
+
const handleViewAll = () => {
|
|
1300
|
+
const url = `/${selectedLocation.slug}/${typeSlug}`;
|
|
1301
|
+
if (url) {
|
|
1302
|
+
dispatch({ type: ActionTypes.NavigateTo, payload: url });
|
|
1303
|
+
}
|
|
1304
|
+
};
|
|
1305
|
+
const handleClickKeyword = (keyword) => {
|
|
1306
|
+
if (keyword.url) {
|
|
1307
|
+
window.location.href = keyword.url;
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
return (React__default["default"].createElement(StyleSearchTagWrapper, null,
|
|
1311
|
+
React__default["default"].createElement(StyleTagLabel, null, t('booking.searchBar.popularKey')),
|
|
1312
|
+
state.popularKeys.map((item) => {
|
|
1313
|
+
return (React__default["default"].createElement(StyleTagItem, { key: item.id, onClick: () => handleClickKeyword(item) }, item.keyword));
|
|
1314
|
+
}),
|
|
1315
|
+
React__default["default"].createElement(StyleTagItem, { className: "view-all", onClick: handleViewAll }, t('booking.searchBar.viewAll'))));
|
|
1316
|
+
};
|
|
1317
|
+
|
|
1318
|
+
const StyledTabWrapper = styled__default["default"].div `
|
|
1319
|
+
background: rgba(255, 255, 255, 0.64);
|
|
1320
|
+
backdrop-filter: blur(12px);
|
|
1321
|
+
border-bottom: 1px solid ${miscTheme.theme.colors.neutral100};
|
|
1322
|
+
`;
|
|
1323
|
+
const StyleTabContainer = styled__default["default"](index.Container) `
|
|
1324
|
+
padding: 0 16px;
|
|
1325
|
+
`;
|
|
1326
|
+
|
|
1327
|
+
const TabSearch = ({ currentTab, hideTabBookingSearch = [], hideSpecialtyTab, isMobile, setCurrentTab, }) => {
|
|
1328
|
+
const { t } = index$1.useTranslations();
|
|
1329
|
+
const stylesTabs = React.useMemo(() => {
|
|
1330
|
+
return {
|
|
1331
|
+
root: {
|
|
1332
|
+
overflowY: isMobile ? 'hidden' : 'initial',
|
|
1333
|
+
overflowX: isMobile ? 'auto' : 'initial',
|
|
1334
|
+
},
|
|
1335
|
+
tabsList: {
|
|
1336
|
+
background: 'rgba(255, 255, 255, 0)',
|
|
1337
|
+
borderBottom: 'none',
|
|
1338
|
+
flexWrap: 'nowrap',
|
|
1339
|
+
'.mantine-Tabs-tab': {
|
|
1340
|
+
'&:last-child': {
|
|
1341
|
+
'&:after': {
|
|
1342
|
+
display: 'none',
|
|
1343
|
+
},
|
|
1344
|
+
},
|
|
1345
|
+
},
|
|
1346
|
+
},
|
|
1347
|
+
tab: {
|
|
1348
|
+
padding: isMobile ? '12px 16px 12px 16px' : '15px 40px 15px 40px',
|
|
1349
|
+
borderTop: '2px solid transparent',
|
|
1350
|
+
borderBottom: 'none',
|
|
1351
|
+
margin: 0,
|
|
1352
|
+
borderRadius: 0,
|
|
1353
|
+
position: 'relative',
|
|
1354
|
+
width: 'auto',
|
|
1355
|
+
'&[data-active="true"]': {
|
|
1356
|
+
borderColor: '#2d87f3',
|
|
1357
|
+
backgroundColor: '#ffffff',
|
|
1358
|
+
'&:after': {
|
|
1359
|
+
display: 'none',
|
|
1360
|
+
},
|
|
1361
|
+
'&:before': {
|
|
1362
|
+
content: '""',
|
|
1363
|
+
width: '100%',
|
|
1364
|
+
height: '1px',
|
|
1365
|
+
position: 'absolute',
|
|
1366
|
+
backgroundColor: '#ffffff',
|
|
1367
|
+
bottom: '-1px',
|
|
1368
|
+
},
|
|
1369
|
+
},
|
|
1370
|
+
'&:hover': {
|
|
1371
|
+
borderColor: '#2d87f3',
|
|
1372
|
+
backgroundColor: '#ffffff',
|
|
1373
|
+
'&:before': {
|
|
1374
|
+
content: '""',
|
|
1375
|
+
width: '100%',
|
|
1376
|
+
height: '1px',
|
|
1377
|
+
position: 'absolute',
|
|
1378
|
+
backgroundColor: '#ffffff',
|
|
1379
|
+
bottom: '-1px',
|
|
1380
|
+
},
|
|
1381
|
+
},
|
|
1382
|
+
'&:after': {
|
|
1383
|
+
content: '""',
|
|
1384
|
+
width: '1px',
|
|
1385
|
+
height: '24px',
|
|
1386
|
+
backgroundColor: '#E4E8EC',
|
|
1387
|
+
position: 'absolute',
|
|
1388
|
+
right: '-1px',
|
|
1389
|
+
},
|
|
1390
|
+
},
|
|
1391
|
+
tabLabel: {
|
|
1392
|
+
color: '#595959',
|
|
1393
|
+
fontSize: isMobile ? '14px' : '16px',
|
|
1394
|
+
fontWeight: 600,
|
|
1395
|
+
lineHeight: isMobile ? '22px' : '24px',
|
|
1396
|
+
},
|
|
1397
|
+
};
|
|
1398
|
+
}, [isMobile]);
|
|
1399
|
+
const tabConfig = React.useMemo(() => [
|
|
1400
|
+
{
|
|
1401
|
+
value: 'hospital',
|
|
1402
|
+
label: t('booking.searchPopup.hospitals'),
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
value: 'doctor',
|
|
1406
|
+
label: t('booking.searchPopup.doctors'),
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
value: 'service',
|
|
1410
|
+
label: t('booking.searchPopup.services'),
|
|
1411
|
+
},
|
|
1412
|
+
...(!hideSpecialtyTab
|
|
1413
|
+
? [
|
|
1414
|
+
{
|
|
1415
|
+
value: 'specialty',
|
|
1416
|
+
label: t('booking.searchPopup.specialties'),
|
|
1417
|
+
},
|
|
1418
|
+
]
|
|
1419
|
+
: []),
|
|
1420
|
+
], [hideSpecialtyTab]);
|
|
1421
|
+
const activeTabs = React.useMemo(() => {
|
|
1422
|
+
return (tabConfig.filter((item) => !hideTabBookingSearch.includes(item.value)) ||
|
|
1423
|
+
[]);
|
|
1424
|
+
}, [hideTabBookingSearch, tabConfig]);
|
|
1425
|
+
return (React__default["default"].createElement(StyledTabWrapper, { className: "booking-search-tab" },
|
|
1426
|
+
React__default["default"].createElement(StyleTabContainer, null,
|
|
1427
|
+
React__default["default"].createElement(core.Tabs, { value: currentTab, onTabChange: (tab) => {
|
|
1428
|
+
setCurrentTab(tab);
|
|
1429
|
+
}, styles: stylesTabs },
|
|
1430
|
+
React__default["default"].createElement(core.Tabs.List, null, activeTabs.map((tab) => {
|
|
1431
|
+
return (React__default["default"].createElement(core.Tabs.Tab, { value: tab.value, key: tab.value }, tab.label));
|
|
1432
|
+
}))))));
|
|
1433
|
+
};
|
|
1434
|
+
|
|
1435
|
+
var TypePopularKeySearch;
|
|
1436
|
+
(function (TypePopularKeySearch) {
|
|
1437
|
+
TypePopularKeySearch["doctor"] = "doctor";
|
|
1438
|
+
TypePopularKeySearch["service"] = "hospital_service";
|
|
1439
|
+
TypePopularKeySearch["hospital"] = "hospital_branch";
|
|
1440
|
+
})(TypePopularKeySearch || (TypePopularKeySearch = {}));
|
|
1441
|
+
|
|
1442
|
+
const ignoreCacarSpecialty = (specialties) => {
|
|
1443
|
+
return specialties.filter((item) => {
|
|
1444
|
+
if (typeof item === 'string') {
|
|
1445
|
+
return item !== 'cacar-api';
|
|
1446
|
+
}
|
|
1447
|
+
return (item === null || item === void 0 ? void 0 : item.id) !== 232;
|
|
1448
|
+
});
|
|
1449
|
+
};
|
|
1450
|
+
function useSearchBarApi({ dispatch, careApiDomain, locale = 'vi-VN', client = '', }) {
|
|
1451
|
+
const fetchCitiesApi = React.useCallback(function fetchCitiesApi(path, params = {}) {
|
|
1452
|
+
const url = `${careApiDomain}${path}`;
|
|
1453
|
+
dispatch({ type: ActionTypes.FetchCitiesStart });
|
|
1454
|
+
return fetch(utils$1.getApiPath(url, params, locale), { method: 'GET' })
|
|
1455
|
+
.then((res) => res.json())
|
|
1456
|
+
.then((data) => {
|
|
1457
|
+
if (data._status !== 1 || !data._data) {
|
|
1458
|
+
console.log('error loading cities', data);
|
|
1459
|
+
return Promise.reject(data);
|
|
1460
|
+
}
|
|
1461
|
+
return data === null || data === void 0 ? void 0 : data._data;
|
|
1462
|
+
})
|
|
1463
|
+
.finally(() => dispatch({ type: ActionTypes.FetchCitiesFinish }));
|
|
1464
|
+
}, [locale]);
|
|
1465
|
+
const fetchCitiesByLocation = React.useCallback(function fetchCitiesByLocation({ coordinates }) {
|
|
1466
|
+
let params = {};
|
|
1467
|
+
const moreParams = {};
|
|
1468
|
+
if (coordinates) {
|
|
1469
|
+
params = {
|
|
1470
|
+
lat: coordinates.lat,
|
|
1471
|
+
lng: coordinates.lng,
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
if (locale === 'ms-MY') {
|
|
1475
|
+
moreParams.noPaging = 1;
|
|
1476
|
+
}
|
|
1477
|
+
const requests = [
|
|
1478
|
+
fetchCitiesApi(paths.PATHS.GET_CITY_BY_IP, Object.assign(Object.assign(Object.assign({}, params), moreParams), { hospitalActive: 1, client: constants.CLIENT_KEY.MSD === client ? '' : client })),
|
|
1479
|
+
];
|
|
1480
|
+
if (locale === 'zh-TW') {
|
|
1481
|
+
requests.push(fetchCitiesApi(paths.PATHS.GET_CITIES_LIST, {
|
|
1482
|
+
noPaging: 1,
|
|
1483
|
+
hospitalActive: 1,
|
|
1484
|
+
client: constants.CLIENT_KEY.MSD === client ? '' : client,
|
|
1485
|
+
}));
|
|
1486
|
+
}
|
|
1487
|
+
else {
|
|
1488
|
+
requests.push(fetchCitiesApi(paths.PATHS.GET_CITIES_LIST, {
|
|
1489
|
+
noPaging: 1,
|
|
1490
|
+
hospitalActive: 1,
|
|
1491
|
+
}));
|
|
1492
|
+
}
|
|
1493
|
+
return Promise.all(requests)
|
|
1494
|
+
.then(([data1, data2]) => {
|
|
1495
|
+
const data = Object.assign({}, data1);
|
|
1496
|
+
if (data2) {
|
|
1497
|
+
const citiesIds = data.cities.map((c) => c.id);
|
|
1498
|
+
data.cities = data.cities.concat(data2.cities.filter((c) => !citiesIds.includes(c.id)));
|
|
1499
|
+
}
|
|
1500
|
+
dispatch({
|
|
1501
|
+
type: ActionTypes.FetchCitiesByGeoIpComplete,
|
|
1502
|
+
payload: data,
|
|
1503
|
+
});
|
|
1504
|
+
})
|
|
1505
|
+
.catch((err) => console.error('error loading cities by location', err));
|
|
1506
|
+
}, [locale, careApiDomain, dispatch]);
|
|
1507
|
+
const fetchCitiesByKeyword = React.useCallback(function fetchCitiesByKeyword(keyword) {
|
|
1508
|
+
return fetchCitiesApi(paths.PATHS.GET_CITIES_LIST, {
|
|
1509
|
+
keyword,
|
|
1510
|
+
client,
|
|
1511
|
+
})
|
|
1512
|
+
.then((data) => {
|
|
1513
|
+
dispatch({
|
|
1514
|
+
type: ActionTypes.FetchCitiesByKeywordComplete,
|
|
1515
|
+
payload: data.cities,
|
|
1516
|
+
});
|
|
1517
|
+
})
|
|
1518
|
+
.catch((err) => console.error('error loading cities by keyword', err));
|
|
1519
|
+
}, [locale, careApiDomain, dispatch]);
|
|
1520
|
+
const fetchSearchResults = React.useCallback(function fetchSearchResults(searchKeywords, state, searchType, clientSlug, cacheResult) {
|
|
1521
|
+
const url = searchType === 'specialty'
|
|
1522
|
+
? `${careApiDomain}${paths.PATHS.GET_SEARCH_SPECIALTY}`
|
|
1523
|
+
: `${careApiDomain}${paths.PATHS.GET_SEARCH_V2}`;
|
|
1524
|
+
dispatch({ type: ActionTypes.FetchSearchResultsStart });
|
|
1525
|
+
const { selectedLocation, geoLocationCoordinates, selectedSpecialty } = state;
|
|
1526
|
+
let cityId = '';
|
|
1527
|
+
if (!selectedLocation) {
|
|
1528
|
+
dispatch({ type: ActionTypes.FetchSearchResultsFinish });
|
|
1529
|
+
return;
|
|
1530
|
+
}
|
|
1531
|
+
if (selectedLocation.id === constants.ID_OPTION_ALL_LOCATION) {
|
|
1532
|
+
cityId = '';
|
|
1533
|
+
}
|
|
1534
|
+
else {
|
|
1535
|
+
cityId = selectedLocation.id;
|
|
1536
|
+
}
|
|
1537
|
+
const lat = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lat) || '';
|
|
1538
|
+
const lng = (geoLocationCoordinates === null || geoLocationCoordinates === void 0 ? void 0 : geoLocationCoordinates.lng) || '';
|
|
1539
|
+
const specialty_id = (selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id) > 0 ? selectedSpecialty === null || selectedSpecialty === void 0 ? void 0 : selectedSpecialty.id : '';
|
|
1540
|
+
const keyword = searchKeywords.trim().length > SEARCH_KEYWORD_MIN_LENGTH[locale]
|
|
1541
|
+
? searchKeywords.trim()
|
|
1542
|
+
: '';
|
|
1543
|
+
return fetch(utils$1.getApiPath(url, Object.assign({ domain: careApiDomain, searchType: searchType || 'global', keyword: keyword, city: cityId === constants.ID_OPTION_CURRENT_LOCATION ? '' : cityId, lat,
|
|
1544
|
+
lng,
|
|
1545
|
+
specialty_id, client_slug: constants.CLIENT_KEY.MSD === clientSlug ? '' : clientSlug, msd: constants.CLIENT_KEY.MSD === client ? 1 : '' }, (searchType === 'doctor' && {
|
|
1546
|
+
skipBooking: 1,
|
|
1547
|
+
})), locale), {
|
|
1548
|
+
method: 'GET',
|
|
1549
|
+
headers: {
|
|
1550
|
+
accept: 'version=2.0.0.0',
|
|
1551
|
+
},
|
|
1552
|
+
})
|
|
1553
|
+
.then((res) => res.json())
|
|
1554
|
+
.then((data) => {
|
|
1555
|
+
if (data._status !== 1 || !data._data) {
|
|
1556
|
+
return Promise.reject(data);
|
|
1557
|
+
}
|
|
1558
|
+
return data === null || data === void 0 ? void 0 : data._data;
|
|
1559
|
+
})
|
|
1560
|
+
.then((results) => {
|
|
1561
|
+
let searchesResult = [];
|
|
1562
|
+
if (searchType !== 'specialty') {
|
|
1563
|
+
if (searchType === 'doctor') {
|
|
1564
|
+
searchesResult = results.searches.map((item) => {
|
|
1565
|
+
return Object.assign(Object.assign({}, item), { specialties: ignoreCacarSpecialty((item === null || item === void 0 ? void 0 : item.specialties) || []) });
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
else {
|
|
1569
|
+
searchesResult = results.searches;
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
if (searchType === 'specialty') {
|
|
1573
|
+
if (keyword) {
|
|
1574
|
+
searchesResult = ignoreCacarSpecialty((results === null || results === void 0 ? void 0 : results.specialties) || []);
|
|
1575
|
+
}
|
|
1576
|
+
else {
|
|
1577
|
+
searchesResult = ignoreCacarSpecialty((results === null || results === void 0 ? void 0 : results.default) || []);
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
dispatch({
|
|
1581
|
+
type: ActionTypes.FetchSearchResultsComplete,
|
|
1582
|
+
payload: {
|
|
1583
|
+
key: searchType,
|
|
1584
|
+
searches: searchesResult || [],
|
|
1585
|
+
},
|
|
1586
|
+
});
|
|
1587
|
+
if (cacheResult) {
|
|
1588
|
+
dispatch({
|
|
1589
|
+
type: ActionTypes.UpdateInitialSearchResults,
|
|
1590
|
+
payload: {
|
|
1591
|
+
key: searchType,
|
|
1592
|
+
searches: searchesResult || [],
|
|
1593
|
+
},
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1596
|
+
})
|
|
1597
|
+
.catch((error) => {
|
|
1598
|
+
console.log('error loading search results', { url, error });
|
|
1599
|
+
})
|
|
1600
|
+
.finally(() => dispatch({ type: ActionTypes.FetchSearchResultsFinish }));
|
|
1601
|
+
}, [locale, careApiDomain, dispatch]);
|
|
1602
|
+
const fetchAllSpecialties = React.useCallback(function fetchSearchSpecialties() {
|
|
1603
|
+
const url = `${careApiDomain}${paths.PATHS.GET_SEARCH_SPECIALTY}`;
|
|
1604
|
+
return fetch(utils$1.getApiPath(url, {
|
|
1605
|
+
domain: careApiDomain,
|
|
1606
|
+
searchType: '',
|
|
1607
|
+
msd: constants.CLIENT_KEY.MSD === client ? 1 : '',
|
|
1608
|
+
}, locale), {
|
|
1609
|
+
method: 'GET',
|
|
1610
|
+
headers: {
|
|
1611
|
+
accept: 'version=2.0.0.0',
|
|
1612
|
+
},
|
|
1613
|
+
})
|
|
1614
|
+
.then((res) => res.json())
|
|
1615
|
+
.then((data) => {
|
|
1616
|
+
if (data._status !== 1 || !data._data) {
|
|
1617
|
+
return Promise.reject(data);
|
|
1618
|
+
}
|
|
1619
|
+
return data === null || data === void 0 ? void 0 : data._data;
|
|
1620
|
+
})
|
|
1621
|
+
.then((results) => {
|
|
1622
|
+
dispatch({
|
|
1623
|
+
type: ActionTypes.FetchAllSpecialties,
|
|
1624
|
+
payload: ignoreCacarSpecialty(results.specialties || []),
|
|
1625
|
+
});
|
|
1626
|
+
})
|
|
1627
|
+
.catch((error) => {
|
|
1628
|
+
console.log('error loading search results', { url, error });
|
|
1629
|
+
});
|
|
1630
|
+
}, [locale, careApiDomain, dispatch]);
|
|
1631
|
+
const fetchPopularKeys = React.useCallback(function fetchPopularKeys(searchType) {
|
|
1632
|
+
const url = `${careApiDomain}${paths.PATHS.GET_SEARCH_POPULAR_KEY}`;
|
|
1633
|
+
return fetch(utils$1.getApiPath(url, {
|
|
1634
|
+
domain: careApiDomain,
|
|
1635
|
+
searchType: TypePopularKeySearch[searchType],
|
|
1636
|
+
sort_by: 'display_order',
|
|
1637
|
+
sort_order: 'asc',
|
|
1638
|
+
}, locale))
|
|
1639
|
+
.then((res) => res.json())
|
|
1640
|
+
.then((data) => {
|
|
1641
|
+
if (data._status !== 1 || !data._data) {
|
|
1642
|
+
return Promise.reject(data);
|
|
1643
|
+
}
|
|
1644
|
+
return data === null || data === void 0 ? void 0 : data._data;
|
|
1645
|
+
})
|
|
1646
|
+
.then((results) => {
|
|
1647
|
+
dispatch({
|
|
1648
|
+
type: ActionTypes.FetchPopularKeys,
|
|
1649
|
+
payload: results.popular_searches || [],
|
|
1650
|
+
});
|
|
1651
|
+
})
|
|
1652
|
+
.catch((error) => {
|
|
1653
|
+
console.log('error loading search results', { url, error });
|
|
1654
|
+
});
|
|
1655
|
+
}, [locale, careApiDomain, dispatch]);
|
|
1656
|
+
return {
|
|
1657
|
+
fetchCitiesByLocation,
|
|
1658
|
+
fetchCitiesByKeyword,
|
|
1659
|
+
fetchSearchResults,
|
|
1660
|
+
fetchAllSpecialties,
|
|
1661
|
+
fetchPopularKeys,
|
|
1662
|
+
};
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
const BookingSearchBarV3 = ({ isMobile, careApiDomain, geoLocationPermission: geoLocationPermissionFromProps, geoLocationCoordinates: geoLocationCoordinatesFromProps, initialSelectedCity: initialSelectedCityFromProps, initialSearchValue = '', initTypeSearch = 'hospital', initSpecialty, careFrontDomain = '/care', isDebug = false,
|
|
1666
|
+
// askForGeolocationPermission = false,
|
|
1667
|
+
gaTrackingSearchBar, gaTrackingLocationSearch, autoCompleteDisabled = false, inputSearchPlaceholder = '', hideTabBookingSearch = [], hideSpecialtySelection = false, hideSpecialtyTab = false, hidePopularSearchKeys = false, clientSlug = '',
|
|
1668
|
+
// isOptionAllLocation = false,
|
|
1669
|
+
// hideResults = [],
|
|
1670
|
+
// isNavResultItem = true,
|
|
1671
|
+
triggerSearchWhenChangeFilter, routerPush, onGeoLocationPermissionChange,
|
|
1672
|
+
// onSearch,
|
|
1673
|
+
onChangeLocation, }) => {
|
|
1674
|
+
var _a;
|
|
1675
|
+
const { locale, t } = index$1.useTranslations();
|
|
1676
|
+
const wrapperRef = React.useRef(null);
|
|
1677
|
+
const searchInputDesktopRef = React.useRef(null);
|
|
1678
|
+
const searchInputMobileRef = React.useRef(null);
|
|
1679
|
+
const inputSearchSpecialtyWrapperRef = React.useRef(null);
|
|
1680
|
+
const [currentTab, setCurrentTab] = React.useState(initTypeSearch);
|
|
1681
|
+
const { geoLocationPermission: geoLocationPermissionFromHook, geoLocationCoordinates: geoLocationCoordinatesFromHook, } = utils$1.useGeolocation();
|
|
1682
|
+
const [state, dispatch] = React.useReducer(reducer, initialState, (s) => (Object.assign(Object.assign({}, s), { isDebug,
|
|
1683
|
+
isMobile, geoLocationPermission: geoLocationPermissionFromProps ||
|
|
1684
|
+
geoLocationPermissionFromHook ||
|
|
1685
|
+
'unset', geoLocationCoordinates: geoLocationCoordinatesFromProps ||
|
|
1686
|
+
geoLocationCoordinatesFromHook ||
|
|
1687
|
+
null, searchKeywords: initialSearchValue, initialSelectedCity: initialSelectedCityFromProps || null, selectedLocation: initialSelectedCityFromProps || s.selectedLocation || null, searchLocationKeywords: (initialSelectedCityFromProps === null || initialSelectedCityFromProps === void 0 ? void 0 : initialSelectedCityFromProps.name) || s.searchLocationKeywords, autoCompleteDisabled,
|
|
1688
|
+
inputSearchPlaceholder,
|
|
1689
|
+
locale })));
|
|
1690
|
+
const { navigateTo, focusedSpecialty,
|
|
1691
|
+
// isLoadingCities,
|
|
1692
|
+
// cities,
|
|
1693
|
+
searchKeywords, geoLocationPermission, selectedLocation,
|
|
1694
|
+
// selectedSpecialty,
|
|
1695
|
+
initialSelectedCity,
|
|
1696
|
+
// defaultCity,
|
|
1697
|
+
searchResults, isLoadingSearchResults,
|
|
1698
|
+
// isMobileModalOpened,
|
|
1699
|
+
// inputSearchPlaceholder,
|
|
1700
|
+
// allSpecialties,
|
|
1701
|
+
} = state;
|
|
1702
|
+
const { fetchCitiesByLocation, fetchCitiesByKeyword, fetchSearchResults, fetchAllSpecialties, fetchPopularKeys, } = useSearchBarApi({
|
|
1703
|
+
dispatch,
|
|
1704
|
+
locale,
|
|
1705
|
+
careApiDomain,
|
|
1706
|
+
client: clientSlug,
|
|
1707
|
+
});
|
|
1708
|
+
const slugs = React.useMemo(() => constants.LOCALIZED_SLUGS[locale], [locale]);
|
|
1709
|
+
const [opened, { close, open }] = hooks.useDisclosure(false);
|
|
1710
|
+
const typeInformation = React.useMemo(() => {
|
|
1711
|
+
return Object.assign({ doctor: {
|
|
1712
|
+
name: t('booking.searchPopup.doctors'),
|
|
1713
|
+
icon: React__default["default"].createElement(DoctorIcon, null),
|
|
1714
|
+
slug: slugs.DOCTOR,
|
|
1715
|
+
}, service: {
|
|
1716
|
+
name: t('booking.searchPopup.services'),
|
|
1717
|
+
icon: React__default["default"].createElement(ServiceIcon, null),
|
|
1718
|
+
slug: slugs.SERVICE,
|
|
1719
|
+
}, hospital: {
|
|
1720
|
+
name: t('booking.searchPopup.hospitals'),
|
|
1721
|
+
icon: React__default["default"].createElement(HospitalIcon, null),
|
|
1722
|
+
slug: slugs.HOSPITAL,
|
|
1723
|
+
} }, (!hideSpecialtyTab && {
|
|
1724
|
+
specialty: {
|
|
1725
|
+
name: t('booking.searchPopup.specialties'),
|
|
1726
|
+
icon: React__default["default"].createElement(SpecialtyIcon, null),
|
|
1727
|
+
slug: slugs.SPECIALTIES,
|
|
1728
|
+
},
|
|
1729
|
+
}));
|
|
1730
|
+
}, [currentTab]);
|
|
1731
|
+
const debouncedFetchCitiesByKeyword = React.useMemo(() => debounce__default["default"](fetchCitiesByKeyword, 400), [fetchCitiesByKeyword]);
|
|
1732
|
+
const debouncedFetchSearchResults = React.useMemo(() => debounce__default["default"](fetchSearchResults, 400), [fetchSearchResults]);
|
|
1733
|
+
// function focusSearchInput() {
|
|
1734
|
+
// if (wrapperRef.current) {
|
|
1735
|
+
// wrapperRef.current
|
|
1736
|
+
// .querySelector<HTMLInputElement>('input[name="search-results"]')
|
|
1737
|
+
// ?.focus()
|
|
1738
|
+
// }
|
|
1739
|
+
// }
|
|
1740
|
+
const onClickSearchByKeyword = React.useCallback(function onClickSearchByKeyword({ locationSlug, specialtyId, } = {}) {
|
|
1741
|
+
var _a;
|
|
1742
|
+
close();
|
|
1743
|
+
let url = '';
|
|
1744
|
+
const { slug: typeSlug } = typeInformation[currentTab];
|
|
1745
|
+
let moreParams = '';
|
|
1746
|
+
const slugClientUrl = constants.MAPPING_CLIENT_WITH_SLUG[locale][clientSlug];
|
|
1747
|
+
const selectedSpecialtyId = specialtyId || ((_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id) || -1;
|
|
1748
|
+
const selectedLocationSlug = locationSlug || (selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.slug) || '';
|
|
1749
|
+
if ((currentTab === 'doctor' || currentTab === 'hospital') &&
|
|
1750
|
+
selectedSpecialtyId > 0) {
|
|
1751
|
+
moreParams = `&specialtyId=${selectedSpecialtyId}`;
|
|
1752
|
+
}
|
|
1753
|
+
if (currentTab === 'specialty') {
|
|
1754
|
+
url = `/${typeSlug}`;
|
|
1755
|
+
}
|
|
1756
|
+
else {
|
|
1757
|
+
url = `/${selectedLocationSlug}/${typeSlug}`;
|
|
1758
|
+
}
|
|
1759
|
+
if (slugClientUrl) {
|
|
1760
|
+
url += `/${slugClientUrl}`;
|
|
1761
|
+
}
|
|
1762
|
+
url += `?q=${searchKeywords}${moreParams}`;
|
|
1763
|
+
if (url) {
|
|
1764
|
+
dispatch({ type: ActionTypes.NavigateTo, payload: url });
|
|
1765
|
+
}
|
|
1766
|
+
}, [
|
|
1767
|
+
clientSlug,
|
|
1768
|
+
close,
|
|
1769
|
+
currentTab,
|
|
1770
|
+
dispatch,
|
|
1771
|
+
locale,
|
|
1772
|
+
searchKeywords,
|
|
1773
|
+
selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.slug,
|
|
1774
|
+
(_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id,
|
|
1775
|
+
typeInformation,
|
|
1776
|
+
]);
|
|
1777
|
+
const handleLocationClick = React.useCallback(function handleLocationClick(city) {
|
|
1778
|
+
triggerSearchWhenChangeFilter &&
|
|
1779
|
+
onClickSearchByKeyword({ locationSlug: city.slug });
|
|
1780
|
+
dispatch({ type: ActionTypes.SelectLocation, payload: city });
|
|
1781
|
+
if (onChangeLocation) {
|
|
1782
|
+
onChangeLocation(city);
|
|
1783
|
+
}
|
|
1784
|
+
}, [
|
|
1785
|
+
dispatch,
|
|
1786
|
+
isMobile,
|
|
1787
|
+
onChangeLocation,
|
|
1788
|
+
onClickSearchByKeyword,
|
|
1789
|
+
triggerSearchWhenChangeFilter,
|
|
1790
|
+
]);
|
|
1791
|
+
useOutsideClick.useOutsideClick(inputSearchSpecialtyWrapperRef, () => {
|
|
1792
|
+
!isMobile &&
|
|
1793
|
+
dispatch({ type: ActionTypes.ClickOutsideInputSearchSpecialty });
|
|
1794
|
+
});
|
|
1795
|
+
React.useEffect(() => {
|
|
1796
|
+
var _a;
|
|
1797
|
+
if (geoLocationPermission !== 'denied' && !initialSelectedCity) {
|
|
1798
|
+
dispatch({
|
|
1799
|
+
type: ActionTypes.SelectLocation,
|
|
1800
|
+
payload: {
|
|
1801
|
+
name: t('booking.searchBar.allLocations'),
|
|
1802
|
+
id: constants.ID_OPTION_ALL_LOCATION,
|
|
1803
|
+
slug: (_a = constants.LOCALIZED_SLUGS[locale]) === null || _a === void 0 ? void 0 : _a.ALL,
|
|
1804
|
+
},
|
|
1805
|
+
});
|
|
1806
|
+
}
|
|
1807
|
+
if (onGeoLocationPermissionChange) {
|
|
1808
|
+
onGeoLocationPermissionChange(geoLocationPermission, state.geoLocationCoordinates);
|
|
1809
|
+
}
|
|
1810
|
+
if (isMobile && geoLocationPermission === 'granted' && selectedLocation) {
|
|
1811
|
+
dispatch({ type: ActionTypes.FocusInputSearch });
|
|
1812
|
+
}
|
|
1813
|
+
fetchCitiesByLocation({ coordinates: state.geoLocationCoordinates });
|
|
1814
|
+
}, [geoLocationPermission]);
|
|
1815
|
+
React.useEffect(() => {
|
|
1816
|
+
var _a;
|
|
1817
|
+
const defaultSpecialty = initSpecialty
|
|
1818
|
+
? initSpecialty
|
|
1819
|
+
: {
|
|
1820
|
+
name: t('booking.searchBar.allSpecialties'),
|
|
1821
|
+
id: -1,
|
|
1822
|
+
thumbnail: '',
|
|
1823
|
+
total_doctor: 0,
|
|
1824
|
+
slug: slugs.SPECIALTIES,
|
|
1825
|
+
};
|
|
1826
|
+
if (initSpecialty) {
|
|
1827
|
+
if (((_a = state.selectedSpecialty) === null || _a === void 0 ? void 0 : _a.id) !== initSpecialty.id) {
|
|
1828
|
+
dispatch({
|
|
1829
|
+
type: ActionTypes.SelectSpecialty,
|
|
1830
|
+
payload: initSpecialty,
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
return;
|
|
1834
|
+
}
|
|
1835
|
+
if (!state.selectedSpecialty ||
|
|
1836
|
+
state.selectedSpecialty.id !== defaultSpecialty.id) {
|
|
1837
|
+
dispatch({
|
|
1838
|
+
type: ActionTypes.SelectSpecialty,
|
|
1839
|
+
payload: defaultSpecialty,
|
|
1840
|
+
});
|
|
1841
|
+
}
|
|
1842
|
+
}, [initSpecialty, slugs.SPECIALTIES, t]);
|
|
1843
|
+
React.useEffect(() => {
|
|
1844
|
+
fetchAllSpecialties();
|
|
1845
|
+
}, []);
|
|
1846
|
+
React.useEffect(() => {
|
|
1847
|
+
fetchPopularKeys(currentTab);
|
|
1848
|
+
}, [currentTab]);
|
|
1849
|
+
React.useEffect(() => {
|
|
1850
|
+
if (navigateTo) {
|
|
1851
|
+
if (routerPush) {
|
|
1852
|
+
routerPush(navigateTo);
|
|
1853
|
+
}
|
|
1854
|
+
else {
|
|
1855
|
+
window.location.href = `${careFrontDomain}${navigateTo}`;
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
}, [navigateTo]);
|
|
1859
|
+
React.useEffect(() => {
|
|
1860
|
+
fetchSearchResults(state.searchKeywords, state, currentTab, clientSlug, true);
|
|
1861
|
+
}, [currentTab]);
|
|
1862
|
+
React.useEffect(() => {
|
|
1863
|
+
if (opened && isMobile) {
|
|
1864
|
+
const timer = setTimeout(() => {
|
|
1865
|
+
var _a;
|
|
1866
|
+
(_a = searchInputMobileRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
1867
|
+
}, 150);
|
|
1868
|
+
return () => clearTimeout(timer);
|
|
1869
|
+
}
|
|
1870
|
+
}, [opened, isMobile]);
|
|
1871
|
+
const searchInputsProps = {
|
|
1872
|
+
type: currentTab,
|
|
1873
|
+
isMobile: isMobile,
|
|
1874
|
+
state: state,
|
|
1875
|
+
dispatch: dispatch,
|
|
1876
|
+
debouncedFetchSearchResults: debouncedFetchSearchResults,
|
|
1877
|
+
initalSearchValue: initialSearchValue,
|
|
1878
|
+
// focusSearchInput: focusSearchInput,
|
|
1879
|
+
onEnterSearch: onClickSearchByKeyword,
|
|
1880
|
+
typeInformation: typeInformation,
|
|
1881
|
+
trackingAttributes: gaTrackingSearchBar,
|
|
1882
|
+
isLoading: isLoadingSearchResults,
|
|
1883
|
+
hideSpecialtySelection: hideSpecialtySelection || hideSpecialtyTab,
|
|
1884
|
+
clientSlug: clientSlug,
|
|
1885
|
+
triggerSearchWhenChangeFilter,
|
|
1886
|
+
onChangeSpecialty: (specialty) => triggerSearchWhenChangeFilter &&
|
|
1887
|
+
onClickSearchByKeyword({ specialtyId: specialty.id }),
|
|
1888
|
+
};
|
|
1889
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
1890
|
+
React__default["default"].createElement(StyledSearchBarWrapper, { ref: wrapperRef },
|
|
1891
|
+
React__default["default"].createElement(TabSearch, { currentTab: currentTab, setCurrentTab: setCurrentTab, isMobile: isMobile, hideTabBookingSearch: hideTabBookingSearch, hideSpecialtyTab: hideSpecialtyTab }),
|
|
1892
|
+
React__default["default"].createElement(StyleWrapperContainer, { className: "booking-search-container" },
|
|
1893
|
+
React__default["default"].createElement(StyleSearchInputContainer, null,
|
|
1894
|
+
React__default["default"].createElement(StyleSearchContent, { className: "booking-search-content" },
|
|
1895
|
+
React__default["default"].createElement("div", { ref: inputSearchSpecialtyWrapperRef },
|
|
1896
|
+
React__default["default"].createElement(core.Flex, { gap: "12px", align: "center", className: "flex-search-input" },
|
|
1897
|
+
React__default["default"].createElement(SearchInputs, Object.assign({}, searchInputsProps, { ref: searchInputDesktopRef, onFocusInput: () => isMobile && open() })),
|
|
1898
|
+
currentTab !== 'specialty' && (React__default["default"].createElement(SearchLocation, { state: state, isMobile: isMobile, dispatch: dispatch, debouncedFetchCitiesByKeyword: debouncedFetchCitiesByKeyword, selectedLocation: selectedLocation, onLocationClick: handleLocationClick, trackingAttributes: gaTrackingLocationSearch })),
|
|
1899
|
+
!isMobile && (React__default["default"].createElement(index$4.Button, { size: "lg", variant: "primary", onClick: () => onClickSearchByKeyword(), styles: {
|
|
1900
|
+
root: {
|
|
1901
|
+
height: '48px',
|
|
1902
|
+
minWidth: '120px',
|
|
1903
|
+
borderRadius: '12px',
|
|
1904
|
+
},
|
|
1905
|
+
} }, t('booking.searchBar.searchButton')))),
|
|
1906
|
+
!hidePopularSearchKeys &&
|
|
1907
|
+
currentTab !== 'specialty' &&
|
|
1908
|
+
state.popularKeys.length > 0 && (React__default["default"].createElement(SearchTag, { type: currentTab, state: state, typeInformation: typeInformation, dispatch: dispatch })),
|
|
1909
|
+
currentTab === 'specialty' &&
|
|
1910
|
+
focusedSpecialty === 'search' && (React__default["default"].createElement(SearchResultSpecialties, { state: state, isMobile: isMobile, dispatch: dispatch, specialties: (searchResults === null || searchResults === void 0 ? void 0 : searchResults.specialty) || [], isLoading: isLoadingSearchResults }))))))),
|
|
1911
|
+
isMobile && (React__default["default"].createElement(ModalSearchResult, { keepMounted: true, opened: opened, onClose: close, closeModal: close, searchInputEle: React__default["default"].createElement(core.Flex, { align: 'center', gap: 8 },
|
|
1912
|
+
React__default["default"].createElement(SearchInputs, Object.assign({}, searchInputsProps, { onlyShowSearchBox: true, ref: searchInputMobileRef })),
|
|
1913
|
+
React__default["default"].createElement(index$4.Button, { variant: "primary", leftIcon: React__default["default"].createElement(core$1.Search, { size: 20, color: '#fff' }), onClick: () => onClickSearchByKeyword(), styles: {
|
|
1914
|
+
root: {
|
|
1915
|
+
borderRadius: '12px',
|
|
1916
|
+
},
|
|
1917
|
+
} })) },
|
|
1918
|
+
React__default["default"].createElement(core.Box, { sx: {
|
|
1919
|
+
marginLeft: -16,
|
|
1920
|
+
marginRight: -16,
|
|
1921
|
+
} },
|
|
1922
|
+
React__default["default"].createElement(SearchResultContent, { type: currentTab, state: state, dispatch: dispatch, isLoading: isLoadingSearchResults, typeInformation: typeInformation, clientSlug: clientSlug }))))));
|
|
1923
|
+
};
|
|
1924
|
+
|
|
1925
|
+
const StyledTextDivider = styled__default["default"].div `
|
|
1926
|
+
background-color: var(--neutral50);
|
|
1927
|
+
padding: 12px 0;
|
|
1928
|
+
box-shadow: inset 0px 1px 0px #e4e8ec;
|
|
1929
|
+
|
|
1930
|
+
> * {
|
|
1931
|
+
display: grid;
|
|
1932
|
+
grid-template-columns: 32px 1fr;
|
|
1933
|
+
align-content: center;
|
|
1934
|
+
|
|
1935
|
+
p {
|
|
1936
|
+
font-weight: 600;
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
.icon-wrapper {
|
|
1941
|
+
display: flex;
|
|
1942
|
+
align-items: center;
|
|
1943
|
+
}
|
|
1944
|
+
`;
|
|
1945
|
+
const TextDivider = ({ children, icon, className, style }) => (React__default["default"].createElement(StyledTextDivider, { style: style, className: className },
|
|
1946
|
+
React__default["default"].createElement(index.Container, null,
|
|
1947
|
+
React__default["default"].createElement("div", { className: "icon-wrapper" }, icon),
|
|
1948
|
+
React__default["default"].createElement(index$2.Text, { size: "c1", color: "var(--neutral800)" }, children))));
|
|
1949
|
+
|
|
1950
|
+
exports.BookingSearchBarV3 = BookingSearchBarV3;
|
|
1951
|
+
exports.TextDivider = TextDivider;
|