(self.webpackChunkvite_template_solid=self.webpackChunkvite_template_solid||[]).push([[121],{1040:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(){for(var e,s,n=[],i=window,r=i;r;){try{if(r.frames.__tcfapiLocator){e=r;break}}catch(e){}if(r===i.top)break;r=r.parent}e||(function e(){var t=i.document,s=!!i.frames.__tcfapiLocator;if(!s)if(t.body){var n=t.createElement("iframe");n.style.cssText="display:none",n.name="__tcfapiLocator",t.body.appendChild(n)}else setTimeout(e,5);return!s}(),i.__tcfapi=function(){for(var e=arguments.length,t=new Array(e),i=0;i3&&2===parseInt(t[1],10)&&"boolean"==typeof t[3]&&(s=t[3],"function"==typeof t[2]&&t[2]("set",!0)):"ping"===t[0]?"function"==typeof t[2]&&t[2]({gdprApplies:s,cmpLoaded:!1,cmpStatus:"stub"}):n.push(t)},i.addEventListener("message",(function(e){var s="string"==typeof e.data,n={};if(s)try{n=JSON.parse(e.data)}catch(e){}else n=e.data;var i="object"===t(n)&&null!==n?n.__tcfapiCall:null;if(i){var r=null==e?void 0:e.source;window.__tcfapi(i.command,i.version,(function(e,t){var n={__tcfapiReturn:{returnValue:e,success:t,callId:i.callId}};r&&r.postMessage&&r.postMessage(s?JSON.stringify(n):n,"*")}),i.parameter),r=null}}),!1))}},5371:(e,t,s)=>{var n;!function(){function i(e,t,s){return e.call.apply(e.bind,arguments)}function r(e,t,s){if(!e)throw Error();if(2=t.f?i():e.fonts.load(function(e){return L(e)+" "+e.f+"00 300px "+b(e.c)}(t.a),t.h).then((function(e){1<=e.length?n():setTimeout(r,25)}),(function(){i()}))}()})),i=null,r=new Promise((function(e,s){i=setTimeout(s,t.f)}));Promise.race([r,n]).then((function(){i&&(clearTimeout(i),i=null),t.g(t.a)}),(function(){t.j(t.a)}))};var x={D:"serif",C:"sans-serif"},F=null;function M(){if(null===F){var e=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);F=!!e&&(536>parseInt(e[1],10)||536===parseInt(e[1],10)&&11>=parseInt(e[2],10))}return F}function k(e,t,s){for(var n in x)if(x.hasOwnProperty(n)&&t===e.f[x[n]]&&s===e.f[x[n]])return!0;return!1}function G(e){var t,s=e.g.a.offsetWidth,n=e.h.a.offsetWidth;(t=s===e.f.serif&&n===e.f["sans-serif"])||(t=M()&&k(e,s,n)),t?a()-e.A>=e.w?M()&&k(e,s,n)&&(null===e.u||e.u.hasOwnProperty(e.a.c))?H(e,e.v):H(e,e.B):function(e){setTimeout(o((function(){G(this)}),e),50)}(e):H(e,e.v)}function H(e,t){setTimeout(o((function(){h(this.g.a),h(this.h.a),h(this.j.a),h(this.m.a),t(this.a)}),e),0)}function B(e,t,s){this.c=e,this.a=t,this.f=0,this.m=this.j=!1,this.s=s}U.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=a(),G(this)};var j=null;function $(e){0==--e.f&&e.j&&(e.m?((e=e.a).g&&p(e.f,[e.a.c("wf","active")],[e.a.c("wf","loading"),e.a.c("wf","inactive")]),T(e,"active")):V(e.a))}function W(e){this.j=e,this.a=new O,this.h=0,this.f=this.g=!0}function Q(e,t,s,n,i){var r=0==--e.h;(e.f||e.g)&&setTimeout((function(){var e=i||null,a=n||{};if(0===s.length&&r)V(t.a);else{t.f+=s.length,r&&(t.j=r);var c,l=[];for(c=0;c{"use strict";s.r(t),s.d(t,{Base64Url:()=>a,BinarySearchTree:()=>l,BitLength:()=>I,BooleanEncoder:()=>S,Cloneable:()=>c,ConsentLanguages:()=>u,DateEncoder:()=>b,DecodingError:()=>n,DeviceDisclosureStorageAccessType:()=>p,EncodingError:()=>i,FieldEncoderMap:()=>V,FieldSequence:()=>T,Fields:()=>d,FixedVectorEncoder:()=>w,GVL:()=>D,GVLError:()=>r,IntEncoder:()=>y,Json:()=>P,LangEncoder:()=>L,PurposeRestriction:()=>m,PurposeRestrictionVector:()=>v,PurposeRestrictionVectorEncoder:()=>_,RestrictionType:()=>h,Segment:()=>g,SegmentEncoder:()=>R,SegmentIDs:()=>E,SegmentSequence:()=>O,SemanticPreEncoder:()=>N,TCModel:()=>U,TCModelError:()=>o,TCString:()=>x,Vector:()=>C,VectorEncodingType:()=>f,VendorVectorEncoder:()=>A});class n extends Error{constructor(e){super(e),this.name="DecodingError"}}class i extends Error{constructor(e){super(e),this.name="EncodingError"}}class r extends Error{constructor(e){super(e),this.name="GVLError"}}class o extends Error{constructor(e,t,s=""){super(`invalid value ${t} passed for ${e} ${s}`),this.name="TCModelError"}}class a{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 i("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 c{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 l;return t.add(e[0]),t}{const t=e.length>>1,s=new l;s.add(e[t]);const n=s.getRoot();if(n){if(t+10){const s=l.build(e.slice(0,t-1));n.left=s?s.getRoot():null}}return s}}return null}}class u{static langSet=new Set(["BG","CA","CS","DA","DE","EL","EN","ES","ET","FI","FR","HR","HU","IT","JA","LT","LV","MT","NL","NO","PL","PT","RO","RU","SK","SL","SV","TR","ZH"]);has(e){return u.langSet.has(e)}forEach(e){u.langSet.forEach(e)}get size(){return u.langSet.size}}class d{static cmpId="cmpId";static cmpVersion="cmpVersion";static consentLanguage="consentLanguage";static consentScreen="consentScreen";static created="created";static supportOOB="supportOOB";static isServiceSpecific="isServiceSpecific";static lastUpdated="lastUpdated";static numCustomPurposes="numCustomPurposes";static policyVersion="policyVersion";static publisherCountryCode="publisherCountryCode";static publisherCustomConsents="publisherCustomConsents";static publisherCustomLegitimateInterests="publisherCustomLegitimateInterests";static publisherLegitimateInterests="publisherLegitimateInterests";static publisherConsents="publisherConsents";static publisherRestrictions="publisherRestrictions";static purposeConsents="purposeConsents";static purposeLegitimateInterests="purposeLegitimateInterests";static purposeOneTreatment="purposeOneTreatment";static specialFeatureOptins="specialFeatureOptins";static useNonStandardStacks="useNonStandardStacks";static vendorConsents="vendorConsents";static vendorLegitimateInterests="vendorLegitimateInterests";static vendorListVersion="vendorListVersion";static vendorsAllowed="vendorsAllowed";static vendorsDisclosed="vendorsDisclosed";static version="version"}var h,p,g,f;!function(e){e[e.NOT_ALLOWED=0]="NOT_ALLOWED",e[e.REQUIRE_CONSENT=1]="REQUIRE_CONSENT",e[e.REQUIRE_LI=2]="REQUIRE_LI"}(h||(h={}));class m extends c{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 m;if(2!==t.length)throw new o("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}${m.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===h.NOT_ALLOWED||this.restrictionType===h.REQUIRE_CONSENT||this.restrictionType===h.REQUIRE_LI)}isSameAs(e){return this.purposeId===e.purposeId&&this.restrictionType===e.restrictionType}}class v extends c{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===h.NOT_ALLOWED)n=i.legIntPurposes.includes(t)||i.purposes.includes(t);else if(i.flexiblePurposes.length)switch(e){case h.REQUIRE_CONSENT:n=i.flexiblePurposes.includes(t)&&i.legIntPurposes.includes(t);break;case h.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 l),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}(),i=[...Array(n).keys()].map((e=>e+1));for(let e=1;e<=n;e++)this.has(s)||(this.map.set(s,l.build(i)),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(m.unHash(n)):t.push(m.unHash(n))})),t}getPurposes(){const e=new Set;return this.map.forEach(((t,s)=>{e.add(m.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=m.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"}(p||(p={})),function(e){e.CORE="core",e.VENDORS_DISCLOSED="vendorsDisclosed",e.VENDORS_ALLOWED="vendorsAllowed",e.PUBLISHER_TC="publisherTC"}(g||(g={}));class E{static ID_TO_KEY=[g.CORE,g.VENDORS_DISCLOSED,g.VENDORS_ALLOWED,g.PUBLISHER_TC];static KEY_TO_ID={[g.CORE]:0,[g.VENDORS_DISCLOSED]:1,[g.VENDORS_ALLOWED]:2,[g.PUBLISHER_TC]:3}}class C extends c{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 o("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 I{static[d.cmpId]=12;static[d.cmpVersion]=12;static[d.consentLanguage]=12;static[d.consentScreen]=6;static[d.created]=36;static[d.isServiceSpecific]=1;static[d.lastUpdated]=36;static[d.policyVersion]=6;static[d.publisherCountryCode]=12;static[d.publisherLegitimateInterests]=24;static[d.publisherConsents]=24;static[d.purposeConsents]=24;static[d.purposeLegitimateInterests]=24;static[d.purposeOneTreatment]=1;static[d.specialFeatureOptins]=12;static[d.useNonStandardStacks]=1;static[d.vendorListVersion]=12;static[d.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 S{static encode(e){return String(Number(e))}static decode(e){return"1"===e}}class y{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 i(`${e} too large to encode into ${t}`);return s.length25||n<0||n>25)throw new i(`invalid language code: ${e}`);if(t%2==1)throw new i(`numBits must be even, ${t} is not valid`);t/=2;return y.encode(s,t)+y.encode(n,t)}static decode(e,t){let s;if(t!==e.length||e.length%2)throw new n("invalid bit length for language");{const t=65,n=e.length/2,i=y.decode(e.slice(0,n),n)+t,r=y.decode(e.slice(n),n)+t;s=String.fromCharCode(i)+String.fromCharCode(r)}return s}}class _{static encode(e){let t=y.encode(e.numRestrictions,I.numRestrictions);return e.isEmpty()||e.getRestrictions().forEach((s=>{t+=y.encode(s.purposeId,I.purposeId),t+=y.encode(s.restrictionType,I.restrictionType);const n=e.getVendors(s),i=n.length;let r=0,o=0,a="";for(let t=0;t{for(;++e<=c&&!l.has(e););return e};if(t===i-1||n[t+1]>u(s)){const e=!(s===o);a+=S.encode(e),a+=y.encode(o,I.vendorId),e&&(a+=y.encode(s,I.vendorId)),o=0}}t+=y.encode(r,I.numEntries),t+=a})),t}static decode(e){let t=0;const s=new v,i=y.decode(e.substr(t,I.numRestrictions),I.numRestrictions);t+=I.numRestrictions;for(let r=0;r{if(r+=S.encode(i),s=e.maxId>c&&l{const t=1===e.length;s+=S.encode(!t),s+=y.encode(e[0],I.vendorId),t||(s+=y.encode(e[1],I.vendorId))})),s}}function V(){return{[d.version]:y,[d.created]:b,[d.lastUpdated]:b,[d.cmpId]:y,[d.cmpVersion]:y,[d.consentScreen]:y,[d.consentLanguage]:L,[d.vendorListVersion]:y,[d.policyVersion]:y,[d.isServiceSpecific]:S,[d.useNonStandardStacks]:S,[d.specialFeatureOptins]:w,[d.purposeConsents]:w,[d.purposeLegitimateInterests]:w,[d.purposeOneTreatment]:S,[d.publisherCountryCode]:L,[d.vendorConsents]:A,[d.vendorLegitimateInterests]:A,[d.publisherRestrictions]:_,segmentType:y,[d.vendorsDisclosed]:A,[d.vendorsAllowed]:A,[d.publisherConsents]:w,[d.publisherLegitimateInterests]:w,[d.numCustomPurposes]:y,[d.publisherCustomConsents]:w,[d.publisherCustomLegitimateInterests]:w}}class T{1={[g.CORE]:[d.version,d.created,d.lastUpdated,d.cmpId,d.cmpVersion,d.consentScreen,d.consentLanguage,d.vendorListVersion,d.purposeConsents,d.vendorConsents]};2={[g.CORE]:[d.version,d.created,d.lastUpdated,d.cmpId,d.cmpVersion,d.consentScreen,d.consentLanguage,d.vendorListVersion,d.policyVersion,d.isServiceSpecific,d.useNonStandardStacks,d.specialFeatureOptins,d.purposeConsents,d.purposeLegitimateInterests,d.purposeOneTreatment,d.publisherCountryCode,d.vendorConsents,d.vendorLegitimateInterests,d.publisherRestrictions],[g.PUBLISHER_TC]:[d.publisherConsents,d.publisherLegitimateInterests,d.numCustomPurposes,d.publisherCustomConsents,d.publisherCustomLegitimateInterests],[g.VENDORS_ALLOWED]:[d.vendorsAllowed],[g.VENDORS_DISCLOSED]:[d.vendorsDisclosed]}}class O{1=[g.CORE];2=[g.CORE];constructor(e,t){if(2===e.version)if(e.isServiceSpecific)this[2].push(g.PUBLISHER_TC);else{const s=!(!t||!t.isForVendors);s&&!0!==e[d.supportOOB]||this[2].push(g.VENDORS_DISCLOSED),s&&(e[d.supportOOB]&&e[d.vendorsAllowed].size>0&&this[2].push(g.VENDORS_ALLOWED),this[2].push(g.PUBLISHER_TC))}}}class R{static fieldSequence=new T;static encode(e,t){let s;try{s=this.fieldSequence[String(e.version)][t]}catch(s){throw new i(`Unable to encode version: ${e.version}, segment: ${t}`)}let n="";t!==g.CORE&&(n=y.encode(E.KEY_TO_ID[t],I.segmentType));const r=V();return s.forEach((s=>{const o=e[s],a=r[s];let c=I[s];void 0===c&&this.isPublisherCustom(s)&&(c=Number(e[d.numCustomPurposes]));try{n+=a.encode(o,c)}catch(e){throw new i(`Error encoding ${t}->${s}: ${e.message}`)}})),a.encode(n)}static decode(e,t,s){const i=a.decode(e);let r=0;s===g.CORE&&(t.version=y.decode(i.substr(r,I[d.version]),I[d.version])),s!==g.CORE&&(r+=I.segmentType);const o=this.fieldSequence[String(t.version)][s],c=V();return o.forEach((e=>{const s=c[e];let o=I[e];if(void 0===o&&this.isPublisherCustom(e)&&(o=Number(t[d.numCustomPurposes])),0!==o){const a=i.substr(r,o);if(t[e]=s===A?s.decode(a,t.version):s.decode(a,o),Number.isInteger(o))r+=o;else{if(!Number.isInteger(t[e].bitLength))throw new n(e);r+=t[e].bitLength}}})),t}static isPublisherCustom(e){return 0===e.indexOf("publisherCustom")}}class N{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,r)=>{if(i){const i=t.vendors[r];if(!i||i.deletedDate)s.unset(r);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(r);else{const t=e.publisherRestrictions.getRestrictions(r);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 i(`Invalid version: ${e.version}`);return this.processor[n](e,s)}}class P{static absCall(e,t,s,n){return new Promise(((i,r)=>{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){}i(e)}else r(new Error(`HTTP Status: ${o.status} response type: ${o.responseType}`))})),o.addEventListener("error",(()=>{r(new Error("error"))})),o.addEventListener("abort",(()=>{r(new Error("aborted"))})),null===t?o.open("GET",e,!0):o.open("POST",e,!0),o.responseType="json",o.timeout=n,o.ontimeout=()=>{r(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 D extends c{static LANGUAGE_CACHE=new Map;static CACHE=new Map;static LATEST_CACHE_KEY=0;static DEFAULT_LANGUAGE="EN";static consentLanguages=new u;static baseUrl_;static set baseUrl(e){if(/^https?:\/\/vendorlist\.consensu\.org\//.test(e))throw new r("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=D.baseUrl;if(this.lang_=D.DEFAULT_LANGUAGE,this.isVendorList(e))this.populate(e),this.readyPromise=Promise.resolve();else{if(!t)throw new r("must specify GVL.baseUrl before loading GVL json");if(e>0){const s=e;D.CACHE.has(s)?(this.populate(D.CACHE.get(s)),this.readyPromise=Promise.resolve()):(t+=D.versionedFilename.replace("[VERSION]",String(s)),this.readyPromise=this.fetchJson(t))}else D.CACHE.has(D.LATEST_CACHE_KEY)?(this.populate(D.CACHE.get(D.LATEST_CACHE_KEY)),this.readyPromise=Promise.resolve()):(this.isLatest=!0,this.readyPromise=this.fetchJson(t+D.latestFilename))}}static emptyLanguageCache(e){let t=!1;return void 0===e&&D.LANGUAGE_CACHE.size>0?(D.LANGUAGE_CACHE=new Map,t=!0):"string"==typeof e&&this.consentLanguages.has(e.toUpperCase())&&(D.LANGUAGE_CACHE.delete(e.toUpperCase()),t=!0),t}static emptyCache(e){let t=!1;return Number.isInteger(e)&&e>=0?(D.CACHE.delete(e),t=!0):void 0===e&&(D.CACHE=new Map,t=!0),t}cacheLanguage(){D.LANGUAGE_CACHE.has(this.lang_)||D.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 P.fetch(e))}catch(e){throw new r(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(!D.consentLanguages.has(t))throw new r(`unsupported language ${e}`);if(t!==this.lang_)if(this.lang_=t,D.LANGUAGE_CACHE.has(t)){const e=D.LANGUAGE_CACHE.get(t);for(const t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}else{const t=D.baseUrl+D.languageFilename.replace("[LANG]",e);try{await this.fetchJson(t),this.cacheLanguage()}catch(e){throw new r("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&&D.CACHE.set(D.LATEST_CACHE_KEY,this.getJson()),D.CACHE.has(this.vendorListVersion)||D.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 i=e.charAt(0).toUpperCase()+e.slice(1);let r;const o={};return r="purpose"===e&&s?this["by"+i+"VendorMap"][String(t)][s]:this["by"+(n?"Special":"")+i+"VendorMap"][String(t)],r.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 D(this.getJson());return this.lang_!==D.DEFAULT_LANGUAGE&&e.changeLanguage(this.lang_),e}static isInstanceOf(e){return"object"==typeof e&&"function"==typeof e.narrowVendorsTo}}class U extends c{static consentLanguages=D.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 C;purposeConsents=new C;purposeLegitimateInterests=new C;publisherConsents=new C;publisherLegitimateInterests=new C;publisherCustomConsents=new C;publisherCustomLegitimateInterests=new C;customPurposes;vendorConsents=new C;vendorLegitimateInterests=new C;vendorsDisclosed=new C;vendorsAllowed=new C;publisherRestrictions=new v;constructor(e){super(),e&&(this.gvl=e),this.updated()}set gvl(e){D.isInstanceOf(e)||(e=new D(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 o("cmpId",e);this.cmpId_=e}get cmpId(){return this.cmpId_}set cmpVersion(e){if(e=Number(e),!(Number.isInteger(e)&&e>-1))throw new o("cmpVersion",e);this.cmpVersion_=e}get cmpVersion(){return this.cmpVersion_}set consentScreen(e){if(e=Number(e),!(Number.isInteger(e)&&e>-1))throw new o("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 o("publisherCountryCode",e);this.publisherCountryCode_=e.toUpperCase()}get publisherCountryCode(){return this.publisherCountryCode_}set vendorListVersion(e){if((e=Number(e)|0)<0)throw new o("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 o("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 o("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 x{static encode(e,t){let s,n="";return e=N.process(e,t),s=Array.isArray(t?.segments)?t.segments:new O(e,t)[""+e.version],s.forEach(((t,i)=>{let r="";i{"use strict";var n,i,r,o,a,c,l,u;s.r(t),s.d(t,{API_KEY:()=>se,CmpApi:()=>ie,CmpApiModel:()=>g,CmpStatus:()=>i,Disabled:()=>m,DisplayStatus:()=>r,EventStatus:()=>o,InAppTCData:()=>E,Ping:()=>C,Response:()=>f,TCData:()=>v,TCFCommand:()=>n}),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"}(n||(n={})),function(e){e.STUB="stub",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"}(i||(i={})),function(e){e.VISIBLE="visible",e.HIDDEN="hidden",e.DISABLED="disabled"}(r||(r={})),function(e){e.TC_LOADED="tcloaded",e.CMP_UI_SHOWN="cmpuishown",e.USER_ACTION_COMPLETE="useractioncomplete"}(o||(o={}));class d{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 h extends d{respond(){this.throwIfParamInvalid(),this.invokeCallback(new v(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 h(e.callback,e.param,t,e.next)}))}clear(){this.queueNumber=0,this.eventQueue.clear()}get size(){return this.eventQueue.size}}class g{static apiVersion="2";static tcfPolicyVersion;static eventQueue=new p;static cmpStatus=i.LOADING;static disabled=!1;static displayStatus=r.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=i.LOADING,this.disabled=!1,this.displayStatus=r.HIDDEN,this.eventQueue.clear()}}class f{cmpId=g.cmpId;cmpVersion=g.cmpVersion;gdprApplies=g.gdprApplies;tcfPolicyVersion=g.tcfPolicyVersion}class m extends f{cmpStatus=i.ERROR}class v extends f{tcString;listenerId;eventStatus;cmpStatus;isServiceSpecific;useNonStandardTexts;publisherCC;purposeOneTreatment;outOfBand;purpose;vendor;specialFeatureOptins;publisher;constructor(e,t){if(super(),this.eventStatus=g.eventStatus,this.cmpStatus=g.cmpStatus,this.listenerId=t,g.gdprApplies){const t=g.tcModel;this.tcString=g.tcString,this.isServiceSpecific=t.isServiceSpecific,this.useNonStandardTexts=t.useNonStandardTexts,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 E extends v{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(),i=e.purposeId.toString(),r=t[i].substr(0,n),o=t[i].substr(n+1);t[i]=r+s+o}))}}return t}}class C extends f{cmpLoaded=!0;cmpStatus=g.cmpStatus;displayStatus=g.displayStatus;apiVersion=String(g.apiVersion);gvlVersion;constructor(){super(),g.tcModel&&g.tcModel.vendorListVersion&&(this.gvlVersion=+g.tcModel.vendorListVersion)}}class I extends d{respond(){this.invokeCallback(new C)}}class S extends h{respond(){this.throwIfParamInvalid(),this.invokeCallback(new E(this.param))}}class y extends Error{constructor(e){super(e),this.name="DecodingError"}}class b extends Error{constructor(e){super(e),this.name="EncodingError"}}class w extends Error{constructor(e){super(e),this.name="GVLError"}}class L extends Error{constructor(e,t,s=""){super(`invalid value ${t} passed for ${e} ${s}`),this.name="TCModelError"}}class _{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 b("Invalid bitField");const t=e.length%this.LCM;e+=t?"0".repeat(this.LCM-t):"";let s="";for(let t=0;t=2&&2==t.length){if(A.langSet.has(e))return e;if(A.langSet.has(t))return t;const s=t+"-"+t;if(A.langSet.has(s))return s;for(const s of A.langSet)if(-1!==s.indexOf(e)||-1!==s.indexOf(t))return s}throw new Error(`unsupported language ${e}`)}forEach(e){A.langSet.forEach(e)}get size(){return A.langSet.size}}class V{static cmpId="cmpId";static cmpVersion="cmpVersion";static consentLanguage="consentLanguage";static consentScreen="consentScreen";static created="created";static supportOOB="supportOOB";static isServiceSpecific="isServiceSpecific";static lastUpdated="lastUpdated";static numCustomPurposes="numCustomPurposes";static policyVersion="policyVersion";static publisherCountryCode="publisherCountryCode";static publisherCustomConsents="publisherCustomConsents";static publisherCustomLegitimateInterests="publisherCustomLegitimateInterests";static publisherLegitimateInterests="publisherLegitimateInterests";static publisherConsents="publisherConsents";static publisherRestrictions="publisherRestrictions";static purposeConsents="purposeConsents";static purposeLegitimateInterests="purposeLegitimateInterests";static purposeOneTreatment="purposeOneTreatment";static specialFeatureOptins="specialFeatureOptins";static useNonStandardTexts="useNonStandardTexts";static vendorConsents="vendorConsents";static vendorLegitimateInterests="vendorLegitimateInterests";static vendorListVersion="vendorListVersion";static vendorsAllowed="vendorsAllowed";static vendorsDisclosed="vendorsDisclosed";static version="version"}class T{clone(){const e=new this.constructor;return Object.keys(this).forEach((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}}}}!function(e){e[e.NOT_ALLOWED=0]="NOT_ALLOWED",e[e.REQUIRE_CONSENT=1]="REQUIRE_CONSENT",e[e.REQUIRE_LI=2]="REQUIRE_LI"}(a||(a={}));class O extends T{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 O;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}${O.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===a.NOT_ALLOWED||this.restrictionType===a.REQUIRE_CONSENT||this.restrictionType===a.REQUIRE_LI)}isSameAs(e){return this.purposeId===e.purposeId&&this.restrictionType===e.restrictionType}}class R extends T{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===a.NOT_ALLOWED)n=i.legIntPurposes.includes(t)||i.purposes.includes(t);else if(i.flexiblePurposes.length)switch(e){case a.REQUIRE_CONSENT:n=i.flexiblePurposes.includes(t)&&i.legIntPurposes.includes(t);break;case a.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 Set),this.bitLength=0),this.map.get(s).add(e)}}restrictPurposeToLegalBasis(e){const t=Array.from(this.gvl.vendorIds),s=e.hash,n=t[t.length-1],i=[...Array(n).keys()].map((e=>e+1));if(this.has(s))for(let e=1;e<=n;e++)this.map.get(s).add(e);else this.map.set(s,new Set(i)),this.bitLength=0}getVendors(e){let t=[];if(e){const s=e.hash;this.has(s)&&(t=Array.from(this.map.get(s)))}else{const e=new Set;this.map.forEach((t=>{t.forEach((t=>{e.add(t)}))})),t=Array.from(e)}return t.sort(((e,t)=>e-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(Array.from(t)[t.size-1],e)})),e}getRestrictions(e){const t=[];return this.map.forEach(((s,n)=>{e?s.has(e)&&t.push(O.unHash(n)):t.push(O.unHash(n))})),t}getPurposes(){const e=new Set;return this.map.forEach(((t,s)=>{e.add(O.unHash(s).purposeId)})),Array.from(e)}remove(e,t){const s=t.hash,n=this.map.get(s);n&&(n.delete(e),0==n.size&&(this.map.delete(s),this.bitLength=0))}set gvl(e){this.gvl_||(this.gvl_=e,this.map.forEach(((e,t)=>{const s=O.unHash(t);Array.from(e).forEach((t=>{this.isOkToHave(s.restrictionType,s.purposeId,t)||e.delete(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"}(c||(c={})),function(e){e.CORE="core",e.VENDORS_DISCLOSED="vendorsDisclosed",e.VENDORS_ALLOWED="vendorsAllowed",e.PUBLISHER_TC="publisherTC"}(l||(l={}));class N{static ID_TO_KEY=[l.CORE,l.VENDORS_DISCLOSED,l.VENDORS_ALLOWED,l.PUBLISHER_TC];static KEY_TO_ID={[l.CORE]:0,[l.VENDORS_DISCLOSED]:1,[l.VENDORS_ALLOWED]:2,[l.PUBLISHER_TC]:3}}class P extends T{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 D{static[V.cmpId]=12;static[V.cmpVersion]=12;static[V.consentLanguage]=12;static[V.consentScreen]=6;static[V.created]=36;static[V.isServiceSpecific]=1;static[V.lastUpdated]=36;static[V.policyVersion]=6;static[V.publisherCountryCode]=12;static[V.publisherLegitimateInterests]=24;static[V.publisherConsents]=24;static[V.purposeConsents]=24;static[V.purposeLegitimateInterests]=24;static[V.purposeOneTreatment]=1;static[V.specialFeatureOptins]=12;static[V.useNonStandardTexts]=1;static[V.vendorListVersion]=12;static[V.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 U{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 b(`${e} too large to encode into ${t}`);return s.length25||n<0||n>25)throw new b(`invalid language code: ${e}`);if(t%2==1)throw new b(`numBits must be even, ${t} is not valid`);t/=2;return U.encode(s,t)+U.encode(n,t)}static decode(e,t){let s;if(t!==e.length||e.length%2)throw new y("invalid bit length for language");{const t=65,n=e.length/2,i=U.decode(e.slice(0,n),n)+t,r=U.decode(e.slice(n),n)+t;s=String.fromCharCode(i)+String.fromCharCode(r)}return s}}class G{static encode(e){let t=U.encode(e.numRestrictions,D.numRestrictions);if(!e.isEmpty()){const s=(t,s)=>{for(let n=t+1;n<=s;n++)if(e.gvl.vendorIds.has(n))return n;return t};e.getRestrictions().forEach((n=>{t+=U.encode(n.purposeId,D.purposeId),t+=U.encode(n.restrictionType,D.restrictionType);const i=e.getVendors(n),r=i.length;let o=0,a=0,c="";for(let e=0;es(t,i[r-1])){const e=!(t===a);c+=F.encode(e),c+=U.encode(a,D.vendorId),e&&(c+=U.encode(t,D.vendorId)),a=0}}t+=U.encode(o,D.numEntries),t+=c}))}return t}static decode(e){let t=0;const s=new R,n=U.decode(e.substr(t,D.numRestrictions),D.numRestrictions);t+=D.numRestrictions;for(let i=0;i{if(r+=F.encode(i),s=e.maxId>c&&l{const t=1===e.length;s+=F.encode(!t),s+=U.encode(e[0],D.vendorId),t||(s+=U.encode(e[1],D.vendorId))})),s}}function B(){return{[V.version]:U,[V.created]:x,[V.lastUpdated]:x,[V.cmpId]:U,[V.cmpVersion]:U,[V.consentScreen]:U,[V.consentLanguage]:k,[V.vendorListVersion]:U,[V.policyVersion]:U,[V.isServiceSpecific]:F,[V.useNonStandardTexts]:F,[V.specialFeatureOptins]:M,[V.purposeConsents]:M,[V.purposeLegitimateInterests]:M,[V.purposeOneTreatment]:F,[V.publisherCountryCode]:k,[V.vendorConsents]:H,[V.vendorLegitimateInterests]:H,[V.publisherRestrictions]:G,segmentType:U,[V.vendorsDisclosed]:H,[V.vendorsAllowed]:H,[V.publisherConsents]:M,[V.publisherLegitimateInterests]:M,[V.numCustomPurposes]:U,[V.publisherCustomConsents]:M,[V.publisherCustomLegitimateInterests]:M}}class j{1={[l.CORE]:[V.version,V.created,V.lastUpdated,V.cmpId,V.cmpVersion,V.consentScreen,V.consentLanguage,V.vendorListVersion,V.purposeConsents,V.vendorConsents]};2={[l.CORE]:[V.version,V.created,V.lastUpdated,V.cmpId,V.cmpVersion,V.consentScreen,V.consentLanguage,V.vendorListVersion,V.policyVersion,V.isServiceSpecific,V.useNonStandardTexts,V.specialFeatureOptins,V.purposeConsents,V.purposeLegitimateInterests,V.purposeOneTreatment,V.publisherCountryCode,V.vendorConsents,V.vendorLegitimateInterests,V.publisherRestrictions],[l.PUBLISHER_TC]:[V.publisherConsents,V.publisherLegitimateInterests,V.numCustomPurposes,V.publisherCustomConsents,V.publisherCustomLegitimateInterests],[l.VENDORS_ALLOWED]:[V.vendorsAllowed],[l.VENDORS_DISCLOSED]:[V.vendorsDisclosed]}}class ${1=[l.CORE];2=[l.CORE];constructor(e,t){if(2===e.version)if(e.isServiceSpecific)this[2].push(l.PUBLISHER_TC);else{const s=!(!t||!t.isForVendors);s&&!0!==e[V.supportOOB]||this[2].push(l.VENDORS_DISCLOSED),s&&(e[V.supportOOB]&&e[V.vendorsAllowed].size>0&&this[2].push(l.VENDORS_ALLOWED),this[2].push(l.PUBLISHER_TC))}}}class W{static fieldSequence=new j;static encode(e,t){let s;try{s=this.fieldSequence[String(e.version)][t]}catch(s){throw new b(`Unable to encode version: ${e.version}, segment: ${t}`)}let n="";t!==l.CORE&&(n=U.encode(N.KEY_TO_ID[t],D.segmentType));const i=B();return s.forEach((s=>{const r=e[s],o=i[s];let a=D[s];void 0===a&&this.isPublisherCustom(s)&&(a=Number(e[V.numCustomPurposes]));try{n+=o.encode(r,a)}catch(e){throw new b(`Error encoding ${t}->${s}: ${e.message}`)}})),_.encode(n)}static decode(e,t,s){const n=_.decode(e);let i=0;s===l.CORE&&(t.version=U.decode(n.substr(i,D[V.version]),D[V.version])),s!==l.CORE&&(i+=D.segmentType);const r=this.fieldSequence[String(t.version)][s],o=B();return r.forEach((e=>{const s=o[e];let r=D[e];if(void 0===r&&this.isPublisherCustom(e)&&(r=Number(t[V.numCustomPurposes])),0!==r){const o=n.substr(i,r);if(t[e]=s===H?s.decode(o,t.version):s.decode(o,r),Number.isInteger(r))i+=r;else{if(!Number.isInteger(t[e].bitLength))throw new y(e);i+=t[e].bitLength}}})),t}static isPublisherCustom(e){return 0===e.indexOf("publisherCustom")}}class Q{static processor=[e=>e,(e,t)=>{e.publisherRestrictions.gvl=t,e.purposeLegitimateInterests.unset([1,3,4,5,6]);const s=new Map;return s.set("legIntPurposes",e.vendorLegitimateInterests),s.set("purposes",e.vendorConsents),s.forEach(((s,n)=>{s.forEach(((i,r)=>{if(i){const i=t.vendors[r];if(!i||i.deletedDate)s.unset(r);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(r);else{const t=e.publisherRestrictions.getRestrictions(r);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 b(`Invalid version: ${e.version}`);return this.processor[n](e,s)}}class J{static absCall(e,t,s,n){return new Promise(((i,r)=>{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){}i(e)}else r(new Error(`HTTP Status: ${o.status} response type: ${o.responseType}`))})),o.addEventListener("error",(()=>{r(new Error("error"))})),o.addEventListener("abort",(()=>{r(new Error("aborted"))})),null===t?o.open("GET",e,!0):o.open("POST",e,!0),o.responseType="json",o.timeout=n,o.ontimeout=()=>{r(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 z extends T{static LANGUAGE_CACHE=new Map;static CACHE=new Map;static LATEST_CACHE_KEY=0;static DEFAULT_LANGUAGE="EN";static consentLanguages=new A;static baseUrl_;static set baseUrl(e){if(/^https?:\/\/vendorlist\.consensu\.org\//.test(e))throw new w("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;dataCategories;lang_;cacheLang_;isLatest=!1;constructor(e){super();let t=z.baseUrl;if(this.lang_=z.DEFAULT_LANGUAGE,this.cacheLang_=z.DEFAULT_LANGUAGE,this.isVendorList(e))this.populate(e),this.readyPromise=Promise.resolve();else{if(!t)throw new w("must specify GVL.baseUrl before loading GVL json");if(e>0){const s=e;z.CACHE.has(s)?(this.populate(z.CACHE.get(s)),this.readyPromise=Promise.resolve()):(t+=z.versionedFilename.replace("[VERSION]",String(s)),this.readyPromise=this.fetchJson(t))}else z.CACHE.has(z.LATEST_CACHE_KEY)?(this.populate(z.CACHE.get(z.LATEST_CACHE_KEY)),this.readyPromise=Promise.resolve()):(this.isLatest=!0,this.readyPromise=this.fetchJson(t+z.latestFilename))}}static emptyLanguageCache(e){let t=!1;return null==e&&z.LANGUAGE_CACHE.size>0?(z.LANGUAGE_CACHE=new Map,t=!0):"string"==typeof e&&this.consentLanguages.has(e.toUpperCase())&&(z.LANGUAGE_CACHE.delete(e.toUpperCase()),t=!0),t}static emptyCache(e){let t=!1;return Number.isInteger(e)&&e>=0?(z.CACHE.delete(e),t=!0):void 0===e&&(z.CACHE=new Map,t=!0),t}cacheLanguage(){z.LANGUAGE_CACHE.has(this.cacheLang_)||z.LANGUAGE_CACHE.set(this.cacheLang_,{purposes:this.purposes,specialPurposes:this.specialPurposes,features:this.features,specialFeatures:this.specialFeatures,stacks:this.stacks,dataCategories:this.dataCategories})}async fetchJson(e){try{this.populate(await J.fetch(e))}catch(e){throw new w(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,dataCategories:this.dataCategories,vendors:this.fullVendorList}))}async changeLanguage(e){let t=e;try{t=z.consentLanguages.parseLanguage(e)}catch(e){throw new w("Error during parsing the language: "+e.message)}const s=e.toUpperCase();if((t.toLowerCase()!==z.DEFAULT_LANGUAGE.toLowerCase()||z.LANGUAGE_CACHE.has(s))&&t!==this.lang_)if(this.lang_=t,z.LANGUAGE_CACHE.has(s)){const e=z.LANGUAGE_CACHE.get(s);for(const t in e)e.hasOwnProperty(t)&&(this[t]=e[t])}else{const e=z.baseUrl+z.languageFilename.replace("[LANG]",this.lang_.toLowerCase());try{await this.fetchJson(e),this.cacheLang_=s,this.cacheLanguage()}catch(e){throw new w("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.dataCategories=e.dataCategories,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&&z.CACHE.set(z.LATEST_CACHE_KEY,this.getJson()),z.CACHE.has(this.vendorListVersion)||z.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 i=e.charAt(0).toUpperCase()+e.slice(1);let r;const o={};return r="purpose"===e&&s?this["by"+i+"VendorMap"][String(t)][s]:this["by"+(n?"Special":"")+i+"VendorMap"][String(t)],r.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 z(this.getJson());return this.lang_!==z.DEFAULT_LANGUAGE&&e.changeLanguage(this.lang_),e}static isInstanceOf(e){return"object"==typeof e&&"function"==typeof e.narrowVendorsTo}}class K extends T{static consentLanguages=z.consentLanguages;isServiceSpecific_=!1;supportOOB_=!0;useNonStandardTexts_=!1;purposeOneTreatment_=!1;publisherCountryCode_="AA";version_=2;consentScreen_=0;policyVersion_=4;consentLanguage_="EN";cmpId_=0;cmpVersion_=0;vendorListVersion_=0;numCustomPurposes_=0;gvl_;created;lastUpdated;specialFeatureOptins=new P;purposeConsents=new P;purposeLegitimateInterests=new P;publisherConsents=new P;publisherLegitimateInterests=new P;publisherCustomConsents=new P;publisherCustomLegitimateInterests=new P;customPurposes;vendorConsents=new P;vendorLegitimateInterests=new P;vendorsDisclosed=new P;vendorsAllowed=new P;publisherRestrictions=new R;constructor(e){super(),e&&(this.gvl=e),this.updated()}set gvl(e){z.isInstanceOf(e)||(e=new z(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 useNonStandardTexts(e){this.useNonStandardTexts_=e}get useNonStandardTexts(){return this.useNonStandardTexts_}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 Y{static encode(e,t){let s,n="";return e=Q.process(e,t),s=Array.isArray(t?.segments)?t.segments:new $(e,t)[""+e.version],s.forEach(((t,i)=>{let r="";i{this.invokeCallback(s.getJson())}))}}class X extends h{respond(){this.listenerId=g.eventQueue.add({callback:this.callback,param:this.param,next:this.next}),super.respond()}}class Z extends d{respond(){this.invokeCallback(g.eventQueue.remove(this.param))}}class ee{static[n.PING]=I;static[n.GET_TC_DATA]=h;static[n.GET_IN_APP_TC_DATA]=S;static[n.GET_VENDOR_LIST]=q;static[n.ADD_EVENT_LISTENER]=X;static[n.REMOVE_EVENT_LISTENER]=Z}class te{static set_=new Set([0,2,void 0,null]);static has(e){return"string"==typeof e&&(e=Number(e)),this.set_.has(e)}}const se="__tcfapi";class ne{callQueue;customCommands;constructor(e){if(e){let t=n.ADD_EVENT_LISTENER;if(e?.[t])throw new Error(`Built-In Custom Commmand for ${t} not allowed: Use ${n.GET_TC_DATA} instead`);if(t=n.REMOVE_EVENT_LISTENER,e?.[t])throw new Error(`Built-In Custom Commmand for ${t} not allowed`);e?.[n.GET_TC_DATA]&&(e[n.ADD_EVENT_LISTENER]=e[n.GET_TC_DATA],e[n.REMOVE_EVENT_LISTENER]=e[n.GET_TC_DATA]),this.customCommands=e}try{this.callQueue=window[se]()||[]}catch(e){this.callQueue=[]}finally{window[se]=this.apiCall.bind(this),this.purgeQueuedCalls()}}apiCall(e,t,s,...i){if("string"!=typeof e)s(null,!1);else if(te.has(t)){if("function"!=typeof s)throw new Error("invalid callback function");g.disabled?s(new m,!1):this.isCustomCommand(e)||this.isBuiltInCommand(e)?this.isCustomCommand(e)&&!this.isBuiltInCommand(e)?this.customCommands[e](s,...i):e===n.PING?this.isCustomCommand(e)?new ee[e](this.customCommands[e],i[0],null,s):new ee[e](s,i[0]):void 0===g.tcModel?this.callQueue.push([e,t,s,...i]):this.isCustomCommand(e)&&this.isBuiltInCommand(e)?new ee[e](this.customCommands[e],i[0],null,s):new ee[e](s,i[0]):s(null,!1)}else s(null,!1)}purgeQueuedCalls(){const e=this.callQueue;this.callQueue=[],e.forEach((e=>{window[se](...e)}))}isCustomCommand(e){return this.customCommands&&"function"==typeof this.customCommands[e]}isBuiltInCommand(e){return void 0!==ee[e]}}class ie{callResponder;isServiceSpecific;numUpdates=0;constructor(e,t,s=!1,n){this.throwIfInvalidInt(e,"cmpId",2),this.throwIfInvalidInt(t,"cmpVersion",0),g.cmpId=e,g.cmpVersion=t,g.tcfPolicyVersion=5,this.isServiceSpecific=!!s,this.callResponder=new ne(n)}throwIfInvalidInt(e,t,s){if(!("number"==typeof e&&Number.isInteger(e)&&e>=s))throw new Error(`Invalid ${t}: ${e}`)}update(e,t=!1){if(g.disabled)throw new Error("CmpApi Disabled");g.cmpStatus=i.LOADED,t?(g.displayStatus=r.VISIBLE,g.eventStatus=o.CMP_UI_SHOWN):void 0===g.tcModel?(g.displayStatus=r.DISABLED,g.eventStatus=o.TC_LOADED):(g.displayStatus=r.HIDDEN,g.eventStatus=o.USER_ACTION_COMPLETE),g.gdprApplies=null!==e,g.gdprApplies?(""===e?(g.tcModel=new K,g.tcModel.cmpId=g.cmpId,g.tcModel.cmpVersion=g.cmpVersion):g.tcModel=Y.decode(e),g.tcModel.isServiceSpecific=this.isServiceSpecific,g.tcfPolicyVersion=Number(g.tcModel.policyVersion),g.tcString=e):g.tcModel=null,0===this.numUpdates?this.callResponder.purgeQueuedCalls():g.eventQueue.exec(),this.numUpdates++}disable(){g.disabled=!0,g.cmpStatus=i.ERROR}}}}]);