{"ast":null,"code":"import Swal from 'sweetalert2';\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"../services/authentication.service\";\nimport * as i2 from \"@angular/forms\";\nexport class LoginComponent {\n constructor(authService, data) {\n this.authService = authService;\n this.data = data;\n this.username = '';\n this.password = '';\n this.waitRes = false;\n this.afterLogin = () => {};\n //localStorage.getItem('theme') === 'dark'\n if (typeof this.afterLogin == typeof data.afterLogin) this.afterLogin = data.afterLogin;\n }\n login() {\n this.waitRes = true;\n this.authService.login(this.username, this.password).subscribe({\n next: () => this.afterLogin(),\n error: err => {\n this.waitRes = false;\n Swal.fire({\n icon: \"error\",\n title: \"Oops...\",\n text: err.error.messages.join(\"\\n\")\n });\n },\n complete: () => this.waitRes = false\n });\n }\n static #_ = this.ɵfac = function LoginComponent_Factory(t) {\n return new (t || LoginComponent)(i0.ɵɵdirectiveInject(i1.AuthenticationService), i0.ɵɵdirectiveInject(MAT_DIALOG_DATA));\n };\n static #_2 = this.ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n type: LoginComponent,\n selectors: [[\"app-login\"]],\n inputs: {\n afterLogin: \"afterLogin\"\n },\n decls: 19,\n vars: 6,\n consts: [[1, \"container\", \"p-0\", \"m-0\"], [1, \"row\", \"justify-content-center\", \"p-0\", \"m-0\"], [1, \"col\", \"p-0\", \"m-0\"], [1, \"card\", \"px-5\"], [1, \"card-body\", \"mx-5\", \"px-5\"], [3, \"ngSubmit\"], [1, \"mb-3\"], [\"for\", \"username\", 1, \"form-label\"], [\"type\", \"text\", \"name\", \"Username\", \"required\", \"\", 1, \"form-control\", 3, \"ngModelChange\", \"ngModel\"], [\"for\", \"password\", 1, \"form-label\"], [1, \"d-flex\"], [\"type\", \"password\", \"name\", \"Password\", \"required\", \"\", 1, \"form-control\", 3, \"ngModelChange\", \"ngModel\"], [\"id\", \"togglePassword\", 1, \"bi\", \"bi-eye-slash\", \"mt-1\"], [\"type\", \"submit\", 1, \"btn\", \"btn-primary\"], [\"aria-hidden\", \"true\"]],\n template: function LoginComponent_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\", 0)(1, \"div\", 1)(2, \"div\", 2)(3, \"div\", 3)(4, \"div\", 4)(5, \"form\", 5);\n i0.ɵɵlistener(\"ngSubmit\", function LoginComponent_Template_form_ngSubmit_5_listener() {\n return ctx.login();\n });\n i0.ɵɵelementStart(6, \"div\", 6)(7, \"label\", 7);\n i0.ɵɵtext(8, \"Benutzername\");\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(9, \"input\", 8);\n i0.ɵɵtwoWayListener(\"ngModelChange\", function LoginComponent_Template_input_ngModelChange_9_listener($event) {\n i0.ɵɵtwoWayBindingSet(ctx.username, $event) || (ctx.username = $event);\n return $event;\n });\n i0.ɵɵelementEnd()();\n i0.ɵɵelementStart(10, \"div\", 6)(11, \"label\", 9);\n i0.ɵɵtext(12, \"Kennwort\");\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(13, \"div\", 10)(14, \"input\", 11);\n i0.ɵɵtwoWayListener(\"ngModelChange\", function LoginComponent_Template_input_ngModelChange_14_listener($event) {\n i0.ɵɵtwoWayBindingSet(ctx.password, $event) || (ctx.password = $event);\n return $event;\n });\n i0.ɵɵelementEnd();\n i0.ɵɵelement(15, \"i\", 12);\n i0.ɵɵelementEnd()();\n i0.ɵɵelementStart(16, \"button\", 13);\n i0.ɵɵelement(17, \"span\", 14);\n i0.ɵɵtext(18, \"Anmeldung\");\n i0.ɵɵelementEnd()()()()()()();\n }\n if (rf & 2) {\n i0.ɵɵadvance(9);\n i0.ɵɵtwoWayProperty(\"ngModel\", ctx.username);\n i0.ɵɵadvance(5);\n i0.ɵɵtwoWayProperty(\"ngModel\", ctx.password);\n i0.ɵɵadvance(3);\n i0.ɵɵclassProp(\"spinner-border\", ctx.waitRes)(\"spinner-border-sm\", ctx.waitRes);\n }\n },\n dependencies: [i2.ɵNgNoValidate, i2.DefaultValueAccessor, i2.NgControlStatus, i2.NgControlStatusGroup, i2.RequiredValidator, i2.NgModel, i2.NgForm],\n styles: [\"i[_ngcontent-%COMP%] {\\n margin-left: -30px;\\n cursor: pointer;\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxvZ2luLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7SUFDSSxrQkFBa0I7SUFDbEIsZUFBZTtBQUNuQiIsImZpbGUiOiJsb2dpbi5jb21wb25lbnQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiaSB7XHJcbiAgICBtYXJnaW4tbGVmdDogLTMwcHg7XHJcbiAgICBjdXJzb3I6IHBvaW50ZXI7XHJcbn0iXX0= */\\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL3NyYy9hcHAvbG9naW4vbG9naW4uY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtJQUNJLGtCQUFrQjtJQUNsQixlQUFlO0FBQ25CO0FBQ0Esb1ZBQW9WIiwic291cmNlc0NvbnRlbnQiOlsiaSB7XHJcbiAgICBtYXJnaW4tbGVmdDogLTMwcHg7XHJcbiAgICBjdXJzb3I6IHBvaW50ZXI7XHJcbn0iXSwic291cmNlUm9vdCI6IiJ9 */\"]\n });\n}","map":{"version":3,"names":["Swal","MAT_DIALOG_DATA","LoginComponent","constructor","authService","data","username","password","waitRes","afterLogin","login","subscribe","next","error","err","fire","icon","title","text","messages","join","complete","_","i0","ɵɵdirectiveInject","i1","AuthenticationService","_2","selectors","inputs","decls","vars","consts","template","LoginComponent_Template","rf","ctx","ɵɵelementStart","ɵɵlistener","LoginComponent_Template_form_ngSubmit_5_listener","ɵɵtext","ɵɵelementEnd","ɵɵtwoWayListener","LoginComponent_Template_input_ngModelChange_9_listener","$event","ɵɵtwoWayBindingSet","LoginComponent_Template_input_ngModelChange_14_listener","ɵɵelement","ɵɵadvance","ɵɵtwoWayProperty","ɵɵclassProp"],"sources":["E:\\TekH\\Visual Studio\\WebUserManager\\DigitalData.UserManager.NgWebUI\\ClientApp\\src\\app\\login\\login.component.ts","E:\\TekH\\Visual Studio\\WebUserManager\\DigitalData.UserManager.NgWebUI\\ClientApp\\src\\app\\login\\login.component.html"],"sourcesContent":["import { Component, Inject, Input, OnInit } from '@angular/core';\r\nimport { AuthenticationService } from '../services/authentication.service';\r\nimport Swal from 'sweetalert2';\r\nimport { Router } from '@angular/router';\r\nimport { MAT_DIALOG_DATA } from '@angular/material/dialog';\r\n\r\n@Component({\r\n selector: 'app-login',\r\n templateUrl: './login.component.html',\r\n styleUrl: './login.component.css'\r\n})\r\nexport class LoginComponent {\r\n\r\n username: string = '';\r\n password: string = '';\r\n\r\n waitRes:boolean = false;\r\n\r\n constructor(private authService: AuthenticationService, @Inject(MAT_DIALOG_DATA) public data: any) {\r\n //localStorage.getItem('theme') === 'dark'\r\n if(typeof(this.afterLogin) == typeof(data.afterLogin))\r\n this.afterLogin = data.afterLogin;\r\n }\r\n\r\n @Input() afterLogin: () => void = () => { }\r\n\r\n login(): void {\r\n this.waitRes = true;\r\n this.authService.login(this.username, this.password).subscribe({\r\n next: () => this.afterLogin(),\r\n error: (err) => {\r\n this.waitRes = false;\r\n Swal.fire({\r\n icon: \"error\",\r\n title: \"Oops...\",\r\n text: err.error.messages.join(\"\\n\"),\r\n });\r\n },\r\n complete: () => this.waitRes = false\r\n })\r\n }\r\n}\r\n","