text: function BackgroundNode({node:e,loadedClassName:a}){let o=e.getAttribute("data-background-image-url");return{node:e,load:d=>{let n=new Image;n.onload=(d=>{requestAnimationFrame(()=>{e.style.backgroundImage=`url(${o})`,e.classList.add(a),d()})})(d),n.src=o}}}let defaultOptions={selector:"[data-background-image-url]",loadedClassName:"loaded"};function BackgroundLazyLoader({selector:e,loadedClassName:a}=defaultOptions){let o=[].slice.apply(document.querySelectorAll(e)).map(e=>new BackgroundNode({node:e,loadedClassName:a})),d=new IntersectionObserver((e,a)=>{e.forEach(({target:e,isIntersecting:d})=>{if(!d)return;let n=o.find(a=>a.node.isSameNode(e));n&&n.load(()=>{a.unobserve(e),(o=o.filter(a=>!a.node.isSameNode(e))).length||a.disconnect()})})});o.forEach(e=>d.observe(e.node))}BackgroundLazyLoader();