{"version":3,"file":"cookie-consent.mjs","sources":["../lib/accessibility.js","../lib/cookie.js","../lib/consent.js","../lib/index.js"],"sourcesContent":["/**\n * The browser user prefers to have reduced motion.\n */\nexport function prefersReducedMotion() {\n  return window.matchMedia('(prefers-reduced-motion)').matches\n}\n\n/**\n * Environment is a browser.\n */\nexport function isBrowser() {\n  return typeof window !== 'undefined'\n}\n","import { isBrowser } from './accessibility'\n\n/**\n * Vanilla JavaScript cookie service plugin.\n *\n * Hardly inspired by `ngx-cookie-service`:\n * @see https://github.com/stevermeister/ngx-cookie-service/blob/master/lib/cookie-service/cookie.service.ts\n */\nexport default class Cookie {\n  static set(name, value, domain, path, maxAge = 7, secure, sameSite = 'Lax') {\n    let cookieString = encodeURIComponent(name) + '=' + JSON.stringify(value) + ';'\n\n    if (domain) {\n      cookieString += 'domain=' + domain + ';'\n    }\n\n    if (path) {\n      cookieString += 'path=' + path + ';'\n    }\n\n    if (typeof maxAge === 'number') {\n      cookieString += 'max-age=' + maxAge * 60 * 60 * 24 + ';'\n    }\n\n    if (secure) {\n      cookieString += 'secure;'\n    }\n\n    cookieString += 'sameSite=' + sameSite + ';'\n\n    if (isBrowser()) {\n      document.cookie = cookieString\n    }\n  }\n\n  static get(name) {\n    if (isBrowser() && document.cookie !== '') {\n      const splitters = document.cookie.split(';')\n\n      for (let i = 0; i < splitters.length; i++) {\n        let [key, value] = splitters[i].split('=')\n        key = decodeURIComponent(key).replace(/^ /, '')\n\n        if (key === name) {\n          return JSON.parse(value)\n        }\n      }\n    }\n\n    return null\n  }\n\n  static getAll() {\n    let cookies = {}\n\n    if (isBrowser() && document.cookie !== '') {\n      const splitters = document.cookie.split(';')\n\n      splitters.forEach((splitter) => {\n        let [key, value] = splitter.split('=')\n        key = decodeURIComponent(key).replace(/^ /, '')\n        value = decodeURIComponent(value)\n        cookies[key] = value\n      })\n    }\n\n    return cookies\n  }\n\n  static find(regex) {\n    let cookies = this.getAll()\n\n    if (typeof regex === 'string') {\n      regex = new RegExp(`^${regex}`, 'g')\n    }\n\n    for (const name in cookies) {\n      if (regex.test(name)) {\n        return cookies[name]\n      }\n    }\n\n    return null\n  }\n\n  static delete(name, domain, path) {\n    this.set(name, '', domain, path, 0)\n  }\n\n  static deleteAll(domain, path) {\n    const cookies = this.getAll()\n\n    for (const name in cookies) {\n      this.delete(name, domain, path)\n    }\n  }\n\n  static clear(regex, domain, path) {\n    const cookies = this.getAll()\n\n    if (typeof regex === 'string') {\n      regex = new RegExp(`^${regex}`, 'g')\n    }\n\n    for (const name in cookies) {\n      const matches = name.match(regex)\n      if (matches && matches.length > 0) {\n        this.delete(name, domain, path)\n      }\n    }\n  }\n}\n","import { prefersReducedMotion } from './accessibility'\nimport Cookie from './cookie'\n\nconst Event = {\n  // order is important here\n  ON_UPDATE: 'onUpdate',\n  ON_VALUE_CHANGED: 'onValueChange',\n  ON_ACCEPT: 'onAccept',\n  ON_REJECT: 'onReject',\n}\n\nconst GlobalEvent = {\n  ON_CONSENT: 'onConsent',\n  ON_ACCEPT_END: 'onAcceptEnd',\n  ON_REJECT_END: 'onRejectEnd',\n}\n\nexport default class CookieConsent {\n  constructor(options) {\n    const defaultOptions = {\n      name: 'cookie-consent',\n      banner: document.getElementById('cookiebanner'),\n      notice: document.getElementById('cookienotice'),\n      linkOnly: false,\n      onConsent: (consent) => {\n        const choices = consent.getChoices()\n        consent.saveUserOptions({ choices, consented: true })\n      },\n      capabilities: [\n        {\n          name: 'functional',\n          noOptOut: true,\n        },\n      ],\n    }\n\n    this.options = { ...defaultOptions, ...options }\n    this.queue = [] // this will hold event hooks to run in order\n\n    if (!this.options.banner || !this.options.notice) {\n      console.error('Can not find required elements!')\n      return // no banner or notice present\n    }\n\n    this.button = {}\n    this.button.reject = this.options.banner.querySelector('.reject')\n    this.button.accept = this.options.banner.querySelector('.accept')\n\n    if (!this.button.reject || !this.button.accept) {\n      console.error('Can not find required buttons!')\n      return undefined // no buttons present\n    }\n\n    this.initEvents()\n\n    const content = this.loadUserOptions()\n\n    console.log(JSON.stringify(content, null, 2))\n\n    if (content?.choices) {\n      this.setChoices(content.choices)\n      this.initStartUpEvents()\n    }\n\n    if (content?.consented) {\n      this.showNotice()\n    } else {\n      this.showBanner()\n    }\n  }\n\n  /**\n   * Initial all element events.\n   */\n  initEvents() {\n    // Reject\n    this.button.reject.addEventListener('click', () => {\n      this.disableChoices()\n      const choices = this.getChoices()\n      choices.forEach((choice) => {\n        const capability = this.getCapability(choice.name)\n        this._runValueEventsFor(capability, choice)\n        this._runEventFor(capability, Event.ON_REJECT)\n      })\n      this._startRunner()\n\n      if (this.options[GlobalEvent.ON_CONSENT] instanceof Function) {\n        this.options[GlobalEvent.ON_CONSENT](this)\n      }\n      if (this.options[GlobalEvent.ON_REJECT_END] instanceof Function) {\n        this.options[GlobalEvent.ON_REJECT_END](this)\n      }\n\n      this.hideBanner()\n      this.showNotice()\n    })\n\n    // Accept\n    this.button.accept.addEventListener('click', () => {\n      const choices = this.getChoices()\n      choices.forEach((choice) => {\n        const capability = this.getCapability(choice.name)\n        this._runValueEventsFor(capability, choice)\n        if (choice.value) {\n          this._runEventFor(capability, Event.ON_ACCEPT)\n        } else {\n          this._runEventFor(capability, Event.ON_REJECT)\n        }\n      })\n      this._startRunner()\n\n      if (this.options[GlobalEvent.ON_CONSENT] instanceof Function) {\n        this.options[GlobalEvent.ON_CONSENT](this)\n      }\n      if (this.options[GlobalEvent.ON_ACCEPT_END] instanceof Function) {\n        this.options[GlobalEvent.ON_ACCEPT_END](this)\n      }\n\n      this.hideBanner()\n      this.showNotice()\n    })\n\n    // Show banner\n    this.options.notice.addEventListener('click', () => {\n      this.hideNotice()\n      this.showBanner()\n    })\n  }\n\n  /**\n   * On first load fire these events.\n   */\n  initStartUpEvents() {\n    const choices = this.getChoices()\n    choices.forEach((choice) => {\n      const capability = this.getCapability(choice.name)\n      if (choice.value) {\n        this._runEventFor(capability, Event.ON_ACCEPT)\n      } else {\n        this._runEventFor(capability, Event.ON_REJECT)\n      }\n    })\n    this._startRunner()\n  }\n\n  /**\n   * Get our plugin options cookies content.\n   */\n  loadUserOptions() {\n    const content = Cookie.get(this.options.name)\n    if (!content) return {}\n    return content\n  }\n\n  /**\n   * Save something to our plugin options cookie.\n   *\n   * @param {object} saveThis\n   */\n  saveUserOptions(saveThis) {\n    const oldContent = this.loadUserOptions()\n    const newContent = { ...oldContent, ...saveThis }\n    Cookie.set(this.options.name, newContent, null, '/')\n  }\n\n  /**\n   * Delete all plugin options that are saved into a cookie.\n   */\n  removeUserOptions() {\n    if (Cookie.get(this.options.name)) {\n      Cookie.delete(this.options.name)\n    }\n  }\n\n  /**\n   * Get single form input choice by its input name.\n   *\n   * @param {string} byName\n   */\n  getChoice(byName) {\n    const node = this.options.banner.querySelector(`.choice [name=\"choice:${byName}\"]`)\n\n    return node.checked\n  }\n\n  /**\n   * Get form input choices.\n   */\n  getChoices() {\n    let choices = []\n\n    this.options.banner.querySelectorAll('.choice input').forEach((node) => {\n      const name = node.getAttribute('name').replace('choice:', '')\n      const value = node.checked\n      choices.push({ name, value })\n    })\n\n    return choices\n  }\n\n  /**\n   * Set form input choices. Most likely for reseting the form.\n   *\n   * @param {Choice[]} choices\n   */\n  setChoices(choices) {\n    this.options.banner.querySelectorAll('.choice input').forEach((node) => {\n      const name = node.getAttribute('name').replace('choice:', '')\n      const choice = choices.find((c) => c.name === name)\n      if (choice) {\n        node.checked = choice.value\n      } else {\n        console.log(node)\n        console.log(choice)\n        console.log('COOKIE and CHOICES are not compatible')\n      }\n    })\n  }\n\n  /**\n   * Disable all choices that user are able to opt out.\n   */\n  disableChoices() {\n    const choices = this.getChoices()\n\n    this.options.capabilities.forEach(({ name, noOptOut }) => {\n      const choice = choices.findIndex((c) => c.name === name)\n      if (choice !== -1 && !noOptOut) {\n        choices[choice].value = false\n      }\n    })\n\n    this.setChoices(choices)\n  }\n\n  /**\n   * Get capability by name.\n   *\n   * @param {string} name\n   */\n  getCapability(name) {\n    return this.options.capabilities.find((c) => c.name === name)\n  }\n\n  /**\n   * Smoothly show an element.\n   *\n   * @param {HTMLElement} element\n   */\n  showElement(element) {\n    if ('animate' in element && !prefersReducedMotion()) {\n      element\n        .animate([{ opacity: 0 }, { opacity: 1 }], {\n          duration: 320,\n          iterations: 1,\n        })\n        .addEventListener('finish', function onFinish() {\n          element.classList.add('visible')\n        })\n    } else {\n      element.classList.add('visible')\n    }\n  }\n\n  /**\n   * Smoothly hide an element.\n   *\n   * @param {HTMLElement} element\n   */\n  hideElement(element) {\n    if ('animate' in element && !prefersReducedMotion()) {\n      element\n        .animate([{ opacity: 1 }, { opacity: 0 }], {\n          duration: 160,\n          iterations: 1,\n        })\n        .addEventListener('finish', function onFinish() {\n          element.classList.remove('visible')\n        })\n    } else {\n      element.classList.remove('visible')\n    }\n  }\n\n  /**\n   * Hide/Show the banner.\n   */\n  hideBanner() {\n    this.hideElement(this.options.banner)\n  }\n  showBanner() {\n    this.showElement(this.options.banner)\n  }\n\n  /**\n   * Hide/Show the notice.\n   */\n  hideNotice() {\n    if (!this.options.linkOnly) {\n      this.hideElement(this.options.notice)\n    }\n  }\n  showNotice() {\n    if (!this.options.linkOnly) {\n      this.showElement(this.options.notice)\n    }\n  }\n\n  /**\n   * Add a callable event function to an queue.\n   *\n   * @param {string} name\n   * @param {function} func\n   */\n  _addToQueue(name, func) {\n    this.queue.push({ name, func })\n  }\n\n  /**\n   * Run the callable event queue.\n   */\n  _startRunner() {\n    // loop event by order\n    for (const event of Object.values(Event)) {\n      // find callables from queue with event name\n      const callables = this.queue.filter((q) => q.name === event)\n      // call them\n      callables.forEach(({ func }) => func())\n    }\n    this.queue = [] // clear queue for new operations\n  }\n\n  /**\n   * Run one event for one capability.\n   *\n   * @param {Capability} capability\n   * @param {Event} withEvent\n   * @param {object} params\n   */\n  _runEventFor(capability, withEvent, params = {}) {\n    if (capability[withEvent] && capability[withEvent] instanceof Function) {\n      this._addToQueue(withEvent, () => capability[withEvent](this, params))\n    }\n  }\n\n  /**\n   * Run common or value change/update events for one capability.\n   *\n   * @param {Capability} capability\n   * @param {Choice} withChoice\n   */\n  _runValueEventsFor(capability, withChoice) {\n    let params = {\n      choice: withChoice.value,\n    }\n\n    // on input value update\n    this._runEventFor(capability, Event.ON_UPDATE, params)\n\n    // on input value change\n    const userOptions = this.loadUserOptions()\n    // load saved cookie options choices if present\n    if (userOptions?.choices) {\n      // find current choice in saved choices\n      const choice = userOptions.choices.find((c) => c.name === withChoice.name)\n      // check against input choice value\n      const hasChanged = withChoice.value !== choice.value\n      if (hasChanged) {\n        this._runEventFor(capability, Event.ON_VALUE_CHANGED, params)\n      }\n    }\n  }\n}\n","import CookieConsent from './consent'\nimport Cookie from './cookie'\n\nimport './style.scss'\n\nCookieConsent.cookie = Cookie\n\nexport default CookieConsent\n"],"names":["prefersReducedMotion","window","matchMedia","matches","isBrowser","Cookie","set","name","value","domain","path","maxAge","secure","sameSite","cookieString","encodeURIComponent","JSON","stringify","document","cookie","get","splitters","split","i","length","key","decodeURIComponent","replace","parse","getAll","cookies","forEach","splitter","find","regex","this","RegExp","test","deleteAll","clear","match","Event","ON_UPDATE","ON_VALUE_CHANGED","ON_ACCEPT","ON_REJECT","CookieConsent","options","defaultOptions","banner","getElementById","notice","linkOnly","onConsent","consent","choices","getChoices","saveUserOptions","consented","capabilities","noOptOut","queue","button","reject","querySelector","accept","initEvents","content","loadUserOptions","console","log","setChoices","initStartUpEvents","showNotice","showBanner","error","addEventListener","_this","disableChoices","choice","capability","getCapability","_runValueEventsFor","_runEventFor","_startRunner","Function","hideBanner","hideNotice","_this2","saveThis","newContent","removeUserOptions","getChoice","byName","checked","querySelectorAll","node","getAttribute","push","c","findIndex","showElement","element","animate","opacity","duration","iterations","classList","add","hideElement","remove","_addToQueue","func","event","_this3","filter","q","Object","values","withEvent","params","_this4","withChoice","userOptions"],"mappings":"wNAGgBA,IACd,OAAOC,OAAOC,WAAW,4BAA4BC,iBAMvCC,IACd,MAAyB,oBAAXH,WCHKI,oCACZC,IAAP,SAAWC,EA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