1/*!/wp-content/themes/newscarm/assets/js/ajax-nav.js*/ 2!function(){'use strict';if(window.__ncNavLoaded)return;window.__ncNavLoaded=!0;var progressEl,mainEl;var MAIN_ID='nc-main-content';var PROGRESS_ID='nc-ajax-progress';var homeUrl=(window.ncData&&ncData.homeUrl)||window.location.origin+'/';var cache={};var SKIP_SRCS=['player.js','nc-player.js','ajax-nav.js','ui.js','auto-refresh.js','hls.min.js','carm-yt.js'];function setProgress(pct){if(!progressEl)progressEl=document.getElementById(PROGRESS_ID);if(!progressEl)return;progressEl.style.opacity='1';progressEl.style.width=pct+'%';if(pct>=100){progressEl.classList.add('done');setTimeout(function(){progressEl.classList.remove('done');progressEl.style.width='0%'},400)}} 3function rerunScripts(container){container.querySelectorAll('script').forEach(function(orig){var src=orig.src||orig.getAttribute('src')||'';if(src){var skip=SKIP_SRCS.some(function(name){return src.indexOf(name)!==-1});if(skip)return} 4var code=orig.textContent||'';if(code&&!src){var fns=code.match(/function\s+([A-Za-z_$][A-Za-z0-9_$]*)\s*\(/g)||[];if(fns.length>0){var allDefined=fns.every(function(fn){var name=fn.replace(/^function\s+/,'').replace(/\s*\(.*/,'');return typeof window[name]==='function'});if(allDefined)return}} 5var s=document.createElement('script');Array.from(orig.attributes).forEach(function(a){s.setAttribute(a.name,a.value)});s.textContent=code;orig.parentNode.replaceChild(s,orig)})} 6function applyContent(html,url,pushState){var tmp=document.createElement('div');tmp.innerHTML=html;var newMain=tmp.querySelector('#'+MAIN_ID);if(!newMain){window.location.href=url;return} 7mainEl=mainEl||document.getElementById(MAIN_ID);if(!mainEl){window.location.href=url;return} 8mainEl.innerHTML=newMain.innerHTML;var titleMatch=html.match(/<title[^>]*>([^<]*)<\/title>/i);if(titleMatch)document.title=titleMatch[1];if(pushState!==!1)history.pushState({url:url},document.title,url);(function(){if(!('IntersectionObserver' in window))return;mainEl.querySelectorAll('img[data-src]').forEach(function(img){img.src=img.dataset.src;delete img.dataset.src})})();(function(){var rel=url.replace(window.location.origin,'').replace(homeUrl.replace(window.location.origin,''),'/');document.querySelectorAll('#nc-main-nav a, .ncb-menu-list a, #nc-mobile-menu a').forEach(function(a){var aRel=a.href.replace(window.location.origin,'').replace(homeUrl.replace(window.location.origin,''),'/');a.classList.toggle('current-menu-item',aRel===rel||('/'!==aRel&&rel.startsWith(aRel)))})})();rerunScripts(mainEl);document.dispatchEvent(new CustomEvent('nc:contentUpdated',{bubbles:!0}));if(typeof ncAmpReinit==='function')ncAmpReinit();window.scrollTo(0,0);setProgress(100);document.body.classList.remove('nc-ajax-loading')} 9function fetchPage(url){var sep=url.indexOf('?')!==-1?'&':'?';return fetch(url+sep+'nc_ajax=1',{headers:{'X-Requested-With':'XMLHttpRequest'}}).then(function(r){if(!r.ok)throw new Error('HTTP '+r.status);return r.text()})} 10var HOME_TTL=60*1000;var cacheTs={};function cacheKey(url){return url.split('#')[0].replace(/\/+$/,'')||'/'} 11function isHomePage(url){return cacheKey(url)===cacheKey(homeUrl)} 12function cacheGet(url){var key=cacheKey(url);if(!cache[key])return null;if(isHomePage(url)&&Date.now()-(cacheTs[key]||0)>HOME_TTL){delete cache[key];delete cacheTs[key];return null} 13return cache[key]} 14function cacheSet(url,html){var key=cacheKey(url);cache[key]=html;cacheTs[key]=Date.now()} 15function navigate(url,pushState,useCache){mainEl=mainEl||document.getElementById(MAIN_ID);if(!mainEl){window.location.href=url;return} 16document.dispatchEvent(new CustomEvent('nc:navStart',{detail:{url:url}}));document.body.classList.add('nc-ajax-loading');setProgress(20);var cached=useCache?cacheGet(url):null;if(cached){setProgress(90);applyContent(cached,url,!1);return} 17fetchPage(url).then(function(html){cacheSet(url,html);setProgress(80);applyContent(html,url,pushState)}).catch(function(err){console.warn('[NC Ajax] Error navegando a '+url+':',err.message);document.dispatchEvent(new CustomEvent('nc:navError',{detail:{url:url,error:err}}));setProgress(0);document.body.classList.remove('nc-ajax-loading');window.location.href=url})}
18function isInternalLink(a){if(!a||a.tagName!=='A')return!1;if(a.target==='_blank')return!1;if(a.hasAttribute('data-no-ajax'))return!1;if(a.hasAttribute('download'))return!1;var href=a.href||'';if(!href||href.startsWith('javascript:')||href.startsWith('mailto:')||href.startsWith('tel:')||href.startsWith('#'))return!1;if(/\/(wp-admin|wp-login|feed)/.test(href))return!1;return href.startsWith(window.location.origin+'/')||href.startsWith(homeUrl)} 19document.addEventListener('click',function(e){var a=e.target.closest('a');if(!isInternalLink(a))return;e.preventDefault();var url=a.href.split('#')[0];navigate(url,!0,!0)});document.addEventListener('nc:navigate',function(e){if(e.detail&&e.detail.url)navigate(e.detail.url,!0,!0);});window.addEventListener('popstate',function(e){var dest=(e.state&&e.state.url)||window.location.href;if(dest.split('#')[0]===window.location.href.split('#')[0])return;navigate(dest,!1,!1)});document.addEventListener('nc:cacheInvalidate',function(e){if(!e.detail||!e.detail.url)return;var key=cacheKey(e.detail.url);delete cache[key];delete cacheTs[key]});history.replaceState({url:window.location.href},document.title,window.location.href);cache[window.location.href]=null;if(!document.getElementById(PROGRESS_ID)){var bar=document.createElement('div');bar.id=PROGRESS_ID;document.body.insertBefore(bar,document.body.firstChild);progressEl=bar}}() 20;
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.