!function(){"use strict";vart={6705:function(t,e,n){varo=n(2667),r=(n(2004),n(8407),n(4458),n(5101),n(6394),n(2322),n(4669),n(9268),n(3233),n(5466)),i=n(3074),a=n.n(i),u=n(1346),s=n(2880),l=n(365),c=n(137),f=n.n(c),h=n(4426),p=n(2259),m=n(612),d=n(5464),b=n(8170),y=n(8349),v=n(3085),g=(n(9174),n(9688)),_=n(8420);functionS(t){return(S="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft})(t)}functionw(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functionk(t,e){for(varn=0;n<e.length;n++){varo=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"ino&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}functionE(t,e,n){returne&&k(t.prototype,e),n&&k(t,n),t}functionP(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&j(t,e)}functionj(t,e){return(j=Object.setPrototypeOf||function(t,e){returnt.__proto__=e,t})(t,e)}functionD(t){vare=function(){if("undefined"==typeofReflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeofProxy)return!0;try{returnDate.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();returnfunction(){varn,o=O(t);if(e){varr=O(this).constructor;n=Reflect.construct(o,arguments,r)}elsen=o.apply(this,arguments);returnC(this,n)}}functionC(t,e){return!e||"object"!==S(e)&&"function"!=typeofe?x(t):e}functionx(t){if(void0===t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returnt}functionO(t){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(t){returnt.__proto__||Object.getPrototypeOf(t)})(t)}varF=function(t){P(n,t);vare=D(n);functionn(t){varo;returnw(this,n),(o=e.call(this,t)).state={subject:"",body:"",isSending:!1},o.onUpdateSubject=o.onUpdateSubject.bind(x(o)),o.onUpdateBody=o.onUpdateBody.bind(x(o)),o.onSubmit=o.onSubmit.bind(x(o)),o.onSubmitSuccess=o.onSubmitSuccess.bind(x(o)),o.onSubmitFail=o.onSubmitFail.bind(x(o)),o}returnE(n,[{key:"onUpdateSubject",value:function(){this.setState({subject:this.refs.msgSubject.value.trim()})}},{key:"onUpdateBody",value:function(){this.setState({body:this.refs.msgBody.value.trim()})}},{key:"onSubmitSuccess",value:function(t){this.setState({subject:"",body:"",isSending:!1},(function(){setTimeout(function(){y.wN("Your message was successfully submitted to "+this.props.author.name,"messageSubmitSucceed")}.bind(this),100)}))}},{key:"onSubmitFail",value:function(t){this.setState({isSending:!1},(function(){console.log(t),setTimeout(function(){y.wN("Your message failed to submit. Please try again","messageSubmitFailed")}.bind(this),100)}))}},{key:"onSubmit",value:function(t){this.state.isSending||""===this.state.subject||""===this.state.body||(t.preventDefault(),t.stopPropagation(),this.setState({isSending:!0},(function(){vart=u.Z._currentValue.users+"/"+this.props.author.username+"/contact";(0,_.j0)(t,{subject:this.state.subject,body:this.state.body},{headers:{"X-CSRFToken":(0,_.m5)()}},!1,this.onSubmitSuccess,this.onSubmitFail)})))}},{key:"render",value:function(){returnr.createElement("div",{className:"media-list-row profile-contact"},r.createElement("div",{className:"media-list-header"},r.createElement("h2",null,"Contact")),r.createElement("form",{method:"post",className:"user-contact-form"+(this.state.isSending?" pending-response":"")},r.createElement("span",null,r.createElement("label",null,"Subject"),r.createElement("input",{ref:"msgSubject",type:"text",required:!0,onChange:this.onUpdateSubject,value:this.state.subject})),r.createElement("span",null,r.createElement("label",null,"Message"),r.createElement("textarea",{ref:"msgBody",required:!0,cols:"40",rows:"10",onChange:this.onUpdateBody,value:this.state.body})),r.createElement("button",{onClick:this.onSubmit},"SUBMIT")))}}])