1const svgCache=new Map();function uShapeWeight(t){return 4*Math.pow(t-0.5,2);} 2async function preloadSVGLayout(container,url){try{if(svgCache.has(url)){const{text,width,height}=svgCache.get(url);if(width&&height)container.style.aspectRatio=`${width} / ${height}`;return;} 3const response=await fetch(url);const text=await response.text();const tempDiv=document.createElement("div");tempDiv.innerHTML=text.trim();const svgEl=tempDiv.querySelector("svg");if(!svgEl)return;let width=parseFloat(svgEl.getAttribute("width"));let height=parseFloat(svgEl.getAttribute("height"));const viewBox=svgEl.getAttribute("viewBox");if((!width||!height)&&viewBox){const parts=viewBox.split(/[\s,]+/).map(parseFloat);if(parts.length===4){width=width||parts[2];height=height||parts[3];}} 4if(!width||!height){const hidden=svgEl.cloneNode(true);hidden.style.visibility="hidden";hidden.style.position="absolute";hidden.style.top="-9999px";hidden.style.left="-9999px";document.body.appendChild(hidden);const bbox=hidden.getBBox?hidden.getBBox():null;if(bbox&&bbox.width&&bbox.height){width=bbox.width;height=bbox.height;}else{width=width||100;height=height||100;} 5hidden.remove();} 6if(width&&height)container.style.aspectRatio=`${width} / ${height}`;svgCache.set(url,{text,width,height});}catch(err){console.error("Error preloading SVG:",err);}} 7async function loadAndAnimateSVG(container,url,options={}){const fade=container.dataset.fade==="true";const rotate=container.dataset.rotate==="true";const scale=container.dataset.scale==="true";const slide=container.dataset.slide==="true";const totalDuration=parseInt(container.dataset.duration)||2103;const easing="ease-in-out";const overlapFactor=0.5;const containerFadeDuration=100;let text;
7if(svgCache.has(url)){text=svgCache.get(url).text;}else{const response=await fetch(url);text=await response.text();} 8container.style.opacity=0;container.style.transition=`opacity ${containerFadeDuration}ms ease-in-out`;container.innerHTML=text;requestAnimationFrame(()=>{container.style.opacity=1;});const svg=container.querySelector("svg");if(!svg)return;const elements=Array.from(svg.querySelectorAll("*")).filter(el=>{if(el.closest('defs'))return false;const nonVisual=['style','title','desc','metadata','script'];if(nonVisual.includes(el.tagName.toLowerCase()))return false;return true;});const count=elements.length;if(count===0)return;const transitionDuration=totalDuration/(1+overlapFactor*(count-1));const baseTotalForIntervals=Math.max(0,totalDuration-transitionDuration);const weights=[];for(let k=0;k<count-1;k++){const t=(k+0.5)/(count-1);weights.push(uShapeWeight(t));} 9const weightSum=weights.reduce((a,b)=>a+b,0);const intervals=weights.map(w=>(w/weightSum)*baseTotalForIntervals);const startTimes=new Array(count).fill(0);for(let i=1;i<count;i++){startTimes[i]=startTimes[i-1]+intervals[i-1];} 10elements.forEach(el=>{el.style.opacity=fade?0:1;el.style.transformBox="fill-box";el.style.transformOrigin="center";el.style.transition=`opacity ${transitionDuration}ms ${easing}, transform ${transitionDuration}ms ${easing}`;const transforms=[];if(rotate)transforms.push("rotate(120deg)");if(scale)transforms.push("scale(0.5)");if(slide)transforms.push("translateY(100%)");el.style.transform=transforms.join(" ");});elements.forEach((el,i)=>{setTimeout(()=>{if(fade)el.style.opacity=1;const transforms=[];if(rotate)transforms.push("rotate(0deg)");if(scale)transforms.push("scale(1)");if(slide)transforms.push("translateY(0)");el.style.transform=transforms.join(" ");},Math.round(startTimes[i])+containerFadeDuration);});} 11const observer=new IntersectionObserver((entries,obs)=>{entries.forEach(entry=>{if(entry.isIntersecting){const container=entry.target;const url=container.getAttribute("data-src");loadAndAnimateSVG(container,url,{totalDuration:2000,fade:true,rotate:false,scale:true,slide:false,easing:"ease-in-out",overlapFactor:0.2,containerFadeDuration:500});obs.unobserve(container);}});},{threshold:0.5});window.addEventListener("load",async()=>{const containers=document.querySelectorAll(".svg-container");await Promise.all(Array.from(containers).map(async el=>{const url=el.getAttribute("data-src");await preloadSVGLayout(el,url);}));containers.forEach(el=>observer.observe(el));});
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.