{"version":3,"file":"Border_Light.D6FPgAz0.mjs","names":["React.useState","React.useRef","React.useCallback"],"sources":["https:/framerusercontent.com/modules/XMiE8katpNXueZ4x0yo2/AaUeiTVj2UIPBAl9Ll6P/Border_Light.js"],"sourcesContent":["/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 200\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/* ─────────────────────────────────────────────\n   Inject spin keyframe once into <head>.\n   A unique ID prevents duplicate injections.\n───────────────────────────────────────────── */const SPIN_KEYFRAME_ID=\"__borderlight_spin__\";function injectKeyframes(){if(typeof document===\"undefined\"||document.getElementById(SPIN_KEYFRAME_ID))return;const style=document.createElement(\"style\");style.id=SPIN_KEYFRAME_ID;style.textContent=`\n        @keyframes borderlight_spin {\n            from { transform: rotateZ(0deg); }\n            to   { transform: rotateZ(360deg); }\n        }\n    `;document.head.appendChild(style);}/* ─────────────────────────────────────────────\n   Component\n───────────────────────────────────────────── */export default function BorderLight(props){const{radius,borderWidth,background,enableSpin,spinColor,spinWidth,spinDuration,spinOpacity,enableMouseGlow,glowColor,glowSize,fadeDuration,glowOpacity,enableProximity,proximityDistance}=props;/* ── hydration guard ── */const[isClient,setIsClient]=React.useState(false);React.useEffect(()=>{setIsClient(true);injectKeyframes();},[]);const isCanvas=RenderTarget.current()===RenderTarget.canvas;/* ── refs ── */const ref=React.useRef(null);const rectRef=React.useRef(null);const rafRef=React.useRef(0);const[mouseOpacity,setMouseOpacity]=React.useState(0);/* keep latest prop values accessible in the stable pointermove closure */const enableProximityRef=React.useRef(enableProximity);const proximityDistanceRef=React.useRef(proximityDistance);const glowOpacityRef=React.useRef(glowOpacity);const enableMouseGlowRef=React.useRef(enableMouseGlow);React.useEffect(()=>{enableProximityRef.current=enableProximity;},[enableProximity]);React.useEffect(()=>{proximityDistanceRef.current=proximityDistance;},[proximityDistance]);React.useEffect(()=>{glowOpacityRef.current=glowOpacity;},[glowOpacity]);React.useEffect(()=>{enableMouseGlowRef.current=enableMouseGlow;},[enableMouseGlow]);/* ── bounding-rect cache ── */React.useEffect(()=>{if(!isClient||isCanvas)return;const update=()=>{if(ref.current)rectRef.current=ref.current.getBoundingClientRect();};update();window.addEventListener(\"resize\",update,{passive:true});window.addEventListener(\"scroll\",update,{passive:true});return()=>{window.removeEventListener(\"resize\",update);window.removeEventListener(\"scroll\",update);};},[isClient,isCanvas]);/* ── RAF-throttled pointer tracking ── */React.useEffect(()=>{if(!isClient||isCanvas)return;const handleMove=e=>{cancelAnimationFrame(rafRef.current);rafRef.current=requestAnimationFrame(()=>{if(!enableMouseGlowRef.current)return;if(!rectRef.current||!ref.current)return;const rect=rectRef.current;ref.current.style.setProperty(\"--x\",`${e.clientX-rect.left}px`);ref.current.style.setProperty(\"--y\",`${e.clientY-rect.top}px`);if(enableProximityRef.current){const dx=e.clientX-(rect.left+rect.width/2);const dy=e.clientY-(rect.top+rect.height/2);const dist=Math.sqrt(dx*dx+dy*dy);const intensity=Math.max(0,1-dist/proximityDistanceRef.current);React.startTransition(()=>setMouseOpacity(intensity*glowOpacityRef.current));}});};window.addEventListener(\"pointermove\",handleMove,{passive:true});return()=>{window.removeEventListener(\"pointermove\",handleMove);cancelAnimationFrame(rafRef.current);};},[isClient,isCanvas]);const onPointerEnter=React.useCallback(()=>{if(!enableMouseGlowRef.current||enableProximityRef.current)return;React.startTransition(()=>setMouseOpacity(glowOpacityRef.current));},[]);const onPointerLeave=React.useCallback(()=>{if(!enableMouseGlowRef.current||enableProximityRef.current)return;React.startTransition(()=>setMouseOpacity(0));},[]);/* ─────────────────────────────────────────\n       Shared CSS mask: reveals only the border\n       ring by excluding the content-box area.\n    ───────────────────────────────────────── */const borderMask={mask:`linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)`,WebkitMaskComposite:\"xor\",maskComposite:\"exclude\"};return /*#__PURE__*/_jsxs(\"div\",{ref:ref,onPointerEnter:onPointerEnter,onPointerLeave:onPointerLeave,style:{position:\"relative\",width:\"100%\",height:\"100%\",borderRadius:radius,background,overflow:\"hidden\"},children:[enableSpin&&/*\n                 * Outer div: applies the border-ring mask + padding trick.\n                 * overflow:hidden is NOT set here so the rotating beam (which\n                 * is larger than the element) isn't clipped by the mask layer.\n                 * Instead we clip inside a dedicated child div.\n                 *//*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,borderRadius:radius,padding:borderWidth,pointerEvents:\"none\",opacity:spinOpacity,...borderMask},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,overflow:\"hidden\",borderRadius:radius},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",width:spinWidth,height:\"160%\",top:\"50%\",left:\"50%\",translate:\"-50% -50%\",background:`linear-gradient(\n                                    transparent,\n                                    ${spinColor},\n                                    ${spinColor},\n                                    ${spinColor},\n                                    transparent\n                                )`,animation:`borderlight_spin ${spinDuration}ms infinite linear`,animationPlayState:isCanvas?\"paused\":\"running\",pointerEvents:\"none\"}})})}),enableMouseGlow&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,borderRadius:radius,pointerEvents:\"none\",padding:borderWidth,opacity:mouseOpacity,transition:`opacity ${fadeDuration}ms ease`,background:`radial-gradient(\n                            ${glowSize}px circle at var(--x, 50%) var(--y, 50%),\n                            ${glowColor},\n                            transparent 70%\n                        )`,...borderMask}})]});}/* ─────────────────────────────────────────────\n   Defaults\n───────────────────────────────────────────── */BorderLight.defaultProps={radius:16,borderWidth:3,background:\"#0b0b0c\",enableSpin:true,spinColor:\"#ff9966\",spinWidth:80,spinDuration:3e3,spinOpacity:1,enableMouseGlow:true,glowColor:\"#38bdf8\",glowSize:140,showAdvanced:false,fadeDuration:200,glowOpacity:1,enableProximity:false,proximityDistance:300};/* ─────────────────────────────────────────────\n   Property Controls\n───────────────────────────────────────────── */addPropertyControls(BorderLight,{/* ── Base ── */radius:{type:ControlType.Number,title:\"Radius\",defaultValue:16},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:3,min:1,max:20},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#0b0b0c\"},/* ── Auto Spin ── */enableSpin:{type:ControlType.Boolean,title:\"Auto Spin\",defaultValue:true},spinColor:{type:ControlType.Color,title:\"Spin Color\",defaultValue:\"#ff9966\",hidden:p=>!p.enableSpin},spinWidth:{type:ControlType.Number,title:\"Beam Width\",defaultValue:80,min:20,max:400,hidden:p=>!p.enableSpin},spinDuration:{type:ControlType.Number,title:\"Spin Speed (ms)\",defaultValue:3e3,min:500,max:2e4,step:100,hidden:p=>!p.enableSpin},spinOpacity:{type:ControlType.Number,title:\"Spin Opacity\",defaultValue:1,min:0,max:1,step:.05,hidden:p=>!p.enableSpin},/* ── Mouse Glow ── */enableMouseGlow:{type:ControlType.Boolean,title:\"Mouse Glow\",defaultValue:true},glowColor:{type:ControlType.Color,title:\"Glow Color\",defaultValue:\"#38bdf8\",hidden:p=>!p.enableMouseGlow},glowSize:{type:ControlType.Number,title:\"Glow Size\",defaultValue:140,min:60,max:400,hidden:p=>!p.enableMouseGlow},/* ── Advanced ── */showAdvanced:{type:ControlType.Boolean,title:\"Advanced\",defaultValue:false},fadeDuration:{type:ControlType.Number,title:\"Fade (ms)\",defaultValue:200,hidden:p=>!p.showAdvanced||!p.enableMouseGlow},glowOpacity:{type:ControlType.Number,title:\"Glow Opacity\",defaultValue:1,min:0,max:1,step:.05,hidden:p=>!p.showAdvanced||!p.enableMouseGlow},enableProximity:{type:ControlType.Boolean,title:\"Proximity Glow\",defaultValue:false,hidden:p=>!p.showAdvanced||!p.enableMouseGlow},proximityDistance:{type:ControlType.Number,title:\"Proximity Range\",defaultValue:300,min:100,max:800,hidden:p=>!p.showAdvanced||!p.enableMouseGlow||!p.enableProximity}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"re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