"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8674],{rXLr:function(e,t,a){a.d(t,{L:function(){return Logo}});var o=a("q1tI"),i=a("PmKk"),l=a("i2MM"),n=a("rBCA"),r=a("K2Xj"),s=a("H1qm"),c=a("EDn0");let d=n.Z.div` position: relative; display: inline-flex; align-items: center; z-index: 0; .main-logo-icon { object-fit: contain; } &[data-logo-is-light] { > svg path { fill: #fff; } img { filter: brightness(0) invert(1); } } &[data-has-badge] { @supports (display: flex) and (gap: 1em) { gap: 0.5rem; } @supports not ((display: flex) and (gap: 1em)) { > img { margin-left: 0.25rem; } } } .common-logo-seasonal-left, .common-logo-seasonal-right { z-index: -1; max-width: unset; max-height: unset; pointer-events: none; } .common-logo-seasonal-left { position: absolute; top: 50%; left: 0; transform: translateY(-50%); pointer-events: none; } .common-logo-seasonal-right { position: absolute; top: 50%; right: 0; transform: translateY(-50%); } &[data-seasonal='christmas'] { padding-left: 37px; padding-right: 22px; .common-logo-seasonal-left { width: 125px; height: 56px; } .common-logo-seasonal-right { width: 23px; height: 17px; } ${r.M.mbDown} { padding-left: 30px; padding-right: 16px; .common-logo-seasonal-left { // width: 125px; height: 46px; } .common-logo-seasonal-right { // width: 23px; height: 12px; } } } &[data-seasonal='new-year'] { padding-right: 85px; .common-logo-seasonal-left { top: 35%; width: 100px; height: 56px; } .common-logo-seasonal-right { width: 85px; height: 54px; } ${r.M.mbDown} { padding-right: 0; .common-logo-seasonal-right { display: none; } } } &[data-seasonal='lunar-new-year'] { padding-left: 30px; padding-right: 35px; .common-logo-seasonal-left { width: 33px; height: 41px; } .common-logo-seasonal-right { width: 37px; height: 54px; } } &[data-seasonal='ramadan'] { &[data-type='hellosehat'] { padding-right: 35px; .common-logo-seasonal-left { width: 165px; height: unset; left: 6px; } .common-logo-seasonal-right { width: 33px; height: unset; } } &[data-type='hellodoktor'] { padding-right: 66px; .common-logo-seasonal-left { width: 133px; height: unset; left: 6px; } .common-logo-seasonal-right { width: 63px; height: unset; } } } &[data-seasonal='hung-king'] { &[data-type='hellobacsi'] { .common-logo-seasonal-left { width: 134px; height: unset; left: 50%; top: 50%; transform: translate(-50%, -50%); } } &[data-type='marryBaby'] { .common-logo-seasonal-left { width: 145px; height: unset; left: 50%; top: 50%; transform: translate(-50%, -50%); } } } &[data-seasonal='vn-independent-day'] { &[data-type='hellobacsi'], &[data-type='marryBaby'] { .common-logo-seasonal-left.desktop-only { width: unset; height: 56px; left: 65%; top: 50%; transform: translate(-50%, -50%); } } &[data-type='marryBaby'] { .common-logo-seasonal-left.desktop-only { left: 50%; z-index: 1; } } &[data-type='hellobacsi'], &[data-type='marryBaby'] { .common-logo-seasonal-left.mobile-only { width: unset; height: 56px; left: 60%; top: 50%; transform: translate(-50%, -50%); } } &[data-type='marryBaby'] { .common-logo-seasonal-left.mobile-only { left: 40%; z-index: 1; } } } .desktop-only { ${r.M.mbDown} { display: none; } } .mobile-only { ${r.M.mbUp} { display: none; } } `,p=n.Z.img` height: 16px; width: unset; margin-bottom: 4px; margin-left: -3px; `,isChristmas=e=>{let t=e.getDate(),a=e.getMonth();return 11===a&&t>=16&&t<=25},u={2023:[22,0],2024:[10,1],2025:[29,0],2026:[17,1],2027:[6,1],2028:[26,0],2029:[13,1],2030:[3,1],2031:[23,0],2032:[11,1],2033:[31,0],2034:[19,1],2035:[8,1],2036:[28,0],2037:[15,1],2038:[4,1],2039:[24,0],2040:[12,1]},g=[i.L.Vietnam,i.L.Taiwan,i.L.Indonesia,i.L.Malaysia],isLunarNewYear=e=>{let t=e.getFullYear(),a=u[t];if(!a)return!1;let o=new Date(t,a[1],a[0]),i=new Date(o);i.setDate(o.getDate()-7);let l=new Date(o);return l.setDate(o.getDate()+5),i<=e&&e<=l},isNewYear=e=>{let t=e.getDate(),a=e.getMonth();return 11===a&&t>=26||0===a&&t<=15},h=[{year:2024,start:[10,2],end:[8,3]},{year:2025,start:[1,2],end:[30,2]},{year:2026,start:[18,1],end:[19,2]},{year:2027,start:[8,1],end:[9,2]},{year:2028,start:[28,0],end:[26,1]},{year:2029,start:[16,0],end:[14,1]},{year:2030,start:[6,0],end:[4,1]},{year:2030,start:[26,11],end:[24,0,2031]},{year:2031,start:[15,11],end:[13,0,2032]},{year:2032,start:[4,11],end:[2,0,2033]}],isRamadan=e=>{let t=e.getFullYear(),a=h.filter(e=>e.year===t);return!!a.length&&a.some(a=>{let o=a.start[2]||t,i=new Date(o,a.start[1],a.start[0]),l=new Date(o,a.end[1],a.end[0]);return i<=e&&e<=l})},m={2024:[18,3],2025:[7,3],2026:[26,3],2027:[16,3],2028:[4,3],2029:[23,3],2030:[12,3],2031:[1,3],2032:[19,3],2033:[9,3],2034:[28,3],2035:[17,3]},isVNHungKing=e=>{let t=e.getFullYear(),a=m[t];if(!a)return!1;let o=new Date(t,a[1],a[0]),i=new Date(o);i.setDate(o.getDate()-1);let l=new Date(o);return l.setDate(o.getDate()+1),i<=e&&e<=l},isVN3004=e=>{let t=e.getFullYear(),a=new Date(t,3,30),o=new Date(a);o.setDate(a.getDate()-1);let i=new Date(a);return i.setDate(a.getDate()+2),o<=e&&e<=i},isLabourDay=e=>{let t=e.getFullYear(),a=new Date(t,4,1),o=new Date(a);o.setDate(a.getDate()-1);let i=new Date(a);return i.setDate(a.getDate()+1),o<=e&&e<=i},isVNIndependentDay=e=>{let t=e.getFullYear(),a=new Date(t,8,2),o=new Date(a);o.setDate(a.getDate()-1);let i=new Date(a);return i.setDate(a.getDate()+1),o<=e&&e<=i},Logo=({type:e,className:t,style:a,isLightLogo:n,customSize:r,badge:u,locale:h,dateForSeasonal:m,isPro:b})=>{let[f,y]=(0,o.useState)({isChristmas:!1,isLunarNewYear:!1,isNewYear:!1,isRamadan:!1,isVNHungKing:!1,isVN3004:!1,isLabourDay:!1,isVNIndependentDay:!1});return(0,o.useEffect)(()=>{if(!m||isNaN(new Date(m).getTime()))return;let e=new Date(m),t=isChristmas(e),a=g.includes(h)&&isLunarNewYear(e),o=!a&&isNewYear(e),l=isRamadan(e),n=h===i.L.Vietnam&&isVNHungKing(e),r=h===i.L.Vietnam&&isVN3004(e),s=h===i.L.Vietnam&&isLabourDay(e),c=h===i.L.Vietnam&&isVNIndependentDay(e);y({isChristmas:t,isLunarNewYear:a,isNewYear:o,isRamadan:l,isVNHungKing:n,isVN3004:r,isLabourDay:s,isVNIndependentDay:c})},[h,new Date(m).getDate()]),o.createElement(d,{className:t,style:a,"data-logo-is-light":n||void 0,"data-has-badge":!!u,"data-seasonal":f.isRamadan?"ramadan":f.isChristmas?"christmas":f.isLunarNewYear?"lunar-new-year":f.isNewYear?"new-year":f.isVNHungKing?"hung-king":f.isVN3004?"30-04":f.isLabourDay?"labour-day":f.isVNIndependentDay?"vn-independent-day":void 0,"data-type":e},f.isChristmas?o.createElement(o.Fragment,null,o.createElement(c.I,{alt:"left xmas logo",src:l.C.getAssetPath("logo/xmas-left.png"),className:"common-logo-seasonal-left"}),o.createElement(c.I,{alt:"right xmas logo",src:l.C.getAssetPath("logo/xmas-right.png"),className:"common-logo-seasonal-right"})):f.isNewYear?o.createElement(o.Fragment,null,o.createElement(c.I,{alt:"left new year logo",src:l.C.getAssetPath("logo/new-year-left.png"),className:"common-logo-seasonal-left"}),o.createElement(c.I,{alt:"right new year logo",src:l.C.getAssetPath("logo/new-year-right.png"),className:"common-logo-seasonal-right"})):f.isLunarNewYear?o.createElement(o.Fragment,null,o.createElement(c.I,{alt:"left lunar new year logo",loading:"lazy",src:l.C.getAssetPath("logo/lunar-new-year-left.png"),className:"common-logo-seasonal-left"}),o.createElement(c.I,{alt:"right lunar new year logo",loading:"lazy",src:l.C.getAssetPath("logo/lunar-new-year-right.png"),className:"common-logo-seasonal-right"})):f.isRamadan&&"hellosehat"===e?o.createElement(o.Fragment,null,o.createElement(c.I,{alt:"left ramadan logo",loading:"lazy",src:l.C.getAssetPath("logo/ramadan-sehat-left.png"),className:"common-logo-seasonal-left"}),o.createElement(c.I,{alt:"right ramadan logo",loading:"lazy",src:l.C.getAssetPath("logo/ramadan-sehat-right.png"),className:"common-logo-seasonal-right"})):f.isRamadan&&"hellodoktor"===e?o.createElement(o.Fragment,null,o.createElement(c.I,{alt:"left ramadan logo",loading:"lazy",src:l.C.getAssetPath("logo/ramadan-doktor-left.png"),className:"common-logo-seasonal-left"}),o.createElement(c.I,{alt:"right ramadan logo",loading:"lazy",src:l.C.getAssetPath("logo/ramadan-doktor-right.png"),className:"common-logo-seasonal-right"})):f.isVNHungKing&&("hellobacsi"===e||"marryBaby"===e)?o.createElement(o.Fragment,null,o.createElement(c.I,{alt:"Hung King logo",loading:"lazy",src:l.C.getAssetPath("logo/hung-king-bg.png"),className:"common-logo-seasonal-left"})):f.isVNIndependentDay&&("hellobacsi"===e||"marryBaby"===e)?o.createElement(o.Fragment,null,o.createElement(c.I,{alt:"VN Independent day logo",loading:"lazy",src:l.C.getAssetPath("logo/vn-independence-desktop.png"),className:"common-logo-seasonal-left desktop-only"}),o.createElement(c.I,{alt:"VN Independent day logo",loading:"lazy",src:l.C.getAssetPath("logo/vn-independence-mobile.png"),className:"common-logo-seasonal-left mobile-only"})):null,o.createElement(s.L,{type:e,width:null==r?void 0:r.width,height:null==r?void 0:r.height,isLight:n}),b?o.createElement(p,{src:l.C.getAssetPath("logo/pro-suffix.svg")}):null,u)}},JxkW:function(e,t,a){a.d(t,{I:function(){return Indicator}});var o=a("6eqW"),i=a("q1tI"),l=a("QJsO"),n=a("iBNF");let Indicator=e=>{var{styles:t,color:a=n.r.colors.red700}=e,r=(0,o._)(e,["styles","color"]);return i.createElement(l.z,Object.assign({inline:!0,position:"top-end",offset:4,styles:Object.assign({processing:{animationDirection:"alternate"}},t),color:a},r))}},Teu0:function(e,t,a){a.d(t,{T:function(){return g},a:function(){return getUserIdFromCookie},b:function(){return getSubotCookieId},c:function(){return getUserInfoFromCookie},d:function(){return getWindowId},e:function(){return checkUntilFinished},f:function(){return checkMobile},g:function(){return getHelloSitesUrl},h:function(){return clickAndOpenInNewTab},i:function(){return formatUrlWithEncrypedGa},j:function(){return isFakeEmail},k:function(){return getHhgIdFromCookie},o:function(){return overrideParamsByQuery},s:function(){return ssoIntents}});var o=a("jhhs"),i=a("Jbia"),l=a("JjKH"),n=a("JIJ2"),r=a("hHL7"),s=a("GOBr"),c=a("xrdX");let d=["form_submit_meta","selected_actions","current_selected","current_keys","current_polls"],p=["bot_id","node_id","action_id","action_value","current_score","gtm_id","ga_client_id","is_new","title_url","url","window_id",...d],overrideParamsByQuery=(e,t)=>{let a=Object.keys(t);return a.map(a=>{let o=t[a];if("source"===a){e.is_new="first_login"===o;return}if(p.includes(a)){if(d.includes(a)){try{e[a]=JSON.parse(o)}catch(e){}return}if("account_id"===a||"current_score"===a||"bot_id"===a){e[a]=parseInt(o);return}e[a]=o}}),e},ssoIntents=e=>[{id:(0,r.Z)(),label:JSON.stringify({title:"",description:""}),type:l.N.SSO_INTENT,url:""},{id:(0,r.Z)(),label:JSON.stringify({title:e({id:"subot.myHealth.title",defaultMessage:"My Health"}),description:e({id:"subot.myHealth.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:l.N.SSO_INTENT,url:"/images/subot/my-health.svg"},{id:(0,r.Z)(),label:JSON.stringify({title:e({id:"subot.saveData.title",defaultMessage:"Save Data"}),description:e({id:"subot.saveData.description",defaultMessage:"Hellobacsi would like to learn from your data to provide better healthcare for you"})}),type:l.N.SSO_INTENT,url:"/images/subot/file-storage.svg"},{id:(0,r.Z)(),label:JSON.stringify({title:e({id:"subot.productYourIdentifiers.title",defaultMessage:"Protect your identifiers"}),description:e({id:"subot.productYourIdentifiers.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:l.N.SSO_INTENT,url:"/images/subot/shield.svg"}];function checkUntilFinished(e){let t=e.condition,a=e.finished,o=e.timeout||3e3,i=new Date().getTime(),l=setInterval(()=>{let e=new Date().getTime();(e-i>o||t())&&(clearInterval(l),a())},300)}let getHhgIdFromCookie=e=>{let t=o.c.parse(e||""),a=t["hhg-id"];return a||n.Z.get("hhg-id")||""},getSubotCookieId=e=>{if(e)return n.Z.set("hhg-id",e),e;let t=getHhgIdFromCookie();if(t)return t;let a=(0,r.Z)();return n.Z.set("hhg-id",a),a},getUserIdFromCookie=e=>{let t=o.c.parse(e||""),a=t[i.B],l=a||n.Z.get(i.B)||"";try{let e=l.split(".")[1],t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a).sub}catch(e){return""}},getUserInfoFromCookie=e=>{let t=o.c.parse(e||""),a=t[i.B],l=a||n.Z.get(i.B)||"";try{let e=l.split(".")[1],t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join("")),o=JSON.parse(a);return{email:o.email,id:o.sub}}catch(e){return{email:"",id:0}}},u=(0,r.Z)(),getWindowId=()=>u,getHelloSitesUrl=(e,t)=>{let a=!t&&"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname);return a?"http://localhost":`https://${s.y?"":"discover."}${c.v[e]}`},checkMobile=e=>{let t=e||("undefined"==typeof navigator?"":navigator.userAgent);return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substring(0,4)))},clickAndOpenInNewTab=e=>{let t=document.createElement("a");t.href=e,t.target="_blank",t.click()},g=30,isFakeEmail=e=>(null==e?void 0:e.endsWith("@hhg.com"))||(null==e?void 0:e.endsWith("@facebook.com"));function formatUrlWithEncrypedGa(e="",t=""){if(!e.startsWith("https://")||!t)return"";let a=new URL(e),o=a.searchParams;return o.get("hhgclid")?(o.delete("hhgclid"),o.set("hhgclid",t),`${a.origin}${a.pathname}?${o.toString()}`):e}},Fs1M:function(e,t,a){a.d(t,{B:function(){return BookingSearchBarV3},T:function(){return TextDivider}});var o,i,l,n,r=a("q1tI"),s=a("6mQP"),c=a("0D4Z"),d=a("iuhU"),p=a("Eso5"),u=a("aDCK"),g=a("mYVa"),h=a("vaps"),m=a("8vDj"),b=a("OAL+"),f=a("SPK5"),y=a("TIp3"),x=a("CmzK"),v=a("NEaA"),w=a("rlLN"),S=a("Iblh"),E=a("AjoW"),C=a("2cXD"),k=a("ZKGu"),I=a("sEfC"),O=a.n(I),j=a("A2eT"),L=a("rBCA"),N=a("iBNF"),T=a("K2Xj"),D=a("zggI"),F=a("ZQ3V"),M=a("pGFX"),_=a("6eqW"),R=a("A24R"),$=a("gOIo"),P=a("19qx"),z=a("p3w3");let B=L.Z.div``,A=L.Z.div` background-color: ${N.r.colors.neutral50}; padding-bottom: 1px; ${T.M.mbDown} { padding: 0; } `,K=(0,L.Z)(D.C)` padding: 0 16px; ${T.M.mbDown} { padding: 0; } `,Z=L.Z.div` padding: 24px 56px; border-radius: 16px; background-color: ${N.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); ${T.M.mbDown} { padding: 16px; border-radius: 0; } .flex-search-input { flex-direction: row; ${T.M.mbDown} { flex-direction: column; } } `,H={"en-PH":3,"tl-PH":2,"id-ID":3,"vi-VN":2,"zh-TW":0,"ms-MY":2,"th-TH":2},W={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,o;switch(e.isDebug&&console.log("bookingSearchBarV3",{action:t,state:e}),t.type){case l.NavigateTo:return Object.assign(Object.assign({},e),{navigateTo:t.payload,focused:"none",isMobileModalOpened:!1});case l.ClickOutsideInputLocation:if("location"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case l.ClickOutsideInputSpecialty:if("specialty"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case l.ClickOutsideInputSearch:if("search"!==e.focused)return e;return Object.assign(Object.assign({},e),{focused:"none"});case l.ClickOutsideInputSearchSpecialty:if("search"!==e.focusedSpecialty)return e;return Object.assign(Object.assign({},e),{focusedSpecialty:"none"});case l.FocusInputLocation:{let t=Object.assign(Object.assign({},e),{focused:"location"});return(null===(a=e.selectedLocation)||void 0===a?void 0:a.id)===j.a&&(t.searchLocationKeywords=""),t}case l.FocusInputSpecialty:{let t=Object.assign(Object.assign({},e),{focused:"specialty"});return(null===(o=e.selectedLocation)||void 0===o?void 0:o.id)===j.a&&(t.searchLocationKeywords=""),t}case l.FocusInputSearch:let i=Object.assign(Object.assign({},e),{focused:"search"});if(e.isMobile)return resetSearchLocationKeywords(i);return i;case l.FocusInputSearchSpecialty:{let t=Object.assign(Object.assign({},e),{focusedSpecialty:"search"});return t}case l.ChangeInputLocation:return Object.assign(Object.assign({},e),{searchLocationKeywords:t.payload});case l.ChangeInputSearch:{let a=t.payload;return Object.assign(Object.assign({},e),{searchKeywords:a,isLoadingSearchResults:a.trim().length>H[e.locale]})}case l.SelectCurrentLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case l.ClearInputLocation:return Object.assign(Object.assign({},e),{focused:"location",cities:e.initialCities,searchLocationKeywords:""});case l.ClearInputSearch:return Object.assign(Object.assign({},e),{focused:"search",searchKeywords:""});case l.SelectLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name,searchResults:{}});case l.SelectSpecialty:return Object.assign(Object.assign({},e),{focused:"none",selectedSpecialty:t.payload,searchResults:{}});case l.SelectSearchResult:return Object.assign(Object.assign({},e),{searchKeywords:t.payload.name,isMobileModalOpened:!1,focused:"none",navigateTo:t.payload.url});case l.FetchCitiesStart:return Object.assign(Object.assign({},e),{isLoadingCities:!0});case l.FetchCitiesFinish:return Object.assign(Object.assign({},e),{isLoadingCities:!1});case l.FetchSearchResultsStart:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!0});case l.FetchSearchResultsFinish:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!1});case l.FetchSearchResultsComplete:{let a=Object.assign(Object.assign({},e),{searchResults:Object.assign(Object.assign({},e.searchResults),{[t.payload.key]:t.payload.searches})});return a}case l.FetchCitiesByGeoIpComplete:{let{cities:a}=t.payload,{default:o}=t.payload;a=a.filter(e=>e.id!==o.id),o&&a.unshift(o),e.initialSelectedCity&&!a.find(t=>t.id===e.initialSelectedCity.id)&&a.unshift(e.initialSelectedCity);let i=Object.assign(Object.assign({},e),{defaultCity:o,initialCities:a,cities:a});return"denied"!==e.geoLocationPermission||e.initialSelectedCity||(i.selectedLocation=o,i.searchLocationKeywords=o.name),i}case l.FetchCitiesByKeywordComplete:return Object.assign(Object.assign({},e),{cities:t.payload});case l.DisplayInitialCities:return Object.assign(Object.assign({},e),{cities:e.initialCities});case l.DisplayInitialSearchResults:{let t=e.searchKeywords.trim(),a=H[e.locale],o=t.length>0&&t.length<=a;return Object.assign(Object.assign({},e),{searchResults:o?{}:e.initialSearchResults,isLoadingSearchResults:!1})}case l.UpdateInitialSearchResults:return Object.assign(Object.assign({},e),{initialSearchResults:Object.assign(Object.assign({},e.initialSearchResults),{[t.payload.key]:t.payload.searches})});case l.GrantGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"granted",geoLocationCoordinates:t.payload});case l.DenyGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"denied",geoLocationCoordinates:null});case l.OpenMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!0});case l.CloseMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!1});case l.UpdateInitialSearchValue:return Object.assign(Object.assign({},e),{searchKeywords:t.payload});case l.SetInputSearchPlaceholder:return Object.assign(Object.assign({},e),{inputSearchPlaceholder:t.payload});case l.FetchAllSpecialties:return Object.assign(Object.assign({},e),{allSpecialties:t.payload});case l.FetchPopularKeys:return Object.assign(Object.assign({},e),{popularKeys:t.payload});default:return e}}(o=l||(l={})).NavigateTo="navigate to url",o.ClickOutsideInputLocation="click outside input location",o.ClickOutsideInputSearch="click outside input search",o.ClickOutsideInputSearchSpecialty="click outside input search specialty",o.ClickOutsideInputSpecialty="click outside input specialty",o.SelectCurrentLocation="select current location",o.FocusInputLocation="focus input location",o.FocusInputSearch="focus input search",o.FocusInputSearchSpecialty="focus input search specialty",o.ChangeInputLocation="change input location",o.ChangeInputSearch="change input search",o.ClearInputLocation="clear input location",o.ClearInputSearch="clear input search",o.SelectLocation="select location",o.SelectSpecialty="select specialty",o.FetchCitiesStart="fetch cities start",o.FetchCitiesFinish="fetch cities finish",o.FetchSearchResultsStart="fetch search results start",o.FetchSearchResultsComplete="fetch search results complete",o.FetchSearchResultsFinish="fetch search results finish",o.FetchCitiesByGeoIpComplete="fetch cities by geo IP finish",o.FetchCitiesByKeywordComplete="fetch cities by keyword finish",o.DisplayInitialCities="display initial cities",o.DisplayInitialSearchResults="display initial search results",o.UpdateInitialSearchResults="update initial search results",o.GrantGeoLocationPermission="grant geolocation permission",o.DenyGeoLocationPermission="deny geolocation permission",o.OpenMobileModal="open mobile modal",o.CloseMobileModal="close mobile modal",o.UpdateInitialSearchValue="update initial search value",o.SelectSearchResult="select search result",o.SetInputSearchPlaceholder="set input search placeholder",o.FocusInputSpecialty="focus input specialty",o.FetchAllSpecialties="fetch all specialty",o.FetchPopularKeys="fetch popular key by type";let q=L.Z.div` flex: 1; position: relative; ${T.M.mbDown} { width: 100%; } `,V=L.Z.div` background: #f7f9fc; border-radius: 12px; height: 48px; display: flex; align-items: center; padding: 4px 12px 4px 4px; gap: 16px; ${T.M.mbDown} { height: 48px; width: 100%; } `,Y=L.Z.div` display: flex; align-items: center; flex-shrink: 0; color: #8c8c8c; svg { width: 18px; height: 18px; } `,G=L.Z.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${N.r.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${T.M.mbDown} { width: calc(100% + 64px); left: -32px; } `,U=L.Z.div``;L.Z.div` display: flex; justify-content: space-between; align-item: center; padding: 9px 14px 9px 22px; background: #f7f9fc; .title { color: ${N.r.colors.gray800}; font-size: 14px; font-weight: 600; line-height: 22px; } .btn-see-all { color: ${N.r.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `;let Q=L.Z.div` padding: 10px 16px; max-height: 400px; overflow: auto; `,J=L.Z.div` display: flex; gap: 12px; align-items: center; cursor: pointer; ${T.M.mbUp} { &:hover { background-color: ${N.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 ${N.r.colors.neutral100}; .title { color: ${N.r.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; } .description { overflow: hidden; color: ${N.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: ${N.r.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `;let SearchResult=({state:e,type:t,results:a,isLoading:o,typeInformation:i,dispatch:n})=>{let{t:s}=(0,k.u)(),{selectedLocation:p}=e,u=(0,r.useMemo)(()=>i[t].slug,[i,t]),handleOnClick=e=>{let a="";switch(t){case"service":a=`/${p.slug}/${u}/${e.slug}`;break;case"doctor":case"hospital":a=`/${u}/${e.slug}-${e.id}`}a&&n({type:l.NavigateTo,payload:a})};return null===a?null:r.createElement(U,null,r.createElement(Q,{className:"search-results__body"},o&&r.createElement("div",{className:"skeleton-result"},[,,,].fill(void 0).map((e,a)=>r.createElement(J,{key:t+"loading"+a,className:2===a?"last-item":""},r.createElement("div",{className:"image-item"},r.createElement(c.O,{height:48,circle:!0,mb:"xl",animate:!0})),r.createElement("div",{className:"infor"},r.createElement("div",{className:"title"},r.createElement(c.O,{height:8,mt:10,radius:"xl",animate:!0})),r.createElement("div",{className:"description"},r.createElement("div",{className:"sub-description"},r.createElement(c.O,{height:8,mt:10,radius:"xl",width:"80%",animate:!0}))))))),!o&&a&&a.length>0&&r.createElement(r.Fragment,null,a.map((e,o)=>{var l,n;let s=a.length>4&&3===o||a.length<=4&&o===a.length-1,c="";return("hospital"===t&&(c=(null==e?void 0:e.address)||""),"doctor"===t&&(c=(null===(l=null==e?void 0:e.specialties)||void 0===l?void 0:l.join(", "))||""),"service"===t&&(c=(null===(n=null==e?void 0:e.hospital_branch)||void 0===n?void 0:n.name)||""),o>=4)?r.createElement(r.Fragment,null):r.createElement(J,{key:e.id,className:(0,d.default)(s?"last-item":"","result-item"),onClick:()=>handleOnClick(e)},r.createElement("div",{className:"image-item"},r.createElement("img",{src:e.logo||e.avatar,alt:e.name})),r.createElement("div",{className:"infor"},r.createElement("div",{className:"title"},e.name),r.createElement("div",{className:"description"},i[t].icon,r.createElement("div",{className:"sub-description"},c))))})),!o&&(null==a?void 0:a.length)===0&&r.createElement(F.T,{size:"sm",color:N.r.colors.gray400,className:"noresult-block"},s("booking.searchBar.noResults"))))},SearchResultContent=({state:e,type:t,isLoading:a,clientSlug:o,typeInformation:i,dispatch:l})=>{var n;return"search"!==e.focused?null:r.createElement(SearchResult,{type:t,state:e,results:(null===(n=e.searchResults)||void 0===n?void 0:n[t])||null,location:e.selectedLocation.name,dispatch:l,isLoading:a,typeInformation:i,clientSlug:o})},X=L.Z.div` position: relative; flex-shrink: 0; ${T.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } &.compact { ${T.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: ${N.r.colors.gray800}; } &:hover { background-color: ${N.r.colors.neutral50}; } &.selected { background-color: ${N.r.colors.neutral50}; } &:last-child { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; } `,DoctorIcon=()=>r.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},r.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=()=>r.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},r.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=()=>r.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},r.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=()=>r.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},r.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:o,isCompact:i=!1})=>{let{t:n,locale:c}=(0,k.u)(),d=(0,r.useRef)(null),m=(0,r.useRef)(null),b=(0,r.useMemo)(()=>j.L[c],[c]),[f,y]=(0,r.useState)(""),[x,{close:v,toggle:w}]=(0,S.q)(!1);(0,C.a)(d,()=>{v(),y(""),o({type:l.ClickOutsideInputSpecialty})});let E=(0,r.useMemo)(()=>[{name:n("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:b.SPECIALTIES},...e.allSpecialties],[e.allSpecialties,n,b.SPECIALTIES]),I=(0,r.useMemo)(()=>f.trim()?E.filter(e=>e.name.toLowerCase().includes(f.toLowerCase().trim())):E,[E,f]),O=(0,r.useMemo)(()=>e.selectedSpecialty?e.selectedSpecialty.name:"",[e.selectedSpecialty]),L=(0,r.useCallback)(e=>{a({id:e.id,name:e.name,slug:e.slug,thumbnail:e.thumbnail||"",total_doctor:0}),v(),y("")},[a,v]),T=(0,r.useCallback)(()=>{w(),x&&y("")},[w,x]);return r.createElement(X,{ref:d,className:i?"compact":""},r.createElement(p.x,{onClick:T,className:x?"dropdown-trigger-open":"",sx:{cursor:"pointer",position:"relative",width:i?t?96:160:"100%",flexShrink:0}},r.createElement(u.I,{readOnly:!0,value:O,placeholder:n("booking.searchPopup.specialties"),rightSection:r.createElement(M.C,{style:{width:20,height:20}}),styles:Object.assign({input:{cursor:"pointer",outline:"none","&:focus":{outline:"none"},"&:not(.mantine-Textarea-input)":{height:i?40:t?40:46,fontSize:i?(0,g.h)(14):t?(0,g.h)(14):(0,g.h)(16),paddingLeft:i?12:16,paddingRight:30,background:i?"white":"transparent",border:i?`1px solid ${N.r.colors.gray200}`:"none",borderRadius:8,letterSpacing:"-0.2px",color:N.r.colors.gray800,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}},rightSection:{width:30,pointerEvents:"none"}},!i&&{wrapper:{position:"relative","&:after":{content:'""',width:"1px",height:"20px",backgroundColor:N.r.colors.neutral100,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)"}}})})),x&&r.createElement(ee,{className:t?"mobile":""},r.createElement(p.x,{sx:{padding:"12px 12px 8px"}},r.createElement(u.I,{ref:m,icon:r.createElement(s.Z,{size:18,color:N.r.colors.gray300}),placeholder:n("booking.searchBar.placeholder.specialty"),value:f,onChange:e=>y(e.target.value),size:"md",styles:{input:{height:40,fontSize:(0,g.h)(15),paddingLeft:36,"&::placeholder":{color:N.r.colors.gray400}},icon:{width:36}}})),r.createElement(h.x.Autosize,{mah:300},0===I.length?r.createElement(p.x,{sx:{padding:"12px 16px",color:N.r.colors.gray400,fontSize:14}},n("common.noResult")):I.map(t=>{var a,o;return r.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===(o=e.selectedSpecialty)||void 0===o?void 0:o.id)===t.id?"selected":"",onClick:()=>L(t),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),L(t))}},r.createElement("div",{className:"image-item"},t.thumbnail?r.createElement("img",{src:t.thumbnail,alt:t.name}):r.createElement(SpecialtyIcon,null)),r.createElement("span",{className:"item-label"},t.name))}))))},ea=(0,r.forwardRef)(({state:e,type:t,isMobile:a,isLoading:o,initalSearchValue:i,typeInformation:n,debouncedFetchSearchResults:c,trackingAttributes:d,hideSpecialtySelection:p=!1,clientSlug:h="",onSearch:m,onFocusInput:b,onEnterSearch:f,dispatch:y,onlyShowSearchBox:x,onChangeSpecialty:v},w)=>{let{t:S}=(0,k.u)(),E=(0,r.useRef)(null),I=(0,r.useRef)(null);(0,r.useImperativeHandle)(w,()=>({focus:()=>{var e;null===(e=I.current)||void 0===e||e.focus()}}));let O=(0,r.useMemo)(()=>d?{"data-event-category":d.dataEventCategory,"data-event-action":d.dataEventAction,"data-event-label":d.dataEventLabel}:{},[d]),j=(0,r.useMemo)(()=>"doctor"===t?S("booking.searchBar.placeholder.doctor"):"service"===t?S("booking.searchBar.placeholder.service"):"hospital"===t?S("booking.searchBar.placeholder.hospital"):"specialty"===t?S("booking.searchBar.placeholder.specialty"):"",[t,S]),L="specialty"!==t&&"service"!==t&&!p&&!x,T=(0,r.useMemo)(()=>({input:{border:"none",background:"transparent",height:"100%",fontSize:(0,g.h)(16),color:N.r.colors.gray800,padding:"0","&::placeholder":{color:N.r.colors.gray400},"&:focus":{outline:"none",boxShadow:"none"},[a?"@media (max-width: 767px)":""]:a?{fontSize:(0,g.h)(16)}:{}},wrapper:{flex:1}}),[a]);(0,C.a)(E,()=>{a||y({type:l.ClickOutsideInputSearch})});let D=(0,r.useCallback)(function(a){y({type:l.ChangeInputSearch,payload:a}),"function"!=typeof m&&(a.trim().length>H[e.locale]||i||0===a.trim().length)&&c(a.trim(),e,t,h)},[y,e,t,i,c,h,m]),F=(0,r.useCallback)(function(e){var t;y({type:l.SelectSpecialty,payload:e}),null==v||v(e),a||null===(t=I.current)||void 0===t||t.focus()},[y,v]),M=(0,r.useCallback)(e=>{"Enter"===e.key&&(e.stopPropagation(),e.preventDefault(),f&&f())},[f]);return r.createElement(q,{ref:E},r.createElement(V,null,L&&r.createElement(SearchSpecialty,{state:e,isMobile:a,dispatch:y,debouncedFetchSearchResults:c,onSpecialtyClick:F,isCompact:!0}),r.createElement(Y,null,r.createElement(s.Z,null)),r.createElement(u.I,Object.assign({ref:I,variant:"unstyled",size:a?"md":"lg",placeholder:j,styles:T,value:e.searchKeywords,name:"search-results",autoComplete:"off",onFocus:()=>{y({type:l.FocusInputSearch}),null==b||b()},onChange:e=>{D(e.target.value)},onKeyDown:M},O))),!a&&"specialty"!==t&&r.createElement(G,null,r.createElement(SearchResultContent,{type:t,state:e,dispatch:y,isLoading:o,typeInformation:n,clientSlug:h})))});ea.displayName="SearchInputs";let ModalSearchResult=e=>{var{searchInputEle:t,closeModal:a,children:o}=e,i=(0,_._)(e,["searchInputEle","closeModal","children"]);let l=(0,m.rZ)();return r.createElement($.M,Object.assign({},i,{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"}}}),r.createElement(b.K,{spacing:16,sx:{paddingTop:16}},r.createElement(f.k,{align:"center",gap:12},r.createElement(R.Z,{size:28,onClick:a,color:l.fn.primaryColor()}),r.createElement(p.x,{sx:{width:"100%"}},t)),o))},eo=L.Z.div` position: relative; width: 240px; flex-shrink: 0; ${T.M.mbDown} { width: 100%; } `;L.Z.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${N.r.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${T.M.mbDown} { width: calc(100% + 64px); left: -32px; } `;let ei=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: ${N.r.colors.neutral100}; } &:not([data-is-denied='true']):hover { background-color: ${N.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; } `,el=(0,L.Z)(E.P)` width: 12px; height: 18px; flex: 0 0 12px; `,en=(0,r.forwardRef)((e,t)=>{var{label:a,value:o}=e,i=(0,_._)(e,["label","value"]);return r.createElement("div",Object.assign({ref:t},i),r.createElement(ei,{key:o,role:"button",tabIndex:0,"aria-label":`Select ${a} as location`,className:"location-item"},r.createElement(el,{color:N.r.colors.neutral400}),r.createElement(y.x,{size:"md"},a)))}),SearchLocation=({state:e,debouncedFetchCitiesByKeyword:t,selectedLocation:a,trackingAttributes:o,onLocationClick:i,dispatch:n})=>{var s;let{t:c,locale:d}=(0,k.u)(),p=(0,r.useRef)(null),u=(0,r.useMemo)(()=>{var t;return[{name:c("booking.searchBar.allLocations"),id:j.I,slug:null===(t=j.L[d])||void 0===t?void 0:t.ALL},...e.cities]},[e.cities,c,d]),h=(0,r.useMemo)(()=>o?{"data-event-category":o.dataEventCategory,"data-event-action":o.dataEventAction,"data-event-label":o.dataEventLabel}:{},[o]),m=(0,r.useCallback)(function(a){n({type:l.ChangeInputLocation,payload:a}),a.trim().length>H[e.locale]?t(a.trim()):(t.cancel(),n({type:l.DisplayInitialCities}))},[t,n,e.locale]);(0,C.a)(p,()=>{n({type:l.ClickOutsideInputLocation})});let b=null!==(s=null==a?void 0:a.id)&&void 0!==s?s:null,f=null===b?void 0:String(b);return r.createElement(eo,{ref:p},r.createElement(x.Ph,Object.assign({key:null!=f?f:"no-selected-location",defaultValue:f,placeholder:c("booking.searchBar.allLocations"),searchable:!0,onSearchChange:e=>{m(e)},onFocus:()=>{n({type:l.DisplayInitialCities})},onDropdownClose:()=>{t.cancel(),n({type:l.DisplayInitialCities})},nothingFound:c("common.noResult"),maxDropdownHeight:340,dropdownPosition:"bottom",icon:r.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.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"}),r.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:r.createElement(M.C,{style:{width:20,height:20}})},h,{styles:()=>({item:{padding:0,"&[data-selected]":{"&, &:hover":{backgroundColor:"#F7F9FC",color:"inherit"},".location-item":{"&::after":{content:E.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,g.h)(15),fontWeight:400,letterSpacing:"-0.3px",color:N.r.colors.gray1000,paddingLeft:44,paddingRight:40,background:"white",border:`1px solid ${N.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=u.find(t=>String(t.id)===e);a&&(i(a),t.cancel(),n({type:l.DisplayInitialCities}),setTimeout(()=>{var e,t;null===(t=null===(e=p.current)||void 0===e?void 0:e.querySelector("input"))||void 0===t||t.blur()},0))},data:u.map(e=>({value:String(e.id),label:e.name,city:e}))})))},er=L.Z.div` display: flex; flex-wrap: wrap; row-gap: 8px; column-gap: 20px; ${T.M.mbDown} { margin-top: 12px; } `,es=L.Z.div` display: flex; align-items: center; border-radius: 8px; border: 1px solid ${N.r.colors.neutral100}; background: ${N.r.colors.white}; padding: 8px 12px 8px 8px; flex: 0 0 calc(33.3% - 13px); gap: 12px; cursor: pointer; &:hover { background: ${N.r.colors.blue50}; } ${T.M.tdDown} { flex: 0 0 calc(50% - 10px); } ${T.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: ${N.r.colors.gray800}; font-size: 14px; font-style: normal; font-weight: 400; line-height: 22px; } .description { color: ${N.r.colors.gray600}; font-size: 12px; font-weight: 400; line-height: 18px; } } `,ec=(0,L.Z)(v.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 ${N.r.colors.neutral200}; padding: 12px 16px; cursor: pointer; display: inline-block; color: ${N.r.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; ${T.M.mbDown} { width: 100%; text-align: center; } } `,SearchResultSpecialties=({state:e,isMobile:t,specialties:a,isLoading:o,dispatch:i})=>{let{t:n,locale:s}=(0,k.u)(),{selectedLocation:d}=e,p=(0,r.useMemo)(()=>j.L[s],[s]),handleOnClick=e=>{let t="";e===j.S?(t=`/${d.slug}/${p.HOSPITAL}/${j.C.GSK}/`,i({type:l.ClickOutsideInputSearchSpecialty})):t=`/${d.slug}/${p.DOCTOR}/${e}`,i({type:l.NavigateTo,payload:t})},u=(0,r.useMemo)(()=>a.length>=9||e.searchKeywords.trim().length<=H[e.locale],[e.searchKeywords,a]);return r.createElement(r.Fragment,null,!t&&r.createElement(ec,{color:"#E4E8EC"}),r.createElement(er,null,a.length>0&&!o&&r.createElement(r.Fragment,null,a.map((e,t)=>t>=9?r.createElement(r.Fragment,null):r.createElement(es,{key:e.id,onClick:()=>handleOnClick(e.slug)},r.createElement("div",{className:"image-item"},r.createElement("img",{src:e.thumbnail,alt:e.name})),r.createElement("div",{className:"infor"},r.createElement("div",{className:"title"},e.name))))),0===a.length&&!o&&r.createElement(F.T,{size:"sm",color:N.r.colors.gray400},n("booking.searchBar.noResults")),o&&Array(6).fill(void 0).map((e,t)=>r.createElement(es,{key:"loading"+t},r.createElement("div",{className:"image-item"},r.createElement(c.O,{height:40,animate:!0})),r.createElement("div",{className:"infor"},r.createElement("div",{className:"title"},r.createElement(c.O,{height:20,radius:"sm",animate:!0})))))),u&&r.createElement(ed,null,r.createElement("div",{className:"show-more",onClick:()=>{let e=`/${p.SPECIALTIES}`;i({type:l.NavigateTo,payload:e})}},n("home.seeAll"))))},ep=L.Z.div` display: flex; gap: 5px; margin-top: 16px; flex-wrap: wrap; `,eu=L.Z.div` color: ${N.r.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 12px; background: ${N.r.colors.white}; border-radius: 32px; cursor: pointer; border: 1px solid ${N.r.colors.white}; margin-bottom: 5px; border-color: ${N.r.colors.neutral100}; background: #f7f9fc; &.view-all { border-radius: 32px; border-color: ${N.r.colors.blue50}; background: ${N.r.colors.blue50}; color: ${N.r.colors.blue600}; &:hover { border-color: ${N.r.colors.blue50}; background: ${N.r.colors.blue50}; color: ${N.r.colors.blue600}; } } &:hover { border-color: ${N.r.colors.neutral100}; background: #f7f9fc; } `,eg=L.Z.div` color: ${N.r.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 0; background: ${N.r.colors.white}; border-radius: 32px; border: 1px solid ${N.r.colors.white}; margin-bottom: 5px; margin-right: 7px; `,SearchTag=({state:e,type:t,typeInformation:a,dispatch:o})=>{let{t:i}=(0,k.u)(),{selectedLocation:n}=e,s=(0,r.useMemo)(()=>a[t].slug,[a,t]),handleClickKeyword=e=>{e.url&&(window.location.href=e.url)};return r.createElement(ep,null,r.createElement(eg,null,i("booking.searchBar.popularKey")),e.popularKeys.map(e=>r.createElement(eu,{key:e.id,onClick:()=>handleClickKeyword(e)},e.keyword)),r.createElement(eu,{className:"view-all",onClick:()=>{let e=`/${n.slug}/${s}`;e&&o({type:l.NavigateTo,payload:e})}},i("booking.searchBar.viewAll")))},eh=L.Z.div` background: rgba(255, 255, 255, 0.64); backdrop-filter: blur(12px); border-bottom: 1px solid ${N.r.colors.neutral100}; `,em=(0,L.Z)(D.C)` padding: 0 16px; `,TabSearch=({currentTab:e,hideTabBookingSearch:t=[],hideSpecialtyTab:a,isMobile:o,setCurrentTab:i})=>{let{t:l}=(0,k.u)(),n=(0,r.useMemo)(()=>({root:{overflowY:o?"hidden":"initial",overflowX:o?"auto":"initial"},tabsList:{background:"rgba(255, 255, 255, 0)",borderBottom:"none",flexWrap:"nowrap",".mantine-Tabs-tab":{"&:last-child":{"&:after":{display:"none"}}}},tab:{padding:o?"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:o?"14px":"16px",fontWeight:600,lineHeight:o?"22px":"24px"}}),[o]),s=(0,r.useMemo)(()=>[{value:"hospital",label:l("booking.searchPopup.hospitals")},{value:"doctor",label:l("booking.searchPopup.doctors")},{value:"service",label:l("booking.searchPopup.services")},...a?[]:[{value:"specialty",label:l("booking.searchPopup.specialties")}]],[a]),c=(0,r.useMemo)(()=>s.filter(e=>!t.includes(e.value))||[],[t,s]);return r.createElement(eh,{className:"booking-search-tab"},r.createElement(em,null,r.createElement(w.m,{value:e,onTabChange:e=>{i(e)},styles:n},r.createElement(w.m.List,null,c.map(e=>r.createElement(w.m.Tab,{value:e.value,key:e.value},e.label))))))};(i=n||(n={})).doctor="doctor",i.service="hospital_service",i.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:o,initialSelectedCity:i,initialSearchValue:c="",initTypeSearch:d="hospital",initSpecialty:u,careFrontDomain:g="/care",isDebug:h=!1,gaTrackingSearchBar:m,gaTrackingLocationSearch:b,autoCompleteDisabled:y=!1,inputSearchPlaceholder:x="",hideTabBookingSearch:v=[],hideSpecialtySelection:w=!1,hideSpecialtyTab:I=!1,hidePopularSearchKeys:L=!1,clientSlug:N="",triggerSearchWhenChangeFilter:T,routerPush:D,onGeoLocationPermissionChange:F,onChangeLocation:M})=>{var _;let{locale:R,t:$}=(0,k.u)(),q=(0,r.useRef)(null),V=(0,r.useRef)(null),Y=(0,r.useRef)(null),G=(0,r.useRef)(null),[U,Q]=(0,r.useState)(d),{geoLocationPermission:J,geoLocationCoordinates:X}=(0,E.u)(),[ee,et]=(0,r.useReducer)(reducer,W,t=>Object.assign(Object.assign({},t),{isDebug:h,isMobile:e,geoLocationPermission:a||J||"unset",geoLocationCoordinates:o||X||null,searchKeywords:c,initialSelectedCity:i||null,selectedLocation:i||t.selectedLocation||null,searchLocationKeywords:(null==i?void 0:i.name)||t.searchLocationKeywords,autoCompleteDisabled:y,inputSearchPlaceholder:x,locale:R})),{navigateTo:eo,focusedSpecialty:ei,searchKeywords:el,geoLocationPermission:en,selectedLocation:er,initialSelectedCity:es,searchResults:ec,isLoadingSearchResults:ed}=ee,{fetchCitiesByLocation:ep,fetchCitiesByKeyword:eu,fetchSearchResults:eg,fetchAllSpecialties:eh,fetchPopularKeys:em}=function({dispatch:e,careApiDomain:t,locale:a="vi-VN",client:o=""}){let i=(0,r.useCallback)(function(o,i={}){let n=`${t}${o}`;return e({type:l.FetchCitiesStart}),fetch((0,E.h)(n,i,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:l.FetchCitiesFinish}))},[a]),s=(0,r.useCallback)(function({coordinates:t}){let n={},r={};t&&(n={lat:t.lat,lng:t.lng}),"ms-MY"===a&&(r.noPaging=1);let s=[i(P.P.GET_CITY_BY_IP,Object.assign(Object.assign(Object.assign({},n),r),{hospitalActive:1,client:j.C.MSD===o?"":o}))];return"zh-TW"===a?s.push(i(P.P.GET_CITIES_LIST,{noPaging:1,hospitalActive:1,client:j.C.MSD===o?"":o})):s.push(i(P.P.GET_CITIES_LIST,{noPaging:1,hospitalActive:1})),Promise.all(s).then(([t,a])=>{let o=Object.assign({},t);if(a){let e=o.cities.map(e=>e.id);o.cities=o.cities.concat(a.cities.filter(t=>!e.includes(t.id)))}e({type:l.FetchCitiesByGeoIpComplete,payload:o})}).catch(e=>console.error("error loading cities by location",e))},[a,t,e]),c=(0,r.useCallback)(function(t){return i(P.P.GET_CITIES_LIST,{keyword:t,client:o}).then(t=>{e({type:l.FetchCitiesByKeywordComplete,payload:t.cities})}).catch(e=>console.error("error loading cities by keyword",e))},[a,t,e]),d=(0,r.useCallback)(function(i,n,r,s,c){let d="specialty"===r?`${t}${P.P.GET_SEARCH_SPECIALTY}`:`${t}${P.P.GET_SEARCH_V2}`;e({type:l.FetchSearchResultsStart});let{selectedLocation:p,geoLocationCoordinates:u,selectedSpecialty:g}=n,h="";if(!p){e({type:l.FetchSearchResultsFinish});return}h=p.id===j.I?"":p.id;let m=(null==u?void 0:u.lat)||"",b=(null==u?void 0:u.lng)||"",f=(null==g?void 0:g.id)>0?null==g?void 0:g.id:"",y=i.trim().length>H[a]?i.trim():"";return fetch((0,E.h)(d,Object.assign({domain:t,searchType:r||"global",keyword:y,city:h===j.a?"":h,lat:m,lng:b,specialty_id:f,client_slug:j.C.MSD===s?"":s,msd:j.C.MSD===o?1:""},"doctor"===r&&{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"!==r&&(a="doctor"===r?t.searches.map(e=>Object.assign(Object.assign({},e),{specialties:ignoreCacarSpecialty((null==e?void 0:e.specialties)||[])})):t.searches),"specialty"===r&&(a=y?ignoreCacarSpecialty((null==t?void 0:t.specialties)||[]):ignoreCacarSpecialty((null==t?void 0:t.default)||[])),e({type:l.FetchSearchResultsComplete,payload:{key:r,searches:a||[]}}),c&&e({type:l.UpdateInitialSearchResults,payload:{key:r,searches:a||[]}})}).catch(e=>{console.log("error loading search results",{url:d,error:e})}).finally(()=>e({type:l.FetchSearchResultsFinish}))},[a,t,e]),p=(0,r.useCallback)(function(){let i=`${t}${P.P.GET_SEARCH_SPECIALTY}`;return fetch((0,E.h)(i,{domain:t,searchType:"",msd:j.C.MSD===o?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:l.FetchAllSpecialties,payload:ignoreCacarSpecialty(t.specialties||[])})}).catch(e=>{console.log("error loading search results",{url:i,error:e})})},[a,t,e]),u=(0,r.useCallback)(function(o){let i=`${t}${P.P.GET_SEARCH_POPULAR_KEY}`;return fetch((0,E.h)(i,{domain:t,searchType:n[o],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:l.FetchPopularKeys,payload:t.popular_searches||[]})}).catch(e=>{console.log("error loading search results",{url:i,error:e})})},[a,t,e]);return{fetchCitiesByLocation:s,fetchCitiesByKeyword:c,fetchSearchResults:d,fetchAllSpecialties:p,fetchPopularKeys:u}}({dispatch:et,locale:R,careApiDomain:t,client:N}),eb=(0,r.useMemo)(()=>j.L[R],[R]),[ef,{close:ey,open:ex}]=(0,S.q)(!1),ev=(0,r.useMemo)(()=>Object.assign({doctor:{name:$("booking.searchPopup.doctors"),icon:r.createElement(DoctorIcon,null),slug:eb.DOCTOR},service:{name:$("booking.searchPopup.services"),icon:r.createElement(ServiceIcon,null),slug:eb.SERVICE},hospital:{name:$("booking.searchPopup.hospitals"),icon:r.createElement(HospitalIcon,null),slug:eb.HOSPITAL}},!I&&{specialty:{name:$("booking.searchPopup.specialties"),icon:r.createElement(SpecialtyIcon,null),slug:eb.SPECIALTIES}}),[U]),ew=(0,r.useMemo)(()=>O()(eu,400),[eu]),eS=(0,r.useMemo)(()=>O()(eg,400),[eg]),eE=(0,r.useCallback)(function({locationSlug:e,specialtyId:t}={}){var a;ey();let o="",{slug:i}=ev[U],n="",r=j.M[R][N],s=t||(null===(a=ee.selectedSpecialty)||void 0===a?void 0:a.id)||-1,c=e||(null==er?void 0:er.slug)||"";("doctor"===U||"hospital"===U)&&s>0&&(n=`&specialtyId=${s}`),o="specialty"===U?`/${i}`:`/${c}/${i}`,r&&(o+=`/${r}`),(o+=`?q=${el}${n}`)&&et({type:l.NavigateTo,payload:o})},[N,ey,U,et,R,el,null==er?void 0:er.slug,null===(_=ee.selectedSpecialty)||void 0===_?void 0:_.id,ev]),eC=(0,r.useCallback)(function(e){T&&eE({locationSlug:e.slug}),et({type:l.SelectLocation,payload:e}),M&&M(e)},[et,e,M,eE,T]);(0,C.a)(G,()=>{e||et({type:l.ClickOutsideInputSearchSpecialty})}),(0,r.useEffect)(()=>{var t;"denied"===en||es||et({type:l.SelectLocation,payload:{name:$("booking.searchBar.allLocations"),id:j.I,slug:null===(t=j.L[R])||void 0===t?void 0:t.ALL}}),F&&F(en,ee.geoLocationCoordinates),e&&"granted"===en&&er&&et({type:l.FocusInputSearch}),ep({coordinates:ee.geoLocationCoordinates})},[en]),(0,r.useEffect)(()=>{var e;let t=u||{name:$("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:eb.SPECIALTIES};if(u){(null===(e=ee.selectedSpecialty)||void 0===e?void 0:e.id)!==u.id&&et({type:l.SelectSpecialty,payload:u});return}ee.selectedSpecialty&&ee.selectedSpecialty.id===t.id||et({type:l.SelectSpecialty,payload:t})},[u,eb.SPECIALTIES,$]),(0,r.useEffect)(()=>{eh()},[]),(0,r.useEffect)(()=>{em(U)},[U]),(0,r.useEffect)(()=>{eo&&(D?D(eo):window.location.href=`${g}${eo}`)},[eo]),(0,r.useEffect)(()=>{eg(ee.searchKeywords,ee,U,N,!0)},[U]),(0,r.useEffect)(()=>{if(ef&&e){let e=setTimeout(()=>{var e;null===(e=Y.current)||void 0===e||e.focus()},150);return()=>clearTimeout(e)}},[ef,e]);let ek={type:U,isMobile:e,state:ee,dispatch:et,debouncedFetchSearchResults:eS,initalSearchValue:c,onEnterSearch:eE,typeInformation:ev,trackingAttributes:m,isLoading:ed,hideSpecialtySelection:w||I,clientSlug:N,triggerSearchWhenChangeFilter:T,onChangeSpecialty:e=>T&&eE({specialtyId:e.id})};return r.createElement(r.Fragment,null,r.createElement(B,{ref:q},r.createElement(TabSearch,{currentTab:U,setCurrentTab:Q,isMobile:e,hideTabBookingSearch:v,hideSpecialtyTab:I}),r.createElement(A,{className:"booking-search-container"},r.createElement(K,null,r.createElement(Z,{className:"booking-search-content"},r.createElement("div",{ref:G},r.createElement(f.k,{gap:"12px",align:"center",className:"flex-search-input"},r.createElement(ea,Object.assign({},ek,{ref:V,onFocusInput:()=>e&&ex()})),"specialty"!==U&&r.createElement(SearchLocation,{state:ee,isMobile:e,dispatch:et,debouncedFetchCitiesByKeyword:ew,selectedLocation:er,onLocationClick:eC,trackingAttributes:b}),!e&&r.createElement(z.B,{size:"lg",variant:"primary",onClick:()=>eE(),styles:{root:{height:"48px",minWidth:"120px",borderRadius:"12px"}}},$("booking.searchBar.searchButton"))),!L&&"specialty"!==U&&ee.popularKeys.length>0&&r.createElement(SearchTag,{type:U,state:ee,typeInformation:ev,dispatch:et}),"specialty"===U&&"search"===ei&&r.createElement(SearchResultSpecialties,{state:ee,isMobile:e,dispatch:et,specialties:(null==ec?void 0:ec.specialty)||[],isLoading:ed})))))),e&&r.createElement(ModalSearchResult,{keepMounted:!0,opened:ef,onClose:ey,closeModal:ey,searchInputEle:r.createElement(f.k,{align:"center",gap:8},r.createElement(ea,Object.assign({},ek,{onlyShowSearchBox:!0,ref:Y})),r.createElement(z.B,{variant:"primary",leftIcon:r.createElement(s.Z,{size:20,color:"#fff"}),onClick:()=>eE(),styles:{root:{borderRadius:"12px"}}}))},r.createElement(p.x,{sx:{marginLeft:-16,marginRight:-16}},r.createElement(SearchResultContent,{type:U,state:ee,dispatch:et,isLoading:ed,typeInformation:ev,clientSlug:N}))))},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:o})=>r.createElement(eb,{style:o,className:a},r.createElement(D.C,null,r.createElement("div",{className:"icon-wrapper"},t),r.createElement(F.T,{size:"c1",color:"var(--neutral800)"},e)))},Xlwb:function(e,t,a){a.d(t,{H:function(){return HealthToolFormWrapper}});var o=a("6eqW"),i=a("q1tI"),l=a("/npG"),n=a("mYVa"),r=a("Eso5"),s=a("aDCK"),c=a("9n+W"),d=a("8vDj"),p=a("SPK5"),u=a("2wr/"),g=a("ZQ3V"),h=a("p3w3"),m=a("ZKGu"),b=a("yVya"),f=a("iBNF"),y=(0,l.k)(()=>({root:{justifyContent:"flex-start"},group:{display:"flex",alignItems:"stretch",gap:(0,n.h)(8)},item:{flex:"1 1 0px"},icon:{flexShrink:0}}));let x=(0,i.createContext)({}),v=(0,l.k)(()=>({root:{display:"flex",flexDirection:"column",gap:(0,n.h)(8),paddingLeft:16,paddingRight:16,"&:last-child":{paddingBottom:16}}}));var w=(0,l.k)((e,{formLayout:t})=>({root:{display:"flex",flexDirection:"column",gap:(0,n.h)("inline"===t?8:16),borderRadius:"inherit",".mantine-Input-input::placeholder, .mantine-Input-input[data-invalid]::placeholder":{color:"#8C8C8C"},[e.fn.smallerThan("sm")]:Object.assign({"input, .mantine-DatePickerInput-input":{fontSize:(0,n.h)(14)}},"default"===t&&{gap:8})},control:{width:(0,n.h)(180),flexShrink:1,"&.error":{"button, input":{borderColor:e.colors.red[7]}}}}));let S=(0,l.k)((e,{formLayout:t})=>{let a="mb"===e.other.template;return{root:Object.assign(Object.assign({minWidth:(0,n.h)(180)},"inline"===t&&{alignSelf:"flex-end",marginTop:(0,n.h)(16)}),"default"===t&&Object.assign({},a&&{alignSelf:"center"}))}}),E=(0,l.k)(e=>({root:{color:e.colors.gray[6],whiteSpace:"nowrap",paddingRight:(0,n.h)(16)}}));var C=(0,l.k)(()=>({root:{display:"flex",gap:(0,n.h)(8),border:"1px solid #EAEAEC",borderRadius:(0,n.h)(16),padding:"10px 16px 12px 16px",flex:"1 1 0px",".mantine-Input-input":{border:0,paddingLeft:0,height:"22px",borderRadius:0,"&:focus":{outline:0,boxShadow:"none"}}},info:{display:"flex",flexDirection:"column",gap:0,flex:"1 1 0px"},label:{color:"#7C7C8F",fontWeight:"normal"},content:{},rightSection:{display:"flex",alignItems:"center",textTransform:"lowercase",color:"#3E3F58"}})),k=(0,l.k)((e,{width:t,direction:a})=>{let o="mb"===e.other.template;return{root:{display:"flex",flexDirection:"column",gap:(0,n.h)(8)},row:{display:"flex",flexDirection:a,alignItems:"stretch",justifyContent:"space-between",gap:(0,n.h)(16),minHeight:(0,n.h)(40)},labelWrapper:Object.assign({flex:"1 1 0px",display:"flex",alignItems:"center"},"row"===a&&{borderBottom:`1px solid ${e.colors.neutral[1]}`}),label:{fontSize:(0,n.h)(14),lineHeight:(0,n.h)(22),color:e.colors.gray[6]},content:{display:"flex",alignItems:"center",gap:(0,n.h)(8),input:{backgroundColor:"#fff"}},control:{width:"number"==typeof t?(0,n.h)(t):t,flexShrink:1,input:Object.assign({},o&&{borderRadius:(0,n.h)(12)}),"&.error":{"button, input":{borderColor:e.colors.red[7]}}},error:{color:"red",textAlign:"right"}}});let I=(0,l.k)(()=>({root:{color:"red",textAlign:"right",width:"auto"}}));var O=(0,l.k)(e=>{let t="mb"===e.other.template;return{root:{label:Object.assign({},t&&{color:f.r.mbColors.midGray,fontSize:(0,n.h)(12),fontWeight:"normal"})}}});let HealthToolFormWrapper=e=>{var{children:t,formLayout:a,styles:l,classNames:n,className:s,component:c="form"}=e,d=(0,o._)(e,["children","formLayout","styles","classNames","className","component"]);let p=a||"default",{classes:u,cx:g}=w({formLayout:p},{name:"HealthToolFormWrapper",styles:l,classNames:n});return i.createElement(x.Provider,{value:{formLayout:p}},i.createElement(r.x,Object.assign({component:c,className:g(s,u.root)},d),t))};HealthToolFormWrapper.Control=e=>{var{className:t,styles:a,classNames:l}=e,n=(0,o._)(e,["className","styles","classNames"]);let{classes:s,cx:c}=O(void 0,{name:"HealthToolFormWrapper__Control",styles:a,classNames:l});return i.createElement(r.x,Object.assign({className:c(t,s.root)},n))},HealthToolFormWrapper.BorderInlineControl=({label:e,children:t,styles:a,classNames:o,direction:l="row",width:n=180,errorMess:s})=>{let{classes:c}=k({width:n,direction:l},{name:"HealthToolFormWrapper__BorderInlineControl",styles:a,classNames:o});return i.createElement(r.x,{className:c.root},i.createElement(r.x,{className:c.row},i.createElement(r.x,{className:c.labelWrapper},e&&i.createElement("label",{className:c.label,htmlFor:"gender"},e)),i.createElement(r.x,{className:c.content},(0,b.Z)(t).map((e,t)=>i.createElement(r.x,{key:t,className:c.control},e)))),s&&i.createElement(g.T,{size:"p4",className:c.error},s))},HealthToolFormWrapper.BorderBoxControl=e=>{var{label:t,rightSection:a,children:l,styles:n,className:s,classNames:c}=e,d=(0,o._)(e,["label","rightSection","children","styles","className","classNames"]);let{classes:p,cx:u}=C(void 0,{name:"HealthToolFormWrapper__BorderBoxControl",styles:n,classNames:c});return i.createElement(r.x,Object.assign({className:u(p.root,s)},d),i.createElement(r.x,{className:p.info},t&&i.createElement(g.T,{size:"n1",as:"label",className:p.label},t),i.createElement(r.x,{className:p.content},i.isValidElement(l)?i.cloneElement(l,Object.assign(Object.assign({},l.props),{size:"sm",error:null})):null)),a&&i.createElement(r.x,{className:p.rightSection},"string"==typeof a?i.createElement(g.T,{size:"p4"},a):i.isValidElement(a)?i.cloneElement(a,{size:24}):null))},HealthToolFormWrapper.Error=e=>{var{styles:t,classNames:a,className:l}=e,n=(0,o._)(e,["styles","classNames","className"]);let{classes:r,cx:s}=I(void 0,{name:"HealthToolFormWrapper__UnitText",styles:t,classNames:a});return i.createElement(g.T,Object.assign({size:"p4",className:s(l,r.root)},n))},HealthToolFormWrapper.FormRow=e=>{var{styles:t,classNames:a,className:l,children:n}=e,s=(0,o._)(e,["styles","classNames","className","children"]);let{classes:c,cx:d}=v(void 0,{name:"HealthToolFormWrapper__FormRow",styles:t,classNames:a});return i.createElement(r.x,Object.assign({className:d(l,c.root)},s),n)},HealthToolFormWrapper.Submit=e=>{var{styles:t,classNames:a,className:l}=e,n=(0,o._)(e,["styles","classNames","className"]);let{formLayout:r}=(0,i.useContext)(x),{classes:s,cx:c}=S({formLayout:r},{name:"HealthToolFormWrapper__SubmitBtn",styles:t,classNames:a});return i.createElement(h.B,Object.assign({className:c("submit-btn",l,s.root)},n,{variant:"primary",size:"md"}))},HealthToolFormWrapper.Unit=e=>{var{styles:t,classNames:a,className:l}=e,n=(0,o._)(e,["styles","classNames","className"]);let{classes:r,cx:s}=E(void 0,{name:"HealthToolFormWrapper__UnitText",styles:t,classNames:a});return i.createElement(g.T,Object.assign({size:"p4",className:s(l,r.root)},n))},HealthToolFormWrapper.Switching=e=>{var{label:t}=e,a=(0,o._)(e,["label"]);let{t:l}=(0,m.u)(),r=(0,d.rZ)(),s="mb"===r.other.template;return i.createElement(p.k,{gap:(0,n.h)(4),sx:()=>({justifyContent:"space-between",alignItems:"center"})},t&&i.createElement(g.T,{size:s?"p4":"s4",color:"gray.6"},t),i.createElement(u.r,Object.assign({labelPosition:"left",onLabel:l("switchBtn.yes"),offLabel:l("switchBtn.no")},a,{styles:e=>({trackLabel:{fontSize:(0,n.h)(12)},track:{cursor:"pointer"},body:{[e.fn.largerThan("sm")]:{flexDirection:"column",alignItems:"flex-start"},[e.fn.smallerThan("sm")]:{justifyContent:"space-between"}},labelWrapper:{[e.fn.smallerThan("sm")]:{display:"flex",justifyContent:"center"}}})})))},HealthToolFormWrapper.ChipGroup=e=>{var{data:t=[],label:a,isMobile:l,layout:d="horizonal",classNames:p,styles:u}=e,h=(0,o._)(e,["data","label","isMobile","layout","classNames","styles"]);let{classes:m,theme:b}=y(void 0,{name:"ChipGroup",classNames:p,styles:u}),f="mb"===b.other.template,x=l?48:f?32:"vertical"===d?32:18;return i.createElement(r.x,null,i.createElement(s.I.Wrapper,{label:a&&i.createElement(g.T,{size:"p3",weight:"semiBold"},a)},i.createElement(c.A.Group,Object.assign({},h),i.createElement(r.x,{className:m.group},t.map((e,t)=>i.createElement(c.A,{className:m.item,key:t,value:String(e.value),styles:{iconWrapper:{display:"none"},label:{width:"100%",borderRadius:(0,n.h)(f?12:8),padding:0,border:`1px solid ${f?"#EAEAEC":b.colors.neutral[2]}`,height:"100%","&[data-checked]":{padding:0,backgroundColor:f?"#FFE9F1":b.colors.blue[0],border:`1px solid ${f?"#F5B4CB":b.colors.blue[1]}`},[b.fn.smallerThan("sm")]:{alignItems:"flex-start"}}}},i.createElement(r.x,{sx:Object.assign(Object.assign(Object.assign({width:"100%",display:"flex",gap:(0,n.h)(f?2:8),padding:"8px 16px 8px 12px",justifyContent:"center",alignItems:"center"},f&&{flexDirection:"column"}),"vertical"===d&&{flexDirection:"column",padding:"16px 8px 8px"}),{[b.fn.smallerThan("sm")]:{flexDirection:"column",padding:"16px 8px 8px"}})},i.isValidElement(e.icon)?i.cloneElement(e.icon,{size:x,isMarryBaby:f,className:m.icon}):null,i.createElement(g.T,{size:"p4",styles:{root:Object.assign(Object.assign({},f&&{textAlign:"center"}),{whiteSpace:"normal",[b.fn.smallerThan("sm")]:{fontSize:(0,n.h)(12),lineHeight:(0,n.h)(18),textAlign:"center"}})}},e.label))))))))}},EDn0:function(e,t,a){a.d(t,{I:function(){return ImageWrap},u:function(){return useScreenSize}});var o=a("q1tI"),i=a("K2Xj"),l=a("6eqW"),n=a("rBCA");let getIsMobile=()=>"undefined"!=typeof window&&window.innerWidth"undefined"!=typeof window&&window.innerWidth>=i.B.BREAK_POINT_MOBILE&&window.innerWidth{let[e,t]=(0,o.useState)(getIsMobile()),[a,i]=(0,o.useState)(getIsLargeMobile());return(0,o.useEffect)(()=>{let handleResize=()=>{t(getIsMobile()),i(getIsLargeMobile())};return window.addEventListener("resize",handleResize,{passive:!0}),()=>{window.removeEventListener("resize",handleResize)}},[]),{isMobile:e,isLargeMobile:a}},ImageWrap=e=>{var{alt:t,backupSrc:a,src:i,placeholderSrc:n,style:s,ref:c}=e,d=(0,l._)(e,["alt","backupSrc","src","placeholderSrc","style","ref"]);let[p,u]=(0,o.useState)(!1);return o.createElement(r,Object.assign({loading:"lazy",alt:t,onError:()=>!p&&u(!0),src:p?a||i:i||a,style:Object.assign(Object.assign({},n?{backgroundImage:`url(${n})`}:{}),s),"data-has-placeholder":!!n,ref:c},d))},r=n.Z.img` &[data-has-placeholder='true'] { background-position: center; background-repeat: no-repeat; background-size: cover; } `},gOIo:function(e,t,a){a.d(t,{M:function(){return Modal}});var o=a("6eqW"),i=a("q1tI"),l=a("h8tX"),n=a("GDet");let Modal=e=>{var{styles:t,classNames:a,transitionProps:r}=e,s=(0,o._)(e,["styles","classNames","transitionProps"]);let{classes:c}=(0,n.u)(void 0,{name:"Modal",styles:t,classNames:a});return i.createElement(l.u,Object.assign({centered:!0,classNames:c,transitionProps:Object.assign({transition:"fade"},r),trapFocus:!1},s))}}}]);