{"version":3,"file":"Counter.C6mMUENH.mjs","names":["React.forwardRef","useRef","__esmMin","init_npm_react_18_3_1","te","p","c","J","init_jsx_runtime","ce","de","motion","useInView","useSpring","useMotionValue","init_framer_motion_DhsWWWsN","cx","init_framer_DKtAEkcX","useSVGTemplate","ControlType","useIsStaticRenderer","withCSS","addPropertyControls","mask","Base","MotionSVG","SVG","svg","getProps","Icon","init_dZkd7bSHY","props","rest","animated","color","width1","alpha","restProps","href","className","qxTvv_EBh","ezTt3ayMo","lschgej4H","style","Counter","numberRef","motionValue","direction","to","from","isStatic","damping","duration","stiffness","springValue","isInView","getDecimalPlaces","str","num","decimals","maxDecimals","formattedValue","formatNumber","timeoutId","delay","hasDecimals","options","value","unsubscribe","latest","isFixedWidth","font","prefix","useSeparateColors","prefixColor","suffix","suffixColor","init_Counter"],"sources":["https:/framerusercontent.com/modules/lGjONevu0Qs1ZIO2v8WJ/9dhBJaKhHHBOoaR9HIyB/dZkd7bSHY.js","https:/framerusercontent.com/modules/vPX5aHEYmYVkHyIVREAU/e9M0C0K34Q3kKU46KWxj/Counter.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 9.749 15.477 L 14.879 18.632 C 15.151 18.797 15.496 18.782 15.753 18.594 C 16.01 18.406 16.128 18.082 16.053 17.772 L 14.658 11.886 L 19.223 7.948 C 19.461 7.739 19.552 7.409 19.455 7.108 C 19.357 6.806 19.09 6.592 18.774 6.563 L 12.783 6.075 L 10.475 0.488 C 10.354 0.193 10.068 0 9.749 0 C 9.431 0 9.144 0.193 9.023 0.488 L 6.715 6.075 L 0.724 6.563 C 0.406 6.59 0.136 6.806 0.038 7.109 C -0.06 7.412 0.034 7.745 0.275 7.953 L 4.84 11.89 L 3.445 17.772 C 3.37 18.082 3.488 18.406 3.745 18.594 C 4.002 18.782 4.347 18.797 4.619 18.632 Z\" fill-opacity=\"var(--1m6trwb, 0)\" fill=\"var(--21h8s6, rgb(0, 0, 0))\" height=\"18.746261605760054px\" id=\"t6hF1mhP1\" transform=\"translate(2.251 2.25)\" width=\"19.49332240036336px\"/><path d=\"M 9.749 15.477 L 14.879 18.632 C 15.151 18.797 15.496 18.782 15.753 18.594 C 16.01 18.406 16.128 18.082 16.053 17.772 L 14.658 11.886 L 19.223 7.948 C 19.461 7.739 19.552 7.409 19.455 7.108 C 19.357 6.806 19.09 6.592 18.774 6.563 L 12.783 6.075 L 10.475 0.488 C 10.354 0.193 10.068 0 9.749 0 C 9.431 0 9.144 0.193 9.023 0.488 L 6.715 6.075 L 0.724 6.563 C 0.406 6.59 0.136 6.806 0.038 7.109 C -0.06 7.412 0.034 7.745 0.275 7.953 L 4.84 11.89 L 3.445 17.772 C 3.37 18.082 3.488 18.406 3.745 18.594 C 4.002 18.782 4.347 18.797 4.619 18.632 Z\" fill=\"transparent\" height=\"18.746261605760054px\" id=\"b0GcHZb5O\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(2.251 2.25)\" width=\"19.49332240036336px\"/></svg>';const getProps=({alpha,color,height,id,width,width1,...props})=>{return{...props,ezTt3ayMo:color??props.ezTt3ayMo??\"rgb(0, 0, 0)\",lschgej4H:width1??props.lschgej4H??1.5,qxTvv_EBh:alpha??props.qxTvv_EBh};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,ezTt3ayMo,lschgej4H,qxTvv_EBh,...restProps}=getProps(props);const href=useSVGTemplate(\"2930526878\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-YnhV6\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m6trwb\":qxTvv_EBh,\"--21h8s6\":ezTt3ayMo,\"--pgex8v\":lschgej4H,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-YnhV6 { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"ezTt3ayMo\":\"color\",\"lschgej4H\":\"width1\",\"qxTvv_EBh\":\"alpha\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Star\",\"color\":{\"type\":\"variable\",\"value\":\"21h8s6\"},\"set\":{\"localId\":\"vectorSet/NGVKdicsm\",\"id\":\"NGVKdicsm\",\"moduleId\":\"omX0gWFPqDwhaiWwf6ab\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-YnhV6\");Icon.displayName=\"Star\";export default Icon;addPropertyControls(Icon,{ezTt3ayMo:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},lschgej4H:{defaultValue:1.5,displayStepper:true,hidden:false,max:6,min:0,step:.5,title:\"Width\",type:ControlType.Number},qxTvv_EBh:{defaultValue:0,displayStepper:true,hidden:false,max:1,min:0,step:.1,title:\"Alpha\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\",\"framerVector\":\"{\\\"name\\\":\\\"Star\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"21h8s6\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/NGVKdicsm\\\",\\\"id\\\":\\\"NGVKdicsm\\\",\\\"moduleId\\\":\\\"omX0gWFPqDwhaiWwf6ab\\\"}}\",\"framerIntrinsicWidth\":\"24\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"true\",\"framerImmutableVariables\":\"true\",\"framerVariables\":\"{\\\"ezTt3ayMo\\\":\\\"color\\\",\\\"lschgej4H\\\":\\\"width1\\\",\\\"qxTvv_EBh\\\":\\\"alpha\\\"}\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Number Counter Component with animated counting effect\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,startTransition}from\"react\";import{useInView,useMotionValue,useSpring}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Counter(props){const{from=0,to=100,direction=\"up\",delay=0,duration=2,prefix=\"\",suffix=\"\",font,color,useSeparateColors=false,prefixColor,suffixColor}=props;const numberRef=useRef(null);const motionValue=useMotionValue(direction===\"down\"?to:from);const isStatic=useIsStaticRenderer();const damping=60+20*(1/duration);const stiffness=400*(1/duration);const springValue=useSpring(motionValue,{damping,stiffness,restDelta:.001,restSpeed:.01});const isInView=useInView(numberRef,{once:true,margin:\"0px\"});const getDecimalPlaces=num=>{const str=num.toString();if(str.includes(\".\")){const decimals=str.split(\".\")[1];if(parseInt(decimals)!==0){return decimals.length;}}return 0;};const maxDecimals=Math.max(getDecimalPlaces(from),getDecimalPlaces(to));useEffect(()=>{if(numberRef.current){const initialValue=direction===\"down\"?to:from;const formattedValue=formatNumber(initialValue);numberRef.current.textContent=formattedValue;}},[from,to,direction,maxDecimals]);useEffect(()=>{if(isStatic)return;if(isInView){const timeoutId=setTimeout(()=>{startTransition(()=>{motionValue.set(direction===\"down\"?from:to);});},delay*1e3);return()=>{clearTimeout(timeoutId);};}},[isInView,motionValue,direction,from,to,delay,isStatic]);const formatNumber=value=>{const hasDecimals=maxDecimals>0;const options={useGrouping:false,minimumFractionDigits:hasDecimals?maxDecimals:0,maximumFractionDigits:hasDecimals?maxDecimals:0};const formattedNumber=Intl.NumberFormat(\"en-US\",options).format(value);return formattedNumber;};useEffect(()=>{if(isStatic)return;const unsubscribe=springValue.on(\"change\",latest=>{if(numberRef.current){const formattedValue=formatNumber(latest);numberRef.current.textContent=formattedValue;}});return()=>unsubscribe();},[springValue,maxDecimals,isStatic]);const isFixedWidth=props?.style&&props.style.width===\"100%\";return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,...isFixedWidth?{}:{minWidth:\"max-content\"},display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:\"8px\"},children:/*#__PURE__*/_jsxs(\"span\",{style:{...font},children:[prefix&&/*#__PURE__*/_jsx(\"span\",{style:{color:useSeparateColors?prefixColor:color},children:prefix}),/*#__PURE__*/_jsx(\"span\",{ref:numberRef,style:{color}}),suffix&&/*#__PURE__*/_jsx(\"span\",{style:{color:useSeparateColors?suffixColor:color},children:suffix})]})});}addPropertyControls(Counter,{direction:{type:ControlType.Enum,title:\"Direction\",options:[\"up\",\"down\"],optionTitles:[\"Count Up\",\"Count Down\"],defaultValue:\"up\"},from:{type:ControlType.Number,title:\"From\",defaultValue:0,step:.1},to:{type:ControlType.Number,title:\"To\",defaultValue:100,step:.1},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:5,step:.1,unit:\"s\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:2,min:.1,max:10,step:.1,unit:\"s\"},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\",placeholder:\"e.g. $\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\",placeholder:\"e.g. %\"},color:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},useSeparateColors:{type:ControlType.Boolean,title:\"Separate Colors\",defaultValue:false,enabledTitle:\"Custom\",disabledTitle:\"Same\"},prefixColor:{type:ControlType.Color,title:\"Prefix Color\",defaultValue:\"#000000\",hidden:({useSeparateColors})=>!useSeparateColors},suffixColor:{type:ControlType.Color,title:\"Suffix Color\",defaultValue:\"#000000\",hidden:({useSeparateColors})=>!useSeparateColors},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"32px\",variant:\"Bold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Counter\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Counter.map"],"mappings":"A,uWACgM,EAAK,0BAAgC,EAAkB,gBAAW,SAAS,EAAM,EAAI,CAAC,MAAoB,gBAAK,MAAM,CAAC,GAAG+B,EAAU,MAAI,SAASA,EAAM,QAAQ,CAAC,CAAE,CAAC,EAAQ,EAAUpB,EAAO,OAAOa,CAAI,EAAQ,EAAiB,iBAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAGQ,GAAMD,EAAM,OAAOE,EAAsB,gBAAKR,EAAU,CAAC,GAAGO,EAAc,WAAa,MAAa,UAAQ,CAAC,EAAe,gBAAK,MAAM,CAAC,GAAGA,EAAS,MAAa,UAAQ,CAAC,CAAE,CAAC,EAAQ,EAAI,8mDAAonD,GAAU,CAAC,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