@usercentrics/cmp-browser-sdk
Advanced tools
Comparing version 0.5.2 to 0.5.3
@@ -16,3 +16,9 @@ # Changelog | ||
- history log | ||
## [0.5.3] - 2020-07-08 | ||
## Added | ||
- Add support for customizing `logoUrl` | ||
## [0.5.2] - 2020-06-18 | ||
@@ -19,0 +25,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("uuid"),n=e(require("lodash/sortBy")),s=e(require("lodash/uniqWith")),i=require("@iabtcf/core"),r=require("@iabtcf/cmpapi"),o=e(require("lodash/uniq")),a=e(require("@iabtcf/stub"));function c(e){return(c="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)}var u,l,d=function(){return(d=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function p(e,t,n,s){return new(n||(n=Promise))((function(i,r){function o(e){try{c(s.next(e))}catch(e){r(e)}}function a(e){try{c(s.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))}function g(e,t){var n,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],s=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function f(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var s=Array(e),i=0;for(t=0;t<n;t++)for(var r=arguments[t],o=0,a=r.length;o<a;o++,i++)s[i]=r[o];return s}!function(e){e.AVAILABLE_LANGUAGES_NOT_FOUND="Unable to find available languages using given settingsId and version.",e.FETCH_AVAILABLE_LANGUAGES="Something went wrong while fetching the available languages.",e.FETCH_DATA_PROCESSING_SERVICES="Something went wrong while fetching the data processing services.",e.FETCH_SETTINGS="Something went wrong while fetching the settings.",e.FETCH_USER_CONSENTS="Something went wrong while fetching the user's consents.",e.FETCH_USER_COUNTRY="Something went wrong while fetching the user's country.",e.GENERATE_DATA_PROCESSING_SERVICES="Something went wrong while generating the data processing services.",e.SAVE_CONSENTS="Something went wrong while saving user consents.",e.SETTINGS_NOT_FOUND="Unable to find settings using given settingsId and version."}(u||(u={})),function(e){e.AGGREGATOR="https://consent-templates-batch-generation.usercentrics.eu",e.CDN="https://api.usercentrics.eu",e.FETCH_CONSENTS="https://api-consent-prod-dot-staticfilesserver.ey.r.appspot.com/consentsHistory",e.GRAPHQL="https://graphql.usercentrics.eu/graphql"}(l||(l={}));var h;!function(e){e[e.RESOURCE_NOT_FOUND=403]="RESOURCE_NOT_FOUND",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT"}(h||(h={}));var v,I=function(e,t){return p(void 0,void 0,void 0,(function(){return g(this,(function(n){return[2,y(e,t)]}))}))},S=function(e,t,n,s){return p(void 0,void 0,void 0,(function(){return g(this,(function(i){return[2,y(e,n,t,s)]}))}))},y=function(e,t,n,s){return p(void 0,void 0,void 0,(function(){var i,r,o;return g(this,(function(a){return i={"content-type":"application/json"},r=d(d({},s),{headers:i,method:n?"POST":"GET"}),n&&(r.body=JSON.stringify(n)),(null==s?void 0:s.headers)&&(r.headers=d(d({},i),s.headers)),[2,Promise.race([fetch(e,r).then((function(e){return p(void 0,void 0,void 0,(function(){return g(this,(function(n){if(e.ok)return[2,C(e)];throw m(t,e.status)}))}))})),new Promise((function(e,n){o=setTimeout((function(){n(m(t,h.REQUEST_TIMEOUT))}),15e3)}))]).finally((function(){clearTimeout(o)}))]}))}))},m=function(e,t){return{errorMessage:e,statusCode:t}},C=function(e){return p(void 0,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return[4,E(e)];case 1:return[2,{data:t.sent(),statusCode:e.status}]}}))}))},E=function(e){return p(void 0,void 0,void 0,(function(){var t,n;return g(this,(function(s){switch(s.label){case 0:return[4,e.json()];case 1:return t=s.sent(),[2,null!==(n=t.data)&&void 0!==n?n:t]}}))}))};!function(e){e.CONSENTS_BUFFER="uc_consents_buffer",e.SETTINGS="uc_settings",e.TC_STRING="uc_tc_string",e.USER_INTERACTION="uc_user_interaction"}(v||(v={}));var T,b,A,L,N,F,w,_,O,U,R=function(e,t){return-1!==e.indexOf(t)},P=function(e){return Array.isArray(e)&&e.length>0},D=function(e){return"object"===c(e)&&null!==e&&Object.keys(e).length>0},V=function(){function e(){}return e.appendToConsentsBuffer=function(t){var n=e.fetchConsentsBuffer();localStorage.setItem(v.CONSENTS_BUFFER,JSON.stringify({consents:n.consents?n.consents.concat(t):t,timestamp:(new Date).valueOf()}))},e.clearOnNewSettingsId=function(t){t!==e.fetchSettingsId()&&e.clear()},e.clearConsentsBuffer=function(){localStorage.removeItem(v.CONSENTS_BUFFER)},e.fetchConsentsBuffer=function(){var e=localStorage.getItem(v.CONSENTS_BUFFER);return e?JSON.parse(e):{}},e.fetchControllerId=function(){return e.fetchSettings().controllerId},e.fetchLanguage=function(){return e.fetchSettings().language},e.fetchServices=function(){return e.fetchSettings().services},e.fetchSettings=function(){var e=localStorage.getItem(v.SETTINGS);return e?JSON.parse(e):{}},e.fetchSettingsId=function(){return e.fetchSettings().id},e.fetchSettingsVersion=function(){return e.fetchSettings().version},e.fetchTCString=function(){var e=localStorage.getItem(v.TC_STRING);return JSON.parse(null!=e?e:'""')},e.fetchUserActionPerformed=function(){return null!==localStorage.getItem(v.USER_INTERACTION)},e.mapServices=function(e){return e.map((function(e){return{history:e.consent.history,id:e.id,processorId:e.processorId,status:e.consent.status}}))},e.mapSettings=function(t,n){return{controllerId:t.controllerId,id:t.id,language:t.ui.language.selected,services:e.mapServices(n),version:t.version}},e.saveSettings=function(e){localStorage.setItem(v.SETTINGS,JSON.stringify(e))},e.saveTCString=function(e){localStorage.setItem(v.TC_STRING,JSON.stringify(e))},e.settingsExist=function(){return D(e.fetchSettings())},e.setUserActionPerformed=function(){localStorage.setItem(v.USER_INTERACTION,JSON.stringify(!0))},e.clear=function(){localStorage.removeItem(v.SETTINGS),localStorage.removeItem(v.USER_INTERACTION)},e}(),B=function(){function e(){this.controllerId="",this.jsonCacheBustingString="",this.jsonFileLanguage="",this.jsonFileVersion="latest",this.saveConsentsTimeout=null,this.settingsId=""}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.resetInstance=function(){e.instance.controllerId="",e.instance.jsonCacheBustingString="",e.instance.jsonFileLanguage="",e.instance.jsonFileVersion="latest",e.instance.saveConsentsTimeout=null,e.instance.settingsId=""},e.prototype.getControllerId=function(){return this.controllerId},e.prototype.getJsonFileLanguage=function(){return this.jsonFileLanguage},e.prototype.getJsonFileVersion=function(){return this.jsonFileVersion},e.prototype.getSettingsId=function(){return this.settingsId},e.prototype.setControllerId=function(e){this.controllerId=e},e.prototype.setJsonCacheBustingString=function(e){this.jsonCacheBustingString=e},e.prototype.setJsonFileLanguage=function(e){this.jsonFileLanguage=e},e.prototype.setJsonFileVersion=function(e){this.jsonFileVersion=e},e.prototype.setSettingsId=function(e){this.settingsId=e},e.prototype.fetchAvailableLanguages=function(){return p(this,void 0,void 0,(function(){var e,t;return g(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=this.createLanguagesJsonUrl(),[4,I(e,u.FETCH_AVAILABLE_LANGUAGES)];case 1:return[2,n.sent().data.languagesAvailable];case 2:throw(t=n.sent()).statusCode===h.RESOURCE_NOT_FOUND&&(t.errorMessage=u.AVAILABLE_LANGUAGES_NOT_FOUND),t;case 3:return[2]}}))}))},e.prototype.fetchServicesJson=function(e){return p(this,void 0,void 0,(function(){var t;return g(this,(function(n){switch(n.label){case 0:return t=this.createServicesJsonUrl(e),[4,I(t,u.FETCH_DATA_PROCESSING_SERVICES)];case 1:return[2,n.sent().data]}}))}))},e.prototype.fetchSettingsJson=function(){return p(this,void 0,void 0,(function(){var e,t;return g(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=this.createSettingsJsonUrl(),[4,I(e,u.FETCH_SETTINGS)];case 1:return[2,n.sent().data];case 2:throw(t=n.sent()).statusCode===h.RESOURCE_NOT_FOUND&&(t.errorMessage=u.SETTINGS_NOT_FOUND),t;case 3:return[2]}}))}))},e.prototype.fetchUserConsents=function(){return p(this,void 0,void 0,(function(){var e;return g(this,(function(t){switch(t.label){case 0:return e=this.createFetchUserConsentsUrl(),[4,I(e,u.FETCH_USER_CONSENTS)];case 1:return[2,t.sent().data.reverse()]}}))}))},e.prototype.fetchUserCountry=function(){return p(this,void 0,void 0,(function(){var e,t;return g(this,(function(n){switch(n.label){case 0:return e=M(),t=k(),[4,S(l.GRAPHQL,e,u.FETCH_USER_COUNTRY,t)];case 1:return[2,n.sent().data.clientLocation]}}))}))},e.prototype.generateServicesJson=function(e){return p(this,void 0,void 0,(function(){var t;return g(this,(function(n){switch(n.label){case 0:return t={request:e},[4,S(l.AGGREGATOR,t,u.GENERATE_DATA_PROCESSING_SERVICES)];case 1:return[2,n.sent().data.fileName]}}))}))},e.prototype.saveConsents=function(e){return p(this,void 0,void 0,(function(){var t,n,s;return g(this,(function(i){switch(i.label){case 0:t=G(e),n=k(),s=x(t),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,S(l.GRAPHQL,s,u.SAVE_CONSENTS,n)];case 2:return i.sent(),[3,4];case 3:return i.sent(),V.appendToConsentsBuffer(t),this.saveConsentsFromBuffer(),[3,4];case 4:return[2]}}))}))},e.prototype.saveConsentsFromBuffer=function(){var e=this,t=V.fetchConsentsBuffer();if(this.saveConsentsTimeout&&clearTimeout(this.saveConsentsTimeout),D(t)){var n=t.timestamp-(new Date).valueOf()+3e5;this.saveConsentsTimeout=setTimeout((function(){return p(e,void 0,void 0,(function(){var e,n;return g(this,(function(s){switch(s.label){case 0:e=k(),n=x(t.consents),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,S(l.GRAPHQL,n,u.SAVE_CONSENTS,e)];case 2:return s.sent(),V.clearConsentsBuffer(),[3,4];case 3:return s.sent(),V.clearConsentsBuffer(),V.appendToConsentsBuffer(t.consents),this.saveConsentsFromBuffer(),[3,4];case 4:return[2]}}))}))}),n>0?n:0)}},e.prototype.addJsonCacheBustingString=function(e){return this.jsonCacheBustingString?e+"?c="+this.jsonCacheBustingString:e},e.prototype.createLanguagesJsonUrl=function(){return this.addJsonCacheBustingString(l.CDN+"/settings/"+this.settingsId+"/"+this.jsonFileVersion+"/languages.json")},e.prototype.createServicesJsonUrl=function(e){return l.CDN+"/consent-templates/"+e+".json"},e.prototype.createSettingsJsonUrl=function(){return this.addJsonCacheBustingString(l.CDN+"/settings/"+this.settingsId+"/"+this.jsonFileVersion+"/"+this.jsonFileLanguage+".json")},e.prototype.createFetchUserConsentsUrl=function(){return l.FETCH_CONSENTS+"?controllerId="+this.controllerId},e}(),M=function(){return{query:"{ clientLocation { countryCode countryName } }"}},k=function(){return{credentials:"omit",headers:{Accept:"application/json","Access-Control-Allow-Origin":"*","X-Request-ID":t.v4()},mode:"cors"}},x=function(e){return{query:"mutation saveConsents($consents: [NewCreateConsentInput]) { saveConsents(consents: $consents) { data { consentId } } }",variables:{consents:e}}},G=function(e){return e.map((function(e){return{action:e.consent.action,appVersion:e.applicationVersion,consentStatus:e.consent.status?"1":"0",consentTemplateId:e.service.id,consentTemplateVersion:e.service.version,controllerId:e.settings.controllerId,language:e.settings.language,processorId:e.service.processorId,referrerControllerId:e.settings.referrerControllerId,settingsId:e.settings.id,settingsVersion:e.settings.version,updatedBy:e.consent.type}}))};!function(e){e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE"}(T||(T={})),function(e){e[e.DATA_LAYER=0]="DATA_LAYER",e[e.WINDOW_EVENT=1]="WINDOW_EVENT"}(b||(b={})),function(e){e[e.MAJOR=0]="MAJOR",e[e.MINOR=1]="MINOR",e[e.PATCH=2]="PATCH"}(A||(A={})),function(e){e[e.FIRST_LAYER=1]="FIRST_LAYER",e[e.SECOND_LAYER=3]="SECOND_LAYER"}(L||(L={})),function(e){e[e.DATA_LAYER=1]="DATA_LAYER",e[e.WINDOW_EVENT=4]="WINDOW_EVENT"}(N||(N={})),function(e){e.DATA_COLLECTED_LIST="dataCollectedList",e.DATA_PURPOSES_LIST="dataPurposesList",e.DATA_RECIPIENTS_LIST="dataRecipientsList",e.TECHNOLOGY_USED="technologyUsed"}(F||(F={})),function(e){e.MAJOR="major",e.MINOR="minor",e.PATCH="patch"}(w||(w={})),(_=exports.FIRST_LAYER_VARIANT||(exports.FIRST_LAYER_VARIANT={}))[_.BANNER=0]="BANNER",_[_.WALL=1]="WALL",(O=exports.SECOND_LAYER_VARIANT||(exports.SECOND_LAYER_VARIANT={}))[O.CENTER=0]="CENTER",O[O.SIDE=1]="SIDE",(U=exports.THEME||(exports.THEME={}))[U.DARK=0]="DARK",U[U.LIGHT=1]="LIGHT";var H,J=function(){function e(){this.dataLayerNames=[],this.windowEventNames=[]}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.resetInstance=function(){e.instance.dataLayerNames=[],e.instance.windowEventNames=[]},e.prototype.init=function(e){var t=this;e.forEach((function(e){var n,s;e.type===b.DATA_LAYER?t.dataLayerNames=null!==(n=e.names)&&void 0!==n?n:[]:e.type===b.WINDOW_EVENT&&(t.windowEventNames=null!==(s=e.names)&&void 0!==s?s:[])}))},e.prototype.dispatch=function(e){P(e)&&(this.pushEventsToDataLayer(e),this.dispatchWindowEvents(e))},e.prototype.pushEventsToDataLayer=function(e){if(P(this.dataLayerNames)){var t=Y(e),n="explicit"===e[0].consent.type;this.dataLayerNames.forEach((function(s){var i;if(window[s]=null!==(i=window[s])&&void 0!==i?i:[],!Array.isArray(window[s]))throw Error("DataLayer: "+s+" is not of type Array!");window[s].push(t),n&&e.forEach((function(e){e.consent.status||window[s].push({event:e.service.name+" EXPLICIT_DENY"})}))}))}},e.prototype.dispatchWindowEvents=function(e){if(P(this.windowEventNames)){var t=Y(e);this.windowEventNames.forEach((function(e){var n=new window.CustomEvent(e,{detail:t});window.dispatchEvent(n)}))}},e}(),Y=function(e){var t={event:"consent_status",type:e[0].consent.type};return e.forEach((function(e){var n;t=d(d({},t),((n={})[e.service.name]=e.consent.status,n))})),t},j=["onEssentialChange","onInitialPageLoad","onNonEURegion","onSessionRestored"];!function(e){e.TEXT_JAVASCRIPT="text/javascript",e.TEXT_PLAIN="text/plain"}(H||(H={}));var W=function(){function e(){}return e.enableScriptsForServicesWithConsent=function(t){var n=e.getDisabledScripts();Array.prototype.forEach.call(n,(function(n){e.disabledScriptHasConsent(t,n)&&e.enableScript(n)}))},e.getDisabledScripts=function(){return document.querySelectorAll('script[data-usercentrics][type="'+H.TEXT_PLAIN+'"]')},e.disabledScriptHasConsent=function(e,t){return e.some((function(e){return e.name===t.getAttribute("data-usercentrics")}))},e.enableScript=function(t){var n,s,i,r=t.src?e.createSrcScriptTag(t):e.createInlineScriptTag(t);s=r,(i=(n=t).parentNode)&&i.replaceChild(s,n)},e.createSrcScriptTag=function(t){var n=e.cloneScriptTag(t);return n.removeAttribute("data-usercentrics"),n.type=H.TEXT_JAVASCRIPT,n},e.createInlineScriptTag=function(t){var n=e.cloneScriptTag(t);n.removeAttribute("data-usercentrics");var s=document.createTextNode(t.text);return n.appendChild(s),n.type=H.TEXT_JAVASCRIPT,n},e.cloneScriptTag=function(e){var t=document.createElement("script");return Array.from(e.attributes).forEach((function(e){t.setAttribute(e.name,e.value)})),t},e}();"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function q(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var z,X=q((function(e,t){var n;e.exports=(n=n||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},i=s.lib={},r=i.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,s=this.sigBytes,i=e.sigBytes;if(this.clamp(),s%4)for(var r=0;r<i;r++){var o=n[r>>>2]>>>24-r%4*8&255;t[s+r>>>2]|=o<<24-(s+r)%4*8}else for(r=0;r<i;r+=4)t[s+r>>>2]=n[r>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=r.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,s=[],i=function(t){t=t;var n=987654321,s=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&s)<<16)+(t=18e3*(65535&t)+(t>>16)&s)&s;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},r=0;r<t;r+=4){var a=i(4294967296*(n||e.random()));n=987654071*a(),s.push(4294967296*a()|0)}return new o.init(s,t)}}),a=s.enc={},c=a.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,s=[],i=0;i<n;i++){var r=t[i>>>2]>>>24-i%4*8&255;s.push((r>>>4).toString(16)),s.push((15&r).toString(16))}return s.join("")},parse:function(e){for(var t=e.length,n=[],s=0;s<t;s+=2)n[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new o.init(n,t/2)}},u=a.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,s=[],i=0;i<n;i++){var r=t[i>>>2]>>>24-i%4*8&255;s.push(String.fromCharCode(r))}return s.join("")},parse:function(e){for(var t=e.length,n=[],s=0;s<t;s++)n[s>>>2]|=(255&e.charCodeAt(s))<<24-s%4*8;return new o.init(n,t)}},l=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,s=n.words,i=n.sigBytes,r=this.blockSize,a=i/(4*r),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*r,u=e.min(4*c,i);if(c){for(var l=0;l<c;l+=r)this._doProcessBlock(s,l);var d=s.splice(0,c);n.sigBytes-=u}return new o.init(d,u)},clone:function(){var e=r.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=(i.Hasher=d.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new p.HMAC.init(e,n).finalize(t)}}}),s.algo={});return s}(Math),n)})),Q=q((function(e,t){var n;e.exports=(n=X,function(e){var t=n,s=t.lib,i=s.WordArray,r=s.Hasher,o=t.algo,a=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),s=2;s<=n;s++)if(!(t%s))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var s=2,i=0;i<64;)t(s)&&(i<8&&(a[i]=n(e.pow(s,.5))),c[i]=n(e.pow(s,1/3)),i++),s++}();var u=[],l=o.SHA256=r.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,s=n[0],i=n[1],r=n[2],o=n[3],a=n[4],l=n[5],d=n[6],p=n[7],g=0;g<64;g++){if(g<16)u[g]=0|e[t+g];else{var f=u[g-15],h=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,v=u[g-2],I=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[g]=h+u[g-7]+I+u[g-16]}var S=s&i^s&r^i&r,y=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),m=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&d)+c[g]+u[g];p=d,d=l,l=a,a=o+m|0,o=r,r=i,i=s,s=m+(y+S)|0}n[0]=n[0]+s|0,n[1]=n[1]+i|0,n[2]=n[2]+r|0,n[3]=n[3]+o|0,n[4]=n[4]+a|0,n[5]=n[5]+l|0,n[6]=n[6]+d|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,s=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(s/4294967296),n[15+(i+64>>>9<<4)]=s,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(l),t.HmacSHA256=r._createHmacHelper(l)}(Math),n.SHA256)})),K=function(){return""+Q(t.v4())},$=function(e){var t=e.backgroundOverlay.find((function(e){var t;return(null===(t=e.target)||void 0===t?void 0:t[0])===L.FIRST_LAYER}));return!!t&&(null==t?void 0:t.darken)>0},Z=function(e){var t=e.backgroundOverlay.find((function(e){var t;return(null===(t=e.target)||void 0===t?void 0:t[0])===L.SECOND_LAYER}));return!!t&&(null==t?void 0:t.darken)>0},ee=function(e,t){var n=function(e,t){return t.find((function(t){return e.templateId===t.templateId&&e.version===t.version}))}(e,t);return{dataCollected:be(n,F.DATA_COLLECTED_LIST),dataDistribution:{processingLocation:n.locationOfProcessing,thirdPartyCountries:n.thirdCountryTransfer},dataPurposes:ve(n),dataRecipients:be(n,F.DATA_RECIPIENTS_LIST),description:Ie(e,n),id:e.templateId,language:{available:n.languagesAvailable,selected:n.language},legalBasis:ye(n),name:he(n),processingCompany:{address:n.addressOfProcessingCompany,dataProtectionOfficer:n.dataProtectionOfficer,name:me(n)},retentionPeriodDescription:Ee(n),technologiesUsed:be(n,F.TECHNOLOGY_USED),urls:{cookiePolicy:n.cookiePolicyURL,dataProcessingAgreement:n.linkToDpa,optOut:n.optOutUrl,privacyPolicy:Ce(n)},version:e.version}},te=function(e){var t,n,s,i,r,o,a,c;return{color:{primary:(null===(n=null===(t=e.customization)||void 0===t?void 0:t.color)||void 0===n?void 0:n.primary)?"#"+e.customization.color.primary:"#0045A5"},font:{family:null!==(r=null===(i=null===(s=e.customization)||void 0===s?void 0:s.font)||void 0===i?void 0:i.family)&&void 0!==r?r:"",size:null!==(c=null===(a=null===(o=e.customization)||void 0===o?void 0:o.font)||void 0===a?void 0:a.size)&&void 0!==c?c:14},logoUrl:null,theme:1}},ne=function(e,t){var n={categorySlug:"none",description:"",isEssential:!1,isHidden:!0,label:""};return Array.prototype.concat(e.categories.map((function(n){return{description:n.description,isEssential:n.isEssential,isHidden:n.isHidden,label:n.label,services:ue(e,t,n),slug:n.categorySlug}})),[d(d({},n),{services:ue(e,t,n),slug:"none"})])},se=function(e,t){return{id:e.templateId,version:e.version,language:t.language}},ie=function(e){return{general:{consentGiven:e.labels.accepted,consentNotGiven:e.labels.denied,consentType:"Consent type",controllerId:"Controller ID",copy:e.labels.copy,date:e.labels.date,decision:"Decision",explicit:"Explicit",implicit:"Implicit",processorId:"Processor ID",showMore:"Show more"},service:{dataCollected:{description:e.labels.dataCollectedInfo,title:e.labels.dataCollectedList},dataDistribution:{processingLocationTitle:e.labels.locationOfProcessing,thirdPartyCountriesTitle:e.labels.transferToThirdCountries},dataPurposes:{description:e.labels.dataPurposesInfo,title:e.labels.dataPurposes},dataRecipientsTitle:e.labels.dataRecipientsList,descriptionTitle:e.labels.descriptionOfService,history:{description:null,title:e.labels.history},legalBasis:{description:e.labels.legalBasisInfo,title:e.labels.legalBasisList},processingCompanyTitle:e.labels.processingCompanyTitle,retentionPeriodTitle:e.labels.retentionPeriod,technologiesUsed:{description:e.labels.technologiesUsedInfo,title:e.labels.technologiesUsed},urls:{cookiePolicyTitle:e.labels.cookiePolicyInfo,optOutTitle:e.labels.optOut,privacyPolicyTitle:e.labels.policyOf}}}},re=function(e){return{available:e.languagesAvailable,isSelectorEnabled:e.showLanguageDropdown,selected:e.language}},oe=function(e){var t;return{cookiePolicy:{label:null!==(t=e.labels.cookiePolicyLinkText)&&void 0!==t?t:"",url:e.cookiePolicyUrl},imprint:{label:e.labels.imprintLinkText||null,url:e.imprintUrl||null},privacyPolicy:{label:e.labels.privacyPolicyLinkText,url:e.privacyPolicyUrl||null}}},ae=function(e){return{iconUrl:e.buttonPrivacyOpenIconUrl||null,isEnabled:e.privacyButtonIsVisible,position:e.buttonDisplayLocation||"bl"}},ce=function(e){return{isEnabled:e.enablePoweredBy,label:"Powered by",partnerUrl:e.partnerPoweredByUrl||null,partnerUrlLabel:e.labels.partnerPoweredByLinkText||null,url:"https://www.usercentrics.com/",urlLabel:"Usercentrics Consent Management"}},ue=function(e,t,n){return e.consentTemplates.reduce((function(e,s){return s.categorySlug===n.categorySlug&&e.push(le(s,t,n)),e}),[])},le=function(e,t,n){return d(d({},ee(e,t)),{categorySlug:e.categorySlug,consent:{history:[],status:Te(e,n)},isEssential:n.isEssential,isHidden:Se(e,n),processorId:K(),subServices:pe(e.subConsents,t)})},de=function(e){return e.map((function(e){switch(e){case w.MAJOR:return A.MAJOR;case w.MINOR:return A.MINOR;case w.PATCH:return A.PATCH}}))},pe=function(e,t){return e.reduce((function(e,n){return e.push(ee(n,t)),e}),[])},ge=function(e){var t;return{cmpId:e.tcf2.cmpId||5,cmpVersion:e.tcf2.cmpVersion||parseInt("3",10),consensuScriptPath:e.tcf2.consensuScriptPath||"/browser-sdk/0.5.2/cookie-bridge.html",consensuSubdomain:e.tcf2.consensuDomain||"https://usercentrics.mgr.consensu.org:443",gdprApplies:null===(t=e.tcf2.gdprApplies)||void 0===t||t,publisherCountryCode:e.tcf2.publisherCountryCode,purposeOneTreatment:e.tcf2.purposeOneTreatment,stackIds:e.tcf2.selectedStacks,vendorIds:e.tcf2.selectedVendorIds}},fe=function(e){return e.tcf2Enabled?function(e){return{buttons:{acceptAll:{label:e.tcf2.buttonsAcceptAllLabel},denyAll:{isEnabled:e.tcf2.buttonsDenyAllIsEnabled,label:e.tcf2.buttonsDenyAllLabel},manageSettings:{label:e.tcf2.linksManageSettingsLabel},save:{label:e.tcf2.buttonsSaveLabel},showVendorTab:{label:e.tcf2.linksVendorListLinkLabel}},customization:te(e),firstLayer:{description:{additionalInfo:e.tcf2.firstLayerAdditionalInfo||null,default:e.tcf2.firstLayerDescription},hideToggles:e.tcf2.firstLayerHideToggles,isOverlayEnabled:$(e),title:e.tcf2.firstLayerTitle},isEmbeddingsEnabled:!0,labels:{general:{disclaimer:e.tcf2.labelsDisclaimer,features:e.tcf2.labelsFeatures,iabVendors:e.tcf2.labelsIabVendors,nonIabPurposes:e.tcf2.labelsNonIabPurposes,nonIabVendors:e.tcf2.labelsNonIabVendors,purposes:e.tcf2.labelsPurposes},nonTCFLabels:ie(e),vendor:{features:"Features",legitimateInterest:"Purposes processed by Legitimate Interest",privacyPolicy:"Privacy Policy",purposes:"Purposes processed by Consent",specialFeatures:"Special Features",specialPurposes:"Special Purposes"}},language:re(e),links:oe(e),poweredBy:ce(e),privacyButton:ae(e),secondLayer:{description:e.tcf2.secondLayerDescription,isOverlayEnabled:Z(e),tabs:{purposes:{label:e.tcf2.tabsPurposeLabel},vendors:{label:e.tcf2.tabsVendorsLabel}},title:e.tcf2.secondLayerTitle},toggles:{consent:{label:e.tcf2.togglesConsentToggleLabel},legitimateInterest:{label:e.tcf2.togglesLegIntToggleLabel},specialFeaturesToggle:{offLabel:e.tcf2.togglesSpecialFeaturesToggleOff,onLabel:e.tcf2.togglesSpecialFeaturesToggleOn}}}}(e):function(e){var t;return{buttons:{acceptAll:{label:e.labels.btnAcceptAll},denyAll:{isEnabled:e.btnDenyIsVisible,label:e.labels.btnDeny},save:{label:e.labels.btnSave},showSecondLayer:{isEnabled:e.btnMoreInfoIsVisible,label:e.labels.btnMore,url:e.moreInfoButtonUrl||null}},customization:te(e),firstLayer:{description:{default:e.bannerMessage,short:e.bannerMobileDescriptionIsActive?e.bannerMobileDescription:null},isCategoryTogglesEnabled:!1,isOverlayEnabled:$(e),title:null!==(t=e.labels.firstLayerTitle)&&void 0!==t?t:"Privacy Settings",variant:0},isEmbeddingsEnabled:!0,labels:ie(e),language:re(e),links:oe(e),poweredBy:ce(e),privacyButton:ae(e),secondLayer:{description:e.labels.titleCorner,isOverlayEnabled:Z(e),tabs:{categories:{isEnabled:!0,label:e.labels.categories},services:{isEnabled:!0,label:"Services"}},title:e.labels.headerCorner,variant:0}}}(e)},he=function(e){return e.dataProcessor||e.dataProcessors[0]},ve=function(e){var t=be(e,F.DATA_PURPOSES_LIST);return P(t)?t:e.dataPurposes},Ie=function(e,t){return e.description||t.descriptionOfService||t.description},Se=function(e,t){return!!t.isHidden||e.isHidden},ye=function(e){return P(e.legalBasisList)?e.legalBasisList:[e.legalGround]},me=function(e){return e.nameOfProcessingCompany||e.processingCompany},Ce=function(e){return e.privacyPolicyURL||e.policyOfProcessorUrl},Ee=function(e){var t;return e.retentionPeriodDescription||(null===(t=e.retentionPeriodList)||void 0===t?void 0:t[0])||""},Te=function(e,t){return!!t.isEssential||e.defaultConsentStatus},be=function(e,t){var n;return P(e[t])?e[t]:(null===(n=e[t])||void 0===n?void 0:n.length)>0?[e[t]]:[]},Ae=function(e){return e.reduce((function(e,t){return t.type===N.DATA_LAYER?e.push({names:t.names,type:b.DATA_LAYER}):t.type===N.WINDOW_EVENT&&e.push({names:t.names,type:b.WINDOW_EVENT}),e}),[])},Le=["AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GR","HR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK"],Ne=function(){function e(){this.apiInstance=B.getInstance(),this.userCountry={}}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.resetInstance=function(){e.instance.userCountry={}},e.prototype.getUserCountry=function(){return p(this,void 0,void 0,(function(){var e;return g(this,(function(t){switch(t.label){case 0:return D(this.userCountry)?[3,2]:[4,this.apiInstance.fetchUserCountry()];case 1:e=t.sent(),this.userCountry=Fe(e),t.label=2;case 2:return[2,this.userCountry]}}))}))},e.prototype.getIsUserInEU=function(){return p(this,void 0,void 0,(function(){var e;return g(this,(function(t){switch(t.label){case 0:return[4,this.getUserCountry()];case 1:return e=t.sent(),[2,R(Le,e.code.toUpperCase())]}}))}))},e}(),Fe=function(e){return{code:e.countryCode,name:e.countryName}},we=function(){function e(){this.apiInstance=B.getInstance(),this.locationInstance=Ne.getInstance(),this.settings={}}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.resetInstance=function(){e.instance.settings={}},e.prototype.getBaseSettings=function(){return{controllerId:this.settings.controllerId,id:this.settings.id,isTcfEnabled:this.settings.isTcfEnabled,ui:this.settings.ui,version:this.settings.version}},e.prototype.getCategories=function(){return this.settings.categories},e.prototype.getCategoryBySlug=function(e){return this.getCategories().find((function(t){return t.slug===e}))},e.prototype.getControllerId=function(){return this.settings.controllerId},e.prototype.getDataExchangeSettings=function(){return this.settings.dataExchangeSettings},e.prototype.getEssentialCategories=function(){return this.getCategories().reduce((function(e,t){return t.isEssential&&e.push(t),e}),[])},e.prototype.getNonEssentialCategories=function(){return this.getCategories().reduce((function(e,t){return t.isEssential||e.push(t),e}),[])},e.prototype.getServices=function(){return this.getServicesFromCategories(this.getCategories())},e.prototype.getServicesByIds=function(e){return this.getServicesFromCategories(this.removeNoneCategory(this.getCategories())).reduce((function(t,n){return e.some((function(e){return e===n.id}))&&t.push(n),t}),[])},e.prototype.getServicesFromCategories=function(e){return e.reduce((function(e,t){return e.concat(t.services)}),[])},e.prototype.getServicesWithConsent=function(){return this.getServices().reduce((function(e,t){return t.consent.status&&e.push(t),e}),[])},e.prototype.getSettings=function(){return this.settings},e.prototype.getTCFPublisherCountryCode=function(){var e;return(null===(e=this.settings.tcf)||void 0===e?void 0:e.publisherCountryCode)||"DE"},e.prototype.getTCFPurposeOneTreatment=function(){var e;return!!(null===(e=this.settings.tcf)||void 0===e?void 0:e.purposeOneTreatment)},e.prototype.getTCFStackIds=function(){var e;return(null===(e=this.settings.tcf)||void 0===e?void 0:e.stackIds)||[]},e.prototype.getTCFVendorIds=function(){var e;return(null===(e=this.settings.tcf)||void 0===e?void 0:e.vendorIds)||[]},e.prototype.isTcfEnabled=function(){return this.settings.isTcfEnabled},e.prototype.setCategories=function(e){this.settings.categories=e},e.prototype.setSettings=function(e){this.settings=e},e.prototype.initSettings=function(){return p(this,void 0,void 0,(function(){var e,t;return g(this,(function(n){switch(n.label){case 0:return[4,this.apiInstance.fetchSettingsJson()];case 1:return e=n.sent(),e=d(d({},s=e),{consentTemplates:s.consentTemplates.reduce((function(e,t){return t.isDeactivated||e.push(t),e}),[])}),[4,this.fetchServices(e)];case 2:return t=n.sent(),this.setSettings(_e(function(e,t){return{acceptAllImplicitlyOutsideEU:e.displayOnlyForEU,categories:ne(e,t),controllerId:K(),dataExchangeSettings:Ae(e.dataExchangeOnPage),id:e.settingsId,isTcfEnabled:e.tcf2Enabled,showFirstLayerOnVersionChange:de(e.showInitialViewForVersionChange),tcf:ge(e),ui:fe(e),version:e.version}}(e,t))),[2]}var s}))}))},e.prototype.mergeServicesIntoExistingCategories=function(e){return this.getCategories().map((function(t){return d(d({},t),{services:t.services.map((function(t){var n=e.find((function(e){return e.id===t.id}));return null!=n?n:t}))})}))},e.prototype.removeNoneCategory=function(e){return e.reduce((function(e,t){return"none"!==t.slug&&e.push(t),e}),[])},e.prototype.shouldAcceptAllImplicitlyOnInit=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){return this.settings.acceptAllImplicitlyOutsideEU&&!this.settings.isTcfEnabled?[2,!this.locationInstance.getIsUserInEU()]:[2,!1]}))}))},e.prototype.shouldShowFirstLayerOnVersionChange=function(){var e=V.fetchSettingsVersion();if(e&&P(this.settings.showFirstLayerOnVersionChange)){var t=this.settings.version.split("."),n=e.split(".");return R(this.settings.showFirstLayerOnVersionChange,A.MAJOR)&&t[0]!==n[0]||R(this.settings.showFirstLayerOnVersionChange,A.MINOR)&&t[1]!==n[1]||R(this.settings.showFirstLayerOnVersionChange,A.PATCH)&&t[2]!==n[2]}return!1},e.prototype.updateServicesWithConsent=function(e,t){return e.map((function(e){return e.isEssential?e:d(d({},e),{consent:d(d({},e.consent),{status:t===T.TRUE})})}))},e.prototype.updateServicesWithConsents=function(e,t){return e.reduce((function(e,n){var s;if(!n.isEssential){var i=t.find((function(e){return e.serviceId===n.id}));s=d(d({},n),{consent:d(d({},n.consent),{status:i.status})})}return e.push(null!=s?s:n),e}),[])},e.prototype.fetchServices=function(e){return p(this,void 0,void 0,(function(){var t,i,r;return g(this,(function(o){switch(o.label){case 0:c=[],(a=e).consentTemplates.forEach((function(e){c.push(se(e,a)),e.subConsents.forEach((function(e){c.push(se(e,a))}))})),t=n(s(c,(function(e,t){return e.id===t.id&&e.version===t.version})),"id"),i=function(e){return""+Q(JSON.stringify(e))}(t),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.apiInstance.fetchServicesJson(i)];case 2:return[2,o.sent()];case 3:return o.sent(),[3,4];case 4:return[4,this.apiInstance.generateServicesJson(t)];case 5:return r=o.sent(),[2,this.apiInstance.fetchServicesJson(r)]}var a,c}))}))},e}(),_e=function(e){return d(d({},e),{categories:e.categories.reduce((function(e,t){return P(t.services)&&e.push(t),e}),[])})},Oe=function(){function e(){this.apiInstance=B.getInstance(),this.eventDispatcherInstance=J.getInstance(),this.settingsInstance=we.getInstance()}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.execute=function(e,t,n){return p(this,void 0,void 0,(function(){var s,i,r=this;return g(this,(function(o){switch(o.label){case 0:return s=e.map((function(e){return Ue(r.settingsInstance.getSettings(),e,t,n)})),i=Re(e,s),[4,this.apiInstance.saveConsents(s)];case 1:return o.sent(),this.settingsInstance.setCategories(this.settingsInstance.mergeServicesIntoExistingCategories(i)),V.saveSettings(V.mapSettings(this.settingsInstance.getSettings(),this.settingsInstance.getServices())),W.enableScriptsForServicesWithConsent(this.settingsInstance.getServicesWithConsent()),this.eventDispatcherInstance.dispatch(s),[2]}}))}))},e.prototype.getMergedServicesAndSettingsFromStorage=function(){var e=V.fetchSettings(),t=this.getMergedAndUpdatedEssentialServices(e),n=t.mergedEssentialServices,s=t.updatedEssentialServices,i=this.getMergedNonEssentialServices(e);return{mergedServices:n.concat(i),mergedSettings:d(d({},this.settingsInstance.getSettings()),{controllerId:e.controllerId}),updatedEssentialServices:s}},e.prototype.mergeSettingsFromStorage=function(){return p(this,void 0,void 0,(function(){var e,t,n,s,i,r,o,a=this;return g(this,(function(c){switch(c.label){case 0:return e=this.getMergedServicesAndSettingsFromStorage(),t=e.mergedServices,n=e.mergedSettings,s=e.updatedEssentialServices,P(s)?(i=s.map((function(e){return Ue(n,e,"onEssentialChange","implicit")})),r=Re(t,i),[4,this.apiInstance.saveConsents(i)]):[3,2];case 1:return c.sent(),this.settingsInstance.setSettings(d(d({},n),{categories:this.settingsInstance.mergeServicesIntoExistingCategories(r)})),[3,3];case 2:this.settingsInstance.setSettings(d(d({},n),{categories:this.settingsInstance.mergeServicesIntoExistingCategories(t)})),c.label=3;case 3:return o=t.map((function(e){return Ue(a.settingsInstance.getSettings(),e,"onInitialPageLoad","implicit")})),V.saveSettings(V.mapSettings(n,t)),W.enableScriptsForServicesWithConsent(this.settingsInstance.getServicesWithConsent()),this.eventDispatcherInstance.dispatch(o),[2]}}))}))},e.prototype.restoreUserSession=function(){return p(this,void 0,void 0,(function(){var e,t,n,s,i,r,o,a,c,u=this;return g(this,(function(l){switch(l.label){case 0:return this.apiInstance.getControllerId()?[4,this.apiInstance.fetchUserConsents()]:[3,4];case 1:return e=l.sent(),t=De(e),n=Ve(e),P(n)?(s=[],i=this.settingsInstance.getServices(),r=[],n.forEach((function(e){var t=i.findIndex((function(t){return t.id===e.templateId}));if(t>-1){var n=i[t],o=d(d({},n),{consent:d(d({},n.consent),{status:e.status})}),a=r.findIndex((function(e){return e.id===n.id}));-1===a?r.push(o):r[a]=o,i[t]=o,s.push(Ue(d(d({},u.settingsInstance.getSettings()),{controllerId:u.apiInstance.getControllerId(),version:e.settingsVersion}),o,e.action,e.updatedBy,{timestamp:1e3*parseInt(e.timestamp,10)}))}})),o=d(d({},this.settingsInstance.getSettings()),{controllerId:this.apiInstance.getControllerId(),version:n.slice(-1)[0].settingsVersion}),a=Re(i,s),this.apiInstance.getControllerId()===V.fetchControllerId()?[3,3]:(c=r.map((function(e){return Ue(o,e,"onSessionRestored","implicit",{referrerControllerId:u.settingsInstance.getControllerId()})})),[4,this.apiInstance.saveConsents(c)])):[3,4];case 2:l.sent(),l.label=3;case 3:return V.saveSettings(V.mapSettings(o,a)),P(t)&&V.setUserActionPerformed(),[2,!0];case 4:return[2,!1]}}))}))},e.prototype.getMergedAndUpdatedEssentialServices=function(e){var t=this.settingsInstance.getServicesFromCategories(this.settingsInstance.getEssentialCategories()),n=[];return{mergedEssentialServices:t.map((function(t){var s=e.services.find((function(e){return e.id===t.id}));if(s){var i=d(d({},t),{consent:d(d({},t.consent),{history:s.history,status:!0}),processorId:s.processorId});return s.status||n.push(i),i}return t})),updatedEssentialServices:n}},e.prototype.getMergedNonEssentialServices=function(e){return this.settingsInstance.getServicesFromCategories(this.settingsInstance.getNonEssentialCategories()).map((function(t){var n=e.services.find((function(e){return e.id===t.id}));return n?d(d({},t),{consent:d(d({},t.consent),{history:n.history,status:n.status}),processorId:n.processorId}):t}))},e}(),Ue=function(e,t,n,s,i){var r,o;return{applicationVersion:"SDK-0.5.2",consent:{action:n,status:t.consent.status,type:s},service:{id:t.id,name:t.name,processorId:t.processorId,version:t.version},settings:{controllerId:e.controllerId,id:e.id,language:e.ui.language.selected,referrerControllerId:null!==(r=null==i?void 0:i.referrerControllerId)&&void 0!==r?r:"",version:e.version},timestamp:null!==(o=null==i?void 0:i.timestamp)&&void 0!==o?o:(new Date).valueOf()}},Re=function(e,t){return e.map((function(e){var n=t.filter((function(t){return t.service.id===e.id}));return P(n)?d(d({},e),{consent:d(d({},e.consent),{history:f(e.consent.history,n.map((function(e){return Pe(e)})))})}):e}))},Pe=function(e){return{action:e.consent.action,language:e.settings.language,status:e.consent.status,timestamp:e.timestamp,type:e.consent.type,versions:{application:e.applicationVersion,service:e.service.version,settings:e.settings.version}}},De=function(e){return e.filter((function(e){return!j.includes(e.action)}))},Ve=function(e){return e.filter((function(e){return"onSessionRestored"!==e.action}))};!function(e){e.DEFAULT_BROWSER_LANGUAGE="Usercentrics: The language has been defaulted to the browser language.",e.DEFAULT_DOCUMENT_LANGUAGE="Usercentrics: The language has been defaulted to the document language.",e.DEFAULT_ENGLISH="Usercentrics: The language has been defaulted to English."}(z||(z={}));var Be,Me,ke,xe,Ge,He=function(){function e(){this.apiInstance=B.getInstance()}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.resolveLanguage=function(){return p(this,void 0,void 0,(function(){var e,t,n,s,i;return g(this,(function(r){switch(r.label){case 0:return[4,this.apiInstance.fetchAvailableLanguages()];case 1:return e=r.sent(),t=this.apiInstance.getJsonFileLanguage(),R(e,t)?[2]:(n=V.fetchLanguage(),R(e,n)?(this.apiInstance.setJsonFileLanguage(n),[2]):(s=Ye(e))?(console.warn(z.DEFAULT_DOCUMENT_LANGUAGE),this.apiInstance.setJsonFileLanguage(s),[2]):(i=Je(e))?(console.warn(z.DEFAULT_BROWSER_LANGUAGE),this.apiInstance.setJsonFileLanguage(i),[2]):(console.warn(z.DEFAULT_ENGLISH),this.apiInstance.setJsonFileLanguage("en"),[2]))}}))}))},e}(),Je=function(e){var t,n=window.navigator;if(P(n.languages))for(var s=0;s<n.languages.length;s+=1){var i=n.languages[s].slice(0,2);if(R(e,i))return i}var r=(null!==(t=n.language)&&void 0!==t?t:n.userLanguage).slice(0,2);return R(e,r)?r:null},Ye=function(e){var t=document.documentElement.lang;if(t){var n=t.slice(0,2);return R(e,n)?n:null}return null},je=function(){function e(){this.selectedVendorsIncludeNonDisclosed=!1,this.settingsInstance=we.getInstance(),this.cmpApi={},this.consensuCookieBridge={},this.tcModel={}}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.resetInstance=function(){e.instance.cmpApi={},e.instance.consensuCookieBridge={},e.instance.selectedVendorsIncludeNonDisclosed=!1,e.instance.tcModel={};var t=document.getElementById("uc-consensu-org-cookie-bridge");t&&t.remove()},e.prototype.init=function(){return p(this,void 0,void 0,(function(){var e,t,n,s,i,o;return g(this,(function(a){switch(a.label){case 0:return e=this.settingsInstance.getSettings().tcf,t=e.cmpId,n=e.cmpVersion,s=e.consensuScriptPath,i=e.consensuSubdomain,[4,this.initConsensuCookieBridge(i,s).catch((function(e){console.warn(e.message)}))];case 1:return a.sent(),[4,this.getGlobalTCString().catch((function(e){console.warn(e.message)}))];case 2:return o=a.sent()||V.fetchTCString()||"",[4,this.initTCModel(o,t,n)];case 3:return a.sent(),this.cmpApi=new r.CmpApi(t,n,!1),[2]}}))}))},e.prototype.acceptAllDisclosed=function(e){return p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return this.tcModel.setAllVendorConsents(),this.tcModel.setAllVendorLegitimateInterests(),this.tcModel.purposeConsents.set(this.getPurposeIdsFromVendorsAndStacks()),this.tcModel.purposeLegitimateInterests.set(this.getPurposeIdsFromVendorsAndStacks()),this.tcModel.specialFeatureOptins.set(this.getSpecialFeatureIdsFromVendorsAndStacks()),[4,this.updateTCString(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.changeLanguage=function(e){return p(this,void 0,void 0,(function(){var t,n;return g(this,(function(s){switch(s.label){case 0:return[4,(t=this.tcModel.gvl).changeLanguage(e)];case 1:return s.sent(),n=this.settingsInstance.getTCFVendorIds(),t.narrowVendorsTo(n),this.tcModel.gvl=t,[2]}}))}))},e.prototype.denyAllDisclosed=function(e){return p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return this.tcModel.unsetAllVendorConsents(),this.tcModel.unsetAllVendorLegitimateInterests(),this.tcModel.purposeConsents.unset(this.getPurposeIdsFromVendorsAndStacks()),this.tcModel.purposeLegitimateInterests.unset(this.getPurposeIdsFromVendorsAndStacks()),this.tcModel.specialFeatureOptins.unset(this.getSpecialFeatureIdsFromVendorsAndStacks()),[4,this.updateTCString(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.getStacks=function(){var e=this.tcModel.gvl;return this.settingsInstance.getTCFStackIds().map((function(t){var n=e.stacks[t];return{description:n.description,id:n.id,name:n.name,purposeIds:n.purposes,specialFeatureIds:n.specialFeatures}}))},e.prototype.getTCFData=function(){return{features:this.getFeaturesFromVendors(),purposes:this.getPurposesFromVendors(),specialFeatures:this.getSpecialFeaturesFromVendorsAndStacks(),specialPurposes:this.getSpecialPurposesFromVendors(),stacks:this.getStacks(),vendors:this.getVendors()}},e.prototype.getVendors=function(){var e=this;return Object.keys(this.tcModel.gvl.vendors).map((function(t){var n=e.tcModel.gvl,s=n.vendors[t];return{consent:e.tcModel.vendorConsents.has(s.id),features:s.features.map((function(e){return{id:e,name:n.features[e].name}})),flexiblePurposes:[],id:s.id,legitimateInterestConsent:e.tcModel.vendorLegitimateInterests.has(s.id),legitimateInterestPurposes:s.legIntPurposes.map((function(e){return{id:e,name:n.purposes[e].name}})),name:s.name,policyUrl:s.policyUrl,purposes:s.purposes.map((function(e){return{id:e,name:n.purposes[e].name}})),showConsentToggle:s.purposes.length>0,showLegitimateInterestConsentToggle:s.legIntPurposes.length>0,specialFeatures:s.specialFeatures.map((function(e){return{id:e,name:n.specialFeatures[e].name}})),specialPurposes:s.specialPurposes.map((function(e){return{id:e,name:n.specialPurposes[e].name}}))}}))},e.prototype.setUIAsClosed=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){return this.cmpApi.update(i.TCString.encode(this.tcModel),!1),[2]}))}))},e.prototype.setUIAsOpen=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){return this.cmpApi.update(i.TCString.encode(this.tcModel),!0),[2]}))}))},e.prototype.updateChoices=function(e,t){return p(this,void 0,void 0,(function(){return g(this,(function(n){switch(n.label){case 0:return e.purposes?[4,this.savePurposes(e.purposes)]:[3,2];case 1:n.sent(),n.label=2;case 2:return e.specialFeatures?[4,this.saveSpecialFeatures(e.specialFeatures)]:[3,4];case 3:n.sent(),n.label=4;case 4:return e.vendors?[4,this.saveVendors(e.vendors)]:[3,6];case 5:n.sent(),n.label=6;case 6:return e.purposes||e.specialFeatures||e.vendors?[4,this.updateTCString(t)]:[3,8];case 7:n.sent(),n.label=8;case 8:return[2]}}))}))},e.prototype.setSelectedVendorsIncludeNonDisclosed=function(e){var t=this;e.some((function(e){return!t.tcModel.vendorsDisclosed.has(e)}))&&(this.selectedVendorsIncludeNonDisclosed=!0)},e.prototype.getFeaturesFromVendors=function(){var e=this;return this.getFeatureIdsFromVendors().map((function(t){var n=e.tcModel.gvl.features[t];return{description:n.description,descriptionLegal:n.descriptionLegal,id:n.id,name:n.name}}))},e.prototype.getFeatureIdsFromVendors=function(){return o(this.getVendors().reduce((function(e,t){return e.concat(t.specialPurposes.map((function(e){return e.id})))}),[]))},e.prototype.getGlobalTCString=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){return[2,this.queryConsensuCookieBridge("getTCString")]}))}))},e.prototype.getPurposesFromVendors=function(){var e=this,t=this.getPurposeIdsFromVendorsAndStacks(),n=this.getStacks();return t.map((function(t){var s=e.tcModel.gvl.purposes[t],i=n.find((function(e){return e.purposeIds.includes(t)}));return{consent:e.tcModel.purposeConsents.has(t),description:s.description,descriptionLegal:s.descriptionLegal,id:s.id,isPartOfASelectedStack:!!i,legitimateInterestConsent:e.tcModel.purposeLegitimateInterests.has(t),name:s.name,showLegitimateInterestToggle:1!==s.id,stackId:(null==i?void 0:i.id)||null}}))},e.prototype.getPurposeIdsFromVendorsAndStacks=function(){var e=this.getVendors().reduce((function(e,t){return e.concat(t.purposes.map((function(e){return e.id}))).concat(t.legitimateInterestPurposes.map((function(e){return e.id})))}),[]),t=this.getStacks().reduce((function(e,t){return e.concat(t.purposeIds)}),[]);return o(e.concat(t))},e.prototype.getSpecialFeaturesFromVendorsAndStacks=function(){var e=this,t=this.getSpecialFeatureIdsFromVendorsAndStacks(),n=this.getStacks();return t.map((function(t){var s=e.tcModel.gvl.specialFeatures[t],i=n.find((function(e){return e.specialFeatureIds.includes(t)}));return{consent:e.tcModel.specialFeatureOptins.has(t),description:s.description,descriptionLegal:s.descriptionLegal,id:s.id,isPartOfASelectedStack:!!i,name:s.name,stackId:(null==i?void 0:i.id)||null}}))},e.prototype.getSpecialFeatureIdsFromVendorsAndStacks=function(){var e=this.getVendors().reduce((function(e,t){return e.concat(t.specialFeatures.map((function(e){return e.id})))}),[]),t=this.getStacks().reduce((function(e,t){return e.concat(t.specialFeatureIds)}),[]);return o(e.concat(t))},e.prototype.getSpecialPurposesFromVendors=function(){var e=this;return this.getSpecialPurposeIdsFromVendors().map((function(t){var n=e.tcModel.gvl.specialPurposes[t];return{description:n.description,descriptionLegal:n.descriptionLegal,id:n.id,name:n.name}}))},e.prototype.getSpecialPurposeIdsFromVendors=function(){return o(this.getVendors().reduce((function(e,t){return e.concat(t.specialPurposes.map((function(e){return e.id})))}),[]))},e.prototype.initConsensuCookieBridge=function(e,t){return p(this,void 0,void 0,(function(){var n=this;return g(this,(function(s){return[2,new Promise((function(s,i){var r=document.getElementById("uc-consensu-org-cookie-bridge");r&&r.remove(),n.consensuCookieBridge=document.createElement("iframe"),n.consensuCookieBridge.style.display="none",n.consensuCookieBridge.id="uc-consensu-org-cookie-bridge",n.consensuCookieBridge.src=""+e+t,n.consensuCookieBridge.onload=function(){return p(n,void 0,void 0,(function(){var e,t=this;return g(this,(function(n){return e=setTimeout((function(){t.consensuCookieBridge={},i(new Error("Cookie bridge iframe did not load"))}),1e3),this.queryConsensuCookieBridge("isCookieBridgeLoaded").then((function(){s()})).catch((function(e){i(e)})).finally((function(){clearTimeout(e)})),[2]}))}))},n.consensuCookieBridge.onerror=function(){return p(n,void 0,void 0,(function(){return g(this,(function(e){return i(new Error("Cookie bridge iframe error")),[2]}))}))},document.body.appendChild(n.consensuCookieBridge)}))]}))}))},e.prototype.initLegitimateInterestConsents=function(e){var t=this;e.forEach((function(n){t.tcModel.vendorsDisclosed.has(n)||t.tcModel.vendorLegitimateInterests.set(e)}));var n=o(e.reduce((function(e,n){return t.tcModel.vendorsDisclosed.has(n)?e.concat(t.tcModel.gvl.vendors[n].purposes).concat(t.tcModel.gvl.vendors[n].legIntPurposes):e}),[]));this.getPurposeIdsFromVendorsAndStacks().forEach((function(e){n.includes(e)||t.tcModel.purposeLegitimateInterests.set(e)}))},e.prototype.initTCModel=function(e,t,n){return p(this,void 0,void 0,(function(){var s,r,o=this;return g(this,(function(a){switch(a.label){case 0:if(s=this.settingsInstance.getTCFVendorIds(),i.GVL.baseUrl="https://api.usercentrics.eu/tcf2/",i.GVL.languageFilename="[LANG].json",i.GVL.latestFilename="en.json",r=new i.GVL,this.tcModel=new i.TCModel(r),e)try{this.tcModel=i.TCString.decode(e,this.tcModel),V.saveTCString(e)}catch(e){console.warn(e.message)}return this.tcModel.cmpId=t,this.tcModel.cmpVersion=n,this.tcModel.publisherCountryCode=this.settingsInstance.getTCFPublisherCountryCode(),this.tcModel.purposeOneTreatment=this.settingsInstance.getTCFPurposeOneTreatment(),[4,this.tcModel.gvl.readyPromise.then((function(){return p(o,void 0,void 0,(function(){return g(this,(function(e){switch(e.label){case 0:return[4,this.tcModel.gvl.changeLanguage(this.settingsInstance.getSettings().ui.language.selected)];case 1:return e.sent(),this.tcModel.gvl.narrowVendorsTo(s),this.initLegitimateInterestConsents(s),this.setSelectedVendorsIncludeNonDisclosed(s),this.tcModel.vendorsDisclosed.set(s),[2]}}))}))}))];case 1:return a.sent(),[2]}}))}))},e.prototype.queryConsensuCookieBridge=function(e,t){return p(this,void 0,void 0,(function(){var n=this;return g(this,(function(s){if(!this.consensuCookieBridge||!this.consensuCookieBridge.id)throw new Error("No consensu.org iframe-bridge exists.");return[2,new Promise((function(s,i){var r=new MessageChannel,o=n.settingsInstance.getSettings().tcf.consensuSubdomain,a=JSON.stringify({method:e,payload:t});r.port1.onmessage=function(e){var t=JSON.parse(e.data),n=t.success,r=t.data;n?s(r):i(new Error(r))},n.consensuCookieBridge&&n.consensuCookieBridge.contentWindow&&n.consensuCookieBridge.contentWindow.postMessage(a,o,[r.port2])}))]}))}))},e.prototype.savePurposes=function(e){return p(this,void 0,void 0,(function(){var t=this;return g(this,(function(n){return e.forEach((function(e){e.consent?t.tcModel.purposeConsents.set(e.id):t.tcModel.purposeConsents.unset(e.id),e.legitimateInterestConsent?t.tcModel.purposeLegitimateInterests.set(e.id):t.tcModel.purposeLegitimateInterests.unset(e.id)})),[2]}))}))},e.prototype.saveSpecialFeatures=function(e){return p(this,void 0,void 0,(function(){var t=this;return g(this,(function(n){return e.forEach((function(e){e.consent?t.tcModel.specialFeatureOptins.set(e.id):t.tcModel.specialFeatureOptins.unset(e.id)})),[2]}))}))},e.prototype.saveVendors=function(e){return p(this,void 0,void 0,(function(){var t=this;return g(this,(function(n){return e.forEach((function(e){e.consent?t.tcModel.vendorConsents.set(e.id):t.tcModel.vendorConsents.unset(e.id),e.legitimateInterestConsent?t.tcModel.vendorLegitimateInterests.set(e.id):t.tcModel.vendorLegitimateInterests.unset(e.id)})),[2]}))}))},e.prototype.setGlobalTCString=function(e){return p(this,void 0,void 0,(function(){return g(this,(function(t){return[2,this.queryConsensuCookieBridge("setTCString",e)]}))}))},e.prototype.updateTCString=function(e){return p(this,void 0,void 0,(function(){var t;return g(this,(function(n){switch(n.label){case 0:return this.tcModel.consentScreen=e,this.tcModel.updated(),t=i.TCString.encode(this.tcModel),[4,this.setGlobalTCString(t).catch((function(e){console.warn(e.message)}))];case 1:return n.sent(),this.cmpApi.update(t,!1),V.saveTCString(t),[2]}}))}))},e}();(Be=exports.CONSENT_ACTION||(exports.CONSENT_ACTION={})).ACCEPT_ALL_SERVICES="onAcceptAllServices",Be.DENY_ALL_SERVICES="onDenyAllServices",Be.ESSENTIAL_CHANGE="onEssentialChange",Be.INITIAL_PAGE_LOAD="onInitialPageLoad",Be.NON_EU_REGION="onNonEURegion",Be.SESSION_RESTORED="onSessionRestored",Be.UPDATE_SERVICES="onUpdateServices",(Me=exports.CONSENT_TYPE||(exports.CONSENT_TYPE={})).EXPLICIT="explicit",Me.IMPLICIT="implicit",(ke=exports.TCF_DECISION_UI_LAYER||(exports.TCF_DECISION_UI_LAYER={}))[ke.FIRST_LAYER=1]="FIRST_LAYER",ke[ke.SECOND_LAYER=2]="SECOND_LAYER",(xe=exports.UI_LAYER||(exports.UI_LAYER={}))[xe.FIRST_LAYER=0]="FIRST_LAYER",xe[xe.NONE=1]="NONE",xe[xe.PRIVACY_BUTTON=2]="PRIVACY_BUTTON",xe[xe.SECOND_LAYER=3]="SECOND_LAYER",(Ge=exports.UI_VARIANT||(exports.UI_VARIANT={}))[Ge.DEFAULT=0]="DEFAULT",Ge[Ge.TCF=1]="TCF";var We=function(){function e(e,t){this.apiInstance=B.getInstance(),this.dataFacadeInstance=Oe.getInstance(),this.eventDispatcherInstance=J.getInstance(),this.languageInstance=He.getInstance(),this.locationInstance=Ne.getInstance(),this.settingsInstance=we.getInstance(),this.tcfInstance=je.getInstance(),(null==t?void 0:t.createTcfApiStub)&&a(),qe(e),this.apiInstance.setSettingsId(e),(null==t?void 0:t.controllerId)&&this.apiInstance.setControllerId(t.controllerId),(null==t?void 0:t.language)&&this.apiInstance.setJsonFileLanguage(t.language),(null==t?void 0:t.settingsCache)&&this.apiInstance.setJsonCacheBustingString(t.settingsCache),(null==t?void 0:t.version)&&this.apiInstance.setJsonFileVersion(t.version)}return e.prototype.init=function(){return p(this,void 0,void 0,(function(){var e,t,n,s;return g(this,(function(i){switch(i.label){case 0:return V.clearOnNewSettingsId(this.apiInstance.getSettingsId()),[4,this.languageInstance.resolveLanguage()];case 1:return i.sent(),[4,this.settingsInstance.initSettings()];case 2:return i.sent(),this.settingsInstance.isTcfEnabled()?[4,this.tcfInstance.init()]:[3,4];case 3:i.sent(),i.label=4;case 4:return this.eventDispatcherInstance.init(this.settingsInstance.getDataExchangeSettings()),[4,this.dataFacadeInstance.restoreUserSession()];case 5:return i.sent(),e=!V.settingsExist(),[4,this.settingsInstance.shouldAcceptAllImplicitlyOnInit()];case 6:return t=i.sent(),n=this.settingsInstance.shouldShowFirstLayerOnVersionChange(),e?t?[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(this.settingsInstance.getServices(),T.TRUE),"onNonEURegion","implicit")]:[3,8]:[3,11];case 7:return i.sent(),[3,10];case 8:return[4,this.dataFacadeInstance.execute(this.settingsInstance.getServices(),"onInitialPageLoad","implicit")];case 9:i.sent(),i.label=10;case 10:return[3,13];case 11:return[4,this.dataFacadeInstance.mergeSettingsFromStorage()];case 12:i.sent(),i.label=13;case 13:return this.apiInstance.saveConsentsFromBuffer(),[4,this.resolveUIOptions(e,t,n)];case 14:return 1!==(s=i.sent()).variant?[3,18]:0!==s.initialLayer?[3,16]:[4,this.tcfInstance.setUIAsOpen()];case 15:return i.sent(),[3,18];case 16:return[4,this.tcfInstance.setUIAsClosed()];case 17:i.sent(),i.label=18;case 18:return[2,s]}}))}))},e.prototype.acceptAllForTCF=function(e){return p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return[4,this.tcfInstance.acceptAllDisclosed(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.acceptAllServices=function(e){return void 0===e&&(e="explicit"),p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(this.settingsInstance.getServices(),T.TRUE),"onAcceptAllServices",e)];case 1:return t.sent(),V.setUserActionPerformed(),[2]}}))}))},e.prototype.changeLanguage=function(e){return p(this,void 0,void 0,(function(){var t,n,s;return g(this,(function(i){switch(i.label){case 0:return this.shouldChangeLanguage(e)?(this.apiInstance.setJsonFileLanguage(e),[4,this.settingsInstance.initSettings()]):[3,3];case 1:return i.sent(),t=this.dataFacadeInstance.getMergedServicesAndSettingsFromStorage(),n=t.mergedServices,s=t.mergedSettings,this.settingsInstance.setSettings(d(d({},s),{categories:this.settingsInstance.mergeServicesIntoExistingCategories(n)})),V.saveSettings(V.mapSettings(s,n)),this.settingsInstance.isTcfEnabled()?[4,this.tcfInstance.changeLanguage(e)]:[3,3];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.denyAllForTCF=function(e){return p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return[4,this.tcfInstance.denyAllDisclosed(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.denyAllServices=function(e){return void 0===e&&(e="explicit"),p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(this.settingsInstance.getServices(),T.FALSE),"onDenyAllServices",e)];case 1:return t.sent(),V.setUserActionPerformed(),[2]}}))}))},e.prototype.fetchIsUserInEU=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){return[2,this.locationInstance.getIsUserInEU()]}))}))},e.prototype.fetchUserCountry=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){return[2,this.locationInstance.getUserCountry()]}))}))},e.prototype.getCategories=function(){return this.settingsInstance.removeNoneCategory(this.settingsInstance.getCategories())},e.prototype.getControllerId=function(){return this.settingsInstance.getControllerId()},e.prototype.getServices=function(){return this.settingsInstance.getServicesFromCategories(this.getCategories())},e.prototype.getSettings=function(){return this.settingsInstance.getBaseSettings()},e.prototype.getTCFData=function(){return this.tcfInstance.getTCFData()},e.prototype.setTCFUIAsClosed=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){switch(e.label){case 0:return[4,this.tcfInstance.setUIAsClosed()];case 1:return e.sent(),[2]}}))}))},e.prototype.setTCFUIAsOpen=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){switch(e.label){case 0:return[4,this.tcfInstance.setUIAsOpen()];case 1:return e.sent(),[2]}}))}))},e.prototype.updateChoicesForTCF=function(e,t){return p(this,void 0,void 0,(function(){return g(this,(function(n){switch(n.label){case 0:return[4,this.tcfInstance.updateChoices(e,t)];case 1:return n.sent(),[2]}}))}))},e.prototype.restoreUserSession=function(e){return p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return this.apiInstance.setControllerId(e),[4,this.dataFacadeInstance.restoreUserSession()];case 1:return t.sent()?[4,this.dataFacadeInstance.mergeSettingsFromStorage()]:[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},e.prototype.updateServices=function(e,t){return void 0===t&&(t="explicit"),p(this,void 0,void 0,(function(){var n,s;return g(this,(function(i){switch(i.label){case 0:return n=this.settingsInstance.getServicesByIds(e.map((function(e){return e.serviceId}))),s=this.settingsInstance.updateServicesWithConsents(n,e),P(s)?[4,this.dataFacadeInstance.execute(s,"onUpdateServices",t)]:[3,2];case 1:i.sent(),i.label=2;case 2:return V.setUserActionPerformed(),[2]}}))}))},e.prototype.resolveUIOptions=function(e,t,n){return p(this,void 0,void 0,(function(){return g(this,(function(s){return t?[2,{initialLayer:1,variant:this.settingsInstance.isTcfEnabled()?1:0}]:e||!V.fetchUserActionPerformed()||n||this.settingsInstance.isTcfEnabled()&&this.tcfInstance.selectedVendorsIncludeNonDisclosed?[2,{initialLayer:0,variant:this.settingsInstance.isTcfEnabled()?1:0}]:this.settingsInstance.getBaseSettings().ui.privacyButton.isEnabled?[2,{initialLayer:2,variant:this.settingsInstance.isTcfEnabled()?1:0}]:[2,{initialLayer:1,variant:this.settingsInstance.isTcfEnabled()?1:0}]}))}))},e.prototype.shouldChangeLanguage=function(e){return e!==this.apiInstance.getJsonFileLanguage()&&this.settingsInstance.getBaseSettings().ui.language.available.some((function(t){return e===t}))},e}(),qe=function(e){(new Image).src="https://app.usercentrics.eu/session/1px.png?settingsId="+e};exports.Usercentrics=We,exports.default=We; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("uuid"),n=e(require("lodash/sortBy")),s=e(require("lodash/uniqWith")),i=require("@iabtcf/core"),r=require("@iabtcf/cmpapi"),o=e(require("lodash/uniq")),a=e(require("@iabtcf/stub"));function c(e){return(c="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)}var u,l,d=function(){return(d=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function p(e,t,n,s){return new(n||(n=Promise))((function(i,r){function o(e){try{c(s.next(e))}catch(e){r(e)}}function a(e){try{c(s.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))}function g(e,t){var n,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=t.call(e,o)}catch(e){r=[6,e],s=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function f(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var s=Array(e),i=0;for(t=0;t<n;t++)for(var r=arguments[t],o=0,a=r.length;o<a;o++,i++)s[i]=r[o];return s}!function(e){e.AVAILABLE_LANGUAGES_NOT_FOUND="Unable to find available languages using given settingsId and version.",e.FETCH_AVAILABLE_LANGUAGES="Something went wrong while fetching the available languages.",e.FETCH_DATA_PROCESSING_SERVICES="Something went wrong while fetching the data processing services.",e.FETCH_SETTINGS="Something went wrong while fetching the settings.",e.FETCH_USER_CONSENTS="Something went wrong while fetching the user's consents.",e.FETCH_USER_COUNTRY="Something went wrong while fetching the user's country.",e.GENERATE_DATA_PROCESSING_SERVICES="Something went wrong while generating the data processing services.",e.SAVE_CONSENTS="Something went wrong while saving user consents.",e.SETTINGS_NOT_FOUND="Unable to find settings using given settingsId and version."}(u||(u={})),function(e){e.AGGREGATOR="https://consent-templates-batch-generation.usercentrics.eu",e.CDN="https://api.usercentrics.eu",e.FETCH_CONSENTS="https://api-consent-prod-dot-staticfilesserver.ey.r.appspot.com/consentsHistory",e.GRAPHQL="https://graphql.usercentrics.eu/graphql"}(l||(l={}));var h;!function(e){e[e.RESOURCE_NOT_FOUND=403]="RESOURCE_NOT_FOUND",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT"}(h||(h={}));var v,I=function(e,t){return p(void 0,void 0,void 0,(function(){return g(this,(function(n){return[2,y(e,t)]}))}))},S=function(e,t,n,s){return p(void 0,void 0,void 0,(function(){return g(this,(function(i){return[2,y(e,n,t,s)]}))}))},y=function(e,t,n,s){return p(void 0,void 0,void 0,(function(){var i,r,o;return g(this,(function(a){return i={"content-type":"application/json"},r=d(d({},s),{headers:i,method:n?"POST":"GET"}),n&&(r.body=JSON.stringify(n)),(null==s?void 0:s.headers)&&(r.headers=d(d({},i),s.headers)),[2,Promise.race([fetch(e,r).then((function(e){return p(void 0,void 0,void 0,(function(){return g(this,(function(n){if(e.ok)return[2,C(e)];throw m(t,e.status)}))}))})),new Promise((function(e,n){o=setTimeout((function(){n(m(t,h.REQUEST_TIMEOUT))}),15e3)}))]).finally((function(){clearTimeout(o)}))]}))}))},m=function(e,t){return{errorMessage:e,statusCode:t}},C=function(e){return p(void 0,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return[4,E(e)];case 1:return[2,{data:t.sent(),statusCode:e.status}]}}))}))},E=function(e){return p(void 0,void 0,void 0,(function(){var t,n;return g(this,(function(s){switch(s.label){case 0:return[4,e.json()];case 1:return t=s.sent(),[2,null!==(n=t.data)&&void 0!==n?n:t]}}))}))};!function(e){e.CONSENTS_BUFFER="uc_consents_buffer",e.SETTINGS="uc_settings",e.TC_STRING="uc_tc_string",e.USER_INTERACTION="uc_user_interaction"}(v||(v={}));var T,b,A,L,N,F,w,_,O,U,R=function(e,t){return-1!==e.indexOf(t)},P=function(e){return Array.isArray(e)&&e.length>0},D=function(e){return"object"===c(e)&&null!==e&&Object.keys(e).length>0},V=function(){function e(){}return e.appendToConsentsBuffer=function(t){var n=e.fetchConsentsBuffer();localStorage.setItem(v.CONSENTS_BUFFER,JSON.stringify({consents:n.consents?n.consents.concat(t):t,timestamp:(new Date).valueOf()}))},e.clearOnNewSettingsId=function(t){t!==e.fetchSettingsId()&&e.clear()},e.clearConsentsBuffer=function(){localStorage.removeItem(v.CONSENTS_BUFFER)},e.fetchConsentsBuffer=function(){var e=localStorage.getItem(v.CONSENTS_BUFFER);return e?JSON.parse(e):{}},e.fetchControllerId=function(){return e.fetchSettings().controllerId},e.fetchLanguage=function(){return e.fetchSettings().language},e.fetchServices=function(){return e.fetchSettings().services},e.fetchSettings=function(){var e=localStorage.getItem(v.SETTINGS);return e?JSON.parse(e):{}},e.fetchSettingsId=function(){return e.fetchSettings().id},e.fetchSettingsVersion=function(){return e.fetchSettings().version},e.fetchTCString=function(){var e=localStorage.getItem(v.TC_STRING);return JSON.parse(null!=e?e:'""')},e.fetchUserActionPerformed=function(){return null!==localStorage.getItem(v.USER_INTERACTION)},e.mapServices=function(e){return e.map((function(e){return{history:e.consent.history,id:e.id,processorId:e.processorId,status:e.consent.status}}))},e.mapSettings=function(t,n){return{controllerId:t.controllerId,id:t.id,language:t.ui.language.selected,services:e.mapServices(n),version:t.version}},e.saveSettings=function(e){localStorage.setItem(v.SETTINGS,JSON.stringify(e))},e.saveTCString=function(e){localStorage.setItem(v.TC_STRING,JSON.stringify(e))},e.settingsExist=function(){return D(e.fetchSettings())},e.setUserActionPerformed=function(){localStorage.setItem(v.USER_INTERACTION,JSON.stringify(!0))},e.clear=function(){localStorage.removeItem(v.SETTINGS),localStorage.removeItem(v.USER_INTERACTION)},e}(),B=function(){function e(){this.controllerId="",this.jsonCacheBustingString="",this.jsonFileLanguage="",this.jsonFileVersion="latest",this.saveConsentsTimeout=null,this.settingsId=""}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.resetInstance=function(){e.instance.controllerId="",e.instance.jsonCacheBustingString="",e.instance.jsonFileLanguage="",e.instance.jsonFileVersion="latest",e.instance.saveConsentsTimeout=null,e.instance.settingsId=""},e.prototype.getControllerId=function(){return this.controllerId},e.prototype.getJsonFileLanguage=function(){return this.jsonFileLanguage},e.prototype.getJsonFileVersion=function(){return this.jsonFileVersion},e.prototype.getSettingsId=function(){return this.settingsId},e.prototype.setControllerId=function(e){this.controllerId=e},e.prototype.setJsonCacheBustingString=function(e){this.jsonCacheBustingString=e},e.prototype.setJsonFileLanguage=function(e){this.jsonFileLanguage=e},e.prototype.setJsonFileVersion=function(e){this.jsonFileVersion=e},e.prototype.setSettingsId=function(e){this.settingsId=e},e.prototype.fetchAvailableLanguages=function(){return p(this,void 0,void 0,(function(){var e,t;return g(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=this.createLanguagesJsonUrl(),[4,I(e,u.FETCH_AVAILABLE_LANGUAGES)];case 1:return[2,n.sent().data.languagesAvailable];case 2:throw(t=n.sent()).statusCode===h.RESOURCE_NOT_FOUND&&(t.errorMessage=u.AVAILABLE_LANGUAGES_NOT_FOUND),t;case 3:return[2]}}))}))},e.prototype.fetchServicesJson=function(e){return p(this,void 0,void 0,(function(){var t;return g(this,(function(n){switch(n.label){case 0:return t=this.createServicesJsonUrl(e),[4,I(t,u.FETCH_DATA_PROCESSING_SERVICES)];case 1:return[2,n.sent().data]}}))}))},e.prototype.fetchSettingsJson=function(){return p(this,void 0,void 0,(function(){var e,t;return g(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=this.createSettingsJsonUrl(),[4,I(e,u.FETCH_SETTINGS)];case 1:return[2,n.sent().data];case 2:throw(t=n.sent()).statusCode===h.RESOURCE_NOT_FOUND&&(t.errorMessage=u.SETTINGS_NOT_FOUND),t;case 3:return[2]}}))}))},e.prototype.fetchUserConsents=function(){return p(this,void 0,void 0,(function(){var e;return g(this,(function(t){switch(t.label){case 0:return e=this.createFetchUserConsentsUrl(),[4,I(e,u.FETCH_USER_CONSENTS)];case 1:return[2,t.sent().data.reverse()]}}))}))},e.prototype.fetchUserCountry=function(){return p(this,void 0,void 0,(function(){var e,t;return g(this,(function(n){switch(n.label){case 0:return e=M(),t=k(),[4,S(l.GRAPHQL,e,u.FETCH_USER_COUNTRY,t)];case 1:return[2,n.sent().data.clientLocation]}}))}))},e.prototype.generateServicesJson=function(e){return p(this,void 0,void 0,(function(){var t;return g(this,(function(n){switch(n.label){case 0:return t={request:e},[4,S(l.AGGREGATOR,t,u.GENERATE_DATA_PROCESSING_SERVICES)];case 1:return[2,n.sent().data.fileName]}}))}))},e.prototype.saveConsents=function(e){return p(this,void 0,void 0,(function(){var t,n,s;return g(this,(function(i){switch(i.label){case 0:t=G(e),n=k(),s=x(t),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,S(l.GRAPHQL,s,u.SAVE_CONSENTS,n)];case 2:return i.sent(),[3,4];case 3:return i.sent(),V.appendToConsentsBuffer(t),this.saveConsentsFromBuffer(),[3,4];case 4:return[2]}}))}))},e.prototype.saveConsentsFromBuffer=function(){var e=this,t=V.fetchConsentsBuffer();if(this.saveConsentsTimeout&&clearTimeout(this.saveConsentsTimeout),D(t)){var n=t.timestamp-(new Date).valueOf()+3e5;this.saveConsentsTimeout=setTimeout((function(){return p(e,void 0,void 0,(function(){var e,n;return g(this,(function(s){switch(s.label){case 0:e=k(),n=x(t.consents),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,S(l.GRAPHQL,n,u.SAVE_CONSENTS,e)];case 2:return s.sent(),V.clearConsentsBuffer(),[3,4];case 3:return s.sent(),V.clearConsentsBuffer(),V.appendToConsentsBuffer(t.consents),this.saveConsentsFromBuffer(),[3,4];case 4:return[2]}}))}))}),n>0?n:0)}},e.prototype.addJsonCacheBustingString=function(e){return this.jsonCacheBustingString?e+"?c="+this.jsonCacheBustingString:e},e.prototype.createLanguagesJsonUrl=function(){return this.addJsonCacheBustingString(l.CDN+"/settings/"+this.settingsId+"/"+this.jsonFileVersion+"/languages.json")},e.prototype.createServicesJsonUrl=function(e){return l.CDN+"/consent-templates/"+e+".json"},e.prototype.createSettingsJsonUrl=function(){return this.addJsonCacheBustingString(l.CDN+"/settings/"+this.settingsId+"/"+this.jsonFileVersion+"/"+this.jsonFileLanguage+".json")},e.prototype.createFetchUserConsentsUrl=function(){return l.FETCH_CONSENTS+"?controllerId="+this.controllerId},e}(),M=function(){return{query:"{ clientLocation { countryCode countryName } }"}},k=function(){return{credentials:"omit",headers:{Accept:"application/json","Access-Control-Allow-Origin":"*","X-Request-ID":t.v4()},mode:"cors"}},x=function(e){return{query:"mutation saveConsents($consents: [NewCreateConsentInput]) { saveConsents(consents: $consents) { data { consentId } } }",variables:{consents:e}}},G=function(e){return e.map((function(e){return{action:e.consent.action,appVersion:e.applicationVersion,consentStatus:e.consent.status?"1":"0",consentTemplateId:e.service.id,consentTemplateVersion:e.service.version,controllerId:e.settings.controllerId,language:e.settings.language,processorId:e.service.processorId,referrerControllerId:e.settings.referrerControllerId,settingsId:e.settings.id,settingsVersion:e.settings.version,updatedBy:e.consent.type}}))};!function(e){e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE"}(T||(T={})),function(e){e[e.DATA_LAYER=0]="DATA_LAYER",e[e.WINDOW_EVENT=1]="WINDOW_EVENT"}(b||(b={})),function(e){e[e.MAJOR=0]="MAJOR",e[e.MINOR=1]="MINOR",e[e.PATCH=2]="PATCH"}(A||(A={})),function(e){e[e.FIRST_LAYER=1]="FIRST_LAYER",e[e.SECOND_LAYER=3]="SECOND_LAYER"}(L||(L={})),function(e){e[e.DATA_LAYER=1]="DATA_LAYER",e[e.WINDOW_EVENT=4]="WINDOW_EVENT"}(N||(N={})),function(e){e.DATA_COLLECTED_LIST="dataCollectedList",e.DATA_PURPOSES_LIST="dataPurposesList",e.DATA_RECIPIENTS_LIST="dataRecipientsList",e.TECHNOLOGY_USED="technologyUsed"}(F||(F={})),function(e){e.MAJOR="major",e.MINOR="minor",e.PATCH="patch"}(w||(w={})),(_=exports.FIRST_LAYER_VARIANT||(exports.FIRST_LAYER_VARIANT={}))[_.BANNER=0]="BANNER",_[_.WALL=1]="WALL",(O=exports.SECOND_LAYER_VARIANT||(exports.SECOND_LAYER_VARIANT={}))[O.CENTER=0]="CENTER",O[O.SIDE=1]="SIDE",(U=exports.THEME||(exports.THEME={}))[U.DARK=0]="DARK",U[U.LIGHT=1]="LIGHT";var H,J=function(){function e(){this.dataLayerNames=[],this.windowEventNames=[]}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.resetInstance=function(){e.instance.dataLayerNames=[],e.instance.windowEventNames=[]},e.prototype.init=function(e){var t=this;e.forEach((function(e){var n,s;e.type===b.DATA_LAYER?t.dataLayerNames=null!==(n=e.names)&&void 0!==n?n:[]:e.type===b.WINDOW_EVENT&&(t.windowEventNames=null!==(s=e.names)&&void 0!==s?s:[])}))},e.prototype.dispatch=function(e){P(e)&&(this.pushEventsToDataLayer(e),this.dispatchWindowEvents(e))},e.prototype.pushEventsToDataLayer=function(e){if(P(this.dataLayerNames)){var t=Y(e),n="explicit"===e[0].consent.type;this.dataLayerNames.forEach((function(s){var i;if(window[s]=null!==(i=window[s])&&void 0!==i?i:[],!Array.isArray(window[s]))throw Error("DataLayer: "+s+" is not of type Array!");window[s].push(t),n&&e.forEach((function(e){e.consent.status||window[s].push({event:e.service.name+" EXPLICIT_DENY"})}))}))}},e.prototype.dispatchWindowEvents=function(e){if(P(this.windowEventNames)){var t=Y(e);this.windowEventNames.forEach((function(e){var n=new window.CustomEvent(e,{detail:t});window.dispatchEvent(n)}))}},e}(),Y=function(e){var t={event:"consent_status",type:e[0].consent.type};return e.forEach((function(e){var n;t=d(d({},t),((n={})[e.service.name]=e.consent.status,n))})),t},j=["onEssentialChange","onInitialPageLoad","onNonEURegion","onSessionRestored"];!function(e){e.TEXT_JAVASCRIPT="text/javascript",e.TEXT_PLAIN="text/plain"}(H||(H={}));var W=function(){function e(){}return e.enableScriptsForServicesWithConsent=function(t){var n=e.getDisabledScripts();Array.prototype.forEach.call(n,(function(n){e.disabledScriptHasConsent(t,n)&&e.enableScript(n)}))},e.getDisabledScripts=function(){return document.querySelectorAll('script[data-usercentrics][type="'+H.TEXT_PLAIN+'"]')},e.disabledScriptHasConsent=function(e,t){return e.some((function(e){return e.name===t.getAttribute("data-usercentrics")}))},e.enableScript=function(t){var n,s,i,r=t.src?e.createSrcScriptTag(t):e.createInlineScriptTag(t);s=r,(i=(n=t).parentNode)&&i.replaceChild(s,n)},e.createSrcScriptTag=function(t){var n=e.cloneScriptTag(t);return n.removeAttribute("data-usercentrics"),n.type=H.TEXT_JAVASCRIPT,n},e.createInlineScriptTag=function(t){var n=e.cloneScriptTag(t);n.removeAttribute("data-usercentrics");var s=document.createTextNode(t.text);return n.appendChild(s),n.type=H.TEXT_JAVASCRIPT,n},e.cloneScriptTag=function(e){var t=document.createElement("script");return Array.from(e.attributes).forEach((function(e){t.setAttribute(e.name,e.value)})),t},e}();"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function q(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var z,X=q((function(e,t){var n;e.exports=(n=n||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},i=s.lib={},r=i.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,s=this.sigBytes,i=e.sigBytes;if(this.clamp(),s%4)for(var r=0;r<i;r++){var o=n[r>>>2]>>>24-r%4*8&255;t[s+r>>>2]|=o<<24-(s+r)%4*8}else for(r=0;r<i;r+=4)t[s+r>>>2]=n[r>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=r.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,s=[],i=function(t){t=t;var n=987654321,s=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&s)<<16)+(t=18e3*(65535&t)+(t>>16)&s)&s;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},r=0;r<t;r+=4){var a=i(4294967296*(n||e.random()));n=987654071*a(),s.push(4294967296*a()|0)}return new o.init(s,t)}}),a=s.enc={},c=a.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,s=[],i=0;i<n;i++){var r=t[i>>>2]>>>24-i%4*8&255;s.push((r>>>4).toString(16)),s.push((15&r).toString(16))}return s.join("")},parse:function(e){for(var t=e.length,n=[],s=0;s<t;s+=2)n[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new o.init(n,t/2)}},u=a.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,s=[],i=0;i<n;i++){var r=t[i>>>2]>>>24-i%4*8&255;s.push(String.fromCharCode(r))}return s.join("")},parse:function(e){for(var t=e.length,n=[],s=0;s<t;s++)n[s>>>2]|=(255&e.charCodeAt(s))<<24-s%4*8;return new o.init(n,t)}},l=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,s=n.words,i=n.sigBytes,r=this.blockSize,a=i/(4*r),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*r,u=e.min(4*c,i);if(c){for(var l=0;l<c;l+=r)this._doProcessBlock(s,l);var d=s.splice(0,c);n.sigBytes-=u}return new o.init(d,u)},clone:function(){var e=r.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=(i.Hasher=d.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new p.HMAC.init(e,n).finalize(t)}}}),s.algo={});return s}(Math),n)})),Q=q((function(e,t){var n;e.exports=(n=X,function(e){var t=n,s=t.lib,i=s.WordArray,r=s.Hasher,o=t.algo,a=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),s=2;s<=n;s++)if(!(t%s))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var s=2,i=0;i<64;)t(s)&&(i<8&&(a[i]=n(e.pow(s,.5))),c[i]=n(e.pow(s,1/3)),i++),s++}();var u=[],l=o.SHA256=r.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,s=n[0],i=n[1],r=n[2],o=n[3],a=n[4],l=n[5],d=n[6],p=n[7],g=0;g<64;g++){if(g<16)u[g]=0|e[t+g];else{var f=u[g-15],h=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,v=u[g-2],I=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[g]=h+u[g-7]+I+u[g-16]}var S=s&i^s&r^i&r,y=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),m=p+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&d)+c[g]+u[g];p=d,d=l,l=a,a=o+m|0,o=r,r=i,i=s,s=m+(y+S)|0}n[0]=n[0]+s|0,n[1]=n[1]+i|0,n[2]=n[2]+r|0,n[3]=n[3]+o|0,n[4]=n[4]+a|0,n[5]=n[5]+l|0,n[6]=n[6]+d|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,s=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(s/4294967296),n[15+(i+64>>>9<<4)]=s,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(l),t.HmacSHA256=r._createHmacHelper(l)}(Math),n.SHA256)})),K=function(){return""+Q(t.v4())},$=function(e){var t=e.backgroundOverlay.find((function(e){var t;return(null===(t=e.target)||void 0===t?void 0:t[0])===L.FIRST_LAYER}));return!!t&&(null==t?void 0:t.darken)>0},Z=function(e){var t=e.backgroundOverlay.find((function(e){var t;return(null===(t=e.target)||void 0===t?void 0:t[0])===L.SECOND_LAYER}));return!!t&&(null==t?void 0:t.darken)>0},ee=function(e,t){var n=function(e,t){return t.find((function(t){return e.templateId===t.templateId&&e.version===t.version}))}(e,t);return{dataCollected:be(n,F.DATA_COLLECTED_LIST),dataDistribution:{processingLocation:n.locationOfProcessing,thirdPartyCountries:n.thirdCountryTransfer},dataPurposes:ve(n),dataRecipients:be(n,F.DATA_RECIPIENTS_LIST),description:Ie(e,n),id:e.templateId,language:{available:n.languagesAvailable,selected:n.language},legalBasis:ye(n),name:he(n),processingCompany:{address:n.addressOfProcessingCompany,dataProtectionOfficer:n.dataProtectionOfficer,name:me(n)},retentionPeriodDescription:Ee(n),technologiesUsed:be(n,F.TECHNOLOGY_USED),urls:{cookiePolicy:n.cookiePolicyURL,dataProcessingAgreement:n.linkToDpa,optOut:n.optOutUrl,privacyPolicy:Ce(n)},version:e.version}},te=function(e){var t,n,s,i,r,o,a,c,u,l;return{color:{primary:(null===(n=null===(t=e.customization)||void 0===t?void 0:t.color)||void 0===n?void 0:n.primary)?"#"+e.customization.color.primary:"#0045A5"},font:{family:null!==(r=null===(i=null===(s=e.customization)||void 0===s?void 0:s.font)||void 0===i?void 0:i.family)&&void 0!==r?r:"",size:null!==(c=null===(a=null===(o=e.customization)||void 0===o?void 0:o.font)||void 0===a?void 0:a.size)&&void 0!==c?c:14},logoUrl:null!==(l=null===(u=e.customization)||void 0===u?void 0:u.logoUrl)&&void 0!==l?l:null,theme:1}},ne=function(e,t){var n={categorySlug:"none",description:"",isEssential:!1,isHidden:!0,label:""};return Array.prototype.concat(e.categories.map((function(n){return{description:n.description,isEssential:n.isEssential,isHidden:n.isHidden,label:n.label,services:ue(e,t,n),slug:n.categorySlug}})),[d(d({},n),{services:ue(e,t,n),slug:"none"})])},se=function(e,t){return{id:e.templateId,version:e.version,language:t.language}},ie=function(e){return{general:{consentGiven:e.labels.accepted,consentNotGiven:e.labels.denied,consentType:"Consent type",controllerId:"Controller ID",copy:e.labels.copy,date:e.labels.date,decision:"Decision",explicit:"Explicit",implicit:"Implicit",processorId:"Processor ID",showMore:"Show more"},service:{dataCollected:{description:e.labels.dataCollectedInfo,title:e.labels.dataCollectedList},dataDistribution:{processingLocationTitle:e.labels.locationOfProcessing,thirdPartyCountriesTitle:e.labels.transferToThirdCountries},dataPurposes:{description:e.labels.dataPurposesInfo,title:e.labels.dataPurposes},dataRecipientsTitle:e.labels.dataRecipientsList,descriptionTitle:e.labels.descriptionOfService,history:{description:null,title:e.labels.history},legalBasis:{description:e.labels.legalBasisInfo,title:e.labels.legalBasisList},processingCompanyTitle:e.labels.processingCompanyTitle,retentionPeriodTitle:e.labels.retentionPeriod,technologiesUsed:{description:e.labels.technologiesUsedInfo,title:e.labels.technologiesUsed},urls:{cookiePolicyTitle:e.labels.cookiePolicyInfo,optOutTitle:e.labels.optOut,privacyPolicyTitle:e.labels.policyOf}}}},re=function(e){return{available:e.languagesAvailable,isSelectorEnabled:e.showLanguageDropdown,selected:e.language}},oe=function(e){var t;return{cookiePolicy:{label:null!==(t=e.labels.cookiePolicyLinkText)&&void 0!==t?t:"",url:e.cookiePolicyUrl},imprint:{label:e.labels.imprintLinkText||null,url:e.imprintUrl||null},privacyPolicy:{label:e.labels.privacyPolicyLinkText,url:e.privacyPolicyUrl||null}}},ae=function(e){return{iconUrl:e.buttonPrivacyOpenIconUrl||null,isEnabled:e.privacyButtonIsVisible,position:e.buttonDisplayLocation||"bl"}},ce=function(e){return{isEnabled:e.enablePoweredBy,label:"Powered by",partnerUrl:e.partnerPoweredByUrl||null,partnerUrlLabel:e.labels.partnerPoweredByLinkText||null,url:"https://www.usercentrics.com/",urlLabel:"Usercentrics Consent Management"}},ue=function(e,t,n){return e.consentTemplates.reduce((function(e,s){return s.categorySlug===n.categorySlug&&e.push(le(s,t,n)),e}),[])},le=function(e,t,n){return d(d({},ee(e,t)),{categorySlug:e.categorySlug,consent:{history:[],status:Te(e,n)},isEssential:n.isEssential,isHidden:Se(e,n),processorId:K(),subServices:pe(e.subConsents,t)})},de=function(e){return e.map((function(e){switch(e){case w.MAJOR:return A.MAJOR;case w.MINOR:return A.MINOR;case w.PATCH:return A.PATCH}}))},pe=function(e,t){return e.reduce((function(e,n){return e.push(ee(n,t)),e}),[])},ge=function(e){var t;return{cmpId:e.tcf2.cmpId||5,cmpVersion:e.tcf2.cmpVersion||parseInt("3",10),consensuScriptPath:e.tcf2.consensuScriptPath||"/browser-sdk/0.5.3/cookie-bridge.html",consensuSubdomain:e.tcf2.consensuDomain||"https://usercentrics.mgr.consensu.org:443",gdprApplies:null===(t=e.tcf2.gdprApplies)||void 0===t||t,publisherCountryCode:e.tcf2.publisherCountryCode,purposeOneTreatment:e.tcf2.purposeOneTreatment,stackIds:e.tcf2.selectedStacks,vendorIds:e.tcf2.selectedVendorIds}},fe=function(e){return e.tcf2Enabled?function(e){return{buttons:{acceptAll:{label:e.tcf2.buttonsAcceptAllLabel},denyAll:{isEnabled:e.tcf2.buttonsDenyAllIsEnabled,label:e.tcf2.buttonsDenyAllLabel},manageSettings:{label:e.tcf2.linksManageSettingsLabel},save:{label:e.tcf2.buttonsSaveLabel},showVendorTab:{label:e.tcf2.linksVendorListLinkLabel}},customization:te(e),firstLayer:{description:{additionalInfo:e.tcf2.firstLayerAdditionalInfo||null,default:e.tcf2.firstLayerDescription},hideToggles:e.tcf2.firstLayerHideToggles,isOverlayEnabled:$(e),title:e.tcf2.firstLayerTitle},isEmbeddingsEnabled:!0,labels:{general:{disclaimer:e.tcf2.labelsDisclaimer,features:e.tcf2.labelsFeatures,iabVendors:e.tcf2.labelsIabVendors,nonIabPurposes:e.tcf2.labelsNonIabPurposes,nonIabVendors:e.tcf2.labelsNonIabVendors,purposes:e.tcf2.labelsPurposes},nonTCFLabels:ie(e),vendor:{features:"Features",legitimateInterest:"Purposes processed by Legitimate Interest",privacyPolicy:"Privacy Policy",purposes:"Purposes processed by Consent",specialFeatures:"Special Features",specialPurposes:"Special Purposes"}},language:re(e),links:oe(e),poweredBy:ce(e),privacyButton:ae(e),secondLayer:{description:e.tcf2.secondLayerDescription,isOverlayEnabled:Z(e),tabs:{purposes:{label:e.tcf2.tabsPurposeLabel},vendors:{label:e.tcf2.tabsVendorsLabel}},title:e.tcf2.secondLayerTitle},toggles:{consent:{label:e.tcf2.togglesConsentToggleLabel},legitimateInterest:{label:e.tcf2.togglesLegIntToggleLabel},specialFeaturesToggle:{offLabel:e.tcf2.togglesSpecialFeaturesToggleOff,onLabel:e.tcf2.togglesSpecialFeaturesToggleOn}}}}(e):function(e){var t;return{buttons:{acceptAll:{label:e.labels.btnAcceptAll},denyAll:{isEnabled:e.btnDenyIsVisible,label:e.labels.btnDeny},save:{label:e.labels.btnSave},showSecondLayer:{isEnabled:e.btnMoreInfoIsVisible,label:e.labels.btnMore,url:e.moreInfoButtonUrl||null}},customization:te(e),firstLayer:{description:{default:e.bannerMessage,short:e.bannerMobileDescriptionIsActive?e.bannerMobileDescription:null},isCategoryTogglesEnabled:!1,isOverlayEnabled:$(e),title:null!==(t=e.labels.firstLayerTitle)&&void 0!==t?t:"Privacy Settings",variant:0},isEmbeddingsEnabled:!0,labels:ie(e),language:re(e),links:oe(e),poweredBy:ce(e),privacyButton:ae(e),secondLayer:{description:e.labels.titleCorner,isOverlayEnabled:Z(e),tabs:{categories:{isEnabled:!0,label:e.labels.categories},services:{isEnabled:!0,label:"Services"}},title:e.labels.headerCorner,variant:0}}}(e)},he=function(e){return e.dataProcessor||e.dataProcessors[0]},ve=function(e){var t=be(e,F.DATA_PURPOSES_LIST);return P(t)?t:e.dataPurposes},Ie=function(e,t){return e.description||t.descriptionOfService||t.description},Se=function(e,t){return!!t.isHidden||e.isHidden},ye=function(e){return P(e.legalBasisList)?e.legalBasisList:[e.legalGround]},me=function(e){return e.nameOfProcessingCompany||e.processingCompany},Ce=function(e){return e.privacyPolicyURL||e.policyOfProcessorUrl},Ee=function(e){var t;return e.retentionPeriodDescription||(null===(t=e.retentionPeriodList)||void 0===t?void 0:t[0])||""},Te=function(e,t){return!!t.isEssential||e.defaultConsentStatus},be=function(e,t){var n;return P(e[t])?e[t]:(null===(n=e[t])||void 0===n?void 0:n.length)>0?[e[t]]:[]},Ae=function(e){return e.reduce((function(e,t){return t.type===N.DATA_LAYER?e.push({names:t.names,type:b.DATA_LAYER}):t.type===N.WINDOW_EVENT&&e.push({names:t.names,type:b.WINDOW_EVENT}),e}),[])},Le=["AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GR","HR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK"],Ne=function(){function e(){this.apiInstance=B.getInstance(),this.userCountry={}}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.resetInstance=function(){e.instance.userCountry={}},e.prototype.getUserCountry=function(){return p(this,void 0,void 0,(function(){var e;return g(this,(function(t){switch(t.label){case 0:return D(this.userCountry)?[3,2]:[4,this.apiInstance.fetchUserCountry()];case 1:e=t.sent(),this.userCountry=Fe(e),t.label=2;case 2:return[2,this.userCountry]}}))}))},e.prototype.getIsUserInEU=function(){return p(this,void 0,void 0,(function(){var e;return g(this,(function(t){switch(t.label){case 0:return[4,this.getUserCountry()];case 1:return e=t.sent(),[2,R(Le,e.code.toUpperCase())]}}))}))},e}(),Fe=function(e){return{code:e.countryCode,name:e.countryName}},we=function(){function e(){this.apiInstance=B.getInstance(),this.locationInstance=Ne.getInstance(),this.settings={}}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.resetInstance=function(){e.instance.settings={}},e.prototype.getBaseSettings=function(){return{controllerId:this.settings.controllerId,id:this.settings.id,isTcfEnabled:this.settings.isTcfEnabled,ui:this.settings.ui,version:this.settings.version}},e.prototype.getCategories=function(){return this.settings.categories},e.prototype.getCategoryBySlug=function(e){return this.getCategories().find((function(t){return t.slug===e}))},e.prototype.getControllerId=function(){return this.settings.controllerId},e.prototype.getDataExchangeSettings=function(){return this.settings.dataExchangeSettings},e.prototype.getEssentialCategories=function(){return this.getCategories().reduce((function(e,t){return t.isEssential&&e.push(t),e}),[])},e.prototype.getNonEssentialCategories=function(){return this.getCategories().reduce((function(e,t){return t.isEssential||e.push(t),e}),[])},e.prototype.getServices=function(){return this.getServicesFromCategories(this.getCategories())},e.prototype.getServicesByIds=function(e){return this.getServicesFromCategories(this.removeNoneCategory(this.getCategories())).reduce((function(t,n){return e.some((function(e){return e===n.id}))&&t.push(n),t}),[])},e.prototype.getServicesFromCategories=function(e){return e.reduce((function(e,t){return e.concat(t.services)}),[])},e.prototype.getServicesWithConsent=function(){return this.getServices().reduce((function(e,t){return t.consent.status&&e.push(t),e}),[])},e.prototype.getSettings=function(){return this.settings},e.prototype.getTCFPublisherCountryCode=function(){var e;return(null===(e=this.settings.tcf)||void 0===e?void 0:e.publisherCountryCode)||"DE"},e.prototype.getTCFPurposeOneTreatment=function(){var e;return!!(null===(e=this.settings.tcf)||void 0===e?void 0:e.purposeOneTreatment)},e.prototype.getTCFStackIds=function(){var e;return(null===(e=this.settings.tcf)||void 0===e?void 0:e.stackIds)||[]},e.prototype.getTCFVendorIds=function(){var e;return(null===(e=this.settings.tcf)||void 0===e?void 0:e.vendorIds)||[]},e.prototype.isTcfEnabled=function(){return this.settings.isTcfEnabled},e.prototype.setCategories=function(e){this.settings.categories=e},e.prototype.setSettings=function(e){this.settings=e},e.prototype.initSettings=function(){return p(this,void 0,void 0,(function(){var e,t;return g(this,(function(n){switch(n.label){case 0:return[4,this.apiInstance.fetchSettingsJson()];case 1:return e=n.sent(),e=d(d({},s=e),{consentTemplates:s.consentTemplates.reduce((function(e,t){return t.isDeactivated||e.push(t),e}),[])}),[4,this.fetchServices(e)];case 2:return t=n.sent(),this.setSettings(_e(function(e,t){return{acceptAllImplicitlyOutsideEU:e.displayOnlyForEU,categories:ne(e,t),controllerId:K(),dataExchangeSettings:Ae(e.dataExchangeOnPage),id:e.settingsId,isTcfEnabled:e.tcf2Enabled,showFirstLayerOnVersionChange:de(e.showInitialViewForVersionChange),tcf:ge(e),ui:fe(e),version:e.version}}(e,t))),[2]}var s}))}))},e.prototype.mergeServicesIntoExistingCategories=function(e){return this.getCategories().map((function(t){return d(d({},t),{services:t.services.map((function(t){var n=e.find((function(e){return e.id===t.id}));return null!=n?n:t}))})}))},e.prototype.removeNoneCategory=function(e){return e.reduce((function(e,t){return"none"!==t.slug&&e.push(t),e}),[])},e.prototype.shouldAcceptAllImplicitlyOnInit=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){return this.settings.acceptAllImplicitlyOutsideEU&&!this.settings.isTcfEnabled?[2,!this.locationInstance.getIsUserInEU()]:[2,!1]}))}))},e.prototype.shouldShowFirstLayerOnVersionChange=function(){var e=V.fetchSettingsVersion();if(e&&P(this.settings.showFirstLayerOnVersionChange)){var t=this.settings.version.split("."),n=e.split(".");return R(this.settings.showFirstLayerOnVersionChange,A.MAJOR)&&t[0]!==n[0]||R(this.settings.showFirstLayerOnVersionChange,A.MINOR)&&t[1]!==n[1]||R(this.settings.showFirstLayerOnVersionChange,A.PATCH)&&t[2]!==n[2]}return!1},e.prototype.updateServicesWithConsent=function(e,t){return e.map((function(e){return e.isEssential?e:d(d({},e),{consent:d(d({},e.consent),{status:t===T.TRUE})})}))},e.prototype.updateServicesWithConsents=function(e,t){return e.reduce((function(e,n){var s;if(!n.isEssential){var i=t.find((function(e){return e.serviceId===n.id}));s=d(d({},n),{consent:d(d({},n.consent),{status:i.status})})}return e.push(null!=s?s:n),e}),[])},e.prototype.fetchServices=function(e){return p(this,void 0,void 0,(function(){var t,i,r;return g(this,(function(o){switch(o.label){case 0:c=[],(a=e).consentTemplates.forEach((function(e){c.push(se(e,a)),e.subConsents.forEach((function(e){c.push(se(e,a))}))})),t=n(s(c,(function(e,t){return e.id===t.id&&e.version===t.version})),"id"),i=function(e){return""+Q(JSON.stringify(e))}(t),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.apiInstance.fetchServicesJson(i)];case 2:return[2,o.sent()];case 3:return o.sent(),[3,4];case 4:return[4,this.apiInstance.generateServicesJson(t)];case 5:return r=o.sent(),[2,this.apiInstance.fetchServicesJson(r)]}var a,c}))}))},e}(),_e=function(e){return d(d({},e),{categories:e.categories.reduce((function(e,t){return P(t.services)&&e.push(t),e}),[])})},Oe=function(){function e(){this.apiInstance=B.getInstance(),this.eventDispatcherInstance=J.getInstance(),this.settingsInstance=we.getInstance()}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.execute=function(e,t,n){return p(this,void 0,void 0,(function(){var s,i,r=this;return g(this,(function(o){switch(o.label){case 0:return s=e.map((function(e){return Ue(r.settingsInstance.getSettings(),e,t,n)})),i=Re(e,s),[4,this.apiInstance.saveConsents(s)];case 1:return o.sent(),this.settingsInstance.setCategories(this.settingsInstance.mergeServicesIntoExistingCategories(i)),V.saveSettings(V.mapSettings(this.settingsInstance.getSettings(),this.settingsInstance.getServices())),W.enableScriptsForServicesWithConsent(this.settingsInstance.getServicesWithConsent()),this.eventDispatcherInstance.dispatch(s),[2]}}))}))},e.prototype.getMergedServicesAndSettingsFromStorage=function(){var e=V.fetchSettings(),t=this.getMergedAndUpdatedEssentialServices(e),n=t.mergedEssentialServices,s=t.updatedEssentialServices,i=this.getMergedNonEssentialServices(e);return{mergedServices:n.concat(i),mergedSettings:d(d({},this.settingsInstance.getSettings()),{controllerId:e.controllerId}),updatedEssentialServices:s}},e.prototype.mergeSettingsFromStorage=function(){return p(this,void 0,void 0,(function(){var e,t,n,s,i,r,o,a=this;return g(this,(function(c){switch(c.label){case 0:return e=this.getMergedServicesAndSettingsFromStorage(),t=e.mergedServices,n=e.mergedSettings,s=e.updatedEssentialServices,P(s)?(i=s.map((function(e){return Ue(n,e,"onEssentialChange","implicit")})),r=Re(t,i),[4,this.apiInstance.saveConsents(i)]):[3,2];case 1:return c.sent(),this.settingsInstance.setSettings(d(d({},n),{categories:this.settingsInstance.mergeServicesIntoExistingCategories(r)})),[3,3];case 2:this.settingsInstance.setSettings(d(d({},n),{categories:this.settingsInstance.mergeServicesIntoExistingCategories(t)})),c.label=3;case 3:return o=t.map((function(e){return Ue(a.settingsInstance.getSettings(),e,"onInitialPageLoad","implicit")})),V.saveSettings(V.mapSettings(n,t)),W.enableScriptsForServicesWithConsent(this.settingsInstance.getServicesWithConsent()),this.eventDispatcherInstance.dispatch(o),[2]}}))}))},e.prototype.restoreUserSession=function(){return p(this,void 0,void 0,(function(){var e,t,n,s,i,r,o,a,c,u=this;return g(this,(function(l){switch(l.label){case 0:return this.apiInstance.getControllerId()?[4,this.apiInstance.fetchUserConsents()]:[3,4];case 1:return e=l.sent(),t=De(e),n=Ve(e),P(n)?(s=[],i=this.settingsInstance.getServices(),r=[],n.forEach((function(e){var t=i.findIndex((function(t){return t.id===e.templateId}));if(t>-1){var n=i[t],o=d(d({},n),{consent:d(d({},n.consent),{status:e.status})}),a=r.findIndex((function(e){return e.id===n.id}));-1===a?r.push(o):r[a]=o,i[t]=o,s.push(Ue(d(d({},u.settingsInstance.getSettings()),{controllerId:u.apiInstance.getControllerId(),version:e.settingsVersion}),o,e.action,e.updatedBy,{timestamp:1e3*parseInt(e.timestamp,10)}))}})),o=d(d({},this.settingsInstance.getSettings()),{controllerId:this.apiInstance.getControllerId(),version:n.slice(-1)[0].settingsVersion}),a=Re(i,s),this.apiInstance.getControllerId()===V.fetchControllerId()?[3,3]:(c=r.map((function(e){return Ue(o,e,"onSessionRestored","implicit",{referrerControllerId:u.settingsInstance.getControllerId()})})),[4,this.apiInstance.saveConsents(c)])):[3,4];case 2:l.sent(),l.label=3;case 3:return V.saveSettings(V.mapSettings(o,a)),P(t)&&V.setUserActionPerformed(),[2,!0];case 4:return[2,!1]}}))}))},e.prototype.getMergedAndUpdatedEssentialServices=function(e){var t=this.settingsInstance.getServicesFromCategories(this.settingsInstance.getEssentialCategories()),n=[];return{mergedEssentialServices:t.map((function(t){var s=e.services.find((function(e){return e.id===t.id}));if(s){var i=d(d({},t),{consent:d(d({},t.consent),{history:s.history,status:!0}),processorId:s.processorId});return s.status||n.push(i),i}return t})),updatedEssentialServices:n}},e.prototype.getMergedNonEssentialServices=function(e){return this.settingsInstance.getServicesFromCategories(this.settingsInstance.getNonEssentialCategories()).map((function(t){var n=e.services.find((function(e){return e.id===t.id}));return n?d(d({},t),{consent:d(d({},t.consent),{history:n.history,status:n.status}),processorId:n.processorId}):t}))},e}(),Ue=function(e,t,n,s,i){var r,o;return{applicationVersion:"SDK-0.5.3",consent:{action:n,status:t.consent.status,type:s},service:{id:t.id,name:t.name,processorId:t.processorId,version:t.version},settings:{controllerId:e.controllerId,id:e.id,language:e.ui.language.selected,referrerControllerId:null!==(r=null==i?void 0:i.referrerControllerId)&&void 0!==r?r:"",version:e.version},timestamp:null!==(o=null==i?void 0:i.timestamp)&&void 0!==o?o:(new Date).valueOf()}},Re=function(e,t){return e.map((function(e){var n=t.filter((function(t){return t.service.id===e.id}));return P(n)?d(d({},e),{consent:d(d({},e.consent),{history:f(e.consent.history,n.map((function(e){return Pe(e)})))})}):e}))},Pe=function(e){return{action:e.consent.action,language:e.settings.language,status:e.consent.status,timestamp:e.timestamp,type:e.consent.type,versions:{application:e.applicationVersion,service:e.service.version,settings:e.settings.version}}},De=function(e){return e.filter((function(e){return!j.includes(e.action)}))},Ve=function(e){return e.filter((function(e){return"onSessionRestored"!==e.action}))};!function(e){e.DEFAULT_BROWSER_LANGUAGE="Usercentrics: The language has been defaulted to the browser language.",e.DEFAULT_DOCUMENT_LANGUAGE="Usercentrics: The language has been defaulted to the document language.",e.DEFAULT_ENGLISH="Usercentrics: The language has been defaulted to English."}(z||(z={}));var Be,Me,ke,xe,Ge,He=function(){function e(){this.apiInstance=B.getInstance()}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.resolveLanguage=function(){return p(this,void 0,void 0,(function(){var e,t,n,s,i;return g(this,(function(r){switch(r.label){case 0:return[4,this.apiInstance.fetchAvailableLanguages()];case 1:return e=r.sent(),t=this.apiInstance.getJsonFileLanguage(),R(e,t)?[2]:(n=V.fetchLanguage(),R(e,n)?(this.apiInstance.setJsonFileLanguage(n),[2]):(s=Ye(e))?(console.warn(z.DEFAULT_DOCUMENT_LANGUAGE),this.apiInstance.setJsonFileLanguage(s),[2]):(i=Je(e))?(console.warn(z.DEFAULT_BROWSER_LANGUAGE),this.apiInstance.setJsonFileLanguage(i),[2]):(console.warn(z.DEFAULT_ENGLISH),this.apiInstance.setJsonFileLanguage("en"),[2]))}}))}))},e}(),Je=function(e){var t,n=window.navigator;if(P(n.languages))for(var s=0;s<n.languages.length;s+=1){var i=n.languages[s].slice(0,2);if(R(e,i))return i}var r=(null!==(t=n.language)&&void 0!==t?t:n.userLanguage).slice(0,2);return R(e,r)?r:null},Ye=function(e){var t=document.documentElement.lang;if(t){var n=t.slice(0,2);return R(e,n)?n:null}return null},je=function(){function e(){this.selectedVendorsIncludeNonDisclosed=!1,this.settingsInstance=we.getInstance(),this.cmpApi={},this.consensuCookieBridge={},this.tcModel={}}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.resetInstance=function(){e.instance.cmpApi={},e.instance.consensuCookieBridge={},e.instance.selectedVendorsIncludeNonDisclosed=!1,e.instance.tcModel={};var t=document.getElementById("uc-consensu-org-cookie-bridge");t&&t.remove()},e.prototype.init=function(){return p(this,void 0,void 0,(function(){var e,t,n,s,i,o;return g(this,(function(a){switch(a.label){case 0:return e=this.settingsInstance.getSettings().tcf,t=e.cmpId,n=e.cmpVersion,s=e.consensuScriptPath,i=e.consensuSubdomain,[4,this.initConsensuCookieBridge(i,s).catch((function(e){console.warn(e.message)}))];case 1:return a.sent(),[4,this.getGlobalTCString().catch((function(e){console.warn(e.message)}))];case 2:return o=a.sent()||V.fetchTCString()||"",[4,this.initTCModel(o,t,n)];case 3:return a.sent(),this.cmpApi=new r.CmpApi(t,n,!1),[2]}}))}))},e.prototype.acceptAllDisclosed=function(e){return p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return this.tcModel.setAllVendorConsents(),this.tcModel.setAllVendorLegitimateInterests(),this.tcModel.purposeConsents.set(this.getPurposeIdsFromVendorsAndStacks()),this.tcModel.purposeLegitimateInterests.set(this.getPurposeIdsFromVendorsAndStacks()),this.tcModel.specialFeatureOptins.set(this.getSpecialFeatureIdsFromVendorsAndStacks()),[4,this.updateTCString(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.changeLanguage=function(e){return p(this,void 0,void 0,(function(){var t,n;return g(this,(function(s){switch(s.label){case 0:return[4,(t=this.tcModel.gvl).changeLanguage(e)];case 1:return s.sent(),n=this.settingsInstance.getTCFVendorIds(),t.narrowVendorsTo(n),this.tcModel.gvl=t,[2]}}))}))},e.prototype.denyAllDisclosed=function(e){return p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return this.tcModel.unsetAllVendorConsents(),this.tcModel.unsetAllVendorLegitimateInterests(),this.tcModel.purposeConsents.unset(this.getPurposeIdsFromVendorsAndStacks()),this.tcModel.purposeLegitimateInterests.unset(this.getPurposeIdsFromVendorsAndStacks()),this.tcModel.specialFeatureOptins.unset(this.getSpecialFeatureIdsFromVendorsAndStacks()),[4,this.updateTCString(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.getStacks=function(){var e=this.tcModel.gvl;return this.settingsInstance.getTCFStackIds().map((function(t){var n=e.stacks[t];return{description:n.description,id:n.id,name:n.name,purposeIds:n.purposes,specialFeatureIds:n.specialFeatures}}))},e.prototype.getTCFData=function(){return{features:this.getFeaturesFromVendors(),purposes:this.getPurposesFromVendors(),specialFeatures:this.getSpecialFeaturesFromVendorsAndStacks(),specialPurposes:this.getSpecialPurposesFromVendors(),stacks:this.getStacks(),vendors:this.getVendors()}},e.prototype.getVendors=function(){var e=this;return Object.keys(this.tcModel.gvl.vendors).map((function(t){var n=e.tcModel.gvl,s=n.vendors[t];return{consent:e.tcModel.vendorConsents.has(s.id),features:s.features.map((function(e){return{id:e,name:n.features[e].name}})),flexiblePurposes:[],id:s.id,legitimateInterestConsent:e.tcModel.vendorLegitimateInterests.has(s.id),legitimateInterestPurposes:s.legIntPurposes.map((function(e){return{id:e,name:n.purposes[e].name}})),name:s.name,policyUrl:s.policyUrl,purposes:s.purposes.map((function(e){return{id:e,name:n.purposes[e].name}})),showConsentToggle:s.purposes.length>0,showLegitimateInterestConsentToggle:s.legIntPurposes.length>0,specialFeatures:s.specialFeatures.map((function(e){return{id:e,name:n.specialFeatures[e].name}})),specialPurposes:s.specialPurposes.map((function(e){return{id:e,name:n.specialPurposes[e].name}}))}}))},e.prototype.setUIAsClosed=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){return this.cmpApi.update(i.TCString.encode(this.tcModel),!1),[2]}))}))},e.prototype.setUIAsOpen=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){return this.cmpApi.update(i.TCString.encode(this.tcModel),!0),[2]}))}))},e.prototype.updateChoices=function(e,t){return p(this,void 0,void 0,(function(){return g(this,(function(n){switch(n.label){case 0:return e.purposes?[4,this.savePurposes(e.purposes)]:[3,2];case 1:n.sent(),n.label=2;case 2:return e.specialFeatures?[4,this.saveSpecialFeatures(e.specialFeatures)]:[3,4];case 3:n.sent(),n.label=4;case 4:return e.vendors?[4,this.saveVendors(e.vendors)]:[3,6];case 5:n.sent(),n.label=6;case 6:return e.purposes||e.specialFeatures||e.vendors?[4,this.updateTCString(t)]:[3,8];case 7:n.sent(),n.label=8;case 8:return[2]}}))}))},e.prototype.setSelectedVendorsIncludeNonDisclosed=function(e){var t=this;e.some((function(e){return!t.tcModel.vendorsDisclosed.has(e)}))&&(this.selectedVendorsIncludeNonDisclosed=!0)},e.prototype.getFeaturesFromVendors=function(){var e=this;return this.getFeatureIdsFromVendors().map((function(t){var n=e.tcModel.gvl.features[t];return{description:n.description,descriptionLegal:n.descriptionLegal,id:n.id,name:n.name}}))},e.prototype.getFeatureIdsFromVendors=function(){return o(this.getVendors().reduce((function(e,t){return e.concat(t.specialPurposes.map((function(e){return e.id})))}),[]))},e.prototype.getGlobalTCString=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){return[2,this.queryConsensuCookieBridge("getTCString")]}))}))},e.prototype.getPurposesFromVendors=function(){var e=this,t=this.getPurposeIdsFromVendorsAndStacks(),n=this.getStacks();return t.map((function(t){var s=e.tcModel.gvl.purposes[t],i=n.find((function(e){return e.purposeIds.includes(t)}));return{consent:e.tcModel.purposeConsents.has(t),description:s.description,descriptionLegal:s.descriptionLegal,id:s.id,isPartOfASelectedStack:!!i,legitimateInterestConsent:e.tcModel.purposeLegitimateInterests.has(t),name:s.name,showLegitimateInterestToggle:1!==s.id,stackId:(null==i?void 0:i.id)||null}}))},e.prototype.getPurposeIdsFromVendorsAndStacks=function(){var e=this.getVendors().reduce((function(e,t){return e.concat(t.purposes.map((function(e){return e.id}))).concat(t.legitimateInterestPurposes.map((function(e){return e.id})))}),[]),t=this.getStacks().reduce((function(e,t){return e.concat(t.purposeIds)}),[]);return o(e.concat(t))},e.prototype.getSpecialFeaturesFromVendorsAndStacks=function(){var e=this,t=this.getSpecialFeatureIdsFromVendorsAndStacks(),n=this.getStacks();return t.map((function(t){var s=e.tcModel.gvl.specialFeatures[t],i=n.find((function(e){return e.specialFeatureIds.includes(t)}));return{consent:e.tcModel.specialFeatureOptins.has(t),description:s.description,descriptionLegal:s.descriptionLegal,id:s.id,isPartOfASelectedStack:!!i,name:s.name,stackId:(null==i?void 0:i.id)||null}}))},e.prototype.getSpecialFeatureIdsFromVendorsAndStacks=function(){var e=this.getVendors().reduce((function(e,t){return e.concat(t.specialFeatures.map((function(e){return e.id})))}),[]),t=this.getStacks().reduce((function(e,t){return e.concat(t.specialFeatureIds)}),[]);return o(e.concat(t))},e.prototype.getSpecialPurposesFromVendors=function(){var e=this;return this.getSpecialPurposeIdsFromVendors().map((function(t){var n=e.tcModel.gvl.specialPurposes[t];return{description:n.description,descriptionLegal:n.descriptionLegal,id:n.id,name:n.name}}))},e.prototype.getSpecialPurposeIdsFromVendors=function(){return o(this.getVendors().reduce((function(e,t){return e.concat(t.specialPurposes.map((function(e){return e.id})))}),[]))},e.prototype.initConsensuCookieBridge=function(e,t){return p(this,void 0,void 0,(function(){var n=this;return g(this,(function(s){return[2,new Promise((function(s,i){var r=document.getElementById("uc-consensu-org-cookie-bridge");r&&r.remove(),n.consensuCookieBridge=document.createElement("iframe"),n.consensuCookieBridge.style.display="none",n.consensuCookieBridge.id="uc-consensu-org-cookie-bridge",n.consensuCookieBridge.src=""+e+t,n.consensuCookieBridge.onload=function(){return p(n,void 0,void 0,(function(){var e,t=this;return g(this,(function(n){return e=setTimeout((function(){t.consensuCookieBridge={},i(new Error("Cookie bridge iframe did not load"))}),1e3),this.queryConsensuCookieBridge("isCookieBridgeLoaded").then((function(){s()})).catch((function(e){i(e)})).finally((function(){clearTimeout(e)})),[2]}))}))},n.consensuCookieBridge.onerror=function(){return p(n,void 0,void 0,(function(){return g(this,(function(e){return i(new Error("Cookie bridge iframe error")),[2]}))}))},document.body.appendChild(n.consensuCookieBridge)}))]}))}))},e.prototype.initLegitimateInterestConsents=function(e){var t=this;e.forEach((function(n){t.tcModel.vendorsDisclosed.has(n)||t.tcModel.vendorLegitimateInterests.set(e)}));var n=o(e.reduce((function(e,n){return t.tcModel.vendorsDisclosed.has(n)?e.concat(t.tcModel.gvl.vendors[n].purposes).concat(t.tcModel.gvl.vendors[n].legIntPurposes):e}),[]));this.getPurposeIdsFromVendorsAndStacks().forEach((function(e){n.includes(e)||t.tcModel.purposeLegitimateInterests.set(e)}))},e.prototype.initTCModel=function(e,t,n){return p(this,void 0,void 0,(function(){var s,r,o=this;return g(this,(function(a){switch(a.label){case 0:if(s=this.settingsInstance.getTCFVendorIds(),i.GVL.baseUrl="https://api.usercentrics.eu/tcf2/",i.GVL.languageFilename="[LANG].json",i.GVL.latestFilename="en.json",r=new i.GVL,this.tcModel=new i.TCModel(r),e)try{this.tcModel=i.TCString.decode(e,this.tcModel),V.saveTCString(e)}catch(e){console.warn(e.message)}return this.tcModel.cmpId=t,this.tcModel.cmpVersion=n,this.tcModel.publisherCountryCode=this.settingsInstance.getTCFPublisherCountryCode(),this.tcModel.purposeOneTreatment=this.settingsInstance.getTCFPurposeOneTreatment(),[4,this.tcModel.gvl.readyPromise.then((function(){return p(o,void 0,void 0,(function(){return g(this,(function(e){switch(e.label){case 0:return[4,this.tcModel.gvl.changeLanguage(this.settingsInstance.getSettings().ui.language.selected)];case 1:return e.sent(),this.tcModel.gvl.narrowVendorsTo(s),this.initLegitimateInterestConsents(s),this.setSelectedVendorsIncludeNonDisclosed(s),this.tcModel.vendorsDisclosed.set(s),[2]}}))}))}))];case 1:return a.sent(),[2]}}))}))},e.prototype.queryConsensuCookieBridge=function(e,t){return p(this,void 0,void 0,(function(){var n=this;return g(this,(function(s){if(!this.consensuCookieBridge||!this.consensuCookieBridge.id)throw new Error("No consensu.org iframe-bridge exists.");return[2,new Promise((function(s,i){var r=new MessageChannel,o=n.settingsInstance.getSettings().tcf.consensuSubdomain,a=JSON.stringify({method:e,payload:t});r.port1.onmessage=function(e){var t=JSON.parse(e.data),n=t.success,r=t.data;n?s(r):i(new Error(r))},n.consensuCookieBridge&&n.consensuCookieBridge.contentWindow&&n.consensuCookieBridge.contentWindow.postMessage(a,o,[r.port2])}))]}))}))},e.prototype.savePurposes=function(e){return p(this,void 0,void 0,(function(){var t=this;return g(this,(function(n){return e.forEach((function(e){e.consent?t.tcModel.purposeConsents.set(e.id):t.tcModel.purposeConsents.unset(e.id),e.legitimateInterestConsent?t.tcModel.purposeLegitimateInterests.set(e.id):t.tcModel.purposeLegitimateInterests.unset(e.id)})),[2]}))}))},e.prototype.saveSpecialFeatures=function(e){return p(this,void 0,void 0,(function(){var t=this;return g(this,(function(n){return e.forEach((function(e){e.consent?t.tcModel.specialFeatureOptins.set(e.id):t.tcModel.specialFeatureOptins.unset(e.id)})),[2]}))}))},e.prototype.saveVendors=function(e){return p(this,void 0,void 0,(function(){var t=this;return g(this,(function(n){return e.forEach((function(e){e.consent?t.tcModel.vendorConsents.set(e.id):t.tcModel.vendorConsents.unset(e.id),e.legitimateInterestConsent?t.tcModel.vendorLegitimateInterests.set(e.id):t.tcModel.vendorLegitimateInterests.unset(e.id)})),[2]}))}))},e.prototype.setGlobalTCString=function(e){return p(this,void 0,void 0,(function(){return g(this,(function(t){return[2,this.queryConsensuCookieBridge("setTCString",e)]}))}))},e.prototype.updateTCString=function(e){return p(this,void 0,void 0,(function(){var t;return g(this,(function(n){switch(n.label){case 0:return this.tcModel.consentScreen=e,this.tcModel.updated(),t=i.TCString.encode(this.tcModel),[4,this.setGlobalTCString(t).catch((function(e){console.warn(e.message)}))];case 1:return n.sent(),this.cmpApi.update(t,!1),V.saveTCString(t),[2]}}))}))},e}();(Be=exports.CONSENT_ACTION||(exports.CONSENT_ACTION={})).ACCEPT_ALL_SERVICES="onAcceptAllServices",Be.DENY_ALL_SERVICES="onDenyAllServices",Be.ESSENTIAL_CHANGE="onEssentialChange",Be.INITIAL_PAGE_LOAD="onInitialPageLoad",Be.NON_EU_REGION="onNonEURegion",Be.SESSION_RESTORED="onSessionRestored",Be.UPDATE_SERVICES="onUpdateServices",(Me=exports.CONSENT_TYPE||(exports.CONSENT_TYPE={})).EXPLICIT="explicit",Me.IMPLICIT="implicit",(ke=exports.TCF_DECISION_UI_LAYER||(exports.TCF_DECISION_UI_LAYER={}))[ke.FIRST_LAYER=1]="FIRST_LAYER",ke[ke.SECOND_LAYER=2]="SECOND_LAYER",(xe=exports.UI_LAYER||(exports.UI_LAYER={}))[xe.FIRST_LAYER=0]="FIRST_LAYER",xe[xe.NONE=1]="NONE",xe[xe.PRIVACY_BUTTON=2]="PRIVACY_BUTTON",xe[xe.SECOND_LAYER=3]="SECOND_LAYER",(Ge=exports.UI_VARIANT||(exports.UI_VARIANT={}))[Ge.DEFAULT=0]="DEFAULT",Ge[Ge.TCF=1]="TCF";var We=function(){function e(e,t){this.apiInstance=B.getInstance(),this.dataFacadeInstance=Oe.getInstance(),this.eventDispatcherInstance=J.getInstance(),this.languageInstance=He.getInstance(),this.locationInstance=Ne.getInstance(),this.settingsInstance=we.getInstance(),this.tcfInstance=je.getInstance(),(null==t?void 0:t.createTcfApiStub)&&a(),qe(e),this.apiInstance.setSettingsId(e),(null==t?void 0:t.controllerId)&&this.apiInstance.setControllerId(t.controllerId),(null==t?void 0:t.language)&&this.apiInstance.setJsonFileLanguage(t.language),(null==t?void 0:t.settingsCache)&&this.apiInstance.setJsonCacheBustingString(t.settingsCache),(null==t?void 0:t.version)&&this.apiInstance.setJsonFileVersion(t.version)}return e.prototype.init=function(){return p(this,void 0,void 0,(function(){var e,t,n,s;return g(this,(function(i){switch(i.label){case 0:return V.clearOnNewSettingsId(this.apiInstance.getSettingsId()),[4,this.languageInstance.resolveLanguage()];case 1:return i.sent(),[4,this.settingsInstance.initSettings()];case 2:return i.sent(),this.settingsInstance.isTcfEnabled()?[4,this.tcfInstance.init()]:[3,4];case 3:i.sent(),i.label=4;case 4:return this.eventDispatcherInstance.init(this.settingsInstance.getDataExchangeSettings()),[4,this.dataFacadeInstance.restoreUserSession()];case 5:return i.sent(),e=!V.settingsExist(),[4,this.settingsInstance.shouldAcceptAllImplicitlyOnInit()];case 6:return t=i.sent(),n=this.settingsInstance.shouldShowFirstLayerOnVersionChange(),e?t?[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(this.settingsInstance.getServices(),T.TRUE),"onNonEURegion","implicit")]:[3,8]:[3,11];case 7:return i.sent(),[3,10];case 8:return[4,this.dataFacadeInstance.execute(this.settingsInstance.getServices(),"onInitialPageLoad","implicit")];case 9:i.sent(),i.label=10;case 10:return[3,13];case 11:return[4,this.dataFacadeInstance.mergeSettingsFromStorage()];case 12:i.sent(),i.label=13;case 13:return this.apiInstance.saveConsentsFromBuffer(),[4,this.resolveUIOptions(e,t,n)];case 14:return 1!==(s=i.sent()).variant?[3,18]:0!==s.initialLayer?[3,16]:[4,this.tcfInstance.setUIAsOpen()];case 15:return i.sent(),[3,18];case 16:return[4,this.tcfInstance.setUIAsClosed()];case 17:i.sent(),i.label=18;case 18:return[2,s]}}))}))},e.prototype.acceptAllForTCF=function(e){return p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return[4,this.tcfInstance.acceptAllDisclosed(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.acceptAllServices=function(e){return void 0===e&&(e="explicit"),p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(this.settingsInstance.getServices(),T.TRUE),"onAcceptAllServices",e)];case 1:return t.sent(),V.setUserActionPerformed(),[2]}}))}))},e.prototype.changeLanguage=function(e){return p(this,void 0,void 0,(function(){var t,n,s;return g(this,(function(i){switch(i.label){case 0:return this.shouldChangeLanguage(e)?(this.apiInstance.setJsonFileLanguage(e),[4,this.settingsInstance.initSettings()]):[3,3];case 1:return i.sent(),t=this.dataFacadeInstance.getMergedServicesAndSettingsFromStorage(),n=t.mergedServices,s=t.mergedSettings,this.settingsInstance.setSettings(d(d({},s),{categories:this.settingsInstance.mergeServicesIntoExistingCategories(n)})),V.saveSettings(V.mapSettings(s,n)),this.settingsInstance.isTcfEnabled()?[4,this.tcfInstance.changeLanguage(e)]:[3,3];case 2:i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.denyAllForTCF=function(e){return p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return[4,this.tcfInstance.denyAllDisclosed(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.denyAllServices=function(e){return void 0===e&&(e="explicit"),p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return[4,this.dataFacadeInstance.execute(this.settingsInstance.updateServicesWithConsent(this.settingsInstance.getServices(),T.FALSE),"onDenyAllServices",e)];case 1:return t.sent(),V.setUserActionPerformed(),[2]}}))}))},e.prototype.fetchIsUserInEU=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){return[2,this.locationInstance.getIsUserInEU()]}))}))},e.prototype.fetchUserCountry=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){return[2,this.locationInstance.getUserCountry()]}))}))},e.prototype.getCategories=function(){return this.settingsInstance.removeNoneCategory(this.settingsInstance.getCategories())},e.prototype.getControllerId=function(){return this.settingsInstance.getControllerId()},e.prototype.getServices=function(){return this.settingsInstance.getServicesFromCategories(this.getCategories())},e.prototype.getSettings=function(){return this.settingsInstance.getBaseSettings()},e.prototype.getTCFData=function(){return this.tcfInstance.getTCFData()},e.prototype.setTCFUIAsClosed=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){switch(e.label){case 0:return[4,this.tcfInstance.setUIAsClosed()];case 1:return e.sent(),[2]}}))}))},e.prototype.setTCFUIAsOpen=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){switch(e.label){case 0:return[4,this.tcfInstance.setUIAsOpen()];case 1:return e.sent(),[2]}}))}))},e.prototype.updateChoicesForTCF=function(e,t){return p(this,void 0,void 0,(function(){return g(this,(function(n){switch(n.label){case 0:return[4,this.tcfInstance.updateChoices(e,t)];case 1:return n.sent(),[2]}}))}))},e.prototype.restoreUserSession=function(e){return p(this,void 0,void 0,(function(){return g(this,(function(t){switch(t.label){case 0:return this.apiInstance.setControllerId(e),[4,this.dataFacadeInstance.restoreUserSession()];case 1:return t.sent()?[4,this.dataFacadeInstance.mergeSettingsFromStorage()]:[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},e.prototype.updateServices=function(e,t){return void 0===t&&(t="explicit"),p(this,void 0,void 0,(function(){var n,s;return g(this,(function(i){switch(i.label){case 0:return n=this.settingsInstance.getServicesByIds(e.map((function(e){return e.serviceId}))),s=this.settingsInstance.updateServicesWithConsents(n,e),P(s)?[4,this.dataFacadeInstance.execute(s,"onUpdateServices",t)]:[3,2];case 1:i.sent(),i.label=2;case 2:return V.setUserActionPerformed(),[2]}}))}))},e.prototype.resolveUIOptions=function(e,t,n){return p(this,void 0,void 0,(function(){return g(this,(function(s){return t?[2,{initialLayer:1,variant:this.settingsInstance.isTcfEnabled()?1:0}]:e||!V.fetchUserActionPerformed()||n||this.settingsInstance.isTcfEnabled()&&this.tcfInstance.selectedVendorsIncludeNonDisclosed?[2,{initialLayer:0,variant:this.settingsInstance.isTcfEnabled()?1:0}]:this.settingsInstance.getBaseSettings().ui.privacyButton.isEnabled?[2,{initialLayer:2,variant:this.settingsInstance.isTcfEnabled()?1:0}]:[2,{initialLayer:1,variant:this.settingsInstance.isTcfEnabled()?1:0}]}))}))},e.prototype.shouldChangeLanguage=function(e){return e!==this.apiInstance.getJsonFileLanguage()&&this.settingsInstance.getBaseSettings().ui.language.available.some((function(t){return e===t}))},e}(),qe=function(e){(new Image).src="https://app.usercentrics.eu/session/1px.png?settingsId="+e};exports.Usercentrics=We,exports.default=We; |
@@ -77,2 +77,3 @@ import { LEGACY_DATA_EXCHANGE_TYPE, LEGACY_VERSION } from '../enums'; | ||
} | null; | ||
logoUrl: string | null; | ||
}; | ||
@@ -79,0 +80,0 @@ dataExchangeOnPage: LegacyDataExchangeSetting[]; |
{ | ||
"name": "@usercentrics/cmp-browser-sdk", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"tcfCmpVersion": "3", | ||
"author": "Usercentrics GmbH", | ||
"description": "Usercentrics CMP Browser SDK", | ||
"homepage": "https://docs.usercentrics.com/cmp_browser_sdk/0.5.2/index.html", | ||
"homepage": "https://docs.usercentrics.com/cmp_browser_sdk/0.5.3/index.html", | ||
"license": "SEE LICENSE IN LICENSE.md", | ||
@@ -9,0 +9,0 @@ "main": "dist/index.js", |
@@ -43,3 +43,3 @@ # Usercentrics CMP Browser SDK | ||
The constructor also supports an optional [Options](https://docs.usercentrics.com/cmp_browser_sdk/0.5.2/interfaces/options.html) parameter. | ||
The constructor also supports an optional [Options](https://docs.usercentrics.com/cmp_browser_sdk/0.5.3/interfaces/options.html) parameter. | ||
@@ -120,3 +120,3 @@ ## Accept / deny / update services in the default (non-TCF) context | ||
The constructor also supports an optional [Options](https://docs.usercentrics.com/cmp_browser_sdk/0.5.2/interfaces/options.html) parameter. | ||
The constructor also supports an optional [Options](https://docs.usercentrics.com/cmp_browser_sdk/0.5.3/interfaces/options.html) parameter. | ||
@@ -248,3 +248,3 @@ For TCF, the `createTcfApiStub` option needs to be set to true in order for the \_\_tcfapi queue to initialize right away (we cannot wait for the settings request to finish). | ||
```html | ||
<script type="application/javascript" src="https://app.usercentrics.eu/browser-sdk/0.5.2/bundle.js"></script> | ||
<script type="application/javascript" src="https://app.usercentrics.eu/browser-sdk/0.5.3/bundle.js"></script> | ||
``` | ||
@@ -280,3 +280,3 @@ | ||
**NOTE**: If you need Internet Explorer 11 support, you can point the `src` attribute to `https://app.usercentrics.eu/browser-sdk/0.5.2/bundle_legacy.js`. | ||
**NOTE**: If you need Internet Explorer 11 support, you can point the `src` attribute to `https://app.usercentrics.eu/browser-sdk/0.5.3/bundle_legacy.js`. | ||
@@ -289,6 +289,6 @@ ## Considerations for building your custom TCF v2.0 UI | ||
Additionally, the IAB will provide you with your own subdomain on the `consensu.org domain`. This subdomain is needed for settings the global-scope `euconsent-v2` cookie. In order for the TCF global-scope to work as intended with this SDK, you need to host a `cookie-handler iframe` on your own `consensu.org subdomain`. You can copy the following iframe `view-source:https://usercentrics.mgr.consensu.org/browser-sdk/0.5.2/cookie-bridge.html` (view page source). Make sure to provide your own `consensu.org subdomain` in the Usercentrics admin settings. Make sure the subdomain starts with `https://`. For your development setup to work correctly we also recommend adding port 443 (https) at the end (e.g. `https://YOUR_COMPANY_NAME.mgr.consensu.org:443`). You also need to provide the relative path to the iframe (including the filename) on that subdomain (e.g. `/YOUR_CURRENT_VERSION/cookie-bridge.html`) . | ||
Additionally, the IAB will provide you with your own subdomain on the `consensu.org domain`. This subdomain is needed for settings the global-scope `euconsent-v2` cookie. In order for the TCF global-scope to work as intended with this SDK, you need to host a `cookie-handler iframe` on your own `consensu.org subdomain`. You can copy the following iframe `view-source:https://usercentrics.mgr.consensu.org/browser-sdk/0.5.3/cookie-bridge.html` (view page source). Make sure to provide your own `consensu.org subdomain` in the Usercentrics admin settings. Make sure the subdomain starts with `https://`. For your development setup to work correctly we also recommend adding port 443 (https) at the end (e.g. `https://YOUR_COMPANY_NAME.mgr.consensu.org:443`). You also need to provide the relative path to the iframe (including the filename) on that subdomain (e.g. `/YOUR_CURRENT_VERSION/cookie-bridge.html`) . | ||
## Documentation | ||
Documentation can be found on our [documentation website](https://docs.usercentrics.com/cmp_browser_sdk/0.5.2/index.html). | ||
Documentation can be found on our [documentation website](https://docs.usercentrics.com/cmp_browser_sdk/0.5.3/index.html). |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
127045
1331
1