{"version":3,"file":"Video.LBCTL6DK.mjs","names":[],"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\":\"variable\"}}}\n//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