"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[5968],{88153:(e,t,r)=>{r.d(t,{A:()=>m});var s=r(62688),a=r.n(s),n=r(71633),l=r.n(n),o=r(97023),i=r.n(o),c=r(14778),d=r(81911);const u=e=>{let{url:t,className:r,onClick:s}=e;const{formatMessage:a}=(0,c.useIntl)();return i().createElement("div",{className:l()("signup-header",r)},i().createElement(d.Link,{"data-testid":"back_button",onClick:s,to:t},i().createElement("span",{id:"back_button_icon",className:"fa fa-1x fa-angle-left",title:a({id:"generic_icons.back",defaultMessage:"Back Icon"})}),i().createElement(c.FormattedMessage,{id:"web.header.back",defaultMessage:"Back"})))};u.propTypes={url:a().string,className:a().string,onClick:a().func},u.defaultProps={url:"/"};const m=u},30491:(e,t,r)=>{r.d(t,{A:()=>i}),r(29206),r(57406),r(55448);var s=r(97023),a=r.n(s),n=r(14778);const l=["placeholder"],o=a().forwardRef(((e,t)=>{let{placeholder:r}=e,s=function(e,t){if(null==e)return{};var r,s,a=function(e,t){if(null==e)return{};var r={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.includes(s))continue;r[s]=e[s]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)r=n[s],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,l);const o=(0,n.useIntl)();return a().createElement("input",Object.assign({ref:t,placeholder:o.formatMessage(r)},s))}));o.displayName="LocalizedPlaceholderInput";const i=o},25968:(e,t,r)=>{r.r(t),r.d(t,{default:()=>b});var s=r(23453),a=r(5908),n=r(17085),l=r(62688),o=r.n(l),i=(r(17046),r(43813),r(76685),r(4290),r(97023)),c=r.n(i),d=r(14778),u=r(78546),m=r(88153),p=r(30491);function f(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class h extends c().PureComponent{constructor(){super(...arguments),f(this,"state",{error:null,updateText:null}),f(this,"resetForm",c().createRef()),f(this,"emailInput",c().createRef()),f(this,"handleSendLink",(async e=>{e.preventDefault();const t=this.emailInput.current.value.trim().toLowerCase();if(!t||!(0,u.xf)(t))return void this.setState({error:c().createElement(d.FormattedMessage,{id:"password_send.error",defaultMessage:"Please enter a valid email address."})});this.setState({error:null});const{data:r,error:s}=await this.props.actions.sendPasswordResetEmail(t);r?(this.setState({error:null,updateText:c().createElement("div",{id:"passwordResetEmailSent",className:"reset-form alert alert-success"},c().createElement(d.FormattedMessage,{id:"password_send.link",defaultMessage:"If the account exists, a password reset email will be sent to:"}),c().createElement("div",null,c().createElement("b",null,t)),c().createElement("br",null),c().createElement(d.FormattedMessage,{id:"password_send.checkInbox",defaultMessage:"Please check your inbox."}))}),this.resetForm.current&&(this.resetForm.current.hidden=!0)):s&&this.setState({error:s.message,updateText:null})}))}render(){let e=null;this.state.error&&(e=c().createElement("div",{className:"form-group has-error"},c().createElement("label",{className:"control-label"},this.state.error)));let t="form-group";return e&&(t+=" has-error"),c().createElement("div",null,c().createElement(m.A,null),c().createElement("div",{className:"col-sm-12"},c().createElement("div",{className:"signup-team__container"},c().createElement(d.FormattedMessage,{id:"password_send.title",tagName:"h1",defaultMessage:"Password Reset"}),this.state.updateText,c().createElement("form",{onSubmit:this.handleSendLink,ref:this.resetForm},c().createElement("p",null,c().createElement(d.FormattedMessage,{id:"password_send.description",defaultMessage:"To reset your password, enter the email address you used to sign up"})),c().createElement("div",{className:t},c().createElement(p.A,{id:"passwordResetEmailInput",type:"email",className:"form-control",name:"email",placeholder:(0,d.defineMessage)({id:"password_send.email",defaultMessage:"Email"}),ref:this.emailInput,spellCheck:"false",autoFocus:!0})),e,c().createElement("button",{id:"passwordResetButton",type:"submit",className:"btn btn-primary"},c().createElement(d.FormattedMessage,{id:"password_send.reset",defaultMessage:"Reset my password"}))))))}}f(h,"propTypes",{actions:o().shape({sendPasswordResetEmail:o().func.isRequired}).isRequired});const b=(0,s.connect)(null,(e=>({actions:(0,a.bindActionCreators)({sendPasswordResetEmail:n.J1},e)})))(h)}}]);
//# sourceMappingURL=5968.c7f0f0c9e6eaedaa4ace.js.map