{"version":3,"file":"DelayedHighlight.DivSleBy.mjs","names":["useId","useRef","useMemo","__esmMin","pe","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","ie","le","c","init_jsx_runtime","de","animate","init_framer_motion_DhsWWWsN","init_framer_CKT6jEEQ","useIsStaticRenderer","sanitizeId","value","withDelayedHighlight","isStaticRenderer","generatedId","animationStopRef","timeoutRef","mutationObserverRef","intersectionObserverRef","rafRef","sweepId","props","selectorValue","root","mounted","hasTriggered","progress","highlightColor","reducedMotion","stopAnimation","clearTimers","setProgress","clearHighlightStyles","scope","element","findClosestInlineSpan","current","node","collectPhraseTargets","start","end","walker","targets","cursor","textNode","textValue","nodeStart","nodeEnd","span","unique","other","applyHighlightStyles","setupHighlight","controls","latest","setupMutationObserver","setupIntersectionObserver","entry","entries","attempts","findRoot","Component","init_DelayedHighlight"],"sources":["https:/framerusercontent.com/modules/iV0QofQqicMFpQzHQD05/4sRSsQ2pOelIANi32Qna/DelayedHighlight.js"],"sourcesContent":["/**\n * User request: rebuild delayed highlight override so it returns only <Component {...props} />,\n * avoids ref interception/wrappers, preserves native Framer text entrance behavior, and applies\n * a delayed gradient sweep highlight to the phrase \"product strategist\" via DOM query + observers.\n */import{jsx as _jsx}from\"react/jsx-runtime\";import{useId,useLayoutEffect,useMemo,useRef}from\"react\";import{useIsStaticRenderer}from\"framer\";import{animate}from\"framer-motion\";function sanitizeId(value){return value.replace(/[^a-zA-Z0-9_-]/g,\"_\");}export function withDelayedHighlight(Component){return function WithDelayedHighlight(props){const isStaticRenderer=useIsStaticRenderer();const generatedId=useId();const animationStopRef=useRef(null);const timeoutRef=useRef(null);const mutationObserverRef=useRef(null);const intersectionObserverRef=useRef(null);const rafRef=useRef(null);const sweepId=useMemo(()=>{const base=props?.id?String(props.id):generatedId;return sanitizeId(base);},[generatedId,props?.id]);useLayoutEffect(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const selectorValue=sweepId.replace(/\"/g,'\\\\\"');let root=null;let mounted=true;let hasTriggered=false;let progress=0;const phrase=\"product strategist\";const highlightColor=\"var(--token-47a037e5-ed5f-4b1a-b252-677b6cc69b4e, rgb(209,227,197))\";const reducedMotion=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;const stopAnimation=()=>{if(animationStopRef.current){animationStopRef.current();animationStopRef.current=null;}};const clearTimers=()=>{if(timeoutRef.current!==null){window.clearTimeout(timeoutRef.current);timeoutRef.current=null;}if(rafRef.current!==null){window.cancelAnimationFrame(rafRef.current);rafRef.current=null;}};const setProgress=value=>{progress=Math.max(0,Math.min(100,value));if(root){root.style.setProperty(\"--highlight-sweep-progress\",`${progress}%`);}};const clearHighlightStyles=scope=>{const current=scope.querySelectorAll(\"[data-highlight-sweep-part='true']\");current.forEach(element=>{element.removeAttribute(\"data-highlight-sweep-part\");element.style.removeProperty(\"background-image\");element.style.removeProperty(\"background-repeat\");element.style.removeProperty(\"background-size\");element.style.removeProperty(\"background-position\");});};const findClosestInlineSpan=(node,scope)=>{let current=node;while(current&&current!==scope){if(current.nodeType===1&&current.tagName.toLowerCase()===\"span\"){return current;}current=current.parentNode;}return null;};const collectPhraseTargets=scope=>{const content=scope.textContent?.toLowerCase()??\"\";const start=content.indexOf(phrase);if(start<0)return[];const end=start+phrase.length;const walker=document.createTreeWalker(scope,NodeFilter.SHOW_TEXT);const targets=[];let cursor=0;while(walker.nextNode()){const textNode=walker.currentNode;const textValue=textNode.textContent??\"\";const nodeStart=cursor;const nodeEnd=cursor+textValue.length;const overlaps=nodeEnd>start&&nodeStart<end;if(overlaps){const span=findClosestInlineSpan(textNode,scope);if(span)targets.push(span);}cursor=nodeEnd;}const unique=Array.from(new Set(targets));return unique.filter(element=>!unique.some(other=>other!==element&&other.contains(element)));};const applyHighlightStyles=scope=>{const targets=collectPhraseTargets(scope);clearHighlightStyles(scope);targets.forEach(element=>{element.setAttribute(\"data-highlight-sweep-part\",\"true\");element.style.backgroundImage=`linear-gradient(${highlightColor}, ${highlightColor})`;element.style.backgroundRepeat=\"no-repeat\";element.style.backgroundSize=\"var(--highlight-sweep-progress, 0%) 100%\";element.style.backgroundPosition=\"left top\";});setProgress(progress);};const setupHighlight=()=>{if(!mounted||!root)return;if(reducedMotion||isStaticRenderer){setProgress(100);applyHighlightStyles(root);return;}setProgress(0);applyHighlightStyles(root);timeoutRef.current=window.setTimeout(()=>{if(!mounted||!root)return;stopAnimation();const controls=animate(progress,100,{type:\"spring\",duration:1.2,bounce:0,onUpdate:latest=>{if(!mounted)return;setProgress(latest);if(root)applyHighlightStyles(root);}});animationStopRef.current=controls.stop;},1400);};const setupMutationObserver=()=>{if(!root||isStaticRenderer)return;mutationObserverRef.current=new MutationObserver(()=>{if(!mounted||!root)return;applyHighlightStyles(root);});mutationObserverRef.current.observe(root,{childList:true,subtree:true});};const setupIntersectionObserver=()=>{if(!root)return;if(isStaticRenderer||reducedMotion){setupHighlight();setupMutationObserver();return;}intersectionObserverRef.current=new IntersectionObserver(entries=>{if(hasTriggered)return;const entry=entries[0];if(!entry||!entry.isIntersecting)return;hasTriggered=true;setupHighlight();setupMutationObserver();if(intersectionObserverRef.current){intersectionObserverRef.current.disconnect();intersectionObserverRef.current=null;}},{threshold:0});intersectionObserverRef.current.observe(root);};let attempts=0;const findRoot=()=>{if(!mounted)return;root=document.querySelector(`[data-highlight-sweep=\"${selectorValue}\"]`);if(root){setupIntersectionObserver();return;}attempts+=1;if(attempts<20){rafRef.current=window.requestAnimationFrame(findRoot);}};findRoot();return()=>{mounted=false;clearTimers();stopAnimation();if(mutationObserverRef.current){mutationObserverRef.current.disconnect();mutationObserverRef.current=null;}if(intersectionObserverRef.current){intersectionObserverRef.current.disconnect();intersectionObserverRef.current=null;}if(root){clearHighlightStyles(root);root.style.removeProperty(\"--highlight-sweep-progress\");}};},[isStaticRenderer,sweepId]);return /*#__PURE__*/_jsx(Component,{...props,\"data-highlight-sweep\":sweepId});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withDelayedHighlight\":{\"type\":\"reactHoc\",\"name\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