{"version":3,"file":"CounterAnimation.Cp2ump5K.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/NDH8IBIpqJQp2Vggx8eD/l6brIxNNfpK1ToGDr5mP/AwMEOGfYK.js","https:/framerusercontent.com/modules/8d6BVFToKh7HA6cqlQM0/bG8PD12B6WByxdzhEllo/CounterAnimation.js"],"sourcesContent":["// Generated by Framer (85eaff3)\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 4.34 4.34 L 0 0\" fill=\"transparent\" height=\"4.34px\" id=\"z8RZjJ9Kn\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(16.66 16.66)\" width=\"4.34px\"/><path d=\"M 0 8 C 0 3.582 3.582 0 8 0 C 12.418 0 16 3.582 16 8 C 16 12.418 12.418 16 8 16 C 3.582 16 0 12.418 0 8 Z\" fill=\"transparent\" height=\"16px\" id=\"FZH9LEsdu\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(3 3)\" width=\"16px\"/></svg>';const getProps=({color,height,id,width,width1,...props})=>{return{...props,JEeZYcamG:width1??props.JEeZYcamG??2,P_DcoRcrY:color??props.P_DcoRcrY??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,P_DcoRcrY,JEeZYcamG,...restProps}=getProps(props);const href=useSVGTemplate(\"1952988144\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-4is15\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m973uw\":P_DcoRcrY,\"--js9iwy\":JEeZYcamG,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-4is15 { -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 {\"P_DcoRcrY\":\"color\",\"JEeZYcamG\":\"width1\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Search\",\"color\":{\"type\":\"variable\",\"value\":\"1m973uw\"},\"set\":{\"localId\":\"vectorSet/ZsiCCGPvG\",\"id\":\"ZsiCCGPvG\",\"moduleId\":\"Y7SpbVH16cWqMhj75z1M\"}}\n */const Icon=withCSS(Component,css,\"framer-4is15\");Icon.displayName=\"Search\";export default Icon;addPropertyControls(Icon,{P_DcoRcrY:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},JEeZYcamG:{defaultValue:2,displayStepper:true,hidden:false,max:16,min:1,title:\"Width\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerVector\":\"{\\\"name\\\":\\\"Search\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"1m973uw\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/ZsiCCGPvG\\\",\\\"id\\\":\\\"ZsiCCGPvG\\\",\\\"moduleId\\\":\\\"Y7SpbVH16cWqMhj75z1M\\\"}}\",\"framerIntrinsicWidth\":\"24\",\"framerIntrinsicHeight\":\"24\",\"framerVariables\":\"{\\\"P_DcoRcrY\\\":\\\"color\\\",\\\"JEeZYcamG\\\":\\\"width1\\\"}\",\"framerImmutableVariables\":\"true\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Simple counter animation component with text-based display and customizable font and color settings\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType,useInView}from\"framer\";import{useRef}from\"react\";/**\n * CounterAnimation Animation\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 80\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CounterAnimation(props){const{targetNumber=\"100\",duration=2,prefix=\"\",suffix=\"\",textColor=\"#000000\",font,style}=props;// Parse string number (accepts both , and . as decimal separator)\nfunction parseNumericValue(str){let s=str.trim();// Remove any non-numeric except .,,-\ns=s.replace(/[\\d.,-]/g,m=>m)// keep numeric chars, dot, comma, minus\n;// If string contains both . and ,, assume European (de-DE) style\nif(s.includes(\".\")&&s.includes(\",\")){s=s.replace(/\\.(?=\\d{3})/g,\"\")// Remove dot thousand sep (only if followed by 3 digits)\n;s=s.replace(/,/g,\".\")// Replace decimal comma to dot\n;}else if(s.includes(\",\")){// Only comma present; treat rightmost comma as decimal\nconst idx=s.lastIndexOf(\",\");if(idx!==-1){s=s.replace(/\\./g,\"\");// Remove all dots (thousand sep)\ns=s.substring(0,idx).replace(/,/g,\"\")+\".\"+s.substring(idx+1).replace(/,/g,\"\");}}else{// Fallback: remove thousands separator, keep decimal dot\ns=s.replace(/\\B(?=(\\d{3})+(?!\\d))/g,\"\");}return parseFloat(s);}const[count,setCount]=useState(0);const ref=useRef(null);const isInView=useInView(ref,{once:true});// Length of decimals for formatting\nconst decimalDigits=(()=>{const trimmed=targetNumber.trim();if(trimmed.includes(\",\")&&trimmed.match(/,[0-9]+$/)){return trimmed.match(/,[0-9]+$/)[0].length-1;}else if(trimmed.includes(\".\")&&trimmed.match(/\\.[0-9]+$/)){return trimmed.match(/\\.[0-9]+$/)[0].length-1;}return 0;})();useEffect(()=>{if(!isInView)return;let startTime=null;let animationFrame;const finalNumber=parseNumericValue(targetNumber);const animate=currentTime=>{if(!startTime)startTime=currentTime;const elapsed=currentTime-startTime;const progress=Math.min(elapsed/(duration*1e3),1);const easeOutQuart=1-Math.pow(1-progress,4);const currentCount=easeOutQuart*finalNumber;startTransition(()=>{setCount(currentCount);});if(progress<1){animationFrame=requestAnimationFrame(animate);}else{startTransition(()=>{setCount(finalNumber);});}};animationFrame=requestAnimationFrame(animate);return()=>{if(animationFrame){cancelAnimationFrame(animationFrame);}};},[targetNumber,duration,isInView]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{...style,position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"max-content\"},children:/*#__PURE__*/_jsxs(\"span\",{style:{color:textColor,...font,whiteSpace:\"nowrap\"},children:[prefix,(()=>{// European style if input contains comma as decimal\nif(targetNumber.trim().includes(\",\")){return count.toLocaleString(\"de-DE\",{minimumFractionDigits:decimalDigits,maximumFractionDigits:decimalDigits});}return count.toLocaleString(undefined,{minimumFractionDigits:decimalDigits,maximumFractionDigits:decimalDigits});})(),suffix]})});}addPropertyControls(CounterAnimation,{targetNumber:{type:ControlType.String,title:\"Target Number\",defaultValue:\"100\",placeholder:\"1000 or 1.234,56\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:2,min:.5,max:10,step:.1,unit:\"s\"},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\",placeholder:\"$\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\",placeholder:\"+\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CounterAnimation\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"200\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"80\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CounterAnimation.map"],"mappings":"iTAC2C,IAAqF,IAA4B,CAAoC,EAAK,0BAAgC,EAAkB,EAAW,SAAS,EAAM,EAAI,CAAC,OAAoB,EAAK,MAAM,CAAC,GAAG,EAAU,MAAI,SAAS,EAAM,SAAS,CAAC,EAAG,CAAO,EAAU,EAAO,OAAO,EAAK,CAAO,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAc,WAAa,MAAa,WAAS,CAAC,CAAc,EAAK,MAAM,CAAC,GAAG,EAAS,MAAa,WAAS,CAAC,EAAG,CAAO,EAAI,qsBAA2sB,GAAU,CAAC,QAAM,SAAO,KAAG,QAAM,SAAO,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAQ,EAAM,WAAW,EAAE,UAAU,GAAO,EAAM,WAAW,eAAe,EASl/C,EAAK,EAT6gD,EAAiB,SAAS,EAAM,EAAI,CAAC,GAAK,CAAC,QAAM,YAAU,WAAS,UAAQ,YAAU,YAAU,GAAG,GAAW,EAAS,EAAM,CAA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