{"ast":null,"code":"import { FormGroup, FormControl, Validators } from '@angular/forms';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"src/app/shared/services/authentication.service\";\nimport * as i2 from \"@angular/common\";\nimport * as i3 from \"@angular/router\";\nimport * as i4 from \"@angular/material/card\";\nimport * as i5 from \"@angular/material/input\";\nimport * as i6 from \"@angular/material/form-field\";\nimport * as i7 from \"@angular/material/button\";\nimport * as i8 from \"@angular/forms\";\nconst _c0 = () => [\"/authentication/login\"];\nfunction ForgotPasswordComponent_div_10_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\")(1, \"mat-error\");\n    i0.ɵɵtext(2);\n    i0.ɵɵelementEnd()();\n  }\n  if (rf & 2) {\n    const ctx_r0 = i0.ɵɵnextContext();\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(ctx_r0.errorMessage);\n  }\n}\nfunction ForgotPasswordComponent_div_11_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\")(1, \"mat-card\");\n    i0.ɵɵtext(2);\n    i0.ɵɵelementEnd()();\n  }\n  if (rf & 2) {\n    const ctx_r0 = i0.ɵɵnextContext();\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(ctx_r0.successMessage);\n  }\n}\nfunction ForgotPasswordComponent_mat_error_19_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"mat-error\");\n    i0.ɵɵtext(1, \"Email Gerekli\");\n    i0.ɵɵelementEnd();\n  }\n}\nexport class ForgotPasswordComponent {\n  constructor(_authService) {\n    this._authService = _authService;\n    this.validateControl = controlName => {\n      return this.forgotPasswordForm.get(controlName).invalid && this.forgotPasswordForm.get(controlName).touched;\n    };\n    this.hasError = (controlName, errorName) => {\n      return this.forgotPasswordForm.get(controlName).hasError(errorName);\n    };\n    this.forgotPassword = forgotPasswordFormValue => {\n      this.showError = this.showSuccess = false;\n      const forgotPass = {\n        ...forgotPasswordFormValue\n      };\n      const forgotPassDto = {\n        email: forgotPass.email,\n        clientURI: 'http://localhost:4200/authentication/resetpassword'\n      };\n      this._authService.forgotPassword('api/accounts/forgotpassword', forgotPassDto).subscribe({\n        next: _ => {\n          this.showSuccess = true;\n          this.successMessage = 'The link has been sent, please check your email to reset your password.';\n        },\n        error: err => {\n          this.showError = true;\n          this.errorMessage = err.message;\n        }\n      });\n    };\n  }\n  ngOnInit() {\n    this.forgotPasswordForm = new FormGroup({\n      email: new FormControl(\"\", [Validators.required])\n    });\n  }\n  static #_ = this.ɵfac = function ForgotPasswordComponent_Factory(t) {\n    return new (t || ForgotPasswordComponent)(i0.ɵɵdirectiveInject(i1.AuthenticationService));\n  };\n  static #_2 = this.ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n    type: ForgotPasswordComponent,\n    selectors: [[\"app-forgot-password\"]],\n    decls: 26,\n    vars: 7,\n    consts: [[1, \"blank-layout-container\", \"justify-content-center\", \"align-items-center\", \"bg-light-primary\"], [1, \"position-relative\", \"row\", \"w-100\", \"h-100\", \"bg-gredient\", \"justify-content-center\"], [1, \"col-lg-4\", \"d-flex\", \"align-items-center\"], [1, \"cardWithShadow\", \"boxed-auth\"], [1, \"p-32\"], [1, \"text-center\"], [\"src\", \"../../../../assets/images/logos/matech-logo.svg\", \"alt\", \"logo\", 1, \"align-middle\", \"m-2\"], [4, \"ngIf\"], [\"autocomplete\", \"off\", \"novalidate\", \"\", 1, \"m-t-30\", 3, \"ngSubmit\", \"formGroup\"], [1, \"mat-body-1\"], [\"appearance\", \"outline\", \"color\", \"primary\", 1, \"w-100\"], [\"matInput\", \"\", \"placeholder\", \"Email address\", \"type\", \"email\", \"id\", \"email\", \"formControlName\", \"email\", 1, \"form-control\"], [1, \"d-flex\", \"align-items-center\", \"m-b-12\"], [\"mat-flat-button\", \"\", \"color\", \"warn\", 1, \"m-t-8\", 3, \"routerLink\"], [1, \"flex-1-auto\"], [\"mat-flat-button\", \"\", \"color\", \"primary\", \"type\", \"submit\", 1, \"m-t-8\", 3, \"disabled\"]],\n    template: function ForgotPasswordComponent_Template(rf, ctx) {\n      if (rf & 1) {\n        i0.ɵɵelementStart(0, \"div\", 0)(1, \"div\", 1)(2, \"div\", 2)(3, \"mat-card\", 3)(4, \"mat-card-content\", 4)(5, \"div\", 5)(6, \"a\");\n        i0.ɵɵelement(7, \"img\", 6);\n        i0.ɵɵelementEnd()();\n        i0.ɵɵelementStart(8, \"mat-card-title\");\n        i0.ɵɵtext(9, \"Parolan\\u0131z\\u0131 m\\u0131 unuttunuz?\");\n        i0.ɵɵelementEnd();\n        i0.ɵɵtemplate(10, ForgotPasswordComponent_div_10_Template, 3, 1, \"div\", 7)(11, ForgotPasswordComponent_div_11_Template, 3, 1, \"div\", 7);\n        i0.ɵɵelementStart(12, \"form\", 8);\n        i0.ɵɵlistener(\"ngSubmit\", function ForgotPasswordComponent_Template_form_ngSubmit_12_listener() {\n          return ctx.forgotPassword(ctx.forgotPasswordForm.value);\n        });\n        i0.ɵɵelementStart(13, \"span\", 9);\n        i0.ɵɵtext(14, \" Yaz\\u0131l\\u0131m Ekibine Ula\\u015F\\u0131n\\u0131z \");\n        i0.ɵɵelementEnd();\n        i0.ɵɵelement(15, \"br\")(16, \"br\");\n        i0.ɵɵelementStart(17, \"mat-form-field\", 10);\n        i0.ɵɵelement(18, \"input\", 11);\n        i0.ɵɵtemplate(19, ForgotPasswordComponent_mat_error_19_Template, 2, 0, \"mat-error\", 7);\n        i0.ɵɵelementEnd();\n        i0.ɵɵelementStart(20, \"div\", 12)(21, \"button\", 13);\n        i0.ɵɵtext(22, \" Giri\\u015Fe D\\u00F6n \");\n        i0.ɵɵelementEnd();\n        i0.ɵɵelement(23, \"span\", 14);\n        i0.ɵɵelementStart(24, \"button\", 15);\n        i0.ɵɵtext(25, \" G\\u00F6nder \");\n        i0.ɵɵelementEnd()()()()()()()();\n      }\n      if (rf & 2) {\n        i0.ɵɵadvance(10);\n        i0.ɵɵproperty(\"ngIf\", ctx.showError);\n        i0.ɵɵadvance();\n        i0.ɵɵproperty(\"ngIf\", ctx.showSuccess);\n        i0.ɵɵadvance();\n        i0.ɵɵproperty(\"formGroup\", ctx.forgotPasswordForm);\n        i0.ɵɵadvance(7);\n        i0.ɵɵproperty(\"ngIf\", ctx.validateControl(\"email\") && ctx.hasError(\"email\", \"required\"));\n        i0.ɵɵadvance(2);\n        i0.ɵɵproperty(\"routerLink\", i0.ɵɵpureFunction0(6, _c0));\n        i0.ɵɵadvance(3);\n        i0.ɵɵproperty(\"disabled\", !ctx.forgotPasswordForm.valid);\n      }\n    },\n    dependencies: [i2.NgIf, i3.RouterLink, i4.MatCard, i4.MatCardContent, i4.MatCardTitle, i5.MatInput, i6.MatFormField, i6.MatError, i7.MatButton, i8.ɵNgNoValidate, i8.DefaultValueAccessor, i8.NgControlStatus, i8.NgControlStatusGroup, i8.FormGroupDirective, i8.FormControlName],\n    encapsulation: 2\n  });\n}","map":{"version":3,"names":["FormGroup","FormControl","Validators","i0","ɵɵelementStart","ɵɵtext","ɵɵelementEnd","ɵɵadvance","ɵɵtextInterpolate","ctx_r0","errorMessage","successMessage","ForgotPasswordComponent","constructor","_authService","validateControl","controlName","forgotPasswordForm","get","invalid","touched","hasError","errorName","forgotPassword","forgotPasswordFormValue","showError","showSuccess","forgotPass","forgotPassDto","email","clientURI","subscribe","next","_","error","err","message","ngOnInit","required","ɵɵdirectiveInject","i1","AuthenticationService","_2","selectors","decls","vars","consts","template","ForgotPasswordComponent_Template","rf","ctx","ɵɵelement","ɵɵtemplate","ForgotPasswordComponent_div_10_Template","ForgotPasswordComponent_div_11_Template","ɵɵlistener","ForgotPasswordComponent_Template_form_ngSubmit_12_listener","value","ForgotPasswordComponent_mat_error_19_Template","ɵɵproperty","ɵɵpureFunction0","_c0","valid"],"sources":["C:\\Users\\Cem\\Desktop\\InventryUI-Client\\src\\app\\pages\\authentication\\forgot-password\\forgot-password.component.ts","C:\\Users\\Cem\\Desktop\\InventryUI-Client\\src\\app\\pages\\authentication\\forgot-password\\forgot-password.component.html"],"sourcesContent":["import { HttpErrorResponse } from '@angular/common/http';\nimport { Component, OnInit } from '@angular/core';\nimport { FormGroup, FormControl, Validators } from '@angular/forms';\nimport { ForgotPasswordDto } from 'src/app/_interface/resetPassword/forgotPasswordDto.model';\nimport { AuthenticationService } from 'src/app/shared/services/authentication.service';\n\n\n\n@Component({\n  selector: 'app-forgot-password',\n  templateUrl: './forgot-password.component.html',\n})\nexport class ForgotPasswordComponent implements OnInit {\n  forgotPasswordForm: FormGroup |any ;\n  successMessage: string;\n  errorMessage: string;\n  showSuccess: boolean;\n  showError: boolean;\n  \n  constructor(private _authService: AuthenticationService) { }\n  \n  ngOnInit(): void {\n    this.forgotPasswordForm = new FormGroup({\n      email: new FormControl(\"\", [Validators.required])\n    })\n  }\n\n  public validateControl = (controlName: string) => {\n    return this.forgotPasswordForm.get(controlName).invalid && this.forgotPasswordForm.get(controlName).touched\n  }\n\n  public hasError = (controlName: string, errorName: string) => {\n    return this.forgotPasswordForm.get(controlName).hasError(errorName)\n  }\n\n  public forgotPassword = (forgotPasswordFormValue:any) => {\n    this.showError = this.showSuccess = false;\n    const forgotPass = { ...forgotPasswordFormValue };\n\n    const forgotPassDto: ForgotPasswordDto = {\n      email: forgotPass.email,\n      clientURI: 'http://localhost:4200/authentication/resetpassword'\n    }\n\n    this._authService.forgotPassword('api/accounts/forgotpassword', forgotPassDto)\n    .subscribe({\n      next: (_) => {\n      this.showSuccess = true;\n      this.successMessage = 'The link has been sent, please check your email to reset your password.'\n    },\n    error: (err: HttpErrorResponse) => {\n      this.showError = true;\n      this.errorMessage = err.message;\n    }})\n  }\n}\n","<div class=\"blank-layout-container justify-content-center align-items-center bg-light-primary\">\n  <div class=\"position-relative row w-100 h-100 bg-gredient justify-content-center\">\n    <div class=\"col-lg-4 d-flex align-items-center\">\n      <mat-card class=\"cardWithShadow boxed-auth\">\n        <mat-card-content class=\"p-32\">\n          <div class=\"text-center\">\n            <a>\n              <img src=\"../../../../assets/images/logos/matech-logo.svg\" class=\"align-middle m-2\" alt=\"logo\" />\n            </a>\n          </div>\n\n          <mat-card-title>Parolanızı mı unuttunuz?</mat-card-title>\n\n          <div *ngIf=\"showError\" >\n           <mat-error>{{errorMessage}}</mat-error>\n        </div>\n        <div *ngIf=\"showSuccess\" >\n         <mat-card>{{successMessage}}</mat-card>\n        </div>\n          <form class=\"m-t-30\" [formGroup]=\"forgotPasswordForm\" autocomplete=\"off\" novalidate\n            (ngSubmit)=\"forgotPassword(forgotPasswordForm.value)\">\n            <span class=\"mat-body-1\">  Yazılım Ekibine Ulaşınız <!--Şifrenizi sıfırlamak için e-postanıza bir şifre sıfırlama bağlantısı gönderilecektir.\n              Birkaç dakika içinde bir e-posta almazsanız lütfen tekrar deneyin. (Daha yapmadık şifre olayını smtp ayarları yapılacak) -->\n            </span>\n            <br>\n            <br>\n\n            <mat-form-field appearance=\"outline\" class=\"w-100\" color=\"primary\">\n              <input matInput placeholder=\"Email address\" type=\"email\" id=\"email\" formControlName=\"email\" class=\"form-control\" />\n                <mat-error *ngIf=\"validateControl('email') && hasError('email', 'required')\">Email Gerekli</mat-error>\n            </mat-form-field>\n\n            <div class=\"d-flex align-items-center m-b-12\">\n              <button mat-flat-button color=\"warn\" class=\"m-t-8\" [routerLink]=\"['/authentication/login']\">\n                Girişe Dön\n              </button>\n              <span class=\"flex-1-auto\"></span>\n              <button mat-flat-button color=\"primary\" class=\"m-t-8\" type=\"submit\"\n                [disabled]=\"!forgotPasswordForm.valid\">\n                Gönder\n              </button>\n            </div>\n\n          </form>\n        </mat-card-content>\n      </mat-card>\n    </div>\n  </div>\n</div>\n"],"mappings":"AAEA,SAASA,SAAS,EAAEC,WAAW,EAAEC,UAAU,QAAQ,gBAAgB;;;;;;;;;;;;;ICYxDC,EADD,CAAAC,cAAA,UAAwB,gBACZ;IAAAD,EAAA,CAAAE,MAAA,GAAgB;IAC9BF,EAD8B,CAAAG,YAAA,EAAY,EACpC;;;;IADQH,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