{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/scripts/vendor/cookies.js","webpack:///./src/scripts/cookiebar/index.js","webpack:///./src/scripts/main.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","getItem","sKey","decodeURIComponent","document","cookie","replace","RegExp","encodeURIComponent","setItem","sValue","vEnd","sPath","sDomain","bSecure","test","sExpires","constructor","Number","Infinity","String","Date","toUTCString","removeItem","this","hasItem","keys","aKeys","split","nLen","length","nIdx","edit","$outer","querySelector","$el","$root","$refs","more","querySelectorAll","actions","details","moreTrigger","validate","i18n","hidetext","getAttribute","showtext","isOpen","mores","forEach","onDetailsClick","onMoreClick","onMoreTriggerClick","onValidateClick","addEventListener","show","e","target","preventDefault","currentTarget","hide","innerHTML","window","TweenMax","set","height","from","ease","Power4","easeOut","onComplete","classList","add","clearProps","to","remove","style","opacity","display","prefs","prefsAll","save","fetch","then","data","inject","dispatch","checkboxes","Array","checked","push","setTime","getTime","JSON","stringify","body","FormData","headers","Headers","action","url","append","method","credentials","response","json","re","tag","createElement","insertBefore","children","consentEvent","CustomEvent","detail","dispatchEvent","event","params","bubbles","cancelable","undefined","evt","createEvent","initCustomEvent","Event","Promise","all","domReady","init","resolve","load","__cookieBar__","err","console","error","start"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,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BAAiB,YAChCJ,EAAQI,OAAO,eAAgB,QAC/BN,EAAK/B,IAAI,SAAUmC,GACnBJ,EAAK/B,IAAI,oBAAqB6B,KAAKC,UAAUf,IAEtCG,MAAMkB,EAAK,CAChBE,OAAQ,OACRP,OACAE,UACAM,YAAa,gBACZpB,KAAKqB,GAAYA,EAASC,SAG/B,OAAOrB,GACL,MAAMsB,EAAK,iGAEXtB,EAAKnC,QAAQ3E,IACX,MAAMqI,EAAMxG,SAASyG,cAAc,UAEnCD,EAAI9C,UAAYvF,EAAE+B,QAAQqG,EAAI,MAC9BvG,SAAS4F,KAAKc,aAAaF,EAAKxG,SAAS4F,KAAKe,SAAS,OAI3D,SAAS9B,GAEP,MAAM+B,EAAe,IAAIC,YAAY,gBAAiB,CAAEC,OAAQjC,IAEhE7E,SAAS+G,cAAcH,MCjR3B,WACE,GAAkC,mBAAvBjD,OAAOkD,YAA4B,OAAO,EAErD,SAASA,EAAYG,EAAOC,GAC1BA,EAASA,GAAU,CAAEC,SAAS,EAAOC,YAAY,EAAOL,YAAQM,GAChE,IAAIC,EAAMrH,SAASsH,YAAY,eAE/B,OADAD,EAAIE,gBAAgBP,EAAOC,EAAOC,QAASD,EAAOE,WAAYF,EAAOH,QAC9DO,EAGTR,EAAYpH,UAAYkE,OAAO6D,MAAM/H,UAErCkE,OAAOkD,YAAcA,EAZvB,GAkBA,MAAM,EACJ,eACE,OAAO,IAAI,EAGb,cACEY,QACGC,IAAI,CACH,EAAOC,aAER3C,KAAK5D,KAAKwG,KAAKvI,KAAK+B,OAGzB,kBACE,OAAO,IAAIqG,QAAQI,IACjB7H,SAASmD,iBAAiB,mBAAoB0E,KAIlD,OACE,IACE,EAAUC,OACVnE,OAAOoE,cAAgB,EACvB,MAAOC,GACPC,QAAQC,MAAMF,KAKpB,EAAOG","file":"epic-cookies-manager-public.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 = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","/*\\\n|*|\n|*| :: cookies.js ::\n|*|\n|*| A complete cookies reader/writer framework with full unicode support.\n|*|\n|*| Revision #1 - September 4, 2014\n|*|\n|*| https://developer.mozilla.org/en-US/docs/Web/API/document.cookie\n|*| https://developer.mozilla.org/User:fusionchess\n|*|\n|*| This framework is released under the GNU Public License, version 3 or later.\n|*| http://www.gnu.org/licenses/gpl-3.0-standalone.html\n|*|\n|*| Syntaxes:\n|*|\n|*| * docCookies.setItem(name, value[, end[, path[, domain[, secure]]]])\n|*| * docCookies.getItem(name)\n|*| * docCookies.removeItem(name[, path[, domain]])\n|*| * docCookies.hasItem(name)\n|*| * docCookies.keys()\n|*|\n\\*/\n\nmodule.exports = {\n getItem: function(sKey) {\n if (!sKey) {\n return null;\n }\n return decodeURIComponent(document.cookie.replace(new RegExp('(?:(?:^|.*;)\\\\s*' + encodeURIComponent('epic-cookie-prefs').replace(/[\\-\\.\\+\\*]/g, '\\\\$&') + '\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$'), '$1')) || null;\n },\n\n setItem: function(sKey, sValue, vEnd, sPath, sDomain, bSecure) {\n if (!sKey || /^(?:expires|max\\-age|path|domain|secure)$/i.test(sKey)) {\n return false;\n }\n\n var sExpires = '';\n if (vEnd) {\n switch (vEnd.constructor) {\n case Number: {\n sExpires = vEnd === Infinity ? '; expires=Fri, 31 Dec 9999 23:59:59 GMT' : '; max-age=' + vEnd;\n break;\n }\n case String: {\n sExpires = '; expires=' + vEnd;\n break;\n }\n case Date: {\n sExpires = '; expires=' + vEnd.toUTCString();\n break;\n }\n }\n }\n\n document.cookie = encodeURIComponent(sKey) + '=' + encodeURIComponent(sValue) + sExpires + (sDomain ? '; domain=' + sDomain : '') + (sPath ? '; path=' + sPath : '') + (bSecure ? '; secure' : '');\n return true;\n },\n\n removeItem: function(sKey, sPath, sDomain) {\n if (!this.hasItem(sKey)) {\n return false;\n }\n document.cookie = encodeURIComponent(sKey) + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT' + (sDomain ? '; domain=' + sDomain : '') + (sPath ? '; path=' + sPath : '');\n return true;\n },\n\n hasItem: function(sKey) {\n if (!sKey) {\n return false;\n }\n return (new RegExp('(?:^|;\\\\s*)' + encodeURIComponent(sKey).replace(/[\\-\\.\\+\\*]/g, '\\\\$&') + '\\\\s*\\\\=')).test(document.cookie);\n },\n keys: function() {\n var aKeys = document.cookie\n .replace(/((?:^|\\s*;)[^\\=]+)(?=;|$)|^\\s*|\\s*(?:\\=[^;]*)?(?:\\1|$)/g, '')\n .split(/\\s*(?:\\=[^;]*)?;\\s*/);\n for (var nLen = aKeys.length, nIdx = 0; nIdx < nLen; nIdx++) {\n aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]);\n }\n return aKeys;\n },\n};\n","import docCookies from '../vendor/cookies';\n\nexport default {\n load(edit) {\n const savedCookies = docCookies.getItem('epic-cookie-prefs');\n\n if (savedCookies && edit !== true) {\n return;\n }\n\n this.$outer = document.querySelector('[data-component=\"cookiebar-outer\"]');\n this.$el = document.querySelector('[data-component=\"cookiebar\"]');\n this.$root = this.$outer || this.$el;\n this.$refs = {\n more: document.querySelectorAll('[data-ref=\"cookiebar.more\"]'),\n actions: document.querySelector('[data-ref=\"cookiebar.actions\"]'),\n details: document.querySelector('[data-ref=\"cookiebar.details\"]'),\n moreTrigger: document.querySelectorAll(\n '[data-ref=\"cookiebar.moreTrigger\"]'\n ),\n validate: document.querySelector('[data-ref=\"cookiebar.validate\"]'),\n };\n\n this.i18n = {\n hidetext: this.$el.getAttribute('data-cookiebar-hidetext'),\n showtext: this.$el.getAttribute('data-cookiebar-showtext'),\n };\n\n this.isOpen = {\n details: false,\n };\n\n this.mores = {};\n\n [...this.$refs.more].forEach(m => {\n const name = m.getAttribute('data-name');\n\n this.isOpen[name] = false;\n this.mores[name] = m;\n });\n\n this.onDetailsClick = this.onDetailsClick.bind(this);\n this.onMoreClick = this.onMoreClick.bind(this);\n this.onMoreTriggerClick = this.onMoreTriggerClick.bind(this);\n this.onValidateClick = this.onValidateClick.bind(this);\n\n [...this.$refs.moreTrigger].forEach(m => {\n m.addEventListener('click', this.onMoreTriggerClick);\n });\n\n this.$refs.details.addEventListener('click', this.onDetailsClick);\n this.$el.addEventListener('submit', this.onValidateClick);\n\n this.show();\n },\n\n onClick(e, target) {\n e.preventDefault();\n\n const name = target.getAttribute('data-name');\n\n switch (target.getAttribute('data-ref')) {\n case 'cookiebar.details':\n this[this.isOpen.details ? 'closeDetails' : 'openDetails']();\n break;\n\n case 'cookiebar.moreTrigger':\n this[this.isOpen[name] ? 'closeMore' : 'openMore'](name);\n break;\n\n case 'cookiebar.validate':\n break;\n\n default:\n }\n },\n\n onDetailsClick(e, target) {\n e.preventDefault();\n this[this.isOpen.details ? 'closeDetails' : 'openDetails']();\n },\n\n onMoreClick(e, target) {\n this[this.isOpen.details ? 'closeDetails' : 'openDetails']();\n },\n\n onMoreTriggerClick(e) {\n const name = e.currentTarget.getAttribute('data-name');\n\n this[this.isOpen[name] ? 'closeMore' : 'openMore'](name);\n },\n\n onValidateClick(e, target) {\n e.preventDefault();\n\n this.hide();\n },\n\n openDetails() {\n this.$refs.details.innerHTML = this.i18n.hidetext;\n this.isOpen.details = true;\n\n if (window.TweenMax) {\n TweenMax.set(this.$refs.actions, {\n height: 'auto',\n });\n\n TweenMax.from(this.$refs.actions, 0.3, {\n height: 0,\n ease: Power4.easeOut,\n onComplete: () => {\n this.$refs.actions.classList.add('is-open');\n TweenMax.set(this.$refs.actions, {\n clearProps: 'all',\n });\n },\n });\n }\n\n this.$refs.actions.classList.add('is-open');\n },\n\n closeDetails() {\n this.$refs.details.innerHTML = this.i18n.showtext;\n this.isOpen.details = false;\n\n if (window.TweenMax) {\n TweenMax.to(this.$refs.actions, 0.3, {\n height: 0,\n ease: Power4.easeOut,\n onComplete: () => {\n TweenMax.set(this.$refs.actions, {\n clearProps: 'all',\n });\n },\n });\n }\n\n this.$refs.actions.classList.remove('is-open');\n },\n\n openMore(name) {\n const more = this.mores[name];\n\n this.isOpen[name] = true;\n\n if (window.TweenMax) {\n TweenMax.set(more, {\n height: 'auto',\n });\n\n TweenMax.from(more, 0.3, {\n height: 0,\n ease: Power4.easeOut,\n onComplete: () => {\n more.classList.add('is-open');\n TweenMax.set(more, {\n clearProps: 'all',\n });\n },\n });\n }\n\n more.classList.add('is-open');\n },\n\n closeMore(name) {\n const more = this.mores[name];\n\n this.isOpen[name] = false;\n\n if (window.TweenMax) {\n TweenMax.to(more, 0.3, {\n height: 0,\n ease: Power4.easeOut,\n onComplete: () => {\n more.classList.remove('is-open');\n TweenMax.set(more, {\n clearProps: 'all',\n });\n },\n });\n }\n\n more.classList.remove('is-open');\n },\n\n show() {\n if (window.TweenMax) {\n this.$root.style.opacity = 0;\n this.$root.style.display = 'block';\n\n TweenMax.to(this.$root, 0.3, {\n opacity: 1,\n });\n } else {\n this.$root.style.display = 'block';\n }\n },\n\n hide() {\n if (window.TweenMax) {\n TweenMax.to(this.$root, 0.3, {\n opacity: 0,\n onComplete: () => {\n this.$root.style.display = 'none';\n },\n });\n } else {\n this.$root.style.display = 'none';\n }\n\n const { prefs, prefsAll } = this.save();\n\n this.fetch(prefs).then(data => {\n this.inject(data);\n this.dispatch([prefsAll]);\n });\n },\n\n save() {\n // Get cookie prefs\n const checkboxes = this.$el.querySelectorAll(\n 'input[type=\"checkbox\"][name=\"cookie_category[]\"]'\n );\n const prefs = [];\n const prefsAll = {};\n\n Array.prototype.forEach.call(checkboxes, ({ value, checked }) => {\n checked && prefs.push(value);\n prefsAll[value] = checked;\n });\n\n // Write cookie-prefs\n const d = new Date();\n d.setTime(d.getTime() + 365 * 24 * 3600 * 1000);\n docCookies.setItem('epic-cookie-prefs', JSON.stringify(prefs), d, '/');\n\n return {\n prefs,\n prefsAll,\n };\n },\n\n fetch(prefs) {\n const body = new FormData();\n const headers = new Headers();\n const action = this.$el.querySelector('[name=\"action\"]').value;\n const url = this.$el.getAttribute('action');\n\n headers.append('cache-control', 'no-cache');\n headers.append('X-Doing-Ajax', 'true');\n body.set('action', action);\n body.set('epic-cookie-prefs', JSON.stringify(prefs));\n\n return fetch(url, {\n method: 'POST',\n body,\n headers,\n credentials: 'same-origin',\n }).then(response => response.json());\n },\n\n inject(data) {\n const re = /(?:)*(?:<(?:noscript|script)>)*([\\s\\S]+?)(?:<\\/(?:noscript|script)>)*(?:)*/gm;\n\n data.forEach(d => {\n const tag = document.createElement('script');\n\n tag.innerHTML = d.replace(re, '$1');\n document.body.insertBefore(tag, document.body.children[0]);\n });\n },\n\n dispatch(prefsAll) {\n // Dispatch custom event\n const consentEvent = new CustomEvent('cookieConsent', { detail: prefsAll });\n\n document.dispatchEvent(consentEvent);\n },\n};\n","import './../styles/main.scss';\nimport Cookiebar from './cookiebar';\n\n// CustomEvent polyfill\n// source: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent\n(function() {\n if (typeof window.CustomEvent === \"function\") return false\n\n function CustomEvent(event, params) {\n params = params || { bubbles: false, cancelable: false, detail: undefined }\n var evt = document.createEvent(\"CustomEvent\")\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail)\n return evt\n }\n\n CustomEvent.prototype = window.Event.prototype\n\n window.CustomEvent = CustomEvent\n})()\n\n/*\n * Cookie Class\n */\nclass Cookie {\n static start() {\n return new Cookie();\n }\n\n constructor() {\n Promise\n .all([\n Cookie.domReady(),\n ])\n .then(this.init.bind(this));\n }\n\n static domReady() {\n return new Promise(resolve => {\n document.addEventListener('DOMContentLoaded', resolve);\n });\n }\n\n init() {\n try {\n Cookiebar.load();\n window.__cookieBar__ = Cookiebar;\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nCookie.start();\n"],"sourceRoot":""}