import{c as e,az as r}from"./index-ltw-H9qF.js";const n=e("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),o=e("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),t=e("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);function a(e){var r;const n=(null==(r=e.contact_type)?void 0:r.toLowerCase())??"";return"room server"===n||"room_server"===n||"room"===n||"server"===n?{type:"room_server",isRepeater:!0===e.is_repeater,isCompanion:!1,isRoomServer:!0,isClient:!1,label:"Room Server",badgeText:"ROOM"}:"companion"===n?{type:"companion",isRepeater:!1,isCompanion:!0,isRoomServer:!1,isClient:!1,label:"Companion",badgeText:"COMP"}:"client"===n||"cli"===n?{type:"companion",isRepeater:!1,isCompanion:!1,isRoomServer:!1,isClient:!0,label:"Client",badgeText:"CLI"}:"repeater"===n||"rep"===n||!0===e.is_repeater?{type:"repeater",isRepeater:!0,isCompanion:!1,isRoomServer:!1,isClient:!1,label:"Repeater",badgeText:"RPT"}:{type:"unknown",isRepeater:!1,isCompanion:!1,isRoomServer:!1,isClient:!1,label:"Unknown",badgeText:""}}function s(e,r){const n=a({});if(!e||!r)return{name:null,nodeType:n};const o=e.startsWith("0x")?e.slice(2):e;for(const[t,s]of Object.entries(r))if((t.startsWith("0x")?t.slice(2):t).toLowerCase().startsWith(o.toLowerCase()))return{name:s.name||s.node_name||null,nodeType:a(s)};return{name:null,nodeType:n}}function i(e){switch(e){case r.GRP_TXT:case r.TXT_MSG:case r.REQ:case r.ANON_REQ:return"companion";case r.TRACE:case r.PATH:return"repeater";case r.GRP_DATA:return"room_server";default:return"unknown"}}function c(e){switch(e){case"chat":return"companion";case"repeater":return"repeater";case"room_server":return"room_server";default:return"unknown"}}export{o as C,t as a,n as b,a as c,s as g,i,c as m};
