1import{a as U}from"./chunk-G4TCXE4E.js";import"./chunk-3SYLZGSD.js";import"./chunk-DPOKHT3A.js";import"./chunk-7TB2E64H.js";import"./chunk-WB524PON.js";import"./chunk-7UZYWCAJ.js";import"./chunk-36JN3LZY.js";import{a as K}from"./chunk-PWHNHOFW.js";import{a as A}from"./chunk-Y5TQRJR4.js";import{A as j,C as z,d as v,f as T,g as D,l as G,p as q,q as V}from"./chunk-2VR4MFCE.js";import{a as N}from"./chunk-Q3P7MYRM.js";import{c as L}from"./chunk-BHDDJKHL.js";import{c as O}from"./chunk-UH53EACN.js";import{g as E}from"./chunk-AYN3TFFZ.js";import"./chunk-FH6NJCWA.js";import"./chunk-NH7CJJXB.js";import"./chunk-F6HGKLF6.js";import{i as I,k as B}from"./chunk-PXHED5G5.js";import"./chunk-FPPZ4BUR.js";import{Dc as x,Ic as s,Jc as a,Ob as p,Pb as d,Qb as n,Rb as b,_a as o,bc as R,dc as _,ea as w,kb as S,pa as k,pb as M,rc as c,tc as m,vb as u}from"./chunk-HP7ADE6B.js";import{a as y,b as C,g as J,h as F}from"./chunk-WWX6BADO.js";var h=J(K());var Y=t=>({"ng-invalid ng-dirty":t});function Q(t,r){t&1&&(d(0,"span"),c(1),s(2,"translate"),n()),t&2&&(o(),m(" ",a(2,1,"changePassword.errors.newPasswordRequired")," "))}function W(t,r){t&1&&(d(0,"span"),c(1),s(2,"translate"),n()),t&2&&(o(),m(" ",a(2,1,"changePassword.errors.newPasswordMinLength")," "))}function X(t,r){if(t&1&&(d(0,"div",16),u(1,Q,3,3,"span",17)(2,W,3,3,"span",17),n()),t&2){let i,e,l=_();o(),p("ngIf",(i=l.passwordForm.get("newPassword"))==null||i.errors==null?null:i.errors.required),o(),p("ngIf",(e=l.passwordForm.get("newPassword"))==null||e.errors==null?null:e.errors.minlength)}}function Z(t,r){t&1&&(d(0,"span"),c(1),s(2,"translate"),n()),t&2&&(o(),m(" ",a(2,1,"changePassword.errors.confirmPasswordRequired")," "))}function $(t,r){t&1&&(d(0,"span"),c(1),s(2,"translate"),n()),t&2&&(o(),m(" ",a(2,1,"changePassword.errors.passwordMismatch")," "))}function ee(t,r){if(t&1&&(d(0,"div",16),u(1,Z,3,3,"span",17)(2,$,3,3,"span",17),n()),t&2){let i,e,l=_();o(),p("ngIf",(i=l.passwordForm.get("confirmPassword"))==null||i.errors==null?null:i.errors.required),o(),p("ngIf",(e=l.passwordForm.get("confirmPassword"))==null||e.errors==null?null:e.errors.mismatch)}}var H=class t{constructor(r){this.fb=r;this.passwordForm=this.fb.group({newPassword:["",[v.required,v.minLength(8)]],confirmPassword:["",[v.required]]},{validators:this.passwordMatchValidator})}passwordForm;bookingService=w(L);router=w(E);backend=w(A);destroyRef=w(k);passwordMatchValidator(r){let i=r.get("newPassword")?.value,e=r.get("confirmPassword")?.value;return i!==e?(r.get("confirmPassword")?.setErrors({mismatch:!0}),{mismatch:!0}):null}onSubmit(){return F(this,null,function*(){if(this.passwordForm.valid){let r=this.bookingService.getConfig("forgotPasswordDetails");r||(yield this.router.navigate(["/login"]));let i=C(y({},this.passwordForm.value),{phone:r.phone,country_code:r.country_code,sourcetype:"web"});this.backend.resetPassword(i).pipe(N(this.destroyRef)).subscribe({next:e=>{e.isSuccess==!0?(h.default.fire({icon:"success",title:"Reset success password",text:"Your password has been reset",timer:3e3,width:"350px",customClass:{popup:"tiny-swal",icon:"tiny-icon"}}),this.router.navigate(["/login"]),this.bookingService.setConfig("forgotPasswordDetails",{})):h.default.fire({icon:"error",title:"Verification",text:e.msg,timer:3e3,width:"350px",customClass:{popup:"tiny-swal",icon:"tiny-icon"}})},error:e=>{h.default.fire({icon:"error",title:"Verification",text:"Reset Failed",timer:3e3,width:"350px",customClass:{popup:"tiny-swal",icon:"tiny-icon"}})}})}else Object.keys(this.passwordForm.controls).forEach(r=>{this.passwordForm.get(r)?.markAsTouched()})})}static \u0275fac=function(i){return new(i||t)(S(j))};static \u0275cmp=M({type:t,selectors:[["app-reset-password"]],decls:32,vars:38,consts:[[1,"app-container"],[1,"row","container"],[1,"col-12"],[1,"background-color","shadow-sm","p-4","rounded-3"],[1,"fw-semibold","fs-4"],[3,"ngSubmit","formGroup"],[1,"row","align-items-end","gy-3","gy-lg-0"],[1,"col-12","col-md-6","col-lg-4"],[1,"d-flex","flex-column"],["for","newPassword",1,"form-label"],["inputId","newPassword","formControlName","newPassword","inputStyleClass","w-100 form-control",3,"feedback","toggleMask","promptLabel","weakLabel","mediumLabel","strongLabel","placeholder","ngClass"],["class","invali
1d-feedback d-block",4,"ngIf"],["for","confirmPassword",1,"form-label"],["inputId","confirmPassword","formControlName","confirmPassword","inputStyleClass","w-100 form-control",3,"feedback","toggleMask","placeholder","ngClass"],[1,"col-12","col-md-12","col-lg-4","d-flex","align-items-end"],["type","submit",1,"btn","btn-primary","rounded-pill","w-100","w-lg-auto",3,"disabled"],[1,"invalid-feedback","d-block"],[4,"ngIf"]],template:function(i,e){if(i&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div")(5,"p",4),c(6,"Reset Password"),n()(),d(7,"form",5),R("ngSubmit",function(){return e.onSubmit()}),d(8,"div",6)(9,"div",7)(10,"div",8)(11,"label",9),c(12),s(13,"translate"),n(),b(14,"p-password",10),s(15,"translate"),s(16,"translate"),s(17,"translate"),s(18,"translate"),s(19,"translate"),u(20,X,3,2,"div",11),n()(),d(21,"div",7)(22,"div",8)(23,"label",12),c(24),s(25,"translate"),n(),b(26,"p-password",13),s(27,"translate"),u(28,ee,3,2,"div",11),n()(),d(29,"div",14)(30,"button",15),c(31," Reset Password "),n()()()()()()()()),i&2){let l,g,f,P;o(7),p("formGroup",e.passwordForm),o(5),m(" ",a(13,18,"changePassword.labels.newPassword"),": "),o(2),p("feedback",!0)("toggleMask",!0)("promptLabel",a(15,20,"changePassword.prompts.enterPassword"))("weakLabel",a(16,22,"changePassword.prompts.weak"))("mediumLabel",a(17,24,"changePassword.prompts.medium"))("strongLabel",a(18,26,"changePassword.prompts.strong"))("placeholder",a(19,28,"changePassword.placeholders.newPassword"))("ngClass",x(34,Y,((l=e.passwordForm.get("newPassword"))==null?null:l.invalid)&&((l=e.passwordForm.get("newPassword"))==null?null:l.touched))),o(6),p("ngIf",((g=e.passwordForm.get("newPassword"))==null?null:g.invalid)&&((g=e.passwordForm.get("newPassword"))==null?null:g.touched)),o(4),m(" ",a(25,30,"changePassword.labels.confirmPassword"),": "),o(2),p("feedback",!1)("toggleMask",!0)("placeholder",a(27,32,"changePassword.placeholders.confirmPassword"))("ngClass",x(36,Y,((f=e.passwordForm.get("confirmPassword"))==null?null:f.invalid)&&((f=e.passwordForm.get("confirmPassword"))==null?null:f.touched))
1),o(2),p("ngIf",((P=e.passwordForm.get("confirmPassword"))==null?null:P.invalid)&&((P=e.passwordForm.get("confirmPassword"))==null?null:P.touched)),o(2),p("disabled",e.passwordForm.invalid)}},dependencies:[B,U,z,G,T,D,q,V,I,O],styles:[".app-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center}.change-password-container[_ngcontent-%COMP%]{max-width:600px;background-color:#efefef;border-radius:6px;padding:1rem}.change-password-container[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:.375rem;padding:.75rem;box-shadow:5px 5px 10px -5px #cdcdcd inset;-webkit-box-shadow:5px 5px 10px -5px #cdcdcd inset;-moz-box-shadow:5px 5px 10px -5px #cdcdcd inset}.change-password-container[_ngcontent-%COMP%] .form-label[_ngcontent-%COMP%]{font-weight:500;margin-bottom:.5rem;color:#333}.change-password-container[_ngcontent-%COMP%] .btn-danger[_ngcontent-%COMP%]{padding:.6rem 0;font-weight:500}@media (max-width: 768px){.change-password-container[_ngcontent-%COMP%]{padding:1.5rem}}.background-color[_ngcontent-%COMP%]{background:#fff}.btn-primary[_ngcontent-%COMP%]{background:linear-gradient(45deg,var(--primary-color-500),var(--primary-color-400));color:var(--primary-color-100);border:1px solid var(--primary-color-500)}@media (min-width: 992px){.w-lg-auto[_ngcontent-%COMP%]{width:auto!important}}"]})};export{H as ResetPassword};
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.