birzha-legalizasia-frontend/dist/assets/Main.b35cf473.js

2 lines
3.8 KiB
JavaScript

import{_ as D,K as S,q as f,J as u,N as V,D as C,v as R,r as P,e as n,f as e,g as h,t as a,O as w,P as y,h as o,n as b,F as I,i as $,j as p,ae as G,l as k,E as L,M as N,a as M,k as B,c as l}from"./index.4724a157.js";import{c as _,r as A,e as F,m as q,u as K}from"./index.esm.744b7350.js";import{L as U}from"./Main.5b8e18c2.js";import{_ as j}from"./Main.427f9a13.js";import{_ as Q}from"./Main.e714db76.js";const W={class:"container"},z={class:"block xl:grid grid-cols-2 gap-4"},H={class:"h-screen xl:h-auto md:flex py-5 xl:py-0 my-10 xl:my-0"},J={class:"md:hidden mb-6"},X={class:"text-center text-white text-lg ml-3"},Y={class:"my-auto mx-auto xl:ml-20 bg-white dark:bg-darkmode-600 xl:bg-transparent px-5 sm:px-8 py-8 xl:p-0 rounded-md shadow-md xl:shadow-none w-full sm:w-3/4 lg:w-2/4 xl:w-auto"},Z={class:"flex items-center justify-between"},ee={class:"intro-x font-bold text-2xl xl:text-3xl text-center xl:text-left"},te={class:"intro-x mt-2 text-slate-400 xl:hidden text-center"},se={class:"intro-x mt-8"},oe=["placeholder"],ae=["placeholder","onKeyup"],re={class:"intro-x flex text-slate-600 dark:text-slate-500 text-xs sm:text-sm mt-4"},le={class:"intro-x mt-5 xl:mt-8 text-center xl:text-left"},ne=["onClick"],ie=["onClick"],de={__name:"Main",setup(me){const i=S({email:"",password:""}),d=f(!1),m=f(!1),E={email:{required:_.withMessage(u.global.t("REQUIRED_VALIDATION"),A),email:_.withMessage(u.global.t("EMAIL_VALIDATION"),F)},password:{required:_.withMessage(u.global.t("REQUIRED_VALIDATION"),A),minLength:_.withMessage(u.global.t("MIN_LENGTH_VALIDATION",{min:8}),q(8))}},t=K(E,V(i)),v=async()=>{if(d.value)return;const s=M();t.value.$touch(),!t.value.$invalid&&(d.value=!0,await s.login(i.email,i.password),d.value=!1)},O=async()=>{if(m.value||(t.value.email.$touch(),t.value.email.$invalid))return;m.value=!0,await M().forgotPassword(i.email),m.value=!1},T=()=>B.push({path:"/register"});return C(()=>{R("body").removeClass("main").removeClass("error-page").addClass("login")}),(s,c)=>{const g=P("LoadingIcon");return l(),n("div",null,[e("div",W,[e("div",z,[h(j),e("div",H,[e("div",J,[e("a",null,[h(U,{class:"mx-auto mb-2"}),e("div",X,a(s.$t("APP_TITLE")),1)])]),e("div",Y,[e("div",Z,[e("h2",ee,a(s.$t("SIGN_IN")),1),h(Q)]),e("div",te,a(s.$t("SING_IN_MOTIVATION_MOBILE")),1),e("div",se,[w(e("input",{type:"text","onUpdate:modelValue":c[0]||(c[0]=r=>o(t).email.$model=r),class:b(["intro-x login__input form-control py-3 px-4 block mt-4",{"border-danger":o(t).email.$error}]),placeholder:s.$t("EMAIL")},null,10,oe),[[y,o(t).email.$model,void 0,{trim:!0}]]),o(t).email.$error?(l(!0),n(I,{key:0},$(o(t).email.$errors,(r,x)=>(l(),n("div",{key:x,class:"text-danger mt-2"},a(r.$message),1))),128)):p("",!0),w(e("input",{type:"password","onUpdate:modelValue":c[1]||(c[1]=r=>o(t).password.$model=r),class:b(["intro-x login__input form-control py-3 px-4 block mt-4",{"border-danger":o(t).password.$error}]),placeholder:s.$t("PASSWORD"),onKeyup:G(v,["enter"])},null,42,ae),[[y,o(t).password.$model,void 0,{trim:!0}]]),o(t).password.$error?(l(!0),n(I,{key:1},$(o(t).password.$errors,(r,x)=>(l(),n("div",{key:x,class:"text-danger mt-2"},a(r.$message),1))),128)):p("",!0)]),e("div",re,[e("a",{type:"button",class:"flex items-center ml-auto cursor-pointer",onClick:O},[k(a(s.$t("FORGOT_PASSWORD"))+" ",1),m.value?(l(),L(g,{key:0,icon:"oval",class:"w-4 h-4 ml-2 primary"})):p("",!0)])]),e("div",le,[e("button",{class:"btn btn-primary py-3 px-4 w-full xl:w-32 xl:mr-3 align-top custom-btns",onClick:N(v,["prevent"])},[k(a(s.$t("LOGIN"))+" ",1),d.value?(l(),L(g,{key:0,icon:"oval",color:"white",class:"w-4 h-4 ml-2"})):p("",!0)],8,ne),e("button",{class:"btn btn-outline-secondary py-3 px-4 w-full mt-3 xl:mt-0 align-top xl:w-auto custom-btns",onClick:N(T,["prevent"])},a(s.$t("REGISTER")),9,ie)])])])])])])}}};var he=D(de,[["__scopeId","data-v-ba851574"]]);export{he as default};