{"version":3,"file":"PartialContainer.BqBhlQ8v.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\":{\"framerContractVers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