"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5238],{MyPT:function(e,t,r){r.d(t,{CT:function(){return fetchEmbeddingDoctorsForSession},oQ:function(){return p},pA:function(){return shouldFetchRemainingEmbeddingDoctors}});var o=r("TYy9"),l=r.n(o),i=r("xweI"),a=r.n(i),n=r("qPyV"),s=r.n(n),c=r("09QT"),d=r("/tR3"),h=r("J3uC"),u=r("oQBk");let p=4,mapTopServiceDoctors=e=>{var t;let r=null==e?void 0:null===(t=e._data)||void 0===t?void 0:t.top_services;return r?a()(l()((0,h.PE)(r).serviceList.map(e=>e.services)),["position"],"asc"):[]},mapSearchCareDoctors=e=>{var t;return a()(((null==e?void 0:null===(t=e._data)||void 0===t?void 0:t.searches)||[]).map(d.XR),["position"],"asc")},getSearchCareParams=(e,t)=>{let{page:r,perPage:o}=t,{embebIds:l,typeEmbedding:i,allDoctors:a}=e;return{type:"doctor",skipBooking:1,page:r,perPage:o,...!a&&{..."doctors"===i&&{doctorIds:l.join(",")},..."specialties"===i&&l.length>0&&{specialtyId:l.join(",")}}}},fetchSearchCareDoctorsPage=async(e,t)=>{let r=await (0,c.d)(u.y.CARE.GET_SEARCH_CARE,{params:getSearchCareParams(e,t)},"careV2");return mapSearchCareDoctors(r)},fetchSearchCareDoctorsFull=async e=>{let t=await Promise.all(Array.from({length:5},(t,r)=>fetchSearchCareDoctorsPage(e,{page:r+1,perPage:60}))),r=l()(t);return a()(s()(r,e=>e.id),["position"],"asc")},fetchEmbeddingDoctorsForSession=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{embebIds:r,typeEmbedding:o,allDoctors:l}=e,{limit:i}=t;if("top_service"===o){if(0===(r||[]).length)return[];let e=await (0,c.d)(u.y.CARE.GET_TOP_SERVICES,{params:{categoryIds:r.join(",")}},"care"),t=mapTopServiceDoctors(e);return i?t.slice(0,i):t}return("doctors"===o||"specialties"===o)&&(l||0!==(r||[]).length)?i?fetchSearchCareDoctorsPage(e,{page:1,perPage:i}):fetchSearchCareDoctorsFull(e):[]},shouldFetchRemainingEmbeddingDoctors=e=>e===p},pSVL:function(e,t,r){r.d(t,{Z:function(){return eN}});var o=r("BGKE"),l=r("q1tI"),i=r("2451"),a=r("/kWL"),n=r("r9m4"),s=r("8vDj"),c=r("Eso5"),d=r("mYVa"),h=r("OAL+"),u=r("SPK5"),p=r("dDsW"),g=r("gHFm"),m=r("iv2E"),f=r("hXNO"),v=r("P5LW"),x=r("rIrU"),b=r("TaKJ"),C=r("TfUb"),y=r("m42D"),S=r("0e15"),w=r("pUA5"),Z=r("vaps"),k=r("ChHM");let getCarePathDoctorListFilterInteractiveStyles=(e,t)=>{let r=(null==t?void 0:t.filterColor)?"transparent":e.colors.neutral[2],o=(null==t?void 0:t.filterColor)?"rgba(255, 255, 255, 0.65)":e.colors.blue[3],l=(null==t?void 0:t.filterColor)?"0 0 6px 1px rgba(255, 255, 255, 0.35)":"0 0 6px 1px ".concat(e.fn.rgba(e.colors.blue[5],.3)),i=(null==t?void 0:t.filterColor)?"0 0 0 1px rgba(255, 255, 255, 0.55), 0 0 12px 3px ".concat(e.fn.rgba(e.white,.3)):"0 0 0 1px ".concat(e.fn.rgba(e.colors.blue[4],.45),", 0 0 12px 4px ").concat(e.fn.rgba(e.colors.blue[5],.35));return{transition:"box-shadow 200ms ease, border-color 200ms ease","&:hover:not(:focus):not(:focus-visible)":{borderColor:r,boxShadow:l},"&:focus":{borderColor:o,outline:"none",boxShadow:i},"&:focus-visible":{borderColor:o,outline:"none",boxShadow:i}}},getCarePathDoctorListDefaultFilterWidthSx=e=>({width:"100%",[e.fn.largerThan("sm")]:{width:(0,d.h)(250),flexShrink:0}}),P={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:(0,d.h)(32),height:(0,d.h)(32),borderRadius:9999,backgroundColor:C.t.neutral[0],overflow:"hidden",lineHeight:0},renderOptionIcon=e=>{if(!e)return null;if("string"==typeof e)return(0,o.tZ)(c.x,{sx:P,children:(0,o.tZ)(c.x,{component:"img",src:e,alt:"",sx:{width:(0,d.h)(20),height:(0,d.h)(20),objectFit:"contain"}})});if((0,l.isValidElement)(e)){var t;return(0,o.tZ)(c.x,{sx:P,children:(0,l.cloneElement)(e,{size:null!==(t=e.props.size)&&void 0!==t?t:20})})}return(0,o.tZ)(c.x,{sx:P,children:(0,o.tZ)(e,{size:20,color:"#111111"})})},D=(0,l.forwardRef)((e,t)=>{let{value:r,onChange:i,filterOpts:n,filterColor:h,filterIcon:g=S.Z,layout:m="default",placeholder:f,optionDataEventCategory:v,optionDataEventAction:x}=e,{formatMessage:b}=(0,p.Z)(),[P,D]=(0,l.useState)(!1),T=(0,s.rZ)(),I=(0,k.O)(()=>D(!1)),L="iconOnly"===m,B=null!==r&&"all"!==r,A=L&&B?"#111":h?"#fff":"#111",N=null!=f?f:b({id:"carePathDoctorList.placeholderSearchCity"}),F=(0,l.useMemo)(()=>{var e;return null===(e=n.find(e=>e.value===r))||void 0===e?void 0:e.label},[n,r]),M=F||N;return(0,l.useImperativeHandle)(t,()=>({openFilter:()=>D(!0)})),(0,o.BX)(c.x,{ref:I,sx:{position:"relative",userSelect:"none",width:L?"auto":"100%"},children:[(0,o.tZ)(u.k,{align:"center",justify:L?"center":"space-between",onClick:()=>D(e=>!e),sx:e=>({position:"relative",boxSizing:"border-box",padding:L?0:"0 ".concat((0,d.h)(12)),backgroundColor:"#fff",borderRadius:8,border:"1px solid ".concat(h?"transparent":e.colors.neutral[2]),cursor:"pointer",gap:8,...getCarePathDoctorListFilterInteractiveStyles(e,{filterColor:h}),...L?{width:(0,d.h)(48),height:(0,d.h)(48),flexShrink:0}:{width:"100%",height:(0,d.h)(48)},...h&&{backgroundColor:h,color:"#fff"},...L&&B&&{backgroundColor:"#E4E8EC"}}),"aria-label":L?M:void 0,children:L?(0,o.BX)(o.HY,{children:[(0,o.tZ)(g,{size:20,color:A}),B&&(0,o.tZ)(c.x,{"aria-hidden":!0,sx:{position:"absolute",top:(0,d.h)(6),right:(0,d.h)(6),width:(0,d.h)(8),height:(0,d.h)(8),borderRadius:"50%",backgroundColor:C.t.red[6],pointerEvents:"none"}})]}):(0,o.BX)(o.HY,{children:[(0,o.BX)(u.k,{gap:(0,d.h)(8),align:"center",children:[(0,o.tZ)(g,{size:24,color:A}),(0,o.tZ)(a.T,{size:"p2",variant:"primary",children:M})]}),(0,o.tZ)(w.Z,{size:24,color:h?"#fff":"#111"})]})}),(0,o.tZ)(c.x,{sx:{display:P?"block":"none",position:"absolute",top:"calc(100% + ".concat((0,d.h)(4),")"),right:L?0:void 0,zIndex:1,minWidth:250},children:(0,o.tZ)(c.x,{sx:e=>({width:"100%",background:"#fff",border:"1px solid ".concat(e.colors.gray[1]),borderRadius:8,padding:(0,d.h)(2),boxShadow:"0px 0px 1px 0px #0000000A, 0px 4px 8px 0px #0000000A, 0px 16px 24px 0px #0000000A, 0px 24px 32px 0px #0000000A"}),children:(0,o.tZ)(Z.x.Autosize,{mah:320,type:"auto",scrollbarSize:8,sx:{thumb:{backgroundColor:T.colors.gray[2]}},children:n.map((e,t)=>{let l=e.value===r;return(0,o.BX)(u.k,{justify:"space-between",...v&&x?{"data-event-category":v,"data-event-action":x,"data-event-label":e.label}:{},sx:t=>({padding:e.icon?8:"".concat((0,d.h)(8)," ").concat((0,d.h)(16)),"&:hover":{background:t.colors.gray[1]},...l?{"&,&:hover":{backgroundColor:"#d5f1f1"}}:{cursor:"pointer"}}),onClick:()=>{i(e.value),D(!1)},children:[(0,o.BX)(u.k,{align:"center",gap:(0,d.h)(8),sx:{minWidth:0},children:[renderOptionIcon(e.icon),(0,o.tZ)(a.T,{size:"p2",children:e.label})]}),l&&(0,o.tZ)(y.Z,{size:18,color:T.colors.blue[6]})]},String(t))})})})})]})}),getDoctorHospital=e=>{if("hospital"in e)return e.hospital},getDoctorCityId=e=>{var t;let r=null===(t=getDoctorHospital(e))||void 0===t?void 0:t.cityId;return null==r?null:String(r)},getDoctorCityName=e=>{var t;let r=null===(t=getDoctorHospital(e))||void 0===t?void 0:t.cityName.trim();return r||null},groupDoctorsByCityId=e=>{let t=new Map;return e.forEach(e=>{let r=getDoctorCityId(e);if(!r)return;let o=getDoctorCityName(e),l=t.get(r);if(l){l.doctors.push(e),!l.group.name&&o&&(l.group.name=o);return}t.set(r,{group:{id:r,name:o||r},doctors:[e]})}),Array.from(t.values())},filterCarePathDoctorListByCity=(e,t)=>{let r=null===t||"all"===t;if(r)return e;let o=groupDoctorsByCityId(e);return o.filter(e=>e.group.id===t).reduce((e,t)=>e.concat(t.doctors),[])},T=(0,l.memo)((0,l.forwardRef)((e,t)=>{let{listingAll:r,selectedFilterId:i,filterColor:a,onFilterChange:n}=e,{formatMessage:s}=(0,p.Z)(),c=(0,f.d)(),d=(0,l.useRef)(null),[h,u]=(0,l.useState)(null!=i?i:null);(0,l.useEffect)(()=>{u(null!=i?i:null)},[i]);let g=(0,l.useMemo)(()=>groupDoctorsByCityId(r),[r]);(0,l.useImperativeHandle)(t,()=>({setDoctorsSelectedFilterId:e=>u(e),openFilter:()=>{var e;return null===(e=d.current)||void 0===e?void 0:e.openFilter()}})),(0,l.useEffect)(()=>{let e=null===h||"all"===h;n({filterValue:h,isAllCitiesSelected:e})},[h,n]);let m=(0,l.useMemo)(()=>[{label:s({id:"keyword.all"}),value:"all"},...g.map(e=>({label:e.group.name,value:e.group.id}))],[s,g]);return m.length<=1?null:(0,o.tZ)(D,{ref:d,value:h,onChange:u,filterOpts:m,filterColor:a,filterIcon:b.Z,layout:c?"iconOnly":"default",optionDataEventCategory:"Service Connection",optionDataEventAction:"Filter Location Click"})}));var I=r("FNss"),L=r("q9DY"),B=r("lSJj"),A=r("c9pU");let normalizeForSearch=e=>(0,A.T)(e).replace(/-/g," ").replace(/\s+/g," ").trim(),textIncludesKeyword=(e,t)=>null!=e&&!!e.trim()&&!!t&&normalizeForSearch(e).includes(t),itemMatchesKeyword=(e,t)=>{var r;if("name"in e&&textIncludesKeyword(e.name,t))return!0;if("hospital"in e&&e.hospital){let r=e.hospital,o="object"==typeof r&&"name"in r?r.name:"string"==typeof r?r:"";if(textIncludesKeyword(o,t))return!0}return!!("specialtiesTransform"in e&&(null===(r=e.specialtiesTransform)||void 0===r?void 0:r.some(e=>textIncludesKeyword(e.slug,t))))},filterCarePathDoctorListByKeyword=(e,t)=>{let r=normalizeForSearch(t);return r?e.filter(e=>itemMatchesKeyword(e,r)):e},N=(0,l.memo)(e=>{let{value:t,onChange:r,className:l,filterColor:i}=e,{formatMessage:a}=(0,p.Z)(),n=(0,s.rZ)(),c=t.trim().length>0,h=i?"#fff":"#111",u=i?"transparent":n.colors.neutral[2];return(0,o.tZ)(I.I,{className:l,value:t,onChange:r,placeholder:a({id:"carePathDoctorList.placeholderSearchDoctor"}),icon:(0,o.tZ)(S.Z,{size:20,color:h}),rightSection:c?(0,o.tZ)(B.k,{type:"button",onClick:()=>r(""),"aria-label":a({id:"carePathDoctorList.search.clear",defaultMessage:"X\xf3a từ kh\xf3a"}),sx:{display:"flex",alignItems:"center",justifyContent:"center",width:(0,d.h)(28),height:(0,d.h)(28)},children:(0,o.tZ)(L.Z,{size:16,color:h})}):void 0,rightSectionWidth:c?(0,d.h)(36):void 0,sx:{width:"100%"},styles:{rightSection:{pointerEvents:"auto"},input:{boxSizing:"border-box",padding:"0 ".concat((0,d.h)(12)),paddingLeft:(0,d.h)(36),...c&&{paddingRight:(0,d.h)(36)},backgroundColor:i||"#fff",borderRadius:8,border:"1px solid ".concat(u),height:"".concat((0,d.h)(48)," !important"),color:i?"#fff":"#111",fontSize:(0,d.h)(15),lineHeight:(0,d.h)(24),outline:"none","&::placeholder":{color:i?"#fff":"#8c8c8c"},...getCarePathDoctorListFilterInteractiveStyles(n,{filterColor:i})}}})});var F=r("YgWB"),M=r("oDhC");let isCareDoctor=e=>"specialtiesTransform"in e,groupDoctorsBySpecialtyId=e=>{let t=new Map;return e.forEach(e=>{var r;isCareDoctor(e)&&(null===(r=e.specialtiesTransform)||void 0===r||r.forEach(r=>{let o=r.id?String(r.id):"";if(!o)return;let l=t.get(o),i=r.name||r.slug||"";if(l){l.doctors.some(t=>t.id===e.id)||l.doctors.push(e),l.group.name||(l.group.name=i);return}t.set(o,{group:{id:o,name:i,thumbnail:r.thumbnail},doctors:[e]})}))}),Array.from(t.values())},doctorMatchesSpecialty=(e,t)=>{var r,o;return!!isCareDoctor(e)&&null!==(o=null===(r=e.specialtiesTransform)||void 0===r?void 0:r.some(e=>String(e.id)===t))&&void 0!==o&&o},filterCarePathDoctorListBySpecialty=(e,t)=>{let r=null===t||"all"===t;return r?e:e.filter(e=>doctorMatchesSpecialty(e,t))},R=(0,l.memo)((0,l.forwardRef)((e,t)=>{let{listingAll:r,selectedFilterId:i,filterColor:a,onFilterChange:n}=e,{formatMessage:s}=(0,p.Z)(),c=(0,l.useRef)(null),[d,h]=(0,l.useState)(null!=i?i:null);(0,l.useEffect)(()=>{h(null!=i?i:null)},[i]);let u=(0,l.useMemo)(()=>groupDoctorsBySpecialtyId(r),[r]);(0,l.useImperativeHandle)(t,()=>({setSpecialtySelectedFilterId:e=>h(e),openFilter:()=>{var e;return null===(e=c.current)||void 0===e?void 0:e.openFilter()}})),(0,l.useEffect)(()=>{let e=null===d||"all"===d;n({filterValue:d,isAllSpecialtiesSelected:e})},[d,n]);let g=(0,l.useMemo)(()=>[{label:s({id:"keyword.all"}),value:"all",icon:(0,o.tZ)(F.Z,{color:C.t.neutral[5]})},...u.map(e=>({label:e.group.name,value:e.group.id,icon:e.group.thumbnail}))],[s,u]);return g.length<=1?null:(0,o.tZ)(D,{ref:c,value:d,onChange:h,filterOpts:g,filterColor:a,layout:"iconOnly",filterIcon:M.Z,optionDataEventCategory:"Service Connection",optionDataEventAction:"Filter Specialty Click"})})),applyCarePathDoctorListFilters=(e,t)=>{let{keyword:r,cityFilterId:o,specialtyFilterId:l}=t,i=filterCarePathDoctorListByKeyword(e,r),a=filterCarePathDoctorListByCity(i,o);return filterCarePathDoctorListBySpecialty(a,l)},Circle=e=>{let{color:t,...r}=e;return(0,o.tZ)("svg",{width:"327",height:"168",viewBox:"0 0 327 168",fill:"none",...r,children:(0,o.tZ)("path",{d:"M127 168C237.457 168 327 78.4569 327 -32C327 -142.457 237.457 -232 127 -232C16.5431 -232 -73 -142.457 -73 -32C-73 78.4569 16.5431 168 127 168Z",fill:t})})};var E=r("g8xC"),z=r("nnl3"),W=r("sEfC"),X=r.n(W),O=r("raAP");let pushCarePathDoctorListSearchResultsEvent=(e,t)=>{let r=e.trim();r&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"view_search_results",event_category:"Service Connection",event_action:"Search - Care Booking",event_label:t,search_term:r}))},isCarePathDoctorListFilterActive=e=>null!==e&&"all"!==e,getCarePathDoctorListCityFilterLabel=(e,t)=>{if(!isCarePathDoctorListFilterActive(t))return null;for(let i of e){var r,o,l;if(!("hospital"in i))continue;let e=null===(r=i.hospital)||void 0===r?void 0:r.cityId;if(null==e||String(e)!==t)continue;let a=null===(l=i.hospital)||void 0===l?void 0:null===(o=l.cityName)||void 0===o?void 0:o.trim();return a||t}return t},getCarePathDoctorListSpecialtyFilterLabel=(e,t)=>{if(!isCarePathDoctorListFilterActive(t))return null;for(let o of e){var r;if(!("specialtiesTransform"in o))continue;let e=null===(r=o.specialtiesTransform)||void 0===r?void 0:r.find(e=>String(e.id)===t);if(e)return e.name||e.slug||t}return t},buildCarePathDoctorListResetEventLabel=e=>{let{searchKeyword:t,cityFilterId:r,specialtyFilterId:o,listingAll:l}=e,i=[],a=t.trim();a&&i.push(a);let n=getCarePathDoctorListCityFilterLabel(l,r);n&&i.push(n);let s=getCarePathDoctorListSpecialtyFilterLabel(l,o);return s&&i.push(s),i.join("^")},hasCarePathDoctorListActiveFilters=e=>{let{searchKeyword:t,cityFilterId:r,specialtyFilterId:o}=e;return!!t.trim()||isCarePathDoctorListFilterActive(r)||isCarePathDoctorListFilterActive(o)},H=(0,l.memo)(e=>{let{onClick:t,eventLabel:r,disabled:l=!1}=e,{formatMessage:i}=(0,p.Z)();return(0,o.tZ)(E.B,{variant:"secondary",color:"#fff",onClick:t,disabled:l,leftIcon:(0,o.tZ)(z.Z,{size:24,color:"currentColor"}),"data-event-category":"Service Connection","data-event-action":"Reset search and filter click","data-event-label":r,sx:e=>({fontWeight:"normal",flexShrink:0,borderColor:"transparent",height:"".concat((0,d.h)(48)," !important"),fontSize:(0,d.h)(15),lineHeight:(0,d.h)(24),letterSpacing:(0,d.h)(-.3),"&:hover":{backgroundColor:"transparent",borderColor:"transparent"},"&[data-disabled]":{backgroundColor:"transparent",color:"#fff"},[e.fn.smallerThan("sm")]:{paddingRight:0},[e.fn.largerThan("sm")]:{"&:not([data-disabled])":{"&:hover":{backgroundColor:"transparent",borderColor:"#fff"}}}}),children:i({id:"reset.title",defaultMessage:"Đặt lại"})})}),keywordSearchWrapperSx=e=>({flex:1,minWidth:0,[e.fn.largerThan("sm")]:{flex:"unset",width:(0,d.h)(250),flexShrink:0}}),doctorsFilterWrapperSx=e=>({flexShrink:0,[e.fn.largerThan("sm")]:{width:(0,d.h)(250)}}),doctorListFilterBarSx=e=>({gap:(0,d.h)(8),flexDirection:"column",alignItems:"stretch",width:"100%",[e.fn.largerThan("sm")]:{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",width:"auto"}}),doctorListFilterRowSx=e=>({gap:(0,d.h)(8),flexDirection:"row",alignItems:"center",flexWrap:"nowrap",width:"100%",[e.fn.largerThan("sm")]:{width:"auto"}}),_=(0,l.memo)(e=>{let{listingAll:t,searchKeyword:r,cityFilterId:i,specialtyFilterId:a,filterColor:n,doctorsFilterRef:d,specialtiesFilterRef:h,onSearchKeywordChange:p,onDoctorsFilterChange:g,onSpecialtiesFilterChange:m,onResetFilters:f,showResetButton:v=!0}=e,x=(0,s.rZ)(),b=(0,O.U)(),C=(0,l.useMemo)(()=>X()((e,t)=>{pushCarePathDoctorListSearchResultsEvent(e,t)},300),[]);(0,l.useEffect)(()=>()=>{C.cancel()},[C]),(0,l.useEffect)(()=>{let e=r.trim();if(!e){C.cancel();return}C(e,b)},[r,b,C]);let y=(0,l.useMemo)(()=>buildCarePathDoctorListResetEventLabel({searchKeyword:r,cityFilterId:i,specialtyFilterId:a,listingAll:t}),[r,i,a,t]),S=(0,l.useMemo)(()=>!hasCarePathDoctorListActiveFilters({searchKeyword:r,cityFilterId:i,specialtyFilterId:a}),[r,i,a]);return(0,o.BX)(u.k,{sx:doctorListFilterBarSx(x),children:[(0,o.BX)(u.k,{sx:doctorListFilterRowSx(x),children:[(0,o.tZ)(c.x,{sx:keywordSearchWrapperSx(x),children:(0,o.tZ)(N,{value:r,onChange:p,filterColor:n})}),(0,o.tZ)(c.x,{sx:doctorsFilterWrapperSx(x),children:(0,o.tZ)(T,{ref:d,listingAll:t,selectedFilterId:i,filterColor:n,onFilterChange:g})}),(0,o.tZ)(c.x,{sx:{flexShrink:0},children:(0,o.tZ)(R,{ref:h,listingAll:t,selectedFilterId:a,filterColor:n,onFilterChange:m})})]}),v&&(0,o.tZ)(H,{onClick:f,eventLabel:y,disabled:S})]})});var K=r("owZr");let isSameCardItem=(e,t)=>e.id===t.id&&e.avatar===t.avatar&&e.name===t.name&&e.rating===t.rating&&e.price===t.price&&e.hospital===t.hospital&&e.hospitalLogo===t.hospitalLogo,buildStableDoctorSlides=(e,t,r,o)=>{if(!e.length)return o.current.clear(),[];let l=new Set,i=e.map(e=>{let i=r(e,t),a=String(i.id);l.add(a);let n=o.current.get(a),s=n&&isSameCardItem(n,i)?n:i;return o.current.set(a,s),{id:a,item:s}});return o.current.forEach((e,t)=>{l.has(t)||o.current.delete(t)}),i};var G=r("0D4Z"),V=r("/npG"),j=(0,V.k)((e,t)=>{let{display:r}=t;return{root:{display:"flex",flex:1,background:"white",borderRadius:(0,d.h)(16),boxShadow:"0px 0px 1px 0px rgba(0, 0, 0, 0.06), 0px 2px 8px 0px rgba(0, 0, 0, 0.08)",overflow:"hidden",flexDirection:"column",alignItems:"stretch",..."vertical"===r&&{justifyContent:"space-between",gap:(0,d.h)(0),[e.fn.largerThan("md")]:{minHeight:(0,d.h)(250)}}},verticalInner:{width:"100%",flex:1,display:"flex",flexDirection:"column"},verticalTop:{padding:(0,d.h)(16),flex:1},verticalFooter:{marginTop:"auto",flexShrink:0,padding:"".concat((0,d.h)(8)," ").concat((0,d.h)(16)),backgroundColor:e.colors.neutral[0],transition:"background-color 0.2s ease","&:has(button:hover, a:hover)":{backgroundColor:e.colors.blue[0]}},horizonInner:{width:"100%",flex:1,display:"flex",flexDirection:"column"},horizonTop:{padding:(0,d.h)(16),flex:1},horizonFooter:{marginTop:"auto",flexShrink:0,padding:(0,d.h)(16),backgroundColor:e.colors.neutral[0],transition:"background-color 0.2s ease","&:has(button:hover, a:hover)":{backgroundColor:e.colors.blue[0]}},btn:{..."vertical"===r?{width:"100%"}:{flexShrink:0}}}}),Y=(0,V.k)(e=>({doctorAvatar:{width:(0,d.h)(64),height:(0,d.h)(64),borderRadius:"50%",overflow:"hidden",backgroundColor:e.colors.gray[1]},doctorAvatarImg:{width:"100%",height:"100%",objectFit:"cover",display:"block"},doctorAvatarWrapOverlay:{position:"relative",flexShrink:0,width:(0,d.h)(64)},ratingPill:{gap:(0,d.h)(4),align:"center",backgroundColor:e.colors.yellow[0],borderRadius:(0,d.h)(32),padding:"".concat((0,d.h)(3)," ").concat((0,d.h)(10))},ratingPillOverlay:{position:"absolute",left:"50%",top:"100%",transform:"translate(-50%, -80%)",flexShrink:0,whiteSpace:"nowrap",padding:"".concat((0,d.h)(2)," ").concat((0,d.h)(8)),zIndex:1,"& svg":{width:(0,d.h)(14),height:(0,d.h)(14)}},doctorNameSpecialtyBlock:{flex:1,minWidth:0,minHeight:(0,d.h)(64),display:"flex",flexDirection:"column",justifyContent:"center"},hospitalAvatarWrap:{width:(0,d.h)(40),height:(0,d.h)(40),flexShrink:0,borderRadius:"50%",border:"1px solid ".concat(e.colors.neutral[1]),overflow:"hidden",backgroundColor:e.white,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}}));let U={radius:"sm"},DoctorAvatarSkeleton=()=>{let{classes:e}=Y(),t=(0,s.rZ)();return(0,o.tZ)(c.x,{className:e.doctorAvatar,sx:{flexShrink:0,backgroundColor:t.colors.gray[1]},children:(0,o.tZ)(G.O,{height:"100%",width:"100%",radius:0})})},HospitalRowSkeleton=()=>{let{classes:e}=Y();return(0,o.BX)(u.k,{align:"center",gap:(0,d.h)(12),sx:{flex:1,minWidth:0},children:[(0,o.tZ)(c.x,{className:e.hospitalAvatarWrap,children:(0,o.tZ)(G.O,{height:"100%",width:"100%",radius:0})}),(0,o.BX)(h.K,{spacing:(0,d.h)(4),sx:{flex:1,minWidth:0},children:[(0,o.tZ)(G.O,{height:(0,d.h)(14),width:"72%",...U}),(0,o.tZ)(G.O,{height:(0,d.h)(12),width:"92%",...U})]})]})},BookButtonSkeleton=e=>{let{fullWidth:t}=e;return(0,o.tZ)(G.O,{height:(0,d.h)(36),width:t?"100%":(0,d.h)(120),radius:"md",sx:{flexShrink:t?void 0:0}})},NameBlockSkeleton=()=>{let{classes:e}=Y();return(0,o.tZ)(c.x,{className:e.doctorNameSpecialtyBlock,children:(0,o.BX)(h.K,{spacing:(0,d.h)(4),children:[(0,o.tZ)(G.O,{height:(0,d.h)(14),width:"88%",...U}),(0,o.tZ)(G.O,{height:(0,d.h)(12),width:"62%",...U})]})})},DoctorCardSkeleton=e=>{let{display:t,className:r,...l}=e,{classes:i,cx:a}=j({display:t},{name:"DoctorCardSkeleton"});return"vertical"===t?(0,o.tZ)(c.x,{className:a(i.root,r),...l,children:(0,o.BX)(h.K,{spacing:0,className:i.verticalInner,children:[(0,o.tZ)(h.K,{className:i.verticalTop,spacing:(0,d.h)(12),children:(0,o.BX)(u.k,{align:"center",gap:(0,d.h)(12),children:[(0,o.tZ)(DoctorAvatarSkeleton,{}),(0,o.tZ)(NameBlockSkeleton,{})]})}),(0,o.BX)(h.K,{className:i.verticalFooter,spacing:(0,d.h)(12),children:[(0,o.tZ)(HospitalRowSkeleton,{}),(0,o.tZ)(BookButtonSkeleton,{fullWidth:!0})]})]})}):(0,o.tZ)(c.x,{className:a(i.root,r),...l,children:(0,o.BX)(h.K,{spacing:(0,d.h)(12),className:i.horizonInner,children:[(0,o.tZ)(h.K,{className:i.horizonTop,spacing:(0,d.h)(4),children:(0,o.BX)(u.k,{align:"center",gap:(0,d.h)(12),children:[(0,o.tZ)(DoctorAvatarSkeleton,{}),(0,o.tZ)(NameBlockSkeleton,{})]})}),(0,o.BX)(u.k,{className:i.horizonFooter,align:"center",gap:(0,d.h)(16),children:[(0,o.tZ)(HospitalRowSkeleton,{}),(0,o.tZ)(BookButtonSkeleton,{})]})]})})};var q=r("rPIz"),Q=r("GqLv"),J=r("CJtR"),$=r("Gi6Z"),ee=r("S3OL");let et=(0,l.memo)(function(e){let{rating:t,className:r,sx:l}=e,i=(0,s.rZ)(),{classes:n,cx:c}=Y(),d=Math.floor(Number(t));return d<=0?null:(0,o.BX)(u.k,{className:c(n.ratingPill,r),sx:l,children:[(0,o.tZ)($.Z,{size:16,color:i.colors.yellow[8]}),(0,o.BX)(a.T,{size:"s5",weight:"semiBold",children:[parseFloat(t),"/5"]})]})}),er=(0,l.memo)(function(e){let{src:t,alt:r,hrefProps:l,rating:i,ratingPlacement:a="inline",className:n,...s}=e,{classes:d}=Y(),h=(0,o.tZ)(c.x,{className:d.doctorAvatar,children:(0,o.tZ)(ee.R,{src:t,alt:r,width:100,height:100,loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover"}})}),u="overlay"===a?(0,o.BX)(c.x,{className:d.doctorAvatarWrapOverlay,children:[h,i&&(0,o.tZ)(et,{rating:i,className:d.ratingPillOverlay})]}):h;return l?(0,o.tZ)("a",{...l,style:{flexShrink:0,...l.style},children:u}):(0,o.tZ)(c.x,{className:n,sx:{flexShrink:0},...s,children:u})}),eo=(0,l.memo)(function(e){let{name:t,hrefProps:r}=e,l=(0,o.tZ)(a.T,{size:"title2",weight:"semiBold",variant:"primary",lineClamp:3,children:t}),i=r?(0,o.tZ)("a",{...r,children:l}):l;return i}),el=(0,l.memo)(function(e){let{text:t}=e;return t?(0,o.tZ)(a.T,{size:"n1",color:"gray.6",lineClamp:3,children:t}):null}),ei=(0,l.memo)(function(e){let{cityName:t}=e;return t?(0,o.BX)(u.k,{align:"center",gap:4,children:[(0,o.tZ)(c.x,{children:(0,o.tZ)("img",{src:"/svg/location-outline.svg",loading:"lazy",style:{width:16,display:"block"},alt:""})}),(0,o.tZ)(a.T,{size:"n1",color:"gray.6",children:t})]}):null}),ea=(0,l.memo)(function(e){let{hospital:t,hospitalLogo:r,hospitalAddress:l,addressLineClamp:i=2}=e,{classes:n}=Y();return t||l||r?(0,o.BX)(u.k,{align:"center",gap:12,sx:{flex:1,minWidth:0},children:[r&&(0,o.tZ)(c.x,{className:n.hospitalAvatarWrap,children:(0,o.tZ)(ee.R,{src:r,alt:t||"Hospital logo",width:100,height:100,loading:"lazy",style:{width:"100%",height:"100%",objectFit:"contain"}})}),(0,o.BX)(c.x,{sx:{flex:1,minWidth:0},children:[t&&(0,o.tZ)(a.T,{size:"p3",weight:"semiBold",variant:"primary",lineClamp:1,children:t}),l&&(0,o.tZ)(a.T,{size:"c1",color:"gray.6",lineClamp:i,children:l})]})]}):null},(e,t)=>e.hospital===t.hospital&&e.hospitalLogo===t.hospitalLogo&&e.hospitalAddress===t.hospitalAddress&&e.addressLineClamp===t.addressLineClamp),en=(0,l.memo)(function(e){let{variant:t,footerClassName:r,hospital:l,hospitalLogo:i,hospitalAddress:a,button:n,...s}=e,c=(0,o.tZ)(ea,{hospital:l,hospitalLogo:i,hospitalAddress:a,addressLineClamp:"vertical"===t?2:1});return"vertical"===t?(0,o.BX)(h.K,{className:r,spacing:(0,d.h)(12),children:[c,n]}):(0,o.BX)(u.k,{className:r,align:"center",gap:(0,d.h)(16),...s,children:[c,n]})});var es=r("Iblh"),ec=r("IDes");let ed=(0,V.k)(e=>({root:{},popoperDropdown:{padding:(0,d.h)(8),border:0,backgroundColor:e.colors.gray[8]},popoperArrow:{backgroundColor:e.colors.gray[8],borderColor:e.colors.gray[8]},text:{color:"#fff"},email:{color:e.colors.blue[3]}})),PromotionTag=e=>{var t,r,l,i;let{label:n,color:s="blue",textColor:h,styles:u,className:g,classNames:m,hasTooltip:v}=e,{formatMessage:x}=(0,p.Z)(),b=(0,f.d)(),[C,{close:y,open:S}]=(0,es.q)(!1),{classes:w,theme:Z,cx:k}=ed(void 0,{name:"PromotionTag",styles:u,classNames:m}),P=h||(null===(r=Z.colors)||void 0===r?void 0:null===(t=r[s])||void 0===t?void 0:t[6]),D=(0,o.tZ)(c.x,{className:k(w.root,g),sx:{background:s.startsWith("#")?s:null===(i=Z.colors)||void 0===i?void 0:null===(l=i[s])||void 0===l?void 0:l[0],borderRadius:(0,d.h)(4),padding:"5px 12px 5px 4px"},children:(0,o.BX)(a.T,{size:"p4",color:P,sx:{display:"flex",gap:(0,d.h)(4),".icon":{marginTop:(0,d.h)(2)}},children:[(0,o.tZ)(ec.Z,{size:16,color:P,className:"icon"}),(0,o.tZ)("span",{children:n})]})});return!b&&(b||v)?(0,o.BX)(I.o,{withArrow:!0,shadow:"md",opened:C,width:300,classNames:{dropdown:w.popoperDropdown,arrow:w.popoperArrow},children:[(0,o.tZ)(I.o.Target,{children:(0,o.tZ)(c.x,{onMouseEnter:S,onMouseLeave:y,sx:{cursor:"pointer"},children:D})}),(0,o.tZ)(I.o.Dropdown,{onMouseEnter:S,onMouseLeave:y,children:(0,o.tZ)(a.T,{size:"p4",className:w.text,children:x({id:"doctorCard.promotionTag.popoverContent",defaultMessage:"Vui l\xf2ng li\xean hệ hotline 02871096118 hoặc email {email} để nhận ngay voucher ưu đ\xe3i."},{email:(0,o.tZ)(c.x,{component:"a",className:w.email,href:"mailto:Hotro@hellobacsi.com",children:"Hotro@hellobacsi.com"})})})})]}):D};var eh=r("zwQ/"),eu=r("xGJE");let tag_Tag=e=>{let{title:t,colorShade:r,icon:i}=e,n=(0,s.rZ)(),c=(0,l.useMemo)(()=>r.split(".")[0],[]),h=(0,l.useMemo)(()=>Number(r.split(".")[1]),[]);return(0,o.BX)(u.k,{align:"center",gap:(0,d.h)(4),sx:()=>({border:"1px solid ".concat(n.colors[c][h]),backgroundColor:n.colors[c][h-1],borderRadius:(0,d.h)(34),padding:" ".concat((0,d.h)(3)," ").concat((0,d.h)(12)," ").concat((0,d.h)(3)," ").concat((0,d.h)(8))}),children:[l.cloneElement(i,{size:16,color:n.colors[c][9]}),(0,o.tZ)(a.T,{size:"n1",children:t})]})},Tags=e=>{let{hasOutpatient:t,hasTelemedicine:r,...l}=e,{formatMessage:i}=(0,p.Z)();return t||r?(0,o.BX)(u.k,{wrap:"wrap",gap:(0,d.h)(4),...l,children:[t&&(0,o.tZ)(tag_Tag,{title:i({id:"carePathEmbedDoctor.outPatient",defaultMessage:"Out patient"}),icon:(0,o.tZ)(eh.Z,{}),colorShade:"blue.1"}),r&&(0,o.tZ)(tag_Tag,{title:i({id:"carePathEmbedDoctor.telemedicine",defaultMessage:"Telemedicine"}),icon:(0,o.tZ)(eu.Z,{}),colorShade:"orange.1"})]}):null},ep=(0,l.memo)(e=>{let{item:t,className:r,classNames:i,display:n="vertical",styles:s,isService:g,showConfirmCityPopup:f=!1,onCancel:b,showPromotionEvent:C,campaign:y={name:"",source:""},...S}=e,{name:w,validOutpatient:Z,validTelemedicine:k,rating:P,slug:D,id:T,cityName:I,doctorWebsite:L,avatar:B,doctorSpecialties:A=[],hospital:N,hospitalLogo:F,hospitalAddress:M}=t,{formatMessage:R}=(0,p.Z)(),{locale:z}=(0,v.h)(),{classes:W,cx:X}=j({display:n},{name:"DoctorCard",classNames:i,styles:s}),{classes:O}=Y(),[H,_]=(0,l.useState)(null),K=(0,l.useMemo)(()=>A.map(e=>"string"==typeof e?e:e.name).filter(Boolean).join(", "),[A]),G=(0,l.useMemo)(()=>g?R({id:"articlePage.careEmbedding.bookService"}):R({id:"articleAuthor.button",defaultMessage:"Book now"}),[R,g]),V=(0,l.useMemo)(()=>{var e;let t="".concat((0,J.UC)(z),"/care/").concat(null===(e=x.a8[z])||void 0===e?void 0:e[g?"SERVICE":"DOCTOR"],"/").concat(D,"-").concat(T,"/"),r=L||t;try{let e=new URL(r,(0,J.UC)(z));return y.name&&e.searchParams.set("utm_campaign",y.name),y.source&&e.searchParams.set("utm_source",y.source),e.toString()}catch(e){return t}},[L,z,g,D,T,y.name,y.source]),U=(0,l.useMemo)(()=>({"data-event-category":"Service Connection","data-event-action":"Book Doctor","data-event-label":L||"https://".concat(m.domainLocales[z]).concat(V)}),[L,z,V]),$=(0,l.useCallback)(e=>{if(f){e.preventDefault(),_({cityName:I,url:V});return}e.currentTarget instanceof HTMLAnchorElement||window.open(V,"_blank","noopener,noreferrer")},[f,I,V]),ee=(0,l.useMemo)(()=>({href:V,target:"_blank",style:{display:"block",borderRadius:"inherit"},className:"pointer-event-child-none",onClick:$,...U}),[V,$,U]),ea=(0,l.useMemo)(()=>f?(0,o.tZ)(E.B,{h:36,size:"md",className:W.btn,onClick:$,...U,children:G}):(0,o.tZ)(E.B,{h:36,size:"md",className:W.btn,...{component:"a",href:V,target:"_blank",rel:"noopener noreferrer",onClick:$,...U},children:G}),[W.btn,$,U,G,f,V]),es=(0,l.useMemo)(()=>C?(0,o.BX)(h.K,{spacing:(0,d.h)(4),align:"flex-start",children:[(0,o.tZ)(PromotionTag,{color:"yellow",textColor:"yellow.9",hasTooltip:!0,label:(0,o.tZ)(o.HY,{children:R({id:"doctorCard.promotionTag.canUseVoucher",defaultMessage:"C\xf3 thể \xe1p dụng voucher"})})}),(0,o.tZ)(PromotionTag,{color:"#FDF1F6",textColor:"#A50064",label:(0,o.tZ)(o.HY,{children:R({id:"doctorCard.promotionTag.discount",defaultMessage:"Thẻ qu\xe0 tặng giảm th\xeam {price}"},{price:(0,o.tZ)("strong",{children:"100.000 đ"})})})}),(0,o.tZ)(PromotionTag,{color:"#FDF1F6",textColor:"#A50064",label:(0,o.tZ)(o.HY,{children:R({id:"doctorCard.promotionTag.discount1",defaultMessage:"Cơ hội nhận qu\xe0 trị gi\xe1 {price}"},{price:(0,o.tZ)("strong",{children:"300.000 đ"})})})})]}):null,[C,R]),ec=(0,l.useMemo)(()=>(0,o.tZ)(Tags,{hasOutpatient:Z,hasTelemedicine:k}),[Z,k]),ed=(0,l.useMemo)(()=>(0,o.tZ)(en,{variant:n,footerClassName:"vertical"===n?W.verticalFooter:W.horizonFooter,hospital:N,hospitalLogo:F,hospitalAddress:M,button:ea}),[n,W.verticalFooter,W.horizonFooter,N,F,M,ea]);return(0,o.BX)(o.HY,{children:[(0,o.tZ)(c.x,{className:X(W.root,r),...S,children:"vertical"===n?(0,o.BX)(h.K,{spacing:0,className:W.verticalInner,children:[(0,o.BX)(h.K,{className:W.verticalTop,spacing:(0,d.h)(12),children:[(0,o.BX)(u.k,{align:"center",gap:12,children:[(0,o.tZ)(er,{src:B,alt:w,hrefProps:ee,rating:P,ratingPlacement:"overlay"}),(0,o.BX)(c.x,{className:O.doctorNameSpecialtyBlock,children:[(0,o.tZ)(eo,{name:w,hrefProps:ee}),(0,o.tZ)(el,{text:K})]})]}),ec,(0,o.tZ)(ei,{cityName:I}),es]}),ed]}):(0,o.BX)(h.K,{spacing:12,className:W.horizonInner,children:[(0,o.BX)(h.K,{className:W.horizonTop,spacing:4,children:[(0,o.BX)(u.k,{align:"center",gap:12,children:[(0,o.tZ)(er,{src:B,alt:w,hrefProps:ee}),(0,o.BX)(h.K,{spacing:4,sx:{flex:1,minWidth:0},children:[(0,o.BX)(c.x,{className:O.doctorNameSpecialtyBlock,children:[(0,o.BX)(u.k,{align:g?"center":"flex-start",justify:"space-between",gap:(0,d.h)(8),children:[(0,o.tZ)(eo,{name:w,hrefProps:ee}),(0,o.tZ)(et,{rating:P,sx:{flexShrink:0}})]}),(0,o.tZ)(el,{text:K})]}),ec,(0,o.tZ)(ei,{cityName:I})]})]}),es]}),ed]})}),f&&H&&(0,o.tZ)(Q.M,{size:(0,d.h)(408),target:x.Hh,opened:!!H,withCloseButton:!0,styles:e=>({header:{position:"absolute",right:0,top:0,border:0,paddingLeft:0},body:{padding:0},heading:{[e.fn.smallerThan("sm")]:{}}}),onClose:()=>_(null),children:(0,o.BX)(h.K,{sx:e=>({padding:(0,d.h)(16),gap:(0,d.h)(16),[e.fn.largerThan("sm")]:{padding:(0,d.h)(32),gap:(0,d.h)(32)}}),children:[(0,o.BX)(h.K,{spacing:8,sx:{textAlign:"center"},children:[(0,o.tZ)(q.H,{tag:"h4",children:R({id:"doctorCard.confirmCityPopup.heading"})}),(0,o.tZ)(a.T,{size:"p2",children:R({id:"doctorCard.confirmCityPopup.content"},{location:(0,o.tZ)("strong",{children:null==H?void 0:H.cityName})})})]}),(0,o.BX)(u.k,{gap:12,sx:{button:{flex:1}},children:[(0,o.tZ)(E.B,{variant:"tertiary",onClick:()=>{_(null),null==b||b()},children:R({id:"carePathDoctorList.confirmLocModal.cancel"})}),(0,o.tZ)(E.B,{onClick:()=>{(null==H?void 0:H.url)&&window.open(null==H?void 0:H.url),_(null)},children:R({id:"confirm"})})]})]})})]})},(e,t)=>{var r,o,l,i;return e.item.id===t.item.id&&e.item.avatar===t.item.avatar&&e.item.name===t.item.name&&e.item.rating===t.item.rating&&e.item.price===t.item.price&&e.item.hospital===t.item.hospital&&e.item.hospitalLogo===t.item.hospitalLogo&&e.display===t.display&&e.isService===t.isService&&e.hidePrice===t.hidePrice&&e.showConfirmCityPopup===t.showConfirmCityPopup&&e.showPromotionEvent===t.showPromotionEvent&&(null===(r=e.campaign)||void 0===r?void 0:r.name)===(null===(o=t.campaign)||void 0===o?void 0:o.name)&&(null===(l=e.campaign)||void 0===l?void 0:l.source)===(null===(i=t.campaign)||void 0===i?void 0:i.source)}),carePathDoctorListActionBtnSx=e=>({width:e?"100%":"auto"}),CarePathDoctorListActionButton=e=>{let{fullWidth:t=!1,sx:r,children:l,...i}=e;return(0,o.tZ)(E.B,{h:48,size:"lg",fullWidth:t,variant:"white",sx:{...carePathDoctorListActionBtnSx(t),...r},...i,children:l})},ShowMoreBtn=e=>{let{fullWidth:t=!0,onClick:r}=e,{formatMessage:l}=(0,p.Z)();return(0,o.tZ)(CarePathDoctorListActionButton,{fullWidth:t,onClick:r,variant:"secondary",color:"#fff",sx:{"&:hover":{backgroundColor:"transparent"}},children:l({id:"articlePage.careEmbedding.seeMore",defaultMessage:"Xem th\xeam"})})},getNativeScrollItemFlex=(e,t)=>{let r=(e-1)*t;return"0 0 calc((100cqi - ".concat(r,"px) / ").concat(e,")")},getNativeScrollPageFlex=()=>"0 0 100cqi",chunkSlidesForViewport=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,r=[];for(let o=0;o1&&void 0!==arguments[1]?arguments[1]:{},n=getNativeScrollItemFlex(t,r),s=getNativeScrollPageFlex();return{cardWrapper:{padding:(0,d.h)(4),width:"100%",minWidth:0,display:"flex",flexDirection:"column",alignItems:"stretch"},mobileCardWrapper:{width:"100%",minWidth:0},mobileExpandBtnWrapper:{paddingTop:(0,d.h)(16)},mobileViewAllBtnWrapper:{paddingTop:(0,d.h)(8)},mobileViewAllBtnWrapperOnly:{paddingTop:(0,d.h)(16)},nativeScrollRoot:{position:"relative"},nativeScrollViewport:{containerType:"inline-size",display:"flex",alignItems:"stretch",overflowX:a?"auto":"hidden",scrollSnapType:a?"x mandatory":"none",scrollBehavior:"smooth",WebkitOverflowScrolling:"touch",touchAction:a?"pan-x":"auto",cursor:a?"grab":"default",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}},nativeScrollPageStatic:{flex:"0 0 100%",boxSizing:"border-box"},nativeScrollItemFull:{flex:"1 1 100%",minWidth:0,display:"flex",flexDirection:"column",boxSizing:"border-box"},nativeScrollDragging:{cursor:"grabbing",scrollSnapType:"none",scrollBehavior:"auto",userSelect:"none"},nativeScrollItem:{flex:n,display:"flex",flexDirection:"column",alignSelf:"stretch",scrollSnapAlign:"start",scrollSnapStop:"always",minWidth:0,boxSizing:"border-box"},nativeScrollPage:{flex:s,alignSelf:"stretch",scrollSnapAlign:"start",scrollSnapStop:"always",minWidth:0,boxSizing:"border-box"},nativeScrollHorizonGrid:{display:"grid",gridTemplateColumns:"repeat(".concat(l,", 1fr)"),gridTemplateRows:i>1?"repeat(".concat(i,", 1fr)"):"1fr",gap:(0,d.h)(r),height:"100%",alignItems:"stretch"},nativeScrollGridCell:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column"},nativeScrollArrow:{position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,width:(0,d.h)(40),height:(0,d.h)(40),borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:e.white,cursor:"pointer",transition:"all .2s ease",userSelect:"none",opacity:.85,boxShadow:"1px 4px 8px 1px rgba(0, 0, 0, 0.1)",...o?{border:"1px solid ".concat(o),"&:hover":{backgroundColor:e.fn.lighten(o,.9)}}:{"&:hover":{backgroundColor:e.colors.neutral100,borderColor:e.colors.neutral100}},"&.disabled":{opacity:0,cursor:"inherit",pointerEvents:"none"}},nativeScrollArrowIcon:{transition:"all .2s ease",...o&&{color:o}},nativeScrollArrowPrev:{left:0,[e.fn.largerThan("sm")]:{left:(0,d.h)(-60)}},nativeScrollArrowNext:{right:0,[e.fn.largerThan("sm")]:{right:(0,d.h)(-60)}}}});let em=(0,l.memo)(e=>{let{slides:t,filterKey:r,cardCommonProps:i}=e,{classes:a}=eg({}),[n,s]=(0,l.useState)(4),d=(0,l.useMemo)(()=>t.map(e=>e.id).join("\x00"),[t]);(0,l.useEffect)(()=>{s(4)},[d,r]);let u=t.length>n,p=(0,l.useMemo)(()=>t.slice(0,n),[t,n]),g=(0,l.useCallback)(()=>{s(e=>Math.min(e+4,t.length))},[t.length]);return(0,o.BX)(h.K,{spacing:16,children:[p.map(e=>{let{id:t,item:r}=e;return(0,o.tZ)(c.x,{className:a.mobileCardWrapper,children:(0,o.tZ)(ep,{...i,item:r})},t)}),u?(0,o.tZ)(c.x,{className:a.mobileCardWrapper,children:(0,o.tZ)(ShowMoreBtn,{onClick:g})}):null]})});var ef=r("5Q4Z"),ev=r("iZ8j");let getNativeScrollPageIndex=e=>{let t=e.clientWidth;return t<=0?0:Math.round(e.scrollLeft/t)},createInitialRenderedIndices=e=>Array.from({length:Math.min(2,e)},(e,t)=>t),areRenderedIndicesEqual=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]),mergeRenderedWithPageAndAhead=(e,t,r)=>{if(t<=0)return[];let o=new Set(e.filter(e=>e>=0&&ee-t)},useNativeScrollLazyRender=(e,t)=>{let{enabled:r,mode:o,totalCount:i}=t,[a,n]=(0,l.useState)(()=>r&&i>0?createInitialRenderedIndices(i):[]),s=(0,l.useRef)(r);s.current=r;let c=(0,l.useRef)(o);c.current=o,(0,l.useLayoutEffect)(()=>{if(!r||i<=0){n([]);return}n(createInitialRenderedIndices(i))},[r,i]);let d=(0,l.useCallback)(e=>{s.current&&!(i<=0)&&n(t=>{let r=mergeRenderedWithPageAndAhead(t,i,e);return areRenderedIndicesEqual(t,r)?t:r})},[i]),h=(0,l.useCallback)(()=>{if(!s.current||"pages"!==c.current)return;let t=e.current;!t||i<=0||t.clientWidth<=0||d(getNativeScrollPageIndex(t))},[e,i,d]),u=(0,l.useCallback)(e=>{d(e)},[d]);(0,l.useEffect)(()=>{if(!r||"pages"!==c.current)return;let t=e.current;if(!t)return;let o=0,onScroll=()=>{o||(o=requestAnimationFrame(()=>{o=0,h()}))};t.addEventListener("scroll",onScroll,{passive:!0});let l="undefined"!=typeof ResizeObserver?new ResizeObserver(()=>{h()}):null;return null==l||l.observe(t),()=>{t.removeEventListener("scroll",onScroll),null==l||l.disconnect(),o&&cancelAnimationFrame(o)}},[r,h,e]);let p=(0,l.useCallback)(e=>!r||(0===a.length?e<2:a.includes(e)),[r,a]);return{shouldRenderIndex:p,prepareIndicesAround:u,syncPreloadFromViewport:h}},isNativeScrollInteractiveTarget=e=>e instanceof Element&&!!e.closest('button, a, input, textarea, select, [role="button"], [data-no-drag]'),ex=(0,l.memo)(e=>{var t,r;let{slides:i,cardCommonProps:a,desktopLayout:n,cardWrapperClassName:s,gap:h,arrowColor:u}=e,{layoutType:p,columns:g,rows:m,itemsPerViewport:f,useGrid:v,enableScroll:x}=n,{classes:b,cx:C}=eg({nativeScrollVisibleCount:f,nativeScrollGap:h,arrowColor:u,gridColumns:g,gridRows:m,enableScroll:x},{name:"CarePathDoctorList"}),y=(0,l.useMemo)(()=>"scroll-pages"===p?chunkSlidesForViewport(i,f):null,[p,i,f]),S=null!==(t=null==y?void 0:y.length)&&void 0!==t?t:0,w=x&&"scroll-pages"===p&&S>1,Z=(0,l.useRef)(null),k=(0,l.useRef)(null),P=(0,l.useRef)(null),D=(0,l.useRef)({prev:!1,next:!1}),T=(0,l.useRef)({active:!1,pointerId:-1,startX:0,startScrollLeft:0,hasMoved:!1}),[I,L]=(0,l.useState)(!1),{shouldRenderIndex:B,prepareIndicesAround:A}=useNativeScrollLazyRender(Z,{enabled:w,mode:"pages",totalCount:S}),N=(0,l.useCallback)(()=>{var e,t;if(!x)return;let r=Z.current;if(!r)return;let o=r.scrollWidth-r.clientWidth,l=r.scrollLeft>4,i=r.scrollLeft{if(!x)return;let t=Z.current;if(t){if(w&&1===e){let r=getNativeScrollPageIndex(t),o=Math.min(Math.max(0,r+e),Math.max(0,Math.ceil(t.scrollWidth/t.clientWidth)-1));A(o)}t.scrollBy({left:e*t.clientWidth,behavior:"smooth"})}},[x,w,A]),M=(0,l.useCallback)(e=>{let t=Z.current;T.current.active&&t&&(T.current.active=!1,L(!1),t.hasPointerCapture(e)&&t.releasePointerCapture(e),N())},[N]),R=(0,l.useCallback)(e=>{if(!x||0!==e.button||"touch"===e.pointerType||isNativeScrollInteractiveTarget(e.target))return;let t=Z.current;t&&(T.current={active:!0,pointerId:e.pointerId,startX:e.clientX,startScrollLeft:t.scrollLeft,hasMoved:!1},L(!0),t.setPointerCapture(e.pointerId))},[x]),E=(0,l.useCallback)(e=>{if(!T.current.active)return;let t=Z.current;if(!t)return;let r=e.clientX-T.current.startX;Math.abs(r)>5&&(T.current.hasMoved=!0),t.scrollLeft=T.current.startScrollLeft-r,e.preventDefault()},[]),z=(0,l.useCallback)(e=>{M(e.pointerId)},[M]),W=(0,l.useCallback)(e=>{M(e.pointerId)},[M]),X=(0,l.useCallback)(e=>{T.current.hasMoved&&(e.preventDefault(),e.stopPropagation(),T.current.hasMoved=!1)},[]);(0,l.useEffect)(()=>{if(!x)return;N();let e=Z.current;if(!e||"undefined"==typeof ResizeObserver)return;let t=0,r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=requestAnimationFrame(N)});return r.observe(e),()=>{cancelAnimationFrame(t),r.disconnect()}},[x,i.length,null==y?void 0:y.length,N]);let O=null!==(r=a.display)&&void 0!==r?r:"vertical",renderPlaceholderGrid=e=>(0,o.tZ)(c.x,{className:b.nativeScrollHorizonGrid,children:Array.from({length:e},(e,t)=>(0,o.tZ)(c.x,{className:b.nativeScrollGridCell,children:(0,o.tZ)(DoctorCardSkeleton,{display:O,sx:{height:"100%",flex:1,minHeight:0}})},"placeholder-cell-".concat(t)))}),renderSlidePlaceholder=(e,t)=>(0,o.tZ)(c.x,{className:C(t?b.nativeScrollGridCell:b.nativeScrollItem,"single-full"===p&&b.nativeScrollItemFull,!t&&"single-full"!==p&&s),"aria-hidden":!0,children:(0,o.tZ)(DoctorCardSkeleton,{display:O,sx:{height:"100%",flex:1,minHeight:0}})},"placeholder-".concat(e)),renderCard=(e,t,r)=>(0,o.tZ)(c.x,{className:C(r?b.nativeScrollGridCell:b.nativeScrollItem,"single-full"===p&&b.nativeScrollItemFull,!r&&"single-full"!==p&&s),children:(0,o.tZ)(ep,{...a,item:t})},e),renderGrid=e=>(0,o.tZ)(c.x,{className:b.nativeScrollHorizonGrid,children:e.map(e=>{let{id:t,item:r}=e;return renderCard(t,r,!0)})});return(0,o.BX)(c.x,{className:b.nativeScrollRoot,children:[x&&(0,o.tZ)(c.x,{ref:k,className:C(b.nativeScrollArrow,b.nativeScrollArrowPrev,"disabled"),onClick:()=>D.current.prev&&F(-1),children:(0,o.tZ)(ef.Z,{className:b.nativeScrollArrowIcon,size:18,useCurrentColor:!0})}),(0,o.tZ)(c.x,{ref:Z,className:C(b.nativeScrollViewport,I&&b.nativeScrollDragging),sx:{gap:(0,d.h)(h)},onScroll:N,onPointerDown:R,onPointerMove:E,onPointerUp:z,onPointerCancel:W,onClickCapture:X,children:(()=>{if("single-full"===p&&i[0]){let{id:e,item:t}=i[0];return(0,o.tZ)(c.x,{className:C(b.nativeScrollPage,b.nativeScrollPageStatic,s),children:renderCard(e,t,!1)})}return"static-grid"===p&&v?(0,o.tZ)(c.x,{className:C(b.nativeScrollPage,b.nativeScrollPageStatic,s),children:renderGrid(i)}):"scroll-pages"===p&&y?y.map((e,t)=>(0,o.tZ)(c.x,{className:C(b.nativeScrollPage,s),children:B(t)?renderGrid(e):renderPlaceholderGrid(e.length)},"page-".concat(t))):i.map((e,t)=>{let{id:r,item:o}=e;return B(t)?renderCard(r,o,!1):renderSlidePlaceholder(r,!1)})})()}),x&&(0,o.tZ)(c.x,{ref:P,className:C(b.nativeScrollArrow,b.nativeScrollArrowNext),onClick:()=>D.current.next&&F(1),children:(0,o.tZ)(ev.Z,{className:b.nativeScrollArrowIcon,size:18,useCurrentColor:!0})})]})}),eb=(0,l.memo)(e=>{let{slides:t,cardCommonProps:r,desktopLayout:l,cardWrapperClassName:i,gap:a}=e,{layoutType:n,columns:s,rows:h}=l;return"single-full"===n&&t[0]?(0,o.tZ)(c.x,{className:i,children:(0,o.tZ)(ep,{...r,item:t[0].item})}):(0,o.tZ)(c.x,{sx:{display:"grid",gridTemplateColumns:"repeat(".concat(s,", minmax(0, 1fr))"),gridTemplateRows:h>1?"repeat(".concat(h,", auto)"):"auto",gap:(0,d.h)(a),alignItems:"stretch"},children:t.map(e=>{let{id:t,item:l}=e;return(0,o.tZ)(c.x,{className:i,sx:{minWidth:0,display:"flex",flexDirection:"column"},children:(0,o.tZ)(ep,{...r,item:l})},t)})})}),eC=K.C.getAssetPath("carePath/doctor-not-found.svg"),ey=Array.from({length:4},(e,t)=>"skeleton-".concat(t)),usePreloadCarePathDoctorNotFoundImage=()=>{(0,l.useEffect)(()=>{let e=new Image;e.src=eC},[])},eS=(0,l.memo)(e=>{var t;let{displayDoctors:r,isLoading:i,isMobile:n,listingGapDesktop:s,desktopListLayout:g,arrowColor:m,mobileListFilterKey:f,cardWrapperClassName:v,typeEmbedding:x,formatCardItem:b,cardCommonProps:C}=e,{formatMessage:y}=(0,p.Z)(),S=(0,l.useRef)(new Map);usePreloadCarePathDoctorNotFoundImage();let w=null!==(t=C.display)&&void 0!==t?t:"vertical",{layoutType:Z,columns:k,rows:P,itemsPerViewport:D,useGrid:T,enableScroll:I}=g,L=getNativeScrollItemFlex(D,s),B=(0,l.useMemo)(()=>"single-full"===Z?1:"static-grid"===Z?k*P:D,[Z,k,P,D]),A=(0,l.useMemo)(()=>buildStableDoctorSlides(r,x,b,S),[r,x,b]);return i?n?(0,o.tZ)(h.K,{spacing:16,children:ey.map(e=>(0,o.tZ)(DoctorCardSkeleton,{display:"vertical"},e))}):"single-full"===Z?(0,o.tZ)(c.x,{sx:{containerType:"inline-size",overflow:"hidden"},children:(0,o.tZ)(c.x,{className:v,children:(0,o.tZ)(DoctorCardSkeleton,{display:w})})}):T?(0,o.tZ)(c.x,{sx:{containerType:"inline-size",overflow:"hidden"},children:(0,o.tZ)(c.x,{className:v,children:(0,o.tZ)(c.x,{sx:{display:"grid",gridTemplateColumns:"repeat(".concat(k,", 1fr)"),gridTemplateRows:P>1?"repeat(".concat(P,", 1fr)"):"1fr",gap:(0,d.h)(s)},children:Array.from({length:B},(e,t)=>(0,o.tZ)(c.x,{sx:{minWidth:0,display:"flex",flexDirection:"column"},children:(0,o.tZ)(DoctorCardSkeleton,{display:w,sx:{height:"100%",flex:1,minHeight:0}})},"desktop-skeleton-".concat(t)))})})}):(0,o.tZ)(u.k,{gap:s,sx:{containerType:"inline-size",overflow:"hidden",alignItems:"stretch"},children:Array.from({length:B},(e,t)=>(0,o.tZ)(c.x,{sx:{flex:L,minWidth:0,display:"flex",flexDirection:"column",alignSelf:"stretch",boxSizing:"border-box"},className:v,children:(0,o.tZ)(DoctorCardSkeleton,{display:w,sx:{height:"100%",flex:1,minHeight:0}})},"desktop-skeleton-".concat(t)))}):r.length?n?(0,o.tZ)(em,{slides:A,filterKey:f,cardCommonProps:C}):I?(0,o.tZ)(ex,{slides:A,cardCommonProps:C,desktopLayout:g,cardWrapperClassName:v,gap:s,arrowColor:m}):(0,o.tZ)(eb,{slides:A,cardCommonProps:C,desktopLayout:g,cardWrapperClassName:v,gap:s}):(0,o.tZ)(c.x,{sx:{display:"flex",alignItems:"center",justifyContent:"center",padding:(0,d.h)(24)},children:(0,o.BX)(h.K,{align:"center",spacing:16,sx:{maxWidth:456},children:[(0,o.tZ)(c.x,{component:"img",src:eC,alt:"",loading:"eager",fetchPriority:"high",width:120,height:120,sx:{width:(0,d.h)(120),aspectRatio:"1 / 1",objectFit:"contain"}}),(0,o.tZ)(a.T,{size:"p2",color:"#fff",align:"center",children:y({id:"carePathDoctorList.notFoundDesc",defaultMessage:"Kh\xf4ng t\xecm thấy b\xe1c sĩ"})})]})})},(e,t)=>e.isLoading===t.isLoading&&e.isMobile===t.isMobile&&e.displayDoctors===t.displayDoctors&&e.cardCommonProps===t.cardCommonProps&&e.mobileListFilterKey===t.mobileListFilterKey&&e.listingGapDesktop===t.listingGapDesktop&&e.arrowColor===t.arrowColor&&e.cardWrapperClassName===t.cardWrapperClassName&&e.typeEmbedding===t.typeEmbedding&&e.formatCardItem===t.formatCardItem&&e.desktopListLayout===t.desktopListLayout);var ew=r("MyPT");let HalfCircle=e=>{let{color:t,...r}=e;return(0,o.tZ)("svg",{width:"204",height:"132",viewBox:"0 0 204 132",fill:"none",...r,children:(0,o.tZ)("path",{d:"M131 0.54982L0 0.549797L-2.29048e-05 131.55C-3.55404e-05 203.817 58.6115 262.55 131 262.55C203.267 262.55 262 203.938 262 131.55C261.879 59.1614 203.268 0.549833 131 0.54982Z",fill:t})})},resolveDesktopDoctorListLayout=(e,t,r)=>{var o;let l=null!==(o=null==r?void 0:r.useScrollLayoutFromFour)&&void 0!==o&&o;return e<=0?{layoutType:"static-grid",columns:1,rows:1,itemsPerViewport:1,useGrid:!0,enableScroll:!1}:1===e?{layoutType:"single-full",columns:1,rows:1,itemsPerViewport:1,useGrid:!1,enableScroll:!1}:2===e?{layoutType:"static-grid",columns:2,rows:1,itemsPerViewport:2,useGrid:!0,enableScroll:!1}:3===e?t?{layoutType:"static-grid",columns:2,rows:2,itemsPerViewport:3,useGrid:!0,enableScroll:!1}:{layoutType:"static-grid",columns:3,rows:1,itemsPerViewport:3,useGrid:!0,enableScroll:!1}:4!==e||l?t?{layoutType:"scroll-pages",columns:2,rows:2,itemsPerViewport:4,useGrid:!0,enableScroll:!0}:{layoutType:"scroll-row",columns:4,rows:1,itemsPerViewport:4,useGrid:!1,enableScroll:!0}:t?{layoutType:"static-grid",columns:2,rows:2,itemsPerViewport:4,useGrid:!0,enableScroll:!1}:{layoutType:"static-grid",columns:4,rows:1,itemsPerViewport:4,useGrid:!0,enableScroll:!1}},resolveDoctorCardDisplay=e=>{let{isMobile:t,itemCount:r,horizontalLayout:o,layoutConfig:l}=e;if(t)return"vertical";if(r>0&&r<=2)return"horizon";let i=null==l?void 0:l[r];return i||(o?"horizon":"vertical")},Shape=e=>{let{color:t,...r}=e;return(0,o.tZ)("svg",{width:"122",height:"122",viewBox:"0 0 122 122",fill:"none",...r,children:(0,o.tZ)("path",{d:"M61 0H122V61C122 94.6513 94.7076 122 61 122C27.3487 122 0 94.7076 0 61C0.0562668 27.2924 27.3487 0 61 0Z",fill:t})})};var eZ=r("TYy9"),ek=r.n(eZ),eP=r("xweI"),eD=r.n(eP),eT=r("09QT"),eI=r("J3uC"),eL=r("oQBk");let eB=(0,l.forwardRef)((e,t)=>{let{categoryIds:r,listingAll:i,selectedFilterId:a,filterColor:n,filterLayout:s,onFilterChange:c}=e,{formatMessage:d}=(0,p.Z)(),h=(0,l.useRef)(null),[u,g]=(0,l.useState)([]),[m,f]=(0,l.useState)(null);(0,l.useImperativeHandle)(t,()=>({setTopServiceSelectedFilterId:e=>f(e),openFilter:()=>{var e;return null===(e=h.current)||void 0===e?void 0:e.openFilter()}})),(0,l.useEffect)(()=>{r.length&&(async()=>{var e,t;let o=await (0,eT.d)(eL.y.CARE.GET_TOP_SERVICES,{params:{showDistrict:1,categoryIds:r.join(",")}},"care");g(ek()(((null==o?void 0:null===(t=o._data)||void 0===t?void 0:null===(e=t.top_services)||void 0===e?void 0:e.city_list)||[]).map(e=>{var t,r,o;return{group:{id:String(null!==(o=null===(t=e.city)||void 0===t?void 0:t.id)&&void 0!==o?o:""),name:(null===(r=e.city)||void 0===r?void 0:r.name)||""},doctors:eD()(ek()((0,eI.PE)(e).serviceList.map(e=>e.services)),["position"],"asc")}})))})()},[r]),(0,l.useEffect)(()=>{a&&f(a)},[a]),(0,l.useEffect)(()=>{let e=null===m||"all"===m,t=e?i:ek()(u.filter(e=>{var t;return(null===(t=e.group)||void 0===t?void 0:t.id)==m}).map(e=>e.doctors));c({doctors:t,filterValue:m,isAllCitiesSelected:e})},[m,u,i,c]);let v=(0,l.useMemo)(()=>[{label:d({id:"keyword.all"}),value:"all"},...u.map(e=>{var t,r;return{label:null===(t=e.group)||void 0===t?void 0:t.name,value:String(null===(r=e.group)||void 0===r?void 0:r.id)}})],[d,u]);return(0,o.tZ)(D,{ref:h,value:m,onChange:f,filterOpts:v,filterColor:n,layout:s})}),getListingItemKey=(e,t)=>{if("id"in e)return String(e.id);if("categoryId"in e){let t=e.services.map(e=>"id"in e?String(e.id):"").join(",");return"".concat(e.categoryId,":").concat(t)}return String(t)},useEmbeddingDoctorsListing=(e,t)=>{let[r,o]=(0,l.useState)(e),[i,a]=(0,l.useState)(!1),n=(0,l.useRef)(!1),[,s]=(0,l.useTransition)(),c=(0,l.useMemo)(()=>e.map(getListingItemKey).join("\x00"),[e]),d=(0,l.useRef)(c);return(0,l.useEffect)(()=>{d.current!==c&&(d.current=c,o(e),n.current=!1,a(!1))},[e,c]),(0,l.useEffect)(()=>{if(n.current||!(0,ew.pA)(e.length))return;n.current=!0,a(!0);let r=!1;return(async()=>{try{let e=await (0,ew.CT)(t);r||s(()=>{o(e)})}catch(e){console.error("Failed to fetch remaining embedding doctors",e)}finally{r||a(!1)}})(),()=>{r=!0}},[t.typeEmbedding,t.allDoctors,t.embebIds.join(","),e.length]),{listingAll:r,isFetchingRemaining:i,initialFetchCount:ew.oQ}},ViewAllBtn=e=>{let{fullWidth:t=!1,target:r="_blank",rel:l="noopener noreferrer",style:i,sx:a,...n}=e,{formatMessage:c}=(0,p.Z)(),d=(0,s.rZ)(),h={target:r,rel:l,...n};return(0,o.tZ)(E.B,{component:"a",size:"lg",variant:"white",fullWidth:t,sx:{width:t?"100%":"auto",display:t?void 0:"inline-flex",textDecoration:"none",backgroundColor:d.white,color:d.colors.blue[6],transition:"background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease","&:hover":{backgroundColor:d.colors.blue[6],color:d.white,borderColor:d.colors.blue[6]},...a&&"object"==typeof a&&!Array.isArray(a)?a:{}},style:i,...h,children:c({id:"categoryPage.seeAll"})})},formatProps=(e,t)=>{var r,o;return"top_service"===t?{name:e.name,validOutpatient:!1,validTelemedicine:!1,rating:e.hospital.rating||"",doctorSpecialties:[],hospital:e.hospital.name||"",hospitalLogo:e.hospital.logo||"",hospitalAddress:e.hospital.address||"",slug:e.slug,id:e.id,avatar:e.image||"",price:e.price||"",priceUnit:e.priceUnit||"",originalPrice:e.originalPrice||"",cityName:(null===(r=e.hospital.city)||void 0===r?void 0:r.name)||""}:{name:e.name,validOutpatient:e.validOutpatient,validTelemedicine:e.validTelemedicine,rating:e.rating,doctorSpecialties:e.doctorSpecialties,hospital:e.hospital.name||"",hospitalLogo:e.hospital.logo||"",hospitalAddress:e.hospital.address||"",slug:e.slug,id:e.id,avatar:e.avatar,price:e.price||"",priceUnit:e.priceUnit||"",originalPrice:e.originalPrice||"",cityName:(null===(o=e.hospital.city)||void 0===o?void 0:o.name)||"",doctorWebsite:e.doctorWebsite||""}},eA={[n.L.Vietnam]:"tat-ca",[n.L.Indonesia]:"semua"},getListingItemId=e=>{var t;return String(null!==(t=e.id)&&void 0!==t?t:"")};var eN=(0,l.memo)((0,l.forwardRef)((e,t)=>{var r,n;let{defaultColor:b,sessionProps:C,hidePrice:y,hideViewAll:S,hideBgPattern:w,listingAll:Z=[],selectedFilterId:k,filterColor:P,styles:D,showConfirmCityPopup:T,viewAllUrl:I,layoutConfig:L,showPromotionEvent:B,carouselListProps:A,applyH1:N,campaign:F,...M}=e,{locale:R}=(0,v.h)(),E=!!(D&&Object.keys(D).length>0),{classes:z}=eg({},{name:"CarePathDoctorList",...E?{styles:D}:{}}),{formatMessage:W}=(0,p.Z)(),X=(0,l.useRef)(null),O=(0,l.useRef)(null),K=(0,l.useRef)(null),[G,V]=(0,l.useState)(!0),{title:j,description:Y,typeEmbedding:U,embebIds:q,allDoctors:Q,horizontalLayout:J,backgroundColor:$}=C,[ee,et]=(0,l.useState)(()=>"top_service"===C.typeEmbedding&&Z.length>0?Z:null),{listingAll:er,isFetchingRemaining:eo}=useEmbeddingDoctorsListing(Z,C),el=$||b,ei=(0,s.rZ)(),ea=(0,f.d)(),en=(0,l.useMemo)(()=>"top_service"===U,[U]),es=(0,l.useMemo)(()=>"doctors"===U||"specialties"===U,[Q,U]),[ec,ed]=(0,l.useState)(""),[eh,eu]=(0,l.useState)(null),[ep,em]=(0,l.useState)(null),ef=(0,l.useMemo)(()=>({keyword:ec,cityFilterId:eh,specialtyFilterId:ep}),[ec,eh,ep]),[ev,ex]=(0,l.useState)(null),eb=(0,l.useMemo)(()=>es?applyCarePathDoctorListFilters(er,ef):en?null!=ee?ee:[]:er,[es,en,er,ef,ee]),eC=(0,l.useMemo)(()=>es?"doctors:".concat(ec,"|").concat(null!=eh?eh:"","|").concat(null!=ep?ep:""):en?"top_service:".concat(null!=ev?ev:"all"):"default",[es,en,ec,eh,ep,ev]),ey=(0,l.useCallback)((e,t)=>formatProps(e,t),[]),eZ=(0,l.useCallback)(()=>{var e,t;ed(""),eu(null),em(null),null===(e=O.current)||void 0===e||e.setDoctorsSelectedFilterId("all"),null===(t=K.current)||void 0===t||t.setSpecialtySelectedFilterId("all")},[]),ek=0===er.length&&(eo||en&&null===ee||!en&&!es&&null===ee),eP=null!==(r=null==eb?void 0:eb.length)&&void 0!==r?r:0,eD=er.length,eT=es&&eD>0,eI=null!==(n=null==A?void 0:A.gapDesktop)&&void 0!==n?n:20,eL=P||b,eN=(0,l.useCallback)(e=>{let{doctors:t,isAllCitiesSelected:r,filterValue:o}=e;et(t),V(r),ex(o)},[]),eF=(0,l.useCallback)(e=>{let{filterValue:t,isAllCitiesSelected:r}=e;eu(r?null:t)},[]),eM=(0,l.useCallback)(e=>{let{filterValue:t,isAllSpecialtiesSelected:r}=e;em(r?null:t)},[]);(0,l.useImperativeHandle)(t,()=>({setSelectedFilterId:e=>{var t,r,o;null===(t=X.current)||void 0===t||t.setTopServiceSelectedFilterId(e),null===(r=O.current)||void 0===r||r.setDoctorsSelectedFilterId(e),null===(o=K.current)||void 0===o||o.setSpecialtySelectedFilterId(e)}})),(0,l.useEffect)(()=>{en||es||et(er)},[en,es,er]);let eR=(0,l.useMemo)(()=>(null===eh||"all"===eh)&&(null===ep||"all"===ep),[eh,ep]),eE=(0,l.useMemo)(()=>buildCarePathDoctorListResetEventLabel({searchKeyword:ec,cityFilterId:eh,specialtyFilterId:ep,listingAll:er}),[ec,eh,ep,er]),ez=(0,l.useMemo)(()=>!hasCarePathDoctorListActiveFilters({searchKeyword:ec,cityFilterId:eh,specialtyFilterId:ep}),[ec,eh,ep]),eW=(0,l.useMemo)(()=>es&&hasCarePathDoctorListActiveFilters({searchKeyword:ec,cityFilterId:eh,specialtyFilterId:ep}),[es,ec,eh,ep]),eX=(0,l.useMemo)(()=>en&&!!ev&&"all"!==ev,[en,ev]),eO=(0,l.useMemo)(()=>eW||eX?eD:eP,[eW,eX,eD,eP]),viewAllByType=e=>{var t;return"/care/".concat((null==eA?void 0:eA[R])||"all","/").concat(null===(t=x.a8[R])||void 0===t?void 0:t["top_service"===U?"SERVICE":"DOCTOR"],"/").concat(e?"?specialtyId=".concat(e):"")},eH=I||"https://".concat(m.domainLocales[R]).concat("specialties"===U&&1===q.length?viewAllByType(null==q?void 0:q[0]):viewAllByType()),e_={href:eH,target:"_blank","data-event-category":"Service Connection","data-event-action":"View All Doctor Click","data-event-label":eH},eK=!S&&!en&&!Q,eG=(0,l.useMemo)(()=>resolveDoctorCardDisplay({isMobile:ea,itemCount:eO,horizontalLayout:J,layoutConfig:L}),[ea,eO,J,L]),eV=(0,l.useMemo)(()=>resolveDesktopDoctorListLayout(eO,"horizon"===eG,{useScrollLayoutFromFour:eo&&eO===ew.oQ}),[eO,eG,eo]),ej=(0,l.useCallback)(()=>{var e,t;en?null===(e=X.current)||void 0===e||e.openFilter():es&&(null===(t=O.current)||void 0===t||t.openFilter())},[en,es]),eY=(0,l.useMemo)(()=>({className:"item",isService:"top_service"===U,hidePrice:y,display:eG,showPromotionEvent:B,showConfirmCityPopup:T&&(es?eR:G),campaign:F,onCancel:ej}),[U,y,eG,B,T,es,eR,G,F,ej]);return(0,o.tZ)(i.T,{variant:i.C.LEADGEN,children:(0,o.BX)(c.x,{sx:{position:"relative",background:el},...M,children:[!w&&(0,o.BX)(c.x,{sx:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none"},children:[(0,o.tZ)(c.x,{sx:{position:"absolute",left:0,top:0},children:(0,o.tZ)(Circle,{color:ei.fn.darken(el,.08)})}),(0,o.BX)(c.x,{sx:{position:"absolute",right:0,bottom:0},children:[(0,o.tZ)(HalfCircle,{color:ei.fn.lighten(el,.08)}),(0,o.tZ)(c.x,{sx:{position:"absolute",left:(0,d.h)(44),top:0,transform:"translate(0, -75%)"},children:(0,o.tZ)(Shape,{color:ei.fn.darken(el,.08)})})]})]}),(0,o.tZ)(g.W,{style:{position:"relative"},children:(0,o.BX)(h.K,{sx:e=>({padding:"".concat((0,d.h)(24)," 0"),gap:8,[e.fn.largerThan("sm")]:{gap:24,padding:"".concat((0,d.h)(40)," 0")}}),children:[(0,o.BX)(u.k,{justify:"space-between",sx:e=>({gap:16,[e.fn.smallerThan("sm")]:{flexDirection:"column",gap:8}}),children:[(0,o.BX)(h.K,{sx:e=>({gap:(0,d.h)(8),[e.fn.largerThan("sm")]:{gap:(0,d.h)(12)}}),children:[j&&(0,o.tZ)(a.T,{size:"h2",as:N?"h1":"h2",color:"#fff",children:j}),Y&&(0,o.tZ)(a.T,{size:"s3",color:"#fff",weight:"semiBold",children:Y})]}),en?(0,o.tZ)(c.x,{sx:getCarePathDoctorListDefaultFilterWidthSx(ei),children:(0,o.tZ)(eB,{ref:X,categoryIds:q,listingAll:er,selectedFilterId:k,filterColor:P,onFilterChange:eN})}):eT?(0,o.tZ)(c.x,{sx:e=>({width:"100%",[e.fn.largerThan("sm")]:{width:"auto"}}),children:(0,o.tZ)(_,{listingAll:er,searchKeyword:ec,cityFilterId:eh,specialtyFilterId:ep,filterColor:P,doctorsFilterRef:O,specialtiesFilterRef:K,onSearchKeywordChange:ed,onDoctorsFilterChange:eF,onSpecialtiesFilterChange:eM,onResetFilters:eZ,showResetButton:!ea})}):null]}),(0,o.BX)(u.k,{justify:"space-between",align:"center",sx:e=>({[e.fn.smallerThan("sm")]:{minHeight:48}}),children:[(0,o.tZ)(a.T,{size:"title1",color:"#fff",weight:"semiBold",children:W({id:en?"carePathDoctorList.totalSearchPerTotalService":"carePathDoctorList.totalSearchPerTotalDoctor",defaultMessage:en?"{search}/{total} services":"{search}/{total} doctors"},{search:eP,total:er.length})}),eT&&ea&&(0,o.tZ)(H,{onClick:eZ,eventLabel:eE,disabled:ez}),eK&&!ea&&(0,o.tZ)(ViewAllBtn,{...e_})]}),(0,o.tZ)(eS,{displayDoctors:eb,isLoading:ek,typeEmbedding:U,isMobile:ea,listingGapDesktop:eI,desktopListLayout:eV,arrowColor:eL,mobileListFilterKey:eC,cardWrapperClassName:z.cardWrapper,formatCardItem:ey,cardCommonProps:eY}),eK&&ea&&(0,o.tZ)(c.x,{className:eP>4?z.mobileViewAllBtnWrapper:z.mobileViewAllBtnWrapperOnly,children:(0,o.tZ)(ViewAllBtn,{...e_,fullWidth:!0})})]})})]})})}),(e,t)=>{var r,o;let l=null!==(r=e.listingAll)&&void 0!==r?r:[],i=null!==(o=t.listingAll)&&void 0!==o?o:[];return!(l!==i&&(l.length!==i.length||l.some((e,t)=>getListingItemId(e)!==getListingItemId(i[t]))))&&e.defaultColor===t.defaultColor&&e.selectedFilterId===t.selectedFilterId&&e.hidePrice===t.hidePrice&&e.hideViewAll===t.hideViewAll&&e.hideBgPattern===t.hideBgPattern&&e.filterColor===t.filterColor&&e.showConfirmCityPopup===t.showConfirmCityPopup&&e.viewAllUrl===t.viewAllUrl&&e.layoutConfig===t.layoutConfig&&e.showPromotionEvent===t.showPromotionEvent&&e.applyH1===t.applyH1&&e.campaign===t.campaign&&e.sessionProps.title===t.sessionProps.title&&e.sessionProps.description===t.sessionProps.description&&e.sessionProps.typeEmbedding===t.sessionProps.typeEmbedding&&e.sessionProps.horizontalLayout===t.sessionProps.horizontalLayout&&e.sessionProps.backgroundColor===t.sessionProps.backgroundColor&&e.sessionProps.allDoctors===t.sessionProps.allDoctors&&e.sessionProps.embebIds===t.sessionProps.embebIds})},hhen:function(e,t,r){r.d(t,{f:function(){return CarePathProductWidgets}});var o=r("BGKE"),l=r("/kWL"),i=r("Eso5"),a=r("gHFm"),n=r("hXNO"),s=r("/npG"),c=r("mYVa"),d=(0,s.k)((e,t)=>{let{bgColor:r,productNumber:o}=t;return{root:{backgroundColor:r||e.colors.blue[0],paddingTop:(0,c.h)(80),paddingBottom:(0,c.h)(80),[e.fn.smallerThan("sm")]:{paddingTop:(0,c.h)(32),paddingBottom:(0,c.h)(32)}},inner:{display:"flex",flexDirection:"column",gap:(0,c.h)(16),[e.fn.largerThan("sm")]:{gap:(0,c.h)(40)}},heading:{color:"#fff"},widgets:{[e.fn.largerThan("sm")]:{...1===o?{background:"#fff"}:{padding:0,background:"transparent"}},[e.fn.smallerThan("sm")]:{background:"transparent",margin:"0 -16px"}},cardRoot:{[e.fn.largerThan("sm")]:{...2===o?{padding:(0,c.h)(16)}:{}}},cardThumbnail:{[e.fn.largerThan("sm")]:{...2===o?{width:(0,c.h)(164)}:{}}},progressBar:{},progressRoot:{background:"rgba(255,255,255,0.5)"}}}),h=r("yioo");let CarePathProductWidgets=e=>{let{title:t,products:r=[],styles:s,classNames:c,className:u,bgColor:p,applyH1:g}=e,m=(0,n.d)(),f=r.length,{classes:v,cx:x}=d({bgColor:p,productNumber:f},{name:"CarePathProductWidgets",styles:s,classNames:c});return r.length>0?(0,o.tZ)(i.x,{className:x(v.root,u),children:(0,o.tZ)(a.W,{children:(0,o.BX)(i.x,{className:v.inner,children:[t&&(0,o.tZ)(l.T,{size:"h2",as:g?"h1":"h3",className:v.heading,children:t}),(0,o.tZ)(h.ProductsWidget,{products:r,numberItemToSlideDesktop:6,numberItemToSlideMobile:2,cartBtnColor:p,layout:m?Array(f).fill("wide-horizon"):["wide-horizon","wide-horizon","horizon","vertical"],classNames:{root:v.widgets,progressBar:v.progressBar,progressRoot:v.progressRoot,cardRoot:v.cardRoot}})]})})}):null}},"/lrZ":function(e,t,r){r.d(t,{O:function(){return CarePathSelection}});var o=r("BGKE"),l=r("owZr"),i=r("/kWL"),a=r("mYVa"),n=r("Eso5"),s=r("OAL+"),c=r("0Tuv"),d=r("gHFm"),h=r("eO6u"),u=r("raAP"),p=r("hXNO"),g=r("/npG"),m=(0,g.k)((e,t)=>{let{unsetRatio:r,detectPage:{isSimilac:o}}=t,l=e.colors;return{root:{},container:{},wrapper:{gap:(0,a.h)(32),padding:"".concat((0,a.h)(24)," 0"),[e.fn.largerThan("sm")]:{gap:(0,a.h)(64),padding:(0,a.h)(80)}},heading:{},description:{color:e.colors.gray[8]},bannerImg:{[e.fn.largerThan("sm")]:{maxWidth:(0,a.h)(744)}},optionList:{display:"flex",[e.fn.smallerThan("sm")]:{flexDirection:"column",width:"100%",gap:(0,a.h)(12)},[e.fn.largerThan("sm")]:{justifyContent:"center",gap:(0,a.h)(24),".item":{width:(0,a.h)(264)}}},radioOptionRoot:{...o&&{backgroundColor:"#fff"},...!r&&{borderRadius:(0,a.h)(16),border:"2px solid transparent",boxShadow:"0px 0px 1px 0px rgba(0, 0, 0, 0.04), 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 16px 24px 0px rgba(0, 0, 0, 0.06)",transition:"all .1s ease",'&[data-checked="true"]':{borderColor:e.fn.primaryColor(),backgroundColor:l[e.primaryColor][0]}}},radioOptionLabel:{padding:0,cursor:"pointer"},radioOptionLabelWrapper:{width:"100%"},radioOptionInner:{display:"none"},optionRoot:{},optionWrapper:{},optionThumbnail:{},optionHeading:{}}});r("q1tI");var f=r("RZSM"),v=(0,g.k)(e=>({root:{},wrapper:{display:"flex",[e.fn.smallerThan("sm")]:{alignItems:"center",padding:(0,a.h)(8),gap:(0,a.h)(16),img:{width:(0,a.h)(48)}},[e.fn.largerThan("sm")]:{flexDirection:"column",alignItems:"center",padding:"".concat((0,a.h)(12)," ").concat((0,a.h)(12)," ").concat((0,a.h)(24)),gap:(0,a.h)(24)}},thumbnail:{borderRadius:(0,a.h)(16),[e.fn.smallerThan("sm")]:{width:(0,a.h)(120)}},heading:{textAlign:"center"}}));let CarePathOption=e=>{let{label:t,icon:r,className:l,classNames:a,styles:s,...c}=e,{classes:d,cx:h}=v(void 0,{name:"CarePathSelection__Option",styles:s,classNames:a});return(0,o.tZ)(n.x,{className:h(l,d.root),...c,children:(0,o.BX)(n.x,{className:d.wrapper,children:[(0,o.tZ)(f.o,{className:d.thumbnail,ratio:1.5,w:"100%",variant:"",children:(0,o.tZ)("img",{src:"".concat(r,"?w=300&q=90"),style:{borderRadius:"inherit"},alt:"",loading:"lazy"})}),(0,o.tZ)(i.T,{className:d.heading,size:"s3",weight:"semiBold",children:t})]})})};var x=r("DslX");let CarePathSelection=e=>{let{heading:t,description:r,unsetRatio:g,useCommonAssess:f,assessFolderName:v,options:b,onSelect:C,keyID:y="",styles:S,classNames:w,className:Z}=e,k=(0,u.U)(),P=(0,x.d)(y),{isNestle:D,isSimilac:T,isVinamilk:I}=P||{},L=(0,p.d)(),{classes:B,cx:A}=m({unsetRatio:g,detectPage:P},{name:"CarePathSelection",styles:S,classNames:w});return(0,o.tZ)(h.Yr,{className:"service-connection-page",style:{minHeight:(0,a.h)(610),marginBottom:0,...T&&{backgroundColor:"#E6FAF7"},...I&&{backgroundColor:"#CFFEC8",backgroundImage:"url(".concat(l.C.getAssetPath("vinamilk/selection-bg.png"),")")}},children:(0,o.tZ)(n.x,{className:A(B.root,Z),children:(0,o.tZ)(d.W,{className:B.container,children:(0,o.BX)(s.K,{className:B.wrapper,align:"stretch",children:[D?(0,o.tZ)(o.HY,{children:(0,o.tZ)(n.x,{sx:{textAlign:"center"},children:(0,o.tZ)("img",{src:l.C.getAssetPath(L?"nestle/selection_banner_mobile.png":"nestle/selection_banner_desktop.png"),loading:"lazy",alt:"Nestle",className:B.bannerImg})})}):(0,o.tZ)(o.HY,{children:(t||r)&&(0,o.BX)(s.K,{spacing:(0,a.h)(8),align:"center",sx:{textAlign:"center"},children:[t&&(0,o.tZ)(i.T,{size:"h1",className:B.heading,as:"div",children:(0,o.tZ)("h1",{dangerouslySetInnerHTML:{__html:t}})}),r&&(0,o.tZ)(i.T,{size:"p3",className:B.description,as:"div",children:(0,o.tZ)("div",{dangerouslySetInnerHTML:{__html:r}})})]})}),(0,o.tZ)(c.Y.Group,{unstyled:!0,onChange:e=>{null==C||C(b.filter(t=>t.groupId===e)[0]||{})},children:(0,o.tZ)(n.x,{className:B.optionList,children:b.map((e,t)=>(0,o.tZ)(c.Y,{classNames:{root:B.radioOptionRoot,label:B.radioOptionLabel,labelWrapper:B.radioOptionLabelWrapper,inner:B.radioOptionInner},value:e.groupId,label:g?(0,o.tZ)(n.x,{"data-event-category":"Service Connection","data-event-action":"Select Audience","data-event-label":k,"data-event-audience":e.label,className:"item pointer-event-child-none",children:(0,o.tZ)("img",{src:f?l.C.getAssetPath(L?"".concat(v,"/option").concat(t+1,"_mobile.png"):"".concat(v,"/option").concat(t+1,".png")):e.icon,loading:"lazy",alt:e.label})}):(0,o.tZ)(CarePathOption,{"data-event-category":"Service Connection","data-event-action":"Select Audience","data-event-label":k,"data-event-audience":e.label,className:"item pointer-event-child-none",classNames:{root:B.optionRoot,wrapper:B.optionWrapper,thumbnail:B.optionThumbnail,heading:B.optionHeading},...e},String(t))},String(t)))})})]})})})})}}}]);