1document.addEventListener("DOMContentLoaded", () => { 2 const scriptTag = document.getElementById('cookiemessagescript'); 3 if (scriptTag) { 4 const popupBackground = scriptTag.getAttribute('data-popup-background'); 5 const popupTextColour = scriptTag.getAttribute('data-popup-text-colour'); 6 const popupMessage = scriptTag.getAttribute('data-popup-message'); 7 const acceptButtonBackground = scriptTag.getAttribute('data-accept-button-background'); 8 const acceptTextColour = scriptTag.getAttribute('data-accept-button-text-colour'); 9 const acceptText = scriptTag.getAttribute('data-accept-text'); 10 const denyButtonBackground = scriptTag.getAttribute('data-deny-button-background'); 11 const denyTextColour = scriptTag.getAttribute('data-deny-button-text-colour'); 12 const denyText = scriptTag.getAttribute('data-deny-text'); 13 const link = scriptTag.getAttribute('data-link'); 14 const url = scriptTag.getAttribute('data-url'); 15 window.cookieconsent.initialise({ 16 "palette": { 17 "popup": { 18 "background": popupBackground, 19 "text": popupTextColour 20 }, 21 "button": { 22 "background": acceptButtonBackground, 23 "text": acceptTextColour 24 }, 25 "highlight": { 26 "background": denyButtonBackground, 27 "text": denyTextColour 28 } 29 }, 30 "position": "bottom-left", 31 "type": "opt-in", 32 "content": { 33 "message": popupMessage, 34 "allow": acceptText, 35 "deny": denyText, 36 "link": link, 37 "href": url 38 }, 39 "onStatusChange": function (status) { 40 window.dataLayer = window.dataLayer || []; 41 function gtag() { 42 dataLayer.push(arguments); 43 } 44 const consentMode = { 45 'ad_user_data': status === 'deny' ? 'denied' : 'granted', 46 'ad_personalization': status === 'deny' ? 'denied' : 'granted', 47 'ad_storage': status === 'deny' ? 'denied' : 'granted', 48 'analytics_storage': status === 'deny' ? 'denied' : 'granted', 49 'wait_for_update': 500 50 }; 51 gtag('consent', 'update', consentMode); 52 setCookie('consentMode', JSON.stringify(consentMode)); 53 window.location.reload(); 54 } 55 }); 56 function denyCookies() { 57 document.cookie.split(';').forEach(c => { 58 if (!c.includes("cookieconsent_status")) { 59 document.cookie = c.replace(/^ +/, '').replace(/=.*/, `=;expires=${new Date().toUTCString()};path=/`); 60 } 61 }); 62 return fetch(`/umbraco/api/CookieConsent/ClearAllCookies`); 63 } 64 function setCookie(name, value, days, path, domain, secure) { 65 let cookie = `${name}=${encodeURIComponent(value)}`; 66 if (days) { 67 const expiry = new Date(); 68 expiry.setDate(expiry.getDate() + days); 69 cookie += `; expires=${expiry.toUTCString()}`; 70 } 71 if (path) cookie += `; path=${path}`; 72 if (domain) cookie += `; domain=${domain}`; 73 if (secure) cookie += `; secure`; 74 document.cookie = cookie; 75 } 76 } 77}); 78//# sourceMappingURL=cookiemessage.js.map
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.