{"version":3,"file":"CounterAnimation.BOFXnuXc.mjs","names":["React.forwardRef","useState","useRef"],"sources":["https:/framerusercontent.com/modules/NDH8IBIpqJQp2Vggx8eD/l6brIxNNfpK1ToGDr5mP/AwMEOGfYK.js","https:/framerusercontent.com/modules/8d6BVFToKh7HA6cqlQM0/7tRVAl1SecQr5FZW8Fu3/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\"}});CounterAnimation.displayName=\"Code/Workshop/Counter Animation\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CounterAnimation\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"80\",\"framerIntrinsicWidth\":\"200\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CounterAnimation.map"],"mappings":"8SAC0C,IAAqF,IAA4B,EAAqC,EAAK,0BAAgC,EAAkB,EAAW,SAAS,EAAM,EAAI,CAAC,OAAoB,EAAK,MAAM,CAAC,GAAG,EAAU,MAAI,SAAS,EAAM,QAAQ,CAAC,CAAE,CAAC,EAAQ,EAAU,EAAO,OAAO,CAAI,EAAQ,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAc,WAAa,MAAa,UAAQ,CAAC,EAAe,EAAK,MAAM,CAAC,GAAG,EAAS,MAAa,UAAQ,CAAC,CAAE,CAAC,EAAQ,EAAI,qsBAA2sB,GAAU,CAAC,QAAM,SAAO,KAAG,QAAM,SAAO,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAQ,EAAM,WAAW,EAAE,UAAU,GAAO,EAAM,WAAW,cAAc,GASj/C,EAAK,EAT6gDA,EAAiB,SAAS,EAAM,EAAI,CAAC,GAAK,C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