"use strict";(self.webpackChunkhhgHealthCareV1=self.webpackChunkhhgHealthCareV1||[]).push([[4209],{94209:function(e,t,i){i.d(t,{x:function(){return xt},K:function(){return bi}});var n,a,l=i(53513),o=i(63538),r=i(53455),s=i(40568),d=i(81539),c=i(2445),u=i(73884),p=i(87365),h=i(53611),g=i(30813),v=i(98771),m=i(21995),f=i(48085),b=i(51387),y=i(40279),x=i(74029),_=i(48894),w=i(13306),Y=i(34767),A=i(32485),M=i.n(A),k=i(92743),C=i(84251),N=i(28414),D=i(88491),F=i(6442);function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t ul {\n padding-left: 20px;\n }\n\n p:not(:last-child) {\n margin-bottom: 15px;\n }\n"]);return ge=function(){return e},e}function ve(){var e=(0,le.A)(["\n ","\n"]);return ve=function(){return e},e}function me(){var e=(0,le.A)(["\n .title {\n font-size: 0.9375rem;\n line-height: 1.25rem;\n font-weight: 500;\n }\n"]);return me=function(){return e},e}var fe=(0,oe.AH)(ge(),(function(e){return e.theme.colors.gray700})),be=((0,oe.Ay)(N.A).withConfig({componentId:"sc-2c4f2e51-0"})(ve(),fe),oe.Ay.div.withConfig({componentId:"sc-2c4f2e51-1"})(me()));var ye,xe,_e=function(e){var t=e.data,i=(0,F.A)().formatMessage,n=(0,D.d)().isMobile,a=t.preparation,l=t.detail,o=t.product_note,r=[{id:"screenerPage.detail.aboutDetail",defaultMessage:"About the Service",htmlContent:[t.about,l].filter(Boolean).join("")},{id:"screenerPage.detail.preparation",defaultMessage:"Preparation",htmlContent:a},{id:"screenerPage.detail.serviceNotes",defaultMessage:"Service note",htmlContent:o}];return(0,c.Y)(be,{className:"px-4 pb-4 md:px-6",children:r.filter((function(e){return!!e.htmlContent})).map((function(e){return(0,c.FD)("div",{className:"border-b border-b-neutral100 last:border-b-0 border-solid first:pt-0 py-5 space-y-4",children:[(0,c.Y)(v.T,{size:n?"title2":"title1",fw:500,color:"gray1000",as:"h3",children:i({id:e.id,defaultMessage:e.defaultMessage})}),(0,c.Y)(ae.U,{className:"md:!text-[15px] md:!leading-6",htmlContent:e.htmlContent})]},e.id)}))})},we=i(28519),Ye=i(73827),Ae=i(84091),Me=function(e){var t=e.benefits,i=(0,D.d)().isMobile;return(0,c.Y)("div",{className:"flex flex-col gap-2",children:null===t||void 0===t?void 0:t.map((function(e){return(0,c.FD)("div",{className:"flex gap-2",children:[(0,c.Y)(E,{className:"text-green600 flex-shrink-0 mt-1 w-5 h-5",width:20,height:20}),(0,c.Y)(v.T,{size:i?"p3":"p2",fw:400,color:"gray700",children:e})]},e)}))})},ke=i(28840),Ce=i(49353),Ne=i(45926),De=i(77557),Fe=i(47511),Se=i(78461),Te=i(52651),Ee=i(38971),He=i(40959);!function(e){e.MOMO="MOMO",e.CITI="CITI"}(ye||(ye={}));xe={},(0,Ee.A)(xe,ye.MOMO,"".concat(He.JpE,"/images/momo.png")),(0,Ee.A)(xe,ye.CITI,"".concat(He.JpE,"/images/citi.png")),"".concat(He.JpE,"/images/momo.png"),"".concat(He.JpE,"/images/citi.png");var Oe=function(e){return{id:e.label,title:e.value,description:e.label}},Be=i(11851),Re=(0,Be.A)("div",{target:"e17y3xki0"})("display:flex;align-items:center;gap:",(0,f.D)(2),";div{gap:",(0,f.D)(0),";svg{width:",(function(e){var t=e.width;return(0,f.D)(t||12)}),";height:",(function(e){var t=e.height;return(0,f.D)(t||12)}),";}}"),Pe=(0,Be.A)(we.m,{target:"e17y3xki1"})("& .summary-description{line-height:",(0,f.D)(20),";font-size:",(0,f.D)(13),";}"),Le=i(92230),Ie=i(61367),ze=i(95204),qe=i(19546);var Ve,je,Ke=function(e){var t,i,n=e.data,a=e.trackerMap,r=e.buttonUi,s=e.buttonUiScrollRef,p=e.isCarouselParallax,h=void 0!==p&&p,g=e.showPaymentHighlight,m=void 0!==g&&g,f=e.showO2OQuantityStepper,y=void 0!==f&&f,_=(0,D.d)().isMobile,w=(0,Fe.J3)(),Y=w.bookingQuantity,A=w.setBookingQuantity,k=n.id,C=n.name,N=n.short_name,S=n.description,T=n.banner,E=n.logo,H=n.hospital,O=n.service_type,B=n.price,R=n.price_unit,P=n.price_discount,L=n.percent_discount,z=n.quantity_supported,q=n.max_product_quantity,V=n.cost_unit,j=n.review,K=n.image_carousel,U=void 0===K?[]:K,G=(0,u.useMemo)((function(){var e=E;return _&&T&&(e=T),[e].concat((0,d.A)(U||[]))}),[_]),Q=(0,x.DH)(n),J=(0,x.P3)(n),$=Boolean(z),W=q||100,Z=$?Math.min(Math.max(Y||1,1),W):1,ee=(0,Se.p)({isEnable:G.length>1}),ae=ee.isOpen,le=ee.initialSlide,oe=ee.closeModal,re=ee.openModalWithSlide,se=ee.handleOpenChange,de=(0,F.A)().formatMessage,ce=(0,Te.p)({offeringId:n.offering_id,hospital:n.organization,price:n.price,type:n.service_type,hospitalBranchIds:null===(t=n.hospital_branch_lists)||void 0===t?void 0:t.map((function(e){return e.id}))}),ue=ce.allVouchers,pe=ce.handleCopyVoucher,he=ce.loading,ge=ce.referralTitle,ve=j||{},me=ve.avg_rating,fe=ve.rating_count,be=(0,X.$)(),ye=be.locale,xe=be.asPath,_e=(0,ie.Kb)(xe),Ee=E||(null===H||void 0===H?void 0:H.logo)||"",Be=E?(null===H||void 0===H?void 0:H.logo)||"":void 0,Ve=(0,u.useMemo)((function(){return(0,c.Y)(c.FK,{children:me&&fe&&(0,c.FD)(Re,{children:[me.toFixed(1)," ",(0,c.Y)(we.v,{value:me,readOnly:!0})]})})}),[me,fe]),je=(0,u.useMemo)((function(){var e,t=(0,x.P3)(n)||(0,x.Bp)(n)?n.success_rate:[],i=(0,Ae.xc)(B,de,"+"),a=[{id:"price",title:"~".concat((0,Ae.nd)(de,i,R)),description:de({id:"hospitalService.detail.priceRange",defaultMessage:"Price range"})}];if(t.length){var l=t.shift();l&&a.push(Oe(l))}(me&&fe&&a.push({id:"rating",title:_?(0,c.FD)("div",{className:"flex items-center gap-1",children:[(0,c.Y)(qe.A,{}),(0,c.Y)("span",{children:me})]}):(0,c.Y)("div",{className:"flex items-center gap-1",children:Ve}),description:(0,c.FD)("div",{className:"flex gap-1 underline md:no-underline",children:[fe," ",de({id:"booking.search.tab.review",defaultMessage:"Reviews"})]})}),t.length)&&(e=a).push.apply(e,(0,d.A)(t.map(Oe)));return a}),[me,fe,_,B,R,de,Ve]),Ke=(0,u.useMemo)((function(){return 2===je.length&&_||!_&&je.length<=3?{layout:"horizontal",align:"start"}:{layout:"vertical",align:"start"}}),[je,_]),Ue={id:k,name:(0,c.Y)(c.FK,{children:(0,c.Y)(v.T,{size:"h3",fw:600,color:"gray1000",children:N||C})}),description:S,banner:_?T:void 0,logo:E,altText:"".concat(N||C||""," - ").concat(He.ElQ[ye].SITE_NAME_FORMATTED)};return(0,c.FD)(we.G,{isMobile:_,isCarouselParallax:h,generalInfo:(0,o.A)((0,l.A)({},Ue),{middleContent:Q&&me&&fe&&(0,c.FD)("div",{className:"flex items-center gap-1",children:[(0,c.Y)(Re,{width:_?16:20,height:_?16:20,children:(0,c.Y)(we.v,{value:me||0,readOnly:!0})}),(0,c.FD)(v.T,{size:_?"p3":"p2",fw:400,color:_?"gray700":"gray1000",children:[fe||0," ",de({id:"booking.search.tab.review",defaultMessage:"Reviews"})]})]})}),backupSrc:"".concat(He.JpE,"/images/").concat(J?"topServices.png":"home-find-doctors.png"),contentClassName:"space-y-4",bannerProps:{className:"md:!object-contain",width:_?void 0:336},imagesSelect:G.length>0?void 0:(0,c.Y)(De.C9,{backgroundImage:Ee,logoImage:Be,alt:"".concat(N||C||""," - ").concat(He.ElQ[ye].SITE_NAME_FORMATTED)}),imageCarousel:G,onCarouselImageClick:re,children:[!Q&&(0,c.Y)(Pe,{infoItems:je,layout:Ke.layout,align:Ke.align}),Q&&Array.isArray(n.highlighted_benefits)&&n.highlighted_benefits.length>0&&(0,c.Y)(Me,{benefits:n.highlighted_benefits}),he?(0,c.Y)(Le.S,{withControls:!_,height:68,children:Array.from({length:3}).map((function(e,t){return(0,c.Y)(b.E,{w:308,h:68,radius:8,bg:ne.w.colors.neutral100},"skeleton-voucher-".concat(t))}))}):ue.length>0&&(0,c.Y)(Le.S,{withControls:!_,height:68,children:ue.map((function(e){var t=e.id,i=e.logo,r=e.name,s=e.description,d=e.voucherCode,u=e.type,p=e.brand,h=u===ze.O7.VOUCHER?"".concat(r," - ").concat(s):ge(e),g=u===ze.O7.REFERRAL,v=g?(0,te.yz)((0,o.A)((0,l.A)({},a.selectReferralVoucherDetail),{"data-event-label":_e}),n.id):(0,o.A)((0,l.A)({},a.selectVoucher),{"data-event-label":r||t});return(0,c.Y)(Ne.s,{image:ze.uY[p]||i||x.__,title:h,description:g?void 0:s,onClick:function(){return d&&pe(d)},dataTracking:v,className:M()("max-w-[243px] h-[61.7px] md:h-[64px]",{"!cursor-default":g})},t)}))}),(0,c.FD)("div",{className:"flex flex-col gap-4","data-section":"hospital-price-desktop-wrapper",children:[y&&$&&(0,c.Y)(Ce.Q2,{value:Z,max:W,onChange:A,footer:de({id:"vaccination.detail.quantityMaxDoses",defaultMessage:"Max {max} doses"},{max:W})}),(0,c.Y)(Ie.n,{className:"py-1 md:py-3",price:B||0,priceDiscount:P||0,percentDiscount:L,priceUnit:R,quantity:Z,textUnit:(0,x.DH)(n)&&1===Z?de({id:"screenerPage.detail.perTime",defaultMessage:"per time"}):(0,x.DH)(n)?void 0:V,showSlash:!(0,x.DH)(n),showFrom:!1,showFromDiscount:!1}),(0,c.Y)("div",{"data-section":"HospitalBranchInfoCard_Desktop",children:(0,c.Y)(ke.A,{totalBranches:(null===(i=n.hospital_branch_lists)||void 0===i?void 0:i.length)||0,organization:n.organization})}),(0,c.Y)("div",{ref:s,"data-section":"ButtonUi_section",children:r})]}),m&&(0,c.FD)(c.FK,{children:[(0,c.Y)(Ye.c,{color:ne.w.colors.neutral100}),(0,c.Y)(I.A,{})]}),(0,c.Y)(we.M,{generalInfo:(0,l.A)({},Ue),isMobile:_,isOpen:ae,backupSrc:"".concat(He.JpE,"/images/").concat(O===He.Hxq.IVF?"topServices.png":"home-find-doctors.png"),onClose:oe,onOpenChange:se,initialSlide:le,imageCarousel:G,title:de({id:"detailPage.title.productGallery",defaultMessage:"Product Gallery"})})]})},Ue=(Ve={},(0,Ee.A)(Ve,m.L.Vietnam,{subscribeLink:ie.$x,app:"Zalo"}),(0,Ee.A)(Ve,m.L.Malaysia,{subscribeLink:ie._s,app:"WhatsApp"}),(0,Ee.A)(Ve,m.L.Indonesia,{subscribeLink:ie.ye,app:"WhatsApp"}),(0,Ee.A)(Ve,m.L.PhilippinesEnglish,{subscribeLink:"",app:"WhatsApp"}),(0,Ee.A)(Ve,m.L.Taiwan,{subscribeLink:"",app:"WhatsApp"}),function(e){var t=e.image,i=e.education,n=e.expertise_credentials,a=e.field,l=e.id,o=e.name,r=e.other_highlights,s=e.positions,d=e.title,c=e.year_of_experience,u=(0,F.A)().formatMessage;return{id:(null===l||void 0===l?void 0:l.toString())||"",name:[o,d].filter(Boolean).join(", "),specialty:a,experience:"".concat(c," ").concat(u({id:"hospitalService.detail.yearExperience",defaultMessage:"Yrs Exp"})),profileImage:t,clinics:s||[],educations:i,expertise:n,otherHighlights:r}}),Ge=i(76308),Qe=i(42382),Je=i(57421),$e=i(12914),We=i(83545),Ze=function(e){var t=e.certifications;if(!t)return null;var i=(0,D.d)().isMobile,n=i?p.D:Le.S;return(0,c.Y)("div",{children:t.length>3?(0,c.Y)(n,{withControls:!i,className:"pl-4 pb-4 md:pb-6 md:pl-6",draggable:!1,dragFree:!1,children:t.map((function(e){return(0,c.Y)(we.t,{className:"w-[188px] h-full min-h-[246px] md:w-full",title:e.title,description:e.description,image:e.image||x.__},e.title)}))}):(0,c.Y)(c.FK,{children:(0,c.Y)("div",{className:"flex gap-4 px-4 pb-4 md:px-6 md:pb-6",children:t.map((function(e){return(0,c.Y)(we.t,{className:"h-full min-h-[246px] w-full",title:e.title,description:e.description,image:e.image||x.__},e.title)}))})})})},Xe=function(e){return(0,We.B)(Ze,e)},et=i(55544),tt=i(3328),it=i(25899),nt=i(27372),at=i(53100),lt=i(36259),ot=i(26115),rt=(0,Be.A)(tt.a.Root,{target:"e11ty3hs0"})("z-index:",He.Mue.modal,";position:relative;.mantine-Modal-inner{",ot.M.mbUp,"{align-items:center;}}.mantine-Paper-root{",ot.M.mbUp,"{max-height:",(0,f.D)(680),";border-radius:1rem;}&::-webkit-scrollbar{width:6px;}&::-webkit-scrollbar-thumb{background:",ne.w.colors.gray200,";border-radius:3px;}&::-webkit-scrollbar-thumb:hover{background:",ne.w.colors.gray300,";border-radius:3px;}max-height:100dvh;.flex-item-doctor-info{gap:",(0,f.D)(24),";}}.mantine-Modal-header{padding:0;width:100%;}.mantine-Modal-body{padding:0;}");function st(){return st=Object.assign?Object.assign.bind():function(e){for(var t=1;tt.clientHeight)};t();var i=new ResizeObserver(t);return i.observe(e.current),window.addEventListener("resize",t),function(){window.removeEventListener("resize",t),i.disconnect()}}}),[e]),i}(l),r=(0,u.useContext)(lt.B).state.isMobileSsr,s=(0,at.l)().isMobile,d=(0,nt.E)(r,s),p=d?"div":tt.a.Header;return(0,c.FD)(rt,{opened:i,onClose:n,fullScreen:d,size:d?void 0:480,transitionProps:{transition:"fade",duration:200},children:[(0,c.Y)(tt.a.Overlay,{}),(0,c.FD)(tt.a.Content,{children:[(0,c.Y)(p,{children:(0,c.Y)("div",{className:" w-full p-[18px] bg-blue50 flex-shrink-0 md:bg-white md:h-14 md:py-4 md:px-6 md:flex md:justify-between",children:d?(0,c.Y)(it.M,{onClick:n,variant:"transparent","aria-label":"Close modal",children:(0,c.Y)(dt,{})}):(0,c.FD)("div",{className:"flex items-center justify-between h-6 w-full",children:[(0,c.Y)(v.T,{size:"title1",weight:"semiBold",color:"black",children:a({id:"hospitalService.detail.doctorExpertise.modal.heading",defaultMessage:"Doctor details"})}),(0,c.Y)(it.M,{onClick:n,variant:"transparent","aria-label":"Close modal",size:24,children:(0,c.Y)(ct.A,{})})]})})}),(0,c.Y)(tt.a.Body,{children:(0,c.Y)("div",{ref:l,className:"h-full flex flex-col",children:(0,c.FD)(h.D,{className:M()("w-full !rounded-none",{"flex-1":!o}),doctorInformation:t,defaultProfileImage:x.k_,children:[(0,c.Y)(h.D.Expertise,{}),(0,c.Y)(h.D.OtherHighlights,{})]})})})]})]})},pt=i(60140),ht=i(77639),gt=i(89252),vt=i(26754),mt=i(86786),ft=i(5792),bt=i(98554),yt=i(89394);function xt(e){var t,i=e.data,n=e.refetchHospitalServiceDetail,a=e.faqsResult,A=(0,D.d)().isMobile,C=A?56:100,N=(0,s.A)((0,$.g)({topOffset:C}),2),S=N[0],T=N[1],E=(0,F.A)().formatMessage,H=(0,vt.HO)().gps,O=(0,X.$)(),B=O.locale,R=O.asPath,P=(0,Fe.J3)(),ne=P.openPopupOrganization,ae=P.bookingQuantity,le=(0,u.useState)(!1),oe=le[0],re=le[1],se=(0,u.useState)(!1),de=se[0],ce=se[1],ue=i.id,pe=i.slug,ge=i.hospital_branch,ve=i.price,me=i.price_discount,fe=i.percent_discount,be=i.price_unit,ye=i.top5_reviews,xe=i.cost_unit,we=i.service_type,Ye=i.organization,Ae=i.offering_id,Me=i.display_name,ke=(0,Q.useAppContext)().state.featureFlags.enableConsultDoctorButton,Ce=(Ye||{}).id,Ne=(0,J.Y)({id:ue}),De=Ne.doctorQuotes,Se=Ne.loading,Te=Ne.handleLoadMore,Ee=Ne.pagination,Oe=(0,x.DH)(i)?i.screener_listing:[],Be=a||{},Re=Be.faq,Pe=Be.related_article,Ie=A?p.D:Le.S,ze=(0,u.useState)(""),qe=ze[0],Ve=ze[1];(0,u.useEffect)((function(){Ve((0,ie.Kb)(R))}),[]);var je=(0,u.useMemo)((function(){var e;return(null===(e=(0,gt.Yf)(null===H||void 0===H?void 0:H.lat,null===H||void 0===H?void 0:H.lng,null===ge||void 0===ge?void 0:ge.latitude,null===ge||void 0===ge?void 0:ge.longitude))||void 0===e?void 0:e.toFixed(1))||""}),[H]),We=(0,ft.o)(),Ze=We.openModal,tt=We.closeModal,it=We.opened,nt=(0,s.A)((0,y.j)(!1),2),at=nt[0],lt=nt[1],ot=lt.open,rt=lt.close,st=(0,u.useState)(),dt=st[0],ct=st[1],xt=(0,u.useRef)(null),_t=(0,u.useRef)(null),wt=(0,u.useRef)({}),Yt=(0,u.useCallback)((function(e){return function(t){wt.current[e]=t}}),[]),At=function(e){if((null===e||void 0===e?void 0:e.length)<=1){var t=Ue(e[0]);return(0,c.Y)("div",(0,o.A)((0,l.A)({},Rt.clickDoctorExpertise),{"data-event-label":t.name,className:"enable-pointer-events flex justify-center items-center pb-4 md:pb-6 md:mx-6",children:(0,c.Y)(h.D,{className:"w-[20.4375rem] max-w-[min(20.4375rem_,_calc(100vw_-_2rem))] h-full",doctorInformation:t,onClickReadMore:Bt(t),isShowReadMoreButton:!0,defaultProfileImage:x.k_})}),t.name)}return(0,c.Y)(Ie,{withControls:!A,className:"pl-4 pb-4 md:pb-6",sx:{".mantine-Carousel-viewport":{paddingRight:(0,f.D)(16)}},align:(null===e||void 0===e?void 0:e.length)<=1?"center":"start",children:null===e||void 0===e?void 0:e.map((function(e){var t=Ue(e);return(0,c.Y)("div",(0,o.A)((0,l.A)({},Rt.clickDoctorExpertise),{"data-event-label":t.name,className:"enable-pointer-events",children:(0,c.Y)(h.D,{className:"w-[20.4375rem] max-w-[min(20.4375rem_,_calc(100vw_-_2rem))] h-full",doctorInformation:t,onClickReadMore:Bt(t),isShowReadMoreButton:!0,defaultProfileImage:x.k_})}),e.name)}))})},Mt=(0,u.useMemo)((function(){var e={id:"related-articles",title:"page.detail.relatedArticles",defaultMessage:"Related Articles",icon:(0,c.Y)(c.FK,{}),renderContent:function(){return(0,c.Y)(mt.x,{listArticle:Pe||[]})},isHidden:!yt.QA.includes(B)||!Pe},t={id:"top5-reviews",title:"vaccination.detail.text.rating",defaultMessage:"Reviews",icon:(0,c.Y)(c.FK,{}),renderContent:function(){return(0,c.Y)(bt.A,{refetchList:n,userReviews:ye,vaccinationDetail:i,onViewAll:Ze,trackerMap:Rt})},isHidden:!yt.iO.includes(B)};return A?[t,e]:[e,t]}),[A]),kt=(0,u.useMemo)((function(){var e,t,n,a;return[{id:"doctor-quotes",title:"vaccination.detail.doctorQuotes",defaultMessage:"What doctors are saying",icon:(0,c.Y)(c.FK,{}),renderContent:function(){return(0,c.Y)("div",{className:"px-4 md:px-6 pb-4 md:pb-6",children:(0,c.Y)(k.C,{doctorQuotes:De,loading:Se,handleLoadMore:Te,pagination:Ee})})},isHidden:!(null===De||void 0===De?void 0:De.length)}].concat((0,d.A)(A?[{id:"doctor-expertise",title:"ivf.doctorExpertise",defaultMessage:"Doctor Expertise",icon:(0,c.Y)(c.FK,{}),renderContent:function(e){return At((0,x.P3)(e)?null===e||void 0===e?void 0:e.doctors:[])},isHidden:!((0,x.P3)(i)&&(null===i||void 0===i||null===(e=i.doctors)||void 0===e?void 0:e.length))||!A||(0,x.DH)(i)}]:[]),[{id:"detail-info",title:(0,x.DH)(i)?"screenerPage.detail.otherDescription":"hospitalService.detail.info",defaultMessage:(0,x.DH)(i)?"Other Description":"Details Service Information",icon:(0,c.Y)(Ge.bu,{}),renderContent:function(e){return(0,x.DH)(e)?(0,c.Y)(_e,{data:e}):(0,c.Y)(he,{data:e})},isHidden:(0,x.DH)(i)&&!(null===i||void 0===i?void 0:i.preparation)&&!(null===i||void 0===i?void 0:i.detail)&&!(null===i||void 0===i?void 0:i.about)&&!(null===i||void 0===i?void 0:i.product_note)},{id:"accreditation",title:"hospitalService.detail.accreditation",defaultMessage:"Accreditation",icon:(0,c.Y)(Ge.bu,{}),renderContent:function(e){return(0,c.Y)(Xe,{certifications:(0,x.P3)(e)?null===e||void 0===e?void 0:e.certifications:[]})},isHidden:!((0,x.P3)(i)&&(null===i||void 0===i||null===(t=i.certifications)||void 0===t?void 0:t.length))||(0,x.DH)(i)},{id:"hospital-info",title:"vaccination.detail.clinic",defaultMessage:"Clinic Info",icon:(0,c.Y)(c.FK,{}),renderContent:function(e){return(0,c.Y)(U.A,{className:"px-4 md:px-6 pb-5 md:pb-6 md:pt-3",organization:e.organization,hospitalBranches:e.hospital_branch_lists})},isHidden:!(0,x.DH)(i)},{id:"payment-methods",title:"vaccination.detail.paymentMethods",defaultMessage:"Payment Methods",icon:(0,c.Y)(Ge.Le,{}),renderContent:function(e){var t;return(0,c.Y)(Ge.sJ,{className:"px-6 pb-6",children:(0,c.Y)(g.P,{isMobile:A,payments:(null===e||void 0===e||null===(t=e.hospital_branch)||void 0===t?void 0:t.accepted_payments)||[]})})},isHidden:!(null===ge||void 0===ge||null===(n=ge.accepted_payments)||void 0===n?void 0:n.length)},{id:"faqs",title:"page.detail.faqs",defaultMessage:"Frequently Asked Questions",icon:(0,c.Y)(c.FK,{}),renderContent:function(){return(0,c.Y)(pt.A,{data:Re||[]})},isHidden:!yt.$z.includes(B)||!(null===Re||void 0===Re?void 0:Re.length)}],(0,d.A)(Mt),[{id:"cross-selling",title:"hospitalService.detail.crossSelling",defaultMessage:"Recommended Services",icon:(0,c.Y)(c.FK,{}),renderContent:function(e){return(0,c.Y)(j.q,{crossSellingData:null===e||void 0===e?void 0:e.list_data_for_crossselling})},isHidden:!(null===i||void 0===i||null===(a=i.list_data_for_crossselling)||void 0===a?void 0:a.length)}])}),[i,null===H||void 0===H?void 0:H.lat,null===H||void 0===H?void 0:H.lng,B,A,De]),Ct=(0,u.useMemo)((function(){var e,t=[];return(0,x.DH)(i)&&Array.isArray(Oe)&&(null===i||void 0===i||null===(e=i.screener_listing)||void 0===e?void 0:e.length)>0&&t.push({ref:_t,id:"included-test",title:"screenerPage.detail.includedTest",defaultMessage:"Included Test"}),kt.filter((function(e){return!e.isHidden&&e.id})).forEach((function(e){var i=e.id||"";t.push({ref:{get current(){return wt.current[i]}},id:i,title:e.title,defaultMessage:e.defaultMessage})})),t}),[i,Oe,kt]),Nt=(0,W.y)({sectionRefs:Ct,formatMessage:E,firstSectionOffset:A?56:100}),Dt=Nt.sections,Ft=Nt.scrollToSection,St=Nt.showFixedScroll,Tt=(0,u.useCallback)((function(){return kt.filter((function(e){return!e.isHidden})).map((function(e,t){return(0,c.Y)("div",{ref:Yt(e.id||""),children:(0,c.Y)(Ge.FJ,{id:e.id||"",icon:e.icon,title:E({id:e.title,defaultMessage:e.defaultMessage}),haveCollapse:!1,className:"md:rounded-2xl",children:e.renderContent(i)})},t)}))}),[i,null===H||void 0===H?void 0:H.lat,null===H||void 0===H?void 0:H.lng,kt,Yt,E]),Et=function(e){var t=e.callingCode,i=e.countryCode,n=e.phone;return _.F.collectionSubmitCTA({area_code:t,country_code:i,cta_text:E({id:"common.contactVia",defaultMessage:"Contact {name}"},{name:w.so.Zalo}),phone_number:n,source_url:window.location.href,messaging_app:w.so.Zalo,source_type:Y.qV[we]})},Ht=function(e){ce(e)},Ot=function(){Ht(!0)},Bt=function(e){return function(){ct(e),ot()}},Rt=(0,u.useMemo)((function(){return(0,te.mZ)(we)}),[we]),Pt=[He.Hxq.HEALTH_SCREENER].includes(we),Lt=(0,G.qP)({shouldCheckEnableBooking:Pt}),It=Lt.enableBooking,zt=Lt.loading,qt=Lt.getEnableBooking;(0,u.useEffect)((function(){n()}),[]),(0,u.useEffect)((function(){Ce&&qt({hospital_id:Ce,product_type:Y.jG[we]})}),[Ce]);var Vt={root:{width:"100%",height:T&&A?(0,f.D)(48):T?(0,f.D)(40):(0,f.D)(52),paddingLeft:(0,f.D)(16),paddingRight:(0,f.D)(16)},label:{fontWeight:600}},jt=(0,V.F)(we,B),Kt=jt.link,Ut=(0,r.A)(jt,["link"]),Gt=(0,Z.d)(Me,Ye.name,qe),Qt=(0,u.useCallback)((function(){return(0,c.Y)(et.b,{dataTracking:(0,te.yz)(Ut,ue),link:B===m.L.Malaysia?Gt:Kt,isPrimary:!It,locale:B,className:M()("contact-button_section","[&_svg]:!w-[26px] [&_svg]:!h-[26px] [&_button]:!py-0 ",{"[&_button]:!h-[52px] [&_p]:text-[17px] [&_p]:tracking-[-0.4px]":!T,"[&_button]:!h-[48px] [&_p]:text-[17px] [&_p]:tracking-[-0.4px]":T&&A,"[&_button]:!h-[40px] [&_button]:!px-4 [&_p]:text-[15px] [&_p]:tracking-[-0.3px]":T&&!A})})}),[Ut,ue,Kt,It,B,T,A,Gt]),Jt=(0,u.useCallback)((function(e){if(zt)return(0,c.Y)(b.E,{width:"100%",height:52});if(It){var t=(0,c.Y)(v.T,{size:T&&!A?"p2":"p1",weight:"semiBold",color:"white",children:E({id:"homePage.bookNow",defaultMessage:"Book Now"})});return(0,c.Y)(Ge.B8,(0,o.A)((0,l.A)({onClick:ne,size:"xl"},(0,te.yz)((0,o.A)((0,l.A)({},e),{"data-event-label":qe}),ue)),{"data-testid":"book-now-button",styles:Vt,className:M()("book-now-button",{"[&_p]:text-[17px] [&_p]:tracking-[-0.4px] !py-0":T&&A,"[&_p]:text-[15px] [&_p]:tracking-[-0.3px] !py-0 !px-4":T&&!A}),children:t}))}return ke?(0,c.Y)(z.u,{locale:B,handleClick:Ot,className:M()("consult-doctor-button",{"[&_p]:text-[17px] [&_p]:tracking-[-0.4px] [&_button]:h-[48px] [&_button]:!py-0":T&&A,"[&_p]:text-[15px] [&_p]:tracking-[-0.3px] [&_button]:h-[40px] [&_button]:!py-0 [&_button]:!px-4":T&&!A})}):Qt()}),[we,It,zt,A,E,pe,Rt.buyVia,B,Kt,T,ne,Qt]),$t=(0,u.useMemo)((function(){return Jt(Rt.clickBookNow)}),[Jt]),Wt=(0,u.useMemo)((function(){return Jt(Rt.clickBookNowHeader)}),[Jt]),Zt=A&&B===m.L.Vietnam&&It,Xt=(0,ee.D)({locale:B,productKey:String(Ae)||""}).badge,ei=Boolean(i.quantity_supported),ti=i.max_product_quantity||100,ii=ei?Math.min(Math.max(ae||1,1),ti):1,ni=It;return(0,c.FD)(c.FK,{children:[(0,c.FD)("div",{className:"space-y-3 md:space-y-4",children:[(0,c.Y)(ft.A,{data:i,onClose:tt,opened:it,refetchList:n,trackerMap:Rt}),dt&&(0,c.Y)(ut,{doctor:dt,opened:at,onClose:rt}),(0,c.Y)("div",{ref:xt,children:(0,c.Y)(Ke,{data:i,distance:je,trackerMap:Rt,showO2OQuantityStepper:It&&(0,x.DH)(i),buttonUiScrollRef:S,isCarouselParallax:A&&(B===m.L.Vietnam||B===m.L.Malaysia),buttonUi:(0,c.FD)("div",{className:"flex flex-col gap-2 w-full",children:[Xt&&(0,c.Y)("div",{"data-section":"buttonUi_urgency-badge",children:(0,c.Y)($e.A,{textProps:{size:"p3",weight:"semiBold"},type:Xt.type,value:Xt.value})}),(0,c.FD)("div",{className:"flex flex-col gap-3 [&_button]:w-full",children:[(0,c.Y)("div",{"data-section":"button-book-now",children:$t}),It&&(0,c.Y)("div",{children:ke?(0,c.Y)(z.u,{locale:B,handleClick:Ot}):Qt()})]})]}),showPaymentHighlight:ni&&A})}),ni&&!A&&(0,c.Y)(I.A,{}),(0,x.DH)(i)&&Array.isArray(Oe)&&(null===i||void 0===i||null===(t=i.screener_listing)||void 0===t?void 0:t.length)>0&&(0,c.Y)("div",{ref:_t,children:(0,c.Y)(L,{tests:Oe.map((function(e){return{title:e.category_name,description:e.interpretation}}))})}),(0,c.FD)("div",{className:"md:flex md:gap-4 ",children:[(0,c.Y)("div",{className:"space-y-3 md:space-y-4 md:max-w-[calc(100%-376px)]",children:Tt()}),!(0,x.DH)(i)&&(0,c.Y)("div",{className:M()("flex flex-col gap-4 md:w-[360px] sticky top-[calc(110px+24px)] md:self-start"),children:!A&&(0,c.Y)("div",{children:(0,x.P3)(i)&&(null===i||void 0===i?void 0:i.doctors)&&(0,c.Y)(Ge.FJ,{id:"doctor-expertise",icon:(0,c.Y)(c.FK,{}),title:E({id:"ivf.doctorExpertise",defaultMessage:"Doctor Expertise"}),haveCollapse:!1,className:"rounded-xl",children:At(null===i||void 0===i?void 0:i.doctors)})})}),(0,c.Y)(Ge.vw,{"data-visible":!!T||void 0,children:(0,c.FD)("div",{className:"py-[15px] px-4 space-y-2 w-full relative",children:[(0,c.FD)("div",{className:"flex justify-between gap-4 w-full",children:[(0,c.Y)(Qe.$,{className:"flex-1",status:i.status,price:ve||0,priceDiscount:me||0,badgeDiscount:{percent:null!==fe&&void 0!==fe?fe:null,variant:"short"},costUnit:(0,x.DH)(i)?E({id:"screenerPage.detail.perTime",defaultMessage:"per time"}):xe,priceUnit:be,isBasicLayout:!0,showFrom:!1,showSlash:!(0,x.DH)(i),perDosePos:"bottom",quantity:ii}),(0,c.Y)("div",{className:"flex-1 max-w-[203px]",children:$t})]}),It&&ke&&(0,c.Y)(q.k,{locale:B,shouldFadeIn:T,handleClick:Ot})]})})]}),(0,c.Y)(h.P,{onOpenChange:function(e){re(e)},isOpen:oe,isMobile:A,onSubmit:Et}),ke&&(0,c.Y)(h.g,{onOpenChange:Ht,isOpen:de,isMobile:A,onSubmit:function(e){var t=e.callingCode,i=e.countryCode,n=e.phone,a=e.gender,l=e.name;return Y.Xx.submitConsultation({area_code:t,country_code:i,phone_number:n,source_url:window.location.href,category_name:we,listing_id:"".concat(ue),name:l,gender:a,extras_data:{product_name:Me,platform:A?"mobile":"desktop",offering_id:Ae}})},locale:B}),(0,c.Y)(ht.k,{data:i,sections:Dt,isDisappear:St,renderButton:Wt,onScrollToSection:Ft,urgencyBadge:Xt,quantity:ii}),(0,c.Y)(Je.A,{})]}),Zt&&!ke&&(0,c.Y)("div",{className:M()({"[&>div]:!bottom-[88px]":A&&!Xt,"[&>div]:!bottom-[116px]":A&&Xt}),children:(0,c.Y)(K.m,{locale:B,isMobile:A,handleSubmitCTA:Et})})]})}var _t=i(858),wt=i(83776),Yt=i(27516),At=i(94886),Mt=i.n(At),kt=i(19475),Ct=i(71437),Nt=i(21861),Dt=i(16381),Ft=i(28901),St=i(87783),Tt=i(28333),Et=i(25683),Ht=i(66031),Ot=i(14739),Bt=i(17745),Rt=i(33714),Pt=i(90700),Lt=i(74489),It=i(87505);var zt=function(e){var t=e.className,i=(0,we.u)(),n=i.handleUpdateFilter,a=i.filters,l=(0,F.A)().formatMessage;return(0,c.Y)(Lt.A,{title:l({id:"hospitalService.list.genderFilter",defaultMessage:"Gender"}),className:t,filterOptions:It.Bj,activeValue:a.gender||[],onReset:function(){n({gender:""})},onChange:function(e){var t=a.gender===e.value?"":e.value;n({gender:t})}})};var qt=function(e){var t=e.className,i=e.activeFilter,n=(0,we.u)(),a=n.handleUpdateFilter,l=n.filters,o=(0,F.A)().formatMessage,r=(0,u.useMemo)((function(){if(!(null===i||void 0===i?void 0:i.length))return It.dB;var e=new Set(i);return It.dB.filter((function(t){return e.has(t.value)}))}),[i]);return r.length?(0,c.Y)(Lt.A,{title:o({id:"hospitalService.list.healthConditionFilter",defaultMessage:"Health Condition"}),className:t,filterOptions:r,activeValue:l.healthCondition||[],onReset:function(){var e;0!==(null===(e=l.healthCondition)||void 0===e?void 0:e.length)&&a({healthCondition:[]})},onChange:function(e){var t=(0,d.A)(l.healthCondition||[]);t.includes(e.value)?t=t.filter((function(t){return t!==e.value})):t.push(e.value),a((0,Ee.A)({},e.filterKey,t))},defaultLenToGetItems:4}):null},Vt=i(94335),jt=i(11277);var Kt=function(e){var t=e.serviceType,i=e.className,n=e.activeFilter,a=(0,we.u)(),l=a.handleUpdateFilter,o=a.filters,r=(0,F.A)().formatMessage,s=(0,u.useMemo)((function(){if(!(null===n||void 0===n?void 0:n.length))return It.gS[t];var e=new Set(n);return It.gS[t].filter((function(t){return e.has(t.value)}))}),[t,n]),p=(0,u.useMemo)((function(){return r({id:It.Eq[t].title,defaultMessage:It.Eq[t].defaultMessage})}),[t]);return s.length?(0,c.Y)(jt.A,{className:i,title:p,filterOptions:s,activeValue:o.productType||[],onChange:function(e){var t=(0,d.A)(o.productType||[]);t.includes(e.value)?t=t.filter((function(t){return t!==e.value})):t.push(e.value),l((0,Ee.A)({},e.filterKey,t))}}):null};var Ut=function(e){var t=e.className,i=e.serviceType,n=e.activeFilter,a=(0,we.u)(),l=a.handleUpdateFilter,o=a.filters,r=(0,F.A)().formatMessage,s=(0,u.useMemo)((function(){var e=It.gS[i];if(!(null===n||void 0===n?void 0:n.length))return e;var t=new Set(n);return e.filter((function(e){return t.has(e.value)}))}),[i,n]),p=(0,u.useMemo)((function(){return r({id:It.Eq[i].title,defaultMessage:It.Eq[i].defaultMessage})}),[i]),h=i===He.Hxq.HEALTH_SCREENER;return s.length?(0,c.Y)(Lt.A,{title:p,className:t,filterOptions:s,activeValue:o.productType||[],onReset:function(){var e;0!==(null===(e=o.productType)||void 0===e?void 0:e.length)&&l({productType:[]})},onChange:function(e){var t=(0,d.A)(o.productType||[]);t.includes(e.value)?t=t.filter((function(t){return t!==e.value})):t.push(e.value),l((0,Ee.A)({},e.filterKey,t))},defaultLenToGetItems:h?4:10}):null},Gt=i(42258),Qt=i(6e3),Jt=i(17428),$t=i(73773),Wt=i(57387),Zt=i(2543),Xt=function(e){var t=e.highlights,i=e.className;return(null===t||void 0===t?void 0:t.length)&&(0,Zt.isArray)(t)?(0,c.Y)("div",{className:M()("flex flex-wrap gap-1",i),children:t.map((function(e,t){return(0,c.Y)(Wt.E,{h:24,py:4,px:8,lh:(0,f.D)(16),radius:8,bg:"white",variant:"outline",classNames:{root:"!border-neutral100 !normal-case !font-normal !text-[11px] leading-[16px] tracking-[-0.2px]",inner:"!text-[#111]"},children:e},"tag-".concat(t))}))}):null},ei=function(e){var t=(null===e||void 0===e?void 0:e.trim())||"";return!!t&&"NOT_AVAILABLE"!==t},ti=i(48045),ii=i(47463),ni=(0,Be.A)(we.q,{target:"eqwqkuh0"})((function(e){return e.isMobile?"\n gap: 16px;\n padding-bottom: 0.875rem;\n .info {\n gap: 8px;\n }\n ":"\n &.card-item {\n grid-template-columns: 1fr 148px;\n column-gap: ".concat((0,f.D)(24),";\n row-gap: 0;\n padding: ").concat((0,f.D)(24)," ").concat((0,f.D)(24)," ").concat((0,f.D)(16),";\n }\n\n &.card-item .info {\n gap: ").concat((0,f.D)(12),";\n min-height: ").concat((0,f.D)(148),";\n }\n\n &.card-item .logo{\n width: ").concat((0,f.D)(148),";\n height: ").concat((0,f.D)(148),";\n\n img {\n width: ").concat((0,f.D)(148),";\n height: ").concat((0,f.D)(148),";\n }\n }\n ")})),ai=(0,Be.A)(Ne.s,{target:"eqwqkuh1"})("img[alt='platform']{width:24px !important;height:24px !important;}"),li=(0,Be.A)(ii.A,{target:"eqwqkuh2"})("&.listing-whatsapp-button{width:100%;height:",(0,f.D)(40),";",ot.M.mbUp,"{width:fit-content;}}"),oi=(0,Be.A)(ti.B,{target:"eqwqkuh3"})("&.listing-book-now-button{width:100%;height:",(0,f.D)(40),";background-color:",ne.w.colors.yellow800,";",ot.M.mbUp,"{width:fit-content;}&:hover{background-color:",ne.w.colors.yellow900,";}.mantine-Text-root{font-size:",(0,f.D)(15),";line-height:",(0,f.D)(24),";letter-spacing:",(0,f.D)(-.3),";}}"),ri=i(72005),si=i(39857),di=i(75802);function ci(e){var t=e.address,i=e.distance,n=e.className,a=void 0===n?"":n,l=e.totalBranches,o=void 0===l?1:l,r=e.organization,s=(0,F.A)().formatMessage,d=(0,D.d)().isMobile,u=o>1;return(0,c.FD)(v.T,{size:"p3",color:ne.w.colors.gray700,className:"flex gap-2 items-center md:items-start ".concat(a),children:[u?(0,c.Y)(si.A,{className:"w-5 h-5 shrink-0"}):(0,c.Y)(di.A,{className:"w-5 h-5 shrink-0"}),(0,c.Y)("div",{className:"cursor-pointer flex-1 md:flex-initial min-w-0",children:u?null===r||void 0===r?void 0:r.name:t}),!d&&(u||i)&&(0,c.Y)("div",{children:"|"}),u?(0,c.Y)("div",{children:s({id:"hospital.info.totalBranches",defaultMessage:"{total, plural, =0 {} =1 {# branch} other {# branches}}"},{total:o})}):i&&(0,c.Y)(ri.A,{isIcon:!1,className:"!border-none !p-0 !w-auto shrink-0",textClassName:"text-gray700 text-[13px] md:leading-[20px]",value:"".concat(i," km")})]})}function ui(e){var t,i,n,a,r,s=e.data,p=e.loading,h=e.gps,g=e.trackerMap,f=e.serviceType,y=(0,Fe.J3)().openPopupOrganizationWithData,_=s||{},w=_.description,Y=_.logo,A=_.hospital_branch,k=_.price,C=_.price_discount,N=_.percent_discount,S=_.price_unit,T=_.cost_unit,E=_.hospital,H=_.display_name,O=_.offering,B=_.slug,R=_.flag_check_for_rule_image,P=(0,D.d)().isMobile,L=(0,X.$)().locale,I=(0,F.A)().formatMessage,z=function(e){var t,i,n,a=e.data,l=e.gps,o=(0,F.A)().formatMessage,r=(0,X.$)().asPath,s=(null===(t=a.hospital_branch)||void 0===t?void 0:t.length)||1,c=null===(i=a.hospital_branch)||void 0===i?void 0:i[0],p=a.review||{},h=p.avg_rating,g=p.rating_count,v=null===(n=a.hospital_branch)||void 0===n?void 0:n.some((function(e){return!!e.rating_count})),m="".concat(r.split("?")[0]).concat(a.slug,"-").concat(null===c||void 0===c?void 0:c.vaccine_detail_id),f=(0,u.useMemo)((function(){var e;return(null===(e=(0,gt.Yf)(null===l||void 0===l?void 0:l.lat,null===l||void 0===l?void 0:l.lng,null===c||void 0===c?void 0:c.latitude,null===c||void 0===c?void 0:c.longitude))||void 0===e?void 0:e.toFixed(1))||""}),[l,c]),b=(0,u.useMemo)((function(){return(0,x.Bp)(a)||(0,x.P3)(a)?a.success_rate_highlights:[]}),[a]),y=(0,u.useMemo)((function(){var e;if((0,x.Bp)(a)||(0,x.P3)(a))return(null===(e=a.key_highlights)||void 0===e?void 0:e.slice(0,3))||[];if((0,x.bL)(a))return(0,d.A)(a.age_group_labels||[]).concat((0,d.A)(a.doses_labels||[]));if((0,x.DH)(a)){var t,i=o({id:He.Mrh[a.gender]||"gender.other",defaultMessage:"Other"}),n=(null===(t=a.category_life_stages)||void 0===t?void 0:t.filter(ei).map((function(e){return o({id:He.URC[e]||e,defaultMessage:He.URC[e]||e})})))||[];return[i].concat((0,d.A)(n))}return[]}),[a,o]);return{totalBranches:s,firstHospitalBranch:c,avgRating:h,ratingCount:g,shouldShowRatingCount:v,href:m,distance:f,successRateHighlights:b,highlightsBadges:y}}({data:(0,o.A)((0,l.A)({},s),{service_type:f}),gps:h}),q=z.totalBranches,V=z.firstHospitalBranch,j=z.avgRating,K=z.ratingCount,U=z.shouldShowRatingCount,G=z.href,Q=z.distance,J=z.successRateHighlights,$=z.highlightsBadges,W=void 0===$?[]:$,ae=(0,Te.p)({offeringId:null===s||void 0===s||null===(t=s.offering)||void 0===t?void 0:t.id,hospital:s.hospital,price:s.price,type:f,hospitalBranchIds:null===(i=s.hospital_branch)||void 0===i?void 0:i.map((function(e){return e.id}))}),le=ae.referralTitle,oe=ae.allVouchers,re=ae.loading,se=(0,ee.D)({locale:L,productKey:(null===O||void 0===O?void 0:O.id)||""}).badge,de=He.yXx.includes(L),ce=f===He.Hxq.HEALTH_SCREENER,ue=(0,u.useMemo)((function(){return Y||(null===E||void 0===E?void 0:E.logo)||""}),[Y,null===E||void 0===E?void 0:E.logo]),pe=R||!Y?void 0:(null===E||void 0===E?void 0:E.logo)||"",he=(0,u.useMemo)((function(){return(0,c.FD)(c.FK,{children:[(0,c.Y)($t.k$,{avgRating:j,ratingCount:K,shouldShowRatingCount:U}),(0,c.Y)($t.SG,{dataTracking:g.selectProductItem,href:G,children:(0,c.Y)(v.T,{as:"span",color:ne.w.colors.gray700,size:"p3",lineClamp:2,children:w})})]})}),[j,K,U,w,G,g.selectClinic]),ge=function(e){return e?null:(0,c.FD)("div",{className:"md:pt-4",children:[se?(0,c.Y)($e.A,{className:"py-1",type:se.type,value:null===se||void 0===se?void 0:se.value}):(0,c.Y)($t.xn,{highlights:J,className:"py-1"}),de&&(0,c.Y)(Qt.b,{text:I({id:"hospitalService.item.badge.fullRefundCancellation",defaultMessage:"Full Refund Cancellation In {number} Days"},{number:10}),className:"text-yellow900 font-medium pb-[6px]"}),(0,c.Y)(Qe.$,{price:k||0,priceDiscount:C||0,badgeDiscount:{percent:null!==N&&void 0!==N?N:null,variant:"short"},priceUnit:S,costUnit:T||"",showFrom:!1,className:"pt-1"})]})},ve=(0,ie.Kb)(G),me=(0,Z.d)(H,E.name,ve),fe=!!(null===A||void 0===A?void 0:A.length)&&(void 0!==(r=null!==(a=null!==(n=s.can_book_now)&&void 0!==n?n:s.toggle_payment_online)&&void 0!==a?a:s.togglePaymentOnline)&&null!==r&&""!==r&&(!0===r||1===r||"1"===r))&&[m.L.Malaysia,m.L.Vietnam].includes(L),be=!ce&&L===m.L.Malaysia&&!!(null===A||void 0===A?void 0:A.length),ye=fe||be,xe=(null===V||void 0===V?void 0:V.vaccine_detail_id)||(null===s||void 0===s?void 0:s.id);return p?(0,c.Y)($t.aL,{}):(0,c.Y)(ni,{logo:Y||"",title:H||"",description:he,href:G,LinkComponent:function(e){return(0,c.Y)($t.SG,(0,o.A)((0,l.A)({},e),{dataTracking:g.selectProductItem}))},defaultImage:x.__,isMobile:P,contentInfo:(0,c.FD)("div",{className:"md:pb-4",children:[(0,c.Y)(Xt,{highlights:W,className:"mt-1"}),ge(P)]}),className:"card-item md:rounded-xl",renderImage:ce?function(){return(0,c.Y)($t.SG,{href:G,dataTracking:g.selectProductItem,children:(0,c.Y)($t.RZ,{backgroundImage:ue,logoImage:pe,width:P?84:148,height:P?84:148,alt:"".concat(H||""," - ").concat(He.ElQ[L].SITE_NAME_FORMATTED)})})}:void 0,children:(0,c.FD)("div",{className:"order-3 col-span-2 flex flex-col gap-3.5",children:[ge(!P),re?(0,c.Y)(Le.S,{withControls:!P,height:40,children:Array.from({length:3}).map((function(e,t){return(0,c.Y)(b.E,{w:248,h:40,radius:8,bg:ne.w.colors.neutral100,className:"max-w-[248px]"},"skeleton-voucher-".concat(t))}))}):(null===oe||void 0===oe?void 0:oe.length)>0&&(0,c.Y)(Le.S,{withControls:!P,height:40,children:oe.map((function(e){var t=e.id,i=e.name,n=e.type,a=e.brand,r=e.logo,s=e.description,d=n===ze.O7.VOUCHER?"".concat(i," - ").concat(s):le(e),u=n===ze.O7.REFERRAL?(0,te.yz)((0,o.A)((0,l.A)({},g.selectReferralVoucherListing),{"data-event-label":ve}),null===V||void 0===V?void 0:V.vaccine_detail_id):(0,o.A)((0,l.A)({},g.clickVoucher),{"data-event-label":"".concat(null===V||void 0===V?void 0:V.vaccine_detail_id,"^").concat(i||t,"^").concat(ve)});return(0,c.Y)($t.SG,{href:G,children:(0,c.Y)(ai,{dataTracking:u,image:ze.uY[a]||r||x.__,title:d,className:M()("max-w-[300px] h-10 !p-2"),classes:{title:{lineClamp:1}}})},t)}))}),!!(null===A||void 0===A?void 0:A.length)&&(0,c.FD)(c.FK,{children:[(0,c.Y)(Ye.c,{color:ne.w.colors.neutral100}),(0,c.FD)("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between -mt-[4px]",children:[(0,c.Y)($t.SG,{dataTracking:g.selectProductItemBranch,href:G,formatEventTracking:function(e){return(0,te.yz)(e,null===V||void 0===V?void 0:V.vaccine_detail_id)},children:ce?(0,c.Y)(Jt.A,{hospitalBranch:{name:(null===V||void 0===V?void 0:V.name)||"",short_name:null===V||void 0===V?void 0:V.short_name},organization:E,distance:Q,totalBranches:q}):(0,c.Y)(ci,{address:(null===V||void 0===V?void 0:V.address)||"",distance:Q,totalBranches:q,organization:E})}),ye&&(0,c.FD)("div",{className:fe&&be?"grid grid-cols-2 gap-2 md:flex md:flex-row md:items-center":"flex flex-col gap-2 md:flex-row md:items-center",children:[be&&(0,c.Y)(li,{dataTracking:(0,te.yz)((0,o.A)((0,l.A)({},g.buyVia),{"data-event-action":"Bottom - Click Message to Whatsapp","data-event-label":ie._s}),xe),link:me,className:"listing-whatsapp-button"}),fe&&(0,c.Y)(oi,(0,o.A)((0,l.A)({size:"lg",className:"listing-book-now-button","data-testid":"listing-book-now-button",onClick:function(e){e.preventDefault(),e.stopPropagation(),(null===A||void 0===A?void 0:A.length)&&B&&xe&&y({id:xe,hospital_branch_lists:A,organization:E,slug:B,service_type:f},{forceOpenModal:!0})}},(0,te.yz)((0,o.A)((0,l.A)({},g.clickBookNow),{"data-event-label":ve}),xe)),{children:(0,c.Y)(v.T,{size:"p2",color:"white",fw:500,children:I({id:"homePage.bookNow",defaultMessage:"Book Now"})})}))]})]})]})]})})}ui.Skeleton=$t.aL;var pi=ui,hi=i(41211),gi=i(92343),vi=i(6483),mi=i(33077),fi=function(e){var t=e.serviceType,i=e.breadcrumbsPages,n=e.initFilterListings,a=(0,F.A)().formatMessage,r=(0,Bt.P)().isOpen,s=(0,u.useMemo)((function(){return(0,te.mZ)(t)}),[t]),d=(0,X.$)().locale,p=(0,D.d)().isMobile,h=(0,we.u)(),g=h.total,m=h.handleUpdateFilter,f=h.filters,y=h.items,x=h.loading,_=h.search,w=(0,u.useState)(!1),Y=w[0],A=w[1],k=(0,u.useState)(!1),C=k[0],N=k[1],S=(0,u.useState)(St.Ok[t]),T=S[0],E=S[1],H=function(e){return function(){E(e),N(!0)}},O=(0,u.useMemo)((function(){var e=0,t=f||{},i=t.by_popularity,n=t.top_price,a=t.productType,l=t.gender,o=t.healthCondition,r=t.lifeStage,s=t.age_group,d=t.hospital_ids;return(i||n)&&e++,s&&e++,a&&Array.isArray(a)&&a.length>0&&(e+=a.length),l&&e++,o&&Array.isArray(o)&&o.length>0&&(e+=o.length),r&&Array.isArray(r)&&r.length>0&&(e+=r.length),d&&Array.isArray(d)&&d.length>0&&(e+=d.length),e}),[f]),B=(0,u.useRef)(!0),R=(0,vt.HO)(),P=R.handleOpen,L=R.geoLocationInfo,I=R.gps,z=R.geoPermission,q=R.isOpen,V=(0,u.useState)((function(){var e=f||{},t=e.by_popularity,i=e.top_price;return t?"by_popularity":i?"top_price":"by_relevance"})),j=V[0],K=V[1],U=function(e){if("near_me"!==e){var t=(0,o.A)((0,l.A)({},f),(0,Ee.A)({},e,Number(!f[e])));m(t)}else P()};(0,u.useEffect)((function(){if(("granted"!==z||L)&&!q&&z){var e,t,i;if(B.current)return void(B.current=!1);var n=(0,o.A)((0,l.A)({},f),{city_id:(null===L||void 0===L||null===(e=L.search)||void 0===e||null===(t=e.city)||void 0===t||null===(i=t.id)||void 0===i?void 0:i.toString())||""});(null===L||void 0===L?void 0:L.place_id)&&I?(n.latitude=+I.lat,n.longitude=+I.lng,n.city_id=""):(n.latitude="",n.longitude=""),m(n)}}),[z,null===L||void 0===L?void 0:L.city,null===L||void 0===L?void 0:L.place_id,null===L||void 0===L?void 0:L.district,null===I||void 0===I?void 0:I.lat,null===I||void 0===I?void 0:I.lng]);var G=!y.length&&!x,Q=(Y||!!_)&&p,J=t===He.Hxq.HEALTH_SCREENER,$=(0,u.useMemo)((function(){var e,i;if(n){var a,l,o={};switch(t){case He.Hxq.HEALTH_SCREENER:o={productType:n.lifeStage,healthCondition:n.healthCondition};break;case He.Hxq.VACCINE:var r,s=f.age_group||"all";o={ageGroup:n.ageGroup,productType:null===(r=n.ageGroup)||void 0===r?void 0:r[s]};break;case He.Hxq.IVF:case He.Hxq.EGG_FREEZING:o={productType:[]};break;default:return}return Object.values(o.ageGroup||{}).flat().length>0||(null!==(a=null===(e=o.productType)||void 0===e?void 0:e.length)&&void 0!==a?a:0)>0||(null!==(l=null===(i=o.healthCondition)||void 0===i?void 0:i.length)&&void 0!==l?l:0)>0?o:void 0}}),[t,n,f.age_group]);return(0,c.Y)(Fe.DT,{children:(0,c.FD)("div",{children:[(0,c.FD)("div",{className:"bg-white md:hidden",children:[(0,c.Y)("div",{className:"py-3 px-4",children:(0,c.Y)(we.L.Search,(0,o.A)((0,l.A)({placeholder:a({id:"ivf.search.placeholder",defaultMessage:"Search hospital/clinic"})},s.searchBox),{onFocus:function(){return A(!0)},onBlur:function(){return A(!1)}}))}),!r&&(0,c.Y)(Ct.A,{isVisible:!Q,maxHeight:200,children:(0,c.Y)(Nt.A,{className:"block md:hidden py-[10px] pl-4",pages:i})})]}),(0,c.FD)(kt.mc,{isNewContainer:!0,className:"gap-6 relative",children:[(0,c.Y)(Nt.A,{className:"hidden py-3 md:block",pages:i}),(0,c.FD)("div",{className:M()("-mx-4 pb-12 md:mx-0 md:flex md:justify-between md:gap-6",{"bg-white":G&&p}),children:[(0,c.FD)("div",{className:"md:w-[320px] hidden md:flex md:flex-col md:gap-3",children:[(0,c.Y)("div",{className:"bg-white p-4 rounded-xl",children:(0,c.Y)(Pt.Ee,(0,l.A)({placeholder:a({id:"ivf.search.placeholder",defaultMessage:"Search hospital/clinic"}),className:"input-desktop"},s.searchBox))}),(0,c.FD)("div",{className:"bg-white p-4 rounded-xl flex flex-col gap-8",children:[J&&Rt.dD.some((function(e){return e===d}))&&(0,c.Y)(Dt.A,{onFilter:function(e){var t={by_relevance:0,by_popularity:0,top_price:0};t[e]=1;var i=(0,l.A)({},f,t);K(e),m(i)},isKeySelected:j}),(0,c.Y)(Ut,{serviceType:t,activeFilter:J?null===n||void 0===n?void 0:n.lifeStage:[]}),J&&(0,c.FD)(c.FK,{children:[(0,c.Y)(qt,{activeFilter:null===n||void 0===n?void 0:n.healthCondition}),(0,c.Y)(zt,{}),(0,c.Y)(Vt.A,{serviceType:t})]})]})]}),(0,c.FD)("div",{className:"md:flex md:flex-col md:flex-1",children:[(0,c.FD)("div",{className:"hidden md:block bg-white mb-3 md:rounded-xl md:px-6 md:py-4",children:[(0,c.Y)("div",{className:"hidden md:block mb-4",children:x?(0,c.Y)(b.E,{w:"20%",h:20}):(0,c.Y)(v.T,{size:"title1",color:"gray900",weight:"semiBold",as:"h2",children:a({id:"ivf.search.total",defaultMessage:"{total} Hospitals/Clinics"},{total:y.length&&g||0})})}),(0,c.Y)(Tt.F,{name:"desktop",onFilter:U,isSelected:{near_me:Number(!!(null===L||void 0===L?void 0:L.place_id)),promo_available:f.promo_available},filterOptions:Et.Q,serviceType:t})]}),(0,c.FD)("div",{className:"bg-white md:flex md:flex-col md:gap-3",children:[(0,c.Y)(Ct.A,{isVisible:!Q,maxHeight:200,children:(0,c.Y)(Kt,{serviceType:t,className:"pb-3 md:hidden",activeFilter:J?null===n||void 0===n?void 0:n.lifeStage:[]})}),(0,c.Y)("div",{className:"md:hidden flex pl-4 pr-4 pt-2 pb-6 items-center",children:(0,c.Y)(Tt.F,{name:"mobile",onFilter:U,isSelected:{near_me:Number(!!(null===L||void 0===L?void 0:L.place_id)),promo_available:f.promo_available},filterOptions:Et.Q,serviceType:t,onFilterClick:H(St.Ok[t]),onHospitalClick:H(St.Xy.HOSPITAL),activeFilterCount:O})}),(0,c.Y)("div",{className:"md:hidden flex gap-[10px] items-center justify-between px-4 ",children:x?(0,c.Y)(b.E,{w:"20%",h:20}):(0,c.Y)(v.T,{size:"p3",color:ne.w.colors.gray400,as:"h2",children:a({id:"ivf.search.total",defaultMessage:"{total} Hospitals/Clinics"},{total:y.length&&g||0})})})]}),(0,c.Y)(we.L.Content,{className:"space-y-3",customLoading:(0,c.FD)("div",{className:"space-y-3",children:[(0,c.Y)(pi.Skeleton,{}),(0,c.Y)(pi.Skeleton,{}),(0,c.Y)(pi.Skeleton,{})]}),customEmpty:(0,c.FD)("div",{className:"flex flex-col gap-2 md:gap-4 items-center justify-start py-20 md:py-10 min-h-[50vh] md:bg-white md:rounded-lg md:h-full",children:[(0,c.Y)(mi.A,{className:"w-[54px] h-[54px] md:hidden text-neutral50"}),(0,c.Y)(vi.A,{className:"hidden md:block md:w-48 md:h-[120px] text-neutral50"}),(0,c.Y)(v.T,{size:"p2",color:ne.w.colors.gray400,className:"text-center",weight:"semiBold",children:a({id:"filter.noResults",defaultMessage:"No result"})})]}),children:(0,c.Y)(we.L.Item,{render:function(e,i){return(0,c.Y)("div",{children:(0,c.Y)(pi,{gps:(null===L||void 0===L?void 0:L.place_id)?I:null,data:e,loading:i,trackerMap:s,serviceType:t})})}})}),(0,c.Y)(we.L.LoadMore,(0,l.A)({renderLoadMore:function(e){var t=e.last;return(0,c.Y)("span",{className:"font-normal",children:a({id:"vaccination.search.loadmore",defaultMessage:"Load more {items} items"},{items:t})})}},s.loadMore))]})]}),(0,c.Y)(hi.m,{locale:d,serviceType:t,filter:f.productType[0]}),(0,c.Y)(Ht.m.div,{className:"absolute inset-0 bg-white z-10",transition:{duration:.15,ease:"easeInOut"},variants:{active:{opacity:1},inactive:{opacity:0,pointerEvents:"none"}},animate:r?"active":"inactive",style:{willChange:"opacity"}})]}),(0,c.Y)(gi.j,{trackerMap:s}),p&&(0,c.Y)(Ft.s,{isOpen:C,onClose:function(){return N(!1)},serviceType:t,totalResults:g||0,defaultActiveCategory:T,activeFilter:$}),(0,c.Y)(Je.A,{})]})})},bi=function(e){var t=e.serviceType,i=e.initItems,n=void 0===i?[]:i,a=e.initPagination,r=e.breadcrumbsPages,s=(0,X.$)().locale,d=(0,u.useRef)(null),p=(0,Ot.Z)(Gt.TE[t]),h=p.state,g=p.setState,v=function(){var e=(0,_t.A)((function(e){var i,n,a,r,c,u,p,h,v,m,f,b,y,x,_,w,A,M,k,C;return(0,wt.__generator)(this,(function(N){switch(N.label){case 0:i=e.page,n=e.pageSize,a=e.search,r=e.filters,c=void 0===r?{}:r,u=e.searchSession,d.current&&d.current.cancel("Operation canceled by the user."),p=Mt().CancelToken,h=p.source(),d.current=h,N.label=1;case 1:return N.trys.push([1,3,,4]),f=Y.ck[t],A={site:Yt.y[s],type:Y.Tc[t],per_page:n,keyword:a||"",page:i,city_id:c.city_id||"",latitude:c.latitude||"",longitude:c.longitude||"",top_rated:null!==(b=c.top_rated)&&void 0!==b?b:0,promo_available:null!==(y=c.promo_available)&&void 0!==y?y:0,health_condition:c.healthCondition||[],hospital_ids:c.hospital_ids||[],gender:c.gender},(0,Ee.A)(A,f,c.productType||[]),(0,Ee.A)(A,"by_relevance",null!==(x=c.by_relevance)&&void 0!==x?x:0),(0,Ee.A)(A,"by_popularity",null!==(_=c.by_popularity)&&void 0!==_?_:0),(0,Ee.A)(A,"top_price",null!==(w=c.top_price)&&void 0!==w?w:0),M=A,u&&(M.page=u),[4,Y.Xx.getVaccinationListV2(M,h.token).then((function(e){var t;return null===(t=e.data)||void 0===t?void 0:t._data}))];case 2:return k=N.sent(),g((0,o.A)((0,l.A)({},c),{keyword:a||"",page:i}),{shallow:!0,scroll:!1}),[2,{data:k.searches,total:(null===(v=k.pagination)||void 0===v?void 0:v.total_items)||0,page:i,searchSession:(null===(m=k.pagination)||void 0===m?void 0:m.next)||""}];case 3:return C=N.sent(),console.log("\ud83d\ude80 ~ fetchVaccinationList ~ error:",C),[2,{data:[],total:0,page:i,isKeepLoading:Mt().isCancel(C)}];case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}();return(0,c.Y)(we.L.Provider,{fetcher:v,defaultSearch:h.keyword||"",defaultFilters:h,defaultItems:n,defaultPage:Number(h.page)||1,defaultTotal:(null===a||void 0===a?void 0:a.total_items)||0,children:(0,c.Y)(fi,(0,o.A)((0,l.A)({},e),{breadcrumbsPages:r}))})}}}]);