(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{1850:function(e,s,a){"use strict";a.r(s);var t=a(6),r=a(224),o=a(15),n=a(22),l=(a(21),a(110),a(8),a(570),a(16)),c=a.n(l),i=a(5),d=a.n(i),m=a(225),u=a.n(m),p=a(28),w=a(95),h=a(0),f=a(907),b=a(29);function N(e,s,a){return s in e?Object.defineProperty(e,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[s]=a,e}class g extends d.a.PureComponent{constructor(e){super(e),N(this,"handlePasswordReset",async e=>{e.preventDefault();const s=u.a.findDOMNode(this.refs.password).value;if(!s||s.length<h.Q.MIN_PASSWORD_LENGTH)return void this.setState({error:d.a.createElement(p.c,{id:"password_form.error",defaultMessage:"Please enter at least {chars} characters.",values:{chars:h.Q.MIN_PASSWORD_LENGTH}})});this.setState({error:null});const a=new URLSearchParams(this.props.location.search).get("token"),{data:t,error:r}=await this.props.actions.resetUserPassword(a,s);t?(w.a.push("/login?extra="+h.Q.PASSWORD_CHANGE),this.setState({error:null})):r&&this.setState({error:r.message})}),this.state={error:null}}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(p.c,{id:"password_form.title",defaultMessage:"Password Reset"})),d.a.createElement("form",{onSubmit:this.handlePasswordReset},d.a.createElement("p",null,d.a.createElement(p.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(f.a,{id:"resetPasswordInput",type:"password",className:"form-control",name:"password",ref:"password",placeholder:{id:Object(b.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(p.c,{id:"password_form.change",defaultMessage:"Change my password"})))))}}N(g,"propTypes",{location:c.a.object.isRequired,siteName:c.a.string,actions:c.a.shape({resetUserPassword:c.a.func.isRequired}).isRequired});s.default=Object(r.connect)(e=>{const{SiteName:s}=Object(o.getConfig)(e);return{siteName:s}},e=>({actions:Object(t.bindActionCreators)({resetUserPassword:n.resetUserPassword},e)}))(g)}}]);
//# sourceMappingURL=29.1a227f95e0407858cecc.js.map