PageSourceSearch

https://spooledge.net/cdn/shop/t/25/assets/lottie-observer.js?v=68384051071371276891783318255

js spooledge.net collected 2026-10-10 02:04:51 UTC 6,639 bytes, 2 lines download raw bytes

1(function(){"use strict";function log(message,data){}const style=document.createElement("style");style.textContent="[data-lottie-src] { display: inline-flex !important; }",document.head.appendChild(style);const animations=new WeakMap,observerOptions={root:null,rootMargin:"100px",threshold:0},destroyObserverOptions={root:null,rootMargin:"500px",threshold:0},jsonCache=new Map;function getFileExtension(url){return url.split("?")[0].split(".").pop().toLowerCase()}function fetchJSON(url){return jsonCache.has(url)?Promise.resolve(jsonCache.get(url)):fetch(url).then(function(res){return res.json()}).then(function(data){return jsonCache.set(url,data),data})}function fetchDotLottie(url){return jsonCache.has(url)?Promise.resolve(jsonCache.get(url)):(""+url,fetch(url).then(function(res){if(!res.ok)throw new Error("HTTP error: "+res.status);return""+res.headers.get("content-type"),res.arrayBuffer()}).then(function(buffer){return""+buffer.byteLength,unzipDotLottie(buffer)}).then(function(data){return jsonCache.set(url,data),data}).catch(function(err){throw""+err.message,err}))}async function unzipDotLottie(buffer){const zip=new Uint8Array(buffer);""+zip.length;let centralDirOffset=-1;for(let i=zip.length-22;i>=0;i--)if(zip[i]===80&&zip[i+1]===75&&zip[i+2]===5&&zip[i+3]===6){centralDirOffset=zip[i+16]|zip[i+17]<<8|zip[i+18]<<16|zip[i+19]<<24;break}if(centralDirOffset===-1)throw new Error("Invalid ZIP file");""+centralDirOffset;let offset=centralDirOffset;for(;offset<zip.length&&!(zip[offset]!==80||zip[offset+1]!==75||zip[offset+2]!==1||zip[offset+3]!==2);){const compressedSize=zip[offset+20]|zip[offset+21]<<8|zip[offset+22]<<16|zip[offset+23]<<24,uncompressedSize=zip[offset+24]|zip[offset+25]<<8|zip[offset+26]<<16|zip[offset+27]<<24,fileNameLength=zip[offset+28]|zip[offset+29]<<8,extraLength=zip[offset+30]|zip[offset+31]<<8,commentLength=zip[offset+32]|zip[offset+33]<<8,localHeaderOffset=zip[offset+42]|zip[offset+43]<<8|zip[offset+44]<<16|zip[offset+45]<<24,fileName=new TextDecoder().decode(zip.slice(offset+46,offset+46+fileNameLength));if(""+fileName,fileName.endsWith(".json")&&fileName!=="manifest.json"){""+fileName;const localOffset=localHeaderOffset,localFileNameLength=zip[localOffset+26]|zip[localOffset+27]<<8,localExtraLength=zip[localOffset+28]|zip[localOffset+29]<<8,dataStart=localOffset+30+localFileNameLength+localExtraLength,compressionMethod=zip[localOffset+8]|zip[localOffset+9]<<8;""+compressionMethod+compressedSize+uncompressedSize;let fileData;if(compressionMethod===0)fileData=zip.slice(dataStart,dataStart+uncompressedSize);else if(compressionMethod===8){const compressedData=zip.slice(dataStart,dataStart+compressedSize);fileData=await inflateRaw(compressedData)}if(fileData){const jsonStr=new TextDecoder().decode(fileData);return""+jsonStr.length,JSON.parse(jsonStr)}}offset+=46+fileNameLength+extraLength+commentLength}throw new Error("Animation JSON not found in .lottie file")}async function inflateRaw(data){if(typeof DecompressionStream<"u"){const ds=new DecompressionStream("deflate-raw"),reader=new Blob([data]).stream().pipeThrough(ds).getReader(),chunks=[];for(;;){const{done,value}=await reader.read();if(done)break;chunks.push(value)}const totalLength=chunks.reduce((acc,chunk)=>acc+chunk.length,0),output=new Uint8Array(totalLength);let offset=0;return chunks.forEach(chunk=>{output.set(chunk,offset),offset+=chunk.length}),output}if(typeof pako<"u")return pako.inflateRaw(data);throw new Error("Decompression not supported. Please use a modern browser or include pako library.")}const LOGIN_ANIM_STORAGE_KEY="login_lottie_played",LOGIN_ANIM_EXPIRY_MS=1440*60*1e3;function isLoginAnimPlayed(){const stored=localStorage.getItem(LOGIN_ANIM_STORAGE_KEY);if(!stored)return!1;const timestamp=parseInt(stored,10);return isNaN(timestamp)?!1:Date.now()-timestamp<LOGIN_ANIM_EXPIRY_MS}function markLoginAnimPlayed(){localStorage.setItem(LOGIN_ANIM_STORAGE_KEY,Date.now().toString())}function loadAnimation(container,src){const ext=getFileExtension(src),fetchFn=ext==="lottie"?fetchDotLottie:fetchJSON,isLoginAnim=container.dataset.lottieLogin==="true";""+ext,container.dataset.loaded="loading",fetchFn(src).then(function(animationData){if(container.dataset.loaded!=="loading")return;if(isLoginAnim){const alreadyPlayed=isLoginAnimPlayed(),anim2=lottie.loadAnimation({container,renderer:"svg",loop:!1,autoplay:!alreadyPlayed,animationData});alreadyPlayed?(anim2.goToAndStop(anim2.totalFrames-1,!0),void 0):(anim2.addEventListener("complete",function(){markLoginAnimPlayed()}),void 0),animations.set(container,anim2),container.dataset.loaded="true";return}const anim=lottie.loadAnimation({container,renderer:"svg",loop:container.dataset.lottieLoop!=="false",autoplay:!0,animationData});animations.set(container,anim),container.dataset.loaded="true"}).catch(function(err){container.dataset.loaded=""})}const lottieObserver=new IntersectionObserver(function(entries){entries.forEac
1h(function(entry){const container=entry.target,src=container.dataset.lottieSrc;entry.isIntersecting&&src&&!container.dataset.loaded&&loadAnimation(container,src)})},observerOptions),destroyObserver=new IntersectionObserver(function(entries){entries.forEach(function(entry){const container=entry.target,src=container.dataset.lottieSrc;if(!entry.isIntersecting&&container.dataset.loaded==="true"){const anim=animations.get(container);anim&&(anim.destroy(),animations.delete(container),container.innerHTML="",container.dataset.loaded="",void 0)}})},destroyObserverOptions);function observeElement(element){element.dataset.observed||element.dataset.lottieSrc&&(lottieObserver.observe(element),destroyObserver.observe(element),element.dataset.observed="true",element.dataset.lottieSrc,void 0)}function init(){if(typeof lottie>"u"){setTimeout(init,100);return}const elements=document.querySelectorAll("[data-lottie-src]");""+elements.length,elements.forEach(observeElement)}function setupMutationObserver(){new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.addedNodes.forEach(function(node){if(node.nodeType===1){node.dataset&&node.dataset.lottieSrc&&observeElement(node);const children=node.querySelectorAll&&node.querySelectorAll("[data-lottie-src]");children&&children.forEach(observeElement)}})})}).observe(document.body,{childList:!0,subtree:!0})}document.readyState==="complete"?(init(),setupMutationObserver()):window.addEventListener("load",function(){init(),setupMutationObserver()}),document.addEventListener("shopify:section:load",function(){setTimeout(init,100)})})();
2//# sourceMappingURL=/cdn/shop/t/25/assets/lottie-observer.js.map?v=68384051071371276891783318255

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.