@m10s/cmp
Version:
Package containing scripts used by Schibsteds' sites to integrate with Sourcepoint CMP
2 lines (1 loc) • 21.3 kB
JavaScript
!function(){var e=["jsSdkVersion","id","realm","clientId","pulseTracker","referrer","state","pulseObjectName","showInWebview","identityObject","identityObjectName","disableSentry","disableNativeConsentCheck","enableUserCentric","groupId"],n=["jsSdkVersion","id","realm","clientId","pulseTracker","referrer","state","pulseObjectName","showInWebview","identityObject","identityObjectName","disableSentry","disableNativeConsentCheck","enableUserCentric","groupId"];function t(){var e=c(),n=e.m(t),u=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function f(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===u||"GeneratorFunction"===(n.displayName||n.name))}var p={throw:1,return:2,break:3,continue:3};function d(e){var n,t;return function(o){n||(n={stop:function(){return t(o.a,2)},catch:function(){return o.v},abrupt:function(e,n){return t(o.a,p[e],n)},delegateYield:function(e,i,a){return n.resultName=i,t(o.d,r(e),a)},finish:function(e){return t(o.f,e)}},t=function(e,t,r){o.p=n.prev,o.n=n.next;try{return e(t,r)}finally{n.next=o.n}}),n.resultName&&(n[n.resultName]=o.v,n.resultName=void 0),n.sent=o.v,n.next=o.n;try{return e.call(this,n)}finally{o.p=n.prev,o.n=n.next}}}return(t=function(){return{wrap:function(n,t,r,o){return e.w(d(n),t,r,o&&o.reverse())},isGeneratorFunction:f,mark:e.m,awrap:function(e,n){return new l(e,n)},AsyncIterator:s,async:function(e,n,t,r,o){return(f(n)?a:i)(d(e),n,t,r,o)},keys:o,values:r}})()}function r(e){if(null!=e){var n=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],t=0;if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function o(e){var n=Object(e),t=[];for(var r in n)t.unshift(r);return function e(){for(;t.length;)if((r=t.pop())in n)return e.value=r,e.done=!1,e;return e.done=!0,e}}function i(e,n,t,r,o){var i=a(e,n,t,r,o);return i.next().then((function(e){return e.done?e.value:i.next()}))}function a(e,n,t,r,o){return new s(c().w(e,n,t,r),o||Promise)}function s(e,n){function t(r,o,i,a){try{var s=e[r](o),c=s.value;return c instanceof l?n.resolve(c.v).then((function(e){t("next",e,i,a)}),(function(e){t("throw",e,i,a)})):n.resolve(c).then((function(e){s.value=e,i(s)}),(function(e){return t("throw",e,i,a)}))}catch(e){a(e)}}var r;this.next||(u(s.prototype),u(s.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),u(this,"_invoke",(function(e,o,i){function a(){return new n((function(n,r){t(e,i,n,r)}))}return r=r?r.then(a,a):a()}),!0)}function c(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return u(l,"_invoke",function(t,r,o){var i,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(n,t){return i=n,s=0,c=e,p.n=t,a}};function d(t,r){for(s=t,c=r,n=0;!f&&u&&!o&&n<l.length;n++){var o,i=l[n],d=p.p,y=i[2];t>3?(o=y===r)&&(c=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=t<2&&d<i[1])?(s=0,p.v=r,p.n=i[1]):d<y&&(o=t<3||i[0]>r||r>y)&&(i[4]=t,i[5]=r,p.n=y,s=0))}if(o||t>1)return a;throw f=!0,r}return function(o,l,y){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,y),s=l,c=y;(n=s<2?e:c)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,i){if(s||(o="next"),n=i[o]){if(!(n=n.call(i,c)))throw TypeError("iterator result is not an object");if(!n.done)return n;c=n.value,s<2&&(s=0)}else 1===s&&(n=i.return)&&n.call(i),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((n=(f=p.n<0)?c:t.call(r,p))!==a)break}catch(n){i=e,s=1,c=n}finally{u=1}}return{value:n,done:f}}}(t,o,i),!0),l}var a={};function s(){}function l(){}function f(){}n=Object.getPrototypeOf;var p=[][r]?n(n([][r]())):(u(n={},r,(function(){return this})),n),d=f.prototype=s.prototype=Object.create(p);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,u(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=f,u(d,"constructor",f),u(f,"constructor",l),l.displayName="GeneratorFunction",u(f,o,"GeneratorFunction"),u(d),u(d,o,"Generator"),u(d,r,(function(){return this})),u(d,"toString",(function(){return"[object Generator]"})),(c=function(){return{w:i,m:y}})()}function u(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}u=function(e,n,t,r){function i(n,t){u(e,n,(function(e){return this._invoke(n,t,e)}))}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))},u(e,n,t,r)}function l(e,n){this.v=e,this.k=n}function f(e,n,t,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void t(e)}s.done?n(c):Promise.resolve(c).then(r,o)}function p(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var i=e.apply(n,t);function a(e){f(i,r,o,a,s,"next",e)}function s(e){f(i,r,o,a,s,"throw",e)}a(void 0)}))}}function d(e,n){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}var y="__CONFIGURATION_PLACEHOLDER__";function v(){var e;"undefined"!=typeof document&&document.location.href.indexOf("sp_debug=1")>0&&(e=console).debug.apply(e,["[CMP]"].concat(Array.prototype.slice.call(arguments)))}function g(e,n,t,r,o){var i=new URL(e);i.searchParams.append("utm_source","cmp"),i.searchParams.append("utm_medium","psi"),i.searchParams.append("referrer",r||window.location.href),t&&i.searchParams.append("client_id",t),n&&i.searchParams.append("environment_id",n),o&&i.searchParams.append("state",o),window.location.href=i.href}function m(e){return null===e?null:Boolean(parseInt(e))}function b(e,n,t){var r=new Date;r.setTime(r.getTime()+24*t*60*60*1e3);var o="expires="+r.toUTCString();document.cookie=e+"="+n+";"+o+";path=/"}function h(e){for(var n=e+"=",t=decodeURIComponent(document.cookie).split(";"),r=0;r<t.length;r++){for(var o=t[r];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(n))return o.substring(n.length,o.length)}return""}function w(e){document.cookie=e+"=; Max-Age=-99999999;"}var _=["Mixed","PSI","SCC","TCF","PMC"],C="default",P="cmp",I="cache",O="accepted",S="rejected",j="unknown",M=Object.freeze({purposes:{CMP_ANALYTICS:{optIn:!1,status:j},CMP_MARKETING:{optIn:!1,status:j},CMP_ADVERTISING:{optIn:!1,status:j},CMP_PERSONALIZATION:{optIn:!1,status:j}},source:C});function k(e,n,t,r){v("Pulse: "+t+"(actor, data):",n,r),T(e,(function(e){e&&"function"==typeof e.track&&e.track(t,{schema:"http://schema.schibsted.com/events/tracker-event.json/348.json",object:Object.assign({},r,k.pulseCommonData),provider:{component:"CMP-Marketplaces"},actor:n})}))}function T(e,n){if(e.psi.pulseTracker)return n(e.psi.pulseTracker);var t=e.psi.pulseObjectName||"pulse";return"function"!=typeof e[t]?console.error("No Pulse integration detected. Aborting."):e[t]((function(e){"function"==typeof n&&n(e)}))}function N(){var e,n=null==(e=k.pulseCommonData)?void 0:e.messageName;if(n)return _.find((function(e){return n.includes(e)}))}function E(e){return"CMP_"+("personalisation"===e?"personalization":e).toUpperCase()}function x(e,n,t){var r=Object.keys(A(e)).filter((function(n){return A(e)[n]})),o=Object.keys(A(e)).filter((function(n){return!A(e)[n]}));return r.map((function(e){var t=n.purposes[E(e)];t.optIn=!0,t.status=O})),o.map((function(e){n.purposes[E(e)].status=S})),n.source=t,n}function A(e){var n,t=m((e._scc_||e._tcf_).getPermissionSync("CMP:advertising")),r=m((e._scc_||e._tcf_).getPermissionSync("CMP:analytics")),o=m((e._scc_||e._tcf_).getPermissionSync("CMP:marketing")),i=m((e._scc_||e._tcf_).getPermissionSync("CMP:personalisation"));return n={advertising:t,analytics:r,marketing:o,personalisation:i},Object.entries(n).filter((function(e){return e[0],null!=e[1]})).reduce((function(e,n){var t,r=n[0],o=n[1];return Object.assign({},e,((t={})[r]=o,t))}),{})}function L(e,n){var t=n.performance.now();return e?Math.round((t-e)/1e3):null}var U="CMP:retrieveMessage";function R(e){e.enableUserCentric&&h("CMP:isLoggedIn")&&!h(U)&&(b(U,!0,400),function(e){var n,t,r,o,i=document.createElement("script");i.src="https://static.dev.cmp.m10s.io/dist/retrieve.js",document.body.appendChild(i);var a=document.createElement("retrieve-message");s=a,c=Object.assign({isWeb:!0,lang:e.consentLanguage},(null==(n=e.consentStatusMessage)?void 0:n.verticalPosition)&&{verticalPosition:null==(t=e.consentStatusMessage)?void 0:t.verticalPosition},(null==(r=e.consentStatusMessage)?void 0:r.horizontalPosition)&&{horizontalPosition:null==(o=e.consentStatusMessage)?void 0:o.horizontalPosition}),Object.entries(c).forEach((function(e){return s.setAttribute.apply(s,e)})),document.body.appendChild(a);var s,c}(e))}var D=null,F=!1,G=!1;function J(e,n){if(n&&("object"!=typeof(t=n)||t.constructor!==Object))return console.error("Provided object is incorrect");var t;if(0===Object.keys(A(e)).length){if(!n)return M;var r=JSON.parse(JSON.stringify(n));return r.source=C,r}return x(e,JSON.parse(JSON.stringify(n||M)),I)}function V(e,n){n.events=n.events||{};var t,r=n.events.onMessageReceiveData,o=n.events.onMessageChoiceSelect,i=n.events.onMessageReady,a=n.events.onPrivacyManagerAction,s=n.events.onConsentReady,c=!0,u={id:n.userId,realm:n.realm};n.events.onMessageReceiveData=function(e,t){v("Sourcepoint: onMessageReceiveData(data)",t),D=!0,k.pulseCommonData={"@id":"sdrn:privacy:cmp:"+(t.messageId||""),"@type":"CMP",messageName:t.msgDescription||"",propertyId:n.propertyId,messageId:t.messageId||void 0,bucket:t.bucket||void 0,jsSdkVersion:n.jsSdkVersion,partitionId:t.prtnUUID||"",language:n.consentLanguage},"function"==typeof r&&r(t)},n.events.onMessageReady=function(){var n,r;null==(n=window._tcf_)||null==(r=n.TCFCallbacks)||r.map((function(e){e()})),v("Sourcepoint: onMessageReady()");var o=N();if(v("Pulse: Detected message type: "+o),!D)return k(e,u,"View",{name:"CMP: Privacy Manager displayed",messageType:N()});t=e.performance.now(),k(e,u,"View",{name:"CMP: Message displayed",messageType:o}),"function"==typeof i&&i()},n.events.onMessageChoiceSelect=function(n,r,i){if(v("Sourcepoint: onMessageReady(choice_id="+r+", choice_type_id="+i+")"),5===i){var a=L(t,e);k(e,u,"engagementEvent",Object.assign({name:"CMP: Link to Privacy / Cookie Policy clicked",elementType:"anchor",isFirstLayer:D,messageType:N()},a&&{duration:a})),D=null}if(9===i){c=!1,D=null;var s=L(t,e);k(e,u,"engagementEvent",Object.assign({name:"CMP: Open Privacy Settings",elementType:"button",messageType:N()},s&&{duration:s}))}if(11===i&&(c=!0),12===i&&(D=!1),15===i){var l=L(t,e);k(e,u,"engagementEvent",Object.assign({name:"CMP: Dismiss message",elementType:"button",messageType:N()},l&&{duration:l}))}"function"==typeof o&&o(r,i)},n.events.onPrivacyManagerAction=function(e,n){v("Sourcepoint: onPrivacyManagerAction()"),F=!0,D=!1,"none"===n.purposeConsent?(G=!0,c=!1):(G=!1,c=!0),"function"==typeof a&&a()},n.events.onConsentReady=function(r,o,i,a){var l,f,p,d;R(n),null==(l=window._tcf_)||null==(f=l.consentedCallback)||f.map((function(e){e(a.consentedToAll)})),null==(p=window._tcf_)||null==(d=p.TCFCallbacks)||d.map((function(e){e()})),v("Sourcepoint: onConsentReady(message_type="+r+", consentUUID="+o+", euconsent)",i),v("Sourcepoint: getMessageType() "+N());var y=L(t,e);if(void 0!==N()||F){var g="PSI"===N()?null:A(e);if(function(e){var n=JSON.parse(JSON.stringify(M));T(e,(function(t){try{t.setConsents(x(e,n,P))}catch(e){console.error("Consents couldn't be set. The provided version of Pulse SDK does not support the setConsents event")}}))}(e),G&&k(e,u,"engagementEvent",Object.assign({name:"CMP: Reject all",elementType:"button",messageType:N()},y&&{duration:y})),!c)return!1;k(e,u,"engagementEvent",Object.assign({name:"CMP: Accept",elementType:"button",messageType:N(),consentedToAll:null==a?void 0:a.consentedToAll,isFirstLayer:D||!!D},g&&{consents:g},y&&{duration:y})),D=null,F=!1,G=!1,"function"==typeof s&&s(r,o,i,a)}}}function W(e,n,t){var r;if(!n||!n.groupPmId)throw new Error("groupPmId is required");var o="CMP:advertising",i="CMP:analytics",a="CMP:marketing",s="CMP:personalisation",c="CMP:performance_marketing",u={};function l(n){return v(t+": getPermissionFromCache(category="+n+")"),e.localStorage.getItem(n)}u[o]=[],u[i]=[],u[a]=[],u[s]=[],u[c]=[];var f,p={subscribers:u,consentedCallback:[],TCFCallbacks:[],showPrivacyManager:function(){v("${type}: showPrivacyManager()"),k.pulseCommonData.messageName="",F=!0,D=!1,e._sp_.gdpr.loadPrivacyManagerModal()},getPermissionSync:function(e){return v(t+": getPermissionSync(category="+e+")"),l(e)},getPermission:function(e,n){v(t+": getPermission(category="+e+")");var r,o=p.subscribe(e,(r=!1,function(e){r?"function"==typeof o&&o():(r=!0,n(e),n=function(){})}))},notify:(r={},r[o]=l(o),r[i]=l(i),r[a]=l(a),r[s]=l(s),r[c]=l(c),f=r,function(e,n){if(f[e]!==n){v(t+": notify(category="+e+", value="+n+")"),f[e]=n;for(var r=p.subscribers[e],o=0;o<r.length;o++)r[o](n)}else v(t+": notify(category="+e+", value="+n+") - IGNORED")}),subscribe:function(e,n){if(v(t+": subscribe(category="+e+")"),p.subscribers[e]){p.subscribers[e].push(n);var r=l(e);return null!==r&&n(r),function(){p.subscribers[e]=p.subscribers[e].filter((function(e){return e!==n}))}}console.error("Unable to subscribe - undefined consent category!")},getCachedOrDefaultConsentsForPulse:function(n){return J(e,n)},isConsentedToAll:function(e){p.consentedCallback.push(e)},getConsentedToAllSync:function(){var e=l("_sp_user_consent_"+n.propertyId);try{var t,r;if(0===Object.keys(localStorage).filter((function(e){return e.startsWith("CMP:")})).length)return null;var o=null==(t=JSON.parse(e))||null==(r=t.gdpr)?void 0:r.consentStatus;if((null==o?void 0:o.vendorListAdditions)||(null==o?void 0:o.legalBasisChanges))return null;var i=null==o?void 0:o.consentedAll;return void 0===i?null:i}catch(e){return null}},onTcfReady:function(e){p.TCFCallbacks.push(e)}};return e._SourcePoint_Consent_Callback=p.notify,p}function H(e,n){var t,r;if(null!=(t=e.psi)&&t.identityObject)return e.psi.identityObject;if(null!=n&&n.identityObject)return n.identityObject;var o=(null==(r=e.psi)?void 0:r.identityObjectName)||(null==n?void 0:n.identityObjectName)||"Identity";return e[o]?e[o]:console.warn("No Schibsted Account integration detected.")}function z(e){var n=Array.from({length:20},(function(){return String.fromCharCode(Math.floor(25*Math.random()+97))})).join(""),t=btoa(JSON.stringify(n));H(e)&&H(e).login({state:t})}var B=function(e){if("number"==typeof e||void 0===e)return config.userId=e;throw new Error("Id value "+e+" is invalid")},K=function(e){return function(e){try{return Boolean(new URL(e))}catch(e){return!1}}(e)?window.psi.isLoggedInUser?g(e,null,window.psi.clientId,window.psi.referrer,window.psi.state):T(window,(function(n){n.getEnvironmentId().then((function(n){g(e,n,window.psi.clientId,window.psi.referrer,window.psi.state)}))})):console.error("The URL passed to the configuration is invalid. Please, correct it.")},Y=function(){return z(window)},q=function(e,n,t){e.targetingParams=e.targetingParams||{},e.targetingParams[n]=t};var Z,$,Q=["Hermes","_app_","tv.nu","FinnApp","Omni"];function X(e){return Q.some((function(n){return e.userAgent.includes(n)}))}function ee(e,n,t){return!new URLSearchParams(null==(r=e.location)?void 0:r.search).has("_sp_pass_consent")&&X(n)&&!t.disableNativeConsentCheck;var r}function ne(){return(ne=p(t().mark((function e(r,o,i,a,s){var c,u,l,f,p;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(te(r,o,i,a,s),a.jsSdkVersion,a.id,a.realm,a.clientId,a.pulseTracker,a.referrer,a.state,a.pulseObjectName,a.showInWebview,a.identityObject,a.identityObjectName,a.disableSentry,a.disableNativeConsentCheck,a.enableUserCentric,a.groupId,c=d(a,n),e.prev=2,u=H(r),e.t0=h("CMP:isLoggedIn"),e.t0){e.next=9;break}return e.next=8,u.isLoggedIn();case 8:e.t0=e.sent;case 9:if(e.t0){e.next=12;break}return e.abrupt("return",re(r,c));case 12:return u.on("logout",(function(){w("CMP:isLoggedIn")})),h("CMP:isLoggedIn")||b("CMP:isLoggedIn",!0),q(a,"loggedin",!0),l={externalParty:"sourcepoint",optionalSuffix:a.groupId},e.next=18,u.getExternalId(l.externalParty,l.optionalSuffix);case 18:f=e.sent,p=q(a,"enableUserCentric",!0),re(r,Object.assign({authId:f,targetingParams:p},c)),e.next=27;break;case 23:e.prev=23,e.t1=e.catch(2),console.error("Identity: ",e.t1),re(r,c);case 27:case"end":return e.stop()}}),e,null,[[2,23]])})))).apply(this,arguments)}function te(e,n,t,r,o){var i,a,s;if(!(r&&r.baseEndpoint&&r.propertyId&&r.consentLanguage))throw new Error("One of missing: baseEndpoint, propertyId, consentLanguage");V(e,r),function(e){e.events=e.events||{},e.events.onError=function(n,t,r){try{n&&window._cmp_.sentry.setTag("message_type",n),t&&window._cmp_.sentry.setTag("errorCode",t),window._cmp_.sentry.setTag("propertyId",e.propertyId),window._cmp_.sentry.captureException(r)}catch(e){console.error("Can not send the error to Sentry, "+e)}},e.events.onMessageChoiceError=function(e,n){try{e&&window._cmp_.sentry.setTag("message_type",e),window._cmp_.sentry.captureException(n)}catch(n){console.error("Can not send the error to Sentry, "+n)}}}(r),r.accountId=r.accountId||1960,r.custom={},"psi"!==o&&(r.gdpr={includeTcfApi:"tcf"===o}),r.propertyHref&&(r.joinHref=!0);var c=r.userId||(null==(i=H(e,r))?void 0:i._session.userId);c&&q(r,"loggedin","true");var u=r.clientId||(null==(a=H(window,r))?void 0:a.clientId);X(t)&&q(r,"mobile-webview",!r.showInWebview||r.showInWebview);var l,f=null==n||null==(s=n.referrer)?void 0:s.split("/")[2];f&&q(r,"referrer-hostname",f),l=/(_sch_cmp_[_a-z0-9]+)=(.+)/i,n.cookie.split(";").filter((function(e){return l.test(e)})).map((function(e){return e.split("=").map((function(e){return e.trim()}))})).forEach((function(e){var n=e[0],t=e[1];return q(r,n,t)})),r.propertyHref&&n.location.search&&-1===r.propertyHref.indexOf("?")&&(r.propertyHref+=n.location.search);var p=r.pulseTracker,d=r.referrer,y=r.state,v=r.pulseObjectName,g=r.showInWebview,m=r.identityObject,b=r.identityObjectName,h=r.enableUserCentric,w=r.groupId;e.psi=e.psi||{},e.psi.isLoggedInUser=!!c,e.psi.setUserId=B,e.psi.openPrivacySettings=K,e.psi.pulseTracker=p,e.psi.clientId=u,e.psi.referrer=d,e.psi.state=y,e.psi.pulseObjectName=v,e.psi.showInWebview=g,e.psi.identityObject=m,e.psi.identityObjectName=b,e.psi.triggerLogin=Y,e.psi.enableUserCentric=h,e.psi.groupId=w}function re(e,n){e._sp_=e._sp_||{},e._sp_.config=n,v("Sourcepoint initiated with config: ",n)}function oe(e,n){if(!n.disableSentry){var t,r,o=e.createElement("script");t=o,r={async:!0,type:"module",src:"https://static.pro.cmp.m10s.io/dist/index.js",fetchPriority:"low"},Object.keys(r).filter((function(e){return void 0!==t[e]})).forEach((function(e){return"object"==typeof r[e]?Object.keys(r[e]).forEach((function(n){return t[e][n]=r[e][n]})):t[e]=r[e]})),e.head.appendChild(o)}}ee(window,navigator,y)?(console.warn("CMP: Native consent is not passed. Sourcepoint will not be initialized."),window._sp_={config:{accountId:1960,baseEndpoint:"https://cdn.privacy-mgmt.com"}}):(Z=document,($=Z.createElement("script")).innerHTML='"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))};"undefined"!=typeof module?module.exports=t:t()}();',Z.head.appendChild($),oe(document,y),function(e,n){e._tcf_=W(e,n)}(window,y),y.enableUserCentric?function(e,n,t,r,o){ne.apply(this,arguments)}(window,document,navigator,y,"tcf"):function(n,t,r,o,i){te(n,t,r,o,i),o.jsSdkVersion,o.id,o.realm,o.clientId,o.pulseTracker,o.referrer,o.state,o.pulseObjectName,o.showInWebview,o.identityObject,o.identityObjectName,o.disableSentry,o.disableNativeConsentCheck,o.enableUserCentric,o.groupId,re(n,d(o,e))}(window,document,navigator,y,"tcf"))}();