import{_ as R}from"./ChatPanel.vue_vue_type_script_setup_true_lang-BMB9LZOK.js";import{d as S,aj as p,ak as I,E as V,H as w,k as n,c as f,a,t as C,e as x,z as $,r as g,g as o,o as v,R as B,a5 as y,$ as _}from"./index-B4jeNr7A.js";const N={class:"flex h-full flex-col"},P={class:"border-b border-slate-800 px-6 py-3"},E={class:"text-xs uppercase tracking-wide text-slate-400"},M={class:"mt-1 flex min-h-8 items-center"},j={class:"text-lg font-semibold text-slate-100"},z={class:"min-h-0 flex-1"},L=S({__name:"ChannelView",props:{communityId:{},channelId:{},community:{},channel:{}},setup(e){const r=e,l=p(),i=I(),t=g(null),s=g(null),d=o(()=>B.value===`${r.communityId}:${r.channelId}`),k=o(()=>r.channel?.capabilities.includes("screenshare")??!1),u=o(()=>k.value&&y.value!==null&&(y.value==="broadcast"||_.value!==null)),b=o(()=>{if(y.value==="broadcast")return"Your screen";const m=_.value;return m?`Watching ${m}`:"Screen share"});function h(){d.value&&t.value?l.attachRenderContainer(t.value):l.detachRenderContainer()}function c(){u.value&&s.value?i.attachRenderContainer(s.value,b.value):i.detachRenderContainer()}return V(()=>{h(),c()}),w(()=>{l.detachRenderContainer(),i.detachRenderContainer()}),n(d,()=>{h()}),n(t,()=>{h()}),n(u,()=>{c()}),n(s,()=>{c()}),n(b,()=>{c()}),(m,D)=>(v(),f("section",N,[a("header",P,[a("p",E,C(e.community?.name??e.communityId),1),a("div",M,[a("h1",j,"# "+C(e.channel?.name??e.channelId),1)])]),d.value?(v(),f("div",{key:0,ref_key:"videoContainer",ref:t,class:"border-b border-slate-800 bg-slate-950 p-4"},null,512)):x("",!0),u.value?(v(),f("div",{key:1,ref_key:"screenshareContainer",ref:s,class:"border-b border-slate-800 bg-slate-950 p-4"},null,512)):x("",!0),a("div",z,[$(R,{kind:"channel","community-id":e.communityId,"channel-id":e.channelId},null,8,["community-id","channel-id"])])]))}});export{L as default};
//# sourceMappingURL=ChannelView-6685akQk.js.map
