{"version":3,"file":"Progressbar.CY2zuFd7.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/VNVwvlZEvcxTg6JUkTpP/nu6uP1Athuk38DxYYFHq/oZOouv5U4.js","https:/framerusercontent.com/modules/vhT9G3IcdCjA480BX9lo/I81AYqa5aVYOblNadOII/Progressbar.js"],"sourcesContent":["// Generated by Framer (9f68555)\nimport{fontStore}from\"framer\";fontStore.loadFonts([\"FS;Manrope-medium\",\"FS;Manrope-bold\"]);export const fonts=[{explicitInter:true,fonts:[{family:\"Manrope\",source:\"fontshare\",style:\"normal\",url:\"https://framerusercontent.com/third-party-assets/fontshare/wf/BNWG6MUI4RTC6WEND2VPDH4MHMIVU3XZ/R5YXY5FMVG6PXU36GNEEA24MIPMEPGSM/CIM4KQCLZSMMLWPVH25IDDSTY4ENPHEY.woff2\",weight:\"500\"},{family:\"Manrope\",source:\"fontshare\",style:\"normal\",url:\"https://framerusercontent.com/third-party-assets/fontshare/wf/NGBUP45ES3F7RD5XGKPEDJ6QEPO4TMOK/EXDVWJ2EDDVVV65UENMX33EDDYBX6OF7/6P4FPMFQH7CCC7RZ4UU4NKSGJ2RLF7V5.woff2\",weight:\"700\"}]}];export const css=['.framer-ItVEy .framer-styles-preset-118tydz:not(.rich-text-wrapper), .framer-ItVEy .framer-styles-preset-118tydz.rich-text-wrapper h5 { --framer-font-family: \"Manrope\", \"Manrope Placeholder\", sans-serif; --framer-font-family-bold: \"Manrope\", \"Manrope Placeholder\", sans-serif; --framer-font-open-type-features: normal; --framer-font-size: 32px; --framer-font-style: normal; --framer-font-style-bold: normal; --framer-font-variation-axes: normal; --framer-font-weight: 500; --framer-font-weight-bold: 700; --framer-letter-spacing: -0.02em; --framer-line-height: 120%; --framer-paragraph-spacing: 40px; --framer-text-alignment: start; --framer-text-color: var(--token-cdc179a0-8597-4ca5-848c-d29b9c8ba1b0, #101010); --framer-text-decoration: none; --framer-text-stroke-color: initial; --framer-text-stroke-width: initial; --framer-text-transform: none; }','@media (max-width: 1199px) and (min-width: 0px) { .framer-ItVEy .framer-styles-preset-118tydz:not(.rich-text-wrapper), .framer-ItVEy .framer-styles-preset-118tydz.rich-text-wrapper h5 { --framer-font-family: \"Manrope\", \"Manrope Placeholder\", sans-serif; --framer-font-family-bold: \"Manrope\", \"Manrope Placeholder\", sans-serif; --framer-font-open-type-features: normal; --framer-font-size: 24px; --framer-font-style: normal; --framer-font-style-bold: normal; --framer-font-variation-axes: normal; --framer-font-weight: 500; --framer-font-weight-bold: 700; --framer-letter-spacing: -0.02em; --framer-line-height: 120%; --framer-paragraph-spacing: 40px; --framer-text-alignment: start; --framer-text-color: var(--token-cdc179a0-8597-4ca5-848c-d29b9c8ba1b0, #101010); --framer-text-decoration: none; --framer-text-stroke-color: initial; --framer-text-stroke-width: initial; --framer-text-transform: none; } }'];export const className=\"framer-ItVEy\";\nexport const __FramerMetadata__ = {\"exports\":{\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{motion}from\"framer-motion\";export function withProgress(Component){return props=>{const[progress,setProgress]=useState(0);const[isScrolling,setIsScrolling]=useState(false);const[isActive,setIsActive]=useState(true)// Tracks if progress bar is active\n;const prevScrollY=useRef(0);useEffect(()=>{const calculateProgress=()=>{const startEl=document.getElementById(\"start\");const endEl=document.getElementById(\"end\");if(startEl&&endEl){const startTop=startEl.offsetTop;const endTop=endEl.offsetTop;const sectionHeight=endTop-startTop;const scrollY=window.pageYOffset||document.documentElement.scrollTop;const viewportHeight=window.innerHeight;// Check when start section appears\nconst startVisibleOffset=startTop-viewportHeight;const endVisibleOffset=endTop-viewportHeight;let sectionProgress;if(scrollY<startVisibleOffset){// Before start appears, progress is 0%\nsectionProgress=0;}else if(scrollY>=endVisibleOffset){// After end is visible, progress is 100%\nsectionProgress=100;}else{// Normal progress calculation between start and end\nconst distanceScrolled=scrollY-startTop;sectionProgress=distanceScrolled/sectionHeight*100;}// Clamp progress between 0% and 100%\nsetProgress(Math.max(0,Math.min(sectionProgress,100)));}};const checkPageHeight=()=>{const totalHeight=document.documentElement.scrollHeight;const viewportHeight=window.innerHeight;// Deactivate progress bar if page height is less than 300vh\nif(totalHeight/viewportHeight<3){setIsActive(false);}else{setIsActive(true);}};const handleScroll=()=>{const scrollY=window.pageYOffset||document.documentElement.scrollTop;if(scrollY!==prevScrollY.current){prevScrollY.current=scrollY;if(isActive)calculateProgress();setIsScrolling(true);}};const handleScrollEnd=()=>{setIsScrolling(false);};checkPageHeight()// Check page height on load\n;calculateProgress();window.addEventListener(\"scroll\",handleScroll);window.addEventListener(\"scrollend\",handleScrollEnd);window.addEventListener(\"resize\",checkPageHeight)// Recheck on resize\n;return()=>{window.removeEventListener(\"scroll\",handleScroll);window.removeEventListener(\"scrollend\",handleScrollEnd);window.removeEventListener(\"resize\",checkPageHeight);};},[isActive]);// Only render progress bar if it is active\nif(!isActive)return null;return /*#__PURE__*/_jsx(motion.div,{...props,animate:{width:`${progress}%`},transition:{type:\"spring\",stiffness:600,damping:40,mass:1}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withProgress\":{\"type\":\"reactHoc\",\"name\":\"withProgress\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Progressbar.map"],"mappings":"sYAC8B,GAAU,UAAU,CAAC,oBAAoB,kBAAkB,CAAC,CAAc,EAAM,CAAC,CAAC,cAAc,GAAK,MAAM,CAAC,CAAC,OAAO,UAAU,OAAO,YAAY,MAAM,SAAS,IAAI,yKAAyK,OAAO,MAAM,CAAC,CAAC,OAAO,UAAU,OAAO,YAAY,MAAM,SAAS,IAAI,yKAAyK,OAAO,MAA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