"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7004],{Zxpr:function(e,t,o){o.r(t),o.d(t,{OpeningOfArticle:function(){return OpeningOfArticle}});var r=o("BGKE"),a=o("iBNF"),n=o("mYVa"),l=o("ns0B"),i=o.n(l),d=o("Vvt1"),c=o.n(d),s=o("hXNO"),u=o("rBCA"),p=o("/kWL");let g=(0,u.Z)(p.T,{target:"e1b077ur0"})("word-break:break-word;"),v=(0,u.Z)("div",{target:"e1b077ur1"})("padding:16px;background:",a.r.colors.neutral50,";border-radius:",a.r.borderRadius,";color:",a.r.colors.gray800,";font-size:14px;line-height:22px;a{color:",a.r.colors.primary600,";}"),h=c()(()=>Promise.all([o.e(4846),o.e(2233),o.e(1058),o.e(5638),o.e(3295),o.e(1538),o.e(6629),o.e(7152),o.e(5684),o.e(2574),o.e(2513),o.e(5238),o.e(7644),o.e(6962),o.e(4050),o.e(6638),o.e(7741),o.e(1137),o.e(2433),o.e(9689),o.e(5385),o.e(3564),o.e(3158),o.e(8320),o.e(5641),o.e(7454),o.e(7004),o.e(4758),o.e(6219),o.e(17),o.e(8990),o.e(4067),o.e(9487),o.e(9083),o.e(1520),o.e(270),o.e(7596),o.e(8217),o.e(7543),o.e(2835),o.e(2507),o.e(6885),o.e(7859),o.e(5970),o.e(2730),o.e(6287),o.e(7682),o.e(1551),o.e(4870),o.e(9922),o.e(3133),o.e(612),o.e(2002),o.e(1880),o.e(7471),o.e(7165),o.e(8854),o.e(5451),o.e(8612)]).then(o.bind(o,"huhZ")).then(e=>e.ArticleAuthorMobile),{loadableGenerated:{webpack:()=>["huhZ"]}}),OpeningOfArticle=e=>{let{article:t}=e,o=(0,s.d)();return(0,r.BX)(r.HY,{children:[(0,r.tZ)(g,{as:"h1",size:"h2",className:"article-header mb-4",color:a.r.colors.gray800,sx:e=>({[e.fn.smallerThan("sm")]:{letterSpacing:"-0.9px",fontSize:(0,n.h)(26),lineHeight:(0,n.h)(34)}}),children:i()((null==t?void 0:t.postTitle)||"")}),o&&(0,r.tZ)(h,{expert:null==t?void 0:t.expert,author:null==t?void 0:t.author,articleReviewed:null==t?void 0:t.articleReviewed,reviewer:null==t?void 0:t.reviewer,updatedAt:(null==t?void 0:t.modifiedTime)||""}),(null==t?void 0:t.affiliate_message)&&(0,r.tZ)(v,{dangerouslySetInnerHTML:{__html:t.affiliate_message},className:"max-md:mb-3 md:mb-4"})]})}},jhGD:function(e,t,o){var r=o("BGKE"),a=o("q1tI"),n=o("dDsW"),l=o("rIrU");t.Z=(0,a.forwardRef)((e,t)=>{let{onFinish:o,onClick:i,isFinished:d,resendLabel:c,className:s}=e,[u,p]=(0,a.useState)(l.ip),g=(0,a.useRef)(),v=(0,a.useRef)(),{formatMessage:h}=(0,n.Z)();v.current=o;let m=(0,a.useCallback)(()=>{let e=l.ip;p(e),clearInterval(g.current),g.current=setInterval(()=>{if(p(e-=1),0===e){var t;null===(t=v.current)||void 0===t||t.call(v,!0),clearInterval(g.current)}},1e3)},[]),f=(0,a.useCallback)(()=>{p(0),clearInterval(g.current)},[]);return(0,a.useImperativeHandle)(t,()=>({reset:m,cancel:f,isFinished:0===u})),(0,a.useEffect)(()=>(m(),()=>{clearInterval(g.current)}),[]),(0,r.BX)("div",{className:s,onClick:i,children:[c||h({id:"subot.resendOTP.button",defaultMessage:"Resend"}),u>0&&!d&&" (".concat(u,"s)")]})})},JUSC:function(e,t,o){o.d(t,{t:function(){return OTPInfoForm}});var r=o("BGKE"),a=o("q1tI"),n=o("odgB"),l=o("E+oP"),i=o.n(l),d=o("wUmw"),c=o("dDsW"),s=o("RB7Y"),u=o("oQBk"),p=o("xIXX"),g=o("CJtR"),v=o("0VOb"),h=o("H9bp"),m=o("UNYN"),f=o("Rlzi"),b=o.n(f),y=o("jhGD"),k=o("rBCA"),w=o("iBNF"),x=o("HMwR"),Z=o("rIrU");let C=(0,k.Z)("div",{target:"e1hkw0jq0"})("margin:0 auto;background:#f7f9fc;border-radius:",w.r.borderRadius,";",x.M.mbDown,"{padding:16px;}",x.M.tdDown,"{padding:24px;}",x.M.mbUp,"{padding:32px;}.user-info-form{.input-row{",x.M.mbDown,"{margin-bottom:16px;}",x.M.tdDown,"{margin-bottom:18px;}",x.M.mbUp,"{margin-bottom:20px;}.address-dropdown > ul{z-index:20000;max-height:250px;overflow-y:auto;}&.error{margin-bottom:0;}}label{display:block;margin-bottom:6px;color:",w.r.colors.gray600,";font-size:13px;font-weight:bold;}input[type='tel'],input[type='number']{width:100%;padding:12px 16px;border:solid 1px ",w.r.colors.gray200,";background:#fff;border-radius:",w.r.borderRadius,";&[disabled]{background-color:",w.r.colors.gray100,";}}input[type='number']::-webkit-inner-spin-button,input[type='number']::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;}button{width:100%;}.error-message{display:block;padding-bottom:20px;color:",w.r.colors.red700,";font-weight:",w.r.sizes.fwRegular,";}.submit-btn{padding:12px 24px;background-color:",w.r.colors.primaryBase,";border-radius:",w.r.borderRadius,";color:#fff;cursor:pointer;font-size:16px;font-weight:700;line-height:24px;transition:background-color 0.3s,border-color 0.3s;display:flex;justify-content:center;&:hover{background-color:",w.r.colors.primaryHover,";}&[disabled]{background-color:",w.r.colors.gray200,";color:#bfbfbf;cursor:not-allowed;}.spinner{margin-right:20px;}}.submit-btn-row{",x.M.mbUp,"{margin-bottom:16px;}",x.M.tdDown,"{margin-bottom:14px;}",x.M.mbDown,"{margin-bottom:12px;}.subot-checkbox{display:flex;align-items:flex-start;margin:0;cursor:pointer;&__input{position:relative;display:block;overflow:hidden;width:18px;height:18px;box-sizing:border-box;padding:0;margin-right:10px;&:before{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;background-color:",w.r.colors.primaryBase,";background-image:url('",Z.Nr,"/checkbox.svg');background-position:center;background-repeat:no-repeat;background-size:120%;content:'';opacity:0;transition:0.3s all ease;}&:checked:before{opacity:1;transition:0.3s all ease;}}&__label{flex:1;font-weight:400;line-height:1.4;}}}}"),S=(0,k.Z)("div",{target:"e1hkw0jq1"})("position:relative;.PhoneInputCountry{background-color:#f2f2f2;.PhoneInputCountrySelectArrow{display:none !important;}}.icon-edit-phone{width:1em;height:1em;position:absolute;right:16px;top:17px;cursor:pointer;path{fill:",w.r.colors.gray600,";}}");o("CCFL");let OTPInfoForm=e=>{let{className:t,style:o,actions:l,countryCode:f,phoneNumber:k,areaCode:w,callBack:x}=e,Z=(0,a.useRef)(),[B,E]=(0,a.useState)(!1),[D,T]=(0,a.useState)(!1),[_,M]=(0,a.useState)(!1),[R,I]=(0,a.useState)(!1),{register:N,formState:{errors:A},control:L,trigger:z,getValues:U,setValue:F}=(0,d.cI)(),{formatMessage:O}=(0,c.Z)(),handleSendOTP=async e=>{e.preventDefault();let t=U(),o=(0,s.SR)(t.phone||"");if((null==o?void 0:o.nationalNumber)&&(null==o?void 0:o.countryCallingCode)){T(!0);try{var r;let e=await (0,p.t9)((0,g.jX)(u.y.SUBOT.POST_SEND_OTP),"POST",{data:{phone_number:o.nationalNumber,area_code:"+".concat(o.countryCallingCode)}});if(T(!1),(null==e?void 0:e._status)===1){R&&(E(!1),Z.current.reset()),I(!0),setTimeout(()=>{let e=document.querySelector(".input-otp-code");e&&(e.focus(),e.scrollIntoView({block:"center"}))},100);return}if((null==e?void 0:e._status)===0&&(null==e?void 0:null===(r=e._messages)||void 0===r?void 0:r[0])==="This phone number was verified"){Z.current&&Z.current.cancel(),(0,v.c)({title:"",message:"Số điện thoại n\xe0y đ\xe3 được x\xe1c minh.",type:"success"});let e=l.find(e=>e.type===m.fe.USER_SUBMIT_SEND);e&&x(e,t.phone);return}throw Error()}catch(e){T(!1),Z.current&&Z.current.cancel(),showMessageSomethingWrong()}}},handleOnVerify=async(e,t)=>{if(e.preventDefault(),M(!0),await z(),i()(A)){let e=U(),{number:o}=e,r=(0,s.SR)(e.phone||"");if((null==r?void 0:r.nationalNumber)&&(null==r?void 0:r.countryCallingCode))try{let a=await (0,p.t9)((0,g.jX)(u.y.SUBOT.POST_VERIFY_OTP),"POST",{data:{phone_number:r.nationalNumber,area_code:"+".concat(r.countryCallingCode),code:o}});if(M(!1),(null==a?void 0:a._status)===1){(0,v.c)({title:"",message:O({id:"subot.verifyOTP.success.message"}),type:"success"}),x(t,e.phone);return}throw Error()}catch(e){(0,v.c)({title:"",message:O({id:"validation.error.validOTP"}),type:"danger"}),M(!1)}}else M(!1)},showMessageSomethingWrong=()=>{(0,v.c)({title:"",message:O({id:"notification.comment.somethingWrong"}),type:"danger"})},renderFormInput=e=>{if(!e.key)return null;switch(e.type){case m.fe.USER_SUBMIT_PHONE:return(0,r.BX)("div",{className:"input-row",children:[(0,r.tZ)("label",{htmlFor:e.key,children:e.label}),(0,r.tZ)(d.Qr,{name:e.key,control:L,rules:{required:!0,validate:e=>(0,s.tm)(e)},render:t=>{let{field:{onChange:o,value:a}}=t,l=!B&&R||D;return(0,r.BX)(S,{children:[(0,r.tZ)(h.Is,{value:a,defaultValue:k,onChange:o,defaultCountry:f,id:e.id,className:"input-row ".concat(e.id),name:e.key,disabled:l,flagComponent:h.tz,placeholder:e.label}),l&&(0,r.tZ)(b(),{viewBox:"0 0 24 24",className:"icon-edit-phone",onClick:()=>{var e;o(""),I(!1),M(!1),null===(e=Z.current)||void 0===e||e.cancel()}}),e.key&&A[e.key]&&(0,r.tZ)("p",{className:"error-message",children:O({id:"validation.error.validNumber",defaultMessage:"Please enter a valid number."})}),(0,r.tZ)("div",{className:"submit-btn-row",children:(0,r.tZ)(n.B,{className:"submit-btn",size:"lg",onClick:handleSendOTP,isDisabled:!B&&R||D,isLoading:D,children:R?(0,r.tZ)(y.Z,{ref:Z,isFinished:B,onFinish:E}):(0,r.tZ)("span",{children:O({id:"subot.sendOTP.button",defaultMessage:"Send OTP"})})})},e.id)]})}})]},e.id);case m.fe.USER_SUBMIT_NUMBER:if(!R)return"";return(0,r.BX)("div",{className:"input-row",children:[(0,r.tZ)("label",{htmlFor:e.key,children:e.label}),(0,r.tZ)("input",{type:"tel",id:e.id,placeholder:e.label,...N(e.key,{required:!0,pattern:/^[0-9]{0,6}$/}),className:"input-otp-code"}),A[e.key]&&(0,r.tZ)("p",{className:"error-message",children:O({id:"validation.error.validOTP",defaultMessage:"Invalid OTP provided"})})]},e.id);default:return""}},renderFormSubmitAndTerms=e=>e.type===m.fe.USER_SUBMIT_SEND&&R?(0,r.tZ)("div",{className:"submit-btn-row",children:(0,r.tZ)(n.B,{className:"submit-btn",size:"lg",isDisabled:_,isLoading:_,onClick:t=>handleOnVerify(t,e),children:e.label})},e.id):"";return(0,a.useEffect)(()=>{if(k){let e=l.find(e=>e.type===m.fe.USER_SUBMIT_PHONE);e&&e.key&&F(e.key,"+".concat(w).concat(k))}},[k,w]),(0,r.tZ)(C,{className:t,style:o,children:(0,r.BX)("form",{className:"user-info-form",children:[l.map(e=>renderFormInput(e)),l.map(e=>renderFormSubmitAndTerms(e))]})})}},x8Vb:function(e,t,o){o.d(t,{q:function(){return OvulationCalculatorCard}});var r=o("BGKE"),a=o("q1tI"),n=o("Vitr"),l=o("iBNF"),i=o("Wgwc"),d=o.n(i),c=o("dDsW"),s=o("FQkf"),u=o.n(s),p=o("gGrW"),g=o.n(p),v=o("wnYK"),h=o("9/ee"),m=o("cfqT"),f=o("a4op"),b=o("hXNO"),y=o("tMVq"),k=o("rIrU"),w=o("rBCA"),x=o("odgB"),Z=o("HMwR");let C=(0,w.Z)("div",{target:"e14m8ex0"})("background-color:#fff;border:1px solid ",l.r.colors.neutral100,";position:relative;border-radius:",l.r.borderRadius,";&[data-in-range='none'],&[data-in-range='period']{.highlighted{color:",l.r.colors.pink700,";}}&[data-in-range='fertile']{.highlighted{color:",l.r.colors.green700,";}}.onboarding-calendar{.cal-nav-prev,.cal-nav-next{top:40px;}",Z.M.mbDown,"{max-width:476px;margin:auto;}}"),S=(0,w.Z)("div",{target:"e14m8ex1"})("position:absolute;top:53px;left:24px;min-height:100px;z-index:100;background-color:white;box-shadow:0px 10px 16px rgba(0,0,0,0.04),0px 2px 8px rgba(0,0,0,0.04),0px 0px 1px rgba(0,0,0,0.04);border-radius:",l.r.borderRadius,";"),B=(0,w.Z)("div",{target:"e14m8ex2"})(Z.M.mbDown,"{padding:8px 16px;display:flex;justify-content:center;}",Z.M.mbUp,"{padding:16px 24px;}"),E=(0,w.Z)("button",{target:"e14m8ex3"})("display:flex;gap:4px;align-items:center;cursor:pointer;padding:8px;border:1px solid;border-radius:",l.r.borderRadius,";font-size:14px;width:fit-content;font-weight:",l.r.sizes.fwBold,";&,> div,path{transition:all 0.2s linear;}",Z.M.mbDown,"{color:",l.r.colors.gray600,";border-color:transparent;}",Z.M.mbUp,"{color:",l.r.colors.gray800,";border-color:",l.r.colors.gray400,";&:hover,&[data-active='true']{color:",l.r.colors.white,";border-color:",l.r.colors.primary800,";background-color:",l.r.colors.primary800,";svg path{fill:",l.r.colors.white,";}}}"),D=(0,w.Z)("div",{target:"e14m8ex4"})("position:relative;display:flex;flex-direction:column;align-items:center;padding:24px;margin-top:20px;[data-in-range='none'] &{background-color:",l.r.colors.neutral50,";}[data-in-range='period'] &{background-color:rgba(255,241,246,0.5);}[data-avoid-pregnancy='false'][data-in-range='fertile'] &{background-color:#effbf6;}[data-avoid-pregnancy='true'][data-in-range='fertile'] &{background-color:#fcf4f3;}.risky{font-weight:bold;color:",l.r.colors.error,";}"),T=(0,w.Z)("button",{target:"e14m8ex5"})("position:absolute;right:16px;top:16px;width:32px;height:32px;border:1px solid ",l.r.colors.gray300,";border-radius:50%;cursor:pointer;display:flex;justify-content:center;align-items:center;"),_=(0,w.Z)("p",{target:"e14m8ex6"})("font-size:18px;font-weight:600;"),M=(0,w.Z)("p",{target:"e14m8ex7"})("padding:16px 0;font-size:32px;font-weight:bold;"),R=(0,w.Z)("p",{target:"e14m8ex8"})("font-size:16px;color:",l.r.colors.gray600,";.rate{font-weight:700;font-size:20px;}"),I=(0,w.Z)(x.B,{target:"e14m8ex9"})("margin-top:20px;color:",l.r.colors.primaryBase,";"),N=(0,w.Z)("div",{target:"e14m8ex10"})("display:flex;align-items:center;justify-content:center;height:56px;padding:0 8px;gap:4px;"),A=(0,w.Z)("div",{target:"e14m8ex11"})("flex:1;display:flex;align-items:center;justify-content:center;gap:6px;"),L=(0,w.Z)("div",{target:"e14m8ex12"})("width:16px;height:10px;border-radius:16px;&.badge--period{background-color:",l.r.colors.pink100,";}&.badge--fertile{background-color:",l.r.colors.green100,";}&.badge--ovulation{width:12px;height:12px;border:1.5px dashed ",l.r.colors.green700,";}[data-avoid-pregnancy='true'] &{&.badge--ovulation{border-color:",l.r.colors.error,";}}"),z=(0,w.Z)("div",{target:"e14m8ex13"})("font-size:12px;");function OvulationCalculatorCard(e){var t,o,i;let{calcObjective:s,className:p,startDate:w=new Date,selectedDate:x,calendarRanges:Z=[],ovulationDays:U=[],ovulationMarkers:F=[],onChangeStartDate:O,onChangeSelectedDate:X,onClickRecalculate:P}=e,{formatMessage:H}=(0,c.Z)(),Q=(0,b.d)(),{localize:V}=(0,f.k)(),[q,G]=(0,a.useState)(!1),[Y,j]=(0,a.useState)(!1),W=(0,a.useRef)(null),[K,J]=(0,a.useState)(!1);(0,y.t)(W,()=>{j(!1),O&&O(x)}),(0,a.useEffect)(()=>{q||window.scrollTo(0,0)},[q]);let $=(0,a.useMemo)(()=>{if(!V)return null;let e=w;return Y&&d()(x).isBetween(w,d()(w).add(2,"month"))&&(e=x),"".concat(V.month(e.getMonth(),{width:"abbreviated"})," ").concat(e.getFullYear())},[V,w,x,Y,H,Q]),ee=(0,a.useCallback)(e=>Z.filter(t=>"period"===t.rangeType&&d()(t.startDate).isAfter(e)).sort((e,t)=>e.startDate.getTime()-t.startDate.getTime())[0],[Z]),et=(0,a.useCallback)(e=>Z.find(t=>"period"===t.rangeType&&d()(e).isBetween(d()(t.startDate).subtract(1,"day"),d()(t.endDate).add(1,"day"),"day")),[Z]),eo=(0,a.useCallback)(e=>Z.find(t=>"fertile"===t.rangeType&&d()(e).isBetween(t.startDate,t.endDate)),[Z]),er=(0,a.useCallback)(e=>{let t=d()(e);return U.sort((e,o)=>Math.abs(t.diff(e,"day"))-Math.abs(t.diff(o,"day")))[0]},[U]),ea=(0,a.useCallback)(e=>U.some(t=>d()(t).isSame(e,"date")),[U]),en=(0,a.useCallback)((e,t)=>e?"period":t?"fertile":"none",[]);function renderBodyTitle1(e){let t=et(e),o=ee(e),r=ea(e),a=er(e),n=eo(e);if(t)return H({id:"health.ovulationCalculator.period"});if(s===k.Yo){if(o)return H({id:"health.ovulationCalculator.periodIn"})}else{if(r)return H({id:"health.ovulationCalculator.dayOf"});if(a&&n){let t=d()(a).diff(e,"day");return t>0?H({id:"health.ovulationCalculator.ovulationIn"}):H({id:"health.ovulationCalculator.periodIn"})}}if(o&&a){let t=d()(a).diff(e,"day");return t<0?H({id:"health.ovulationCalculator.periodIn"}):H({id:"health.ovulationCalculator.ovulationIn"})}return null}function renderBodyTitle2(e){let t;let o=et(e),r=ee(e),a=ea(e),n=er(e),l=eo(e);if(o)return H({id:"common.day.singular"},{day:d()(e).diff(o.startDate,"day")+1});if(s===k.Yo)r&&(t=d()(r.startDate).diff(e,"day"));else{if(a)return H({id:"health.ovulationCalculator.ovulation"});if(l){let o=d()(n).diff(e,"day");o>0?t=o:r&&(t=d()(r.startDate).diff(e,"day"))}}if(!t&&r&&n){let o=d()(n).diff(e,"day");t=o<0?d()(r.startDate).diff(e,"day"):o}return t?H({id:"common.day.".concat(1===t?"singular":"plural")},{day:t}):null}function renderBodyDetails(e){let t=et(e),o=er(e);if(s===k.CG){if(t)return(0,r.tZ)("span",{className:"low-risk",children:H({id:"ovulationPage.chanceVeryLow"})});if(o){let t=d()(o).diff(e,"day");if(0===t)return(0,r.tZ)("span",{className:"risky",children:H({id:"ovulationPage.chanceVeryRisky"})});if(t>=-1&&t<=5)return(0,r.tZ)("span",{className:"risky",children:H({id:"ovulationPage.chanceRisky"})})}return(0,r.tZ)("span",{className:"low-risk",children:H({id:"ovulationPage.chanceLow"})})}let a=2.1;if(t)a=1;else if(o){let t=d()(o).diff(e,"day");t>=-1&&t<=5&&(a=k.UX[t])}return(0,r.BX)("span",{children:[H({id:"ovulationPage.pregnancyRate"})," ",(0,r.BX)("span",{className:"rate highlighted",children:[a,"%"]})]})}function renderCalendar(e,t){return(0,r.tZ)(v.f,{mode:e,start:w,selected:x,onChangeStart:O,onChangeSelected:X,ranges:Z,markers:F,renderTooltip:"monthly"===e?renderTooltip:void 0,...t})}function renderTooltip(e){return(0,r.BX)(r.HY,{children:[(0,r.BX)(n.T,{size:"p2",color:l.r.colors.gray800,type:"bold",children:[renderBodyTitle1(e)," ",renderBodyTitle2(e)]}),(0,r.tZ)(n.T,{size:"p3",children:renderBodyDetails(e)})]})}return(0,r.BX)(C,{className:p,"data-in-range":en(et(x),eo(x)),"data-avoid-pregnancy":s===k.CG,children:[(0,r.tZ)("div",{children:Y&&(0,r.tZ)(S,{ref:W,children:renderCalendar("monthly")})}),(0,r.tZ)(B,{children:(0,r.BX)(E,{"data-active":Y,onClick:function(){Q?G(!0):j(!0)},children:[(0,r.tZ)(u(),{}),$]})}),renderCalendar("weekly",{className:"onboarding-calendar"}),(0,r.BX)(D,{children:[(0,r.tZ)(T,{onClick:()=>J(!0),children:(0,r.tZ)(g(),{})}),K&&(0,r.tZ)(h.F,{isMobile:Q,shareUrl:null!==(i=null===(o=window)||void 0===o?void 0:null===(t=o.location)||void 0===t?void 0:t.href)&&void 0!==i?i:"",onRecalculate:P,onClose:()=>J(!1)}),(0,r.tZ)(_,{className:"highlighted",children:renderBodyTitle1(x)}),(0,r.tZ)(M,{children:renderBodyTitle2(x)}),(0,r.tZ)(R,{children:renderBodyDetails(x)}),(0,r.tZ)(I,{onClick:P,color:"tertiary",size:"md",children:H({id:"health.ovulationCalculator.editPeriodDate"})})]}),(0,r.BX)(N,{children:[(0,r.BX)(A,{children:[(0,r.tZ)(L,{className:"badge--period"}),(0,r.tZ)(z,{children:H({id:"health.ovulationCalculator.period"})})]}),s!==k.Yo&&(0,r.BX)(r.HY,{children:[(0,r.BX)(A,{children:[(0,r.tZ)(L,{className:"badge--fertile"}),(0,r.tZ)(z,{children:H({id:"health.ovulationCalculator.fertile"})})]}),(0,r.BX)(A,{children:[(0,r.tZ)(L,{className:"badge--ovulation"}),(0,r.tZ)(z,{children:H({id:"health.ovulationCalculator.ovulation"})})]})]})]}),(0,r.tZ)("div",{children:q&&(0,r.tZ)(m.D,{onClose:function(){G(!1),O&&O(x)},startDate:w,ranges:Z,markers:F,selectedDate:x,onChangeSelectedDate:X,onChangeStartDate:O,renderTooltip:renderTooltip})})]})}},vplf:function(e,t,o){o.d(t,{j9:function(){return i}});var r=o("rBCA"),a=o("iBNF"),n=o("HMwR"),l=o("rIrU");a.r.colors.neutral200,l.uQ,a.r.colors.neutral200,l.uQ,a.r.colors.pink700,l.uQ,a.r.colors.pink700;let i=(0,r.Z)("div",{target:"e7yon21"})("display:flex;flex-direction:column;align-items:center;justify-content:center;",n.M.mbUp,"{margin-bottom:32px;}");a.r.colors.neutral50,a.r.borderRadius},SMvd:function(e,t,o){o.d(t,{L:function(){return BookingDays}});var r=o("BGKE"),a=o("q1tI"),n=o("Vitr"),l=o("iBNF"),i=o("/rh5"),d=o("25AQ"),c=o("JhOC"),s=o("dDsW"),u=o("i/U4"),p=o("a4op"),g=o("Sz1N"),v=o("TSYQ"),h=o.n(v),m=o("DzJC"),f=o.n(m),b=o("4Y4a"),y=o.n(b),k=o("aNTj");let ScrollList=e=>{let{children:t,className:o,numberOfItems:n,step:l}=e,i=(0,a.useRef)(null),[d,c]=(0,a.useState)("left"),[s,u]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{k.E.measure(()=>{i.current&&(i.current.scrollWidth<=i.current.clientWidth?s&&u(!1):s||u(!0))})},[i,t]),(0,a.useEffect)(()=>{var e;let checkScroll=()=>{k.E.measure(()=>{i.current&&(0===i.current.scrollLeft?c("left"):i.current.scrollLeft+i.current.clientWidth===i.current.scrollWidth?c("right"):c("mid"))})},t=f()(checkScroll,200);return null===(e=i.current)||void 0===e||e.addEventListener("scroll",t,{passive:!0}),checkScroll(),()=>{var e;null===(e=i.current)||void 0===e||e.removeEventListener("scroll",t)}},[]),(0,r.BX)(g.V$,{className:o,children:[(0,r.tZ)(y(),{className:h()("chevron","left",{disabled:!s||"left"===d}),onClick:()=>{k.E.measure(()=>{i.current&&i.current.scrollTo({left:i.current.scrollLeft-(l||(i.current.scrollWidth-i.current.clientWidth)/(n||3)),behavior:"smooth"})})}}),(0,r.tZ)(g.vA,{ref:i,children:t}),(0,r.tZ)(y(),{className:h()("chevron","right",{disabled:!s||"right"===d}),onClick:()=>{k.E.measure(()=>{i.current&&i.current.scrollTo({left:i.current.scrollLeft+(l||(i.current.scrollWidth-i.current.clientWidth)/(n||3)),behavior:"smooth"})})}})]})},BookingDays=e=>{var t;return(null===(t=e.schedules)||void 0===t?void 0:t.length)?(0,r.tZ)(_BookingDays,{...e}):null},_BookingDays=e=>{let{startDate:t,endDate:o,schedules:v,date:h,setDate:m,dataEventAction:f,dataEventCategory:b,dataEventLabel:y}=e,{formatMessage:k}=(0,s.Z)(),[w,x]=(0,a.useState)((0,u.Y7)(h)),Z=(0,a.useMemo)(()=>{try{return(0,i.Z)({start:t,end:o}).map(e=>{var t;let o=(0,u.Y7)(e);return{date:e,day:o,numberOfSlots:v&&(null===(t=v.find(e=>e.workingDay===o))||void 0===t?void 0:t.slots)||0}})}catch(e){}return[]},[v]);(0,a.useEffect)(()=>{x((0,u.Y7)(h))},[h]),(0,a.useEffect)(()=>{let e=Z.find(e=>{let{numberOfSlots:t}=e;return t>0}),t=[(null==e?void 0:e.date)||new Date,h].sort(c.Z);m(t[t.length-1]||new Date),x((0,u.Y7)(t[t.length-1]||new Date))},[Z]);let{locale:C}=(0,p.k)();return(0,a.useEffect)(()=>{setTimeout(()=>{let e=document.querySelector("[data-booking-day='".concat(w,"']"));null==e||e.scrollIntoView({behavior:"smooth"})},1e3)},[w]),(0,r.tZ)(ScrollList,{children:Z.map(e=>{let{date:t,day:o,numberOfSlots:a}=e;return(0,r.BX)(g.un,{"data-booking-day":o,"data-active":w===o,onClick:()=>{m(t)},"data-event-category":b,"data-event-action":f,"data-event-label":y,children:[(0,r.tZ)(n.T,{size:"xs",type:"caption",color:l.r.colors.gray600,style:{fontSize:12,whiteSpace:"nowrap"},children:(0,d.Z)(t,"EEE",{locale:C})}),(0,r.tZ)(n.T,{size:"md",type:"bold",color:l.r.colors.gray800,style:{fontSize:16,lineHeight:"18px"},children:t.getDate()}),(0,r.tZ)(n.T,{size:"xs",color:a>0?l.r.colors.green600:l.r.colors.gray400,style:{fontSize:12,whiteSpace:"nowrap"},children:k({id:a>0?"careBooking.numberOfSlotPlural":"careBooking.numberOfSlotSingular",defaultMessage:"".concat(a," slot").concat(a>0?"s":"")},{number:a})})]},o)})})}},r72T:function(e,t,o){o.d(t,{l:function(){return BookingTime}});var r=o("BGKE"),a=o("q1tI"),n=o("c212"),l=o("odgB"),i=o("dDsW"),d=o("Sz1N");let BookingTime=e=>{let{workingTimes:t}=e;return t?(0,r.tZ)(_BookingTime,{...e,workingTimes:t}):null},_BookingTime=e=>{let{workingTimes:t,scheduleId:o,setScheduleId:c,dataEventAction:s,dataEventCategory:u,dataEventLabel:p}=e,{formatMessage:g}=(0,i.Z)(),[v,h]=(0,a.useState)(0),[m,f]=(0,a.useState)([]),b=(0,a.useMemo)(()=>{let e=[],o=[];return t.morning&&(e.push({name:g({id:"common.morning",defaultMessage:"Morning"}).concat(" (".concat(t.morning.length,")"))}),o.push("morning")),t.afternoon&&(e.push({name:g({id:"common.afternoon",defaultMessage:"Afternoon"}).concat(" (".concat(t.afternoon.length,")"))}),o.push("afternoon")),t.evening&&(e.push({name:g({id:"common.evening",defaultMessage:"Evening"}).concat(" (".concat(t.evening.length,")"))}),o.push("evening")),f(o),e},[t,g]);return(0,a.useEffect)(()=>{c("")},[v]),(0,r.BX)(d.As,{children:[(0,r.tZ)(n.T,{className:"booking-time-tabs",tabContent:b,initialTab:v,onChange:h}),(0,r.tZ)(d.rR,{children:(t[m[v]]||[]).map(e=>(0,r.tZ)(l.B,{size:"md",color:o===e.scheduleId?"primary":"secondary",onClick:()=>c(e.scheduleId),dataEventAction:s,dataEventCategory:u,dataEventLabel:p,children:"".concat(e.started," - ").concat(e.ended)},e.scheduleId))})]})}},"5nB9":function(e,t,o){var r=o("BGKE"),a=o("OeEL"),n=o.n(a),l=o("Sz1N"),i=o("crQX");t.Z=e=>{let{logo:t,name:o,price:a,priceUnit:d,onEditClick:c}=e;return(0,r.BX)(l.up,{children:[(0,r.tZ)("img",{loading:"lazy",src:t,alt:o}),(0,r.tZ)(i.Z,{name:o,price:a,priceUnit:d,isDetail:!0}),(0,r.tZ)(n(),{className:"doctor-edit-icon",onClick:c})]})}},RehD:function(e,t,o){var r=o("BGKE"),a=o("Vitr"),n=o("kriW"),l=o("Sz1N"),i=o("J03+");t.Z=e=>{let{type:t,translationId:o="",href:d="",onClose:c}=e;return(0,r.BX)(r.HY,{children:[t===i.jE.DEFAULT&&(0,r.tZ)(l.G_,{children:(0,r.tZ)(n.Z,{id:o,defaultMessage:"We could not find any result. Click here to see more",tagName:"p",values:{a:function(e){return(0,r.tZ)("a",{href:d,onClick:c,target:"_blank",children:e})}}})}),t===i.jE.SEARCH&&(0,r.tZ)(a.T,{size:"xs",className:"no-result",children:(0,r.tZ)(n.Z,{id:"careBooking.noSearchResult",defaultMessage:"No matching result, please try another keyword or see more",tagName:"p",values:{a:function(e){return(0,r.tZ)("a",{href:d,onClick:c,target:"_blank",children:e})}}})})]})}},crQX:function(e,t,o){var r=o("BGKE"),a=o("Vitr"),n=o("iBNF"),l=o("20a2"),i=o("dDsW"),d=o("iz81"),c=o("Sz1N");t.Z=e=>{let{name:t,price:o,priceUnit:s,isDetail:u}=e,{formatMessage:p}=(0,i.Z)(),{locale:g="en-PH"}=(0,l.useRouter)();return(0,r.BX)(c.Tz,{children:[(0,r.tZ)(a.T,{size:"sm",type:"regular",className:u?"option-name":"",children:t}),(0,r.BX)(d.Kk,{children:[(0,r.tZ)("div",{className:"icon-price hospital-card-icon",children:(0,r.tZ)("img",{loading:"lazy",src:"/svg/price-green.svg",alt:"Price"})}),(0,r.tZ)("div",{className:"text-price",children:(0,r.BX)(a.T,{size:"c2",color:n.r.colors.green600,children:["".concat(Intl.NumberFormat(g).format(parseInt(o))," ").concat(s," "),p({id:"articlePage.careEmbedding.servicePrice",defaultMessage:"Service Price"})]})})]})]})}},KGmN:function(e,t,o){o.r(t),o.d(t,{default:function(){return containers_DoctorQuickBookingContainer}});var r=o("BGKE"),a=o("q1tI"),n=o("c212"),l=o("/CSP"),i=o("sEfC"),d=o.n(i),c=o("E+oP"),s=o.n(c),u=o("wUmw"),p=o("dDsW"),g=o("CJtR"),v=o("YbGd"),h=o("jdT+"),m=o("P5LW"),f=o("rIrU"),b=o("SMvd"),y=o("r72T"),k=o("5nB9"),w=o("RehD"),x=o("/rh5"),Z=o("09QT"),C=o("/tR3"),S=o("oQBk"),B=o("i/U4"),E=o("crQX");let useDoctor=(e,t,o,n,l,i,d,c,s)=>{let[u,p]=(0,a.useState)(!1),[g,v]=(0,a.useState)(!1),[h,m]=(0,a.useState)([]),[f,b]=(0,a.useState)(null),y=(0,a.useRef)(null),k=(0,a.useMemo)(()=>{try{var e;if(!Array.isArray(y.current)||!(y.current.length>0))return(0,x.Z)({start:new Date,end:new Date(t)});return(0,x.Z)({start:new Date,end:new Date((null===(e=y.current[0])||void 0===e?void 0:e.workingDay)||t)}).map(e=>{var t,o;let r=(0,B.Y7)(e),a=(null===(o=y.current)||void 0===o?void 0:null===(t=o.find(e=>e.workingDay===r))||void 0===t?void 0:t.slots)||0;if(!a||0===a)return e})}catch(e){}return[]},[y.current]),w=(0,a.useMemo)(()=>h.map(e=>({value:e.id,label:(0,r.tZ)(E.Z,{name:e.name,price:e.price,priceUnit:e.priceUnit}),icon:(0,r.tZ)("img",{loading:"lazy",src:e.avatar,alt:e.slug})})),[h]),D=(0,a.useMemo)(()=>h.find(e=>e.id===(null==i?void 0:i.value)),[h,i]),T=(0,a.useMemo)(()=>{var e;return null==f?void 0:null===(e=f.find(e=>e.workingDay===(0,B.Y7)(c||new Date)))||void 0===e?void 0:e.workingTimes},[f,c]);return(0,a.useEffect)(()=>{if(!(null==l?void 0:l.value)){b(null);return}(async()=>{var e;p(!0);let t=await (0,Z.d)(S.y.CARE.GET_DOCTOR_LIST,{params:{cityId:(null==o?void 0:o.value)||"",hospitalBranchId:null==l?void 0:l.value,random:1,specialtyId:null==n?void 0:n.value,keyword:d&&d.length>=3?d:""}},"care"),r=(null==t?void 0:null===(e=t._data)||void 0===e?void 0:e.doctors)?t._data.doctors.map(C.XR):null;Array.isArray(r)&&(null==n?void 0:n.value)&&(null==l?void 0:l.value)&&m(r),p(!1)})()},[null==n?void 0:n.value,null==l?void 0:l.value,d.length>=3?d:""]),(0,a.useEffect)(()=>{if(!(null==i?void 0:i.value)&&!(null==i?void 0:i.id)){b(null);return}(async()=>{v(!0);let[o,r]=await Promise.all([(0,Z.d)(S.y.CARE.GET_DOCTOR_SCHEDULE,{params:{id:String((null==i?void 0:i.value)||(null==i?void 0:i.id)),startDate:(0,B.Y7)(e),endDate:(0,B.Y7)(t)}},"care"),(0,Z.d)(S.y.CARE.GET_DOCTOR_SCHEDULE,{params:{id:String((null==i?void 0:i.value)||(null==i?void 0:i.id)),startDate:(0,B.Y7)(e)}},"care")]);if((null==r?void 0:r._data)&&(y.current=r._data.schedules?r._data.schedules.map(C.cv):null),null==o?void 0:o._data){var a;b((null==o?void 0:null===(a=o._data)||void 0===a?void 0:a.schedules)?o._data.schedules.map(C.cv):null)}v(!1)})()},[i,null==i?void 0:i.value,(0,B.Y7)(e)]),(0,a.useEffect)(()=>{(null==i?void 0:i.value)||(null==i?void 0:i.id)||b(null)},[null==i?void 0:i.value,s]),{list:h,loading:u,scheduleLoading:g,options:w,currentValue:D,notFound:!h.length,schedule:f,workingTime:T,disabledDays:k,allSchedule:y.current}},useHospital=(e,t,o,n)=>{let[l,i]=(0,a.useState)(!1),[d,c]=(0,a.useState)([]),s=(0,a.useMemo)(()=>d.map(e=>({...e,value:e.id,label:e.name,icon:(0,r.tZ)("img",{loading:"lazy",src:e.logo,alt:e.slug})})),[d]),u=(0,a.useMemo)(()=>d.find(e=>e.value===(null==n?void 0:n.value)),[d,n]);return(0,a.useEffect)(()=>{(null==e?void 0:e.value)&&(async()=>{var r;i(!0);let a=await (0,Z.d)(S.y.CARE.GET_SEARCH_CARE,{params:{cityId:(null==t?void 0:t.value)||"",doctorSpecialtyId:null==e?void 0:e.value,type:"hospital",keyword:o&&o.length>=3?o:""}},"care"),n=null==a?void 0:null===(r=a._data)||void 0===r?void 0:r.searches;Array.isArray(n)&&c(n),i(!1)})()},[null==e?void 0:e.value,o.length>=3?o:""]),{list:d,loading:l,options:s,currentValue:u,notFound:!d.length}},useSpecialty=(e,t,o)=>{let[n,l]=(0,a.useState)(!1),[i,d]=(0,a.useState)([]),c=(0,a.useMemo)(()=>i.map(e=>({...e,value:e.id,label:e.name,icon:(0,r.tZ)("img",{loading:"lazy",src:e.thumbnail,alt:e.slug})})),[i]),s=(0,a.useMemo)(()=>i.find(e=>e.value===(null==o?void 0:o.value)),[i,o]);return(0,a.useEffect)(()=>{(null==e?void 0:e.value)&&(async()=>{var o;l(!0);let r=await (0,Z.d)(S.y.CARE.GET_SEARCH_CARE,{params:{cityId:(null==e?void 0:e.value)||"",keyword:t&&t.length>=3?t:"",type:"global"}},"care"),a=null==r?void 0:null===(o=r._data)||void 0===o?void 0:o.specialties;Array.isArray(a)&&d(a),l(!1)})()},[null==e?void 0:e.value,t.length>=3?t:""]),{list:i,loading:n,options:c,currentValue:s,notFound:!i.length}};var D=o("oBJH"),T=o("Sz1N"),_=o("J03+"),containers_DoctorQuickBookingContainer=e=>{var t;let{data:o,onClose:i,onSubmit:c,careType:x}=e,{formatMessage:Z}=(0,p.Z)(),{locale:C,router:{query:{currentUrl:S}}}=(0,m.h)(),[B,E]=(0,a.useState)(""),[M,R]=(0,a.useState)(""),[I,N]=(0,a.useState)(""),A=d()(e=>E(e),300),L=d()(e=>R(e),300),z=d()(e=>N(e),300),U=(0,a.useRef)(!s()(o)),[F,O]=(0,a.useState)(!0),{control:X,watch:P,setValue:H}=(0,u.Gc)(),Q=P("selected_city"),V=P("date"),q=P("selected_specialty"),G=P("selected_hospital"),Y=P("selected_doctor"),j=P("selected_schedule"),{date:W,setDate:K,startDate:J,endDate:$,dateMonthValue:ee}=(0,D.Y)(V),et=(0,a.useMemo)(()=>(null==j?void 0:j.value)?3:(null==Y?void 0:Y.value)||(null==Y?void 0:Y.id)?2:(null==G?void 0:G.value)?1:(null==q?void 0:q.value)?0:-1,[null==Q?void 0:Q.value,null==q?void 0:q.value,null==G?void 0:G.value,null==Y?void 0:Y.value,null==Y?void 0:Y.id,null==j?void 0:j.value]);(0,a.useEffect)(()=>{U.current||(H("selected_specialty",f.XL),E(""))},[null==Q?void 0:Q.value]),(0,a.useEffect)(()=>{U.current||(H("selected_hospital",f.XL),R(""))},[null==q?void 0:q.value,null==Q?void 0:Q.value]),(0,a.useEffect)(()=>{U.current||(H("selected_doctor",f.XL),N(""))},[null==G?void 0:G.value]),(0,a.useEffect)(()=>{U.current||H("selected_schedule","")},[null==Y?void 0:Y.value]),(0,a.useEffect)(()=>{H("date",W),c()},[j]);let eo=useSpecialty(Q,B,q),er=useHospital(q,Q,M,G),ea=useDoctor(J,$,Q,q,G,Y,I,W,x);(0,a.useEffect)(()=>{O(!1)},[]),(0,a.useEffect)(()=>{if(o){var e,t,r,a,n,l;((null===(e=o.specialty)||void 0===e?void 0:e.id)||(null===(t=o.hospital)||void 0===t?void 0:t.id)||(null===(r=o.doctor)||void 0===r?void 0:r.id))&&(U.current=!0),(null===(a=o.specialty)||void 0===a?void 0:a.id)&&H("selected_specialty",{...o.specialty,value:o.specialty.id||"",label:o.specialty.name||""}),(null===(n=o.hospital)||void 0===n?void 0:n.id)&&H("selected_hospital",{...o.hospital,value:o.hospital.id,label:o.hospital.name||""}),(null===(l=o.doctor)||void 0===l?void 0:l.id)&&H("selected_doctor",{...o.doctor,value:o.doctor.id,label:o.doctor.name||""}),setTimeout(()=>{U.current=!1},1e3)}},[o]),(0,a.useEffect)(()=>{!U.current&&Array.isArray(ea.list)&&ea.list.length>=1&&H("selected_doctor",{...ea.list[0]})},[ea.list]);let en=[{title:Z({id:"careBooking.selectSpecialty",defaultMessage:"Select specialty"}),isLoading:eo.loading,content:(0,r.tZ)(u.Qr,{name:"selected_specialty",control:X,render:e=>{let{field:{onChange:t,value:o}}=e;return(0,r.BX)(T.mF,{children:[(0,r.tZ)(v.s,{dropdownLabelTrackingAttributes:{"data-event-category":"Care","data-event-action":"Doctor Quick Booking - Specialty Click","data-event-label":S},className:"booking-select",id:"select-specialty",options:eo.options,value:o,placeholderIcon:(null==q?void 0:q.icon)||(0,r.tZ)(T.tv,{src:"".concat(f.Nr,"/search.svg")}),onChange:t,onSearchChange:A,placeholder:eo.notFound?Z({id:"common.noResultFound",defaultMessage:"No result found"}):Z({id:"careBooking.selectSpecialty",defaultMessage:"Select Specialty"}),useSearchFilter:!1,disabled:!(null==Q?void 0:Q.value)||eo.notFound&&!B}),eo.notFound&&!eo.loading&&(0,r.tZ)(w.Z,{type:_.jE.SEARCH,href:"".concat((0,g.Em)({locale:C})),onClose:i})]})}})},{title:Z({id:"careBooking.selectHospital",defaultMessage:"Select hospital"}),isLoading:er.loading,content:(0,r.tZ)(u.Qr,{name:"selected_hospital",control:X,render:e=>{let{field:{onChange:t,value:a}}=e;return(0,r.BX)(T.mF,{children:[(0,r.tZ)(v.s,{dropdownLabelTrackingAttributes:{"data-event-category":"Care","data-event-action":"Doctor Quick Booking - Hospital Click","data-event-label":S},className:"booking-select",id:"select-hospital",options:er.options,value:a,placeholderIcon:(null==G?void 0:G.icon)||(null==G?void 0:G.logo)&&(0,r.tZ)("img",{loading:"lazy",src:null==G?void 0:G.logo,alt:null==G?void 0:G.slug})||(0,r.tZ)(T.tv,{src:"".concat(f.Nr,"/search.svg")}),onChange:t,onSearchChange:L,placeholder:er.notFound&&!M&&(null==q?void 0:q.value)?Z({id:"common.noResultFound",defaultMessage:"No result found"}):Z({id:"careBooking.selectHospital",defaultMessage:"Select hospital"}),disabled:!(null==q?void 0:q.value)||(er.loading||er.notFound)&&!M,useSearchFilter:!1}),s()(o)&&er.notFound&&!er.loading&&q&&q.value&&(M?(0,r.tZ)(w.Z,{type:_.jE.SEARCH,href:"".concat((0,g.uf)({locale:C,slug:q.slug,citySlug:Q.slug||Q.label})),onClose:i}):(0,r.tZ)(w.Z,{type:_.jE.DEFAULT,translationId:"careBooking.noHospitalLabel",href:"".concat((0,g.uf)({locale:C,slug:q.slug})),onClose:i}))]})}})},{title:Z({id:"careBooking.selectDoctor",defaultMessage:"Select doctor"}),isLoading:ea.loading,content:(0,r.tZ)(u.Qr,{name:"selected_doctor",control:X,render:e=>{var t,a;let{field:{onChange:n,value:l}}=e;return(0,r.BX)(T.mF,{children:[(0,r.tZ)(v.s,{dropdownLabelTrackingAttributes:{"data-event-category":"Care","data-event-action":"Doctor Quick Booking - Doctor Click","data-event-label":S},className:"booking-select",id:"select-doctor",options:ea.options,value:l,onChange:n,onSearchChange:z,placeholderIcon:(0,r.tZ)(T.tv,{src:"".concat(f.Nr,"/search.svg")}),placeholder:ea.notFound&&!I&&(null==G?void 0:G.value)?Z({id:"common.noResultFound",defaultMessage:"No result found"}):Z({id:"careBooking.selectDoctor",defaultMessage:"Select doctor"}),disabled:!(null==G?void 0:G.value)||(ea.loading||ea.notFound)&&!I,useSearchFilter:!1}),((null==Y?void 0:Y.id)||ea.currentValue)&&(0,r.tZ)(k.Z,{logo:Y.avatar||ea.currentValue.avatar,name:Y.name||ea.currentValue.name,price:(null==Y?void 0:Y.price)||ea.currentValue.price,priceUnit:Y.priceUnit||"",onEditClick:()=>H("selected_doctor",f.XL)}),s()(o)&&ea.notFound&&!ea.loading&&G&&G.value&&(I?(0,r.tZ)(w.Z,{type:_.jE.SEARCH,href:"".concat((0,g.D4)({id:G.id,name:G.name,locale:C,slug:G.slug}),"?tab=").concat(null===(a=f.a8[C])||void 0===a?void 0:a.DOCTOR),onClose:i}):(0,r.tZ)(w.Z,{type:_.jE.DEFAULT,translationId:"careBooking.noDoctorLabel",href:"".concat((0,g.D4)({id:G.id,name:G.name,locale:C,slug:G.slug}),"?tab=").concat(null===(t=f.a8[C])||void 0===t?void 0:t.DOCTOR),onClose:i}))]})}})},{title:Z({id:"careBooking.selectTime",defaultMessage:"Select time"}),isLoading:ea.scheduleLoading,content:(0,r.tZ)("div",{style:{paddingBottom:16}})}];return(0,r.tZ)(r.HY,{children:!F&&(0,r.BX)(r.HY,{children:[(0,r.tZ)(T.To,{children:(0,r.tZ)(h.R,{steps:en,currentStep:et})}),(0,r.BX)(T.oR,{children:[(0,r.tZ)(n.D,{className:"booking-date",customInput:e=>(0,r.tZ)(l.I,{type:"text",size:"md",name:"booking-date",...e,value:ee,isDisabled:!(null==G?void 0:G.value)||!ea.schedule||ea.scheduleLoading,actionIcon:(0,r.tZ)("img",{loading:"lazy",src:"/svg/calendar-simple.svg",alt:""}),readOnly:!0,trackingAttributes:{dataEventCategory:"Care",dataEventAction:"Doctor Quick Booking - Appointment Click",dataEventLabel:S}}),disabledDays:[...null!==(t=ea.disabledDays)&&void 0!==t?t:[],{before:new Date,after:Array.isArray(ea.allSchedule)&&ea.allSchedule.length>0?new Date(ea.allSchedule[0].workingDay):$}],locale:C,pickedDate:W,displayDateFormat:f.c7,onChange:e=>{K(e)},placeholder:""}),((null==Y?void 0:Y.value)||(null==Y?void 0:Y.id))&&(0,r.BX)(r.HY,{children:[(0,r.tZ)(b.L,{startDate:J,endDate:$,schedules:ea.schedule,date:W,setDate:K,locale:C,dataEventCategory:"Care",dataEventAction:"Doctor Quick Booking - Appointment Click",dataEventLabel:S}),(0,r.tZ)(y.l,{workingTimes:ea.workingTime,scheduleId:j,setScheduleId:e=>H("selected_schedule",e),dataEventCategory:"Care",dataEventAction:"Doctor Quick Booking - Appointment Click",dataEventLabel:S})]})]})]})})}},LqwN:function(e,t,o){o.r(t),o.d(t,{default:function(){return containers_ServiceQuickBookingContainer}});var r=o("BGKE"),a=o("q1tI"),n=o("c212"),l=o("/CSP"),i=o("sEfC"),d=o.n(i),c=o("E+oP"),s=o.n(c),u=o("wUmw"),p=o("dDsW"),g=o("CJtR"),v=o("YbGd"),h=o("jdT+"),m=o("P5LW"),f=o("rIrU"),b=o("SMvd"),y=o("r72T"),k=o("5nB9"),w=o("RehD"),x=o("/rh5"),Z=o("q1s5"),C=o("09QT"),S=o("/tR3"),B=o("oQBk"),E=o("i/U4"),D=o("crQX");let useService=(e,t,o,n,l,i,d,c)=>{let[s,u]=(0,a.useState)(!1),[p,g]=(0,a.useState)(!1),[v,h]=(0,a.useState)([]),[m,f]=(0,a.useState)(null),b=(0,a.useRef)(null),y=(0,a.useMemo)(()=>{try{var e;if(!Array.isArray(b.current)||!(b.current.length>0))return(0,x.Z)({start:new Date,end:new Date(t)});return(0,x.Z)({start:new Date,end:(0,Z.Z)(new Date((null===(e=b.current[0])||void 0===e?void 0:e.workingDay)||t),{days:1})}).map(e=>{var t,o;let r=(0,E.Y7)(e),a=(null===(o=b.current)||void 0===o?void 0:null===(t=o.find(e=>e.workingDay===r))||void 0===t?void 0:t.slots)||0;if(!a||0===a)return e})}catch(e){}return[]},[b.current]),k=(0,a.useMemo)(()=>v.map(e=>{var t,o,a,n;return{...e,value:(null===(t=e.hospital)||void 0===t?void 0:t.id)||e.id,label:(0,r.tZ)(D.Z,{name:(null===(o=e.hospital)||void 0===o?void 0:o.name)||e.name,price:e.price,priceUnit:e.priceUnit}),icon:(0,r.tZ)("img",{loading:"lazy",src:(null===(a=e.hospital)||void 0===a?void 0:a.logo)||e.logo,alt:(null===(n=e.hospital)||void 0===n?void 0:n.name)||e.name,className:"hospital-image"})}}),[v]),w=(0,a.useCallback)(()=>v.find(e=>"hospital"in e?e.hospital.id===(null==l?void 0:l.value):e.id===(null==l?void 0:l.value)),[v,null==l?void 0:l.value]),T=(0,a.useMemo)(()=>w()?w():(null==l?void 0:l.value)?l:void 0,[w,null==l?void 0:l.value,null==o?void 0:o.value]),_=(0,a.useMemo)(()=>{var e;return null==m?void 0:null===(e=m.find(e=>e.workingDay===(0,E.Y7)(d||new Date)))||void 0===e?void 0:e.workingTimes},[m,d]);return(0,a.useEffect)(()=>{(null==n?void 0:n.value)&&(null==n?void 0:n.value)!==""&&(async()=>{u(!0);let e=await (0,C.d)(B.y.CARE.GET_SEARCH_CARE,{params:{cityId:(null==o?void 0:o.value)||"",type:"service",serviceId:null==n?void 0:n.value,hospitalBranchName:i&&i.length>=3?i:""}},"care").then(e=>{var t;return(null==e?void 0:null===(t=e._data)||void 0===t?void 0:t.searches.map(S.Yo))||[]});h(e),u(!1)})()},[null==n?void 0:n.value,null==o?void 0:o.value,i&&i.length>=3?i:""]),(0,a.useEffect)(()=>{(null==l?void 0:l.value)&&(null==l?void 0:l.value)!==""||f([]),(async()=>{if(null==l?void 0:l.id){g(!0);let[r,a]=await Promise.all([(0,C.d)(B.y.CARE.GET_SERVICE_SCHEDULE,{params:{serviceId:String(null==l?void 0:l.id),startDate:(0,E.Y7)(e),endDate:(0,E.Y7)(t)}},"care"),(0,C.d)(B.y.CARE.GET_SERVICE_SCHEDULE,{params:{serviceId:String(null==l?void 0:l.id),startDate:(0,E.Y7)(e)}},"care")]);if((null==a?void 0:a._data)&&(b.current=a._data.schedules?a._data.schedules.map(S.ph):null),null==r?void 0:r._data){var o;f((null==r?void 0:null===(o=r._data)||void 0===o?void 0:o.schedules)?r._data.schedules.map(S.ph):null)}g(!1)}})()},[null==l?void 0:l.value,(0,E.Y7)(e)]),(0,a.useEffect)(()=>{f(null)},[null==l?void 0:l.value,c]),{list:v,loading:s,scheduleLoading:p,options:k,currentValue:T,notFound:!v.length,schedule:m,workingTime:_,disabledDays:y,allSchedule:b.current}},useServiceType=(e,t,o)=>{let[n,l]=(0,a.useState)(!1),[i,d]=(0,a.useState)([]),c=(0,a.useMemo)(()=>i.map(e=>({value:e.id,label:e.name,icon:(0,r.tZ)("img",{loading:"lazy",src:e.logo||f.A4,alt:e.slug})})),[i]),s=(0,a.useMemo)(()=>c.find(e=>e.value===(null==o?void 0:o.value))?c.find(e=>e.value===(null==o?void 0:o.value)):(null==o?void 0:o.value)?{value:o.value,label:o.label,icon:(0,r.tZ)("img",{loading:"lazy",src:o.logo||f.A4,alt:o.slug})}:void 0,[c,null==o?void 0:o.value,null==e?void 0:e.value]);return(0,a.useEffect)(()=>{(null==e?void 0:e.value)&&(async()=>{l(!0);let e=await (0,C.d)(B.y.CARE.GET_CARE_SERVICE_TYPE_DETAIL,{params:{keyword:t&&t.length>=3?t:""}},"care").then(e=>{var t;return(null==e?void 0:null===(t=e._data)||void 0===t?void 0:t.service_types)||[]});d(e),l(!1)})()},[null==e?void 0:e.value,t.length>=3?t:""]),{list:i,loading:n,options:c,currentValue:s,notFound:!i.length}};var T=o("oBJH"),_=o("Sz1N"),M=o("J03+"),containers_ServiceQuickBookingContainer=e=>{var t;let{data:o,onClose:i,onSubmit:c,careType:x}=e,{formatMessage:Z}=(0,p.Z)(),{locale:C,router:{query:{currentUrl:S}}}=(0,m.h)(),[B,E]=(0,a.useState)(""),[D,R]=(0,a.useState)(""),I=d()(e=>E(e),300),N=d()(e=>R(e),300),A=(0,a.useRef)(!s()(o)),{control:L,watch:z,setValue:U}=(0,u.Gc)(),F=z("selected_city"),O=z("date"),X=z("selected_service_type"),P=z("selected_service"),H=z("selected_service_schedule"),{date:Q,setDate:V,startDate:q,endDate:G,dateMonthValue:Y}=(0,T.Y)(O),j=(0,a.useMemo)(()=>(null==H?void 0:H.value)?2:(null==P?void 0:P.value)?1:(null==X?void 0:X.value)?0:-1,[null==F?void 0:F.value,null==H?void 0:H.value,null==P?void 0:P.value,null==X?void 0:X.value]);(0,a.useEffect)(()=>{A.current||(U("selected_service_type",f.XL),E(""))},[null==F?void 0:F.value]),(0,a.useEffect)(()=>{A.current||(U("selected_service",f.XL),R(""))},[null==X?void 0:X.value]),(0,a.useEffect)(()=>{A.current||U("selected_service_schedule","")},[null==P?void 0:P.value]),(0,a.useEffect)(()=>{U("date",Q),c()},[H]);let[W,K]=(0,a.useState)(!0);(0,a.useEffect)(()=>{K(!1)},[]),(0,a.useEffect)(()=>{s()(o)&&x===M.yU.SERVICE&&(U("date",Q),U("selected_service_type",f.XL),U("selected_service",f.XL),U("selected_service_schedule",""),U("selected_specialty",f.XL),U("selected_hospital",f.XL),U("selected_doctor",f.XL),U("selected_schedule",""))},[]),(0,a.useEffect)(()=>{if(o&&!s()(o)){var e,t,r,a;((null===(e=o.service)||void 0===e?void 0:e.id)||(null===(t=o.serviceType)||void 0===t?void 0:t.id))&&(A.current=!0),(null===(r=o.serviceType)||void 0===r?void 0:r.id)&&U("selected_service_type",{...o.serviceType,value:o.serviceType.id||"",label:o.serviceType.name||""}),(null===(a=o.service)||void 0===a?void 0:a.id)&&U("selected_service",{...o.service,value:o.service.id,label:o.service.name||""}),setTimeout(()=>{A.current=!1},1e3)}},[o]);let J=useServiceType(F,B,X),$=useService(q,G,F,X,P,D,Q,x),ee=[{title:Z({id:"careBooking.selectService",defaultMessage:"Select a service"}),isLoading:J.loading,content:(0,r.tZ)(u.Qr,{name:"selected_service_type",control:L,render:e=>{var t;let{field:{onChange:o,value:a}}=e;return(0,r.BX)(_.mF,{children:[(0,r.tZ)(v.s,{dropdownLabelTrackingAttributes:{"data-event-category":"Care","data-event-action":"Service Quick Booking - Service Click","data-event-label":S},className:"booking-select",id:"select-service",options:J.options,value:a,onChange:o,placeholderIcon:(null===(t=J.currentValue)||void 0===t?void 0:t.icon)||(0,r.tZ)(_.tv,{src:"".concat(f.Nr,"/search.svg")}),onSearchChange:I,placeholder:J.notFound?Z({id:"common.noResultFound",defaultMessage:"No result found"}):Z({id:"careBooking.selectService",defaultMessage:"Select a service"}),useSearchFilter:!1,disabled:!(null==F?void 0:F.value)||J.notFound&&!B}),J.notFound&&!J.loading&&F&&F.value&&(0,r.tZ)(w.Z,{type:M.jE.SEARCH,href:"".concat((0,g.qQ)({locale:C,citySlug:F.slug||F.label})),onClose:i})]})}})},{title:Z({id:"careBooking.selectHospital",defaultMessage:"Select hospital"}),isLoading:$.loading,content:(0,r.tZ)(u.Qr,{name:"selected_service",control:L,render:e=>{var t,o;let{field:{onChange:a,value:n}}=e;return(0,r.BX)(_.mF,{children:[(0,r.tZ)(v.s,{dropdownLabelTrackingAttributes:{"data-event-category":"Care","data-event-action":"Service Quick Booking - Hospital Click","data-event-label":S},className:"booking-select",id:"select-hospital",style:{visibility:$.currentValue?"hidden":"visible"},options:$.options,value:n,placeholderIcon:(null==P?void 0:P.icon)||(0,r.tZ)(_.tv,{src:"".concat(f.Nr,"/search.svg")}),onChange:a,onSearchChange:N,placeholder:Z({id:"careBooking.selectHospital",defaultMessage:"Select hospital"}),useSearchFilter:!1,disabled:!(null==X?void 0:X.value)||(null==X?void 0:X.value)===""||$.loading||!D&&""!==D}),$.currentValue&&(0,r.tZ)(k.Z,{logo:(null===(t=$.currentValue.hospital)||void 0===t?void 0:t.logo)||$.currentValue.logo,name:(null===(o=$.currentValue.hospital)||void 0===o?void 0:o.name)||$.currentValue.name,price:$.currentValue.price,priceUnit:$.currentValue.priceUnit,onEditClick:()=>U("selected_service",f.XL)}),$.notFound&&!$.loading&&X&&X.value&&(D?(0,r.tZ)(w.Z,{type:M.jE.SEARCH,href:"".concat((0,g.qQ)({locale:C,citySlug:(null==F?void 0:F.slug)||(null==F?void 0:F.label)})),onClose:i}):(0,r.tZ)(w.Z,{type:M.jE.DEFAULT,translationId:"careBooking.noHospitalLabel",href:"".concat((0,g.qQ)({locale:C,citySlug:(null==F?void 0:F.slug)||(null==F?void 0:F.label)})),onClose:i}))]})}})},{title:Z({id:"careBooking.selectTime",defaultMessage:"Select time"}),isLoading:$.scheduleLoading,content:(0,r.tZ)("div",{style:{paddingBottom:16}})}];return(0,r.tZ)(r.HY,{children:!W&&(0,r.BX)(r.HY,{children:[(0,r.tZ)(_.To,{children:(0,r.tZ)(h.R,{steps:ee,currentStep:j})}),(0,r.BX)(_.oR,{children:[(0,r.tZ)(n.D,{className:"booking-date",customInput:e=>(0,r.tZ)(l.I,{type:"text",size:"md",name:"booking-date",...e,value:Y,isDisabled:!(null==P?void 0:P.value),actionIcon:(0,r.tZ)("img",{loading:"lazy",src:"/svg/calendar-simple.svg",alt:""}),readOnly:!0,trackingAttributes:{dataEventCategory:"Care",dataEventAction:"Service Quick Booking - Appointment Click",dataEventLabel:S}}),disabledDays:[...null!==(t=$.disabledDays)&&void 0!==t?t:[],{before:new Date,after:Array.isArray($.allSchedule)&&$.allSchedule.length>0?new Date($.allSchedule[0].workingDay):G}],locale:C,pickedDate:Q,displayDateFormat:f.c7,onChange:e=>V(e)}),(0,r.tZ)(b.L,{startDate:q,endDate:G,schedules:$.schedule,date:Q,setDate:V,locale:C,dataEventCategory:"Care",dataEventAction:"Service Quick Booking - Appointment Click",dataEventLabel:S}),(0,r.tZ)(y.l,{workingTimes:$.workingTime,scheduleId:H,setScheduleId:e=>U("selected_service_schedule",e),dataEventCategory:"Care",dataEventAction:"Service Quick Booking - Appointment Click",dataEventLabel:S})]})]})})}},oBJH:function(e,t,o){o.d(t,{Y:function(){return useDate}});var r=o("q1tI"),a=o("L8hi"),n=o("IjAw"),l=o("EhJz"),i=o("1i5A"),d=o("a4op"),c=o("rIrU");let useDate=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,[t,o]=(0,r.useState)(e),{localize:s}=(0,d.k)(),u=(0,r.useMemo)(()=>(0,a.Z)(t,{weekStartsOn:1}),[t]),p=(0,r.useMemo)(()=>{let e=(0,n.Z)(u,{days:1-c.dy}),t=new Date;return(0,l.Z)(e,t)||(0,i.Z)(e,t)?e:t},[u]),g=(0,r.useMemo)(()=>"".concat(s.month(t.getMonth(),{width:"wide"})," ").concat(t.getFullYear()),[s,t]);return{date:t,setDate:o,startDate:p,endDate:u,dateMonthValue:g}}},Sz1N:function(e,t,o){o.d(t,{As:function(){return m},G_:function(){return y},HA:function(){return x},I:function(){return s},To:function(){return d},Tz:function(){return w},UX:function(){return b},V$:function(){return g},mF:function(){return u},oR:function(){return c},qH:function(){return i},rR:function(){return f},t6:function(){return l},tv:function(){return k},un:function(){return h},up:function(){return p},vA:function(){return v}});var r=o("rBCA"),a=o("iBNF"),n=o("HMwR");let l=(0,r.Z)("form",{target:"e1oqgwk50"})("position:relative;/* overflow:auto;*/\n flex:1;::-webkit-scrollbar{display:none;}"),i=(0,r.Z)("div",{target:"e1oqgwk51"})("position:sticky;z-index:1;top:0;display:flex;height:40px;align-items:center;padding:0 24px;background-color:",a.r.colors.primary50,";input{padding-left:8px;border:none;font-weight:",a.r.sizes.fwSemiBold," !important;color:",a.r.colors.secondaryDark,";&:focus,&:active{border:none;box-shadow:none;}}#location-dropdown{min-width:180px;&,&:hover{border:none;box-shadow:none;}> div > span{font-weight:",a.r.sizes.fwSemiBold,";}ul{z-index:",a.r.zIndexes.onTop,";background-color:",a.r.colors.white,";li{padding-block:8px !important;}}}"),d=(0,r.Z)("div",{target:"e1oqgwk52"})("padding:8px 16px 0;.booking-select{&[data-has-icons='true']{border:1px solid ",a.r.colors.gray200,";&:not([data-disabled='true']){background-color:",a.r.colors.white,";}}ul{z-index:",a.r.zIndexes.onTop,";max-height:304px;background-color:",a.r.colors.white,";box-shadow:-4px 4px 8px rgba(67,86,100,0.102956),-8px 8px 16px rgba(67,86,100,0.0780977);overflow-y:scroll;img{object-fit:contain;}}/* span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-right:10px;}*/}"),c=(0,r.Z)("div",{target:"e1oqgwk53"})("padding:16px 24px;background-color:",a.r.colors.neutral50,";input{background-color:",a.r.colors.white,";cursor:pointer;}"),s=(0,r.Z)("div",{target:"e1oqgwk54"})("position:sticky;bottom:0;z-index:0;width:100%;display:flex;gap:8px;padding:16px 24px;background-color:",a.r.colors.white,";button,a{width:100%;}a{text-decoration:none;}button{height:100%;pointer-events:none;}",n.M.mbDown,"{position:initial;z-index:500;button[data-size='lg'][data-color='secondary'],button[data-size='lg'][data-color='primary']{padding:12px;}}"),u=(0,r.Z)("div",{target:"e1oqgwk55"})("position:relative;padding:8px 0 24px;font-size:14px;.no-result{margin-top:8px;a{text-decoration:none;}}"),p=(0,r.Z)("div",{target:"e1oqgwk56"})("position:absolute;top:5px;left:0;display:flex;width:100%;align-items:center;padding:8px;background-color:",a.r.colors.neutral50,";border-radius:",a.r.borderRadius,";gap:8px;> img{flex-grow:0;flex-shrink:0;width:32px;height:32px;border-radius:50%;object-fit:cover;outline:1px solid ",a.r.colors.gray100,";}.doctor-edit-icon{flex-grow:0;flex-shrink:0;align-self:flex-start;margin-left:auto;cursor:pointer;}.hospital-card-icon{padding-right:8px;}"),g=(0,r.Z)("div",{target:"e1oqgwk57"})("display:flex;overflow:hidden;width:100%;align-items:center;justify-content:space-between;margin-top:16px;.chevron{cursor:pointer;path{stroke:",a.r.colors.gray600," !important;transition:stroke 0.2s;}&.disabled{pointer-events:none;path{stroke:",a.r.colors.gray300," !important;}}&.right{transform:rotateZ(180deg);}}"),v=(0,r.Z)("div",{target:"e1oqgwk58"})("display:flex;width:calc(100% - 64px);flex-wrap:nowrap;padding:8px 0px;gap:8px;overflow-x:scroll;::-webkit-scrollbar{display:none;}"),h=(0,r.Z)("div",{target:"e1oqgwk59"})("display:flex;min-width:68px;max-width:75px;height:68px;flex:0 0 calc((100% - 24px) / 4);flex-direction:column;align-items:center;justify-content:space-between;padding:4px 0px;border:1px solid transparent;margin:0 auto;background:",a.r.colors.white,";border-radius:",a.r.borderRadius,";cursor:pointer;&[data-active='true']{border-color:",a.r.colors.primaryBase,";background-color:",a.r.colors.primary50,";}p{line-height:18px;}"),m=(0,r.Z)("div",{target:"e1oqgwk510"})("margin-top:24px;.booking-time-tabs{width:100%;> li{flex:1;justify-content:center;&[aria-selected='false']{border-bottom:3px solid transparent;margin-bottom:-1px;}}}"),f=(0,r.Z)("div",{target:"e1oqgwk511"})("display:grid;margin-top:24px;grid-gap:8px;grid-template-columns:repeat(3,1fr);button{padding:7px 0 !important;&[data-color='secondary']{padding:8px 0 !important;border:1px solid ",a.r.colors.neutral200,";> span{color:",a.r.colors.gray800,";font-weight:",a.r.sizes.fwRegular,";}}}"),b=(0,r.Z)("div",{target:"e1oqgwk512"})("width:100%;overflow:hidden;padding:16px;.type{&-wrapper{width:100%;display:flex;justify-content:center;align-items:center;border-radius:8px;padding:4px;background-color:",a.r.colors.neutral50,";}&-button{width:100%;/* padding:7px 16px;*/\n max-height:32px;border-radius:4px;&.active{}}}"),y=(0,r.Z)("div",{target:"e1oqgwk513"})("padding:8px 8px 8px 16px;position:absolute;top:0;left:0;width:100%;height:60px;background-color:",a.r.colors.neutral50,";border-radius:",a.r.borderRadius,";p{font-size:14px;font-weight:400;color:",a.r.colors.gray400,";letter-spacing:-0.2px;line-height:22px;}"),k=(0,r.Z)("img",{target:"e1oqgwk514"})("width:24px;height:24px;"),w=(0,r.Z)("div",{target:"e1oqgwk515"})("overflow:hidden;width:100%;.hospital-card-icon{padding-right:0;}.option-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}"),x={header:{height:"64px",margin:0,paddingInline:"16px",flexDirection:"row-reverse",justifyContent:"flex-end",gap:"16px"},content:{display:"flex",flexDirection:"column"},body:{padding:0},close:{margin:0}}},Khha:function(e,t,o){o.r(t),o.d(t,{QuickBookingDrawer:function(){return QuickBookingDrawer}});var r=o("BGKE"),a=o("q1tI"),n=o("Vitr"),l=o("iBNF"),i=o("0Dyn"),d=o("5t9f"),c=o("sEfC"),s=o.n(c),u=o("Vvt1"),p=o.n(u),g=o("wUmw"),v=o("dDsW"),h=o("a5vB"),m=o("vOFr"),f=o.n(m),b=o("CJtR"),y=o("IoKP"),k=o("YbGd"),w=o("i/U4"),x=o("P5LW"),Z=o("rIrU"),C=o("o0qI"),S=o("Zr8O"),B=o("odgB"),E=o("hXNO"),D=o("Sz1N"),components_ButtonGroup=e=>{let{onClickSubmit:t,isFormValid:o,redirectUrl:a,submitButtonTrackingCode:n,learnMoreButtonTrackingCode:l}=e,{formatMessage:i}=(0,v.Z)(),{locale:d}=(0,x.h)(),c=(0,E.d)();return(0,r.BX)(D.I,{children:[(0,r.tZ)("a",{href:a,target:"_blank",onClick:t,...n,children:(0,r.tZ)(B.B,{color:"primary",size:c?"md":"lg",isDisabled:!o,children:i({id:"careBooking.submitButton",defaultMessage:"Book a doctor"})})}),(0,r.tZ)("a",{href:"https://".concat((0,b.Ok)(d)),target:"_blank",...l,children:(0,r.tZ)(B.B,{color:"secondary",size:c?"md":"lg",children:i({id:"careBooking.learnMore",defaultMessage:"Learn more"})})})]})},T=o("g8xC"),_=o("J03+"),components_CareTypeSwitch=e=>{let{careType:t,onCareTypeChange:o,currentUrl:a}=e,{formatMessage:n}=(0,v.Z)();return(0,r.tZ)(D.UX,{children:(0,r.BX)("div",{className:"type-wrapper",children:[(0,r.tZ)(T.B,{className:"type-button",size:"sm",variant:t===_.yU.DOCTOR?"primary":"ghost",onClick:()=>o(_.yU.DOCTOR),"data-event-category":"Care","data-event-action":"Quick Booking - Doctor Tab Click","data-event-label":a,children:n({id:"careBooking.doctor",defaultMessage:"Doctor"})}),(0,r.tZ)(T.B,{className:"type-button",size:"sm",variant:t===_.yU.SERVICE?"primary":"ghost",onClick:()=>o(_.yU.SERVICE),"data-event-category":"Care","data-event-action":"Quick Booking - Service Tab Click","data-event-label":a,children:n({id:"careBooking.service",defaultMessage:"Service"})})]})})},M=o("snNa");let R=p()(()=>Promise.all([o.e(8171),o.e(9377),o.e(9409),o.e(6259),o.e(1818),o.e(7519),o.e(761),o.e(2189),o.e(5231),o.e(7797),o.e(5454),o.e(5481),o.e(2354),o.e(9803),o.e(5349),o.e(4148),o.e(2509),o.e(1533),o.e(1108),o.e(9124),o.e(4190),o.e(5464),o.e(8261),o.e(8841),o.e(9353),o.e(7730),o.e(3929),o.e(7884),o.e(137),o.e(4414),o.e(4001),o.e(7613),o.e(8098),o.e(3416),o.e(2500),o.e(1570),o.e(3506),o.e(1413),o.e(2138),o.e(9467),o.e(4467),o.e(6966),o.e(5243),o.e(8132),o.e(1375),o.e(4561),o.e(1448),o.e(5465),o.e(1217),o.e(5480),o.e(731),o.e(2050),o.e(2008),o.e(8469),o.e(8214),o.e(1482),o.e(6817),o.e(467),o.e(5951),o.e(9357),o.e(747),o.e(5675),o.e(6753),o.e(4802),o.e(3046),o.e(5745),o.e(3437),o.e(252),o.e(6839),o.e(9424),o.e(5702),o.e(8922),o.e(6399),o.e(553),o.e(2902),o.e(4969),o.e(3257),o.e(6611),o.e(7538),o.e(6894),o.e(5341),o.e(4846),o.e(2233),o.e(1058),o.e(5638),o.e(3295),o.e(1538),o.e(6629),o.e(7152),o.e(5684),o.e(2574),o.e(2513),o.e(5238),o.e(7644),o.e(6962),o.e(4050),o.e(6638),o.e(7741),o.e(1137),o.e(2433),o.e(9689),o.e(5385),o.e(3564),o.e(3158),o.e(8320),o.e(5641),o.e(7454),o.e(7004),o.e(4758),o.e(6219),o.e(17),o.e(8990),o.e(4067),o.e(9487),o.e(9083),o.e(1520),o.e(270),o.e(7596),o.e(8217),o.e(7543),o.e(2835),o.e(2507),o.e(6885),o.e(7859),o.e(5970),o.e(2730),o.e(6287),o.e(7682),o.e(1551),o.e(4870),o.e(9922),o.e(3133),o.e(612),o.e(2002),o.e(1880),o.e(7471),o.e(7165),o.e(8854),o.e(5451),o.e(8612),o.e(2819),o.e(7695),o.e(3602),o.e(8101)]).then(o.bind(o,"KGmN")),{loadableGenerated:{webpack:()=>["KGmN"]}}),I=p()(()=>Promise.all([o.e(8171),o.e(9377),o.e(9409),o.e(6259),o.e(1818),o.e(7519),o.e(761),o.e(2189),o.e(5231),o.e(7797),o.e(5454),o.e(5481),o.e(2354),o.e(9803),o.e(5349),o.e(4148),o.e(2509),o.e(1533),o.e(1108),o.e(9124),o.e(4190),o.e(5464),o.e(8261),o.e(8841),o.e(9353),o.e(7730),o.e(3929),o.e(7884),o.e(137),o.e(4414),o.e(4001),o.e(7613),o.e(8098),o.e(3416),o.e(2500),o.e(1570),o.e(3506),o.e(1413),o.e(2138),o.e(9467),o.e(4467),o.e(6966),o.e(5243),o.e(8132),o.e(1375),o.e(4561),o.e(1448),o.e(5465),o.e(1217),o.e(5480),o.e(731),o.e(2050),o.e(2008),o.e(8469),o.e(8214),o.e(1482),o.e(6817),o.e(467),o.e(5951),o.e(9357),o.e(747),o.e(5675),o.e(6753),o.e(4802),o.e(3046),o.e(5745),o.e(3437),o.e(252),o.e(6839),o.e(9424),o.e(5702),o.e(8922),o.e(6399),o.e(553),o.e(2902),o.e(4969),o.e(3257),o.e(6611),o.e(7538),o.e(6894),o.e(5341),o.e(4846),o.e(2233),o.e(1058),o.e(5638),o.e(3295),o.e(1538),o.e(6629),o.e(7152),o.e(5684),o.e(2574),o.e(2513),o.e(5238),o.e(7644),o.e(6962),o.e(4050),o.e(6638),o.e(7741),o.e(1137),o.e(2433),o.e(9689),o.e(5385),o.e(3564),o.e(3158),o.e(8320),o.e(5641),o.e(7454),o.e(7004),o.e(4758),o.e(6219),o.e(17),o.e(8990),o.e(4067),o.e(9487),o.e(9083),o.e(1520),o.e(270),o.e(7596),o.e(8217),o.e(7543),o.e(2835),o.e(2507),o.e(6885),o.e(7859),o.e(5970),o.e(2730),o.e(6287),o.e(7682),o.e(1551),o.e(4870),o.e(9922),o.e(3133),o.e(612),o.e(2002),o.e(1880),o.e(7471),o.e(7165),o.e(8854),o.e(5451),o.e(8612),o.e(2819),o.e(7695),o.e(3602),o.e(4344)]).then(o.bind(o,"LqwN")),{loadableGenerated:{webpack:()=>["LqwN"]}}),QuickBookingDrawer=()=>{let{locale:e,router:{query:{currentUrl:t}}}=(0,x.h)(),{setCareType:o,setOpenQuickBookingDrawer:c,careType:u,openQuickBookingDrawer:p,data:m}=(0,S.B)(e=>e,h.X),{formatMessage:B}=(0,v.Z)(),[E,T]=(0,a.useState)(!1),{state:{isLoggedIn:N}}=(0,a.useContext)(C.I),A=(0,g.cI)(),{handleSubmit:L,control:z,setValue:U,watch:F}=A,O=F("selected_city"),[X,P]=(0,a.useState)(""),H=s()(e=>P(e),300),Q=(0,M.m)(p,U,O,void 0,X),[V,q]=(0,a.useState)(),G=(0,a.useMemo)(()=>Q.permission?[{label:B({id:"search.currentLocation",defaultMessage:"My Location"}),value:0,icon:(0,r.tZ)(f(),{})}]:[{label:B({id:"careBooking.grantLocation",defaultMessage:"Please allow permission to search by current location"}),value:-1,disabled:!0}],[Q.permission]),Y=(0,a.useMemo)(()=>Q.cityList.map(e=>({...e,label:e.name,value:e.id})),[Q.cityList]),j=(0,a.useMemo)(()=>({"data-event-category":"Care","data-event-action":u===_.yU.DOCTOR?"Doctor Quick Booking - Booking Click":"Service Quick Booking - Booking Click","data-event-label":t||""}),[u,t]),W=(0,a.useMemo)(()=>({"data-event-category":"Care","data-event-action":u===_.yU.DOCTOR?"Doctor Quick Booking - See More Click":"Service Quick Booking - See More Click","data-event-label":t||""}),[u,t]),onSubmit=t=>{if(t){var o,r,a,n,l,i,d,c,s,p,g;let v="?date=".concat((0,w.Y7)(t.date)),h="";u===_.yU.DOCTOR?(v+="&doctorId=".concat((null===(o=t.selected_doctor)||void 0===o?void 0:o.value)||(null===(r=t.selected_doctor)||void 0===r?void 0:r.id),"&scheduleId=").concat(t.selected_schedule),h="doctor",T(!!((null===(a=t.selected_city)||void 0===a?void 0:a.value)&&(null===(n=t.selected_specialty)||void 0===n?void 0:n.value)&&(null===(l=t.selected_hospital)||void 0===l?void 0:l.value)&&((null===(i=t.selected_doctor)||void 0===i?void 0:i.value)||(null===(d=t.selected_doctor)||void 0===d?void 0:d.id))&&t.selected_schedule))):u===_.yU.SERVICE&&(v+="&serviceId=".concat(null===(c=t.selected_service)||void 0===c?void 0:c.id,"&scheduleId=").concat(t.selected_service_schedule),h="service",T(!!((null===(s=t.selected_city)||void 0===s?void 0:s.value)&&(null===(p=t.selected_service_type)||void 0===p?void 0:p.value)&&(null===(g=t.selected_service)||void 0===g?void 0:g.value)&&t.selected_service_schedule)));let m="https://".concat((0,b.Ok)(e),"/booking/").concat(h,"/").concat(v);q(m||void 0)}};return(0,r.tZ)(d.d,{opened:p,onClose:()=>c(!1),title:(0,r.tZ)(n.T,{size:"lg",type:"bold",color:l.r.colors.secondaryBase,children:u===_.yU.DOCTOR?B({id:"careBooking.doctorBooking",defaultMessage:"Book a doctor"}):B({id:"careBooking.serviceBooking",defaultMessage:"Book a service"})}),size:500,position:"right",zIndex:310,styles:D.HA,lockScroll:!0,children:(0,r.tZ)(g.RV,{...A,children:(0,r.BX)(D.t6,{onSubmit:L(onSubmit),children:[(0,r.tZ)(g.Qr,{name:"selected_city",control:z,rules:{required:!0},render:e=>{let{field:{onChange:o,value:a}}=e;return(0,r.BX)(D.qH,{children:[(0,r.BX)(n.T,{type:"regular",size:"sm",children:[B({id:"search.currentLocation",defaultMessage:"Current location"}),":"]}),(0,r.tZ)(k.s,{id:"location-dropdown",options:[...G,...Y],value:a,onChange:o,onSearchChange:H,placeholder:"",dropdownLabelTrackingAttributes:{"data-event-category":"Care","data-event-action":"Quick Booking - Location Click","data-event-label":t},useSearchFilter:!1,onFocus:()=>{Q.onFocus()}}),Q.loading&&(0,r.tZ)(y.Z,{})]})}}),(0,r.tZ)(components_CareTypeSwitch,{careType:u,currentUrl:t,onCareTypeChange:e=>{o(e)}}),(()=>{switch(u){case _.yU.DOCTOR:return(0,r.tZ)(R,{data:m,careType:u,onClose:()=>c(!1),onSubmit:L(onSubmit)});case _.yU.SERVICE:return(0,r.tZ)(I,{data:m,careType:u,onClose:()=>c(!1),onSubmit:L(onSubmit)});default:return null}})(),(0,r.tZ)(components_ButtonGroup,{onClickSubmit:e=>{E?(c(!1),N?window.open(V):Z.Ew?i.u.getState().triggerLogin({returnUrl:V}):window.open((0,b.bT)(V))):e.preventDefault()},isFormValid:E,redirectUrl:V,submitButtonTrackingCode:j,learnMoreButtonTrackingCode:W})]})})})}},"J03+":function(e,t,o){var r,a,n,l,i,d;o.d(t,{jE:function(){return n},yU:function(){return r}}),(l=r||(r={}))[l.DOCTOR=0]="DOCTOR",l[l.SERVICE=1]="SERVICE",(i=a||(a={}))[i.GRANTED=0]="GRANTED",i[i.DENIED=1]="DENIED",i[i.UNSUPPORTED=2]="UNSUPPORTED",(d=n||(n={}))[d.DEFAULT=0]="DEFAULT",d[d.SEARCH=1]="SEARCH"},tiER:function(e,t,o){o.r(t),o.d(t,{QuickBookingDrawerWrapper:function(){return QuickBookingDrawerWrapper}});var r=o("BGKE"),a=o("Vvt1"),n=o.n(a),l=o("a5vB"),i=o("Zr8O");let d=n()(()=>Promise.all([o.e(9409),o.e(6259),o.e(1818),o.e(7519),o.e(761),o.e(2189),o.e(5231),o.e(7797),o.e(5454),o.e(5481),o.e(2354),o.e(9803),o.e(5349),o.e(4148),o.e(2509),o.e(1533),o.e(1108),o.e(9124),o.e(4190),o.e(5464),o.e(8261),o.e(8841),o.e(9353),o.e(7730),o.e(3929),o.e(7884),o.e(137),o.e(4414),o.e(4001),o.e(7613),o.e(8098),o.e(3416),o.e(2500),o.e(1570),o.e(3506),o.e(1413),o.e(2138),o.e(9467),o.e(4467),o.e(6966),o.e(5243),o.e(8132),o.e(1375),o.e(4561),o.e(1448),o.e(5465),o.e(1217),o.e(5480),o.e(731),o.e(2050),o.e(2008),o.e(8469),o.e(8214),o.e(1482),o.e(6817),o.e(467),o.e(5951),o.e(9357),o.e(747),o.e(5675),o.e(6753),o.e(4802),o.e(3046),o.e(5745),o.e(3437),o.e(252),o.e(6839),o.e(9424),o.e(5702),o.e(8922),o.e(6399),o.e(553),o.e(2902),o.e(4969),o.e(3257),o.e(6611),o.e(7538),o.e(6894),o.e(5341),o.e(4846),o.e(2233),o.e(1058),o.e(5638),o.e(3295),o.e(1538),o.e(6629),o.e(7152),o.e(5684),o.e(2574),o.e(2513),o.e(5238),o.e(7644),o.e(6962),o.e(4050),o.e(6638),o.e(7741),o.e(1137),o.e(2433),o.e(9689),o.e(5385),o.e(3564),o.e(3158),o.e(8320),o.e(5641),o.e(7454),o.e(7004),o.e(4758),o.e(6219),o.e(17),o.e(8990),o.e(4067),o.e(9487),o.e(9083),o.e(1520),o.e(270),o.e(7596),o.e(8217),o.e(7543),o.e(2835),o.e(2507),o.e(6885),o.e(7859),o.e(5970),o.e(2730),o.e(6287),o.e(7682),o.e(1551),o.e(4870),o.e(9922),o.e(3133),o.e(612),o.e(2002),o.e(1880),o.e(7471),o.e(7165),o.e(8854),o.e(5451),o.e(8612),o.e(2819),o.e(7695),o.e(9149)]).then(o.bind(o,"Khha")).then(e=>e.QuickBookingDrawer),{loadableGenerated:{webpack:()=>["Khha"]},ssr:!1}),QuickBookingDrawerWrapper=()=>{let e=(0,i.B)(e=>e.openQuickBookingDrawer,l.X);return e?(0,r.tZ)(d,{}):null}},KNnw:function(e,t,o){o.d(t,{Fg:function(){return i},Qx:function(){return l},R7:function(){return d},VX:function(){return c},j1:function(){return s},oC:function(){return u}});var r=o("rBCA"),a=o("HMwR"),n=o("iBNF");let l=(0,r.Z)("div",{target:"eso8w1s0"})(a.M.mbUp,"{padding:0.5rem 0;}&[data-show-full='true']{padding:0;}"),i=(0,r.Z)("a",{target:"eso8w1s1"})("display:block;margin-bottom:1rem;",a.M.mbDown,"{margin-bottom:0.5rem;}.related-post{pointer-events:none;color:",n.r.colors.secondaryBase,";font-weight:600;letter-spacing:0;line-height:31px;",a.M.mbDown,"{font-size:14px;line-height:22px;}}"),d=(0,r.Z)("div",{target:"eso8w1s2"})("margin:1rem 0 0;",a.M.mbDown,"{margin:0.5rem 0 0;}&[data-show-full='true']{margin:0;",a.M.mbUp,"{.related-article-card[data-size='md']{padding-top:0.5rem;}}}.content .author{flex:1;.avatar{width:32px;height:32px;}}"),c=(0,r.Z)("div",{target:"eso8w1s3"})("padding:0;cursor:pointer;.content .inner-content .text{-webkit-line-clamp:2;}"),s=(0,r.Z)("div",{target:"eso8w1s4"})("width:100%;padding:1rem 0;padding:1rem 1rem 0;",a.M.mbUp,"{padding:1rem 0 0;}background:white;"),u=(0,r.Z)("div",{target:"eso8w1s5"})("width:100%;",a.M.mbDown,"{width:calc(100% + 2rem);margin-right:-1rem;margin-left:-1rem;}padding:1rem 0;padding:0.5rem 0;background:",n.r.colors.neutral50,";")},hoxo:function(e,t,o){o.d(t,{Z:function(){return RelatedPosts}});var r=o("BGKE"),a=o("Vitr"),n=o("rPIz"),l=o("Vvt1"),i=o.n(l),d=o("dDsW"),c=o("iv2E"),s=o("P5LW"),u=o("KNnw"),p=o("rIrU");let g=i()(()=>Promise.all([o.e(2138),o.e(9467),o.e(4467),o.e(6966),o.e(5243),o.e(8132),o.e(1375),o.e(4561),o.e(1448),o.e(5465),o.e(1217),o.e(5480),o.e(731),o.e(2050),o.e(2008),o.e(8469),o.e(8214),o.e(1482),o.e(6817),o.e(467),o.e(5951),o.e(9357),o.e(747),o.e(5675),o.e(6753),o.e(4802),o.e(3046),o.e(5745),o.e(3437),o.e(252),o.e(6839),o.e(9424),o.e(5702),o.e(8922),o.e(6399),o.e(553),o.e(2902),o.e(4969),o.e(3257),o.e(6611),o.e(7538),o.e(6894),o.e(5341),o.e(4846),o.e(2233),o.e(1058),o.e(5638),o.e(3295),o.e(1538),o.e(6629),o.e(7152),o.e(5684),o.e(2574),o.e(2513),o.e(5238),o.e(7644),o.e(6962),o.e(4050),o.e(6638),o.e(7741),o.e(1137),o.e(2433),o.e(9689),o.e(5385),o.e(3564),o.e(3158),o.e(8320),o.e(5641),o.e(7454),o.e(7004),o.e(4758),o.e(6219),o.e(17),o.e(8990),o.e(4067),o.e(9487),o.e(9083),o.e(1520),o.e(270),o.e(7596),o.e(8217),o.e(7543),o.e(2835),o.e(2507),o.e(6885),o.e(7859),o.e(5970),o.e(2730),o.e(6287),o.e(7682),o.e(1551),o.e(4870),o.e(9922),o.e(3133),o.e(612),o.e(2002),o.e(1880),o.e(7471),o.e(7165),o.e(8854),o.e(5451),o.e(8612),o.e(2819),o.e(7695),o.e(6678)]).then(o.bind(o,"1KiM")).then(e=>e.ArticleCardWrapper),{loadableGenerated:{webpack:()=>["1KiM"]}}),RelatedPosts=e=>{let{className:t,title:o,articles:l=[],isMobile:i,articleType:v}=e,{formatMessage:h}=(0,d.Z)(),{locale:m}=(0,s.h)(),f=v||p.Yx.articleType;return(0,r.tZ)(u.Qx,{"data-show-full":f!==p.Iq.ArticleType3,className:t,children:(0,r.BX)(r.HY,{children:[(0,r.tZ)(a.T,{size:i?"xs":"md",color:"#8C8C8C",type:"bold",style:{textTransform:"uppercase",...i?{}:{fontSize:18}},children:o||h({id:l.length>1?"articlePage.relatedPostsSectionTitle.many":"articlePage.relatedPostsSectionTitle.one"})}),(0,r.tZ)(u.R7,{"data-show-full":f!==p.Iq.ArticleType3,children:l.map((e,t)=>f===p.Iq.ArticleType3?(0,r.tZ)(u.Fg,{href:e.permalink,"data-event-category":"Related Article","data-event-action":"Click ".concat(t+1),"data-event-label":"https://".concat(c.domainLocales[m]).concat(e.permalinkDecode),style:{cursor:"pointer"},children:(0,r.tZ)(n.H,{className:"related-post",tag:"h5",as:"h3",children:e.postTitle})},"related-article-".concat(t)):(0,r.tZ)(u.VX,{children:(0,r.tZ)("a",{"data-event-category":"Further Article","data-event-action":"Click","data-event-label":"https://".concat(c.domainLocales[m]).concat(e.permalinkDecode),children:(0,r.tZ)(g,{article:e,className:"related-article-card",type:"author",size:i?"sm":"md",authorImageWrapProps:{width:32,height:32},dataEventActionForBanner:"Article Image Click",dataEventActionForTitle:"Article Title Click",dataEventCategoryForBanner:"Further Article",dataEventCategoryForTitle:"Further Article",dataEventLabelForBanner:"https://".concat(c.domainLocales[m]).concat(e.permalinkDecode),dataEventLabelForBookmark:"https://".concat(c.domainLocales[m]).concat(e.permalinkDecode),dataEventLabelForCategory:"https://".concat(c.domainLocales[m]).concat(e.category.permalinkDecode),dataEventLabelForTitle:"https://".concat(c.domainLocales[m]).concat(e.permalinkDecode),headingAs:"p"})})},"injected-article-".concat(t)))})]})})}},xeXx:function(e,t,o){o.r(t),o.d(t,{InjectedRelatedPosts:function(){return InjectedRelatedPosts}});var r=o("BGKE"),a=o("q1tI"),n=o("p46w"),l=o.n(n),i=o("4QfM"),d=o("rIrU"),c=o("hoxo"),s=o("KNnw");let InjectedRelatedPosts=e=>{let{slug:t,...o}=e,[n,u]=(0,a.useState)(null);return((0,a.useEffect)(()=>{(async()=>{let e=l().get(d.Ud);u(await (0,i.vX)({slug:t,isRelated:1,requestFrom:e}))})()},[t]),n)?(0,r.tZ)(s.oC,{children:(0,r.tZ)(s.j1,{children:(0,r.tZ)(c.Z,{articles:[n],...o})})}):null}},BpjA:function(e,t,o){o("rIrU"),o("wtoa"),o("zKC1"),o("s9tu"),o("rBCA");var r=o("HMwR"),a=o("iBNF");r.M.mbDown,r.M.mbDown,r.M.mbDown,r.M.mbUp,r.M.mbDown,r.M.mbDown,r.M.mbUp,r.M.mbDown,r.M.mbDown,r.M.mbDown,a.r.borderRadius,a.r.borderRadius,r.M.mbDown}}]);