(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{1972:function(e,s,t){"use strict";t.r(s);var a=t(7),r=t(307),o=t(15),n=t(21),c=(t(51),t(170),t(35),t(603),t(16)),l=t.n(c),i=t(6),d=t.n(i),u=t(28),m=t(96),p=t(0),h=t(1142),w=t(29);function f(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}class b extends d.a.PureComponent{constructor(e){super(e),f(this,"handlePasswordReset",async e=>{e.preventDefault();const s=this.passwordInput.current.value;if(!s||s.length<p.P.MIN_PASSWORD_LENGTH)return void this.setState({error:d.a.createElement(u.c,{id:"password_form.error",defaultMessage:"Please enter at least {chars} characters.",values:{chars:p.P.MIN_PASSWORD_LENGTH}})});this.setState({error:null});const t=new URLSearchParams(this.props.location.search).get("token"),{data:a,error:r}=await this.props.actions.resetUserPassword(t,s);a?(m.a.push("/login?extra="+p.P.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 s="form-group";return e&&(s+=" 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.c,{id:"password_form.title",defaultMessage:"Password Reset"})),d.a.createElement("form",{onSubmit:this.handlePasswordReset},d.a.createElement("p",null,d.a.createElement(u.c,{id:"password_form.enter",defaultMessage:"Enter a new password for your {siteName} account.",values:{siteName:this.props.siteName}})),d.a.createElement("div",{className:s},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.c,{id:"password_form.change",defaultMessage:"Change my password"})))))}}f(b,"propTypes",{location:l.a.object.isRequired,siteName:l.a.string,actions:l.a.shape({resetUserPassword:l.a.func.isRequired}).isRequired});s.default=Object(r.connect)(e=>{const{SiteName:s}=Object(o.getConfig)(e);return{siteName:s}},e=>({actions:Object(a.bindActionCreators)({resetUserPassword:n.resetUserPassword},e)}))(b)}}]);
//# sourceMappingURL=29.966cad74d5c9859543d5.js.map