2025-03-22 00:49:46 +01:00

2 lines
13 KiB
JavaScript

/*! For license information please see usersync.min.js.LICENSE.txt */
(()=>{var e={34:(e,n,t)=>{var i,o,r;void 0===(o="function"==typeof(i=r=function(){function e(){for(var e=0,n={};e<arguments.length;e++){var t=arguments[e];for(var i in t)n[i]=t[i]}return n}function n(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function t(i){function o(){}function r(n,t,r){if("undefined"!=typeof document){"number"==typeof(r=e({path:"/"},o.defaults,r)).expires&&(r.expires=new Date(1*new Date+864e5*r.expires)),r.expires=r.expires?r.expires.toUTCString():"";try{var a=JSON.stringify(t);/^[\{\[]/.test(a)&&(t=a)}catch(e){}t=i.write?i.write(t,n):encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=encodeURIComponent(String(n)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var c="";for(var s in r)r[s]&&(c+="; "+s,!0!==r[s]&&(c+="="+r[s].split(";")[0]));return document.cookie=n+"="+t+c}}function a(e,t){if("undefined"!=typeof document){for(var o={},r=document.cookie?document.cookie.split("; "):[],a=0;a<r.length;a++){var c=r[a].split("="),s=c.slice(1).join("=");t||'"'!==s.charAt(0)||(s=s.slice(1,-1));try{var u=n(c[0]);if(s=(i.read||i)(s,u)||n(s),t)try{s=JSON.parse(s)}catch(e){}if(o[u]=s,e===u)break}catch(e){}}return e?o[e]:o}}return o.set=r,o.get=function(e){return a(e,!1)},o.getJSON=function(e){return a(e,!0)},o.remove=function(n,t){r(n,"",e(t,{expires:-1}))},o.defaults={},o.withConverter=t,o}((function(){}))})?i.call(n,t,n,e):i)||(e.exports=o),e.exports=r()},310:(e,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CMP_VERSION=n.CMP_ID=n.UUID_VERSION=n.POS_BTF=n.POS_ATF=n.ATF_AD_UNITS=n.MISSING_TAG_ID=n.TAG_ID=n.DO_NOT_TRACK=n.tokenKey=n.THIRTY_DAYS_IN_SECONDS=n.THIRTY_DAYS=n.NINETY_DAYS_IN_SECONDS=n.NINETY_DAYS=n.DEFAULT_SYNC_TTL=n.FOURTEEN_DAYS=void 0,n.FOURTEEN_DAYS=14,n.DEFAULT_SYNC_TTL=86400*n.FOURTEEN_DAYS,n.NINETY_DAYS=90,n.NINETY_DAYS_IN_SECONDS=86400*n.NINETY_DAYS,n.THIRTY_DAYS=30,n.THIRTY_DAYS_IN_SECONDS=86400*n.THIRTY_DAYS,n.tokenKey="am_tokens",n.DO_NOT_TRACK="$doNotTrack",n.TAG_ID="1363c924529b3998",n.MISSING_TAG_ID="MISSING_TAG_ID",n.ATF_AD_UNITS=["adhesion_mobile","adhesion_tablet","adhesion_desktop","sidebar_atf","leaderboard_atf","sidebar_btf","recipe_mobile","recipe_btf"],n.POS_ATF=1,n.POS_BTF=3,n.UUID_VERSION={us:"invalidate-verizon-pushes",eu:"eu-v1"},n.CMP_ID=46,n.CMP_VERSION=3},576:function(e,n,t){"use strict";var i=this&&this.__awaiter||function(e,n,t,i){return new(t||(t=Promise))((function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}s((i=i.apply(e,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0}),n.readAndResolve=n.readFromAll=n.writeToAll=n.readFromCache=n.writeToCache=void 0;const o=t(34),r=t(206),a=t(310);n.writeToCache=(e,n,t)=>i(void 0,void 0,void 0,(function*(){if(!window.caches||(null==n?void 0:n.mv_uuid)===a.DO_NOT_TRACK)return;const i=yield caches.open(t),o=new Headers;o.append("Content-Type","application/json"),o.append("Accept","application/json"),o.append("Cache-Control","max-age=31557600"),i.put(e,new Response(JSON.stringify(n),{headers:o}))})),n.readFromCache=e=>i(void 0,void 0,void 0,(function*(){if(!window.caches)return null;const n=yield window.caches.open("am");if(!n)return null;const t=yield n.match(e);if(!t)return null;if(!t.ok)return null;try{return yield t.json()}catch(e){console.warn(e)}})),n.writeToAll=(e,t,r)=>i(void 0,void 0,void 0,(function*(){try{yield(0,n.writeToCache)(e,t,r)}catch(e){}return o.set(e,t,{path:"/",expires:365,secure:!0,sameSite:"None"}),o.set(e,t,{path:"/",expires:365,secure:!0,sameSite:"None"}),!0})),n.readFromAll=e=>i(void 0,void 0,void 0,(function*(){const t={};try{t.cache=yield(0,n.readFromCache)(e)}catch(e){}return t.cookie=o.getJSON(e),t})),n.readAndResolve=e=>i(void 0,void 0,void 0,(function*(){let t={};try{t=yield(0,n.readFromAll)(e)}catch(e){}if(t.cookie&&!t.cache){try{(0,n.writeToCache)(`/${r.tokenKey}`,t.cookie,r.cacheKey)}catch(e){}return t.cookie}return t.cache&&!t.cookie?(o.set(r.tokenKey,t.cache),t.cache):t.cache&&t.cookie?t.cookie:null}))},326:function(e,n){"use strict";var t=this&&this.__awaiter||function(e,n,t,i){return new(t||(t=Promise))((function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}s((i=i.apply(e,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0}),n.getGPPString=n.getCCPAString=n.getTCFConsentString=n.hasValidCMP=n.isServingNonPersonalizedAds=void 0,n.isServingNonPersonalizedAds=(e,n)=>"1"===e&&!n,n.hasValidCMP=e=>"0"===e||"1"===e&&(window.__cmp||window.__tcfapi||window.__gpp),n.getTCFConsentString=function(e){return t(this,void 0,void 0,(function*(){return new Promise((n=>{e("getTCData",2,(e=>{e.gdprApplies?n(e.tcString):n("")}))}))}))},n.getCCPAString=function(e){return t(this,void 0,void 0,(function*(){return new Promise((n=>{e("getUSPData",1,(e=>{(null==e?void 0:e.uspString)?n(e.uspString):n("")}))}))}))};const i=e=>!(!e||"string"!=typeof e);n.getGPPString=function(e){return t(this,void 0,void 0,(function*(){return new Promise((n=>{e("ping",(t=>{"1.0"===(null==t?void 0:t.gppVersion)?e("getGPPData",(e=>{i(e.gppString)?n(e.gppString):n("")})):i(null==t?void 0:t.gppString)?n(t.gppString):n("")}))}))}))}},206:(e,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.cacheKey=n.tokenKey=void 0,n.tokenKey="am_tokens",n.cacheKey="am"},425:e=>{"use strict";e.exports=function(){var e=null,n=document.createElement("iframe");n.id="3pc";const t="mediavine".startsWith("jo")?"adsbymediavine":"mediavine";return n.src=`https://scripts.${t}.com/sync/check`,n.style.display="none",n.style.position="fixed",function(){return null!==e?Promise.resolve(e):new Promise((function(t){window.addEventListener("message",(function i(o){"3pc.supported"!==o.data&&"3pc.unsupported"!==o.data||(e="3pc.supported"===o.data,t({supported:e,timedOut:!1}),document.body.removeChild(n),window.removeEventListener("message",i))}),!1),setTimeout((function(){null===e&&(t({supported:e=!1,timedOut:!0}),document.body.removeChild(n))}),1e3),document.body.appendChild(n)}))}}()},694:(e,n,t)=>{"use strict";n.Wt=n.O9=void 0;const i=t(310);n.O9=()=>{const e="eu-central-1".split("-")[0];return i.UUID_VERSION[e]||i.UUID_VERSION.us},n.Wt=function(e,n){return!(!(null==e?void 0:e.mv_uuid)||(null==e?void 0:e.version)!==n)}}},n={};function t(i){var o=n[i];if(void 0!==o)return o.exports;var r=n[i]={exports:{}};return e[i].call(r.exports,r,r.exports,t),r.exports}t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{"use strict";var e,n=t(576),i=t(326),o=t(206),r=t(694),a=t(425),c=t.n(a),s=function(e,n,t,i){return new(t||(t=Promise))((function(o,r){function a(e){try{s(i.next(e))}catch(e){r(e)}}function c(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}s((i=i.apply(e,n||[])).next())}))},u=function(e,n){var t,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function c(c){return function(s){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,c[0]&&(a=0)),a;)try{if(t=1,i&&(o=2&c[0]?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,i=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=n.call(e,a)}catch(e){c=[6,e],i=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}},d="//exchange.mediavine.com";!function(e){var n=this;e.init=function(e){return s(n,[e],void 0,(function(e){e.slug;var n=e.gdpr,t=e.gdpr_compliance,o=e.alternateMvUuids,r=void 0===o?[]:o,a=e.s2sBidders;return u(this,(function(e){switch(e.label){case 0:return(0,i.isServingNonPersonalizedAds)(n,t)||!(0,i.hasValidCMP)(n)?[2]:(c()().then((function(e){window.$adManagementConfig&&window.$adManagementConfig.web&&(window.$adManagementConfig.web.tpc=e)})),window.addEventListener("message",p,!1),f(),[4,v(a,r)]);case 1:return m(e.sent()),[2]}}))}))},e.uuidVersion=(0,r.O9)()}(e||(e={}));var l,p=function(t){var i=[];if(t.data&&"syncUrls"===t.data.message){var r=t.data,a=r.tokens,c=r.syncUrls;(0,n.writeToAll)(o.tokenKey,a,o.cacheKey),(0,n.writeToAll)("".concat(o.tokenKey,"_").concat(e.uuidVersion),a,o.cacheKey),(c||[]).forEach((function(e){return i.push(function(e){return s(this,arguments,void 0,(function(e){var n=e.type,t=e.url;return u(this,(function(e){return[2,new Promise((function(e){switch(n){case l.iframe:m(t,e);break;case l.pixel:!function(e,n){var t=function(e,n){return void 0===n&&(n=!0),e?'<div style="position:absolute;left:0px;top:0px;visibility:hidden;">'+'<img src="'+(n?encodeURI(e):e)+'" alt="" width="1" height="1"></div>':""}(e,!1),i=document.createElement("div");i.innerHTML=t;var o=i.firstChild;n&&(o.addEventListener("load",n),o.addEventListener("error",n)),h(o,document,"html",!0)}(t,e);break;case l.script:!function(e,n){var t=document.createElement("script");t.setAttribute("src",e),n&&(t.addEventListener("load",n),t.addEventListener("error",n)),h(t,document,"html",!0)}(t,e)}}))]}))}))}(e))}))}},f=function(){new Event("UsersyncWriteToAll"),window.addEventListener("UsersyncWriteToAll",(function(t){(0,n.writeToAll)("am_tokens",t.detail,"am"),(0,n.writeToAll)("am_tokens_".concat(e.uuidVersion),t.detail,"am")}),!1)};function v(t,a){return s(this,void 0,void 0,(function(){var c,s,l,p,f,v,h,m,g,w;return u(this,(function(u){switch(u.label){case 0:return c="".concat(d,"/usersync/sync?origin=").concat(document.location.origin,"&src=").concat(d,"&s2sVersion=").concat("production"),[4,(0,n.readAndResolve)("".concat(o.tokenKey,"_").concat(e.uuidVersion))];case 1:return s=u.sent(),[4,(0,n.writeToAll)(o.tokenKey,s,o.cacheKey)];case 2:if(u.sent(),(0,r.Wt)(s,e.uuidVersion))l=null==s?void 0:s.mv_uuid;else for(p=0,f=a;p<f.length;p++)v=f[p],h=v.get(),!l&&(0,r.Wt)(h,e.uuidVersion)&&(l=h.mv_uuid);return l&&(c="".concat(c,"&mv_uuid=").concat(l,"&version=").concat(e.uuidVersion),a.forEach((function(n){return n.set({mv_uuid:l,version:e.uuidVersion})}))),window.__tcfapi?[4,(0,i.getTCFConsentString)(window.__tcfapi)]:[3,4];case 3:return m=u.sent(),c+="&gdpr=".concat(m?"1":"0","&gdpr_consent=").concat(m),[3,5];case 4:c+="&gdpr=0",u.label=5;case 5:return window.__uspapi?[4,(0,i.getCCPAString)(window.__uspapi)]:[3,7];case 6:g=u.sent(),c+="&us_privacy=".concat(g),u.label=7;case 7:return window.__gpp?[4,(0,i.getGPPString)(window.__gpp)]:[3,9];case 8:w=u.sent(),c+="&gppString=".concat(w),u.label=9;case 9:return c+="&p=".concat(function(e){var n={};return e.forEach((function(e){var t,i,o;(null===(o=null===(i=null===(t=window.$adManagementConfig)||void 0===t?void 0:t.web)||void 0===i?void 0:i.model)||void 0===o?void 0:o[e])&&(n[e]=window.$adManagementConfig.web.model[e])})),encodeURIComponent(JSON.stringify(n))}(t)),[2,c]}}))}))}function h(e,n,t,i){var o;n=n||document,o=t?n.getElementsByTagName(t):n.getElementsByTagName("head");try{if((o=o.length?o:n.getElementsByTagName("body")).length){o=o[0];var r=i?null:o.firstChild;return o.insertBefore(e,r)}}catch(e){}}function m(e,n){var t=function(e,n,t){return void 0===n&&(n=!0),void 0===t&&(t=""),e?(n&&(e=encodeURI(e)),t&&(t='sandbox="'.concat(t,'"')),"<iframe ".concat(t,'\n frameborder="0"\n allowtransparency="true"\n marginheight="0" marginwidth="0"\n width="0" hspace="0" vspace="0" height="0"\n style="height:0px;width:0px;display:none;"\n scrolling="no"\n src="').concat(e,'">\n </iframe>')):""}(e,!1,"allow-scripts allow-same-origin"),i=document.createElement("div");i.innerHTML=t;var o=i.firstChild;n&&(o.addEventListener("load",n),o.addEventListener("error",n)),h(o,document,"html",!0)}!function(e){e.pixel="pixel",e.iframe="iframe",e.script="script"}(l||(l={})),window.$adManagementConfig=window.$adManagementConfig||{},window.$adManagementConfig.web=window.$adManagementConfig.web||{},window.$adManagementConfig.web.usersyncInit=e.init})()})();