{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/widget/helpers/urlParamsHelper.js","webpack:///./node_modules/date-fns/esm/toDate/index.js","webpack:///./node_modules/date-fns/esm/addMilliseconds/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:///./node_modules/date-fns/esm/_lib/toInteger/index.js","webpack:///./app/javascript/widget/constants/sdkEvents.js","webpack:///./node_modules/charenc/charenc.js","webpack:///./node_modules/md5/md5.js","webpack:///./app/javascript/shared/helpers/colorHelper.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/js-cookie/dist/js.cookie.js","webpack:///./node_modules/color2k/dist/index.module.es.js","webpack:///./node_modules/date-fns/esm/_lib/requiredArgs/index.js","webpack:///./app/javascript/shared/helpers/AudioNotificationHelper.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","toDate","argument","argStr","Date","getTime","console","warn","Error","stack","NaN","addMilliseconds","dirtyDate","dirtyAmount","timestamp","amount","SET_USER_ERROR","popoutChatWindow","windowUrl","open","focus","err","log","MILLISECONDS_IN_HOUR","addHours","SDK_SET_BUBBLE_VISIBILITY","toInteger","dirtyNumber","number","Number","isNaN","Math","ceil","floor","RUUT_ERROR","RUUT_ON_MESSAGE","RUUT_ON_START_CONVERSATION","RUUT_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","isWidgetColorLighter","color","colorToCheck","replace","parseInt","substr","adjustColorForContrast","backgroundColor","adjustedColor","iteration","getContrast","adjustmentDirection","getLuminance","mix","toHex","base64map","rotl","rotr","randomBytes","random","words","hex","hexToBytes","bytesToBase64","base64","triplet","j","charAt","base64ToBytes","imod4","indexOf","pow","obj","readFloatLE","isSlowBuffer","_isBuffer","restoreElement","id","newBody","element","document","getElementById","newElement","querySelector","appendChild","restoreWidgetInDOM","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","getElementsByTagName","widgetHolder","createElement","bubbleHolder","chatBubble","closeBubble","onBubbleClick","props","toggleValue","isOpen","$ruut","newIsOpen","onBubbleToggle","removeUnreadClass","holderEl","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","updateRuutAuthCookie","getUrl","baseUrl","createFrame","getAppFrame","loadCSS","css","innerHTML","iframe","cwCookie","widgetUrl","src","allow","visibility","holderClassName","position","hideMessageBubble","widgetStyle","initPostMessageCommunication","initWindowSizeListener","preventDefaultScroll","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","showUnreadMessagesDialog","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","chatIcon","path","target","bubbleClassName","bubbleIcon","createElementNS","setAttributeNS","bubblePath","textNode","title","createBubbleIcon","background","isMobile","matchMedia","matches","ruutSDK","run","_ruutSettings$showUnr","Turbo","Turbolinks","newDocument","ruutSettings","useBrowserLanguage","navigator","language","toggleBubbleVisibility","widgetElm","setUser","hasUserKeys","userCookieName","existingCookieValue","hashToBeStored","setCustomAttributes","customAttributes","keys","deleteCustomAttribute","customAttribute","setConversationCustomAttributes","deleteConversationCustomAttribute","setLabel","removeLabel","setLocale","localeToBeUsed","setColorScheme","reset","assign","source","init","converter","defaultAttributes","attributes","now","toUTCString","stringifiedAttributes","attributeName","cookie","write","cookies","jar","parts","found","read","withAttributes","this","withConverter","freeze","factory","guard","low","high","min","max","ColorError","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","parseToHsla","alpha","index","delta","hsla","toFixed","f","channel","g","color1","color2","luminance1","luminance2","rgba","weight","normalize","r1","g1","b1","a1","r2","g2","b2","a2","alphaDelta","normalizedWeight","weight2","weight1","lighten","darken","requiredArgs","required","args","TypeError","async","requestContext","audioCtx","getAudioContext","AudioContext","webkitAudioContext","playSound","audioBuffer","createBufferSource","buffer","connect","destination","loop","start","audioRequest","Request","fetch","response","arrayBuffer","decodeAudioData","Promise","res","catch"],"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,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gB2N,iBAAyC,IAAlCrQ,EAAO9N,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GAAIoe,EAAcpe,UAAAC,OAAA,EAAAD,UAAA,QAAAE,EAC9D,MAAMme,EAZuBC,MAC7B,IAAID,EACJ,IACEA,EAAW,IAAK7e,OAAO+e,cAAgB/e,OAAOgf,mBAChD,CAAE,MACA,CAEF,OAAOH,CAAQ,EAKEC,GACXG,EAAYC,IAChBlf,OAAOgS,eAAiB,KACtB,GAAI6M,EAAU,CACZ,MAAM7G,EAAS6G,EAASM,qBACxBnH,EAAOoH,OAASF,EAChBlH,EAAOqH,QAAQR,EAASS,aACxBtH,EAAOuH,MAAO,EACdvH,EAAOwH,OACT,EACD,EAGH,GAAIX,EAAU,CACZ,MAAM,KAAEhU,EAAO,YAAW,UAAEoG,EAAY,QAAW2N,GAAkB,CAAC,EAEhEa,EAAe,IAAIC,QADL,GAAGpR,WAAiBzD,KAAQoG,SAGhD0O,MAAMF,GACHvO,MAAK0O,GAAYA,EAASC,gBAC1B3O,MAAKkO,IACJP,EAASiB,gBAAgBV,GAAQlO,KAAK+N,GAE/B,IAAIc,SAAQC,GAAOA,SAE3BC,OAAM,QAGX,CACF,C","file":"js/sdk.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// 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 = 2372);\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 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}","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}","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 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}","export const RUUT_ERROR = 'ruut:error';\nexport const RUUT_ON_MESSAGE = 'ruut:on-message';\nexport const RUUT_ON_START_CONVERSATION = 'ruut:on-start-conversation';\nexport const RUUT_READY = 'ruut: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})();","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","(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 color-scheme: normal;\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: #a450e9;\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: #a450e9;\n box-shadow: 0 8px 32px rgba(0, 0, 0, .4) !important;\n}\n\n.woot-widget-bubble svg {\n all: revert;\n height: 30px;\n // margin: 20px;\n width: 30px;\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 css.id = 'cw-widget-styles';\n document.body.appendChild(css);\n};\n\n// This is a method specific to Turbo\n// The body replacing strategy removes Chatwoot styles\n// as well as the widget, this help us get it back\nexport const restoreElement = (id, newBody) => {\n const element = document.getElementById(id);\n const newElement = newBody.querySelector(`#${id}`);\n\n if (element && !newElement) {\n newBody.appendChild(element);\n }\n};\n\nexport const restoreWidgetInDOM = newBody => {\n restoreElement('cw-bubble-holder', newBody);\n restoreElement('cw-widget-holder', newBody);\n restoreElement('cw-widget-styles', newBody);\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 'M68.9925 113.991C98.9103 113.442 123 88.1366 123 57C123 25.5198 98.3757 0 68 0C37.6243 0 13 25.5198 13 57C13 68.878 16.5057 79.9074 22.5032 89.0375L0 112L64.0785 113.857C65.3738 113.952 66.6815 114 68 114C68.2663 114 68.5321 113.998 68.7975 113.994L69 114L68.9925 113.991Z';\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.$ruut.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.$ruut.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 123 114');\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.$ruut.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 bubbleHolder.id = 'cw-bubble-holder';\n body.appendChild(bubbleHolder);\n};\n\nexport const onBubbleClick = (props = {}) => {\n const { toggleValue } = props;\n const { isOpen } = window.$ruut;\n if (isOpen !== toggleValue) {\n const newIsOpen = toggleValue === undefined ? !isOpen : toggleValue;\n window.$ruut.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.$ruut;\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 };\n\n if (baseDomain) {\n cookieOptions.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 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 { RUUT_ERROR, RUUT_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 updateRuutAuthCookie = (cookieContent, baseDomain = '') =>\n setCookieWithDomain('ruut_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.$ruut.position}`;\n if (window.$ruut.hideMessageBubble) {\n holderClassName += ` woot-widget--without-bubble`;\n }\n if (isFlatWidgetStyle(window.$ruut.widgetStyle)) {\n holderClassName += ` woot-widget-holder--flat`;\n }\n\n addClasses(widgetHolder, holderClassName);\n widgetHolder.id = 'cw-widget-holder';\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.$ruut;\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.$ruut.baseDomain);\n updateRuutAuthCookie(message.config.authToken, window.$ruut.baseDomain);\n window.$ruut.hasLoaded = true;\n const campaignsSnoozedTill = Cookies.get('cw_snooze_campaigns_till');\n IFrameHelper.sendMessage('config-set', {\n locale: window.$ruut.locale,\n position: window.$ruut.position,\n hideMessageBubble: window.$ruut.hideMessageBubble,\n showPopoutButton: window.$ruut.showPopoutButton,\n widgetStyle: window.$ruut.widgetStyle,\n darkMode: window.$ruut.darkMode,\n showUnreadMessagesDialog: window.$ruut.showUnreadMessagesDialog,\n campaignsSnoozedTill,\n });\n IFrameHelper.onLoad({\n widgetColor: message.config.channelConfig.widgetColor,\n });\n IFrameHelper.toggleCloseButton();\n\n if (window.$ruut.user) {\n IFrameHelper.sendMessage('set-user', window.$ruut.user);\n }\n\n window.playAudioAlert = () => {};\n\n initOnEvents.forEach(e => {\n document.addEventListener(e, IFrameHelper.setupAudioListeners, false);\n });\n\n if (!window.$ruut.resetTriggered) {\n dispatchWindowEvent({ eventName: RUUT_READY });\n }\n },\n error: ({ errorType, data }) => {\n dispatchWindowEvent({ eventName: RUUT_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.$ruut.launcherTitle || message.label);\n },\n\n setAuthCookie({ data: { widgetAuthToken } }) {\n updateAuthCookie(widgetAuthToken, window.$ruut.baseDomain);\n updateRuutAuthCookie(widgetAuthToken, window.$ruut.baseDomain);\n },\n\n setCampaignReadOn() {\n updateCampaignReadStatus(window.$ruut.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.$ruut.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.$ruut.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.$ruut.hideMessageBubble);\n onLocationChangeListener();\n\n let className = 'woot-widget-bubble';\n let closeBtnClassName = `woot-elements--${window.$ruut.position} woot-widget-bubble woot--close woot--hide`;\n\n if (isFlatWidgetStyle(window.$ruut.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 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 {\n addClasses,\n removeClasses,\n restoreWidgetInDOM,\n} from '../sdk/DOMHelpers';\nimport { setCookieWithDomain } from '../sdk/cookieHelpers';\nimport { SDK_SET_BUBBLE_VISIBILITY } from 'shared/constants/sharedFrameEvents';\n\nconst runSDK = ({ baseUrl, websiteToken }) => {\n if (window.$ruut) {\n return;\n }\n\n if (window.Turbo) {\n // if this is a Rails Turbo app\n document.addEventListener('turbo:before-render', event =>\n restoreWidgetInDOM(event.detail.newBody)\n );\n }\n\n if (window.Turbolinks) {\n document.addEventListener('turbolinks:before-render', event => {\n restoreWidgetInDOM(event.data.newBody);\n });\n }\n\n // if this is an astro app\n document.addEventListener('astro:before-swap', event =>\n restoreWidgetInDOM(event.newDocument.body)\n );\n\n const ruutSettings = window.ruutSettings || {};\n let locale = ruutSettings.locale;\n let baseDomain = ruutSettings.baseDomain;\n\n if (ruutSettings.useBrowserLanguage) {\n locale = window.navigator.language.replace('-', '_');\n }\n\n window.$ruut = {\n baseUrl,\n baseDomain,\n hasLoaded: false,\n hideMessageBubble: ruutSettings.hideMessageBubble || false,\n isOpen: false,\n position: ruutSettings.position === 'left' ? 'left' : 'right',\n websiteToken,\n locale,\n useBrowserLanguage: ruutSettings.useBrowserLanguage || false,\n type: getBubbleView(ruutSettings.type),\n launcherTitle: ruutSettings.launcherTitle || '',\n showPopoutButton: ruutSettings.showPopoutButton || false,\n showUnreadMessagesDialog: ruutSettings.showUnreadMessagesDialog ?? true,\n widgetStyle: getWidgetStyle(ruutSettings.widgetStyle) || 'standard',\n resetTriggered: false,\n darkMode: getDarkMode(ruutSettings.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.$ruut.hideMessageBubble = true;\n } else if (visibility === 'show') {\n removeClasses(widgetElm, 'woot-hidden');\n removeClasses(widgetHolder, 'woot-widget--without-bubble');\n window.$ruut.hideMessageBubble = false;\n }\n IFrameHelper.sendMessage(SDK_SET_BUBBLE_VISIBILITY, {\n hideMessageBubble: window.$ruut.hideMessageBubble,\n });\n },\n\n popoutChatWindow() {\n IFrameHelper.events.popoutChatWindow({\n baseUrl: window.$ruut.baseUrl,\n websiteToken: window.$ruut.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.$ruut.identifier = identifier;\n window.$ruut.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.$ruut.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.$ruut.baseUrl,\n websiteToken: window.$ruut.websiteToken,\n });\n\n window.$ruut.resetTriggered = true;\n },\n };\n\n IFrameHelper.createFrame({\n baseUrl,\n websiteToken,\n });\n};\n\nwindow.ruutSDK = {\n run: runSDK,\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});","/**\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 };","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}","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"],"sourceRoot":""}