{"version":3,"file":"Count_to.Cyly8HPl.mjs","names":["useRef","useState","start","end","props"],"sources":["https:/framerusercontent.com/modules/swCP7XSmnDacDDhDYMKj/mWHXN5k0HlCLzzSQNM4I/Count_to.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useRef,useEffect}from\"react\";import{animate,useInView}from\"framer-motion\";const StartingNumber=0;const Repeat=true;const duration=6;const easing=[.25,.1,.25,1];export function withAnimatedNumber(Component){return props=>{const ref=useRef(null);const isInView=useInView(ref,{once:!Repeat});const[number,setNumber]=useState(\"\");const extractTextContent=props=>{var _props_children_props_children_props_children_props,_props_children_props_children_props_children,_props_children_props_children_props,_props_children_props_children,_props_children_props,_props_children;const content=((_props_children=props.children)===null||_props_children===void 0?void 0:(_props_children_props=_props_children.props)===null||_props_children_props===void 0?void 0:(_props_children_props_children=_props_children_props.children)===null||_props_children_props_children===void 0?void 0:(_props_children_props_children_props=_props_children_props_children.props)===null||_props_children_props_children_props===void 0?void 0:(_props_children_props_children_props_children=_props_children_props_children_props.children)===null||_props_children_props_children_props_children===void 0?void 0:(_props_children_props_children_props_children_props=_props_children_props_children_props_children.props)===null||_props_children_props_children_props_children_props===void 0?void 0:_props_children_props_children_props_children_props.children)||\"\";const[start,end]=content.split(\",\").map(num=>parseInt(num.trim()));return{start:isNaN(start)?0:start,end:isNaN(end)?isNaN(start)?0:start:end};};const{start,end}=extractTextContent(props);const digitCount=end.toString().length;const formatNumber=num=>{return num.toString().padStart(digitCount,\"0\");};console.log(\"Extracted start:\",formatNumber(start),\"end:\",formatNumber(end));useEffect(()=>{console.log(\"Effect running. Start:\",formatNumber(start),\"End:\",formatNumber(end));console.log(\"Is in view (inside effect):\",isInView);if(isInView){animate(start,end,{duration:2.5,ease:[.25,.1,.25,1],onUpdate:val=>{const valueToInteger=Math.round(val);const formattedValue=formatNumber(valueToInteger);console.log(\"Animated value:\",formattedValue);setNumber(formattedValue);}});}},[isInView,start,end,digitCount]);console.log(\"Rendering with number:\",number);return /*#__PURE__*/_jsx(Component,{...props,text:number,ref:ref});};}export function withDecimal(Component){return props=>{const ref=useRef(null);const isInView=useInView(ref,{once:!Repeat});const[number,setNumber]=useState(\"0.0\");const extractTextContent=props=>{var _props_children_props_children_props_children_props,_props_children_props_children_props_children,_props_children_props_children_props,_props_children_props_children,_props_children_props,_props_children;const content=((_props_children=props.children)===null||_props_children===void 0?void 0:(_props_children_props=_props_children.props)===null||_props_children_props===void 0?void 0:(_props_children_props_children=_props_children_props.children)===null||_props_children_props_children===void 0?void 0:(_props_children_props_children_props=_props_children_props_children.props)===null||_props_children_props_children_props===void 0?void 0:(_props_children_props_children_props_children=_props_children_props_children_props.children)===null||_props_children_props_children_props_children===void 0?void 0:(_props_children_props_children_props_children_props=_props_children_props_children_props_children.props)===null||_props_children_props_children_props_children_props===void 0?void 0:_props_children_props_children_props_children_props.children)||\"0\";return parseFloat(content)||0;};const end=extractTextContent(props);const decimalPlaces=(end.toString().split(\".\")[1]||\"\").length;const formatNumber=num=>{return num.toFixed(decimalPlaces);};console.log(\"Extracted end:\",end);useEffect(()=>{console.log(\"Effect running. End:\",end);console.log(\"Is in view (inside effect):\",isInView);if(isInView){animate(0,end,{duration:2.5,ease:easing,onUpdate:val=>{const formattedValue=formatNumber(val);console.log(\"Animated value:\",formattedValue);setNumber(formattedValue);}});}},[isInView,end,decimalPlaces]);console.log(\"Rendering with number:\",number);return /*#__PURE__*/_jsx(Component,{...props,text:number,ref:ref});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withAnimatedNumber\":{\"type\":\"reactHoc\",\"name\":\"withAnimatedNumber\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDecimal\":{\"type\":\"reactHoc\",\"name\":\"withDecimal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Count_to.map"],"mappings":"2QAA2N,SAAgB,EAAmB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,E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