"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7082],{FaaI:function(e,t,n){n.d(t,{h:function(){return useCity}});var a=n("q1tI"),i=n("09QT"),l=n("oQBk"),o=n("Tk9B");let useCity=function(e,t,n,r){let c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",[d,s]=(0,a.useState)(!1),[u,h]=(0,a.useState)([]),g=(0,a.useRef)([]),[p,f]=(0,a.useState)(!0),m=(0,a.useCallback)(()=>{h(g.current)},[]);return(0,a.useEffect)(()=>{e&&(async()=>{try{s(!0);let e=await (0,i.d)(l.y.CARE.GET_CARE_GEOBYIP,void 0,"care");if(null==e?void 0:e._data){let{default:n={},cities:a}=e._data;h(a||[]),g.current=a;let i=r?a.find(e=>e.id===r):n;null==t||t("selected_city",{...i,value:i.id,label:i.name})}}catch(e){}finally{s(!1)}})()},[e,r]),(0,a.useEffect)(()=>{c&&""!==c&&c.length>=3?(async()=>{try{s(!0);let e=await (0,i.d)(l.y.CARE.GET_CARE_CITY_LIST,{params:{keyword:c}},"care");if(null==e?void 0:e._data){let{cities:t}=e._data;h(t||[])}}catch(e){}finally{s(!1)}})():h(g.current)},[c]),(0,a.useEffect)(()=>{e&&(async()=>{s(!0);try{if((null==n?void 0:n.value)===0){let n={latitude:"",longitude:""};try{var e,a;let t=await (0,o.k)();n={latitude:(null===(e=t.location)||void 0===e?void 0:e.latitude)||"",longitude:(null===(a=t.location)||void 0===a?void 0:a.longitude)||""},f(!0)}catch(e){f(!1)}let r=await (0,i.d)(l.y.CARE.GET_CARE_GEOBYIP,{params:n},"care");if(null==r?void 0:r._data){let{default:e={}}=r._data;null==t||t("selected_city",{...e,value:e.id,label:e.name})}}}catch(e){}finally{s(!1)}})()},[null==n?void 0:n.value]),{loading:d,permission:p,setCityLoading:s,cityList:u,onFocus:m}}},a7TI:function(e,t,n){n.r(t),n.d(t,{DefaultPagination:function(){return el},default:function(){return clinicLocator}});var a=n("BGKE"),i=n("q1tI"),l=n("rBCA"),o=n("fdQd"),r=n("8wjV"),c=n("wp0n"),d=n("oTwY"),s=n("kd6S"),u=n("Eso5"),h=n("mYVa"),g=n("SPK5"),p=n("FQtM"),f=n("gxre"),m=n("XRSF"),v=n("gHhT"),b=n("dDsW"),w=n("gHFm"),x=n("rz9S"),y=n("3d+w"),C=n("raAP"),k=n("hXNO"),S=n("P5LW"),T=n("rIrU"),L=n("mwIZ"),Z=n.n(L),B=n("09QT"),E=n("/tR3"),I=n("oQBk"),N=n("rEaw");function sanitizeDuplicateFilterId(e){if(!e||!e.length)return[];let t=new Map,n=[];return e.forEach(e=>t.set(e.value,e)),t.forEach(e=>{n.push(e)}),n}let _={streetViewControl:!1,fullscreenControl:!1,mapTypeControl:!1,styles:[{featureType:"all",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"poi.medical",elementType:"labels.icon",stylers:[{visibility:"on"}]}]},M={[N.MV.Vietnam]:{lat:10.762622,lng:106.660172},[N.MV.Indonesia]:{lat:-6.208763,lng:106.845599},[N.MV.Malaysia]:{lat:3.139003,lng:101.686855},[N.MV.Thailand]:{lat:13.756331,lng:100.501765},[N.MV.Cambodia]:{lat:11.544873,lng:104.892167},[N.MV.Taiwan]:{lat:25.032969,lng:121.565418},[N.MV.Myanmar]:{lat:19.763306,lng:96.07851},[N.MV.PhilippinesEnglish]:{lat:14.599512,lng:120.98422},[N.MV.India]:{lat:28.613939,lng:77.209021}};var z=n("GcSG"),R=n("94Cm");let D=(0,i.forwardRef)((e,t)=>{let{options:n=_,zoom:l=13,onLoad:o,center:r,onCenterChanged:c,markerItems:d,markerItemProps:{onClick:s}={},children:u}=e,[h,g]=(0,i.useState)(),p=(0,i.useCallback)(e=>{g(e),null==o||o(e)},[o]);return(0,i.useImperativeHandle)(t,()=>h,[h]),(0,a.tZ)(z.LoadScript,{googleMapsApiKey:R.JO,children:(0,a.BX)(z.GoogleMap,{id:"clinicLocator--map",zoom:l,options:n,onLoad:p,onCenterChanged:c,mapContainerClassName:"g-map",center:r,children:[null==d?void 0:d.map(e=>(0,a.tZ)(z.Marker,{position:{lat:Number(e.latitude),lng:Number(e.longitude)},onClick:()=>null==s?void 0:s(e)},e.id)),u]})})});var A=n("iBNF"),X=n("R7WV"),F=n("zPX9"),P=n("unQi"),V=n("VZtU"),W=n("o5qa"),G=n("vaps"),H=n("iuhU"),O=n("pK+c"),U=n("jpeG"),j=n("YL+3");let ClinicLocatorSidebarLocation=e=>{var t;let{data:n=[],defaultValue:i="",onChange:l,...o}=e,{formatMessage:r}=(0,b.Z)();return n&&(null==n?void 0:n.length)?(0,a.tZ)(j.A,{...o,value:i,data:[{label:r({id:"clinicLocator.filterAll"}),value:"",type:null==n?void 0:null===(t=n[0])||void 0===t?void 0:t.type},...n],onSelectItem:e=>l(e)}):null};var K=n("nGnw"),Y=n("OAL+"),Q=n("eZo4");let q=(0,i.createContext)({});var J=(0,n("/npG").k)(function(e){let{useMobileLayout:t,backgroundColor:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{resultItem:{padding:(0,h.h)(12),display:"flex",flexDirection:"column",gap:4,...!t&&{[e.fn.largerThan("sm")]:{gap:8,padding:(0,h.h)(16)}}},wrapper:{flexDirection:"column-reverse",...!t&&{[e.fn.largerThan("md")]:{height:"min(800px,70vh)",flexDirection:"row"}}},content:{height:"min(800px,70vh)",position:"relative",...!t&&{[e.fn.largerThan("md")]:{flex:1,minWidth:0,position:"static"}}},sidebar:{width:"100%",backgroundColor:e.colors.neutral50,...!t&&{[e.fn.largerThan("md")]:{width:(0,h.h)(456),overflow:"auto"},[e.fn.largerThan(1500)]:{width:"max(".concat((0,h.h)(456),",25%)")}}},sidebarExtend:{order:3,paddingTop:(0,h.h)(8),paddingInline:(0,h.h)(16),paddingBottom:(0,h.h)(12),...!t&&{[e.fn.largerThan("md")]:{order:1,paddingInline:(0,h.h)(24),paddingTop:(0,h.h)(40),paddingBottom:0}}},sidebarSticky:{order:1,zIndex:1,paddingInline:(0,h.h)(16),paddingBlock:(0,h.h)(8),...!t&&{[e.fn.largerThan("md")]:{order:2,paddingTop:(0,h.h)(16),paddingInline:(0,h.h)(24),paddingBottom:(0,h.h)(12)}}},sidebarSearch:{...!t&&{[e.fn.largerThan("lg")]:{paddingBottom:(0,h.h)(16)}}},countTitle:{gap:(0,h.h)(8),alignItems:"center",...!t&&{[e.fn.largerThan("md")]:{flex:1,minWidth:0}},".mantine-Select-item":{whiteSpace:"nowrap",fontSize:(0,h.h)(14),padding:"10px 16px"}},searchBtn:{...!t&&{[e.fn.largerThan("lg")]:{paddingTop:(0,h.h)(12)}}},sidebarList:{maxWidth:"100%",order:2,display:"flex",gap:(0,h.h)(8),flexDirection:"row",overflow:"auto",paddingBlock:(0,h.h)(8),paddingInline:(0,h.h)(16),...!t&&{[e.fn.largerThan("md")]:{order:3,gap:0,flexDirection:"column",overflow:"hidden",paddingBlock:0,paddingInline:0},[e.fn.largerThan("lg")]:{flex:1,minHeight:0}}},controlBtns:{transform:"translate(0, -50%)",backgroundColor:"#fff",borderRadius:(0,h.h)(4),".zoomBtn":{border:"none",borderRadius:(0,h.h)(4),borderTop:"1px solid ".concat(e.colors.gray100),borderInline:"1px solid ".concat(e.colors.gray100),"+ .zoomBtn":{borderRadius:0},"&:first-child":{borderRadius:"".concat((0,h.h)(4)," ").concat((0,h.h)(4)," 0 0")},"&:last-child":{borderRadius:"0 0 ".concat((0,h.h)(4)," ").concat((0,h.h)(4)),borderBottom:"1px solid ".concat(e.colors.gray100)},".zoomIcon":{width:"70%",height:"70%"},...!t&&{[e.fn.largerThan("sm")]:{width:(0,h.h)(46),height:(0,h.h)(46)}}}},contentWrapper:{position:"relative",maxHeight:"100%",display:"flex",overflow:"auto",flex:1,background:"white",transition:"all .3s ease",[e.fn.smallerThan("sm")]:{padding:"0 16px 16px",gap:(0,h.h)(12)},...!t&&{[e.fn.largerThan("sm")]:{flexDirection:"column",'&[data-opened="false"]':{transform:"translate(-50%, 0)",opacity:0}}}},searchItem:{width:"100%",background:"white",'&[data-selected="true"]':{background:e.colors.blue[0]},[e.fn.smallerThan("sm")]:{border:"1px solid ".concat(e.colors.neutral[1]),borderRadius:(0,h.h)(6)},...!t&&{[e.fn.largerThan("sm")]:{borderBottom:"1px solid ".concat(e.colors.neutral[1])}}},filterSelectRoot:{width:"120px"},filterSelectItem:{fontSize:"14px",padding:"8px 10px"},filterSelectInput:{height:"auto !important",border:0,paddingLeft:0,paddingRight:(0,h.h)(22),":focus":{outline:0,boxShadow:"none"},[e.fn.smallerThan("sm")]:{textAlign:"right"}},filterSelectRightSection:{pointerEvents:"none",width:(0,h.h)(20)},filterSelectDropdown:{...!t&&{[e.fn.largerThan("sm")]:{transform:"translate(-10px, 0)"}}},foundListRoot:{display:"flex",flexDirection:"column",transition:"all .3s ease",...!t&&{[e.fn.largerThan("sm")]:{position:"absolute",zIndex:2,top:(0,h.h)(29),left:(0,h.h)(10),maxHeight:"calc(100% - 53px)",width:(0,h.h)(312),alignItems:"flex-start",'&[data-open="false"]':{pointerEvents:"none"}}},[e.fn.smallerThan("sm")]:{border:"none",transition:"all .3s ease",background:"white"}},foundListWrapper:{padding:"".concat((0,h.h)(8)," ").concat((0,h.h)(16)),[e.fn.smallerThan("sm")]:{'&[data-open="false"]':{borderBottom:"1px solid ".concat(e.colors.neutral[1])}},...!t&&{[e.fn.largerThan("sm")]:{padding:"".concat((0,h.h)(8)," ").concat((0,h.h)(12)),background:"white",borderBottom:"1px solid ".concat(e.colors.neutral[1]),pointerEvents:"initial",width:"100%",'&[data-open="false"]':{width:"auto"}}}},foundListInner:{[e.fn.smallerThan("sm")]:{justifyContent:"space-between"},...!t&&{[e.fn.largerThan("sm")]:{justifyContent:"space-between",'&[data-open="false"]':{justifyContent:"flex-start"}}}},arrowBtn:{cursor:"pointer",...!t&&{[e.fn.largerThan("sm")]:{marginTop:"3px"}}},titleComp:{flex:1,color:e.colors.gray800,fontSize:(0,h.h)(24),fontWeight:700,lineHeight:(0,h.h)(32),letterSpacing:(0,h.h)(-.8),textAlign:"center",paddingTop:(0,h.h)(48),paddingBottom:(0,h.h)(16),...!t&&{[e.fn.largerThan(1112)]:{textAlign:"left",fontSize:(0,h.h)(22),letterSpacing:(0,h.h)(-.6),paddingTop:0,paddingBottom:0}}},viewExpertBtn:{height:"auto",paddingBlock:0,paddingLeft:0,paddingRight:0,marginLeft:"auto",borderRadius:(0,h.h)(8),color:e.colors.primary600,backgroundColor:"transparent !important",".mantine-Button-leftIcon":{marginRight:(0,h.h)(12)},...!t&&{[e.fn.largerThan("md")]:{height:(0,h.h)(48),paddingBlock:(0,h.h)(12),paddingLeft:(0,h.h)(12),paddingRight:(0,h.h)(16),color:"white",backgroundColor:"".concat(n||e.colors.primary600," !important"),"&:hover":{backgroundColor:"".concat(n||e.colors.primary500," !important")}}}}}});let $=(0,i.forwardRef)(function(e,t){let{id:n,name:l,address:o,...r}=e,{isMobile:d}=(0,i.useContext)(q),{classes:s}=J({useMobileLayout:d});return(0,a.BX)(u.x,{className:s.resultItem,ref:t,...r,children:[(0,a.tZ)(c.T,{size:"s3",weight:"semiBold",children:l}),(0,a.tZ)(c.T,{size:"p4",sx:{display:"-webkit-box","-webkit-line-clamp":"3","-webkit-box-orient":"vertical",overflow:"hidden"},children:o})]},n)}),ee=(0,i.forwardRef)((e,t)=>{let{loading:n,data:i,placeholder:l,onClickLeftIcon:r,value:d,icon:s=(0,a.tZ)(V.Z,{color:A.r.colors.gray300,onClick:r}),...u}=e,{formatMessage:p}=(0,b.Z)(),f=p({id:"clinicLocator.inputPlaceholder",defaultMessage:"Search by hospital name"}),m=(0,a.BX)(Y.K,{align:"center",sx:{position:"relative",padding:(0,h.h)(40),width:"100%"},children:[(0,a.tZ)(Q.f,{visible:!!n,sx:()=>({borderRadius:(0,h.h)(20),border:0})}),(0,a.tZ)(g.k,{align:"center",justify:"center",sx:{background:"white",borderRadius:"50%",width:(0,h.h)(120),height:(0,h.h)(120),img:{width:(0,h.h)(80)}},children:(0,a.tZ)("img",{src:K.C.getAssetPath("hospital.png"),alt:"Not found",loading:"lazy"})}),(0,a.tZ)(c.T,{size:"p4",children:p({id:"clinicLocator.notFound",defaultMessage:"No result found. Try another keyword!"})})]});return(0,a.tZ)(o.S,{ref:t,size:"lg",clearable:!0,keepSearch:!0,searchable:!0,withinPortal:!0,limit:20,icon:s,disabled:n,data:i,inputMode:"text",value:d||"",placeholder:l||f,filter:()=>!0,itemComponent:$,rightSection:null,dropdownComponent:e=>{let{children:t}=e;return(0,a.BX)(G.x,{scrollbarSize:8,className:"w-full",children:[t,(0,a.tZ)(Q.f,{visible:!!n,sx:()=>({borderRadius:(0,h.h)(20),border:0})})]})},nothingFound:m,styles:()=>{let e={border:0,padding:0,borderRadius:(0,h.h)(20)};return d&&(i.length||n)||(e.display="none"),{input:{borderRadius:(0,h.h)(8),borderColor:A.r.colors.gray200,fontSize:(0,h.h)(16),lineHeight:1.5,"&[data-with-icon]":{paddingLeft:(0,h.h)(48)}},dropdown:e,item:{borderRadius:0,borderTop:"1px solid ".concat(A.r.colors.neutral100),"&:first-of-type":{borderTop:0}}}},...u})}),ClinicLocatorSidebar=e=>{var t;let{color:n,loading:l,extendComponent:o,clinics:d,clinicSelected:s,onSelectClinic:p,pagination:f=el,searchLoading:m,searchData:v=[],searchValue:w,onChangeSearch:x,onSubmitSearch:y,onItemSubmitSearch:C,filter:k=[],onFilter:T,onChange:L,searchRef:Z}=e,{isMobile:B}=(0,i.useContext)(q),{classes:E}=J({useMobileLayout:B}),{locale:I}=(0,S.h)(),{formatMessage:N}=(0,b.Z)(),_=(0,i.useRef)(null),[M,z]=(0,i.useState)(w||""),[R,D]=(0,i.useState)(!1),[j,K]=(0,i.useState)(!1),Y=(0,i.useMemo)(()=>!m&&l,[l,m]),{title:Q}=(0,i.useMemo)(()=>({title:N({id:"clinicLocator.foundClinics",defaultMessage:"{count} Clinics"},{count:null==f?void 0:f.total_items.toLocaleString(I)})}),[null==f?void 0:f.total_items]),$=(0,i.useMemo)(()=>(null==f?void 0:f.current)<(null==f?void 0:f.last),[null==f?void 0:f.current,null==f?void 0:f.last]),et=(0,i.useMemo)(()=>new IntersectionObserver(function(e){for(let t of e){let{target:e,isIntersecting:n}=t;e===_.current&&n&&$&&(null==L||L("page",f.current+1))}}),[L,null==f?void 0:f.current,$]),en=B?g.k:G.x,ea=(0,i.useCallback)(e=>{null==p||p(e)},[p]),ei=(0,i.useCallback)(e=>{e.includes("-----")||(z(e),null==x||x(e))},[x]),eo=(0,i.useCallback)(e=>{if("Enter"===e.key){let t=e.target.value;null==y||y(t)}},[y]),er=(0,i.useCallback)(e=>{let{value:t,label:n,...a}=e;null==C||C(a)},[C]);return(0,i.useEffect)(()=>{z(w||"")},[w]),(0,i.useEffect)(()=>{if(_.current)return et.observe(_.current),()=>{et.disconnect()}},[et]),(0,a.BX)(en,{className:"ClinicLocatorSidebar--wrapper",...B?{direction:"column"}:{styles:{root:{height:"100%"},thumb:{zIndex:2}},scrollbarSize:6},children:[(0,a.tZ)(g.k,{align:"stretch",gap:(0,h.h)(16),className:"ClinicLocatorSidebar--extends ".concat(E.sidebarExtend),children:o}),(0,a.BX)(u.x,{pos:"sticky",top:0,left:0,right:0,bg:A.r.colors.neutral50,className:(0,H.default)("ClinicLocatorSidebar--sticky items-center relative",{"pt-4":!B},E.sidebarSticky),children:[(0,a.BX)(g.k,{gap:(0,h.h)(8),align:"center",children:[(0,a.tZ)(ee,{ref:Z,data:null===(t=v||[])||void 0===t?void 0:t.map(e=>{let{id:t,name:n}=e;return{...e,value:"-----".concat(t),label:n}}),loading:m&&!Y,value:M,onChange:ei,onItemSubmit:er,onKeyUp:eo,onClickLeftIcon:()=>K(!j),className:(0,H.default)("flex-1 min-w-0 transition-all duration-200",{"opacity-0 pointer-events-none":B&&!j,"opacity-100 pointer-events-auto":B&&j},E.sidebarSearch),sx:()=>({".mantine-Input-icon":{pointerEvents:j?"auto":"none"}})}),(0,a.tZ)(r.B,{onClick:()=>D(!R),leftIcon:R?(0,a.tZ)(O.ok,{className:"text-[24px] text-gray800"}):(0,a.tZ)(U.Z,{className:"text-[24px] text-gray800"}),className:(0,H.default)("ml-auto !w-6 !h-6 !p-0 !bg-[transparent]",{"!block":B,"!hidden":!B})})]}),(0,a.BX)(g.k,{gap:(0,h.h)(8),align:"center",className:(0,H.default)("transition-all duration-200",{"absolute inset-0 z-[1] px-4 opacity-100 pointer-events-none":B&&!j,"absolute inset-0 px-4 opacity-0 pointer-events-none":B&&j},E.searchBtn),children:[!B&&(0,a.tZ)(W.Z,{size:24,color:n||A.r.colors.primary600,className:"block"}),B&&(0,a.tZ)(r.B,{leftIcon:(0,a.tZ)(V.Z,{className:"!text-white"}),className:"!w-8 !h-8 !block pointer-events-auto",sx:()=>({backgroundColor:"".concat(n||A.r.colors.primary600," !important"),svg:{width:(0,h.h)(18),height:(0,h.h)(18),path:{fill:"#fff"}}}),onClick:()=>K(!j)}),(0,a.BX)(g.k,{className:E.countTitle,align:"center",gap:16,children:[(0,a.tZ)(c.T,{size:"s3",fs:(0,h.h)(16),fw:600,lh:(0,h.h)(24),miw:0,sx:{flex:1},children:Q}),(0,a.tZ)(ClinicLocatorSidebarLocation,{data:k,onChange:T,className:"pointer-events-auto"})]})]})]}),(0,a.BX)(u.x,{className:(0,H.default)("clinicLocatorSidebar--body",{"!hidden":B&&!R},E.sidebarList),children:[Y&&(0,a.tZ)(P.fz,{visible:Y,sx:()=>({borderRadius:(0,h.h)(20),border:0})}),!Y&&(null==d?void 0:d.map((e,t)=>{let{id:n,logo:i,name:l,address:o}=e;return(0,a.BX)(g.k,{gap:(0,h.h)(16),sx:()=>({cursor:"pointer"}),className:(0,H.default)("clinicLocatorSidebar--item relative",{"min-w-[280px]":B,"p-3":B,"px-6 py-3":!B,"border-b border-solid border-gray100":!B,"bg-blue50":(null==s?void 0:s.id)===n&&B,"bg-[transparent]":(null==s?void 0:s.id)===n&&!B}),onClick:()=>ea(e),children:[(0,a.tZ)("div",{className:(0,H.default)("absolute bg-primary600 opacity-0 transform ease-linear",{"left-0 bottom-0 w-full h-[2px]":B,"top-0 left-[2px] w-[2px] h-full":!B,"opacity-100":(null==s?void 0:s.id)===n})}),!B&&(0,a.tZ)(u.x,{className:"w-8 h-8",children:(0,a.tZ)(X.I,{width:"100%",height:"100%",src:i,alt:l,className:"object-contain object-center"})}),(0,a.BX)(u.x,{sx:()=>({flex:1,minWidth:0}),children:[(0,a.tZ)(c.T,{size:"s3",weight:"semiBold",children:l}),(0,a.tZ)(c.T,{size:"p4",lineClamp:3,children:o})]})]},"".concat(n,"-").concat(t))})),$&&(0,a.BX)(a.HY,{children:[!m&&!l&&(0,a.tZ)("div",{ref:_,className:"clinicLocatorSidebar__loadmore"}),!l&&(0,a.tZ)(F.L,{})]})]})]})};var et=n("LL/B"),en=n("xrdX"),ea=n("8vDj"),ei=n("CJtR");function SelectedClinicMarker(e){var t,n;let{selectedClinic:l,hideBooking:o}=e,{formatMessage:r}=(0,b.Z)(),d=(0,ea.rZ)(),{dataEventCategory:s}=(0,i.useContext)(q),[p,f]=(0,i.useState)(),{locale:m}=(0,S.h)(),v=et.C.includes(m)?(0,ei.D4)({id:l.id,name:l.name,locale:m,slug:l.slug}):null,w=l.totalAvailableDoctors&&l.totalAvailableServices?{label:r({id:"articleAuthor.button",defaultMessage:"Book now"}),url:v}:l.totalAvailableDoctors?{label:r({id:"articleAuthor.button",defaultMessage:"Book now"}),url:"".concat(v,"?tab=").concat(null===(t=T.a8[m])||void 0===t?void 0:t.DOCTOR)}:l.totalAvailableServices?{label:r({id:"articleAuthor.button",defaultMessage:"Book now"}),url:"".concat(v,"?tab=").concat(null===(n=T.a8[m])||void 0===n?void 0:n.SERVICE)}:{label:r({id:"articlePage.careEmbedding.viewDetail"}),url:v};return(0,a.BX)(a.HY,{children:[(0,a.tZ)(z.Marker,{position:{lat:Number(l.latitude),lng:Number(l.longitude)},onLoad:f}),p&&(0,a.tZ)(z.InfoWindow,{anchor:p,options:{minWidth:320,maxWidth:320},children:(0,a.BX)(Y.K,{spacing:(0,h.h)(4),children:[l.logo?(0,a.tZ)("div",{children:(0,a.tZ)("img",{loading:"lazy",src:l.logo,alt:l.name,width:"auto",height:48})}):null,(0,a.BX)(Y.K,{spacing:(0,h.h)(4),children:[(0,a.tZ)(c.T,{size:"s4",weight:"semiBold",children:l.name}),(0,a.tZ)(c.T,{size:"n1",children:l.address}),!o&&(l.totalAvailableDoctors||l.totalAvailableServices)?(0,a.BX)(c.T,{size:"n1",children:[r({id:"clinicLocator.infoWindow.availableForBooking",defaultMessage:"Available for booking"}),": ",(0,a.BX)(u.x,{component:"span",sx:e=>({span:{display:"inline-block"},"span + span":{position:"relative",marginLeft:(0,h.h)(5),paddingLeft:(0,h.h)(5),"&:before":{content:'""',width:(0,h.h)(2),height:(0,h.h)(2),borderRadius:"50%",background:e.colors.gray[6],position:"absolute",left:"0",top:"50%"}}}),children:[l.totalAvailableDoctors>0&&(0,a.tZ)("span",{children:l.totalAvailableDoctors?r({id:"clinicLocator.infoWindow.availableDoctors"}):""}),l.totalAvailableServices>0&&(0,a.tZ)("span",{children:(0,a.tZ)("span",{children:l.totalAvailableServices?r({id:"clinicLocator.infoWindow.availableServices"}):""})})]})]}):null,(!o&&w.url||l.websiteUrl)&&(0,a.BX)(g.k,{align:"center",gap:16,sx:{"a:focus-visible":{outline:"none"}},children:[!o&&w.url&&(0,a.tZ)(u.x,{component:"a",href:w.url,target:"_blank",className:"pointer-event-child-none","data-event-category":s,"data-event-action":"Book Doctor via Clinic Click","data-event-label":"https://".concat(en.v[m]).concat(w.url),children:(0,a.tZ)(c.T,{size:"n1",sx:{color:d.colors.blue[8],textDecoration:"underline",textUnderlineOffset:(0,h.h)(4)},children:w.label})}),l.websiteUrl&&(0,a.tZ)(u.x,{component:"a",href:l.websiteUrl,target:"_blank",className:"pointer-event-child-none","data-event-category":s,"data-event-action":"Clinic Directory - Go to Hospital Page","data-event-label":l.websiteUrl,children:(0,a.tZ)(c.T,{size:"n1",sx:{color:d.colors.blue[8],textDecoration:"underline",textUnderlineOffset:(0,h.h)(4)},children:r({id:"clinicLocator.infoWindow.websiteUrl",defaultMessage:"Go to hospital page"})})})]})]})]})},l.id)]})}let el={current:1,first:1,last:1,next:1,prev:1,total_items:0,items_per_page:20};var clinicLocator=e=>{var t,n;let{title:l,specialties:v=[],specialties_hashtag:T,defaultColor:L,hideBooking:N,onGetBrowserLoc:_,infoPath:z,useMobileLayout:R,dataEventCategory:A="Service Connection",...X}=e,{formatMessage:F}=(0,b.Z)(),{classes:P}=J({useMobileLayout:R}),{locale:V}=(0,S.h)(),W=(0,k.d)(!0),G=(0,C.U)(),H=(0,i.useRef)(),O=(0,i.useRef)(null),U=(0,i.useRef)(null),j=(0,i.useRef)(null),K=function(e){let{specialties:t}=e,n={type:"hospital",allowSearchInDistrict:1,showDistricts:1};return t.length&&(n.specialtyIds=t.join(",")),n}({specialties:v}),[Y,Q]=(0,i.useState)(K),[$,ee]=(0,i.useState)(!1),[et,en]=(0,i.useState)([]),[ea,ei]=(0,i.useState)([]),[er,ec]=(0,i.useState)([]),[ed,es]=(0,i.useState)(!1),[eu,eh]=(0,i.useState)(!1),[eg,ep]=(0,i.useState)(!1),{loading:ef,fetchClinics:em}=function(e){let{infoPath:t}=e,[n,a]=(0,i.useState)(!1),l=(0,i.useCallback)(async e=>{a(!0);try{let n=await (0,B.d)(I.y.CARE.GET_SEARCH_CARE,{params:e},"careV2"),{_data:a}=n||{};if(!a)throw Error(JSON.stringify(n));let{searches:i}=a||{};return{data:{...a,searches:i.map(e=>{let n={...e};return t&&(n.name=Z()(e,t,e.name)),(0,E.ZL)(n)})},errors:[]}}catch(e){return{data:null,errors:[]}}finally{a(!1)}},[t]);return(0,i.useMemo)(()=>({loading:n,setLoading:a,fetchClinics:l}),[n,a,l])}({infoPath:z}),appendClinics=e=>{ec(t=>{let n=[...t,...e],a=n.reduce((e,t)=>(e[t.id]=t,e),{});return Object.values(a)})},[ev,eb]=(0,i.useState)(el),[ew,ex]=(0,i.useState)(null),[ey,eC]=(0,i.useState)(null),[ek,eS]=(0,i.useState)(),[eT,eL]=(0,i.useState)(""),eZ=M[V],{title:eB,viewExpertsBtn:eE}=(0,i.useMemo)(()=>({title:l||F({id:"section.clinicLocator.title",defaultMessage:"Explore the best Clinics for yourself"}),viewExpertsBtn:F({id:"section.clinicLocator.viewExpertsBtn",defaultMessage:"View Experts"})}),[F,l]),eI=(0,i.useMemo)(()=>(0,a.tZ)(TitleComp,{title:eB}),[eB]),eN=(0,i.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(0==e.length)return!1;if(O.current){let t=new window.google.maps.LatLngBounds;if(null==e||e.forEach(e=>{t.extend(new window.google.maps.LatLng(e.latitude,e.longitude))}),t.getNorthEast().equals(t.getSouthWest())){let e=new google.maps.LatLng(t.getNorthEast().lat()+.005,t.getNorthEast().lng()+.005),n=new google.maps.LatLng(t.getNorthEast().lat()-.005,t.getNorthEast().lng()-.005);t.extend(e),t.extend(n)}O.current.fitBounds(t)}},[]);function formatFilterData(e){let{cities:t=[],districts:n=[]}=e,a=n.length?n.map(e=>({label:e.name,value:e.id,type:"district"})):t.length?t.map(e=>({label:e.name,value:e.id,type:"city"})):[];return a}let handleReset=async e=>{var t;let{data:n}=await em({...K,...e}),{searches:a,districts:i,cities:l,pagination:o}=n||{};eC({filter:sanitizeDuplicateFilterId(null==ey?void 0:null===(t=ey.filter)||void 0===t?void 0:t.concat(formatFilterData({cities:l,districts:i}))),initialClinics:a,initialPagination:o||el})},handleFetch=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a={...K,...e&&{latitude:e.lat,longitude:e.lng,...t&&{distance:5}}};Q(a);try{let{data:e}=await em(a),{searches:t,districts:i,cities:l,pagination:o}=e||{};ec(t||[]),eC(e=>{var n,a;return{...e,initialClinics:t,initialPagination:o||el,filter:sanitizeDuplicateFilterId(null===(a=(null==ey?void 0:ey.filter)||[])||void 0===a?void 0:null===(n=a.concat(formatFilterData({cities:l,districts:i})))||void 0===n?void 0:n.concat((null==e?void 0:e.filter)||[]))}}),n&&setTimeout(()=>{ep(n)},1e3)}catch(e){console.error(e)}},handleFilter=async e=>{let t=null==e?void 0:e.type,n=null==e?void 0:e.value,a={...Y,..."district"===t?{districtId:n}:"city"===t?{cityId:n}:{}};n||(delete a.cityId,delete a.districtId,delete a.distance),Q(a);try{let{data:e}=await em(a),{searches:t,pagination:n}=e||{};ec(t||[]),eC(e=>({...e,initialClinics:t,initialPagination:n||el}))}catch(e){console.error(e)}},handleSearch=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={...Y,keyword:e};if(eL(e),Q(n),!e){handleReset({keyword:e});return}$||(null==e?void 0:e.length)<3&&!t||(H.current&&clearTimeout(H.current),H.current=setTimeout(async()=>{ee(!0);try{var e;let{data:t}=await em(n),{searches:a,districts:i,cities:l,pagination:o}=t,r=sanitizeDuplicateFilterId(((null==ey?void 0:ey.filter)||[]).concat(formatFilterData({cities:l,districts:i})));ex(null),en(a),ei(r),eb(o||el),null===(e=U.current)||void 0===e||e.focus()}catch(e){console.error(e)}ee(!1),setTimeout(()=>{var e;return null===(e=U.current)||void 0===e?void 0:e.focus()},0)},250))},handleChange=async(e,t)=>{if($)return;let n={...Y,[e]:t};H.current&&clearTimeout(H.current),H.current=setTimeout(async()=>{var e,t;ee(!0);let{data:a}=await em(n),{searches:i,pagination:l,districts:o,cities:r}=a,c=function(e){if(!e||!e.length)return[];let t=[...e],n=Array.from(new Set(t.map(e=>e.id))).map(e=>t.find(t=>t.id===e));return n.filter(Boolean)}(null===(e=(null==ey?void 0:ey.initialClinics)||[])||void 0===e?void 0:e.concat(i)),d=sanitizeDuplicateFilterId(null===(t=(null==ey?void 0:ey.filter)||[])||void 0===t?void 0:t.concat(formatFilterData({cities:r,districts:o})));ec(c),eC(e=>({...e,initialClinics:c,initialPagination:l||el,filter:d})),ee(!1)},250)},handleMarkerClick=async function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(ex(e),t&&eL(""),en([]),O.current){let t=new window.google.maps.LatLngBounds;if(t.extend(new window.google.maps.LatLng(e.latitude,e.longitude)),t.getNorthEast().equals(t.getSouthWest())){let e=new google.maps.LatLng(t.getNorthEast().lat()+.01,t.getNorthEast().lng()+.01),n=new google.maps.LatLng(t.getNorthEast().lat()-.01,t.getNorthEast().lng()-.01);t.extend(e),t.extend(n)}O.current.fitBounds(t)}if(!ey){ec([e]);let{data:t}=await em({type:"hospital",latitude:e.latitude,longitude:e.longitude,distance:5,perPage:50,showDistricts:0}),{searches:n}=t;appendClinics(n)}},getCurrentLocation=()=>{if(!eg){if(!navigator.geolocation)return console.log("Geolocation is not supported by this browser."),null;es(!0),navigator.geolocation.getCurrentPosition(e=>{es(!1),handleFetch({lat:e.coords.latitude.toFixed(8),lng:e.coords.longitude.toFixed(8)},!0,!0),eS({lat:e.coords.latitude,lng:e.coords.longitude}),null==_||_({lat:e.coords.latitude,lng:e.coords.longitude})},e=>(console.log("Error getting user location",e),es(!1),1===e.code&&eh(!0),null))}},e_=(0,i.useCallback)(e=>()=>{var t,n;let a=(null===(t=O.current)||void 0===t?void 0:t.getZoom())||15;null===(n=O.current)||void 0===n||n.setZoom(a+e)},[null===(t=O.current)||void 0===t?void 0:t.getZoom,null===(n=O.current)||void 0===n?void 0:n.setZoom]);(0,i.useEffect)(()=>{O.current&&ey&&(((null==ey?void 0:ey.initialClinics)||[]).length>0?eN(ey.initialClinics):ek&&O.current.setCenter(ek))},[ey]),(0,i.useEffect)(()=>{if(O.current&&ek){let e=new window.google.maps.LatLngBounds;if(e.extend(new window.google.maps.LatLng(ek.lat,ek.lng)),e.getNorthEast().equals(e.getSouthWest())){let t=new google.maps.LatLng(e.getNorthEast().lat()+.01,e.getNorthEast().lng()+.01),n=new google.maps.LatLng(e.getNorthEast().lat()-.01,e.getNorthEast().lng()-.01);e.extend(t),e.extend(n)}O.current.fitBounds(e)}},[ek]),(0,i.useEffect)(()=>{if(eu){let e=setTimeout(()=>{eh(!1)},3e3);return()=>clearTimeout(e)}},[eu]);let eM=W||R;return(0,a.tZ)(q.Provider,{value:{isMobile:eM,dataEventCategory:A},children:(0,a.BX)(eo,{ref:j,...X,children:[eM&&(0,a.tZ)(w.W,{className:"map-hhg-container",children:eI}),(0,a.tZ)(u.x,{sx:{position:"relative",backgroundColor:"#fff",".gm-style":{img:{maxHeight:"none !important",maxWidth:"100%",objectFit:"contain"},".gm-style-iw-c":{padding:(0,h.h)(12),borderRadius:(0,h.h)(16),boxShadow:"0px 0px 1px 0px rgba(0, 0, 0, 0.04), 0px 0px 2px 0px rgba(0, 0, 0, 0.06), 0px 4px 8px 0px rgba(0, 0, 0, 0.04)"},".gm-style-iw > button":{right:"0 !important",top:"0 !important"}}},children:(0,a.BX)(g.k,{className:P.wrapper,pos:"relative",children:[(0,a.tZ)(g.k,{id:"clinicLocator--sidebar",direction:"column",mah:"100%",className:P.sidebar,children:(0,a.tZ)(ClinicLocatorSidebar,{color:L,loading:ef,extendComponent:(0,a.BX)(a.HY,{children:[!eM&&eI,(0,a.tZ)(ButtonComp,{buttonText:eE,backgroundColor:L,specialties_hashtag:T,currentUrl:G})]}),clinics:null==ey?void 0:ey.initialClinics,pagination:null==ey?void 0:ey.initialPagination,clinicSelected:ew,onSelectClinic:e=>{var t,n;handleMarkerClick(e,!1),null===(t=(n=window).gtag)||void 0===t||t.call(n,"event","interaction_click",{event_category:A,event_action:"Clinic Directory Click",event_label:G,hospital_id:e.id,click_location:"list"}),setTimeout(()=>{var e;null===(e=document.getElementById("clinicLocator--content"))||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},100)},searchLoading:$,searchValue:eT,searchData:et||[],onChangeSearch:handleSearch,onItemSubmitSearch:e=>{var t,n,a,i,l;let o={...Y};delete o.keyword,eL(""),Q(o),appendClinics([e]),handleMarkerClick(e),null===(t=U.current)||void 0===t||t.blur(),null===(n=(a=window).gtag)||void 0===n||n.call(a,"event","view_search_results",{event_category:A,event_action:"Clinic Directory",event_label:G,search_term:eT,search_result_shown:((et||[]).length>0).toString()}),null===(i=(l=window).gtag)||void 0===i||i.call(l,"event","interaction_click",{event_category:A,event_action:"Clinic Directory Click",event_label:G,hospital_id:e.id,click_location:"search box"})},onSubmitSearch:e=>{var t,n;if(null==et?void 0:et.length){let t={...Y,keyword:e};eL(e),Q(t),en([]),ec(et),setTimeout(()=>{var e,t;eC({filter:sanitizeDuplicateFilterId(null===(e=(null==ey?void 0:ey.filter)||[])||void 0===e?void 0:e.concat(ea)),initialClinics:et,initialPagination:ev}),null==U||null===(t=U.current)||void 0===t||t.blur()},200),eM&&(null==j?void 0:j.current)&&window.scrollTo({top:j.current.offsetTop+j.current.clientHeight+64-window.outerHeight,behavior:"smooth"})}null===(t=(n=window).gtag)||void 0===t||t.call(n,"event","view_search_results",{event_category:A,event_action:"Clinic Directory",event_label:G,search_term:eT,search_result_shown:((et||[]).length>0).toString()})},filter:null==ey?void 0:ey.filter,onFilter:handleFilter,onChange:$?void 0:handleChange,searchRef:U,queryParams:Y,onUpdateDisplayClinics:appendClinics})}),(0,a.BX)(u.x,{id:"clinicLocator--content",className:P.content,children:[(0,a.tZ)(D,{ref:O,onLoad:e=>{var t,n;let a=null===(t=e.getCenter())||void 0===t?void 0:t.lat(),i=null===(n=e.getCenter())||void 0===n?void 0:n.lng();if(a&&i){let e=(null==eZ?void 0:eZ.lat)===a&&(null==eZ?void 0:eZ.lng)===i,t={lat:a,lng:i};eS(t),handleFetch(t,!e)}},zoom:13,center:ek||eZ,onCenterChanged:()=>ep(!1),markerItems:er,markerItemProps:{onClick(e){var t,n;handleMarkerClick(e),null===(t=(n=window).gtag)||void 0===t||t.call(n,"event","interaction_click",{event_category:A,event_action:"Clinic Directory Click",event_label:G,hospital_id:e.id,click_location:"map"})}},children:ew&&(0,a.tZ)(SelectedClinicMarker,{selectedClinic:ew,hideBooking:N})}),(0,a.BX)(g.k,{direction:"column",gap:0,pos:"absolute",top:"50%",right:(0,h.h)(16),className:P.controlBtns,children:[(0,a.tZ)(p.u,{label:F({id:"clinicLocator.zoomOutToViewMore"}),position:"left",withArrow:!0,children:(0,a.tZ)(f.A,{variant:"default",className:"zoomBtn",onClick:()=>{eN(er)},children:(0,a.tZ)(y.Z,{className:"zoomIcon"})})}),(0,a.tZ)(f.A,{variant:"default",className:"zoomBtn",onClick:e_(1),children:(0,a.tZ)(d.Z,{className:"zoomIcon"})}),(0,a.tZ)(f.A,{variant:"default",className:"zoomBtn",onClick:e_(-1),children:(0,a.tZ)(s.Z,{className:"zoomIcon"})})]}),(0,a.tZ)(g.k,{pos:"absolute",left:"50%",bottom:(0,h.h)(16),sx:()=>({zIndex:0,transform:"translate(-50%, 0)"}),children:(0,a.BX)(o.o,{position:"top",withArrow:!0,arrowPosition:"center",shadow:"md",opened:eu,onChange:eh,positionDependencies:["isMobile"],children:[(0,a.tZ)(o.o.Target,{children:(0,a.tZ)(r.B,{className:"pointer-event-child-none",styles:e=>({root:{...L&&{background:"".concat(L,"!important"),"&:hover":{background:"".concat(e.fn.darken(L,.05))}},"&[data-loading]":{"&:before":{background:"transparent"}}},leftIcon:{display:"none"}}),onClick:()=>getCurrentLocation(),loading:ed,rightIcon:ed?(0,a.tZ)(m.a,{color:"#fff",size:"xs"}):(0,a.tZ)(x.Z,{color:"#fff",size:18}),"data-event-category":A,"data-event-action":"Find The Nearest Clinic","data-event-label":G,children:F({id:"clinicLocator.findNearClinic",defaultMessage:"Find your nearest Clinic"})})}),(0,a.tZ)(o.o.Dropdown,{style:{pointerEvents:"none"},children:(0,a.tZ)(c.T,{size:"xs",children:F({id:"clinicLocator.plsAllowAccess",defaultMessage:"Please allow location access"})})})]})})]})]})})]})})};let TitleComp=e=>{let{title:t}=e,{isMobile:n}=(0,i.useContext)(q),{classes:l,cx:o}=J({useMobileLayout:n});return(0,a.tZ)(c.T,{as:"h2",miw:0,fs:(0,h.h)(22),className:o("map-header",l.titleComp),children:t})},ButtonComp=e=>{let{buttonText:t,backgroundColor:n,specialties_hashtag:l,currentUrl:o}=e,{isMobile:c,dataEventCategory:d}=(0,i.useContext)(q),{classes:s}=J({backgroundColor:n,useMobileLayout:c}),u=(0,i.useMemo)(()=>{if(!l)return null;let e=document.getElementById("#".concat(l.replace(/\#/g,"")));if(!e)return null;let n={"data-event-category":d,"data-event-action":"CLick - View experts","data-event-label":"".concat(o).concat(l?"".concat(l):"")};return(0,a.tZ)(r.B,{...n,className:s.viewExpertBtn,size:"lg",variant:"primary",onClick:()=>{e.scrollIntoView({behavior:"smooth",inline:"center",block:"center"})},leftIcon:(0,a.tZ)(v.E,{w:(0,h.h)(24),h:(0,h.h)(24),src:"".concat(T.uQ,"/clinic.svg"),alt:t}),children:t})},[l,t]);return u},eo=(0,l.Z)("div",{target:"eaw7sr10"})("display:flex;flex-direction:column;.g-map{width:100%;height:100%;}")},"7a+s":function(e,t,n){n.d(t,{S:function(){return ClinicLocatorEmbedCard}});var a=n("BGKE"),i=n("wp0n"),l=n("8vDj"),o=n("OAL+"),r=n("Vvt1"),c=n.n(r);let d=c()(()=>Promise.all([n.e(1255),n.e(4846),n.e(2233),n.e(1058),n.e(3295),n.e(1538),n.e(7152),n.e(5684),n.e(2574),n.e(9884),n.e(7644),n.e(6962),n.e(8767),n.e(6638),n.e(7741),n.e(3434),n.e(2433),n.e(5385),n.e(3564),n.e(7082),n.e(3158),n.e(5641),n.e(7454),n.e(7004),n.e(4758),n.e(6219),n.e(17),n.e(8990),n.e(4067),n.e(9487),n.e(9083),n.e(1520),n.e(270),n.e(7596),n.e(8217),n.e(7543),n.e(2835),n.e(2507),n.e(6885),n.e(7859),n.e(690),n.e(2730),n.e(6287),n.e(7682),n.e(1551),n.e(4870),n.e(9922),n.e(3133),n.e(612),n.e(2002),n.e(1880),n.e(7471),n.e(7165),n.e(5451),n.e(8612),n.e(2819),n.e(7695)]).then(n.bind(n,"a7TI")).then(e=>e.default),{loadableGenerated:{webpack:()=>["a7TI"]},ssr:!1}),ClinicLocatorEmbedCard=e=>{let{title:t,description:n,specialties:r,color:c,dataEventCategory:s}=e,u=(0,l.rZ)();return(0,a.BX)(o.K,{spacing:16,sx:e=>({".map-hhg-container":{display:"none"},[e.fn.largerThan("sm")]:{"#clinicLocator--content":{height:400}}}),children:[(t||n)&&(0,a.BX)(o.K,{spacing:8,children:[t&&(0,a.tZ)(i.T,{size:"h3",variant:"primary",children:t}),n&&(0,a.tZ)(i.T,{size:"p1",children:n})]}),(0,a.tZ)(d,{useMobileLayout:!0,className:"locator-map",specialties:r,defaultColor:c||u.fn.primaryColor(),dataEventCategory:s})]})}}}]);