From 4ae6f2a68b0255cc332310778f97dd54c53141d5 Mon Sep 17 00:00:00 2001 From: Marco Monti Date: Mon, 17 Jun 2024 09:21:56 +0200 Subject: [PATCH 1/5] Accessibility fixes | utility fix --- build/cookieconsent.js | 511 +++++++++++++++++--- build/cookieconsent.min.js | 2 +- docs_src/src/assets/js/cookieconsent.min.js | 2 +- src/lib/Interface.js | 37 +- src/lib/Utilities.js | 69 +-- 5 files changed, 515 insertions(+), 106 deletions(-) diff --git a/build/cookieconsent.js b/build/cookieconsent.js index c6f4ecc..8e98e92 100644 --- a/build/cookieconsent.js +++ b/build/cookieconsent.js @@ -27,11 +27,46 @@ class Utilities { } else if (r < 0) { r = 0; } - var b = (num >> 8 & 0x00FF) + amt; - if (b > 255) { - b = 255; - } else if (b < 0) { - b = 0; + }, { + key: "lightenDarkenColor", + value: function lightenDarkenColor(col, amt) { + var usePound = false; + + // Handling HEX color format + if (col[0] === "#") { + col = col.slice(1); + usePound = true; + var num = parseInt(col, 16); + var r = (num >> 16) + amt; + var g = (num >> 8 & 0x00FF) + amt; + var b = (num & 0x0000FF) + amt; + r = Math.min(255, Math.max(0, r)); + g = Math.min(255, Math.max(0, g)); + b = Math.min(255, Math.max(0, b)); + return (usePound ? "#" : "") + (r << 16 | g << 8 | b).toString(16).padStart(6, '0'); + } + + // Handling RGBA and RGB color format + if (col.startsWith("rgb")) { + var parts = col.match(/rgba?\((\d{1,3})\s*,?\s*(\d{1,3})\s*,?\s*(\d{1,3})(?:\s*\/\s*(\d+\.?\d*%?))?\)/i); + if (parts) { + var _r = parseInt(parts[1]) + amt; + var _g = parseInt(parts[2]) + amt; + var _b = parseInt(parts[3]) + amt; + var a = parts[4] ? parseFloat(parts[4]) : 1; + _r = Math.min(255, Math.max(0, _r)); + _g = Math.min(255, Math.max(0, _g)); + _b = Math.min(255, Math.max(0, _b)); + + // Conditionally format output depending on alpha presence + if (parts[4]) { + return "rgba(".concat(_r, ", ").concat(_g, ", ").concat(_b, ", ").concat(a, ")"); + } else { + return "rgb(".concat(_r, ", ").concat(_g, ", ").concat(_b, ")"); + } + } + } + return col; // Return the original if format is not recognized } var g = (num & 0x0000FF) + amt; if (g > 255) { @@ -1021,19 +1056,147 @@ class Interface { constructor() { this.elements = {}; } - buildStyle() { - return el('style', '#cconsent-bar, #cconsent-bar * { box-sizing:border-box }', '#cconsent-bar .visually-hide, #cconsent-modal .visually-hide { position: absolute !important; overflow: hidden !important; clip-path: rect(1px 1px 1px 1px) !important; width: 1px !important; height: 1px !important; }', '#cconsent-bar { background-color:' + window.CookieConsent.config.theme.barColor + '; color:' + window.CookieConsent.config.theme.barTextColor + '; padding:15px; text-align:right; font-family:inherit; font-size:14px; line-height:18px; position:fixed; bottom:0; inset-inline:0; z-index:9998; transform: translateY(0); transition: transform .6s ease-in-out; transition-delay: .3s;}', '#cconsent-bar.ccb--hidden {transform: translateY(100%); display:block; visible:hidden;}', '#cconsent-bar .ccb__wrapper { display:flex; flex-wrap:wrap; justify-content:space-between; max-width:1800px; margin:0 auto;}', '#cconsent-bar .ccb__left { align-self:center; text-align:left; margin: 15px 0;}', '#cconsent-bar .ccb__right { align-self:center; white-space: nowrap;}', '#cconsent-bar .ccb__right > div {display:inline-block; color:#FFF;}', '#cconsent-bar button { line-height:normal; font-size:14px; border:0; padding:10px 10px; color:' + window.CookieConsent.config.theme.barMainButtonTextColor + '; background-color:' + window.CookieConsent.config.theme.barMainButtonColor + ';}', '#cconsent-bar button.consent-give { line-height:normal; font-size:14px; border:none; padding:10px 10px; color:' + window.CookieConsent.config.theme.barMainButtonTextColor + '; background-color:' + window.CookieConsent.config.theme.barMainButtonColor + ';}', '#cconsent-bar button.consent-decline { line-height:normal; font-size:14px; border:none; padding:10px 10px; color:' + window.CookieConsent.config.theme.barMainButtonColor + '; background-color:' + window.CookieConsent.config.theme.barMainButtonTextColor + '; margin-right: 10px; border: 1px solid ' + window.CookieConsent.config.theme.barMainButtonColor + '}', '#cconsent-bar button.ccb__edit { appearance:none; margin-right:15px; border:0; padding:0; text-decoration:underline; color:' + window.CookieConsent.config.theme.barTextColor + '; background:none; }', '#cconsent-bar a:hover, #cconsent-bar button:hover { cursor:pointer; }', '#cconsent-modal, #cconsent-init-modal { display:none; font-size:14px; line-height:18px; color:#666; width: 100vw; height: 100vh; position:fixed; left:0; top:0; right:0; bottom:0; font-family:inherit; font-size:14px; background-color:rgba(0,0,0,0.6); z-index:9999; align-items:center; justify-content:center;}', '@media (max-width: 600px) { #cconsent-modal, #cconsent-init-modal { height: 100% } }', '#cconsent-modal button, #cconsent-init-modal button { border: 0 }', '#cconsent-modal h2, #cconsent-init-modal h2, #cconsent-modal h3, #cconsent-init-modal h3 {color:#333; margin-top:0}', '#cconsent-modal.ccm--visible, #cconsent-init-modal.ccm--visible {display:flex}', '#cconsent-modal .ccm__content, #cconsent-init-modal .ccm__content { max-width:600px; max-height:600px; overflow-Y:auto; background-color:#EFEFEF; display:flex; flex-direction:column; justify-content:space-between; }', '@media (max-width: 600px) { #cconsent-modal .ccm__content, #cconsent-init-modal .ccm__content { max-width:100vw; height:100%; max-height:initial; }}', '#cconsent-modal .ccm__content > .ccm__content__heading, #cconsent-init-modal .ccm__content > .ccm__content__heading { border-bottom:1px solid #D8D8D8; padding:35px 35px 20px; background-color:#EFEFEF; position:relative; }', '#cconsent-modal .ccm__content > .ccm__content__heading h2, #cconsent-init-modal .ccm__content > .ccm__content__heading h2 { font-size:21px; font-weight:600; color:#333; margin:0 }', '#cconsent-modal .ccm__content > .ccm__content__heading p, #cconsent-init-modal .ccm__content > .ccm__content__heading p { margin-top:1rem; margin-bottom:1rem; }', '#cconsent-modal .ccm__content > .ccm__content__heading .ccm__cheading__close, #cconsent-init-modal .ccm__content > .ccm__content__heading .ccm__cheading__close { appearance:none; padding:0; border:0; font-weight:600; color:#888; cursor:pointer; font-size:26px; position:absolute; right:15px; top:15px; width:26px; height:26px; background:none; text-align:center; }', '#cconsent-modal .ccm__content > .ccm__content__heading .ccm__cheading__close:focus-visible, #cconsent-init-modal .ccm__content > .ccm__content__heading .ccm__cheading__close:focus-visible { box-shadow: 0 0 0 0.25rem ' + window.CookieConsent.config.theme.focusColor + '; }', '#cconsent-modal .ccm__content > .ccm__content__body { background-color:#FFF; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup { margin:0; border-bottom: 1px solid #D8D8D8; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head {color:#333; font-weight:600; cursor:pointer; position:relative; padding:0; margin:0; transition: background-color .5s ease-out; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head:hover { background-color:#F9F9F9 }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head__status { order: 1; position:absolute; left:35px; font-weight: 600; display:inline-block; margin-right: 20px; pointer-events: none; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head__status.ccm__tab-head__status--checked { font-size:1em; color:#28a834; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head__status.ccm__tab-head__status--unchecked { font-size:1.4em; color:#e56385; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head__text { order: 2; pointer-events: none; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup .ccm__tab-head .ccm__tab-head__icon-wedge { transition: transform .3s ease-out; transform-origin: center; position:absolute;right:25px; top:50%; transform:rotate(0deg); transform:translateY(-50%); order: 3;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup .ccm__tab-head .ccm__tab-head__icon-wedge > svg { pointer-events: none; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup.ccm__tabgroup--open .ccm__tab-head .ccm__tab-head__icon-wedge { transform:translateY(-50%) rotate(-180deg) }', '#cconsent-modal .ccm__tab-trigger { appearance: none; background: none; display: flex; flex-direction: row; width: 100%; padding:17px 35px 17px 56px; color:#333; font-weight:600; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content {padding:0; margin:0}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup .ccm__tab-content { max-height: 0; overflow: hidden; opacity: 0; transition: all .5s ease-out; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup .ccm__tab-content__inner { display: flex; flex-direction: row; padding:25px 35px; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup.ccm__tabgroup--open .ccm__tab-head { background-color:#f9f9f9 }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup.ccm__tabgroup--open .ccm__tab-content { max-height: 900px; opacity: 1; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose {order:1;}', '@media (max-width: 600px) { #cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup.ccm__tabgroup--open .ccm__tab-content {flex-direction:column} }', '@media (max-width: 600px) { #cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose { margin-bottom:20px; } }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-component {display:flex; margin-right:35px; align-items:center;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch__status {font-weight:600;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-group {background:none; width:40px; height:20px; margin:0 10px; position:relative;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch__slider {position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; border-radius:10px; transition: .4s; pointer-events: none;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch__slider:before {position: absolute; content: ""; height: 12px; width: 12px; left: 4px; bottom: 4px; background-color: white; border-radius:50%; transition: .4s;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-group[aria-checked="true"] .ccm__switch__slider {background-color: #28A834;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-group:focus-visible {box-shadow: 0 0 0 2px' + window.CookieConsent.config.theme.focusColor + ';}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-group[aria-checked="true"] .ccm__switch__slider:before {transform: translateX(20px);}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__desc {order:2;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content h3 {font-size:18px; margin-bottom:10px; line-height:1;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content p {color:#444; margin-bottom:0}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__list:not(:empty) {margin-top:30px;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__list .ccm__list__title {color:#333; font-weight:600;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__list ul { margin:15px 0; padding-left:15px }', '#cconsent-modal .ccm__footer, #cconsent-init-modal .ccm__footer { padding:35px; background-color:#EFEFEF; text-align:center; display: flex; align-items:center; justify-content:flex-end; }', '#cconsent-modal .ccm__footer button, #cconsent-init-modal .ccm__footer button { line-height:normal; font-size:14px; transition: background-color .5s ease-out; background-color:' + window.CookieConsent.config.theme.modalMainButtonColor + '; color:' + window.CookieConsent.config.theme.modalMainButtonTextColor + '; border:none; padding:13px; min-width:110px; border-radius: 2px; cursor:pointer; height: 100%; }', '#cconsent-modal .ccm__footer button:hover, #cconsent-init-modal .ccm__footer button:hover { background-color:' + Utilities.lightenDarkenColor(window.CookieConsent.config.theme.modalMainButtonColor, -20) + '; }', '#cconsent-modal .ccm__footer button + button, #cconsent-init-modal .ccm__footer button + button { margin-left: 10px; }'); - } - injectCustomStyles(customCSS) { - let fullOverride = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - const style = document.createElement('style'); - style.appendChild(document.createTextNode(customCSS)); - if (fullOverride) { - document.head.appendChild(style); - } else { - let defaultStyleTag = document.body.getElementsByTagName('style'); - if (defaultStyleTag.length) { - defaultStyleTag[0].insertAdjacentElement('afterend', style); + Interface_createClass(Interface, [{ + key: "buildStyle", + value: function buildStyle() { + return el('style', '#cconsent-bar, #cconsent-bar * { box-sizing:border-box }', '#cconsent-bar .visually-hide, #cconsent-modal .visually-hide { position: absolute !important; overflow: hidden !important; clip: rect(1px 1px 1px 1px) !important; clip: rect(1px, 1px, 1px, 1px) !important;width: 1px !important; height: 1px !important; }', '#cconsent-bar { background-color:' + window.CookieConsent.config.theme.barColor + '; color:' + window.CookieConsent.config.theme.barTextColor + '; padding:15px; text-align:right; font-family:sans-serif; font-size:14px; line-height:18px; position:fixed; bottom:0; left:0; width:100%; z-index:9998; transform: translateY(0); transition: transform .6s ease-in-out; transition-delay: .3s;}', '#cconsent-bar.ccb--hidden {transform: translateY(100%); display:block; visible:hidden;}', '#cconsent-bar .ccb__wrapper { display:flex; flex-wrap:wrap; justify-content:space-between; max-width:1800px; margin:0 auto;}', '#cconsent-bar .ccb__left { align-self:center; text-align:left; margin: 15px 0;}', '#cconsent-bar .ccb__right { align-self:center; white-space: nowrap;}', '#cconsent-bar .ccb__right > div {display:inline-block; color:#FFF;}', '#cconsent-bar button { line-height:normal; font-size:14px; border:0; padding:10px 10px; color:' + window.CookieConsent.config.theme.barMainButtonTextColor + '; background-color:' + window.CookieConsent.config.theme.barMainButtonColor + ';}', '#cconsent-bar button.consent-give { line-height:normal; font-size:14px; border:none; padding:10px 10px; color:' + window.CookieConsent.config.theme.barMainButtonTextColor + '; background-color:' + window.CookieConsent.config.theme.barMainButtonColor + ';}', '#cconsent-bar button.consent-decline { line-height:normal; font-size:14px; border:none; padding:10px 10px; color:' + window.CookieConsent.config.theme.barMainButtonColor + '; background-color:' + window.CookieConsent.config.theme.barMainButtonTextColor + '; margin-right: 10px; border: 1px solid ' + window.CookieConsent.config.theme.barMainButtonColor + '}', '#cconsent-bar button.ccb__edit { -moz-appearance:none; -webkit-appearance:none; appearance:none; margin-right:15px; border:0; padding:0; text-decoration:underline; color:' + window.CookieConsent.config.theme.barTextColor + '; background:none; }', '#cconsent-bar a:hover, #cconsent-bar button:hover { cursor:pointer; }', '#cconsent-bar button:focus-visible {box-shadow: 0 0 0 2px ' + window.CookieConsent.config.theme.focusColor + ';}', '#cconsent-modal, #cconsent-init-modal { display:none; font-size:14px; line-height:18px; color:#666; width: 100vw; height: 100vh; position:fixed; left:0; top:0; right:0; bottom:0; font-family:sans-serif; font-size:14px; background-color:rgba(0,0,0,0.6); z-index:9999; align-items:center; justify-content:center;}', '@media (max-width: 600px) { #cconsent-modal, #cconsent-init-modal { height: 100% } }', '#cconsent-modal button, #cconsent-init-modal button { border: 0 }', '#cconsent-modal strong, #cconsent-init-modal strong {color:#333; margin-top:0}', '#cconsent-modal.ccm--visible, #cconsent-init-modal.ccm--visible {display:flex}', '#cconsent-modal .ccm__content, #cconsent-init-modal .ccm__content { max-width:600px; max-height:600px; overflow-Y:auto; background-color:#EFEFEF; display:flex; flex-direction:column; justify-content:space-between; }', '@media (max-width: 600px) { #cconsent-modal .ccm__content, #cconsent-init-modal .ccm__content { max-width:100vw; height:100%; max-height:initial; }}', '#cconsent-modal .ccm__content > .ccm__content__heading, #cconsent-init-modal .ccm__content > .ccm__content__heading { border-bottom:1px solid #D8D8D8; padding:35px 35px 20px; background-color:#EFEFEF; position:relative; }', '#cconsent-modal .ccm__content > .ccm__content__heading strong, #cconsent-init-modal .ccm__content > .ccm__content__heading strong { font-size:21px; font-weight:600; color:#333; margin:0 }', '#cconsent-modal .ccm__content > .ccm__content__heading p, #cconsent-init-modal .ccm__content > .ccm__content__heading p { margin-top:1rem; margin-bottom:1rem; }', '#cconsent-modal .ccm__content > .ccm__content__heading .ccm__cheading__close, #cconsent-init-modal .ccm__content > .ccm__content__heading .ccm__cheading__close { -moz-appearance:none; -webkit-appearance:none; appearance:none; padding:0; border:0; font-weight:600; color:#888; cursor:pointer; font-size:26px; position:absolute; right:15px; top:15px; width:26px; height:26px; background:none; text-align:center; }', '#cconsent-modal .ccm__content > .ccm__content__heading .ccm__cheading__close:focus-visible, #cconsent-init-modal .ccm__content > .ccm__content__heading .ccm__cheading__close:focus-visible { box-shadow: 0 0 0 0.25rem ' + window.CookieConsent.config.theme.focusColor + '; }', '#cconsent-modal .ccm__content > .ccm__content__body { background-color:#FFF; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup { margin:0; border-bottom: 1px solid #D8D8D8; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head {color:#333; font-weight:600; cursor:pointer; position:relative; padding:0; margin:0; transition: background-color .5s ease-out; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head:hover { background-color:#F9F9F9 }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head__status { order: 1; position:absolute; left:35px; font-weight: 600; display:inline-block; margin-right: 20px; pointer-events: none; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head__status.ccm__tab-head__status--checked { font-size:1em; color:#28a834; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head__status.ccm__tab-head__status--unchecked { font-size:1.4em; color:#e56385; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head__text { order: 2; pointer-events: none; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup .ccm__tab-head .ccm__tab-head__icon-wedge { transition: transform .3s ease-out; transform-origin: center; position:absolute;right:25px; top:50%; transform:rotate(0deg); transform:translateY(-50%); order: 3;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup .ccm__tab-head .ccm__tab-head__icon-wedge > svg { pointer-events: none; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup.ccm__tabgroup--open .ccm__tab-head .ccm__tab-head__icon-wedge { transform:translateY(-50%) rotate(-180deg) }', '#cconsent-modal .ccm__tab-trigger { appearance: none; background: none; display: flex; flex-direction: row; width: 100%; padding:17px 35px 17px 56px; color:#333; font-weight:600; }', '#cconsent-modal .ccm__tab-trigger:focus-visible {box-shadow: 0 0 0 2px ' + window.CookieConsent.config.theme.focusColor + ';}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content {padding:0; margin:0}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup .ccm__tab-content { overflow: hidden; display: none; transition: all .5s ease-out; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup .ccm__tab-content__inner { display: flex; flex-direction: row; padding:25px 35px; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup.ccm__tabgroup--open .ccm__tab-head { background-color:#f9f9f9 }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup.ccm__tabgroup--open .ccm__tab-content { max-height: 900px; display: block; }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose {order:1;}', '@media (max-width: 600px) { #cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup.ccm__tabgroup--open .ccm__tab-content {flex-direction:column} }', '@media (max-width: 600px) { #cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose { margin-bottom:20px; } }', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-component {display:flex; margin-right:35px; align-items:center;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch__status {font-weight:600;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-group {background:none; width:40px; height:20px; margin:0 10px; position:relative;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch__slider {position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; border-radius:10px; -webkit-transition: .4s; transition: .4s; pointer-events: none;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch__slider:before {position: absolute; content: ""; height: 12px; width: 12px; left: 4px; bottom: 4px; background-color: white; border-radius:50%; -webkit-transition: .4s; transition: .4s;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-group[aria-checked="true"] .ccm__switch__slider {background-color: #28A834;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-group:focus-visible {box-shadow: 0 0 0 2px ' + window.CookieConsent.config.theme.focusColor + ';}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-group[aria-checked="true"] .ccm__switch__slider:before {-webkit-transform: translateX(20px); -ms-transform: translateX(20px); transform: translateX(20px);}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__desc {order:2;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content strong {font-size:18px; margin-bottom:10px; line-height:1;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content p {color:#444; margin-bottom:0}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__list:not(:empty) {margin-top:30px;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__list .ccm__list__title {color:#333; font-weight:600;}', '#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__list ul { margin:15px 0; padding-left:15px }', '#cconsent-modal .ccm__footer, #cconsent-init-modal .ccm__footer { padding:35px; background-color:#EFEFEF; text-align:center; display: flex; align-items:center; justify-content:flex-end; }', '#cconsent-modal .ccm__footer button, #cconsent-init-modal .ccm__footer button { line-height:normal; font-size:14px; transition: background-color .5s ease-out; background-color:' + window.CookieConsent.config.theme.modalMainButtonColor + '; color:' + window.CookieConsent.config.theme.modalMainButtonTextColor + '; border:none; padding:13px; min-width:110px; border-radius: 2px; cursor:pointer; height: 100%; }', '#cconsent-modal .ccm__footer button:hover, #cconsent-init-modal .ccm__footer button:hover { background-color:' + Utilities.lightenDarkenColor(window.CookieConsent.config.theme.modalMainButtonColor, -20) + '; }', '#cconsent-modal .ccm__footer button:focus-within, #cconsent-init-modal .ccm__footer button:focus-within { box-shadow: 0 0 0 0.25rem ' + window.CookieConsent.config.theme.focusColor + '; }', '#cconsent-modal .ccm__footer button + button, #cconsent-init-modal .ccm__footer button + button { margin-left: 10px; }'); + } + }, { + key: "buildBar", + value: function buildBar() { + return el('div#cconsent-bar.ccb--hidden', el("div.ccb__wrapper", el('div.ccb__left', el('div.cc-text', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'barMainText'))), el('div.ccb__right', el('div.ccb__button', el('button.ccb__edit', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'barLinkSetting'), { + 'aria-hidden': 'true', + tabindex: '-1' + }), window.CookieConsent.config.showRejectAllButton && el('button.consent-decline', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'barBtnRejectAll'), { + 'aria-hidden': 'true', + tabindex: '-1' + }), el('button.consent-give', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'barBtnAcceptAll'), { + 'aria-hidden': 'true', + tabindex: '-1' + })))), { + role: 'region', + 'aria-label': Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'cookieBarLabel'), + 'aria-hidden': 'true', + tabindex: '-1' + }); + } + }, { + key: "buildModal", + value: function buildModal() { + // Cookie names list middleware + var listCookies = function listCookies(category) { + var list = []; + for (var service in window.CookieConsent.config.services) { + window.CookieConsent.config.services[service].category === category && list.push(window.CookieConsent.config.services[service]); + } + if (list.length) { + var listItems = []; + for (var item in list) { + listItems.push(el('li', Language.getTranslation(list[item], window.CookieConsent.config.language.current, 'name'))); + } + return [el('div.ccm__list', el('span.ccm__list__title', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'modalAffectedSolutions')), el('ul', listItems))]; + } + }; + function modalTabGroups() { + var contentItems = []; + var i = 0; + for (var key in window.CookieConsent.config.categories) { + var tabId = Math.random().toString(16).slice(2); + contentItems.push(el('dl.ccm__tabgroup' + '.' + key + (window.CookieConsent.config.categories[key].checked ? '.checked-5jhk' : ''), { + 'data-category': key + }, el('dt.ccm__tab-head', el('button#ccm__tab-trigger--' + tabId + '.ccm__tab-trigger', el('span.ccm__tab-head__text', Language.getTranslation(window.CookieConsent.config.categories[key], window.CookieConsent.config.language.current, 'name')), el('span.ccm__tab-head__status' + (window.CookieConsent.config.categories[key].checked ? '.ccm__tab-head__status--checked' : '.ccm__tab-head__status--unchecked'), window.CookieConsent.config.categories[key].checked ? '✔' : '×', { + 'aria-label': window.CookieConsent.config.categories[key].checked ? Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'checked') : Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'unchecked') + }), el('span.ccm__tab-head__icon-wedge', el(document.createElementNS("http://www.w3.org/2000/svg", "svg"), { + version: "1.2", + preserveAspectRatio: "none", + viewBox: "0 0 24 24", + class: "icon-wedge-svg", + "data-id": "e9b3c566e8c14cfea38af128759b91a3", + style: "opacity: 1; mix-blend-mode: normal; fill: rgb(51, 51, 51); width: 32px; height: 32px;" + }, el(document.createElementNS("http://www.w3.org/2000/svg", "path"), { + 'xmlns:default': "http://www.w3.org/2000/svg", + class: "icon-wedge-angle-down", + d: "M17.2,9.84c0-0.09-0.04-0.18-0.1-0.24l-0.52-0.52c-0.13-0.13-0.33-0.14-0.47-0.01c0,0-0.01,0.01-0.01,0.01 l-4.1,4.1l-4.09-4.1C7.78,8.94,7.57,8.94,7.44,9.06c0,0-0.01,0.01-0.01,0.01L6.91,9.6c-0.13,0.13-0.14,0.33-0.01,0.47 c0,0,0.01,0.01,0.01,0.01l4.85,4.85c0.13,0.13,0.33,0.14,0.47,0.01c0,0,0.01-0.01,0.01-0.01l4.85-4.85c0.06-0.06,0.1-0.15,0.1-0.24 l0,0H17.2z", + style: "fill: rgb(51, 51, 51);" + }))), { + 'aria-expanded': 'false', + 'aria-controls': 'ccm__tab-content--' + tabId + })), el('dd#ccm__tab-content--' + tabId + '.ccm__tab-content', el('div.ccm__tab-content__inner', el('div.ccm__tab-content__desc', el('strong#ccm__tab-content__title--' + tabId, Language.getTranslation(window.CookieConsent.config.categories[key], window.CookieConsent.config.language.current, 'name'), { + 'aria-label': "".concat(Language.getTranslation(window.CookieConsent.config.categories[key], window.CookieConsent.config.language.current, 'name'), " - tab") + }), el('p', Language.getTranslation(window.CookieConsent.config.categories[key], window.CookieConsent.config.language.current, 'description')), el('div.ccm__list', listCookies(key))), el('div.ccm__tab-content__choose', !window.CookieConsent.config.categories[key].needed && el('div.ccm__switch-component', el('span.ccm__switch__status.status-off', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'off')), el('button.ccm__switch-group', el('span.ccm__switch__text.visually-hide', Language.getTranslation(window.CookieConsent.config.categories[key], window.CookieConsent.config.language.current, 'name')), el('span.ccm__switch__slider'), { + 'role': 'switch', + 'data-category': key, + 'aria-checked': window.CookieConsent.config.categories[key].checked, + 'aria-label': Language.getTranslation(window.CookieConsent.config.categories[key], window.CookieConsent.config.language.current, 'name') + }), el('span.ccm__switch__status.status-on', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'on'))))), { + 'role': 'region', + 'aria-labelledby': 'ccm__tab-trigger--' + tabId, + 'aria-hidden': 'true' + }))); + i++; + } + return contentItems; + } + return el('dialog#cconsent-modal', el('div.ccm__content', el('div.ccm__content__heading', el('strong#ccm__content__title', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'modalMainTitle'), { + 'aria-label': 'Cookie Consent options' + }), el('p', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'modalMainText'), window.CookieConsent.config.modalMainTextMoreLink ? el('a', { + href: window.CookieConsent.config.modalMainTextMoreLink, + target: '_blank', + rel: 'noopener noreferrer' + }, Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'learnMore')) : null), el('button.ccm__cheading__close', '×', { + 'aria-label': Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'closeAriaLabel') + })), el('div.ccm__content__body', el('div.ccm__tabs', modalTabGroups())), el('div.ccm__footer', el('button#ccm__footer__consent-modal-submit', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'modalBtnSave')), window.CookieConsent.config.showRejectAllButton && el('button.consent-decline', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'modalBtnRejectAll')), el('button.consent-give', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'modalBtnAcceptAll')))), { + 'aria-labelledby': 'ccm__content__title', + 'aria-hidden': 'true' + }); + } + }, { + key: "buildInitialModal", + value: function buildInitialModal() { + return el('dialog#cconsent-init-modal', el('div.ccm__content', el('div.ccm__content__heading', el('strong#init__ccm__content__title', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'modalMainTitle'), { + 'aria-label': 'Cookie Consent' + }), el('p', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'modalMainText'), window.CookieConsent.config.modalMainTextMoreLink ? el('a', { + href: window.CookieConsent.config.modalMainTextMoreLink, + target: '_blank', + rel: 'noopener noreferrer' + }, Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'learnMore')) : null)), el('div.ccm__footer', el('button.consent-decline', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'initModalBtnDisagree')), el('button.ccm__edit', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'initModalBtnOptions')), el('button.consent-give', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'initModalBtnAgree')))), { + 'aria-labelledby': 'init__ccm__content__title', + 'aria-hidden': 'true' + }); + } + }, { + key: "modalRedrawIcons", + value: function modalRedrawIcons() { + var tabGroups = this.elements['modal'].querySelectorAll('.ccm__tabgroup'); + var _iterator = Interface_createForOfIteratorHelper(tabGroups), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var tabGroup = _step.value; + var lightSwitch = tabGroup.querySelector('button.ccm__switch-group'); + var tabStatus = tabGroup.querySelector('.ccm__tab-head__status'); + if (window.CookieConsent.config.categories[tabGroup.dataset.category].checked) { + if (!tabGroup.classList.contains('checked-5jhk')) { + tabGroup.classList.add('checked-5jhk'); + lightSwitch.setAttribute('aria-checked', 'true'); + tabStatus.classList.remove('ccm__tab-head__status--unchecked'); + tabStatus.setAttribute('aria-label', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'checked')); + tabStatus.textContent = '✔'; + tabStatus.classList.add('ccm__tab-head__status--checked'); + } + ; + } else { + if (tabGroup.classList.contains('checked-5jhk')) tabGroup.classList.remove('checked-5jhk'); + lightSwitch.setAttribute('aria-checked', 'false'); + tabStatus.setAttribute('aria-label', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'unchecked')); + tabStatus.textContent = '×'; + tabStatus.classList.add('ccm__tab-head__status--unchecked'); + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); } } } @@ -1151,32 +1314,59 @@ class Interface { tabStatus.classList.add('ccm__tab-head__status--unchecked'); } } - } - render(name, elem, callback) { - if (typeof callback === 'undefined') callback = function () {}; - if (typeof this.elements[name] !== 'undefined') { - this.elements[name].parentNode.replaceChild(elem, this.elements[name]); - this.elements[name] = elem; - callback(elem); - return elem; - } else { - var insertedElem = mount(document.body, elem, document.body.firstChild); - if (insertedElem) { - this.elements[name] = insertedElem; - } - callback(insertedElem); - return insertedElem; - } - } - buildInterface(callback) { - if (typeof callback === 'undefined') callback = function () {}; - var that = this; - Utilities.ready(function () { - if (window.CookieConsent.config.noUI) { - that.writeBufferToDOM(); - that.buildCookie(cookie => { - that.setCookie(cookie); - }); + }, { + key: "buildInterface", + value: function buildInterface(callback) { + if (typeof callback === 'undefined') callback = function callback() {}; + var that = this; + Utilities.ready(function () { + if (window.CookieConsent.config.noUI) { + that.writeBufferToDOM(); + that.buildCookie(function (cookie) { + that.setCookie(cookie); + }); + callback(); + return; + } + that.render('style', that.buildStyle()); + + //show the bar only if layout mode is 'bar' + if (window.CookieConsent.config.mode == 'bar') { + that.render('bar', that.buildBar(), function (bar) { + // Show the bar after a while + if (!window.CookieConsent.config.cookieExists) { + setTimeout(function () { + var buttonSettings = bar.querySelector('.ccb__edit'); + var buttonConsentGive = bar.querySelector('.consent-give'); + var buttonConsentDecline = bar.querySelector('.consent-decline'); + bar.classList.remove('ccb--hidden'); + bar.setAttribute('aria-hidden', 'false'); + bar.setAttribute('tabindex', '0'); + buttonSettings.setAttribute('tabindex', '0'); + buttonSettings.setAttribute('aria-hidden', 'false'); + buttonConsentGive.setAttribute('tabindex', '0'); + buttonConsentGive.setAttribute('aria-hidden', 'false'); + buttonConsentDecline !== null && buttonConsentDecline.setAttribute('tabindex', '0'); + buttonConsentDecline !== null && buttonConsentDecline.setAttribute('aria-hidden', 'false'); + }, window.CookieConsent.config.UITimeout); + } + }); + } + that.render('modal', that.buildModal()); + + //show init modal if layout mode is 'modal' + if (window.CookieConsent.config.mode == 'modal') { + that.render('modalInit', that.buildInitialModal(), function (modal) { + if (!window.CookieConsent.config.cookieExists) { + setTimeout(function () { + modal.classList.add('ccm--visible'); + modal.setAttribute('aria-hidden', 'false'); + modal.setAttribute('tabindex', '0'); + modal.querySelector('.ccm__footer').style.justifyContent = 'center'; + }, window.CookieConsent.config.UITimeout); + } + }); + } callback(); return; } @@ -1268,20 +1458,229 @@ class Interface { }); } - // If you click Reject all cookies - var buttonConsentDecline = document.querySelectorAll('.consent-decline'); - for (let button of buttonConsentDecline) { - button.addEventListener('click', () => { - var buttonSettings = document.querySelector('.ccb__edit'); - var buttonConsentGive = document.querySelector('.consent-give'); + // If you click Accept all cookies + var buttonConsentGive = document.querySelectorAll('.consent-give'); + var _iterator2 = Interface_createForOfIteratorHelper(buttonConsentGive), + _step2; + try { + var _loop = function _loop() { + var button = _step2.value; + button.addEventListener('click', function () { + var _this$elements$bar4, _this$elements$bar5, _this$elements$bar6, _this$elements$modalI13, _this$elements$modalI14, _this$elements$modalI15; + var buttonSettings = document.querySelector('.ccb__edit'); + var buttonConsentDecline = document.querySelector('.consent-decline'); + + // We set config to full consent + for (var key in window.CookieConsent.config.categories) { + window.CookieConsent.config.categories[key].wanted = window.CookieConsent.config.categories[key].checked = true; + } + _this.writeBufferToDOM(); + _this.buildCookie(function (cookie) { + _this.setCookie(cookie); + }); + (_this$elements$bar4 = _this.elements['bar']) === null || _this$elements$bar4 === void 0 ? void 0 : _this$elements$bar4.classList.add('ccb--hidden'); + (_this$elements$bar5 = _this.elements['bar']) === null || _this$elements$bar5 === void 0 ? void 0 : _this$elements$bar5.setAttribute('aria-hidden', 'true'); + (_this$elements$bar6 = _this.elements['bar']) === null || _this$elements$bar6 === void 0 ? void 0 : _this$elements$bar6.setAttribute('tabindex', '-1'); + _this.elements['modal'].classList.remove('ccm--visible'); + _this.elements['modal'].setAttribute('aria-hidden', 'true'); + _this.elements['modal'].setAttribute('tabindex', '-1'); + (_this$elements$modalI13 = _this.elements['modalInit']) === null || _this$elements$modalI13 === void 0 ? void 0 : _this$elements$modalI13.classList.remove('ccm--visible'); + (_this$elements$modalI14 = _this.elements['modalInit']) === null || _this$elements$modalI14 === void 0 ? void 0 : _this$elements$modalI14.setAttribute('aria-hidden', 'true'); + (_this$elements$modalI15 = _this.elements['modalInit']) === null || _this$elements$modalI15 === void 0 ? void 0 : _this$elements$modalI15.setAttribute('tabindex', '-1'); + button.setAttribute('tabindex', '-1'); + button.setAttribute('aria-hidden', 'true'); + buttonSettings.setAttribute('tabindex', '-1'); + buttonSettings.setAttribute('aria-hidden', 'true'); + buttonConsentDecline !== null && buttonConsentDecline.setAttribute('tabindex', '-1'); + buttonConsentDecline !== null && buttonConsentDecline.setAttribute('aria-hidden', 'true'); + focusTarget.focus(); + modalOpen = false; + _this.modalRedrawIcons(); + }); + }; + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + _loop(); + } - // We set config to full consent only in is needed - for (let key in window.CookieConsent.config.categories) { - window.CookieConsent.config.categories[key].wanted = window.CookieConsent.config.categories[key].checked = window.CookieConsent.config.categories[key].needed; + // If you click Reject all cookies + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } + var buttonConsentDecline = document.querySelectorAll('.consent-decline'); + var _iterator3 = Interface_createForOfIteratorHelper(buttonConsentDecline), + _step3; + try { + var _loop2 = function _loop2() { + var button = _step3.value; + button.addEventListener('click', function () { + var _this$elements$bar7, _this$elements$bar8, _this$elements$bar9, _this$elements$modalI16, _this$elements$modalI17, _this$elements$modalI18; + var buttonSettings = document.querySelector('.ccb__edit'); + var buttonConsentGive = document.querySelector('.consent-give'); + + // We set config to full consent only in is needed + for (var key in window.CookieConsent.config.categories) { + window.CookieConsent.config.categories[key].wanted = window.CookieConsent.config.categories[key].checked = window.CookieConsent.config.categories[key].needed; + } + _this.writeBufferToDOM(); + _this.buildCookie(function (cookie) { + _this.setCookie(cookie); + }); + (_this$elements$bar7 = _this.elements['bar']) === null || _this$elements$bar7 === void 0 ? void 0 : _this$elements$bar7.classList.add('ccb--hidden'); + (_this$elements$bar8 = _this.elements['bar']) === null || _this$elements$bar8 === void 0 ? void 0 : _this$elements$bar8.setAttribute('aria-hidden', 'true'); + (_this$elements$bar9 = _this.elements['bar']) === null || _this$elements$bar9 === void 0 ? void 0 : _this$elements$bar9.setAttribute('tabindex', '-1'); + _this.elements['modal'].classList.remove('ccm--visible'); + _this.elements['modal'].setAttribute('aria-hidden', 'true'); + _this.elements['modal'].setAttribute('tabindex', '-1'); + (_this$elements$modalI16 = _this.elements['modalInit']) === null || _this$elements$modalI16 === void 0 ? void 0 : _this$elements$modalI16.classList.remove('ccm--visible'); + (_this$elements$modalI17 = _this.elements['modalInit']) === null || _this$elements$modalI17 === void 0 ? void 0 : _this$elements$modalI17.setAttribute('aria-hidden', 'true'); + (_this$elements$modalI18 = _this.elements['modalInit']) === null || _this$elements$modalI18 === void 0 ? void 0 : _this$elements$modalI18.setAttribute('tabindex', '-1'); + button.setAttribute('tabindex', '-1'); + button.setAttribute('aria-hidden', 'true'); + buttonSettings.setAttribute('tabindex', '-1'); + buttonSettings.setAttribute('aria-hidden', 'true'); + buttonConsentGive.setAttribute('tabindex', '-1'); + buttonConsentGive.setAttribute('aria-hidden', 'true'); + focusTarget.focus(); + modalOpen = false; + _this.modalRedrawIcons(); + }); + }; + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + _loop2(); } - this.writeBufferToDOM(); - this.buildCookie(cookie => { - this.setCookie(cookie); + + // If you click Cookie settings and open settings modal + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } + Array.prototype.forEach.call(document.querySelectorAll('.ccm__edit, .ccb__edit'), function (edit) { + edit.addEventListener('click', function () { + var _this$elements$modalI, _this$elements$modalI2, _this$elements$modalI3; + modalOpen = true; + _this.elements['modal'].classList.add('ccm--visible'); + _this.elements['modal'].setAttribute('aria-hidden', 'false'); + _this.elements['modal'].setAttribute('tabindex', '0'); + _this.elements['modal'].querySelector('.ccm__cheading__close').focus(); + (_this$elements$modalI = _this.elements['modalInit']) === null || _this$elements$modalI === void 0 ? void 0 : _this$elements$modalI.classList.remove('ccm--visible'); + (_this$elements$modalI2 = _this.elements['modalInit']) === null || _this$elements$modalI2 === void 0 ? void 0 : _this$elements$modalI2.setAttribute('aria-hidden', 'true'); + (_this$elements$modalI3 = _this.elements['modalInit']) === null || _this$elements$modalI3 === void 0 ? void 0 : _this$elements$modalI3.setAttribute('tabindex', '-1'); + }); + }); + + // If you click trough the tabs on Cookie settings + // If you click on/off switch + this.elements['modal'].querySelector('.ccm__tabs').addEventListener('click', function (event) { + // If you click trough the tabs on Cookie settings + if (event.target.classList.contains('ccm__tab-trigger') || event.target.classList.contains('ccm__tab-head__icon-wedge')) { + var getDlParent = function getDlParent(eventTarget) { + var parent = eventTarget.parentNode; + if (parent.nodeName !== 'DL') { + return getDlParent(parent); + } else { + return parent; + } + }; + var parentDl = getDlParent(event.target); + if (parentDl.classList.contains('ccm__tabgroup--open')) { + parentDl.classList.remove('ccm__tabgroup--open'); + event.target.setAttribute('aria-expanded', 'false'); + parentDl.querySelector('.ccm__tab-content').setAttribute('aria-hidden', 'true'); + } else { + parentDl.classList.add('ccm__tabgroup--open'); + event.target.setAttribute('aria-expanded', 'true'); + parentDl.querySelector('.ccm__tab-content').setAttribute('aria-hidden', 'false'); + } + } + + // If you click on/off switch + if (event.target.classList.contains('ccm__switch-group')) { + var status = event.target.getAttribute('aria-checked'); + var label = event.target.textContent.trim(); + var dl = document.querySelector('.ccm__tabgroup.' + event.target.dataset.category); + var dlStatus = document.querySelector('.ccm__tabgroup.' + event.target.dataset.category + ' .ccm__tab-head__status'); + window.CookieConsent.config.categories[event.target.dataset.category].wanted = window.CookieConsent.config.categories[event.target.dataset.category].checked = status === 'true' ? false : true; + event.target.setAttribute('aria-checked', status !== 'true'); + dl.classList.remove('checked-5jhk'); + dlStatus.classList.remove('ccm__tab-head__status--checked'); + dlStatus.classList.remove('ccm__tab-head__status--unchecked'); + if (status !== 'true') { + event.target.setAttribute('aria-label', label + ' ' + Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'enabled')); + dl.classList.add('checked-5jhk'); + dlStatus.setAttribute('aria-label', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'checked')); + dlStatus.textContent = '✔'; + dlStatus.classList.add('ccm__tab-head__status--checked'); + } else { + event.target.setAttribute('aria-label', label + ' ' + Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'disabled')); + dl.classList.remove('checked-5jhk'); + dlStatus.setAttribute('aria-label', Language.getTranslation(window.CookieConsent.config, window.CookieConsent.config.language.current, 'unchecked')); + dlStatus.textContent = '×'; + dlStatus.classList.add('ccm__tab-head__status--unchecked'); + } + } + }); + + // If you click close on open modal + this.elements['modal'].querySelector('.ccm__cheading__close').addEventListener('click', function (event) { + _this.elements['modal'].classList.remove('ccm--visible'); + _this.elements['modal'].setAttribute('aria-hidden', 'true'); + _this.elements['modal'].setAttribute('tabindex', '-1'); + if (!window.CookieConsent.config.cookieExists) { + var _this$elements$modalI4, _this$elements$modalI5, _this$elements$modalI6; + (_this$elements$modalI4 = _this.elements['modalInit']) === null || _this$elements$modalI4 === void 0 ? void 0 : _this$elements$modalI4.classList.add('ccm--visible'); + (_this$elements$modalI5 = _this.elements['modalInit']) === null || _this$elements$modalI5 === void 0 ? void 0 : _this$elements$modalI5.setAttribute('aria-hidden', 'false'); + (_this$elements$modalI6 = _this.elements['modalInit']) === null || _this$elements$modalI6 === void 0 ? void 0 : _this$elements$modalI6.setAttribute('tabindex', '0'); + } + modalOpen = false; + }); + document.addEventListener('keydown', function (event) { + if (modalOpen && (!event.keyCode || event.keyCode === 27)) { + _this.elements['modal'].classList.remove('ccm--visible'); + _this.elements['modal'].setAttribute('aria-hidden', 'true'); + _this.elements['modal'].setAttribute('tabindex', '-1'); + if (!window.CookieConsent.config.cookieExists) { + var _this$elements$modalI7, _this$elements$modalI8, _this$elements$modalI9; + (_this$elements$modalI7 = _this.elements['modalInit']) === null || _this$elements$modalI7 === void 0 ? void 0 : _this$elements$modalI7.classList.add('ccm--visible'); + (_this$elements$modalI8 = _this.elements['modalInit']) === null || _this$elements$modalI8 === void 0 ? void 0 : _this$elements$modalI8.setAttribute('aria-hidden', 'false'); + (_this$elements$modalI9 = _this.elements['modalInit']) === null || _this$elements$modalI9 === void 0 ? void 0 : _this$elements$modalI9.setAttribute('tabindex', '0'); + } + modalOpen = false; + } + }); + + // If you click submit on cookie settings + document.getElementById('ccm__footer__consent-modal-submit').addEventListener('click', function () { + var switchElements = _this.elements['modal'].querySelectorAll('.ccm__switch input'); + Array.prototype.forEach.call(switchElements, function (switchElement) { + window.CookieConsent.config.categories[switchElement.dataset.category].wanted = switchElement.checked; + }); + var buttonSettings = document.querySelector('.ccb__edit'); + var buttonConsentGive = document.querySelector('.consent-give'); + var buttonConsentDecline = document.querySelector('.consent-decline'); + _this.buildCookie(function (cookie) { + _this.setCookie(cookie, function () { + var _this$elements$modalI10, _this$elements$modalI11, _this$elements$modalI12, _this$elements$bar, _this$elements$bar2, _this$elements$bar3; + _this.elements['modal'].classList.remove('ccm--visible'); + _this.elements['modal'].setAttribute('aria-hidden', 'true'); + _this.elements['modal'].setAttribute('tabindex', '-1'); + (_this$elements$modalI10 = _this.elements['modalInit']) === null || _this$elements$modalI10 === void 0 ? void 0 : _this$elements$modalI10.classList.remove('ccm--visible'); + (_this$elements$modalI11 = _this.elements['modalInit']) === null || _this$elements$modalI11 === void 0 ? void 0 : _this$elements$modalI11.setAttribute('aria-hidden', 'true'); + (_this$elements$modalI12 = _this.elements['modalInit']) === null || _this$elements$modalI12 === void 0 ? void 0 : _this$elements$modalI12.setAttribute('tabindex', '-1'); + (_this$elements$bar = _this.elements['bar']) === null || _this$elements$bar === void 0 ? void 0 : _this$elements$bar.classList.add('ccb--hidden'); + (_this$elements$bar2 = _this.elements['bar']) === null || _this$elements$bar2 === void 0 ? void 0 : _this$elements$bar2.setAttribute('aria-hidden', 'true'); + (_this$elements$bar3 = _this.elements['bar']) === null || _this$elements$bar3 === void 0 ? void 0 : _this$elements$bar3.setAttribute('tabindex', '-1'); + buttonSettings.setAttribute('tabindex', '-1'); + buttonSettings.setAttribute('aria-hidden', 'true'); + buttonConsentGive.setAttribute('tabindex', '-1'); + buttonConsentGive.setAttribute('aria-hidden', 'true'); + buttonConsentDecline !== null && buttonConsentDecline.setAttribute('tabindex', '-1'); + buttonConsentDecline !== null && buttonConsentDecline.setAttribute('aria-hidden', 'true'); + focusTarget.focus(); + modalOpen = false; + }); }); this.elements['bar']?.classList.add('ccb--hidden'); this.elements['bar']?.setAttribute('aria-hidden', 'true'); diff --git a/build/cookieconsent.min.js b/build/cookieconsent.min.js index fcac76b..f711d92 100644 --- a/build/cookieconsent.min.js +++ b/build/cookieconsent.min.js @@ -1 +1 @@ -(()=>{"use strict";class e{static ready(e){(document.attachEvent?"complete"===document.readyState:"loading"!==document.readyState)?e():document.addEventListener("DOMContentLoaded",e)}static objectType(e){return Object.prototype.toString.call(e).slice(8,-1)}static lightenDarkenColor(e,t){var o=!1;"#"==e[0]&&(e=e.slice(1),o=!0);var n=parseInt(e,16),i=(n>>16)+t;i>255?i=255:i<0&&(i=0);var c=(n>>8&255)+t;c>255?c=255:c<0&&(c=0);var a=(255&n)+t;return a>255?a=255:a<0&&(a=0),(o?"#":"")+(a|c<<8|i<<16).toString(16)}static removeCookie(){document.cookie="cconsent=; expires=Thu, 01 Jan 1980 00:00:00 UTC; path=/;",localStorage.removeItem("consentMode"),window.CookieConsent.config.cookieExists=!1}static listGlobalServices(e){let t=[];if(void 0===window.CookieConsent)return t;if(void 0===e)for(let e in window.CookieConsent.config.services)t.push(e);else for(let o in window.CookieConsent.config.services)window.CookieConsent.config.services[o].category===e&&t.push(o);return t}static dispatchEvent(e,t){"function"==typeof Event?t=new Event(t):(t=document.createEvent("Event")).initEvent(t,!0,!0),e.dispatchEvent(t)}}class t{createBlacklist(t){var o={};for(var n in window.CookieConsent.config.services)window.CookieConsent.config.services[n].type===t&&!1===window.CookieConsent.config.categories[window.CookieConsent.config.services[n].category].needed&&!1===window.CookieConsent.config.categories[window.CookieConsent.config.services[n].category].wanted&&(o[n]=window.CookieConsent.config.services[n]);var i=[];for(var n in o){if("String"===(t=e.objectType(o[n].search)))i.push(o[n].search);else if("Array"===t)for(let e=0;e=0&&!1===window.CookieConsent.config.categories[window.CookieConsent.config.services[e].category].wanted)return void window.CookieConsent.buffer.appendChild.push({this:this,category:window.CookieConsent.config.services[e].category,arguments});return Node.prototype.appendChild.apply(this,arguments)}}overrideInsertBefore(){Element.prototype.insertBefore=function(e){if("SCRIPT"===arguments[0].tagName)for(let e in window.CookieConsent.config.services)if("dynamic-script"===window.CookieConsent.config.services[e].type&&arguments[0].outerHTML.indexOf(window.CookieConsent.config.services[e].search)>=0&&!1===window.CookieConsent.config.categories[window.CookieConsent.config.services[e].category].wanted)return void window.CookieConsent.buffer.insertBefore.push({this:this,category:window.CookieConsent.config.services[e].category,arguments});return Node.prototype.insertBefore.apply(this,arguments)}}}class n extends t{constructor(){super()}init(){this.filterTags()}filterTags(){e.ready((()=>{var e=super.createBlacklist("script-tag"),t=document.querySelectorAll('script[type="text/plain"]');for(var o of t)if(e.indexOf(o.dataset.consent)<0){var n=document.createElement("script"),i=o.parentNode;for(var c of(o.type="text/javascript",o.attributes))n.setAttribute(c.nodeName,c.nodeValue);n.innerHTML=o.innerHTML,i.insertBefore(n,o),i.removeChild(o)}}))}}class i extends t{constructor(){super()}init(){this.filterWrappers()}filterWrappers(){var e=super.createBlacklist("wrapped");window.CookieConsent.wrapper=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;e.indexOf(t)<0&&o()}}}class c extends t{constructor(){super()}init(){this.filterlocalCookies()}getCookieDescriptor(){var e;return(e=Object.getOwnPropertyDescriptor(document,"cookie")||Object.getOwnPropertyDescriptor(HTMLDocument.prototype,"cookie"))||((e={}).get=HTMLDocument.prototype.__lookupGetter__("cookie"),e.set=HTMLDocument.prototype.__lookupSetter__("cookie")),e}filterlocalCookies(){var e=super.createBlacklist("localcookie"),t=this.getCookieDescriptor();Object.defineProperty(document,"cookie",{configurable:!0,get:function(){return t.get.apply(document)},set:function(){var o=arguments;if(e.length){var n=arguments[0].split("=")[0];Array.prototype.forEach.call(e,(function(e){n.indexOf(e)<0&&t.set.apply(document,o)}))}else t.set.apply(document,o)}})}}function a(e,t){var o=function(e){for(var t=e.split(/([#.])/),o="",n="",i=[],c=0;c0;)o[n]=arguments[n+1];var i=typeof e;if("string"===i)t=S(e).cloneNode(!1);else if(y(e))t=e.cloneNode(!1);else{if("function"!==i)throw new Error("At least one argument required");var c=e;t=new(Function.prototype.bind.apply(c,[null].concat(o)))}return p(v(t),o,!0),t}var T=A;function S(e){return x[e]||(x[e]=a(e))}function M(e){for(var t=[],o=arguments.length-1;o-- >0;)t[o]=arguments[o+1];for(var n=L(e,t,v(e).firstChild);n;){var i=n.nextSibling;r(e,n),n=i}}function L(e,t,o){for(var n=o,i=new Array(t.length),c=0;c0;)t[o]=arguments[o+1];var n=S(e);return A.bind.apply(A,[this,n].concat(t))};var B=function(e,t,o){this.View=e,this.initData=o,this.oldLookup={},this.lookup={},this.oldViews=[],this.views=[],null!=t&&(this.key="function"==typeof t?t:function(e){return function(t){return t[e]}}(t))};B.prototype.update=function(e,t){for(var o=this,n=o.View,i=o.key,c=o.initData,a=null!=i,r=this.lookup,s={},d=new Array(e.length),l=this.views,_=0;_0;)o[n]=arguments[n+1];var i=typeof e;if("string"===i)t=D(e).cloneNode(!1);else if(y(e))t=e.cloneNode(!1);else{if("function"!==i)throw new Error("At least one argument required");var c=e;t=new(Function.prototype.bind.apply(c,[null].concat(o)))}return p(v(t),o,!0),t}function D(e){return I[e]||(I[e]=a(e,N))}O.extend=function(e){var t=D(e);return O.bind(this,t)},O.ns=N;class q{setLocale(e){window.CookieConsent.config.language.current=e}static getTranslation(e,t,o){var n;return e.hasOwnProperty("language")?e.language.hasOwnProperty("locale")?(n=e.language.locale.hasOwnProperty(t)?t:"en",e.language.locale[n].hasOwnProperty(o)?e.language.locale[n][o]:"[Missing translation]"):"[Missing locale object]":"[Missing language object]"}}class F{constructor(){this.elements={}}buildStyle(){return T("style","#cconsent-bar, #cconsent-bar * { box-sizing:border-box }","#cconsent-bar .visually-hide, #cconsent-modal .visually-hide { position: absolute !important; overflow: hidden !important; clip-path: rect(1px 1px 1px 1px) !important; width: 1px !important; height: 1px !important; }","#cconsent-bar { background-color:"+window.CookieConsent.config.theme.barColor+"; color:"+window.CookieConsent.config.theme.barTextColor+"; padding:15px; text-align:right; font-family:inherit; font-size:14px; line-height:18px; position:fixed; bottom:0; inset-inline:0; z-index:9998; transform: translateY(0); transition: transform .6s ease-in-out; transition-delay: .3s;}","#cconsent-bar.ccb--hidden {transform: translateY(100%); display:block; visible:hidden;}","#cconsent-bar .ccb__wrapper { display:flex; flex-wrap:wrap; justify-content:space-between; max-width:1800px; margin:0 auto;}","#cconsent-bar .ccb__left { align-self:center; text-align:left; margin: 15px 0;}","#cconsent-bar .ccb__right { align-self:center; white-space: nowrap;}","#cconsent-bar .ccb__right > div {display:inline-block; color:#FFF;}","#cconsent-bar button { line-height:normal; font-size:14px; border:0; padding:10px 10px; color:"+window.CookieConsent.config.theme.barMainButtonTextColor+"; background-color:"+window.CookieConsent.config.theme.barMainButtonColor+";}","#cconsent-bar button.consent-give { line-height:normal; font-size:14px; border:none; padding:10px 10px; color:"+window.CookieConsent.config.theme.barMainButtonTextColor+"; background-color:"+window.CookieConsent.config.theme.barMainButtonColor+";}","#cconsent-bar button.consent-decline { line-height:normal; font-size:14px; border:none; padding:10px 10px; color:"+window.CookieConsent.config.theme.barMainButtonColor+"; background-color:"+window.CookieConsent.config.theme.barMainButtonTextColor+"; margin-right: 10px; border: 1px solid "+window.CookieConsent.config.theme.barMainButtonColor+"}","#cconsent-bar button.ccb__edit { appearance:none; margin-right:15px; border:0; padding:0; text-decoration:underline; color:"+window.CookieConsent.config.theme.barTextColor+"; background:none; }","#cconsent-bar a:hover, #cconsent-bar button:hover { cursor:pointer; }","#cconsent-modal, #cconsent-init-modal { display:none; font-size:14px; line-height:18px; color:#666; width: 100vw; height: 100vh; position:fixed; left:0; top:0; right:0; bottom:0; font-family:inherit; font-size:14px; background-color:rgba(0,0,0,0.6); z-index:9999; align-items:center; justify-content:center;}","@media (max-width: 600px) { #cconsent-modal, #cconsent-init-modal { height: 100% } }","#cconsent-modal button, #cconsent-init-modal button { border: 0 }","#cconsent-modal h2, #cconsent-init-modal h2, #cconsent-modal h3, #cconsent-init-modal h3 {color:#333; margin-top:0}","#cconsent-modal.ccm--visible, #cconsent-init-modal.ccm--visible {display:flex}","#cconsent-modal .ccm__content, #cconsent-init-modal .ccm__content { max-width:600px; max-height:600px; overflow-Y:auto; background-color:#EFEFEF; display:flex; flex-direction:column; justify-content:space-between; }","@media (max-width: 600px) { #cconsent-modal .ccm__content, #cconsent-init-modal .ccm__content { max-width:100vw; height:100%; max-height:initial; }}","#cconsent-modal .ccm__content > .ccm__content__heading, #cconsent-init-modal .ccm__content > .ccm__content__heading { border-bottom:1px solid #D8D8D8; padding:35px 35px 20px; background-color:#EFEFEF; position:relative; }","#cconsent-modal .ccm__content > .ccm__content__heading h2, #cconsent-init-modal .ccm__content > .ccm__content__heading h2 { font-size:21px; font-weight:600; color:#333; margin:0 }","#cconsent-modal .ccm__content > .ccm__content__heading p, #cconsent-init-modal .ccm__content > .ccm__content__heading p { margin-top:1rem; margin-bottom:1rem; }","#cconsent-modal .ccm__content > .ccm__content__heading .ccm__cheading__close, #cconsent-init-modal .ccm__content > .ccm__content__heading .ccm__cheading__close { appearance:none; padding:0; border:0; font-weight:600; color:#888; cursor:pointer; font-size:26px; position:absolute; right:15px; top:15px; width:26px; height:26px; background:none; text-align:center; }","#cconsent-modal .ccm__content > .ccm__content__heading .ccm__cheading__close:focus-visible, #cconsent-init-modal .ccm__content > .ccm__content__heading .ccm__cheading__close:focus-visible { box-shadow: 0 0 0 0.25rem "+window.CookieConsent.config.theme.focusColor+"; }","#cconsent-modal .ccm__content > .ccm__content__body { background-color:#FFF; }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup { margin:0; border-bottom: 1px solid #D8D8D8; }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head {color:#333; font-weight:600; cursor:pointer; position:relative; padding:0; margin:0; transition: background-color .5s ease-out; }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head:hover { background-color:#F9F9F9 }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head__status { order: 1; position:absolute; left:35px; font-weight: 600; display:inline-block; margin-right: 20px; pointer-events: none; }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head__status.ccm__tab-head__status--checked { font-size:1em; color:#28a834; }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head__status.ccm__tab-head__status--unchecked { font-size:1.4em; color:#e56385; }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-head__text { order: 2; pointer-events: none; }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup .ccm__tab-head .ccm__tab-head__icon-wedge { transition: transform .3s ease-out; transform-origin: center; position:absolute;right:25px; top:50%; transform:rotate(0deg); transform:translateY(-50%); order: 3;}","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup .ccm__tab-head .ccm__tab-head__icon-wedge > svg { pointer-events: none; }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup.ccm__tabgroup--open .ccm__tab-head .ccm__tab-head__icon-wedge { transform:translateY(-50%) rotate(-180deg) }","#cconsent-modal .ccm__tab-trigger { appearance: none; background: none; display: flex; flex-direction: row; width: 100%; padding:17px 35px 17px 56px; color:#333; font-weight:600; }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content {padding:0; margin:0}","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup .ccm__tab-content { max-height: 0; overflow: hidden; opacity: 0; transition: all .5s ease-out; }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup .ccm__tab-content__inner { display: flex; flex-direction: row; padding:25px 35px; }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup.ccm__tabgroup--open .ccm__tab-head { background-color:#f9f9f9 }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup.ccm__tabgroup--open .ccm__tab-content { max-height: 900px; opacity: 1; }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose {order:1;}","@media (max-width: 600px) { #cconsent-modal .ccm__content > .ccm__content__body .ccm__tabgroup.ccm__tabgroup--open .ccm__tab-content {flex-direction:column} }","@media (max-width: 600px) { #cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose { margin-bottom:20px; } }","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-component {display:flex; margin-right:35px; align-items:center;}","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch__status {font-weight:600;}","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-group {background:none; width:40px; height:20px; margin:0 10px; position:relative;}","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch__slider {position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; border-radius:10px; transition: .4s; pointer-events: none;}",'#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch__slider:before {position: absolute; content: ""; height: 12px; width: 12px; left: 4px; bottom: 4px; background-color: white; border-radius:50%; transition: .4s;}','#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-group[aria-checked="true"] .ccm__switch__slider {background-color: #28A834;}',"#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-group:focus-visible {box-shadow: 0 0 0 2px"+window.CookieConsent.config.theme.focusColor+";}",'#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__choose .ccm__switch-group[aria-checked="true"] .ccm__switch__slider:before {transform: translateX(20px);}',"#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__tab-content__desc {order:2;}","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content h3 {font-size:18px; margin-bottom:10px; line-height:1;}","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content p {color:#444; margin-bottom:0}","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__list:not(:empty) {margin-top:30px;}","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__list .ccm__list__title {color:#333; font-weight:600;}","#cconsent-modal .ccm__content > .ccm__content__body .ccm__tab-content .ccm__list ul { margin:15px 0; padding-left:15px }","#cconsent-modal .ccm__footer, #cconsent-init-modal .ccm__footer { padding:35px; background-color:#EFEFEF; text-align:center; display: flex; align-items:center; justify-content:flex-end; }","#cconsent-modal .ccm__footer button, #cconsent-init-modal .ccm__footer button { line-height:normal; font-size:14px; transition: background-color .5s ease-out; background-color:"+window.CookieConsent.config.theme.modalMainButtonColor+"; color:"+window.CookieConsent.config.theme.modalMainButtonTextColor+"; border:none; padding:13px; min-width:110px; border-radius: 2px; cursor:pointer; height: 100%; }","#cconsent-modal .ccm__footer button:hover, #cconsent-init-modal .ccm__footer button:hover { background-color:"+e.lightenDarkenColor(window.CookieConsent.config.theme.modalMainButtonColor,-20)+"; }","#cconsent-modal .ccm__footer button + button, #cconsent-init-modal .ccm__footer button + button { margin-left: 10px; }")}injectCustomStyles(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const o=document.createElement("style");if(o.appendChild(document.createTextNode(e)),t)document.head.appendChild(o);else{let e=document.body.getElementsByTagName("style");e.length&&e[0].insertAdjacentElement("afterend",o)}}buildBar(){return T("div#cconsent-bar.ccb--hidden",T("div.ccb__wrapper",T("div.ccb__left",T("div.cc-text",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"barMainText"))),T("div.ccb__right",T("div.ccb__button",T("button.ccb__edit",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"barLinkSetting"),{"aria-hidden":"true",tabindex:"-1"}),window.CookieConsent.config.showRejectAllButton&&T("button.consent-decline",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"barBtnRejectAll"),{"aria-hidden":"true",tabindex:"-1"}),T("button.consent-give",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"barBtnAcceptAll"),{"aria-hidden":"true",tabindex:"-1"})))),{role:"region","aria-label":q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"cookieBarLabel"),"aria-hidden":"true",tabindex:"-1"})}buildModal(){var e=function(e){var t=[];for(let o in window.CookieConsent.config.services)window.CookieConsent.config.services[o].category===e&&t.push(window.CookieConsent.config.services[o]);if(t.length){var o=[];for(let e in t)o.push(T("li",q.getTranslation(t[e],window.CookieConsent.config.language.current,"name")));return[T("div.ccm__list",T("span.ccm__list__title",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"modalAffectedSolutions")),T("ul",o))]}};return T("dialog#cconsent-modal",T("div.ccm__content",T("div.ccm__content__heading",T("h2#ccm__content__title",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"modalMainTitle")),T("p",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"modalMainText"),window.CookieConsent.config.modalMainTextMoreLink?T("a",{href:window.CookieConsent.config.modalMainTextMoreLink,target:"_blank",rel:"noopener noreferrer"},q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"learnMore")):null),T("button.ccm__cheading__close","×",{"aria-label":q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"closeAriaLabel")})),T("div.ccm__content__body",T("div.ccm__tabs",function(){let t=[];for(let o in window.CookieConsent.config.categories){let n=Math.random().toString(16).slice(2);t.push(T("dl.ccm__tabgroup."+o+(window.CookieConsent.config.categories[o].checked?".checked-5jhk":""),{"data-category":o},T("dt.ccm__tab-head",T("button#ccm__tab-trigger--"+n+".ccm__tab-trigger",T("span.ccm__tab-head__text",q.getTranslation(window.CookieConsent.config.categories[o],window.CookieConsent.config.language.current,"name")),T("span.ccm__tab-head__status"+(window.CookieConsent.config.categories[o].checked?".ccm__tab-head__status--checked":".ccm__tab-head__status--unchecked"),window.CookieConsent.config.categories[o].checked?"✔":"×",{"aria-label":window.CookieConsent.config.categories[o].checked?q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"checked"):q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"unchecked")}),T("span.ccm__tab-head__icon-wedge",T(document.createElementNS("http://www.w3.org/2000/svg","svg"),{version:"1.2",preserveAspectRatio:"none",viewBox:"0 0 24 24",class:"icon-wedge-svg","data-id":"e9b3c566e8c14cfea38af128759b91a3",style:"opacity: 1; mix-blend-mode: normal; fill: rgb(51, 51, 51); width: 32px; height: 32px;"},T(document.createElementNS("http://www.w3.org/2000/svg","path"),{"xmlns:default":"http://www.w3.org/2000/svg",class:"icon-wedge-angle-down",d:"M17.2,9.84c0-0.09-0.04-0.18-0.1-0.24l-0.52-0.52c-0.13-0.13-0.33-0.14-0.47-0.01c0,0-0.01,0.01-0.01,0.01 l-4.1,4.1l-4.09-4.1C7.78,8.94,7.57,8.94,7.44,9.06c0,0-0.01,0.01-0.01,0.01L6.91,9.6c-0.13,0.13-0.14,0.33-0.01,0.47 c0,0,0.01,0.01,0.01,0.01l4.85,4.85c0.13,0.13,0.33,0.14,0.47,0.01c0,0,0.01-0.01,0.01-0.01l4.85-4.85c0.06-0.06,0.1-0.15,0.1-0.24 l0,0H17.2z",style:"fill: rgb(51, 51, 51);"}))),{"aria-expanded":"false","aria-controls":"ccm__tab-content--"+n})),T("dd#ccm__tab-content--"+n+".ccm__tab-content",T("div.ccm__tab-content__inner",T("div.ccm__tab-content__desc",T("h3#ccm__tab-content__title--"+n,q.getTranslation(window.CookieConsent.config.categories[o],window.CookieConsent.config.language.current,"name")),T("p",q.getTranslation(window.CookieConsent.config.categories[o],window.CookieConsent.config.language.current,"description")),T("div.ccm__list",e(o))),T("div.ccm__tab-content__choose",!window.CookieConsent.config.categories[o].needed&&T("div.ccm__switch-component",T("span.ccm__switch__status.status-off",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"off")),T("button.ccm__switch-group",T("span.ccm__switch__text.visually-hide",q.getTranslation(window.CookieConsent.config.categories[o],window.CookieConsent.config.language.current,"name")),T("span.ccm__switch__slider"),{role:"switch","data-category":o,"aria-checked":window.CookieConsent.config.categories[o].checked,"aria-label":q.getTranslation(window.CookieConsent.config.categories[o],window.CookieConsent.config.language.current,"name")}),T("span.ccm__switch__status.status-on",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"on"))))),{role:"region","aria-labelledby":"ccm__tab-trigger--"+n,"aria-hidden":"true"})))}return t}())),T("div.ccm__footer",T("button#ccm__footer__consent-modal-submit",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"modalBtnSave")),window.CookieConsent.config.showRejectAllButton&&T("button.consent-decline",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"modalBtnRejectAll")),T("button.consent-give",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"modalBtnAcceptAll")))),{"aria-labelledby":"ccm__content__title","aria-hidden":"true"})}buildInitialModal(){return T("dialog#cconsent-init-modal",T("div.ccm__content",T("div.ccm__content__heading",T("h2#init__ccm__content__title",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"modalMainTitle")),T("p",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"modalMainText"),window.CookieConsent.config.modalMainTextMoreLink?T("a",{href:window.CookieConsent.config.modalMainTextMoreLink,target:"_blank",rel:"noopener noreferrer"},q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"learnMore")):null)),T("div.ccm__footer",T("button.consent-decline",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"initModalBtnDisagree")),T("button.ccm__edit",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"initModalBtnOptions")),T("button.consent-give",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"initModalBtnAgree")))),{"aria-labelledby":"init__ccm__content__title","aria-hidden":"true"})}modalRedrawIcons(){var e=this.elements.modal.querySelectorAll(".ccm__tabgroup");for(let n of e){var t=n.querySelector("button.ccm__switch-group"),o=n.querySelector(".ccm__tab-head__status");window.CookieConsent.config.categories[n.dataset.category].checked?n.classList.contains("checked-5jhk")||(n.classList.add("checked-5jhk"),t.setAttribute("aria-checked","true"),o.classList.remove("ccm__tab-head__status--unchecked"),o.setAttribute("aria-label",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"checked")),o.textContent="✔",o.classList.add("ccm__tab-head__status--checked")):(n.classList.contains("checked-5jhk")&&n.classList.remove("checked-5jhk"),t.setAttribute("aria-checked","false"),o.setAttribute("aria-label",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"unchecked")),o.textContent="×",o.classList.add("ccm__tab-head__status--unchecked"))}}render(e,t,o){if(void 0===o&&(o=function(){}),void 0!==this.elements[e])return this.elements[e].parentNode.replaceChild(t,this.elements[e]),this.elements[e]=t,o(t),t;var n=m(document.body,t,document.body.firstChild);return n&&(this.elements[e]=n),o(n),n}buildInterface(t){void 0===t&&(t=function(){});var o=this;e.ready((function(){if(window.CookieConsent.config.noUI)return o.writeBufferToDOM(),o.buildCookie((e=>{o.setCookie(e)})),void t();window.CookieConsent.config.fullCSSOverride?o.injectCustomStyles(window.CookieConsent.config.fullCSSOverride,!0):(o.render("style",o.buildStyle()),window.CookieConsent.config.customCSS&&o.injectCustomStyles(window.CookieConsent.config.customCSS)),"bar"==window.CookieConsent.config.mode&&o.render("bar",o.buildBar(),(e=>{window.CookieConsent.config.cookieExists||setTimeout((()=>{var t=e.querySelector(".ccb__edit"),o=e.querySelector(".consent-give"),n=e.querySelector(".consent-decline");e.classList.remove("ccb--hidden"),e.setAttribute("aria-hidden","false"),e.setAttribute("tabindex","0"),t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","false"),o.setAttribute("tabindex","0"),o.setAttribute("aria-hidden","false"),null!==n??n.setAttribute("tabindex","0"),null!==n??n.setAttribute("aria-hidden","false")}),window.CookieConsent.config.UITimeout)})),o.render("modal",o.buildModal()),"modal"==window.CookieConsent.config.mode&&o.render("modalInit",o.buildInitialModal(),(e=>{window.CookieConsent.config.cookieExists||setTimeout((()=>{e.classList.add("ccm--visible"),e.setAttribute("aria-hidden","false"),e.setAttribute("tabindex","0"),e.querySelector(".ccm__footer").style.justifyContent="center"}),window.CookieConsent.config.UITimeout)})),t()}))}addEventListeners(e){var t=!1,o=document.querySelector("body"),n=document.querySelectorAll(".consent-give");for(let e of n)e.addEventListener("click",(()=>{var n=document.querySelector(".ccb__edit"),i=document.querySelector(".consent-decline");for(let e in window.CookieConsent.config.categories)window.CookieConsent.config.categories[e].wanted=window.CookieConsent.config.categories[e].checked=!0;this.writeBufferToDOM(),this.buildCookie((e=>{this.setCookie(e)})),this.elements.bar?.classList.add("ccb--hidden"),this.elements.bar?.setAttribute("aria-hidden","true"),this.elements.bar?.setAttribute("tabindex","-1"),this.elements.modal.classList.remove("ccm--visible"),this.elements.modal.setAttribute("aria-hidden","true"),this.elements.modal.setAttribute("tabindex","-1"),this.elements.modalInit?.classList.remove("ccm--visible"),this.elements.modalInit?.setAttribute("aria-hidden","true"),this.elements.modalInit?.setAttribute("tabindex","-1"),e.setAttribute("tabindex","-1"),e.setAttribute("aria-hidden","true"),n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),null!==i??i.setAttribute("tabindex","-1"),null!==i??i.setAttribute("aria-hidden","true"),o.focus(),t=!1,this.modalRedrawIcons()}));var i=document.querySelectorAll(".consent-decline");for(let e of i)e.addEventListener("click",(()=>{var n=document.querySelector(".ccb__edit"),i=document.querySelector(".consent-give");for(let e in window.CookieConsent.config.categories)window.CookieConsent.config.categories[e].wanted=window.CookieConsent.config.categories[e].checked=window.CookieConsent.config.categories[e].needed;this.writeBufferToDOM(),this.buildCookie((e=>{this.setCookie(e)})),this.elements.bar?.classList.add("ccb--hidden"),this.elements.bar?.setAttribute("aria-hidden","true"),this.elements.bar?.setAttribute("tabindex","-1"),this.elements.modal.classList.remove("ccm--visible"),this.elements.modal.setAttribute("aria-hidden","true"),this.elements.modal.setAttribute("tabindex","-1"),this.elements.modalInit?.classList.remove("ccm--visible"),this.elements.modalInit?.setAttribute("aria-hidden","true"),this.elements.modalInit?.setAttribute("tabindex","-1"),e.setAttribute("tabindex","-1"),e.setAttribute("aria-hidden","true"),n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),o.focus(),t=!1,this.modalRedrawIcons()}));Array.prototype.forEach.call(document.querySelectorAll(".ccm__edit, .ccb__edit"),(e=>{e.addEventListener("click",(()=>{t=!0,this.elements.modal.classList.add("ccm--visible"),this.elements.modal.setAttribute("aria-hidden","false"),this.elements.modal.setAttribute("tabindex","0"),this.elements.modal.querySelector(".ccm__cheading__close").focus(),this.elements.modalInit?.classList.remove("ccm--visible"),this.elements.modalInit?.setAttribute("aria-hidden","true"),this.elements.modalInit?.setAttribute("tabindex","-1")}))})),this.elements.modal.querySelector(".ccm__tabs").addEventListener("click",(e=>{if(e.target.classList.contains("ccm__tab-trigger")||e.target.classList.contains("ccm__tab-head__icon-wedge")){function a(e){var t=e.parentNode;return"DL"!==t.nodeName?a(t):t}var t=a(e.target);t.classList.contains("ccm__tabgroup--open")?(t.classList.remove("ccm__tabgroup--open"),e.target.setAttribute("aria-expanded","false"),t.querySelector(".ccm__tab-content").setAttribute("aria-hidden","true")):(t.classList.add("ccm__tabgroup--open"),e.target.setAttribute("aria-expanded","true"),t.querySelector(".ccm__tab-content").setAttribute("aria-hidden","false"))}if(e.target.classList.contains("ccm__switch-group")){var o=e.target.getAttribute("aria-checked"),n=e.target.textContent.trim(),i=document.querySelector(".ccm__tabgroup."+e.target.dataset.category),c=document.querySelector(".ccm__tabgroup."+e.target.dataset.category+" .ccm__tab-head__status");window.CookieConsent.config.categories[e.target.dataset.category].wanted=window.CookieConsent.config.categories[e.target.dataset.category].checked="true"!==o,e.target.setAttribute("aria-checked","true"!==o),i.classList.remove("checked-5jhk"),c.classList.remove("ccm__tab-head__status--checked"),c.classList.remove("ccm__tab-head__status--unchecked"),"true"!==o?(e.target.setAttribute("aria-label",n+" "+q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"enabled")),i.classList.add("checked-5jhk"),c.setAttribute("aria-label",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"checked")),c.textContent="✔",c.classList.add("ccm__tab-head__status--checked")):(e.target.setAttribute("aria-label",n+" "+q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"disabled")),i.classList.remove("checked-5jhk"),c.setAttribute("aria-label",q.getTranslation(window.CookieConsent.config,window.CookieConsent.config.language.current,"unchecked")),c.textContent="×",c.classList.add("ccm__tab-head__status--unchecked"))}})),this.elements.modal.querySelector(".ccm__cheading__close").addEventListener("click",(e=>{this.elements.modal.classList.remove("ccm--visible"),this.elements.modal.setAttribute("aria-hidden","true"),this.elements.modal.setAttribute("tabindex","-1"),window.CookieConsent.config.cookieExists||(this.elements.modalInit?.classList.add("ccm--visible"),this.elements.modalInit?.setAttribute("aria-hidden","false"),this.elements.modalInit?.setAttribute("tabindex","0")),t=!1})),document.addEventListener("keydown",(e=>{!t||e.keyCode&&27!==e.keyCode||(this.elements.modal.classList.remove("ccm--visible"),this.elements.modal.setAttribute("aria-hidden","true"),this.elements.modal.setAttribute("tabindex","-1"),window.CookieConsent.config.cookieExists||(this.elements.modalInit?.classList.add("ccm--visible"),this.elements.modalInit?.setAttribute("aria-hidden","false"),this.elements.modalInit?.setAttribute("tabindex","0")),t=!1)})),document.getElementById("ccm__footer__consent-modal-submit").addEventListener("click",(()=>{let e=this.elements.modal.querySelectorAll(".ccm__switch input");Array.prototype.forEach.call(e,(e=>{window.CookieConsent.config.categories[e.dataset.category].wanted=e.checked}));var n=document.querySelector(".ccb__edit"),i=document.querySelector(".consent-give"),c=document.querySelector(".consent-decline");this.buildCookie((e=>{this.setCookie(e,(()=>{this.elements.modal.classList.remove("ccm--visible"),this.elements.modal.setAttribute("aria-hidden","true"),this.elements.modal.setAttribute("tabindex","-1"),this.elements.modalInit?.classList.remove("ccm--visible"),this.elements.modalInit?.setAttribute("aria-hidden","true"),this.elements.modalInit?.setAttribute("tabindex","-1"),this.elements.bar?.classList.add("ccb--hidden"),this.elements.bar?.setAttribute("aria-hidden","true"),this.elements.bar?.setAttribute("tabindex","-1"),n.setAttribute("tabindex","-1"),n.setAttribute("aria-hidden","true"),i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),null!==c??c.setAttribute("tabindex","-1"),null!==c??c.setAttribute("aria-hidden","true"),o.focus(),t=!1}))})),this.writeBufferToDOM()}))}writeBufferToDOM(){for(let e of window.CookieConsent.buffer.appendChild)!0===window.CookieConsent.config.categories[e.category].wanted&&Node.prototype.appendChild.apply(e.this,e.arguments);for(let e of window.CookieConsent.buffer.insertBefore)!0===window.CookieConsent.config.categories[e.category].wanted&&(e.arguments[1]=null===e.arguments[0].parentNode?e.this.lastChild:e.arguments[1],Node.prototype.insertBefore.apply(e.this,e.arguments))}updateConsentMode(e){if(window.dataLayer||!1){function t(){dataLayer.push(arguments)}t("consent","update",e.consentMode),localStorage.setItem("consentMode",JSON.stringify(e.consentMode))}}buildCookie(t){let o={version:window.CookieConsent.config.cookieVersion,categories:{},services:[],consentMode:{}};for(let e in window.CookieConsent.config.categories)o.categories[e]={wanted:window.CookieConsent.config.categories[e].wanted};for(let e in window.CookieConsent.config.consentModeControls)o.consentMode[e]=window.CookieConsent.config.categories[window.CookieConsent.config.consentModeControls[e]]?.wanted?"granted":"denied";return o.services=e.listGlobalServices(),this.updateConsentMode(o),t&&t(o),o}setCookie(e,t){const o=new Date(Date.now()+31536e6).toUTCString();document.cookie=`cconsent=${JSON.stringify(e)}; expires=${o}; path=/;`,window.CookieConsent.config.cookieExists=!0,t&&t()}}class R{constructor(e){window.CookieConsent.buffer={appendChild:[],insertBefore:[]},window.CookieConsent.wrapper=function(){},window.CookieConsent.setConfiguration=this.setConfiguration.bind(this),window.CookieConsent.config={active:!0,cookieExists:!1,cookieVersion:1,mode:"bar",modalMainTextMoreLink:null,showRejectAllButton:!1,UITimeout:1e3,noUI:!1,theme:{barColor:"#2b7abb",barTextColor:"#fff",barMainButtonColor:"#fff",barMainButtonTextColor:"#2b7abb",modalMainButtonColor:"#1e6ef4",modalMainButtonTextColor:"#fff",focusColor:"rgb(40 168 52 / 75%)"},customCSS:null,fullCSSOverride:null,language:{current:"en",locale:{en:{cookieBarLabel:"Cookie consent",barMainText:"This website uses cookies to ensure you get the best experience on our website.",closeAriaLabel:"close",barLinkSetting:"Cookie Settings",barBtnAcceptAll:"Accept all cookies",barBtnRejectAll:"Reject all cookies",modalMainTitle:"Cookie settings",modalMainText:"Cookies are small piece of data sent from a website and stored on the user's computer by the user's web browser while the user is browsing. Your browser stores each message in a small file, called cookie. When you request another page from the server, your browser sends the cookie back to the server. Cookies were designed to be a reliable mechanism for websites to remember information or to record the user's browsing activity.",modalBtnSave:"Save current settings",modalBtnAcceptAll:"Accept all cookies and close",modalBtnRejectAll:"Reject all cookies and close",initModalBtnAgree:"I agree",initModalBtnDisagree:"I do not agree",initModalBtnOptions:"Manage options",modalAffectedSolutions:"Affected solutions:",learnMore:"Learn More",on:"On",off:"Off",enabled:"is enabled.",disabled:"is disabled.",checked:"checked",unchecked:"unchecked"},hu:{cookieBarLabel:"Hozzájárulás sütik engedélyzéséhez",barMainText:"Ez a weboldal Sütiket használ a jobb felhasználói élmény érdekében.",closeAriaLabel:"bezár",barLinkSetting:"Süti beállítások",barBtnAcceptAll:"Minden süti elfogadása",barBtnRejectAll:"Minden süti elutasítása",modalMainTitle:"Süti beállítások",modalMainText:"A HTTP-süti (általában egyszerűen süti, illetve angolul cookie) egy információcsomag, amelyet a szerver küld a webböngészőnek, majd a böngésző visszaküld a szervernek minden, a szerver felé irányított kérés alkalmával. Amikor egy weboldalt kérünk le a szervertől, akkor a böngésző elküldi a számára elérhető sütiket. A süti-ket úgy tervezték, hogy megbízható mechanizmust biztosítsanak a webhelyek számára az információk megőrzésére vagy a felhasználók böngészési tevékenységének rögzítésére.",modalBtnSave:"Beállítások mentése",modalBtnAcceptAll:"Minden Süti elfogadása",modalBtnRejectAll:"Minden süti elutasítása",initModalBtnAgree:"Egyetértek",initModalBtnDisagree:"Nem értek egyet",initModalBtnOptions:"Beállítások kezelése",modalAffectedSolutions:"Mire lesz ez hatással:",learnMore:"Tudj meg többet",on:"Be",off:"Ki",enabled:"bekapcsolva.",disabled:"kikapcsolva.",checked:"kipipálva",unchecked:"nincs kipipálva"}}},categories:{},consentModeControls:{},services:{}},this.setConfiguration(e)}setConfiguration(t){this.mergeDeep(window.CookieConsent.config,t),this.cookieToConfig(),e.dispatchEvent(document,"CCConfigSet")}cookieToConfig(){function t(){return e.removeCookie(),location.reload(),!1}return document.cookie.split(";").filter((e=>{if(e.indexOf("cconsent")>=0){var o=JSON.parse(e.split("=")[1]);if(void 0===o.version)return t();if(o.version!==window.CookieConsent.config.cookieVersion)return t();for(let e in o.categories)if(void 0===window.CookieConsent.config.categories[e])return t();for(let e in o.consentMode)if(void 0===window.CookieConsent.config.consentModeControls[e])return t();if(o.services.forEach((function(e){if(void 0===window.CookieConsent.config.services[e])return t()})),!window.CookieConsent.config.noUI)for(let e in o.categories)window.CookieConsent.config.categories[e].checked=window.CookieConsent.config.categories[e].wanted=!0===o.categories[e].wanted;return window.CookieConsent.config.cookieExists=!0,!0}})),!1}isObject(e){return e&&"object"==typeof e&&!Array.isArray(e)}mergeDeep(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n-1&&this.removeCookie(o.services[n].cookies[i]);else if("RegExp"===c){let c=o.services[n].cookies[i];for(let o in t)t[o].match(c.name)&&this.removeCookie({name:t[o],domain:"String"===e.objectType(c.domain)?c.domain:null})}}}removeCookie(t){let o="String"===e.objectType(t.domain)?`domain=${t.domain};`:"";document.cookie=`${t.name}=; expires=Thu, 01 Jan 1980 00:00:00 UTC; ${o} path=/;`}}const U=new class{init(e){new R(e);const t=new V,a=new o,r=new n,s=new i,d=new c;t.init(),a.init(),r.init(),s.init(),d.init();const l=new F;l.buildInterface((()=>{l.addEventListeners()}))}};window.CookieConsent=window.CookieConsent||{},window.CookieConsent.init=U.init})(); \ No newline at end of file +(()=>{"use strict";function e(e,t){for(var n=0;n>16)+t,r=(o>>8&255)+t,c=(255&o)+t;return(n?"#":"")+((i=Math.min(255,Math.max(0,i)))<<16|(r=Math.min(255,Math.max(0,r)))<<8|(c=Math.min(255,Math.max(0,c)))).toString(16).padStart(6,"0")}if(e.startsWith("rgb")){var a=e.match(/rgba?\((\d{1,3})\s*,?\s*(\d{1,3})\s*,?\s*(\d{1,3})(?:\s*\/\s*(\d+\.?\d*%?))?\)/i);if(a){var s=parseInt(a[1])+t,l=parseInt(a[2])+t,d=parseInt(a[3])+t,u=a[4]?parseFloat(a[4]):1;return s=Math.min(255,Math.max(0,s)),l=Math.min(255,Math.max(0,l)),d=Math.min(255,Math.max(0,d)),a[4]?"rgba(".concat(s,", ").concat(l,", ").concat(d,", ").concat(u,")"):"rgb(".concat(s,", ").concat(l,", ").concat(d,")")}}return e}},{key:"removeCookie",value:function(){document.cookie="cconsent=; expires=Thu, 01 Jan 1980 00:00:00 UTC; path=/;",localStorage.removeItem("consentMode"),window.CookieConsent.config.cookieExists=!1}},{key:"listGlobalServices",value:function(e){var t=[];if(void 0===window.CookieConsent)return t;if(void 0===e)for(var n in window.CookieConsent.config.services)t.push(n);else for(var o in window.CookieConsent.config.services)window.CookieConsent.config.services[o].category===e&&t.push(o);return t}},{key:"dispatchEvent",value:function(e,t){"function"==typeof Event?t=new Event(t):(t=document.createEvent("Event")).initEvent(t,!0,!0),e.dispatchEvent(t)}}],(o=null)&&e(n.prototype,o),i&&e(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();function n(e,t){for(var n=0;n=0&&!1===window.CookieConsent.config.categories[window.CookieConsent.config.services[t].category].wanted)return void window.CookieConsent.buffer.appendChild.push({this:this,category:window.CookieConsent.config.services[t].category,arguments});return Node.prototype.appendChild.apply(this,arguments)}}},{key:"overrideInsertBefore",value:function(){Element.prototype.insertBefore=function(e){if("SCRIPT"===arguments[0].tagName)for(var t in window.CookieConsent.config.services)if("dynamic-script"===window.CookieConsent.config.services[t].type&&arguments[0].outerHTML.indexOf(window.CookieConsent.config.services[t].search)>=0&&!1===window.CookieConsent.config.categories[window.CookieConsent.config.services[t].category].wanted)return void window.CookieConsent.buffer.insertBefore.push({this:this,category:window.CookieConsent.config.services[t].category,arguments});return Node.prototype.insertBefore.apply(this,arguments)}}}],n&&r(t.prototype,n),o&&r(t,o),Object.defineProperty(t,"prototype",{writable:!1}),s}(o);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,c=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){a=!0,r=e},f:function(){try{c||null==n.return||n.return()}finally{if(a)throw r}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;e.indexOf(t)<0&&n()}}}],n&&v(t.prototype,n),o&&v(t,o),Object.defineProperty(t,"prototype",{writable:!1}),r}(o);function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function j(e,t){for(var n=0;n0;)n[o]=arguments[o+1];var i=typeof e;if("string"===i)t=ee(e).cloneNode(!1);else if($(e))t=e.cloneNode(!1);else{if("function"!==i)throw new Error("At least one argument required");var r=e;t=new(Function.prototype.bind.apply(r,[null].concat(n)))}return G(X(t),n,!0),t}var Z=Q;function ee(e){return K[e]||(K[e]=L(e))}function te(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];for(var o=ne(e,t,X(e).firstChild);o;){var i=o.nextSibling;P(e,o),o=i}}function ne(e,t,n){for(var o=n,i=new Array(t.length),r=0;r0;)t[n]=arguments[n+1];var o=ee(e);return Q.bind.apply(Q,[this,o].concat(t))};var oe=function(e,t,n){this.View=e,this.initData=n,this.oldLookup={},this.lookup={},this.oldViews=[],this.views=[],null!=t&&(this.key="function"==typeof t?t:function(e){return function(t){return t[e]}}(t))};oe.prototype.update=function(e,t){for(var n=this,o=n.View,i=n.key,r=n.initData,c=null!=i,a=this.lookup,s={},l=new Array(e.length),d=this.views,u=0;u0;)n[o]=arguments[o+1];var i=typeof e;if("string"===i)t=de(e).cloneNode(!1);else if($(e))t=e.cloneNode(!1);else{if("function"!==i)throw new Error("At least one argument required");var r=e;t=new(Function.prototype.bind.apply(r,[null].concat(n)))}return G(X(t),n,!0),t}function de(e){return se[e]||(se[e]=L(e,ae))}function ue(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,c=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){a=!0,r=e},f:function(){try{c||null==n.return||n.return()}finally{if(a)throw r}}}}function _e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n