{"version":3,"file":"Counter.cMHqYCVw.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/t4JTNrVJM95V6oPig8u2/JgBuVTQ3YLYv6bAENcpI/Counter.js"],"sourcesContent":["import{jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useEffect,useRef,useState}from\"react\";import{useInView}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Counter(props){const{prefix=\"\",value=100,suffix=\"\",decimals=0,duration=1.6,color=\"#1B3A2D\",fontSize=42}=props;const ref=useRef(null);const isStatic=useIsStaticRenderer();const inView=useInView(ref,{once:true,margin:\"-8% 0px\"});const[display,setDisplay]=useState(0);const[mounted,setMounted]=useState(false);useEffect(()=>{setMounted(true);},[]);useEffect(()=>{if(isStatic){setDisplay(value);return;}if(!inView)return;let raf=0;let startTime=0;const step=t=>{if(!startTime)startTime=t;const p=Math.min(1,(t-startTime)/(duration*1e3));const eased=1-Math.pow(1-p,3);setDisplay(value*eased);if(p<1)raf=requestAnimationFrame(step);else setDisplay(value);};raf=requestAnimationFrame(step);return()=>cancelAnimationFrame(raf);},[inView,isStatic,value,duration]);// Render the final value on the server and on the first client paint so the\n// published HTML carries the real number instead of 0. The count-up starts\n// once the component has mounted and scrolled into view.\nconst shown=isStatic||!mounted?value:display;const formatted=shown.toLocaleString(\"en-US\",{minimumFractionDigits:decimals,maximumFractionDigits:decimals});return /*#__PURE__*/_jsxs(\"span\",{ref:ref,style:{fontFamily:\"'Playfair Display', serif\",fontWeight:500,fontSize,lineHeight:1,letterSpacing:\"-0.01em\",color,whiteSpace:\"nowrap\",minWidth:\"max-content\",...props.style},children:[prefix,formatted,suffix]});}addPropertyControls(Counter,{prefix:{type:ControlType.String,defaultValue:\"\"},value:{type:ControlType.Number,defaultValue:100,min:0,max:1e7,step:1},suffix:{type:ControlType.String,defaultValue:\"\"},decimals:{type:ControlType.Number,defaultValue:0,min:0,max:2,step:1},duration:{type:ControlType.Number,defaultValue:1.6,min:.3,max:4,step:.1},color:{type:ControlType.Color,defaultValue:\"#1B3A2D\"},fontSize:{type:ControlType.Number,defaultValue:42,min:12,max:120,step:1}});\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":"iPAGG,SAAwB,EAAQ,EAAM,CAAC,GAAK,CAAC,SAAO,GAAG,QAAM,IAAI,SAAO,GAAG,WAAS,EAAE,WAAS,IAAI,QAAM,UAAU,WAAS,IAAI,EAAY,EAAIA,EAAO,IAAI,EAAQ,EAAS,EAAoB,EAAQ,EAAO,EAAU,EAAI,CAAC,KAAK,GAAK,OAAO,SAAS,CAAC,EAAO,CAAC,EAAQ,GAAYC,EAAS,CAAC,EAAO,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAAE,MAAc,CAAC,EAAW,EAAI,CAAE,EAAE,CAAC,CAAC,EAAE,MAAc,CAAC,GAAG,EAAS,CAAC,EAAW,CAAK,EAAE,MAAO,CAAC,GAAG,CAAC,EAAO,OAAO,IAAI,EAAI,EAAM,EAAU,EAAQ,EAAK,GAAG,CAAC,AAAc,IAAU,EAAE,IAAM,EAAE,KAAK,IAAI,GAAG,EAAE,IAAY,EAAS,IAAI,EAAQ,EAAM,GAAW,EAAE,IAAE,EAAG,EAAW,EAAM,CAAK,EAAK,EAAE,EAAE,EAAI,sBAAsB,CAAI,EAAO,EAAW,CAAK,CAAE,EAAkC,MAAhC,GAAI,sBAAsB,CAAI,MAAY,qBAAqB,CAAG,CAAE,EAAE,CAAC,EAAO,EAAS,EAAM,CAAQ,CAAC,EAG/tB,IAAM,GAAvC,GAAU,CAAC,EAAQ,EAAM,EAAA,CA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