stockbot-buyvm/tests/data/stock_files/twk-chunk-48f3b594.js
2023-12-02 14:49:13 -05:00

1 line
18 KiB
JavaScript

(window.tawkJsonp=window.tawkJsonp||[]).push([["chunk-48f3b594"],{"3bc8":function(t,e,i){"use strict";(function(t){var a=i("5a60"),s=i("2f62"),n=i("f0b0"),r=i("2966"),o=i("87dd");function l(t){return(l="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 c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,a)}return i}function h(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?c(Object(i),!0).forEach((function(e){g(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function g(t,e,i){return(e=function(t){var e=function(t,e){if("object"!==l(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var a=i.call(t,e||"default");if("object"!==l(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===l(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}e.a={name:"MessagePreview",components:{"i-frame":a.a,TawkChatInput:n.TawkChatInput,TawkCard:n.TawkCard,TawkIcon:n.TawkIcon,TawkAvatar:n.TawkAvatar,TawkVideo:n.TawkVideo,TawkImage:n.TawkImage,CallWidget:function(){return i.e("chunk-495d98f9").then(i.bind(null,"bcae"))},TawkEmoji:n.TawkEmoji,SurveyOptions:r.a,TawkChatBubble:n.TawkChatBubble},directives:{TawkTooltip:n.TawkTooltip},mixins:[o.a],computed:h(h({},Object(s.c)({minDesktop:"widget/minDesktop",minMobile:"widget/minMobile",pageStatus:"session/pageStatus",chatWindowState:"session/chatWindowState",showMessagePreview:"widget/showMessagePreview",isRight:"widget/isRight",isBottom:"widget/isBottom",isCenter:"widget/isCenter",features:"widget/features",isRoundWidget:"widget/isRoundWidget",incomingMessage:"chat/incomingMessage",chatVersion:"chat/chatVersion",states:"widget/states",prechatFormSubmitted:"session/prechatFormSubmitted",agentProfile:"chat/agentProfile",incomingCall:"chat/incomingCall",hasLiveChat:"widget/hasLiveChat",zoomRatio:"widget/zoomRatio",mobileBrowserName:"browserData/mobileBrowserName",hasChatStarted:"chat/hasChatStarted",agentsCount:"chat/agentsCount",emojiEnabled:"widget/emojiEnabled",isPrechatEnabled:"widget/isPrechatEnabled"})),{},{xOffset:function(){return t.Tawk_Window.widgetSettings.xOffset()},yOffset:function(){return t.Tawk_Window.widgetSettings.yOffset()},xOffsetMobile:function(){return t.Tawk_Window.widgetSettings.xOffsetMobile()},yOffsetMobile:function(){return t.Tawk_Window.widgetSettings.yOffsetMobile()},width:function(){var t=360;return this.mobileBrowserName&&(t=.6*window.screen.availWidth),t<360&&(t=360),window.innerWidth<=t+2*this.padding&&(t=window.innerWidth-2*this.padding),t},frameWidth:function(){var t=this.width*this.zoomRatio;return this.previewXOffset+t>window.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+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;",h(h({},this.genericStyles),t)},inputPlaceholder:function(){var t,e=this.states[this.pageStatus];if(e&&e.body&&e.body.length)for(var i=0;i<e.body.length;i++){var a=e.body[i];if("chat"===a.type){t=a.content.inputPlaceholder;break}}return t},showInputField:function(){return!(this.states.prechat&&this.states.prechat.handlers&&this.states.prechat.handlers.form&&!this.prechatFormSubmitted)},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.surveyObj.question.length)&&(t=!1)})),t},getSurveyOptions:function(){var t={};if(this.messages.length){var e=this.messages.length-1,i=this.messages[e];i.surveyObj&&i.surveyObj.question.length&&((t=i.surveyObj).senderType=i.senderType)}return t}}),data:function(){return{backgroundColor:this.$store.getters["widget/headerBgColor"],cssLink:"".concat("https://embed.tawk.to/_s/v4/app/6549ac0173e","/css/message-preview.css"),isVisible:!1,messages:[],isDuration:!0,height:100,isLive:!0,padding:20,isDraggedOver:!1,textAreaHeight:18}},watch:{incomingMessage:function(t,e){"min"===this.chatWindowState&&t&&"v"!==t.senderType&&(!e||!e.cver||e.cver&&e.cver<t.cver)&&(this.displayMessage(t),this.isVisible=!0)},chatWindowState:function(t){"max"===t&&this.clearMessages()},isVisible:function(e){t.Tawk_Window.eventBus.$emit("mpIsVisible",e)},incomingCall:function(t){"min"===this.chatWindowState&&(this.isVisible=!!t||0!==this.messages.length)}},methods:h(h({},Object(s.b)({toggleWidget:"session/toggleWidget",routerPush:"router/routerPush"})),{},{imageLoaded:function(){this.recalculateHeight()},maximizeWidget:function(){this.isVisible=!1,this.toggleWidget(),this.clearMessages(),this.isPrechatEnabled&&!this.prechatFormSubmitted?this.routerPush("prechat"):this.routerPush("chat")},clearMessages:function(){this.isVisible=!1,this.messages=[]},displayMessage:function(t){if("v"!==t.ut&&!t.callId){if(t.profileImg)t.profileImage="".concat("https://tawk.link","/").concat(t.profileImg);else if(t.data&&t.data.rsc){var e=this.agentProfile(t.data.rsc);if(!e)return;t.profileImage=e.profileImage}if(t.message?"s"===t.senderType?t.snippet=this.limitMessageLength(t.message,500):t.snippet=this.limitMessageLength(t.message,150):t.snippet="",t.showProfile=!0,3===this.messages.length&&((this.isBottom?this.messages.splice(0,1):this.messages.splice(-1,1))[0].showProfile&&this.messages.length>0&&(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+10;var e=window.innerHeight-t.previewYOffset-t.$refs["tawk-chatinput-container"].clientHeight-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()}),1e3)},limitMessageLength:function(t,e){var i=0;if(t.length>e)for(i=0;i<e;)if('<img class="emojione"'===t.substring(i,i+21)||'<a target="_blank"'===t.substring(i,i+18)){for(var a=i;a<t.length;a++)if(i++,e++,">"===t.substring(a,a+1)){e-=1;break}}else i++;return t.substring(0,e)+(t.length>e?"[...]":"")},emojiOpened:function(t){t?this.$refs["tawk-message-preview-content"].clientHeight<this.textAreaHeight+310&&(this.height=this.textAreaHeight+310):this.recalculateHeight()},textareaResized:function(t){this.$refs&&this.$refs["tawk-message-preview-content"]&&(t>=0?(this.textAreaHeight=t,this.height=this.$refs["tawk-message-preview-content"].clientHeight+10+t):this.recalculateHeight())},messageTyping:function(e){t.Tawk_Window.chatManager.sendMessagePreview(e)},sendMessage:function(e){var i=e.message,a=e.attachments;this.maximizeWidget(),t.Tawk_Window.chatManager.sendMessage({message:i,attachments:a}),this.clearMessages()},ratingClicked:function(e){this.maximizeWidget(),t.Tawk_Window.chatManager.changeRating(e),this.clearMessages()},filesAdded:function(){this.height=this.$refs["tawk-message-preview-content"].clientHeight+10+66},filesRemoved:function(){this.recalculateHeight()},sendFiles:function(e){t.Tawk_Window.chatManager.uploadFiles(e),this.clearMessages(),this.maximizeWidget()},dragover:function(t){this.isLiveChatFeatureEnabled&&this.features.upload&&(t.preventDefault(),this.isDraggedOver=!0,this.recalculateHeight())},dragleave:function(t){this.isLiveChatFeatureEnabled&&this.features.upload&&(t.preventDefault(),t.currentTarget.contains(t.relatedTarget)||(this.isDraggedOver=!1,this.recalculateHeight()))},drop:function(t){this.isLiveChatFeatureEnabled&&this.features.upload&&(t.preventDefault(),this.isDraggedOver=!1,this.$refs["tawk-chatinput"]&&this.$refs["tawk-chatinput"].$refs&&this.$refs["tawk-chatinput"].$refs.fileupload&&(this.$refs["tawk-chatinput"].$refs.fileupload.files=t.dataTransfer.files,this.$refs["tawk-chatinput"].onFileUpload()))},dismissPreview:function(e,i){if(e&&e.stopPropagation(),this.messages.length){if(!i){var a=this.messages[this.messages.length-1];if(!a||!a.timeStamp)return;t.Tawk_Window.app.$socket.publish("visitorChatDismiss",{timestamp:a.timeStamp},(function(){}))}this.clearMessages()}},scaleContent:function(){if(this.mobileBrowserName){var e,i=this.isRight?"right":"left";if(e=this.isBottom?"bottom":"top",!t.Tawk_Window.isMobileOptimizedWebsite){var a="scale(".concat(this.zoomRatio,")"),s="-moz-transform: ".concat(a,";\n\t\t\t\t\t\t\t-webkit-transform: ").concat(a,";\n\t\t\t\t\t\t\t-o-transform: ").concat(a,";\n\t\t\t\t\t\t\t-ms-transform: ").concat(a,";\n\t\t\t\t\t\t\ttransform: ").concat(a,";"),n="-moz-transform-origin: ".concat(e," ").concat(i,";\n\t\t\t\t\t\t\t\t-webkit-transform-origin: ").concat(e," ").concat(i,";\n\t\t\t\t\t\t\t\t-o-transform-orgin: ").concat(e," ").concat(i,";\n\t\t\t\t\t\t\t\t-ms-transform-origin: ").concat(e," ").concat(i,";\n\t\t\t\t\t\t\t\ttransform-origin: ").concat(e," ").concat(i);this.$refs["tawk-message-preview-content"].style.cssText+=s+n;var r=parseInt(this.frameWidth.replace("px",""),10);r&&(r/=this.zoomRatio),this.$refs["tawk-message-preview"].style.width="".concat(r,"px")}}},loaded:function(){var e,i=this;e=this.$refs["tawk-message-preview"]?parseFloat(getComputedStyle(this.$refs["tawk-message-preview"]).fontSize):16,this.textAreaHeight=e+2,t.Tawk_Window.eventBus.$on("resetState",(function(){i.clearMessages()}))},paste:function(t){var e,i=(t.originalEvent||t).clipboardData;i&&((e=i.files).length&&!this.features.upload||e&&e.length&&(this.$refs["tawk-chatinput"].$refs.fileupload.files=e,this.$refs["tawk-chatinput"].onFileUpload()))},submitSurvey:function(e){t.Tawk_Window.chatManager.sendMessage({message:e})}}),mounted:function(){var e=this;window.addEventListener("resize",this.recalculateHeight),t.Tawk_Window.eventBus.$on("dismissPreview",(function(t){t.ts&&e.dismissPreview(null,!0)}))},beforeDestroy:function(){window.removeEventListener("resize",this.recalculateHeight),t.Tawk_Window.eventBus.$off("dismissPreview")}}}).call(this,i("c8ba"))},"6b5b":function(t,e,i){"use strict";i.r(e);var a=i("3bc8").a,s=i("2877"),n=Object(s.a)(a,(function(){var t=this,e=t._self._c;return e("i-frame",{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",class:[t.isBottom?"tawk-flex-bottom":"tawk-flex-top"],style:{width:"".concat(t.width,"px"),"justify-content":"".concat(t.isRight?"flex-end":"flex-start")},attrs:{id:"tawk-message-preview"},on:{dragover:t.dragover,dragleave:t.dragleave,drop:t.drop,paste:t.paste}},[e("div",{ref:"tawk-message-preview-content",staticClass:"tawk-message-preview-content",attrs:{id:"tawk-message-preview-content"}},[t.isLiveChatFeatureEnabled&&!t.isSurveyOptionOnly?e("tawk-card",{directives:[{name:"tawk-tooltip",rawName:"v-tawk-tooltip"}],staticClass:"tawk-message-preview-close tawk-box-shadow-xsmall",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:"close"}})],1):t._e(),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-margin-auto-left tawk-call-card",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){return e("div",{key:i.cver,staticClass:"tawk-margin-xsmall-bottom"},[i.surveyObj?[i.surveyObj.question.length?e("div",{staticClass:"tawk-message-box tawk-flex tawk-flex-bottom"},[i.showProfile?e("tawk-avatar",{staticClass:"tawk-box-shadow-small",attrs:{src:i.profileImage,alt:"".concat(t.$i18n("chat","agent_profile_image")),size:"small"}}):t._e(),e("tawk-card",{staticClass:"tawk-box-shadow-xsmall tawk-message tawk-margin-auto-left",class:[i.showProfile?"tawk-has-avatar":""],attrs:{size:"xsmall"}},[i.isUpload?e("div",{staticStyle:{"padding-bottom":"20px"}},[i.fileType?e("div",["image"===i.fileType?e("tawk-image",{attrs:{src:i.fileLink,alt:i.fileName,position:"center"},on:{imageLoaded:function(e){return t.recalculateHeight()}}}):t._e(),"video"===i.fileType?e("tawk-video",{attrs:{content:{source:"selfhosted",url:i.fileLink,options:{controls:"",mute:!0,loop:!1,startTime:"0"}}}}):t._e(),"audio"===i.fileType?e("audio",{staticStyle:{width:"100%",height:"30px"},attrs:{controls:""}},[e("source",{attrs:{src:i.fileLink,type:i.data.file.mimetype}})]):t._e(),e("div",{staticClass:"tawk-flex",staticStyle:{"margin-top":"10px"}},[e("span",{staticClass:"tawk-text-truncate tawk-flex-1"},[t._v(" "+t._s(i.fileName)+" ")]),e("span",{staticClass:"tawk-flex-none",staticStyle:{padding:"0 5px"}},[t._v(" "+t._s(i.humanizeFileSize)+" ")]),e("a",{staticClass:"tawk-flex-none",attrs:{href:i.fileLink,target:"_blank"}},[t._v(" "+t._s(t.$i18n("chat","download"))+" "),e("tawk-icon",{attrs:{type:"download",size:"small"}})],1)])],1):e("div",[e("b",[t._v(t._s(i.fileName))]),e("div",{staticClass:"tawk-flex",staticStyle:{"margin-top":"10px"}},[e("span",{staticClass:"tawk-flex-none"},[t._v(" "+t._s(i.humanizeFileSize)+" ")]),e("a",{staticClass:"tawk-flex-none tawk-margin-auto-left",attrs:{href:i.fileLink,target:"_blank"}},[t._v(" "+t._s(t.$i18n("chat","download"))+" "),e("tawk-icon",{attrs:{type:"download",size:"small"}})],1)])])]):e("div",{staticClass:"tawk-text-regular-3",staticStyle:{"padding-bottom":"20px"}},[e("tawk-emoji",{attrs:{emoji:i.surveyObj?i.surveyObj.question:i.snippet,enabled:t.emojiEnabled}})],1),e("div",{staticClass:"tawk-flex tawk-text-regular-2 tawk-text-grey-2"},[e("div",{staticClass:"flex-auto"},[t._v(t._s(i.name)+" ")]),e("div",{staticClass:"flex-none tawk-margin-auto-left"},[e("tawk-timeago",{staticClass:"tawk-text-regular-1 tawk-text-grey-2",attrs:{datetime:i.time,isDuration:t.isDuration,isLive:t.isLive}})],1)])])],1):t._e()]:e("div",{staticClass:"tawk-message-box tawk-flex tawk-flex-bottom"},[i.showProfile?e("tawk-avatar",{staticClass:"tawk-box-shadow-small",attrs:{src:i.profileImage,alt:"".concat(t.$i18n("chat","agent_profile_image")),size:"small"}}):t._e(),e("tawk-card",{staticClass:"tawk-box-shadow-xsmall tawk-message tawk-margin-auto-left",class:[i.showProfile?"tawk-has-avatar":""],attrs:{size:"xsmall"}},[[i.attchs||i.surveyObj||i.snippet?e("tawk-chat-bubble",{staticClass:"tawk-message-preview-chat-bubble",attrs:{attachments:i.attchs},on:{imageLoaded:t.imageLoaded}},[i.surveyObj||i.snippet?e("tawk-emoji",{attrs:{emoji:i.surveyObj?i.surveyObj.question:i.snippet,enabled:t.emojiEnabled}}):t._e()],1):e("div",{staticClass:"tawk-margin-xsmall-bottom"},[e("tawk-icon",{attrs:{type:"attach-file",size:"small"}}),t._v(" "+t._s(t.$i18n("chat","sent_form"))+" ")],1)],e("div",{staticClass:"tawk-flex tawk-text-regular-2 tawk-text-grey-2"},[e("div",{staticClass:"flex-auto"},[t._v(t._s(i.name)+" ")]),e("div",{staticClass:"flex-none tawk-margin-auto-left"},[e("tawk-timeago",{staticClass:"tawk-text-regular-1 tawk-text-grey-2",attrs:{datetime:i.time,isDuration:t.isDuration,isLive:t.isLive}})],1)])],2)],1)],2)})),0),Object.keys(t.getSurveyOptions).length&&"v"!==t.getSurveyOptions.senderType?e("div",[e("survey-options",{staticClass:"tawk-message",attrs:{options:t.getSurveyOptions.options},on:{selectSurvey:t.submitSurvey}})],1):t._e()],1),e("transition",{attrs:{name:"fade-enter"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.showInputField&&!t.isSurveyOptionOnly,expression:"showInputField && !isSurveyOptionOnly"}]},[e("tawk-card",{ref:"tawk-chatinput-container",staticClass:"tawk-chatinput-container tawk-box-shadow-xsmall",class:[t.isDraggedOver?"has-dragover":""],attrs:{size:"xsmall",id:"tawk-chatinput-container"}},[t.isDraggedOver?e("div",{staticClass:"tawk-dragover-container",attrs:{id:"tawk-dragover-container"}},[e("tawk-icon",{attrs:{type:"attach-file",size:"xlarge"}}),e("p",[t._v(t._s(t.$i18n("rollover","uploadFile")))])],1):t._e(),e("tawk-chat-input",{ref:"tawk-chatinput",attrs:{features:t.features,placeholder:t.inputPlaceholder},on:{emojiPreview:t.emojiOpened,textareaResized:t.textareaResized,messageTyping:t.messageTyping,sendMessage:t.sendMessage,ratingClicked:t.ratingClicked,filesAdded:t.filesAdded,sendFiles:t.sendFiles}})],1)],1)])],1)],1)])])])}),[],!1,null,null,null);e.default=n.exports}}]);