;(function(window){if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;}
if(!Element.prototype.closest){Element.prototype.closest=function(s){var el=this;do{if(Element.prototype.matches.call(el,s))return el;el=el.parentElement||el.parentNode;}while(el!==null&&el.nodeType===1);return null;};}
window.addEventListener('DOMContentLoaded',function(){var overlayHtml=['<div class="video-cookie-overlay">','<div>','<p>','This content cannot be displayed until agreeing to our use of Social Media cookies. ','<a href="https://go.microsoft.com/fwlink/?linkid=845480" target="_blank" rel="noopener">Learn more</a>.','</p>','<p>','<button class="btn js-manage-consent" type="button">Manage cookies</button>','</p>','</div>','</div>',].join('');var gtagCookies=function(){return document.cookie.split(';').map(function(cookie){return cookie.trim().split('=').shift();}).filter(function(name){return name.indexOf('_g')===0;});}
var clearCookies=function(cookies){if(!cookies.length){return;}
var expires=new Date(Date.now()-864e5).toUTCString();var domain='.'+window.location.hostname.split('.').slice(-2).join('.');cookies.forEach(function(cookie){document.cookie=cookie+'=deleted; expires='+expires+'; path=/; domain='+domain;});};var iframes=Array.prototype.slice.call(document.querySelectorAll('.ipsEmbeddedVideo iframe'));iframes.forEach(function(iframe){if(iframe.dataset.embedSrc){iframe.dataset.src=iframe.dataset.embedSrc;iframe.removeAttribute('data-embed-src');}});iframes=iframes.filter(function(iframe){return!!iframe.dataset.src;});var onInit=function(err,siteConsent){if(err){return;}
if(!siteConsent.isConsentRequired||siteConsent.getConsentFor('SocialMedia')){iframes.forEach(function(iframe){iframe.src=iframe.dataset.src;});}else{typeof CKEDITOR!=='undefined'&&CKEDITOR.on('instanceReady',function(e){var editor=e.editor;$(editor.element.$.form).on('submit',function(e){var $form=$(e.currentTarget);if($form.data('processed')){return;}
$form.data('processed',true);e.preventDefault();e.stopImmediatePropagation();e.stopPropagation();var $html=$('<div>'+editor.getData()+'</div>');$html.find('.video-cookie-overlay').remove();editor.setData($html.html());editor.updateElement();setTimeout(function(){$form.data('processed',false);},2000);$form.trigger('submit');});});iframes.forEach(function(iframe){if(iframe.querySelector('.video-cookie-overlay')){return;}
iframe.closest('.ipsEmbeddedVideo').innerHTML+=overlayHtml;});window.addEventListener('load',function(){$(document).on('contentChange',function(e){$('.ipsEmbeddedVideo iframe[src]').each(function(i,iframe){if(iframe.hasAttribute('src')){iframe.setAttribute('data-embed-src',iframe.src);}
iframe.removeAttribute('src');if(iframe.querySelector('.video-cookie-overlay')){return;}
iframe.closest('.ipsEmbeddedVideo').innerHTML+=overlayHtml;});$(document).on('click','.js-manage-consent',function(e){e.preventDefault();siteConsent.manageConsent();})});});}
if(siteConsent.isConsentRequired){document.getElementById('elFooterLinks').innerHTML+='<li><a href="#" class="js-manage-consent">Manage cookies</a></li>';if(!siteConsent.getConsentFor('Analytics')){clearCookies(gtagCookies());}}
Array.prototype.forEach.call(document.querySelectorAll('.js-manage-consent'),function(el){el.addEventListener('click',function(e){e.preventDefault();siteConsent.manageConsent();});});var consent=siteConsent.getConsent();window.onConsentChanged.callbacks.forEach(function(cb){cb(consent);});window.onConsentChanged=function(cb){cb(consent);};};var onConsentChanged=function(){window.location.reload();};window.WcpConsent&&window.WcpConsent.init(document.documentElement.lang,'cookie-banner',onInit,onConsentChanged,window.WcpConsent.themes.dark);});}(window));;