1/** 2 * Embed differiti: YouTube, Instagram, X, TikTok. 3 * 4 * Gli iframe arrivano in pagina con `data-src` al posto di `src` (lo fa il 5 * filtro su `the_content`) e vengono caricati solo quando servono: dopo il 6 * primo scroll, clic o tocco, oppure dopo 5 secondi. Per YouTube viene 7 * disegnata prima un'anteprima con la miniatura e il pulsante play, così la 8 * pagina non paga il costo del player per un video che nessuno guarderà . 9 * 10 * NOTA: questo file è il risultato minificato che era incollato dentro 11 * `optimizer_fix_embedded_code.php`. Il sorgente leggibile non esiste nel 12 * repository: è stato spostato qui invariato, byte per byte, per non 13 * cambiarne il comportamento. Andrebbe riscritto in forma leggibile. 14 */ 15!function(){"use strict";let e=!1,t,r;const n={scrollThreshold:200,loadDelay:2e3,fallbackTimeout:5e3};function o(){e||(e=!0,requestAnimationFrame(()=>{a(),i()}))}function a(){const e=document.querySelectorAll("iframe[data-src]");if(!e.length)return;"IntersectionObserver"in window?(t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(s(e.target),t.unobserve(e.target))})},{rootMargin:n.scrollThreshold+"px",threshold:.1}),e.forEach(e=>{e.getAttribute("data-src").includes("youtube.com")&&l(e),t.observe(e)})):e.forEach(s)}function l(e){const t=document.createElement("div");t.className="video-embed-wrapper";const r=c(e.getAttribute("data-src"));if(r){const e=document.createElement("img");e.className="video-thumbnail",e.src=`https://i.ytimg.com/vi_webp/${r}/maxresdefault.webp`,e.alt="Video thumbnail",e.loading="lazy",e.onerror=()=>{e.src=`https://i.ytimg.com/vi/${r}/maxresdefault.jpg`},t.appendChild(e)}const n=document.createElement("div");n.className="video-play-button",n.innerHTML='<svg viewBox="0 0 68 48" width="68" height="48"><path d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#f00"/><path d="M 45,24 27,14 27,34" fill="#fff"/></svg>',t.appendChild(n),t.addEventListener("click",()=>{t.classList.add("loading"),s(e,!0)},{once:!0}),e.parentNode.insertBefore(t,e),t.appendChild(e)}function s(e,t=!1){if(!e.getAttribute("data-src")||e.getAttribute("src"))return;const r=e.getAttribute("data-src"),n=t&&r.includes("youtube.com")?r+(r.includes("?")?"&":"?")+"autoplay=1&mute=1":r;e.setAttribute("src",n),e.className="video-embed-iframe";const o=e.closest(".video-embed-wrapper");if(o){o.classList.remove("loading");const e=o.querySelector(".video-thumbnail"),t=o.querySelector(".video-play-button");e&&(e.style.opacity="0"),t&&(t.style.display="none")}}function i(){const e=[];document.querySelector(".twitter-tweet")&&e.push({src:"https://platform.twitter.com/widgets.js",id:"twitter-wjs"}),document.querySelector(".instagram-media")&&e.push({src:"//www.instagram.com/embed.js",id:"instagram-embed"}),document.querySelector(".tiktok-embed")&&e.push({src:"https://www.tiktok.com/embed.js",id:"tiktok-embed"}),e.forEach((e,t)=>{setTimeout(()=>{if(!document.getElementById(e.id)){const t=document.createElement("script");t.id=e.id,t.src=e.src,t.async=!0,document.head.appendChild(t)}},500*t)})}function c(e){const t=e.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/);return t?t[1]:null}let d=!1;function u(){d||(d=!0,clearTimeout(r),setTimeout(o,n.loadDelay))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{r=setTimeout(o,n.fallbackTimeout),document.addEventListener("scroll",u,{passive:!0,once:!0}),document.addEventListener("click",u,{once:!0}),document.addEventListener("touchstart",u,{passive:!0,once:!0})}):(r=setTimeout(o,n.fallbackTimeout),document.addEventListener("scroll",u,{passive:!0,once:!0}),document.addEventListener("click",u,{once:!0}),document.addEventListener("touchstart",u,{passive:!0,once:!0})),window.addEventListener("beforeunload",()=>{t&&t.disconnect(),r&&clearTimeout(r)})}();
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.