{"version":3,"file":"Ring.Qe7LSMaA.mjs","names":["useRef","useState","__esmMin","_e","de","p","c","init_jsx_runtime","init_npm_react_18_3_1","ce","useTransform","useMotionValue","animate","useReducedMotion","init_framer_motion_DhsWWWsN","motion","useInView","RenderTarget","addPropertyControls","init_framer_D6uXRwWs","ControlType","Ring","props","ref","inView","reduce","canvas","mv","value","shown","setShown","u","v","r","stroke","C","dash","gid","style","color","colorTo","track","font","textColor","valueSize","suffix","caption","captionColor","init_Ring"],"sources":["https:/framerusercontent.com/modules/v77l3CGQnlqzJBGNxLPo/Z5dhLZCftr9LHK36ZtHS/Ring.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef}from\"react\";import{motion,useInView,useReducedMotion,animate,useMotionValue,useTransform}from\"framer-motion\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useState}from\"react\";/**\n * Progress ring that fills and counts up when it scrolls into view.\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 96\n * @framerIntrinsicHeight 96\n */export default function Ring(props){const{value,suffix,caption,stroke,color,colorTo,track,textColor,captionColor,valueSize,font,style}=props;const ref=useRef(null);const inView=useInView(ref,{once:true,amount:.4});const reduce=useReducedMotion();const canvas=RenderTarget.current()===RenderTarget.canvas;const mv=useMotionValue(canvas||reduce?value:0);const[shown,setShown]=useState(canvas||reduce?value:0);useEffect(()=>{if(canvas||reduce||!inView)return;const c=animate(mv,value,{duration:1.8,ease:[.22,1,.36,1]});const u=mv.on(\"change\",v=>setShown(Math.round(v)));return()=>{c.stop();u();};},[inView,value]);const r=50-stroke/2-1;const C=2*Math.PI*r;const dash=useTransform(mv,v=>C*(1-Math.max(0,Math.min(100,v))/100));const gid=\"rg\"+Math.round(value*31+stroke*7);return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{position:\"relative\",width:\"100%\",height:\"100%\",...style},children:[/*#__PURE__*/_jsxs(\"svg\",{viewBox:\"0 0 100 100\",style:{width:\"100%\",height:\"100%\",display:\"block\",transform:\"rotate(-90deg)\"},children:[/*#__PURE__*/_jsx(\"defs\",{children:/*#__PURE__*/_jsxs(\"linearGradient\",{id:gid,x1:\"0\",y1:\"0\",x2:\"1\",y2:\"1\",children:[/*#__PURE__*/_jsx(\"stop\",{offset:\"0%\",stopColor:color}),/*#__PURE__*/_jsx(\"stop\",{offset:\"100%\",stopColor:colorTo})]})}),/*#__PURE__*/_jsx(\"circle\",{cx:\"50\",cy:\"50\",r:r,fill:\"none\",stroke:track,strokeWidth:stroke}),/*#__PURE__*/_jsx(motion.circle,{cx:\"50\",cy:\"50\",r:r,fill:\"none\",stroke:`url(#${gid})`,strokeWidth:stroke,strokeLinecap:\"round\",strokeDasharray:C,style:{strokeDashoffset:dash}})]}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",inset:0,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:2,fontFamily:font,color:textColor},children:[/*#__PURE__*/_jsxs(\"span\",{style:{fontSize:valueSize,letterSpacing:\"-0.04em\",lineHeight:1,fontVariantNumeric:\"tabular-nums\"},children:[shown,suffix]}),caption?/*#__PURE__*/_jsx(\"span\",{style:{fontSize:Math.max(9,valueSize*.4),color:captionColor,lineHeight:1.1},children:caption}):null]})]});}Ring.defaultProps={value:82,suffix:\"%\",caption:\"\",stroke:7,color:\"#FFD43B\",colorTo:\"#3DDC84\",track:\"rgba(255,255,255,0.18)\",textColor:\"#FFFFFF\",captionColor:\"rgba(255,255,255,0.6)\",valueSize:22,font:\"Inter Display, Inter, sans-serif\"};addPropertyControls(Ring,{value:{type:ControlType.Number,min:0,max:100,step:1},suffix:{type:ControlType.String},caption:{type:ControlType.String},stroke:{type:ControlType.Number,min:2,max:16,step:1},color:{type:ControlType.Color},colorTo:{type:ControlType.Color},track:{type:ControlType.Color},textColor:{type:ControlType.Color},captionColor:{type:ControlType.Color},valueSize:{type:ControlType.Number,min:8,max:80,step:1},font:{type:ControlType.String}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Ring\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"96\",\"framerIntrinsicWidth\":\"96\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Ring.map"],"mappings":"A,2RAMG,SAAwBqB,EAAK,EAAM,CAAC,GAAK,CAAC,QAAM,SAAO,UAAQ,SAAO,QAAM,UAAQ,QAAM,YAAU,eAAa,YAAU,OAAK,SAAOC,EAAYC,EAAIvB,EAAO,IAAI,EAAQwB,EAAOR,EAAUO,EAAI,CAAC,KAAK,GAAK,OAAO,EAAE,CAAC,EAAQE,EAAOZ,EAAiB,EAAQa,EAAOT,EAAa,QAAQ,IAAIA,EAAa,OAAaU,EAAGhB,EAAee,GAAQD,EAAOG,EAAM,CAAC,EAAO,CAACC,EAAMC,GAAU7B,EAASyB,GAAQD,EAAOG,EAAM,CAAC,EAAEnB,MAAc,CAAC,GAAGiB,GAAQD,GAAQ,CAACD,EAAO,OAAO,IAAMlB,EAAEM,EAAQe,EAAGC,EAAM,CAAC,SAAS,IAAI,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAQG,EAAEJ,EAAG,GAAG,SAAS,GAAGG,EAAS,KAAK,MAAME,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC1B,EAAE,KAAK,EAAEyB,EAAE,CAAE,CAAE,EAAE,CAACP,EAAOI,CAAK,CAAC,EAAE,IAAMK,EAAE,GAAGC,EAAO,EAAE,EAAQC,EAAE,EAAE,KAAK,GAAGF,EAAQG,EAAK1B,EAAaiB,EAAG,GAAGQ,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,IAAIH,CAAC,CAAC,EAAE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