UNPKG

@m10s/cmp

Version:

Package containing scripts used by Schibsteds' sites to integrate with Sourcepoint CMP

2 lines (1 loc) 21.4 kB
!function(){var e=["jsSdkVersion","id","realm","clientId","pulseTracker","referrer","state","pulseObjectName","showInWebview","identityObject","identityObjectName","disableSentry","disableNativeConsentCheck","groupId"];function n(){var e=s(),c=e.m(n),p=(Object.getPrototypeOf?Object.getPrototypeOf(c):c.__proto__).constructor;function l(e){var n="function"==typeof e&&e.constructor;return!!n&&(n===p||"GeneratorFunction"===(n.displayName||n.name))}var f={throw:1,return:2,break:3,continue:3};function d(e){var n,r;return function(o){n||(n={stop:function(){return r(o.a,2)},catch:function(){return o.v},abrupt:function(e,n){return r(o.a,f[e],n)},delegateYield:function(e,i,a){return n.resultName=i,r(o.d,t(e),a)},finish:function(e){return r(o.f,e)}},r=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(n=function(){return{wrap:function(n,t,r,o){return e.w(d(n),t,r,o&&o.reverse())},isGeneratorFunction:l,mark:e.m,awrap:function(e,n){return new u(e,n)},AsyncIterator:a,async:function(e,n,t,r,a){return(l(n)?i:o)(d(e),n,t,r,a)},keys:r,values:t}})()}function t(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 r(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 o(e,n,t,r,o){var a=i(e,n,t,r,o);return a.next().then((function(e){return e.done?e.value:a.next()}))}function i(e,n,t,r,o){return new a(s().w(e,n,t,r),o||Promise)}function a(e,n){function t(r,o,i,a){try{var s=e[r](o),c=s.value;return c instanceof u?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||(c(a.prototype),c(a.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),c(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 s(){/*! 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 s=r&&r.prototype instanceof u?r:u,p=Object.create(s.prototype);return c(p,"_invoke",function(t,r,o){var i,s,c,u=0,p=o||[],l=!1,f={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(n,t){return i=n,s=0,c=e,f.n=t,a}};function d(t,r){for(s=t,c=r,n=0;!l&&u&&!o&&n<p.length;n++){var o,i=p[n],d=f.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,f.v=r,f.n=i[1]):d<y&&(o=t<3||i[0]>r||r>y)&&(i[4]=t,i[5]=r,f.n=y,s=0))}if(o||t>1)return a;throw l=!0,r}return function(o,p,y){if(u>1)throw TypeError("Generator is already running");for(l&&1===p&&d(p,y),s=p,c=y;(n=s<2?e:c)||!l;){i||(s?s<3?(s>1&&(f.n=-1),d(s,c)):f.n=c:f.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=(l=f.n<0)?c:t.call(r,f))!==a)break}catch(n){i=e,s=1,c=n}finally{u=1}}return{value:n,done:l}}}(t,o,i),!0),p}var a={};function u(){}function p(){}function l(){}n=Object.getPrototypeOf;var f=[][r]?n(n([][r]())):(c(n={},r,(function(){return this})),n),d=l.prototype=u.prototype=Object.create(f);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,c(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return p.prototype=l,c(d,"constructor",l),c(l,"constructor",p),p.displayName="GeneratorFunction",c(l,o,"GeneratorFunction"),c(d),c(d,o,"Generator"),c(d,r,(function(){return this})),c(d,"toString",(function(){return"[object Generator]"})),(s=function(){return{w:i,m:y}})()}function c(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}c=function(e,n,t,r){function i(n,t){c(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))},c(e,n,t,r)}function u(e,n){this.v=e,this.k=n}function p(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 l(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var i=e.apply(n,t);function a(e){p(i,r,o,a,s,"next",e)}function s(e){p(i,r,o,a,s,"throw",e)}a(void 0)}))}}var f="__CONFIGURATION_PLACEHOLDER__";function d(){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 y(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 v(e){return null===e?null:Boolean(parseInt(e))}function m(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=/"}var g=["Mixed","PSI","SCC","TCF","PMC"],h="default",b="cmp",_="cache",w="account",P="accepted",C="rejected",I="unknown",O=Object.freeze({purposes:{CMP_ANALYTICS:{optIn:!1,status:I},CMP_MARKETING:{optIn:!1,status:I},CMP_ADVERTISING:{optIn:!1,status:I},CMP_PERSONALIZATION:{optIn:!1,status:I}},source:h});function S(e,n,t,r){d("Pulse: "+t+"(actor, data):",n,r),M(e,(function(e){e&&"function"==typeof e.track&&e.track(t,{schema:"http://schema.pulse.m10s.io/events/tracker-event.json/362.json",object:Object.assign({},r,S.pulseCommonData),provider:{component:"CMP-Marketplaces"},actor:n})}))}function M(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 j(){var e,n=null==(e=S.pulseCommonData)?void 0:e.messageName;if(n)return g.find((function(e){return n.includes(e)}))}function k(e){return"CMP_"+("personalisation"===e?"personalization":e).toUpperCase()}function T(e,n,t){var r=Object.keys(N(e)).filter((function(n){return N(e)[n]})),o=Object.keys(N(e)).filter((function(n){return!N(e)[n]}));return r.map((function(e){var t=n.purposes[k(e)];t.optIn=!0,t.status=P})),o.map((function(e){n.purposes[k(e)].status=C})),n.source=t,n}function N(e){var n,t=v((e._scc_||e._tcf_).getPermissionSync("CMP:advertising")),r=v((e._scc_||e._tcf_).getPermissionSync("CMP:analytics")),o=v((e._scc_||e._tcf_).getPermissionSync("CMP:marketing")),i=v((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 E(e,n){var t=n.performance.now();return e?Math.round((t-e)/1e3):null}var A=null,x=!1,L=!1;function R(e,n,t){if(n&&("object"!=typeof(r=n)||r.constructor!==Object))return console.error("Provided object is incorrect");var r;if(0===Object.keys(N(e)).length){if(!n)return O;var o=JSON.parse(JSON.stringify(n));return o.source=h,o}var i=JSON.parse(JSON.stringify(n||O));return T(e,i,t?w:_)}function D(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){d("Sourcepoint: onMessageReceiveData(data)",t),A=!0,S.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()})),d("Sourcepoint: onMessageReady()");var o=j();if(d("Pulse: Detected message type: "+o),!A)return S(e,u,"View",{name:"CMP: Privacy Manager displayed",messageType:j()});t=e.performance.now(),S(e,u,"View",{name:"CMP: Message displayed",messageType:o}),"function"==typeof i&&i()},n.events.onMessageChoiceSelect=function(n,r,i){if(d("Sourcepoint: onMessageReady(choice_id="+r+", choice_type_id="+i+")"),5===i){var a=E(t,e);S(e,u,"engagementEvent",Object.assign({name:"CMP: Link to Privacy / Cookie Policy clicked",elementType:"anchor",isFirstLayer:A,messageType:j()},a&&{duration:a})),A=null}if(9===i){c=!1,A=null;var s=E(t,e);S(e,u,"engagementEvent",Object.assign({name:"CMP: Open Privacy Settings",elementType:"button",messageType:j()},s&&{duration:s}))}if(11===i&&(c=!0),12===i&&(A=!1),15===i){var p=E(t,e);S(e,u,"engagementEvent",Object.assign({name:"CMP: Dismiss message",elementType:"button",messageType:j()},p&&{duration:p}))}"function"==typeof o&&o(r,i)},n.events.onPrivacyManagerAction=function(e,n){d("Sourcepoint: onPrivacyManagerAction()"),x=!0,A=!1,"none"===n.purposeConsent?(L=!0,c=!1):(L=!1,c=!0),"function"==typeof a&&a()},n.events.onConsentReady=function(n,r,o,i){var a,p,l,f;null==(a=window._tcf_)||null==(p=a.consentedCallback)||p.map((function(e){e(i.consentedToAll)})),null==(l=window._tcf_)||null==(f=l.TCFCallbacks)||f.map((function(e){e()})),d("Sourcepoint: onConsentReady(message_type="+n+", consentUUID="+r+", euconsent)",o),d("Sourcepoint: getMessageType() "+j());var y=E(t,e);if(void 0!==j()||x){var v="PSI"===j()?null:N(e);if(function(e){var n=JSON.parse(JSON.stringify(O));M(e,(function(t){try{t.setConsents(T(e,n,b))}catch(e){console.error("Consents couldn't be set. The provided version of Pulse SDK does not support the setConsents event")}}))}(e),L&&S(e,u,"engagementEvent",Object.assign({name:"CMP: Reject all",elementType:"button",messageType:j()},y&&{duration:y})),!c)return!1;S(e,u,"engagementEvent",Object.assign({name:"CMP: Accept",elementType:"button",messageType:j(),consentedToAll:null==i?void 0:i.consentedToAll,isFirstLayer:A||!!A},v&&{consents:v},y&&{duration:y})),A=null,x=!1,L=!1,"function"==typeof s&&s(n,r,o,i)}}}function F(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 p(n){return d(t+": getPermissionFromCache(category="+n+")"),e.localStorage.getItem(n)}u[o]=[],u[i]=[],u[a]=[],u[s]=[],u[c]=[];var l,f={subscribers:u,consentedCallback:[],TCFCallbacks:[],showPrivacyManager:function(){d("${type}: showPrivacyManager()"),S.pulseCommonData.messageName="",x=!0,A=!1,e._sp_.gdpr.loadPrivacyManagerModal()},getPermissionSync:function(e){return d(t+": getPermissionSync(category="+e+")"),p(e)},getPermission:function(e,n){d(t+": getPermission(category="+e+")");var r,o=f.subscribe(e,(r=!1,function(e){r?"function"==typeof o&&o():(r=!0,n(e),n=function(){})}))},notify:(r={},r[o]=p(o),r[i]=p(i),r[a]=p(a),r[s]=p(s),r[c]=p(c),l=r,function(e,n){if(l[e]!==n){d(t+": notify(category="+e+", value="+n+")"),l[e]=n;for(var r=f.subscribers[e],o=0;o<r.length;o++)r[o](n)}else d(t+": notify(category="+e+", value="+n+") - IGNORED")}),subscribe:function(e,n){if(d(t+": subscribe(category="+e+")"),f.subscribers[e]){f.subscribers[e].push(n);var r=p(e);return null!==r&&n(r),function(){f.subscribers[e]=f.subscribers[e].filter((function(e){return e!==n}))}}console.error("Unable to subscribe - undefined consent category!")},getCachedOrDefaultConsentsForPulse:function(t){return R(e,t,n.authId)},isConsentedToAll:function(e){f.consentedCallback.push(e)},getConsentedToAllSync:function(){var e=p("_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){f.TCFCallbacks.push(e)},clearCMPData:function(){["_sp_user_consent_"+n.propertyId,"_sp_non_keyed_local_state","_sp_local_state","CMP:advertising","CMP:analytics","CMP:marketing","CMP:personalisation"].forEach((function(e){localStorage.removeItem(e),sessionStorage.removeItem(e)}));var e=function(){for(var e=window.location.hostname,n=e.split("."),t=[],r=0;r<n.length-1;r++)t.push("."+n.slice(r).join("."));return t.push(e),t}();["consentUUID","euconsent-v2","consentDate","_cmp_advertising","_cmp_analytics","_cmp_marketing","_cmp_personalisation"].forEach((function(n){e.forEach((function(e){document.cookie=n+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain="+e+";"})),document.cookie=n+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;"}))}};return e._SourcePoint_Consent_Callback=f.notify,f}function U(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 G(e){var n=Array.from({length:20},(function(){return String.fromCharCode(Math.floor(25*Math.random()+97))})).join(""),t=btoa(JSON.stringify(n));U(e)&&U(e).login({state:t})}var J=function(e){if("number"==typeof e||void 0===e)return config.userId=e;throw new Error("Id value "+e+" is invalid")},V=function(e){return function(e){try{return Boolean(new URL(e))}catch(e){return!1}}(e)?window.psi.isLoggedInUser?y(e,null,window.psi.clientId,window.psi.referrer,window.psi.state):M(window,(function(n){n.getEnvironmentId().then((function(n){y(e,n,window.psi.clientId,window.psi.referrer,window.psi.state)}))})):console.error("The URL passed to the configuration is invalid. Please, correct it.")},H=function(){return G(window)},W=function(e,n,t){e.targetingParams=e.targetingParams||{},e.targetingParams[n]=t};var z=["Hermes","_app_","tv.nu","FinnApp","Omni"];function B(e){return z.some((function(n){return e.userAgent.includes(n)}))}function K(e,n,t){return!new URLSearchParams(null==(r=e.location)?void 0:r.search).has("_sp_pass_consent")&&B(n)&&!t.disableNativeConsentCheck;var r}function Y(n,t,r,o,i){!function(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");D(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=U(e,r))?void 0:i._session.userId);c&&W(r,"loggedin","true");var u=r.clientId||(null==(a=U(window,r))?void 0:a.clientId);function p(){var e=/(_sch_cmp_[_a-z0-9]+)=(.+)/i;n.cookie.split(";").filter((function(n){return e.test(n)})).map((function(e){return e.split("=").map((function(e){return e.trim()}))})).forEach((function(e){var n=e[0],t=e[1];return W(r,n,t)}))}B(t)&&W(r,"mobile-webview",!r.showInWebview||r.showInWebview);var l=null==n||null==(s=n.referrer)?void 0:s.split("/")[2];l&&W(r,"referrer-hostname",l);p(),r.propertyHref&&n.location.search&&-1===r.propertyHref.indexOf("?")&&(r.propertyHref+=n.location.search);var f=r.pulseTracker,d=r.referrer,y=r.state,v=r.pulseObjectName,m=r.showInWebview,g=r.identityObject,h=r.identityObjectName,b=r.groupId;e.psi=e.psi||{},e.psi.isLoggedInUser=!!c,e.psi.setUserId=J,e.psi.openPrivacySettings=V,e.psi.pulseTracker=f,e.psi.clientId=u,e.psi.referrer=d,e.psi.state=y,e.psi.pulseObjectName=v,e.psi.showInWebview=m,e.psi.identityObject=g,e.psi.identityObjectName=h,e.psi.triggerLogin=H,e.psi.groupId=b}(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.groupId;return function(e,n){e._sp_=e._sp_||{},e._sp_.config=n,d("Sourcepoint initiated with config: ",n)}(n,function(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}(o,e))}function q(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)}}function Z(){return(Z=l(n().mark((function e(t,r){var o,i,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o="https://cdn.privacy-mgmt.com/consent/tcfv2/consent/v3/history/"+r.propertyId+"?authId="+r.authId,e.next=4,fetch(o);case 4:if((i=e.sent).ok){e.next=7;break}throw new Error("HTTP "+i.status);case 7:return e.next=9,i.json();case 9:0===(a=e.sent).length&&S(t,r.userId,"View",{"@id":"sdrn:privacy:cmp:"+r.propertyId,"@type":"CMP",name:"CMP: First save to account",language:r.consentLanguage}),a.length>0&&(S(t,r.userId,"View",{"@id":"sdrn:privacy:cmp:"+r.propertyId,"@type":"CMP",name:"CMP: Account already has saved choices",language:r.consentLanguage}),$(r)),m("CMP:stickyConsent",!0,400),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),console.warn("[SP] Fetching consent history error:",e.t0);case 18:case"end":return e.stop()}}),e,null,[[0,15]])})))).apply(this,arguments)}function $(e){var n,t,r,o,i=document.createElement("script");i.src="https://static.pro.cmp.m10s.io/dist/retrieve.js",document.body.appendChild(i);var a,s,c=document.createElement("retrieve-message");a=c,s=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(s).forEach((function(e){return a.setAttribute.apply(a,e)})),document.body.appendChild(c)}!function(){if(K(window,navigator,f))return console.warn("CMP: Native consent is not passed. Sourcepoint will not be initialized."),void(window._sp_={config:{accountId:1960,baseEndpoint:"https://cdn.privacy-mgmt.com"}});var e,n;e=document,(n=e.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()}();',e.head.appendChild(n),q(document,f),function(e,n){e._tcf_=F(e,n)}(window,f),Y(window,document,navigator,f,"tcf"),f.authId&&!function(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""}("CMP:stickyConsent")&&function(e,n){Z.apply(this,arguments)}(window,f)}()}();