{"version":3,"file":"Layout_Jump.DkGc0oij.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/Dd9HFQFdk17XH5pTkpyZ/B7Ntb7ZBuot0eBT8Cs9U/Layout_Jump.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n */export default function AvoidLayoutJumping({direction,...props}){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=useRef(null);const rafId=useRef(null);const timeoutId=useRef(null);const vertical=direction===\"vertical\"||direction===\"both\";const horizontal=direction===\"horizontal\"||direction===\"both\";useEffect(()=>{if(isCanvas)return;const parent=ref.current?.parentElement?.parentElement;if(!parent)return;const container=parent.parentElement;if(!container)return;const observer=new ResizeObserver(()=>onResize());observer.observe(parent);const updateSize=()=>{const{width,height}=parent.getBoundingClientRect();if(horizontal){container.style.width=`${width}px`;}if(vertical){container.style.height=`${height}px`;}rafId.current=requestAnimationFrame(()=>updateSize());};const stopTimers=()=>{if(rafId.current)cancelAnimationFrame(rafId.current);if(timeoutId.current)clearTimeout(timeoutId.current);};const onResize=()=>{stopTimers();timeoutId.current=setTimeout(()=>stopTimers(),1e3)// Timeout needs to be at least the animation\n;updateSize();};return()=>{stopTimers();if(horizontal)container.style.width=\"\";if(vertical)container.style.height=\"\";observer.disconnect();};},[]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,...props,\"aria-hidden\":\"true\"});}AvoidLayoutJumping.displayName=\"Layout Jump Preventer\";addPropertyControls(AvoidLayoutJumping,{direction:{type:ControlType.Enum,defaultValue:\"vertical\",options:[\"vertical\",\"horizontal\",\"both\"],optionTitles:[\"Vertical\",\"Horizontal\",\"Both\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\",optionIcons:[\"direction-vertical\",\"direction-horizontal\",\"direction-all\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AvoidLayoutJumping\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Layout_Jump.map"],"mappings":"wLAIG,SAAwB,EAAmB,CAAC,YAAU,GAAG,GAAO,CAAC,IAAM,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAa,EAAIA,EAAO,IAAI,EAAQ,EAAMA,EAAO,IAAI,EAAQ,EAAUA,EAAO,IAAI,EAAQ,EAAS,IAAY,YAAY,IAAY,OAAa,EAAW,IAAY,cAAc,IAAY,OAC3K,OADkL,MAAc,CAAC,GAAG,EAAS,OAAO,IAAM,EAAO,EAAI,SAAS,eAAe,cAAc,GAAG,CAAC,EAAO,OAAO,IAAM,EAAU,EAAO,cAAc,GAAG,CAAC,EAAU,OAAO,IAAM,EAAS,IAAI,mBAAmB,EAAS,CAAC,EAAE,EAAS,QAAQ,CAAM,EAAE,IAAM,MAAe,CAAC,GAAK,CAAC,QAAM,UAAQ,EAAO,sBAAsB,EAAK,IAAY,EAAU,MAAM,MAAM,GAAG,EAAM,KAAQ,IAAU,EAAU,MAAM,OAAO,GAAG,EAAO,KAAK,EAAM,QAAQ,0BAA0B,EAAW,CAAC,CAAE,EAAQ,MAAe,CAAI,EAAM,SAAQ,qBAAqB,EAAM,OAAO,EAAK,EAAU,SAAQ,aAAa,EAAU,OAAO,CAAE,EAAQ,MAAa,CAAC,EAAW,EAAE,EAAU,QAAQ,eAAe,EAAW,EAAE,GAAG,EAC/+B,EAAW,CAAE,EAAE,UAAU,CAAC,EAAW,EAAK,IAAW,EAAU,MAAM,MAAM,IAAM,IAAS,EAAU,MAAM,OAAO,IAAG,EAAS,WAAW,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,MAAM,CAAK,MA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