{"version":3,"file":"CountUp.3F7STC7g.mjs","names":["CountUp","useState","useRef","containerStyle","textStyle","useState","useRef"],"sources":["https:/framerusercontent.com/modules/hEvX0S0Q0JpjYZpRDZk3/uKr4x1gMWk8PXAL8UZ7h/CountUp_1.js","https:/framerusercontent.com/modules/AuZFvgNw1RhWkzPn2WwQ/CSY4c5LDfmWYRow7XzaO/CountUp.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CountUp(props){const{targetNumber,duration,font,color,fontSize,lineHeight}=props;const[count,setCount]=useState(0);const[isVisible,setIsVisible]=useState(false);const[hasAnimated,setHasAnimated]=useState(false);const ref=useRef(null);useEffect(()=>{const observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting&&!hasAnimated){setIsVisible(true);setHasAnimated(true);let start=0;const increment=targetNumber/(duration*60);const updateCounter=()=>{start+=increment;if(start<targetNumber){setCount(Math.ceil(start));requestAnimationFrame(updateCounter);}else{setCount(targetNumber);}};updateCounter();}},{threshold:.1});if(ref.current){observer.observe(ref.current);}return()=>{if(ref.current){observer.unobserve(ref.current);}};},[targetNumber,duration,hasAnimated]);return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,ref:ref,children:/*#__PURE__*/_jsxs(\"span\",{style:{...textStyle,fontFamily:font,color:color,fontSize:`${fontSize}px`,lineHeight:`${lineHeight}px`,opacity:isVisible?1:0,transition:\"opacity 0.5s ease-in-out\"},children:[count,\"+\"]})});}// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};const textStyle={fontWeight:\"400\",letterSpacing:\"0em\",textAlign:\"center\",margin:\"0\"};// Adding property controls for Framer\naddPropertyControls(CountUp,{targetNumber:{type:ControlType.Number,title:\"Target Number\",defaultValue:100},duration:{type:ControlType.Number,title:\"Duration (s)\",defaultValue:2,step:.1},font:{type:ControlType.String,title:\"Font Family\",defaultValue:\"inter\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#ffffff\"},fontSize:{type:ControlType.Number,title:\"Font Size (px)\",defaultValue:54,unit:\"px\"},lineHeight:{type:ControlType.Number,title:\"Line Height (px)\",defaultValue:54,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountUp\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountUp_1.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CountUp(props){const{targetNumber,duration,font,color,fontSize,lineHeight}=props;const[count,setCount]=useState(0);const[isVisible,setIsVisible]=useState(false);const[hasAnimated,setHasAnimated]=useState(false);const ref=useRef(null);useEffect(()=>{const observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting&&!hasAnimated){setIsVisible(true);setHasAnimated(true);let start=0;const increment=targetNumber/(duration*60);const updateCounter=()=>{start+=increment;if(start<targetNumber){setCount(Math.ceil(start));requestAnimationFrame(updateCounter);}else{setCount(targetNumber);}};updateCounter();}},{threshold:.1});if(ref.current){observer.observe(ref.current);}return()=>{if(ref.current){observer.unobserve(ref.current);}};},[targetNumber,duration,hasAnimated]);return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,ref:ref,children:/*#__PURE__*/_jsxs(\"span\",{style:{...textStyle,fontFamily:font,color:color,fontSize:`${fontSize}px`,lineHeight:`${lineHeight}px`,opacity:isVisible?1:0,transition:\"opacity 0.5s ease-in-out\"},children:[count,\"+\"]})});}// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};const textStyle={fontWeight:\"400\",letterSpacing:\"0em\",textAlign:\"center\",margin:\"0\"};// Adding property controls for Framer\naddPropertyControls(CountUp,{targetNumber:{type:ControlType.Number,title:\"Target Number\",defaultValue:100},duration:{type:ControlType.Number,title:\"Duration (s)\",defaultValue:2,step:.1},font:{type:ControlType.String,title:\"Font Family\",defaultValue:\"inter\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#ffffff\"},fontSize:{type:ControlType.Number,title:\"Font Size (px)\",defaultValue:54,unit:\"px\"},lineHeight:{type:ControlType.Number,title:\"Line Height (px)\",defaultValue:54,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountUp\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountUp.map"],"mappings":"+LAMG,SAAwBA,EAAQ,EAAM,CAAC,GAAK,CAAC,eAAa,WAAS,OAAK,QAAM,WAAS,cAAY,EAAW,CAAC,EAAM,GAAUC,EAAS,EAAE,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAO,EAAIC,EAAO,KAAK,CAAkiB,OAAjiB,MAAc,CAAC,IAAM,EAAS,IAAI,sBAAsB,CAAC,KAAS,CAAC,GAAG,EAAM,gBAAgB,CAAC,EAAY,CAAC,EAAa,GAAK,CAAC,EAAe,GAAK,CAAC,IA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