{"version":3,"file":"LocaleeScrollOverrides.A4Azs05E.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/K69Ru0IcB00EHw1GX4qg/1I6bHud2GbvDDQ61CCKy/LocaleeScrollOverrides.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";const SETTLE_DELAY=160;const MAJOR_SHRINK_RATIO=.5;/**\n * Holt eine Komponente zurueck in den Sichtbereich, wenn sie stark zusammenklappt.\n * Gedacht fuer Formulare, die nach dem Absenden auf eine kompakte Success-Variante wechseln:\n * die Oberkante bleibt im Dokument stehen, der Nutzer schaut danach aber auf den Inhalt darunter.\n */export function withRevealOnCollapse(Component){return props=>{const ref=useRef(null);useEffect(()=>{const element=ref.current;if(!element)return;if(typeof window===\"undefined\")return;if(typeof ResizeObserver===\"undefined\")return;let baselineHeight=element.getBoundingClientRect().height;let settleTimer=null;function settle(){settleTimer=null;if(!element||!element.isConnected)return;const rect=element.getBoundingClientRect();const previousHeight=baselineHeight;baselineHeight=rect.height;if(previousHeight<=0)return;if((previousHeight-rect.height)/previousHeight<MAJOR_SHRINK_RATIO)return;if(rect.top>=0)return;const margin=Math.max(24,Math.min(160,(window.innerHeight-rect.height)/3));const reduceMotion=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;window.scrollTo({top:Math.max(0,window.scrollY+rect.top-margin),behavior:reduceMotion?\"auto\":\"smooth\"});}const observer=new ResizeObserver(()=>{if(settleTimer!==null)window.clearTimeout(settleTimer);settleTimer=window.setTimeout(settle,SETTLE_DELAY);});observer.observe(element);return()=>{observer.disconnect();if(settleTimer!==null)window.clearTimeout(settleTimer);};},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withRevealOnCollapse\":{\"type\":\"reactHoc\",\"name\":\"withRevealOnCollapse\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingUR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