(()=>{"use strict";var e,t,s,n,r,i,o,c;!function(e){e.PING="ping",e.GET_TC_DATA="getTCData",e.GET_IN_APP_TC_DATA="getInAppTCData",e.GET_VENDOR_LIST="getVendorList",e.ADD_EVENT_LISTENER="addEventListener",e.REMOVE_EVENT_LISTENER="removeEventListener"}(e||(e={})),function(e){e.STUB="stub",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"}(t||(t={})),function(e){e.VISIBLE="visible",e.HIDDEN="hidden",e.DISABLED="disabled"}(s||(s={})),function(e){e.TC_LOADED="tcloaded",e.CMP_UI_SHOWN="cmpuishown",e.USER_ACTION_COMPLETE="useractioncomplete"}(n||(n={}));class l{listenerId;callback;next;param;success=!0;constructor(e,t,s,n){Object.assign(this,{callback:e,listenerId:s,param:t,next:n});try{this.respond()}catch(e){this.invokeCallback(null)}}invokeCallback(e){const t=null!==e;"function"==typeof this.next?this.callback(this.next,e,t):this.callback(e,t)}}class a extends l{respond(){this.throwIfParamInvalid(),this.invokeCallback(new m(this.param,this.listenerId))}throwIfParamInvalid(){if(!(void 0===this.param||Array.isArray(this.param)&&this.param.every(Number.isInteger)))throw new Error("Invalid Parameter")}}class p{eventQueue=new Map;queueNumber=0;add(e){return this.eventQueue.set(this.queueNumber,e),this.queueNumber++}remove(e){return this.eventQueue.delete(e)}exec(){this.eventQueue.forEach(((e,t)=>{new a(e.callback,e.param,t,e.next)}))}clear(){this.queueNumber=0,this.eventQueue.clear()}get size(){return this.eventQueue.size}}class d{static apiVersion="2";static tcfPolicyVersion;static eventQueue=new p;static cmpStatus=t.LOADING;static disabled=!1;static displayStatus=s.HIDDEN;static cmpId;static cmpVersion;static eventStatus;static gdprApplies;static tcModel;static tcString;static reset(){delete this.cmpId,delete this.cmpVersion,delete this.eventStatus,delete this.gdprApplies,delete this.tcModel,delete this.tcString,delete this.tcfPolicyVersion,this.cmpStatus=t.LOADING,this.disabled=!1,this.displayStatus=s.HIDDEN,this.eventQueue.clear()}}class u{cmpId=d.cmpId;cmpVersion=d.cmpVersion;gdprApplies=d.gdprApplies;tcfPolicyVersion=d.tcfPolicyVersion}class h extends u{cmpStatus=t.ERROR}class m extends u{tcString;listenerId;eventStatus;cmpStatus;isServiceSpecific;useNonStandardStacks;publisherCC;purposeOneTreatment;outOfBand;purpose;vendor;specialFeatureOptins;publisher;constructor(e,t){if(super(),this.eventStatus=d.eventStatus,this.cmpStatus=d.cmpStatus,this.listenerId=t,d.gdprApplies){const t=d.tcModel;this.tcString=d.tcString,this.isServiceSpecific=t.isServiceSpecific,this.useNonStandardStacks=t.useNonStandardStacks,this.purposeOneTreatment=t.purposeOneTreatment,this.publisherCC=t.publisherCountryCode,this.outOfBand={allowedVendors:this.createVectorField(t.vendorsAllowed,e),disclosedVendors:this.createVectorField(t.vendorsDisclosed,e)},this.purpose={consents:this.createVectorField(t.purposeConsents),legitimateInterests:this.createVectorField(t.purposeLegitimateInterests)},this.vendor={consents:this.createVectorField(t.vendorConsents,e),legitimateInterests:this.createVectorField(t.vendorLegitimateInterests,e)},this.specialFeatureOptins=this.createVectorField(t.specialFeatureOptins),this.publisher={consents:this.createVectorField(t.publisherConsents),legitimateInterests:this.createVectorField(t.publisherLegitimateInterests),customPurpose:{consents:this.createVectorField(t.publisherCustomConsents),legitimateInterests:this.createVectorField(t.publisherCustomLegitimateInterests)},restrictions:this.createRestrictions(t.publisherRestrictions)}}}createRestrictions(e){const t={};if(e.numRestrictions>0){const s=e.getMaxVendorId();for(let n=1;n<=s;n++){const s=n.toString();e.getRestrictions(n).forEach((e=>{const n=e.purposeId.toString();t[n]||(t[n]={}),t[n][s]=e.restrictionType}))}}return t}createVectorField(e,t){return t?t.reduce(((t,s)=>(t[String(s)]=e.has(Number(s)),t)),{}):[...e].reduce(((e,t)=>(e[t[0].toString(10)]=t[1],e)),{})}}class g extends m{constructor(e){super(e),delete this.outOfBand}createVectorField(e){return[...e].reduce(((e,t)=>e+(t[1]?"1":"0")),"")}createRestrictions(e){const t={};if(e.numRestrictions>0){const s=e.getMaxVendorId();e.getRestrictions().forEach((e=>{t[e.purposeId.toString()]="_".repeat(s)}));for(let n=0;n{const s=e.restrictionType.toString(),r=e.purposeId.toString(),i=t[r].substr(0,n),o=t[r].substr(n+1);t[r]=i+s+o}))}}return t}}class f extends u{cmpLoaded=!0;cmpStatus=d.cmpStatus;displayStatus=d.displayStatus;apiVersion=String(d.apiVersion);gvlVersion;constructor(){super(),d.tcModel&&d.tcModel.vendorListVersion&&(this.gvlVersion=+d.tcModel.vendorListVersion)}}class v extends l{respond(){this.invokeCallback(new f)}}class _ extends a{respond(){this.throwIfParamInvalid(),this.invokeCallback(new g(this.param))}}class y extends Error{constructor(e){super(e),this.name="EncodingError"}}class I extends Error{constructor(e){super(e),this.name="DecodingError"}}class S{static DICT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";static REVERSE_DICT=new Map([["A",0],["B",1],["C",2],["D",3],["E",4],["F",5],["G",6],["H",7],["I",8],["J",9],["K",10],["L",11],["M",12],["N",13],["O",14],["P",15],["Q",16],["R",17],["S",18],["T",19],["U",20],["V",21],["W",22],["X",23],["Y",24],["Z",25],["a",26],["b",27],["c",28],["d",29],["e",30],["f",31],["g",32],["h",33],["i",34],["j",35],["k",36],["l",37],["m",38],["n",39],["o",40],["p",41],["q",42],["r",43],["s",44],["t",45],["u",46],["v",47],["w",48],["x",49],["y",50],["z",51],["0",52],["1",53],["2",54],["3",55],["4",56],["5",57],["6",58],["7",59],["8",60],["9",61],["-",62],["_",63]]);static BASIS=6;static LCM=24;static encode(e){if(!/^[0-1]+$/.test(e))throw new y("Invalid bitField");const t=e.length%this.LCM;e+=t?"0".repeat(this.LCM-t):"";let s="";for(let t=0;t{const s=this.deepClone(this[t]);void 0!==s&&(e[t]=s)})),e}deepClone(e){const t=typeof e;if("number"===t||"string"===t||"boolean"===t)return e;if(null!==e&&"object"===t){if("function"==typeof e.clone)return e.clone();if(e instanceof Date)return new Date(e.getTime());if(void 0!==e[Symbol.iterator]){const t=[];for(const s of e)t.push(this.deepClone(s));return e instanceof Array?t:new e.constructor(t)}{const t={};for(const s in e)e.hasOwnProperty(s)&&(t[s]=this.deepClone(e[s]));return t}}}}class L extends Error{constructor(e,t,s=""){super(`invalid value ${t} passed for ${e} ${s}`),this.name="TCModelError"}}!function(e){e[e.NOT_ALLOWED=0]="NOT_ALLOWED",e[e.REQUIRE_CONSENT=1]="REQUIRE_CONSENT",e[e.REQUIRE_LI=2]="REQUIRE_LI"}(r||(r={}));class w extends b{static hashSeparator="-";purposeId_;restrictionType;constructor(e,t){super(),void 0!==e&&(this.purposeId=e),void 0!==t&&(this.restrictionType=t)}static unHash(e){const t=e.split(this.hashSeparator),s=new w;if(2!==t.length)throw new L("hash",e);return s.purposeId=parseInt(t[0],10),s.restrictionType=parseInt(t[1],10),s}get hash(){if(!this.isValid())throw new Error("cannot hash invalid PurposeRestriction");return`${this.purposeId}${w.hashSeparator}${this.restrictionType}`}get purposeId(){return this.purposeId_}set purposeId(e){this.purposeId_=e}isValid(){return Number.isInteger(this.purposeId)&&this.purposeId>0&&(this.restrictionType===r.NOT_ALLOWED||this.restrictionType===r.REQUIRE_CONSENT||this.restrictionType===r.REQUIRE_LI)}isSameAs(e){return this.purposeId===e.purposeId&&this.restrictionType===e.restrictionType}}class A extends b{root=null;getRoot(){return this.root}isEmpty(){return!this.root}add(e){const t={value:e,left:null,right:null};let s;if(this.isEmpty())this.root=t;else for(s=this.root;;)if(es.value))break;if(null===s.right){s.right=t;break}s=s.right}}get(){const e=[];let t=this.root;for(;t;)if(t.left){let s=t.left;for(;s.right&&s.right!=t;)s=s.right;s.right==t?(s.right=null,e.push(t.value),t=t.right):(s.right=t,t=t.left)}else e.push(t.value),t=t.right;return e}contains(e){let t=!1,s=this.root;for(;s;){if(s.value===e){t=!0;break}e>s.value?s=s.right:et.value)s=t,t=t.right,n="right";else{if(t.left||t.right)if(t.left)if(t.right){const e=this.min(t.right);this.remove(e,t.right),t.value=e}else s?s[n]=t.left:this.root=t.left;else s?s[n]=t.right:this.root=t.right;else s?s[n]=null:this.root=null;t=null}}static build(e){if(e&&0!==e.length){if(1===e.length){const t=new A;return t.add(e[0]),t}{const t=e.length>>1,s=new A;s.add(e[t]);const n=s.getRoot();if(n){if(t+10){const s=A.build(e.slice(0,t-1));n.left=s?s.getRoot():null}}return s}}return null}}class V extends b{bitLength=0;map=new Map;gvl_;has(e){return this.map.has(e)}isOkToHave(e,t,s){let n=!0;if(this.gvl?.vendors){const i=this.gvl.vendors[s];if(i)if(e===r.NOT_ALLOWED)n=i.legIntPurposes.includes(t)||i.purposes.includes(t);else if(i.flexiblePurposes.length)switch(e){case r.REQUIRE_CONSENT:n=i.flexiblePurposes.includes(t)&&i.legIntPurposes.includes(t);break;case r.REQUIRE_LI:n=i.flexiblePurposes.includes(t)&&i.purposes.includes(t)}else n=!1;else n=!1}return n}add(e,t){if(this.isOkToHave(t.restrictionType,t.purposeId,e)){const s=t.hash;this.has(s)||(this.map.set(s,new A),this.bitLength=0),this.map.get(s).add(e)}}restrictPurposeToLegalBasis(e){const t=this.gvl.vendorIds,s=e.hash,n=function(){let e;for(e of t);return e}(),r=[...Array(n).keys()].map((e=>e+1));for(let e=1;e<=n;e++)this.has(s)||(this.map.set(s,A.build(r)),this.bitLength=0),this.map.get(s).add(e)}getVendors(e){let t=[];if(e){const s=e.hash;this.has(s)&&(t=this.map.get(s).get())}else{const e=new Set;this.map.forEach((t=>{t.get().forEach((t=>{e.add(t)}))})),t=Array.from(e)}return t}getRestrictionType(e,t){let s;return this.getRestrictions(e).forEach((e=>{e.purposeId===t&&(void 0===s||s>e.restrictionType)&&(s=e.restrictionType)})),s}vendorHasRestriction(e,t){let s=!1;const n=this.getRestrictions(e);for(let e=0;e{e=Math.max(t.max(),e)})),e}getRestrictions(e){const t=[];return this.map.forEach(((s,n)=>{e?s.contains(e)&&t.push(w.unHash(n)):t.push(w.unHash(n))})),t}getPurposes(){const e=new Set;return this.map.forEach(((t,s)=>{e.add(w.unHash(s).purposeId)})),Array.from(e)}remove(e,t){const s=t.hash,n=this.map.get(s);n&&(n.remove(e),n.isEmpty()&&(this.map.delete(s),this.bitLength=0))}set gvl(e){this.gvl_||(this.gvl_=e,this.map.forEach(((e,t)=>{const s=w.unHash(t);e.get().forEach((t=>{this.isOkToHave(s.restrictionType,s.purposeId,t)||e.remove(t)}))})))}get gvl(){return this.gvl_}isEmpty(){return 0===this.map.size}get numRestrictions(){return this.map.size}}!function(e){e.COOKIE="cookie",e.WEB="web",e.APP="app"}(i||(i={})),function(e){e.CORE="core",e.VENDORS_DISCLOSED="vendorsDisclosed",e.VENDORS_ALLOWED="vendorsAllowed",e.PUBLISHER_TC="publisherTC"}(o||(o={}));class z{static ID_TO_KEY=[o.CORE,o.VENDORS_DISCLOSED,o.VENDORS_ALLOWED,o.PUBLISHER_TC];static KEY_TO_ID={[o.CORE]:0,[o.VENDORS_DISCLOSED]:1,[o.VENDORS_ALLOWED]:2,[o.PUBLISHER_TC]:3}}class T extends b{bitLength=0;maxId_=0;set_=new Set;*[Symbol.iterator](){for(let e=1;e<=this.maxId;e++)yield[e,this.has(e)]}values(){return this.set_.values()}get maxId(){return this.maxId_}has(e){return this.set_.has(e)}unset(e){Array.isArray(e)?e.forEach((e=>this.unset(e))):"object"==typeof e?this.unset(Object.keys(e).map((e=>Number(e)))):(this.set_.delete(Number(e)),this.bitLength=0,e===this.maxId&&(this.maxId_=0,this.set_.forEach((e=>{this.maxId_=Math.max(this.maxId,e)}))))}isIntMap(e){let t="object"==typeof e;return t=t&&Object.keys(e).every((t=>{let s=Number.isInteger(parseInt(t,10));return s=s&&this.isValidNumber(e[t].id),s=s&&void 0!==e[t].name,s})),t}isValidNumber(e){return parseInt(e,10)>0}isSet(e){let t=!1;return e instanceof Set&&(t=Array.from(e).every(this.isValidNumber)),t}set(e){if(Array.isArray(e))e.forEach((e=>this.set(e)));else if(this.isSet(e))this.set(Array.from(e));else if(this.isIntMap(e))this.set(Object.keys(e).map((e=>Number(e))));else{if(!this.isValidNumber(e))throw new L("set()",e,"must be positive integer array, positive integer, Set, or IntMap");this.set_.add(e),this.maxId_=Math.max(this.maxId,e),this.bitLength=0}}empty(){this.set_=new Set}forEach(e){for(let t=1;t<=this.maxId;t++)e(this.has(t),t)}get size(){return this.set_.size}setAll(e){this.set(e)}}class O{static[C.cmpId]=12;static[C.cmpVersion]=12;static[C.consentLanguage]=12;static[C.consentScreen]=6;static[C.created]=36;static[C.isServiceSpecific]=1;static[C.lastUpdated]=36;static[C.policyVersion]=6;static[C.publisherCountryCode]=12;static[C.publisherLegitimateInterests]=24;static[C.publisherConsents]=24;static[C.purposeConsents]=24;static[C.purposeLegitimateInterests]=24;static[C.purposeOneTreatment]=1;static[C.specialFeatureOptins]=12;static[C.useNonStandardStacks]=1;static[C.vendorListVersion]=12;static[C.version]=6;static anyBoolean=1;static encodingType=1;static maxId=16;static numCustomPurposes=6;static numEntries=12;static numRestrictions=12;static purposeId=6;static restrictionType=2;static segmentType=3;static singleOrRange=1;static vendorId=16}class P{static encode(e){return String(Number(e))}static decode(e){return"1"===e}}class k{static encode(e,t){let s;if("string"==typeof e&&(e=parseInt(e,10)),s=e.toString(2),s.length>t||e<0)throw new y(`${e} too large to encode into ${t}`);return s.length25||n<0||n>25)throw new y(`invalid language code: ${e}`);if(t%2==1)throw new y(`numBits must be even, ${t} is not valid`);return t/=2,k.encode(s,t)+k.encode(n,t)}static decode(e,t){let s;if(t!==e.length||e.length%2)throw new I("invalid bit length for language");{const t=65,n=e.length/2,r=k.decode(e.slice(0,n),n)+t,i=k.decode(e.slice(n),n)+t;s=String.fromCharCode(r)+String.fromCharCode(i)}return s}}class F{static encode(e){let t=k.encode(e.numRestrictions,O.numRestrictions);return e.isEmpty()||e.getRestrictions().forEach((s=>{t+=k.encode(s.purposeId,O.purposeId),t+=k.encode(s.restrictionType,O.restrictionType);const n=e.getVendors(s),r=n.length;let i=0,o=0,c="";for(let t=0;t{for(;++e<=l&&!a.has(e););return e};if(t===r-1||n[t+1]>p(s)){const e=!(s===o);c+=P.encode(e),c+=k.encode(o,O.vendorId),e&&(c+=k.encode(s,O.vendorId)),o=0}}t+=k.encode(i,O.numEntries),t+=c})),t}static decode(e){let t=0;const s=new V,n=k.decode(e.substr(t,O.numRestrictions),O.numRestrictions);t+=O.numRestrictions;for(let r=0;r{i+=P.encode(r),s=e.maxId>a&&p{const t=1===e.length;s+=P.encode(!t),s+=k.encode(e[0],O.vendorId),t||(s+=k.encode(e[1],O.vendorId))})),s}}function U(){return{[C.version]:k,[C.created]:R,[C.lastUpdated]:R,[C.cmpId]:k,[C.cmpVersion]:k,[C.consentScreen]:k,[C.consentLanguage]:D,[C.vendorListVersion]:k,[C.policyVersion]:k,[C.isServiceSpecific]:P,[C.useNonStandardStacks]:P,[C.specialFeatureOptins]:N,[C.purposeConsents]:N,[C.purposeLegitimateInterests]:N,[C.purposeOneTreatment]:P,[C.publisherCountryCode]:D,[C.vendorConsents]:M,[C.vendorLegitimateInterests]:M,[C.publisherRestrictions]:F,segmentType:k,[C.vendorsDisclosed]:M,[C.vendorsAllowed]:M,[C.publisherConsents]:N,[C.publisherLegitimateInterests]:N,[C.numCustomPurposes]:k,[C.publisherCustomConsents]:N,[C.publisherCustomLegitimateInterests]:N}}class x{1={[o.CORE]:[C.version,C.created,C.lastUpdated,C.cmpId,C.cmpVersion,C.consentScreen,C.consentLanguage,C.vendorListVersion,C.purposeConsents,C.vendorConsents]};2={[o.CORE]:[C.version,C.created,C.lastUpdated,C.cmpId,C.cmpVersion,C.consentScreen,C.consentLanguage,C.vendorListVersion,C.policyVersion,C.isServiceSpecific,C.useNonStandardStacks,C.specialFeatureOptins,C.purposeConsents,C.purposeLegitimateInterests,C.purposeOneTreatment,C.publisherCountryCode,C.vendorConsents,C.vendorLegitimateInterests,C.publisherRestrictions],[o.PUBLISHER_TC]:[C.publisherConsents,C.publisherLegitimateInterests,C.numCustomPurposes,C.publisherCustomConsents,C.publisherCustomLegitimateInterests],[o.VENDORS_ALLOWED]:[C.vendorsAllowed],[o.VENDORS_DISCLOSED]:[C.vendorsDisclosed]}}class H{1=[o.CORE];2=[o.CORE];constructor(e,t){if(2===e.version)if(e.isServiceSpecific)this[2].push(o.PUBLISHER_TC);else{const s=!(!t||!t.isForVendors);s&&!0!==e[C.supportOOB]||this[2].push(o.VENDORS_DISCLOSED),s&&(e[C.supportOOB]&&e[C.vendorsAllowed].size>0&&this[2].push(o.VENDORS_ALLOWED),this[2].push(o.PUBLISHER_TC))}}}class q{static fieldSequence=new x;static encode(e,t){let s;try{s=this.fieldSequence[String(e.version)][t]}catch(s){throw new y(`Unable to encode version: ${e.version}, segment: ${t}`)}let n="";t!==o.CORE&&(n=k.encode(z.KEY_TO_ID[t],O.segmentType));const r=U();return s.forEach((s=>{const i=e[s],o=r[s];let c=O[s];void 0===c&&this.isPublisherCustom(s)&&(c=Number(e[C.numCustomPurposes]));try{n+=o.encode(i,c)}catch(e){throw new y(`Error encoding ${t}->${s}: ${e.message}`)}})),S.encode(n)}static decode(e,t,s){const n=S.decode(e);let r=0;s===o.CORE&&(t.version=k.decode(n.substr(r,O[C.version]),O[C.version])),s!==o.CORE&&(r+=O.segmentType);const i=this.fieldSequence[String(t.version)][s],c=U();return i.forEach((e=>{const s=c[e];let i=O[e];if(void 0===i&&this.isPublisherCustom(e)&&(i=Number(t[C.numCustomPurposes])),0!==i){const o=n.substr(r,i);if(t[e]=s===M?s.decode(o,t.version):s.decode(o,i),Number.isInteger(i))r+=i;else{if(!Number.isInteger(t[e].bitLength))throw new I(e);r+=t[e].bitLength}}})),t}static isPublisherCustom(e){return 0===e.indexOf("publisherCustom")}}class B{static processor=[e=>e,(e,t)=>{e.publisherRestrictions.gvl=t,e.purposeLegitimateInterests.unset(1);const s=new Map;return s.set("legIntPurposes",e.vendorLegitimateInterests),s.set("purposes",e.vendorConsents),s.forEach(((s,n)=>{s.forEach(((i,o)=>{if(i){const i=t.vendors[o];if(!i||i.deletedDate)s.unset(o);else if(0===i[n].length)if("legIntPurposes"===n&&0===i.purposes.length&&0===i.legIntPurposes.length&&i.specialPurposes.length>0);else if(e.isServiceSpecific)if(0===i.flexiblePurposes.length)s.unset(o);else{const t=e.publisherRestrictions.getRestrictions(o);let i=!1;for(let e=0,s=t.length;e0&&t?.version<=this.processor.length?e.version=t.version:e.version=this.processor.length;const n=e.version-1;if(!this.processor[n])throw new y(`Invalid version: ${e.version}`);return this.processor[n](e,s)}}class G extends Error{constructor(e){super(e),this.name="GVLError"}}class j{static absCall(e,t,s,n){return new Promise(((r,i)=>{const o=new XMLHttpRequest;o.withCredentials=s,o.addEventListener("load",(()=>{if(o.readyState==XMLHttpRequest.DONE)if(o.status>=200&&o.status<300){let e=o.response;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}r(e)}else i(new Error(`HTTP Status: ${o.status} response type: ${o.responseType}`))})),o.addEventListener("error",(()=>{i(new Error("error"))})),o.addEventListener("abort",(()=>{i(new Error("aborted"))})),null===t?o.open("GET",e,!0):o.open("POST",e,!0),o.responseType="json",o.timeout=n,o.ontimeout=()=>{i(new Error("Timeout "+n+"ms "+e))},o.send(t)}))}static post(e,t,s=!1,n=0){return this.absCall(e,JSON.stringify(t),s,n)}static fetch(e,t=!1,s=0){return this.absCall(e,null,t,s)}}class Q extends b{static LANGUAGE_CACHE=new Map;static CACHE=new Map;static LATEST_CACHE_KEY=0;static DEFAULT_LANGUAGE="EN";static consentLanguages=new E;static baseUrl_;static set baseUrl(e){if(/^https?:\/\/vendorlist\.consensu\.org\//.test(e))throw new G("Invalid baseUrl! You may not pull directly from vendorlist.consensu.org and must provide your own cache");e.length>0&&"/"!==e[e.length-1]&&(e+="/"),this.baseUrl_=e}static get baseUrl(){return this.baseUrl_}static latestFilename="vendor-list.json";static versionedFilename="archives/vendor-list-v[VERSION].json";static languageFilename="purposes-[LANG].json";readyPromise;gvlSpecificationVersion;vendorListVersion;tcfPolicyVersion;lastUpdated;purposes;specialPurposes;features;specialFeatures;isReady_=!1;vendors_;vendorIds;fullVendorList;byPurposeVendorMap;bySpecialPurposeVendorMap;byFeatureVendorMap;bySpecialFeatureVendorMap;stacks;lang_;isLatest=!1;constructor(e){super();let t=Q.baseUrl;if(this.lang_=Q.DEFAULT_LANGUAGE,this.isVendorList(e))this.populate(e),this.readyPromise=Promise.resolve();else{if(!t)throw new G("must specify GVL.baseUrl before loading GVL json");if(e>0){const s=e;Q.CACHE.has(s)?(this.populate(Q.CACHE.get(s)),this.readyPromise=Promise.resolve()):(t+=Q.versionedFilename.replace("[VERSION]",String(s)),this.readyPromise=this.fetchJson(t))}else Q.CACHE.has(Q.LATEST_CACHE_KEY)?(this.populate(Q.CACHE.get(Q.LATEST_CACHE_KEY)),this.readyPromise=Promise.resolve()):(this.isLatest=!0,this.readyPromise=this.fetchJson(t+Q.latestFilename))}}static emptyLanguageCache(e){let t=!1;return void 0===e&&Q.LANGUAGE_CACHE.size>0?(Q.LANGUAGE_CACHE=new Map,t=!0):"string"==typeof e&&this.consentLanguages.has(e.toUpperCase())&&(Q.LANGUAGE_CACHE.delete(e.toUpperCase()),t=!0),t}static emptyCache(e){let t=!1;return Number.isInteger(e)&&e>=0?(Q.CACHE.delete(e),t=!0):void 0===e&&(Q.CACHE=new Map,t=!0),t}cacheLanguage(){Q.LANGUAGE_CACHE.has(this.lang_)||Q.LANGUAGE_CACHE.set(this.lang_,{purposes:this.purposes,specialPurposes:this.specialPurposes,features:this.features,specialFeatures:this.specialFeatures,stacks:this.stacks})}async fetchJson(e){try{this.populate(await j.fetch(e))}catch(e){throw new G(e.message)}}getJson(){return JSON.parse(JSON.stringify({gvlSpecificationVersion:this.gvlSpecificationVersion,vendorListVersion:this.vendorListVersion,tcfPolicyVersion:this.tcfPolicyVersion,lastUpdated:this.lastUpdated,purposes:this.purposes,specialPurposes:this.specialPurposes,features:this.features,specialFeatures:this.specialFeatures,stacks:this.stacks,vendors:this.fullVendorList}))}async changeLanguage(e){const t=e.toUpperCase();if(!Q.consentLanguages.has(t))throw new G(`unsupported language ${e}`);if(t!==this.lang_)if(this.lang_=t,Q.LANGUAGE_CACHE.has(t)){const e=Q.LANGUAGE_CACHE.get(t);for(const t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}else{const t=Q.baseUrl+Q.languageFilename.replace("[LANG]",e);try{await this.fetchJson(t),this.cacheLanguage()}catch(e){throw new G("unable to load language: "+e.message)}}}get language(){return this.lang_}isVendorList(e){return void 0!==e&&void 0!==e.vendors}populate(e){this.purposes=e.purposes,this.specialPurposes=e.specialPurposes,this.features=e.features,this.specialFeatures=e.specialFeatures,this.stacks=e.stacks,this.isVendorList(e)&&(this.gvlSpecificationVersion=e.gvlSpecificationVersion,this.tcfPolicyVersion=e.tcfPolicyVersion,this.vendorListVersion=e.vendorListVersion,this.lastUpdated=e.lastUpdated,"string"==typeof this.lastUpdated&&(this.lastUpdated=new Date(this.lastUpdated)),this.vendors_=e.vendors,this.fullVendorList=e.vendors,this.mapVendors(),this.isReady_=!0,this.isLatest&&Q.CACHE.set(Q.LATEST_CACHE_KEY,this.getJson()),Q.CACHE.has(this.vendorListVersion)||Q.CACHE.set(this.vendorListVersion,this.getJson())),this.cacheLanguage()}mapVendors(e){this.byPurposeVendorMap={},this.bySpecialPurposeVendorMap={},this.byFeatureVendorMap={},this.bySpecialFeatureVendorMap={},Object.keys(this.purposes).forEach((e=>{this.byPurposeVendorMap[e]={legInt:new Set,consent:new Set,flexible:new Set}})),Object.keys(this.specialPurposes).forEach((e=>{this.bySpecialPurposeVendorMap[e]=new Set})),Object.keys(this.features).forEach((e=>{this.byFeatureVendorMap[e]=new Set})),Object.keys(this.specialFeatures).forEach((e=>{this.bySpecialFeatureVendorMap[e]=new Set})),Array.isArray(e)||(e=Object.keys(this.fullVendorList).map((e=>+e))),this.vendorIds=new Set(e),this.vendors_=e.reduce(((e,t)=>{const s=this.vendors_[String(t)];return s&&void 0===s.deletedDate&&(s.purposes.forEach((e=>{this.byPurposeVendorMap[String(e)].consent.add(t)})),s.specialPurposes.forEach((e=>{this.bySpecialPurposeVendorMap[String(e)].add(t)})),s.legIntPurposes.forEach((e=>{this.byPurposeVendorMap[String(e)].legInt.add(t)})),s.flexiblePurposes&&s.flexiblePurposes.forEach((e=>{this.byPurposeVendorMap[String(e)].flexible.add(t)})),s.features.forEach((e=>{this.byFeatureVendorMap[String(e)].add(t)})),s.specialFeatures.forEach((e=>{this.bySpecialFeatureVendorMap[String(e)].add(t)})),e[t]=s),e}),{})}getFilteredVendors(e,t,s,n){const r=e.charAt(0).toUpperCase()+e.slice(1);let i;const o={};return i="purpose"===e&&s?this["by"+r+"VendorMap"][String(t)][s]:this["by"+(n?"Special":"")+r+"VendorMap"][String(t)],i.forEach((e=>{o[String(e)]=this.vendors[String(e)]})),o}getVendorsWithConsentPurpose(e){return this.getFilteredVendors("purpose",e,"consent")}getVendorsWithLegIntPurpose(e){return this.getFilteredVendors("purpose",e,"legInt")}getVendorsWithFlexiblePurpose(e){return this.getFilteredVendors("purpose",e,"flexible")}getVendorsWithSpecialPurpose(e){return this.getFilteredVendors("purpose",e,void 0,!0)}getVendorsWithFeature(e){return this.getFilteredVendors("feature",e)}getVendorsWithSpecialFeature(e){return this.getFilteredVendors("feature",e,void 0,!0)}get vendors(){return this.vendors_}narrowVendorsTo(e){this.mapVendors(e)}get isReady(){return this.isReady_}clone(){const e=new Q(this.getJson());return this.lang_!==Q.DEFAULT_LANGUAGE&&e.changeLanguage(this.lang_),e}static isInstanceOf(e){return"object"==typeof e&&"function"==typeof e.narrowVendorsTo}}class $ extends b{static consentLanguages=Q.consentLanguages;isServiceSpecific_=!1;supportOOB_=!0;useNonStandardStacks_=!1;purposeOneTreatment_=!1;publisherCountryCode_="AA";version_=2;consentScreen_=0;policyVersion_=2;consentLanguage_="EN";cmpId_=0;cmpVersion_=0;vendorListVersion_=0;numCustomPurposes_=0;gvl_;created;lastUpdated;specialFeatureOptins=new T;purposeConsents=new T;purposeLegitimateInterests=new T;publisherConsents=new T;publisherLegitimateInterests=new T;publisherCustomConsents=new T;publisherCustomLegitimateInterests=new T;customPurposes;vendorConsents=new T;vendorLegitimateInterests=new T;vendorsDisclosed=new T;vendorsAllowed=new T;publisherRestrictions=new V;constructor(e){super(),e&&(this.gvl=e),this.updated()}set gvl(e){Q.isInstanceOf(e)||(e=new Q(e)),this.gvl_=e,this.publisherRestrictions.gvl=e}get gvl(){return this.gvl_}set cmpId(e){if(e=Number(e),!(Number.isInteger(e)&&e>1))throw new L("cmpId",e);this.cmpId_=e}get cmpId(){return this.cmpId_}set cmpVersion(e){if(e=Number(e),!(Number.isInteger(e)&&e>-1))throw new L("cmpVersion",e);this.cmpVersion_=e}get cmpVersion(){return this.cmpVersion_}set consentScreen(e){if(e=Number(e),!(Number.isInteger(e)&&e>-1))throw new L("consentScreen",e);this.consentScreen_=e}get consentScreen(){return this.consentScreen_}set consentLanguage(e){this.consentLanguage_=e}get consentLanguage(){return this.consentLanguage_}set publisherCountryCode(e){if(!/^([A-z]){2}$/.test(e))throw new L("publisherCountryCode",e);this.publisherCountryCode_=e.toUpperCase()}get publisherCountryCode(){return this.publisherCountryCode_}set vendorListVersion(e){if((e=Number(e)>>0)<0)throw new L("vendorListVersion",e);this.vendorListVersion_=e}get vendorListVersion(){return this.gvl?this.gvl.vendorListVersion:this.vendorListVersion_}set policyVersion(e){if(this.policyVersion_=parseInt(e,10),this.policyVersion_<0)throw new L("policyVersion",e)}get policyVersion(){return this.gvl?this.gvl.tcfPolicyVersion:this.policyVersion_}set version(e){this.version_=parseInt(e,10)}get version(){return this.version_}set isServiceSpecific(e){this.isServiceSpecific_=e}get isServiceSpecific(){return this.isServiceSpecific_}set useNonStandardStacks(e){this.useNonStandardStacks_=e}get useNonStandardStacks(){return this.useNonStandardStacks_}set supportOOB(e){this.supportOOB_=e}get supportOOB(){return this.supportOOB_}set purposeOneTreatment(e){this.purposeOneTreatment_=e}get purposeOneTreatment(){return this.purposeOneTreatment_}setAllVendorConsents(){this.vendorConsents.set(this.gvl.vendors)}unsetAllVendorConsents(){this.vendorConsents.empty()}setAllVendorsDisclosed(){this.vendorsDisclosed.set(this.gvl.vendors)}unsetAllVendorsDisclosed(){this.vendorsDisclosed.empty()}setAllVendorsAllowed(){this.vendorsAllowed.set(this.gvl.vendors)}unsetAllVendorsAllowed(){this.vendorsAllowed.empty()}setAllVendorLegitimateInterests(){this.vendorLegitimateInterests.set(this.gvl.vendors)}unsetAllVendorLegitimateInterests(){this.vendorLegitimateInterests.empty()}setAllPurposeConsents(){this.purposeConsents.set(this.gvl.purposes)}unsetAllPurposeConsents(){this.purposeConsents.empty()}setAllPurposeLegitimateInterests(){this.purposeLegitimateInterests.set(this.gvl.purposes)}unsetAllPurposeLegitimateInterests(){this.purposeLegitimateInterests.empty()}setAllSpecialFeatureOptins(){this.specialFeatureOptins.set(this.gvl.specialFeatures)}unsetAllSpecialFeatureOptins(){this.specialFeatureOptins.empty()}setAll(){this.setAllVendorConsents(),this.setAllPurposeLegitimateInterests(),this.setAllSpecialFeatureOptins(),this.setAllPurposeConsents(),this.setAllVendorLegitimateInterests()}unsetAll(){this.unsetAllVendorConsents(),this.unsetAllPurposeLegitimateInterests(),this.unsetAllSpecialFeatureOptins(),this.unsetAllPurposeConsents(),this.unsetAllVendorLegitimateInterests()}get numCustomPurposes(){let e=this.numCustomPurposes_;if("object"==typeof this.customPurposes){const t=Object.keys(this.customPurposes).sort(((e,t)=>Number(e)-Number(t)));e=parseInt(t.pop(),10)}return e}set numCustomPurposes(e){if(this.numCustomPurposes_=parseInt(e,10),this.numCustomPurposes_<0)throw new L("numCustomPurposes",e)}updated(){const e=new Date,t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));this.created=t,this.lastUpdated=t}}class W{static encode(e,t){let s,n="";return e=B.process(e,t),s=Array.isArray(t?.segments)?t.segments:new H(e,t)[""+e.version],s.forEach(((t,r)=>{let i="";r{this.invokeCallback(s.getJson())}))}}class Y extends a{respond(){this.listenerId=d.eventQueue.add({callback:this.callback,param:this.param,next:this.next}),super.respond()}}class K extends l{respond(){this.invokeCallback(d.eventQueue.remove(this.param))}}class X{static[e.PING]=v;static[e.GET_TC_DATA]=a;static[e.GET_IN_APP_TC_DATA]=_;static[e.GET_VENDOR_LIST]=J;static[e.ADD_EVENT_LISTENER]=Y;static[e.REMOVE_EVENT_LISTENER]=K}class Z{static set_=new Set([0,2,void 0,null]);static has(e){return"string"==typeof e&&(e=Number(e)),this.set_.has(e)}}const ee="__tcfapi";class te{callQueue;customCommands;constructor(t){if(t){let s=e.ADD_EVENT_LISTENER;if(t?.[s])throw new Error(`Built-In Custom Commmand for ${s} not allowed: Use ${e.GET_TC_DATA} instead`);if(s=e.REMOVE_EVENT_LISTENER,t?.[s])throw new Error(`Built-In Custom Commmand for ${s} not allowed`);t?.[e.GET_TC_DATA]&&(t[e.ADD_EVENT_LISTENER]=t[e.GET_TC_DATA],t[e.REMOVE_EVENT_LISTENER]=t[e.GET_TC_DATA]),this.customCommands=t}try{this.callQueue=window[ee]()||[]}catch(e){this.callQueue=[]}finally{window[ee]=this.apiCall.bind(this),this.purgeQueuedCalls()}}apiCall(t,s,n,...r){if("string"!=typeof t)n(null,!1);else if(Z.has(s)){if("function"!=typeof n)throw new Error("invalid callback function");d.disabled?n(new h,!1):this.isCustomCommand(t)||this.isBuiltInCommand(t)?this.isCustomCommand(t)&&!this.isBuiltInCommand(t)?this.customCommands[t](n,...r):t===e.PING?this.isCustomCommand(t)?new X[t](this.customCommands[t],r[0],null,n):new X[t](n,r[0]):void 0===d.tcModel?this.callQueue.push([t,s,n,...r]):this.isCustomCommand(t)&&this.isBuiltInCommand(t)?new X[t](this.customCommands[t],r[0],null,n):new X[t](n,r[0]):n(null,!1)}else n(null,!1)}purgeQueuedCalls(){const e=this.callQueue;this.callQueue=[],e.forEach((e=>{window[ee](...e)}))}isCustomCommand(e){return this.customCommands&&"function"==typeof this.customCommands[e]}isBuiltInCommand(e){return void 0!==X[e]}}class se{callResponder;isServiceSpecific;numUpdates=0;constructor(e,t,s=!1,n){this.throwIfInvalidInt(e,"cmpId",2),this.throwIfInvalidInt(t,"cmpVersion",0),d.cmpId=e,d.cmpVersion=t,d.tcfPolicyVersion=2,this.isServiceSpecific=!!s,this.callResponder=new te(n)}throwIfInvalidInt(e,t,s){if(!("number"==typeof e&&Number.isInteger(e)&&e>=s))throw new Error(`Invalid ${t}: ${e}`)}update(e,r=!1){if(d.disabled)throw new Error("CmpApi Disabled");d.cmpStatus=t.LOADED,r?(d.displayStatus=s.VISIBLE,d.eventStatus=n.CMP_UI_SHOWN):void 0===d.tcModel?(d.displayStatus=s.DISABLED,d.eventStatus=n.TC_LOADED):(d.displayStatus=s.HIDDEN,d.eventStatus=n.USER_ACTION_COMPLETE),d.gdprApplies=null!==e,d.gdprApplies?(""===e?(d.tcModel=new $,d.tcModel.cmpId=d.cmpId,d.tcModel.cmpVersion=d.cmpVersion):d.tcModel=W.decode(e),d.tcModel.isServiceSpecific=this.isServiceSpecific,d.tcfPolicyVersion=Number(d.tcModel.policyVersion),d.tcString=e):d.tcModel=null,0===this.numUpdates?this.callResponder.purgeQueuedCalls():d.eventQueue.exec(),this.numUpdates++}disable(){d.disabled=!0,d.cmpStatus=t.ERROR}}const ne=1==cmplz_tcf.isServiceSpecific,re=["gl","eu","bg","ca","cs","da","de","el","es","et","fi","fr","hr","hu","it","ja","lt","lv","mt","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","tr","zh"];let ie,oe=re.length,ce=document.documentElement.lang.length?document.documentElement.lang.toLowerCase():"en",le="en";for(let e=0;e{e.target.closest(t)&&s(e)}))}function Ee(e){return null===e.offsetParent}re.includes(le)||(le="en",ye=cmplz_tcf.cmp_url+"cmp/vendorlist/vendor-list.json");let Ce=new Promise((function(e,t){ae=e})),be=new Promise((function(e,t){pe=e})),Le=new Promise((function(e,t){de=e})),we=new Promise((function(e,t){ue=e})),Ae=new Promise((function(e,t){he=e}));const Ve=fe?fetch(_e).then((e=>e.text())).then((e=>{const t=e.split("\n");t.shift(),ge=t.map((e=>{if(0===e.length)return null;const[t,s,n,r]=function(e){const t=/"(.*?)"|([^,]+)/g,s=[];let n;for(;null!==(n=t.exec(e));)s.push(n[1]||n[2]);return s}(e);return{id:parseInt(t),name:s,policyUrl:n,domains:r,consent:0}})),ge=ge.filter((e=>null!=e))})).catch((e=>{console.log("Error:",e)})):Promise.resolve(),ze=fetch(ye,{method:"GET"}).then((e=>e.json())).then((e=>{ie=e})).catch((e=>{console.log("Error:",e)}));Promise.all([Ve,ze]).then((()=>{de()})),document.addEventListener("wp_consent_type_defined",(function(e){ae()})),document.addEventListener("cmplz_cookie_warning_loaded",(function(e){complianz.disable_cookiebanner||ue()})),document.addEventListener("cmplz_revoke",(function(e){const t=e.detail;he(t)})),Ce.then((()=>{})),Le.then((()=>{const e=I(),t=window.localStorage.getItem("cmplz_ac_string");Q.baseUrl=cmplz_tcf.cmp_url+"cmp/vendorlist",me=ie.dataCategories;let s=new Q(ie),n=s.clone(),r=new $(s);r.publisherCountryCode=cmplz_tcf.publisherCountryCode,r.version=2,r.cmpId=332,r.cmpVersion=1,r.isServiceSpecific=ne,r.UseNonStandardStacks=0;const i=new se(332,1,ne,{getTCData:(e,s,n)=>{s&&t&&"object"==typeof s&&(s.addtlConsent=t,s.enableAdvertiserConsentMode=!(0===ge.length||void 0===ge[0].consent)),e(s,n)}});function o(){d(),function(){r.setAllVendorLegitimateInterests();for(let e in r.gvl.vendors){let t=r.gvl.vendors[e];0===t.legIntPurposes.length&&0===t.specialPurposes.length&&r.vendorLegitimateInterests.unset(t.id)}}(),r.setAllPurposeLegitimateInterests();for(let e in cmplz_tcf.purposes)r.purposeConsents.set(cmplz_tcf.purposes[e]),m("purpose_legitimate_interest",cmplz_tcf.purposes[e]);r.setAllSpecialFeatureOptins();for(let e in cmplz_tcf.specialFeatures)r.specialFeatureOptins.set(cmplz_tcf.specialFeatures[e]),m("specialfeature",cmplz_tcf.specialFeatures[e]);r.setAllPurposeConsents();for(let e in cmplz_tcf.purposes)r.purposeConsents.set(cmplz_tcf.purposes[e]),m("purpose_consent",cmplz_tcf.purposes[e]);r.setAllVendorConsents(),document.querySelectorAll(".cmplz-tcf-input").forEach((e=>{e.checked=!0})),S(r,_()),cmplz_set_cookie("banner-status","dismissed")}function c(e){p(),r.unsetAllPurposeLegitimateInterests(),function(){r.unsetAllVendorLegitimateInterests();for(let e in r.gvl.vendors){let t=r.gvl.vendors[e];0===t.legIntPurposes.length&&0===t.purposes.length&&0===t.flexiblePurposes.length&&0===t.specialFeatures.length&&0!==t.specialPurposes.length&&r.vendorLegitimateInterests.set(t.id)}}();for(let e in cmplz_tcf.specialFeatures)r.specialFeatureOptins.set(cmplz_tcf.specialFeatures[e]),g("specialfeature",cmplz_tcf.specialFeatures[e]);for(let e in cmplz_tcf.purposes)r.purposeConsents.set(cmplz_tcf.purposes[e]),g("purpose_consent",cmplz_tcf.purposes[e]);r.unsetAllVendorConsents(),document.querySelectorAll(".cmplz-tcf-input").forEach((e=>{e.disabled||(e.checked=!1)})),S(r,_()),e&&location.reload()}r.gvl.readyPromise.then((()=>{let s=function(e){let t=Object.values(e).map((e=>e.id)),s=y("purposes",e,cmplz_tcf.purposes);t=t.filter((e=>s.includes(e))),s=y("specialPurposes",e,cmplz_tcf.specialPurposes),t=t.filter((e=>s.includes(e))),s=y("features",e,cmplz_tcf.features),t=t.filter((e=>s.includes(e))),s=y("specialFeatures",e,cmplz_tcf.specialFeatures),t=t.filter((e=>s.includes(e)));let n=Object.keys(cmplz_tcf.excludedVendors).map((function(e){return cmplz_tcf.excludedVendors[e]}));return t=t.filter((e=>!n.includes(e))),t}(r.gvl.getJson().vendors);r.gvl.narrowVendorsTo(s);try{r=W.decode(e,r),S(r,_()),ge=l(t,ge)}catch(e){}pe()})),Promise.all([Ce,be]).then((()=>{if(function(e){const t=document.getElementById("cmplz-tcf-vendor-container");if(null===t)return;t.innerHTML="";const s=document.getElementById("cmplz-tcf-vendor-template").innerHTML,n=L(ie.purposes,cmplz_tcf.purposes),i=L(ie.specialPurposes,cmplz_tcf.specialPurposes),l=L(ie.features,cmplz_tcf.features),p=L(ie.specialFeatures,cmplz_tcf.specialFeatures);v("purpose_consent",n,"statistics"),v("purpose_consent",n,"marketing"),v("purpose_legitimate_interest",n,"statistics"),v("purpose_legitimate_interest",n,"marketing"),v("feature",l,!1),v("specialpurpose",i,!1),v("specialfeature",p,!1),0===p.length&&(document.getElementById("cmplz-tcf-specialfeatures-wrapper").style.display="none");for(let i in e)if(e.hasOwnProperty(i)){let o=s;const c=e[i],l=c.purposes.concat(c.legIntPurposes);let a="";for(const e in l)if(l.hasOwnProperty(e)){let t=l[e],s=!1;for(const e in n)if(n.hasOwnProperty(e)&&n[e].id===t){s=n[e].name;let r=c.dataRetention&&c.dataRetention.hasOwnProperty("stdRetention")?c.dataRetention.stdRetention:null,i=c.dataRetention&&c.dataRetention.hasOwnProperty(t)?c.dataRetention[t]:r;void 0===i&&(i=cmplz_tcf.undeclared_string),a+='
'+s+"| "+cmplz_tcf.retention_string+": "+i+"
"}}let p=[];for(const e in c.dataDeclaration)if(c.dataDeclaration.hasOwnProperty(e)){let t=c.dataDeclaration[e],s="";for(const e in me)me.hasOwnProperty(e)&&me[e].id===t&&(s=me[e].name);p.push(s)}p=p.join(", ");let d=Math.round(c.cookieMaxAgeSeconds/86400);if(cmplz_tcf.debug&&console.log(c),o=o.replace(/{cookie_retention_seconds}/g,c.cookieMaxAgeSeconds),o=o.replace(/{cookie_retention_days}/g,d),o=o.replace(/{vendor_name}/g,c.name),o=o.replace(/{vendor_categories}/g,p),o=o.replace(/{vendor_id}/g,c.id),o=o.replace(/{purposes}/g,a),c.urls.hasOwnProperty(0)){const e=c.urls[0].privacy;o=o.replace(/{privacy_policy}/g,e)}const u=document.createElement("div");u.innerHTML=o;const h=u.firstChild;h.querySelector(".cmplz-tcf-vendor-input").checked=r.vendorConsents.has(c.id)||r.vendorLegitimateInterests.has(c.id),h.querySelector(".cmplz-tcf-vendor-input").setAttribute("data-vendor_id",c.id),h.querySelector(".cmplz-tcf-consent-input").checked=r.vendorConsents.has(c.id),h.querySelector(".cmplz-tcf-consent-input").setAttribute("data-vendor_id",c.id),0!==c.legIntPurposes.length&&(h.querySelector(".cmplz_tcf_legitimate_interest_checkbox").style.display="block",h.querySelector(".cmplz-tcf-legitimate-interest-input").setAttribute("data-vendor_id",c.id),h.querySelector(".cmplz-tcf-legitimate-interest-input").checked=r.vendorLegitimateInterests.has(c.id)),c.usesNonCookieAccess?u.querySelector(".non-cookie-storage-active").style.display="block":u.querySelector(".non-cookie-storage-inactive").style.display="block",c.cookieRefresh?u.querySelector(".non-cookie-refresh-active").style.display="block":u.querySelector(".non-cookie-refresh-inactive").style.display="block",c.cookieMaxAgeSeconds<=0?u.querySelector(".session-storage").style.display="block":c.cookieMaxAgeSeconds<=86400?u.querySelector(".retention_seconds").style.display="block":u.querySelector(".retention_days").style.display="block";let m=document.createDocumentFragment();h.classList.add("cmplz-vendortype-tcf"),m.appendChild(h),t.appendChild(h)}for(let e in ge)if(ge.hasOwnProperty(e)){let n=s;const r=ge[e];n=n.replace(/{vendor_name}/g,r.name),n=n.replace(/{vendor_id}/g,r.id),n=n.replace(/{privacy_policy}/g,r.policyUrl);const i=document.createElement("div");i.innerHTML=n;const o=i.firstChild;o.querySelector(".cmplz-tcf-vendor-input").checked=1===r.consent,o.querySelector(".cmplz-tcf-vendor-input").setAttribute("data-ac_vendor_id",r.id),o.querySelector(".cmplz-tcf-consent-input").checked=1===r.consent,o.querySelector(".cmplz-tcf-consent-input").setAttribute("data-ac_vendor_id",r.id);let c=document.createDocumentFragment();o.classList.add("cmplz-vendortype-ac"),c.appendChild(o),t.appendChild(o)}Se("click",".cmplz-tcf-legitimate-interest-input",(function(e){let t=e.target;const s=parseInt(t.getAttribute("data-vendor_id"));t.checked?(r.vendorLegitimateInterests.set(s),t.closest(".cmplz-tcf-vendor-container").querySelector(".cmplz-tcf-vendor-input").checked=!0):r.vendorLegitimateInterests.unset(s),S(r,!0),cmplz_set_cookie("banner-status","dismissed")})),Se("click",".cmplz-tcf-consent-input",(function(e){let t=e.target;const s=parseInt(t.getAttribute("data-vendor_id"));let n=t.closest(".cmplz-tcf-vendor-container");s&&(t.checked?(r.vendorConsents.set(s),n.querySelector(".cmplz-tcf-vendor-input").prop("checked",!0)):(r.vendorConsents.unset(s),n.querySelector(".cmplz-tcf-vendor-input").prop("checked",!1)));const i=parseInt(t.getAttribute("data-ac_vendor_id"));i&&(t.checked?(u(i),n.querySelector(".cmplz-tcf-vendor-input").prop("checked",!0)):(a(i),n.querySelector(".cmplz-tcf-vendor-input").prop("checked",!1))),S(r,!0),cmplz_set_cookie("banner-status","dismissed")})),Se("click",".cmplz-tcf-vendor-input",(function(e){let t=e.target;const s=parseInt(t.getAttribute("data-vendor_id")),n=parseInt(t.getAttribute("data-ac_vendor_id"));let i=t.closest(".cmplz-tcf-vendor-container");s?t.checked?(r.vendorConsents.set(s),r.vendorLegitimateInterests.set(s),i.querySelector(".cmplz-tcf-legitimate-interest-input").checked=!0,i.querySelector(".cmplz-tcf-consent-input").checked=!0):(r.vendorConsents.unset(s),r.vendorLegitimateInterests.unset(s),i.querySelector(".cmplz-tcf-legitimate-interest-input").checked=!1,i.querySelector(".cmplz-tcf-consent-input").checked=!1):n&&(t.checked?(u(n),i.querySelector(".cmplz-tcf-consent-input").checked=!0):(a(n),i.querySelector(".cmplz-tcf-consent-input").checked=!1)),S(r,!0),cmplz_set_cookie("banner-status","dismissed")})),Se("click",".cmplz-tcf-toggle-info",(function(e){let t=e.target;e.preventDefault(),Ee()?t.style.display="block":t.style.display="none"})),Se("click",".cmplz-tcf-toggle-vendor",(function(e){let t=e.target;e.preventDefault();const s=t.closest(".cmplz-tcf-vendor-container").querySelector(".cmplz-tcf-info");Ee(s)?(t.classList.add("cmplz-tcf-rl"),t.classList.remove("cmplz-tcf-rm"),s.style.display="block"):(t.classList.add("cmplz-tcf-rm"),t.classList.remove("cmplz-tcf-rl"),s.style.display="none")})),Se("click","#cmplz-tcf-selectall",(function(){for(let t in e)if(e.hasOwnProperty(t)){const s=e[t];r.vendorConsents.set(s.id),document.querySelector("#cmplz-tcf-"+s.id).checked=!0}document.querySelectorAll("[data-vendor_id]").forEach((e=>{e.checked=!0})),o()})),Se("click","#cmplz-tcf-deselectall",(function(){for(let t in e)if(e.hasOwnProperty(t)){const s=e[t];r.vendorConsents.unset(s.id),document.querySelector("#cmplz-tcf-"+s.id).checked=!1}c(!0)}));let d=new CustomEvent("cmplz_vendor_container_loaded",{detail:complianz.region});document.dispatchEvent(d)}(r.gvl.vendors),"optin"===complianz.consenttype){cmplz_tcf.debug&&console.log(r);let e=new Date;Date.parse(r.created){!function(){if(!b(complianz.region))return;if("optin"===complianz.consenttype){const e=C("marketing",!1),t=C("statistics",!1),s=L(L(ie.purposes,cmplz_tcf.purposes),e),n=L(L(ie.purposes,cmplz_tcf.purposes),t),r=L(ie.features,cmplz_tcf.features),i=L(ie.specialPurposes,cmplz_tcf.specialPurposes),o=L(ie.specialFeatures,cmplz_tcf.specialFeatures);0===r.length&&(document.querySelector(".cmplz-tcf .cmplz-features").style.display="none"),0===i.length&&(document.querySelector(".cmplz-tcf .cmplz-specialpurposes").style.display="none"),0===o.length&&(document.querySelector(".cmplz-tcf .cmplz-specialfeatures").style.display="none"),0===n.length&&(document.querySelector(".cmplz-tcf .cmplz-statistics").style.display="none"),document.querySelector(".cmplz-tcf .cmplz-statistics .cmplz-description").innerHTML=w(n),document.querySelector(".cmplz-tcf .cmplz-marketing .cmplz-description").innerHTML=w(s),document.querySelector(".cmplz-tcf .cmplz-features .cmplz-description").innerHTML=w(r),document.querySelector(".cmplz-tcf .cmplz-specialfeatures .cmplz-title").innerHTML=w(o),document.querySelector(".cmplz-tcf .cmplz-specialpurposes .cmplz-title").innerHTML=w(i)}let e=document.querySelectorAll(".cmplz-manage-vendors.tcf");if(e){let t="optin"===complianz.consenttype?r.gvl.vendorIds.size:"";fe&&"optin"===complianz.consenttype&&(t+=ge.length),e.forEach((e=>{e.innerHTML=e.innerHTML.replace("{vendor_count}",t)}))}let t=document.getElementById("cmplz-tcf-wrapper"),s=document.getElementById("cmplz-tcf-wrapper-nojavascript");t&&(t.style.display="block",s.style.display="none")}()})),Ae.then((e=>{b(complianz.region)&&c(e)})),document.addEventListener("cmplz_fire_categories",(function(e){"optin"===complianz.consenttype&&cmplz_in_array("marketing",e.detail.categories)&&o()}));const l=(e,t)=>{let s=h(e);t.forEach((e=>{s.includes(e.id)&&(e.consent=1)}));const n=new Set(Object.values(r.gvl.vendors).map((e=>e.name)));return t.filter((e=>!n.has(e.name)))},a=e=>{ge.forEach((t=>{parseInt(t.id)===e&&(t.consent=0)}))},p=()=>{ge.forEach((e=>{e.consent=0}))},d=()=>{ge.forEach((e=>{e.consent=1}))},u=e=>{ge.forEach((t=>{parseInt(t.id)===e&&(t.consent=1)}))},h=e=>{if(!e||0===e.length)return[];let t=e.split("~");return t[0],t[1].split(".").map((e=>parseInt(e)))};function m(e,t){if("purpose_consent"===e){r.purposeConsents.set(t);for(let e in r.gvl.vendors){let s=r.gvl.vendors[e];n.vendors[s.id].purposes.includes(t)&&!s.purposes.includes(t)&&r.gvl.vendors[s.id].purposes.push(t)}}if("purpose_legitimate_interest"===e){r.purposeLegitimateInterests.set(t);for(let e in r.gvl.vendors){let s=r.gvl.vendors[e];n.vendors[s.id].purposes.includes(t)&&!s.purposes.includes(t)&&r.gvl.vendors[s.id].purposes.push(t)}}if("specialfeature"===e){r.specialFeatureOptins.set(t);for(let e in r.gvl.vendors){let s=r.gvl.vendors[e];n.vendors[s.id].specialFeatures.includes(t)&&!s.specialFeatures.includes(t)&&r.gvl.vendors[s.id].specialFeatures.push(t)}}if("feature"===e)for(let e in r.gvl.vendors){let s=r.gvl.vendors[e];n.vendors[s.id].features.includes(t)&&!s.features.includes(t)&&r.gvl.vendors[s.id].features.push(t)}}function g(e,t){if("purpose_consent"===e){r.purposeConsents.unset(t);for(let e in r.gvl.vendors){let s=r.gvl.vendors[e],n=s.purposes.indexOf(t);n>-1&&r.gvl.vendors[s.id].purposes.splice(n,1)}}if("purpose_legitimate_interest"===e){r.purposeLegitimateInterests.unset(t);for(let e in r.gvl.vendors){let s=r.gvl.vendors[e],n=s.legIntPurposes.indexOf(t);n>-1&&r.gvl.vendors[s.id].legIntPurposes.splice(n,1)}}if("specialfeature"===e){r.specialFeatureOptins.unset(t);for(let e in r.gvl.vendors){let s=r.gvl.vendors[e];const n=s.specialFeatures.indexOf(t);n>-1&&r.gvl.vendors[s.id].specialFeatures.splice(n,1)}}if("feature"===e)for(let e in r.gvl.vendors){let s=r.gvl.vendors[e];const n=s.features.indexOf(t);n>-1&&r.gvl.vendors[s.id].features.splice(n,1)}}function f(e,t,s,n,i){const{name:o,description:c,id:l,illustrations:a}=t;let p=a&&a.hasOwnProperty(0)?a[0]:"";const d=function(e,t,s){let n=[];for(const e in t)for(const r in s)if(t[e].purposes.includes(s[""+r])){n.push(t[e].id);break}return n}(0,r.gvl.vendors,[l]).length,u=c.split("*").join(", "),h=document.getElementById("cmplz-tcf-type-template").innerHTML.replace(/{type_name}/g,o).replace(/{type_count}/g,d).replace(/{type_description}/g,u).replace(/{type_id}/g,l).replace(/{type_example}/g,p).replace(/{type}/g,e),m=document.createElement("div");m.innerHTML=h;const g=m.firstChild,f=g.querySelector(`.cmplz-tcf-${e}-input`);f.checked=n,f.disabled=i,f.setAttribute(`data-${e}_id`,l),s.appendChild(g)}function v(e,t,s){let n,i=e;!1!==s&&(i=s+"-"+i,n=C(s,!1));const o=document.getElementById("cmplz-tcf-"+i+"s-container");if(null!==o){o.innerHTML="";for(let i in t)if(t.hasOwnProperty(i)){const c=t[i];if(!s||n.includes(c.id)){let t=!1,s=!1;"purpose_consent"===e&&(t=r.purposeConsents.has(c.id)),"purpose_legitimate_interest"===e&&(t=r.purposeLegitimateInterests.has(c.id)),"specialfeature"===e&&(t=r.specialFeatureOptins.has(c.id)),"feature"!==e&&"specialpurpose"!==e||(t=s=!0),f(e,c,o,t,s)}}Se("click",".cmplz-tcf-"+e+"-input",(function(t){const s=t.target,n=parseInt(s.getAttribute("data-"+e+"_id")),i=s.checked;document.querySelectorAll("[data-"+e+'_id="'+n+'"]').forEach((e=>{e.checked=i})),"purpose_consent"===e&&r.purposeConsents[i?"set":"unset"](n),"purpose_legitimate_interest"===e&&r.purposeLegitimateInterests[i?"set":"unset"](n),"specialfeature"===e&&r.specialFeatureOptins[i?"set":"unset"](n),i?m(e,n):g(e,n),function(){for(let e in r.gvl.vendors){let t=r.gvl.vendors[e];0===t.legIntPurposes.length&&0===t.specialPurposes.length&&r.vendorLegitimateInterests.unset(t.id),0===t.legIntPurposes.length&&0===t.purposes.length&&0===t.flexiblePurposes.length&&0===t.specialFeatures.length&&0!==t.specialPurposes.length&&r.vendorLegitimateInterests.set(t.id)}}(),S(r,!0),cmplz_set_cookie("banner-status","dismissed")})),Se("click",".cmplz-tcf-toggle",(function(e){let t=e.target;e.preventDefault();let s=t.closest("label").querySelector(".cmplz-tcf-type-description");Ee(s)?(t.classList.add("cmplz-tcf-rl"),t.classList.remove("cmplz-tcf-rm"),s.style.display="block"):(t.classList.add("cmplz-tcf-rm"),t.classList.remove("cmplz-tcf-rl"),s.style.display="none")}))}}function _(){let e=!0;"dismissed"===Ie("banner-status")&&(e=!1);const t=null!==document.getElementById("cmplz-tcf-vendor-container");return e||t}function y(e,t,s){const n=[];for(const r of Object.values(t)){const t=r[e];Object.values(t).every((e=>s.includes(e)))&&n.push(r.id)}return n}function I(){let e=Ie("policy_id");return(!e||"undefined"!=typeof complianz&&complianz.current_policy_id!==e)&&localStorage.cmplz_tcf_consent&&localStorage.removeItem("cmplz_tcf_consent"),window.localStorage.getItem("cmplz_tcf_consent")}function S(e,t){!function(){if(0===ge.length||void 0===ge[0].consent)return;let e="1~",t=ge.filter((e=>1===e.consent));0!==t.length?(e+=t.map((e=>e.id)).join("."),window.localStorage.setItem("cmplz_ac_string",e)):localStorage.cmplz_ac_string&&localStorage.removeItem("cmplz_ac_string")}();let s=null;e&&(e.created=E(e.lastUpdated),e.lastUpdated=E(e.lastUpdated),s=W.encode(e)),i.update(s,t),window.localStorage.setItem("cmplz_tcf_consent",s)}function E(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function C(e,t){return"functional"===e||"preferences"===e?[]:"marketing"===e?t?[1,2,3,4,5,6,7,8,9,10]:[1,2,3,4,5,6,10]:"statistics"===e?[1,7,8,9]:void 0}function b(e){return!!cmplz_in_array(e,complianz.tcf_regions)}function L(e,t){let s=[];for(let n in e)(t.includes(""+e[n].id)||t.includes(e[n].id))&&s.push(e[n]);return s}function w(e){let t="";const s=e.length-1;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].name,t+=n{"optout"===complianz.consenttype||ve?(fetch(ke,{method:"GET"}).then((e=>e.json())).then((function(e){Oe=e,Te()})),cmplz_tcf.ccpa_applies?(cmplz_set_cookie("usprivacy","1YN"+cmplz_tcf.lspact,!1),document.addEventListener("cmplz_fire_categories",(function(e){let t="1YY"+cmplz_tcf.lspact;cmplz_in_array("marketing",e.detail.categories)&&(t="1YN"+cmplz_tcf.lspact),cmplz_set_cookie("usprivacy",t,!1)}))):cmplz_set_cookie("usprivacy","1---"+cmplz_tcf.lspact,!1),Pe.then((()=>{let e=Oe.signatories;const t=document.getElementById("cmplz-tcf-us-vendor-container");if(null===t)return;t.innerHTML="";const s=document.getElementById("cmplz-tcf-vendor-template").innerHTML;for(let n in e)if(e.hasOwnProperty(n)){let r=s,i=e[n];r=r.replace(/{vendor_name}/g,i.signatoryLegalName);let o=!0;-1===i.optoutUrl.indexOf("http")?(o=!1,r=r.replace(/{optout_string}/g,i.optoutUrl)):r=r.replace(/{optout_url}/g,i.optoutUrl);const c=document.createElement("div");c.innerHTML=r;const l=c.firstChild;o?(l.querySelector(".cmplz-tcf-optout-string").style.display="none",l.querySelector(".cmplz-tcf-optout-url").style.display="block"):(l.querySelector(".cmplz-tcf-optout-string").style.display="block",l.querySelector(".cmplz-tcf-optout-url").style.display="none"),document.createDocumentFragment().appendChild(l),t.appendChild(l)}document.querySelector("#cmplz-tcf-wrapper").style.display="block",document.querySelector("#cmplz-tcf-wrapper-nojavascript").style.display="none"}))):cmplz_tcf.debug&&console.log("not an optout tcf region or page")})),document.addEventListener("cmplz_dnsmpi_submit",(function(e){cmplz_tcf.debug&&console.log("fire data deletion request for TCF"),__uspapi("performDeletion",1)}))})();