"use strict";(self.webpackChunkhhgHealthCareV1=self.webpackChunkhhgHealthCareV1||[]).push([[2060,7777],{37777:function(e,t,a){a.d(t,{n:function(){return _e}});var o=a(73884),i=a.n(o),n=a(26662),l=a(51387),r=a(94858),s=a(25793),c=a(50864),d=a(48085),p=a(86566),u=a(6596),h=a(50315),g=a(14677),b=a(36814),m=a(73827),f=a(42060),y=a(40279),v=a(83621),x=a(6806),w=a(11851),S=a(35291),C=a(77514),E=a(91266),O=a(35616),k=a.n(O),j=a(27516);const L=({className:e,color:t})=>i().createElement("svg",{width:"14",height:"20",viewBox:"0 0 14 20",className:e},i().createElement("path",{d:"M7 0C3.134 0 0 3.134 0 7C0 10.966 4.404 16.82 6.226 19.071C6.626 19.565 7.374 19.565 7.774 19.071C9.596 16.82 14 10.966 14 7C14 3.134 10.866 0 7 0ZM7 9.5C5.619 9.5 4.5 8.381 4.5 7C4.5 5.619 5.619 4.5 7 4.5C8.381 4.5 9.5 5.619 9.5 7C9.5 8.381 8.381 9.5 7 9.5Z",fill:t||"currentColor"})),I=w.A.li` display: flex; align-items: center; gap: 12px; padding: 8px 16px; > :first-child { flex: 1; } > :nth-child(2) { flex: 6; } & + li::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background-color: ${S.w.colors.neutral100}; } `,T="url(\"data:image/svg+xml,%3Csvg width='19' height='14' viewBox='0 0 19 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.9803 0.990669C16.7205 0.99841 16.4739 1.10699 16.2928 1.2934L5.99984 11.5864L2.70687 8.2934C2.61473 8.19743 2.50436 8.12081 2.38223 8.06802C2.2601 8.01524 2.12867 7.98735 1.99563 7.986C1.86259 7.98464 1.73061 8.00985 1.60743 8.06014C1.48426 8.11043 1.37235 8.18479 1.27827 8.27887C1.1842 8.37295 1.10983 8.48485 1.05954 8.60803C1.00926 8.73121 0.98405 8.86318 0.985403 8.99622C0.986757 9.12926 1.01464 9.26069 1.06743 9.38282C1.12021 9.50495 1.19684 9.61532 1.29281 9.70747L5.29281 13.7075C5.48035 13.8949 5.73467 14.0002 5.99984 14.0002C6.26501 14.0002 6.51933 13.8949 6.70687 13.7075L17.7069 2.70747C17.8514 2.567 17.9501 2.38616 17.99 2.18864C18.03 1.99112 18.0093 1.78614 17.9308 1.60055C17.8523 1.41497 17.7195 1.25744 17.5499 1.14861C17.3803 1.03978 17.1817 0.984729 16.9803 0.990669Z' fill='%232685F1'/%3E%3C/svg%3E%0A\")",$=(w.A.div` display: flex; position: absolute; top: 48px; min-width: 100%; box-shadow: 0px 24px 32px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 1px rgba(0, 0, 0, 0.04); border-radius: ${S.w.borderRadius}; background-color: white; z-index: 30; ${C.M.tdDown} { position: relative; top: 0; box-shadow: initial; } `,w.A.ul` width: 100%; max-height: 600px; overflow-y: auto; `,(0,w.A)(L)` width: 12px; height: 18px; `,w.A.li` position: relative; cursor: pointer; padding: 12px 18px; display: flex; align-items: center; gap: 14px; overflow: hidden; ${({isSelected:e})=>e&&`\n &::after {\n content: ${T};\n top: 50%;\n right: 18px;\n position: absolute;\n transform: translateY(-50%);\n }\n `} & + li::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background-color: ${S.w.colors.neutral100}; } &:not([data-is-denied='true']):hover { background-color: ${S.w.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; } `,(0,w.A)((({count:e,className:t})=>i().createElement(i().Fragment,null,[...Array(e)].map(((e,a)=>i().createElement(I,{className:t,key:a},i().createElement(E.A,{count:1,height:32}),i().createElement(E.A,{count:1,height:24})))))))` &:first-child { padding-top: 18px; } `,(e,t,a)=>k()(e,Object.assign(Object.assign({},t),{domain:j.y[a||"en-PH"]})));var P=a(33824),M=a(18301),R=a(38221),D=a.n(R),A=a(78833),F=a(15356),N=a(16478),K=a(57232),B=a(29833),z=a(41303),_=function(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i{var{size:t,color:a=z.fT}=e,o=_(e,["size","color"]);const n=(0,z.D5)(t);return i().createElement("svg",Object.assign({width:n,height:n,viewBox:"0 0 24 24",fill:"none"},o),i().createElement("path",{fill:a,d:"M10.296 18.658c.256 0 .512-.1.707-.295l.086-.086a1 1 0 0 0 0-1.414L7.226 13h13.07a1 1 0 0 0 0-2H7.226l3.863-3.863a1 1 0 0 0 0-1.414l-.086-.086a1 1 0 0 0-1.414 0l-5.656 5.656a1 1 0 0 0 0 1.414l5.656 5.656a1 1 0 0 0 .707.295"}))},V=a(27492);const W="api/lists/cities?keyword={keyword}&country_id={countryId}&site={domain}&_nopaging={noPaging}&client={client}&hospital_active={hospitalActive}",G="api/v2/search/?site={domain}&type={searchType}&keyword={keyword}&city_id={city}&latitude={lat}&longitude={lng}&specialty_id={specialty_id}&client_slug={client_slug}&msd={msd}&skip_booking={skipBooking}",H="api/geobyip?site={domain}&latitude={lat}&longitude={lng}&_nopaging={noPaging}&client={client}&hospital_active={hospitalActive}",U="api/v2/specialties/?site={domain}&type={searchType}&keyword={keyword}&city_id={city}&latitude={lat}&longitude={lng}&msd={msd}",Q="api/search/keywords?site={domain}&sort_by={sort_by}&sort_order={sort_order}&type={searchType}";var Y=a(51442);const Z=w.A.div``,J=w.A.div` background-color: ${S.w.colors.neutral50}; padding-bottom: 1px; ${C.M.mbDown} { padding: 0 16px 10px; } `,X=(0,w.A)(F.C)` padding: 0 16px; ${C.M.mbDown} { padding: 0; } `,ee=w.A.div` padding: 24px 56px; border-radius: 16px; background-color: ${S.w.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); ${C.M.mbDown} { padding: 16px 16px; border-radius: 0px 0px 12px 12px; } .flex-search-input { flex-direction: row; ${C.M.mbDown} { flex-direction: column; } } `,te={"en-PH":3,"tl-PH":2,"id-ID":3,"vi-VN":2,"zh-TW":0,"ms-MY":2,"th-TH":2},ae={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:[]};var oe;function ie(e){const{selectedLocation:t,searchLocationKeywords:a}=e;return t&&a!==t.name?Object.assign(Object.assign({},e),{searchLocationKeywords:t.name}):e}function ne(e,t){var a,o;switch(e.isDebug&&console.log("bookingSearchBar",{action:t,state:e}),t.type){case oe.NavigateTo:return Object.assign(Object.assign({},e),{navigateTo:t.payload,focused:"none",isMobileModalOpened:!1});case oe.ClickOutsideInputLocation:return"location"!==e.focused?e:ie(Object.assign(Object.assign({},e),{focused:"none"}));case oe.ClickOutsideInputSpecialty:return"specialty"!==e.focused?e:ie(Object.assign(Object.assign({},e),{focused:"none"}));case oe.ClickOutsideInputSearch:return"search"!==e.focused?e:Object.assign(Object.assign({},e),{focused:"none"});case oe.ClickOutsideInputSearchSpecialty:return"search"!==e.focusedSpecialty?e:Object.assign(Object.assign({},e),{focusedSpecialty:"none"});case oe.FocusInputLocation:{const t=Object.assign(Object.assign({},e),{focused:"location"});return(null===(a=e.selectedLocation)||void 0===a?void 0:a.id)===A.a&&(t.searchLocationKeywords=""),t}case oe.FocusInputSpecialty:{const t=Object.assign(Object.assign({},e),{focused:"specialty"});return(null===(o=e.selectedLocation)||void 0===o?void 0:o.id)===A.a&&(t.searchLocationKeywords=""),t}case oe.FocusInputSearch:const i=Object.assign(Object.assign({},e),{focused:"search"});return e.isMobile?ie(i):i;case oe.FocusInputSearchSpecialty:return Object.assign(Object.assign({},e),{focusedSpecialty:"search"});case oe.ChangeInputLocation:return Object.assign(Object.assign({},e),{searchLocationKeywords:t.payload});case oe.ChangeInputSearch:{const a=t.payload;return Object.assign(Object.assign({},e),{searchKeywords:a,isLoadingSearchResults:a.trim().length>te[e.locale]})}case oe.SelectCurrentLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case oe.ClearInputLocation:return Object.assign(Object.assign({},e),{focused:"location",cities:e.initialCities,searchLocationKeywords:""});case oe.ClearInputSearch:return Object.assign(Object.assign({},e),{focused:"search",searchKeywords:""});case oe.SelectLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name,searchResults:{}});case oe.SelectSpecialty:return Object.assign(Object.assign({},e),{focused:"none",selectedSpecialty:t.payload,searchResults:{}});case oe.SelectSearchResult:return Object.assign(Object.assign({},e),{searchKeywords:t.payload.name,isMobileModalOpened:!1,focused:"none",navigateTo:t.payload.url});case oe.FetchCitiesStart:return Object.assign(Object.assign({},e),{isLoadingCities:!0});case oe.FetchCitiesFinish:return Object.assign(Object.assign({},e),{isLoadingCities:!1});case oe.FetchSearchResultsStart:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!0});case oe.FetchSearchResultsFinish:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!1});case oe.FetchSearchResultsComplete:return Object.assign(Object.assign({},e),{searchResults:Object.assign(Object.assign({},e.searchResults),{[t.payload.key]:t.payload.searches})});case oe.FetchCitiesByGeoIpComplete:{let{cities:a}=t.payload;const{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);const 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 oe.FetchCitiesByKeywordComplete:return Object.assign(Object.assign({},e),{cities:t.payload});case oe.DisplayInitialCities:return Object.assign(Object.assign({},e),{cities:e.initialCities});case oe.DisplayInitialSearchResults:{const t=e.searchKeywords.trim(),a=te[e.locale],o=t.length>0&&t.length<=a;return Object.assign(Object.assign({},e),{searchResults:o?{}:e.initialSearchResults,isLoadingSearchResults:!1})}case oe.UpdateInitialSearchResults:return Object.assign(Object.assign({},e),{initialSearchResults:Object.assign(Object.assign({},e.initialSearchResults),{[t.payload.key]:t.payload.searches})});case oe.GrantGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"granted",geoLocationCoordinates:t.payload});case oe.DenyGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"denied",geoLocationCoordinates:null});case oe.OpenMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!0});case oe.CloseMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!1});case oe.UpdateInitialSearchValue:return Object.assign(Object.assign({},e),{searchKeywords:t.payload});case oe.SetInputSearchPlaceholder:return Object.assign(Object.assign({},e),{inputSearchPlaceholder:t.payload});case oe.FetchAllSpecialties:return Object.assign(Object.assign({},e),{allSpecialties:t.payload});case oe.FetchPopularKeys:return Object.assign(Object.assign({},e),{popularKeys:t.payload});default:return e}}!function(e){e.NavigateTo="navigate to url",e.ClickOutsideInputLocation="click outside input location",e.ClickOutsideInputSearch="click outside input search",e.ClickOutsideInputSearchSpecialty="click outside input search specialty",e.ClickOutsideInputSpecialty="click outside input specialty",e.SelectCurrentLocation="select current location",e.FocusInputLocation="focus input location",e.FocusInputSearch="focus input search",e.FocusInputSearchSpecialty="focus input search specialty",e.ChangeInputLocation="change input location",e.ChangeInputSearch="change input search",e.ClearInputLocation="clear input location",e.ClearInputSearch="clear input search",e.SelectLocation="select location",e.SelectSpecialty="select specialty",e.FetchCitiesStart="fetch cities start",e.FetchCitiesFinish="fetch cities finish",e.FetchSearchResultsStart="fetch search results start",e.FetchSearchResultsComplete="fetch search results complete",e.FetchSearchResultsFinish="fetch search results finish",e.FetchCitiesByGeoIpComplete="fetch cities by geo IP finish",e.FetchCitiesByKeywordComplete="fetch cities by keyword finish",e.DisplayInitialCities="display initial cities",e.DisplayInitialSearchResults="display initial search results",e.UpdateInitialSearchResults="update initial search results",e.GrantGeoLocationPermission="grant geolocation permission",e.DenyGeoLocationPermission="deny geolocation permission",e.OpenMobileModal="open mobile modal",e.CloseMobileModal="close mobile modal",e.UpdateInitialSearchValue="update initial search value",e.SelectSearchResult="select search result",e.SetInputSearchPlaceholder="set input search placeholder",e.FocusInputSpecialty="focus input specialty",e.FetchAllSpecialties="fetch all specialty",e.FetchPopularKeys="fetch popular key by type"}(oe||(oe={}));const le=w.A.div` flex: 1; position: relative; ${C.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } `,re=w.A.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${S.w.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${C.M.mbDown} { width: calc(100% + 64px); left: -32px; } `,se=w.A.div``;w.A.div` display: flex; justify-content: space-between; align-item: center; padding: 9px 14px 9px 22px; background: #f7f9fc; .title { color: ${S.w.colors.gray800}; font-size: 14px; font-weight: 600; line-height: 22px; } .btn-see-all { color: ${S.w.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `;const ce=w.A.div` padding: 10px 16px; max-height: 400px; overflow: auto; `,de=w.A.div` display: flex; gap: 12px; align-items: center; cursor: pointer; ${C.M.mbUp} { &:hover { background-color: ${S.w.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 ${S.w.colors.neutral100}; .title { color: ${S.w.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; } .description { overflow: hidden; color: ${S.w.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; } } `;w.A.div` padding: 0 16px 16px; .search-detail-btn { color: ${S.w.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `;const pe=({state:e,type:t,results:a,isLoading:n,typeInformation:s,dispatch:c})=>{const{t:d}=(0,M.u)(),{selectedLocation:p}=e,u=(0,o.useMemo)((()=>s[t].slug),[s,t]);return null===a?null:i().createElement(se,null,i().createElement(ce,{className:"search-results__body"},n&&i().createElement("div",{className:"skeleton-result"},Array(3).fill(void 0).map(((e,a)=>i().createElement(de,{key:t+"loading"+a,className:2===a?"last-item":""},i().createElement("div",{className:"image-item"},i().createElement(l.E,{height:48,circle:!0,mb:"xl",animate:!0})),i().createElement("div",{className:"infor"},i().createElement("div",{className:"title"},i().createElement(l.E,{height:8,mt:10,radius:"xl",animate:!0})),i().createElement("div",{className:"description"},i().createElement("div",{className:"sub-description"},i().createElement(l.E,{height:8,mt:10,radius:"xl",width:"80%",animate:!0})))))))),!n&&a&&a.length>0&&i().createElement(i().Fragment,null,a.map(((e,o)=>{var n,l;const d=a.length>4&&3===o||a.length<=4&&o===a.length-1;let h="";return"hospital"===t&&(h=(null===e||void 0===e?void 0:e.address)||""),"doctor"===t&&(h=(null===(n=null===e||void 0===e?void 0:e.specialties)||void 0===n?void 0:n.join(", "))||""),"service"===t&&(h=(null===(l=null===e||void 0===e?void 0:e.hospital_branch)||void 0===l?void 0:l.name)||""),o>=4?i().createElement(i().Fragment,null):i().createElement(de,{key:e.id,className:(0,r.A)(d?"last-item":"","result-item"),onClick:()=>(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&&c({type:oe.NavigateTo,payload:a})})(e)},i().createElement("div",{className:"image-item"},i().createElement("img",{src:e.logo||e.avatar,alt:e.name})),i().createElement("div",{className:"infor"},i().createElement("div",{className:"title"},e.name),i().createElement("div",{className:"description"},s[t].icon,i().createElement("div",{className:"sub-description"},h))))}))),!n&&0===(null===a||void 0===a?void 0:a.length)&&i().createElement(N.T,{size:"sm",color:S.w.colors.gray400,className:"noresult-block"},d("booking.searchBar.noResults"))))},ue=({state:e,type:t,isLoading:a,clientSlug:o,typeInformation:n,dispatch:l})=>{var r;return"search"!==e.focused?null:i().createElement(pe,{type:t,state:e,results:(null===(r=e.searchResults)||void 0===r?void 0:r[t])||null,location:e.selectedLocation.name,dispatch:l,isLoading:a,typeInformation:n,clientSlug:o})},he=w.A.div` position: relative; ${C.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } `;w.A.div` position: absolute; top: calc(100% + 2px); width: calc(100% + 100px); border-radius: 4px; background: ${S.w.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; max-height: 300px; overflow: auto; ${C.M.mbDown} { width: calc(100% + 64px); left: -32px; } `;const ge=w.A.li` position: relative; cursor: pointer; padding: 12px 18px; display: flex; align-items: center; gap: 14px; overflow: hidden; .image-item { display: flex; align-items: center; width: 40px; height: 40px; flex-shrink: 0; img { width: 100%; object-fit: cover; } svg { width: 40px; } } ${({isSelected:e})=>e&&`\n &::after {\n content: ${T};\n top: 50%;\n right: 18px;\n position: absolute;\n transform: translateY(-50%);\n }\n `} & + li::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; background-color: ${S.w.colors.neutral100}; } &:not([data-is-denied='true']):hover { background-color: ${S.w.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; } `,be=()=>i().createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},i().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"})),me=()=>i().createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},i().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"})),fe=()=>i().createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},i().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"})),ye=()=>i().createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},i().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"})),ve=(0,o.forwardRef)(((e,t)=>{var{label:a,value:o,specialty:n}=e,l=(0,B._)(e,["label","value","specialty"]);return i().createElement("div",Object.assign({ref:t},l),i().createElement(ge,{key:o,role:"button",tabIndex:0,"aria-label":`Select ${a} as location`},i().createElement("div",{className:"image-item"},n.thumbnail?i().createElement("img",{src:n.thumbnail,alt:a}):i().createElement(ye,null)),i().createElement(s.E,{size:"md"},a)))})),xe=({state:e,onSpecialtyClick:t,dispatch:a})=>{const{t:n,locale:l}=(0,M.u)(),r=(0,o.useRef)(null),s=(0,o.useMemo)((()=>A.L[l]),[l]);(0,P.a)(r,(()=>{a({type:oe.ClickOutsideInputSpecialty})}));const p=[{name:n("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:s.SPECIALTIES},...e.allSpecialties],u=e.selectedSpecialty&&"number"===typeof e.selectedSpecialty.id?String(e.selectedSpecialty.id):null;return i().createElement(he,{ref:r},i().createElement(c.l6,{value:u,placeholder:n("booking.searchPopup.specialties"),searchable:!0,nothingFound:n("common.noResult"),maxDropdownHeight:340,dropdownPosition:"bottom",data:p.map((e=>({value:String(e.id),label:e.name,specialty:e}))),rightSection:i().createElement(K.C,{style:{width:20,height:20}}),styles:e=>({dropdown:{left:"0 !important",border:0,marginTop:-7,borderRadius:0,"& [data-mantine-scrollbar]":{'&[data-orientation="vertical"]':{width:"6px"}},[e.fn.largerThan("sm")]:{minWidth:264,width:"264px !important"}},item:{padding:0,"&[data-selected]":{"&, &:hover":{backgroundColor:"transparent",color:"inherit"}},"&[data-hovered]":{backgroundColor:"transparent"}},input:{"&:not(.mantine-Textarea-input)":{height:40,fontSize:(0,d.D)(14),paddingLeft:14,paddingRight:14,[e.fn.largerThan("sm")]:{height:46,fontSize:(0,d.D)(16),paddingLeft:16,paddingRight:16,borderColor:"transparent"},"&:focus, &:focus-within":{outline:"none",boxShadow:"none"}}},itemsWrapper:{padding:0},wrapper:{[e.fn.largerThan("sm")]:{position:"relative","&:after":{content:'""',width:"1px",height:"20px",backgroundColor:"#E4E8EC",position:"absolute",right:0,top:"13px"}}}}),itemComponent:ve,filter:(e,t)=>t.label.toLowerCase().includes(e.toLowerCase().trim()),onChange:e=>{if(null==e)return;const a=p.find((t=>String(t.id)===e));a&&t(Object.assign(Object.assign(Object.assign({},a),{thumbnail:a.thumbnail||""}),-1!==Number(e)&&{total_doctor:0}))}}))},we=(0,o.forwardRef)((({state:e,type:t,isMobile:a,isLoading:l,initalSearchValue:r,typeInformation:s,debouncedFetchSearchResults:c,trackingAttributes:h,hideSpecialtySelection:g=!1,clientSlug:b="",onSearch:m,onFocusInput:f,onEnterSearch:y,dispatch:v,onlyShowSearchBox:x,onChangeSpecialty:w},S)=>{const{t:C}=(0,M.u)(),E=(0,p.xd)(),O=(0,o.useRef)(null),k=(0,o.useRef)(null);(0,o.useImperativeHandle)(S,(()=>({focus:()=>{var e;null===(e=k.current)||void 0===e||e.focus()}})));const j=!x,L=(0,o.useMemo)((()=>h?{"data-event-category":h.dataEventCategory,"data-event-action":h.dataEventAction,"data-event-label":h.dataEventLabel}:{}),[h]),I=(0,o.useMemo)((()=>"doctor"===t?C("booking.searchBar.placeholder.doctor"):"service"===t?C("booking.searchBar.placeholder.service"):"hospital"===t?C("booking.searchBar.placeholder.hospital"):"specialty"===t?C("booking.searchBar.placeholder.specialty"):""),[t,C]),T=(0,o.useMemo)((()=>({root:{flex:1,"&.hide-specialty-selection":{".mantine-Input-rightSection":{display:"none"},input:{paddingLeft:j?48:16,[E.fn.smallerThan("sm")]:{height:40,fontSize:(0,d.D)(14)}},".mantine-Input-icon":{left:"0"}}}})),[j,E]),$=(0,o.useMemo)((()=>({icon:{left:"205px"},input:{color:"#262626",'&[data-with-icon="true"]':{paddingLeft:"245px",paddingRight:"16px"}},rightSection:{left:0,width:"205px",padding:"1px"}})),[]),R=(0,o.useMemo)((()=>({input:{color:"#262626"}})),[]);(0,P.a)(O,(()=>{!a&&v({type:oe.ClickOutsideInputSearch})}));const D=(0,o.useCallback)((function(a){v({type:oe.ChangeInputSearch,payload:a}),"function"!==typeof m&&(a.trim().length>te[e.locale]||r||0===a.trim().length)&&c(a.trim(),e,t,b)}),[v,e,t,r,c,b,m]),A=(0,o.useCallback)((function(e){var t;v({type:oe.SelectSpecialty,payload:e}),null===w||void 0===w||w(e),!a&&(null===(t=k.current)||void 0===t||t.focus())}),[v,w]),F=(0,o.useCallback)((e=>{"Enter"===e.key&&(e.stopPropagation(),e.preventDefault(),y&&y())}),[y]);return i().createElement(le,{ref:O},"specialty"===t?i().createElement(u.p.Wrapper,{styles:T},i().createElement(u.p,{ref:k,icon:j&&i().createElement(n.A,null),size:a?"md":"lg",placeholder:I,styles:R,value:e.searchKeywords,onFocus:()=>v({type:oe.FocusInputSearchSpecialty}),onChange:e=>{D(e.target.value)},onKeyDown:F})):i().createElement(i().Fragment,null,"service"===t?i().createElement(u.p.Wrapper,{styles:T},i().createElement(u.p,{ref:k,icon:j&&i().createElement(n.A,null),size:a?"md":"lg",name:"search-results",placeholder:I,onFocus:()=>{v({type:oe.FocusInputSearch}),null===f||void 0===f||f()},value:e.searchKeywords,onChange:e=>{D(e.target.value)},onKeyDown:F})):i().createElement(i().Fragment,null,a&&!g?i().createElement(i().Fragment,null,!x&&i().createElement(xe,{state:e,isMobile:a,dispatch:v,debouncedFetchSearchResults:c,onSpecialtyClick:A}),i().createElement(u.p.Wrapper,{styles:T},i().createElement(u.p,{ref:k,icon:j&&i().createElement(n.A,null),size:"md",placeholder:I,value:e.searchKeywords,name:"search-results",onFocus:()=>{v({type:oe.FocusInputSearch}),null===f||void 0===f||f()},onChange:e=>{D(e.target.value)},onKeyDown:F}))):i().createElement(u.p.Wrapper,{styles:T,className:g?"hide-specialty-selection":""},i().createElement(u.p,Object.assign({ref:k,icon:j&&i().createElement(n.A,null),size:"lg",placeholder:I,styles:$,name:"search-results",autoComplete:"off",value:e.searchKeywords,onChange:e=>{D(e.target.value)},onFocus:()=>{v({type:oe.FocusInputSearch}),null===f||void 0===f||f()},onKeyDown:F},L,{rightSection:g?i().createElement(i().Fragment,null):!x&&i().createElement(xe,{state:e,isMobile:a,dispatch:v,debouncedFetchSearchResults:c,onSpecialtyClick:A})})))),!a&&i().createElement(re,null,i().createElement(ue,{type:t,state:e,dispatch:v,isLoading:l,typeInformation:s,clientSlug:b}))))}));we.displayName="SearchInputs";const Se=e=>{var{searchInputEle:t,closeModal:a,children:o}=e,n=(0,B._)(e,["searchInputEle","closeModal","children"]);const l=(0,p.xd)();return i().createElement(V.M,Object.assign({},n,{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"}}}),i().createElement(h.B,{spacing:16,sx:{paddingTop:16}},i().createElement(g.s,{align:"center",gap:12},i().createElement(q,{size:28,onClick:a,color:l.fn.primaryColor()}),i().createElement(b.a,{sx:{width:"100%"}},t)),o))},Ce=w.A.div` position: relative; ${C.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } `;w.A.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${S.w.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${C.M.mbDown} { width: calc(100% + 64px); left: -32px; } `;const Ee=w.A.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: ${S.w.colors.neutral100}; } &:not([data-is-denied='true']):hover { background-color: ${S.w.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; } `,Oe=(0,w.A)(L)` width: 12px; height: 18px; flex: 0 0 12px; `,ke=(0,o.forwardRef)(((e,t)=>{var{label:a,value:o}=e,n=(0,B._)(e,["label","value"]);return i().createElement("div",Object.assign({ref:t},n),i().createElement(Ee,{key:o,role:"button",tabIndex:0,"aria-label":`Select ${a} as location`,className:"location-item"},i().createElement(Oe,{color:S.w.colors.neutral400}),i().createElement(s.E,{size:"md"},a)))})),je=({state:e,debouncedFetchCitiesByKeyword:t,selectedLocation:a,trackingAttributes:n,onLocationClick:l,dispatch:r})=>{var s;const{t:p,locale:u}=(0,M.u)(),h=(0,o.useRef)(null),g=(0,o.useMemo)((()=>{var t;return[{name:p("booking.searchBar.allLocations"),id:A.I,slug:null===(t=A.L[u])||void 0===t?void 0:t.ALL},...e.cities]}),[e.cities,p,u]),b=(0,o.useMemo)((()=>n?{"data-event-category":n.dataEventCategory,"data-event-action":n.dataEventAction,"data-event-label":n.dataEventLabel}:{}),[n]),m=(0,o.useCallback)((function(a){r({type:oe.ChangeInputLocation,payload:a}),a.trim().length>te[e.locale]?t(a.trim()):(t.cancel(),r({type:oe.DisplayInitialCities}))}),[t,r,e.locale]);(0,P.a)(h,(()=>{r({type:oe.ClickOutsideInputLocation})}));const f=null!==(s=null===a||void 0===a?void 0:a.id)&&void 0!==s?s:null,y=null===f?void 0:String(f);return i().createElement(Ce,{ref:h},i().createElement(c.l6,Object.assign({key:null!==y&&void 0!==y?y:"no-selected-location",defaultValue:y,placeholder:p("booking.searchBar.allLocations"),searchable:!0,onSearchChange:e=>{m(e)},onFocus:()=>{r({type:oe.DisplayInitialCities})},onDropdownClose:()=>{t.cancel(),r({type:oe.DisplayInitialCities})},nothingFound:p("common.noResult"),maxDropdownHeight:340,dropdownPosition:"bottom",data:g.map((e=>({value:String(e.id),label:e.name,city:e}))),rightSection:i().createElement(i().Fragment,null)},b,{styles:e=>({item:{padding:0,"&[data-selected]":{"&, &:hover":{backgroundColor:"transparent",color:"inherit"},".location-item":{"&::after":{content:T,top:"50%",right:19,position:"absolute",transform:"translateY(-50%)"}}},"&[data-hovered]":{backgroundColor:"transparent"}},input:{"&:not(.mantine-Textarea-input)":{height:48,fontSize:(0,d.D)(16),paddingLeft:16,paddingRight:16,[e.fn.smallerThan("sm")]:{height:40,fontSize:(0,d.D)(14),paddingLeft:14,paddingRight:14}}},itemsWrapper:{padding:0},dropdown:{left:"0 !important",border:0,marginTop:-7,borderRadius:0,"& ::-webkit-scrollbar":{width:"6px",height:"6px"}}}),itemComponent:ke,filter:()=>!0,onChange:e=>{if(null==e)return;const a=g.find((t=>String(t.id)===e));a&&(l(a),t.cancel(),r({type:oe.DisplayInitialCities}),setTimeout((()=>{var e,t;null===(t=null===(e=h.current)||void 0===e?void 0:e.querySelector("input"))||void 0===t||t.blur()}),0))}})))},Le=w.A.div` display: flex; flex-wrap: wrap; row-gap: 8px; column-gap: 20px; ${C.M.mbDown} { margin-top: 12px; } `,Ie=w.A.div` display: flex; align-items: center; border-radius: 8px; border: 1px solid ${S.w.colors.neutral100}; background: ${S.w.colors.white}; padding: 8px 12px 8px 8px; flex: 0 0 calc(33.3% - 13px); gap: 12px; cursor: pointer; &:hover { background: ${S.w.colors.blue50}; } ${C.M.tdDown} { flex: 0 0 calc(50% - 10px); } ${C.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: ${S.w.colors.gray800}; font-size: 14px; font-style: normal; font-weight: 400; line-height: 22px; } .description { color: ${S.w.colors.gray600}; font-size: 12px; font-weight: 400; line-height: 18px; } } `,Te=(0,w.A)(m.c)` margin: 24px 0 !important; `,$e=w.A.div` display: flex; justify-content: center; margin-top: 24px; .show-more { border-radius: 4px; border: 1px solid ${S.w.colors.neutral200}; padding: 12px 16px; cursor: pointer; display: inline-block; color: ${S.w.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; ${C.M.mbDown} { width: 100%; text-align: center; } } `,Pe=({state:e,isMobile:t,specialties:a,isLoading:n,dispatch:r})=>{const{t:s,locale:c}=(0,M.u)(),{selectedLocation:d}=e,p=(0,o.useMemo)((()=>A.L[c]),[c]),u=(0,o.useMemo)((()=>a.length>=9||e.searchKeywords.trim().length<=te[e.locale]),[e.searchKeywords,a]);return i().createElement(i().Fragment,null,!t&&i().createElement(Te,{color:"#E4E8EC"}),i().createElement(Le,null,a.length>0&&!n&&i().createElement(i().Fragment,null,a.map(((e,t)=>t>=9?i().createElement(i().Fragment,null):i().createElement(Ie,{key:e.id,onClick:()=>(e=>{let t="";e===A.S?(t=`/${d.slug}/${p.HOSPITAL}/${A.C.GSK}/`,r({type:oe.ClickOutsideInputSearchSpecialty})):t=`/${d.slug}/${p.DOCTOR}/${e}`,r({type:oe.NavigateTo,payload:t})})(e.slug)},i().createElement("div",{className:"image-item"},i().createElement("img",{src:e.thumbnail,alt:e.name})),i().createElement("div",{className:"infor"},i().createElement("div",{className:"title"},e.name)))))),0===a.length&&!n&&i().createElement(N.T,{size:"sm",color:S.w.colors.gray400},s("booking.searchBar.noResults")),n&&Array(6).fill(void 0).map(((e,t)=>i().createElement(Ie,{key:"loading"+t},i().createElement("div",{className:"image-item"},i().createElement(l.E,{height:40,animate:!0})),i().createElement("div",{className:"infor"},i().createElement("div",{className:"title"},i().createElement(l.E,{height:20,radius:"sm",animate:!0}))))))),u&&i().createElement($e,null,i().createElement("div",{className:"show-more",onClick:()=>{const e=`/${p.SPECIALTIES}`;r({type:oe.NavigateTo,payload:e})}},s("home.seeAll"))))},Me=w.A.div` display: flex; gap: 5px; margin-top: 16px; flex-wrap: wrap; `,Re=w.A.div` color: ${S.w.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 12px; background: ${S.w.colors.white}; border-radius: 32px; cursor: pointer; border: 1px solid ${S.w.colors.white}; margin-bottom: 5px; border-color: ${S.w.colors.neutral100}; background: #f7f9fc; &.view-all { border-radius: 32px; border-color: ${S.w.colors.blue50}; background: ${S.w.colors.blue50}; color: ${S.w.colors.blue600}; &:hover { border-color: ${S.w.colors.blue50}; background: ${S.w.colors.blue50}; color: ${S.w.colors.blue600}; } } &:hover { border-color: ${S.w.colors.neutral100}; background: #f7f9fc; } `,De=w.A.div` color: ${S.w.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 0; background: ${S.w.colors.white}; border-radius: 32px; border: 1px solid ${S.w.colors.white}; margin-bottom: 5px; margin-right: 7px; `,Ae=({state:e,type:t,typeInformation:a,dispatch:n})=>{const{t:l}=(0,M.u)(),{selectedLocation:r}=e,s=(0,o.useMemo)((()=>a[t].slug),[a,t]);return i().createElement(Me,null,i().createElement(De,null,l("booking.searchBar.popularKey")),e.popularKeys.map((e=>i().createElement(Re,{key:e.id,onClick:()=>{var t;(t=e).url&&(window.location.href=t.url)}},e.keyword))),i().createElement(Re,{className:"view-all",onClick:()=>{const e=`/${r.slug}/${s}`;e&&n({type:oe.NavigateTo,payload:e})}},l("booking.searchBar.viewAll")))},Fe=w.A.div` background: rgba(255, 255, 255, 0.64); backdrop-filter: blur(12px); border-bottom: 1px solid ${S.w.colors.neutral100}; `,Ne=(0,w.A)(F.C)` padding: 0 16px; `,Ke=({currentTab:e,hideTabBookingSearch:t=[],hideSpecialtyTab:a,isMobile:n,setCurrentTab:l})=>{const{t:r}=(0,M.u)(),s=(0,o.useMemo)((()=>({root:{overflowY:n?"hidden":"initial",overflowX:n?"auto":"initial"},tabsList:{background:"rgba(255, 255, 255, 0)",borderBottom:"none",flexWrap:"nowrap",".mantine-Tabs-tab":{"&:last-child":{"&:after":{display:"none"}}}},tab:{padding:n?"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:n?"14px":"16px",fontWeight:600,lineHeight:n?"22px":"24px"}})),[n]),c=(0,o.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]),d=(0,o.useMemo)((()=>c.filter((e=>!t.includes(e.value)))||[]),[t,c]);return i().createElement(Fe,{className:"booking-search-tab"},i().createElement(Ne,null,i().createElement(f.t,{value:e,onTabChange:e=>{l(e)},styles:s},i().createElement(f.t.List,null,d.map((e=>i().createElement(f.t.Tab,{value:e.value,key:e.value},e.label)))))))};var Be;!function(e){e.doctor="doctor",e.service="hospital_service",e.hospital="hospital_branch"}(Be||(Be={}));const ze=e=>e.filter((e=>"string"===typeof e?"cacar-api"!==e:232!==(null===e||void 0===e?void 0:e.id)));const _e=({isMobile:e,careApiDomain:t,geoLocationPermission:a,geoLocationCoordinates:l,initialSelectedCity:r,initialSearchValue:s="",initTypeSearch:c="hospital",initSpecialty:d,careFrontDomain:p="/care",isDebug:u=!1,gaTrackingSearchBar:h,gaTrackingLocationSearch:m,autoCompleteDisabled:f=!1,inputSearchPlaceholder:w="",hideTabBookingSearch:S=[],hideSpecialtySelection:C=!1,hideSpecialtyTab:E=!1,hidePopularSearchKeys:O=!1,clientSlug:k="",triggerSearchWhenChangeFilter:j,routerPush:L,onGeoLocationPermissionChange:I,onChangeLocation:T})=>{var R;const{locale:F,t:N}=(0,M.u)(),K=(0,o.useRef)(null),B=(0,o.useRef)(null),z=(0,o.useRef)(null),_=(0,o.useRef)(null),[q,V]=(0,o.useState)(c),{geoLocationPermission:ie,geoLocationCoordinates:le}=function(){const[e,t]=(0,o.useState)((()=>{if("undefined"===typeof window)return"unset";if((0,x.Ri)(v.U))return"granted";const e=!location.protocol.includes("https")&&"localhost"!==location.hostname;return!navigator.geolocation||e?"denied":"unset"})),[a,i]=(0,o.useState)((()=>{if("undefined"===typeof window)return null;const e=(0,x.Ri)(v.U);if(e)try{return JSON.parse(e)}catch(t){console.log(t)}return null})),n=(0,o.useCallback)((function(){navigator.geolocation&&navigator.geolocation.getCurrentPosition((e=>{const a={lat:""+Math.round(1e7*e.coords.latitude)/1e7,lng:""+Math.round(1e7*e.coords.longitude)/1e7};(0,x.TV)(v.U,JSON.stringify(a),{minutes:15}),i(a),t("granted")}),(()=>{(0,x.Yj)(v.U),t("denied")}))}),[]);return(0,o.useMemo)((()=>({geoLocationPermission:e,geoLocationCoordinates:a,requestGeoLocation:n})),[e,a])}(),[re,se]=(0,o.useReducer)(ne,ae,(t=>Object.assign(Object.assign({},t),{isDebug:u,isMobile:e,geoLocationPermission:a||ie||"unset",geoLocationCoordinates:l||le||null,searchKeywords:s,initialSelectedCity:r||null,selectedLocation:r||t.selectedLocation||null,searchLocationKeywords:(null===r||void 0===r?void 0:r.name)||t.searchLocationKeywords,autoCompleteDisabled:f,inputSearchPlaceholder:w,locale:F}))),{navigateTo:ce,focusedSpecialty:de,searchKeywords:pe,geoLocationPermission:he,selectedLocation:ge,initialSelectedCity:ve,searchResults:xe,isLoadingSearchResults:Ce}=re,{fetchCitiesByLocation:Ee,fetchCitiesByKeyword:Oe,fetchSearchResults:ke,fetchAllSpecialties:Le,fetchPopularKeys:Ie}=function({dispatch:e,careApiDomain:t,locale:a="vi-VN",client:i=""}){const n=(0,o.useCallback)((function(o,i={}){const n=`${t}${o}`;return e({type:oe.FetchCitiesStart}),fetch($(n,i,a),{method:"GET"}).then((e=>e.json())).then((e=>1===e._status&&e._data?null===e||void 0===e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e)))).finally((()=>e({type:oe.FetchCitiesFinish})))}),[a]);return{fetchCitiesByLocation:(0,o.useCallback)((function({coordinates:t}){let o={};const l={};t&&(o={lat:t.lat,lng:t.lng}),"ms-MY"===a&&(l.noPaging=1);const r=[n(H,Object.assign(Object.assign(Object.assign({},o),l),{hospitalActive:1,client:A.C.MSD===i?"":i}))];return"zh-TW"===a?r.push(n(W,{noPaging:1,hospitalActive:1,client:A.C.MSD===i?"":i})):r.push(n(W,{noPaging:1,hospitalActive:1})),Promise.all(r).then((([t,a])=>{const o=Object.assign({},t);if(a){const e=o.cities.map((e=>e.id));o.cities=o.cities.concat(a.cities.filter((t=>!e.includes(t.id))))}e({type:oe.FetchCitiesByGeoIpComplete,payload:o})})).catch((e=>console.error("error loading cities by location",e)))}),[a,t,e]),fetchCitiesByKeyword:(0,o.useCallback)((function(t){return n(W,{keyword:t,client:i}).then((t=>{e({type:oe.FetchCitiesByKeywordComplete,payload:t.cities})})).catch((e=>console.error("error loading cities by keyword",e)))}),[a,t,e]),fetchSearchResults:(0,o.useCallback)((function(o,n,l,r,s){const c="specialty"===l?`${t}${U}`:`${t}${G}`;e({type:oe.FetchSearchResultsStart});const{selectedLocation:d,geoLocationCoordinates:p,selectedSpecialty:u}=n;let h="";if(!d)return void e({type:oe.FetchSearchResultsFinish});h=d.id===A.I?"":d.id;const g=(null===p||void 0===p?void 0:p.lat)||"",b=(null===p||void 0===p?void 0:p.lng)||"",m=(null===u||void 0===u?void 0:u.id)>0?null===u||void 0===u?void 0:u.id:"",f=o.trim().length>te[a]?o.trim():"";return fetch($(c,Object.assign({domain:t,searchType:l||"global",keyword:f,city:h===A.a?"":h,lat:g,lng:b,specialty_id:m,client_slug:A.C.MSD===r?"":r,msd:A.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?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:ze((null===e||void 0===e?void 0:e.specialties)||[])}))):t.searches),"specialty"===l&&(a=ze(f?(null===t||void 0===t?void 0:t.specialties)||[]:(null===t||void 0===t?void 0:t.default)||[])),e({type:oe.FetchSearchResultsComplete,payload:{key:l,searches:a||[]}}),s&&e({type:oe.UpdateInitialSearchResults,payload:{key:l,searches:a||[]}})})).catch((e=>{console.log("error loading search results",{url:c,error:e})})).finally((()=>e({type:oe.FetchSearchResultsFinish})))}),[a,t,e]),fetchAllSpecialties:(0,o.useCallback)((function(){const o=`${t}${U}`;return fetch($(o,{domain:t,searchType:"",msd:A.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?void 0:e._data:Promise.reject(e))).then((t=>{e({type:oe.FetchAllSpecialties,payload:ze(t.specialties||[])})})).catch((e=>{console.log("error loading search results",{url:o,error:e})}))}),[a,t,e]),fetchPopularKeys:(0,o.useCallback)((function(o){const i=`${t}${Q}`;return fetch($(i,{domain:t,searchType:Be[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?void 0:e._data:Promise.reject(e))).then((t=>{e({type:oe.FetchPopularKeys,payload:t.popular_searches||[]})})).catch((e=>{console.log("error loading search results",{url:i,error:e})}))}),[a,t,e])}}({dispatch:se,locale:F,careApiDomain:t,client:k}),Te=(0,o.useMemo)((()=>A.L[F]),[F]),[$e,{close:Me,open:Re}]=(0,y.j)(!1),De=(0,o.useMemo)((()=>Object.assign({doctor:{name:N("booking.searchPopup.doctors"),icon:i().createElement(be,null),slug:Te.DOCTOR},service:{name:N("booking.searchPopup.services"),icon:i().createElement(me,null),slug:Te.SERVICE},hospital:{name:N("booking.searchPopup.hospitals"),icon:i().createElement(fe,null),slug:Te.HOSPITAL}},!E&&{specialty:{name:N("booking.searchPopup.specialties"),icon:i().createElement(ye,null),slug:Te.SPECIALTIES}})),[q]),Fe=(0,o.useMemo)((()=>D()(Oe,400)),[Oe]),Ne=(0,o.useMemo)((()=>D()(ke,400)),[ke]),_e=(0,o.useCallback)((function({locationSlug:e,specialtyId:t}={}){var a;Me();let o="";const{slug:i}=De[q];let n="";const l=A.M[F][k],r=t||(null===(a=re.selectedSpecialty)||void 0===a?void 0:a.id)||-1,s=e||(null===ge||void 0===ge?void 0:ge.slug)||"";("doctor"===q||"hospital"===q)&&r>0&&(n=`&specialtyId=${r}`),o="specialty"===q?`/${i}`:`/${s}/${i}`,l&&(o+=`/${l}`),o+=`?q=${pe}${n}`,o&&se({type:oe.NavigateTo,payload:o})}),[k,Me,q,se,F,pe,null===ge||void 0===ge?void 0:ge.slug,null===(R=re.selectedSpecialty)||void 0===R?void 0:R.id,De]),qe=(0,o.useCallback)((function(e){j&&_e({locationSlug:e.slug}),se({type:oe.SelectLocation,payload:e}),T&&T(e)}),[se,e,T,_e,j]);(0,P.a)(_,(()=>{!e&&se({type:oe.ClickOutsideInputSearchSpecialty})})),(0,o.useEffect)((()=>{var t;"denied"===he||ve||se({type:oe.SelectLocation,payload:{name:N("booking.searchBar.allLocations"),id:A.I,slug:null===(t=A.L[F])||void 0===t?void 0:t.ALL}}),I&&I(he,re.geoLocationCoordinates),e&&"granted"===he&&ge&&se({type:oe.FocusInputSearch}),Ee({coordinates:re.geoLocationCoordinates})}),[he]),(0,o.useEffect)((()=>{var e;const t=d||{name:N("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:Te.SPECIALTIES};d?(null===(e=re.selectedSpecialty)||void 0===e?void 0:e.id)!==d.id&&se({type:oe.SelectSpecialty,payload:d}):re.selectedSpecialty&&re.selectedSpecialty.id===t.id||se({type:oe.SelectSpecialty,payload:t})}),[d,Te.SPECIALTIES,N]),(0,o.useEffect)((()=>{Le()}),[]),(0,o.useEffect)((()=>{Ie(q)}),[q]),(0,o.useEffect)((()=>{ce&&(L?L(ce):window.location.href=`${p}${ce}`)}),[ce]),(0,o.useEffect)((()=>{ke(re.searchKeywords,re,q,k,!0)}),[q]),(0,o.useEffect)((()=>{if($e&&e){const e=setTimeout((()=>{var e;null===(e=z.current)||void 0===e||e.focus()}),150);return()=>clearTimeout(e)}}),[$e,e]);const Ve={type:q,isMobile:e,state:re,dispatch:se,debouncedFetchSearchResults:Ne,initalSearchValue:s,onEnterSearch:_e,typeInformation:De,trackingAttributes:h,isLoading:Ce,hideSpecialtySelection:C||E,clientSlug:k,triggerSearchWhenChangeFilter:j,onChangeSpecialty:e=>j&&_e({specialtyId:e.id})};return i().createElement(i().Fragment,null,i().createElement(Z,{ref:K},i().createElement(Ke,{currentTab:q,setCurrentTab:V,isMobile:e,hideTabBookingSearch:S,hideSpecialtyTab:E}),i().createElement(J,{className:"booking-search-container"},i().createElement(X,null,i().createElement(ee,{className:"booking-search-content"},i().createElement("div",{ref:_},i().createElement(g.s,{gap:"12px",justify:"space-between",align:"center",direction:e?"column":"row",className:"flex-search-input"},"specialty"!==q&&i().createElement(je,{state:re,isMobile:e,dispatch:se,debouncedFetchCitiesByKeyword:Fe,selectedLocation:ge,onLocationClick:qe,trackingAttributes:m}),i().createElement(we,Object.assign({},Ve,{ref:B,onFocusInput:()=>e&&Re()})),i().createElement(Y.B,{size:e?"md":"lg",fullWidth:e,variant:"primary",onClick:()=>_e(),styles:{root:{height:e?"40px":"48px"}}},N("booking.searchBar.searchButton"))),!O&&"specialty"!==q&&re.popularKeys.length>0&&i().createElement(Ae,{type:q,state:re,typeInformation:De,dispatch:se}),"specialty"===q&&"search"===de&&i().createElement(Pe,{state:re,isMobile:e,dispatch:se,specialties:(null===xe||void 0===xe?void 0:xe.specialty)||[],isLoading:Ce})))))),e&&i().createElement(Se,{keepMounted:!0,opened:$e,onClose:Me,closeModal:Me,searchInputEle:i().createElement(g.s,{align:"center",gap:8},i().createElement(we,Object.assign({},Ve,{onlyShowSearchBox:!0,ref:z})),i().createElement(Y.B,{variant:"primary",leftIcon:i().createElement(n.A,{size:20,color:"#fff"}),onClick:()=>_e()}))},i().createElement(b.a,{sx:{marginLeft:-16,marginRight:-16}},i().createElement(ue,{type:q,state:re,dispatch:se,isLoading:Ce,typeInformation:De,clientSlug:k}))))}},26662:function(e,t,a){var o=a(73884),i=a.n(o),n=a(41303),l=function(e,t){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i{var{size:t,color:a=n.fT}=e,o=l(e,["size","color"]);const r=(0,n.D5)(t);return i().createElement("svg",Object.assign({width:r,height:r,viewBox:"0 0 24 24",fill:"none"},o),i().createElement("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.972 10.873a6.901 6.901 0 1 1 13.803 0 6.901 6.901 0 0 1-13.803 0M10.873 2a8.873 8.873 0 1 0 5.539 15.806l3.905 3.906a.986.986 0 0 0 1.394-1.395l-3.905-3.905A8.873 8.873 0 0 0 10.873 2",fill:a}))}},42060:function(e,t,a){a.d(t,{t:function(){return Ee}});var o=a(73884),i=a.n(o),n=a(86566),l=a(85618);const r="Tabs component was not found in the tree",s="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",[c,d]=(0,l.F)(r);var p=a(48085),u=a(50736),h=a(36950),g=Object.defineProperty,b=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,y=(e,t,a)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,v=(e,t)=>{for(var a in t||(t={}))m.call(t,a)&&y(e,a,t[a]);if(b)for(var a of b(t))f.call(t,a)&&y(e,a,t[a]);return e};function x({orientation:e,inverted:t,placement:a},o,i){const n="vertical"===e;return"default"===i?{[n?"left"===a?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${(0,p.D)(2)} solid ${"dark"===o.colorScheme?o.colors.dark[4]:o.colors.gray[3]}`}:"outline"===i?{[n?"left"===a?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${(0,p.D)(1)} solid ${"dark"===o.colorScheme?o.colors.dark[4]:o.colors.gray[3]}`}:"pills"===i?{gap:`calc(${o.spacing.sm} / 2)`}:{}}var w=(0,u.r)(((e,t,{variant:a})=>{const o="vertical"===t.orientation;return{tabsList:v({display:"flex",flexWrap:"wrap",flexDirection:o?"column":"row",justifyContent:h.H[t.position],'& [role="tab"]':{flex:t.grow?1:void 0}},x(t,e,a))}})),S=a(36814),C=Object.defineProperty,E=Object.defineProperties,O=Object.getOwnPropertyDescriptors,k=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,I=(e,t,a)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;const T={grow:!1,position:"left"},$=(0,o.forwardRef)(((e,t)=>{const a=(0,n.a1)("TabsList",T,e),{children:o,className:l,grow:r,position:s}=a,c=((e,t)=>{var a={};for(var o in e)j.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&k)for(var o of k(e))t.indexOf(o)<0&&L.call(e,o)&&(a[o]=e[o]);return a})(a,["children","className","grow","position"]),{orientation:p,variant:u,color:h,radius:g,inverted:b,placement:m,classNames:f,styles:y,unstyled:v}=d(),{classes:x,cx:C}=w({orientation:p,grow:r,color:h,position:s,radius:g,inverted:b,placement:m},{name:"Tabs",unstyled:v,classNames:f,styles:y,variant:u});return i().createElement(S.a,($=((e,t)=>{for(var a in t||(t={}))j.call(t,a)&&I(e,a,t[a]);if(k)for(var a of k(t))L.call(t,a)&&I(e,a,t[a]);return e})({},c),P={className:C(x.tabsList,l),ref:t,role:"tablist","aria-orientation":p},E($,O(P))),o);var $,P}));$.displayName="@mantine/core/TabsList";var P=a(55470),M=(0,u.r)(((e,{orientation:t})=>({panel:{flex:"vertical"===t?1:void 0}}))),R=Object.defineProperty,D=Object.defineProperties,A=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,B=(e,t,a)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;const z={},_=(0,o.forwardRef)(((e,t)=>{const a=(0,n.a1)("TabsPanel",z,e),{value:l,children:r,sx:s,className:c}=a,p=((e,t)=>{var a={};for(var o in e)N.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&F)for(var o of F(e))t.indexOf(o)<0&&K.call(e,o)&&(a[o]=e[o]);return a})(a,["value","children","sx","className"]),u=d(),{classes:h,cx:g}=M({orientation:u.orientation,color:u.color,radius:u.radius,inverted:u.inverted,placement:u.placement},{name:"Tabs",unstyled:u.unstyled,classNames:u.classNames,styles:u.styles,variant:u.variant}),b=u.getPanelId(l),m=u.value===l,f=u.keepMounted||m?r:null;return(0,o.useEffect)((()=>(u.setMountedPanelIds((e=>[...e,b])),u.setMountedPanelIds((e=>e.filter((e=>e!==b)))))),[b]),i().createElement(S.a,(y=((e,t)=>{for(var a in t||(t={}))N.call(t,a)&&B(e,a,t[a]);if(F)for(var a of F(t))K.call(t,a)&&B(e,a,t[a]);return e})({},p),v={ref:t,sx:[{display:m?void 0:"none"},...(0,P.n)(s)],className:g(h.panel,c),role:"tabpanel",id:b,"aria-labelledby":u.getTabId(l)},D(y,A(v))),f);var y,v}));_.displayName="@mantine/core/TabsPanel";var q=a(54363),V=Object.defineProperty,W=Object.defineProperties,G=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,Y=(e,t,a)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,Z=(e,t)=>{for(var a in t||(t={}))U.call(t,a)&&Y(e,a,t[a]);if(H)for(var a of H(t))Q.call(t,a)&&Y(e,a,t[a]);return e},J=(e,t)=>W(e,G(t));function X(e,{orientation:t,color:a,radius:o,inverted:i,placement:n},l){const r="vertical"===t,s=e.fn.variant({color:a,variant:"filled"}),c=(0,p.D)(e.fn.radius(o)),d="vertical"===t?"left"===n?`${c} 0 0 ${c}`:` 0 ${c} ${c} 0`:i?`0 0 ${c} ${c}`:`${c} ${c} 0 0`;return"default"===l?J(Z({[r?"left"===n?"borderRight":"borderLeft":i?"borderTop":"borderBottom"]:`${(0,p.D)(2)} solid transparent`,[r?"left"===n?"marginRight":"marginLeft":i?"marginTop":"marginBottom"]:(0,p.D)(-2),borderRadius:d},e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.colors.gray[0],borderColor:"dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[3]})),{"&[data-active]":Z({borderColor:s.background,color:"dark"===e.colorScheme?e.white:e.black},e.fn.hover({borderColor:s.background}))}):"outline"===l?{borderRadius:d,border:`${(0,p.D)(1)} solid transparent`,[r?"left"===n?"borderRight":"borderLeft":i?"borderTop":"borderBottom"]:"none","&[data-active]":{borderColor:"dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[3],"&::before":{content:'""',backgroundColor:"dark"===e.colorScheme?e.colors.dark[7]:e.white,position:"absolute",bottom:r?0:i?"unset":(0,p.D)(-1),top:r?0:i?(0,p.D)(-1):"unset",[r?"width":"height"]:(0,p.D)(1),right:r?"left"===n?(0,p.D)(-1):"unset":0,left:r?"left"===n?"unset":(0,p.D)(-1):0}}}:"pills"===l?J(Z({borderRadius:e.fn.radius(o)},e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.colors.gray[0]})),{"&[data-active]":Z({backgroundColor:s.background,color:e.white},e.fn.hover({backgroundColor:s.background}))}):{}}var ee=(0,u.r)(((e,t,{variant:a})=>({tabLabel:{},tab:Z({position:"relative",padding:`${e.spacing.xs} ${e.spacing.md}`,paddingLeft:t.withIcon?e.spacing.xs:void 0,paddingRight:t.withRightSection?e.spacing.xs:void 0,fontSize:e.fontSizes.sm,whiteSpace:"nowrap",zIndex:0,display:"flex",alignItems:"center",justifyContent:"horizontal"===t.orientation?"center":void 0,lineHeight:1,"&:disabled":Z({opacity:.5,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),"&:focus":{zIndex:1}},X(e,t,a)),tabRightSection:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginLeft:(0,p.D)(7)}},tabIcon:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginRight:(0,p.D)(7)}}}))),te=a(42990),ae=Object.defineProperty,oe=Object.defineProperties,ie=Object.getOwnPropertyDescriptors,ne=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,se=(e,t,a)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;const ce={},de=(0,o.forwardRef)(((e,t)=>{const a=(0,n.a1)("TabsTab",ce,e),{value:o,children:l,onKeyDown:r,onClick:s,className:c,icon:p,rightSection:u,color:h}=a,g=((e,t)=>{var a={};for(var o in e)le.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&ne)for(var o of ne(e))t.indexOf(o)<0&&re.call(e,o)&&(a[o]=e[o]);return a})(a,["value","children","onKeyDown","onClick","className","icon","rightSection","color"]),b=d(),m=!!p,f=!!u,{theme:y,classes:v,cx:x}=ee({withIcon:m||f&&!l,withRightSection:f||m&&!l,orientation:b.orientation,color:h||b.color,radius:b.radius,inverted:b.inverted,placement:b.placement},{name:"Tabs",unstyled:b.unstyled,classNames:b.classNames,styles:b.styles,variant:b.variant}),w=o===b.value,S=b.getPanelId(o),C=b.mountedPanelIds.includes(o)?S:void 0;return i().createElement(te.N,(E=((e,t)=>{for(var a in t||(t={}))le.call(t,a)&&se(e,a,t[a]);if(ne)for(var a of ne(t))re.call(t,a)&&se(e,a,t[a]);return e})({},g),O={unstyled:b.unstyled,className:x(v.tab,c),"data-active":w||void 0,ref:t,type:"button",role:"tab",id:b.getTabId(o),"aria-selected":w,tabIndex:w||null===b.value?0:-1,"aria-controls":C,onClick:e=>{b.onTabChange(b.allowTabDeactivation&&o===b.value?null:o),null==s||s(e)},onKeyDown:(0,q.Y)({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:b.activateTabWithKeyboard,loop:b.loop,dir:y.dir,orientation:b.orientation,onKeyDown:r})},oe(E,ie(O))),p&&i().createElement("span",{className:v.tabIcon},p),l&&i().createElement("span",{className:v.tabLabel},l),u&&i().createElement("span",{className:v.tabRightSection},u));var E,O}));de.displayName="@mantine/core/Tab";var pe=a(25850),ue=a(27878),he=a(19203);function ge({defaultValue:e,value:t,onTabChange:a,orientation:n,children:l,loop:r,id:d,activateTabWithKeyboard:p,allowTabDeactivation:u,variant:h,color:g,radius:b,inverted:m,placement:f,keepMounted:y=!0,classNames:v,styles:x,unstyled:w}){const S=(0,ue.B)(d),[C,E]=(0,o.useState)([]),[O,k]=(0,he.Z)({value:t,defaultValue:e,finalValue:null,onChange:a});return i().createElement(c,{value:{placement:f,value:O,orientation:n,id:S,loop:r,activateTabWithKeyboard:p,getTabId:(0,pe.r)(`${S}-tab`,s),getPanelId:(0,pe.r)(`${S}-panel`,s),onTabChange:k,setMountedPanelIds:E,mountedPanelIds:C,allowTabDeactivation:u,variant:h,color:g,radius:b,inverted:m,keepMounted:y,classNames:v,styles:x,unstyled:w}},l)}ge.displayName="@mantine/core/TabsProvider";var be=(0,u.r)(((e,{orientation:t,placement:a})=>({root:{display:"vertical"===t?"flex":void 0,flexDirection:"right"===a?"row-reverse":"row"}}))),me=Object.defineProperty,fe=Object.defineProperties,ye=Object.getOwnPropertyDescriptors,ve=Object.getOwnPropertySymbols,xe=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,Se=(e,t,a)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;const Ce={orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},Ee=(0,o.forwardRef)(((e,t)=>{const a=(0,n.a1)("Tabs",Ce,e),{defaultValue:o,value:l,orientation:r,loop:s,activateTabWithKeyboard:c,allowTabDeactivation:d,children:p,id:u,onTabChange:h,variant:g,color:b,className:m,unstyled:f,classNames:y,styles:v,radius:x,inverted:w,keepMounted:C,placement:E}=a,O=((e,t)=>{var a={};for(var o in e)xe.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&ve)for(var o of ve(e))t.indexOf(o)<0&&we.call(e,o)&&(a[o]=e[o]);return a})(a,["defaultValue","value","orientation","loop","activateTabWithKeyboard","allowTabDeactivation","children","id","onTabChange","variant","color","className","unstyled","classNames","styles","radius","inverted","keepMounted","placement"]),{classes:k,cx:j}=be({orientation:r,color:b,radius:x,inverted:w,placement:E},{unstyled:f,name:"Tabs",classNames:y,styles:v,variant:g});return i().createElement(ge,{activateTabWithKeyboard:c,defaultValue:o,orientation:r,onTabChange:h,value:l,id:u,loop:s,allowTabDeactivation:d,color:b,variant:g,radius:x,inverted:w,keepMounted:C,placement:E,classNames:y,styles:v,unstyled:f},i().createElement(S.a,(L=((e,t)=>{for(var a in t||(t={}))xe.call(t,a)&&Se(e,a,t[a]);if(ve)for(var a of ve(t))we.call(t,a)&&Se(e,a,t[a]);return e})({},O),I={className:j(k.root,m),id:u,ref:t},fe(L,ye(I))),p));var L,I}));Ee.List=$,Ee.Tab=de,Ee.Panel=_,Ee.displayName="@mantine/core/Tabs"}}]);