{"version":3,"file":"AutoResize.DMbcJgKx.mjs","names":[],"sources":["https:/framerusercontent.com/modules/6HygQKYDEflwxze69Wcf/kPjtdoNFXVMZSbiFOUT0/AutoResize.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";addPropertyControls(AutoResize,{postMessageTypeName:{type:ControlType.String,title:\"postMessage Type Name\"}});export default function AutoResize(props){if(typeof window===\"undefined\")return /*#__PURE__*/_jsx(\"div\",{});useEffect(()=>{let timeoutId=null;const updateHeight=()=>{const height=document.documentElement.getBoundingClientRect().height;window.parent.postMessage({type:props.postMessageTypeName,height},\"*\");console.log(\"sent a message to window.\");console.log(height);};const debouncedUpdateHeight=()=>{clearTimeout(timeoutId);timeoutId=setTimeout(updateHeight,1)// 200ms 안에 여러 번 resize 발생해도 마지막 한 번만 실행\n;};// 초기 한 번 실행\nsetTimeout(updateHeight,300);const resizeObserver=new ResizeObserver(debouncedUpdateHeight);resizeObserver.observe(document.documentElement);return()=>{resizeObserver.disconnect();clearTimeout(timeoutId);};},[]);return /*#__PURE__*/_jsx(\"div\",{});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AutoResize\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AutoResize.map"],"mappings":"0SAA0O,SAAwB,EAAW,EAAM,CAE/D,OAF0E,IAAS,QAA+C,MAAc,CAAC,IAAI,EAAU,KAAW,MAAiB,CAAC,IAAM,EAAO,SAAS,gBAAgB,uBAAuB,CAAC,OAAO,EAAO,OAAO,YAAY,CAAC,KAAK,EAAM,oBAAoB,SAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,4BAA4B,CAAC,QAAQ,IAAI,EAAO,EAAS,MAA0B,CAAC,aAAa,EAAU,CAAC,EAAU,WAAW,EAAa,EAAE,EAExrB,WAAW,EAAa,IAAI,CAAC,IAAM,EAAe,IAAI,eAAe,EAAsB,CAAkD,OAAjD,EAAe,QAAQ,SAAS,gBAAgB,KAAW,CAAC,EAAe,YAAY,CAAC,aAAa,EAAU,GAAK,EAAE,CAAC,CAFoH,EAAK,MAAM,EAAE,CAAC,sBAA1S,IAA6B,IAAoD,GAAoB,EAAW,CAAC,oBAAoB,CAAC,KAAK,EAAY,OAAO,MAAM,wBAAwB,CAAC,CAAC"}