{"version":3,"file":"FOUCFix.D6pJ8OYB.mjs","names":[],"sources":["https:/framerusercontent.com/modules/q35IXHgxPsO89EmCwh8J/3TjDJpYwTjA1e8R0p8Dg/FOUCFix.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * FOUCFix — prevents the brief flash of desktop-width layout that happens on\n * mobile while Framer's client JS hydrates and applies responsive styles.\n *\n * How it works:\n *   1. Renders an inline <style> tag. Because it's part of the SSR'd HTML,\n *      the CSS rule applies on the very first paint — before any JS runs.\n *   2. The rule hides <body> on narrow viewports until <html> gets the\n *      data-framer-ready attribute.\n *   3. On mount (after React hydrates and the responsive layout has settled),\n *      useEffect adds that attribute, fading the page in.\n *   4. A failsafe timer guarantees the page is never stuck invisible if\n *      hydration is slow or something goes wrong.\n *\n * Drop one instance on each page. Renders nothing visible.\n *\n * NOTE: failsafeMs was previously fixed at 800ms. On heavier pages (video,\n * embeds, sticky sections) mobile hydration can take longer than that, so the\n * failsafe was firing BEFORE the responsive layout had actually settled —\n * revealing a moment of desktop-shaped layout that then visibly snapped into\n * the mobile layout once hydration caught up a beat later. Raising the\n * default gives slower pages enough headroom to settle before the failsafe\n * ever has to step in; fast pages still reveal immediately via the RAF path\n * and never wait for the failsafe at all.\n */export default function FOUCFix(props){const{breakpoint=809,fadeMs=150,failsafeMs=2200}=props;useEffect(()=>{if(typeof document===\"undefined\")return;let revealed=false;const reveal=()=>{if(revealed)return;revealed=true;document.documentElement.setAttribute(\"data-framer-ready\",\"true\");};// Two RAFs: first lets Framer commit its responsive layout pass,\n// second guarantees the browser has painted that pass before we\n// unhide. This eliminates the visible jump on the common/fast path.\nconst raf1=requestAnimationFrame(()=>{requestAnimationFrame(reveal);});// Belt-and-suspenders: also reveal once the window has fully loaded\n// (images/video/fonts settled), in case RAF fired before layout was\n// truly final on a slow connection.\nconst onLoad=()=>reveal();if(document.readyState===\"complete\"){// already loaded by the time we mounted\n}else{window.addEventListener(\"load\",onLoad,{once:true});}// Failsafe: if nothing else has revealed the page yet, force it so\n// the page is never stuck invisible.\nconst timeout=window.setTimeout(reveal,failsafeMs);return()=>{cancelAnimationFrame(raf1);window.removeEventListener(\"load\",onLoad);window.clearTimeout(timeout);};},[failsafeMs]);const css=`\n@media (max-width: ${breakpoint}px) {\n    html:not([data-framer-ready]) body {\n        opacity: 0 !important;\n    }\n    html[data-framer-ready] body {\n        opacity: 1;\n        transition: opacity ${fadeMs}ms ease-out;\n    }\n}\n`.trim();return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{width:0,height:0,overflow:\"hidden\",position:\"absolute\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:css}})});}addPropertyControls(FOUCFix,{breakpoint:{type:ControlType.Number,title:\"Breakpoint\",defaultValue:809,min:320,max:1200,step:1,description:\"Apply only at viewports ≤ this width (px).\"},fadeMs:{type:ControlType.Number,title:\"Fade (ms)\",defaultValue:150,min:0,max:600,step:10,description:\"Fade-in duration once layout is ready.\"},failsafeMs:{type:ControlType.Number,title:\"Failsafe (ms)\",defaultValue:2200,min:400,max:4e3,step:100,description:\"Force-reveal after this long even if hydration/load hasn't signaled ready. Raise this if heavy pages (video, embeds) still show a desktop→mobile snap; lower it if the fade-in itself feels delayed on fast connections.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FOUCFix\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FOUCFix.map"],"mappings":"mLAwBG,SAAwB,EAAQ,EAAM,CAAC,GAAK,CAAC,aAAW,IAAI,SAAO,IAAI,aAAW,MAAM,EAmBlF,OAnBwF,MAAc,CAAC,GAAG,OAAO,SAAW,IAAY,OAAO,IAAI,EAAS,GAAY,MAAW,CAAI,IAAgB,EAAS,GAAK,SAAS,gB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