{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/XZeEPdC7OdtQPKJhqy8L/QMIaxmqJthjp3L83jLOj/Magnetic.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useMotionValue,useSpring}from\"framer-motion\";import{useEffect,useRef,useCallback}from\"react\";export function Followcursor({damping=100,stiffness=1e3,effectRange=2,intensity=5,actionableArea=30,style}){const x=useMotionValue(0);const y=useMotionValue(0);const springX=useSpring(x,{damping,stiffness});const springY=useSpring(y,{damping,stiffness});const ref=useRef(null);const handleMouseMove=useCallback(event=>{if(!ref.current)return;const element=ref.current;const rect=element.getBoundingClientRect();const mouseX=event.clientX;const mouseY=event.clientY;const isWithinBounds=mouseX>=rect.left-actionableArea&&mouseX<=rect.right+actionableArea&&mouseY>=rect.top-actionableArea&&mouseY<=rect.bottom+actionableArea;if(isWithinBounds){const displacementX=mouseX-(rect.left+rect.width/2);const displacementY=mouseY-(rect.top+rect.height/2);const normalizedX=displacementX/(rect.width/2)*effectRange*intensity;const normalizedY=displacementY/(rect.height/2)*effectRange*intensity;// Use requestAnimationFrame to update motion values\nrequestAnimationFrame(()=>{x.set(normalizedX);y.set(normalizedY);});}else{// Reset position if mouse is out of bounds\nrequestAnimationFrame(()=>{x.set(0);y.set(0);});}},[actionableArea,effectRange,intensity,x,y]);useEffect(()=>{window.addEventListener(\"mousemove\",handleMouseMove);return()=>{window.removeEventListener(\"mousemove\",handleMouseMove);};},[handleMouseMove]);return{ref:ref,style:{x:springX,y:springY,...style}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withFollowcursor(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...Followcursor(props)});};}withFollowcursor.displayName=\"Followcursor\";\nexport const __FramerMetadata__ = {\"exports\":{\"Followcursor\":{\"type\":\"override\",\"name\":\"Followcursor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFollowcursor\":{\"type\":\"reactHoc\",\"name\":\"withFollowcursor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Magnetic.map"],
  "mappings": "qKAAsJ,SAASA,EAAa,CAAC,QAAAC,EAAQ,IAAI,UAAAC,EAAU,IAAI,YAAAC,EAAY,EAAE,UAAAC,EAAU,EAAE,eAAAC,EAAe,GAAG,MAAAC,CAAK,EAAE,CAAC,IAAMC,EAAEC,EAAe,CAAC,EAAQC,EAAED,EAAe,CAAC,EAAQE,EAAQC,EAAUJ,EAAE,CAAC,QAAAN,EAAQ,UAAAC,CAAS,CAAC,EAAQU,EAAQD,EAAUF,EAAE,CAAC,QAAAR,EAAQ,UAAAC,CAAS,CAAC,EAAQW,EAAIC,EAAO,IAAI,EAAQC,EAAgBC,EAAYC,GAAO,CAAC,GAAG,CAACJ,EAAI,QAAQ,OAAiC,IAAMK,EAAlBL,EAAI,QAA2B,sBAAsB,EAAQM,EAAOF,EAAM,QAAcG,EAAOH,EAAM,QAAsK,GAAzIE,GAAQD,EAAK,KAAKb,GAAgBc,GAAQD,EAAK,MAAMb,GAAgBe,GAAQF,EAAK,IAAIb,GAAgBe,GAAQF,EAAK,OAAOb,EAAiC,CAAC,IAAMgB,EAAcF,GAAQD,EAAK,KAAKA,EAAK,MAAM,GAASI,EAAcF,GAAQF,EAAK,IAAIA,EAAK,OAAO,GAASK,EAAYF,GAAeH,EAAK,MAAM,GAAGf,EAAYC,EAAgBoB,EAAYF,GAAeJ,EAAK,OAAO,GAAGf,EAAYC,EAC1/B,sBAAsB,IAAI,CAACG,EAAE,IAAIgB,CAAW,EAAEd,EAAE,IAAIe,CAAW,CAAE,CAAC,CAAE,MACpE,sBAAsB,IAAI,CAACjB,EAAE,IAAI,CAAC,EAAEE,EAAE,IAAI,CAAC,CAAE,CAAC,CAAG,EAAE,CAACJ,EAAeF,EAAYC,EAAUG,EAAEE,CAAC,CAAC,EAAE,OAAAgB,EAAU,KAAKC,EAAO,iBAAiB,YAAYX,CAAe,EAAQ,IAAI,CAACW,EAAO,oBAAoB,YAAYX,CAAe,CAAE,GAAI,CAACA,CAAe,CAAC,EAAQ,CAAC,IAAIF,EAAI,MAAM,CAAC,EAAEH,EAAQ,EAAEE,EAAQ,GAAGN,CAAK,CAAC,CAAE,CAA2J,SAASqB,EAAiBC,EAAE,CAAC,OAAOC,IAAQC,EAA+BC,CAAuC,EAASC,EAAKJ,EAAE,CAAC,GAAGC,EAAM,GAAG7B,EAAa6B,CAAK,CAAC,CAAC,EAAI,CAACF,EAAiB,YAAY",
  "names": ["Followcursor", "damping", "stiffness", "effectRange", "intensity", "actionableArea", "style", "x", "useMotionValue", "y", "springX", "useSpring", "springY", "ref", "pe", "handleMouseMove", "te", "event", "rect", "mouseX", "mouseY", "displacementX", "displacementY", "normalizedX", "normalizedY", "ue", "window", "withFollowcursor", "C", "props", "re", "DataObserverContext", "p"]
}
