1import{h as L,r as $,f,K as _,n as a,L as i,$ as s,a1 as l,a0 as o,aa as E,F as k,a7 as q,u as d,M as C}from"./vue-datepicker-CpIdsRIT.js";import{_ as h}from"./CardContainer.vue_vue_type_script_setup_true_lang-BKfUFWAw.js";import{V as F,r as w,e as R}from"./VForm-DE7HWpqe.js";import{u as N,a as S,b as B,o as M,V,e as U,x as j,y as P}from"./index-o4dhNVJj.js";import{r as T}from"./ResolveErrorCode-uRcKEtjn.js";import{V as y}from"./VTextField-DmCcBAfM.js";import{V as I}from"./VCheckbox-nrSLyQgk.js";import"./datefns-BAflKSlV.js";import"./VCheckboxBtn-gsiJdvrK.js";const O={class:"flex flex-col gap-3 mt-8"},D={class:"text-2xl"},H={class:"font-bold"},K={class:"flex justify-between items-center"},z={class:"flex flex-col justify-items-end"},G={class:"text-center"},se=L({__name:"Login",setup(J){const u=M(),b=N(),{notifyError:v}=S(),{t:A}=B(),r=$({email:u.currentRoute.value?.query?.email??"",password:""}),p=f(!1),c=f(!1),g=f(!1),x=async()=>{c.value=!0;try{await b.signIn(r.email,r.password),await u.push({name:"cockpit"})}catch(e){const t=P(e)?e?.response?.data?.code:null;v(A(T(e,"Auth.Login.genericError"))),t==="NewPasswordRequiredException"&&await u.push({name:"confirm-password",query:{email:r.email}}),(t==="PasswordResetRequiredException"||t==="TemporaryPasswordExpiredException")&&await u.push({name:"forgot-password",query:{email:r.email}})}c.value=!1};return(e,t)=>{const m=E("router-link");return C(),_(k,null,[a(h,{class:"min-w-64 flex items-center justify-between mt-12","padding-class":"p-1"},{default:s(()=>[a(V,{color:"secondary",style:{"background-image":"linear-gradient(45deg,#d73625,#F78361)!important"},class:"grow w-1/2"},{default:s(()=>[l(o(e.$t("Auth.Login.title")),1)]),_:1}),a(m,{to:{name:"register"},class:"grow w-1/2 text-center"},{default:s(()=>[l(o(e.$t("Auth.Register.title")),1)]),_:1})]),_:1}),i("div",O,[i("span",D,[i("span",H,o(e.$t("Auth.Login.greeting")),1),l(" "+o(e.$t("Auth.Login.heading")),1)]),a(h,{class:"flex flex-col gap-3 p-6 sm:w-[60dvw]"},{default:s(()=>[i("span",null,o(e.$t("Auth.Login.prompt")),1),a(F,{modelValue:p.value,"onUpdate:modelValue":t[3]||(t[3]=n=>p.value=n),class:"flex flex-col gap-3",onSubmit:q(x,["prevent"])},{default:s(()=>[a(y,{modelValue:r.email,"onUpdate:modelValue":t[0]||(t[0]=n=>r.email=n),label:e.$t("Auth.Login.email"),type:"email",color:"secondary","prepend-inner-icon":d(U),rules:[d(w),d(R)],variant:"outlined","hide-details":"auto",required:""},null,8,["modelValue","label","prepend-inner-icon","rules"]),a(y,{modelValue:r.password,"onUpdate:modelValue":t[1]||(t[1]=n=>r.password=n),label:e.$t("Auth.Login.password"),type:"password",color:"secondary","prepend-inner-icon":d(j),rules:[d(w)],variant:"outlined","hide-details":"auto",required:""},null,8,["modelValue","label","prepend-inner-icon","rules"]),i("div",K,[a(I,{modelValue:g.value,"onUpdate:modelValue":t[2]||(t[2]=n=>g.value=n),label:e.$t("Auth.Login.rememberMe"),color:"secondary","hide-details":"auto"},null,8,["modelValue","label"]),i("div",z,[a(m,{to:{name:"forgot-password"},class:"text-info cursor-pointer underline place-self-end"},{default:s(()=>[l(o(e.$t("Auth.Login.recoverAccount")),1)]),_:1}),a(m,{to:{name:"reset-password"},class:"text-info cursor-pointer underline place-self-end"},{default:s(()=>[l(o(e.$t("Auth.Login.resetCode")),1)]),_:1})])]),a(V,{loading:c.value,disabled:!p.value,type:"submit",color:"secondary",height:"46",style:{"background-image":"linear-gradient(45deg,#d73625,#F78361)!important"}},{default:s(()=>[l(o(e.$t("Auth.Login.title")),1)]),_:1},8,["loading","disabled"])]),_:1},8,["modelValue"])]),_:1}),i("span",G,[l(o(e.$t("Auth.Login.newHere"))+" ",1),a(m,{to:{name:"register"},class:"text-info underline"},{default:s(()=>[l(o(e.$t("Auth.Login.createAccount")),1)]),_:1})])])],64)}}});export{se 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.