{"version":3,"file":"CustomCursor.qPecfaEl.mjs","names":["useState","useRef","useMemo","_Fragment"],"sources":["https:/framerusercontent.com/modules/tVEDFNMr7QNXUBC0mpnI/oG8uqvtc0RidKqZ3nVmK/CustomCursor.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{startTransition,useEffect,useMemo,useRef,useState}from\"react\";// @ts-ignore - react-dom types may be unavailable in this Framer environment, runtime module is present.\nimport{createPortal}from\"react-dom\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function CustomCursor(props){const{defaultSize,pressedSize,activeSize,color,opacity,borderWidth,activeBorderWidth,transitionDuration,mixBlendModeEnabled,hideNativeCursor,style}=props;const isStatic=useIsStaticRenderer();const[isTouchDevice,setIsTouchDevice]=useState(false);const[position,setPosition]=useState({x:-200,y:-200});const[isPressed,setIsPressed]=useState(false);const[isActive,setIsActive]=useState(false);const frameRef=useRef(null);const latestPointRef=useRef({x:-200,y:-200});const activeRef=useRef(false);useEffect(()=>{if(isStatic)return;if(typeof window===\"undefined\")return;let coarse=false;let fine=true;try{coarse=window.matchMedia(\"(pointer: coarse)\").matches;fine=window.matchMedia(\"(pointer: fine)\").matches;}catch{coarse=false;fine=true;}const nextIsTouchDevice=coarse||!fine;startTransition(()=>setIsTouchDevice(nextIsTouchDevice));},[isStatic]);useEffect(()=>{if(isStatic||isTouchDevice)return;if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const updatePosition=()=>{frameRef.current=null;const next=latestPointRef.current;startTransition(()=>setPosition(next));};const updateActive=(x,y)=>{let nextActive=false;const target=document.elementFromPoint(x,y);if(target)nextActive=isCursorActiveTarget(target);if(nextActive!==activeRef.current){activeRef.current=nextActive;startTransition(()=>setIsActive(nextActive));}};const onMouseMove=event=>{latestPointRef.current={x:event.clientX,y:event.clientY};if(frameRef.current===null)frameRef.current=window.requestAnimationFrame(updatePosition);updateActive(event.clientX,event.clientY);};const onMouseDown=()=>{startTransition(()=>setIsPressed(true));};const onMouseUp=()=>{startTransition(()=>setIsPressed(false));};window.addEventListener(\"mousemove\",onMouseMove,{passive:true});window.addEventListener(\"mousedown\",onMouseDown);window.addEventListener(\"mouseup\",onMouseUp);return()=>{window.removeEventListener(\"mousemove\",onMouseMove);window.removeEventListener(\"mousedown\",onMouseDown);window.removeEventListener(\"mouseup\",onMouseUp);if(frameRef.current!==null){window.cancelAnimationFrame(frameRef.current);frameRef.current=null;}};},[isStatic,isTouchDevice]);useEffect(()=>{if(isTouchDevice)return;if(!hideNativeCursor)return;if(typeof document===\"undefined\")return;const root=document.documentElement;const body=document.body;const previousRootCursor=root.style.cursor;const previousCursor=document.body.style.cursor;const styleSelector='style[data-custom-cursor-style=\"true\"]';const existingStyle=document.head.querySelector(styleSelector);if(existingStyle)existingStyle.remove();const cursorStyle=document.createElement(\"style\");cursorStyle.setAttribute(\"data-custom-cursor-style\",\"true\");cursorStyle.textContent=\"*, *:hover, *:active, *:focus { cursor: none !important; }\";document.head.appendChild(cursorStyle);root.style.cursor=\"none\";body.style.cursor=\"none\";return()=>{const insertedStyle=document.head.querySelector(styleSelector);if(insertedStyle)insertedStyle.remove();root.style.cursor=previousRootCursor;body.style.cursor=previousCursor;};},[hideNativeCursor,isTouchDevice]);const resolvedDefaultSize=Math.max(1,defaultSize);const resolvedPressedSize=Math.max(1,pressedSize);const resolvedActiveSize=Math.max(1,activeSize??defaultSize);const currentSize=isPressed?resolvedPressedSize:isActive?resolvedActiveSize:resolvedDefaultSize;const dotStyle=useMemo(()=>({position:\"fixed\",left:0,top:0,width:currentSize,height:currentSize,transform:`translate3d(${position.x}px, ${position.y}px, 0) translate(-50%, -50%)`,borderRadius:999,backgroundColor:isActive?\"transparent\":color,border:isActive?`${Math.max(0,activeBorderWidth??borderWidth)}px solid ${color}`:\"0px solid transparent\",opacity:mixBlendModeEnabled?1:clamp(opacity,0,1),mixBlendMode:mixBlendModeEnabled?\"difference\":\"normal\",pointerEvents:\"none\",zIndex:2147483647,transitionProperty:\"width, height, background-color, border, opacity\",transitionDuration:`${Math.max(0,transitionDuration)}s`,transitionTimingFunction:\"cubic-bezier(0.22, 1, 0.36, 1)\",willChange:\"transform, width, height\"}),[activeBorderWidth,borderWidth,color,currentSize,isActive,mixBlendModeEnabled,opacity,position.x,position.y,transitionDuration]);if(isStatic||isTouchDevice){return /*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",inset:0,pointerEvents:\"none\",zIndex:2147483647,...style}});}if(typeof document===\"undefined\"){return /*#__PURE__*/_jsx(\"div\",{style:{display:\"none\"}});}return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{style:{display:\"none\"}}),/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":true,style:{...style,...dotStyle}}),document.body)]});}function isCursorActiveTarget(node){let current=node;while(current){const tag=current.tagName.toLowerCase();if(tag===\"a\"||tag===\"button\")return true;if(current.getAttribute(\"role\")?.toLowerCase()===\"button\")return true;if(current.hasAttribute(\"data-cursor-active\"))return true;if(typeof window!==\"undefined\"){const computed=window.getComputedStyle(current);if(computed.cursor===\"pointer\")return true;}current=current.parentElement;}return false;}function clamp(value,min,max){if(!Number.isFinite(value))return min;return Math.min(max,Math.max(min,value));}addPropertyControls(CustomCursor,{defaultSize:{type:ControlType.Number,title:\"Default Size\",defaultValue:18,min:1,max:200,step:1},pressedSize:{type:ControlType.Number,title:\"Pressed Size\",defaultValue:15,min:1,max:200,step:1},activeSize:{type:ControlType.Number,title:\"Active Size\",defaultValue:26,min:1,max:200,step:1},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FFFFFF\"},opacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:.8,min:0,max:1,step:.01},borderWidth:{type:ControlType.Number,title:\"Border\",defaultValue:.2,min:0,max:10,step:.1},activeBorderWidth:{type:ControlType.Number,title:\"Active Border\",defaultValue:1.5,min:0,max:10,step:.1},transitionDuration:{type:ControlType.Number,title:\"Transition\",defaultValue:.4,min:0,max:2,step:.05,unit:\"s\"},mixBlendModeEnabled:{type:ControlType.Boolean,title:\"Blend Diff\",defaultValue:true},hideNativeCursor:{type:ControlType.Boolean,title:\"Hide Native\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomCursor\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomCursor.map"],"mappings":"wPAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,cAAY,cAAY,aAAW,QAAM,UAAQ,cAAY,oBAAkB,qBAAmB,sBAAoB,mBAAiB,SAAO,EAAY,EAAS,EAAoB,EAAO,CAAC,EAAc,GAAkBA,EAAS,EAAK,EAAO,CAAC,EAAS,GAAaA,EAAS,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAAO,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAO,CAAC,EAAS,GAAaA,EAAS,EAAK,EAAQ,EAASC,EAAO,IAAI,EAAQ,EAAeA,EAAO,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAAQ,EAAUA,EAAO,EAAK,EAAE,MAAc,CAAoB,GAAhB,GAA0B,IAAS,OAAY,OAAO,IAAI,EAAO,GAAU,EAAK,GAAK,GAAG,CAAC,EAAO,EAAO,WAAW,mBAAmB,CAAC,CAAC,QAAQ,EAAK,EAAO,WAAW,iBAAiB,CAAC,CAAC,OAAQ,MAAM,CAAC,EAAO,GAAM,EAAK,EAAK,CAAC,IAAM,EAAkB,GAAQ,CAAC,EAAK,MAAoB,EAAiB,CAAiB,CAAC,CAAE,EAAE,CAAC,CAAQ,CAAC,EAAE,MAAc,CAAmC,GAA/B,GAAU,GAA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