{"version":3,"file":"ScrollProgress.BMLXOy-R.mjs","names":["React.forwardRef","useRef","useState"],"sources":["https:/framerusercontent.com/modules/evRSjXQjugi7cvVXPVth/My2lJlNokJ5queD1qDmL/DsvY2Y6oS.js","https:/framerusercontent.com/modules/FLTvvzyBjUM6DhIEfj1E/HTdXe3XZcloiPB7TJzKK/ScrollProgress.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 16 8 L 14.59 6.59 L 9 12.17 L 9 0 L 7 0 L 7 12.17 L 1.42 6.58 L 0 8 L 8 16 Z\" fill=\"var(--esondr, rgb(0,0,0))\" height=\"16px\" id=\"uR80kQ715\" transform=\"translate(4 4)\" width=\"16px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({fill,height,id,width,...props})=>{return{...props,K5AAorpEW:fill??props.K5AAorpEW??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,K5AAorpEW,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-kk8TD\",className),layoutId:layoutId,ref:ref,style:{\"--esondr\":K5AAorpEW,...style}});});const css=[`.framer-kk8TD { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--esondr); mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"K5AAorpEW\":\"fill\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Arrow Downward\",\"color\":{\"type\":\"variable\",\"value\":\"esondr\"},\"set\":{\"localId\":\"vectorSet/DnLsXE00W\",\"id\":\"DnLsXE00W\",\"moduleId\":\"JIScivAkNLgXrcOUxHXD\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-kk8TD\");Icon.displayName=\"Arrow Downward\";export default Icon;addPropertyControls(Icon,{K5AAorpEW:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Fill\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerImmutableVariables\":\"true\",\"framerVector\":\"{\\\"name\\\":\\\"Arrow Downward\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"esondr\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/DnLsXE00W\\\",\\\"id\\\":\\\"DnLsXE00W\\\",\\\"moduleId\\\":\\\"JIScivAkNLgXrcOUxHXD\\\"}}\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\",\"framerIntrinsicWidth\":\"24\",\"framerContractVersion\":\"1\",\"framerVariables\":\"{\\\"K5AAorpEW\\\":\\\"fill\\\"}\",\"framerDisableUnlink\":\"true\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Scroll Progress component that tracks the scroll progress of its immediate parent Stack, not the window\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Scroll Progress - tracks the scroll of its parent Stack\n * @framerIntrinsicWidth 360\n * @framerIntrinsicHeight 8\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ScrollProgress(props){const{color,backgroundColor,height,borderRadius,style}=props;const barRef=useRef(null);const[progress,setProgress]=useState(0);const isStatic=useIsStaticRenderer();useEffect(()=>{if(isStatic)return;let scrollParent=null;if(barRef.current){// Traverse up to find scrollable parent (Stack)\nlet el=barRef.current.parentElement;while(el&&el!==document.body){const overflowY=window.getComputedStyle(el).overflowY;if(overflowY===\"auto\"||overflowY===\"scroll\"){scrollParent=el;break;}el=el.parentElement;}}if(!scrollParent)return;function handleScroll(){const max=scrollParent.scrollHeight-scrollParent.clientHeight;if(max<=0){startTransition(()=>setProgress(0));return;}startTransition(()=>setProgress(scrollParent.scrollTop/max));}handleScroll();scrollParent.addEventListener(\"scroll\",handleScroll);return()=>{scrollParent?.removeEventListener(\"scroll\",handleScroll);};},[isStatic]);// Animate width but show static at preview/canvas\nconst displayProgress=isStatic?0:progress;return /*#__PURE__*/_jsx(\"div\",{ref:barRef,style:{width:\"100%\",height,background:backgroundColor,borderRadius,position:\"relative\",overflow:\"hidden\",...style},\"aria-hidden\":true,children:/*#__PURE__*/_jsx(\"div\",{style:{width:`${displayProgress*100}%`,height:\"100%\",background:color,borderRadius,transition:isStatic?\"none\":\"width 0.45s cubic-bezier(0.33,1,0.68,1)\"}})});}addPropertyControls(ScrollProgress,{color:{type:ControlType.Color,title:\"Bar Color\",defaultValue:\"#0099FF\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#EEEEEE\"},height:{type:ControlType.Number,title:\"Height\",defaultValue:8,min:2,max:40,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:24}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollProgress\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"8\",\"framerSupportedL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