(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3639],{95590:function(e,s,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/newsletters",function(){return n(66896)}])},14393:function(e,s,n){"use strict";n.a(e,async function(e,t){try{var a=n(85893),r=n(93437),i=n(98746),l=e([r]);r=(l.then?(await l)():l)[0];let o=e=>{let{pageData:s}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Z,{seoSettings:s.page.seoSettings}),(0,a.jsx)(r.Z,{pageData:s})]})};s.Z=o,t()}catch(c){t(c)}})},15477:function(e,s,n){"use strict";n.a(e,async function(e,t){try{n.d(s,{Z:function(){return a.Z}});var a=n(14393),r=e([a]);a=(r.then?(await r)():r)[0],t()}catch(i){t(i)}})},25272:function(e,s,n){"use strict";n.d(s,{Z:function(){return b}});var t=n(85893),a=n(59371),r=n.n(a),i=n(25675),l=n.n(i),o=n(16310),c=n(82175),d=n(41922),u=n(15140),m=n.n(u),h=n(67294),g=n(4166),x=n.n(g);let p=e=>{let{id:s,name:n,label:a,type:r="checkbox",value:i,onChange:l,hasError:o,errorMessage:c}=e,[d,u]=(0,h.useState)(i?"on":"off"),m=()=>{l(!0),u("on")},g=()=>{l(!1),u("off")};return(0,t.jsxs)("div",{className:"".concat(x().root," ").concat(o?x().hasError:""),children:[(0,t.jsxs)("fieldset",{className:x().fieldset,children:["off"===d&&(0,t.jsxs)("div",{className:x().wrap,onClick:m,children:[(0,t.jsx)("div",{className:x().box}),(0,t.jsx)("div",{className:x().txt,children:a})]}),"on"===d&&(0,t.jsxs)("div",{className:x().wrap,onClick:g,children:[(0,t.jsx)("div",{className:x().boxChecked}),(0,t.jsx)("div",{className:x().txt,children:a})]})]}),c&&(0,t.jsx)("div",{className:x().errorMessage,children:c})]})};var w=n(31092);let j="Required field",_="Invalid email",f=o.Ry().shape({firstName:o.Z_().required(j),lastName:o.Z_().required(j),email:o.Z_().required(j).email(_)}),v=e=>{let s=[];return e.agobaynews&&s.push("PRODUCTS"),e.agobayweekly&&s.push("WEEKLY"),s},N=()=>{let[e,s]=(0,h.useState)("signIn"),n=(0,c.TA)({validationSchema:f,initialValues:{agobaynews:!1,agobayweekly:!1,lastName:"",firstName:"",email:""},onSubmit:async()=>{try{let e=await fetch("/api/subscribe",{method:"POST",body:JSON.stringify({firstName:n.values.firstName,lastName:n.values.lastName,email:n.values.email,tags:v(n.values)})}),t=await e.json();if(console.log(t),t.success)s("success");else throw Error("Something went wrong");s("success")}catch(a){s("error")}}});return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"agContent",children:[(0,t.jsx)(w.Z,{children:(0,t.jsxs)("div",{className:r().nlGrid,children:[(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:r().nlInfoWrap,children:[(0,t.jsx)(l(),{src:"/assets/img/AGOBAY_Superzeichen_Kreis-Linear_RGB.svg",alt:"AGOBAY Weekly",width:115,height:115}),(0,t.jsx)("div",{className:r().nlTitle,children:"THE AGOBAY weekly"}),(0,t.jsx)("div",{className:r().nlText,children:"Our weekly newsletter brings you updates on new stories in our journal, additions to our online shop, monthly playlists, upcoming events and everything else that inspires the world of AGOBAY."})]})}),(0,t.jsx)("div",{className:r().nlGridItem,children:(0,t.jsxs)("div",{className:r().nlInfoWrap,children:[(0,t.jsx)(l(),{src:"/assets/img/AGOBAY_Superzeichen_NEWS.svg",alt:"AGOBAY Weekly",width:115,height:115}),(0,t.jsx)("div",{className:r().nlTitle,children:"PRODUCT updates"}),(0,t.jsx)("div",{className:r().nlText,children:"Our product newsletter keeps you informed about the latest product launches and restocks in our online shop, encompassing additions to our permanent collection as well as our single pieces."})]})})]})}),"success"===e&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{className:m().nlSignUpSuccessWrap,children:(0,t.jsxs)("div",{className:m().nlSignIn,children:[(0,t.jsx)("h3",{children:"WELCOME"}),(0,t.jsx)("p",{children:"Thank you for joining the world of AGOBAY. Your first newsletter is on its way soon."})]})})}),"error"===e&&(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{children:"ERROR"}),(0,t.jsx)("p",{children:"Something went wrong, please try again later."})]})}),"signIn"===e&&(0,t.jsx)(w.Z,{children:(0,t.jsxs)("form",{onSubmit:n.handleSubmit,children:[(0,t.jsxs)("div",{className:r().nlCheckbox,children:[(0,t.jsx)("div",{className:r().nlCheckboxFirst,children:(0,t.jsx)(p,{id:"agobayweekly",name:"agobayweekly",label:"I sign up for AGOBAY WEEKLY",value:n.values.agobayweekly,onChange:e=>n.setFieldValue("agobayweekly",e)})}),(0,t.jsx)("div",{className:r().nlCheckboxSecond,children:(0,t.jsx)(p,{id:"agobaynews",name:"agobaynews",label:"I sign up for product updates",value:n.values.agobaynews,onChange:e=>n.setFieldValue("agobaynews",e)})})]}),(0,t.jsxs)("div",{className:r().nlSignUpForm,children:[(0,t.jsx)(d.Z,{id:"firstName",name:"firstName",label:"First name",value:n.values.firstName,onChange:n.handleChange,hasError:n.touched.firstName&&!!n.errors.firstName}),(0,t.jsx)(d.Z,{id:"lastName",name:"lastName",label:"Last Name",value:n.values.lastName,onChange:n.handleChange,hasError:n.touched.lastName&&!!n.errors.lastName}),(0,t.jsx)(d.Z,{id:"email",name:"email",label:"Email",value:n.values.email,onChange:n.handleChange,hasError:n.touched.email&&!!n.errors.email,errorMessage:n.touched.email&&n.errors.email&&n.errors.email===_?n.errors.email:""}),(0,t.jsx)("div",{className:m().btnNL,children:(0,t.jsx)("button",{type:"submit",className:m().suBtn,children:"SUBSCRIBE"})})]})]})})]})})};var b=N},98746:function(e,s,n){"use strict";n.d(s,{Z:function(){return o}});var t=n(85893),a=n(9008),r=n.n(a),i=n(11163);let l=e=>{let{seoSettings:s,noIndex:n=!1}=e,a=(0,i.useRouter)(),l=("https://www.agobay.com"+(a.locale?"/"+a.locale:"")+("/404"===a.route||"/500"===a.route?a.route:"/"!==a.asPath?a.asPath:"")).split("?")[0],o="".concat(s.title?s.title+" | ":"","AGOBAY"),c=s.ogTitle?s.ogTitle+" | AGOBAY":o,d=s.ogDescription?s.ogDescription:s.description;return(0,t.jsxs)(r(),{children:[(0,t.jsx)("title",{children:o},"title"),(0,t.jsx)("meta",{name:"title",content:o},"metaTitle"),s.description&&(0,t.jsx)("meta",{name:"description",content:s.description},"description"),c&&(0,t.jsx)("meta",{property:"og:title",content:c},"ogTitle"),d&&(0,t.jsx)("meta",{property:"og:description",content:d},"ogDescription"),s.ogImage&&(0,t.jsx)("meta",{property:"og:image",content:s.ogImage.url},"ogImage"),c&&(0,t.jsx)("meta",{name:"twitter:title",content:c},"twitterTitle"),d&&(0,t.jsx)("meta",{name:"twitter:description",content:d},"twitterDescription"),s.ogImage&&(0,t.jsx)("meta",{name:"twitter:image",content:s.ogImage.url},"twitterImage"),(0,t.jsx)("link",{rel:"canonical",href:l}),n&&(0,t.jsx)("meta",{name:"robots",content:"noindex"})]})};var o=l},31092:function(e,s,n){"use strict";n.d(s,{Z:function(){return o}});var t=n(85893),a=n(47382),r=n.n(a),i=n(67294);let l=e=>{let{children:s}=e,[n,a]=(0,i.useState)(!1),l=(0,i.useRef)(null),o=(0,i.useRef)(-1),c=()=>{let e=l.current;if(!e)return;let s=e.getBoundingClientRect().top+window.scrollY,n=window.scrollY>o.current?"down":"up";"down"===n&&window.scrollY>s-window.innerHeight?a(!0):"up"===n&&s>window.scrollY+window.innerHeight&&a(!1),o.current=window.scrollY};return(0,i.useEffect)(()=>(window.addEventListener("scroll",c),c(),()=>{window.removeEventListener("scroll",c)}),[]),(0,t.jsx)("div",{className:n?"".concat(r().animated," ").concat(r().slideInUp):"",ref:l,children:s})};var o=l},69282:function(e,s,n){"use strict";n.d(s,{Z:function(){return c}});var t=n(85893),a=n(76317),r=n.n(a),i=n(41664),l=n.n(i);let o=()=>(0,t.jsx)("div",{className:"agContent",children:(0,t.jsx)("div",{className:"c1",children:(0,t.jsx)("div",{className:r().preFooter,children:(0,t.jsx)(l(),{href:"https://www.instagram.com/agobay.escapes/",target:"_blank",rel:"noreferrer",children:"FOLLOW US ON INSTAGRAM"})})})});var c=o},66896:function(e,s,n){"use strict";n.a(e,async function(e,t){try{n.r(s),n.d(s,{__N_SSG:function(){return c},default:function(){return d}});var a=n(85893),r=n(15477),i=n(69282),l=n(25272),o=e([r]);r=(o.then?(await o)():o)[0];var c=!0;function d(e){let{agobayLandingpage:s}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.Z,{pageData:{page:s.localized}}),(0,a.jsx)(l.Z,{}),(0,a.jsx)(i.Z,{})]})}t()}catch(u){t(u)}})},15140:function(e){e.exports={nlSignUpSuccessWrap:"NewsletterSignUp_nlSignUpSuccessWrap___6Y56",nlSignIn:"NewsletterSignUp_nlSignIn__qi71a",suBtn:"NewsletterSignUp_suBtn__Ra8hH",btnNL:"NewsletterSignUp_btnNL__u1gO1"}},47382:function(e){e.exports={animated:"SlideInUp_animated__Y_S_A",slideInUp:"SlideInUp_slideInUp__zDmhJ"}},4166:function(e){e.exports={root:"FormCheckbox_root__cx1Vt",fieldset:"FormCheckbox_fieldset__qj2a_",hasError:"FormCheckbox_hasError__G15bg",errorMessage:"FormCheckbox_errorMessage__WYXJl",wrap:"FormCheckbox_wrap__4DOEs",box:"FormCheckbox_box__jp9gn",boxChecked:"FormCheckbox_boxChecked__ZaJyE",txt:"FormCheckbox_txt___o656"}},76317:function(e){e.exports={preFooter:"FollowInstagram_preFooter__n2DFy"}}},function(e){e.O(0,[1255,4573,3437,9774,2888,179],function(){return e(e.s=95590)}),_N_E=e.O()}]);