{"version":3,"file":"OverlayScroll.CgpWS2vy.mjs","names":["useRef","useCallback","forwardRef","useEffect","_jsx","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","ce","init_jsx_runtime","ne","J","de","window","RenderTarget","init_framer_ChujFWHC","useMergedRef","forwarded","local","node","withOverlayWheelScroll","Component","props","forwardedRef","setRef","onWheel","event","target","c","init_OverlayScroll"],"sources":["https:/framerusercontent.com/modules/OoEeYhqzSZbbTpR4wMIU/LWDXgUgfccU862RK9AKd/OverlayScroll.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useRef}from\"react\";import{RenderTarget}from\"framer\";/**\n * OVERLAY SCROLLING\n *\n * Framer's overlay lock attaches a `wheel` listener high up the capture chain\n * and calls preventDefault() on it, so the page behind can't scroll while an\n * overlay is open. The side effect is that a scroll container INSIDE the\n * overlay stops responding to the wheel too: its scrollbar still drags (that's\n * a pointer interaction, untouched) but the wheel is dead.\n *\n * Apply `withOverlayWheelScroll` to the scroll container inside the overlay —\n * the layer with overflow: scroll and a bounded height.\n *\n * This is not specific to any one overlay. Any scroll container inside any\n * Framer overlay will hit the same problem, and this fixes all of them.\n */// Merge our own node reference with whatever ref Framer passes down.\nfunction useMergedRef(forwarded){const local=useRef(null);const setRef=useCallback(node=>{local.current=node;if(typeof forwarded===\"function\")forwarded(node);else if(forwarded&&typeof forwarded===\"object\")forwarded.current=node;},[forwarded]);return[local,setRef];}/**\n * Keeps native scrolling — momentum, smoothness and trackpad feel are all\n * preserved, because we never touch the default action. We only stop the event\n * from travelling far enough down the capture chain for Framer's overlay lock\n * to preventDefault it.\n *\n * Registered on `window` in the capture phase, which fires before any listener\n * on document or on the overlay element itself.\n */export function withOverlayWheelScroll(Component){return /*#__PURE__*/forwardRef((props,forwardedRef)=>{const[local,setRef]=useMergedRef(forwardedRef);useEffect(()=>{// No-op on the canvas; runs in preview and on the published site.\nif(RenderTarget.current()===RenderTarget.canvas)return;const node=local.current;if(!node)return;const onWheel=event=>{const target=event.target;if(!target||!node.contains(target))return;// Do NOT preventDefault — the browser's own scrolling is what\n// we want. Just make sure the lock handler never sees this.\nevent.stopPropagation();};window.addEventListener(\"wheel\",onWheel,{capture:true,passive:true});return()=>window.removeEventListener(\"wheel\",onWheel,{capture:true});},[]);return /*#__PURE__*/_jsx(Component,{ref:setRef,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withOverlayWheelScroll\":{\"type\":\"reactHoc\",\"name\":\"withOverlayWheelScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OverlayScroll.map"],"mappings":"A,kMAeA,SAASgB,EAAaC,EAAU,CAAC,IAAMC,EAAMlB,EAAO,IAAI,EAA2L,MAAM,CAACkB,EAAnLjB,EAAYkB,GAAM,CAACD,EAAM,QAAQC,EAAQ,OAAOF,GAAY,WAAWA,EAAUE,CAAI,EAAUF,GAAW,OAAOA,GAAY,WAASA,EAAU,QAAQE,EAAK,EAAE,CAACF,CAAS,CAAqB,CAAC,CAAE,CAQrQ,SAAgBG,EAAuBC,EAAU,CAAC,MAAoBnB,iBAAYoB,EAAMC,IAAe,CAAC,GAAK,CAACL,EAAMM,GAAQR,EAAaO,CAAY,EAGkB,OAHhBpB,MAAc,CACxK,GAAGW,EAAa,QAAQ,IAAIA,EAAa,OAAO,OAAO,IAAMK,EAAKD,EAAM,QAAQ,GAAG,CAACC,EAAK,OAAO,IAAMM,EAAQC,GAAO,CAAC,IAAMC,EAAOD,EAAM,OAAWC,GAASR,EAAK,SAASQ,CAAM,GAEjLD,EAAM,gBAAgB,CAAE,EAAuE,OAArEb,EAAO,iBAAiB,QAAQY,EAAQ,CAAC,QAAQ,GAAK,QAAQ,EAAI,CAAC,MAAYZ,EAAO,oBAAoB,QAAQY,EAAQ,CAAC,QAAQ,EAAI,CAAC,CAAE,EAAE,CAAC,CAAC,EAAsBrB,gBAAKiB,EAAU,CAAC,IAAIG,EAAO,GAAGF,CAAK,CAAC,CAAE,CAAC,CAAE,C"}