mirror of
https://github.com/rightup/pyMC_Repeater.git
synced 2026-03-28 17:43:06 +01:00
2 lines
45 KiB
JavaScript
2 lines
45 KiB
JavaScript
import{a as ve,r as d,E as xe,o as be,L as x,e as s,f as e,g as Q,h as u,j as G,l as b,t as a,k as h,F as D,i as q,w as m,v,X as Y,x as Z,q as n}from"./index-xzvnOpJo.js";import{g as ye,s as ge}from"./preferences-DtwbSSgO.js";import{_ as ke}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-7siCLFWH.js";import{_ as fe}from"./MessageDialog.vue_vue_type_script_setup_true_lang-SzTqrYUh.js";const he={class:"p-6 space-y-6"},we={class:"relative overflow-hidden rounded-[20px] p-6 mb-6 glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10"},_e={class:"relative flex items-center justify-between"},Ce={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Me={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},je={class:"relative flex items-center justify-between"},Le={class:"text-3xl font-bold text-content-primary dark:text-content-primary mb-1"},Se={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},$e={class:"relative flex items-center justify-between"},Ae={class:"text-3xl font-bold text-primary mb-1"},Ve={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},Be={class:"relative flex items-center justify-between"},Re={key:0,class:"w-6 h-6 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ze={key:1,class:"w-6 h-6 text-accent-yellow",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ee={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6"},Fe={key:0,class:"flex items-center justify-center py-12"},Ie={key:1,class:"flex items-center justify-center py-12"},De={class:"text-center"},Ne={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},Ue={key:2,class:"space-y-4"},He={class:"relative flex items-start justify-between"},Ke={class:"flex-1"},Oe={class:"flex items-center gap-3 mb-4"},Pe={class:"relative"},Te={key:0,class:"absolute inset-0 bg-accent-green/50 rounded-full animate-ping"},Ge={class:"text-xl font-bold text-content-primary dark:text-content-primary group-hover:text-primary transition-colors"},qe={key:0,class:"text-content-muted dark:text-content-muted text-sm"},Je={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3"},We={class:"text-content-primary dark:text-content-primary/90 ml-2"},Xe={class:"flex items-center gap-2"},Qe={key:0,class:"text-content-primary dark:text-content-primary/90 font-mono ml-2 text-xs"},Ye={key:1,class:"text-content-muted dark:text-content-muted ml-2 text-xs"},Ze=["onClick"],et={class:"text-content-primary dark:text-content-primary/90 ml-2"},tt={key:0},rt={class:"text-content-primary dark:text-content-primary/90 ml-2"},ot={key:0,class:"text-accent-green"},st={key:1,class:"text-content-muted dark:text-content-muted"},nt={key:2,class:"text-primary"},at={key:0,class:"text-xs text-content-muted dark:text-content-muted font-mono"},lt={class:"ml-4 flex flex-wrap gap-2"},dt=["onClick","disabled","title"],it=["onClick","disabled","title"],ut=["onClick"],ct=["onClick"],pt={key:3,class:"text-center py-12 text-content-secondary dark:text-content-muted"},mt={key:1,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},vt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},xt={class:"space-y-4"},bt={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},yt={key:0},gt={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},kt={class:"grid grid-cols-2 gap-4"},ft={class:"grid grid-cols-2 gap-4"},ht={key:2,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},wt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},_t={class:"space-y-4"},Ct=["value"],Mt={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},jt={key:0},Lt={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},St={class:"grid grid-cols-2 gap-4"},$t={class:"grid grid-cols-2 gap-4"},At={key:0,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50 p-4"},Vt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 max-w-4xl w-full h-[85vh] flex flex-col shadow-2xl"},Bt={class:"relative overflow-hidden rounded-[15px] mb-6 p-5 bg-white/50 dark:bg-white/5 border border-stroke-subtle dark:border-white/10"},Rt={class:"relative flex items-center justify-between"},zt={class:"flex items-center gap-4"},Et={class:"text-content-secondary dark:text-content-muted text-sm flex items-center gap-2"},Ft={class:"text-primary font-semibold"},It={class:"flex items-center gap-2"},Dt={class:"bg-primary/30 px-1.5 py-0.5 rounded-full text-[10px]"},Nt={class:"flex-1 overflow-y-auto mb-4 space-y-3"},Ut={key:0,class:"flex items-center justify-center py-12"},Ht={key:1,class:"flex items-center justify-center py-12"},Kt={class:"text-center"},Ot={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},Pt={key:2,class:"space-y-3"},Tt={class:"relative flex items-start justify-between gap-3"},Gt={class:"flex-1 min-w-0"},qt={class:"flex items-center gap-2 mb-3"},Jt={class:"flex items-center gap-2 flex-wrap"},Wt={key:0,class:"text-primary text-sm font-bold"},Xt={key:1,class:"text-primary/80 text-xs font-mono bg-primary/10 px-2 py-1 rounded-md border border-primary/20"},Qt={key:2,class:"text-content-muted dark:text-content-muted text-xs"},Yt={class:"text-content-secondary dark:text-content-muted text-xs flex items-center gap-1"},Zt={key:3,class:"text-content-muted dark:text-content-muted/50 text-[10px] font-mono bg-background-mute dark:bg-white/5 px-1.5 py-0.5 rounded"},er={class:"text-content-primary dark:text-content-primary/90 text-sm leading-relaxed break-words whitespace-pre-wrap bg-gray-50 dark:bg-white/5 p-3 rounded-[10px] border border-stroke-subtle dark:border-white/5"},tr=["onClick"],rr={key:0,class:"text-center pt-4"},or={key:1,class:"text-center pt-4"},sr={key:3,class:"flex items-center justify-center h-full"},nr={class:"relative overflow-hidden rounded-[15px] border-t border-stroke-subtle dark:border-white/20 pt-4 mt-4"},ar={class:"relative space-y-3"},lr={class:"flex gap-3"},dr={class:"flex-1 relative"},ir=["onKeydown"],ur=["disabled"],cr={key:1,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-[60] p-4"},pr={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-3xl w-full max-h-[80vh] flex flex-col"},mr={class:"flex items-center justify-between mb-4 pb-4 border-b border-stroke-subtle dark:border-white/10"},vr={class:"text-content-secondary dark:text-content-primary/70 text-sm mt-1"},xr={class:"text-primary"},br={class:"flex-1 overflow-y-auto space-y-3"},yr={key:0,class:"text-center py-12"},gr={class:"space-y-2"},kr={class:"flex items-center justify-between"},fr={class:"flex items-center gap-2"},hr={class:"text-content-primary dark:text-content-primary font-semibold"},wr={class:"flex items-center gap-2"},_r={class:"text-content-secondary dark:text-content-muted text-xs"},Cr=["onClick"],Mr={class:"space-y-1 text-xs"},jr={class:"flex items-center gap-2"},Lr={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded"},Sr={class:"flex items-center gap-2"},$r={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded text-[10px] break-all"},Ar={class:"flex items-center justify-between text-xs text-content-secondary dark:text-content-muted"},Vr={class:"flex items-center gap-4"},Br={key:0},Rr={key:1},zr={key:0},Ur=ve({name:"RoomServersView",__name:"RoomServers",setup(Er){const N=d(!1),j=d(null),c=d(null),L=d(!1),B=d(!1),l=d(null),w=d(!1),_=d(!1),S=d(new Set),R=d(!1),z=d(""),U=d(!1),H=d({message:"",variant:"success"}),K=d(!1),y=d(""),E=d(""),g=d([]),$=d(!1),C=d(null),k=d(""),F=d(ye("roomServers_messagesLimit",50)),I=d(0),O=d(!0);xe(F,o=>ge("roomServers_messagesLimit",o));const M=d([]),P=d(!1),p=d({name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}});be(async()=>{await A()});async function A(){N.value=!0,j.value=null;try{const o=await x.getIdentities();o.success?c.value=o.data:j.value=o.error||"Failed to load identities"}catch(o){j.value=o instanceof Error?o.message:"Failed to load identities"}finally{N.value=!1}}async function ee(){try{const o=await x.createIdentity(p.value);o.success?(L.value=!1,J(),await A(),i(o.message||"Identity created successfully!","success")):i(`Failed to create identity: ${o.error}`,"error")}catch(o){i(`Error creating identity: ${o}`,"error")}}async function te(){try{const o=await x.updateIdentity(l.value);o.success?(B.value=!1,l.value=null,await A(),i(o.message||"Identity updated successfully!","success")):i(`Failed to update identity: ${o.error}`,"error")}catch(o){i(`Error updating identity: ${o}`,"error")}}function re(o){z.value=o,R.value=!0}async function oe(){const o=z.value;R.value=!1;try{const t=await x.deleteIdentity(o);t.success?(await A(),i(t.message||"Identity deleted successfully!","success")):i(`Failed to delete identity: ${t.error}`,"error")}catch(t){i(`Error deleting identity: ${t}`,"error")}finally{z.value=""}}function i(o,t){H.value={message:o,variant:t},U.value=!0}async function se(o){try{const t=await x.sendRoomServerAdvert(o);t.success?i(t.message||`Advert sent for '${o}'!`,"success"):i(`Failed to send advert: ${t.error}`,"error")}catch(t){i(`Error sending advert: ${t}`,"error")}}function ne(o){l.value=JSON.parse(JSON.stringify(o)),l.value.settings||(l.value.settings={}),l.value.settings.admin_password||(l.value.settings.admin_password=""),l.value.settings.guest_password||(l.value.settings.guest_password=""),_.value=!1,B.value=!0}function J(){p.value={name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}},w.value=!1}function W(){L.value=!1,B.value=!1,l.value=null,w.value=!1,_.value=!1,J()}function ae(o){S.value.has(o)?S.value.delete(o):S.value.add(o)}async function le(o){y.value=o,K.value=!0,I.value=0,O.value=!0;const t=c.value?.configured.find(r=>r.name===o);E.value=t?.hash||"",await X(),await V(!0)}async function X(){try{console.log("Fetching ACL clients for room:",y.value,"hash:",E.value);const o=await x.getACLClients({identity_hash:E.value,identity_name:y.value});console.log("ACL clients response:",o),o.success&&o.data&&(M.value=o.data.clients||[],console.log("ACL clients loaded:",M.value.length))}catch(o){console.error("Failed to fetch ACL clients:",o)}}async function V(o=!1){o&&(I.value=0,g.value=[]),$.value=!0,C.value=null;try{const t=await x.getRoomMessages({room_name:y.value,limit:F.value,offset:I.value});if(t.success&&t.data){const r=t.data.messages||[];o?g.value=r:g.value=[...g.value,...r],O.value=r.length===F.value}else C.value=t.error||"Failed to load messages"}catch(t){C.value=t instanceof Error?t.message:"Failed to load messages"}finally{$.value=!1}}async function de(){I.value+=F.value,await V(!1)}async function T(){if(k.value.trim())try{const o=await x.postRoomMessage({room_name:y.value,message:k.value,author_pubkey:"server"});o.success?(k.value="",await V(!0)):i(`Failed to send message: ${o.error}`,"error")}catch(o){i(`Error sending message: ${o}`,"error")}}async function ie(o){if(confirm("Are you sure you want to delete this message?"))try{const t=await x.deleteRoomMessage({room_name:y.value,message_id:o});t.success?(await V(!0),i("Message deleted successfully","success")):i(`Failed to delete message: ${t.error}`,"error")}catch(t){i(`Error deleting message: ${t}`,"error")}}function ue(){K.value=!1,y.value="",E.value="",g.value=[],k.value="",C.value=null,M.value=[]}function ce(o){return o?new Date(o*1e3).toLocaleString():"Unknown"}async function pe(o,t){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const r=await x.removeACLClient({public_key:o,identity_hash:t});r.success?(await X(),i("Client removed successfully","success")):i(`Failed to remove client: ${r.error}`,"error")}catch(r){i(`Error removing client: ${r}`,"error")}}return(o,t)=>(n(),s(D,null,[e("div",he,[e("div",we,[t[26]||(t[26]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50"},null,-1)),t[27]||(t[27]=e("div",{class:"absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse"},null,-1)),e("div",_e,[t[25]||(t[25]=G('<div class="flex items-center gap-4"><div class="relative"><div class="absolute inset-0 bg-primary/30 blur-xl rounded-full"></div><div class="relative bg-primary/20 p-4 rounded-[15px] border border-primary/30"><svg class="w-8 h-8 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path></svg></div></div><div><h1 class="text-3xl font-bold text-content-primary dark:text-content-primary mb-1">Room Servers</h1><p class="text-content-secondary dark:text-content-muted text-sm">Manage room server identities and messages</p></div></div>',1)),e("button",{onClick:t[0]||(t[0]=r=>L.value=!0),class:"group relative px-6 py-3 bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary rounded-[12px] border border-primary/50 transition-all hover:scale-105 hover:shadow-lg hover:shadow-primary/20"},t[24]||(t[24]=[e("span",{class:"flex items-center gap-2"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})]),b(" Add Room Server ")],-1)]))])]),c.value&&c.value.total_configured>0?(n(),s("div",Ce,[e("div",Me,[t[30]||(t[30]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",je,[e("div",null,[t[28]||(t[28]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Total Configured",-1)),e("div",Le,a(c.value.total_configured),1)]),t[29]||(t[29]=e("div",{class:"bg-background-mute dark:bg-white/10 p-3 rounded-[12px] group-hover:bg-background-mute dark:group-hover:bg-stroke/20 transition-colors"},[e("svg",{class:"w-6 h-6 text-content-secondary dark:text-content-primary/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})])],-1))])]),e("div",Se,[t[33]||(t[33]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",$e,[e("div",null,[t[31]||(t[31]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Currently Registered",-1)),e("div",Ae,a(c.value.total_registered),1)]),t[32]||(t[32]=e("div",{class:"bg-primary/20 p-3 rounded-[12px] group-hover:bg-primary/30 transition-colors"},[e("svg",{class:"w-6 h-6 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1))])]),e("div",Ve,[t[37]||(t[37]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-accent-green/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",Be,[e("div",null,[t[34]||(t[34]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Status",-1)),e("div",{class:h(["text-3xl font-bold",c.value.total_registered===c.value.total_configured?"text-accent-green":"text-accent-yellow"])},a(c.value.total_registered===c.value.total_configured?"Synced":"Out of Sync"),3)]),e("div",{class:h(["p-3 rounded-[12px] transition-colors",c.value.total_registered===c.value.total_configured?"bg-accent-green/20 group-hover:bg-accent-green/30":"bg-accent-yellow/20 group-hover:bg-accent-yellow/30"])},[c.value.total_registered===c.value.total_configured?(n(),s("svg",Re,t[35]||(t[35]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):(n(),s("svg",ze,t[36]||(t[36]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2)])])])):u("",!0),e("div",Ee,[N.value?(n(),s("div",Fe,t[38]||(t[38]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),e("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading room servers...")],-1)]))):j.value?(n(),s("div",Ie,[e("div",De,[t[39]||(t[39]=e("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load room servers",-1)),e("div",Ne,a(j.value),1),e("button",{onClick:A,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):c.value&&c.value.configured.length>0?(n(),s("div",Ue,[(n(!0),s(D,null,q(c.value.configured,r=>(n(),s("div",{key:r.name,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[15px] p-5 border border-stroke-subtle dark:border-white/10 hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300"},[t[46]||(t[46]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",He,[e("div",Ke,[e("div",Oe,[e("div",Pe,[r.registered?(n(),s("div",Te)):u("",!0),e("div",{class:h(["relative w-3 h-3 rounded-full",r.registered?"bg-accent-green":"bg-accent-red"])},null,2)]),e("h3",Ge,a(r.name),1),e("span",{class:h(["px-3 py-1 text-xs font-semibold rounded-full",r.registered?"bg-accent-green/20 text-accent-green border border-accent-green/30":"bg-accent-red/20 text-accent-red border border-accent-red/30"])},a(r.registered?"● Active":"○ Inactive"),3),r.hash?(n(),s("span",qe,a(r.hash),1)):u("",!0)]),e("div",Je,[e("div",null,[t[40]||(t[40]=e("span",{class:"text-content-muted dark:text-content-muted"},"Node Name:",-1)),e("span",We,a(r.settings?.node_name||"Not set"),1)]),e("div",Xe,[t[41]||(t[41]=e("span",{class:"text-content-muted dark:text-content-muted"},"Identity Key:",-1)),S.value.has(r.name)?(n(),s("span",Qe,a(r.identity_key),1)):(n(),s("span",Ye," •••••••••••••••• ")),e("button",{onClick:f=>ae(r.name),class:"text-primary/70 hover:text-primary text-xs underline"},a(S.value.has(r.name)?"Hide":"Show"),9,Ze)]),e("div",null,[t[42]||(t[42]=e("span",{class:"text-content-muted dark:text-content-muted"},"Location:",-1)),e("span",et,a(r.settings?.latitude||0)+", "+a(r.settings?.longitude||0),1)]),r.settings?.admin_password||r.settings?.guest_password?(n(),s("div",tt,[t[43]||(t[43]=e("span",{class:"text-content-muted dark:text-content-muted"},"Passwords:",-1)),e("span",rt,[r.settings?.admin_password?(n(),s("span",ot,"Admin")):u("",!0),r.settings?.admin_password&&r.settings?.guest_password?(n(),s("span",st," / ")):u("",!0),r.settings?.guest_password?(n(),s("span",nt,"Guest")):u("",!0)])])):u("",!0)]),r.address?(n(),s("div",at," Address: "+a(r.address),1)):u("",!0)]),e("div",lt,[e("button",{onClick:f=>le(r.name),disabled:!r.registered,class:h(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",r.registered?"bg-secondary/20 hover:bg-secondary/30 text-secondary border border-secondary/30 hover:scale-105 hover:shadow-lg hover:shadow-secondary/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"]),title:r.registered?"Manage messages for this room":"Room server must be active to manage messages"},t[44]||(t[44]=[e("svg",{class:"w-4 h-4 group-hover:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1),b(" Messages ",-1)]),10,dt),e("button",{onClick:f=>se(r.name),disabled:!r.registered,class:h(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",r.registered?"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/30 hover:scale-105 hover:shadow-lg hover:shadow-accent-green/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"]),title:r.registered?"Send advert for this room server":"Room server must be active to send advert"},t[45]||(t[45]=[e("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1),b(" Send Advert ",-1)]),10,it),e("button",{onClick:f=>ne(r),class:"px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors"}," Edit ",8,ut),e("button",{onClick:f=>re(r.name),class:"px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Delete ",8,ct)])])]))),128))])):(n(),s("div",pt,[t[47]||(t[47]=e("svg",{class:"w-16 h-16 mx-auto mb-4 text-content-muted dark:text-content-muted/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})],-1)),t[48]||(t[48]=e("p",{class:"text-lg mb-2"},"No room servers configured",-1)),t[49]||(t[49]=e("p",{class:"text-sm mb-4"},"Add your first room server to get started",-1)),e("button",{onClick:t[1]||(t[1]=r=>L.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," + Add Room Server ")]))]),L.value?(n(),s("div",mt,[e("div",vt,[t[60]||(t[60]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Add Room Server",-1)),e("div",xt,[e("div",null,[t[50]||(t[50]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Name *",-1)),m(e("input",{"onUpdate:modelValue":t[2]||(t[2]=r=>p.value.name=r),type:"text",placeholder:"e.g., MainBBS",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.name]])]),e("div",null,[e("label",bt,[t[51]||(t[51]=b(" Identity Key (Optional) ",-1)),e("button",{onClick:t[3]||(t[3]=r=>w.value=!w.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},a(w.value?"Hide":"Show/Edit"),1)]),w.value?(n(),s("div",yt,[m(e("input",{"onUpdate:modelValue":t[4]||(t[4]=r=>p.value.identity_key=r),type:"text",placeholder:"Leave empty to auto-generate",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.identity_key]]),t[52]||(t[52]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Leave empty to automatically generate a secure key",-1))])):(n(),s("div",gt," Will be auto-generated if not provided "))]),e("div",null,[t[53]||(t[53]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),m(e("input",{"onUpdate:modelValue":t[5]||(t[5]=r=>p.value.settings.node_name=r),type:"text",placeholder:"Display name for the room server",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.node_name]])]),e("div",kt,[e("div",null,[t[54]||(t[54]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Latitude",-1)),m(e("input",{"onUpdate:modelValue":t[6]||(t[6]=r=>p.value.settings.latitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.latitude,void 0,{number:!0}]])]),e("div",null,[t[55]||(t[55]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Longitude",-1)),m(e("input",{"onUpdate:modelValue":t[7]||(t[7]=r=>p.value.settings.longitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.longitude,void 0,{number:!0}]])])]),e("div",ft,[e("div",null,[t[56]||(t[56]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Admin Password (Optional)",-1)),m(e("input",{"onUpdate:modelValue":t[8]||(t[8]=r=>p.value.settings.admin_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.admin_password]]),t[57]||(t[57]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Full access to room server",-1))]),e("div",null,[t[58]||(t[58]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Guest Password (Optional)",-1)),m(e("input",{"onUpdate:modelValue":t[9]||(t[9]=r=>p.value.settings.guest_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.guest_password]]),t[59]||(t[59]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Read-only access",-1))])])]),e("div",{class:"flex justify-end gap-3 mt-6"},[e("button",{onClick:W,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),e("button",{onClick:ee,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Create ")])])])):u("",!0),B.value&&l.value?(n(),s("div",ht,[e("div",wt,[t[72]||(t[72]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Edit Room Server",-1)),e("div",_t,[e("div",null,[t[61]||(t[61]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Current Name",-1)),e("input",{value:l.value.name,disabled:"",type:"text",class:"w-full bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-muted dark:text-content-muted cursor-not-allowed"},null,8,Ct)]),e("div",null,[t[62]||(t[62]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"New Name (optional)",-1)),m(e("input",{"onUpdate:modelValue":t[10]||(t[10]=r=>l.value.new_name=r),type:"text",placeholder:"Leave empty to keep current name",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.new_name]])]),e("div",null,[e("label",Mt,[t[63]||(t[63]=b(" Identity Key (Optional) ",-1)),e("button",{onClick:t[11]||(t[11]=r=>_.value=!_.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},a(_.value?"Hide":"Show/Edit"),1)]),_.value?(n(),s("div",jt,[m(e("input",{"onUpdate:modelValue":t[12]||(t[12]=r=>l.value.identity_key=r),type:"text",placeholder:"Leave empty to keep current key",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.identity_key]]),t[64]||(t[64]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Leave empty to keep the current identity key",-1))])):(n(),s("div",Lt,' Click "Show/Edit" to change the identity key '))]),e("div",null,[t[65]||(t[65]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),m(e("input",{"onUpdate:modelValue":t[13]||(t[13]=r=>l.value.settings.node_name=r),type:"text",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.node_name]])]),e("div",St,[e("div",null,[t[66]||(t[66]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Latitude",-1)),m(e("input",{"onUpdate:modelValue":t[14]||(t[14]=r=>l.value.settings.latitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.latitude,void 0,{number:!0}]])]),e("div",null,[t[67]||(t[67]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Longitude",-1)),m(e("input",{"onUpdate:modelValue":t[15]||(t[15]=r=>l.value.settings.longitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.longitude,void 0,{number:!0}]])])]),e("div",$t,[e("div",null,[t[68]||(t[68]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Admin Password",-1)),m(e("input",{"onUpdate:modelValue":t[16]||(t[16]=r=>l.value.settings.admin_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.admin_password]]),t[69]||(t[69]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Full access to room server",-1))]),e("div",null,[t[70]||(t[70]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Guest Password",-1)),m(e("input",{"onUpdate:modelValue":t[17]||(t[17]=r=>l.value.settings.guest_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.guest_password]]),t[71]||(t[71]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Read-only access",-1))])])]),e("div",{class:"flex justify-end gap-3 mt-6"},[e("button",{onClick:W,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),e("button",{onClick:te,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Update ")])])])):u("",!0)]),Q(ke,{show:R.value,title:"Delete Room Server",message:`Are you sure you want to delete '${z.value}'? This action cannot be undone.`,"confirm-text":"Delete","cancel-text":"Cancel",variant:"danger",onClose:t[18]||(t[18]=r=>R.value=!1),onConfirm:oe},null,8,["show","message"]),Q(fe,{show:U.value,message:H.value.message,variant:H.value.variant,onClose:t[19]||(t[19]=r=>U.value=!1)},null,8,["show","message","variant"]),K.value?(n(),s("div",At,[e("div",Vt,[e("div",Bt,[t[79]||(t[79]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/20 via-primary/20 to-accent-purple/20"},null,-1)),t[80]||(t[80]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent"},null,-1)),e("div",Rt,[e("div",zt,[t[75]||(t[75]=G('<div class="relative"><div class="absolute inset-0 bg-secondary/40 blur-xl rounded-full"></div><div class="relative bg-secondary/20 p-3 rounded-[12px] border border-secondary/30"><svg class="w-6 h-6 text-secondary" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path></svg></div></div>',1)),e("div",null,[t[74]||(t[74]=e("h2",{class:"text-2xl font-bold text-content-primary dark:text-content-primary mb-1"},"Room Messages",-1)),e("p",Et,[t[73]||(t[73]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})],-1)),e("span",Ft,a(y.value),1)])])]),e("div",It,[e("button",{onClick:t[20]||(t[20]=r=>P.value=!0),class:"group px-3 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-[10px] text-xs font-medium transition-all hover:scale-105 border border-primary/30 flex items-center gap-2",title:"View active sessions"},[t[76]||(t[76]=e("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})],-1)),t[77]||(t[77]=e("span",{class:"hidden sm:inline"},"Sessions",-1)),e("span",Dt,a(M.value.length),1)]),e("button",{onClick:ue,class:"p-2 text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-[10px] transition-all"},t[78]||(t[78]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])])]),e("div",Nt,[$.value&&g.value.length===0?(n(),s("div",Ut,t[81]||(t[81]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),e("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading messages...")],-1)]))):C.value?(n(),s("div",Ht,[e("div",Kt,[t[82]||(t[82]=e("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load messages",-1)),e("div",Ot,a(C.value),1),e("button",{onClick:t[21]||(t[21]=r=>V(!0)),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):g.value.length>0?(n(),s("div",Pt,[(n(!0),s(D,null,q(g.value,(r,f)=>(n(),s("div",{key:r.id||f,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[12px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-secondary/30 transition-all duration-300 hover:shadow-lg hover:shadow-secondary/10"},[t[87]||(t[87]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",Tt,[e("div",Gt,[e("div",qt,[e("div",Jt,[t[84]||(t[84]=e("div",{class:"w-6 h-6 rounded-full bg-gradient-to-br from-primary/30 to-secondary/30 flex items-center justify-center"},[e("svg",{class:"w-3 h-3 text-content-secondary dark:text-content-primary/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})])],-1)),r.author_name?(n(),s("span",Wt,a(r.author_name),1)):u("",!0),r.author_pubkey?(n(),s("span",Xt,a(r.author_pubkey.substring(0,8))+"... ",1)):(n(),s("span",Qt," Anonymous ")),t[85]||(t[85]=e("span",{class:"text-content-muted dark:text-content-muted/60 text-xs"},"•",-1)),e("span",Yt,[t[83]||(t[83]=e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),b(" "+a(ce(r.timestamp)),1)]),r.id?(n(),s("span",Zt," #"+a(r.id),1)):u("",!0)])]),e("div",er,a(r.message_text),1)]),e("button",{onClick:me=>ie(r.id),class:"group/delete flex-shrink-0 p-2 bg-accent-red/10 hover:bg-accent-red/20 text-accent-red rounded-[8px] transition-all hover:scale-110 border border-accent-red/20",title:"Delete this message"},t[86]||(t[86]=[e("svg",{class:"w-4 h-4 group-hover/delete:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,tr)])]))),128)),O.value&&!$.value?(n(),s("div",rr,[e("button",{onClick:de,class:"group px-6 py-2.5 bg-gradient-to-r from-gray-100 dark:from-white/5 to-gray-200 dark:to-white/10 hover:from-gray-200 dark:hover:from-white/10 hover:to-gray-300 dark:hover:to-white/15 text-content-primary dark:text-content-primary rounded-[10px] transition-all hover:scale-105 text-sm font-medium border border-stroke-subtle dark:border-stroke/10 flex items-center gap-2 mx-auto"},t[88]||(t[88]=[e("svg",{class:"w-4 h-4 group-hover:translate-y-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1),b(" Load More Messages ",-1)]))])):$.value?(n(),s("div",or,t[89]||(t[89]=[e("div",{class:"flex items-center justify-center gap-2 text-content-secondary dark:text-content-muted text-sm"},[e("div",{class:"animate-spin w-4 h-4 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full"}),b(" Loading... ")],-1)]))):u("",!0)])):(n(),s("div",sr,t[90]||(t[90]=[G('<div class="text-center py-12"><div class="relative mb-6"><div class="absolute inset-0 bg-secondary/20 blur-3xl rounded-full"></div><div class="relative bg-gradient-to-br from-secondary/20 to-primary/20 p-6 rounded-[20px] inline-block border border-stroke-subtle dark:border-white/10"><svg class="w-16 h-16 text-content-muted dark:text-content-muted/70" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path></svg></div></div><p class="text-xl font-bold text-content-primary dark:text-content-primary mb-2">No messages yet</p><p class="text-sm text-content-secondary dark:text-content-muted">Be the first to start the conversation</p></div>',1)])))]),e("div",nr,[t[93]||(t[93]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none"},null,-1)),e("div",ar,[e("div",lr,[e("div",dr,[m(e("textarea",{"onUpdate:modelValue":t[22]||(t[22]=r=>k.value=r),onKeydown:[Y(Z(T,["ctrl"]),["enter"]),Y(Z(T,["meta"]),["enter"])],placeholder:"Type your message... (Ctrl+Enter to send)",rows:"3",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-3 text-content-primary dark:text-content-primary text-sm placeholder-gray-500 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 focus:bg-white dark:focus:bg-white/10 transition-all resize-none"},null,40,ir),[[v,k.value]])]),e("button",{onClick:T,disabled:!k.value.trim(),class:h(["group px-6 py-3 rounded-[12px] transition-all duration-200 flex items-center justify-center gap-2 font-medium",k.value.trim()?"bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary border border-primary/50 hover:scale-105 hover:shadow-lg hover:shadow-primary/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"])},t[91]||(t[91]=[e("svg",{class:"w-5 h-5 group-hover:translate-x-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})],-1),e("span",{class:"hidden sm:inline"},"Send",-1)]),10,ur)]),t[92]||(t[92]=e("p",{class:"text-content-secondary dark:text-content-muted/60 text-xs flex items-center gap-2"},[e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),b(" Press Ctrl+Enter to send message quickly ")],-1))])])])])):u("",!0),P.value?(n(),s("div",cr,[e("div",pr,[e("div",mr,[e("div",null,[t[95]||(t[95]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary"},"Active Sessions",-1)),e("p",vr,[t[94]||(t[94]=b("Room: ",-1)),e("span",xr,a(y.value),1)])]),e("button",{onClick:t[23]||(t[23]=r=>P.value=!1),class:"text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary transition-colors"},t[96]||(t[96]=[e("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),e("div",br,[M.value.length===0?(n(),s("div",yr,t[97]||(t[97]=[e("div",{class:"text-content-secondary dark:text-content-muted"},"No active sessions found",-1)]))):u("",!0),(n(!0),s(D,null,q(M.value,(r,f)=>(n(),s("div",{key:r.public_key_full||f,class:"glass-card backdrop-blur-xl rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10"},[e("div",gr,[e("div",kr,[e("div",fr,[e("span",hr,a(r.identity_name||"Unknown"),1),e("span",{class:h(["px-2 py-0.5 text-xs font-medium rounded",r.permissions==="admin"?"bg-accent-green/20 text-accent-green":"bg-secondary/20 text-secondary"])},a(r.permissions),3)]),e("div",wr,[e("span",_r,a(r.identity_type),1),e("button",{onClick:me=>pe(r.public_key_full,r.identity_hash),class:"px-2 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors",title:"Remove client from ACL"}," Remove ",8,Cr)])]),e("div",Mr,[e("div",jr,[t[98]||(t[98]=e("span",{class:"text-content-secondary dark:text-content-muted"},"Short Key:",-1)),e("code",Lr,a(r.public_key),1)]),e("div",Sr,[t[99]||(t[99]=e("span",{class:"text-content-secondary dark:text-content-muted"},"Full Key:",-1)),e("code",$r,a(r.public_key_full),1)])]),e("div",Ar,[e("div",Vr,[r.address?(n(),s("span",Br,"📍 "+a(r.address),1)):u("",!0),r.last_login_success?(n(),s("span",Rr,"Last Login: "+a(new Date(r.last_login_success*1e3).toLocaleString()),1)):u("",!0)]),r.last_activity?(n(),s("span",zr,"Active: "+a(Math.floor((Date.now()/1e3-r.last_activity)/60))+"m ago",1)):u("",!0)])])]))),128))])])])):u("",!0)],64))}});export{Ur as default};
|