PageSourceSearch

https://app.allimpexo.com/assets/ChangePassword-CvXofl_g.js

js allimpexo.com collected 2026-10-02 01:22:15 UTC 6,246 bytes, 1 lines download raw bytes

1var m=Object.defineProperty;var u=(n,r,e)=>r in n?m(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e;var t=(n,r,e)=>u(n,typeof r!="symbol"?r+"":r,e);import{$ as f,r as x,w as P,v as o,U as c,y as S,j as s,S as p,bb as g,F as d,cU as h,cV as w,b1 as C}from"./index-DP1EdfVr.js";/* empty css             */class j extends x.Component{constructor(){super(...arguments);t(this,"state",{loggedInUser:localStorage.getItem("loggedInUserId"),oldPassword:"",password:"",passwordConfirmation:"",validationMessage:0,submitSpinner:!1,logoutSpinner:!1,showOldPassword:!1,showNewPassword:!1,showNewPasswordConfirm:!1});t(this,"handlePasswordChange",e=>{const{name:a,value:i}=e.target;a==="password"&&this.setState({[a]:i},()=>{new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})").test(this.state.password)?this.setState({validationMessage:1}):this.setState({validationMessage:0})}),this.setState({[a]:i})});t(this,"handlePasswordConfirmationChange",e=>{const{name:a,value:i}=e.target;this.setState({[a]:i},()=>{new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})").test(this.state.passwordConfirmation)?this.setState({validationMessage:1}):this.setState({validationMessage:0})})});t(this,"handleSubmit",()=>{if(this.state.password!==""&&this.state.oldPassword)this.setState({submitSpinner:!0},function(){const e={oldPassword:this.state.oldPassword,user_id:this.state.loggedInUser,password:this.state.password,password_confirmation:this.state.passwordConfirmation};this.state.validationMessage===1?e.password===e.password_confirmation?P(c.changePassword,e,a=>{if(a.data.success)this.setState({oldPassword:"",password:"",passwordConfirmation:""}),this.setState({submitSpinner:!1}),o("Success",a.data.message,"success").then(i=>{if(i){const l=localStorage.getItem("currentAppVersion");localStorage.clear(),l&&localStorage.setItem("currentAppVersion",l),window.location.href="/login"}});else{this.setState({submitSpinner:!1}),o("Error","Your request was unsuccessful. Please try again later.","error");return}},a=>{this.setState({submitSpinner:!1,oldPassword:"",password:"",passwordConfirmation:""}),o("error",a.response.data.message,"error")}):(this.setState({submitSpinner:!1}),o("Warning","Password and Password Confirmation didn't match!","warning")):(this.setState({submitSpinner:!1}),o("Warning","The password requirement was not fulfilled.","warning"))});else{o("Error","Enter valid password. Password cannot be empty.","error");return}});t(this,"handleLogout",()=>{this.setState({logoutSpinner:!0},()=>{S(c.logoutUrl,e=>{if(e.data.success){const a=localStorage.getItem("currentAppVersion");localStorage.clear(),a&&localStorage.setItem("currentAppVersion",a),window.location.href="/login"}else this.setState({logoutSpinner:!1}),o("Error","sorry couldn't logout","error")},e=>{this.setState({logoutSpinner:!1}),o("Error","sorry couldn't logout","error")})})});t(this,"handleToggleOldPassword",()=>{this.setState(e=>({showOldPassword:!e.showOldPassword}))});t(this,"handleToggleNewPassword",()=>{this.setState(e=>({showNewPassword:!e.showNewPassword}))});t(this,"handleToggleNewPasswordConfirm",()=>{this.setState(e=>({showNewPasswordConfirm:!e.showNewPasswordConfirm}))})}render(){return s.jsx("div",{className:"h-100 pt-5",children:s.jsxs("div",{className:"container",children:[this.state.submitSpinner?s.jsxs("div",{className:"fullWindow-Spinner",children:[s.jsx("div",{children:s.jsx(p,{color:"primary",children:""})}),s.jsx("div",{style:{fontSize:"16px",marginTop:"15px"},children:"Please Wait. Updating Password ..."})]}
1):null,s.jsxs("div",{style:{padding:"20px 5px 0px 5px"},children:[s.jsx("div",{className:"d-flex justify-content-end",children:s.jsx(g,{handleClick:this.handleLogout,buttonTitle:this.state.logoutSpinner?s.jsx(p,{color:"primary",size:"sm",children:""}):"Logout"})}),s.jsx("h4",{className:"text-center rateQueryTitle",children:"Change Password"}),s.jsxs("form",{children:[s.jsxs("div",{className:"form-group mb-3 password-input-wrapper",children:[s.jsx("label",{children:"Old Password:"}),s.jsx("input",{type:this.state.showOldPassword?"text":"password",placeholder:"Enter a old password",className:"form-control inputColor",name:"oldPassword",value:this.state.oldPassword,onChange:this.handlePasswordChange,autoFocus:!0}),s.jsx("span",{className:"password-toggle-reset",onClick:this.handleToggleOldPassword,children:s.jsx(d,{icon:this.state.showOldPassword?h:w,size:"lg"})})]}),s.jsxs("div",{className:"form-group mb-0 password-input-wrapper",children:[s.jsx("label",{children:"New Password:"}),s.jsx("input",{type:this.state.showNewPassword?"text":"password",placeholder:"Enter a new password",className:"form-control inputColor",name:"password",value:this.state.password,onChange:this.handlePasswordChange,autoFocus:!0}),s.jsx("span",{className:"password-toggle-reset",onClick:this.handleToggleNewPassword,children:s.jsx(d,{icon:this.state.showNewPassword?h:w,size:"lg"})})]}),this.state.validationMessage===0?s.jsxs("div",{className:"pass-error-warning",children:[s.jsx("strong",{children:"Password must contain:"}),s.jsx("br",{}),"- at least 1 lowercase alphabetical character",s.jsx("br",{}),"- at least 1 uppercase alphabetical character",s.jsx("br",{}),"- must contain at least 1 numeric character",s.jsx("br",{}),"- eight characters or longer"]}):null,s.jsxs("div",{className:"form-group mt-3 password-input-wrapper",children:[s.jsx("label",{children:"New Password Confirmation:"}),s.jsx("input",{type:this.state.showNewPasswordConfirm?"text":"password",placeholder:"Enter Password Confirmation",className:"form-control inputColor",name:"passwordConfirmation",value:this.state.passwordConfirmation,onChange:this.handlePasswordConfirmationChange}),s.jsx("span",{className:"password-toggle-reset",onClick:this.handleToggleNewPasswordConfirm,children:s.jsx(d,{icon:this.state.showNewPasswordConfirm?h:w,size:"lg"})})]}),this.state.password!==null&&this.state.passwordConfirmation!==null&&this.state.password!==this.state.passwordConfirmation?s.jsx("div",{className:"pass-error-warning",children:s.jsx("strong",{children:"Password is not same"})}):null]}),s.jsx(C,{children:s.jsx(g,{handleClick:this.handleSubmit,buttonTitle:"Change",className:"float-right"})})]})]})})}}const y=f(j);export{y as default};

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.