"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5451],{uriS:function(e,t,a){a.d(t,{v:function(){return DueDateCalculator},Q:function(){return A.Q4}});var o=a("BGKE"),n=a("q1tI"),l=a("iBNF"),i=a("xi0p"),r=a("wp0n"),c=a("fdQd"),d=a("8wjV"),s=a("Eso5"),u=a("mYVa"),m=a("OAL+"),h=a("gHhT"),g=a("cChf"),p=a("Wgwc"),f=a.n(p),v=a("dDsW"),b=a("6l8M"),y=a("w99c"),w=a("YFSc"),D=a("1LUM"),Z=a("ouLS"),C=a("RGkz"),S=a("P5LW"),P=a("rIrU"),T=a("o0qI"),B=a("aNTj"),_=a("1HUI"),I=a("LL/B"),E=a("u7wK"),L=a("g/tz"),x=a("csLd"),N=a("8vdq"),k=a("rBCA");a("qQsD");var F=a("uuQu");let R=(0,k.Z)("div",{target:"erjgweg0"})("width:100%;.method-label{display:flex;align-items:center;gap:4px;}");F.M.mbDown,F.M.mbDown,l.r.colors.primaryBase,l.r.colors.primaryBase;let M=(0,k.Z)(R,{target:"erjgweg4"})("#due-date-dropdown{z-index:1;width:100%;min-width:unset;max-width:unset;margin-bottom:2rem;color:",l.r.colors.gray800,";}.due-date-input{width:100%;min-width:unset;max-width:unset;color:",l.r.colors.gray800,";}.due-date-calculate-button{margin-right:auto;margin-left:auto;}"),O=(0,k.Z)("div",{target:"erjgweg5"})("display:flex;align-items:right;& > p{display:inline-block;border-bottom:solid 1px ",l.r.colors.primaryBase,";margin-bottom:24px;margin-left:auto;color:",l.r.colors.primaryBase,";cursor:pointer;font-size:11px;line-height:16px;text-align:right;}"),H=(0,k.Z)("div",{target:"erjgweg7"})("margin-bottom:1rem;"),U=(0,k.Z)("form",{target:"erjgweg8"})(F.M.mbDown,"{padding:16px 12px;border-radius:12px;background-color:",l.r.colors.white,";}");var A=a("i/U4"),X=(0,n.forwardRef)((e,t)=>{let{onSubmit:a,isEmbed:l=!1,controlledSubmit:i}=e,{formatMessage:c}=(0,v.Z)(),{locale:d,router:s}=(0,S.h)(),{state:{isLoggedIn:u}}=(0,x.b)(),[m,h]=(0,n.useState)(new Date),{getHealthToolLink:g}=(0,_.u)(d),{setIsCalculating:p}=(0,A.eY)();(0,n.useImperativeHandle)(t,()=>({submitForm:onSubmitForm}));let onSubmitForm=async()=>{let e=l?"".concat(window.location.origin).concat(P.sb).concat(g(N.QO.DUE_DATE)):window.location.origin+window.location.pathname,t=["".concat(I.Q.type,"=").concat(A.Q4.conception),"".concat(I.Q.startDate,"=").concat(f()(m).format(P.yJ)),"".concat(I.Q.additional,"= "),I.c.includes(d)?"joincommunity=1":""].filter(Boolean).join("&"),o=e+"?".concat(t);if(i){p(!0);let e=await (0,A.P2)(m);a&&a(e,o);return}if(u||(0,L.p0)(o,"due-date"),l)s.push(o);else{p(!0);let e=await (0,A.P2)(m);a&&a(e,o)}};return(0,o.tZ)(M,{children:(0,o.tZ)(H,{children:(0,o.tZ)(E.D,{label:(0,o.tZ)(r.T,{as:"label",size:"s4",children:c({id:"dueDatePage.conceptionDate"})}),value:m,size:"md",onChange:e=>{h(e||new Date)},excludeDate:e=>f()(e).isBefore(f()().subtract(43,"week"))})})})}),z=(0,n.forwardRef)((e,t)=>{let{onSubmit:a,isEmbed:l=!1,controlledSubmit:i}=e,{formatMessage:c}=(0,v.Z)(),{state:{isLoggedIn:d}}=(0,x.b)(),{locale:s,router:u}=(0,S.h)(),{getHealthToolLink:m}=(0,_.u)(s),{setIsCalculating:h}=(0,A.eY)(),g=(0,n.useMemo)(()=>m(N.QO.DUE_DATE),[m]),[p,b]=(0,n.useState)(new Date);(0,n.useImperativeHandle)(t,()=>({submitForm:onSubmitForm}));let onSubmitForm=async()=>{let e=l?"".concat(window.location.origin,"/").concat(g):window.location.origin+window.location.pathname,t=["".concat(I.Q.type,"=").concat(A.Q4.IUI),"".concat(I.Q.startDate,"=").concat(f()(p).format(P.yJ)),"".concat(I.Q.additional,"= "),I.c.includes(s)?"joincommunity=1":""].filter(Boolean).join("&"),o=e+"?".concat(t);if(i){h(!0);let e=await (0,A.NC)(p);a&&a(e,o);return}if(d||(0,L.p0)(o,"due-date"),l)u.push(o);else{h(!0);let e=await (0,A.NC)(p);a&&a(e,o)}};return(0,o.tZ)(M,{children:(0,o.tZ)(H,{children:(0,o.tZ)(E.D,{label:(0,o.tZ)(r.T,{as:"label",size:"s4",children:c({id:"dueDatePage.date_of_IUI_procedure",defaultMessage:"Date of IUI procedure"})}),value:p,onChange:e=>{b(e||new Date)},excludeDate:e=>f()(e).isBefore(f()().subtract(43,"week")),size:"md"})})})}),Q=(0,n.forwardRef)((e,t)=>{let{onSubmit:a,isEmbed:l=!1,controlledSubmit:i}=e,{formatMessage:d}=(0,v.Z)(),{locale:s,router:u}=(0,S.h)(),{state:{isLoggedIn:h}}=(0,n.useContext)(T.I)||{},[g,p]=(0,n.useState)(new Date),[b,y]=(0,n.useState)("3"),{getHealthToolLink:w}=(0,_.u)(s),{setIsCalculating:D}=(0,A.eY)();(0,n.useImperativeHandle)(t,()=>({submitForm:onSubmitForm}));let onSubmitForm=async()=>{let e=l?"".concat(window.location.origin).concat(P.sb).concat(w(N.QO.DUE_DATE)):window.location.origin+window.location.pathname,t=e+"?".concat(I.Q.type,"=2&").concat(I.Q.startDate,"=").concat(f()(g).format(P.yJ),"&").concat(I.Q.additional,"=").concat(b).concat(I.c.includes(s)?"&joincommunity=1":"");if(i){D(!0);let e=await (0,A.kF)(g,b);a&&a(e,t);return}if(h||(0,L.p0)(t,"due-date"),l)u.push(t);else{D(!0);let e=await (0,A.kF)(g,b);a&&a(e,t)}};return(0,o.BX)(M,{children:[(0,o.tZ)(H,{children:(0,o.tZ)(E.D,{label:(0,o.tZ)(r.T,{as:"label",size:"s4",children:d({id:"dueDatePage.ivf.transferDate"})}),value:g,onChange:e=>{p(e||new Date)},excludeDate:e=>f()(e).isBefore(f()().subtract(43,"week")),size:"md"})}),(0,o.tZ)(H,{children:(0,o.tZ)(c.R.Group,{name:"dayTransfer",value:b,onChange:e=>y(e),size:"md",children:(0,o.BX)(m.K,{spacing:"xs",children:[(0,o.tZ)(c.R,{value:"3",label:d({id:"dueDatePage.ivf.transferDateRadio"},{number:3})}),(0,o.tZ)(c.R,{value:"5",label:d({id:"dueDatePage.ivf.transferDateRadio"},{number:5})})]})})})]})}),G=(0,n.forwardRef)((e,t)=>{let{onSubmit:a,isEmbed:l=!1,controlledSubmit:i}=e,{formatMessage:d}=(0,v.Z)(),{state:{isLoggedIn:s}}=(0,x.b)(),[u,m]=(0,n.useState)("28"),{locale:h,router:g}=(0,S.h)(),{getHealthToolLink:p}=(0,_.u)(h),{setIsCalculating:b}=(0,A.eY)(),y=(0,n.useMemo)(()=>p(N.QO.DUE_DATE),[p]),w=(0,n.useMemo)(()=>[...Array(21)].map((e,t)=>({label:d({id:"dueDatePage.daysText"},{number:t+20}),value:"".concat(t+20)})),[]),[D,Z]=(0,n.useState)(new Date);(0,n.useImperativeHandle)(t,()=>({submitForm:onSubmitForm}));let onSubmitForm=async()=>{let e=l?"".concat(window.location.origin,"/").concat(y):window.location.origin+window.location.pathname,t=["".concat(I.Q.type,"=").concat(A.Q4.lastPeriod),"".concat(I.Q.startDate,"=").concat(f()(D).format(P.yJ)),"".concat(I.Q.additional,"=").concat(u),I.c.includes(h)?"joincommunity=1":""].filter(Boolean).join("&"),o=e+"?".concat(t);if(i){b(!0);let e=await (0,A.g6)(D,u);a&&a(e,o);return}if(s||(0,L.p0)(o,"due-date"),l)g.push(o);else{b(!0);let e=await (0,A.g6)(D,u);a&&a(e,o)}};return(0,o.BX)(M,{children:[(0,o.tZ)(H,{children:(0,o.tZ)(E.D,{label:(0,o.tZ)(r.T,{as:"label",size:"s4",children:d({id:"dueDatePage.lastPeriod.lastPeriodLabel"})}),value:D,onChange:e=>{Z(e||new Date)},excludeDate:e=>f()(e).isBefore(f()().subtract(43,"week")),size:"md"})}),(0,o.tZ)(H,{children:(0,o.tZ)(c.S,{label:(0,o.tZ)(r.T,{as:"label",size:"s4",children:d({id:"dueDatePage.lastPeriod.periodLengthLabel"})}),size:"md",maxDropdownHeight:300,data:w,value:u,onChange:e=>m(e||"")})})]})}),V=a("SPK5"),j=a("FQtM"),Y=a("hXNO"),W=(0,n.forwardRef)((e,t)=>{let{onSubmit:a,isEmbed:i=!1,controlledSubmit:d,form:s,scrollIntoExplaination:u}=e,{formatMessage:m}=(0,v.Z)(),{state:{isLoggedIn:g}}=(0,x.b)(),p=(0,Y.d)(),{locale:b,router:y}=(0,S.h)(),{getHealthToolLink:w}=(0,_.u)(b),D=(0,n.useMemo)(()=>w(N.QO.DUE_DATE),[w]),[Z,C]=(0,n.useState)(new Date),T=s.getInputProps("ultrasoundCRL"),B=s.getInputProps("ultrasoundMSD");(0,n.useImperativeHandle)(t,()=>({submitForm:onSubmitForm}));let onSubmitForm=async()=>{let e=i?"".concat(window.location.origin,"/").concat(D):window.location.origin+window.location.pathname,t="".concat(T.value,"|").concat(B.value),o=["".concat(I.Q.type,"=").concat(A.Q4.ultrasound),"".concat(I.Q.startDate,"=").concat(f()(Z).format(P.yJ)),"".concat(I.Q.additional,"=").concat(t),I.c.includes(b)?"joincommunity=1":""].filter(Boolean).join("&"),n=e+"?".concat(o);if(d){let e=await (0,A.Oh)(Z,t);a&&a(e,n);return}if(g||(0,L.p0)(n,"due-date"),i)y.push(n);else{let e=await (0,A.Oh)(Z,t);a&&a(e,n)}},k=(0,o.tZ)(r.T,{size:"p4",color:l.r.colors.gray400,children:"mm"});return(0,o.BX)(M,{children:[(0,o.tZ)(H,{children:(0,o.tZ)(E.D,{label:(0,o.BX)(r.T,{as:"label",size:"s4",children:[m({id:"dueDatePage.date_of_ultrasound",defaultMessage:"Date of Ultrasound"})," "]}),value:Z,onChange:e=>{C(e||new Date)},excludeDate:e=>f()(e).isBefore(f()().subtract(43,"week")),size:"md"})}),(0,o.BX)(V.k,{align:"center",gap:4,mb:4,children:[(0,o.tZ)(r.T,{as:"label",size:"s4",children:m({id:"dueDatePage.validation.one_is_required",defaultMessage:"At least one is required"})}),(0,o.tZ)(j.u,{withinPortal:!0,withArrow:!0,width:300,multiline:!0,label:m({id:"dueDatePage.ultrasound.tooltip"}),children:(0,o.tZ)(h.E,{width:18,height:18,src:"".concat(P.Nr,"/info-icon.svg"),alt:"",onClick:u})})]}),(0,o.BX)(H,{children:[(0,o.BX)(V.k,{gap:p?8:12,children:[(0,o.tZ)(c.I,{placeholder:"CRL",sx:{flex:1},rightSection:k,type:"number",min:0,step:.01,...T,errorProps:{sx:{display:"none"}}}),(0,o.tZ)(c.I,{placeholder:"MSD",sx:{flex:1},rightSection:k,type:"number",min:0,step:.01,...B,errorProps:{sx:{display:"none"}}})]}),T.error||B.error?(0,o.tZ)(r.T,{size:"p5",color:l.r.colors.red700,children:T.error||B.error}):null]})]})});let q=(0,n.forwardRef)((e,t)=>{let{value:a,label:n,imageSrc:i,...c}=e;return(0,o.BX)(s.x,{ref:t,sx:{gap:(0,u.h)(8),display:"flex",padding:"5px 6px",alignItems:"center","&[data-selected]":{backgroundColor:l.r.colors.gray100},"&[data-selected]:hover":{backgroundColor:l.r.colors.gray100},"&[data-hovered]":{backgroundColor:l.r.colors.gray100}},className:"",...c,children:[(0,o.tZ)("img",{src:i,style:{width:"20px",height:"20px",objectFit:"contain",maxWidth:"100%"},alt:n,loading:"lazy"}),(0,o.tZ)(r.T,{size:"p2",children:n})]})}),DueDateCalculator=e=>{let{additionalQuestions:t=[],onSubmitDueDate:a,isEmbed:l=!1,controlledSubmit:p,adUnitPath:_}=e,I=(0,n.useRef)(null),{formatMessage:E}=(0,v.Z)(),{router:L,locale:x}=(0,S.h)(),{state:{userInfo:N}}=(0,n.useContext)(T.I),k=(0,n.useRef)(null),{calculatorType:F,setCalculatorType:M,isCalculating:H}=(0,A.eY)(),V=(0,g.c)({initialValues:{birthday:void 0,isFirstPregnant:!0,isMyself:!0,ultrasoundCRL:void 0,ultrasoundMSD:void 0},validate(e){let t=e.birthday?{}:{birthday:E({id:"validation.error.requiredField"})};if(F===A.Q4.ultrasound){let a=Number(e.ultrasoundCRL),o=Number(e.ultrasoundMSD);if(!a&&!o)return{ultrasoundCRL:E({id:"dueDatePage.validation.record_not_valid",defaultMessage:"Your recorded isn't valid!"}),...t};let n=a>=5&&a<=101,l=o>0&&o<=13;if(n||l)return{...t};if(a&&!n)return{ultrasoundCRL:E({id:"dueDatePage.validation.record_not_valid",defaultMessage:"Your recorded isn't valid!"}),...t};if(o&&!l)return{ultrasoundMSD:E({id:"dueDatePage.validation.crl",defaultMessage:"The MSD value is invalid. Please enter the CRL metric to continue."}),...t}}return{...t}}}),j=(0,n.useMemo)(()=>i.a[x].map(e=>{let t=A.iB[e];return{...t,label:E({id:t.label})}}),[x]),Y=(0,n.useCallback)(()=>{B.E.measure(()=>{let e=document.querySelector("#calculator-info");if(e){let t=e.getBoundingClientRect().top+window.scrollY-80;window.scrollTo({top:t,behavior:"smooth"})}})},[]),onBeforeSubmit=async(e,t)=>{var o;let n=V.getInputProps("birthday").value,l={...e,...n&&{birthday:f()(n).format(P.tD)},isMyself:Number(!!V.getInputProps("isMyself").value),isFirstPregnant:Number(!!V.getInputProps("isFirstPregnant").value),...(null===(o=V.getInputProps("additionalQuestions").value)||void 0===o?void 0:o.length)>0&&{additionalQuestions:V.getInputProps("additionalQuestions").value}};localStorage.setItem(A.Ls,JSON.stringify({...l,isSubmitted:!!(null==N?void 0:N.id),source_url:window.location.href})),null==a||a(l,t)};(0,n.useEffect)(()=>{(null==N?void 0:N.id)&&(V.setFieldValue("isMyself",!0),(null==N?void 0:N.birthday)&&V.setFieldValue("birthday",f()(N.birthday).toDate()))},[null==N?void 0:N.id]);let K=V.getInputProps("birthday").value,J=V.getInputProps("isMyself").value;(0,n.useEffect)(()=>{null===N&&Z.P.syncParamsToUseOnSSOForm({gender:J?"female":"",birthday:J?K:void 0},L)},[K,N,J]);let $=(0,n.useMemo)(()=>j.find(e=>e.value===String(F)),[j,F]);return(0,o.BX)(s.x,{pb:24,children:[(0,o.tZ)(U,{onSubmit:V.onSubmit(()=>{var e;return null===(e=k.current)||void 0===e?void 0:e.submitForm()}),children:(0,o.BX)(m.K,{spacing:(0,u.h)(12),children:[(0,o.tZ)(C.__,{children:(0,o.tZ)(y.u,{...V.getInputProps("birthday")})}),(0,o.BX)(C.__,{children:[(0,o.tZ)(w.X,{checked:V.getInputProps("isMyself").value,...V.getInputProps("isMyself"),onChange:e=>V.setFieldValue("isMyself",e.currentTarget.checked)}),(0,o.tZ)(w.X,{...V.getInputProps("isFirstPregnant"),defaultChecked:!0,label:E({id:"tools.isFirstPregnant",defaultMessage:"Is this the first pregnant?"})})]}),(0,o.BX)(R,{children:[(0,o.BX)(s.x,{className:"method-label",mb:4,children:[(0,o.tZ)(r.T,{as:"label",size:"s4",children:E({id:"dueDatePage.calculationMethod"})}),(0,o.tZ)(h.E,{width:18,height:18,src:"".concat(P.Nr,"/info-icon.svg"),alt:"",onClick:Y})]}),(0,o.tZ)(c.S,{value:String(F),placeholder:E({id:"dueDatePage.calculationMethod"}),data:j,itemComponent:q,onChange:e=>M(Number(e)),icon:(0,o.tZ)("img",{src:null==$?void 0:$.imageSrc,style:{width:"20px",height:"20px",objectFit:"contain",maxWidth:"100%"},alt:null==$?void 0:$.imageSrc,loading:"lazy"}),styles:{input:{"&[data-with-icon]":{paddingLeft:"2.3rem"}}}}),!l&&(0,o.tZ)(O,{})]}),(0,o.BX)(s.x,{children:[F===A.Q4.lastPeriod?(0,o.tZ)(G,{ref:k,isEmbed:l,controlledSubmit:p,onSubmit:onBeforeSubmit}):null,F===A.Q4.IUI?(0,o.tZ)(z,{ref:k,isEmbed:l,controlledSubmit:p,onSubmit:onBeforeSubmit}):null,F===A.Q4.ultrasound?(0,o.tZ)(W,{ref:k,isEmbed:l,controlledSubmit:p,onSubmit:onBeforeSubmit,form:V,scrollIntoExplaination:Y}):null,F===A.Q4.conception?(0,o.tZ)(X,{ref:k,isEmbed:l,controlledSubmit:p,onSubmit:onBeforeSubmit}):null,F===A.Q4.IVF?(0,o.tZ)(Q,{ref:k,isEmbed:l,controlledSubmit:p,onSubmit:onBeforeSubmit}):null,(0,o.tZ)(b.Z,{ref:I,additionalQuestions:t,onChange:e=>V.setFieldValue("additionalQuestions",e),className:"mb-4"})]}),(0,o.tZ)(d.B,{type:"submit",className:"due-date-calculate-button",size:"lg",color:"primary",dataEventCategory:"Health Tool",dataEventAction:"Due Date",fullWidth:!0,loading:H,children:E({id:H?"dueDatePage.calculating":"dueDatePage.lastPeriod.calculate"})})]})}),_&&(0,o.tZ)(D.AdBlock,{adUnitPath:_,size:[300,250],divId:"div-gpt-ad-topbanner-mobile",pos:["TopBanner"]})]})}},"i/U4":function(e,t,a){a.d(t,{Ls:function(){return h},NC:function(){return getDueDateIUI},Oh:function(){return getDueDateUltrasound},P2:function(){return getDueDateConception},Q4:function(){return l},Y7:function(){return DateToInputValue},eY:function(){return p},g6:function(){return getDueDateLastPeriod},iB:function(){return g},kF:function(){return getDueDateIVF}});var o,n,l,i,r=a("Wgwc"),c=a.n(r),d=a("VNqU"),s=a("09QT"),u=a("oQBk"),m=a("rIrU");let h="duedateInfo";(o=l||(l={}))[o.lastPeriod=0]="lastPeriod",o[o.conception=1]="conception",o[o.IVF=2]="IVF",o[o.IUI=3]="IUI",o[o.ultrasound=4]="ultrasound",(n=i||(i={})).lastPeriod="lmp",n.conception="cd",n.IVF="ivf",n.IUI="iui",n.ultrasound="us";let g={[String(0)]:{value:String(0),imageSrc:"".concat(m.Nr,"/due-date-last-period-icon-revamp.png"),label:"dueDatePage.lastPeriod"},[String(2)]:{value:String(2),imageSrc:"".concat(m.Nr,"/due-date-ivf-icon.png"),label:"dueDatePage.ivf"},[String(1)]:{value:String(1),imageSrc:"".concat(m.Nr,"/due-date-conception-date-icon.png"),label:"dueDatePage.conceptionDate"},[String(3)]:{value:String(3),imageSrc:"".concat(m.Nr,"/due-date-iui-icon.png"),label:"dueDatePage.IUI"},[String(4)]:{value:String(4),imageSrc:"".concat(m.Nr,"/due-date-ultrasound-icon.png"),label:"dueDatePage.ultrasound"}},getDueDateLastPeriod=async(e,t)=>{let a=Number(t),o=["method=lmp","circle_length=".concat(a),"date=".concat(c()(e).format(m.tD))].join("&"),n="".concat(u.y.HEALTH_TOOL.GET_DUE_DATE_RESULT,"?").concat(o),l={method:1,first_day:c()(e).format(m.yJ),cycle_length_days:a,conception_date:null,ivf_transfer_date:null,days_transfer:null};try{var i,r;let{data:e}=await (0,s.d)(n);if(!(null==e?void 0:e.due_date)&&!(null==e?void 0:null===(r=e.gestational_week)||void 0===r?void 0:null===(i=r[1])||void 0===i?void 0:i.from))return{startDate:null,dueDate:null,otherInfo:l};return{startDate:c()(e.gestational_week[1].from,m.tD).toDate(),dueDate:c()(e.due_date,m.tD).toDate(),otherInfo:l}}catch(e){return{startDate:null,dueDate:null,otherInfo:l}}},getDueDateIUI=async e=>{let t=["method=iui","date=".concat(c()(e).format(m.tD))].join("&"),a="".concat(u.y.HEALTH_TOOL.GET_DUE_DATE_RESULT,"?").concat(t),o={method:4,insemination_date:c()(e).format(m.yJ),cycle_length_days:null,conception_date:null,ivf_transfer_date:null,days_transfer:null};try{var n,l;let{data:e}=await (0,s.d)(a);if(!(null==e?void 0:e.due_date)&&!(null==e?void 0:null===(l=e.gestational_week)||void 0===l?void 0:null===(n=l[1])||void 0===n?void 0:n.from))return{startDate:null,dueDate:null,otherInfo:o};return{startDate:c()(e.gestational_week[1].from,m.tD).toDate(),dueDate:c()(e.due_date,m.tD).toDate(),otherInfo:o}}catch(e){return{startDate:null,dueDate:null,otherInfo:o}}},getDueDateUltrasound=async(e,t)=>{let[a,o]=t.split("|"),[n,l]=[Number(a),Number(o)],i=["method=us","date=".concat(c()(e).format(m.tD)),n?"crl=".concat(n):"",!n&&l?"msd=".concat(l):""].join("&"),r="".concat(u.y.HEALTH_TOOL.GET_DUE_DATE_RESULT,"?").concat(i),d={method:5,measurement_date:c()(e).format(m.yJ),crl_value:n,msd_value:l,insemination_date:null,cycle_length_days:null,conception_date:null,ivf_transfer_date:null,days_transfer:null};try{var h,g;let{data:e}=await (0,s.d)(r);if(!(null==e?void 0:e.due_date)&&!(null==e?void 0:null===(g=e.gestational_week)||void 0===g?void 0:null===(h=g[1])||void 0===h?void 0:h.from))return{startDate:null,dueDate:null,otherInfo:d};return{startDate:c()(e.gestational_week[1].from,m.tD).toDate(),dueDate:c()(e.due_date,m.tD).toDate(),otherInfo:d}}catch(e){return{startDate:null,dueDate:null,otherInfo:d}}},getDueDateConception=async e=>{let t=["method=cd","date=".concat(c()(e).format(m.tD))].join("&"),a="".concat(u.y.HEALTH_TOOL.GET_DUE_DATE_RESULT,"?").concat(t),o={method:2,conception_date:c()(e).format(m.yJ),insemination_date:null,measurement_date:null,first_day:null,cycle_length_days:null,ivf_transfer_date:null,days_transfer:null};try{var n,l;let{data:e}=await (0,s.d)(a);if(!(null==e?void 0:e.due_date)&&!(null==e?void 0:null===(l=e.gestational_week)||void 0===l?void 0:null===(n=l[1])||void 0===n?void 0:n.from))return{startDate:null,dueDate:null,otherInfo:o};return{startDate:c()(e.gestational_week[1].from,m.tD).toDate(),dueDate:c()(e.due_date,m.tD).toDate(),otherInfo:o}}catch(e){return{startDate:null,dueDate:null,otherInfo:o}}},getDueDateIVF=async(e,t)=>{let a=Number(t),o=["method=ivf","embryo_transfer_date=".concat(a),"date=".concat(c()(e).format(m.tD))].join("&"),n="".concat(u.y.HEALTH_TOOL.GET_DUE_DATE_RESULT,"?").concat(o),l={method:3,ivf_transfer_date:c()(e).format(m.yJ),measurement_date:null,insemination_date:null,days_transfer:a,conception_date:null,first_day:null,cycle_length_days:null};try{var i,r;let{data:e}=await (0,s.d)(n);if(!(null==e?void 0:e.due_date)&&!(null==e?void 0:null===(r=e.gestational_week)||void 0===r?void 0:null===(i=r[1])||void 0===i?void 0:i.from))return{startDate:null,dueDate:null,otherInfo:l};return{startDate:c()(e.gestational_week[1].from,m.tD).toDate(),dueDate:c()(e.due_date,m.tD).toDate(),otherInfo:l}}catch(e){return{startDate:null,dueDate:null,otherInfo:l}}},DateToInputValue=e=>"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"),"-").concat(String(e.getDate()).padStart(2,"0")),p=(0,d.Ue)(e=>({isCalculating:!1,isRecalculate:!1,navResultTarget:"due_date_revealed",setNavResultTarget:t=>e({navResultTarget:t}),calculatorType:0,setCalculatorType:t=>e(()=>({calculatorType:t})),setIsCalculating:t=>e(()=>({isCalculating:t})),setIsRecalculate:t=>e(()=>({isRecalculate:t}))}))},daLf:function(e,t,a){a.d(t,{f:function(){return HealthToolLayout}});var o=a("BGKE"),n=a("q1tI"),l=a("7Ci/"),i=a("Eso5"),r=a("OAL+"),c=a("mYVa");let HealthToolLayout=e=>{let{children:t}=e,a=n.Children.toArray(t),r=a.find(e=>"left"===e.type.columnName),c=a.find(e=>"right"===e.type.columnName);return(0,o.tZ)(l.W,{size:"lg",sx:{margin:"0 auto",backgroundColor:"#fff",borderRadius:8},children:(0,o.BX)(i.x,{sx:e=>({[e.fn.largerThan("sm")]:{display:"flex",justifyContent:"space-between"}}),children:[r&&(0,o.tZ)(i.x,{sx:e=>({[e.fn.largerThan("sm")]:{width:"calc(65% - 24px)"}}),children:r}),c&&(0,o.tZ)(i.x,{sx:e=>({[e.fn.largerThan("sm")]:{width:"35%"}}),children:c})]})})};function LeftColumn(e){let{children:t,...a}=e;return(0,o.tZ)(r.K,{sx:e=>({padding:"".concat((0,c.h)(16)," 0"),gap:(0,c.h)(24),[e.fn.largerThan("sm")]:{padding:"".concat((0,c.h)(32)," 0")}}),...a,children:t})}function RightColumn(e){let{children:t,...a}=e;return(0,o.tZ)(r.K,{sx:e=>({[e.fn.largerThan("sm")]:{padding:"".concat((0,c.h)(24)," 0")}}),...a,children:t})}LeftColumn.columnName="left",LeftColumn.displayName="HealthToolLayoutLeft",HealthToolLayout.LeftColumn=LeftColumn,RightColumn.columnName="right",RightColumn.displayName="HealthToolLayoutRight",HealthToolLayout.RightColumn=RightColumn},bLQg:function(e,t,a){a.d(t,{N:function(){return getLayoutStateByStep}});var o=a("gNV7");function getLayoutStateByStep(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.h.ShowGeneralForm,t={hasResult:!1,showCalculatorForm:!0,showGeneralInfo:!0,showNavResult:!1,showDetailResult:!1,showError:!1};switch(e){case o.h.ShowGeneralForm:case o.h.CalculatingForm:return t;case o.h.ShowSuccessResult:return{hasResult:!0,showCalculatorForm:!1,showGeneralInfo:!1,showNavResult:!0,showDetailResult:!0,showError:!1};case o.h.ShowFailResult:return{hasResult:!1,showCalculatorForm:!0,showGeneralInfo:!1,showNavResult:!1,showDetailResult:!1,showError:!0};case o.h.RecalculateForm:case o.h.ReCalculatingForm:return{hasResult:!0,showCalculatorForm:!0,showGeneralInfo:!1,showNavResult:!1,showDetailResult:!0,showError:!1};case o.h.BackToResult:return{hasResult:!0,showCalculatorForm:!1,showGeneralInfo:!1,showNavResult:!0,showDetailResult:!0,showError:!1};case o.h.CalculatingFormBaseSSRParam:return{hasResult:!1,showCalculatorForm:!1,showGeneralInfo:!1,showNavResult:!0,showDetailResult:!0,showError:!1};default:return t}}},"Y/XE":function(e,t,a){a.d(t,{A:function(){return HealthToolTwoColumnLayout}});var o=a("BGKE"),n=a("q1tI"),l=a("1HUI"),i=a("LL/B"),r=a("ZLal"),c=a("fNFL"),d=a("kfjY"),s=a("Eso5"),u=a("vaps"),m=a("SPK5"),h=a("OAL+"),g=a("dDsW"),p=a("O+8R"),f=a("CBW8"),v=a("lXMY"),b=a("2kea"),y=a("usqR"),w=a("JizU"),D=a("OHji"),Z=a("O+H8"),C=a("FxIt"),S=a("Uj9i"),P=a("zTPA"),T=a("raAP"),B=a("hXNO"),_=a("P5LW"),I=a("rIrU"),E=a("T9go"),L=a("VIdu"),x=a("/npG"),N=(0,x.k)(e=>({root:{},colLeft:{position:"relative"},colRight:{},colLeftContent:{flexGrow:1},formWrapper:{[e.fn.smallerThan("sm")]:{backgroundColor:"#fff",borderRadius:12,padding:12}},formEle:{[e.fn.largerThan("sm")]:{position:"absolute",top:0,left:0,right:0,bottom:0}},selectNavResult:{position:"fixed",top:0,left:0,right:0,zIndex:2}})),k=a("wp0n"),F=a("1Hbx"),R=a("bpvy"),M=a("0UxZ"),O=a("mYVa"),H=(0,x.k)(()=>({icon:{width:24,height:24,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",backgroundColor:"#fff"},accControl:{padding:0,"-webkit-tap-highlight-color":"transparent","&:active":{backgroundColor:"transparent"}},accItem:{padding:0,border:0},accContent:{padding:"".concat((0,O.h)(8)," 0")},accLabel:{padding:0}}));let ToolHeader=e=>{let{toolInfo:t,hasResult:a,withDescriptionAccordion:n}=e,{classes:l}=H(void 0,{name:"HealthToolTwoColumnLayout__ToolHeader"}),i=(0,o.tZ)(k.T,{size:"h3",as:a?"h2":"h1",children:null==t?void 0:t.title});return(0,o.BX)(h.K,{spacing:4,children:[n&&(null==t?void 0:t.description)?(0,o.tZ)(R.U,{classNames:{control:l.accControl,item:l.accItem,content:l.accContent,label:l.accLabel},children:(0,o.BX)(R.U.Item,{value:"item-1",children:[(0,o.tZ)(R.U.Control,{className:"no-focus",chevron:(0,o.tZ)(s.x,{className:l.icon,children:(0,o.tZ)(F.Z,{size:18})}),children:i}),(0,o.tZ)(R.U.Panel,{children:(0,o.tZ)(k.T,{size:"p4",as:"div",dangerouslySetInnerHTML:{__html:null==t?void 0:t.description}})})]})}):i,(0,o.tZ)(M.I.MedicalReview,{size:"small",reviewBy:null==t?void 0:t.reviewBy})]})};var U=a("2su4"),A=a("VJ+m");let X={in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(10%)"},transitionProperty:"transform, opacity"},z={in:{opacity:1,transform:"translate(-50%, 0)"},out:{opacity:0,transform:"translate(-50%, 100%) "},transitionProperty:"transform, opacity"},HealthToolTwoColumnLayout=e=>{var t;let{type:a,navigatorProps:x,toolInfo:k,toolName:F,formEle:R,layoutState:{hasResult:M,showCalculatorForm:O,showGeneralInfo:H,showNavResult:Q,showDetailResult:G,showError:V},loading:j,showOnboading:Y,onClickRecalculateForm:W,onClickBackToResult:q,resultList:K,extraPayloadValues:J,layoutColor:$,styles:ee,classNames:et}=e,ea=(0,B.d)(),{classes:eo}=N(void 0,{name:"HealthToolTwoColumnLayout",styles:ee,classNames:et}),{formatMessage:en}=(0,g.Z)(),{locale:el,query:ei,asPath:er}=(0,_.h)(),ec=(0,T.U)(),{getHealthToolLink:ed}=(0,l.u)(el),es=(0,E.a)(e=>e.setShouldOnboardingModalOpen),eu=ei[i.Q.source],em="".concat(I.MO,"user"),eh=M?"my-health"===eu?[{label:en({id:"healthTool.breadcrumb.myHealth",defaultMessage:"My Health"}),value:"".concat(em,"/health")},{label:en({id:"".concat(F,".breadcrumb.result"),defaultMessage:"BMI Result"}),value:""}]:[{label:en({id:"healthtools.title"}),value:"/health-tools"},{label:en({id:"".concat(F,".heading"),defaultMessage:"BMI Calculator"}),value:ed(F)},{label:en({id:"".concat(F,".breadcrumb.result"),defaultMessage:"BMI Result"}),value:""}]:[{label:en({id:"healthtools.title"}),value:"/health-tools"},{label:en({id:"".concat(F,".heading"),defaultMessage:"BMI Calculator"}),value:ed(F)}],eg=null==k?void 0:k.is_sponsored,ep=(null==k?void 0:k.sponsorTheme)||$,ef=(0,L.od)({countryAdTag:(0,L.Em)(el,{isMobile:ea}),contentAdTag:(0,L.WV)(el,er,["health-tools/due-date"])}),ev=!ea||"form"===a&&!M;return(0,n.useEffect)(()=>{Y&&es(!0)},[Y]),(0,n.useEffect)(()=>{G&&requestAnimationFrame(()=>{var e;null===(e=document.scrollingElement)||void 0===e||e.scrollTo({top:0,behavior:"auto"})})},[G]),(0,o.tZ)(o.HY,{children:(0,o.tZ)(r.T,{variant:r.C.LEADGEN,children:(0,o.tZ)(U.x,{...x,children:(0,o.BX)(o.HY,{children:[(0,o.tZ)(Z.X,{hasSponsor:eg,listing:K,loading:j,children:(0,o.BX)(A.l,{hasSponsor:eg,classNames:{contentBox:eo.colLeftContent},color:ep,breadcrumbEle:(0,o.tZ)(b.d,{pageItem:eh}),recalculateEle:(M||ea&&V)&&(0,o.tZ)(p.w,{"data-event-category":"Health Tool","data-event-action":"Recalculation Click","data-event-label":ec,showCalculatorForm:O,onShowCalculatorForm:W,onBack:q}),header:(0,o.tZ)(ToolHeader,{toolInfo:k,hasResult:M,withDescriptionAccordion:ea}),children:[ev&&(0,o.tZ)(A.l.ColLeft,{className:eo.colLeft,children:(0,o.tZ)(o.HY,{children:(0,o.BX)(A.l.ColLeftContent,{children:[(0,o.tZ)(d.u,{keepMounted:!0,mounted:O,transition:X,children:e=>(0,o.tZ)(s.x,{style:e,className:eo.formEle,children:(0,o.tZ)(u.x,{h:"100%",type:"hover",scrollbarSize:6,children:(0,o.tZ)(A.l.ColLeftInner,{className:eo.formWrapper,children:R})})})}),(0,o.tZ)(d.u,{mounted:Q,transition:X,children:e=>(0,o.tZ)(s.x,{style:e,sx:()=>({height:"100%"}),children:(0,o.BX)(A.l.ColLeftInner,{sx:{display:"flex",justifyContent:"space-between",flexDirection:"column",paddingTop:26,paddingBottom:24,height:"100%"},children:[(0,o.tZ)(Z.X.Nav,{}),(0,o.tZ)(y.E,{contentSize:"n1",bordered:!1,description:null==k?void 0:k.disclaimer,headingSize:"c2"})]})})})]})})}),(0,o.tZ)(Z.X.NavSelect,{className:eo.selectNavResult,mounted:Q&&ea}),(0,o.BX)(A.l.ColRight,{className:eo.colRight,color:ep,children:[(0,o.tZ)(d.u,{transition:"fade",mounted:G,children:e=>(0,o.tZ)(Z.X.ResultListing,{itemWrapper:A.l.FullScreenSection,style:e})}),(0,o.tZ)(d.u,{transition:"fade",mounted:H,children:e=>(0,o.tZ)(D.T,{color:ep,toolInfo:k,style:e})}),(0,o.tZ)(d.u,{transition:"fade",mounted:V,children:e=>(0,o.tZ)(m.k,{align:"center",justify:"center",style:e,sx:e=>({[e.fn.largerThan("sm")]:{position:"absolute",inset:0}}),children:(0,o.tZ)(w.I,{})})})]})]})}),(null==k?void 0:k.enable_ad)&&(0,o.tZ)(o.HY,{children:G&&ea?(0,o.tZ)(f.o,{children:(0,o.tZ)(v.FixedBottomAdBlock,{adUnitPath:ef,className:"article-bottom-ad",isMobile:!0})}):(0,o.tZ)(d.u,{keepMounted:!0,mounted:!O,transition:z,children:e=>(0,o.tZ)(f.o,{children:(0,o.tZ)(v.FixedBottomAdBlock,{adUnitPath:ef,className:"article-bottom-ad",isMobile:!1,style:e})})})}),M&&(0,o.tZ)(f.o,{children:(0,o.tZ)(S.OutOfPageAd,{id:"div-gpt-out-of-page",adUnitPath:ef})}),Y&&(0,o.tZ)(P.X,{campaign:null==k?void 0:null===(t=k.collectingData)||void 0===t?void 0:t.campaigns,isSkippable:null==k?void 0:k.isSkippable,typeForm:null==k?void 0:k.collectingTypes,phoneVerify:null==k?void 0:k.phoneVerification,toolName:"bmi",extraPayloadValues:J}),ea&&(0,o.tZ)(c.M,{opened:O&&M,onClose:q,zIndex:305,fullScreen:!0,withCloseButton:!0,transitionProps:{transition:"slide-right",duration:200},styles:e=>{var t;return{content:{borderRadius:0,height:"100% !important"},header:{borderBottom:0,...ep&&{backgroundColor:null===(t=e.colors[ep])||void 0===t?void 0:t[0]}}}},children:(0,o.BX)(h.K,{spacing:16,children:[(0,o.tZ)(s.x,{sx:e=>{var t;return{marginLeft:-16,marginRight:-16,padding:"0 16px 16px",...ep&&{backgroundColor:null===(t=e.colors[ep])||void 0===t?void 0:t[0]}}},children:(0,o.tZ)(ToolHeader,{toolInfo:k,hasResult:M})}),(0,o.tZ)(s.x,{sx:{borderRadius:12,backgroundColor:"#fff"},children:R})]})}),(0,o.tZ)(C.default.FitnessHealthTool,{})]})})})})}},gNV7:function(e,t,a){var o,n;a.d(t,{h:function(){return o}}),(n=o||(o={})).ShowGeneralForm="ShowGeneralForm",n.CalculatingForm="CalculatingForm",n.ReCalculatingForm="ReCalculatingForm",n.ShowSuccessResult="ShowSuccessResult",n.ShowFailResult="ShowFailResult",n.RecalculateForm="RecalculateForm",n.BackToResult="BackToResult",n.CalculatingFormBaseSSRParam="CalculatingFormBaseSSRParam"},Ovg6:function(e,t,a){a.d(t,{q:function(){return DiscoverHead}});var o=a("BGKE"),n=a("q1tI"),l=a("4v/2"),i=a("g4pe"),r=a.n(i),c=a("CJtR"),d=a("Nzzg"),s=a("iv2E"),u=a("P5LW"),m=a("rIrU");let DiscoverHead=e=>{var t,a,i,h;let g,{SEOData:p={},noUsingRouterPush:f=!1,languageOptions:v=[],isHealthToolResultSharing:b}=e,{DEPLOY_ENV:y}=m.ENV,{asPath:w}=(0,u.h)(),{totalPages:D,currentPage:Z,title:C="",description:S="",image:P,type:T,customMetaData:B=[],isIndexable:_=!0,hasNoCanonical:I=!1,openGraph:E,twitter:L}=p,{title:x,image:N,imageWidth:k="1200",imageHeight:F="630",description:R}=E||{},{image:M,title:O,description:H}=L||{},{locale:U,router:{pathname:A,query:X,push:z}}=(0,u.h)(),Q="https://".concat(s.domainLocales[U]).concat(m.Nr,"/").concat(U,".png"),G=(0,d.y)(U,P)||Q,V=(0,d.y)(U,N),j=(0,d.y)(U,M),Y="".concat(m.sb).concat(A);Object.keys(X).forEach(e=>{let t=X[e];t&&Array.isArray(t)&&(Y=Y.replace("[...".concat(e,"]"),t.join("/"))),"string"==typeof t&&A.endsWith("[".concat(e,"]"))&&(Y=Y.replace("[".concat(e,"]"),t))});let W=(0,n.useMemo)(()=>(null==v?void 0:v.length)>=2?v.map(e=>e.label===m.K4.EN?{...e,label:"en-PH"}:e.label===m.K4.FIL?{...e,label:"tl-PH"}:e):[],[v]);(0,n.useEffect)(()=>{let replaceClick=e=>{if(e&&e.target){let t=e.target;"A"!=t.nodeName||t.closest(".no-replace-click")||"_blank"===t.target||(e.preventDefault(),z(t.href))}};return()=>{f||window.document.body.removeEventListener("click",replaceClick)}},[]);let q="/"===Y?"":"/";if(p.apiMetaData&&"string"==typeof p.apiMetaData){let e=null===(h=p.apiMetaData)||void 0===h?void 0:h.match(/(.*)<\/title>/),t=" - Page ".concat(Z," of ").concat(D),a=Z&&1!==Z&&e&&e[0]&&e[1]?p.apiMetaData.replace(e[0],e[0].includes("-")?e[0].replace("-",t+" - "):"".concat(e[1].concat(t),"")):p.apiMetaData;try{g=(0,l.ZP)(a,{trim:!0,replace:e=>{e.attribs&&Object.keys(e.attribs).forEach(t=>{let a=t.replace(/[^\w\s]/gi,""),o=e.attribs[t];if(delete e.attribs[t],isNaN(Number(a))){var n,l;e.attribs[a]=o,["og:image","twitter:image"].includes(o)&&(e.attribs.content=(0,d.y)(U,e.attribs.content)||G),b&&(null===(n=e.attribs)||void 0===n?void 0:n.property)==="og:url"&&(null===(l=e.attribs)||void 0===l?void 0:l.content)&&(e.attribs.content="\n ".concat((0,c.UC)(U)).concat(w))}})}})}catch(e){console.error(e)}let n=null==g?void 0:g.some(e=>{var t;return(null===(t=e.props)||void 0===t?void 0:t.property)==="og:image"});Array.isArray(g)&&g.length&&!n&&(g=[...g,(0,o.tZ)("meta",{property:"og:image",content:V||G},"og:image"),(0,o.tZ)("meta",{property:"og:image:secure_url",content:V||G},"og:image:secure_url"),(0,o.tZ)("meta",{property:"og:image:width",content:"".concat(k)},"og:image:width"),(0,o.tZ)("meta",{property:"og:image:height",content:"".concat(F)},"og:image:height"),(0,o.tZ)("meta",{name:"twitter:image",content:j||G},"twitter:image")])}let K=null==g?void 0:g.filter(e=>"title"===e.type),J=(null==K?void 0:null===(a=K[0])||void 0===a?void 0:null===(t=a.props)||void 0===t?void 0:t.children)||C;return(0,o.BX)(r(),{children:[(0,o.tZ)("meta",{charSet:"UTF-8"}),(0,o.tZ)("meta",{name:"viewport",content:"width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"}),(0,o.tZ)("meta",{name:"google",content:"notranslate"}),(0,o.tZ)("meta",{name:"robots",content:_&&"production"===y?"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1":"noindex"}),(0,o.tZ)("meta",{property:"fb:app_id",content:"653713035016537"}),B.map((e,t)=>(0,o.tZ)("meta",{...e},"custom-meta-".concat(t))),(0,o.tZ)("meta",{name:"theme-color",content:"#2c87f3"}),(0,o.tZ)("meta",{name:"page_type",content:"Home"}),(0,o.tZ)("meta",{name:"page_platform",content:"WEB"}),(0,o.tZ)("meta",{name:"page_language",content:U}),W&&W.length>=2?W.map(e=>(0,o.tZ)("link",{rel:"alternate",hrefLang:e.label,href:"https://".concat(s.domainLocales[U]).concat(e.value)},e.value)):(0,o.tZ)("link",{rel:"alternate",href:"https://".concat(s.domainLocales[U]).concat(Y).concat(q)}),(0,o.tZ)("meta",{name:"ahrefs-site-verification",content:"46e7521a2b89a1013149c4685bbe02a1d36a4732fef98655142b829bc87cba4d"}),!g&&(0,o.BX)(o.HY,{children:[(0,o.tZ)("title",{children:null===(i=p.openGraph)||void 0===i?void 0:i.title}),!I&&(0,o.tZ)("link",{rel:"canonical",href:"https://".concat(s.domainLocales[U]).concat(Y).concat(q)}),(0,o.tZ)("meta",{name:"description",content:S||R}),p.schemaData&&(0,o.tZ)("script",{type:"application/ld+json",className:"yoast-schema-graph",dangerouslySetInnerHTML:{__html:p.schemaData}}),(0,o.tZ)("meta",{property:"og:locale",content:U}),(0,o.tZ)("meta",{property:"og:type",content:T||"website"}),(0,o.tZ)("meta",{property:"og:title",content:x||C}),(0,o.tZ)("meta",{property:"og:description",content:R||S}),(0,o.tZ)("meta",{property:"og:url",content:"https://".concat(s.domainLocales[U]).concat(Y,"/")}),(0,o.tZ)("meta",{property:"og:site_name",content:m.CX[U].SITE_NAME_FORMATTED}),(0,o.tZ)("meta",{property:"og:image",content:V||G}),(0,o.tZ)("meta",{property:"og:image:secure_url",content:V||G}),(0,o.tZ)("meta",{property:"og:image:width",content:"".concat(k)}),(0,o.tZ)("meta",{property:"og:image:height",content:"".concat(F)}),(0,o.tZ)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,o.tZ)("meta",{name:"twitter:title",content:O||C}),(0,o.tZ)("meta",{name:"twitter:description",content:H||S}),(0,o.tZ)("meta",{name:"twitter:image",content:j||G})]}),(m.rF[U]||[]).map((e,t)=>"link"===e.type?(0,o.tZ)("link",{rel:e.rel,href:e.href,sizes:e.sizes},"favicon-".concat(t)):"meta"===e.type?(0,o.tZ)("meta",{name:e.name,content:e.content},t):null),g,J&&(0,o.tZ)("title",{children:J})]})}},JuOI:function(e,t,a){var o=a("BGKE"),n=a("q1tI"),l=a("IDBz");let ErrorBoundary=class ErrorBoundary extends n.Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught React Boundary error:",e,t),(0,l.Tb)("React Boundary Error",{extra:{error:e,errorInfo:t}})}render(){return this.state.hasError?this.props.fallback||(0,o.tZ)(o.HY,{}):this.props.children||(0,o.tZ)(o.HY,{})}constructor(...e){super(...e),this.state={hasError:!1}}};t.Z=ErrorBoundary},"2su4":function(e,t,a){a.d(t,{x:function(){return NavigatorLayout},c:function(){return getDefaultLanguageOptions}});var o=a("BGKE"),n=a("JuOI"),l=a("P5LW"),i=a("rIrU"),r=a("q1tI"),c=a("p46w"),d=a.n(c),s=a("Vvt1"),u=a.n(s),m=a("dDsW"),h=a("iv2E");let g=u()(()=>Promise.all([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,"LlqN")).then(e=>e.LeavePageConfirmPopupWrapper),{loadableGenerated:{webpack:()=>["LlqN"]},ssr:!1}),p=u()(()=>Promise.all([a.e(9377),a.e(9043),a.e(1255),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)]).then(a.bind(a,"wWMa")).then(e=>e.CookieAcceptConfirm),{loadableGenerated:{webpack:()=>[null]},ssr:!1}),BelowMainContent=()=>{var e;let{locale:t,router:{asPath:a}}=(0,l.h)(),[c,s]=(0,r.useState)(!1),[u,f]=(0,r.useState)(!1),[v,b]=(0,r.useTransition)(),{formatMessage:y}=(0,m.Z)();(0,r.useEffect)(()=>{b(()=>{s(i.P8.includes(t)&&!d().get(i.gV))}),setTimeout(()=>{b(()=>{f(!0)})},5e3)},[]),(0,r.useEffect)(()=>{let e=document.getElementsByTagName("body")[0];c?e.classList.add("hasCookieConfirm"):e.classList.remove("hasCookieConfirm")},[c]);let w=(0,r.useCallback)(()=>{let e={adConsentGranted:!0,analyticsConsentGranted:!0,functionalityConsentGranted:!0,personalizationConsentGranted:!0,securityConsentGranted:!0};d().set(i.gV,JSON.stringify(e),{domain:"development"===i.ENV.NEXT_PUBLIC_DEPLOY_ENV?"localhost":".".concat(h.domainLocales[t])}),s(!1),window.consentListeners.forEach(t=>{t(e)})},[s]);return(0,o.BX)(o.HY,{children:[(0,o.tZ)("div",{id:"mantine-modal-target",style:{position:"relative",zIndex:305},children:u&&(0,o.tZ)(o.HY,{children:(0,o.tZ)(n.Z,{children:(0,o.tZ)(g,{})})})}),c&&u?(0,o.tZ)(n.Z,{children:(0,o.tZ)(p,{theme:"helloSites",className:"cookie-confirm-box",title:y({id:"cookiePolicies.modal.title",defaultMessage:"Please accept our privacy policy"}),description:y({id:"cookiePolicies.modal.description",defaultMessage:"Hello Health Group uses cookies to improve your experience and to show you personalized ads"}),policiesUrl:"/static".concat((null===(e=i.p[t])||void 0===e?void 0:e.PRIVACY_POLICY)||"/"),onAcceptClick:w,translations:{acceptButton:y({id:"cookiePolicies.modal.accept",defaultMessage:"Accept"}),policiesButton:y({id:"cookiePolicies.modal.ourPolicies",defaultMessage:"Our Policies"})},trackingAttributes:{dataEventCategory:"Consent Pop Up",dataEventAction:"Accept Click",dataEventLabel:"https://".concat(h.domainLocales[t]).concat(i.sb).concat(a)}})}):void 0]})};var f=a("Ovg6"),v=a("AeFk"),b=a("rBCA"),y=a("uuQu"),w=a("iBNF"),D=a("nsdv"),Z=a("eosF"),C=a("a5vB"),S=a("09QT"),P=a("oQBk"),T=a("fKro"),B=a("raAP"),_=a("hXNO"),I=a("05Ua"),E=a("o0qI"),L=a("Zr8O"),x=a("p9sL");let N=u()(()=>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)]).then(a.bind(a,"Gwuz")).then(e=>e.StickySponsoredBy),{loadableGenerated:{webpack:()=>["Gwuz"]}}),k=(0,v.iv)("a[data-event-category='Chatbot AI']{button{padding-left:10px;padding-right:12px;height:36px;.mantine-Button-label{font-size:13px;font-weight:500;line-height:22px;color:#111111;}.mantine-Button-leftIcon{margin-right:2px;svg{width:24px;height:24px;}}}}input[name='search-input-menu-servicedesktop'].mantine-Input-input{border-color:#e4e8ec;border-radius:8px;",y.M.mbDown,"{height:46px;}}"),F=(0,v.iv)("div[data-site-type='helloSites']{background-color:",w.r.colors.blue900,";}"),R=(0,b.Z)(D.N,{target:"e3b5erp0"})(i.ax?k:""," ",e=>e.isWinCashBackTheme?F:(0,v.iv)("div[data-site-type='helloSites']{background-color:#ffffff;}")),MainNav=e=>{let{onTopBarAppears:t,sitewideBanner:a,isSponsored:c,sponsoredType:d,sponsoredBy:s,dataNavMenuContent:u,languageOptions:m,activeMenuService:g,subHead:p,isHomepage:f}=e,{locale:v,router:{asPath:b}}=(0,l.h)(),y=(0,B.U)(),{setIsNavCollapse:w,setIsNavSponsor:D}=(0,x.P)(e=>({setIsNavCollapse:e.setIsNavCollapse,setIsNavSponsor:e.setIsNavSponsor}),C.X),k=[Z.L.Vietnam,Z.L.Malaysia].includes(v),{state:F={},dispatch:M}=(0,r.useContext)(E.I),{setOpenQuickBookingDrawer:O}=(0,L.B)(e=>e,C.X),{userInfo:H}=F,U=(0,_.d)(),A=(0,r.useMemo)(()=>({enableAppIntroPage:[Z.L.Vietnam].includes(v),enableProfileFindMyBooking:i.tm.includes(v)&&U}),[v,U]),X=void 0===s||Array.isArray(s)?s:[s];(0,r.useEffect)(()=>{D(!!c)},[c]),(0,r.useEffect)(()=>{v===Z.L.Vietnam&&(async()=>{(null==H?void 0:H.id)?(await T.M.getCartId(),T.M.getCart().then(e=>{var t;M({type:I.H.UPDATE_CART,payload:(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.items_qty)||0})})):(await T.z.getCartId(),T.z.getCart().then(e=>{var t;M({type:I.H.UPDATE_CART,payload:(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.items_qty)||0})}))})()},[null==H?void 0:H.id,b]);let z=(0,r.useMemo)(()=>{var e,t,a,o;return{...u,healthTools:{...null==u?void 0:u.healthTools,items:null==u?void 0:null===(t=u.healthTools)||void 0===t?void 0:null===(e=t.items)||void 0===e?void 0:e.map(e=>({...e,icon:e.icon||i.us})),spotlights:null==u?void 0:null===(o=u.healthTools)||void 0===o?void 0:null===(a=o.spotlights)||void 0===a?void 0:a.map(e=>({...e,icon:e.icon||i.us}))}}},[u]);return(0,o.tZ)(n.Z,{children:(0,o.tZ)(R,{siteType:"helloSites",locale:v,currentUrl:y,onLogout:()=>{(0,S.d)(P.y.USER_PROFILE.POST_LOGOUT,{method:"POST"},"sso"),M({type:I.H.LOGOUT,payload:{domain:"."+h.domainLocales[v]}})},ssrMenuContent:z||{},onTopBarAppears:e=>{null==t||t(e),w(!e)},userState:{...F,userInfo:H||void 0},isMobile:U,isHomepage:f,activeMenuService:g||"categories",sitewideBannerData:a||void 0,languageOptions:m,onBookingClick:e=>{e.preventDefault(),O(!0)},sponsorComponent:c?(0,o.tZ)(N,{isCollapsed:!1,sponsoredType:d,sponsoredBy:X,isMobile:U}):void 0,isUserLoading:(null==F?void 0:F.userInfo)===void 0,subHead:p,configs:A,isWinCashBackTheme:k})})};var M=a("8k6x"),O=a("2M76");let NavFooter=e=>{let{footerInfo:t}=e,{locale:a}=(0,l.h)();return(0,o.tZ)(o.HY,{children:t&&(0,o.tZ)(n.Z,{children:(0,o.tZ)(O.Z,{ssrOnly:!0,children:(0,o.tZ)(M.F,{footerInfo:t,locale:a,siteType:"helloSites",type:"main",basePath:i.sb})})})})},H={English:"en",Filipino:"tl"},U={English:"EN",Filipino:"FIL"},getDefaultLanguageOptions=(e,t)=>["en-PH","tl-PH"].includes(e)?[{label:"EN",value:t,locale:"en-PH"},{label:"FIL",value:"/fil"+t,locale:"tl-PH"}]:[],NavigatorLayout=e=>{let{title:t,description:a,image:r,children:c,onTopBarAppears:d,SEOData:s={},type:u="website",footerInfo:m,sitewideBanner:h,isSponsored:g,sponsoredType:p,sponsoredBy:v,noUsingRouterPush:b,dataNavMenuContent:y,languageOptions:w,activeMenuService:D,subHead:Z,isHealthToolResultSharing:C,isHomepage:S=!1,isInline:P}=e,{locale:T}=(0,l.h)(),B=i.CX[T].SITE_NAME_FORMATTED,_=null==w?void 0:w.map(e=>({...e,locale:e.locale?e.locale:H[e.label]+"-"+T.split("-")[1],label:U[e.label]||e.label,originalLabel:e.label}));return(0,o.BX)(o.HY,{children:[(0,o.tZ)(n.Z,{children:(0,o.tZ)(f.q,{SEOData:{title:t,image:r,description:a,siteName:B,type:u,...s},noUsingRouterPush:b,languageOptions:null==_?void 0:_.map(e=>({...e,label:e.originalLabel})),isHealthToolResultSharing:C})}),P?null:(0,o.tZ)(MainNav,{onTopBarAppears:d,isSponsored:g,sponsoredType:p,sponsoredBy:v,sitewideBanner:h,languageOptions:_,dataNavMenuContent:y,activeMenuService:D,subHead:Z,isHomepage:S}),(0,o.tZ)(n.Z,{fallback:(0,o.tZ)("div",{style:{width:"100%",height:200}}),children:c}),P?null:(0,o.BX)(o.HY,{children:[(0,o.tZ)(BelowMainContent,{}),(0,o.tZ)(NavFooter,{footerInfo:m})]})]})}},p9sL:function(e,t,a){a.d(t,{P:function(){return n}});var o=a("VNqU");let n=(0,o.Ue)(e=>({isNavCollapse:!1,isNavSponsor:!1,isNavBanner:!1,setIsNavCollapse(t){e({isNavCollapse:t})},setIsNavSponsor(t){e({isNavSponsor:t})},setIsNavBanner(t){e({isNavBanner:t})}}))},rD8X:function(e,t,a){a.d(t,{q:function(){return OvulationCalculator}});var o,n,l=a("BGKE"),i=a("q1tI"),r=a("MmHG"),c=a("dDsW"),d=a("rIrU"),s=a("oXha"),u=a("1HUI"),m=a("LgdP"),h=a("u7wK"),g=a("Wgwc"),p=a.n(g),f=a("N0kT"),v=a("iv2E"),b=a("P5LW"),y=a("8vdq");let OvulationForm=e=>{let{onSubmit:t}=e,{formatMessage:a}=(0,c.Z)(),{locale:o}=(0,b.h)(),{getHealthToolLink:n}=(0,u.u)(o),d=(0,i.useMemo)(()=>n(y.QO.OVULATION),[n]),[g,w]=(0,i.useState)(new Date),[D,Z]=(0,i.useState)([28]),[C,S]=(0,i.useState)([7]),P={cycle:D[0],periodDateStart:g,periodLength:C[0]};return(0,l.BX)(s.Si,{children:[(0,l.tZ)("div",{style:{marginBottom:"1rem"},children:(0,l.tZ)(h.D,{size:"md",name:"date",className:"due-date-input",label:(0,l.tZ)(r.T,{size:"label2",type:"bold",color:"#595959",children:a({id:"dueDatePage.lastPeriod.lastPeriodLabel"})}),value:g,onChange:e=>w(e||new Date),excludeDate:e=>p()(e).isBefore(p()().subtract(45,"day"))||p()(e).isAfter(p()())})}),(0,l.BX)("div",{style:{marginBottom:"1rem"},children:[(0,l.BX)(r.T,{size:"label2",type:"bold",color:"#595959",children:[a({id:"ovulationPage.cycleLength"})+" ",(0,l.tZ)(r.T,{size:"label2",type:"bold",color:"#797979",style:{display:"inline"},children:a({id:"ovulationPage.dayUnit"})})]}),(0,l.tZ)(f.c,{min:21,max:45,step:1,value:D,onChange:Z})]}),(0,l.BX)("div",{style:{marginBottom:"2rem"},children:[(0,l.BX)(r.T,{size:"label2",type:"bold",color:"#595959",children:[a({id:"ovulationPage.periodDuration"})+" ",(0,l.tZ)(r.T,{size:"label2",type:"bold",color:"#797979",style:{display:"inline"},children:a({id:"ovulationPage.dayUnit"})})]}),(0,l.tZ)(f.c,{min:1,max:15,step:1,value:C,onChange:S})]}),(0,l.tZ)("div",{style:{marginBottom:"1rem"},children:(0,l.tZ)(m.B,{className:"due-date-calculate-button",size:"lg",color:"primary",dataEventCategory:"Health Tool",dataEventAction:"Ovulation",dataEventLabel:"https://".concat(v.domainLocales[o],"/").concat(d),onClick:()=>{localStorage.setItem("ovulationInfo",JSON.stringify(P)),t&&t({startDate:g,cycle:D[0],periodLength:C[0]})},children:a({id:"dueDatePage.lastPeriod.calculate"})})})]})};(o=n||(n={}))[o.trackPeriod=1]="trackPeriod",o[o.conceive=2]="conceive",o[o.avoidPregnancy=3]="avoidPregnancy";let OvulationCalculator=e=>{let{onSubmitOvulation:t}=e,{formatMessage:a}=(0,c.Z)(),[o,n]=(0,i.useState)(1),u=[{imageSrc:"".concat(d.Nr,"/ovulation-track-period-icon.png"),label:a({id:"ovulationPage.trackPeriod"}),value:1},{imageSrc:"".concat(d.Nr,"/ovulation-conceive-icon.png"),label:a({id:"ovulationPage.conceive"}),value:2},{imageSrc:"".concat(d.Nr,"/ovulation-avoid-pregnancy-icon.png"),label:a({id:"ovulationPage.avoidPregnancy"}),value:3}];return(0,l.BX)(l.HY,{children:[(0,l.BX)(s.QG,{children:[(0,l.tZ)(r.T,{size:"xs",type:"bold",color:"#595959",children:a({id:"ovulationPage.objectives"})}),(0,l.tZ)(s.Eo,{children:u.map(e=>(0,l.tZ)(s.PF,{onClick:t=>{t.stopPropagation(),n(e.value)},children:(0,l.tZ)(s.m$,{className:e.value===o?"active":void 0,imgBanner:(0,l.tZ)("img",{src:e.imageSrc,style:{width:"63px",height:"63px",objectFit:"contain",maxWidth:"100%"},alt:e.label,loading:"lazy"}),label:e.label})},"".concat(e.value)))})]}),(0,l.tZ)(OvulationForm,{onSubmit:e=>{let{startDate:a,cycle:n,periodLength:l}=e;t&&t({method:o,periodDateStart:a,cycle:n,periodLength:l})}})]})}},oXha:function(e,t,a){a.d(t,{Eo:function(){return s},PF:function(){return u},QG:function(){return d},Si:function(){return h},_:function(){return c},__:function(){return p},eH:function(){return g},m$:function(){return m}});var o=a("rBCA"),n=a("qQsD"),l=a("uuQu"),i=a("iBNF"),r=a("vZvF");let c=(0,o.Z)(r.g,{target:"e7pcofi0"})("margin-right:0.3rem;vertical-align:middle;"),d=(0,o.Z)("div",{target:"e7pcofi1"})("width:100%;margin-bottom:2rem;"),s=(0,o.Z)("div",{target:"e7pcofi2"})("display:flex;width:100%;justify-content:space-between;margin-top:0.5rem;margin-bottom:12px;"),u=(0,o.Z)("div",{target:"e7pcofi3"})("width:31%;height:140px;",l.M.mbDown,"{height:130px;width:32.5%;}"),m=(0,o.Z)(n.C,{target:"e7pcofi4"})("width:100%;height:100%;justify-content:space-around;",l.M.mbDown,"{padding:0.25rem;}&.active{border-color:",i.r.colors.primaryBase,";box-shadow:none;p{color:",i.r.colors.primaryBase,";}}"),h=(0,o.Z)("div",{target:"e7pcofi5"})("width:100%;margin-bottom:2rem;.due-date-calculate-button{margin-right:auto;margin-left:auto;}"),g=(0,o.Z)("div",{target:"e7pcofi6"})("margin-bottom:1rem;",l.M.mbUp,"{padding-left:1rem;}"),p=(0,o.Z)("div",{target:"e7pcofi7"})("display:flex;flex-direction:column;gap:1.5rem;margin-bottom:1rem;")},HfWj:function(e,t,a){a.d(t,{h:function(){return n},q:function(){return OvulationCalculator}});var o,n,l=a("BGKE"),i=a("q1tI"),r=a("1HUI"),c=a("LgdP"),d=a("wp0n"),s=a("u7wK"),u=a("unQi"),m=a("SPK5"),h=a("mYVa"),g=a("OAL+"),p=a("Wgwc"),f=a.n(p),v=a("dDsW"),b=a("CJtR"),y=a("6l8M"),w=a("w99c"),D=a("YFSc"),Z=a("7rod"),C=a("P5LW"),S=a("rIrU"),P=a("8vdq"),T=a("o0qI"),B=a("oXha");(o=n||(n={}))[o.TrackPeriod=1]="TrackPeriod",o[o.Conceive=2]="Conceive",o[o.AvoidPregnancy=3]="AvoidPregnancy";let OvulationCalculator=e=>{let{additionalQuestions:t=[],onCalc:a}=e,{formatMessage:o}=(0,v.Z)(),{locale:n}=(0,C.h)(),{state:{userInfo:p}}=(0,i.useContext)(T.I),{getHealthToolLink:_}=(0,r.u)(n),I=(0,i.useRef)(null),E=(0,i.useMemo)(()=>_(P.QO.OVULATION),[_]),L=(0,i.useMemo)(()=>[{imageSrc:"".concat(S.Nr,"/ovulation-track-period-icon.png"),label:o({id:"ovulationPage.trackPeriod"}),value:1},{imageSrc:"".concat(S.Nr,"/ovulation-conceive-icon.png"),label:o({id:"ovulationPage.conceive"}),value:2},{imageSrc:"".concat(S.Nr,"/ovulation-avoid-pregnancy-icon.png"),label:o({id:"ovulationPage.avoidPregnancy"}),value:3}],[]),x=(0,Z.mR)(),onSubmit=async e=>{var t;null==I||null===(t=I.current)||void 0===t||t.validate(async()=>{localStorage.setItem("ovulationInfo",JSON.stringify({...e,isSubmitted:!!(null==p?void 0:p.id),source_url:window.location.href})),null==a||a()})};return(0,l.BX)("form",{onSubmit:x.onSubmit(onSubmit),children:[(0,l.BX)(m.k,{gap:(0,h.h)(24),sx:e=>({[e.fn.smallerThan("sm")]:{flexDirection:"column",".birthday-field":{marginBottom:0}},[e.fn.largerThan("sm")]:{"& > div":{width:"100%",flexGrow:1}}}),children:[(0,l.tZ)(B.__,{className:"birthday-field",children:(0,l.tZ)(w.u,{...x.getInputProps("birthday"),onChange:e=>{x.setFieldValue("age",String(f()().diff(e,"year"))),x.setFieldValue("birthday",e)}})}),(0,l.tZ)(B.__,{children:(0,l.tZ)(D.X,{checked:x.getInputProps("isYourself").value,onChange:e=>x.setFieldValue("isYourself",e.currentTarget.checked)})})]}),(0,l.BX)(B.QG,{children:[(0,l.tZ)(d.T,{as:"label",size:"s4",children:o({id:"ovulationPage.objectives"})}),(0,l.tZ)(B.Eo,{children:L.map(e=>(0,l.tZ)(B.PF,{onClick:t=>{t.stopPropagation(),x.getInputProps("type").onChange(e.value)},children:(0,l.tZ)(B.m$,{className:e.value===x.getInputProps("type").value?"active":void 0,imgBanner:(0,l.tZ)("img",{src:e.imageSrc,style:{width:"63px",height:"63px",objectFit:"contain",maxWidth:"100%"},alt:e.label,loading:"lazy"}),label:e.label})},e.value))})]}),(0,l.BX)(B.Si,{children:[(0,l.tZ)(B.__,{children:(0,l.tZ)(s.D,{label:(0,l.tZ)(d.T,{as:"label",size:"s4",children:o({id:"dueDatePage.lastPeriod.lastPeriodLabel"})}),excludeDate:e=>f()(e).isBefore(f()().subtract(46,"day"))||f()(e).isAfter(f()()),...x.getInputProps("startDate")})}),(0,l.BX)(B.__,{children:[(0,l.BX)(d.T,{as:"label",size:"s4",children:[o({id:"ovulationPage.cycleLength"})+" ",(0,l.tZ)(d.T,{size:"s4",color:"#797979",style:{display:"inline"},children:o({id:"ovulationPage.dayUnit"})})]}),(0,l.tZ)(u.iR,{...x.getInputProps("cycle"),withControl:!0,min:21,max:45})]}),(0,l.BX)(B.__,{children:[(0,l.BX)(d.T,{size:"s4",color:"#595959",children:[o({id:"ovulationPage.periodDuration"})+" ",(0,l.tZ)(d.T,{size:"s4",color:"#797979",style:{display:"inline"},children:o({id:"ovulationPage.dayUnit"})})]}),(0,l.tZ)(u.iR,{...x.getInputProps("periodLength"),withControl:!0,min:1,max:15})]}),(0,l.BX)(g.K,{spacing:(0,h.h)(24),children:[(0,l.tZ)(y.Z,{ref:I,additionalQuestions:t,onChange:e=>x.setFieldValue("additionalQuestions",e)}),(0,l.tZ)(B.__,{children:(0,l.tZ)(c.B,{className:"due-date-calculate-button",size:"lg",color:"primary",dataEventCategory:"Health Tool",dataEventAction:"Ovulation",dataEventLabel:"".concat((0,b.UC)(n)).concat(E),type:"submit",children:o({id:"dueDatePage.lastPeriod.calculate"})})})]})]})]})}},IhfM:function(e,t,a){a.d(t,{J:function(){return OvulationInfo}});var o=a("BGKE"),n=a("q1tI"),l=a("MmHG"),i=a("+xBH"),r=a("rIrU"),c=a("oXha");let OvulationInfo=e=>{let{heading:t,infos:a,content:d,className:s}=e,[u,m]=(0,n.useState)(-1);return(0,o.BX)("div",{id:"calculator-info",className:s,children:[(0,o.BX)(l.T,{size:"base",type:"bold",color:"#8C8C8C",style:{margin:"1rem 0"},children:[(0,o.tZ)(c._,{src:"".concat(r.Nr,"/info-icon.svg")}),t]}),d?(0,o.tZ)(c.eH,{children:(0,o.tZ)(l.T,{size:"p2",style:{lineHeight:"1.5"},children:d})}):null,null==a?void 0:a.map((e,t)=>(0,o.tZ)(i.l,{title:e.title,isExpand:u===t,onChange:e=>e?m(t):m(-1),contentString:e.description,iconPosition:"right",style:{marginBottom:"1rem"}},t))]})}},j6je:function(e,t,a){a.d(t,{Yv:function(){return getPeriodEndDate},kw:function(){return isDateInCycleForAd},rw:function(){return getOvulationDate},wu:function(){return createOvulationEvents},xP:function(){return getFertileDates}});var o,n,l=a("Wgwc"),i=a.n(l);a("rIrU");var r=a("oQBk"),c=a("CJtR");let getPeriodEndDate=(e,t)=>i()(e).add(t-1,"day").toDate(),getOvulationDate=e=>i()(e).subtract(14,"day").toDate(),getFertileDates=e=>{let t=i()(e).subtract(5,"day").toDate(),a=i()(e).add(1,"day").toDate();return{fertileDateStart:t,fertileDateEnd:a}},isDateInCycleForAd=(e,t,a,o)=>{let n=i()(t).startOf("day").toDate(),l=i()(e).startOf("day").toDate(),r=i()(e).isBefore(i()(t));for(;;){let e=getPeriodEndDate(n,o);if(i()(l).isBetween(i()(n).subtract(8,"day"),i()(e),"day","[]"))return!0;if(r&&i()(e).isBefore(i()(l))||!r&&i()(l).isBefore(i()(n).subtract(8,"day")))return!1;e=getPeriodEndDate(n=i()(n).add(r?-1*a:a,"day").toDate(),o)}};(o=n||(n={}))[o.normal=1]="normal",o[o.fertile=2]="fertile",o[o.ovulation=3]="ovulation",o[o.period=4]="period";let createOvulationEvents=e=>{let{token:t,cycle:a,day:o,user_id:n,period:l,method:i}=e;return(0,c.fu)(r.y.HEALTH_TOOL.OVULATION_CREATE_EVENT,{method:i,day:o,cycle:a,period:l,token:t,user_id:n})}}}]);