{"version":3,"file":"Video.PX6pRJcc.mjs","names":["useRef","useState","useMemo","useCallback"],"sources":["https:/framerusercontent.com/modules/OzNHj4aCu28klMIHrx7w/bV1Ilz5iPnKWF7JSSkbQ/Video.js"],"sourcesContent":["// Request: Keep poster as an overlay and fade it out smoothly (~0.3–0.5s) once playback actually starts (playing/canplay), with pointer-events none and SSR/canvas-safe behavior; add a poster fade duration control while preserving existing behavior.\n// Native video component with alignment control for object-fit: cover\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{startTransition,useCallback,useEffect,useMemo,useRef,useState}from\"react\";/**\n * Native Video Component with Alignment Control\n * \n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function Video(props){const{videoFile=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",autoplay=true,loop=true,muted=true,controls=false,resetOutOfView=false,alignment=\"center\",poster,posterFadeDuration=.4,preload=\"metadata\"}=props;const videoRef=useRef(null);const[isPosterVisible,setIsPosterVisible]=useState(true);const posterUrl=useMemo(()=>{if(!poster)return undefined;if(typeof poster===\"string\")return poster||undefined;if(typeof poster.src===\"string\"&&poster.src.length>0)return poster.src;return undefined;},[poster]);const showPoster=Boolean(posterUrl)&&isPosterVisible;const fadeOutPoster=useCallback(()=>{if(!posterUrl)return;startTransition(()=>{setIsPosterVisible(false);});},[posterUrl]);const handleCanPlay=useCallback(()=>{const videoElement=videoRef.current;if(!videoElement)return;if(!videoElement.paused&&!videoElement.ended&&videoElement.currentTime>0){fadeOutPoster();}},[fadeOutPoster]);const handlePlaying=useCallback(()=>{fadeOutPoster();},[fadeOutPoster]);useEffect(()=>{startTransition(()=>{setIsPosterVisible(true);});},[posterUrl,videoFile]);useEffect(()=>{if(!resetOutOfView)return;if(typeof window===\"undefined\"||typeof IntersectionObserver===\"undefined\")return;if(!videoRef.current)return;const videoElement=videoRef.current;const observer=new IntersectionObserver(([entry])=>{if(!entry)return;if(!entry.isIntersecting){videoElement.pause();try{videoElement.currentTime=0;}catch{// Ignore seek errors silently.\n}if(posterUrl){startTransition(()=>{setIsPosterVisible(true);});}return;}if(!autoplay)return;const playPromise=videoElement.play();if(playPromise&&typeof playPromise.catch===\"function\"){playPromise.catch(()=>{// Ignore autoplay-related promise rejections silently.\n});}});observer.observe(videoElement);return()=>{observer.disconnect();};},[autoplay,posterUrl,resetOutOfView]);return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:videoFile,autoPlay:autoplay,loop:loop,muted:muted,controls:controls,playsInline:true,preload:preload,onCanPlay:handleCanPlay,onPlaying:handlePlaying,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:alignment}}),posterUrl?/*#__PURE__*/_jsx(\"img\",{src:posterUrl,srcSet:typeof poster===\"object\"?poster.srcSet:undefined,alt:\"\",\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:alignment,pointerEvents:\"none\",zIndex:1,opacity:showPoster?1:0,transition:`opacity ${Math.max(0,posterFadeDuration)}s ease`}}):null]});}addPropertyControls(Video,{videoFile:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\",\"ogg\"]},alignment:{type:ControlType.Enum,title:\"Alignment\",options:[\"top\",\"center\",\"bottom\",\"left\",\"right\",\"top left\",\"top right\",\"bottom left\",\"bottom right\"],optionTitles:[\"Top\",\"Center\",\"Bottom\",\"Left\",\"Right\",\"Top Left\",\"Top Right\",\"Bottom Left\",\"Bottom Right\"],defaultValue:\"center\"},poster:{type:ControlType.ResponsiveImage,title:\"Poster\"},posterFadeDuration:{type:ControlType.Number,title:\"Poster Fade\",defaultValue:.4,min:0,max:2,step:.05,unit:\"s\"},preload:{type:ControlType.Enum,title:\"Preload\",options:[\"none\",\"metadata\",\"auto\"],optionTitles:[\"None\",\"Metadata\",\"Auto\"],defaultValue:\"metadata\"},autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},muted:{type:ControlType.Boolean,title:\"Muted\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},controls:{type:ControlType.Boolean,title:\"Controls\",defaultValue:false,enabledTitle:\"Show\",disabledTitle:\"Hide\"},resetOutOfView:{type:ControlType.Boolean,title:\"Reset Out of View\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Video\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Video.map"],"mappings":"kOAOG,SAAwB,EAAM,EAAM,CAAC,GAAK,CAAC,YAAU,uEAAuE,WAAS,GAAK,OAAK,GAAK,QAAM,GAAK,WAAS,GAAM,iBAAe,GAAM,YAAU,SAAS,SAAO,qBAAmB,GAAG,UAAQ,YAAY,EAAY,EAASA,EAAO,IAAI,EAAO,CAAC,EAAgB,GAAoBC,EAAS,EAAI,EAAQ,EAAUC,MAAY,CAAK,KAAwB,IAAG,OAAO,GAAS,SAAS,OAAO,GAAQ,IAAA,GAAU,GAAG,OAAO,EAAO,KAAM,UAAU,EAAO,IAAI,OAAO,EAAE,OAAO,EAAO,GAA7E,CAAkG,EAAE,CAAC,CAAM,CAAC,EAAQ,EAAW,EAAQ,GAAY,EAAsB,EAAcC,MAAgB,CAAK,GAAiB,MAAoB,CAAC,EAAmB,EAAK,CAAE,CAAC,CAAE,EAAE,CAAC,CAAS,CAAC,EAAQ,EAAcA,M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