{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/useIsomorphicLayoutEffect.js@^0.2.0", "ssg:https://framer.com/m/framer/useMeasuredSize.js"],
  "sourcesContent": ["import{useLayoutEffect,useEffect}from\"react\";/**\n * Swaps `useLayoutEffect` for `useEffect` on the server to avoid React warnings.\n * NOTE! The effect won't run on the server.\n */ export const useIsomorphicLayoutEffect=typeof document!==\"undefined\"?useLayoutEffect:useEffect;\nexport const __FramerMetadata__ = {\"exports\":{\"useIsomorphicLayoutEffect\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./useIsomorphicLayoutEffect.map", "import*as React from\"react\";import{useIsomorphicLayoutEffect}from\"https://framer.com/m/framer/useIsomorphicLayoutEffect.js@^0.2.0\";let safeResizeObserver=undefined;try{if(typeof window!==undefined){safeResizeObserver=window.ResizeObserver;}}catch(e){// happy linting!\n}class SharedObserver{//@ts-ignore\nupdateResizedElements(entries){for(const entry of entries){const callbackForElement=this.callbacks.get(entry.target);if(callbackForElement)callbackForElement(entry.contentRect);}}observeElementWithCallback(element,callback){if(!this.sharedResizeObserver)return;this.sharedResizeObserver.observe(element);this.callbacks.set(element,callback);}unobserve(element){if(!this.sharedResizeObserver)return;this.sharedResizeObserver.unobserve(element);this.callbacks.delete(element);}constructor(){this.callbacks=new WeakMap();const ResizeObserver1=safeResizeObserver;if(!ResizeObserver1)return;this.sharedResizeObserver=new ResizeObserver1(this.updateResizedElements.bind(this));}}const sharedResizeObserver=new SharedObserver();/**\n * Uses a globally shared resize observer, and returns an updated\n * size object when the element's size changes. This is the recommended way to\n * use a Resize Observer: https://github.com/WICG/resize-observer/issues/59.\n */ export function useMeasuredSize(ref,callback){const[size,setSize]=React.useState(null);function updateSize(newSize){if(!size||newSize.height!==size.height||newSize.width!==size.width){if(callback)callback(newSize);setSize({width:newSize.width,height:newSize.height});}}// On mount, immediately measure and set a size. This will defer paint until\n// no more updates are scheduled. Additionally add our element to the shared\n// ResizeObserver with a callback to perform when the element resizes.\n// Finally, remove the element from the observer when the component is unmounted.\nuseIsomorphicLayoutEffect(()=>{if(!ref.current)return;const{offsetWidth,offsetHeight}=ref.current;// Defer paint until initial size is added.\nupdateSize({width:offsetWidth,height:offsetHeight});// Resize observer will race to add the initial size, but since the size\n// is set above, it won't trigger a render on mount since it should\n// match the measured size. Future executions of the callback will\n// trigger renders if the size changes.\nsharedResizeObserver.observeElementWithCallback(ref.current,updateSize);return()=>{if(!ref.current)return;sharedResizeObserver.unobserve(ref.current);};},[]);return size;}export function useSizeChange(ref,callback){const size=React.useRef(null);const updateSize=React.useCallback(newSize=>{if(!size.current||newSize.height!==size.current.height||newSize.width!==size.current.width){size.current={width:newSize.width,height:newSize.height};if(callback)callback(size.current);}},[callback]);// On mount, immediately measure and set a size. This will defer paint until\n// no more updates are scheduled. Additionally add our element to the shared\n// ResizeObserver with a callback to perform when the element resizes.\n// Finally, remove the element from the observer when the component is unmounted.\nuseIsomorphicLayoutEffect(()=>{if(!ref.current)return;const{offsetWidth,offsetHeight}=ref.current;// Defer paint until initial size is added.\nupdateSize({width:offsetWidth,height:offsetHeight});// Resize observer will race to add the initial size, but since the size\n// is set above, it won't trigger a render on mount since it should\n// match the measured size. Future executions of the callback will\n// trigger renders if the size changes.\nsharedResizeObserver.observeElementWithCallback(ref.current,updateSize);return()=>{if(!ref.current)return;sharedResizeObserver.unobserve(ref.current);};},[callback]);return null;}\nexport const __FramerMetadata__ = {\"exports\":{\"useSizeChange\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useMeasuredSize\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./useMeasuredSize.map"],
  "mappings": "gGAGW,IAAMA,EAA0B,OAAO,SAAW,IAAYC,EAAgBC,ECH0C,IAAIC,EAA6B,GAAG,CAAI,OAAOC,IAAS,SAAWD,EAAmBC,EAAO,eAAgB,MAAC,CACjP,CAAC,IAAMC,EAAN,K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haredObserver", "entries", "entry", "callbackForElement", "element", "callback", "ResizeObserver1", "sharedResizeObserver", "useMeasuredSize", "ref", "size", "setSize", "ye", "updateSize", "newSize", "useIsomorphicLayoutEffect", "offsetWidth", "offsetHeight"]
}
