1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ea4f30a3-467b-582e-800e-938bb0b68e28")}catch(e){}}(); 3import{b as le}from"./chunk-CK42FIAO.js";import{a as de}from"./chunk-67ZL44O5.js";import{a as oe}from"./chunk-FVWVPSNZ.js";import{a as re}from"./chunk-64QJVREX.js";import{a as se,b as ae}from"./chunk-JEZTBI4E.js";import{a as ie,d as ne}from"./chunk-FJ4ZOLGT.js";import{A as Y,B as Z,C as ee,c as k,e as u,f as z,g as O,i as J,m as K,s as Q,t as X}from"./chunk-R5XMVSYY.js";import{b as te}from"./chunk-K5Q7KIV2.js";import"./chunk-F4I7SJ6J.js";import"./chunk-DKLXHHLQ.js";import{$a as n,Aa as i,Ab as w,Ad as $,Cd as H,Dd as L,Ed as W,Ga as f,Hb as R,Ia as B,Ja as D,M as b,Ma as M,Qc as U,R as _,Sc as A,Ta as a,Va as d,Vc as G,Y as I,Yc as v,_a as p,ab as l,bb as c,ca as F,da as y,i as E,ib as S,kb as P,mb as r,mc as j,sc as V,wc as q,yb as h}from"./chunk-SBKZPI4X.js";function we(t,m){if(t&1&&c(0,"cmp-alert",2),t&2){let e=r();p("alertType","info")("message",e.sen["forgotten-password-mail-sent"])}}function ge(t,m){if(t&1&&c(0,"cmp-alert",2),t&2){let e=r();p("alertType","success")("message",e.sen["forgotten-password-password-changed"])}}function _e(t,m){if(t&1&&c(0,"cmp-alert",2),t&2){let e=r();p("alertType","error")("message",e.sen["forgotten-errors-occured"])}}function ve(t,m){if(t&1&&c(0,"cmp-alert",2),t&2){let e=r();p("alertType","error")("message",e.sen["app-captcha-failed"])}}function Ce(t,m){if(t&1&&c(0,"cmp-alert",2),t&2){let e=r(3);p("alertType","info")("message",e.sen["forgotten-password-allready-used-info"])}}function xe(t,m){if(t&1&&c(0,"cmp-val-msg",11),t&2){let e=r(3);p("msg",e.sen["subs-newsletter-unsubscribe-email-not-valid"])}}function be(t,m){if(t&1&&(n(0,"div",5),a(1,Ce,1,2,"cmp-alert",2),n(2,"label",7),h(3),l(),n(4,"div",8),c(5,"input",9),n(6,"div",10),a(7,xe,1,1,"cmp-val-msg",11),l()()()),t&2){let e=r(2);i(),d(e.hashIsNotValid?1:-1),i(2),w(" ",e.sen["forgotten-errors-user-name"]," "),i(2),p("placeholder",R(e.sen["forgotten-errors-user-name"])),i(2),d(e.fpForm.get("userName").touched&&e.fpForm.get("userName").invalid?7:-1)}}function Fe(t,m){if(t&1&&(n(0,"div",10),c(1,"cmp-val-msg",11),l()),t&2){let e=r(3);i(),p("msg",e.passwordSvc.passwordPolicyMessage(e.fpForm.controls.newPassword.value))}}function ye(t,m){if(t&1&&(n(0,"div",5)(1,"label",12),h(2),l(),n(3,"div",8),c(4,"input",13),a(5,Fe,2,1,"div",10),l()()),t&2){let e=r(2);i(2),w(" ",e.sen["forgotten-errors-new-password"]," "),i(3),d(e.fpForm.controls.newPassword.touched&&e.fpForm.controls.newPassword.invalid?5:-1)}}function Se(t,m){if(t&1&&(n(0,"div",10),c(1,"cmp-val-msg",11),l()),t&2){let e=r(3);i(),p("msg",e.sen["change-pwd-invalid-confirm"])}}function Pe(t,m){if(t&1){let e=S();n(0,"div",5)(1,"label",14),h(2),l(),n(3,"div",8)(4,"input",15),P("blur",function(){F(e);let s=r(2);return y(s.onPasswordVerifyBlured())}),l(),a(5,Se,2,1,"div",10),l()()}if(t&2){let e=r(2);i(2),w(" ",e.sen["forgotten-errors-new-password-verify"]," "),i(3),d(e.passwordVerifyBlured&&e.fpForm.controls.newPassword.touched&&e.fpForm.controls.newPassword.value!==e.fpForm.controls.newPasswordVerify.value?5:-1)}}function Ve(t,m){if(t&1){let e=S();n(0,"form",4),P("ngSubmit",function(){F(e);let s=r();return y(s.executeCaptcha())}),a(1,be,8,5,"div",5),a(2,ye,6,2,"div",5),a(3,Pe,6,2,"div",5),n(4,"div",5)(5,"button",6),h(6),l()()()}if(t&2){let e=r();p("formGroup",e.fpForm),i(),d(e.hashValidated?-1:1),i(),d(e.hashValidated?2:-1),i(),d(e.hashValidated?3:-1),i(2),p("disabled",e.isSubmitButtonDisabled),i(),w(" ",e.sen["forgotten-errors-send"]," ")}}var N=(()=>{class t extends W{constructor(e,o,s,g,C,x,pe,me){super(e,o),this.dataSvc=e,this.seSvc=o,this.router=s,this.fb=g,this.http=C,this.route=x,this.fcSvc=pe,this.passwordSvc=me,this.fpForm=new J({}),this.mailSent=!1,this.hashValidated=!1,this.passwordSuccessfullyChanged=!1,this.thereWereErrors=!1,this.captchaFailed=!1,this.displayForm=!0,this.ngUnsubscribe=new E,this.passwordVerifyBlured=!1,this.hashIsNotValid=!1,this.isSubmitButtonDisabled=!1,this.userLoggedIn&&this.router.navigateByUrl("").then(()=>{}
3),this.mailPat=this.seSvc.settings.validationPatterns.email,this.fpForm=this.fb.group({userName:[""],newPassword:[""],newPasswordVerify:[""]});let T=this.sen["forgotten-password-title"],ce=`${this.seSvc.settings.shopSeo.ShopName} - ${T}`,fe={displayName:T,targetSeoTail:""};this.dataSvc.setBc([fe],ce);let ue=this.route.snapshot.url.length>0;this.setProperValidation(ue)}executeCaptcha(){if(this.passwordVerifyBlured=!0,this.fpForm.invalid){this.fpForm.markAllAsTouched(),re.scrollToFirstInvalid(null);return}this.isSubmitButtonDisabled=!0,this.fcSvc.executeCaptcha("forgotten_pwd","forgotten-password.component.onCaptchaExecuted").subscribe({next:e=>{this.captchaFailed=!e.success,this.sendRequest(e.secret)},error:()=>{this.isSubmitButtonDisabled=!1}})}sendRequest(e){this.dataSvc.dataLoading=!0,this.isSubmitButtonDisabled=!0,this.hashValidated===!0?this.sendChangePassword(e):this.sendGenerateHashRequest(e)}sendChangePassword(e){let o=this.fpForm.get("newPassword"),s=this.fpForm.get("newPasswordVerify");if(!o?.valid||!s?.valid){this.isSubmitButtonDisabled=!1;return}let g={userName:null,password:o.value,hash:this.hash},C=new V({"Captcha-Secret":e});this.http.post(`api/${v}/forgotten-password/change-password`,g,{headers:C}).pipe(_(this.ngUnsubscribe),b(()=>{this.dataSvc.dataLoading=!1,this.isSubmitButtonDisabled=!1})).subscribe(x=>{this.displayForm=!1,x===!0?this.passwordSuccessfullyChanged=!0:(this.passwordSuccessfullyChanged=!1,this.thereWereErrors=!0)})}sendGenerateHashRequest(e){let o=this.fpForm.get("userName");if(!o?.valid){this.isSubmitButtonDisabled=!1;return}let s={userName:o.value},g=new V({"Captcha-Secret":e});this.http.post(`api/${v}/forgotten-password/request`,s,{headers:g}).pipe(_(this.ngUnsubscribe),b(()=>{this.dataSvc.dataLoading=!1,this.isSubmitButtonDisabled=!1})).subscribe({next:()=>{this.displayForm=!1,this.mailSent=!0},error:()=>{this.displayForm=!1,this.mailSent=!0}})}ngOnInit(){this.dataSvc.setFbMetaTags(this.dataSvc.domain+"/zapomenute-heslo",this.sen["login-forgot-password"],null),this.dataSvc.setTitle(`${this.seSvc.settings.shopSeo.ShopName} - ${this.sen["login-forgot-password"]}`,this.sen["frgpwd-description"]),this.route.url.pipe(_(this.ngUnsubscribe)).subscribe(e=>{e[0]&&(this.hash=e[0].path,this.http.get(`api/${v}/forgotten-password/validate/${this.hash}`).pipe(_(this.ngUnsubscribe)).subscribe(o=>{o===!0?this.hashValidated=!0:(this.hashValidated=!1,this.hash=null,this.hashIsNotValid=!0,this.fpForm.get("userName")?.setValidators([u.required,u.pattern(this.mailPat)]),this.fpForm.get("userName")?.updateValueAndValidity(),this.fpForm.get("newPassword")?.setValidators(null),this.fpForm.get("newPassword")?.updateValueAndValidity(),this.fpForm.get("newPasswordVerify")?.setValidators(null),this.fpForm.get("newPasswordVerify")?.updateValueAndValidity())}))})}setProperValidation(e){e?(this.fpForm.get("userName")?.setValidators(null),this.fpForm.get("newPassword")?.setValidators([u.required,u.pattern(new RegExp(this.seSvc.passwordRegExpPattern))]),this.fpForm.get("newPasswordVerify")?.setValidators([u.required,u.pattern(new RegExp(this.seSvc.passwordRegExpPattern))])):(this.fpForm.get("newPassword")?.setValidators(null),this.fpForm.get("newPasswordVerify")?.setValidators(null),this.fpForm.get("userName")?.setValidators([u.required,u.pattern(this.mailPat)]))}ngOnDestroy(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()}isButtonDisabled(){return this.hashIsNotValid?this.fpForm.controls.userName.pristine||this.fpForm.controls.userName.invalid:this.fpForm.invalid}onPasswordVerifyBlured(){this.passwordVerifyBlured=!0}static{this.\u0275fac=function(o){return new(o||t)(f(L),f(H),f(A),f(Y),f(q),f(U),f(te),f($))}}static{this.\u0275cmp=B({type:t,selectors:[["ng-component"]],standalone:!1,features:[M],decls:8,vars:6,consts:[[1,"forgotten-password"],[1,"forgotten-password__title","h1"],[3,"alertType","message"],["action","#","name","fpForm",1,"forgotten-password__form",3,"formGroup"],["action","#","name","fpForm",1,"forgotten-password__form",3,"ngSubmit","formGroup"],[1,"forgotten-password__row"],["type","submit",1,"btn","btn--medium","btn--primary",3,"disabled"],["for","userName",1,"form-label","sr-only"],[1,"forgotten-password__value"],["type","text","id","userName","formControlName","userName",1,"form-input",3,"placeholder"],[1,"validation"],[3,"msg"],["for","newPassword",1,"form-label"],["password-eye-svg","","type","password","id","newPassword","formControlName","newPassword",1,"form-input"],["for","newPasswordVerify",1,"form-label"],["password-eye-svg","","type","password","id","newPasswordVerify","formControlName","newPasswordVerify",1,"form-input",3,"blur"]],template:function(o,s){o&1&&(n(0,"div",0)(1,"h1",1),h(2),l(
3),a(3,we,1,2,"cmp-alert",2),a(4,ge,1,2,"cmp-alert",2),a(5,_e,1,2,"cmp-alert",2),a(6,ve,1,2,"cmp-alert",2),a(7,Ve,7,6,"form",3),l()),o&2&&(i(2),w(" ",s.sen["forgotten-password-title"]," "),i(),d(s.mailSent?3:-1),i(),d(s.passwordSuccessfullyChanged?4:-1),i(),d(s.thereWereErrors?5:-1),i(),d(s.captchaFailed?6:-1),i(),d(s.displayForm?7:-1))},dependencies:[K,k,z,O,X,Q,ie,se,oe],styles:[`.forgotten-password__title{margin-bottom:20px}@media screen and (min-width:768px){.forgotten-password__title{margin-bottom:32px}}.forgotten-password__row{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:12px}.forgotten-password__row:last-child{margin-bottom:0}@media screen and (max-width:479.98px){.forgotten-password__row button{width:100%}}.forgotten-password__value{position:relative;width:100%}@media screen and (min-width:480px){.forgotten-password__value{max-width:400px}} 4`],encapsulation:2})}}return t})();var et=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=D({type:t})}static{this.\u0275inj=I({imports:[j,Z,ee,G.forChild([{path:"",component:N},{path:":hash",component:N}]),ne,ae,le,de]})}}return t})();export{et as ForgottenPasswordModule}; 5 6//# debugId=ea4f30a3-467b-582e-800e-938bb0b68e28
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.