/*! For license information please see main.be068b2a.js.LICENSE.txt */ (function(){var __webpack_modules__={81506: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},e.exports.__esModule=!0,e.exports.default=e.exports},34575:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},93913:function(e){function t(e,t){for(var n=0;n0)&&(p=(null===n||void 0===n?void 0:n.IMAGE)||(null===n||void 0===n?void 0:n.IMAGES_URLS[0]),h="\ud83d\uddbc\ufe0f"),(null!==n&&void 0!==n&&n.AUDIO||(null===n||void 0===n||null===(f=n.AUDIOS_URLS)||void 0===f?void 0:f.length)>0)&&(h="\ud83c\udfa7"),(null!==n&&void 0!==n&&n.VIDEO||(null===n||void 0===n||null===(d=n.VIDEOS_URLS)||void 0===d?void 0:d.length)>0)&&(h="\ud83c\udf9e\ufe0f");return(0,o.jsx)("div",{ref:c,className:a?"bm-wc-reply-message-container-dismissable":"bm-wc-reply-message-container",children:(0,o.jsx)("div",{className:a?"bm-wc-message-container-dismissable":"bm-wc-message-container",children:(0,o.jsxs)("div",{className:"bm-wc-flex-container",children:[(0,o.jsx)("div",{className:a?"bm-wc-separator-bar-dismissable":"bm-wc-separator-bar"}),(0,o.jsxs)("div",{className:"bm-wc-message-content-container",children:[(0,o.jsxs)("div",{className:a?"bm-wc-message-text-container-dismissable":"bm-wc-message-text-container",children:[u&&(0,o.jsx)("p",{className:"bm-wc-message-from-text",children:(null===(t=n.RENDERING_INFO)||void 0===t?void 0:t.OPERATOR_ALIAS)||n.FROM_NAME}),(0,o.jsx)("p",{className:"bm-wc-message-body-text",children:h})]}),p&&(0,o.jsx)("div",{className:"bm-wc-message-image-container",children:(0,o.jsx)("img",{className:"bm-wc-message-body-image",src:p,alt:"message reply"})})]}),a&&(0,o.jsx)("div",{className:"bm-wc-dismiss-button-container",children:(0,o.jsx)("div",{onClick:i,children:(0,o.jsx)("span",{className:"bm-wc-dismiss-button",children:"X"})})})]})})},n._id_)}},81652:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{$j:function(){return connect},HX:function(){return resizeUpdate},Zm:function(){return sendMessageAction},aG:function(){return inputFocusChangedAction},aY:function(){return getInitialState},cT:function(){return uploadFile},eK:function(){return reportError},j2:function(){return initialize},lr:function(){return maximizeAction},mc:function(){return reset},oU:function(){return minimizeAction},tZ:function(){return inputTextChangedAction},we:function(){return CHANGING_PRESENCE_TIME}});var _app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(15861),_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(1413),_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(87757),_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0__),_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(73459),_webarchitecture_server_env__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(96711),_selectors_ReducerSelectors__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(46186),_server_ReliableSocketHandler__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(83188),wait_promise__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(66505),wait_promise__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(wait_promise__WEBPACK_IMPORTED_MODULE_5__),lodash__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(16031),lodash__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__),MAXIMIZE="MAXIMIZE",MINIMIZE="MINIMIZE",CHANGING_PRESENCE_TIME=["0.5s",400],reliableSocketHandler,authToken,serverGroup,container,disconnectedAtLeastOnce=!1,servicesInitialized=!1,changingPresenceImpl=!1,varsToSet={},wsNotConnected={setVariables:function(e){varsToSet=(0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},varsToSet),e)},onEnter:function(){}},waitingHi={setVariables:function(e){varsToSet=(0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},varsToSet),e)},nextState:wsNotConnected,onEnter:function(){}},wsConnected={setVariables:function(e){return lodash__WEBPACK_IMPORTED_MODULE_6___default().isEmpty(e)?Promise.resolve():sendToServer("setVariables",{msg:{variables:e}},!1)},onEnter:function(){wsConnected.setVariables(varsToSet).then((function(e){return varsToSet={},null})).catch((function(e){return console.error(e.message)}))}},connectionState=waitingHi;function getInitialState(){return{connected:!1,visible:!0,minimized:!1,startsMinimized:!0,presenceAlreadyChanged:!1,presenceChanging:null,configuration:{},uploadProgress:0,recordingAudio:!1,suggestionText:"",suggestions:[],hamburger:[],visiblePopup:null,userId:null,business:null,customer:null,ratingDone:!1,locale:"es",initialMessages:[],messages:[],waitingForServerDataLocalTime:null,lastArrivedMessageLocalTime:null,messagesSentCount:0,isBotTyping:!1,isCustomerTyping:!1,lastCustomerMessageSentTime:getServerDate(null),lastBotMessageReceivedTime:getServerDate(null),lastBotMessageReadTime:getServerDate(null)}}function initialize(e){var t,n,r,o,i=(container=e).state.configuration,a={bmMaximize:function(){return maximizeAction(!1)},bmMinimize:function(){return minimizeAction()},bmHide:function(){return hideAction()},bmShow:function(){return showAction()},bmSendMessage:function(e){return sendMessageAction("text",{text:e})},bmInfo:function(){var e=container.state.customer;return(0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({chatPlatformId:e.CHAT_PLATFORM_ID,platformContactId:e.PLATFORM_CONTACT_ID},lodash__WEBPACK_IMPORTED_MODULE_6___default().omit(window.botmaker,["frameWrapper","iframe"]))},bmConnect:function(){var e=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t&&(window.BOTMAKER_VAR=t),e.next=3,connect();case 3:container.start();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),bmSetVariables:function(e){e=lodash__WEBPACK_IMPORTED_MODULE_6___default().mapValues(e,(function(e,t){return void 0===e||null===e?"":lodash__WEBPACK_IMPORTED_MODULE_6___default().isString(e)?e.trim():lodash__WEBPACK_IMPORTED_MODULE_6___default().isArray(e)||lodash__WEBPACK_IMPORTED_MODULE_6___default().isObject(e)?JSON.stringify(e):e.toString()})),connectionState.setVariables(e)}};if(Object.assign(window,a),window.hasParentAccess){if(Object.assign(window.parent,a),window.parent!==window.parent.parent)try{Object.assign(window.parent.parent,a)}catch(_){console.warn("no parent window access")}}else window.addEventListener("message",onParentMessage);if(window.botmaker={},window.parent!==window){var s={overflow:"hidden",position:"fixed",width:0,height:"100%",bottom:0,right:0,zIndex:2147483647,display:"flex"};if(window.hasParentAccess&&window.parent.botmaker){window.botmaker=window.parent.botmaker,window.botmaker.parentChatIframe=getBotmakerFrame(window,"chat-iframe");var u=window.botmaker,c=u.iframe,l=u.frameWrapper,f=u.parentChatIframe;Object.assign(c.style,{position:"relative",top:0,left:0,width:"100%",height:"100%",border:0,maxHeight:"100vh",display:"flex"}),Object.assign(l.style,s),f&&Object.assign(f.style,s),window.parent.addEventListener("resize",resizeUpdate)}else window.parent.postMessage({messageType:"resize",style:s},"*"),window.addEventListener("resize",resizeUpdate)}if(null!==(t=window.BM_JS_VARS)&&void 0!==t&&t.business){var d=window.BM_JS_VARS.business,h=null!==(n=i["--bm-wc-config-chatStartsMinimized"])&&void 0!==n&&n,p=null!==(r=i["--bm-wc-config-mobileChatStartsMinimized"])&&void 0!==r&&r,m=null!==(o=i["--bm-wc-config-chatStartsHidden"])&&void 0!==o&&o,g=(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.tq)()?p:h;container.setContainerState({business:d,visible:!m,startsMinimized:"true"!==(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.ej)("maximized")&&g,minimized:"true"!==(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.ej)("maximized")&&g}),window.botmaker.zIndex="2147483647",window.botmaker.isMinimized=g}else reportError("Invalid BM_JS_VARS!")}function connect(){return _connect.apply(this,arguments)}function _connect(){return(_connect=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(){var t,n,r,o,i,a,s;return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=window.BM_JS_VARS.business,null!==(t=window.BM_JS_VARS)&&void 0!==t&&t.business){e.next=4;break}return reportError("Invalid BM_JS_VARS!"),e.abrupt("return");case 4:r=(0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},buildHiObject()),{},{type:"hi",v:_webarchitecture_server_env__WEBPACK_IMPORTED_MODULE_2__.q4,ts:(new Date).getTime()}),waitingServerInitialDataChangedAction(!0);case 6:return e.prev=7,o=_webarchitecture_server_env__WEBPACK_IMPORTED_MODULE_2__.H5+"webchat/hirest"+(__webpack_require__.g.BM_JS_VARS.sgtemp?"/"+__webpack_require__.g.BM_JS_VARS.sgtemp:""),e.next=11,fetch(o,{method:"POST",body:JSON.stringify(r),headers:new Headers({"Content-Type":"application/json","Accept-Encoding":"gzip, deflate, br"})});case 11:return i=e.sent,e.next=14,i.json();case 14:return a=e.sent,r.clientVars.testConsole&&container.setContainerState({business:(0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},container.getContainerState().business),{},{_id_:a.customer.BUSINESS_ID}),isTestConsole:!0}),authToken=a.token,serverGroup=a.sg||"",waitingServerInitialDataChangedAction(!1),personalizadorWebchat(n,a),e.next=22,onServerMessage(a);case 22:if(!a.connectws){e.next=26;break}return disconnectedAtLeastOnce=!0,e.next=26,tryToInitializeWSIfNotAlreadyDone();case 26:return e.abrupt("return");case 29:return e.prev=29,e.t0=e.catch(7),reportError(e.t0),e.next=34,wait_promise__WEBPACK_IMPORTED_MODULE_5___default().sleep(1e3*(30+Math.trunc(21*Math.random())));case 34:if(null!==(s=container.getContainerState().waitingForServerDataLocalTime)){e.next=39;break}return e.abrupt("return");case 39:(new Date).getTime()-s>3e4&&(console.warn("Waiting for server initial data, send hi again!"),waitingServerInitialDataChangedAction(!0));case 40:e.next=6;break;case 42:case"end":return e.stop()}}),e,null,[[7,29]])})))).apply(this,arguments)}var reset=function(){var e=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,runIntent("HARD_RESET_USER");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function personalizadorWebchat(e,t){if("PersonalizadorWebchat"===e._id_){var n=new Date,r=new Date;r.setSeconds(n.getSeconds()+1);var o=new Date;o.setSeconds(r.getSeconds()+3);var i=new Date;i.setSeconds(o.getSeconds()+5);var a=new Date;a.setSeconds(i.getSeconds()+7),t.messages=[{CREATION_TIME:n,_id_:"WebchatConfig_Bot1",FROM:"me",type:"text",MESSAGE:"Bienvenido al Personalizador de Webchat.",BUSINESS_ID:"PersonalizadorWebchat",FROM_NAME:"Bot",input:!1,SENT:!0,RECEIVED:!0,READ:!0},{_id_:"WebchatConfig_User",CREATION_TIME:r,FROM:"UserBot",MESSAGE:"Aqu\xed puede probar distintos estilos.",SENT:!0,RECEIVED:!0,READ:!0},{CREATION_TIME:i,_id_:"WebchatConfig_Bot3",FROM:"me",ITEMS:[{subTitle:"Subtitulo",imageURL:"https://www.todoperros.com/wp-content/uploads/2016/08/perro.jpg",options:[{itemType:"url",_id_:"https://www.botmaker.com",value:"Ir a"}],title:"Titulo",itemURL:""},{subTitle:"Subtitulo 2",imageURL:"https://www.todoperros.com/wp-content/uploads/2016/08/perro.jpg",options:[{itemType:"url",_id_:"https://www.botmaker.com",value:"Ir a "}],title:"Titulo 2",itemURL:""}],ORDER:{},INDEX:2,FROM_NAME:"Bot"},{CREATION_TIME:a,_id_:"WebchatConfig_Bot4",FROM:"me",type:"text",MESSAGE:"Estas son algunas pills.",FROM_NAME:"Bot",input:!1,SENT:!0,RECEIVED:!0,READ:!0,HAS_QUICK_REPLIES:!0,OPTIONS:[{itemType:"postback",value:"Opci\xf3n 1"},{itemType:"postback",value:"Opci\xf3n 2"},{itemType:"postback",value:"Opci\xf3n 3"}]}]}}function onParentMessage(e){if(e.data&&e.data.messageType){var t=e.data,n=t.messageType,r=t.variables;switch(n){case"maximize":return window.bmMaximize();case"minimize":return window.bmMinimize();case"hide":return window.bmHide();case"show":return window.bmShow();case"info":return e.source.postMessage({messageType:"info",info:window.bmInfo()},"*");case"connect":return window.bmConnect(r);default:console.error("Message type from parent not recognized ["+n+"]")}}}function tryToInitializeWSIfNotAlreadyDone(){return _tryToInitializeWSIfNotAlreadyDone.apply(this,arguments)}function _tryToInitializeWSIfNotAlreadyDone(){return(_tryToInitializeWSIfNotAlreadyDone=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(){var t;return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(servicesInitialized){e.next=10;break}return servicesInitialized=!0,t="".concat(_webarchitecture_server_env__WEBPACK_IMPORTED_MODULE_2__.$1?"ws://localhost:20380":"wss://ws.botmaker.com","/").concat(serverGroup,"/ws/wendpoint/"),e.next=5,new Promise((function(e){return reliableSocketHandler=new _server_ReliableSocketHandler__WEBPACK_IMPORTED_MODULE_4__.Z(t,(function(t){connectionChangedAction(t),e(!0)}),(function(e){return onServerMessage(e)}))}));case 5:connectionState=wsConnected,waitingHi.nextState=wsConnected,connectionState.onEnter(),continuouslySendHeartbeat(),continuouslyTick();case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function buildHiObject(){var e={};if(e.isMobile=(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.tq)(),e=addBelcorpSpecifics(e),Object.keys(window.BM_JS_VARS||{}).filter((function(e){return"business"!==e})).forEach((function(t){return e[t]=window.BM_JS_VARS[t]})),window.hasParentAccess&&window.parent.BOTMAKER_VAR&&(window.BOTMAKER_VAR=window.parent.BOTMAKER_VAR),window.BOTMAKER_VAR&&Object.keys(window.BOTMAKER_VAR).forEach((function(t){return e[t]=window.BOTMAKER_VAR[t]})),authToken=null,document.cookie&&document.cookie.length>0){var t=new RegExp("botmaker_auth[^;]+").exec(document.cookie);t&&t.length>0&&(authToken=unescape(t?t.toString().replace(/^[^=]+./,""):null))}return{url:window.location.href,token:authToken,businessId:__webpack_require__.g.BM_JS_VARS.business._id_,webId:__webpack_require__.g.BM_JS_VARS.business.WEB_ID,clientVars:e,msg:{}}}function onServerMessage(e){return _onServerMessage.apply(this,arguments)}function _onServerMessage(){return _onServerMessage=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function _callee5(message){var payloadType,_message,date,s,serverDate,maxTimeout,_s,c,isOperatorTyping,code,_s2,currentMessages,isNewMessageFromConsole,lastMessage,time,minimized;return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function _callee5$(_context5){for(;;)switch(_context5.prev=_context5.next){case 0:if(payloadType=message.type,"SERVER_INITIAL_DATA"===payloadType&&(message.reloadOn&&(window.location=message.reloadOn),message.token||(message=message.msg),authToken=message.token,date=new Date,date.setTime(date.getTime()+964224e5),document.cookie="botmaker_auth=".concat(message.token,"; expires=").concat(date.toGMTString(),";SameSite=").concat(window.hasParentAccess?"Lax":"None","; Secure; path=/"),s=(0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},container.getContainerState()),{},{serverTimeMillisDiff:new Date(message.serverTime).getTime()-(new Date).getTime(),visible:message&&message.visible||container.getContainerState().visible,userId:message.customer._id_,locale:message.lang||"es",customer:message.customer,hamburger:message.hamburger||[],waitingForServerDataLocalTime:null,initialMessages:message&&message.initialMessages,suggestionsDataUrl:message.suggestionsDataUrl,addOperatorNamePrefixToResponses:null===(_message=message)||void 0===_message?void 0:_message.addOperatorNamePrefixToResponses}),message.visible&&(window.botmaker.isHidden=!1,resizeUpdate()),serverDate=getServerDate(s),s.lastCustomerMessageSentTime=serverDate,s.lastBotMessageReceivedTime=serverDate,s.lastBotMessageReadTime=serverDate,s.messages=_selectors_ReducerSelectors__WEBPACK_IMPORTED_MODULE_3__._((0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},s),{},{messages:[]}),message.messages.slice()),message.maximizeIn&&"false"!==(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.ej)("maximized")&&(maxTimeout=setTimeout((function(){window.bmMaximize(),maxTimeout&&clearTimeout(maxTimeout)}),1e3*message.maximizeIn)),s.visible&&window.dispatchEvent(new Event("bmShow")),connectionState=waitingHi.nextState,connectionState.onEnter(),container.setContainerState(s)),"MESSAGE_STATE_CHANGED"!==payloadType){_context5.next=11;break}return _context5.next=5,wait_promise__WEBPACK_IMPORTED_MODULE_5___default().sleep(500);case 5:_s=(0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},container.getContainerState()),c=lodash__WEBPACK_IMPORTED_MODULE_6___default().get(message,"msg.customer"),_s.lastCustomerMessageSentTime=getServerDate(_s),_s.customer=c||_s.customer,_s.messages=_selectors_ReducerSelectors__WEBPACK_IMPORTED_MODULE_3__._(_s,[]),container.setContainerState(_s);case 11:if("me"!==lodash__WEBPACK_IMPORTED_MODULE_6___default().get(message,"msg.FROM")||"Bot"!==lodash__WEBPACK_IMPORTED_MODULE_6___default().get(message,"msg.FROM_NAME")){_context5.next=18;break}return _context5.next=14,wait_promise__WEBPACK_IMPORTED_MODULE_5___default().sleep(800);case 14:return _context5.next=16,setBotIsTyping(!0);case 16:return _context5.next=18,wait_promise__WEBPACK_IMPORTED_MODULE_5___default().sleep(1e3);case 18:if("RESTART"===payloadType&&setTimeout((function(){return window.location.reload(!0)}),200),"BOT_TYPING_CHANGED"!==payloadType){_context5.next=23;break}return isOperatorTyping=lodash__WEBPACK_IMPORTED_MODULE_6___default().get(message,"msg.isOperatorTyping",!1),_context5.next=23,setBotIsTyping(isOperatorTyping);case 23:if("ADD_HTML_CODE_TO_WEBCHAT_FRAME"===payloadType&&(code=lodash__WEBPACK_IMPORTED_MODULE_6___default().get(message,"msg.code","").trim(),""!==code&&eval(code)),payloadType!==MAXIMIZE){_context5.next=27;break}return _context5.next=27,maximizeAction(!0);case 27:if(payloadType!==MINIMIZE){_context5.next=30;break}return _context5.next=30,minimizeAction();case 30:"RECEIVE_WEBCHAT_MESSAGE"===payloadType&&(_s2=(0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},container.getContainerState()),(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.hY)(document.getElementById("audio-income")),currentMessages=_selectors_ReducerSelectors__WEBPACK_IMPORTED_MODULE_3__._(_s2,message.msg),isNewMessageFromConsole=!1,currentMessages.length>1&&(lastMessage=lodash__WEBPACK_IMPORTED_MODULE_6___default().tail(currentMessages),time=(getServerDate(_s2)-new Date(lastMessage.CREATION_TIME).getTime())/1e3,isNewMessageFromConsole=time<900&&(!lastMessage.REPRESENTATION_ID||"WebChat.WEBCHAT_FIRST_MESSAGE"!==lastMessage.REPRESENTATION_ID)),_s2.messages=currentMessages,_s2.lastArrivedMessageLocalTime=(new Date).getTime(),minimized=_s2.minimized,minimized&&isNewMessageFromConsole&&((0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.d8)("maximized","true",1),minimized=!1),_s2.minimized=minimized,container.setContainerState(_s2),window.botmaker.isMinimized=minimized,resizeUpdate());case 31:case"end":return _context5.stop()}}),_callee5)}))),_onServerMessage.apply(this,arguments)}function getBotmakerFrame(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(window.hasParentAccess&&!(n>3)&&e.frames)return e.frames[t]?e.frames[t]:getBotmakerFrame(e.parent,t,n+1)}function resizeUpdate(){var e,t=document.getElementById("wc-chat-frame"),n=window.botmaker,r=n.frameWrapper,o=n.parentChatIframe;if(t){var i=container.getContainerState(),a=i.visible,s=i.minimized,u=i.configuration;if(!a||window.botmaker.isHidden){var c={height:0,width:0};return r&&Object.assign(r.style,c),void(o?Object.assign(o.style,c):window.hasParentAccess||window.parent.postMessage({messageType:"resize",style:c},"*"))}var l={},f=u["--bm-wc-config-fullscreen"]||!1,d="none"!==u["--main-bm-launcher-msg-display"],h="".concat(parseInt(null===(e=u["--main-bm-launcher-img-width"])||void 0===e?void 0:e.replace("px",""))+25,"px");if((0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.tq)()||f)if(s)Object.assign(l,{maxHeight:container.chatFrameStyle.maxHeight,height:u["--bm-wc-config-main-button-frame-height"],width:d?u["--bm-wc-config-main-button-frame-width"]:h,left:u["--bm-wc-config-main-button-frame-left"],right:u["--bm-wc-config-main-button-frame-right"],bottom:u["--bm-wc-config-main-button-frame-bottom"]}),t.removeAttribute("style");else{var p=u["--bm-wc-config-main-height"];Object.assign(l,{maxHeight:"100vh",height:p||"100%",width:u["--bm-wc-config-main-width"]||"100vw",left:0,right:0,top:u["--bm-wc-config-main-button-frame-top"],bottom:0}),Object.assign(t.style,{marginBottom:0,marginRight:0,marginLeft:0,height:"100%",width:"100%"})}else s?Object.assign(l,{maxHeight:container.chatFrameStyle.maxHeight,height:u["--bm-wc-config-main-button-frame-height"],width:d?u["--bm-wc-config-main-button-frame-width"]:h}):Object.assign(l,{maxHeight:_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.Eg,height:u["--bm-wc-config-main-button-frame-height-maximized"],width:u["--bm-wc-config-main-conversational-frame-width"]?u["--bm-wc-config-main-conversational-frame-width"]:t.getBoundingClientRect().width+50+"px"}),Object.assign(l,{top:u["--bm-wc-config-main-button-frame-top"],bottom:u["--bm-wc-config-main-button-frame-bottom"],right:u["--bm-wc-config-main-button-frame-right"],left:u["--bm-wc-config-main-button-frame-left"],margin:u["--bm-wc-config-main-button-frame-margin"]});r&&Object.assign(r.style,l),o?Object.assign(o.style,l):window.hasParentAccess||window.parent.postMessage({messageType:"resize",style:l},"*")}}function setBotIsTyping(e){return _setBotIsTyping.apply(this,arguments)}function _setBotIsTyping(){return(_setBotIsTyping=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t){var n;return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n=(0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},container.getContainerState()),{},{isBotTyping:t||!1})).isBotTyping&&(n.messages=_selectors_ReducerSelectors__WEBPACK_IMPORTED_MODULE_3__._(n,[])),container.setContainerState(n);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function waitingServerInitialDataChangedAction(e){var t;e?((connectionState=waitingHi).onEnter(),t=(new Date).getTime()):t=null,container.setContainerState({waitingForServerDataLocalTime:t})}function connectionChangedAction(e){return _connectionChangedAction.apply(this,arguments)}function _connectionChangedAction(){return(_connectionChangedAction=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||(disconnectedAtLeastOnce=!0),!disconnectedAtLeastOnce||!t){e.next=4;break}return e.next=4,sendHiToServerSync();case 4:return container.setContainerState({connected:t}),e.abrupt("return",sendIPAddress());case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hideAction(){return _hideAction.apply(this,arguments)}function _hideAction(){return(_hideAction=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:container.setContainerState({visible:!1}),window.botmaker.isHidden=!0,resizeUpdate();case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function showAction(){return _showAction.apply(this,arguments)}function _showAction(){return(_showAction=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:container.getContainerState().visible||window.dispatchEvent(new Event("bmShow")),container.setContainerState({visible:!0}),window.botmaker.isHidden=!1,resizeUpdate();case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function commonChangeSizeAction(){window.botmaker.iframe&&(window.botmaker.returnToOriginalState?window.botmaker.returnToOriginalState():window.botmaker.isMinimized||(window.botmaker.returnToOriginalState=(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.sp)(__webpack_require__.g.parent.window.document))),resizeUpdate()}function minimizeAction(){return _minimizeAction.apply(this,arguments)}function _minimizeAction(){return(_minimizeAction=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!changingPresenceImpl){e.next=2;break}return e.abrupt("return");case 2:return changingPresenceImpl=!0,container.setContainerState({presenceAlreadyChanged:!0,presenceChanging:"minimizing"}),e.next=6,wait_promise__WEBPACK_IMPORTED_MODULE_5___default().sleep(CHANGING_PRESENCE_TIME[1]);case 6:return container.setContainerState({minimized:!0}),(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.d8)("maximized","false",1),window.botmaker.isMinimized=!0,commonChangeSizeAction(),e.next=12,wait_promise__WEBPACK_IMPORTED_MODULE_5___default().sleep(100);case 12:container.setContainerState({presenceChanging:null}),resizeUpdate(),changingPresenceImpl=!1;case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function connectAction(){return tryToInitializeWSIfNotAlreadyDone()}function maximizeAction(e){return _maximizeAction.apply(this,arguments)}function _maximizeAction(){return(_maximizeAction=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!changingPresenceImpl){e.next=2;break}return e.abrupt("return");case 2:if(changingPresenceImpl=!0,!t){e.next=6;break}return e.next=6,sendToServer("maximized");case 6:(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.d8)("maximized","true",1),window.botmaker.isMinimized=!1,container.setContainerState({presenceAlreadyChanged:!0,presenceChanging:null,minimized:!1}),commonChangeSizeAction(),changingPresenceImpl=!1;case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sendToServerAndWaitForAck(e,t){return _sendToServerAndWaitForAck.apply(this,arguments)}function _sendToServerAndWaitForAck(){return(_sendToServerAndWaitForAck=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t,n){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sendToServer(t,n,!0);case 2:n=e.sent;case 3:if(!reliableSocketHandler.isMessagePending(n)){e.next=8;break}return e.next=6,wait_promise__WEBPACK_IMPORTED_MODULE_5___default().sleep(250);case 6:e.next=3;break;case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function uploadFile(e,t){var n=container.getContainerState().business._id_,r=new FormData;r.append("authToken",authToken),r.append("file",e);var o=function(e){console.error(e),container.setContainerState({uploadProgress:0}),t&&t()},i=new XMLHttpRequest;i.addEventListener("error",o),i.addEventListener("abort",o),i.upload.addEventListener("progress",(function(e){return container.setContainerState({uploadProgress:e.loaded/e.total})})),i.addEventListener("load",(function(){var n=JSON.parse(i.response),r=null;e.type.startsWith("image")?r={IMAGES_URLS:[n.url],MESSAGE:"__image__"}:e.type.startsWith("video")?r={VIDEOS_URLS:[n.url]}:e.type.startsWith("audio")?r={AUDIOS_URLS:[n.url]}:e.type.startsWith("file")||e.type.startsWith("text")||e.type.startsWith("application")?r={FILES_URLS:[n.url],MESSAGE:"__file__"}:console.error("Unsupported file",e),null!=r&&sendMessageAction("upload",r),container.setContainerState({uploadProgress:0,visiblePopup:null}),t&&t()})),i.open("POST","".concat(_webarchitecture_server_env__WEBPACK_IMPORTED_MODULE_2__.H5,"webchat/upload/").concat(n,"/upload"),!0),i.send(r)}function sendToServer(e){return _sendToServer.apply(this,arguments)}function _sendToServer(){return _sendToServer=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t){var n,r,o=arguments;return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=o.length>2?o[2]:void 0,n.msg||(n={msg:n}),__webpack_require__.g.BM_JS_VARS&&__webpack_require__.g.BM_JS_VARS.business&&(n.businessId=__webpack_require__.g.BM_JS_VARS.business._id_),n.type=t,n.token=authToken,n.ts=(new Date).getTime(),n.v=_webarchitecture_server_env__WEBPACK_IMPORTED_MODULE_2__.q4,e.next=10,tryToInitializeWSIfNotAlreadyDone();case 10:return reliableSocketHandler.sendMessage(n,r),e.abrupt("return",n);case 12:case"end":return e.stop()}}),e)}))),_sendToServer.apply(this,arguments)}function sendHiToServerSync(){return _sendHiToServerSync.apply(this,arguments)}function _sendHiToServerSync(){return(_sendHiToServerSync=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(){var t,n;return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=buildHiObject()).token=null,waitingServerInitialDataChangedAction(!0),e.next=5,sendToServer("hi",t,!0);case 5:return e.next=8,wait_promise__WEBPACK_IMPORTED_MODULE_5___default().sleep(1e3*(30+Math.trunc(21*Math.random())));case 8:if(null!==(n=container.getContainerState().waitingForServerDataLocalTime)){e.next=13;break}return e.abrupt("break",20);case 13:if(!((new Date).getTime()-n>3e4)){e.next=18;break}return console.warn("Waiting for server initial data, send hi again!"),waitingServerInitialDataChangedAction(!0),e.next=18,sendToServerAndWaitForAck("hi",t);case 18:e.next=5;break;case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function addBelcorpSpecifics(e){return e.req_belcorpCountryId=(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.re)("countryId"),e.req_belcorpUserId=(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.re)("userId"),e.req_belcorpConsultantCode=(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.re)("codigoConsultora"),e.req_belcorpDocumentNumber=(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.re)("numeroDocumento"),e.req_belcorpDeviceId=(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.re)("deviceId"),e.req_belcorpUserArea=(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.re)("UA"),e.req_belcorpToken=(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.re)("token"),e}function continuouslySendHeartbeat(){return _continuouslySendHeartbeat.apply(this,arguments)}function _continuouslySendHeartbeat(){return(_continuouslySendHeartbeat=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(){var t,n;return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=container.getContainerState()).userId||!t.business){e.next=10;break}return n=t.customer?t.customer.QUEUE:null,e.next=6,sendToServer("Heartbeat",{isVisible:t.visible,queue:n||"_default_"});case 6:return e.next=8,wait_promise__WEBPACK_IMPORTED_MODULE_5___default().sleep(12e4);case 8:e.next=12;break;case 10:return e.next=12,wait_promise__WEBPACK_IMPORTED_MODULE_5___default().sleep(1e3);case 12:e.next=0;break;case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function runIntent(e){return _runIntent.apply(this,arguments)}function _runIntent(){return(_runIntent=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sendToServer("runIntent",{intentId:t});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function continuouslyTick(){return _continuouslyTick.apply(this,arguments)}function _continuouslyTick(){return(_continuouslyTick=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,wait_promise__WEBPACK_IMPORTED_MODULE_5___default().sleep(900);case 3:return e.next=5,checkBotMessageState();case 5:e.next=0;break;case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function checkBotMessageState(){return _checkBotMessageState.apply(this,arguments)}function _checkBotMessageState(){return(_checkBotMessageState=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(){var t,n,r,o,i,a,s;return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==(t=container.getContainerState()).messages.length){e.next=3;break}return e.abrupt("return");case 3:if((n=lodash__WEBPACK_IMPORTED_MODULE_6___default().last(t.messages))&&"me"===n.FROM){e.next=6;break}return e.abrupt("return");case 6:if(r=new Date(n.CREATION_TIME).getTime(),o=r>t.lastBotMessageReceivedTime,i=__webpack_require__.g.document.hasFocus()&&container.isScrollAtBottom()&&r>t.lastBotMessageReadTime,o||i){e.next=11;break}return e.abrupt("return");case 11:return e.next=13,sendToServerAndWaitForAck("customerReceiveAndReadStateChange",{received:o,read:i});case 13:a=container.getContainerState(),s=getServerDate(a),o&&container.setContainerState({lastBotMessageReceivedTime:s}),i&&container.setContainerState({lastBotMessageReadTime:s});case 17:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function getServerDate(e){var t=(null===e||void 0===e?void 0:e.serverTimeMillisDiff)||0;return(new Date).getTime()+t}function inputFocusChangedAction(e){return _inputFocusChangedAction.apply(this,arguments)}function _inputFocusChangedAction(){return(_inputFocusChangedAction=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(container){e.next=2;break}return e.abrupt("return");case 2:((0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.qx)()||(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.HM)())&&t&&setTimeout((function(){var e=document.body.style.overflow;document.body.style.overflow="hidden";var t=(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.Jj)();t.scrollTo(0,document.body.scrollHeight),t.scrollTo(0,0),document.body.style.overflow=e||"none"}),5),container.setContainerState({hasInputFocus:t});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function inputTextChangedAction(e){return _inputTextChangedAction.apply(this,arguments)}function _inputTextChangedAction(){return(_inputTextChangedAction=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t){var n,r,o,i;return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=container.getContainerState().isCustomerTyping,r=t.length,n===(o=r>0)){e.next=7;break}return container.setContainerState({isCustomerTyping:o}),e.next=7,sendToServer("customerTypingChanged",{isCustomerTyping:o});case 7:i=(0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},container.getContainerState()),{},{suggestions:[]}),container.setContainerState(i);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rateSessionAction(e){return _rateSessionAction.apply(this,arguments)}function _rateSessionAction(){return(_rateSessionAction=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sendToServer("rateSession",t);case 2:container.setContainerState({rateSessionDone:!0});case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function sendMessageAction(e,t){return _sendMessageAction.apply(this,arguments)}function _sendMessageAction(){return _sendMessageAction=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t,n){var r,o,i,a,s,u,c,l,f,d,h,p,m,g=arguments;return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=g.length>2&&void 0!==g[2]?g[2]:null,(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.hY)(document.getElementById("audio-sent")),!n||!n.text||"@logout"!==n.text.toLowerCase()){e.next=6;break}return reliableSocketHandler.close(),window.location.reload(),e.abrupt("return");case 6:if(o=container.getContainerState(),i=o.userId,a=o.business,s=o.messages,u=o.serverTimeMillisDiff,c=o.messagesSentCount,i&&a){e.next=11;break}return reportError("No user or business defined yet"),e.abrupt("return");case 11:for(l=[],f=s.length-1;f>=0&&"FIRST_MESSAGE"===s[f].INTENT_ID&&"me"===s[f].FROM;)l.unshift(s[f]),f--;return d=(0,_util_WebUtils__WEBPACK_IMPORTED_MODULE_1__.Qe)(20),h={_id_:d,CREATION_TIME:new Date(getServerDate({serverTimeMillisDiff:u})),FROM:i,firstMessageReply:l.length>0?l:void 0},r&&(h.RENDERING_INFO={},h.RENDERING_INFO.replyTo={_id_:r._id_,MESSAGE:r.MESSAGE,FROM:r.FROM,FROM_NAME:r.FROM_NAME},r.IMAGES_URLS&&(h.RENDERING_INFO.replyTo.IMAGE=r.IMAGES_URLS[0]),r.VIDEOS_URLS&&(h.RENDERING_INFO.replyTo.VIDEO=r.VIDEOS_URLS[0]),r.AUDIOS_URLS&&(h.RENDERING_INFO.replyTo.AUDIO=r.AUDIOS_URLS[0]),r.FILES_URLS&&(h.RENDERING_INFO.replyTo.FILE=r.FILES_URLS[0])),"callback"===t?(h.MESSAGE=n.id,h.CALLBACK_ID=n.id):"upload"===t?h=(0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)((0,_app_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__.Z)({},h),n):h.MESSAGE=n.text,lodash__WEBPACK_IMPORTED_MODULE_6___default().isEmpty(varsToSet)||(h.variables=varsToSet,varsToSet={}),e.next=21,sendToServer("fromWebChat",h,!0);case 21:p=e.sent,"callback"===t&&((m=JSON.parse(p.msg.MESSAGE)).button=n.value,p.msg.MESSAGE=JSON.stringify(m)),container.setContainerState({isCustomerTyping:!1,messagesSentCount:c+1,messages:_selectors_ReducerSelectors__WEBPACK_IMPORTED_MODULE_3__._(o,[p.msg])});case 24:case"end":return e.stop()}}),e)}))),_sendMessageAction.apply(this,arguments)}function reportError(e){console.error(e||"no details")}function sendIPAddress(){return _sendIPAddress.apply(this,arguments)}function _sendIPAddress(){return(_sendIPAddress=(0,_app_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_8__.Z)(_app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(){return _app_node_modules_babel_runtime_regenerator_index_js__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch("https://m-infra.appspot.com/ip.jsp",{method:"GET"}).then((function(e){return e.json()})).then((function(e){return{country:e.country,ip:e.ip}})).then((function(e){return sendToServer("setCountry",e)})).catch(reportError));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},66726:function(e,t,n){"use strict";var r={};n.r(r),n.d(r,{addTrackers:function(){return Bt},default:function(){return Jt},event:function(){return Gt},exception:function(){return Kt},ga:function(){return zt},initialize:function(){return Ft},modalview:function(){return Yt},outboundLink:function(){return $t},pageview:function(){return Vt},plugin:function(){return Zt},send:function(){return Ht},set:function(){return Wt},testModeAPI:function(){return Qt},timing:function(){return qt}});n(93764),n(74065),n(44210),n(23663),n(30186),n(78199),n(2481),n(82585),n(16208),n(34071),n(64383),n(26655),n(90049),n(18152),n(65025),n(88424),n(89824),n(6805),n(50237),n(73990),n(28442),n(99149),n(40798),n(75292),n(33242),n(57359),n(39237),n(10944),n(72047),n(73545),n(3167),n(39026),n(16631),n(46962),n(53870),n(208),n(89575),n(95671),n(23017),n(49449),n(76001),n(11497),n(49796),n(49998),n(62371),n(94097),n(34480),n(15485),n(40239),n(33968),n(88616),n(89918),n(93177),n(30392),n(38552),n(97263),n(25222),n(10190),n(8716),n(68388),n(32613),n(20307),n(42968),n(34738),n(12076),n(63590),n(93130),n(14039),n(76118),n(13090),n(23440),n(83785),n(81669),n(28092),n(67972),n(16056),n(69286),n(57794),n(46040),n(11938),n(99588),n(25596),n(55820),n(66347),n(61658),n(60185),n(38737),n(86659),n(64316),n(26578),n(19943),n(84377),n(99514),n(62690),n(7251),n(84019),n(67069),n(65458),n(7734),n(246),n(85387),n(28794),n(96832),n(36438),n(8902),n(27181),n(93158),n(42803),n(99155),n(9900),n(24670),n(38142),n(8999),n(63410),n(27909),n(4541),n(91038),n(925),n(87049),n(31677),n(34897),n(6234),n(75350),n(90192),n(44826),n(34379),n(12964),n(90463),n(71577),n(44113),n(52993),n(37428),n(78754),n(16402),n(37623),n(58074),n(24718),n(87598),n(41125),n(11510),n(17391),n(28345),n(89608),n(18298),n(95811),n(43639),n(17858),n(66862),n(20836),n(8532),n(27788),n(27638),n(13473),n(470),n(10056),n(18497),n(23198),n(62319),n(86728),n(11430),n(33292),n(83938),n(1278),n(85179),n(89437),n(28702),n(79478),n(45686),n(92694),n(30743),n(40643),n(95338),n(47897),n(38601),n(64048),n(48582),n(36679),n(13835),n(39532),n(22754),n(20223),n(56633),n(56038),n(92995),n(55429),n(60237),n(67366),n(25507),n(17619),n(36037),n(53245),n(91642),n(68937);var o=n(47313),i=n(1168),a=n(1413),s=n(15861),u=n(42982);var c=n(40181);function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(u){s=!0,o=u}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||(0,c.Z)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var f,d,h,p=n(15671),m=n(43144),g=n(79340),_=n(45716),v=n(87757),b=n.n(v),y=n(73459),w=n(7142),x=n(81652),E=n(98495),k=n.n(E);function S(){return(S=(0,s.Z)(b().mark((function e(t,n){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,d){e.next=6;break}return e.next=4,navigator.mediaDevices.getUserMedia({video:!1,audio:!0});case 4:f=e.sent,d=k()(f,{type:"audio"});case 6:d.startRecording(),h=(new Date).getTime(),n&&function e(){d&&(n(T()),setTimeout(e,1e3))}(),t(!0),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(0),alert("Unable to capture your microphone."),console.error(e.t0),t(!1);case 17:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)}function T(){var e=((new Date).getTime()-h)/1e3,t=Math.floor(e/3600),n=Math.floor((e-3600*t)/60),r=Math.floor(e-3600*t-60*n);return n<10&&(n="0".concat(n)),r<10&&(r="0".concat(r)),t<=0?"".concat(n,":").concat(r):"".concat(t,":").concat(n,":").concat(r)}var O=n(30191),M=n.n(O),A=n(46417),C=function(e){(0,g.Z)(n,e);var t=(0,_.Z)(n);function n(e,r){var o;return(0,p.Z)(this,n),(o=t.call(this,e,r)).state={postfix:"",h:0},o}return(0,m.Z)(n,[{key:"componentDidMount",value:function(){this.setState({h:this.mainDiv.getBoundingClientRect().height})}},{key:"getHeight",value:function(){return this.state.h}},{key:"muteChat",value:function(){var e=document.getElementById("audio-income");e&&(e.volume=0);var t=document.getElementById("audio-sent");t&&(t.volume=0)}},{key:"render",value:function(){var e=this,t=this.props,n=t.locale,r=t.changePresence,o=t.status,i=t.showStatus,a=t.showHeaderButton,s=t.isTestConsole,u=t.botName;return(0,A.jsxs)("div",{ref:function(t){return e.mainDiv=t},className:"wc-header",children:[(0,A.jsx)("div",{className:"wc-header-icon"}),(0,A.jsxs)("div",{className:"wc-header-middle",children:[(0,A.jsx)("div",{className:"wc-botname",children:u}),i&&(0,A.jsxs)("div",{className:"wc-header-subtitle",children:[(0,A.jsx)("div",{className:"wc-header-subtitle-1"}),(0,A.jsx)("div",{className:"wc-header-subtitle-2",children:o+this.state.postfix})]})]}),s&&(0,A.jsx)("button",{className:"new-chat-button",onClick:x.mc,children:(0,y.VQ)(n).newChat}),a&&(0,A.jsx)("button",{tabIndex:"1","aria-label":(0,y.VQ)(n).closeChat,onClick:r,className:"wc-header-right"})]})}}]),n}(o.PureComponent),R=n(38920),D=n(16031),P=n.n(D),I=n(46123),j=n.n(I),L=n(20477),N=n.n(L);var U=[],B=new function(){return N()('/*! For license information please see fuse.worker.48f1b782.worker.js.LICENSE.txt */\n!function(){var e={469:function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r1)throw new Error(\'"weight" property in key must bein the range of [0, 1)\');i=null==i?u:Math.max(i,u),o=null==o?u:Math.min(o,u),this._keyWeights[h]=u,a+=u}if(a>1)throw new Error("Total of weights cannot exceed 1")}}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log(\'---------\\nSearch pattern: "\'.concat(e,\'"\'));var r=this._prepareSearchers(e),n=r.tokenSearchers,o=r.fullSearcher,i=this._search(n,o);return this._computeScore(i),this.options.shouldSort&&this._sort(i),t.limit&&"number"==typeof t.limit&&(i=i.slice(0,t.limit)),this._format(i)}},{key:"_prepareSearchers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var r=e.split(this.options.tokenSeparator),n=0,o=r.length;n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=this.list,n={},o=[];if("string"==typeof r[0]){for(var i=0,a=r.length;i-1&&(C=(C+l)/2),r._log("Score average:",C);var P=!r.options.tokenize||!r.options.matchAllTokens||h>=u.length;if(r._log("\\nCheck Matches: ".concat(P)),(s||v.isMatch)&&P){var j={key:n,arrayIndex:t,value:o,score:C};r.options.includeMatches&&(j.matchedIndices=v.matchedIndices);var I=d[a];I?I.output.push(j):(d[a]={item:i,output:[j]},g.push(d[a]))}}else if(c(o))for(var T=0,E=o.length;T0?Number.EPSILON:h.score;c*=Math.pow(v,f)}i.score=c,this._log(i)}}},{key:"_sort",value:function(e){this._log("\\n\\nSorting...."),e.sort(this.options.sortFn)}},{key:"_format",value:function(e){var t=[];if(this.options.verbose){var r=[];this._log("\\n\\nOutput:\\n\\n",JSON.stringify(e,(function(e,t){if("object"===n(t)&&null!==t){if(-1!==r.indexOf(t))return;r.push(t)}return t}),2)),r=null}var o=[];this.options.includeMatches&&o.push((function(e,t){var r=e.output;t.matches=[];for(var n=0,o=r.length;n-1&&(a.arrayIndex=i.arrayIndex),t.matches.push(a)}}})),this.options.includeScore&&o.push((function(e,t){t.score=e.score}));for(var i=0,a=e.length;ic)return o(e,this.pattern,l);var h=this.options,u=h.location,f=h.distance,v=h.threshold,d=h.findAllMatches,p=h.minMatchCharLength;return i(e,this.pattern,this.patternAlphabet,{location:u,distance:f,threshold:v,findAllMatches:d,minMatchCharLength:p,includeMatches:n})}}])&&n(t.prototype,r),s&&n(t,s),e}();e.exports=s},function(e,t){var r=/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g;e.exports=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/ +/g,o=new RegExp(t.replace(r,"\\\\$&").replace(n,"|")),i=e.match(o),a=!!i,s=[];if(a)for(var c=0,l=i.length;c=E;z-=1){var W=z-1,K=r[e.charAt(W)];if(K&&(M[W]=1),N[z]=(N[z+1]<<1|1)&K,0!==j&&(N[z]|=(O[z+1]|O[z])<<1|1|O[z+1]),N[z]&P&&(A=n(t,{errors:j,currentLocation:W,expectedLocation:m,distance:l}))<=S){if(S=A,(b=W)<=m)break;E=Math.max(1,2*m-b)}}if(n(t,{errors:j+1,currentLocation:m,expectedLocation:m,distance:l})>S)break;O=N}var $={isMatch:b>=0,score:0===A?.001:A};return y&&($.matchedIndices=o(M,p)),$}},function(e,t){e.exports=function(e,t){var r=t.errors,n=void 0===r?0:r,o=t.currentLocation,i=void 0===o?0:o,a=t.expectedLocation,s=void 0===a?0:a,c=t.distance,l=void 0===c?100:c,h=n/e.length,u=Math.abs(s-i);return l?h+u/l:u?1:h}},function(e,t){e.exports=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=[],n=-1,o=-1,i=0,a=e.length;i=t&&r.push([n,o]),n=-1)}return e[i-1]&&i-n>=t&&r.push([n,i-1]),r}},function(e,t){e.exports=function(e){for(var t={},r=e.length,n=0;n0&&void 0!==arguments[0]?arguments[0]:[];B.postMessage({list:U.concat(e),searchOpts:F})},r.clearSuggestionList=function(){r.setState({selectedSuggestionIdx:-1,suggestions:[],userInput:null})},r.onSendMessage=(0,s.Z)(b().mark((function e(){var t,n,o,i,a,s;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.props,n=t.businessId,o=t.messageToReply,i=t.onDismissReply,a=r.state.inputMaxLength,(0,y.tq)()&&r.textarea.blur(),!(0===(s=r.textarea.value.trim()).length||s.length>a)){e.next=6;break}return e.abrupt("return");case 6:if("PersonalizadorWebchat"===n){e.next=10;break}return e.next=9,x.Zm("text",{text:s},o);case 9:i&&i();case 10:r.textarea.value="",r.clearSuggestionList(),r.updateFuseItems(),r.updateDimensions();case 14:case"end":return e.stop()}}),e)}))),r.onMouseDownOverButton=function(e){e.preventDefault()},r.onKeyDown=function(e){var t=e.keyCode;switch(t){case 39:case 37:default:break;case 13:e.shiftKey||(e.preventDefault(),r.onSendMessage(),r.props.scrollToBottom(),r.textarea.focus());break;case 27:r.clearSuggestionList();break;case 38:case 40:r.state.suggestions.length>0&&r.setState((function(e){var n=-1;return n=38===t?e.selectedSuggestionIdx<0?r.state.suggestions.length-1:e.selectedSuggestionIdx-1:e.selectedSuggestionIdx>=r.state.suggestions.length-1?-1:e.selectedSuggestionIdx+1,r.textarea.value=-1===n?r.state.userInput:r.state.suggestions[n].button,{selectedSuggestionIdx:n}}))}},r.onKeyUp=(0,s.Z)(b().mark((function e(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.textarea){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,x.tZ(r.textarea.value.trim());case 4:if(0!==r.textarea.value.trim().length){e.next=7;break}return r.clearSuggestionList(),e.abrupt("return");case 7:-1===r.state.selectedSuggestionIdx&&r.setState({userInput:r.textarea.value.trim()});case 8:case"end":return e.stop()}}),e)}))),r.onKeyUpDebounce=P().debounce(r.onKeyUp,150,{maxWait:250}),r.onFocusInput=function(){x.aG(!0),r.props.changeVisiblePopup(null)},r.updateDimensions=function(e){var t,n;if(r.textarea){var o=r.textarea.style;o.height="5px";var i=window.getComputedStyle(r.textarea).maxHeight;i=Math.min(Number(i.replace(/px|none/,"")),150);var a=r.textarea.scrollHeightr.state.inputMaxLength&&y.hY(document.getElementById("audio-error"))}},r.getHeight=function(){return r.h||30},r.recalculatePositionInIOS=function(e){r.mainDiv&&(r.mainDiv.style.bottom=e+"px")},r.addCharacter=function(e){r.textarea.value+=e,r.setState({userInput:r.textarea.value.trim()}),r.updateDimensions(),r.textarea.focus()},r.fileUpload=function(e){e.preventDefault();var t=e.dataTransfer?e.dataTransfer.files:e.target.files;x.cT(t[0],(function(){document.getElementById("bm-upload-file").value=null,(0,y.tq)()&&(document.getElementById("bm-upload-camera").value=null)}))},r.inputClicked=function(e){r.props.changeVisiblePopup(r.props.visiblePopup===e?null:e)},r.renderInput=function(e){var t=e.type,n=e.defaultClass,o=e.callback,i=e.title,a=e.tabIndex,s=e.ariaLabel,u=r.props,c=u.allDisabled,l=u.visiblePopup,f=c||l&&l!==t,d="upload"!==l&&"camera"!==l,h=(0,A.jsx)("button",{tabIndex:a||-1,"aria-expanded":d?l===t:void 0,"aria-disabled":f,"aria-label":s,className:j()("wc-footer-button",{"wc-input-disabled":d&&f},{"wc-input-clicked":d&&l===t},n),onMouseDown:r.onMouseDownOverButton,onClick:f?null:function(){"upload"!==t&&r.inputClicked(t),d&&o&&o()},children:"\xa0"},"wc-button-"+t);return i?(0,A.jsxs)("div",{className:"wc-footer-button-container",children:[(0,A.jsx)("div",{className:"wc-footer-button-title",children:i}),h]}):h},r.alwaysShowInput=function(){return r.props.configuration["--bm-wc-config-footer-always-open"]},r.showIntentIcons=function(){return r.props.configuration["--bm-wc-config-footer-show-intent-icons"]},r.showIntentPills=function(){return r.props.configuration["--bm-wc-config-footer-show-intent-pills"]},r.getInputMaxLength=function(){return r.props.configuration["--bm-wc-config-input-max-length"]},r.renderExtraButtons=function(){return r.props.intentButtons.map((function(e){return(0,A.jsxs)("div",{className:"wc-extra-button-container wc-footer-button-container",children:[(0,A.jsx)("div",{className:"wc-footer-button-title",children:e.button}),(0,A.jsx)("i",{tabIndex:"-1",title:e.button,className:"wc-footer-button material-icons wc-extra-button",onClick:function(){var t=JSON.stringify(e);x.Zm("callback",{id:t,value:t})},children:e.icon||"play_circle_outline"})]},"wc-button-"+e.intent)}))},r.showKeyboard=function(){r.alwaysShowInput()||r.setState({showInput:!r.state.showInput})},r.onBlurInput=function(){x.aG(!1)},r.renderExtraPills=function(){var e=r.props.intentButtons;return r.showIntentPills()&&e.length?(0,A.jsxs)("div",{className:"wc-footer-extra-pills",children:[(0,A.jsx)("div",{className:"wc-footer-extra-pills-title"}),e.map((function(e){return(0,A.jsxs)("div",{tabIndex:"-1",className:"wc-footer-extra-pill bm-webchat-rule-pills-pill",onClick:function(){var t=JSON.stringify(e);x.Zm("callback",{id:t,value:t})},children:[(0,A.jsx)("i",{title:e.button,className:"wc-footer-extra-pill-icon material-icons",children:e.icon||"play_circle_outline"}),(0,A.jsx)("span",{className:"wc-footer-extra-pill-text",children:e.button})]},"wc-button-"+e.intent)}))]}):null};var o=parseInt(r.getInputMaxLength()),i=isFinite(o)?o:240;return r.state={suggestions:[],selectedSuggestionIdx:-1,lastSearchingString:null,userInput:null,showInput:r.alwaysShowInput(),inputMaxLength:i},r.isSearching=!1,r.showSuggestions=!0,r}return(0,m.Z)(n,[{key:"componentDidMount",value:function(){this.initializeFuse(),setTimeout(this.updateDimensions,0)}},{key:"componentDidUpdate",value:function(e,t){this.textarea&&!t.showInput&&this.state.showInput&&(this.textarea.focus(),this.updateDimensions());var n=this.state.userInput&&this.state.userInput.length>2&&this.state.userInput.trim().toLowerCase();this.showSuggestions&&n&&!this.isSearching&&n!==this.state.lastSearchString&&(n||null!==this.state.lastSearchString)&&(this.isSearching=!0,B.postMessage({searchString:n}))}},{key:"componentWillUnmount",value:function(){B.removeEventListener("message",this.handleMessage)}},{key:"renderButtons",value:function(e){var t,n=this,r=this.props,o=r.switchRecordingAudio,i=r.configuration,a=r.locale,s=this.state.userInput,u=((null===(t=this.textarea)||void 0===t?void 0:t.value)||"").trim().length>0,c=(s||"").length,l=(0,y.VQ)(a);return u?(0,A.jsxs)(A.Fragment,{children:[e&&(0,A.jsxs)("span",{className:j()("wc-footer-button-input-counter",{"wc-footer-button-input-counter-disabled":c>e}),children:[c,"/",e]}),(0,A.jsxs)("button",{className:j()("wc-footer-button","wc-input-send",{"wc-input-disabled":e&&c>e}),tabIndex:"5",onMouseDown:this.onMouseDownOverButton,onClick:this.onSendMessage,disabled:c>e,"aria-label":i[".wc-input-send-text::before"]||l.sendMessage,children:[(0,A.jsx)("div",{className:"wc-input-send-img",children:"\xa0"}),(0,A.jsx)("div",{className:"wc-input-send-text"})]},"wc-input-send")]}):(0,A.jsxs)(A.Fragment,{children:[(0,y.tq)()&&(0,A.jsxs)(A.Fragment,{children:[this.renderInput({type:"camera",defaultClass:"wc-input-camera",callback:function(){return document.getElementById("bm-upload-camera").click()},tabIndex:6,ariaLabel:l.camera}),(0,A.jsx)("input",{style:{display:"none"},onChange:function(e){return n.fileUpload(e)},type:"file",accept:"image/*",capture:"camera",id:"bm-upload-camera"},"wc-button-camera-i")]}),this.renderInput({type:"upload",defaultClass:"wc-input-upload",callback:function(){return document.getElementById("bm-upload-file").click()},title:i[".wc-input-upload-text"],tabIndex:7,ariaLabel:l.sendFile}),(0,A.jsx)("input",{style:{display:"none"},onChange:function(e){return n.fileUpload(e)},type:"file",id:"bm-upload-file"},"wc-button-upload-i"),this.renderInput({type:"mic",defaultClass:"wc-input-mic",callback:function(){return o()},tabIndex:8,ariaLabel:l.recordAudio}),this.alwaysShowInput()&&this.renderInput({type:"emoji",defaultClass:"wc-input-emoji",tabIndex:9,ariaLabel:l.openEmojis})]})}},{key:"renderSuggestions",value:function(){var e,t=this,n=this.props,r=n.visiblePopup,o=n.scrollToBottom,i=n.locale,a=this.state,s=a.suggestions,u=a.selectedSuggestionIdx,c=((null===(e=this.textarea)||void 0===e?void 0:e.value)||"").trim().length>0;return"hamburger"!==r&&this.showSuggestions&&c&&s.length>0?(0,A.jsx)(R.default,{items:s,sendMessage:function(e,n){x.Zm("text",{text:JSON.parse(n.value).button}),t.clearSuggestionList(),t.textarea.value="",o()},visible:!0,selectedItemIdx:u,locale:i}):null}},{key:"render",value:function(){var e=this,t=this.props,n=t.hamburgerDisabled,r=t.placeholder,o=t.locale,i=this.state,a=i.showInput,s=i.inputMaxLength;return a?(0,A.jsxs)("div",{ref:function(t){return e.mainDiv=t},className:"wc-footer",children:[this.renderSuggestions(),(0,A.jsxs)("div",{className:"wc-footer-input",style:this.alwaysShowInput()?{}:{justifyContent:"space-between"},children:[!n&&this.renderInput({type:"hamburger",defaultClass:"wc-input-more",tabIndex:2,ariaLabel:(0,y.VQ)(o).openMenu}),this.alwaysShowInput()&&(0,A.jsx)("textarea",{ref:function(t){return e.textarea=t},id:"wc-textarea",className:"wc-textarea",spellCheck:"true",placeholder:r||"",onChange:this.updateDimensions,onBlur:this.onBlurInput,onFocus:this.onFocusInput,onKeyUp:this.onKeyUpDebounce,onKeyDown:this.onKeyDown,tabIndex:"4","aria-label":r||(0,y.VQ)(o).inputAria,autoFocus:!(0,y.tq)()}),(0,A.jsx)("div",{className:"wc-input-buttons",children:this.renderButtons(s)})]}),this.renderExtraPills()]}):(0,A.jsxs)("div",{ref:function(t){return e.mainDiv=t},className:"wc-footer",children:[(0,A.jsx)("div",{className:"wc-conversational-footer-container",onClick:this.showKeyboard,children:(0,A.jsx)("div",{className:"wc-conversational-keyboard"})}),this.renderExtraPills()]})}}]),n}(o.PureComponent),W=z,H=function(e){var t=e.changePresence,n=e.currentPresence,r=e.msgCounter,o=e.locale,i=e.presenceChanging,a="starts-minimized"===n,s=a||"minimized"===n;if(!s&&(0,y.tq)())return null;var u=(0,y.VQ)(o);return(0,A.jsxs)("button",{id:"wc-button",onClick:t,tabIndex:"0","aria-label":s||"minimizing"===i?u.openChat:u.closeChat,className:j()("wc-button",{"wc-button-anim":a},{"wc-button-minimized":s},{"wc-button-regular":!s}),children:[s&&r&&r>0?(0,A.jsx)("div",{className:"wc-new-messages-counter",style:{display:"none"},children:r}):(0,A.jsx)("div",{}),a&&(0,A.jsx)("div",{className:j()("wc-button-1",{"wc-button-1-anim":a})}),s&&(0,A.jsx)("div",{className:j()("wc-button-2",{"wc-button-2-anim":s})}),(a||s)&&(0,A.jsx)("div",{className:j()("wc-button-3",{"wc-button-3-anim":!a&&s})})]},"wc-button")},V=(0,o.memo)(H);function Y(e,t){for(var n=0;ny},M=function(e){return function(e){var t=g[e].b;return m+t+b}(e)>w},A=function(e){return function(e){return S(e)<0}(e)||O(e)||function(e){return T(e)<0}(e)||M(e)},C=function(e){return!A(e)},R=["top","bottom","left","right"],D=[],P=0;P<4;P++){var I=R[P];C(I)&&D.push(I)}var j,L=!1,N=o!==r;return C(o)&&N?(L=!0,j=o):D.length>0&&N&&A(o)&&A(r)&&(L=!0,j=D[0]),L?{isNewState:!0,newState:{place:j}}:{isNewState:!1,position:{left:parseInt(S(r)-k,10),top:parseInt(T(r)-E,10)}}}var be,ye,we,xe=function(e){var t=e.getBoundingClientRect(),n=t.height,r=t.width;return{height:parseInt(n,10),width:parseInt(r,10)}},Ee=function(e,t,n){var r=t.getBoundingClientRect(),o=r.top,i=r.left,a=xe(t),s=a.width,u=a.height;return"float"===n?{mouseX:e.clientX,mouseY:e.clientY}:{mouseX:i+s/2,mouseY:o+u/2}},ke=function(e,t,n,r,o){var i,a,s,u;return"float"===e?(i={l:-r/2,r:r/2,t:-(o+3+2),b:-3},s={l:-r/2,r:r/2,t:15,b:o+3+2+12},u={l:-(r+3+2),r:-3,t:-o/2,b:o/2},a={l:3,r:r+3+2,t:-o/2,b:o/2}):"solid"===e&&(i={l:-r/2,r:r/2,t:-(n/2+o+2),b:-n/2},s={l:-r/2,r:r/2,t:n/2,b:n/2+o+2},u={l:-(r+t/2+2),r:-t/2,t:-o/2,b:o/2},a={l:t/2,r:r+t/2+2,t:-o/2,b:o/2}),{top:i,bottom:s,left:u,right:a}},Se=function(e){var t=0,n=0;for(var r in"[object String]"===Object.prototype.toString.apply(e)&&(e=JSON.parse(e.toString().replace(/\'/g,'"'))),e)"top"===r?n-=parseInt(e[r],10):"bottom"===r?n+=parseInt(e[r],10):"left"===r?t-=parseInt(e[r],10):"right"===r&&(t+=parseInt(e[r],10));return{extraOffset_X:t,extraOffset_Y:n}},Te=function(e){for(var t=e;t&&"none"===window.getComputedStyle(t).getPropertyValue("transform");)t=t.parentElement;return{parentTop:t&&t.getBoundingClientRect().top||0,parentLeft:t&&t.getBoundingClientRect().left||0}};function Oe(e,t,n,r){if(t)return t;if(void 0!==n&&null!==n)return n;if(null===n)return null;var i=//;return r&&"false"!==r&&i.test(e)?e.split(i).map((function(e,t){return o.createElement("span",{key:t,className:"multi-line"},e)})):e}function Me(e){var t={};return Object.keys(e).filter((function(e){return/(^aria-\w+$|^role$)/.test(e)})).forEach((function(n){t[n]=e[n]})),t}!function(e){if(e&&"undefined"!==typeof window){var t=document.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t)}}('.__react_component_tooltip {\n border-radius: 3px;\n display: inline-block;\n font-size: 13px;\n left: -999em;\n opacity: 0;\n padding: 8px 21px;\n position: fixed;\n pointer-events: none;\n transition: opacity 0.3s ease-out;\n top: -999em;\n visibility: hidden;\n z-index: 999;\n}\n.__react_component_tooltip.allow_hover, .__react_component_tooltip.allow_click {\n pointer-events: auto;\n}\n.__react_component_tooltip:before, .__react_component_tooltip:after {\n content: "";\n width: 0;\n height: 0;\n position: absolute;\n}\n.__react_component_tooltip.show {\n opacity: 0.9;\n margin-top: 0px;\n margin-left: 0px;\n visibility: visible;\n}\n.__react_component_tooltip.type-dark {\n color: #fff;\n background-color: #222;\n}\n.__react_component_tooltip.type-dark.place-top:after {\n border-top-color: #222;\n border-top-style: solid;\n border-top-width: 6px;\n}\n.__react_component_tooltip.type-dark.place-bottom:after {\n border-bottom-color: #222;\n border-bottom-style: solid;\n border-bottom-width: 6px;\n}\n.__react_component_tooltip.type-dark.place-left:after {\n border-left-color: #222;\n border-left-style: solid;\n border-left-width: 6px;\n}\n.__react_component_tooltip.type-dark.place-right:after {\n border-right-color: #222;\n border-right-style: solid;\n border-right-width: 6px;\n}\n.__react_component_tooltip.type-dark.border {\n border: 1px solid #fff;\n}\n.__react_component_tooltip.type-dark.border.place-top:before {\n border-top: 8px solid #fff;\n}\n.__react_component_tooltip.type-dark.border.place-bottom:before {\n border-bottom: 8px solid #fff;\n}\n.__react_component_tooltip.type-dark.border.place-left:before {\n border-left: 8px solid #fff;\n}\n.__react_component_tooltip.type-dark.border.place-right:before {\n border-right: 8px solid #fff;\n}\n.__react_component_tooltip.type-success {\n color: #fff;\n background-color: #8DC572;\n}\n.__react_component_tooltip.type-success.place-top:after {\n border-top-color: #8DC572;\n border-top-style: solid;\n border-top-width: 6px;\n}\n.__react_component_tooltip.type-success.place-bottom:after {\n border-bottom-color: #8DC572;\n border-bottom-style: solid;\n border-bottom-width: 6px;\n}\n.__react_component_tooltip.type-success.place-left:after {\n border-left-color: #8DC572;\n border-left-style: solid;\n border-left-width: 6px;\n}\n.__react_component_tooltip.type-success.place-right:after {\n border-right-color: #8DC572;\n border-right-style: solid;\n border-right-width: 6px;\n}\n.__react_component_tooltip.type-success.border {\n border: 1px solid #fff;\n}\n.__react_component_tooltip.type-success.border.place-top:before {\n border-top: 8px solid #fff;\n}\n.__react_component_tooltip.type-success.border.place-bottom:before {\n border-bottom: 8px solid #fff;\n}\n.__react_component_tooltip.type-success.border.place-left:before {\n border-left: 8px solid #fff;\n}\n.__react_component_tooltip.type-success.border.place-right:before {\n border-right: 8px solid #fff;\n}\n.__react_component_tooltip.type-warning {\n color: #fff;\n background-color: #F0AD4E;\n}\n.__react_component_tooltip.type-warning.place-top:after {\n border-top-color: #F0AD4E;\n border-top-style: solid;\n border-top-width: 6px;\n}\n.__react_component_tooltip.type-warning.place-bottom:after {\n border-bottom-color: #F0AD4E;\n border-bottom-style: solid;\n border-bottom-width: 6px;\n}\n.__react_component_tooltip.type-warning.place-left:after {\n border-left-color: #F0AD4E;\n border-left-style: solid;\n border-left-width: 6px;\n}\n.__react_component_tooltip.type-warning.place-right:after {\n border-right-color: #F0AD4E;\n border-right-style: solid;\n border-right-width: 6px;\n}\n.__react_component_tooltip.type-warning.border {\n border: 1px solid #fff;\n}\n.__react_component_tooltip.type-warning.border.place-top:before {\n border-top: 8px solid #fff;\n}\n.__react_component_tooltip.type-warning.border.place-bottom:before {\n border-bottom: 8px solid #fff;\n}\n.__react_component_tooltip.type-warning.border.place-left:before {\n border-left: 8px solid #fff;\n}\n.__react_component_tooltip.type-warning.border.place-right:before {\n border-right: 8px solid #fff;\n}\n.__react_component_tooltip.type-error {\n color: #fff;\n background-color: #BE6464;\n}\n.__react_component_tooltip.type-error.place-top:after {\n border-top-color: #BE6464;\n border-top-style: solid;\n border-top-width: 6px;\n}\n.__react_component_tooltip.type-error.place-bottom:after {\n border-bottom-color: #BE6464;\n border-bottom-style: solid;\n border-bottom-width: 6px;\n}\n.__react_component_tooltip.type-error.place-left:after {\n border-left-color: #BE6464;\n border-left-style: solid;\n border-left-width: 6px;\n}\n.__react_component_tooltip.type-error.place-right:after {\n border-right-color: #BE6464;\n border-right-style: solid;\n border-right-width: 6px;\n}\n.__react_component_tooltip.type-error.border {\n border: 1px solid #fff;\n}\n.__react_component_tooltip.type-error.border.place-top:before {\n border-top: 8px solid #fff;\n}\n.__react_component_tooltip.type-error.border.place-bottom:before {\n border-bottom: 8px solid #fff;\n}\n.__react_component_tooltip.type-error.border.place-left:before {\n border-left: 8px solid #fff;\n}\n.__react_component_tooltip.type-error.border.place-right:before {\n border-right: 8px solid #fff;\n}\n.__react_component_tooltip.type-info {\n color: #fff;\n background-color: #337AB7;\n}\n.__react_component_tooltip.type-info.place-top:after {\n border-top-color: #337AB7;\n border-top-style: solid;\n border-top-width: 6px;\n}\n.__react_component_tooltip.type-info.place-bottom:after {\n border-bottom-color: #337AB7;\n border-bottom-style: solid;\n border-bottom-width: 6px;\n}\n.__react_component_tooltip.type-info.place-left:after {\n border-left-color: #337AB7;\n border-left-style: solid;\n border-left-width: 6px;\n}\n.__react_component_tooltip.type-info.place-right:after {\n border-right-color: #337AB7;\n border-right-style: solid;\n border-right-width: 6px;\n}\n.__react_component_tooltip.type-info.border {\n border: 1px solid #fff;\n}\n.__react_component_tooltip.type-info.border.place-top:before {\n border-top: 8px solid #fff;\n}\n.__react_component_tooltip.type-info.border.place-bottom:before {\n border-bottom: 8px solid #fff;\n}\n.__react_component_tooltip.type-info.border.place-left:before {\n border-left: 8px solid #fff;\n}\n.__react_component_tooltip.type-info.border.place-right:before {\n border-right: 8px solid #fff;\n}\n.__react_component_tooltip.type-light {\n color: #222;\n background-color: #fff;\n}\n.__react_component_tooltip.type-light.place-top:after {\n border-top-color: #fff;\n border-top-style: solid;\n border-top-width: 6px;\n}\n.__react_component_tooltip.type-light.place-bottom:after {\n border-bottom-color: #fff;\n border-bottom-style: solid;\n border-bottom-width: 6px;\n}\n.__react_component_tooltip.type-light.place-left:after {\n border-left-color: #fff;\n border-left-style: solid;\n border-left-width: 6px;\n}\n.__react_component_tooltip.type-light.place-right:after {\n border-right-color: #fff;\n border-right-style: solid;\n border-right-width: 6px;\n}\n.__react_component_tooltip.type-light.border {\n border: 1px solid #222;\n}\n.__react_component_tooltip.type-light.border.place-top:before {\n border-top: 8px solid #222;\n}\n.__react_component_tooltip.type-light.border.place-bottom:before {\n border-bottom: 8px solid #222;\n}\n.__react_component_tooltip.type-light.border.place-left:before {\n border-left: 8px solid #222;\n}\n.__react_component_tooltip.type-light.border.place-right:before {\n border-right: 8px solid #222;\n}\n.__react_component_tooltip.place-top {\n margin-top: -10px;\n}\n.__react_component_tooltip.place-top:before {\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n bottom: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-top:after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -6px;\n left: 50%;\n margin-left: -8px;\n}\n.__react_component_tooltip.place-bottom {\n margin-top: 10px;\n}\n.__react_component_tooltip.place-bottom:before {\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n top: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-bottom:after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -6px;\n left: 50%;\n margin-left: -8px;\n}\n.__react_component_tooltip.place-left {\n margin-left: -10px;\n}\n.__react_component_tooltip.place-left:before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n right: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip.place-left:after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n right: -6px;\n top: 50%;\n margin-top: -4px;\n}\n.__react_component_tooltip.place-right {\n margin-left: 10px;\n}\n.__react_component_tooltip.place-right:before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n left: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip.place-right:after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n left: -6px;\n top: 50%;\n margin-top: -4px;\n}\n.__react_component_tooltip .multi-line {\n display: block;\n padding: 2px 0px;\n text-align: center;\n}');var Ae,Ce=function(e){e.hide=function(e){fe(le.HIDE,{target:e})},e.rebuild=function(){fe(le.REBUILD)},e.show=function(e){fe(le.SHOW,{target:e})},e.prototype.globalRebuild=function(){this.mount&&(this.unbindListener(),this.bindListener())},e.prototype.globalShow=function(e){if(this.mount){var t={currentTarget:e.detail.target};this.showTooltip(t,!0)}},e.prototype.globalHide=function(e){if(this.mount){var t=!!(e&&e.detail&&e.detail.target);this.hideTooltip({currentTarget:t&&e.detail.target},t)}}}(be=function(e){e.prototype.bindWindowEvents=function(e){window.removeEventListener(le.HIDE,this.globalHide),window.addEventListener(le.HIDE,this.globalHide,!1),window.removeEventListener(le.REBUILD,this.globalRebuild),window.addEventListener(le.REBUILD,this.globalRebuild,!1),window.removeEventListener(le.SHOW,this.globalShow),window.addEventListener(le.SHOW,this.globalShow,!1),e&&(window.removeEventListener("resize",this.onWindowResize),window.addEventListener("resize",this.onWindowResize,!1))},e.prototype.unbindWindowEvents=function(){window.removeEventListener(le.HIDE,this.globalHide),window.removeEventListener(le.REBUILD,this.globalRebuild),window.removeEventListener(le.SHOW,this.globalShow),window.removeEventListener("resize",this.onWindowResize)},e.prototype.onWindowResize=function(){this.mount&&this.hideTooltip()}}(be=function(e){e.prototype.isCustomEvent=function(e){return this.state.event||!!e.getAttribute("data-event")},e.prototype.customBindListener=function(e){var t=this,n=this.state,r=n.event,o=n.eventOff,i=e.getAttribute("data-event")||r,a=e.getAttribute("data-event-off")||o;i.split(" ").forEach((function(n){e.removeEventListener(n,pe.get(e,n));var r=de.bind(t,a);pe.set(e,n,r),e.addEventListener(n,r,!1)})),a&&a.split(" ").forEach((function(n){e.removeEventListener(n,t.hideTooltip),e.addEventListener(n,t.hideTooltip,!1)}))},e.prototype.customUnbindListener=function(e){var t=this.state,n=t.event,r=t.eventOff,o=n||e.getAttribute("data-event"),i=r||e.getAttribute("data-event-off");e.removeEventListener(o,pe.get(e,n)),i&&e.removeEventListener(i,this.hideTooltip)}}(be=function(e){e.prototype.isCapture=function(e){return e&&"true"===e.getAttribute("data-iscapture")||this.props.isCapture||!1}}(be=function(e){e.prototype.getEffect=function(e){return e.getAttribute("data-effect")||this.props.effect||"float"}}(be=function(e){e.prototype.isBodyMode=function(){return!!this.props.bodyMode},e.prototype.bindBodyListener=function(e){var t=this,n=this.state,r=n.event,o=n.eventOff,i=n.possibleCustomEvents,a=n.possibleCustomEventsOff,s=_e(),u=ge(e,"data-event"),c=ge(e,"data-event-off");null!=r&&(u[r]=!0),null!=o&&(c[o]=!0),i.split(" ").forEach((function(e){return u[e]=!0})),a.split(" ").forEach((function(e){return c[e]=!0})),this.unbindBodyListener(s);var l=this.bodyModeListeners={};for(var f in null==r&&(l.mouseover=me.bind(this,this.showTooltip,{}),l.mousemove=me.bind(this,this.updateTooltip,{respectEffect:!0}),l.mouseout=me.bind(this,this.hideTooltip,{})),u)l[f]=me.bind(this,(function(e){var n=e.currentTarget.getAttribute("data-event-off")||o;de.call(t,n,e)}),{customEvent:!0});for(var d in c)l[d]=me.bind(this,this.hideTooltip,{customEvent:!0});for(var h in l)s.addEventListener(h,l[h])},e.prototype.unbindBodyListener=function(e){e=e||_e();var t=this.bodyModeListeners;for(var n in t)e.removeEventListener(n,t[n])}}((we=ye=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Q(this,Z(t).call(this,e))).state={place:e.place||"top",desiredPlace:e.place||"top",type:"dark",effect:"float",show:!1,border:!1,offset:{},extraClass:"",html:!1,delayHide:0,delayShow:0,event:e.event||null,eventOff:e.eventOff||null,currentEvent:null,currentTarget:null,ariaProps:Me(e),isEmptyTip:!1,disable:!1,possibleCustomEvents:e.possibleCustomEvents||"",possibleCustomEventsOff:e.possibleCustomEventsOff||"",originTooltip:null,isMultiline:!1},n.bind(["showTooltip","updateTooltip","hideTooltip","hideTooltipOnScroll","getTooltipContent","globalRebuild","globalShow","globalHide","onWindowResize","mouseOnToolTip"]),n.mount=!0,n.delayShowLoop=null,n.delayHideLoop=null,n.delayReshow=null,n.intervalUpdateContent=null,n}var n,r,i;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$(e,t)}(t,e),n=t,r=[{key:"bind",value:function(e){var t=this;e.forEach((function(e){t[e]=t[e].bind(t)}))}},{key:"componentDidMount",value:function(){var e=this.props,t=(e.insecure,e.resizeHide);this.bindListener(),this.bindWindowEvents(t)}},{key:"componentWillUnmount",value:function(){this.mount=!1,this.clearTimer(),this.unbindListener(),this.removeScrollListener(),this.unbindWindowEvents()}},{key:"mouseOnToolTip",value:function(){return!(!this.state.show||!this.tooltipRef)&&(this.tooltipRef.matches||(this.tooltipRef.msMatchesSelector?this.tooltipRef.matches=this.tooltipRef.msMatchesSelector:this.tooltipRef.matches=this.tooltipRef.mozMatchesSelector),this.tooltipRef.matches(":hover"))}},{key:"getTargetArray",value:function(e){var t;if(e){var n=e.replace(/\\/g,"\\\\").replace(/"/g,'\\"');t=document.querySelectorAll('[data-tip][data-for="'.concat(n,'"]'))}else t=document.querySelectorAll("[data-tip]:not([data-for])");return function(e){var t=e.length;return e.hasOwnProperty?Array.prototype.slice.call(e):new Array(t).fill().map((function(t){return e[t]}))}(t)}},{key:"bindListener",value:function(){var e=this,t=this.props,n=t.id,r=t.globalEventOff,o=t.isCapture,i=this.getTargetArray(n);i.forEach((function(t){null===t.getAttribute("currentItem")&&t.setAttribute("currentItem","false"),e.unbindBasicListener(t),e.isCustomEvent(t)&&e.customUnbindListener(t)})),this.isBodyMode()?this.bindBodyListener(i):i.forEach((function(t){var n=e.isCapture(t),r=e.getEffect(t);e.isCustomEvent(t)?e.customBindListener(t):(t.addEventListener("mouseenter",e.showTooltip,n),"float"===r&&t.addEventListener("mousemove",e.updateTooltip,n),t.addEventListener("mouseleave",e.hideTooltip,n))})),r&&(window.removeEventListener(r,this.hideTooltip),window.addEventListener(r,this.hideTooltip,o)),this.bindRemovalTracker()}},{key:"unbindListener",value:function(){var e=this,t=this.props,n=t.id,r=t.globalEventOff;this.isBodyMode()?this.unbindBodyListener():this.getTargetArray(n).forEach((function(t){e.unbindBasicListener(t),e.isCustomEvent(t)&&e.customUnbindListener(t)})),r&&window.removeEventListener(r,this.hideTooltip),this.unbindRemovalTracker()}},{key:"unbindBasicListener",value:function(e){var t=this.isCapture(e);e.removeEventListener("mouseenter",this.showTooltip,t),e.removeEventListener("mousemove",this.updateTooltip,t),e.removeEventListener("mouseleave",this.hideTooltip,t)}},{key:"getTooltipContent",value:function(){var e,t=this.props,n=t.getContent,r=t.children;return n&&(e=Array.isArray(n)?n[0]&&n[0](this.state.originTooltip):n(this.state.originTooltip)),Oe(this.state.originTooltip,r,e,this.state.isMultiline)}},{key:"isEmptyTip",value:function(e){return"string"===typeof e&&""===e||null===e}},{key:"showTooltip",value:function(e,t){if(!t||this.getTargetArray(this.props.id).some((function(t){return t===e.currentTarget}))){var n=this.props,r=n.multiline,o=n.getContent,i=e.currentTarget.getAttribute("data-tip"),a=e.currentTarget.getAttribute("data-multiline")||r||!1,s=e instanceof window.FocusEvent||t,u=!0;e.currentTarget.getAttribute("data-scroll-hide")?u="true"===e.currentTarget.getAttribute("data-scroll-hide"):null!=this.props.scrollHide&&(u=this.props.scrollHide);var c=e.currentTarget.getAttribute("data-place")||this.props.place||"top",l=s?"solid":this.getEffect(e.currentTarget),f=e.currentTarget.getAttribute("data-offset")||this.props.offset||{},d=ve(e,e.currentTarget,this.tooltipRef,c,c,l,f);d.position&&this.props.overridePosition&&(d.position=this.props.overridePosition(d.position,e.currentTarget,this.tooltipRef,c,c,l,f));var h=d.isNewState?d.newState.place:c;this.clearTimer();var p=e.currentTarget,m=this.state.show?p.getAttribute("data-delay-update")||this.props.delayUpdate:0,g=this,_=function(){g.setState({originTooltip:i,isMultiline:a,desiredPlace:c,place:h,type:p.getAttribute("data-type")||g.props.type||"dark",effect:l,offset:f,html:p.getAttribute("data-html")?"true"===p.getAttribute("data-html"):g.props.html||!1,delayShow:p.getAttribute("data-delay-show")||g.props.delayShow||0,delayHide:p.getAttribute("data-delay-hide")||g.props.delayHide||0,delayUpdate:p.getAttribute("data-delay-update")||g.props.delayUpdate||0,border:p.getAttribute("data-border")?"true"===p.getAttribute("data-border"):g.props.border||!1,extraClass:p.getAttribute("data-class")||g.props.class||g.props.className||"",disable:p.getAttribute("data-tip-disable")?"true"===p.getAttribute("data-tip-disable"):g.props.disable||!1,currentTarget:p},(function(){u&&g.addScrollListener(g.state.currentTarget),g.updateTooltip(e),o&&Array.isArray(o)&&(g.intervalUpdateContent=setInterval((function(){if(g.mount){var e=g.props.getContent,t=Oe(i,"",e[0](),a),n=g.isEmptyTip(t);g.setState({isEmptyTip:n}),g.updatePosition()}}),o[1]))}))};m?this.delayReshow=setTimeout(_,m):_()}}},{key:"updateTooltip",value:function(e){var t=this,n=this.state,r=n.delayShow,o=n.disable,i=this.props.afterShow,a=this.getTooltipContent(),s=parseInt(r,10),u=e.currentTarget||e.target;if(!this.mouseOnToolTip()&&!this.isEmptyTip(a)&&!o){var c=function(){if(Array.isArray(a)&&a.length>0||a){var n=!t.state.show;t.setState({currentEvent:e,currentTarget:u,show:!0},(function(){t.updatePosition(),n&&i&&i(e)}))}};clearTimeout(this.delayShowLoop),r?this.delayShowLoop=setTimeout(c,s):c()}}},{key:"listenForTooltipExit",value:function(){this.state.show&&this.tooltipRef&&this.tooltipRef.addEventListener("mouseleave",this.hideTooltip)}},{key:"removeListenerForTooltipExit",value:function(){this.state.show&&this.tooltipRef&&this.tooltipRef.removeEventListener("mouseleave",this.hideTooltip)}},{key:"hideTooltip",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{isScroll:!1},o=this.state.disable,i=r.isScroll,a=i?0:this.state.delayHide,s=this.props.afterHide,u=this.getTooltipContent();if(this.mount&&!this.isEmptyTip(u)&&!o){if(t){var c=this.getTargetArray(this.props.id),l=c.some((function(t){return t===e.currentTarget}));if(!l||!this.state.show)return}var f=function(){var t=n.state.show;n.mouseOnToolTip()?n.listenForTooltipExit():(n.removeListenerForTooltipExit(),n.setState({show:!1},(function(){n.removeScrollListener(),t&&s&&s(e)})))};this.clearTimer(),a?this.delayHideLoop=setTimeout(f,parseInt(a,10)):f()}}},{key:"hideTooltipOnScroll",value:function(e,t){this.hideTooltip(e,t,{isScroll:!0})}},{key:"addScrollListener",value:function(e){var t=this.isCapture(e);window.addEventListener("scroll",this.hideTooltipOnScroll,t)}},{key:"removeScrollListener",value:function(){window.removeEventListener("scroll",this.hideTooltipOnScroll)}},{key:"updatePosition",value:function(){var e=this,t=this.state,n=t.currentEvent,r=t.currentTarget,o=t.place,i=t.desiredPlace,a=t.effect,s=t.offset,u=this.tooltipRef,c=ve(n,r,u,o,i,a,s);if(c.position&&this.props.overridePosition&&(c.position=this.props.overridePosition(c.position,n,r,u,o,i,a,s)),c.isNewState)return this.setState(c.newState,(function(){e.updatePosition()}));u.style.left=c.position.left+"px",u.style.top=c.position.top+"px"}},{key:"clearTimer",value:function(){clearTimeout(this.delayShowLoop),clearTimeout(this.delayHideLoop),clearTimeout(this.delayReshow),clearInterval(this.intervalUpdateContent)}},{key:"render",value:function(){var e=this,n=this.state,r=n.extraClass,i=n.html,a=n.ariaProps,s=n.disable,u=this.getTooltipContent(),c=this.isEmptyTip(u),l="__react_component_tooltip"+(!this.state.show||s||c?"":" show")+(this.state.border?" border":"")+" place-".concat(this.state.place)+" type-".concat(this.state.type)+(this.props.delayUpdate?" allow_hover":"")+(this.props.clickable?" allow_click":""),f=this.props.wrapper;t.supportedWrappers.indexOf(f)<0&&(f=t.defaultProps.wrapper);var d=[l,r].filter(Boolean).join(" ");return i?o.createElement(f,G({className:d,id:this.props.id,ref:function(t){return e.tooltipRef=t}},a,{"data-id":"tooltip",dangerouslySetInnerHTML:{__html:u}})):o.createElement(f,G({className:d,id:this.props.id},a,{ref:function(t){return e.tooltipRef=t},"data-id":"tooltip"}),u)}}],i=[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.ariaProps,r=Me(e);return Object.keys(r).some((function(e){return r[e]!==n[e]}))?function(e){for(var t=1;t0&&e[0].length>2})).forEach((function(e){return s[e[0]]=e[1]}));Object.keys(s).length>0&&(i.definedStyles[r]=s)}}))}));var r=Object.values(n).filter((function(e){return!e.href&&e.cssRules})).filter((function(e){return Object.values(e.cssRules).find((function(e){return":root"===e.selectorText}))}))[0],o=[],a=r?null===(e=Object.values(r.cssRules).find((function(e){return":root"===e.selectorText})))||void 0===e?void 0:e.style:{};return Object.values(a||{}).forEach((function(e){o.push("var(".concat(e,")"));var n=a.getPropertyValue(e);e&&n&&(t[e]=n.replace(/["']/g,"").trim(),"true"===t[e]?t[e]=!0:"false"===t[e]&&(t[e]=!1))})),Object.values(n).filter((function(e){return!e.href&&e.cssRules})).forEach((function(e){var t=Object.values(e.cssRules).filter(Boolean),n=function(e){var n=t.find((function(t){return t.selectorText===e}));if(!n)return"continue";Object.entries(Be[e]).forEach((function(e){var t=l(e,2),r=t[0],i=t[1];i.includes("var(")&&!o.find((function(e){return e===i}))||n&&n.style.setProperty(r,i)}))};for(var r in Be)n(r)})),t},i.start=function(){var e=i.definedStyles[".bm-webchat-entries"]||{};i.chatFrameStyle=i.definedStyles[".wc-chat-frame"]||{},e.maxHeight&&(i.maxEntriesHeight=parseInt(e.maxHeight.match(/(\d*)px/)[1],10)),e["max-height"]&&(i.maxEntriesHeight=parseInt(e["max-height"].match(/(\d*)px/)[1],10)),e.height&&(i.entriesHeight=e.height),setInterval(i.checkShowMessages,300),setTimeout(i.forceScrollToBottom,1e3),!(0,y.qx)()&&!(0,y.HM)()&&i.setFocusOnInput(),x.HX(),document.addEventListener("keyup",(function(e){var t=e.key||e.keyCode;"Escape"!==t&&"Esc"!==t&&27!==t||x.oU()}))},i.checkAvatarPositionAndMoreItemsToScroll=function(e){var t;null!==(t=i.moreItemsOnScrollRef.current)&&void 0!==t&&t.style&&(i.moreItemsOnScrollRef.current.style.visibility=i.isScrollAtBottom()?"hidden":"visible"),i.isScrollAtBottom()&&i.setState({newMessagesCount:0});var n=i.state.showingMessages,r=P().findLast(n,(function(e){return"me"===e.FROM&&(e.MESSAGE||"").trim().length})),o=null===r||void 0===r?void 0:r._id_,a=document.getElementById(o);if(a){var s=document.getElementById("bm-sending-avatar");if(!s)return;var u=a.offsetTop+a.getBoundingClientRect().height+s.getBoundingClientRect().height-18,c=e||s.offsetTop>u;c&&(s.style.transition="none"),s.style.top="".concat(u,"px"),c&&(s.offsetHeight.valueOf(),s.style.removeProperty("transition"))}},i.checkShowMessages=function(){var e=i.state,t=e.showingMessages,n=e.messages,r=P().differenceBy(n,t,"_id_");if(i.state.minimized)i.setState({newMessagesCount:r.length,isBotTyping:!1});else if(!(new Date-i.animatingIncomeMsg<1500||P().isEmpty(r)))if(i.animatingIncomeMsg=new Date,!i.isScrollAtBottom()||P().isEmpty(t)&&r.length>2)i.setState({newMessagesCount:r.length,isBotTyping:!1,showingMessages:n});else{var o=P().head(r);n.length1,showingMessages:[].concat((0,u.Z)(t),[o])}),"me"!==o.FROM&&i.setState({isBotTyping:!1})}},i.forceScrollToBottom=function(){i.stickToBottom=!0,i.setState({showMoreItemsScroll:!1}),i.scrollToBottom()},i.scrollToBottom=P().debounce((function(){var e=i.scrollableDivRef.current;e&&i.stickToBottom&&(e.scrollToBottom(),i.setState({newMessagesCount:0}),i.checkAvatarPositionAndMoreItemsToScroll())}),200),i.onClickReplyMessage=function(e){var t,n;i.setState({isReplyingMessage:!0,messageToReply:e});var r=null===(t=i.footerRef)||void 0===t||null===(n=t.current)||void 0===n?void 0:n.textarea;r&&r.focus()},i.onDismissReply=function(){return i.setState({isReplyingMessage:!1,messageToReply:null})},i.switchRecording=function(){var e;i.state.recordingAudio?(e=function(e){i.setState({recordingAudio:!1}),x.cT(e)},d.stopRecording((function(){var t=d.getBlob();d.destroy(),f.stop(),f=null,d=null,e&&e(t)}))):function(e,t){S.apply(this,arguments)}((function(e){e&&i.setState({recordingAudio:!0})})),i.scrollToBottom()},i.onImageLoaded=function(){i.scrollToBottom(),i.checkAvatarPositionAndMoreItemsToScroll()},i.changeMessageFocus=function(e){var t,n=i.state,r=n.focusMessageIndex,o=n.showingMessages;if("ArrowUp"===e.key&&r>0?t=r-1:"ArrowDown"===e.key&&rt&&i.prevScroll.scrollTop>n&&(i.stickToBottom=!1,i.setState({showMoreItemsScroll:!0})),!i.stickToBottom&&r&&(i.stickToBottom=!0,i.setState({showMoreItemsScroll:!1})),i.prevScroll={top:t,scrollTop:n}},i.onChangeVisiblePopup=function(e){i.setState({visiblePopup:e}),i.forceScrollToBottom()},i.animatingIncomeMsg=new Date,i.animatingAvatar=!1,i.definedStyles={},i.entriesHeight=230,i.maxEntriesHeight=640,i.stickToBottom=!0,i.prevScroll={top:0,scrollTop:0},i.footerRef=o.createRef(),i.scrollableDivRef=o.createRef(),i.moreItemsOnScrollRef=o.createRef(),i.state=(0,a.Z)((0,a.Z)({},x.aY()),{},{newMessagesCount:0,showingMessages:[],configuration:i.getStyleConfiguration(),showMoreItemsScroll:!1,focusMessageIndex:null,botId:null,isReplyingMessage:!1,messageToReply:null,replyFooterHeight:0}),i}return(0,m.Z)(n,[{key:"componentDidMount",value:function(){var e=(0,s.Z)(b().mark((function e(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x.j2(this),window.hasParentAccess){e.next=4;break}return window.parent.postMessage({messageType:"ready"},"*"),e.abrupt("return");case 4:return e.next=6,x.$j();case 6:this.start();case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"componentDidUpdate",value:function(e,t){var n=this.state,r=n.messages,o=n.showingMessages,i=n.isBotTyping,a=n.uploadProgress;if(t.messages.length>0&&r.length>0&&t.messages.length>r.length&&this.checkShowMessages(),t.showingMessages!==o){var s;this.scrollToBottom(),this.checkAvatarPositionAndMoreItemsToScroll();var u=null===(s=P().findLast(r,(function(e){return"me"===e.FROM})))||void 0===s?void 0:s.BOT_ID;u&&t.botId!==u&&this.setState({botId:u})}t.isBotTyping!==i&&this.scrollToBottom(),!t.uploadProgress&&a&&this.forceScrollToBottom()}},{key:"getContainerState",value:function(){return this.state}},{key:"setFocusOnInput",value:function(){var e=document.getElementById("wc-textarea");e&&e.focus()}},{key:"hasImage",value:function(e){return e&&(!P().isEmpty(e.imageURL)||!P().isEmpty(e.IMAGES_URLS))}},{key:"setContainerState",value:function(e){this.setState(e)}},{key:"isScrollAtBottom",value:function(){var e=this.scrollableDivRef.current;return!e||e.getScrollHeight()-e.getClientHeight()-e.getScrollTop()<100}},{key:"renderTextMessage",value:function(e,t,n,r){var o,i,a,s=this,u=this.state,c=u.configuration,l=u.addOperatorNamePrefixToResponses,f=l&&"Bot"!==e.FROM_NAME&&"User"!==e.FROM_NAME,d=l&&(c["--bm-wc-config-show-operator-avatar"]||!1),h=c["--bm-wc-config-footer-always-open"]||!1;if(t){var p,m=(null===(p=e.RENDERING_INFO)||void 0===p?void 0:p.attachmentCaption)||!["__file__","__image__"].includes(e.MESSAGE)&&e.MESSAGE||(0,y.Ry)(e.FILES_URLS[0].replace(/^.*[\\/]/,""));a=(0,A.jsxs)("a",{href:e.FILES_URLS[0],target:"_blank",rel:"noopener noreferrer",download:m,className:"bm-webchat-text-entry-download",children:[(0,A.jsx)("div",{className:"bm-webchat-text-entry-download-icon",children:"\xa0"}),m.length>30?m.substring(0,29)+"..":m]})}else if("{"===e.MESSAGE[0])try{var g=JSON.parse(e.MESSAGE),_=g.button||g.intent||(0,y.DE)("button",this.state.locale);if("{"===_[0]){var v=JSON.parse(_);_=v.button||v.intent||(0,y.DE)("button",this.state.locale)}a=(0,A.jsxs)("div",{className:"bm-webchat-rule-message-entry",children:[(0,A.jsx)("div",{className:"bm-webchat-rule-message-entry-icon"}),_]})}catch(w){x.eK(w)}var b=r&&e._id_===r._id_&&n;return a||(a=(0,y.iF)(e.MESSAGE,n?"bm-webchat-link-left":"bm-webchat-link-right",null,null,null===e||void 0===e||null===(o=e.RENDERING_INFO)||void 0===o?void 0:o.replyTo)),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{id:b?"wc-last-platform-message":null,className:n?"bm-webchat-text-entry-left":"bm-webchat-text-entry-right","data-for":"chatcomponent-tooltip","data-tip":(0,y.cq)(e.CREATION_TIME,this.state.locale),children:[n&&f&&(0,A.jsx)("b",{className:"bm-webchat-operator-name",children:(null===(i=e.RENDERING_INFO)||void 0===i?void 0:i.OPERATOR_ALIAS)||e.FROM_NAME}),a,(0,A.jsxs)("div",{className:"bm-webchat-sent-tildes",children:[(0,A.jsx)("span",{className:"bm-webchat-sent-tilde-time",children:Pe()(e.CREATION_TIME).format("hh:mm A")}),!n&&(0,A.jsxs)("div",{className:"bm-webchat-sent-tilde-status",children:[(e.SENT||e.RECEIVED||e.READ)&&(0,A.jsx)("div",{className:"bm-webchat-sent-tilde-".concat(e.READ?"on":"off"," bm-webchat-sent-tilde-right"),children:"\xa0"}),(e.RECEIVED||e.READ)&&(0,A.jsx)("div",{className:"bm-webchat-sent-tilde-".concat(e.READ?"on":"off"," bm-webchat-sent-tilde-left"),children:"\xa0"})]})]},"tildes-"+e._id_)]}),d&&(!n||n&&!b)&&(0,A.jsx)(Le,{isFromBot:n,operatorId:e.OPERATOR_ID}),n&&h&&(0,A.jsx)("div",{className:"bm-webchat-reply-button",onClick:function(){return s.onClickReplyMessage(e)},children:(0,A.jsx)("div",{className:"bm-webchat-reply-button-image"})})]})}},{key:"getSpec",value:function(e){var t="me"!==e.FROM,n=this.hasImage(e),r=P().get(e,"title","").trim().length>0||P().get(e,"subTitle","").trim().length>0||"__image__"!==P().get(e,"MESSAGE","")&&P().get(e,"MESSAGE","").trim().length>0,o=!P().isEmpty(e.ITEMS),i=(e.OPTIONS||e.options||[]).length,a=i>0&&!e.HAS_QUICK_REPLIES,s=!P().isEmpty(e.FILES_URLS),u=!P().isEmpty(e.AUDIOS_URLS),c=!P().isEmpty(e.VIDEOS_URLS),l=n||r||o||s||u||c||a,f=e.OPERATOR_ID,d=n&&1===e.IMAGES_URLS.length&&e.IMAGES_URLS[0].includes("851557_369239266556155_759568595_n.png");return{hasImage:n,hasText:r,hasItems:o,optionsCount:i,hasOptions:a,hasFilesUrls:s,hasAudioUrls:u,hasVideoUrls:c,hasOnlyQuickReplies:!n&&!r&&!o&&!s&&!u&&!c&&e.HAS_QUICK_REPLIES,hasContent:l,isUser:t,sentByHuman:f,isLikeMessage:d}}},{key:"getKey",value:function(e,t){return e._id_+e.MESSAGE+e.title+e.subTitle+e.imageURL+t}},{key:"renderChatEntry",value:function(e,t,n,r,i){var s,u,c=this,l=this.state,f=l.focusMessageIndex,d=l.locale,h=l.configuration,p=this.getSpec(e),m=P().last(n)._id_===e._id_,g=P().find(r,{_id_:e._id_}),_="me"===e.FROM,v=g?(0,y.cq)(e.SESSION_CREATION_TIME,d):null,b=h["--bm-wc-config-vertical-pills"]||!1;e.RENDERING_INFO&&e.RENDERING_INFO.isMdContent||"article"===e.type?u=(0,A.jsx)(Ke,{message:e,locale:d,onToggleFullView:this.checkAvatarPositionAndMoreItemsToScroll,onMount:this.scrollToBottom},e._id_):p.hasItems?u=(0,A.jsx)(He,{message:e,onMount:this.scrollToBottom,sendMessage:x.Zm,getKey:this.getKey},e._id_):p.isLikeMessage?u=this.renderTextMessage((0,a.Z)((0,a.Z)({},e),{},{MESSAGE:"\ud83d\udc4d"}),p.hasFilesUrls,_,i):!p.hasImage||p.hasText||p.hasOptions?p.hasOptions||e.title||e.subTitle||p.hasImage?u=(0,A.jsx)(Ye,{message:e,sendMessage:function(e,t){return x.Zm(e,t)},onMount:this.scrollToBottom,onImageLoaded:this.onImageLoaded},this.getKey(e,t)):e.IS_RECEIPT_MESSAGE?u=(0,A.jsx)(We,{locale:d,inIframe:true,message:e},e._id_):e.IS_SEND_TO_MESSENGER_BUTTON&&"me"===e.FROM?u=(0,A.jsx)(ze,{message:e,locale:d,chatsAreSeenByOperator:this.props.chatsAreSeenByOperator},e._id_):p.hasVideoUrls?u=(0,A.jsxs)("div",{children:[e.MESSAGE&&this.renderTextMessage((0,a.Z)((0,a.Z)({},e),{},{VIDEOS_URLS:null}),p.hasFilesUrls,_,i),(0,A.jsx)("div",{className:"bm-webchat-video-entry",children:(0,A.jsxs)("video",{width:"99%",controls:!0,muted:!0,preload:"auto",style:{marginTop:e.MESSAGE?"7px":"0px"},children:[(0,A.jsx)("source",{src:e.VIDEOS_URLS[0],type:-1!==e.VIDEOS_URLS[0].indexOf("youtube.")?"video/youtube":"video/mp4"}),"Your browser does not support the video tag."]})})]}):p.hasAudioUrls?u=(0,A.jsx)("div",{children:(0,A.jsx)("div",{className:"bm-webchat-audio-entry",children:(0,A.jsxs)("audio",{controlsList:"nodownload",controls:!0,style:{marginTop:e.MESSAGE?"7px":"0px"},children:[(0,A.jsx)("source",{src:e.AUDIOS_URLS[0],type:"audio/mpeg"}),"Your browser does not support the audio tag."]})})}):"VOICE_MEETING_LINK"===(null===(s=e.RENDERING_INFO)||void 0===s?void 0:s.specialType)?u=(0,A.jsx)("div",{className:"bm-webchat-text-entry-left bm-webchat-text-entry-80",children:(0,A.jsx)(Ze,{meetingData:e.RENDERING_INFO.meetingData,locale:d})}):(e.IS_WRITING||e.MESSAGE&&e.MESSAGE.trim().length>0||p.hasFilesUrls)&&(u=this.renderTextMessage(e,p.hasFilesUrls,_,i)):u=(0,A.jsx)(Ve,{inIframe:true,onImageLoaded:this.onImageLoaded,message:e,onMount:this.scrollToBottom},this.getKey(e,t));var w=(0,y.VQ)(d);return(0,A.jsxs)(o.Fragment,{children:[g&&v&&(0,A.jsx)("li",{id:v,className:"bm-webchat-entries-li-session-date",children:v},v),(0,A.jsxs)("li",{id:e._id_,style:{justifyContent:_?"flex-start":"flex-end"},className:"bm-webchat-entries-li",tabIndex:f===t||null==f&&m?1:-1,onFocus:function(){return c.setState({focusMessageIndex:t})},onKeyDown:this.changeMessageFocus,children:[(0,A.jsx)("span",{className:"message-extra-aria","aria-hidden":!1,children:_?w.messageReceived:w.messageSent}),u]},e._id_),m&&e.OPTIONS&&e.OPTIONS.length>0&&e.HAS_QUICK_REPLIES&&(0,A.jsx)("li",{className:"bm-webchat-pills-li",children:(0,A.jsx)(qe,{locale:d,message:e,sendMessage:function(e,t){return x.Zm(e,t)},onMount:this.scrollToBottom,verticalPills:b})},"pill-"+e._id_)]},e._id_)}},{key:"currentPresence",value:function(){var e=this.state,t=e.presenceAlreadyChanged,n=e.minimized,r=e.startsMinimized;return!t&&r&&n?"starts-minimized":n?"minimized":"maximized"}},{key:"render",value:function(){var e,t,n,r=this,o=this.state,i=o.locale,s=o.userId,u=o.business,c=o.showingMessages,l=o.configuration,f=o.presenceChanging,d=o.newMessagesCount,h=o.recordingAudio,p=o.showMoreItemsScroll,m=o.visiblePopup,g=o.hamburger,_=o.suggestionsDataUrl,v=(o.customer,o.hasInputFocus),b=o.isBotTyping,E=o.isReplyingMessage,k=o.messageToReply,S=o.replyFooterHeight,T=o.isTestConsole,O=o.botId,M=o.addOperatorNamePrefixToResponses;if(!u||!s)return null;var R,D=P().uniqBy(c,"SESSION_CREATION_TIME"),I=P().last(c.filter((function(e){return"me"!==e.FROM}))),j=P().findLast(c,(function(e){return"me"===e.FROM&&(e.MESSAGE||"").trim().length})),L=P().get(l,"--bm-wc-config-autohide-scrollbar",!1),N=(null===(e=this.footerRef.current)||void 0===e||null===(t=e.mainDiv)||void 0===t?void 0:t.offsetHeight)+S||0,U=M&&l["--bm-wc-config-show-operator-avatar"],B=this.state.uploadProgress>0?Math.round(100*this.state.uploadProgress)+"%":null,F=this.currentPresence(),z=!f&&("starts-minimized"===F||"minimized"===F),H=d>0,Y=null===j||void 0===j||null===(n=j.RENDERING_INFO)||void 0===n?void 0:n.disableUserInput;R=f?"minimizing"===f?"minimizing-frame":"maximizing-frame":this.state.minimized?"minimizing-frame":"maximizing-frame";var q=l["--bm-wc-config-animation-type"]||"height";R+="-".concat(q," ")+x.we[0];var G=v&&((0,y.qx)()||(0,y.HM)())?{paddingTop:(0,y.cE)()}:void 0;Re.rebuild();var K=l["--bm-wc-config-status-visible"]||!1,Z=l["--bm-wc-config-header-button-visible"]||(0,y.tq)()&&!l["--bm-wc-config-disableMinimizeOnMobile"]&&!l["--bm-wc-config-fullscreen"],$=l["--bm-wc-recording-text"]||"",Q=l["--main-bm-header-text"]||"",J=(0,y.VQ)(i);return(0,A.jsxs)("div",{className:"wc-container",children:[(0,A.jsxs)("div",{id:"wc-chat-frame",style:(0,a.Z)((0,a.Z)({animation:R},G),{},{maxHeight:(0,y.tq)()?"100vh":y.Eg}),className:"wc-chat-frame "+(this.state.minimized?"wc-chat-frame-minimized":"wc-chat-frame-regular"),children:[!z&&(0,A.jsx)(C,{changePresence:this.changePresence,status:(0,y.DE)("online",i),locale:i,isTestConsole:T,showStatus:K,showHeaderButton:Z,botName:Q}),!z&&(0,A.jsxs)(w.$B,{ref:this.scrollableDivRef,className:"bm-webchat-entries bm-wc-fullscreen-responsive-container",autoHide:L,onScrollStop:this.onScrollStop,onWheel:this.onWheel,onScrollFrame:this.onScrollFrame,renderTrackVertical:function(e){var t=Object.assign({},e);return(0,A.jsx)("div",(0,a.Z)({},t))},children:[(0,A.jsxs)("div",{id:"bm-entries-ul",className:"bm-webchat-entries-ul","aria-live":"polite","aria-label":J.conversation,role:"log",children:[(0,A.jsx)(Le,{isLast:!0,isFromBot:!0,operatorId:U&&(null===j||void 0===j?void 0:j.OPERATOR_ID)},"bm-sending-avatar"),c.map((function(e,t){return r.renderChatEntry(e,t,c,D,j)})),I&&b&&(0,A.jsx)("div",{className:"bm-conversational-typing-container",children:(0,A.jsx)(Ne,{})})]}),B&&(0,A.jsxs)("div",{className:"wc-uploading-main",children:[(0,A.jsx)("div",{className:"wc-uploading",children:(0,A.jsx)("div",{style:{width:B},className:"wc-uploading-bar",children:"\xa0"})}),(0,A.jsx)("span",{className:"wc-uploading-text",children:B})]}),h&&(0,A.jsxs)("div",{className:"wc-recording-main",onClick:this.switchRecording,children:[(0,A.jsx)("div",{className:"wc-recording",children:"\xa0"}),(0,A.jsx)("span",{className:"wc-recording-text",children:$})]})]}),!z&&p&&!this.isScrollAtBottom()&&(0,A.jsxs)("div",{ref:this.moreItemsOnScrollRef,style:{bottom:N+15},onClick:this.forceScrollToBottom,className:"wc-more-items-on-scroll",children:[H&&(0,A.jsx)("span",{className:"wc-more-items-on-scroll-counter",children:d}),(0,A.jsx)("div",{className:"wc-more-items-on-scroll-image"})]}),!z&&"emoji"===m&&(0,A.jsx)(Fe,{locale:i,addCharacter:function(e){r.setState({visiblePopup:null}),r.footerRef.current.addCharacter(e.native)}}),!z&&(0,A.jsx)(Ge,{visible:"hamburger"===m,items:g,sendMessage:function(e,t){x.Zm(e,t),r.setState({visiblePopup:null}),r.forceScrollToBottom(),(0,y.tq)()||r.setFocusOnInput()},locale:i}),E&&(0,A.jsx)(Ue.Z,{setHeight:function(e){return r.setState({replyFooterHeight:e})},currentMessage:k,isDismissable:!0,onDismiss:this.onDismissReply,showOperatorName:M}),!z&&(0,A.jsx)(W,{ref:this.footerRef,hamburgerDisabled:P().isEmpty(g),visiblePopup:m,recordingAudio:h,allDisabled:null!==B,switchRecordingAudio:this.switchRecording,changeVisiblePopup:this.onChangeVisiblePopup,placeholder:l["--bm-wc-config-input-placeholder"],scrollToBottom:this.forceScrollToBottom,suggestionsDataUrl:_,enableInput:!Y,intentButtons:g,configuration:l,businessId:u._id_,locale:i,messageToReply:k,onDismissReply:this.onDismissReply,botId:O}),!z&&(0,A.jsx)("div",{className:"wc-powered-by"}),(0,A.jsx)(Re,{id:"chatcomponent-tooltip",event:"click focus",className:"bm-webchat-entries-li-tooltip",place:"top",disable:(0,y.tq)(),effect:"solid",globalEventOff:"click",delayShow:50,delayHide:100})]}),(0,A.jsx)(V,{changePresence:this.changePresence,currentPresence:F,presenceChanging:f,msgCounter:"PersonalizadorWebchat"===u._id_?2:d,locale:i})]})}}]),n}(o.Component),Qe=$e,Je=n(75192),Xe=n.n(Je);function et(e){console.warn("[react-ga]",e)}function tt(e){return tt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tt(e)}function nt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rt(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function it(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function at(e,t){for(var n=0;n0&&t+e.length!==n.length&&e.search(_t)>-1&&":"!==n.charAt(t-2)&&("-"!==n.charAt(t+e.length)||"-"===n.charAt(t-1))&&n.charAt(t-1).search(/[^\s-]/)<0?e.toLowerCase():e.substr(1).search(/[A-Z]|\../)>-1?e:e.charAt(0).toUpperCase()+e.substr(1)}))}var bt=!1;function yt(e){console.info("[react-ga]",e)}var wt=[],xt={calls:wt,ga:function(){for(var e=arguments.length,t=new Array(e),n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function kt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function St(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tt(e){return Tt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tt(e)}function Ot(e){return function(e){if(Array.isArray(e))return Mt(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return Mt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=e||"";return(arguments.length>1?arguments[1]:void 0)&&(n=vt(e)),t&&(n=mt(n)),n}(e,Rt,It)}function Nt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&(jt.apply(void 0,t),Ct&&(yt("called ga('arguments');"),yt("with arguments: ".concat(JSON.stringify(t))))),window.ga}function Wt(e,t){e?"object"===Tt(e)?(0===Object.keys(e).length&&et("empty `fieldsObject` given to .set()"),Nt(t,"set",e),Ct&&(yt("called ga('set', fieldsObject);"),yt("with fieldsObject: ".concat(JSON.stringify(e))))):et("Expected `fieldsObject` arg to be an Object"):et("`fieldsObject` is required in .set()")}function Ht(e,t){Nt(t,"send",e),Ct&&(yt("called ga('send', fieldObject);"),yt("with fieldObject: ".concat(JSON.stringify(e))),yt("with trackers: ".concat(JSON.stringify(t))))}function Vt(e,t,n){if(e){var r=gt(e);if(""!==r){var o={};if(n&&(o.title=n),Nt(t,"send",function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.category,n=e.variable,r=e.value,o=e.label,i=arguments.length>1?arguments[1]:void 0;if(t&&n&&"number"===typeof r){var a={hitType:"timing",timingCategory:Lt(t),timingVar:Lt(n),timingValue:r};o&&(a.timingLabel=Lt(o)),Ht(a,i)}else et("args.category, args.variable AND args.value are required in timing() AND args.value has to be a number")}function Gt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.category,n=e.action,r=e.label,o=e.value,i=e.nonInteraction,a=e.transport,s=Et(e,["category","action","label","value","nonInteraction","transport"]),u=arguments.length>1?arguments[1]:void 0;if(t&&n){var c={hitType:"event",eventCategory:Lt(t),eventAction:Lt(n)};r&&(c.eventLabel=Lt(r)),"undefined"!==typeof o&&("number"!==typeof o?et("Expected `args.value` arg to be a Number."):c.eventValue=o),"undefined"!==typeof i&&("boolean"!==typeof i?et("`args.nonInteraction` must be a boolean."):c.nonInteraction=i),"undefined"!==typeof a&&("string"!==typeof a?et("`args.transport` must be a string."):(-1===["beacon","xhr","image"].indexOf(a)&&et("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"),c.transport=a)),Object.keys(s).filter((function(e){return"dimension"===e.substr(0,"dimension".length)})).forEach((function(e){c[e]=s[e]})),Object.keys(s).filter((function(e){return"metric"===e.substr(0,"metric".length)})).forEach((function(e){c[e]=s[e]})),Ht(c,u)}else et("args.category AND args.action are required in event()")}function Kt(e,t){var n=e.description,r=e.fatal,o={hitType:"exception"};n&&(o.exDescription=Lt(n)),"undefined"!==typeof r&&("boolean"!==typeof r?et("`args.fatal` must be a boolean."):o.exFatal=r),Ht(o,t)}var Zt={require:function(e,t,n){if(e){var r=gt(e);if(""!==r){var o=n?"".concat(n,".require"):"require";if(t){if("object"!==Tt(t))return void et("Expected `options` arg to be an Object");0===Object.keys(t).length&&et("Empty `options` given to .require()"),zt(o,r,t),Ct&&yt("called ga('require', '".concat(r,"', ").concat(JSON.stringify(t)))}else zt(o,r),Ct&&yt("called ga('require', '".concat(r,"');"))}else et("`name` cannot be an empty string in .require()")}else et("`name` is required in .require()")},execute:function(e,t){for(var n,r,o=arguments.length,i=new Array(o>2?o-2:0),a=2;a1&&void 0!==arguments[1]?arguments[1]:{},n={mimeType:t.mimeType||null,onBeforeSend:t.onBeforeSend||Function.prototype,onSuccess:t.onSuccess||Function.prototype,onError:t.onError||Function.prototype,onComplete:t.onComplete||Function.prototype},r=Array.isArray(e)?e:[e],o=Array.apply(null,Array(r.length)).map((function(e){return null}));function i(e){var t="string"===typeof e,n=t&&"<"===e.trim().charAt(0);return t&&!n}function a(e,t){n.onError(e,r[t],t)}function s(e,t){var i=n.onSuccess(e,r[t],t);e=!1===i?"":i||e,o[t]=e,-1===o.indexOf(null)&&n.onComplete(o)}var u=document.createElement("a");r.forEach((function(e,t){if(u.setAttribute("href",e),u.href=String(u.href),Boolean(document.all&&!window.atob)&&u.host.split(":")[0]!==location.host.split(":")[0]){if(u.protocol===location.protocol){var r=new XDomainRequest;r.open("GET",e),r.timeout=0,r.onprogress=Function.prototype,r.ontimeout=Function.prototype,r.onload=function(){var e=r.responseText;i(e)?s(e,t):a(r,t)},r.onerror=function(e){a(r,t)},setTimeout((function(){r.send()}),0)}else console.warn("Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol (".concat(e,")")),a(null,t)}else{var o=new XMLHttpRequest;o.open("GET",e),n.mimeType&&o.overrideMimeType&&o.overrideMimeType(n.mimeType),n.onBeforeSend(o,e,t),o.onreadystatechange=function(){if(4===o.readyState){var e=o.responseText;o.status<400&&i(e)||0===o.status&&i(e)?s(e,t):a(o,t)}},o.send()}}))}function un(e){var t=/\/\*[\s\S]+?\*\//g,n=/(?:@import\s*)(?:url\(\s*)?(?:['"])([^'"]*)(?:['"])(?:\s*\))?(?:[^;]*;)/g,r={rootElement:e.rootElement||document,include:e.include||'style,link[rel="stylesheet"]',exclude:e.exclude||null,filter:e.filter||null,skipDisabled:!1!==e.skipDisabled,useCSSOM:e.useCSSOM||!1,onBeforeSend:e.onBeforeSend||Function.prototype,onSuccess:e.onSuccess||Function.prototype,onError:e.onError||Function.prototype,onComplete:e.onComplete||Function.prototype},o=Array.apply(null,r.rootElement.querySelectorAll(r.include)).filter((function(e){return t=e,n=r.exclude,!(t.matches||t.matchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector).call(t,n);var t,n})),i=Array.apply(null,Array(o.length)).map((function(e){return null}));function a(){if(-1===i.indexOf(null)){i.reduce((function(e,t,n){return""===t&&e.push(n),e}),[]).reverse().forEach((function(e){return[o,i].forEach((function(t){return t.splice(e,1)}))}));var e=i.join("");r.onComplete(e,i,o)}}function s(e,t,n,o){var s=r.onSuccess(e,n,o);c(e=void 0!==s&&!1===Boolean(s)?"":s||e,n,o,(function(e,o){null===i[t]&&(o.forEach((function(e){return r.onError(e.xhr,n,e.url)})),!r.filter||r.filter.test(e)?i[t]=e:i[t]="",a())}))}function u(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i={};return i.rules=(e.replace(t,"").match(n)||[]).filter((function(e){return-1===o.indexOf(e)})),i.urls=i.rules.map((function(e){return e.replace(n,"$1")})),i.absoluteUrls=i.urls.map((function(e){return cn(e,r)})),i.absoluteRules=i.rules.map((function(e,t){var n=i.urls[t],o=cn(i.absoluteUrls[t],r);return e.replace(n,o)})),i}function c(e,t,n,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],s=u(e,n,a);s.rules.length?sn(s.absoluteUrls,{onBeforeSend:function(e,n,o){r.onBeforeSend(e,t,n)},onSuccess:function(e,n,o){var i=r.onSuccess(e,t,n),s=u(e=!1===i?"":i||e,n,a);return s.rules.forEach((function(t,n){e=e.replace(t,s.absoluteRules[n])})),e},onError:function(r,u,l){i.push({xhr:r,url:u}),a.push(s.rules[l]),c(e,t,n,o,i,a)},onComplete:function(r){r.forEach((function(t,n){e=e.replace(s.rules[n],t)})),c(e,t,n,o,i,a)}}):o(e,i)}o.length?o.forEach((function(e,t){var n=e.getAttribute("href"),o=e.getAttribute("rel"),u="link"===e.nodeName.toLowerCase()&&n&&o&&-1!==o.toLowerCase().indexOf("stylesheet"),c=!1!==r.skipDisabled&&e.disabled,l="style"===e.nodeName.toLowerCase();if(u&&!c)sn(n,{mimeType:"text/css",onBeforeSend:function(t,n,o){r.onBeforeSend(t,e,n)},onSuccess:function(r,o,i){var a=cn(n);s(r,t,e,a)},onError:function(n,o,s){i[t]="",r.onError(n,e,o),a()}});else if(l&&!c){var f=e.textContent;r.useCSSOM&&(f=Array.apply(null,e.sheet.cssRules).map((function(e){return e.cssText})).join("")),s(f,t,e,location.href)}else i[t]="",a()})):r.onComplete("",[])}function cn(e,t){var n=document.implementation.createHTMLDocument(""),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),r.href=t||document.baseURI||(document.querySelector("base")||{}).href||location.href,o.href=e,o.href}var ln=fn;function fn(e,t,n){e instanceof RegExp&&(e=dn(e,n)),t instanceof RegExp&&(t=dn(t,n));var r=hn(e,t,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+e.length,r[1]),post:n.slice(r[1]+t.length)}}function dn(e,t){var n=t.match(e);return n?n[0]:null}function hn(e,t,n){var r,o,i,a,s,u=n.indexOf(e),c=n.indexOf(t,u+1),l=u;if(u>=0&&c>0){if(e===t)return[u,c];for(r=[],i=n.length;l>=0&&!s;)l==u?(r.push(l),u=n.indexOf(e,l+1)):1==r.length?s=[r.pop(),c]:((o=r.pop())=0?u:c;r.length&&(s=[i,a])}return s}function pn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={preserveStatic:!0,removeComments:!1},r=an({},n,t),o=[];function i(e){throw new Error("CSS parse error: ".concat(e))}function a(t){var n=t.exec(e);if(n)return e=e.slice(n[0].length),n}function s(){return a(/^{\s*/)}function u(){return a(/^}/)}function c(){a(/^\s*/)}function l(){if(c(),"/"===e[0]&&"*"===e[1]){for(var t=2;e[t]&&("*"!==e[t]||"/"!==e[t+1]);)t++;if(!e[t])return i("end of comment is missing");var n=e.slice(2,t);return e=e.slice(t+2),{type:"comment",comment:n}}}function f(){for(var e,t=[];e=l();)t.push(e);return r.removeComments?[]:t}function d(){for(c();"}"===e[0];)i("extra closing bracket");var t=a(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/);if(t){var n,r=t[0].trim();/\/\*/.test(r)&&(r=r.replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,""));var o=/["']\w*,\w*["']/.test(r);return o&&(r=r.replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"\u200c")}))),n=/,/.test(r)?r.split(/\s*(?![^(]*\)),\s*/):[r],o&&(n=n.map((function(e){return e.replace(/\u200C/g,",")}))),n}}function h(){if("@"===e[0])return T();a(/^([;\s]*)+/);var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=a(/^(\*?[-#/*\\\w.]+(\[[0-9a-z_-]+\])?)\s*/);if(n){if(n=n[0].trim(),!a(/^:\s*/))return i("property missing ':'");var r=a(/^((?:\/\*.*?\*\/|'(?:\\'|.)*?'|"(?:\\"|.)*?"|\((\s*'(?:\\'|.)*?'|"(?:\\"|.)*?"|[^)]*?)\s*\)|[^};])+)/),o={type:"declaration",property:n.replace(t,""),value:r?r[0].replace(t,"").trim():""};return a(/^[;\s]*/),o}}function p(){if(!s())return i("missing '{'");for(var e,t=f();e=h();)t.push(e),t=t.concat(f());return u()?t:i("missing '}'")}function m(){c();for(var e,t=[];e=a(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),a(/^,\s*/);if(t.length)return{type:"keyframe",values:t,declarations:p()}}function g(){var e=a(/^@([-\w]+)?keyframes\s*/);if(e){var t=e[1];if(!(e=a(/^([-\w]+)\s*/)))return i("@keyframes missing name");var n,r=e[1];if(!s())return i("@keyframes missing '{'");for(var o=f();n=m();)o.push(n),o=o.concat(f());return u()?{type:"keyframes",name:r,vendor:t,keyframes:o}:i("@keyframes missing '}'")}}function _(){if(a(/^@page */))return{type:"page",selectors:d()||[],declarations:p()}}function v(){var e=a(/@(top|bottom|left|right)-(left|center|right|top|middle|bottom)-?(corner)?\s*/);if(e)return{type:"page-margin-box",name:"".concat(e[1],"-").concat(e[2])+(e[3]?"-".concat(e[3]):""),declarations:p()}}function b(){if(a(/^@font-face\s*/))return{type:"font-face",declarations:p()}}function y(){var e=a(/^@supports *([^{]+)/);if(e)return{type:"supports",supports:e[1].trim(),rules:M()}}function w(){if(a(/^@host\s*/))return{type:"host",rules:M()}}function x(){var e=a(/^@media([^{]+)*/);if(e)return{type:"media",media:(e[1]||"").trim(),rules:M()}}function E(){var e=a(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(e)return{type:"custom-media",name:e[1].trim(),media:e[2].trim()}}function k(){var e=a(/^@([-\w]+)?document *([^{]+)/);if(e)return{type:"document",document:e[2].trim(),vendor:e[1]?e[1].trim():null,rules:M()}}function S(){var e=a(/^@(import|charset|namespace)\s*([^;]+);/);if(e)return{type:e[1],name:e[2].trim()}}function T(){if(c(),"@"===e[0]){var t=S()||b()||x()||g()||y()||k()||E()||w()||_()||v();if(t&&!r.preserveStatic){var n=!1;if(t.declarations)n=t.declarations.some((function(e){return/var\(/.test(e.value)}));else n=(t.keyframes||t.rules||[]).some((function(e){return(e.declarations||[]).some((function(e){return/var\(/.test(e.value)}))}));return n?t:{}}return t}}function O(){if(!r.preserveStatic){var t=ln("{","}",e);if(t){var n=/:(?:root|host)(?![.:#(])/.test(t.pre)&&/--\S*\s*:/.test(t.body),o=/var\(/.test(t.body);if(!n&&!o)return e=e.slice(t.end+1),{}}}var a=d()||[],s=r.preserveStatic?p():p().filter((function(e){var t=a.some((function(e){return/:(?:root|host)(?![.:#(])/.test(e)}))&&/^--\S/.test(e.property),n=/var\(/.test(e.value);return t||n}));return a.length||i("selector missing"),{type:"rule",selectors:a,declarations:s}}function M(t){if(!t&&!s())return i("missing '{'");for(var n,r=f();e.length&&(t||"}"!==e[0])&&(n=T()||O());)n.type&&r.push(n),r=r.concat(f());return t||u()?r:i("missing '}'")}return{type:"stylesheet",stylesheet:{rules:M(!0),errors:o}}}function mn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={parseHost:!1,store:{},onWarning:function(){}},r=an({},n,t),o=new RegExp(":".concat(r.parseHost?"host":"root","$"));return"string"===typeof e&&(e=pn(e,r)),e.stylesheet.rules.forEach((function(e){"rule"===e.type&&e.selectors.some((function(e){return o.test(e)}))&&e.declarations.forEach((function(e,t){var n=e.property,o=e.value;n&&0===n.indexOf("--")&&(r.store[n]=o)}))})),r.store}function gn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r={charset:function(e){return"@charset "+e.name+";"},comment:function(e){return 0===e.comment.indexOf("__CSSVARSPONYFILL")?"/*"+e.comment+"*/":""},"custom-media":function(e){return"@custom-media "+e.name+" "+e.media+";"},declaration:function(e){return e.property+":"+e.value+";"},document:function(e){return"@"+(e.vendor||"")+"document "+e.document+"{"+o(e.rules)+"}"},"font-face":function(e){return"@font-face{"+o(e.declarations)+"}"},host:function(e){return"@host{"+o(e.rules)+"}"},import:function(e){return"@import "+e.name+";"},keyframe:function(e){return e.values.join(",")+"{"+o(e.declarations)+"}"},keyframes:function(e){return"@"+(e.vendor||"")+"keyframes "+e.name+"{"+o(e.keyframes)+"}"},media:function(e){return"@media "+e.media+"{"+o(e.rules)+"}"},namespace:function(e){return"@namespace "+e.name+";"},page:function(e){return"@page "+(e.selectors.length?e.selectors.join(", "):"")+"{"+o(e.declarations)+"}"},"page-margin-box":function(e){return"@"+e.name+"{"+o(e.declarations)+"}"},rule:function(e){var t=e.declarations;if(t.length)return e.selectors.join(",")+"{"+o(t)+"}"},supports:function(e){return"@supports "+e.supports+"{"+o(e.rules)+"}"}};function o(e){for(var o="",i=0;i1&&void 0!==arguments[1]?arguments[1]:{},n={preserveStatic:!0,preserveVars:!1,variables:{},onWarning:function(){}},r=an({},n,t);return"string"===typeof e&&(e=pn(e,r)),_n(e.stylesheet,(function(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(-1===e.indexOf("var("))return e;var r=ln("(",")",e);function o(e){var r=e.split(",")[0].replace(/[\s\n\t]/g,""),o=(e.match(/(?:\s*,\s*){1}(.*)?/)||[])[1],i=Object.prototype.hasOwnProperty.call(t.variables,r)?String(t.variables[r]):void 0,a=i||(o?String(o):void 0),s=n||e;return i||t.onWarning('variable "'.concat(r,'" is undefined')),a&&"undefined"!==a&&a.length>0?yn(a,t,s):"var(".concat(s,")")}if(r){if("var"===r.pre.slice(-3)){var i=0===r.body.trim().length;return i?(t.onWarning("var() must contain a non-whitespace string"),e):r.pre.slice(0,-3)+o(r.body)+yn(r.post,t)}return r.pre+"(".concat(yn(r.body,t),")")+yn(r.post,t)}return-1!==e.indexOf("var(")&&t.onWarning('missing closing ")" in the value "'.concat(e,'"')),e}var wn,xn="undefined"!==typeof window,En=xn&&window.CSS&&window.CSS.supports&&window.CSS.supports("(--a: 0)"),kn={group:0,job:0},Sn={rootElement:xn?document:null,shadowDOM:!1,include:"style,link[rel=stylesheet]",exclude:"",variables:{},onlyLegacy:!0,preserveStatic:!0,preserveVars:!1,silent:!1,updateDOM:!0,updateURLs:!0,watch:null,onBeforeSend:function(){},onError:function(){},onWarning:function(){},onSuccess:function(){},onComplete:function(){},onFinally:function(){}},Tn={cssComments:/\/\*[\s\S]+?\*\//g,cssKeyframes:/@(?:-\w*-)?keyframes/,cssMediaQueries:/@media[^{]+\{([\s\S]+?})\s*}/g,cssUrls:/url\((?!['"]?(?:data|http|\/\/):)['"]?([^'")]*)['"]?\)/g,cssVarDeclRules:/(?::(?:root|host)(?![.:#(])[\s,]*[^{]*{\s*[^}]*})/g,cssVarDecls:/(?:[\s;]*)(-{2}\w[\w-]*)(?:\s*:\s*)([^;]*);/g,cssVarFunc:/var\(\s*--[\w-]/,cssVars:/(?:(?::(?:root|host)(?![.:#(])[\s,]*[^{]*{\s*[^;]*;*\s*)|(?:var\(\s*))(--[^:)]+)(?:\s*[:)])/},On={dom:{},job:{},user:{}},Mn=!1,An=null,Cn=0,Rn=null,Dn=!1;function Pn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="cssVars(): ",n=an({},Sn,e);function r(e,r,o,i){!n.silent&&window.console&&console.error("".concat(t).concat(e,"\n"),r),n.onError(e,r,o,i)}function o(e){!n.silent&&window.console&&console.warn("".concat(t).concat(e)),n.onWarning(e)}function i(e){n.onFinally(Boolean(e),En,Fn()-n.__benchmark)}if(xn){if(n.watch)return n.watch=Sn.watch,In(n),void Pn(n);if(!1===n.watch&&An&&(An.disconnect(),An=null),!n.__benchmark){if(Mn===n.rootElement)return void jn(e);var a=[].slice.call(n.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])'));if(n.__benchmark=Fn(),n.exclude=[An?'[data-cssvars]:not([data-cssvars=""])':'[data-cssvars="out"]',"link[disabled]:not([data-cssvars])",n.exclude].filter((function(e){return e})).join(","),n.variables=Un(n.variables),a.forEach((function(e){var t="style"===e.nodeName.toLowerCase()&&e.__cssVars.text,n=t&&e.textContent!==e.__cssVars.text;t&&n&&(e.sheet&&(e.sheet.disabled=!1),e.setAttribute("data-cssvars",""))})),!An){var s=[].slice.call(n.rootElement.querySelectorAll('[data-cssvars="out"]'));s.forEach((function(e){var t=e.getAttribute("data-cssvars-group");(t?n.rootElement.querySelector('[data-cssvars="src"][data-cssvars-group="'.concat(t,'"]')):null)||e.parentNode.removeChild(e)})),Cn&&a.length2&&void 0!==arguments[2]?arguments[2]:[],s=an({},On.dom,On.user);if(On.job={},a.forEach((function(e,i){var a=t[i];if(e.__cssVars=e.__cssVars||{},e.__cssVars.text=a,Tn.cssVars.test(a))try{var s=pn(a,{preserveStatic:n.preserveStatic,removeComments:!0});mn(s,{parseHost:Boolean(n.rootElement.host),store:On.dom,onWarning:o}),e.__cssVars.tree=s}catch(u){r(u.message,e)}})),an(On.job,On.dom),n.updateDOM?(an(On.user,n.variables),an(On.job,On.user)):(an(On.job,On.user,n.variables),an(s,n.variables)),kn.job>0&&Boolean(Object.keys(On.job).length>Object.keys(s).length||Boolean(Object.keys(s).length&&Object.keys(On.job).some((function(e){return On.job[e]!==s[e]})))))zn(n.rootElement),Pn(n);else{var u=[],c=[],l=!1;if(n.updateDOM&&kn.job++,a.forEach((function(e,i){var a=!e.__cssVars.tree;if(e.__cssVars.tree)try{vn(e.__cssVars.tree,an({},n,{variables:On.job,onWarning:o}));var s=gn(e.__cssVars.tree);if(n.updateDOM){var f=t[i],d=Tn.cssVarFunc.test(f);if(e.getAttribute("data-cssvars")||e.setAttribute("data-cssvars","src"),s.length&&d){var h=e.getAttribute("data-cssvars-group")||++kn.group,p=s.replace(/\s/g,""),m=n.rootElement.querySelector('[data-cssvars="out"][data-cssvars-group="'.concat(h,'"]'))||document.createElement("style");l=l||Tn.cssKeyframes.test(s),n.preserveStatic&&e.sheet&&(e.sheet.disabled=!0),m.hasAttribute("data-cssvars")||m.setAttribute("data-cssvars","out"),p===e.textContent.replace(/\s/g,"")?(a=!0,m&&m.parentNode&&(e.removeAttribute("data-cssvars-group"),m.parentNode.removeChild(m))):p!==m.textContent.replace(/\s/g,"")&&([e,m].forEach((function(e){e.setAttribute("data-cssvars-job",kn.job),e.setAttribute("data-cssvars-group",h)})),m.textContent=s,u.push(s),c.push(m),m.parentNode||e.parentNode.insertBefore(m,e.nextSibling))}}else e.textContent.replace(/\s/g,"")!==s&&u.push(s)}catch(g){r(g.message,e)}a&&e.setAttribute("data-cssvars","skip"),e.hasAttribute("data-cssvars-job")||e.setAttribute("data-cssvars-job",kn.job)})),Cn=n.rootElement.querySelectorAll('[data-cssvars]:not([data-cssvars="out"])').length,n.shadowDOM)for(var f,d=[].concat(n.rootElement).concat([].slice.call(n.rootElement.querySelectorAll("*"))),h=0;f=d[h];++h)if(f.shadowRoot&&f.shadowRoot.querySelector("style")){var p=an({},n,{rootElement:f.shadowRoot});Pn(p)}n.updateDOM&&l&&Ln(n.rootElement),Mn=!1,n.onComplete(u.join(""),c,JSON.parse(JSON.stringify(On.job)),Fn()-n.__benchmark),i(c.length)}}}));else document.addEventListener("DOMContentLoaded",(function t(n){Pn(e),document.removeEventListener("DOMContentLoaded",t)}))}}function In(e){function t(e){var t=n(e)&&e.hasAttribute("disabled"),r=(e.sheet||{}).disabled;return t||r}function n(e){return"link"===e.nodeName.toLowerCase()&&-1!==(e.getAttribute("rel")||"").indexOf("stylesheet")}function r(e){return"style"===e.nodeName.toLowerCase()}window.MutationObserver&&(An&&(An.disconnect(),An=null),(An=new MutationObserver((function(o){o.some((function(o){return function(r){var o=!1;if("attributes"===r.type&&n(r.target)&&!t(r.target)){var i="disabled"===r.attributeName,a="href"===r.attributeName,s="skip"===r.target.getAttribute("data-cssvars"),u="src"===r.target.getAttribute("data-cssvars");i?o=!s&&!u:a&&(s?r.target.setAttribute("data-cssvars",""):u&&zn(e.rootElement,!0),o=!0)}return o}(o)||function(e){var t=!1;if("childList"===e.type){var n=r(e.target),o="out"===e.target.getAttribute("data-cssvars");t=n&&!o}return t}(o)||function(e){var o=!1;return"childList"===e.type&&(o=[].slice.call(e.addedNodes).some((function(e){var o=1===e.nodeType&&e.hasAttribute("data-cssvars"),i=r(e)&&Tn.cssVars.test(e.textContent);return!o&&(n(e)||i)&&!t(e)}))),o}(o)||function(t){var n=!1;return"childList"===t.type&&(n=[].slice.call(t.removedNodes).some((function(t){var n=1===t.nodeType,r=n&&"out"===t.getAttribute("data-cssvars"),o=n&&"src"===t.getAttribute("data-cssvars"),i=o;if(o||r){var a=t.getAttribute("data-cssvars-group"),s=e.rootElement.querySelector('[data-cssvars-group="'.concat(a,'"]'));o&&zn(e.rootElement,!0),s&&s.parentNode.removeChild(s)}return i}))),n}(o)}))&&Pn(e)}))).observe(document.documentElement,{attributes:!0,attributeFilter:["disabled","href"],childList:!0,subtree:!0}))}function jn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;clearTimeout(Rn),Rn=setTimeout((function(){e.__benchmark=null,Pn(e)}),t)}function Ln(e){var t=["animation-name","-moz-animation-name","-webkit-animation-name"].filter((function(e){return getComputedStyle(document.body)[e]}))[0];if(t){for(var n=e.getElementsByTagName("*"),r=[],o="__CSSVARSPONYFILL-KEYFRAMES__",i=0,a=n.length;i0&&void 0!==arguments[0]?arguments[0]:{},t=/^-{2}/;return Object.keys(e).reduce((function(n,r){return n[t.test(r)?r:"--".concat(r.replace(/^-+/,""))]=e[r],n}),{})}function Bn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location.href,n=document.implementation.createHTMLDocument(""),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),r.href=t,o.href=e,o.href}function Fn(){return xn&&(window.performance||{}).now?window.performance.now():(new Date).getTime()}function zn(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[].slice.call(e.querySelectorAll('[data-cssvars="skip"],[data-cssvars="src"]'));n.forEach((function(e){return e.setAttribute("data-cssvars","")})),t&&(On.dom={})}Pn.reset=function(){for(var e in kn.job=0,kn.group=0,Mn=!1,An&&(An.disconnect(),An=null),Cn=0,Rn=null,Dn=!1,On)On[e]={}},Pn();try{window.parent.document&&(window.hasParentAccess=!0)}catch(Wn){window.hasParentAccess=!1}i.render((0,A.jsx)(Qe,{}),document.getElementById("botmakerMain")),(0,y.iX)("audio-income","https://storage.googleapis.com/m-infra.appspot.com/public/res/BotmakerTesting/20210901-ZTQICMRUTAYMZ6GT41ZG-24RS2-YnViYmxlX3BvcF8zLm1wMw==.mpeg"),(0,y.iX)("audio-sent","https://storage.googleapis.com/m-infra.appspot.com/public/res/BotmakerTesting/20210901-9SaE0VZGz9ZNkjs6SO9fJnFVpRu1-8U3QN-YnViYmxlX3BvcF8xLm1wMw==.mp3"),(0,y.iX)("audio-error","https://storage.googleapis.com/m-infra.appspot.com/public/res/GonzaBot/20210914-9SaE0VZGz9ZNkjs6SO9fJnFVpRu1-6BXZT-bWl4a2l0LW5lZ2F0aXZlLXRvbmUtaW50ZXJmYWNlLXRhcC0yNTY5Lndhdg==.wav"),null!==(wn=window.hasParentAccess?window.parent.BOTMAKER_VAR:window.BOTMAKER_VAR)&&void 0!==wn&&wn.disableGA||(nn("UA-73723709-1",{gaOptions:{cookieFlags:"secure;samesite=none"}}),rn(window.location.pathname+window.location.search))},46186:function(e,t,n){"use strict";n.d(t,{_:function(){return i}});var r=n(16031),o=n.n(r);function i(e,t){var n=e.messages,r=e.customer,i=e.isBotTyping,a=e.lastCustomerMessageSentTime,s=o().uniqBy((n||[]).concat(t),"_id_").sort((function(e,t){var n=new Date(e.CREATION_TIME),r=new Date(t.CREATION_TIME);return n>r?1:ne};return s=function(e,t){if(!t||0===t.length)return t;var n=function(e,t){var n=(t=t||[]).map((function(e){return e.RENDERING_INFO&&e.RENDERING_INFO.lastClearChatTime||0})).reduce((function(e,t){return Math.max(e,t)}),e.customer&&e.customer.lastClearChatTime||0);if(0===n){var r=t.find((function(e){return"FIRST_MESSAGE"===e.INTENT_ID}));if(r)return new Date(r.CREATION_TIME).getTime()}return n}(e,t),r=t[t.length-1];return t.filter((function(e){return new Date(e.CREATION_TIME).getTime()>=n})).map((function(e){var t,n=e===r;return e.input=n&&(r.REPRESENTATION_ID&&0===r.REPRESENTATION_ID.indexOf("FAQ.QUESTION/")||r.OPERATOR_ID&&!((t=r)&&t.OPTIONS&&t.OPTIONS.length>0)),e})).filter((function(e){return!e.input||e.MESSAGE||e.OPTIONS}))}(e,s),s.map((function(e){var t=new Date(e.CREATION_TIME).getTime();return e.SENT||(e.SENT=l(t,a)),e.RECEIVED||(e.RECEIVED=l(t,null===r||void 0===r?void 0:r.OPERATOR_LAST_MSG_RECEIVED)),e.READ||(e.READ=l(t,null===r||void 0===r?void 0:r.OPERATOR_LAST_MSG_READ)),e}))}},83188:function(e,t,n){"use strict";var r=n(15671),o=n(43144),i=n(84688),a=n.n(i),s=n(22445),u=n(16031),c=n.n(u),l=function(){function e(t,n,o,i){var s=this;(0,r.Z)(this,e),this.pendingSentMessages=[],this.debug=!1,this.alertLogger=null,this.markMessageAsSent=function(e){"operationDecision"===e.type&&s.onMessage({type:"markMessageAsSent",msg:e.msg})},window.debug&&(this.debug=!0),this.onConnectedChange=n,this.onMessage=o,this.webSocket=new(a())(t),this.webSocket.debug=this.debug,this.webSocket.timeoutInterval=2e3,this.webSocket.maxReconnectInterval=2e3,this.webSocket.reconnectDecay=1,this.connectionChanged=this.connectionChanged.bind(this),this.receiveMessage=this.receiveMessage.bind(this),this.errorOccurred=this.errorOccurred.bind(this),this.close=this.close.bind(this),this.webSocket.addEventListener("open",this.connectionChanged),this.webSocket.addEventListener("message",this.receiveMessage),this.webSocket.addEventListener("error",this.errorOccurred),this.webSocket.addEventListener("close",this.connectionChanged),this.isIE()||window.addEventListener("beforeunload",(function(){return s.close(),!0})),window.addEventListener("onunload",(function(){return s.close(),!0})),this.pendingSentMessages=[],this.alertLogger=i,setInterval((function(){return s.tryToResendMessages()}),1e4)}return(0,o.Z)(e,[{key:"isIE",value:function(){return!!document.documentMode}},{key:"toHexString",value:function(e){return e.map((function(e){return("0"+(255&e).toString(16)).slice(-2)})).join("")}},{key:"connectionChanged",value:function(e){var t=this.webSocket&&this.webSocket.readyState===WebSocket.OPEN;t&&(this.onConnectedChange(t,null),this.log("connectionChanged --\x3e isConnected: ",t,e))}},{key:"isMessagePending",value:function(e){return this.pendingSentMessages.find((function(t){return t.m.tx===e.tx}))}},{key:"errorOccurred",value:function(e){var t=this.websocket&&this.webSocket.readyState===WebSocket.OPEN;this.log("errorOccurred --\x3e isConnected: ",t," error ",e),this.onConnectedChange(t,e)}},{key:"receiveMessage",value:function(e){var t=this,n=JSON.parse(e.data);if(this.log("Receive message ",n.tx," ",n.type),n.txAck)return this.pendingSentMessages=this.pendingSentMessages.filter((function(e){return e.id!==n.txAck||(t.markMessageAsSent(e.m),!1)})),void this.log("Messages pending list size: ",this.pendingSentMessages.length);this.onMessage(n)}},{key:"sendMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;if(e.tx=n||this.toHexString(s(20)),e.waitForAck=t,this.log("Send message ",e.tx," waitForAck ",t," type ",e.type),t&&this.pendingSentMessages.push({t:(new Date).getTime(),id:e.tx,m:e}),this.webSocket&&this.webSocket.readyState===WebSocket.OPEN){var r=JSON.stringify(e);r.length>12e4&&console.error("Sending message too long! ",r.length,e.type),this.webSocket.send(r)}}},{key:"tryToResendMessages",value:function(){var e=this;if(0!==this.pendingSentMessages.length){var t=(new Date).getTime(),n=this.pendingSentMessages.filter((function(e){return t-e.t>6e3}));this.pendingSentMessages.length>50&&(this.alertLogger&&this.alertLogger("** pendingMessagesToAck: ".concat(this.pendingSentMessages.length)),this.pendingSentMessages.length>100&&(this.pendingSentMessages=[])),this.pendingSentMessages=c().difference(this.pendingSentMessages,n),n.forEach((function(t){e.log("re sending",t),e.sendMessage(t.m,!0,t.id)})),this.log("after resending size",this.pendingSentMessages.length)}}},{key:"close",value:function(){return this.log("Closing websocket and resources!"),this.tryToResendMessages(),this.webSocket&&(this.webSocket.removeEventListener("open",this.connectionChanged),this.webSocket.removeEventListener("message",this.receiveMessage),this.webSocket.removeEventListener("error",this.errorOccurred),this.webSocket.removeEventListener("close",this.connectionChanged),this.webSocket.close(),this.webSocket=null),!1}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;nI()?330:410:O()?j()>I()?270:235:0}function R(e){if(e||T()){setTimeout((function(){e.paused&&e.play()}),150)}}function D(e){for(var t,n,r="",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i',document.body.appendChild(r),r}function F(e,t,n){if(e())var r=setTimeout((function(){F(e,t),r&&clearTimeout(r)}),n||10);else t()}function z(e,t,n,o,a){var s=function(e){var t=i().emojify(e,{emojiType:"twemoji",onlyBetweenTheseChars:"!\xa1\xbf? );(:,.",attributes:{width:"20px",height:"20px",style:{verticalAlign:"middle"}}});return null===t||void 0===t?void 0:t.reduce((function(e,t){return p().isString(p().last(e))&&p().isString(t)?e.map((function(n,r){return r===e.length-1?"".concat(n).concat(t):n})):e.concat(t)}),[])},u=function(e){var t=[],n=(e.match(/\*/g)||[]).length;if(n>0&&n%2===0)for(var r=0;e&&e.length>0;){if(r>5){console.error("ERROR: infinite loop");break}var o=e.split("*",3);t.push((0,_.jsxs)("span",{children:[s(o[0]),(0,_.jsx)("b",{children:s(o[1])})]},r++)),e=e.substr((o[0]+o[1]).length+2)}return t.push(s(e)),(0,_.jsx)("div",{children:t})};return(0,_.jsx)("div",{id:o||null,className:"bm-webchat-rule-message-all-container",children:(0,_.jsxs)(r.ZP,{properties:{className:t||"bm-webchat-rule-message-all",target:"_blank"},children:[a&&(0,_.jsx)(m.Z,{currentMessage:a}),e.split("\n").map((function(e,r){return e.length>0?(0,_.jsx)("div",{style:n?{maxWidth:n}:{},className:t||"bm-webchat-rule-message-line",children:u(e.replace(/\(y\)/gi,":+1:"))},r):(0,_.jsx)("div",{className:"bm-webchat-rule-message-empty-line",children:"\xa0"},r)}))]})})}function W(e){return function(e,t){var n=function(){return console.log("VIEWPORT setScaleViewPortMetaTag: nothing to do")};if(e.querySelector){var r=e.querySelector("meta[name=viewport]");if(r){console.log("VIEWPORT existe viewport");var o=r.content;n=function(){r.content=o,console.warn("VIEWPORT setScaleViewPortMetaTag back to: "+o)}}else console.log("VIEWPORT no existe viewport"),(r=e.createElement("meta")).name="viewport",e.getElementsByTagName("head")[0].appendChild(r),n=function(){r.content="width=980, user-scalable=yes",console.log("VIEWPORT setScaleViewPortMetaTag back: removing tag (it did NOT exist)")};r.content=t}return n}(e,"width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no")}function H(){return window.hasParentAccess&&window.parent&&window.parent!==window?window.parent:window}function V(){return navigator.userAgent.toLowerCase().includes("firefox")&&"netscape"in window&&/ rv:/.test(navigator.userAgent)}function Y(){return navigator.userAgent.includes("Edge")&&(!!navigator.msSaveBlob||!!navigator.msSaveOrOpenBlob)}function q(e){var t=/\d{8}-\w{20,28}-\w{5}-/,n=decodeURIComponent(e).replace(t,""),r=l().basename(u.parse(n).pathname);try{var o=r.lastIndexOf("."),i=g.lW.from(r.substring(0,o),"base64").toString();return e.match(t)?i||r:l().basename(u.parse(e).pathname)}catch(a){return r}}},96711:function(e,t,n){"use strict";n.d(t,{$1:function(){return r},H5:function(){return i},q4:function(){return o}});var r=!1,o="50367",i=(r?"http://localhost:20480":"https://go.botmaker.com")+"/rest/"},20279:function(e){var t={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};e.exports=function(e,n){return"number"!==typeof n||t[e]?n:n+"px"}},2470:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=u(e),a=i[0],s=i[1],c=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,f=s>0?a-4:a;for(n=0;n>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[l++]=255&t);1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,u=r-o;su?u:s+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!==typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,r){for(var o,i,a=[],s=t;s>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},40918:function(e,t,n){"use strict";var r=n(34575).default,o=n(93913).default,i=n(81506).default,a=n(2205).default,s=n(99842).default,u=n(2470),c=n(60545),l="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=h,t.h2=50;var f=2147483647;function d(e){if(e>f)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,h.prototype),t}function h(e,t,n){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return g(e)}return p(e,t,n)}function p(e,t,n){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!h.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|y(e,t),r=d(n),o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(ee(e,Uint8Array)){var t=new Uint8Array(e);return v(t.buffer,t.byteOffset,t.byteLength)}return _(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(ee(e,ArrayBuffer)||e&&ee(e.buffer,ArrayBuffer))return v(e,t,n);if("undefined"!==typeof SharedArrayBuffer&&(ee(e,SharedArrayBuffer)||e&&ee(e.buffer,SharedArrayBuffer)))return v(e,t,n);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return h.from(r,t,n);var o=function(e){if(h.isBuffer(e)){var t=0|b(e.length),n=d(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!==typeof e.length||te(e.length)?d(0):_(e);if("Buffer"===e.type&&Array.isArray(e.data))return _(e.data)}(e);if(o)return o;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return h.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function m(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function g(e){return m(e),d(e<0?0:0|b(e))}function _(e){for(var t=e.length<0?0:0|b(e.length),n=d(t),r=0;r=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|e}function y(e,t){if(h.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ee(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(o)return r?-1:Q(e).length;t=(""+t).toLowerCase(),o=!0}}function w(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return R(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function x(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function E(e,t,n,r,o){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),te(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"===typeof t&&(t=h.from(t,r)),h.isBuffer(t))return 0===t.length?-1:k(e,t,n,r,o);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):k(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function k(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;is&&(n=s-u),i=n;i>=0;i--){for(var f=!0,d=0;do&&(r=o):r=o;var i,a=t.length;for(r>a/2&&(r=a/2),i=0;i>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?u.fromByteArray(e):u.fromByteArray(e.slice(t,n))}function R(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:i>223?3:i>191?2:1;if(o+s<=n){var u=void 0,c=void 0,l=void 0,f=void 0;switch(s){case 1:i<128&&(a=i);break;case 2:128===(192&(u=e[o+1]))&&(f=(31&i)<<6|63&u)>127&&(a=f);break;case 3:u=e[o+1],c=e[o+2],128===(192&u)&&128===(192&c)&&(f=(15&i)<<12|(63&u)<<6|63&c)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:u=e[o+1],c=e[o+2],l=e[o+3],128===(192&u)&&128===(192&c)&&128===(192&l)&&(f=(15&i)<<18|(63&u)<<12|(63&c)<<6|63&l)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=s}return function(e){var t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rr.length?(h.isBuffer(i)||(i=h.from(i)),i.copy(r,o)):Uint8Array.prototype.set.call(r,i,o);else{if(!h.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,o)}o+=i.length}return r},h.byteLength=y,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tn&&(e+=" ... "),""},l&&(h.prototype[l]=h.prototype.inspect),h.prototype.compare=function(e,t,n,r,o){if(ee(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),u=this.slice(r,o),c=e.slice(t,n),l=0;l>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return S(this,e,t,n);case"utf8":case"utf-8":return T(this,e,t,n);case"ascii":case"latin1":case"binary":return O(this,e,t,n);case"base64":return M(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function P(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,n,r,o,i){if(!h.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function B(e,t,n,r,o){G(t,r,o,e,n,7);var i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;var a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function F(e,t,n,r,o){G(t,r,o,e,n,7);var i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;var a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function z(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function W(e,t,n,r,o){return t=+t,n>>>=0,o||z(e,0,n,4),c.write(e,t,n,r,23,4),n+4}function H(e,t,n,r,o){return t=+t,n>>>=0,o||z(e,0,n,8),c.write(e,t,n,r,52,8),n+8}h.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||N(e,t,this.length);for(var r=this[e],o=1,i=0;++i>>=0,t>>>=0,n||N(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},h.prototype.readUint8=h.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readBigUInt64LE=re((function(e){K(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);var r=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),o=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+n*Math.pow(2,24);return BigInt(r)+(BigInt(o)<>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);var r=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],o=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+n;return(BigInt(r)<>>=0,t>>>=0,n||N(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},h.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||N(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},h.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},h.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},h.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readBigInt64LE=re((function(e){K(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);var r=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(n<<24);return(BigInt(r)<>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);var r=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(r)<>>=0,t||N(e,4,this.length),c.read(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),c.read(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),c.read(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),c.read(this,e,!1,52,8)},h.prototype.writeUintLE=h.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||U(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i>>=0,n>>>=0,r)||U(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},h.prototype.writeUint8=h.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,1,255,0),this[t]=255&e,t+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeBigUInt64LE=re((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),h.prototype.writeBigUInt64BE=re((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),h.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);U(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},h.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);U(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},h.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},h.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},h.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeBigInt64LE=re((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),h.prototype.writeBigInt64BE=re((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),h.prototype.writeFloatLE=function(e,t,n){return W(this,e,t,!0,n)},h.prototype.writeFloatBE=function(e,t,n){return W(this,e,t,!1,n)},h.prototype.writeDoubleLE=function(e,t,n){return H(this,e,t,!0,n)},h.prototype.writeDoubleBE=function(e,t,n){return H(this,e,t,!1,n)},h.prototype.copy=function(e,t,n,r){if(!h.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(i=t;i=r+4;n-=3)t="_".concat(e.slice(n-3,n)).concat(t);return"".concat(e.slice(0,n)).concat(t)}function G(e,t,n,r,o,i){if(e>n||e3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(i+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(i+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(i+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(n).concat(s),new V.ERR_OUT_OF_RANGE("value",a,e)}!function(e,t,n){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||Z(t,e.length-(n+1))}(r,o,i)}function K(e,t){if("number"!==typeof e)throw new V.ERR_INVALID_ARG_TYPE(t,"number",e)}function Z(e,t,n){if(Math.floor(e)!==e)throw K(e,n),new V.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new V.ERR_BUFFER_OUT_OF_BOUNDS;throw new V.ERR_OUT_OF_RANGE(n||"offset",">= ".concat(n?1:0," and <= ").concat(t),e)}Y("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),Y("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),Y("ERR_OUT_OF_RANGE",(function(e,t,n){var r='The value of "'.concat(e,'" is out of range.'),o=n;return Number.isInteger(n)&&Math.abs(n)>Math.pow(2,32)?o=q(String(n)):"bigint"===typeof n&&(o=String(n),(n>Math.pow(BigInt(2),BigInt(32))||n<-Math.pow(BigInt(2),BigInt(32)))&&(o=q(o)),o+="n"),r+=" It must be ".concat(t,". Received ").concat(o)}),RangeError);var $=/[^+/0-9A-Za-z-_]/g;function Q(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function J(e){return u.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function X(e,t,n,r){var o;for(o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function ee(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function te(e){return e!==e}var ne=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,o=0;o<16;++o)t[r+o]=e[n]+e[o];return t}();function re(e){return"undefined"===typeof BigInt?oe:e}function oe(){throw new Error("BigInt not supported")}},44632:function(e){e.exports=function(){for(var e=arguments.length,t=[],n=0;n>8&255]},Y=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},q=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},G=function(e){return z(e,23,4)},K=function(e){return z(e,52,8)},Z=function(e,t){b(e.prototype,t,{get:function(){return T(this)[t]}})},$=function(e,t,n,r){var o=p(n),i=T(e);if(o+t>i.byteLength)throw U(C);var a=T(i.buffer).bytes,s=o+i.byteOffset,u=w(a,s,s+t);return r?u:F(u)},Q=function(e,t,n,r,o,i){var a=p(n),s=T(e);if(a+t>s.byteLength)throw U(C);for(var u=T(s.buffer).bytes,c=a+s.byteOffset,l=r(+o),f=0;fte;)(X=ee[te++])in D||u(D,X,R[X]);P.constructor=D}_&&g(j)!==L&&_(j,L);var ne=new I(new D(2)),re=o(j.setInt8);ne.setInt8(0,2147483648),ne.setInt8(1,2147483649),!ne.getInt8(0)&&ne.getInt8(1)||c(j,{setInt8:function(e,t){re(this,e,t<<24>>24)},setUint8:function(e,t){re(this,e,t<<24>>24)}},{unsafe:!0})}else P=(D=function(e){f(this,P);var t=p(e);O(this,{bytes:B(N(t),0),byteLength:t}),i||(this.byteLength=t)}).prototype,j=(I=function(e,t,n){f(this,j),f(e,P);var r=T(e).byteLength,o=d(t);if(o<0||o>r)throw U("Wrong offset");if(o+(n=void 0===n?r-o:h(n))>r)throw U("Wrong length");O(this,{buffer:e,byteLength:n,byteOffset:o}),i||(this.buffer=e,this.byteLength=n,this.byteOffset=o)}).prototype,i&&(Z(D,"byteLength"),Z(I,"buffer"),Z(I,"byteLength"),Z(I,"byteOffset")),c(j,{getInt8:function(e){return $(this,1,e)[0]<<24>>24},getUint8:function(e){return $(this,1,e)[0]},getInt16:function(e){var t=$(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=$(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return q($(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return q($(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return W($(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return W($(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Q(this,1,e,H,t)},setUint8:function(e,t){Q(this,1,e,H,t)},setInt16:function(e,t){Q(this,2,e,V,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Q(this,2,e,V,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Q(this,4,e,Y,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Q(this,4,e,Y,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Q(this,4,e,G,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Q(this,8,e,K,t,arguments.length>2?arguments[2]:void 0)}});x(D,M),x(I,A),e.exports={ArrayBuffer:D,DataView:I}},88891:function(e,t,n){"use strict";var r=n(11446),o=n(53864),i=n(76425),a=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),s=i(n),u=o(e,s),c=o(t,s),l=arguments.length>2?arguments[2]:void 0,f=a((void 0===l?s:o(l,s))-c,s-u),d=1;for(c0;)c in n?n[u]=n[c]:delete n[u],u+=d,c+=d;return n}},76206:function(e,t,n){"use strict";var r=n(11446),o=n(53864),i=n(76425);e.exports=function(e){for(var t=r(this),n=i(t),a=arguments.length,s=o(a>1?arguments[1]:void 0,n),u=a>2?arguments[2]:void 0,c=void 0===u?n:o(u,n);c>s;)t[s++]=e;return t}},3424:function(e,t,n){"use strict";var r=n(79056).forEach,o=n(11689)("forEach");e.exports=o?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},45034:function(e,t,n){var r=n(76425);e.exports=function(e,t){for(var n=0,o=r(t),i=new e(o);o>n;)i[n]=t[n++];return i}},97509:function(e,t,n){"use strict";var r=n(19782),o=n(25852),i=n(37892),a=n(11446),s=n(19780),u=n(77487),c=n(73011),l=n(76425),f=n(36072),d=n(68029),h=n(84284),p=r.Array;e.exports=function(e){var t=a(e),n=c(this),r=arguments.length,m=r>1?arguments[1]:void 0,g=void 0!==m;g&&(m=o(m,r>2?arguments[2]:void 0));var _,v,b,y,w,x,E=h(t),k=0;if(!E||this==p&&u(E))for(_=l(t),v=n?new this(_):p(_);_>k;k++)x=g?m(t[k],k):t[k],f(v,k,x);else for(w=(y=d(t,E)).next,v=n?new this:[];!(b=i(w,y)).done;k++)x=g?s(y,m,[b.value,k],!0):b.value,f(v,k,x);return v.length=k,v}},49821:function(e,t,n){var r=n(76494),o=n(53864),i=n(76425),a=function(e){return function(t,n,a){var s,u=r(t),c=i(u),l=o(a,c);if(e&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},79056:function(e,t,n){var r=n(25852),o=n(34534),i=n(70769),a=n(11446),s=n(76425),u=n(41180),c=o([].push),l=function(e){var t=1==e,n=2==e,o=3==e,l=4==e,f=6==e,d=7==e,h=5==e||f;return function(p,m,g,_){for(var v,b,y=a(p),w=i(y),x=r(m,g),E=s(w),k=0,S=_||u,T=t?S(p,E):n||d?S(p,0):void 0;E>k;k++)if((h||k in w)&&(b=x(v=w[k],k,y),e))if(t)T[k]=b;else if(b)switch(e){case 3:return!0;case 5:return v;case 6:return k;case 2:c(T,v)}else switch(e){case 4:return!1;case 7:c(T,v)}return f?-1:o||l?l:T}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},34116:function(e,t,n){"use strict";var r=n(12256),o=n(76494),i=n(56501),a=n(76425),s=n(11689),u=Math.min,c=[].lastIndexOf,l=!!c&&1/[1].lastIndexOf(1,-0)<0,f=s("lastIndexOf"),d=l||!f;e.exports=d?function(e){if(l)return r(c,this,arguments)||0;var t=o(this),n=a(t),s=n-1;for(arguments.length>1&&(s=u(s,i(arguments[1]))),s<0&&(s=n+s);s>=0;s--)if(s in t&&t[s]===e)return s||0;return-1}:c},76205:function(e,t,n){var r=n(66111),o=n(75508),i=n(32504),a=o("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},11689:function(e,t,n){"use strict";var r=n(66111);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},69998:function(e,t,n){var r=n(19782),o=n(68973),i=n(11446),a=n(70769),s=n(76425),u=r.TypeError,c=function(e){return function(t,n,r,c){o(n);var l=i(t),f=a(l),d=s(l),h=e?d-1:0,p=e?-1:1;if(r<2)for(;;){if(h in f){c=f[h],h+=p;break}if(h+=p,e?h<0:d<=h)throw u("Reduce of empty array with no initial value")}for(;e?h>=0:d>h;h+=p)h in f&&(c=n(c,f[h],h,l));return c}};e.exports={left:c(!1),right:c(!0)}},92914:function(e,t,n){var r=n(19782),o=n(53864),i=n(76425),a=n(36072),s=r.Array,u=Math.max;e.exports=function(e,t,n){for(var r=i(e),c=o(t,r),l=o(void 0===n?r:n,r),f=s(u(l-c,0)),d=0;c0;)e[r]=e[--r];r!==i++&&(e[r]=n)}return e},a=function(e,t,n,r){for(var o=t.length,i=n.length,a=0,s=0;a1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!v(this,e)}}),i(h,n?{get:function(e){var t=v(this,e);return t&&t.value},set:function(e,t){return _(this,0===e?0:e,t)}}:{add:function(e){return _(this,e=0===e?0:e,e)}}),f&&r(h,"size",{get:function(){return g(this).size}}),l},setStrong:function(e,t,n){var r=t+" Iterator",o=m(t),i=m(r);c(e,t,(function(e,t){p(this,{type:r,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),l(t)}}},70655:function(e,t,n){"use strict";var r=n(34534),o=n(66814),i=n(36781).getWeakData,a=n(59799),s=n(34965),u=n(35793),c=n(81413),l=n(79056),f=n(78320),d=n(25313),h=d.set,p=d.getterFor,m=l.find,g=l.findIndex,_=r([].splice),v=0,b=function(e){return e.frozen||(e.frozen=new y)},y=function(){this.entries=[]},w=function(e,t){return m(e.entries,(function(e){return e[0]===t}))};y.prototype={get:function(e){var t=w(this,e);if(t)return t[1]},has:function(e){return!!w(this,e)},set:function(e,t){var n=w(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=g(this.entries,(function(t){return t[0]===e}));return~t&&_(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,n,r){var l=e((function(e,o){u(e,d),h(e,{type:t,id:v++,frozen:void 0}),void 0!=o&&c(o,e[r],{that:e,AS_ENTRIES:n})})),d=l.prototype,m=p(t),g=function(e,t,n){var r=m(e),o=i(a(t),!0);return!0===o?b(r).set(t,n):o[r.id]=n,e};return o(d,{delete:function(e){var t=m(this);if(!s(e))return!1;var n=i(e);return!0===n?b(t).delete(e):n&&f(n,t.id)&&delete n[t.id]},has:function(e){var t=m(this);if(!s(e))return!1;var n=i(e);return!0===n?b(t).has(e):n&&f(n,t.id)}}),o(d,n?{get:function(e){var t=m(this);if(s(e)){var n=i(e);return!0===n?b(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return g(this,e,t)}}:{add:function(e){return g(this,e,!0)}}),l}}},19881:function(e,t,n){"use strict";var r=n(73587),o=n(19782),i=n(34534),a=n(79492),s=n(86255),u=n(36781),c=n(81413),l=n(35793),f=n(30171),d=n(34965),h=n(66111),p=n(21784),m=n(21117),g=n(2142);e.exports=function(e,t,n){var _=-1!==e.indexOf("Map"),v=-1!==e.indexOf("Weak"),b=_?"set":"add",y=o[e],w=y&&y.prototype,x=y,E={},k=function(e){var t=i(w[e]);s(w,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(v&&!d(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return v&&!d(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(v&&!d(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(a(e,!f(y)||!(v||w.forEach&&!h((function(){(new y).entries().next()})))))x=n.getConstructor(t,e,_,b),u.enable();else if(a(e,!0)){var S=new x,T=S[b](v?{}:-0,1)!=S,O=h((function(){S.has(1)})),M=p((function(e){new y(e)})),A=!v&&h((function(){for(var e=new y,t=5;t--;)e[b](t,t);return!e.has(-0)}));M||((x=t((function(e,t){l(e,w);var n=g(new y,e,x);return void 0!=t&&c(t,n[b],{that:n,AS_ENTRIES:_}),n}))).prototype=w,w.constructor=x),(O||A)&&(k("delete"),k("has"),_&&k("get")),(A||T)&&k(b),v&&w.clear&&delete w.clear}return E[e]=x,r({global:!0,forced:x!=y},E),m(x,e),v||n.setStrong(x,e,_),x}},11147:function(e,t,n){var r=n(78320),o=n(20412),i=n(82530),a=n(81684);e.exports=function(e,t,n){for(var s=o(t),u=a.f,c=i.f,l=0;l"+u+""}},16728:function(e,t,n){"use strict";var r=n(11647).IteratorPrototype,o=n(83302),i=n(80431),a=n(21117),s=n(55706),u=function(){return this};e.exports=function(e,t,n,c){var l=t+" Iterator";return e.prototype=o(r,{next:i(+!c,n)}),a(e,l,!1,!0),s[l]=u,e}},87454:function(e,t,n){var r=n(37420),o=n(81684),i=n(80431);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},80431:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},36072:function(e,t,n){"use strict";var r=n(44560),o=n(81684),i=n(80431);e.exports=function(e,t,n){var a=r(t);a in e?o.f(e,a,i(0,n)):e[a]=n}},31022:function(e,t,n){"use strict";var r=n(19782),o=n(59799),i=n(83131),a=r.TypeError;e.exports=function(e){if(o(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw a("Incorrect hint");return i(this,e)}},99035:function(e,t,n){"use strict";var r=n(73587),o=n(37892),i=n(42192),a=n(21774),s=n(30171),u=n(16728),c=n(7209),l=n(32695),f=n(21117),d=n(87454),h=n(86255),p=n(75508),m=n(55706),g=n(11647),_=a.PROPER,v=a.CONFIGURABLE,b=g.IteratorPrototype,y=g.BUGGY_SAFARI_ITERATORS,w=p("iterator"),x="keys",E="values",k="entries",S=function(){return this};e.exports=function(e,t,n,a,p,g,T){u(n,t,a);var O,M,A,C=function(e){if(e===p&&j)return j;if(!y&&e in P)return P[e];switch(e){case x:case E:case k:return function(){return new n(this,e)}}return function(){return new n(this)}},R=t+" Iterator",D=!1,P=e.prototype,I=P[w]||P["@@iterator"]||p&&P[p],j=!y&&I||C(p),L="Array"==t&&P.entries||I;if(L&&(O=c(L.call(new e)))!==Object.prototype&&O.next&&(i||c(O)===b||(l?l(O,b):s(O[w])||h(O,w,S)),f(O,R,!0,!0),i&&(m[R]=S)),_&&p==E&&I&&I.name!==E&&(!i&&v?d(P,"name",E):(D=!0,j=function(){return o(I,this)})),p)if(M={values:C(E),keys:g?j:C(x),entries:C(k)},T)for(A in M)(y||D||!(A in P))&&h(P,A,M[A]);else r({target:t,proto:!0,forced:y||D},M);return i&&!T||P[w]===j||h(P,w,j,{name:p}),m[t]=j,M}},43611:function(e,t,n){var r=n(30306),o=n(78320),i=n(17659),a=n(81684).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},37420:function(e,t,n){var r=n(66111);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},20916:function(e,t,n){var r=n(19782),o=n(34965),i=r.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},7727:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},17255:function(e,t,n){var r=n(20916)("span").classList,o=r&&r.constructor&&r.constructor.prototype;e.exports=o===Object.prototype?void 0:o},62554:function(e,t,n){var r=n(64771).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},32599:function(e){e.exports="object"==typeof window&&"object"!=typeof Deno},90907:function(e,t,n){var r=n(64771);e.exports=/MSIE|Trident/.test(r)},37290:function(e,t,n){var r=n(64771),o=n(19782);e.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==o.Pebble},98716:function(e,t,n){var r=n(64771);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},70520:function(e,t,n){var r=n(73135),o=n(19782);e.exports="process"==r(o.process)},25053:function(e,t,n){var r=n(64771);e.exports=/web0s(?!.*chrome)/i.test(r)},64771:function(e,t,n){var r=n(66780);e.exports=r("navigator","userAgent")||""},32504:function(e,t,n){var r,o,i=n(19782),a=n(64771),s=i.process,u=i.Deno,c=s&&s.versions||u&&u.version,l=c&&c.v8;l&&(o=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},35199:function(e,t,n){var r=n(64771).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},28605:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},73587:function(e,t,n){var r=n(19782),o=n(82530).f,i=n(87454),a=n(86255),s=n(4958),u=n(11147),c=n(79492);e.exports=function(e,t){var n,l,f,d,h,p=e.target,m=e.global,g=e.stat;if(n=m?r:g?r[p]||s(p,{}):(r[p]||{}).prototype)for(l in t){if(d=t[l],f=e.noTargetGet?(h=o(n,l))&&h.value:n[l],!c(m?l:p+(g?".":"#")+l,e.forced)&&void 0!==f){if(typeof d==typeof f)continue;u(d,f)}(e.sham||f&&f.sham)&&i(d,"sham",!0),a(n,l,d,e)}}},66111:function(e){e.exports=function(e){try{return!!e()}catch(t){return!0}}},88635:function(e,t,n){"use strict";n(4541);var r=n(34534),o=n(86255),i=n(75493),a=n(66111),s=n(75508),u=n(87454),c=s("species"),l=RegExp.prototype;e.exports=function(e,t,n,f){var d=s(e),h=!a((function(){var t={};return t[d]=function(){return 7},7!=""[e](t)})),p=h&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return t=!0,null},n[d](""),!t}));if(!h||!p||n){var m=r(/./[d]),g=t(d,""[e],(function(e,t,n,o,a){var s=r(e),u=t.exec;return u===i||u===l.exec?h&&!a?{done:!0,value:m(t,n,o)}:{done:!0,value:s(n,t,o)}:{done:!1}}));o(String.prototype,e,g[0]),o(l,d,g[1])}f&&u(l[d],"sham",!0)}},58504:function(e,t,n){"use strict";var r=n(19782),o=n(38162),i=n(76425),a=n(25852),s=r.TypeError;e.exports=function e(t,n,r,u,c,l,f,d){for(var h,p=c,m=0,g=!!f&&a(f,d);m0&&o(h))p=e(t,n,h,i(h),p,l-1)-1;else{if(p>=9007199254740991)throw s("Exceed the acceptable array length");t[p]=h}p++}m++}return p}},31561:function(e,t,n){var r=n(66111);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},12256:function(e,t,n){var r=n(55830),o=Function.prototype,i=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(i):function(){return a.apply(i,arguments)})},25852:function(e,t,n){var r=n(34534),o=n(68973),i=n(55830),a=r(r.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?a(e,t):function(){return e.apply(t,arguments)}}},55830:function(e,t,n){var r=n(66111);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},5268:function(e,t,n){"use strict";var r=n(19782),o=n(34534),i=n(68973),a=n(34965),s=n(78320),u=n(51346),c=n(55830),l=r.Function,f=o([].concat),d=o([].join),h={},p=function(e,t,n){if(!s(h,t)){for(var r=[],o=0;o]*>)/g,l=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,f,d){var h=n+e.length,p=r.length,m=l;return void 0!==f&&(f=o(f),m=c),s(d,m,(function(o,s){var c;switch(a(s,0)){case"$":return"$";case"&":return e;case"`":return u(t,0,n);case"'":return u(t,h);case"<":c=f[u(s,1,-1)];break;default:var l=+s;if(0===l)return o;if(l>p){var d=i(l/10);return 0===d?o:d<=p?void 0===r[d-1]?a(s,1):r[d-1]+a(s,1):o}c=r[l-1]}return void 0===c?"":c}))}},19782:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},78320:function(e,t,n){var r=n(34534),o=n(11446),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},52819:function(e){e.exports={}},81628:function(e,t,n){var r=n(19782);e.exports=function(e,t){var n=r.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}},4836:function(e,t,n){var r=n(66780);e.exports=r("document","documentElement")},53373:function(e,t,n){var r=n(37420),o=n(66111),i=n(20916);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},44221:function(e,t,n){var r=n(19782).Array,o=Math.abs,i=Math.pow,a=Math.floor,s=Math.log,u=Math.LN2;e.exports={pack:function(e,t,n){var c,l,f,d=r(n),h=8*n-t-1,p=(1<>1,g=23===t?i(2,-24)-i(2,-77):0,_=e<0||0===e&&1/e<0?1:0,v=0;for((e=o(e))!=e||e===1/0?(l=e!=e?1:0,c=p):(c=a(s(e)/u),e*(f=i(2,-c))<1&&(c--,f*=2),(e+=c+m>=1?g/f:g*i(2,1-m))*f>=2&&(c++,f/=2),c+m>=p?(l=0,c=p):c+m>=1?(l=(e*f-1)*i(2,t),c+=m):(l=e*i(2,m-1)*i(2,t),c=0));t>=8;)d[v++]=255&l,l/=256,t-=8;for(c=c<0;)d[v++]=255&c,c/=256,h-=8;return d[--v]|=128*_,d},unpack:function(e,t){var n,r=e.length,o=8*r-t-1,a=(1<>1,u=o-7,c=r-1,l=e[c--],f=127&l;for(l>>=7;u>0;)f=256*f+e[c--],u-=8;for(n=f&(1<<-u)-1,f>>=-u,u+=t;u>0;)n=256*n+e[c--],u-=8;if(0===f)f=1-s;else{if(f===a)return n?NaN:l?-1/0:1/0;n+=i(2,t),f-=s}return(l?-1:1)*n*i(2,f-t)}}},70769:function(e,t,n){var r=n(19782),o=n(34534),i=n(66111),a=n(73135),s=r.Object,u=o("".split);e.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?u(e,""):s(e)}:s},2142:function(e,t,n){var r=n(30171),o=n(34965),i=n(32695);e.exports=function(e,t,n){var a,s;return i&&r(a=t.constructor)&&a!==n&&o(s=a.prototype)&&s!==n.prototype&&i(e,s),e}},50112:function(e,t,n){var r=n(34534),o=n(30171),i=n(58749),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},36781:function(e,t,n){var r=n(73587),o=n(34534),i=n(52819),a=n(34965),s=n(78320),u=n(81684).f,c=n(59814),l=n(64350),f=n(61481),d=n(39020),h=n(31561),p=!1,m=d("meta"),g=0,_=function(e){u(e,m,{value:{objectID:"O"+g++,weakData:{}}})},v=e.exports={enable:function(){v.enable=function(){},p=!0;var e=c.f,t=o([].splice),n={};n[m]=1,e(n).length&&(c.f=function(n){for(var r=e(n),o=0,i=r.length;ov;v++)if((y=A(e[v]))&&l(g,y))return y;return new m(!1)}r=f(e,_)}for(w=r.next;!(x=i(w,r)).done;){try{y=A(x.value)}catch(C){h(r,"throw",C)}if("object"==typeof y&&y&&l(g,y))return y}return new m(!1)}},78300:function(e,t,n){var r=n(37892),o=n(59799),i=n(62135);e.exports=function(e,t,n){var a,s;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(u){s=!0,a=u}if("throw"===t)throw n;if(s)throw a;return o(a),n}},11647:function(e,t,n){"use strict";var r,o,i,a=n(66111),s=n(30171),u=n(83302),c=n(7209),l=n(86255),f=n(75508),d=n(42192),h=f("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(o=c(c(i)))!==Object.prototype&&(r=o):p=!0),void 0==r||a((function(){var e={};return r[h].call(e)!==e}))?r={}:d&&(r=u(r)),s(r[h])||l(r,h,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},55706:function(e){e.exports={}},76425:function(e,t,n){var r=n(61234);e.exports=function(e){return r(e.length)}},19898:function(e){var t=Math.expm1,n=Math.exp;e.exports=!t||t(10)>22025.465794806718||t(10)<22025.465794806718||-2e-17!=t(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:n(e)-1}:t},32319:function(e,t,n){var r=n(49093),o=Math.abs,i=Math.pow,a=i(2,-52),s=i(2,-23),u=i(2,127)*(2-s),c=i(2,-126);e.exports=Math.fround||function(e){var t,n,i=o(e),l=r(e);return iu||n!=n?l*(1/0):l*n}},53521:function(e){var t=Math.log,n=Math.LOG10E;e.exports=Math.log10||function(e){return t(e)*n}},26702:function(e){var t=Math.log;e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:t(1+e)}},49093:function(e){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},20209:function(e,t,n){var r,o,i,a,s,u,c,l,f=n(19782),d=n(25852),h=n(82530).f,p=n(11092).set,m=n(98716),g=n(37290),_=n(25053),v=n(70520),b=f.MutationObserver||f.WebKitMutationObserver,y=f.document,w=f.process,x=f.Promise,E=h(f,"queueMicrotask"),k=E&&E.value;k||(r=function(){var e,t;for(v&&(e=w.domain)&&e.exit();o;){t=o.fn,o=o.next;try{t()}catch(n){throw o?a():i=void 0,n}}i=void 0,e&&e.enter()},m||v||_||!b||!y?!g&&x&&x.resolve?((c=x.resolve(void 0)).constructor=x,l=d(c.then,c),a=function(){l(r)}):v?a=function(){w.nextTick(r)}:(p=d(p,f),a=function(){p(r)}):(s=!0,u=y.createTextNode(""),new b(r).observe(u,{characterData:!0}),a=function(){u.data=s=!s})),e.exports=k||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,a()),i=t}},48022:function(e,t,n){var r=n(23458);e.exports=r&&!!Symbol.for&&!!Symbol.keyFor},23458:function(e,t,n){var r=n(32504),o=n(66111);e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},2347:function(e,t,n){var r=n(66111),o=n(75508),i=n(42192),a=o("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),i&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://\u0442\u0435\u0441\u0442").host||"#%D0%B1"!==new URL("http://a#\u0431").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},33280:function(e,t,n){var r=n(19782),o=n(30171),i=n(50112),a=r.WeakMap;e.exports=o(a)&&/native code/.test(i(a))},54249:function(e,t,n){"use strict";var r=n(68973),o=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new o(e)}},63522:function(e,t,n){var r=n(19782),o=n(22872),i=r.TypeError;e.exports=function(e){if(o(e))throw i("The method doesn't accept regular expressions");return e}},31024:function(e,t,n){var r=n(19782).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&r(e)}},96048:function(e,t,n){var r=n(19782),o=n(66111),i=n(34534),a=n(55217),s=n(58119).trim,u=n(31136),c=i("".charAt),l=r.parseFloat,f=r.Symbol,d=f&&f.iterator,h=1/l(u+"-0")!==-1/0||d&&!o((function(){l(Object(d))}));e.exports=h?function(e){var t=s(a(e)),n=l(t);return 0===n&&"-"==c(t,0)?-0:n}:l},39232:function(e,t,n){var r=n(19782),o=n(66111),i=n(34534),a=n(55217),s=n(58119).trim,u=n(31136),c=r.parseInt,l=r.Symbol,f=l&&l.iterator,d=/^[+-]?0x/i,h=i(d.exec),p=8!==c(u+"08")||22!==c(u+"0x16")||f&&!o((function(){c(Object(f))}));e.exports=p?function(e,t){var n=s(a(e));return c(n,t>>>0||(h(d,n)?16:10))}:c},85698:function(e,t,n){"use strict";var r=n(37420),o=n(34534),i=n(37892),a=n(66111),s=n(11467),u=n(51186),c=n(23509),l=n(11446),f=n(70769),d=Object.assign,h=Object.defineProperty,p=o([].concat);e.exports=!d||a((function(){if(r&&1!==d({b:1},d(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),o="abcdefghijklmnopqrst";return e[n]=7,o.split("").forEach((function(e){t[e]=e})),7!=d({},e)[n]||s(d({},t)).join("")!=o}))?function(e,t){for(var n=l(e),o=arguments.length,a=1,d=u.f,h=c.f;o>a;)for(var m,g=f(arguments[a++]),_=d?p(s(g),d(g)):s(g),v=_.length,b=0;v>b;)m=_[b++],r&&!i(h,g,m)||(n[m]=g[m]);return n}:d},83302:function(e,t,n){var r,o=n(59799),i=n(3415),a=n(28605),s=n(52819),u=n(4836),c=n(20916),l=n(59325),f=l("IE_PROTO"),d=function(){},h=function(e){return"