(self.webpackChunkhhgHealthCareV1=self.webpackChunkhhgHealthCareV1||[]).push([[3285],{50470:function(e,t,n){"use strict";n.d(t,{z:function(){return r}});var i=n(2445),o=n(73884),a=n(6442),s=n(40959),r=function(e){var t=e.token,n=void 0===t?s.n_:t,r=(0,o.useState)(!1),c=r[0],l=r[1],d=(0,a.A)().formatMessage;return(0,o.useEffect)((function(){if(!c){var e=document.querySelector("#zalo-script");e&&e.remove();var t=document.createElement("script");t.setAttribute("id","zalo-script"),t.src="https://sp.zalo.me/plugins/sdk.js",t.async=!0,document.head.appendChild(t),document.body.classList.add("has-zalo-widget"),l(!0)}return function(){c&&document.body.classList.remove("has-zalo-widget")}}),[c]),(0,i.Y)(i.FK,{children:(0,i.Y)("div",{className:"zalo-chat-widget","data-oaid":n,"data-welcome-message":d({id:"common.zaloConfig.message",defaultMessage:"r\u1ea5t vui \u0111\u01b0\u1ee3c h\u1ed7 tr\u1ee3 b\u1ea1n"}),"data-autopopup":"0","data-width":"","data-height":""})})}},8239:function(e,t,n){"use strict";n.d(t,{PM:function(){return s},bp:function(){return a}});var i=["MidBanner1","MidBanner2","EndBanner"],o=["TopBanner","MidBanner1","MidBanner2","EndBanner"],a=function(e,t){var n=Math.floor(e/4);return t?o[n]:i[n]},s=function(e,t,n){return!!a(e,n)&&((e+1)%4===0||t<4&&e+1===t)}},14585:function(e,t,n){"use strict";n.d(t,{e:function(){return T}});var i=n(2445),o=n(73884),a=n(72091),s=n(84091),r=n(3873),c=n(95780),l=n(27516),d=n(88491),u=n(73419),h=n(6442),p=n(76672),g=n(51524),v=function(e){var t=e.hospitalInfo,n=e.gps,a=e.onHospitalClick,v=e.onMainActionClick,f=e.onPhoneClick,m=e.orderedListIndex,y=(0,h.A)().formatMessage,S=(0,d.d)().isMobile,C=(0,o.useRef)(null),_=(0,o.useState)(!1),b=_[0],T=_[1],M=(0,o.useState)(!1),A=M[0],L=M[1],I=(0,u.$)().locale,E={OPEN:y({id:"hospital.status.open",defaultMessage:"Open"}),OPEN_SOON:y({id:"hospital.status.openSoon",defaultMessage:"Opening Soon"}),CLOSED:y({id:"hospital.status.closed",defaultMessage:"Closed"}),CLOSE_SOON:y({id:"hospital.status.closingSoon",defaultMessage:"Closing Soon"})},w=(0,o.useMemo)((function(){return(0,s.Pw)(t.workingTimes)}),[t.workingTimes]),k=b?{id:"hospitalCard.seeMore",defaultMessage:"See More"}:{id:"hospitalCard.seeLess",defaultMessage:"See Less"},O=(0,s.eP)(t),P="https://".concat(l.y[I]).concat(O);return(0,o.useEffect)((function(){setTimeout((function(){var e,t=null===(e=C.current)||void 0===e?void 0:e.clientHeight;t&&L(S?Math.ceil(t/22)>2:Math.ceil(t/24)>2),T(!0)}),0)}),[]),(0,i.Y)(p.I,{type:"hospital",hospitalInfo:t,gps:n,phone:"zh-TW"===I?t.phone:"",onHospitalClick:a,onMainActionClick:function(e){null===v||void 0===v||v(e)},onPhoneClick:f,orderedListIndex:m,hospitalStatus:{value:w,label:E[w]},hospitalURL:(0,s.eP)(t),children:t.about&&(S?(0,i.Y)(g.ns,{onClick:function(){return T(!b)},"data-is-collapsed":b,children:(0,i.Y)("p",{ref:C,children:(0,i.Y)(r.T,{size:"p3",className:"content-description",children:t.about})})}):(0,i.Y)(g.d4,{children:(0,i.Y)(g.xC,{children:(0,i.FD)(g.ns,{"data-is-collapsed":b,children:[(0,i.Y)("p",{ref:C,children:(0,i.Y)(r.T,{size:"p4",className:"content-description",children:t.about})}),A&&(0,i.Y)(c.B,{size:"sm",color:"ghost",className:"see-more-button",onClick:function(){return T(!b)},"data-padding-none":!0,dataEventCategory:"Care",dataEventAction:"See More Click",dataEventLabel:P,children:y(k)})]})})}))})},f=n(10297),m=n(36259),y=n(79151),S=n(20607),C=n(70931),_=n(8239),b=n(40959),T=function(e){var t=e.results,n=e.gps,r=e.isMobile,c=e.showAd,l=(0,f.useRouter)(),d=l.locale,u=void 0===d?"vi-VN":d,h=(0,o.useContext)(m.B).state.isLoggedIn,p=function(e,t){var n="view"===t?e.websiteUrl:e.bookingUrl,i="zh-TW"===u?n:"".concat((0,s.eP)(e));window.sessionStorage.setItem("returnUrl",JSON.stringify(window.location.href)),i&&l.push(i)},g=function(e){"zh-TW"===u||h?l.push("tel:".concat(e.phone)):(window.sessionStorage.setItem("returnUrl",JSON.stringify(window.location.href)),b.dXu?a.u.getState().triggerLogin({source:"care_phone"}):l.push((0,s.GC)(window.location.href,"care_phone")))},T=(0,C.oq)({locale:u,isMobile:r,contentAdTag:"Search"});return(0,i.Y)(y.Uy,{children:null===t||void 0===t?void 0:t.map((function(e,a){return(0,i.FD)(o.Fragment,{children:[(0,i.Y)(v,{hospitalInfo:e,onHospitalClick:function(e){return p(e,"view")},onMainActionClick:function(e){return p(e,"book")},onPhoneClick:g,gps:n,orderedListIndex:a}),c&&(0,_.PM)(a,t.length,r)&&(0,i.Y)(S.z,{adUnitPath:T,size:r?[[300,250],[320,100]]:[728,90],divId:r?"ad-search-hospital-mobile-"+a:"ad-search-hospital-desktop-"+a,pos:[(0,_.bp)(a,r)],style:{marginBottom:24},adDefaultSize:r?[320,100]:[728,90]},String(r))]},"hospital-".concat(a))}))})}},79151:function(e,t,n){"use strict";n.d(t,{E2:function(){return m},G6:function(){return p},Uy:function(){return h},k6:function(){return v},pv:function(){return f},tu:function(){return g}});var i=n(24537),o=n(26115),a=n(27317);function s(){var e=(0,i.A)(["\n width: 100%;\n & > * {\n margin-bottom: 16px;\n }\n"]);return s=function(){return e},e}function r(){var e=(0,i.A)(["\n align-self: flex-start;\n margin: 22px 0;\n"]);return r=function(){return e},e}function c(){var e=(0,i.A)(["\n "," {\n padding: 0;\n }\n .booking-search-tab {\n background: rgba(255, 255, 255, 0.4);\n ","\n }\n\n .booking-search-container {\n background-color: ",";\n }\n\n ","\n"]);return c=function(){return e},e}function l(){var e=(0,i.A)(["\n margin-top: -57px;\n "," {\n margin-top: -48px;\n }\n\n .booking-search-content {\n border-radius: 0 0 16px 16px;\n }\n"]);return l=function(){return e},e}function d(){var e=(0,i.A)(["\n background: ",";\n height: 80px;\n\n "," {\n height: 72px;\n }\n\n &.has-client-sponsored {\n height: 112px;\n &[data-gsk='true'] {\n height: 130px;\n }\n\n "," {\n height: 96px;\n &[data-gsk='true'] {\n height: 120px;\n }\n }\n\n .container-client-sponsored {\n padding-top: 16px;\n\n "," {\n padding-top: 14px;\n }\n }\n }\n"]);return d=function(){return e},e}function u(){var e=(0,i.A)(["\n width: 100%;\n align-self: flex-start;\n\n ","\n"]);return u=function(){return e},e}var h=a.Ay.div.withConfig({componentId:"sc-480dca99-0"})(s()),p=a.Ay.div.withConfig({componentId:"sc-480dca99-1"})(r()),g=a.Ay.div.withConfig({componentId:"sc-480dca99-2"})(c(),o.M.mbDown,(function(e){return e.isNewVersion&&"\n border:unset;\n margin-top: 80px;\n\n ".concat(o.M.mbDown," {\n margin-top: 50px;\n }\n ")}),(function(e){return e.theme.colors.white}),(function(e){return e.isNewVersion&&"\n &.container-search .booking-search-content {\n border-radius: 16px;\n\n ".concat(o.M.mbDown," {\n border-radius: 0;\n }\n }\n ")})),v=a.Ay.div.withConfig({componentId:"sc-480dca99-3"})(l(),o.M.tdDown),f=a.Ay.div.withConfig({componentId:"sc-480dca99-4"})(d(),(function(e){return e.theme.colors.blue50}),o.M.tdDown,o.M.tdDown,o.M.tdDown),m=a.Ay.div.withConfig({componentId:"sc-480dca99-5"})(u(),(function(e){return e.$loading&&"\n display: none;\n "}))},7367:function(e,t,n){"use strict";n.d(t,{C9:function(){return o},jz:function(){return a},rl:function(){return s}});var i=n(21995),o=[i.L.PhilippinesEnglish,i.L.PhilippinesTagalog],a=[i.L.Vietnam,i.L.Indonesia,i.L.Malaysia,i.L.PhilippinesEnglish,i.L.PhilippinesTagalog,i.L.Thailand],s=[i.L.PhilippinesEnglish,i.L.PhilippinesTagalog]},23285:function(e,t,n){"use strict";n.r(t),n.d(t,{NoResult:function(){return ge},__N_SSP:function(){return pe},dataGskSeo:function(){return me},default:function(){return ye}});var i=n(858),o=n(53513),a=n(63538),s=n(83776),r=n(2445),c=n(7367),l=n(73884),d=n(3873),u=n(28519),h=n(26115),p=n(39378),g=n(47761),v=n(95780),f=n(81942),m=n(66472),y=n(27516),S=n(21995),C=n(74029),_=n(3365);function b(e){var t,n,i,o=e.url,a=e.seoTitle,s=e.seoDesc,r=e.searchType,c=e.searchData,l=e.footerInfo,d=e.cityInfo,u=e.specialty,h=e.f,p="".concat(_.V2).concat(o),g="".concat(p,"#collectionpage"),v=[],f="";"DOCTOR"===r?(f=h({id:"page.title.doctor"}),v=null===(i=c.doctors)||void 0===i?void 0:i.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,url:"".concat(_.wd).concat(_.VH.DOCTOR,"/").concat(e.slug,"-").concat(e.id),image:e.avatar}}))):"HOSPITAL"===r?(f=h({id:"page.title.hospital"}),v=null===(n=c.hospitals)||void 0===n?void 0:n.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,url:"".concat(_.wd).concat(_.VH.HOSPITAL,"/").concat(e.slug,"-").concat(e.id),image:e.logo}}))):"SERVICE"===r&&(f=h({id:"doctorPage.service"}),v=null===(t=c.services)||void 0===t?void 0:t.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,url:"".concat(_.wd).concat(_.VH.HOSPITAL,"/").concat(e.slug,"-").concat(e.id)}})));var m={"@type":"CollectionPage","@id":g,url:p,name:a,description:s,about:f,isPartOf:{"@id":_.vq},inLanguage:_.Np};return d&&(m.contentLocation=d.name),u&&(m.specialty={"@type":"MedicalSpecialty",name:u.name}),(0,_.oU)([m,{"@type":"ItemList",mainEntityOfPage:{"@id":g},itemListElement:v}],l)}var T=n(59850),M=n(84091),A=n(32485),L=n.n(A),I=n(19475),E=n(79151),w=n(72091),k=n(54238),O=n(10297),P=n(36259),D=n(20607),Y=n(70931),R=n(8239),N=n(40959),F=function(e){var t=e.results,n=e.gps,i=e.noResult,o=e.showAd,a=e.isMobile,s=(0,O.useRouter)(),c=(0,l.useContext)(P.B).state.isLoggedIn,d=function(e){var t=(0,M.eP)(e);s.push(t)},u=function(e){c?s.push("tel:".concat(e.phone)):(window.sessionStorage.setItem("returnUrl",JSON.stringify(window.location.href)),N.dXu?w.u.getState().triggerLogin({source:"care_phone"}):s.push((0,M.GC)(window.location.href,"care_phone")))},h=function(e){s.push((0,M.pN)(e))},p=s.locale,g=(0,Y.oq)({locale:p,isMobile:a,contentAdTag:"Search"});return(0,r.FD)(E.Uy,{children:[null===t||void 0===t?void 0:t.map((function(e,i){return(0,r.FD)(l.Fragment,{children:[(0,r.Y)(k.a,{serviceInfo:e,onHospitalClick:d,onMainActionClick:h,onPhoneClick:u,gps:n,orderedListIndex:i},"service-".concat(e.id)),o&&(0,R.PM)(i,t.length,a)&&(0,r.Y)(D.z,{adUnitPath:g,size:a?[[300,250],[320,100]]:[728,90],divId:a?"ad-search-service-mobile-"+i:"ad-search-service-desktop-"+i,pos:[(0,R.bp)(i,a)],style:{marginBottom:24},adDefaultSize:a?[320,100]:[728,90]},String(a))]},e.id)})),(!t||0===t.length)&&i]})},x=n(73419),z=n(6442),H=n(52785),B=n(89238),G=function(e){var t=e.results,n=e.isMobile,i=e.isMobileOrTablet,o=e.gps,a=e.showAd,s=(0,O.useRouter)().locale,c=(0,Y.oq)({locale:s,isMobile:n,contentAdTag:"Search"});return(0,r.Y)(r.FK,{children:t.map((function(e,s){return(0,r.FD)(l.Fragment,{children:[(0,r.Y)(B.w,{doctorInfo:e,hospitalInfo:e.hospital||{},isMobile:i,orderedListIndex:s,gps:o},"doctor-".concat(e.id)),a&&(0,R.PM)(s,t.length,n)&&(0,r.Y)(D.z,{adUnitPath:c,size:n?[[300,250],[320,100]]:[728,90],divId:n?"ad-search-doctor-mobile-"+s:"ad-search-doctor-desktop-"+s,pos:[(0,R.bp)(s,n)],style:{marginBottom:24},adDefaultSize:n?[320,100]:[728,90]},String(n))]},"doctor-".concat(e.id))}))})},K=n(14585),V=function(e){var t=e.type,n=e.gps,i=e.isMobile,o=e.isMobileOrTablet,a=e.results;return"hospital"===t?(0,r.Y)(K.e,{isMobile:i,gps:n,results:a,showAd:!0}):"doctor"===t?(0,r.Y)(G,{isMobileOrTablet:o,isMobile:i,results:a,gps:n,showAd:!0}):null},U=function(e){var t=e.type,n=void 0===t?"hospital":t,i=e.results,o=e.isMobile,a=e.isMobileOrTablet,s=e.gps,d=e.noResult,h=e.searchKeywords,p=e.isClientGSK,g=void 0!==p&&p,v=(0,x.$)(),f=(0,l.useContext)(P.B).ability,m=v.query,S=v.locale,C=v.asPath,_=(0,z.A)().formatMessage,b=f.can(H.aG.read,H.OV.bookingBlock),T=(0,l.useMemo)((function(){if(g||b)return[{name:_({id:"searchPage.tab.hospital",defaultMessage:"Hospital"}),dataEventCategory:"Care",dataEventAction:"Hospital Tab Click",dataEventLabel:"https://".concat(y.y[S]).concat(N.JpE).concat(C)}];var e=[{name:_({id:"searchPage.tab.hospital",defaultMessage:"Hospital"}),dataEventCategory:"Care",dataEventAction:"Hospital Tab Click",dataEventLabel:"https://".concat(y.y[S]).concat(N.JpE).concat(C)}];return c.rl.includes(S)||e.unshift({name:_({id:"searchPage.tab.doctor",defaultMessage:"Doctor"}),dataEventCategory:"Care",dataEventAction:"Doctor Tab Click",dataEventLabel:"https://".concat(y.y[S]).concat(N.JpE).concat(C)}),e}),[g,b,S]),M=(0,l.useMemo)((function(){return g?0:"hospital"===n?1:0}),[n,g]);return(0,r.FD)(r.FK,{children:[N.hgd.includes(S)&&(0,r.Y)(E.G6,{children:(0,r.Y)(u.T,{tabContent:T,initialTab:M,onChange:function(e){var t,n,i,o="/"+m.slug[0],a=[];g?o+="/".concat(null===(t=N.y1A[S])||void 0===t?void 0:t.HOSPITAL,"/"):o+="/".concat(0===e?null===(n=N.y1A[S])||void 0===n?void 0:n.DOCTOR:null===(i=N.y1A[S])||void 0===i?void 0:i.HOSPITAL,"/");m.slug[2]&&(o+=m.slug[2]+"/"),h&&a.push("q=".concat(h)),"string"===typeof m.specialtyId&&m.specialtyId&&a.push("specialtyId=".concat(m.specialtyId)),v.push("".concat(o).concat(a.length?"?".concat(a.join("&")):""))}})}),i&&i.length?(0,r.Y)(V,{type:n,gps:s,isMobile:o,isMobileOrTablet:a,results:i}):d]})},W=n(88491),q=n(22699),J=n(50470),j=n(90332),$=n(95380),X=n(24537);function Q(){var e=(0,X.A)(["\n display: flex;\n gap: 16px;\n color: ",";\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 22px;\n letter-spacing: -0.2px;\n white-space: nowrap;\n align-items: center;\n"]);return Q=function(){return e},e}var Z=n(27317).Ay.div.withConfig({componentId:"sc-d4bf07f5-0"})(Q(),(function(e){return e.theme.colors.gray600})),ee=function(e){var t=e.logo,n=e.className,i=(0,z.A)().formatMessage;return(0,r.FD)(Z,{className:n,children:[i({id:"admin.sponsoredBy.title",defaultMessage:"Sponsored by"}),t&&t]})},te=n(78859),ne=n(57920),ie=n(6224),oe=n.n(ie),ae=n(81539),se=n(91266),re=n(61817),ce=n.n(re),le=function(e){var t=e.isMobile,n=e.elements,i=void 0===n?2:n;return(0,r.Y)(r.FK,{children:(0,ae.A)(Array(i)).map((function(e,n){return(0,r.Y)("div",{className:L()(ce().mDoctorInfo),style:{width:"100%",marginTop:0===n?22:0},children:(0,r.FD)("div",{className:L()(ce().doctorHeader),children:[(0,r.Y)("div",{className:L()(ce().Image),children:(0,r.Y)(se.A,{width:72,height:72,style:{marginRight:16,marginBottom:16}})}),(0,r.FD)("div",{className:L()(ce().doctorInfoHeader),style:{width:"100%"},children:[(0,r.Y)(se.A,{style:{width:"100%",height:"20px"}}),(0,r.Y)(se.A,{style:{width:"100%",height:"20px"}}),(0,r.Y)(se.A,{style:{width:"100%",height:"20px"}}),(0,r.Y)(se.A,{style:{width:"100%",height:"20px"}}),!t&&(0,r.FD)("div",{className:L()(ce().pricing,ce().isDesktop),children:[(0,r.Y)(se.A,{width:16,height:16,style:{marginRight:8}}),(0,r.Y)(se.A,{width:300,height:16})]})]}),!t&&(0,r.FD)("div",{style:{minWidth:"200px"},children:[(0,r.Y)(se.A,{height:20,style:{marginBottom:8,width:"100%"}}),(0,r.Y)(se.A,{height:40,style:{marginBottom:8,width:"100%"}})]})]})},n)}))})},de=n(28171),ue=n(81e3),he=n(86711),pe=!0,ge=function(e){var t=e.noResultMessage,n=e.className;return(0,r.FD)(I.mc,{className:L()(oe().noResults,n),children:[(0,r.Y)(he.A,{}),(0,r.Y)("div",{children:(0,r.Y)(d.T,{size:"base",children:t.current})})]})},ve={HOSPITAL:"searchPage.resultsFound.hospitals",DOCTOR:"searchPage.resultsFound.doctors",SERVICE:"searchPage.resultsFound.services"},fe={HOSPITAL:"searchPage.resultsFound.hospitals.allOrCurrent",DOCTOR:"searchPage.resultsFound.doctors.allOrCurrent",SERVICE:"searchPage.resultsFound.services.allOrCurrent"},me={imageSeoGsk:"https://cdn-healthcare.hellohealthgroup.com/2024/06/ID.jpg",titleSeo:"Temukan Vaksin Rotavirus Terdekat dari Lokasi Anda",descSeo:"Segera buat janji konsultasi dengan Dokter Spesialis Anak sekarang!"},ye=function(e){var t,n,_,A,w,k,O,P,R,H,B,G,K,V,X=e.query,Q=e.searchResultSSR,Z=e.canonicalUrl,ie=e.specialties,ae=e.cities,se=e.searchAPISlugArr,re=e.pageType,ce=e.searchType,he=e.cityFromSlug,pe=e.typeSearchFromSlug,ye=e.searchKeywords,Se=e.footerInfo,Ce=e.searchSpecialty,_e=e.clientSlug,be=e.isHasDoctorList,Te=e.isHasServiceList,Me=(0,W.d)(),Ae=Me.isMobile,Le=Me.isMobileOrTablet,Ie=(0,x.$)(),Ee=Ie.query,we=Ie.locale,ke=void 0===we?"vi-VN":we,Oe=Ie.asPath,Pe=Ee.slug,De=Array.isArray(Pe)?Pe[0]:Pe,Ye=(0,z.A)().formatMessage,Re={hospital:{},serviceOrDoctor:{},yishiFilter:{}},Ne=(0,l.useState)(!1),Fe=Ne[0],xe=Ne[1],ze=(0,l.useState)(X),He=ze[0],Be=ze[1],Ge=(0,l.useState)(!1),Ke=Ge[0],Ve=Ge[1],Ue=(0,l.useState)("")[0],We=(0,l.useState)(Ee.page&&parseInt(Ee.page)||1),qe=We[0],Je=We[1],je=(0,l.useState)({lat:"",lng:""}),$e=je[0],Xe=je[1],Qe=(0,l.useState)(Re),Ze=Qe[0],et=Qe[1],tt=(0,l.useState)({cityId:-1,keyword:""}),nt=tt[0],it=tt[1],ot=(0,l.useState)(!1),at=ot[0],st=ot[1],rt=(0,l.useRef)(""),ct=null===ae||void 0===ae?void 0:ae.find((function(e){return e.slug===De})),lt=N.u3o.GSK===_e,dt="vi-VN"===ke&&"ALL"===re,ut=(null===(t=Ee.slug)||void 0===t?void 0:t[1])===(null===(n=N.y1A[ke])||void 0===n?void 0:n.DOCTOR)&&"ms-MY"===ke,ht=(0,l.useMemo)((function(){var e;return Pe[2]&&Pe[1]===(null===(e=N.y1A[ke])||void 0===e?void 0:e.SERVICE)&&ie.find((function(e){return e.slug===Pe[2]}))}),[Pe[2],ie]),pt=(0,l.useMemo)((function(){if(null===$e||void 0===$e?void 0:$e.lat){var e=$e.lat,t=$e.lng;return"&latitude=".concat(e,"&longitude=").concat(t)}return""}),[$e.lat,$e.lng]),gt=se.join("/"),vt=(0,l.useMemo)((function(){return(0,ne.IF)(function(){return"zh-TW"===ke?Ze.yishiFilter:Ee.slug[1]===(null===(e=N.y1A[ke])||void 0===e?void 0:e.HOSPITAL)?Ze.hospital:Ze.serviceOrDoctor;var e}(),Ee,ke)}),[JSON.stringify(Ze),Ee]),ft=function(e){var t;"zh-TW"===ke?et((0,a.A)((0,o.A)({},Ze),{yishiFilter:e})):Ee.slug[1]===(null===(t=N.y1A[ke])||void 0===t?void 0:t.HOSPITAL)?et((0,a.A)((0,o.A)({},Ze),{hospital:e})):et((0,a.A)((0,o.A)({},Ze),{serviceOrDoctor:e}))},mt=(0,q.A)({url:(0,M.er)(T.R.GET_SEARCH_NO_PARAMS+"&skip_booking=1")+He,method:"GET",trigger:He,condition:He!==X||"CURRENT"===re,options:{headers:{accept:"application/json, text/plain, version=2.0.0"}}}),yt=mt.loading,St=void 0!==yt&&yt,Ct=mt.response,_t=void 0===Ct?{}:Ct,bt=(0,l.useMemo)((function(){var e,t;return((null===_t||void 0===_t||null===(e=_t._data)||void 0===e?void 0:e.districts)||(null===Q||void 0===Q||null===(t=Q._data)||void 0===t?void 0:t.districts)||[]).map(C.YT)}),[_t,Q]),Tt=(0,l.useState)([]),Mt=Tt[0],At=Tt[1];(0,l.useEffect)((function(){var e,t,n,i;("DOCTOR"===ce&&!(null===(e=Ze.serviceOrDoctor)||void 0===e||null===(t=e.district_id)||void 0===t?void 0:t.length)||"HOSPITAL"===ce&&!(null===(n=Ze.hospital)||void 0===n||null===(i=n.district_id)||void 0===i?void 0:i.length))&&JSON.stringify(Mt)!==JSON.stringify(bt)&&At(bt)}),[bt,JSON.stringify(Ze),ce]);var Lt,It,Et,wt,kt=Ee.slug[1]===(null===(_=N.y1A[ke])||void 0===_?void 0:_.DOCTOR)&&![S.L.PhilippinesEnglish,S.L.PhilippinesTagalog].includes(ke)||Ee.slug[1]===(null===(A=N.y1A[ke])||void 0===A?void 0:A.SERVICE),Ot=St,Pt=null===_t||void 0===_t||null===(w=_t._data)||void 0===w?void 0:w.pagination,Dt=null===Q||void 0===Q||null===(k=Q._data)||void 0===k?void 0:k.pagination,Yt=null!==(Lt=null===Pt||void 0===Pt?void 0:Pt.total_items)&&void 0!==Lt?Lt:null===Dt||void 0===Dt?void 0:Dt.total_items,Rt=null!==(It=null===Pt||void 0===Pt?void 0:Pt.last)&&void 0!==It?It:null===Dt||void 0===Dt?void 0:Dt.last,Nt=null!==(Et=null===_t||void 0===_t||null===(O=_t._data)||void 0===O?void 0:O.searches)&&void 0!==Et?Et:null===Q||void 0===Q||null===(P=Q._data)||void 0===P?void 0:P.searches;switch(Ee.slug[1]){case null===(R=N.y1A[ke])||void 0===R?void 0:R.DOCTOR:wt="doctor";break;case null===(H=N.y1A[ke])||void 0===H?void 0:H.SERVICE:wt="service";break;case null===(B=N.y1A[ke])||void 0===B?void 0:B.HOSPITAL:wt="hospital"}var Ft,xt,zt=(0,Y.oq)({locale:ke,isMobile:Ae,contentAdTag:"Search"}),Ht=(0,r.FD)(r.FK,{children:[Yt>0?(0,r.Y)(r.FK,{children:"zh-TW"===ke?(0,r.Y)(te.ly,{onCloseClick:function(){return Ve(!1)},isMobile:Le,numberOfResults:Yt,isLoading:Ot,onFilterChange:ft,filters:Ze.yishiFilter,city:he,gps:$e,isLoadingDistricts:at,setIsLoadingDistricts:st},"yishi-filter"):(0,r.FD)(r.FK,{children:[kt&&(0,r.Y)(te.W2,{searchType:wt,onCloseClick:function(){return Ve(!1)},isMobile:Le,numberOfResults:Yt,isLoading:Ot,onFilterChange:ft,labelPrice:{min:Ye({id:"filter.minPrice"}),max:Ye({id:"filter.maxPrice"})},rangePrice:{min:0,max:N.sOt[ke],step:N.sOt[ke]/100},currencyUnit:m.yT[ke],filters:Ze.serviceOrDoctor,districts:Mt},"search-filter"),Ee.slug[1]===(null===(G=N.y1A[ke])||void 0===G?void 0:G.HOSPITAL)&&(0,r.Y)(te.HX,{onCloseClick:function(){return Ve(!1)},isMobile:Le,numberOfResults:Yt,isLoading:Ot,onFilterChange:ft,gps:$e,filters:Ze.hospital,isShowedDistanceFilter:!1,districts:Mt},"hospital-filter")]})}):(0,r.Y)(r.FK,{}),!Ae&&(0,r.Y)(D.z,{adUnitPath:zt,size:[[300,250],[300,600]],divId:"ad-search-side-desktop",pos:["TopBanner"],adDefaultSize:[300,250],style:{marginTop:40}})]}),Bt=function(){var e=[];switch(Ot&&(rt.current=""!==Ue?Ye({id:"searchPage.noResultFound",defaultMessage:"No result"},{keyword:Ue}):Ye({id:"searchPage.noResults",defaultMessage:"No result"}),e.push((0,r.FD)(l.Fragment,{children:[("DOCTOR"===ce||"HOSPITAL"===ce)&&(N.LuG.includes(ke)||N.hgd.includes(ke))&&(0,r.Y)(E.G6,{children:(0,r.Y)(u.T,{initialTab:"DOCTOR"===ce?0:1,tabContent:[{name:Ye({id:"searchPage.tab.doctor",defaultMessage:"Doctor"})},{name:Ye({id:"searchPage.tab.hospital",defaultMessage:"Hospital"})}]})}),(0,r.Y)(le,{isMobile:Le,elements:10})]},"search-loading"))),ce){case"HOSPITAL":var t;return e.push((0,r.Y)(E.E2,{$loading:Ot,children:(0,r.Y)(U,{type:"hospital",results:null!==(t=null===Nt||void 0===Nt?void 0:Nt.map(C.em))&&void 0!==t?t:[],isMobileOrTablet:Le,isMobile:Ae,gps:$e,noResult:(0,r.Y)(ge,{noResultMessage:rt}),searchKeywords:ye,isClientGSK:lt})},"result-hospital")),e;case"DOCTOR":var n;return e.push((0,r.Y)(E.E2,{$loading:Ot,children:(0,r.Y)(U,{type:"doctor",results:null!==(n=null===Nt||void 0===Nt?void 0:Nt.map(C.pW))&&void 0!==n?n:[],isMobile:Ae,isMobileOrTablet:Le,gps:$e,noResult:(0,r.Y)(ge,{noResultMessage:rt}),searchKeywords:ye,isClientGSK:lt})},"result-doctor")),e;case"SERVICE":var i;return e.push((0,r.Y)(E.E2,{$loading:Ot,children:(0,r.Y)(F,{results:null!==(i=null===Nt||void 0===Nt?void 0:Nt.map(C.JG))&&void 0!==i?i:[],gps:$e,noResult:(0,r.Y)(ge,{noResultMessage:rt}),showAd:!0,isMobile:Ae})},"result-service")),e;default:return e.push((0,r.Y)(ge,{noResultMessage:rt},"no-result")),e}}(),Gt="";Ee.slug[1]===(null===(K=N.y1A[ke])||void 0===K?void 0:K.SERVICE)&&(null===(V=Ee.slug[2])||void 0===V?void 0:V.length)&&(Gt=null!==(xt=null===Nt||void 0===Nt||null===(Ft=Nt[0])||void 0===Ft?void 0:Ft.name)&&void 0!==xt?xt:"");var Kt="ALL"===re||"CURRENT"===re?ce&&fe[ce]:ce&&ve[ce];(0,l.useEffect)((function(){var e=-1!==nt.cityId?nt.cityId:null===he||void 0===he?void 0:he.id,t=e?"&city_id=".concat(e):"",n="&page=".concat(qe).concat(t).concat(pt).concat(vt);"string"===typeof Ee.q&&Ee.q.trim().length>2&&(ye=encodeURI(Ee.q),n+="&keyword=".concat(ye)),"string"===typeof Ee.specialtyId&&Ee.specialtyId&&(n+="&specialty_id=".concat(Ee.specialtyId)),n+="zh-TW"===ke?"&type=".concat("HOSPITAL"===ce?"hospital":"doctor"):"&slug=".concat(gt),1===Number(null===Ee||void 0===Ee?void 0:Ee.course)&&(n+="&course=1"),_e===N.u3o.GSK&&(n+="&client_slug=".concat(_e)),_e===N.u3o.MSD&&(n+="&msd=1"),Be(n+="&show_districts=1")}),[vt,pt,gt,Ee,qe,JSON.stringify(nt)]),(0,l.useEffect)((function(){var e=function(){var e=(0,i.A)((function(){var e,t,n;return(0,s.__generator)(this,(function(i){switch(i.label){case 0:return[4,(0,M.px)((0,M.er)(T.R.GET_CITY,{ids:nt.cityId}),"GET")];case 1:return t=i.sent(),(null===(n=null===t||void 0===t||null===(e=t._data)||void 0===e?void 0:e.cities)||void 0===n?void 0:n.length)>0&&Ie.push("/".concat(n[0].slug,"/").concat(Ee.slug[1],"/").concat(nt.keyword?"?q=".concat(nt.keyword):"")),[2]}}))}));return function(){return e.apply(this,arguments)}}();"zh-TW"===ke&&e()}),[nt.cityId]),(0,l.useEffect)((function(){if(qe&&Number(qe)>0){var e=(0,h.f)(Oe,qe);Ie.push(e)}}),[qe]),(0,l.useEffect)((function(){(!Nt||Nt.length<1)&&Rt>0&&Je(1)}),[null===Nt||void 0===Nt?void 0:Nt.length]),(0,l.useEffect)((function(){document.documentElement.classList.toggle("noscroll",Ke)}),[Ke]),(0,l.useEffect)((function(){(0,M.DW)(Ie.query)}),[$e.lat,$e.lng]),(0,l.useEffect)((function(){var e=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;Le||e||"CURRENT"===re&&"permissions"in navigator&&navigator.permissions.query({name:"geolocation"}).then((function(e){"prompt"===e.state&&xe(!0),e.addEventListener("change",(function(){xe("prompt"===e.state)}))}))}),[re,Le]),(0,l.useEffect)((function(){return et(Re)}),[De,nt.cityId]);var Vt=null===ie||void 0===ie?void 0:ie.find((function(e){var t;return e.slug===(null===(t=Ee.slug)||void 0===t?void 0:t[2])})),Ut=(0,l.useMemo)((function(){return ye?decodeURIComponent(ye):""}),[ye,ie]),Wt=(0,l.useMemo)((function(){var e="page.title.search",t="home.seoDescription";if(ct)switch(ce){case"DOCTOR":e="pageType.doctorSpecialty.title",t="pageType.doctorSpecialty.description";break;case"HOSPITAL":e="pageType.hospitalSpecialty.title",t="pageType.hospitalSpecialty.description";break;case"SERVICE":Gt&&(e="pageType.service.title",t="pageType.service.description")}return lt&&"id-ID"===ke?{titleSeo:me.titleSeo,descSeo:me.descSeo}:{titleSeo:Ye({id:e},{specialty:(null===Vt||void 0===Vt?void 0:Vt.name)||"",city:(null===ct||void 0===ct?void 0:ct.name)||"",serviceName:Gt}),descSeo:Ye({id:t},{specialty:(null===Vt||void 0===Vt?void 0:Vt.name)||"",city:(null===ct||void 0===ct?void 0:ct.name)||"",serviceName:Gt})}}),[ct,ce,Gt,lt]),qt=Wt.titleSeo,Jt=Wt.descSeo,jt=(0,l.useMemo)((function(){return"doctor"===wt?Ye({id:"searchComponent.search.placeholder.doctor",defaultMessage:"Search by doctor name"}):"hospital"===wt?Ye({id:"searchComponent.search.placeholder.hospital",defaultMessage:"Search by hospital name"}):""}),[wt]),$t=(0,l.useMemo)((function(){if(c.C9.includes(ke))return["service","specialty"];if(_e===N.u3o.GSK)return["doctor","service","specialty"];if(_e===N.u3o.MSD)return["service","specialty"];var e=[];return be||e.push("doctor"),Te||e.push("service"),e}),[_e,ke,be,Te]),Xt=(0,l.useMemo)((function(){return _e===N.u3o.GSK||_e===N.u3o.MSD}),[_e]),Qt="CURRENT"!==re&&Q?b({url:Z,seoTitle:qt,seoDesc:Jt,searchType:ce,footerInfo:Se,searchData:{doctors:"DOCTOR"===ce?null===Q||void 0===Q?void 0:Q._data.searches:[],hospitals:"HOSPITAL"===ce?null===Q||void 0===Q?void 0:Q._data.searches:[],services:"SERVICE"===ce?null===Q||void 0===Q?void 0:Q._data.searches:[]},cityInfo:he||void 0,specialty:Vt,f:Ye}):void 0;return(0,r.FD)(r.FK,{children:[Fe&&(0,r.Y)(j.eX,{onCloseClick:function(){return xe(!1)},showCloseButton:!1}),(0,r.Y)(de.K,{title:qt,description:Jt,image:lt&&"id-ID"===ke?me.imageSeoGsk:N.ElQ[ke].HOMEPAGE_IMAGE,SEOData:{isIndexable:!!Rt,hasNoAmp:!0,canonicalUrl:null===Z||void 0===Z?void 0:Z.toLowerCase()},schemaOrg:Qt,isMobile:Le,footerInfo:Se,children:(0,r.FD)("div",{className:oe().pSearchPage,children:[!ut&&(0,r.Y)(E.pv,{"data-gsk":lt,className:lt?"has-client-sponsored":"",children:lt&&(0,r.Y)(I.mc,{className:"container-client-sponsored",children:(0,r.Y)(ee,{logo:(0,r.Y)("img",{loading:"lazy",src:"/care/images/LogoGSK.png",alt:"GSK",style:{height:50}})})})}),(0,r.Y)(E.tu,{isNewVersion:ut,className:"container-search p-[0px]",children:(0,r.Y)(E.k6,{children:ut?(0,r.Y)(p.B,{isMobile:Le,careApiDomain:"https://health-care.hellohealthgroup.com/",routerPush:Ie.push,initialSelectedCity:he,initialSearchValue:Ut,askForGeolocationPermission:!0,initTypeSearch:lt?"hospital":pe||void 0,initSpecialty:Ce,onGeoLocationPermissionChange:function(e,t){t&&Xe(t)},gaTrackingSearchBar:{dataEventCategory:"Care",dataEventAction:"Search Click",dataEventLabel:"https://".concat(y.y[ke]).concat(N.JpE).concat(Oe)},gaTrackingLocationSearch:{dataEventCategory:"Care",dataEventAction:"Change Location Click",dataEventLabel:"https://".concat(y.y[ke]).concat(N.JpE).concat(Oe)},onSearch:void 0,inputSearchPlaceholder:void 0,onChangeLocation:void 0,hidePopularSearchKeys:Xt,hideSpecialtySelection:lt,hideTabBookingSearch:["doctor","hospital","service","specialty"],clientSlug:_e,triggerSearchWhenChangeFilter:!0}):(0,r.Y)(g.n,{isMobile:Le,careApiDomain:"https://health-care.hellohealthgroup.com/",routerPush:Ie.push,initialSelectedCity:he,initialSearchValue:Ut,askForGeolocationPermission:!0,initTypeSearch:lt?"hospital":pe||void 0,initSpecialty:Ce,onGeoLocationPermissionChange:function(e,t){t&&Xe(t)},gaTrackingSearchBar:{dataEventCategory:"Care",dataEventAction:"Search Click",dataEventLabel:"https://".concat(y.y[ke]).concat(N.JpE).concat(Oe)},gaTrackingLocationSearch:{dataEventCategory:"Care",dataEventAction:"Change Location Click",dataEventLabel:"https://".concat(y.y[ke]).concat(N.JpE).concat(Oe)},autoCompleteDisabled:"zh-TW"===ke,onSearch:"zh-TW"===ke?function(e){st(!0),it(e);var t="string"===typeof Ee.slug?Ee.slug:Ee.slug.join("/");Ie.push("/".concat(t,"/").concat(e.keyword?"?q=".concat(e.keyword):""))}:void 0,inputSearchPlaceholder:"zh-TW"===ke?jt:void 0,onChangeLocation:"zh-TW"===ke?function(e){st(!0),it((0,a.A)((0,o.A)({},nt),{cityId:e.id}))}:void 0,hidePopularSearchKeys:Xt,hideSpecialtySelection:lt,hideTabBookingSearch:$t,clientSlug:_e,triggerSearchWhenChangeFilter:!0})})}),(0,r.FD)(I.mc,{children:["DOCTOR"===ce&&ke===S.L.Malaysia&&(0,r.Y)("p",{className:"text-[18px] md:text-[22px] text-gray800 font-bold leading-[26px] md:leading-8 mt-6",children:Ye({id:"searchPage.tab.doctorTitle",defaultMessage:"Book a Licensed Doctor for Weight Loss (GLP-1 Medication) Teleconsultation"})}),(0,r.FD)("div",{className:oe().resultsContainer,children:[(0,r.FD)("div",{className:oe().doctors,children:[(0,r.FD)("div",{className:oe().filter,children:[(0,r.FD)("div",{className:oe().filterWithNotice,children:[!("DOCTOR"===ce&&ke===S.L.Malaysia)&&(0,r.Y)("h1",{className:L()(oe().totalResults),children:Ye({id:Kt||"searchPage.resultsFound",defaultMessage:"{number} results for you"},{number:Yt||0,cityName:(null===ct||void 0===ct?void 0:ct.name)||"",serviceName:" ".concat(Gt," "),specialtyName:ht?" ".concat(ht.name," "):""})}),Le&&kt&&(0,r.Y)(v.B,{size:"md",color:"ghost",icon:(0,r.Y)(ue.A,{}),className:oe().filterIcon,"data-event-category":"Care","data-event-action":"Filter Click","data-event-label":"https://".concat(y.y[ke]).concat(N.JpE).concat(Oe),onClick:function(){Ve(!0)},children:(0,r.Y)(d.T,{size:"base",type:"regular",children:Ye({id:"searchPage.filter",defaultMessage:"Filter"})})})]}),Bt]}),Yt>0&&Rt>1&&(0,r.Y)(f.P,{className:oe().pagination,pagesAmount:Rt,currentPage:qe,onClick:function(e){return e.preventDefault()},onChange:function(e){window.scrollTo({top:0,left:0,behavior:"smooth"}),setTimeout((function(){Je(e)}),200)},href:N.kUY?Z:window.location.href}),"zh-TW"===ke&&(0,r.Y)(d.T,{size:"sm",className:"mt-[8px]",children:Ye({id:"searchResults.messageBox"})})]}),!Le&&(0,r.Y)("div",{className:oe().filterRight,children:Ht})]})]})]})}),dt&&(0,r.Y)(J.z,{token:N.n_},N.n_),(0,r.Y)($.A,{adUnitPath:zt,isMobile:Ae}),(0,r.Y)(r.FK,{children:Le&&Ke&&Ht})]})}},6224:function(e){e.exports={pSearchPage:"search_pSearchPage__Dk6vU",resultsContainer:"search_resultsContainer__nmEsF",doctors:"search_doctors__OIPrK",filterRight:"search_filterRight__WtUmC",filter:"search_filter__Gdo4q",totalResults:"search_totalResults__P9EqZ",pagination:"search_pagination__NKBx9",noResults:"search_noResults__EhP8q",filterIcon:"search_filterIcon__27Mmv",filterWithNotice:"search_filterWithNotice__rdSKr",searchBar:"search_searchBar__vcimF"}},61817:function(e){e.exports={mDoctorInfo:"searchLoading_mDoctorInfo__nJLpg",Image:"searchLoading_Image__uRwdS",doctorHeader:"searchLoading_doctorHeader__IQQZj",hospital:"searchLoading_hospital__ue_En",isDesktop:"searchLoading_isDesktop__KL4PA",tags:"searchLoading_tags__iurOG",tag:"searchLoading_tag__NJoxa",Divider:"searchLoading_Divider__rXPyQ",Location:"searchLoading_Location__7mi5w",directions:"searchLoading_directions__ZFVK_",pricing:"searchLoading_pricing__BGcxe",cta:"searchLoading_cta___wVai",appointmentcta:"searchLoading_appointmentcta__1pIMG",call:"searchLoading_call__Edo_6",isMobile:"searchLoading_isMobile___J63M",ctaDesktop:"searchLoading_ctaDesktop__lNWdC",ctaButton:"searchLoading_ctaButton__ekj5_",phoneButton:"searchLoading_phoneButton__joVc_",HospitalInfo:"searchLoading_HospitalInfo__TwZou",doctorInfoHeader:"searchLoading_doctorInfoHeader__FcjyN",doctorTag:"searchLoading_doctorTag__EzrIj"}}}]);