import{_ as x,a as S,b as V,c as k}from"./BfPjfeWt.js";import{u as B,c as p,b as c,a as e,t as o,e as r,f as $,g as b,h as f,n as C,i as D,k as E,l as d,o as v}from"./BKiFavna.js";import{u as H}from"./BZ7f31ti.js";import{u as I}from"./DKzHUNYh.js";import{u as M}from"./BOqT4ZDK.js";import{_ as U}from"./DlAUqK2U.js";import"./DxB0DKYp.js";const q={"data-theme":"light"},z={id:"main-content",role:"main"},A={class:"form-wrap"},F={class:"form-container narrow"},G={class:"lead"},j={class:"form-group"},J={class:"form-group"},K=["disabled"],L={__name:"newsletter",setup(O){const{lang:t}=B(),{api:g}=H(),m=I(),s=E({name:"",email:""}),l=d(!1),n=d(""),u=d("success"),h=async()=>{l.value=!0,n.value="";try{const a=await g.post("/newsletter/subscribe",s);n.value=a.data.message,u.value="success",m.success(a.data.message),s.name="",s.email=""}catch(a){n.value=a.message,u.value="error",m.error(a.message),m.error(a.message)}finally{l.value=!1}};return M({title:t.value==="bn"?"নিউজলেটার":"Newsletter"}),(a,i)=>{const w=x,y=S,N=V,T=k;return v(),p("div",q,[c(w),c(y),c(N),e("main",z,[e("div",A,[e("div",F,[e("h1",null,o(r(t)==="bn"?"নিউজলেটার সাবস্ক্রাইব করুন":"Subscribe to Newsletter"),1),e("p",G,o(r(t)==="bn"?"সর্বশেষ সংবাদ ইমেইলে পেতে সাবস্ক্রাইব করুন।":"Get latest news in your inbox."),1),e("form",{onSubmit:$(h,["prevent"])},[e("div",j,[e("label",null,o(r(t)==="bn"?"নাম (ঐচ্ছিক)":"Name (optional)"),1),b(e("input",{"onUpdate:modelValue":i[0]||(i[0]=_=>s.name=_)},null,512),[[f,s.name]])]),e("div",J,[e("label",null,o(r(t)==="bn"?"ইমেইল":"Email")+" *",1),b(e("input",{"onUpdate:modelValue":i[1]||(i[1]=_=>s.email=_),type:"email",required:""},null,512),[[f,s.email]])]),n.value?(v(),p("p",{key:0,class:C(["msg",u.value])},o(n.value),3)):D("",!0),e("button",{disabled:l.value,class:"submit-btn"},o(l.value?"Subscribing...":r(t)==="bn"?"সাবস্ক্রাইব":"Subscribe"),9,K)],32)])])]),c(T)])}}},ee=U(L,[["__scopeId","data-v-61169d7e"]]);export{ee as default};
