"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4447],{ZI5f:function(e,t,a){a.d(t,{A:function(){return Avatar},D:function(){return DistanceTag},I:function(){return IconWrapper},P:function(){return Pin3},S:function(){return ShapedArrowDown}});var i=a("q1tI"),o=a("rBCA"),r=a("iBNF"),n=a("RBzE"),l=a("uzh1");let Pin3=e=>i.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"none"},e),i.createElement("g",{clipPath:"url(#clip0_5371_10640)"},i.createElement("path",{d:"M6.6665 4.3335L8.1665 5.8335L6.6665 7.3335",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M8.16667 5.8335H5.83333C5.09667 5.8335 4.5 6.43016 4.5 7.16683V7.50016",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M6.94331 10.3902L10.3907 6.94281C10.9114 6.42211 10.9114 5.57789 10.3907 5.05719L6.94331 1.60981C6.42261 1.08911 5.57839 1.08911 5.05769 1.60981L1.61031 5.05719C1.08961 5.57789 1.08961 6.42211 1.61031 6.94281L5.05769 10.3902C5.57839 10.9109 6.42261 10.9109 6.94331 10.3902Z",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"})),i.createElement("defs",null,i.createElement("clipPath",{id:"clip0_5371_10640"},i.createElement("rect",{width:12,height:12,fill:"white"})))),ShapedArrowDown=e=>i.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none"},e),i.createElement("path",{d:"M13.5554 9.33398L7.99989 5.55621L2.44434 9.33398",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),s=o.Z.div` background-color: var(--background-color, transparent); color: white; cursor: pointer; img { --width: var(--width-prop, 40px); --height: var(--height-prop, 40px); width: var(--width); height: var(--height); } &[data-has-max='true'] { img { max-width: var(--width); max-height: var(--height); } } &[data-avatar-type='square'] { img { --width: var(--width-prop, 72px); --height: var(--height-prop, 72px); border-radius: ${r.r.borderRadius}; } } &[data-avatar-type='rounded'] { img { border-radius: 50%; } } &[data-custom-size='true'] { display: flex; overflow: hidden; overflow: hidden; width: var(--size); height: var(--size); align-items: center; justify-content: center; background-size: cover; font-size: calc(var(--size) / 2); font-weight: bold; &[data-avatar-type='square'] { border-radius: ${r.r.borderRadius}; } &[data-avatar-type='rounded'] { border-radius: 50%; img { --width: 100%; --height: 100%; } } img { object-fit: cover; } } `,c={xs:28,small:32,medium:40,large:48,xl:64,xxl:80,xxxl:96},Avatar=({type:e="square",size:t,avatarImg:a,avatarUrl:o,firstLetter:r,backgroundColor:l,onClick:d,style:u,className:p,width:h,height:g,alt:m})=>{let b=t?c[t]:void 0,[E,S]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(o){let e=document.createElement("img");e.setAttribute("src",o),e.addEventListener("error",()=>{S(!0)})}},[o,S]);let f=(!o&&!a||E)&&r;return i.createElement(s,{style:Object.assign(Object.assign({},u),{"--size":b?b+"px":void 0,"--width-prop":h?h+"px":void 0,"--height-prop":g?g+"px":void 0,"--background-color":l}),"data-has-max":!!(h&&g),"data-avatar-type":e,onClick:d,className:p,avatarUrl:o,"data-custom-size":!!t},a,o&&!E&&i.createElement(n.I,{src:o,alt:m||"avatar"}),f&&r)},d=o.Z.div` display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; color: ${r.r.colors.red700}; border-radius: 8px; border: 1px solid ${r.r.colors.neutral100}; font-size: 0.6875rem; line-height: 1rem; border-radius: 0.5rem; `,u=(0,o.Z)(Pin3)` width: 0.75rem; height: 0.75rem; color: ${r.r.colors.gray400}; `;function DistanceTag({value:e,className:t}){return i.createElement(d,{className:t},i.createElement(u,null),i.createElement(l.T,{size:"p3",weight:"regular",color:r.r.colors.gray400},e))}let p=o.Z.div` display: inline-flex; align-items: center; justify-content: center; flex-grow: 0; flex-shrink: 0; width: calc(var(--wrapper-size, var(--icon-size)) * 1px); height: calc(var(--wrapper-size, var(--icon-size)) * 1px); &[data-clickable='true'] { cursor: pointer; } > * { width: calc(var(--icon-size) * 1px); height: calc(var(--icon-size) * 1px); } &[data-svg-custom-stroke='true'] > svg * { stroke: var(--icon-stroke-color); } &[data-svg-custom-fill='true'] > svg * { fill: var(--icon-fill-color); } `,IconWrapper=({children:e,className:t,onClick:a,wrapperSize:o,iconSize:r=24,wrapperStyle:n,iconStyle:l,svgIcon:s,wrapperProps:c})=>i.createElement(p,Object.assign({className:t,onClick:a,style:Object.assign(Object.assign(Object.assign(Object.assign({},o&&{"--wrapper-size":o}),r&&{"--icon-size":r}),s&&Object.assign(Object.assign({},s.fill&&{"--icon-fill-color":s.fill}),s.stroke&&{"--icon-stroke-color":s.stroke})),n),"data-clickable":!!a,"data-svg-custom-stroke":!!(null==s?void 0:s.stroke),"data-svg-custom-fill":!!(null==s?void 0:s.fill)},c),i.cloneElement(e,{style:l}))},vucB:function(e,t,a){a.d(t,{B:function(){return BookingSearchBarV3},T:function(){return TextDivider}});var i,o,r,n,l=a("q1tI"),s=a("6mQP"),c=a("0D4Z"),d=a("iuhU"),u=a("Eso5"),p=a("aDCK"),h=a("mYVa"),g=a("vaps"),m=a("8vDj"),b=a("OAL+"),E=a("SPK5"),S=a("TIp3"),f=a("CmzK"),y=a("NEaA"),v=a("rlLN"),x=a("Iblh"),C=a("DKrg"),I=a("wgce"),T=a("sFNn"),_=a("sEfC"),O=a.n(_),w=a("LuOk"),L=a("rBCA"),k=a("iBNF"),R=a("CL9C"),N=a("cSIu"),M=a("uzh1"),A=a("jjeI"),U=a("vEfc"),B=a("A24R"),D=a("TWAq"),P=a("LrmT"),j=a("abax");let $=L.Z.div``,F=L.Z.div` background-color: ${k.r.colors.neutral50}; padding-bottom: 1px; ${R.M.mbDown} { padding: 0; } `,G=(0,L.Z)(N.C)` padding: 0 16px; ${R.M.mbDown} { padding: 0; } `,z=L.Z.div` padding: 24px 56px; border-radius: 16px; background-color: ${k.r.colors.white}; box-shadow: 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); ${R.M.mbDown} { padding: 16px; border-radius: 0; } .flex-search-input { flex-direction: row; ${R.M.mbDown} { flex-direction: column; } } `,K={"en-PH":3,"tl-PH":2,"id-ID":3,"vi-VN":2,"zh-TW":0,"ms-MY":2,"th-TH":2},H={isMobile:!1,isDebug:!1,navigateTo:null,geoLocationPermission:"unset",geoLocationCoordinates:null,focused:"none",focusedSpecialty:"none",searchLocationKeywords:"",searchSpecialtyKeywords:"",searchKeywords:"",selectedLocation:null,selectedSpecialty:null,defaultCity:null,initialCities:[],cities:[],searchResults:{},initialSearchResults:{},isLoadingCities:!1,isLoadingSearchResults:!1,isMobileModalOpened:!1,initialSelectedCity:null,autoCompleteDisabled:!1,inputSearchPlaceholder:"",locale:"vi-VN",allSpecialties:[],popularKeys:[]};function resetSearchLocationKeywords(e){let{selectedLocation:t,searchLocationKeywords:a}=e;return t&&a!==t.name?Object.assign(Object.assign({},e),{searchLocationKeywords:t.name}):e}function reducer(e,t){var a,i;switch(e.isDebug&&console.log("bookingSearchBarV3",{action:t,state:e}),t.type){case r.NavigateTo:return Object.assign(Object.assign({},e),{navigateTo:t.payload,focused:"none",isMobileModalOpened:!1});case r.ClickOutsideInputLocation:if("location"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case r.ClickOutsideInputSpecialty:if("specialty"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case r.ClickOutsideInputSearch:if("search"!==e.focused)return e;return Object.assign(Object.assign({},e),{focused:"none"});case r.ClickOutsideInputSearchSpecialty:if("search"!==e.focusedSpecialty)return e;return Object.assign(Object.assign({},e),{focusedSpecialty:"none"});case r.FocusInputLocation:{let t=Object.assign(Object.assign({},e),{focused:"location"});return(null===(a=e.selectedLocation)||void 0===a?void 0:a.id)===w.a&&(t.searchLocationKeywords=""),t}case r.FocusInputSpecialty:{let t=Object.assign(Object.assign({},e),{focused:"specialty"});return(null===(i=e.selectedLocation)||void 0===i?void 0:i.id)===w.a&&(t.searchLocationKeywords=""),t}case r.FocusInputSearch:let o=Object.assign(Object.assign({},e),{focused:"search"});if(e.isMobile)return resetSearchLocationKeywords(o);return o;case r.FocusInputSearchSpecialty:{let t=Object.assign(Object.assign({},e),{focusedSpecialty:"search"});return t}case r.ChangeInputLocation:return Object.assign(Object.assign({},e),{searchLocationKeywords:t.payload});case r.ChangeInputSearch:{let a=t.payload;return Object.assign(Object.assign({},e),{searchKeywords:a,isLoadingSearchResults:a.trim().length>K[e.locale]})}case r.SelectCurrentLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case r.ClearInputLocation:return Object.assign(Object.assign({},e),{focused:"location",cities:e.initialCities,searchLocationKeywords:""});case r.ClearInputSearch:return Object.assign(Object.assign({},e),{focused:"search",searchKeywords:""});case r.SelectLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name,searchResults:{}});case r.SelectSpecialty:return Object.assign(Object.assign({},e),{focused:"none",selectedSpecialty:t.payload,searchResults:{}});case r.SelectSearchResult:return Object.assign(Object.assign({},e),{searchKeywords:t.payload.name,isMobileModalOpened:!1,focused:"none",navigateTo:t.payload.url});case r.FetchCitiesStart:return Object.assign(Object.assign({},e),{isLoadingCities:!0});case r.FetchCitiesFinish:return Object.assign(Object.assign({},e),{isLoadingCities:!1});case r.FetchSearchResultsStart:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!0});case r.FetchSearchResultsFinish:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!1});case r.FetchSearchResultsComplete:{let a=Object.assign(Object.assign({},e),{searchResults:Object.assign(Object.assign({},e.searchResults),{[t.payload.key]:t.payload.searches})});return a}case r.FetchCitiesByGeoIpComplete:{let{cities:a}=t.payload,{default:i}=t.payload;a=a.filter(e=>e.id!==i.id),i&&a.unshift(i),e.initialSelectedCity&&!a.find(t=>t.id===e.initialSelectedCity.id)&&a.unshift(e.initialSelectedCity);let o=Object.assign(Object.assign({},e),{defaultCity:i,initialCities:a,cities:a});return"denied"!==e.geoLocationPermission||e.initialSelectedCity||(o.selectedLocation=i,o.searchLocationKeywords=i.name),o}case r.FetchCitiesByKeywordComplete:return Object.assign(Object.assign({},e),{cities:t.payload});case r.DisplayInitialCities:return Object.assign(Object.assign({},e),{cities:e.initialCities});case r.DisplayInitialSearchResults:{let t=e.searchKeywords.trim(),a=K[e.locale],i=t.length>0&&t.length<=a;return Object.assign(Object.assign({},e),{searchResults:i?{}:e.initialSearchResults,isLoadingSearchResults:!1})}case r.UpdateInitialSearchResults:return Object.assign(Object.assign({},e),{initialSearchResults:Object.assign(Object.assign({},e.initialSearchResults),{[t.payload.key]:t.payload.searches})});case r.GrantGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"granted",geoLocationCoordinates:t.payload});case r.DenyGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"denied",geoLocationCoordinates:null});case r.OpenMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!0});case r.CloseMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!1});case r.UpdateInitialSearchValue:return Object.assign(Object.assign({},e),{searchKeywords:t.payload});case r.SetInputSearchPlaceholder:return Object.assign(Object.assign({},e),{inputSearchPlaceholder:t.payload});case r.FetchAllSpecialties:return Object.assign(Object.assign({},e),{allSpecialties:t.payload});case r.FetchPopularKeys:return Object.assign(Object.assign({},e),{popularKeys:t.payload});default:return e}}(i=r||(r={})).NavigateTo="navigate to url",i.ClickOutsideInputLocation="click outside input location",i.ClickOutsideInputSearch="click outside input search",i.ClickOutsideInputSearchSpecialty="click outside input search specialty",i.ClickOutsideInputSpecialty="click outside input specialty",i.SelectCurrentLocation="select current location",i.FocusInputLocation="focus input location",i.FocusInputSearch="focus input search",i.FocusInputSearchSpecialty="focus input search specialty",i.ChangeInputLocation="change input location",i.ChangeInputSearch="change input search",i.ClearInputLocation="clear input location",i.ClearInputSearch="clear input search",i.SelectLocation="select location",i.SelectSpecialty="select specialty",i.FetchCitiesStart="fetch cities start",i.FetchCitiesFinish="fetch cities finish",i.FetchSearchResultsStart="fetch search results start",i.FetchSearchResultsComplete="fetch search results complete",i.FetchSearchResultsFinish="fetch search results finish",i.FetchCitiesByGeoIpComplete="fetch cities by geo IP finish",i.FetchCitiesByKeywordComplete="fetch cities by keyword finish",i.DisplayInitialCities="display initial cities",i.DisplayInitialSearchResults="display initial search results",i.UpdateInitialSearchResults="update initial search results",i.GrantGeoLocationPermission="grant geolocation permission",i.DenyGeoLocationPermission="deny geolocation permission",i.OpenMobileModal="open mobile modal",i.CloseMobileModal="close mobile modal",i.UpdateInitialSearchValue="update initial search value",i.SelectSearchResult="select search result",i.SetInputSearchPlaceholder="set input search placeholder",i.FocusInputSpecialty="focus input specialty",i.FetchAllSpecialties="fetch all specialty",i.FetchPopularKeys="fetch popular key by type";let q=L.Z.div` flex: 1; position: relative; ${R.M.mbDown} { width: 100%; } `,Z=L.Z.div` background: #f7f9fc; border-radius: 12px; height: 48px; display: flex; align-items: center; padding: 4px 12px 4px 4px; gap: 16px; ${R.M.mbDown} { height: 48px; width: 100%; } `,W=L.Z.div` display: flex; align-items: center; flex-shrink: 0; color: #8c8c8c; svg { width: 18px; height: 18px; } `,V=L.Z.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${k.r.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${R.M.mbDown} { width: calc(100% + 64px); left: -32px; } `,Y=L.Z.div``;L.Z.div` display: flex; justify-content: space-between; align-item: center; padding: 9px 14px 9px 22px; background: #f7f9fc; .title { color: ${k.r.colors.gray800}; font-size: 14px; font-weight: 600; line-height: 22px; } .btn-see-all { color: ${k.r.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `;let Q=L.Z.div` padding: 10px 16px; max-height: 400px; overflow: auto; `,X=L.Z.div` display: flex; gap: 12px; align-items: center; cursor: pointer; ${R.M.mbUp} { &:hover { background-color: ${k.r.colors.blue50}; } } .image-item { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; img { object-fit: contain; width: 100%; height: 100%; border-radius: 50%; } } .infor { overflow: hidden; padding: 12px 0; flex: 1; border-bottom: 1px solid ${k.r.colors.neutral100}; .title { color: ${k.r.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; } .description { overflow: hidden; color: ${k.r.colors.gray600}; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 18px; display: flex; gap: 8px; align-items: center; margin-top: 5px; svg { flex: 0 0 16px; } .sub-description { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; } } } &.last-item { .infor { border-bottom: none; } } `;L.Z.div` padding: 0 16px 16px; .search-detail-btn { color: ${k.r.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `;let SearchResult=({state:e,type:t,results:a,isLoading:i,typeInformation:o,dispatch:n})=>{let{t:s}=(0,T.u)(),{selectedLocation:u}=e,p=(0,l.useMemo)(()=>o[t].slug,[o,t]),handleOnClick=e=>{let a="";switch(t){case"service":a=`/${u.slug}/${p}/${e.slug}`;break;case"doctor":case"hospital":a=`/${p}/${e.slug}-${e.id}`}a&&n({type:r.NavigateTo,payload:a})};return null===a?null:l.createElement(Y,null,l.createElement(Q,{className:"search-results__body"},i&&l.createElement("div",{className:"skeleton-result"},[,,,].fill(void 0).map((e,a)=>l.createElement(X,{key:t+"loading"+a,className:2===a?"last-item":""},l.createElement("div",{className:"image-item"},l.createElement(c.O,{height:48,circle:!0,mb:"xl",animate:!0})),l.createElement("div",{className:"infor"},l.createElement("div",{className:"title"},l.createElement(c.O,{height:8,mt:10,radius:"xl",animate:!0})),l.createElement("div",{className:"description"},l.createElement("div",{className:"sub-description"},l.createElement(c.O,{height:8,mt:10,radius:"xl",width:"80%",animate:!0}))))))),!i&&a&&a.length>0&&l.createElement(l.Fragment,null,a.map((e,i)=>{var r,n;let s=a.length>4&&3===i||a.length<=4&&i===a.length-1,c="";return("hospital"===t&&(c=(null==e?void 0:e.address)||""),"doctor"===t&&(c=(null===(r=null==e?void 0:e.specialties)||void 0===r?void 0:r.join(", "))||""),"service"===t&&(c=(null===(n=null==e?void 0:e.hospital_branch)||void 0===n?void 0:n.name)||""),i>=4)?l.createElement(l.Fragment,null):l.createElement(X,{key:e.id,className:(0,d.default)(s?"last-item":"","result-item"),onClick:()=>handleOnClick(e)},l.createElement("div",{className:"image-item"},l.createElement("img",{src:e.logo||e.avatar,alt:e.name})),l.createElement("div",{className:"infor"},l.createElement("div",{className:"title"},e.name),l.createElement("div",{className:"description"},o[t].icon,l.createElement("div",{className:"sub-description"},c))))})),!i&&(null==a?void 0:a.length)===0&&l.createElement(M.T,{size:"sm",color:k.r.colors.gray400,className:"noresult-block"},s("booking.searchBar.noResults"))))},SearchResultContent=({state:e,type:t,isLoading:a,clientSlug:i,typeInformation:o,dispatch:r})=>{var n;return"search"!==e.focused?null:l.createElement(SearchResult,{type:t,state:e,results:(null===(n=e.searchResults)||void 0===n?void 0:n[t])||null,location:e.selectedLocation.name,dispatch:r,isLoading:a,typeInformation:o,clientSlug:i})},J=L.Z.div` position: relative; flex-shrink: 0; ${R.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } &.compact { ${R.M.mbDown} { width: auto; display: block; } } `,ee=L.Z.div` position: absolute; top: calc(100% + 4px); left: 0; min-width: 264px; background: white; border-radius: 12px; box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.04), 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04); z-index: 10; overflow: hidden; &.mobile { min-width: 280px; } `,et=L.Z.div` cursor: pointer; padding: 12px 16px; display: flex; align-items: center; gap: 12px; outline: none; .image-item { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex-shrink: 0; img { width: 100%; height: 100%; object-fit: contain; } svg { width: 24px; height: 24px; } } .item-label { font-size: 15px; font-weight: 400; line-height: 24px; letter-spacing: -0.3px; color: ${k.r.colors.gray800}; } &:hover { background-color: ${k.r.colors.neutral50}; } &.selected { background-color: ${k.r.colors.neutral50}; } &:last-child { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; } `,DoctorIcon=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},l.createElement("path",{d:"M8.983 14.333q-1.666 0-2.833-1.166Q4.983 12 4.983 10.333v-.366a3.48 3.48 0 0 1-2.258-1.2 3.57 3.57 0 0 1-.909-2.434V3.1a.58.58 0 0 1 .175-.425.58.58 0 0 1 .425-.175h1.4v-.167a.486.486 0 0 1 .5-.5q.217 0 .36.142a.5.5 0 0 1 .14.358v1.334a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V3.5h-1v2.833q0 1.1.784 1.884Q4.383 9 5.483 9t1.883-.783.784-1.884V3.5h-1v.167a.485.485 0 0 1-.5.5.484.484 0 0 1-.5-.5V2.333a.486.486 0 0 1 .5-.5q.217 0 .358.142a.5.5 0 0 1 .142.358V2.5h1.4a.58.58 0 0 1 .425.175.58.58 0 0 1 .175.425v3.233q0 1.4-.908 2.434a3.5 3.5 0 0 1-2.259 1.2v.366q0 1.25.875 2.126a2.9 2.9 0 0 0 2.125.874q1.25 0 2.125-.874a2.9 2.9 0 0 0 .875-2.126V9.25a1.74 1.74 0 0 1-.858-.609 1.6 1.6 0 0 1-.342-1.008q0-.716.5-1.216t1.2-.5q.716 0 1.217.5.5.5.5 1.216 0 .567-.342 1.008t-.875.609v1.083q0 1.667-1.167 2.834-1.166 1.166-2.833 1.166m3.5-6q.3 0 .509-.208a.67.67 0 0 0 .208-.492q0-.3-.208-.508a.7.7 0 0 0-.509-.208q-.3 0-.5.208a.7.7 0 0 0-.2.508q0 .284.2.492t.5.208",fill:"#595959"})),ServiceIcon=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},l.createElement("path",{d:"M6.868 9.265v.974q0 .405.284.69.284.283.69.283t.69-.284.284-.69v-.973h.973q.405 0 .69-.284a.94.94 0 0 0 .284-.689.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284h-.973v-.974a.94.94 0 0 0-.284-.69.94.94 0 0 0-.69-.284.94.94 0 0 0-.689.284.94.94 0 0 0-.285.69v.974h-.973a.94.94 0 0 0-.69.283.94.94 0 0 0-.284.69q0 .405.284.69.285.284.69.284zm-3.46 4.868q-.581 0-.994-.413A1.36 1.36 0 0 1 2 12.725v-6.65a1.4 1.4 0 0 1 .563-1.127l4.434-3.333q.369-.282.844-.282.474 0 .846.282l4.434 3.333q.264.193.413.493.15.3.15.633v6.651q0 .58-.414.995a1.36 1.36 0 0 1-.994.413zm0-1.168h8.868q.105 0 .172-.068a.23.23 0 0 0 .068-.172v-6.65a.2.2 0 0 0-.027-.11.3.3 0 0 0-.07-.085L7.983 2.554a.2.2 0 0 0-.142-.052.2.2 0 0 0-.142.052L3.266 5.88a.3.3 0 0 0-.071.086.2.2 0 0 0-.027.108v6.651q0 .105.068.172a.23.23 0 0 0 .172.068",fill:"#595959"})),HospitalIcon=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},l.createElement("path",{d:"M8 8q.55 0 .941-.392.393-.391.392-.941 0-.55-.392-.942A1.28 1.28 0 0 0 8 5.333q-.55 0-.942.392a1.28 1.28 0 0 0-.391.942q0 .55.391.941Q7.45 8 8 8m0 4.9q2.032-1.866 3.017-3.392Q12 7.983 12 6.8q0-1.817-1.158-2.975Q9.682 2.667 8 2.667T5.158 3.825Q4 4.983 4 6.8q0 1.184.983 2.708Q5.966 11.034 8 12.9m0 1.517a.8.8 0 0 1-.5-.183q-2.433-2.151-3.633-3.992T2.667 6.8q0-2.5 1.608-3.983Q5.883 1.332 8 1.333q2.116 0 3.725 1.484T13.333 6.8q0 1.6-1.2 3.442-1.2 1.841-3.633 3.991a.8.8 0 0 1-.5.184",fill:"#8C8C8C"})),SpecialtyIcon=()=>l.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},l.createElement("path",{d:"M3.833.5a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667M10.5.5c-.92 0-1.667.746-1.667 1.667V5.5c0 .92.746 1.667 1.667 1.667h3.333c.921 0 1.667-.746 1.667-1.667V2.167C15.5 1.246 14.754.5 13.833.5zM3.833 8.833a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667m8.334 0a3.333 3.333 0 1 0 0 6.667 3.333 3.333 0 0 0 0-6.667",fill:"#9AA2AC"})),SearchSpecialty=({state:e,isMobile:t,onSpecialtyClick:a,dispatch:i,isCompact:o=!1})=>{let{t:n,locale:c}=(0,T.u)(),d=(0,l.useRef)(null),m=(0,l.useRef)(null),b=(0,l.useMemo)(()=>w.L[c],[c]),[E,S]=(0,l.useState)(""),[f,{close:y,toggle:v}]=(0,x.q)(!1);(0,I.a)(d,()=>{y(),S(""),i({type:r.ClickOutsideInputSpecialty})});let C=(0,l.useMemo)(()=>[{name:n("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:b.SPECIALTIES},...e.allSpecialties],[e.allSpecialties,n,b.SPECIALTIES]),_=(0,l.useMemo)(()=>E.trim()?C.filter(e=>e.name.toLowerCase().includes(E.toLowerCase().trim())):C,[C,E]),O=(0,l.useMemo)(()=>e.selectedSpecialty?e.selectedSpecialty.name:"",[e.selectedSpecialty]),L=(0,l.useCallback)(e=>{a({id:e.id,name:e.name,slug:e.slug,thumbnail:e.thumbnail||"",total_doctor:0}),y(),S("")},[a,y]),R=(0,l.useCallback)(()=>{v(),f&&S("")},[v,f]);return l.createElement(J,{ref:d,className:o?"compact":""},l.createElement(u.x,{onClick:R,className:f?"dropdown-trigger-open":"",sx:{cursor:"pointer",position:"relative",width:o?t?96:160:"100%",flexShrink:0}},l.createElement(p.I,{readOnly:!0,value:O,placeholder:n("booking.searchPopup.specialties"),rightSection:l.createElement(A.C,{style:{width:20,height:20}}),styles:Object.assign({input:{cursor:"pointer",outline:"none","&:focus":{outline:"none"},"&:not(.mantine-Textarea-input)":{height:o?40:t?40:46,fontSize:o?(0,h.h)(14):t?(0,h.h)(14):(0,h.h)(16),paddingLeft:o?12:16,paddingRight:30,background:o?"white":"transparent",border:o?`1px solid ${k.r.colors.gray200}`:"none",borderRadius:8,letterSpacing:"-0.2px",color:k.r.colors.gray800,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}},rightSection:{width:30,pointerEvents:"none"}},!o&&{wrapper:{position:"relative","&:after":{content:'""',width:"1px",height:"20px",backgroundColor:k.r.colors.neutral100,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)"}}})})),f&&l.createElement(ee,{className:t?"mobile":""},l.createElement(u.x,{sx:{padding:"12px 12px 8px"}},l.createElement(p.I,{ref:m,icon:l.createElement(s.Z,{size:18,color:k.r.colors.gray300}),placeholder:n("booking.searchBar.placeholder.specialty"),value:E,onChange:e=>S(e.target.value),size:"md",styles:{input:{height:40,fontSize:(0,h.h)(15),paddingLeft:36,"&::placeholder":{color:k.r.colors.gray400}},icon:{width:36}}})),l.createElement(g.x.Autosize,{mah:300},0===_.length?l.createElement(u.x,{sx:{padding:"12px 16px",color:k.r.colors.gray400,fontSize:14}},n("common.noResult")):_.map(t=>{var a,i;return l.createElement(et,{key:t.id,tabIndex:0,role:"option","aria-selected":(null===(a=e.selectedSpecialty)||void 0===a?void 0:a.id)===t.id,className:(null===(i=e.selectedSpecialty)||void 0===i?void 0:i.id)===t.id?"selected":"",onClick:()=>L(t),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),L(t))}},l.createElement("div",{className:"image-item"},t.thumbnail?l.createElement("img",{src:t.thumbnail,alt:t.name}):l.createElement(SpecialtyIcon,null)),l.createElement("span",{className:"item-label"},t.name))}))))},ea=(0,l.forwardRef)(({state:e,type:t,isMobile:a,isLoading:i,initalSearchValue:o,typeInformation:n,debouncedFetchSearchResults:c,trackingAttributes:d,hideSpecialtySelection:u=!1,clientSlug:g="",onSearch:m,onFocusInput:b,onEnterSearch:E,dispatch:S,onlyShowSearchBox:f,onChangeSpecialty:y},v)=>{let{t:x}=(0,T.u)(),C=(0,l.useRef)(null),_=(0,l.useRef)(null);(0,l.useImperativeHandle)(v,()=>({focus:()=>{var e;null===(e=_.current)||void 0===e||e.focus()}}));let O=(0,l.useMemo)(()=>d?{"data-event-category":d.dataEventCategory,"data-event-action":d.dataEventAction,"data-event-label":d.dataEventLabel}:{},[d]),w=(0,l.useMemo)(()=>"doctor"===t?x("booking.searchBar.placeholder.doctor"):"service"===t?x("booking.searchBar.placeholder.service"):"hospital"===t?x("booking.searchBar.placeholder.hospital"):"specialty"===t?x("booking.searchBar.placeholder.specialty"):"",[t,x]),L="specialty"!==t&&"service"!==t&&!u&&!f,R=(0,l.useMemo)(()=>({input:{border:"none",background:"transparent",height:"100%",fontSize:(0,h.h)(16),color:k.r.colors.gray800,padding:"0","&::placeholder":{color:k.r.colors.gray400},"&:focus":{outline:"none",boxShadow:"none"},[a?"@media (max-width: 767px)":""]:a?{fontSize:(0,h.h)(16)}:{}},wrapper:{flex:1}}),[a]);(0,I.a)(C,()=>{a||S({type:r.ClickOutsideInputSearch})});let N=(0,l.useCallback)(function(a){S({type:r.ChangeInputSearch,payload:a}),"function"!=typeof m&&(a.trim().length>K[e.locale]||o||0===a.trim().length)&&c(a.trim(),e,t,g)},[S,e,t,o,c,g,m]),M=(0,l.useCallback)(function(e){var t;S({type:r.SelectSpecialty,payload:e}),null==y||y(e),a||null===(t=_.current)||void 0===t||t.focus()},[S,y]),A=(0,l.useCallback)(e=>{"Enter"===e.key&&(e.stopPropagation(),e.preventDefault(),E&&E())},[E]);return l.createElement(q,{ref:C},l.createElement(Z,null,L&&l.createElement(SearchSpecialty,{state:e,isMobile:a,dispatch:S,debouncedFetchSearchResults:c,onSpecialtyClick:M,isCompact:!0}),l.createElement(W,null,l.createElement(s.Z,null)),l.createElement(p.I,Object.assign({ref:_,variant:"unstyled",size:a?"md":"lg",placeholder:w,styles:R,value:e.searchKeywords,name:"search-results",autoComplete:"off",onFocus:()=>{S({type:r.FocusInputSearch}),null==b||b()},onChange:e=>{N(e.target.value)},onKeyDown:A},O))),!a&&"specialty"!==t&&l.createElement(V,null,l.createElement(SearchResultContent,{type:t,state:e,dispatch:S,isLoading:i,typeInformation:n,clientSlug:g})))});ea.displayName="SearchInputs";let ModalSearchResult=e=>{var{searchInputEle:t,closeModal:a,children:i}=e,o=(0,U.a)(e,["searchInputEle","closeModal","children"]);let r=(0,m.rZ)();return l.createElement(D.M,Object.assign({},o,{zIndex:310,fullScreen:!0,styles:{content:{borderRadius:0,height:"100%",".search-results__body":{padding:0},".result-item":{paddingLeft:16,paddingRight:16},".noresult-block":{padding:16},".skeleton-result":{padding:16}},header:{display:"none"}}}),l.createElement(b.K,{spacing:16,sx:{paddingTop:16}},l.createElement(E.k,{align:"center",gap:12},l.createElement(B.Z,{size:28,onClick:a,color:r.fn.primaryColor()}),l.createElement(u.x,{sx:{width:"100%"}},t)),i))},ei=L.Z.div` position: relative; width: 240px; flex-shrink: 0; ${R.M.mbDown} { width: 100%; } `;L.Z.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${k.r.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${R.M.mbDown} { width: calc(100% + 64px); left: -32px; } `;let eo=L.Z.div` position: relative; cursor: pointer; padding: 12px 18px; display: flex; align-items: center; gap: 14px; overflow: hidden; & + li::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background-color: ${k.r.colors.neutral100}; } &:not([data-is-denied='true']):hover { background-color: ${k.r.colors.neutral50}; } &:last-child:hover { border-bottom-right-radius: 6px; border-bottom-left-radius: 6px; } &:first-child:hover { border-top-right-radius: 6px; border-top-left-radius: 6px; } &[data-is-denied='true'] { cursor: not-allowed; } `,er=(0,L.Z)(C.P)` width: 12px; height: 18px; flex: 0 0 12px; `,en=(0,l.forwardRef)((e,t)=>{var{label:a,value:i}=e,o=(0,U.a)(e,["label","value"]);return l.createElement("div",Object.assign({ref:t},o),l.createElement(eo,{key:i,role:"button",tabIndex:0,"aria-label":`Select ${a} as location`,className:"location-item"},l.createElement(er,{color:k.r.colors.neutral400}),l.createElement(S.x,{size:"md"},a)))}),SearchLocation=({state:e,debouncedFetchCitiesByKeyword:t,selectedLocation:a,trackingAttributes:i,onLocationClick:o,dispatch:n})=>{var s;let{t:c,locale:d}=(0,T.u)(),u=(0,l.useRef)(null),p=(0,l.useMemo)(()=>{var t;return[{name:c("booking.searchBar.allLocations"),id:w.I,slug:null===(t=w.L[d])||void 0===t?void 0:t.ALL},...e.cities]},[e.cities,c,d]),g=(0,l.useMemo)(()=>i?{"data-event-category":i.dataEventCategory,"data-event-action":i.dataEventAction,"data-event-label":i.dataEventLabel}:{},[i]),m=(0,l.useCallback)(function(a){n({type:r.ChangeInputLocation,payload:a}),a.trim().length>K[e.locale]?t(a.trim()):(t.cancel(),n({type:r.DisplayInitialCities}))},[t,n,e.locale]);(0,I.a)(u,()=>{n({type:r.ClickOutsideInputLocation})});let b=null!==(s=null==a?void 0:a.id)&&void 0!==s?s:null,E=null===b?void 0:String(b);return l.createElement(ei,{ref:u},l.createElement(f.Ph,Object.assign({key:null!=E?E:"no-selected-location",defaultValue:E,placeholder:c("booking.searchBar.allLocations"),searchable:!0,onSearchChange:e=>{m(e)},onFocus:()=>{n({type:r.DisplayInitialCities})},onDropdownClose:()=>{t.cancel(),n({type:r.DisplayInitialCities})},nothingFound:c("common.noResult"),maxDropdownHeight:340,dropdownPosition:"bottom",icon:l.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M9.99908 10.8332C11.2264 10.8332 12.2213 9.83764 12.2213 8.61097C12.2213 7.3843 11.2264 6.38875 9.99908 6.38875C8.77174 6.38875 7.77686 7.3843 7.77686 8.61097C7.77686 9.83764 8.77174 10.8332 9.99908 10.8332Z",stroke:"#111111",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M9.99919 18.0554C11.7584 17.4999 16.6659 13.611 16.6659 8.61097C16.6659 4.93097 13.6811 1.94431 9.99919 1.94431C6.3173 1.94431 3.33252 4.93097 3.33252 8.61097C3.33252 13.611 8.23996 17.4999 9.99919 18.0554Z",stroke:"#111111",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),rightSection:l.createElement(A.C,{style:{width:20,height:20}})},g,{styles:()=>({item:{padding:0,"&[data-selected]":{"&, &:hover":{backgroundColor:"#F7F9FC",color:"inherit"},".location-item":{"&::after":{content:C.i,top:"50%",right:19,position:"absolute",transform:"translateY(-50%)"}}},"&[data-hovered]":{backgroundColor:"transparent"}},root:{width:"100%"},wrapper:{width:"100%"},input:{"&:not(.mantine-Textarea-input)":{height:48,fontSize:(0,h.h)(15),fontWeight:400,letterSpacing:"-0.3px",color:k.r.colors.gray1000,paddingLeft:44,paddingRight:40,background:"white",border:`1px solid ${k.r.colors.gray200}`,borderRadius:12}},icon:{width:44,paddingLeft:12},rightSection:{width:40,paddingRight:12},itemsWrapper:{padding:0},dropdown:{left:"0 !important",border:0,marginTop:4,borderRadius:12,overflow:"hidden",boxShadow:"0px 0px 1px 0px rgba(0, 0, 0, 0.04), 0px 2px 8px 0px rgba(0, 0, 0, 0.04), 0px 10px 16px 0px rgba(0, 0, 0, 0.04)","& ::-webkit-scrollbar":{width:"6px",height:"6px"}}}),itemComponent:en,filter:()=>!0,onChange:e=>{if(null==e)return;let a=p.find(t=>String(t.id)===e);a&&(o(a),t.cancel(),n({type:r.DisplayInitialCities}),setTimeout(()=>{var e,t;null===(t=null===(e=u.current)||void 0===e?void 0:e.querySelector("input"))||void 0===t||t.blur()},0))},data:p.map(e=>({value:String(e.id),label:e.name,city:e}))})))},el=L.Z.div` display: flex; flex-wrap: wrap; row-gap: 8px; column-gap: 20px; ${R.M.mbDown} { margin-top: 12px; } `,es=L.Z.div` display: flex; align-items: center; border-radius: 8px; border: 1px solid ${k.r.colors.neutral100}; background: ${k.r.colors.white}; padding: 8px 12px 8px 8px; flex: 0 0 calc(33.3% - 13px); gap: 12px; cursor: pointer; &:hover { background: ${k.r.colors.blue50}; } ${R.M.tdDown} { flex: 0 0 calc(50% - 10px); } ${R.M.mbDown} { flex: 0 0 100%; border: none; } .image-item { display: flex; align-items: center; width: 40px; height: 40px; img { width: 100%; object-fit: cover; } } .infor { flex: 1; .title { color: ${k.r.colors.gray800}; font-size: 14px; font-style: normal; font-weight: 400; line-height: 22px; } .description { color: ${k.r.colors.gray600}; font-size: 12px; font-weight: 400; line-height: 18px; } } `,ec=(0,L.Z)(y.i)` margin: 24px 0 !important; `,ed=L.Z.div` display: flex; justify-content: center; margin-top: 24px; .show-more { border-radius: 4px; border: 1px solid ${k.r.colors.neutral200}; padding: 12px 16px; cursor: pointer; display: inline-block; color: ${k.r.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; ${R.M.mbDown} { width: 100%; text-align: center; } } `,SearchResultSpecialties=({state:e,isMobile:t,specialties:a,isLoading:i,dispatch:o})=>{let{t:n,locale:s}=(0,T.u)(),{selectedLocation:d}=e,u=(0,l.useMemo)(()=>w.L[s],[s]),handleOnClick=e=>{let t="";e===w.S?(t=`/${d.slug}/${u.HOSPITAL}/${w.C.GSK}/`,o({type:r.ClickOutsideInputSearchSpecialty})):t=`/${d.slug}/${u.DOCTOR}/${e}`,o({type:r.NavigateTo,payload:t})},p=(0,l.useMemo)(()=>a.length>=9||e.searchKeywords.trim().length<=K[e.locale],[e.searchKeywords,a]);return l.createElement(l.Fragment,null,!t&&l.createElement(ec,{color:"#E4E8EC"}),l.createElement(el,null,a.length>0&&!i&&l.createElement(l.Fragment,null,a.map((e,t)=>t>=9?l.createElement(l.Fragment,null):l.createElement(es,{key:e.id,onClick:()=>handleOnClick(e.slug)},l.createElement("div",{className:"image-item"},l.createElement("img",{src:e.thumbnail,alt:e.name})),l.createElement("div",{className:"infor"},l.createElement("div",{className:"title"},e.name))))),0===a.length&&!i&&l.createElement(M.T,{size:"sm",color:k.r.colors.gray400},n("booking.searchBar.noResults")),i&&Array(6).fill(void 0).map((e,t)=>l.createElement(es,{key:"loading"+t},l.createElement("div",{className:"image-item"},l.createElement(c.O,{height:40,animate:!0})),l.createElement("div",{className:"infor"},l.createElement("div",{className:"title"},l.createElement(c.O,{height:20,radius:"sm",animate:!0})))))),p&&l.createElement(ed,null,l.createElement("div",{className:"show-more",onClick:()=>{let e=`/${u.SPECIALTIES}`;o({type:r.NavigateTo,payload:e})}},n("home.seeAll"))))},eu=L.Z.div` display: flex; gap: 5px; margin-top: 16px; flex-wrap: wrap; `,ep=L.Z.div` color: ${k.r.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 12px; background: ${k.r.colors.white}; border-radius: 32px; cursor: pointer; border: 1px solid ${k.r.colors.white}; margin-bottom: 5px; border-color: ${k.r.colors.neutral100}; background: #f7f9fc; &.view-all { border-radius: 32px; border-color: ${k.r.colors.blue50}; background: ${k.r.colors.blue50}; color: ${k.r.colors.blue600}; &:hover { border-color: ${k.r.colors.blue50}; background: ${k.r.colors.blue50}; color: ${k.r.colors.blue600}; } } &:hover { border-color: ${k.r.colors.neutral100}; background: #f7f9fc; } `,eh=L.Z.div` color: ${k.r.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 0; background: ${k.r.colors.white}; border-radius: 32px; border: 1px solid ${k.r.colors.white}; margin-bottom: 5px; margin-right: 7px; `,SearchTag=({state:e,type:t,typeInformation:a,dispatch:i})=>{let{t:o}=(0,T.u)(),{selectedLocation:n}=e,s=(0,l.useMemo)(()=>a[t].slug,[a,t]),handleClickKeyword=e=>{e.url&&(window.location.href=e.url)};return l.createElement(eu,null,l.createElement(eh,null,o("booking.searchBar.popularKey")),e.popularKeys.map(e=>l.createElement(ep,{key:e.id,onClick:()=>handleClickKeyword(e)},e.keyword)),l.createElement(ep,{className:"view-all",onClick:()=>{let e=`/${n.slug}/${s}`;e&&i({type:r.NavigateTo,payload:e})}},o("booking.searchBar.viewAll")))},eg=L.Z.div` background: rgba(255, 255, 255, 0.64); backdrop-filter: blur(12px); border-bottom: 1px solid ${k.r.colors.neutral100}; `,em=(0,L.Z)(N.C)` padding: 0 16px; `,TabSearch=({currentTab:e,hideTabBookingSearch:t=[],hideSpecialtyTab:a,isMobile:i,setCurrentTab:o})=>{let{t:r}=(0,T.u)(),n=(0,l.useMemo)(()=>({root:{overflowY:i?"hidden":"initial",overflowX:i?"auto":"initial"},tabsList:{background:"rgba(255, 255, 255, 0)",borderBottom:"none",flexWrap:"nowrap",".mantine-Tabs-tab":{"&:last-child":{"&:after":{display:"none"}}}},tab:{padding:i?"12px 16px 12px 16px":"15px 40px 15px 40px",borderTop:"2px solid transparent",borderBottom:"none",margin:0,borderRadius:0,position:"relative",width:"auto",'&[data-active="true"]':{borderColor:"#2d87f3",backgroundColor:"#ffffff","&:after":{display:"none"},"&:before":{content:'""',width:"100%",height:"1px",position:"absolute",backgroundColor:"#ffffff",bottom:"-1px"}},"&:hover":{borderColor:"#2d87f3",backgroundColor:"#ffffff","&:before":{content:'""',width:"100%",height:"1px",position:"absolute",backgroundColor:"#ffffff",bottom:"-1px"}},"&:after":{content:'""',width:"1px",height:"24px",backgroundColor:"#E4E8EC",position:"absolute",right:"-1px"}},tabLabel:{color:"#595959",fontSize:i?"14px":"16px",fontWeight:600,lineHeight:i?"22px":"24px"}}),[i]),s=(0,l.useMemo)(()=>[{value:"hospital",label:r("booking.searchPopup.hospitals")},{value:"doctor",label:r("booking.searchPopup.doctors")},{value:"service",label:r("booking.searchPopup.services")},...a?[]:[{value:"specialty",label:r("booking.searchPopup.specialties")}]],[a]),c=(0,l.useMemo)(()=>s.filter(e=>!t.includes(e.value))||[],[t,s]);return l.createElement(eg,{className:"booking-search-tab"},l.createElement(em,null,l.createElement(v.m,{value:e,onTabChange:e=>{o(e)},styles:n},l.createElement(v.m.List,null,c.map(e=>l.createElement(v.m.Tab,{value:e.value,key:e.value},e.label))))))};(o=n||(n={})).doctor="doctor",o.service="hospital_service",o.hospital="hospital_branch";let ignoreCacarSpecialty=e=>e.filter(e=>"string"==typeof e?"cacar-api"!==e:(null==e?void 0:e.id)!==232),BookingSearchBarV3=({isMobile:e,careApiDomain:t,geoLocationPermission:a,geoLocationCoordinates:i,initialSelectedCity:o,initialSearchValue:c="",initTypeSearch:d="hospital",initSpecialty:p,careFrontDomain:h="/care",isDebug:g=!1,gaTrackingSearchBar:m,gaTrackingLocationSearch:b,autoCompleteDisabled:S=!1,inputSearchPlaceholder:f="",hideTabBookingSearch:y=[],hideSpecialtySelection:v=!1,hideSpecialtyTab:_=!1,hidePopularSearchKeys:L=!1,clientSlug:k="",triggerSearchWhenChangeFilter:R,routerPush:N,onGeoLocationPermissionChange:M,onChangeLocation:A})=>{var U;let{locale:B,t:D}=(0,T.u)(),q=(0,l.useRef)(null),Z=(0,l.useRef)(null),W=(0,l.useRef)(null),V=(0,l.useRef)(null),[Y,Q]=(0,l.useState)(d),{geoLocationPermission:X,geoLocationCoordinates:J}=(0,C.u)(),[ee,et]=(0,l.useReducer)(reducer,H,t=>Object.assign(Object.assign({},t),{isDebug:g,isMobile:e,geoLocationPermission:a||X||"unset",geoLocationCoordinates:i||J||null,searchKeywords:c,initialSelectedCity:o||null,selectedLocation:o||t.selectedLocation||null,searchLocationKeywords:(null==o?void 0:o.name)||t.searchLocationKeywords,autoCompleteDisabled:S,inputSearchPlaceholder:f,locale:B})),{navigateTo:ei,focusedSpecialty:eo,searchKeywords:er,geoLocationPermission:en,selectedLocation:el,initialSelectedCity:es,searchResults:ec,isLoadingSearchResults:ed}=ee,{fetchCitiesByLocation:eu,fetchCitiesByKeyword:ep,fetchSearchResults:eh,fetchAllSpecialties:eg,fetchPopularKeys:em}=function({dispatch:e,careApiDomain:t,locale:a="vi-VN",client:i=""}){let o=(0,l.useCallback)(function(i,o={}){let n=`${t}${i}`;return e({type:r.FetchCitiesStart}),fetch((0,C.h)(n,o,a),{method:"GET"}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e))).finally(()=>e({type:r.FetchCitiesFinish}))},[a]),s=(0,l.useCallback)(function({coordinates:t}){let n={},l={};t&&(n={lat:t.lat,lng:t.lng}),"ms-MY"===a&&(l.noPaging=1);let s=[o(P.P.GET_CITY_BY_IP,Object.assign(Object.assign(Object.assign({},n),l),{hospitalActive:1,client:w.C.MSD===i?"":i}))];return"zh-TW"===a?s.push(o(P.P.GET_CITIES_LIST,{noPaging:1,hospitalActive:1,client:w.C.MSD===i?"":i})):s.push(o(P.P.GET_CITIES_LIST,{noPaging:1,hospitalActive:1})),Promise.all(s).then(([t,a])=>{let i=Object.assign({},t);if(a){let e=i.cities.map(e=>e.id);i.cities=i.cities.concat(a.cities.filter(t=>!e.includes(t.id)))}e({type:r.FetchCitiesByGeoIpComplete,payload:i})}).catch(e=>console.error("error loading cities by location",e))},[a,t,e]),c=(0,l.useCallback)(function(t){return o(P.P.GET_CITIES_LIST,{keyword:t,client:i}).then(t=>{e({type:r.FetchCitiesByKeywordComplete,payload:t.cities})}).catch(e=>console.error("error loading cities by keyword",e))},[a,t,e]),d=(0,l.useCallback)(function(o,n,l,s,c){let d="specialty"===l?`${t}${P.P.GET_SEARCH_SPECIALTY}`:`${t}${P.P.GET_SEARCH_V2}`;e({type:r.FetchSearchResultsStart});let{selectedLocation:u,geoLocationCoordinates:p,selectedSpecialty:h}=n,g="";if(!u){e({type:r.FetchSearchResultsFinish});return}g=u.id===w.I?"":u.id;let m=(null==p?void 0:p.lat)||"",b=(null==p?void 0:p.lng)||"",E=(null==h?void 0:h.id)>0?null==h?void 0:h.id:"",S=o.trim().length>K[a]?o.trim():"";return fetch((0,C.h)(d,Object.assign({domain:t,searchType:l||"global",keyword:S,city:g===w.a?"":g,lat:m,lng:b,specialty_id:E,client_slug:w.C.MSD===s?"":s,msd:w.C.MSD===i?1:""},"doctor"===l&&{skipBooking:1}),a),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)).then(t=>{let a=[];"specialty"!==l&&(a="doctor"===l?t.searches.map(e=>Object.assign(Object.assign({},e),{specialties:ignoreCacarSpecialty((null==e?void 0:e.specialties)||[])})):t.searches),"specialty"===l&&(a=S?ignoreCacarSpecialty((null==t?void 0:t.specialties)||[]):ignoreCacarSpecialty((null==t?void 0:t.default)||[])),e({type:r.FetchSearchResultsComplete,payload:{key:l,searches:a||[]}}),c&&e({type:r.UpdateInitialSearchResults,payload:{key:l,searches:a||[]}})}).catch(e=>{console.log("error loading search results",{url:d,error:e})}).finally(()=>e({type:r.FetchSearchResultsFinish}))},[a,t,e]),u=(0,l.useCallback)(function(){let o=`${t}${P.P.GET_SEARCH_SPECIALTY}`;return fetch((0,C.h)(o,{domain:t,searchType:"",msd:w.C.MSD===i?1:""},a),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)).then(t=>{e({type:r.FetchAllSpecialties,payload:ignoreCacarSpecialty(t.specialties||[])})}).catch(e=>{console.log("error loading search results",{url:o,error:e})})},[a,t,e]),p=(0,l.useCallback)(function(i){let o=`${t}${P.P.GET_SEARCH_POPULAR_KEY}`;return fetch((0,C.h)(o,{domain:t,searchType:n[i],sort_by:"display_order",sort_order:"asc"},a)).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)).then(t=>{e({type:r.FetchPopularKeys,payload:t.popular_searches||[]})}).catch(e=>{console.log("error loading search results",{url:o,error:e})})},[a,t,e]);return{fetchCitiesByLocation:s,fetchCitiesByKeyword:c,fetchSearchResults:d,fetchAllSpecialties:u,fetchPopularKeys:p}}({dispatch:et,locale:B,careApiDomain:t,client:k}),eb=(0,l.useMemo)(()=>w.L[B],[B]),[eE,{close:eS,open:ef}]=(0,x.q)(!1),ey=(0,l.useMemo)(()=>Object.assign({doctor:{name:D("booking.searchPopup.doctors"),icon:l.createElement(DoctorIcon,null),slug:eb.DOCTOR},service:{name:D("booking.searchPopup.services"),icon:l.createElement(ServiceIcon,null),slug:eb.SERVICE},hospital:{name:D("booking.searchPopup.hospitals"),icon:l.createElement(HospitalIcon,null),slug:eb.HOSPITAL}},!_&&{specialty:{name:D("booking.searchPopup.specialties"),icon:l.createElement(SpecialtyIcon,null),slug:eb.SPECIALTIES}}),[Y]),ev=(0,l.useMemo)(()=>O()(ep,400),[ep]),ex=(0,l.useMemo)(()=>O()(eh,400),[eh]),eC=(0,l.useCallback)(function({locationSlug:e,specialtyId:t}={}){var a;eS();let i="",{slug:o}=ey[Y],n="",l=w.M[B][k],s=t||(null===(a=ee.selectedSpecialty)||void 0===a?void 0:a.id)||-1,c=e||(null==el?void 0:el.slug)||"";("doctor"===Y||"hospital"===Y)&&s>0&&(n=`&specialtyId=${s}`),i="specialty"===Y?`/${o}`:`/${c}/${o}`,l&&(i+=`/${l}`),(i+=`?q=${er}${n}`)&&et({type:r.NavigateTo,payload:i})},[k,eS,Y,et,B,er,null==el?void 0:el.slug,null===(U=ee.selectedSpecialty)||void 0===U?void 0:U.id,ey]),eI=(0,l.useCallback)(function(e){R&&eC({locationSlug:e.slug}),et({type:r.SelectLocation,payload:e}),A&&A(e)},[et,e,A,eC,R]);(0,I.a)(V,()=>{e||et({type:r.ClickOutsideInputSearchSpecialty})}),(0,l.useEffect)(()=>{var t;"denied"===en||es||et({type:r.SelectLocation,payload:{name:D("booking.searchBar.allLocations"),id:w.I,slug:null===(t=w.L[B])||void 0===t?void 0:t.ALL}}),M&&M(en,ee.geoLocationCoordinates),e&&"granted"===en&&el&&et({type:r.FocusInputSearch}),eu({coordinates:ee.geoLocationCoordinates})},[en]),(0,l.useEffect)(()=>{var e;let t=p||{name:D("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:eb.SPECIALTIES};if(p){(null===(e=ee.selectedSpecialty)||void 0===e?void 0:e.id)!==p.id&&et({type:r.SelectSpecialty,payload:p});return}ee.selectedSpecialty&&ee.selectedSpecialty.id===t.id||et({type:r.SelectSpecialty,payload:t})},[p,eb.SPECIALTIES,D]),(0,l.useEffect)(()=>{eg()},[]),(0,l.useEffect)(()=>{em(Y)},[Y]),(0,l.useEffect)(()=>{ei&&(N?N(ei):window.location.href=`${h}${ei}`)},[ei]),(0,l.useEffect)(()=>{eh(ee.searchKeywords,ee,Y,k,!0)},[Y]),(0,l.useEffect)(()=>{if(eE&&e){let e=setTimeout(()=>{var e;null===(e=W.current)||void 0===e||e.focus()},150);return()=>clearTimeout(e)}},[eE,e]);let eT={type:Y,isMobile:e,state:ee,dispatch:et,debouncedFetchSearchResults:ex,initalSearchValue:c,onEnterSearch:eC,typeInformation:ey,trackingAttributes:m,isLoading:ed,hideSpecialtySelection:v||_,clientSlug:k,triggerSearchWhenChangeFilter:R,onChangeSpecialty:e=>R&&eC({specialtyId:e.id})};return l.createElement(l.Fragment,null,l.createElement($,{ref:q},l.createElement(TabSearch,{currentTab:Y,setCurrentTab:Q,isMobile:e,hideTabBookingSearch:y,hideSpecialtyTab:_}),l.createElement(F,{className:"booking-search-container"},l.createElement(G,null,l.createElement(z,{className:"booking-search-content"},l.createElement("div",{ref:V},l.createElement(E.k,{gap:"12px",align:"center",className:"flex-search-input"},l.createElement(ea,Object.assign({},eT,{ref:Z,onFocusInput:()=>e&&ef()})),"specialty"!==Y&&l.createElement(SearchLocation,{state:ee,isMobile:e,dispatch:et,debouncedFetchCitiesByKeyword:ev,selectedLocation:el,onLocationClick:eI,trackingAttributes:b}),!e&&l.createElement(j.B,{size:"lg",variant:"primary",onClick:()=>eC(),styles:{root:{height:"48px",minWidth:"120px",borderRadius:"12px"}}},D("booking.searchBar.searchButton"))),!L&&"specialty"!==Y&&ee.popularKeys.length>0&&l.createElement(SearchTag,{type:Y,state:ee,typeInformation:ey,dispatch:et}),"specialty"===Y&&"search"===eo&&l.createElement(SearchResultSpecialties,{state:ee,isMobile:e,dispatch:et,specialties:(null==ec?void 0:ec.specialty)||[],isLoading:ed})))))),e&&l.createElement(ModalSearchResult,{keepMounted:!0,opened:eE,onClose:eS,closeModal:eS,searchInputEle:l.createElement(E.k,{align:"center",gap:8},l.createElement(ea,Object.assign({},eT,{onlyShowSearchBox:!0,ref:W})),l.createElement(j.B,{variant:"primary",leftIcon:l.createElement(s.Z,{size:20,color:"#fff"}),onClick:()=>eC(),styles:{root:{borderRadius:"12px"}}}))},l.createElement(u.x,{sx:{marginLeft:-16,marginRight:-16}},l.createElement(SearchResultContent,{type:Y,state:ee,dispatch:et,isLoading:ed,typeInformation:ey,clientSlug:k}))))},eb=L.Z.div` background-color: var(--neutral50); padding: 12px 0; box-shadow: inset 0px 1px 0px #e4e8ec; > * { display: grid; grid-template-columns: 32px 1fr; align-content: center; p { font-weight: 600; } } .icon-wrapper { display: flex; align-items: center; } `,TextDivider=({children:e,icon:t,className:a,style:i})=>l.createElement(eb,{style:i,className:a},l.createElement(N.C,null,l.createElement("div",{className:"icon-wrapper"},t),l.createElement(M.T,{size:"c1",color:"var(--neutral800)"},e)))},HG5m:function(e,t,a){a.d(t,{B:function(){return b},C:function(){return N},E:function(){return k},F:function(){return L},G:function(){return m},N:function(){return x},S:function(){return _},V:function(){return T},a:function(){return E},c:function(){return y},d:function(){return v},e:function(){return w},f:function(){return C},g:function(){return I},h:function(){return R},i:function(){return M}});var i,o,r,n,l,s,c,d,u,p,h,g,m,b,E,S,f,y,v,x,C,I,T,_,O=a("4BRW");(i=m||(m={})).Boy="boy",i.Girl="girl",(o=b||(b={}))[o.Height=0]="Height",o[o.Weight=1]="Weight",o[o.Head=2]="Head",o[o.BMI=3]="BMI",(r=E||(E={}))[r.Weekly=0]="Weekly",r[r.Monthly=1]="Monthly",r[r.Yearly=2]="Yearly",(n=S||(S={}))[n.Height=0]="Height",n[n.Weight=1]="Weight",n[n.Head=2]="Head",n[n.BMI=3]="BMI",n[n.Record=4]="Record",(l=f||(f={}))[l.Phone=0]="Phone",l[l.OTP=1]="OTP",l[l.OTPEmail=2]="OTPEmail",l[l.PersonalInfo=3]="PersonalInfo",l[l.UpdatePassword=4]="UpdatePassword",l[l.Result=5]="Result",l[l.DynamicForm=6]="DynamicForm",(s=y||(y={}))[s.HEAD=0]="HEAD",s[s.TAIL=1]="TAIL",s[s.MIDDLE=2]="MIDDLE",s[s.CONNECT=3]="CONNECT",s[s.SSO=4]="SSO",s[s.MULTIPLE=5]="MULTIPLE",(c=v||(v={}))[c.UNDEFINED=-1]="UNDEFINED",c[c.TEXT=0]="TEXT",c[c.IMAGE=1]="IMAGE",c[c.FORM=2]="FORM",c[c.CONDITION=3]="CONDITION",c[c.POLL=4]="POLL",c[c.FINAL_STANDARD=5]="FINAL_STANDARD",c[c.FINAL=6]="FINAL",c[c.FINAL_THANK_YOU=7]="FINAL_THANK_YOU",c[c.RATING=8]="RATING",c[c.REACTION=9]="REACTION",c[c.REVIEW=10]="REVIEW",c[c.RESULT_POLL=11]="RESULT_POLL",c[c.RESULT_RATING=12]="RESULT_RATING",c[c.RESULT_REACTION=13]="RESULT_REACTION",c[c.OTP=14]="OTP";let w=[v.FINAL,v.FINAL_STANDARD,v.FINAL_THANK_YOU];(d=x||(x={})).BOT_TEXT="bot-text",d.BOT_IMAGE="bot-image",d.BOT_BACKGROUND_IMAGE="bot-background-image",d.BOT_BUTTON="bot-button",d.BOT_URL="bot-url",d.BOT_RECALCULATE="bot-recalculate",d.BOT_BOOKING="bot-booking",d.BOT_MAIN_TITLE="bot-main-title",d.BOT_MAIN_IMAGE="bot-main-image",d.BOT_MAIN_BODY="bot-main-body",d.BOT_MAIN_BUTTON="bot-main-button",d.BOT_SUB_TITLE="bot-sub-title",d.BOT_SUB_BODY="bot-sub-body",d.BOT_LANDING_PAGE_URL="bot-landing-page-url",d.BOT_LANDING_PAGE_BUTTON="bot-landing-page-button",d.BOT_RISK_SCREEN="bot-risk-screen",d.BOT_RELATED_ARTICLE="bot-related-article",d.THANK_YOU_IMAGE="thank-you-image",d.THANK_YOU_TITLE="thank-you-title",d.THANK_YOU_BODY="thank-you-body",d.TOTAL_LINE="total-line",d.BOT_SUBMISSION="bot-submission",d.BOT_EVENT_SUBMISSION="bot-event-submission",d.BOT_SUGGESTED_SERVICE="bot-suggested-service",d.SSO_INTENT="sso-intent",(u=C||(C={})).ACTION_CONDITION="action-condition",u.ACTION_INTERNAL="action-internal",u.ACTION_EXTERNAL="action-external",u.ACTION_SSO_REDIRECT="action-sso-redirect",u.ACTION_MULTIPLE_BUTTON="action-multiple-button",u.USER_CHOICE_TEXT="user-choice-text",u.USER_CHOICE_TEXT_BY_INPUT="user-choice-text-by-input",u.USER_CHOICE_NEXT="user-choice-next",u.USER_CHOICE_IMAGE="user-choice-image",u.USER_SUBMIT_TEXT="user-submit-text",u.USER_SUBMIT_NUMBER="user-submit-number",u.USER_SUBMIT_NAME="user-submit-name",u.USER_SUBMIT_PHONE="user-submit-phone",u.USER_SUBMIT_EMAIL="user-submit-email",u.USER_SUBMIT_DROPDOWN="user-submit-dropdown",u.USER_SUBMIT_DATE="user-submit-date",u.USER_SUBMIT_DOB="user-submit-dob",u.USER_SUBMIT_CONFIRM="user-submit-confirm",u.USER_SUBMIT_SEND="user-submit-send",u.USER_SUBMIT_RESEND="user-submit-resend",u.USER_SUBMIT_ADDRESS="user-submit-address",u.USER_SUBMIT_ADDRESS_PROVINCE="user-submit-address-province",u.USER_SUBMIT_ADDRESS_DISTRICT="user-submit-address-district",u.USER_SUBMIT_ADDRESS_COMMUNE="user-submit-address-commune",u.USER_SUBMIT_BMI="user-submit-bmi",u.USER_SUBMIT_BMI_HIDDEN="user-submit-bmi-hidden",u.USER_SUBMIT_TERMS="user-submit-terms",u.USER_SUBMIT_GENDER="user-submit-gender",u.USER_SUBMIT_OTP="user-submit-otp",u.USER_SUBMIT_WHATSAPP="user-submit-whatsapp",u.POLL_CHOICE="poll-choice",u.POLL_CHOICE_TEXT_BY_INPUT="poll-choice-text-by-input",u.POLL_CHOICE_IMAGE="poll-choice-image",u.POLL_BUTTON="poll-button",u.RATING_STAR="rating-star",u.RATING_DESCRIPTION="rating-description",u.RATING_BUTTON="rating-button",u.LIKE_CHOICE="like-choice",u.DISLIKE_CHOICE="dislike-choice",u.REVIEW_CHOICE="review-choice",u.REVIEW_DESCRIPTION="review-description",u.REVIEW_BUTTON="review-button",u.RESULT_BUTTON="result-button",u.POLL_RESULT="poll-result",u.USER_SUBMIT_GOOGLE_API_ADDRESS="user-submit-google-api-address";let L=[C.USER_SUBMIT_ADDRESS_PROVINCE,C.USER_SUBMIT_ADDRESS_DISTRICT,C.USER_SUBMIT_ADDRESS_COMMUNE,C.USER_SUBMIT_ADDRESS];(p=I||(I={}))[p.UNLIMITED=0]="UNLIMITED",p[p.EXACT_NUMBER=1]="EXACT_NUMBER",p[p.RANGE=2]="RANGE";let k={[C.USER_SUBMIT_EMAIL]:"email",[C.USER_SUBMIT_TEXT]:"text",[C.USER_SUBMIT_DROPDOWN]:"text",[C.USER_SUBMIT_NAME]:"name",[C.USER_SUBMIT_NUMBER]:"number",[C.USER_SUBMIT_ADDRESS]:"address",[C.USER_SUBMIT_PHONE]:"tel",[C.USER_SUBMIT_OTP]:"tel",[C.USER_SUBMIT_WHATSAPP]:"tel",[C.USER_SUBMIT_DATE]:"date",[C.USER_SUBMIT_CONFIRM]:"confirm",[C.USER_SUBMIT_SEND]:"submit",[C.USER_SUBMIT_TERMS]:"terms",[C.USER_SUBMIT_ADDRESS_PROVINCE]:"province",[C.USER_SUBMIT_ADDRESS_DISTRICT]:"district",[C.USER_SUBMIT_ADDRESS_COMMUNE]:"commune",[C.USER_SUBMIT_BMI]:"bmi",[C.USER_SUBMIT_GENDER]:"gender",[C.POLL_CHOICE]:"poll",[C.POLL_CHOICE_TEXT_BY_INPUT]:"poll",[C.POLL_CHOICE_IMAGE]:"poll",[C.RATING_STAR]:"rating",[C.RATING_DESCRIPTION]:"text",[C.LIKE_CHOICE]:"like",[C.DISLIKE_CHOICE]:"dislike",[C.REVIEW_CHOICE]:"review",[C.USER_SUBMIT_GOOGLE_API_ADDRESS]:"google-api-address",[C.USER_SUBMIT_DOB]:"dob"},R={FRU:"FRU",survey:"Survey",ristScreener:"risk_screener",voucherAcuvue:"ACUVUE"};(h=T||(T={})).VIDEO="video",h.SHORTS="short",h.PODCAST="podcast",h.LIVESTREAM="live-stream",(g=_||(_={})).Facebook="facebook",g.Zalo="zalo",g.Twitter="twitter",g.WhatsApp="whatsApp",g.Line="line",g.Instagram="instagram",g.LinkedIn="linkedin",g.Youtube="youtube",g.Tiktok="tiktok",g.Telegram="telegram",g.Viber="viber";let N={DD:{id:"common.day",defaultMessage:"Day"},MM:{id:"common.month",defaultMessage:"Month"},YYYY:{id:"common.year",defaultMessage:"Year"}};var M=Object.freeze({__proto__:null,get SocialType(){return _},COMMON_DATE_TRANSLATE_KEY:N,get Gender(){return m},get BabyGrowthChartType(){return b},get BabyGrowthChartDuration(){return E},get BabyGrowthResultTab(){return S},get LOCALE(){return O.L},get OnboardingStep(){return f},get NodePosition(){return y},get NodeType(){return v},NodeFinalTypes:w,get NodeIntentType(){return x},get NodeActionType(){return C},FULL_KEY_ADDRESS:L,get NodeMultipleOptions(){return I},ELEMENT_CONTROL_INPUT_TYPE:k,SubotType:R,get VideoType(){return T}})},uJ2t:function(e,t,a){a.d(t,{C:function(){return Close},D:function(){return DrawerComponent},u:function(){return useDrawerDrag}});var i=a("q1tI"),o=a("vEfc"),r=a("iuhU"),n=a("rSBk"),l=a("rBCA"),s=a("W9Px");let Close=e=>i.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},e),i.createElement("path",{d:"M3.99403 3.32695C3.86141 3.32698 3.73181 3.36657 3.62181 3.44065C3.5118 3.51472 3.42638 3.61992 3.37648 3.7428C3.32658 3.86567 3.31445 4.00064 3.34165 4.13044C3.36885 4.26024 3.43415 4.37898 3.52919 4.47148L7.05784 8.00013L3.52919 11.5288C3.46521 11.5902 3.41413 11.6638 3.37894 11.7452C3.34375 11.8266 3.32516 11.9142 3.32425 12.0029C3.32335 12.0916 3.34015 12.1796 3.37368 12.2617C3.40721 12.3438 3.45678 12.4185 3.5195 12.4812C3.58222 12.5439 3.65682 12.5935 3.73894 12.627C3.82106 12.6605 3.90904 12.6773 3.99774 12.6764C4.08643 12.6755 4.17405 12.6569 4.25547 12.6217C4.33689 12.5865 4.41047 12.5355 4.4719 12.4715L8.00054 8.94283L11.5292 12.4715C11.5906 12.5355 11.6642 12.5865 11.7456 12.6217C11.827 12.6569 11.9147 12.6755 12.0034 12.6764C12.092 12.6773 12.18 12.6605 12.2621 12.627C12.3443 12.5935 12.4189 12.5439 12.4816 12.4812C12.5443 12.4185 12.5939 12.3439 12.6274 12.2617C12.6609 12.1796 12.6777 12.0916 12.6768 12.0029C12.6759 11.9142 12.6573 11.8266 12.6222 11.7452C12.587 11.6638 12.5359 11.5902 12.4719 11.5288L8.94325 8.00013L12.4719 4.47148C12.5682 4.37784 12.634 4.25728 12.6607 4.1256C12.6873 3.99392 12.6735 3.85726 12.6212 3.73354C12.5688 3.60982 12.4803 3.5048 12.3672 3.43224C12.2542 3.35969 12.1218 3.32299 11.9875 3.32695C11.8143 3.33211 11.6499 3.4045 11.5292 3.52877L8.00054 7.05742L4.4719 3.52877C4.40977 3.46491 4.33548 3.41415 4.2534 3.37948C4.17132 3.34482 4.08313 3.32696 3.99403 3.32695Z"})),c=300,useDrawerDrag=(e=c)=>{let[t,a]=(0,i.useState)(!1),o=(0,i.useCallback)(()=>{a(!0)},[]),r=(0,i.useCallback)(()=>{setTimeout(()=>{a(!1)},e)},[e]);return{isDragging:t,handleDragStart:o,handleDragEnd:r}},d=(0,l.Z)(n.dy.Content)` position: fixed; z-index: ${s.c-9e6+1}; inset: 0; background-color: #fff; outline: none !important; &::-webkit-scrollbar { width: 6px; height: 6px; } &::-webkit-scrollbar-track { background-color: transparent; } &::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.4); border-radius: 6px; } &[data-vaul-drawer-direction='bottom'] { border-top-left-radius: 8px; border-top-right-radius: 8px; } &[data-vaul-drawer-direction='top'] { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; } &[data-vaul-drawer-direction='left'] { border-top-right-radius: 8px; border-bottom-right-radius: 8px; } &[data-vaul-drawer-direction='right'] { border-top-left-radius: 8px; border-bottom-left-radius: 8px; } ${e=>e.isDragging&&` input { caret-color: transparent; } `} `,u=(0,l.Z)(n.dy.Overlay)` position: fixed; inset: 0; z-index: ${s.c-9e6}; width: 100%; max-height: 100%; &[data-state='open'] { opacity: 0.6 !important; } `,DrawerComponent=e=>{let{open:t,onOpenChange:a,snapPoints:l,activeSnapPoint:c,setActiveSnapPoint:p,children:h,overlayClassName:g,className:m,fadeFromIndex:b=s.c-9e6,onClose:E}=e,S=(0,o.a)(e,["open","onOpenChange","snapPoints","activeSnapPoint","setActiveSnapPoint","children","overlayClassName","className","fadeFromIndex","onClose"]),[f,y]=(0,i.useState)(t),[v,x]=(0,i.useState)(l?null==l?void 0:l[0]:null),{isDragging:C,handleDragStart:I,handleDragEnd:T}=useDrawerDrag(),_=(0,i.useCallback)(e=>{y(e),null==a||a(e)},[a]),O=(0,i.useMemo)(()=>l&&l.length?v===l[l.length-1]:f,[v,l]),w=(0,i.useMemo)(()=>{let e={open:f,onOpenChange:_,fadeFromIndex:b};return l&&(null==l?void 0:l.length)&&(e.snapPoints=l,e.activeSnapPoint=v,e.setActiveSnapPoint=e=>{x(e),null==p||p(e)}),e},[f,_,v,x,p,l,b]);return(0,i.useEffect)(()=>{y(t)},[t]),(0,i.useEffect)(()=>{x(c)},[c]),i.createElement(n.dy.Root,Object.assign({onDrag:I,onRelease:T,onClose:E},S,w),i.createElement(n.dy.Portal,null,i.createElement(u,{className:(0,r.default)(g,"drawer__overlay",{drawer__overlay_full:O})}),i.createElement(d,{isDragging:C,className:(0,r.default)(m,"drawer__content",{drawer__content_full:O})},i.createElement(n.dy.Handle,{className:"drawer__handle"}),i.createElement(n.dy.Title,{style:{display:"none"}}),h)))}},o8a9:function(e,t,a){a.r(t),a.d(t,{ProfileChatbot:function(){return ProfileChatbot},TabDataInit:function(){return v},TabName:function(){return r},UserType:function(){return n}});var i,o,r,n,l=a("vEfc"),s=a("q1tI"),c=a("PGYf"),d=a("DJ4l"),u=a("XsRk"),p=a("IQVP"),h=a("d/ZZ"),g=a("WedE"),m=a("vWP/"),b=a("4JiQ"),E=a("/Llt"),S=a("4BRW");a("JIJ2"),a("NmYn"),a("gY0P"),a("Wgwc"),a("QgiU"),a("rBCA");let f=(0,s.createContext)({}),Faqs=({faqs:e})=>{let[t,a]=(0,s.useState)([]),handleClick=e=>{if(t.includes(e)){let i=t.filter(t=>t!==e);a(i)}else a(t=>[...t,e])};return s.createElement("div",{className:"_0NhMo6T"},e.map((e,a)=>{let i=t.includes(a);return s.createElement("div",{className:"nrZtZ-u",key:a},s.createElement("div",{className:"faq-item",onClick:()=>handleClick(a)},s.createElement("div",{className:"faq-question",dangerouslySetInnerHTML:{__html:e.question||""}}),i?s.createElement(g.Z,null):s.createElement(m.Z,null)),s.createElement(b.U,{in:i,className:"faq-answer"},s.createElement("div",{dangerouslySetInnerHTML:{__html:e.answer||""}})))}))};var y={container:"_2ugC2Ll",body:"CCwRHCd",description:"RF63WXG",cardAuthorWrapper:"PIaeC0v"};let formatExperience=e=>e?{title:null==e?void 0:e.title,organization:null==e?void 0:e.organization,duration:e.duration}:{},formatEducation=e=>e?{completedYear:null==e?void 0:e.completed_year,schoolName:e.school_name,study:e.study}:{};(i=r||(r={}))[i.About=0]="About",i[i.Care=1]="Care",i[i.Answer=2]="Answer",i[i.Posts=3]="Posts",(o=n||(n={}))[o.Expert=0]="Expert",o[o.User=1]="User";let v={experiences:[],relatedPosts:[],educations:[],awards:[],contact:{},data:{}},ProfileChatbot=e=>{var{authorProps:t,authActionWrapper:a,onSkipQuestion:i,onCloseFromPost:o,onChatWithBot:r,showSkipQuestionTag:n,currentPageUrl:g}=e,m=(0,l.a)(e,["authorProps","authActionWrapper","onSkipQuestion","onCloseFromPost","onChatWithBot","showSkipQuestionTag","currentPageUrl"]);let{data:{locale:b,userInfo:v,env:{isMarryBaby:x}}}=(0,s.useContext)(h.T),C=String(null==t?void 0:t.userId),[I,T]=(0,s.useState)(),[_,O]=(0,s.useState)(!1),[w,L]=(0,s.useState)(),[k,R]=(0,s.useState)([]),[N,M]=(0,s.useState)(""),A=(null==v?void 0:v._togetherUserId)===(null==t?void 0:t.userId),[U,B]=(0,s.useState)(1),D={value:String(U),dataList:[{value:"1",text:"FAQs",content:s.createElement(Faqs,{faqs:k})}],onTabChange:e=>B(Number(e))};return(0,s.useEffect)(()=>{(0,l._)(void 0,void 0,void 0,function*(){var e,t,a,i,o,r,n,l,s,c,d;O(!0);let g=yield Promise.all([(0,h.c)((0,h.f)(p.yy.USER.DETAIL,{_locale:b,id:C}),"GET"),(0,h.c)((0,h.f)(p.yy.CHATBOT.PROFILE,{_locale:b}),"GET"),(0,h.c)((0,h.f)(p.yy.CHATBOT.FAQS_LIST,{_locale:b}),"GET")]),[m,E,S]=g,f={data:null==m?void 0:m.data,experiences:((null===(t=null===(e=null==m?void 0:m.data)||void 0===e?void 0:e.fields)||void 0===t?void 0:t.experiences)||[]).map(formatExperience),relatedPosts:((null===(a=null==m?void 0:m.data)||void 0===a?void 0:a.related_post)||[]).map(e=>(0,u.f)(e.post)),educations:((null===(o=null===(i=null==m?void 0:m.data)||void 0===i?void 0:i.fields)||void 0===o?void 0:o.educations)||[]).map(formatEducation),awards:(null===(n=null===(r=null==m?void 0:m.data)||void 0===r?void 0:r.fields)||void 0===n?void 0:n.awards_accreditations)||[],contact:(null===(s=null===(l=null==m?void 0:m.data)||void 0===l?void 0:l.fields)||void 0===s?void 0:s.contact)||{}};(null==m?void 0:m.status)===1&&L(f),R((null===(c=null==S?void 0:S.data)||void 0===c?void 0:c.faqs)||[]),M((null===(d=null==E?void 0:E.data)||void 0===d?void 0:d.description)||""),O(!1)})},[]),s.createElement(f.Provider,{value:{isMarryBaby:x,siteType:x?"marryBaby":"helloSites",authorId:String((null==t?void 0:t.userId)||""),authActionWrapper:a,onSkipQuestion:i,info:w,authorProps:t,onCloseFromPost:o,countValues:I,setCountValues:T,isAuthorLogin:A,showSkipQuestionTag:n,currentPageUrl:g}},s.createElement("div",Object.assign({},m,{className:`${y.container} ${(null==m?void 0:m.className)||""}`,"data-is-marrybaby":x}),_?s.createElement(d.L,null):s.createElement(s.Fragment,null,s.createElement("div",{className:y.cardAuthorWrapper},s.createElement(E.C,Object.assign({},t,{className:"card-author",showDetailPopup:!1,showChatbotButton:b===S.L.Vietnam,onChatWithBot:r}))),s.createElement("div",{className:y.description,dangerouslySetInnerHTML:{__html:N}}),k.length>0&&s.createElement("div",{className:y.body},s.createElement(c.T,Object.assign({},D))))))}}}]);