import{B as e,C as t,G as n,L as r,N as i,O as a,S as o,T as s,U as c,V as l,_ as u,a as d,b as f,g as p,j as m,m as h,n as g,p as _,r as v,t as y,u as b,x,z as S}from"./ui-BjxGELcM.js";import{n as C,t as w}from"./eye-8xrL_Squ.js";import{t as T}from"./globe-Cy3sFr4f.js";import{t as E}from"./hash-Dadu1FEQ.js";import{n as D,r as O,t as k}from"./users-D75l7xkO.js";import{t as A}from"./log-out-BYvt6A8x.js";import{t as j}from"./message-square-DGTwCJY8.js";import{t as M}from"./radio-tower-Dfdb9MI0.js";import{n as N,t as ee}from"./user-round-BD5O3Mh0.js";import{t as P}from"./shield-check-CU6M0J1d.js";import{t as F}from"./video-02fL9iqS.js";import{n as I,r as L}from"./index-BsK239Bd.js";var R=[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]],z=e=>r(u,n(e,{iconNode:R,name:`key-round`})),te=[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],B=e=>r(u,n(e,{iconNode:te,name:`layers`})),V=[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]],ne=e=>r(u,n(e,{iconNode:V,name:`refresh-cw`})),H=[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]],U=e=>r(u,n(e,{iconNode:H,name:`save`})),W=[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]],G=e=>r(u,n(e,{iconNode:W,name:`settings`})),K=[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]],q=e=>r(u,n(e,{iconNode:K,name:`sliders-horizontal`})),J=[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],Y=e=>r(u,n(e,{iconNode:J,name:`trash-2`})),X=a(`
`),se=a(`
manage / console
`),fe=a(`
暂无房间数据`),me=a(`
room /
`),Oe=a(`
加载中…`);function ke(e){return(()=>{var t=we(),n=t.firstChild,a=n.firstChild,c=a.firstChild.nextSibling,u=c.firstChild,p=u.firstChild.nextSibling,h=p.firstChild,_=u.nextSibling,y=_.firstChild.nextSibling,x=_.nextSibling,S=x.firstChild;S.firstChild;var k=S.nextSibling.firstChild.nextSibling,A=x.nextSibling.firstChild.nextSibling,M=A.firstChild,P=M.nextSibling,F=a.nextSibling.firstChild,L=F.firstChild.nextSibling,R=F.nextSibling,z=n.nextSibling;return o(p,r(E,{class:`size-4 shrink-0 text-muted-foreground`}),h),h.$$input=t=>e.setNewRoom({name:t.currentTarget.value}),y.$$input=t=>e.setNewRoom({desc:t.currentTarget.value}),o(S,r(b,{get value(){return e.newRoom.isPublic?`public`:`private`},onChange:t=>e.setNewRoom({isPublic:t===`public`}),options:[{value:`public`,label:`公开`},{value:`private`,label:`私密`}]}),null),k.$$input=t=>e.setNewRoom({max:t.currentTarget.value}),o(A,r(O,{class:`size-4 shrink-0 text-muted-foreground`}),M),M.$$input=t=>e.setNewRoom({pwd:t.currentTarget.value}),P.$$click=()=>e.setNewRoom({showPwd:!e.newRoom.showPwd}),o(P,r(i,{get when(){return e.newRoom.showPwd},get fallback(){return r(w,{class:`size-4`})},get children(){return r(C,{class:`size-4`})}})),o(c,r(v,{class:`w-full`,get onClick(){return e.onCreate},get disabled(){return e.loading||!e.newRoom.name.trim()},get children(){return[r(D,{class:`size-4`}),`创建房间`]}}),null),o(L,()=>e.rooms.length),o(R,r(m,{get each(){return e.rooms},children:t=>(()=>{var n=Te(),i=n.firstChild,a=i.firstChild,s=a.nextSibling,c=i.nextSibling,u=c.firstChild,p=u.firstChild;return n.$$click=()=>e.onSelectRoom(t.room.name),o(a,()=>t.room.name),o(s,()=>t.room.description||`—`),o(c,r(d,{get active(){return t.live}}),u),o(u,()=>t.member_count,p),l(()=>f(n,`flex w-full items-center justify-between gap-3 border-b border-line/60 px-4 py-3 text-left hover:bg-accent/40 ${e.selectedRoom===t.room.name?`bg-acid-lime/10`:``}`)),n})()})),o(z,r(i,{get when(){return e.selectedRoom},get fallback(){return Ee()},get children(){return[(()=>{var t=be(),n=t.firstChild,i=n.firstChild.firstChild;i.firstChild;var a=i.nextSibling,s=n.nextSibling,c=s.firstChild,u=c.firstChild.nextSibling,d=c.nextSibling.firstChild.nextSibling,f=s.nextSibling;return o(i,()=>e.selectedRoom,null),o(a,()=>e.editingRoom?.display_name||e.selectedRoom),o(n,r(g,{get variant(){return e.editingRoom?.is_public?`success`:`warning`},get children(){return e.editingRoom?.is_public?`公开`:`私密`}}),null),u.$$input=t=>e.setEdit({desc:t.currentTarget.value}),d.$$input=t=>e.setEdit({max:t.currentTarget.value}),o(f,r(v,{class:`gap-1.5`,get onClick(){return e.onSave},get children(){return[r(U,{class:`size-4`}),`保存`]}}),null),o(f,r(v,{variant:`danger`,class:`gap-1.5`,onClick:()=>e.onDelete(e.selectedRoom),get children(){return[r(Y,{class:`size-4`}),`删除`]}}),null),l(()=>u.value=e.edit.desc),l(()=>d.value=e.edit.max),t})(),(()=>{var t=xe(),n=t.firstChild,a=n.firstChild;a.firstChild;var s=n.nextSibling;return o(a,()=>e.members.length,null),o(s,r(m,{get each(){return e.members},children:t=>(()=>{var n=De(),a=n.firstChild,s=a.nextSibling.firstChild,c=s.nextSibling;return o(a,()=>(t.username[0]||`?`).toUpperCase()),o(s,()=>t.username),o(c,()=>t.effective_permissions?.join(`, `)||``),o(n,r(b,{class:`w-28`,get value(){return t.role},onChange:n=>e.onChangeRole(e.selectedRoom,t.username,n),options:[{value:`creator`,label:`房主`},{value:`admin`,label:`管理员`},{value:`member`,label:`成员`},{value:`guest`,label:`访客`}]}),null),o(n,r(i,{get when(){return t.role!==`creator`},get children(){return r(v,{variant:`ghost`,class:`h-8 px-2 text-destructive`,onClick:()=>e.onKick(e.selectedRoom,t.username),get children(){return r(I,{class:`size-4`})}})}}),null),l(()=>f(a,`flex size-8 items-center justify-center border font-mono text-xs font-bold ${ye[t.role]?.color||``}`)),n})()})),t})(),(()=>{var t=Ce(),n=t.firstChild,a=n.firstChild;return o(n,r(q,{class:`size-4`}),a),o(t,r(i,{get when(){return e.roomSettings},get fallback(){return Oe()},get children(){return[(()=>{var t=Se(),n=t.firstChild,i=n.firstChild,a=i.firstChild,s=i.nextSibling,c=n.nextSibling,u=c.firstChild,d=u.firstChild,f=u.nextSibling,p=c.nextSibling,m=p.firstChild,h=m.firstChild,g=m.nextSibling,_=p.nextSibling.firstChild,v=_.firstChild,y=_.nextSibling;return o(i,r(j,{class:`size-4 text-muted-foreground`}),a),s.$$input=t=>e.setRoomSettings({...e.roomSettings,chat_enabled:t.currentTarget.checked}),o(u,r(ee,{class:`size-4 text-muted-foreground`}),d),f.$$input=t=>e.setRoomSettings({...e.roomSettings,allow_guest_join:t.currentTarget.checked}),o(m,r(N,{class:`size-4 text-muted-foreground`}),h),g.$$input=t=>e.setRoomSettings({...e.roomSettings,require_approval:t.currentTarget.checked}),o(_,r(T,{class:`size-4 text-muted-foreground`}),v),y.$$input=t=>e.setRoomSettings({...e.roomSettings,is_public:t.currentTarget.checked}),l(()=>s.checked=!!e.roomSettings?.chat_enabled),l(()=>f.checked=!!e.roomSettings?.allow_guest_join),l(()=>g.checked=!!e.roomSettings?.require_approval),l(()=>y.checked=!!e.roomSettings?.is_public),t})(),r(v,{class:`mt-4 gap-1.5`,get onClick(){return e.onSaveSettings},get children(){return[r(U,{class:`size-4`}),`保存设置`]}})]}}),null),t})()]}})),l(()=>s(M,`type`,e.newRoom.showPwd?`text`:`password`)),l(()=>h.value=e.newRoom.name),l(()=>y.value=e.newRoom.desc),l(()=>k.value=e.newRoom.max),l(()=>M.value=e.newRoom.pwd),t})()}x([`input`,`click`]);var Ae=a(`
Creator 全量 · Guest 只读,个人覆盖 added/removed 生效。
请选择房间`),Re=a(`
JWT_SECRET 需显式配置;推流 token HS256 签发。
私密房间支持密码;is_public 与 allow_guest_join 联动。