vanilla-cookieconsent
Advanced tools
Comparing version 3.0.0-rc.10 to 3.0.0-rc.11
/*! | ||
* CookieConsent 3.0.0-rc.10 | ||
* CookieConsent 3.0.0-rc.11 | ||
* https://github.com/orestbida/cookieconsent | ||
@@ -7,2 +7,2 @@ * Author Orest Bida | ||
*/ | ||
const e='button';class t{constructor(){this.t={mode:'opt-in',revision:0,autoShow:!0,autoClearCookies:!0,manageScriptTags:!0,hideFromBots:!0,lazyHtmlGeneration:!0,cookie:{name:'cc_cookie',expiresAfterDays:182,domain:'',path:'/',sameSite:'Lax'}},this.o={i:{},l:'',_:{},u:{},p:{},m:[],g:!1,v:null,h:null,C:null,S:'',k:!0,T:!1,M:!1,D:!1,A:!1,N:!1,H:!1,I:!1,V:!1,P:[],F:!1,O:!0,j:[],R:!1,B:'',G:!1,J:[],L:[],U:[],$:[],q:!1,K:!1,W:!1,X:[],Y:[],Z:[],ee:{},te:{},oe:{},ne:{},ae:{},se:[],ce:[]},this.ie={re:{},le:{}},this.de={},this.fe={_e:'cc:onFirstConsent',ue:'cc:onConsent',pe:'cc:onChange',me:'cc:onModalShow',ge:'cc:onModalHide',ve:'cc:onModalReady'}}}const o=new t,n=(e,t)=>e.indexOf(t),a=(e,t)=>-1!==n(e,t),s=e=>Array.isArray(e),c=e=>'string'==typeof e,i=e=>!!e&&'object'==typeof e&&!s(e),r=e=>'function'==typeof e,l=e=>Object.keys(e),d=e=>Array.from(new Set(e)),f=()=>document.activeElement,_=e=>e.preventDefault(),u=(e,t)=>e.querySelectorAll(t),p=e=>e.dispatchEvent(new Event('change')),m=t=>{const o=document.createElement(t);return t===e&&(o.type=t),o},g=(e,t,o)=>e.setAttribute(t,o),v=(e,t,o)=>{e.removeAttribute(o?'data-'+t:t)},b=(e,t,o)=>e.getAttribute(o?'data-'+t:t),h=(e,t)=>e.appendChild(t),y=(e,t)=>e.classList.add(t),C=(e,t)=>y(e,'cm__'+t),w=(e,t)=>y(e,'pm__'+t),S=(e,t)=>e.classList.remove(t),k=e=>{if('object'!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());let t=Array.isArray(e)?[]:{};for(let o in e){let n=e[o];t[o]=k(n)}return t},T=()=>{const e={},{J:t,ee:n,te:a}=o.o;for(const o of t)e[o]=A(a[o],l(n[o]));return e},M=(e,t)=>dispatchEvent(new CustomEvent(e,{detail:t})),x=(e,t,n,a)=>{e.addEventListener(t,n),a&&o.o.m.push({be:e,he:t,ye:n})},D=()=>{const e=o.t.cookie.expiresAfterDays;return r(e)?e(o.o.B):e},A=(e,t)=>{const o=e||[],n=t||[];return o.filter((e=>!a(n,e))).concat(n.filter((e=>!a(o,e))))},E=e=>{o.o.L=d(e),o.o.B=(()=>{let e='custom';const{L:t,J:n,U:a}=o.o,s=t.length;return s===n.length?e='all':s===a.length&&(e='necessary'),e})()},N=(e,t,n,a)=>{const{show:s,showPreferences:c,hide:i,hidePreferences:r,acceptCategory:l}=t,d=e||document,f=e=>u(d,`[data-cc="${e}"]`),p=(e,t)=>{_(e),l(t),r(),i()},m=f('show-preferencesModal'),v=f('show-consentModal'),b=f('accept-all'),h=f('accept-necessary'),y=f('accept-custom'),C=o.t.lazyHtmlGeneration;for(const e of m)g(e,'aria-haspopup','dialog'),x(e,'click',(e=>{_(e),c()})),C&&x(e,'mouseenter',(e=>{_(e),o.o.A||n(t,a)}),!0);for(let e of v)g(e,'aria-haspopup','dialog'),x(e,'click',(e=>{_(e),s(!0)}),!0);for(let e of b)x(e,'click',(e=>{p(e,'all')}),!0);for(let e of y)x(e,'click',(e=>{p(e)}),!0);for(let e of h)x(e,'click',(e=>{p(e,[])}),!0)},H=()=>{const{k:e,L:t,J:n}=o.o;return{accepted:t,rejected:e?[]:n.filter((e=>!a(t,e)))}};let I;const V=e=>{clearTimeout(I),e?y(o.ie.Ce,'disable--interaction'):I=setTimeout((()=>{S(o.ie.Ce,'disable--interaction')}),500)},P=()=>{const{o:t,ie:n}=o,a=['[href]',e,'input','details','[tabindex="0"]'].join(':not([tabindex="-1"]), '),s=(e,t)=>{const o=u(e,a);t[0]=o[0],t[1]=o[o.length-1]};t.T&&s(n.we,t.X),t.A&&s(n.Se,t.Y),t.I=!1,t.H=!1},F=(e,t,n)=>{const{pe:a,ue:s,_e:c,ge:i,ve:l,me:d}=o.de,f=o.fe,_={cookie:o.o.p};if(t){const o={modalName:t};return e===f.me?r(d)&&d(o):e===f.ge?r(i)&&i(o):(o.modal=n,r(l)&&l(o)),M(e,o)}e===f._e?r(c)&&c(k(_)):e===f.ue?r(s)&&s(k(_)):(_.changedCategories=o.o.j,_.changedServices=o.o.ne,r(a)&&a(k(_))),M(e,k(_))},O=e=>{const{te:t,ne:n,J:s,ee:c,se:i,ce:l,p:d,j:f}=o.o;for(const e of s){const o=n[e]||t[e]||[];for(const n of o){const o=c[e][n],{onAccept:s,onReject:i}=o;o&&(!o.ke&&a(t[e],n)&&r(s)?(o.ke=!0,s()):o.ke&&!a(t[e],n)&&r(i)&&(o.ke=!1,i()))}}if(!o.t.manageScriptTags)return;const _=i,u=e||d.categories||[],p=(e,o)=>{if(o<e.length){const s=e[o],c=l[o],i=c.Te,r=c.Me,d=a(u,i),_=!!r&&a(t[i],r);if(!c.xe){let t=!r&&!c.De&&d,l=r&&!c.De&&_,u=!r&&c.De&&!d&&a(f,i),h=r&&c.De&&!_&&a(n[i]||[],r);if(t||u||l||h){c.xe=!0;const t=b(s,'type',!0);v(s,'type',!!t),v(s,'data-category');let n=b(s,'src',!0);n&&v(s,'src',!0);const a=m('script');a.textContent=s.innerHTML;for(const{nodeName:e}of s.attributes)g(a,e,s[e]||b(s,e));if(t&&(a.type=t),n?a.src=n:n=s.src,n&&(a.onload=a.onerror=()=>{p(e,++o)}),s.replaceWith(a),n)return}}p(e,++o)}};p(_,0)},j=['middle','top','bottom'],R=['left','center','right'],B={box:{Ae:['wide','inline'],Ee:j,Ne:R,He:'bottom',Ie:'right'},cloud:{Ae:['inline'],Ee:j,Ne:R,He:'bottom',Ie:'center'},bar:{Ae:['inline'],Ee:j.slice(1),Ne:[],He:'bottom',Ie:''}},G={box:{Ae:[],Ee:[],Ne:[],He:'',Ie:''},bar:{Ae:['wide'],Ee:[],Ne:['left','right'],He:'',Ie:'left'}},J=e=>{const t=o.o.i.guiOptions,n=t?.consentModal,a=t?.preferencesModal;0===e&&L(o.ie.we,B,n,'cm--','box','cm'),1===e&&L(o.ie.Se,G,a,'pm--','box','pm')},L=(e,t,n,s,c,i)=>{if(!n)return;e.className=i;const{layout:r,position:l,flipButtons:d}=n,f=!1!==n.equalWeightButtons,_=r?.split(' ')||[],u=_[0],p=_[1],m=u in t?u:c,g=t[m],v=a(g.Ae,p)&&p,b=l?.split(' ')||[],h=b[0],C='pm--'===s?b[0]:b[1],w=a(g.Ee,h)?h:g.He,k=a(g.Ne,C)?C:g.Ie,T=t=>y(e,s+t);T(m),T(v),T(w),T(k),d&&T('flip');const M=i+'__btn--secondary';if('cm'===i){const{Ve:e,Pe:t}=o.ie;e&&(f?S(e,M):y(e,M)),t&&(f?S(t,M):y(t,M))}else{const{Fe:e}=o.ie;e&&(f?S(e,M):y(e,M))}},U=(t,n)=>{const a=o.o,s=o.ie,{hide:r,hidePreferences:d,acceptCategory:f}=t,_=e=>{f(e),d(),r()},u=a.u&&a.u.preferencesModal;if(!u)return;const p=u.title,v=u.closeIconLabel,b=u.acceptAllBtn,C=u.acceptNecessaryBtn,k=u.savePreferencesBtn,T=u.sections,M=b||C||k;if(s.Oe)s.je=m('div'),w(s.je,'body');else{s.Oe=m('div'),y(s.Oe,'pm-wrapper'),s.Se=m('div'),s.Se.style.visibility='hidden',y(s.Se,'pm'),g(s.Se,'role','dialog'),g(s.Se,'aria-hidden',!0),g(s.Se,'aria-modal',!0),g(s.Se,'aria-labelledby','pm__title'),x(s.Ce,'keydown',(e=>{27===e.keyCode&&d()}),!0),s.Re=m('div'),w(s.Re,'header'),s.Be=m('div'),w(s.Be,'title'),s.Be.id='pm__title',g(s.Be,'role','heading'),g(s.Be,'aria-level','2'),s.Ge=m(e),w(s.Ge,'close-btn'),g(s.Ge,'aria-label',u.closeIconLabel||''),x(s.Ge,'click',d),s.Je=m('div'),w(s.Je,'body'),s.Le=m('div'),w(s.Le,'footer');var D=m('div');y(D,'btns');var A=m('div'),E=m('div');w(A,'btn-group'),w(E,'btn-group'),h(s.Le,A),h(s.Le,E),h(s.Re,s.Be),h(s.Re,s.Ge),h(s.Se,s.Re),h(s.Se,s.Je),M&&h(s.Se,s.Le),h(s.Oe,s.Se)}let N;p&&(s.Be.innerHTML=p,v&&g(s.Ge,'aria-label',v)),T&&T.forEach((t=>{const o=t.title,n=t.description,r=t.linkedCategory,d=r&&a.G[r],f=t.cookieTable,_=f?.body,p=_?.length>0,v=!!d,b=v&&a.ee[r],C=i(b)&&l(b)||[],k=v&&(!!n||!!p||l(b).length>0);var T=m('div');if(w(T,'section'),k||n){var M=m('div');w(M,'section-desc-wrapper')}let D=C.length;if(k&&D>0){const e=m('div');w(e,'section-services');for(const t of C){const o=b[t]?.label||t,n=m('div'),a=m('div'),s=m('div'),c=m('div');w(n,'service'),w(c,'service-title'),w(a,'service-header'),w(s,'service-icon');const i=z(o,t,d,!0,r);c.innerHTML=o,h(a,s),h(a,c),h(n,a),h(n,i),h(e,n)}h(M,e)}if(o){var A=m('div'),E=m(v?e:'div');if(w(A,'section-title-wrapper'),w(E,'section-title'),E.innerHTML=o,h(A,E),v){const e=m('span');w(e,'section-arrow'),h(A,e),T.className+='--toggle';const t=z(o,r,d);let n=u.serviceCounterLabel;if(D>0&&c(n)){let e=m('span');w(e,'badge'),w(e,'service-counter'),g(e,'aria-hidden',!0),g(e,'data-servicecounter',D),n&&(n=n.split('|'),n=n.length>1&&D>1?n[1]:n[0],g(e,'data-counterlabel',n)),e.innerHTML=D+(n?' '+n:''),h(E,e)}if(k){w(T,'section--expandable');var H=r+'-desc';g(E,'aria-expanded',!1),g(E,'aria-controls',H)}h(A,t)}else g(E,'role','heading'),g(E,'aria-level','3');h(T,A)}if(n){var I=m('div');w(I,'section-desc'),I.innerHTML=n,h(M,I)}if(k&&(g(M,'aria-hidden','true'),M.id=H,((e,t,o)=>{x(E,'click',(()=>{t.classList.contains('is-expanded')?(S(t,'is-expanded'),g(o,'aria-expanded','false'),g(e,'aria-hidden','true')):(y(t,'is-expanded'),g(o,'aria-expanded','true'),g(e,'aria-hidden','false'))}))})(M,T,E),p)){const e=m('table'),t=m('thead'),o=m('tbody');w(e,'section-table'),w(t,'table-head'),w(o,'table-body');const n=f.headers,a=l(n),c=s.Ue.createDocumentFragment(),i=m('tr');g(i,'role','row');for(const e of a){const t=n[e],o=m('th');o.id='cc__row-'+t,g(o,'role','columnheader'),g(o,'scope','col'),w(o,'table-th'),o.innerHTML=t,h(c,o)}h(i,c),h(t,i);const r=s.Ue.createDocumentFragment();for(const e of _){const t=m('tr');g(t,'role','row'),w(t,'table-tr');for(const o of a){const a=n[o],s=e[o],c=m('td'),i=m('div');w(c,'table-td'),g(c,'data-column',a),g(c,'headers','cc__row-'+a),i.insertAdjacentHTML('beforeend',s),h(c,i),h(t,c)}h(r,t)}h(o,r),h(e,t),h(e,o),h(M,e)}(k||n)&&h(T,M);const V=s.je||s.Je;v?(N||(N=m('div'),w(N,'section-toggles')),N.appendChild(T)):N=null,h(V,N||T)})),(b||C)&&(C&&(s.Fe||(s.Fe=m(e),w(s.Fe,'btn'),g(s.Fe,'data-role','necessary'),h(A,s.Fe),x(s.Fe,'click',(()=>_([])))),s.Fe.innerHTML=C),b&&(s.ze||(s.ze=m(e),w(s.ze,'btn'),g(s.ze,'data-role','all'),h(A,s.ze),x(s.ze,'click',(()=>_('all')))),s.ze.innerHTML=b)),k&&(s.$e||(s.$e=m(e),w(s.$e,'btn'),w(s.$e,'btn--secondary'),g(s.$e,'data-role','save'),h(E,s.$e),x(s.$e,'click',(()=>_()))),s.$e.innerHTML=k),s.je&&(s.Se.replaceChild(s.je,s.Je),s.Je=s.je),J(1),a.A||(a.A=!0,F(o.fe.ve,'preferencesModal',s.Se),n(t),setTimeout(P,10),h(s.qe,s.Oe),setTimeout((()=>y(s.Oe,'cc--anim')),100))};function z(e,t,n,s,c){const i=o.o,r=o.ie,l=m('label'),d=m('input'),f=m('span'),_=m('span'),u=m('span'),p=m('span');if(d.type='checkbox',y(l,'section__toggle-wrapper'),y(d,'section__toggle'),y(u,'toggle__icon-on'),y(p,'toggle__icon-off'),y(f,'toggle__icon'),y(_,'toggle__label'),g(f,'aria-hidden','true'),s?(y(l,'toggle-service'),g(d,'data-category',c),r.le[c][t]=d):r.re[t]=d,s?(e=>{x(d,'change',(()=>{const t=r.le[e],o=r.re[e];i.oe[e]=[];for(let o in t){const n=t[o];n.checked&&i.oe[e].push(n.value)}o.checked=i.oe[e].length>0}))})(c):(e=>{x(d,'click',(()=>{const t=r.le[e];i.oe[e]=[];for(let e in t)t[e].checked=d.checked}))})(t),d.value=t,_.textContent=e.replace(/<.*>.*<\/.*>/gm,''),h(f,p),h(f,u),i.k)(n.enabled||n.readOnly)&&(d.checked=!0);else if(s){const e=i.te[c];d.checked=n.readOnly||a(e,t)}else a(i.L,t)&&(d.checked=!0);return n.readOnly&&(d.disabled=!0),h(l,d),h(l,f),h(l,_),l}const $=(t,n)=>{const a=o.o,s=o.ie,{hide:c,showPreferences:i,acceptCategory:r}=t,l=a.u&&a.u.consentModal;if(!l)return;const d=l.acceptAllBtn,f=l.acceptNecessaryBtn,_=l.showPreferencesBtn,u=l.closeIconLabel,p=l.footer,v=l.label,b=l.title,w=e=>{c(),r(e)};if(!s.Ke){s.Ke=m('div'),s.we=m('div'),s.Qe=m('div'),s.We=m('div'),s.Xe=m('div'),y(s.Ke,'cm-wrapper'),y(s.we,'cm'),C(s.Qe,'body'),C(s.We,'texts'),C(s.Xe,'btns'),g(s.we,'role','dialog'),g(s.we,'aria-modal','true'),g(s.we,'aria-hidden','false'),g(s.we,'aria-describedby','cm__desc'),v?g(s.we,'aria-label',v):b&&g(s.we,'aria-labelledby','cm__title'),s.we.style.visibility='hidden';const t='box',o=a.i.guiOptions?.consentModal,n=(o?.layout||t).split(' ')[0]===t;b&&u&&n&&(s.Pe||(s.Pe=m(e),C(s.Pe,'btn'),C(s.Pe,'btn--close'),x(s.Pe,'click',(()=>{w([])})),h(s.Qe,s.Pe)),g(s.Pe,'aria-label',u)),h(s.Qe,s.We),(d||f||_)&&h(s.Qe,s.Xe),h(s.we,s.Qe),h(s.Ke,s.we)}b&&(s.Ye||(s.Ye=m('div'),s.Ye.className=s.Ye.id='cm__title',g(s.Ye,'role','heading'),g(s.Ye,'aria-level','2'),h(s.We,s.Ye)),s.Ye.innerHTML=b);let S=l.description;if(S&&(a.F&&(S=S.replace('{{revisionMessage}}',a.O?'':l.revisionMessage||'')),s.Ze||(s.Ze=m('div'),s.Ze.className=s.Ze.id='cm__desc',h(s.We,s.Ze)),s.Ze.innerHTML=S),d&&(s.et||(s.et=m(e),C(s.et,'btn'),g(s.et,'data-role','all'),x(s.et,'click',(()=>{w('all')}))),s.et.innerHTML=d),f&&(s.Ve||(s.Ve=m(e),C(s.Ve,'btn'),g(s.Ve,'data-role','necessary'),x(s.Ve,'click',(()=>{w([])}))),s.Ve.innerHTML=f),_&&(s.tt||(s.tt=m(e),C(s.tt,'btn'),C(s.tt,'btn--secondary'),g(s.tt,'data-role','show'),x(s.tt,'mouseenter',(()=>{a.A||U(t,n)})),x(s.tt,'click',i)),s.tt.innerHTML=_),s.ot||(s.ot=m('div'),C(s.ot,'btn-group'),f&&h(s.ot,s.Ve),d&&h(s.ot,s.et),(d||f)&&h(s.Qe,s.ot),h(s.Xe,s.ot)),s.tt&&!s.nt&&(s.nt=m('div'),s.Ve&&s.et?(C(s.nt,'btn-group'),h(s.nt,s.tt),h(s.Xe,s.nt)):(h(s.ot,s.tt),C(s.ot,'btn-group--uneven'))),p){if(!s.st){let e=m('div'),t=m('div');s.st=m('div'),C(e,'footer'),C(t,'links'),C(s.st,'link-group'),h(t,s.st),h(e,t),h(s.we,e)}s.st.innerHTML=p}J(0),a.T||(a.T=!0,F(o.fe.ve,'consentModal',s.we),n(t),setTimeout(P,10),h(s.qe,s.Ke),setTimeout((()=>y(s.Ke,'cc--anim')),100)),N(s.Qe,t,U,n)},q=e=>c(e)&&e in o.o._,K=()=>o.o.l||o.o.i.language.default,Q=e=>{e&&(o.o.l=e)},W=async e=>{const t=o.o;let n;n=e&&q(e)?e:K();let a=t._[n];if(!a)return!1;if(c(a)){const e=await(async e=>{try{const t=await fetch(e,{method:'GET'});return!!t.ok&&await t.json()}catch(e){return!1}})(a);if(!e)return!1;a=e}return t.u=a,Q(n),!0},X=()=>{let e=o.o.i.language.rtl,t=o.ie.qe;e&&t&&(s(e)||(e=[e]),a(e,o.o.l)?y(t,'cc--rtl'):S(t,'cc--rtl'))},Y=e=>{const t=o.ie;if(!t.qe){t.qe=m('div'),t.qe.id='cc-main',t.qe.style.position='fixed',t.qe.style.zIndex='2147483647',X();let n=o.o.i.root;n&&c(n)&&(n=document.querySelector(n)),h(n||t.Ue.body,t.qe),(({hidePreferences:e})=>{const t=o.ie;x(t.qe,'click',(n=>{const a=o.o;a.V?t.Se.contains(n.target)?a.N=!0:(e(),a.N=!1):a.M&&t.we.contains(n.target)&&(a.N=!0)}))})(e)}},Z=e=>{const{hostname:t,protocol:n}=location,{name:s,path:c,domain:i,sameSite:r}=o.t.cookie,l=encodeURIComponent(JSON.stringify(o.o.p)),d=e?(()=>{const e=o.o.C,t=e?new Date-e:0;return 864e5*D()-t})():864e5*D(),f=new Date;f.setTime(f.getTime()+d);let _=s+'='+l+(0!==d?'; expires='+f.toUTCString():'')+'; Path='+c+'; SameSite='+r;a(t,'.')&&(_+='; Domain='+i),'https:'===n&&(_+='; Secure'),document.cookie=_,o.o.p},ee=(e,t,n)=>{const a=n||o.t.cookie.domain,s=t||o.t.cookie.path,c='www.'===a.slice(0,4),i=c&&a.substring(4),r=(e,t)=>{document.cookie=e+'=; path='+s+(t?'; domain=.'+t:'')+'; expires=Thu, 01 Jan 1970 00:00:01 GMT;'};for(const t of e)r(t),r(t,a),c&&r(t,i)},te=e=>(e=>{let t;try{t=JSON.parse(decodeURIComponent(e))}catch(e){t={}}return t})(oe(e||o.t.cookie.name,!0)),oe=(e,t)=>{const o=document.cookie.match('(^|;)\\s*'+e+'\\s*=\\s*([^;]+)');return o?t?o.pop():e:''},ne=e=>{const t=document.cookie.split(/;\s*/),o=[];for(const n of t){let t=n.split('=')[0];if(e)try{e.test(t)&&o.push(t)}catch(e){}else o.push(t)}return o},ae=(e,t=[])=>{((e,t)=>{const{J:n,U:i,p:r,A:l}=o.o;let d=[];e?s(e)?d.push(...e):c(e)&&('all'===e?d=n:d.push(e)):d=l?(()=>{const{oe:e}=o.o,t=o.ie.re;if(!t)return[];let n=[];for(let e in t)t[e].checked&&n.push(e);for(let t in e)e[t].length>0&&n.push(t);return n})():r.categories,d=d.filter((e=>!a(n,e)||!a(t,e))),d.push(...i),E(d)})(e,t),(()=>{const e=o.o,{B:t,oe:n,U:s,L:c,te:i,ee:r,J:f}=e;e.ae=k(i);for(const o of f){const f=r[o],_=l(f),u=n[o]?.length>0,p=a(s,o);if(0!==_.length){if(i[o]=[],p)i[o].push(..._);else{if('all'===t)if(u){const e=n[o];i[o].push(...e)}else i[o].push(..._);else if('necessary'===t)i[o]=[];else if(u){const e=n[o];i[o].push(...e)}else a(c,o)&&i[o].push(..._);e.oe={}}i[o]=d(i[o])}}})(),(()=>{const e=o.o;'opt-out'===o.t.mode&&e.k?e.j=A(e.$,e.L):e.j=A(e.L,e.p.categories);let t=e.j.length>0,s=!1;for(const t of e.J)e.ne[t]=A(e.te[t],e.ae[t]),e.ne[t].length>0&&(s=!0);const c=o.ie.re;for(let t in c)c[t].checked=a(e.L,t);for(const t of e.J){const n=o.ie.le[t],s=e.te[t];for(const e in n)n[e].checked=a(s,e)}e.h||(e.h=new Date),e.S||(e.S=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))),e.p={categories:k(e.L),revision:o.t.revision,data:e.v,consentTimestamp:e.h.toISOString(),consentId:e.S,services:k(e.te)};let i=!1;(e.k||t||s)&&(e.k&&(e.k=!1,i=!0),E(e.L),e.C?e.C=new Date:e.C=e.h,e.p.lastConsentTimestamp=e.C.toISOString(),Z(),o.t.autoClearCookies&&(i||!e.k&&t)&&(e=>{const t=o.o,s=ne();t.R=!1;let c=e?t.J:t.j;c=c.filter((e=>{let o=t.G[e];return!!o&&!o.readOnly&&!!o.autoClear}));for(const o of c){const c=t.G[o].autoClear,i=c?.cookies||[],r=a(t.j,o),l=!a(t.L,o),d=r&&l;if(e&&l||!e&&d){!0===c.reloadPage&&d&&(t.R=!0);for(const e of i){let t=[];const o=e.name,a=e.domain,c=e.path;if(o instanceof RegExp)for(let e of s)o.test(e)&&t.push(e);else{let e=n(s,o);e>-1&&t.push(s[e])}t.length>0&&ee(t,c,a)}}}})(i),O()),i&&(F(o.fe._e),F(o.fe.ue),'opt-in'===o.t.mode)||((t||s)&&F(o.fe.pe),e.R&&location.reload())})()},se=e=>{let t;return t=o.o.k&&'opt-in'!==o.t.mode?o.o.$:H().accepted||[],a(t,e)},ce=(e,t)=>{const{J:n,ee:i}=o.o;if(!(e&&t&&c(t)&&a(n,t)&&0!==l(i[t]).length))return!1;((e,t)=>{const n=o.o,{ee:i,oe:r}=n,d=o.ie.le[t]||{},f=l(i[t]);if(r[t]=[],c(e))if('all'===e)for(let e in d)d[e].checked=!0,p(d[e]);else{for(let t in d)d[t].checked=e===t,p(d[t]);a(f,e)&&r[t].push(e)}else if(s(e))for(let o in d){const n=a(e,o);d[o].checked=n,p(d[o]),n&&r[t].push(o)}})(e,t),ae()},ie=(e,t)=>a(o.o.te[t]||[],e),re=e=>''!==oe(e,!0),le=(e,t,o)=>{let n=[];const a=e=>{if(c(e)){let t=oe(e);''!==t&&n.push(t)}else n.push(...ne(e))};if(s(e))for(let t of e)a(t);else a(e);ee(n,t,o)},de=e=>{const{ie:t,o:n}=o;e&&!n.T&&$(pe,Y),n.T&&(n.M=!0,n.g&&V(!0),y(t.Ce,'show--consent'),g(t.we,'aria-hidden','false'),setTimeout((()=>{n.K=f(),n.P=n.X}),200),F(o.fe.me,'consentModal'))},fe=()=>{const{ie:e,o:t,fe:n}=o;t.T&&(t.M=!1,t.g&&V(),S(e.Ce,'show--consent'),g(e.we,'aria-hidden','true'),setTimeout((()=>{t.K.focus(),t.P=[]}),200),F(n.ge,'consentModal'))},_e=()=>{const e=o.o;e.A&&e.D||(e.A||U(pe,Y),y(o.ie.Ce,'show--preferences'),g(o.ie.Se,'aria-hidden','false'),e.D=!0,setTimeout((()=>{e.V=!0}),1),setTimeout((()=>{e.M?e.W=f():e.K=f(),0!==e.Y.length&&(e.Y[0].focus(),e.P=e.Y)}),200),F(o.fe.me,'preferencesModal'))},ue=()=>{const e=o.o;e.D&&(S(o.ie.Ce,'show--preferences'),g(o.ie.Se,'aria-hidden','true'),e.D=!1,setTimeout((()=>{e.V=!1}),1),e.M?(e.W&&e.W.focus(),e.P=e.X):(e.K&&e.K.focus(),e.P=[]),e.N=!1,F(o.fe.ge,'preferencesModal'))};var pe={show:de,hide:fe,showPreferences:_e,hidePreferences:ue,acceptCategory:ae};const me=async(e,t)=>{if(!q(e))return!1;const n=o.o;return!(e===K()&&!0!==t||!await W(e)||(Q(e),n.T&&$(pe,Y),n.A&&U(pe,Y),X(),P(),0))},ge=()=>{const{B:e,te:t}=o.o,{accepted:n,rejected:a}=H();return k({acceptType:e,acceptedCategories:n,rejectedCategories:a,acceptedServices:t,rejectedServices:T()})},ve=(e,t)=>{let o=document.querySelector('script[src="'+e+'"]');return new Promise((n=>{if(o)return n(!0);if(o=m('script'),i(t))for(const e in t)g(o,e,t[e]);o.onload=()=>n(!0),o.onerror=()=>{o.remove(),n(!1)},o.src=e,h(document.head,o)}))},be=e=>{let t,n=e.value,a=e.mode,s=!1;const c=o.o;if('update'===a){c.v=t=he('data');const e=typeof t==typeof n;if(e&&'object'==typeof t){!t&&(t={});for(let e in n)t[e]!==n[e]&&(t[e]=n[e],s=!0)}else!e&&t||t===n||(t=n,s=!0)}else t=n,s=!0;return s&&(c.v=t,c.p.data=t,Z(!0)),s},he=(e,t)=>{const o=te(t);return e?o[e]:o},ye=e=>{const t=o.t,n=o.o.i;return e?t[e]||n[e]:{...t,...n,cookie:{...t.cookie}}},Ce=()=>!o.o.k,we=async e=>{const{o:t,t:n,fe:r}=o,d=window;if(!d._ccRun){if(d._ccRun=!0,(e=>{const{ie:t,t:n,o:s}=o,c=n,r=s,{cookie:d}=c,f=o.de,_=e.cookie,p=e.categories,m=l(p)||[],g=navigator,v=document;t.Ue=v,t.Ce=v.documentElement,d.domain=location.hostname,r.i=e,r._=e.language.translations,r.G=p,r.J=m,r.g=!!e.disablePageInteraction,f._e=e.onFirstConsent,f.ue=e.onConsent,f.pe=e.onChange,f.ge=e.onModalHide,f.me=e.onModalShow,f.ve=e.onModalReady;const{mode:h,autoShow:y,autoClearCookies:C,revision:w,manageScriptTags:S,hideFromBots:k,lazyHtmlGeneration:T}=e;'opt-out'===h&&(c.mode=h),'boolean'==typeof y&&(c.autoShow=y),'boolean'==typeof C&&(c.autoClearCookies=C),'boolean'==typeof S&&(c.manageScriptTags=S),'number'==typeof w&&w>=0&&(c.revision=w,r.F=!0),'boolean'==typeof T&&(c.lazyHtmlGeneration=T),!1===k&&(c.hideFromBots=!1),!0===c.hideFromBots&&g&&(r.q=g.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(g.userAgent)||g.webdriver),i(_)&&(c.cookie={...d,..._}),c.autoClearCookies,r.F,c.manageScriptTags,(e=>{const{G:t,ee:n,te:a,U:s}=o.o;for(let c of e){const e=t[c],r=e.services||{},d=i(r)&&l(r)||[];n[c]={},a[c]=[],e.readOnly&&(s.push(c),a[c]=d),o.ie.le[c]={};for(let e of d){const t=r[e];t.ke=!1,n[c][e]=t}}})(m),(()=>{if(!o.t.manageScriptTags)return;const e=o.o;e.se=u(o.ie.Ue,'script[data-category]'),e.ce=[];for(const t of e.se){let o=b(t,'data-category'),n=t.dataset.service||'',s=!1;if(o&&'!'===o.charAt(0)&&(o=o.slice(1),s=!0),'!'===n.charAt(0)&&(n=n.slice(1),s=!0),a(e.J,o)&&(e.ce.push({xe:!1,De:s,Te:o,Me:n}),n)){const t=e.ee[o];t[n]||(t[n]={ke:!1})}}})(),Q((()=>{const e=o.o.i.language.autoDetect;if(e){let t;if('browser'===e?t=navigator.language.slice(0,2).toLowerCase():'document'===e&&(t=document.documentElement.lang),q(t))return t}return K()})())})(e),t.q)return;(()=>{const e=o.o,t=o.t,n=te(),{categories:a,services:i,consentId:r,consentTimestamp:l,lastConsentTimestamp:d,data:f,revision:_}=n,u=s(a);e.p=n,e.S=r;const p=!!r&&c(r);e.h=l,e.h&&(e.h=new Date(l)),e.C=d,e.C&&(e.C=new Date(d)),e.v=void 0!==f?f:null,e.F&&p&&_!==t.revision&&(e.O=!1),e.k=!(p&&e.O&&e.h&&e.C&&u),e.k,e.k?'opt-out'===t.mode&&(()=>{const e=o.o;for(const t of e.J)if(e.G[t].enabled){e.$.push(t);const o=e.ee[t]||{};for(let n in o)e.te[t].push(n)}})():(e.te={...e.te,...i},E([...e.U,...a]))})();const p=Ce();if(!await W())return!1;if(await(async e=>{N(null,e,U,Y),o.o.k&&$(e,Y),o.t.lazyHtmlGeneration||U(e,Y),(()=>{const e=o.ie,t=o.o;x(e.Ce,'keydown',(e=>{if('Tab'!==e.key)return;const n=t.P;if(n.length>0){const a=f();e.shiftKey?a===n[0]&&(n[1].focus(),_(e)):a===n[1]&&(n[0].focus(),_(e)),t.H||o.o.N||(t.H=!0,!t.I&&_(e),e.shiftKey?n[1].focus():n[0].focus())}!t.H&&(t.I=!0)}),!0)})()})(pe),n.autoShow&&!p&&de(!0),p)return O(),F(r.ue);'opt-out'===n.mode&&O(t.$)}},Se=e=>{const{qe:n,Ce:a}=o.ie,{name:s,path:c,domain:i}=o.t.cookie;e&&le(s,c,i);for(const{be:e,he:t,ye:n}of o.o.m)e.removeEventListener(t,n);n?.remove(),a?.classList.remove('disable--interaction','show--preferences','show--consent');const r=new t;for(const e in o)o[e]=r[e];window._ccRun=!1};export{ae as acceptCategory,ce as acceptService,se as acceptedCategory,ie as acceptedService,le as eraseCookies,ye as getConfig,he as getCookie,ge as getUserPreferences,fe as hide,ue as hidePreferences,ve as loadScript,Se as reset,we as run,be as setCookieData,me as setLanguage,de as show,_e as showPreferences,Ce as validConsent,re as validCookie}; | ||
const e='button';class t{constructor(){this.t={mode:'opt-in',revision:0,autoShow:!0,autoClearCookies:!0,manageScriptTags:!0,hideFromBots:!0,lazyHtmlGeneration:!0,cookie:{name:'cc_cookie',expiresAfterDays:182,domain:'',path:'/',sameSite:'Lax'}},this.o={i:{},l:'',_:{},u:{},p:{},m:[],g:!1,v:null,h:null,C:null,S:'',k:!0,T:!1,M:!1,D:!1,A:!1,N:!1,H:!1,I:!1,V:!1,P:[],F:!1,O:!0,j:[],R:!1,B:'',G:!1,J:[],L:[],U:[],$:[],q:!1,K:!1,W:!1,X:[],Y:[],Z:[],ee:{},te:{},oe:{},ne:{},ae:{},se:[],ce:[]},this.ie={re:{},le:{}},this.de={},this.fe={_e:'cc:onFirstConsent',ue:'cc:onConsent',pe:'cc:onChange',me:'cc:onModalShow',ge:'cc:onModalHide',ve:'cc:onModalReady'}}}const o=new t,n=(e,t)=>e.indexOf(t),a=(e,t)=>-1!==n(e,t),s=e=>Array.isArray(e),c=e=>'string'==typeof e,i=e=>!!e&&'object'==typeof e&&!s(e),r=e=>'function'==typeof e,l=e=>Object.keys(e),d=e=>Array.from(new Set(e)),f=()=>document.activeElement,_=e=>e.preventDefault(),u=(e,t)=>e.querySelectorAll(t),p=e=>e.dispatchEvent(new Event('change')),m=t=>{const o=document.createElement(t);return t===e&&(o.type=t),o},g=(e,t,o)=>e.setAttribute(t,o),v=(e,t,o)=>{e.removeAttribute(o?'data-'+t:t)},b=(e,t,o)=>e.getAttribute(o?'data-'+t:t),h=(e,t)=>e.appendChild(t),y=(e,t)=>e.classList.add(t),C=(e,t)=>y(e,'cm__'+t),w=(e,t)=>y(e,'pm__'+t),S=(e,t)=>e.classList.remove(t),k=e=>{if('object'!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());let t=Array.isArray(e)?[]:{};for(let o in e){let n=e[o];t[o]=k(n)}return t},T=()=>{const e={},{J:t,ee:n,te:a}=o.o;for(const o of t)e[o]=A(a[o],l(n[o]));return e},M=(e,t)=>dispatchEvent(new CustomEvent(e,{detail:t})),x=(e,t,n,a)=>{e.addEventListener(t,n),a&&o.o.m.push({be:e,he:t,ye:n})},D=()=>{const e=o.t.cookie.expiresAfterDays;return r(e)?e(o.o.B):e},A=(e,t)=>{const o=e||[],n=t||[];return o.filter((e=>!a(n,e))).concat(n.filter((e=>!a(o,e))))},E=e=>{o.o.L=d(e),o.o.B=(()=>{let e='custom';const{L:t,J:n,U:a}=o.o,s=t.length;return s===n.length?e='all':s===a.length&&(e='necessary'),e})()},N=(e,t,n,a)=>{const{show:s,showPreferences:c,hide:i,hidePreferences:r,acceptCategory:l}=t,d=e||document,f=e=>u(d,`[data-cc="${e}"]`),p=(e,t)=>{_(e),l(t),r(),i()},m=f('show-preferencesModal'),v=f('show-consentModal'),b=f('accept-all'),h=f('accept-necessary'),y=f('accept-custom'),C=o.t.lazyHtmlGeneration;for(const e of m)g(e,'aria-haspopup','dialog'),x(e,'click',(e=>{_(e),c()})),C&&x(e,'mouseenter',(e=>{_(e),o.o.A||n(t,a)}),!0);for(let e of v)g(e,'aria-haspopup','dialog'),x(e,'click',(e=>{_(e),s(!0)}),!0);for(let e of b)x(e,'click',(e=>{p(e,'all')}),!0);for(let e of y)x(e,'click',(e=>{p(e)}),!0);for(let e of h)x(e,'click',(e=>{p(e,[])}),!0)},H=()=>{const{k:e,L:t,J:n}=o.o;return{accepted:t,rejected:e?[]:n.filter((e=>!a(t,e)))}};let I;const V=e=>{clearTimeout(I),e?y(o.ie.Ce,'disable--interaction'):I=setTimeout((()=>{S(o.ie.Ce,'disable--interaction')}),500)},P=()=>{const{o:t,ie:n}=o,a=['[href]',e,'input','details','[tabindex="0"]'].join(':not([tabindex="-1"]), '),s=(e,t)=>{const o=u(e,a);t[0]=o[0],t[1]=o[o.length-1]};t.T&&s(n.we,t.X),t.A&&s(n.Se,t.Y),t.I=!1,t.H=!1},F=(e,t,n)=>{const{pe:a,ue:s,_e:c,ge:i,ve:l,me:d}=o.de,f=o.fe,_={cookie:o.o.p};if(t){const o={modalName:t};return e===f.me?r(d)&&d(o):e===f.ge?r(i)&&i(o):(o.modal=n,r(l)&&l(o)),M(e,o)}e===f._e?r(c)&&c(k(_)):e===f.ue?r(s)&&s(k(_)):(_.changedCategories=o.o.j,_.changedServices=o.o.ne,r(a)&&a(k(_))),M(e,k(_))},O=e=>{const{te:t,ne:n,J:s,ee:c,se:i,ce:l,p:d,j:f}=o.o;for(const e of s){const o=n[e]||t[e]||[];for(const n of o){const o=c[e][n],{onAccept:s,onReject:i}=o;o&&(!o.ke&&a(t[e],n)&&r(s)?(o.ke=!0,s()):o.ke&&!a(t[e],n)&&r(i)&&(o.ke=!1,i()))}}if(!o.t.manageScriptTags)return;const _=i,u=e||d.categories||[],p=(e,o)=>{if(o<e.length){const s=e[o],c=l[o],i=c.Te,r=c.Me,d=a(u,i),_=!!r&&a(t[i],r);if(!c.xe){let t=!r&&!c.De&&d,l=r&&!c.De&&_,u=!r&&c.De&&!d&&a(f,i),h=r&&c.De&&!_&&a(n[i]||[],r);if(t||u||l||h){c.xe=!0;const t=b(s,'type',!0);v(s,'type',!!t),v(s,'data-category');let n=b(s,'src',!0);n&&v(s,'src',!0);const a=m('script');a.textContent=s.innerHTML;for(const{nodeName:e}of s.attributes)g(a,e,s[e]||b(s,e));if(t&&(a.type=t),n?a.src=n:n=s.src,n&&(a.onload=a.onerror=()=>{p(e,++o)}),s.replaceWith(a),n)return}}p(e,++o)}};p(_,0)},j=['middle','top','bottom'],R=['left','center','right'],B={box:{Ae:['wide','inline'],Ee:j,Ne:R,He:'bottom',Ie:'right'},cloud:{Ae:['inline'],Ee:j,Ne:R,He:'bottom',Ie:'center'},bar:{Ae:['inline'],Ee:j.slice(1),Ne:[],He:'bottom',Ie:''}},G={box:{Ae:[],Ee:[],Ne:[],He:'',Ie:''},bar:{Ae:['wide'],Ee:[],Ne:['left','right'],He:'',Ie:'left'}},J=e=>{const t=o.o.i.guiOptions,n=t?.consentModal,a=t?.preferencesModal;0===e&&L(o.ie.we,B,n,'cm--','box','cm'),1===e&&L(o.ie.Se,G,a,'pm--','box','pm')},L=(e,t,n,s,c,i)=>{e.className=i;const r=n?.layout,l=n?.position,d=n?.flipButtons,f=!1!==n?.equalWeightButtons,_=r?.split(' ')||[],u=_[0],p=_[1],m=u in t?u:c,g=t[m],v=a(g.Ae,p)&&p,b=l?.split(' ')||[],h=b[0],C='pm--'===s?b[0]:b[1],w=a(g.Ee,h)?h:g.He,k=a(g.Ne,C)?C:g.Ie,T=t=>y(e,s+t);T(m),T(v),T(w),T(k),d&&T('flip');const M=i+'__btn--secondary';if('cm'===i){const{Ve:e,Pe:t}=o.ie;e&&(f?S(e,M):y(e,M)),t&&(f?S(t,M):y(t,M))}else{const{Fe:e}=o.ie;e&&(f?S(e,M):y(e,M))}},U=(t,n)=>{const a=o.o,s=o.ie,{hide:r,hidePreferences:d,acceptCategory:f}=t,_=e=>{f(e),d(),r()},u=a.u&&a.u.preferencesModal;if(!u)return;const p=u.title,v=u.closeIconLabel,b=u.acceptAllBtn,C=u.acceptNecessaryBtn,k=u.savePreferencesBtn,T=u.sections,M=b||C||k;if(s.Oe)s.je=m('div'),w(s.je,'body');else{s.Oe=m('div'),y(s.Oe,'pm-wrapper'),s.Se=m('div'),s.Se.style.visibility='hidden',y(s.Se,'pm'),g(s.Se,'role','dialog'),g(s.Se,'aria-hidden',!0),g(s.Se,'aria-modal',!0),g(s.Se,'aria-labelledby','pm__title'),x(s.Ce,'keydown',(e=>{27===e.keyCode&&d()}),!0),s.Re=m('div'),w(s.Re,'header'),s.Be=m('div'),w(s.Be,'title'),s.Be.id='pm__title',g(s.Be,'role','heading'),g(s.Be,'aria-level','2'),s.Ge=m(e),w(s.Ge,'close-btn'),g(s.Ge,'aria-label',u.closeIconLabel||''),x(s.Ge,'click',d),s.Je=m('div'),w(s.Je,'body'),s.Le=m('div'),w(s.Le,'footer');var D=m('div');y(D,'btns');var A=m('div'),E=m('div');w(A,'btn-group'),w(E,'btn-group'),h(s.Le,A),h(s.Le,E),h(s.Re,s.Be),h(s.Re,s.Ge),h(s.Se,s.Re),h(s.Se,s.Je),M&&h(s.Se,s.Le),h(s.Oe,s.Se)}let N;p&&(s.Be.innerHTML=p,v&&g(s.Ge,'aria-label',v)),T&&T.forEach((t=>{const o=t.title,n=t.description,r=t.linkedCategory,d=r&&a.G[r],f=t.cookieTable,_=f?.body,p=_?.length>0,v=!!d,b=v&&a.ee[r],C=i(b)&&l(b)||[],k=v&&(!!n||!!p||l(b).length>0);var T=m('div');if(w(T,'section'),k||n){var M=m('div');w(M,'section-desc-wrapper')}let D=C.length;if(k&&D>0){const e=m('div');w(e,'section-services');for(const t of C){const o=b[t]?.label||t,n=m('div'),a=m('div'),s=m('div'),c=m('div');w(n,'service'),w(c,'service-title'),w(a,'service-header'),w(s,'service-icon');const i=z(o,t,d,!0,r);c.innerHTML=o,h(a,s),h(a,c),h(n,a),h(n,i),h(e,n)}h(M,e)}if(o){var A=m('div'),E=m(v?e:'div');if(w(A,'section-title-wrapper'),w(E,'section-title'),E.innerHTML=o,h(A,E),v){const e=m('span');w(e,'section-arrow'),h(A,e),T.className+='--toggle';const t=z(o,r,d);let n=u.serviceCounterLabel;if(D>0&&c(n)){let e=m('span');w(e,'badge'),w(e,'service-counter'),g(e,'aria-hidden',!0),g(e,'data-servicecounter',D),n&&(n=n.split('|'),n=n.length>1&&D>1?n[1]:n[0],g(e,'data-counterlabel',n)),e.innerHTML=D+(n?' '+n:''),h(E,e)}if(k){w(T,'section--expandable');var H=r+'-desc';g(E,'aria-expanded',!1),g(E,'aria-controls',H)}h(A,t)}else g(E,'role','heading'),g(E,'aria-level','3');h(T,A)}if(n){var I=m('div');w(I,'section-desc'),I.innerHTML=n,h(M,I)}if(k&&(g(M,'aria-hidden','true'),M.id=H,((e,t,o)=>{x(E,'click',(()=>{t.classList.contains('is-expanded')?(S(t,'is-expanded'),g(o,'aria-expanded','false'),g(e,'aria-hidden','true')):(y(t,'is-expanded'),g(o,'aria-expanded','true'),g(e,'aria-hidden','false'))}))})(M,T,E),p)){const e=m('table'),t=m('thead'),o=m('tbody');w(e,'section-table'),w(t,'table-head'),w(o,'table-body');const n=f.headers,a=l(n),c=s.Ue.createDocumentFragment(),i=m('tr');g(i,'role','row');for(const e of a){const t=n[e],o=m('th');o.id='cc__row-'+t,g(o,'role','columnheader'),g(o,'scope','col'),w(o,'table-th'),o.innerHTML=t,h(c,o)}h(i,c),h(t,i);const r=s.Ue.createDocumentFragment();for(const e of _){const t=m('tr');g(t,'role','row'),w(t,'table-tr');for(const o of a){const a=n[o],s=e[o],c=m('td'),i=m('div');w(c,'table-td'),g(c,'data-column',a),g(c,'headers','cc__row-'+a),i.insertAdjacentHTML('beforeend',s),h(c,i),h(t,c)}h(r,t)}h(o,r),h(e,t),h(e,o),h(M,e)}(k||n)&&h(T,M);const V=s.je||s.Je;v?(N||(N=m('div'),w(N,'section-toggles')),N.appendChild(T)):N=null,h(V,N||T)})),(b||C)&&(C&&(s.Fe||(s.Fe=m(e),w(s.Fe,'btn'),g(s.Fe,'data-role','necessary'),h(A,s.Fe),x(s.Fe,'click',(()=>_([])))),s.Fe.innerHTML=C),b&&(s.ze||(s.ze=m(e),w(s.ze,'btn'),g(s.ze,'data-role','all'),h(A,s.ze),x(s.ze,'click',(()=>_('all')))),s.ze.innerHTML=b)),k&&(s.$e||(s.$e=m(e),w(s.$e,'btn'),w(s.$e,'btn--secondary'),g(s.$e,'data-role','save'),h(E,s.$e),x(s.$e,'click',(()=>_()))),s.$e.innerHTML=k),s.je&&(s.Se.replaceChild(s.je,s.Je),s.Je=s.je),J(1),a.A||(a.A=!0,F(o.fe.ve,'preferencesModal',s.Se),n(t),setTimeout(P,10),h(s.qe,s.Oe),setTimeout((()=>y(s.Oe,'cc--anim')),100))};function z(e,t,n,s,c){const i=o.o,r=o.ie,l=m('label'),d=m('input'),f=m('span'),_=m('span'),u=m('span'),p=m('span');if(d.type='checkbox',y(l,'section__toggle-wrapper'),y(d,'section__toggle'),y(u,'toggle__icon-on'),y(p,'toggle__icon-off'),y(f,'toggle__icon'),y(_,'toggle__label'),g(f,'aria-hidden','true'),s?(y(l,'toggle-service'),g(d,'data-category',c),r.le[c][t]=d):r.re[t]=d,s?(e=>{x(d,'change',(()=>{const t=r.le[e],o=r.re[e];i.oe[e]=[];for(let o in t){const n=t[o];n.checked&&i.oe[e].push(n.value)}o.checked=i.oe[e].length>0}))})(c):(e=>{x(d,'click',(()=>{const t=r.le[e];i.oe[e]=[];for(let e in t)t[e].checked=d.checked}))})(t),d.value=t,_.textContent=e.replace(/<.*>.*<\/.*>/gm,''),h(f,p),h(f,u),i.k)(n.enabled||n.readOnly)&&(d.checked=!0);else if(s){const e=i.te[c];d.checked=n.readOnly||a(e,t)}else a(i.L,t)&&(d.checked=!0);return n.readOnly&&(d.disabled=!0),h(l,d),h(l,f),h(l,_),l}const $=(t,n)=>{const a=o.o,s=o.ie,{hide:c,showPreferences:i,acceptCategory:r}=t,l=a.u&&a.u.consentModal;if(!l)return;const d=l.acceptAllBtn,f=l.acceptNecessaryBtn,_=l.showPreferencesBtn,u=l.closeIconLabel,p=l.footer,v=l.label,b=l.title,w=e=>{c(),r(e)};if(!s.Ke){s.Ke=m('div'),s.we=m('div'),s.Qe=m('div'),s.We=m('div'),s.Xe=m('div'),y(s.Ke,'cm-wrapper'),y(s.we,'cm'),C(s.Qe,'body'),C(s.We,'texts'),C(s.Xe,'btns'),g(s.we,'role','dialog'),g(s.we,'aria-modal','true'),g(s.we,'aria-hidden','false'),g(s.we,'aria-describedby','cm__desc'),v?g(s.we,'aria-label',v):b&&g(s.we,'aria-labelledby','cm__title'),s.we.style.visibility='hidden';const t='box',o=a.i.guiOptions?.consentModal,n=(o?.layout||t).split(' ')[0]===t;b&&u&&n&&(s.Pe||(s.Pe=m(e),C(s.Pe,'btn'),C(s.Pe,'btn--close'),x(s.Pe,'click',(()=>{w([])})),h(s.Qe,s.Pe)),g(s.Pe,'aria-label',u)),h(s.Qe,s.We),(d||f||_)&&h(s.Qe,s.Xe),h(s.we,s.Qe),h(s.Ke,s.we)}b&&(s.Ye||(s.Ye=m('div'),s.Ye.className=s.Ye.id='cm__title',g(s.Ye,'role','heading'),g(s.Ye,'aria-level','2'),h(s.We,s.Ye)),s.Ye.innerHTML=b);let S=l.description;if(S&&(a.F&&(S=S.replace('{{revisionMessage}}',a.O?'':l.revisionMessage||'')),s.Ze||(s.Ze=m('div'),s.Ze.className=s.Ze.id='cm__desc',h(s.We,s.Ze)),s.Ze.innerHTML=S),d&&(s.et||(s.et=m(e),C(s.et,'btn'),g(s.et,'data-role','all'),x(s.et,'click',(()=>{w('all')}))),s.et.innerHTML=d),f&&(s.Ve||(s.Ve=m(e),C(s.Ve,'btn'),g(s.Ve,'data-role','necessary'),x(s.Ve,'click',(()=>{w([])}))),s.Ve.innerHTML=f),_&&(s.tt||(s.tt=m(e),C(s.tt,'btn'),C(s.tt,'btn--secondary'),g(s.tt,'data-role','show'),x(s.tt,'mouseenter',(()=>{a.A||U(t,n)})),x(s.tt,'click',i)),s.tt.innerHTML=_),s.ot||(s.ot=m('div'),C(s.ot,'btn-group'),f&&h(s.ot,s.Ve),d&&h(s.ot,s.et),(d||f)&&h(s.Qe,s.ot),h(s.Xe,s.ot)),s.tt&&!s.nt&&(s.nt=m('div'),s.Ve&&s.et?(C(s.nt,'btn-group'),h(s.nt,s.tt),h(s.Xe,s.nt)):(h(s.ot,s.tt),C(s.ot,'btn-group--uneven'))),p){if(!s.st){let e=m('div'),t=m('div');s.st=m('div'),C(e,'footer'),C(t,'links'),C(s.st,'link-group'),h(t,s.st),h(e,t),h(s.we,e)}s.st.innerHTML=p}J(0),a.T||(a.T=!0,F(o.fe.ve,'consentModal',s.we),n(t),setTimeout(P,10),h(s.qe,s.Ke),setTimeout((()=>y(s.Ke,'cc--anim')),100)),N(s.Qe,t,U,n)},q=e=>c(e)&&e in o.o._,K=()=>o.o.l||o.o.i.language.default,Q=e=>{e&&(o.o.l=e)},W=async e=>{const t=o.o;let n;n=e&&q(e)?e:K();let a=t._[n];if(!a)return!1;if(c(a)){const e=await(async e=>{try{const t=await fetch(e,{method:'GET'});return!!t.ok&&await t.json()}catch(e){return!1}})(a);if(!e)return!1;a=e}return t.u=a,Q(n),!0},X=()=>{let e=o.o.i.language.rtl,t=o.ie.qe;e&&t&&(s(e)||(e=[e]),a(e,o.o.l)?y(t,'cc--rtl'):S(t,'cc--rtl'))},Y=e=>{const t=o.ie;if(!t.qe){t.qe=m('div'),t.qe.id='cc-main',t.qe.style.position='fixed',t.qe.style.zIndex='2147483647',X();let n=o.o.i.root;n&&c(n)&&(n=document.querySelector(n)),h(n||t.Ue.body,t.qe),(({hidePreferences:e})=>{const t=o.ie;x(t.qe,'click',(n=>{const a=o.o;a.V?t.Se.contains(n.target)?a.N=!0:(e(),a.N=!1):a.M&&t.we.contains(n.target)&&(a.N=!0)}))})(e)}},Z=e=>{const{hostname:t,protocol:n}=location,{name:s,path:c,domain:i,sameSite:r}=o.t.cookie,l=encodeURIComponent(JSON.stringify(o.o.p)),d=e?(()=>{const e=o.o.C,t=e?new Date-e:0;return 864e5*D()-t})():864e5*D(),f=new Date;f.setTime(f.getTime()+d);let _=s+'='+l+(0!==d?'; expires='+f.toUTCString():'')+'; Path='+c+'; SameSite='+r;a(t,'.')&&(_+='; Domain='+i),'https:'===n&&(_+='; Secure'),document.cookie=_,o.o.p},ee=(e,t,n)=>{const a=n||o.t.cookie.domain,s=t||o.t.cookie.path,c='www.'===a.slice(0,4),i=c&&a.substring(4),r=(e,t)=>{document.cookie=e+'=; path='+s+(t?'; domain=.'+t:'')+'; expires=Thu, 01 Jan 1970 00:00:01 GMT;'};for(const t of e)r(t),r(t,a),c&&r(t,i)},te=e=>(e=>{let t;try{t=JSON.parse(decodeURIComponent(e))}catch(e){t={}}return t})(oe(e||o.t.cookie.name,!0)),oe=(e,t)=>{const o=document.cookie.match('(^|;)\\s*'+e+'\\s*=\\s*([^;]+)');return o?t?o.pop():e:''},ne=e=>{const t=document.cookie.split(/;\s*/),o=[];for(const n of t){let t=n.split('=')[0];if(e)try{e.test(t)&&o.push(t)}catch(e){}else o.push(t)}return o},ae=(e,t=[])=>{((e,t)=>{const{J:n,U:i,p:r,A:l}=o.o;let d=[];e?s(e)?d.push(...e):c(e)&&('all'===e?d=n:d.push(e)):d=l?(()=>{const{oe:e}=o.o,t=o.ie.re;if(!t)return[];let n=[];for(let e in t)t[e].checked&&n.push(e);for(let t in e)e[t].length>0&&n.push(t);return n})():r.categories,d=d.filter((e=>!a(n,e)||!a(t,e))),d.push(...i),E(d)})(e,t),(()=>{const e=o.o,{B:t,oe:n,U:s,L:c,te:i,ee:r,J:f}=e;e.ae=k(i);for(const o of f){const f=r[o],_=l(f),u=n[o]?.length>0,p=a(s,o);if(0!==_.length){if(i[o]=[],p)i[o].push(..._);else{if('all'===t)if(u){const e=n[o];i[o].push(...e)}else i[o].push(..._);else if('necessary'===t)i[o]=[];else if(u){const e=n[o];i[o].push(...e)}else a(c,o)&&i[o].push(..._);e.oe={}}i[o]=d(i[o])}}})(),(()=>{const e=o.o;'opt-out'===o.t.mode&&e.k?e.j=A(e.$,e.L):e.j=A(e.L,e.p.categories);let t=e.j.length>0,s=!1;for(const t of e.J)e.ne[t]=A(e.te[t],e.ae[t]),e.ne[t].length>0&&(s=!0);const c=o.ie.re;for(let t in c)c[t].checked=a(e.L,t);for(const t of e.J){const n=o.ie.le[t],s=e.te[t];for(const e in n)n[e].checked=a(s,e)}e.h||(e.h=new Date),e.S||(e.S=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))),e.p={categories:k(e.L),revision:o.t.revision,data:e.v,consentTimestamp:e.h.toISOString(),consentId:e.S,services:k(e.te)};let i=!1;(e.k||t||s)&&(e.k&&(e.k=!1,i=!0),E(e.L),e.C?e.C=new Date:e.C=e.h,e.p.lastConsentTimestamp=e.C.toISOString(),Z(),o.t.autoClearCookies&&(i||!e.k&&t)&&(e=>{const t=o.o,s=ne();t.R=!1;let c=e?t.J:t.j;c=c.filter((e=>{let o=t.G[e];return!!o&&!o.readOnly&&!!o.autoClear}));for(const o of c){const c=t.G[o].autoClear,i=c?.cookies||[],r=a(t.j,o),l=!a(t.L,o),d=r&&l;if(e&&l||!e&&d){!0===c.reloadPage&&d&&(t.R=!0);for(const e of i){let t=[];const o=e.name,a=e.domain,c=e.path;if(o instanceof RegExp)for(let e of s)o.test(e)&&t.push(e);else{let e=n(s,o);e>-1&&t.push(s[e])}t.length>0&&ee(t,c,a)}}}})(i),O()),i&&(F(o.fe._e),F(o.fe.ue),'opt-in'===o.t.mode)||((t||s)&&F(o.fe.pe),e.R&&location.reload())})()},se=e=>{let t;return t=o.o.k&&'opt-in'!==o.t.mode?o.o.$:H().accepted||[],a(t,e)},ce=(e,t)=>{const{J:n,ee:i}=o.o;if(!(e&&t&&c(t)&&a(n,t)&&0!==l(i[t]).length))return!1;((e,t)=>{const n=o.o,{ee:i,oe:r}=n,d=o.ie.le[t]||{},f=l(i[t]);if(r[t]=[],c(e))if('all'===e)for(let e in d)d[e].checked=!0,p(d[e]);else{for(let t in d)d[t].checked=e===t,p(d[t]);a(f,e)&&r[t].push(e)}else if(s(e))for(let o in d){const n=a(e,o);d[o].checked=n,p(d[o]),n&&r[t].push(o)}})(e,t),ae()},ie=(e,t)=>a(o.o.te[t]||[],e),re=e=>''!==oe(e,!0),le=(e,t,o)=>{let n=[];const a=e=>{if(c(e)){let t=oe(e);''!==t&&n.push(t)}else n.push(...ne(e))};if(s(e))for(let t of e)a(t);else a(e);ee(n,t,o)},de=e=>{const{ie:t,o:n}=o;e&&!n.T&&$(pe,Y),n.T&&(n.M=!0,n.g&&V(!0),y(t.Ce,'show--consent'),g(t.we,'aria-hidden','false'),setTimeout((()=>{n.K=f(),n.P=n.X}),200),F(o.fe.me,'consentModal'))},fe=()=>{const{ie:e,o:t,fe:n}=o;t.T&&(t.M=!1,t.g&&V(),S(e.Ce,'show--consent'),g(e.we,'aria-hidden','true'),setTimeout((()=>{t.K.focus(),t.P=[]}),200),F(n.ge,'consentModal'))},_e=()=>{const e=o.o;e.A&&e.D||(e.A||U(pe,Y),y(o.ie.Ce,'show--preferences'),g(o.ie.Se,'aria-hidden','false'),e.D=!0,setTimeout((()=>{e.V=!0}),1),setTimeout((()=>{e.M?e.W=f():e.K=f(),0!==e.Y.length&&(e.Y[0].focus(),e.P=e.Y)}),200),F(o.fe.me,'preferencesModal'))},ue=()=>{const e=o.o;e.D&&(S(o.ie.Ce,'show--preferences'),g(o.ie.Se,'aria-hidden','true'),e.D=!1,setTimeout((()=>{e.V=!1}),1),e.M?(e.W&&e.W.focus(),e.P=e.X):(e.K&&e.K.focus(),e.P=[]),e.N=!1,F(o.fe.ge,'preferencesModal'))};var pe={show:de,hide:fe,showPreferences:_e,hidePreferences:ue,acceptCategory:ae};const me=async(e,t)=>{if(!q(e))return!1;const n=o.o;return!(e===K()&&!0!==t||!await W(e)||(Q(e),n.T&&$(pe,Y),n.A&&U(pe,Y),X(),P(),0))},ge=()=>{const{B:e,te:t}=o.o,{accepted:n,rejected:a}=H();return k({acceptType:e,acceptedCategories:n,rejectedCategories:a,acceptedServices:t,rejectedServices:T()})},ve=(e,t)=>{let o=document.querySelector('script[src="'+e+'"]');return new Promise((n=>{if(o)return n(!0);if(o=m('script'),i(t))for(const e in t)g(o,e,t[e]);o.onload=()=>n(!0),o.onerror=()=>{o.remove(),n(!1)},o.src=e,h(document.head,o)}))},be=e=>{let t,n=e.value,a=e.mode,s=!1;const c=o.o;if('update'===a){c.v=t=he('data');const e=typeof t==typeof n;if(e&&'object'==typeof t){!t&&(t={});for(let e in n)t[e]!==n[e]&&(t[e]=n[e],s=!0)}else!e&&t||t===n||(t=n,s=!0)}else t=n,s=!0;return s&&(c.v=t,c.p.data=t,Z(!0)),s},he=(e,t)=>{const o=te(t);return e?o[e]:o},ye=e=>{const t=o.t,n=o.o.i;return e?t[e]||n[e]:{...t,...n,cookie:{...t.cookie}}},Ce=()=>!o.o.k,we=async e=>{const{o:t,t:n,fe:r}=o,d=window;if(!d._ccRun){if(d._ccRun=!0,(e=>{const{ie:t,t:n,o:s}=o,c=n,r=s,{cookie:d}=c,f=o.de,_=e.cookie,p=e.categories,m=l(p)||[],g=navigator,v=document;t.Ue=v,t.Ce=v.documentElement,d.domain=location.hostname,r.i=e,r._=e.language.translations,r.G=p,r.J=m,r.g=!!e.disablePageInteraction,f._e=e.onFirstConsent,f.ue=e.onConsent,f.pe=e.onChange,f.ge=e.onModalHide,f.me=e.onModalShow,f.ve=e.onModalReady;const{mode:h,autoShow:y,autoClearCookies:C,revision:w,manageScriptTags:S,hideFromBots:k,lazyHtmlGeneration:T}=e;'opt-out'===h&&(c.mode=h),'boolean'==typeof y&&(c.autoShow=y),'boolean'==typeof C&&(c.autoClearCookies=C),'boolean'==typeof S&&(c.manageScriptTags=S),'number'==typeof w&&w>=0&&(c.revision=w,r.F=!0),'boolean'==typeof T&&(c.lazyHtmlGeneration=T),!1===k&&(c.hideFromBots=!1),!0===c.hideFromBots&&g&&(r.q=g.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(g.userAgent)||g.webdriver),i(_)&&(c.cookie={...d,..._}),c.autoClearCookies,r.F,c.manageScriptTags,(e=>{const{G:t,ee:n,te:a,U:s}=o.o;for(let c of e){const e=t[c],r=e.services||{},d=i(r)&&l(r)||[];n[c]={},a[c]=[],e.readOnly&&(s.push(c),a[c]=d),o.ie.le[c]={};for(let e of d){const t=r[e];t.ke=!1,n[c][e]=t}}})(m),(()=>{if(!o.t.manageScriptTags)return;const e=o.o;e.se=u(o.ie.Ue,'script[data-category]'),e.ce=[];for(const t of e.se){let o=b(t,'data-category'),n=t.dataset.service||'',s=!1;if(o&&'!'===o.charAt(0)&&(o=o.slice(1),s=!0),'!'===n.charAt(0)&&(n=n.slice(1),s=!0),a(e.J,o)&&(e.ce.push({xe:!1,De:s,Te:o,Me:n}),n)){const t=e.ee[o];t[n]||(t[n]={ke:!1})}}})(),Q((()=>{const e=o.o.i.language.autoDetect;if(e){let t;if('browser'===e?t=navigator.language.slice(0,2).toLowerCase():'document'===e&&(t=document.documentElement.lang),q(t))return t}return K()})())})(e),t.q)return;(()=>{const e=o.o,t=o.t,n=te(),{categories:a,services:i,consentId:r,consentTimestamp:l,lastConsentTimestamp:d,data:f,revision:_}=n,u=s(a);e.p=n,e.S=r;const p=!!r&&c(r);e.h=l,e.h&&(e.h=new Date(l)),e.C=d,e.C&&(e.C=new Date(d)),e.v=void 0!==f?f:null,e.F&&p&&_!==t.revision&&(e.O=!1),e.k=!(p&&e.O&&e.h&&e.C&&u),e.k,e.k?'opt-out'===t.mode&&(()=>{const e=o.o;for(const t of e.J)if(e.G[t].enabled){e.$.push(t);const o=e.ee[t]||{};for(let n in o)e.te[t].push(n)}})():(e.te={...e.te,...i},E([...e.U,...a]))})();const p=Ce();if(!await W())return!1;if(await(async e=>{N(null,e,U,Y),o.o.k&&$(e,Y),o.t.lazyHtmlGeneration||U(e,Y),(()=>{const e=o.ie,t=o.o;x(e.Ce,'keydown',(e=>{if('Tab'!==e.key)return;const n=t.P;if(n.length>0){const a=f();e.shiftKey?a===n[0]&&(n[1].focus(),_(e)):a===n[1]&&(n[0].focus(),_(e)),t.H||o.o.N||(t.H=!0,!t.I&&_(e),e.shiftKey?n[1].focus():n[0].focus())}!t.H&&(t.I=!0)}),!0)})()})(pe),n.autoShow&&!p&&de(!0),p)return O(),F(r.ue);'opt-out'===n.mode&&O(t.$)}},Se=e=>{const{qe:n,Ce:a}=o.ie,{name:s,path:c,domain:i}=o.t.cookie;e&&le(s,c,i);for(const{be:e,he:t,ye:n}of o.o.m)e.removeEventListener(t,n);n?.remove(),a?.classList.remove('disable--interaction','show--preferences','show--consent');const r=new t;for(const e in o)o[e]=r[e];window._ccRun=!1};export{ae as acceptCategory,ce as acceptService,se as acceptedCategory,ie as acceptedService,le as eraseCookies,ye as getConfig,he as getCookie,ge as getUserPreferences,fe as hide,ue as hidePreferences,ve as loadScript,Se as reset,we as run,be as setCookieData,me as setLanguage,de as show,_e as showPreferences,Ce as validConsent,re as validCookie}; |
/*! | ||
* CookieConsent 3.0.0-rc.10 | ||
* CookieConsent 3.0.0-rc.11 | ||
* https://github.com/orestbida/cookieconsent | ||
@@ -7,2 +7,2 @@ * Author Orest Bida | ||
*/ | ||
var e,t;e=this,t=function(e){'use strict';const t='opt-in',o='opt-out',n='show--consent',a='show--preferences',s='disable--interaction',c='data-category',r='div',i='button',l='aria-hidden',d='btn-group',f='click',_='data-role',u='consentModal',p='preferencesModal';class m{constructor(){this.t={mode:t,revision:0,autoShow:!0,autoClearCookies:!0,manageScriptTags:!0,hideFromBots:!0,lazyHtmlGeneration:!0,cookie:{name:'cc_cookie',expiresAfterDays:182,domain:'',path:'/',sameSite:'Lax'}},this.o={i:{},l:'',_:{},u:{},p:{},m:[],g:!1,h:null,v:null,C:null,S:'',T:!0,M:!1,D:!1,k:!1,A:!1,N:!1,H:!1,I:!1,V:!1,P:[],j:!1,F:!0,O:[],R:!1,B:'',G:!1,J:[],L:[],U:[],$:[],q:!1,K:!1,W:!1,X:[],Y:[],Z:[],ee:{},te:{},oe:{},ne:{},ae:{},se:[],ce:[]},this.re={ie:{},le:{}},this.de={},this.fe={_e:'cc:onFirstConsent',ue:'cc:onConsent',pe:'cc:onChange',me:'cc:onModalShow',ge:'cc:onModalHide',be:'cc:onModalReady'}}}const g=new m,b=(e,t)=>e.indexOf(t),y=(e,t)=>-1!==b(e,t),h=e=>Array.isArray(e),v=e=>'string'==typeof e,C=e=>!!e&&'object'==typeof e&&!h(e),w=e=>'function'==typeof e,S=e=>Object.keys(e),T=e=>Array.from(new Set(e)),x=()=>document.activeElement,M=e=>e.preventDefault(),D=(e,t)=>e.querySelectorAll(t),k=e=>e.dispatchEvent(new Event('change')),A=e=>{const t=document.createElement(e);return e===i&&(t.type=e),t},E=(e,t,o)=>e.setAttribute(t,o),N=(e,t,o)=>{e.removeAttribute(o?'data-'+t:t)},H=(e,t,o)=>e.getAttribute(o?'data-'+t:t),I=(e,t)=>e.appendChild(t),V=(e,t)=>e.classList.add(t),P=(e,t)=>V(e,'cm__'+t),j=(e,t)=>V(e,'pm__'+t),F=(e,t)=>e.classList.remove(t),O=e=>{if('object'!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());let t=Array.isArray(e)?[]:{};for(let o in e){let n=e[o];t[o]=O(n)}return t},R=()=>{const e={},{J:t,ee:o,te:n}=g.o;for(const a of t)e[a]=L(n[a],S(o[a]));return e},B=(e,t)=>dispatchEvent(new CustomEvent(e,{detail:t})),G=(e,t,o,n)=>{e.addEventListener(t,o),n&&g.o.m.push({ye:e,he:t,ve:o})},J=()=>{const e=g.t.cookie.expiresAfterDays;return w(e)?e(g.o.B):e},L=(e,t)=>{const o=e||[],n=t||[];return o.filter((e=>!y(n,e))).concat(n.filter((e=>!y(o,e))))},U=e=>{g.o.L=T(e),g.o.B=(()=>{let e='custom';const{L:t,J:o,U:n}=g.o,a=t.length;return a===o.length?e='all':a===n.length&&(e='necessary'),e})()},z=(e,t,o,n)=>{const{show:a,showPreferences:s,hide:c,hidePreferences:r,acceptCategory:i}=t,l=e||document,d=e=>D(l,`[data-cc="${e}"]`),_=(e,t)=>{M(e),i(t),r(),c()},u=d('show-preferencesModal'),p=d('show-consentModal'),m=d('accept-all'),b=d('accept-necessary'),y=d('accept-custom'),h=g.t.lazyHtmlGeneration;for(const e of u)E(e,'aria-haspopup','dialog'),G(e,f,(e=>{M(e),s()})),h&&G(e,'mouseenter',(e=>{M(e),g.o.A||o(t,n)}),!0);for(let e of p)E(e,'aria-haspopup','dialog'),G(e,f,(e=>{M(e),a(!0)}),!0);for(let e of m)G(e,f,(e=>{_(e,'all')}),!0);for(let e of y)G(e,f,(e=>{_(e)}),!0);for(let e of b)G(e,f,(e=>{_(e,[])}),!0)},$=()=>{const{T:e,L:t,J:o}=g.o;return{accepted:t,rejected:e?[]:o.filter((e=>!y(t,e)))}};let q;const K=e=>{clearTimeout(q),e?V(g.re.Ce,s):q=setTimeout((()=>{F(g.re.Ce,s)}),500)},Q=()=>{const{o:e,re:t}=g,o=['[href]',i,'input','details','[tabindex="0"]'].join(':not([tabindex="-1"]), '),n=(e,t)=>{const n=D(e,o);t[0]=n[0],t[1]=n[n.length-1]};e.M&&n(t.we,e.X),e.A&&n(t.Se,e.Y),e.I=!1,e.H=!1},W=(e,t,o)=>{const{pe:n,ue:a,_e:s,ge:c,be:r,me:i}=g.de,l=g.fe,d={cookie:g.o.p};if(t){const n={modalName:t};return e===l.me?w(i)&&i(n):e===l.ge?w(c)&&c(n):(n.modal=o,w(r)&&r(n)),B(e,n)}e===l._e?w(s)&&s(O(d)):e===l.ue?w(a)&&a(O(d)):(d.changedCategories=g.o.O,d.changedServices=g.o.ne,w(n)&&n(O(d))),B(e,O(d))},X=e=>{const{te:t,ne:o,J:n,ee:a,se:s,ce:r,p:i,O:l}=g.o;for(const e of n){const n=o[e]||t[e]||[];for(const o of n){const n=a[e][o],{onAccept:s,onReject:c}=n;n&&(!n.Te&&y(t[e],o)&&w(s)?(n.Te=!0,s()):n.Te&&!y(t[e],o)&&w(c)&&(n.Te=!1,c()))}}if(!g.t.manageScriptTags)return;const d=s,f=e||i.categories||[],_=(e,n)=>{if(n<e.length){const a=e[n],s=r[n],i=s.xe,d=s.Me,u=y(f,i),p=!!d&&y(t[i],d);if(!s.De){let t=!d&&!s.ke&&u,r=d&&!s.ke&&p,f=!d&&s.ke&&!u&&y(l,i),m=d&&s.ke&&!p&&y(o[i]||[],d);if(t||f||r||m){s.De=!0;const t=H(a,'type',!0);N(a,'type',!!t),N(a,c);let o=H(a,'src',!0);o&&N(a,'src',!0);const r=A('script');r.textContent=a.innerHTML;for(const{nodeName:e}of a.attributes)E(r,e,a[e]||H(a,e));if(t&&(r.type=t),o?r.src=o:o=a.src,o&&(r.onload=r.onerror=()=>{_(e,++n)}),a.replaceWith(r),o)return}}_(e,++n)}};_(d,0)},Y='bottom',Z='left',ee='center',te='right',oe='inline',ne='wide',ae='pm--',se=['middle','top',Y],ce=[Z,ee,te],re={box:{Ae:[ne,oe],Ee:se,Ne:ce,He:Y,Ie:te},cloud:{Ae:[oe],Ee:se,Ne:ce,He:Y,Ie:ee},bar:{Ae:[oe],Ee:se.slice(1),Ne:[],He:Y,Ie:''}},ie={box:{Ae:[],Ee:[],Ne:[],He:'',Ie:''},bar:{Ae:[ne],Ee:[],Ne:[Z,te],He:'',Ie:Z}},le=e=>{const t=g.o.i.guiOptions,o=t?.consentModal,n=t?.preferencesModal;0===e&&de(g.re.we,re,o,'cm--','box','cm'),1===e&&de(g.re.Se,ie,n,ae,'box','pm')},de=(e,t,o,n,a,s)=>{if(!o)return;e.className=s;const{layout:c,position:r,flipButtons:i}=o,l=!1!==o.equalWeightButtons,d=c?.split(' ')||[],f=d[0],_=d[1],u=f in t?f:a,p=t[u],m=y(p.Ae,_)&&_,b=r?.split(' ')||[],h=b[0],v=n===ae?b[0]:b[1],C=y(p.Ee,h)?h:p.He,w=y(p.Ne,v)?v:p.Ie,S=t=>V(e,n+t);S(u),S(m),S(C),S(w),i&&S('flip');const T=s+'__btn--secondary';if('cm'===s){const{Ve:e,Pe:t}=g.re;e&&(l?F(e,T):V(e,T)),t&&(l?F(t,T):V(t,T))}else{const{je:e}=g.re;e&&(l?F(e,T):V(e,T))}},fe=(e,t)=>{const o=g.o,n=g.re,{hide:a,hidePreferences:s,acceptCategory:c}=e,u=e=>{c(e),s(),a()},m=o.u&&o.u.preferencesModal;if(!m)return;const b=m.title,y=m.closeIconLabel,h=m.acceptAllBtn,w=m.acceptNecessaryBtn,T=m.savePreferencesBtn,x=m.sections,M=h||w||T;if(n.Fe)n.Oe=A(r),j(n.Oe,'body');else{n.Fe=A(r),V(n.Fe,'pm-wrapper'),n.Se=A(r),n.Se.style.visibility='hidden',V(n.Se,'pm'),E(n.Se,'role','dialog'),E(n.Se,l,!0),E(n.Se,'aria-modal',!0),E(n.Se,'aria-labelledby','pm__title'),G(n.Ce,'keydown',(e=>{27===e.keyCode&&s()}),!0),n.Re=A(r),j(n.Re,'header'),n.Be=A(r),j(n.Be,'title'),n.Be.id='pm__title',E(n.Be,'role','heading'),E(n.Be,'aria-level','2'),n.Ge=A(i),j(n.Ge,'close-btn'),E(n.Ge,'aria-label',m.closeIconLabel||''),G(n.Ge,f,s),n.Je=A(r),j(n.Je,'body'),n.Le=A(r),j(n.Le,'footer');var D=A(r);V(D,'btns');var k=A(r),N=A(r);j(k,d),j(N,d),I(n.Le,k),I(n.Le,N),I(n.Re,n.Be),I(n.Re,n.Ge),I(n.Se,n.Re),I(n.Se,n.Je),M&&I(n.Se,n.Le),I(n.Fe,n.Se)}let H;b&&(n.Be.innerHTML=b,y&&E(n.Ge,'aria-label',y)),x&&x.forEach((e=>{const t=e.title,a=e.description,s=e.linkedCategory,c=s&&o.G[s],d=e.cookieTable,_=d?.body,u=_?.length>0,p=!!c,g=p&&o.ee[s],b=C(g)&&S(g)||[],y=p&&(!!a||!!u||S(g).length>0);var h=A(r);if(j(h,'section'),y||a){var w=A(r);j(w,'section-desc-wrapper')}let T=b.length;if(y&&T>0){const e=A(r);j(e,'section-services');for(const t of b){const o=g[t]?.label||t,n=A(r),a=A(r),i=A(r),l=A(r);j(n,'service'),j(l,'service-title'),j(a,'service-header'),j(i,'service-icon');const d=_e(o,t,c,!0,s);l.innerHTML=o,I(a,i),I(a,l),I(n,a),I(n,d),I(e,n)}I(w,e)}if(t){var x=A(r),M=A(p?i:r);if(j(x,'section-title-wrapper'),j(M,'section-title'),M.innerHTML=t,I(x,M),p){const e=A('span');j(e,'section-arrow'),I(x,e),h.className+='--toggle';const o=_e(t,s,c);let n=m.serviceCounterLabel;if(T>0&&v(n)){let e=A('span');j(e,'badge'),j(e,'service-counter'),E(e,l,!0),E(e,'data-servicecounter',T),n&&(n=n.split('|'),n=n.length>1&&T>1?n[1]:n[0],E(e,'data-counterlabel',n)),e.innerHTML=T+(n?' '+n:''),I(M,e)}if(y){j(h,'section--expandable');var D=s+'-desc';E(M,'aria-expanded',!1),E(M,'aria-controls',D)}I(x,o)}else E(M,'role','heading'),E(M,'aria-level','3');I(h,x)}if(a){var k=A(r);j(k,'section-desc'),k.innerHTML=a,I(w,k)}if(y&&(E(w,l,'true'),w.id=D,((e,t,o)=>{G(M,f,(()=>{t.classList.contains('is-expanded')?(F(t,'is-expanded'),E(o,'aria-expanded','false'),E(e,l,'true')):(V(t,'is-expanded'),E(o,'aria-expanded','true'),E(e,l,'false'))}))})(w,h,M),u)){const e=A('table'),t=A('thead'),o=A('tbody');j(e,'section-table'),j(t,'table-head'),j(o,'table-body');const a=d.headers,s=S(a),c=n.Ue.createDocumentFragment(),i=A('tr');E(i,'role','row');for(const e of s){const t=a[e],o=A('th');o.id='cc__row-'+t,E(o,'role','columnheader'),E(o,'scope','col'),j(o,'table-th'),o.innerHTML=t,I(c,o)}I(i,c),I(t,i);const l=n.Ue.createDocumentFragment();for(const e of _){const t=A('tr');E(t,'role','row'),j(t,'table-tr');for(const o of s){const n=a[o],s=e[o],c=A('td'),i=A(r);j(c,'table-td'),E(c,'data-column',n),E(c,'headers','cc__row-'+n),i.insertAdjacentHTML('beforeend',s),I(c,i),I(t,c)}I(l,t)}I(o,l),I(e,t),I(e,o),I(w,e)}(y||a)&&I(h,w);const N=n.Oe||n.Je;p?(H||(H=A(r),j(H,'section-toggles')),H.appendChild(h)):H=null,I(N,H||h)})),(h||w)&&(w&&(n.je||(n.je=A(i),j(n.je,'btn'),E(n.je,_,'necessary'),I(k,n.je),G(n.je,f,(()=>u([])))),n.je.innerHTML=w),h&&(n.ze||(n.ze=A(i),j(n.ze,'btn'),E(n.ze,_,'all'),I(k,n.ze),G(n.ze,f,(()=>u('all')))),n.ze.innerHTML=h)),T&&(n.$e||(n.$e=A(i),j(n.$e,'btn'),j(n.$e,'btn--secondary'),E(n.$e,_,'save'),I(N,n.$e),G(n.$e,f,(()=>u()))),n.$e.innerHTML=T),n.Oe&&(n.Se.replaceChild(n.Oe,n.Je),n.Je=n.Oe),le(1),o.A||(o.A=!0,W(g.fe.be,p,n.Se),t(e),setTimeout(Q,10),I(n.qe,n.Fe),setTimeout((()=>V(n.Fe,'cc--anim')),100))};function _e(e,t,o,n,a){const s=g.o,r=g.re,i=A('label'),d=A('input'),_=A('span'),u=A('span'),p=A('span'),m=A('span');if(d.type='checkbox',V(i,'section__toggle-wrapper'),V(d,'section__toggle'),V(p,'toggle__icon-on'),V(m,'toggle__icon-off'),V(_,'toggle__icon'),V(u,'toggle__label'),E(_,l,'true'),n?(V(i,'toggle-service'),E(d,c,a),r.le[a][t]=d):r.ie[t]=d,n?(e=>{G(d,'change',(()=>{const t=r.le[e],o=r.ie[e];s.oe[e]=[];for(let o in t){const n=t[o];n.checked&&s.oe[e].push(n.value)}o.checked=s.oe[e].length>0}))})(a):(e=>{G(d,f,(()=>{const t=r.le[e];s.oe[e]=[];for(let e in t)t[e].checked=d.checked}))})(t),d.value=t,u.textContent=e.replace(/<.*>.*<\/.*>/gm,''),I(_,m),I(_,p),s.T)(o.enabled||o.readOnly)&&(d.checked=!0);else if(n){const e=s.te[a];d.checked=o.readOnly||y(e,t)}else y(s.L,t)&&(d.checked=!0);return o.readOnly&&(d.disabled=!0),I(i,d),I(i,_),I(i,u),i}const ue=(e,t)=>{const o=g.o,n=g.re,{hide:a,showPreferences:s,acceptCategory:c}=e,p=o.u&&o.u.consentModal;if(!p)return;const m=p.acceptAllBtn,b=p.acceptNecessaryBtn,y=p.showPreferencesBtn,h=p.closeIconLabel,v=p.footer,C=p.label,w=p.title,S=e=>{a(),c(e)};if(!n.Ke){n.Ke=A(r),n.we=A(r),n.Qe=A(r),n.We=A(r),n.Xe=A(r),V(n.Ke,'cm-wrapper'),V(n.we,'cm'),P(n.Qe,'body'),P(n.We,'texts'),P(n.Xe,'btns'),E(n.we,'role','dialog'),E(n.we,'aria-modal','true'),E(n.we,l,'false'),E(n.we,'aria-describedby','cm__desc'),C?E(n.we,'aria-label',C):w&&E(n.we,'aria-labelledby','cm__title'),n.we.style.visibility='hidden';const e='box',t=o.i.guiOptions?.consentModal,a=(t?.layout||e).split(' ')[0]===e;w&&h&&a&&(n.Pe||(n.Pe=A(i),P(n.Pe,'btn'),P(n.Pe,'btn--close'),G(n.Pe,f,(()=>{S([])})),I(n.Qe,n.Pe)),E(n.Pe,'aria-label',h)),I(n.Qe,n.We),(m||b||y)&&I(n.Qe,n.Xe),I(n.we,n.Qe),I(n.Ke,n.we)}w&&(n.Ye||(n.Ye=A(r),n.Ye.className=n.Ye.id='cm__title',E(n.Ye,'role','heading'),E(n.Ye,'aria-level','2'),I(n.We,n.Ye)),n.Ye.innerHTML=w);let T=p.description;if(T&&(o.j&&(T=T.replace('{{revisionMessage}}',o.F?'':p.revisionMessage||'')),n.Ze||(n.Ze=A(r),n.Ze.className=n.Ze.id='cm__desc',I(n.We,n.Ze)),n.Ze.innerHTML=T),m&&(n.et||(n.et=A(i),P(n.et,'btn'),E(n.et,_,'all'),G(n.et,f,(()=>{S('all')}))),n.et.innerHTML=m),b&&(n.Ve||(n.Ve=A(i),P(n.Ve,'btn'),E(n.Ve,_,'necessary'),G(n.Ve,f,(()=>{S([])}))),n.Ve.innerHTML=b),y&&(n.tt||(n.tt=A(i),P(n.tt,'btn'),P(n.tt,'btn--secondary'),E(n.tt,_,'show'),G(n.tt,'mouseenter',(()=>{o.A||fe(e,t)})),G(n.tt,f,s)),n.tt.innerHTML=y),n.ot||(n.ot=A(r),P(n.ot,d),b&&I(n.ot,n.Ve),m&&I(n.ot,n.et),(m||b)&&I(n.Qe,n.ot),I(n.Xe,n.ot)),n.tt&&!n.nt&&(n.nt=A(r),n.Ve&&n.et?(P(n.nt,d),I(n.nt,n.tt),I(n.Xe,n.nt)):(I(n.ot,n.tt),P(n.ot,'btn-group--uneven'))),v){if(!n.st){let e=A(r),t=A(r);n.st=A(r),P(e,'footer'),P(t,'links'),P(n.st,'link-group'),I(t,n.st),I(e,t),I(n.we,e)}n.st.innerHTML=v}le(0),o.M||(o.M=!0,W(g.fe.be,u,n.we),t(e),setTimeout(Q,10),I(n.qe,n.Ke),setTimeout((()=>V(n.Ke,'cc--anim')),100)),z(n.Qe,e,fe,t)},pe=e=>v(e)&&e in g.o._,me=()=>g.o.l||g.o.i.language.default,ge=e=>{e&&(g.o.l=e)},be=async e=>{const t=g.o;let o;o=e&&pe(e)?e:me();let n=t._[o];if(!n)return!1;if(v(n)){const e=await(async e=>{try{const t=await fetch(e,{method:'GET'});return!!t.ok&&await t.json()}catch(e){return!1}})(n);if(!e)return!1;n=e}return t.u=n,ge(o),!0},ye=()=>{let e=g.o.i.language.rtl,t=g.re.qe;e&&t&&(h(e)||(e=[e]),y(e,g.o.l)?V(t,'cc--rtl'):F(t,'cc--rtl'))},he=e=>{const t=g.re;if(!t.qe){t.qe=A(r),t.qe.id='cc-main',t.qe.style.position='fixed',t.qe.style.zIndex='2147483647',ye();let o=g.o.i.root;o&&v(o)&&(o=document.querySelector(o)),I(o||t.Ue.body,t.qe),(({hidePreferences:e})=>{const t=g.re;G(t.qe,f,(o=>{const n=g.o;n.V?t.Se.contains(o.target)?n.N=!0:(e(),n.N=!1):n.D&&t.we.contains(o.target)&&(n.N=!0)}))})(e)}},ve=e=>{const{hostname:t,protocol:o}=location,{name:n,path:a,domain:s,sameSite:c}=g.t.cookie,r=encodeURIComponent(JSON.stringify(g.o.p)),i=e?(()=>{const e=g.o.C,t=e?new Date-e:0;return 864e5*J()-t})():864e5*J(),l=new Date;l.setTime(l.getTime()+i);let d=n+'='+r+(0!==i?'; expires='+l.toUTCString():'')+'; Path='+a+'; SameSite='+c;y(t,'.')&&(d+='; Domain='+s),'https:'===o&&(d+='; Secure'),document.cookie=d,g.o.p},Ce=(e,t,o)=>{const n=o||g.t.cookie.domain,a=t||g.t.cookie.path,s='www.'===n.slice(0,4),c=s&&n.substring(4),r=(e,t)=>{document.cookie=e+'=; path='+a+(t?'; domain=.'+t:'')+'; expires=Thu, 01 Jan 1970 00:00:01 GMT;'};for(const t of e)r(t),r(t,n),s&&r(t,c)},we=e=>(e=>{let t;try{t=JSON.parse(decodeURIComponent(e))}catch(e){t={}}return t})(Se(e||g.t.cookie.name,!0)),Se=(e,t)=>{const o=document.cookie.match('(^|;)\\s*'+e+'\\s*=\\s*([^;]+)');return o?t?o.pop():e:''},Te=e=>{const t=document.cookie.split(/;\s*/),o=[];for(const n of t){let t=n.split('=')[0];if(e)try{e.test(t)&&o.push(t)}catch(e){}else o.push(t)}return o},xe=(e,n=[])=>{((e,t)=>{const{J:o,U:n,p:a,A:s}=g.o;let c=[];e?h(e)?c.push(...e):v(e)&&('all'===e?c=o:c.push(e)):c=s?(()=>{const{oe:e}=g.o,t=g.re.ie;if(!t)return[];let o=[];for(let e in t)t[e].checked&&o.push(e);for(let t in e)e[t].length>0&&o.push(t);return o})():a.categories,c=c.filter((e=>!y(o,e)||!y(t,e))),c.push(...n),U(c)})(e,n),(()=>{const e=g.o,{B:t,oe:o,U:n,L:a,te:s,ee:c,J:r}=e;e.ae=O(s);for(const i of r){const r=c[i],l=S(r),d=o[i]?.length>0,f=y(n,i);if(0!==l.length){if(s[i]=[],f)s[i].push(...l);else{if('all'===t)if(d){const e=o[i];s[i].push(...e)}else s[i].push(...l);else if('necessary'===t)s[i]=[];else if(d){const e=o[i];s[i].push(...e)}else y(a,i)&&s[i].push(...l);e.oe={}}s[i]=T(s[i])}}})(),(()=>{const e=g.o;g.t.mode===o&&e.T?e.O=L(e.$,e.L):e.O=L(e.L,e.p.categories);let n=e.O.length>0,a=!1;for(const t of e.J)e.ne[t]=L(e.te[t],e.ae[t]),e.ne[t].length>0&&(a=!0);const s=g.re.ie;for(let t in s)s[t].checked=y(e.L,t);for(const t of e.J){const o=g.re.le[t],n=e.te[t];for(const e in o)o[e].checked=y(n,e)}e.v||(e.v=new Date),e.S||(e.S=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))),e.p={categories:O(e.L),revision:g.t.revision,data:e.h,consentTimestamp:e.v.toISOString(),consentId:e.S,services:O(e.te)};let c=!1;(e.T||n||a)&&(e.T&&(e.T=!1,c=!0),U(e.L),e.C?e.C=new Date:e.C=e.v,e.p.lastConsentTimestamp=e.C.toISOString(),ve(),g.t.autoClearCookies&&(c||!e.T&&n)&&(e=>{const t=g.o,o=Te();t.R=!1;let n=e?t.J:t.O;n=n.filter((e=>{let o=t.G[e];return!!o&&!o.readOnly&&!!o.autoClear}));for(const a of n){const n=t.G[a].autoClear,s=n?.cookies||[],c=y(t.O,a),r=!y(t.L,a),i=c&&r;if(e&&r||!e&&i){!0===n.reloadPage&&i&&(t.R=!0);for(const e of s){let t=[];const n=e.name,a=e.domain,s=e.path;if(n instanceof RegExp)for(let e of o)n.test(e)&&t.push(e);else{let e=b(o,n);e>-1&&t.push(o[e])}t.length>0&&Ce(t,s,a)}}}})(c),X()),c&&(W(g.fe._e),W(g.fe.ue),g.t.mode===t)||((n||a)&&W(g.fe.pe),e.R&&location.reload())})()},Me=(e,t,o)=>{let n=[];const a=e=>{if(v(e)){let t=Se(e);''!==t&&n.push(t)}else n.push(...Te(e))};if(h(e))for(let t of e)a(t);else a(e);Ce(n,t,o)},De=e=>{const{re:t,o:o}=g;e&&!o.M&&ue(Ne,he),o.M&&(o.D=!0,o.g&&K(!0),V(t.Ce,n),E(t.we,l,'false'),setTimeout((()=>{o.K=x(),o.P=o.X}),200),W(g.fe.me,u))},ke=()=>{const{re:e,o:t,fe:o}=g;t.M&&(t.D=!1,t.g&&K(),F(e.Ce,n),E(e.we,l,'true'),setTimeout((()=>{t.K.focus(),t.P=[]}),200),W(o.ge,u))},Ae=()=>{const e=g.o;e.A&&e.k||(e.A||fe(Ne,he),V(g.re.Ce,a),E(g.re.Se,l,'false'),e.k=!0,setTimeout((()=>{e.V=!0}),1),setTimeout((()=>{e.D?e.W=x():e.K=x(),0!==e.Y.length&&(e.Y[0].focus(),e.P=e.Y)}),200),W(g.fe.me,p))},Ee=()=>{const e=g.o;e.k&&(F(g.re.Ce,a),E(g.re.Se,l,'true'),e.k=!1,setTimeout((()=>{e.V=!1}),1),e.D?(e.W&&e.W.focus(),e.P=e.X):(e.K&&e.K.focus(),e.P=[]),e.N=!1,W(g.fe.ge,p))};var Ne={show:De,hide:ke,showPreferences:Ae,hidePreferences:Ee,acceptCategory:xe};const He=(e,t)=>{const o=we(t);return e?o[e]:o},Ie=()=>!g.o.T;e.acceptCategory=xe,e.acceptService=(e,t)=>{const{J:o,ee:n}=g.o;if(!(e&&t&&v(t)&&y(o,t)&&0!==S(n[t]).length))return!1;((e,t)=>{const o=g.o,{ee:n,oe:a}=o,s=g.re.le[t]||{},c=S(n[t]);if(a[t]=[],v(e))if('all'===e)for(let e in s)s[e].checked=!0,k(s[e]);else{for(let t in s)s[t].checked=e===t,k(s[t]);y(c,e)&&a[t].push(e)}else if(h(e))for(let o in s){const n=y(e,o);s[o].checked=n,k(s[o]),n&&a[t].push(o)}})(e,t),xe()},e.acceptedCategory=e=>{let o;return o=g.o.T&&g.t.mode!==t?g.o.$:$().accepted||[],y(o,e)},e.acceptedService=(e,t)=>y(g.o.te[t]||[],e),e.eraseCookies=Me,e.getConfig=e=>{const t=g.t,o=g.o.i;return e?t[e]||o[e]:{...t,...o,cookie:{...t.cookie}}},e.getCookie=He,e.getUserPreferences=()=>{const{B:e,te:t}=g.o,{accepted:o,rejected:n}=$();return O({acceptType:e,acceptedCategories:o,rejectedCategories:n,acceptedServices:t,rejectedServices:R()})},e.hide=ke,e.hidePreferences=Ee,e.loadScript=(e,t)=>{let o=document.querySelector('script[src="'+e+'"]');return new Promise((n=>{if(o)return n(!0);if(o=A('script'),C(t))for(const e in t)E(o,e,t[e]);o.onload=()=>n(!0),o.onerror=()=>{o.remove(),n(!1)},o.src=e,I(document.head,o)}))},e.reset=e=>{const{qe:t,Ce:o}=g.re,{name:c,path:r,domain:i}=g.t.cookie;e&&Me(c,r,i);for(const{ye:e,he:t,ve:o}of g.o.m)e.removeEventListener(t,o);t?.remove(),o?.classList.remove(s,a,n);const l=new m;for(const e in g)g[e]=l[e];window._ccRun=!1},e.run=async e=>{const{o:t,t:n,fe:a}=g,s=window;if(!s._ccRun){if(s._ccRun=!0,(e=>{const{re:t,t:n,o:a}=g,s=n,r=a,{cookie:i}=s,l=g.de,d=e.cookie,f=e.categories,_=S(f)||[],u=navigator,p=document;t.Ue=p,t.Ce=p.documentElement,i.domain=location.hostname,r.i=e,r._=e.language.translations,r.G=f,r.J=_,r.g=!!e.disablePageInteraction,l._e=e.onFirstConsent,l.ue=e.onConsent,l.pe=e.onChange,l.ge=e.onModalHide,l.me=e.onModalShow,l.be=e.onModalReady;const{mode:m,autoShow:b,autoClearCookies:h,revision:v,manageScriptTags:w,hideFromBots:T,lazyHtmlGeneration:x}=e;m===o&&(s.mode=m),'boolean'==typeof b&&(s.autoShow=b),'boolean'==typeof h&&(s.autoClearCookies=h),'boolean'==typeof w&&(s.manageScriptTags=w),'number'==typeof v&&v>=0&&(s.revision=v,r.j=!0),'boolean'==typeof x&&(s.lazyHtmlGeneration=x),!1===T&&(s.hideFromBots=!1),!0===s.hideFromBots&&u&&(r.q=u.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(u.userAgent)||u.webdriver),C(d)&&(s.cookie={...i,...d}),s.autoClearCookies,r.j,s.manageScriptTags,(e=>{const{G:t,ee:o,te:n,U:a}=g.o;for(let s of e){const e=t[s],c=e.services||{},r=C(c)&&S(c)||[];o[s]={},n[s]=[],e.readOnly&&(a.push(s),n[s]=r),g.re.le[s]={};for(let e of r){const t=c[e];t.Te=!1,o[s][e]=t}}})(_),(()=>{if(!g.t.manageScriptTags)return;const e=g.o;e.se=D(g.re.Ue,'script[data-category]'),e.ce=[];for(const t of e.se){let o=H(t,c),n=t.dataset.service||'',a=!1;if(o&&'!'===o.charAt(0)&&(o=o.slice(1),a=!0),'!'===n.charAt(0)&&(n=n.slice(1),a=!0),y(e.J,o)&&(e.ce.push({De:!1,ke:a,xe:o,Me:n}),n)){const t=e.ee[o];t[n]||(t[n]={Te:!1})}}})(),ge((()=>{const e=g.o.i.language.autoDetect;if(e){let t;if('browser'===e?t=navigator.language.slice(0,2).toLowerCase():'document'===e&&(t=document.documentElement.lang),pe(t))return t}return me()})())})(e),t.q)return;(()=>{const e=g.o,t=g.t,n=we(),{categories:a,services:s,consentId:c,consentTimestamp:r,lastConsentTimestamp:i,data:l,revision:d}=n,f=h(a);e.p=n,e.S=c;const _=!!c&&v(c);e.v=r,e.v&&(e.v=new Date(r)),e.C=i,e.C&&(e.C=new Date(i)),e.h=void 0!==l?l:null,e.j&&_&&d!==t.revision&&(e.F=!1),e.T=!(_&&e.F&&e.v&&e.C&&f),e.T,e.T?t.mode===o&&(()=>{const e=g.o;for(const t of e.J)if(e.G[t].enabled){e.$.push(t);const o=e.ee[t]||{};for(let n in o)e.te[t].push(n)}})():(e.te={...e.te,...s},U([...e.U,...a]))})();const r=Ie();if(!await be())return!1;if(await(async e=>{z(null,e,fe,he),g.o.T&&ue(e,he),g.t.lazyHtmlGeneration||fe(e,he),(()=>{const e=g.re,t=g.o;G(e.Ce,'keydown',(e=>{if('Tab'!==e.key)return;const o=t.P;if(o.length>0){const n=x();e.shiftKey?n===o[0]&&(o[1].focus(),M(e)):n===o[1]&&(o[0].focus(),M(e)),t.H||g.o.N||(t.H=!0,!t.I&&M(e),e.shiftKey?o[1].focus():o[0].focus())}!t.H&&(t.I=!0)}),!0)})()})(Ne),n.autoShow&&!r&&De(!0),r)return X(),W(a.ue);n.mode===o&&X(t.$)}},e.setCookieData=e=>{let t,o=e.value,n=e.mode,a=!1;const s=g.o;if('update'===n){s.h=t=He('data');const e=typeof t==typeof o;if(e&&'object'==typeof t){!t&&(t={});for(let e in o)t[e]!==o[e]&&(t[e]=o[e],a=!0)}else!e&&t||t===o||(t=o,a=!0)}else t=o,a=!0;return a&&(s.h=t,s.p.data=t,ve(!0)),a},e.setLanguage=async(e,t)=>{if(!pe(e))return!1;const o=g.o;return!(e===me()&&!0!==t||!await be(e)||(ge(e),o.M&&ue(Ne,he),o.A&&fe(Ne,he),ye(),Q(),0))},e.show=De,e.showPreferences=Ae,e.validConsent=Ie,e.validCookie=e=>''!==Se(e,!0)},'object'==typeof exports&&'undefined'!=typeof module?t(exports):'function'==typeof define&&define.amd?define(['exports'],t):t((e='undefined'!=typeof globalThis?globalThis:e||self).CookieConsent={}); | ||
var e,t;e=this,t=function(e){'use strict';const t='opt-in',o='opt-out',n='show--consent',a='show--preferences',s='disable--interaction',c='data-category',r='div',i='button',l='aria-hidden',d='btn-group',f='click',_='data-role',u='consentModal',p='preferencesModal';class m{constructor(){this.t={mode:t,revision:0,autoShow:!0,autoClearCookies:!0,manageScriptTags:!0,hideFromBots:!0,lazyHtmlGeneration:!0,cookie:{name:'cc_cookie',expiresAfterDays:182,domain:'',path:'/',sameSite:'Lax'}},this.o={i:{},l:'',_:{},u:{},p:{},m:[],g:!1,h:null,v:null,C:null,S:'',T:!0,M:!1,D:!1,k:!1,A:!1,N:!1,H:!1,I:!1,V:!1,P:[],j:!1,F:!0,O:[],R:!1,B:'',G:!1,J:[],L:[],U:[],$:[],q:!1,K:!1,W:!1,X:[],Y:[],Z:[],ee:{},te:{},oe:{},ne:{},ae:{},se:[],ce:[]},this.re={ie:{},le:{}},this.de={},this.fe={_e:'cc:onFirstConsent',ue:'cc:onConsent',pe:'cc:onChange',me:'cc:onModalShow',ge:'cc:onModalHide',be:'cc:onModalReady'}}}const g=new m,b=(e,t)=>e.indexOf(t),y=(e,t)=>-1!==b(e,t),h=e=>Array.isArray(e),v=e=>'string'==typeof e,C=e=>!!e&&'object'==typeof e&&!h(e),w=e=>'function'==typeof e,S=e=>Object.keys(e),T=e=>Array.from(new Set(e)),x=()=>document.activeElement,M=e=>e.preventDefault(),D=(e,t)=>e.querySelectorAll(t),k=e=>e.dispatchEvent(new Event('change')),A=e=>{const t=document.createElement(e);return e===i&&(t.type=e),t},E=(e,t,o)=>e.setAttribute(t,o),N=(e,t,o)=>{e.removeAttribute(o?'data-'+t:t)},H=(e,t,o)=>e.getAttribute(o?'data-'+t:t),I=(e,t)=>e.appendChild(t),V=(e,t)=>e.classList.add(t),P=(e,t)=>V(e,'cm__'+t),j=(e,t)=>V(e,'pm__'+t),F=(e,t)=>e.classList.remove(t),O=e=>{if('object'!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());let t=Array.isArray(e)?[]:{};for(let o in e){let n=e[o];t[o]=O(n)}return t},R=()=>{const e={},{J:t,ee:o,te:n}=g.o;for(const a of t)e[a]=L(n[a],S(o[a]));return e},B=(e,t)=>dispatchEvent(new CustomEvent(e,{detail:t})),G=(e,t,o,n)=>{e.addEventListener(t,o),n&&g.o.m.push({ye:e,he:t,ve:o})},J=()=>{const e=g.t.cookie.expiresAfterDays;return w(e)?e(g.o.B):e},L=(e,t)=>{const o=e||[],n=t||[];return o.filter((e=>!y(n,e))).concat(n.filter((e=>!y(o,e))))},U=e=>{g.o.L=T(e),g.o.B=(()=>{let e='custom';const{L:t,J:o,U:n}=g.o,a=t.length;return a===o.length?e='all':a===n.length&&(e='necessary'),e})()},z=(e,t,o,n)=>{const{show:a,showPreferences:s,hide:c,hidePreferences:r,acceptCategory:i}=t,l=e||document,d=e=>D(l,`[data-cc="${e}"]`),_=(e,t)=>{M(e),i(t),r(),c()},u=d('show-preferencesModal'),p=d('show-consentModal'),m=d('accept-all'),b=d('accept-necessary'),y=d('accept-custom'),h=g.t.lazyHtmlGeneration;for(const e of u)E(e,'aria-haspopup','dialog'),G(e,f,(e=>{M(e),s()})),h&&G(e,'mouseenter',(e=>{M(e),g.o.A||o(t,n)}),!0);for(let e of p)E(e,'aria-haspopup','dialog'),G(e,f,(e=>{M(e),a(!0)}),!0);for(let e of m)G(e,f,(e=>{_(e,'all')}),!0);for(let e of y)G(e,f,(e=>{_(e)}),!0);for(let e of b)G(e,f,(e=>{_(e,[])}),!0)},$=()=>{const{T:e,L:t,J:o}=g.o;return{accepted:t,rejected:e?[]:o.filter((e=>!y(t,e)))}};let q;const K=e=>{clearTimeout(q),e?V(g.re.Ce,s):q=setTimeout((()=>{F(g.re.Ce,s)}),500)},Q=()=>{const{o:e,re:t}=g,o=['[href]',i,'input','details','[tabindex="0"]'].join(':not([tabindex="-1"]), '),n=(e,t)=>{const n=D(e,o);t[0]=n[0],t[1]=n[n.length-1]};e.M&&n(t.we,e.X),e.A&&n(t.Se,e.Y),e.I=!1,e.H=!1},W=(e,t,o)=>{const{pe:n,ue:a,_e:s,ge:c,be:r,me:i}=g.de,l=g.fe,d={cookie:g.o.p};if(t){const n={modalName:t};return e===l.me?w(i)&&i(n):e===l.ge?w(c)&&c(n):(n.modal=o,w(r)&&r(n)),B(e,n)}e===l._e?w(s)&&s(O(d)):e===l.ue?w(a)&&a(O(d)):(d.changedCategories=g.o.O,d.changedServices=g.o.ne,w(n)&&n(O(d))),B(e,O(d))},X=e=>{const{te:t,ne:o,J:n,ee:a,se:s,ce:r,p:i,O:l}=g.o;for(const e of n){const n=o[e]||t[e]||[];for(const o of n){const n=a[e][o],{onAccept:s,onReject:c}=n;n&&(!n.Te&&y(t[e],o)&&w(s)?(n.Te=!0,s()):n.Te&&!y(t[e],o)&&w(c)&&(n.Te=!1,c()))}}if(!g.t.manageScriptTags)return;const d=s,f=e||i.categories||[],_=(e,n)=>{if(n<e.length){const a=e[n],s=r[n],i=s.xe,d=s.Me,u=y(f,i),p=!!d&&y(t[i],d);if(!s.De){let t=!d&&!s.ke&&u,r=d&&!s.ke&&p,f=!d&&s.ke&&!u&&y(l,i),m=d&&s.ke&&!p&&y(o[i]||[],d);if(t||f||r||m){s.De=!0;const t=H(a,'type',!0);N(a,'type',!!t),N(a,c);let o=H(a,'src',!0);o&&N(a,'src',!0);const r=A('script');r.textContent=a.innerHTML;for(const{nodeName:e}of a.attributes)E(r,e,a[e]||H(a,e));if(t&&(r.type=t),o?r.src=o:o=a.src,o&&(r.onload=r.onerror=()=>{_(e,++n)}),a.replaceWith(r),o)return}}_(e,++n)}};_(d,0)},Y='bottom',Z='left',ee='center',te='right',oe='inline',ne='wide',ae='pm--',se=['middle','top',Y],ce=[Z,ee,te],re={box:{Ae:[ne,oe],Ee:se,Ne:ce,He:Y,Ie:te},cloud:{Ae:[oe],Ee:se,Ne:ce,He:Y,Ie:ee},bar:{Ae:[oe],Ee:se.slice(1),Ne:[],He:Y,Ie:''}},ie={box:{Ae:[],Ee:[],Ne:[],He:'',Ie:''},bar:{Ae:[ne],Ee:[],Ne:[Z,te],He:'',Ie:Z}},le=e=>{const t=g.o.i.guiOptions,o=t?.consentModal,n=t?.preferencesModal;0===e&&de(g.re.we,re,o,'cm--','box','cm'),1===e&&de(g.re.Se,ie,n,ae,'box','pm')},de=(e,t,o,n,a,s)=>{e.className=s;const c=o?.layout,r=o?.position,i=o?.flipButtons,l=!1!==o?.equalWeightButtons,d=c?.split(' ')||[],f=d[0],_=d[1],u=f in t?f:a,p=t[u],m=y(p.Ae,_)&&_,b=r?.split(' ')||[],h=b[0],v=n===ae?b[0]:b[1],C=y(p.Ee,h)?h:p.He,w=y(p.Ne,v)?v:p.Ie,S=t=>V(e,n+t);S(u),S(m),S(C),S(w),i&&S('flip');const T=s+'__btn--secondary';if('cm'===s){const{Ve:e,Pe:t}=g.re;e&&(l?F(e,T):V(e,T)),t&&(l?F(t,T):V(t,T))}else{const{je:e}=g.re;e&&(l?F(e,T):V(e,T))}},fe=(e,t)=>{const o=g.o,n=g.re,{hide:a,hidePreferences:s,acceptCategory:c}=e,u=e=>{c(e),s(),a()},m=o.u&&o.u.preferencesModal;if(!m)return;const b=m.title,y=m.closeIconLabel,h=m.acceptAllBtn,w=m.acceptNecessaryBtn,T=m.savePreferencesBtn,x=m.sections,M=h||w||T;if(n.Fe)n.Oe=A(r),j(n.Oe,'body');else{n.Fe=A(r),V(n.Fe,'pm-wrapper'),n.Se=A(r),n.Se.style.visibility='hidden',V(n.Se,'pm'),E(n.Se,'role','dialog'),E(n.Se,l,!0),E(n.Se,'aria-modal',!0),E(n.Se,'aria-labelledby','pm__title'),G(n.Ce,'keydown',(e=>{27===e.keyCode&&s()}),!0),n.Re=A(r),j(n.Re,'header'),n.Be=A(r),j(n.Be,'title'),n.Be.id='pm__title',E(n.Be,'role','heading'),E(n.Be,'aria-level','2'),n.Ge=A(i),j(n.Ge,'close-btn'),E(n.Ge,'aria-label',m.closeIconLabel||''),G(n.Ge,f,s),n.Je=A(r),j(n.Je,'body'),n.Le=A(r),j(n.Le,'footer');var D=A(r);V(D,'btns');var k=A(r),N=A(r);j(k,d),j(N,d),I(n.Le,k),I(n.Le,N),I(n.Re,n.Be),I(n.Re,n.Ge),I(n.Se,n.Re),I(n.Se,n.Je),M&&I(n.Se,n.Le),I(n.Fe,n.Se)}let H;b&&(n.Be.innerHTML=b,y&&E(n.Ge,'aria-label',y)),x&&x.forEach((e=>{const t=e.title,a=e.description,s=e.linkedCategory,c=s&&o.G[s],d=e.cookieTable,_=d?.body,u=_?.length>0,p=!!c,g=p&&o.ee[s],b=C(g)&&S(g)||[],y=p&&(!!a||!!u||S(g).length>0);var h=A(r);if(j(h,'section'),y||a){var w=A(r);j(w,'section-desc-wrapper')}let T=b.length;if(y&&T>0){const e=A(r);j(e,'section-services');for(const t of b){const o=g[t]?.label||t,n=A(r),a=A(r),i=A(r),l=A(r);j(n,'service'),j(l,'service-title'),j(a,'service-header'),j(i,'service-icon');const d=_e(o,t,c,!0,s);l.innerHTML=o,I(a,i),I(a,l),I(n,a),I(n,d),I(e,n)}I(w,e)}if(t){var x=A(r),M=A(p?i:r);if(j(x,'section-title-wrapper'),j(M,'section-title'),M.innerHTML=t,I(x,M),p){const e=A('span');j(e,'section-arrow'),I(x,e),h.className+='--toggle';const o=_e(t,s,c);let n=m.serviceCounterLabel;if(T>0&&v(n)){let e=A('span');j(e,'badge'),j(e,'service-counter'),E(e,l,!0),E(e,'data-servicecounter',T),n&&(n=n.split('|'),n=n.length>1&&T>1?n[1]:n[0],E(e,'data-counterlabel',n)),e.innerHTML=T+(n?' '+n:''),I(M,e)}if(y){j(h,'section--expandable');var D=s+'-desc';E(M,'aria-expanded',!1),E(M,'aria-controls',D)}I(x,o)}else E(M,'role','heading'),E(M,'aria-level','3');I(h,x)}if(a){var k=A(r);j(k,'section-desc'),k.innerHTML=a,I(w,k)}if(y&&(E(w,l,'true'),w.id=D,((e,t,o)=>{G(M,f,(()=>{t.classList.contains('is-expanded')?(F(t,'is-expanded'),E(o,'aria-expanded','false'),E(e,l,'true')):(V(t,'is-expanded'),E(o,'aria-expanded','true'),E(e,l,'false'))}))})(w,h,M),u)){const e=A('table'),t=A('thead'),o=A('tbody');j(e,'section-table'),j(t,'table-head'),j(o,'table-body');const a=d.headers,s=S(a),c=n.Ue.createDocumentFragment(),i=A('tr');E(i,'role','row');for(const e of s){const t=a[e],o=A('th');o.id='cc__row-'+t,E(o,'role','columnheader'),E(o,'scope','col'),j(o,'table-th'),o.innerHTML=t,I(c,o)}I(i,c),I(t,i);const l=n.Ue.createDocumentFragment();for(const e of _){const t=A('tr');E(t,'role','row'),j(t,'table-tr');for(const o of s){const n=a[o],s=e[o],c=A('td'),i=A(r);j(c,'table-td'),E(c,'data-column',n),E(c,'headers','cc__row-'+n),i.insertAdjacentHTML('beforeend',s),I(c,i),I(t,c)}I(l,t)}I(o,l),I(e,t),I(e,o),I(w,e)}(y||a)&&I(h,w);const N=n.Oe||n.Je;p?(H||(H=A(r),j(H,'section-toggles')),H.appendChild(h)):H=null,I(N,H||h)})),(h||w)&&(w&&(n.je||(n.je=A(i),j(n.je,'btn'),E(n.je,_,'necessary'),I(k,n.je),G(n.je,f,(()=>u([])))),n.je.innerHTML=w),h&&(n.ze||(n.ze=A(i),j(n.ze,'btn'),E(n.ze,_,'all'),I(k,n.ze),G(n.ze,f,(()=>u('all')))),n.ze.innerHTML=h)),T&&(n.$e||(n.$e=A(i),j(n.$e,'btn'),j(n.$e,'btn--secondary'),E(n.$e,_,'save'),I(N,n.$e),G(n.$e,f,(()=>u()))),n.$e.innerHTML=T),n.Oe&&(n.Se.replaceChild(n.Oe,n.Je),n.Je=n.Oe),le(1),o.A||(o.A=!0,W(g.fe.be,p,n.Se),t(e),setTimeout(Q,10),I(n.qe,n.Fe),setTimeout((()=>V(n.Fe,'cc--anim')),100))};function _e(e,t,o,n,a){const s=g.o,r=g.re,i=A('label'),d=A('input'),_=A('span'),u=A('span'),p=A('span'),m=A('span');if(d.type='checkbox',V(i,'section__toggle-wrapper'),V(d,'section__toggle'),V(p,'toggle__icon-on'),V(m,'toggle__icon-off'),V(_,'toggle__icon'),V(u,'toggle__label'),E(_,l,'true'),n?(V(i,'toggle-service'),E(d,c,a),r.le[a][t]=d):r.ie[t]=d,n?(e=>{G(d,'change',(()=>{const t=r.le[e],o=r.ie[e];s.oe[e]=[];for(let o in t){const n=t[o];n.checked&&s.oe[e].push(n.value)}o.checked=s.oe[e].length>0}))})(a):(e=>{G(d,f,(()=>{const t=r.le[e];s.oe[e]=[];for(let e in t)t[e].checked=d.checked}))})(t),d.value=t,u.textContent=e.replace(/<.*>.*<\/.*>/gm,''),I(_,m),I(_,p),s.T)(o.enabled||o.readOnly)&&(d.checked=!0);else if(n){const e=s.te[a];d.checked=o.readOnly||y(e,t)}else y(s.L,t)&&(d.checked=!0);return o.readOnly&&(d.disabled=!0),I(i,d),I(i,_),I(i,u),i}const ue=(e,t)=>{const o=g.o,n=g.re,{hide:a,showPreferences:s,acceptCategory:c}=e,p=o.u&&o.u.consentModal;if(!p)return;const m=p.acceptAllBtn,b=p.acceptNecessaryBtn,y=p.showPreferencesBtn,h=p.closeIconLabel,v=p.footer,C=p.label,w=p.title,S=e=>{a(),c(e)};if(!n.Ke){n.Ke=A(r),n.we=A(r),n.Qe=A(r),n.We=A(r),n.Xe=A(r),V(n.Ke,'cm-wrapper'),V(n.we,'cm'),P(n.Qe,'body'),P(n.We,'texts'),P(n.Xe,'btns'),E(n.we,'role','dialog'),E(n.we,'aria-modal','true'),E(n.we,l,'false'),E(n.we,'aria-describedby','cm__desc'),C?E(n.we,'aria-label',C):w&&E(n.we,'aria-labelledby','cm__title'),n.we.style.visibility='hidden';const e='box',t=o.i.guiOptions?.consentModal,a=(t?.layout||e).split(' ')[0]===e;w&&h&&a&&(n.Pe||(n.Pe=A(i),P(n.Pe,'btn'),P(n.Pe,'btn--close'),G(n.Pe,f,(()=>{S([])})),I(n.Qe,n.Pe)),E(n.Pe,'aria-label',h)),I(n.Qe,n.We),(m||b||y)&&I(n.Qe,n.Xe),I(n.we,n.Qe),I(n.Ke,n.we)}w&&(n.Ye||(n.Ye=A(r),n.Ye.className=n.Ye.id='cm__title',E(n.Ye,'role','heading'),E(n.Ye,'aria-level','2'),I(n.We,n.Ye)),n.Ye.innerHTML=w);let T=p.description;if(T&&(o.j&&(T=T.replace('{{revisionMessage}}',o.F?'':p.revisionMessage||'')),n.Ze||(n.Ze=A(r),n.Ze.className=n.Ze.id='cm__desc',I(n.We,n.Ze)),n.Ze.innerHTML=T),m&&(n.et||(n.et=A(i),P(n.et,'btn'),E(n.et,_,'all'),G(n.et,f,(()=>{S('all')}))),n.et.innerHTML=m),b&&(n.Ve||(n.Ve=A(i),P(n.Ve,'btn'),E(n.Ve,_,'necessary'),G(n.Ve,f,(()=>{S([])}))),n.Ve.innerHTML=b),y&&(n.tt||(n.tt=A(i),P(n.tt,'btn'),P(n.tt,'btn--secondary'),E(n.tt,_,'show'),G(n.tt,'mouseenter',(()=>{o.A||fe(e,t)})),G(n.tt,f,s)),n.tt.innerHTML=y),n.ot||(n.ot=A(r),P(n.ot,d),b&&I(n.ot,n.Ve),m&&I(n.ot,n.et),(m||b)&&I(n.Qe,n.ot),I(n.Xe,n.ot)),n.tt&&!n.nt&&(n.nt=A(r),n.Ve&&n.et?(P(n.nt,d),I(n.nt,n.tt),I(n.Xe,n.nt)):(I(n.ot,n.tt),P(n.ot,'btn-group--uneven'))),v){if(!n.st){let e=A(r),t=A(r);n.st=A(r),P(e,'footer'),P(t,'links'),P(n.st,'link-group'),I(t,n.st),I(e,t),I(n.we,e)}n.st.innerHTML=v}le(0),o.M||(o.M=!0,W(g.fe.be,u,n.we),t(e),setTimeout(Q,10),I(n.qe,n.Ke),setTimeout((()=>V(n.Ke,'cc--anim')),100)),z(n.Qe,e,fe,t)},pe=e=>v(e)&&e in g.o._,me=()=>g.o.l||g.o.i.language.default,ge=e=>{e&&(g.o.l=e)},be=async e=>{const t=g.o;let o;o=e&&pe(e)?e:me();let n=t._[o];if(!n)return!1;if(v(n)){const e=await(async e=>{try{const t=await fetch(e,{method:'GET'});return!!t.ok&&await t.json()}catch(e){return!1}})(n);if(!e)return!1;n=e}return t.u=n,ge(o),!0},ye=()=>{let e=g.o.i.language.rtl,t=g.re.qe;e&&t&&(h(e)||(e=[e]),y(e,g.o.l)?V(t,'cc--rtl'):F(t,'cc--rtl'))},he=e=>{const t=g.re;if(!t.qe){t.qe=A(r),t.qe.id='cc-main',t.qe.style.position='fixed',t.qe.style.zIndex='2147483647',ye();let o=g.o.i.root;o&&v(o)&&(o=document.querySelector(o)),I(o||t.Ue.body,t.qe),(({hidePreferences:e})=>{const t=g.re;G(t.qe,f,(o=>{const n=g.o;n.V?t.Se.contains(o.target)?n.N=!0:(e(),n.N=!1):n.D&&t.we.contains(o.target)&&(n.N=!0)}))})(e)}},ve=e=>{const{hostname:t,protocol:o}=location,{name:n,path:a,domain:s,sameSite:c}=g.t.cookie,r=encodeURIComponent(JSON.stringify(g.o.p)),i=e?(()=>{const e=g.o.C,t=e?new Date-e:0;return 864e5*J()-t})():864e5*J(),l=new Date;l.setTime(l.getTime()+i);let d=n+'='+r+(0!==i?'; expires='+l.toUTCString():'')+'; Path='+a+'; SameSite='+c;y(t,'.')&&(d+='; Domain='+s),'https:'===o&&(d+='; Secure'),document.cookie=d,g.o.p},Ce=(e,t,o)=>{const n=o||g.t.cookie.domain,a=t||g.t.cookie.path,s='www.'===n.slice(0,4),c=s&&n.substring(4),r=(e,t)=>{document.cookie=e+'=; path='+a+(t?'; domain=.'+t:'')+'; expires=Thu, 01 Jan 1970 00:00:01 GMT;'};for(const t of e)r(t),r(t,n),s&&r(t,c)},we=e=>(e=>{let t;try{t=JSON.parse(decodeURIComponent(e))}catch(e){t={}}return t})(Se(e||g.t.cookie.name,!0)),Se=(e,t)=>{const o=document.cookie.match('(^|;)\\s*'+e+'\\s*=\\s*([^;]+)');return o?t?o.pop():e:''},Te=e=>{const t=document.cookie.split(/;\s*/),o=[];for(const n of t){let t=n.split('=')[0];if(e)try{e.test(t)&&o.push(t)}catch(e){}else o.push(t)}return o},xe=(e,n=[])=>{((e,t)=>{const{J:o,U:n,p:a,A:s}=g.o;let c=[];e?h(e)?c.push(...e):v(e)&&('all'===e?c=o:c.push(e)):c=s?(()=>{const{oe:e}=g.o,t=g.re.ie;if(!t)return[];let o=[];for(let e in t)t[e].checked&&o.push(e);for(let t in e)e[t].length>0&&o.push(t);return o})():a.categories,c=c.filter((e=>!y(o,e)||!y(t,e))),c.push(...n),U(c)})(e,n),(()=>{const e=g.o,{B:t,oe:o,U:n,L:a,te:s,ee:c,J:r}=e;e.ae=O(s);for(const i of r){const r=c[i],l=S(r),d=o[i]?.length>0,f=y(n,i);if(0!==l.length){if(s[i]=[],f)s[i].push(...l);else{if('all'===t)if(d){const e=o[i];s[i].push(...e)}else s[i].push(...l);else if('necessary'===t)s[i]=[];else if(d){const e=o[i];s[i].push(...e)}else y(a,i)&&s[i].push(...l);e.oe={}}s[i]=T(s[i])}}})(),(()=>{const e=g.o;g.t.mode===o&&e.T?e.O=L(e.$,e.L):e.O=L(e.L,e.p.categories);let n=e.O.length>0,a=!1;for(const t of e.J)e.ne[t]=L(e.te[t],e.ae[t]),e.ne[t].length>0&&(a=!0);const s=g.re.ie;for(let t in s)s[t].checked=y(e.L,t);for(const t of e.J){const o=g.re.le[t],n=e.te[t];for(const e in o)o[e].checked=y(n,e)}e.v||(e.v=new Date),e.S||(e.S=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))),e.p={categories:O(e.L),revision:g.t.revision,data:e.h,consentTimestamp:e.v.toISOString(),consentId:e.S,services:O(e.te)};let c=!1;(e.T||n||a)&&(e.T&&(e.T=!1,c=!0),U(e.L),e.C?e.C=new Date:e.C=e.v,e.p.lastConsentTimestamp=e.C.toISOString(),ve(),g.t.autoClearCookies&&(c||!e.T&&n)&&(e=>{const t=g.o,o=Te();t.R=!1;let n=e?t.J:t.O;n=n.filter((e=>{let o=t.G[e];return!!o&&!o.readOnly&&!!o.autoClear}));for(const a of n){const n=t.G[a].autoClear,s=n?.cookies||[],c=y(t.O,a),r=!y(t.L,a),i=c&&r;if(e&&r||!e&&i){!0===n.reloadPage&&i&&(t.R=!0);for(const e of s){let t=[];const n=e.name,a=e.domain,s=e.path;if(n instanceof RegExp)for(let e of o)n.test(e)&&t.push(e);else{let e=b(o,n);e>-1&&t.push(o[e])}t.length>0&&Ce(t,s,a)}}}})(c),X()),c&&(W(g.fe._e),W(g.fe.ue),g.t.mode===t)||((n||a)&&W(g.fe.pe),e.R&&location.reload())})()},Me=(e,t,o)=>{let n=[];const a=e=>{if(v(e)){let t=Se(e);''!==t&&n.push(t)}else n.push(...Te(e))};if(h(e))for(let t of e)a(t);else a(e);Ce(n,t,o)},De=e=>{const{re:t,o:o}=g;e&&!o.M&&ue(Ne,he),o.M&&(o.D=!0,o.g&&K(!0),V(t.Ce,n),E(t.we,l,'false'),setTimeout((()=>{o.K=x(),o.P=o.X}),200),W(g.fe.me,u))},ke=()=>{const{re:e,o:t,fe:o}=g;t.M&&(t.D=!1,t.g&&K(),F(e.Ce,n),E(e.we,l,'true'),setTimeout((()=>{t.K.focus(),t.P=[]}),200),W(o.ge,u))},Ae=()=>{const e=g.o;e.A&&e.k||(e.A||fe(Ne,he),V(g.re.Ce,a),E(g.re.Se,l,'false'),e.k=!0,setTimeout((()=>{e.V=!0}),1),setTimeout((()=>{e.D?e.W=x():e.K=x(),0!==e.Y.length&&(e.Y[0].focus(),e.P=e.Y)}),200),W(g.fe.me,p))},Ee=()=>{const e=g.o;e.k&&(F(g.re.Ce,a),E(g.re.Se,l,'true'),e.k=!1,setTimeout((()=>{e.V=!1}),1),e.D?(e.W&&e.W.focus(),e.P=e.X):(e.K&&e.K.focus(),e.P=[]),e.N=!1,W(g.fe.ge,p))};var Ne={show:De,hide:ke,showPreferences:Ae,hidePreferences:Ee,acceptCategory:xe};const He=(e,t)=>{const o=we(t);return e?o[e]:o},Ie=()=>!g.o.T;e.acceptCategory=xe,e.acceptService=(e,t)=>{const{J:o,ee:n}=g.o;if(!(e&&t&&v(t)&&y(o,t)&&0!==S(n[t]).length))return!1;((e,t)=>{const o=g.o,{ee:n,oe:a}=o,s=g.re.le[t]||{},c=S(n[t]);if(a[t]=[],v(e))if('all'===e)for(let e in s)s[e].checked=!0,k(s[e]);else{for(let t in s)s[t].checked=e===t,k(s[t]);y(c,e)&&a[t].push(e)}else if(h(e))for(let o in s){const n=y(e,o);s[o].checked=n,k(s[o]),n&&a[t].push(o)}})(e,t),xe()},e.acceptedCategory=e=>{let o;return o=g.o.T&&g.t.mode!==t?g.o.$:$().accepted||[],y(o,e)},e.acceptedService=(e,t)=>y(g.o.te[t]||[],e),e.eraseCookies=Me,e.getConfig=e=>{const t=g.t,o=g.o.i;return e?t[e]||o[e]:{...t,...o,cookie:{...t.cookie}}},e.getCookie=He,e.getUserPreferences=()=>{const{B:e,te:t}=g.o,{accepted:o,rejected:n}=$();return O({acceptType:e,acceptedCategories:o,rejectedCategories:n,acceptedServices:t,rejectedServices:R()})},e.hide=ke,e.hidePreferences=Ee,e.loadScript=(e,t)=>{let o=document.querySelector('script[src="'+e+'"]');return new Promise((n=>{if(o)return n(!0);if(o=A('script'),C(t))for(const e in t)E(o,e,t[e]);o.onload=()=>n(!0),o.onerror=()=>{o.remove(),n(!1)},o.src=e,I(document.head,o)}))},e.reset=e=>{const{qe:t,Ce:o}=g.re,{name:c,path:r,domain:i}=g.t.cookie;e&&Me(c,r,i);for(const{ye:e,he:t,ve:o}of g.o.m)e.removeEventListener(t,o);t?.remove(),o?.classList.remove(s,a,n);const l=new m;for(const e in g)g[e]=l[e];window._ccRun=!1},e.run=async e=>{const{o:t,t:n,fe:a}=g,s=window;if(!s._ccRun){if(s._ccRun=!0,(e=>{const{re:t,t:n,o:a}=g,s=n,r=a,{cookie:i}=s,l=g.de,d=e.cookie,f=e.categories,_=S(f)||[],u=navigator,p=document;t.Ue=p,t.Ce=p.documentElement,i.domain=location.hostname,r.i=e,r._=e.language.translations,r.G=f,r.J=_,r.g=!!e.disablePageInteraction,l._e=e.onFirstConsent,l.ue=e.onConsent,l.pe=e.onChange,l.ge=e.onModalHide,l.me=e.onModalShow,l.be=e.onModalReady;const{mode:m,autoShow:b,autoClearCookies:h,revision:v,manageScriptTags:w,hideFromBots:T,lazyHtmlGeneration:x}=e;m===o&&(s.mode=m),'boolean'==typeof b&&(s.autoShow=b),'boolean'==typeof h&&(s.autoClearCookies=h),'boolean'==typeof w&&(s.manageScriptTags=w),'number'==typeof v&&v>=0&&(s.revision=v,r.j=!0),'boolean'==typeof x&&(s.lazyHtmlGeneration=x),!1===T&&(s.hideFromBots=!1),!0===s.hideFromBots&&u&&(r.q=u.userAgent&&/bot|crawl|spider|slurp|teoma/i.test(u.userAgent)||u.webdriver),C(d)&&(s.cookie={...i,...d}),s.autoClearCookies,r.j,s.manageScriptTags,(e=>{const{G:t,ee:o,te:n,U:a}=g.o;for(let s of e){const e=t[s],c=e.services||{},r=C(c)&&S(c)||[];o[s]={},n[s]=[],e.readOnly&&(a.push(s),n[s]=r),g.re.le[s]={};for(let e of r){const t=c[e];t.Te=!1,o[s][e]=t}}})(_),(()=>{if(!g.t.manageScriptTags)return;const e=g.o;e.se=D(g.re.Ue,'script[data-category]'),e.ce=[];for(const t of e.se){let o=H(t,c),n=t.dataset.service||'',a=!1;if(o&&'!'===o.charAt(0)&&(o=o.slice(1),a=!0),'!'===n.charAt(0)&&(n=n.slice(1),a=!0),y(e.J,o)&&(e.ce.push({De:!1,ke:a,xe:o,Me:n}),n)){const t=e.ee[o];t[n]||(t[n]={Te:!1})}}})(),ge((()=>{const e=g.o.i.language.autoDetect;if(e){let t;if('browser'===e?t=navigator.language.slice(0,2).toLowerCase():'document'===e&&(t=document.documentElement.lang),pe(t))return t}return me()})())})(e),t.q)return;(()=>{const e=g.o,t=g.t,n=we(),{categories:a,services:s,consentId:c,consentTimestamp:r,lastConsentTimestamp:i,data:l,revision:d}=n,f=h(a);e.p=n,e.S=c;const _=!!c&&v(c);e.v=r,e.v&&(e.v=new Date(r)),e.C=i,e.C&&(e.C=new Date(i)),e.h=void 0!==l?l:null,e.j&&_&&d!==t.revision&&(e.F=!1),e.T=!(_&&e.F&&e.v&&e.C&&f),e.T,e.T?t.mode===o&&(()=>{const e=g.o;for(const t of e.J)if(e.G[t].enabled){e.$.push(t);const o=e.ee[t]||{};for(let n in o)e.te[t].push(n)}})():(e.te={...e.te,...s},U([...e.U,...a]))})();const r=Ie();if(!await be())return!1;if(await(async e=>{z(null,e,fe,he),g.o.T&&ue(e,he),g.t.lazyHtmlGeneration||fe(e,he),(()=>{const e=g.re,t=g.o;G(e.Ce,'keydown',(e=>{if('Tab'!==e.key)return;const o=t.P;if(o.length>0){const n=x();e.shiftKey?n===o[0]&&(o[1].focus(),M(e)):n===o[1]&&(o[0].focus(),M(e)),t.H||g.o.N||(t.H=!0,!t.I&&M(e),e.shiftKey?o[1].focus():o[0].focus())}!t.H&&(t.I=!0)}),!0)})()})(Ne),n.autoShow&&!r&&De(!0),r)return X(),W(a.ue);n.mode===o&&X(t.$)}},e.setCookieData=e=>{let t,o=e.value,n=e.mode,a=!1;const s=g.o;if('update'===n){s.h=t=He('data');const e=typeof t==typeof o;if(e&&'object'==typeof t){!t&&(t={});for(let e in o)t[e]!==o[e]&&(t[e]=o[e],a=!0)}else!e&&t||t===o||(t=o,a=!0)}else t=o,a=!0;return a&&(s.h=t,s.p.data=t,ve(!0)),a},e.setLanguage=async(e,t)=>{if(!pe(e))return!1;const o=g.o;return!(e===me()&&!0!==t||!await be(e)||(ge(e),o.M&&ue(Ne,he),o.A&&fe(Ne,he),ye(),Q(),0))},e.show=De,e.showPreferences=Ae,e.validConsent=Ie,e.validCookie=e=>''!==Se(e,!0)},'object'==typeof exports&&'undefined'!=typeof module?t(exports):'function'==typeof define&&define.amd?define(['exports'],t):t((e='undefined'!=typeof globalThis?globalThis:e||self).CookieConsent={}); |
{ | ||
"name": "vanilla-cookieconsent", | ||
"version": "3.0.0-rc.10", | ||
"version": "3.0.0-rc.11", | ||
"description": "🍪 Simple cross-browser cookie-consent plugin written in vanilla js.", | ||
@@ -5,0 +5,0 @@ "main": "dist/cookieconsent.umd.js", |
# CookieConsent v3 | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) | ||
[![Latest version](https://img.shields.io/github/v/tag/orestbida/cookieconsent?include_prereleases&label=Release&sort=semver)](https://github.com/orestbida/cookieconsent/releases/v3.0.0-rc.10) | ||
[![Latest version](https://img.shields.io/github/v/tag/orestbida/cookieconsent?include_prereleases&label=Release&sort=semver)](https://github.com/orestbida/cookieconsent/releases/v3.0.0-rc.11) | ||
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/orestbida/cookieconsent/tree/v3%2E0-beta.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/orestbida/cookieconsent/tree/v3%2E0-beta) | ||
@@ -6,0 +6,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123282