From 4b19816a504d1cebdeedf38073aaeb2eaeb15a99 Mon Sep 17 00:00:00 2001 From: Remigijus Kiminas Date: Wed, 22 Feb 2023 08:16:57 -0500 Subject: [PATCH] Update translations cache --- lhc_web/design/defaulttheme/js/widgetv2/react.app.js | 2 +- lhc_web/design/defaulttheme/js/widgetv2/react.app.js.map | 2 +- .../widget/react-app/src/store/chatWidgetListener.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lhc_web/design/defaulttheme/js/widgetv2/react.app.js b/lhc_web/design/defaulttheme/js/widgetv2/react.app.js index 6bc3cbe118..7be813c70e 100644 --- a/lhc_web/design/defaulttheme/js/widgetv2/react.app.js +++ b/lhc_web/design/defaulttheme/js/widgetv2/react.app.js @@ -1,3 +1,3 @@ /*! For license information please see react.app.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.LHCReactAPP=t():e.LHCReactAPP=t()}(self,(function(){return function(){var __webpack_modules__={2858:function(e){e.exports=function(e){if(Array.isArray(e))return e}},1506:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},8926:function(e){function t(e,t,a,n,i,r,s){try{var o=e[r](s),c=o.value}catch(e){return void a(e)}o.done?t(c):Promise.resolve(c).then(n,i)}e.exports=function(e){return function(){var a=this,n=arguments;return new Promise((function(i,r){var s=e.apply(a,n);function o(e){t(s,i,r,o,c,"next",e)}function c(e){t(s,i,r,o,c,"throw",e)}o(void 0)}))}}},4575:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},3913:function(e){function t(e,t){for(var a=0;a0||a.chatwidget.getIn(["chatLiveData","status"])===_constants_chat_status__WEBPACK_IMPORTED_MODULE_2__.pA)),r=a.chatwidget.getIn(["chatLiveData","status"])==_constants_chat_status__WEBPACK_IMPORTED_MODULE_2__.sk&&a.chatwidget.getIn(["chatLiveData","uid"])>0;(1==i||r)&&a.chatwidget.hasIn(["chat_ui","survey_id"])&&(a.chatwidget.hasIn(["chat_ui","survey_button"])&&1!==a.chatwidget.getIn(["chat_ui_state","show_survey"])&&1!=i||(n=!0)),a.chatwidget.hasIn(["chat_ui","close_on_unload"])&&"embed"==a.chatwidget.get("mode")&&(!1!==a.chatwidget.get("isMobile")&&!0!==n||_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("endChat",[{sender:"endButton"}])),"popup"==a.chatwidget.get("mode")&&1==n&&_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("endChat",[{sender:"endButton"}]),a.chatwidget.hasIn(["chatData","id"])&&a.chatwidget.hasIn(["chatData","hash"])?axios__WEBPACK_IMPORTED_MODULE_0___default().post(window.lhcChat.base_url+"chat/userclosechat/"+a.chatwidget.getIn(["chatData","id"])+"/"+a.chatwidget.getIn(["chatData","hash"]),null,defaultHeaders):!0===a.chatwidget.getIn(["proactive","has"])&&"popup"==window.lhcChat.mode&&window.opener&&hideInvitation()(e,t)}}function checkErrorCounter(){2==syncStatus.error_counter&&_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("reloadWidget",[])}function addMessage(e){return function(t,a){if(1!=syncStatus.add_msg){syncStatus.add_msg=!0;try{_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("messageSend",[{chat_id:e.id,hash:e.hash,msg:e.msg}])}catch(e){_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.logJSError({stack:JSON.stringify(JSON.stringify(e))})}axios__WEBPACK_IMPORTED_MODULE_0___default().post(window.lhcChat.base_url+"widgetrestapi/addmsguser",e,defaultHeaders).then((function(n){try{(n.data.error||a().chatwidget.getIn(["chatLiveData","error"]))&&t({type:"ADD_MESSAGES_SUBMITTED",data:{r:n.data.r,msg:e.msg}}),syncStatus.add_msg=!1,fetchMessages({theme:e.theme,chat_id:e.id,lmgsid:a().chatwidget.getIn(["chatLiveData","lmsgid"]),hash:e.hash})(t,a),n.data.t&&_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("botTrigger",[{trigger:n.data.t}]),void 0===n.data.r||!0===n.data.error&&!0===n.data.system?(syncStatus.error_counter++,2==syncStatus.error_counter&&(_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.logJSError({stack:JSON.stringify(JSON.stringify(n)+"\nRD:"+JSON.stringify(n.data)+"\nRH:"+JSON.stringify(n.headers)+"\nRS:"+JSON.stringify(n.status))}),checkErrorCounter()),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("messageSendError",[{chat_id:e.id,hash:e.hash,msg:JSON.stringify(n.data)}])):syncStatus.error_counter=0}catch(e){throw e}finally{syncStatus.add_msg=!1,syncStatus.add_msg_pending.length>0&&addMessage(syncStatus.add_msg_pending.shift())(t,a)}})).catch((function(n){if(isNetworkError(n))t({type:"ADD_MESSAGES_SUBMITTED",data:{r:"SEND_CONNECTION",msg:e.msg}}),t({type:"NO_CONNECTION",data:!0});else{syncStatus.error_counter++;var i;i=n.response?JSON.stringify(JSON.stringify(n)+"\nRD:"+JSON.stringify(n.response.data)+"\nRH:"+JSON.stringify(n.response.headers)+"\nRS:"+JSON.stringify(n.response.status)):(n.request,JSON.stringify(JSON.stringify(n))),2==syncStatus.error_counter?(_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.logJSError({stack:i}),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("messageSendError",[{chat_id:e.id,hash:e.hash,msg:i}]),checkErrorCounter()):(t({type:"ADD_MESSAGES_SUBMITTED",data:{r:"SEND_FAILED",msg:e.msg}}),syncStatus.add_msg=!1,addMessage(e)(t,a))}syncStatus.add_msg=!1}))}else syncStatus.add_msg_pending.push(e)}}function userTyping(e,t){return function(a,n){var i=n();"true"===e?_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("visitorTyping",[{chat_id:i.chatwidget.getIn(["chatData","id"]),hash:i.chatwidget.getIn(["chatData","hash"]),status:!0,msg:t}]):_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("visitorTyping",[{chat_id:i.chatwidget.getIn(["chatData","id"]),hash:i.chatwidget.getIn(["chatData","hash"]),status:!1}]),i.chatwidget.get("overrides").contains("typing")||axios__WEBPACK_IMPORTED_MODULE_0___default().post(window.lhcChat.base_url+"chat/usertyping/"+i.chatwidget.getIn(["chatData","id"])+"/"+i.chatwidget.getIn(["chatData","hash"])+"/"+e,{msg:t},defaultHeaders).then((function(e){})).catch((function(e){console.log(e)}))}}function submitInlineSurvey(e){return axios__WEBPACK_IMPORTED_MODULE_0___default().post(window.lhcChat.base_url+"survey/fillinline",e,defaultHeaders)}},6313:function(e,t,a){"use strict";var n=a(4575),i=a.n(n),r=a(3913),s=a.n(r),o=a(2205),c=a.n(o),l=a(8585),d=a.n(l),u=a(9754),h=a.n(u),p=a(7294);var _=function(e){c()(r,e);var t,a,n=(t=r,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=h()(t);if(a){var i=h()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return d()(this,e)});function r(e){return i()(this,r),n.call(this,e)}return s()(r,[{key:"render",value:function(){return p.createElement(p.Fragment,null,p.createElement("div",{className:"fade modal-backdrop show"}),p.createElement("div",{role:"dialog",id:"dialog-content","aria-modal":"true",className:"fade modal show d-block p-2",tabIndex:"-1"},p.createElement("div",{className:"modal-content p-2 "+(this.props.full_height?"h-100":"")},this.props.as_html&&p.createElement("div",{className:this.props.full_height?"h-100":"",dangerouslySetInnerHTML:{__html:this.props.text}}),!this.props.as_html&&p.createElement("p",null,this.props.text),p.createElement("div",{className:"modal-footer"},p.createElement("button",{className:"btn btn-secondary btn-sm",onClick:this.props.close,type:"button"},this.props.closeText)))))}}]),r}(p.PureComponent);t.Z=_},5918:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(7154),_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4575),_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__),_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(3913),_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__),_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1506),_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__),_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(2205),_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__),_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(8585),_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__),_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(9754),_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__),react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(7294),html_react_parser__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(488),html_react_parser__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(html_react_parser__WEBPACK_IMPORTED_MODULE_8__),react_redux__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(6458);function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var a,n=_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(e);if(t){var i=_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this,a)}}function _isNativeReflectConstruct(){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}}var ChatBotIntroMessage=function(_PureComponent){_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(ChatBotIntroMessage,_PureComponent);var _super=_createSuper(ChatBotIntroMessage);function ChatBotIntroMessage(e){var t;return _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this,ChatBotIntroMessage),(t=_super.call(this,e)).abstractClick=t.abstractClick.bind(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(t)),t.updateTriggerClicked=t.updateTriggerClicked.bind(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(t)),t.processBotAction=t.processBotAction.bind(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(t)),t.disableEditor=!1,t}return _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(ChatBotIntroMessage,[{key:"addLoader",value:function(e,t){e["data-no-change"]||"button"!=e.type||(t.setAttribute("disabled","disabled"),t.innerHTML=''+t.innerHTML)}},{key:"abstractClick",value:function(e,t){var a=this.props.t;if(this.addLoader(e,t.target),-1!==e.onclick.indexOf("lhinst.updateTriggerClicked"))this.updateTriggerClicked({type:"triggerclicked"},e,t.target);else if(-1!==e.onclick.indexOf("notificationsLHC.sendNotification"));else if(-1!==e.onclick.indexOf("lhinst.buttonClicked"))this.updateTriggerClicked({type:""},e,t.target);else if(-1!==e.onclick.indexOf("lhinst.updateChatClicked"))this.updateTriggerClicked({type:"",mainType:"updatebuttonclicked"},e,t.target);else if(-1!==e.onclick.indexOf("lhinst.editGenericStep"))this.updateTriggerClicked({type:"editgenericstep"},e,t.target);else if(-1!==e.onclick.indexOf("lhinst.dropdownClicked")){var n=document.getElementById("id_generic_list-"+e["data-id"]);n&&"0"!=n.value&&""!=n.value?(e["data-payload"]=n.value,this.updateTriggerClicked({type:"valueclicked"},e,t.target)):alert(a("bot.please_choose"))}else helperFunctions.emitEvent("MessageClick",[e,this.props.dispatch]),console.log("Unknown click event: "+e.onclick);t.preventDefault()}},{key:"updateTriggerClicked",value:function(e,t,a){this.props.setBotPayload({type:e.type,payload:t["data-payload"],id:t["data-id"],processed:void 0===t["data-keep"]})}},{key:"processBotAction",value:function processBotAction(domNode){var attr=domNode.attribs;"lhinst.disableVisitorEditor"==attr["data-bot-action"]?this.disableEditor=!0:"lhinst.setDelay"==attr["data-bot-action"]||"execute-js"==attr["data-bot-action"]&&eval(domNode.children[0].data)}},{key:"render",value:function(){var e=this;return html_react_parser__WEBPACK_IMPORTED_MODULE_8___default()(this.props.content,{replace:function(t){if(t.attribs){var a=Object.assign({},t.attribs);if(t.attribs.onclick&&delete t.attribs.onclick,t.name&&"button"===t.name){if(a.onclick)return react__WEBPACK_IMPORTED_MODULE_7__.createElement("button",_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},t.attribs,{onClick:function(t){return e.abstractClick(a,t)}}),(0,html_react_parser__WEBPACK_IMPORTED_MODULE_8__.domToReact)(t.children))}else if(t.name&&"a"===t.name){if(a.onclick)return react__WEBPACK_IMPORTED_MODULE_7__.createElement("a",_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},t.attribs,{onClick:function(t){return e.abstractClick(a,t)}}),(0,html_react_parser__WEBPACK_IMPORTED_MODULE_8__.domToReact)(t.children))}else t.name&&"script"===t.name&&t.attribs["data-bot-action"]&&e.processBotAction(t)}}})}}]),ChatBotIntroMessage}(react__WEBPACK_IMPORTED_MODULE_7__.PureComponent);__webpack_exports__.Z=ChatBotIntroMessage},5198:function(e,t,a){"use strict";var n=a(4575),i=a.n(n),r=a(3913),s=a.n(r),o=a(1506),c=a.n(o),l=a(2205),d=a.n(l),u=a(8585),h=a.n(u),p=a(9754),_=a.n(p),g=a(7294),f=a(7139),m=a(6512),v=a(6458);var w=function(e){d()(r,e);var t,a,n=(t=r,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=_()(t);if(a){var i=_()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return h()(this,e)});function r(e){var t;return i()(this,r),(t=n.call(this,e)).onchangeAttr=t.onchangeAttr.bind(c()(t)),t.onchangeAttrProduct=t.onchangeAttrProduct.bind(c()(t)),t}return s()(r,[{key:"onchangeAttr",value:function(e){this.props.onChangeContent({id:"DepartamentID",value:e.value}),!0===this.props.departments.getIn(["settings","product_by_department"])&&this.props.dispatch((0,m.Xp)({dep_id:e.value}))}},{key:"onchangeAttrProduct",value:function(e){this.props.onChangeContent({id:"ProductID",value:e.value})}},{key:"componentDidMount",value:function(){!0!==this.props.departments.getIn(["settings","product"])||!0!==this.props.departments.getIn(["settings","product_by_department"])&&!this.props.departments.has("products")||this.props.onChangeContent({id:"HasProductID",value:!0}),0!=this.props.departments.get("departments").size&&(1!=this.props.departments.get("departments").size&&this.props.departments.hasIn(["settings","optional"])?this.props.departments.get("departments").size>1&&this.onchangeAttr({value:-1}):this.onchangeAttr({value:this.props.setDefaultValue||this.props.departments.getIn(["departments",0]).get("value")}))}},{key:"render",value:function(){var e=this,t=this.props.t,a=null;if(this.props.departments.get("departments").size>1&&!this.props.departments.hasIn(["settings","hide_department"])){var n=["form-control","form-control-sm"];!0===this.props.isInvalid&&n.push("is-invalid");var i=this.props.departments.get("departments").map((function(e){return g.createElement("option",{key:"dep-"+e.get("value"),value:e.get("value")},e.get("name")," ",e.get("online")?"":t("department.offline"))}));a=g.createElement("div",{className:"form-group"},g.createElement("label",{className:"control-label"},this.props.departments.getIn(["settings","label"]),"*"),g.createElement("select",{id:"id-department-field",defaultValue:this.props.setDefaultValue||this.props.defaultValueField,className:n.join(" "),onChange:function(t){return e.onchangeAttr({value:t.target.value})}},this.props.departments.hasIn(["settings","optional"])&&g.createElement("option",{value:"-1"},this.props.departments.getIn(["settings","optional"])),i))}var r=null;if(!0===this.props.departments.getIn(["settings","product"])){var s=["form-control","form-control-sm"];!0===this.props.isInvalidProduct&&s.push("is-invalid");var o=this.props.departments.has("products")?this.props.departments.get("products").map((function(e){return g.createElement("option",{key:"product-"+e.get("value"),value:e.get("value")},e.get("name"))})):"";this.props.departments.has("products")&&this.props.departments.get("products").size>0&&(r=g.createElement("div",{className:"form-group"},g.createElement("label",{className:"control-label"},t("department.product"),!0===this.props.departments.getIn(["settings","product_required"])?"*":""),g.createElement("select",{className:s.join(" "),onChange:function(t){return e.onchangeAttrProduct({value:t.target.value})}},g.createElement("option",{value:""},t("department.choose_a_product")),o)))}return null!==r||null!==a?g.createElement("div",{className:"col-12"},a,r):null}}]),r}(g.Component);t.Z=(0,v.$j)()((0,f.Z)()(w))},7786:function(e,t,a){"use strict";var n=a(4575),i=a.n(n),r=a(3913),s=a.n(r),o=a(1506),c=a.n(o),l=a(2205),d=a.n(l),u=a(8585),h=a.n(u),p=a(9754),_=a.n(p),g=a(9713),f=a.n(g),m=a(7294),v=a(7139);var w=function(e){d()(r,e);var t,a,n=(t=r,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=_()(t);if(a){var i=_()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return h()(this,e)});function r(e){var t;return i()(this,r),t=n.call(this,e),f()(c()(t),"state",{hiddenIfPrefilled:!1}),t.onchangeAttr=t.onchangeAttr.bind(c()(t)),t.onFileAdded=t.onFileAdded.bind(c()(t)),t}return s()(r,[{key:"onchangeAttr",value:function(e){if(this.props.onChangeContent({id:this.props.field.get("name"),value:e.value,field:this.props.field}),"dropdown"==this.props.field.get("type")){var t=parseInt(e.target.options[e.target.selectedIndex].getAttribute("dep-id"));t>0&&this.props.onChangeContent({id:"DepartamentID",value:t,subject_id:e.target.options[e.target.selectedIndex].getAttribute("subject-id")})}}},{key:"onFileAdded",value:function(e){for(var t=this,a=e.target.files,n=[],i=0;it.props.field.get("fs")&&o.push(e.name+": "+s("file.to_big_file"))})),o.length>0?alert(o.join("\n")):this.props.onChangeContent({id:this.props.field.get("name"),value:n[0],field:this.props.field})}},{key:"componentDidMount",value:function(){var e=this;"checkbox"==this.props.field.get("type")&&1==this.props.field.get("default")?this.props.onChangeContent({id:this.props.field.get("name"),value:!0}):"dropdown"==this.props.field.get("type")&&(this.props.onChangeContent({id:this.props.field.get("name"),value:this.props.defaultValueField}),this.props.field.get("options").map((function(t){t.get("value")==e.props.defaultValueField&&t.get("dep_id")&&e.props.onChangeContent({set_default:!0,id:"DepartamentID",subject_id:t.has("subject_id")?t.get("subject_id"):null,value:t.get("dep_id")})}))),this.props.attrPrefill&&this.props.attrPrefill.attr_prefill_admin&&this.props.attrPrefill.attr_prefill_admin.forEach((function(t){(t.index==e.props.field.get("identifier")||e.props.field.has("identifier_prefill")&&t.index==e.props.field.get("identifier_prefill"))&&(e.props.onChangeContent({id:e.props.field.get("name"),value:t.value}),e.props.field.has("hide_prefilled")&&1==e.props.field.get("hide_prefilled")&&!1===e.props.isInvalid&&e.setState({hiddenIfPrefilled:!0}))}))}},{key:"render",value:function(){var e=this;if(!0===this.state.hiddenIfPrefilled&&!0!==this.props.isInvalid)return null;var t="col-"+this.props.field.get("width"),a=!0===this.props.field.get("required"),n=[];if(""!=this.props.field.get("class")&&n.push(this.props.field.get("class")),!0===this.props.isInvalid&&n.push("is-invalid"),"text"==this.props.field.get("type"))return m.createElement("div",{className:t},m.createElement("div",{className:"form-group"},m.createElement("label",{className:"control-label"},this.props.field.get("label"),!0===a?"*":""),m.createElement("input",{type:"text",className:n.join(" "),required:a,onChange:function(t){return e.onchangeAttr({value:t.target.value})},name:this.props.field.get("name"),defaultValue:this.props.defaultValueField,placeholder:this.props.field.get("placeholder")})));if("password"==this.props.field.get("type"))return m.createElement("div",{className:t},m.createElement("div",{className:"form-group"},m.createElement("label",{className:"control-label"},this.props.field.get("label"),!0===a?"*":""),m.createElement("input",{type:"password",autocomplete:"new-password",className:n.join(" "),required:a,onChange:function(t){return e.onchangeAttr({value:t.target.value})},name:this.props.field.get("name"),defaultValue:this.props.defaultValueField,placeholder:this.props.field.get("placeholder")})));if("textarea"==this.props.field.get("type"))return m.createElement("div",{className:t},m.createElement("div",{className:"form-group"},!this.props.chatUI.has("hide_message_label")&&"question"==this.props.field.get("identifier")&&m.createElement("label",{className:"control-label"},this.props.field.get("label"),!0===a?"*":""),m.createElement("textarea",{className:n.join(" "),required:a,onChange:function(t){return e.onchangeAttr({value:t.target.value})},name:this.props.field.get("name"),defaultValue:this.props.defaultValueField,placeholder:this.props.field.get("placeholder")})));if("file"==this.props.field.get("type"))return m.createElement("div",{className:t},m.createElement("div",{className:"form-group overflow-hidden"},m.createElement("label",{className:"control-label"},this.props.field.get("label"),!0===a?"*":""),m.createElement("input",{type:"file",onChange:function(t){return e.onFileAdded(t)},className:this.props.field.get("class"),required:a,name:this.props.field.get("name")})));if("checkbox"==this.props.field.get("type"))return m.createElement("div",{className:t},m.createElement("div",{className:"form-group"},m.createElement("div",{className:"form-check"},m.createElement("input",{className:n.join(" "),id:"check-for-"+this.props.field.get("name"),defaultChecked:this.props.field.get("default"),type:"checkbox",value:"on",onChange:function(t){return e.onchangeAttr({value:t.target.checked})},required:a,name:this.props.field.get("name")}),m.createElement("label",{className:"form-check-label",for:"check-for-"+this.props.field.get("name"),dangerouslySetInnerHTML:{__html:this.props.field.get("label")}}))));if("hidden"==this.props.field.get("type"))return m.createElement("input",{type:"hidden",className:n.join(" "),required:a,onChange:function(t){return e.onchangeAttr({value:t.target.value})},name:this.props.field.get("name"),defaultValue:this.props.defaultValueField,placeholder:this.props.field.get("placeholder")});if("dropdown"==this.props.field.get("type")){var i=this.props.field.get("options").map((function(t){return m.createElement("option",{key:"opt-drop-"+t.get("value"),"subject-id":t.has("subject_id")?t.get("subject_id"):null,"dep-id":t.get("dep_id"),selected:e.props.defaultValueField==t.get("value"),value:t.get("value")},t.get("name"))}));return m.createElement("div",{className:t},m.createElement("div",{className:"form-group"},m.createElement("label",{className:"control-label"},this.props.field.get("label"),!0===a?"*":""),m.createElement("select",{className:n.join(" "),required:a,onChange:function(t){return e.onchangeAttr({target:t.target,value:t.target.value})},name:this.props.field.get("name"),defaultValue:this.props.defaultValueField},i)))}return console.log("Unknown field"),null}}]),r}(m.Component);t.Z=(0,v.Z)()(w)},2446:function(e,t,a){"use strict";var n=a(7154),i=a.n(n),r=a(4575),s=a.n(r),o=a(3913),c=a.n(o),l=a(1506),d=a.n(l),u=a(2205),h=a.n(u),p=a(8585),_=a.n(p),g=a(9754),f=a.n(g),m=a(9713),v=a.n(m),w=a(7294),y=a(9669),b=a.n(y),E=a(488),I=a.n(E),D=a(7139),S=a(298),T=a.n(S);var C=function(e){h()(o,e);var t,n,r=(t=o,n=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,a=f()(t);if(n){var i=f()(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return _()(this,e)});function o(e){var t;return s()(this,o),t=r.call(this,e),v()(d()(t),"state",{body:null}),v()(d()(t),"dismissModal",(function(e){t.props.toggle(),e&&e.stopPropagation()})),v()(d()(t),"generalOnClick",(function(e){var a=t.props.t,n=e["data-bb-code"];if(e["data-promt"]&&"img"==e["data-promt"])(i=prompt(a("bbcode.img_link")))&&(n="["+n+"]"+i+"[/"+n+"]");else if(e["data-promt"]&&"url"==e["data-promt"]){var i;(i=prompt(a("bbcode.link")))&&(n="[url="+i+"]"+a("bbcode.link_here")+"[/url]")}t.props.insertText(n),t.props.toggle()})),v()(d()(t),"generalDataActionClick",(function(e,a){e["data-action"]&&t.props[e["data-action"]]&&t.props[e["data-action"]](e["data-action-arg"]||null),a&&a.stopPropagation()})),t}return c()(o,[{key:"componentDidMount",value:function(){var e=this;b().get(window.lhcChat.base_url+this.props.dataUrl).then((function(t){e.setState({body:t.data});var n=document.getElementById("dialog-content"),i=a(2767),r=n.querySelectorAll('[data-bs-toggle="tab"]');if(r.length>0){var s=0;Array.prototype.forEach.call(r,(function(e){e.tabItem=new i(e)}));var o=new(T())(".tab-content");o.onSwipeLeft((function(){s=s0?s-1:r.length-1,r[s].tabItem.show()}))}})).catch((function(e){console.log(e)}))}},{key:"render",value:function(){var e=this;return w.createElement(w.Fragment,null,null!==this.state.body&&w.createElement("div",{className:"fade modal-backdrop show"}),null!==this.state.body&&w.createElement("div",{role:"dialog",id:"dialog-content","aria-modal":"true",className:"fade modal show d-block",tabIndex:"-1"},I()(this.state.body,{replace:function(t){if(t.attribs&&"react-close-modal"===t.attribs.id)return w.createElement("button",{type:"button",className:"btn-close float-end","data-bs-dismiss":"modal",onClick:e.dismissModal,"aria-label":"Close"});if(t.attribs&&t.attribs.linkaction)return t.attribs.class&&(t.attribs.className=t.attribs.class,delete t.attribs.class),w.createElement("a",i()({},t.attribs,{onClick:function(a){return e.generalDataActionClick(t.attribs,a)}}),(0,E.domToReact)(t.children));if(t.attribs&&t.attribs.bbitem)return t.attribs.class&&(t.attribs.className=t.attribs.class,delete t.attribs.class),w.createElement("a",i()({},t.attribs,{onClick:function(a){return e.generalOnClick(t.attribs)}}),(0,E.domToReact)(t.children));if(t.type&&"tag"===t.type&&t.name&&"input"==t.name&&t.attribs&&t.attribs.type&&"button"==t.attribs.type)return t.attribs.class&&(t.attribs.className=t.attribs.class,delete t.attribs.class),w.createElement("input",i()({},t.attribs,{onClick:function(a){return e.generalDataActionClick(t.attribs,a)}}));if(t.type&&"script"===t.type){if(t.children.length>0)setTimeout((function(){var e=document.createElement("script");e.appendChild(document.createTextNode(t.children[0].data)),document.getElementsByTagName("head").item(0).appendChild(e)}),500);else if(t.attribs&&t.attribs.src){var a=document.createElement("script");a.src=t.attribs.src,a.type="text/javascript",document.getElementsByTagName("head").item(0).appendChild(a)}return w.createElement(w.Fragment,null)}}})))}}]),o}(w.PureComponent);t.Z=(0,D.Z)()(C)},9702:function(e,t,a){"use strict";a.d(t,{Z:function(){return N}});var n=a(4575),i=a.n(n),r=a(3913),s=a.n(r),o=a(1506),c=a.n(o),l=a(2205),d=a.n(l),u=a(8585),h=a.n(u),p=a(9754),_=a.n(p),g=a(9713),f=a.n(g),m=a(7294),v=a(6458),w=a(7139),y=a(7786),b=a(3038),E=a.n(b);var I=function(e){d()(r,e);var t,a,n=(t=r,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=_()(t);if(a){var i=_()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return h()(this,e)});function r(e){return i()(this,r),n.call(this,e)}return s()(r,[{key:"render",value:function(){var e=this.props.errors.mapEntries((function(e){var t=E()(e,2),a=t[0],n=t[1];if("captcha"==a||"blocked_user"==a||!isNaN(a))return[m.createElement("li",null,n)]}));return e.size>0?m.createElement("div",{"data-alert":"",className:"mt-2 alert alert-danger alert-dismissible fade show"},m.createElement("ul",{className:"ps-1 m-0"},e)):null}}]),r}(m.Component),D=a(5198),S=a(2446);var T=function(e){d()(o,e);var t,n,r=(t=o,n=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,a=_()(t);if(n){var i=_()(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return h()(this,e)});function o(e){return i()(this,o),r.call(this,e)}return s()(o,[{key:"componentDidMount",value:function(){new(a(208))(document.getElementById("chat-dropdown-options"))}},{key:"render",value:function(){var e=this,t=this.props.t;return m.createElement("div",{className:"btn-group dropup disable-select ps-2 pt-2"},m.createElement("i",{className:"material-icons settings text-muted",id:"chat-dropdown-options","data-bs-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},""),m.createElement("div",{className:"dropdown-menu shadow bg-white lhc-dropdown-menu rounded ms-1"},m.createElement("div",{className:"d-flex flex-row px-1"},this.props.bbEnabled&&m.createElement("a",{onClick:function(t){return e.props.toggleModal()},title:t("button.bb_code")},m.createElement("i",{className:"material-icons chat-setting-item text-muted me-0 bbcode-ico"},"")),this.props.langEnabled&&m.createElement("a",{onClick:this.props.changeLanguage,title:t("button.lang")},m.createElement("i",{className:"material-icons chat-setting-item text-muted me-0 lang-ico"},"")))))}}]),o}(m.PureComponent),C=(0,w.Z)()(T),k=a(2137),O=a(5918);var A,x=function(e){d()(r,e);var t,a,n=(t=r,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=_()(t);if(a){var i=_()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return h()(this,e)});function r(e){return i()(this,r),n.call(this,e)}return s()(r,[{key:"componentDidMount",value:function(){k.a.sendMessageParent("readInvitation",[{name:this.props.invitation.invitation_name||"Manual"}])}},{key:"render",value:function(){return"message"==this.props.mode?m.createElement(m.Fragment,null,this.props.invitation.prev_msg&&m.createElement(O.Z,{setBotPayload:this.props.setBotPayload,content:this.props.invitation.prev_msg}),this.props.invitation.message&&m.createElement("div",{className:"message-row message-admin"},m.createElement("span",{className:"usr-tit op-tit"},m.createElement("i",{title:this.props.invitation.name_support||this.props.invitation.extra_profile,className:"chat-operators mi-fs15 me-0"},this.props.invitation.bubble&&this.props.invitation.photo&&m.createElement("img",{src:this.props.invitation.photo,alt:"",className:"profile-msg-pic"}),(!this.props.invitation.photo||!this.props.invitation.bubble)&&m.createElement("i",{className:"material-icons "+(this.props.invitation.bubble?"icon-assistant me-0":"")},"")),!this.props.invitation.bubble&&(this.props.invitation.name_support||this.props.invitation.extra_profile)),m.createElement("div",{className:"msg-body",dangerouslySetInnerHTML:{__html:this.props.invitation.message}})),this.props.invitation.message_full&&m.createElement(O.Z,{setBotPayload:this.props.setBotPayload,content:this.props.invitation.message_full})):m.createElement(m.Fragment,null,m.createElement("div",{id:"lhc-profile-body"},m.createElement("div",{id:"chat-status-container",className:"operator-info d-flex border-bottom p-2"},m.createElement("div",null,this.props.invitation.photo&&m.createElement("img",{width:"48",height:"48",src:this.props.invitation.photo,title:this.props.invitation.photo_title,alt:""}),!this.props.invitation.photo&&m.createElement("i",{className:"icon-assistant material-icons me-0"},"")),m.createElement("div",{className:"p-1 ps-2 w-100"},this.props.invitation.name_support&&!this.props.invitation.hide_name&&m.createElement("div",{className:"fw-bold"},this.props.invitation.name_support),this.props.invitation.extra_profile&&m.createElement("div",{dangerouslySetInnerHTML:{__html:this.props.invitation.extra_profile}})))),"profile_only"!=this.props.mode&&this.props.invitation.message&&m.createElement("div",{id:"messagesBlock"},m.createElement("div",{className:"bottom-message position-relative"},m.createElement("div",{className:"message-row message-admin pt-1 text-left ms-3"},m.createElement("div",{className:"msg-body",dangerouslySetInnerHTML:{__html:this.props.invitation.message}})))))}}]),r}(m.PureComponent),M=a(6313),P=a(6512);function L(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function R(e){for(var t=1;t0&&this.props.chatwidget.getIn(["onlineData","department","departments"]).map((function(a){a.get("value")==e.value&&(0==a.get("online")&&(t.props.dispatch({type:"dep_default",data:e.value}),t.props.dispatch({type:"onlineStatus",data:!1})),t.props.chatwidget.getIn(["onlineData","dep_forms"])!=e.value&&t.updateOnlineFieldsInit(e.value))}))),"Question"==e.id&&(!0===this.props.chatwidget.getIn(["proactive","has"])&&""!=e.value&&1===this.props.chatwidget.getIn(["chat_ui","proactive_once_typed"])&&1===this.props.chatwidget.getIn(["chat_ui","custom_html_priority"])?(this.props.dispatch({type:"attr_set",attr:["chat_ui","custom_html_priority"],data:0}),this.customHTMLPriority=!0):""==e.value&&1==this.customHTMLPriority&&this.props.dispatch({type:"attr_set",attr:["chat_ui","custom_html_priority"],data:1}))}},{key:"handleContentChangeCustom",value:function(e){this.props.dispatch({type:"CUSTOM_FIELDS_ITEM",data:{id:e.field.get("index"),value:e.value}})}},{key:"componentDidMount",value:function(){k.a.prefillFields(this),this.updateOnlineFields(),null!==this.props.botPayload&&this.setBotPayload(this.props.botPayload);var e=document.getElementById("CSChatMessage-tmp");null!==e&&document.body.removeChild(e)}},{key:"componentWillUnmount",value:function(){var e=document.getElementById("messagesBlock");null!==e&&this.props.setMessages(e.innerHTML);var t=document.getElementById("lhc-profile-body");null!==t&&this.props.setProfile(t.innerHTML);var a=document.getElementById("CSChatMessage");null===a?this.props.setHideMessageField(!0):(this.props.setHideMessageField(!1),a.id="CSChatMessage-tmp",a.style.cssText="position:absolute;left:-999px;bottom:0px;",document.body.appendChild(a))}},{key:"setBotPayload",value:function(e){this.botPayload=e,this.handleSubmit()}},{key:"updateOnlineFieldsInit",value:function(e){this.props.dispatch((0,P.El)({department:this.props.chatwidget.get("department"),product:this.props.chatwidget.get("product"),theme:this.props.chatwidget.get("theme"),mode:this.props.chatwidget.get("mode"),pvhash:this.props.chatwidget.get("pvhash"),phash:this.props.chatwidget.get("phash"),bot_id:this.props.chatwidget.get("bot_id"),trigger_id:this.props.chatwidget.get("trigger_id"),vid:this.props.chatwidget.get("vid"),dep_default:e||this.props.chatwidget.get("departmentDefault")||0,online:1,chat_ui:this.props.chatwidget.get("chat_ui")}))}},{key:"updateOnlineFields",value:function(){!1===this.props.chatwidget.getIn(["onlineData","fetched"])&&this.updateOnlineFieldsInit()}},{key:"componentDidUpdate",value:function(e,t,a){this.updateOnlineFields(),document.getElementById("id-container-fluid")&&k.a.sendMessageParent("widgetHeight",[{height:document.getElementById("id-container-fluid").offsetHeight+40}]);var n=!1;if(!1===this.apiLoaded&&null!==this.props.chatwidget.get("api_data")&&(this.apiLoaded=!0,this.setState(R(R({},this.state),this.props.chatwidget.get("api_data"))),n=!0),(!0===n||0==this.props.chatwidget.get("isMobile")&&!1===e.chatwidget.get("shown")&&!0===this.props.chatwidget.get("shown"))&&"widget"==this.props.chatwidget.get("mode")&&this.textMessageRef.current&&(this.textMessageRef.current.focus(),this.scrollBottom()),!0===this.props.chatwidget.getIn(["onlineData","fetched"])&&!1===e.chatwidget.getIn(["onlineData","fetched"])&&(this.props.chatwidget.hasIn(["chat_ui","uprev"])&&k.a.emitEvent("play_sound",[{type:"new_message",sound_on:!0===this.props.chatwidget.getIn(["usersettings","soundOn"]),widget_open:this.props.chatwidget.get("shown")&&"widget"==this.props.chatwidget.get("mode")||document.hasFocus()}]),this.scrollBottom()),this.props.chatwidget.get("departmentDefault")!==e.chatwidget.get("departmentDefault")){this.setState({DepartamentID:this.props.chatwidget.get("departmentDefault")});var i=document.getElementById("id-department-field");null!==i&&(i.value=this.props.chatwidget.get("departmentDefault")),this.updateOnlineFieldsInit()}}},{key:"scrollBottom",value:function(){var e=this;this.messagesAreaRef.current&&(this.messagesAreaRef.current.scrollTop=this.messagesAreaRef.current.scrollHeight+1e3,setTimeout((function(){e.messagesAreaRef.current&&(e.messagesAreaRef.current.scrollTop=e.messagesAreaRef.current.scrollHeight+1e3)}),450))}},{key:"moveCaretAtEnd",value:function(e){var t=e.target.value;e.target.value="",e.target.value=t}},{key:"render",value:function(){var e=this,t=this.props.t;if(!0===this.props.chatwidget.getIn(["onlineData","fetched"])&&!0===this.props.chatwidget.getIn(["onlineData","disabled"]))return m.createElement("div",{className:"alert alert-danger m-2",role:"alert"},t("start_chat.cant_start_a_chat"));if(!1===this.props.chatwidget.getIn(["onlineData","fetched"])||!0===this.props.chatwidget.getIn(["chat_ui","auto_start"]))return null;if(this.props.chatwidget.getIn(["onlineData","fields"]).size>0&&(!this.props.chatwidget.hasIn(["chat_ui","show_messages_box"])||1!=this.props.chatwidget.getIn(["onlineData","fields_visible"])||0!=this.props.chatwidget.getIn(["customData","fields"]).size))var a=this.props.chatwidget.getIn(["onlineData","fields"]).map((function(t){return m.createElement(y.Z,{chatUI:e.props.chatwidget.get("chat_ui"),key:t.get("identifier"),isInvalid:e.props.chatwidget.hasIn(["validationErrors",t.get("identifier")]),defaultValueField:e.state[t.get("name")]||t.get("value"),attrPrefill:{attr_prefill_admin:e.props.chatwidget.get("attr_prefill_admin"),attr_prefill:e.props.chatwidget.get("attr_prefill")},onChangeContent:e.handleContentChange,field:t})}));else a="";var n=!1,i="";if(this.props.chatwidget.getIn(["customData","fields"]).size>0&&(this.props.chatwidget.getIn(["customData","fields"]).map((function(e){return n=!e.has("type")||"hidden"!==e.get("type")||n})),1==n&&(i=this.props.chatwidget.getIn(["customData","fields"]).map((function(t){return m.createElement(y.Z,{chatUI:e.props.chatwidget.get("chat_ui"),key:t.get("identifier"),isInvalid:e.props.chatwidget.hasIn(["validationErrors",t.get("identifier")]),defaultValueField:t.get("value"),onChangeContent:e.handleContentChangeCustom,field:t})})))),this.props.chatwidget.hasIn(["onlineData","paid","error"])&&this.props.chatwidget.getIn(["onlineData","paid","error"]))return m.createElement("p",{className:"p-2"},this.props.chatwidget.getIn(["onlineData","paid","message"]));if(0==this.props.chatwidget.get("processStatus")||1==this.props.chatwidget.get("processStatus")){if(this.props.chatwidget.hasIn(["chat_ui","show_messages_box"])&&this.props.chatwidget.getIn(["onlineData","department","departments"]).size<=1&&this.props.chatwidget.getIn(["onlineData","fields_visible"])<=1&&(0==this.props.chatwidget.getIn(["customData","fields"]).size||!1===n)){var r="ps-0 no-outline form-control rounded-0 form-control rounded-start-0 rounded-end-0 border-0 "+(!0===this.props.chatwidget.get("shown")&&this.textMessageRef.current&&(/\r|\n/.exec(this.state.Question)||this.state.Question.length>this.textMessageRef.current.offsetWidth/8.6)?"msg-two-line":"msg-one-line"),s="flex-grow-1 overflow-scroll position-relative",o="bottom-message px-1";return this.props.chatwidget.hasIn(["chat_ui","msg_expand"])&&"embed"==this.props.chatwidget.get("mode")&&(s="overflow-scroll position-relative",o+=" position-relative"),this.props.chatwidget.getIn(["chat_ui","disabled"])?m.createElement(M.Z,{closeText:t("button.close"),full_height:!0,close:function(t){return e.props.dispatch((0,P.H7)(!0))},as_html:!0,text:this.props.chatwidget.getIn(["chat_ui","disabled"])}):m.createElement(m.Fragment,null,this.state.showBBCode&&m.createElement(S.Z,{showModal:this.state.showBBCode,insertText:this.insertText,toggle:this.toggleModal,dataUrl:"/chat/bbcodeinsert?react=1"}),this.state.changeLanguage&&m.createElement(S.Z,{showModal:this.state.changeLanguage,setLanguage:this.setLanguageAction,toggle:this.changeLanguage,dataUrl:"/widgetrestapi/chooselanguage"}),this.props.chatwidget.hasIn(["validationErrors","blocked_user"])&&m.createElement(M.Z,{closeText:t("button.close"),as_html:!0,close:function(t){return e.props.dispatch((0,P.H7)(!0))},text:this.props.chatwidget.getIn(["validationErrors","blocked_user"])}),!0===this.props.chatwidget.getIn(["proactive","has"])&&!this.props.chatwidget.hasIn(["proactive","data","std_header"])&&m.createElement(x,{mode:"profile_only",invitation:this.props.chatwidget.getIn(["proactive","data"])})||(this.props.chatwidget.hasIn(["chat_ui","pre_chat_html"])||this.props.chatwidget.hasIn(["chat_ui","operator_profile"])&&""!=this.props.chatwidget.getIn(["chat_ui","operator_profile"]))&&m.createElement("div",{id:"lhc-profile-body"},m.createElement("div",{id:"chat-status-container",className:"p-2 border-bottom",dangerouslySetInnerHTML:{__html:(this.props.chatwidget.hasIn(["chat_ui","pre_chat_html"])?this.props.chatwidget.getIn(["chat_ui","pre_chat_html"]):"")+(this.props.chatwidget.hasIn(["chat_ui","operator_profile"])?this.props.chatwidget.getIn(["chat_ui","operator_profile"]):"")}})),m.createElement("div",{className:s,id:"messagesBlock"},m.createElement("div",{className:o,id:"messages-scroll",ref:this.messagesAreaRef},!0===this.props.chatwidget.getIn(["proactive","has"])&&!this.props.chatwidget.getIn(["chat_ui","custom_html_priority"])&&m.createElement(x,{mode:"message",setBotPayload:this.setBotPayload,invitation:this.props.chatwidget.getIn(["proactive","data"])}),!this.props.chatwidget.getIn(["proactive","has"])&&this.props.chatwidget.hasIn(["chat_ui","cmmsg_widget"])&&m.createElement(O.Z,{setBotPayload:this.setBotPayload,content:this.props.chatwidget.getIn(["chat_ui","cmmsg_widget"])}),1==this.props.chatwidget.get("processStatus")&&""!=this.state.Question&&m.createElement("div",{"data-op-id":"0",className:"message-row response"},m.createElement("div",{className:"msg-date"}),m.createElement("span",{title:"",className:"usr-tit vis-tit"},m.createElement("i",{title:t("start_chat.visitor"),className:"material-icons chat-operators mi-fs15 me-0"},""),m.createElement("span",{className:"user-nick-title"},t("start_chat.visitor"))),m.createElement("div",{className:"msg-body"},this.state.Question)))),(!this.props.chatwidget.getIn(["proactive","has"])||1===this.props.chatwidget.getIn(["chat_ui","custom_html_priority"]))&&this.props.chatwidget.hasIn(["chat_ui","custom_html_widget"])&&m.createElement("div",{className:"custom-html-container "+(""!=this.state.Question?"visitor-started-type":""),dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","custom_html_widget"])}}),(1==this.props.chatwidget.getIn(["onlineData","fields_visible"])||0==this.props.chatwidget.getIn(["onlineData","fields_visible"])&&!this.props.chatwidget.hasIn(["chat_ui","hstr_btn"]))&&m.createElement("div",{className:"d-flex flex-row border-top position-relative message-send-area"},this.props.chatwidget.hasIn(["validationErrors","question"])&&m.createElement("div",{id:"id-operator-typing",className:"bg-white ps-1"},this.props.chatwidget.getIn(["validationErrors","question"])),1==this.props.chatwidget.getIn(["onlineData","fields_visible"])&&m.createElement(m.Fragment,null,(!this.props.chatwidget.hasIn(["chat_ui","bbc_btnh"])||this.props.chatwidget.hasIn(["chat_ui","lng_btnh"]))&&m.createElement(C,{bbEnabled:!this.props.chatwidget.hasIn(["chat_ui","bbc_btnh"]),langEnabled:this.props.chatwidget.hasIn(["chat_ui","lng_btnh"]),changeLanguage:this.changeLanguage,toggleModal:this.toggleModal}),m.createElement("div",{className:"mx-auto w-100"},m.createElement("textarea",{autoFocus:0==this.props.chatwidget.get("isMobile")&&"widget"==this.props.chatwidget.get("mode")&&!0===this.props.chatwidget.get("shown"),onFocus:this.moveCaretAtEnd,maxLength:this.props.chatwidget.getIn(["chat_ui","max_length"]),"aria-label":"Type your message here...",id:"CSChatMessage",value:1==this.props.chatwidget.get("processStatus")?"":this.state.Question,placeholder:this.props.chatwidget.hasIn(["chat_ui","placeholder_message"])?this.props.chatwidget.getIn(["chat_ui","placeholder_message"]):t("chat.type_here"),onKeyDown:this.enterKeyDown,onChange:function(t){return e.handleContentChange({id:"Question",value:t.target.value})},ref:this.textMessageRef,rows:"1",className:r})),m.createElement("div",{className:"disable-select"},m.createElement("div",{className:"user-chatwidget-buttons pt-1",id:"ChatSendButtonContainer"},1!=this.props.chatwidget.get("processStatus")&&m.createElement("a",{onClick:this.handleSubmit,title:t("button.start_chat")},m.createElement("i",{className:"material-icons text-muted settings"},"")),1==this.props.chatwidget.get("processStatus")&&m.createElement("i",{className:"material-icons text-muted settings me-0"},"")))),0==this.props.chatwidget.getIn(["onlineData","fields_visible"])&&!this.props.chatwidget.hasIn(["chat_ui","hstr_btn"])&&m.createElement("button",{className:"mx-auto pb-1 w-100 btn btn-light rounded-0",onClick:this.handleSubmit,title:t("button.start_chat")},this.props.chatwidget.getIn(["chat_ui","custom_start_button"])||t("button.start_chat_With_us"))))}return m.createElement("div",{id:"id-container-fluid"},!0===this.props.chatwidget.getIn(["proactive","has"])&&m.createElement(x,{mode:"profile",invitation:this.props.chatwidget.getIn(["proactive","data"])})||this.props.chatwidget.hasIn(["chat_ui","operator_profile"])&&""!=this.props.chatwidget.getIn(["chat_ui","operator_profile"])&&m.createElement("div",{className:"p-2"+(this.props.chatwidget.hasIn(["chat_ui","np_border"])?"":" border-bottom"),dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","operator_profile"])}}),m.createElement("div",{className:"container-fluid"},m.createElement(I,{errors:this.props.chatwidget.get("validationErrors")}),!this.props.chatwidget.getIn(["proactive","has"])&&this.props.chatwidget.hasIn(["chat_ui","custom_html_widget"])&&m.createElement("div",{className:"custom-html-container",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","custom_html_widget"])}}),m.createElement("form",{onSubmit:this.handleSubmit},m.createElement("div",{className:"row pt-2"},a,i,this.props.chatwidget.hasIn(["onlineData","department"])&&m.createElement(D.Z,{defaultValueField:this.state.DepartamentID,setDefaultValue:this.props.chatwidget.get("departmentDefault"),onChangeContent:this.handleContentChange,isInvalidProduct:this.props.chatwidget.hasIn(["validationErrors","ProductID"]),isInvalid:this.props.chatwidget.hasIn(["validationErrors","department"]),departments:this.props.chatwidget.getIn(["onlineData","department"])})),(!this.props.chatwidget.hasIn(["chat_ui","hstr_btn"])||""!==i||""!==a||!0===this.props.chatwidget.getIn(["proactive","has"]))&&m.createElement("div",{className:"row"},m.createElement("div",{className:"col-12 pb-3"},m.createElement("button",{disabled:1==this.props.chatwidget.get("processStatus"),type:"submit",className:"btn btn-secondary btn-sm"},this.props.chatwidget.getIn(["chat_ui","custom_start_button"])||t("button.start_chat")))))))}return 2==this.props.chatwidget.get("processStatus")?m.createElement("div",{className:"container-fluid",id:"id-container-fluid"},m.createElement("div",{className:"row"},m.createElement("div",{className:"col-12"},m.createElement("p",null,t("start_chat.thank_you_for_feedback"))))):void 0}}],[{key:"getDerivedStateFromProps",value:function(e,t){if(e.chatwidget.getIn(["chat_ui","auto_start"])&&0==e.chatwidget.get("processStatus")&&("embed"==e.chatwidget.get("mode")||"popup"==e.chatwidget.get("mode")||"widget"==e.chatwidget.get("mode")&&1==e.chatwidget.get("shown"))){var a=t;a.jsvar=e.chatwidget.get("jsVars"),a["captcha_"+e.chatwidget.getIn(["captcha","hash"])]=e.chatwidget.getIn(["captcha","ts"]),a.tscaptcha=e.chatwidget.getIn(["captcha","ts"]),a.user_timezone=k.a.getTimeZone(),a.URLRefer=window.location.href.substring(window.location.protocol.length),a.r=e.chatwidget.get("ses_ref"),""!=e.chatwidget.get("bot_id")&&(a.bot_id=e.chatwidget.get("bot_id")),""!=e.chatwidget.get("subject_id")&&(a.subject_id=e.chatwidget.get("subject_id")),""!=e.chatwidget.get("trigger_id")&&(a.trigger_id=e.chatwidget.get("trigger_id")),""!=e.chatwidget.get("operator")&&(a.operator=e.chatwidget.get("operator")),null!==e.chatwidget.get("priority")&&(a.priority=e.chatwidget.get("priority")),null!==e.chatwidget.get("pvhash")&&(a.pvhash=e.chatwidget.get("pvhash")),null!==e.chatwidget.get("phash")&&(a.phash=e.chatwidget.get("phash"));var n=k.a.getCustomFieldsSubmit(e.chatwidget.getIn(["customData","fields"]));null!==n&&(a=R(R({},a),n)),null!==e.chatwidget.get("api_data")&&(a=R(R({},a),e.chatwidget.get("api_data")));var i={department:e.chatwidget.get("department"),theme:e.chatwidget.get("theme"),mode:e.chatwidget.get("mode"),vid:e.chatwidget.get("vid"),fields:a};null!==e.botPayload&&(i.bpayload=e.botPayload),!0===e.chatwidget.hasIn(["proactive","data","invitation_id"])&&(i.invitation_id=e.chatwidget.getIn(["proactive","data","invitation_id"])),e.dispatch((0,P.Ym)(i))}return null}}]),r}(m.Component))||A,N=(0,w.Z)()(B)},9944:function(e,t,a){"use strict";a.d(t,{XI:function(){return n},sk:function(){return i},pA:function(){return r},B4:function(){return s},pV:function(){return o},Pd:function(){return c}});var n=1,i=2,r=5,s=2,o=3,c=5},2137:function(e,t,a){"use strict";a.d(t,{a:function(){return o}});var n=a(4575),i=a.n(n),r=a(3913),s=a.n(r),o=new(function(){function e(){i()(this,e);var t,n=document.currentScript||(t=document.getElementsByTagName("script"))[t.length-1],r=a(4795);this.prefix=n.getAttribute("scope")||"lhc",this.prefixUppercase=this.prefix.toUpperCase(),this.eventEmitter=new r;try{this.hasSessionStorage=!!window.sessionStorage}catch(e){this.hasSessionStorage=!1}try{this.hasLocalStorage=!!window.localStorage}catch(e){this.hasLocalStorage=!1}}return s()(e,[{key:"emitEvent",value:function(e,t,a){this.eventEmitter.emitEvent(e,t)}},{key:"sendMessageParent",value:function(e,t){window.opener&&!1===window.opener.closed?window.opener.postMessage(this.prefix+"::"+e+"::"+JSON.stringify(t||null),"*"):window.parent&&!1===window.parent.closed&&window.parent.postMessage(this.prefix+"::"+e+"::"+JSON.stringify(t||null),"/"),"undefined"!=typeof LHCEventTracker&&LHCEventTracker(e,t)}},{key:"sendMessageParentDirect",value:function(e,t){var a=null;window.parent&&window.parent["$_"+this.prefixUppercase]&&!1===window.parent.closed?a=window.parent["$_"+this.prefixUppercase].eventListener:window.opener&&window.opener["$_"+this.prefixUppercase]&&!1===window.opener.closed&&(a=window.opener["$_"+this.prefixUppercase].eventListener),null!==a?a.emitEvent(e,t):this.sendMessageParent(e,t)}},{key:"setLocalStorage",value:function(e,t){if(this.hasLocalStorage&&localStorage.setItem)try{localStorage.setItem(this.prefix+e,t)}catch(e){}}},{key:"setSessionStorage",value:function(e,t){if(this.hasSessionStorage&&sessionStorage.setItem)try{sessionStorage.setItem(this.prefix+e,t)}catch(e){}}},{key:"getSessionStorage",value:function(e){return this.hasSessionStorage&&sessionStorage.getItem?sessionStorage.getItem(this.prefix+e):null}},{key:"getLocalStorage",value:function(e){return this.hasLocalStorage&&localStorage.getItem?localStorage.getItem(this.prefix+e):null}},{key:"removeSessionStorage",value:function(e){this.hasSessionStorage&&sessionStorage.removeItem&&sessionStorage.removeItem(this.prefix+e)}},{key:"removeLocalStorage",value:function(e){this.hasLocalStorage&&localStorage.removeItem&&localStorage.removeItem(this.prefix+e)}},{key:"getTimeZone",value:function(){try{var e=Intl.DateTimeFormat().resolvedOptions().timeZone;return"undefined"==e&&(e="UTC"),e}catch(e){var t=new Date;return(t.getTimezoneOffset()<(a=new Date(t.getFullYear(),0,1),n=new Date(t.getFullYear(),6,1),Math.max(a.getTimezoneOffset(),n.getTimezoneOffset()))?t.getTimezoneOffset():t.getTimezoneOffset()-60)/60*-1}var a,n}},{key:"getCustomFieldsSubmit",value:function(e){if(e.size>0){var t={name_items:[],values_req:[],value_items:[],value_types:[],encattr:[],value_show:[]};return e.forEach((function(e){t.value_items.push(e.get("value")),t.name_items.push(e.get("name")),t.values_req.push(!0===e.get("required")?"t":"f"),t.encattr.push(!0===e.get("encrypted")?"t":""),t.value_types.push(e.get("type")),t.value_show.push(e.get("show"))})),t}return null}},{key:"prefillFields",value:function(e){var t=e.props.chatwidget.get("attr_prefill");t.length>0&&t.forEach((function(t){e.setState(t)}))}},{key:"logJSError",value:function(e){var t;(t={}).location=location&&location.href?location.href:"",t.message=window.navigator.userAgent,t.stack=e.stack,t.stack=t.stack.replace(/(\r\n|\n|\r)/gm,"");var a=new XMLHttpRequest;a.open("POST",window.lhcChat.base_url+"audit/logjserror",!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send("data="+encodeURIComponent(JSON.stringify(t)))}}]),e}());window.lhcHelperfunctions=o},5501:function(e,t,a){"use strict";var n,i,r=a(7294),s=a(3935),o=a(4575),c=a.n(o),l=a(3913),d=a.n(l),u=a(2205),h=a.n(u),p=a(8585),_=a.n(p),g=a(9754),f=a.n(g),m=a(1506),v=a.n(m),w=a(9713),y=a.n(w),b=a(6458),E=a(6512),I=a(2137),D=a(9944),S=a(7139);var T=(n=(0,b.$j)((function(e){return{chatwidget:e.chatwidget}})),n(i=function(e){h()(s,e);var t,n,i=(t=s,n=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,a=f()(t);if(n){var i=f()(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return _()(this,e)});function s(e){var t;return c()(this,s),(t=i.call(this,e)).closeWidget=t.closeWidget.bind(v()(t)),t.endChat=t.endChat.bind(v()(t)),t.popup=t.popup.bind(v()(t)),t}return d()(s,[{key:"closeWidget",value:function(){this.props.dispatch((0,E.H7)())}},{key:"endChat",value:function(){this.props.endChat()}},{key:"popup",value:function(){this.props.popupChat()}},{key:"componentDidMount",value:function(){var e=document.getElementById("headerDropDown");e&&new(a(208))(e)}},{key:"render",value:function(){var e=this,t=this.props.t,a=!this.props.chatwidget.hasIn(["chat_ui","clinst"])||this.props.chatwidget.get("isMobile"),n=this.props.chatwidget.hasIn(["chat_ui","custom_html_header_body"]),i="row header-chat"+(1==this.props.chatwidget.get("isMobile")?" mobile-header":" desktop-header"),s=!this.props.chatwidget.hasIn(["chat_ui","hide_popup"]),o=!0===this.props.chatwidget.get("isChatting")&&!this.props.chatwidget.hasIn(["chat_ui","hide_close"]),c=0,l=this.props.chatwidget.hasIn(["chat_ui","header_buttons"])&&this.props.chatwidget.getIn(["chat_ui","header_buttons"]).map((function(n,i){var l=n.get("pos");if(l="left"==l?"start":"right"==l?"end":l,"min"==n.get("btn")&&a)return c++,r.createElement("a",{className:"minimize-icon header-link float-"+l,title:e.props.chatwidget.getIn(["chat_ui","min_text"])||t("button.minimize"),onClick:e.closeWidget},e.props.chatwidget.hasIn(["chat_ui","img_icon_min"])&&r.createElement("img",{className:"px-1",src:e.props.chatwidget.getIn(["chat_ui","img_icon_min"]),alt:""})||r.createElement("i",{className:"material-icons"},""));if("popup"==n.get("btn")&&s)return c++,r.createElement("a",{className:"header-link float-"+l,title:e.props.chatwidget.getIn(["chat_ui","popup_text"])||t("button.popup"),onClick:e.popup},e.props.chatwidget.hasIn(["chat_ui","img_icon_popup"])&&r.createElement("img",{className:"px-1",src:e.props.chatwidget.getIn(["chat_ui","img_icon_popup"]),alt:""})||r.createElement("i",{className:"material-icons"},""));if("close"==n.get("btn")&&o){var d=e.props.chatwidget.getIn(["chat_ui","end_chat_text"])||t("button.end_chat");return c++,r.createElement("a",{title:d,className:"header-link float-"+l,onClick:e.endChat},e.props.chatwidget.hasIn(["chat_ui","img_icon_close"])&&r.createElement("img",{className:"px-1",src:e.props.chatwidget.getIn(["chat_ui","img_icon_close"]),alt:""})||r.createElement("i",{className:"material-icons"},""),n.get("print")&&r.createElement("span",{className:"end-chat-text"},d))}}));return r.createElement("div",{id:"widget-header-content",className:i},n&&r.createElement("div",{className:"lhc-custom-header-inside",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","custom_html_header_body"])}}),c>0&&r.createElement("div",{className:"col-12 px-1"},l))}}]),s}(r.Component))||i),C=(0,S.Z)()(T),k=a(9702),O=a(488),A=a.n(O),x=a(7154),M=a.n(x),P=a(3038),L=a.n(P),R=a(2446);var B=r.lazy((function(){return a.e(536).then(a.bind(a,3536))})),N=function(e){h()(i,e);var t,a,n=(t=i,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 i=f()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return _()(this,e)});function i(e){var t;return c()(this,i),t=n.call(this,e),y()(v()(t),"state",{jsExecuted:!1,moreReactions:!1,reactToMessageId:0}),t.abstractClick=t.abstractClick.bind(v()(t)),t.imageLoaded=t.imageLoaded.bind(v()(t)),t.updateTriggerClicked=t.updateTriggerClicked.bind(v()(t)),t.disableEditor=!1,t.delayData=[],t}return d()(i,[{key:"addLoader",value:function(e,t){e["data-no-change"]||"button"!=e.type||(t.setAttribute("disabled","disabled"),t.innerHTML=''+t.innerHTML)}},{key:"abstractClick",value:function(e,t){var a=this,n=this.props.t;if(void 0===e.onchange){if(this.addLoader(e,t.target),e.onclick)if(-1!==e.onclick.indexOf("lhinst.updateTriggerClicked"))this.updateTriggerClicked({type:"/(type)/triggerclicked"},e,t.target);else if(-1!==e.onclick.indexOf("notificationsLHC.sendNotification"))this.props.dispatch((0,E.rN)()),t.target.innerHTML=n("notifications.subscribing"),setTimeout((function(){a.removeMetaMessage(e["data-id"])}),500);else if(-1!==e.onclick.indexOf("lhinst.moreReactions"))this.setState({moreReactions:!0,reactToMessageId:e["data-id"]}),t.stopPropagation();else if(-1!==e.onclick.indexOf("lhinst.reactionsToolbar"))this.props.setReactingTo(e["data-id"]!=this.props.reactToMessageId?e["data-id"]:0),t.stopPropagation();else if(-1!==e.onclick.indexOf("lhinst.reactionsClicked"))this.updateTriggerClicked({type:"/(type)/reactions"+(this.props.themeId?"/(theme)/"+this.props.themeId:"")},e,t.target),this.props.setReactingTo(0);else if(-1!==e.onclick.indexOf("lhinst.buttonClicked"))this.updateTriggerClicked({type:""},e,t.target);else if(-1!==e.onclick.indexOf("lhinst.startVoiceCall"))this.props.voiceCall();else if(-1!==e.onclick.indexOf("lhinst.chooseFile"))this.props.abstractAction("fileupload");else if(-1!==e.onclick.indexOf("lhinst.updateChatClicked"))this.updateTriggerClicked({type:"",mainType:"updatebuttonclicked"},e,t.target);else if(-1!==e.onclick.indexOf("lhinst.editGenericStep"))this.updateTriggerClicked({type:"/(type)/editgenericstep"},e,t.target);else if(-1!==e.onclick.indexOf("lhinst.hideShowAction")){var i=JSON.parse(e["data-load"]),r=document.getElementById("message-more-"+i.id);r.classList.contains("hide")?(t.target.innerText=i.hide_text,r.classList.remove("hide")):(t.target.innerText=i.show_text,r.classList.add("hide"))}else if(-1!==e.onclick.indexOf("lhinst.executeJS"))(0,E.bQ)(e,this);else if(-1!==e.onclick.indexOf("lhinst.dropdownClicked")){var s=document.getElementById("id_generic_list-"+e["data-id"]);s&&"0"!=s.value&&""!=s.value?(e["data-payload"]=s.value,this.updateTriggerClicked({type:"/(type)/valueclicked"},e,t.target)):alert(n("bot.please_choose"))}else-1!==e.onclick.indexOf("lhinst.zoomImage")?I.a.sendMessageParentDirect("zoomImage",[{txt_download:n("bbcode.img_download"),src:e.src,title:e.title?e.title:""}]):(I.a.emitEvent("MessageClick",[e,this.props.dispatch]),console.log("Unknown click event: "+e.onclick));t.preventDefault()}else{if(e.type&&"checkbox"==e.type){if("enable-confirm"==e["payload-type"]){var o=document.getElementById("confirm-button-"+e["data-id"]);t.target.checked?(o.removeAttribute("disabled"),o.onclick=function(t){return a.updateTriggerClicked({type:""},{"data-payload":"confirm","data-id":e["data-id"]},t.target)}):o.setAttribute("disabled","disabled")}return}var c=t.target.options[t.target.selectedIndex],l={"data-payload":c.getAttribute("data-payload"),"data-id":c.getAttribute("data-id")};"trigger"==c.getAttribute("payload-type")?this.updateTriggerClicked({type:"/(type)/triggerclicked"},l,t.target):"button"!=c.getAttribute("payload-type")&&"payload"!=c.getAttribute("payload-type")||this.updateTriggerClicked({type:""},l,t.target)}}},{key:"removeMetaMessage",value:function(e){setTimeout((function(){var t=document.getElementById("msg-"+e);if(t){var a,n=t.getElementsByClassName("meta-message-"+e);for(a=0;as?n.style.right="-"+(r-10)+"px":o0&&this.delayData.forEach((function(t){e.props.sendDelay(t),e.props.scrollBottom(!1,!1)}))}},{key:"formatStringToCamelCase",value:function(e){var t=e.split("-");return 1===t.length?t[0]:t[0]+t.slice(1).map((function(e){return e[0].toUpperCase()+e.slice(1)})).join("")}},{key:"getStyleObjectFromString",value:function(e){var t=this,a={};return e.split(";").forEach((function(e){var n=e.split(":"),i=L()(n,2),r=i[0],s=i[1];if(r){var o=t.formatStringToCamelCase(r.trim());a[o]=s.trim()}})),a}},{key:"render",value:function(){var e=this,t=(this.props.t,!1),a=A()(this.props.msg.msg,{replace:function(a){if(a.attribs){var n=Object.assign({},a.attribs);if(a.attribs.class){if(a.attribs.className=a.attribs.class,-1!==a.attribs.className.indexOf("message-row")&&parseInt(e.props.reactToMessageId)==parseInt(a.attribs.id.replace("msg-",""))&&(a.attribs.className+=" current-reacting-to"),-1!==a.attribs.className.indexOf("message-row")&&e.props.id>0)a.attribs.className+=" fade-in-fast",e.props.msg.msop>0&&e.props.msg.msop!=e.props.msg.lmsop&&0==t&&(a.attribs.className+=" operator-changes",t=!0);else if(e.props.profilePic&&-1!==a.attribs.className.indexOf("vis-icon-hld"))return r.createElement("img",{className:"profile-msg-pic",onLoad:e.imageLoaded,src:e.props.profilePic,alt:"",title:""});delete a.attribs.class}if(a.attribs.onclick&&delete a.attribs.onclick,a.name&&"img"===a.name){if(a.attribs.style&&(a.attribs.style=e.getStyleObjectFromString(a.attribs.style)),void 0===a.attribs["data-ignore-load"])return r.createElement("img",M()({},a.attribs,{onLoad:e.imageLoaded,onClick:function(t){return e.abstractClick(n,t)}}))}else if(a.name&&"button"===a.name){if(n.onclick)return a.attribs.style&&(a.attribs.style=e.getStyleObjectFromString(a.attribs.style)),r.createElement("button",M()({},a.attribs,{onClick:function(t){return e.abstractClick(n,t)}}),(0,O.domToReact)(a.children))}else if(a.name&&"a"===a.name){if(n.onclick)return a.attribs.style&&(a.attribs.style=e.getStyleObjectFromString(a.attribs.style)),r.createElement("a",M()({},a.attribs,{onClick:function(t){return e.abstractClick(n,t)}}),(0,O.domToReact)(a.children))}else if(a.name&&"select"===a.name){if(n.onchange)return a.attribs.style&&(a.attribs.style=e.getStyleObjectFromString(a.attribs.style)),r.createElement("select",M()({},a.attribs,{onChange:function(t){return e.abstractClick(n,t)}}),(0,O.domToReact)(a.children))}else{if(a.name&&"inlinesurvey"===a.name)return r.createElement(r.Suspense,{fallback:"..."},r.createElement(B,M()({},a.attribs,{surveyOptions:a.children})));if(a.name&&"input"===a.name){if(a.attribs.type&&"checkbox"==a.attribs.type&&n.onchange)return a.attribs.style&&(a.attribs.style=e.getStyleObjectFromString(a.attribs.style)),r.createElement("input",M()({type:"checkbox"},a.attribs,{onChange:function(t){return e.abstractClick(n,t)}}));if(a.attribs.type&&"radio"==a.attribs.type)return a.attribs.style&&(a.attribs.style=e.getStyleObjectFromString(a.attribs.style)),a.attribs.checked&&(a.attribs.defaultChecked=!0,delete a.attribs.checked),r.createElement("input",M()({type:"radio"},a.attribs))}else if(a.name&&"script"===a.name&&a.attribs["data-bot-action"]){if(!a.attribs["data-bot-always"]){if(1==e.state.jsExecuted)return r.createElement(r.Fragment,null);e.setState({jsExecuted:!0})}return(0,E.bQ)(a,e),r.createElement(r.Fragment,null)}}}}});return r.createElement(r.Fragment,null,this.state.moreReactions&&r.createElement(R.Z,{setReaction:function(t){e.updateTriggerClicked({type:"/(type)/reactions"+(e.props.themeId?"/(theme)/"+e.props.themeId:"")},JSON.parse(t),null),e.setState({moreReactions:!1}),e.props.setReactingTo(0)},confirmClose:function(t){e.setState({moreReactions:!1})},cancelClose:function(t){e.setState({moreReactions:!1})},toggle:function(t){e.setState({moreReactions:!1})},dataUrl:"/chat/reacttomessagemodal/"+this.state.reactToMessageId+(this.props.themeId?"/(theme)/"+this.props.themeId:"")}),1==this.props.hasNew&&this.props.id==this.props.newId&&r.createElement("div",{id:"scroll-to-message",className:"message-admin border-bottom new-msg-holder border-danger text-center"},r.createElement("span",{className:"new-msg bg-danger text-white d-inline-block fs12 rounded-top"},this.props.newTitle)),a)}}]),i}(r.PureComponent),F=(0,S.Z)()((0,b.$j)()(N)),U=a(8926),H=a.n(U),j=a(7757),W=a.n(j);function q(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function K(e){for(var t=1;tt.props.fileOptions.get("fs")&&i.push(e.name+": "+a("file.to_big_file"))})),i.length>0?alert(i.join("\n")):this.setState({files:e})}},{key:"componentDidUpdate",value:function(e,t){this.state.files.length>0&&0==this.state.uploading&&this.uploadFiles()}},{key:"uploadFiles",value:(t=H()(W().mark((function e(){var t,a=this;return W().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({uploadProgress:{},uploading:!0}),t=[],this.state.files.forEach((function(e){t.push(a.sendRequest(e))})),e.prev=3,e.next=6,Promise.all(t);case 6:this.setState({successfullUploaded:!0,uploading:!1,files:[]}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),this.setState({successfullUploaded:!0,uploading:!1,files:[]});case 12:case"end":return e.stop()}}),e,this,[[3,9]])}))),function(){return t.apply(this,arguments)})},{key:"sendRequest",value:function(e){var t=this,a=this.props.t;return new Promise((function(n,i){var r=new XMLHttpRequest,s=new FormData;s.append("files",e,e.name),r.upload.addEventListener("progress",(function(n){n.lengthComputable&&(K({},t.state.uploadProgress)[e.name]={state:"pending",percentage:n.loaded/n.total*100},t.props.progress(a("file.uploading")+" "+Math.round(n.loaded/n.total*100)+"%"))})),r.upload.addEventListener("load",(function(n){K({},t.state.uploadProgress)[e.name]={state:"done",percentage:100},t.props.progress(a("file.processing"))})),r.onload=function(){var e=JSON.parse(r.response);e&&e.error&&"true"==e.error?e.error_msg?t.props.progress(e.error_msg):t.props.progress(a("file.upload_failed")):(t.props.progress(a("file.completed")),t.props.onCompletion()),n(r)},r.upload.addEventListener("error",(function(a){var n=K({},t.state.uploadProgress);n[e.name]={state:"error",percentage:0},t.setState({uploadProgress:n}),i(r)})),r.open("POST",t.props.base_url+"/file/uploadfile/"+t.props.chat_id+"/"+t.props.hash),r.send(s)}))}},{key:"openFileDialog",value:function(){this.state.uploading||this.fileInputRef.current.click()}},{key:"onFilesAddedUI",value:function(e){var t=e.target.files,a=this.fileListToArray(t);this.onFilesAdded(a)}},{key:"onDragOver",value:function(e){e.preventDefault(),this.state.uploading||this.props.onDrag&&this.props.onDrag(!0)}},{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.props.dropArea.current&&(e.props.dropArea.current.ondragover=e.onDragOver,e.props.dropArea.current.ondragleave=e.onDragLeave,e.props.dropArea.current.ondrop=e.onDrop,document.addEventListener("paste",e.onPaste),I.a.eventEmitter.addListener("fileupload",e.openFileDialog))}),1e3)}},{key:"componentWillUnmount",value:function(){this.props.dropArea.current&&(this.props.dropArea.current.ondragover=null,this.props.dropArea.current.ondragleave=null,this.props.dropArea.current.ondrop=null),I.a.eventEmitter.removeListener("fileupload",this.openFileDialog),document.removeEventListener("paste",this.onPaste)}},{key:"onPaste",value:function(e){var t=e&&e.clipboardData&&e.clipboardData.items;if(t&&t.length){for(var a=[],n=0;n0&&this.onFilesAdded(a)}}},{key:"onDragLeave",value:function(e){this.props.onDrag&&this.props.onDrag(!1)}},{key:"onDrop",value:function(e){if(e.preventDefault(),!this.state.uploading){var t=e.dataTransfer.files,a=this.fileListToArray(t);this.onFilesAdded(a),this.props.onDrag&&this.props.onDrag(!1)}}},{key:"fileListToArray",value:function(e){for(var t=[],a=0;a=this.props.chat_ui.get("switch_to_human")&&X().get(window.lhcChat.base_url+"restapi/isonlinechat/"+this.props.chat.get("id")+"?exclude_bot=true").then((function(e){if(e.data.isonline){var t=document.getElementById("transfer-to-human-btn");null!==t&&t.classList.remove("hide")}}))}},{key:"componentDidMount",value:function(){this.checkSwitchButtom()}},{key:"componentDidUpdate",value:function(e,t,a){this.checkSwitchButtom()}},{key:"render",value:function(){var e=this;return A()(this.props.status,{replace:function(t){if(t.attribs&&t.attribs.onclick&&t.name&&("i"==t.name||"a"==t.name)){var a=Object.assign({},t.attribs);return t.attribs.class&&(t.attribs.className=t.attribs.class,delete t.attribs.class),t.attribs.onclick&&delete t.attribs.onclick,r.createElement("i",M()({},t.attribs,{onClick:function(t){return e.abstractClick(a)}}),(0,O.domToReact)(t.children))}}})}}]),i}(r.PureComponent))||Z),ee=Q;var te,ae,ne=function(e){h()(i,e);var t,a,n=(t=i,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 i=f()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return _()(this,e)});function i(e){return c()(this,i),n.call(this,e)}return d()(i,[{key:"render",value:function(){return r.createElement(r.Fragment,null,null!==this.props.profileBefore&&r.createElement("div",{dangerouslySetInnerHTML:{__html:this.props.profileBefore}}),r.createElement("div",{className:this.props.msg_expand,id:"messagesBlock",dangerouslySetInnerHTML:{__html:this.props.messagesBefore}}),!this.props.hideMessageField&&r.createElement("div",{className:"d-flex flex-row border-top position-relative message-send-area"},r.createElement("div",{className:"btn-group dropup disable-select ps-2 pt-2"},r.createElement("i",{className:"material-icons settings text-muted","aria-haspopup":"true","aria-expanded":"false"},"")),r.createElement("div",{className:"mx-auto pb-1 w-100"},r.createElement("textarea",{"aria-label":"Type your message here...",placeholder:this.props.placeholderMessage,id:"CSChatMessage",rows:"1",className:"ps-0 no-outline form-control rounded-0 form-control rounded-start-0 rounded-end-0 border-0"})),r.createElement("div",{className:"disable-select"},r.createElement("div",{className:"user-chatwidget-buttons pt-1",id:"ChatSendButtonContainer"},r.createElement("i",{className:"material-icons text-muted settings me-0"},"")))))}}]),i}(r.PureComponent),ie=a(6313);function re(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=function(e,t){if(e){if("string"==typeof e)return se(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?se(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,o=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return s=e.done,e},e:function(e){o=!0,r=e},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw r}}}}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a70?!0!==this.state.scrollButton&&this.setState({scrollButton:!0}):!1!==this.state.scrollButton&&this.setState({scrollButton:!1,otm:0}))}},{key:"scrollToMessage",value:function(){var e=this;if(1==this.state.hasNew&&(clearTimeout(this.timeoutNewMessage),this.timeoutNewMessage=setTimeout((function(){e.setState({hasNew:!1,newId:0})}),1e3)),1==this.state.hasNew&&this.state.otm>0){this.setState({otm:0});try{document.getElementById("scroll-to-message").scrollIntoView()}catch(e){this.scrollBottom()}}else this.scrollBottom()}},{key:"changeFontAction",value:function(e){this.setState({fontSize:this.state.fontSize+(1==e?5:-5)}),I.a.setLocalStorage("_dfs",this.state.fontSize),this.scrollBottom()}},{key:"setLanguageAction",value:function(e){I.a.setLocalStorage("_lng",e),this.setState({changeLanguage:!1}),(0,E._Z)({lng:e,id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"])}),I.a.emitEvent("change_language",[e]),this.updateStatus()}},{key:"componentDidMount",value:function(){var e=I.a.getSessionStorage("_ttxt");null!==e&&this.setState({value:e});var t=I.a.getLocalStorage("_dfs");null!==t&&this.setState({fontSize:parseInt(t)});var a=document.getElementById("CSChatMessage");if(null!==a&&(!0===this.props.chatwidget.get("shown")&&"widget"==this.props.chatwidget.get("mode")||"popup"==this.props.chatwidget.get("mode"))){a.focus();var n=document.getElementById("CSChatMessage-tmp");null!==n&&document.body.removeChild(n)}}},{key:"focusMessage",value:function(){this.textMessageRef.current&&(this.textMessageRef.current.focus(),this.state.value.length>0&&(this.textMessageRef.current.selectionStart=this.state.value.length,this.textMessageRef.current.selectionEnd=this.state.value.length))}},{key:"setEditorEnabled",value:function(e){this.setState({enabledEditor:e})}},{key:"hasClass",value:function(e,t){return new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className)}},{key:"addClass",value:function(e,t){this.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)}},{key:"removeClass",value:function(e,t){this.hasClass(e,t)&&(e.className=e.className.replace(new RegExp("(\\s|^)"+t+"(\\s|$)")," ").replace(/^\s+|\s+$/g,""))}},{key:"setMetaUpdateState",value:function(e){!1===e&&!0===this.pendingMetaUpdate&&(this.pendingMetaUpdate=!1,this.updateMetaAutoHide(!0),this.doScrollBottom()),!0===e&&(this.pendingMetaUpdate=!0,this.updateMetaAutoHide(),this.doScrollBottom())}},{key:"updateMetaAutoHide",value:function(e){var t=document.getElementById("messages-scroll");t&&["meta-auto-hide","meta-auto-hide-normal"].forEach((function(a){var n=t.getElementsByClassName(a);if(n.length>0){var i=e?0:1;for(r=0;r2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],r=!0;e=e.nextElementSibling;)r&&e&&!e.matches(t)==a?i.push(e):r=n;return i}},{key:"sendDelay",value:function(e){var t=this,a=e.id,n=e.duration,i=e.delay,r=e.untill_message,s=document.getElementById("msg-"+a);s&&(i>0&&this.addClass(s,"hide"),1==r&&this.nextUntil(s,".message-admin",!1,!0).length>0||setTimeout((function(){if(0==t.delayed)if(1==r)null!==t.intervalFunction&&t.intervalFunction(),t.intervalFunction=function(){if(t.nextUntil(s,".message-admin",!1,!0).length>0)s.parentNode.removeChild(s),t.scrollBottom(!1,!1),t.intervalFunction=null,clearInterval(t.intervalPending);else if(!t.hasClass(s,"meta-hider")){t.addClass(s,"meta-hider"),t.addClass(s,"message-row-typing"),t.removeClass(s,"hide"),t.removeClass(s,"fade-in-fast");var e,a=re(s.getElementsByClassName("msg-body"));try{for(a.s();!(e=a.n()).done;){var n=e.value;t.removeClass(n,"hide")}}catch(e){a.e(e)}finally{a.f()}t.scrollBottom(!1,!1)}},clearInterval(t.intervalPending),t.intervalPending=setInterval(t.intervalFunction,150);else{t.delayed=!0,t.addClass(s,"meta-hider"),t.addClass(s,"message-row-typing"),t.nextUntil(s,".meta-hider").forEach((function(e){t.addClass(e,"hide")})),t.unhideDelayedTimer=setTimeout((function(){t.unhideDelayed(a)}),1e3*n),t.removeClass(s,"hide"),t.removeClass(s,"fade-in-fast");var e,o=re(s.getElementsByClassName("msg-body"));try{for(o.s();!(e=o.n()).done;){var c=e.value;t.removeClass(c,"hide")}}catch(e){o.e(e)}finally{o.f()}i>0&&(t.updateMetaAutoHide(),t.scrollBottom(!1,!1))}else t.addClass(s,"message-row-typing"),t.addClass(s,"meta-hider"),t.delayQueue.push({id:a,delay:n})}),1e3*i))}},{key:"unhideDelayed",value:function(e){var t=this,a=document.getElementById("msg-"+e);if(a)if(this.nextUntil(a,".meta-hider").forEach((function(e){t.removeClass(e,"hide")})),a.parentNode.removeChild(a),this.updateMetaAutoHide(),this.scrollBottom(),this.delayQueue.length>0){var n=this.delayQueue.shift();setTimeout((function(){t.unhideDelayed(n.id)}),1e3*n.delay);var i=document.getElementById("msg-"+n.id);if(null!==i){this.removeClass(i,"hide"),this.removeClass(i,"fade-in-fast");var r,s=re(i.getElementsByClassName("msg-body"));try{for(s.s();!(r=s.n()).done;){var o=r.value;this.removeClass(o,"hide")}}catch(e){s.e(e)}finally{s.f()}}}else this.delayed=!1}},{key:"componentWillUnmount",value:function(){clearInterval(this.intervalPending),clearInterval(this.typingStopped),clearTimeout(this.unhideDelayedTimer),clearTimeout(this.timeoutNewMessage)}},{key:"getSnapshotBeforeUpdate",value:function(e,t){if(e.chatwidget.getIn(["chatLiveData","messages"]).size!=this.props.chatwidget.getIn(["chatLiveData","messages"]).size){var a=!1,n=!0,i=0;this.messagesAreaRef.current&&((i=this.messagesAreaRef.current.scrollHeight-this.messagesAreaRef.current.scrollTop)-this.messagesAreaRef.current.offsetHeight<70?i=0:n=!1,a=!0);var r=this.state.hasNew,s=1==r?this.state.newId:0,o=1==r?this.state.otm:0;if(0!=e.chatwidget.getIn(["chatLiveData","messages"]).size&&!1===this.props.chatwidget.getIn(["chatLiveData","uw"])){var c=this.props.chatwidget.get("shown")&&"widget"==this.props.chatwidget.get("mode")||"widget"!=this.props.chatwidget.get("mode")&&document.hasFocus();0==r?(s=1==(r=0==c||0==window.lhcChat.is_focused||0==n)?e.chatwidget.getIn(["chatLiveData","messages"]).size:0,o=this.props.chatwidget.getIn(["chatLiveData","otm"])):o+=this.props.chatwidget.getIn(["chatLiveData","otm"]);var l=this.props.chatwidget.hasIn(["chat_ui","msg_snippet"])&&this.props.chatwidget.getIn(["chatLiveData","messages",-1,"msg"]);I.a.emitEvent("play_sound",[{msop:this.props.chatwidget.getIn(["chatLiveData","msop"]),msg_body:l,otm:o,type:"new_message",sound_on:!0===this.props.chatwidget.getIn(["usersettings","soundOn"]),widget_open:c}])}else r=!1,s=0,o=0;if(this.setState({valueSend:!1,hasNew:r,newId:s,otm:o,scrollButton:!n}),1==a)return i}else{if(!1===e.chatwidget.get("shown")&&!0===this.props.chatwidget.get("shown"))return 0;this.props.chatwidget.getIn(["chatLiveData","error"])&&(this.props.chatwidget.getIn(["chatLiveData","lmsg"])&&(0==this.state.errorMode||this.props.chatwidget.getIn(["chatLiveData","lmsg"])!=e.chatwidget.getIn(["chatLiveData","lmsg"]))||!this.props.chatwidget.getIn(["chatLiveData","lmsg"])&&0==this.state.errorMode)?this.setState({errorMode:!0,valueSend:!1,value:this.props.chatwidget.getIn(["chatLiveData","lmsg"])}):!this.props.chatwidget.getIn(["chatLiveData","error"])&&e.chatwidget.getIn(["chatLiveData","error"])&&this.setState({errorMode:!1,valueSend:!1,value:""})}return null}},{key:"componentDidUpdate",value:function(e,t,a){var n=this;!1!==this.state.showMessages&&e.chatwidget.getIn(["chatLiveData","status"])==this.props.chatwidget.getIn(["chatLiveData","status"])||(1==this.props.chatwidget.get("newChat")&&1==this.props.chatwidget.getIn(["chatLiveData","messages"]).size?this.scrollBottom(!1,!0):this.scrollBottom(!1,!1));var i=!1;if((!1===t.enabledEditor&&t.enabledEditor!=this.state.enabledEditor&&1==(i=!0)||this.props.chatwidget.get("msgLoaded")!==e.chatwidget.get("msgLoaded")&&(0==this.props.chatwidget.get("newChat")||1==(i=!0)))&&(0==i?this.scrollBottom(!1,!1):this.scrollBottom(!1,!0),(!0!==this.props.chatwidget.getIn(["chat_ui","auto_start"])||"embed"!=this.props.chatwidget.get("mode")||!1===this.props.chatwidget.getIn(["chat_ui","auto_start"])&&"embed"==this.props.chatwidget.get("mode")||!1===t.enabledEditor&&t.enabledEditor!=this.state.enabledEditor)&&(this.focusMessage(),setTimeout((function(){n.focusMessage()}),500))),null!==a&&this.messagesAreaRef.current){var r=document.getElementById("messages-scroll"),s=document.getElementById("msg-"+this.props.chatwidget.getIn(["chatLiveData","lfmsgid"]));r&&s&&-1===s.className.indexOf("ignore-auto-scroll")&&r.scrollHeight-r.offsetHeight>s.offsetTop?(this.setState({scrollButton:!0}),this.messagesAreaRef.current.scrollTop=s.offsetTop):this.messagesAreaRef.current.scrollTop=this.messagesAreaRef.current.scrollHeight-a}if(1==this.props.chatwidget.getIn(["chat_ui_state","confirm_close"])&&!1===this.state.preloadSurvey&&this.setState({preloadSurvey:!0}),!1===e.chatwidget.get("shown")&&!0===this.props.chatwidget.get("shown")&&"widget"==this.props.chatwidget.get("mode")&&this.textMessageRef.current&&this.textMessageRef.current.focus(),!0!==this.props.chatwidget.getIn(["chat_ui","start_on_close"])||!0!==this.props.chatwidget.getIn(["chatLiveData","closed"])||void 0!==e.chatwidget.getIn(["chatLiveData","closed"])&&!1!==e.chatwidget.hasIn(["chatLiveData","closed"])&&!1!==e.chatwidget.getIn(["chatLiveData","closed"])||this.props.chatwidget.getIn(["chat_ui","survey_id"])||this.props.endChat({show_start:this.props.chatwidget.get("shown")}),!0===this.props.chatwidget.getIn(["chatLiveData","closed"])&&0===this.props.chatwidget.getIn(["chatLiveData","status_sub"])&&5===e.chatwidget.getIn(["chatLiveData","status_sub"])&&this.props.dispatch((0,E.Rt)({id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),theme:this.props.chatwidget.get("theme")})),!(!0!==this.props.chatwidget.get("shown")||"widget"!=this.props.chatwidget.get("mode")&&"embed"!=this.props.chatwidget.get("mode")||!0!==this.props.chatwidget.get("initLoaded")||!0!==this.props.chatwidget.get("msgLoaded")||0!=e.chatwidget.get("msgLoaded")&&0!=e.chatwidget.get("initLoaded"))){"widget"==this.props.chatwidget.get("mode")&&this.textMessageRef.current&&this.textMessageRef.current.focus();var o=document.getElementById("CSChatMessage-tmp");null!==o&&document.body.removeChild(o)}}},{key:"doScrollBottom",value:function(e){var t;this.messagesAreaRef.current&&(e&&null!==(t=document.getElementById("msg-"+this.props.chatwidget.getIn(["chatLiveData","lfmsgid"])))&&-1===t.className.indexOf("ignore-auto-scroll")?this.messagesAreaRef.current.scrollTop=t.offsetTop:this.messagesAreaRef.current.scrollTop=this.messagesAreaRef.current.scrollHeight+1e3)}},{key:"scrollBottom",value:function(e,t){var a=this;!this.messagesAreaRef.current||e&&this.state.scrollButton||(this.doScrollBottom(t),setTimeout((function(){a.doScrollBottom(t),!1===a.state.showMessages&&a.setState({showMessages:!0})}),450))}},{key:"abstractAction",value:function(e,t){I.a.emitEvent(e,t)}},{key:"updateMessage",value:function(e){this.props.dispatch((0,E.o6)({msg_id:e,lmgsid:this.props.chatwidget.getIn(["chatLiveData","lmsgid"]),mode:this.props.chatwidget.get("mode"),theme:this.props.chatwidget.get("theme"),id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),no_scroll:!0}))}},{key:"updateMessages",value:function(){var e={chat_id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),lmgsid:this.props.chatwidget.getIn(["chatLiveData","lmsgid"]),theme:this.props.chatwidget.get("theme"),new_chat:this.props.chatwidget.get("newChat")};e.new_chat&&0===e.lmgsid&&(e.old_msg_id=this.props.chatwidget.getIn(["chatData","lmsg_id"])),this.props.dispatch((0,E.W4)(e))}},{key:"updateStatus",value:function(){this.props.dispatch((0,E.kW)({chat_id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),theme:this.props.chatwidget.get("theme"),mode:this.props.chatwidget.get("mode")}))}},{key:"sendMessage",value:function(){I.a.setSessionStorage("_ttxt",""),this.props.dispatch((0,E.Hz)({id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),msg:this.state.value,mn:this.props.chatwidget.hasIn(["chat_ui","mn"]),theme:this.props.chatwidget.get("theme"),lmgsid:this.props.chatwidget.getIn(["chatLiveData","lmsgid"])})),this.setState({value:"",valueSend:!0,errorMode:!1}),this.currentMessageTyping="",this.focusMessage(),this.doScrollBottom()}},{key:"enterKeyDown",value:function(e){"Enter"!==e.key||e.shiftKey||(this.sendMessage(),e.preventDefault())}},{key:"keyUp",value:function(e){"Enter"===e.key||e.shiftKey||(!1===this.isTyping?(this.isTyping=!0,this.props.dispatch((0,E.Hx)("true",this.state.value))):(clearTimeout(this.typingStopped),this.typingStopped=setTimeout(this.typingStoppedAction,6e3),this.currentMessageTyping!=this.state.value&&(Math.abs(this.currentMessageTyping.length-this.state.value.length)>6||this.props.chatwidget.get("overrides").contains("typing"))&&(this.currentMessageTyping=this.state.value,this.props.dispatch((0,E.Hx)("true",this.state.value)))))}},{key:"typingStoppedAction",value:function(){1==this.isTyping&&(this.isTyping=!1,this.props.dispatch((0,E.Hx)("false")))}},{key:"endChat",value:function(){this.props.endChat({show_start:this.props.chatwidget.get("shown")})}},{key:"toggleModal",value:function(){this.setState({showBBCode:!this.state.showBBCode}),this.state.showBBCode&&this.focusMessage()}},{key:"mailChat",value:function(){this.setState({showMail:!this.state.showMail})}},{key:"changeLanguage",value:function(){this.setState({changeLanguage:!this.state.changeLanguage})}},{key:"changeFont",value:function(){this.setState({changeFontSize:!this.state.changeFontSize})}},{key:"voiceCall",value:function(){var e=void 0!==window.screenLeft?window.screenLeft:window.screenX,t=void 0!==window.screenTop?window.screenTop:window.screenY,a=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,n=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,i=a/window.screen.availWidth,r=(a-parseInt(800))/2/i+e,s="scrollbars=yes,menubar=1,resizable=1,width=800,height=600,top="+((n-parseInt(600))/2/i+t)+",left="+r,o=window.open("",I.a.prefix+"_voice_popup_v2",s),c=!1,l=!1;try{!o||o.closed||void 0===o.closed||"about:blank"===o.location.href?(o=window.open(this.props.chatwidget.get("base_url")+"voicevideo/call/"+this.props.chatwidget.getIn(["chatData","id"])+"/"+this.props.chatwidget.getIn(["chatData","hash"]),I.a.prefix+"_voice_popup_v2",s),l=!0):c=!0}catch(e){c=!0}!o||o.closed||void 0===o.closed||1==l||!0===c&&o.focus()}},{key:"toggleSound",value:function(){this.props.dispatch({type:"toggleSound",data:!this.props.chatwidget.getIn(["usersettings","soundOn"])}),I.a.sendMessageParent("toggleSound",[{sender:"toolbarButton"}])}},{key:"render",value:function(){var e=this,t=this.props.t;if(!1===this.props.chatwidget.get("initLoaded")||!1===this.props.chatwidget.get("msgLoaded")){var a="flex-grow-1 overflow-scroll position-relative";return this.props.chatwidget.hasIn(["chat_ui","msg_expand"])&&(a="overflow-scroll position-relative"),r.createElement(ne,{profileBefore:this.props.profileBefore,msg_expand:a,messagesBefore:this.props.messagesBefore,placeholderMessage:this.props.chatwidget.hasIn(["chat_ui","placeholder_message"])?this.props.chatwidget.getIn(["chat_ui","placeholder_message"]):t("chat.type_here")})}if(this.props.chatwidget.hasIn(["chatLiveData","ru"])&&this.props.chatwidget.getIn(["chatLiveData","ru"]))return u=this.props.chatwidget.get("base_url")+this.props.chatwidget.getIn(["chatLiveData","ru"]),r.createElement(r.Fragment,null,r.createElement("iframe",{allowtransparency:"true",src:u,frameBorder:"0",className:"flex-grow-1 position-relative iframe-modal"}));if(this.props.chatwidget.get("chatLiveData").has("messages"))var n=this.props.chatwidget.getIn(["chatLiveData","messages"]).map((function(a,n){return r.createElement(F,{reactToMessageId:e.state.reactToMsgId,setReactingTo:function(t){return e.setState({reactToMsgId:t})},themeId:e.props.chatwidget.get("theme"),profilePic:e.props.chatwidget.get("profile_pic"),newTitle:e.props.chatwidget.getIn(["chat_ui","cnew_msgh"])||t("button.new"),newId:e.state.newId,hasNew:e.state.hasNew,voiceCall:e.voiceCall,endChat:e.props.endChat,setMetaUpdateState:e.setMetaUpdateState,sendDelay:e.sendDelay,setEditorEnabled:e.setEditorEnabled,abstractAction:e.abstractAction,updateStatus:e.updateStatus,focusMessage:e.focusMessage,updateMessage:e.updateMessage,updateMessages:e.updateMessages,scrollBottom:e.scrollBottom,id:n,key:"msg_"+n,msg:a})}));else n="";var i;i=!0===this.state.dragging?t("chat.drop_files"):this.props.chatwidget.getIn(["chatLiveData","closed"])?t("chat.chat_closed"):this.props.chatwidget.hasIn(["chat_ui","placeholder_message"])?this.props.chatwidget.getIn(["chat_ui","placeholder_message"]):t("chat.type_here"),a="flex-grow-1 overflow-scroll position-relative";var s="bottom-message px-1";this.props.chatwidget.hasIn(["chat_ui","msg_expand"])&&"embed"==this.props.chatwidget.get("mode")&&(a="overflow-scroll position-relative",s+=" position-relative");var o="mx-auto w-100";1==this.props.chatwidget.getIn(["chatLiveData","closed"])&&(o+="embed"==this.props.chatwidget.get("mode")?" pe-2":" pe-1");var c=!0,l=!1,d=!1,u="",h="flex-grow-1 position-relative iframe-modal content-loader mb-2",p=this.props.chatwidget.hasIn(["chatLiveData","status_sub"])&&(this.props.chatwidget.getIn(["chatLiveData","status_sub"])==D.Pd||this.props.chatwidget.getIn(["chatLiveData","status_sub"])==D.pV&&(this.props.chatwidget.getIn(["chatLiveData","uid"])>0||this.props.chatwidget.getIn(["chatLiveData","status"])===D.pA||this.props.chatwidget.getIn(["chatLiveData","status"])==D.sk))||this.props.chatwidget.getIn(["chatLiveData","status"])==D.sk&&this.props.chatwidget.getIn(["chatLiveData","uid"])>0||!0===this.state.gotToSurvey;(this.props.chatwidget.hasIn(["chatLiveData","status_sub"])&&this.props.chatwidget.getIn(["chatLiveData","status_sub"])==D.Pd||this.props.chatwidget.getIn(["chatLiveData","status"])==D.sk&&this.props.chatwidget.getIn(["chatLiveData","status_sub"])!=D.pV)&&(d=!0),(!0===this.state.preloadSurvey||p)&&this.props.chatwidget.hasIn(["chat_ui","survey_id"])&&(u=this.props.chatwidget.get("base_url")+"survey/fillwidget/(chatid)/"+this.props.chatwidget.getIn(["chatData","id"])+"/(hash)/"+this.props.chatwidget.getIn(["chatData","hash"]),this.props.chatwidget.get("theme")&&(u=u+"/(theme)/"+this.props.chatwidget.get("theme")),u=u+"/(survey)/"+this.props.chatwidget.getIn(["chat_ui","survey_id"])+(!0===d?"/(force)/true":""),this.props.chatwidget.hasIn(["chat_ui","survey_url"])&&(u=this.props.chatwidget.getIn(["chat_ui","survey_url"]).replace("{chat_id}",this.props.chatwidget.getIn(["chatData","id"])).replace("{chat_hash}",this.props.chatwidget.getIn(["chatData","hash"]))+(!0===d?"?force=true":"")),l=!0,c=!1,(!1===p||this.props.chatwidget.hasIn(["chat_ui","survey_button"])&&0===this.props.chatwidget.getIn(["chat_ui_state","show_survey"])&&this.props.chatwidget.getIn(["chatLiveData","status"])==D.sk&&this.props.chatwidget.getIn(["chatLiveData","status_sub"])!=D.Pd&&this.props.chatwidget.getIn(["chatLiveData","status_sub"])!=D.pV||1==this.props.chatwidget.getIn(["chat_ui_state","confirm_close"]))&&(c=!0,h=" d-none"));var _=this.props.chatwidget.getIn(["chat_ui","end_chat_text"])||t("button.end_chat"),g={fontSize:(this.props.chatwidget.hasIn(["chat_ui","font_size"])?this.state.fontSize:"100")+"%"};return r.createElement(r.Fragment,null,this.props.chatwidget.getIn(["chatLiveData","abort"])&&r.createElement(ie.Z,{closeText:t("button.close"),close:function(t){return e.props.dispatch((0,E.H7)(!0))},text:this.props.chatwidget.getIn(["chatLiveData","abort"])}),this.props.chatwidget.hasIn(["chat_ui","pre_survey_url"])&&this.props.chatwidget.getIn(["chatLiveData","uid"])>0&&2!==this.props.chatwidget.getIn(["chat_ui_state","pre_survey_done"])&&(1===this.props.chatwidget.getIn(["chat_ui_state","pre_survey_done"])||p)&&r.createElement(R.Z,{cancelClose:function(t){return e.props.dispatch((0,E.Lt)(!1))},confirmClose:function(t){return e.props.dispatch((0,E.Lt)(!0))},toggle:this.props.cancelPresurvey,dataUrl:this.props.chatwidget.getIn(["chat_ui","pre_survey_url"])+this.props.chatwidget.getIn(["chatData","id"])+"/"+this.props.chatwidget.getIn(["chatData","hash"])+(this.props.chatwidget.hasIn(["chat_ui","survey_id"])?"/(hassurvey)/true":"")+(this.props.chatwidget.get("theme")?"/(theme)/"+this.props.chatwidget.get("theme"):null)}),l&&r.createElement(r.Fragment,null,0==c&&this.props.chatwidget.hasIn(["chatStatusData","result"])&&!this.props.chatwidget.hasIn(["chat_ui","hide_status"])&&this.props.chatwidget.getIn(["chatStatusData","result"])&&r.createElement("div",{id:"chat-status-container",className:"p-2 border-bottom live-status-"+this.props.chatwidget.getIn(["chatLiveData","status"])},r.createElement(ee,{updateStatus:this.updateStatus,vtm:this.props.chatwidget.hasIn(["chat_ui","switch_to_human"])&&this.props.chatwidget.getIn(["chatLiveData","status"])==D.pA?this.props.chatwidget.getIn(["chatLiveData","vtm"]):0,status:this.props.chatwidget.getIn(["chatStatusData","result"])})),r.createElement("iframe",{allowtransparency:"true",src:u,frameBorder:"0",className:h})),(c||l)&&r.createElement(G,{hasSurvey:l,syncInterval:this.props.chatwidget.getIn(["chat_ui","sync_interval"]),updateStatus:this.updateStatus,updateMessages:this.updateMessages,initClose:this.props.chatwidget.get("initClose"),dispatch:this.props.dispatch,status_sub:this.props.chatwidget.getIn(["chatLiveData","status_sub"]),status:this.props.chatwidget.getIn(["chatLiveData","status"]),theme:this.props.chatwidget.get("theme"),lmgsid:this.props.chatwidget.getIn(["chatLiveData","lmsgid"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),chat_id:this.props.chatwidget.getIn(["chatData","id"])}),c&&r.createElement(r.Fragment,null,1==this.props.chatwidget.getIn(["chat_ui_state","confirm_close"])&&r.createElement(R.Z,{confirmClose:this.props.endChat,cancelClose:this.props.cancelClose,toggle:this.props.cancelClose,dataUrl:"/chat/confirmleave/"+this.props.chatwidget.getIn(["chatData","id"])+"/"+this.props.chatwidget.getIn(["chatData","hash"])}),this.state.showBBCode&&r.createElement(R.Z,{showModal:this.state.showBBCode,insertText:this.insertText,toggle:this.toggleModal,dataUrl:"/chat/bbcodeinsert?react=1"}),this.state.changeLanguage&&r.createElement(R.Z,{showModal:this.state.changeLanguage,setLanguage:this.setLanguageAction,insertText:this.insertText,toggle:this.changeLanguage,dataUrl:"/widgetrestapi/chooselanguage/(id)/"+this.props.chatwidget.getIn(["chatData","id"])+"/(hash)/"+this.props.chatwidget.getIn(["chatData","hash"])}),this.state.showMail&&r.createElement(r.Suspense,{fallback:"..."},r.createElement(de,{showModal:this.state.showMail,changeFont:this.changeFont,toggle:this.mailChat,chatHash:this.props.chatwidget.getIn(["chatData","hash"]),chatId:this.props.chatwidget.getIn(["chatData","id"])})),this.state.changeFontSize&&r.createElement(r.Suspense,{fallback:"..."},r.createElement(ue,{showModal:this.state.changeFontSize,toggle:this.changeFont,changeFont:this.changeFontAction})),"embed"==this.props.chatwidget.get("mode")&&this.props.chatwidget.hasIn(["chat_ui","embed_cls"])&&1==this.props.chatwidget.getIn(["chat_ui","embed_cls"])&&r.createElement("div",{className:"close-modal-btn position-absolute"},this.props.chatwidget.hasIn(["chat_ui","close_btn"])&&r.createElement("a",{onClick:this.endChat,title:_},r.createElement("i",{className:"material-icons settings text-muted"},""),r.createElement("span",{className:"embed-close-title"},_))),this.props.chatwidget.hasIn(["chatStatusData","result"])&&!this.props.chatwidget.hasIn(["chat_ui","hide_status"])&&this.props.chatwidget.getIn(["chatStatusData","result"])&&r.createElement("div",{id:"chat-status-container",className:"p-2 border-bottom live-status-"+this.props.chatwidget.getIn(["chatLiveData","status"])},r.createElement(ee,{updateStatus:this.updateStatus,vtm:this.props.chatwidget.hasIn(["chat_ui","switch_to_human"])&&this.props.chatwidget.getIn(["chatLiveData","status"])==D.pA?this.props.chatwidget.getIn(["chatLiveData","vtm"]):0,status:this.props.chatwidget.getIn(["chatStatusData","result"])})),r.createElement("div",{className:a,onClick:function(t){e.setState({reactToMsgId:0})},id:"messagesBlock",onScroll:this.onScrollMessages},r.createElement("div",{className:s,id:"messages-scroll",style:g,ref:this.messagesAreaRef},this.props.chatwidget.hasIn(["chat_ui","prev_chat"])&&r.createElement("div",{dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","prev_chat"])}}),n),this.state.scrollButton&&r.createElement("div",{className:"position-absolute btn-bottom-scroll fade-in"},r.createElement("button",{type:"button",onClick:this.scrollToMessage,className:"btn btn-sm btn-secondary"},this.state.hasNew&&this.state.otm>0&&r.createElement("div",null,r.createElement("i",{className:"material-icons"},""),this.state.otm," ",1==this.state.otm?this.props.chatwidget.getIn(["chat_ui","cnew_msg"])||t("button.new_msg"):this.props.chatwidget.getIn(["chat_ui","cnew_msgm"])||t("button.new_msgm"))||this.props.chatwidget.getIn(["chat_ui","cscroll_btn"])||t("button.scroll_bottom")))),r.createElement("div",{className:(!1===this.props.chatwidget.get("msgLoaded")||!1===this.state.enabledEditor?"d-none ":"d-flex ")+"flex-row border-top position-relative message-send-area"},(this.props.chatwidget.getIn(["chatLiveData","ott"])||this.props.chatwidget.getIn(["chatLiveData","error"])&&"SEND_CONNECTION"!=this.props.chatwidget.getIn(["chatLiveData","error"])||this.props.chatwidget.get("network_down"))&&r.createElement("div",{id:"id-operator-typing",className:"bg-white ps-1"},this.props.chatwidget.getIn(["chatLiveData","error"])?-1===this.props.chatwidget.getIn(["chatLiveData","error"]).indexOf("SEND_")?this.props.chatwidget.getIn(["chatLiveData","error"]):t("online_chat."+this.props.chatwidget.getIn(["chatLiveData","error"]).toLowerCase()):this.props.chatwidget.get("network_down")?t("online_chat.send_connection"):this.props.chatwidget.getIn(["chatLiveData","ott"])),"embed"==this.props.chatwidget.get("mode")&&this.props.chatwidget.hasIn(["chat_ui","embed_cls"])&&2==this.props.chatwidget.getIn(["chat_ui","embed_cls"])&&r.createElement("div",{className:"inline-cls-btn pt-1 ps-2"},this.props.chatwidget.hasIn(["chat_ui","close_btn"])&&r.createElement("a",{onClick:this.endChat,title:_},r.createElement("i",{className:"material-icons settings text-muted me-0"},""))),r.createElement(J,{elementId:"chat-dropdown-options"},r.createElement("div",{className:"btn-group dropup disable-select ps-1 pt-2"},r.createElement("i",{className:"material-icons settings text-muted",id:"chat-dropdown-options","data-bs-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},""),r.createElement("div",{className:"dropdown-menu shadow bg-white rounded lhc-dropdown-menu ms-1 "+("rtl"==window.lhcChat.staticJS.dir?"dropdown-menu-end":"")},r.createElement("div",{className:"d-flex flex-row ps-1"},r.createElement("a",{onClick:this.toggleSound,title:t("chat.option_sound")},r.createElement("i",{className:"material-icons chat-setting-item text-muted "+(!0===this.props.chatwidget.getIn(["usersettings","soundOn"])?"sound-on-ico":"sound-off-ico")},!0===this.props.chatwidget.getIn(["usersettings","soundOn"])?r.createElement(r.Fragment,null,""):r.createElement(r.Fragment,null,""))),this.props.chatwidget.hasIn(["chat_ui","print"])&&r.createElement("a",{target:"_blank",href:this.props.chatwidget.get("base_url")+"chat/printchat/"+this.props.chatwidget.getIn(["chatData","id"])+"/"+this.props.chatwidget.getIn(["chatData","hash"]),title:t("button.print")},r.createElement("i",{className:"material-icons chat-setting-item text-muted print-ico"},"")),this.props.chatwidget.hasIn(["chat_ui","dwntxt"])&&r.createElement("a",{target:"_blank",href:this.props.chatwidget.get("base_url")+"chat/downloadtxt/"+this.props.chatwidget.getIn(["chatData","id"])+"/"+this.props.chatwidget.getIn(["chatData","hash"]),title:t("button.dwntxt")},r.createElement("i",{className:"material-icons chat-setting-item text-muted download-ico"},"")),!this.props.chatwidget.getIn(["chatLiveData","closed"])&&this.props.chatwidget.hasIn(["chat_ui","file"])&&r.createElement(z,{fileOptions:this.props.chatwidget.getIn(["chat_ui","file_options"]),onDrag:this.dragging,dropArea:this.textMessageRef,onCompletion:this.updateMessages,progress:this.setStatusText,base_url:this.props.chatwidget.get("base_url"),chat_id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),link:!0}),!this.props.chatwidget.getIn(["chatLiveData","closed"])&&1==this.props.chatwidget.getIn(["chatLiveData","status"])&&this.props.chatwidget.hasIn(["chat_ui","voice"])&&!0===this.props.chatwidget.getIn(["chat_ui","voice"])&&r.createElement("a",{onClick:this.voiceCall,title:t("button.voice")},r.createElement("i",{className:"material-icons chat-setting-item text-muted voice-ico"},"")),!this.props.chatwidget.getIn(["chatLiveData","closed"])&&!this.props.chatwidget.hasIn(["chat_ui","bbc_btnh"])&&r.createElement("a",{onClick:this.toggleModal,title:t("button.bb_code")},r.createElement("i",{className:"material-icons chat-setting-item text-muted bbcode-ico"},"")),this.props.chatwidget.hasIn(["chat_ui","mail"])&&r.createElement("a",{onClick:this.mailChat,title:t("button.mail")},r.createElement("i",{className:"material-icons chat-setting-item text-muted mail-ico"},"")),this.props.chatwidget.hasIn(["chat_ui","font_size"])&&r.createElement("a",{onClick:function(t){return e.changeFont(t)}},r.createElement("i",{className:"material-icons chat-setting-item text-muted fs-ico"},"")),this.props.chatwidget.hasIn(["chat_ui","close_btn"])&&r.createElement("a",{onClick:this.endChat,title:_},r.createElement("i",{className:"material-icons chat-setting-item text-muted close-ico"},"")),this.props.chatwidget.hasIn(["chat_ui","lng_btnh"])&&r.createElement("a",{onClick:this.changeLanguage,title:t("button.lang")},r.createElement("i",{className:"material-icons chat-setting-item text-muted lang-ico"},"")))))),r.createElement("div",{className:o},this.props.chatwidget.getIn(["chatLiveData","closed"])&&this.props.chatwidget.hasIn(["chat_ui","survey_id"])&&r.createElement("button",{onClick:this.goToSurvey,className:"w-100 btn btn-success"},t("online_chat.go_to_survey")),(!this.props.chatwidget.getIn(["chatLiveData","closed"])||!this.props.chatwidget.hasIn(["chat_ui","survey_id"]))&&r.createElement("textarea",{onFocus:function(t){e.setState({reactToMsgId:0})},onTouchStart:this.scrollBottom,maxLength:this.props.chatwidget.getIn(["chat_ui","max_length"]),onKeyUp:this.keyUp,readOnly:this.props.chatwidget.getIn(["chatLiveData","closed"])||this.props.chatwidget.get("network_down"),id:"CSChatMessage",placeholder:i,onKeyDown:this.enterKeyDown,value:this.props.chatwidget.getIn(["chatLiveData","closed"])?"":this.state.value,onChange:this.handleChange,ref:this.textMessageRef,rows:"1",className:"ps-0 no-outline form-control rounded-0 form-control rounded-start-0 rounded-end-0 border-0 "+(!0===this.props.chatwidget.get("shown")&&this.textMessageRef.current&&(/\r|\n/.exec(this.state.value)||this.state.value.length>this.textMessageRef.current.offsetWidth/8.6)?"msg-two-line":"msg-one-line")})),!this.props.chatwidget.getIn(["chatLiveData","closed"])&&!this.props.chatwidget.get("network_down")&&r.createElement("div",{className:"disable-select"},r.createElement("div",{className:"user-chatwidget-buttons pt-1 pe-1",id:"ChatSendButtonContainer"},!0===this.state.voiceMode&&r.createElement(r.Suspense,{fallback:"..."},r.createElement(le,{onCompletion:this.updateMessages,progress:this.setStatusText,base_url:this.props.chatwidget.get("base_url"),chat_id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),maxSeconds:"30",cancel:this.cancelVoiceRecording})),!this.state.valueSend&&this.props.chatwidget.hasIn(["chat_ui","voice_message"])&&void 0!==window.Audio&&0==this.state.value.length&&!1===this.state.voiceMode&&r.createElement("a",{onClick:this.startVoiceRecording,title:t("button.record_voice")},r.createElement("i",{className:"material-icons text-muted settings me-0"},"")),!this.state.valueSend&&(!this.props.chatwidget.hasIn(["chat_ui","voice_message"])||!(void 0!==window.Audio)||this.state.value.length>0&&!1===this.state.voiceMode)&&r.createElement("a",{onClick:this.sendMessage,title:t("button.send")},r.createElement("i",{className:"material-icons text-muted settings me-0"},"")),this.state.valueSend&&r.createElement("i",{className:"material-icons text-muted settings me-0"},""))))))}}]),i}(r.Component))||ae),pe=(0,S.Z)()(he);var _e=r.lazy((function(){return a.e(476).then(a.bind(a,5476))})),ge=r.lazy((function(){return a.e(906).then(a.bind(a,906))})),fe=(oe=(0,b.$j)((function(e){return{chatwidget:e.chatwidget}})),oe(ce=function(e){h()(i,e);var t,a,n=(t=i,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 i=f()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return _()(this,e)});function i(e){var t;return c()(this,i),t=n.call(this,e),y()(v()(t),"state",{}),t.endChat=t.endChat.bind(v()(t)),t.popupChat=t.popupChat.bind(v()(t)),t.cancelClose=t.cancelClose.bind(v()(t)),t.setProfile=t.setProfile.bind(v()(t)),t.setMessages=t.setMessages.bind(v()(t)),t.setHideMessageField=t.setHideMessageField.bind(v()(t)),t.setBotPayload=t.setBotPayload.bind(v()(t)),t.lastHeiht=0,t.profileHTML=null,t.messagesHTML=null,t.hideMessageField=!1,t.botPayload=null,I.a.eventEmitter.addListener("end_chat_visitor",(function(e){return t.endChat()})),t}return d()(i,[{key:"cancelClose",value:function(){this.props.dispatch({type:"UI_STATE",data:{attr:"confirm_close",val:0}})}},{key:"setBotPayload",value:function(e){this.botPayload=e}},{key:"endChat",value:function(e){void 0===e&&(e={});var t=!1,a=!1,n=!1,i=this.props.chatwidget.hasIn(["chatLiveData","status_sub"])&&(this.props.chatwidget.getIn(["chatLiveData","status_sub"])==D.B4||this.props.chatwidget.getIn(["chatLiveData","status_sub"])==D.Pd||this.props.chatwidget.getIn(["chatLiveData","status_sub"])==D.pV&&(this.props.chatwidget.getIn(["chatLiveData","uid"])>0||this.props.chatwidget.getIn(["chatLiveData","status"])===D.pA||this.props.chatwidget.getIn(["chatLiveData","status"])==D.sk)),r=this.props.chatwidget.getIn(["chatLiveData","status"])==D.sk&&this.props.chatwidget.getIn(["chatLiveData","uid"])>0;(1==i||r)&&this.props.chatwidget.hasIn(["chat_ui","survey_id"])&&(this.props.chatwidget.hasIn(["chat_ui","survey_button"])&&1!==this.props.chatwidget.getIn(["chat_ui_state","show_survey"])&&1!=i?a=!0:t=!0),!1===t&&this.props.chatwidget.hasIn(["chat_ui","confirm_close"])&&0===this.props.chatwidget.getIn(["chat_ui_state","confirm_close"])?this.props.dispatch({type:"UI_STATE",data:{attr:"confirm_close",val:1}}):(1===this.props.chatwidget.getIn(["chat_ui_state","confirm_close"])&&this.props.dispatch({type:"UI_STATE",data:{attr:"confirm_close",val:2}}),1===this.props.chatwidget.getIn(["chat_ui_state","pre_survey_done"])&&this.props.dispatch({type:"UI_STATE",data:{attr:"pre_survey_done",val:2}}),this.props.chatwidget.hasIn(["chat_ui","pre_survey_url"])&&0===this.props.chatwidget.getIn(["chat_ui_state","pre_survey_done"])&&this.props.chatwidget.getIn(["chatLiveData","uid"])>0&&(this.props.dispatch({type:"UI_STATE",data:{attr:"pre_survey_done",val:1}}),n=!0),!0!==a?!1===this.props.chatwidget.get("initClose")&&this.props.chatwidget.hasIn(["chat_ui","survey_id"])&&0==t&&(this.props.chatwidget.getIn(["chatLiveData","uid"])>0||this.props.chatwidget.getIn(["chatLiveData","status"])===D.pA)?this.props.dispatch((0,E.Nl)({show_start:!(!e||!e.show_start)&&e.show_start,noCloseReason:"SHOW_SURVEY",noClose:!0,vid:this.props.chatwidget.get("vid"),chat:{id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"])}})):0==n&&this.props.dispatch((0,E.Nl)({show_start:!(!e||!e.show_start)&&e.show_start,vid:this.props.chatwidget.get("vid"),chat:{id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"])}})):this.props.dispatch({type:"UI_STATE",data:{attr:"show_survey",val:1}}))}},{key:"popupChat",value:function(){var e=null;window.parent&&window.parent["$_"+I.a.prefixUppercase]&&!1===window.parent.closed?e=window.parent["$_"+I.a.prefixUppercase].eventListener:window.opener&&window.opener["$_"+I.a.prefixUppercase]&&!1===window.opener.closed&&(e=window.opener["$_"+I.a.prefixUppercase].eventListener),null!==e?e.emitEvent("openPopup"):I.a.sendMessageParent("openPopup",[])}},{key:"setProfile",value:function(e){this.profileHTML=e}},{key:"setMessages",value:function(e){this.messagesHTML=e}},{key:"setHideMessageField",value:function(e){this.hideMessageField=e}},{key:"render",value:function(){if(!1===this.props.chatwidget.get("loadedCore"))return null;if(!0===this.props.chatwidget.getIn(["proactive","pending"]))return r.createElement(r.Suspense,{fallback:"..."},r.createElement(ge,{setBotPayload:this.setBotPayload}));var e="d-flex flex-column flex-grow-1 reset-container-margins";return"widget"==this.props.chatwidget.get("mode")?e+=1==this.props.chatwidget.get("isMobile")?" mobile-body":" desktop-body":"embed"==this.props.chatwidget.get("mode")&&(e+=1==this.props.chatwidget.get("isMobile")?" mobile-embed-body":" desktop-embed-body"),this.props.chatwidget.hasIn(["chat_ui","msg_expand"])&&"embed"==this.props.chatwidget.get("mode")&&(e+=" mh-100"),!0===this.props.chatwidget.get("isChatting")?(e+=" online-chat online-chat-status-"+this.props.chatwidget.getIn(["chatLiveData","status"]),r.createElement(r.Fragment,null,this.props.chatwidget.hasIn(["chat_ui","custom_html_header"])&&r.createElement("div",{className:"lhc-custom-header-above",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","custom_html_header"])}}),"widget"==this.props.chatwidget.get("mode")&&r.createElement(C,{popupChat:this.popupChat,endChat:this.endChat}),r.createElement("div",{className:e},r.createElement(pe,{hideMessageField:this.hideMessageField,profileBefore:this.profileHTML,messagesBefore:this.messagesHTML,cancelClose:this.cancelClose,endChat:this.endChat})))):!0===this.props.chatwidget.get("isOnline")&&!1===this.props.chatwidget.get("isOfflineMode")?(e+=" start-chat",r.createElement(r.Fragment,null,this.props.chatwidget.hasIn(["chat_ui","custom_html_header"])&&r.createElement("div",{className:"lhc-custom-header-above",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","custom_html_header"])}}),"widget"==this.props.chatwidget.get("mode")&&r.createElement(C,{popupChat:this.popupChat,endChat:this.endChat}),r.createElement("div",{className:e},r.createElement(k.Z,{botPayload:this.botPayload,setHideMessageField:this.setHideMessageField,setProfile:this.setProfile,setMessages:this.setMessages})))):(e+=" offline-chat",r.createElement(r.Fragment,null,this.props.chatwidget.hasIn(["chat_ui","custom_html_header"])&&r.createElement("div",{className:"lhc-custom-header-above",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","custom_html_header"])}}),"widget"==this.props.chatwidget.get("mode")&&r.createElement(C,{popupChat:this.popupChat,endChat:this.endChat}),r.createElement("div",{className:e},r.createElement(r.Suspense,{fallback:""},r.createElement(_e,null)))))}}]),i}(r.Component))||ce),me=fe,ve=a(1766);var we=function(e){h()(i,e);var t,a,n=(t=i,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 i=f()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return _()(this,e)});function i(e){var t;return c()(this,i),t=n.call(this,e),y()(v()(t),"state",{}),y()(v()(t),"playSound",(function(e){"new_message"==e.type?(!0===e.sound_on&&(!1===e.widget_open||!0===e.widget_open&&0==window.lhcChat.is_focused)&&t.playSoundFile("new_message"),0==e.widget_open&&I.a.sendMessageParent("unread_message",[{msop:e.msop||null,msg_body:e.msg_body||null,type:"unread_message",otm:e.otm||0}])):"new_invitation"==e.type&&!0===e.sound_on?null===I.a.getSessionStorage("_invs")&&(I.a.setSessionStorage("_invs",1),t.playSoundFile("new_invitation")):"new_chat"==e.type&&!0===e.sound_on&&t.playSoundFile("new_invitation"),0==window.lhcChat.is_focused&&I.a.sendMessageParent("unread_message_title",[{status:!1}])})),y()(v()(t),"playSoundFile",(function(e){new ve.Howl({src:[window.lhcChat.base_url+"/widgetrestapi/loadsound/"+e+"_mp3",window.lhcChat.base_url+"/widgetrestapi/loadsound/"+e+"_ogg",window.lhcChat.base_url+"/widgetrestapi/loadsound/"+e+"_wav"],format:["mp3","ogg","wav"],autoplay:!0})})),I.a.eventEmitter.addListener("play_sound",(function(e){return t.playSound(e)})),t}return d()(i,[{key:"render",value:function(){return null}}]),i}(r.PureComponent),ye=(0,b.$j)()(we);var be=function(e){h()(i,e);var t,a,n=(t=i,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 i=f()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return _()(this,e)});function i(e){var t;return c()(this,i),(t=n.call(this,e)).state={hasError:!1},t}return d()(i,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t}),I.a.logJSError({stack:e.stack?JSON.stringify(e.stack):""})}},{key:"render",value:function(){return this.state.hasError?r.createElement("p",null,"Please re-load window because of an error."):this.props.children}}]),i}(r.Component);var Ee=function(e){h()(i,e);var t,a,n=(t=i,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 i=f()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return _()(this,e)});function i(){return c()(this,i),n.apply(this,arguments)}return d()(i,[{key:"render",value:function(){return r.createElement(r.Fragment,null,r.createElement(be,null,r.createElement(ye,null),r.createElement(me,null)))}}]),i}(r.Component),Ie=Ee;function De(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Se(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function Te(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:je,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Pe:return!1===e.get("isChatting")&&(e=e.set("processStatus",0).set("isOfflineMode",!1)),e.set("shown",!1);case"loadedCore":return e.set("loadedCore",!0);case"attr_set":return e.setIn(t.attr,t.data);case"profile_pic":return e.set("profile_pic",-1!==t.data.indexOf("http:")||-1!==t.data.indexOf("https:")?t.data:window.lhcChat.base_url+"widgetrestapi/avatar/"+t.data);case"attr_rem":return e.removeIn(t.attr);case"operator":case"leave_message":case"phash":case"pvhash":case"attr_prefill":case"attr_prefill_admin":case Le:case"base_url":case"theme":case"jsVars":case"jsVarsPrefill":case"subject_id":case"bot_id":case"trigger_id":case"priority":case"lang":return e.set(t.type,t.data);case"widgetStatus":return 1==t.data&&!0===e.getIn(["proactive","pending"])&&(e=e.setIn(["proactive","pending"],!1)),1==t.data&&e.hasIn(["proactive","data","hide_on_open"])&&(e=e.set("proactive",(0,He.d0)({pending:!1,has:!1,data:{}}))),e.set("shown",t.data);case"PROACTIVE":return e.set("proactive",{pending:!1===e.get("shown")&&!1===t.data.qinv,has:!0,data:t.data});case"HIDE_INVITATION":return e.setIn(["proactive","pending"],!1);case"CANCEL_INVITATION":return e.set("proactive",(0,He.d0)({pending:!1,has:!1,data:{}}));case"FULL_INVITATION":return e.setIn(["proactive","pending"],!1);case Be:return e.setIn(["usersettings","soundOn"],t.data);case Ne:return e.set("shown",!1).set("processStatus",0).set("isChatting",!1).set("newChat",!0).set("proactive",(0,He.d0)({pending:!1,has:!1,data:{}})).set("chatData",(0,He.d0)({})).removeIn(["chat_ui","survey_id"]).removeIn(["chat_ui","cmmsg_widget"]).setIn(["onlineData","fetched"],!1).set("chatLiveData",(0,He.d0)({lmsop:0,vtm:0,otm:0,msop:0,uid:0,status:0,status_sub:0,uw:!1,ott:"",closed:!1,lfmsgid:0,lmsgid:0,operator:"",messages:[]})).set("chatStatusData",(0,He.d0)({})).set("chat_ui_state",(0,He.d0)({confirm_close:0,show_survey:0,pre_survey_done:0})).set("initClose",!1).set("initLoaded",!1);case"chat_status_changed":return e.setIn(["chatLiveData","ott"],t.data.text);case Re:return e.set("isOnline",t.data);case Fe:return e.set("offlineData",(0,He.d0)({fetched:!0,disabled:t.data.disabled,fields_visible:t.data.fields_visible,fields:t.data.fields,department:t.data.department})).set("chat_ui",e.get("chat_ui").merge((0,He.d0)(t.data.chat_ui)));case"department":case"mode":case"product":case"captcha":return e.set(t.type,(0,He.d0)(t.data));case"INIT_PRODUCTS":return e.setIn(["onlineData","department","products"],(0,He.d0)(t.data.products)).setIn(["onlineData","department","settings","product_required"],t.data.required);case"CHAT_SESSION_REFFERER":return e.set("ses_ref",t.data.ref);case"CHAT_ADD_OVERRIDE":return e.update("overrides",(function(e){return e.push(t.data)}));case"CHAT_REMOVE_OVERRIDE":return e.update("overrides",(function(e){return e.filter((function(e){return e!=t.data}))}));case Ue:return!0===t.data.success?(I.a.sendMessageParent("chatStarted",[t.data.chatData,e.get("mode")]),"popup"==e.get("mode")&&(!0===I.a.hasSessionStorage?(I.a.setSessionStorage("_chat",JSON.stringify(t.data.chatData)),I.a.removeSessionStorage("_reset_chat")):document.location="#/"+t.data.chatData.id+"/"+t.data.chatData.hash),e.set("processStatus",2).set("isChatting",!0).set("chatData",(0,He.d0)(t.data.chatData)).set("validationErrors",(0,He.d0)({}))):e.set("validationErrors",(0,He.d0)(t.data.errors)).set("processStatus",0).setIn(["chat_ui","auto_start"],!1);case"OFFLINE_SUBMITTED":return!0===t.data.success?(I.a.sendMessageParent("offlineMessage",[]),e.set("processStatus",2).set("validationErrors",(0,He.d0)({}))):e.set("validationErrors",(0,He.d0)(t.data.errors)).set("processStatus",0);case"INIT_CLOSE":return e.set("initClose",!0);case"CHAT_ALREADY_STARTED":return e.set("processStatus",2).set("isChatting",!0).set("newChat",!1).set("chatData",(0,He.d0)(t.data));case"OFFLINE_SUBMITTING":return e.set("processStatus",1);case"CHAT_SET_VID":return e.set("vid",t.data);case"ONLINE_SUBMITTING":return e.set("processStatus",1);case"UI_STATE":return e.setIn(["chat_ui_state",t.data.attr],t.data.val);case"INIT_CHAT_SUBMITTED":return t.data.chat_ui_state&&(e=e.set("chat_ui_state",e.get("chat_ui_state").merge((0,He.d0)(t.data.chat_ui_state)))),e.setIn(["chatLiveData","operator"],t.data.operator).set("chat_ui",e.get("chat_ui").merge((0,He.d0)(t.data.chat_ui))).setIn(["chatLiveData","status_sub"],t.data.status_sub).setIn(["chatLiveData","status"],t.data.status).set("initLoaded",!0).setIn(["chatLiveData","closed"],t.data.closed&&!0===t.data.closed);case"REFRESH_UI_COMPLETED":return t.data.chat_ui_remove&&t.data.chat_ui_remove.forEach((function(t){e=e.removeIn(t)})),e.set("chat_ui",e.get("chat_ui").merge((0,He.d0)(t.data.chat_ui)));case"FETCH_MESSAGE_SUBMITTED":var a=e.getIn(["chatLiveData","messages"]).findIndex((function(e){if(e.msg.includes('id="msg-'+t.data.id+'"'))return!0}));if(-1!==a){var n=document.createElement("div");n.innerHTML=e.getIn(["chatLiveData","messages",a,"msg"]);var i=n.querySelector("#msg-"+t.data.id);i&&(n.innerHTML=n.innerHTML.replace(i.outerHTML,t.data.msg),e=e.setIn(["chatLiveData","messages",a,"msg"],n.innerHTML))}return e;case"FETCH_MESSAGES_SUBMITTED":return t.data.closed_arg&&t.data.closed_arg.survey_id&&(e=e.setIn(["chat_ui","survey_id"],t.data.closed_arg.survey_id)),t.data.disable_survey&&(e=e.removeIn(["chat_ui","survey_id"])),t.data.extension&&(e=e.set("extension",e.get("extension").merge((0,He.d0)(t.data.extension)))),""!==t.data.messages&&(e=e.updateIn(["chatLiveData","messages"],(function(a){return a.push({lmsop:e.getIn(["chatLiveData","msop"]),msop:t.data.msop,msg:t.data.messages})})).setIn(["chatLiveData","uw"],t.data.uw&&!0===t.data.uw).setIn(["chatLiveData","lmsgid"],t.data.message_id).setIn(["chatLiveData","lfmsgid"],t.data.message_id_first).setIn(["chatLiveData","msop"],t.data.lmsop||t.data.msop)),t.data.vtm&&(e=e.updateIn(["chatLiveData","vtm"],(function(e){return e+t.data.vtm}))),t.data.otm&&(e=e.setIn(["chatLiveData","otm"],t.data.otm)),e.get("overrides").contains("typing")||(e=e.setIn(["chatLiveData","ott"],t.data.ott)),e.setIn(["chatLiveData","status_sub"],t.data.status_sub).setIn(["chatLiveData","status"],t.data.status).set("msgLoaded",!0).set("network_down",!1).setIn(["chatLiveData","closed"],t.data.closed&&!0===t.data.closed);case"CHECK_CHAT_STATUS_FINISHED":return t.data.extension&&(e=e.set("extension",e.get("extension").merge((0,He.d0)(t.data.extension)))),e.set("chatStatusData",(0,He.d0)(t.data)).setIn(["chatLiveData","closed"],t.data.closed&&!0===t.data.closed||e.getIn(["chatLiveData","closed"])).setIn(["chatLiveData","status"],t.data.status).setIn(["chatLiveData","uid"],t.data.uid).setIn(["chatLiveData","ru"],t.data.ru?t.data.ru:null).set("chat_ui",e.get("chat_ui").merge((0,He.d0)(t.data.chat_ui))).set("network_down",!1).setIn(["chatLiveData","status_sub"],t.data.status_sub);case"ONLINE_FIELDS_UPDATED":return e.set("onlineData",(0,He.d0)({dep_forms:t.data.dep_forms,disabled:t.data.disabled,fetched:!0,paid:t.data.paid,fields_visible:t.data.fields_visible,fields:t.data.fields,department:t.data.department})).set("chat_ui",e.get("chat_ui").merge((0,He.d0)(t.data.chat_ui)));case"CHAT_UI_UPDATE":return e.set("chat_ui",e.get("chat_ui").merge((0,He.d0)(t.data)));case"CUSTOM_FIELDS":return e.set("customData",(0,He.d0)({fields:t.data}));case"dep_default":return e.set("departmentDefault",t.data);case"survey":return e.setIn(["chat_ui","survey_id"],t.data);case"CUSTOM_FIELDS_ITEM":return e.setIn(["customData","fields",t.data.id,"value"],t.data.value);case"ADD_MESSAGES_SUBMITTED":return e.setIn(["chatLiveData","error"],t.data.r).setIn(["chatLiveData","lmsg"],t.data.r?t.data.msg:"");case"NO_CONNECTION":return e.set("network_down",t.data);default:return e}}}),qe=a(3894),Ke=a(5068),Ve=a(696),ze=a(5397),Ge=a(5538);Ve.Z.use(Ge.Z).use(ze.Db);var $e=Ve.Z,Ze=function(){for(var e=arguments.length,t=new Array(e),a=0;a-1};function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function d(e){return"string"!=typeof e&&(e=String(e)),e}function u(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function _(e){return new Promise((function(t,a){e.onload=function(){t(e.result)},e.onerror=function(){a(e.error)}}))}function g(e){var t=new FileReader,a=_(t);return t.readAsArrayBuffer(e),a}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:a&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,a,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,a=_(t=new FileReader),t.readAsText(e),a;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),a=new Array(t.length),n=0;n-1?n:a),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function y(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var a=e.split("="),n=a.shift().replace(/\+/g," "),i=a.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},m.call(w.prototype),m.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];b.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var a=Error(e);this.stack=a.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function I(e,a){return new Promise((function(n,r){var s=new w(e,a);if(s.signal&&s.signal.aborted)return r(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function c(){o.abort()}o.onload=function(){var e,t,a={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var a=e.split(":"),n=a.shift().trim();if(n){var i=a.join(":").trim();t.append(n,i)}})),t)};a.url="responseURL"in o?o.responseURL:a.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;n(new b(i,a))},o.onerror=function(){r(new TypeError("Network request failed"))},o.ontimeout=function(){r(new TypeError("Network request failed"))},o.onabort=function(){r(new t.DOMException("Aborted","AbortError"))},o.open(s.method,s.url,!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&i&&(o.responseType="blob"),s.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",c),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",c)}),o.send(void 0===s._bodyInit?null:s._bodyInit)}))}I.polyfill=!0,e.fetch||(e.fetch=I,e.Headers=h,e.Request=w,e.Response=b),t.Headers=h,t.Request=w,t.Response=b,t.fetch=I,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},8679:function(e,t,a){"use strict";var n=a(9864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};function c(e){return n.isMemo(e)?s:o[e.$$typeof]||i}o[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[n.Memo]=s;var l=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,_=Object.prototype;e.exports=function e(t,a,n){if("string"!=typeof a){if(_){var i=p(a);i&&i!==_&&e(t,i,n)}var s=d(a);u&&(s=s.concat(u(a)));for(var o=c(t),g=c(a),f=0;f=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,r.ctx.currentTime);for(var a=0;a=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,p()),e},codecs:function(e){return(this||r)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||r;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(t){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||r,t=null;try{t="undefined"!=typeof Audio?new Audio:null}catch(t){return e}if(!t||"function"!=typeof t.canPlayType)return e;var a=t.canPlayType("audio/mpeg;").replace(/^no$/,""),n=e._navigator?e._navigator.userAgent:"",i=n.match(/OPR\/([0-6].)/g),s=i&&parseInt(i[0].split("/")[1],10)<33,o=-1!==n.indexOf("Safari")&&-1===n.indexOf("Chrome"),c=n.match(/Version\/(.*?) /),l=o&&c&&parseInt(c[1],10)<15;return e._codecs={mp3:!(s||!a&&!t.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!a,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(l||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(l||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||r;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(a){for(;e._html5AudioPool.length0?o._seek:a._sprite[e][0]/1e3),d=Math.max(0,(a._sprite[e][0]+a._sprite[e][1])/1e3-l),u=1e3*d/Math.abs(o._rate),h=a._sprite[e][0]/1e3,p=(a._sprite[e][0]+a._sprite[e][1])/1e3;o._sprite=e,o._ended=!1;var _=function(){o._paused=!1,o._seek=l,o._start=h,o._stop=p,o._loop=!(!o._loop&&!a._sprite[e][2])};if(!(l>=p)){var g=o._node;if(a._webAudio){var f=function(){a._playLock=!1,_(),a._refreshBuffer(o);var e=o._muted||a._muted?0:o._volume;g.gain.setValueAtTime(e,r.ctx.currentTime),o._playStart=r.ctx.currentTime,void 0===g.bufferSource.start?o._loop?g.bufferSource.noteGrainOn(0,l,86400):g.bufferSource.noteGrainOn(0,l,d):o._loop?g.bufferSource.start(0,l,86400):g.bufferSource.start(0,l,d),u!==1/0&&(a._endTimers[o._id]=setTimeout(a._ended.bind(a,o),u)),t||setTimeout((function(){a._emit("play",o._id),a._loadQueue()}),0)};"running"===r.state&&"interrupted"!==r.ctx.state?f():(a._playLock=!0,a.once("resume",f),a._clearTimer(o._id))}else{var m=function(){g.currentTime=l,g.muted=o._muted||a._muted||r._muted||g.muted,g.volume=o._volume*r.volume(),g.playbackRate=o._rate;try{var n=g.play();if(n&&"undefined"!=typeof Promise&&(n instanceof Promise||"function"==typeof n.then)?(a._playLock=!0,_(),n.then((function(){a._playLock=!1,g._unlocked=!0,t?a._loadQueue():a._emit("play",o._id)})).catch((function(){a._playLock=!1,a._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),o._ended=!0,o._paused=!0}))):t||(a._playLock=!1,_(),a._emit("play",o._id)),g.playbackRate=o._rate,g.paused)return void a._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||o._loop?a._endTimers[o._id]=setTimeout(a._ended.bind(a,o),u):(a._endTimers[o._id]=function(){a._ended(o),g.removeEventListener("ended",a._endTimers[o._id],!1)},g.addEventListener("ended",a._endTimers[o._id],!1))}catch(e){a._emit("playerror",o._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===g.src&&(g.src=a._src,g.load());var v=window&&window.ejecta||!g.readyState&&r._navigator.isCocoonJS;if(g.readyState>=3||v)m();else{a._playLock=!0,a._state="loading";var w=function(){a._state="loaded",m(),g.removeEventListener(r._canPlayEvent,w,!1)};g.addEventListener(r._canPlayEvent,w,!1),a._clearTimer(o._id)}}return o._id}a._ended(o)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var a=t._getSoundIds(e),n=0;n=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else i.length>=2&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if(!(void 0!==e&&e>=0&&e<=1))return(a=t?n._soundById(t):n._sounds[0])?a._volume:0;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"volume",action:function(){n.volume.apply(n,i)}}),n;void 0===t&&(n._volume=e),t=n._getSoundIds(t);for(var c=0;c0?n/l:n),u=Date.now();e._fadeTo=a,e._interval=setInterval((function(){var i=(Date.now()-u)/n;u=Date.now(),o+=c*i,o=Math.round(100*o)/100,o=c<0?Math.max(a,o):Math.min(a,o),s._webAudio?e._volume=o:s.volume(o,e._id,!0),r&&(s._volume=o),(at&&o>=a)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,s.volume(a,e._id),s._emit("fade",e._id))}),d)},_stopFade:function(e){var t=this,a=t._soundById(e);return a&&a._interval&&(t._webAudio&&a._node.gain.cancelScheduledValues(r.ctx.currentTime),clearInterval(a._interval),a._interval=null,t.volume(a._fadeTo,e),a._fadeTo=null,t._emit("fade",e)),t},loop:function(){var e,t,a,n=this,i=arguments;if(0===i.length)return n._loop;if(1===i.length){if("boolean"!=typeof i[0])return!!(a=n._soundById(parseInt(i[0],10)))&&a._loop;e=i[0],n._loop=e}else 2===i.length&&(e=i[0],t=parseInt(i[1],10));for(var r=n._getSoundIds(t),s=0;s=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else 2===i.length&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if("number"!=typeof e)return(a=n._soundById(t))?a._rate:n._rate;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"rate",action:function(){n.rate.apply(n,i)}}),n;void 0===t&&(n._rate=e),t=n._getSoundIds(t);for(var c=0;c=0?t=parseInt(n[0],10):a._sounds.length&&(t=a._sounds[0]._id,e=parseFloat(n[0]))}else 2===n.length&&(e=parseFloat(n[0]),t=parseInt(n[1],10));if(void 0===t)return 0;if("number"==typeof e&&("loaded"!==a._state||a._playLock))return a._queue.push({event:"seek",action:function(){a.seek.apply(a,n)}}),a;var o=a._soundById(t);if(o){if(!("number"==typeof e&&e>=0)){if(a._webAudio){var c=a.playing(t)?r.ctx.currentTime-o._playStart:0,l=o._rateSeek?o._rateSeek-o._seek:0;return o._seek+(l+c*Math.abs(o._rate))}return o._node.currentTime}var d=a.playing(t);d&&a.pause(t,!0),o._seek=e,o._ended=!1,a._clearTimer(t),a._webAudio||!o._node||isNaN(o._node.duration)||(o._node.currentTime=e);var u=function(){d&&a.play(t,!0),a._emit("seek",t)};if(d&&!a._webAudio){var h=function(){a._playLock?setTimeout(h,0):u()};setTimeout(h,0)}else u()}return a},playing:function(e){var t=this;if("number"==typeof e){var a=t._soundById(e);return!!a&&!a._paused}for(var n=0;n=0&&r._howls.splice(n,1);var i=!0;for(a=0;a=0){i=!1;break}return c&&i&&delete c[e._src],r.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,a,n){var i=this["_on"+e];return"function"==typeof t&&i.push(n?{id:a,fn:t,once:n}:{id:a,fn:t}),this},off:function(e,t,a){var n=this,i=n["_on"+e],r=0;if("number"==typeof t&&(a=t,t=null),t||a)for(r=0;r=0;r--)i[r].id&&i[r].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,a)}.bind(n,i[r].fn),0),i[r].once&&n.off(e,i[r].fn,i[r].id));return n._loadQueue(e),n},_loadQueue:function(e){var t=this;if(t._queue.length>0){var a=t._queue[0];a.event===e&&(t._queue.shift(),t._loadQueue()),e||a.action()}return t},_ended:function(e){var t=this,a=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;n--){if(a<=t)return;e._sounds[n]._ended&&(e._webAudio&&e._sounds[n]._node&&e._sounds[n]._node.disconnect(0),e._sounds.splice(n,1),a--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],a=0;a=0;if(r._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=r._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(r._navigator&&r._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var o=function(e){this._parent=e,this.init()};o.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++r._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,a=r._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=void 0===r.ctx.createGain?r.ctx.createGainNode():r.ctx.createGain(),e._node.gain.setValueAtTime(a,r.ctx.currentTime),e._node.paused=!0,e._node.connect(r.masterGain)):r.noAudio||(e._node=r._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(r._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=t._src,e._node.preload=!0===t._preload?"auto":t._preload,e._node.volume=a*r.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++r._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),e._node.removeEventListener(r._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(10*e._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var c={},l=function(e){var t=e._src;if(c[t])return e._duration=c[t].duration,void h(e);if(/^data:[^;]+;base64,/.test(t)){for(var a=atob(t.split(",")[1]),n=new Uint8Array(a.length),i=0;i0?(c[t._src]=e,h(t,e)):a()};"undefined"!=typeof Promise&&1===r.ctx.decodeAudioData.length?r.ctx.decodeAudioData(e).then(n).catch(a):r.ctx.decodeAudioData(e,n,a)},h=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},p=function(){if(r.usingWebAudio){try{"undefined"!=typeof AudioContext?r.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?r.ctx=new webkitAudioContext:r.usingWebAudio=!1}catch(e){r.usingWebAudio=!1}r.ctx||(r.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(r._navigator&&r._navigator.platform),t=r._navigator&&r._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),a=t?parseInt(t[1],10):null;if(e&&a&&a<9){var n=/safari/.test(r._navigator&&r._navigator.userAgent.toLowerCase());r._navigator&&!n&&(r.usingWebAudio=!1)}r.usingWebAudio&&(r.masterGain=void 0===r.ctx.createGain?r.ctx.createGainNode():r.ctx.createGain(),r.masterGain.gain.setValueAtTime(r._muted?0:r._volume,r.ctx.currentTime),r.masterGain.connect(r.ctx.destination)),r._setup()}};void 0===(n=function(){return{Howler:r,Howl:s}}.apply(t,[]))||(e.exports=n),t.Howler=r,t.Howl=s,void 0!==a.g?(a.g.HowlerGlobal=i,a.g.Howler=r,a.g.Howl=s,a.g.Sound=o):"undefined"!=typeof window&&(window.HowlerGlobal=i,window.Howler=r,window.Howl=s,window.Sound=o)}(),function(){"use strict";var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var a=t._howls.length-1;a>=0;a--)t._howls[a].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,a){var n=this;return n.ctx&&n.ctx.listener?(t="number"!=typeof t?n._pos[1]:t,a="number"!=typeof a?n._pos[2]:a,"number"!=typeof e?n._pos:(n._pos=[e,t,a],void 0!==n.ctx.listener.positionX?(n.ctx.listener.positionX.setTargetAtTime(n._pos[0],Howler.ctx.currentTime,.1),n.ctx.listener.positionY.setTargetAtTime(n._pos[1],Howler.ctx.currentTime,.1),n.ctx.listener.positionZ.setTargetAtTime(n._pos[2],Howler.ctx.currentTime,.1)):n.ctx.listener.setPosition(n._pos[0],n._pos[1],n._pos[2]),n)):n},HowlerGlobal.prototype.orientation=function(e,t,a,n,i,r){var s=this;if(!s.ctx||!s.ctx.listener)return s;var o=s._orientation;return t="number"!=typeof t?o[1]:t,a="number"!=typeof a?o[2]:a,n="number"!=typeof n?o[3]:n,i="number"!=typeof i?o[4]:i,r="number"!=typeof r?o[5]:r,"number"!=typeof e?o:(s._orientation=[e,t,a,n,i,r],void 0!==s.ctx.listener.forwardX?(s.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),s.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),s.ctx.listener.forwardZ.setTargetAtTime(a,Howler.ctx.currentTime,.1),s.ctx.listener.upX.setTargetAtTime(n,Howler.ctx.currentTime,.1),s.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),s.ctx.listener.upZ.setTargetAtTime(r,Howler.ctx.currentTime,.1)):s.ctx.listener.setOrientation(e,t,a,n,i,r),s)},Howl.prototype.init=(e=Howl.prototype.init,function(t){var a=this;return a._orientation=t.orientation||[1,0,0],a._stereo=t.stereo||null,a._pos=t.pos||null,a._pannerAttr={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:360,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:360,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:0,distanceModel:void 0!==t.distanceModel?t.distanceModel:"inverse",maxDistance:void 0!==t.maxDistance?t.maxDistance:1e4,panningModel:void 0!==t.panningModel?t.panningModel:"HRTF",refDistance:void 0!==t.refDistance?t.refDistance:1,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:1},a._onstereo=t.onstereo?[{fn:t.onstereo}]:[],a._onpos=t.onpos?[{fn:t.onpos}]:[],a._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}),Howl.prototype.stereo=function(e,a){var n=this;if(!n._webAudio)return n;if("loaded"!==n._state)return n._queue.push({event:"stereo",action:function(){n.stereo(e,a)}}),n;var i=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===a){if("number"!=typeof e)return n._stereo;n._stereo=e,n._pos=[e,0,0]}for(var r=n._getSoundIds(a),s=0;s/i,h=//i,p=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,_=s.isIE(9),g=_||s.isIE();if("function"==typeof window.DOMParser){var f=new window.DOMParser,m=_?"text/xml":"text/html";n=function(e,t){return t&&(e="<"+t+">"+e+""),_&&(e=e.replace(p,"<$1$2$3/>")),f.parseFromString(e,m)}}if("object"==typeof document.implementation){var v=document.implementation.createHTMLDocument(g?"HTML_DOM_PARSER_TITLE":void 0);i=function(e,t){if(t)return v.documentElement.getElementsByTagName(t)[0].innerHTML=e,v;try{return v.documentElement.innerHTML=e,v}catch(t){if(n)return n(e)}}}var w=document.createElement("template");w.content&&(r=function(e){return w.innerHTML=e,w.content.childNodes});var y=i||n;e.exports=function(e){var t,a,i,s,p=e.match(d);switch(p&&p[1]&&(t=p[1].toLowerCase()),t){case o:if(n)return a=n(e),u.test(e)||(i=a.getElementsByTagName(c)[0])&&i.parentNode.removeChild(i),h.test(e)||(i=a.getElementsByTagName(l)[0])&&i.parentNode.removeChild(i),a.getElementsByTagName(o);break;case c:case l:if(y)return s=y(e).getElementsByTagName(t),h.test(e)&&u.test(e)?s[0].parentNode.childNodes:s;break;default:if(r)return r(e);if(y)return y(e,l).getElementsByTagName(l)[0].childNodes}return[]}},5057:function(e,t,a){var n=a(6982),i=a(3412),r=i.formatDOM,s=i.isIE(9),o=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,a=e.match(o);return a&&a[1]&&(t=a[1],s&&(e=e.replace(a[0],""))),r(n(e),null,t)}},3412:function(e,t,a){for(var n,i=a(9804).CASE_SENSITIVE_TAG_NAMES,r={},s=0,o=i.length;s=0;--r){var s=this.tryEntries[r],o=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev=0;--a){var i=this.tryEntries[a];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),T(a),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var n=a.completion;if("throw"===n.type){var i=n.arg;T(a)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,n){return this.delegate={iterator:k(e),resultName:a,nextLoc:n},"next"===this.method&&(this.arg=t),_}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},53:function(e,t){"use strict";var a,n,i,r,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var o=null,c=null,l=function(){if(null!==o)try{var e=t.unstable_now();o(!0,e),o=null}catch(e){throw setTimeout(l,0),e}},d=Date.now();t.unstable_now=function(){return Date.now()-d},a=function(e){null!==o?setTimeout(a,0,e):(o=e,setTimeout(l,0))},n=function(e,t){c=setTimeout(e,t)},i=function(){clearTimeout(c)},r=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var u=window.performance,h=window.Date,p=window.setTimeout,_=window.clearTimeout;if("undefined"!=typeof console){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof u&&"function"==typeof u.now)t.unstable_now=function(){return u.now()};else{var f=h.now();t.unstable_now=function(){return h.now()-f}}var m=!1,v=null,w=-1,y=5,b=0;r=function(){return t.unstable_now()>=b},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,i=e[n];if(!(void 0!==i&&0C(s,a))void 0!==c&&0>C(c,s)?(e[n]=c,e[o]=a,n=o):(e[n]=s,e[r]=a,n=r);else{if(!(void 0!==c&&0>C(c,a)))break e;e[n]=c,e[o]=a,n=o}}}return t}return null}function C(e,t){var a=e.sortIndex-t.sortIndex;return 0!==a?a:e.id-t.id}var k=[],O=[],A=1,x=null,M=3,P=!1,L=!1,R=!1;function B(e){for(var t=S(O);null!==t;){if(null===t.callback)T(O);else{if(!(t.startTime<=e))break;T(O),t.sortIndex=t.expirationTime,D(k,t)}t=S(O)}}function N(e){if(R=!1,B(e),!L)if(null!==S(k))L=!0,a(F);else{var t=S(O);null!==t&&n(N,t.startTime-e)}}function F(e,a){L=!1,R&&(R=!1,i()),P=!0;var s=M;try{for(B(a),x=S(k);null!==x&&(!(x.expirationTime>a)||e&&!r());){var o=x.callback;if(null!==o){x.callback=null,M=x.priorityLevel;var c=o(x.expirationTime<=a);a=t.unstable_now(),"function"==typeof c?x.callback=c:x===S(k)&&T(k),B(a)}else T(k);x=S(k)}if(null!==x)var l=!0;else{var d=S(O);null!==d&&n(N,d.startTime-a),l=!1}return l}finally{x=null,M=s,P=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var H=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){L||P||(L=!0,a(F))},t.unstable_getCurrentPriorityLevel=function(){return M},t.unstable_getFirstCallbackNode=function(){return S(k)},t.unstable_next=function(e){switch(M){case 1:case 2:case 3:var t=3;break;default:t=M}var a=M;M=t;try{return e()}finally{M=a}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=H,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=M;M=e;try{return t()}finally{M=a}},t.unstable_scheduleCallback=function(e,r,s){var o=t.unstable_now();if("object"==typeof s&&null!==s){var c=s.delay;c="number"==typeof c&&0o?(e.sortIndex=c,D(O,e),null===S(k)&&e===S(O)&&(R?i():R=!0,n(N,c-o))):(e.sortIndex=s,D(k,e),L||P||(L=!0,a(F))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();B(e);var a=S(k);return a!==x&&null!==x&&null!==a&&null!==a.callback&&a.startTime<=e&&a.expirationTime=this.touchStartX?(this.onSwipeRightAgent&&this.onSwipeRightAgent(),"swiped right"):this.touchEndY+this.options.threshold<=this.touchStartY?(this.onSwipeUpAgent&&this.onSwipeUpAgent(),"swiped up"):this.touchEndY-this.options.threshold>=this.touchStartY?(this.onSwipeDownAgent&&this.onSwipeDownAgent(),"swiped down"):this.touchEndY===this.touchStartY?(this.onTapAgent&&this.onTapAgent(),"tap"):void 0}}}},__webpack_module_cache__={},deferred,leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var a=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(a.exports,a,a.exports,__webpack_require__),a.exports}__webpack_require__.m=__webpack_modules__,deferred=[],__webpack_require__.O=function(e,t,a,n){if(!t){var i=1/0;for(c=0;c=n)&&Object.keys(__webpack_require__.O).every((function(e){return __webpack_require__.O[e](t[s])}))?t.splice(s--,1):(r=!1,n0&&deferred[c-1][2]>n;c--)deferred[c]=deferred[c-1];deferred[c]=[t,a,n]},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var a=Object.create(null);__webpack_require__.r(a);var n={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&t&&e;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((function(t){n[t]=function(){return e[t]}}));return n.default=function(){return e},__webpack_require__.d(a,n),a},__webpack_require__.d=function(e,t){for(var a in t)__webpack_require__.o(t,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},__webpack_require__.f={},__webpack_require__.e=function(e){return Promise.all(Object.keys(__webpack_require__.f).reduce((function(t,a){return __webpack_require__.f[a](e,t),t}),[]))},__webpack_require__.u=function(e){return e+"."+{218:"5fd9b6569a5e09b99c04",261:"f9508b095570e4c54db7",476:"430b407336b2c532e572",502:"7d9075974af1f1c56a6a",536:"daa69d70da79b79bc1ec",800:"8c3bfdb4ac7cf39ec020",815:"8e6ab21729cb74142161",906:"7600912896be0876d73b"}[e]+".js"},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},inProgress={},dataWebpackPrefix="LHCReactAPP:",__webpack_require__.l=function(e,t,a,n){if(inProgress[e])inProgress[e].push(t);else{var i,r;if(void 0!==a)for(var s=document.getElementsByTagName("script"),o=0;o0||a.chatwidget.getIn(["chatLiveData","status"])===_constants_chat_status__WEBPACK_IMPORTED_MODULE_2__.pA)),r=a.chatwidget.getIn(["chatLiveData","status"])==_constants_chat_status__WEBPACK_IMPORTED_MODULE_2__.sk&&a.chatwidget.getIn(["chatLiveData","uid"])>0;(1==i||r)&&a.chatwidget.hasIn(["chat_ui","survey_id"])&&(a.chatwidget.hasIn(["chat_ui","survey_button"])&&1!==a.chatwidget.getIn(["chat_ui_state","show_survey"])&&1!=i||(n=!0)),a.chatwidget.hasIn(["chat_ui","close_on_unload"])&&"embed"==a.chatwidget.get("mode")&&(!1!==a.chatwidget.get("isMobile")&&!0!==n||_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("endChat",[{sender:"endButton"}])),"popup"==a.chatwidget.get("mode")&&1==n&&_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("endChat",[{sender:"endButton"}]),a.chatwidget.hasIn(["chatData","id"])&&a.chatwidget.hasIn(["chatData","hash"])?axios__WEBPACK_IMPORTED_MODULE_0___default().post(window.lhcChat.base_url+"chat/userclosechat/"+a.chatwidget.getIn(["chatData","id"])+"/"+a.chatwidget.getIn(["chatData","hash"]),null,defaultHeaders):!0===a.chatwidget.getIn(["proactive","has"])&&"popup"==window.lhcChat.mode&&window.opener&&hideInvitation()(e,t)}}function checkErrorCounter(){2==syncStatus.error_counter&&_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("reloadWidget",[])}function addMessage(e){return function(t,a){if(1!=syncStatus.add_msg){syncStatus.add_msg=!0;try{_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("messageSend",[{chat_id:e.id,hash:e.hash,msg:e.msg}])}catch(e){_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.logJSError({stack:JSON.stringify(JSON.stringify(e))})}axios__WEBPACK_IMPORTED_MODULE_0___default().post(window.lhcChat.base_url+"widgetrestapi/addmsguser",e,defaultHeaders).then((function(n){try{(n.data.error||a().chatwidget.getIn(["chatLiveData","error"]))&&t({type:"ADD_MESSAGES_SUBMITTED",data:{r:n.data.r,msg:e.msg}}),syncStatus.add_msg=!1,fetchMessages({theme:e.theme,chat_id:e.id,lmgsid:a().chatwidget.getIn(["chatLiveData","lmsgid"]),hash:e.hash})(t,a),n.data.t&&_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.sendMessageParent("botTrigger",[{trigger:n.data.t}]),void 0===n.data.r||!0===n.data.error&&!0===n.data.system?(syncStatus.error_counter++,2==syncStatus.error_counter&&(_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.logJSError({stack:JSON.stringify(JSON.stringify(n)+"\nRD:"+JSON.stringify(n.data)+"\nRH:"+JSON.stringify(n.headers)+"\nRS:"+JSON.stringify(n.status))}),checkErrorCounter()),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("messageSendError",[{chat_id:e.id,hash:e.hash,msg:JSON.stringify(n.data)}])):syncStatus.error_counter=0}catch(e){throw e}finally{syncStatus.add_msg=!1,syncStatus.add_msg_pending.length>0&&addMessage(syncStatus.add_msg_pending.shift())(t,a)}})).catch((function(n){if(isNetworkError(n))t({type:"ADD_MESSAGES_SUBMITTED",data:{r:"SEND_CONNECTION",msg:e.msg}}),t({type:"NO_CONNECTION",data:!0});else{syncStatus.error_counter++;var i;i=n.response?JSON.stringify(JSON.stringify(n)+"\nRD:"+JSON.stringify(n.response.data)+"\nRH:"+JSON.stringify(n.response.headers)+"\nRS:"+JSON.stringify(n.response.status)):(n.request,JSON.stringify(JSON.stringify(n))),2==syncStatus.error_counter?(_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.logJSError({stack:i}),_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("messageSendError",[{chat_id:e.id,hash:e.hash,msg:i}]),checkErrorCounter()):(t({type:"ADD_MESSAGES_SUBMITTED",data:{r:"SEND_FAILED",msg:e.msg}}),syncStatus.add_msg=!1,addMessage(e)(t,a))}syncStatus.add_msg=!1}))}else syncStatus.add_msg_pending.push(e)}}function userTyping(e,t){return function(a,n){var i=n();"true"===e?_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("visitorTyping",[{chat_id:i.chatwidget.getIn(["chatData","id"]),hash:i.chatwidget.getIn(["chatData","hash"]),status:!0,msg:t}]):_lib_helperFunctions__WEBPACK_IMPORTED_MODULE_1__.a.eventEmitter.emitEvent("visitorTyping",[{chat_id:i.chatwidget.getIn(["chatData","id"]),hash:i.chatwidget.getIn(["chatData","hash"]),status:!1}]),i.chatwidget.get("overrides").contains("typing")||axios__WEBPACK_IMPORTED_MODULE_0___default().post(window.lhcChat.base_url+"chat/usertyping/"+i.chatwidget.getIn(["chatData","id"])+"/"+i.chatwidget.getIn(["chatData","hash"])+"/"+e,{msg:t},defaultHeaders).then((function(e){})).catch((function(e){console.log(e)}))}}function submitInlineSurvey(e){return axios__WEBPACK_IMPORTED_MODULE_0___default().post(window.lhcChat.base_url+"survey/fillinline",e,defaultHeaders)}},6313:function(e,t,a){"use strict";var n=a(4575),i=a.n(n),r=a(3913),s=a.n(r),o=a(2205),c=a.n(o),l=a(8585),d=a.n(l),u=a(9754),h=a.n(u),p=a(7294);var _=function(e){c()(r,e);var t,a,n=(t=r,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=h()(t);if(a){var i=h()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return d()(this,e)});function r(e){return i()(this,r),n.call(this,e)}return s()(r,[{key:"render",value:function(){return p.createElement(p.Fragment,null,p.createElement("div",{className:"fade modal-backdrop show"}),p.createElement("div",{role:"dialog",id:"dialog-content","aria-modal":"true",className:"fade modal show d-block p-2",tabIndex:"-1"},p.createElement("div",{className:"modal-content p-2 "+(this.props.full_height?"h-100":"")},this.props.as_html&&p.createElement("div",{className:this.props.full_height?"h-100":"",dangerouslySetInnerHTML:{__html:this.props.text}}),!this.props.as_html&&p.createElement("p",null,this.props.text),p.createElement("div",{className:"modal-footer"},p.createElement("button",{className:"btn btn-secondary btn-sm",onClick:this.props.close,type:"button"},this.props.closeText)))))}}]),r}(p.PureComponent);t.Z=_},5918:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(7154),_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__),_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4575),_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__),_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(3913),_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__),_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1506),_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__),_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(2205),_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__),_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(8585),_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__),_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(9754),_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__),react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(7294),html_react_parser__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(488),html_react_parser__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(html_react_parser__WEBPACK_IMPORTED_MODULE_8__),react_redux__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(6458);function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var a,n=_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(e);if(t){var i=_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this,a)}}function _isNativeReflectConstruct(){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}}var ChatBotIntroMessage=function(_PureComponent){_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(ChatBotIntroMessage,_PureComponent);var _super=_createSuper(ChatBotIntroMessage);function ChatBotIntroMessage(e){var t;return _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this,ChatBotIntroMessage),(t=_super.call(this,e)).abstractClick=t.abstractClick.bind(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(t)),t.updateTriggerClicked=t.updateTriggerClicked.bind(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(t)),t.processBotAction=t.processBotAction.bind(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(t)),t.disableEditor=!1,t}return _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(ChatBotIntroMessage,[{key:"addLoader",value:function(e,t){e["data-no-change"]||"button"!=e.type||(t.setAttribute("disabled","disabled"),t.innerHTML=''+t.innerHTML)}},{key:"abstractClick",value:function(e,t){var a=this.props.t;if(this.addLoader(e,t.target),-1!==e.onclick.indexOf("lhinst.updateTriggerClicked"))this.updateTriggerClicked({type:"triggerclicked"},e,t.target);else if(-1!==e.onclick.indexOf("notificationsLHC.sendNotification"));else if(-1!==e.onclick.indexOf("lhinst.buttonClicked"))this.updateTriggerClicked({type:""},e,t.target);else if(-1!==e.onclick.indexOf("lhinst.updateChatClicked"))this.updateTriggerClicked({type:"",mainType:"updatebuttonclicked"},e,t.target);else if(-1!==e.onclick.indexOf("lhinst.editGenericStep"))this.updateTriggerClicked({type:"editgenericstep"},e,t.target);else if(-1!==e.onclick.indexOf("lhinst.dropdownClicked")){var n=document.getElementById("id_generic_list-"+e["data-id"]);n&&"0"!=n.value&&""!=n.value?(e["data-payload"]=n.value,this.updateTriggerClicked({type:"valueclicked"},e,t.target)):alert(a("bot.please_choose"))}else helperFunctions.emitEvent("MessageClick",[e,this.props.dispatch]),console.log("Unknown click event: "+e.onclick);t.preventDefault()}},{key:"updateTriggerClicked",value:function(e,t,a){this.props.setBotPayload({type:e.type,payload:t["data-payload"],id:t["data-id"],processed:void 0===t["data-keep"]})}},{key:"processBotAction",value:function processBotAction(domNode){var attr=domNode.attribs;"lhinst.disableVisitorEditor"==attr["data-bot-action"]?this.disableEditor=!0:"lhinst.setDelay"==attr["data-bot-action"]||"execute-js"==attr["data-bot-action"]&&eval(domNode.children[0].data)}},{key:"render",value:function(){var e=this;return html_react_parser__WEBPACK_IMPORTED_MODULE_8___default()(this.props.content,{replace:function(t){if(t.attribs){var a=Object.assign({},t.attribs);if(t.attribs.onclick&&delete t.attribs.onclick,t.name&&"button"===t.name){if(a.onclick)return react__WEBPACK_IMPORTED_MODULE_7__.createElement("button",_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},t.attribs,{onClick:function(t){return e.abstractClick(a,t)}}),(0,html_react_parser__WEBPACK_IMPORTED_MODULE_8__.domToReact)(t.children))}else if(t.name&&"a"===t.name){if(a.onclick)return react__WEBPACK_IMPORTED_MODULE_7__.createElement("a",_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({},t.attribs,{onClick:function(t){return e.abstractClick(a,t)}}),(0,html_react_parser__WEBPACK_IMPORTED_MODULE_8__.domToReact)(t.children))}else t.name&&"script"===t.name&&t.attribs["data-bot-action"]&&e.processBotAction(t)}}})}}]),ChatBotIntroMessage}(react__WEBPACK_IMPORTED_MODULE_7__.PureComponent);__webpack_exports__.Z=ChatBotIntroMessage},5198:function(e,t,a){"use strict";var n=a(4575),i=a.n(n),r=a(3913),s=a.n(r),o=a(1506),c=a.n(o),l=a(2205),d=a.n(l),u=a(8585),h=a.n(u),p=a(9754),_=a.n(p),g=a(7294),f=a(7139),m=a(6512),v=a(6458);var w=function(e){d()(r,e);var t,a,n=(t=r,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=_()(t);if(a){var i=_()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return h()(this,e)});function r(e){var t;return i()(this,r),(t=n.call(this,e)).onchangeAttr=t.onchangeAttr.bind(c()(t)),t.onchangeAttrProduct=t.onchangeAttrProduct.bind(c()(t)),t}return s()(r,[{key:"onchangeAttr",value:function(e){this.props.onChangeContent({id:"DepartamentID",value:e.value}),!0===this.props.departments.getIn(["settings","product_by_department"])&&this.props.dispatch((0,m.Xp)({dep_id:e.value}))}},{key:"onchangeAttrProduct",value:function(e){this.props.onChangeContent({id:"ProductID",value:e.value})}},{key:"componentDidMount",value:function(){!0!==this.props.departments.getIn(["settings","product"])||!0!==this.props.departments.getIn(["settings","product_by_department"])&&!this.props.departments.has("products")||this.props.onChangeContent({id:"HasProductID",value:!0}),0!=this.props.departments.get("departments").size&&(1!=this.props.departments.get("departments").size&&this.props.departments.hasIn(["settings","optional"])?this.props.departments.get("departments").size>1&&this.onchangeAttr({value:-1}):this.onchangeAttr({value:this.props.setDefaultValue||this.props.departments.getIn(["departments",0]).get("value")}))}},{key:"render",value:function(){var e=this,t=this.props.t,a=null;if(this.props.departments.get("departments").size>1&&!this.props.departments.hasIn(["settings","hide_department"])){var n=["form-control","form-control-sm"];!0===this.props.isInvalid&&n.push("is-invalid");var i=this.props.departments.get("departments").map((function(e){return g.createElement("option",{key:"dep-"+e.get("value"),value:e.get("value")},e.get("name")," ",e.get("online")?"":t("department.offline"))}));a=g.createElement("div",{className:"form-group"},g.createElement("label",{className:"control-label"},this.props.departments.getIn(["settings","label"]),"*"),g.createElement("select",{id:"id-department-field",defaultValue:this.props.setDefaultValue||this.props.defaultValueField,className:n.join(" "),onChange:function(t){return e.onchangeAttr({value:t.target.value})}},this.props.departments.hasIn(["settings","optional"])&&g.createElement("option",{value:"-1"},this.props.departments.getIn(["settings","optional"])),i))}var r=null;if(!0===this.props.departments.getIn(["settings","product"])){var s=["form-control","form-control-sm"];!0===this.props.isInvalidProduct&&s.push("is-invalid");var o=this.props.departments.has("products")?this.props.departments.get("products").map((function(e){return g.createElement("option",{key:"product-"+e.get("value"),value:e.get("value")},e.get("name"))})):"";this.props.departments.has("products")&&this.props.departments.get("products").size>0&&(r=g.createElement("div",{className:"form-group"},g.createElement("label",{className:"control-label"},t("department.product"),!0===this.props.departments.getIn(["settings","product_required"])?"*":""),g.createElement("select",{className:s.join(" "),onChange:function(t){return e.onchangeAttrProduct({value:t.target.value})}},g.createElement("option",{value:""},t("department.choose_a_product")),o)))}return null!==r||null!==a?g.createElement("div",{className:"col-12"},a,r):null}}]),r}(g.Component);t.Z=(0,v.$j)()((0,f.Z)()(w))},7786:function(e,t,a){"use strict";var n=a(4575),i=a.n(n),r=a(3913),s=a.n(r),o=a(1506),c=a.n(o),l=a(2205),d=a.n(l),u=a(8585),h=a.n(u),p=a(9754),_=a.n(p),g=a(9713),f=a.n(g),m=a(7294),v=a(7139);var w=function(e){d()(r,e);var t,a,n=(t=r,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=_()(t);if(a){var i=_()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return h()(this,e)});function r(e){var t;return i()(this,r),t=n.call(this,e),f()(c()(t),"state",{hiddenIfPrefilled:!1}),t.onchangeAttr=t.onchangeAttr.bind(c()(t)),t.onFileAdded=t.onFileAdded.bind(c()(t)),t}return s()(r,[{key:"onchangeAttr",value:function(e){if(this.props.onChangeContent({id:this.props.field.get("name"),value:e.value,field:this.props.field}),"dropdown"==this.props.field.get("type")){var t=parseInt(e.target.options[e.target.selectedIndex].getAttribute("dep-id"));t>0&&this.props.onChangeContent({id:"DepartamentID",value:t,subject_id:e.target.options[e.target.selectedIndex].getAttribute("subject-id")})}}},{key:"onFileAdded",value:function(e){for(var t=this,a=e.target.files,n=[],i=0;it.props.field.get("fs")&&o.push(e.name+": "+s("file.to_big_file"))})),o.length>0?alert(o.join("\n")):this.props.onChangeContent({id:this.props.field.get("name"),value:n[0],field:this.props.field})}},{key:"componentDidMount",value:function(){var e=this;"checkbox"==this.props.field.get("type")&&1==this.props.field.get("default")?this.props.onChangeContent({id:this.props.field.get("name"),value:!0}):"dropdown"==this.props.field.get("type")&&(this.props.onChangeContent({id:this.props.field.get("name"),value:this.props.defaultValueField}),this.props.field.get("options").map((function(t){t.get("value")==e.props.defaultValueField&&t.get("dep_id")&&e.props.onChangeContent({set_default:!0,id:"DepartamentID",subject_id:t.has("subject_id")?t.get("subject_id"):null,value:t.get("dep_id")})}))),this.props.attrPrefill&&this.props.attrPrefill.attr_prefill_admin&&this.props.attrPrefill.attr_prefill_admin.forEach((function(t){(t.index==e.props.field.get("identifier")||e.props.field.has("identifier_prefill")&&t.index==e.props.field.get("identifier_prefill"))&&(e.props.onChangeContent({id:e.props.field.get("name"),value:t.value}),e.props.field.has("hide_prefilled")&&1==e.props.field.get("hide_prefilled")&&!1===e.props.isInvalid&&e.setState({hiddenIfPrefilled:!0}))}))}},{key:"render",value:function(){var e=this;if(!0===this.state.hiddenIfPrefilled&&!0!==this.props.isInvalid)return null;var t="col-"+this.props.field.get("width"),a=!0===this.props.field.get("required"),n=[];if(""!=this.props.field.get("class")&&n.push(this.props.field.get("class")),!0===this.props.isInvalid&&n.push("is-invalid"),"text"==this.props.field.get("type"))return m.createElement("div",{className:t},m.createElement("div",{className:"form-group"},m.createElement("label",{className:"control-label"},this.props.field.get("label"),!0===a?"*":""),m.createElement("input",{type:"text",className:n.join(" "),required:a,onChange:function(t){return e.onchangeAttr({value:t.target.value})},name:this.props.field.get("name"),defaultValue:this.props.defaultValueField,placeholder:this.props.field.get("placeholder")})));if("password"==this.props.field.get("type"))return m.createElement("div",{className:t},m.createElement("div",{className:"form-group"},m.createElement("label",{className:"control-label"},this.props.field.get("label"),!0===a?"*":""),m.createElement("input",{type:"password",autocomplete:"new-password",className:n.join(" "),required:a,onChange:function(t){return e.onchangeAttr({value:t.target.value})},name:this.props.field.get("name"),defaultValue:this.props.defaultValueField,placeholder:this.props.field.get("placeholder")})));if("textarea"==this.props.field.get("type"))return m.createElement("div",{className:t},m.createElement("div",{className:"form-group"},!this.props.chatUI.has("hide_message_label")&&"question"==this.props.field.get("identifier")&&m.createElement("label",{className:"control-label"},this.props.field.get("label"),!0===a?"*":""),m.createElement("textarea",{className:n.join(" "),required:a,onChange:function(t){return e.onchangeAttr({value:t.target.value})},name:this.props.field.get("name"),defaultValue:this.props.defaultValueField,placeholder:this.props.field.get("placeholder")})));if("file"==this.props.field.get("type"))return m.createElement("div",{className:t},m.createElement("div",{className:"form-group overflow-hidden"},m.createElement("label",{className:"control-label"},this.props.field.get("label"),!0===a?"*":""),m.createElement("input",{type:"file",onChange:function(t){return e.onFileAdded(t)},className:this.props.field.get("class"),required:a,name:this.props.field.get("name")})));if("checkbox"==this.props.field.get("type"))return m.createElement("div",{className:t},m.createElement("div",{className:"form-group"},m.createElement("div",{className:"form-check"},m.createElement("input",{className:n.join(" "),id:"check-for-"+this.props.field.get("name"),defaultChecked:this.props.field.get("default"),type:"checkbox",value:"on",onChange:function(t){return e.onchangeAttr({value:t.target.checked})},required:a,name:this.props.field.get("name")}),m.createElement("label",{className:"form-check-label",for:"check-for-"+this.props.field.get("name"),dangerouslySetInnerHTML:{__html:this.props.field.get("label")}}))));if("hidden"==this.props.field.get("type"))return m.createElement("input",{type:"hidden",className:n.join(" "),required:a,onChange:function(t){return e.onchangeAttr({value:t.target.value})},name:this.props.field.get("name"),defaultValue:this.props.defaultValueField,placeholder:this.props.field.get("placeholder")});if("dropdown"==this.props.field.get("type")){var i=this.props.field.get("options").map((function(t){return m.createElement("option",{key:"opt-drop-"+t.get("value"),"subject-id":t.has("subject_id")?t.get("subject_id"):null,"dep-id":t.get("dep_id"),selected:e.props.defaultValueField==t.get("value"),value:t.get("value")},t.get("name"))}));return m.createElement("div",{className:t},m.createElement("div",{className:"form-group"},m.createElement("label",{className:"control-label"},this.props.field.get("label"),!0===a?"*":""),m.createElement("select",{className:n.join(" "),required:a,onChange:function(t){return e.onchangeAttr({target:t.target,value:t.target.value})},name:this.props.field.get("name"),defaultValue:this.props.defaultValueField},i)))}return console.log("Unknown field"),null}}]),r}(m.Component);t.Z=(0,v.Z)()(w)},2446:function(e,t,a){"use strict";var n=a(7154),i=a.n(n),r=a(4575),s=a.n(r),o=a(3913),c=a.n(o),l=a(1506),d=a.n(l),u=a(2205),h=a.n(u),p=a(8585),_=a.n(p),g=a(9754),f=a.n(g),m=a(9713),v=a.n(m),w=a(7294),y=a(9669),b=a.n(y),E=a(488),I=a.n(E),D=a(7139),S=a(298),T=a.n(S);var C=function(e){h()(o,e);var t,n,r=(t=o,n=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,a=f()(t);if(n){var i=f()(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return _()(this,e)});function o(e){var t;return s()(this,o),t=r.call(this,e),v()(d()(t),"state",{body:null}),v()(d()(t),"dismissModal",(function(e){t.props.toggle(),e&&e.stopPropagation()})),v()(d()(t),"generalOnClick",(function(e){var a=t.props.t,n=e["data-bb-code"];if(e["data-promt"]&&"img"==e["data-promt"])(i=prompt(a("bbcode.img_link")))&&(n="["+n+"]"+i+"[/"+n+"]");else if(e["data-promt"]&&"url"==e["data-promt"]){var i;(i=prompt(a("bbcode.link")))&&(n="[url="+i+"]"+a("bbcode.link_here")+"[/url]")}t.props.insertText(n),t.props.toggle()})),v()(d()(t),"generalDataActionClick",(function(e,a){e["data-action"]&&t.props[e["data-action"]]&&t.props[e["data-action"]](e["data-action-arg"]||null),a&&a.stopPropagation()})),t}return c()(o,[{key:"componentDidMount",value:function(){var e=this;b().get(window.lhcChat.base_url+this.props.dataUrl).then((function(t){e.setState({body:t.data});var n=document.getElementById("dialog-content"),i=a(2767),r=n.querySelectorAll('[data-bs-toggle="tab"]');if(r.length>0){var s=0;Array.prototype.forEach.call(r,(function(e){e.tabItem=new i(e)}));var o=new(T())(".tab-content");o.onSwipeLeft((function(){s=s0?s-1:r.length-1,r[s].tabItem.show()}))}})).catch((function(e){console.log(e)}))}},{key:"render",value:function(){var e=this;return w.createElement(w.Fragment,null,null!==this.state.body&&w.createElement("div",{className:"fade modal-backdrop show"}),null!==this.state.body&&w.createElement("div",{role:"dialog",id:"dialog-content","aria-modal":"true",className:"fade modal show d-block",tabIndex:"-1"},I()(this.state.body,{replace:function(t){if(t.attribs&&"react-close-modal"===t.attribs.id)return w.createElement("button",{type:"button",className:"btn-close float-end","data-bs-dismiss":"modal",onClick:e.dismissModal,"aria-label":"Close"});if(t.attribs&&t.attribs.linkaction)return t.attribs.class&&(t.attribs.className=t.attribs.class,delete t.attribs.class),w.createElement("a",i()({},t.attribs,{onClick:function(a){return e.generalDataActionClick(t.attribs,a)}}),(0,E.domToReact)(t.children));if(t.attribs&&t.attribs.bbitem)return t.attribs.class&&(t.attribs.className=t.attribs.class,delete t.attribs.class),w.createElement("a",i()({},t.attribs,{onClick:function(a){return e.generalOnClick(t.attribs)}}),(0,E.domToReact)(t.children));if(t.type&&"tag"===t.type&&t.name&&"input"==t.name&&t.attribs&&t.attribs.type&&"button"==t.attribs.type)return t.attribs.class&&(t.attribs.className=t.attribs.class,delete t.attribs.class),w.createElement("input",i()({},t.attribs,{onClick:function(a){return e.generalDataActionClick(t.attribs,a)}}));if(t.type&&"script"===t.type){if(t.children.length>0)setTimeout((function(){var e=document.createElement("script");e.appendChild(document.createTextNode(t.children[0].data)),document.getElementsByTagName("head").item(0).appendChild(e)}),500);else if(t.attribs&&t.attribs.src){var a=document.createElement("script");a.src=t.attribs.src,a.type="text/javascript",document.getElementsByTagName("head").item(0).appendChild(a)}return w.createElement(w.Fragment,null)}}})))}}]),o}(w.PureComponent);t.Z=(0,D.Z)()(C)},9702:function(e,t,a){"use strict";a.d(t,{Z:function(){return N}});var n=a(4575),i=a.n(n),r=a(3913),s=a.n(r),o=a(1506),c=a.n(o),l=a(2205),d=a.n(l),u=a(8585),h=a.n(u),p=a(9754),_=a.n(p),g=a(9713),f=a.n(g),m=a(7294),v=a(6458),w=a(7139),y=a(7786),b=a(3038),E=a.n(b);var I=function(e){d()(r,e);var t,a,n=(t=r,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=_()(t);if(a){var i=_()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return h()(this,e)});function r(e){return i()(this,r),n.call(this,e)}return s()(r,[{key:"render",value:function(){var e=this.props.errors.mapEntries((function(e){var t=E()(e,2),a=t[0],n=t[1];if("captcha"==a||"blocked_user"==a||!isNaN(a))return[m.createElement("li",null,n)]}));return e.size>0?m.createElement("div",{"data-alert":"",className:"mt-2 alert alert-danger alert-dismissible fade show"},m.createElement("ul",{className:"ps-1 m-0"},e)):null}}]),r}(m.Component),D=a(5198),S=a(2446);var T=function(e){d()(o,e);var t,n,r=(t=o,n=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,a=_()(t);if(n){var i=_()(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return h()(this,e)});function o(e){return i()(this,o),r.call(this,e)}return s()(o,[{key:"componentDidMount",value:function(){new(a(208))(document.getElementById("chat-dropdown-options"))}},{key:"render",value:function(){var e=this,t=this.props.t;return m.createElement("div",{className:"btn-group dropup disable-select ps-2 pt-2"},m.createElement("i",{className:"material-icons settings text-muted",id:"chat-dropdown-options","data-bs-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},""),m.createElement("div",{className:"dropdown-menu shadow bg-white lhc-dropdown-menu rounded ms-1"},m.createElement("div",{className:"d-flex flex-row px-1"},this.props.bbEnabled&&m.createElement("a",{onClick:function(t){return e.props.toggleModal()},title:t("button.bb_code")},m.createElement("i",{className:"material-icons chat-setting-item text-muted me-0 bbcode-ico"},"")),this.props.langEnabled&&m.createElement("a",{onClick:this.props.changeLanguage,title:t("button.lang")},m.createElement("i",{className:"material-icons chat-setting-item text-muted me-0 lang-ico"},"")))))}}]),o}(m.PureComponent),C=(0,w.Z)()(T),k=a(2137),O=a(5918);var A,x=function(e){d()(r,e);var t,a,n=(t=r,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=_()(t);if(a){var i=_()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return h()(this,e)});function r(e){return i()(this,r),n.call(this,e)}return s()(r,[{key:"componentDidMount",value:function(){k.a.sendMessageParent("readInvitation",[{name:this.props.invitation.invitation_name||"Manual"}])}},{key:"render",value:function(){return"message"==this.props.mode?m.createElement(m.Fragment,null,this.props.invitation.prev_msg&&m.createElement(O.Z,{setBotPayload:this.props.setBotPayload,content:this.props.invitation.prev_msg}),this.props.invitation.message&&m.createElement("div",{className:"message-row message-admin"},m.createElement("span",{className:"usr-tit op-tit"},m.createElement("i",{title:this.props.invitation.name_support||this.props.invitation.extra_profile,className:"chat-operators mi-fs15 me-0"},this.props.invitation.bubble&&this.props.invitation.photo&&m.createElement("img",{src:this.props.invitation.photo,alt:"",className:"profile-msg-pic"}),(!this.props.invitation.photo||!this.props.invitation.bubble)&&m.createElement("i",{className:"material-icons "+(this.props.invitation.bubble?"icon-assistant me-0":"")},"")),!this.props.invitation.bubble&&(this.props.invitation.name_support||this.props.invitation.extra_profile)),m.createElement("div",{className:"msg-body",dangerouslySetInnerHTML:{__html:this.props.invitation.message}})),this.props.invitation.message_full&&m.createElement(O.Z,{setBotPayload:this.props.setBotPayload,content:this.props.invitation.message_full})):m.createElement(m.Fragment,null,m.createElement("div",{id:"lhc-profile-body"},m.createElement("div",{id:"chat-status-container",className:"operator-info d-flex border-bottom p-2"},m.createElement("div",null,this.props.invitation.photo&&m.createElement("img",{width:"48",height:"48",src:this.props.invitation.photo,title:this.props.invitation.photo_title,alt:""}),!this.props.invitation.photo&&m.createElement("i",{className:"icon-assistant material-icons me-0"},"")),m.createElement("div",{className:"p-1 ps-2 w-100"},this.props.invitation.name_support&&!this.props.invitation.hide_name&&m.createElement("div",{className:"fw-bold"},this.props.invitation.name_support),this.props.invitation.extra_profile&&m.createElement("div",{dangerouslySetInnerHTML:{__html:this.props.invitation.extra_profile}})))),"profile_only"!=this.props.mode&&this.props.invitation.message&&m.createElement("div",{id:"messagesBlock"},m.createElement("div",{className:"bottom-message position-relative"},m.createElement("div",{className:"message-row message-admin pt-1 text-left ms-3"},m.createElement("div",{className:"msg-body",dangerouslySetInnerHTML:{__html:this.props.invitation.message}})))))}}]),r}(m.PureComponent),M=a(6313),P=a(6512);function L(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function R(e){for(var t=1;t0&&this.props.chatwidget.getIn(["onlineData","department","departments"]).map((function(a){a.get("value")==e.value&&(0==a.get("online")&&(t.props.dispatch({type:"dep_default",data:e.value}),t.props.dispatch({type:"onlineStatus",data:!1})),t.props.chatwidget.getIn(["onlineData","dep_forms"])!=e.value&&t.updateOnlineFieldsInit(e.value))}))),"Question"==e.id&&(!0===this.props.chatwidget.getIn(["proactive","has"])&&""!=e.value&&1===this.props.chatwidget.getIn(["chat_ui","proactive_once_typed"])&&1===this.props.chatwidget.getIn(["chat_ui","custom_html_priority"])?(this.props.dispatch({type:"attr_set",attr:["chat_ui","custom_html_priority"],data:0}),this.customHTMLPriority=!0):""==e.value&&1==this.customHTMLPriority&&this.props.dispatch({type:"attr_set",attr:["chat_ui","custom_html_priority"],data:1}))}},{key:"handleContentChangeCustom",value:function(e){this.props.dispatch({type:"CUSTOM_FIELDS_ITEM",data:{id:e.field.get("index"),value:e.value}})}},{key:"componentDidMount",value:function(){k.a.prefillFields(this),this.updateOnlineFields(),null!==this.props.botPayload&&this.setBotPayload(this.props.botPayload);var e=document.getElementById("CSChatMessage-tmp");null!==e&&document.body.removeChild(e)}},{key:"componentWillUnmount",value:function(){var e=document.getElementById("messagesBlock");null!==e&&this.props.setMessages(e.innerHTML);var t=document.getElementById("lhc-profile-body");null!==t&&this.props.setProfile(t.innerHTML);var a=document.getElementById("CSChatMessage");null===a?this.props.setHideMessageField(!0):(this.props.setHideMessageField(!1),a.id="CSChatMessage-tmp",a.style.cssText="position:absolute;left:-999px;bottom:0px;",document.body.appendChild(a))}},{key:"setBotPayload",value:function(e){this.botPayload=e,this.handleSubmit()}},{key:"updateOnlineFieldsInit",value:function(e){this.props.dispatch((0,P.El)({department:this.props.chatwidget.get("department"),product:this.props.chatwidget.get("product"),theme:this.props.chatwidget.get("theme"),mode:this.props.chatwidget.get("mode"),pvhash:this.props.chatwidget.get("pvhash"),phash:this.props.chatwidget.get("phash"),bot_id:this.props.chatwidget.get("bot_id"),trigger_id:this.props.chatwidget.get("trigger_id"),vid:this.props.chatwidget.get("vid"),dep_default:e||this.props.chatwidget.get("departmentDefault")||0,online:1,chat_ui:this.props.chatwidget.get("chat_ui")}))}},{key:"updateOnlineFields",value:function(){!1===this.props.chatwidget.getIn(["onlineData","fetched"])&&this.updateOnlineFieldsInit()}},{key:"componentDidUpdate",value:function(e,t,a){this.updateOnlineFields(),document.getElementById("id-container-fluid")&&k.a.sendMessageParent("widgetHeight",[{height:document.getElementById("id-container-fluid").offsetHeight+40}]);var n=!1;if(!1===this.apiLoaded&&null!==this.props.chatwidget.get("api_data")&&(this.apiLoaded=!0,this.setState(R(R({},this.state),this.props.chatwidget.get("api_data"))),n=!0),(!0===n||0==this.props.chatwidget.get("isMobile")&&!1===e.chatwidget.get("shown")&&!0===this.props.chatwidget.get("shown"))&&"widget"==this.props.chatwidget.get("mode")&&this.textMessageRef.current&&(this.textMessageRef.current.focus(),this.scrollBottom()),!0===this.props.chatwidget.getIn(["onlineData","fetched"])&&!1===e.chatwidget.getIn(["onlineData","fetched"])&&(this.props.chatwidget.hasIn(["chat_ui","uprev"])&&k.a.emitEvent("play_sound",[{type:"new_message",sound_on:!0===this.props.chatwidget.getIn(["usersettings","soundOn"]),widget_open:this.props.chatwidget.get("shown")&&"widget"==this.props.chatwidget.get("mode")||document.hasFocus()}]),this.scrollBottom()),this.props.chatwidget.get("departmentDefault")!==e.chatwidget.get("departmentDefault")){this.setState({DepartamentID:this.props.chatwidget.get("departmentDefault")});var i=document.getElementById("id-department-field");null!==i&&(i.value=this.props.chatwidget.get("departmentDefault")),this.updateOnlineFieldsInit()}}},{key:"scrollBottom",value:function(){var e=this;this.messagesAreaRef.current&&(this.messagesAreaRef.current.scrollTop=this.messagesAreaRef.current.scrollHeight+1e3,setTimeout((function(){e.messagesAreaRef.current&&(e.messagesAreaRef.current.scrollTop=e.messagesAreaRef.current.scrollHeight+1e3)}),450))}},{key:"moveCaretAtEnd",value:function(e){var t=e.target.value;e.target.value="",e.target.value=t}},{key:"render",value:function(){var e=this,t=this.props.t;if(!0===this.props.chatwidget.getIn(["onlineData","fetched"])&&!0===this.props.chatwidget.getIn(["onlineData","disabled"]))return m.createElement("div",{className:"alert alert-danger m-2",role:"alert"},t("start_chat.cant_start_a_chat"));if(!1===this.props.chatwidget.getIn(["onlineData","fetched"])||!0===this.props.chatwidget.getIn(["chat_ui","auto_start"]))return null;if(this.props.chatwidget.getIn(["onlineData","fields"]).size>0&&(!this.props.chatwidget.hasIn(["chat_ui","show_messages_box"])||1!=this.props.chatwidget.getIn(["onlineData","fields_visible"])||0!=this.props.chatwidget.getIn(["customData","fields"]).size))var a=this.props.chatwidget.getIn(["onlineData","fields"]).map((function(t){return m.createElement(y.Z,{chatUI:e.props.chatwidget.get("chat_ui"),key:t.get("identifier"),isInvalid:e.props.chatwidget.hasIn(["validationErrors",t.get("identifier")]),defaultValueField:e.state[t.get("name")]||t.get("value"),attrPrefill:{attr_prefill_admin:e.props.chatwidget.get("attr_prefill_admin"),attr_prefill:e.props.chatwidget.get("attr_prefill")},onChangeContent:e.handleContentChange,field:t})}));else a="";var n=!1,i="";if(this.props.chatwidget.getIn(["customData","fields"]).size>0&&(this.props.chatwidget.getIn(["customData","fields"]).map((function(e){return n=!e.has("type")||"hidden"!==e.get("type")||n})),1==n&&(i=this.props.chatwidget.getIn(["customData","fields"]).map((function(t){return m.createElement(y.Z,{chatUI:e.props.chatwidget.get("chat_ui"),key:t.get("identifier"),isInvalid:e.props.chatwidget.hasIn(["validationErrors",t.get("identifier")]),defaultValueField:t.get("value"),onChangeContent:e.handleContentChangeCustom,field:t})})))),this.props.chatwidget.hasIn(["onlineData","paid","error"])&&this.props.chatwidget.getIn(["onlineData","paid","error"]))return m.createElement("p",{className:"p-2"},this.props.chatwidget.getIn(["onlineData","paid","message"]));if(0==this.props.chatwidget.get("processStatus")||1==this.props.chatwidget.get("processStatus")){if(this.props.chatwidget.hasIn(["chat_ui","show_messages_box"])&&this.props.chatwidget.getIn(["onlineData","department","departments"]).size<=1&&this.props.chatwidget.getIn(["onlineData","fields_visible"])<=1&&(0==this.props.chatwidget.getIn(["customData","fields"]).size||!1===n)){var r="ps-0 no-outline form-control rounded-0 form-control rounded-start-0 rounded-end-0 border-0 "+(!0===this.props.chatwidget.get("shown")&&this.textMessageRef.current&&(/\r|\n/.exec(this.state.Question)||this.state.Question.length>this.textMessageRef.current.offsetWidth/8.6)?"msg-two-line":"msg-one-line"),s="flex-grow-1 overflow-scroll position-relative",o="bottom-message px-1";return this.props.chatwidget.hasIn(["chat_ui","msg_expand"])&&"embed"==this.props.chatwidget.get("mode")&&(s="overflow-scroll position-relative",o+=" position-relative"),this.props.chatwidget.getIn(["chat_ui","disabled"])?m.createElement(M.Z,{closeText:t("button.close"),full_height:!0,close:function(t){return e.props.dispatch((0,P.H7)(!0))},as_html:!0,text:this.props.chatwidget.getIn(["chat_ui","disabled"])}):m.createElement(m.Fragment,null,this.state.showBBCode&&m.createElement(S.Z,{showModal:this.state.showBBCode,insertText:this.insertText,toggle:this.toggleModal,dataUrl:"/chat/bbcodeinsert?react=1"}),this.state.changeLanguage&&m.createElement(S.Z,{showModal:this.state.changeLanguage,setLanguage:this.setLanguageAction,toggle:this.changeLanguage,dataUrl:"/widgetrestapi/chooselanguage"}),this.props.chatwidget.hasIn(["validationErrors","blocked_user"])&&m.createElement(M.Z,{closeText:t("button.close"),as_html:!0,close:function(t){return e.props.dispatch((0,P.H7)(!0))},text:this.props.chatwidget.getIn(["validationErrors","blocked_user"])}),!0===this.props.chatwidget.getIn(["proactive","has"])&&!this.props.chatwidget.hasIn(["proactive","data","std_header"])&&m.createElement(x,{mode:"profile_only",invitation:this.props.chatwidget.getIn(["proactive","data"])})||(this.props.chatwidget.hasIn(["chat_ui","pre_chat_html"])||this.props.chatwidget.hasIn(["chat_ui","operator_profile"])&&""!=this.props.chatwidget.getIn(["chat_ui","operator_profile"]))&&m.createElement("div",{id:"lhc-profile-body"},m.createElement("div",{id:"chat-status-container",className:"p-2 border-bottom",dangerouslySetInnerHTML:{__html:(this.props.chatwidget.hasIn(["chat_ui","pre_chat_html"])?this.props.chatwidget.getIn(["chat_ui","pre_chat_html"]):"")+(this.props.chatwidget.hasIn(["chat_ui","operator_profile"])?this.props.chatwidget.getIn(["chat_ui","operator_profile"]):"")}})),m.createElement("div",{className:s,id:"messagesBlock"},m.createElement("div",{className:o,id:"messages-scroll",ref:this.messagesAreaRef},!0===this.props.chatwidget.getIn(["proactive","has"])&&!this.props.chatwidget.getIn(["chat_ui","custom_html_priority"])&&m.createElement(x,{mode:"message",setBotPayload:this.setBotPayload,invitation:this.props.chatwidget.getIn(["proactive","data"])}),!this.props.chatwidget.getIn(["proactive","has"])&&this.props.chatwidget.hasIn(["chat_ui","cmmsg_widget"])&&m.createElement(O.Z,{setBotPayload:this.setBotPayload,content:this.props.chatwidget.getIn(["chat_ui","cmmsg_widget"])}),1==this.props.chatwidget.get("processStatus")&&""!=this.state.Question&&m.createElement("div",{"data-op-id":"0",className:"message-row response"},m.createElement("div",{className:"msg-date"}),m.createElement("span",{title:"",className:"usr-tit vis-tit"},m.createElement("i",{title:t("start_chat.visitor"),className:"material-icons chat-operators mi-fs15 me-0"},""),m.createElement("span",{className:"user-nick-title"},t("start_chat.visitor"))),m.createElement("div",{className:"msg-body"},this.state.Question)))),(!this.props.chatwidget.getIn(["proactive","has"])||1===this.props.chatwidget.getIn(["chat_ui","custom_html_priority"]))&&this.props.chatwidget.hasIn(["chat_ui","custom_html_widget"])&&m.createElement("div",{className:"custom-html-container "+(""!=this.state.Question?"visitor-started-type":""),dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","custom_html_widget"])}}),(1==this.props.chatwidget.getIn(["onlineData","fields_visible"])||0==this.props.chatwidget.getIn(["onlineData","fields_visible"])&&!this.props.chatwidget.hasIn(["chat_ui","hstr_btn"]))&&m.createElement("div",{className:"d-flex flex-row border-top position-relative message-send-area"},this.props.chatwidget.hasIn(["validationErrors","question"])&&m.createElement("div",{id:"id-operator-typing",className:"bg-white ps-1"},this.props.chatwidget.getIn(["validationErrors","question"])),1==this.props.chatwidget.getIn(["onlineData","fields_visible"])&&m.createElement(m.Fragment,null,(!this.props.chatwidget.hasIn(["chat_ui","bbc_btnh"])||this.props.chatwidget.hasIn(["chat_ui","lng_btnh"]))&&m.createElement(C,{bbEnabled:!this.props.chatwidget.hasIn(["chat_ui","bbc_btnh"]),langEnabled:this.props.chatwidget.hasIn(["chat_ui","lng_btnh"]),changeLanguage:this.changeLanguage,toggleModal:this.toggleModal}),m.createElement("div",{className:"mx-auto w-100"},m.createElement("textarea",{autoFocus:0==this.props.chatwidget.get("isMobile")&&"widget"==this.props.chatwidget.get("mode")&&!0===this.props.chatwidget.get("shown"),onFocus:this.moveCaretAtEnd,maxLength:this.props.chatwidget.getIn(["chat_ui","max_length"]),"aria-label":"Type your message here...",id:"CSChatMessage",value:1==this.props.chatwidget.get("processStatus")?"":this.state.Question,placeholder:this.props.chatwidget.hasIn(["chat_ui","placeholder_message"])?this.props.chatwidget.getIn(["chat_ui","placeholder_message"]):t("chat.type_here"),onKeyDown:this.enterKeyDown,onChange:function(t){return e.handleContentChange({id:"Question",value:t.target.value})},ref:this.textMessageRef,rows:"1",className:r})),m.createElement("div",{className:"disable-select"},m.createElement("div",{className:"user-chatwidget-buttons pt-1",id:"ChatSendButtonContainer"},1!=this.props.chatwidget.get("processStatus")&&m.createElement("a",{onClick:this.handleSubmit,title:t("button.start_chat")},m.createElement("i",{className:"material-icons text-muted settings"},"")),1==this.props.chatwidget.get("processStatus")&&m.createElement("i",{className:"material-icons text-muted settings me-0"},"")))),0==this.props.chatwidget.getIn(["onlineData","fields_visible"])&&!this.props.chatwidget.hasIn(["chat_ui","hstr_btn"])&&m.createElement("button",{className:"mx-auto pb-1 w-100 btn btn-light rounded-0",onClick:this.handleSubmit,title:t("button.start_chat")},this.props.chatwidget.getIn(["chat_ui","custom_start_button"])||t("button.start_chat_With_us"))))}return m.createElement("div",{id:"id-container-fluid"},!0===this.props.chatwidget.getIn(["proactive","has"])&&m.createElement(x,{mode:"profile",invitation:this.props.chatwidget.getIn(["proactive","data"])})||this.props.chatwidget.hasIn(["chat_ui","operator_profile"])&&""!=this.props.chatwidget.getIn(["chat_ui","operator_profile"])&&m.createElement("div",{className:"p-2"+(this.props.chatwidget.hasIn(["chat_ui","np_border"])?"":" border-bottom"),dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","operator_profile"])}}),m.createElement("div",{className:"container-fluid"},m.createElement(I,{errors:this.props.chatwidget.get("validationErrors")}),!this.props.chatwidget.getIn(["proactive","has"])&&this.props.chatwidget.hasIn(["chat_ui","custom_html_widget"])&&m.createElement("div",{className:"custom-html-container",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","custom_html_widget"])}}),m.createElement("form",{onSubmit:this.handleSubmit},m.createElement("div",{className:"row pt-2"},a,i,this.props.chatwidget.hasIn(["onlineData","department"])&&m.createElement(D.Z,{defaultValueField:this.state.DepartamentID,setDefaultValue:this.props.chatwidget.get("departmentDefault"),onChangeContent:this.handleContentChange,isInvalidProduct:this.props.chatwidget.hasIn(["validationErrors","ProductID"]),isInvalid:this.props.chatwidget.hasIn(["validationErrors","department"]),departments:this.props.chatwidget.getIn(["onlineData","department"])})),(!this.props.chatwidget.hasIn(["chat_ui","hstr_btn"])||""!==i||""!==a||!0===this.props.chatwidget.getIn(["proactive","has"]))&&m.createElement("div",{className:"row"},m.createElement("div",{className:"col-12 pb-3"},m.createElement("button",{disabled:1==this.props.chatwidget.get("processStatus"),type:"submit",className:"btn btn-secondary btn-sm"},this.props.chatwidget.getIn(["chat_ui","custom_start_button"])||t("button.start_chat")))))))}return 2==this.props.chatwidget.get("processStatus")?m.createElement("div",{className:"container-fluid",id:"id-container-fluid"},m.createElement("div",{className:"row"},m.createElement("div",{className:"col-12"},m.createElement("p",null,t("start_chat.thank_you_for_feedback"))))):void 0}}],[{key:"getDerivedStateFromProps",value:function(e,t){if(e.chatwidget.getIn(["chat_ui","auto_start"])&&0==e.chatwidget.get("processStatus")&&("embed"==e.chatwidget.get("mode")||"popup"==e.chatwidget.get("mode")||"widget"==e.chatwidget.get("mode")&&1==e.chatwidget.get("shown"))){var a=t;a.jsvar=e.chatwidget.get("jsVars"),a["captcha_"+e.chatwidget.getIn(["captcha","hash"])]=e.chatwidget.getIn(["captcha","ts"]),a.tscaptcha=e.chatwidget.getIn(["captcha","ts"]),a.user_timezone=k.a.getTimeZone(),a.URLRefer=window.location.href.substring(window.location.protocol.length),a.r=e.chatwidget.get("ses_ref"),""!=e.chatwidget.get("bot_id")&&(a.bot_id=e.chatwidget.get("bot_id")),""!=e.chatwidget.get("subject_id")&&(a.subject_id=e.chatwidget.get("subject_id")),""!=e.chatwidget.get("trigger_id")&&(a.trigger_id=e.chatwidget.get("trigger_id")),""!=e.chatwidget.get("operator")&&(a.operator=e.chatwidget.get("operator")),null!==e.chatwidget.get("priority")&&(a.priority=e.chatwidget.get("priority")),null!==e.chatwidget.get("pvhash")&&(a.pvhash=e.chatwidget.get("pvhash")),null!==e.chatwidget.get("phash")&&(a.phash=e.chatwidget.get("phash"));var n=k.a.getCustomFieldsSubmit(e.chatwidget.getIn(["customData","fields"]));null!==n&&(a=R(R({},a),n)),null!==e.chatwidget.get("api_data")&&(a=R(R({},a),e.chatwidget.get("api_data")));var i={department:e.chatwidget.get("department"),theme:e.chatwidget.get("theme"),mode:e.chatwidget.get("mode"),vid:e.chatwidget.get("vid"),fields:a};null!==e.botPayload&&(i.bpayload=e.botPayload),!0===e.chatwidget.hasIn(["proactive","data","invitation_id"])&&(i.invitation_id=e.chatwidget.getIn(["proactive","data","invitation_id"])),e.dispatch((0,P.Ym)(i))}return null}}]),r}(m.Component))||A,N=(0,w.Z)()(B)},9944:function(e,t,a){"use strict";a.d(t,{XI:function(){return n},sk:function(){return i},pA:function(){return r},B4:function(){return s},pV:function(){return o},Pd:function(){return c}});var n=1,i=2,r=5,s=2,o=3,c=5},2137:function(e,t,a){"use strict";a.d(t,{a:function(){return o}});var n=a(4575),i=a.n(n),r=a(3913),s=a.n(r),o=new(function(){function e(){i()(this,e);var t,n=document.currentScript||(t=document.getElementsByTagName("script"))[t.length-1],r=a(4795);this.prefix=n.getAttribute("scope")||"lhc",this.prefixUppercase=this.prefix.toUpperCase(),this.eventEmitter=new r;try{this.hasSessionStorage=!!window.sessionStorage}catch(e){this.hasSessionStorage=!1}try{this.hasLocalStorage=!!window.localStorage}catch(e){this.hasLocalStorage=!1}}return s()(e,[{key:"emitEvent",value:function(e,t,a){this.eventEmitter.emitEvent(e,t)}},{key:"sendMessageParent",value:function(e,t){window.opener&&!1===window.opener.closed?window.opener.postMessage(this.prefix+"::"+e+"::"+JSON.stringify(t||null),"*"):window.parent&&!1===window.parent.closed&&window.parent.postMessage(this.prefix+"::"+e+"::"+JSON.stringify(t||null),"/"),"undefined"!=typeof LHCEventTracker&&LHCEventTracker(e,t)}},{key:"sendMessageParentDirect",value:function(e,t){var a=null;window.parent&&window.parent["$_"+this.prefixUppercase]&&!1===window.parent.closed?a=window.parent["$_"+this.prefixUppercase].eventListener:window.opener&&window.opener["$_"+this.prefixUppercase]&&!1===window.opener.closed&&(a=window.opener["$_"+this.prefixUppercase].eventListener),null!==a?a.emitEvent(e,t):this.sendMessageParent(e,t)}},{key:"setLocalStorage",value:function(e,t){if(this.hasLocalStorage&&localStorage.setItem)try{localStorage.setItem(this.prefix+e,t)}catch(e){}}},{key:"setSessionStorage",value:function(e,t){if(this.hasSessionStorage&&sessionStorage.setItem)try{sessionStorage.setItem(this.prefix+e,t)}catch(e){}}},{key:"getSessionStorage",value:function(e){return this.hasSessionStorage&&sessionStorage.getItem?sessionStorage.getItem(this.prefix+e):null}},{key:"getLocalStorage",value:function(e){return this.hasLocalStorage&&localStorage.getItem?localStorage.getItem(this.prefix+e):null}},{key:"removeSessionStorage",value:function(e){this.hasSessionStorage&&sessionStorage.removeItem&&sessionStorage.removeItem(this.prefix+e)}},{key:"removeLocalStorage",value:function(e){this.hasLocalStorage&&localStorage.removeItem&&localStorage.removeItem(this.prefix+e)}},{key:"getTimeZone",value:function(){try{var e=Intl.DateTimeFormat().resolvedOptions().timeZone;return"undefined"==e&&(e="UTC"),e}catch(e){var t=new Date;return(t.getTimezoneOffset()<(a=new Date(t.getFullYear(),0,1),n=new Date(t.getFullYear(),6,1),Math.max(a.getTimezoneOffset(),n.getTimezoneOffset()))?t.getTimezoneOffset():t.getTimezoneOffset()-60)/60*-1}var a,n}},{key:"getCustomFieldsSubmit",value:function(e){if(e.size>0){var t={name_items:[],values_req:[],value_items:[],value_types:[],encattr:[],value_show:[]};return e.forEach((function(e){t.value_items.push(e.get("value")),t.name_items.push(e.get("name")),t.values_req.push(!0===e.get("required")?"t":"f"),t.encattr.push(!0===e.get("encrypted")?"t":""),t.value_types.push(e.get("type")),t.value_show.push(e.get("show"))})),t}return null}},{key:"prefillFields",value:function(e){var t=e.props.chatwidget.get("attr_prefill");t.length>0&&t.forEach((function(t){e.setState(t)}))}},{key:"logJSError",value:function(e){var t;(t={}).location=location&&location.href?location.href:"",t.message=window.navigator.userAgent,t.stack=e.stack,t.stack=t.stack.replace(/(\r\n|\n|\r)/gm,"");var a=new XMLHttpRequest;a.open("POST",window.lhcChat.base_url+"audit/logjserror",!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send("data="+encodeURIComponent(JSON.stringify(t)))}}]),e}());window.lhcHelperfunctions=o},5501:function(e,t,a){"use strict";var n,i,r=a(7294),s=a(3935),o=a(4575),c=a.n(o),l=a(3913),d=a.n(l),u=a(2205),h=a.n(u),p=a(8585),_=a.n(p),g=a(9754),f=a.n(g),m=a(1506),v=a.n(m),w=a(9713),y=a.n(w),b=a(6458),E=a(6512),I=a(2137),D=a(9944),S=a(7139);var T=(n=(0,b.$j)((function(e){return{chatwidget:e.chatwidget}})),n(i=function(e){h()(s,e);var t,n,i=(t=s,n=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,a=f()(t);if(n){var i=f()(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return _()(this,e)});function s(e){var t;return c()(this,s),(t=i.call(this,e)).closeWidget=t.closeWidget.bind(v()(t)),t.endChat=t.endChat.bind(v()(t)),t.popup=t.popup.bind(v()(t)),t}return d()(s,[{key:"closeWidget",value:function(){this.props.dispatch((0,E.H7)())}},{key:"endChat",value:function(){this.props.endChat()}},{key:"popup",value:function(){this.props.popupChat()}},{key:"componentDidMount",value:function(){var e=document.getElementById("headerDropDown");e&&new(a(208))(e)}},{key:"render",value:function(){var e=this,t=this.props.t,a=!this.props.chatwidget.hasIn(["chat_ui","clinst"])||this.props.chatwidget.get("isMobile"),n=this.props.chatwidget.hasIn(["chat_ui","custom_html_header_body"]),i="row header-chat"+(1==this.props.chatwidget.get("isMobile")?" mobile-header":" desktop-header"),s=!this.props.chatwidget.hasIn(["chat_ui","hide_popup"]),o=!0===this.props.chatwidget.get("isChatting")&&!this.props.chatwidget.hasIn(["chat_ui","hide_close"]),c=0,l=this.props.chatwidget.hasIn(["chat_ui","header_buttons"])&&this.props.chatwidget.getIn(["chat_ui","header_buttons"]).map((function(n,i){var l=n.get("pos");if(l="left"==l?"start":"right"==l?"end":l,"min"==n.get("btn")&&a)return c++,r.createElement("a",{className:"minimize-icon header-link float-"+l,title:e.props.chatwidget.getIn(["chat_ui","min_text"])||t("button.minimize"),onClick:e.closeWidget},e.props.chatwidget.hasIn(["chat_ui","img_icon_min"])&&r.createElement("img",{className:"px-1",src:e.props.chatwidget.getIn(["chat_ui","img_icon_min"]),alt:""})||r.createElement("i",{className:"material-icons"},""));if("popup"==n.get("btn")&&s)return c++,r.createElement("a",{className:"header-link float-"+l,title:e.props.chatwidget.getIn(["chat_ui","popup_text"])||t("button.popup"),onClick:e.popup},e.props.chatwidget.hasIn(["chat_ui","img_icon_popup"])&&r.createElement("img",{className:"px-1",src:e.props.chatwidget.getIn(["chat_ui","img_icon_popup"]),alt:""})||r.createElement("i",{className:"material-icons"},""));if("close"==n.get("btn")&&o){var d=e.props.chatwidget.getIn(["chat_ui","end_chat_text"])||t("button.end_chat");return c++,r.createElement("a",{title:d,className:"header-link float-"+l,onClick:e.endChat},e.props.chatwidget.hasIn(["chat_ui","img_icon_close"])&&r.createElement("img",{className:"px-1",src:e.props.chatwidget.getIn(["chat_ui","img_icon_close"]),alt:""})||r.createElement("i",{className:"material-icons"},""),n.get("print")&&r.createElement("span",{className:"end-chat-text"},d))}}));return r.createElement("div",{id:"widget-header-content",className:i},n&&r.createElement("div",{className:"lhc-custom-header-inside",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","custom_html_header_body"])}}),c>0&&r.createElement("div",{className:"col-12 px-1"},l))}}]),s}(r.Component))||i),C=(0,S.Z)()(T),k=a(9702),O=a(488),A=a.n(O),x=a(7154),M=a.n(x),P=a(3038),L=a.n(P),R=a(2446);var B=r.lazy((function(){return a.e(536).then(a.bind(a,3536))})),N=function(e){h()(i,e);var t,a,n=(t=i,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 i=f()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return _()(this,e)});function i(e){var t;return c()(this,i),t=n.call(this,e),y()(v()(t),"state",{jsExecuted:!1,moreReactions:!1,reactToMessageId:0}),t.abstractClick=t.abstractClick.bind(v()(t)),t.imageLoaded=t.imageLoaded.bind(v()(t)),t.updateTriggerClicked=t.updateTriggerClicked.bind(v()(t)),t.disableEditor=!1,t.delayData=[],t}return d()(i,[{key:"addLoader",value:function(e,t){e["data-no-change"]||"button"!=e.type||(t.setAttribute("disabled","disabled"),t.innerHTML=''+t.innerHTML)}},{key:"abstractClick",value:function(e,t){var a=this,n=this.props.t;if(void 0===e.onchange){if(this.addLoader(e,t.target),e.onclick)if(-1!==e.onclick.indexOf("lhinst.updateTriggerClicked"))this.updateTriggerClicked({type:"/(type)/triggerclicked"},e,t.target);else if(-1!==e.onclick.indexOf("notificationsLHC.sendNotification"))this.props.dispatch((0,E.rN)()),t.target.innerHTML=n("notifications.subscribing"),setTimeout((function(){a.removeMetaMessage(e["data-id"])}),500);else if(-1!==e.onclick.indexOf("lhinst.moreReactions"))this.setState({moreReactions:!0,reactToMessageId:e["data-id"]}),t.stopPropagation();else if(-1!==e.onclick.indexOf("lhinst.reactionsToolbar"))this.props.setReactingTo(e["data-id"]!=this.props.reactToMessageId?e["data-id"]:0),t.stopPropagation();else if(-1!==e.onclick.indexOf("lhinst.reactionsClicked"))this.updateTriggerClicked({type:"/(type)/reactions"+(this.props.themeId?"/(theme)/"+this.props.themeId:"")},e,t.target),this.props.setReactingTo(0);else if(-1!==e.onclick.indexOf("lhinst.buttonClicked"))this.updateTriggerClicked({type:""},e,t.target);else if(-1!==e.onclick.indexOf("lhinst.startVoiceCall"))this.props.voiceCall();else if(-1!==e.onclick.indexOf("lhinst.chooseFile"))this.props.abstractAction("fileupload");else if(-1!==e.onclick.indexOf("lhinst.updateChatClicked"))this.updateTriggerClicked({type:"",mainType:"updatebuttonclicked"},e,t.target);else if(-1!==e.onclick.indexOf("lhinst.editGenericStep"))this.updateTriggerClicked({type:"/(type)/editgenericstep"},e,t.target);else if(-1!==e.onclick.indexOf("lhinst.hideShowAction")){var i=JSON.parse(e["data-load"]),r=document.getElementById("message-more-"+i.id);r.classList.contains("hide")?(t.target.innerText=i.hide_text,r.classList.remove("hide")):(t.target.innerText=i.show_text,r.classList.add("hide"))}else if(-1!==e.onclick.indexOf("lhinst.executeJS"))(0,E.bQ)(e,this);else if(-1!==e.onclick.indexOf("lhinst.dropdownClicked")){var s=document.getElementById("id_generic_list-"+e["data-id"]);s&&"0"!=s.value&&""!=s.value?(e["data-payload"]=s.value,this.updateTriggerClicked({type:"/(type)/valueclicked"},e,t.target)):alert(n("bot.please_choose"))}else-1!==e.onclick.indexOf("lhinst.zoomImage")?I.a.sendMessageParentDirect("zoomImage",[{txt_download:n("bbcode.img_download"),src:e.src,title:e.title?e.title:""}]):(I.a.emitEvent("MessageClick",[e,this.props.dispatch]),console.log("Unknown click event: "+e.onclick));t.preventDefault()}else{if(e.type&&"checkbox"==e.type){if("enable-confirm"==e["payload-type"]){var o=document.getElementById("confirm-button-"+e["data-id"]);t.target.checked?(o.removeAttribute("disabled"),o.onclick=function(t){return a.updateTriggerClicked({type:""},{"data-payload":"confirm","data-id":e["data-id"]},t.target)}):o.setAttribute("disabled","disabled")}return}var c=t.target.options[t.target.selectedIndex],l={"data-payload":c.getAttribute("data-payload"),"data-id":c.getAttribute("data-id")};"trigger"==c.getAttribute("payload-type")?this.updateTriggerClicked({type:"/(type)/triggerclicked"},l,t.target):"button"!=c.getAttribute("payload-type")&&"payload"!=c.getAttribute("payload-type")||this.updateTriggerClicked({type:""},l,t.target)}}},{key:"removeMetaMessage",value:function(e){setTimeout((function(){var t=document.getElementById("msg-"+e);if(t){var a,n=t.getElementsByClassName("meta-message-"+e);for(a=0;as?n.style.right="-"+(r-10)+"px":o0&&this.delayData.forEach((function(t){e.props.sendDelay(t),e.props.scrollBottom(!1,!1)}))}},{key:"formatStringToCamelCase",value:function(e){var t=e.split("-");return 1===t.length?t[0]:t[0]+t.slice(1).map((function(e){return e[0].toUpperCase()+e.slice(1)})).join("")}},{key:"getStyleObjectFromString",value:function(e){var t=this,a={};return e.split(";").forEach((function(e){var n=e.split(":"),i=L()(n,2),r=i[0],s=i[1];if(r){var o=t.formatStringToCamelCase(r.trim());a[o]=s.trim()}})),a}},{key:"render",value:function(){var e=this,t=(this.props.t,!1),a=A()(this.props.msg.msg,{replace:function(a){if(a.attribs){var n=Object.assign({},a.attribs);if(a.attribs.class){if(a.attribs.className=a.attribs.class,-1!==a.attribs.className.indexOf("message-row")&&parseInt(e.props.reactToMessageId)==parseInt(a.attribs.id.replace("msg-",""))&&(a.attribs.className+=" current-reacting-to"),-1!==a.attribs.className.indexOf("message-row")&&e.props.id>0)a.attribs.className+=" fade-in-fast",e.props.msg.msop>0&&e.props.msg.msop!=e.props.msg.lmsop&&0==t&&(a.attribs.className+=" operator-changes",t=!0);else if(e.props.profilePic&&-1!==a.attribs.className.indexOf("vis-icon-hld"))return r.createElement("img",{className:"profile-msg-pic",onLoad:e.imageLoaded,src:e.props.profilePic,alt:"",title:""});delete a.attribs.class}if(a.attribs.onclick&&delete a.attribs.onclick,a.name&&"img"===a.name){if(a.attribs.style&&(a.attribs.style=e.getStyleObjectFromString(a.attribs.style)),void 0===a.attribs["data-ignore-load"])return r.createElement("img",M()({},a.attribs,{onLoad:e.imageLoaded,onClick:function(t){return e.abstractClick(n,t)}}))}else if(a.name&&"button"===a.name){if(n.onclick)return a.attribs.style&&(a.attribs.style=e.getStyleObjectFromString(a.attribs.style)),r.createElement("button",M()({},a.attribs,{onClick:function(t){return e.abstractClick(n,t)}}),(0,O.domToReact)(a.children))}else if(a.name&&"a"===a.name){if(n.onclick)return a.attribs.style&&(a.attribs.style=e.getStyleObjectFromString(a.attribs.style)),r.createElement("a",M()({},a.attribs,{onClick:function(t){return e.abstractClick(n,t)}}),(0,O.domToReact)(a.children))}else if(a.name&&"select"===a.name){if(n.onchange)return a.attribs.style&&(a.attribs.style=e.getStyleObjectFromString(a.attribs.style)),r.createElement("select",M()({},a.attribs,{onChange:function(t){return e.abstractClick(n,t)}}),(0,O.domToReact)(a.children))}else{if(a.name&&"inlinesurvey"===a.name)return r.createElement(r.Suspense,{fallback:"..."},r.createElement(B,M()({},a.attribs,{surveyOptions:a.children})));if(a.name&&"input"===a.name){if(a.attribs.type&&"checkbox"==a.attribs.type&&n.onchange)return a.attribs.style&&(a.attribs.style=e.getStyleObjectFromString(a.attribs.style)),r.createElement("input",M()({type:"checkbox"},a.attribs,{onChange:function(t){return e.abstractClick(n,t)}}));if(a.attribs.type&&"radio"==a.attribs.type)return a.attribs.style&&(a.attribs.style=e.getStyleObjectFromString(a.attribs.style)),a.attribs.checked&&(a.attribs.defaultChecked=!0,delete a.attribs.checked),r.createElement("input",M()({type:"radio"},a.attribs))}else if(a.name&&"script"===a.name&&a.attribs["data-bot-action"]){if(!a.attribs["data-bot-always"]){if(1==e.state.jsExecuted)return r.createElement(r.Fragment,null);e.setState({jsExecuted:!0})}return(0,E.bQ)(a,e),r.createElement(r.Fragment,null)}}}}});return r.createElement(r.Fragment,null,this.state.moreReactions&&r.createElement(R.Z,{setReaction:function(t){e.updateTriggerClicked({type:"/(type)/reactions"+(e.props.themeId?"/(theme)/"+e.props.themeId:"")},JSON.parse(t),null),e.setState({moreReactions:!1}),e.props.setReactingTo(0)},confirmClose:function(t){e.setState({moreReactions:!1})},cancelClose:function(t){e.setState({moreReactions:!1})},toggle:function(t){e.setState({moreReactions:!1})},dataUrl:"/chat/reacttomessagemodal/"+this.state.reactToMessageId+(this.props.themeId?"/(theme)/"+this.props.themeId:"")}),1==this.props.hasNew&&this.props.id==this.props.newId&&r.createElement("div",{id:"scroll-to-message",className:"message-admin border-bottom new-msg-holder border-danger text-center"},r.createElement("span",{className:"new-msg bg-danger text-white d-inline-block fs12 rounded-top"},this.props.newTitle)),a)}}]),i}(r.PureComponent),F=(0,S.Z)()((0,b.$j)()(N)),U=a(8926),H=a.n(U),j=a(7757),W=a.n(j);function q(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function K(e){for(var t=1;tt.props.fileOptions.get("fs")&&i.push(e.name+": "+a("file.to_big_file"))})),i.length>0?alert(i.join("\n")):this.setState({files:e})}},{key:"componentDidUpdate",value:function(e,t){this.state.files.length>0&&0==this.state.uploading&&this.uploadFiles()}},{key:"uploadFiles",value:(t=H()(W().mark((function e(){var t,a=this;return W().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({uploadProgress:{},uploading:!0}),t=[],this.state.files.forEach((function(e){t.push(a.sendRequest(e))})),e.prev=3,e.next=6,Promise.all(t);case 6:this.setState({successfullUploaded:!0,uploading:!1,files:[]}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),this.setState({successfullUploaded:!0,uploading:!1,files:[]});case 12:case"end":return e.stop()}}),e,this,[[3,9]])}))),function(){return t.apply(this,arguments)})},{key:"sendRequest",value:function(e){var t=this,a=this.props.t;return new Promise((function(n,i){var r=new XMLHttpRequest,s=new FormData;s.append("files",e,e.name),r.upload.addEventListener("progress",(function(n){n.lengthComputable&&(K({},t.state.uploadProgress)[e.name]={state:"pending",percentage:n.loaded/n.total*100},t.props.progress(a("file.uploading")+" "+Math.round(n.loaded/n.total*100)+"%"))})),r.upload.addEventListener("load",(function(n){K({},t.state.uploadProgress)[e.name]={state:"done",percentage:100},t.props.progress(a("file.processing"))})),r.onload=function(){var e=JSON.parse(r.response);e&&e.error&&"true"==e.error?e.error_msg?t.props.progress(e.error_msg):t.props.progress(a("file.upload_failed")):(t.props.progress(a("file.completed")),t.props.onCompletion()),n(r)},r.upload.addEventListener("error",(function(a){var n=K({},t.state.uploadProgress);n[e.name]={state:"error",percentage:0},t.setState({uploadProgress:n}),i(r)})),r.open("POST",t.props.base_url+"/file/uploadfile/"+t.props.chat_id+"/"+t.props.hash),r.send(s)}))}},{key:"openFileDialog",value:function(){this.state.uploading||this.fileInputRef.current.click()}},{key:"onFilesAddedUI",value:function(e){var t=e.target.files,a=this.fileListToArray(t);this.onFilesAdded(a)}},{key:"onDragOver",value:function(e){e.preventDefault(),this.state.uploading||this.props.onDrag&&this.props.onDrag(!0)}},{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.props.dropArea.current&&(e.props.dropArea.current.ondragover=e.onDragOver,e.props.dropArea.current.ondragleave=e.onDragLeave,e.props.dropArea.current.ondrop=e.onDrop,document.addEventListener("paste",e.onPaste),I.a.eventEmitter.addListener("fileupload",e.openFileDialog))}),1e3)}},{key:"componentWillUnmount",value:function(){this.props.dropArea.current&&(this.props.dropArea.current.ondragover=null,this.props.dropArea.current.ondragleave=null,this.props.dropArea.current.ondrop=null),I.a.eventEmitter.removeListener("fileupload",this.openFileDialog),document.removeEventListener("paste",this.onPaste)}},{key:"onPaste",value:function(e){var t=e&&e.clipboardData&&e.clipboardData.items;if(t&&t.length){for(var a=[],n=0;n0&&this.onFilesAdded(a)}}},{key:"onDragLeave",value:function(e){this.props.onDrag&&this.props.onDrag(!1)}},{key:"onDrop",value:function(e){if(e.preventDefault(),!this.state.uploading){var t=e.dataTransfer.files,a=this.fileListToArray(t);this.onFilesAdded(a),this.props.onDrag&&this.props.onDrag(!1)}}},{key:"fileListToArray",value:function(e){for(var t=[],a=0;a=this.props.chat_ui.get("switch_to_human")&&X().get(window.lhcChat.base_url+"restapi/isonlinechat/"+this.props.chat.get("id")+"?exclude_bot=true").then((function(e){if(e.data.isonline){var t=document.getElementById("transfer-to-human-btn");null!==t&&t.classList.remove("hide")}}))}},{key:"componentDidMount",value:function(){this.checkSwitchButtom()}},{key:"componentDidUpdate",value:function(e,t,a){this.checkSwitchButtom()}},{key:"render",value:function(){var e=this;return A()(this.props.status,{replace:function(t){if(t.attribs&&t.attribs.onclick&&t.name&&("i"==t.name||"a"==t.name)){var a=Object.assign({},t.attribs);return t.attribs.class&&(t.attribs.className=t.attribs.class,delete t.attribs.class),t.attribs.onclick&&delete t.attribs.onclick,r.createElement("i",M()({},t.attribs,{onClick:function(t){return e.abstractClick(a)}}),(0,O.domToReact)(t.children))}}})}}]),i}(r.PureComponent))||Z),ee=Q;var te,ae,ne=function(e){h()(i,e);var t,a,n=(t=i,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 i=f()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return _()(this,e)});function i(e){return c()(this,i),n.call(this,e)}return d()(i,[{key:"render",value:function(){return r.createElement(r.Fragment,null,null!==this.props.profileBefore&&r.createElement("div",{dangerouslySetInnerHTML:{__html:this.props.profileBefore}}),r.createElement("div",{className:this.props.msg_expand,id:"messagesBlock",dangerouslySetInnerHTML:{__html:this.props.messagesBefore}}),!this.props.hideMessageField&&r.createElement("div",{className:"d-flex flex-row border-top position-relative message-send-area"},r.createElement("div",{className:"btn-group dropup disable-select ps-2 pt-2"},r.createElement("i",{className:"material-icons settings text-muted","aria-haspopup":"true","aria-expanded":"false"},"")),r.createElement("div",{className:"mx-auto pb-1 w-100"},r.createElement("textarea",{"aria-label":"Type your message here...",placeholder:this.props.placeholderMessage,id:"CSChatMessage",rows:"1",className:"ps-0 no-outline form-control rounded-0 form-control rounded-start-0 rounded-end-0 border-0"})),r.createElement("div",{className:"disable-select"},r.createElement("div",{className:"user-chatwidget-buttons pt-1",id:"ChatSendButtonContainer"},r.createElement("i",{className:"material-icons text-muted settings me-0"},"")))))}}]),i}(r.PureComponent),ie=a(6313);function re(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=function(e,t){if(e){if("string"==typeof e)return se(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?se(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,o=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return s=e.done,e},e:function(e){o=!0,r=e},f:function(){try{s||null==a.return||a.return()}finally{if(o)throw r}}}}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a70?!0!==this.state.scrollButton&&this.setState({scrollButton:!0}):!1!==this.state.scrollButton&&this.setState({scrollButton:!1,otm:0}))}},{key:"scrollToMessage",value:function(){var e=this;if(1==this.state.hasNew&&(clearTimeout(this.timeoutNewMessage),this.timeoutNewMessage=setTimeout((function(){e.setState({hasNew:!1,newId:0})}),1e3)),1==this.state.hasNew&&this.state.otm>0){this.setState({otm:0});try{document.getElementById("scroll-to-message").scrollIntoView()}catch(e){this.scrollBottom()}}else this.scrollBottom()}},{key:"changeFontAction",value:function(e){this.setState({fontSize:this.state.fontSize+(1==e?5:-5)}),I.a.setLocalStorage("_dfs",this.state.fontSize),this.scrollBottom()}},{key:"setLanguageAction",value:function(e){I.a.setLocalStorage("_lng",e),this.setState({changeLanguage:!1}),(0,E._Z)({lng:e,id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"])}),I.a.emitEvent("change_language",[e]),this.updateStatus()}},{key:"componentDidMount",value:function(){var e=I.a.getSessionStorage("_ttxt");null!==e&&this.setState({value:e});var t=I.a.getLocalStorage("_dfs");null!==t&&this.setState({fontSize:parseInt(t)});var a=document.getElementById("CSChatMessage");if(null!==a&&(!0===this.props.chatwidget.get("shown")&&"widget"==this.props.chatwidget.get("mode")||"popup"==this.props.chatwidget.get("mode"))){a.focus();var n=document.getElementById("CSChatMessage-tmp");null!==n&&document.body.removeChild(n)}}},{key:"focusMessage",value:function(){this.textMessageRef.current&&(this.textMessageRef.current.focus(),this.state.value.length>0&&(this.textMessageRef.current.selectionStart=this.state.value.length,this.textMessageRef.current.selectionEnd=this.state.value.length))}},{key:"setEditorEnabled",value:function(e){this.setState({enabledEditor:e})}},{key:"hasClass",value:function(e,t){return new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className)}},{key:"addClass",value:function(e,t){this.hasClass(e,t)||(e.className+=(e.className?" ":"")+t)}},{key:"removeClass",value:function(e,t){this.hasClass(e,t)&&(e.className=e.className.replace(new RegExp("(\\s|^)"+t+"(\\s|$)")," ").replace(/^\s+|\s+$/g,""))}},{key:"setMetaUpdateState",value:function(e){!1===e&&!0===this.pendingMetaUpdate&&(this.pendingMetaUpdate=!1,this.updateMetaAutoHide(!0),this.doScrollBottom()),!0===e&&(this.pendingMetaUpdate=!0,this.updateMetaAutoHide(),this.doScrollBottom())}},{key:"updateMetaAutoHide",value:function(e){var t=document.getElementById("messages-scroll");t&&["meta-auto-hide","meta-auto-hide-normal"].forEach((function(a){var n=t.getElementsByClassName(a);if(n.length>0){var i=e?0:1;for(r=0;r2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=[],r=!0;e=e.nextElementSibling;)r&&e&&!e.matches(t)==a?i.push(e):r=n;return i}},{key:"sendDelay",value:function(e){var t=this,a=e.id,n=e.duration,i=e.delay,r=e.untill_message,s=document.getElementById("msg-"+a);s&&(i>0&&this.addClass(s,"hide"),1==r&&this.nextUntil(s,".message-admin",!1,!0).length>0||setTimeout((function(){if(0==t.delayed)if(1==r)null!==t.intervalFunction&&t.intervalFunction(),t.intervalFunction=function(){if(t.nextUntil(s,".message-admin",!1,!0).length>0)s.parentNode.removeChild(s),t.scrollBottom(!1,!1),t.intervalFunction=null,clearInterval(t.intervalPending);else if(!t.hasClass(s,"meta-hider")){t.addClass(s,"meta-hider"),t.addClass(s,"message-row-typing"),t.removeClass(s,"hide"),t.removeClass(s,"fade-in-fast");var e,a=re(s.getElementsByClassName("msg-body"));try{for(a.s();!(e=a.n()).done;){var n=e.value;t.removeClass(n,"hide")}}catch(e){a.e(e)}finally{a.f()}t.scrollBottom(!1,!1)}},clearInterval(t.intervalPending),t.intervalPending=setInterval(t.intervalFunction,150);else{t.delayed=!0,t.addClass(s,"meta-hider"),t.addClass(s,"message-row-typing"),t.nextUntil(s,".meta-hider").forEach((function(e){t.addClass(e,"hide")})),t.unhideDelayedTimer=setTimeout((function(){t.unhideDelayed(a)}),1e3*n),t.removeClass(s,"hide"),t.removeClass(s,"fade-in-fast");var e,o=re(s.getElementsByClassName("msg-body"));try{for(o.s();!(e=o.n()).done;){var c=e.value;t.removeClass(c,"hide")}}catch(e){o.e(e)}finally{o.f()}i>0&&(t.updateMetaAutoHide(),t.scrollBottom(!1,!1))}else t.addClass(s,"message-row-typing"),t.addClass(s,"meta-hider"),t.delayQueue.push({id:a,delay:n})}),1e3*i))}},{key:"unhideDelayed",value:function(e){var t=this,a=document.getElementById("msg-"+e);if(a)if(this.nextUntil(a,".meta-hider").forEach((function(e){t.removeClass(e,"hide")})),a.parentNode.removeChild(a),this.updateMetaAutoHide(),this.scrollBottom(),this.delayQueue.length>0){var n=this.delayQueue.shift();setTimeout((function(){t.unhideDelayed(n.id)}),1e3*n.delay);var i=document.getElementById("msg-"+n.id);if(null!==i){this.removeClass(i,"hide"),this.removeClass(i,"fade-in-fast");var r,s=re(i.getElementsByClassName("msg-body"));try{for(s.s();!(r=s.n()).done;){var o=r.value;this.removeClass(o,"hide")}}catch(e){s.e(e)}finally{s.f()}}}else this.delayed=!1}},{key:"componentWillUnmount",value:function(){clearInterval(this.intervalPending),clearInterval(this.typingStopped),clearTimeout(this.unhideDelayedTimer),clearTimeout(this.timeoutNewMessage)}},{key:"getSnapshotBeforeUpdate",value:function(e,t){if(e.chatwidget.getIn(["chatLiveData","messages"]).size!=this.props.chatwidget.getIn(["chatLiveData","messages"]).size){var a=!1,n=!0,i=0;this.messagesAreaRef.current&&((i=this.messagesAreaRef.current.scrollHeight-this.messagesAreaRef.current.scrollTop)-this.messagesAreaRef.current.offsetHeight<70?i=0:n=!1,a=!0);var r=this.state.hasNew,s=1==r?this.state.newId:0,o=1==r?this.state.otm:0;if(0!=e.chatwidget.getIn(["chatLiveData","messages"]).size&&!1===this.props.chatwidget.getIn(["chatLiveData","uw"])){var c=this.props.chatwidget.get("shown")&&"widget"==this.props.chatwidget.get("mode")||"widget"!=this.props.chatwidget.get("mode")&&document.hasFocus();0==r?(s=1==(r=0==c||0==window.lhcChat.is_focused||0==n)?e.chatwidget.getIn(["chatLiveData","messages"]).size:0,o=this.props.chatwidget.getIn(["chatLiveData","otm"])):o+=this.props.chatwidget.getIn(["chatLiveData","otm"]);var l=this.props.chatwidget.hasIn(["chat_ui","msg_snippet"])&&this.props.chatwidget.getIn(["chatLiveData","messages",-1,"msg"]);I.a.emitEvent("play_sound",[{msop:this.props.chatwidget.getIn(["chatLiveData","msop"]),msg_body:l,otm:o,type:"new_message",sound_on:!0===this.props.chatwidget.getIn(["usersettings","soundOn"]),widget_open:c}])}else r=!1,s=0,o=0;if(this.setState({valueSend:!1,hasNew:r,newId:s,otm:o,scrollButton:!n}),1==a)return i}else{if(!1===e.chatwidget.get("shown")&&!0===this.props.chatwidget.get("shown"))return 0;this.props.chatwidget.getIn(["chatLiveData","error"])&&(this.props.chatwidget.getIn(["chatLiveData","lmsg"])&&(0==this.state.errorMode||this.props.chatwidget.getIn(["chatLiveData","lmsg"])!=e.chatwidget.getIn(["chatLiveData","lmsg"]))||!this.props.chatwidget.getIn(["chatLiveData","lmsg"])&&0==this.state.errorMode)?this.setState({errorMode:!0,valueSend:!1,value:this.props.chatwidget.getIn(["chatLiveData","lmsg"])}):!this.props.chatwidget.getIn(["chatLiveData","error"])&&e.chatwidget.getIn(["chatLiveData","error"])&&this.setState({errorMode:!1,valueSend:!1,value:""})}return null}},{key:"componentDidUpdate",value:function(e,t,a){var n=this;!1!==this.state.showMessages&&e.chatwidget.getIn(["chatLiveData","status"])==this.props.chatwidget.getIn(["chatLiveData","status"])||(1==this.props.chatwidget.get("newChat")&&1==this.props.chatwidget.getIn(["chatLiveData","messages"]).size?this.scrollBottom(!1,!0):this.scrollBottom(!1,!1));var i=!1;if((!1===t.enabledEditor&&t.enabledEditor!=this.state.enabledEditor&&1==(i=!0)||this.props.chatwidget.get("msgLoaded")!==e.chatwidget.get("msgLoaded")&&(0==this.props.chatwidget.get("newChat")||1==(i=!0)))&&(0==i?this.scrollBottom(!1,!1):this.scrollBottom(!1,!0),(!0!==this.props.chatwidget.getIn(["chat_ui","auto_start"])||"embed"!=this.props.chatwidget.get("mode")||!1===this.props.chatwidget.getIn(["chat_ui","auto_start"])&&"embed"==this.props.chatwidget.get("mode")||!1===t.enabledEditor&&t.enabledEditor!=this.state.enabledEditor)&&(this.focusMessage(),setTimeout((function(){n.focusMessage()}),500))),null!==a&&this.messagesAreaRef.current){var r=document.getElementById("messages-scroll"),s=document.getElementById("msg-"+this.props.chatwidget.getIn(["chatLiveData","lfmsgid"]));r&&s&&-1===s.className.indexOf("ignore-auto-scroll")&&r.scrollHeight-r.offsetHeight>s.offsetTop?(this.setState({scrollButton:!0}),this.messagesAreaRef.current.scrollTop=s.offsetTop):this.messagesAreaRef.current.scrollTop=this.messagesAreaRef.current.scrollHeight-a}if(1==this.props.chatwidget.getIn(["chat_ui_state","confirm_close"])&&!1===this.state.preloadSurvey&&this.setState({preloadSurvey:!0}),!1===e.chatwidget.get("shown")&&!0===this.props.chatwidget.get("shown")&&"widget"==this.props.chatwidget.get("mode")&&this.textMessageRef.current&&this.textMessageRef.current.focus(),!0!==this.props.chatwidget.getIn(["chat_ui","start_on_close"])||!0!==this.props.chatwidget.getIn(["chatLiveData","closed"])||void 0!==e.chatwidget.getIn(["chatLiveData","closed"])&&!1!==e.chatwidget.hasIn(["chatLiveData","closed"])&&!1!==e.chatwidget.getIn(["chatLiveData","closed"])||this.props.chatwidget.getIn(["chat_ui","survey_id"])||this.props.endChat({show_start:this.props.chatwidget.get("shown")}),!0===this.props.chatwidget.getIn(["chatLiveData","closed"])&&0===this.props.chatwidget.getIn(["chatLiveData","status_sub"])&&5===e.chatwidget.getIn(["chatLiveData","status_sub"])&&this.props.dispatch((0,E.Rt)({id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),theme:this.props.chatwidget.get("theme")})),!(!0!==this.props.chatwidget.get("shown")||"widget"!=this.props.chatwidget.get("mode")&&"embed"!=this.props.chatwidget.get("mode")||!0!==this.props.chatwidget.get("initLoaded")||!0!==this.props.chatwidget.get("msgLoaded")||0!=e.chatwidget.get("msgLoaded")&&0!=e.chatwidget.get("initLoaded"))){"widget"==this.props.chatwidget.get("mode")&&this.textMessageRef.current&&this.textMessageRef.current.focus();var o=document.getElementById("CSChatMessage-tmp");null!==o&&document.body.removeChild(o)}}},{key:"doScrollBottom",value:function(e){var t;this.messagesAreaRef.current&&(e&&null!==(t=document.getElementById("msg-"+this.props.chatwidget.getIn(["chatLiveData","lfmsgid"])))&&-1===t.className.indexOf("ignore-auto-scroll")?this.messagesAreaRef.current.scrollTop=t.offsetTop:this.messagesAreaRef.current.scrollTop=this.messagesAreaRef.current.scrollHeight+1e3)}},{key:"scrollBottom",value:function(e,t){var a=this;!this.messagesAreaRef.current||e&&this.state.scrollButton||(this.doScrollBottom(t),setTimeout((function(){a.doScrollBottom(t),!1===a.state.showMessages&&a.setState({showMessages:!0})}),450))}},{key:"abstractAction",value:function(e,t){I.a.emitEvent(e,t)}},{key:"updateMessage",value:function(e){this.props.dispatch((0,E.o6)({msg_id:e,lmgsid:this.props.chatwidget.getIn(["chatLiveData","lmsgid"]),mode:this.props.chatwidget.get("mode"),theme:this.props.chatwidget.get("theme"),id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),no_scroll:!0}))}},{key:"updateMessages",value:function(){var e={chat_id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),lmgsid:this.props.chatwidget.getIn(["chatLiveData","lmsgid"]),theme:this.props.chatwidget.get("theme"),new_chat:this.props.chatwidget.get("newChat")};e.new_chat&&0===e.lmgsid&&(e.old_msg_id=this.props.chatwidget.getIn(["chatData","lmsg_id"])),this.props.dispatch((0,E.W4)(e))}},{key:"updateStatus",value:function(){this.props.dispatch((0,E.kW)({chat_id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),theme:this.props.chatwidget.get("theme"),mode:this.props.chatwidget.get("mode")}))}},{key:"sendMessage",value:function(){I.a.setSessionStorage("_ttxt",""),this.props.dispatch((0,E.Hz)({id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),msg:this.state.value,mn:this.props.chatwidget.hasIn(["chat_ui","mn"]),theme:this.props.chatwidget.get("theme"),lmgsid:this.props.chatwidget.getIn(["chatLiveData","lmsgid"])})),this.setState({value:"",valueSend:!0,errorMode:!1}),this.currentMessageTyping="",this.focusMessage(),this.doScrollBottom()}},{key:"enterKeyDown",value:function(e){"Enter"!==e.key||e.shiftKey||(this.sendMessage(),e.preventDefault())}},{key:"keyUp",value:function(e){"Enter"===e.key||e.shiftKey||(!1===this.isTyping?(this.isTyping=!0,this.props.dispatch((0,E.Hx)("true",this.state.value))):(clearTimeout(this.typingStopped),this.typingStopped=setTimeout(this.typingStoppedAction,6e3),this.currentMessageTyping!=this.state.value&&(Math.abs(this.currentMessageTyping.length-this.state.value.length)>6||this.props.chatwidget.get("overrides").contains("typing"))&&(this.currentMessageTyping=this.state.value,this.props.dispatch((0,E.Hx)("true",this.state.value)))))}},{key:"typingStoppedAction",value:function(){1==this.isTyping&&(this.isTyping=!1,this.props.dispatch((0,E.Hx)("false")))}},{key:"endChat",value:function(){this.props.endChat({show_start:this.props.chatwidget.get("shown")})}},{key:"toggleModal",value:function(){this.setState({showBBCode:!this.state.showBBCode}),this.state.showBBCode&&this.focusMessage()}},{key:"mailChat",value:function(){this.setState({showMail:!this.state.showMail})}},{key:"changeLanguage",value:function(){this.setState({changeLanguage:!this.state.changeLanguage})}},{key:"changeFont",value:function(){this.setState({changeFontSize:!this.state.changeFontSize})}},{key:"voiceCall",value:function(){var e=void 0!==window.screenLeft?window.screenLeft:window.screenX,t=void 0!==window.screenTop?window.screenTop:window.screenY,a=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,n=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,i=a/window.screen.availWidth,r=(a-parseInt(800))/2/i+e,s="scrollbars=yes,menubar=1,resizable=1,width=800,height=600,top="+((n-parseInt(600))/2/i+t)+",left="+r,o=window.open("",I.a.prefix+"_voice_popup_v2",s),c=!1,l=!1;try{!o||o.closed||void 0===o.closed||"about:blank"===o.location.href?(o=window.open(this.props.chatwidget.get("base_url")+"voicevideo/call/"+this.props.chatwidget.getIn(["chatData","id"])+"/"+this.props.chatwidget.getIn(["chatData","hash"]),I.a.prefix+"_voice_popup_v2",s),l=!0):c=!0}catch(e){c=!0}!o||o.closed||void 0===o.closed||1==l||!0===c&&o.focus()}},{key:"toggleSound",value:function(){this.props.dispatch({type:"toggleSound",data:!this.props.chatwidget.getIn(["usersettings","soundOn"])}),I.a.sendMessageParent("toggleSound",[{sender:"toolbarButton"}])}},{key:"render",value:function(){var e=this,t=this.props.t;if(!1===this.props.chatwidget.get("initLoaded")||!1===this.props.chatwidget.get("msgLoaded")){var a="flex-grow-1 overflow-scroll position-relative";return this.props.chatwidget.hasIn(["chat_ui","msg_expand"])&&(a="overflow-scroll position-relative"),r.createElement(ne,{profileBefore:this.props.profileBefore,msg_expand:a,messagesBefore:this.props.messagesBefore,placeholderMessage:this.props.chatwidget.hasIn(["chat_ui","placeholder_message"])?this.props.chatwidget.getIn(["chat_ui","placeholder_message"]):t("chat.type_here")})}if(this.props.chatwidget.hasIn(["chatLiveData","ru"])&&this.props.chatwidget.getIn(["chatLiveData","ru"]))return u=this.props.chatwidget.get("base_url")+this.props.chatwidget.getIn(["chatLiveData","ru"]),r.createElement(r.Fragment,null,r.createElement("iframe",{allowtransparency:"true",src:u,frameBorder:"0",className:"flex-grow-1 position-relative iframe-modal"}));if(this.props.chatwidget.get("chatLiveData").has("messages"))var n=this.props.chatwidget.getIn(["chatLiveData","messages"]).map((function(a,n){return r.createElement(F,{reactToMessageId:e.state.reactToMsgId,setReactingTo:function(t){return e.setState({reactToMsgId:t})},themeId:e.props.chatwidget.get("theme"),profilePic:e.props.chatwidget.get("profile_pic"),newTitle:e.props.chatwidget.getIn(["chat_ui","cnew_msgh"])||t("button.new"),newId:e.state.newId,hasNew:e.state.hasNew,voiceCall:e.voiceCall,endChat:e.props.endChat,setMetaUpdateState:e.setMetaUpdateState,sendDelay:e.sendDelay,setEditorEnabled:e.setEditorEnabled,abstractAction:e.abstractAction,updateStatus:e.updateStatus,focusMessage:e.focusMessage,updateMessage:e.updateMessage,updateMessages:e.updateMessages,scrollBottom:e.scrollBottom,id:n,key:"msg_"+n,msg:a})}));else n="";var i;i=!0===this.state.dragging?t("chat.drop_files"):this.props.chatwidget.getIn(["chatLiveData","closed"])?t("chat.chat_closed"):this.props.chatwidget.hasIn(["chat_ui","placeholder_message"])?this.props.chatwidget.getIn(["chat_ui","placeholder_message"]):t("chat.type_here"),a="flex-grow-1 overflow-scroll position-relative";var s="bottom-message px-1";this.props.chatwidget.hasIn(["chat_ui","msg_expand"])&&"embed"==this.props.chatwidget.get("mode")&&(a="overflow-scroll position-relative",s+=" position-relative");var o="mx-auto w-100";1==this.props.chatwidget.getIn(["chatLiveData","closed"])&&(o+="embed"==this.props.chatwidget.get("mode")?" pe-2":" pe-1");var c=!0,l=!1,d=!1,u="",h="flex-grow-1 position-relative iframe-modal content-loader mb-2",p=this.props.chatwidget.hasIn(["chatLiveData","status_sub"])&&(this.props.chatwidget.getIn(["chatLiveData","status_sub"])==D.Pd||this.props.chatwidget.getIn(["chatLiveData","status_sub"])==D.pV&&(this.props.chatwidget.getIn(["chatLiveData","uid"])>0||this.props.chatwidget.getIn(["chatLiveData","status"])===D.pA||this.props.chatwidget.getIn(["chatLiveData","status"])==D.sk))||this.props.chatwidget.getIn(["chatLiveData","status"])==D.sk&&this.props.chatwidget.getIn(["chatLiveData","uid"])>0||!0===this.state.gotToSurvey;(this.props.chatwidget.hasIn(["chatLiveData","status_sub"])&&this.props.chatwidget.getIn(["chatLiveData","status_sub"])==D.Pd||this.props.chatwidget.getIn(["chatLiveData","status"])==D.sk&&this.props.chatwidget.getIn(["chatLiveData","status_sub"])!=D.pV)&&(d=!0),(!0===this.state.preloadSurvey||p)&&this.props.chatwidget.hasIn(["chat_ui","survey_id"])&&(u=this.props.chatwidget.get("base_url")+"survey/fillwidget/(chatid)/"+this.props.chatwidget.getIn(["chatData","id"])+"/(hash)/"+this.props.chatwidget.getIn(["chatData","hash"]),this.props.chatwidget.get("theme")&&(u=u+"/(theme)/"+this.props.chatwidget.get("theme")),u=u+"/(survey)/"+this.props.chatwidget.getIn(["chat_ui","survey_id"])+(!0===d?"/(force)/true":""),this.props.chatwidget.hasIn(["chat_ui","survey_url"])&&(u=this.props.chatwidget.getIn(["chat_ui","survey_url"]).replace("{chat_id}",this.props.chatwidget.getIn(["chatData","id"])).replace("{chat_hash}",this.props.chatwidget.getIn(["chatData","hash"]))+(!0===d?"?force=true":"")),l=!0,c=!1,(!1===p||this.props.chatwidget.hasIn(["chat_ui","survey_button"])&&0===this.props.chatwidget.getIn(["chat_ui_state","show_survey"])&&this.props.chatwidget.getIn(["chatLiveData","status"])==D.sk&&this.props.chatwidget.getIn(["chatLiveData","status_sub"])!=D.Pd&&this.props.chatwidget.getIn(["chatLiveData","status_sub"])!=D.pV||1==this.props.chatwidget.getIn(["chat_ui_state","confirm_close"]))&&(c=!0,h=" d-none"));var _=this.props.chatwidget.getIn(["chat_ui","end_chat_text"])||t("button.end_chat"),g={fontSize:(this.props.chatwidget.hasIn(["chat_ui","font_size"])?this.state.fontSize:"100")+"%"};return r.createElement(r.Fragment,null,this.props.chatwidget.getIn(["chatLiveData","abort"])&&r.createElement(ie.Z,{closeText:t("button.close"),close:function(t){return e.props.dispatch((0,E.H7)(!0))},text:this.props.chatwidget.getIn(["chatLiveData","abort"])}),this.props.chatwidget.hasIn(["chat_ui","pre_survey_url"])&&this.props.chatwidget.getIn(["chatLiveData","uid"])>0&&2!==this.props.chatwidget.getIn(["chat_ui_state","pre_survey_done"])&&(1===this.props.chatwidget.getIn(["chat_ui_state","pre_survey_done"])||p)&&r.createElement(R.Z,{cancelClose:function(t){return e.props.dispatch((0,E.Lt)(!1))},confirmClose:function(t){return e.props.dispatch((0,E.Lt)(!0))},toggle:this.props.cancelPresurvey,dataUrl:this.props.chatwidget.getIn(["chat_ui","pre_survey_url"])+this.props.chatwidget.getIn(["chatData","id"])+"/"+this.props.chatwidget.getIn(["chatData","hash"])+(this.props.chatwidget.hasIn(["chat_ui","survey_id"])?"/(hassurvey)/true":"")+(this.props.chatwidget.get("theme")?"/(theme)/"+this.props.chatwidget.get("theme"):null)}),l&&r.createElement(r.Fragment,null,0==c&&this.props.chatwidget.hasIn(["chatStatusData","result"])&&!this.props.chatwidget.hasIn(["chat_ui","hide_status"])&&this.props.chatwidget.getIn(["chatStatusData","result"])&&r.createElement("div",{id:"chat-status-container",className:"p-2 border-bottom live-status-"+this.props.chatwidget.getIn(["chatLiveData","status"])},r.createElement(ee,{updateStatus:this.updateStatus,vtm:this.props.chatwidget.hasIn(["chat_ui","switch_to_human"])&&this.props.chatwidget.getIn(["chatLiveData","status"])==D.pA?this.props.chatwidget.getIn(["chatLiveData","vtm"]):0,status:this.props.chatwidget.getIn(["chatStatusData","result"])})),r.createElement("iframe",{allowtransparency:"true",src:u,frameBorder:"0",className:h})),(c||l)&&r.createElement(G,{hasSurvey:l,syncInterval:this.props.chatwidget.getIn(["chat_ui","sync_interval"]),updateStatus:this.updateStatus,updateMessages:this.updateMessages,initClose:this.props.chatwidget.get("initClose"),dispatch:this.props.dispatch,status_sub:this.props.chatwidget.getIn(["chatLiveData","status_sub"]),status:this.props.chatwidget.getIn(["chatLiveData","status"]),theme:this.props.chatwidget.get("theme"),lmgsid:this.props.chatwidget.getIn(["chatLiveData","lmsgid"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),chat_id:this.props.chatwidget.getIn(["chatData","id"])}),c&&r.createElement(r.Fragment,null,1==this.props.chatwidget.getIn(["chat_ui_state","confirm_close"])&&r.createElement(R.Z,{confirmClose:this.props.endChat,cancelClose:this.props.cancelClose,toggle:this.props.cancelClose,dataUrl:"/chat/confirmleave/"+this.props.chatwidget.getIn(["chatData","id"])+"/"+this.props.chatwidget.getIn(["chatData","hash"])}),this.state.showBBCode&&r.createElement(R.Z,{showModal:this.state.showBBCode,insertText:this.insertText,toggle:this.toggleModal,dataUrl:"/chat/bbcodeinsert?react=1"}),this.state.changeLanguage&&r.createElement(R.Z,{showModal:this.state.changeLanguage,setLanguage:this.setLanguageAction,insertText:this.insertText,toggle:this.changeLanguage,dataUrl:"/widgetrestapi/chooselanguage/(id)/"+this.props.chatwidget.getIn(["chatData","id"])+"/(hash)/"+this.props.chatwidget.getIn(["chatData","hash"])}),this.state.showMail&&r.createElement(r.Suspense,{fallback:"..."},r.createElement(de,{showModal:this.state.showMail,changeFont:this.changeFont,toggle:this.mailChat,chatHash:this.props.chatwidget.getIn(["chatData","hash"]),chatId:this.props.chatwidget.getIn(["chatData","id"])})),this.state.changeFontSize&&r.createElement(r.Suspense,{fallback:"..."},r.createElement(ue,{showModal:this.state.changeFontSize,toggle:this.changeFont,changeFont:this.changeFontAction})),"embed"==this.props.chatwidget.get("mode")&&this.props.chatwidget.hasIn(["chat_ui","embed_cls"])&&1==this.props.chatwidget.getIn(["chat_ui","embed_cls"])&&r.createElement("div",{className:"close-modal-btn position-absolute"},this.props.chatwidget.hasIn(["chat_ui","close_btn"])&&r.createElement("a",{onClick:this.endChat,title:_},r.createElement("i",{className:"material-icons settings text-muted"},""),r.createElement("span",{className:"embed-close-title"},_))),this.props.chatwidget.hasIn(["chatStatusData","result"])&&!this.props.chatwidget.hasIn(["chat_ui","hide_status"])&&this.props.chatwidget.getIn(["chatStatusData","result"])&&r.createElement("div",{id:"chat-status-container",className:"p-2 border-bottom live-status-"+this.props.chatwidget.getIn(["chatLiveData","status"])},r.createElement(ee,{updateStatus:this.updateStatus,vtm:this.props.chatwidget.hasIn(["chat_ui","switch_to_human"])&&this.props.chatwidget.getIn(["chatLiveData","status"])==D.pA?this.props.chatwidget.getIn(["chatLiveData","vtm"]):0,status:this.props.chatwidget.getIn(["chatStatusData","result"])})),r.createElement("div",{className:a,onClick:function(t){e.setState({reactToMsgId:0})},id:"messagesBlock",onScroll:this.onScrollMessages},r.createElement("div",{className:s,id:"messages-scroll",style:g,ref:this.messagesAreaRef},this.props.chatwidget.hasIn(["chat_ui","prev_chat"])&&r.createElement("div",{dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","prev_chat"])}}),n),this.state.scrollButton&&r.createElement("div",{className:"position-absolute btn-bottom-scroll fade-in"},r.createElement("button",{type:"button",onClick:this.scrollToMessage,className:"btn btn-sm btn-secondary"},this.state.hasNew&&this.state.otm>0&&r.createElement("div",null,r.createElement("i",{className:"material-icons"},""),this.state.otm," ",1==this.state.otm?this.props.chatwidget.getIn(["chat_ui","cnew_msg"])||t("button.new_msg"):this.props.chatwidget.getIn(["chat_ui","cnew_msgm"])||t("button.new_msgm"))||this.props.chatwidget.getIn(["chat_ui","cscroll_btn"])||t("button.scroll_bottom")))),r.createElement("div",{className:(!1===this.props.chatwidget.get("msgLoaded")||!1===this.state.enabledEditor?"d-none ":"d-flex ")+"flex-row border-top position-relative message-send-area"},(this.props.chatwidget.getIn(["chatLiveData","ott"])||this.props.chatwidget.getIn(["chatLiveData","error"])&&"SEND_CONNECTION"!=this.props.chatwidget.getIn(["chatLiveData","error"])||this.props.chatwidget.get("network_down"))&&r.createElement("div",{id:"id-operator-typing",className:"bg-white ps-1"},this.props.chatwidget.getIn(["chatLiveData","error"])?-1===this.props.chatwidget.getIn(["chatLiveData","error"]).indexOf("SEND_")?this.props.chatwidget.getIn(["chatLiveData","error"]):t("online_chat."+this.props.chatwidget.getIn(["chatLiveData","error"]).toLowerCase()):this.props.chatwidget.get("network_down")?t("online_chat.send_connection"):this.props.chatwidget.getIn(["chatLiveData","ott"])),"embed"==this.props.chatwidget.get("mode")&&this.props.chatwidget.hasIn(["chat_ui","embed_cls"])&&2==this.props.chatwidget.getIn(["chat_ui","embed_cls"])&&r.createElement("div",{className:"inline-cls-btn pt-1 ps-2"},this.props.chatwidget.hasIn(["chat_ui","close_btn"])&&r.createElement("a",{onClick:this.endChat,title:_},r.createElement("i",{className:"material-icons settings text-muted me-0"},""))),r.createElement(J,{elementId:"chat-dropdown-options"},r.createElement("div",{className:"btn-group dropup disable-select ps-1 pt-2"},r.createElement("i",{className:"material-icons settings text-muted",id:"chat-dropdown-options","data-bs-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},""),r.createElement("div",{className:"dropdown-menu shadow bg-white rounded lhc-dropdown-menu ms-1 "+("rtl"==window.lhcChat.staticJS.dir?"dropdown-menu-end":"")},r.createElement("div",{className:"d-flex flex-row ps-1"},r.createElement("a",{onClick:this.toggleSound,title:t("chat.option_sound")},r.createElement("i",{className:"material-icons chat-setting-item text-muted "+(!0===this.props.chatwidget.getIn(["usersettings","soundOn"])?"sound-on-ico":"sound-off-ico")},!0===this.props.chatwidget.getIn(["usersettings","soundOn"])?r.createElement(r.Fragment,null,""):r.createElement(r.Fragment,null,""))),this.props.chatwidget.hasIn(["chat_ui","print"])&&r.createElement("a",{target:"_blank",href:this.props.chatwidget.get("base_url")+"chat/printchat/"+this.props.chatwidget.getIn(["chatData","id"])+"/"+this.props.chatwidget.getIn(["chatData","hash"]),title:t("button.print")},r.createElement("i",{className:"material-icons chat-setting-item text-muted print-ico"},"")),this.props.chatwidget.hasIn(["chat_ui","dwntxt"])&&r.createElement("a",{target:"_blank",href:this.props.chatwidget.get("base_url")+"chat/downloadtxt/"+this.props.chatwidget.getIn(["chatData","id"])+"/"+this.props.chatwidget.getIn(["chatData","hash"]),title:t("button.dwntxt")},r.createElement("i",{className:"material-icons chat-setting-item text-muted download-ico"},"")),!this.props.chatwidget.getIn(["chatLiveData","closed"])&&this.props.chatwidget.hasIn(["chat_ui","file"])&&r.createElement(z,{fileOptions:this.props.chatwidget.getIn(["chat_ui","file_options"]),onDrag:this.dragging,dropArea:this.textMessageRef,onCompletion:this.updateMessages,progress:this.setStatusText,base_url:this.props.chatwidget.get("base_url"),chat_id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),link:!0}),!this.props.chatwidget.getIn(["chatLiveData","closed"])&&1==this.props.chatwidget.getIn(["chatLiveData","status"])&&this.props.chatwidget.hasIn(["chat_ui","voice"])&&!0===this.props.chatwidget.getIn(["chat_ui","voice"])&&r.createElement("a",{onClick:this.voiceCall,title:t("button.voice")},r.createElement("i",{className:"material-icons chat-setting-item text-muted voice-ico"},"")),!this.props.chatwidget.getIn(["chatLiveData","closed"])&&!this.props.chatwidget.hasIn(["chat_ui","bbc_btnh"])&&r.createElement("a",{onClick:this.toggleModal,title:t("button.bb_code")},r.createElement("i",{className:"material-icons chat-setting-item text-muted bbcode-ico"},"")),this.props.chatwidget.hasIn(["chat_ui","mail"])&&r.createElement("a",{onClick:this.mailChat,title:t("button.mail")},r.createElement("i",{className:"material-icons chat-setting-item text-muted mail-ico"},"")),this.props.chatwidget.hasIn(["chat_ui","font_size"])&&r.createElement("a",{onClick:function(t){return e.changeFont(t)}},r.createElement("i",{className:"material-icons chat-setting-item text-muted fs-ico"},"")),this.props.chatwidget.hasIn(["chat_ui","close_btn"])&&r.createElement("a",{onClick:this.endChat,title:_},r.createElement("i",{className:"material-icons chat-setting-item text-muted close-ico"},"")),this.props.chatwidget.hasIn(["chat_ui","lng_btnh"])&&r.createElement("a",{onClick:this.changeLanguage,title:t("button.lang")},r.createElement("i",{className:"material-icons chat-setting-item text-muted lang-ico"},"")))))),r.createElement("div",{className:o},this.props.chatwidget.getIn(["chatLiveData","closed"])&&this.props.chatwidget.hasIn(["chat_ui","survey_id"])&&r.createElement("button",{onClick:this.goToSurvey,className:"w-100 btn btn-success"},t("online_chat.go_to_survey")),(!this.props.chatwidget.getIn(["chatLiveData","closed"])||!this.props.chatwidget.hasIn(["chat_ui","survey_id"]))&&r.createElement("textarea",{onFocus:function(t){e.setState({reactToMsgId:0})},onTouchStart:this.scrollBottom,maxLength:this.props.chatwidget.getIn(["chat_ui","max_length"]),onKeyUp:this.keyUp,readOnly:this.props.chatwidget.getIn(["chatLiveData","closed"])||this.props.chatwidget.get("network_down"),id:"CSChatMessage",placeholder:i,onKeyDown:this.enterKeyDown,value:this.props.chatwidget.getIn(["chatLiveData","closed"])?"":this.state.value,onChange:this.handleChange,ref:this.textMessageRef,rows:"1",className:"ps-0 no-outline form-control rounded-0 form-control rounded-start-0 rounded-end-0 border-0 "+(!0===this.props.chatwidget.get("shown")&&this.textMessageRef.current&&(/\r|\n/.exec(this.state.value)||this.state.value.length>this.textMessageRef.current.offsetWidth/8.6)?"msg-two-line":"msg-one-line")})),!this.props.chatwidget.getIn(["chatLiveData","closed"])&&!this.props.chatwidget.get("network_down")&&r.createElement("div",{className:"disable-select"},r.createElement("div",{className:"user-chatwidget-buttons pt-1 pe-1",id:"ChatSendButtonContainer"},!0===this.state.voiceMode&&r.createElement(r.Suspense,{fallback:"..."},r.createElement(le,{onCompletion:this.updateMessages,progress:this.setStatusText,base_url:this.props.chatwidget.get("base_url"),chat_id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"]),maxSeconds:"30",cancel:this.cancelVoiceRecording})),!this.state.valueSend&&this.props.chatwidget.hasIn(["chat_ui","voice_message"])&&void 0!==window.Audio&&0==this.state.value.length&&!1===this.state.voiceMode&&r.createElement("a",{onClick:this.startVoiceRecording,title:t("button.record_voice")},r.createElement("i",{className:"material-icons text-muted settings me-0"},"")),!this.state.valueSend&&(!this.props.chatwidget.hasIn(["chat_ui","voice_message"])||!(void 0!==window.Audio)||this.state.value.length>0&&!1===this.state.voiceMode)&&r.createElement("a",{onClick:this.sendMessage,title:t("button.send")},r.createElement("i",{className:"material-icons text-muted settings me-0"},"")),this.state.valueSend&&r.createElement("i",{className:"material-icons text-muted settings me-0"},""))))))}}]),i}(r.Component))||ae),pe=(0,S.Z)()(he);var _e=r.lazy((function(){return a.e(476).then(a.bind(a,5476))})),ge=r.lazy((function(){return a.e(906).then(a.bind(a,906))})),fe=(oe=(0,b.$j)((function(e){return{chatwidget:e.chatwidget}})),oe(ce=function(e){h()(i,e);var t,a,n=(t=i,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 i=f()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return _()(this,e)});function i(e){var t;return c()(this,i),t=n.call(this,e),y()(v()(t),"state",{}),t.endChat=t.endChat.bind(v()(t)),t.popupChat=t.popupChat.bind(v()(t)),t.cancelClose=t.cancelClose.bind(v()(t)),t.setProfile=t.setProfile.bind(v()(t)),t.setMessages=t.setMessages.bind(v()(t)),t.setHideMessageField=t.setHideMessageField.bind(v()(t)),t.setBotPayload=t.setBotPayload.bind(v()(t)),t.lastHeiht=0,t.profileHTML=null,t.messagesHTML=null,t.hideMessageField=!1,t.botPayload=null,I.a.eventEmitter.addListener("end_chat_visitor",(function(e){return t.endChat()})),t}return d()(i,[{key:"cancelClose",value:function(){this.props.dispatch({type:"UI_STATE",data:{attr:"confirm_close",val:0}})}},{key:"setBotPayload",value:function(e){this.botPayload=e}},{key:"endChat",value:function(e){void 0===e&&(e={});var t=!1,a=!1,n=!1,i=this.props.chatwidget.hasIn(["chatLiveData","status_sub"])&&(this.props.chatwidget.getIn(["chatLiveData","status_sub"])==D.B4||this.props.chatwidget.getIn(["chatLiveData","status_sub"])==D.Pd||this.props.chatwidget.getIn(["chatLiveData","status_sub"])==D.pV&&(this.props.chatwidget.getIn(["chatLiveData","uid"])>0||this.props.chatwidget.getIn(["chatLiveData","status"])===D.pA||this.props.chatwidget.getIn(["chatLiveData","status"])==D.sk)),r=this.props.chatwidget.getIn(["chatLiveData","status"])==D.sk&&this.props.chatwidget.getIn(["chatLiveData","uid"])>0;(1==i||r)&&this.props.chatwidget.hasIn(["chat_ui","survey_id"])&&(this.props.chatwidget.hasIn(["chat_ui","survey_button"])&&1!==this.props.chatwidget.getIn(["chat_ui_state","show_survey"])&&1!=i?a=!0:t=!0),!1===t&&this.props.chatwidget.hasIn(["chat_ui","confirm_close"])&&0===this.props.chatwidget.getIn(["chat_ui_state","confirm_close"])?this.props.dispatch({type:"UI_STATE",data:{attr:"confirm_close",val:1}}):(1===this.props.chatwidget.getIn(["chat_ui_state","confirm_close"])&&this.props.dispatch({type:"UI_STATE",data:{attr:"confirm_close",val:2}}),1===this.props.chatwidget.getIn(["chat_ui_state","pre_survey_done"])&&this.props.dispatch({type:"UI_STATE",data:{attr:"pre_survey_done",val:2}}),this.props.chatwidget.hasIn(["chat_ui","pre_survey_url"])&&0===this.props.chatwidget.getIn(["chat_ui_state","pre_survey_done"])&&this.props.chatwidget.getIn(["chatLiveData","uid"])>0&&(this.props.dispatch({type:"UI_STATE",data:{attr:"pre_survey_done",val:1}}),n=!0),!0!==a?!1===this.props.chatwidget.get("initClose")&&this.props.chatwidget.hasIn(["chat_ui","survey_id"])&&0==t&&(this.props.chatwidget.getIn(["chatLiveData","uid"])>0||this.props.chatwidget.getIn(["chatLiveData","status"])===D.pA)?this.props.dispatch((0,E.Nl)({show_start:!(!e||!e.show_start)&&e.show_start,noCloseReason:"SHOW_SURVEY",noClose:!0,vid:this.props.chatwidget.get("vid"),chat:{id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"])}})):0==n&&this.props.dispatch((0,E.Nl)({show_start:!(!e||!e.show_start)&&e.show_start,vid:this.props.chatwidget.get("vid"),chat:{id:this.props.chatwidget.getIn(["chatData","id"]),hash:this.props.chatwidget.getIn(["chatData","hash"])}})):this.props.dispatch({type:"UI_STATE",data:{attr:"show_survey",val:1}}))}},{key:"popupChat",value:function(){var e=null;window.parent&&window.parent["$_"+I.a.prefixUppercase]&&!1===window.parent.closed?e=window.parent["$_"+I.a.prefixUppercase].eventListener:window.opener&&window.opener["$_"+I.a.prefixUppercase]&&!1===window.opener.closed&&(e=window.opener["$_"+I.a.prefixUppercase].eventListener),null!==e?e.emitEvent("openPopup"):I.a.sendMessageParent("openPopup",[])}},{key:"setProfile",value:function(e){this.profileHTML=e}},{key:"setMessages",value:function(e){this.messagesHTML=e}},{key:"setHideMessageField",value:function(e){this.hideMessageField=e}},{key:"render",value:function(){if(!1===this.props.chatwidget.get("loadedCore"))return null;if(!0===this.props.chatwidget.getIn(["proactive","pending"]))return r.createElement(r.Suspense,{fallback:"..."},r.createElement(ge,{setBotPayload:this.setBotPayload}));var e="d-flex flex-column flex-grow-1 reset-container-margins";return"widget"==this.props.chatwidget.get("mode")?e+=1==this.props.chatwidget.get("isMobile")?" mobile-body":" desktop-body":"embed"==this.props.chatwidget.get("mode")&&(e+=1==this.props.chatwidget.get("isMobile")?" mobile-embed-body":" desktop-embed-body"),this.props.chatwidget.hasIn(["chat_ui","msg_expand"])&&"embed"==this.props.chatwidget.get("mode")&&(e+=" mh-100"),!0===this.props.chatwidget.get("isChatting")?(e+=" online-chat online-chat-status-"+this.props.chatwidget.getIn(["chatLiveData","status"]),r.createElement(r.Fragment,null,this.props.chatwidget.hasIn(["chat_ui","custom_html_header"])&&r.createElement("div",{className:"lhc-custom-header-above",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","custom_html_header"])}}),"widget"==this.props.chatwidget.get("mode")&&r.createElement(C,{popupChat:this.popupChat,endChat:this.endChat}),r.createElement("div",{className:e},r.createElement(pe,{hideMessageField:this.hideMessageField,profileBefore:this.profileHTML,messagesBefore:this.messagesHTML,cancelClose:this.cancelClose,endChat:this.endChat})))):!0===this.props.chatwidget.get("isOnline")&&!1===this.props.chatwidget.get("isOfflineMode")?(e+=" start-chat",r.createElement(r.Fragment,null,this.props.chatwidget.hasIn(["chat_ui","custom_html_header"])&&r.createElement("div",{className:"lhc-custom-header-above",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","custom_html_header"])}}),"widget"==this.props.chatwidget.get("mode")&&r.createElement(C,{popupChat:this.popupChat,endChat:this.endChat}),r.createElement("div",{className:e},r.createElement(k.Z,{botPayload:this.botPayload,setHideMessageField:this.setHideMessageField,setProfile:this.setProfile,setMessages:this.setMessages})))):(e+=" offline-chat",r.createElement(r.Fragment,null,this.props.chatwidget.hasIn(["chat_ui","custom_html_header"])&&r.createElement("div",{className:"lhc-custom-header-above",dangerouslySetInnerHTML:{__html:this.props.chatwidget.getIn(["chat_ui","custom_html_header"])}}),"widget"==this.props.chatwidget.get("mode")&&r.createElement(C,{popupChat:this.popupChat,endChat:this.endChat}),r.createElement("div",{className:e},r.createElement(r.Suspense,{fallback:""},r.createElement(_e,null)))))}}]),i}(r.Component))||ce),me=fe,ve=a(1766);var we=function(e){h()(i,e);var t,a,n=(t=i,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 i=f()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return _()(this,e)});function i(e){var t;return c()(this,i),t=n.call(this,e),y()(v()(t),"state",{}),y()(v()(t),"playSound",(function(e){"new_message"==e.type?(!0===e.sound_on&&(!1===e.widget_open||!0===e.widget_open&&0==window.lhcChat.is_focused)&&t.playSoundFile("new_message"),0==e.widget_open&&I.a.sendMessageParent("unread_message",[{msop:e.msop||null,msg_body:e.msg_body||null,type:"unread_message",otm:e.otm||0}])):"new_invitation"==e.type&&!0===e.sound_on?null===I.a.getSessionStorage("_invs")&&(I.a.setSessionStorage("_invs",1),t.playSoundFile("new_invitation")):"new_chat"==e.type&&!0===e.sound_on&&t.playSoundFile("new_invitation"),0==window.lhcChat.is_focused&&I.a.sendMessageParent("unread_message_title",[{status:!1}])})),y()(v()(t),"playSoundFile",(function(e){new ve.Howl({src:[window.lhcChat.base_url+"/widgetrestapi/loadsound/"+e+"_mp3",window.lhcChat.base_url+"/widgetrestapi/loadsound/"+e+"_ogg",window.lhcChat.base_url+"/widgetrestapi/loadsound/"+e+"_wav"],format:["mp3","ogg","wav"],autoplay:!0})})),I.a.eventEmitter.addListener("play_sound",(function(e){return t.playSound(e)})),t}return d()(i,[{key:"render",value:function(){return null}}]),i}(r.PureComponent),ye=(0,b.$j)()(we);var be=function(e){h()(i,e);var t,a,n=(t=i,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 i=f()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return _()(this,e)});function i(e){var t;return c()(this,i),(t=n.call(this,e)).state={hasError:!1},t}return d()(i,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t}),I.a.logJSError({stack:e.stack?JSON.stringify(e.stack):""})}},{key:"render",value:function(){return this.state.hasError?r.createElement("p",null,"Please re-load window because of an error."):this.props.children}}]),i}(r.Component);var Ee=function(e){h()(i,e);var t,a,n=(t=i,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 i=f()(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return _()(this,e)});function i(){return c()(this,i),n.apply(this,arguments)}return d()(i,[{key:"render",value:function(){return r.createElement(r.Fragment,null,r.createElement(be,null,r.createElement(ye,null),r.createElement(me,null)))}}]),i}(r.Component),Ie=Ee;function De(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Se(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function Te(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:je,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Pe:return!1===e.get("isChatting")&&(e=e.set("processStatus",0).set("isOfflineMode",!1)),e.set("shown",!1);case"loadedCore":return e.set("loadedCore",!0);case"attr_set":return e.setIn(t.attr,t.data);case"profile_pic":return e.set("profile_pic",-1!==t.data.indexOf("http:")||-1!==t.data.indexOf("https:")?t.data:window.lhcChat.base_url+"widgetrestapi/avatar/"+t.data);case"attr_rem":return e.removeIn(t.attr);case"operator":case"leave_message":case"phash":case"pvhash":case"attr_prefill":case"attr_prefill_admin":case Le:case"base_url":case"theme":case"jsVars":case"jsVarsPrefill":case"subject_id":case"bot_id":case"trigger_id":case"priority":case"lang":return e.set(t.type,t.data);case"widgetStatus":return 1==t.data&&!0===e.getIn(["proactive","pending"])&&(e=e.setIn(["proactive","pending"],!1)),1==t.data&&e.hasIn(["proactive","data","hide_on_open"])&&(e=e.set("proactive",(0,He.d0)({pending:!1,has:!1,data:{}}))),e.set("shown",t.data);case"PROACTIVE":return e.set("proactive",{pending:!1===e.get("shown")&&!1===t.data.qinv,has:!0,data:t.data});case"HIDE_INVITATION":return e.setIn(["proactive","pending"],!1);case"CANCEL_INVITATION":return e.set("proactive",(0,He.d0)({pending:!1,has:!1,data:{}}));case"FULL_INVITATION":return e.setIn(["proactive","pending"],!1);case Be:return e.setIn(["usersettings","soundOn"],t.data);case Ne:return e.set("shown",!1).set("processStatus",0).set("isChatting",!1).set("newChat",!0).set("proactive",(0,He.d0)({pending:!1,has:!1,data:{}})).set("chatData",(0,He.d0)({})).removeIn(["chat_ui","survey_id"]).removeIn(["chat_ui","cmmsg_widget"]).setIn(["onlineData","fetched"],!1).set("chatLiveData",(0,He.d0)({lmsop:0,vtm:0,otm:0,msop:0,uid:0,status:0,status_sub:0,uw:!1,ott:"",closed:!1,lfmsgid:0,lmsgid:0,operator:"",messages:[]})).set("chatStatusData",(0,He.d0)({})).set("chat_ui_state",(0,He.d0)({confirm_close:0,show_survey:0,pre_survey_done:0})).set("initClose",!1).set("initLoaded",!1);case"chat_status_changed":return e.setIn(["chatLiveData","ott"],t.data.text);case Re:return e.set("isOnline",t.data);case Fe:return e.set("offlineData",(0,He.d0)({fetched:!0,disabled:t.data.disabled,fields_visible:t.data.fields_visible,fields:t.data.fields,department:t.data.department})).set("chat_ui",e.get("chat_ui").merge((0,He.d0)(t.data.chat_ui)));case"department":case"mode":case"product":case"captcha":return e.set(t.type,(0,He.d0)(t.data));case"INIT_PRODUCTS":return e.setIn(["onlineData","department","products"],(0,He.d0)(t.data.products)).setIn(["onlineData","department","settings","product_required"],t.data.required);case"CHAT_SESSION_REFFERER":return e.set("ses_ref",t.data.ref);case"CHAT_ADD_OVERRIDE":return e.update("overrides",(function(e){return e.push(t.data)}));case"CHAT_REMOVE_OVERRIDE":return e.update("overrides",(function(e){return e.filter((function(e){return e!=t.data}))}));case Ue:return!0===t.data.success?(I.a.sendMessageParent("chatStarted",[t.data.chatData,e.get("mode")]),"popup"==e.get("mode")&&(!0===I.a.hasSessionStorage?(I.a.setSessionStorage("_chat",JSON.stringify(t.data.chatData)),I.a.removeSessionStorage("_reset_chat")):document.location="#/"+t.data.chatData.id+"/"+t.data.chatData.hash),e.set("processStatus",2).set("isChatting",!0).set("chatData",(0,He.d0)(t.data.chatData)).set("validationErrors",(0,He.d0)({}))):e.set("validationErrors",(0,He.d0)(t.data.errors)).set("processStatus",0).setIn(["chat_ui","auto_start"],!1);case"OFFLINE_SUBMITTED":return!0===t.data.success?(I.a.sendMessageParent("offlineMessage",[]),e.set("processStatus",2).set("validationErrors",(0,He.d0)({}))):e.set("validationErrors",(0,He.d0)(t.data.errors)).set("processStatus",0);case"INIT_CLOSE":return e.set("initClose",!0);case"CHAT_ALREADY_STARTED":return e.set("processStatus",2).set("isChatting",!0).set("newChat",!1).set("chatData",(0,He.d0)(t.data));case"OFFLINE_SUBMITTING":return e.set("processStatus",1);case"CHAT_SET_VID":return e.set("vid",t.data);case"ONLINE_SUBMITTING":return e.set("processStatus",1);case"UI_STATE":return e.setIn(["chat_ui_state",t.data.attr],t.data.val);case"INIT_CHAT_SUBMITTED":return t.data.chat_ui_state&&(e=e.set("chat_ui_state",e.get("chat_ui_state").merge((0,He.d0)(t.data.chat_ui_state)))),e.setIn(["chatLiveData","operator"],t.data.operator).set("chat_ui",e.get("chat_ui").merge((0,He.d0)(t.data.chat_ui))).setIn(["chatLiveData","status_sub"],t.data.status_sub).setIn(["chatLiveData","status"],t.data.status).set("initLoaded",!0).setIn(["chatLiveData","closed"],t.data.closed&&!0===t.data.closed);case"REFRESH_UI_COMPLETED":return t.data.chat_ui_remove&&t.data.chat_ui_remove.forEach((function(t){e=e.removeIn(t)})),e.set("chat_ui",e.get("chat_ui").merge((0,He.d0)(t.data.chat_ui)));case"FETCH_MESSAGE_SUBMITTED":var a=e.getIn(["chatLiveData","messages"]).findIndex((function(e){if(e.msg.includes('id="msg-'+t.data.id+'"'))return!0}));if(-1!==a){var n=document.createElement("div");n.innerHTML=e.getIn(["chatLiveData","messages",a,"msg"]);var i=n.querySelector("#msg-"+t.data.id);i&&(n.innerHTML=n.innerHTML.replace(i.outerHTML,t.data.msg),e=e.setIn(["chatLiveData","messages",a,"msg"],n.innerHTML))}return e;case"FETCH_MESSAGES_SUBMITTED":return t.data.closed_arg&&t.data.closed_arg.survey_id&&(e=e.setIn(["chat_ui","survey_id"],t.data.closed_arg.survey_id)),t.data.disable_survey&&(e=e.removeIn(["chat_ui","survey_id"])),t.data.extension&&(e=e.set("extension",e.get("extension").merge((0,He.d0)(t.data.extension)))),""!==t.data.messages&&(e=e.updateIn(["chatLiveData","messages"],(function(a){return a.push({lmsop:e.getIn(["chatLiveData","msop"]),msop:t.data.msop,msg:t.data.messages})})).setIn(["chatLiveData","uw"],t.data.uw&&!0===t.data.uw).setIn(["chatLiveData","lmsgid"],t.data.message_id).setIn(["chatLiveData","lfmsgid"],t.data.message_id_first).setIn(["chatLiveData","msop"],t.data.lmsop||t.data.msop)),t.data.vtm&&(e=e.updateIn(["chatLiveData","vtm"],(function(e){return e+t.data.vtm}))),t.data.otm&&(e=e.setIn(["chatLiveData","otm"],t.data.otm)),e.get("overrides").contains("typing")||(e=e.setIn(["chatLiveData","ott"],t.data.ott)),e.setIn(["chatLiveData","status_sub"],t.data.status_sub).setIn(["chatLiveData","status"],t.data.status).set("msgLoaded",!0).set("network_down",!1).setIn(["chatLiveData","closed"],t.data.closed&&!0===t.data.closed);case"CHECK_CHAT_STATUS_FINISHED":return t.data.extension&&(e=e.set("extension",e.get("extension").merge((0,He.d0)(t.data.extension)))),e.set("chatStatusData",(0,He.d0)(t.data)).setIn(["chatLiveData","closed"],t.data.closed&&!0===t.data.closed||e.getIn(["chatLiveData","closed"])).setIn(["chatLiveData","status"],t.data.status).setIn(["chatLiveData","uid"],t.data.uid).setIn(["chatLiveData","ru"],t.data.ru?t.data.ru:null).set("chat_ui",e.get("chat_ui").merge((0,He.d0)(t.data.chat_ui))).set("network_down",!1).setIn(["chatLiveData","status_sub"],t.data.status_sub);case"ONLINE_FIELDS_UPDATED":return e.set("onlineData",(0,He.d0)({dep_forms:t.data.dep_forms,disabled:t.data.disabled,fetched:!0,paid:t.data.paid,fields_visible:t.data.fields_visible,fields:t.data.fields,department:t.data.department})).set("chat_ui",e.get("chat_ui").merge((0,He.d0)(t.data.chat_ui)));case"CHAT_UI_UPDATE":return e.set("chat_ui",e.get("chat_ui").merge((0,He.d0)(t.data)));case"CUSTOM_FIELDS":return e.set("customData",(0,He.d0)({fields:t.data}));case"dep_default":return e.set("departmentDefault",t.data);case"survey":return e.setIn(["chat_ui","survey_id"],t.data);case"CUSTOM_FIELDS_ITEM":return e.setIn(["customData","fields",t.data.id,"value"],t.data.value);case"ADD_MESSAGES_SUBMITTED":return e.setIn(["chatLiveData","error"],t.data.r).setIn(["chatLiveData","lmsg"],t.data.r?t.data.msg:"");case"NO_CONNECTION":return e.set("network_down",t.data);default:return e}}}),qe=a(3894),Ke=a(5068),Ve=a(696),ze=a(5397),Ge=a(5538);Ve.Z.use(Ge.Z).use(ze.Db);var $e=Ve.Z,Ze=function(){for(var e=arguments.length,t=new Array(e),a=0;a-1};function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function d(e){return"string"!=typeof e&&(e=String(e)),e}function u(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function _(e){return new Promise((function(t,a){e.onload=function(){t(e.result)},e.onerror=function(){a(e.error)}}))}function g(e){var t=new FileReader,a=_(t);return t.readAsArrayBuffer(e),a}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:a&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,a,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,a=_(t=new FileReader),t.readAsText(e),a;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),a=new Array(t.length),n=0;n-1?n:a),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function y(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var a=e.split("="),n=a.shift().replace(/\+/g," "),i=a.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function b(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},m.call(w.prototype),m.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];b.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var a=Error(e);this.stack=a.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function I(e,a){return new Promise((function(n,r){var s=new w(e,a);if(s.signal&&s.signal.aborted)return r(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function c(){o.abort()}o.onload=function(){var e,t,a={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var a=e.split(":"),n=a.shift().trim();if(n){var i=a.join(":").trim();t.append(n,i)}})),t)};a.url="responseURL"in o?o.responseURL:a.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;n(new b(i,a))},o.onerror=function(){r(new TypeError("Network request failed"))},o.ontimeout=function(){r(new TypeError("Network request failed"))},o.onabort=function(){r(new t.DOMException("Aborted","AbortError"))},o.open(s.method,s.url,!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&i&&(o.responseType="blob"),s.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",c),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",c)}),o.send(void 0===s._bodyInit?null:s._bodyInit)}))}I.polyfill=!0,e.fetch||(e.fetch=I,e.Headers=h,e.Request=w,e.Response=b),t.Headers=h,t.Request=w,t.Response=b,t.fetch=I,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},8679:function(e,t,a){"use strict";var n=a(9864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};function c(e){return n.isMemo(e)?s:o[e.$$typeof]||i}o[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[n.Memo]=s;var l=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,_=Object.prototype;e.exports=function e(t,a,n){if("string"!=typeof a){if(_){var i=p(a);i&&i!==_&&e(t,i,n)}var s=d(a);u&&(s=s.concat(u(a)));for(var o=c(t),g=c(a),f=0;f=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,r.ctx.currentTime);for(var a=0;a=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,p()),e},codecs:function(e){return(this||r)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||r;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(t){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||r,t=null;try{t="undefined"!=typeof Audio?new Audio:null}catch(t){return e}if(!t||"function"!=typeof t.canPlayType)return e;var a=t.canPlayType("audio/mpeg;").replace(/^no$/,""),n=e._navigator?e._navigator.userAgent:"",i=n.match(/OPR\/([0-6].)/g),s=i&&parseInt(i[0].split("/")[1],10)<33,o=-1!==n.indexOf("Safari")&&-1===n.indexOf("Chrome"),c=n.match(/Version\/(.*?) /),l=o&&c&&parseInt(c[1],10)<15;return e._codecs={mp3:!(s||!a&&!t.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!a,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(l||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(l||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||r;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(a){for(;e._html5AudioPool.length0?o._seek:a._sprite[e][0]/1e3),d=Math.max(0,(a._sprite[e][0]+a._sprite[e][1])/1e3-l),u=1e3*d/Math.abs(o._rate),h=a._sprite[e][0]/1e3,p=(a._sprite[e][0]+a._sprite[e][1])/1e3;o._sprite=e,o._ended=!1;var _=function(){o._paused=!1,o._seek=l,o._start=h,o._stop=p,o._loop=!(!o._loop&&!a._sprite[e][2])};if(!(l>=p)){var g=o._node;if(a._webAudio){var f=function(){a._playLock=!1,_(),a._refreshBuffer(o);var e=o._muted||a._muted?0:o._volume;g.gain.setValueAtTime(e,r.ctx.currentTime),o._playStart=r.ctx.currentTime,void 0===g.bufferSource.start?o._loop?g.bufferSource.noteGrainOn(0,l,86400):g.bufferSource.noteGrainOn(0,l,d):o._loop?g.bufferSource.start(0,l,86400):g.bufferSource.start(0,l,d),u!==1/0&&(a._endTimers[o._id]=setTimeout(a._ended.bind(a,o),u)),t||setTimeout((function(){a._emit("play",o._id),a._loadQueue()}),0)};"running"===r.state&&"interrupted"!==r.ctx.state?f():(a._playLock=!0,a.once("resume",f),a._clearTimer(o._id))}else{var m=function(){g.currentTime=l,g.muted=o._muted||a._muted||r._muted||g.muted,g.volume=o._volume*r.volume(),g.playbackRate=o._rate;try{var n=g.play();if(n&&"undefined"!=typeof Promise&&(n instanceof Promise||"function"==typeof n.then)?(a._playLock=!0,_(),n.then((function(){a._playLock=!1,g._unlocked=!0,t?a._loadQueue():a._emit("play",o._id)})).catch((function(){a._playLock=!1,a._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),o._ended=!0,o._paused=!0}))):t||(a._playLock=!1,_(),a._emit("play",o._id)),g.playbackRate=o._rate,g.paused)return void a._emit("playerror",o._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||o._loop?a._endTimers[o._id]=setTimeout(a._ended.bind(a,o),u):(a._endTimers[o._id]=function(){a._ended(o),g.removeEventListener("ended",a._endTimers[o._id],!1)},g.addEventListener("ended",a._endTimers[o._id],!1))}catch(e){a._emit("playerror",o._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===g.src&&(g.src=a._src,g.load());var v=window&&window.ejecta||!g.readyState&&r._navigator.isCocoonJS;if(g.readyState>=3||v)m();else{a._playLock=!0,a._state="loading";var w=function(){a._state="loaded",m(),g.removeEventListener(r._canPlayEvent,w,!1)};g.addEventListener(r._canPlayEvent,w,!1),a._clearTimer(o._id)}}return o._id}a._ended(o)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var a=t._getSoundIds(e),n=0;n=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else i.length>=2&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if(!(void 0!==e&&e>=0&&e<=1))return(a=t?n._soundById(t):n._sounds[0])?a._volume:0;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"volume",action:function(){n.volume.apply(n,i)}}),n;void 0===t&&(n._volume=e),t=n._getSoundIds(t);for(var c=0;c0?n/l:n),u=Date.now();e._fadeTo=a,e._interval=setInterval((function(){var i=(Date.now()-u)/n;u=Date.now(),o+=c*i,o=Math.round(100*o)/100,o=c<0?Math.max(a,o):Math.min(a,o),s._webAudio?e._volume=o:s.volume(o,e._id,!0),r&&(s._volume=o),(at&&o>=a)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,s.volume(a,e._id),s._emit("fade",e._id))}),d)},_stopFade:function(e){var t=this,a=t._soundById(e);return a&&a._interval&&(t._webAudio&&a._node.gain.cancelScheduledValues(r.ctx.currentTime),clearInterval(a._interval),a._interval=null,t.volume(a._fadeTo,e),a._fadeTo=null,t._emit("fade",e)),t},loop:function(){var e,t,a,n=this,i=arguments;if(0===i.length)return n._loop;if(1===i.length){if("boolean"!=typeof i[0])return!!(a=n._soundById(parseInt(i[0],10)))&&a._loop;e=i[0],n._loop=e}else 2===i.length&&(e=i[0],t=parseInt(i[1],10));for(var r=n._getSoundIds(t),s=0;s=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else 2===i.length&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if("number"!=typeof e)return(a=n._soundById(t))?a._rate:n._rate;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"rate",action:function(){n.rate.apply(n,i)}}),n;void 0===t&&(n._rate=e),t=n._getSoundIds(t);for(var c=0;c=0?t=parseInt(n[0],10):a._sounds.length&&(t=a._sounds[0]._id,e=parseFloat(n[0]))}else 2===n.length&&(e=parseFloat(n[0]),t=parseInt(n[1],10));if(void 0===t)return 0;if("number"==typeof e&&("loaded"!==a._state||a._playLock))return a._queue.push({event:"seek",action:function(){a.seek.apply(a,n)}}),a;var o=a._soundById(t);if(o){if(!("number"==typeof e&&e>=0)){if(a._webAudio){var c=a.playing(t)?r.ctx.currentTime-o._playStart:0,l=o._rateSeek?o._rateSeek-o._seek:0;return o._seek+(l+c*Math.abs(o._rate))}return o._node.currentTime}var d=a.playing(t);d&&a.pause(t,!0),o._seek=e,o._ended=!1,a._clearTimer(t),a._webAudio||!o._node||isNaN(o._node.duration)||(o._node.currentTime=e);var u=function(){d&&a.play(t,!0),a._emit("seek",t)};if(d&&!a._webAudio){var h=function(){a._playLock?setTimeout(h,0):u()};setTimeout(h,0)}else u()}return a},playing:function(e){var t=this;if("number"==typeof e){var a=t._soundById(e);return!!a&&!a._paused}for(var n=0;n=0&&r._howls.splice(n,1);var i=!0;for(a=0;a=0){i=!1;break}return c&&i&&delete c[e._src],r.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,a,n){var i=this["_on"+e];return"function"==typeof t&&i.push(n?{id:a,fn:t,once:n}:{id:a,fn:t}),this},off:function(e,t,a){var n=this,i=n["_on"+e],r=0;if("number"==typeof t&&(a=t,t=null),t||a)for(r=0;r=0;r--)i[r].id&&i[r].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,a)}.bind(n,i[r].fn),0),i[r].once&&n.off(e,i[r].fn,i[r].id));return n._loadQueue(e),n},_loadQueue:function(e){var t=this;if(t._queue.length>0){var a=t._queue[0];a.event===e&&(t._queue.shift(),t._loadQueue()),e||a.action()}return t},_ended:function(e){var t=this,a=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;n--){if(a<=t)return;e._sounds[n]._ended&&(e._webAudio&&e._sounds[n]._node&&e._sounds[n]._node.disconnect(0),e._sounds.splice(n,1),a--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],a=0;a=0;if(r._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=r._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(r._navigator&&r._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var o=function(e){this._parent=e,this.init()};o.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++r._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,a=r._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=void 0===r.ctx.createGain?r.ctx.createGainNode():r.ctx.createGain(),e._node.gain.setValueAtTime(a,r.ctx.currentTime),e._node.paused=!0,e._node.connect(r.masterGain)):r.noAudio||(e._node=r._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(r._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=t._src,e._node.preload=!0===t._preload?"auto":t._preload,e._node.volume=a*r.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++r._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),e._node.removeEventListener(r._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(10*e._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var c={},l=function(e){var t=e._src;if(c[t])return e._duration=c[t].duration,void h(e);if(/^data:[^;]+;base64,/.test(t)){for(var a=atob(t.split(",")[1]),n=new Uint8Array(a.length),i=0;i0?(c[t._src]=e,h(t,e)):a()};"undefined"!=typeof Promise&&1===r.ctx.decodeAudioData.length?r.ctx.decodeAudioData(e).then(n).catch(a):r.ctx.decodeAudioData(e,n,a)},h=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},p=function(){if(r.usingWebAudio){try{"undefined"!=typeof AudioContext?r.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?r.ctx=new webkitAudioContext:r.usingWebAudio=!1}catch(e){r.usingWebAudio=!1}r.ctx||(r.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(r._navigator&&r._navigator.platform),t=r._navigator&&r._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),a=t?parseInt(t[1],10):null;if(e&&a&&a<9){var n=/safari/.test(r._navigator&&r._navigator.userAgent.toLowerCase());r._navigator&&!n&&(r.usingWebAudio=!1)}r.usingWebAudio&&(r.masterGain=void 0===r.ctx.createGain?r.ctx.createGainNode():r.ctx.createGain(),r.masterGain.gain.setValueAtTime(r._muted?0:r._volume,r.ctx.currentTime),r.masterGain.connect(r.ctx.destination)),r._setup()}};void 0===(n=function(){return{Howler:r,Howl:s}}.apply(t,[]))||(e.exports=n),t.Howler=r,t.Howl=s,void 0!==a.g?(a.g.HowlerGlobal=i,a.g.Howler=r,a.g.Howl=s,a.g.Sound=o):"undefined"!=typeof window&&(window.HowlerGlobal=i,window.Howler=r,window.Howl=s,window.Sound=o)}(),function(){"use strict";var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var a=t._howls.length-1;a>=0;a--)t._howls[a].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,a){var n=this;return n.ctx&&n.ctx.listener?(t="number"!=typeof t?n._pos[1]:t,a="number"!=typeof a?n._pos[2]:a,"number"!=typeof e?n._pos:(n._pos=[e,t,a],void 0!==n.ctx.listener.positionX?(n.ctx.listener.positionX.setTargetAtTime(n._pos[0],Howler.ctx.currentTime,.1),n.ctx.listener.positionY.setTargetAtTime(n._pos[1],Howler.ctx.currentTime,.1),n.ctx.listener.positionZ.setTargetAtTime(n._pos[2],Howler.ctx.currentTime,.1)):n.ctx.listener.setPosition(n._pos[0],n._pos[1],n._pos[2]),n)):n},HowlerGlobal.prototype.orientation=function(e,t,a,n,i,r){var s=this;if(!s.ctx||!s.ctx.listener)return s;var o=s._orientation;return t="number"!=typeof t?o[1]:t,a="number"!=typeof a?o[2]:a,n="number"!=typeof n?o[3]:n,i="number"!=typeof i?o[4]:i,r="number"!=typeof r?o[5]:r,"number"!=typeof e?o:(s._orientation=[e,t,a,n,i,r],void 0!==s.ctx.listener.forwardX?(s.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),s.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),s.ctx.listener.forwardZ.setTargetAtTime(a,Howler.ctx.currentTime,.1),s.ctx.listener.upX.setTargetAtTime(n,Howler.ctx.currentTime,.1),s.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),s.ctx.listener.upZ.setTargetAtTime(r,Howler.ctx.currentTime,.1)):s.ctx.listener.setOrientation(e,t,a,n,i,r),s)},Howl.prototype.init=(e=Howl.prototype.init,function(t){var a=this;return a._orientation=t.orientation||[1,0,0],a._stereo=t.stereo||null,a._pos=t.pos||null,a._pannerAttr={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:360,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:360,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:0,distanceModel:void 0!==t.distanceModel?t.distanceModel:"inverse",maxDistance:void 0!==t.maxDistance?t.maxDistance:1e4,panningModel:void 0!==t.panningModel?t.panningModel:"HRTF",refDistance:void 0!==t.refDistance?t.refDistance:1,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:1},a._onstereo=t.onstereo?[{fn:t.onstereo}]:[],a._onpos=t.onpos?[{fn:t.onpos}]:[],a._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}),Howl.prototype.stereo=function(e,a){var n=this;if(!n._webAudio)return n;if("loaded"!==n._state)return n._queue.push({event:"stereo",action:function(){n.stereo(e,a)}}),n;var i=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===a){if("number"!=typeof e)return n._stereo;n._stereo=e,n._pos=[e,0,0]}for(var r=n._getSoundIds(a),s=0;s/i,h=//i,p=/<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi,_=s.isIE(9),g=_||s.isIE();if("function"==typeof window.DOMParser){var f=new window.DOMParser,m=_?"text/xml":"text/html";n=function(e,t){return t&&(e="<"+t+">"+e+""),_&&(e=e.replace(p,"<$1$2$3/>")),f.parseFromString(e,m)}}if("object"==typeof document.implementation){var v=document.implementation.createHTMLDocument(g?"HTML_DOM_PARSER_TITLE":void 0);i=function(e,t){if(t)return v.documentElement.getElementsByTagName(t)[0].innerHTML=e,v;try{return v.documentElement.innerHTML=e,v}catch(t){if(n)return n(e)}}}var w=document.createElement("template");w.content&&(r=function(e){return w.innerHTML=e,w.content.childNodes});var y=i||n;e.exports=function(e){var t,a,i,s,p=e.match(d);switch(p&&p[1]&&(t=p[1].toLowerCase()),t){case o:if(n)return a=n(e),u.test(e)||(i=a.getElementsByTagName(c)[0])&&i.parentNode.removeChild(i),h.test(e)||(i=a.getElementsByTagName(l)[0])&&i.parentNode.removeChild(i),a.getElementsByTagName(o);break;case c:case l:if(y)return s=y(e).getElementsByTagName(t),h.test(e)&&u.test(e)?s[0].parentNode.childNodes:s;break;default:if(r)return r(e);if(y)return y(e,l).getElementsByTagName(l)[0].childNodes}return[]}},5057:function(e,t,a){var n=a(6982),i=a(3412),r=i.formatDOM,s=i.isIE(9),o=/<(![a-zA-Z\s]+)>/;e.exports=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t,a=e.match(o);return a&&a[1]&&(t=a[1],s&&(e=e.replace(a[0],""))),r(n(e),null,t)}},3412:function(e,t,a){for(var n,i=a(9804).CASE_SENSITIVE_TAG_NAMES,r={},s=0,o=i.length;s=0;--r){var s=this.tryEntries[r],o=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var c=n.call(s,"catchLoc"),l=n.call(s,"finallyLoc");if(c&&l){if(this.prev=0;--a){var i=this.tryEntries[a];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),T(a),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var n=a.completion;if("throw"===n.type){var i=n.arg;T(a)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,n){return this.delegate={iterator:k(e),resultName:a,nextLoc:n},"next"===this.method&&(this.arg=t),_}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},53:function(e,t){"use strict";var a,n,i,r,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var o=null,c=null,l=function(){if(null!==o)try{var e=t.unstable_now();o(!0,e),o=null}catch(e){throw setTimeout(l,0),e}},d=Date.now();t.unstable_now=function(){return Date.now()-d},a=function(e){null!==o?setTimeout(a,0,e):(o=e,setTimeout(l,0))},n=function(e,t){c=setTimeout(e,t)},i=function(){clearTimeout(c)},r=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var u=window.performance,h=window.Date,p=window.setTimeout,_=window.clearTimeout;if("undefined"!=typeof console){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof u&&"function"==typeof u.now)t.unstable_now=function(){return u.now()};else{var f=h.now();t.unstable_now=function(){return h.now()-f}}var m=!1,v=null,w=-1,y=5,b=0;r=function(){return t.unstable_now()>=b},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,i=e[n];if(!(void 0!==i&&0C(s,a))void 0!==c&&0>C(c,s)?(e[n]=c,e[o]=a,n=o):(e[n]=s,e[r]=a,n=r);else{if(!(void 0!==c&&0>C(c,a)))break e;e[n]=c,e[o]=a,n=o}}}return t}return null}function C(e,t){var a=e.sortIndex-t.sortIndex;return 0!==a?a:e.id-t.id}var k=[],O=[],A=1,x=null,M=3,P=!1,L=!1,R=!1;function B(e){for(var t=S(O);null!==t;){if(null===t.callback)T(O);else{if(!(t.startTime<=e))break;T(O),t.sortIndex=t.expirationTime,D(k,t)}t=S(O)}}function N(e){if(R=!1,B(e),!L)if(null!==S(k))L=!0,a(F);else{var t=S(O);null!==t&&n(N,t.startTime-e)}}function F(e,a){L=!1,R&&(R=!1,i()),P=!0;var s=M;try{for(B(a),x=S(k);null!==x&&(!(x.expirationTime>a)||e&&!r());){var o=x.callback;if(null!==o){x.callback=null,M=x.priorityLevel;var c=o(x.expirationTime<=a);a=t.unstable_now(),"function"==typeof c?x.callback=c:x===S(k)&&T(k),B(a)}else T(k);x=S(k)}if(null!==x)var l=!0;else{var d=S(O);null!==d&&n(N,d.startTime-a),l=!1}return l}finally{x=null,M=s,P=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var H=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){L||P||(L=!0,a(F))},t.unstable_getCurrentPriorityLevel=function(){return M},t.unstable_getFirstCallbackNode=function(){return S(k)},t.unstable_next=function(e){switch(M){case 1:case 2:case 3:var t=3;break;default:t=M}var a=M;M=t;try{return e()}finally{M=a}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=H,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=M;M=e;try{return t()}finally{M=a}},t.unstable_scheduleCallback=function(e,r,s){var o=t.unstable_now();if("object"==typeof s&&null!==s){var c=s.delay;c="number"==typeof c&&0o?(e.sortIndex=c,D(O,e),null===S(k)&&e===S(O)&&(R?i():R=!0,n(N,c-o))):(e.sortIndex=s,D(k,e),L||P||(L=!0,a(F))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();B(e);var a=S(k);return a!==x&&null!==x&&null!==a&&null!==a.callback&&a.startTime<=e&&a.expirationTime=this.touchStartX?(this.onSwipeRightAgent&&this.onSwipeRightAgent(),"swiped right"):this.touchEndY+this.options.threshold<=this.touchStartY?(this.onSwipeUpAgent&&this.onSwipeUpAgent(),"swiped up"):this.touchEndY-this.options.threshold>=this.touchStartY?(this.onSwipeDownAgent&&this.onSwipeDownAgent(),"swiped down"):this.touchEndY===this.touchStartY?(this.onTapAgent&&this.onTapAgent(),"tap"):void 0}}}},__webpack_module_cache__={},deferred,leafPrototypes,getProto,inProgress,dataWebpackPrefix;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var a=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(a.exports,a,a.exports,__webpack_require__),a.exports}__webpack_require__.m=__webpack_modules__,deferred=[],__webpack_require__.O=function(e,t,a,n){if(!t){var i=1/0;for(c=0;c=n)&&Object.keys(__webpack_require__.O).every((function(e){return __webpack_require__.O[e](t[s])}))?t.splice(s--,1):(r=!1,n0&&deferred[c-1][2]>n;c--)deferred[c]=deferred[c-1];deferred[c]=[t,a,n]},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var a=Object.create(null);__webpack_require__.r(a);var n={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&t&&e;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((function(t){n[t]=function(){return e[t]}}));return n.default=function(){return e},__webpack_require__.d(a,n),a},__webpack_require__.d=function(e,t){for(var a in t)__webpack_require__.o(t,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},__webpack_require__.f={},__webpack_require__.e=function(e){return Promise.all(Object.keys(__webpack_require__.f).reduce((function(t,a){return __webpack_require__.f[a](e,t),t}),[]))},__webpack_require__.u=function(e){return e+"."+{218:"5fd9b6569a5e09b99c04",261:"f9508b095570e4c54db7",476:"430b407336b2c532e572",502:"7d9075974af1f1c56a6a",536:"daa69d70da79b79bc1ec",800:"8c3bfdb4ac7cf39ec020",815:"8e6ab21729cb74142161",906:"7600912896be0876d73b"}[e]+".js"},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},inProgress={},dataWebpackPrefix="LHCReactAPP:",__webpack_require__.l=function(e,t,a,n){if(inProgress[e])inProgress[e].push(t);else{var i,r;if(void 0!==a)for(var s=document.getElementsByTagName("script"),o=0;o {\n if (persistent){\n dispatch({type: \"CANCEL_INVITATION\"});\n } else {\n dispatch({type: \"HIDE_INVITATION\"});\n }\n })\n .catch((err) => {\n console.log(err);\n })\n }\n}\n\nexport function minimizeWidget(forceClose) {\n return function(dispatch, getState) {\n const state = getState();\n if (state.chatwidget.getIn(['proactive','has']) === true) {\n hideInvitation()(dispatch, getState);\n } else {\n helperFunctions.sendMessageParent('closeWidget', [{'sender' : 'closeButton'}]);\n }\n if (forceClose && (window.lhcChat['mode'] == 'popup' || window.lhcChat['mode'] == 'embed')) {\n helperFunctions.removeSessionStorage('_chat');\n helperFunctions.removeSessionStorage('_reset_chat');\n window.close();\n }\n }\n}\n\nexport function cancelPresurvey(confirm) {\n return function(dispatch, getState) {\n const state = getState();\n\n let args = '';\n\n if (state.chatwidget.get('theme')) {\n args = args + '/(theme)/' + state.chatwidget.get('theme');\n }\n\n if (confirm === true) {\n args = args + '/(confirm)/true';\n }\n\n axios.post(window.lhcChat['base_url'] + state.chatwidget.getIn(['chat_ui','pre_survey_url']) + state.chatwidget.getIn(['chatData','id']) + '/' + state.chatwidget.getIn(['chatData','hash']) + args, null, defaultHeaders).then((response) => {\n if (confirm === false || response.data.confirmed) {\n dispatch({'type' : 'UI_STATE', 'data' : {'attr': 'pre_survey_done', 'val': 2}});\n if (!state.chatwidget.hasIn(['chat_ui','survey_id'])) {\n helperFunctions.sendMessageParent('endChat',[{'sender' : 'endButton'}]);\n }\n }\n })\n .catch((err) => {\n console.log(err);\n })\n }\n}\n\nexport function endChat(obj, action) {\n action = action || \"t\";\n return function(dispatch, getState) {\n clearTimeout(syncStatus.auto_close_timeout);\n axios.post(window.lhcChat['base_url'] + \"chat/chatwidgetclosed/(eclose)/\"+action+\"/(hash)/\" + obj['chat']['id'] +'_'+ obj['chat']['hash'] + '/(vid)/' + obj['vid'] + '/(close)/' + (!obj.noClose ? '1' : '0'), null, defaultHeaders)\n .then((response) => {\n if (!obj.noClose) {\n if (window.lhcChat['mode'] == 'popup') {\n helperFunctions.removeSessionStorage('_chat');\n helperFunctions.removeSessionStorage('_reset_chat');\n // We try to close window at first place\n window.close();\n\n // If it's direct chat window we have to show start chat form\n helperFunctions.eventEmitter.emitEvent('endedChat', [{'chat_id':obj['chat']['id'], 'hash': obj['chat']['hash']}]);\n } else {\n helperFunctions.sendMessageParent('endChat', [{show_start: obj['show_start'], 'sender' : 'endButton'}]);\n }\n } else {\n dispatch({type: \"INIT_CLOSE\", data: obj})\n }\n })\n .catch((err) => {\n console.log(err);\n })\n }\n}\n\nexport function setSiteAccess(payload) {\n return axios.post(window.lhcChat['base_url'] + \"widgetrestapi/setsiteaccess/\", payload, defaultHeaders);\n}\n\nexport function getProducts(obj) {\n return function(dispatch) {\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/getproducts/\" + obj['dep_id'], null, defaultHeaders)\n .then((response) => {\n dispatch({type: \"INIT_PRODUCTS\", data: response.data})\n })\n .catch((err) => {\n console.log(err);\n })\n }\n}\n\nexport function voteAction(obj) {\n return axios.post(window.lhcChat['base_url'] + \"chat/voteaction/\" + obj.id + '/' + obj.hash + '/' + obj.type, null, defaultHeaders)\n}\n\nexport function transferToHumanAction(obj) {\n return axios.post(window.lhcChat['base_url'] + \"chat/transfertohuman/\" + obj.id + '/' + obj.hash, null, defaultHeaders)\n}\n\nexport function initProactive(data) {\n return function(dispatch, getState) {\n const state = getState();\n\n let payload = {\n 'invitation' : data.invitation,\n 'vid_id' : data.vid_id,\n 'uts' : (new Date()).getTime()\n };\n\n if (state.chatwidget.get('theme')) {\n payload['theme'] = state.chatwidget.get('theme');\n }\n\n if (state.chatwidget.get('vid')) {\n payload['vid'] = state.chatwidget.get('vid');\n }\n\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/getinvitation\", payload, defaultHeaders).then((response) => {\n if (response.data.chat_id && response.data.chat_hash) {\n dispatch({type: \"ONLINE_SUBMITTED\", data: {\n success : true,\n chatData : {\n id : response.data.chat_id,\n hash : response.data.chat_hash\n }\n }});\n showMessageSnippet({'id' : response.data.chat_id, 'hash' : response.data.chat_hash})(dispatch, getState);\n } else {\n dispatch({type: \"PROACTIVE\", data: response.data})\n }\n });\n }\n}\n\nexport function showMessageSnippet(obj) {\n return function(dispatch, getState) {\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/getmessagesnippet\", obj, defaultHeaders)\n .then((response) => {\n helperFunctions.sendMessageParent('msgSnippet',[response.data]);\n const state = getState();\n helperFunctions.emitEvent('play_sound', [{'type' : 'new_chat','sound_on' : (state.chatwidget.getIn(['usersettings','soundOn']) === true), 'widget_open' : false}]);\n })\n .catch((err) => {\n })\n }\n}\n\nexport function storeSubscriber(payload) {\n return function(dispatch, getState) {\n const state = getState();\n\n let args = '/(action)/sub';\n\n if (state.chatwidget.hasIn(['chatData','id']) && state.chatwidget.hasIn(['chatData','hash'])) {\n args = args + '/(hash)/' + state.chatwidget.getIn(['chatData','id']) + '_' + state.chatwidget.getIn(['chatData','hash']);\n }\n\n if (state.chatwidget.get('theme')) {\n args = args + '/(theme)/' + state.chatwidget.get('theme');\n }\n\n if (state.chatwidget.get('vid')) {\n args = args + '/(vid)/' + state.chatwidget.get('vid');\n }\n\n axios.post(window.lhcChat['base_url'] + \"notifications/subscribe\" +args, {'data' : payload}, defaultHeaders)\n .then((response) => {\n if (state.chatwidget.hasIn(['chatData','id']) && state.chatwidget.hasIn(['chatData','hash'])) {\n dispatch(fetchMessages({\n 'chat_id': state.chatwidget.getIn(['chatData','id']),\n 'hash' : state.chatwidget.getIn(['chatData','hash']),\n 'lmgsid' : state.chatwidget.getIn(['chatLiveData','lmsgid']),\n 'theme' : state.chatwidget.get('theme')\n }));\n }\n })\n }\n}\n\nexport function updateTriggerClicked(typeParams, params) {\n return function(dispatch, getState) {\n const state = getState();\n return axios.post(window.lhcChat['base_url'] + \"genericbot/\"+(typeParams.mainType ? typeParams.mainType : \"buttonclicked\")+\"/\" + state.chatwidget.getIn(['chatData','id']) + '/' + state.chatwidget.getIn(['chatData','hash']) + typeParams.type, params, defaultHeaders)\n }\n}\n\nexport function subscribeNotifications(params) {\n return function(dispatch, getState) {\n const state = getState();\n helperFunctions.sendMessageParent('subscribeEvent', [{'pk' : state.chatwidget.getIn(['chat_ui','notifications_pk'])}]);\n }\n}\n\nexport function initOfflineForm(obj) {\n return function(dispatch) {\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/onlinesettings\", obj, defaultHeaders)\n .then((response) => {\n dispatch({type: \"OFFLINE_FIELDS_UPDATED\", data: response.data})\n })\n .catch((err) => {\n dispatch({type: \"OFFLINE_FIELDS_REJECTED\", data: err})\n })\n }\n}\n\nexport function initOnlineForm(obj) {\n return function(dispatch) {\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/onlinesettings\", obj, defaultHeaders)\n .then((response) => {\n if (response.data.paid.continue && response.data.paid.continue === true) {\n dispatch({type: \"ONLINE_SUBMITTED\", data: {\n success : true,\n chatData : {\n id : response.data.paid.id,\n hash : response.data.paid.hash\n }\n }});\n } else {\n dispatch({type: \"ONLINE_FIELDS_UPDATED\", data: response.data})\n }\n })\n .catch((err) => {\n dispatch({type: \"ONLINE_FIELDS_REJECTED\", data: err})\n })\n }\n}\n\nexport function getCaptcha(dispatch, form, obj) {\n var date = new Date();\n var timestamp = Math.round(date.getTime()/1000);\n axios.post(window.lhcChat['base_url'] + \"captcha/captchastring/fake/\" + timestamp, null, defaultHeaders)\n .then((response) => {\n dispatch({type: \"captcha\", data: {'hash' : response.data.result, 'ts' : timestamp}});\n\n // Update submit object instantly\n obj.fields['captcha_' + response.data.result] = timestamp;\n obj.fields['tscaptcha'] = timestamp;\n\n // We auto resubmit only one time\n if (!obj.fields['tscaptcha_resubmit']) {\n obj.fields['tscaptcha_resubmit'] = 1;\n form(obj)(dispatch);\n } else {\n delete obj.fields['tscaptcha_resubmit'];\n }\n\n });\n}\n\nexport function submitOnlineForm(obj) {\n return function(dispatch) {\n dispatch({type: \"ONLINE_SUBMITTING\"});\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/submitonline\", obj, defaultHeaders)\n .then((response) => {\n\n // If validation contains invalid captcha update it instantly\n if (response.data.success === false && response.data.errors.captcha) {\n getCaptcha(dispatch, submitOnlineForm, obj);\n if (!obj.fields['tscaptcha_resubmit']) {\n return;\n }\n }\n\n dispatch({type: \"ONLINE_SUBMITTED\", data: response.data});\n\n if (response.data.t) {\n helperFunctions.sendMessageParent('botTrigger',[{'trigger' : response.data.t}]);\n }\n\n })\n .catch((err) => {\n dispatch({type: \"ONLINE_SUBMITT_REJECTED\", data: err})\n })\n }\n}\n\nexport function submitOfflineForm(obj) {\n return function(dispatch) {\n dispatch({type: \"OFFLINE_SUBMITTING\"});\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/submitoffline\", obj, {headers: { 'Content-Type': 'multipart/form-data'}})\n .then((response) => {\n\n // If validation contains invalid captcha update it instantly\n if (response.data.success === false && response.data.errors.captcha) {\n getCaptcha(dispatch, submitOfflineForm, obj);\n if (!obj.fields['tscaptcha_resubmit']) {\n return;\n }\n }\n\n dispatch({type: \"OFFLINE_SUBMITTED\", data: response.data})\n })\n .catch((err) => {\n dispatch({type: \"OFFLINE_SUBMITT_REJECTED\", data: err})\n })\n }\n}\n\nexport function updateUISettings(obj) {\n return function(dispatch, getState) {\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/uisettings\", obj, defaultHeaders)\n .then((response) => {\n dispatch({type: \"REFRESH_UI_COMPLETED\", data: response.data})\n })\n .catch((err) => {\n console.log(err);\n dispatch({type: \"REFRESH_UI_REJECTED\", data: err})\n })\n }\n}\n\nexport function initChatUI(obj) {\n\n // We should always sync chat status\n // As this value can be true if visitor starts another chat just\n syncStatus.status = false;\n\n return function(dispatch, getState) {\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/initchat\", obj, defaultHeaders)\n .then((response) => {\n dispatch({type: \"INIT_CHAT_SUBMITTED\", data: response.data})\n\n if (response.data.init_calls) {\n response.data.init_calls.forEach((callExtension) => {\n if (callExtension.extension === 'nodeJSChat') {\n import('../extensions/nodejs/nodeJSChat').then((module) => {\n module.nodeJSChat.bootstrap(callExtension.params, dispatch, getState);\n });\n\n } else if (callExtension.extension === 'dummy_extensions') {\n // Import your extension here\n }\n });\n }\n })\n .catch((err) => {\n console.log(err);\n dispatch({type: \"INIT_CHAT_REJECTED\", data: err})\n })\n }\n}\n\nfunction processResponseCheckStatus(response, getState, dispatch) {\n if (response.op) {\n\n response.op.forEach((op) => {\n var action = op.split(':')[0];\n if (action == 'lhc_chat_redirect') {\n helperFunctions.sendMessageParent('location',[op.split(':')[1].replace(new RegExp('__SPLIT__','g'),':')]);\n } else if (action == 'lhc_screenshot') {\n\n const state = getState();\n\n var append = '';\n\n if ( state.chatwidget.hasIn(['chatData','id'])) {\n append = append + '/(hash)/' + state.chatwidget.getIn(['chatData','id']) + '_' + state.chatwidget.getIn(['chatData','hash']);\n }\n\n if ( state.chatwidget.get('vid')) {\n append = append + '/(vid)/' + state.chatwidget.get('vid');\n }\n\n helperFunctions.sendMessageParent('screenshot',[window.lhcChat['base_url'] + 'file/storescreenshot' + append]);\n } else if (action == 'lhc_cobrowse') {\n helperFunctions.sendMessageParent('screenshare',[]);\n } else if (action == 'lhc_cobrowse_cmd') {\n helperFunctions.sendMessageParent('screenshareCommand',[op]);\n } else if (action == 'lhc_ui_refresh') {\n const state = getState();\n updateUISettings({'id' : state.chatwidget.getIn(['chatData','id']), 'hash' : state.chatwidget.getIn(['chatData','hash'])})(dispatch, getState);\n } else if (action.indexOf('lhinst.updateMessageRow') !== -1) {\n const state = getState();\n updateMessage({'msg_id' : action.replace('lhinst.updateMessageRow(','').replace(')',''), 'lmgsid' : state.chatwidget.getIn(['chatLiveData','lmsgid']), 'mode' : state.chatwidget.get('mode'), 'theme' : state.chatwidget.get('theme'), 'id' : state.chatwidget.getIn(['chatData','id']), 'hash' : state.chatwidget.getIn(['chatData','hash'])})(dispatch, getState);\n }\n });\n }\n}\n\nexport function updateMessage(obj) {\n return function(dispatch, getState) {\n const state = getState();\n\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/fetchmessage\", obj, defaultHeaders)\n .then((response) => {\n\n // Get present className of the row\n let elm = document.getElementById('msg-'+response.data.id);\n let classNameRow = null;\n if (elm !== null) {\n classNameRow = elm.className;\n }\n\n // Now we can update as we know a class\n dispatch({type: \"FETCH_MESSAGE_SUBMITTED\", data: response.data});\n\n // Reselect updated row\n elm = document.getElementById('msg-'+response.data.id);\n\n // Update className\n if (classNameRow !== null) {\n elm.className = classNameRow;\n }\n\n // Just adjust a scroll\n if (!obj.no_scroll) {\n let elmScroll = document.getElementById('messages-scroll');\n if (elmScroll !== null) {\n elmScroll.scrollTop = elmScroll.scrollHeight + 1000;\n }\n }\n\n\n/*\n let elmUpdated = document.getElementById('msg-'+response.data.id);\n let collection = elmUpdated.getElementsByTagName('script');\n let collectionButton = elmUpdated.getElementsByTagName('button');\n let collectionA = elmUpdated.getElementsByTagName('a');\n\n for (let item of collection) {\n var attribs = {};\n if (item.hasAttributes()) {\n var attrs = item.attributes;\n for (var i = attrs.length - 1; i >= 0; i--) {\n attribs[attrs[i].name] = attrs[i].value;\n }\n }\n item.attribs = attribs;\n parseScript(item, this);\n }\n\n for (let item of collectionButton) {\n var attribs = {};\n if (item.hasAttributes()) {\n var attrs = item.attributes;\n for (var i = attrs.length - 1; i >= 0; i--) {\n attribs[attrs[i].name] = attrs[i].value;\n }\n }\n item.attribs = attribs;\n if (item.onclick) {\n item.onclick = () => parseScript(item, this);\n }\n }\n\n for (let item of collectionA) {\n var attribs = {};\n if (item.hasAttributes()) {\n var attrs = item.attributes;\n for (var i = attrs.length - 1; i >= 0; i--) {\n attribs[attrs[i].name] = attrs[i].value;\n }\n }\n item.attribs = attribs;\n\n if (item.onclick) {\n item.onclick = () => parseScript(item, this, obj, dispatch, getState);\n }\n }*/\n\n })\n .catch((err) => {\n console.log(err);\n })\n }\n}\n\nexport function parseScript(domNode, inst, obj, dispatch, getState) {\n const attr = domNode.attribs || domNode;\n\n if (attr['data-bot-action'] == 'lhinst.disableVisitorEditor') {\n inst.disableEditor = true;\n } else if (attr['data-bot-action'] == 'lhinst.setDelay') {\n inst.delayData.push(JSON.parse(attr['data-bot-args']));\n } else if (attr['data-bot-action'] == 'button-click') {\n dispatch(updateTriggerClicked({'type' : '/(type)/'+attr['data-action-type'] + (obj.theme ? '/(theme)/' + obj.theme : '')}, {\n \"payload-id\": (typeof attr['data-identifier'] === 'undefined' ? null : attr['data-identifier']),\n payload: attr['data-payload'],\n id : attr['data-id'],\n processed : (typeof attr['data-keep'] === 'undefined')})).then((data) => {\n if (data.data.t) {\n helperFunctions.sendMessageParent('botTrigger', [{'trigger' : data.data.t}]);\n }\n if (data.data.update_message) {\n const state = getState();\n updateMessage({'no_scroll' : true, 'msg_id' : attr['data-id'], 'lmgsid' : state.chatwidget.getIn(['chatLiveData','lmsgid']), 'mode' : state.chatwidget.get('mode'), 'theme' : state.chatwidget.get('theme'), 'id' : state.chatwidget.getIn(['chatData','id']), 'hash' : state.chatwidget.getIn(['chatData','hash'])})(dispatch, getState);\n } else {\n fetchMessages({'theme' : obj.theme, 'chat_id' : obj.id, 'lmgsid' : obj.lmgsid, 'hash' : obj.hash})(dispatch, getState);\n checkChatStatus({\n 'chat_id': obj.id,\n 'hash' : obj.hash,\n 'theme' : obj.theme,\n 'mode' : obj.mode\n })\n }\n });\n\n } else if (attr['data-bot-action'] == 'execute-js') {\n if (attr['data-bot-extension']) {\n var args = {};\n if (typeof attr['data-bot-args'] !== 'undefined') {\n args = JSON.parse(attr['data-bot-args']);\n }\n helperFunctions.emitEvent('extensionExecute',[attr['data-bot-extension'],[args]]);\n } else if (attr['data-bot-emit']) {\n var args = {};\n if (typeof attr['data-bot-args'] !== 'undefined') {\n args = JSON.parse(attr['data-bot-args']);\n }\n helperFunctions.emitEvent(attr['data-bot-emit'],[args]);\n } else if (attr['data-bot-event']) {\n inst.props[attr['data-bot-event']]();\n } else {\n if (attr.src) {\n var th = document.getElementsByTagName('head')[0];\n var s = document.createElement('script');\n s.setAttribute('type','text/javascript');\n s.setAttribute('src', attr.src);\n th.appendChild(s);\n } else if (typeof domNode.children[0] !== 'undefined' && typeof domNode.children[0]['data'] !== 'undefined') {\n eval(domNode.children[0]['data']);\n }\n }\n }\n}\n\nfunction isNetworkError(err) {\n return !!err.isAxiosError && !err.response;\n}\n\nexport function fetchMessages(obj) {\n return function(dispatch, getState) {\n\n if (syncStatus.msg == true || syncStatus.add_msg == true) {\n return;\n }\n\n syncStatus.msg = true;\n\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/fetchmessages\", obj, defaultHeaders)\n .then((response) => {\n\n try {\n dispatch({type: \"FETCH_MESSAGES_SUBMITTED\", data: response.data});\n\n processResponseCheckStatus(response.data, getState, dispatch);\n\n helperFunctions.emitEvent('chat.fetch_messages',[response.data, dispatch, getState]);\n\n if (response.data.cs || (response.data.closed && response.data.closed === true)) {\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/checkchatstatus\", obj, defaultHeaders)\n .then((response) => {\n if (response.data.deleted) {\n helperFunctions.sendMessageParent('endChat',[{'sender' : 'endButton'}]);\n clearTimeout(syncStatus.auto_close_timeout);\n } else {\n dispatch({type: \"CHECK_CHAT_STATUS_FINISHED\", data: response.data});\n helperFunctions.emitEvent('chat.check_status',[response.data, dispatch, getState]);\n }\n if (response.data.closed && response.data.closed === true && !response.data.deleted) {\n setAutoClose(getState);\n }\n })\n .catch((err) => {\n dispatch({type: \"CHECK_CHAT_STATUS_REJECTED\", data: err})\n })\n }\n\n } catch (e) {\n throw e;\n } finally {\n syncStatus.msg = false;\n }\n\n })\n .catch((err) => {\n\n if (isNetworkError(err)) {\n dispatch({type: \"NO_CONNECTION\", data: true});\n }\n\n syncStatus.msg = false;\n })\n }\n}\n\nexport function checkChatStatus(obj) {\n return function(dispatch, getState) {\n\n if (syncStatus.status == true) {\n return;\n }\n\n syncStatus.status = true;\n\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/checkchatstatus\", obj, defaultHeaders)\n .then((response) => {\n if (response.data.deleted) {\n helperFunctions.sendMessageParent('endChat',[{'sender' : 'endButton'}]);\n clearTimeout(syncStatus.auto_close_timeout);\n } else {\n syncStatus.status = false;\n dispatch({type: \"CHECK_CHAT_STATUS_FINISHED\", data: response.data});\n helperFunctions.emitEvent('chat.check_status',[response.data, dispatch, getState]);\n }\n if (response.data.closed && response.data.closed === true && !response.data.deleted) {\n setAutoClose(getState);\n }\n })\n .catch((err) => {\n syncStatus.status = false;\n })\n }\n}\n\nfunction setAutoClose(getState) {\n const state = getState();\n if (state.chatwidget.hasIn(['chat_ui','open_timeout'])) {\n clearTimeout(syncStatus.auto_close_timeout);\n syncStatus.auto_close_timeout = setTimeout(function(){\n helperFunctions.sendMessageParent('endChat',[{'sender' : 'endButton'}]);\n clearTimeout(syncStatus.auto_close_timeout);\n },state.chatwidget.getIn(['chat_ui','open_timeout']) * 1000);\n }\n}\n\nexport function pageUnload() {\n return function(dispatch, getState) {\n const state = getState();\n\n let surveyMode = false\n let surveyByVisitor = (state.chatwidget.hasIn(['chatLiveData','status_sub']) && (state.chatwidget.getIn(['chatLiveData','status_sub']) == STATUS_SUB_CONTACT_FORM || state.chatwidget.getIn(['chatLiveData','status_sub']) == STATUS_SUB_SURVEY_SHOW || (state.chatwidget.getIn(['chatLiveData','status_sub']) == STATUS_SUB_USER_CLOSED_CHAT && (state.chatwidget.getIn(['chatLiveData','uid']) > 0 || state.chatwidget.getIn(['chatLiveData','status']) === STATUS_BOT_CHAT))));\n let surveyByOperator = (state.chatwidget.getIn(['chatLiveData','status']) == STATUS_CLOSED_CHAT && state.chatwidget.getIn(['chatLiveData','uid']) > 0);\n\n if ((surveyByVisitor == true || surveyByOperator) && state.chatwidget.hasIn(['chat_ui','survey_id'])) {\n // If survey button is required and we have not went to survey yet\n if ((!state.chatwidget.hasIn(['chat_ui','survey_button']) || state.chatwidget.getIn(['chat_ui_state','show_survey']) === 1) || surveyByVisitor == true) {\n surveyMode = true;\n }\n }\n\n /**\n * Unload always if we have this options in theme and chat is in survey mode on mobile or is unloading in general desktop application\n * */\n if (state.chatwidget.hasIn(['chat_ui','close_on_unload']) && state.chatwidget.get('mode') == 'embed') {\n if (state.chatwidget.get('isMobile') === false || surveyMode === true) {\n helperFunctions.sendMessageParent('endChat',[{'sender' : 'endButton'}]);\n }\n }\n\n // If popoup is closed\n if (state.chatwidget.get('mode') == 'popup' && surveyMode == true) {\n helperFunctions.sendMessageParent('endChat',[{'sender' : 'endButton'}]);\n }\n\n if (state.chatwidget.hasIn(['chatData','id']) && state.chatwidget.hasIn(['chatData','hash'])) {\n axios.post(window.lhcChat['base_url'] + \"chat/userclosechat/\" + state.chatwidget.getIn(['chatData','id']) + '/' + state.chatwidget.getIn(['chatData','hash']), null, defaultHeaders);\n } else if (state.chatwidget.getIn(['proactive','has']) === true && window.lhcChat['mode'] == 'popup' && window.opener) {\n hideInvitation()(dispatch, getState);\n }\n }\n}\n\nfunction checkErrorCounter() {\n if (syncStatus.error_counter == 2) {\n // Restart widget on second error\n helperFunctions.sendMessageParent('reloadWidget',[]);\n }\n}\n\nexport function addMessage(obj) {\n return function(dispatch, getState) {\n\n if (syncStatus.add_msg == true) {\n syncStatus.add_msg_pending.push(obj);\n return;\n }\n\n syncStatus.add_msg = true;\n\n try {\n helperFunctions.eventEmitter.emitEvent('messageSend', [{'chat_id':obj.id, 'hash': obj.hash, msg: obj.msg}]);\n } catch (error) {\n helperFunctions.logJSError({\n 'stack' : JSON.stringify(JSON.stringify(error))\n });\n }\n\n axios.post(window.lhcChat['base_url'] + \"widgetrestapi/addmsguser\", obj, defaultHeaders)\n .then((response) => {\n try {\n // Update error state if it changed\n if (response.data.error || getState().chatwidget.getIn(['chatLiveData','error'])) {\n dispatch({type: \"ADD_MESSAGES_SUBMITTED\", data: {r: response.data.r, msg: obj.msg}});\n }\n \n syncStatus.add_msg = false;\n \n fetchMessages({'theme' : obj.theme, 'chat_id' : obj.id, 'lmgsid' : getState().chatwidget.getIn(['chatLiveData','lmsgid']), 'hash' : obj.hash})(dispatch, getState);\n\n if (response.data.t) {\n helperFunctions.sendMessageParent('botTrigger',[{'trigger' : response.data.t}]);\n }\n\n if (typeof response.data.r === 'undefined' || (response.data.error === true && response.data.system === true)) {\n\n syncStatus.error_counter++;\n\n // Log error only if it happens two times in a row\n if (syncStatus.error_counter == 2) {\n helperFunctions.logJSError({\n 'stack' : JSON.stringify(JSON.stringify(response) + \"\\nRD:\"+JSON.stringify(response.data) +\"\\nRH:\"+ JSON.stringify(response.headers) +\"\\nRS:\"+ JSON.stringify(response.status))\n });\n\n checkErrorCounter();\n }\n\n helperFunctions.eventEmitter.emitEvent('messageSendError', [{'chat_id':obj.id, 'hash': obj.hash, msg: JSON.stringify(response.data)}]);\n } else {\n syncStatus.error_counter = 0;\n }\n } catch (e) {\n throw e;\n } finally {\n syncStatus.add_msg = false;\n // There is pending message to be added\n if (syncStatus.add_msg_pending.length > 0) {\n addMessage(syncStatus.add_msg_pending.shift())(dispatch, getState);\n }\n }\n })\n .catch((error) => {\n if (isNetworkError(error)) {\n dispatch({type: \"ADD_MESSAGES_SUBMITTED\", data: {r: \"SEND_CONNECTION\", \"msg\" : obj.msg}});\n dispatch({type: \"NO_CONNECTION\", data: true});\n } else {\n syncStatus.error_counter++;\n\n var stack = null;\n\n // Error\n if (error.response) {\n stack = JSON.stringify(JSON.stringify(error) + \"\\nRD:\"+JSON.stringify(error.response.data) +\"\\nRH:\"+ JSON.stringify(error.response.headers) +\"\\nRS:\"+ JSON.stringify(error.response.status));\n } else if (error.request) {\n stack = JSON.stringify(JSON.stringify(error));\n } else {\n stack = JSON.stringify(JSON.stringify(error));\n }\n\n // Log error only if it happens two times in a row\n if (syncStatus.error_counter == 2) {\n\n helperFunctions.logJSError({\n 'stack': stack\n });\n\n helperFunctions.eventEmitter.emitEvent('messageSendError', [{'chat_id':obj.id, 'hash': obj.hash, msg: stack}]);\n\n checkErrorCounter();\n } else {\n\n dispatch({type: \"ADD_MESSAGES_SUBMITTED\", data: {r: \"SEND_FAILED\", \"msg\" : obj.msg}});\n\n syncStatus.add_msg = false;\n\n // Try to send message again\n addMessage(obj)(dispatch, getState);\n }\n }\n\n syncStatus.add_msg = false;\n })\n }\n}\n\nexport function userTyping(status, msg) {\n return function(dispatch, getState) {\n const state = getState();\n\n if (status === 'true') {\n helperFunctions.eventEmitter.emitEvent('visitorTyping', [{'chat_id':state.chatwidget.getIn(['chatData','id']), 'hash': state.chatwidget.getIn(['chatData','hash']),'status': true, msg: msg}]);\n } else {\n helperFunctions.eventEmitter.emitEvent('visitorTyping', [{'chat_id':state.chatwidget.getIn(['chatData','id']), 'hash': state.chatwidget.getIn(['chatData','hash']),'status': false}]);\n }\n\n if (!state.chatwidget.get('overrides').contains('typing')) {\n axios.post(window.lhcChat['base_url'] + \"chat/usertyping/\" + state.chatwidget.getIn(['chatData','id']) + '/' + state.chatwidget.getIn(['chatData','hash']) + '/' + status, {'msg' : msg}, defaultHeaders)\n .then((response) => {\n }).catch((err) => {\n console.log(err);\n });\n }\n }\n}\n\nexport function submitInlineSurvey(obj) {\n return axios.post(window.lhcChat['base_url'] + \"survey/fillinline\", obj, defaultHeaders);\n}","import React, { PureComponent } from 'react';\n\nclass ChatAbort extends PureComponent {\n\n constructor(props) {\n super(props);\n }\n\n render() {\n return \n
\n
\n
\n\n {this.props.as_html &&
}\n {!this.props.as_html &&

{this.props.text}

}\n\n
\n \n
\n
\n
\n
;\n }\n}\n\nexport default ChatAbort;\n","import React, { PureComponent } from 'react';\nimport parse, { domToReact } from 'html-react-parser';\nimport { connect } from \"react-redux\";\nimport { withTranslation } from 'react-i18next';\n\nclass ChatBotIntroMessage extends PureComponent {\n\n constructor(props) {\n super(props);\n this.abstractClick = this.abstractClick.bind(this);\n this.updateTriggerClicked = this.updateTriggerClicked.bind(this);\n this.processBotAction = this.processBotAction.bind(this);\n this.disableEditor = false;\n }\n\n addLoader(attrs, element) {\n if (!attrs[\"data-no-change\"] && attrs.type == 'button') {\n element.setAttribute(\"disabled\",\"disabled\");\n element.innerHTML = \"\" + element.innerHTML;\n }\n }\n\n /**\n * Here we handle bot buttons actions\n * */\n abstractClick(attrs, e) {\n\n const { t } = this.props;\n\n this.addLoader(attrs,e.target);\n\n if (attrs.onclick.indexOf('lhinst.updateTriggerClicked') !== -1) {\n this.updateTriggerClicked({type:'triggerclicked'}, attrs, e.target);\n } else if (attrs.onclick.indexOf('notificationsLHC.sendNotification') !== -1) {\n // todo\n } else if (attrs.onclick.indexOf('lhinst.buttonClicked') !== -1) {\n this.updateTriggerClicked({type:''}, attrs, e.target);\n } else if (attrs.onclick.indexOf('lhinst.updateChatClicked') !== -1) {\n this.updateTriggerClicked({type:'',mainType: 'updatebuttonclicked'}, attrs, e.target);\n } else if (attrs.onclick.indexOf('lhinst.editGenericStep') !== -1) {\n this.updateTriggerClicked({type:'editgenericstep'}, attrs, e.target);\n } else if (attrs.onclick.indexOf('lhinst.dropdownClicked') !== -1) {\n const list = document.getElementById('id_generic_list-' + attrs['data-id']);\n if (list && list.value != \"0\" && list.value != \"\") {\n attrs['data-payload'] = list.value;\n this.updateTriggerClicked({type:'valueclicked'}, attrs, e.target);\n } else {\n alert(t('bot.please_choose'));\n }\n } else {\n helperFunctions.emitEvent('MessageClick',[attrs, this.props.dispatch]);\n console.log('Unknown click event: ' + attrs.onclick);\n }\n\n e.preventDefault();\n }\n\n updateTriggerClicked(paramsType, attrs, target) {\n this.props.setBotPayload({type: paramsType['type'], payload: attrs['data-payload'], id : attrs['data-id'], processed : (typeof attrs['data-keep'] === 'undefined')})\n }\n\n processBotAction(domNode) {\n\n const attr = domNode.attribs;\n\n if (attr['data-bot-action'] == 'lhinst.disableVisitorEditor') {\n this.disableEditor = true;\n } else if (attr['data-bot-action'] == 'lhinst.setDelay') {\n //this.delayData.push(JSON.parse(attr['data-bot-args']));\n } else if (attr['data-bot-action'] == 'execute-js') {\n eval(domNode.children[0]['data']);\n }\n }\n\n render() {\n\n return parse(this.props.content, {\n\n replace: domNode => {\n if (domNode.attribs) {\n\n var cloneAttr = Object.assign({}, domNode.attribs);\n\n if (domNode.attribs.onclick) {\n delete domNode.attribs.onclick;\n }\n\n if (domNode.name && domNode.name === 'button') {\n if (cloneAttr.onclick) {\n return \n }\n } else if (domNode.name && domNode.name === 'a') {\n if (cloneAttr.onclick) {\n return this.abstractClick(cloneAttr, e)} >{domToReact(domNode.children)}\n }\n } else if (domNode.name && domNode.name === 'script' && domNode.attribs['data-bot-action']) {\n this.processBotAction(domNode);\n }\n }\n }\n });\n }\n}\n\nexport default ChatBotIntroMessage;","import React, { Component } from 'react';\nimport { withTranslation } from 'react-i18next';\nimport { getProducts } from \"../actions/chatActions\"\nimport { connect } from \"react-redux\";\n\nclass ChatDepartment extends Component {\n\n constructor(props) {\n super(props);\n this.onchangeAttr = this.onchangeAttr.bind(this);\n this.onchangeAttrProduct = this.onchangeAttrProduct.bind(this);\n }\n\n onchangeAttr(e) {\n this.props.onChangeContent({id : 'DepartamentID', value : e.value});\n\n if (this.props.departments.getIn(['settings','product_by_department']) === true) {\n this.props.dispatch(getProducts({'dep_id' : e.value}));\n }\n }\n\n onchangeAttrProduct(e) {\n this.props.onChangeContent({id : 'ProductID', value : e.value});\n }\n\n componentDidMount() {\n\n // We have product functionality enabled\n if (this.props.departments.getIn(['settings','product']) === true && (this.props.departments.getIn(['settings','product_by_department']) === true || this.props.departments.has('products')))\n {\n this.props.onChangeContent({id : 'HasProductID', value : true});\n }\n\n if (this.props.departments.get('departments').size == 0)\n {\n return;\n }\n\n if (this.props.departments.get('departments').size == 1 || !this.props.departments.hasIn(['settings','optional'])) {\n this.onchangeAttr({'value': this.props.setDefaultValue || this.props.departments.getIn(['departments',0]).get('value')});\n } else if (this.props.departments.get('departments').size > 1) {\n this.onchangeAttr({'value': -1});\n }\n }\n\n render() {\n\n const { t } = this.props;\n\n var departmentOutput = null;\n if (this.props.departments.get('departments').size > 1 && !this.props.departments.hasIn(['settings','hide_department'])) {\n var classNameInput = ['form-control','form-control-sm'];\n\n if (this.props.isInvalid === true) {\n classNameInput.push('is-invalid');\n }\n\n var options = this.props.departments.get('departments').map(dep => );\n departmentOutput =
\n \n \n
;\n }\n\n var productOutput = null;\n if (this.props.departments.getIn(['settings','product']) === true) {\n var classNameInputProduct = ['form-control','form-control-sm'];\n\n if (this.props.isInvalidProduct === true) {\n classNameInputProduct.push('is-invalid');\n }\n\n var prouducts = this.props.departments.has('products') ? this.props.departments.get('products').map(dep => ) : \"\";\n if (this.props.departments.has('products') && this.props.departments.get('products').size > 0) {\n productOutput =
\n \n \n
;\n };\n }\n\n if (productOutput !== null || departmentOutput !== null){\n return
{departmentOutput}{productOutput}
\n } else {\n return null;\n }\n }\n}\n\nexport default connect()(withTranslation()(ChatDepartment));\n","import React, { Component } from 'react';\nimport { withTranslation } from 'react-i18next';\n\nclass ChatField extends Component {\n\n state = {\n hiddenIfPrefilled: false\n };\n\n constructor(props) {\n super(props);\n this.onchangeAttr = this.onchangeAttr.bind(this);\n this.onFileAdded = this.onFileAdded.bind(this);\n }\n\n onchangeAttr(e) {\n this.props.onChangeContent({id : this.props.field.get('name'), value : e.value, field : this.props.field});\n \n if (this.props.field.get('type') == 'dropdown' ) {\n var selectedOption = parseInt(e.target.options[e.target.selectedIndex].getAttribute('dep-id'));\n if (selectedOption > 0) {\n // Maybe we should add product and custom start chat form dependency\n // Now we just assume different departments will have same start chat form settings\n this.props.onChangeContent({id : 'DepartamentID', value : selectedOption, subject_id: e.target.options[e.target.selectedIndex].getAttribute('subject-id')});\n }\n }\n }\n\n onFileAdded(e) {\n const list = e.target.files;\n const files = [];\n for (var i = 0; i < list.length; i++) {\n files.push(list.item(i));\n }\n\n if (list.length == 0) {\n return null;\n }\n\n const ruleTest = new RegExp(\"(\\.|\\/)(\" + this.props.field.get('ft_us') + \")$\",\"i\");\n\n const { t } = this.props;\n\n let uploadErrors = [];\n files.forEach(file => {\n if (!(ruleTest.test(file.type) || ruleTest.test(file.name))) {\n uploadErrors.push(file.name + ': ' + t('file.incorrect_type'));\n }\n if (file.size > this.props.field.get('fs')) {\n uploadErrors.push(file.name + ': '+ t('file.to_big_file'));\n }\n });\n\n if (uploadErrors.length > 0) {\n alert(uploadErrors.join(\"\\n\"));\n } else {\n this.props.onChangeContent({id : this.props.field.get('name'), value : files[0], field : this.props.field});\n }\n }\n\n componentDidMount() {\n if (this.props.field.get('type') == 'checkbox' && this.props.field.get('default') == true) {\n this.props.onChangeContent({id : this.props.field.get('name'), value : true});\n } else if (this.props.field.get('type') == 'dropdown') {\n this.props.onChangeContent({id : this.props.field.get('name'), value : this.props.defaultValueField});\n this.props.field.get('options').map((dep) => {\n if (dep.get('value') == this.props.defaultValueField && dep.get('dep_id')) {\n this.props.onChangeContent({set_default: true, id : 'DepartamentID', subject_id: (dep.has('subject_id') ? dep.get('subject_id') : null), value : dep.get('dep_id')});\n }\n });\n }\n\n if (this.props.attrPrefill && this.props.attrPrefill.attr_prefill_admin) {\n this.props.attrPrefill.attr_prefill_admin.forEach((item) => {\n if (item.index == this.props.field.get('identifier') || (this.props.field.has('identifier_prefill') && item.index == this.props.field.get('identifier_prefill'))) {\n this.props.onChangeContent({id : this.props.field.get('name'), value : item.value});\n // Hide only valid prefilled fields\n if (this.props.field.has('hide_prefilled') && this.props.field.get('hide_prefilled') == true && this.props.isInvalid === false) {\n this.setState({'hiddenIfPrefilled':true});\n }\n }\n });\n }\n }\n\n render() {\n\n if (this.state.hiddenIfPrefilled === true && this.props.isInvalid !== true) {\n return null;\n }\n\n var className = 'col-' + this.props.field.get('width');\n var required = this.props.field.get('required') === true;\n\n var classNameInput = [];\n\n if (this.props.field.get('class') != '') {\n classNameInput.push(this.props.field.get('class'));\n }\n\n if (this.props.isInvalid === true) {\n classNameInput.push('is-invalid');\n }\n\n if (this.props.field.get('type') == 'text') {\n return (\n
\n
\n \n this.onchangeAttr({'value' : e.target.value})} name={this.props.field.get('name')} defaultValue={this.props.defaultValueField} placeholder={this.props.field.get('placeholder')} />\n
\n
\n )\n } else if (this.props.field.get('type') == 'password') {\n return (\n
\n
\n \n this.onchangeAttr({'value' : e.target.value})} name={this.props.field.get('name')} defaultValue={this.props.defaultValueField} placeholder={this.props.field.get('placeholder')} />\n
\n
\n )\n } else if (this.props.field.get('type') == 'textarea') {\n return (\n
\n
\n {!this.props.chatUI.has('hide_message_label') && this.props.field.get('identifier') == 'question' && }\n