PageSourceSearch

https://noticiasnuevainglaterra.com/wp-content/themes/noticias-network/assets/js/theme.js?ver=1788890010

js noticiasnuevainglaterra.com collected 2026-10-08 07:06:47 UTC 23,450 bytes, 866 lines download raw bytes

1(function () {
2	function initCarousel(root) {
3		if (!root || root.dataset.noticiasCarouselReady === "1") {
4			return;
5		}
6
7		var viewport = root.querySelector(".noticias-carousel__viewport");
8		var slides = Array.prototype.slice.call(root.querySelectorAll(".noticias-carousel-card"));
9		var prev = root.querySelector(".noticias-carousel__button--prev");
10		var next = root.querySelector(".noticias-carousel__button--next");
11		var autoplay = null;
12
13		if (!viewport || slides.length < 2) {
14			if (prev) prev.hidden = true;
15			if (next) next.hidden = true;
16			return;
17		}
18
19		root.dataset.noticiasCarouselReady = "1";
20
21		function currentIndex() {
22			var width = viewport.clientWidth || 1;
23			return Math.round(viewport.scrollLeft / width);
24		}
25
26		function goTo(index, smooth) {
27			var total = slides.length;
28			var nextIndex = index;
29
30			if (nextIndex < 0) nextIndex = total - 1;
31			if (nextIndex >= total) nextIndex = 0;
32
33			viewport.scrollTo({
34				left: nextIndex * viewport.clientWidth,
35				behavior: smooth === false ? "auto" : "smooth"
36			});
37		}
38
39		function startAutoplay() {
40			stopAutoplay();
41			autoplay = window.setInterval(function () {
42				goTo(currentIndex() + 1);
43			}, 6500);
44		}
45
46		function stopAutoplay() {
47			if (autoplay) {
48				window.clearInterval(autoplay);
49				autoplay = null;
50			}
51		}
52
53		if (prev) {
54			prev.addEventListener("click", function () {
55				goTo(currentIndex() - 1);
56				startAutoplay();
57			});
58		}
59
60		if (next) {
61			next.addEventListener("click", function () {
62				goTo(currentIndex() + 1);
63				startAutoplay();
64			});
65		}
66
67		viewport.addEventListener("keydown", function (event) {
68			if (event.key === "ArrowLeft") {
69				event.preventDefault();
70				goTo(currentIndex() - 1);
71				startAutoplay();
72			}
73
74			if (event.key === "ArrowRight") {
75				event.preventDefault();
76				goTo(currentIndex() + 1);
77				startAutoplay();
78			}
79		});
80
81		root.addEventListener("mouseenter", stopAutoplay);
82		root.addEventListener("mouseleave", startAutoplay);
83		root.addEventListener("focusin", stopAutoplay);
84		root.addEventListener("focusout", startAutoplay);
85
86		window.addEventListener("resize", function () {
87			goTo(currentIndex(), false);
88		});
89
90		startAutoplay();
91	}
92
93	function initShare(root) {
94		if (!root || root.dataset.noticiasShareReady === "1") {
95			return;
96		}
97
98		var button = root.querySelector("[data-noticias-share-button]");
99		var status = root.querySelector("[data-noticias-share-status]");
100		var url = root.getAttribute("data-share-url") || window.location.href;
101		var title = root.getAttribute("data-share-title") || document.title;
102		var statusTimer = null;
103
104		if (!button) {
105			return;
106		}
107
108		root.dataset.noticiasShareReady = "1";
109
110		function setStatus(message) {
111			if (!status) {
112				return;
113			}
114
115			status.textContent = message || "";
116
117			if (statusTimer) {
118				window.clearTimeout(statusTimer);
119			}
120
121			if (message) {
122				statusTimer = window.setTimeout(function () {
123					status.textContent = "";
124				}, 3200);
125			}
126		}
127
128		function fallbackCopy() {
129			if (navigator.clipboard && window.isSecureContext) {
130				navigator.clipboard.writeText(url).then(
131					function () {
132						setStatus("Enlace copiado");
133					},
134					function () {
135						setStatus("No se pudo copiar");
136					}
137				);
138				return;
139			}
140
141			var textarea = document.createElement("textarea");
142			textarea.value = url;
143			textarea.setAttribute("readonly", "");
144			textarea.style.position = "fixed";
145			textarea.style.left = "-9999px";
146			document.body.appendChild(textarea);
147			textarea.select();
148
149			try {
150				document.execCommand("copy");
151				setStatus("Enlace copiado");
152			} catch (error) {
153				setStatus("No se pudo copiar");
154			}
155
156			document.body.removeChild(textarea);
157		}
158
159		button.addEventListener("click", function () {
160			if (navigator.share) {
161				navigator.share({
162					title: title,
163					url: url
164				}).catch(function (error) {
165					if (!error || error.name !== "AbortError") {
166						fallbackCopy();
167					}
168				});
169				return;
170			}
171
172			fallbackCopy();
173		});
174	}
175
176	function initMobileAppNav(root) {
177		if (!root || root.dataset.noticiasMobileNavReady === "1") {
178			return;
179		}
180
181		root.dataset.noticiasMobileNavReady = "1";
182
183		var mobileMedia = window.matchMedia ? window.matchMedia("(max-width: 767px)") : null;
184		var modalRoot = document.querySelector("[data-noticias-mobile-app-modal-root]");
185		var triggers = Array.prototype.slice.call(root.querySelectorAll("[data-noticias-mobile-sheet-trigger]"));
186		var sheets = modalRoot ? Array.prototype.slice.call(modalRoot.querySelectorAll(".noticias-mobile-app-sheet")) : [];
187		var backdrop = modalRoot ? modalRoot.querySelector(".noticias-mobile-app-nav__backdrop") : null;
188		var activeSheet = null;
189		var activeTrigger = null;
190		var closeTimer = null;
191		var lastScrollY = window.scrollY || window.pageYOffset || 0;
192		var ticking = false;
193
194		function isMobile() {
195			return !mobileMedia || mobileMedia.matches;
196		}
197
198		function sheetByKey(key) {
199			return modalRoot ? modalRoot.querySelector("#noticias-mobile-sheet-" + key) : null;
200		}
201
202		function setTriggerExpanded(trigger, expanded) {
203			if (trigger) {
204				trigger.setAttribute("aria-expanded", expanded ? "true" : "false");
205				trigger.classList.toggle("is-sheet-open", expanded);
206			}
207		}
208
209		function setSheetHidden(sheet, hidden) {
210			if (!sheet) {
211				return;
212			}
213
214			if (hidden) {
215				sheet.hidden = true;
216				return;
217			}
218
219			sheet.hidden = false;
220		}
221
222		function closeSheet(focusTrigger) {
223			if (!activeSheet) {
224				return;
225			}
226
227			var closingSheet = activeSheet;
228			var closingTrigger = activeTrigger;
229
230			activeSheet.classList.remove("is-open");
231			if (backdrop) {
232				backdrop.classList.remove("is-open");
233			}
234			root.classList.remove("is-sheet-open");
235			if (modalRoot) {
236				modalRoot.classList.remove("is-open");
237			}
238			document.documentElement.classList.remove("noticias-mobile-sheet-open");
239			setTriggerExpanded(activeTrigger, false);
240
241			activeSheet = null;
242			activeTrigger = null;
243
244			if (closeTimer) {
245				window.clearTimeout(closeTimer);
246			}
247			closeTimer = window.setTimeout(function () {
248				setSheetHidden(closingSheet, true);
249				if (backdrop) {
250					backdrop.hidden = true;
251				}
252			}, 220);
253
254			if (focusTrigger && closingTrigger) {
255				window.setTimeout(function () {
256					closingTrigger.focus();
257				}, 80);
258			}
259		}
260
261		function openSheet(key, trigger) {
262			var sheet = sheetByKey(key);
263			if (!sheet) {
264				return;
265			}
266
267			if (activeSheet === sheet) {
268				closeSheet(false);
269				return;
270			}
271
272			closeSheet(false);
273
274			if (closeTimer) {
275				window.clearTimeout(closeTimer);
276				closeTimer = null;
277			}
278
279			sheets.forEach(function (otherSheet) {
280				if (otherSheet !== sheet) {
281					otherSheet.classList.remove("is-open");
282					setSheetHidden(otherSheet, true);
283				}
284			});
285
286			activeSheet = sheet;
287			activeTrigger = trigger || null;
288			root.classList.remove("is-hidden-on-scroll");
289			root.classList.add("is-sheet-open");
290			if (modalRoot) {
291				modalRoot.classList.add("is-open");
292			}
293			document.documentElement.classList.add("noticias-mobile-sheet-open");
294			setTriggerExpanded(activeTrigger, true);
295			setSheetHidden(sheet, false);
296			if (backdrop) {
297				backdrop.hidden = false;
298			}
299
300			var frame = sheet.querySelector("iframe[data-noticias-modal-src]");
301			if (frame && !frame.getAttribute("src")) {
302				frame.setAttribute("src", frame.getAttribute("data-noticias-modal-src"));
303			}
304
305			window.requestAnimationFrame(function () {
306				sheet.classList.add("is-open");
307				if (backdrop) {
308					backdrop.classList.add("is-open");
309				}
310			});
311
312			var firstLink = sheet.querySelector("a[href], button:not([disabled])");
313			if (firstLink) {
314				window.setTimeout(function () {
315					firstLink.focus();
316				}, 120);
317			}
318		}
319
320		triggers.forEach(function (trigger) {
321			trigger.addEventListener("click", function (event) {
322				if (!isMobile()) {
323					return;
324				}
325
326				event.preventDefault();
327				openSheet(trigger.getAttribute("data-noticias-mobile-sheet-trigger"), trigger);
328			});
329		});
330
331		(modalRoot || root).querySelectorAll("[data-noticias-mobile-sheet-close]").forEach(function (closeButton) {
332			closeButton.addEventListener("click", function () {
333				closeSheet(true);
334			});
335		});
336
337		document.addEventListener("keydown", function (event) {
338			if (event.key === "Escape" && activeSheet) {
339				closeSheet(true);
340			}
341		});
342
343		document.addEventListener("click", function (event) {
344			if (activeSheet && !root.contains(event.target) && (!modalRoot || !modalRoot.contains(event.target))) {
345				closeSheet(false);
346			}
347		});
348
349		sheets.forEach(function (sheet) {
350			sheet.addEventListener("click", function (event) {
351				if (event.target && event.target.closest && event.target.closest("a[href]")) {
352					closeSheet(false);
353				}
354			});
355		});
356
357		if (mobileMedia && mobileMedia.addEventListener) {
358			mobileMedia.addEventListener("change", function () {
359				closeSheet(false);
360				root.classList.remove("is-hidden-on-scroll");
361			});
362		} else if (mobileMedia && mobileMedia.addListener) {
363			mobileMedia.addListener(function () {
364				closeSheet(false);
365				root.classList.remove("is-hidden-on-scroll");
366			});
367		}
368
369		function updateScrollState() {
370			ticking = false;
371			if (!isMobile() || activeSheet) {
372				root.classList.remove("is-hidden-on-scroll");
373				lastScrollY = window.scrollY || window.pageYOffset || 0;
374				return;
375			}
376
377			var currentY = Math.max(0, window.scrollY || window.pageYOffset || 0);
378			var delta = currentY - lastScrollY;
379
380			if (currentY < 72 || delta < -8) {
381				root.classList.remove("is-hidden-on-scroll");
382			} else if (delta > 8) {
383				root.classList.add("is-hidden-on-scroll");
384			}
385
386			lastScrollY = currentY;
387		}
388
389		window.addEventListener("scroll", function () {
390			if (!ticking) {
391				ticking = true;
392				window.requestAnimationFrame(updateScrollState);
393			}
394		}, { passive: true });
395	}
396
397	function initPwa() {
398		var config = window.noticiasPwaConfig || {};
399		var standalone = window.matchMedia && window.matchMedia("(display-mode: standalone)").matches;
400
401		if (standalone || window.navigator.standalone) {
402			document.documentElement.classList.add("noticias-pwa-standalone");
403		}
404
405		if (!config.enabled || !config.swUrl || !("serviceWorker" in navigator)) {
406			return;
407		}
408
409		window.addEventListener("load", function () {
410			navigator.serviceWorker.register(config.swUrl, { scope: config.scope || "/" }).catch(function () {});
411		});
412	}
413
414	function initInstantNavigation() {
415		var config = window.noticiasPwaConfig || {};
416
417		if (!config.prefetchEnabled || !window.fetch || !window.URL) {
418			return;
419		}
420
421		if (document.body && document.body.classList.contains("logged-in")) {
422			return;
423		}
424
425		var connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
426		if (connection && (connection.saveData || /(^|-)2g$/.test(connection.effectiveType || ""))) {
427			return;
428		}
429
430		var prefetched = {};
431		var queue = [];
432		var active = 0;
433		var maxActive = 2;
434		var autoPrefetchLimit = window.matchMedia && window.matchMedia("(max-width: 767px)").matches ? 8 : 12;
435		var autoPrefetched = 0;
436		var blockedPaths = [
437			/\/wp-admin\//,
438			/\/wp-login\.php/,
439			/\/wp-json\//,
440			/admin-ajax\.php/,
441			/\/cart\//,
442			/\/checkout\//,
443			/\/my-account\//
444		];
445		var blockedFiles = /\.(?:7z|avi|css|csv|docx?|gif|jpe?g|js|json|m4a|mov|mp3|mp4|pdf|png|svg|webm|webp|xlsx?|xml|zip)(?:$|[?#])/i;
446
447		function normalizedLinkUrl(link) {
448			if (!link || !link.href) {
449				return "";
450			}
451
452			var target = (link.getAttribute("target") || "").toLowerCase();
453			var rel = (link.getAttribute("rel") || "").toLowerCase();
454
455			if (target && target !== "_self") return "";
456			if (rel.indexOf("nofollow") !== -1 || rel.indexOf("sponsored") !== -1) return "";
457			if (link.hasAttribute("download")) return "";
458
459			var url;
460			try {
461				url = new URL(link.href, window.location.href);
462			} catch (error) {
463				return "";
464			}
465
466			if (url.origin !== window.location.origin) return "";
467			if (url.hash && url.pathname === window.location.pathname && url.search === window.location.search) return "";
468			if (url.search) return "";
469			if (blockedFiles.test(url.pathname)) return "";
470			if (blockedPaths.some(function (pattern) { return pattern.test(url.pathname); })) return "";
471
472			url.hash = "";
473			return url.toString();
474		}
475
476		function pumpQueue() {
477			if (active >= maxActive || !queue.length) {
478				return;
479			}
480
481			var url = queue.shift();
482			var controller = window.AbortController ? new AbortController() : null;
483			var timeout = controller ? window.setTimeout(function () {
484				controller.abort();
485			}, 4500) : null;
486			var options = {
487				credentials: "same-origin",
488				mode: "same-origin",
489				cache: "force-cache",
490				headers: {
491					"X-Noticias-Prefetch": "1"
492				}
493			};
494
495			if (controller) {
496				options.signal = controller.signal;
497			}
498
499			active += 1;
500			prefetched[url] = "loading";
501
502			fetch(url, options).then(function (response) {
503				if (response && response.ok) {
504					prefetched[url] = "done";
505				}
506			}).catch(function () {
507				prefetched[url] = "failed";
508			}).finally(function () {
509				if (timeout) window.clearTimeout(timeout);
510				active -= 1;
511				pumpQueue();
512			});
513		}
514
515		function queuePrefetch(url) {
516			if (!url || prefetched[url]) {
517				return;
518			}
519
520			prefetched[url] = "queued";
521			queue.push(url);
522			pumpQueue();
523		}
524
525		function prefetchFromEvent(event) {
526			var link = event.target && event.target.closest ? event.target.closest("a[href]") : null;
527			queuePrefetch(normalizedLinkUrl(link));
528		}
529
530		function prefetchLinks(selector, limit) {
531			var links = Array.prototype.slice.call(document.querySelectorAll(selector || "a[href]"));
532			var count = 0;
533
534			links.some(function (link) {
535				var url = normalizedLinkUrl(link);
536				if (!url) {
537					return false;
538				}
539
540				queuePrefetch(url);
541				count += 1;
542				return limit && count >= limit;
543			});
544		}
545
546		function markNavigation(event) {
547			if (event.defaultPrevented || event.button > 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
548				return;
549			}
550
551			var link = event.target && event.target.closest ? event.target.closest("a[href]") : null;
552			var url = normalizedLinkUrl(link);
553
554			if (!url) {
555				return;
556			}
557
558			document.documentElement.classList.add("noticias-page-loading");
559			queuePrefetch(url);
560		}
561
562		document.addEventListener("pointerover", prefetchFromEvent, { passive: true });
563		document.addEventListener("pointerdown", prefetchFromEvent, { passive: true });
564		document.addEventListener("touchstart", prefetchFromEvent, { passive: true });
565		document.addEventListener("focusin", prefetchFromEvent);
566		document.addEventListener("mousedown", prefetchFromEvent, { passive: true });
567		document.addEventListener("click", markNavigation);
568
569		window.addEventListener("pageshow", function () {
570			document.documentElement.classList.remove("noticias-page-loading");
571		});
572
573		function observeVisibleLinks() {
574			var links = Array.prototype.slice.call(document.querySelectorAll(
575				"main .wp-block-post-title a[href], main .noticias-archive-card a[href], main .noticias-post-card a[href], main .noticias-related-card a[href], main .noticias-carousel-card a[href]"
576			));
577
578			if (!links.length || !("IntersectionObserver" in window)) {
579				return;
580			}
581
582			var observer = new IntersectionObserver(function (entries) {
583				entries.forEach(function (entry) {
584					if (!entry.isIntersecting || autoPrefetched >= autoPrefetchLimit) {
585						return;
586					}
587
588					autoPrefetched += 1;
589					observer.unobserve(entry.target);
590					queuePrefetch(normalizedLinkUrl(entry.target));
591				});
592			}, {
593				rootMargin: "700px 0px",
594				threshold: 0.01
595			});
596
597			links.forEach(function (link) {
598				if (autoPrefetched < autoPrefetchLimit) {
599					observer.observe(link);
600				}
601			});
602		}
603
604		if ("requestIdleCallback" in window) {
605			window.requestIdleCallback(observeVisibleLinks, { timeout: 1600 });
606			window.requestIdleCallback(function () {
607				prefetchLinks(".noticias-mobile-app-nav a[href]", 4);
608			}, { timeout: 900 });
609		} else {
610			window.setTimeout(observeVisibleLinks, 900);
611			window.setTimeout(function () {
612				prefetchLinks(".noticias-mobile-app-nav a[href]", 4);
613			}, 500);
614		}
615	}
616
617		function initLazyMedia() {
618			document.querySelectorAll("img:not([loading])").forEach(function (image) {
619				image.setAttribute("loading", "lazy");
620			});
621
622		document.querySelectorAll("img:not([decoding])").forEach(function (image) {
623			image.setAttribute("decoding", "async");
624		});
625
626		document.querySelectorAll("iframe:not([loading])").forEach(function (iframe) {
627			iframe.setAttribute("loading", "lazy");
628			});
629		}
630
631		function initMobileCardNavigation() {
632			if (document.documentElement.dataset.noticiasMobileCardNavigationReady === "1") {
633				return;
634			}
635
636			var touchMedia = window.matchMedia ? window.matchMedia("(hover: none), (pointer: coarse)") : null;
637
638			function isTouchExperience() {
639				return !touchMedia || touchMedia.matches;
640			}
641
642			function primaryCardLink(card) {
643				return card ? card.querySelector(".noticias-card__image[href], .noticias-card__title a[href], .noticias-card__more[href], .wp-block-post-title a[href], .wp-block-post-excerpt__more-link[href]") : null;
644			}
645
646			function shouldIgnoreTap(target, card) {
647				if (!target || !card) {
648					return true;
649				}
650
651				return !!target.closest("a[href], button, input, select, textarea, summary, [role='button'], [data-noticias-carousel]");
652			}
653
654			document.documentElement.dataset.noticiasMobileCardNavigationReady = "1";
655
656			document.addEventListener("click", function (event) {
657				if (!isTouchExperience() || event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
658					return;
659				}
660
661				var card = event.target.closest("main .noticias-home-grid .noticias-card, main .noticias-query--archive .noticias-card");
662
663				if (!card || shouldIgnoreTap(event.target, card)) {
664					return;
665				}
666
667				var link = primaryCardLink(card);
668				if (!link || !link.href) {
669					return;
670				}
671
672				event.preventDefault();
673				document.documentElement.classList.add("noticias-page-loading");
674				window.location.href = link.href;
675			});
676		}
677
678			function initVideoPlaceholders() {
679				var shells = Array.prototype.slice.call(document.querySelectorAll("#tsp-player-wrapper, .fox-broadcast-inner"));
680
681			shells.forEach(function (shell) {
682			if (!shell || shell.dataset.noticiasVideoPlaceholderReady === "1") {
683				return;
684			}
685
686				var videos = Array.prototype.slice.call(shell.querySelectorAll("video"));
687				var isTeradekShell = shell.id === "tsp-player-wrapper";
688
689				if (!videos.length) {
690					return;
691			}
692
693			shell.dataset.noticiasVideoPlaceholderReady = "1";
694			shell.classList.add("noticias-video-shell");
695
696			function hasVideoSource(video) {
697				return !!(video && (video.currentSrc || video.getAttribute("src")));
698			}
699
700				function hasAnyVideoSource() {
701					return videos.some(hasVideoSource);
702				}
703
704				function teradekPlayerElement() {
705					return shell.querySelector(".video-js") || shell.querySelector("#tsp-player");
706				}
707
708				function teradekBadgeText() {
709					var badge = shell.querySelector("#live-badge");
710					return badge ? (badge.textContent || "").trim().toLowerCase() : "";
711				}
712
713				function teradekPlayerIsHidden() {
714					var playerEl = teradekPlayerElement();
715					if (!playerEl) {
716						return false;
717					}
718
719					if (playerEl.style && playerEl.style.display === "none") {
720						return true;
721					}
722
723					return window.getComputedStyle && window.getComputedStyle(playerEl).display === "none";
724				}
725
726					function setState(state) {
727						if (!state) {
728							return;
729					}
730
731						var nextClass = "is-video-" + state;
732						var nextBusy = state === "loading" ? "true" : "false";
733
734						if (shell.classList.contains(nextClass) && shell.getAttribute("aria-busy") === nextBusy) {
735							return;
736						}
737
738					shell.classList.remove("is-video-loading", "is-video-ready", "is-video-image", "is-video-offline");
739						shell.classList.add("is-video-" + state);
740						shell.setAttribute("aria-busy", nextBusy);
741					}
742
743					function reconcileTeradekState() {
744						if (!isTeradekShell) {
745							return;
746						}
747
748					var badgeText = teradekBadgeText();
749					if (badgeText === "offline" && teradekPlayerIsHidden()) {
750						setState("offline");
751						return;
752					}
753
754						if (hasAnyVideoSource() && teradekPlayerElement() && !teradekPlayerIsHidden()) {
755							setState("ready");
756						}
757					}
758
759			function markLoading(video) {
760				if (shell.classList.contains("is-video-image") && !hasVideoSource(video)) {
761					return;
762				}
763
764				if (!hasVideoSource(video) && shell.classList.contains("fox-broadcast-inner")) {
765					setState("image");
766					return;
767				}
768
769				setState("loading");
770			}
771
772				function markReady() {
773					setState("ready");
774				}
775
776				function markError() {
777					if (shell.classList.contains("fox-broadcast-inner")) {
778						setState(hasAnyVideoSource() ? "loading" : "image");
779						return;
780					}
781
782					if (isTeradekShell) {
783						reconcileTeradekState();
784						return;
785					}
786
787					setState("offline");
788				}
789
790			videos.forEach(function (video) {
791				if (video.readyState >= 2) {
792					markReady();
793				}
794
795				video.addEventListener("loadstart", function () {
796					markLoading(video);
797				});
798				video.addEventListener("waiting", function () {
799					markLoading(video);
800				});
801					video.addEventListener("stalled", function () {
802						markLoading(video);
803					});
804					video.addEventListener("loadedmetadata", markReady);
805					video.addEventListener("loadeddata", markReady);
806					video.addEventListener("canplay", markReady);
807					video.addEventListener("playing", markReady);
808					video.addEventListener("error", markError);
809				});
810
811			if (hasAnyVideoSource()) {
812				setState(videos.some(function (video) { return video.readyState >= 2; }) ? "ready" : "loading");
813			} else if (shell.classList.contains("fox-broadcast-inner") && shell.classList.contains("is-video-loading")) {
814				setState("loading");
815			} else if (shell.classList.contains("fox-broadcast-inner")) {
816				setState("image");
817			} else {
818				setState("loading");
819			}
820
821				if ("MutationObserver" in window) {
822					var observer = new MutationObserver(function () {
823						if (!hasAnyVideoSource() && shell.classList.contains("fox-broadcast-inner") && !shell.classList.contains("is-video-loading")) {
824							setState("image");
825						}
826
827						reconcileTeradekState();
828					});
829
830					if (isTeradekShell) {
831						observer.observe(shell, { attributes: true, childList: true, subtree: true, characterData: true });
832					} else {
833						videos.forEach(function (video) {
834							observer.observe(video, { attributes: true, attributeFilter: ["src", "poster"] });
835						});
836					}
837				}
838
839					if (isTeradekShell) {
840						window.setTimeout(reconcileTeradekState, 900);
841						window.setTimeout(function () {
842							if (hasAnyVideoSource() && !shell.classList.contains("is-video-ready") && !shell.classList.contains("is-video-offline")) {
843								reconcileTeradekState();
844							}
845						}, 4500);
846					}
847			});
848		}
849
850	function initAll() {
851			initPwa();
852			initInstantNavigation();
853			initLazyMedia();
854			initMobileCardNavigation();
855			initVideoPlaceholders();
856			document.querySelectorAll("[data-noticias-carousel]").forEach(initCarousel);
857		document.querySelectorAll("[data-noticias-share]").forEach(initShare);
858		document.querySelectorAll("[data-noticias-mobile-app-nav]").forEach(initMobileAppNav);
859	}
860
861	if (document.readyState === "loading") {
862		document.addEventListener("DOMContentLoaded", initAll);
863	} else {
864		initAll();
865	}
866})();

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.