import{_ as k,a as N,b as S,c as U}from"./BfPjfeWt.js";import{u as j,c as b,b as d,a as o,t as n,e as a,f as C,g as i,v as B,d as M,h as u,i as h,j as D,n as E,k as $,l as v,o as f}from"./BKiFavna.js";import{u as q}from"./BZ7f31ti.js";import{u as H}from"./DKzHUNYh.js";import{u as I}from"./BOqT4ZDK.js";import{_ as O}from"./DlAUqK2U.js";import"./DxB0DKYp.js";const P={"data-theme":"light"},z={id:"main-content",role:"main"},A={class:"form-wrap"},F={class:"form-container"},K={class:"lead"},L={class:"form-group checkbox"},G={key:0,class:"form-row"},J={class:"form-group"},Q={class:"form-group"},R={class:"form-row"},W={class:"form-group"},X={class:"form-group"},Y={class:"form-group"},Z={value:"politics"},oo={value:"business"},eo={value:"crime"},so={value:"sports"},to={value:"other"},no={class:"form-group"},ao={class:"form-group"},lo=["disabled"],io={__name:"tip",setup(ro){const{lang:t}=j(),{api:g}=q(),p=H(),e=$({name:"",email:"",phone:"",location:"",category:"politics",subject:"",description:"",is_anonymous:!1}),m=v(!1),c=v(""),_=v("success"),y=async()=>{m.value=!0,c.value="";try{const r=await g.post("/tips",e);c.value=r.data.message,_.value="success",p.success(r.data.message),Object.keys(e).forEach(s=>e[s]=""),e.is_anonymous=!1,e.category="politics"}catch(r){c.value=r.message,_.value="error",p.error(r.message),p.error(r.message)}finally{m.value=!1}};return I({title:t.value==="bn"?"নিউজ টিপস":"News Tip"}),(r,s)=>{const w=k,V=N,T=S,x=U;return f(),b("div",P,[d(w),d(V),d(T),o("main",z,[o("div",A,[o("div",F,[o("h1",null,n(a(t)==="bn"?"নিউজ টিপস পাঠান":"Send News Tip"),1),o("p",K,n(a(t)==="bn"?"গুরুত্বপূর্ণ ঘটনা বা তথ্য আমাদের জানান।":"Share important news or information with us."),1),o("form",{onSubmit:C(y,["prevent"])},[o("div",L,[o("label",null,[i(o("input",{type:"checkbox","onUpdate:modelValue":s[0]||(s[0]=l=>e.is_anonymous=l)},null,512),[[B,e.is_anonymous]]),M(" "+n(a(t)==="bn"?"অ্যানোনিমাস থাকতে চাই":"Keep me anonymous"),1)])]),e.is_anonymous?h("",!0):(f(),b("div",G,[o("div",J,[o("label",null,n(a(t)==="bn"?"নাম":"Name"),1),i(o("input",{"onUpdate:modelValue":s[1]||(s[1]=l=>e.name=l)},null,512),[[u,e.name]])]),o("div",Q,[o("label",null,n(a(t)==="bn"?"ইমেইল":"Email"),1),i(o("input",{"onUpdate:modelValue":s[2]||(s[2]=l=>e.email=l),type:"email"},null,512),[[u,e.email]])])])),o("div",R,[o("div",W,[o("label",null,n(a(t)==="bn"?"ফোন":"Phone"),1),i(o("input",{"onUpdate:modelValue":s[3]||(s[3]=l=>e.phone=l),type:"tel"},null,512),[[u,e.phone]])]),o("div",X,[o("label",null,n(a(t)==="bn"?"লোকেশন":"Location"),1),i(o("input",{"onUpdate:modelValue":s[4]||(s[4]=l=>e.location=l)},null,512),[[u,e.location]])])]),o("div",Y,[o("label",null,n(a(t)==="bn"?"ক্যাটাগরি":"Category"),1),i(o("select",{"onUpdate:modelValue":s[5]||(s[5]=l=>e.category=l)},[o("option",Z,n(a(t)==="bn"?"রাজনীতি":"Politics"),1),o("option",oo,n(a(t)==="bn"?"ব্যবসা":"Business"),1),o("option",eo,n(a(t)==="bn"?"অপরাধ":"Crime"),1),o("option",so,n(a(t)==="bn"?"খেলা":"Sports"),1),o("option",to,n(a(t)==="bn"?"অন্যান্য":"Other"),1)],512),[[D,e.category]])]),o("div",no,[o("label",null,n(a(t)==="bn"?"বিষয়":"Subject")+" *",1),i(o("input",{"onUpdate:modelValue":s[6]||(s[6]=l=>e.subject=l),required:""},null,512),[[u,e.subject]])]),o("div",ao,[o("label",null,n(a(t)==="bn"?"বিস্তারিত":"Description")+" *",1),i(o("textarea",{"onUpdate:modelValue":s[7]||(s[7]=l=>e.description=l),rows:"6",required:""},null,512),[[u,e.description]])]),c.value?(f(),b("p",{key:1,class:E(["msg",_.value])},n(c.value),3)):h("",!0),o("button",{disabled:m.value,class:"submit-btn"},n(m.value?"Sending...":a(t)==="bn"?"পাঠান":"Submit"),9,lo)],32)])])]),d(x)])}}},fo=O(io,[["__scopeId","data-v-742f16da"]]);export{fo as default};
