Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vanilla-cookieconsent

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vanilla-cookieconsent - npm Package Compare versions

Comparing version 2.6.1 to 2.6.2

128

demo/app.js

@@ -12,7 +12,7 @@ // obtain cookieconsent plugin

autoclear_cookies : true, // default: false
theme_css: '../src/cookieconsent.css',
theme_css: '../src/cookieconsent.css',
cookie_name: 'cc_cookie_demo1', // default: 'cc_cookie'
cookie_expiration : 365, // default: 182
page_scripts: true, // default: false
page_scripts: true, // default: false
// auto_language : false, // default: false

@@ -30,18 +30,18 @@ // autorun : true, // default: true

gui_options : {
consent_modal : {
layout : 'box', // box,cloud,bar
position : 'bottom right', // bottom,middle,top + left,right,center
transition : 'slide' // zoom,slide
gui_options: {
consent_modal: {
layout: 'box', // box,cloud,bar
position: 'bottom right', // bottom,middle,top + left,right,center
transition: 'slide' // zoom,slide
},
settings_modal : {
layout : 'box', // box,bar
// position: 'left', // right,left (available only if bar layout selected)
transition : 'slide' // zoom,slide
settings_modal: {
layout: 'box', // box,bar
// position: 'left', // right,left (available only if bar layout selected)
transition: 'slide' // zoom,slide
}
},
onAccept: function(cookie){
console.log("onAccept fired ...");
onAccept: function (cookie) {
console.log('onAccept fired ...');
// delete line below

@@ -51,15 +51,17 @@ typeof doDemoThings === 'function' && doDemoThings(cookie);

onChange: function(cookie, changed_preferences){
console.log("onChange fired ...");
onChange: function (cookie, changed_preferences) {
console.log('onChange fired ...');
// If analytics category's status was changed ...
if(changed_preferences.indexOf('analytics') > -1){
if (changed_preferences.indexOf('analytics') > -1) {
// If analytics category is disabled ...
if(!cc.allowedCategory('analytics')){
if (!cc.allowedCategory('analytics')) {
// Disable gtag ...
console.log("disabling gtag")
console.log('disabling gtag')
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('consent', 'default', {

@@ -71,3 +73,3 @@ 'ad_storage': 'denied',

}
// delete line below

@@ -77,46 +79,46 @@ typeof doDemoThings === 'function' && doDemoThings(cookie);

languages : {
'en' : {
consent_modal : {
title : cookie + " We use cookies!",
description : 'Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent. <button type="button" data-cc="c-settings" class="cc-link">Let me choose</button>',
languages: {
'en': {
consent_modal: {
title: cookie + ' We use cookies!',
description: 'Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent. <button type="button" data-cc="c-settings" class="cc-link">Let me choose</button>',
primary_btn: {
text: 'Accept all',
role: 'accept_all' //'accept_selected' or 'accept_all'
role: 'accept_all' // 'accept_selected' or 'accept_all'
},
secondary_btn: {
text : 'Reject all',
role : 'accept_necessary' //'settings' or 'accept_necessary'
text: 'Reject all',
role: 'accept_necessary' // 'settings' or 'accept_necessary'
}
},
settings_modal : {
title : logo,
save_settings_btn : "Save settings",
accept_all_btn : "Accept all",
reject_all_btn: "Reject all",
close_btn_label: "Close",
cookie_table_headers : [
{col1: "Name" },
{col2: "Domain" },
{col3: "Expiration" },
{col4: "Description" }
settings_modal: {
title: logo,
save_settings_btn: 'Save settings',
accept_all_btn: 'Accept all',
reject_all_btn: 'Reject all',
close_btn_label: 'Close',
cookie_table_headers: [
{col1: 'Name'},
{col2: 'Domain'},
{col3: 'Expiration'},
{col4: 'Description'}
],
blocks : [
blocks: [
{
title : "Cookie usage 📢",
title: 'Cookie usage 📢',
description: 'I use cookies to ensure the basic functionalities of the website and to enhance your online experience. You can choose for each category to opt-in/out whenever you want. For more details relative to cookies and other sensitive data, please read the full <a href="#" class="cc-link">privacy policy</a>.'
},{
title : "Strictly necessary cookies",
}, {
title: 'Strictly necessary cookies',
description: 'These cookies are essential for the proper functioning of my website. Without these cookies, the website would not work properly',
toggle : {
value : 'necessary',
enabled : true,
readonly: true //cookie categories with readonly=true are all treated as "necessary cookies"
toggle: {
value: 'necessary',
enabled: true,
readonly: true // cookie categories with readonly=true are all treated as "necessary cookies"
}
},{
title : "Performance and Analytics cookies",
}, {
title: 'Performance and Analytics cookies',
description: 'These cookies allow the website to remember the choices you have made in the past',
toggle : {
value : 'analytics', //there are no default categories => you specify them
enabled : false,
toggle: {
value: 'analytics', // there are no default categories => you specify them
enabled: false,
readonly: false

@@ -129,3 +131,3 @@ },

col3: '2 years',
col4: 'description ...' ,
col4: 'description ...',
is_regex: true

@@ -137,15 +139,15 @@ },

col3: '1 day',
col4: 'description ...' ,
col4: 'description ...',
}
]
},{
title : "Advertisement and Targeting cookies",
}, {
title: 'Advertisement and Targeting cookies',
description: 'These cookies collect information about how you use the website, which pages you visited and which links you clicked on. All of the data is anonymized and cannot be used to identify you',
toggle : {
value : 'targeting',
enabled : false,
toggle: {
value: 'targeting',
enabled: false,
readonly: false
}
},{
title : "More information",
}, {
title: 'More information',
description: 'For any queries in relation to my policy on cookies and your choices, please <a class="cc-link" href="https://orestbida.com/contact">contact me</a>.',

@@ -157,2 +159,2 @@ }

}
});
});

@@ -6,8 +6,8 @@ // obtain cookieconsent plugin

cc.run({
current_lang : 'en',
autoclear_cookies : true, // default: false
current_lang: 'en',
autoclear_cookies: true, // default: false
theme_css: '../src/cookieconsent.css',
cookie_name: 'cc_cookie_demo2', // default: 'cc_cookie'
cookie_expiration : 365, // default: 182
page_scripts: true, // default: false
cookie_expiration: 365, // default: 182
page_scripts: true, // default: false
force_consent: true, // default: false

@@ -21,17 +21,17 @@

// cookie_domain: location.hostname, // default: current domain
// cookie_path: "/", // default: root
// cookie_same_site: "Lax",
// cookie_path: '/', // default: root
// cookie_same_site: 'Lax',
// use_rfc_cookie: false, // default: false
// revision: 0, // default: 0
gui_options : {
consent_modal : {
layout : 'cloud', // box,cloud,bar
position : 'bottom center', // bottom,middle,top + left,right,center
transition : 'slide' // zoom,slide
gui_options: {
consent_modal: {
layout: 'cloud', // box,cloud,bar
position: 'bottom center', // bottom,middle,top + left,right,center
transition: 'slide' // zoom,slide
},
settings_modal : {
layout : 'bar', // box,bar
position: 'left', // right,left (available only if bar layout selected)
transition : 'slide' // zoom,slide
settings_modal: {
layout: 'bar', // box,bar
position: 'left', // right,left (available only if bar layout selected)
transition: 'slide' // zoom,slide
}

@@ -42,24 +42,28 @@ },

onAccept: function(cookie){
console.log("onAccept fired ...");
onAccept: function (cookie) {
console.log('onAccept fired ...');
disableBtn('btn2');
disableBtn('btn3');
// Delete line below
document.getElementById("cookie_val") && (document.getElementById("cookie_val").innerHTML = JSON.stringify(cookie, null, 2));
document.getElementById('cookie_val') && (document.getElementById('cookie_val').innerHTML = JSON.stringify(cookie, null, 2));
},
onChange: function(cookie, changed_preferences){
console.log("onChange fired ...");
onChange: function (cookie, changed_preferences) {
console.log('onChange fired ...');
// If analytics category's status was changed ...
if(changed_preferences.indexOf('analytics') > -1){
if (changed_preferences.indexOf('analytics') > -1) {
// If analytics category is disabled ...
if(!cc.allowedCategory('analytics')){
if (!cc.allowedCategory('analytics')) {
// Disable gtag ...
console.log("disabling gtag")
console.log('disabling gtag')
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
function gtag() {
dataLayer.push(arguments);
}
gtag('consent', 'default', {

@@ -73,10 +77,10 @@ 'ad_storage': 'denied',

// Delete line below
document.getElementById("cookie_val") && (document.getElementById("cookie_val").innerHTML = JSON.stringify(cookie, null, 2));
document.getElementById('cookie_val') && (document.getElementById('cookie_val').innerHTML = JSON.stringify(cookie, null, 2));
},
languages : {
'en' : {
consent_modal : {
title : "Hello traveller, it's cookie time!",
description : 'Our website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent. <a href="#privacy-policy" class="cc-link">Privacy policy</a>',
languages: {
'en': {
consent_modal: {
title: 'Hello traveller, it\'s cookie time!',
description: 'Our website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent. <a href="#privacy-policy" class="cc-link">Privacy policy</a>',
primary_btn: {

@@ -87,36 +91,36 @@ text: 'Accept all',

secondary_btn: {
text : 'Preferences',
role : 'settings' //'settings' or 'accept_necessary'
text: 'Preferences',
role: 'settings' //'settings' or 'accept_necessary'
},
revision_message: "<br><br> Dear user, terms and conditions have changed since the last time you visisted!"
revision_message: '<br><br> Dear user, terms and conditions have changed since the last time you visisted!'
},
settings_modal : {
title : 'Cookie settings',
save_settings_btn : "Save current selection",
accept_all_btn : "Accept all",
reject_all_btn: "Reject all",
close_btn_label: "Close",
cookie_table_headers : [
{col1: "Name" },
{col2: "Domain" },
{col3: "Expiration" }
settings_modal: {
title: 'Cookie settings',
save_settings_btn: 'Save current selection',
accept_all_btn: 'Accept all',
reject_all_btn: 'Reject all',
close_btn_label: 'Close',
cookie_table_headers: [
{col1: 'Name'},
{col2: 'Domain'},
{col3: 'Expiration'}
],
blocks : [
blocks: [
{
title : "Cookie usage",
description: getLoremIpsum()+' <a href="#" class="cc-link">Privacy Policy</a>.'
},{
title : "Strictly necessary cookies",
description: getLoremIpsum()+getLoremIpsum()+"<br><br>"+getLoremIpsum()+getLoremIpsum(),
toggle : {
value : 'necessary',
enabled : true,
title: 'Cookie usage',
description: getLoremIpsum() + ' <a href="#" class="cc-link">Privacy Policy</a>.'
}, {
title: 'Strictly necessary cookies',
description: getLoremIpsum() + getLoremIpsum() + "<br><br>" + getLoremIpsum() + getLoremIpsum(),
toggle: {
value: 'necessary',
enabled: true,
readonly: true //cookie categories with readonly=true are all treated as "necessary cookies"
}
},{
title : "Analytics & Performance cookies",
}, {
title: 'Analytics & Performance cookies',
description: getLoremIpsum(),
toggle : {
value : 'analytics',
enabled : false,
toggle: {
value: 'analytics',
enabled: false,
readonly: false

@@ -128,3 +132,3 @@ },

col2: 'yourdomain.com',
col3: "description ...",
col3: 'description ...',
is_regex: true

@@ -141,15 +145,15 @@ },

col3: 'test cookie with custom path ...',
path: '/demo' // needed for autoclear cookies
path: '/demo' // needed for autoclear cookies
}
]
},{
title : "Targeting & Advertising cookies",
}, {
title: 'Targeting & Advertising cookies',
description: 'If this category is deselected, <b>the page will reload when preferences are saved</b>... <br><br>(demo example with reload option enabled, for scripts like microsoft clarity which will re-set cookies and send beacons even after the cookies have been cleared by the cookieconsent\'s autoclear function)',
toggle : {
value : 'targeting',
enabled : false,
toggle: {
value: 'targeting',
enabled: false,
readonly: false,
reload: 'on_disable' // New option in v2.4, check readme.md
},
cookie_table : [
cookie_table: [
{

@@ -163,4 +167,4 @@ col1: '^_cl', // New option in v2.4: regex (microsoft clarity cookies)

]
},{
title : "More information",
}, {
title: 'More information',
description: getLoremIpsum() + ' <a class="cc-link" href="https://orestbida.com/contact/">Contact me</a>.',

@@ -175,3 +179,3 @@ }

function getLoremIpsum(){
function getLoremIpsum() {
return 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';

@@ -181,3 +185,3 @@ }

// DELETE ALL CONTENT BELOW THIS COMMENT!!!
if(cc.validCookie('cc_cookie')){
if (cc.validCookie('cc_cookie')) {
//if cookie is set => disable buttons

@@ -188,5 +192,5 @@ disableBtn('btn2');

function disableBtn(id){
function disableBtn(id) {
document.getElementById(id).disabled = true;
document.getElementById(id).className = "styled_btn disabled";
document.getElementById(id).className = 'styled_btn disabled';
}

@@ -196,10 +200,10 @@

function toggleDarkmode(){
if(!darkmode){
function toggleDarkmode() {
if (!darkmode) {
document.getElementById('theme').innerText = 'dark theme';
document.body.className='d_mode c_darkmode';
document.body.className = 'd_mode c_darkmode';
darkmode = true;
}else{
} else {
document.getElementById('theme').innerText = 'light theme';
document.body.className='d_mode';
document.body.className = 'd_mode';
darkmode = false;

@@ -212,35 +216,35 @@ }

*/
if(document.addEventListener){
if (document.addEventListener) {
document.getElementById("btn2").addEventListener('click', function(){
document.getElementById('btn2').addEventListener('click', function () {
cc.show(0);
});
document.getElementById("btn3").addEventListener('click', function(){
document.getElementById('btn3').addEventListener('click', function () {
cc.hide();
});
document.getElementById("btn5").addEventListener('click', function(){
cc.showSettings(0);
document.getElementById('btn5').addEventListener('click', function () {
cc.showSettings(0);
});
document.getElementById("btn6").addEventListener('click', function(){
document.getElementById('btn6').addEventListener('click', function () {
toggleDarkmode();
});
}else{
document.getElementById("btn2").attachEvent('onclick', function(){
} else {
document.getElementById('btn2').attachEvent('onclick', function () {
cc.show(0);
});
document.getElementById("btn3").attachEvent('onclick', function(){
document.getElementById('btn3').attachEvent('onclick', function () {
cc.hide();
});
document.getElementById("btn5").attachEvent('onclick', function(){
cc.showSettings(0);
document.getElementById('btn5').attachEvent('onclick', function () {
cc.showSettings(0);
});
document.getElementById("btn6").attachEvent('onclick', function(){
document.getElementById('btn6').attachEvent('onclick', function () {
toggleDarkmode();
});
}
}
/*
CookieConsent v2.6.1
CookieConsent v2.6.2
https://www.github.com/orestbida/cookieconsent

@@ -7,17 +7,17 @@ Author Orest Bida

*/
(function(){function Xa(Ya){function Ga(a,b){return a.classList?a.classList.contains(b):!!a.className.match(new RegExp("(\\s|^)"+b+"(\\s|$)"))}function ua(a,b){a.classList?a.classList.remove(b):a.className=a.className.replace(new RegExp("(\\s|^)"+b+"(\\s|$)")," ")}function F(a,b){a.classList?a.classList.add(b):Ga(a,b)||(a.className+=" "+b)}function ha(a){if("object"===typeof a){var b=[],c=0;for(b[c++]in a);return b}}function G(a,b,c,d){a.addEventListener?d?a.addEventListener(b,c,{passive:!0}):a.addEventListener(b,
c,!1):a.attachEvent("on"+b,c)}function Ha(a,b,c){b=b?b:"/";for(var d=0;d<a.length;d++)for(var e=0;e<c.length;e++)document.cookie=a[d]+"=; path="+b+(-1<c[e].indexOf(".")?"; domain="+c[e]:"")+"; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"}function ia(a,b,c){var d;if("one"===b){if((d=(d=document.cookie.match("(^|;)\\s*"+a+"\\s*=\\s*([^;]+)"))?c?d.pop():a:"")&&a===S){try{d=JSON.parse(d)}catch(e){d=JSON.parse(decodeURIComponent(d))}d=JSON.stringify(d)}}else if("all"===b)for(a=document.cookie.split(/;\s*/),
d=[],b=0;b<a.length;b++)d.push(a[b].split("=")[0]);return d}function va(a,b){b=ja?encodeURIComponent(b):b;var c=new Date;c.setTime(c.getTime()+864E5*Ia);a=a+"="+(b||"")+("; expires="+c.toUTCString())+"; Path="+Ja+";";a+=" SameSite="+Ka+";";-1<location.hostname.indexOf(".")&&(a+=" Domain="+T+";");"https:"===location.protocol&&(a+=" Secure;");document.cookie=a}function La(){if(Ma){var a=Na,b=r.level||[],c=function(d,e){if(e<d.length){var g=d[e],l=g.getAttribute("data-cookiecategory");if(-1<H(b,l)){g.type=
"text/javascript";g.removeAttribute("data-cookiecategory");l=g.getAttribute("data-src");var k=f("script");k.textContent=g.innerHTML;(function(t,m){for(var p=m.attributes,W=p.length,J=0;J<W;J++)m=p[J],t.setAttribute(m.nodeName,m.nodeValue)})(k,g);l?k.src=l:l=g.src;l&&(a?k.readyState?k.onreadystatechange=function(){if("loaded"===k.readyState||"complete"===k.readyState)k.onreadystatechange=null,c(d,++e)}:k.onload=function(){k.onload=null;c(d,++e)}:l=!1);g.parentNode.replaceChild(k,g);if(l)return}c(d,
++e)}};c(document.querySelectorAll("script[data-cookiecategory]"),0)}}function Oa(a,b){function c(e,g,l,k,t,m,p){m=m&&m.split(" ")||[];if(-1<H(g,t)&&(F(e,t),("bar"!==t||"middle"!==m[0])&&-1<H(l,m[0])))for(g=0;g<m.length;g++)F(e,m[g]);-1<H(k,p)&&F(e,p)}if("object"===typeof a){var d=a.consent_modal;a=a.settings_modal;U&&d&&c(w,["box","bar","cloud"],["top","middle","bottom"],["zoom","slide"],d.layout,d.position,d.transition);!b&&a&&c(I,["bar"],["left","right"],["zoom","slide"],a.layout,a.position,a.transition)}}
function Za(){var a=!1,b=!1;G(document,"keydown",function(c){c=c||window.event;"Tab"===c.key&&(u&&(c.shiftKey?document.activeElement===u[0]&&(u[1].focus(),c.preventDefault()):document.activeElement===u[1]&&(u[0].focus(),c.preventDefault()),b||ka||(b=!0,!a&&c.preventDefault(),c.shiftKey?u[3]?u[2]?u[2].focus():u[0].focus():u[1].focus():u[3]?u[3].focus():u[0].focus())),!b&&(a=!0))});document.contains&&G(M,"click",function(c){c=c||window.event;wa?O.contains(c.target)?ka=!0:(h.hideSettings(0),ka=!1):la&&
w.contains(c.target)&&(ka=!0)},!0)}function f(a){var b=document.createElement(a);"button"===a&&b.setAttribute("type",a);return b}function H(a,b){for(var c=a.length,d=0;d<c;d++)if(a[d]==b)return d;return-1}function $a(a,b){if("string"!==typeof a||""==a||document.getElementById("cc--style"))b();else{var c=f("style");c.id="cc--style";var d=new XMLHttpRequest;d.onreadystatechange=function(){4==this.readyState&&200==this.status&&(c.setAttribute("type","text/css"),c.styleSheet?c.styleSheet.cssText=this.responseText:
c.appendChild(document.createTextNode(this.responseText)),document.getElementsByTagName("head")[0].appendChild(c),b())};d.open("GET",a);d.send()}}function ab(a){var b=document.querySelectorAll(".c-tgl")||[],c=[],d=!1;if(0<b.length){for(var e=0;e<b.length;e++)-1!==H(a,N[e])?(b[e].checked=!0,P[e]||(c.push(N[e]),P[e]=!0)):(b[e].checked=!1,P[e]&&(c.push(N[e]),P[e]=!1));if(Pa&&V&&0<c.length){b=x.length;e=-1;var g=ia("","all"),l=[T,"."+T];if("www."===T.slice(0,4)){var k=T.substr(4);l.push(k);l.push("."+
k)}for(k=0;k<b;k++){var t=x[k];if(t.hasOwnProperty("toggle")&&!P[++e]&&t.hasOwnProperty("cookie_table")&&-1<H(c,t.toggle.value)){var m=t.cookie_table,p=ha(X[0])[0],W=m.length;"on_disable"===t.toggle.reload&&(d=!0);for(var J=0;J<W;J++){var K=m[J],n=[],v=K[p],y=K.is_regex||!1,q=K.domain||null;K=K.path||!1;q&&(l=[q,"."+q]);if(y)for(y=0;y<g.length;y++)g[y].match(v)&&n.push(g[y]);else v=H(g,v),-1<v&&n.push(g[v]);0<n.length&&(Ha(n,K,l),"on_clear"===t.toggle.reload&&(d=!0))}}}}}r={level:a,revision:pa,data:C,
rfc_cookie:ja};if(!V||0<c.length||!Y)Y=!0,va(S,JSON.stringify(r)),La();if("function"===typeof xa&&!V)return V=!0,xa(r);"function"===typeof ya&&0<c.length&&ya(r,c);d&&window.location.reload()}function bb(a,b){M=f("div");M.id="cc--main";M.style.position="fixed";M.style.zIndex="1000000";M.innerHTML='\x3c!--[if lt IE 9 ]><div id="cc_div" class="cc_div ie"></div><![endif]--\x3e\x3c!--[if (gt IE 8)|!(IE)]>\x3c!--\x3e<div id="cc_div" class="cc_div"></div>\x3c!--<![endif]--\x3e';var c=M.children[0],d=L,e=
"string"===typeof ca.textContent?"textContent":"innerText";za=b;Aa=function(z){!0===z.force_consent&&F(ca,"force--consent");var Q=z.languages[d].consent_modal.description;Ba&&(Q=Y?Q.replace("{{revision_message}}",""):Q.replace("{{revision_message}}",Qa||z.languages[d].consent_modal.revision_message||""));if(w)ma.innerHTML=Q;else{w=f("div");var Z=f("div"),qa=f("div"),na=f("div");ma=f("div");var ra=f("div"),oa=f("button"),da=f("button"),sa=f("div");w.id="cm";Z.id="c-inr";qa.id="c-inr-i";na.id="c-ttl";
ma.id="c-txt";ra.id="c-bns";oa.id="c-p-bn";da.id="c-s-bn";sa.id="cm-ov";oa.className="c-bn";da.className="c-bn c_link";na.setAttribute("role","heading");na.setAttribute("aria-level","2");w.setAttribute("role","dialog");w.setAttribute("aria-modal","true");w.setAttribute("aria-hidden","false");w.setAttribute("aria-labelledby","c-ttl");w.setAttribute("aria-describedby","c-txt");w.style.visibility=sa.style.visibility="hidden";sa.style.opacity=0;na.insertAdjacentHTML("beforeend",z.languages[d].consent_modal.title);
ma.insertAdjacentHTML("beforeend",Q);oa[e]=z.languages[d].consent_modal.primary_btn.text;da[e]=z.languages[d].consent_modal.secondary_btn.text;var Ra;"accept_all"==z.languages[d].consent_modal.primary_btn.role&&(Ra="all");G(oa,"click",function(){h.hide();h.accept(Ra)});"accept_necessary"==z.languages[d].consent_modal.secondary_btn.role?G(da,"click",function(){h.hide();h.accept([])}):G(da,"click",function(){h.showSettings(0)});qa.appendChild(na);qa.appendChild(ma);ra.appendChild(oa);ra.appendChild(da);
Z.appendChild(qa);Z.appendChild(ra);w.appendChild(Z);c.appendChild(w);c.appendChild(sa);U=!0}};a||Aa(b);I=f("div");var g=f("div"),l=f("div"),k=f("div");O=f("div");var t=f("div"),m=f("div"),p=f("button"),W=f("div"),J=f("div"),K=f("div");I.id="s-cnt";g.id="c-vln";k.id="c-s-in";l.id="cs";t.id="s-ttl";O.id="s-inr";m.id="s-hdr";J.id="s-bl";p.id="s-c-bn";K.id="cs-ov";W.id="s-c-bnc";p.className="c-bn";p.setAttribute("aria-label",b.languages[d].settings_modal.close_btn_label||"Close");I.setAttribute("role",
"dialog");I.setAttribute("aria-modal","true");I.setAttribute("aria-hidden","true");I.setAttribute("aria-labelledby","s-ttl");t.setAttribute("role","heading");I.style.visibility=K.style.visibility="hidden";K.style.opacity=0;W.appendChild(p);G(g,"keydown",function(z){z=z||window.event;27==z.keyCode&&h.hideSettings(0)},!0);G(p,"click",function(){h.hideSettings(0)});x=b.languages[L].settings_modal.blocks;X=b.languages[L].settings_modal.cookie_table_headers;p=x.length;t.insertAdjacentHTML("beforeend",
(function(){function Xa(Ya){function Ga(a,b){return a.classList?a.classList.contains(b):!!a.className.match(new RegExp("(\\s|^)"+b+"(\\s|$)"))}function ua(a,b){a.classList?a.classList.remove(b):a.className=a.className.replace(new RegExp("(\\s|^)"+b+"(\\s|$)")," ")}function F(a,b){a.classList?a.classList.add(b):Ga(a,b)||(a.className+=" "+b)}function ha(a){if("object"===typeof a){var b=[],c=0;for(b[c++]in a);return b}}function G(a,b,c,d){a.addEventListener?!0===d?a.addEventListener(b,c,{passive:!0}):
a.addEventListener(b,c,!1):a.attachEvent("on"+b,c)}function Ha(a,b,c){b=b?b:"/";for(var d=0;d<a.length;d++)for(var e=0;e<c.length;e++)document.cookie=a[d]+"=; path="+b+(-1<c[e].indexOf(".")?"; domain="+c[e]:"")+"; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"}function ia(a,b,c){var d;if("one"===b){if((d=(d=document.cookie.match("(^|;)\\s*"+a+"\\s*=\\s*([^;]+)"))?c?d.pop():a:"")&&a===S){try{d=JSON.parse(d)}catch(e){d=JSON.parse(decodeURIComponent(d))}d=JSON.stringify(d)}}else if("all"===b)for(a=document.cookie.split(/;\s*/),
d=[],b=0;b<a.length;b++)d.push(a[b].split("=")[0]);return d}function va(a,b){b=ja?encodeURIComponent(b):b;var c=new Date;c.setTime(c.getTime()+864E5*Ia);a=a+"="+(b||"")+("; expires="+c.toUTCString())+"; Path="+Ja+";";a+=" SameSite="+Ka+";";-1<window.location.hostname.indexOf(".")&&(a+=" Domain="+T+";");"https:"===window.location.protocol&&(a+=" Secure;");document.cookie=a}function La(){if(Ma){var a=Na,b=r.level||[],c=function(d,e){if(e<d.length){var g=d[e],l=g.getAttribute("data-cookiecategory");
if(-1<H(b,l)){g.type="text/javascript";g.removeAttribute("data-cookiecategory");l=g.getAttribute("data-src");var k=f("script");k.textContent=g.innerHTML;(function(t,m){for(var p=m.attributes,W=p.length,J=0;J<W;J++)m=p[J],t.setAttribute(m.nodeName,m.nodeValue)})(k,g);l?k.src=l:l=g.src;l&&(a?k.readyState?k.onreadystatechange=function(){if("loaded"===k.readyState||"complete"===k.readyState)k.onreadystatechange=null,c(d,++e)}:k.onload=function(){k.onload=null;c(d,++e)}:l=!1);g.parentNode.replaceChild(k,
g);if(l)return}c(d,++e)}};c(document.querySelectorAll("script[data-cookiecategory]"),0)}}function Oa(a,b){function c(e,g,l,k,t,m,p){m=m&&m.split(" ")||[];if(-1<H(g,t)&&(F(e,t),("bar"!==t||"middle"!==m[0])&&-1<H(l,m[0])))for(g=0;g<m.length;g++)F(e,m[g]);-1<H(k,p)&&F(e,p)}if("object"===typeof a){var d=a.consent_modal;a=a.settings_modal;U&&d&&c(w,["box","bar","cloud"],["top","middle","bottom"],["zoom","slide"],d.layout,d.position,d.transition);!b&&a&&c(I,["bar"],["left","right"],["zoom","slide"],a.layout,
a.position,a.transition)}}function Za(){var a=!1,b=!1;G(document,"keydown",function(c){c=c||window.event;"Tab"===c.key&&(u&&(c.shiftKey?document.activeElement===u[0]&&(u[1].focus(),c.preventDefault()):document.activeElement===u[1]&&(u[0].focus(),c.preventDefault()),b||ka||(b=!0,!a&&c.preventDefault(),c.shiftKey?u[3]?u[2]?u[2].focus():u[0].focus():u[1].focus():u[3]?u[3].focus():u[0].focus())),!b&&(a=!0))});document.contains&&G(M,"click",function(c){c=c||window.event;wa?O.contains(c.target)?ka=!0:(h.hideSettings(0),
ka=!1):la&&w.contains(c.target)&&(ka=!0)},!0)}function f(a){var b=document.createElement(a);"button"===a&&b.setAttribute("type",a);return b}function H(a,b){for(var c=a.length,d=0;d<c;d++)if(a[d]===b)return d;return-1}function $a(a,b){if("string"!==typeof a||""===a||document.getElementById("cc--style"))b();else{var c=f("style");c.id="cc--style";var d=new XMLHttpRequest;d.onreadystatechange=function(){4===this.readyState&&200===this.status&&(c.setAttribute("type","text/css"),c.styleSheet?c.styleSheet.cssText=
this.responseText:c.appendChild(document.createTextNode(this.responseText)),document.getElementsByTagName("head")[0].appendChild(c),b())};d.open("GET",a);d.send()}}function ab(a){var b=document.querySelectorAll(".c-tgl")||[],c=[],d=!1;if(0<b.length){for(var e=0;e<b.length;e++)-1!==H(a,N[e])?(b[e].checked=!0,P[e]||(c.push(N[e]),P[e]=!0)):(b[e].checked=!1,P[e]&&(c.push(N[e]),P[e]=!1));if(Pa&&V&&0<c.length){b=x.length;e=-1;var g=ia("","all"),l=[T,"."+T];if("www."===T.slice(0,4)){var k=T.substr(4);l.push(k);
l.push("."+k)}for(k=0;k<b;k++){var t=x[k];if(Object.prototype.hasOwnProperty.call(t,"toggle")&&!P[++e]&&Object.prototype.hasOwnProperty.call(t,"cookie_table")&&-1<H(c,t.toggle.value)){var m=t.cookie_table,p=ha(X[0])[0],W=m.length;"on_disable"===t.toggle.reload&&(d=!0);for(var J=0;J<W;J++){var K=m[J],n=[],v=K[p],y=K.is_regex||!1,q=K.domain||null;K=K.path||!1;q&&(l=[q,"."+q]);if(y)for(y=0;y<g.length;y++)g[y].match(v)&&n.push(g[y]);else v=H(g,v),-1<v&&n.push(g[v]);0<n.length&&(Ha(n,K,l),"on_clear"===
t.toggle.reload&&(d=!0))}}}}}r={level:a,revision:pa,data:C,rfc_cookie:ja};if(!V||0<c.length||!Y)Y=!0,va(S,JSON.stringify(r)),La();if("function"===typeof xa&&!V)return V=!0,xa(r);"function"===typeof ya&&0<c.length&&ya(r,c);d&&window.location.reload()}function bb(a,b){M=f("div");M.id="cc--main";M.style.position="fixed";M.style.zIndex="1000000";M.innerHTML='\x3c!--[if lt IE 9 ]><div id="cc_div" class="cc_div ie"></div><![endif]--\x3e\x3c!--[if (gt IE 8)|!(IE)]>\x3c!--\x3e<div id="cc_div" class="cc_div"></div>\x3c!--<![endif]--\x3e';
var c=M.children[0],d=L,e="string"===typeof ca.textContent?"textContent":"innerText";za=b;Aa=function(z){!0===z.force_consent&&F(ca,"force--consent");var Q=z.languages[d].consent_modal.description;Ba&&(Q=Y?Q.replace("{{revision_message}}",""):Q.replace("{{revision_message}}",Qa||z.languages[d].consent_modal.revision_message||""));if(w)ma.innerHTML=Q;else{w=f("div");var Z=f("div"),qa=f("div"),na=f("div");ma=f("div");var ra=f("div"),oa=f("button"),da=f("button"),sa=f("div");w.id="cm";Z.id="c-inr";qa.id=
"c-inr-i";na.id="c-ttl";ma.id="c-txt";ra.id="c-bns";oa.id="c-p-bn";da.id="c-s-bn";sa.id="cm-ov";oa.className="c-bn";da.className="c-bn c_link";na.setAttribute("role","heading");na.setAttribute("aria-level","2");w.setAttribute("role","dialog");w.setAttribute("aria-modal","true");w.setAttribute("aria-hidden","false");w.setAttribute("aria-labelledby","c-ttl");w.setAttribute("aria-describedby","c-txt");w.style.visibility=sa.style.visibility="hidden";sa.style.opacity=0;na.insertAdjacentHTML("beforeend",
z.languages[d].consent_modal.title);ma.insertAdjacentHTML("beforeend",Q);oa[e]=z.languages[d].consent_modal.primary_btn.text;da[e]=z.languages[d].consent_modal.secondary_btn.text;var Ra;"accept_all"===z.languages[d].consent_modal.primary_btn.role&&(Ra="all");G(oa,"click",function(){h.hide();h.accept(Ra)});"accept_necessary"===z.languages[d].consent_modal.secondary_btn.role?G(da,"click",function(){h.hide();h.accept([])}):G(da,"click",function(){h.showSettings(0)});qa.appendChild(na);qa.appendChild(ma);
ra.appendChild(oa);ra.appendChild(da);Z.appendChild(qa);Z.appendChild(ra);w.appendChild(Z);c.appendChild(w);c.appendChild(sa);U=!0}};a||Aa(b);I=f("div");var g=f("div"),l=f("div"),k=f("div");O=f("div");var t=f("div"),m=f("div"),p=f("button"),W=f("div"),J=f("div"),K=f("div");I.id="s-cnt";g.id="c-vln";k.id="c-s-in";l.id="cs";t.id="s-ttl";O.id="s-inr";m.id="s-hdr";J.id="s-bl";p.id="s-c-bn";K.id="cs-ov";W.id="s-c-bnc";p.className="c-bn";p.setAttribute("aria-label",b.languages[d].settings_modal.close_btn_label||
"Close");I.setAttribute("role","dialog");I.setAttribute("aria-modal","true");I.setAttribute("aria-hidden","true");I.setAttribute("aria-labelledby","s-ttl");t.setAttribute("role","heading");I.style.visibility=K.style.visibility="hidden";K.style.opacity=0;W.appendChild(p);G(g,"keydown",function(z){z=z||window.event;27===z.keyCode&&h.hideSettings(0)},!0);G(p,"click",function(){h.hideSettings(0)});x=b.languages[L].settings_modal.blocks;X=b.languages[L].settings_modal.cookie_table_headers;p=x.length;t.insertAdjacentHTML("beforeend",
b.languages[L].settings_modal.title);for(var n=0;n<p;++n){var v=f("div"),y=f("div"),q=f("div"),D=f("div");v.className="c-bl";y.className="desc";q.className="p";D.className="title";q.insertAdjacentHTML("beforeend",x[n].description);if("undefined"!==typeof x[n].toggle){var A="c-ac-"+n,aa=f("button"),E=f("label"),B=f("input"),R=f("span"),ba=f("span"),ea=f("span"),Sa=f("span");aa.className="b-tl";E.className="b-tg";B.className="c-tgl";ea.className="on-i";Sa.className="off-i";R.className="c-tg";ba.className=

@@ -30,11 +30,11 @@ "t-lb";aa.setAttribute("aria-expanded","false");aa.setAttribute("aria-controls",A);B.type="checkbox";R.setAttribute("aria-hidden","true");var Ca=x[n].toggle.value;B.value=Ca;ba[e]=x[n].title;aa.insertAdjacentHTML("beforeend",x[n].title);D.appendChild(aa);R.appendChild(ea);R.appendChild(Sa);a?-1<H(r.level,Ca)?(B.checked=!0,P.push(!0)):P.push(!1):x[n].toggle.enabled?(B.checked=!0,P.push(!0)):P.push(!1);N.push(Ca);x[n].toggle.readonly?(B.disabled=!0,F(R,"c-ro"),Da.push(!0)):Da.push(!1);F(y,"b-acc");

l.appendChild(k);g.appendChild(l);I.appendChild(g);c.appendChild(I);c.appendChild(K);(Ya||document.body).appendChild(M)}function Ta(){function a(c,d){var e=!1,g=!1;try{for(var l=c.querySelectorAll(b.join(':not([tabindex="-1"]), ')),k,t=l.length,m=0;m<t;)k=l[m].getAttribute("data-focus"),g||"1"!==k?"0"===k&&(e=l[m],g||"0"===l[m+1].getAttribute("data-focus")||(g=l[m+1])):g=l[m],m++}catch(p){return c.querySelectorAll(b.join(", "))}d[0]=l[0];d[1]=l[l.length-1];d[2]=e;d[3]=g}var b=["[href]","button","input",
"details",'[tabindex="0"]'];a(O,fa);U&&a(w,Ea)}function Ua(a,b){if(b.hasOwnProperty(a))return a;if(0<ha(b).length)return b.hasOwnProperty(L)?L:ha(b)[0]}function cb(){for(var a=document.querySelectorAll('a[data-cc="c-settings"], button[data-cc="c-settings"]'),b=0;b<a.length;b++)a[b].setAttribute("aria-haspopup","dialog"),G(a[b],"click",function(c){h.showSettings(0);c.preventDefault?c.preventDefault():c.returnValue=!1})}function db(a){"number"===typeof a.cookie_expiration&&(Ia=a.cookie_expiration);
"boolean"===typeof a.autorun&&(Va=a.autorun);"string"===typeof a.cookie_domain&&(T=a.cookie_domain);"string"===typeof a.cookie_same_site&&(Ka=a.cookie_same_site);"string"===typeof a.cookie_path&&(Ja=a.cookie_path);"string"===typeof a.cookie_name&&(S=a.cookie_name);"function"===typeof a.onAccept&&(xa=a.onAccept);"function"===typeof a.onChange&&(ya=a.onChange);"number"===typeof a.revision&&(-1<a.revision&&(pa=a.revision),Ba=!0);!0===a.autoclear_cookies&&(Pa=!0);!0===a.use_rfc_cookie&&(ja=!0);!0===a.hide_from_bots&&
(Wa=navigator&&navigator.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(navigator.userAgent));Ma=!0===a.page_scripts;Na=!1!==a.page_scripts_order;if(!0===a.auto_language){var b=navigator.language||navigator.browserLanguage;2<b.length&&(b=b[0]+b[1]);L=Ua(b.toLowerCase(),a.languages)}else"string"===typeof a.current_lang&&(L=Ua(a.current_lang,a.languages))}var L="en",Va=!0,S="cc_cookie",Ia=182,T=location.hostname,Ja="/",Ka="Lax",ja=!1,Pa=!0,pa=0,Ma,Na,h={},r={},U=!1,V=!1,la=!1,wa=!1,ka=!1,u,X,x,xa,
ya,Y=!0,Ba=!1,C=null,Wa=!1,ta,Fa,Ea=[],fa=[],P=[],N=[],Da=[],ca=document.documentElement,M,w,I,O,za,Aa,Qa="",ma;h.allowedCategory=function(a){return-1<H(JSON.parse(ia(S,"one",!0)||"{}").level||[],a)};h.run=function(a){if(!document.getElementById("cc_div")&&(db(a),!Wa&&(r=JSON.parse(ia(S,"one",!0)||"{}"),V=void 0!==r.level,C=void 0!==r.data?r.data:null,Y="number"===typeof a.revision?V?-1<a.revision?r.revision===pa:!0:!0:!0,U=!V||!Y,bb(!U,a),$a(a.theme_css,function(){Ta();Oa(a.gui_options);cb();Va&&
U&&h.show(a.delay||0);setTimeout(function(){F(M,"c--anim")},30);setTimeout(function(){Za()},100)}),V&&Y))){var b="boolean"===typeof r.rfc_cookie;if(!b||b&&r.rfc_cookie!==ja)r.rfc_cookie=ja,va(S,JSON.stringify(r));La();if("function"===typeof a.onAccept)a.onAccept(r)}};h.showSettings=function(a){setTimeout(function(){F(ca,"show--settings");I.setAttribute("aria-hidden","false");wa=!0;setTimeout(function(){la?Fa=document.activeElement:ta=document.activeElement;0!==fa.length&&(fa[3]?fa[3].focus():fa[0].focus(),
u=fa)},200)},0<a?a:0)};h.set=function(a,b){switch(a){case "data":a=b.value;var c=!1;if("update"===b.mode)if(C=h.get("data"),(b=typeof C===typeof a)&&"object"===typeof C){!C&&(C={});for(var d in a)C[d]!==a[d]&&(C[d]=a[d],c=!0)}else!b&&C||C===a||(C=a,c=!0);else C=a,c=!0;c&&(r.data=C,va(S,JSON.stringify(r)));return c;case "revision":return d=b.value,a=b.prompt_consent,b=b.message,M&&"number"===typeof d&&r.revision!==d?(Ba=!0,Qa=b,Y=!1,pa=d,!0===a?(Aa(za),Oa(za.gui_options,!0),Ta(),h.show()):h.accept(),
b=!0):b=!1,b}};h.get=function(a){return JSON.parse(ia(S,"one",!0)||"{}")[a]};h.loadScript=function(a,b,c){var d="function"===typeof b;if(document.querySelector('script[src="'+a+'"]'))d&&b();else{var e=f("script");if(c&&0<c.length)for(var g=0;g<c.length;++g)c[g]&&e.setAttribute(c[g].name,c[g].value);d&&(e.readyState?e.onreadystatechange=function(){if("loaded"===e.readyState||"complete"===e.readyState)e.onreadystatechange=null,b()}:e.onload=b);e.src=a;(document.head?document.head:document.getElementsByTagName("head")[0]).appendChild(e)}};
h.show=function(a){U&&setTimeout(function(){F(ca,"show--consent");w.setAttribute("aria-hidden","false");la=!0;setTimeout(function(){ta=document.activeElement;u=Ea},200)},0<a?a:0)};h.hide=function(){U&&(ua(ca,"show--consent"),w.setAttribute("aria-hidden","true"),la=!1,setTimeout(function(){ta.focus();u=null},200))};h.hideSettings=function(){ua(ca,"show--settings");wa=!1;I.setAttribute("aria-hidden","true");setTimeout(function(){la?(Fa&&Fa.focus(),u=Ea):(ta.focus(),u=null);ka=!1},200)};h.accept=function(a,
b){function c(){for(var g=document.querySelectorAll(".c-tgl")||[],l=[],k=0;k<g.length;k++)g[k].checked&&l.push(g[k].value);return l}a=a||void 0;var d=b||[];b=[];if(a)if("object"===typeof a&&"number"===typeof a.length)for(var e=0;e<a.length;e++)-1!==H(N,a[e])&&b.push(a[e]);else"string"===typeof a&&("all"===a?b=N.slice():-1!==H(N,a)&&b.push(a));else b=c();if(1<=d.length)for(e=0;e<d.length;e++)b=b.filter(function(g){return g!==d[e]});for(e=0;e<N.length;e++)!0===Da[e]&&-1===H(b,N[e])&&b.push(N[e]);ab(b)};
h.eraseCookies=function(a,b,c){var d=[];c=c?[c,"."+c]:[T,"."+T];if("object"===typeof a&&0<a.length)for(var e=0;e<a.length;e++)this.validCookie(a[e])&&d.push(a[e]);else this.validCookie(a)&&d.push(a);Ha(d,b,c)};h.validCookie=function(a){return""!=ia(a,"one",!0)};return h}"function"!==typeof window.initCookieConsent&&(window.initCookieConsent=Xa)})();
"details",'[tabindex="0"]'];a(O,fa);U&&a(w,Ea)}function Ua(a,b){if(Object.prototype.hasOwnProperty.call(b,a))return a;if(0<ha(b).length)return Object.prototype.hasOwnProperty.call(b,L)?L:ha(b)[0]}function cb(){for(var a=document.querySelectorAll('a[data-cc="c-settings"], button[data-cc="c-settings"]'),b=0;b<a.length;b++)a[b].setAttribute("aria-haspopup","dialog"),G(a[b],"click",function(c){h.showSettings(0);c.preventDefault?c.preventDefault():c.returnValue=!1})}function db(a){"number"===typeof a.cookie_expiration&&
(Ia=a.cookie_expiration);"boolean"===typeof a.autorun&&(Va=a.autorun);"string"===typeof a.cookie_domain&&(T=a.cookie_domain);"string"===typeof a.cookie_same_site&&(Ka=a.cookie_same_site);"string"===typeof a.cookie_path&&(Ja=a.cookie_path);"string"===typeof a.cookie_name&&(S=a.cookie_name);"function"===typeof a.onAccept&&(xa=a.onAccept);"function"===typeof a.onChange&&(ya=a.onChange);"number"===typeof a.revision&&(-1<a.revision&&(pa=a.revision),Ba=!0);!0===a.autoclear_cookies&&(Pa=!0);!0===a.use_rfc_cookie&&
(ja=!0);!0===a.hide_from_bots&&(Wa=navigator&&(navigator.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(navigator.userAgent)||navigator.g));Ma=!0===a.page_scripts;Na=!1!==a.page_scripts_order;if(!0===a.auto_language){var b=navigator.language||navigator.browserLanguage;2<b.length&&(b=b[0]+b[1]);L=Ua(b.toLowerCase(),a.languages)}else"string"===typeof a.current_lang&&(L=Ua(a.current_lang,a.languages))}var L="en",Va=!0,S="cc_cookie",Ia=182,T=window.location.hostname,Ja="/",Ka="Lax",ja=!1,Pa=!0,pa=0,
Ma,Na,h={},r={},U=!1,V=!1,la=!1,wa=!1,ka=!1,u,X,x,xa,ya,Y=!0,Ba=!1,C=null,Wa=!1,ta,Fa,Ea=[],fa=[],P=[],N=[],Da=[],ca=document.documentElement,M,w,I,O,za,Aa,Qa="",ma;h.allowedCategory=function(a){return-1<H(JSON.parse(ia(S,"one",!0)||"{}").level||[],a)};h.run=function(a){if(!document.getElementById("cc_div")&&(db(a),!Wa&&(r=JSON.parse(ia(S,"one",!0)||"{}"),V=void 0!==r.level,C=void 0!==r.data?r.data:null,Y="number"===typeof a.revision?V?-1<a.revision?r.revision===pa:!0:!0:!0,U=!V||!Y,bb(!U,a),$a(a.theme_css,
function(){Ta();Oa(a.gui_options);cb();Va&&U&&h.show(a.delay||0);setTimeout(function(){F(M,"c--anim")},30);setTimeout(function(){Za()},100)}),V&&Y))){var b="boolean"===typeof r.rfc_cookie;if(!b||b&&r.rfc_cookie!==ja)r.rfc_cookie=ja,va(S,JSON.stringify(r));La();if("function"===typeof a.onAccept)a.onAccept(r)}};h.showSettings=function(a){setTimeout(function(){F(ca,"show--settings");I.setAttribute("aria-hidden","false");wa=!0;setTimeout(function(){la?Fa=document.activeElement:ta=document.activeElement;
0!==fa.length&&(fa[3]?fa[3].focus():fa[0].focus(),u=fa)},200)},0<a?a:0)};h.set=function(a,b){switch(a){case "data":a=b.value;var c=!1;if("update"===b.mode)if(C=h.get("data"),(b=typeof C===typeof a)&&"object"===typeof C){!C&&(C={});for(var d in a)C[d]!==a[d]&&(C[d]=a[d],c=!0)}else!b&&C||C===a||(C=a,c=!0);else C=a,c=!0;c&&(r.data=C,va(S,JSON.stringify(r)));return c;case "revision":return d=b.value,a=b.prompt_consent,b=b.message,M&&"number"===typeof d&&r.revision!==d?(Ba=!0,Qa=b,Y=!1,pa=d,!0===a?(Aa(za),
Oa(za.gui_options,!0),Ta(),h.show()):h.accept(),b=!0):b=!1,b;default:return!1}};h.get=function(a){return JSON.parse(ia(S,"one",!0)||"{}")[a]};h.loadScript=function(a,b,c){var d="function"===typeof b;if(document.querySelector('script[src="'+a+'"]'))d&&b();else{var e=f("script");if(c&&0<c.length)for(var g=0;g<c.length;++g)c[g]&&e.setAttribute(c[g].name,c[g].value);d&&(e.readyState?e.onreadystatechange=function(){if("loaded"===e.readyState||"complete"===e.readyState)e.onreadystatechange=null,b()}:e.onload=
b);e.src=a;(document.head?document.head:document.getElementsByTagName("head")[0]).appendChild(e)}};h.show=function(a){U&&setTimeout(function(){F(ca,"show--consent");w.setAttribute("aria-hidden","false");la=!0;setTimeout(function(){ta=document.activeElement;u=Ea},200)},0<a?a:0)};h.hide=function(){U&&(ua(ca,"show--consent"),w.setAttribute("aria-hidden","true"),la=!1,setTimeout(function(){ta.focus();u=null},200))};h.hideSettings=function(){ua(ca,"show--settings");wa=!1;I.setAttribute("aria-hidden","true");
setTimeout(function(){la?(Fa&&Fa.focus(),u=Ea):(ta.focus(),u=null);ka=!1},200)};h.accept=function(a,b){function c(){for(var g=document.querySelectorAll(".c-tgl")||[],l=[],k=0;k<g.length;k++)g[k].checked&&l.push(g[k].value);return l}a=a||void 0;var d=b||[];b=[];if(a)if("object"===typeof a&&"number"===typeof a.length)for(var e=0;e<a.length;e++)-1!==H(N,a[e])&&b.push(a[e]);else"string"===typeof a&&("all"===a?b=N.slice():-1!==H(N,a)&&b.push(a));else b=c();if(1<=d.length)for(e=0;e<d.length;e++)b=b.filter(function(g){return g!==
d[e]});for(e=0;e<N.length;e++)!0===Da[e]&&-1===H(b,N[e])&&b.push(N[e]);ab(b)};h.eraseCookies=function(a,b,c){var d=[];c=c?[c,"."+c]:[T,"."+T];if("object"===typeof a&&0<a.length)for(var e=0;e<a.length;e++)this.validCookie(a[e])&&d.push(a[e]);else this.validCookie(a)&&d.push(a);Ha(d,b,c)};h.validCookie=function(a){return""!==ia(a,"one",!0)};return h}"function"!==typeof window.initCookieConsent&&(window.initCookieConsent=Xa)})();
{
"name": "vanilla-cookieconsent",
"version": "2.6.1",
"version": "2.6.2",
"description": "🍪 Simple cross-browser cookie-consent plugin written in vanilla js.",

@@ -5,0 +5,0 @@ "main": "dist/cookieconsent.js",

@@ -25,16 +25,11 @@ [Forked](https://github.com/orestbida/cookieconsent) to publish in the NPM registry. No further

## Table of contents
- [Table of contents](#table-of-contents)
- [Key features](#key-features)
- [How to use](#how-to-use)
- [Download & CDN](#download--cdn)
- [NPM](#npm)
- [Layout options & customization](#layout-options--customization)
- [Manage third party scripts](#manage-third-party-scripts)
- [APIs & configuration parameters](#apis--configuration-parameters)
- [All available options](#all-available-options)
- [Full example configurations](#full-example-configurations)
- [How to configure languages & cookie settings](#how-to-configure-languages--cookie-settings)
- [How to enable/manage revisions](#how-to-enablemanage-revisions)
- [FAQ](#faq)
- [License](#license)
1. [Key features](#key-features)
2. [Installation & Usage](#installation--usage)
4. [Layout options & customization](#layout-options--customization)
5. [APIs & config. parameters](#apis--configuration-parameters)
6. [Manage third party scripts](#manage-third-party-scripts)
7. [Configuration examples](#full-example-configurations)
8. [How to enable/manage revisions](#how-to-enablemanage-revisions)
9. [FAQ](#faq)
10. [License](#license)

@@ -51,67 +46,153 @@ ## Key features

## How to use
1. Download (or use via [cdn](#download--cdn)) and include the script at the bottom of `body` tag.
## Installation & Usage
1. Download the [latest release](https://github.com/orestbida/cookieconsent/releases/latest) or use via CDN or [NPM](https://www.npmjs.com/package/vanilla-cookieconsent)
```bash
# CDN links
https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.6.2/dist/cookieconsent.js
https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.6.2/dist/cookieconsent.css
```
Thanks to [Till Sanders](https://github.com/tillsanders) for bringing the plugin on npm.
```bash
npm i vanilla-cookieconsent
yarn add vanilla-cookieconsent
```
1. Import the plugin: add a `script` tag pointing to `cookieconsent.js`
```html
<script src="<path-to-cookieconsent.js>"></script>
<html>
<head> <!-- head content --> </head>
<body>
<!-- body content -->
<script defer src="<path-to-cookieconsent.js>"></script>
</body>
</html>
```
2. Run the plugin with your configuration parameters. **IMPORTANT**: you must provide at least the following parameters: `current_lang` and `languages`
<span>Note: replace `<path-to-cookieconsent.js>` with a valid path!</span>
<br>
<details><summary><b>Show basic example</b></summary>
```html
<script defer src="<path-to-cookieconsent.js>"></script>
<script>
window.addEventListener('load', function(){
3. Configure and run
- <details><summary>As external script</summary>
<p>
var cookieconsent = initCookieConsent();
- Create a `.js` file (e.g. `cookieconsent-init.js`) and import it in your html page
```html
<body>
<!-- body content ... -->
<script defer src="<path-to-cookieconsent.js>"></script>
<script defer src="<path-to-cookieconsent-init.js>"></script>
<body>
```
cookieconsent.run({
current_lang : 'en',
theme_css : '<path-to-cookieconsent.css>',
- Configure the plugin inside `cookieconsent-init.js`
```javascript
// obtain plugin
var cc = initCookieConsent();
onAccept : function(){
// do something ...
// run plugin with your configuration
cc.run({
current_lang: 'en',
autoclear_cookies: true, // default: false
theme_css: '<path-to-cookieconsent.css>', // 🚨 replace with a valid path
page_scripts: true, // default: false
// delay: 0, // default: 0
// auto_language: false, // default: false
// autorun: true, // default: true
// force_consent: false, // default: false
// hide_from_bots: false, // default: false
// remove_cookie_tables: false // default: false
// cookie_name: 'cc_cookie', // default: 'cc_cookie'
// cookie_expiration: 182, // default: 182 (days)
// cookie_domain: location.hostname, // default: current domain
// cookie_path: '/', // default: root
// cookie_same_site: 'Lax', // default: 'Lax'
// use_rfc_cookie: false, // default: false
// revision: 0, // default: 0
onAccept: function (cookie) {
// ...
},
languages : {
en : {
consent_modal : {
title : "I use cookies",
description : 'Your cookie consent message here',
onChange: function (cookie, changed_preferences) {
// ...
},
languages: {
'en': {
consent_modal: {
title: 'We use cookies!',
description: 'Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent. <button type="button" data-cc="c-settings" class="cc-link">Let me choose</button>',
primary_btn: {
text: 'Accept',
role: 'accept_all' //'accept_selected' or 'accept_all'
text: 'Accept all',
role: 'accept_all' // 'accept_selected' or 'accept_all'
},
secondary_btn: {
text : 'Reject',
role : 'accept_necessary' //'settings' or 'accept_necessary'
text: 'Reject all',
role: 'accept_necessary' // 'settings' or 'accept_necessary'
}
},
settings_modal : {
title : 'Cookie settings',
save_settings_btn : "Save settings",
accept_all_btn : "Accept all",
reject_all_btn : "Reject all", // optional, [v.2.5.0 +]
close_btn_label: "Close",
blocks : [
settings_modal: {
title: 'Cookie preferences',
save_settings_btn: 'Save settings',
accept_all_btn: 'Accept all',
reject_all_btn: 'Reject all',
close_btn_label: 'Close',
cookie_table_headers: [
{col1: 'Name'},
{col2: 'Domain'},
{col3: 'Expiration'},
{col4: 'Description'}
],
blocks: [
{
title : "Cookie usage",
description: 'Your cookie usage disclaimer'
},{
title : "Strictly necessary cookies",
description: 'Category description ... ',
toggle : {
value : 'necessary',
enabled : false,
readonly: true
title: 'Cookie usage 📢',
description: 'I use cookies to ensure the basic functionalities of the website and to enhance your online experience. You can choose for each category to opt-in/out whenever you want. For more details relative to cookies and other sensitive data, please read the full <a href="#" class="cc-link">privacy policy</a>.'
}, {
title: 'Strictly necessary cookies',
description: 'These cookies are essential for the proper functioning of my website. Without these cookies, the website would not work properly',
toggle: {
value: 'necessary',
enabled: true,
readonly: true // cookie categories with readonly=true are all treated as "necessary cookies"
}
},{
title : "Analytics cookies",
description: 'Category description ... ',
toggle : {
value : 'analytics',
enabled : false,
}, {
title: 'Performance and Analytics cookies',
description: 'These cookies allow the website to remember the choices you have made in the past',
toggle: {
value: 'analytics', // your cookie category
enabled: false,
readonly: false
},
cookie_table: [ // list of all expected cookies
{
col1: '^_ga', // match all cookies starting with "_ga"
col2: 'google.com',
col3: '2 years',
col4: 'description ...',
is_regex: true
},
{
col1: '_gid',
col2: 'google.com',
col3: '1 day',
col4: 'description ...',
}
]
}, {
title: 'Advertisement and Targeting cookies',
description: 'These cookies collect information about how you use the website, which pages you visited and which links you clicked on. All of the data is anonymized and cannot be used to identify you',
toggle: {
value: 'targeting',
enabled: false,
readonly: false
}
},
}, {
title: 'More information',
description: 'For any queries in relation to our policy on cookies and your choices, please <a class="cc-link" href="#yourcontactpage">contact us</a>.',
}
]

@@ -122,32 +203,134 @@ }

});
});
</script>
```
</summary>
</details>
<br>
```
</p>
</details>
- <details><summary>As inline script</summary>
<p>
For more details check out [full examples](#full-example-configurations) and [how to configure languages & cookie settings](#how-to-configure-languages--cookie-settings) sections.
```html
<body>
<!-- body content ... -->
<script defer src="<path-to-cookieconsent.js>"></script>
<!-- Inline script -->
<script>
window.addEventListener('load', function(){
// obtain plugin
var cc = initCookieConsent();
## Download & CDN
You can download the [latest version](https://github.com/orestbida/cookieconsent/releases) or use it via cdn:
// run plugin with your configuration
cc.run({
current_lang: 'en',
autoclear_cookies: true, // default: false
theme_css: '<path-to-cookieconsent.css>', // 🚨 replace with a valid path
page_scripts: true, // default: false
javascript :
```html
https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.6.0/dist/cookieconsent.js
```
// delay: 0, // default: 0
// auto_language: false, // default: false
// autorun: true, // default: true
// force_consent: false, // default: false
// hide_from_bots: false, // default: false
// remove_cookie_tables: false // default: false
// cookie_name: 'cc_cookie', // default: 'cc_cookie'
// cookie_expiration: 182, // default: 182 (days)
// cookie_domain: location.hostname, // default: current domain
// cookie_path: '/', // default: root
// cookie_same_site: 'Lax', // default: 'Lax'
// use_rfc_cookie: false, // default: false
// revision: 0, // default: 0
stylesheet :
```html
https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@v2.6.0//dist/cookieconsent.css
```
onAccept: function (cookie) {
// ...
},
## NPM
Thanks to [Till Sanders](https://github.com/tillsanders) for bringing the plugin on [npm](https://www.npmjs.com/package/vanilla-cookieconsent).
onChange: function (cookie, changed_preferences) {
// ...
},
```
npm i vanilla-cookieconsent
yarn add vanilla-cookieconsent
```
languages: {
'en': {
consent_modal: {
title: 'We use cookies!',
description: 'Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent. <button type="button" data-cc="c-settings" class="cc-link">Let me choose</button>',
primary_btn: {
text: 'Accept all',
role: 'accept_all' // 'accept_selected' or 'accept_all'
},
secondary_btn: {
text: 'Reject all',
role: 'accept_necessary' // 'settings' or 'accept_necessary'
}
},
settings_modal: {
title: 'Cookie preferences',
save_settings_btn: 'Save settings',
accept_all_btn: 'Accept all',
reject_all_btn: 'Reject all',
close_btn_label: 'Close',
cookie_table_headers: [
{col1: 'Name'},
{col2: 'Domain'},
{col3: 'Expiration'},
{col4: 'Description'}
],
blocks: [
{
title: 'Cookie usage 📢',
description: 'I use cookies to ensure the basic functionalities of the website and to enhance your online experience. You can choose for each category to opt-in/out whenever you want. For more details relative to cookies and other sensitive data, please read the full <a href="#" class="cc-link">privacy policy</a>.'
}, {
title: 'Strictly necessary cookies',
description: 'These cookies are essential for the proper functioning of my website. Without these cookies, the website would not work properly',
toggle: {
value: 'necessary',
enabled: true,
readonly: true // cookie categories with readonly=true are all treated as "necessary cookies"
}
}, {
title: 'Performance and Analytics cookies',
description: 'These cookies allow the website to remember the choices you have made in the past',
toggle: {
value: 'analytics', // your cookie category
enabled: false,
readonly: false
},
cookie_table: [ // list of all expected cookies
{
col1: '^_ga', // match all cookies starting with "_ga"
col2: 'google.com',
col3: '2 years',
col4: 'description ...',
is_regex: true
},
{
col1: '_gid',
col2: 'google.com',
col3: '1 day',
col4: 'description ...',
}
]
}, {
title: 'Advertisement and Targeting cookies',
description: 'These cookies collect information about how you use the website, which pages you visited and which links you clicked on. All of the data is anonymized and cannot be used to identify you',
toggle: {
value: 'targeting',
enabled: false,
readonly: false
}
}, {
title: 'More information',
description: 'For any queries in relation to our policy on cookies and your choices, please <a class="cc-link" href="#yourcontactpage">contact us</a>.',
}
]
}
}
}
});
});
</script>
<body>
```
</p>
</details>
<br>

@@ -159,16 +342,16 @@ ## Layout options & customization

cookieconsent.run({
...
// ...
gui_options: {
consent_modal : {
layout : 'cloud', // box/cloud/bar
position : 'bottom center', // bottom/middle/top + left/right/center
consent_modal: {
layout: 'cloud', // box/cloud/bar
position: 'bottom center', // bottom/middle/top + left/right/center
transition: 'slide' // zoom/slide
},
settings_modal : {
layout : 'box', // box/bar
// position : 'left', // left/right
transition: 'slide' // zoom/slide
settings_modal: {
layout: 'box', // box/bar
// position: 'left', // left/right
transition: 'slide' // zoom/slide
}
}
...
//...
});

@@ -179,3 +362,3 @@ ```

## Manage third party scripts
If you have `<script>` tags which you want to manage through the cookieconsent (enable based on a specific cookie category) you can do this by either moving the javascript code inside the onAccept/onChange methods and using the provided APIs below, or via `page_scripts` option:
You can easily manage third party scripts (enable/disable based on user's preferences) via the `page_scripts` option:

@@ -186,20 +369,16 @@ 1. Enable page scripts management:

cookieconsent.run({
...
// ...
page_scripts: true
...
// ...
});
```
2. Disable the script tag by setting `type="text/plain"`:
2. Set `type="text/plain"` and `data-cookiecategory="<category>"` to any `script` tag you want to manage:
```html
<script type="text/plain" src="<path>/analytics.js" defer>
<script type="text/plain" data-cookiecategory="analytics" src="analytics.js" defer></script>
```
3. Add `data-cookiecategory` attribute:
<i>Note: `data-cookiecategory` must be a valid category defined inside the configuration object</i>
```html
<script type="text/plain" data-cookiecategory="analytics" src="<path>/analytics.js" defer>
```
<i>Note: data-cookiecategory must also be defined inside the config. object</i>
## APIs & configuration parameters
## API & configuration parameters
After getting the plugin like so:

@@ -259,10 +438,10 @@

```javascript
...
toggle : {
// ...
toggle: {
value: 'analytics', // cookie category
enabled : false, // default status
readonly: false // allow to enable/disable
// reload : 'on_disable', // allows to reload page when the current cookie category is deselected
// reload: 'on_disable', // allows to reload page when the current cookie category is deselected
}
...
// ...
```

@@ -273,3 +452,3 @@

// Check if user accepts cookie consent with analytics category enabled
if(!cookieconsent.allowedCategory('analytics')){
if (!cookieconsent.allowedCategory('analytics')) {
// yoo, you might want to load analytics.js ...

@@ -287,3 +466,3 @@ };

// Example: check if '_gid' cookie is set
if(!cookieconsent.validCookie('_gid')){
if (!cookieconsent.validCookie('_gid')) {
// yoo, _gid cookie is not set, do something ...

@@ -378,23 +557,23 @@ };

Below a table which sums up all of the available options (must be passed to the .run() method).
| Option | Type | Default | Description |
|--------------------- |---------- |--------- |---------------------------------------------------------------------------------------------------------------------------------- |
| `autorun` | boolean | true | If enabled, show the cookie consent as soon as possible (otherwise you need to manually call the `.show()` method) |
| `delay` | number | 0 | Number of `milliseconds` before showing the consent-modal |
| `cookie_expiration` | number | 182 | Number of days before the cookie expires (182 days = 6 months) |
| Option | Type | Default | Description |
|--------------------- |---------- |--------- |---------------------------------------------------------------------------------------------------------------------------------- |
| `autorun` | boolean | true | If enabled, show the cookie consent as soon as possible (otherwise you need to manually call the `.show()` method) |
| `delay` | number | 0 | Number of `milliseconds` before showing the consent-modal |
| `cookie_expiration` | number | 182 | Number of days before the cookie expires (182 days = 6 months) |
| `cookie_path` | string | "/" | Path where the cookie will be set |
| `cookie_domain` | string | location.hostname | Specify your domain (will be grabbed by default) or a subdomain |
| `cookie_same_site` | string | "Lax" | SameSite attribute |
| `use_rfc_cookie` | boolean | false | Enable if you want the value of the cookie to be rfc compliant (it's base64 encoded) |
| `theme_css` | string | - | Specify path to the .css file |
| `use_rfc_cookie` | boolean | false | Enable if you want the value of the cookie to be rfc compliant |
| `theme_css` | string | - | Specify path to the .css file |
| `force_consent` | boolean | false | Enable if you want to block page navigation until user action (check [faq](#faq) for a proper implementation) |
| `revision` | number | 0 | Specify this option to enable revisions. [Check below](#how-to-enablemanage-revisions) for a proper usage |
| `current_lang` | string | - | Specify one of the languages you have defined (can also be dynamic): `'en'`, `'de'` ... |
| `auto_language` | boolean | false | Automatically detect language based on the user's browser language, if language is not defined => use specified `current_lang` |
| `autoclear_cookies` | boolean | false | Enable if you want to automatically delete cookies when user opts-out of a specific category inside cookie settings |
| `page_scripts` | boolean | false | Enable if you want to easily `manage existing <script>` tags. Check [manage third party scripts](#manage-third-party-scripts) |
| `remove_cookie_tables`| boolean | false | Enable if you want to remove the html cookie tables (but still want to make use of `autoclear_cookies`) |
| `hide_from_bots` | boolean | false | Enable if you don't want the plugin to run when a bot/crawler is detected |
| `current_lang` | string | - | Specify one of the languages you have defined (can also be dynamic): `'en'`, `'de'` ... |
| `auto_language` | boolean | false | Automatically detect language based on the user's browser language, if language is not defined => use specified `current_lang` |
| `autoclear_cookies` | boolean | false | Enable if you want to automatically delete cookies when user opts-out of a specific category inside cookie settings |
| `page_scripts` | boolean | false | Enable if you want to easily `manage existing <script>` tags. Check [manage third party scripts](#manage-third-party-scripts) |
| `remove_cookie_tables`| boolean | false | Enable if you want to remove the html cookie tables (but still want to make use of `autoclear_cookies`) |
| `hide_from_bots` | boolean | false | Enable if you don't want the plugin to run when a bot/crawler/webdriver is detected |
| `gui_options` | object | - | Customization option which allows to choose layout, position and transition. Check [layout options & customization](#layout-options--customization) |
| __`onAccept`__ | function | - | Method run `once` either when: <br> 1. The moment the cookie consent is accepted <br> 2. After each page load (if cookie consent has already been accepted) |
| __`onChange`__ | function | - | Method run `whenever preferences are modified` (and only if cookie consent has already been accepted) |
| __`onAccept`__ | function | - | Method run `once` either when: <br> 1. The moment the cookie consent is accepted <br> 2. After each page load (if cookie consent has already been accepted) |
| __`onChange`__ | function | - | Method run `whenever preferences are modified` (and only if cookie consent has already been accepted) |
| `languages` | object | - | [Check below](#how-to-configure-languages--cookie-settings) for configuration

@@ -406,5 +585,4 @@

How to:
1. enable `page_scripts`
2. set `type="text/plain"`and `data-cookiecategory="<your-category>"` to each script:
2. set `type="text/plain"` and `data-cookiecategory="<your-category>"` to each script:

@@ -426,3 +604,3 @@ <br>

<script>
window.addEventListener('load', function(){
window.addEventListener('load', function () {
// obtain cookieconsent plugin

@@ -433,60 +611,60 @@ var cookieconsent = initCookieConsent();

cookieconsent.run({
autorun : true,
current_lang : 'en',
theme_css : "<path-to-cookieconsent.css>",
autoclear_cookies : true,
autorun: true,
current_lang: 'en',
theme_css: '<path-to-cookieconsent.css>',
autoclear_cookies: true,
page_scripts: true,
onAccept: function(cookie){
onAccept: function (cookie) {
// ... cookieconsent accepted
},
onChange: function(cookie, changed_preferences){
onChange: function (cookie, changed_preferences) {
// ... cookieconsent preferences were changed
},
languages : {
en : {
consent_modal : {
title : "I use cookies",
description : 'Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only upon approval. <a aria-label="Cookie policy" class="cc-link" href="#">Read more</a>',
languages: {
en: {
consent_modal: {
title: 'I use cookies',
description: 'Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only upon approval. <a aria-label="Cookie policy" class="cc-link" href="#">Read more</a>',
primary_btn: {
text: 'Accept',
role: 'accept_all' //'accept_selected' or 'accept_all'
role: 'accept_all' // 'accept_selected' or 'accept_all'
},
secondary_btn: {
text : 'Settings',
role : 'settings' //'settings' or 'accept_necessary'
text: 'Settings',
role: 'settings' // 'settings' or 'accept_necessary'
}
},
settings_modal : {
title : 'Cookie preferences',
save_settings_btn : "Save settings",
accept_all_btn : "Accept all",
reject_all_btn : "Reject all", // optional, [v.2.5.0 +]
cookie_table_headers : [
{col1: "Name" },
{col2: "Domain" },
{col3: "Expiration" },
{col4: "Description" },
{col5: "Type" }
settings_modal: {
title: 'Cookie preferences',
save_settings_btn: 'Save settings',
accept_all_btn: 'Accept all',
reject_all_btn: 'Reject all', // optional, [v.2.5.0 +]
cookie_table_headers: [
{col1: 'Name'},
{col2: 'Domain'},
{col3: 'Expiration'},
{col4: 'Description'},
{col5: 'Type'}
],
blocks : [
blocks: [
{
title : "Cookie usage",
title: 'Cookie usage',
description: 'I use cookies to ensure the basic functionalities of the website and to enhance your online experience. You can choose for each category to opt-in/out whenever you want.'
},{
title : "Strictly necessary cookies",
}, {
title: 'Strictly necessary cookies',
description: 'These cookies are essential for the proper functioning of my website. Without these cookies, the website would not work properly.',
toggle : {
value : 'necessary',
enabled : true,
toggle: {
value: 'necessary',
enabled: true,
readonly: true
}
},{
title : "Analytics cookies",
}, {
title: 'Analytics cookies',
description: 'These cookies collect information about how you use the website, which pages you visited and which links you clicked on. All of the data is anonymized and cannot be used to identify you.',
toggle : {
value : 'analytics',
enabled : false,
toggle: {
value: 'analytics',
enabled: false,
readonly: false

@@ -499,3 +677,3 @@ },

col3: '2 years',
col4: 'description ...' ,
col4: 'description ...',
col5: 'Permanent cookie',

@@ -508,8 +686,8 @@ is_regex: true

col3: '1 day',
col4: 'description ...' ,
col4: 'description ...',
col5: 'Permanent cookie'
}
]
},{
title : "More information",
}, {
title: 'More information',
description: 'For any queries in relation to my policy on cookies and your choices, please <a class="cc-link" href="#yourwebsite">contact me</a>.',

@@ -538,39 +716,39 @@ }

cookieconsent.run({
...,
languages : {
'en' : {
consent_modal : {
title : "Title here ...",
description : 'Description here ...',
// ...,
languages: {
'en': {
consent_modal: {
title: 'Title here ...',
description: 'Description here ...',
primary_btn: {
text: 'Accept',
role: 'accept_all' //'accept_selected' or 'accept_all'
role: 'accept_all' // 'accept_selected' or 'accept_all'
},
secondary_btn: {
text : 'Settings',
role : 'settings' //'settings' or 'accept_necessary'
text: 'Settings',
role: 'settings' // 'settings' or 'accept_necessary'
}
},
settings_modal : {
title : 'Cookie preferences ...',
save_settings_btn : "Save settings",
accept_all_btn : "Accept all",
blocks : [
settings_modal: {
title: 'Cookie preferences ...',
save_settings_btn: 'Save settings',
accept_all_btn: 'Accept all',
blocks: [
{
title : "First block title ...",
title: 'First block title ...',
description: 'First block description ...'
},{
title : "Second block title ...",
}, {
title: 'Second block title ...',
description: 'Second block description ...',
toggle : {
value : 'my_category1',
enabled : true,
toggle: {
value: 'my_category1',
enabled: true,
readonly: true
}
},{
title : "Third block title ...",
}, {
title: 'Third block title ...',
description: 'Third block description ...',
toggle : {
value : 'my_category2',
enabled : false,
toggle: {
value: 'my_category2',
enabled: false,
readonly: false

@@ -582,37 +760,37 @@ }

},
'it' : {
consent_modal : {
title : "Title in italian here ...",
description : 'Description in italian here ...',
'it': {
consent_modal: {
title: 'Title in italian here ...',
description: 'Description in italian here ...',
primary_btn: {
text: 'Accept in italian',
role: 'accept_all' //'accept_selected' or 'accept_all'
role: 'accept_all' //'accept_selected' or 'accept_all'
},
secondary_btn: {
text : 'Settings',
role : 'settings' //'settings' or 'accept_necessary'
text: 'Settings',
role: 'settings' //'settings' or 'accept_necessary'
}
},
settings_modal : {
title : 'Cookie preferences ...',
save_settings_btn : "Save settings in italian",
accept_all_btn : "Accept all",
blocks : [
settings_modal: {
title: 'Cookie preferences ...',
save_settings_btn: 'Save settings in italian',
accept_all_btn: "Accept all",
blocks: [
{
title : "First block title in italian ...",
title: 'First block title in italian ...',
description: 'First block description in italian ...'
},{
title : "Second block title in italian ...",
}, {
title: 'Second block title in italian ...',
description: 'Second block description in italian...',
toggle : {
value : 'my_category1',
enabled : true,
toggle: {
value: 'my_category1',
enabled: true,
readonly: true
}
},{
title : "Third block title in italian ...",
}, {
title: 'Third block title in italian ...',
description: 'Third block description in italian...',
toggle : {
value : 'my_category2',
enabled : false,
toggle: {
value: 'my_category2',
enabled: false,
readonly: false

@@ -652,32 +830,30 @@ }

cookieconsent.run({
...,
// ...,
revision: 1,
...
// ...
})
```
2. Set a valid `revision_message` parameter (optional) inside `consent_modal`, and put the following placeholder `{{revision_message}}` somewhere inside `description`:
2. Set a valid `revision_message` parameter (optional) inside `consent_modal`, and add the following placeholder `{{revision_message}}` inside `description`:
```javascript
cookieconsent.run({
...,
// ...,
revision: 1,
...,
languages : {
en : {
consent_modal : {
...,
description: "Usual description ... {{revision_message}}",
revision_message: "<br> Dude, my terms have changed. Sorry for bothering you again!",
...
// ...,
languages: {
en: {
consent_modal: {
// ...,
description: 'Usual description ... {{revision_message}}',
revision_message: '<br> Dude, my terms have changed. Sorry for bothering you again!',
// ...
},
...
// ...
}
}
...
// ...
})
```
## FAQ

@@ -717,5 +893,5 @@ - <details><summary>How to enable dark-mode</summary>

cookieconsent.run({
...
current_lang : document.documentElement.getAttribute('lang'),
...
// ...
current_lang: document.documentElement.getAttribute('lang'),
// ...
});

@@ -740,5 +916,5 @@ ```

cookieconsent.run({
..,
// ...
page_scripts: true,
...
// ...
});

@@ -749,3 +925,3 @@ ```

```html
<script type="text/plain" data-cookiecategory="analytics" src="<path-to-analytics.js"></script>
<script type="text/plain" data-cookiecategory="analytics" src="<path-to-analytics.js>"></script>
```

@@ -762,6 +938,6 @@

cookieconsent.run({
..,
onAccept: function(){
if(cookieconsent.allowedCategory('analytics')){
cookieconsent.loadScript('<path-to-analytics.js', function(){
// ...
onAccept: function () {
if (cookieconsent.allowedCategory('analytics')) {
cookieconsent.loadScript('<path-to-analytics.js', function () {
// script loaded ...

@@ -785,5 +961,5 @@ });

cookieconsent.run({
...
theme_css : "../src/cookieconsent.css",
...
// ...
theme_css: '../src/cookieconsent.css',
// ...
});

@@ -802,5 +978,5 @@ ```

cookieconsent.run({
...
force_consent : true,
...
// ...
force_consent: true,
// ...
});

@@ -812,3 +988,3 @@ ```

html,
body{
body {
height: auto!important;

@@ -835,9 +1011,9 @@ width: 100vw!important;

```javascript
...
cookie_table_headers : [
{col1: "Name" },
{col2: "Source" },
{col3: "Description" },
// ...
cookie_table_headers: [
{col1: "Name"},
{col2: "Source"},
{col3: "Description"},
]
...
// ...
```

@@ -848,3 +1024,3 @@

```javascript
...
// ...
cookie_table: [

@@ -862,3 +1038,3 @@ {

]
...
// ...
```

@@ -869,3 +1045,46 @@

</details>
- <details><summary>How to use in React</summary>
<p>
1. Create a new component: `CookieConsent.js`
```javascript
import { useEffect } from "react";
import "./<path-to-cookieconsent.css>";
import "./<path-to-cookieconsent.js>";
export default function CookieConsent() {
useEffect(() => {
const cc = window.initCookieConsent();
cc.run({
// your config
});
}, []);
return null;
}
```
2. Import the component only once (generally in your main/root component like `App.js` or `index.js`)
```javascript
import CookieConsent from "./<path-to-CookieConsent.js-component>";
export default function App() {
return (
<div className="App">
<h1>Hello World</h1>
<CookieConsent/>
</div>
);
}
```
</p>
</details>
## License
Distributed under the MIT License. See [LICENSE](https://github.com/orestbida/cookieconsent/blob/master/LICENSE) for more information.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc