{"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 let LoginComponent = /*#__PURE__*/(() => {\n 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: 21,\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\"], [\"type\", \"password\", \"name\", \"Password\", \"required\", \"\", 1, \"form-control\", 3, \"ngModelChange\", \"ngModel\"], [1, \"mb-3\", \"form-check\"], [\"type\", \"checkbox\", \"id\", \"check\", 1, \"form-check-input\"], [\"for\", \"check\", 1, \"form-check-label\"], [\"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, \"input\", 10);\n i0.ɵɵtwoWayListener(\"ngModelChange\", function LoginComponent_Template_input_ngModelChange_13_listener($event) {\n i0.ɵɵtwoWayBindingSet(ctx.password, $event) || (ctx.password = $event);\n return $event;\n });\n i0.ɵɵelementEnd()();\n i0.ɵɵelementStart(14, \"div\", 11);\n i0.ɵɵelement(15, \"input\", 12);\n i0.ɵɵelementStart(16, \"label\", 13);\n i0.ɵɵtext(17, \"\\u00DCberpr\\u00FCfen Sie mich\");\n i0.ɵɵelementEnd()();\n i0.ɵɵelementStart(18, \"button\", 14);\n i0.ɵɵelement(19, \"span\", 15);\n i0.ɵɵtext(20, \"Anmeldung\");\n i0.ɵɵelementEnd()()()()()()();\n }\n if (rf & 2) {\n i0.ɵɵadvance(9);\n i0.ɵɵtwoWayProperty(\"ngModel\", ctx.username);\n i0.ɵɵadvance(4);\n i0.ɵɵtwoWayProperty(\"ngModel\", ctx.password);\n i0.ɵɵadvance(6);\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 });\n }\n return LoginComponent;\n})();","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}