"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7884],{"/v//":function(e,t,a){a.d(t,{B:function(){return BookingSearchBarV3},T:function(){return TextDivider}});var l,n,r,o,i=a("q1tI"),c=a("6mQP"),s=a("0D4Z"),d=a("iuhU"),u=a("Eso5"),p=a("aDCK"),m=a("mYVa"),g=a("vaps"),h=a("8vDj"),f=a("OAL+"),b=a("SPK5"),C=a("TIp3"),y=a("CmzK"),E=a("NEaA"),v=a("rlLN"),x=a("Iblh"),w=a("xwny"),S=a("qU7X"),D=a("FUIV"),P=a("sEfC"),I=a.n(P),O=a("xuQY"),L=a("rBCA"),F=a("iBNF"),k=a("JIuZ"),_=a("HzgG"),M=a("pMur"),j=a("/ozO"),$=a("Kz+G"),T=a("A24R"),R=a("CFP3"),N=a("trqo"),B=a("VLju");let H=L.Z.div``,A=L.Z.div` background-color: ${F.r.colors.neutral50}; padding-bottom: 1px; ${k.M.mbDown} { padding: 0; } `,Z=(0,L.Z)(_.C)` padding: 0 16px; ${k.M.mbDown} { padding: 0; } `,z=L.Z.div` padding: 24px 56px; border-radius: 16px; background-color: ${F.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); ${k.M.mbDown} { padding: 16px; border-radius: 0; } .flex-search-input { flex-direction: row; ${k.M.mbDown} { flex-direction: column; } } `,V={"en-PH":3,"tl-PH":2,"id-ID":3,"vi-VN":2,"zh-TW":0,"ms-MY":2,"th-TH":2},U={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,l;switch(e.isDebug&&console.log("bookingSearchBarV3",{action:t,state:e}),t.type){case r.NavigateTo:return Object.assign(Object.assign({},e),{navigateTo:t.payload,focused:"none",isMobileModalOpened:!1});case r.ClickOutsideInputLocation:if("location"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case r.ClickOutsideInputSpecialty:if("specialty"!==e.focused)return e;return resetSearchLocationKeywords(Object.assign(Object.assign({},e),{focused:"none"}));case r.ClickOutsideInputSearch:if("search"!==e.focused)return e;return Object.assign(Object.assign({},e),{focused:"none"});case r.ClickOutsideInputSearchSpecialty:if("search"!==e.focusedSpecialty)return e;return Object.assign(Object.assign({},e),{focusedSpecialty:"none"});case r.FocusInputLocation:{let t=Object.assign(Object.assign({},e),{focused:"location"});return(null===(a=e.selectedLocation)||void 0===a?void 0:a.id)===O.a&&(t.searchLocationKeywords=""),t}case r.FocusInputSpecialty:{let t=Object.assign(Object.assign({},e),{focused:"specialty"});return(null===(l=e.selectedLocation)||void 0===l?void 0:l.id)===O.a&&(t.searchLocationKeywords=""),t}case r.FocusInputSearch:let n=Object.assign(Object.assign({},e),{focused:"search"});if(e.isMobile)return resetSearchLocationKeywords(n);return n;case r.FocusInputSearchSpecialty:{let t=Object.assign(Object.assign({},e),{focusedSpecialty:"search"});return t}case r.ChangeInputLocation:return Object.assign(Object.assign({},e),{searchLocationKeywords:t.payload});case r.ChangeInputSearch:{let a=t.payload;return Object.assign(Object.assign({},e),{searchKeywords:a,isLoadingSearchResults:a.trim().length>V[e.locale]})}case r.SelectCurrentLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name});case r.ClearInputLocation:return Object.assign(Object.assign({},e),{focused:"location",cities:e.initialCities,searchLocationKeywords:""});case r.ClearInputSearch:return Object.assign(Object.assign({},e),{focused:"search",searchKeywords:""});case r.SelectLocation:return Object.assign(Object.assign({},e),{focused:"none",selectedLocation:t.payload,searchLocationKeywords:t.payload.name,searchResults:{}});case r.SelectSpecialty:return Object.assign(Object.assign({},e),{focused:"none",selectedSpecialty:t.payload,searchResults:{}});case r.SelectSearchResult:return Object.assign(Object.assign({},e),{searchKeywords:t.payload.name,isMobileModalOpened:!1,focused:"none",navigateTo:t.payload.url});case r.FetchCitiesStart:return Object.assign(Object.assign({},e),{isLoadingCities:!0});case r.FetchCitiesFinish:return Object.assign(Object.assign({},e),{isLoadingCities:!1});case r.FetchSearchResultsStart:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!0});case r.FetchSearchResultsFinish:return Object.assign(Object.assign({},e),{isLoadingSearchResults:!1});case r.FetchSearchResultsComplete:{let a=Object.assign(Object.assign({},e),{searchResults:Object.assign(Object.assign({},e.searchResults),{[t.payload.key]:t.payload.searches})});return a}case r.FetchCitiesByGeoIpComplete:{let{cities:a}=t.payload,{default:l}=t.payload;a=a.filter(e=>e.id!==l.id),l&&a.unshift(l),e.initialSelectedCity&&!a.find(t=>t.id===e.initialSelectedCity.id)&&a.unshift(e.initialSelectedCity);let n=Object.assign(Object.assign({},e),{defaultCity:l,initialCities:a,cities:a});return"denied"!==e.geoLocationPermission||e.initialSelectedCity||(n.selectedLocation=l,n.searchLocationKeywords=l.name),n}case r.FetchCitiesByKeywordComplete:return Object.assign(Object.assign({},e),{cities:t.payload});case r.DisplayInitialCities:return Object.assign(Object.assign({},e),{cities:e.initialCities});case r.DisplayInitialSearchResults:{let t=e.searchKeywords.trim(),a=V[e.locale],l=t.length>0&&t.length<=a;return Object.assign(Object.assign({},e),{searchResults:l?{}:e.initialSearchResults,isLoadingSearchResults:!1})}case r.UpdateInitialSearchResults:return Object.assign(Object.assign({},e),{initialSearchResults:Object.assign(Object.assign({},e.initialSearchResults),{[t.payload.key]:t.payload.searches})});case r.GrantGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"granted",geoLocationCoordinates:t.payload});case r.DenyGeoLocationPermission:return Object.assign(Object.assign({},e),{geoLocationPermission:"denied",geoLocationCoordinates:null});case r.OpenMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!0});case r.CloseMobileModal:return Object.assign(Object.assign({},e),{isMobileModalOpened:!1});case r.UpdateInitialSearchValue:return Object.assign(Object.assign({},e),{searchKeywords:t.payload});case r.SetInputSearchPlaceholder:return Object.assign(Object.assign({},e),{inputSearchPlaceholder:t.payload});case r.FetchAllSpecialties:return Object.assign(Object.assign({},e),{allSpecialties:t.payload});case r.FetchPopularKeys:return Object.assign(Object.assign({},e),{popularKeys:t.payload});default:return e}}(l=r||(r={})).NavigateTo="navigate to url",l.ClickOutsideInputLocation="click outside input location",l.ClickOutsideInputSearch="click outside input search",l.ClickOutsideInputSearchSpecialty="click outside input search specialty",l.ClickOutsideInputSpecialty="click outside input specialty",l.SelectCurrentLocation="select current location",l.FocusInputLocation="focus input location",l.FocusInputSearch="focus input search",l.FocusInputSearchSpecialty="focus input search specialty",l.ChangeInputLocation="change input location",l.ChangeInputSearch="change input search",l.ClearInputLocation="clear input location",l.ClearInputSearch="clear input search",l.SelectLocation="select location",l.SelectSpecialty="select specialty",l.FetchCitiesStart="fetch cities start",l.FetchCitiesFinish="fetch cities finish",l.FetchSearchResultsStart="fetch search results start",l.FetchSearchResultsComplete="fetch search results complete",l.FetchSearchResultsFinish="fetch search results finish",l.FetchCitiesByGeoIpComplete="fetch cities by geo IP finish",l.FetchCitiesByKeywordComplete="fetch cities by keyword finish",l.DisplayInitialCities="display initial cities",l.DisplayInitialSearchResults="display initial search results",l.UpdateInitialSearchResults="update initial search results",l.GrantGeoLocationPermission="grant geolocation permission",l.DenyGeoLocationPermission="deny geolocation permission",l.OpenMobileModal="open mobile modal",l.CloseMobileModal="close mobile modal",l.UpdateInitialSearchValue="update initial search value",l.SelectSearchResult="select search result",l.SetInputSearchPlaceholder="set input search placeholder",l.FocusInputSpecialty="focus input specialty",l.FetchAllSpecialties="fetch all specialty",l.FetchPopularKeys="fetch popular key by type";let K=L.Z.div` flex: 1; position: relative; ${k.M.mbDown} { width: 100%; } `,q=L.Z.div` background: #f7f9fc; border-radius: 12px; height: 48px; display: flex; align-items: center; padding: 4px 12px 4px 4px; gap: 16px; ${k.M.mbDown} { height: 48px; width: 100%; } `,G=L.Z.div` display: flex; align-items: center; flex-shrink: 0; color: #8c8c8c; svg { width: 18px; height: 18px; } `,Y=L.Z.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${F.r.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${k.M.mbDown} { width: calc(100% + 64px); left: -32px; } `,W=L.Z.div``;L.Z.div` display: flex; justify-content: space-between; align-item: center; padding: 9px 14px 9px 22px; background: #f7f9fc; .title { color: ${F.r.colors.gray800}; font-size: 14px; font-weight: 600; line-height: 22px; } .btn-see-all { color: ${F.r.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `;let Q=L.Z.div` padding: 10px 16px; max-height: 400px; overflow: auto; `,X=L.Z.div` display: flex; gap: 12px; align-items: center; cursor: pointer; ${k.M.mbUp} { &:hover { background-color: ${F.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 ${F.r.colors.neutral100}; .title { color: ${F.r.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; } .description { overflow: hidden; color: ${F.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: ${F.r.colors.blue600}; font-size: 14px; line-height: 22px; cursor: pointer; } `;let SearchResult=({state:e,type:t,results:a,isLoading:l,typeInformation:n,dispatch:o})=>{let{t:c}=(0,D.u)(),{selectedLocation:u}=e,p=(0,i.useMemo)(()=>n[t].slug,[n,t]),handleOnClick=e=>{let a="";switch(t){case"service":a=`/${u.slug}/${p}/${e.slug}`;break;case"doctor":case"hospital":a=`/${p}/${e.slug}-${e.id}`}a&&o({type:r.NavigateTo,payload:a})};return null===a?null:i.createElement(W,null,i.createElement(Q,{className:"search-results__body"},l&&i.createElement("div",{className:"skeleton-result"},[,,,].fill(void 0).map((e,a)=>i.createElement(X,{key:t+"loading"+a,className:2===a?"last-item":""},i.createElement("div",{className:"image-item"},i.createElement(s.O,{height:48,circle:!0,mb:"xl",animate:!0})),i.createElement("div",{className:"infor"},i.createElement("div",{className:"title"},i.createElement(s.O,{height:8,mt:10,radius:"xl",animate:!0})),i.createElement("div",{className:"description"},i.createElement("div",{className:"sub-description"},i.createElement(s.O,{height:8,mt:10,radius:"xl",width:"80%",animate:!0}))))))),!l&&a&&a.length>0&&i.createElement(i.Fragment,null,a.map((e,l)=>{var r,o;let c=a.length>4&&3===l||a.length<=4&&l===a.length-1,s="";return("hospital"===t&&(s=(null==e?void 0:e.address)||""),"doctor"===t&&(s=(null===(r=null==e?void 0:e.specialties)||void 0===r?void 0:r.join(", "))||""),"service"===t&&(s=(null===(o=null==e?void 0:e.hospital_branch)||void 0===o?void 0:o.name)||""),l>=4)?i.createElement(i.Fragment,null):i.createElement(X,{key:e.id,className:(0,d.default)(c?"last-item":"","result-item"),onClick:()=>handleOnClick(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"},n[t].icon,i.createElement("div",{className:"sub-description"},s))))})),!l&&(null==a?void 0:a.length)===0&&i.createElement(M.T,{size:"sm",color:F.r.colors.gray400,className:"noresult-block"},c("booking.searchBar.noResults"))))},SearchResultContent=({state:e,type:t,isLoading:a,clientSlug:l,typeInformation:n,dispatch:r})=>{var o;return"search"!==e.focused?null:i.createElement(SearchResult,{type:t,state:e,results:(null===(o=e.searchResults)||void 0===o?void 0:o[t])||null,location:e.selectedLocation.name,dispatch:r,isLoading:a,typeInformation:n,clientSlug:l})},J=L.Z.div` position: relative; flex-shrink: 0; ${k.M.mbDown} { width: 100%; display: flex; flex-direction: column; gap: 12px; } &.compact { ${k.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: ${F.r.colors.gray800}; } &:hover { background-color: ${F.r.colors.neutral50}; } &.selected { background-color: ${F.r.colors.neutral50}; } &:last-child { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; } `,DoctorIcon=()=>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"})),ServiceIcon=()=>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"})),HospitalIcon=()=>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"})),SpecialtyIcon=()=>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"})),SearchSpecialty=({state:e,isMobile:t,onSpecialtyClick:a,dispatch:l,isCompact:n=!1})=>{let{t:o,locale:s}=(0,D.u)(),d=(0,i.useRef)(null),h=(0,i.useRef)(null),f=(0,i.useMemo)(()=>O.L[s],[s]),[b,C]=(0,i.useState)(""),[y,{close:E,toggle:v}]=(0,x.q)(!1);(0,S.a)(d,()=>{E(),C(""),l({type:r.ClickOutsideInputSpecialty})});let w=(0,i.useMemo)(()=>[{name:o("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:f.SPECIALTIES},...e.allSpecialties],[e.allSpecialties,o,f.SPECIALTIES]),P=(0,i.useMemo)(()=>b.trim()?w.filter(e=>e.name.toLowerCase().includes(b.toLowerCase().trim())):w,[w,b]),I=(0,i.useMemo)(()=>e.selectedSpecialty?e.selectedSpecialty.name:"",[e.selectedSpecialty]),L=(0,i.useCallback)(e=>{a({id:e.id,name:e.name,slug:e.slug,thumbnail:e.thumbnail||"",total_doctor:0}),E(),C("")},[a,E]),k=(0,i.useCallback)(()=>{v(),y&&C("")},[v,y]);return i.createElement(J,{ref:d,className:n?"compact":""},i.createElement(u.x,{onClick:k,className:y?"dropdown-trigger-open":"",sx:{cursor:"pointer",position:"relative",width:n?t?96:160:"100%",flexShrink:0}},i.createElement(p.I,{readOnly:!0,value:I,placeholder:o("booking.searchPopup.specialties"),rightSection:i.createElement(j.C,{style:{width:20,height:20}}),styles:Object.assign({input:{cursor:"pointer",outline:"none","&:focus":{outline:"none"},"&:not(.mantine-Textarea-input)":{height:n?40:t?40:46,fontSize:n?(0,m.h)(14):t?(0,m.h)(14):(0,m.h)(16),paddingLeft:n?12:16,paddingRight:30,background:n?"white":"transparent",border:n?`1px solid ${F.r.colors.gray200}`:"none",borderRadius:8,letterSpacing:"-0.2px",color:F.r.colors.gray800,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}},rightSection:{width:30,pointerEvents:"none"}},!n&&{wrapper:{position:"relative","&:after":{content:'""',width:"1px",height:"20px",backgroundColor:F.r.colors.neutral100,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)"}}})})),y&&i.createElement(ee,{className:t?"mobile":""},i.createElement(u.x,{sx:{padding:"12px 12px 8px"}},i.createElement(p.I,{ref:h,icon:i.createElement(c.Z,{size:18,color:F.r.colors.gray300}),placeholder:o("booking.searchBar.placeholder.specialty"),value:b,onChange:e=>C(e.target.value),size:"md",styles:{input:{height:40,fontSize:(0,m.h)(15),paddingLeft:36,"&::placeholder":{color:F.r.colors.gray400}},icon:{width:36}}})),i.createElement(g.x.Autosize,{mah:300},0===P.length?i.createElement(u.x,{sx:{padding:"12px 16px",color:F.r.colors.gray400,fontSize:14}},o("common.noResult")):P.map(t=>{var a,l;return i.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===(l=e.selectedSpecialty)||void 0===l?void 0:l.id)===t.id?"selected":"",onClick:()=>L(t),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),L(t))}},i.createElement("div",{className:"image-item"},t.thumbnail?i.createElement("img",{src:t.thumbnail,alt:t.name}):i.createElement(SpecialtyIcon,null)),i.createElement("span",{className:"item-label"},t.name))}))))},ea=(0,i.forwardRef)(({state:e,type:t,isMobile:a,isLoading:l,initalSearchValue:n,typeInformation:o,debouncedFetchSearchResults:s,trackingAttributes:d,hideSpecialtySelection:u=!1,clientSlug:g="",onSearch:h,onFocusInput:f,onEnterSearch:b,dispatch:C,onlyShowSearchBox:y,onChangeSpecialty:E},v)=>{let{t:x}=(0,D.u)(),w=(0,i.useRef)(null),P=(0,i.useRef)(null);(0,i.useImperativeHandle)(v,()=>({focus:()=>{var e;null===(e=P.current)||void 0===e||e.focus()}}));let I=(0,i.useMemo)(()=>d?{"data-event-category":d.dataEventCategory,"data-event-action":d.dataEventAction,"data-event-label":d.dataEventLabel}:{},[d]),O=(0,i.useMemo)(()=>"doctor"===t?x("booking.searchBar.placeholder.doctor"):"service"===t?x("booking.searchBar.placeholder.service"):"hospital"===t?x("booking.searchBar.placeholder.hospital"):"specialty"===t?x("booking.searchBar.placeholder.specialty"):"",[t,x]),L="specialty"!==t&&"service"!==t&&!u&&!y,k=(0,i.useMemo)(()=>({input:{border:"none",background:"transparent",height:"100%",fontSize:(0,m.h)(16),color:F.r.colors.gray800,padding:"0","&::placeholder":{color:F.r.colors.gray400},"&:focus":{outline:"none",boxShadow:"none"},[a?"@media (max-width: 767px)":""]:a?{fontSize:(0,m.h)(16)}:{}},wrapper:{flex:1}}),[a]);(0,S.a)(w,()=>{a||C({type:r.ClickOutsideInputSearch})});let _=(0,i.useCallback)(function(a){C({type:r.ChangeInputSearch,payload:a}),"function"!=typeof h&&(a.trim().length>V[e.locale]||n||0===a.trim().length)&&s(a.trim(),e,t,g)},[C,e,t,n,s,g,h]),M=(0,i.useCallback)(function(e){var t;C({type:r.SelectSpecialty,payload:e}),null==E||E(e),a||null===(t=P.current)||void 0===t||t.focus()},[C,E]),j=(0,i.useCallback)(e=>{"Enter"===e.key&&(e.stopPropagation(),e.preventDefault(),b&&b())},[b]);return i.createElement(K,{ref:w},i.createElement(q,null,L&&i.createElement(SearchSpecialty,{state:e,isMobile:a,dispatch:C,debouncedFetchSearchResults:s,onSpecialtyClick:M,isCompact:!0}),i.createElement(G,null,i.createElement(c.Z,null)),i.createElement(p.I,Object.assign({ref:P,variant:"unstyled",size:a?"md":"lg",placeholder:O,styles:k,value:e.searchKeywords,name:"search-results",autoComplete:"off",onFocus:()=>{C({type:r.FocusInputSearch}),null==f||f()},onChange:e=>{_(e.target.value)},onKeyDown:j},I))),!a&&"specialty"!==t&&i.createElement(Y,null,i.createElement(SearchResultContent,{type:t,state:e,dispatch:C,isLoading:l,typeInformation:o,clientSlug:g})))});ea.displayName="SearchInputs";let ModalSearchResult=e=>{var{searchInputEle:t,closeModal:a,children:l}=e,n=(0,$._)(e,["searchInputEle","closeModal","children"]);let r=(0,h.rZ)();return i.createElement(R.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(f.K,{spacing:16,sx:{paddingTop:16}},i.createElement(b.k,{align:"center",gap:12},i.createElement(T.Z,{size:28,onClick:a,color:r.fn.primaryColor()}),i.createElement(u.x,{sx:{width:"100%"}},t)),l))},el=L.Z.div` position: relative; width: 240px; flex-shrink: 0; ${k.M.mbDown} { width: 100%; } `;L.Z.div` position: absolute; top: calc(100% + 2px); width: 100%; border-radius: 4px; background: ${F.r.colors.white}; box-shadow: 0px 8px 40px 0px rgba(0, 0, 0, 0.1); z-index: 10; ${k.M.mbDown} { width: calc(100% + 64px); left: -32px; } `;let en=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: ${F.r.colors.neutral100}; } &:not([data-is-denied='true']):hover { background-color: ${F.r.colors.neutral50}; } &:last-child:hover { border-bottom-right-radius: 6px; border-bottom-left-radius: 6px; } &:first-child:hover { border-top-right-radius: 6px; border-top-left-radius: 6px; } &[data-is-denied='true'] { cursor: not-allowed; } `,er=(0,L.Z)(w.P)` width: 12px; height: 18px; flex: 0 0 12px; `,eo=(0,i.forwardRef)((e,t)=>{var{label:a,value:l}=e,n=(0,$._)(e,["label","value"]);return i.createElement("div",Object.assign({ref:t},n),i.createElement(en,{key:l,role:"button",tabIndex:0,"aria-label":`Select ${a} as location`,className:"location-item"},i.createElement(er,{color:F.r.colors.neutral400}),i.createElement(C.x,{size:"md"},a)))}),SearchLocation=({state:e,debouncedFetchCitiesByKeyword:t,selectedLocation:a,trackingAttributes:l,onLocationClick:n,dispatch:o})=>{var c;let{t:s,locale:d}=(0,D.u)(),u=(0,i.useRef)(null),p=(0,i.useMemo)(()=>{var t;return[{name:s("booking.searchBar.allLocations"),id:O.I,slug:null===(t=O.L[d])||void 0===t?void 0:t.ALL},...e.cities]},[e.cities,s,d]),g=(0,i.useMemo)(()=>l?{"data-event-category":l.dataEventCategory,"data-event-action":l.dataEventAction,"data-event-label":l.dataEventLabel}:{},[l]),h=(0,i.useCallback)(function(a){o({type:r.ChangeInputLocation,payload:a}),a.trim().length>V[e.locale]?t(a.trim()):(t.cancel(),o({type:r.DisplayInitialCities}))},[t,o,e.locale]);(0,S.a)(u,()=>{o({type:r.ClickOutsideInputLocation})});let f=null!==(c=null==a?void 0:a.id)&&void 0!==c?c:null,b=null===f?void 0:String(f);return i.createElement(el,{ref:u},i.createElement(y.Ph,Object.assign({key:null!=b?b:"no-selected-location",defaultValue:b,placeholder:s("booking.searchBar.allLocations"),searchable:!0,onSearchChange:e=>{h(e)},onFocus:()=>{o({type:r.DisplayInitialCities})},onDropdownClose:()=>{t.cancel(),o({type:r.DisplayInitialCities})},nothingFound:s("common.noResult"),maxDropdownHeight:340,dropdownPosition:"bottom",icon:i.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.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"}),i.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:i.createElement(j.C,{style:{width:20,height:20}})},g,{styles:()=>({item:{padding:0,"&[data-selected]":{"&, &:hover":{backgroundColor:"#F7F9FC",color:"inherit"},".location-item":{"&::after":{content:w.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,m.h)(15),fontWeight:400,letterSpacing:"-0.3px",color:F.r.colors.gray1000,paddingLeft:44,paddingRight:40,background:"white",border:`1px solid ${F.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:eo,filter:()=>!0,onChange:e=>{if(null==e)return;let a=p.find(t=>String(t.id)===e);a&&(n(a),t.cancel(),o({type:r.DisplayInitialCities}),setTimeout(()=>{var e,t;null===(t=null===(e=u.current)||void 0===e?void 0:e.querySelector("input"))||void 0===t||t.blur()},0))},data:p.map(e=>({value:String(e.id),label:e.name,city:e}))})))},ei=L.Z.div` display: flex; flex-wrap: wrap; row-gap: 8px; column-gap: 20px; ${k.M.mbDown} { margin-top: 12px; } `,ec=L.Z.div` display: flex; align-items: center; border-radius: 8px; border: 1px solid ${F.r.colors.neutral100}; background: ${F.r.colors.white}; padding: 8px 12px 8px 8px; flex: 0 0 calc(33.3% - 13px); gap: 12px; cursor: pointer; &:hover { background: ${F.r.colors.blue50}; } ${k.M.tdDown} { flex: 0 0 calc(50% - 10px); } ${k.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: ${F.r.colors.gray800}; font-size: 14px; font-style: normal; font-weight: 400; line-height: 22px; } .description { color: ${F.r.colors.gray600}; font-size: 12px; font-weight: 400; line-height: 18px; } } `,es=(0,L.Z)(E.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 ${F.r.colors.neutral200}; padding: 12px 16px; cursor: pointer; display: inline-block; color: ${F.r.colors.gray800}; font-size: 16px; font-weight: 600; line-height: 24px; ${k.M.mbDown} { width: 100%; text-align: center; } } `,SearchResultSpecialties=({state:e,isMobile:t,specialties:a,isLoading:l,dispatch:n})=>{let{t:o,locale:c}=(0,D.u)(),{selectedLocation:d}=e,u=(0,i.useMemo)(()=>O.L[c],[c]),handleOnClick=e=>{let t="";e===O.S?(t=`/${d.slug}/${u.HOSPITAL}/${O.C.GSK}/`,n({type:r.ClickOutsideInputSearchSpecialty})):t=`/${d.slug}/${u.DOCTOR}/${e}`,n({type:r.NavigateTo,payload:t})},p=(0,i.useMemo)(()=>a.length>=9||e.searchKeywords.trim().length<=V[e.locale],[e.searchKeywords,a]);return i.createElement(i.Fragment,null,!t&&i.createElement(es,{color:"#E4E8EC"}),i.createElement(ei,null,a.length>0&&!l&&i.createElement(i.Fragment,null,a.map((e,t)=>t>=9?i.createElement(i.Fragment,null):i.createElement(ec,{key:e.id,onClick:()=>handleOnClick(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&&!l&&i.createElement(M.T,{size:"sm",color:F.r.colors.gray400},o("booking.searchBar.noResults")),l&&Array(6).fill(void 0).map((e,t)=>i.createElement(ec,{key:"loading"+t},i.createElement("div",{className:"image-item"},i.createElement(s.O,{height:40,animate:!0})),i.createElement("div",{className:"infor"},i.createElement("div",{className:"title"},i.createElement(s.O,{height:20,radius:"sm",animate:!0})))))),p&&i.createElement(ed,null,i.createElement("div",{className:"show-more",onClick:()=>{let e=`/${u.SPECIALTIES}`;n({type:r.NavigateTo,payload:e})}},o("home.seeAll"))))},eu=L.Z.div` display: flex; gap: 5px; margin-top: 16px; flex-wrap: wrap; `,ep=L.Z.div` color: ${F.r.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 12px; background: ${F.r.colors.white}; border-radius: 32px; cursor: pointer; border: 1px solid ${F.r.colors.white}; margin-bottom: 5px; border-color: ${F.r.colors.neutral100}; background: #f7f9fc; &.view-all { border-radius: 32px; border-color: ${F.r.colors.blue50}; background: ${F.r.colors.blue50}; color: ${F.r.colors.blue600}; &:hover { border-color: ${F.r.colors.blue50}; background: ${F.r.colors.blue50}; color: ${F.r.colors.blue600}; } } &:hover { border-color: ${F.r.colors.neutral100}; background: #f7f9fc; } `,em=L.Z.div` color: ${F.r.colors.gray600}; font-size: 14px; font-weight: 600; line-height: 22px; padding: 4px 0; background: ${F.r.colors.white}; border-radius: 32px; border: 1px solid ${F.r.colors.white}; margin-bottom: 5px; margin-right: 7px; `,SearchTag=({state:e,type:t,typeInformation:a,dispatch:l})=>{let{t:n}=(0,D.u)(),{selectedLocation:o}=e,c=(0,i.useMemo)(()=>a[t].slug,[a,t]),handleClickKeyword=e=>{e.url&&(window.location.href=e.url)};return i.createElement(eu,null,i.createElement(em,null,n("booking.searchBar.popularKey")),e.popularKeys.map(e=>i.createElement(ep,{key:e.id,onClick:()=>handleClickKeyword(e)},e.keyword)),i.createElement(ep,{className:"view-all",onClick:()=>{let e=`/${o.slug}/${c}`;e&&l({type:r.NavigateTo,payload:e})}},n("booking.searchBar.viewAll")))},eg=L.Z.div` background: rgba(255, 255, 255, 0.64); backdrop-filter: blur(12px); border-bottom: 1px solid ${F.r.colors.neutral100}; `,eh=(0,L.Z)(_.C)` padding: 0 16px; `,TabSearch=({currentTab:e,hideTabBookingSearch:t=[],hideSpecialtyTab:a,isMobile:l,setCurrentTab:n})=>{let{t:r}=(0,D.u)(),o=(0,i.useMemo)(()=>({root:{overflowY:l?"hidden":"initial",overflowX:l?"auto":"initial"},tabsList:{background:"rgba(255, 255, 255, 0)",borderBottom:"none",flexWrap:"nowrap",".mantine-Tabs-tab":{"&:last-child":{"&:after":{display:"none"}}}},tab:{padding:l?"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:l?"14px":"16px",fontWeight:600,lineHeight:l?"22px":"24px"}}),[l]),c=(0,i.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]),s=(0,i.useMemo)(()=>c.filter(e=>!t.includes(e.value))||[],[t,c]);return i.createElement(eg,{className:"booking-search-tab"},i.createElement(eh,null,i.createElement(v.m,{value:e,onTabChange:e=>{n(e)},styles:o},i.createElement(v.m.List,null,s.map(e=>i.createElement(v.m.Tab,{value:e.value,key:e.value},e.label))))))};(n=o||(o={})).doctor="doctor",n.service="hospital_service",n.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:l,initialSelectedCity:n,initialSearchValue:s="",initTypeSearch:d="hospital",initSpecialty:p,careFrontDomain:m="/care",isDebug:g=!1,gaTrackingSearchBar:h,gaTrackingLocationSearch:f,autoCompleteDisabled:C=!1,inputSearchPlaceholder:y="",hideTabBookingSearch:E=[],hideSpecialtySelection:v=!1,hideSpecialtyTab:P=!1,hidePopularSearchKeys:L=!1,clientSlug:F="",triggerSearchWhenChangeFilter:k,routerPush:_,onGeoLocationPermissionChange:M,onChangeLocation:j})=>{var $;let{locale:T,t:R}=(0,D.u)(),K=(0,i.useRef)(null),q=(0,i.useRef)(null),G=(0,i.useRef)(null),Y=(0,i.useRef)(null),[W,Q]=(0,i.useState)(d),{geoLocationPermission:X,geoLocationCoordinates:J}=(0,w.u)(),[ee,et]=(0,i.useReducer)(reducer,U,t=>Object.assign(Object.assign({},t),{isDebug:g,isMobile:e,geoLocationPermission:a||X||"unset",geoLocationCoordinates:l||J||null,searchKeywords:s,initialSelectedCity:n||null,selectedLocation:n||t.selectedLocation||null,searchLocationKeywords:(null==n?void 0:n.name)||t.searchLocationKeywords,autoCompleteDisabled:C,inputSearchPlaceholder:y,locale:T})),{navigateTo:el,focusedSpecialty:en,searchKeywords:er,geoLocationPermission:eo,selectedLocation:ei,initialSelectedCity:ec,searchResults:es,isLoadingSearchResults:ed}=ee,{fetchCitiesByLocation:eu,fetchCitiesByKeyword:ep,fetchSearchResults:em,fetchAllSpecialties:eg,fetchPopularKeys:eh}=function({dispatch:e,careApiDomain:t,locale:a="vi-VN",client:l=""}){let n=(0,i.useCallback)(function(l,n={}){let o=`${t}${l}`;return e({type:r.FetchCitiesStart}),fetch((0,w.h)(o,n,a),{method:"GET"}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e))).finally(()=>e({type:r.FetchCitiesFinish}))},[a]),c=(0,i.useCallback)(function({coordinates:t}){let o={},i={};t&&(o={lat:t.lat,lng:t.lng}),"ms-MY"===a&&(i.noPaging=1);let c=[n(N.P.GET_CITY_BY_IP,Object.assign(Object.assign(Object.assign({},o),i),{hospitalActive:1,client:O.C.MSD===l?"":l}))];return"zh-TW"===a?c.push(n(N.P.GET_CITIES_LIST,{noPaging:1,hospitalActive:1,client:O.C.MSD===l?"":l})):c.push(n(N.P.GET_CITIES_LIST,{noPaging:1,hospitalActive:1})),Promise.all(c).then(([t,a])=>{let l=Object.assign({},t);if(a){let e=l.cities.map(e=>e.id);l.cities=l.cities.concat(a.cities.filter(t=>!e.includes(t.id)))}e({type:r.FetchCitiesByGeoIpComplete,payload:l})}).catch(e=>console.error("error loading cities by location",e))},[a,t,e]),s=(0,i.useCallback)(function(t){return n(N.P.GET_CITIES_LIST,{keyword:t,client:l}).then(t=>{e({type:r.FetchCitiesByKeywordComplete,payload:t.cities})}).catch(e=>console.error("error loading cities by keyword",e))},[a,t,e]),d=(0,i.useCallback)(function(n,o,i,c,s){let d="specialty"===i?`${t}${N.P.GET_SEARCH_SPECIALTY}`:`${t}${N.P.GET_SEARCH_V2}`;e({type:r.FetchSearchResultsStart});let{selectedLocation:u,geoLocationCoordinates:p,selectedSpecialty:m}=o,g="";if(!u){e({type:r.FetchSearchResultsFinish});return}g=u.id===O.I?"":u.id;let h=(null==p?void 0:p.lat)||"",f=(null==p?void 0:p.lng)||"",b=(null==m?void 0:m.id)>0?null==m?void 0:m.id:"",C=n.trim().length>V[a]?n.trim():"";return fetch((0,w.h)(d,Object.assign({domain:t,searchType:i||"global",keyword:C,city:g===O.a?"":g,lat:h,lng:f,specialty_id:b,client_slug:O.C.MSD===c?"":c,msd:O.C.MSD===l?1:""},"doctor"===i&&{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"!==i&&(a="doctor"===i?t.searches.map(e=>Object.assign(Object.assign({},e),{specialties:ignoreCacarSpecialty((null==e?void 0:e.specialties)||[])})):t.searches),"specialty"===i&&(a=C?ignoreCacarSpecialty((null==t?void 0:t.specialties)||[]):ignoreCacarSpecialty((null==t?void 0:t.default)||[])),e({type:r.FetchSearchResultsComplete,payload:{key:i,searches:a||[]}}),s&&e({type:r.UpdateInitialSearchResults,payload:{key:i,searches:a||[]}})}).catch(e=>{console.log("error loading search results",{url:d,error:e})}).finally(()=>e({type:r.FetchSearchResultsFinish}))},[a,t,e]),u=(0,i.useCallback)(function(){let n=`${t}${N.P.GET_SEARCH_SPECIALTY}`;return fetch((0,w.h)(n,{domain:t,searchType:"",msd:O.C.MSD===l?1:""},a),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)).then(t=>{e({type:r.FetchAllSpecialties,payload:ignoreCacarSpecialty(t.specialties||[])})}).catch(e=>{console.log("error loading search results",{url:n,error:e})})},[a,t,e]),p=(0,i.useCallback)(function(l){let n=`${t}${N.P.GET_SEARCH_POPULAR_KEY}`;return fetch((0,w.h)(n,{domain:t,searchType:o[l],sort_by:"display_order",sort_order:"asc"},a)).then(e=>e.json()).then(e=>1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)).then(t=>{e({type:r.FetchPopularKeys,payload:t.popular_searches||[]})}).catch(e=>{console.log("error loading search results",{url:n,error:e})})},[a,t,e]);return{fetchCitiesByLocation:c,fetchCitiesByKeyword:s,fetchSearchResults:d,fetchAllSpecialties:u,fetchPopularKeys:p}}({dispatch:et,locale:T,careApiDomain:t,client:F}),ef=(0,i.useMemo)(()=>O.L[T],[T]),[eb,{close:eC,open:ey}]=(0,x.q)(!1),eE=(0,i.useMemo)(()=>Object.assign({doctor:{name:R("booking.searchPopup.doctors"),icon:i.createElement(DoctorIcon,null),slug:ef.DOCTOR},service:{name:R("booking.searchPopup.services"),icon:i.createElement(ServiceIcon,null),slug:ef.SERVICE},hospital:{name:R("booking.searchPopup.hospitals"),icon:i.createElement(HospitalIcon,null),slug:ef.HOSPITAL}},!P&&{specialty:{name:R("booking.searchPopup.specialties"),icon:i.createElement(SpecialtyIcon,null),slug:ef.SPECIALTIES}}),[W]),ev=(0,i.useMemo)(()=>I()(ep,400),[ep]),ex=(0,i.useMemo)(()=>I()(em,400),[em]),ew=(0,i.useCallback)(function({locationSlug:e,specialtyId:t}={}){var a;eC();let l="",{slug:n}=eE[W],o="",i=O.M[T][F],c=t||(null===(a=ee.selectedSpecialty)||void 0===a?void 0:a.id)||-1,s=e||(null==ei?void 0:ei.slug)||"";("doctor"===W||"hospital"===W)&&c>0&&(o=`&specialtyId=${c}`),l="specialty"===W?`/${n}`:`/${s}/${n}`,i&&(l+=`/${i}`),(l+=`?q=${er}${o}`)&&et({type:r.NavigateTo,payload:l})},[F,eC,W,et,T,er,null==ei?void 0:ei.slug,null===($=ee.selectedSpecialty)||void 0===$?void 0:$.id,eE]),eS=(0,i.useCallback)(function(e){k&&ew({locationSlug:e.slug}),et({type:r.SelectLocation,payload:e}),j&&j(e)},[et,e,j,ew,k]);(0,S.a)(Y,()=>{e||et({type:r.ClickOutsideInputSearchSpecialty})}),(0,i.useEffect)(()=>{var t;"denied"===eo||ec||et({type:r.SelectLocation,payload:{name:R("booking.searchBar.allLocations"),id:O.I,slug:null===(t=O.L[T])||void 0===t?void 0:t.ALL}}),M&&M(eo,ee.geoLocationCoordinates),e&&"granted"===eo&&ei&&et({type:r.FocusInputSearch}),eu({coordinates:ee.geoLocationCoordinates})},[eo]),(0,i.useEffect)(()=>{var e;let t=p||{name:R("booking.searchBar.allSpecialties"),id:-1,thumbnail:"",total_doctor:0,slug:ef.SPECIALTIES};if(p){(null===(e=ee.selectedSpecialty)||void 0===e?void 0:e.id)!==p.id&&et({type:r.SelectSpecialty,payload:p});return}ee.selectedSpecialty&&ee.selectedSpecialty.id===t.id||et({type:r.SelectSpecialty,payload:t})},[p,ef.SPECIALTIES,R]),(0,i.useEffect)(()=>{eg()},[]),(0,i.useEffect)(()=>{eh(W)},[W]),(0,i.useEffect)(()=>{el&&(_?_(el):window.location.href=`${m}${el}`)},[el]),(0,i.useEffect)(()=>{em(ee.searchKeywords,ee,W,F,!0)},[W]),(0,i.useEffect)(()=>{if(eb&&e){let e=setTimeout(()=>{var e;null===(e=G.current)||void 0===e||e.focus()},150);return()=>clearTimeout(e)}},[eb,e]);let eD={type:W,isMobile:e,state:ee,dispatch:et,debouncedFetchSearchResults:ex,initalSearchValue:s,onEnterSearch:ew,typeInformation:eE,trackingAttributes:h,isLoading:ed,hideSpecialtySelection:v||P,clientSlug:F,triggerSearchWhenChangeFilter:k,onChangeSpecialty:e=>k&&ew({specialtyId:e.id})};return i.createElement(i.Fragment,null,i.createElement(H,{ref:K},i.createElement(TabSearch,{currentTab:W,setCurrentTab:Q,isMobile:e,hideTabBookingSearch:E,hideSpecialtyTab:P}),i.createElement(A,{className:"booking-search-container"},i.createElement(Z,null,i.createElement(z,{className:"booking-search-content"},i.createElement("div",{ref:Y},i.createElement(b.k,{gap:"12px",align:"center",className:"flex-search-input"},i.createElement(ea,Object.assign({},eD,{ref:q,onFocusInput:()=>e&&ey()})),"specialty"!==W&&i.createElement(SearchLocation,{state:ee,isMobile:e,dispatch:et,debouncedFetchCitiesByKeyword:ev,selectedLocation:ei,onLocationClick:eS,trackingAttributes:f}),!e&&i.createElement(B.B,{size:"lg",variant:"primary",onClick:()=>ew(),styles:{root:{height:"48px",minWidth:"120px",borderRadius:"12px"}}},R("booking.searchBar.searchButton"))),!L&&"specialty"!==W&&ee.popularKeys.length>0&&i.createElement(SearchTag,{type:W,state:ee,typeInformation:eE,dispatch:et}),"specialty"===W&&"search"===en&&i.createElement(SearchResultSpecialties,{state:ee,isMobile:e,dispatch:et,specialties:(null==es?void 0:es.specialty)||[],isLoading:ed})))))),e&&i.createElement(ModalSearchResult,{keepMounted:!0,opened:eb,onClose:eC,closeModal:eC,searchInputEle:i.createElement(b.k,{align:"center",gap:8},i.createElement(ea,Object.assign({},eD,{onlyShowSearchBox:!0,ref:G})),i.createElement(B.B,{variant:"primary",leftIcon:i.createElement(c.Z,{size:20,color:"#fff"}),onClick:()=>ew(),styles:{root:{borderRadius:"12px"}}}))},i.createElement(u.x,{sx:{marginLeft:-16,marginRight:-16}},i.createElement(SearchResultContent,{type:W,state:ee,dispatch:et,isLoading:ed,typeInformation:eE,clientSlug:F}))))},ef=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:l})=>i.createElement(ef,{style:l,className:a},i.createElement(_.C,null,i.createElement("div",{className:"icon-wrapper"},t),i.createElement(M.T,{size:"c1",color:"var(--neutral800)"},e)))},IQnp:function(e,t,a){a.d(t,{D:function(){return DueDateForm},a:function(){return M}});var l,n,r,o,i=a("Kz+G"),c=a("q1tI"),s=a("8vDj"),d=a("iuhU"),u=a("DA0W"),p=a("SPK5"),m=a("FQtM"),g=a("Eso5"),h=a("sWYD"),f=a("QUW8"),b=a("NbaP"),C=a("cChf"),y=a("ZFu2"),E=a("Wgwc"),v=a.n(E),x=a("H1c6"),w=a("3tAZ"),S=a("pMur"),D=a("FUIV"),P=a("+aod"),I=a("fkrl"),O=a("w8hz"),L=a("+7X0"),F=a("iBNF");(l=r||(r={}))[l.lastPeriod=0]="lastPeriod",l[l.conception=1]="conception",l[l.IVF=2]="IVF",l[l.IUI=3]="IUI",l[l.ultrasound=4]="ultrasound";let k={[String(r.lastPeriod)]:{value:String(r.lastPeriod),icon:f.L,label:"dueDatePage.lastPeriod"},[String(r.IVF)]:{value:String(r.IVF),icon:e=>{var{isMarryBaby:t,size:a=24}=e,l=(0,i._)(e,["isMarryBaby","size"]);let n=Object.assign({width:a,height:a},l);return t?c.createElement("svg",Object.assign({viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),c.createElement("path",{d:"M15.804 28.278a3.16 3.16 0 0 1-3.18-3.208l.128-20.306 6.405.008-.128 20.307c-.012 1.757-1.452 3.191-3.225 3.2",fill:"#fff"}),c.createElement("path",{d:"m12.72 10.266-.116 14.788c-.011 1.757 1.423 3.197 3.18 3.208 1.774-.008 3.214-1.442 3.225-3.2V10.267",fill:"#FFEAF1"}),c.createElement("circle",{cx:"14.662",cy:"19.027",transform:"rotate(-49.83 14.662 19.027)",fill:"#3E3F58",r:"1.012"}),c.createElement("circle",{cx:"16.326",cy:"13.426",r:"1.012",transform:"rotate(-49.83 16.326 13.426)",fill:"#3E3F58"}),c.createElement("path",{d:"m14.662 19.026.087 1.022a.98.98 0 0 0 .344.667.98.98 0 0 1 .32.98l-.123.51m1.036-8.779.087 1.022a.98.98 0 0 0 .344.666.98.98 0 0 1 .32.98l-.123.511",stroke:"#3E3F58"}),c.createElement("path",{d:"M18.833 27.597a3.94 3.94 0 0 1-3.02 1.408 4 4 0 0 1-2.795-1.148 3.98 3.98 0 0 1-1.14-2.795l.108-20.553c0-.426.344-.756.753-.738.426 0 .757.345.738.754l-.108 20.553c.002.656.248 1.256.697 1.733a2.42 2.42 0 0 0 1.727.706 2.483 2.483 0 0 0 2.47-2.462l.109-20.553c0-.426.344-.757.753-.738.426 0 .757.344.738.754l-.108 20.553a3.85 3.85 0 0 1-.922 2.526",fill:"#202135"}),c.createElement("path",{d:"M20.753 4.975a.75.75 0 0 1-.58.262l-8.714-.027a.727.727 0 0 1-.738-.754c0-.425.344-.756.754-.737l8.713.026c.426 0 .756.344.738.754a.66.66 0 0 1-.173.476",fill:"#202135"})):c.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),c.createElement("path",{d:"M13.064 5.794a17.8 17.8 0 0 1 3.34-4.638l4.26 2.881a17.8 17.8 0 0 0-3.272 4.507l-1.08 2.12a.65.65 0 0 0 .124.76 7.9 7.9 0 0 1 2.296 4.81c.027.265-1.141 5.997-9.376 5.573-1.587-.082-5.724-1.269-6.12-2.86a8 8 0 0 1-.233-2.161c.124-4.165 3.718-7.648 7.884-7.647h.098a.65.65 0 0 0 .59-.36z",fill:"#BCDEFF"}),c.createElement("path",{d:"M20.75 3.234 16.696.496a.886.886 0 1 0-.992 1.469l4.056 2.738a.886.886 0 0 0 .992-1.469",fill:"#E3F2FF"}),c.createElement("path",{d:"M18.771 17.024a7.87 7.87 0 0 1-2.7 5.944A4.2 4.2 0 0 1 13.301 24H8.473a4.2 4.2 0 0 1-2.769-1.03 7.9 7.9 0 0 1-2.468-4.023c.924.468 2.191.805 3.922.805 1.142 0 2.01-.346 2.775-.834q.323-.21.629-.446c1.973-1.516 3.524-3.668 8.17-2.238q.04.39.04.79",fill:"#2D87F3"}),c.createElement("path",{d:"M11.858 15.5c-1.78.348-3.096-1.608-2.134-3.121a2.06 2.06 0 0 1 1.529-.944q.303-.03.588.025a.27.27 0 0 0 .268-.107c.282-.373.737-.573 1.2-.639.224-.031.374-.24.379-.44.021-.794.657-1.311 1.288-1.234.183.022.223.27.058.35l-.012.006a.9.9 0 0 0-.28.196c-.213.263-.187.407-.153.6.03.167.066.37-.04.715a1.45 1.45 0 0 1-.504.7c-.255.19-.445.23-.592.263-.088.019-.16.034-.223.076a.27.27 0 0 0-.07.379c.184.27.306.587.344.934a2.063 2.063 0 0 1-1.646 2.24",fill:"#fff"}),c.createElement("ellipse",{cx:"10",cy:"20.5",rx:"3",ry:"2.5",fill:"#FF6F4D"}))},label:"dueDatePage.ivf"},[String(r.conception)]:{value:String(r.conception),icon:e=>{var{isMarryBaby:t,size:a=24}=e,l=(0,i._)(e,["isMarryBaby","size"]);let n=Object.assign({width:a,height:a},l);return t?c.createElement("svg",Object.assign({viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),c.createElement("path",{d:"M16.5 27.133c1.298 0 2.596-.149 3.868-.447a9.15 9.15 0 0 0 6.818-6.818 16.94 16.94 0 0 0 0-7.736 9.15 9.15 0 0 0-6.818-6.818 16.94 16.94 0 0 0-7.736 0 9.15 9.15 0 0 0-6.818 6.818A17 17 0 0 0 5.367 16a.867.867 0 1 1-1.734 0c0-1.43.165-2.862.494-4.264a10.88 10.88 0 0 1 8.109-8.11 18.7 18.7 0 0 1 8.528 0 10.88 10.88 0 0 1 8.11 8.11 18.7 18.7 0 0 1 0 8.528 10.88 10.88 0 0 1-8.11 8.11 18.7 18.7 0 0 1-4.264.493.867.867 0 0 1 0-1.734",fill:"#3E3F58"}),c.createElement("path",{d:"M11.633 16a4.867 4.867 0 1 1 9.734 0 4.867 4.867 0 0 1-9.734 0m4.867-3.133a3.133 3.133 0 1 0 0 6.266 3.133 3.133 0 0 0 0-6.266",fill:"#E85388"}),c.createElement("path",{d:"M9.834 25.333a2.667 2.667 0 1 0-2.298-1.312l-.084.084a3.25 3.25 0 0 0-.952 2.298c0 .726-.41 1.39-1.06 1.715l-1.238.619a.667.667 0 0 0 .596 1.193l1.24-.62a3.25 3.25 0 0 0 1.796-2.907c0-.508.202-.995.561-1.355l.084-.084c.397.235.86.37 1.355.37",fill:"#3E3F58"})):c.createElement("svg",Object.assign({width:a,height:a,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),c.createElement("circle",{cx:"9",cy:"6.75",fill:"#91CAFF",r:"6.75"}),c.createElement("circle",{cx:"9",cy:"6.75",fill:"#2D87F3",r:"5.4"}),c.createElement("path",{d:"M1.789 12.2a.245.245 0 0 1-.02-.489c.073-.006 1.795-.167 1.761-1.605-.013-.587.15-1.057.485-1.397.524-.53 1.273-.528 1.305-.527a.245.245 0 0 1-.002.49h-.002c-.011 0-.582.004-.955.385-.236.24-.351.59-.34 1.038.018.793-.367 1.41-1.114 1.787a3.3 3.3 0 0 1-1.118.319M.75 17.774a.245.245 0 0 1 .226-.263c.073-.006 1.786-.162 1.749-1.593-.016-.586.146-1.055.48-1.392.521-.528 1.27-.524 1.3-.523a.245.245 0 0 1-.006.49c-.015 0-.58.004-.949.38q-.352.362-.335 1.033c.02.791-.362 1.406-1.106 1.78a3.3 3.3 0 0 1-1.095.313.245.245 0 0 1-.263-.225",fill:"#D2D6DC"}),c.createElement("path",{d:"M8.659 5.035c-.562-.561-1.956-.078-2.699.665-.407.407-.635.91-.665 1.373v.124l1.145 1.16.181.042c.464-.03.966-.258 1.373-.665.743-.743 1.226-2.137.665-2.699",fill:"#E3F2FF"}),c.createElement("path",{d:"m5.295 7.073-.292.75a.55.55 0 0 0 .124.589l.155.155a.55.55 0 0 0 .589.124l.75-.292z",fill:"#91CAFF"}),c.createElement("path",{d:"M8.098 11.358a.87.87 0 0 0-.233-.523c-.562-.562-1.956-.079-2.699.664-.407.408-.635.91-.665 1.373v.125l1.146 1.16.18.042c.464-.03.966-.258 1.374-.666.566-.566.98-1.51.897-2.175",fill:"#E3F2FF"}),c.createElement("path",{d:"m4.5 12.872-.29.75a.55.55 0 0 0 .123.589l.156.155a.55.55 0 0 0 .588.124l.75-.292z",fill:"#91CAFF"}))},label:"dueDatePage.conceptionDate"},[String(r.IUI)]:{value:String(r.IUI),icon:e=>{var{isMarryBaby:t,size:a=24}=e,l=(0,i._)(e,["isMarryBaby","size"]);let n=Object.assign({width:a,height:a},l);return c.createElement("svg",Object.assign({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),c.createElement("ellipse",{cx:"10",cy:"7.5",rx:"7.5",ry:"7.5",fill:"#91CAFF"}),c.createElement("ellipse",{cx:"10",cy:"7.5",rx:"6",ry:"6",fill:"#2D87F3"}),c.createElement("path",{d:"M1.98877 13.5566C1.8483 13.5566 1.72914 13.4487 1.71769 13.3062C1.7056 13.1563 1.81732 13.025 1.9672 13.013C2.04819 13.0061 3.96085 12.8267 3.92397 11.2296C3.90887 10.5766 4.09013 10.0544 4.46266 9.6775C5.04496 9.08834 5.87737 9.09055 5.91289 9.09138C6.06324 9.09309 6.18376 9.21636 6.18204 9.36675C6.18033 9.51603 6.05877 9.63593 5.90985 9.63593C5.9091 9.63593 5.90835 9.63593 5.9076 9.63593C5.8958 9.63593 5.26174 9.64041 4.84671 10.0637C4.58418 10.3314 4.4569 10.7194 4.46838 11.2171C4.48874 12.0983 4.06094 12.7846 3.23124 13.202C2.63342 13.5027 2.03606 13.5537 2.01095 13.5558C2.00351 13.5563 1.99611 13.5566 1.98877 13.5566Z",fill:"#D2D6DC"}),c.createElement("path",{d:"M0.834813 19.7487C0.823187 19.5988 0.935297 19.4678 1.08522 19.4562C1.16581 19.4496 3.06971 19.2768 3.02807 17.6868C3.011 17.0352 3.1904 16.5146 3.56121 16.1394C4.14076 15.5531 4.97192 15.5577 5.00687 15.5587C5.15722 15.5608 5.27734 15.6845 5.27516 15.8349C5.27301 15.9849 5.15117 16.106 4.99993 16.1032C4.99989 16.1032 4.99982 16.1032 4.99975 16.1032C4.98315 16.1032 4.35528 16.1074 3.9453 16.5255C3.68491 16.791 3.55946 17.177 3.57245 17.6725C3.59545 18.552 3.17051 19.2358 2.34353 19.6499C1.74807 19.948 1.15233 19.9971 1.12728 19.9991C0.976577 20.0107 0.846367 19.898 0.834813 19.7487Z",fill:"#D2D6DC"}),c.createElement("path",{d:"M9.62226 5.59508C8.99818 4.971 7.44969 5.50769 6.62421 6.33313C6.1713 6.78604 5.91828 7.34408 5.88477 7.85874V7.99721L7.15753 9.28601L7.35857 9.33258C7.87323 9.29906 8.43127 9.04605 8.88418 8.59314C9.70966 7.76766 10.2463 6.21916 9.62226 5.59508Z",fill:"#E3F2FF"}),c.createElement("path",{d:"M5.88516 7.85889L5.5611 8.69259C5.47325 8.91856 5.52723 9.17508 5.69865 9.3465L5.87139 9.51925C5.95823 9.60609 6.06693 9.66256 6.18243 9.68584C6.29486 9.70856 6.4137 9.70005 6.52509 9.65676L7.3588 9.3327L5.88516 7.85889Z",fill:"#91CAFF"}),c.createElement("path",{d:"M8.99894 12.6201C8.97018 12.3889 8.88805 12.1875 8.73945 12.0389C8.11537 11.4149 6.56687 11.9515 5.7414 12.777C5.28849 13.2299 5.03547 13.7879 5.00195 14.3026V14.4411L6.27493 15.7298L6.47597 15.7764C6.99063 15.7429 7.54867 15.4898 8.00158 15.0369C8.63034 14.4081 9.09073 13.3598 8.99894 12.6201Z",fill:"#E3F2FF"}),c.createElement("path",{d:"M5.00235 14.3027L4.67829 15.1364C4.59043 15.3624 4.64441 15.6189 4.81583 15.7904L4.98858 15.9631C5.07542 16.0499 5.18412 16.1064 5.29962 16.1297C5.41205 16.1524 5.53089 16.1439 5.64228 16.1006L6.47598 15.7766L5.00235 14.3027Z",fill:"#91CAFF"}))},label:"dueDatePage.IUI"},[String(r.ultrasound)]:{value:String(r.ultrasound),icon:e=>{var{isMarryBaby:t,size:a=24}=e,l=(0,i._)(e,["isMarryBaby","size"]);let n=Object.assign({width:a,height:a},l);return c.createElement("svg",Object.assign({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),c.createElement("g",{clipPath:"url(#clip0_5646_32454)"},c.createElement("path",{d:"M17.278 1.47119H2.7207C2.03035 1.47119 1.4707 2.03084 1.4707 2.72119V17.2785C1.4707 17.9689 2.03035 18.5285 2.7207 18.5285H17.278C17.9684 18.5285 18.528 17.9689 18.528 17.2785V2.72119C18.528 2.03084 17.9684 1.47119 17.278 1.47119Z",fill:"#65B5FF"}),c.createElement("path",{d:"M11.23 9.94794C12.1285 10.4395 11.7085 11.7187 10.9077 11.7734C10.1386 11.8261 9.79346 11.6067 9.12721 11.1589C8.74409 10.9014 8.11299 9.67872 7.93815 9.36872C7.74008 9.01332 7.58143 8.63733 7.46503 8.24747C7.31862 7.75122 7.71315 7.30122 8.03987 7.31731C8.09475 7.32086 8.14794 7.33765 8.19491 7.36625C8.24188 7.39485 8.28122 7.43441 8.30956 7.48153C8.3227 7.49619 8.33867 7.50803 8.3565 7.51636C8.37433 7.52469 8.39367 7.52933 8.41334 7.53C8.43301 7.53067 8.45261 7.52736 8.47097 7.52027C8.48933 7.51317 8.50607 7.50244 8.52018 7.48872C8.55856 7.44827 8.60864 7.42084 8.66339 7.41028C8.71814 7.39972 8.77482 7.40655 8.82549 7.42981C9.03081 7.56731 8.99503 7.80294 9.13081 8.11544C9.34088 8.4938 9.61306 8.83417 9.93596 9.12231C10.3217 9.44809 10.5785 9.59138 11.23 9.94794Z",fill:"#2B62CD"}),c.createElement("path",{d:"M19.5332 1.54781C19.5129 1.54783 19.4928 1.54386 19.4741 1.53611C19.4553 1.52836 19.4383 1.51699 19.424 1.50265C19.4096 1.48832 19.3982 1.47129 19.3904 1.45255C19.3827 1.43381 19.3787 1.41372 19.3787 1.39344V0.932812C19.3784 0.850311 19.3455 0.771271 19.2872 0.712933C19.2288 0.654596 19.1498 0.621695 19.0673 0.621406H18.6066C18.5665 0.62013 18.5285 0.603298 18.5006 0.574472C18.4726 0.545646 18.457 0.507087 18.457 0.466953C18.457 0.42682 18.4726 0.38826 18.5006 0.359434C18.5285 0.330608 18.5665 0.313776 18.6066 0.3125H19.0673C19.2317 0.312707 19.3894 0.378127 19.5057 0.494414C19.622 0.6107 19.6874 0.768359 19.6876 0.932812V1.39344C19.6876 1.43438 19.6713 1.47365 19.6424 1.5026C19.6134 1.53155 19.5742 1.54781 19.5332 1.54781Z",fill:"#2D87F3"}),c.createElement("path",{d:"M0.689531 1.54789C0.648588 1.54789 0.609323 1.53163 0.580372 1.50268C0.551421 1.47372 0.535156 1.43446 0.535156 1.39352V0.932891C0.535363 0.768356 0.600848 0.610626 0.717236 0.494326C0.833623 0.378027 0.991403 0.312661 1.15594 0.312578H1.61641C1.6371 0.31192 1.65772 0.315428 1.67703 0.322893C1.69635 0.330359 1.71397 0.34163 1.72884 0.356038C1.74371 0.370445 1.75554 0.387695 1.76361 0.406762C1.77169 0.425829 1.77585 0.446324 1.77585 0.467031C1.77585 0.487738 1.77169 0.508234 1.76361 0.527301C1.75554 0.546368 1.74371 0.563618 1.72884 0.578025C1.71397 0.592432 1.69635 0.603703 1.67703 0.611169C1.65772 0.618635 1.6371 0.622143 1.61641 0.621484H1.15594C1.07325 0.621484 0.993926 0.654258 0.935352 0.712626C0.876779 0.770995 0.843727 0.8502 0.843437 0.932891V1.39352C0.843438 1.43438 0.827238 1.47357 0.798388 1.50251C0.769538 1.53145 0.730393 1.54777 0.689531 1.54789Z",fill:"#2D87F3"}),c.createElement("path",{d:"M19.0673 19.4648H18.6066C18.5665 19.4636 18.5285 19.4467 18.5006 19.4179C18.4726 19.3891 18.457 19.3505 18.457 19.3104C18.457 19.2702 18.4726 19.2317 18.5006 19.2029C18.5285 19.174 18.5665 19.1572 18.6066 19.1559H19.0673C19.1498 19.1556 19.2288 19.1227 19.2872 19.0644C19.3455 19.0061 19.3784 18.927 19.3787 18.8445V18.3841C19.378 18.3634 19.3815 18.3427 19.389 18.3234C19.3965 18.3041 19.4077 18.2865 19.4221 18.2716C19.4365 18.2567 19.4538 18.2449 19.4729 18.2368C19.4919 18.2288 19.5124 18.2246 19.5331 18.2246C19.5538 18.2246 19.5743 18.2288 19.5934 18.2368C19.6125 18.2449 19.6297 18.2567 19.6441 18.2716C19.6585 18.2865 19.6698 18.3041 19.6773 18.3234C19.6847 18.3427 19.6882 18.3634 19.6876 18.3841V18.8441C19.6875 19.0086 19.6221 19.1664 19.5058 19.2828C19.3895 19.3991 19.2318 19.4646 19.0673 19.4648Z",fill:"#2D87F3"}),c.createElement("path",{d:"M1.40625 19.6875H0.940156C0.773755 19.6873 0.614228 19.6211 0.496565 19.5034C0.378901 19.3858 0.312707 19.2262 0.3125 19.0598V18.5938C0.3125 18.5523 0.328962 18.5126 0.358265 18.4833C0.387567 18.454 0.42731 18.4375 0.46875 18.4375C0.51019 18.4375 0.549933 18.454 0.579235 18.4833C0.608538 18.5126 0.625 18.5523 0.625 18.5938V19.0595C0.624979 19.1009 0.633115 19.1419 0.648942 19.1802C0.664769 19.2185 0.687977 19.2532 0.717242 19.2825C0.746507 19.3118 0.781256 19.3351 0.819503 19.3509C0.857751 19.3668 0.898749 19.375 0.940156 19.375H1.40625C1.44769 19.375 1.48743 19.3915 1.51674 19.4208C1.54604 19.4501 1.5625 19.4898 1.5625 19.5312C1.5625 19.5727 1.54604 19.6124 1.51674 19.6417C1.48743 19.671 1.44769 19.6875 1.40625 19.6875Z",fill:"#2D87F3"}),c.createElement("path",{d:"M3.95953 2.8125H2.65625C2.61481 2.8125 2.57507 2.79604 2.54576 2.76674C2.51646 2.73743 2.5 2.69769 2.5 2.65625C2.5 2.61481 2.51646 2.57507 2.54576 2.54576C2.57507 2.51646 2.61481 2.5 2.65625 2.5H3.95953C4.00097 2.5 4.04071 2.51646 4.07002 2.54576C4.09932 2.57507 4.11578 2.61481 4.11578 2.65625C4.11578 2.69769 4.09932 2.73743 4.07002 2.76674C4.04071 2.79604 4.00097 2.8125 3.95953 2.8125Z",fill:"#2D87F3"}),c.createElement("path",{d:"M17.3443 14.9688H16.7285C16.6871 14.9688 16.6473 14.9523 16.618 14.923C16.5887 14.8937 16.5723 14.8539 16.5723 14.8125C16.5723 14.7711 16.5887 14.7313 16.618 14.702C16.6473 14.6727 16.6871 14.6562 16.7285 14.6562H17.3443C17.3857 14.6562 17.4255 14.6727 17.4548 14.702C17.4841 14.7313 17.5005 14.7711 17.5005 14.8125C17.5005 14.8539 17.4841 14.8937 17.4548 14.923C17.4255 14.9523 17.3857 14.9688 17.3443 14.9688Z",fill:"#2D87F3"}),c.createElement("path",{d:"M17.3443 16.3027H16.7285C16.6871 16.3027 16.6473 16.2863 16.618 16.257C16.5887 16.2277 16.5723 16.1879 16.5723 16.1465C16.5723 16.105 16.5887 16.0653 16.618 16.036C16.6473 16.0067 16.6871 15.9902 16.7285 15.9902H17.3443C17.3857 15.9902 17.4255 16.0067 17.4548 16.036C17.4841 16.0653 17.5005 16.105 17.5005 16.1465C17.5005 16.1879 17.4841 16.2277 17.4548 16.257C17.4255 16.2863 17.3857 16.3027 17.3443 16.3027Z",fill:"#2D87F3"}),c.createElement("path",{d:"M17.3443 13.6499H16.7285C16.6871 13.6499 16.6473 13.6334 16.618 13.6041C16.5887 13.5748 16.5723 13.5351 16.5723 13.4937C16.5723 13.4522 16.5887 13.4125 16.618 13.3832C16.6473 13.3539 16.6871 13.3374 16.7285 13.3374H17.3443C17.3857 13.3374 17.4255 13.3539 17.4548 13.3832C17.4841 13.4125 17.5005 13.4522 17.5005 13.4937C17.5005 13.5351 17.4841 13.5748 17.4548 13.6041C17.4255 13.6334 17.3857 13.6499 17.3443 13.6499Z",fill:"#2D87F3"}),c.createElement("path",{d:"M4.99063 3.84375H2.65625C2.61481 3.84375 2.57507 3.82729 2.54576 3.79799C2.51646 3.76868 2.5 3.72894 2.5 3.6875C2.5 3.64606 2.51646 3.60632 2.54576 3.57701C2.57507 3.54771 2.61481 3.53125 2.65625 3.53125H4.99063C5.03207 3.53125 5.07181 3.54771 5.10111 3.57701C5.13041 3.60632 5.14687 3.64606 5.14687 3.6875C5.14687 3.72894 5.13041 3.76868 5.10111 3.79799C5.07181 3.82729 5.03207 3.84375 4.99063 3.84375Z",fill:"#2D87F3"}),c.createElement("path",{d:"M4.99063 4.875H2.65625C2.61481 4.875 2.57507 4.85854 2.54576 4.82924C2.51646 4.79993 2.5 4.76019 2.5 4.71875C2.5 4.67731 2.51646 4.63757 2.54576 4.60826C2.57507 4.57896 2.61481 4.5625 2.65625 4.5625H4.99063C5.03207 4.5625 5.07181 4.57896 5.10111 4.60826C5.13041 4.63757 5.14687 4.67731 5.14687 4.71875C5.14687 4.76019 5.13041 4.79993 5.10111 4.82924C5.07181 4.85854 5.03207 4.875 4.99063 4.875Z",fill:"#2D87F3"}),c.createElement("path",{d:"M17.3443 12.3843H16.7285C16.6871 12.3843 16.6473 12.3678 16.618 12.3385C16.5887 12.3092 16.5723 12.2695 16.5723 12.228C16.5723 12.1866 16.5887 12.1468 16.618 12.1175C16.6473 12.0882 16.6871 12.0718 16.7285 12.0718H17.3443C17.3857 12.0718 17.4255 12.0882 17.4548 12.1175C17.4841 12.1468 17.5005 12.1866 17.5005 12.228C17.5005 12.2695 17.4841 12.3092 17.4548 12.3385C17.4255 12.3678 17.3857 12.3843 17.3443 12.3843Z",fill:"#2D87F3"}),c.createElement("path",{d:"M17.3443 17.6562H16.7285C16.6871 17.6562 16.6473 17.6398 16.618 17.6105C16.5887 17.5812 16.5723 17.5414 16.5723 17.5C16.5723 17.4586 16.5887 17.4188 16.618 17.3895C16.6473 17.3602 16.6871 17.3438 16.7285 17.3438H17.3443C17.3857 17.3438 17.4255 17.3602 17.4548 17.3895C17.4841 17.4188 17.5005 17.4586 17.5005 17.5C17.5005 17.5414 17.4841 17.5812 17.4548 17.6105C17.4255 17.6398 17.3857 17.6562 17.3443 17.6562Z",fill:"#2D87F3"}),c.createElement("path",{d:"M17.0352 17.6563C16.9937 17.6563 16.954 17.6398 16.9247 17.6105C16.8954 17.5812 16.8789 17.5415 16.8789 17.5001V12.228C16.8789 12.1866 16.8954 12.1468 16.9247 12.1175C16.954 12.0882 16.9937 12.0718 17.0352 12.0718C17.0766 12.0718 17.1163 12.0882 17.1456 12.1175C17.1749 12.1468 17.1914 12.1866 17.1914 12.228V17.5001C17.1914 17.5415 17.1749 17.5812 17.1456 17.6105C17.1163 17.6398 17.0766 17.6563 17.0352 17.6563Z",fill:"#2D87F3"}),c.createElement("path",{d:"M8.60596 12.3197C8.54189 12.4053 8.46174 12.4775 8.37002 12.5324C8.13096 12.6807 7.05018 13.0533 5.9919 12.0152C5.72695 11.7747 5.47994 11.5151 5.25284 11.2385C5.07471 11.0041 4.83877 10.959 4.57627 10.5683C4.34659 10.2262 4.36846 9.61991 4.57627 9.35412C4.84502 9.01194 5.32627 8.84022 5.62627 9.49631C5.76534 9.80256 6.47002 10.476 7.0294 10.6262C7.09603 10.6424 7.16404 10.6523 7.23252 10.6558C7.85752 10.6952 8.57627 11.1307 8.74659 11.6512C8.77467 11.766 8.77661 11.8857 8.75227 12.0014C8.72793 12.1172 8.67794 12.2259 8.60596 12.3197Z",fill:"#2B62CD"}),c.createElement("path",{d:"M17.8215 7.60137C17.3465 10.2436 15.2621 10.3982 14.3965 11.2482C13.9965 11.642 14.0606 11.7092 13.9965 12.7201C13.9231 13.8951 13.2621 16.1139 11.0356 16.7654C8.77777 17.4279 6.96371 16.5029 6.00121 14.6982C5.14339 13.0904 4.21527 13.6154 3.00121 13.1811C2.42152 12.9717 2.00433 12.4811 2.01996 11.9748C2.03871 11.3217 2.40902 10.8404 3.37777 11.3217C4.04964 11.6545 4.69496 11.5936 5.30433 11.5201C5.63507 11.4688 5.96971 11.4468 6.30433 11.4545C6.96796 11.5169 7.60602 11.7417 8.16214 12.1092C8.31527 12.2061 8.42621 12.2889 8.48402 12.3342C8.0626 11.9665 7.71478 11.5222 7.45902 11.0248C7.44183 10.9936 7.2848 10.655 7.25589 10.592C6.96136 9.95137 7.39027 9.35606 7.83714 9.35606C7.87141 9.35549 7.9056 9.3597 7.93871 9.36855C8.05114 9.39698 8.14976 9.46457 8.21683 9.55918C8.23545 9.57848 8.25784 9.59375 8.28261 9.60403C8.30738 9.61431 8.334 9.61939 8.36082 9.61895C8.38763 9.61851 8.41407 9.61256 8.43849 9.60147C8.46291 9.59038 8.48479 9.57439 8.50277 9.55449C8.54371 9.50394 8.60167 9.47004 8.66579 9.45911C8.72992 9.44818 8.79583 9.46098 8.85121 9.49512C9.13871 9.66699 8.98871 10.0232 9.19808 10.4342C9.42152 10.8732 10.109 11.3389 10.634 11.2389C11.0293 11.1623 11.8606 10.6811 10.634 10.167C9.94808 9.88105 9.86683 9.48418 9.93558 9.12168C9.96058 8.99356 10.1621 8.41543 10.1653 8.39356C10.1996 8.1248 9.64652 7.69668 10.1653 7.31699C10.4215 7.12949 10.459 6.88262 10.5075 6.56855C10.7934 4.6998 12.02 3.47168 13.9825 3.47168C16.5262 3.47168 18.1418 5.82793 17.8215 7.60137Z",fill:"#2D87F3"}),c.createElement("path",{d:"M11.0678 7.4316C11.006 7.43496 10.9443 7.42333 10.888 7.3977C10.8317 7.37207 10.7824 7.33321 10.7443 7.28441C10.7305 7.26814 10.7201 7.24921 10.7139 7.22877C10.7076 7.20833 10.7056 7.18683 10.708 7.16559C10.7104 7.14436 10.7171 7.12384 10.7278 7.1053C10.7384 7.08677 10.7527 7.07062 10.7699 7.05784C10.787 7.04507 10.8066 7.03594 10.8274 7.03103C10.8482 7.02613 10.8698 7.02553 10.8908 7.0293C10.9118 7.03306 10.9319 7.0411 10.9497 7.05292C10.9675 7.06474 10.9827 7.08009 10.9943 7.09801C11.0256 7.1391 11.159 7.11504 11.2378 7.0802C11.2756 7.06321 11.3186 7.06193 11.3573 7.07666C11.3961 7.09138 11.4274 7.1209 11.4444 7.15871C11.4614 7.19653 11.4627 7.23954 11.4479 7.27829C11.4332 7.31705 11.4037 7.34836 11.3659 7.36535C11.272 7.40738 11.1706 7.42991 11.0678 7.4316Z",fill:"#2B62CD"}),c.createElement("path",{d:"M11.548 13.1983C11.5518 13.2185 11.5515 13.2392 11.5471 13.2592C11.5428 13.2792 11.5345 13.2981 11.5227 13.3149C11.5109 13.3316 11.4958 13.3458 11.4785 13.3567C11.4611 13.3675 11.4417 13.3748 11.4215 13.378C11.2165 13.4117 11.0089 13.4279 10.8012 13.4265C10.5169 13.4214 10.2349 13.3757 9.96367 13.2905C9.44418 13.1038 8.96486 12.8201 8.55117 12.4546C7.77477 11.8262 7.66367 11.4171 7.45898 11.0249C7.74314 11.4988 8.12768 11.9047 8.58555 12.214C9.03605 12.5485 9.53089 12.8188 10.0559 13.0171C10.4848 13.1224 10.9305 13.141 11.3668 13.0718C11.387 13.0677 11.4079 13.0678 11.4281 13.0721C11.4483 13.0763 11.4675 13.0846 11.4844 13.0964C11.5014 13.1082 11.5157 13.1233 11.5267 13.1409C11.5376 13.1584 11.5449 13.1779 11.548 13.1983Z",fill:"#2B62CD"}),c.createElement("path",{d:"M10.5484 8.85297C10.511 8.86675 10.4712 8.87312 10.4313 8.87172C10.2958 8.86506 10.164 8.82594 10.0469 8.75766C10.0858 8.62969 10.1177 8.54703 10.1419 8.46875C10.2299 8.5323 10.3369 8.56419 10.4453 8.55922C10.464 8.55169 10.4839 8.54798 10.504 8.54833C10.5241 8.54867 10.5439 8.55306 10.5623 8.56122C10.5807 8.56939 10.5972 8.58116 10.6109 8.59585C10.6247 8.61054 10.6353 8.62784 10.6422 8.64672C10.6561 8.68656 10.6541 8.73021 10.6366 8.76862C10.6192 8.80703 10.5876 8.83724 10.5484 8.85297Z",fill:"#2B62CD"})),c.createElement("defs",null,c.createElement("clipPath",{id:"clip0_5646_32454"},c.createElement("rect",{width:"20",height:"20",fill:"white"}))))},label:"dueDatePage.ultrasound"}},_=[String(r.lastPeriod),String(r.IVF),String(r.conception)],M={[b.L.Cambodia]:_,[b.L.Singapore]:_,[b.L.India]:_,[b.L.Indonesia]:[String(r.lastPeriod),String(r.IUI),String(r.IVF),String(r.ultrasound)],[b.L.Malaysia]:_,[b.L.Myanmar]:_,[b.L.PhilippinesEnglish]:_,[b.L.PhilippinesTagalog]:_,[b.L.Taiwan]:_,[b.L.Thailand]:_,[b.L.Vietnam]:[String(r.lastPeriod),String(r.IVF),String(r.IUI),String(r.ultrasound)]},j="yyyy-MM-dd",getDueDateLastPeriod=(e,t)=>({otherInfo:{method:r.lastPeriod+1,first_day:(0,h.Z)(e,j),measurement_date:null,insemination_date:null,cycle_length_days:t,conception_date:null,ivf_transfer_date:null,days_transfer:null}}),getDueDateConception=e=>({otherInfo:{method:r.conception+1,conception_date:(0,h.Z)(e,j),measurement_date:null,insemination_date:null,first_day:null,cycle_length_days:null,ivf_transfer_date:null,days_transfer:null}}),getDueDateIVF=(e,t)=>({otherInfo:{method:r.IVF+1,ivf_transfer_date:(0,h.Z)(e,j),measurement_date:null,insemination_date:null,days_transfer:t,conception_date:null,first_day:null,cycle_length_days:null}}),getDueDateIUI=e=>({otherInfo:{method:r.conception+1,insemination_date:(0,h.Z)(e,j),measurement_date:null,conception_date:null,first_day:null,cycle_length_days:null,ivf_transfer_date:null,days_transfer:null}}),getDueDateUltrasound=(e,t)=>{let[a,l]=t.split("|"),[n,o]=[Number(a),Number(l)];return{otherInfo:{method:r.conception+1,measurement_date:(0,h.Z)(e,j),conception_date:null,insemination_date:null,crl_value:n,msd_value:o,first_day:null,cycle_length_days:null,ivf_transfer_date:null,days_transfer:null}}},$=(0,c.createContext)({}),T=(0,c.createContext)({}),DefaultLayout$4=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,c.useContext)(T);return c.createElement(P.H.FormRow,null,c.createElement(w.D,Object.assign({label:c.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.lastPeriod.lastPeriodLabel"))},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date})))},InlineLayout$4=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,c.useContext)(T);return c.createElement(P.H.FormRow,null,c.createElement(P.H.BorderInlineControl,{width:300,label:e("dueDatePage.lastPeriod.lastPeriodLabel")},c.createElement(w.D,Object.assign({},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date,error:null}))),t.errors.lastPeriodDate&&c.createElement(P.H.Error,null,t.errors.lastPeriodDate))},MbLayout$4=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,c.useContext)(T);return c.createElement(P.H.BorderBoxControl,{label:e("dueDatePage.lastPeriod.lastPeriodLabel"),rightSection:c.createElement(I.Z,null)},c.createElement(w.D,Object.assign({},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},rightSection:null,maxDate:new Date})))},ConceptionForm=({})=>{let{classes:e={}}=(0,c.useContext)(O.C),{formLayout:t,onSubmit:a,currentUrl:l,submitProps:n}=(0,c.useContext)($),o=(0,s.rZ)(),{t:i}=(0,D.u)(),u=(0,C.c)({initialValues:{lastPeriodDate:new Date}}),p={onSubmit:u.onSubmit(e=>{let{lastPeriodDate:t}=e,l=`${L.Q.type}=${r.conception}&${L.Q.startDate}=${v()(t).format(L.A)}&${L.Q.additional}= `;a(getDueDateConception(t),l)})};return c.createElement(T.Provider,{value:{form:u}},c.createElement(P.H,Object.assign({formLayout:t},p),"inline"===t?c.createElement(InlineLayout$4,null):"mb"===o.other.template?c.createElement(MbLayout$4,null):c.createElement(DefaultLayout$4,null),c.createElement(P.H.FormRow,{className:e.submitWrapper},c.createElement(P.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:l,className:(0,d.default)("due-date-calculate-button",e.submitBtn),type:"submit"},n),i("dueDatePage.lastPeriod.calculate")))))},R=(0,c.createContext)({}),DefaultLayout$3=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,c.useContext)(R);return c.createElement(P.H.FormRow,null,c.createElement(w.D,Object.assign({label:c.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.date_of_IUI_procedure"))},t.getInputProps("dateOfIUIProcedure"),{popoverProps:{withinPortal:!0},maxDate:new Date})))},InlineLayout$3=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,c.useContext)(R);return c.createElement(P.H.FormRow,null,c.createElement(P.H.BorderInlineControl,{width:300,label:e("dueDatePage.date_of_IUI_procedure")},c.createElement(w.D,Object.assign({},t.getInputProps("dateOfIUIProcedure"),{popoverProps:{withinPortal:!0},maxDate:new Date,error:null}))))},MbLayout$3=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,c.useContext)(R);return c.createElement(P.H.BorderBoxControl,{label:e("dueDatePage.date_of_IUI_procedure"),rightSection:c.createElement(I.Z,null)},c.createElement(w.D,Object.assign({},t.getInputProps("dateOfIUIProcedure"),{popoverProps:{withinPortal:!0},rightSection:null,maxDate:new Date})))},IUIForm=({})=>{let{formLayout:e,onSubmit:t,currentUrl:a,submitProps:l}=(0,c.useContext)($),{classes:n={}}=(0,c.useContext)(O.C),o=(0,s.rZ)(),{t:i}=(0,D.u)(),u=(0,C.c)({initialValues:{dateOfIUIProcedure:new Date}}),p={onSubmit:u.onSubmit(e=>{let{dateOfIUIProcedure:a}=e,l=`${L.Q.type}=${r.IUI}&${L.Q.startDate}=${v()(a).format(L.A)}&${L.Q.additional}= `;t(getDueDateIUI(a),l)})};return c.createElement(R.Provider,{value:{form:u}},c.createElement(P.H,Object.assign({formLayout:e},p),"inline"===e?c.createElement(InlineLayout$3,null):"mb"===o.other.template?c.createElement(MbLayout$3,null):c.createElement(DefaultLayout$3,null),c.createElement(P.H.FormRow,{className:n.submitWrapper},c.createElement(P.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:a,className:(0,d.default)("due-date-calculate-button",n.submitBtn),type:"submit"},l),i("dueDatePage.lastPeriod.calculate")))))},N=(0,c.createContext)({}),DefaultLayout$2=()=>{let{t:e}=(0,D.u)(),{form:t,transferDateOptions:a}=(0,c.useContext)(N);return c.createElement(c.Fragment,null,c.createElement(P.H.FormRow,null,c.createElement(w.D,Object.assign({label:c.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.ivf.transferDate"))},t.getInputProps("IVFDate"),{popoverProps:{withinPortal:!0},maxDate:new Date}))),c.createElement(P.H.FormRow,null,c.createElement(x.R.Group,Object.assign({},t.getInputProps("dayTransfer")),c.createElement(u.Z,null,a.map((e,t)=>c.createElement(x.R,{key:t,value:e.value,label:e.label}))))))},InlineLayout$2=()=>{let{t:e}=(0,D.u)(),{form:t,transferDateOptions:a}=(0,c.useContext)(N);return c.createElement(c.Fragment,null,c.createElement(P.H.FormRow,null,c.createElement(P.H.BorderInlineControl,{width:300,label:e("dueDatePage.ivf.transferDate")},c.createElement(w.D,Object.assign({},t.getInputProps("IVFDate"),{popoverProps:{withinPortal:!0},maxDate:new Date})))),c.createElement(P.H.FormRow,null,c.createElement(P.H.BorderInlineControl,{width:"none"},c.createElement(x.R.Group,Object.assign({},t.getInputProps("dayTransfer")),c.createElement(u.Z,null,a.map((e,t)=>c.createElement(x.R,{key:t,value:e.value,label:e.label})))))))},MbLayout$2=()=>{let{t:e}=(0,D.u)(),{form:t,transferDateOptions:a}=(0,c.useContext)(N);return c.createElement(c.Fragment,null,c.createElement(P.H.BorderBoxControl,{label:e("dueDatePage.ivf.transferDate"),rightSection:c.createElement(I.Z,null)},c.createElement(w.D,Object.assign({},t.getInputProps("IVFDate"),{popoverProps:{withinPortal:!0},maxDate:new Date,rightSection:null}))),c.createElement(x.R.Group,Object.assign({},t.getInputProps("dayTransfer")),c.createElement(u.Z,null,a.map((e,t)=>c.createElement(x.R,{key:t,value:e.value,label:e.label})))))},IVFForm=({})=>{var e;let{classes:t={}}=(0,c.useContext)(O.C),{formLayout:a,onSubmit:l,currentUrl:n,submitProps:o}=(0,c.useContext)($),{t:i}=(0,D.u)(),u=(0,s.rZ)(),p=[{value:"3",label:i("dueDatePage.ivf.transferDateRadio",{number:3})},{value:"5",label:i("dueDatePage.ivf.transferDateRadio",{number:5})}],m=(0,C.c)({initialValues:{IVFDate:new Date,dayTransfer:null===(e=null==p?void 0:p[0])||void 0===e?void 0:e.value}}),g={onSubmit:m.onSubmit(e=>{let{IVFDate:t}=e,a=Number(e.dayTransfer),n=`${L.Q.type}=${r.IVF}&${L.Q.startDate}=${v()(t).format(L.A)}&${L.Q.additional}=${a}`;l(getDueDateIVF(t,Number(a)),n)})};return c.createElement(N.Provider,{value:{form:m,transferDateOptions:p}},c.createElement(P.H,Object.assign({formLayout:a},g),"inline"===a?c.createElement(InlineLayout$2,null):"mb"===u.other.template?c.createElement(MbLayout$2,null):c.createElement(DefaultLayout$2,null),c.createElement(P.H.FormRow,{className:t.submitWrapper},c.createElement(P.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:n,className:(0,d.default)("due-date-calculate-button",t.submitBtn),type:"submit"},o),i("dueDatePage.lastPeriod.calculate")))))},B=(0,c.createContext)({}),DefaultLayout$1=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,c.useContext)(B),a=(0,c.useMemo)(()=>[...Array(21)].map((t,a)=>({label:e("dueDatePage.daysText",{number:a+20}),value:`${a+20}`})),[]);return c.createElement(c.Fragment,null,c.createElement(P.H.FormRow,null,c.createElement(w.D,Object.assign({label:c.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.lastPeriod.lastPeriodLabel"))},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date}))),c.createElement(P.H.FormRow,null,c.createElement(x.I.Wrapper,{label:c.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.lastPeriod.periodLengthLabel"))},c.createElement(x.S,Object.assign({placeholder:e("tools.inputPlaceholder",{content:e("dueDatePage.daysText",{number:30})}),data:a,withinPortal:!0},t.getInputProps("periodLength"))))))},InlineLayout$1=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,c.useContext)(B),a=(0,c.useMemo)(()=>[...Array(21)].map((t,a)=>({label:e("dueDatePage.daysText",{number:a+20}),value:`${a+20}`})),[]);return c.createElement(c.Fragment,null,c.createElement(P.H.FormRow,null,c.createElement(P.H.BorderInlineControl,{label:e("dueDatePage.lastPeriod.lastPeriodLabel"),width:300},c.createElement(w.D,Object.assign({},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date})))),c.createElement(P.H.FormRow,null,c.createElement(P.H.BorderInlineControl,{label:e("dueDatePage.lastPeriod.periodLengthLabel"),width:300},c.createElement(x.S,Object.assign({placeholder:e("tools.inputPlaceholder",{content:e("dueDatePage.daysText",{number:30})}),data:a},t.getInputProps("periodLength"),{error:null,withinPortal:!0})))),t.errors.periodLength&&c.createElement(P.H.FormRow,null,c.createElement(P.H.Error,null,t.errors.periodLength)))},MbLayout$1=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,c.useContext)(B);return c.createElement(c.Fragment,null,c.createElement(P.H.BorderBoxControl,{label:e("dueDatePage.lastPeriod.lastPeriodLabel"),rightSection:c.createElement(I.Z,null)},c.createElement(w.D,Object.assign({rightSection:null},t.getInputProps("lastPeriodDate"),{popoverProps:{withinPortal:!0},maxDate:new Date}))),c.createElement(P.H.BorderBoxControl,{label:e("dueDatePage.lastPeriod.periodLengthLabel"),rightSection:e("ovulationPage.dayUnit")},c.createElement(x.I.Number,Object.assign({min:20,max:40,placeholder:e("tools.inputPlaceholder",{content:"30"})},t.getInputProps("periodLength")))),t.errors.periodLength&&c.createElement(P.H.Error,null,t.errors.periodLength))},LastPeriodForm=({})=>{let{formLayout:e,onSubmit:t,currentUrl:a,submitProps:l}=(0,c.useContext)($),{classes:n={}}=(0,c.useContext)(O.C),{t:o}=(0,D.u)(),i=(0,s.rZ)(),u="mb"===i.other.template,p=(0,C.c)({initialValues:{lastPeriodDate:new Date},validate:{periodLength:(0,y.U)(o("validation.error.requiredField"))}}),m={onSubmit:p.onSubmit(e=>{let{periodLength:a,lastPeriodDate:l}=e,n=`${L.Q.type}=${r.lastPeriod}&${L.Q.startDate}=${v()(l).format(L.A)}&${L.Q.additional}=${a}`;t(getDueDateLastPeriod(l,a),n)})};return c.createElement(B.Provider,{value:{form:p}},c.createElement(P.H,Object.assign({formLayout:e},m),"inline"===e?c.createElement(InlineLayout$1,null):u?c.createElement(MbLayout$1,null):c.createElement(DefaultLayout$1,null),c.createElement(P.H.FormRow,{className:n.submitWrapper},c.createElement(P.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:a,className:(0,d.default)("due-date-calculate-button",n.submitBtn),type:"submit"},l),o("dueDatePage.lastPeriod.calculate")))))},H=(0,c.createContext)({}),Info=e=>{var{isMarryBaby:t,size:a=24}=e,l=(0,i._)(e,["isMarryBaby","size"]);let n=Object.assign({width:a,height:a},l);return c.createElement("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.00065 1.3335C4.32065 1.3335 1.33398 4.32016 1.33398 8.00016C1.33398 11.6802 4.32065 14.6668 8.00065 14.6668C11.6807 14.6668 14.6673 11.6802 14.6673 8.00016C14.6673 4.32016 11.6807 1.3335 8.00065 1.3335ZM8.00065 11.3335C7.63398 11.3335 7.33398 11.0335 7.33398 10.6668V8.00016C7.33398 7.6335 7.63398 7.3335 8.00065 7.3335C8.36732 7.3335 8.66732 7.6335 8.66732 8.00016V10.6668C8.66732 11.0335 8.36732 11.3335 8.00065 11.3335ZM7.33398 6.00016H8.66732V4.66683H7.33398V6.00016Z",fill:"#2D87F3"}))},DefaultLayout=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,c.useContext)(H),a=c.createElement(S.T,{size:"p4",color:F.r.colors.gray400},"mm"),l=t.getInputProps("ultrasoundCRL"),n=t.getInputProps("ultrasoundMSD");return c.createElement(c.Fragment,null,c.createElement(P.H.FormRow,null,c.createElement(w.D,Object.assign({label:c.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.date_of_ultrasound"))},t.getInputProps("dateOfUltrasound"),{popoverProps:{withinPortal:!0},maxDate:new Date}))),c.createElement(P.H.FormRow,null,c.createElement(p.k,{align:"center",gap:4,mb:4},c.createElement(S.T,{size:"p2",weight:"semiBold"},e("dueDatePage.validation.one_is_required")),c.createElement(m.u,{withinPortal:!0,withArrow:!0,width:300,multiline:!0,label:e("dueDatePage.ultrasound.tooltip")},c.createElement(p.k,null,c.createElement(Info,{size:16})))),c.createElement(p.k,{gap:8},c.createElement(x.I,Object.assign({placeholder:"CRL",sx:{flex:1},rightSection:a,type:"number",min:0,step:.01},l,{errorProps:{sx:{display:"none"}}})),c.createElement(x.I,Object.assign({placeholder:"MSD",sx:{flex:1},rightSection:a,type:"number",min:0,step:.01},n,{errorProps:{sx:{display:"none"}}}))),(t.errors.ultrasoundCRL||t.errors.ultrasoundMSD)&&c.createElement(S.T,{size:"p4",color:F.r.colors.red500},t.errors.ultrasoundCRL||t.errors.ultrasoundMSD)))},InlineLayout=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,c.useContext)(H),a=c.createElement(S.T,{size:"p4",color:F.r.colors.gray400},"mm"),l=t.getInputProps("ultrasoundCRL"),n=t.getInputProps("ultrasoundMSD");return c.createElement(c.Fragment,null,c.createElement(P.H.FormRow,null,c.createElement(P.H.BorderInlineControl,{width:300,label:e("dueDatePage.date_of_ultrasound")},c.createElement(w.D,Object.assign({},t.getInputProps("dateOfUltrasound"),{popoverProps:{withinPortal:!0},maxDate:new Date,error:null})))),c.createElement(P.H.FormRow,null,c.createElement(P.H.BorderInlineControl,{width:300,label:c.createElement(p.k,{align:"center",gap:4},c.createElement("span",null,e("dueDatePage.validation.one_is_required")),c.createElement(m.u,{withinPortal:!0,withArrow:!0,width:300,multiline:!0,label:e("dueDatePage.ultrasound.tooltip")},c.createElement(p.k,null,c.createElement(Info,{size:16}))))},c.createElement(g.x,null,c.createElement(p.k,{gap:8},c.createElement(x.I,Object.assign({placeholder:"CRL",sx:{flex:1},rightSection:a,type:"number",min:0,step:.01},l,{errorProps:{sx:{display:"none"}}})),c.createElement(x.I,Object.assign({placeholder:"MSD",sx:{flex:1},rightSection:a,type:"number",min:0,step:.01},n,{errorProps:{sx:{display:"none"}}}))))),(t.errors.ultrasoundCRL||t.errors.ultrasoundMSD)&&c.createElement(P.H.Error,null,t.errors.ultrasoundCRL||t.errors.ultrasoundMSD)))},MbLayout=()=>{let{t:e}=(0,D.u)(),{form:t}=(0,c.useContext)(H);return c.createElement(P.H.BorderBoxControl,{label:e("dueDatePage.date_of_ultrasound"),rightSection:c.createElement(I.Z,null)},c.createElement(w.D,Object.assign({},t.getInputProps("dateOfUltrasound"),{popoverProps:{withinPortal:!0},rightSection:null,maxDate:new Date})))},UltrasoundForm=({})=>{let{classes:e={}}=(0,c.useContext)(O.C),{formLayout:t,onSubmit:a,currentUrl:l,submitProps:n}=(0,c.useContext)($),o=(0,s.rZ)(),{t:i}=(0,D.u)(),u=(0,C.c)({initialValues:{dateOfUltrasound:new Date},validate:e=>{let t=Number(e.ultrasoundCRL),a=Number(e.ultrasoundMSD);if(!t&&!a)return{ultrasoundCRL:i("dueDatePage.validation.record_not_valid")};let l=t>=5&&t<=101,n=a>0&&a<=13;return l||n?{}:t&&!l?{ultrasoundCRL:i("dueDatePage.validation.record_not_valid")}:a&&!n?{ultrasoundMSD:i("dueDatePage.validation.crl")}:void 0}}),p={onSubmit:u.onSubmit(e=>{let{dateOfUltrasound:t,ultrasoundCRL:l,ultrasoundMSD:n}=e,o=`${l}|${n}`,i=`${L.Q.type}=${r.ultrasound}&${L.Q.startDate}=${v()(t).format(L.A)}&${L.Q.additional}=${o}`;a(getDueDateUltrasound(t,o),i)})};return c.createElement(H.Provider,{value:{form:u}},c.createElement(P.H,Object.assign({formLayout:t},p),"inline"===t?c.createElement(InlineLayout,null):"mb"===o.other.template?c.createElement(MbLayout,null):c.createElement(DefaultLayout,null),c.createElement(P.H.FormRow,{className:e.submitWrapper},c.createElement(P.H.Submit,Object.assign({dataEventCategory:"Health Tool",dataEventAction:"Due Date",dataEventLabel:l,className:(0,d.default)("due-date-calculate-button",e.submitBtn),type:"submit"},n),i("dueDatePage.lastPeriod.calculate")))))},FormSwitcher=()=>{let{calculatorType:e}=(0,c.useContext)($);switch(e){case r.lastPeriod:return c.createElement(LastPeriodForm,null);case r.conception:return c.createElement(ConceptionForm,null);case r.IVF:return c.createElement(IVFForm,null);case r.IUI:return c.createElement(IUIForm,null);case r.ultrasound:return c.createElement(UltrasoundForm,null);default:return null}};(n=o||(o={}))[n.trackPeriod=0]="trackPeriod",n[n.conceive=1]="conceive",n[n.avoidPregnancy=2]="avoidPregnancy";let A=(0,c.forwardRef)((e,t)=>{var{label:a,icon:l}=e,n=(0,i._)(e,["label","icon"]);return c.createElement(g.x,Object.assign({ref:t,sx:{gap:"1rem",display:"flex",padding:"5px 6px",alignItems:"center","&[data-selected]":{backgroundColor:F.r.colors.gray100},"&[data-selected]:hover":{backgroundColor:F.r.colors.gray100},"&[data-hovered]":{backgroundColor:F.r.colors.gray100}},className:""},n),l,c.createElement(S.T,{size:"p4"},a))}),DueDateForm=e=>{var{locale:t,formLayout:a="default",submitProps:l,currentUrl:n,isMobile:o,onSubmit:s}=e,d=(0,i._)(e,["locale","formLayout","submitProps","currentUrl","isMobile","onSubmit"]);let{t:u}=(0,D.u)(),[p,m]=(0,c.useState)(r.lastPeriod),g=(0,c.useMemo)(()=>(null==M?void 0:M[t].map(e=>{let t=k[e],a=t.icon;return Object.assign(Object.assign({},t),{label:u(t.label),icon:c.createElement(a,{size:20})})}))||[],[t,u]),h=(0,c.useMemo)(()=>g.find(e=>e.value===String(p)),[p,g]);return c.createElement($.Provider,{value:{calculatingMethods:g,submitProps:l,currentUrl:n,isMobile:o,formLayout:a,onSubmit:s,calculatorType:p,setCalculatorType:m}},c.createElement(P.H,Object.assign({component:"div",formLayout:a},d),"default"===a?c.createElement(P.H.FormRow,null,c.createElement(P.H.Control,null,c.createElement(x.S,{label:c.createElement(S.T,{size:"p2",weight:"semiBold"},u("dueDatePage.calculationMethod")),value:String(p),data:g,itemComponent:A,onChange:e=>m(Number(e)),icon:null==h?void 0:h.icon}))):c.createElement(P.H.FormRow,null,c.createElement(P.H.BorderInlineControl,{label:c.createElement(S.T,{size:"p2",weight:"semiBold"},u("dueDatePage.calculationMethod")),width:300},c.createElement(x.S,{value:String(p),data:g,itemComponent:A,onChange:e=>m(Number(e))}))),c.createElement(FormSwitcher,null)))}},sfOR:function(e,t,a){a.d(t,{H:function(){return Heading}});var l=a("Kz+G"),n=a("q1tI"),r=a("8vDj"),o=a("pMur");let Heading=e=>{var{as:t,tag:a,color:i,fontWeight:c,dataEventCategory:s,dataEventAction:d,dataEventLabel:u}=e,p=(0,l._)(e,["as","tag","color","fontWeight","dataEventCategory","dataEventAction","dataEventLabel"]);let m=(0,r.rZ)();return n.createElement(o.T,Object.assign({as:t||a,color:i||m.colors.gray[8],"data-event-category":s,"data-event-action":d,"data-event-label":u,weight:"semibold"===c?"semiBold":"bold",size:a,"data-size":a,"data-font-weight":c||void 0},p))}},"+CDV":function(e,t,a){a.d(t,{F:function(){return Footer}});var l=a("q1tI"),n=a("HzgG"),r=a("Wgwc"),o=a.n(r),i=a("SPK5"),c=a("OAL+"),s=a("Eso5"),d=a("pMur"),u=a("JIuZ"),p=a("kuQP"),m=a("rBCA"),g=a("iBNF"),h=a("xrdX"),f=a("bZ6y"),b=a("0rTm");let C=m.Z.footer` background-color: #1b3250; .inner { padding: 64px 24px 98px 24px; margin: 0 auto; } .newsletter { padding: 24px 0; } .footer-logo { max-width: 132px; max-height: 32px; &[data-is-sehat='true'] { max-width: 250px; } img { object-fit: contain; } } .social { margin-top: 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; > .icons { display: flex; gap: 16px; } } hr { height: 1px; border: none; margin: 16px 0 16px 0; background: ${g.r.colors.neutral500}; opacity: 0.1; outline: none; } .footer-menu-column { min-width: 168px; } .footer-menu-title { margin-bottom: 16px; } .footer-menu-link { display: block; } .footer-menu-link-wrapper { display: flex; flex-direction: column; gap: 12px; } .copyright { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; .copyright-content { color: ${g.r.colors.neutral500}; font-size: 12px; } .copyright-image-wrapper { flex-shrink: 0; flex-wrap: wrap; display: flex; gap: 16px; justify-content: flex-end; .copyright-image { align-self: flex-start; img { height: 32px; } } } } .otherSites { display: flex; gap: 16px; align-items: center; padding: 19px 0; border-top: 1px solid ${g.r.colors.neutral100}1a; border-bottom: 1px solid ${g.r.colors.neutral100}1a; .flags { display: flex; gap: 12px; } } .signupButton { display: none; border: none; margin-top: 16px; outline: none; text-transform: uppercase; } ${u.M.mbDown} { .inner { padding: 64px 0; } .social { flex-direction: column; gap: 10px; align-items: start; } hr { margin-top: 0px; } .copyright { align-items: center; text-align: center; } .copyright-image-wrapper { justify-content: center; max-width: unset; } .otherSites { flex-direction: column; padding: 24px 0; .linkTitle { text-align: center; } .flags { flex-wrap: wrap; justify-content: center; } } .footer-menu-title { margin-bottom: 12px; } .footer-menu { display: grid; grid-template-columns: repeat(2, 1fr); > .footer-menu-column { padding: 24px 0; } > .footer-menu-column:first-child { grid-column-start: 1; grid-column-end: 3; border-top: 1px solid ${g.r.colors.neutral100}1a; border-bottom: 1px solid ${g.r.colors.neutral100}1a; > .footer-menu-link-wrapper { display: grid; grid-template-columns: repeat(2, 1fr); } } } .otherSites { margin-bottom: 24px; } } ${u.M.mbUp} { .newsletter > p { max-width: 360px; } .hrMobile { display: none; } .copyright { gap: 24px; flex-direction: row-reverse; align-items: center; justify-content: space-between; } .otherSites { margin-bottom: 40px; } .columns { display: flex; flex-direction: row; width: 100%; gap: 16px; margin-bottom: 40px; > div:nth-child(1) { display: flex; flex-direction: column; flex: 1; } > div:nth-child(2) { display: flex; flex-direction: row; gap: 24px; } } } `,y=m.Z.img` width: 32px; height: 32px; ${u.M.mbDown} { width: 24px; height: 24px; } .country-flag { width: 100%; height: 100%; } `,Flag=({url:e,dataEventCategory:t,dataEventAction:a,dataEventLabel:n})=>l.createElement(y,{loading:"lazy",className:"country-flag",src:e,alt:"Country Flag","data-event-category":t,"data-event-action":a,"data-content-label":n}),FooterMenuColumn=({title:e,items:t,locale:a,index:n})=>{let{isMobile:r}=(0,p.u)();return l.createElement("div",{className:"footer-menu-column"},e?l.createElement(d.T,{size:r?"s4":"s3",className:"footer-menu-title",weight:r?"regular":"semiBold",color:"neutral.6"},e):null,l.createElement("div",{className:"footer-menu-link-wrapper"},null==t?void 0:t.map((e,t)=>l.createElement(d.T,{size:r?"p3":"p4",as:"a","data-event-category":"Footer","data-event-action":e.title,"data-event-label":`https://${h.v[a]}${e.url}`,className:"footer-menu-link",href:e.url,key:t,color:"#fff",weight:r&&0===n?"semiBold":"regular"},e.title))))},DiscoverFooter=({className:e,footerInfo:t,locale:a})=>{var r,i,c,s,u,m,g,h,f,b,y;let{isMobile:E}=(0,p.u)(),v=null==t?void 0:t.menu,x=(null===(i=null===(r=null==t?void 0:t.general)||void 0===r?void 0:r.verified)||void 0===i?void 0:i.filter(Boolean))||[];return l.createElement(C,{className:e},l.createElement(n.C,null,l.createElement("div",{className:"inner"},l.createElement("a",{href:"/"},l.createElement("img",{loading:"lazy",className:"footer-logo",src:null===(c=null==t?void 0:t.general)||void 0===c?void 0:c.logo,alt:"Logo","data-is-sehat":"id-ID"===a})),l.createElement("div",{className:"columns"},l.createElement("div",{className:"newsletter"},l.createElement(d.T,{size:E?"s3":"s4",weight:"semiBold",color:"neutral.0"},null===(s=null==t?void 0:t.general)||void 0===s?void 0:s.content),l.createElement("div",{className:"social"},l.createElement(d.T,{size:"p4",color:"neutral.6"},null===(u=null==t?void 0:t.social)||void 0===u?void 0:u.title),l.createElement("div",{className:"icons"},null===(g=null===(m=null==t?void 0:t.social)||void 0===m?void 0:m.socials)||void 0===g?void 0:g.map((e,t)=>l.createElement("a",{key:t,"data-event-category":"Footer","data-event-action":`Follow us - ${e.name}`,"data-content-label":e.url,href:e.url},l.createElement("img",{loading:"lazy","data-event-category":"Footer","data-event-action":`Follow us - ${e.name}`,"data-content-label":e.url,src:e.icon,alt:"Logo Social",className:"social-icon",width:"24",height:"24"})))))),l.createElement("div",{className:"footer-menu"},v&&l.createElement(l.Fragment,null,null==v?void 0:v.map((e,t)=>l.createElement(FooterMenuColumn,{title:e.menu_title,items:e.items,locale:a,key:t,index:t}))))),l.createElement("div",{className:"otherSites"},l.createElement(d.T,{size:"p4",className:"linkTitle",color:"neutral.6",weight:"regular"},null===(h=null==t?void 0:t.branch)||void 0===h?void 0:h.title),l.createElement("div",{className:"flags"},null===(b=null===(f=null==t?void 0:t.branch)||void 0===f?void 0:f.branch)||void 0===b?void 0:b.map((e,t)=>l.createElement("a",{href:e.url,key:t,"data-event-category":"Footer","data-event-action":e.name,"data-event-label":e.url},l.createElement(Flag,{url:e.flag,dataEventCategory:"Footer",dataEventAction:e.name,dataEventLabel:e.url}))))),l.createElement("div",{className:"copyright"},l.createElement("div",{className:"copyright-image-wrapper"},x.length?x.map((e,t)=>l.createElement("a",{href:e.url,key:t,className:"copyright-image"},l.createElement("img",{loading:"lazy",src:e.image,alt:"DMCA Icon"}))):null),l.createElement(d.T,{size:"n1",className:"copyright-content",as:"div",color:"neutral.6",weight:"regular"},l.createElement("div",{dangerouslySetInnerHTML:{__html:null===(y=null==t?void 0:t.general)||void 0===y?void 0:y.copyright.replace(/{currentYear}/gi,o()().get("year").toString())}}))))))},E=m.Z.footer` position: relative; overflow: hidden; .icons { margin-top: 12px; margin-bottom: 20px; > a:not(:last-child) { margin-right: 16px; } } a { text-decoration: none; } `,v=m.Z.div` position: relative; padding: 80px 0 40px; margin: auto 68px; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid ${g.r.colors.neutral200}; ${u.M.tdDown} { margin: auto 16px; flex-wrap: wrap; row-gap: 32px; column-gap: 16px; } ${u.M.mbDown} { margin: auto 0; } `,x=m.Z.div` display: flex; justify-content: space-between; gap: 12px; flex-direction: column; ${u.M.mbDown} { flex: 1 1 160px; } .title { padding-bottom: 4px; } `,w=m.Z.div` display: flex; justify-content: space-between; gap: 12px; flex-direction: column; `,S=m.Z.div` background-color: #{map-get($mbColors, 'dark')}; padding: 16px 0; position: relative; img { width: 89px; height: 32px; } .content { display: flex; align-items: center; justify-content: space-between; gap: 174px; margin: auto 68px; ${u.M.tdDown} { margin: auto 16px; } ${u.M.mbDown} { flex-direction: column-reverse; gap: 16px; align-items: flex-start; margin: auto 0; } } .verify { display: flex; align-items: flex-start; gap: 8px; } `,D=m.Z.div` padding: 40px 0; ${u.M.mbUp} { margin: auto 68px; } `,P=m.Z.div` display: flex; gap: 16px; .social-logo { width: 28px; } `,MarryBabyFooter=({logoType:e="marryBaby",footerMenu:t,background:a})=>{var r;if(!t)return null;let{general:u,menu:p,socials:m}=t;return l.createElement(E,{style:{backgroundColor:a||"none"}},l.createElement(n.C,null,l.createElement(v,null,null==p?void 0:p.map(({menu_title:e,items:t},a)=>l.createElement(x,{key:`mbf${a}`},l.createElement(b.M,{className:"title",type:"subtitle-1",color:g.r.mbColors.pink},e),null==t?void 0:t.map(({title:e,url:t},a)=>l.createElement("a",{"data-event-category":"Footer","data-event-action":"Click","data-event-label":`${t}`,className:"link",href:t,key:`footer-links-${a}`},l.createElement(w,{key:`mbitem${a}`},l.createElement(b.M,{type:"bodytext-2",color:g.r.mbColors.gray},e)))))))),l.createElement(n.C,null,l.createElement(D,null,l.createElement(i.k,{gap:"24px",sx:e=>({[e.fn.largerThan("sm")]:{".info-item":{flexGrow:1,width:"50%"}},[e.fn.smallerThan("sm")]:{flexDirection:"column"}})},l.createElement(c.K,{spacing:"24px",className:"info-item"},l.createElement(f.L,{className:"logo",type:e}),l.createElement(d.T,{size:"p4",as:"div"},l.createElement("div",{dangerouslySetInnerHTML:{__html:null==u?void 0:u.content}})),l.createElement(P,null,null==m?void 0:m.map(({icon:e,name:t,url:a},n)=>l.createElement("a",{key:`social${n}`,target:"_blank",rel:"noreferrer","data-event-category":"Footer","data-event-action":`Follow us - ${t}`,"data-content-label":t,href:a},l.createElement("img",{className:"social-logo",loading:"lazy",src:e,alt:t}))))),l.createElement(s.x,{className:"info-item",sx:{paddingTop:"7px"}},l.createElement(d.T,{size:"p4",as:"div"},l.createElement("div",{dangerouslySetInnerHTML:{__html:null==u?void 0:u.information}})))))),l.createElement(S,null,l.createElement(n.C,null,l.createElement("div",{className:"content"},l.createElement(d.T,{size:"p5",color:"#fff",as:"div"},l.createElement("div",{dangerouslySetInnerHTML:{__html:null==u?void 0:u.copyright.replace(/{currentYear}/gi,o()().get("year").toString())}})),l.createElement("div",{className:"verify"},null===(r=null==u?void 0:u.verified)||void 0===r?void 0:r.map(({image:e,url:t},a)=>l.createElement("img",{loading:"lazy",key:`imgMbFt${a}`,src:e,alt:t})))))))},Footer=({locale:e,footerInfo:t,siteType:a,background:n})=>"helloSites"===a?l.createElement(DiscoverFooter,{locale:e,footerInfo:t||{}}):l.createElement(MarryBabyFooter,{footerMenu:t,background:n})},"fn/9":function(e,t,a){a.d(t,{B:function(){return m},F:function(){return h},G:function(){return g},S:function(){return d},a:function(){return fetchSSOV2ApiJson},c:function(){return checkUserExist},f:function(){return fetchSSOV2Api},g:function(){return getUserInfo},h:function(){return handleAuthSuccess},l:function(){return u},r:function(){return resetPassword},u:function(){return updateUserInfo},w:function(){return p}});var l=a("Kz+G"),n=a("GOBr"),r=a("bxxm"),o=a("+7X0"),i=a("27Mu"),c=a("NbaP"),s=a("xrdX");let d={LOGIN_BY_SOCIAL:"member/social-login",EMAIL:{REGISTER_BY_SEND_OTP:"login/login-with-email",LOGIN_BY_PASSWORD:"member/login",VERIFY_BY_OTP:"login/email-verify-code",SEND_OTP:"login/email-resend-otp-code"},PHONE:{REGISTER_BY_SEND_OTP:"login/login-with-sms",SEND_OTP:"login/sms/sent-otp",VERIFY_BY_OTP:"login/phone-verify-code",LOGIN_BY_PASSWORD:"member/login-by-phone",UPDATE_PHONE_SEND_OTP:"login/sms-social/sent-otp",UPDATE_PHONE_VERIFY_OTP:"login/sms-social/phone-verify-code"},WHATSAPP:{LOGIN_OTP_WHATSAPP:"login/login-otp-whatsapp",REGISTER_BY_SEND_OTP:"login/login-with-whatsapp",SEND_OTP:"login/whatsapp/sent-otp",UPDATE_PHONE_SEND_OTP:"login/sms-social/whatsapp/sent-otp",UPDATE_PHONE_VERIFY_OTP:"login/sms-social/whatsapp-verify-code",VERIFY_BY_OTP:"login/whatsapp-verify-code"},ZALO:{REGISTER_BY_SEND_OTP:"login/login-with-zalo",SEND_OTP:"login/zalo/sent-otp",VERIFY_BY_OTP:"login/zalo-verify-code",UPDATE_PHONE_SEND_OTP:"login/sms-social/zalo/sent-otp",UPDATE_PHONE_VERIFY_OTP:"login/sms-social/zalo-verify-code"},RESET_PASSWORD:"login/reset-password",CHECK_USER_EXIST:"member/check-user-exist",UPDATE_USER_INFO:"login/update-first-info",SETUP_USER_INFO:"login/setup-first-info",ECOM_CARE:{SEND_OTP:"login/ecom-care/send-email-otp-code",VERIFY_OTP:"login/ecom-care/email-verify-code",RESEND_OTP:"login/ecom-care/resend-email-otp-code"}},u="vi-VN",p={[c.L.Vietnam]:"1",[c.L.Indonesia]:"2",[c.L.Malaysia]:"3"}[u];o.L[u].PHONE;let getSSOV2ApiUrl=e=>(0,r.n)(`${(0,r.a)(u)}/api/v2/${e}`),getSSOApiUrl=e=>(0,r.n)(`${(0,r.a)(u)}/api/${e}`),m="hhg_user_token",fetchSSOV2Api=(e,t={},a)=>(0,l.a)(void 0,void 0,void 0,function*(){var l;let n;let r=a?"":null===(l=document.cookie.split("; ").find(e=>e.startsWith(m)))||void 0===l?void 0:l.split("=")[1];try{t.body instanceof FormData&&(t.body.append("ga_client_id",(0,i.ej)("_ga")||""),t.body.append("referrer",window.location.href)),n=yield fetch(getSSOV2ApiUrl(e),r?Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:`Bearer ${r}`},null==t?void 0:t.headers)}):t)}catch(e){return console.error(e),null}return null==n?void 0:n.json()}),fetchSSOV2ApiJson=(e,t,a)=>(0,l.a)(void 0,void 0,void 0,function*(){var l;let n;let r=a?"":null===(l=document.cookie.split("; ").find(e=>e.startsWith(m)))||void 0===l?void 0:l.split("=")[1];try{n=yield fetch(getSSOV2ApiUrl(e),{method:"POST",headers:Object.assign({Accept:"application/json","Content-Type":"application/json"},r?{Authorization:`Bearer ${r}`}:{}),body:JSON.stringify(t)})}catch(e){return console.error(e),null}return null==n?void 0:n.json()}),fetchSSOApi=(e,t={},a)=>(0,l.a)(void 0,void 0,void 0,function*(){var l;let n;let r=a?"":null===(l=document.cookie.split("; ").find(e=>e.startsWith(m)))||void 0===l?void 0:l.split("=")[1];try{n=yield fetch(getSSOApiUrl(e),r?Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:`Bearer ${r}`},null==t?void 0:t.headers)}):t)}catch(e){return console.error(e),null}return null==n?void 0:n.json()}),resetPassword=(e,t)=>(0,l.a)(void 0,void 0,void 0,function*(){let a=new FormData;return a.append("password",e),a.append("confirm-password",t),fetchSSOV2Api(d.RESET_PASSWORD,{method:"POST",body:a})}),checkUserExist=({email:e,phone:t})=>(0,l.a)(void 0,void 0,void 0,function*(){let a=new FormData;return e?a.append("email",e):a.append("phone_number",t),fetchSSOV2Api(d.CHECK_USER_EXIST,{method:"POST",body:a})}),updateUserInfo=e=>(0,l.a)(void 0,void 0,void 0,function*(){let t=new FormData;return Object.keys(e).forEach(a=>{let l=e[a];null!=l&&("string"!=typeof l||l.trim())&&t.append(a,e[a])}),fetchSSOV2Api(d.SETUP_USER_INFO,{method:"POST",body:t})}),g=n.y?"289442006438-040a42cbidr6v5d178f3iqi9q95821r3.apps.googleusercontent.com":"289442006438-cihobuq1h3r4426pur7u0e43fqdnep59.apps.googleusercontent.com",h="2759888574045636",getUserInfo=()=>(0,l.a)(void 0,void 0,void 0,function*(){return fetchSSOApi("user/profile",{method:"POST"})}),handleAuthSuccess=e=>{(null==e?void 0:e.token)&&(0,i.d8)(m,e.token,{domain:"localhost"===window.location.hostname?"localhost":`.${s.v[u]}`,expires:new Date(1e3*e.expire_in).toUTCString()}),(null==e?void 0:e.refresh_token)&&(0,i.d8)(o.k,e.refresh_token,{domain:"localhost"===window.location.hostname?"localhost":`.${s.v[u]}`})}}}]);