{"version":3,"file":"CountUp.__9rMm3u.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/sUazLXZjtdSSVK25y2pa/MRG8MhOGPnbletbOgT3y/CountUp.js"],"sourcesContent":["import{jsx as _jsx}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,fontWeight}=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__*/_jsx(\"span\",{style:{...textStyle,fontFamily:font,color:color,fontSize:`${fontSize}px`,lineHeight:`${lineHeight}px`,fontWeight:fontWeight,opacity:isVisible?1:0,transition:\"opacity 0.5s ease-in-out\"},children:count.toLocaleString()})});}// Styles are written in object syntax\nconst containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};const textStyle={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:\"Montaga, serif\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},fontSize:{type:ControlType.Number,title:\"Font Size (px)\",defaultValue:54,unit:\"px\"},lineHeight:{type:ControlType.Number,title:\"Line Height (px)\",defaultValue:54,unit:\"px\"},fontWeight:{type:ControlType.Enum,title:\"Font Weight\",options:[\"100\",\"200\",\"300\",\"400\",\"500\",\"600\",\"700\",\"800\",\"900\"],optionTitles:[\"Thin\",\"Extra Light\",\"Light\",\"Regular\",\"Medium\",\"Semi Bold\",\"Bold\",\"Extra Bold\",\"Black\"],defaultValue:\"400\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountUp\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountUp.map"],"mappings":"wLAMG,SAAwB,EAAQ,EAAM,CAAC,GAAK,CAAC,eAAa,WAAS,OAAK,QAAM,WAAS,aAAW,cAAY,EAAW,CAAC,EAAM,GAAUA,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,IAAI,EAAM,EAAQ,EAAU,GAAc,EAAS,IAAU,MAAkB,CAAC,GAAO,EAAa,EAAM,GAAc,EAAS,KAAK,KAAK,EAAM,CAAC,CAAC,sBAAsB,EAAc,EAAO,EAAS,EAAa,EAAI,GAAe,GAAI,CAAC,UAAU,GAAG,CAAC,CAAgD,OAA5C,EAAI,SAAS,EAAS,QAAQ,EAAI,QAAQ,KAAY,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