1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[94],{4575:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/suggestion",function(){return t(3778)}])},3778:function(e,s,t){"use strict";t.r(s),t.d(s,{__N_SSP:function(){return p},default:function(){return f}});var i=t(5893),n=t(6308),a=t(7294),l=t(9537);class r extends l.Z{generateFetchUrl(){return"".concat(l.Z.API_CONTACT_FORM,"/").concat(this.options.id,"/feedback")}async post(){try{let e=new FormData;for(let s in this.options.data)e.append(s,this.options.data[s]);e.append("_wpcf7_unit_tag","true");let s=await this._post({apiCall:this.generateFetchUrl()},e);return{error:"main_sent"===s.data.status?null:s.data.message}}catch(e){return{error:e}}}constructor(e){super(e),this.options=e}}var u=t(1859),o=t(1163),m=t(1648),c=t(4712),d=t(9869),x=t(5675),g=t.n(x),h=t(3460),p=!0;function f(){var e,s,t,l;let x=(0,m.T)(),[p]=(0,u.Z)(),{locale:f}=(0,o.useRouter)(),{submit:_}=(l=String(null==p?void 0:p.userSuggestionForm),{submit:(0,a.useCallback)(e=>new r({id:l,data:e,language:f}).post(),[l,f])}),v=(0,o.useRouter)(),j=(0,a.useRef)(null),[b,N]=(0,a.useState)(!1),[y,w]=(0,a.useState)({name:"",email:"",message:"",file:null}),k=e=>{w(s=>({...s,[e.target.name]:e.target.value}))},C=()=>{w(e=>({...e,file:null})),j.current&&(j.current.value="")},F=async e=>{try{e.preventDefault();let{error:s}=await _({"form-name":y.name,"form-email":y.email,"form-message":y.message,"form-file":y.file});if(s)return c.Am.custom(e=>(0,i.jsx)(d.F,{id:e,text:s}),{duration:3e3});N(!0),(0,h.N)({event:"article_interaction",interaction_type:"suggest",interaction_option:y.message})}catch(e){c.Am.custom(s=>(0,i.jsx)(d.F,{id:s,text:String(e)}),{duration:3e3})}};return(0,i.jsx)(n.Z,{children:(0,i.jsx)("div",{className:"mx-auto mb-2.5 mt-14 flex w-full max-w-2xl items-center p-2.5 lg:my-24",children:b?(0,i.jsxs)("div",{className:"flex w-full flex-col items-center",children:[(0,i.jsx)("div",{className:"mb-11",children:(0,i.jsx)(g(),{src:"/assets/images/icons/check.svg",alt:"K\xf6sz\xf6nj\xfck",width:174,height:174})}),(0,i.jsxs)("div",{className:"mb-14 space-y-3 text-center font-medium",children:[(0,i.jsx)("h1",{className:"text-6xl",children:x.user_suggestion.thank_you}),(0,i.jsx)("p",{children:x.user_suggestion.tip_received})]}),(0,i.jsx)("div",{children:(0,i.jsx)("button",{className:"rounded bg-primary px-7 py-2.5 text-sm font-medium text-white",onClick:()=>v.push("/"),children:x.user_suggestion.back_to_main_page})})]}):(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"mb-6 text-5xl font-medium text-black opacity-10 lg:text-7xl",children:(0,i.jsx)("h1",{children:x.user_suggestion.reader_tip_title})}),(0,i.jsx)("div",{className:"mb-4 text-[16px] text-black",children:(0,i.jsx)("p",{children:x.user_suggestion.reader_tip_text})}),(0,i.jsx)("div",{children:(0,i.jsxs)("form",{className:"space-y-7",onSubmit:F,children:[(0,i.jsxs)("div",{className:"lg:max-w-[370px]",children:[(0,i.jsx)("label",{htmlFor:"name",className:"mb-1.5 text-sm font-medium",children:x.user_suggestion.name}),(0,i.jsx)("input",{name:"name",className:"w-full rounded border border-gray-300",type:"text",value:y.name,onChange:k})]}),(0,i.jsxs)("div",{className:"lg:max-w-[370px]",children:[(0,i.jsx)("label",{htmlFor:"email",className:"mb-1.5 text-sm font-medium",children:x.user_suggestion.email}),(0,i.jsx)("input",{name:"email",className:"w-full rounded border border-gray-300",type:"email",value:y.email,onChange:k})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("label",{htmlFor:"message",className:"mb-1.5 text-sm font-medium",children:[x.user_suggestion.message," ",(0,i.jsx)("span",{className:"text-primary",children:"*"})]}),(0,i.jsx)("textarea",{name:"message",className:"w-full resize-none rounded border border-gray-300",required:!0,rows:9,value:y.message,onChange:k})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"flex items-center space-x-2.5 text-xs",children:[(0,i.jsx)("button",{onClick:()=>{var e;return null===(e=j.current)||void 0===e?void 0:e.click()},type:"button",className:"rounded border border-gray-500 bg-gray-200 p-1.5",children:x.user_suggestion.file_upload}),(0,i.jsx)("label",{htmlFor:"file",children:null!==(t=null===(e=y.file)||void 0===e?void 0:e.name)&&void 0!==t?t:x.user_suggestion.file_upload_text}),(null===(s=y.file)||void 0===s?void 0:s.name)&&(0,i.jsx)("button",{type:"button",onClick:C,children:(0,i.jsx)(g(),{src:"/assets/images/icons/times.svg",alt:"",width:12,height:12})})]}),(0,i.jsx)("input",{ref:j,id:"file",name:"file",className:"hidden",type:"file",onChange:e=>{var s,t;if((null===(s=e.target.files)||void 0===s?void 0:s[0])&&(null===(t=e.target.files)||void 0===t?void 0:t[0].size)>1048576)return C();let i=e.target.files[0];w(e=>({...e,file:i}))},multiple:!1})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between space-y-5 lg:flex-nowrap lg:space-y-0",children:[(0,i.jsx)("button",{className:"w-full rounded bg-primary px-14 py-2.5 font-medium text-white lg:w-auto",type:"submit",children:x.user_suggestion.send}),(0,i.jsxs)("span",{className:"text-xs font-medium text-primary",children:["* ",x.user_suggestion.required]})]})]})})]})})})}}},function(e){e.O(0,[675,428,308,888,774,179],function(){return e(e.s=4575)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.