{"version":3,"file":"Video.DBaoh1be.mjs","names":["useState","useRef","useId"],"sources":["https:/framerusercontent.com/modules/afAuJ77Ke40vBx246LEa/KZ7SaptaOnBba3b16YM4/Video.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useEffect,useState,useId}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function Video(props){const[videoSrc,setVideoSrc]=useState(null);const containerStyle={height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"visible\"};const videoRef=useRef(null);const id=useId();useEffect(()=>{if(!videoSrc)return;const videoElement=videoRef.current;const handleIntersection=entries=>{entries.forEach(entry=>{if(entry.isIntersecting&&entry.intersectionRatio>=.8){videoElement.play();}else{videoElement.pause();}});};const observer=new IntersectionObserver(handleIntersection,{threshold:Array.from({length:101},(_,i)=>i/100)});if(videoElement){observer.observe(videoElement);}return()=>{if(videoElement){observer.unobserve(videoElement);}};},[videoSrc]);useEffect(()=>{setVideoSrc(props.file);},[props.file]);return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:videoSrc?/*#__PURE__*/_jsxs(\"video\",{ref:videoRef,controls:false,autoPlay:true,muted:true,loop:true,playsInline:true,style:{objectFit:\"cover\",width:\"100%\",height:\"100%\",borderRadius:props.cornerRadius},children:[/*#__PURE__*/_jsx(\"source\",{src:videoSrc,type:\"video/mp4\"}),\"Your browser does not support HTML5 video.\"]}):/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",borderRadius:props.cornerRadius,backgroundColor:\"black\"}})},id);}Video.defaultProps={cornerRadius:0,file:[]};addPropertyControls(Video,{cornerRadius:{type:ControlType.Number,title:\"Corner Radius\"},file:{type:ControlType.File,title:\"Video File\",allowedFileTypes:[\"mp4\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Video\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"vari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