{"version":3,"file":"WithLoopRotateY.DaBt0Co2.mjs","names":["useState","__esmMin","init_ssg_sandbox_shims","te","_e","init_jsx_runtime","J","c","init_npm_react_18_3_1","ce","window","useMotionValue","useMotionValueEvent","animate","init_framer_motion_DhsWWWsN","useIsStaticRenderer","init_framer_DxfB3JJo","withLoopRotateY","canAnimate","motionRotateY","minAngle","rotateYValue","setRotateYValue","props","latest","controls","maxAngle","durationSeconds","fallback","Component","init_WithLoopRotateY"],"sources":["https:/framerusercontent.com/modules/KpnXhfjhkTMEbsZlpwZM/ezSJX9Om71ORRsA4uJDu/WithLoopRotateY.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useEffect,useState}from\"react\";import{useIsStaticRenderer}from\"framer\";import{animate,useMotionValue,useMotionValueEvent}from\"framer-motion\";// User request: Create a new override named withLoopRotateY that continuously swings rotateY between -15 and 15 as a plain numeric prop.\nconst minAngle=-15;const maxAngle=15;const durationSeconds=4;export function withLoopRotateY(Component){return /*#__PURE__*/forwardRef(function WithLoopRotateY(props,ref){const isStatic=useIsStaticRenderer();const canAnimate=!isStatic&&typeof window!==\"undefined\";const motionRotateY=useMotionValue(minAngle);const[rotateYValue,setRotateYValue]=useState(typeof props.rotateY===\"number\"?props.rotateY:minAngle);useMotionValueEvent(motionRotateY,\"change\",latest=>{if(!canAnimate)return;if(typeof latest!==\"number\"||Number.isNaN(latest))return;startTransition(()=>{setRotateYValue(latest);});});useEffect(()=>{let controls;if(canAnimate){motionRotateY.set(minAngle);controls=animate(motionRotateY,maxAngle,{duration:durationSeconds,repeat:Infinity,repeatType:\"mirror\",ease:\"easeInOut\"});}else{const fallback=typeof props.rotateY===\"number\"?props.rotateY:minAngle;startTransition(()=>{setRotateYValue(fallback);});}return()=>{controls?.stop();};},[canAnimate,motionRotateY,props.rotateY]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,rotateY:rotateYValue});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withLoopRotateY\":{\"type\":\"reactHoc\",\"name\":\"withLoopRotateY\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithLoopRotateY.map"],"mappings":"A,sQAC6D,SAAgBiB,EAAgB,EAAU,CAAC,MAAoB,gBAAW,SAAyB,EAAM,EAAI,CAAsC,IAAMC,EAAW,CAAvCH,EAA+C,GAAUL,IAAS,OAAkBS,EAAcR,EAAeS,CAAQ,EAAO,CAACC,EAAaC,GAAiBtB,EAAS,OAAOuB,EAAM,SAAU,SAASA,EAAM,QAAQH,CAAQ,EAAikB,OAA/jBR,EAAoBO,EAAc,SAAS,GAAQ,CAAKD,IAAqB,OAAOM,GAAS,UAAU,OAAO,MAAMA,CAAM,GAASrB,MAAoB,CAACmB,EAAgBE,CAAM,CAAE,CAAC,EAAE,CAAC,EAAEf,MAAc,CAAC,IAAIgB,EAAS,GAAGP,EAAYC,EAAc,IAAIC,CAAQ,EAAE,EAASP,EAAQM,EAAcO,EAAS,CAAC,SAASC,EAAgB,OAAO,IAAS,WAAW,SAAS,KAAK,WAAW,CAAC,MAAO,CAAC,IAAMC,EAAS,OAAOL,EAAM,SAAU,SAASA,EAAM,QAAQH,EAASjB,MAAoB,CAACmB,EAAgBM,CAAQ,CAAE,CAAC,CAAE,CAAC,UAAU,CAACH,GAAU,KAAK,CAAE,CAAE,EAAE,CAACP,EAAWC,EAAcI,EAAM,OAAO,CAAC,EAAsB,gBAAKM,EAAU,CAAC,GAAGN,EAAU,MAAI,QAAQF,CAAY,CAAC,CAAE,CAAC,CAAE,C,4DAAliC,EAAS,IAAU,EAAS,GAAS,EAAgB,C"}