import{B as e,C as t,E as n,H as r,K as i,M as a,P as o,R as s,S as c,V as l,W as u,_ as d,d as f,h as p,k as m,m as h,n as g,o as _,r as v,t as y,v as b,w as x,x as S}from"./ui-CzB-gjVP.js";import{n as C,t as w}from"./eye-DaP7VxYZ.js";import{i as T,n as E,r as D,t as O}from"./users-D7ZZ6mzL.js";import{t as k}from"./hash-ORiZzY9V.js";import{t as A}from"./log-out-BSFDyM4m.js";import{t as j}from"./message-square-1ZGuav88.js";import{t as M}from"./radio-tower-UMy9OSpZ.js";import{n as N,t as ee}from"./user-round-BkRPX9Ri.js";import{t as P}from"./shield-check-PAk2q1NC.js";import{t as F}from"./video-C1co3G53.js";import{n as I,r as L}from"./index-D9mHcT7c.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=>s(b,i(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=>s(b,i(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=>s(b,i(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=>s(b,i(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=>s(b,i(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=>s(b,i(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=>s(b,i(e,{iconNode:J,name:`trash-2`})),X=m(`
`),se=m(`
manage / console
`),fe=m(`
暂无房间数据`),me=m(`
room /
`),Oe=m(`
加载中…`);function ke(e){return(()=>{var i=we(),c=i.firstChild,l=c.firstChild,u=l.firstChild.nextSibling,d=u.firstChild,p=d.firstChild.nextSibling,m=p.firstChild,h=d.nextSibling,y=h.firstChild.nextSibling,b=h.nextSibling,x=b.firstChild;x.firstChild;var O=x.nextSibling.firstChild.nextSibling,A=b.nextSibling.firstChild.nextSibling,M=A.firstChild,P=M.nextSibling,F=l.nextSibling.firstChild,L=F.firstChild.nextSibling,R=F.nextSibling,z=c.nextSibling;return t(p,s(k,{class:`size-4 shrink-0 text-muted-foreground`}),m),m.$$input=t=>e.setNewRoom({name:t.currentTarget.value}),y.$$input=t=>e.setNewRoom({desc:t.currentTarget.value}),t(x,s(f,{get value(){return e.newRoom.isPublic?`public`:`private`},onChange:t=>e.setNewRoom({isPublic:t===`public`}),options:[{value:`public`,label:`公开`},{value:`private`,label:`私密`}]}),null),O.$$input=t=>e.setNewRoom({max:t.currentTarget.value}),t(A,s(D,{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}),t(P,s(o,{get when(){return e.newRoom.showPwd},get fallback(){return s(w,{class:`size-4`})},get children(){return s(C,{class:`size-4`})}})),t(u,s(v,{class:`w-full`,get onClick(){return e.onCreate},get disabled(){return e.loading||!e.newRoom.name.trim()},get children(){return[s(E,{class:`size-4`}),`创建房间`]}}),null),t(L,()=>e.rooms.length),t(R,s(a,{get each(){return e.rooms},children:n=>(()=>{var i=Te(),a=i.firstChild,o=a.firstChild,c=o.nextSibling,l=a.nextSibling,u=l.firstChild,d=u.firstChild;return i.$$click=()=>e.onSelectRoom(n.room.name),t(o,()=>n.room.name),t(c,()=>n.room.description||`—`),t(l,s(_,{get active(){return n.live}}),u),t(u,()=>n.member_count,d),r(()=>S(i,`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===n.room.name?`bg-acid-lime/10`:``}`)),i})()})),t(z,s(o,{get when(){return e.selectedRoom},get fallback(){return Ee()},get children(){return[(()=>{var n=be(),i=n.firstChild,a=i.firstChild.firstChild;a.firstChild;var o=a.nextSibling,c=i.nextSibling,l=c.firstChild,u=l.firstChild.nextSibling,d=l.nextSibling.firstChild.nextSibling,f=c.nextSibling;return t(a,()=>e.selectedRoom,null),t(o,()=>e.editingRoom?.display_name||e.selectedRoom),t(i,s(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}),t(f,s(v,{class:`gap-1.5`,get onClick(){return e.onSave},get children(){return[s(U,{class:`size-4`}),`保存`]}}),null),t(f,s(v,{variant:`danger`,class:`gap-1.5`,onClick:()=>e.onDelete(e.selectedRoom),get children(){return[s(Y,{class:`size-4`}),`删除`]}}),null),r(()=>u.value=e.edit.desc),r(()=>d.value=e.edit.max),n})(),(()=>{var n=xe(),i=n.firstChild,c=i.firstChild;c.firstChild;var l=i.nextSibling;return t(c,()=>e.members.length,null),t(l,s(a,{get each(){return e.members},children:n=>(()=>{var i=De(),a=i.firstChild,c=a.nextSibling.firstChild,l=c.nextSibling;return t(a,()=>(n.username[0]||`?`).toUpperCase()),t(c,()=>n.username),t(l,()=>n.effective_permissions?.join(`, `)||``),t(i,s(f,{class:`w-28`,get value(){return n.role},onChange:t=>e.onChangeRole(e.selectedRoom,n.username,t),options:[{value:`creator`,label:`房主`},{value:`admin`,label:`管理员`},{value:`member`,label:`成员`},{value:`guest`,label:`访客`}]}),null),t(i,s(o,{get when(){return n.role!==`creator`},get children(){return s(v,{variant:`ghost`,class:`h-8 px-2 text-destructive`,onClick:()=>e.onKick(e.selectedRoom,n.username),get children(){return s(I,{class:`size-4`})}})}}),null),r(()=>S(a,`flex size-8 items-center justify-center border font-mono text-xs font-bold ${ye[n.role]?.color||``}`)),i})()})),n})(),(()=>{var n=Ce(),i=n.firstChild,a=i.firstChild;return t(i,s(q,{class:`size-4`}),a),t(n,s(o,{get when(){return e.roomSettings},get fallback(){return Oe()},get children(){return[(()=>{var n=Se(),i=n.firstChild,a=i.firstChild,o=a.firstChild,c=a.nextSibling,l=i.nextSibling,u=l.firstChild,d=u.firstChild,f=u.nextSibling,p=l.nextSibling,m=p.firstChild,h=m.firstChild,g=m.nextSibling,_=p.nextSibling.firstChild,v=_.firstChild,y=_.nextSibling;return t(a,s(j,{class:`size-4 text-muted-foreground`}),o),c.$$input=t=>e.setRoomSettings({...e.roomSettings,chat_enabled:t.currentTarget.checked}),t(u,s(ee,{class:`size-4 text-muted-foreground`}),d),f.$$input=t=>e.setRoomSettings({...e.roomSettings,allow_guest_join:t.currentTarget.checked}),t(m,s(N,{class:`size-4 text-muted-foreground`}),h),g.$$input=t=>e.setRoomSettings({...e.roomSettings,require_approval:t.currentTarget.checked}),t(_,s(T,{class:`size-4 text-muted-foreground`}),v),y.$$input=t=>e.setRoomSettings({...e.roomSettings,is_public:t.currentTarget.checked}),r(()=>c.checked=!!e.roomSettings?.chat_enabled),r(()=>f.checked=!!e.roomSettings?.allow_guest_join),r(()=>g.checked=!!e.roomSettings?.require_approval),r(()=>y.checked=!!e.roomSettings?.is_public),n})(),s(v,{class:`mt-4 gap-1.5`,get onClick(){return e.onSaveSettings},get children(){return[s(U,{class:`size-4`}),`保存设置`]}})]}}),null),n})()]}})),r(()=>n(M,`type`,e.newRoom.showPwd?`text`:`password`)),r(()=>m.value=e.newRoom.name),r(()=>y.value=e.newRoom.desc),r(()=>O.value=e.newRoom.max),r(()=>M.value=e.newRoom.pwd),i})()}c([`input`,`click`]);var Ae=m(`
Creator 全量 · Guest 只读,个人覆盖 added/removed 生效。
请选择房间`),Re=m(`
JWT_SECRET 需显式配置;推流 token HS256 签发。
私密房间支持密码;is_public 与 allow_guest_join 联动。