"use client"
import{c as m}from"./chunk-6DIYJ56I.mjs";import{Slot as R}from"@radix-ui/react-slot";import{useEffect as w,useState as y}from"react";import{jsxs as E}from"react/jsx-runtime";var V=({ref:u,asChild:c,className:i,children:e,prefix:l,duration:t=250,as:f="span",...n})=>{let[o,p]=y(Number(e));return w(()=>{if(isNaN(Number(e))){console.warn("CountingNumbers expects a numeric value as children.");return}let N=Number(e),r=o,b=N,d=performance.now(),a=()=>{let C=performance.now(),s=Math.min((C-d)/t,1),g=r+(b-r)*s;p(Math.round(g)),s<1&&requestAnimationFrame(a)};requestAnimationFrame(a)},[e,t]),E(c?R:f,{ref:u,className:i,...n,children:[l,m(o,n.fullNumber?{full:!0}:void 0)]})};V.displayName="CountingNumbers";export{V as a};
