{"version":3,"file":"DotPatternOverlay.Bl65LTKf.mjs","names":["useRef","useState","useCallback"],"sources":["https:/framerusercontent.com/modules/FLVhzusHDM6cLa6kwMzM/bnqiTCEpRpS4tzQNdnfO/DotPatternOverlay.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef,useCallback}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";function DotPatternOverlay(props){const{dotColor=\"rgb(225, 224, 218)\",dotSize=1.2,dotSpacing=14,dotOpacity=.85,style}=props;const wrapperRef=useRef(null);const[dims,setDims]=useState({x:0,y:0,w:0,h:0});// False until the section has been measured. While false the dot layer is\n// not painted, so it can never register as a layout shift.\nconst[measured,setMeasured]=useState(false);// Editor canvas: stay completely inert so we never mutate Framer's own\n// wrapper DOM (which pushes the selection outline behind page content).\nconst isCanvas=RenderTarget.current()===RenderTarget.canvas;const forceOverflowVisible=useCallback(()=>{const el=wrapperRef.current;if(!el)return;let node=el.parentElement;for(let i=0;i<10;i++){if(!node)break;const style=window.getComputedStyle(node);if(style.overflow===\"hidden\"||style.overflow===\"clip\"||style.overflowX===\"hidden\"||style.overflowY===\"hidden\"){// Only force overflow on tiny Framer wrappers (height < 10px),\n// not on section-level containers which need overflow hidden for mobile\nif(node.offsetHeight<10){node.style.overflow=\"visible\";}}// Stop at any container with meaningful height (section-level)\nif(node.offsetHeight>=100){break;}node=node.parentElement;}},[]);const findSection=useCallback(()=>{const el=wrapperRef.current;if(!el)return null;let node=el;while(node&&node.parentElement){node=node.parentElement;if(node.offsetWidth>=300&&node.offsetHeight>=200){return node;}}return null;},[]);const reposition=useCallback(()=>{const el=wrapperRef.current;if(!el)return;forceOverflowVisible();const sectionEl=findSection();if(!sectionEl)return;const sectionRect=sectionEl.getBoundingClientRect();const elRect=el.getBoundingClientRect();setDims({x:sectionRect.left-elRect.left,y:sectionRect.top-elRect.top,w:sectionRect.width,h:sectionRect.height});setMeasured(true);},[findSection,forceOverflowVisible]);useEffect(()=>{if(typeof window===\"undefined\")return;// Do nothing on the editor canvas.\nif(RenderTarget.current()===RenderTarget.canvas)return;// Measure straight away so the dots appear on the next frame.\nreposition();const t1=setTimeout(reposition,100);const t2=setTimeout(reposition,300);const t3=setTimeout(reposition,800);const t4=setTimeout(reposition,2e3);let observer=null;try{observer=new ResizeObserver(()=>reposition());if(wrapperRef.current?.parentElement){observer.observe(wrapperRef.current.parentElement);}}catch(e){// no-op\n}window.addEventListener(\"resize\",reposition);const overflowTimer=window.setInterval(forceOverflowVisible,3e3);return()=>{clearTimeout(t1);clearTimeout(t2);clearTimeout(t3);clearTimeout(t4);observer?.disconnect();window.removeEventListener(\"resize\",reposition);clearInterval(overflowTimer);};},[reposition,forceOverflowVisible]);// Editor canvas: render an inert, zero-size, non-painting placeholder.\n// No dot layer is drawn here so nothing can overlap the selection outline.\nif(isCanvas){return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:0,height:0,overflow:\"visible\",pointerEvents:\"none\",...style}});}return /*#__PURE__*/_jsx(\"div\",{ref:wrapperRef,style:{position:\"relative\",width:0,height:0,overflow:\"visible\",pointerEvents:\"none\",...style},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:dims.x,top:dims.y,width:dims.w||\"100vw\",height:dims.h||\"100vh\",// Not painted until measured => never a layout-shift source.\nvisibility:measured?\"visible\":\"hidden\",backgroundImage:`radial-gradient(circle, ${dotColor} ${dotSize}px, transparent ${dotSize}px)`,backgroundSize:`${dotSpacing}px ${dotSpacing}px`,backgroundPosition:`${dotSpacing/2}px ${dotSpacing/2}px`,opacity:dotOpacity,pointerEvents:\"none\",zIndex:0}})});}addPropertyControls(DotPatternOverlay,{dotColor:{title:\"Dot Color\",type:ControlType.Color,defaultValue:\"rgb(225, 224, 218)\"},dotSize:{title:\"Dot Size\",type:ControlType.Number,defaultValue:1.2,min:.5,max:5,step:.1},dotSpacing:{title:\"Dot Spacing\",type:ControlType.Number,defaultValue:14,min:8,max:60,step:1},dotOpacity:{title:\"Opacity\",type:ControlType.Number,defaultValue:.85,min:0,max:1,step:.05}});export default DotPatternOverlay;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DotPatternOverlay\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DotPatternOverlay.map"],"mappings":"2MAAqK,SAAS,EAAkB,EAAM,CAAC,GAAK,CAAC,WAAS,qBAAqB,UAAQ,IAAI,aAAW,GAAG,aAAW,IAAI,SAAO,EAAY,EAAWA,EAAO,IAAI,EAAO,CAAC,EAAK,GAASC,EAAS,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAExW,CAAC,EAAS,GAAaA,EAAS,EAAK,EAEpC,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAa,EAAqBC,MAAgB,CAAC,IAAM,EAAG,EAAW,QAAQ,GAAG,CAAC,EAAG,OAAO,IAAI,EAAK,EAAG,cAAc,IAAI,IAAI,EAAE,EAAE,EAAE,IAAY,EAAT,IAAI,CAAgB,IAAM,EAAM,EAAO,iBAAiB,CAAI,EAGzP,IAH8P,EAAM,WAAW,UAAU,EAAM,WAAW,QAAQ,EAAM,YAAY,UAAU,EAAM,YAAY,WAE7V,EAAK,aAAa,KAAI,EAAK,MAAM,SAAS,WAC1C,EAAK,cAAc,IAAK,MAAO,EAAK,EAAK,aAAc,CAAC,EAAE,CAAC,CAAC,EAAQ,EAAYA,MAAgB,CAAC,IAAM,EAAG,EAAW,QAAQ,GAAG,CAAC,EAAG,OAAO,KAAK,IAAI,EAAK,EAAG,KAAM,GAAM,EAAK,eAAuC,GAAxB,EAAK,EAAK,cAAiB,EAAK,aAAa,KAAK,EAAK,cAAc,IAAK,OAAO,EAAO,OAAO,IAAK,EAAE,CAAC,CAAC,EAAQ,EAAWA,MAAgB,CAAC,IAAM,EAAG,EAAW,QAAQ,GAA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