1import{a as k,E as C,F as L,r as l,t as p,k as b,j as e,M as F,e as T,f as g,C as z,i as B,v as P,L as R,w,x as I,o as M,A as _,y as A}from"./index-DYqdqpF7.js";import{B as V}from"./bell-B7KhY4Yy.js";function $(){const{language:t}=k(),j=C(),v=L(),[i,o]=l.useState(""),[m,d]=l.useState(!1),[y,N]=l.useState(!1),[u,x]=l.useState(null),h=l.useRef(!1),s=t==="fr",r="newsletter-page",n=new URLSearchParams(j.search).get("source")||"direct";l.useEffect(()=>{p("newsletter_page_view",{language:t,source:n,...b()})},[t,n]);const S=a=>{if(a instanceof TypeError)return"network";const c=a?.status;if(typeof c=="number"){if(c>=500)return"server";if(c>=400)return"validation"}return"server"},E=async a=>{if(a.preventDefault(),!i){w({form:"newsletter",page:r,language:t,error_code:"validation",field:"email"});return}d(!0),x(null),I({form:"newsletter",page:r,language:t});try{await M.subscribeNewsletter(i),N(!0),o(""),p(_.NEWSLETTER_SUBSCRIBE,{language:t,source:`newsletter-page-${n}`,page:r,...b()}),A({form:"newsletter",page:r,language:t})}catch(f){x(s?"Erreur. Veuillez réessayer.":"Error. Please try again."),w({form:"newsletter",page:r,language:t,error_code:S(f)})}finally{d(!1)}};return e.jsx(F,{children:e.jsxs("div",{className:"min-h-[calc(100vh-140px)] flex flex-col items-center justify-center px-4 py-12",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-primary/5 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-primary/5 rounded-full blur-3xl"})]}),e.jsx("div",{className:"relative z-10 w-full max-w-lg",children:y?e.jsxs("div",{className:"glass-card p-8 sm:p-10 border border-primary/30 text-center",children:[e.jsx("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-gradient-to-br from-green-500/20 to-green-600/20 flex items-center justify-center",children:e.jsx(T,{className:"w-10 h-10 text-green-400"})}),e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold text-white mb-4",children:s?"Inscription confirmée !":"Subscription confirmed!"}),e.jsx("p",{className:"text-white/70 mb-8",children:s?"Merci de votre intérêt ! Vous recevrez bientôt des nouvelles de nos prochains concerts et sorties.":"Thank you for your interest! You will soon receive news about our upcoming concerts and releases."}),e.jsx("button",{onClick:()=>v(`/${t}`),className:"btn-gold px-8 py-3",children:s?"Retour à l'accueil":"Back to home"})]}):e.jsxs("div",{className:"glass-card p-8 sm:p-10 border border-primary/30",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-gradient-to-br from-gold/20 to-gold-light/20 flex items-center justify-center",children:e.jsx(g,{className:"w-8 h-8 text-primary"})}),e.jsx("h1",{className:"title-gold text-2xl sm:text-3xl font-bold mb-3",children:s?"Restez informé":"Stay informed"}),e.jsx("p",{className:"text-white/70 text-sm sm:text-base",children:s?"Inscrivez-vous à la newsletter de Clément Chatelain":"Subscribe to Clément Chatelain's newsletter"})]}),e.jsxs("div",{className:"grid gap-4 mb-8",children:[e.jsxs("div",{className:"flex items-start gap-3 text-sm",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(z,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-white font-medium",children:s?"Prochains concerts":"Upcoming concerts"}),e.jsx("p",{className:"text-white/50 text-xs mt-0.5",children:s?"Soyez les premiers informés des dates":"Be the first to know about dates"})]})]}),e.jsxs("div",{className:"flex items-start gap-3 text-sm",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(B,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-white font-medium",children:s?"Sorties d'albums":"Album releases"}),e.jsx("p",{className:"text-white/50 text-xs mt-0.5",children:s?"Nouveaux enregistrements et collaborations":"New recordings and collaborations"})]})]})]}),e.jsxs("form",{onSubmit:E,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"sr-only",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(g,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-white/40"}),e.jsx("input",{id:"email",type:"email",value:i,onChange:a=>o(a.target.value),onFocus:()=>{h.current||(h.current=!0,P({form:"newsletter",page:r,language:t}))},required:!0,placeholder:s?"[email protected]":"[email protected]",className:"w-full pl-12 pr-4 py-4 bg-white/5 border border-white/20 rounded-xl text-white placeholder-white/40 focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/50 transition-all"})]})]}),u&&e.jsx("p",{className:"text-red-400 text-sm text-center bg-red-500/10 py-2 px-4 roun
1ded-lg",children:u}),e.jsx("button",{type:"submit",disabled:m||!i,className:"w-full py-4 rounded-xl text-base font-semibold disabled:opacity-50 transition-all duration-300 hover:scale-[1.02] hover:shadow-lg hover:shadow-primary/20",style:{background:"linear-gradient(135deg, hsl(43, 74%, 61%) 0%, hsl(45, 76%, 76%) 100%)",color:"hsl(0, 0%, 4%)"},children:m?e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[e.jsx(R,{className:"w-5 h-5 animate-spin"}),s?"Inscription...":"Subscribing..."]}):e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[e.jsx(V,{className:"w-5 h-5"}),s?"S'inscrire à la newsletter":"Subscribe to newsletter"]})})]}),e.jsx("p",{className:"text-white/40 text-xs text-center mt-6",children:s?"Votre email ne sera jamais partagé. Vous pouvez vous désinscrire à tout moment.":"Your email will never be shared. You can unsubscribe at any time."})]})})]})})}export{$ as NewsletterPage,$ as default};
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.