{"version":3,"file":"AnimatedCounter.7-ZfOG9G.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/gLu8BZYl1STqDgvz1Cl5/1nzVZ5GJkwn2sK03PMEF/AnimatedCounter.js"],"sourcesContent":["// Animated Counter component with label, animated ticker, and subline\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useInView,useMotionValue,useSpring}from\"framer-motion\";/**\n * Animated Counter\n * \n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function AnimatedCounter(props){const{label,targetValue,prefix,suffix,subline,labelFont,numberFont,sublineFont,labelColor,numberColor,sublineColor,duration,delay}=props;const ref=useRef(null);const isInView=useInView(ref,{once:true});const isStatic=useIsStaticRenderer();const motionValue=useMotionValue(0);const springValue=useSpring(motionValue,{duration:duration*1e3,bounce:0});const[displayValue,setDisplayValue]=useState(0);useEffect(()=>{if(isStatic){startTransition(()=>setDisplayValue(targetValue));return;}if(isInView){const timeout=setTimeout(()=>{motionValue.set(targetValue);},delay*1e3);return()=>clearTimeout(timeout);}},[isInView,targetValue,motionValue,delay,isStatic]);useEffect(()=>{if(isStatic)return;const unsubscribe=springValue.on(\"change\",latest=>{startTransition(()=>setDisplayValue(Math.floor(latest)));});return()=>unsubscribe();},[springValue,isStatic]);const formatNumber=num=>{return num.toLocaleString();};return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:12,position:\"relative\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{...labelFont,color:labelColor,textAlign:\"center\",width:\"max-content\"},children:label}),/*#__PURE__*/_jsxs(motion.div,{style:{...numberFont,color:numberColor,textAlign:\"center\",width:\"max-content\"},children:[prefix,formatNumber(displayValue),suffix]}),/*#__PURE__*/_jsx(\"div\",{style:{...sublineFont,color:sublineColor,textAlign:\"center\",width:\"max-content\"},children:subline})]});}addPropertyControls(AnimatedCounter,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Average client revenue generated\"},targetValue:{type:ControlType.Number,title:\"Target Value\",defaultValue:168e3,min:0,step:1e3},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"$\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"k\"},subline:{type:ControlType.String,title:\"Subline\",defaultValue:\"in their first 90 days\"},labelFont:{type:ControlType.Font,title:\"Label Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},numberFont:{type:ControlType.Font,title:\"Number Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}},sublineFont:{type:ControlType.Font,title:\"Subline Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},labelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"#CCCCCC\"},numberColor:{type:ControlType.Color,title:\"Number Color\",defaultValue:\"#000000\"},sublineColor:{type:ControlType.Color,title:\"Subline Color\",defaultValue:\"#CCCCCC\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:2,min:.5,max:5,step:.1,unit:\"s\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:3,step:.1,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedCounter\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\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