{"version":3,"file":"SkipRingTimer_1.0d1QLWMz.mjs","names":["React.useState","React.useMemo"],"sources":["https:/framerusercontent.com/modules/vKiG6OqEBUSoyHFwxPXz/mn2iGmxaKQIrgpynmOoo/SkipRingTimer_1.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerSupportsResize false\n */export default function SkipRingTimer(props){const{duration,size,strokeWidth,trackColor,progressColor,playing,staticProgress}=props;const[prefersReducedMotion,setPrefersReducedMotion]=React.useState(false);const[animatedProgress,setAnimatedProgress]=React.useState(staticProgress);React.useEffect(()=>{if(typeof window!==\"undefined\"&&typeof window.matchMedia===\"function\"){const mediaQuery=window.matchMedia(\"(prefers-reduced-motion: reduce)\");React.startTransition(()=>setPrefersReducedMotion(mediaQuery.matches));const onChange=()=>{React.startTransition(()=>setPrefersReducedMotion(mediaQuery.matches));};if(typeof mediaQuery.addEventListener===\"function\"){mediaQuery.addEventListener(\"change\",onChange);return()=>mediaQuery.removeEventListener(\"change\",onChange);}else{mediaQuery.addListener(onChange);return()=>mediaQuery.removeListener(onChange);}}else{React.startTransition(()=>setPrefersReducedMotion(false));}},[]);const renderTarget=RenderTarget.current();const isCanvasLike=renderTarget===RenderTarget.canvas||renderTarget===RenderTarget.export||renderTarget===RenderTarget.thumbnail;const durationMs=React.useMemo(()=>Math.max(.1,duration)*1e3,[duration]);const clampedStaticProgress=React.useMemo(()=>Math.min(100,Math.max(0,staticProgress)),[staticProgress]);const shouldAnimate=playing&&!prefersReducedMotion&&!isCanvasLike;React.useEffect(()=>{if(!shouldAnimate){React.startTransition(()=>setAnimatedProgress(clampedStaticProgress));return;}let rafId=0;let startTime=0;const tick=time=>{if(startTime===0)startTime=time;const elapsed=(time-startTime)%durationMs;const nextProgress=elapsed/durationMs*100;React.startTransition(()=>setAnimatedProgress(nextProgress));rafId=window.requestAnimationFrame(tick);};if(typeof window!==\"undefined\"){rafId=window.requestAnimationFrame(tick);}return()=>{if(typeof window!==\"undefined\"&&rafId){window.cancelAnimationFrame(rafId);}};},[shouldAnimate,durationMs,clampedStaticProgress]);const progress=shouldAnimate?animatedProgress:clampedStaticProgress;const radius=React.useMemo(()=>Math.max(0,(size-strokeWidth)/2),[size,strokeWidth]);const circumference=React.useMemo(()=>2*Math.PI*radius,[radius]);const dashOffset=React.useMemo(()=>circumference*(1-progress/100),[circumference,progress]);const center=size/2;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:size,height:size,minWidth:size,minHeight:size,maxWidth:size,maxHeight:size,display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"visible\"},children:/*#__PURE__*/_jsxs(\"svg\",{width:size,height:size,viewBox:`0 0 ${size} ${size}`,role:\"img\",\"aria-label\":\"Temporizador circular\",style:{display:\"block\",overflow:\"visible\"},children:[/*#__PURE__*/_jsx(\"circle\",{cx:center,cy:center,r:radius,fill:\"none\",stroke:trackColor,strokeWidth:strokeWidth}),/*#__PURE__*/_jsx(\"circle\",{cx:center,cy:center,r:radius,fill:\"none\",stroke:progressColor,strokeWidth:strokeWidth,strokeLinecap:\"round\",strokeDasharray:circumference,strokeDashoffset:dashOffset,transform:`rotate(-90 ${center} ${center})`})]})});}SkipRingTimer.displayName=\"SkipRingTimer\";addPropertyControls(SkipRingTimer,{duration:{type:ControlType.Number,title:\"Dura\\xe7\\xe3o\",defaultValue:7,min:1,max:30,step:.5,unit:\"s\"},size:{type:ControlType.Number,title:\"Tamanho\",defaultValue:20,min:12,max:64,step:1,unit:\"px\"},strokeWidth:{type:ControlType.Number,title:\"Espessura\",defaultValue:2,min:1,max:6,step:.5,unit:\"px\"},trackColor:{type:ControlType.Color,title:\"Cor da trilha\",defaultValue:\"rgba(14,15,15,0.12)\"},progressColor:{type:ControlType.Color,title:\"Cor do progresso\",defaultValue:\"rgb(79,70,229)\"},playing:{type:ControlType.Boolean,title:\"Animando\",defaultValue:true,enabledTitle:\"Sim\",disabledTitle:\"N\\xe3o\"},staticProgress:{type:ControlType.Number,title:\"Progresso est\\xe1tico\",defaultValue:25,min:0,max:100,step:1,unit:\"%\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SkipRingTimer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportsResize\":\"false\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SkipRingTimer_1.map"],"mappings":"2NAIG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,WAAS,OAAK,cAAY,aAAW,gBAAc,UAAQ,kBAAgB,EAAW,CAAC,EAAqB,GAAyBA,EAAe,EAAK,EAAO,CAAC,EAAiB,GAAqBA,EAAe,CAAc,EAAE,MAAoB,CAAC,GAAU,IAAS,QAAa,OAAO,EAAO,YAAa,WAAW,CAAC,IAAM,EAAW,EAAO,WAAW,kCAAkC,EAAE,MAA0B,EAAwB,EAAW,OAAO,CAAC,EAAE,IAAM,MAAa,CAAC,MAA0B,EAAwB,EAAW,OAAO,CAAC,CAAE,EAAwM,OAAnM,OAAO,EAAW,kBAAmB,YAAY,EAAW,iBAAiB,SAAS,CAAQ,MAAY,EAAW,oBAAoB,SAAS,CAAQ,IAAQ,EAAW,YAAY,CAAQ,MAAY,EAAW,eAAe,CAAQ,EAAG,MAAM,MAA0B,EAAwB,EAAK,CAAC,CAAG,EAAE,CAAC,CAAC,EAAE,IAAM,EAAa,EAAa,QAAQ,EAAQ,EAAa,IAAe,EAAa,QAAQ,IAAe,EAAa,QAAQ,IAAe,EAAa,UAAgB,EAAWC,MAAkB,KAAK,IAAI,GAAG,CAAQ,EAAE,IAAI,CAAC,CAAQ,CAAC,EAAQ,EAAsBA,MAAkB,KAAK,IAAI,IAAI,KAA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