import{r as e}from"./react-vendor-SJkaNtXX.js";const t=(t={})=>{const{threshold:o=.1,rootMargin:s="0px 0px -50px 0px"}=t;e.useEffect(()=>{if("undefined"==typeof window||!("IntersectionObserver"in window)){return void document.querySelectorAll(".scroll-animate").forEach(e=>e.classList.add("visible"))}const e=new WeakSet,t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&e.target.classList.add("visible")})},{threshold:o,rootMargin:s}),r=(o=document)=>{o.querySelectorAll(".scroll-animate").forEach(o=>{e.has(o)||(e.add(o),t.observe(o))})};r(document);const n=new MutationObserver(o=>{o.forEach(o=>{o.addedNodes.forEach(o=>{var s;o instanceof Element&&((null==(s=o.classList)?void 0:s.contains("scroll-animate"))&&(e.has(o)||(e.add(o),t.observe(o))),o.querySelectorAll&&r(o))})})});n.observe(document.body,{childList:!0,subtree:!0});const c=setTimeout(()=>{document.querySelectorAll(".scroll-animate:not(.visible)").forEach(e=>{e.classList.add("visible")})},2500);return()=>{t.disconnect(),n.disconnect(),clearTimeout(c)}},[o,s])};export{t as u};