{"version":3,"file":"PortfolioLoaderSequence.BToFrYVJ.mjs","names":["useRef","useState","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/4ZRJAd9vtX8L5MWo4hXn/ZQHE8Jmm8pyha1mVjyGH/PortfolioLoaderSequence.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useIsStaticRenderer}from\"framer\";import{forwardRef,startTransition,useCallback,useEffect,useMemo,useRef,useState}from\"react\";import{useInView}from\"framer-motion\";/**\n * User request: Create a Framer code override export named PortfolioLoaderSequence for an existing canvas loader frame.\n * The override must run once on mount: start visible covering the viewport; animate its child content from opacity 0 and translateY(16px) to visible over 400ms; pause 500ms; animate child content to opacity 0 and translateY(-24px); then slide the entire loader upward out of the viewport over 700ms using cubic-bezier(0.77, 0, 0.18, 1), with total duration about 1.6 seconds.\n * After completion set pointer events to none and visibility hidden. Respect prefers-reduced-motion by hiding immediately without animation.\n * Keep all typography and layout canvas-editable; the override should only add runtime sequencing and should not rebuild the visual.\n * Ensure it is safe for SSR/static rendering and does not persistently block page interaction.\n */export function PortfolioLoaderSequence(Component){return /*#__PURE__*/forwardRef(function PortfolioLoaderSequenceOverride(props,ref){const isStaticRenderer=useIsStaticRenderer();const rootRef=useRef(null);const isInView=useInView(rootRef,{amount:.1});const hasRunRef=useRef(false);const[isHidden,setIsHidden]=useState(false);const setRefs=useCallback(node=>{rootRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref&&typeof ref===\"object\"){ref.current=node;}},[ref]);useEffect(()=>{let isCancelled=false;const hideImmediately=()=>{if(isCancelled)return;startTransition(()=>setIsHidden(true));};const prefersReducedMotion=typeof window!==\"undefined\"&&typeof window.matchMedia===\"function\"&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;if(isStaticRenderer||prefersReducedMotion){hideImmediately();return;}if(!isInView||hasRunRef.current)return;hasRunRef.current=true;const root=rootRef.current;if(!root)return;const childElements=Array.from(root.children);if(childElements.length===0){root.animate([{transform:\"translateY(0vh)\"},{transform:\"translateY(-100vh)\"}],{duration:700,easing:\"cubic-bezier(0.77, 0, 0.18, 1)\",fill:\"forwards\"}).onfinish=()=>{hideImmediately();};return;}childElements.forEach(child=>{child.style.opacity=\"0\";child.style.transform=\"translateY(16px)\";});const run=async()=>{const animateChildren=(keyframes,duration)=>{const animations=childElements.map(child=>child.animate(keyframes,{duration,easing:\"ease\",fill:\"forwards\"}));return Promise.all(animations.map(animation=>new Promise(resolve=>{animation.onfinish=()=>resolve();animation.oncancel=()=>resolve();})));};const wait=ms=>new Promise(resolve=>{if(typeof window!==\"undefined\"){window.setTimeout(resolve,ms);}else{resolve();}});await animateChildren([{opacity:0,transform:\"translateY(16px)\"},{opacity:1,transform:\"translateY(0px)\"}],400);if(isCancelled)return;await wait(500);if(isCancelled)return;await animateChildren([{opacity:1,transform:\"translateY(0px)\"},{opacity:0,transform:\"translateY(-24px)\"}],200);if(isCancelled)return;await new Promise(resolve=>{const slideAnimation=root.animate([{transform:\"translateY(0vh)\"},{transform:\"translateY(-100vh)\"}],{duration:700,easing:\"cubic-bezier(0.77, 0, 0.18, 1)\",fill:\"forwards\"});slideAnimation.onfinish=()=>resolve();slideAnimation.oncancel=()=>resolve();});if(isCancelled)return;hideImmediately();};run();return()=>{isCancelled=true;};},[isInView,isStaticRenderer]);return /*#__PURE__*/_jsx(Component,{ref:setRefs,...props,style:{position:\"relative\",...props.style,pointerEvents:isHidden?\"none\":props.style?.pointerEvents,visibility:isHidden?\"hidden\":props.style?.visibility}});});}export function ProjectSectionTabsActive(Component){return /*#__PURE__*/forwardRef(function ProjectSectionTabsActiveOverride(props,ref){const rootRef=useRef(null);const activeIdRef=useRef(\"\");const tabHashes=useMemo(()=>[\"#overview\",\"#problem\",\"#research\",\"#solution\",\"#reflection\"],[]);const setActiveStyles=useCallback((anchors,activeHash)=>{activeIdRef.current=activeHash;for(const anchor of anchors){const isActive=anchor.getAttribute(\"href\")===activeHash;anchor.style.fontWeight=isActive?\"700\":\"500\";anchor.style.color=isActive?\"#111111\":\"#72716D\";}},[]);useEffect(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const rootEl=rootRef.current;if(!rootEl)return;const anchors=Array.from(rootEl.querySelectorAll('a[href^=\"#\"]'));if(anchors.length===0)return;const anchorsByHash=new Map;for(const anchor of anchors){const href=anchor.getAttribute(\"href\");if(!href)continue;anchorsByHash.set(href,anchor);}const firstAvailableHash=tabHashes.find(hash=>anchorsByHash.has(hash))??anchors[0].getAttribute(\"href\")??\"#overview\";setActiveStyles(anchors,firstAvailableHash);const clickHandlers=[];for(const anchor of anchors){const handler=event=>{event.preventDefault();const hash=anchor.getAttribute(\"href\");if(!hash)return;setActiveStyles(anchors,hash);const target=document.querySelector(hash);if(!target)return;const targetY=target.getBoundingClientRect().top+window.scrollY-160;window.scrollTo({top:Math.max(0,targetY),behavior:\"smooth\"});};anchor.addEventListener(\"click\",handler);clickHandlers.push({anchor,handler});}const observedSections=tabHashes.map(hash=>{const section=document.querySelector(hash);return section?{hash,section}:null;}).filter(Boolean);const visible=new Map;const sectionToHash=new Map;for(const item of observedSections){sectionToHash.set(item.section,item.hash);}const observer=new IntersectionObserver(entries=>{for(const entry of entries){const hash=sectionToHash.get(entry.target);if(!hash)continue;if(entry.isIntersecting){visible.set(hash,entry);}else{visible.delete(hash);}}let nextActive=activeIdRef.current||firstAvailableHash;if(visible.size>0){nextActive=Array.from(visible.entries()).sort((a,b)=>{const aTop=Math.abs(a[1].boundingClientRect.top-160);const bTop=Math.abs(b[1].boundingClientRect.top-160);return aTop-bTop;})[0][0];}else{for(const hash of tabHashes){const section=document.querySelector(hash);if(!section)continue;const top=section.getBoundingClientRect().top;if(top-160<=0)nextActive=hash;}}if(nextActive!==activeIdRef.current){setActiveStyles(anchors,nextActive);}},{root:null,rootMargin:\"-160px 0px -55% 0px\",threshold:[0,.1,.25,.5,.75,1]});for(const item of observedSections)observer.observe(item.section);return()=>{for(const{anchor,handler}of clickHandlers){anchor.removeEventListener(\"click\",handler);}observer.disconnect();};},[setActiveStyles,tabHashes]);return /*#__PURE__*/_jsx(Component,{...props,ref:node=>{rootRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref){ref.current=node;}}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"PortfolioLoaderSequence\":{\"type\":\"reactHoc\",\"name\":\"PortfolioLoaderSequence\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ProjectSectionTabsActive\":{\"type\":\"reactHoc\",\"name\":\"ProjectSectionTabsActive\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PortfolioLoaderSequence.map"],"mappings":"6QAMG,SAAgB,EAAwB,EAAU,CAAC,OAAoB,EAAW,SAAyC,EAAM,EAAI,CAAC,IAAM,EAAiB,EAAoB,EAAQ,EAAQA,EAAO,IAAI,EAAQ,EAAS,EAAU,EAAQ,CAAC,OAAO,EAAE,CAAC,EAAQ,EAAUA,EAAO,EAAK,EAAO,CAAC,EAAS,GAAaC,EAAS,EAAK,EAAQ,EAAQC,EAAY,GAAM,CAAC,EAAQ,QAAQ,EAAQ,OAAO,GAAM,WAAY,EAAI,CAAI,EAAW,GAAK,OAAO,GAAM,WAAU,EAAI,QAAQ,EAAM,EAAE,CAAC,CAAG,CAAC,EAA45D,OAA15D,MAAc,CAAC,IAAI,EAAY,GAAY,MAAoB,CAAI,GAAmB,MAAoB,EAAY,EAAI,CAAC,CAAE,EAAQ,EAA4B,IAAS,QAAa,OAAO,EAAO,YAAa,YAAY,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAQ,GAAG,GAAkB,EAAqB,CAAC,EAAgB,EAAE,MAAO,CAAC,GAAG,CAAC,GAAU,EAAU,QAAQ,OAAO,EAAU,QAAQ,GAAK,IAAM,EAAK,EAAQ,QAAQ,GAAG,CAAC,EAAK,OAAO,IAAM,EAAc,MAAM,KAAK,EAAK,QAAQ,EAAE,GAAG,EAAc,SAAS,EAAE,CAAC,EA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