import{p as ke,_ as Se,a as Fe,b as Te,c as Ve,d as ze,e as Ge,f as Ee,h as $e,g as Me}from"./BU72HVE_.js";import{_ as qe}from"./CItpdUGi.js";import{K as h,g as Be,k as Ne,r as n,h as De,y as j,z as A,A as Pe,B as p,C as I,D as c,E as z,V as Le,F as je,G as R,c as _,a as t,t as k,j as e,s as Ae,H as G,b as u,I as S,x as E,i as Ie,q as U,l as Re,J as Ue,o as x,d as We}from"./DgR3D_w1.js";import{u as Ze}from"./O1F2TMdC.js";import{l as Oe,S as Ke}from"./ttmfhMs_.js";import{_ as He}from"./DON-A3Kb.js";import{s as Je,p as Qe}from"./BMw4bYVx.js";const Ye=h("/assets/images/giftCards/hero-bg-desktop.png"),Xe=h("/assets/images/giftCards/hero-bg-mobile.png"),et=h("/assets/images/giftCards/bubble-green-beans.png"),tt=h("/assets/images/giftCards/icon-veggie.svg"),at=h("/assets/images/giftCards/icon-thumbsup.svg"),st=h("/assets/images/giftCards/icon-clock.svg"),it={class:"md:tw-min-h-[537px] md:tw-flex tw-items-center tw-justify-center tw-relative tw-overflow-hidden tw-bg-gradient-to-r tw-from-[#dde6f5] tw-to-[#d9e2ee] md:tw-bg-transparent"},lt={class:"tw-container max-md:tw-bg-nl-green-300 max-md:tw-pb-[15px] max-md:tw-pt-[20px] max-md:tw-relative"},nt=t("div",{class:"md:tw-hidden tw-absolute tw-bottom-[-15px] tw-left-0 tw-right-0 tw-h-[15px]",style:{background:`url('/assets/images/giftCards/hero-wave-mob.svg')
          no-repeat 50% 0 / 100% 100%`}},null,-1),ot={class:"md:tw-max-w-[664px] md:tw-min-h-[318px] tw-mx-auto tw-flex tw-items-center tw-justify-center tw-relative tw-z-2 tw-text-[16px] md:tw-text-[30px] tw-leading-[1.23] tw-text-nl-yellow-100 tw-text-center md:tw-py-5 md:tw-px-[60px]"},rt=t("div",{class:"tw-hidden md:tw-block tw-absolute tw-inset-0 tw-z-1"},[t("svg",{width:"665",height:"389",viewBox:"0 0 665 389",fill:"none",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"none",class:"tw-w-full tw-h-full"},[t("path",{d:"M651.949 96.9315C622.621 1.81776 567.128 -14.3902 426.457 13.2111C324.372 33.2412 61.3824 -64 17.997 83.3656C-16.9529 202.079 -0.999817 361.251 89.0002 378.251C171.184 393.775 223.224 362.305 342.033 378.251C460.842 394.197 556.861 394.67 604 353C651.139 311.33 683.491 199.226 651.949 96.9315Z",fill:"#007D4D"})])],-1),dt={class:"tw-relative tw-z-2"},mt={class:"tw-text-[36px] tw-font-black max-md:tw-leading-[1.055] md:tw-text-h1 tw-mb-[10px] md:tw-mb-[7px]"},ct={class:"tw-font-bold"},ut=t("div",{class:"tw-absolute tw-inset-0 tw-hidden md:tw-block"},[t("img",{src:Ye,"aria-hidden":"true",class:"tw-w-full tw-h-full tw-object-cover",alt:"Nurture Life Background Image Desktop"})],-1),wt=t("div",{class:"md:tw-hidden"},[t("img",{src:Xe,"aria-hidden":"true",class:"tw-w-full",alt:"Nurture Life Background Image Mobile"})],-1),pt={class:"tw-pt-[23px] md:tw-pt-10 tw-pb-5 tw-overflow-x-hidden"},vt={class:"tw-container max-md:-tw-mx-[23px] max-md:tw-w-auto"},ft={id:"gift-cards-previous",class:"tw-mx-auto tw-max-w-[561px] tw-mb-[25px]"},xt={id:"gift-cards"},ht=["data-step","validation-schema"],_t={class:"tw-bg-[#e8ded1] tw-rounded-[19px] tw-pt-[18px] tw-px-[26px] tw-pb-[21px]"},gt={class:"col-span-2"},bt={class:"w-full"},yt={class:"w-full"},Ct={key:2,class:"tw-text-nl-red-100 tw-text-[12px] tw-block !tw-mt-1 tw-text-center"},kt={class:"tw-flex tw-flex-col tw-items-center !tw-mt-6"},St={class:"tw-inline-flex tw-gap-2 tw-justify-center tw-items-center tw-rounded-[8px] tw-text-[20px] tw-uppercase tw-font-bold tw-bg-nl-violet-100 tw-text-white tw-min-w-[306px] tw-py-[10px]","data-cy":"submitButton",type:"submit"},Ft=t("span",{class:"tw-mt-3 tw-inline-flex tw-items-center tw-uppercase tw-font-medium tw-text-[18px]"},[t("i",{class:"icon-main-chevron-bold-right tw-inline-flex tw-mr-2 tw-rotate-180 tw-text-[14px] tw-mt-[2px]"}),We("Go back")],-1),Tt=[Ft],Vt=Re(`<div class="tw-mx-auto md:tw-max-w-[732px] tw-mb-[10px] md:tw-mb-[60px] max-md:tw-bg-nl-blue-500 max-md:-tw-mx-[23px]"><div class="tw-relative md:tw-min-h-[344px] tw-overflow-hidden tw-z-1 tw-py-[62px] md:tw-py-[50px] max-md:tw-pl-[10%] max-md:tw-pr-[23px]"><div class="tw-hidden md:tw-block tw-absolute tw-inset-0 -tw-z-1"><svg width="732" height="354" viewBox="0 0 732 354" preserveAspectRatio="none" fill="none" xmlns="http://www.w3.org/2000/svg" class="tw-w-full tw-h-full"><path d="M729.901 151.724C742.896 234.029 695.913 349.255 578.954 349.255C425.008 349.255 269.804 354 169.786 354C-11.4939 354 -14.4218 144.952 59.1363 67.4827C123.114 0.102858 222.079 7.4437 265.064 14.2269C342.666 26.4728 489.783 40.7153 586.951 28.7511C704.91 14.2269 721.648 99.4571 729.901 151.724Z" fill="#008753"></path><path d="M715.901 141.724C728.896 224.029 681.913 339.255 564.954 339.255C411.008 339.255 255.804 344 155.786 344C-25.4939 344 -28.4218 134.952 45.1363 57.4827C109.114 -9.89714 208.079 -2.5563 251.064 4.22688C328.666 16.4728 475.783 30.7153 572.951 18.7511C690.91 4.22688 707.648 89.4571 715.901 141.724Z" fill="#DEEFF5"></path></svg></div><div class="md:tw-hidden tw-absolute tw-top-0 tw-left-0 tw-right-0 tw-h-[40px]" style="background:url(&#39;/assets/images/giftCards/text-bg-t.svg&#39;)
                no-repeat 50% 0 / 100% 100%;"></div><div class="md:tw-hidden tw-absolute tw-bottom-0 tw-left-0 tw-right-0 tw-h-[40px]" style="background:url(&#39;/assets/images/giftCards/text-bg-b.svg&#39;)
                no-repeat 50% 0 / 100% 100%;"></div><h2 class="tw-text-left min-[410px]:tw-text-center tw-text-h2-sm md:tw-text-h2 !tw-leading-[0.875] tw-text-nl-green-100 tw-uppercase tw-mb-[13px] md:tw-mb-[35px]">Gift Nurture Life to...</h2><div class="tw-flex max-md:tw-flex-row-reverse max-md:tw-items-center max-md:tw-max-w-[400px] max-md:tw-mx-auto md:tw-px-[60px]"><div class="tw-w-[123px] md:tw-w-[261px] md:-tw-mt-4 md:tw-translate-x-[17%]"><img src="`+et+'" class="md:tw-w-[202px]" alt=""></div><div class="tw-flex-1"><ul class="tw-space-y-3 md:tw-space-y-5 tw-text-[18px] md:tw-text-[24px] tw-font-medium [&amp;_li]:tw-relative [&amp;_li]:tw-pl-[36px] [&amp;_li]:after:tw-content-[&#39;&#39;] [&amp;_li]:after:tw-bg-checkmark [&amp;_li]:after:tw-size-[23px] [&amp;_li]:after:tw-absolute [&amp;_li]:after:tw-left-0 [&amp;_li]:after:tw-top-0"><li>Work from home parents</li><li>Stressed colleagues</li><li>Moms who hate cooking</li><li>Dads with picky eaters</li><li>Literally anyone with kids</li></ul></div></div></div></div><div class="tw-mx-auto tw-max-w-[400px] md:tw-max-w-[727px] tw-mb-[45px] max-md:tw-px-5"><h2 class="tw-text-center max-md:tw-text-[28px] max-md:!tw-leading-[1.143] tw-text-h2 !tw-leading-[0.875] tw-text-nl-green-100 tw-uppercase tw-mb-4 md:tw-mb-5">Why buy a Nurture Life Gift Card?</h2><div class="tw-flex tw-gap-y-6 tw-flex-wrap -tw-mx-3 max-md:tw-leading-[1.25]"><div class="tw-w-full md:tw-w-1/3 tw-px-3 tw-text-center"><div class="tw-mb-[14px] tw-size-[68px] tw-mx-auto"><img src="'+tt+'" alt=""></div><h3 class="tw-text-[20px] tw-leading-[1.042] tw-font-bold tw-normal-case tw-mb-[10px]">Nutritious &amp; Fresh</h3><p>Parents can feel great about serving up our nutritionally balanced meals and snacks made with real, clean ingredients.</p></div><div class="tw-w-full md:tw-w-1/3 tw-px-3 tw-text-center"><div class="tw-mb-[14px] tw-size-[68px] tw-mx-auto"><img src="'+at+'" alt=""></div><h3 class="tw-text-[20px] tw-leading-[1.042] tw-font-bold tw-normal-case tw-mb-[10px]">Kid-Friendly</h3><p>We design every meal with kids’ tastebuds in mind. From hidden veggies to familiar flavors, each element centers kids’ palates.</p></div><div class="tw-w-full md:tw-w-1/3 tw-px-3 tw-text-center"><div class="tw-mb-[14px] tw-size-[68px] tw-mx-auto"><img src="'+st+'" alt=""></div><h3 class="tw-text-[20px] tw-leading-[1.042] tw-font-bold tw-normal-case tw-mb-[10px]">Less Stress</h3><p>Every item on our menu can be served in a minute or less. That means less time cooking, more time for everything else.</p></div></div></div>',2),W="gift-cards",Dt=Be({__name:"index",async setup(zt){let g,$;const{data:b}=([g,$]=Ne(async()=>Ze(W,async()=>await $fetch(`/api/content/pages/${W}`),"$fqWRZ3QBiA")),g=await g,$(),g);Je(Qe(b.value));const Z=b.value.page.gifts.faqs,O=b.value.page.gifts.header,K=b.value.page.gifts.subheader,o=n(),d=n(1),v=n(!1),f=n(!1),H=De(()=>d.value===1?"Continue to Payment":l.value&&l.value.gift_amount===l.value.pay_amount?`Buy ${Ue(l.value?l.value.gift_amount:0,0)} Gift Card`:"Buy Gift Card"),M=j(A({amount:Pe().min(25,"This field is required"),message:p().min(3,"This field is required").nullable(),"recipient:first_name":p().min(1,"This field is required").nullable(),"recipient:last_name":p().min(1,"This field is required").nullable(),"recipient:email":p().email().min(1,"This field is required").nullable(),"recipient:zip_code":p().min(1,"This field is required").nullable().refine(()=>{var a;return!!((a=i.value.timezone)!=null&&a.state)},"Wrong zip code")})),{handleSubmit:J,errors:y}=I({validationSchema:M}),{value:Q}=c("amount"),{value:q}=c("message"),{value:Y}=c("recipient:first_name"),{value:X}=c("recipient:last_name"),{value:ee}=c("recipient:email"),{value:te}=c("recipient:zip_code"),F=new Date;F.setMinutes(F.getMinutes()+30);const m=n({method:"print",schedule:F.toISOString()}),l=n(),i=n({timezone:null,first_name:"",last_name:"",email:"",zip_code:"",message:"Thought you’d enjoy these healthy meals and snacks for babies, toddlers, and kids! They’ve got a ton of options on their menu, all ready to eat in a minute or less. Enjoy the cooking break!"});q.value=i.value.message,z(l,a=>{Q.value=a.gift_amount},{deep:!0}),z(()=>i,()=>{q.value=i.value.message,Y.value=i.value.first_name,X.value=i.value.last_name,te.value=i.value.zip_code,ee.value=i.value.email},{deep:!0});const w=n({first_name:"",last_name:"",email:""}),B=j(A({"sender:first_name":p().min(1,"This field is required").nullable(),"sender:last_name":p().min(1,"This field is required").nullable(),"sender:email":p().email().min(1,"This field is required").nullable()})),{handleSubmit:ae,errors:se}=I({validationSchema:B}),{value:ie}=c("sender:first_name"),{value:le}=c("sender:last_name"),{value:ne}=c("sender:email");z(()=>w,()=>{ie.value=w.value.first_name,le.value=w.value.last_name,ne.value=w.value.email},{deep:!0});const oe=function(){f.value=!0,o.value=null,d.value===1?re():de()},re=J(async()=>{v.value=!0,await we(l.value.original_amount),v.value=!1,d.value=2,f.value=!1}),de=ae(async()=>{if(!D.value){o.value="Please enter your payment info.";return}o.value="",v.value=!0;try{await me(i)?N.value=!0:o.value="We were unable to process your payment"}catch(a){a instanceof Le?ve(a.fieldErrors):o.value=a.response?a.response.data.message||a.response.data:a.message||a}finally{v.value=!1}}),me=async a=>{o.value=null,await C.value.submit();const{error:s,confirmationToken:V}=await T.value.createConfirmationToken({elements:C.value,params:{payment_method_data:{billing_details:{email:a.value.email,name:a.value.first_name+" "+a.value.last_name}}}});if(s)throw Error(s.message);return!!(await ke({amount:l.value.original_amount,confirmation_token:V.id,recipient:a.value,sender:w.value,delivery_method:`${m.value.schedule!==null&&m.value.method!=="print"?"scheduled_":""}${m.value.method}`,delivery_schedule:m.value.schedule})).success},ce=()=>{window.location.reload()},N=n(!1),T=n(),C=n(),D=n(!1),ue=async function(){T.value=await Oe(Ke)},we=async function(a){await ue(),C.value=await T.value.elements({mode:"payment",amount:a*100,currency:"usd",paymentMethodCreation:"manual",appearance:{},paymentMethodTypes:["card"]})},pe=a=>{D.value=a,a&&(o.value="")},ve=a=>{f.value=!0;const s=je(a);(s.delivery_schedule||s.delivery_method)&&(s.deliveryMethod={schedule:s.delivery_schedule??null,method:s.delivery_method??null}),He.intersection(["recipient","delivery_schedule","delivery_method"],Object.keys(s)).length?(d.value=1,o.value=R(s)):o.value=R(s)};return(a,s)=>{var L;const V=Se,P=Fe,fe=Te,xe=Ve,he=ze,_e=Ge,ge=Ee,be=qe,ye=$e,Ce=Me;return x(),_(G,null,[t("section",it,[t("div",lt,[nt,t("div",ot,[rt,t("div",dt,[t("h1",mt,k(e(O)),1),t("div",ct,k(e(K)),1)])])]),ut,wt]),t("section",pt,[t("div",vt,[t("div",ft,[t("div",xt,[t("form",{id:"gift-cards-form",class:"tw-space-y-[11px] md:tw-space-y-[15px]","data-step":e(d),novalidate:"",onSubmit:Ae(oe,["prevent"]),"validation-schema":e(d)===1?e(M):e(B)},[e(d)===1?(x(),_(G,{key:0},[u(V,{modelValue:e(l),"onUpdate:modelValue":s[0]||(s[0]=r=>S(l)?l.value=r:null),errors:e(y),submitClicked:e(f)},null,8,["modelValue","errors","submitClicked"]),u(P,{modelValue:e(m),"onUpdate:modelValue":s[1]||(s[1]=r=>S(m)?m.value=r:null),errors:e(y),timezone:(L=e(i).timezone)==null?void 0:L.time_zone},null,8,["modelValue","errors","timezone"]),t("div",_t,[u(fe,{modelValue:e(i),"onUpdate:modelValue":s[2]||(s[2]=r=>S(i)?i.value=r:null),submitClicked:e(f),"delivery-method":e(m),errors:e(y)},null,8,["modelValue","submitClicked","delivery-method","errors"]),u(xe,{submitClicked:e(f),modelValue:e(i).message,"onUpdate:modelValue":s[3]||(s[3]=r=>e(i).message=r),errors:e(y)},null,8,["submitClicked","modelValue","errors"])])],64)):(x(),_(G,{key:1},[t("div",gt,[u(he,{amount:e(l),"delivery-method":e(m),recipient:e(i),onGoBack:s[4]||(s[4]=r=>d.value=1)},null,8,["amount","delivery-method","recipient"])]),t("div",bt,[u(_e,{submitClicked:e(f),modelValue:e(w),"onUpdate:modelValue":s[5]||(s[5]=r=>S(w)?w.value=r:null),errors:e(se)},null,8,["submitClicked","modelValue","errors"])]),t("div",yt,[u(ge,{builder:e(C),onChanged:pe},null,8,["builder"])])],64)),e(o)?(x(),_("p",Ct,k(e(o)),1)):E("",!0),t("div",kt,[t("button",St,[e(v)?(x(),Ie(be,{key:0,class:"!tw-h-5 [&>div]:!tw-top-1"})):E("",!0),t("span",{class:U({"tw-opacity-0 tw-absolute":e(v)})},k(e(H)),3),t("i",{class:U([{"tw-opacity-0 tw-absolute":e(v)},"icon-main-chevron-bold-right tw-text-[14px] tw-mt-[2px]"])},null,2)]),e(d)===2?(x(),_("button",{key:0,"aria-live":"polite",class:"flex items-center mt-12",onClick:s[6]||(s[6]=r=>d.value=1)},Tt)):E("",!0)])],40,ht)])]),Vt,u(ye,{faqs:e(Z)},null,8,["faqs"])])]),u(Ce,{open:e(N),onClick:ce},null,8,["open"])],64)}}});export{Dt as default};