(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{1240:function(e,a,t){"use strict";t.d(a,"a",(function(){return u}));t(109);var r=t(133),s=t.n(r),i=t(4),n=t.n(i),o=t(1213),c=t(1211);function l(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}class u extends n.a.PureComponent{render(){return n.a.createElement("div",{id:"back_button",className:"signup-header"},n.a.createElement(c.Link,{onClick:this.props.onClick,to:this.props.url},n.a.createElement(o.a,{id:"generic_icons.back",defaultMessage:"Back Icon"},e=>n.a.createElement("span",{id:"back_button_icon",className:"fa fa-1x fa-angle-left",title:e.toString()})),n.a.createElement(o.a,{id:"web.header.back",defaultMessage:"Back"})))}}l(u,"propTypes",{url:s.a.string,onClick:s.a.func}),l(u,"defaultProps",{url:"/"})},1245:function(e,a,t){"use strict";a.a=t.p+"files/ab8aa80cba445eb0fb75e6611c292567.png"},2212:function(e,a,t){"use strict";t.r(a);var r=t(7),s=t(290),i=t(15),n=t(14),o=t(9),c=t(43),l=(t(58),t(205),t(31),t(573),t(133)),u=t.n(l),d=t(4),p=t.n(d),m=t(1213),E=t(164),h=t(96),g=t(0),f=t(1245),b=t(1240),v=t(1225),_=t(1226);function R(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}class y extends p.a.PureComponent{constructor(e){super(e),R(this,"verifyEmail",async()=>{const{actions:{verifyUserEmail:e}}=this.props,a=await e(new URLSearchParams(this.props.location.search).get("token")||"");"data"in a?this.handleSuccess():"error"in a&&this.handleError(g.R.FAILED_EMAIL_VERIFICATION)}),this.state={verifyStatus:"pending",serverError:null}}componentDidMount(){this.verifyEmail()}handleRedirect(){if(this.props.isLoggedIn)_.f();else{let e="/login?extra=verified";const a=new URLSearchParams(this.props.location.search).get("email");a&&(e+="&email="+encodeURIComponent(a));const t=new URLSearchParams(this.props.location.search).get("redirect_to");t&&(e+="&redirect_to="+t),h.a.push(e)}}async handleSuccess(){if(this.setState({verifyStatus:"success"}),this.props.actions.clearErrors(),this.props.isLoggedIn){this.props.actions.logError({message:g.h.EMAIL_VERIFIED,type:g.i.SUCCESS},!0),Object(E.d)("settings","verify_email");const e=await this.props.actions.getMe();"data"in e?this.handleRedirect():"error"in e&&this.handleError(g.R.FAILED_USER_STATE_GET)}else this.handleRedirect()}handleError(e){let a=null;e===g.R.FAILED_EMAIL_VERIFICATION?a=p.a.createElement(m.a,{id:"signup_user_completed.invalid_invite",defaultMessage:"The invite link was invalid. Please speak with your Administrator to receive an invitation."}):e===g.R.FAILED_USER_STATE_GET&&(a=p.a.createElement(m.a,{id:"signup_user_completed.failed_update_user_state",defaultMessage:"Please clear your cache and try to log in."})),this.setState({verifyStatus:"failure",serverError:a})}render(){if("failure"!==this.state.verifyStatus)return p.a.createElement(v.a,null);let e=null;return this.state.serverError&&(e=p.a.createElement("div",{className:"form-group has-error"},p.a.createElement("label",{className:"control-label"},this.state.serverError))),p.a.createElement("div",null,p.a.createElement(b.a,null),p.a.createElement("div",{className:"col-sm-12"},p.a.createElement("div",{className:"signup-team__container"},p.a.createElement("img",{alt:"signup team logo",className:"signup-team-logo",src:f.a}),p.a.createElement("div",{className:"signup__content"},p.a.createElement("h1",null,this.props.siteName),p.a.createElement("h4",{className:"color--light"},p.a.createElement(m.a,{id:"web.root.signup_info",defaultMessage:"All team communication in one place, searchable and accessible anywhere"})),e))))}}R(y,"propTypes",{location:u.a.shape({search:u.a.string.isRequired}).isRequired,siteName:u.a.string,actions:u.a.shape({verifyUserEmail:u.a.func.isRequired,getMe:u.a.func.isRequired,logError:u.a.func.isRequired,clearErrors:u.a.func.isRequired}).isRequired,isLoggedIn:u.a.bool.isRequired});a.default=Object(s.connect)((function(e){const a=Object(n.getConfig)(e).SiteName;return{isLoggedIn:Boolean(Object(o.getCurrentUserId)(e)),siteName:a}}),(function(e){return{actions:Object(r.bindActionCreators)({verifyUserEmail:i.verifyUserEmail,getMe:i.getMe,logError:c.logError,clearErrors:c.clearErrors},e)}}))(y)}}]);
//# sourceMappingURL=18.69376521bbd97c7d3977.js.map