!function(){var e=window;if(e.tpd=e.tpd||{},e.tpd.cookies=e.tpd.cookies||{},e.tpd.cookies=Object.assign(e.tpd.cookies,{getByName:function(e){for(var t=e+"=",i=decodeURIComponent(document.cookie).split(";"),o=0;o a");t&&("login"===e?(t.removeEventListener("click",window.tpdAdmiral.showManage),t.addEventListener("click",window.tpdAdmiral.showLogin)):"manage"===e&&(t.removeEventListener("click",window.tpdAdmiral.showLogin),t.addEventListener("click",window.tpdAdmiral.showManage)))},updateButtonTextTo:function(e){var t=document.querySelector(".register-page-login-button > a");t&&(t.innerText=e)},showManage:function(e){"object"==typeof e&&(e.preventDefault(),window.tpdAdmiral.showForm("manage"))},showLogin:function(e){"object"==typeof e&&(e.preventDefault(),window.tpdAdmiral.showForm("login"))},showForm:function(e){window.admiral("show","transact."+e)}}),void 0!==window.admiral){window.admiral("after","transact.loggedOut",function(){e.tpd.cookies.setAdmiralCookieVal("non-subscriber"),e.tpdAdmiral.updateButtonTextTo("Login"),e.tpdAdmiral.updateClickListenerTo("login")}),window.admiral("after","measure.detected",function(t){t.subscribed?(e.tpd.cookies.setAdmiralCookieVal("subscriber"),e.tpdAdmiral.updateButtonTextTo("Manage"),e.tpdAdmiral.updateClickListenerTo("manage")):(t.adblocking,e.tpd.cookies.setAdmiralCookieVal("non-subscriber"),e.tpdAdmiral.updateButtonTextTo("Login"),e.tpdAdmiral.updateClickListenerTo("login"))});var t=document.querySelector(".register-page-get-started-button");if(t)t.querySelector("span").addEventListener("click",function(e){e.preventDefault(),window.admiral("show","transact.subscribe")});var i=document.querySelector(".register-page-bottom-get-started-button");if(i)i.querySelector("span").addEventListener("click",function(e){e.preventDefault(),window.admiral("show","transact.subscribe")})}}();; !function(){let t=window,e=document;t.tpd=t.tpd||{},t.tpd.utils=t.tpd.utils||{};let n=t.tpd.utils;n.loadScript=function(t,n=!0,o=null,l=null,r=null,i=null){let d=e.createElement("script");if(d.src=t,d.async=!0,"function"==typeof l&&d.addEventListener("load",l),r&&(d.id=r),"object"==typeof i)for(let t in i)d.setAttribute(t,i[t]);o||(o=e.body),o.appendChild(d)},n.lazyLoadingCurrently=[],n.getLazyLoadingObjIndFromDom=function(t){for(let e=0,n=this.lazyLoadingCurrently.length;e=0;t--)if(t===o){n.lazyLoadingCurrently.splice(t,1);break}},l)};r.obs.observe(e),this.lazyLoadingCurrently.push(r)},n.afterDomContentLoaded=function(t){"loading"===e.readyState?e.addEventListener("DOMContentLoaded",t):t()},n.cmd=n.cmd||[],function(){let t=n.cmd.length;if(t>0)for(let e=0;ee.getElementsByTagName(t),n=(e,t)=>e.getElementsByClassName(t);let r=n(e,"mob-menu-container")[0];if(!r)return;let o=n(e,"header"===tpdThemeSettings.selectedHeader?"header":"header-container")[0];if(!o)return;const i=(e,t)=>e.classList.contains(t);let a="header"===o.tagName?o:t(e,"header")[0];if(!a)return;let s=t(a,"nav")[0];if(!s)return;let d=e.body,l=n(s,"menu-item-has-children"),c=n(s,"search-input");r.addEventListener("click",function(){let e=o.getBoundingClientRect().top,t=o.offsetHeight+e;this.classList.toggle("change"),i(s,"active")?(()=>{if(s.classList.remove("active"),s.style.top="0px",d.style.overflow="auto",l)for(let e,t=0,n=l.length;t{s.classList.add("active"),s.style.top=`${e}px`,d.style.overflow="hidden"})(t)})}),function(){let e=tpdThemeSettings.selectedHeader;if(!["header","header-1","header-2"].includes(e))return;let t=window,n=document;t.tpd=t.tpd||{},t.tpd.adBlockerInUse=!1,t.tpd.pullHeaderUp=function(){var t=null;if("header"===e?t="header.header.sticky":"header-1"===e?t="span.header-container.banner-style":"header-2"===e&&(t="header.header-2"),!t)return;let r=n.querySelector("header."+e),o=n.querySelector("header-1"===e?"span.header-container.banner-style":"header.header-2");r&&(r.style.top="0px"),o&&(o.style.top="0px")};var r=function(){!0!==t.tpd.adBlockerInUse&&(t.tpd.adBlockerInUse=!0,t.tpd.pullHeaderUp(),n.body.classList.add("user-is-adblocking"))},o=function(e){"object"==typeof e.target&&"SCRIPT"===e.target.tagName&&e.target.src.includes("cdn.tpdads.com")&&(t.removeEventListener("error",o),r())};t.addEventListener("error",o,!0),t.addEventListener("load",function(){n.querySelector('script[src*="cdn.tpdads.com"]')&&(t.tpd.hasOwnProperty("publisherId")||r())})}(),function(){let e=tpdThemeSettings.stickyBanner_settings;if("object"==typeof e&&("on"===e.enabled||"on"===e.enabled_mobile)&&("on"===e.enabled||window.tpdMobile)&&("on"===e.enabled_mobile||!window.tpdMobile)){if(window.tpdMobile&&"on"===e.enabled_mobile){var t=document.querySelector(".header");if(!t)return;var n=10,r=document.querySelector(".tpd-banner-mobile"),o=document.querySelector(".header-container")?document.querySelector(".header-container"):0,i=r?r.clientHeight:0,a=e.timing_mobile,s="0";document.body.classList.contains("admin-bar")&&(s="32px"),void 0!==a&&(n=parseInt(a)),n*=1e3,setTimeout(function(){r&&"header-4"!==tpdThemeSettings.selectedHeader&&(r.style.top="-"+i+"px"),t.style.top=s,o&&(o.style.top="0px");let e=r.querySelector(".tpd-banner-ad-container");if(!e)return;let n=e.querySelector("div[ data-google-query-id ]");n&&"none"===n.style.display&&(e.style.minHeight="0px")},n)}else if(!window.tpdMobile&&"on"===e.enabled){var d=document.querySelector(".header:not(.sticky-banner-nav)");if(!d)return;var l=10,c=document.querySelector(".tpd-banner-desktop"),u=e.timing,p="0";document.body.classList.contains("admin-bar")&&(p="32px"),void 0!==u&&(l=parseInt(u)),l*=1e3;var g=new MutationObserver(function(t){!function(t){if("none"===t.style.display){let e=document.querySelector(".tpd-banner-desktop > .tpd-banner-ad-container");e&&(e.style.minHeight="0px")}if(!0!==e.done){e.done=!0;var n=c.clientHeight;"32px"===p&&(n+=32),d.style.top=n+"px",setTimeout(function(){c.style.top="-999px",d.style.top=p,document.querySelector(".nav").classList.contains("active")&&(document.querySelector(".nav.active").style.top=d.offsetHeight+"px")},l)}}(t[0].target)});if(c){var h=c.querySelector(".tpd-banner-ad-container").children;if(h.length>0)for(var m=0,f=h.length;m{let e=document,t=window,n=t.tpdMobile;const r=t=>e.querySelector(t);let o=r(".nav"),i=r(".tpd-banner-mobile"),a=r(".tpd-banner-desktop"),s=r(".header-container");const d=e=>e.getBoundingClientRect().height,l=e=>getComputedStyle(e).top;t.addEventListener("resize",function(){if(!o)return;if(!o.classList.contains("active"))return;let e=i?d(i)+d(s):d(s),t=l(n?i:a);o.style.top=`calc( ${t} + ${e}px )`})})()}}(),function(){try{const t={root:null,rootMargin:String(window.innerHeight)+"px",threshold:0},n=()=>{const e=document.querySelectorAll(".instagram-media");if(!e||0===e.length)return;const n=[];new Promise(t=>{e.forEach(e=>{n.push(e.getAttribute("src")),e.removeAttribute("src"),e.loading="lazy"}),0!==n.length&&t()}).then(()=>{const r=new IntersectionObserver((t,r)=>{t.forEach(t=>{if(t.isIntersecting){const o=t.target,i=Array.from(e).indexOf(o);-1!==i&&n[i]&&(o.src=n[i]),r.unobserve(o)}})},t);e.forEach(e=>{r.observe(e)})})};document.addEventListener("DOMContentLoaded",()=>{n()});const r=()=>{const e=document.querySelectorAll("figure.wp-block-embed-twitter");if(!e||0===e.length)return;const n=[];new Promise(t=>{e.forEach(e=>{const t=e.querySelector("iframe");t&&(n.push(t.getAttribute("src")),t.removeAttribute("src"),t.loading="lazy")}),0!==n.length&&t()}).then(()=>{const r=new IntersectionObserver((t,r)=>{t.forEach(t=>{if(t.isIntersecting){const o=t.target,i=o.querySelector("iframe"),a=Array.from(e).indexOf(o);-1!==a&&i&&n[a]&&(i.src=n[a]),r.unobserve(o)}})},t);e.forEach(e=>{r.observe(e)})})};window.addEventListener("load",r)}catch(e){console.warn("[TPD] Error running social embed lazy loading "+e)}}(),window.addEventListener("load",function(){function e(){let e=this.parentNode;if(e.classList.toggle("open"),e.classList.contains("open")){e.children[0].setAttribute("href","#"),(t=e,Array.prototype.filter.call(t.parentNode.children,function(e){return e!==t})).forEach(e=>{e.classList.contains("open")&&e.classList.remove("open")})}var t}document.querySelectorAll(".menu-item-has-children").forEach(e=>{let t=document.createElement("div");t.classList.add("toggle-menu"),e.prepend(t)}),document.querySelectorAll(".toggle-menu").forEach(t=>{t.addEventListener("click",e)})}),function(){let e=document,t=window;let n=[];var r=function(t){n.includes(t)||(n.push(t),t.addEventListener("click",function(t){let n=e.querySelector("form.search"),r=e.querySelector("form.search input.search-input");if(n.classList.contains("active"))return t.preventDefault(),void(""===r.value?n.classList.remove("active"):n.submit());n.classList.add("active")}))};let o=e.querySelectorAll("header button.search-submit");o.length>0&&o.forEach(function(e){r(e)}),t.addEventListener("load",function(){0!==(o=e.querySelectorAll("header button.search-submit")).length&&o.forEach(function(e){r(e)})})}(),function(){var e=document.querySelectorAll("ul.sharing a.bttn:not( .email-bttn )");if(e.length){function t(e,t,n=10){if(e.tagName===t)return e;for(var r=1;e.parentNode;){if((e=e.parentNode).tagName===t)return e;if(r>n)return null;r+=1}}for(var n=0,r=e.length;n{t[r].afterDomContentLoaded(function(){if(!0!==tpdThemeSettings.espSignup.enabled)return;let t=document,n=t.querySelector('form[name="sign-up"]');n&&n.addEventListener("submit",function(r){r.preventDefault();let o=new FormData(n);o.append("security",tpdThemeSettings.espSignup.nonce);let i=new XMLHttpRequest;i.open("POST",tpdThemeSettings.espSignup.ajaxUrl),i.onreadystatechange=function(){if(i.readyState===XMLHttpRequest.DONE)if(200===i.status){t.querySelectorAll(".success-message, .success-message svg").forEach(function(e){e.classList.add("active")})}else e.error(`[TPD][ESPSignup] Request failed with status ${i.status}`)},i.onerror=function(t){e.error(`[TPD][ESPSignup] Request failed with error ${t}`)},i.send(o)})})})}catch(n){e.error(`[TPD][ESPSignup] Run-time error ${n}`)}}(),function(){if("header-4"!==tpdThemeSettings.selectedHeader)return;let e=window;e.googletag=e.googletag||{},e.googletag.cmd=e.googletag.cmd||[];const t=tpdMobile?tpdThemeSettings.stickyBanner_settings.timing_mobile:tpdThemeSettings.stickyBanner_settings.timing;let n=null;void 0!==t&&(n=1e3*parseInt(t));const r=document.querySelector(".banner-container.banner-style:not(.ad-disabled)"),o=document.querySelector(".banner-spacer-top"),i=document.querySelector("#content"),a=document.querySelector(".wp-post-image"),s=document.querySelector("body.home article .tpd-card-main"),d=document.querySelector("header.sticky-banner-nav"),l=tpdThemeSettings.bannerTargetDOM.split(",").map(e=>e.trim()).filter(e=>e.length>0).map(e=>document.querySelector(e)).find(e=>null!==e)||a;if(!(r&&i&&l&&d))return;let c=tpdMobile?tpdThemeSettings.stickyBanner_settings.banner_mobile_height:tpdThemeSettings.stickyBanner_settings.banner_desktop_height;c=parseInt(c.replace(" px",""),10);const u=()=>{const e=l.getBoundingClientRect().top,n=s?s.getBoundingClientRect().top:0,r=d.offsetHeight,o=t?i.getBoundingClientRect().top:i.getBoundingClientRect().top-(tpdMobile?10:30),a=n?n-o:e-o;return{validTopFeaturedImageTop:e,tpdCardTop:n,navHeight:r,contentTop:o,heightNeeded:a,totalHeight:c+r+a}},p=(e,t,n,a)=>{o.style.height="0",o.style.paddingTop="0",i.style.paddingTop=tpdMobile?"10px":"30px",r.style.position="sticky",r.style.height=`${t}px`,r.style.top=`-${t-n}px`,r.style.marginBottom=`-${a}px`,d.style.top=`${e}px`,d.style.marginBottom=""};if(e.googletag.cmd.push(()=>{const e=t=>{t.slot.getSlotElementId()&&r&&!isNaN(n)&&setTimeout(()=>{const{navHeight:e,totalHeight:t,heightNeeded:n}=u();p(c,t,e,n)},n),googletag.pubads().removeEventListener("impressionViewable",e)};googletag.pubads().addEventListener("impressionViewable",e)}),r&&isNaN(n)){const{navHeight:e,totalHeight:t,heightNeeded:n}=u();p(c,t,e,n)}}();;