"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[7099],{47099(e,s,t){t.r(s),t.d(s,{default:()=>g});var a=t(37270),r=t(32446),o=t(17085),n=t(26614),m=(t(15724),t(5673),t(30164),t(21279),t(71633)),l=t.n(m),c=t(36418),u=t(14778),d=t(81911),i=t(14891),p=t(81444);const f=({location:e,siteName:s,actions:t})=>{const a=(0,u.useIntl)(),r=(0,d.useHistory)(),[o,n]=(0,c.useState)(null),m=(0,c.useRef)(null);(0,c.useEffect)(()=>{document.title=a.formatMessage({id:"password_form.pageTitle",defaultMessage:"Password Reset | {siteName}"},{siteName:s||"Mattermost"})},[a,s]);const f=o?c.createElement("div",{className:"form-group has-error"},c.createElement("label",{className:"control-label"},o)):null;return c.createElement("div",{className:"col-sm-12"},c.createElement("div",{className:"signup-team__container"},c.createElement(u.FormattedMessage,{id:"password_form.title",tagName:"h1",defaultMessage:"Password Reset"}),c.createElement("form",{onSubmit:async s=>{s.preventDefault();const a=m.current.value,o=new URLSearchParams(e.search).get("token");if("string"!=typeof o)throw new Error("token must be a string");const{data:l,error:c}=await t.resetUserPassword(o,a);l?(r.push("/login?extra="+p.Ay.PASSWORD_CHANGE),n(null)):c&&n(c.message)}},c.createElement("p",null,c.createElement(u.FormattedMessage,{id:"password_form.enter",defaultMessage:"Enter a new password for your {siteName} account.",values:{siteName:s}})),c.createElement("div",{className:l()("form-group",{"has-error":o})},c.createElement("input",{id:"resetPasswordInput",type:"password",className:"form-control",name:"password",ref:m,placeholder:a.formatMessage({id:"password_form.pwd",defaultMessage:"Password"}),spellCheck:"false",autoFocus:!0})),f,c.createElement(i.Button,{id:"resetPasswordButton",type:"submit",emphasis:"primary"},c.createElement(u.FormattedMessage,{id:"password_form.change",defaultMessage:"Change my password"})))))},w=(0,c.memo)(f),g=(0,a.connect)(function(e){return{siteName:(0,n.zj)(e).SiteName}},e=>({actions:(0,r.zH)({resetUserPassword:o.cw},e)}))(w)}}]);
//# sourceMappingURL=7099.7528a380ac0898401262.js.map