(window.webpackJsonpLHCReactAPP=window.webpackJsonpLHCReactAPP||[]).push([[3],{512:function(e,t,a){"use strict";a.r(t);var n=a(6),s=a.n(n),l=a(7),i=a.n(l),r=a(9),o=a.n(r),c=a(10),m=a.n(c),d=a(3),u=a.n(d),h=a(11),p=a.n(h),b=a(12),f=a.n(b),g=a(0),v=a.n(g),E=a(20),w=a.n(E),N=a(25),y=function(e){function t(e){var a;return s()(this,t),a=o()(this,m()(t).call(this,e)),f()(u()(a),"state",{mail:null,success:"",errors:null,sending:!1}),f()(u()(a),"dismissModal",(function(){a.props.toggle()})),a.sendMail=a.sendMail.bind(u()(a)),a.emailRef=v.a.createRef(),a}return p()(t,e),i()(t,[{key:"sendMail",value:function(e){var t=this;this.setState({sending:!0}),w.a.post(window.lhcChat.base_url+"widgetrestapi/sendmailsettings/"+this.props.chatId+"/"+this.props.chatHash+"/(action)/send",{email:this.state.mail},{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((function(e){0==e.data.error?t.props.toggle():(t.setState({sending:!1}),t.setState({errors:e.data.result}))})),e&&e.preventDefault()}},{key:"componentDidMount",value:function(){var e=this;w.a.get(window.lhcChat.base_url+"widgetrestapi/sendmailsettings/"+this.props.chatId+"/"+this.props.chatHash).then((function(t){e.setState({mail:t.data}),e.emailRef.current&&e.emailRef.current.focus()})).catch((function(e){console.log(e)}))}},{key:"render",value:function(){var e=this,t=this.props.t;return v.a.createElement(v.a.Fragment,null,null!==this.state.mail&&v.a.createElement(v.a.Fragment,null,v.a.createElement("div",{className:"fade modal-backdrop show"}),v.a.createElement("div",{role:"dialog",id:"dialog-content","aria-modal":"true",className:"fade modal show d-block",tabIndex:"-1"},v.a.createElement("div",{className:"modal-dialog modal-lg"},v.a.createElement("div",{className:"modal-content"},v.a.createElement("div",{className:"modal-header pt-1 pb-1 pl-2 pr-2"}," ",v.a.createElement("h4",{className:"modal-title",id:"myModalLabel"},v.a.createElement("span",{className:"material-icons"},""),t("button.mail")),v.a.createElement("button",{type:"button",className:"close float-right","data-dismiss":"modal",onClick:this.dismissModal,"aria-label":"Close"},v.a.createElement("span",{"aria-hidden":"true"},"×"))),v.a.createElement("div",{className:"modal-body"},v.a.createElement("div",{className:"row"},v.a.createElement("div",{className:"col-12"},this.state.errors&&v.a.createElement("div",{className:"mb-0",dangerouslySetInnerHTML:{__html:this.state.errors}}),v.a.createElement("div",{className:"mb-0"},v.a.createElement("form",{onSubmit:this.sendMail},v.a.createElement("input",{className:"form-control form-group form-control-sm",ref:this.emailRef,required:"required",type:"email",defaultValue:this.state.mail,onChange:function(t){return e.setState({mail:t.target.value})},placeholder:t("chat.enter_email"),title:t("chat.enter_email")}),v.a.createElement("div",{className:"btn-group",role:"group","aria-label":"..."},v.a.createElement("button",{type:"submit",disabled:this.state.sending,className:"btn btn-secondary btn-sm"},t("button.send")),v.a.createElement("button",{type:"button",className:"btn btn-secondary btn-sm",onClick:this.dismissModal},t("button.cancel")))))))))))))}}]),t}(g.PureComponent);t.default=Object(N.b)()(y)}}]);
//# sourceMappingURL=3.ebd2630847bc8173025f.ie.js.map