{"version":3,"file":"Video.CyhrWtR5.mjs","names":["useRef","useState","useMemo","useCallback","__esmMin","ne","init_npm_react_18_3_1","te","pe","window","ce","p","init_jsx_runtime","_e","de","init_ssg_sandbox_shims","addPropertyControls","ControlType","init_framer_DKWANagr","Video","props","videoRef","isPosterVisible","setIsPosterVisible","posterUrl","poster","showPoster","fadeOutPoster","handleCanPlay","videoElement","handlePlaying","videoFile","resetOutOfView","observer","entry","autoplay","playPromise","alignment","posterFadeDuration","init_Video"],"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":"A,kOAOG,SAAwBmB,EAAM,EAAM,CAAC,GAAK,CAAC,YAAU,uEAAuE,WAAS,GAAK,OAAK,GAAK,QAAM,GAAK,WAAS,GAAM,iBAAe,GAAM,YAAU,SAAS,SAAO,qBAAmB,GAAG,UAAQ,YAAYC,EAAYC,EAASrB,EAAO,IAAI,EAAO,CAACsB,EAAgBC,GAAoBtB,EAAS,EAAI,EAAQuB,EAAUtB,MAAY,CAAC,GAAIuB,EAAwB,IAAG,OAAOA,GAAS,SAAS,OAA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