{"version":3,"sources":["node_modules/js-cookie/dist/js.cookie.js","src/js/modules/cookiebot-helper.js"],"names":["module","exports","assign","target","i","arguments","length","source","key","init","converter","defaultAttributes","set","value","attributes","document","expires","Date","now","toUTCString","encodeURIComponent","replace","decodeURIComponent","escape","stringifiedAttributes","attributeName","split","cookie","write","Object","create","get","cookies","jar","parts","slice","join","foundKey","read","e","remove","withAttributes","this","withConverter","freeze","path","factory","CookiebotHelper","selectors","dialog","window","addEventListener","Cookiebot","consent","statistics","_removeStatisticCookies","selector","querySelectorAll","forEach","link","renew","_moveFocusToDialog","delay","setTimeout","cookieDialog","querySelector","focus","Cookies"],"mappings":"+EAGiEA,EAAOC,QAO/D,WAAc,aAGrB,SAASC,EAAQC,GACf,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CACzC,IAAIG,EAASF,UAAUD,GACvB,IAAK,IAAII,KAAOD,EACdJ,EAAOK,GAAOD,EAAOC,GAGzB,OAAOL,EA4HT,OArGA,SAASM,EAAMC,EAAWC,GACxB,SAASC,EAAKJ,EAAKK,EAAOC,GACxB,GAAwB,qBAAbC,SAAX,CAMkC,kBAFlCD,EAAaZ,EAAO,GAAIS,EAAmBG,IAErBE,UACpBF,EAAWE,QAAU,IAAIC,KAAKA,KAAKC,MAA6B,MAArBJ,EAAWE,UAEpDF,EAAWE,UACbF,EAAWE,QAAUF,EAAWE,QAAQG,eAG1CX,EAAMY,mBAAmBZ,GACtBa,QAAQ,uBAAwBC,oBAChCD,QAAQ,QAASE,QAEpB,IAAIC,EAAwB,GAC5B,IAAK,IAAIC,KAAiBX,EACnBA,EAAWW,KAIhBD,GAAyB,KAAOC,GAEE,IAA9BX,EAAWW,KAWfD,GAAyB,IAAMV,EAAWW,GAAeC,MAAM,KAAK,KAGtE,OAAQX,SAASY,OACfnB,EAAM,IAAME,EAAUkB,MAAMf,EAAOL,GAAOgB,GA6B9C,OAAOK,OAAOC,OACZ,CACElB,IAAKA,EACLmB,IA7BJ,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KC,6BAEN,KAIL,qCAIA,SAAwBC,GAAW,IAAD,OACjBzC,SAAS0C,iBAAiBD,GACnCE,SAAQ,SAACC,GACbA,EAAKR,iBAAiB,SAAS,WAC1BD,OAAOE,YACRF,OAAOE,UAAUQ,QACjB,EAAKC,mBAAmB,cAMhC,gCAKA,SAAmBC,GAAQ,IAAD,OACxBC,YAAW,WACT,IAAMC,EAAejD,SAASkD,cAAc,EAAKjB,UAAUC,QACxDe,GACDA,EAAaE,UAEdJ,KACJ,qCAED,WACEK,IAAQ3B,OAAO,qBAChB,EArDiC","file":"hashed/11.66ff82fc.chunk.js","sourcesContent":["/*! js-cookie v3.0.1 | MIT */\n;\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, (function () {\n var current = global.Cookies;\n var exports = global.Cookies = factory();\n exports.noConflict = function () { global.Cookies = current; return exports; };\n }()));\n}(this, (function () { '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(\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n decodeURIComponent\n )\n }\n };\n /* eslint-enable no-var */\n\n /* eslint-disable no-var */\n\n function init (converter, defaultAttributes) {\n function set (key, value, attributes) {\n if (typeof document === 'undefined') {\n return\n }\n\n attributes = assign({}, defaultAttributes, attributes);\n\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\n key = encodeURIComponent(key)\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n .replace(/[()]/g, escape);\n\n var stringifiedAttributes = '';\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\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\n return (document.cookie =\n key + '=' + converter.write(value, key) + stringifiedAttributes)\n }\n\n function get (key) {\n if (typeof document === 'undefined' || (arguments.length && !key)) {\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\n try {\n var foundKey = decodeURIComponent(parts[0]);\n jar[foundKey] = converter.read(value, foundKey);\n\n if (key === foundKey) {\n break\n }\n } catch (e) {}\n }\n\n return key ? jar[key] : jar\n }\n\n return Object.create(\n {\n set: set,\n get: get,\n remove: function (key, attributes) {\n set(\n key,\n '',\n assign({}, attributes, {\n expires: -1\n })\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 {\n attributes: { value: Object.freeze(defaultAttributes) },\n converter: { value: Object.freeze(converter) }\n }\n )\n }\n\n var api = init(defaultConverter, { path: '/' });\n /* eslint-enable no-var */\n\n return api;\n\n})));\n","/**\n * Cookiebot related helper functions\n */\nimport Cookies from 'js-cookie';\n\nexport default class CookiebotHelper {\n\n /**\n * Constructor\n */\n constructor() {\n this.selectors = {\n dialog: '#CybotCookiebotDialog'\n }\n }\n\n\n addConsentListeners() {\n window.addEventListener('CookiebotOnConsentReady', (e) => {\n if (!window.Cookiebot.consent.statistics) {\n this._removeStatisticCookies();\n }\n }, false);\n\n }\n\n /**\n * Enables cookiebot widget to be opened from custom links/buttons\n * @param {string} selector Selector for custom links/buttons\n */\n initCustomWidgetOpeners(selector) {\n const links = document.querySelectorAll(selector);\n links.forEach((link) => {\n link.addEventListener('click', () => {\n if(window.Cookiebot) {\n window.Cookiebot.renew();\n this._moveFocusToDialog(1000);\n }\n });\n })\n }\n\n /**\n * After delay, move focus to dialog\n * It will take a second for dialog to appear, and then we want to move the focus to it\n * @param {number} delay time in milliseconds\n */\n _moveFocusToDialog(delay) {\n setTimeout(() => {\n const cookieDialog = document.querySelector(this.selectors.dialog);\n if(cookieDialog) {\n cookieDialog.focus();\n }\n }, delay);\n }\n\n _removeStatisticCookies() {\n Cookies.remove('ecommerceItem');\n }\n\n}\n"],"sourceRoot":""}