import{_ as $,a as q,b as B,c as D}from"./BfPjfeWt.js";import{_ as E}from"./DxB0DKYp.js";import{u as I,E as M,G as R,c as m,b as r,a as e,t as a,e as t,f as C,g as b,h as g,i as y,d as p,w as H,l as c,o as h}from"./BKiFavna.js";import{u as U}from"./BZ7f31ti.js";import{u as A}from"./DKzHUNYh.js";import{u as F}from"./BOqT4ZDK.js";import{_ as G}from"./DlAUqK2U.js";const P={"data-theme":"light"},W={id:"main-content",role:"main"},Y={class:"auth-container"},j={class:"auth-box"},z={class:"auth-title"},J={class:"auth-subtitle"},K={class:"form-group"},O={class:"form-group"},Q=["placeholder"],X={key:0,class:"error-msg"},Z=["disabled"],ee={key:0,class:"fas fa-spinner fa-spin"},se={class:"auth-footer"},oe={__name:"login",setup(te){const f=A(),{lang:s}=I(),{login:w}=U(),v=M(),x=R(),u=c(""),_=c(""),n=c(!1),l=c(""),T=async()=>{n.value=!0,l.value="";try{const i=await w(u.value,_.value);f.success(s.value==="bn"?`স্বাগতম, ${i.name}!`:`Welcome, ${i.name}!`);const o=x.query.redirect;o?v.push(o):v.push("/")}catch(i){const o=i.message||(s.value==="bn"?"লগইন ব্যর্থ":"Login failed");l.value=o,f.error(o)}finally{n.value=!1}};return F({title:"Login"}),(i,o)=>{const N=$,V=q,k=B,L=E,S=D;return h(),m("div",P,[r(N),r(V),r(k),e("main",W,[e("div",Y,[e("div",j,[e("h1",z,a(t(s)==="bn"?"লগইন করুন":"Login"),1),e("p",J,a(t(s)==="bn"?"আপনার অ্যাকাউন্টে প্রবেশ করুন":"Sign in to your account"),1),e("form",{onSubmit:C(T,["prevent"]),class:"auth-form"},[e("div",K,[e("label",null,a(t(s)==="bn"?"ইমেইল":"Email"),1),b(e("input",{"onUpdate:modelValue":o[0]||(o[0]=d=>u.value=d),type:"email",required:"",placeholder:"your@email.com"},null,512),[[g,u.value]])]),e("div",O,[e("label",null,a(t(s)==="bn"?"পাসওয়ার্ড":"Password"),1),b(e("input",{"onUpdate:modelValue":o[1]||(o[1]=d=>_.value=d),type:"password",required:"",placeholder:t(s)==="bn"?"আপনার পাসওয়ার্ড":"Your password"},null,8,Q),[[g,_.value]])]),l.value?(h(),m("p",X,a(l.value),1)):y("",!0),e("button",{type:"submit",disabled:n.value,class:"auth-btn"},[n.value?(h(),m("i",ee)):y("",!0),p(" "+a(n.value?t(s)==="bn"?"লগইন হচ্ছে...":"Signing in...":t(s)==="bn"?"লগইন করুন":"Sign In"),1)],8,Z),e("div",se,[e("p",null,[p(a(t(s)==="bn"?"অ্যাকাউন্ট নেই?":"Don't have an account?")+" ",1),r(L,{to:"/register"},{default:H(()=>[p(a(t(s)==="bn"?"রেজিস্টার করুন":"Register"),1)]),_:1})])])],32)])])]),r(S)])}}},_e=G(oe,[["__scopeId","data-v-6e3ba152"]]);export{_e as default};
