{"version":3,"file":"Dvh.DWeNM-R0.mjs","names":["useRef","useCallback","useEffect","useLayoutEffect"],"sources":["https:/framerusercontent.com/modules/Wzu93mpSq4gZrk6ogv0C/ShAG88NvDcTwEpWnB4Tn/Dvh.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useLayoutEffect,useCallback,useRef}from\"react\";// Avoid server-side layout effects; the initial height stays 100dvh on both sides.\nconst useClientLayoutEffect=typeof window===\"undefined\"?useEffect:useLayoutEffect;const heightListeners=new Set;let stopHeightMonitor=()=>{};let latestHeight=null;function subscribeHeight(listener){if(typeof window===\"undefined\"||typeof document===\"undefined\"){return()=>{};}heightListeners.add(listener);if(heightListeners.size===1){const viewport=window.visualViewport;let frame=null;let timers=[];let active=true;latestHeight=null;const measure=()=>{frame=null;if(!active)return;const height=viewport?.height??window.innerHeight;if(!Number.isFinite(height)||height<=0||height===latestHeight)return;latestHeight=height;heightListeners.forEach(notify=>notify(height));};const schedule=()=>{if(active&&frame===null)frame=window.requestAnimationFrame(measure);};const recover=()=>{schedule();timers.forEach(timer=>window.clearTimeout(timer));// Safari may restore its toolbar after mount or back/forward navigation.\ntimers=[50,150,300,600,1e3].map(delay=>window.setTimeout(schedule,delay));};const onVisibility=()=>{if(!document.hidden)recover();};viewport?.addEventListener(\"resize\",schedule);window.addEventListener(\"resize\",schedule);window.addEventListener(\"pageshow\",recover);window.addEventListener(\"orientationchange\",recover);document.addEventListener(\"visibilitychange\",onVisibility);recover();stopHeightMonitor=()=>{active=false;if(frame!==null)window.cancelAnimationFrame(frame);timers.forEach(timer=>window.clearTimeout(timer));viewport?.removeEventListener(\"resize\",schedule);window.removeEventListener(\"resize\",schedule);window.removeEventListener(\"pageshow\",recover);window.removeEventListener(\"orientationchange\",recover);document.removeEventListener(\"visibilitychange\",onVisibility);latestHeight=null;};}else if(latestHeight!==null){listener(latestHeight);}let subscribed=true;return()=>{if(!subscribed)return;subscribed=false;heightListeners.delete(listener);if(heightListeners.size===0){stopHeightMonitor();stopHeightMonitor=()=>{};}};}function bindElementHeight(element){const style=element.style;const originalHeight=style.getPropertyValue(\"height\");const originalPriority=style.getPropertyPriority(\"height\");let appliedHeight=null;let active=true;const apply=height=>{if(!active)return;const value=height+\"px\";// Only the actual DOM element receives the measured height.\nif(style.getPropertyValue(\"height\")!==value){style.setProperty(\"height\",value);}appliedHeight=value;};const unsubscribe=subscribeHeight(apply);return{refresh(){if(latestHeight!==null)apply(latestHeight);},release(){if(!active)return;active=false;unsubscribe();// Restore only the inline height we still own, preserving other edits.\nif(appliedHeight!==null&&style.getPropertyValue(\"height\")===appliedHeight){if(originalHeight)style.setProperty(\"height\",originalHeight,originalPriority);else style.removeProperty(\"height\");}}};}/**\n * @framerDescription Applies visual viewport height directly to the layer DOM ref, with Safari refresh recovery.\n */export function withDynamicViewportHeight(Component){const Wrapped=/*#__PURE__*/forwardRef((props,ref)=>{const elementRef=useRef(null);const bindingRef=useRef(null);const forwardedCleanupRef=useRef(null);const setElement=useCallback(node=>{bindingRef.current?.release();bindingRef.current=null;// Some custom components expose an imperative handle instead of a DOM node.\nelementRef.current=node&&node.nodeType===1&&node.style?node:null;if(elementRef.current){bindingRef.current=bindElementHeight(elementRef.current);}// Preserve both object refs and callback refs, including React 19 cleanup.\nif(forwardedCleanupRef.current){forwardedCleanupRef.current();forwardedCleanupRef.current=null;}else if(node===null&&typeof ref===\"function\"){ref(null);}if(node!==null&&typeof ref===\"function\"){const cleanup=ref(node);if(typeof cleanup===\"function\"){forwardedCleanupRef.current=cleanup;}}else if(ref&&typeof ref!==\"function\"){ref.current=node;}},[ref]);useClientLayoutEffect(()=>{// Reconnect after Strict Mode's effect cleanup/setup cycle.\nif(elementRef.current&&!bindingRef.current){bindingRef.current=bindElementHeight(elementRef.current);}return()=>{bindingRef.current?.release();bindingRef.current=null;};},[]);useClientLayoutEffect(()=>{// Reapply after a parent-driven render if React changed the inline style.\nbindingRef.current?.refresh();});return /*#__PURE__*/_jsx(Component,{...props,ref:setElement,style:{...props.style,// Stable SSR/initial fallback; measured pixels never enter props.\nheight:\"100dvh\"}});});Wrapped.displayName=\"withDynamicViewportHeight(\"+(Component.displayName||Component.name||\"Component\")+\")\";return Wrapped;}/**\n * @framerDescription Applies height: 100lvh (Large Viewport Height) to the element. Uses the largest possible viewport size.\n * @param Component The component to wrap.\n * @returns A new component with the override applied.\n */export function withLargeViewportHeight(Component){return props=>{const combinedStyle={...props.style,height:\"100lvh\"};return /*#__PURE__*/_jsx(Component,{...props,style:combinedStyle});};}/**\n * @framerDescription Applies height: 100svh (Small Viewport Height) to the element. Uses the smallest possible viewport size, accounting for browser UI.\n * @param Component The component to wrap.\n * @returns A new component with the override applied.\n */export function withSmallViewportHeight(Component){return props=>{const combinedStyle={...props.style,height:\"100svh\"};return /*#__PURE__*/_jsx(Component,{...props,style:combinedStyle});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withDynamicViewportHeight\":{\"type\":\"reactHoc\",\"name\":\"withDynamicViewportHeight\",\"annotations\":{\"framerDescription\":\"Applies visual viewport height directly to the layer DOM ref, with Safari refresh recovery.\",\"framerContractVersion\":\"1\"}},\"withSmallViewportHeight\":{\"type\":\"reactHoc\",\"name\":\"withSmallViewportHeight\",\"annotations\":{\"framerDescription\":\"Applies height: 100svh (Small Viewport Height) to the element. Uses the smallest possible viewport size, accounting for browser UI.\",\"framerContractVersion\":\"1\"}},\"withLargeViewportHeight\":{\"type\":\"reactHoc\",\"name\":\"withLargeViewportHeight\",\"annotations\":{\"framerDescription\":\"Applies height: 100lvh (Large Viewport Height) to the element. Uses the largest possible viewport size.\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Dvh.map"],"mappings":"4JACmK,SAAS,EAAgB,EAAS,CAAC,GAAU,IAAS,QAAa,OAAO,SAAW,IAAa,UAAU,CAAC,EAAiC,GAA9B,EAAgB,IAAI,CAAQ,EAAK,EAAgB,OAAO,EAAE,CAAC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