{"version":3,"file":"KMScrollFix.DFkBfe3Z.mjs","names":[],"sources":["https:/framerusercontent.com/modules/gLs0GDz6O4APO3qLrfxR/8QFl6G5TsF8olxnFrVe7/KMScrollFix.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";/**\n * Kältemeister – KMScrollFix V1 (unsichtbare Hilfsebene)\n * Nach dem Absenden ersetzen Klimaplaner, Wartungsplaner und Kontaktformular ihre lange Ansicht durch einen kurzen Danke-Block;\n * die Seite wird kürzer und der Browser bleibt im Footer stehen. Dieser Helfer beobachtet das DOM und scrollt beim Erscheinen\n * von .kw-done / .kp-done / .ks-sent zur zugehörigen Karte. Einmal pro Seite einsetzen (Höhe 1px, keine Optik).\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function KMScrollFix(){React.useEffect(()=>{if(typeof window===\"undefined\"||typeof MutationObserver===\"undefined\")return;const reduced=window.matchMedia&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;const TARGETS=\".kw-done, .kp-done, .ks-sent, .kw-step, .kp-step\";let last=0;const scrollTo=el=>{const now=Date.now();if(now-last<400)return;last=now;const card=el.closest(\".kw-card, .kp-card, .ks-formwrap\")||el;const top=card.getBoundingClientRect().top+window.scrollY-110;try{window.scrollTo({top:Math.max(0,top),behavior:reduced?\"auto\":\"smooth\"});}catch(e){window.scrollTo(0,Math.max(0,top));}};const obs=new MutationObserver(muts=>{for(const m of muts)for(const n of Array.from(m.addedNodes)){if(!(n instanceof Element))continue;const hit=n.matches(TARGETS)?n:n.querySelector(TARGETS);if(!hit)continue;// Nur reagieren, wenn die Karte gerade nicht sichtbar ist (z. B. nach dem Absenden weit unten)\nconst card=hit.closest(\".kw-card, .kp-card, .ks-formwrap\")||hit;const r=card.getBoundingClientRect();if(r.top<0||r.top>window.innerHeight*.6)scrollTo(hit);}});obs.observe(document.body,{childList:true,subtree:true});return()=>obs.disconnect();},[]);return /*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1,opacity:0,pointerEvents:\"none\"},\"aria-hidden\":\"true\"});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"KMScrollFix\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./KMScrollFix.map"],"mappings":"2HAOG,SAAwB,GAAa,CACiN,OADhN,MAAoB,CAAC,GAAU,IAAS,QAAa,OAAO,iBAAmB,IAAY,OAAO,IAAM,EAAQ,EAAO,YAAY,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAc,EAAQ,mDAAuD,EAAK,EAAQ,EAAS,GAAI,CAAC,IAAM,EAAI,KAAK,IAAI,EAAE,GAAG,EAAI,EAAK,IAAI,OAAO,EAAK,EAAkE,IAAM,GAAzD,EAAG,QAAQ,kCAAkC,GAAG,EAAA,CAAkB,sBAAsB,CAAC,CAAC,IAAI,EAAO,QAAQ,IAAI,GAAG,CAAC,EAAO,SAAS,CAAC,IAAI,KAAK,IAAI,EAAE,CAAG,EAAE,SAAS,EAAQ,OAAO,QAAQ,CAAC,CAAE,MAAS,CAAC,EAAO,SAAS,EAAE,KAAK,IAAI,EAAE,CAAG,CAAC,CAAE,CAAC,EAAQ,EAAI,IAAI,iBAAiB,GAAM,CAAC,IAAI,IAAM,KAAK,EAAK,IAAI,IAAM,KAAK,MAAM,KAAK,EAAE,UAAU,EAAE,CAAC,GAAG,EAAE,aAAa,SAAS,SAAS,IAAM,EAAI,EAAE,QAAQ,CAAO,EAAE,EAAE,EAAE,cAAc,CAAO,EAAE,GAAG,CAAC,EAAI,SAC9vB,IAAM,GAA3D,EAAI,QAAQ,kCAAkC,GAAG,EAAA,CAAiB,sBAAsB,GAAK,EAAE,IAAI,GAAG,EAAE,IAAI,EAAO,YAAY,KAAG,EAAS,CAAG,CAAE,CAAC,CAAC,EAA2D,OAAzD,EAAI,QAAQ,SAAS,KAAK,CAAC,UAAU,GAAK,QAAQ,EAAI,CAAC,MAAY,EAAI,WAAW,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,MAAM,EAAE,cAAc,MAAM,CAAC,CAAE,qBAR9T,IAA4B"}