text: (window.webpackJsonp=window.webpackJsonp||[]).push([[28],{1992:function(e,a,s){"use strict";s.r(a);var t=s(6),r=s(310),o=s(14),n=s(20),l=(s(53),s(172),s(35),s(595),s(33)),c=s.n(l),i=s(7),d=s.n(i),u=s(1108),m=s(84),p=s(0),h=s(1129),w=s(28);function f(e,a,s){return a in e?Object.defineProperty(e,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[a]=s,e}class b extends d.a.PureComponent{constructor(e){super(e),f(this,"handlePasswordReset",async e=>{e.preventDefault();const a=this.passwordInput.current.value;if(!a||a.length<p.Q.MIN_PASSWORD_LENGTH)return void this.setState({error:d.a.createElement(u.a,{id:"password_form.error",defaultMessage:"Please enter at least {chars} characters.",values:{chars:p.Q.MIN_PASSWORD_LENGTH}})});this.setState({error:null});const s=new URLSearchParams(this.props.location.search).get("token"),{data:t,error:r}=await this.props.actions.resetUserPassword(s,a);t?(m.a.push("/login?extra="+p.Q.PASSWORD_CHANGE),this.setState({error:null})):r&&this.setState({error:r.message})}),this.state={error:null},this.passwordInput=d.a.createRef()}render(){let e=null;this.state.error&&(e=d.a.createElement("div",{className:"form-group has-error"},d.a.createElement("label",{className:"control-label"},this.state.error)));let a="form-group";return e&&(a+=" has-error"),d.a.createElement("div",{className:"col-sm-12"},d.a.createElement("div",{className:"signup-team__container"},d.a.createElement("h3",null,d.a.createElement(u.a,{id:"password_form.title",defaultMessage:"Password Reset"})),d.a.createElement("form",{onSubmit:this.handlePasswordReset},d.a.createElement("p",null,d.a.createElement(u.a,{id:"password_form.enter",defaultMessage:"Enter a new password for your {siteName} account.",values:{siteName:this.props.siteName}})),d.a.createElement("div",{className:a},d.a.createElement(h.a,{id:"resetPasswordInput",type:"password",className:"form-control",name:"password",ref:this.passwordInput,placeholder:{id:Object(w.b)("password_form.pwd"),defaultMessage:"Password"},spellCheck:"false",autoFocus:!0})),e,d.a.createElement("button",{id:"resetPasswordButton",type:"submit",className:"btn btn-primary"},d.a.createElement(u.a,{id:"password_form.change",defaultMessage:"Change my password"})))))}}f(b,"propTypes",{location:c.a.object.isRequired,siteName:c.a.string,actions:c.a.shape({resetUserPassword:c.a.func.isRequired}).isRequired});a.default=Object(r.connect)(e=>{const{SiteName:a}=Object(o.getConfig)(e);return{siteName:a}},e=>({actions:Object(t.bindActionCreators)({resetUserPassword:n.resetUserPassword},e)}))(b)}}]);
  //# sourceMappingURL=28.1399cf44d88b4b79587f.js.map