{"version":3,"file":"Loader.BPa9htLL.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/akYjuiPx6ktsWdzhigqj/sxjpSNsjxqdK6TnAAGad/Loader.js"],"sourcesContent":["// Simple animated loader component\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{motion,useInView,useMotionValue,useTransform,animate,useMotionValueEvent}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Loader(props){const{targetNumber,prefix,suffix,color,duration,font}=props;const ref=useRef(null);const isInView=useInView(ref,{once:true});const count=useMotionValue(0);const rounded=useTransform(count,latest=>Math.round(latest));const[displayValue,setDisplayValue]=useState(0);useMotionValueEvent(rounded,\"change\",latest=>{setDisplayValue(latest);});useEffect(()=>{if(isInView){const controls=animate(count,targetNumber,{duration:duration/1e3,ease:\"easeOut\"});return controls.stop;}},[isInView,targetNumber,duration,count]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",position:\"relative\",color:color,...font},children:/*#__PURE__*/_jsxs(motion.span,{children:[prefix,displayValue,suffix]})});}addPropertyControls(Loader,{targetNumber:{type:ControlType.Number,title:\"Target Number\",defaultValue:600,min:0,max:1e4,step:1},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:\"Color\",defaultValue:\"#000000\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:800,min:100,max:3e3,step:100,unit:\"ms\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Loader\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Loader.map"],"mappings":"mRAIG,SAAwB,EAAO,EAAM,CAAC,GAAK,CAAC,eAAa,SAAO,SAAO,QAAM,WAAS,QAAM,EAAY,EAAIA,EAAO,KAAK,CAAO,EAAS,EAAU,EAAI,CAAC,KAAK,GAAK,CAAC,CAAO,EAAM,EAAe,EAAE,CAAO,EAAQ,EAAa,EAAM,GAAQ,KAAK,MAAM,EAAO,CAAC,CAAM,CAAC,EAAa,GAAiBC,EAAS,EAAE,CAAwP,OAAvP,EAAoB,EAAQ,SAAS,GAAQ,CAAC,EAAgB,EAAO,EAAG,CAAC,MAAc,CAAC,GAAG,EAA4F,OAAnE,EAAQ,EAAM,EAAa,CAAC,SAAS,EAAS,IAAI,KAAK,UAAU,CAAC,CAAiB,MAAQ,CAAC,EAAS,EAAa,EAAS,EAAM,CAAC,CAAqB,EAAK,MAAM,CAAK,MAAI,MAAM,CAAC,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,SAAS,WAAiB,QAAM,GAAG,EAAK,CAAC,SAAsB,EAAM,EAAO,KAAK,CAAC,SAAS,CAAC,EAAO,EAAa,EAAO,CAAC,CAAC,CAAC,CAAC,kBAHptB,IAAoG,IAAoD,IAA6C,CAGihB,EAAoB,EAAO,CAAC,aAAa,CAAC,KAAK,EAAY,OAAO,MAAM,gBAAgB,aAAa,IAAI,IAAI,EAAE,IAAI,IAAI,KAAK,EAAE,CAAC,OAAO,CAAC,KAAK,EAAY,OAAO,MAAM,SAAS,aAAa,GAAG,YAAY,UAAU,CAAC,OAAO,CAAC,KAAK,EAAY,OAAO,MAAM,SAAS,aAAa,GAAG,YAAY,aAAa,CAAC,MAAM,CAAC,KAAK,EAAY,MAAM,MAAM,QAA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