{"version":3,"file":"CaseStudyProgressTop.wbcVUaRV.mjs","names":["React.useState","_Fragment","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","l","_e","p","c","init_jsx_runtime","ce","useScroll","useSpring","init_framer_motion_DhsWWWsN","motion","init_framer_BL70qLPA","RenderTarget","CaseStudyProgressTop","isCanvas","scaleY","scrollYProgress","visible","setVisible","phoneMq","lastY","hideTimer","onScroll","y","past","goingUp","goingDown","goTop","reduce","show","CSS","init_CaseStudyProgressTop"],"sources":["https:/framerusercontent.com/modules/Uafa0rz38wMRtiGpXCkB/oU5X3JIzPVxTm5R40mzH/CaseStudyProgressTop.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{motion,useScroll,useSpring}from\"framer-motion\";import{RenderTarget}from\"framer\";/**\n * Back-to-top button with scroll progress line.\n * Desktop/tablet: unchanged (appears after 650px, progress line above).\n * Phone (≤767px): smaller, no progress line, sits clear of the home indicator,\n * and only appears while the visitor scrolls UP (the moment they want the top),\n * so it never parks on top of content while they read.\n * Reduce Motion: jumps to the top instead of smooth-scrolling.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */const CSS=`\n.cspt{position:fixed;right:28px;bottom:28px;z-index:999;width:58px;height:112px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:10px;font-family:Manrope,Inter,sans-serif}\n.cspt.is-canvas{position:relative;right:auto;bottom:auto}\n.cspt__track{height:46px;width:2px;border-radius:99px;background:rgba(96,113,124,.18);overflow:hidden;position:relative}\n.cspt__btn{width:48px;height:48px;border-radius:999px;border:1px solid rgba(96,113,124,.22);background:rgba(251,250,247,.92);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);box-shadow:0 8px 28px rgba(6,16,24,.12);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;cursor:pointer;color:#101318;padding:0}\n.cspt__arrow{font-size:16px;line-height:1}\n.cspt__lbl{font-size:7.5px;font-weight:850;letter-spacing:.1em}\n@media (max-width:767px){\n .cspt:not(.is-canvas){right:14px;bottom:calc(14px + env(safe-area-inset-bottom,0px));width:40px;height:40px;gap:0}\n .cspt:not(.is-canvas) .cspt__track{display:none}\n .cspt:not(.is-canvas) .cspt__btn{width:40px;height:40px;background:rgba(251,250,247,.86);box-shadow:0 6px 18px rgba(6,16,24,.18)}\n .cspt:not(.is-canvas) .cspt__lbl{display:none}\n .cspt:not(.is-canvas) .cspt__arrow{font-size:17px}\n}\n`;export default function CaseStudyProgressTop(){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const{scrollYProgress}=useScroll();const scaleY=useSpring(scrollYProgress,{stiffness:120,damping:26,mass:.25});const[visible,setVisible]=React.useState(false);React.useEffect(()=>{if(isCanvas||typeof window===\"undefined\")return;const phoneMq=window.matchMedia(\"(max-width: 767px)\");let lastY=window.scrollY;let hideTimer=null;const onScroll=()=>{const y=window.scrollY;const past=y>650;if(!phoneMq.matches){setVisible(past);}else{const goingUp=y<lastY-4;const goingDown=y>lastY+4;if(past&&goingUp){setVisible(true);clearTimeout(hideTimer);// tuck away again if they stop scrolling up and keep reading\nhideTimer=setTimeout(()=>setVisible(false),2600);}else if(goingDown||!past){setVisible(false);}}lastY=y;};onScroll();window.addEventListener(\"scroll\",onScroll,{passive:true});return()=>{clearTimeout(hideTimer);window.removeEventListener(\"scroll\",onScroll);};},[isCanvas]);const goTop=()=>{if(typeof window===\"undefined\")return;const reduce=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;window.scrollTo({top:0,behavior:reduce?\"auto\":\"smooth\"});};const show=isCanvas||visible;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:CSS}}),/*#__PURE__*/_jsxs(motion.div,{className:`cspt${isCanvas?\" is-canvas\":\"\"}`,initial:false,animate:{opacity:show?1:0,y:show?0:8},transition:{duration:.25},style:{pointerEvents:show?\"auto\":\"none\"},\"aria-hidden\":show?undefined:true,children:[/*#__PURE__*/_jsx(\"div\",{className:\"cspt__track\",children:/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",inset:0,background:\"linear-gradient(180deg,#72B0D3,#6D4CFF 55%,#0CC48B)\",transformOrigin:\"top\",scaleY:isCanvas?1:scaleY}})}),/*#__PURE__*/_jsxs(motion.button,{type:\"button\",className:\"cspt__btn\",onClick:goTop,whileHover:isCanvas?undefined:{y:-2},whileTap:isCanvas?undefined:{scale:.96},\"aria-label\":\"Back to top\",tabIndex:show?0:-1,children:[/*#__PURE__*/_jsx(\"span\",{className:\"cspt__arrow\",\"aria-hidden\":\"true\",children:\"↑\"}),/*#__PURE__*/_jsx(\"span\",{className:\"cspt__lbl\",\"aria-hidden\":\"true\",children:\"TOP\"})]})]})]});}CaseStudyProgressTop.defaultProps={width:58,height:112};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CaseStudyProgressTop\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CaseStudyProgressTop.map"],"mappings":"A,qQAwBE,SAAwBkB,GAAsB,CAAC,IAAMC,EAASF,EAAa,QAAQ,IAAIA,EAAa,OAAY,CAAC,mBAAiBL,EAAU,EAAQQ,EAAOP,EAAUQ,EAAgB,CAAC,UAAU,IAAI,QAAQ,GAAG,KAAK,GAAG,CAAC,EAAO,CAACC,EAAQC,GAAYvB,EAAe,EAAK,EAAEW,MAAoB,CAAC,GAAGQ,GAAiBd,IAAS,OAAY,OAAO,IAAMmB,EAAQnB,EAAO,WAAW,oBAAoB,EAAMoB,EAAMpB,EAAO,QAAYqB,EAAU,KAAWC,MAAa,CAAC,IAAMC,EAAEvB,EAAO,QAAcwB,EAAKD,EAAE,IAAI,GAAG,CAACJ,EAAQ,QAASD,EAAWM,CAAI,MAAO,CAAC,IAAMC,EAAQF,EAAEH,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