{"version":3,"file":"PartialContainer.BM3Nbop0.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/0LIpg0HLKIhGtcwxVRw5/ZxA9NSflb4UcFP84hCwt/PartialContainer.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef,useImperativeHandle}from\"react\";export function withIframeEventHandlers(Component,opts={}){const{rootSelector='[data-framer-name=\"mito-content\"]'}=opts;return /*#__PURE__*/forwardRef((props,ref)=>{const innerRef=useRef(null);const lastHeightRef=useRef(-1);// Keep embed seamless\nuseEffect(()=>{document.documentElement.style.margin=\"0\";document.body.style.margin=\"0\";document.body.style.overflow=\"hidden\";},[]);const getRoot=()=>document.querySelector(rootSelector)??innerRef.current??document.body;const computeHeight=()=>{const root=getRoot();if(!root)return 0;const rect=Math.ceil(root.getBoundingClientRect().height||0);return rect;};const sendSize=()=>{const h=computeHeight();if(h!==lastHeightRef.current&&h>=0){lastHeightRef.current=h;window.parent?.postMessage({type:\"mito-embed-size\",height:h},\"*\");}};useEffect(()=>{// Initial double tick to capture late layout\nconst raf1=requestAnimationFrame(()=>{sendSize();requestAnimationFrame(sendSize);});// Respond to parent requests\nconst onMessage=e=>{if(e?.data?.type===\"mito-embed-get-size\")sendSize();};window.addEventListener(\"message\",onMessage);// Window changes\nconst onResize=()=>requestAnimationFrame(sendSize);window.addEventListener(\"load\",onResize);window.addEventListener(\"resize\",onResize);// Observe only the root container\nconst root=getRoot();const ro=new ResizeObserver(()=>sendSize());if(root)ro.observe(root);return()=>{cancelAnimationFrame(raf1);window.removeEventListener(\"message\",onMessage);window.removeEventListener(\"load\",onResize);window.removeEventListener(\"resize\",onResize);ro.disconnect();};},[rootSelector]);useImperativeHandle(ref,()=>innerRef.current);return /*#__PURE__*/_jsx(Component,{ref:innerRef,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withIframeEventHandlers\":{\"type\":\"reactHoc\",\"name\":\"withIframeEventHandlers\",\"annotations\":{\"framerContractVersion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