1(function(window,document,$){'use strict';if(window.AP_AJAX_NAV&&window.AP_AJAX_NAV.ready===!0&&window.AP_AJAX_NAV.runtimeVersion==='47.6-header-instant'&&typeof window.AP_AJAX_NAV.navigate==='function'){return} 2var config=window.AP_AJAX_NAV||{};function getJQuery(){if(!$&&window.jQuery){$=window.jQuery} 3return $||null} 4var contentSelector=config.contentSelector||'.eltd-content';var menuSelector=config.menuSelector||'#menu-empty';var requestController=null;var navigationGeneration=0;var currentUrl=window.location.href;function sameOrigin(url){return url.origin===window.location.origin} 5function normalisePath(url){var path=url.pathname.replace(/\/+$/,'');return path||'/'} 6function escapeSelector(value){if(window.CSS&&typeof window.CSS.escape==='function')return window.CSS.escape(value);return String(value).replace(/([ #;?%&,.+*~\\':"!^$[\]()=>|\/@])/g,'\\$1')} 7function shouldHandleLink(link,event){if(!link||!link.href||link.target==='_blank'||link.hasAttribute('download'))return!1;if(event.defaultPrevented||event.button!==0||event.metaKey||event.ctrlKey||event.shiftKey||event.altKey)return!1;if(link.closest('[data-no-ajax], .no-ajax, .woocommerce-cart-form, .woocommerce-checkout'))return!1;if(link.classList.contains('no_link')||/^\s*(?:javascript:|mailto:|tel:)/i.test(link.getAttribute('href')||''))return!1;var rawHref=(link.getAttribute('href')||'').trim();if(!rawHref||rawHref==='#')return!1;var url;try{url=new URL(link.href,window.location.href)}catch(e){return!1} 8if(!sameOrigin(url)||!/^https?:$/.test(url.protocol))return!1;if(url.pathname.indexOf('/wp-admin')===0||url.pathname.indexOf('/wp-login.php')===0)return!1;if(/\.(?:jpg|jpeg|png|gif|webp|svg|pdf|zip|xml|json|mp4|mp3|docx?|xlsx?)$/i.test(url.pathname))return!1;if(url.searchParams.has('add-to-cart')||url.searchParams.has('wc-ajax'))return!1;if(url.hash&&normalisePath(url)===normalisePath(new URL(window.location.href))&&url.search===window.location.search)return!1;return!0} 9var progressResetTimer=null;var progressCreepTimer=null;var currentProgress=0;function stopProgressCreep(){if(progressCreepTimer){window.clearTimeout(progressCreepTimer);progressCreepTimer=null}} 10function scheduleProgressCreep(){stopProgressCreep();function creep(){if(!document.documentElement.classList.contains('ap-ajax-loading')){progressCreepTimer=null;return} 11if(currentProgress<91){var remaining=91-currentProgress;var step=Math.max(0.45,Math.min(2.45,remaining*0.082));setProgress(currentProgress+step)} 12progressCreepTimer=window.setTimeout(creep,520)} 13progressCreepTimer=window.setTimeout(creep,560)} 14function setProgress(value,immediate){var bar=document.getElementById('progress-bar');if(!bar)return;var progress=Math.max(0,Math.min(100,Number(value)||0));currentProgress=Math.max(currentProgress,progress);if(progress===0||immediate)currentProgress=progress;if(progressResetTimer){window.clearTimeout(progressResetTimer);progressResetTimer=null} 15bar.style.transition=immediate?'none':'';bar.style.width=progress+'%';bar.setAttribute('aria-valuenow',String(Math.round(progress)));if(immediate){void bar.offsetWidth;bar.style.transition=''}} 16var headerInstantReleaseRaf=0;function setLoading(isLoading){var root=document.documentElement;if(isLoading){if(headerInstantReleaseRaf){window.cancelAnimationFrame(headerInstantReleaseRaf);headerInstantReleaseRaf=0} 17root.classList.add('ap-ajax-header-instant');root.classList.add('ap-ajax-loading');document.body.setAttribute('aria-busy','true');setProgress(0,!0);window.requestAnimationFrame(function(){setProgress(6);scheduleProgressCreep()});return} 18stopProgressCreep();root.classList.remove('ap-ajax-loading');document.body.setAttribute('aria-busy','false');setProgress(100);headerInstantReleaseRaf=window.requestAnimationFrame(function(){headerInstantReleaseRaf=window.requestAnimationFrame(function(){root.classList.remove('ap-ajax-header-instant');headerInstantReleaseRaf=0})});progressResetTimer=window.setTimeout(function(){var bar=document.getElementById('progress-bar');if(bar){bar.classList.add('ap-progress-resetting');bar.style.width='0%';currentProgress=0;window.setTimeout(function(){bar.classList.remove('ap-progress-resetting')},40)} 19progressResetTimer=null},320)}
20var contentVersionStoragePrefix='apEditorialLandingVersion:';var initialDocumentContentVersion=config.contentVersion?String(config.contentVersion):'';var initialLandingVersions=config.landingVersions&&typeof config.landingVersions==='object'?config.landingVersions:{};var versionCheckThrottleMs=Math.max(0,Number(config.versionCheckThrottleMs)||8000);var editorialFreshBudgetMs=Math.max(300,Number(config.editorialFreshBudgetMs)||1400);var editorialVersionPollMs=Math.max(10000,Number(config.editorialVersionPollMs)||30000);var cachedVersionPayload=null;var cachedVersionPayloadAt=0;var dirtyLandingVersions={};var versionCheckPromise=null;var versionPollTimer=null;function landingKeyForUrl(value){var requested;try{requested=new URL(value,window.location.href)}catch(e){return''} 21var targets=Array.isArray(config.freshLandingUrls)&&config.freshLandingUrls.length?config.freshLandingUrls:[config.homeUrl||'/'];for(var i=0;i<targets.length;i+=1){var target;try{target=new URL(targets[i],window.location.origin)}catch(e){continue} 22if(requested.origin===target.origin&&normalisePath(requested)===normalisePath(target)&&requested.search===target.search){return requested.origin+normalisePath(target)}} 23return''} 24function landingPathForUrl(value){var requested;try{requested=new URL(value,window.location.href)}catch(e){return''} 25var targets=Array.isArray(config.freshLandingUrls)&&config.freshLandingUrls.length?config.freshLandingUrls:[config.homeUrl||'/'];for(var i=0;i<targets.length;i+=1){var target;try{target=new URL(targets[i],window.location.origin)}catch(e){continue} 26if(requested.origin===target.origin&&normalisePath(requested)===normalisePath(target)&&requested.search===target.search){return normalisePath(target)}} 27return''} 28function isFreshLandingTarget(value){return Boolean(landingPathForUrl(value))} 29function initialVersionForLanding(value){var path=landingPathForUrl(value);if(path&&initialLandingVersions[path]){return String(initialLandingVersions[path])} 30return initialDocumentContentVersion||''} 31function versionForLandingPayload(payload,value){if(!payload||typeof payload!=='object')return'';var path=landingPathForUrl(value);if(path&&payload.versions&&typeof payload.versions==='object'&&payload.versions[path]){return String(payload.versions[path])} 32return payload.version?String(payload.version):''} 33function getRememberedLandingVersion(value){var key=landingKeyForUrl(value);if(!key)return'';try{return window.sessionStorage.getItem(contentVersionStoragePrefix+key)||''}catch(e){return''}} 34function rememberLandingVersion(value,version){var key=landingKeyForUrl(value);if(!key||!version)return;try{window.sessionStorage.setItem(contentVersionStoragePrefix+key,String(version))}catch(e){}} 35function buildAjaxRequestUrl(value,forceFresh){var requestUrl=new URL(value,window.location.href);if(forceFresh){requestUrl.searchParams.set('_ap_editorial_fresh',String(Date.now()))} 36return requestUrl.href} 37function fetchEditorialContentVersion(signal){var now=Date.now();if(!config.contentVersionUrl){return Promise.resolve({version:initialDocumentContentVersion||'',versions:initialLandingVersions})} 38var versionUrl;try{versionUrl=new URL(config.contentVersionUrl,window.location.href);versionUrl.searchParams.set('_apv',String(now))}catch(e){return Promise.resolve({version:initialDocumentContentVersion||'',versions:initialLandingVersions})} 39return fetch(versionUrl.href,{method:'GET',credentials:'same-origin',cache:'no-store',headers:{'Accept':'application/json','Cache-Control':'no-cache, no-store, max-age=0','Pragma':'no-cache'},signal:signal}).then(function(response){if(!response.ok)throw new Error('Content version HTTP '+response.status);return response.json()}).then(function(payload){if(!payload||typeof payload!=='object'){throw new Error('Invalid editorial version payload')} 40cachedVersionPayload=payload;cachedVersionPayloadAt=Date.now();return payload})} 41function markEditorialChanges(payload){if(!payload||typeof payload!=='object')return;var targets=Array.isArray(config.freshLandingUrls)?config.freshLandingUrls:[];targets.forEach(function(targetUrl){var path=landingPathForUrl(targetUrl);
41if(!path)return;var incoming=versionForLandingPayload(payload,targetUrl);if(!incoming)return;var remembered=getRememberedLandingVersion(targetUrl)||initialVersionForLanding(targetUrl);if(remembered&&incoming!==remembered){dirtyLandingVersions[path]=incoming}else if(remembered&&incoming===remembered){delete dirtyLandingVersions[path]}})} 42function runEditorialVersionCheck(){if(versionCheckPromise)return versionCheckPromise;var controller=new AbortController();versionCheckPromise=fetchEditorialContentVersion(controller.signal).then(function(payload){markEditorialChanges(payload);return payload}).catch(function(){return cachedVersionPayload||null}).then(function(payload){versionCheckPromise=null;return payload});return versionCheckPromise} 43function scheduleEditorialVersionCheck(delay){if(versionPollTimer)window.clearTimeout(versionPollTimer);versionPollTimer=window.setTimeout(function poll(){runEditorialVersionCheck().then(function(){scheduleEditorialVersionCheck(editorialVersionPollMs)})},Math.max(0,Number(delay)||0))} 44function landingDirtyVersion(value){var path=landingPathForUrl(value);return path&&dirtyLandingVersions[path]?String(dirtyLandingVersions[path]):''} 45function markLandingFresh(value,version){var path=landingPathForUrl(value);if(!path||!version)return;rememberLandingVersion(value,version);if(dirtyLandingVersions[path]===String(version)){delete dirtyLandingVersions[path]}} 46function fetchHtmlWithProgress(url,signal,attempt,forceFresh){attempt=attempt||0;setProgress(attempt?Math.max(currentProgress,58):12);var freshEditorialRequest=Boolean(forceFresh&&isFreshLandingTarget(url));var requestUrl=buildAjaxRequestUrl(url,freshEditorialRequest);return fetch(requestUrl,{method:'GET',credentials:'same-origin',headers:(function(){var headers={'Accept':'text/html,application/xhtml+xml'};if(freshEditorialRequest){headers['Cache-Control']='no-cache, no-store, max-age=0';headers.Pragma='no-cache';headers['X-AP-Editorial-Fresh']='1'} 47return headers})(),cache:freshEditorialRequest?'no-store':(attempt?'reload':'default'),signal:signal}).then(function(response){if(!response.ok){var error=new Error('HTTP '+response.status);error.status=response.status;throw error} 48setProgress(Math.max(currentProgress,54));return response.text()}).then(function(html){if(!html||html.length<128)throw new Error('Empty or incomplete HTML response');setProgress(Math.max(currentProgress,68));return html}).catch(function(error){if(error&&error.name==='AbortError')throw error;var status=Number(error&&error.status||0);var transient=!status||status===408||status===425||status===429||status>=500;if(attempt===0&&transient&&!signal.aborted){setProgress(Math.max(currentProgress,62));return new Promise(function(resolve){window.setTimeout(resolve,220)}).then(function(){if(signal.aborted){var aborted=new Error('Navigation aborted');aborted.name='AbortError';throw aborted} 49return fetchHtmlWithProgress(url,signal,1,forceFresh)})} 50throw error})} 51function fetchFreshHtmlSilently(url,signal){var requestUrl=buildAjaxRequestUrl(url,!0);return fetch(requestUrl,{method:'GET',credentials:'same-origin',headers:{'Accept':'text/html,application/xhtml+xml','Cache-Control':'no-cache, no-store, max-age=0','Pragma':'no-cache','X-AP-Editorial-Fresh':'1'},cache:'no-store',signal:signal}).then(function(response){if(!response.ok){var error=new Error('HTTP '+response.status);error.status=response.status;throw error} 52return response.text()}).then(function(html){if(!html||html.length<128){throw new Error('Empty or incomplete fresh HTML response')} 53return html})} 54function absoluteAssetUrl(value,base){try{var url=new URL(value,base||window.location.href);url.hash='';return url.href}catch(e){return value||''}} 55function assetSet(root,selector,attribute,base){return Array.prototype.map.call(root.querySelectorAll(selector),function(node){return absoluteAssetUrl(node.getAttribute(attribute),base)}).filter(Boolean)} 56function copyAttributes(source,target){Array.prototype.forEach.call(source.attributes||[],function(attribute){target.setAttribute(attribute.name,attribute.value)})} 57function loadStylesheetFromNode(incomingLink,base){return new Promise(function(resolve){var link=document.createElement('link');copyAttributes(incomingLink,link);link.href=absoluteAssetUrl(incomingLink.getAttribute('href'),base);link.setAttribute('data-ap-ajax-style','true');link.onload=resolve;link.onerror=resolve;document.head.appendChild(link)})} 58function styleTextSignature(text){var value=String(text||'').replace(/\s+/g,' ').trim();var hash=2166136261;for(var i=0;i<value.length;i+=1){hash^=value.charCodeAt(i);hash+=(hash<<1)+(hash<<4)+(hash<<7)+(hash<<8)+(hash<<24)} 59return'ap-style-'+(hash>>>0).toString(36)} 60function syncInlineStyles(parsed){var incomingView=parsed.querySelector(contentSelector);Array.prototype.forEach.call(document.querySelectorAll('style[data-ap-destination-style="true"]'),function(style){style.parentNode.removeChild(style)});var incomingStyles=Array.prototype.filter.call(parsed.querySelectorAll('style'),function(style){return!incomingView||!incomingView.contains(style)});
60incomingStyles.forEach(function(incomingStyle,index){var text=incomingStyle.textContent||'';if(!text.trim())return;var style=document.createElement('style');Array.prototype.forEach.call(incomingStyle.attributes||[],function(attribute){if(attribute.name.toLowerCase()!=='id'){style.setAttribute(attribute.name,attribute.value)}});style.setAttribute('data-ap-destination-style','true');style.setAttribute('data-ap-destination-style-order',String(index));if(incomingStyle.id)style.setAttribute('data-ap-source-style-id',incomingStyle.id);style.textContent=text;document.head.appendChild(style)})} 61function copyShellElementState(parsed,selector,options){var incoming=parsed.querySelector(selector);var current=document.querySelector(selector);if(!incoming||!current)return;options=options||{};if(options.classes!==!1)current.className=incoming.className;if(options.style){if(incoming.hasAttribute('style'))current.setAttribute('style',incoming.getAttribute('style'));else current.removeAttribute('style')} 62Array.prototype.forEach.call(options.attributes||[],function(name){if(incoming.hasAttribute(name))current.setAttribute(name,incoming.getAttribute(name)||'');else current.removeAttribute(name)})} 63function syncPersistentShellState(parsed){copyShellElementState(parsed,'.eltd-wrapper',{classes:!0});copyShellElementState(parsed,'.eltd-wrapper-inner',{classes:!0});copyShellElementState(parsed,'#eltd-content-wrapper',{classes:!0,style:!0});copyShellElementState(parsed,'.eltd-page-header',{classes:!0,style:!0});copyShellElementState(parsed,'.eltd-mobile-header',{classes:!0,style:!0});copyShellElementState(parsed,'.eltd-sticky-header',{classes:!0,style:!0});copyShellElementState(parsed,'footer',{classes:!0,style:!0})} 64function ensureRequiredAssets(parsed){isolateHomeToSingleStyles(parsed);var incomingBase=parsed.baseURI||window.location.href;var currentStyles=assetSet(document,'link[rel="stylesheet"][href]','href');var incomingLinks=Array.prototype.slice.call(parsed.querySelectorAll('link[rel="stylesheet"][href]'));var missingLinks=incomingLinks.filter(function(link){var url=absoluteAssetUrl(link.getAttribute('href'),incomingBase);if(!url||currentStyles.indexOf(url)!==-1)return!1;currentStyles.push(url);return!0});syncInlineStyles(parsed);return Promise.all(missingLinks.map(function(link){return loadStylesheetFromNode(link,incomingBase)}))} 65function elementSignature(root,selector){var element=root.querySelector(selector);if(!element)return'missing';return element.tagName+'|'+String(element.id||'')} 66function isHomeContext(body){if(!body)return!1;return body.classList.contains('home')||body.classList.contains('blog')||body.classList.contains('front-page')||body.classList.contains('page-template-default-home')} 67function linkedStylesheetSet(root,base){return assetSet(root,'link[rel="stylesheet"][href]','href',base).sort()} 68function isSinglePostContext(body){if(!body)return!1;return body.classList.contains('single-post')||body.classList.contains('single')||body.classList.contains('singular')} 69function isPersistentGlobalStylesheet(link){var id=String(link.id||'').toLowerCase();var href=String(link.getAttribute('href')||'').toLowerCase();var token=id+' '+href;return/(?:modules(?:-responsive)?\.min\.css|plugins\.min\.css|style_dynamic(?:_responsive)?\.css|\/style\.css(?:\?|$)|ap-ajax-navigation\.css|wp-block-library|global-styles|classic-theme-styles|dashicons|admin-bar|font-?awesome|elegant-icons|ionicons|google-font|fonts\.googleapis|revslider|rs6\.css)/i.test(token)} 70function isPersistentGlobalInlineStyle(style){var id=String(style.id||'').toLowerCase();return/(?:global-styles|wp-block-library|classic-theme-styles|admin-bar|emoji|custom-background|eltd-style-dynamic)/i.test(id)} 71function isolateHomeToSingleStyles(parsed){var homeToSingle=isHomeContext(document.body)&&isSinglePostContext(parsed.body);var incomingBase=parsed.baseURI||window.location.href;var incomingHrefs=new Set(assetSet(parsed,'link[rel="stylesheet"][href]','href',incomingBase));Array.prototype.forEach.call(document.querySelectorAll('link[rel="stylesheet"][href]'),function(link){var href=absoluteAssetUrl(link.getAttribute('href'),window.location.href);var required=incomingHrefs.has(href);if(required&&link.hasAttribute('data-ap-home-style-suspended')){link.disabled=!1;link.removeAttribute('data-ap-home-style-suspended');return} 72if(homeToSingle&&!required&&!isPersistentGlobalStylesheet(link)){link.disabled=!0;link.setAttribute('data-ap-home-style-suspended','true')}});var incomingView=parsed.querySelector(contentSelector);var incomingSignatures=new Set();Array.prototype.forEach.call(parsed.querySelectorAll('style'),function(style){if(incomingView&&incomingView.contains(style))return;incomingSignatures.add(styleTextSignature(style.textContent||''))});var currentView=document.querySelector(contentSelector);Array.prototype.forEach.call(document.querySelectorAll('style'),function(style){if(style.getAttribute('data-ap-destination-style')==='true')return;if(currentView&¤tView.contains(style))return;var signature=styleTextSignature(style.textContent||'');var required=incomingSignatures.has(signature);if(required&&style.hasAttribute('data-ap-home-style-suspended')){var oldMedia=style.getAttribute('data-ap-old-media');if(oldMedia!==null&&oldMedia!=='')style.setAttribute('media',oldMedia);else style.removeAttribute('media');style.removeAttribute('data-ap-old-media');style.removeAttribute('data-ap-home-style-suspended');return} 73if(homeToSingle&&!required&&!isPersistentGlobalInlineStyle(style)){if(!style.hasAttribute('data-ap-home-style-suspended')){style.setAttribute('data-ap-old-media',style.getAttribute('media')||'')} 74style.setAttribute('media','not all');style.setAttribute('data-ap-home-style-suspended','true')}})} 75function stylingContextIsCompatible(parsed){if(config.preserveHeaderShell||config.neverHardReload)return!0;
75if(isHomeContext(document.body)!==isHomeContext(parsed.body))return!1;var currentStyles=linkedStylesheetSet(document,window.location.href);var incomingStyles=linkedStylesheetSet(parsed,parsed.baseURI||window.location.href);function coreNames(list){return list.map(function(url){try{return new URL(url).pathname.split('/').pop().replace(/\?.*$/,'')}catch(e){return url}}).filter(function(name){return/(?:modules|plugins|style_dynamic|responsive|woocommerce|js_composer|visual-composer)/i.test(name)}).sort().join('|')} 76return coreNames(currentStyles)===coreNames(incomingStyles)} 77function structureIsCompatible(parsed){var incoming=parsed.querySelector(contentSelector);var current=document.querySelector(contentSelector);if(!incoming||!current||incoming.tagName!==current.tagName)return!1;var structuralSelectors=['.eltd-wrapper','.eltd-wrapper-inner','#eltd-content-wrapper','.eltd-page-header','footer'];if(!(config.preserveHeaderShell||config.neverHardReload)&&!structuralSelectors.every(function(selector){return elementSignature(document,selector)===elementSignature(parsed,selector)})){if(config.debug&&window.console){console.warn('[AP AJAX] Shared shell mismatch; using normal navigation.')} 78return!1} 79var specialBodyClasses=['page-template-landing-page','page-template-landing-page-php','woocommerce-checkout','woocommerce-cart'];if(!(config.preserveHeaderShell||config.neverHardReload)&&specialBodyClasses.some(function(className){return document.body.classList.contains(className)||(parsed.body&&parsed.body.classList.contains(className))}))return!1;return!0} 80function isRepeatablePageLoader(src){var absolute=absoluteAssetUrl(src||'');return/\/www\/delivery\/asyncjs\.php(?:[?#]|$)/i.test(absolute)||/\/js\/[a-f0-9]{16,}\.js(?:[?#]|$)/i.test(absolute)} 81function executeScripts(container){var scripts=Array.prototype.slice.call(container.querySelectorAll('script'));scripts.forEach(function(oldScript){var src=oldScript.getAttribute('src');if(src){var absolute=absoluteAssetUrl(src);var repeatablePageLoader=isRepeatablePageLoader(absolute);var alreadyLoaded=Array.prototype.some.call(document.querySelectorAll('script[src]'),function(script){return absoluteAssetUrl(script.getAttribute('src'))===absolute});if(alreadyLoaded&&!repeatablePageLoader){oldScript.remove();return}} 82var newScript=document.createElement('script');Array.prototype.slice.call(oldScript.attributes).forEach(function(attr){newScript.setAttribute(attr.name,attr.value)});if(!src)newScript.text=oldScript.textContent;oldScript.parentNode.replaceChild(newScript,oldScript)})} 83function syncOneMenu(incomingMenu,currentMenu){if(!incomingMenu||!currentMenu)return;var currentItems=currentMenu.querySelectorAll('[id^="nav-menu-item-"]');Array.prototype.forEach.call(currentItems,function(item){var incomingItem=incomingMenu.querySelector('#'+escapeSelector(item.id));if(!incomingItem)return;item.className=incomingItem.className;var currentLink=item.firstElementChild&&item.firstElementChild.tagName==='A'?item.firstElementChild:null;var incomingLink=incomingItem.firstElementChild&&incomingItem.firstElementChild.tagName==='A'?incomingItem.firstElementChild:null;if(currentLink&&incomingLink)currentLink.className=incomingLink.className})} 84function syncMenuState(parsed){var incomingPrimary=parsed.querySelector(menuSelector);var currentPrimary=document.querySelector(menuSelector);syncOneMenu(incomingPrimary,currentPrimary);var currentMenus=document.querySelectorAll('nav ul, .eltd-mobile-nav ul');Array.prototype.forEach.call(currentMenus,function(currentMenu){if(currentMenu===currentPrimary||!currentMenu.id)return;syncOneMenu(parsed.getElementById(currentMenu.id),currentMenu)})} 85function syncHead(parsed){document.title=parsed.title||document.title;['canonical','prev','next'].forEach(function(rel){var incoming=parsed.querySelector('link[rel="'+rel+'"]');var current=document.querySelector('link[rel="'+rel+'"]');if(incoming&¤t)current.href=incoming.href;else if(incoming&&!current)document.head.appendChild(incoming.cloneNode(!0));else if(!incoming&¤t&&rel!=='canonical')current.remove();});['description','robots'].forEach(function(name){var incoming=parsed.querySelector('meta[name="'+name+'"]');var current=document.querySelector('meta[name="'+name+'"]');
85if(incoming&¤t)current.setAttribute('content',incoming.getAttribute('content')||'');else if(incoming&&!current)document.head.appendChild(incoming.cloneNode(!0));else if(!incoming&¤t&&name!=='robots')current.remove();})} 86function recalcUncoveringFooter(){var footer=document.querySelector('footer');var wrapper=document.getElementById('eltd-content-wrapper');if(!footer)return;if(document.body.classList.contains('eltd-uncovering-footer')&&wrapper&&!document.documentElement.classList.contains('touch')){var inner=footer.querySelector('.eltd-footer-inner');var height=inner?inner.getBoundingClientRect().height:footer.getBoundingClientRect().height;wrapper.style.marginBottom=height+'px';footer.style.height=height+'px';footer.style.visibility='visible';wrapper.style.borderBottom='2px solid #dddcdc';wrapper.style.backgroundColor=window.getComputedStyle(document.body).backgroundColor}else{footer.style.height='';footer.style.visibility='';if(wrapper){wrapper.style.marginBottom='';wrapper.style.borderBottom='';wrapper.style.backgroundColor=''}}} 87function initialisePreservedHeaderMenus(){$=getJQuery();if(!$)return;var itemSelector='.eltd-page-header .eltd-drop-down > ul > li.eltd-menu-has-sub, '+'.eltd-page-header .eltd-drop-down > ul > li.menu-item-has-children';function normalise($item){var $second=$item.children('.eltd-menu-second');if(!$second.length)return $second;var node=$second.get(0);node.style.removeProperty('visibility');node.style.removeProperty('overflow');if(!$second.data('ap-natural-height')){var inner=$second.children('.eltd-menu-inner').get(0);var natural=inner?inner.scrollHeight:node.scrollHeight;if(natural>0)$second.data('ap-natural-height',natural);} 88return $second} 89$(itemSelector).each(function(){normalise($(this))});$(document).off('.apPreservedMenu').on('mouseenter.apPreservedMenu focusin.apPreservedMenu',itemSelector,function(){var $item=$(this);var $second=normalise($item);if(!$second.length)return;var height=$second.data('ap-natural-height');if(!height){var inner=$second.children('.eltd-menu-inner').get(0);height=inner?inner.scrollHeight:$second.get(0).scrollHeight;if(height>0)$second.data('ap-natural-height',height);} 90$second.addClass('eltd-drop-down-start').css({height:height?height+'px':'auto',opacity:'1',visibility:'visible',overflow:'visible'})}).on('mouseleave.apPreservedMenu focusout.apPreservedMenu',itemSelector,function(event){if(event.type==='focusout'&&event.relatedTarget&&this.contains(event.relatedTarget))return;var $second=$(this).children('.eltd-menu-second');if(!$second.length)return;$second.removeClass('eltd-drop-down-start').css({height:'0px',opacity:'0'});$second.get(0).style.removeProperty('visibility');$second.get(0).style.removeProperty('overflow')})} 91function closeOpenPreservedSubmenus(){$=getJQuery();if(!$)return;var $openMenus=$('.eltd-page-header .eltd-menu-second').filter(function(){var node=this;var style=window.getComputedStyle(node);return node.classList.contains('eltd-drop-down-start')||parseFloat(style.opacity||'0')>0||node.getBoundingClientRect().height>1});if(!$openMenus.length)return;$openMenus.each(function(){var $second=$(this);$second.removeClass('eltd-drop-down-start').css({height:'0px',opacity:'0'});this.style.removeProperty('visibility');this.style.removeProperty('overflow')})} 92function reinitialiseFeatures(){$=getJQuery();try{if($&&window.eltd){window.eltd.body=$(document.body);window.eltd.windowWidth=$(window).width();window.eltd.windowHeight=$(window).height()} 93var common=window.eltd&&window.eltd.modules&&window.eltd.modules.common;if(common){['eltdFluidVideo','eltdPrettyPhoto','eltdPostGallerySlider','eltdPreloadBackgrounds','eltdInitAudioPlayer','eltdInitSelfHostedVideoPlayer','eltdSelfHostedVideoSize','eltdInitParallax'].forEach(function(name){if(typeof common[name]==='function'){try{common[name]()}catch(e){}}})} 94if(typeof window.vc_js==='function'){try{window.vc_js()}catch(e){}} 95if(window.Waypoint&&typeof window.Waypoint.refreshAll==='function'){try{window.Waypoint.refreshAll()}catch(e){}} 96if($){try{$(document.body).trigger('post-load')}catch(e){} 97try{$(window).trigger('resize').trigger('scroll')}catch(e){}}else{try{window.dispatchEvent(new Event('resize'))}catch(e){} 98try{window.dispatchEvent(new Event('scroll'))}catch(e){} 99window.setTimeout(function(){$=getJQuery();if($){try{$(document.body).trigger('post-load')}catch(e){} 100try{$(window).trigger('resize').trigger('scroll')}catch(e){} 101try{initialisePreservedHeaderMenus()}catch(e){}}},120)}}finally{window.requestAnimationFrame(recalcUncoveringFooter);window.setTimeout(recalcUncoveringFooter,120);window.setTimeout(recalcUncoveringFooter,420)}} 102function syncBodyClasses(parsedBody){if(!parsedBody)return;var preserve=['admin-bar','logged-in','customize-support','eltd-side-menu-opened','eltd-mobile-nav-opened','ap-ajax-loading'];var runtime=preserve.filter(function(name){return document.body.classList.contains(name)});document.body.className=parsedBody.className||'';runtime.forEach(function(name){document.body.classList.add(name)})} 103function syncBodyAttributes(parsedBody){if(!parsedBody)return;['itemscope','itemtype','itemid','dir'].forEach(function(name){if(parsedBody.hasAttribute(name)){document.body.setAttribute(name,parsedBody.getAttribute(name)||'')}else if(name!=='dir'){document.body.removeAttribute(name)}})} 104function markPersistentShell(){var header=document.querySelector('.eltd-page-header');var mobileHeader=document.querySelector('.eltd-mobile-header');var content=document.querySelector(contentSelector);if(header)header.setAttribute('data-ap-persistent-header','true');
104if(mobileHeader)mobileHeader.setAttribute('data-ap-persistent-header','true');if(content)content.setAttribute('data-ap-ajax-root','true');} 105function requestPluginMobileMenuClose(){var panel=document.getElementById('mg-wprm-wrap');var bar=document.getElementById('wprmenu_bar');var overlay=document.querySelector('.wprm-overlay');var hamburger=bar&&bar.querySelector('.hamburger');var isOpen=Boolean((panel&&panel.classList.contains('cbp-spmenu-open'))||(bar&&bar.classList.contains('active'))||(overlay&&overlay.classList.contains('active'))||(hamburger&&hamburger.classList.contains('is-active')));if(!isOpen||!bar)return;window.requestAnimationFrame(function(){window.requestAnimationFrame(function(){try{bar.dispatchEvent(new MouseEvent('click',{bubbles:!0,cancelable:!0,view:window}))}catch(error){if(typeof bar.click==='function')bar.click();}})})} 106function updateDocument(parsed,url,pushState,closeSubmenuAfterLoad,closeMobileMenuAfterLoad){if(!structureIsCompatible(parsed))throw new Error('AJAX structure mismatch');var incoming=parsed.querySelector(contentSelector);var current=document.querySelector(contentSelector);var imported=document.importNode(incoming,!0);current.replaceWith(imported);syncHead(parsed);syncMenuState(parsed);syncBodyClasses(parsed.body);syncBodyAttributes(parsed.body);syncPersistentShellState(parsed);markPersistentShell();executeScripts(imported);if(pushState)window.history.pushState({apAjax:!0},'',url);currentUrl=url;window.scrollTo(0,0);if(closeSubmenuAfterLoad)closeOpenPreservedSubmenus();if(closeMobileMenuAfterLoad)requestPluginMobileMenuClose();reinitialiseFeatures();var loadedEvent;try{loadedEvent=new CustomEvent('ap:ajax:loaded',{detail:{url:url}})}catch(e){loadedEvent=document.createEvent('CustomEvent');loadedEvent.initCustomEvent('ap:ajax:loaded',!1,!1,{url:url})} 107document.dispatchEvent(loadedEvent);$=getJQuery();if($){try{$(document).trigger('ap_ajax_loaded',[url])}catch(e){}}} 108function isArchiveContext(body){if(!body)return!1;return body.classList.contains('category')||body.classList.contains('archive')||body.classList.contains('search')||body.classList.contains('blog')} 109function hasPagination(root){if(!root)return!1;return!!root.querySelector('.eltd-pagination, .eltd-blog-pagination, .pagination, .page-numbers, '+'nav.navigation.pagination, .wp-pagenavi, [class*="pagination"]')} 110function validateFetchedDocument(parsed,url){var incoming=parsed.querySelector(contentSelector);if(!incoming)throw new Error('Destination content wrapper missing');if(isArchiveContext(parsed.body)&&isArchiveContext(document.body)){var currentContent=document.querySelector(contentSelector);if(hasPagination(currentContent)&&!hasPagination(incoming)){throw new Error('Archive response is missing pagination')}} 111if(isSinglePostContext(parsed.body)){var hasPost=incoming.querySelector('article, .eltd-blog-single, .single-post, .eltd-post-content, .eltd-post-text');if(!hasPost)throw new Error('Single-post response is incomplete');} 112return parsed} 113function fetchNavigationHtml(url,signal){if(!isFreshLandingTarget(url)){return fetchHtmlWithProgress(url,signal,0,!1)} 114var dirtyVersion=landingDirtyVersion(url);if(!dirtyVersion){return fetchHtmlWithProgress(url,signal,0,!1)} 115var freshController=new AbortController();var fallbackTimer=null;function abortFreshFromParent(){if(!freshController.signal.aborted)freshController.abort();} 116if(signal.aborted){abortFreshFromParent()}else{signal.addEventListener('abort',abortFreshFromParent,{once:!0})} 117var normalPromise=fetchHtmlWithProgress(url,signal,0,!1);var freshPromise=fetchFreshHtmlSilently(url,freshController.signal).then(function(freshHtml){return{type:'fresh',html:freshHtml}}).catch(function(){if(signal.aborted){var parentAbort=new Error('Navigation aborted');parentAbort.name='AbortError';throw parentAbort} 118return null});var budgetPromise=new Promise(function(resolve){fallbackTimer=window.setTimeout(function(){resolve({type:'budget'})},editorialFreshBudgetMs)});return Promise.race([freshPromise,budgetPromise]).then(function(winner){if(winner&&winner.type==='fresh'){if(fallbackTimer){window.clearTimeout(fallbackTimer);fallbackTimer=null} 119signal.removeEventListener('abort',abortFreshFromParent);markLandingFresh(url,dirtyVersion);return winner.html} 120abortFreshFromParent();signal.removeEventListener('abort',abortFreshFromParent);return normalPromise})} 121var apIntentCache=new Map();var AP_INTENT_TTL=30000;var AP_INTENT_MAX=6;var apPrefetchTimer=null;function pruneIntentCache(){var now=Date.now();apIntentCache.forEach(function(entry,key){if(!entry||entry.expiresAt<=now)apIntentCache.delete(key);});while(apIntentCache.size>AP_INTENT_MAX){var firstKey=apIntentCache.keys().next().value;
121if(!firstKey)break;apIntentCache.delete(firstKey)}} 122function eligiblePrefetchUrl(value){var url;try{url=new URL(value,window.location.href)}catch(e){return''} 123if(!sameOrigin(url)||!/^https?:$/.test(url.protocol))return'';if(isFreshLandingTarget(url.href))return'';if(url.pathname.indexOf('/wp-admin')===0||url.pathname.indexOf('/wp-login.php')===0)return'';if(/\.(?:jpg|jpeg|png|gif|webp|svg|pdf|zip|xml|json|mp4|mp3|docx?|xlsx?)$/i.test(url.pathname))return'';return url.href} 124function prefetchDestination(value){var url=eligiblePrefetchUrl(value);if(!url)return;pruneIntentCache();var existing=apIntentCache.get(url);if(existing&&existing.expiresAt>Date.now())return;var entry={html:'',promise:null,expiresAt:Date.now()+AP_INTENT_TTL};entry.promise=fetch(url,{method:'GET',credentials:'same-origin',headers:{'Accept':'text/html,application/xhtml+xml'},cache:'default'}).then(function(r){if(!r.ok)throw new Error('Prefetch HTTP '+r.status);return r.text()}).then(function(html){if(!html||html.length<128)throw new Error('Incomplete prefetch');entry.html=html;entry.promise=null;entry.expiresAt=Date.now()+AP_INTENT_TTL;return html}).catch(function(){apIntentCache.delete(url);return''});apIntentCache.set(url,entry);pruneIntentCache()} 125function rememberNavigationHtml(url,html){if(!html||isFreshLandingTarget(url))return;var eligible=eligiblePrefetchUrl(url);if(!eligible)return;apIntentCache.set(eligible,{html:html,promise:null,expiresAt:Date.now()+AP_INTENT_TTL});pruneIntentCache()} 126function cachedNavigationHtml(url,signal){pruneIntentCache();var entry=apIntentCache.get(url);if(!entry||entry.expiresAt<=Date.now())return null;if(entry.html)return Promise.resolve(entry.html);if(entry.promise){return entry.promise.then(function(html){if(signal.aborted){var aborted=new Error('Navigation aborted');aborted.name='AbortError';throw aborted} 127return html||null})} 128return null} 129function waitForProgressPaint(target,delay){setProgress(target);return new Promise(function(resolve){window.requestAnimationFrame(function(){window.setTimeout(resolve,Math.max(0,Number(delay)||0))})})} 130function navigate(url,pushState,closeSubmenuAfterLoad,closeMobileMenuAfterLoad){if(requestController)requestController.abort();var controller=new AbortController();var generation=++navigationGeneration;requestController=controller;setLoading(!0);var cachedHtmlPromise=isFreshLandingTarget(url)?null:cachedNavigationHtml(url,controller.signal);var htmlPromise=cachedHtmlPromise||fetchNavigationHtml(url,controller.signal);htmlPromise.then(function(html){rememberNavigationHtml(url,html);setProgress(72);var parsed=new DOMParser().parseFromString(html,'text/html');validateFetchedDocument(parsed,url);if(!structureIsCompatible(parsed))throw new Error('AJAX structure mismatch');setProgress(78);return ensureRequiredAssets(parsed).then(function(){return waitForProgressPaint(94,45).then(function(){updateDocument(parsed,url,pushState,closeSubmenuAfterLoad,closeMobileMenuAfterLoad);setProgress(98)})})}).catch(function(error){if(error.name==='AbortError')return;if(window.console&&config.debug){console.error('[AP AJAX] Navigation failed; using browser fallback.',error)} 131var failedEvent;try{failedEvent=new CustomEvent('ap:ajax:error',{detail:{url:url,error:String(error&&error.message||error),fallback:!0}})}catch(e){failedEvent=document.createEvent('CustomEvent');failedEvent.initCustomEvent('ap:ajax:error',!1,!1,{url:url,error:String(error&&error.message||error),fallback:!0})} 132document.dispatchEvent(failedEvent);setProgress(Math.max(currentProgress,94));window.setTimeout(function(){window.location.assign(url)},90);return}).then(function(){if(generation!==navigationGeneration||requestController!==controller){return} 133requestController=null;setLoading(!1)})} 134window.AP_AJAX_NAV=Object.assign({},window.AP_AJAX_NAV||{},{ready:!0,runtimeVersion:'47.6-header-instant',navigate:function(url,pushState,closeSubmenuAfterLoad,closeMobileMenuAfterLoad){navigate(url,pushState!==!1,!!closeSubmenuAfterLoad,!!closeMobileMenuAfterLoad)}});document.addEventListener('pointerover',function(event){var target=event.target;if(!target||typeof target.closest!=='function')return;var link=target.closest('a[href]');if(!link)return;if(apPrefetchTimer)window.clearTimeout(apPrefetchTimer);apPrefetchTimer=window.setTimeout(function(){prefetchDestination(link.href)},45)},{passive:!0,capture:!0});document.addEventListener('touchstart',function(event){var target=event.target;if(!target||typeof target.closest!=='function')return;var link=target.closest('a[href]');if(link)prefetchDestination(link.href);},{passive:!0,capture:!0});document.addEventListener('pointerdown',function(event){var target=event.target;if(!target||typeof target.closest!=='function')return;var link=target.closest('a[href]');if(!link)return;prefetchDestination(link.href)},{passive:!0,capture:!0});document.addEventListener('click',function(event){var target=event.target;if(!target||typeof target.closest!=='function')return;var link=target.closest('a');if(!shouldHandleLink(link,event))return;var cameFromSubmenu=!!link.closest('.eltd-page-header .eltd-menu-second');
134var cameFromPluginMobileMenu=!!link.closest('#mg-wprm-wrap');event.preventDefault();event.stopImmediatePropagation();document.documentElement.setAttribute('data-ap-last-navigation','ajax');navigate(link.href,!0,cameFromSubmenu,cameFromPluginMobileMenu)},!0);document.addEventListener('submit',function(event){var form=event.target;if(!form||String(form.method).toLowerCase()!=='get')return;if(form.closest('[data-no-ajax], .no-ajax'))return;if(!(form.matches('[role="search"], .searchform, .woocommerce-product-search')||form.querySelector('input[name="s"]')))return;var action=new URL(form.action||window.location.href,window.location.href);if(!sameOrigin(action))return;event.preventDefault();var params=new URLSearchParams(new FormData(form));action.search=params.toString();navigate(action.toString(),!0)},!0);window.addEventListener('popstate',function(){if(window.location.href===currentUrl)return;navigate(window.location.href,!1)});markPersistentShell();initialisePreservedHeaderMenus();scheduleEditorialVersionCheck(0);document.addEventListener('visibilitychange',function(){if(!document.hidden&&(Date.now()-cachedVersionPayloadAt)>=editorialVersionPollMs){runEditorialVersionCheck()}});window.addEventListener('focus',function(){if((Date.now()-cachedVersionPayloadAt)>=editorialVersionPollMs){runEditorialVersionCheck()}});window.addEventListener('load',function(){recalcUncoveringFooter();initialisePreservedHeaderMenus()})})(window,document,window.jQuery)
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.