1var __defProp = Object.defineProperty; 2var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 3var __decorate = (decorators, target, key, kind) => { 4 var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; 5 for (var i = decorators.length - 1, decorator; i >= 0; i--) 6 if (decorator = decorators[i]) 7 result = (kind ? decorator(target, key, result) : decorator(result)) || result; 8 if (kind && result) 9 __defProp(target, key, result); 10 return result; 11}; 12import {customElement, property, LitElement, html, css} from "../web_modules/lit-element.js"; 13export let CookieConsentTrigger = class extends LitElement { 14 constructor() { 15 super(...arguments); 16 this.linkText = "Cookie Settings"; 17 this.cookieId = "PM_GDPR_CC"; 18 this.reloadpage = "true"; 19 } 20 static get styles() { 21 return css` 22 :host{ 23 24 } 25 :host * { 26 box-sizing: border-box; 27 } 28 29 .display-as-link { 30 appearance:none; 31 background:none; 32 border:none; 33 cursor:pointer; 34 line-height:3; 35 } 36 37 ::slotted(*){ 38 /*color:var(--cta-text-color,white) !important;*/ 39 color:var(--brand-color-dark,black); 40 font-family: var(--font-base, sans-serif); 41 text-decoration:underline; 42 } 43 `; 44 } 45 static setCookie(cname, cvalue, exdays) { 46 const d = new Date(); 47 d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1e3); 48 const expires = "expires=" + d.toUTCString(); 49 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 50 } 51 static getCookie(cname) { 52 const name = cname + "="; 53 const decodedCookie = decodeURIComponent(document.cookie); 54 const ca = decodedCookie.split(";"); 55 for (let i = 0; i < ca.length; i++) { 56 let c = ca[i]; 57 while (c.charAt(0) == " ") { 58 c = c.substring(1); 59 } 60 if (c.indexOf(name) == 0) { 61 return c.substring(name.length, c.length); 62 } 63 } 64 return ""; 65 } 66 static deleteCookie(cname) { 67 document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;'; 68 } 69 triggerCookieConsent() { 70 let alternativeCookieBannerIsActive=(window['alternativeCookieBanner'] === true ); 71 const weHaveKdCookie= CookieConsentTrigger.getCookie('KD_GDPR_CC'); 72 if(weHaveKdCookie.length>0){ 73 alternativeCookieBannerIsActive=true; 74 } 75 if (alternativeCookieBannerIsActive) { 76 window["loadCookiebannerHtml"](); 77 } else { 78 CookieConsentTrigger.setCookie(this.cookieId, "reset", 1); 79 80 if (this.reloadpage === "true") { 81 setTimeout(() => { 82 location.reload(); 83 }, 1e3); 84 } 85 } 86 } 87 render() { 88 return html` 89 <button class="display-as-link" @click="${this.triggerCookieConsent}"> 90 <slot> </slot> 91 </button> 92 `; 93 } 94}; 95__decorate([ 96 property() 97], CookieConsentTrigger.prototype, "linkText", 2); 98__decorate([ 99 property() 100], CookieConsentTrigger.prototype, "cookieId", 2); 101__decorate([ 102 property() 103], CookieConsentTrigger.prototype, "reloadpage", 2); 104CookieConsentTrigger = __decorate([ 105 customElement("cookie-banner-trigger") 106], CookieConsentTrigger);
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.