1(function () { 2 const name = 'jump_cookie_consent_4' 3 const googleTagManagerInUse = window.gtag !== undefined; 4 5 const expires = () => { 6 const year = 365 * 24 * 60 * 60 * 1000; 7 const date = new Date(); 8 date.setTime(date.getTime() + 20 * year); 9 return date.toUTCString(); 10 } 11 12 let value = { 13 accepted: false, 14 acceptedAll: false, 15 cookiePreferences: {}, 16 googleConsentTypes: {}, 17 created: Math.floor(Date.now() / 1000), 18 }; 19 20 const acceptMakeCookie = () => { 21 const newValue = { 22 ...value, 23 accepted: true, 24 }; 25 26 document.cookie = 27 name + '=' + JSON.stringify(newValue) + '; expires=' + expires() + ';path=/'; 28 } 29 30 31 // Cookie popup 32 const cookiePopup = document.querySelector('[data-control="cookieConsent"]'); 33 const cookiePopupButton = cookiePopup ? cookiePopup.querySelector('[data-control="cookieConsent_button"]') : null; 34 35 if (cookiePopup && cookiePopupButton) { 36
37 cookiePopupButton.addEventListener('click', () => { 38 value.acceptedAll = true; 39 const allGrants = { 40 'ad_storage': 'granted', 41 'ad_user_data': 'granted', 42 'ad_personalization': 'granted', 43 'analytics_storage': 'granted' 44 }; 45 46 // Add Google Consent Types to cookie 47 value.googleConsentTypes = allGrants; 48 49 acceptMakeCookie(); 50 51 if (googleTagManagerInUse) { 52 gtag('consent', 'update', allGrants); 53 } 54 55 cookiePopup.style.display = 'none'; 56 }); 57 } 58 59 // Cookie preferences form 60 const cookiePreferencesForm = document.querySelector('[data-control="cookieConsentForm"]'); 61 62 if (cookiePreferencesForm) { 63 if (cookiePopup) { 64 cookiePopup.style.display = 'none'; 65 } 66 67 cookiePreferencesForm.addEventListener('submit', e => { 68 e.preventDefault(); 69 const inputs = cookiePreferencesForm.querySelectorAll('input[type=radio]:checked'); 70 let googleConsentTypes = [] 71 72 for (let i = 0; i < inputs.length; i++) { 73 value.cookiePreferences[inputs[i].name] = inputs[i].value; 74 const type = inputs[i].dataset.googleConsentType 75 76 if (type) { 77 googleConsentTypes.push({ type, value: inputs[i].value }); 78 } 79 } 80 81 if (googleConsentTypes.length) { 82 const grants = googleConsentTypes.reduce(function (acc, current) { 83 acc[current.type] = current.value === 'disallow' ? 'denied' : 'granted'; 84 85 return acc; 86 }, {}) 87 88 // Add Google Consent Types to cookie 89 value.googleConsentTypes = grants; 90 91 if (googleTagManagerInUse) { 92 gtag('consent', 'update', grants); 93 } 94 } 95 96 acceptMakeCookie(); 97 98 window.location = document.referrer ? document.referrer : '/'; 99 }); 100 } 101})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.