{"version":3,"file":"StaggerReveal.C4yojev3.mjs","names":["useRef","useLayoutEffect","useEffect","__esmMin","le","init_ssg_sandbox_shims","window","de","c","init_jsx_runtime","init_npm_react_18_3_1","ce","addPropertyControls","init_framer_CaDWdxiz","RenderTarget","ControlType","StaggerReveal","props","ref","useIsoLayoutEffect","marker","anchor","container","target","getItems","el","hide","distance","show","items","played","play","anim","duration","i","step","inView","r","vh","threshold","check","observer","entries","raf","fallback","init_StaggerReveal"],"sources":["https:/framerusercontent.com/modules/gvEeg763oQ7YAMhLmL8Y/3SMLiejEThlG8U1zYWC3/StaggerReveal.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useLayoutEffect,useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const useIsoLayoutEffect=typeof window!==\"undefined\"?useLayoutEffect:useEffect;/**\n * Reveals the cards of a group one by one when the group scrolls into view.\n * Works with regular stacks, grids and CMS collection lists.\n * Place it right after the card container (or inside it) — it renders nothing.\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function StaggerReveal(props){const{target=\"Previous sibling\",step=.12,duration=.9,distance=28,threshold=.15}=props;const ref=useRef(null);useIsoLayoutEffect(()=>{if(typeof window===\"undefined\")return;if(RenderTarget.current()===RenderTarget.canvas)return;if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;const marker=ref.current;if(!marker)return;// Framer wraps code components in their own container element, so climb out of it first\nlet anchor=marker;while(anchor.parentElement&&anchor.parentElement.children.length===1&&!anchor.previousElementSibling){anchor=anchor.parentElement;}const container=target===\"Parent\"?anchor.parentElement:anchor.previousElementSibling;if(!container)return;const getItems=()=>Array.from(container.children).filter(el=>el!==anchor&&getComputedStyle(el).position!==\"absolute\");// Hide with filter/translate instead of opacity/transform, so Framer hover effects\n// (which animate opacity and transform) never pick up a hidden start value.\nconst hide=el=>{el.style.filter=\"opacity(0)\";el.style.translate=`0 ${distance}px`;};const show=el=>{el.style.filter=\"\";el.style.translate=\"\";};let items=getItems();items.forEach(hide);let played=false;const play=()=>{if(played)return;played=true;items=getItems();items.forEach((el,i)=>{const anim=el.animate([{filter:\"opacity(0)\",translate:`0 ${distance}px`},{filter:\"opacity(1)\",translate:\"0 0\"}],{duration:duration*1e3,delay:i*step*1e3,easing:\"cubic-bezier(0.22, 1, 0.36, 1)\",fill:\"backwards\"});show(el);anim.onfinish=()=>anim.cancel();});};const inView=()=>{const r=container.getBoundingClientRect();const vh=window.innerHeight||document.documentElement.clientHeight;return r.top<vh*(1-Math.min(threshold,.9))&&r.bottom>0;};const check=()=>{if(played)return;if(inView())play();else if(container.getBoundingClientRect().bottom<0){played=true;getItems().forEach(show);}};let observer=null;if(\"IntersectionObserver\"in window){observer=new IntersectionObserver(entries=>{if(entries.some(e=>e.isIntersecting))check();},{threshold:[0,threshold]});observer.observe(container);}window.addEventListener(\"scroll\",check,{passive:true});document.addEventListener(\"visibilitychange\",check);const raf=requestAnimationFrame(check);// safety net: never leave cards hidden\nconst fallback=window.setTimeout(()=>{if(!played&&(document.visibilityState!==\"visible\"||inView()))play();},2500);return()=>{observer?.disconnect();window.removeEventListener(\"scroll\",check);document.removeEventListener(\"visibilitychange\",check);cancelAnimationFrame(raf);window.clearTimeout(fallback);getItems().forEach(show);};},[target,step,duration,distance,threshold]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{position:\"relative\",width:0,height:0,pointerEvents:\"none\",...props.style}});}addPropertyControls(StaggerReveal,{target:{type:ControlType.Enum,title:\"Target\",options:[\"Previous sibling\",\"Parent\"],defaultValue:\"Previous sibling\"},step:{type:ControlType.Number,title:\"Stagger\",defaultValue:.12,min:0,max:.5,step:.01,unit:\"s\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:.9,min:.2,max:2,step:.05,unit:\"s\"},distance:{type:ControlType.Number,title:\"Distance\",defaultValue:28,min:0,max:80,step:1,unit:\"px\"},threshold:{type:ControlType.Number,title:\"Threshold\",defaultValue:.15,min:0,max:1,step:.05}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StaggerReveal\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StaggerReveal.map"],"mappings":"A,8MAOG,SAAwBgB,EAAc,EAAM,CAAC,GAAK,CAAC,SAAO,mBAAmB,OAAK,IAAI,WAAS,GAAG,WAAS,GAAG,YAAU,KAAKC,EAAYC,EAAIlB,EAAO,IAAI,EAI2N,OAJzNmB,MAAuB,CAA8F,GAAnFb,IAAS,QAAsBQ,EAAa,QAAQ,IAAIA,EAAa,QAAiBR,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAQ,OAAO,IAAMc,EAAOF,EAAI,QAAQ,GAAG,CAACE,EAAO,OAC9X,IAAIC,EAAOD,EAAO,KAAMC,EAAO,eAAeA,EAAO,cAAc,SAAS,SAAS,GAAG,CAACA,EAAO,wBAAwB,EAAOA,EAAO,cAAe,IAAMC,EAAUC,IAAS,SAASF,EAAO,cAAcA,EAAO,uBAAuB,GAAG,CAACC,EAAU,OAAO,IAAME,MAAa,MAAM,KAAKF,EAAU,QAAQ,CAAC,CAAC,OAAO,GAAIG,IAAKJ,GAAQ,iBAAiBI,CAAE,CAAC,CAAC,WAAW,UAAU,EAE7WC,EAAK,GAAI,CAAC,EAAG,MAAM,OAAO,aAAa,EAAG,MAAM,UAAU,KAAKC,EAAS,GAAI,EAAQC,EAAK,GAAI,CAAC,EAAG,MAAM,OAAO,GAAG,EAAG,MAAM,UAAU,EAAG,EAAMC,EAAML,EAAS,EAAEK,EAAM,QAAQH,CAAI,EAAE,IAAII,EAAO,GAAYC,MAAS,CAAID,IAAc,EAAO,GAAK,EAAMN,EAAS,EAAEK,EAAM,SAAS,EAAG,IAAI,CAAC,IAAMG,EAAKP,EAAG,QAAQ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