{"version":3,"file":"Iframe_resize.COUgFSRN.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/Ub9LX6UJ0yzCeUM6zdrh/Rt0CXarCHDUBdyPLMJPZ/Iframe_resize.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\"});export function withRotate(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{rotate:90},transition:{duration:2}});});}export function withHover(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,whileHover:{scale:1.05}});});}export function withRandomColor(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});});}export function ResizeIframe(){return{onMount(element){const handleMessage=event=>{// Optional: Verify the origin of the message for security\n// if (event.origin !== \"https://your-embedded-site.com\") return;\nif(event.data.type===\"resize\"){// Find the actual iframe element within the Framer component\nconst iframe=element.querySelector(\"iframe\");if(iframe){iframe.style.height=`${event.data.value}px`;}}};// Add event listener for messages from the iframe\nwindow.addEventListener(\"message\",handleMessage,false);// Clean up the event listener when the component unmounts\nreturn()=>{window.removeEventListener(\"message\",handleMessage);};}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withResizeIframe(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ResizeIframe(props)});};}withResizeIframe.displayName=\"ResizeIframe\";\nexport const __FramerMetadata__ = {\"exports\":{\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withResizeIframe\":{\"type\":\"reactHoc\",\"name\":\"withResizeIframe\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ResizeIframe\":{\"type\":\"override\",\"name\":\"ResizeIframe\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Iframe_resize.map"],"mappings":"gPACgqB,SAAgB,GAAc,CAAC,MAAM,CAAC,QAAQ,EAAQ,CAAC,IAAM,EAAc,GAAO,CAElvB,GAAG,EAAM,KAAK,OAAO,SAAS,CAC9B,IAAM,EAAO,EAAQ,cAAc,SAAS,CAAI,IAAQ,EAAO,MAAM,OAAO,GAAG,EAAM,KAAK,MAAM,OAEhG,OADA,EAAO,iBAAiB,UAAU,EAAc,GAAM,KAC5C,CAAC,EAAO,oBAAoB,UAAU,EAAc,GAAK,CAAqJ,SAAgB,EAAiB,EAAE,CAAC,MAAO,KAAQ,EAA+BA,EAAwC,CAAQC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAa,EAAM,CAAC,CAAC,uBANxV,IAA8B,IAAqE,IAAqE,IAMK,CALzM,EAAY,CAAC,WAAW,UAAU,CAAC,CAKqV,EAAiB,YAAY"}