import{_ as M,r as l,o as I,b as r,c as d,d as s,q as c,H as P,z as m,C as L,v as w,F as _,s as g,I as B,t as f,f as N,L as V,J as A,K as D,M as U,N as j}from"./main.84523976.js";import{u as F}from"./use-meta.97669149.js";const H={class:"form full-form auth-cover"},O={class:"form-container"},S={class:"form-form"},T={class:"form-form-wrap"},z={class:"form-container"},E={class:"form-content"},G={class:"auth-brand mb-4 text-center"},q=["src","alt"],J={class:"form"},K={id:"username-field",class:"field-wrapper input"},R={class:"invalid-feedback"},Y={id:"password-field",class:"field-wrapper input mb-2"},Q=["type"],W={class:"invalid-feedback"},X={class:"terms-conditions"},Z={__name:"login",setup($){F({title:"Iniciar sesi\xF3n"});const h=A,k=D,y=U,u=l("password"),i=l({email:null,password:null}),x=l(null),p=l(!1),o=l({}),n=l(!1),b=()=>{u.value=u.value==="password"?"text":"password"},C=async()=>{p.value=!0,n.value=!0;try{const a=await j(i.value);if(!a.success)return o.value=a.error;o.value={email:null,password:null},localStorage.setItem("token",a.token),window.location.href=window.location.origin+window.location.pathname+"?nocache="+Date.now()}catch(a){console.log(a)}finally{n.value=!1}};return I(()=>{n.value=!1}),(a,e)=>(r(),d("div",H,[s("div",O,[s("div",S,[s("div",T,[s("div",z,[s("div",E,[s("div",G,[s("img",{src:c(k),alt:c(h),class:"auth-brand-logo"},null,8,q)]),e[10]||(e[10]=s("h1",{class:""}," Iniciar sesi\xF3n ",-1)),s("form",{novalidate:"",class:"text-start",ref_key:"formComponent",ref:x,onSubmit:P(C,["stop","prevent"])},[s("div",J,[s("div",K,[e[3]||(e[3]=s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-user"},[s("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),s("circle",{cx:"12",cy:"7",r:"4"})],-1)),m(s("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>i.value.email=t),type:"text",class:w([p.value?o.value.email?"is-invalid":"is-valid":""]),placeholder:"Usuario"},null,2),[[L,i.value.email]]),e[4]||(e[4]=s("div",{class:"valid-feedback"},null,-1)),s("div",R,[(r(!0),d(_,null,g(o.value.email,(t,v)=>(r(),d("li",{key:v},f(t),1))),128))])]),s("div",Y,[e[5]||(e[5]=s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-lock"},[s("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),s("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})],-1)),m(s("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>i.value.password=t),type:u.value,class:w([p.value?o.value.password?"is-invalid":"is-valid":""]),placeholder:"Contrase\xF1a"},null,10,Q),[[B,i.value.password]]),e[6]||(e[6]=s("div",{class:"valid-feedback"},null,-1)),s("div",W,[(r(!0),d(_,null,g(o.value.password,(t,v)=>(r(),d("li",{key:v},f(t),1))),128))])]),s("div",{class:"d-sm-flex justify-content-between"},[s("div",{class:"field-wrapper toggle-pass d-flex align-items-center"},[e[8]||(e[8]=s("p",{class:"d-inline-block"},"Mostrar contrase\xF1a",-1)),s("label",{class:"switch s-primary mx-2"},[s("input",{onClick:b,type:"checkbox",class:"custom-control-input",checked:""}),e[7]||(e[7]=s("span",{class:"slider round"},null,-1))])]),e[9]||(e[9]=s("div",{class:"field-wrapper"},[s("button",{type:"submit",class:"btn btn-primary"},"Iniciar sesi\xF3n")],-1))])])],544),s("p",X,f(c(y)),1)])])])]),e[11]||(e[11]=s("div",{class:"form-image"},[s("div",{class:"l-image"})],-1))]),N(c(V),{active:n.value,"onUpdate:active":e[2]||(e[2]=t=>n.value=t),"can-cancel":!1,"is-full-page":!0},null,8,["active"])]))}},ts=M(Z,[["__scopeId","data-v-19fc682d"]]);export{ts as default};
