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port.js","webpack://apexchatwidgets/./widgets/core/positioners/Positioner.js","webpack://apexchatwidgets/./widgets/core/animators/TabAnimator.js","webpack://apexchatwidgets/./widgets/tab/RegisterTab.js","webpack://apexchatwidgets/./widgets/core/hooks/getFixedTop.js","webpack://apexchatwidgets/./widgets/core/positioners/TabPositioner.js"],"sourcesContent":["/**\r\n. a dedicated class for doing animations\r\n* */\r\nimport Browser from '../hooks/Browser';\r\nimport getFixedTop from '../hooks/getFixedTop';\r\nimport getViewport from '../hooks/getViewport';\r\nimport { Position } from '../enums/Enum';\r\nimport WidgetTypes from '../enums/WidgetTypes';\r\n/**\r\n * \r\n * @param {*} me.configurations \r\n * @param {*} dom optional document object to cater parent and iframe based DOM manipulation alike \r\n @returns \r\n */\r\n\r\nexport default class Animator {\r\n constructor(configurations, dom) {\r\n this.configuration = configurations;\r\n this.$el = this.configuration.el;\r\n this.DOM = dom || document;\r\n this.attr = 'bottom';\r\n }\r\n\r\n tabMaximize(options) {\r\n const me = this;\r\n const chatTabPosition = me.configuration.chatTab.chatTabLeftSide ? 'left' : 'right'; // We need in string that Tab is left or Right\r\n // summary: Due to RESET CSS the animation was not working because earlier version was using IN-Line CSS and now recently chat_tab.css was introduced so Sliding animation can only play via JS version\r\n let marginValue = parseFloat(me.configuration.chatTab.borderWidth) + 10;\r\n if (!me.configuration.chatTab.chatTabLeftSide) {\r\n marginValue += 5;\r\n }\r\n ApexChat.animate(\r\n document.getElementById(options.element),\r\n `top: 50%;${chatTabPosition}: -150px; margin-${chatTabPosition}: ${marginValue}px;`,\r\n {\r\n duration: 110,\r\n after() {\r\n ApexChat.animate(\r\n document.getElementById(options.element),\r\n `${chatTabPosition}: 0px; margin-${chatTabPosition}: ${marginValue}px;`,\r\n {\r\n duration: 500\r\n }\r\n );\r\n }\r\n }\r\n );\r\n }\r\n\r\n tabMinimize(options) {\r\n const me = this;\r\n const chatTabPosition = me.configuration.chatTab.chatTabLeftSide ? 'left' : 'right'; // We need in string that Tab is left or Right\r\n const marginValue = `${parseFloat(me.configuration.chatTab.borderWidth) + 18}px`;\r\n ApexChat.animate(\r\n document.getElementById(options.element),\r\n `${chatTabPosition}: -150px; margin-${chatTabPosition}: -50px;top: 44%;`,\r\n {\r\n duration: 110,\r\n after() {\r\n ApexChat.animate(\r\n document.getElementById(options.element),\r\n `${chatTabPosition}: 0px; margin-${chatTabPosition}: ${marginValue};`,\r\n {\r\n duration: 500\r\n }\r\n );\r\n }\r\n }\r\n );\r\n }\r\n\r\n slide(options, configuration, position) {\r\n const me = this;\r\n const pureElement = me.getPureElement(options.element);\r\n const ele = me.getElement(options.element, pureElement);\r\n const target = ele.offsetHeight;\r\n this.invitationHeight = target; // Store the height so we can still use it in height calculations if the tab is animating\r\n // set it at the right position, but with a 0px height\r\n ele.style[me.attr] = me.getEndPosition(position, ele);\r\n ele.style.height = '0px';\r\n this.initialDisplayAnimation = ApexChat.animate(pureElement, `height:${target}px`, {\r\n duration: me.configuration.animationTime,\r\n after() { }\r\n });\r\n }\r\n\r\n slideFromLeft(options, configuration, position) {\r\n const me = this;\r\n const pureElement = me.getPureElement(options.element);\r\n const ele = me.getElement(options.element, pureElement);\r\n let dims = getViewport();\r\n let start = `${dims[1]}px`;\r\n let end = me.getEndPosition(position, ele);\r\n // for IE, we deal with the top of the invitation\r\n if (Browser.isIE()) {\r\n me.attr = 'top';\r\n start = '0px';\r\n end = getFixedTop(position, ele);\r\n }\r\n // set it at the right position, but with a 0px height\r\n ele.style[me.attr] = end;\r\n dims = getViewport();\r\n let endinglocation = '';\r\n switch (position) {\r\n case Position.Right:\r\n case Position.TopRight:\r\n delete ele.style.left;\r\n ele.style.right = `${dims[0]}px`;\r\n endinglocation = 'right:0px';\r\n break;\r\n case Position.Left:\r\n case Position.TopLeft:\r\n ele.style.left = `${-ele.offsetWidth}px`;\r\n endinglocation = 'left:0px';\r\n break;\r\n case Position.Center:\r\n case Position.Middle:\r\n case Position.TopMiddle:\r\n ele.style.left = '0px';\r\n var left = `${dims[0] / 2 - ele.offsetWidth / 2}px`;\r\n endinglocation = `left:${left}`;\r\n break;\r\n default:\r\n }\r\n this.initialDisplayAnimation = ApexChat.animate(pureElement, endinglocation, {\r\n duration: me.configuration.animationTime,\r\n after() { }\r\n });\r\n }\r\n\r\n slideFromRight(options, configuration, position) {\r\n const me = this;\r\n const pureElement = me.getPureElement(options.element);\r\n const ele = me.getElement(options.element, pureElement);\r\n ele.style[me.attr] = me.getEndPosition(position, ele);\r\n const dims = getViewport();\r\n let endinglocation = '';\r\n switch (position) {\r\n case Position.Right:\r\n case Position.TopRight:\r\n ele.style.right = `${-ele.offsetWidth}px`;\r\n endinglocation = 'right:0px';\r\n break;\r\n case Position.Left:\r\n case Position.TopLeft:\r\n ele.style.left = `${dims[0]}px`;\r\n endinglocation = 'left:0px';\r\n break;\r\n case Position.Center:\r\n case Position.Middle:\r\n case Position.TopMiddle:\r\n ele.style.left = `${dims[0]}px`;\r\n var left = `${dims[0] / 2 - ele.offsetWidth / 2}px`;\r\n endinglocation = `left:${left}`;\r\n break;\r\n default:\r\n }\r\n this.initialDisplayAnimation = ApexChat.animate(pureElement, endinglocation, {\r\n duration: me.configuration.animationTime,\r\n after() { }\r\n });\r\n }\r\n\r\n slideDrop(options, configuration, position) {\r\n // const me = this;\r\n // const pureElement = me.getPureElement(options.element);\r\n // const ele = me.getElement(options.element, pureElement);\r\n // const dims = getViewport();\r\n // const start = `${dims[1]}px`;\r\n // let end = me.getEndPosition(position, ele);\r\n // if (\r\n // !(\r\n // position == Position.TopLeft ||\r\n // position == Position.TopMiddle ||\r\n // position == Position.TopRight\r\n // )\r\n // ) {\r\n // end = `${me.attr}:${end}`;\r\n // ele.style[me.attr] = start;\r\n // }\r\n // this.initialDisplayAnimation = ApexChat.animate(pureElement, end, {\r\n // duration: me.configuration.animationTime,\r\n // // bounce function, from emile.js\r\n // easing: me.bounce,\r\n // after() { }\r\n // });\r\n }\r\n\r\n getPureElement(element) {\r\n if (element.indexOf('.') === -1 && element.indexOf('#') === -1) {\r\n return element;\r\n }\r\n return element.substring(1, element.lenght);\r\n }\r\n\r\n getElement(element, pureElement) {\r\n const me = this;\r\n return me.isClass(element)\r\n ? document.getElementsByClassName(pureElement)[0]\r\n : document.getElementById(pureElement);\r\n }\r\n\r\n isClass(element) {\r\n return element.indexOf('.') !== -1;\r\n }\r\n\r\n getEndPosition(position, element) {\r\n const dims = getViewport();\r\n const halfHeight = dims[1] / 2 - element.offsetHeight / 2;\r\n return position == Position.Center ||\r\n position == Position.LeftCenter ||\r\n position == Position.RightCenter\r\n ? `${halfHeight}px`\r\n : '0px';\r\n }\r\n\r\n bounce(pos) {\r\n if (pos < 1 / 2.75) {\r\n return 7.5625 * pos * pos;\r\n }\r\n if (pos < 2 / 2.75) {\r\n return 7.5625 * (pos -= 1.5 / 2.75) * pos + 0.75;\r\n }\r\n if (pos < 2.5 / 2.75) {\r\n return 7.5625 * (pos -= 2.25 / 2.75) * pos + 0.9375;\r\n }\r\n return 7.5625 * (pos -= 2.625 / 2.75) * pos + 0.984375;\r\n }\r\n\r\n wiggleElement(options) {\r\n const me = this;\r\n const wiggleBounceAnimationDuration = 1000;\r\n const pureElement = me.getPureElement(options.element);\r\n const ele = me.getElement(options.element, pureElement);\r\n const { position } = options;\r\n const end = me.getEndPosition(position, ele);\r\n const bottom = parseInt(ele.style.bottom === '' ? 0 : ele.style.bottom);\r\n // JIRA_4452 - Emile.js error\r\n // summary: we need to wiggle the widget if its only bottom (as V3 on top position wiggle is not required) as per V2.\r\n if (\r\n !(\r\n position == Position.TopLeft ||\r\n position == Position.TopMiddle ||\r\n position == Position.TopRight\r\n )\r\n ) {\r\n const amount = parseInt(bottom, 10) + 25;\r\n const easing = me.bounce;\r\n const targetCSS = `${me.attr}:${amount}px`;\r\n const backToOldCSS = `${me.attr}:${end}`;\r\n ApexChat.animate(pureElement, targetCSS, {\r\n duration: wiggleBounceAnimationDuration, // This animation shouldn't be set from the profile me.configuration. This is the bounce back duration of the wiggle widget.\r\n after() {\r\n // Back to the earlier position..\r\n ApexChat.animate(pureElement, backToOldCSS, {\r\n easing,\r\n duration: wiggleBounceAnimationDuration,\r\n after() { }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n}\r\n","const getViewport = () => {\r\n let viewportwidth;\r\n let viewportheight;\r\n\r\n // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight\r\n if (typeof window.innerWidth !== 'undefined') {\r\n viewportwidth = window.innerWidth;\r\n viewportheight = window.innerHeight;\r\n }\r\n\r\n\r\n // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)\r\n else if (typeof document.documentElement !== 'undefined' &&\r\n typeof document.documentElement.clientWidth !== 'undefined' &&\r\n document.documentElement.clientWidth) {\r\n viewportwidth = document.documentElement.clientWidth;\r\n viewportheight = document.documentElement.clientHeight;\r\n }\r\n\r\n\r\n // older versions of IE\r\n else {\r\n viewportwidth = document.getElementsByTagName('body')[0].clientWidth;\r\n viewportheight = document.getElementsByTagName('body')[0].clientHeight;\r\n }\r\n\r\n return [viewportwidth, viewportheight];\r\n};\r\nexport default getViewport;\r\n","/**\r\n *\r\n * a dedicated class for doing positioning\r\n * @param {*} configurations\r\n * @param {*} context optional document object to cater parent and iframe based DOM manipulation alike\r\n * @returns\r\n */\r\n\r\nexport default class Positioner {\r\n constructor(configurations, context) {\r\n const me = this;\r\n me.configuration = configurations;\r\n me.DOM = context || document;\r\n }\r\n\r\n getPureElement(element) {\r\n if (element.indexOf('.') === -1 && element.indexOf('#') === -1) {\r\n return element;\r\n }\r\n return element.substring(1, element.lenght);\r\n }\r\n\r\n getElement(element, pureElement) {\r\n return this.isClass(element)\r\n ? this.DOM.getElementsByClassName(pureElement)[0]\r\n : this.DOM.getElementById(pureElement);\r\n }\r\n\r\n isClass(element) {\r\n return element.indexOf('.') !== -1;\r\n }\r\n}\r\n","import Animator from './Animator';\r\n\r\nexport default class TabAnimator extends Animator {\r\n constructor(configurations, dom) {\r\n super(configurations, dom);\r\n }\r\n\r\n animate(options) {\r\n const me = this;\r\n function chatTabSlide(direction) {\r\n if (me.shown) {\r\n ApexChat.animate(\r\n document.getElementById(options.element),\r\n `${direction}: -${me.configuration.chatTab.height}`,\r\n {\r\n duration: 1000\r\n }\r\n );\r\n me.shown = false;\r\n } else {\r\n ApexChat.animate(document.getElementById(options.element), `${direction}: 0px`, {\r\n duration: 1000\r\n });\r\n me.shown = true;\r\n }\r\n }\r\n function chatTabBlink() {\r\n if (me.shown) {\r\n document.getElementById(options.element).style.display = 'none';\r\n me.shown = false;\r\n } else {\r\n me.document.getElementById(options.element).style.display = 'block';\r\n me.shown = true;\r\n }\r\n }\r\n if (\r\n me.configuration.chatTab.chatTabAnimate == 'Blink' &&\r\n me.configuration.chatTab.chatTabTimer != 0\r\n ) {\r\n me.shown = true;\r\n\r\n setInterval(chatTabBlink, me.configuration.chatTab.chatTabTimer * 1000);\r\n }\r\n // summary: Due to RESET CSS the animation was not working because earlier version was using IN-Line CSS and now recently chat_tab.css was introduced so Sliding animation can only play via JS version\r\n if (\r\n me.configuration.chatTab.chatTabAnimate.indexOf('Slide') != -1 &&\r\n me.configuration.chatTab.chatTabTimer != 0\r\n ) {\r\n const chatTabDirection = me.configuration.chatTab.chatTabAnimate.replace('Slide', '');\r\n me.shown = true;\r\n\r\n setInterval(() => {\r\n chatTabSlide(chatTabDirection.toLowerCase());\r\n }, me.configuration.chatTab.chatTabTimer * 1000);\r\n }\r\n }\r\n}\r\n","/**\r\n * client/wrapper type for the Tab widget on parent/page\r\n */\r\n\r\nimport TabAnimator from '../core/animators/TabAnimator';\r\nimport BaseWidgetClient from '../core/BaseWidgetClient';\r\nimport TabPositioner from '../core/positioners/TabPositioner';\r\nimport WidgetTypes from '../core/enums/WidgetTypes';\r\nimport createNS from '../core/createNs';\r\n\r\nexport default function RegisterTab() {\r\n const Tab = class extends BaseWidgetClient {\r\n constructor(options) {\r\n if (!options.chatTab) {\r\n return;\r\n }\r\n super(\r\n Object.assign(options, {\r\n widget: WidgetTypes.Tab // containerBg: 'blue'\r\n })\r\n );\r\n this.animator = new TabAnimator(options, this.DOM)\r\n this.positioner = new TabPositioner(this.options);\r\n this.ready();\r\n }\r\n\r\n ready() {\r\n super.ready();\r\n const me = this;\r\n me.create();\r\n }\r\n\r\n create() {\r\n super.create();\r\n const self = this;\r\n self.$container.innerHTML = ``;\r\n document.body.appendChild(self.$container);\r\n document.getElementById(self.parentDivId).style.position = 'fixed';\r\n document.getElementById(self.parentDivId).style.top = '50%';\r\n self.options.chatTab.chatTabLeftSide\r\n ? document.getElementById(self.parentDivId).style.left\r\n : (document.getElementById(self.parentDivId).style.right = 0);\r\n this.positioner.position({\r\n element: self.parentDivId,\r\n widgetType: WidgetTypes.Tab,\r\n isIframeOuterObject: true\r\n });\r\n this.animator.animate({\r\n element: self.parentDivId,\r\n widgetType: WidgetTypes.Tab\r\n });\r\n this.show();\r\n }\r\n\r\n show() {\r\n super.show();\r\n }\r\n };\r\n const fqName = `${WidgetTypes.Tab}_client`;\r\n // Export to window\r\n createNS(fqName, Tab);\r\n}\r\n","import getBody from './getBody';\r\nimport { Position } from '../enums/Enum';\r\nimport getViewport from './getViewport';\r\n\r\n// determines the \"top\" coordinate needed to create a fixed position simulation\r\n/* If this context will be provided than this function will return the scroll position of that specific context */\r\nconst getFixedTop = (position, container, padding, forceEdge, context) => {\r\n let scroll;\r\n if (context) {\r\n scroll = context.documentElement.scrollTop\r\n ? context.documentElement.scrollTop\r\n : getBody(context).scrollTop;\r\n } else {\r\n scroll = document.documentElement.scrollTop\r\n ? document.documentElement.scrollTop\r\n : getBody().scrollTop;\r\n }\r\n if (!container) {\r\n // If container is NULL then just assign it.\r\n container = document.getElementById('apexchat');\r\n }\r\n if (container.offsetHeight) {\r\n const dims = getViewport();\r\n const halfHeight = dims[1] / 2 - container.offsetHeight / 2;\r\n\r\n const pos = position == Position.Center\r\n ? halfHeight + scroll\r\n : dims[1] - container.offsetHeight + scroll;\r\n return `${pos - (padding || 0)}px`;\r\n }\r\n};\r\nexport default getFixedTop;\r\n","/**\r\n *\r\n * a dedicated class for doing positioning\r\n * @param {*} configurations\r\n * @param {*} context optional document object to cater parent and iframe based DOM manipulation alike\r\n * @returns\r\n */\r\nimport Positioner from './Positioner';\r\n\r\nexport default class TabPositioner extends Positioner {\r\n constructor(configurations, context) {\r\n super(configurations, context);\r\n const me = this;\r\n me.configuration = configurations;\r\n me.DOM = context || document;\r\n }\r\n\r\n position(options) {\r\n const me = this;\r\n const tempDOM = me.DOM;\r\n if (options.context) {\r\n me.DOM = options.context;\r\n }\r\n const { element, isIframeOuterObject } = options;\r\n let targetObj;\r\n if (typeof element === 'object') {\r\n targetObj = element;\r\n } else {\r\n const pureElement = this.getPureElement(element);\r\n targetObj = this.getElement(element, pureElement);\r\n }\r\n targetObj.style.paddingLeft = '10px';\r\n targetObj.style.paddingRight = '10px';\r\n targetObj.style.height = this.configuration.chatTab.height;\r\n if (targetObj) {\r\n const iframe = targetObj.querySelector('#apexchat_tab_invitation_frame');\r\n if (iframe) {\r\n iframe.style.width = 'auto';\r\n }\r\n }\r\n\r\n targetObj.style.display = 'block';\r\n let trans = 0;\r\n if (this.configuration.chatTab.chatTabLeftSide) {\r\n trans = -51 + this.configuration.chatTab.chatTabTrans;\r\n targetObj.style.left = 0;\r\n // targetObj.style.marginLeft = this.configuration.chatTab.borderWidth;\r\n targetObj.style.borderBottomRightRadius = this.configuration.chatTab.borderRadius;\r\n targetObj.style.borderBottomLeftRadius = this.configuration.chatTab.borderRadius;\r\n targetObj.style.marginTop = '-10px';\r\n targetObj.style.transformOrigin = 'top';\r\n } else {\r\n trans = 50 + this.configuration.chatTab.chatTabTrans;\r\n targetObj.style.right = 0;\r\n // targetObj.style.marginRight = this.configuration.chatTab.borderWidth;\r\n targetObj.style.borderTopRightRadius = this.configuration.chatTab.borderRadius;\r\n targetObj.style.borderTopLeftRadius = this.configuration.chatTab.borderRadius;\r\n targetObj.style.transformOrigin = 'bottom';\r\n }\r\n if (isIframeOuterObject == true) {\r\n targetObj.style.transform = `translateX(${trans}%) translateY(-50%) rotate(-90deg)`;\r\n targetObj.style.webkitTransform = `translateX(${trans}%) translateY(-50%) rotate(-90deg)`;\r\n targetObj.style.msTransform = `translateX(${trans}%) translateY(-50%) rotate(-90deg)`;\r\n const borderWidth = parseFloat(this.configuration.chatTab.borderWidth);\r\n if (this.configuration.chatTab.chatTabLeftSide) {\r\n if (borderWidth == 0) {\r\n targetObj.style.marginLeft = '8px';\r\n }\r\n } else {\r\n // var marginValue = ;\r\n targetObj.style.marginRight = `${borderWidth + (borderWidth == 0 ? 10 : 20)}px`;\r\n }\r\n }\r\n if (this.configuration.chatTab.hover) {\r\n targetObj.className += 'cstDiv';\r\n }\r\n me.DOM = tempDOM;\r\n }\r\n}\r\n"],"names":["Animator","constructor","configurations","dom","this","configuration","$el","el","DOM","document","attr","tabMaximize","options","me","chatTabPosition","chatTab","chatTabLeftSide","marginValue","parseFloat","borderWidth","ApexChat","animate","getElementById","element","duration","after","tabMinimize","slide","position","pureElement","getPureElement","ele","getElement","target","offsetHeight","invitationHeight","style","getEndPosition","height","initialDisplayAnimation","animationTime","slideFromLeft","dims","getViewport","start","end","Browser","isIE","getFixedTop","endinglocation","Position","Right","TopRight","left","right","Left","TopLeft","offsetWidth","Center","Middle","TopMiddle","slideFromRight","slideDrop","indexOf","substring","lenght","isClass","getElementsByClassName","halfHeight","LeftCenter","RightCenter","bounce","pos","wiggleElement","bottom","parseInt","amount","easing","targetCSS","backToOldCSS","viewportwidth","viewportheight","window","innerWidth","innerHeight","documentElement","clientWidth","clientHeight","getElementsByTagName","Positioner","context","TabAnimator","super","chatTabAnimate","chatTabTimer","shown","setInterval","display","chatTabDirection","replace","direction","toLowerCase","RegisterTab","Tab","BaseWidgetClient","Object","assign","widget","WidgetTypes","animator","positioner","TabPositioner","ready","create","self","$container","innerHTML","iframeId","body","appendChild","parentDivId","top","widgetType","isIframeOuterObject","show","fqName","createNS","container","padding","forceEdge","scroll","scrollTop","getBody","tempDOM","targetObj","paddingLeft","paddingRight","iframe","querySelector","width","trans","chatTabTrans","borderBottomRightRadius","borderRadius","borderBottomLeftRadius","marginTop","transformOrigin","borderTopRightRadius","borderTopLeftRadius","transform","webkitTransform","msTransform","marginLeft","marginRight","hover","className"],"sourceRoot":""}