2 lines
3.1 KiB
JavaScript
2 lines
3.1 KiB
JavaScript
import{S as e,i as t,a as s,b as n,k as o,s as i,e as a,c as u,n as l,d as r,f as c,l as m,g as d,r as p,m as h,o as f,j as g}from"./index-6e99513e.js";import*as b from"../../../../../../../../../js/libraries/authTools.js";function w(e){let t,s,o,i,h,f,g,b,w,y,x,I,k,v,E,$,j,C,L,T,P,B,G;return{c(){t=a("div"),s=a("h2"),s.textContent="LOG IN",o=u(),i=a("label"),i.textContent="Email ",h=a("span"),f=u(),g=a("input"),b=u(),w=a("div"),y=a("label"),y.textContent="Password ",x=a("span"),I=u(),k=a("input"),v=u(),E=a("button"),E.innerHTML='<object type="image/svg+xml" data="/img/auth/eye_icon.svg" title="eye icon"></object>',$=u(),j=a("div"),C=a("input"),L=a("label"),L.textContent="remember me",T=u(),P=a("button"),P.textContent="Log in",this.c=l,r(s,"class","auth-title"),r(i,"class","auth-label"),r(i,"for","emailInput"),r(h,"id","email-msg"),r(g,"id","emailInput"),r(g,"class","authEmailInput"),r(g,"type","email"),r(y,"class","auth-label"),r(y,"for","passwordInput"),r(x,"id","password-msg"),r(k,"id","passwordInput"),r(k,"class","authPasswordInput"),r(k,"type","password"),r(E,"class","eye-icon"),r(w,"class","password-field"),r(C,"type","checkbox"),r(C,"id","remember-me-checkbox"),r(L,"id","remember-me-label"),r(L,"for","passwordInput"),r(j,"id","remember-me"),r(P,"class","auth-button"),r(t,"id","login-group"),r(t,"class","pane auth-pane")},m(a,u){n(a,t,u),c(t,s),c(t,o),c(t,i),c(t,h),e[9](h),c(t,f),c(t,g),e[10](g),c(t,b),c(t,w),c(w,y),c(w,x),e[11](x),c(w,I),c(w,k),e[12](k),c(w,v),c(w,E),e[13](E),c(t,$),c(t,j),c(j,C),e[15](C),c(j,L),c(t,T),c(t,P),B||(G=[m(E,"click",e[14]),m(P,"click",e[16])],B=!0)},p:l,i:l,o:l,d(s){s&&d(t),e[9](null),e[10](null),e[11](null),e[12](null),e[13](null),e[15](null),B=!1,p(G)}}}function y(e,t,s){let n,o,i,a,u,l,r,c,m,{focused:d=!1}=t,p=h("auth");function w(){if(p.googleInit){google.accounts.id.renderButton(m,{theme:"outline",size:"large"});let e=m.getElementsByTagName("iframe")[0];e.style.height="5rem",e.style.width="5rem"}else setTimeout(w,100)}f((()=>{s(7,c.checked=!0,c),s(2,i={email:n,password:o,remember:c}),s(6,r={email:u,password:l}),p.msgs=r,p.remember=c,p.loginGoogle=m,document.addEventListener("keypress",(function(e){"Enter"==e.code&&d&&b.login(r,i)})),w()}));return e.$$set=e=>{"focused"in e&&s(8,d=e.focused)},[n,o,i,a,u,l,r,c,d,function(e){g[e?"unshift":"push"]((()=>{u=e,s(4,u)}))},function(e){g[e?"unshift":"push"]((()=>{n=e,s(0,n)}))},function(e){g[e?"unshift":"push"]((()=>{l=e,s(5,l)}))},function(e){g[e?"unshift":"push"]((()=>{o=e,s(1,o)}))},function(e){g[e?"unshift":"push"]((()=>{a=e,s(3,a)}))},()=>b.changePasswordVisibility(a),function(e){g[e?"unshift":"push"]((()=>{c=e,s(7,c)}))},()=>b.login(r,i)]}class x extends e{constructor(e){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';@import '/css/auth.css';</style>",t(this,{target:this.shadowRoot,props:s(this.attributes),customElement:!0},y,w,i,{focused:8},null),e&&(e.target&&n(e.target,this,e.anchor),e.props&&(this.$set(e.props),o()))}static get observedAttributes(){return["focused"]}get focused(){return this.$$.ctx[8]}set focused(e){this.$$set({focused:e}),o()}}customElements.define("login-component",x);export{x as default};
|