{"version":3,"file":"LoadingScreen.gvDd8PhT.mjs","names":["useState","useRef","p"],"sources":["https:/framerusercontent.com/modules/6zkqxbqg1euB56d9o8rb/xAqvzMeWrQt1tks4RRoo/LoadingScreen.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";// Libre Caslon Display — Google Font\nconst FONT_IMPORT=\"https://fonts.googleapis.com/css2?family=Libre+Caslon+Display&display=swap\";/**\n * LoadingScreen V4.4 — Scramble fix\n * Scramble now stays in the 90s range so it never reads as a drop to 0%.\n * All other behaviour identical to V4.3.\n */export default function LoadingScreen(){const[progress,setProgress]=useState(0);const[visible,setVisible]=useState(true);const[phase,setPhase]=useState(\"loading\");const[logoFlipped,setLogoFlipped]=useState(false);const[scramble,setScramble]=useState(null);const progressRef=useRef(0);const targetRef=useRef(0);const rafRef=useRef(0);const doneRef=useRef(false);const framesLoadedRef=useRef(0);// Inject global styles + font\nuseEffect(()=>{if(typeof document===\"undefined\")return;const id=\"gg-global-bg\";if(!document.getElementById(id)){const style=document.createElement(\"style\");style.id=id;style.textContent=`html,body{background-color:#050505!important;}`;document.head.appendChild(style);}const fontId=\"gg-caslon-font\";if(!document.getElementById(fontId)){const link=document.createElement(\"link\");link.id=fontId;link.rel=\"stylesheet\";link.href=FONT_IMPORT;document.head.appendChild(link);}},[]);useEffect(()=>{if(typeof window===\"undefined\")return;try{if(sessionStorage.getItem(\"gg-loaded\")){setVisible(false);window.dispatchEvent(new CustomEvent(\"loaderComplete\"));return;}}catch(e){}if(!visible)return;const startTime=Date.now();const originalOverflow=document.body.style.overflow;document.body.style.overflow=\"hidden\";const ready={fonts:false,document:false,frames:false};const MIN_DISPLAY_MS=2e3;const REQUIRED_FRAMES=10;const animateProgress=()=>{const current=progressRef.current;const target=targetRef.current;if(current<target){const diff=target-current;const speed=diff>20?.06:diff>5?.04:.025;progressRef.current=Math.min(current+Math.max(diff*speed,.15),target);setProgress(Math.round(progressRef.current));}rafRef.current=requestAnimationFrame(animateProgress);};rafRef.current=requestAnimationFrame(animateProgress);const updateTarget=()=>{if(doneRef.current)return;let p=0;if(ready.fonts)p+=20;if(ready.document)p+=20;const frameProgress=Math.min(framesLoadedRef.current/REQUIRED_FRAMES,1);p+=Math.floor(frameProgress*40);const elapsed=Date.now()-startTime;p=Math.max(p,Math.floor(Math.min(elapsed/6e3,1)*15));targetRef.current=Math.min(p,95);if(ready.fonts&&ready.document&&ready.frames)finishLoading();};const finishLoading=()=>{if(doneRef.current)return;doneRef.current=true;targetRef.current=100;const elapsed=Date.now()-startTime;const remaining=Math.max(0,MIN_DISPLAY_MS-elapsed);setTimeout(()=>{cancelAnimationFrame(rafRef.current);progressRef.current=100;setProgress(100);setLogoFlipped(true);setTimeout(()=>{setPhase(\"static\");// Scramble stays in the high 90s so it never looks like a drop to 0%,\n// and always resolves back to 100 when finished.\nlet scrambleFrame=0;const doScramble=()=>{scrambleFrame++;setScramble(90+Math.floor(Math.random()*10))// 90–99\n;if(scrambleFrame<12)requestAnimationFrame(doScramble);else setScramble(null)// null → render falls back to progress (100)\n;};requestAnimationFrame(doScramble);setTimeout(()=>{document.body.style.overflow=originalOverflow;setPhase(\"exiting\");try{sessionStorage.setItem(\"gg-loaded\",\"1\");}catch(e){}window.dispatchEvent(new CustomEvent(\"loaderComplete\"));setTimeout(()=>{setVisible(false);setPhase(\"done\");},1500);},350);},750);},remaining+400);};if(document.fonts&&document.fonts.ready){document.fonts.ready.then(()=>{ready.fonts=true;updateTarget();}).catch(()=>{ready.fonts=true;updateTarget();});}else{setTimeout(()=>{ready.fonts=true;updateTarget();},1500);}const checkDoc=()=>{if(document.readyState===\"complete\"){setTimeout(()=>{ready.document=true;updateTarget();},200);}};if(document.readyState===\"complete\")checkDoc();else window.addEventListener(\"load\",checkDoc);const onFrameReady=()=>{framesLoadedRef.current++;if(framesLoadedRef.current>=REQUIRED_FRAMES)ready.frames=true;updateTarget();};window.addEventListener(\"gg:frameReady\",onFrameReady);const frameTimeout=setTimeout(()=>{if(!ready.frames){ready.frames=true;updateTarget();}},6e3);const interval=setInterval(updateTarget,200);const maxTimer=setTimeout(finishLoading,1e4);return()=>{clearTimeout(maxTimer);clearTimeout(frameTimeout);clearInterval(interval);cancelAnimationFrame(rafRef.current);window.removeEventListener(\"gg:frameReady\",onFrameReady);document.body.style.overflow=originalOverflow;};},[visible]);if(!visible)return null;const isExiting=phase===\"exiting\";const isStatic=phase===\"static\";const backdropFilter=isExiting?\"blur(0px) brightness(1) saturate(1)\":\"blur(22px) brightness(1.6) saturate(0.4)\";const bgColor=isExiting?\"rgba(0,0,0,0)\":\"#000\";return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"fixed\",inset:0,zIndex:99999,overflow:\"hidden\",pointerEvents:isExiting?\"none\":\"auto\",backgroundColor:bgColor,backdropFilter,WebkitBackdropFilter:backdropFilter,transition:isExiting?\"backdrop-filter 1.4s cubic-bezier(0.16, 1, 0.3, 1), -webkit-backdrop-filter 1.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.8s ease-out\":\"none\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:26,left:24,zIndex:4,perspective:\"800px\"},children:/*#__PURE__*/_jsx(\"div\",{style:{transform:logoFlipped?\"rotateY(360deg)\":\"rotateY(0deg)\",transition:\"transform 0.65s cubic-bezier(0.8, 0, 0.1, 1)\",transformStyle:\"preserve-3d\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"17\",height:\"13\",viewBox:\"0 0 17 13\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M15.9643 4.33916H15.8957C15.3264 4.33916 14.8669 3.87063 14.8669 3.29021V3.22028C14.8669 2.63986 14.4073 2.17133 13.838 2.17133H9.50313C8.93383 2.17133 8.47428 2.63986 8.47428 3.22028V3.73077C8.47428 3.73077 8.47428 3.75524 8.47428 3.76923C8.47771 3.83566 8.47428 3.90559 8.44684 3.96853C8.36454 4.17483 8.17591 4.32518 7.94957 4.34615C7.93242 4.34615 7.91527 4.34615 7.89812 4.34615H7.55175C7.52431 4.34615 7.5003 4.34615 7.47287 4.34615H5.27799C4.7087 4.34615 4.24914 4.81469 4.24914 5.39511V5.46504C4.24914 6.04545 4.7087 6.51399 5.27799 6.51399H7.31854C7.34598 6.51399 7.36998 6.51399 7.39742 6.51399H7.89127C8.16905 6.51399 8.39883 6.70629 8.46742 6.96504C8.47771 7.0035 8.48114 7.04545 8.48114 7.08741C8.48114 7.0979 8.48114 7.11189 8.48114 7.12238V7.63287C8.48114 7.67133 8.48114 7.70629 8.488 7.74476V8.06993C8.488 8.08741 8.488 8.1049 8.488 8.12238C8.46056 8.43357 8.20335 8.67483 7.8947 8.67483H2.72302C2.39379 8.67832 2.12629 8.40559 2.12629 8.06993V3.21678C2.12629 2.63636 2.58584 2.16783 3.15513 2.16783H7.4763C8.04559 2.16783 8.50514 1.6993 8.50514 1.11888V1.04895C8.50514 0.468532 8.04559 0 7.4763 0H3.15513C2.58584 0 2.12629 0.468532 2.12629 1.04895V1.11888C2.12629 1.6993 1.66673 2.16783 1.09744 2.16783H1.02885C0.459552 2.16783 0 2.63636 0 3.21678V7.62238C0 8.2028 0.459552 8.67133 1.02885 8.67133H1.09744C1.66673 8.67133 2.12629 9.13986 2.12629 9.72028V9.79021C2.12629 10.3706 2.58584 10.8392 3.15513 10.8392H7.49001C8.05931 10.8392 8.51886 10.3706 8.51886 9.79021V9.27972C8.51886 9.27972 8.51886 9.25525 8.51886 9.24126C8.51543 9.17483 8.51886 9.1049 8.5463 9.04196C8.62861 8.83567 8.81723 8.68532 9.04358 8.66434C9.06072 8.66434 9.07787 8.66434 9.09502 8.66434H9.4414C9.46883 8.66434 9.49284 8.66434 9.52028 8.66434H11.7152C12.2844 8.66434 12.744 8.1958 12.744 7.61539V7.54546C12.744 6.96504 12.2844 6.4965 11.7152 6.4965H9.6746C9.64717 6.4965 9.62316 6.4965 9.59572 6.4965H9.10188C8.82409 6.4965 8.59431 6.3042 8.52572 6.04545C8.51543 6.00699 8.512 5.96504 8.512 5.92308C8.512 5.91259 8.512 5.8986 8.512 5.88811V5.37762C8.512 5.33916 8.512 5.3042 8.50514 5.26573V4.94056C8.50514 4.92308 8.50514 4.90559 8.50514 4.88811C8.53258 4.57692 8.78979 4.33566 9.09845 4.33566H14.277C14.6062 4.33217 14.8737 4.6049 14.8737 4.94056V9.78322C14.8737 10.3636 14.4142 10.8322 13.8449 10.8322H9.55114C8.98184 10.8322 8.52229 11.3007 8.52229 11.8811V11.951C8.52229 12.5315 8.98184 13 9.55114 13H13.8449C14.4142 13 14.8737 12.5315 14.8737 11.951V11.8811C14.8737 11.3007 15.3333 10.8322 15.9026 10.8322H15.9712C16.5404 10.8322 17 10.3636 17 9.78322V5.38811C17 4.80769 16.5404 4.33916 15.9712 4.33916H15.9643Z\",fill:\"#FFFFFF\"})})})}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:0,left:0,width:\"100%\",height:\"2px\",zIndex:3,backgroundColor:\"rgba(255,255,255,0.08)\",opacity:isExiting?0:1,transition:isExiting?\"opacity 0.2s ease-out\":\"none\"},children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor:\"#ffffff\",transformOrigin:\"left center\",transform:`scaleX(${progress/100})`,transition:\"transform 0.3s ease-out\"}})}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",bottom:6,left:6,zIndex:3,fontFamily:\"'Libre Caslon Display', serif\",fontSize:\"min(140px, 17.5vw)\",fontWeight:400,lineHeight:.85,color:\"#ffffff\",letterSpacing:\"-0.02em\",userSelect:\"none\",overflow:\"hidden\",opacity:isExiting?0:1,transform:isExiting?\"scale(1.08) translateY(-2%)\":\"scale(1)\",transition:isExiting?\"opacity 0.4s ease-out, transform 1s cubic-bezier(0.16, 1, 0.3, 1)\":\"none\",filter:isStatic?`blur(${Math.random()*2}px)`:\"none\"},children:[scramble!==null?scramble:progress,\"%\"]})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LoadingScreen\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LoadingScreen.map"],"mappings":"qJAKG,SAAwB,GAAe,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,EAAE,CAAM,CAAC,EAAQ,GAAYA,EAAS,GAAK,CAAM,CAAC,EAAM,GAAUA,EAAS,UAAU,CAAM,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAM,CAAC,EAAS,GAAaA,EAAS,KAAK,CAAO,EAAYC,EAAO,EAAE,CAAO,EAAUA,EAAO,EAAE,CAAO,EAAOA,EAAO,EAAE,CAAO,EAAQA,EAAO,GAAM,CAAO,EAAgBA,EAAO,EAAE,CAKi8B,GAJ50C,MAAc,CAAC,GAAG,OAAO,SAAW,IAAY,OAAO,IAAM,EAAG,eAAe,GAAG,CAAC,SAAS,eAAe,EAAG,CAAC,CAAC,IAAM,EAAM,SAAS,cAAc,QAAQ,CAAC,EAAM,GAAG,EAAG,EAAM,YAAY,iDAAiD,SAAS,KAAK,YAAY,EAAM,CAAE,IAAM,EAAO,iBAAiB,GAAG,CAAC,SAAS,eAAe,EAAO,CAAC,CAAC,IAAM,EAAK,SAAS,cAAc,OAAO,CAAC,EAAK,GAAG,EAAO,EAAK,IAAI,aAAa,EAAK,KAAK,EAAY,SAAS,KAAK,YAAY,EAAK,GAAI,EAAE,CAAC,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,GAAG,CAAC,GAAG,eAAe,QAAQ,YAAY,CAAC,CAAC,EAAW,GAAM,CAAC,EAAO,cAAc,IAAI,YAAY,iBAAiB,CAAC,CAAC,aAAiB,EAAE,GAAG,CAAC,EAAQ,OAAO,IAAM,EAAU,KAAK,KAAK,CAAO,EAAiB,SAAS,KAAK,MAAM,SAAS,SAAS,K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