{"version":3,"sources":["webpack:///./src/client/default/js/components/notificationComponent.js","webpack:///./src/client/default/js/base/baseComponent.js","webpack:///./node_modules/js-cookie/src/js.cookie.js","webpack:///./src/microtemplates/notification/notificationList.ejs"],"names":["NotificationComponent","element","notificationActiveId","this","CUSTOM_MESSAGES","NOTIFICATION","push","addNotification","close","closeNotification","pushall","addNotificationAll","pushFirstAvailable","addFirstAvailableNotification","notifications","forEach","notification","firstNotification","find","n","isNotificationClosed","setTimeout","notificationCanBeAdded","stateUpdate","id","title","notificationTitle","description","notificationDescription","icon","notificationIcon","quietPeriod","notificationQuietPeriod","maxViews","notificationMaxViews","image","notificationImage","rank","notificationPromoPush","notificationPost","notificationCtaLink","notificationCtaLabel","subtitle","notificationSubTitle","isfirst","setState","notificationToClose","notificationTimer","$el","lastElementChild","classList","add","skipCookie","document","querySelector","state","Cookies","set","expires","Date","getTime","incrementViews","closed","Object","keys","some","remove","EMIT","get","querySelectorAll","stateChanges","notificationList","map","sort","a","b","firstNotificationOpen","slice","reverse","e","firstNotificationIndex","findIndex","emitTracking","trackLinkClass","length","innerHTML","notificationListTemplate","trackingClick","notificationClosed","views","shown","action","label","TRACKING_EVENTS","update","eventCategory","eventAction","eventLabel","_this","link","$on","baseComponent","BaseComponent","_componentElement","setAttribute","_checkMessages","compOptions","options","dataset","filter","entry","includes","optionValue","cleanEntry","cleanOptionKey","JSON","parse","replace","convertType","deepFreeze","getAttribute","events","cb","elements","Bean","on","stopPropagation","one","off","fire","container","message","_loading","LOADER_EVENTS","show","body","error","hide","option","optionReturn","key","str","charAt","toLocaleLowerCase","BaseGiaComponent","factory","module","exports","OldCookies","window","api","noConflict","extend","i","result","arguments","attributes","decode","s","decodeURIComponent","init","converter","value","path","defaults","toUTCString","stringify","test","write","encodeURIComponent","String","escape","stringifiedAttributes","attributeName","split","cookie","json","jar","cookies","parts","join","name","read","getJSON","withConverter","anonymous","locals","escapeFn","include","rethrow","err","flnm","lineno","esc","lines","start","Math","max","end","min","filename","context","line","curr","markup","undefined","_MATCH_HTML","encode_char","_ENCODE_HTML_RULES","c","__line","__lines","__filename","__output","__append","index"],"mappings":";6sBAIqBA,E,gCAUnB,WAAYC,GAAS,0BACnB,cAAMA,IACDC,qBAAuB,GAFT,E,kCATrB,WAAe,MACb,kBACGC,KAAKC,gBAAgBC,aAAaC,KAAOH,KAAKI,iBADjD,MAEGJ,KAAKC,gBAAgBC,aAAaG,MAAQL,KAAKM,mBAFlD,MAGGN,KAAKC,gBAAgBC,aAAaK,QAAUP,KAAKQ,oBAHpD,MAIGR,KAAKC,gBAAgBC,aAAaO,mBAAqBT,KAAKU,+BAJ/D,I,gCAaF,SAAmBC,GAAe,WAChCA,EAAcC,SAAQ,SAACC,GACrB,EAAKT,gBAAgBS,Q,2CAIzB,YAAiD,WAC3CC,EAD2C,EAAjBH,cACQI,MAAK,SAACC,GAC1C,OAAQ,EAAKC,qBAAqBD,MAEhCF,GACFI,YAAW,WACT,EAAKd,gBAAgBU,KACpB,O,6BAIP,SAAgBD,GAAc,WAC5B,GAAIb,KAAKmB,uBAAuBN,GAAe,CAC7C,IAAIO,EAAc,GAClBA,EAAYP,EAAaQ,IAAM,CAC7BA,GAAIR,EAAaQ,GACjBC,MAAOT,EAAaU,kBACpBC,YAAaX,EAAaY,wBAC1BC,KAAMb,EAAac,iBACnBC,YAAaf,EAAagB,wBAC1BC,SAAUjB,EAAakB,qBACvBC,MAAOnB,EAAaoB,kBACpBC,KAAMrB,EAAaqB,KACnBC,sBAAuBtB,EAAasB,sBACpCC,iBAAkBvB,EAAauB,iBAC/BC,oBAAqBxB,EAAawB,oBAClCC,qBAAsBzB,EAAayB,qBACnCC,SAAU1B,EAAa2B,qBACvBC,SAAS,GAGXzC,KAAK0C,SAAStB,GAEVP,EAAa8B,qBACf3C,KAAKM,kBAAkB,CAAEe,GAAIR,EAAa8B,sBAGxC9B,EAAa+B,oBACf1B,YAAW,WACT,EAAK2B,IAAIC,iBAAiBC,UAAUC,IAAI,aACvCnC,EA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AC/BmL,SAAS,WACTA,SAAStM,EAAaW,aACtB2L,SAAS,qCACTJ,OAAS,GACLlM,EAAa0B,WACb4K,SAAS,sCACTJ,OAAS,GACTI,SAAStM,EAAa0B,UACtB4K,SAAS,sBACTJ,OAAS,IAEbI,SAAS,qBACTJ,OAAS,GACTI,SAAStM,EAAaW,aACtB2L,SAAS,sBACTJ,OAAS,GACLlM,EAAayB,sBAAwBzB,EAAawB,sBAClD8K,SAAS,2BACTJ,OAAS,GACTI,SAAStM,EAAawB,qBACtB8K,SAAS,6BACLtM,EAAamE,iBACbmI,SAAS,KACTA,SAAStM,EAAamE,gBACtBmI,SAAS,MAEbA,SAAS,wBACTJ,OAAS,GACTI,SAAStM,EAAayB,sBACtB6K,SAAS,oCACTJ,OAAS,IAEbI,SAAS,0CACTJ,OAAS,IAEbI,SAAS,QAEbA,SAAS,MAEbA,SAAS,MACTJ,OAAS,GAEb,OAAOG,SACT,MAAOtI,GACL8G,QAAQ9G,EAAGoI,QAASC,WAAYF,OAAQvB","file":"js/component-notificationComponent-js.chunks.js","sourcesContent":["import baseComponent from '../base/baseComponent';\nimport notificationListTemplate from 'MICROTEMPLATES/notification/notificationList.ejs';\nimport Cookies from 'js-cookie';\n\nexport default class NotificationComponent extends baseComponent {\n  get Messages() {\n    return {\n      [this.CUSTOM_MESSAGES.NOTIFICATION.push]: this.addNotification,\n      [this.CUSTOM_MESSAGES.NOTIFICATION.close]: this.closeNotification,\n      [this.CUSTOM_MESSAGES.NOTIFICATION.pushall]: this.addNotificationAll,\n      [this.CUSTOM_MESSAGES.NOTIFICATION.pushFirstAvailable]: this.addFirstAvailableNotification\n    };\n  }\n\n  constructor(element) {\n    super(element);\n    this.notificationActiveId = '';\n  }\n\n  addNotificationAll(notifications) {\n    notifications.forEach((notification) => {\n      this.addNotification(notification);\n    });\n  }\n\n  addFirstAvailableNotification({ notifications }) {\n    let firstNotification = notifications.find((n) => {\n      return !this.isNotificationClosed(n);\n    });\n    if (firstNotification) {\n      setTimeout(() => {\n        this.addNotification(firstNotification);\n      }, 3000);\n    }\n  }\n\n  addNotification(notification) {\n    if (this.notificationCanBeAdded(notification)) {\n      let stateUpdate = {};\n      stateUpdate[notification.id] = {\n        id: notification.id,\n        title: notification.notificationTitle,\n        description: notification.notificationDescription,\n        icon: notification.notificationIcon,\n        quietPeriod: notification.notificationQuietPeriod,\n        maxViews: notification.notificationMaxViews,\n        image: notification.notificationImage,\n        rank: notification.rank,\n        notificationPromoPush: notification.notificationPromoPush,\n        notificationPost: notification.notificationPost,\n        notificationCtaLink: notification.notificationCtaLink,\n        notificationCtaLabel: notification.notificationCtaLabel,\n        subtitle: notification.notificationSubTitle,\n        isfirst: false\n      };\n\n      this.setState(stateUpdate);\n\n      if (notification.notificationToClose) {\n        this.closeNotification({ id: notification.notificationToClose });\n      }\n\n      if (notification.notificationTimer) {\n        setTimeout(() => {\n          this.$el.lastElementChild.classList.add('closing');\n        }, notification.notificationTimer);\n        setTimeout(() => {\n          this.closeNotification({ id: notification.id, skipCookie: true });\n        }, notification.notificationTimer + +500);\n      }\n\n      document.querySelector('body').classList.add(`notification-in`);\n    }\n  }\n\n  closeNotification({ id, skipCookie }) {\n    let notification = this.state[id];\n    if (notification) {\n      if (!skipCookie) {\n        Cookies.set('c4_notification_closed_' + notification.id, 'true', {\n          expires: new Date(new Date().getTime() + notification.quietPeriod * 60 * 1000)\n        });\n      }\n      this.incrementViews(notification);\n      notification.closed = true;\n      let stateUpdate = {};\n      stateUpdate[id] = notification;\n      this.setState(stateUpdate);\n      let hasNotificationOpen = Object.keys(this.state).some((id) => {\n        return !this.state[id].closed;\n      });\n\n      if (!hasNotificationOpen) {\n        document.querySelector('body').classList.remove(`notification-in`);\n      }\n      this.EMIT(this.CUSTOM_MESSAGES.NOTIFICATION.closed, { id: id });\n\n      let firstNotification = Cookies.get('c4_notification_first_' + notification.id);\n      if (firstNotification) {\n        Cookies.remove('c4_notification_first_' + notification.id);\n      }\n    }\n    this.$el.querySelectorAll('.push-notification').forEach((notification) => {\n      notification.classList.add('opening');\n    });\n  }\n\n  stateChange(stateChanges) {\n    let notificationList = Object.keys(this.state)\n      .map((id) => {\n        return this.state[id];\n      })\n      .sort((a, b) => {\n        return a.rank - b.rank;\n      });\n\n    let firstNotificationOpen = notificationList\n      .slice()\n      .reverse()\n      .find((e) => {\n        return !e.closed;\n      });\n\n    if (firstNotificationOpen) {\n      let firstNotificationIndex = notificationList.findIndex((e) => {\n        return e.id === firstNotificationOpen.id;\n      });\n      if (this.notificationActiveId !== firstNotificationOpen.id) {\n        this.emitTracking('Impression', null);\n        this.notificationActiveId = firstNotificationOpen.id;\n      }\n\n      if (firstNotificationOpen.notificationCtaLabel && firstNotificationOpen.notificationCtaLink) {\n        notificationList[firstNotificationIndex].trackLinkClass = 'js-track-link';\n      }\n\n      let firstNotification = Cookies.get('c4_notification_first_' + firstNotificationOpen.id);\n      if (!firstNotification && !firstNotificationOpen.notificationTimer) {\n        notificationList[firstNotificationIndex].isfirst = true;\n        setTimeout(() => {\n          Cookies.set('c4_notification_first_' + firstNotificationOpen.id, 'true');\n        }, 1000);\n      } else {\n        notificationList[notificationList.length - 1].isfirst = false;\n      }\n    }\n\n    // if (firstNotificationOpen && firstNotificationOpen.notificationPromoPush) {\n    //   Cookies.set('c4_notification_shown_' + firstNotificationOpen.id, 'true', { expires: new Date(new Date().getTime() + firstNotificationOpen.quietPeriod * 60 * 1000) });\n    // }\n    this.$el.innerHTML = notificationListTemplate({ notifications: notificationList });\n    if (firstNotificationOpen) {\n      this.trackingClick(firstNotificationOpen);\n    }\n  }\n\n  closeFirtsNotification() {\n    let notificationList = Object.keys(this.state)\n      .map((id) => {\n        return this.state[id];\n      })\n      .sort((a, b) => {\n        return a.rank - b.rank;\n      });\n\n    let firstNotificationOpen = notificationList\n      .slice()\n      .reverse()\n      .find((e) => {\n        return !e.closed;\n      });\n\n    if (firstNotificationOpen) {\n      this.closeNotification({ id: firstNotificationOpen.id });\n    }\n  }\n\n  notificationCanBeAdded(notification) {\n    let notificationexist = this.state[notification.id];\n    if (notificationexist && !notification.closed) return;\n    let notificationClosed = Cookies.get('c4_notification_closed_' + notification.id);\n    let views = Cookies.get('c4_notification_views_' + notification.id);\n    let shown = Cookies.get('c4_notification_shown_' + notification.id);\n    if (\n      (notificationClosed && notificationClosed === 'true') ||\n      (views && views >= notification.maxViews) ||\n      (views && views >= notification.notificationMaxViews) ||\n      (shown && shown === 'true')\n    ) {\n      return false;\n    }\n\n    return true;\n  }\n\n  isNotificationClosed(notification) {\n    let notificationClosed = Cookies.get('c4_notification_closed_' + notification.id);\n    let views = Cookies.get('c4_notification_views_' + notification.id);\n    let shown = Cookies.get('c4_notification_shown_' + notification.id);\n    if ((notificationClosed && notificationClosed === 'true') || (views && views >= notification.notificationMaxViews) || (shown && shown === 'true')) {\n      return true;\n    }\n\n    return false;\n  }\n\n  incrementViews(notification) {\n    let views = Cookies.get('c4_notification_views_' + notification.id);\n    Cookies.set('c4_notification_views_' + notification.id, views ? +views + 1 : 1);\n  }\n\n  emitTracking(action, label) {\n    this.EMIT(this.CUSTOM_MESSAGES.TRACKING_EVENTS.update, {\n      eventCategory: 'Push banner',\n      eventAction: action,\n      eventLabel: label\n    });\n  }\n\n  trackingClick(notification) {\n    const _this = this;\n    let link = document.querySelector('.js-track-link');\n    this.$on(\n      'click',\n      function(e) {\n        _this.emitTracking('Click', notification.id + ' - ' + notification.notificationCtaLabel);\n      },\n      link\n    );\n  }\n}\n","/* eslint-disable new-cap */\n/* eslint-disable valid-jsdoc */\n/* eslint-disable no-underscore-dangle */\n\nimport Bean from 'bean';\nimport deepFreeze from '../utilities/freeze';\nimport BaseGiaComponent from './baseGiaComponent';\n\nexport default class BaseComponent extends BaseGiaComponent {\n  /**\n   * @returns {HTMLElement}\n   */\n  get $el() {\n    return /** @type {HTMLElement} */ (this._componentElement);\n  }\n\n  get $options() {\n    const compOptions = {};\n    const options = { ...this.$el.dataset };\n    const optionsEntires = Object.keys(options).filter((entry) => entry.includes('option'));\n    optionsEntires.forEach((entry) => {\n      const cleanEntry = BaseComponent.cleanOptionKey(entry);\n      let optionValue;\n      if (options[entry].includes('{') && options[entry].includes('}')) {\n        optionValue = JSON.parse(options[entry].replace(/'/g, '\"'));\n      } else {\n        optionValue = BaseComponent.convertType(options[entry]);\n      }\n      compOptions[cleanEntry] = optionValue;\n    });\n    return deepFreeze(compOptions);\n  }\n\n  get COMPONENT_NAME() {\n    return this.$el.getAttribute('data-component');\n  }\n\n  /**\n   *\n   * constructor\n   *\n   * @param {Element} element\n   */\n  constructor(element) {\n    super(element);\n    this._componentElement = element;\n    this._componentElement.setAttribute('data-component-init', 'true');\n    this._checkMessages();\n  }\n\n  static convertType(option) {\n    let optionReturn;\n    switch (option) {\n      case 'false':\n        optionReturn = false;\n        break;\n      case 'true':\n        optionReturn = true;\n        break;\n      case 'null':\n        optionReturn = null;\n        break;\n      default:\n        optionReturn = option;\n        break;\n    }\n\n    return optionReturn;\n  }\n\n  static cleanOptionKey(key) {\n    const str = key.replace('option', '');\n    return `${str.charAt(0).toLocaleLowerCase()}${str.slice(1)}`;\n  }\n\n  /**\n   *\n   * $on\n   *\n   * @param {String} events\n   * @param {Function} cb\n   * @param {Element} [element = this.$el]\n   * @param {Array|String|Element} [elements = null]\n   */\n  $on(events, cb, element = this.$el, elements = null) {\n    if (!element || !events || !cb) return;\n    if (!elements) {\n      Bean.on(element, events, (e) => {\n        if (e) e.stopPropagation();\n        cb(e);\n      });\n    } else {\n      Bean.on(element, events, elements, (e) => {\n        if (e) e.stopPropagation();\n        cb(e);\n      });\n    }\n  }\n\n  /**\n   *\n   * $one\n   *\n   * @param {String} events\n   * @param {Function} cb\n   * @param {Element} [element = this.$el]\n   */\n  $one(events, cb, element = this.$el) {\n    Bean.one(element, events, cb);\n  }\n\n  /**\n   *\n   * $off\n   *\n   * @param {String} events\n   * @param {Element} [element = this.$el]\n   */\n  $off(events, element = this.$el) {\n    Bean.off(element, events);\n  }\n\n  /**\n   *\n   * $fire\n   *\n   * @param {String} events\n   * @param {Element} [element = this.$el]\n   */\n  $fire(events, element = this.$el) {\n    Bean.fire(element, events);\n  }\n\n  /**\n   *\n   * Activate loader\n   *\n   * @param {HTMLElement} [container]\n   * @param {String} [message]\n   */\n  loading(container, message) {\n    this._loading = true;\n    this.EMIT(this.CUSTOM_MESSAGES.LOADER_EVENTS.show, {\n      container: container || document.body,\n      message: message ?? null\n    });\n  }\n\n  /**\n   *\n   * Deactivate loader\n   *\n   * @param {HTMLElement} [container]\n   * @param {String} [message]\n   * @param {Boolean} [error=false]\n   * @param {String} [icon]\n   */\n  endLoading(container, message, error = false, icon) {\n    this._loading = false;\n    setTimeout(() => {\n      if (!this._loading) {\n        this.EMIT(this.CUSTOM_MESSAGES.LOADER_EVENTS.hide, {\n          container: container || document.body,\n          message,\n          error,\n          icon\n        });\n      }\n    }, 400);\n  }\n}\n","/*!\n * JavaScript Cookie v2.2.1\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction decode (s) {\n\t\treturn s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api() {}\n\n\t\tfunction set (key, value, attributes) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tattributes = extend({\n\t\t\t\tpath: '/'\n\t\t\t}, api.defaults, attributes);\n\n\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\tattributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);\n\t\t\t}\n\n\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\ttry {\n\t\t\t\tvar result = JSON.stringify(value);\n\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\tvalue = result;\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\n\t\t\tvalue = converter.write ?\n\t\t\t\tconverter.write(value, key) :\n\t\t\t\tencodeURIComponent(String(value))\n\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\n\t\t\tkey = encodeURIComponent(String(key))\n\t\t\t\t.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)\n\t\t\t\t.replace(/[\\(\\)]/g, escape);\n\n\t\t\tvar stringifiedAttributes = '';\n\t\t\tfor (var attributeName in attributes) {\n\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Considers RFC 6265 section 5.2:\n\t\t\t\t// ...\n\t\t\t\t// 3.  If the remaining unparsed-attributes contains a %x3B (\";\")\n\t\t\t\t//     character:\n\t\t\t\t// Consume the characters of the unparsed-attributes up to,\n\t\t\t\t// not including, the first %x3B (\";\") character.\n\t\t\t\t// ...\n\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n\t\t\t}\n\n\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t}\n\n\t\tfunction get (key, json) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar jar = {};\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all.\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = decode(parts[0]);\n\t\t\t\t\tcookie = (converter.read || converter)(cookie, name) ||\n\t\t\t\t\t\tdecode(cookie);\n\n\t\t\t\t\tif (json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tjar[name] = cookie;\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn key ? jar[key] : jar;\n\t\t}\n\n\t\tapi.set = set;\n\t\tapi.get = function (key) {\n\t\t\treturn get(key, false /* read as raw */);\n\t\t};\n\t\tapi.getJSON = function (key) {\n\t\t\treturn get(key, true /* read as json */);\n\t\t};\n\t\tapi.remove = function (key, attributes) {\n\t\t\tset(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.defaults = {};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n","module.exports = function anonymous(locals, escapeFn, include, rethrow) {\n    rethrow = rethrow || function rethrow(err, str, flnm, lineno, esc) {\n        var lines = str.split(\"\\n\");\n        var start = Math.max(lineno - 3, 0);\n        var end = Math.min(lines.length, lineno + 3);\n        var filename = esc(flnm);\n        var context = lines.slice(start, end).map(function(line, i) {\n            var curr = i + start + 1;\n            return (curr == lineno ? \" >> \" : \"    \") + curr + \"| \" + line;\n        }).join(\"\\n\");\n        err.path = filename;\n        err.message = (filename || \"ejs\") + \":\" + lineno + \"\\n\" + context + \"\\n\\n\" + err.message;\n        throw err;\n    };\n    escapeFn = escapeFn || function(markup) {\n        return markup == undefined ? \"\" : String(markup).replace(_MATCH_HTML, encode_char);\n    };\n    var _ENCODE_HTML_RULES = {\n        \"&\": \"&amp;\",\n        \"<\": \"&lt;\",\n        \">\": \"&gt;\",\n        '\"': \"&#34;\",\n        \"'\": \"&#39;\"\n    }, _MATCH_HTML = /[&<>'\"]/g;\n    function encode_char(c) {\n        return _ENCODE_HTML_RULES[c] || c;\n    }\n    var __line = 1, __lines = '<% if (notifications && notifications.length > 0) { %> <% notifications.forEach(function(notification,index){ %> <% if (!notification.closed) { %>\\n<div class=\"push-notification <% if (notification.isfirst) { %> first-time <% } %><% if (notification.notificationPost) { %> post-notification <% } %> \">\\n    <div class=\"notification-header\">\\n        <p><img src=\"<%= notification.icon %>\" alt=\"<%= notification.title %>\" /><%= notification.title %></p>\\n        <button class=\"notification-close\" data-option-notification-id=\"<%= notification.id %>\" data-component=\"closeNotificationComponent\" aria-label=\"chiudi notifica\"></button>\\n    </div>\\n    <div class=\"notification-body\">\\n        <img class=\"notification-image lazyload\" src=\"<%= notification.image %>\" alt=\"<%- notification.description %>\" />\\n        <div>\\n            <% if (notification.subtitle) {%>\\n            <p class=\"subtitle\"><%- notification.subtitle %></p>\\n            <%}%>\\n            <p><%- notification.description %></p>\\n            <% if (notification.notificationCtaLabel && notification.notificationCtaLink) {%>\\n            <a href=\"<%- notification.notificationCtaLink %>\" class=\"btn btn-primary <% if (notification.trackLinkClass) { %> <%- notification.trackLinkClass %> <% } %>\"\\n                ><%- notification.notificationCtaLabel %></a\\n            >\\n            <%}%>\\n        </div>\\n    </div>\\n</div>\\n<% } %> <% }); %> <% } %>\\n', __filename = \"src/microtemplates/notification/notificationList.ejs\";\n    try {\n        var __output = \"\";\n        function __append(s) {\n            if (s !== undefined && s !== null) __output += s;\n        }\n        with (locals || {}) {\n            if (notifications && notifications.length > 0) {\n                __append(\" \");\n                notifications.forEach(function(notification, index) {\n                    __append(\" \");\n                    if (!notification.closed) {\n                        __append('\\n<div class=\"push-notification ');\n                        __line = 2;\n                        if (notification.isfirst) {\n                            __append(\" first-time \");\n                        }\n                        if (notification.notificationPost) {\n                            __append(\" post-notification \");\n                        }\n                        __append(' \">\\n    <div class=\"notification-header\">\\n        <p><img src=\"');\n                        __line = 4;\n                        __append(escapeFn(notification.icon));\n                        __append('\" alt=\"');\n                        __append(escapeFn(notification.title));\n                        __append('\" />');\n                        __append(escapeFn(notification.title));\n                        __append('</p>\\n        <button class=\"notification-close\" data-option-notification-id=\"');\n                        __line = 5;\n                        __append(escapeFn(notification.id));\n                        __append('\" data-component=\"closeNotificationComponent\" aria-label=\"chiudi notifica\"></button>\\n    </div>\\n    <div class=\"notification-body\">\\n        <img class=\"notification-image lazyload\" src=\"');\n                        __line = 8;\n                        __append(escapeFn(notification.image));\n                        __append('\" alt=\"');\n                        __append(notification.description);\n                        __append('\" />\\n        <div>\\n            ');\n                        __line = 10;\n                        if (notification.subtitle) {\n                            __append('\\n            <p class=\"subtitle\">');\n                            __line = 11;\n                            __append(notification.subtitle);\n                            __append(\"</p>\\n            \");\n                            __line = 12;\n                        }\n                        __append(\"\\n            <p>\");\n                        __line = 13;\n                        __append(notification.description);\n                        __append(\"</p>\\n            \");\n                        __line = 14;\n                        if (notification.notificationCtaLabel && notification.notificationCtaLink) {\n                            __append('\\n            <a href=\"');\n                            __line = 15;\n                            __append(notification.notificationCtaLink);\n                            __append('\" class=\"btn btn-primary ');\n                            if (notification.trackLinkClass) {\n                                __append(\" \");\n                                __append(notification.trackLinkClass);\n                                __append(\" \");\n                            }\n                            __append('\"\\n                >');\n                            __line = 16;\n                            __append(notification.notificationCtaLabel);\n                            __append(\"</a\\n            >\\n            \");\n                            __line = 18;\n                        }\n                        __append(\"\\n        </div>\\n    </div>\\n</div>\\n\");\n                        __line = 22;\n                    }\n                    __append(\" \");\n                });\n                __append(\" \");\n            }\n            __append(\"\\n\");\n            __line = 23;\n        }\n        return __output;\n    } catch (e) {\n        rethrow(e, __lines, __filename, __line, escapeFn);\n    }\n}"],"sourceRoot":""}