webpackJsonp([53],{1839:function(e,t,a){"use strict";(function(e){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var l=a(6),s=r(l),o=a(4),i=r(o),u=a(5),n=r(u),d=a(7),c=r(d),m=a(8),f=r(m),p=a(16),h=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t.default=e,t}(p),w=a(9),_=r(w),v=a(2),y=r(v),E=a(1),g=r(E),M=a(45),b=r(M),S=a(18),N=a(671),P=function(t){function a(e){(0,i.default)(this,a);var t=(0,c.default)(this,(a.__proto__||(0,s.default)(a)).call(this,e));return t.submit=t.submit.bind(t),t.state={},t}return(0,f.default)(a,t),(0,n.default)(a,[{key:"submit",value:function(e){var t=this;e.preventDefault();var a={},r=b.default.findDOMNode(this.refs.password).value;if(!r)return a.error=h.localizeMessage("claim.oauth_to_email.enterPwd","Please enter a password."),void this.setState(a);var l=h.isValidPassword(r);if(""!==l)return void this.setState({error:l});var s=b.default.findDOMNode(this.refs.passwordconfirm).value;if(!s||r!==s)return a.error=h.localizeMessage("claim.oauth_to_email.pwdNotMatch","Password do not match."),void this.setState(a);a.error=null,this.setState(a),(0,N.oauthToEmail)(this.props.currentType,this.props.email,r,null,function(e){t.setState({error:e.message})})}},{key:"render",value:function(){var t=null;this.state.error&&(t=g.default.createElement("div",{className:"form-group has-error"},g.default.createElement("label",{className:"control-label"},this.state.error)));var a="form-group";t&&(a+=" has-error");var r=(this.props.currentType===_.default.SAML_SERVICE?_.default.SAML_SERVICE.toUpperCase():h.toTitleCase(this.props.currentType))+" SSO";return g.default.createElement("div",null,g.default.createElement("h3",null,g.default.createElement(S.FormattedMessage,{id:"claim.oauth_to_email.title",defaultMessage:"Switch {type} Account to Email",values:{type:r}})),g.default.createElement("form",{onSubmit:this.submit},g.default.createElement("p",null,g.default.createElement(S.FormattedMessage,{id:"claim.oauth_to_email.description",defaultMessage:"Upon changing your account type, you will only be able to login with your email and password."})),g.default.createElement("p",null,g.default.createElement(S.FormattedMessage,{id:"claim.oauth_to_email.enterNewPwd",defaultMessage:"Enter a new password for your {site} email account",values:{site:e.window.mm_config.SiteName}})),g.default.createElement("div",{className:a},g.default.createElement("input",{type:"password",className:"form-control",name:"password",ref:"password",placeholder:h.localizeMessage("claim.oauth_to_email.newPwd","New Password"),spellCheck:"false"})),g.default.createElement("div",{className:a},g.default.createElement("input",{type:"password",className:"form-control",name:"passwordconfirm",ref:"passwordconfirm",placeholder:h.localizeMessage("claim.oauth_to_email.confirm","Confirm Password"),spellCheck:"false"})),t,g.default.createElement("button",{type:"submit",className:"btn btn-primary"},g.default.createElement(S.FormattedMessage,{id:"claim.oauth_to_email.switchTo",defaultMessage:"Switch {type} to email and password",values:{type:r}}))))}}]),a}(g.default.Component);t.default=P,P.defaultProps={},P.propTypes={currentType:y.default.string,email:y.default.string}}).call(t,a(22))}});
//# sourceMappingURL=53.4b9e2ee326db29bef963.js.map