"use strict";(self.webpackChunkLHCReactAPP=self.webpackChunkLHCReactAPP||[]).push([[800],{5800:function(e,t,a){a.r(t);var n=a(4575),l=a.n(n),s=a(3913),r=a.n(s),i=a(1506),c=a.n(i),o=a(2205),m=a.n(o),d=a(8585),u=a.n(d),h=a(9754),f=a.n(h),p=a(9713),b=a.n(p),v=a(7294),E=a(9669),g=a.n(E),N=a(7139);var y=function(e){m()(s,e);var t,a,n=(t=s,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=f()(t);if(a){var l=f()(this).constructor;e=Reflect.construct(n,arguments,l)}else e=n.apply(this,arguments);return u()(this,e)});function s(e){var t;return l()(this,s),t=n.call(this,e),b()(c()(t),"state",{mail:null,success:"",errors:null,sending:!1}),b()(c()(t),"dismissModal",(function(){t.props.toggle()})),t.sendMail=t.sendMail.bind(c()(t)),t.emailRef=v.createRef(),t}return r()(s,[{key:"sendMail",value:function(e){var t=this;this.setState({sending:!0}),g().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;g().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.createElement(v.Fragment,null,null!==this.state.mail&&v.createElement(v.Fragment,null,v.createElement("div",{className:"fade modal-backdrop show"}),v.createElement("div",{role:"dialog",id:"dialog-content","aria-modal":"true",className:"fade modal show d-block mail-send-modal",tabIndex:"-1"},v.createElement("div",{className:"modal-dialog modal-lg"},v.createElement("div",{className:"modal-content"},v.createElement("div",{className:"modal-header"}," ",v.createElement("h4",{className:"modal-title",id:"myModalLabel"},v.createElement("span",{className:"material-icons"},""),t("button.mail")),v.createElement("button",{type:"button",className:"btn-close float-end","data-bs-dismiss":"modal",onClick:this.dismissModal,"aria-label":"Close"})),v.createElement("div",{className:"modal-body"},v.createElement("div",{className:"row"},v.createElement("div",{className:"col-12"},this.state.errors&&v.createElement("div",{className:"mb-0",dangerouslySetInnerHTML:{__html:this.state.errors}}),v.createElement("div",{className:"mb-0"},v.createElement("form",{onSubmit:this.sendMail},v.createElement("p",{className:"mail-explain"},t("button.email_explain")),v.createElement("div",{className:"form-group"},v.createElement("label",{className:"text-muted"},t("button.email")),v.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.createElement("div",{className:"row"},v.createElement("div",{className:"col-5"},v.createElement("button",{type:"submit",disabled:this.state.sending||""==this.state.mail,className:"btn btn-primary w-100 btn-sm"},t("button.send"))),v.createElement("div",{className:"col-2"}),v.createElement("div",{className:"col-5"},v.createElement("button",{type:"button",className:"btn text-muted btn-link btn-sm w-100",onClick:this.dismissModal},t("button.cancel"))))))))))))))}}]),s}(v.PureComponent);t.default=(0,N.Z)()(y)}}]);
//# sourceMappingURL=800.8c3bfdb4ac7cf39ec020.js.map