import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{$ as t,A as n,D as r,E as i,Et as a,L as o,X as s,ft as c,y as l}from"./vendor-vue-core-D3IvUUeM.js";var u=[`controls`,`poster`],d=[`src`],f=o({__name:`MediaVideoTop`,props:{asset:{}},emits:[`videoPlayingStateChanged`,`videoControlsChanged`],setup(e,{emit:o}){let f=o,p=a(!1),m=a(!1),h=i(()=>!m.value||p.value);c(h,e=>{f(`videoControlsChanged`,e)}),s(()=>{f(`videoControlsChanged`,h.value)});let onVideoPlay=()=>{m.value=!0,f(`videoPlayingStateChanged`,!0)},onVideoPause=()=>{m.value=!1,f(`videoPlayingStateChanged`,!1)},onVideoEnded=()=>{m.value=!1,f(`videoPlayingStateChanged`,!1)};return(e,i)=>(t(),n(`div`,{class:`relative size-full overflow-hidden rounded bg-black`,onMouseenter:i[1]||=e=>p.value=!0,onMouseleave:i[2]||=e=>p.value=!1},[r(`video`,{controls:h.value,preload:`metadata`,muted:``,loop:``,playsinline:``,poster:e.asset.preview_url,class:`relative size-full object-contain transition-transform duration-300 group-hover:scale-105 group-data-[selected=true]:scale-105`,onClick:i[0]||=l(()=>{},[`stop`]),onPlay:onVideoPlay,onPause:onVideoPause,onEnded:onVideoEnded},[r(`source`,{src:e.asset.src||``},null,8,d)],40,u)],32))}});export{f as default};
//# sourceMappingURL=MediaVideoTop-BVsQxvrz.js.map