{"version":3,"file":"VF_Counter.DPig6L0D.mjs","names":["useState","useRef","__esmMin","init_npm_react_18_3_1","te","window","init_ssg_sandbox_shims","ce","init_jsx_runtime","p","_e","de","motion","init_framer_motion_DhsWWWsN","addPropertyControls","init_framer_BCdLsbZT","ControlType","VFCounter","count","setCount","start","hasAnimated","setHasAnimated","containerRef","rafRef","easeOutCubic","t","startOnViewport","observer","entry","startTime","cancelled","animate","ts","elapsed","duration","eased","value","incrementType","end","formatNumber","decimalSeparatorType","number","formattedCount","formattedEnd","ariaLabel","prefixText","suffixText","gapSize","textColor","font","style","prefixFont","prefixColor","suffixFont","suffixColor","init_VF_Counter"],"sources":["https:/framerusercontent.com/modules/9QOZ4I7UcaEBvtlBQaxT/mx6FeU8Xr1gx87kGWYPP/VF_Counter.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef,startTransition}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Number Counter with ease-out animation, runs once on first viewport entry\n *\n * @framerName VF Counter\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function VFCounter({start=0,end=10,duration=2,gapSize=4,prefixText=\"\",suffixText=\"\",prefixFont,suffixFont,prefixColor,suffixColor,decimalSeparatorType=\"comma\",font,textColor=\"#D3D3D3\",startOnViewport=false,incrementType=\"integer\",style}){const[count,setCount]=useState(start);const[hasAnimated,setHasAnimated]=useState(false);const containerRef=useRef(null);const rafRef=useRef(null);// Ease-out cubic function\nfunction easeOutCubic(t){return 1-Math.pow(1-t,3);}useEffect(()=>{if(!startOnViewport){if(!hasAnimated){setHasAnimated(true);}return;}if(typeof window===\"undefined\")return;const observer=new window.IntersectionObserver(([entry])=>{if(entry.isIntersecting&&!hasAnimated){startTransition(()=>setHasAnimated(true));}});if(containerRef.current)observer.observe(containerRef.current);return()=>observer.disconnect();},[startOnViewport,hasAnimated]);useEffect(()=>{if(!hasAnimated)return;let startTime=null;let cancelled=false;function animate(ts){if(cancelled)return;if(!startTime)startTime=ts;const elapsed=(ts-startTime)/1e3;let t=Math.min(elapsed/duration,1);let eased=easeOutCubic(t);let value;if(incrementType===\"integer\"){value=Math.round(start+(end-start)*eased);}else{value=parseFloat((start+(end-start)*eased).toFixed(1));}setCount(value);if(t<1){rafRef.current=requestAnimationFrame(animate);}else{setCount(end);}}rafRef.current=requestAnimationFrame(animate);return()=>{cancelled=true;if(rafRef.current)cancelAnimationFrame(rafRef.current);};},[hasAnimated,start,end,duration,incrementType]);const formatNumber=number=>{if(decimalSeparatorType===\"comma\")return number.toLocaleString(\"en-US\");if(decimalSeparatorType===\"period\")return number.toLocaleString(\"en-US\").replace(/,/g,\".\");return number.toFixed(incrementType===\"integer\"?0:1);};const formattedCount=formatNumber(count);const formattedEnd=formatNumber(end);const ariaLabel=`${prefixText}${formattedEnd}${suffixText}`;return /*#__PURE__*/_jsxs(motion.div,{ref:containerRef,\"aria-label\":ariaLabel,role:\"img\",style:{display:\"flex\",gap:`${gapSize}px`,alignItems:\"center\",color:textColor,letterSpacing:font?.letterSpacing,fontSize:font?.fontSize,fontWeight:font?.variant?undefined:font?.fontWeight,fontStyle:font?.variant&&font.variant.toLowerCase().includes(\"italic\")?\"italic\":undefined,fontFamily:font?.fontFamily,lineHeight:font?.lineHeight,...style},children:[/*#__PURE__*/_jsx(\"style\",{children:`.framer-counter-visual[data-counter-value]::after{content:attr(data-counter-value);}`}),prefixText&&/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{fontFamily:prefixFont?.fontFamily,fontWeight:prefixFont?.fontWeight,fontSize:prefixFont?.fontSize,letterSpacing:prefixFont?.letterSpacing,lineHeight:prefixFont?.lineHeight,color:prefixColor},children:prefixText}),/*#__PURE__*/_jsxs(\"span\",{\"aria-hidden\":\"true\",style:{position:\"relative\",display:\"inline-block\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",width:\"1px\",height:\"1px\",padding:0,margin:\"-1px\",overflow:\"hidden\",clip:\"rect(0, 0, 0, 0)\",clipPath:\"inset(50%)\",whiteSpace:\"nowrap\",border:0},children:formattedEnd}),/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",className:\"framer-counter-visual\",\"data-counter-value\":formattedCount})]}),suffixText&&/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{fontFamily:suffixFont?.fontFamily,fontWeight:suffixFont?.fontWeight,fontSize:suffixFont?.fontSize,letterSpacing:suffixFont?.letterSpacing,lineHeight:suffixFont?.lineHeight,color:suffixColor},children:suffixText})]});}addPropertyControls(VFCounter,{startOnViewport:{type:ControlType.Boolean,title:\"Viewport\",defaultValue:false},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"36px\",variant:\"Medium\",letterSpacing:\"-0.07em\",lineHeight:\"1em\"}},textColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#D3D3D3\"},start:{type:ControlType.Number,title:\"Start Number\",defaultValue:0},end:{type:ControlType.Number,title:\"End Number\",defaultValue:10},duration:{type:ControlType.Number,title:\"Duration (s)\",defaultValue:2,min:.1,max:20,step:.1},decimalSeparatorType:{type:ControlType.Enum,title:\"Separator\",defaultValue:\"comma\",options:[\"comma\",\"period\",\"none\"]},incrementType:{type:ControlType.Enum,title:\"Increment Type\",defaultValue:\"integer\",options:[\"integer\",\"decimal\"]},prefixText:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},prefixFont:{title:\"Prefix Font\",type:ControlType.Font,controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},prefixColor:{type:ControlType.Color,title:\"Prefix Color\",defaultValue:\"#D3D3D3\"},suffixText:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\"},suffixFont:{title:\"Suffix Font\",type:ControlType.Font,controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},suffixColor:{type:ControlType.Color,title:\"Suffix Color\",defaultValue:\"#D3D3D3\"},gapSize:{type:ControlType.Number,title:\"Gap Size\",defaultValue:4,min:0,max:100}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VFCounter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerName\":\"VF Counter\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VF_Counter.map"],"mappings":"A,gQAMG,SAAwBiB,EAAU,CAAC,QAAM,EAAE,MAAI,GAAG,WAAS,EAAE,UAAQ,EAAE,aAAW,GAAG,aAAW,GAAG,aAAW,aAAW,cAAY,cAAY,uBAAqB,QAAQ,OAAK,YAAU,UAAU,kBAAgB,GAAM,gBAAc,UAAU,SAAO,CAAC,GAAK,CAACC,EAAMC,GAAUnB,EAASoB,CAAK,EAAO,CAACC,EAAYC,GAAgBtB,EAAS,EAAK,EAAQuB,EAAatB,EAAO,IAAI,EAAQuB,EAAOvB,EAAO,IAAI,EAChZ,SAASwB,EAAa,EAAE,CAAC,MAAO,IAAW,EAAEC,IAAE,CAAG,CAACnB,MAAc,CAAC,GAAG,CAACoB,EAAgB,CAAKN,GAAaC,EAAe,EAAI,EAAG,MAAO,CAAC,GAAUjB,IAAS,OAAY,OAAO,IAAMuB,EAAS,IAAIvB,EAAO,sBAAsB,CAACwB,KAAS,CAAIA,EAAM,gBAAgB,CAACR,GAAajB,MAAoBkB,EAAe,EAAI,CAAC,CAAG,CAAC,EAAiE,OAA5DC,EAAa,SAAQK,EAAS,QAAQL,EAAa,OAAO,MAAYK,EAAS,WAAW,CAAE,EAAE,CAACD,EAAgBN,CAAW,CAAC,EAA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