{"version":3,"file":"Utils.azJn7Da2.mjs","names":["useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/AuIvBQDgULXbPXi15bJc/7qWnG8ACXWA0KgXSjNLH/Utils.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useEffect,useCallback}from\"react\";// Learn more: https://www.framer.com/developers/overrides/\nlet globalCurrentPlayingVideo=null;function useVideoRefEffect(videoRef){const animationFrameId=useRef();const moveToNextSlide=useCallback(()=>{var _parentButtonElement_children_;const parentButtonElement=document.querySelector(\".framer--slideshow-controls\");const nextButton=parentButtonElement===null||parentButtonElement===void 0?void 0:(_parentButtonElement_children_=parentButtonElement.children[0])===null||_parentButtonElement_children_===void 0?void 0:_parentButtonElement_children_.querySelector('[aria-label=\"Next\"]');if(nextButton instanceof HTMLElement){nextButton.click();}},[]);const handleCenterCheck=useCallback(()=>{if(!videoRef.current)return;const rect=videoRef.current.getBoundingClientRect();// const centerTolerance = rect.width / 2\nconst windowCenterX=window.innerWidth/2;const elementCenterX=rect.left+rect.width/2;const centerTolerance=rect.width/2+(elementCenterX>=windowCenterX?32:0);const isCentered=Math.abs(windowCenterX-elementCenterX)<centerTolerance;const containerDiv=videoRef.current.children[2];const videoElement=containerDiv===null||containerDiv===void 0?void 0:containerDiv.querySelector(\"video\");if(!videoElement)return;const handleVideoChange=shouldPlay=>{if(shouldPlay){globalCurrentPlayingVideo=videoElement;videoElement.muted=true;videoElement.addEventListener(\"ended\",moveToNextSlide);videoElement.play().catch(error=>{console.error(\"Error playing video:\",error);});}else{videoElement.pause();videoElement.autoplay=false;videoElement.removeEventListener(\"ended\",moveToNextSlide);globalCurrentPlayingVideo=null;}};if(isCentered){if(globalCurrentPlayingVideo&&globalCurrentPlayingVideo!==videoElement){globalCurrentPlayingVideo.pause();globalCurrentPlayingVideo.autoplay=false;globalCurrentPlayingVideo.removeEventListener(\"ended\",moveToNextSlide);}if(globalCurrentPlayingVideo!==videoElement){handleVideoChange(true);}}else if(globalCurrentPlayingVideo===videoElement){handleVideoChange(false);}},[moveToNextSlide]);useEffect(()=>{const checkLoop=()=>{handleCenterCheck();animationFrameId.current=requestAnimationFrame(checkLoop);};// Start the continuous position check\ncheckLoop();// Perform checks on scroll and resize events\nwindow.addEventListener(\"scroll\",handleCenterCheck);window.addEventListener(\"resize\",handleCenterCheck);// Cleanup on unmount\nreturn()=>{if(animationFrameId.current){cancelAnimationFrame(animationFrameId.current);}// Clean up all event listeners\nif(globalCurrentPlayingVideo){globalCurrentPlayingVideo.removeEventListener(\"ended\",moveToNextSlide);}window.removeEventListener(\"scroll\",handleCenterCheck);window.removeEventListener(\"resize\",handleCenterCheck);};},[handleCenterCheck]);}export function withCentered(Component){return props=>{const videoRef=useRef(null);useVideoRefEffect(videoRef);return /*#__PURE__*/_jsx(Component,{...props,ref:videoRef});};}export function withFullScreenWidth(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,style:{width:\"100vw\"}});};}export function withMaskClipFix(Component){return props=>{console.log(\"props: \",props);useEffect(()=>{// Wait for the DOM to be ready\nconst screenMasks=document.querySelectorAll('[data-framer-name=\"Screen Mask\"]');if(screenMasks.length>0){screenMasks.forEach(screenMask=>{if(!screenMask.style.webkitMaskSize||!screenMask.style.webkitMaskImage){console.log(\"Applying mask styles to:\",screenMask);screenMask.style.webkitMaskImage=\"url('https://framerusercontent.com/images/qv6dX5DJvWx1MG8Aqv53oAlDTI0.png')\";screenMask.style.webkitMaskSize=\"cover\";// screenMask.style.webkitMaskPosition = \"center\";\n}});}},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withFullScreenWidth\":{\"type\":\"reactHoc\",\"name\":\"withFullScreenWidth\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCentered\":{\"type\":\"reactHoc\",\"name\":\"withCentered\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMaskClipFix\":{\"type\":\"reactHoc\",\"name\":\"withMaskClipFix\",\"annotations\":{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