{"version":3,"file":"TextReveal.DEpHSRDA.mjs","names":["__esmMin","c","J","init_jsx_runtime","init_npm_react_18_3_1","MOTION","words","done","split","el","out","walker","texts","t","parts","frag","part","span","withTextReveal","Component","props","useScroll","ref","reveal","FROM","EDGE","init_TextReveal","init_Scroll","mm","list","gsap"],"sources":["https:/framerusercontent.com/modules/E5PaOI80FHIFH22DoeJ6/YZkhLkijZazZwIT9p3co/TextReveal.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";import{useScroll,MOTION}from\"https://framerusercontent.com/modules/hJsQnBJGZQOjWLqRhBc8/6wwnRKzSXvXwIiNHpiNT/Scroll.js\";// Scroll-scrubbed text reveal (Home About lead): the words go from 20% to full opacity, in reading order, as the text moves\n// up the screen, with a soft 4-word edge, like the Figma frame. Runs on GSAP ScrollTrigger (scrubbed, so it moves with Lenis).\n// Starts when the text's top reaches 85% of the screen and finishes when its bottom reaches the middle.\n// Off for reduced motion (the words aren't split and show at full opacity). Not on touch-off: it's opacity only, no jitter.\nconst FROM=.15;const EDGE=4;const split=new WeakMap;// Wrap each word in a span once; spaces stay as plain text so wrapping and selection are unchanged.\nfunction words(el){const done=split.get(el);if(done)return done;const out=[];const walker=document.createTreeWalker(el,NodeFilter.SHOW_TEXT);const texts=[];while(walker.nextNode())texts.push(walker.currentNode);for(const t of texts){const parts=(t.nodeValue||\"\").split(/(\\s+)/);if(parts.length<2&&!parts[0])continue;const frag=document.createDocumentFragment();for(const part of parts){if(!part)continue;if(/^\\s+$/.test(part))frag.appendChild(document.createTextNode(part));else{const span=document.createElement(\"span\");span.textContent=part;out.push(span);frag.appendChild(span);}}t.parentNode?.replaceChild(frag,t);}split.set(el,out);return out;}// Word i fades over [i, i + EDGE] of a timeline EDGE + word count long, so 4 words are always mid-fade.\nconst reveal=(el,gsap,_ST,mm)=>{mm.add(MOTION,()=>{const list=words(el);if(!list.length)return;gsap.timeline({scrollTrigger:{trigger:el,start:\"top 85%\",end:\"bottom 30%\",scrub:true}}).fromTo(list,{opacity:FROM},{opacity:1,duration:EDGE,stagger:1,ease:\"none\"},0).set({},{},list.length+EDGE);});};export function withTextReveal(Component){return /*#__PURE__*/forwardRef(function TextReveal(props,ref){return /*#__PURE__*/_jsx(Component,{...props,ref:useScroll(ref,reveal)});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withTextReveal\":{\"type\":\"reactHoc\",\"name\":\"withTextReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"A,uKAKA,SAASM,EAAM,EAAG,CAAC,IAAMC,EAAKC,EAAM,IAAIC,CAAE,EAAE,GAAGF,EAAK,OAAOA,EAAK,IAAMG,EAAI,CAAC,EAAQC,EAAO,SAAS,iBAAiBF,EAAG,WAAW,SAAS,EAAQG,EAAM,CAAC,EAAE,KAAMD,EAAO,SAAS,GAAEC,EAAM,KAAKD,EAAO,WAAW,EAAE,IAAI,IAAME,KAAKD,EAAM,CAAC,IAAME,GAAOD,EAAE,WAAW,GAAA,CAAI,MAAM,OAAO,EAAE,GAAGC,EAAM,OAAO,GAAG,CAACA,EAAM,GAAG,SAAS,IAAMC,EAAK,SAAS,uBAAuB,EAAE,IAAI,IAAMC,KAAQF,EAAO,GAAIE,EAAc,IAAG,QAAQ,KAAKA,CAAI,EAAED,EAAK,YAAY,SAAS,eAAeC,CAAI,CAAC,MAAM,CAAC,IAAMC,EAAK,SAAS,cAAc,MAAM,EAAE,EAAK,YAAYD,EAAKN,EAAI,KAAKO,CAAI,EAAEF,EAAK,YAAYE,CAAI,CAAE,EAAEJ,EAAE,YAAY,aAAaE,EAAKF,CAAC,CAAE,CAAmB,OAAlBL,EAAM,IAAIC,EAAGC,CAAG,EAASA,CAAI,CAClW,SAAgBQ,EAAe,EAAU,CAAC,MAAoB,gBAAW,SAAoB,EAAM,EAAI,CAAC,MAAoB,gBAAKC,EAAU,CAAC,GAAGC,EAAM,IAAIC,EAAUC,EAAIC,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