{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/widget/helpers/urlParamsHelper.js","webpack:///./node_modules/date-fns/esm/addMilliseconds/index.js","webpack:///./node_modules/date-fns/esm/toDate/index.js","webpack:///./app/javascript/widget/constants/errorTypes.js","webpack:///./app/javascript/widget/helpers/popoutHelper.js","webpack:///./node_modules/date-fns/esm/addHours/index.js","webpack:///./app/javascript/shared/constants/sharedFrameEvents.js","webpack:///./app/javascript/widget/constants/sdkEvents.js","webpack:///./node_modules/charenc/charenc.js","webpack:///./node_modules/md5/md5.js","webpack:///./node_modules/date-fns/esm/_lib/toInteger/index.js","webpack:///./node_modules/crypt/crypt.js","webpack:///./node_modules/is-buffer/index.js","webpack:///./app/javascript/sdk/sdk.js","webpack:///./app/javascript/sdk/DOMHelpers.js","webpack:///./app/javascript/sdk/constants.js","webpack:///./app/javascript/sdk/settingsHelper.js","webpack:///./app/javascript/sdk/bubbleHelpers.js","webpack:///./app/javascript/shared/helpers/CustomEventHelper.js","webpack:///./app/javascript/sdk/cookieHelpers.js","webpack:///./app/javascript/sdk/IFrameHelper.js","webpack:///./app/javascript/packs/sdk.js","webpack:///./node_modules/color2k/dist/index.module.es.js","webpack:///./app/javascript/shared/helpers/colorHelper.js","webpack:///./node_modules/js-cookie/dist/js.cookie.js","webpack:///./app/javascript/shared/helpers/AudioNotificationHelper.js","webpack:///./node_modules/date-fns/esm/_lib/requiredArgs/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","buildSearchParamsWithLocale","search","locale","window","WOOT_WIDGET","$root","$i18n","params","URLSearchParams","append","getLocale","arguments","length","undefined","buildPopoutURL","_ref","origin","conversationCookie","websiteToken","popoutUrl","URL","searchParams","toString","addMilliseconds","dirtyDate","dirtyAmount","timestamp","getTime","amount","Date","toDate","argument","argStr","console","warn","Error","stack","NaN","SET_USER_ERROR","popoutChatWindow","windowUrl","open","focus","err","log","MILLISECONDS_IN_HOUR","addHours","SDK_SET_BUBBLE_VISIBILITY","CHATWOOT_ERROR","CHATWOOT_ON_MESSAGE","CHATWOOT_ON_START_CONVERSATION","CHATWOOT_READY","charenc","utf8","stringToBytes","str","bin","unescape","encodeURIComponent","bytesToString","bytes","decodeURIComponent","escape","push","charCodeAt","String","fromCharCode","join","crypt","isBuffer","md5","message","options","constructor","encoding","Array","slice","isArray","Uint8Array","bytesToWords","a","b","FF","_ff","GG","_gg","HH","_hh","II","_ii","aa","bb","cc","dd","endian","x","_blocksize","_digestsize","digestbytes","wordsToBytes","asBytes","asString","bytesToHex","toInteger","dirtyNumber","number","Number","isNaN","Math","ceil","floor","base64map","rotl","rotr","randomBytes","random","words","hex","hexToBytes","parseInt","substr","bytesToBase64","base64","triplet","j","charAt","base64ToBytes","replace","imod4","indexOf","pow","obj","readFloatLE","isSlowBuffer","_isBuffer","addClasses","elm","classes","classList","add","split","toggleClass","toggle","removeClasses","remove","onLocationChange","referrerURL","referrerHost","IFrameHelper","events","BUBBLE_DESIGN","WIDGET_DESIGN","DARK_MODE","getBubbleView","type","includes","isExpandedView","isFlatWidgetStyle","style","getDarkMode","darkMode","body","document","getElementsByTagName","widgetHolder","createElement","bubbleHolder","chatBubble","closeBubble","notificationBubble","onBubbleClick","props","toggleValue","isOpen","$chatwoot","newIsOpen","onBubbleToggle","removeUnreadClass","holderEl","querySelector","dispatchWindowEvent","_ref2","eventName","data","event","CustomEvent","detail","createEvent","initCustomEvent","dispatchEvent","REQUIRED_USER_KEYS","ALLOWED_USER_ATTRIBUTES","getUserCookieName","websiteIdentifier","computeHashForUserData","identifier","user","reduce","acc","getUserString","setCookieWithDomain","expires","baseDomain","cookieOptions","sameSite","domain","JSON","stringify","Cookies","set","updateAuthCookie","cookieContent","getUrl","baseUrl","createFrame","getAppFrame","loadCSS","css","innerHTML","appendChild","iframe","cwCookie","widgetUrl","src","allow","id","visibility","holderClassName","position","hideMessageBubble","widgetStyle","initPostMessageCommunication","initWindowSizeListener","preventDefaultScroll","getElementById","getBubbleHolder","getElementsByClassName","sendMessage","contentWindow","postMessage","onmessage","e","parse","addEventListener","toggleCloseButton","deltaY","contentHeight","scrollHeight","visibleHeight","offsetHeight","scrollTop","preventDefault","setFrameHeightToFitContent","extraHeight","isFixedHeight","updatedIframeHeight","setAttribute","setupAudioListeners","getAlertAudio","alertTone","then","initOnEvents","forEach","removeEventListener","loaded","config","authToken","hasLoaded","campaignsSnoozedTill","showPopoutButton","onLoad","widgetColor","channelConfig","playAudioAlert","resetTriggered","error","_ref3","errorType","onEvent","_ref4","eventIdentifier","setBubbleLabel","bubbleText","launcherTitle","label","innerText","setAuthCookie","_ref5","widgetAuthToken","setCampaignReadOn","expireBy","updateCampaignReadStatus","toggleBubble","state","bubbleState","_ref6","closeWindow","pushEvent","_ref7","updateIframeHeight","setUnreadMode","addUnreadClass","resetUnreadMode","handleNotificationDot","bubbleElement","unreadMessageCount","contains","closeChat","playAudio","_ref8","onLocationChangeListener","oldHref","location","href","host","bodyList","MutationObserver","mutations","observe","childList","subtree","className","closeBtnClassName","isWidgetColorLighter","chatIcon","path","target","bubbleClassName","bubbleIcon","createElementNS","setAttributeNS","bubblePath","textNode","title","createBubbleIcon","background","isMobile","matchMedia","matches","chatwootSDK","run","chatwootSettings","useBrowserLanguage","navigator","language","toggleBubbleVisibility","widgetElm","setUser","hasUserKeys","userCookieName","existingCookieValue","hashToBeStored","setCustomAttributes","customAttributes","keys","deleteCustomAttribute","customAttribute","setConversationCustomAttributes","deleteConversationCustomAttribute","setLabel","removeLabel","setLocale","localeToBeUsed","setColorScheme","reset","guard","low","high","min","max","ColorError","color","super","ColorError$1","parseToRgba","trim","toLowerCase","normalizedColor","namedColorRegex","test","normalizedColorName","result","compressedColorMap","hash","nameToHex","reducedHexMatch","reducedHexRegex","exec","arr","from","map","hexMatch","hexRegex","rgbaMatch","rgbaRegex","parseFloat","hslaMatch","hslaRegex","h","hslToRgb","colorToInt","next","substring","prefix","RegExp","roundColor","round","hue","saturation","lightness","huePrime","chroma","abs","secondComponent","red","green","blue","lightnessModification","getLuminance","f","channel","g","getContrast","color1","color2","luminance1","luminance2","rgba","alpha","toFixed","mix","weight","normalize","index","r1","g1","b1","a1","r2","g2","b2","a2","alphaDelta","normalizedWeight","weight2","weight1","colorToCheck","adjustColorForContrast","backgroundColor","adjustedColor","iteration","toHex","assign","source","init","converter","defaultAttributes","attributes","now","toUTCString","stringifiedAttributes","attributeName","cookie","write","cookies","jar","parts","found","read","withAttributes","this","withConverter","freeze","factory","async","requestContext","audioCtx","getAudioContext","AudioContext","webkitAudioContext","playSound","audioBuffer","createBufferSource","buffer","connect","destination","loop","start","audioRequest","Request","fetch","response","arrayBuffer","decodeAudioData","Promise","res","catch","requiredArgs","required","args","TypeError"],"mappings":";aACE,IAAIA,EAAmB,CAAC,EAGxB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,CAAC,GAUX,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,OACf,CAIAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,GAEhE,EAGAZ,EAAoBkB,EAAI,SAAShB,GACX,qBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,GACvD,EAOArB,EAAoBsB,EAAI,SAAS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// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2513);\n","export const buildSearchParamsWithLocale = search => {\n const locale = window.WOOT_WIDGET.$root.$i18n.locale;\n const params = new URLSearchParams(search);\n params.append('locale', locale);\n\n return `?${params}`;\n};\n\nexport const getLocale = (search = '') => {\n return new URLSearchParams(search).get('locale');\n};\n\nexport const buildPopoutURL = ({\n origin,\n conversationCookie,\n websiteToken,\n locale,\n}) => {\n const popoutUrl = new URL('/widget', origin);\n popoutUrl.searchParams.append('cw_conversation', conversationCookie);\n popoutUrl.searchParams.append('website_token', websiteToken);\n popoutUrl.searchParams.append('locale', locale);\n\n return popoutUrl.toString();\n};\n","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\n\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\n\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule\"); // eslint-disable-next-line no-console\n\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}","export const SET_USER_ERROR = 'SET_USER_ERROR';\n","import { buildPopoutURL } from './urlParamsHelper';\n\nexport const popoutChatWindow = (\n origin,\n websiteToken,\n locale,\n conversationCookie\n) => {\n try {\n const windowUrl = buildPopoutURL({\n origin,\n websiteToken,\n locale,\n conversationCookie,\n });\n const popoutWindow = window.open(\n windowUrl,\n `webwidget_session_${websiteToken}`,\n 'resizable=off,width=400,height=600'\n );\n popoutWindow.focus();\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log(err);\n }\n};\n","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\n/**\n * @name addHours\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the hours added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\n\nexport default function addHours(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR);\n}","export const SDK_SET_BUBBLE_VISIBILITY = 'sdk-set-bubble-visibility';\n","export const CHATWOOT_ERROR = 'chatwoot:error';\nexport const CHATWOOT_ON_MESSAGE = 'chatwoot:on-message';\nexport const CHATWOOT_ON_START_CONVERSATION = 'chatwoot:on-start-conversation';\nexport const CHATWOOT_READY = 'chatwoot:ready';\n","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function (str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n // Convert a byte array to a string\n bytesToString: function (bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function (str) {\n for (var bytes = [], i = 0; i < str.length; i++) bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n // Convert a byte array to a string\n bytesToString: function (bytes) {\n for (var str = [], i = 0; i < bytes.length; i++) str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\nmodule.exports = charenc;","(function () {\n var crypt = require('crypt'),\n utf8 = require('charenc').utf8,\n isBuffer = require('is-buffer'),\n bin = require('charenc').bin,\n // The core\n md5 = function (message, options) {\n // Convert to byte array\n if (message.constructor == String) {\n if (options && options.encoding === 'binary') message = bin.stringToBytes(message);else message = utf8.stringToBytes(message);\n } else if (isBuffer(message)) message = Array.prototype.slice.call(message, 0);else if (!Array.isArray(message) && message.constructor !== Uint8Array) message = message.toString();\n // else, assume byte array already\n\n var m = crypt.bytesToWords(message),\n l = message.length * 8,\n a = 1732584193,\n b = -271733879,\n c = -1732584194,\n d = 271733878;\n\n // Swap endian\n for (var i = 0; i < m.length; i++) {\n m[i] = (m[i] << 8 | m[i] >>> 24) & 0x00FF00FF | (m[i] << 24 | m[i] >>> 8) & 0xFF00FF00;\n }\n\n // Padding\n m[l >>> 5] |= 0x80 << l % 32;\n m[(l + 64 >>> 9 << 4) + 14] = l;\n\n // Method shortcuts\n var FF = md5._ff,\n GG = md5._gg,\n HH = md5._hh,\n II = md5._ii;\n for (var i = 0; i < m.length; i += 16) {\n var aa = a,\n bb = b,\n cc = c,\n dd = d;\n a = FF(a, b, c, d, m[i + 0], 7, -680876936);\n d = FF(d, a, b, c, m[i + 1], 12, -389564586);\n c = FF(c, d, a, b, m[i + 2], 17, 606105819);\n b = FF(b, c, d, a, m[i + 3], 22, -1044525330);\n a = FF(a, b, c, d, m[i + 4], 7, -176418897);\n d = FF(d, a, b, c, m[i + 5], 12, 1200080426);\n c = FF(c, d, a, b, m[i + 6], 17, -1473231341);\n b = FF(b, c, d, a, m[i + 7], 22, -45705983);\n a = FF(a, b, c, d, m[i + 8], 7, 1770035416);\n d = FF(d, a, b, c, m[i + 9], 12, -1958414417);\n c = FF(c, d, a, b, m[i + 10], 17, -42063);\n b = FF(b, c, d, a, m[i + 11], 22, -1990404162);\n a = FF(a, b, c, d, m[i + 12], 7, 1804603682);\n d = FF(d, a, b, c, m[i + 13], 12, -40341101);\n c = FF(c, d, a, b, m[i + 14], 17, -1502002290);\n b = FF(b, c, d, a, m[i + 15], 22, 1236535329);\n a = GG(a, b, c, d, m[i + 1], 5, -165796510);\n d = GG(d, a, b, c, m[i + 6], 9, -1069501632);\n c = GG(c, d, a, b, m[i + 11], 14, 643717713);\n b = GG(b, c, d, a, m[i + 0], 20, -373897302);\n a = GG(a, b, c, d, m[i + 5], 5, -701558691);\n d = GG(d, a, b, c, m[i + 10], 9, 38016083);\n c = GG(c, d, a, b, m[i + 15], 14, -660478335);\n b = GG(b, c, d, a, m[i + 4], 20, -405537848);\n a = GG(a, b, c, d, m[i + 9], 5, 568446438);\n d = GG(d, a, b, c, m[i + 14], 9, -1019803690);\n c = GG(c, d, a, b, m[i + 3], 14, -187363961);\n b = GG(b, c, d, a, m[i + 8], 20, 1163531501);\n a = GG(a, b, c, d, m[i + 13], 5, -1444681467);\n d = GG(d, a, b, c, m[i + 2], 9, -51403784);\n c = GG(c, d, a, b, m[i + 7], 14, 1735328473);\n b = GG(b, c, d, a, m[i + 12], 20, -1926607734);\n a = HH(a, b, c, d, m[i + 5], 4, -378558);\n d = HH(d, a, b, c, m[i + 8], 11, -2022574463);\n c = HH(c, d, a, b, m[i + 11], 16, 1839030562);\n b = HH(b, c, d, a, m[i + 14], 23, -35309556);\n a = HH(a, b, c, d, m[i + 1], 4, -1530992060);\n d = HH(d, a, b, c, m[i + 4], 11, 1272893353);\n c = HH(c, d, a, b, m[i + 7], 16, -155497632);\n b = HH(b, c, d, a, m[i + 10], 23, -1094730640);\n a = HH(a, b, c, d, m[i + 13], 4, 681279174);\n d = HH(d, a, b, c, m[i + 0], 11, -358537222);\n c = HH(c, d, a, b, m[i + 3], 16, -722521979);\n b = HH(b, c, d, a, m[i + 6], 23, 76029189);\n a = HH(a, b, c, d, m[i + 9], 4, -640364487);\n d = HH(d, a, b, c, m[i + 12], 11, -421815835);\n c = HH(c, d, a, b, m[i + 15], 16, 530742520);\n b = HH(b, c, d, a, m[i + 2], 23, -995338651);\n a = II(a, b, c, d, m[i + 0], 6, -198630844);\n d = II(d, a, b, c, m[i + 7], 10, 1126891415);\n c = II(c, d, a, b, m[i + 14], 15, -1416354905);\n b = II(b, c, d, a, m[i + 5], 21, -57434055);\n a = II(a, b, c, d, m[i + 12], 6, 1700485571);\n d = II(d, a, b, c, m[i + 3], 10, -1894986606);\n c = II(c, d, a, b, m[i + 10], 15, -1051523);\n b = II(b, c, d, a, m[i + 1], 21, -2054922799);\n a = II(a, b, c, d, m[i + 8], 6, 1873313359);\n d = II(d, a, b, c, m[i + 15], 10, -30611744);\n c = II(c, d, a, b, m[i + 6], 15, -1560198380);\n b = II(b, c, d, a, m[i + 13], 21, 1309151649);\n a = II(a, b, c, d, m[i + 4], 6, -145523070);\n d = II(d, a, b, c, m[i + 11], 10, -1120210379);\n c = II(c, d, a, b, m[i + 2], 15, 718787259);\n b = II(b, c, d, a, m[i + 9], 21, -343485551);\n a = a + aa >>> 0;\n b = b + bb >>> 0;\n c = c + cc >>> 0;\n d = d + dd >>> 0;\n }\n return crypt.endian([a, b, c, d]);\n };\n\n // Auxiliary functions\n md5._ff = function (a, b, c, d, x, s, t) {\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\n return (n << s | n >>> 32 - s) + b;\n };\n md5._gg = function (a, b, c, d, x, s, t) {\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\n return (n << s | n >>> 32 - s) + b;\n };\n md5._hh = function (a, b, c, d, x, s, t) {\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\n return (n << s | n >>> 32 - s) + b;\n };\n md5._ii = function (a, b, c, d, x, s, t) {\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\n return (n << s | n >>> 32 - s) + b;\n };\n\n // Package private blocksize\n md5._blocksize = 16;\n md5._digestsize = 16;\n module.exports = function (message, options) {\n if (message === undefined || message === null) throw new Error('Illegal argument ' + message);\n var digestbytes = crypt.wordsToBytes(md5(message, options));\n return options && options.asBytes ? digestbytes : options && options.asString ? bin.bytesToString(digestbytes) : crypt.bytesToHex(digestbytes);\n };\n})();","export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n var number = Number(dirtyNumber);\n if (isNaN(number)) {\n return number;\n }\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}","(function () {\n var base64map = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n crypt = {\n // Bit-wise rotation left\n rotl: function (n, b) {\n return n << b | n >>> 32 - b;\n },\n // Bit-wise rotation right\n rotr: function (n, b) {\n return n << 32 - b | n >>> b;\n },\n // Swap big-endian to little-endian and vice versa\n endian: function (n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++) n[i] = crypt.endian(n[i]);\n return n;\n },\n // Generate an array of any length of random bytes\n randomBytes: function (n) {\n for (var bytes = []; n > 0; n--) bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function (bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) words[b >>> 5] |= bytes[i] << 24 - b % 32;\n return words;\n },\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function (words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8) bytes.push(words[b >>> 5] >>> 24 - b % 32 & 0xFF);\n return bytes;\n },\n // Convert a byte array to a hex string\n bytesToHex: function (bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n // Convert a hex string to a byte array\n hexToBytes: function (hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2) bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n // Convert a byte array to a base-64 string\n bytesToBase64: function (bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2];\n for (var j = 0; j < 4; j++) if (i * 8 + j * 6 <= bytes.length * 8) base64.push(base64map.charAt(triplet >>> 6 * (3 - j) & 0x3F));else base64.push('=');\n }\n return base64.join('');\n },\n // Convert a base-64 string to a byte array\n base64ToBytes: function (base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push((base64map.indexOf(base64.charAt(i - 1)) & Math.pow(2, -2 * imod4 + 8) - 1) << imod4 * 2 | base64map.indexOf(base64.charAt(i)) >>> 6 - imod4 * 2);\n }\n return bytes;\n }\n };\n module.exports = crypt;\n})();","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer);\n};\nfunction isBuffer(obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj);\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer(obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0));\n}","export const SDK_CSS = `\n:root {\n --b-100: #F2F3F7;\n --s-700: #37546D;\n}\n\n.woot-widget-holder {\n box-shadow: 0 5px 40px rgba(0, 0, 0, .16);\n opacity: 1;\n will-change: transform, opacity;\n transform: translateY(0);\n overflow: hidden !important;\n position: fixed !important;\n transition: opacity 0.2s linear, transform 0.25s linear;\n z-index: 2147483000 !important;\n}\n\n.woot-widget-holder.woot-widget-holder--flat {\n box-shadow: none;\n border-radius: 0;\n border: 1px solid var(--b-100);\n}\n\n.woot-widget-holder iframe {\n border: 0;\n height: 100% !important;\n width: 100% !important;\n max-height: 100vh !important;\n}\n\n.woot-widget-holder.has-unread-view {\n border-radius: 0 !important;\n min-height: 80px !important;\n height: auto;\n bottom: 94px;\n box-shadow: none !important;\n border: 0;\n}\n\n.woot-widget-bubble {\n background: #1f93ff;\n border-radius: 100px;\n border-width: 0px;\n bottom: 20px;\n box-shadow: 0 8px 24px rgba(0, 0, 0, .16) !important;\n cursor: pointer;\n height: 64px;\n padding: 0px;\n position: fixed;\n user-select: none;\n width: 64px;\n z-index: 2147483000 !important;\n}\n\n.woot-widget-bubble.woot-widget-bubble--flat {\n border-radius: 0;\n}\n\n.woot-widget-holder.woot-widget-holder--flat {\n bottom: 90px;\n}\n\n.woot-widget-bubble.woot-widget-bubble--flat {\n height: 56px;\n width: 56px;\n}\n\n.woot-widget-bubble.woot-widget-bubble--flat svg {\n margin: 16px;\n}\n\n.woot-widget-bubble.woot-widget-bubble--flat.woot--close::before,\n.woot-widget-bubble.woot-widget-bubble--flat.woot--close::after {\n left: 28px;\n top: 16px;\n}\n\n.woot-widget-bubble.unread-notification::after {\n content: '';\n position: absolute;\n width: 12px;\n height: 12px;\n background: #ff4040;\n border-radius: 100%;\n top: 0px;\n right: 0px;\n border: 2px solid #ffffff;\n transition: background 0.2s ease;\n}\n\n.woot-widget-bubble.woot-widget--expanded {\n bottom: 24px;\n display: flex;\n height: 48px !important;\n width: auto !important;\n align-items: center;\n}\n\n.woot-widget-bubble.woot-widget--expanded div {\n align-items: center;\n color: #fff;\n display: flex;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, Arial, sans-serif;\n font-size: 16px;\n font-weight: 500;\n justify-content: center;\n padding-right: 20px;\n width: auto !important;\n}\n\n.woot-widget-bubble.woot-widget--expanded.woot-widget-bubble-color--lighter div{\n color: var(--s-700);\n}\n\n.woot-widget-bubble.woot-widget--expanded svg {\n height: 20px;\n margin: 14px 8px 14px 16px;\n width: 20px;\n}\n\n.woot-widget-bubble.woot-elements--left {\n left: 20px;\n}\n\n.woot-widget-bubble.woot-elements--right {\n right: 20px;\n}\n\n.woot-widget-bubble:hover {\n background: #1f93ff;\n box-shadow: 0 8px 32px rgba(0, 0, 0, .4) !important;\n}\n\n.woot-widget-bubble svg {\n all: revert;\n height: 24px;\n margin: 20px;\n width: 24px;\n}\n\n.woot-widget-bubble.woot-widget-bubble-color--lighter path{\n fill: var(--s-700);\n}\n\n@media only screen and (min-width: 667px) {\n .woot-widget-holder.woot-elements--left {\n left: 20px;\n }\n .woot-widget-holder.woot-elements--right {\n right: 20px;\n }\n}\n\n.woot--close:hover {\n opacity: 1;\n}\n\n.woot--close::before, .woot--close::after {\n background-color: #fff;\n content: ' ';\n display: inline;\n height: 24px;\n left: 32px;\n position: absolute;\n top: 20px;\n width: 2px;\n}\n\n.woot-widget-bubble-color--lighter.woot--close::before, .woot-widget-bubble-color--lighter.woot--close::after {\n background-color: var(--s-700);\n}\n\n.woot--close::before {\n transform: rotate(45deg);\n}\n\n.woot--close::after {\n transform: rotate(-45deg);\n}\n\n.woot--hide {\n bottom: -100vh !important;\n top: unset !important;\n opacity: 0;\n visibility: hidden !important;\n z-index: -1 !important;\n}\n\n.woot-widget--without-bubble {\n bottom: 20px !important;\n}\n.woot-widget-holder.woot--hide{\n transform: translateY(40px);\n}\n.woot-widget-bubble.woot--close {\n transform: translateX(0px) scale(1) rotate(0deg);\n transition: transform 300ms ease, opacity 100ms ease, visibility 0ms linear 0ms, bottom 0ms linear 0ms;\n}\n.woot-widget-bubble.woot--close.woot--hide {\n transform: translateX(8px) scale(.75) rotate(45deg);\n transition: transform 300ms ease, opacity 200ms ease, visibility 0ms linear 500ms, bottom 0ms ease 200ms;\n}\n\n.woot-widget-bubble {\n transform-origin: center;\n will-change: transform, opacity;\n transform: translateX(0) scale(1) rotate(0deg);\n transition: transform 300ms ease, opacity 100ms ease, visibility 0ms linear 0ms, bottom 0ms linear 0ms;\n}\n.woot-widget-bubble.woot--hide {\n transform: translateX(8px) scale(.75) rotate(-30deg);\n transition: transform 300ms ease, opacity 200ms ease, visibility 0ms linear 500ms, bottom 0ms ease 200ms;\n}\n\n.woot-widget-bubble.woot-widget--expanded {\n transform: translateX(0px);\n transition: transform 300ms ease, opacity 100ms ease, visibility 0ms linear 0ms, bottom 0ms linear 0ms;\n}\n.woot-widget-bubble.woot-widget--expanded.woot--hide {\n transform: translateX(8px);\n transition: transform 300ms ease, opacity 200ms ease, visibility 0ms linear 500ms, bottom 0ms ease 200ms;\n}\n.woot-widget-bubble.woot-widget-bubble--flat.woot--close {\n transform: translateX(0px);\n transition: transform 300ms ease, opacity 10ms ease, visibility 0ms linear 0ms, bottom 0ms linear 0ms;\n}\n.woot-widget-bubble.woot-widget-bubble--flat.woot--close.woot--hide {\n transform: translateX(8px);\n transition: transform 300ms ease, opacity 200ms ease, visibility 0ms linear 500ms, bottom 0ms ease 200ms;\n}\n.woot-widget-bubble.woot-widget--expanded.woot-widget-bubble--flat {\n transform: translateX(0px);\n transition: transform 300ms ease, opacity 200ms ease, visibility 0ms linear 0ms, bottom 0ms linear 0ms;\n}\n.woot-widget-bubble.woot-widget--expanded.woot-widget-bubble--flat.woot--hide {\n transform: translateX(8px);\n transition: transform 300ms ease, opacity 200ms ease, visibility 0ms linear 500ms, bottom 0ms ease 200ms;\n}\n\n@media only screen and (max-width: 667px) {\n .woot-widget-holder {\n height: 100%;\n right: 0;\n top: 0;\n width: 100%;\n }\n\n .woot-widget-holder iframe {\n min-height: 100% !important;\n }\n\n\n .woot-widget-holder.has-unread-view {\n height: auto;\n right: 0;\n width: auto;\n bottom: 0;\n top: auto;\n max-height: 100vh;\n padding: 0 8px;\n }\n\n .woot-widget-holder.has-unread-view iframe {\n min-height: unset !important;\n }\n\n .woot-widget-holder.has-unread-view.woot-elements--left {\n left: 0;\n }\n\n .woot-widget-bubble.woot--close {\n bottom: 60px;\n opacity: 0;\n visibility: hidden !important;\n z-index: -1 !important;\n }\n}\n\n@media only screen and (min-width: 667px) {\n .woot-widget-holder {\n border-radius: 16px;\n bottom: 104px;\n height: calc(90% - 64px - 20px);\n max-height: 640px !important;\n min-height: 250px !important;\n width: 400px !important;\n }\n}\n\n.woot-hidden {\n display: none !important;\n}\n`;\n","import { SDK_CSS } from './sdk.js';\nimport { IFrameHelper } from './IFrameHelper';\n\nexport const loadCSS = () => {\n const css = document.createElement('style');\n css.innerHTML = `${SDK_CSS}`;\n document.body.appendChild(css);\n};\n\nexport const addClasses = (elm, classes) => {\n elm.classList.add(...classes.split(' '));\n};\n\nexport const toggleClass = (elm, classes) => {\n elm.classList.toggle(classes);\n};\n\nexport const removeClasses = (elm, classes) => {\n elm.classList.remove(...classes.split(' '));\n};\n\nexport const onLocationChange = ({ referrerURL, referrerHost }) => {\n IFrameHelper.events.onLocationChange({\n referrerURL,\n referrerHost,\n });\n};\n\nexport const onLocationChangeListener = () => {\n let oldHref = document.location.href;\n const referrerHost = document.location.host;\n const config = {\n childList: true,\n subtree: true,\n };\n onLocationChange({\n referrerURL: oldHref,\n referrerHost,\n });\n\n const bodyList = document.querySelector('body');\n const observer = new MutationObserver(mutations => {\n mutations.forEach(() => {\n if (oldHref !== document.location.href) {\n oldHref = document.location.href;\n onLocationChange({\n referrerURL: oldHref,\n referrerHost,\n });\n }\n });\n });\n\n observer.observe(bodyList, config);\n};\n","export const BUBBLE_DESIGN = ['standard', 'expanded_bubble'];\nexport const WIDGET_DESIGN = ['standard', 'flat'];\nexport const DARK_MODE = ['light', 'auto', 'dark'];\n","import { BUBBLE_DESIGN, DARK_MODE, WIDGET_DESIGN } from './constants';\n\nexport const getBubbleView = type =>\n BUBBLE_DESIGN.includes(type) ? type : BUBBLE_DESIGN[0];\n\nexport const isExpandedView = type => getBubbleView(type) === BUBBLE_DESIGN[1];\n\nexport const getWidgetStyle = style =>\n WIDGET_DESIGN.includes(style) ? style : WIDGET_DESIGN[0];\n\nexport const isFlatWidgetStyle = style => style === 'flat';\n\nexport const getDarkMode = darkMode =>\n DARK_MODE.includes(darkMode) ? darkMode : DARK_MODE[0];\n","import { addClasses, removeClasses, toggleClass } from './DOMHelpers';\nimport { IFrameHelper } from './IFrameHelper';\nimport { isExpandedView } from './settingsHelper';\n\nexport const bubbleSVG =\n 'M240.808 240.808H122.123C56.6994 240.808 3.45695 187.562 3.45695 122.122C3.45695 56.7031 56.6994 3.45697 122.124 3.45697C187.566 3.45697 240.808 56.7031 240.808 122.122V240.808Z';\n\nexport const body = document.getElementsByTagName('body')[0];\nexport const widgetHolder = document.createElement('div');\n\nexport const bubbleHolder = document.createElement('div');\nexport const chatBubble = document.createElement('button');\nexport const closeBubble = document.createElement('button');\nexport const notificationBubble = document.createElement('span');\n\nexport const setBubbleText = bubbleText => {\n if (isExpandedView(window.$chatwoot.type)) {\n const textNode = document.getElementById('woot-widget--expanded__text');\n textNode.innerText = bubbleText;\n }\n};\n\nexport const createBubbleIcon = ({ className, path, target }) => {\n let bubbleClassName = `${className} woot-elements--${window.$chatwoot.position}`;\n const bubbleIcon = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'svg'\n );\n bubbleIcon.setAttributeNS(null, 'id', 'woot-widget-bubble-icon');\n bubbleIcon.setAttributeNS(null, 'width', '24');\n bubbleIcon.setAttributeNS(null, 'height', '24');\n bubbleIcon.setAttributeNS(null, 'viewBox', '0 0 240 240');\n bubbleIcon.setAttributeNS(null, 'fill', 'none');\n bubbleIcon.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n\n const bubblePath = document.createElementNS(\n 'http://www.w3.org/2000/svg',\n 'path'\n );\n bubblePath.setAttributeNS(null, 'd', path);\n bubblePath.setAttributeNS(null, 'fill', '#FFFFFF');\n\n bubbleIcon.appendChild(bubblePath);\n target.appendChild(bubbleIcon);\n\n if (isExpandedView(window.$chatwoot.type)) {\n const textNode = document.createElement('div');\n textNode.id = 'woot-widget--expanded__text';\n textNode.innerText = '';\n target.appendChild(textNode);\n bubbleClassName += ' woot-widget--expanded';\n }\n\n target.className = bubbleClassName;\n target.title = 'Open chat window';\n return target;\n};\n\nexport const createBubbleHolder = hideMessageBubble => {\n if (hideMessageBubble) {\n addClasses(bubbleHolder, 'woot-hidden');\n }\n addClasses(bubbleHolder, 'woot--bubble-holder');\n body.appendChild(bubbleHolder);\n};\n\nexport const createNotificationBubble = () => {\n addClasses(notificationBubble, 'woot--notification');\n return notificationBubble;\n};\n\nexport const onBubbleClick = (props = {}) => {\n const { toggleValue } = props;\n const { isOpen } = window.$chatwoot;\n if (isOpen !== toggleValue) {\n const newIsOpen = toggleValue === undefined ? !isOpen : toggleValue;\n window.$chatwoot.isOpen = newIsOpen;\n\n toggleClass(chatBubble, 'woot--hide');\n toggleClass(closeBubble, 'woot--hide');\n toggleClass(widgetHolder, 'woot--hide');\n IFrameHelper.events.onBubbleToggle(newIsOpen);\n\n if (!newIsOpen) {\n chatBubble.focus();\n }\n }\n};\n\nexport const onClickChatBubble = () => {\n bubbleHolder.addEventListener('click', onBubbleClick);\n};\n\nexport const addUnreadClass = () => {\n const holderEl = document.querySelector('.woot-widget-holder');\n addClasses(holderEl, 'has-unread-view');\n};\n\nexport const removeUnreadClass = () => {\n const holderEl = document.querySelector('.woot-widget-holder');\n removeClasses(holderEl, 'has-unread-view');\n};\n","export const createEvent = ({ eventName, data = null }) => {\n let event;\n if (typeof window.CustomEvent === 'function') {\n event = new CustomEvent(eventName, { detail: data });\n } else {\n event = document.createEvent('CustomEvent');\n event.initCustomEvent(eventName, false, false, data);\n }\n return event;\n};\n\nexport const dispatchWindowEvent = ({ eventName, data }) => {\n const event = createEvent({ eventName, data });\n window.dispatchEvent(event);\n};\n","import md5 from 'md5';\nimport Cookies from 'js-cookie';\n\nconst REQUIRED_USER_KEYS = ['avatar_url', 'email', 'name'];\nconst ALLOWED_USER_ATTRIBUTES = [...REQUIRED_USER_KEYS, 'identifier_hash'];\n\nexport const getUserCookieName = () => {\n const SET_USER_COOKIE_PREFIX = 'cw_user_';\n const { websiteToken: websiteIdentifier } = window.$chatwoot;\n return `${SET_USER_COOKIE_PREFIX}${websiteIdentifier}`;\n};\n\nexport const getUserString = ({ identifier = '', user }) => {\n const userStringWithSortedKeys = ALLOWED_USER_ATTRIBUTES.reduce(\n (acc, key) => `${acc}${key}${user[key] || ''}`,\n ''\n );\n return `${userStringWithSortedKeys}identifier${identifier}`;\n};\n\nexport const computeHashForUserData = (...args) => md5(getUserString(...args));\n\nexport const hasUserKeys = user =>\n REQUIRED_USER_KEYS.reduce((acc, key) => acc || !!user[key], false);\n\nexport const setCookieWithDomain = (\n name,\n value,\n { expires = 365, baseDomain = undefined } = {}\n) => {\n const cookieOptions = {\n expires,\n sameSite: 'Lax',\n domain: baseDomain,\n };\n\n // if type of value is object, stringify it\n // this is because js-cookies 3.0 removed builtin json support\n // ref: https://github.com/js-cookie/js-cookie/releases/tag/v3.0.0\n if (typeof value === 'object') {\n value = JSON.stringify(value);\n }\n\n Cookies.set(name, value, cookieOptions);\n};\n","import Cookies from 'js-cookie';\nimport {\n addClasses,\n loadCSS,\n removeClasses,\n onLocationChangeListener,\n} from './DOMHelpers';\nimport {\n body,\n widgetHolder,\n createBubbleHolder,\n createBubbleIcon,\n bubbleSVG,\n chatBubble,\n closeBubble,\n bubbleHolder,\n createNotificationBubble,\n onClickChatBubble,\n onBubbleClick,\n setBubbleText,\n addUnreadClass,\n removeUnreadClass,\n} from './bubbleHelpers';\nimport { isWidgetColorLighter } from 'shared/helpers/colorHelper';\nimport { dispatchWindowEvent } from 'shared/helpers/CustomEventHelper';\nimport { CHATWOOT_ERROR, CHATWOOT_READY } from '../widget/constants/sdkEvents';\nimport { SET_USER_ERROR } from '../widget/constants/errorTypes';\nimport { getUserCookieName, setCookieWithDomain } from './cookieHelpers';\nimport {\n getAlertAudio,\n initOnEvents,\n} from 'shared/helpers/AudioNotificationHelper';\nimport { isFlatWidgetStyle } from './settingsHelper';\nimport { popoutChatWindow } from '../widget/helpers/popoutHelper';\nimport addHours from 'date-fns/addHours';\n\nconst updateAuthCookie = (cookieContent, baseDomain = '') =>\n setCookieWithDomain('cw_conversation', cookieContent, {\n baseDomain,\n });\n\nconst updateCampaignReadStatus = baseDomain => {\n const expireBy = addHours(new Date(), 1);\n setCookieWithDomain('cw_snooze_campaigns_till', Number(expireBy), {\n expires: expireBy,\n baseDomain,\n });\n};\n\nexport const IFrameHelper = {\n getUrl({ baseUrl, websiteToken }) {\n return `${baseUrl}/widget?website_token=${websiteToken}`;\n },\n createFrame: ({ baseUrl, websiteToken }) => {\n if (IFrameHelper.getAppFrame()) {\n return;\n }\n\n loadCSS();\n const iframe = document.createElement('iframe');\n const cwCookie = Cookies.get('cw_conversation');\n let widgetUrl = IFrameHelper.getUrl({ baseUrl, websiteToken });\n if (cwCookie) {\n widgetUrl = `${widgetUrl}&cw_conversation=${cwCookie}`;\n }\n iframe.src = widgetUrl;\n iframe.allow =\n 'camera;microphone;fullscreen;display-capture;picture-in-picture;clipboard-write;';\n iframe.id = 'chatwoot_live_chat_widget';\n iframe.style.visibility = 'hidden';\n\n let holderClassName = `woot-widget-holder woot--hide woot-elements--${window.$chatwoot.position}`;\n if (window.$chatwoot.hideMessageBubble) {\n holderClassName += ` woot-widget--without-bubble`;\n }\n if (isFlatWidgetStyle(window.$chatwoot.widgetStyle)) {\n holderClassName += ` woot-widget-holder--flat`;\n }\n\n addClasses(widgetHolder, holderClassName);\n widgetHolder.appendChild(iframe);\n body.appendChild(widgetHolder);\n IFrameHelper.initPostMessageCommunication();\n IFrameHelper.initWindowSizeListener();\n IFrameHelper.preventDefaultScroll();\n },\n getAppFrame: () => document.getElementById('chatwoot_live_chat_widget'),\n getBubbleHolder: () => document.getElementsByClassName('woot--bubble-holder'),\n sendMessage: (key, value) => {\n const element = IFrameHelper.getAppFrame();\n element.contentWindow.postMessage(\n `chatwoot-widget:${JSON.stringify({ event: key, ...value })}`,\n '*'\n );\n },\n initPostMessageCommunication: () => {\n window.onmessage = e => {\n if (\n typeof e.data !== 'string' ||\n e.data.indexOf('chatwoot-widget:') !== 0\n ) {\n return;\n }\n const message = JSON.parse(e.data.replace('chatwoot-widget:', ''));\n if (typeof IFrameHelper.events[message.event] === 'function') {\n IFrameHelper.events[message.event](message);\n }\n };\n },\n initWindowSizeListener: () => {\n window.addEventListener('resize', () => IFrameHelper.toggleCloseButton());\n },\n preventDefaultScroll: () => {\n widgetHolder.addEventListener('wheel', event => {\n const deltaY = event.deltaY;\n const contentHeight = widgetHolder.scrollHeight;\n const visibleHeight = widgetHolder.offsetHeight;\n const scrollTop = widgetHolder.scrollTop;\n\n if (\n (scrollTop === 0 && deltaY < 0) ||\n (visibleHeight + scrollTop === contentHeight && deltaY > 0)\n ) {\n event.preventDefault();\n }\n });\n },\n\n setFrameHeightToFitContent: (extraHeight, isFixedHeight) => {\n const iframe = IFrameHelper.getAppFrame();\n const updatedIframeHeight = isFixedHeight ? `${extraHeight}px` : '100%';\n\n if (iframe)\n iframe.setAttribute('style', `height: ${updatedIframeHeight} !important`);\n },\n\n setupAudioListeners: () => {\n const { baseUrl = '' } = window.$chatwoot;\n getAlertAudio(baseUrl, { type: 'widget', alertTone: 'ding' }).then(() =>\n initOnEvents.forEach(event => {\n document.removeEventListener(\n event,\n IFrameHelper.setupAudioListeners,\n false\n );\n })\n );\n },\n\n events: {\n loaded: message => {\n updateAuthCookie(message.config.authToken, window.$chatwoot.baseDomain);\n window.$chatwoot.hasLoaded = true;\n const campaignsSnoozedTill = Cookies.get('cw_snooze_campaigns_till');\n IFrameHelper.sendMessage('config-set', {\n locale: window.$chatwoot.locale,\n position: window.$chatwoot.position,\n hideMessageBubble: window.$chatwoot.hideMessageBubble,\n showPopoutButton: window.$chatwoot.showPopoutButton,\n widgetStyle: window.$chatwoot.widgetStyle,\n darkMode: window.$chatwoot.darkMode,\n campaignsSnoozedTill,\n });\n IFrameHelper.onLoad({\n widgetColor: message.config.channelConfig.widgetColor,\n });\n IFrameHelper.toggleCloseButton();\n\n if (window.$chatwoot.user) {\n IFrameHelper.sendMessage('set-user', window.$chatwoot.user);\n }\n\n window.playAudioAlert = () => {};\n\n initOnEvents.forEach(e => {\n document.addEventListener(e, IFrameHelper.setupAudioListeners, false);\n });\n\n if (!window.$chatwoot.resetTriggered) {\n dispatchWindowEvent({ eventName: CHATWOOT_READY });\n }\n },\n error: ({ errorType, data }) => {\n dispatchWindowEvent({ eventName: CHATWOOT_ERROR, data: data });\n\n if (errorType === SET_USER_ERROR) {\n Cookies.remove(getUserCookieName());\n }\n },\n onEvent({ eventIdentifier: eventName, data }) {\n dispatchWindowEvent({ eventName, data });\n },\n setBubbleLabel(message) {\n setBubbleText(window.$chatwoot.launcherTitle || message.label);\n },\n\n setAuthCookie({ data: { widgetAuthToken } }) {\n updateAuthCookie(widgetAuthToken, window.$chatwoot.baseDomain);\n },\n\n setCampaignReadOn() {\n updateCampaignReadStatus(window.$chatwoot.baseDomain);\n },\n\n toggleBubble: state => {\n let bubbleState = {};\n if (state === 'open') {\n bubbleState.toggleValue = true;\n } else if (state === 'close') {\n bubbleState.toggleValue = false;\n }\n\n onBubbleClick(bubbleState);\n },\n\n popoutChatWindow: ({ baseUrl, websiteToken, locale }) => {\n const cwCookie = Cookies.get('cw_conversation');\n window.$chatwoot.toggle('close');\n popoutChatWindow(baseUrl, websiteToken, locale, cwCookie);\n },\n\n closeWindow: () => {\n onBubbleClick({ toggleValue: false });\n removeUnreadClass();\n },\n\n onBubbleToggle: isOpen => {\n IFrameHelper.sendMessage('toggle-open', { isOpen });\n if (isOpen) {\n IFrameHelper.pushEvent('webwidget.triggered');\n }\n },\n onLocationChange: ({ referrerURL, referrerHost }) => {\n IFrameHelper.sendMessage('change-url', {\n referrerURL,\n referrerHost,\n });\n },\n updateIframeHeight: message => {\n const { extraHeight = 0, isFixedHeight } = message;\n\n IFrameHelper.setFrameHeightToFitContent(extraHeight, isFixedHeight);\n },\n\n setUnreadMode: () => {\n addUnreadClass();\n onBubbleClick({ toggleValue: true });\n },\n\n resetUnreadMode: () => removeUnreadClass(),\n handleNotificationDot: event => {\n if (window.$chatwoot.hideMessageBubble) {\n return;\n }\n\n const bubbleElement = document.querySelector('.woot-widget-bubble');\n if (\n event.unreadMessageCount > 0 &&\n !bubbleElement.classList.contains('unread-notification')\n ) {\n addClasses(bubbleElement, 'unread-notification');\n } else if (event.unreadMessageCount === 0) {\n removeClasses(bubbleElement, 'unread-notification');\n }\n },\n\n closeChat: () => {\n onBubbleClick({ toggleValue: false });\n },\n\n playAudio: () => {\n window.playAudioAlert();\n },\n },\n pushEvent: eventName => {\n IFrameHelper.sendMessage('push-event', { eventName });\n },\n\n onLoad: ({ widgetColor }) => {\n const iframe = IFrameHelper.getAppFrame();\n iframe.style.visibility = '';\n iframe.setAttribute('id', `chatwoot_live_chat_widget`);\n\n if (IFrameHelper.getBubbleHolder().length) {\n return;\n }\n createBubbleHolder(window.$chatwoot.hideMessageBubble);\n onLocationChangeListener();\n\n let className = 'woot-widget-bubble';\n let closeBtnClassName = `woot-elements--${window.$chatwoot.position} woot-widget-bubble woot--close woot--hide`;\n\n if (isFlatWidgetStyle(window.$chatwoot.widgetStyle)) {\n className += ' woot-widget-bubble--flat';\n closeBtnClassName += ' woot-widget-bubble--flat';\n }\n\n if (isWidgetColorLighter(widgetColor)) {\n className += ' woot-widget-bubble-color--lighter';\n closeBtnClassName += ' woot-widget-bubble-color--lighter';\n }\n\n const chatIcon = createBubbleIcon({\n className,\n path: bubbleSVG,\n target: chatBubble,\n });\n\n addClasses(closeBubble, closeBtnClassName);\n\n chatIcon.style.background = widgetColor;\n closeBubble.style.background = widgetColor;\n\n bubbleHolder.appendChild(chatIcon);\n bubbleHolder.appendChild(closeBubble);\n bubbleHolder.appendChild(createNotificationBubble());\n onClickChatBubble();\n },\n toggleCloseButton: () => {\n let isMobile = false;\n if (window.matchMedia('(max-width: 668px)').matches) {\n isMobile = true;\n }\n IFrameHelper.sendMessage('toggle-close-button', { isMobile });\n },\n};\n","import Cookies from 'js-cookie';\nimport { IFrameHelper } from '../sdk/IFrameHelper';\nimport {\n getBubbleView,\n getDarkMode,\n getWidgetStyle,\n} from '../sdk/settingsHelper';\nimport {\n computeHashForUserData,\n getUserCookieName,\n hasUserKeys,\n} from '../sdk/cookieHelpers';\nimport { addClasses, removeClasses } from '../sdk/DOMHelpers';\nimport { setCookieWithDomain } from '../sdk/cookieHelpers';\nimport { SDK_SET_BUBBLE_VISIBILITY } from 'shared/constants/sharedFrameEvents';\nconst runSDK = ({ baseUrl, websiteToken }) => {\n if (window.$chatwoot) {\n return;\n }\n\n const chatwootSettings = window.chatwootSettings || {};\n let locale = chatwootSettings.locale;\n let baseDomain = chatwootSettings.baseDomain;\n\n if (chatwootSettings.useBrowserLanguage) {\n locale = window.navigator.language.replace('-', '_');\n }\n\n window.$chatwoot = {\n baseUrl,\n baseDomain,\n hasLoaded: false,\n hideMessageBubble: chatwootSettings.hideMessageBubble || false,\n isOpen: false,\n position: chatwootSettings.position === 'left' ? 'left' : 'right',\n websiteToken,\n locale,\n useBrowserLanguage: chatwootSettings.useBrowserLanguage || false,\n type: getBubbleView(chatwootSettings.type),\n launcherTitle: chatwootSettings.launcherTitle || '',\n showPopoutButton: chatwootSettings.showPopoutButton || false,\n widgetStyle: getWidgetStyle(chatwootSettings.widgetStyle) || 'standard',\n resetTriggered: false,\n darkMode: getDarkMode(chatwootSettings.darkMode),\n\n toggle(state) {\n IFrameHelper.events.toggleBubble(state);\n },\n\n toggleBubbleVisibility(visibility) {\n let widgetElm = document.querySelector('.woot--bubble-holder');\n let widgetHolder = document.querySelector('.woot-widget-holder');\n if (visibility === 'hide') {\n addClasses(widgetHolder, 'woot-widget--without-bubble');\n addClasses(widgetElm, 'woot-hidden');\n window.$chatwoot.hideMessageBubble = true;\n } else if (visibility === 'show') {\n removeClasses(widgetElm, 'woot-hidden');\n removeClasses(widgetHolder, 'woot-widget--without-bubble');\n window.$chatwoot.hideMessageBubble = false;\n }\n IFrameHelper.sendMessage(SDK_SET_BUBBLE_VISIBILITY, {\n hideMessageBubble: window.$chatwoot.hideMessageBubble,\n });\n },\n\n popoutChatWindow() {\n IFrameHelper.events.popoutChatWindow({\n baseUrl: window.$chatwoot.baseUrl,\n websiteToken: window.$chatwoot.websiteToken,\n locale,\n });\n },\n\n setUser(identifier, user) {\n if (typeof identifier !== 'string' && typeof identifier !== 'number') {\n throw new Error('Identifier should be a string or a number');\n }\n\n if (!hasUserKeys(user)) {\n throw new Error(\n 'User object should have one of the keys [avatar_url, email, name]'\n );\n }\n\n const userCookieName = getUserCookieName();\n const existingCookieValue = Cookies.get(userCookieName);\n const hashToBeStored = computeHashForUserData({ identifier, user });\n if (hashToBeStored === existingCookieValue) {\n return;\n }\n\n window.$chatwoot.identifier = identifier;\n window.$chatwoot.user = user;\n IFrameHelper.sendMessage('set-user', { identifier, user });\n\n setCookieWithDomain(userCookieName, hashToBeStored, {\n baseDomain,\n });\n },\n\n setCustomAttributes(customAttributes = {}) {\n if (!customAttributes || !Object.keys(customAttributes).length) {\n throw new Error('Custom attributes should have atleast one key');\n } else {\n IFrameHelper.sendMessage('set-custom-attributes', { customAttributes });\n }\n },\n\n deleteCustomAttribute(customAttribute = '') {\n if (!customAttribute) {\n throw new Error('Custom attribute is required');\n } else {\n IFrameHelper.sendMessage('delete-custom-attribute', {\n customAttribute,\n });\n }\n },\n\n setConversationCustomAttributes(customAttributes = {}) {\n if (!customAttributes || !Object.keys(customAttributes).length) {\n throw new Error('Custom attributes should have atleast one key');\n } else {\n IFrameHelper.sendMessage('set-conversation-custom-attributes', {\n customAttributes,\n });\n }\n },\n\n deleteConversationCustomAttribute(customAttribute = '') {\n if (!customAttribute) {\n throw new Error('Custom attribute is required');\n } else {\n IFrameHelper.sendMessage('delete-conversation-custom-attribute', {\n customAttribute,\n });\n }\n },\n\n setLabel(label = '') {\n IFrameHelper.sendMessage('set-label', { label });\n },\n\n removeLabel(label = '') {\n IFrameHelper.sendMessage('remove-label', { label });\n },\n\n setLocale(localeToBeUsed = 'en') {\n IFrameHelper.sendMessage('set-locale', { locale: localeToBeUsed });\n },\n\n setColorScheme(darkMode = 'light') {\n IFrameHelper.sendMessage('set-color-scheme', {\n darkMode: getDarkMode(darkMode),\n });\n },\n\n reset() {\n if (window.$chatwoot.isOpen) {\n IFrameHelper.events.toggleBubble();\n }\n\n Cookies.remove('cw_conversation');\n Cookies.remove(getUserCookieName());\n\n const iframe = IFrameHelper.getAppFrame();\n iframe.src = IFrameHelper.getUrl({\n baseUrl: window.$chatwoot.baseUrl,\n websiteToken: window.$chatwoot.websiteToken,\n });\n\n window.$chatwoot.resetTriggered = true;\n },\n };\n\n IFrameHelper.createFrame({\n baseUrl,\n websiteToken,\n });\n};\n\nwindow.chatwootSDK = {\n run: runSDK,\n};\n","/**\n * A simple guard function:\n *\n * ```js\n * Math.min(Math.max(low, value), high)\n * ```\n */\nfunction guard(low, high, value) {\n return Math.min(Math.max(low, value), high);\n}\nclass ColorError extends Error {\n constructor(color) {\n super(`Failed to parse color: \"${color}\"`);\n }\n}\nvar ColorError$1 = ColorError;\n\n/**\n * Parses a color into red, gree, blue, alpha parts\n *\n * @param color the input color. Can be a RGB, RBGA, HSL, HSLA, or named color\n */\nfunction parseToRgba(color) {\n if (typeof color !== 'string') throw new ColorError$1(color);\n if (color.trim().toLowerCase() === 'transparent') return [0, 0, 0, 0];\n let normalizedColor = color.trim();\n normalizedColor = namedColorRegex.test(color) ? nameToHex(color) : color;\n const reducedHexMatch = reducedHexRegex.exec(normalizedColor);\n if (reducedHexMatch) {\n const arr = Array.from(reducedHexMatch).slice(1);\n return [...arr.slice(0, 3).map(x => parseInt(r(x, 2), 16)), parseInt(r(arr[3] || 'f', 2), 16) / 255];\n }\n const hexMatch = hexRegex.exec(normalizedColor);\n if (hexMatch) {\n const arr = Array.from(hexMatch).slice(1);\n return [...arr.slice(0, 3).map(x => parseInt(x, 16)), parseInt(arr[3] || 'ff', 16) / 255];\n }\n const rgbaMatch = rgbaRegex.exec(normalizedColor);\n if (rgbaMatch) {\n const arr = Array.from(rgbaMatch).slice(1);\n return [...arr.slice(0, 3).map(x => parseInt(x, 10)), parseFloat(arr[3] || '1')];\n }\n const hslaMatch = hslaRegex.exec(normalizedColor);\n if (hslaMatch) {\n const [h, s, l, a] = Array.from(hslaMatch).slice(1).map(parseFloat);\n if (guard(0, 100, s) !== s) throw new ColorError$1(color);\n if (guard(0, 100, l) !== l) throw new ColorError$1(color);\n return [...hslToRgb(h, s, l), Number.isNaN(a) ? 1 : a];\n }\n throw new ColorError$1(color);\n}\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i) {\n hash = hash * 33 ^ str.charCodeAt(--i);\n }\n\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */\n return (hash >>> 0) % 2341;\n}\nconst colorToInt = x => parseInt(x.replace(/_/g, ''), 36);\nconst compressedColorMap = '1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm'.split(' ').reduce((acc, next) => {\n const key = colorToInt(next.substring(0, 3));\n const hex = colorToInt(next.substring(3)).toString(16);\n\n // NOTE: padStart could be used here but it breaks Node 6 compat\n // https://github.com/ricokahler/color2k/issues/351\n let prefix = '';\n for (let i = 0; i < 6 - hex.length; i++) {\n prefix += '0';\n }\n acc[key] = `${prefix}${hex}`;\n return acc;\n}, {});\n\n/**\n * Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.\n */\nfunction nameToHex(color) {\n const normalizedColorName = color.toLowerCase().trim();\n const result = compressedColorMap[hash(normalizedColorName)];\n if (!result) throw new ColorError$1(color);\n return `#${result}`;\n}\nconst r = (str, amount) => Array.from(Array(amount)).map(() => str).join('');\nconst reducedHexRegex = new RegExp(`^#${r('([a-f0-9])', 3)}([a-f0-9])?$`, 'i');\nconst hexRegex = new RegExp(`^#${r('([a-f0-9]{2})', 3)}([a-f0-9]{2})?$`, 'i');\nconst rgbaRegex = new RegExp(`^rgba?\\\\(\\\\s*(\\\\d+)\\\\s*${r(',\\\\s*(\\\\d+)\\\\s*', 2)}(?:,\\\\s*([\\\\d.]+))?\\\\s*\\\\)$`, 'i');\nconst hslaRegex = /^hsla?\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)%\\s*,\\s*([\\d.]+)%(?:\\s*,\\s*([\\d.]+))?\\s*\\)$/i;\nconst namedColorRegex = /^[a-z]+$/i;\nconst roundColor = color => {\n return Math.round(color * 255);\n};\nconst hslToRgb = (hue, saturation, lightness) => {\n let l = lightness / 100;\n if (saturation === 0) {\n // achromatic\n return [l, l, l].map(roundColor);\n }\n\n // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV\n const huePrime = (hue % 360 + 360) % 360 / 60;\n const chroma = (1 - Math.abs(2 * l - 1)) * (saturation / 100);\n const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));\n let red = 0;\n let green = 0;\n let blue = 0;\n if (huePrime >= 0 && huePrime < 1) {\n red = chroma;\n green = secondComponent;\n } else if (huePrime >= 1 && huePrime < 2) {\n red = secondComponent;\n green = chroma;\n } else if (huePrime >= 2 && huePrime < 3) {\n green = chroma;\n blue = secondComponent;\n } else if (huePrime >= 3 && huePrime < 4) {\n green = secondComponent;\n blue = chroma;\n } else if (huePrime >= 4 && huePrime < 5) {\n red = secondComponent;\n blue = chroma;\n } else if (huePrime >= 5 && huePrime < 6) {\n red = chroma;\n blue = secondComponent;\n }\n const lightnessModification = l - chroma / 2;\n const finalRed = red + lightnessModification;\n const finalGreen = green + lightnessModification;\n const finalBlue = blue + lightnessModification;\n return [finalRed, finalGreen, finalBlue].map(roundColor);\n};\n\n// taken from:\n// https://github.com/styled-components/polished/blob/a23a6a2bb26802b3d922d9c3b67bac3f3a54a310/src/internalHelpers/_rgbToHsl.js\n\n/**\n * Parses a color in hue, saturation, lightness, and the alpha channel.\n *\n * Hue is a number between 0 and 360, saturation, lightness, and alpha are\n * decimal percentages between 0 and 1\n */\nfunction parseToHsla(color) {\n const [red, green, blue, alpha] = parseToRgba(color).map((value, index) =>\n // 3rd index is alpha channel which is already normalized\n index === 3 ? value : value / 255);\n const max = Math.max(red, green, blue);\n const min = Math.min(red, green, blue);\n const lightness = (max + min) / 2;\n\n // achromatic\n if (max === min) return [0, 0, lightness, alpha];\n const delta = max - min;\n const saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);\n const hue = 60 * (red === max ? (green - blue) / delta + (green < blue ? 6 : 0) : green === max ? (blue - red) / delta + 2 : (red - green) / delta + 4);\n return [hue, saturation, lightness, alpha];\n}\n\n/**\n * Takes in hsla parts and constructs an hsla string\n *\n * @param hue The color circle (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is blue\n * @param saturation Percentage of saturation, given as a decimal between 0 and 1\n * @param lightness Percentage of lightness, given as a decimal between 0 and 1\n * @param alpha Percentage of opacity, given as a decimal between 0 and 1\n */\nfunction hsla(hue, saturation, lightness, alpha) {\n return `hsla(${(hue % 360).toFixed()}, ${guard(0, 100, saturation * 100).toFixed()}%, ${guard(0, 100, lightness * 100).toFixed()}%, ${parseFloat(guard(0, 1, alpha).toFixed(3))})`;\n}\n\n/**\n * Adjusts the current hue of the color by the given degrees. Wraps around when\n * over 360.\n *\n * @param color input color\n * @param degrees degrees to adjust the input color, accepts degree integers\n * (0 - 360) and wraps around on overflow\n */\nfunction adjustHue(color, degrees) {\n const [h, s, l, a] = parseToHsla(color);\n return hsla(h + degrees, s, l, a);\n}\n\n/**\n * Darkens using lightness. This is equivalent to subtracting the lightness\n * from the L in HSL.\n *\n * @param amount The amount to darken, given as a decimal between 0 and 1\n */\nfunction darken(color, amount) {\n const [hue, saturation, lightness, alpha] = parseToHsla(color);\n return hsla(hue, saturation, lightness - amount, alpha);\n}\n\n/**\n * Desaturates the input color by the given amount via subtracting from the `s`\n * in `hsla`.\n *\n * @param amount The amount to desaturate, given as a decimal between 0 and 1\n */\nfunction desaturate(color, amount) {\n const [h, s, l, a] = parseToHsla(color);\n return hsla(h, s - amount, l, a);\n}\n\n// taken from:\n// https://github.com/styled-components/polished/blob/0764c982551b487469043acb56281b0358b3107b/src/color/getLuminance.js\n\n/**\n * Returns a number (float) representing the luminance of a color.\n */\nfunction getLuminance(color) {\n if (color === 'transparent') return 0;\n function f(x) {\n const channel = x / 255;\n return channel <= 0.04045 ? channel / 12.92 : Math.pow((channel + 0.055) / 1.055, 2.4);\n }\n const [r, g, b] = parseToRgba(color);\n return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b);\n}\n\n// taken from:\n// https://github.com/styled-components/polished/blob/0764c982551b487469043acb56281b0358b3107b/src/color/getContrast.js\n\n/**\n * Returns the contrast ratio between two colors based on\n * [W3's recommended equation for calculating contrast](http://www.w3.org/TR/WCAG20/#contrast-ratiodef).\n */\nfunction getContrast(color1, color2) {\n const luminance1 = getLuminance(color1);\n const luminance2 = getLuminance(color2);\n return luminance1 > luminance2 ? (luminance1 + 0.05) / (luminance2 + 0.05) : (luminance2 + 0.05) / (luminance1 + 0.05);\n}\n\n/**\n * Takes in rgba parts and returns an rgba string\n *\n * @param red The amount of red in the red channel, given in a number between 0 and 255 inclusive\n * @param green The amount of green in the red channel, given in a number between 0 and 255 inclusive\n * @param blue The amount of blue in the red channel, given in a number between 0 and 255 inclusive\n * @param alpha Percentage of opacity, given as a decimal between 0 and 1\n */\nfunction rgba(red, green, blue, alpha) {\n return `rgba(${guard(0, 255, red).toFixed()}, ${guard(0, 255, green).toFixed()}, ${guard(0, 255, blue).toFixed()}, ${parseFloat(guard(0, 1, alpha).toFixed(3))})`;\n}\n\n/**\n * Mixes two colors together. Taken from sass's implementation.\n */\nfunction mix(color1, color2, weight) {\n const normalize = (n, index) =>\n // 3rd index is alpha channel which is already normalized\n index === 3 ? n : n / 255;\n const [r1, g1, b1, a1] = parseToRgba(color1).map(normalize);\n const [r2, g2, b2, a2] = parseToRgba(color2).map(normalize);\n\n // The formula is copied from the original Sass implementation:\n // http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method\n const alphaDelta = a2 - a1;\n const normalizedWeight = weight * 2 - 1;\n const combinedWeight = normalizedWeight * alphaDelta === -1 ? normalizedWeight : normalizedWeight + alphaDelta / (1 + normalizedWeight * alphaDelta);\n const weight2 = (combinedWeight + 1) / 2;\n const weight1 = 1 - weight2;\n const r = (r1 * weight1 + r2 * weight2) * 255;\n const g = (g1 * weight1 + g2 * weight2) * 255;\n const b = (b1 * weight1 + b2 * weight2) * 255;\n const a = a2 * weight + a1 * (1 - weight);\n return rgba(r, g, b, a);\n}\n\n/**\n * Given a series colors, this function will return a `scale(x)` function that\n * accepts a percentage as a decimal between 0 and 1 and returns the color at\n * that percentage in the scale.\n *\n * ```js\n * const scale = getScale('red', 'yellow', 'green');\n * console.log(scale(0)); // rgba(255, 0, 0, 1)\n * console.log(scale(0.5)); // rgba(255, 255, 0, 1)\n * console.log(scale(1)); // rgba(0, 128, 0, 1)\n * ```\n *\n * If you'd like to limit the domain and range like chroma-js, we recommend\n * wrapping scale again.\n *\n * ```js\n * const _scale = getScale('red', 'yellow', 'green');\n * const scale = x => _scale(x / 100);\n *\n * console.log(scale(0)); // rgba(255, 0, 0, 1)\n * console.log(scale(50)); // rgba(255, 255, 0, 1)\n * console.log(scale(100)); // rgba(0, 128, 0, 1)\n * ```\n */\nfunction getScale() {\n for (var _len = arguments.length, colors = new Array(_len), _key = 0; _key < _len; _key++) {\n colors[_key] = arguments[_key];\n }\n return n => {\n const lastIndex = colors.length - 1;\n const lowIndex = guard(0, lastIndex, Math.floor(n * lastIndex));\n const highIndex = guard(0, lastIndex, Math.ceil(n * lastIndex));\n const color1 = colors[lowIndex];\n const color2 = colors[highIndex];\n const unit = 1 / lastIndex;\n const weight = (n - unit * lowIndex) / unit;\n return mix(color1, color2, weight);\n };\n}\nconst guidelines = {\n decorative: 1.5,\n readable: 3,\n aa: 4.5,\n aaa: 7\n};\n\n/**\n * Returns whether or not a color has bad contrast against a background\n * according to a given standard.\n */\nfunction hasBadContrast(color) {\n let standard = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'aa';\n let background = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '#fff';\n return getContrast(color, background) < guidelines[standard];\n}\n\n/**\n * Lightens a color by a given amount. This is equivalent to\n * `darken(color, -amount)`\n *\n * @param amount The amount to darken, given as a decimal between 0 and 1\n */\nfunction lighten(color, amount) {\n return darken(color, -amount);\n}\n\n/**\n * Takes in a color and makes it more transparent by convert to `rgba` and\n * decreasing the amount in the alpha channel.\n *\n * @param amount The amount to increase the transparency by, given as a decimal between 0 and 1\n */\nfunction transparentize(color, amount) {\n const [r, g, b, a] = parseToRgba(color);\n return rgba(r, g, b, a - amount);\n}\n\n/**\n * Takes a color and un-transparentizes it. Equivalent to\n * `transparentize(color, -amount)`\n *\n * @param amount The amount to increase the opacity by, given as a decimal between 0 and 1\n */\nfunction opacify(color, amount) {\n return transparentize(color, -amount);\n}\n\n/**\n * An alternative function to `readableColor`. Returns whether or not the \n * readable color (i.e. the color to be place on top the input color) should be\n * black.\n */\nfunction readableColorIsBlack(color) {\n return getLuminance(color) > 0.179;\n}\n\n/**\n * Returns black or white for best contrast depending on the luminosity of the\n * given color.\n */\nfunction readableColor(color) {\n return readableColorIsBlack(color) ? '#000' : '#fff';\n}\n\n/**\n * Saturates a color by converting it to `hsl` and increasing the saturation\n * amount. Equivalent to `desaturate(color, -amount)`\n * \n * @param color Input color\n * @param amount The amount to darken, given as a decimal between 0 and 1\n */\nfunction saturate(color, amount) {\n return desaturate(color, -amount);\n}\n\n/**\n * Takes in any color and returns it as a hex code.\n */\nfunction toHex(color) {\n const [r, g, b, a] = parseToRgba(color);\n let hex = x => {\n const h = guard(0, 255, x).toString(16);\n // NOTE: padStart could be used here but it breaks Node 6 compat\n // https://github.com/ricokahler/color2k/issues/351\n return h.length === 1 ? `0${h}` : h;\n };\n return `#${hex(r)}${hex(g)}${hex(b)}${a < 1 ? hex(Math.round(a * 255)) : ''}`;\n}\n\n/**\n * Takes in any color and returns it as an rgba string.\n */\nfunction toRgba(color) {\n return rgba(...parseToRgba(color));\n}\n\n/**\n * Takes in any color and returns it as an hsla string.\n */\nfunction toHsla(color) {\n return hsla(...parseToHsla(color));\n}\nexport { ColorError$1 as ColorError, adjustHue, darken, desaturate, getContrast, getLuminance, getScale, guard, hasBadContrast, hsla, lighten, mix, opacify, parseToHsla, parseToRgba, readableColor, readableColorIsBlack, rgba, saturate, toHex, toHsla, toRgba, transparentize };","import { toHex, mix, getLuminance, getContrast } from 'color2k';\n\nexport const isWidgetColorLighter = color => {\n const colorToCheck = color.replace('#', '');\n const c_r = parseInt(colorToCheck.substr(0, 2), 16);\n const c_g = parseInt(colorToCheck.substr(2, 2), 16);\n const c_b = parseInt(colorToCheck.substr(4, 2), 16);\n const brightness = (c_r * 299 + c_g * 587 + c_b * 114) / 1000;\n return brightness > 225;\n};\n\nexport const adjustColorForContrast = (color, backgroundColor) => {\n const targetRatio = 3.1;\n const MAX_ITERATIONS = 20;\n let adjustedColor = color;\n\n for (let iteration = 0; iteration < MAX_ITERATIONS; iteration += 1) {\n const currentRatio = getContrast(adjustedColor, backgroundColor);\n if (currentRatio >= targetRatio) {\n break;\n }\n const adjustmentDirection =\n getLuminance(adjustedColor) < 0.5 ? '#fff' : '#151718';\n adjustedColor = mix(adjustedColor, adjustmentDirection, 0.05);\n }\n\n return toHex(adjustedColor);\n};\n","/*! js-cookie v3.0.5 | MIT */\n;\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, function () {\n var current = global.Cookies;\n var exports = global.Cookies = factory();\n exports.noConflict = function () {\n global.Cookies = current;\n return exports;\n };\n }());\n})(this, function () {\n 'use strict';\n\n /* eslint-disable no-var */\n function assign(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n target[key] = source[key];\n }\n }\n return target;\n }\n /* eslint-enable no-var */\n\n /* eslint-disable no-var */\n var defaultConverter = {\n read: function (value) {\n if (value[0] === '\"') {\n value = value.slice(1, -1);\n }\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent);\n },\n write: function (value) {\n return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);\n }\n };\n /* eslint-enable no-var */\n\n /* eslint-disable no-var */\n\n function init(converter, defaultAttributes) {\n function set(name, value, attributes) {\n if (typeof document === 'undefined') {\n return;\n }\n attributes = assign({}, defaultAttributes, attributes);\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n }\n if (attributes.expires) {\n attributes.expires = attributes.expires.toUTCString();\n }\n name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue;\n }\n stringifiedAttributes += '; ' + attributeName;\n if (attributes[attributeName] === true) {\n continue;\n }\n\n // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n return document.cookie = name + '=' + converter.write(value, name) + stringifiedAttributes;\n }\n function get(name) {\n if (typeof document === 'undefined' || arguments.length && !name) {\n return;\n }\n\n // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var jar = {};\n for (var i = 0; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var value = parts.slice(1).join('=');\n try {\n var found = decodeURIComponent(parts[0]);\n jar[found] = converter.read(value, found);\n if (name === found) {\n break;\n }\n } catch (e) {}\n }\n return name ? jar[name] : jar;\n }\n return Object.create({\n set,\n get,\n remove: function (name, attributes) {\n set(name, '', assign({}, attributes, {\n expires: -1\n }));\n },\n withAttributes: function (attributes) {\n return init(this.converter, assign({}, this.attributes, attributes));\n },\n withConverter: function (converter) {\n return init(assign({}, this.converter, converter), this.attributes);\n }\n }, {\n attributes: {\n value: Object.freeze(defaultAttributes)\n },\n converter: {\n value: Object.freeze(converter)\n }\n });\n }\n var api = init(defaultConverter, {\n path: '/'\n });\n /* eslint-enable no-var */\n\n return api;\n});","export const initOnEvents = ['click', 'touchstart', 'keypress', 'keydown'];\n\nexport const getAudioContext = () => {\n let audioCtx;\n try {\n audioCtx = new (window.AudioContext || window.webkitAudioContext)();\n } catch {\n // AudioContext is not available.\n }\n return audioCtx;\n};\n\n// eslint-disable-next-line default-param-last\nexport const getAlertAudio = async (baseUrl = '', requestContext) => {\n const audioCtx = getAudioContext();\n const playSound = audioBuffer => {\n window.playAudioAlert = () => {\n if (audioCtx) {\n const source = audioCtx.createBufferSource();\n source.buffer = audioBuffer;\n source.connect(audioCtx.destination);\n source.loop = false;\n source.start();\n }\n };\n };\n\n if (audioCtx) {\n const { type = 'dashboard', alertTone = 'ding' } = requestContext || {};\n const resourceUrl = `${baseUrl}/audio/${type}/${alertTone}.mp3`;\n const audioRequest = new Request(resourceUrl);\n\n fetch(audioRequest)\n .then(response => response.arrayBuffer())\n .then(buffer => {\n audioCtx.decodeAudioData(buffer).then(playSound);\n // eslint-disable-next-line no-promise-executor-return\n return new Promise(res => res());\n })\n .catch(() => {\n // error\n });\n }\n};\n","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}"],"sourceRoot":""}