1(() => { 2 const normalizedPath = window.location.pathname 3 .replace(/^\/(?:en|es)(?=\/|$)/, '') 4 .replace(/\/+$/, '') || '/'; 5 const landingPaths = ['/', '/pregnant', '/moms', '/planning']; 6 if (!landingPaths.includes(normalizedPath)) return; 7 8 const root = document.documentElement; 9 const styleIds = ['landing-base-styles', 'landing-polish-styles']; 10 const timeout = 4000; 11 let frameId = 0; 12 let timeoutId = 0; 13 let settled = false; 14 let watchedLinks = []; 15 16 const onStyleSettled = (event) => { 17 if (event.type === 'error' || watchedLinks.every(link => link.sheet)) reveal(); 18 }; 19 20 const reveal = () => { 21 if (settled) return; 22 settled = true; 23 window.cancelAnimationFrame(frameId); 24 window.clearTimeout(timeoutId); 25 watchedLinks.forEach((link) => { 26 link.removeEventListener('load', onStyleSettled); 27 link.removeEventListener('error', onStyleSettled); 28 }); 29 root.classList.remove('landing-css-pending'); 30 }; 31 32 const watchStyles = () => { 33 const links = styleIds.map(id => document.getElementById(id)); 34 if (links.some(link => !link)) { 35 frameId = window.requestAnimationFrame(watchStyles); 36 return; 37 } 38 39 watchedLinks = links; 40 if (links.every(link => link.sheet)) { 41 reveal(); 42 return; 43 } 44 45 links.forEach((link) => { 46 if (!link.sheet) { 47 link.addEventListener('load', onStyleSettled); 48 link.addEventListener('error', onStyleSettled); 49 } 50 }); 51 }; 52 53 root.classList.add('landing-css-pending'); 54 timeoutId = window.setTimeout(reveal, timeout); 55 watchStyles(); 56})();
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.