let tbpAccordion=document.getElementsByClassName("tbp-accordion-label"),tbpCheckboxes=document.querySelectorAll(".tbp-popup-checkbox"),tbpSubmitPopup=document.getElementById("tbp-submit"),taboolaConsentBanner=document.getElementById("tbp-consent"),taboolaConsentPopup=document.getElementById("tbp-cookie-popup"),tbp={version:4.1,initialized:!1,consented:!1,tbp_override_country:null,tbp_required_countries:["US","CA","DE","AU","AT","BE","BG","HR","CY","CZ","DK","EE","FI","NO","FR","DE","GR","HU","IE","IT","IS","LV","LU","MT","NL","PL","PT","LI","RO","SK","SI","ES","SE","UK","GB","CH"],tbp_sls_countries:["US","CA","GB","AT","FR","ZA","DE","CH","NZ","ES","AU","IE","BE","LU","MC","MX","PL","NL","BR","JP","IS","NO","SE","FI","DK","IN","IL"],tbpCookieState:{StrictlyNecessaryCookies:!0,FunctionalCookies:!0,PerformanceCookies:!0,TargetingCookies:!0},popupActive:!1,tbp_consent_messages:{en:{message:'We and our partners use cookies on this website to keep it working properly, to enhance your user experience and for advertising purposes. For more information on the types of cookies we use and how to disable them, please see our Cookie Policy.',buttonAccept:"Accept All",buttonDeny:"Deny All",buttonManage:"Manage Cookies"}},tbpHashString:function(t){let e,n;for(e=0;e-1},tbpLoadJSON:function(t,e,n){let o=new XMLHttpRequest;o.onreadystatechange=function(){o.readyState===XMLHttpRequest.DONE&&(200===o.status?e&&e(JSON.parse(o.responseText)):n&&n(o))},o.open("GET",t,!0),o.send()},tbpDomainWhitelisted:function(){return!0},tbpSaveSettings:function(t){let e=JSON.stringify(t);tbp.tbpSetCookie("siteConfiguration",e)},tbpGetSettings:function(){let t=tbp.tbpGetCookie("siteConfiguration")||"{}";return JSON.parse(t)},tbpIsRequiredCountry:function(t){return"string"!=typeof t&&(t=""),-1!==tbp.tbp_required_countries.indexOf(t.toUpperCase())},tbpIsSLSCountry:function(t){return"string"!=typeof t&&(t=""),-1!==tbp.tbp_sls_countries.indexOf(t.toUpperCase())},tbpGetCountryCode:function(){return tbp.tbpGetCookie("siteCountryCode")},tbpSetCountryCode:function(t){tbp.tbpSetCookie("siteCountryCode",t,1)},tbpSetCookie:function(t,e,n,o=!1){let i="";if(n){let t=new Date;t.setTime(t.getTime()+24*n*60*60*1e3),i="; expires="+t.toUTCString()}document.cookie=t+"=; Max-Age=-99999999; ",document.cookie=t+"="+(e||"")+i+"; domain=.taboola.com; path=/ ; SameSite=None ; Secure;",o||(document.cookie=t+"="+(e||"")+i+"; path=/; SameSite=None ; Secure;"),"dev.taboola.local"==location.hostname&&(document.cookie=t+"="+(e||"")+i+";")},tbpGetCookie:function(t){let e=t+"=",n=document.cookie.split(";");for(let t=0;t{t.addEventListener("change",(e=>{tbp.tbpCookieState[t.name]=t.checked}))})),tbpSubmitPopup.addEventListener("click",(t=>{tbp.tbpConsentSettings(!0),tbp.tbpConfirmConsent(),tbp.tbpHideConsentPopup()}))},tbpShowManageCookiesPopup:function(){tbp.popupActive=!0,taboolaConsentPopup.style.display="block",tbp.tbpHideConsentMessage()},tbpConsentSettings:function(t=!0){let e=Object.keys(tbp.tbpCookieState).filter((t=>!0===tbp.tbpCookieState[t]));return t?e.join(","):e},tbpSetConsent:function(){tbp.tbpSetCookie("tbp-consent",tbp.tbpConsentSettings(!0),365),tbp.tbpFireGTMConsent(tbp.tbpConsentSettings(!0)),tbp.tbpFiredSavedEvent()},tbpSetGoogleV2ConsentFlag:!1,tbpSetGoogleV2Consent:function(t=!1){(!1===tbp.tbpSetGoogleV2ConsentFlag||t)&&(gtag("consent","default",{ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",analytics_storage:"denied",wait_for_update:250}),tbp.tbpSetGoogleV2ConsentFlag=!0);let e=tbp.tbpGetCookie("tbp-consent")||"";window.gtag("consent","update",{ad_storage:-1!==e.indexOf("TargetingCookies")?"granted":"denied",analytics_storage:-1!==e.indexOf("PerformanceCookies")?"granted":"denied",ad_user_data:-1!==e.indexOf("TargetingCookies")?"granted":"denied",ad_personalization:-1!==e.indexOf("TargetingCookies")?"granted":"denied"})},tbpFireGTMConsent:function(t){tbp.tbpSetGoogleV2Consent(),window.dataLayer.push({event:"tbpConsentConfirmed",consentSettings:t})},tbpFiredSavedEvent:function(){const t=new Event("tbpConsentSaved");window.dispatchEvent(t)},tbpShowConsentForCountry:function(t){t=t?t.toUpperCase():"UK",tbp.tbpIsRequiredCountry(t)?tbp.tbpShowConsent(t):tbp.tbpConfirmConsent()},tbpUpdateConsentMessage:function(t){t=(t=void 0!==t?t.toLowerCase():"en").toLowerCase(),tbp.tbp_consent_messages[t]||(t="en"),document.getElementById("tbp-consent-text").innerHTML=tbp.tbp_consent_messages[t].message,document.getElementById("tbp-consent-confirm").innerText=tbp.tbp_consent_messages[t].buttonAccept,document.getElementById("tbp-consent-deny").innerText=tbp.tbp_consent_messages[t].buttonDeny,document.getElementById("tbp-consent-manage").innerText=tbp.tbp_consent_messages[t].buttonManage},tbpIsConsented:function(){return null!==tbp.tbpGetCookie("tbp-consent")},tbpThrowNotRecognized:function(){tbp.tbpLoadJSON("https://geoip.codejitsu.ca/report-failure",(function(){}),(function(){})),"undefined"!=typeof dataLayer&&dataLayer.push({event:"tbpConsentNotRecognizable"})},tbpOptOutGA:function(){window.gaProperties&&"object"==typeof window.gaProperties&&window.gaPropertiesDisableString.forEach((function(t){tbp.tbpSetCookie(t,!0,365),document[t]=!0}))},tbpOptInGA:function(){window.gaProperties&&"object"==typeof window.gaProperties&&window.gaPropertiesDisableString.forEach((function(t){tbp.tbpUnsetCookie("ua_disable_string"),document[t]=void 0}))},tbpOptInOutToggle:function(){return tbp.tbpGetOptOutStatus()?(tbp.tbpSetCookie("DNT","",365,!0),tbp.tbpOptInGA(),!1):(tbp.tbpSetCookie("DNT","1",365,!0),tbp.tbpOptOutGA(),!0)},tbpGetOptOutStatus:function(){let t=tbp.tbpGetCookie("DNT");return!(!t||""===t)},tbpResizeElementHeight:function(t){let e=0,n=window.document.body;window.innerHeight?e=window.innerHeight:n.parentElement.clientHeight?e=n.parentElement.clientHeight:n&&n.clientHeight&&(e=n.clientHeight),t.style.height=e-t.offsetTop/2+"px"},tbpInitialize:function(t){tbp.initialized||(tbp.initialized=!0,void 0!==t&&(this.tbpSetCountryCode(t),tbp.tbp_override_country=t),tbp.tbpIsConsented()&&tbp.tbpGetCookie("siteCountryCode")?tbp.tbpSetGoogleV2Consent():(tbp.tbpSetGoogleV2Consent(!0),tbp.tbpGetCookie("siteCountryCode")?tbp.tbpShowConsentForCountry(tbp.tbpGetCookie("siteCountryCode")):tbp.tbpLoadJSON("https://geoip.codejitsu.ca/json",(function(t){t&&t.country_code?(tbp.tbpSetCookie("siteCountryCode",t.country_code,1),t.region_code&&tbp.tbpSetCookie("siteState",t.region_code,365),tbp.tbpShowConsentForCountry(t.country_code),tbp.userCountryCode=t.country_code):(tbp.tbpThrowNotRecognized(),tbp.tbpShowConsent())}),(function(){tbp.tbpThrowNotRecognized(),tbp.tbpShowConsent()}))))},tbpActivateCookieButtonListener:function(){const t=document.getElementById("tbp-display-cookie-banner");null!==t&&t.addEventListener("click",(()=>{taboolaConsentBanner.classList.remove("tbp-hidden"),tbp.initialized=!1,tbp.consented=!1,tbp.tbpShowConsent(tbp.userCountryCode,!0)}))}};window.addEventListener("resize",(()=>{tbp.tbpResizeElementHeight(document.getElementById("tbp-cookie-popup"))}));let __collect_ip=function(){tbp.tbpLoadJSON("https://geoip.codejitsu.ca/ip.php",(function(t){t&&t.md5&&"undefined"!=typeof dataLayer&&dataLayer.push({IPAddress:t.md5,event:"userIP"})}),(function(){}))};"loading"!==document.readyState?__collect_ip():document.addEventListener("DOMContentLoaded",(function(){__collect_ip()}));let checkLastTrafficSource=function(){let t=tbp.tbpGetCookie("lastTrafficSource")||"",e=tbp.tbpHashString(t);return!e||tbp.tbpGetSettings().lts==e},updateLastTrafficSourceInSettings=function(){let t=tbp.tbpGetCookie("lastTrafficSource")||"",e=tbp.tbpHashString(t),n=tbp.tbpGetSettings();n.lts=e,tbp.tbpSaveSettings(n)};if(!checkLastTrafficSource()){let t=tbp.tbpGetCookie("_mkto_trk"),e=tbp.tbpGetCookie("lastTrafficSource")||"";if(t){t=btoa(t);let n=new XMLHttpRequest;n.withCredentials=!1,n.addEventListener("readystatechange",(function(){4===this.readyState&&updateLastTrafficSourceInSettings()})),n.open("GET","https://helpersng.taboola.com/mkto-update-last-ts?lastUTMData="+encodeURIComponent(e)+"&mktoToken="+t),n.send()}}window.tbp=tbp,window.dataLayer=window.dataLayer||[],window.gtag=window.gtag||function(){dataLayer.push(arguments)},tbp.tbpSetGoogleV2Consent(!0);