"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7004],{Zxpr:function(e,t,a){a.r(t),a.d(t,{OpeningOfArticle:function(){return OpeningOfArticle}});var o=a("BGKE"),r=a("iBNF"),n=a("mYVa"),l=a("ns0B"),i=a.n(l),d=a("Vvt1"),c=a.n(d),s=a("hXNO"),u=a("rBCA"),p=a("wp0n");let g=(0,u.Z)(p.T,{target:"e1b077ur0"})("word-break:break-word;"),v=(0,u.Z)("div",{target:"e1b077ur1"})("padding:16px;background:",r.r.colors.neutral50,";border-radius:",r.r.borderRadius,";color:",r.r.colors.gray800,";font-size:14px;line-height:22px;a{color:",r.r.colors.primary600,";}"),h=c()(()=>Promise.all([a.e(2138),a.e(9467),a.e(4467),a.e(6966),a.e(5243),a.e(8132),a.e(1375),a.e(4561),a.e(1448),a.e(5465),a.e(1217),a.e(5480),a.e(731),a.e(2050),a.e(2008),a.e(8469),a.e(8214),a.e(1482),a.e(6817),a.e(467),a.e(5951),a.e(9357),a.e(747),a.e(5675),a.e(6753),a.e(4802),a.e(3046),a.e(5745),a.e(3437),a.e(252),a.e(6839),a.e(9424),a.e(5702),a.e(8922),a.e(6399),a.e(553),a.e(2902),a.e(4969),a.e(3257),a.e(6611),a.e(7538),a.e(6894),a.e(5341),a.e(4846),a.e(2233),a.e(1058),a.e(3295),a.e(1538),a.e(7152),a.e(5684),a.e(2574),a.e(9884),a.e(7644),a.e(6962),a.e(8767),a.e(6638),a.e(7741),a.e(3434),a.e(2433),a.e(5385),a.e(3564),a.e(7082),a.e(3158),a.e(5641),a.e(7454),a.e(7004),a.e(4758),a.e(6219),a.e(17),a.e(8990),a.e(4067),a.e(9487),a.e(9083),a.e(1520),a.e(270),a.e(7596),a.e(8217),a.e(7543),a.e(2835),a.e(2507),a.e(6885),a.e(7859),a.e(690),a.e(2730),a.e(6287),a.e(7682),a.e(1551),a.e(4870),a.e(9922),a.e(3133),a.e(612),a.e(2002),a.e(1880),a.e(7471),a.e(7165),a.e(5451),a.e(8612)]).then(a.bind(a,"huhZ")).then(e=>e.ArticleAuthorMobile),{loadableGenerated:{webpack:()=>["huhZ"]}}),OpeningOfArticle=e=>{let{article:t}=e,a=(0,s.d)();return(0,o.BX)(o.HY,{children:[(0,o.tZ)(g,{as:"h1",size:"h2",className:"article-header mb-4",color:r.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)||"")}),a&&(0,o.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,o.tZ)(v,{dangerouslySetInnerHTML:{__html:t.affiliate_message},className:"max-md:mb-3 md:mb-4"})]})}},jhGD:function(e,t,a){var o=a("BGKE"),r=a("q1tI"),n=a("dDsW"),l=a("rIrU");t.Z=(0,r.forwardRef)((e,t)=>{let{onFinish:a,onClick:i,isFinished:d,resendLabel:c,className:s}=e,[u,p]=(0,r.useState)(l.ip),g=(0,r.useRef)(),v=(0,r.useRef)(),{formatMessage:h}=(0,n.Z)();v.current=a;let m=(0,r.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,r.useCallback)(()=>{p(0),clearInterval(g.current)},[]);return(0,r.useImperativeHandle)(t,()=>({reset:m,cancel:f,isFinished:0===u})),(0,r.useEffect)(()=>(m(),()=>{clearInterval(g.current)}),[]),(0,o.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,a){a.d(t,{t:function(){return OTPInfoForm}});var o=a("BGKE"),r=a("q1tI"),n=a("LgdP"),l=a("E+oP"),i=a.n(l),d=a("wUmw"),c=a("dDsW"),s=a("RB7Y"),u=a("oQBk"),p=a("xIXX"),g=a("CJtR"),v=a("0VOb"),h=a("H9bp"),m=a("UNYN"),f=a("Rlzi"),b=a.n(f),y=a("jhGD"),k=a("rBCA"),w=a("iBNF"),x=a("uuQu"),C=a("rIrU");let Z=(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('",C.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,";}}");a("CCFL");let OTPInfoForm=e=>{let{className:t,style:a,actions:l,countryCode:f,phoneNumber:k,areaCode:w,callBack:x}=e,C=(0,r.useRef)(),[E,B]=(0,r.useState)(!1),[D,T]=(0,r.useState)(!1),[_,M]=(0,r.useState)(!1),[R,I]=(0,r.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(),a=(0,s.SR)(t.phone||"");if((null==a?void 0:a.nationalNumber)&&(null==a?void 0:a.countryCallingCode)){T(!0);try{var o;let e=await (0,p.t9)((0,g.jX)(u.y.SUBOT.POST_SEND_OTP),"POST",{data:{phone_number:a.nationalNumber,area_code:"+".concat(a.countryCallingCode)}});if(T(!1),(null==e?void 0:e._status)===1){R&&(B(!1),C.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===(o=e._messages)||void 0===o?void 0:o[0])==="This phone number was verified"){C.current&&C.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),C.current&&C.current.cancel(),showMessageSomethingWrong()}}},handleOnVerify=async(e,t)=>{if(e.preventDefault(),M(!0),await z(),i()(A)){let e=U(),{number:a}=e,o=(0,s.SR)(e.phone||"");if((null==o?void 0:o.nationalNumber)&&(null==o?void 0:o.countryCallingCode))try{let r=await (0,p.t9)((0,g.jX)(u.y.SUBOT.POST_VERIFY_OTP),"POST",{data:{phone_number:o.nationalNumber,area_code:"+".concat(o.countryCallingCode),code:a}});if(M(!1),(null==r?void 0:r._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,o.BX)("div",{className:"input-row",children:[(0,o.tZ)("label",{htmlFor:e.key,children:e.label}),(0,o.tZ)(d.Qr,{name:e.key,control:L,rules:{required:!0,validate:e=>(0,s.tm)(e)},render:t=>{let{field:{onChange:a,value:r}}=t,l=!E&&R||D;return(0,o.BX)(S,{children:[(0,o.tZ)(h.Is,{value:r,defaultValue:k,onChange:a,defaultCountry:f,id:e.id,className:"input-row ".concat(e.id),name:e.key,disabled:l,flagComponent:h.tz,placeholder:e.label}),l&&(0,o.tZ)(b(),{viewBox:"0 0 24 24",className:"icon-edit-phone",onClick:()=>{var e;a(""),I(!1),M(!1),null===(e=C.current)||void 0===e||e.cancel()}}),e.key&&A[e.key]&&(0,o.tZ)("p",{className:"error-message",children:O({id:"validation.error.validNumber",defaultMessage:"Please enter a valid number."})}),(0,o.tZ)("div",{className:"submit-btn-row",children:(0,o.tZ)(n.B,{className:"submit-btn",size:"lg",onClick:handleSendOTP,isDisabled:!E&&R||D,isLoading:D,children:R?(0,o.tZ)(y.Z,{ref:C,isFinished:E,onFinish:B}):(0,o.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,o.BX)("div",{className:"input-row",children:[(0,o.tZ)("label",{htmlFor:e.key,children:e.label}),(0,o.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,o.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,o.tZ)("div",{className:"submit-btn-row",children:(0,o.tZ)(n.B,{className:"submit-btn",size:"lg",isDisabled:_,isLoading:_,onClick:t=>handleOnVerify(t,e),children:e.label})},e.id):"";return(0,r.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,o.tZ)(Z,{className:t,style:a,children:(0,o.BX)("form",{className:"user-info-form",children:[l.map(e=>renderFormInput(e)),l.map(e=>renderFormSubmitAndTerms(e))]})})}},x8Vb:function(e,t,a){a.d(t,{q:function(){return OvulationCalculatorCard}});var o=a("BGKE"),r=a("q1tI"),n=a("MmHG"),l=a("iBNF"),i=a("Wgwc"),d=a.n(i),c=a("dDsW"),s=a("FQkf"),u=a.n(s),p=a("gGrW"),g=a.n(p),v=a("wnYK"),h=a("9/ee"),m=a("cfqT"),f=a("a4op"),b=a("hXNO"),y=a("tMVq"),k=a("rIrU"),w=a("rBCA"),x=a("LgdP"),C=a("uuQu");let Z=(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;}",C.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,";"),E=(0,w.Z)("div",{target:"e14m8ex2"})(C.M.mbDown,"{padding:8px 16px;display:flex;justify-content:center;}",C.M.mbUp,"{padding:16px 24px;}"),B=(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;}",C.M.mbDown,"{color:",l.r.colors.gray600,";border-color:transparent;}",C.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,a,i;let{calcObjective:s,className:p,startDate:w=new Date,selectedDate:x,calendarRanges:C=[],ovulationDays:U=[],ovulationMarkers:F=[],onChangeStartDate:O,onChangeSelectedDate:P,onClickRecalculate:X}=e,{formatMessage:Q}=(0,c.Z)(),G=(0,b.d)(),{localize:H}=(0,f.k)(),[q,Y]=(0,r.useState)(!1),[V,j]=(0,r.useState)(!1),W=(0,r.useRef)(null),[K,J]=(0,r.useState)(!1);(0,y.t)(W,()=>{j(!1),O&&O(x)}),(0,r.useEffect)(()=>{q||window.scrollTo(0,0)},[q]);let $=(0,r.useMemo)(()=>{if(!H)return null;let e=w;return V&&d()(x).isBetween(w,d()(w).add(2,"month"))&&(e=x),"".concat(H.month(e.getMonth(),{width:"abbreviated"})," ").concat(e.getFullYear())},[H,w,x,V,Q,G]),ee=(0,r.useCallback)(e=>C.filter(t=>"period"===t.rangeType&&d()(t.startDate).isAfter(e)).sort((e,t)=>e.startDate.getTime()-t.startDate.getTime())[0],[C]),et=(0,r.useCallback)(e=>C.find(t=>"period"===t.rangeType&&d()(e).isBetween(d()(t.startDate).subtract(1,"day"),d()(t.endDate).add(1,"day"),"day")),[C]),ea=(0,r.useCallback)(e=>C.find(t=>"fertile"===t.rangeType&&d()(e).isBetween(t.startDate,t.endDate)),[C]),eo=(0,r.useCallback)(e=>{let t=d()(e);return U.sort((e,a)=>Math.abs(t.diff(e,"day"))-Math.abs(t.diff(a,"day")))[0]},[U]),er=(0,r.useCallback)(e=>U.some(t=>d()(t).isSame(e,"date")),[U]),en=(0,r.useCallback)((e,t)=>e?"period":t?"fertile":"none",[]);function renderBodyTitle1(e){let t=et(e),a=ee(e),o=er(e),r=eo(e),n=ea(e);if(t)return Q({id:"health.ovulationCalculator.period"});if(s===k.Yo){if(a)return Q({id:"health.ovulationCalculator.periodIn"})}else{if(o)return Q({id:"health.ovulationCalculator.dayOf"});if(r&&n){let t=d()(r).diff(e,"day");return t>0?Q({id:"health.ovulationCalculator.ovulationIn"}):Q({id:"health.ovulationCalculator.periodIn"})}}if(a&&r){let t=d()(r).diff(e,"day");return t<0?Q({id:"health.ovulationCalculator.periodIn"}):Q({id:"health.ovulationCalculator.ovulationIn"})}return null}function renderBodyTitle2(e){let t;let a=et(e),o=ee(e),r=er(e),n=eo(e),l=ea(e);if(a)return Q({id:"common.day.singular"},{day:d()(e).diff(a.startDate,"day")+1});if(s===k.Yo)o&&(t=d()(o.startDate).diff(e,"day"));else{if(r)return Q({id:"health.ovulationCalculator.ovulation"});if(l){let a=d()(n).diff(e,"day");a>0?t=a:o&&(t=d()(o.startDate).diff(e,"day"))}}if(!t&&o&&n){let a=d()(n).diff(e,"day");t=a<0?d()(o.startDate).diff(e,"day"):a}return t?Q({id:"common.day.".concat(1===t?"singular":"plural")},{day:t}):null}function renderBodyDetails(e){let t=et(e),a=eo(e);if(s===k.CG){if(t)return(0,o.tZ)("span",{className:"low-risk",children:Q({id:"ovulationPage.chanceVeryLow"})});if(a){let t=d()(a).diff(e,"day");if(0===t)return(0,o.tZ)("span",{className:"risky",children:Q({id:"ovulationPage.chanceVeryRisky"})});if(t>=-1&&t<=5)return(0,o.tZ)("span",{className:"risky",children:Q({id:"ovulationPage.chanceRisky"})})}return(0,o.tZ)("span",{className:"low-risk",children:Q({id:"ovulationPage.chanceLow"})})}let r=2.1;if(t)r=1;else if(a){let t=d()(a).diff(e,"day");t>=-1&&t<=5&&(r=k.UX[t])}return(0,o.BX)("span",{children:[Q({id:"ovulationPage.pregnancyRate"})," ",(0,o.BX)("span",{className:"rate highlighted",children:[r,"%"]})]})}function renderCalendar(e,t){return(0,o.tZ)(v.f,{mode:e,start:w,selected:x,onChangeStart:O,onChangeSelected:P,ranges:C,markers:F,renderTooltip:"monthly"===e?renderTooltip:void 0,...t})}function renderTooltip(e){return(0,o.BX)(o.HY,{children:[(0,o.BX)(n.T,{size:"p2",color:l.r.colors.gray800,type:"bold",children:[renderBodyTitle1(e)," ",renderBodyTitle2(e)]}),(0,o.tZ)(n.T,{size:"p3",children:renderBodyDetails(e)})]})}return(0,o.BX)(Z,{className:p,"data-in-range":en(et(x),ea(x)),"data-avoid-pregnancy":s===k.CG,children:[(0,o.tZ)("div",{children:V&&(0,o.tZ)(S,{ref:W,children:renderCalendar("monthly")})}),(0,o.tZ)(E,{children:(0,o.BX)(B,{"data-active":V,onClick:function(){G?Y(!0):j(!0)},children:[(0,o.tZ)(u(),{}),$]})}),renderCalendar("weekly",{className:"onboarding-calendar"}),(0,o.BX)(D,{children:[(0,o.tZ)(T,{onClick:()=>J(!0),children:(0,o.tZ)(g(),{})}),K&&(0,o.tZ)(h.F,{isMobile:G,shareUrl:null!==(i=null===(a=window)||void 0===a?void 0:null===(t=a.location)||void 0===t?void 0:t.href)&&void 0!==i?i:"",onRecalculate:X,onClose:()=>J(!1)}),(0,o.tZ)(_,{className:"highlighted",children:renderBodyTitle1(x)}),(0,o.tZ)(M,{children:renderBodyTitle2(x)}),(0,o.tZ)(R,{children:renderBodyDetails(x)}),(0,o.tZ)(I,{onClick:X,color:"tertiary",size:"md",children:Q({id:"health.ovulationCalculator.editPeriodDate"})})]}),(0,o.BX)(N,{children:[(0,o.BX)(A,{children:[(0,o.tZ)(L,{className:"badge--period"}),(0,o.tZ)(z,{children:Q({id:"health.ovulationCalculator.period"})})]}),s!==k.Yo&&(0,o.BX)(o.HY,{children:[(0,o.BX)(A,{children:[(0,o.tZ)(L,{className:"badge--fertile"}),(0,o.tZ)(z,{children:Q({id:"health.ovulationCalculator.fertile"})})]}),(0,o.BX)(A,{children:[(0,o.tZ)(L,{className:"badge--ovulation"}),(0,o.tZ)(z,{children:Q({id:"health.ovulationCalculator.ovulation"})})]})]})]}),(0,o.tZ)("div",{children:q&&(0,o.tZ)(m.D,{onClose:function(){Y(!1),O&&O(x)},startDate:w,ranges:C,markers:F,selectedDate:x,onChangeSelectedDate:P,onChangeStartDate:O,renderTooltip:renderTooltip})})]})}},vplf:function(e,t,a){a.d(t,{j9:function(){return i}});var o=a("rBCA"),r=a("iBNF"),n=a("uuQu"),l=a("rIrU");r.r.colors.neutral200,l.uQ,r.r.colors.neutral200,l.uQ,r.r.colors.pink700,l.uQ,r.r.colors.pink700;let i=(0,o.Z)("div",{target:"e7yon21"})("display:flex;flex-direction:column;align-items:center;justify-content:center;",n.M.mbUp,"{margin-bottom:32px;}");r.r.colors.neutral50,r.r.borderRadius},SMvd:function(e,t,a){a.d(t,{L:function(){return BookingDays}});var o=a("BGKE"),r=a("q1tI"),n=a("MmHG"),l=a("iBNF"),i=a("/rh5"),d=a("25AQ"),c=a("JhOC"),s=a("dDsW"),u=a("i/U4"),p=a("a4op"),g=a("Sz1N"),v=a("TSYQ"),h=a.n(v),m=a("DzJC"),f=a.n(m),b=a("4Y4a"),y=a.n(b),k=a("aNTj");let ScrollList=e=>{let{children:t,className:a,numberOfItems:n,step:l}=e,i=(0,r.useRef)(null),[d,c]=(0,r.useState)("left"),[s,u]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{k.E.measure(()=>{i.current&&(i.current.scrollWidth<=i.current.clientWidth?s&&u(!1):s||u(!0))})},[i,t]),(0,r.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,o.BX)(g.V$,{className:a,children:[(0,o.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,o.tZ)(g.vA,{ref:i,children:t}),(0,o.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,o.tZ)(_BookingDays,{...e}):null},_BookingDays=e=>{let{startDate:t,endDate:a,schedules:v,date:h,setDate:m,dataEventAction:f,dataEventCategory:b,dataEventLabel:y}=e,{formatMessage:k}=(0,s.Z)(),[w,x]=(0,r.useState)((0,u.Y7)(h)),C=(0,r.useMemo)(()=>{try{return(0,i.Z)({start:t,end:a}).map(e=>{var t;let a=(0,u.Y7)(e);return{date:e,day:a,numberOfSlots:v&&(null===(t=v.find(e=>e.workingDay===a))||void 0===t?void 0:t.slots)||0}})}catch(e){}return[]},[v]);(0,r.useEffect)(()=>{x((0,u.Y7)(h))},[h]),(0,r.useEffect)(()=>{let e=C.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))},[C]);let{locale:Z}=(0,p.k)();return(0,r.useEffect)(()=>{setTimeout(()=>{let e=document.querySelector("[data-booking-day='".concat(w,"']"));null==e||e.scrollIntoView({behavior:"smooth"})},1e3)},[w]),(0,o.tZ)(ScrollList,{children:C.map(e=>{let{date:t,day:a,numberOfSlots:r}=e;return(0,o.BX)(g.un,{"data-booking-day":a,"data-active":w===a,onClick:()=>{m(t)},"data-event-category":b,"data-event-action":f,"data-event-label":y,children:[(0,o.tZ)(n.T,{size:"xs",type:"caption",color:l.r.colors.gray600,style:{fontSize:12,whiteSpace:"nowrap"},children:(0,d.Z)(t,"EEE",{locale:Z})}),(0,o.tZ)(n.T,{size:"md",type:"bold",color:l.r.colors.gray800,style:{fontSize:16,lineHeight:"18px"},children:t.getDate()}),(0,o.tZ)(n.T,{size:"xs",color:r>0?l.r.colors.green600:l.r.colors.gray400,style:{fontSize:12,whiteSpace:"nowrap"},children:k({id:r>0?"careBooking.numberOfSlotPlural":"careBooking.numberOfSlotSingular",defaultMessage:"".concat(r," slot").concat(r>0?"s":"")},{number:r})})]},a)})})}},r72T:function(e,t,a){a.d(t,{l:function(){return BookingTime}});var o=a("BGKE"),r=a("q1tI"),n=a("qQsD"),l=a("LgdP"),i=a("dDsW"),d=a("Sz1N");let BookingTime=e=>{let{workingTimes:t}=e;return t?(0,o.tZ)(_BookingTime,{...e,workingTimes:t}):null},_BookingTime=e=>{let{workingTimes:t,scheduleId:a,setScheduleId:c,dataEventAction:s,dataEventCategory:u,dataEventLabel:p}=e,{formatMessage:g}=(0,i.Z)(),[v,h]=(0,r.useState)(0),[m,f]=(0,r.useState)([]),b=(0,r.useMemo)(()=>{let e=[],a=[];return t.morning&&(e.push({name:g({id:"common.morning",defaultMessage:"Morning"}).concat(" (".concat(t.morning.length,")"))}),a.push("morning")),t.afternoon&&(e.push({name:g({id:"common.afternoon",defaultMessage:"Afternoon"}).concat(" (".concat(t.afternoon.length,")"))}),a.push("afternoon")),t.evening&&(e.push({name:g({id:"common.evening",defaultMessage:"Evening"}).concat(" (".concat(t.evening.length,")"))}),a.push("evening")),f(a),e},[t,g]);return(0,r.useEffect)(()=>{c("")},[v]),(0,o.BX)(d.As,{children:[(0,o.tZ)(n.T,{className:"booking-time-tabs",tabContent:b,initialTab:v,onChange:h}),(0,o.tZ)(d.rR,{children:(t[m[v]]||[]).map(e=>(0,o.tZ)(l.B,{size:"md",color:a===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,a){var o=a("BGKE"),r=a("OeEL"),n=a.n(r),l=a("Sz1N"),i=a("crQX");t.Z=e=>{let{logo:t,name:a,price:r,priceUnit:d,onEditClick:c}=e;return(0,o.BX)(l.up,{children:[(0,o.tZ)("img",{loading:"lazy",src:t,alt:a}),(0,o.tZ)(i.Z,{name:a,price:r,priceUnit:d,isDetail:!0}),(0,o.tZ)(n(),{className:"doctor-edit-icon",onClick:c})]})}},RehD:function(e,t,a){var o=a("BGKE"),r=a("MmHG"),n=a("kriW"),l=a("Sz1N"),i=a("J03+");t.Z=e=>{let{type:t,translationId:a="",href:d="",onClose:c}=e;return(0,o.BX)(o.HY,{children:[t===i.jE.DEFAULT&&(0,o.tZ)(l.G_,{children:(0,o.tZ)(n.Z,{id:a,defaultMessage:"We could not find any result. Click here to see more",tagName:"p",values:{a:function(e){return(0,o.tZ)("a",{href:d,onClick:c,target:"_blank",children:e})}}})}),t===i.jE.SEARCH&&(0,o.tZ)(r.T,{size:"xs",className:"no-result",children:(0,o.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,o.tZ)("a",{href:d,onClick:c,target:"_blank",children:e})}}})})]})}},crQX:function(e,t,a){var o=a("BGKE"),r=a("MmHG"),n=a("iBNF"),l=a("20a2"),i=a("dDsW"),d=a("iz81"),c=a("Sz1N");t.Z=e=>{let{name:t,price:a,priceUnit:s,isDetail:u}=e,{formatMessage:p}=(0,i.Z)(),{locale:g="en-PH"}=(0,l.useRouter)();return(0,o.BX)(c.Tz,{children:[(0,o.tZ)(r.T,{size:"sm",type:"regular",className:u?"option-name":"",children:t}),(0,o.BX)(d.Kk,{children:[(0,o.tZ)("div",{className:"icon-price hospital-card-icon",children:(0,o.tZ)("img",{loading:"lazy",src:"/svg/price-green.svg",alt:"Price"})}),(0,o.tZ)("div",{className:"text-price",children:(0,o.BX)(r.T,{size:"c2",color:n.r.colors.green600,children:["".concat(Intl.NumberFormat(g).format(parseInt(a))," ").concat(s," "),p({id:"articlePage.careEmbedding.servicePrice",defaultMessage:"Service Price"})]})})]})]})}},KGmN:function(e,t,a){a.r(t),a.d(t,{default:function(){return containers_DoctorQuickBookingContainer}});var o=a("BGKE"),r=a("q1tI"),n=a("qQsD"),l=a("l9Yf"),i=a("sEfC"),d=a.n(i),c=a("E+oP"),s=a.n(c),u=a("wUmw"),p=a("dDsW"),g=a("CJtR"),v=a("YbGd"),h=a("jdT+"),m=a("P5LW"),f=a("rIrU"),b=a("SMvd"),y=a("r72T"),k=a("5nB9"),w=a("RehD"),x=a("/rh5"),C=a("09QT"),Z=a("/tR3"),S=a("oQBk"),E=a("i/U4"),B=a("crQX");let useDoctor=(e,t,a,n,l,i,d,c,s)=>{let[u,p]=(0,r.useState)(!1),[g,v]=(0,r.useState)(!1),[h,m]=(0,r.useState)([]),[f,b]=(0,r.useState)(null),y=(0,r.useRef)(null),k=(0,r.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,a;let o=(0,E.Y7)(e),r=(null===(a=y.current)||void 0===a?void 0:null===(t=a.find(e=>e.workingDay===o))||void 0===t?void 0:t.slots)||0;if(!r||0===r)return e})}catch(e){}return[]},[y.current]),w=(0,r.useMemo)(()=>h.map(e=>({value:e.id,label:(0,o.tZ)(B.Z,{name:e.name,price:e.price,priceUnit:e.priceUnit}),icon:(0,o.tZ)("img",{loading:"lazy",src:e.avatar,alt:e.slug})})),[h]),D=(0,r.useMemo)(()=>h.find(e=>e.id===(null==i?void 0:i.value)),[h,i]),T=(0,r.useMemo)(()=>{var e;return null==f?void 0:null===(e=f.find(e=>e.workingDay===(0,E.Y7)(c||new Date)))||void 0===e?void 0:e.workingTimes},[f,c]);return(0,r.useEffect)(()=>{if(!(null==l?void 0:l.value)){b(null);return}(async()=>{var e;p(!0);let t=await (0,C.d)(S.y.CARE.GET_DOCTOR_LIST,{params:{cityId:(null==a?void 0:a.value)||"",hospitalBranchId:null==l?void 0:l.value,random:1,specialtyId:null==n?void 0:n.value,keyword:d&&d.length>=3?d:""}},"care"),o=(null==t?void 0:null===(e=t._data)||void 0===e?void 0:e.doctors)?t._data.doctors.map(Z.XR):null;Array.isArray(o)&&(null==n?void 0:n.value)&&(null==l?void 0:l.value)&&m(o),p(!1)})()},[null==n?void 0:n.value,null==l?void 0:l.value,d.length>=3?d:""]),(0,r.useEffect)(()=>{if(!(null==i?void 0:i.value)&&!(null==i?void 0:i.id)){b(null);return}(async()=>{v(!0);let[a,o]=await Promise.all([(0,C.d)(S.y.CARE.GET_DOCTOR_SCHEDULE,{params:{id:String((null==i?void 0:i.value)||(null==i?void 0:i.id)),startDate:(0,E.Y7)(e),endDate:(0,E.Y7)(t)}},"care"),(0,C.d)(S.y.CARE.GET_DOCTOR_SCHEDULE,{params:{id:String((null==i?void 0:i.value)||(null==i?void 0:i.id)),startDate:(0,E.Y7)(e)}},"care")]);if((null==o?void 0:o._data)&&(y.current=o._data.schedules?o._data.schedules.map(Z.cv):null),null==a?void 0:a._data){var r;b((null==a?void 0:null===(r=a._data)||void 0===r?void 0:r.schedules)?a._data.schedules.map(Z.cv):null)}v(!1)})()},[i,null==i?void 0:i.value,(0,E.Y7)(e)]),(0,r.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,a,n)=>{let[l,i]=(0,r.useState)(!1),[d,c]=(0,r.useState)([]),s=(0,r.useMemo)(()=>d.map(e=>({...e,value:e.id,label:e.name,icon:(0,o.tZ)("img",{loading:"lazy",src:e.logo,alt:e.slug})})),[d]),u=(0,r.useMemo)(()=>d.find(e=>e.value===(null==n?void 0:n.value)),[d,n]);return(0,r.useEffect)(()=>{(null==e?void 0:e.value)&&(async()=>{var o;i(!0);let r=await (0,C.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:a&&a.length>=3?a:""}},"care"),n=null==r?void 0:null===(o=r._data)||void 0===o?void 0:o.searches;Array.isArray(n)&&c(n),i(!1)})()},[null==e?void 0:e.value,a.length>=3?a:""]),{list:d,loading:l,options:s,currentValue:u,notFound:!d.length}},useSpecialty=(e,t,a)=>{let[n,l]=(0,r.useState)(!1),[i,d]=(0,r.useState)([]),c=(0,r.useMemo)(()=>i.map(e=>({...e,value:e.id,label:e.name,icon:(0,o.tZ)("img",{loading:"lazy",src:e.thumbnail,alt:e.slug})})),[i]),s=(0,r.useMemo)(()=>i.find(e=>e.value===(null==a?void 0:a.value)),[i,a]);return(0,r.useEffect)(()=>{(null==e?void 0:e.value)&&(async()=>{var a;l(!0);let o=await (0,C.d)(S.y.CARE.GET_SEARCH_CARE,{params:{cityId:(null==e?void 0:e.value)||"",keyword:t&&t.length>=3?t:"",type:"global"}},"care"),r=null==o?void 0:null===(a=o._data)||void 0===a?void 0:a.specialties;Array.isArray(r)&&d(r),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=a("oBJH"),T=a("Sz1N"),_=a("J03+"),containers_DoctorQuickBookingContainer=e=>{var t;let{data:a,onClose:i,onSubmit:c,careType:x}=e,{formatMessage:C}=(0,p.Z)(),{locale:Z,router:{query:{currentUrl:S}}}=(0,m.h)(),[E,B]=(0,r.useState)(""),[M,R]=(0,r.useState)(""),[I,N]=(0,r.useState)(""),A=d()(e=>B(e),300),L=d()(e=>R(e),300),z=d()(e=>N(e),300),U=(0,r.useRef)(!s()(a)),[F,O]=(0,r.useState)(!0),{control:P,watch:X,setValue:Q}=(0,u.Gc)(),G=X("selected_city"),H=X("date"),q=X("selected_specialty"),Y=X("selected_hospital"),V=X("selected_doctor"),j=X("selected_schedule"),{date:W,setDate:K,startDate:J,endDate:$,dateMonthValue:ee}=(0,D.Y)(H),et=(0,r.useMemo)(()=>(null==j?void 0:j.value)?3:(null==V?void 0:V.value)||(null==V?void 0:V.id)?2:(null==Y?void 0:Y.value)?1:(null==q?void 0:q.value)?0:-1,[null==G?void 0:G.value,null==q?void 0:q.value,null==Y?void 0:Y.value,null==V?void 0:V.value,null==V?void 0:V.id,null==j?void 0:j.value]);(0,r.useEffect)(()=>{U.current||(Q("selected_specialty",f.XL),B(""))},[null==G?void 0:G.value]),(0,r.useEffect)(()=>{U.current||(Q("selected_hospital",f.XL),R(""))},[null==q?void 0:q.value,null==G?void 0:G.value]),(0,r.useEffect)(()=>{U.current||(Q("selected_doctor",f.XL),N(""))},[null==Y?void 0:Y.value]),(0,r.useEffect)(()=>{U.current||Q("selected_schedule","")},[null==V?void 0:V.value]),(0,r.useEffect)(()=>{Q("date",W),c()},[j]);let ea=useSpecialty(G,E,q),eo=useHospital(q,G,M,Y),er=useDoctor(J,$,G,q,Y,V,I,W,x);(0,r.useEffect)(()=>{O(!1)},[]),(0,r.useEffect)(()=>{if(a){var e,t,o,r,n,l;((null===(e=a.specialty)||void 0===e?void 0:e.id)||(null===(t=a.hospital)||void 0===t?void 0:t.id)||(null===(o=a.doctor)||void 0===o?void 0:o.id))&&(U.current=!0),(null===(r=a.specialty)||void 0===r?void 0:r.id)&&Q("selected_specialty",{...a.specialty,value:a.specialty.id||"",label:a.specialty.name||""}),(null===(n=a.hospital)||void 0===n?void 0:n.id)&&Q("selected_hospital",{...a.hospital,value:a.hospital.id,label:a.hospital.name||""}),(null===(l=a.doctor)||void 0===l?void 0:l.id)&&Q("selected_doctor",{...a.doctor,value:a.doctor.id,label:a.doctor.name||""}),setTimeout(()=>{U.current=!1},1e3)}},[a]),(0,r.useEffect)(()=>{!U.current&&Array.isArray(er.list)&&er.list.length>=1&&Q("selected_doctor",{...er.list[0]})},[er.list]);let en=[{title:C({id:"careBooking.selectSpecialty",defaultMessage:"Select specialty"}),isLoading:ea.loading,content:(0,o.tZ)(u.Qr,{name:"selected_specialty",control:P,render:e=>{let{field:{onChange:t,value:a}}=e;return(0,o.BX)(T.mF,{children:[(0,o.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:ea.options,value:a,placeholderIcon:(null==q?void 0:q.icon)||(0,o.tZ)(T.tv,{src:"".concat(f.Nr,"/search.svg")}),onChange:t,onSearchChange:A,placeholder:ea.notFound?C({id:"common.noResultFound",defaultMessage:"No result found"}):C({id:"careBooking.selectSpecialty",defaultMessage:"Select Specialty"}),useSearchFilter:!1,disabled:!(null==G?void 0:G.value)||ea.notFound&&!E}),ea.notFound&&!ea.loading&&(0,o.tZ)(w.Z,{type:_.jE.SEARCH,href:"".concat((0,g.Em)({locale:Z})),onClose:i})]})}})},{title:C({id:"careBooking.selectHospital",defaultMessage:"Select hospital"}),isLoading:eo.loading,content:(0,o.tZ)(u.Qr,{name:"selected_hospital",control:P,render:e=>{let{field:{onChange:t,value:r}}=e;return(0,o.BX)(T.mF,{children:[(0,o.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:eo.options,value:r,placeholderIcon:(null==Y?void 0:Y.icon)||(null==Y?void 0:Y.logo)&&(0,o.tZ)("img",{loading:"lazy",src:null==Y?void 0:Y.logo,alt:null==Y?void 0:Y.slug})||(0,o.tZ)(T.tv,{src:"".concat(f.Nr,"/search.svg")}),onChange:t,onSearchChange:L,placeholder:eo.notFound&&!M&&(null==q?void 0:q.value)?C({id:"common.noResultFound",defaultMessage:"No result found"}):C({id:"careBooking.selectHospital",defaultMessage:"Select hospital"}),disabled:!(null==q?void 0:q.value)||(eo.loading||eo.notFound)&&!M,useSearchFilter:!1}),s()(a)&&eo.notFound&&!eo.loading&&q&&q.value&&(M?(0,o.tZ)(w.Z,{type:_.jE.SEARCH,href:"".concat((0,g.uf)({locale:Z,slug:q.slug,citySlug:G.slug||G.label})),onClose:i}):(0,o.tZ)(w.Z,{type:_.jE.DEFAULT,translationId:"careBooking.noHospitalLabel",href:"".concat((0,g.uf)({locale:Z,slug:q.slug})),onClose:i}))]})}})},{title:C({id:"careBooking.selectDoctor",defaultMessage:"Select doctor"}),isLoading:er.loading,content:(0,o.tZ)(u.Qr,{name:"selected_doctor",control:P,render:e=>{var t,r;let{field:{onChange:n,value:l}}=e;return(0,o.BX)(T.mF,{children:[(0,o.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:er.options,value:l,onChange:n,onSearchChange:z,placeholderIcon:(0,o.tZ)(T.tv,{src:"".concat(f.Nr,"/search.svg")}),placeholder:er.notFound&&!I&&(null==Y?void 0:Y.value)?C({id:"common.noResultFound",defaultMessage:"No result found"}):C({id:"careBooking.selectDoctor",defaultMessage:"Select doctor"}),disabled:!(null==Y?void 0:Y.value)||(er.loading||er.notFound)&&!I,useSearchFilter:!1}),((null==V?void 0:V.id)||er.currentValue)&&(0,o.tZ)(k.Z,{logo:V.avatar||er.currentValue.avatar,name:V.name||er.currentValue.name,price:(null==V?void 0:V.price)||er.currentValue.price,priceUnit:V.priceUnit||"",onEditClick:()=>Q("selected_doctor",f.XL)}),s()(a)&&er.notFound&&!er.loading&&Y&&Y.value&&(I?(0,o.tZ)(w.Z,{type:_.jE.SEARCH,href:"".concat((0,g.D4)({id:Y.id,name:Y.name,locale:Z,slug:Y.slug}),"?tab=").concat(null===(r=f.a8[Z])||void 0===r?void 0:r.DOCTOR),onClose:i}):(0,o.tZ)(w.Z,{type:_.jE.DEFAULT,translationId:"careBooking.noDoctorLabel",href:"".concat((0,g.D4)({id:Y.id,name:Y.name,locale:Z,slug:Y.slug}),"?tab=").concat(null===(t=f.a8[Z])||void 0===t?void 0:t.DOCTOR),onClose:i}))]})}})},{title:C({id:"careBooking.selectTime",defaultMessage:"Select time"}),isLoading:er.scheduleLoading,content:(0,o.tZ)("div",{style:{paddingBottom:16}})}];return(0,o.tZ)(o.HY,{children:!F&&(0,o.BX)(o.HY,{children:[(0,o.tZ)(T.To,{children:(0,o.tZ)(h.R,{steps:en,currentStep:et})}),(0,o.BX)(T.oR,{children:[(0,o.tZ)(n.D,{className:"booking-date",customInput:e=>(0,o.tZ)(l.I,{type:"text",size:"md",name:"booking-date",...e,value:ee,isDisabled:!(null==Y?void 0:Y.value)||!er.schedule||er.scheduleLoading,actionIcon:(0,o.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=er.disabledDays)&&void 0!==t?t:[],{before:new Date,after:Array.isArray(er.allSchedule)&&er.allSchedule.length>0?new Date(er.allSchedule[0].workingDay):$}],locale:Z,pickedDate:W,displayDateFormat:f.c7,onChange:e=>{K(e)},placeholder:""}),((null==V?void 0:V.value)||(null==V?void 0:V.id))&&(0,o.BX)(o.HY,{children:[(0,o.tZ)(b.L,{startDate:J,endDate:$,schedules:er.schedule,date:W,setDate:K,locale:Z,dataEventCategory:"Care",dataEventAction:"Doctor Quick Booking - Appointment Click",dataEventLabel:S}),(0,o.tZ)(y.l,{workingTimes:er.workingTime,scheduleId:j,setScheduleId:e=>Q("selected_schedule",e),dataEventCategory:"Care",dataEventAction:"Doctor Quick Booking - Appointment Click",dataEventLabel:S})]})]})]})})}},LqwN:function(e,t,a){a.r(t),a.d(t,{default:function(){return containers_ServiceQuickBookingContainer}});var o=a("BGKE"),r=a("q1tI"),n=a("qQsD"),l=a("l9Yf"),i=a("sEfC"),d=a.n(i),c=a("E+oP"),s=a.n(c),u=a("wUmw"),p=a("dDsW"),g=a("CJtR"),v=a("YbGd"),h=a("jdT+"),m=a("P5LW"),f=a("rIrU"),b=a("SMvd"),y=a("r72T"),k=a("5nB9"),w=a("RehD"),x=a("/rh5"),C=a("q1s5"),Z=a("09QT"),S=a("/tR3"),E=a("oQBk"),B=a("i/U4"),D=a("crQX");let useService=(e,t,a,n,l,i,d,c)=>{let[s,u]=(0,r.useState)(!1),[p,g]=(0,r.useState)(!1),[v,h]=(0,r.useState)([]),[m,f]=(0,r.useState)(null),b=(0,r.useRef)(null),y=(0,r.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,C.Z)(new Date((null===(e=b.current[0])||void 0===e?void 0:e.workingDay)||t),{days:1})}).map(e=>{var t,a;let o=(0,B.Y7)(e),r=(null===(a=b.current)||void 0===a?void 0:null===(t=a.find(e=>e.workingDay===o))||void 0===t?void 0:t.slots)||0;if(!r||0===r)return e})}catch(e){}return[]},[b.current]),k=(0,r.useMemo)(()=>v.map(e=>{var t,a,r,n;return{...e,value:(null===(t=e.hospital)||void 0===t?void 0:t.id)||e.id,label:(0,o.tZ)(D.Z,{name:(null===(a=e.hospital)||void 0===a?void 0:a.name)||e.name,price:e.price,priceUnit:e.priceUnit}),icon:(0,o.tZ)("img",{loading:"lazy",src:(null===(r=e.hospital)||void 0===r?void 0:r.logo)||e.logo,alt:(null===(n=e.hospital)||void 0===n?void 0:n.name)||e.name,className:"hospital-image"})}}),[v]),w=(0,r.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,r.useMemo)(()=>w()?w():(null==l?void 0:l.value)?l:void 0,[w,null==l?void 0:l.value,null==a?void 0:a.value]),_=(0,r.useMemo)(()=>{var e;return null==m?void 0:null===(e=m.find(e=>e.workingDay===(0,B.Y7)(d||new Date)))||void 0===e?void 0:e.workingTimes},[m,d]);return(0,r.useEffect)(()=>{(null==n?void 0:n.value)&&(null==n?void 0:n.value)!==""&&(async()=>{u(!0);let e=await (0,Z.d)(E.y.CARE.GET_SEARCH_CARE,{params:{cityId:(null==a?void 0:a.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==a?void 0:a.value,i&&i.length>=3?i:""]),(0,r.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[o,r]=await Promise.all([(0,Z.d)(E.y.CARE.GET_SERVICE_SCHEDULE,{params:{serviceId:String(null==l?void 0:l.id),startDate:(0,B.Y7)(e),endDate:(0,B.Y7)(t)}},"care"),(0,Z.d)(E.y.CARE.GET_SERVICE_SCHEDULE,{params:{serviceId:String(null==l?void 0:l.id),startDate:(0,B.Y7)(e)}},"care")]);if((null==r?void 0:r._data)&&(b.current=r._data.schedules?r._data.schedules.map(S.ph):null),null==o?void 0:o._data){var a;f((null==o?void 0:null===(a=o._data)||void 0===a?void 0:a.schedules)?o._data.schedules.map(S.ph):null)}g(!1)}})()},[null==l?void 0:l.value,(0,B.Y7)(e)]),(0,r.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,a)=>{let[n,l]=(0,r.useState)(!1),[i,d]=(0,r.useState)([]),c=(0,r.useMemo)(()=>i.map(e=>({value:e.id,label:e.name,icon:(0,o.tZ)("img",{loading:"lazy",src:e.logo||f.A4,alt:e.slug})})),[i]),s=(0,r.useMemo)(()=>c.find(e=>e.value===(null==a?void 0:a.value))?c.find(e=>e.value===(null==a?void 0:a.value)):(null==a?void 0:a.value)?{value:a.value,label:a.label,icon:(0,o.tZ)("img",{loading:"lazy",src:a.logo||f.A4,alt:a.slug})}:void 0,[c,null==a?void 0:a.value,null==e?void 0:e.value]);return(0,r.useEffect)(()=>{(null==e?void 0:e.value)&&(async()=>{l(!0);let e=await (0,Z.d)(E.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=a("oBJH"),_=a("Sz1N"),M=a("J03+"),containers_ServiceQuickBookingContainer=e=>{var t;let{data:a,onClose:i,onSubmit:c,careType:x}=e,{formatMessage:C}=(0,p.Z)(),{locale:Z,router:{query:{currentUrl:S}}}=(0,m.h)(),[E,B]=(0,r.useState)(""),[D,R]=(0,r.useState)(""),I=d()(e=>B(e),300),N=d()(e=>R(e),300),A=(0,r.useRef)(!s()(a)),{control:L,watch:z,setValue:U}=(0,u.Gc)(),F=z("selected_city"),O=z("date"),P=z("selected_service_type"),X=z("selected_service"),Q=z("selected_service_schedule"),{date:G,setDate:H,startDate:q,endDate:Y,dateMonthValue:V}=(0,T.Y)(O),j=(0,r.useMemo)(()=>(null==Q?void 0:Q.value)?2:(null==X?void 0:X.value)?1:(null==P?void 0:P.value)?0:-1,[null==F?void 0:F.value,null==Q?void 0:Q.value,null==X?void 0:X.value,null==P?void 0:P.value]);(0,r.useEffect)(()=>{A.current||(U("selected_service_type",f.XL),B(""))},[null==F?void 0:F.value]),(0,r.useEffect)(()=>{A.current||(U("selected_service",f.XL),R(""))},[null==P?void 0:P.value]),(0,r.useEffect)(()=>{A.current||U("selected_service_schedule","")},[null==X?void 0:X.value]),(0,r.useEffect)(()=>{U("date",G),c()},[Q]);let[W,K]=(0,r.useState)(!0);(0,r.useEffect)(()=>{K(!1)},[]),(0,r.useEffect)(()=>{s()(a)&&x===M.yU.SERVICE&&(U("date",G),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,r.useEffect)(()=>{if(a&&!s()(a)){var e,t,o,r;((null===(e=a.service)||void 0===e?void 0:e.id)||(null===(t=a.serviceType)||void 0===t?void 0:t.id))&&(A.current=!0),(null===(o=a.serviceType)||void 0===o?void 0:o.id)&&U("selected_service_type",{...a.serviceType,value:a.serviceType.id||"",label:a.serviceType.name||""}),(null===(r=a.service)||void 0===r?void 0:r.id)&&U("selected_service",{...a.service,value:a.service.id,label:a.service.name||""}),setTimeout(()=>{A.current=!1},1e3)}},[a]);let J=useServiceType(F,E,P),$=useService(q,Y,F,P,X,D,G,x),ee=[{title:C({id:"careBooking.selectService",defaultMessage:"Select a service"}),isLoading:J.loading,content:(0,o.tZ)(u.Qr,{name:"selected_service_type",control:L,render:e=>{var t;let{field:{onChange:a,value:r}}=e;return(0,o.BX)(_.mF,{children:[(0,o.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:r,onChange:a,placeholderIcon:(null===(t=J.currentValue)||void 0===t?void 0:t.icon)||(0,o.tZ)(_.tv,{src:"".concat(f.Nr,"/search.svg")}),onSearchChange:I,placeholder:J.notFound?C({id:"common.noResultFound",defaultMessage:"No result found"}):C({id:"careBooking.selectService",defaultMessage:"Select a service"}),useSearchFilter:!1,disabled:!(null==F?void 0:F.value)||J.notFound&&!E}),J.notFound&&!J.loading&&F&&F.value&&(0,o.tZ)(w.Z,{type:M.jE.SEARCH,href:"".concat((0,g.qQ)({locale:Z,citySlug:F.slug||F.label})),onClose:i})]})}})},{title:C({id:"careBooking.selectHospital",defaultMessage:"Select hospital"}),isLoading:$.loading,content:(0,o.tZ)(u.Qr,{name:"selected_service",control:L,render:e=>{var t,a;let{field:{onChange:r,value:n}}=e;return(0,o.BX)(_.mF,{children:[(0,o.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==X?void 0:X.icon)||(0,o.tZ)(_.tv,{src:"".concat(f.Nr,"/search.svg")}),onChange:r,onSearchChange:N,placeholder:C({id:"careBooking.selectHospital",defaultMessage:"Select hospital"}),useSearchFilter:!1,disabled:!(null==P?void 0:P.value)||(null==P?void 0:P.value)===""||$.loading||!D&&""!==D}),$.currentValue&&(0,o.tZ)(k.Z,{logo:(null===(t=$.currentValue.hospital)||void 0===t?void 0:t.logo)||$.currentValue.logo,name:(null===(a=$.currentValue.hospital)||void 0===a?void 0:a.name)||$.currentValue.name,price:$.currentValue.price,priceUnit:$.currentValue.priceUnit,onEditClick:()=>U("selected_service",f.XL)}),$.notFound&&!$.loading&&P&&P.value&&(D?(0,o.tZ)(w.Z,{type:M.jE.SEARCH,href:"".concat((0,g.qQ)({locale:Z,citySlug:(null==F?void 0:F.slug)||(null==F?void 0:F.label)})),onClose:i}):(0,o.tZ)(w.Z,{type:M.jE.DEFAULT,translationId:"careBooking.noHospitalLabel",href:"".concat((0,g.qQ)({locale:Z,citySlug:(null==F?void 0:F.slug)||(null==F?void 0:F.label)})),onClose:i}))]})}})},{title:C({id:"careBooking.selectTime",defaultMessage:"Select time"}),isLoading:$.scheduleLoading,content:(0,o.tZ)("div",{style:{paddingBottom:16}})}];return(0,o.tZ)(o.HY,{children:!W&&(0,o.BX)(o.HY,{children:[(0,o.tZ)(_.To,{children:(0,o.tZ)(h.R,{steps:ee,currentStep:j})}),(0,o.BX)(_.oR,{children:[(0,o.tZ)(n.D,{className:"booking-date",customInput:e=>(0,o.tZ)(l.I,{type:"text",size:"md",name:"booking-date",...e,value:V,isDisabled:!(null==X?void 0:X.value),actionIcon:(0,o.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):Y}],locale:Z,pickedDate:G,displayDateFormat:f.c7,onChange:e=>H(e)}),(0,o.tZ)(b.L,{startDate:q,endDate:Y,schedules:$.schedule,date:G,setDate:H,locale:Z,dataEventCategory:"Care",dataEventAction:"Service Quick Booking - Appointment Click",dataEventLabel:S}),(0,o.tZ)(y.l,{workingTimes:$.workingTime,scheduleId:Q,setScheduleId:e=>U("selected_service_schedule",e),dataEventCategory:"Care",dataEventAction:"Service Quick Booking - Appointment Click",dataEventLabel:S})]})]})})}},oBJH:function(e,t,a){a.d(t,{Y:function(){return useDate}});var o=a("q1tI"),r=a("L8hi"),n=a("IjAw"),l=a("EhJz"),i=a("1i5A"),d=a("a4op"),c=a("rIrU");let useDate=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,[t,a]=(0,o.useState)(e),{localize:s}=(0,d.k)(),u=(0,o.useMemo)(()=>(0,r.Z)(t,{weekStartsOn:1}),[t]),p=(0,o.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,o.useMemo)(()=>"".concat(s.month(t.getMonth(),{width:"wide"})," ").concat(t.getFullYear()),[s,t]);return{date:t,setDate:a,startDate:p,endDate:u,dateMonthValue:g}}},Sz1N:function(e,t,a){a.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 o=a("rBCA"),r=a("iBNF"),n=a("uuQu");let l=(0,o.Z)("form",{target:"e1oqgwk50"})("position:relative;/* overflow:auto;*/\n flex:1;::-webkit-scrollbar{display:none;}"),i=(0,o.Z)("div",{target:"e1oqgwk51"})("position:sticky;z-index:1;top:0;display:flex;height:40px;align-items:center;padding:0 24px;background-color:",r.r.colors.primary50,";input{padding-left:8px;border:none;font-weight:",r.r.sizes.fwSemiBold," !important;color:",r.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:",r.r.sizes.fwSemiBold,";}ul{z-index:",r.r.zIndexes.onTop,";background-color:",r.r.colors.white,";li{padding-block:8px !important;}}}"),d=(0,o.Z)("div",{target:"e1oqgwk52"})("padding:8px 16px 0;.booking-select{&[data-has-icons='true']{border:1px solid ",r.r.colors.gray200,";&:not([data-disabled='true']){background-color:",r.r.colors.white,";}}ul{z-index:",r.r.zIndexes.onTop,";max-height:304px;background-color:",r.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,o.Z)("div",{target:"e1oqgwk53"})("padding:16px 24px;background-color:",r.r.colors.neutral50,";input{background-color:",r.r.colors.white,";cursor:pointer;}"),s=(0,o.Z)("div",{target:"e1oqgwk54"})("position:sticky;bottom:0;z-index:0;width:100%;display:flex;gap:8px;padding:16px 24px;background-color:",r.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,o.Z)("div",{target:"e1oqgwk55"})("position:relative;padding:8px 0 24px;font-size:14px;.no-result{margin-top:8px;a{text-decoration:none;}}"),p=(0,o.Z)("div",{target:"e1oqgwk56"})("position:absolute;top:5px;left:0;display:flex;width:100%;align-items:center;padding:8px;background-color:",r.r.colors.neutral50,";border-radius:",r.r.borderRadius,";gap:8px;> img{flex-grow:0;flex-shrink:0;width:32px;height:32px;border-radius:50%;object-fit:cover;outline:1px solid ",r.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,o.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:",r.r.colors.gray600," !important;transition:stroke 0.2s;}&.disabled{pointer-events:none;path{stroke:",r.r.colors.gray300," !important;}}&.right{transform:rotateZ(180deg);}}"),v=(0,o.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,o.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:",r.r.colors.white,";border-radius:",r.r.borderRadius,";cursor:pointer;&[data-active='true']{border-color:",r.r.colors.primaryBase,";background-color:",r.r.colors.primary50,";}p{line-height:18px;}"),m=(0,o.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,o.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 ",r.r.colors.neutral200,";> span{color:",r.r.colors.gray800,";font-weight:",r.r.sizes.fwRegular,";}}}"),b=(0,o.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:",r.r.colors.neutral50,";}&-button{width:100%;/* padding:7px 16px;*/\n max-height:32px;border-radius:4px;&.active{}}}"),y=(0,o.Z)("div",{target:"e1oqgwk513"})("padding:8px 8px 8px 16px;position:absolute;top:0;left:0;width:100%;height:60px;background-color:",r.r.colors.neutral50,";border-radius:",r.r.borderRadius,";p{font-size:14px;font-weight:400;color:",r.r.colors.gray400,";letter-spacing:-0.2px;line-height:22px;}"),k=(0,o.Z)("img",{target:"e1oqgwk514"})("width:24px;height:24px;"),w=(0,o.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}}},"i/rW":function(e,t,a){a.r(t),a.d(t,{QuickBookingDrawer:function(){return QuickBookingDrawer}});var o=a("BGKE"),r=a("q1tI"),n=a("MmHG"),l=a("iBNF"),i=a("bVHi"),d=a("5t9f"),c=a("sEfC"),s=a.n(c),u=a("Vvt1"),p=a.n(u),g=a("wUmw"),v=a("dDsW"),h=a("a5vB"),m=a("vOFr"),f=a.n(m),b=a("CJtR"),y=a("IoKP"),k=a("YbGd"),w=a("i/U4"),x=a("P5LW"),C=a("rIrU"),Z=a("o0qI"),S=a("Zr8O"),E=a("LgdP"),B=a("hXNO"),D=a("Sz1N"),components_ButtonGroup=e=>{let{onClickSubmit:t,isFormValid:a,redirectUrl:r,submitButtonTrackingCode:n,learnMoreButtonTrackingCode:l}=e,{formatMessage:i}=(0,v.Z)(),{locale:d}=(0,x.h)(),c=(0,B.d)();return(0,o.BX)(D.I,{children:[(0,o.tZ)("a",{href:r,target:"_blank",onClick:t,...n,children:(0,o.tZ)(E.B,{color:"primary",size:c?"md":"lg",isDisabled:!a,children:i({id:"careBooking.submitButton",defaultMessage:"Book a doctor"})})}),(0,o.tZ)("a",{href:"https://".concat((0,b.Ok)(d)),target:"_blank",...l,children:(0,o.tZ)(E.B,{color:"secondary",size:c?"md":"lg",children:i({id:"careBooking.learnMore",defaultMessage:"Learn more"})})})]})},T=a("8wjV"),_=a("J03+"),components_CareTypeSwitch=e=>{let{careType:t,onCareTypeChange:a,currentUrl:r}=e,{formatMessage:n}=(0,v.Z)();return(0,o.tZ)(D.UX,{children:(0,o.BX)("div",{className:"type-wrapper",children:[(0,o.tZ)(T.B,{className:"type-button",size:"sm",variant:t===_.yU.DOCTOR?"primary":"ghost",onClick:()=>a(_.yU.DOCTOR),"data-event-category":"Care","data-event-action":"Quick Booking - Doctor Tab Click","data-event-label":r,children:n({id:"careBooking.doctor",defaultMessage:"Doctor"})}),(0,o.tZ)(T.B,{className:"type-button",size:"sm",variant:t===_.yU.SERVICE?"primary":"ghost",onClick:()=>a(_.yU.SERVICE),"data-event-category":"Care","data-event-action":"Quick Booking - Service Tab Click","data-event-label":r,children:n({id:"careBooking.service",defaultMessage:"Service"})})]})})},M=a("09QT"),R=a("oQBk");p()(()=>Promise.all([a.e(9377),a.e(9043),a.e(9409),a.e(6259),a.e(1818),a.e(7519),a.e(761),a.e(2189),a.e(5231),a.e(7797),a.e(5454),a.e(5481),a.e(140),a.e(5718),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(4190),a.e(2582),a.e(6509),a.e(5308),a.e(4125),a.e(9715),a.e(7730),a.e(3929),a.e(891),a.e(137),a.e(4414),a.e(1079),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413),a.e(2138),a.e(9467),a.e(4467),a.e(6966),a.e(5243),a.e(8132),a.e(1375),a.e(4561),a.e(1448),a.e(5465),a.e(1217),a.e(5480),a.e(731),a.e(2050),a.e(2008),a.e(8469),a.e(8214),a.e(1482),a.e(6817),a.e(467),a.e(5951),a.e(9357),a.e(747),a.e(5675),a.e(6753),a.e(4802),a.e(3046),a.e(5745),a.e(3437),a.e(252),a.e(6839),a.e(9424),a.e(5702),a.e(8922),a.e(6399),a.e(553),a.e(2902),a.e(4969),a.e(3257),a.e(6611),a.e(7538),a.e(6894),a.e(5341),a.e(4846),a.e(2233),a.e(1058),a.e(3295),a.e(1538),a.e(7152),a.e(5684),a.e(2574),a.e(9884),a.e(7644),a.e(6962),a.e(8767),a.e(6638),a.e(7741),a.e(3434),a.e(2433),a.e(5385),a.e(3564),a.e(7082),a.e(3158),a.e(5641),a.e(7454),a.e(7004),a.e(4758),a.e(6219),a.e(17),a.e(8990),a.e(4067),a.e(9487),a.e(9083),a.e(1520),a.e(270),a.e(7596),a.e(8217),a.e(7543),a.e(2835),a.e(2507),a.e(6885),a.e(7859),a.e(690),a.e(2730),a.e(6287),a.e(7682),a.e(1551),a.e(4870),a.e(9922),a.e(3133),a.e(612),a.e(2002),a.e(1880),a.e(7471),a.e(7165),a.e(5451),a.e(8612),a.e(2819),a.e(7695),a.e(3602),a.e(8101)]).then(a.bind(a,"KGmN")),{loadableGenerated:{webpack:()=>["KGmN"]}}),p()(()=>Promise.all([a.e(9377),a.e(9043),a.e(9409),a.e(6259),a.e(1818),a.e(7519),a.e(761),a.e(2189),a.e(5231),a.e(7797),a.e(5454),a.e(5481),a.e(140),a.e(5718),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(4190),a.e(2582),a.e(6509),a.e(5308),a.e(4125),a.e(9715),a.e(7730),a.e(3929),a.e(891),a.e(137),a.e(4414),a.e(1079),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413),a.e(2138),a.e(9467),a.e(4467),a.e(6966),a.e(5243),a.e(8132),a.e(1375),a.e(4561),a.e(1448),a.e(5465),a.e(1217),a.e(5480),a.e(731),a.e(2050),a.e(2008),a.e(8469),a.e(8214),a.e(1482),a.e(6817),a.e(467),a.e(5951),a.e(9357),a.e(747),a.e(5675),a.e(6753),a.e(4802),a.e(3046),a.e(5745),a.e(3437),a.e(252),a.e(6839),a.e(9424),a.e(5702),a.e(8922),a.e(6399),a.e(553),a.e(2902),a.e(4969),a.e(3257),a.e(6611),a.e(7538),a.e(6894),a.e(5341),a.e(4846),a.e(2233),a.e(1058),a.e(3295),a.e(1538),a.e(7152),a.e(5684),a.e(2574),a.e(9884),a.e(7644),a.e(6962),a.e(8767),a.e(6638),a.e(7741),a.e(3434),a.e(2433),a.e(5385),a.e(3564),a.e(7082),a.e(3158),a.e(5641),a.e(7454),a.e(7004),a.e(4758),a.e(6219),a.e(17),a.e(8990),a.e(4067),a.e(9487),a.e(9083),a.e(1520),a.e(270),a.e(7596),a.e(8217),a.e(7543),a.e(2835),a.e(2507),a.e(6885),a.e(7859),a.e(690),a.e(2730),a.e(6287),a.e(7682),a.e(1551),a.e(4870),a.e(9922),a.e(3133),a.e(612),a.e(2002),a.e(1880),a.e(7471),a.e(7165),a.e(5451),a.e(8612),a.e(2819),a.e(7695),a.e(3602),a.e(4344)]).then(a.bind(a,"LqwN")),{loadableGenerated:{webpack:()=>["LqwN"]}});let getLocation=()=>new Promise((e,t)=>{navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(t=>{e({longitude:t.coords.longitude,latitude:t.coords.latitude})},e=>{console.log("Getting location failed:",e.message),t()},{timeout:3e4,maximumAge:0}):t()}),useCity=function(e,t,a,o){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",[l,i]=(0,r.useState)(!1),[d,c]=(0,r.useState)([]),s=(0,r.useRef)([]),[u,p]=(0,r.useState)(!0),g=(0,r.useCallback)(()=>{c(s.current)},[]);return(0,r.useEffect)(()=>{e&&(async()=>{try{i(!0);let e=await (0,M.d)(R.y.CARE.GET_CARE_GEOBYIP,void 0,"care");if(null==e?void 0:e._data){let{default:a={},cities:r}=e._data;c(r||[]),s.current=r;let n=o?r.find(e=>e.id===o):a;null==t||t("selected_city",{...n,value:n.id,label:n.name})}}catch(e){}finally{i(!1)}})()},[e,o]),(0,r.useEffect)(()=>{n&&""!==n&&n.length>=3?(async()=>{try{i(!0);let e=await (0,M.d)(R.y.CARE.GET_CARE_CITY_LIST,{params:{keyword:n}},"care");if(null==e?void 0:e._data){let{cities:t}=e._data;c(t||[])}}catch(e){}finally{i(!1)}})():c(s.current)},[n]),(0,r.useEffect)(()=>{e&&(async()=>{i(!0);try{if((null==a?void 0:a.value)===0){let e={latitude:"",longitude:""};try{e=await getLocation(),p(!0)}catch(e){p(!1)}let a=await (0,M.d)(R.y.CARE.GET_CARE_GEOBYIP,{params:e},"care");if(null==a?void 0:a._data){let{default:e={}}=a._data;null==t||t("selected_city",{...e,value:e.id,label:e.name})}}}catch(e){}finally{i(!1)}})()},[null==a?void 0:a.value]),{loading:l,permission:u,setCityLoading:i,cityList:d,onFocus:g}},I=p()(()=>Promise.all([a.e(9377),a.e(9043),a.e(9409),a.e(6259),a.e(1818),a.e(7519),a.e(761),a.e(2189),a.e(5231),a.e(7797),a.e(5454),a.e(5481),a.e(140),a.e(5718),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(4190),a.e(2582),a.e(6509),a.e(5308),a.e(4125),a.e(9715),a.e(7730),a.e(3929),a.e(891),a.e(137),a.e(4414),a.e(1079),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413),a.e(2138),a.e(9467),a.e(4467),a.e(6966),a.e(5243),a.e(8132),a.e(1375),a.e(4561),a.e(1448),a.e(5465),a.e(1217),a.e(5480),a.e(731),a.e(2050),a.e(2008),a.e(8469),a.e(8214),a.e(1482),a.e(6817),a.e(467),a.e(5951),a.e(9357),a.e(747),a.e(5675),a.e(6753),a.e(4802),a.e(3046),a.e(5745),a.e(3437),a.e(252),a.e(6839),a.e(9424),a.e(5702),a.e(8922),a.e(6399),a.e(553),a.e(2902),a.e(4969),a.e(3257),a.e(6611),a.e(7538),a.e(6894),a.e(5341),a.e(4846),a.e(2233),a.e(1058),a.e(3295),a.e(1538),a.e(7152),a.e(5684),a.e(2574),a.e(9884),a.e(7644),a.e(6962),a.e(8767),a.e(6638),a.e(7741),a.e(3434),a.e(2433),a.e(5385),a.e(3564),a.e(7082),a.e(3158),a.e(5641),a.e(7454),a.e(7004),a.e(4758),a.e(6219),a.e(17),a.e(8990),a.e(4067),a.e(9487),a.e(9083),a.e(1520),a.e(270),a.e(7596),a.e(8217),a.e(7543),a.e(2835),a.e(2507),a.e(6885),a.e(7859),a.e(690),a.e(2730),a.e(6287),a.e(7682),a.e(1551),a.e(4870),a.e(9922),a.e(3133),a.e(612),a.e(2002),a.e(1880),a.e(7471),a.e(7165),a.e(5451),a.e(8612),a.e(2819),a.e(7695),a.e(3602),a.e(8101)]).then(a.bind(a,"KGmN")),{loadableGenerated:{webpack:()=>["KGmN"]}}),N=p()(()=>Promise.all([a.e(9377),a.e(9043),a.e(9409),a.e(6259),a.e(1818),a.e(7519),a.e(761),a.e(2189),a.e(5231),a.e(7797),a.e(5454),a.e(5481),a.e(140),a.e(5718),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(4190),a.e(2582),a.e(6509),a.e(5308),a.e(4125),a.e(9715),a.e(7730),a.e(3929),a.e(891),a.e(137),a.e(4414),a.e(1079),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413),a.e(2138),a.e(9467),a.e(4467),a.e(6966),a.e(5243),a.e(8132),a.e(1375),a.e(4561),a.e(1448),a.e(5465),a.e(1217),a.e(5480),a.e(731),a.e(2050),a.e(2008),a.e(8469),a.e(8214),a.e(1482),a.e(6817),a.e(467),a.e(5951),a.e(9357),a.e(747),a.e(5675),a.e(6753),a.e(4802),a.e(3046),a.e(5745),a.e(3437),a.e(252),a.e(6839),a.e(9424),a.e(5702),a.e(8922),a.e(6399),a.e(553),a.e(2902),a.e(4969),a.e(3257),a.e(6611),a.e(7538),a.e(6894),a.e(5341),a.e(4846),a.e(2233),a.e(1058),a.e(3295),a.e(1538),a.e(7152),a.e(5684),a.e(2574),a.e(9884),a.e(7644),a.e(6962),a.e(8767),a.e(6638),a.e(7741),a.e(3434),a.e(2433),a.e(5385),a.e(3564),a.e(7082),a.e(3158),a.e(5641),a.e(7454),a.e(7004),a.e(4758),a.e(6219),a.e(17),a.e(8990),a.e(4067),a.e(9487),a.e(9083),a.e(1520),a.e(270),a.e(7596),a.e(8217),a.e(7543),a.e(2835),a.e(2507),a.e(6885),a.e(7859),a.e(690),a.e(2730),a.e(6287),a.e(7682),a.e(1551),a.e(4870),a.e(9922),a.e(3133),a.e(612),a.e(2002),a.e(1880),a.e(7471),a.e(7165),a.e(5451),a.e(8612),a.e(2819),a.e(7695),a.e(3602),a.e(4344)]).then(a.bind(a,"LqwN")),{loadableGenerated:{webpack:()=>["LqwN"]}}),QuickBookingDrawer=()=>{let{locale:e,router:{query:{currentUrl:t}}}=(0,x.h)(),{setCareType:a,setOpenQuickBookingDrawer:c,careType:u,openQuickBookingDrawer:p,data:m}=(0,S.B)(e=>e,h.X),{formatMessage:E}=(0,v.Z)(),[B,T]=(0,r.useState)(!1),{state:{isLoggedIn:M}}=(0,r.useContext)(Z.I),R=(0,g.cI)(),{handleSubmit:A,control:L,setValue:z,watch:U}=R,F=U("selected_city"),[O,P]=(0,r.useState)(""),X=s()(e=>P(e),300),Q=useCity(p,z,F,void 0,O),[G,H]=(0,r.useState)(),q=(0,r.useMemo)(()=>Q.permission?[{label:E({id:"search.currentLocation",defaultMessage:"My Location"}),value:0,icon:(0,o.tZ)(f(),{})}]:[{label:E({id:"careBooking.grantLocation",defaultMessage:"Please allow permission to search by current location"}),value:-1,disabled:!0}],[Q.permission]),Y=(0,r.useMemo)(()=>Q.cityList.map(e=>({...e,label:e.name,value:e.id})),[Q.cityList]),V=(0,r.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]),j=(0,r.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 a,o,r,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===(a=t.selected_doctor)||void 0===a?void 0:a.value)||(null===(o=t.selected_doctor)||void 0===o?void 0:o.id),"&scheduleId=").concat(t.selected_schedule),h="doctor",T(!!((null===(r=t.selected_city)||void 0===r?void 0:r.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);H(m||void 0)}};return(0,o.tZ)(d.d,{opened:p,onClose:()=>c(!1),title:(0,o.tZ)(n.T,{size:"lg",type:"bold",color:l.r.colors.secondaryBase,children:u===_.yU.DOCTOR?E({id:"careBooking.doctorBooking",defaultMessage:"Book a doctor"}):E({id:"careBooking.serviceBooking",defaultMessage:"Book a service"})}),size:500,position:"right",zIndex:310,styles:D.HA,lockScroll:!0,children:(0,o.tZ)(g.RV,{...R,children:(0,o.BX)(D.t6,{onSubmit:A(onSubmit),children:[(0,o.tZ)(g.Qr,{name:"selected_city",control:L,rules:{required:!0},render:e=>{let{field:{onChange:a,value:r}}=e;return(0,o.BX)(D.qH,{children:[(0,o.BX)(n.T,{type:"regular",size:"sm",children:[E({id:"search.currentLocation",defaultMessage:"Current location"}),":"]}),(0,o.tZ)(k.s,{id:"location-dropdown",options:[...q,...Y],value:r,onChange:a,onSearchChange:X,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,o.tZ)(y.Z,{})]})}}),(0,o.tZ)(components_CareTypeSwitch,{careType:u,currentUrl:t,onCareTypeChange:e=>{a(e)}}),(()=>{switch(u){case _.yU.DOCTOR:return(0,o.tZ)(I,{data:m,careType:u,onClose:()=>c(!1),onSubmit:A(onSubmit)});case _.yU.SERVICE:return(0,o.tZ)(N,{data:m,careType:u,onClose:()=>c(!1),onSubmit:A(onSubmit)});default:return null}})(),(0,o.tZ)(components_ButtonGroup,{onClickSubmit:e=>{B?(c(!1),M?window.open(G):C.Ew?i.u.getState().triggerLogin({returnUrl:G}):window.open((0,b.bT)(G))):e.preventDefault()},isFormValid:B,redirectUrl:G,submitButtonTrackingCode:V,learnMoreButtonTrackingCode:j})]})})})}},"J03+":function(e,t,a){var o,r,n,l,i,d;a.d(t,{jE:function(){return n},yU:function(){return o}}),(l=o||(o={}))[l.DOCTOR=0]="DOCTOR",l[l.SERVICE=1]="SERVICE",(i=r||(r={}))[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,a){a.r(t),a.d(t,{QuickBookingDrawerWrapper:function(){return QuickBookingDrawerWrapper}});var o=a("BGKE"),r=a("Vvt1"),n=a.n(r),l=a("a5vB"),i=a("Zr8O");let d=n()(()=>Promise.all([a.e(9409),a.e(6259),a.e(1818),a.e(7519),a.e(761),a.e(2189),a.e(5231),a.e(7797),a.e(5454),a.e(5481),a.e(140),a.e(5718),a.e(3684),a.e(5349),a.e(4148),a.e(2509),a.e(1533),a.e(1108),a.e(9124),a.e(4190),a.e(2582),a.e(6509),a.e(5308),a.e(4125),a.e(9715),a.e(7730),a.e(3929),a.e(891),a.e(137),a.e(4414),a.e(1079),a.e(7613),a.e(8098),a.e(3416),a.e(2500),a.e(1570),a.e(3506),a.e(1413),a.e(2138),a.e(9467),a.e(4467),a.e(6966),a.e(5243),a.e(8132),a.e(1375),a.e(4561),a.e(1448),a.e(5465),a.e(1217),a.e(5480),a.e(731),a.e(2050),a.e(2008),a.e(8469),a.e(8214),a.e(1482),a.e(6817),a.e(467),a.e(5951),a.e(9357),a.e(747),a.e(5675),a.e(6753),a.e(4802),a.e(3046),a.e(5745),a.e(3437),a.e(252),a.e(6839),a.e(9424),a.e(5702),a.e(8922),a.e(6399),a.e(553),a.e(2902),a.e(4969),a.e(3257),a.e(6611),a.e(7538),a.e(6894),a.e(5341),a.e(4846),a.e(2233),a.e(1058),a.e(3295),a.e(1538),a.e(7152),a.e(5684),a.e(2574),a.e(9884),a.e(7644),a.e(6962),a.e(8767),a.e(6638),a.e(7741),a.e(3434),a.e(2433),a.e(5385),a.e(3564),a.e(7082),a.e(3158),a.e(5641),a.e(7454),a.e(7004),a.e(4758),a.e(6219),a.e(17),a.e(8990),a.e(4067),a.e(9487),a.e(9083),a.e(1520),a.e(270),a.e(7596),a.e(8217),a.e(7543),a.e(2835),a.e(2507),a.e(6885),a.e(7859),a.e(690),a.e(2730),a.e(6287),a.e(7682),a.e(1551),a.e(4870),a.e(9922),a.e(3133),a.e(612),a.e(2002),a.e(1880),a.e(7471),a.e(7165),a.e(5451),a.e(8612),a.e(9149)]).then(a.bind(a,"i/rW")).then(e=>e.QuickBookingDrawer),{loadableGenerated:{webpack:()=>["i/rW"]},ssr:!1}),QuickBookingDrawerWrapper=()=>{let e=(0,i.B)(e=>e.openQuickBookingDrawer,l.X);return e?(0,o.tZ)(d,{}):null}},KNnw:function(e,t,a){a.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 o=a("rBCA"),r=a("uuQu"),n=a("iBNF");let l=(0,o.Z)("div",{target:"eso8w1s0"})(r.M.mbUp,"{padding:0.5rem 0;}&[data-show-full='true']{padding:0;}"),i=(0,o.Z)("a",{target:"eso8w1s1"})("display:block;margin-bottom:1rem;",r.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;",r.M.mbDown,"{font-size:14px;line-height:22px;}}"),d=(0,o.Z)("div",{target:"eso8w1s2"})("margin:1rem 0 0;",r.M.mbDown,"{margin:0.5rem 0 0;}&[data-show-full='true']{margin:0;",r.M.mbUp,"{.related-article-card[data-size='md']{padding-top:0.5rem;}}}.content .author{flex:1;.avatar{width:32px;height:32px;}}"),c=(0,o.Z)("div",{target:"eso8w1s3"})("padding:0;cursor:pointer;.content .inner-content .text{-webkit-line-clamp:2;}"),s=(0,o.Z)("div",{target:"eso8w1s4"})("width:100%;padding:1rem 0;padding:1rem 1rem 0;",r.M.mbUp,"{padding:1rem 0 0;}background:white;"),u=(0,o.Z)("div",{target:"eso8w1s5"})("width:100%;",r.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,a){a.d(t,{Z:function(){return RelatedPosts}});var o=a("BGKE"),r=a("MmHG"),n=a("DEkF"),l=a("Vvt1"),i=a.n(l),d=a("dDsW"),c=a("iv2E"),s=a("P5LW"),u=a("KNnw"),p=a("rIrU");let g=i()(()=>Promise.all([a.e(9409),a.e(6259),a.e(1818),a.e(7519),a.e(761),a.e(2189),a.e(2138),a.e(9467),a.e(4467),a.e(6966),a.e(5243),a.e(8132),a.e(1375),a.e(4561),a.e(1448),a.e(5465),a.e(1217),a.e(5480),a.e(731),a.e(2050),a.e(2008),a.e(8469),a.e(8214),a.e(1482),a.e(6817),a.e(467),a.e(5951),a.e(9357),a.e(747),a.e(5675),a.e(6753),a.e(4802),a.e(3046),a.e(5745),a.e(3437),a.e(252),a.e(6839),a.e(9424),a.e(5702),a.e(8922),a.e(6399),a.e(553),a.e(2902),a.e(4969),a.e(3257),a.e(6611),a.e(7538),a.e(6894),a.e(5341),a.e(4846),a.e(2233),a.e(1058),a.e(3295),a.e(1538),a.e(7152),a.e(5684),a.e(2574),a.e(9884),a.e(7644),a.e(6962),a.e(8767),a.e(6638),a.e(7741),a.e(3434),a.e(2433),a.e(5385),a.e(3564),a.e(7082),a.e(3158),a.e(5641),a.e(7454),a.e(7004),a.e(4758),a.e(6219),a.e(17),a.e(8990),a.e(4067),a.e(9487),a.e(9083),a.e(1520),a.e(270),a.e(7596),a.e(8217),a.e(7543),a.e(2835),a.e(2507),a.e(6885),a.e(7859),a.e(690),a.e(2730),a.e(6287),a.e(7682),a.e(1551),a.e(4870),a.e(9922),a.e(3133),a.e(612),a.e(2002),a.e(1880),a.e(7471),a.e(7165),a.e(5451),a.e(8612),a.e(2819),a.e(7695),a.e(6678)]).then(a.bind(a,"1KiM")).then(e=>e.ArticleCardWrapper),{loadableGenerated:{webpack:()=>["1KiM"]}}),RelatedPosts=e=>{let{className:t,title:a,articles:l=[],isMobile:i,articleType:v}=e,{formatMessage:h}=(0,d.Z)(),{locale:m}=(0,s.h)(),f=v||p.Yx.articleType;return(0,o.tZ)(u.Qx,{"data-show-full":f!==p.Iq.ArticleType3,className:t,children:(0,o.BX)(o.HY,{children:[(0,o.tZ)(r.T,{size:i?"xs":"md",color:"#8C8C8C",type:"bold",style:{textTransform:"uppercase",...i?{}:{fontSize:18}},children:a||h({id:l.length>1?"articlePage.relatedPostsSectionTitle.many":"articlePage.relatedPostsSectionTitle.one"})}),(0,o.tZ)(u.R7,{"data-show-full":f!==p.Iq.ArticleType3,children:l.map((e,t)=>f===p.Iq.ArticleType3?(0,o.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,o.tZ)(n.H,{className:"related-post",tag:"h5",as:"h3",children:e.postTitle})},"related-article-".concat(t)):(0,o.tZ)(u.VX,{children:(0,o.tZ)("a",{"data-event-category":"Further Article","data-event-action":"Click","data-event-label":"https://".concat(c.domainLocales[m]).concat(e.permalinkDecode),children:(0,o.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,a){a.r(t),a.d(t,{InjectedRelatedPosts:function(){return InjectedRelatedPosts}});var o=a("BGKE"),r=a("q1tI"),n=a("p46w"),l=a.n(n),i=a("4QfM"),d=a("rIrU"),c=a("hoxo"),s=a("KNnw");let InjectedRelatedPosts=e=>{let{slug:t,...a}=e,[n,u]=(0,r.useState)(null);return((0,r.useEffect)(()=>{(async()=>{let e=l().get(d.Ud);u(await (0,i.vX)({slug:t,isRelated:1,requestFrom:e}))})()},[t]),n)?(0,o.tZ)(s.oC,{children:(0,o.tZ)(s.j1,{children:(0,o.tZ)(c.Z,{articles:[n],...a})})}):null}},BpjA:function(e,t,a){a("rIrU"),a("wtoa"),a("zKC1"),a("s9tu"),a("rBCA");var o=a("uuQu"),r=a("iBNF");o.M.mbDown,o.M.mbDown,o.M.mbDown,o.M.mbUp,o.M.mbDown,o.M.mbDown,o.M.mbUp,o.M.mbDown,o.M.mbDown,o.M.mbDown,r.r.borderRadius,r.r.borderRadius,o.M.mbDown}}]);