import"./rolldown-runtime-DIIn1E2Q.js";import{A as e,D as t,I as n,O as r,R as i,Z as a,b as o,et as s,j as c,kt as l,pt as u}from"./vendor-vue-core-DO0afONr.js";import"./vendor-other-D7fTIduy.js";import{t as d}from"./VideoPlayOverlay-DAgHndSD.js";var f=[`controls`],p=[`src`,`type`],m=i({__name:`MediaVideoTop`,props:{asset:{}},emits:[`videoPlayingStateChanged`,`videoControlsChanged`],setup(i,{emit:m}){let h=m,g=l(null),_=l(!1),v=l(!1),y=t(()=>v.value&&_.value);u(y,e=>{h(`videoControlsChanged`,e)}),a(()=>{h(`videoControlsChanged`,y.value)});let onVideoPlay=()=>{v.value=!0,h(`videoPlayingStateChanged`,!0)},onVideoPause=()=>{v.value=!1,h(`videoPlayingStateChanged`,!1)},onVideoClick=async()=>{if(y.value)return;let e=g.value;if(e){if(e.paused||e.ended){await e.play().catch(()=>{});return}e.pause()}};return(t,i)=>(s(),c(`div`,{class:`relative size-full overflow-hidden rounded-sm bg-black`,onMouseenter:i[0]||=e=>_.value=!0,onMouseleave:i[1]||=e=>_.value=!1},[r(`video`,{ref_key:`videoElement`,ref:g,controls:y.value,preload:`metadata`,muted:``,loop:``,playsinline:``,class:`relative size-full object-contain transition-transform duration-300 group-hover:scale-105 group-data-[selected=true]:scale-105`,onClick:o(onVideoClick,[`stop`]),onPlay:onVideoPlay,onPause:onVideoPause},[t.asset.src?(s(),c(`source`,{key:0,src:t.asset.src,type:t.asset.mime_type??void 0},null,8,p)):e(``,!0)],40,f),n(d,{visible:!v.value,size:`md`},null,8,[`visible`])],32))}});export{m as default};
//# sourceMappingURL=MediaVideoTop-Dk0hUPbV.js.map