"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[4654],{94654:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_}),n(3188),n(30973),n(17046),n(36169),n(43813),n(59297);var a=n(97023),s=n.n(a),o=n(14778),r=n(23453),i=n(81911),l=n(1418),c=n(17085),u=n(77440),d=n(7430),m=n(91767),E=n(59671),v=n(65844),p=n(1396),y=n(78451),f=n(85873),g=function(e){return e.PENDING="pending",e.SUCCESS="success",e.FAILURE="failure",e}(g||{});const _=()=>{var e;const{formatMessage:t}=(0,o.useIntl)(),n=(0,r.useDispatch)(),_=(0,i.useHistory)(),{search:S}=(0,i.useLocation)(),N=null!==(e=new URLSearchParams(S).get("token"))&&void 0!==e?e:"",I=Boolean((0,r.useSelector)(d.WR)),w=(0,r.useSelector)(u.Pu),[h,C]=(0,a.useState)(g.PENDING),[R,b]=(0,a.useState)("");(0,a.useEffect)((()=>{(0,E.sx)("signup","do_verify_email",(0,f.ge)()),k()}),[]);const A=()=>{if(I)return w?void _.push("/"):void(0,m.tc)();const e=new URLSearchParams(S);e.set("extra",y.YM.SIGNIN_VERIFIED),_.push("/login?".concat(e))},k=async()=>{const{error:e}=await n((0,c.TB)(N));if(e)return C(g.FAILURE),void b(t({id:"signup_user_completed.invalid_invite.message",defaultMessage:"Please speak with your Administrator to receive an invitation."}));if(C(g.SUCCESS),await n((0,l.x8)()),!I)return void A();n((0,l.vV)({message:y.Xu.EMAIL_VERIFIED,type:y.cn.SUCCESS},{errorBarMode:l.tq.Always})),(0,E.sx)("settings","verify_email");const{error:a}=await n((0,c.jp)());if(a)return C(g.FAILURE),void b(t({id:"signup_user_completed.failed_update_user_state",defaultMessage:"Please clear your cache and try to log in."}));A()};return h===g.FAILURE?s().createElement("div",{className:"do-verify-body"},s().createElement("div",{className:"do-verify-body-content"},s().createElement(v.A,{title:t({id:"signup_user_completed.invalid_invite.title",defaultMessage:"This invite link is invalid"}),message:R,extraContent:s().createElement("div",{className:"do-verify-body-content-button-container"},s().createElement("button",{className:"do-verify-body-content-button-return",onClick:()=>_.replace("/")},t({id:"signup_user_completed.return",defaultMessage:"Return to log in"})))}))):s().createElement(p.A,null)}},65844:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(62688),s=n.n(a),o=n(97023),r=n.n(o),i=n(78451);const l=e=>{let{title:t,message:n,SVGElement:a,extraContent:s,onEnterKeyDown:o}=e;return r().createElement("div",{className:"content-layout-column",onKeyDown:e=>{o&&e.key===i.Ay.KeyCodes.ENTER[0]&&o(e)},tabIndex:0},r().createElement("div",{className:"content-layout-column-svg"},a),r().createElement("h1",{className:"content-layout-column-title"},t),r().createElement("p",{className:"content-layout-column-message"},n),s&&r().createElement("div",{className:"content-layout-column-extra-content"},s))};l.propTypes={title:s().node.isRequired,message:s().node.isRequired,SVGElement:s().node,extraContent:s().node,onEnterKeyDown:s().func};const c=l}}]);
//# sourceMappingURL=4654.0c80529c39f48302294b.js.map