"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[612],{aKoo:function(e,t,i){i.d(t,{Z:function(){return template_builder_ModuleMultipleStepsForm}});var n=i("BGKE"),a=i("q1tI"),o=i("TSYQ"),r=i.n(o),l=i("MpNG"),d=i("/Ds5"),s=i("ECoa"),c=i("hXNO"),p=i("rBCA");let u=(0,p.Z)("div",{target:"ejjaoxp0"})("background:#ffffff;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:8px;padding:16px 24px;font-family:Inter;min-height:200px;&.desktop{padding-bottom:44px;.step-wrap-field{input{padding-right:50px;}}}.step-wrap-field{position:relative;input{height:48px;}[data-has-display-icon] input{padding-left:42px;}.step-btn-arrow{position:absolute;right:4px;top:4px;}}.step-btn-arrow{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:10px;width:40px;height:40px;background:#2159a9;border-radius:4px;cursor:pointer;&:hover{opacity:0.9;}path{stroke:#fff;}&[disabled]{opacity:0.7;cursor:not-allowed;}&.loading{pointer-events:none;> svg{opacity:0;}@keyframes btnArrowloading{0%{transform:translate(-50%,-50%) rotate(0deg);}100%{transform:translate(-50%,-50%) rotate(360deg);}}&::after{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:1em;height:1em;border-radius:100%;border:2px solid #fff;border-top-color:rgba(255,255,255,0.7);animation:btnArrowloading 1s linear infinite;}}}.step-label{font-family:'Inter';font-style:normal;font-weight:400;font-size:16px;line-height:24px;letter-spacing:-0.2px;color:#262626;margin-bottom:24px;}.step-mobile-submit{padding:12px 24px;background:#2159a9;border-radius:4px;font-weight:700;font-size:16px;line-height:24px;letter-spacing:-0.2px;color:#fff;font-weight:700;width:100%;margin-top:60px;cursor:pointer;&:hover{opacity:0.9;}&[disabled]{opacity:0.7;cursor:not-allowed;}&.loading{pointer-events:none;@keyframes btnMobileSubmit{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}&::after{content:'';display:inline-block;width:0.8em;height:0.8em;border-radius:100%;border:2px solid #fff;border-top-color:rgba(255,255,255,0.7);animation:btnMobileSubmit 1s linear infinite;vertical-align:middle;margin-left:3px;}}}&.mobile{.head-title{font-size:16px;}.step-label{font-size:14px;margin-bottom:19px;}}"),h=(0,p.Z)("div",{target:"ejjaoxp1"})("margin-bottom:24px;.head-title{color:#262626;font-weight:600;font-size:18px;line-height:28px;}.head-progress{height:4px;position:relative;background:#e4e8ec;margin-top:8px;display:flex;gap:4px;> button{flex:1;pointer-events:none;&.active,&.active--current{cursor:pointer;pointer-events:auto;background-color:#00b16a;}&.active--current ~ .active{opacity:0.5;}}&--active{top:0;left:0;bottom:0;position:absolute;background:#00b16a;}}");var m=i("fdQd"),g=i("GcSG"),f=i("3TDp"),b=i.n(f),x=i("vOFr"),y=i.n(x),v=i("P9Xb"),k=i.n(v),Z=i("94Cm");let w=(0,p.Z)("div",{target:"e84jhu70"})("display:flex;gap:13px;svg{position:relative;top:2px;min-width:20px;}"),C=(0,p.Z)("div",{target:"eyqwiad0"})(".delete-icon{cursor:pointer;}.step-wrap-field > .delete-icon{position:absolute;right:52px;top:17px;}"),N=(0,a.forwardRef)(function(e,t){let{label:i,...a}=e;return(0,n.BX)(w,{ref:t,...a,children:[(0,n.tZ)(y(),{}),(0,n.tZ)("span",{children:i})]})}),S=["places"];var B=i("u7wK"),T=i("Wgwc"),D=i.n(T),_=i("+QaA"),O=i.n(_),X=i("Rn8e"),E=i.n(X);let M="YYYY-MM-DD",V=(0,p.Z)("div",{target:"e8bkjsk0"})();D().extend(O());var A=i("l9Yf"),P=i("rYNE"),I=i("g8qU"),Y=i.n(I),L=i("UEkr"),G=i("0VOb");let K=(0,p.Z)("div",{target:"e1o8gj960"})(".step-email-consense{margin-top:24px;input{width:18px;height:18px;border:2px solid #595959;border-radius:2px;position:relative;top:2px;&:checked{border-color:#2d87f3;}}label{color:#262626;font-size:14px;max-width:100%;a{color:#2d87f3;font-weight:700;&:hover{text-decoration:underline;}}}& + .step-mobile-submit{margin-top:16px;}}svg{color:#bfbfbf;}");var j=i("YDrh"),H=i.n(j);let z=(0,p.Z)("div",{target:"e1k9tta80"})();var R=i("93jb");let q=(0,p.Z)("div",{target:"e1doeso80"})(".step-radio-wrap{display:flex;flex:1;& > div{flex:1;}[data-type='circle']{input{border:2px solid #8c8c8c;&:hover,&:checked{border-color:#2d87f3;}&:hover{box-shadow:0 0 1px 1px #2d87f3;}}}}.step-mother-field-wrap{display:flex;align-items:center;}");var W=i("dDsW"),F=i("Mvrv"),J=i("oQBk"),Q=i("xIXX"),U=i("CJtR"),$=i("jhGD"),ee=i("ky4n");let et=(0,p.Z)("div",{target:"e6nq3mm0"})(".step-wrap-field + .step-wrap-otp-field{margin-top:16px;}.step-wrap-otp-field{position:relative;input{height:48px;background-color:#fff;border-radius:4px;border:1px solid #d9d9d9;color:#000;font-weight:600;font-size:16px;line-height:24px;}.step-btn-arrow{position:absolute;right:4px;top:4px;}}.otp-field-separator{width:8px;min-width:8px;}.step-otp-resend{display:flex;align-items:center;font-weight:400;font-size:14px;line-height:22px;gap:8px;margin-top:8px;&--error{color:#f44d2c;}& + .step-mobile-submit{margin-top:8px;}}.step-otp-count-down{color:#2d87f3;cursor:pointer;position:relative;&::after{content:'';position:absolute;height:1px;left:0;right:0;bottom:0;background-color:#2d87f3;}}.mobile &{.step-otp-resend{margin-top:30px;justify-content:center;}.step-wrap-otp-field > div{justify-content:center;}}"),ei={"padding-top":"11px","padding-bottom":"11px","padding-right":"16px","padding-left":"16px","border-top":"1px solid #D9D9D9","border-bottom":"1px solid #D9D9D9","border-right":"1px solid #D9D9D9","border-left":"1px solid #D9D9D9","border-radius":"4px"};var en=i("Pwl8"),ea=i.n(en);let eo=(0,p.Z)("div",{target:"e1sro4pi0"})("display:flex;gap:24px;align-items:center;background-color:#fff;padding:40px 24px;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:8px;.thank-you-icon{min-width:160px;}.thank-you-title{font-weight:600;font-size:18px;line-height:28px;letter-spacing:-0.4px;color:#262626;}.thank-you-desc{font-weight:400;font-size:16px;line-height:24px;color:#262626;margin-top:8px;}&.mobile{gap:8px;text-align:center;flex-direction:column;.thank-you-icon{width:120px;height:120px;min-width:120px;}.thank-you-desc{font-size:14px;}}");var ModuleMultipleStepsForm_ThankYou=function(e){let{className:t}=e;return(0,n.BX)(eo,{className:t,children:[(0,n.tZ)(ea(),{className:"thank-you-icon",viewBox:"0 0 160 160"}),(0,n.BX)("div",{className:"thank-you-content",children:[(0,n.tZ)("h3",{className:"thank-you-title",children:"Cảm ơn bạn đ\xe3 đăng k\xfd tham dự chương tr\xecnh!"}),(0,n.tZ)("p",{className:"thank-you-desc",children:"Ch\xfang t\xf4i đ\xe3 ghi nhận th\xf4ng tin của bạn. Xin đợi li\xean hệ từ ph\xeda nh\xe3n h\xe0ng để được trao c\xe1c phần qu\xe0 may mắn."})]})]})},er=i("LYMv");let el={email:function(e){let{initValue:t="",onSubmit:i,isMobile:o}=e,[r,l]=(0,a.useState)(t),[d,s]=(0,a.useState)(!!t),c=!(0,L.oH)(r),handleClick=()=>{if(!d){(0,G.c)({title:"Vui l\xf2ng x\xe1c nhận đồng \xfd với điều khoản v\xe0 chương tr\xecnh của ch\xfang t\xf4i!",message:"",type:"danger"});return}i&&!c&&i(r)};return(0,n.BX)(K,{children:[(0,n.BX)("div",{className:"step-wrap-field",children:[(0,n.tZ)(A.I,{name:"email",value:r,onChange:l,size:"md",type:"email",autoComplete:"on",placeholder:"Địa chỉ email",displayIcon:o?(0,n.tZ)(Y(),{width:"20",height:"20",viewBox:"0 0 24 24"}):void 0}),!o&&(0,n.tZ)("button",{className:"step-btn-arrow",disabled:c,onClick:handleClick,children:(0,n.tZ)(k(),{})})]}),(0,n.tZ)("div",{className:"step-email-consense",children:(0,n.tZ)(P.C,{value:"step",name:"consense",checked:d,onChange:(e,t)=>s(t),label:(0,n.BX)("span",{children:["T\xf4i đ\xe3 đọc v\xe0 đồng \xfd với c\xe1c điều khoản v\xe0 chương tr\xecnh của"," ",(0,n.tZ)("a",{href:"https://hellobacsi.com/static/chinh-sach/",target:"_blank",children:"Hello Bacsi"})," ","v\xe0"," ",(0,n.tZ)("a",{href:"https://docs.google.com/document/d/1pNgpoW49GMsDsrlrIu4hX25l9v0zIEc8/edit",target:"_blank",children:"Abbott Similac"})," ","v\xe0 được hướng dẫn c\xe1ch ngưng chương tr\xecnh"]})})}),o&&(0,n.tZ)("button",{className:"step-mobile-submit",disabled:c,onClick:handleClick,children:"Tiếp tục"})]})},fullName:function(e){let{initValue:t="",onSubmit:i,isMobile:o}=e,[r,l]=(0,a.useState)(t),d=r.length<3,handleClickSubmit=()=>{i&&!d&&i(r)};return(0,n.BX)(z,{children:[(0,n.tZ)("p",{className:"step-label",children:"Ch\xfang t\xf4i đ\xe3 nhận được email của bạn, ch\xfang t\xf4i đang giao qu\xe0 đến cho"}),(0,n.BX)("div",{className:"step-wrap-field",children:[(0,n.tZ)(A.I,{name:"fullName",value:r,onChange:l,size:"md",placeholder:"Họ v\xe0 t\xean",displayIcon:(0,n.tZ)(H(),{})}),!o&&(0,n.tZ)("button",{className:"step-btn-arrow",disabled:d,onClick:handleClickSubmit,children:(0,n.tZ)(k(),{})})]}),o&&(0,n.tZ)("button",{className:"step-mobile-submit",disabled:d,onClick:handleClickSubmit,children:"Tiếp tục"})]})},address:function(e){let{isMobile:t,initValue:i="",onSubmit:o,answersLog:r}=e,[l,d]=(0,a.useState)(""),[s,c]=(0,a.useState)(i),p=!t,{predictions:u}=(0,Z.ap)(l,"VN"),h=s.length<3,handleClickSubmit=()=>{o&&!h&&o(s)},f=(0,a.useMemo)(()=>{let e=u.map(e=>({value:e.description,label:e.description})),t=e.find(e=>e.value===s);return!s||t?e:[{value:s,label:s}].concat(e)},[u,s]),x=(0,a.useMemo)(()=>(0,n.tZ)(b(),{style:{cursor:"pointer"},className:"delete-icon",onClick:()=>{c(""),d("")}}),[]),v=r.find(e=>"fullName"===e.stepKey);return(0,n.BX)(n.HY,{children:[(0,n.tZ)(g.LoadScript,{googleMapsApiKey:Z.JO,libraries:S,loadingElement:(0,n.tZ)(n.HY,{})}),(0,n.BX)(C,{children:[(0,n.BX)("p",{className:"step-label",children:["Thật tuyệt ",(0,n.tZ)("strong",{children:null==v?void 0:v.stepValue}),", h\xe3y cho ch\xfang t\xf4i biết địa chỉ để giao qu\xe0 đến cho bạn"]}),(0,n.BX)("div",{className:"step-wrap-field",style:{minHeight:"48px"},children:[(0,n.tZ)(m.S,{data:f,icon:(0,n.tZ)(y(),{}),itemComponent:N,searchable:!0,onChange:e=>c(e||""),clearable:!0,styles:(0,a.useCallback)(()=>({item:{"&":{paddingLeft:"21px"},"&[data-selected], &[data-selected]:hover":{color:"#262626",backgroundColor:"#f8f9fc"},"&:first-of-type":{display:"none"}},icon:{"&":{width:"auto",paddingLeft:"21px",paddingRight:"13px"}},input:{"&":t?{paddingLeft:"48px"}:{paddingLeft:"48px",paddingRight:"74px!important"}},itemsWrapper:{"&":{padding:"0"}},rightSection:{"@media (max-width: 767px)":{"pointer-events":"auto"}}}),[t]),value:s,rightSection:s?x:(0,n.tZ)(n.HY,{}),placeholder:"Địa chỉ của bạn",searchValue:l,onSearchChange:e=>{d(e)},filter:()=>!0}),p&&s&&x,p&&(0,n.tZ)("button",{className:"step-btn-arrow",disabled:h,onClick:handleClickSubmit,children:(0,n.tZ)(k(),{})})]}),t&&(0,n.tZ)("button",{className:"step-mobile-submit",disabled:h,onClick:handleClickSubmit,children:"Tiếp tục"})]})]})},phoneNumber:function(e){let{initValue:t="",isMobile:i,onSubmit:o,type:l}=e,{formatMessage:d}=(0,W.Z)(),s=(0,a.useRef)(),c=!i,[p,u]=(0,a.useState)(t),[h,m]=(0,a.useState)(!!t),[g,f]=(0,a.useState)(""),[b,x]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1),[Z,w]=(0,a.useState)(t?"verifiedAlready":"idle");function autoSubmitIfPhoneVerifiedAlready(){o&&o(p)}let handleCheckPhone=async()=>{try{let e=await (0,Q.uu)((0,U.DS)(J.y.LEADGEN.POST_LEAD_CHECK_PHONE_LOG),"POST",{data:{phone:p,type:l}});if((null==e?void 0:e._messages[0])==="Phone was used")return{ok:!1};return{ok:!0}}catch(e){return{ok:!1}}},handleSubmitToGetCode=async()=>{if(h&&p){v(!0);try{var e;if(!(await handleCheckPhone()).ok){(0,G.c)({title:"Số điện thoại của bạn đ\xe3 từng đăng k\xfd nhận qu\xe0. Vui l\xf2ng thử lại với c\xe1c chiến dịch sau!",message:"",type:"danger"}),v(!1);return}let t=await (0,Q.uu)((0,U.DS)(J.y.LEADGEN.POST_LEAD_SEND_OTP),"POST",{data:{phone_number:p.replace("+","")}}),i=null==t?void 0:null===(e=t._messages)||void 0===e?void 0:e[0];if("Send sms successfully"===i)w("sent");else if("This phone number was verified"===i)w("verifiedAlready"),autoSubmitIfPhoneVerifiedAlready();else{let e=d({id:"notification.comment.somethingWrong"});w("idle"),(0,G.c)({title:i||e,message:"",type:"danger"})}}catch(e){}v(!1)}},handleVerifyCode=()=>{g.length<6||"verifying"===Z||(w("verifying"),(0,Q.uu)((0,U.DS)(J.y.LEADGEN.POST_LEAD_VERIFY_OTP),"POST",{data:{otp_code:g,phone_number:p.replace("+","")}}).then(e=>{let t=null==e?void 0:e._messages[0];if("Verify successfully"===t)autoSubmitIfPhoneVerifiedAlready(),w("verified"),(0,G.c)({title:d({id:"subot.verifyOTP.success.message",defaultMessage:"Verified successful"}),message:"",type:"success"});else if("This phone number was verified"===t)autoSubmitIfPhoneVerifiedAlready(),w("verifiedAlready");else{let t=d({id:"notification.comment.somethingWrong"});x(!0),w("sent"),(0,G.c)({title:(null==e?void 0:e._messages[0])||t,message:"",type:"danger"})}}))},C=p&&("sent"===Z||"verifying"===Z||"verified"===Z);return(0,n.BX)(et,{children:[C?(0,n.BX)("p",{className:"step-label",children:["Ch\xfang t\xf4i đ\xe3 gửi m\xe3 OTP đến số điện thoại của bạn"," ",(0,n.tZ)("strong",{children:p})]}):(0,n.tZ)("p",{className:"step-label",children:"H\xe3y để lại số điện thoại để ch\xfang t\xf4i li\xean lạc khi giao qu\xe0 nh\xe9"}),("idle"===Z||"verifiedAlready"===Z)&&(0,n.BX)("div",{className:"step-wrap-field",children:[(0,n.tZ)(ee.Z,{country:"VN",defaultCountry:"VN",placeholder:"Số điện thoại",styleRecord:ei,disabled:!1,onChange:e=>{let{phone:t,isValid:i}=e;u(t),m(i)},defaultValue:p}),c&&(0,n.tZ)("button",{className:r()("step-btn-arrow",{loading:y}),disabled:!h,onClick:handleSubmitToGetCode,children:(0,n.tZ)(k(),{})}),i&&(0,n.tZ)("button",{disabled:!h,className:r()("step-mobile-submit",{loading:y}),onClick:handleSubmitToGetCode,children:"Tiếp tục"})]}),C&&(0,n.BX)(n.HY,{children:[(0,n.BX)("div",{className:"step-wrap-otp-field",children:[(0,n.tZ)(F.Z,{value:g,numInputs:6,separator:(0,n.tZ)("span",{className:"otp-field-separator"}),onChange:f,hasErrored:b,inputStyle:{width:"48px"},errorStyle:{border:"1px solid #F44D2C"},isInputNum:!0}),c&&(0,n.tZ)("button",{className:r()("step-btn-arrow",{loading:"verifying"===Z}),disabled:g.length<6,onClick:handleVerifyCode,children:(0,n.tZ)(k(),{})})]}),(0,n.BX)("div",{className:"step-otp-resend",children:[b?(0,n.tZ)("span",{className:"step-otp-resend--error",children:"OTP kh\xf4ng hợp lệ"}):(0,n.tZ)("span",{children:"Bạn kh\xf4ng nhận được m\xe3 OTP?"}),(0,n.tZ)($.Z,{ref:s,resendLabel:"Gửi lại OTP",className:"step-otp-count-down",onClick:()=>{s.current&&s.current.isFinished&&(0,Q.uu)((0,U.DS)(J.y.LEADGEN.POST_LEAD_SEND_OTP),"POST",{data:{phone_number:p.replace("+","")}}).then(()=>{setTimeout(()=>{var e;null===(e=s.current)||void 0===e||e.reset()},100)})}})]}),i&&(0,n.tZ)("button",{disabled:!h,className:r()("step-mobile-submit",{loading:"verifying"===Z}),onClick:handleVerifyCode,children:"Tiếp tục"})]})]})},motherCheck:function(e){let{isMobile:t,onSubmit:i,initValue:o=""}=e,[r,l]=(0,a.useState)(o),d=""===r,onClickSubmit=()=>{i&&!d&&i(r)};return(0,n.BX)(q,{children:[(0,n.tZ)("p",{className:"step-label",children:"Gần xong rồi. Ch\xfang t\xf4i muốn biết bạn đang mang thai hay đang cho con b\xfa"}),(0,n.BX)("div",{className:"step-mother-field-wrap",children:[(0,n.BX)("div",{className:"step-radio-wrap",children:[(0,n.tZ)(R.R,{type:"circle",label:"Mẹ mang thai",name:"pregnant",value:"pregnant",checked:"pregnant"===r,onChange:e=>l(e)}),(0,n.tZ)(R.R,{type:"circle",label:"Mẹ đang cho con b\xfa",name:"breastfeeding",value:"breastfeeding",checked:"breastfeeding"===r,onChange:e=>l(e)})]}),!t&&(0,n.tZ)("button",{className:"step-btn-arrow",disabled:d,onClick:onClickSubmit,children:(0,n.tZ)(k(),{})})]}),t&&(0,n.tZ)("button",{className:"step-mobile-submit",disabled:d,onClick:onClickSubmit,children:"Tiếp tục"})]})},birthday:function(e){let{isMobile:t,answersLog:i,initValue:o,onSubmit:r}=e,[l,d]=(0,a.useState)(()=>{if(o){let e=D()(o,M);if(e.isValid())return e.toDate()}return null}),s=!l,c=i.find(e=>"motherCheck"===e.stepKey),p=(null==c?void 0:c.stepValue)==="pregnant"?"H\xe3y chọn ng\xe0y dự sinh của b\xe9":"H\xe3y chọn ng\xe0y sinh nhật của b\xe9",u=(null==c?void 0:c.stepValue)==="pregnant"?"Ng\xe0y dự sinh của b\xe9":"Ng\xe0y sinh nhật của b\xe9",handleClickSubmit=()=>{r&&!s&&r(D()(l).format(M))};return(0,n.BX)(V,{children:[(0,n.tZ)("p",{className:"step-label",children:p}),(0,n.BX)("div",{className:"step-wrap-field",children:[(0,n.tZ)(B.D,{placeholder:u,icon:(0,n.tZ)(E(),{}),rightSection:(0,n.tZ)(n.HY,{}),value:l,onChange:d,valueFormat:"DD/MM/YYYY",styles:{input:{"&":{paddingLeft:"48px"}},icon:{"&":{width:"auto",paddingLeft:"18px",paddingRight:"10px"}}}}),!t&&(0,n.tZ)("button",{className:"step-btn-arrow",disabled:s,onClick:handleClickSubmit,children:(0,n.tZ)(k(),{})})]}),t&&(0,n.tZ)("button",{className:"step-mobile-submit",disabled:s,onClick:handleClickSubmit,children:"Tiếp tục"})]})}};var template_builder_ModuleMultipleStepsForm=function(e){let{initAnswersLog:t,onChange:i,loading:o,title:p,type:m,listSteps:g}=e,f=(0,c.d)(),[b,x]=(0,a.useState)([]),[y,v]=(0,a.useState)(er.uE.email),k=b.length;return((0,a.useEffect)(()=>{if(t){var e;x(t),v((null===(e=t.slice(-1)[0])||void 0===e?void 0:e.stepKey)||er.uE.email)}},[t]),"thankYou"===y)?(0,n.tZ)(ModuleMultipleStepsForm_ThankYou,{className:r()({mobile:f,desktop:!f})}):o?(0,n.BX)(u,{className:r()({mobile:f,desktop:!f}),children:[(0,n.BX)(h,{children:[(0,n.tZ)("h3",{className:"head-title",children:p}),(0,n.tZ)("div",{className:"head-progress"})]}),(0,n.tZ)(s.Z,{height:16}),(0,n.tZ)(s.Z,{height:48,style:{marginTop:"25px"}})]}):(0,n.BX)(u,{className:r()({mobile:f,desktop:!f}),children:[(0,n.BX)(h,{children:[(0,n.tZ)("h3",{className:"head-title",children:p}),(0,n.tZ)("div",{className:"head-progress",children:g.map((e,t)=>{let i=t{i&&v(e)}},e)})})]}),(0,n.tZ)(l.M,{exitBeforeEnter:!0,children:(0,n.tZ)(d.E.div,{initial:{x:20,opacity:0},animate:{x:0,opacity:1},exit:{x:-20,opacity:0},transition:{duration:.2},children:g.map((e,t)=>{if(y!==e)return null;let a=g[t+1]||er.Aw,o=a===er.Aw,r=b.find(e=>e.stepKey===y),l=el[y];return(0,n.tZ)(l,{isMobile:f,onSubmit:e=>{let t=b;i(t=r?t.map(t=>t.stepKey===y?{...t,stepKey:y,stepValue:e}:t):[...t,{stepKey:y,stepValue:e}],{isFinished:o,nextStepKey:a,currentStep:y},()=>{v(a),x(t)})},initValue:null==r?void 0:r.stepValue,answersLog:b,type:m},y)})},y)})]})}},LYMv:function(e,t,i){i.d(t,{Aw:function(){return o},T6:function(){return generateBody},uE:function(){return r}});var n=i("dvDa"),a=i("94Cm");let o="thankYou",r={email:"email",fullName:"fullName",address:"address",phoneNumber:"phoneNumber",motherCheck:"motherCheck",birthday:"birthday"},l={email:"email",fullName:"text",address:"text",phoneNumber:"tel",motherCheck:"text",birthday:"date"},d={email:"email",fullName:"name",address:"address",phoneNumber:"phone",motherCheck:"motherType",birthday:"dob"},generateBody=async e=>{let t="",i={data:{url:window.location.href,title_article:document.title||window.location.href,meta:e.map(e=>("address"===e.stepKey&&(t=e.stepValue),{key:d[e.stepKey],control:l[e.stepKey],value:e.stepValue}))}};try{var o;let{data:e}=await n.default.get("https://maps.googleapis.com/maps/api/geocode/json?address=".concat(encodeURIComponent(t),"&key=").concat(a.JO));if("OK"===e.status&&(null===(o=e.results)||void 0===o?void 0:o.length)){let t=e.results[0].address_components;for(let e=0;e(0,n.tZ)(TempalteModuleItem,{gridColumns:i,moduleData:e},e.uuid))})}function TemplateRowItem(e){let{columns:t,contentStyle:i,containerStyle:o,contentComputedStyle:c,uuid:p}=e,u=(0,a.useContext)(s.mD)||{},h=(0,l.d)(),m="true"===String(null==c?void 0:c.hideContentOnMobile),g="true"===String(null==c?void 0:c.hideContentOnDesktop);return h&&m||!h&&g?null:(0,n.tZ)(d.Xt,{containerStyle:o,contentStyle:i,align:u.align,containerBgColor:u.containerBgColor,containerWidth:u.containerWidth,className:r()({desktop_hide:g,mobile_hide:m}),children:(0,n.tZ)("div",{className:r()("lp-row-container",{"lp-row-container--full":"true"===c.rowWithoutContainer,"lp-row-columns-stack":"true"!==c.rowMobileTwoColumns,"lp-row-two-columns-mobile":"true"===c.rowMobileTwoColumns}),id:p,children:t.map(e=>(0,n.tZ)(TemplateColumnItem,{uuid:e.uuid,modules:e.modules,gridColumns:e["grid-columns"],containerStyle:e.style||{}},e.uuid))})})}}}]);