-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path585.613976c59fd11ef1.js
1 lines (1 loc) · 9.4 KB
/
585.613976c59fd11ef1.js
1
"use strict";(self.webpackChunkangular_SIMAt=self.webpackChunkangular_SIMAt||[]).push([[585],{5585:(q,_,s)=>{s.r(_),s.d(_,{LoginModule:()=>P});var g=s(9808),T=s(8077),p=s(6696),d=s(1777),t=s(5e3),w=s(1135);let m=(()=>{class r{constructor(){this.ToggleSubject=new w.X(!1)}back(){this.ToggleSubject.next(!1)}register(){this.ToggleSubject.next(!0)}get toggle(){return this.ToggleSubject.value}}return r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=t.Yz7({token:r,factory:r.\u0275fac}),r})();var Z=s(5861),i=s(3075);class b{constructor(a={}){this.username=a.username||"",this.password=a.password||""}}var u=s(7793),y=s(704),f=s(72),l=s(7322),h=s(7531),v=s(7423),C=s(5245);function k(r,a){1&r&&(t.TgZ(0,"mat-error"),t._uU(1,"Password minimal 8 karakter"),t.qZA())}let x=(()=>{class r{constructor(e,n,o,c,N,Y,R){this._state=e,this._fb=n,this._loginService=o,this._alertService=c,this._router=N,this._route=Y,this.spinner=R,this.hide=!0,this.loading=!1,this.form=this._fb.group(new b),this.addValidators()}addValidators(){this.f.username.addValidators([i.kI.required]),this.f.password.addValidators([i.kI.required,i.kI.minLength(8)])}get f(){return this.form.controls}register(){this._state.register()}login(){var e=this;return(0,Z.Z)(function*(){var n;if(!e.form.invalid&&!e.loading)try{const o=e.form.getRawValue();if("alvin"!==o.username.toLowerCase()&&"putra"!==o.username.toLowerCase()&&"demo"!==o.username.toLowerCase())return void e._alertService.alert("warning","Warning",'Silahkan akses <a href="https://mobile-presensi.ypsimlibrary.com">https://mobile-presensi.ypsimlibrary.com</a>!');e.spinner.show(),e.loading=!0,(yield e._loginService.login(o))&&e._router.navigate(["/app/home"],{relativeTo:e._route})}catch(o){console.error(o),e._alertService.alert("error","Error",null!==(n=null==o?void 0:o.Message)&&void 0!==n?n:JSON.stringify(o,null,2))}finally{e.loading=!1,e.spinner.hide()}})()}ngOnInit(){}}return r.\u0275fac=function(e){return new(e||r)(t.Y36(m),t.Y36(i.qu),t.Y36(u.r),t.Y36(y.c),t.Y36(p.F0),t.Y36(p.gz),t.Y36(f.t2))},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-login-card"]],decls:35,vars:7,consts:[["bdColor","rgba(0, 0, 0, 0.8)","size","medium","color","#fff","type","ball-clip-rotate",3,"fullScreen"],[2,"color","white"],[1,"card"],[1,"card-body"],[3,"formGroup"],[1,"row"],[1,"col-12","text-center","mb-3"],["src","assets/images/logo-ypsim.jpeg","width","130",1,"img-fluid"],[1,"col-12","text-center"],[1,"app-title"],[1,"col-12"],["appearance","standard"],["matInput","","formControlName","username","type","text","name","username","id","username"],["matInput","","formControlName","password","name","password","id","password",3,"type"],[4,"ngIf"],["mat-icon-button","","matSuffix","",3,"click"],[1,"col-12","text-end","mb-2"],["href","#"],[1,"col-12","mb-3"],["mat-raised-button","","color","success",1,"w-100",3,"click"],["mat-raised-button","","color","grey",1,"w-100",3,"click"]],template:function(e,n){1&e&&(t.TgZ(0,"ngx-spinner",0)(1,"p",1),t._uU(2,"Loading..."),t.qZA()(),t.TgZ(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6),t._UZ(8,"img",7),t.qZA(),t.TgZ(9,"div",8)(10,"p",9),t._uU(11,"SIMAt"),t.qZA()(),t.TgZ(12,"div",10)(13,"mat-form-field",11)(14,"mat-label"),t._uU(15,"Username"),t.qZA(),t._UZ(16,"input",12),t.qZA()(),t.TgZ(17,"div",10)(18,"mat-form-field",11)(19,"mat-label"),t._uU(20,"Password"),t.qZA(),t._UZ(21,"input",13),t.YNc(22,k,2,0,"mat-error",14),t.TgZ(23,"button",15),t.NdJ("click",function(){return n.hide=!n.hide}),t.TgZ(24,"mat-icon"),t._uU(25),t.qZA()()()(),t.TgZ(26,"div",16)(27,"a",17),t._uU(28,"Lupa kata sandi?"),t.qZA()(),t.TgZ(29,"div",18)(30,"button",19),t.NdJ("click",function(){return n.login()}),t._uU(31," Masuk "),t.qZA()(),t.TgZ(32,"div",10)(33,"button",20),t.NdJ("click",function(){return n.register()}),t._uU(34," Daftar "),t.qZA()()()()()()),2&e&&(t.Q6J("fullScreen",!0),t.xp6(5),t.Q6J("formGroup",n.form),t.xp6(16),t.Q6J("type",n.hide?"password":"text"),t.xp6(1),t.Q6J("ngIf",n.f.password.errors&&n.f.password.errors.minlength),t.xp6(1),t.uIk("aria-label","Hide password")("aria-pressed",n.hide),t.xp6(2),t.Oqu(n.hide?"visibility_off":"visibility"))},directives:[f.Ro,i._Y,i.JL,i.sg,l.KE,l.hX,h.Nt,i.Fj,i.JJ,i.u,g.O5,l.TO,v.lW,l.R9,C.Hw],styles:[".card[_ngcontent-%COMP%]{border-radius:12px;max-height:calc(100vh - 3rem);box-shadow:0 4px 4px #00000048}.card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{padding-left:1.5rem;padding-right:1.5rem;overflow:auto}.card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .app-title[_ngcontent-%COMP%]{font-weight:700;font-size:22px;letter-spacing:4px}.card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .col-12[_ngcontent-%COMP%] > mat-form-field[_ngcontent-%COMP%]{width:100%}"]}),r})();class M extends b{constructor(a={}){super(a),this.nik=a.nik||""}}function O(r,a){1&r&&(t.TgZ(0,"mat-error"),t._uU(1," Password minimal 8 karakter "),t.qZA())}let S=(()=>{class r{constructor(e,n,o,c){this._state=e,this._fb=n,this._alertService=o,this._loginService=c,this.hide=!0,this.loading=!1,this.form=this._fb.group(new M),this.addValidators()}addValidators(){this.f.nik.addValidators([i.kI.required]),this.f.username.addValidators([i.kI.required]),this.f.password.addValidators([i.kI.required,i.kI.minLength(8)])}get f(){return this.form.controls}back(){this._state.back()}register(){var e=this;return(0,Z.Z)(function*(){var n;if(!e.form.invalid&&!e.loading)try{e.loading=!0;const o=e.form.getRawValue();yield e._loginService.register(o),e._alertService.alert("success","Behasil","Registrasi berhasil")}catch(o){e._alertService.alert("error","Error",null!==(n=o.Message)&&void 0!==n?n:JSON.stringify(o,null,2))}finally{e.loading=!1}})()}ngOnInit(){}}return r.\u0275fac=function(e){return new(e||r)(t.Y36(m),t.Y36(i.qu),t.Y36(y.c),t.Y36(u.r))},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-register-card"]],decls:34,vars:6,consts:[[1,"card"],[1,"card-body"],[3,"formGroup"],[1,"row"],[1,"col-12","text-center","mb-3"],["src","assets/images/logo-ypsim.jpeg","width","130",1,"img-fluid"],[1,"col-12","text-center","mb-2"],[1,"app-title"],[1,"col-12"],["appearance","standard"],["matInput","","formControlName","nik","type","text","name","nik","id","nik"],["matInput","","formControlName","username","type","text","name","username","id","username"],["matInput","","formControlName","password","name","password","id","password",3,"type"],[4,"ngIf"],["mat-icon-button","","matSuffix","",3,"click"],[1,"col-12","mb-3"],["mat-raised-button","","color","success",1,"w-100",3,"click"],["mat-raised-button","","color","grey",1,"w-100",3,"click"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"form",2)(3,"div",3)(4,"div",4),t._UZ(5,"img",5),t.qZA(),t.TgZ(6,"div",6)(7,"p",7),t._uU(8,"SIMAt"),t.qZA()(),t.TgZ(9,"div",8)(10,"mat-form-field",9)(11,"mat-label"),t._uU(12,"NIK"),t.qZA(),t._UZ(13,"input",10),t.qZA()(),t.TgZ(14,"div",8)(15,"mat-form-field",9)(16,"mat-label"),t._uU(17,"Username"),t.qZA(),t._UZ(18,"input",11),t.qZA()(),t.TgZ(19,"div",8)(20,"mat-form-field",9)(21,"mat-label"),t._uU(22,"Password"),t.qZA(),t._UZ(23,"input",12),t.YNc(24,O,2,0,"mat-error",13),t.TgZ(25,"button",14),t.NdJ("click",function(){return n.hide=!n.hide}),t.TgZ(26,"mat-icon"),t._uU(27),t.qZA()()()(),t.TgZ(28,"div",15)(29,"button",16),t.NdJ("click",function(){return n.register()}),t._uU(30," Daftar "),t.qZA()(),t.TgZ(31,"div",8)(32,"button",17),t.NdJ("click",function(){return n.back()}),t._uU(33," Kembali "),t.qZA()()()()()()),2&e&&(t.xp6(2),t.Q6J("formGroup",n.form),t.xp6(21),t.Q6J("type",n.hide?"password":"text"),t.xp6(1),t.Q6J("ngIf",n.f.password.errors&&n.f.password.errors.minlength),t.xp6(1),t.uIk("aria-label","Hide password")("aria-pressed",n.hide),t.xp6(2),t.Oqu(n.hide?"visibility_off":"visibility"))},directives:[i._Y,i.JL,i.sg,l.KE,l.hX,h.Nt,i.Fj,i.JJ,i.u,g.O5,l.TO,v.lW,l.R9,C.Hw],styles:[".card[_ngcontent-%COMP%]{border-radius:12px;max-height:calc(100vh - 3rem);box-shadow:0 4px 4px #00000048}.card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{padding-left:1.5rem;padding-right:1.5rem;overflow:auto}.card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .app-title[_ngcontent-%COMP%]{font-weight:700;font-size:22px;letter-spacing:4px}.card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .col-12[_ngcontent-%COMP%] > mat-form-field[_ngcontent-%COMP%]{width:100%}"]}),r})();function A(r,a){1&r&&t._UZ(0,"app-login-card")}function I(r,a){1&r&&t._UZ(0,"app-register-card")}let U=(()=>{class r{constructor(e){this._state=e,this.hide=!0}get toggle(){return this._state.toggle}ngOnInit(){}}return r.\u0275fac=function(e){return new(e||r)(t.Y36(m))},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-login"]],decls:6,vars:4,consts:[[1,"wrapper"],[1,"container","container-xxl","py-4","px-4"],[4,"ngIf"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div"),t.YNc(3,A,1,0,"app-login-card",2),t.qZA(),t.TgZ(4,"div"),t.YNc(5,I,1,0,"app-register-card",2),t.qZA()()()),2&e&&(t.xp6(2),t.Q6J("@animate",void 0),t.xp6(1),t.Q6J("ngIf",!n.toggle),t.xp6(1),t.Q6J("@animate",void 0),t.xp6(1),t.Q6J("ngIf",n.toggle))},directives:[g.O5,x,S],styles:[".wrapper[_ngcontent-%COMP%]{height:100vh;display:flex;align-items:center;max-height:100vh;background-image:linear-gradient(#E0DC35,#29972B)}"],data:{animation:[(0,d.X$)("animate",[(0,d.eR)(":enter",[(0,d.oB)({})]),(0,d.eR)(":leave",[(0,d.oB)({})])])]}}),r})();const J=[{path:"",canActivate:[s(8042).i],component:U}];let P=(()=>{class r{}return r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=t.oAB({type:r}),r.\u0275inj=t.cJS({providers:[m,u.r],imports:[[g.ez,T.IJ,i.u5,i.UX,f.ef,l.lN,h.c,C.Ps,v.ot,p.Bz.forChild(J)]]}),r})()}}]);