(window.tawkJsonp=window.tawkJsonp||[]).push([["chunk-2d0da3af"],{"6b5b":function(t,e,i){"use strict";i.r(e);var s=i("5a60"),a=i("2f62"),o=i("f0b0"),r=i("2966"),n=i("87dd"),c=i("5868");function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function m(t){for(var e=1;ewindow.innerWidth&&(t=window.innerWidth-this.previewXOffset),"".concat(t,"px")},frameHeight:function(){return"".concat((this.height+45)*this.zoomRatio,"px")},previewYOffset:function(){var t=this.mobileBrowserName?this.minMobile:this.minDesktop,e=this.mobileBrowserName?this.yOffsetMobile:this.yOffset;return this.isCenter?e:(t.height+this.padding/2+e)*this.zoomRatio},previewXOffset:function(){var t=this.mobileBrowserName?this.minMobile:this.minDesktop,e=this.mobileBrowserName?this.xOffsetMobile:this.xOffset;return this.isCenter?(t.height+this.padding+e)*this.zoomRatio:e*this.zoomRatio},styleObject:function(){var t={"position:":"fixed !important;","height:":"".concat(this.frameHeight," !important;"),"width:":"".concat(this.frameWidth," !important;"),"min-height:":"".concat(this.frameHeight," !important;"),"min-width:":"".concat(this.frameWidth," !important;"),"max-height:":"".concat(this.frameHeight," !important;"),"max-width:":"".concat(this.frameWidth," !important;")};return this.isCenter?(t["top:"]="calc(50% + ".concat(this.previewYOffset,"px);"),t["transform:"]="translate(0, -50%) !important;",t["-webkit-transform:"]="translate(0, -50%) !important;"):this.isBottom?t["bottom:"]="".concat(this.previewYOffset,"px;"):t["top:"]="".concat(this.previewYOffset,"px;"),this.isRight?t["right:"]="".concat(this.previewXOffset,"px !important;"):t["left:"]="".concat(this.previewXOffset,"px !important;"),this.isVisible?t["display:"]="block !important;":t["display:"]="none !important;",m(m({},this.genericStyles),t)},isLiveChatFeatureEnabled:function(){return!!(this.hasLiveChat||this.hasChatStarted&&this.agentsCount>0)},isSurveyOptionOnly:function(){var t=!0;return this.messages.filter((function(e){(!e.surveyObj||e.surveyObj&&0!==e.message.length)&&(t=!1)})),t},getSurveyOptions:function(){var t={};if(this.messages.length){var e=this.messages.length-1,i=this.messages[e];i.surveyObj&&((t=i.surveyObj).senderType=i.senderType)}return t},chatBubbleCustomStyle:function(){var t={};return this.isBottom?this.isRight?t["border-bottom-right-radius"]="0px":t["border-bottom-left-radius"]="0px":this.isRight?t["border-top-right-radius"]="0px":t["border-top-left-radius"]="0px",t}}),data:function(){return{isCloseVisible:!1,backgroundColor:this.$store.getters["widget/headerBgColor"],cssLink:"".concat("https://embed.tawk.to/_s/v4/app/682d3d4dbc8","/css/message-preview.css"),isVisible:!1,messages:[],isDuration:!0,height:100,isLive:!0,padding:20,key:o.Helper.generateUUID()}},watch:{incomingMessage:function(t,e){"min"===this.chatWindowState&&t&&"v"!==t.senderType&&(!e||!e.cver||e.cver&&e.cver0&&(this.isBottom?this.messages[0].showProfile=!0:this.messages[this.messages.length-1].showProfile=!0)),this.messages.length>0)this.messages[this.messages.length-1].ownerId===t.ownerId&&(t.showProfile=!1);this.isBottom?this.messages.push(t):this.messages.unshift(t),this.recalculateHeight()}},recalculateHeight:function(){var t=this;setTimeout((function(){t.height=t.$refs["tawk-message-preview-content"].clientHeight+100;var e=window.innerHeight-t.previewYOffset-45;t.$refs["tawk-chat-message-container"].style["max-height"]="".concat(e*t.zoomRatio,"px"),t.$refs["tawk-chat-message-container"].scrollTop=999999999,t.scaleContent()}),300)},limitMessageLength:function(t,e){var i=0;if(t.length>e)for(i=0;i"===t.substring(s,s+1)){e-=1;break}}else i++;return t.substring(0,e)+(t.length>e?"[...]":"")},dismissPreview:function(t,e){if(t&&t.stopPropagation(),this.messages.length){if(!e){var i=this.messages[this.messages.length-1];if(!i||!i.timeStamp)return;this.$socket.publish("visitorChatDismiss",{timestamp:i.timeStamp},(function(){}))}this.clearMessages()}},scaleContent:function(){if(this.mobileBrowserName){var t,e=this.isRight?"right":"left";if(t=this.isBottom?"bottom":"top",!this.$TawkWindow.isMobileOptimizedWebsite){var i="scale(".concat(this.zoomRatio,")"),s="-moz-transform: ".concat(i,";\n\t\t\t\t\t\t\t-webkit-transform: ").concat(i,";\n\t\t\t\t\t\t\t-o-transform: ").concat(i,";\n\t\t\t\t\t\t\t-ms-transform: ").concat(i,";\n\t\t\t\t\t\t\ttransform: ").concat(i,";"),a="-moz-transform-origin: ".concat(t," ").concat(e,";\n\t\t\t\t\t\t\t\t-webkit-transform-origin: ").concat(t," ").concat(e,";\n\t\t\t\t\t\t\t\t-o-transform-orgin: ").concat(t," ").concat(e,";\n\t\t\t\t\t\t\t\t-ms-transform-origin: ").concat(t," ").concat(e,";\n\t\t\t\t\t\t\t\ttransform-origin: ").concat(t," ").concat(e);this.$refs["tawk-message-preview-content"].style.cssText+=s+a;var o=parseInt(this.frameWidth.replace("px",""),10);o&&(o/=this.zoomRatio),this.$refs["tawk-message-preview"].style.width="".concat(o,"px")}}},loaded:function(){var t,e=this;t=this.$refs["tawk-message-preview"]?parseFloat(getComputedStyle(this.$refs["tawk-message-preview"]).fontSize):16,this.textAreaHeight=t+2,this.$eventBus.$on("resetState",(function(){e.clearMessages()}))},submitSurvey:function(t){this.$TawkChatManager.sendMessage({message:t})},parseMarkdown:function(t){try{var e,i=this.$TawkWindow.makeHtml(t);return((i=i.replace(c.a.regLineBreaks,c.a.br))instanceof Error||void 0===i)&&this.$TawkLogger.reportError({error:i,source:{name:"components/message-preview/base.vue",method:"parseMarkdown()"},data:{propertyId:this.propertyId,widgetId:this.widgetId,os:this.os,userAgent:null===(e=navigator)||void 0===e?void 0:e.userAgent}}),i}catch(e){var s;return this.$TawkLogger.reportError({error:e,source:{name:"components/message-preview/base.vue",method:"parseMarkdown()"},data:{propertyId:this.propertyId,widgetId:this.widgetId,os:this.os,userAgent:null===(s=navigator)||void 0===s?void 0:s.userAgent}}),t}},handleMouseOver:function(){this.isCloseVisible&&!this.mobileBrowserName||(this.isCloseVisible=!0)},handleMouseLeave:function(){(this.isCloseVisible||this.mobileBrowserName)&&(this.isCloseVisible=!1)}}),mounted:function(){var t=this;window.addEventListener("resize",this.recalculateHeight),this.$eventBus.$on("dismissPreview",(function(e){e.ts&&t.dismissPreview(null,!0)})),this.$eventBus.$on("switchWidget",(function(){t.key=o.Helper.generateUUID()})),this.mobileBrowserName&&(this.isCloseVisible=!0)},beforeDestroy:function(){window.removeEventListener("resize",this.recalculateHeight),this.$eventBus.$off("dismissPreview")}},u=i("2877"),f=Object(u.a)(d,(function(){var t=this,e=t._self._c;return e("i-frame",{key:t.key,attrs:{width:t.frameWidth,height:t.frameHeight,cssLink:t.cssLink,styleObject:t.styleObject}},[e("div",{staticClass:"tawk-flex",staticStyle:{width:"100%",height:"100%"},style:{"justify-content":"".concat(t.isRight?"flex-end":"flex-start")}},[e("div",{ref:"tawk-message-preview",staticClass:"tawk-flex tawk-message-preview tawk-fadeIn tawk-padding-small",class:[t.isBottom?"tawk-flex-bottom":"tawk-flex-top"],style:{width:"".concat(t.width,"px"),"justify-content":"".concat(t.isRight?"flex-end":"flex-start"),"box-sizing":"border-box"},attrs:{id:"tawk-message-preview"},on:{mouseover:t.handleMouseOver,mouseleave:t.handleMouseLeave}},[e("div",{ref:"tawk-message-preview-content",staticClass:"tawk-message-preview-content",attrs:{id:"tawk-message-preview-content"}},[e("div",{style:{visibility:"".concat(t.isCloseVisible?"visible":"hidden")}},[t.isLiveChatFeatureEnabled&&!t.isSurveyOptionOnly?e("tawk-card",{directives:[{name:"tawk-tooltip",rawName:"v-tawk-tooltip"}],staticClass:"tawk-message-preview-close tawk-box-shadow-xsmall",class:t.isRight?"tawk-margin-auto-left":"tawk-margin-auto-right",attrs:{id:"tawk-mpreview-close",role:"button",tabindex:"0","data-text":"".concat(t.$i18n("bubble","attention_grabber")),"aria-label":"".concat(t.$i18n("bubble","attention_grabber"))},on:{click:t.dismissPreview}},[e("tawk-icon",{attrs:{type:"x"}})],1):t._e()],1),t.incomingCall?e("div",{staticClass:"tawk-message-box tawk-call-card tawk-flex tawk-flex-bottom"},[e("tawk-card",{staticClass:"tawk-box-shadow-xsmall tawk-message tawk-call-card",class:t.isRight?"tawk-margin-auto-left":"tawk-margin-auto-right",style:t.chatBubbleCustomStyle,attrs:{size:"xsmall"}},[e("call-widget",{attrs:{fullVersion:!1}})],1)],1):t._e(),e("div",{directives:[{name:"show",rawName:"v-show",value:!t.incomingCall&&t.isLiveChatFeatureEnabled,expression:"!incomingCall &&\n\t\t\t\t\t\t\tisLiveChatFeatureEnabled"}]},[e("div",{ref:"tawk-chat-message-container",staticClass:"tawk-chat-message-container",attrs:{id:"tawk-chat-message-container",role:"button",tabindex:"0"},on:{click:t.maximizeWidget}},[e("transition-group",{attrs:{name:"list"}},t._l(t.messages,(function(i,s){return e("div",{key:"".concat(i.cver).concat(s),staticClass:"tawk-margin-xsmall-bottom"},[i.message.length||i.attchs?e("div",{staticClass:"tawk-message-box tawk-flex tawk-flex-bottom"},[e("tawk-card",{staticClass:"tawk-box-shadow-xsmall tawk-message",class:t.isRight?"tawk-margin-auto-left":"tawk-margin-auto-right",style:t.chatBubbleCustomStyle,attrs:{size:"small"}},[[i.attchs||i.snippet?e("tawk-chat-bubble",{staticClass:"tawk-message-preview-chat-bubble",attrs:{attachments:i.attchs},on:{imageLoaded:t.imageLoaded}},[e("div",{staticClass:"tawk-text-regular-3",staticStyle:{"font-size":".875rem"}},[i.snippet?e("tawk-emoji",{attrs:{emoji:t.parseMarkdown(i.snippet),enabled:t.emojiEnabled}}):t._e()],1)]):e("div",{staticClass:"tawk-margin-xsmall-bottom"},[e("tawk-icon",{attrs:{type:"attachment",size:"small"}}),t._v(" "+t._s(t.$i18n("chat","sent_form"))+" ")],1)]],2)],1):t._e()])})),0),Object.keys(t.getSurveyOptions).length&&"v"!==t.getSurveyOptions.senderType?e("div",[e("survey-options",{staticClass:"tawk-message tawk-margin-top",class:t.isRight?"tawk-flex-bottom tawk-margin-auto-left":"tawk-flex-top tawk-margin-auto-right",attrs:{options:t.getSurveyOptions.options},on:{selectSurvey:t.submitSurvey}})],1):t._e()],1)])])])])])}),[],!1,null,null,null);e.default=f.exports}}]);