function checkMobile(){(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=580)&&(isMobile=!0,mobileWidth=window.innerWidth)}function registerEvents(){wpcEvents.forEach(function(a){jsDebug&&console.log("Event registered: "+a),window.addEventListener(a,function(){preloadTimeout(a)})})}function preloadTimeout(a){if(jsDebug&&console.log("Running Preload Timeout"),!preloadRunned){if(jsDebug&&(console.log("Event name in preload is "),console.log(a),console.log("Before width: "+windowWidth),console.log("After width: "+window.innerWidth)),"resize"==a&&windowWidth===window.innerWidth)return!1;preloadRunned=!0,setTimeout(function(){jsDebug&&console.log("Inside Preload Timeout"),preload(),removeEventListeners()},50)}}function removeEventListeners(){wpcEvents.forEach(function(a){window.removeEventListener(a,preloadTimeout)})}function preloadStyles(){var a=[],b=[].slice.call(document.querySelectorAll('[rel="wpc-stylesheet"],[type="wpc-stylesheet"]')),c=[].slice.call(document.querySelectorAll('[rel="wpc-mobile-stylesheet"],[type="wpc-mobile-stylesheet"]'));b.forEach(function(b,c){var d=new Promise(function(a,c){"link"===b.tagName.toLowerCase()&&b.setAttribute("rel","stylesheet"),b.setAttribute("type","text/css"),b.addEventListener("load",function(){a()}),b.addEventListener("error",function(){c()})});a.push(d)}),b=[],c.forEach(function(b,c){var d=new Promise(function(a,c){"link"===b.tagName.toLowerCase()&&b.setAttribute("rel","stylesheet"),b.setAttribute("type","text/css"),b.addEventListener("load",function(){a()}),b.addEventListener("error",function(){c()})});a.push(d)}),c=[],Promise.all(a).then(function(){document.querySelector("#wpc-critical-css")}).catch(function(){b.forEach(function(a,b){"link"===a.tagName.toLowerCase()&&a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css")})}),wpcEvents.forEach(function(a){window.removeEventListener(a,preload)})}function preload(){var a=[].slice.call(document.querySelectorAll("iframe.wpc-iframe-delay")),b=[],c=[].slice.call(document.querySelectorAll('[rel="wpc-stylesheet"],[type="wpc-stylesheet"]')),d=[].slice.call(document.querySelectorAll('[rel="wpc-mobile-stylesheet"],[type="wpc-mobile-stylesheet"]')),e=[],f=[];jsDebug&&(console.log("Found scripts"),console.log(b));for(var g=0;g<b.length;g++){var h=b[g];h.src&&h.src.includes("wp-includes")&&(e.push(h),b.splice(g,1),g--)}jsDebug&&(console.log("Found WP scripts"),console.log(e)),e.forEach(function(a,b){var c=document.createElement("script");c.setAttribute("src",a.getAttribute("src")),c.setAttribute("type","text/javascript"),document.body.appendChild(c)}),e=[],b.forEach(function(a,b){var c=a.id;if(jsDebug&&console.log(a),a.hasAttribute("src")||a.id.includes("-before")||a.id.includes("-after")||a.id.includes("-extra")){var d=document.getElementById(c+"-before"),e=document.getElementById(c+"-after"),f=document.getElementById(c+"-extra");if(null!==d){var g=document.createElement("script");g.textContent=d.textContent,g.setAttribute("type","text/javascript"),g.async=!1,document.head.appendChild(g)}if(null!==f){var h=document.createElement("script");h.textContent=f.textContent,h.setAttribute("type","text/javascript"),h.async=!1,document.head.appendChild(h)}if(null!==a){var i=document.createElement("script");null!==a.getAttribute("src")?(i.setAttribute("src",a.getAttribute("src")),i.setAttribute("type","text/javascript"),i.async=!1,document.head.appendChild(i)):(i.textContent=a.textContent,i.setAttribute("type","text/javascript"),i.async=!1,document.head.appendChild(i)),i.onload=function(){if(null!==e){var a=document.createElement("script");a.textContent=e.textContent,a.setAttribute("type","text/javascript"),document.head.appendChild(a),e.remove()}}}null!==a&&a.remove(),null!==d&&d.remove(),null!==f&&f.remove()}else{var j=document.createElement("script");j.textContent=a.textContent,j.setAttribute("type","text/javascript"),j.async=!1,document.head.appendChild(j)}}),b=[],c.forEach(function(a,b){var c=new Promise(function(b,c){"link"===a.tagName.toLowerCase()&&a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.addEventListener("load",function(){b()}),a.addEventListener("error",function(){c()})});f.push(c)}),c=[],a.forEach(function(a,b){var c=new Promise(function(b,c){var d=a.getAttribute("data-src");a.setAttribute("src",d),a.addEventListener("load",function(){b()}),a.addEventListener("error",function(){c()})});f.push(c)}),a=[],d.forEach(function(a,b){var c=new Promise(function(b,c){"link"===a.tagName.toLowerCase()&&a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.addEventListener("load",function(){b()}),a.addEventListener("error",function(){c()})});f.push(c)}),d=[],Promise.all(f).then(function(){document.querySelector("#wpc-critical-css")}).catch(function(){c.forEach(function(a,b){"link"===a.tagName.toLowerCase()&&a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css")})}),wpcEvents.forEach(function(a){window.removeEventListener(a,preload)})}function SetupNewApiURL(a,b,c){return b>0&&!c.classList.contains("wpc-excluded-adaptive")&&(b>1100&&(b=1100),a=a.replace(/w:(\d{1,5})/g,"w:"+b)),jsDebug&&(console.log("Set new Width"),console.log(c),console.log(c.width),console.log(c.parentElement),console.log(c.parentElement.offsetWidth),console.log(b)),window.devicePixelRatio>=2&&"true"==ngf298gh738qwbdh0s87v_vars.retina_enabled||"true"==ngf298gh738qwbdh0s87v_vars.force_retina?(a=a.replace(/r:0/g,"r:1"),jsDebug&&(console.log("Retina set to True"),console.log("DevicePixelRation "+window.devicePixelRatio))):(a=a.replace(/r:1/g,"r:0"),jsDebug&&(console.log("Retina set to False"),console.log("DevicePixelRation "+window.devicePixelRatio))),"true"==ngf298gh738qwbdh0s87v_vars.webp_enabled&&0==isSafari?(c.classList.contains("wpc-excluded-webp")||(a=a.replace(/wp:0/g,"wp:1")),jsDebug&&console.log("WebP set to True")):(a=a.replace(/wp:1/g,"wp:0"),jsDebug&&console.log("WebP set to False")),"true"==ngf298gh738qwbdh0s87v_vars.exif_enabled?a=a.replace(/e:0/g,"e:1"):(a=a.replace(/\/e:1/g,""),a=a.replace(/\/e:0/g,"")),isMobile&&(a=getSrcset(a.split(","),mobileWidth,c)),a}function srcSetUpdateWidth(a,b,c){c.classList.contains("wpc-excluded-adaptive");var d=a.split(" ").pop();if(d.endsWith("w")){var e=d.slice(0,-1);parseInt(e)<=5&&(e=1),a=a.replace(/w:(\d{1,5})/g,"w:"+e)}else if(d.endsWith("x")){var e=d.slice(0,-1);parseInt(e)<=3&&(e=1),a=a.replace(/w:(\d{1,5})/g,"w:"+e)}return a}function getSrcset(a,b,c){var d="";return a.forEach(function(a){jsDebug&&(console.log("Image src part from array"),console.log(a)),newApiURL=srcSetUpdateWidth(a.trimStart(),b,c),d+=newApiURL+","}),d.slice(0,-1)}function listHas(a,b){var c=!1;return a.forEach(function(a){a.includes(b)&&(c=!0)}),!!c}function runAdaptive(){[].slice.call(document.querySelectorAll("img[data-wpc-loaded='true']")).forEach(function(a){var b=a;if(masonry=b.closest(".masonry"),owlSlider=b.closest(".owl-carousel"),SlickSlider=b.closest(".slick-slider"),SlickList=b.closest(".slick-list"),slides=b.closest(".slides"),jsDebug&&(console.log(masonry),console.log(owlSlider),console.log(SlickSlider),console.log(SlickList),console.log(slides)),SlickSlider||SlickList||slides||owlSlider||masonry)return void 0!==b.dataset.src&&""!=b.dataset.src?newApiURL=b.dataset.src:newApiURL=b.src,newApiURL=newApiURL.replace(/w:(\d{1,5})/g,"w:1"),b.src=newApiURL,b.classList.add("ic-fade-in"),b.classList.add("wpc-remove-lazy"),b.classList.remove("wps-ic-lazy-image"),void b.removeAttribute("data-wpc-loaded");"false"==ngf298gh738qwbdh0s87v_vars.adaptive_enabled||b.classList.toString().includes("logo")?imgWidth=1:(imageStyle=window.getComputedStyle(b),imgWidth=Math.round(parseInt(imageStyle.width)),"undefined"!=typeof imgWidth&&imgWidth&&0!=imgWidth&&!isNaN(imgWidth)||(imgWidth=1),listHas(b.classList,"slide")&&(imgWidth=1)),jsDebug&&(console.log("Image Stuff 2"),console.log(b.parentElement.offsetWidth),console.log(b.offsetWidth),console.log(imgWidth),console.log("Image Stuff END")),void 0!==b.dataset.src&&""!=b.dataset.src?(newApiURL=b.dataset.src,newApiURL=SetupNewApiURL(newApiURL,imgWidth,b),b.src=newApiURL,void 0!==b.dataset.srcset&&""!=b.dataset.src&&(b.srcset=b.dataset.srcset)):void 0!==b.src&&""!=b.src&&(newApiURL=b.src,newApiURL=SetupNewApiURL(newApiURL,imgWidth,b),b.src=newApiURL,void 0!==b.dataset.srcset&&""!=b.dataset.src&&(b.srcset=b.dataset.srcset)),b.classList.add("ic-fade-in"),b.classList.remove("wps-ic-lazy-image"),b.removeAttribute("data-wpc-loaded"),b.removeAttribute("data-srcset"),srcSetAPI="",void 0!==b.srcset&&""!=b.srcset?(srcSetAPI=newApiURL=b.srcset,jsDebug&&(console.log("Image has srcset"),console.log(b.srcset),console.log(newApiURL)),newApiURL=SetupNewApiURL(newApiURL,0,b),b.srcset=newApiURL):void 0!==b.dataset.srcset&&""!=b.dataset.srcset&&(srcSetAPI=newApiURL=b.dataset.srcset,jsDebug&&(console.log("Image does not have srcset"),console.log(newApiURL)),newApiURL=SetupNewApiURL(newApiURL,0,b),b.srcset=newApiURL)})}function onScroll(){runAdaptive()}var mobileWidth=1,isMobile=!1,jsDebug=!1,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);"true"==ngf298gh738qwbdh0s87v_vars.js_debug&&(jsDebug=!0),checkMobile();var preloadRunned=!1,windowWidth=window.innerWidth;window.addEventListener("DOMContentLoaded",function(){});var wpcEvents=["keydown","mousemove","touchmove","touchstart","touchend","wheel","visibilitychange","resize"];window.addEventListener("load",function(){window.scrollY;return!0}),document.addEventListener("WPCContentLoaded",function(){runAdaptive()});const wpcObserver=new MutationObserver(function(a){for(var b=0;b<a.length;b++){console.log("running observer");var c=a[b];if("childList"===c.type&&c.addedNodes.length>0&&c.addedNodes[0].tagName&&"img"===c.addedNodes[0].tagName.toLowerCase())for(var d=0;d<c.addedNodes.length;d++){var e=c.addedNodes[d];e.tagName&&"img"===e.tagName.toLowerCase()&&(adaptiveImage=e,void 0!==adaptiveImage.dataset.src&&""!=adaptiveImage.dataset.src?(newApiURL=adaptiveImage.dataset.src,newApiURL=SetupNewApiURL(newApiURL,imgWidth,adaptiveImage),adaptiveImage.src=newApiURL,void 0!==adaptiveImage.dataset.srcset&&""!=adaptiveImage.dataset.src&&(adaptiveImage.srcset=adaptiveImage.dataset.srcset)):void 0!==adaptiveImage.src&&""!=adaptiveImage.src&&(newApiURL=adaptiveImage.src,newApiURL=SetupNewApiURL(newApiURL,imgWidth,adaptiveImage),adaptiveImage.src=newApiURL,void 0!==adaptiveImage.dataset.srcset&&""!=adaptiveImage.dataset.src&&(adaptiveImage.srcset=adaptiveImage.dataset.srcset)),adaptiveImage.classList.add("ic-fade-in"),adaptiveImage.classList.remove("wps-ic-lazy-image"),adaptiveImage.removeAttribute("data-wpc-loaded"),adaptiveImage.removeAttribute("data-srcset"),srcSetAPI="",void 0!==adaptiveImage.srcset&&""!=adaptiveImage.srcset?(srcSetAPI=newApiURL=adaptiveImage.srcset,jsDebug&&(console.log("Image has srcset"),console.log(adaptiveImage.srcset),console.log(newApiURL)),newApiURL=SetupNewApiURL(newApiURL,0,adaptiveImage),adaptiveImage.srcset=newApiURL):void 0!==adaptiveImage.dataset.srcset&&""!=adaptiveImage.dataset.srcset&&(srcSetAPI=newApiURL=adaptiveImage.dataset.srcset,jsDebug&&(console.log("Image does not have srcset"),console.log(newApiURL)),newApiURL=SetupNewApiURL(newApiURL,0,adaptiveImage),adaptiveImage.srcset=newApiURL))}}});window.addEventListener("scroll",onScroll);