@sleep2agi/agent-network-dashboard 0.4.6-preview.112 → 0.4.6-preview.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/diagnostics/route-bundle-stats.json +4 -4
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +2 -2
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin.html +2 -2
- package/.next/server/app/admin.rsc +2 -2
- package/.next/server/app/admin.segments/_full.segment.rsc +2 -2
- package/.next/server/app/admin.segments/_head.segment.rsc +1 -1
- package/.next/server/app/admin.segments/_index.segment.rsc +2 -2
- package/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/admin.segments/admin.segment.rsc +1 -1
- package/.next/server/app/index.html +2 -2
- package/.next/server/app/index.rsc +3 -3
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +2 -2
- package/.next/server/app/login.rsc +3 -3
- package/.next/server/app/login.segments/_full.segment.rsc +3 -3
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +2 -2
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/logs.html +2 -2
- package/.next/server/app/logs.rsc +2 -2
- package/.next/server/app/logs.segments/_full.segment.rsc +2 -2
- package/.next/server/app/logs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/logs.segments/_index.segment.rsc +2 -2
- package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/logs.segments/logs.segment.rsc +1 -1
- package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
- package/.next/server/app/messages.html +2 -2
- package/.next/server/app/messages.rsc +2 -2
- package/.next/server/app/messages.segments/_full.segment.rsc +2 -2
- package/.next/server/app/messages.segments/_head.segment.rsc +1 -1
- package/.next/server/app/messages.segments/_index.segment.rsc +2 -2
- package/.next/server/app/messages.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/messages.segments/messages.segment.rsc +1 -1
- package/.next/server/app/node/page_client-reference-manifest.js +1 -1
- package/.next/server/app/node.html +2 -2
- package/.next/server/app/node.rsc +2 -2
- package/.next/server/app/node.segments/_full.segment.rsc +2 -2
- package/.next/server/app/node.segments/_head.segment.rsc +1 -1
- package/.next/server/app/node.segments/_index.segment.rsc +2 -2
- package/.next/server/app/node.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/node.segments/node.segment.rsc +1 -1
- package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/nodes.html +2 -2
- package/.next/server/app/nodes.rsc +2 -2
- package/.next/server/app/nodes.segments/_full.segment.rsc +2 -2
- package/.next/server/app/nodes.segments/_head.segment.rsc +1 -1
- package/.next/server/app/nodes.segments/_index.segment.rsc +2 -2
- package/.next/server/app/nodes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/nodes.segments/nodes.segment.rsc +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/server-logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/server-logs.html +2 -2
- package/.next/server/app/server-logs.rsc +2 -2
- package/.next/server/app/server-logs.segments/_full.segment.rsc +2 -2
- package/.next/server/app/server-logs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/server-logs.segments/_index.segment.rsc +2 -2
- package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/server-logs.segments/server-logs.segment.rsc +1 -1
- package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/networks.html +2 -2
- package/.next/server/app/settings/networks.rsc +2 -2
- package/.next/server/app/settings/networks.segments/_full.segment.rsc +2 -2
- package/.next/server/app/settings/networks.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/settings.segment.rsc +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens.html +2 -2
- package/.next/server/app/settings/tokens.rsc +2 -2
- package/.next/server/app/settings/tokens.segments/_full.segment.rsc +2 -2
- package/.next/server/app/settings/tokens.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/settings.segment.rsc +1 -1
- package/.next/server/app/settings.html +2 -2
- package/.next/server/app/settings.rsc +3 -3
- package/.next/server/app/settings.segments/_full.segment.rsc +3 -3
- package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
- package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks.html +2 -2
- package/.next/server/app/tasks.rsc +2 -2
- package/.next/server/app/tasks.segments/_full.segment.rsc +2 -2
- package/.next/server/app/tasks.segments/_head.segment.rsc +1 -1
- package/.next/server/app/tasks.segments/_index.segment.rsc +2 -2
- package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/tasks.segments/tasks.segment.rsc +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js.map +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js +1 -1
- package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +2 -2
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/0d--gbyab-v7s.css +2 -0
- package/.next/static/chunks/{0o1s~o3f9f84c.js → 0g6p4eq70q6i3.js} +1 -1
- package/.next/static/chunks/{0h8km8znayry8.js → 0h24lkna3-_3v.js} +1 -1
- package/.next/static/chunks/{09t1rv4-r8156.js → 0rq7zc3c6~k5q.js} +3 -3
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/app/components/TopoGraph.tsx +24 -10
- package/package.json +1 -1
- package/scripts/topo-legend-panel-header-test.mjs +83 -0
- package/.next/static/chunks/115k17sotk9jg.css +0 -2
- /package/.next/static/{KpPCct8cnXFRc8SfmjhKb → j0uI-MQ8MXUGBpownTJQf}/_buildManifest.js +0 -0
- /package/.next/static/{KpPCct8cnXFRc8SfmjhKb → j0uI-MQ8MXUGBpownTJQf}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{KpPCct8cnXFRc8SfmjhKb → j0uI-MQ8MXUGBpownTJQf}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module.exports=[83077,(a,b,c)=>{},33737,(a,b,c)=>{a.r(83077);var d=a.r(54413),e=d&&"object"==typeof d&&"default"in d?d:{default:d},f="u">typeof process&&process.env&&!0,g=function(a){return"[object String]"===Object.prototype.toString.call(a)},h=function(){function a(a){var b=void 0===a?{}:a,c=b.name,d=void 0===c?"stylesheet":c,e=b.optimizeForSpeed,h=void 0===e?f:e;i(g(d),"`name` must be a string"),this._name=d,this._deletedRulePlaceholder="#"+d+"-deleted-rule____{}",i("boolean"==typeof h,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=h,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0,this._nonce=null}var b,c=a.prototype;return c.setOptimizeForSpeed=function(a){i("boolean"==typeof a,"`setOptimizeForSpeed` accepts a boolean"),i(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=a,this.inject()},c.isOptimizeForSpeed=function(){return this._optimizeForSpeed},c.inject=function(){var a=this;i(!this._injected,"sheet already injected"),this._injected=!0,this._serverSheet={cssRules:[],insertRule:function(b,c){return"number"==typeof c?a._serverSheet.cssRules[c]={cssText:b}:a._serverSheet.cssRules.push({cssText:b}),c},deleteRule:function(b){a._serverSheet.cssRules[b]=null}}},c.getSheetForTag=function(a){if(a.sheet)return a.sheet;for(var b=0;b<document.styleSheets.length;b++)if(document.styleSheets[b].ownerNode===a)return document.styleSheets[b]},c.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},c.insertRule=function(a,b){return i(g(a),"`insertRule` accepts only strings"),"number"!=typeof b&&(b=this._serverSheet.cssRules.length),this._serverSheet.insertRule(a,b),this._rulesCount++},c.replaceRule=function(a,b){this._optimizeForSpeed;var c=this._serverSheet;if(b.trim()||(b=this._deletedRulePlaceholder),!c.cssRules[a])return a;c.deleteRule(a);try{c.insertRule(b,a)}catch(d){f||console.warn("StyleSheet: illegal rule: \n\n"+b+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),c.insertRule(this._deletedRulePlaceholder,a)}return a},c.deleteRule=function(a){this._serverSheet.deleteRule(a)},c.flush=function(){this._injected=!1,this._rulesCount=0,this._serverSheet.cssRules=[]},c.cssRules=function(){return this._serverSheet.cssRules},c.makeStyleTag=function(a,b,c){b&&i(g(b),"makeStyleTag accepts only strings as second parameter");var d=document.createElement("style");this._nonce&&d.setAttribute("nonce",this._nonce),d.type="text/css",d.setAttribute("data-"+a,""),b&&d.appendChild(document.createTextNode(b));var e=document.head||document.getElementsByTagName("head")[0];return c?e.insertBefore(d,c):e.appendChild(d),d},b=[{key:"length",get:function(){return this._rulesCount}}],function(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}(a.prototype,b),a}();function i(a,b){if(!a)throw Error("StyleSheet: "+b+".")}var j=function(a){for(var b=5381,c=a.length;c;)b=33*b^a.charCodeAt(--c);return b>>>0},k={};function l(a,b){if(!b)return"jsx-"+a;var c=String(b),d=a+c;return k[d]||(k[d]="jsx-"+j(a+"-"+c)),k[d]}function m(a,b){var c=a+(b=b.replace(/\/style/gi,"\\/style"));return k[c]||(k[c]=b.replace(/__jsx-style-dynamic-selector/g,a)),k[c]}var n=function(){function a(a){var b=void 0===a?{}:a,c=b.styleSheet,d=void 0===c?null:c,e=b.optimizeForSpeed,f=void 0!==e&&e;this._sheet=d||new h({name:"styled-jsx",optimizeForSpeed:f}),this._sheet.inject(),d&&"boolean"==typeof f&&(this._sheet.setOptimizeForSpeed(f),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var b=a.prototype;return b.add=function(a){var b=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(a.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed());var c=this.getIdAndRules(a),d=c.styleId,e=c.rules;if(d in this._instancesCounts){this._instancesCounts[d]+=1;return}var f=e.map(function(a){return b._sheet.insertRule(a)}).filter(function(a){return -1!==a});this._indices[d]=f,this._instancesCounts[d]=1},b.remove=function(a){var b=this,c=this.getIdAndRules(a).styleId;if(function(a,b){if(!a)throw Error("StyleSheetRegistry: "+b+".")}(c in this._instancesCounts,"styleId: `"+c+"` not found"),this._instancesCounts[c]-=1,this._instancesCounts[c]<1){var d=this._fromServer&&this._fromServer[c];d?(d.parentNode.removeChild(d),delete this._fromServer[c]):(this._indices[c].forEach(function(a){return b._sheet.deleteRule(a)}),delete this._indices[c]),delete this._instancesCounts[c]}},b.update=function(a,b){this.add(b),this.remove(a)},b.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},b.cssRules=function(){var a=this,b=this._fromServer?Object.keys(this._fromServer).map(function(b){return[b,a._fromServer[b]]}):[],c=this._sheet.cssRules();return b.concat(Object.keys(this._indices).map(function(b){return[b,a._indices[b].map(function(a){return c[a].cssText}).join(a._optimizeForSpeed?"":"\n")]}).filter(function(a){return!!a[1]}))},b.styles=function(a){var b,c;return b=this.cssRules(),void 0===(c=a)&&(c={}),b.map(function(a){var b=a[0],d=a[1];return e.default.createElement("style",{id:"__"+b,key:"__"+b,nonce:c.nonce?c.nonce:void 0,dangerouslySetInnerHTML:{__html:d}})})},b.getIdAndRules=function(a){var b=a.children,c=a.dynamic,d=a.id;if(c){var e=l(d,c);return{styleId:e,rules:Array.isArray(b)?b.map(function(a){return m(e,a)}):[m(e,b)]}}return{styleId:l(d),rules:Array.isArray(b)?b:[b]}},b.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(a,b){return a[b.id.slice(2)]=b,a},{})},a}(),o=d.createContext(null);function p(){return new n}function q(){return d.useContext(o)}function r(a){var b=q();return b&&b.add(a),null}o.displayName="StyleSheetContext",e.default.useInsertionEffect||e.default.useLayoutEffect,r.dynamic=function(a){return a.map(function(a){return l(a[0],a[1])}).join(" ")},c.StyleRegistry=function(a){var b=a.registry,c=a.children,f=d.useContext(o),g=d.useState(function(){return f||b||p()})[0];return e.default.createElement(o.Provider,{value:g},c)},c.createStyleRegistry=p,c.style=r,c.useStyleRegistry=q},72100,(a,b,c)=>{b.exports=a.r(33737).style},87515,a=>{"use strict";var b=a.i(64247),c=a.i(54413),d=a.i(88534),e=a.i(92088);function f({online:a,working:c,total:d,version:e,uptime:h}){let i=d>0?Math.round(a/d*100):0,j=0===d;return(0,b.jsxs)("div",{className:j?"mb-4":"mb-8",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"Agent Network"}),(0,b.jsxs)("span",{className:"text-xs text-gray-500",children:["CommHub ",e," · ",h]})]}),j?(0,b.jsxs)("div",{className:"anet-stat-strip flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-gray-500 border-t border-b border-[#2a2a4a] py-2",children:[(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,b.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full bg-gray-600"}),(0,b.jsx)("span",{className:"text-gray-300 tabular-nums",children:"0"})," online"]}),(0,b.jsx)("span",{className:"text-gray-700",children:"·"}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,b.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full bg-gray-600"}),(0,b.jsx)("span",{className:"text-gray-300 tabular-nums",children:"0"})," working"]}),(0,b.jsx)("span",{className:"text-gray-700",children:"·"}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,b.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full bg-gray-600"}),(0,b.jsx)("span",{className:"text-gray-300 tabular-nums",children:"0"})," registered"]})]}):(0,b.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[(0,b.jsx)(g,{value:a,label:"Online",sub:`${i}% of fleet`,color:"text-green-400",accent:"from-green-500/20 to-green-500/0",border:"border-green-500/15"}),(0,b.jsx)(g,{value:c,label:"Working",sub:a>0?`${Math.round(c/a*100)}% utilization`:"--",color:"text-cyan-400",accent:"from-cyan-500/20 to-cyan-500/0",border:"border-cyan-500/15"}),(0,b.jsx)(g,{value:d-a,label:"Offline",sub:d-a==0?"All systems go":`${d-a} disconnected`,color:"text-gray-400",accent:"from-gray-500/10 to-gray-500/0",border:"border-gray-500/15"}),(0,b.jsx)(g,{value:d,label:"Total",sub:"Registered nodes",color:"text-white",accent:"from-blue-500/15 to-blue-500/0",border:"border-blue-500/15"})]})]})}function g({value:a,label:c,sub:d,color:e,accent:f,border:h}){let i=e.replace("text-","").split("-")[0];return(0,b.jsxs)("div",{"data-anet-stat-card":i,className:`anet-stat-card relative overflow-hidden rounded-xl border ${h} bg-[#111128] px-4 py-3 transition-all`,children:[(0,b.jsx)("div",{className:`absolute inset-0 bg-gradient-to-br ${f} pointer-events-none`}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:`text-3xl font-bold ${e} tabular-nums leading-tight`,children:a}),(0,b.jsx)("div",{className:"text-sm text-gray-300 mt-0.5",children:c}),(0,b.jsx)("div",{className:"text-xs text-gray-600 mt-1",children:d})]})]})}function h(){let[a,d]=(0,c.useState)(""),[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)(""),i=async()=>{if(a.trim()){f(!0),h("");try{let b=await fetch("/api/hub/broadcast",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:a})}),c=await b.json();c.ok?(h(`Broadcast sent to ${c.recipients} node(s)`),d("")):h(`Failed: ${c.error||"Send error"}`)}catch(a){h(`Failed: ${a instanceof Error?a.message:"Send error"}`)}f(!1),setTimeout(()=>h(""),5e3)}};return(0,b.jsxs)("div",{className:"mb-6",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)("input",{type:"text",value:a,onChange:a=>d(a.target.value),onKeyDown:a=>"Enter"===a.key&&i(),placeholder:"Broadcast message to all online agents...",maxLength:500,"aria-label":"Broadcast message",className:"flex-1 bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-2.5 text-sm text-white placeholder-gray-600 focus:border-blue-500/50 focus:ring-1 focus:ring-blue-500/20 focus:outline-none transition-colors"}),(0,b.jsx)("button",{onClick:i,disabled:e||!a.trim(),"aria-label":"Send broadcast",className:"flex items-center gap-2 px-5 py-2.5 bg-blue-600 hover:bg-blue-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-all font-medium cursor-pointer disabled:cursor-not-allowed",children:e?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,b.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),(0,b.jsx)("path",{d:"M4 12a8 8 0 018-8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),(0,b.jsx)("span",{children:"Sending…"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("path",{d:"M3 11v3a1 1 0 0 0 1 1h2l3.29 3.29a1 1 0 0 0 1.71-.71V7.42a1 1 0 0 0-1.71-.71L6 10H4a1 1 0 0 0-1 1Z"}),(0,b.jsx)("path",{d:"M16 8a5 5 0 0 1 0 6",opacity:"0.7"}),(0,b.jsx)("path",{d:"M19 5a9 9 0 0 1 0 12",opacity:"0.45"})]}),(0,b.jsx)("span",{children:"Broadcast"})]})})]}),a.length>0&&(0,b.jsxs)("div",{className:"text-right text-xs text-gray-600 mt-1 tabular-nums",children:[a.length,"/500"]}),g&&(0,b.jsx)("div",{className:`mt-3 text-sm text-center anet-fade-in ${g.startsWith("Failed")?"text-red-400":"text-green-400/80"}`,children:g})]})}var i=a.i(8893),j=a.i(91328),k=a.i(9943),l=a.i(92945);function m({alias:a,onClose:d}){let[e,f]=(0,c.useState)({x:0,y:0}),[g,h]=(0,c.useState)({w:380,h:520}),n=(0,c.useRef)({active:!1,startX:0,startY:0,baseX:0,baseY:0}),o=(0,c.useRef)({active:!1,startX:0,startY:0,baseW:0,baseH:0}),{sessions:p}=(0,k.useSessions)(),q=(0,c.useMemo)(()=>p.find(b=>b.alias===a),[p,a]),r=q&&"offline"!==q.status?null:(0,l.relativeAgo)(q?.last_seen_at),s=(0,c.useCallback)((a,b,c,d)=>({x:Math.min(Math.max(16,a),Math.max(16,window.innerWidth-c-16)),y:Math.min(Math.max(16,b),Math.max(16,window.innerHeight-d-16))}),[]);(0,c.useEffect)(()=>{let a=()=>{let a=window.innerWidth,b=window.innerHeight,c=Math.min(380,a-32),d=Math.min(520,b-96);h({w:c,h:d});let e=a<640;f(s(e?16:a-c-24,e?b-d-16:96,c,d))};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[s]),(0,c.useEffect)(()=>{let a=a=>{"Escape"===a.key&&d()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[d]);let t=a=>{if(n.current.active){n.current.active=!1;try{a.currentTarget.releasePointerCapture?.(a.pointerId)}catch{}}},u=a=>{if(o.current.active){o.current.active=!1,a.stopPropagation();try{a.currentTarget.releasePointerCapture?.(a.pointerId)}catch{}}};return(0,b.jsxs)("div",{className:"fixed z-50 flex flex-col overflow-hidden rounded-xl border border-[var(--border)] bg-[var(--bg)] shadow-2xl shadow-black/60 anet-fade-in",style:{left:e.x,top:e.y,width:g.w,height:g.h},role:"dialog","aria-label":`Chat with ${a}`,children:[(0,b.jsxs)("div",{onPointerDown:a=>{0===a.button&&(a.currentTarget.setPointerCapture?.(a.pointerId),n.current={active:!0,startX:a.clientX,startY:a.clientY,baseX:e.x,baseY:e.y})},onPointerMove:a=>{let b=n.current;b.active&&f(s(b.baseX+(a.clientX-b.startX),b.baseY+(a.clientY-b.startY),g.w,g.h))},onPointerUp:t,onPointerCancel:t,className:"flex items-center justify-between px-3 py-2.5 border-b border-[var(--border)] bg-[var(--bg-secondary)] rounded-t-xl cursor-grab active:cursor-grabbing select-none touch-none",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,b.jsx)(i.AliasAvatar,{alias:a,size:28}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-semibold text-[var(--fg)] truncate",children:a}),q?.project_dir?(0,b.jsxs)("div",{className:"text-[10px] text-[var(--fg-muted)] truncate font-mono",title:q.project_dir,"data-popover-cwd":!0,children:["cwd: ",q.project_dir]}):null,r?(0,b.jsxs)("div",{className:"text-[10px] text-[var(--fg-muted)] truncate","data-popover-lastseen":!0,children:["last seen: ",r]}):null,q?.project_dir||r?null:(0,b.jsx)("div",{className:"text-[10px] text-[var(--fg-muted)]",children:"Drag to move · Esc to close"})]})]}),(0,b.jsx)("button",{onClick:d,onPointerDown:a=>a.stopPropagation(),"aria-label":"Close chat",className:"text-[var(--fg-muted)] hover:text-[var(--fg)] p-1.5 rounded-lg hover:bg-[var(--bg-elevated)] shrink-0",children:(0,b.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0",children:(0,b.jsx)(j.TaskChatPanel,{alias:a,onClose:d,inline:!0})}),(0,b.jsx)("div",{onPointerDown:a=>{0===a.button&&(a.stopPropagation(),a.currentTarget.setPointerCapture?.(a.pointerId),o.current={active:!0,startX:a.clientX,startY:a.clientY,baseW:g.w,baseH:g.h})},onPointerMove:a=>{let b=o.current;if(!b.active)return;a.stopPropagation();let c=Math.max(300,window.innerWidth-e.x-16),d=Math.max(320,window.innerHeight-e.y-16);h({w:Math.min(c,Math.max(300,b.baseW+(a.clientX-b.startX))),h:Math.min(d,Math.max(320,b.baseH+(a.clientY-b.startY)))})},onPointerUp:u,onPointerCancel:u,"aria-label":"Resize chat",className:"absolute bottom-0 right-0 w-5 h-5 cursor-nwse-resize touch-none z-10",style:{touchAction:"none"},children:(0,b.jsx)("svg",{className:"absolute bottom-0.5 right-0.5 w-3 h-3 text-[var(--fg-dim)]",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":!0,children:(0,b.jsx)("path",{d:"M11 5L5 11M11 9L9 11"})})})]})}let n={id:"unknown",label:"Unknown vendor",mono:{bg:"hsl(220 10% 26%)",ring:"hsl(220 10% 46%)",text:"hsl(220 14% 82%)"},initial:"?",logo:null},o=[{test:a=>a.startsWith("intern"),vendor:{id:"intern",label:"书生 · 上海 AI 实验室",mono:{bg:"hsl(28 38% 24%)",ring:"hsl(32 45% 52%)",text:"hsl(34 60% 82%)"},initial:"书",logo:"/intern_avatar.png"}},{test:a=>a.startsWith("minimax"),vendor:{id:"minimax",label:"MiniMax",mono:{bg:"hsl(18 50% 26%)",ring:"hsl(18 65% 52%)",text:"hsl(20 80% 82%)"},initial:"M",logo:null}},{test:a=>a.startsWith("claude"),vendor:{id:"anthropic",label:"Anthropic",mono:{bg:"hsl(16 32% 26%)",ring:"hsl(16 48% 54%)",text:"hsl(18 60% 84%)"},initial:"A",logo:null}},{test:a=>a.startsWith("gpt")||a.startsWith("codex")||a.startsWith("o1")||a.startsWith("o3")||a.startsWith("o4"),vendor:{id:"openai",label:"OpenAI",mono:{bg:"hsl(165 26% 22%)",ring:"hsl(165 40% 44%)",text:"hsl(165 45% 80%)"},initial:"O",logo:null}}];function p(a){if(!a)return n;let b=a.toLowerCase();for(let a of o)if(a.test(b))return a.vendor;return n}let q={"claude-code-cli":{label:"Claude Code CLI",iconPath:"M4 5h16v14H4z M7 9l3 3-3 3 M13 15h4",color:"#a78bfa"},"codex-sdk":{label:"Codex SDK",iconPath:"M9 7l-5 5 5 5 M15 7l5 5-5 5",color:"#38bdf8"},"claude-agent-sdk":{label:"Claude Agent SDK",iconPath:"M4 7h16v10H4z M8 11h8 M8 14h5",color:"#34d399"},"http-api":{label:"HTTP API",iconPath:"M7 18a4 4 0 010-8 5 5 0 019.6-1.3A3.5 3.5 0 0118 18z",color:"#fbbf24"}};function r(a){return a?q[a]??null:null}function s(a,b,c,d=0){let e=b<=2?Math.PI:1.78*Math.PI,f=-Math.PI/2-e/2,g=b<=1?-Math.PI/2:f+e*a/(b-1)+d;return{x:500+c*Math.cos(g),y:330+c*Math.sin(g)}}function t(a,b,c=0){let d=(a.x+b.x)/2,e=(a.y+b.y)/2,f=b.x-a.x,g=b.y-a.y,h=Math.hypot(f,g)||1,i={x:d+-g/h*c,y:e+f/h*c};return`M${a.x},${a.y} Q${i.x},${i.y} ${b.x},${b.y}`}function u(a,b){return a.length>b?`${a.slice(0,b-1)}...`:a}function v({sessions:a}){let d=(0,c.useRef)(Date.now()),[e,f]=(0,c.useState)(()=>Date.now());(0,c.useEffect)(()=>{d.current=Date.now()},[a]),(0,c.useEffect)(()=>{let a=setInterval(()=>f(Date.now()),1e3);return()=>clearInterval(a)},[]);let g=Math.max(0,Math.floor((e-d.current)/1e3)),h=g>10;return(0,b.jsxs)("span",{className:h?"hidden sm:inline px-2.5 py-1 rounded-md bg-amber-500/10 text-amber-300 border border-amber-500/20 font-mono":"hidden sm:inline px-2.5 py-1 rounded-md bg-gray-500/10 text-gray-400 border border-gray-500/20 font-mono",title:h?`Last sync ${g}s ago — SWR refresh may be lagging`:`Live data \xb7 refreshes every 5s \xb7 last sync ${g}s ago`,"data-freshness-chip":!0,children:["live · ",g,"s"]})}function w(a,b,c){return b?"working"===a.status?{label:"working",primary:c?"#059669":"#22c55e",halo:c?"#d1fae5":"#14532d",text:c?"#065f46":"#dcfce7"}:"idle"===a.status?{label:"idle",primary:c?"#0d9488":"#2dd4bf",halo:c?"#ccfbf1":"#134e4a",text:c?"#115e59":"#ccfbf1"}:{label:a.status||"online",primary:c?"#0284c7":"#38bdf8",halo:c?"#e0f2fe":"#0c4a6e",text:c?"#0c4a6e":"#e0f2fe"}:{label:"offline",primary:c?"#94a3b8":"#6b7280",halo:c?"#e2e8f0":"#111827",text:c?"#475569":"#9ca3af"}}let x={panelStops:["#0b1220","#080814","#101018"],radarStops:[{color:"#22d3ee",opacity:.18},{color:"#22c55e",opacity:.045},{color:"#020617",opacity:0}],arrowFill:"#67e8f9",ringStroke:"#164e63",spokeStroke:{active:"#22d3ee",idle:"#155e75"},flowEdge:"#67e8f9",flowPath:"#e0f2fe",flowParticle:"#fef08a",nodeFill:{online:"#020617",offline:"#080814"},labelBox:{fill:"#020617",stroke:"#1f2937"},legendBox:{fill:"#020617",stroke:"#1f2937"},legendText:"#94a3b8",legendHeadline:"#e5e7eb",legendAccent:"#67e8f9",containerBg:"#080814",containerBorder:"#2a2a4a",topRailGradient:"from-transparent via-cyan-400/70 to-transparent"},y={panelStops:["#f8fafc","#ffffff","#f1f5f9"],radarStops:[{color:"#10b981",opacity:.06},{color:"#3b82f6",opacity:.03},{color:"#ffffff",opacity:0}],arrowFill:"#10b981",ringStroke:"#cbd5e1",spokeStroke:{active:"#10b981",idle:"#cbd5e1"},flowEdge:"#10b981",flowPath:"#475569",flowParticle:"#f59e0b",nodeFill:{online:"#ffffff",offline:"#f8fafc"},labelBox:{fill:"#ffffff",stroke:"#e2e8f0"},legendBox:{fill:"#ffffff",stroke:"#e2e8f0"},legendText:"#475569",legendHeadline:"#0f172a",legendAccent:"#0d9488",containerBg:"#ffffff",containerBorder:"#e3e6eb",topRailGradient:"from-transparent via-emerald-500/40 to-transparent"};function z(a,b){let c=0;for(;c<a.length&&c<b.length&&a[c]===b[c];)c++;return a.slice(0,c)}function A(a){let b=a.length,c=a.map((a,b)=>b),d=a=>{for(;c[a]!==a;)c[a]=c[c[a]],a=c[a];return a},e=(a,b)=>{let e=d(a),f=d(b);e!==f&&(c[e]=f)},f={};for(let b of(a.forEach((a,b)=>{let c=a.project_dir?.trim();c&&(f[c]||=[]).push(b)}),Object.values(f)))for(let a=1;a<b.length;a++)e(b[0],b[a]);let g=a.map((a,b)=>b).sort((b,c)=>a[b].alias.localeCompare(a[c].alias));for(let b=0;b+1<g.length;b++)z(a[g[b]].alias,a[g[b+1]].alias).length>=2&&e(g[b],g[b+1]);let h={};for(let a=0;a<b;a++)(h[d(a)]||=[]).push(a);let i={};for(let b of Object.values(h)){let c;if(1===b.length)c=a[b[0]].alias;else{let d=new Set(b.map(b=>a[b].project_dir?.trim()).filter(Boolean));if(1===d.size){let a=[...d][0];c=a.split("/").filter(Boolean).pop()||a}else(c=b.map(b=>a[b].alias).reduce((a,b)=>z(a,b))).length<2&&(c=a[b[0]].alias)}for(let d of b)i[a[d].alias]=c}return i}function B(a,b){let c=new Map;return a.forEach(a=>{if(!b[a.from_alias]||!b[a.to_alias]||a.from_alias===a.to_alias)return;let d=`${a.from_alias}->${a.to_alias}`,e=c.get(d),f=a.created_at||"",g=e?f>e.last_at?f:e.last_at:f;c.set(d,{key:d,from:a.from_alias,to:a.to_alias,count:(e?.count||0)+1,content:e?.content||a.content,last_at:g})}),[...c.values()].slice(0,18)}function C({sessions:a,sseSessions:d,renameSignal:e}){let f,g,h,j,k,n,o,q,z,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W="light"===function(){let[a,b]=(0,c.useState)("dark");return(0,c.useEffect)(()=>{let a=()=>{let a=document.documentElement.getAttribute("data-theme")||"cyber";b("light"===a||"mint"===a?"light":"dark")};a();let c=new MutationObserver(a);return c.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>c.disconnect()},[]),a}(),X=function(){let[a,b]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{},[]),a}(),Y=W?y:x,Z="intern"===function(){let[a,b]=(0,c.useState)(null);return(0,c.useEffect)(()=>{try{let a=new URL(window.location.href).searchParams.get("brand");null!==a?""===a||"none"===a?(localStorage.removeItem("anet-brand"),b(null)):(localStorage.setItem("anet-brand",a),b(a)):b(localStorage.getItem("anet-brand"))}catch{}},[]),a}(),[$,_]=(0,c.useState)([]),[aa,ab]=(0,c.useState)("ring");(0,c.useEffect)(()=>{try{let a=localStorage.getItem("anet-topo-layout");("grid"===a||"ring"===a)&&ab(a)}catch{}},[]);let ac=()=>ab(a=>{let b="ring"===a?"grid":"ring";try{localStorage.setItem("anet-topo-layout",b)}catch{}return b}),[ad,ae]=(0,c.useState)(.84);(0,c.useEffect)(()=>{try{let a=parseFloat(localStorage.getItem("anet-topo-nodescale")||"");(.7===a||.84===a||1===a)&&ae(a)}catch{}},[]),(0,c.useEffect)(()=>{let a=async()=>{try{let a=await fetch("/api/hub/messages?limit=50");if(401===a.status)return void window.location.assign("/login");let b=await a.json();_(b.messages||[])}catch{}};a();let b=setInterval(a,5e3);return()=>clearInterval(b)},[]);let{onlineNodes:af,offlineNodes:ag,nodePositions:ah,flowLinks:ai,activeAliases:aj,groupKeys:ak,groupBoxes:al,gridContentBottom:am}=(0,c.useMemo)(()=>{let b=a=>(a.network_id?d[`${a.network_id}:${a.alias}`]:void 0)??d[a.alias],c=(a,b)=>a.alias.localeCompare(b.alias),e=Date.now(),f=a.filter(a=>"offline"!==a.status||b(a)).sort(c),g=a.filter(a=>"offline"===a.status&&!b(a)&&!(a=>{if("offline"!==a.status||b(a)||!a.last_seen_at)return!1;let c=(0,l.parseHubTime)(a.last_seen_at);return null!==c&&e-c>36e5})(a)).sort(c),h={};if("grid"===aa){let a=[...f,...g],c=A(a),d=Math.max(1,Math.ceil(Math.sqrt(a.length))),e=700/d,i=Math.round(26*ad),j=[];for(let b of a){let a=c[b.alias],d=j[j.length-1];d&&d.key===a?d.members.push(b):j.push({key:a,members:[b]})}let k=[],l=0,m=0;for(;m<j.length;)if(j[m].members.length>=2)k.push({members:j[m].members,startRow:l,centred:!1,isGroup:!0}),l+=Math.ceil(j[m].members.length/d),m++;else{let a=[];for(;m<j.length&&j[m].members.length<2;)a.push(j[m].members[0]),m++;k.push({members:a,startRow:l,centred:!0,isGroup:!1}),l+=Math.ceil(a.length/d)}let n=Math.max(1,l),o=i+20,p=Math.max(2*i+22,o+12,i+(ad<.8?12:14)+o+3,Math.min(100,526/n));for(let a of k)a.members.forEach((b,c)=>{let f=Math.floor(c/d),g=c%d,i=Math.min(d,a.members.length-f*d),j=a.centred?(d-i)*e/2:0;h[b.alias]={x:150+j+(g+.5)*e,y:126+(a.startRow+f+.5)*p}});let q=B($,h),r=new Set;q.forEach(a=>{r.add(a.from),r.add(a.to)});let s=Math.max(8,Math.min(26,p-o-8)),t=k.filter(a=>a.isGroup).map(a=>{let d=a.members.map(a=>h[a.alias]).filter(Boolean),e=d.map(a=>a.x),f=d.map(a=>a.y),g=Math.min(...e),i=Math.min(...f),j=0,k=0,l=0;for(let c of a.members){let a="offline"!==c.status||!!b(c);"working"===c.status?j++:a?k++:l++}return{key:a.members.length?c[a.members[0].alias]:"",count:a.members.length,statuses:{working:j,idle:k,offline:l},x:g-s,y:i-o,w:Math.max(...e)-g+2*s,h:Math.max(...f)-i+o+s}});return{onlineNodes:f,offlineNodes:g,nodePositions:h,flowLinks:q,activeAliases:r,groupKeys:c,groupBoxes:t,gridContentBottom:126+n*p+8}}let i=f.length>14,j=!i&&f.length>8,k=f.length;if(i){let a=Math.ceil(f.length/3),b=f.slice(0,a),c=f.slice(a,2*a),d=f.slice(2*a);b.forEach((a,c)=>{h[a.alias]=s(c,Math.max(b.length,1),145)});let e=b.length<=2?Math.PI:1.78*Math.PI,g=b.length>1?e/(b.length-1):0;c.forEach((a,b)=>{h[a.alias]=s(b,Math.max(c.length,1),215,g/2)}),d.forEach((a,b)=>{h[a.alias]=s(b,Math.max(d.length,1),285)}),k=d.length}else if(j){let a=Math.ceil(f.length/2),b=f.length-a,c=f.slice(0,a),d=f.slice(a);c.forEach((b,c)=>{h[b.alias]=s(c,Math.max(a,1),175)});let e=a<=2?Math.PI:1.78*Math.PI,g=a>1?e/(a-1):0;d.forEach((a,c)=>{h[a.alias]=s(c,Math.max(b,1),260,g/2)}),k=b}else f.forEach((a,b)=>{h[a.alias]=s(b,Math.max(f.length,1),220)});let m=k<=2?Math.PI:1.78*Math.PI,n=k>1?m/(k-1):0,o=k>0?n/2:0,p=325+6*Math.max(0,g.length-4);g.forEach((a,b)=>{h[a.alias]=s(b,Math.max(g.length,1),p,o)});let q=B($,h),r=new Set;q.forEach(a=>{r.add(a.from),r.add(a.to)});let t=A([...f,...g]);return{onlineNodes:f,offlineNodes:g,nodePositions:h,flowLinks:q,activeAliases:r,groupKeys:t,groupBoxes:[],gridContentBottom:0}},[$,a,d,aa,ad]),an=af.filter(a=>"working"===a.status).length,ao=(0,c.useMemo)(()=>{let a=new Map;for(let b of[...af,...ag]){let c=p(b.model),d="unknown"===c.id?"?":c.initial,e=a.get(d);e?e.count++:a.set(d,{initial:d,count:1,color:c.mono.text})}return[...a.values()].sort((a,b)=>b.count-a.count)},[af,ag]),ap=af.length+ag.length>16,[aq,ar]=(0,c.useState)(null),[as,at]=(0,c.useState)(null),au=as??(aq?ak[aq]??aq:null),[av,aw]=(0,c.useState)(()=>null),ax=au??av;(0,c.useEffect)(()=>{try{av?sessionStorage.setItem("anet-topo-pinned-group",av):sessionStorage.removeItem("anet-topo-pinned-group")}catch{}},[av]),(0,c.useEffect)(()=>{!av||new Set(Object.values(ak)).has(av)||aw(null)},[av,ak]);let[ay,az]=(0,c.useState)(null),[aA,aB]=(0,c.useState)(!1),[aC,aD]=(0,c.useState)(null),[aE,aF]=(0,c.useState)(()=>null),aG=aC??aE;(0,c.useEffect)(()=>{try{aE?sessionStorage.setItem("anet-topo-pinned-vendor",aE):sessionStorage.removeItem("anet-topo-pinned-vendor")}catch{}},[aE]),(0,c.useEffect)(()=>{aE&&!ao.some(a=>a.initial===aE)&&aF(null)},[aE,ao]);let[aH,aI]=(0,c.useState)(null),[aJ,aK]=(0,c.useState)(()=>null),aL=aH??aJ;(0,c.useEffect)(()=>{try{aJ?sessionStorage.setItem("anet-topo-pinned-status",aJ):sessionStorage.removeItem("anet-topo-pinned-status")}catch{}},[aJ]),(0,c.useEffect)(()=>{let a=a=>{let b=a.detail||{};if("clear"===b.kind)aK(null),aw(null),aF(null);else if("clear-vendor"===b.kind)aF(null);else if("status"===b.kind){let a=b.value;("working"===a||"idle"===a||"offline"===a)&&aK(a)}else"group"===b.kind&&"string"==typeof b.value&&aw(b.value)};return window.addEventListener("anet:topo-pin",a),()=>window.removeEventListener("anet:topo-pin",a)},[]);let aM=(0,c.useMemo)(()=>{if(!ay)return null;let a=ai.find(a=>a.key===ay);return a?new Set([a.from,a.to]):null},[ay,ai]),aN=(0,c.useRef)(null),aO=(0,c.useRef)(null),[aP,aQ]=(0,c.useState)({zoom:1,x:0,y:0}),aR=(0,c.useRef)(aP),aS=(0,c.useRef)({active:!1,startX:0,startY:0,baseX:0,baseY:0}),[aT,aU]=(0,c.useState)(!1),[aV,aW]=(0,c.useState)(null),[aX,aY]=(0,c.useState)(null);(0,c.useEffect)(()=>{e&&e.from===aV&&aW(e.to)},[e]),(0,c.useEffect)(()=>{aR.current=aP},[aP]),(0,c.useEffect)(()=>{try{let a=localStorage.getItem("anet-topo-view");if(a){let b=JSON.parse(a);"number"==typeof b?.zoom&&aQ({zoom:Math.min(4,Math.max(.5,b.zoom)),x:"number"==typeof b.x?b.x:0,y:"number"==typeof b.y?b.y:0})}}catch{}},[]);let[aZ]=(0,c.useState)(()=>!1),a$=(0,c.useRef)(!1);(0,c.useEffect)(()=>{if(!a$.current){if(aZ){a$.current=!0;return}if("grid"===aa&&0!==a.length&&am){if(am<=680){a$.current=!0;return}aQ({zoom:Math.max(.5,Math.min(1,680/am)),x:0,y:0}),a$.current=!0}}},[aa,a.length,am,aZ]),(0,c.useEffect)(()=>{try{localStorage.setItem("anet-topo-view",JSON.stringify(aP))}catch{}},[aP]),(0,c.useEffect)(()=>{let a=()=>aU(document.fullscreenElement===aN.current);return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]),(0,c.useEffect)(()=>{let a=aO.current;if(!a)return;let b=b=>{if(!aT&&!b.ctrlKey&&!b.metaKey)return;b.preventDefault();let c=a.getBoundingClientRect(),d=(b.clientX-c.left)/c.width*1e3,e=(b.clientY-c.top)/c.height*680;aQ(a=>{let c=Math.min(1.08,Math.max(.926,Math.exp(-(6e-4*b.deltaY)))),f=Math.min(4,Math.max(.5,a.zoom*c)),g=f/a.zoom;return{zoom:f,x:d-(d-a.x)*g,y:e-(e-a.y)*g}})};return a.addEventListener("wheel",b,{passive:!1}),()=>a.removeEventListener("wheel",b)},[aT]);let[a_,a0]=(0,c.useState)(!1),a1=a=>{if(aS.current.active){aS.current.active=!1,a0(!1);try{a.currentTarget.releasePointerCapture?.(a.pointerId)}catch{}}},a2=a=>{aQ(b=>{let c=Math.min(4,Math.max(.5,b.zoom*a)),d=c/b.zoom;return{zoom:c,x:500-(500-b.x)*d,y:340-(340-b.y)*d}})},a3=()=>aQ({zoom:1,x:0,y:0}),a4=(0,c.useCallback)(()=>{aQ({zoom:!am||am<=680?1:Math.max(.5,Math.min(1,680/am)),x:0,y:0})},[am]);return(0,c.useEffect)(()=>{let a=a=>{"toggle"===(a.detail||{}).kind&&ac()},b=a=>{"fit"===(a.detail||{}).kind&&a4()};return window.addEventListener("anet:topo-layout",a),window.addEventListener("anet:topo-view",b),()=>{window.removeEventListener("anet:topo-layout",a),window.removeEventListener("anet:topo-view",b)}},[a4]),(0,c.useEffect)(()=>{let a=a=>{if(a.ctrlKey||a.metaKey||a.altKey)return;let b=document.activeElement;if(b){let a=b.tagName;if("INPUT"===a||"TEXTAREA"===a||"SELECT"===a||b.isContentEditable)return}"+"===a.key||"="===a.key?(a2(1.2),a.preventDefault()):"-"===a.key||"_"===a.key?(a2(1/1.2),a.preventDefault()):"0"===a.key?(a3(),a.preventDefault()):"f"===a.key||"F"===a.key?(a4(),a.preventDefault()):"l"===a.key||"L"===a.key?(ac(),a.preventDefault()):"Escape"===a.key&&!aV&&(aJ||av||aE)&&(aJ&&aK(null),av&&aw(null),aE&&aF(null),a.preventDefault())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[a4,aV,aJ,av,aE]),(0,b.jsxs)("section",{className:"w-full max-w-6xl mx-auto mb-8",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between mb-3 px-1",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-xs uppercase text-gray-600 tracking-wider",children:"Network Topology"}),(0,b.jsx)("h2",{className:"text-lg text-white font-semibold",children:"Command mesh"})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,b.jsxs)("div",{className:"inline-flex rounded-md border border-gray-500/25 overflow-hidden",role:"group","aria-label":"Topology layout",children:[(0,b.jsx)("button",{onClick:()=>{"ring"!==aa&&ac()},"aria-pressed":"ring"===aa,title:"Ring layout (l to toggle)",className:`px-2.5 py-1 transition-colors ${"ring"===aa?"bg-cyan-500/15 text-cyan-300":"text-gray-500 hover:text-gray-400"}`,children:"Ring"}),(0,b.jsx)("button",{onClick:()=>{"grid"!==aa&&ac()},"aria-pressed":"grid"===aa,title:"Grid layout (l to toggle)",className:`px-2.5 py-1 border-l border-gray-500/25 transition-colors ${"grid"===aa?"bg-cyan-500/15 text-cyan-300":"text-gray-500 hover:text-gray-400"}`,children:"Grid"})]}),(0,b.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-green-500/10 text-green-300 border border-green-500/20","data-working-chip":!0,"data-pin-mirror":"working"===aJ?"true":"false",title:an>0?"working"===aJ?"Pinned — Esc to clear":"Hover to highlight working nodes":void 0,style:{cursor:an>0?"pointer":void 0,boxShadow:"working"===aJ?"inset 0 0 0 1px #4ade80, inset 0 0 0 2px rgba(255,255,255,0.45)":void 0},onMouseEnter:()=>{an>0&&aI("working")},onMouseLeave:()=>aI(a=>"working"===a?null:a),children:[an," working"]}),(0,b.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-cyan-500/10 text-cyan-300 border border-cyan-500/20","data-online-chip":!0,"data-pin-mirror":"idle"===aJ?"true":"false",title:af.length>0?"idle"===aJ?"Pinned — Esc to clear":"Hover to highlight online nodes":void 0,style:{cursor:af.length>0?"pointer":void 0,boxShadow:"idle"===aJ?"inset 0 0 0 1px #67e8f9, inset 0 0 0 2px rgba(255,255,255,0.45)":void 0},onMouseEnter:()=>{let a=af.length-an;an>0?aI("working"):a>0&&aI("idle")},onMouseLeave:()=>aI(a=>"working"===a||"idle"===a?null:a),children:[af.length," online"]}),(()=>{let a=af.length-an,c=ag.length,d=an+a+c;if(0===d)return null;let e=(a,c,e,f)=>{if(0===a)return null;let g=aJ===e,h="working"===e?af.filter(a=>"working"===a.status).map(a=>a.alias):"idle"===e?af.filter(a=>"working"!==a.status).map(a=>a.alias):ag.map(a=>a.alias),i=h.slice(0,8).join(", "),j=h.length>8?` + ${h.length-8} more`:"",k=g?"click to release filter":"click to highlight";return(0,b.jsx)("span",{"data-pressure-seg":e,"data-pressure-seg-aliases":h.join(","),role:"button",tabIndex:0,"aria-pressed":g,title:`${a} ${f}
|
|
2
2
|
${i}${j}
|
|
3
3
|
${k}`,style:{width:`${a/d*100}%`,background:c,height:"100%",cursor:"pointer",boxShadow:g?`inset 0 0 0 1px ${c}, inset 0 0 0 2px rgba(255,255,255,0.6)`:void 0},onClick:a=>{a.stopPropagation(),aK(a=>a===e?null:e)},onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&(a.preventDefault(),aK(a=>a===e?null:e))},onMouseEnter:()=>aI(e),onMouseLeave:()=>aI(a=>a===e?null:a)},e)};return(0,b.jsxs)("span",{className:"hidden sm:inline-flex items-center gap-2 px-2.5 py-1 rounded-md bg-gray-500/10 text-gray-400 border border-gray-500/20 font-mono",title:`${an} working \xb7 ${a} idle \xb7 ${c} offline`,"data-fleet-pressure":!0,children:[(0,b.jsx)("span",{className:"text-[10px] tracking-wide",children:"pressure"}),(0,b.jsxs)("span",{className:"inline-flex h-1.5 w-16 rounded-full overflow-hidden",style:{background:"rgb(75 85 99 / 0.25)"},children:[e(an,W?"#059669":"#22c55e","working","working"),e(a,W?"#0d9488":"#2dd4bf","idle","idle"),e(c,W?"#94a3b8":"#6b7280","offline","offline")]})]})})(),aJ&&(f="working"===aJ?an:"idle"===aJ?af.length-an:ag.length,h=(g="working"===aJ?af.filter(a=>"working"===a.status).map(a=>a.alias):"idle"===aJ?af.filter(a=>"working"!==a.status).map(a=>a.alias):ag.map(a=>a.alias)).slice(0,8).join(", "),j=g.length>8?` + ${g.length-8} more`:"",(0,b.jsxs)("span",{"data-active-filter":"status","data-filter-match-count":f,"data-filter-match-aliases":g.join(","),className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md font-mono text-xs border anet-fade-in",title:f>0?`${h}${j} — click to clear`:"Click to clear filter",onClick:()=>aK(null),style:{background:"working"===aJ?W?"#05966914":"#22c55e1f":"idle"===aJ?W?"#0d948814":"#2dd4bf1f":W?"#94a3b814":"#6b72801f",color:"working"===aJ?W?"#047857":"#86efac":"idle"===aJ?W?"#0f766e":"#5eead4":W?"#475569":"#9ca3af",borderColor:"currentColor",cursor:"pointer"},children:[(0,b.jsxs)("span",{children:[(0,b.jsx)("span",{className:"hidden sm:inline","data-filter-prefix":!0,children:"filter: "}),aJ,(0,b.jsxs)("span",{className:"opacity-70",children:[" · ",f]})]}),(0,b.jsx)("button",{type:"button","aria-label":`Clear ${aJ} filter`,onClick:a=>{a.stopPropagation(),aK(null)},className:"ml-0.5 leading-none hover:opacity-70",style:{background:"transparent",color:"inherit",cursor:"pointer",padding:0},children:"×"})]})),av&&(k=Object.values(ak).filter(a=>a===av).length,o=(n=Object.entries(ak).filter(([,a])=>a===av).map(([a])=>a)).slice(0,8).join(", "),q=n.length>8?` + ${n.length-8} more`:"",(0,b.jsxs)("span",{"data-active-filter":"group","data-filter-match-count":k,"data-filter-match-aliases":n.join(","),className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md font-mono text-xs border anet-fade-in",title:k>0?`${o}${q} — click to clear`:"Click to clear filter",onClick:()=>aw(null),style:{background:W?"#67e8f914":"#67e8f91f",color:Y.legendAccent,borderColor:"currentColor",cursor:"pointer"},children:[(0,b.jsxs)("span",{children:[(0,b.jsx)("span",{className:"hidden sm:inline","data-filter-prefix":!0,children:"filter: "}),av,(0,b.jsxs)("span",{className:"opacity-70",children:[" · ",k]})]}),(0,b.jsx)("button",{type:"button","aria-label":`Clear group filter ${av}`,onClick:a=>{a.stopPropagation(),aw(null)},className:"ml-0.5 leading-none hover:opacity-70",style:{background:"transparent",color:"inherit",cursor:"pointer",padding:0},children:"×"})]})),aE&&(z=ao.find(a=>a.initial===aE),D=z?.count??0,E=z?.color??Y.legendText,G=(F=[...af,...ag].filter(a=>{let b=p(a.model);return("unknown"===b.id?"?":b.initial)===aE}).map(a=>a.alias)).slice(0,8).join(", "),H=F.length>8?` + ${F.length-8} more`:"",(0,b.jsxs)("span",{"data-active-filter":"vendor","data-filter-match-count":D,"data-filter-match-aliases":F.join(","),className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md font-mono text-xs border anet-fade-in",title:D>0?`${G}${H} — click to clear`:"Click to clear vendor filter",onClick:()=>aF(null),style:{background:`${E}1f`,color:E,borderColor:"currentColor",cursor:"pointer"},children:[(0,b.jsxs)("span",{children:[(0,b.jsx)("span",{className:"hidden sm:inline","data-filter-prefix":!0,children:"filter: "}),aE,(0,b.jsxs)("span",{className:"opacity-70",children:[" · ",D]})]}),(0,b.jsx)("button",{type:"button","aria-label":`Clear vendor filter ${aE}`,onClick:a=>{a.stopPropagation(),aF(null)},className:"ml-0.5 leading-none hover:opacity-70",style:{background:"transparent",color:"inherit",cursor:"pointer",padding:0},children:"×"})]})),ao.length>1&&(0,b.jsx)("span",{className:"hidden sm:inline-flex items-center gap-2 px-2.5 py-1 rounded-md bg-gray-500/10 text-gray-400 border border-gray-500/20 font-mono",title:"Hover to highlight; click to pin",children:ao.map(a=>{let c=aE===a.initial,d=[...af,...ag].filter(b=>{let c=p(b.model);return("unknown"===c.id?"?":c.initial)===a.initial}).map(a=>a.alias),e=d.slice(0,8).join(", "),f=d.length>8?` + ${d.length-8} more`:"",g=c?`${e}${f} — click again or Esc to clear`:`${e}${f} — click to pin`;return(0,b.jsxs)("span",{role:"button",tabIndex:0,"aria-pressed":c,className:"inline-flex items-baseline gap-0.5 px-1 rounded","data-vendor-letter":a.initial,"data-vendor-pinned":c?"true":"false","data-vendor-aliases":d.join(","),title:g,style:{cursor:"pointer",boxShadow:c?`inset 0 0 0 1px ${a.color}, inset 0 0 0 2px rgba(255,255,255,0.45)`:void 0},onMouseEnter:()=>aD(a.initial),onMouseLeave:()=>aD(b=>b===a.initial?null:b),onClick:()=>aF(b=>b===a.initial?null:a.initial),onKeyDown:b=>{("Enter"===b.key||" "===b.key)&&(b.preventDefault(),aF(b=>b===a.initial?null:a.initial))},children:[(0,b.jsx)("span",{style:{color:a.color},children:a.initial}),(0,b.jsxs)("span",{className:"text-gray-500",children:[":",a.count]})]},a.initial)})}),(J=null!==(I=ai.reduce((a,b)=>{if(!b.last_at)return a;let c=(0,l.parseHubTime)(b.last_at);return null===c?a:null===a||c>a?c:a},null))?(0,l.relativeAgo)(new Date(I).toISOString()):null,(0,b.jsxs)("span",{className:"hidden sm:inline px-2.5 py-1 rounded-md bg-gray-500/10 text-gray-400 border border-gray-500/20","data-active-links-chip":!0,title:ai.length>0?"Hover to brighten all active flows":void 0,style:{cursor:ai.length>0?"pointer":void 0},onMouseEnter:()=>{ai.length>0&&aB(!0)},onMouseLeave:()=>aB(!1),children:[ai.length," active link",1===ai.length?"":"s",J?(0,b.jsxs)("span",{className:"text-gray-500",children:[" · last ",J]}):null]})),(0,b.jsx)(v,{sessions:a})]})]}),(0,b.jsxs)("div",{ref:aN,className:`relative overflow-hidden rounded-lg border shadow-2xl ${W?"shadow-zinc-900/5":"shadow-cyan-950/30"} ${aT?"flex items-center justify-center":""}`,style:{background:Y.containerBg,borderColor:Y.containerBorder},children:[(0,b.jsx)("div",{className:`absolute inset-x-0 top-0 h-px bg-gradient-to-r ${Y.topRailGradient}`}),(0,b.jsxs)("svg",{ref:aO,viewBox:"0 0 1000 680",className:"w-full h-auto block",preserveAspectRatio:"xMidYMid meet",onPointerDown:a=>{0===a.button&&(a.currentTarget.setPointerCapture?.(a.pointerId),aS.current={active:!0,startX:a.clientX,startY:a.clientY,baseX:aR.current.x,baseY:aR.current.y},a0(!0))},onPointerMove:a=>{let b=aS.current;if(!b.active)return;let c=aO.current;if(!c)return;let d=c.getBoundingClientRect(),e=(a.clientX-b.startX)/d.width*1e3,f=(a.clientY-b.startY)/d.height*680;aQ(a=>({...a,x:b.baseX+e,y:b.baseY+f}))},onPointerUp:a1,onPointerLeave:a1,onDoubleClick:a=>{let b=a.target;b?.closest("g[data-node]")||a3()},style:{cursor:a_?"grabbing":"grab",touchAction:"none"},children:[(0,b.jsxs)("defs",{children:[(0,b.jsxs)("linearGradient",{id:"topo-panel",x1:"0",x2:"1",y1:"0",y2:"1",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:Y.panelStops[0]}),(0,b.jsx)("stop",{offset:"48%",stopColor:Y.panelStops[1]}),(0,b.jsx)("stop",{offset:"100%",stopColor:Y.panelStops[2]})]}),(0,b.jsxs)("radialGradient",{id:"topo-radar",cx:"50%",cy:"50%",r:"55%",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:Y.radarStops[0].color,stopOpacity:Y.radarStops[0].opacity}),(0,b.jsx)("stop",{offset:"45%",stopColor:Y.radarStops[1].color,stopOpacity:Y.radarStops[1].opacity}),(0,b.jsx)("stop",{offset:"100%",stopColor:Y.radarStops[2].color,stopOpacity:Y.radarStops[2].opacity})]}),!W&&(0,b.jsxs)("filter",{id:"topo-glow",children:[(0,b.jsx)("feGaussianBlur",{stdDeviation:"4",result:"blur"}),(0,b.jsxs)("feMerge",{children:[(0,b.jsx)("feMergeNode",{in:"blur"}),(0,b.jsx)("feMergeNode",{in:"SourceGraphic"})]})]}),[{id:"topo-arrow-s",size:12},{id:"topo-arrow",size:16},{id:"topo-arrow-l",size:22}].map(a=>(0,b.jsx)("marker",{id:a.id,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:a.size,markerHeight:a.size,markerUnits:"userSpaceOnUse",orient:"auto-start-reverse",children:(0,b.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:Y.arrowFill})},a.id)),(0,b.jsxs)("radialGradient",{id:"topo-sweep",cx:"0%",cy:"50%",r:"100%",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:W?"#0d9488":"#22d3ee",stopOpacity:W?.18:.32}),(0,b.jsx)("stop",{offset:"70%",stopColor:W?"#0d9488":"#22d3ee",stopOpacity:W?.1:.18}),(0,b.jsx)("stop",{offset:"100%",stopColor:W?"#0d9488":"#22d3ee",stopOpacity:"0"})]})]}),(0,b.jsx)("rect",{width:"1000",height:"680",fill:"url(#topo-panel)"}),(0,b.jsxs)("g",{transform:`translate(${aP.x} ${aP.y}) scale(${aP.zoom})`,children:["ring"===aa&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("circle",{cx:500,cy:330,r:"330",fill:"url(#topo-radar)",style:{pointerEvents:"none"}}),!W&&(0,b.jsx)("g",{opacity:"0.5",style:{pointerEvents:"none"},children:Array.from({length:28}).map((a,c)=>{let d=9301*c+49297;return(0,b.jsx)("circle",{cx:13*d%1e3,cy:7*d%680,r:c%3==0?1.2:.7,fill:"#a5b4fc",opacity:.35+c%4*.05},c)})}),(0,b.jsx)("g",{style:{transformOrigin:"500px 330px",transformBox:"view-box",pointerEvents:"none"},className:"anet-topo-sweep",opacity:W?.7:1,children:(0,b.jsx)("path",{d:`M 500 330 L 830 330 A 330 330 0 0 0 ${500+330*Math.cos(-Math.PI/4.5)} ${330+330*Math.sin(-Math.PI/4.5)} Z`,fill:"url(#topo-sweep)"})}),[90,170,250,330].map(a=>(0,b.jsx)("circle",{cx:500,cy:330,r:a,fill:"none",stroke:Y.ringStroke,strokeWidth:"1",opacity:W?.6:.35},a)),(K=af.length>14?[145,215,285]:af.length>8?[175,260]:af.length>0?[220]:[],M=(L=!!(aJ||av||aE))?Y.legendAccent:Y.ringStroke,K.map(a=>{let c=af.reduce((b,c)=>{let d=ah[c.alias];return d&&15>Math.abs(Math.hypot(d.x-500,d.y-330)-a)?b+1:b},0);if(0===c)return null;let d=c<=2?0:c<=6?1:2,e=[.24,.36,.5][d],f=[.32,.46,.62][d];return(0,b.jsx)("circle",{cx:500,cy:330,r:a,fill:"none",stroke:M,strokeWidth:"0.7",strokeDasharray:"2 8",opacity:W?e:f,style:{pointerEvents:"none",transition:"stroke 200ms ease-out"},"data-tier-ring":a,"data-tier-occupancy":c,"data-tier-bucket":d,"data-tier-tinted":L?"true":"false"},`tier-${a}`)})),!W&&[0,.25,.5,.75].map((a,c)=>(0,b.jsx)("g",{children:(0,b.jsx)("circle",{cx:830,cy:330,r:0===c?2.8:2.2,fill:"#22d3ee",opacity:.9,filter:"url(#topo-glow)",children:(0,b.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:`${360*a} 500 330`,to:`${360*a+360} 500 330`,dur:"16s",repeatCount:"indefinite"})})},`orbit-${c}`)),[0,30,60,90,120,150].map(a=>(0,b.jsx)("line",{x1:500-360*Math.cos(a*Math.PI/180),y1:330-360*Math.sin(a*Math.PI/180),x2:500+360*Math.cos(a*Math.PI/180),y2:330+360*Math.sin(a*Math.PI/180),stroke:Y.ringStroke,strokeWidth:"1",opacity:W?.35:.18},a))]}),"ring"===aa&&af.map((a,c)=>{let d=ah[a.alias];if(!d)return null;let e=t({x:500,y:330},d,0),f=aj.has(a.alias);return(0,b.jsx)("path",{d:e,fill:"none",stroke:f?Y.spokeStroke.active:Y.spokeStroke.idle,strokeWidth:f?2:1,strokeDasharray:f?"none":"6 14",opacity:f?.7:.45,className:f?void 0:"anet-topo-spoke-flow",style:f?void 0:{animationDelay:`${-(.25*c)}s`}},`hub-${a.alias}`)}),al.map(a=>{let c,d,e,f,g=ax===a.key,h=av===a.key;return(0,b.jsxs)("g",{"data-group":a.key,className:"transition-opacity",style:{opacity:!ax||g?1:.28},children:[(0,b.jsx)("rect",{x:a.x,y:a.y,width:a.w,height:a.h,rx:"14",fill:W?"#0f172a":"#a5b4fc",fillOpacity:h?W?.08:.13:g?W?.05:.09:W?.025:.045,stroke:h||g?Y.legendAccent:Y.ringStroke,strokeWidth:h?3:g?2:1.5,strokeDasharray:h||g?"none":"6 6","data-group-box-pinned":h?"true":"false","data-group-box-live":h||g||!(a.statuses.working>0)?"false":"true",className:h||g||!(a.statuses.working>0)?void 0:"anet-topo-groupbox-live",style:{transition:"stroke 200ms ease-out, stroke-width 200ms ease-out, fill-opacity 200ms ease-out",pointerEvents:"none"}}),(0,b.jsxs)("g",{role:"button",tabIndex:0,"aria-pressed":av===a.key,"data-group-label-hit":a.key,style:{pointerEvents:"all",cursor:"pointer"},onPointerDown:a=>a.stopPropagation(),onClick:()=>aw(b=>b===a.key?null:a.key),onPointerEnter:()=>at(a.key),onPointerLeave:()=>at(b=>b===a.key?null:b),children:[(d=(c=Object.entries(ak).filter(([,b])=>b===a.key).map(([a])=>a)).slice(0,8).join(", "),e=c.length>8?` + ${c.length-8} more`:"",f=[a.statuses.working>0?`${a.statuses.working} working`:null,a.statuses.idle>0?`${a.statuses.idle} idle`:null,a.statuses.offline>0?`${a.statuses.offline} offline`:null].filter(Boolean).join(" · "),(0,b.jsx)("title",{children:[`${a.key} (${c.length} member${1===c.length?"":"s"})`,f||null,`${d}${e}`,av===a.key?"click to release pin":"click to pin this group"].filter(Boolean).join("\n")})),(0,b.jsx)("rect",{x:a.x+6,y:a.y+2,width:Math.min(a.w-12,240),height:20,fill:"transparent"}),(0,b.jsxs)("text",{x:a.x+12,y:a.y+14,fill:g?Y.legendHeadline:Y.legendText,fontSize:"13",fontFamily:"monospace",fontWeight:"700",style:{transition:"fill 200ms ease-out"},"data-group-label":a.key,children:[a.key,(0,b.jsxs)("tspan",{dx:"6",fill:Y.legendText,fontSize:"11",fontWeight:"400",children:["· ",a.count]}),a.statuses.working>0&&(0,b.jsxs)("tspan",{dx:"8",fill:W?"#059669":"#22c55e",fontSize:"11",fontWeight:"600",children:[a.statuses.working,"w"]}),a.statuses.idle>0&&(0,b.jsxs)("tspan",{dx:"4",fill:W?"#0d9488":"#2dd4bf",fontSize:"11",fontWeight:"600",children:[a.statuses.idle,"i"]}),a.statuses.offline>0&&(0,b.jsxs)("tspan",{dx:"4",fill:W?"#94a3b8":"#6b7280",fontSize:"11",fontWeight:"600",children:[a.statuses.offline,"o"]})]})]})]},`grp-${a.key}`)}),ai.map((a,c)=>{let d,e,f,g,h,i,j,k,m=ah[a.from],n=ah[a.to];if(!m||!n)return null;let o=(c%2==0?1:-1)*Math.min(36,.18*Math.hypot(n.x-m.x,n.y-m.y)),p=t(m,n,o),q=Math.min(2+a.count,7),r=Math.max(.9,2.6/Math.sqrt(a.count)),s=Math.max(.35,1-(a.last_at?Math.max(0,Date.now()-Date.parse(a.last_at)):0)/3e5),u=a.count<=2?"topo-arrow-s":a.count<=4?"topo-arrow":"topo-arrow-l",v=(0,l.relativeAgo)(a.last_at),w=`${a.from} → ${a.to}
|
|
4
|
-
${a.count} message${1===a.count?"":"s"}${v?` \xb7 last ${v}`:""}`,x=ay===a.key,y=ak[a.from]??a.from,z=ak[a.to]??a.to,A=x?2:ay?.35:aq||ax?a.from===aq||a.to===aq?1.7:ax&&y===ax&&z===ax?1.3:.35:aA?1.5:1,B=x?Math.min(1.4*q,10):q;return(0,b.jsxs)("g",{children:[(0,b.jsx)("path",{d:p,fill:"none",stroke:"transparent",strokeWidth:Math.max(q+10,16),style:{pointerEvents:"stroke"},"data-edge-hitbox":!0,onMouseEnter:()=>az(a.key),onMouseLeave:()=>az(b=>b===a.key?null:b),children:(0,b.jsx)("title",{children:w})}),(0,b.jsx)("path",{d:p,fill:"none",stroke:Y.flowEdge,strokeWidth:B,opacity:Math.min(1,(W?.22:.28)*s*A),filter:W?void 0:"url(#topo-glow)",markerEnd:`url(#${u})`,className:"transition-opacity duration-300",style:{pointerEvents:"none"}}),(0,b.jsx)("path",{id:`flow-path-${c}`,d:p,fill:"none",stroke:Y.flowPath,strokeWidth:"1",strokeDasharray:"2 12",opacity:Math.min(1,(W?.4:.75)*s*A),className:"transition-opacity duration-300"}),!X&&(0,b.jsx)("circle",{r:"4",fill:Y.flowParticle,filter:W?void 0:"url(#topo-glow)",opacity:Math.min(1,s*A),children:(0,b.jsx)("animateMotion",{dur:`${r}s`,begin:`-${(.37*c%r).toFixed(3)}s`,repeatCount:"indefinite",path:p})}),!X&&s>.5&&(0,b.jsxs)("circle",{cx:n.x,cy:n.y,r:"0",fill:"none",stroke:Y.flowEdge,strokeWidth:"1.5",opacity:"0",style:{pointerEvents:"none"},"data-arrival-ping":a.key,children:[(0,b.jsx)("animate",{attributeName:"r",values:"0;14;22",dur:`${r}s`,begin:`-${(.92*r).toFixed(2)}s`,repeatCount:"indefinite"}),(0,b.jsx)("animate",{attributeName:"opacity",values:"0;0.55;0",dur:`${r}s`,begin:`-${(.92*r).toFixed(2)}s`,repeatCount:"indefinite"})]}),!X&&s>.5&&a.count>=3&&(0,b.jsxs)("circle",{cx:m.x,cy:m.y,r:"0",fill:"none",stroke:Y.flowEdge,strokeWidth:"1.5",opacity:"0",style:{pointerEvents:"none"},"data-dispatch-pulse":a.key,children:[(0,b.jsx)("animate",{attributeName:"r",values:"0;12;18",dur:`${r}s`,begin:"0s",repeatCount:"indefinite"}),(0,b.jsx)("animate",{attributeName:"opacity",values:"0;0.45;0",dur:`${r}s`,begin:"0s",repeatCount:"indefinite"})]}),a.count>=3&&(d=(m.x+n.x)/2,e=(m.y+n.y)/2,f=n.x-m.x,h=Math.hypot(f,g=n.y-m.y)||1,i=d+-g/h*o*.5,j=e+f/h*o*.5,k=Math.min(1,s*A),(0,b.jsxs)("g",{"data-edge-count-badge":a.key,style:{pointerEvents:"none"},opacity:k,children:[(0,b.jsx)("circle",{cx:i,cy:j,r:"9",fill:Y.legendBox.fill,stroke:Y.flowEdge,strokeWidth:"1",opacity:W?.95:.82}),(0,b.jsx)("text",{x:i,y:j+3,textAnchor:"middle",fill:Y.legendHeadline,fontSize:"10",fontFamily:"monospace",fontWeight:"700",children:a.count})]}))]},a.key)}),"ring"===aa&&(0,b.jsxs)("g",{"data-topo-hub":!0,style:{cursor:"pointer"},onPointerDown:a=>a.stopPropagation(),onClick:()=>{a4(),aY({ts:Date.now(),x:500,y:330,r0:18,color:W?"#059669":"#10b981"}),setTimeout(()=>aY(a=>a&&500===a.x&&330===a.y?null:a),600)},children:[(0,b.jsx)("title",{children:(N=a.length,O=["Network hub",`${N} session${1===N?"":"s"}`],af.length>0&&O.push(`${af.length} online`),an>0&&O.push(`${an} working`),ai.length>0&&O.push(`${ai.length} active link${1===ai.length?"":"s"}`),O.join(" · ")+"\nclick to fit view")}),(Q=[.52,.58,.65,.72][P=0===an?0:an<=2?1:an<=5?2:3],R=[.16,.2,.26,.32][P],S=[4,3.2,2.7,2.4][P],T=`0.32;${Q};0.32`,U=`0.08;${R};0.08`,(0,b.jsx)("circle",{cx:500,cy:330,r:"18",fill:W?"#d1fae5":"#10b981",opacity:W?.42:.12,"data-hub-busyness":P,children:!X&&(0,b.jsx)("animate",{attributeName:"opacity",values:W?T:U,dur:`${S}s`,repeatCount:"indefinite"})})),(0,b.jsx)("circle",{cx:500,cy:330,r:"10",fill:W?"#059669":"#10b981"}),(0,b.jsx)("circle",{cx:500,cy:330,r:"5",fill:"#d1fae5",opacity:"0.9"})]}),[...af,...ag].map((a,c)=>{let e,f,g,h,j,k=ah[a.alias];if(!k)return null;let m=(a.network_id?d[`${a.network_id}:${a.alias}`]:void 0)??d[a.alias],n="offline"!==a.status||!!m,o=w(a,n,W),q=aj.has(a.alias),s=Math.round((n?26:18)*ad),t=!ap||aq===a.alias||aP.zoom>=1.4,v=!ax||(ak[a.alias]??a.alias)===ax,x=0;if("ring"===aa){let b=ah[a.alias];if(b){let a=Math.hypot(b.x-500,b.y-330);x=a<195?0:a<270?1:a<310?2:3}}return(0,b.jsxs)("g",{"data-node":a.alias,"data-tier-idx":"ring"===aa?x:-1,className:"group transition-opacity anet-fade-in",style:{cursor:"pointer",opacity:aM&&!aM.has(a.alias)&&aV!==a.alias||aG&&aV!==a.alias&&("unknown"===(e=p(a.model)).id?"?":e.initial)!==aG||aL&&aV!==a.alias&&!("working"===aL?"working"===a.status:"idle"===aL?n&&"working"!==a.status:!n)?.28:v?aV===a.alias||n?1:.6:.32,animationDelay:"ring"===aa?`${180*x+c%6*25}ms`:`${25*Math.min(c,24)}ms`,transform:X||aq!==a.alias?void 0:"translateY(-2px)",transition:"transform 180ms cubic-bezier(0.4,0,0.2,1)"},onPointerDown:a=>a.stopPropagation(),onPointerEnter:()=>ar(a.alias),onPointerLeave:()=>ar(b=>b===a.alias?null:b),onClick:()=>{aW(a.alias),aY({ts:Date.now(),x:k.x,y:k.y,r0:s,color:o.primary}),setTimeout(()=>aY(a=>a&&Date.now()-a.ts>=590?null:a),600)},children:[(()=>{var c,d;let e,f,g,h=!n&&a.last_seen_at?(0,l.relativeAgo)(a.last_seen_at):null,i=ak[a.alias],j=i?Object.values(ak).filter(a=>a===i).length:1,k=j>1?`group: ${i} \xb7 ${j}`:null,m=0,o=0;for(let b of ai)b.from===a.alias&&(o+=b.count),b.to===a.alias&&(m+=b.count);let q=m+o>0?`flows: ${m} in / ${o} out`:null;return(0,b.jsx)("title",{children:[`${a.alias} \xb7 ${a.status}`,(c=a.model,d=a.runtime,e=p(c),f=r(d),g=[],"unknown"!==e.id&&g.push(e.label),c&&g.push(c),f&&g.push(f.label),g.join(" · ")),k,a.project_dir?`cwd: ${a.project_dir}`:null,h?`last seen: ${h}`:null,q].filter(Boolean).join("\n")})})(),(0,b.jsx)("circle",{cx:k.x,cy:k.y,r:s+12,fill:"none",stroke:o.primary,strokeWidth:"2",className:"opacity-0 group-hover:opacity-70 transition-opacity duration-150",style:{pointerEvents:"none"}}),aV===a.alias&&(0,b.jsx)("circle",{cx:k.x,cy:k.y,r:s+14,fill:"none",stroke:o.primary,strokeWidth:"2.5",opacity:W?.85:.95,filter:W?void 0:"url(#topo-glow)",className:"transition-opacity duration-200",style:{pointerEvents:"none"}}),q&&!X&&(0,b.jsxs)("circle",{cx:k.x,cy:k.y,r:s+14,fill:o.primary,opacity:W?.08:.12,children:[(0,b.jsx)("animate",{attributeName:"r",values:`${s+8};${s+22};${s+8}`,dur:"2.4s",repeatCount:"indefinite"}),(0,b.jsx)("animate",{attributeName:"opacity",values:W?"0.12;0.02;0.12":"0.18;0.04;0.18",dur:"2.4s",repeatCount:"indefinite"})]}),(0,b.jsx)("circle",{cx:k.x,cy:k.y,r:s+8,fill:o.halo,opacity:n?W?.85:.65:W?.4:.25,className:"transition-[fill,opacity] duration-300 ease-out"}),(0,b.jsx)("circle",{cx:k.x,cy:k.y,r:s,fill:n?Y.nodeFill.online:Y.nodeFill.offline,stroke:o.primary,strokeWidth:n?3:1.5,strokeDasharray:n?"none":"5 5",filter:n&&!W?"url(#topo-glow)":void 0,className:"transition-[fill,stroke] duration-300 ease-out"}),(()=>{let c=Math.round((n?14:10)*ad),d=2*s,e=p(a.model),f=/书生|书小生|intern/i.test(a.alias);if(Z||f||e.logo)return(0,b.jsx)("image",{href:e.logo??"/intern_avatar.png",x:k.x-d/2,y:k.y-d/2,width:d,height:d,preserveAspectRatio:"xMidYMid meet"});if("unknown"!==e.id)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("circle",{cx:k.x,cy:k.y,r:c,fill:e.mono.bg,stroke:e.mono.ring,strokeWidth:"1"}),(0,b.jsx)("text",{x:k.x,y:k.y,dy:"0.34em",textAnchor:"middle",fill:e.mono.text,fontSize:c,fontFamily:"monospace",fontWeight:"700",children:e.initial})]});let g=(0,i.aliasAvatarColors)(ak[a.alias]||a.alias);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("circle",{cx:k.x,cy:k.y,r:c,fill:g.bg,stroke:g.ring,strokeWidth:"1"}),(0,b.jsx)("text",{x:k.x,y:k.y,dy:"0.34em",textAnchor:"middle",fill:g.text,fontSize:c,fontFamily:"monospace",fontWeight:"700",children:(0,i.aliasInitial)(a.alias)})]})})(),(()=>{let c=r(a.runtime);if(!c)return null;let d=n?7:5.5,e=k.x+.72*s,f=k.y+.72*s,g=2*d*.62;return(0,b.jsxs)("g",{style:{pointerEvents:"none"},children:[(0,b.jsx)("circle",{cx:e,cy:f,r:d,fill:Y.containerBg,stroke:c.color,strokeWidth:"1.5"}),(0,b.jsx)("g",{transform:`translate(${e-g/2} ${f-g/2}) scale(${g/24})`,children:(0,b.jsx)("path",{d:c.iconPath,fill:"none",stroke:c.color,strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})]})})(),"working"===a.status&&(g=(f=m??0)>=4?"0.7s":f>=2?"0.9s":"1.2s",(0,b.jsx)("circle",{cx:k.x,cy:k.y-(s-6),r:"2.5",fill:Y.flowParticle,"data-pulse-dur":g,opacity:X?.6:void 0,children:!X&&(0,b.jsx)("animate",{attributeName:"opacity",values:"1;0.25;1",dur:g,repeatCount:"indefinite"})})),(j=(h=ad<.8)?88:100,t?(0,b.jsxs)("g",{transform:`translate(${k.x}, ${k.y+s+(h?18:22)})`,style:{pointerEvents:"none"},className:"transition-transform duration-200 group-hover:-translate-y-[1.5px]",children:[(0,b.jsx)("rect",{x:-j/2,y:h?-12:-14,width:j,height:h?36:42,rx:"6",fill:Y.labelBox.fill,stroke:Y.labelBox.stroke,opacity:W?1:.94}),(0,b.jsx)("text",{x:"0",y:"1",textAnchor:"middle",fill:o.text,fontSize:h?11:12,fontFamily:"monospace",fontWeight:"700",children:u(a.alias,h?11:12)}),(0,b.jsxs)("text",{x:"0",y:h?15:17,textAnchor:"middle",fill:o.primary,fontSize:h?8:9,fontFamily:"monospace",children:[o.label,n&&null!=m?` sse:${m}`:""]})]}):(0,b.jsx)("text",{x:k.x,y:k.y+s+(h?12:14),textAnchor:"middle",fill:o.text,fontSize:h?9:10,fontFamily:"monospace",fontWeight:"700",opacity:.9,className:"transition-transform duration-200 group-hover:-translate-y-[1.5px]",style:{pointerEvents:"none",paintOrder:"stroke"},stroke:Y.containerBg,strokeWidth:"3",children:u(a.alias,h?9:10)}))]},a.alias)}),aX&&!X&&(0,b.jsxs)("circle",{cx:aX.x,cy:aX.y,r:aX.r0+4,fill:"none",stroke:aX.color,strokeWidth:"2",opacity:"0",style:{pointerEvents:"none"},children:[(0,b.jsx)("animate",{attributeName:"r",values:`${aX.r0+4};${aX.r0+30}`,dur:"0.5s",fill:"freeze"}),(0,b.jsx)("animate",{attributeName:"opacity",values:"0.7;0",dur:"0.5s",fill:"freeze"})]},aX.ts)]}),(0,b.jsxs)("g",{transform:"translate(16, 16)",children:[(0,b.jsx)("rect",{x:"0",y:"0",width:"230",height:"84",rx:"10",fill:Y.legendBox.fill,stroke:Y.legendBox.stroke,opacity:W?.97:.92,style:{filter:W?"drop-shadow(0 2px 6px rgba(15,23,42,0.08))":"drop-shadow(0 2px 6px rgba(0,0,0,0.45))"},"data-topo-panel-elevation":"recent"}),(0,b.jsx)("text",{x:"13",y:"21",fill:Y.legendHeadline,fontSize:"12",fontFamily:"monospace",fontWeight:"700",children:"recent signal"}),(0,b.jsxs)("text",{x:"150",y:"21",fill:Y.legendAccent,fontSize:"10",fontFamily:"monospace","data-recent-panel-count":!0,children:[ai.length," flows"]}),0===ai.length?(0,b.jsx)("text",{x:"115",y:"60",textAnchor:"middle",fill:Y.legendText,fontSize:"10",fontFamily:"monospace",fontStyle:"italic",opacity:.65,"data-recent-signal-empty":!0,children:"no flow yet"}):ai.slice(0,3).map((a,c)=>{let d=a.last_at?(0,l.relativeAgo)(a.last_at):null,e=d?d.replace(/\s+ago$/,""):null,f=ay===a.key;return(0,b.jsxs)("g",{"data-recent-row":a.key,"data-recent-row-hovered":f?"true":"false",style:{cursor:"pointer"},onMouseEnter:()=>az(a.key),onMouseLeave:()=>az(b=>b===a.key?null:b),children:[(0,b.jsx)("rect",{x:"6",y:38+16*c-10,width:"218",height:"14",rx:"3",fill:f?Y.legendAccent:"transparent",opacity:f?W?.1:.14:1,style:{transition:"fill 150ms ease-out, opacity 150ms ease-out"}}),(0,b.jsxs)("text",{x:"13",y:38+16*c,fill:ay===a.key?Y.legendHeadline:Y.legendText,fontSize:"9",fontFamily:"monospace",style:{transition:"fill 150ms ease-out"},children:[u(a.from,6)," ","->"," ",u(a.to,6)," / ",a.count," / ",u(a.content,8)]}),e?(0,b.jsx)("text",{x:"217",y:38+16*c,textAnchor:"end",fill:Y.legendText,fontSize:"8",fontFamily:"monospace",opacity:.55,"data-recent-row-ts":a.key,style:{pointerEvents:"none"},children:e}):null]},a.key)})]}),(0,b.jsxs)("g",{transform:"translate(760, 16)",children:[(0,b.jsx)("rect",{x:"0",y:"0",width:"224",height:"96",rx:"10",fill:Y.legendBox.fill,stroke:Y.legendBox.stroke,opacity:W?.97:.92,style:{filter:W?"drop-shadow(0 2px 6px rgba(15,23,42,0.08))":"drop-shadow(0 2px 6px rgba(0,0,0,0.45))"},"data-topo-panel-elevation":"legend"}),(V=af.length-an,[{key:"working",y0:24,y1:28,fill:W?"#059669":"#22c55e",label:"working node",count:an},{key:"idle",y0:48,y1:52,fill:W?"#0d9488":"#2dd4bf",label:"online idle",count:V},{key:"offline",y0:72,y1:76,fill:W?"#94a3b8":"#6b7280",label:"offline / no SSE",count:ag.length}]).map(a=>{let c=aJ===a.key;return(0,b.jsxs)("g",{"data-legend-status":a.key,role:"button",tabIndex:0,"aria-pressed":c,style:{cursor:"pointer"},onPointerDown:a=>a.stopPropagation(),onMouseEnter:()=>aI(a.key),onMouseLeave:()=>aI(b=>b===a.key?null:b),onClick:()=>aK(b=>b===a.key?null:a.key),children:[(0,b.jsx)("rect",{x:"6",y:a.y0-12,width:"170",height:"22",rx:"3",fill:aH===a.key||c?a.fill:"transparent",opacity:c?W?.14:.18:aH===a.key?W?.08:.12:1,"data-legend-row-tinted":c?"pinned":aH===a.key?"hover":"none",style:{transition:"fill 150ms ease-out, opacity 150ms ease-out"}}),(0,b.jsx)("circle",{cx:"16",cy:a.y0,r:"5.5",fill:a.fill}),c&&(0,b.jsx)("circle",{cx:"16",cy:a.y0,r:"8",fill:"none",stroke:a.fill,strokeWidth:"1.5"}),(0,b.jsx)("text",{x:"30",y:a.y1,fill:aH===a.key||c?Y.legendHeadline:Y.legendText,fontSize:"11",fontFamily:"monospace",style:{transition:"fill 150ms ease-out"},children:a.label}),(0,b.jsx)("text",{x:"215",y:a.y1,textAnchor:"end",fill:Y.legendText,fontSize:"11",fontFamily:"monospace",opacity:aH===a.key||c?.95:.65,"data-legend-count":a.key,style:{pointerEvents:"none",transition:"opacity 150ms ease-out"},children:a.count})]},a.key)}),(0,b.jsx)("path",{d:"M140,72 Q164,48 196,72",fill:"none",stroke:Y.flowEdge,strokeWidth:"3",markerEnd:"url(#topo-arrow)",style:{pointerEvents:"none"}})]})]}),(()=>{if(.01>Math.abs(aP.zoom-1)&&1>Math.abs(aP.x)&&1>Math.abs(aP.y)||af.length+ag.length===0)return null;let a=-aP.x/aP.zoom*.12,c=-aP.y/aP.zoom*.12058823529411765,e=1e3/aP.zoom*.12,f=680/aP.zoom*.12058823529411765;return(0,b.jsx)("div",{className:"absolute right-3 rounded-md border shadow-lg shadow-black/30 overflow-hidden anet-fade-in",style:{bottom:56,background:Y.legendBox.fill,borderColor:Y.containerBorder,cursor:"crosshair"},role:"img","aria-label":"Topology minimap — click to recenter",title:"Minimap · click to recenter",onClick:a=>{let b=a.currentTarget.getBoundingClientRect(),c=(a.clientX-b.left)/b.width,d=(a.clientY-b.top)/b.height;aQ(a=>({...a,x:500-1e3*c*a.zoom,y:340-680*d*a.zoom}))},"data-topo-minimap":!0,children:(0,b.jsxs)("svg",{width:120,height:82,viewBox:"0 0 120 82",style:{display:"block"},children:[[...af,...ag].map(a=>{let c=ah[a.alias];if(!c)return null;let e=(a.network_id?d[`${a.network_id}:${a.alias}`]:void 0)??d[a.alias],f="offline"!==a.status||!!e,g=w(a,f,W);return(0,b.jsx)("circle",{cx:.12*c.x,cy:.12058823529411765*c.y,r:f?1.7:1.2,fill:g.primary,opacity:f?.9:.5},a.alias)}),(0,b.jsx)("rect",{x:Math.max(0,a),y:Math.max(0,c),width:Math.max(0,Math.min(120-Math.max(0,a),e)),height:Math.max(0,Math.min(82-Math.max(0,c),f)),fill:"none",stroke:Y.legendAccent,strokeWidth:"1",opacity:"0.9"})]})})})(),(0,b.jsxs)("div",{className:"absolute bottom-3 right-3 flex items-center gap-1.5 text-xs select-none",children:[(0,b.jsx)("div",{className:"flex items-center rounded-md border overflow-hidden",style:{background:Y.legendBox.fill,borderColor:Y.containerBorder},role:"group","aria-label":"Node size",children:[["S",.7],["M",.84],["L",1]].map(([a,c],d)=>(0,b.jsx)("button",{onClick:()=>(a=>{ae(a);try{localStorage.setItem("anet-topo-nodescale",String(a))}catch{}})(c),"aria-pressed":ad===c,title:`Node size: ${"S"===a?"small":"M"===a?"medium":"large"}`,className:`px-2 py-1 transition-colors ${d>0?"border-l":""} ${ad===c?"bg-cyan-500/15 text-cyan-300":"hover:bg-white/5"}`,style:{color:ad===c?void 0:Y.legendText,borderColor:Y.containerBorder},children:a},a))}),(0,b.jsxs)("div",{className:"flex items-center rounded-md border overflow-hidden",style:{background:Y.legendBox.fill,borderColor:Y.containerBorder},children:[(0,b.jsx)("button",{onClick:()=>a2(1/1.2),className:"px-2 py-1 hover:bg-white/5 transition-colors",style:{color:Y.legendText},"aria-label":"Zoom out",title:"Zoom out (−)",children:(0,b.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":!0,children:(0,b.jsx)("path",{d:"M5 12h14"})})}),(0,b.jsxs)("span",{className:"px-2 py-1 tabular-nums border-x text-center",style:{color:Y.legendText,borderColor:Y.containerBorder,minWidth:46},title:"Current zoom level",children:[Math.round(100*aP.zoom),"%"]}),(0,b.jsx)("button",{onClick:()=>a2(1.2),className:"px-2 py-1 hover:bg-white/5 transition-colors",style:{color:Y.legendText},"aria-label":"Zoom in",title:"Zoom in (+)",children:(0,b.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":!0,children:(0,b.jsx)("path",{d:"M12 5v14M5 12h14"})})})]}),(0,b.jsx)("button",{onClick:a3,className:"p-1.5 rounded-md border hover:bg-white/5 transition-colors",style:{background:Y.legendBox.fill,borderColor:Y.containerBorder,color:Y.legendText},"aria-label":"Reset view",title:"Reset zoom + pan (0, or double-click the canvas)",children:(0,b.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,b.jsx)("path",{d:"M3 12a9 9 0 1 0 9-9 9 9 0 0 0-6.4 2.6L3 8"}),(0,b.jsx)("path",{d:"M3 3v5h5"})]})}),(0,b.jsx)("button",{onClick:()=>{let a=aN.current;if(a)if(document.fullscreenElement)document.exitFullscreen?.();else{let b=a.requestFullscreen||a.webkitRequestFullscreen;b?.call(a)}},className:"p-1.5 rounded-md border hover:bg-white/5 transition-colors",style:{background:Y.legendBox.fill,borderColor:Y.containerBorder,color:Y.legendText},"aria-label":aT?"Exit fullscreen":"Enter fullscreen",title:aT?"Exit fullscreen":"Fullscreen",children:aT?(0,b.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,b.jsx)("path",{d:"M8 3v4a1 1 0 0 1-1 1H3M21 8h-4a1 1 0 0 1-1-1V3M3 16h4a1 1 0 0 1 1 1v4M16 21v-4a1 1 0 0 1 1-1h4"})}):(0,b.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,b.jsx)("path",{d:"M3 8V5a2 2 0 0 1 2-2h3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M21 16v3a2 2 0 0 1-2 2h-3"})})})]}),aV&&(0,b.jsx)(m,{alias:aV,onClose:()=>aW(null)})]})]})}let D={working:{bg:"bg-green-900/30 border-green-800/30",text:"text-green-300",dot:"bg-green-500",glow:"shadow-green-500/10"},idle:{bg:"bg-cyan-900/30 border-cyan-800/30",text:"text-cyan-300",dot:"bg-cyan-400",glow:"shadow-cyan-500/5"},blocked:{bg:"bg-yellow-900/30 border-yellow-800/30",text:"text-yellow-300",dot:"bg-yellow-500",glow:""},error:{bg:"bg-red-900/30 border-red-800/30",text:"text-red-300",dot:"bg-red-500",glow:""}},E={bg:"bg-gray-800/50 border-gray-700/30",text:"text-gray-500",dot:"bg-gray-500",glow:""};function F({session:a,hasSse:c,sseCount:f,onChat:g}){let h=c&&D[a.status]||E;return(0,b.jsxs)(d.default,{href:`/node?alias=${encodeURIComponent(a.alias)}`,prefetch:!1,className:`anet-agent-card group relative block rounded-xl border p-4 transition-all duration-300 cursor-pointer hover:-translate-y-0.5 ${c?`bg-[#111128] border-[#2a2a4a] hover:border-cyan-500/30 hover:shadow-lg ${h.glow}`:"bg-[#0d0d1a] border-[#1a1a2a] opacity-40"}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsx)(i.AliasAvatar,{alias:a.alias,size:22}),(0,b.jsx)("span",{className:"font-semibold text-white truncate text-sm",title:a.alias,children:a.alias}),(0,b.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${h.dot} ${c&&"working"===a.status?"animate-pulse":""}`})]}),(0,b.jsx)("span",{className:`text-[11px] px-2 py-0.5 rounded-md border shrink-0 ${h.bg} ${h.text}`,children:c?a.status:"offline"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,b.jsx)("span",{className:"text-xs text-gray-600 bg-[#0a0a15] px-2 py-0.5 rounded border border-[#1a1a2a]",children:a.agent||"unknown"}),c&&(0,b.jsxs)("span",{className:"text-[10px] text-green-500",children:["SSE:",f]})]}),a.task?(0,b.jsx)("div",{className:"text-xs text-gray-400 bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a] line-clamp-2",title:a.task,children:a.task}):(0,b.jsx)("div",{className:"text-xs text-gray-700 italic",children:"No active task"}),a.progress>0&&(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsxs)("div",{className:"flex justify-between text-[10px] mb-1",children:[(0,b.jsx)("span",{className:"text-gray-600",children:"Progress"}),(0,b.jsxs)("span",{className:h.text,children:[a.progress,"%"]})]}),(0,b.jsx)("div",{className:"w-full bg-gray-800 rounded-full h-1.5 overflow-hidden",children:(0,b.jsx)("div",{className:`h-1.5 rounded-full transition-all duration-700 ${"working"===a.status?"bg-green-500":"bg-cyan-500"}`,style:{width:`${Math.min(a.progress,100)}%`}})})]}),(0,b.jsxs)("div",{className:"mt-3 flex justify-between items-center text-[10px] text-gray-600",children:[(0,b.jsx)("span",{className:"truncate",title:a.server||"",children:a.server||"--"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[g&&c&&(0,b.jsx)("button",{onClick:b=>{b.preventDefault(),b.stopPropagation(),g(a.alias)},className:"text-cyan-400 hover:text-cyan-300 px-1.5 py-0.5 rounded border border-cyan-500/20 hover:bg-cyan-500/10 transition-colors",children:"Chat"}),(0,b.jsx)("span",{children:(0,e.timeAgo)(a.updated_at)}),(0,b.jsx)("svg",{"aria-hidden":!0,className:"w-3 h-3 text-gray-700 opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,b.jsx)("path",{d:"M9 18l6-6-6-6"})})]})]})]})}function G({messages:a}){return 0===a.length?null:(0,b.jsxs)("div",{className:"mt-8",children:[(0,b.jsxs)("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Inbox"}),(0,b.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:a.length})]}),(0,b.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto pr-1 scrollbar-thin",children:a.map(a=>(0,b.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-3 text-sm transition-colors hover:border-[#3a3a5a]",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs mb-1.5",children:[a.from_session&&(0,b.jsx)(i.AliasAvatar,{alias:a.from_session,size:16}),(0,b.jsx)("span",{className:"text-gray-200 font-medium truncate",children:a.from_session}),(0,b.jsx)("span",{className:"ml-auto text-gray-600 shrink-0",title:a.created_at,children:(0,e.timeAgo)(a.created_at)})]}),(0,b.jsx)("div",{className:"text-gray-300 leading-relaxed line-clamp-3",title:a.content||"",children:(0,e.previewContent)(a.content)})]},a.id))})]})}function H(){return(0,b.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,b.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8 anet-skeleton-pulse",children:[1,2,3,4].map(a=>(0,b.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-4 py-3",children:[(0,b.jsx)(I,{w:"2.5rem",h:"1.75rem"}),(0,b.jsx)(I,{w:"3.5rem",h:"0.75rem",className:"mt-2"}),(0,b.jsx)(I,{w:"5rem",h:"0.625rem",className:"mt-1"})]},a))}),(0,b.jsxs)("div",{className:"flex items-center gap-3 mb-3 anet-skeleton-pulse",children:[(0,b.jsx)(I,{w:"6rem",h:"2.5rem",rounded:"0.75rem"}),(0,b.jsxs)("div",{className:"flex-1 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-2.5 flex items-center gap-3",children:[(0,b.jsx)("div",{className:"w-8 h-8 rounded-full anet-skeleton-bar"}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)(I,{w:"6rem",h:"0.875rem"}),(0,b.jsx)(I,{w:"10rem",h:"0.625rem",className:"mt-1"})]})]})]}),(0,b.jsx)("div",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 anet-skeleton-pulse",children:(0,b.jsx)(I,{w:"14rem",h:"0.875rem"})}),(0,b.jsx)("div",{className:"grid grid-cols-3 gap-2 sm:gap-3 mb-3 anet-skeleton-pulse",children:[1,2,3].map(a=>(0,b.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-3",children:[(0,b.jsx)(I,{w:"2rem",h:"1.25rem"}),(0,b.jsx)(I,{w:"2.5rem",h:"0.75rem",className:"mt-1"}),(0,b.jsx)(I,{w:"3.5rem",h:"0.625rem",className:"mt-px"})]},a))}),(0,b.jsx)("div",{className:"grid grid-cols-3 gap-2 sm:gap-3 mb-6 anet-skeleton-pulse",children:[1,2,3].map(a=>(0,b.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-2.5 flex items-center justify-center gap-2",children:[(0,b.jsx)("div",{className:"w-4 h-4 rounded anet-skeleton-bar"}),(0,b.jsx)(I,{w:"4rem",h:"0.75rem"})]},a))}),(0,b.jsxs)("div",{className:"mb-6 flex gap-2 anet-skeleton-pulse",children:[(0,b.jsx)("div",{className:"flex-1 h-10 rounded-lg border border-[#2a2a4a] bg-[#111128]"}),(0,b.jsx)("div",{className:"w-28 h-10 rounded-lg anet-skeleton-bar"})]}),(0,b.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-3 sm:gap-4 anet-skeleton-pulse",children:[1,2,3,4].map(a=>(0,b.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] p-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,b.jsx)("div",{className:"w-2 h-2 rounded-full anet-skeleton-bar"}),(0,b.jsx)(I,{w:"6rem",h:"0.875rem"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(I,{w:"100%",h:"0.625rem"}),(0,b.jsx)(I,{w:"75%",h:"0.625rem"}),(0,b.jsx)(I,{w:"55%",h:"0.625rem"})]})]},a))})]})}function I({w:a,h:c,rounded:d,className:e}){return(0,b.jsx)("div",{className:`anet-skeleton-bar ${e||""}`,style:{width:a,height:c,borderRadius:d||"0.375rem"}})}var J=a.i(19595),K=a.i(49597),L=a.i(59202);function M(){let{setNetworkId:a}=(0,L.useNetworkId)(),[d,e]=(0,c.useState)({user:null,networks:[],currentNetwork:"",token:""}),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let a=sessionStorage.getItem("anet_v3_auth");if(a)try{e(JSON.parse(a))}catch{}},[]);let[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),v=async()=>{try{await fetch(`/api/hub/auth?token=${d.token}&endpoint=/api/auth/me`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update_profile",token:d.token,display_name:r,email:t})});let a=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update_profile",token:d.token,display_name:r,email:t})}),b=await a.json();if(b.ok&&b.user){let a={...d,user:b.user};e(a),sessionStorage.setItem("anet_v3_auth",JSON.stringify(a)),q(!1)}}catch{}};if(!d.user)return null;let w=(d.user.display_name||d.user.username).slice(0,2).toUpperCase();return(0,b.jsxs)("div",{className:"flex items-center justify-between bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-2.5 mb-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-cyan-500 to-blue-600 flex items-center justify-center text-xs font-bold text-white",children:w}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-sm text-white font-medium",children:d.user.display_name||d.user.username}),(0,b.jsxs)("div",{className:"text-[10px] text-gray-500",children:[d.user.role," · ",d.user.user_id]})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[d.networks.length>0&&(0,b.jsx)("select",{value:d.currentNetwork,onChange:b=>{let c={...d,currentNetwork:b.target.value};e(c),a(b.target.value),sessionStorage.setItem("anet_v3_auth",JSON.stringify(c))},className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white focus:outline-none",children:d.networks.map(a=>(0,b.jsx)("option",{value:a.network_id,children:a.network_name},a.network_id))}),(0,b.jsxs)("button",{onClick:()=>{s(d.user?.display_name||""),u(""),q(!p)},className:"text-xs text-gray-500 hover:text-gray-300 whitespace-nowrap","aria-label":"Edit profile",children:[(0,b.jsx)("span",{className:"hidden sm:inline",children:"Edit"}),(0,b.jsx)("svg",{className:"sm:hidden w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.862 4.487z"})})]}),(0,b.jsxs)("button",{onClick:()=>{e({user:null,networks:[],currentNetwork:"",token:""}),sessionStorage.removeItem("anet_v3_auth")},className:"text-xs text-gray-500 hover:text-gray-300 whitespace-nowrap","aria-label":"Sign out",children:[(0,b.jsx)("span",{className:"hidden sm:inline",children:"Sign out"}),(0,b.jsx)("svg",{className:"sm:hidden w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})})]})]}),p&&(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#2a2a4a]",children:[(0,b.jsx)("input",{type:"text",value:r,onChange:a=>s(a.target.value),placeholder:"Display name",className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white placeholder-gray-600 focus:outline-none w-32"}),(0,b.jsx)("input",{type:"email",value:t,onChange:a=>u(a.target.value),placeholder:"Email",className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white placeholder-gray-600 focus:outline-none w-40"}),(0,b.jsx)("button",{onClick:v,className:"px-2 py-1 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded",children:"Save"})]})]})}var N=a.i(72100);function O({tabs:a,activeTab:c,onOpenTab:d,onCloseTab:e,onSetActive:f,onClose:g}){return 0===a.length?null:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{onClick:g,className:"jsx-f7cf3d1a6fdfc074 fixed inset-0 bg-black/30 z-40 lg:hidden"}),(0,b.jsxs)("div",{className:"jsx-f7cf3d1a6fdfc074 fixed top-0 right-0 h-full w-full lg:w-[500px] bg-[#0a0a1a] border-l border-[#2a2a4a] z-50 flex flex-col shadow-2xl shadow-black/60 animate-slide-in",children:[(0,b.jsxs)("div",{className:"jsx-f7cf3d1a6fdfc074 flex items-center border-b border-[#2a2a4a] bg-[#0d0d1a] overflow-x-auto",children:[(0,b.jsx)("div",{className:"jsx-f7cf3d1a6fdfc074 flex-1 flex min-w-0",children:a.map(a=>(0,b.jsxs)("button",{onClick:()=>f(a),className:`jsx-f7cf3d1a6fdfc074 flex items-center gap-1.5 px-3 py-2.5 text-xs border-b-2 transition-colors shrink-0 ${c===a?"border-cyan-400 text-cyan-300 bg-cyan-500/5":"border-transparent text-gray-500 hover:text-gray-300"}`,children:[(0,b.jsx)("div",{className:`jsx-f7cf3d1a6fdfc074 w-2 h-2 rounded-full ${c===a?"bg-cyan-400":"bg-gray-600"}`}),(0,b.jsx)("span",{className:"jsx-f7cf3d1a6fdfc074 max-w-[80px] truncate",children:a}),(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),e(a)},className:"jsx-f7cf3d1a6fdfc074 ml-1 text-gray-600 hover:text-gray-300 p-0.5",children:"×"})]},a))}),(0,b.jsx)("button",{onClick:g,className:"jsx-f7cf3d1a6fdfc074 text-gray-500 hover:text-white px-3 py-2.5 shrink-0 border-l border-[#2a2a4a]",children:(0,b.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,className:"jsx-f7cf3d1a6fdfc074 w-4 h-4",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12",className:"jsx-f7cf3d1a6fdfc074"})})})]}),(0,b.jsx)("div",{className:"jsx-f7cf3d1a6fdfc074 flex-1 relative overflow-hidden",children:a.map(a=>(0,b.jsx)("div",{className:`jsx-f7cf3d1a6fdfc074 absolute inset-0 ${c===a?"block":"hidden"}`,children:(0,b.jsx)(P,{alias:a})},a))})]}),(0,b.jsx)(N.default,{id:"f7cf3d1a6fdfc074",children:"@keyframes slide-in{0%{transform:translate(100%)}to{transform:translate(0)}}.animate-slide-in{animation:.2s ease-out slide-in}"})]})}function P({alias:a}){return(0,b.jsx)(j.TaskChatPanel,{alias:a,onClose:()=>{},inline:!0})}function Q({sessions:a,onClose:d}){let[e,f]=(0,c.useState)(new Set),[g,h]=(0,c.useState)(""),[j,k]=(0,c.useState)("normal"),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)([]),[p,q]=(0,c.useState)(""),r=a.filter(a=>"offline"!==a.status).filter(a=>!p||a.alias.toLowerCase().includes(p.toLowerCase())||(a.agent||"").toLowerCase().includes(p.toLowerCase())),s=async()=>{if(!g.trim()||0===e.size||l)return;m(!0),o([]);let a=[...e].map(async a=>{try{let b=await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:a,task:g,priority:j})}),c=await b.json();return{alias:a,ok:!!c.ok,error:c.error}}catch(b){return{alias:a,ok:!1,error:"send failed"}}});o(await Promise.all(a)),m(!1)},t=n.filter(a=>a.ok).length;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"fixed inset-0 bg-black/50 z-40 anet-fade-in",onClick:d}),(0,b.jsxs)("div",{className:"fixed inset-4 lg:inset-x-[15%] lg:inset-y-[5%] bg-[#0a0a1a] border border-[#2a2a4a] rounded-2xl z-50 flex flex-col shadow-2xl shadow-black/70 overflow-hidden anet-fade-in",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-bold text-white",children:"Dispatch Task"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"Send a task to one or more agents"})]}),(0,b.jsx)("button",{onClick:d,className:"text-gray-500 hover:text-white p-1.5 rounded-lg hover:bg-[#1a1a2a]",children:(0,b.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,b.jsxs)("div",{className:"flex-1 flex flex-col lg:flex-row overflow-hidden",children:[(0,b.jsxs)("div",{className:"lg:w-[280px] border-b lg:border-b-0 lg:border-r border-[#2a2a4a] flex flex-col",children:[(0,b.jsxs)("div",{className:"px-4 py-3 border-b border-[#2a2a4a]",children:[(0,b.jsx)("input",{type:"text",value:p,onChange:a=>q(a.target.value),placeholder:"Filter agents...",className:"w-full bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none"}),(0,b.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,b.jsx)("button",{onClick:()=>{e.size===r.length?f(new Set):f(new Set(r.map(a=>a.alias)))},className:"text-[10px] text-cyan-400 hover:text-cyan-300",children:e.size===r.length?"Deselect all":`Select all (${r.length})`}),(0,b.jsxs)("span",{className:"text-[10px] text-gray-600",children:[e.size," selected"]})]})]}),(0,b.jsxs)("div",{className:"flex-1 overflow-y-auto px-2 py-2 space-y-0.5 max-h-[200px] lg:max-h-none",children:[r.map(a=>(0,b.jsxs)("button",{onClick:()=>{var b;return b=a.alias,void f(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-xs text-left transition-colors ${e.has(a.alias)?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/20":"text-gray-400 hover:bg-[#1a1a2a]"}`,children:[(0,b.jsx)(i.AliasAvatar,{alias:a.alias,size:16}),(0,b.jsx)("div",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${"working"===a.status?"bg-green-400":"idle"===a.status?"bg-cyan-400":"bg-gray-500"}`}),(0,b.jsx)("span",{className:"truncate flex-1",children:a.alias}),(0,b.jsx)("span",{className:"text-[9px] text-gray-600",children:a.agent||"--"})]},a.alias)),0===r.length&&(0,b.jsx)("div",{className:"text-center text-xs text-gray-600 py-4",children:"No online agents"})]})]}),(0,b.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,b.jsxs)("div",{className:"flex-1 px-6 py-4 flex flex-col",children:[(0,b.jsx)("label",{className:"text-xs text-gray-500 uppercase mb-2",children:"Task Prompt"}),(0,b.jsx)("textarea",{value:g,onChange:a=>h(a.target.value),placeholder:"Enter the task you want to dispatch...",className:"flex-1 min-h-[120px] bg-[#111128] border border-[#2a2a4a] rounded-xl px-4 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none resize-none"}),(0,b.jsxs)("div",{className:"flex items-center gap-3 mt-4",children:[(0,b.jsxs)("select",{value:j,onChange:a=>k(a.target.value),className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-xs text-white focus:outline-none",children:[(0,b.jsx)("option",{value:"normal",children:"Normal priority"}),(0,b.jsx)("option",{value:"high",children:"High priority"}),(0,b.jsx)("option",{value:"low",children:"Low priority"})]}),(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsx)("button",{onClick:s,disabled:l||!g.trim()||0===e.size,className:"px-6 py-2.5 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 disabled:from-gray-800 disabled:to-gray-800 disabled:text-gray-600 text-white text-sm font-medium rounded-xl transition-all shadow-lg shadow-cyan-500/10 disabled:shadow-none active:scale-95",children:l?(0,b.jsxs)("span",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Sending..."]}):`Dispatch to ${e.size} agent${e.size>1?"s":""}`})]})]}),n.length>0&&(0,b.jsxs)("div",{className:"px-6 py-3 border-t border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,b.jsxs)("div",{className:"text-xs text-gray-500 mb-2",children:[t,"/",n.length," dispatched successfully"]}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:n.map(a=>(0,b.jsxs)("span",{className:`flex items-center gap-1.5 text-[10px] pl-1 pr-2 py-0.5 rounded-full border ${a.ok?"text-green-300 border-green-500/20 bg-green-500/5":"text-red-300 border-red-500/20 bg-red-500/5"}`,children:[(0,b.jsx)(i.AliasAvatar,{alias:a.alias,size:14}),(0,b.jsx)("span",{children:a.alias}),(0,b.jsx)("span",{"aria-hidden":!0,children:a.ok?"✓":a.error||"✗"})]},a.alias))})]})]})]})]})]})}var R=a.i(66286),S=a.i(25894);a.s(["default",0,function(){let a,g,j,l,m;(0,c.useEffect)(()=>{sessionStorage.getItem("anet_v3_auth")||(fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login"))},[]);let{sessions:n,hint:o,error:p,isLoading:q}=(0,k.useSessions)(),{health:r}=(0,k.useHealth)(),{config:s}=(0,k.useAnetConfig)(),{tasks:t}=(0,k.useTasks)({limit:"500"}),{stats:u}=(0,k.useStats)(),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(!1),z=function(){let[a,b]=(0,c.useState)([]),[d,e]=(0,c.useState)("");return{tabs:a,activeTab:d,openTab:a=>{b(b=>b.includes(a)?b:[...b,a]),e(a)},closeTab:a=>{b(b=>{let c=b.filter(b=>b!==a);return d===a&&e(c[c.length-1]||""),c})},closeAll:()=>{b([]),e("")},setActiveTab:e}}(),[A,B]=(0,c.useState)(!1),[D,E]=(0,c.useState)([]),[I,L]=(0,c.useState)("all"),[N,P]=(0,c.useState)(null),{mutate:T}=(0,S.useSWRConfig)(),U="1"!==process.env.NEXT_PUBLIC_DISABLE_SSE,{connected:V,supported:W}=(0,R.useSSE)({url:"/api/hub/events",enabled:U,onEvent:a=>{if("node.renamed"===a.type){T("/api/hub/status");let b=a.data;b?.old_alias&&b?.new_alias&&P({from:b.old_alias,to:b.new_alias,ts:Date.now()});return}["new_task","new_message","new_reply","node_status_changed","broadcast"].includes(a.type)&&(T("/api/hub/status"),T(a=>"string"==typeof a&&a.startsWith("/api/hub/tasks"),void 0,{revalidate:!0}))}});if((0,c.useEffect)(()=>{let a=()=>{fetch("/api/hub/inbox").then(a=>a.json()).then(a=>{a.messages?.length&&E(b=>{let c=new Set(b.map(a=>a.id));return[...a.messages.filter(a=>!c.has(a.id)),...b].slice(0,100)})}).catch(()=>{})};a();let b=setInterval(a,1e4);return()=>clearInterval(b)},[]),q)return(0,b.jsx)(H,{});let X=r?.sse_sessions||{},Y=a=>(a.network_id?X[`${a.network_id}:${a.alias}`]:void 0)??X[a.alias],Z=a=>"offline"!==a.status||!!Y(a),$=n.filter(Z).length,_=n.length,aa=n.filter(a=>"working"===a.status).length,ab=r?(0,e.formatUptime)(r.uptime):"--",ac=r?.version||"--",ad=!!(s?.hub&&s.tokenConfigured),ae=s?.source==="file"?"Local config":s?.source==="runtime-env"?"Runtime env":"Config missing",af={};if(u?.tasks?.by_status?.length)for(let a of u.tasks.by_status)af[a.status]=a.count;else for(let a of t)af[a.status]=(af[a.status]||0)+1;let ag=[...n].sort((a,b)=>{let c=+!!Z(a),d=+!!Z(b);if(c!==d)return d-c;let e=+("working"===a.status);return("working"===b.status)-e}),ah=0===n.length&&!p;return(0,b.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,b.jsx)("div",{className:"lg:ml-0 ml-10",children:(0,b.jsx)(f,{online:$,working:aa,total:_,version:ac,uptime:ab})}),(0,b.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[!ah&&(0,b.jsx)("button",{onClick:()=>B(!0),className:"px-4 py-2 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 text-white text-sm font-medium rounded-xl shadow-lg shadow-cyan-500/10 transition-all active:scale-95 shrink-0",children:"⚡ Dispatch"}),(0,b.jsx)("div",{className:"flex-1",children:(0,b.jsx)(M,{})})]}),(0,b.jsxs)("section",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 shadow-lg shadow-black/20",children:[(0,b.jsxs)("button",{onClick:()=>y(!x),className:"w-full flex items-center justify-between text-left",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)("span",{className:"uppercase text-gray-600",children:"Config"}),(0,b.jsx)("span",{className:`w-2 h-2 rounded-full ${ad?"bg-green-400":"bg-red-400"}`}),(0,b.jsx)("span",{className:"text-gray-500",children:ae})]}),(0,b.jsx)("svg",{className:`w-4 h-4 text-gray-600 transition-transform ${x?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),x&&(0,b.jsxs)("div",{className:"mt-3 pt-3 border-t border-[#2a2a4a]",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,b.jsx)("div",{className:"min-w-0",children:(0,b.jsxs)("div",{className:"text-gray-100 truncate text-sm",title:s?.hub||void 0,children:["Hub: ",(0,b.jsx)("span",{className:s?.hub?"text-cyan-300":"text-red-300",children:s?.hub?.trim()||"not configured"})]})}),(0,b.jsx)("div",{className:"flex flex-wrap gap-2 text-xs",children:(0,b.jsxs)("span",{className:`px-2.5 py-1 rounded-md border ${s?.tokenConfigured?"bg-blue-500/5 text-blue-300 border-blue-500/20":"bg-gray-500/5 text-gray-400 border-gray-500/20"}`,children:["Token: ",s?.tokenPreview||"not configured"]})})]}),s?.error&&(0,b.jsx)("div",{className:"mt-2 text-xs text-gray-600",children:s.error})]})]}),Object.keys(af).length>0&&(0,b.jsxs)("section",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 shadow-lg shadow-black/20",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("div",{className:"text-xs uppercase text-gray-600",children:"Task Status"}),(0,b.jsx)(d.default,{href:"/tasks",prefetch:!1,className:"text-xs text-cyan-400 hover:text-cyan-300",children:"View all →"})]}),(0,b.jsx)("div",{className:"flex flex-wrap gap-2",children:["running","delivered","acked","replied","created","failed","cancelled","expired","closed"].filter(a=>af[a]).map(a=>(0,b.jsxs)(d.default,{href:`/tasks?status=${a}`,prefetch:!1,className:`px-2.5 py-1 rounded-md border text-xs ${K.STATUS_CHIP_CLASS[a]} hover:opacity-80 transition-opacity`,children:[a,": ",af[a]]},a))})]}),!ah&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 mb-2",children:"Quick navigation"}),(0,b.jsx)("section",{className:"mb-3 grid grid-cols-3 gap-2 sm:gap-3",children:(a=n.filter(a=>Z(a)&&"working"!==a.status).length,g=_-$,j=t.filter(a=>"failed"===a.status).length,[{href:"/nodes",label:"Nodes",value:`${$}/${_}`,sub:`${_>0?Math.round($/_*100):0}% online`,color:"text-green-400 border-green-500/20",popover:0===_?null:[{k:"working",v:aa,dot:"",color:"#4ade80"},{k:"idle",v:a,dot:"",color:"#22d3ee"},{k:"offline",v:g,dot:"",color:"#9ca3af"}]},{href:"/tasks",label:"Tasks",value:String(Object.values(af).reduce((a,b)=>a+b,0)||0),sub:"all-time",color:"text-cyan-400 border-cyan-500/20",popover:0===Object.keys(af).length?null:["running","replied","failed","cancelled","expired","closed","created","delivered","acked"].filter(a=>af[a]).map(a=>({k:a,v:af[a],dot:"",color:({running:"#4ade80",replied:"#a78bfa",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c",closed:"#9ca3af",created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee"})[a]||"#9ca3af"}))},{href:"/tasks?status=failed",label:"Failed",value:String(af.failed||0),sub:af.failed?"needs review":"none",color:af.failed?"text-red-400 border-red-500/25":"text-gray-500 border-gray-700/30",popover:j?[{k:`${j} in current view`,v:"",dot:"",color:"#f87171"}]:[{k:"no failures yet",v:"",dot:"",color:"#4b5563"}]}].map(a=>(0,b.jsxs)(d.default,{href:a.href,prefetch:!1,className:`anet-stat-link group relative rounded-xl border ${a.color} bg-[#111128] px-3 py-3 transition-all hover:-translate-y-px`,children:[(0,b.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,b.jsx)("div",{className:`text-xl font-semibold tabular-nums ${a.color.split(" ")[0]}`,children:a.value}),(0,b.jsx)("div",{className:"hidden sm:block text-[10px] text-gray-600 group-hover:text-gray-400 transition-colors",children:"View →"})]}),(0,b.jsx)("div",{className:"text-[11px] text-gray-400 mt-0.5",children:a.label}),(0,b.jsx)("div",{className:"text-[10px] text-gray-600 mt-px",children:a.sub}),a.popover&&a.popover.length>0&&(0,b.jsxs)("div",{className:"anet-stat-popover hidden md:block pointer-events-none absolute left-2 right-2 top-full mt-1 z-20 rounded-lg border border-[#2a2a4a] bg-[#0d0d1a] shadow-lg shadow-black/30 px-3 py-2 opacity-0 translate-y-[-2px] group-hover:opacity-100 group-hover:translate-y-0 transition-all duration-150 delay-100",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-1.5",children:"Breakdown"}),(0,b.jsx)("ul",{className:"space-y-1",children:a.popover.map(a=>(0,b.jsxs)("li",{className:"flex items-center gap-2 text-[11px]",children:[(0,b.jsx)("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:a.color},"aria-hidden":!0}),(0,b.jsx)("span",{className:"text-gray-400 capitalize",children:a.k}),""!==a.v&&(0,b.jsx)("span",{className:"ml-auto text-gray-300 tabular-nums font-medium",children:a.v})]},a.k))})]})]},a.href)))}),(0,b.jsx)("section",{className:"mb-6 grid grid-cols-3 gap-2 sm:gap-3",children:[{href:"/messages",label:"Messages",icon:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"},{href:"/logs",label:"Audit log",icon:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z M14 2v6h6 M16 13H8 M16 17H8 M10 9H8"},{href:"/admin",label:"Admin",icon:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4z M6 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2"}].map(a=>(0,b.jsxs)(d.default,{href:a.href,prefetch:!1,className:"anet-nav-tile flex items-center justify-center gap-2 rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-2.5 text-[12px] text-gray-400 hover:text-gray-200 transition-colors",children:[(0,b.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,b.jsx)("path",{d:a.icon})}),(0,b.jsx)("span",{children:a.label})]},a.href))}),(0,b.jsx)(h,{}),t.length>0&&(0,b.jsxs)("section",{className:"mb-6 bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Recent Activity"}),(0,b.jsx)(d.default,{href:"/tasks",className:"text-xs text-cyan-400 hover:text-cyan-300",children:"All tasks →"})]}),(0,b.jsx)("div",{className:"space-y-2 max-h-40 overflow-y-auto",children:t.slice(0,5).map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:K.STATUS_DOT_HEX[a.status]||"#6b7280"}}),a.from_name&&(0,b.jsx)(i.AliasAvatar,{alias:a.from_name,size:14}),(0,b.jsx)("span",{className:"text-gray-300 shrink-0 max-w-[20%] truncate",children:a.from_name||"?"}),(0,b.jsx)("span",{className:"text-gray-600",children:"→"}),a.to_name&&(0,b.jsx)(i.AliasAvatar,{alias:a.to_name,size:14}),(0,b.jsx)("span",{className:"text-gray-300 shrink-0 max-w-[20%] truncate",children:a.to_name||"?"}),(0,b.jsx)("span",{className:"text-gray-500 truncate flex-1",title:a.content||"",children:(0,e.previewContent)(a.content).slice(0,60)}),(0,b.jsx)("span",{className:`shrink-0 px-1.5 py-0.5 rounded text-[10px] border ${K.STATUS_CHIP_CLASS[a.status]||"text-gray-500 border-gray-700/30"}`,children:a.status})]},a.task_id))})]})]}),p&&(0,b.jsxs)("div",{className:"bg-red-900/20 border border-red-800/40 text-red-300 px-4 py-3 rounded-lg mb-6 text-sm flex items-center justify-between",role:"alert",children:[(0,b.jsx)("span",{children:String(p)}),(0,b.jsx)("span",{className:"text-gray-500 text-xs",children:"Check CommHub connection"})]}),n.length>0&&(0,b.jsx)("div",{className:"flex justify-center mb-4",children:(0,b.jsx)("button",{onClick:()=>w(!v),className:"text-xs text-gray-500 hover:text-gray-300 border border-gray-700/50 px-4 py-1.5 rounded-lg transition-colors hover:border-gray-600 cursor-pointer",children:v?"Hide Topology":"Show Topology"})}),!v&&n.length>0&&(0,b.jsx)("div",{className:"lg:hidden text-center text-xs text-gray-600 mb-4",children:"Topology hidden on mobile for better readability"}),v&&n.length>0&&(0,b.jsx)(C,{sessions:n,sseSessions:X,renameSignal:N}),0!==n.length||p?(l={all:ag.length,working:ag.filter(a=>Z(a)&&"working"===a.status).length,idle:ag.filter(a=>Z(a)&&"working"!==a.status).length,offline:ag.filter(a=>!Z(a)).length},m=ag.filter(a=>"all"===I||("offline"===I?!Z(a):"working"===I?Z(a)&&"working"===a.status:"idle"!==I||Z(a)&&"working"!==a.status)),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"mb-3 flex flex-wrap items-center gap-1",children:[{key:"all",label:"All"},{key:"working",label:"Working",dot:"#4ade80"},{key:"idle",label:"Idle",dot:"#22d3ee"},{key:"offline",label:"Offline",dot:"#6b7280"}].map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>L(a.key),disabled:0===l[a.key]&&"all"!==a.key,className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs transition-colors disabled:opacity-30 disabled:cursor-not-allowed ${I===a.key?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/30":"text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] border border-transparent"}`,children:[a.dot&&(0,b.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full",style:{backgroundColor:a.dot}}),(0,b.jsx)("span",{children:a.label}),(0,b.jsx)("span",{className:`text-[10px] tabular-nums ${I===a.key?"text-cyan-400":"text-gray-600"}`,children:l[a.key]})]},a.key))}),(0,b.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-3 sm:gap-4",children:m.map(a=>(0,b.jsx)(F,{session:a,hasSse:Z(a),sseCount:Y(a)||0,onChat:z.openTab},a.alias))}),0===m.length&&(0,b.jsxs)("div",{className:"mt-4 text-center text-xs text-gray-600",children:['No agents match "',I,'" — ',(0,b.jsx)("button",{onClick:()=>L("all"),className:"underline hover:text-gray-400",children:"Show all"})]})]})):(0,b.jsx)(J.NodesEmptyState,{hint:o,taskHistoryCount:Object.values(af).reduce((a,b)=>a+b,0)}),(0,b.jsx)(G,{messages:D}),(0,b.jsx)("div",{className:"mt-8 text-center text-xs text-gray-600 flex items-center justify-center gap-2 flex-wrap",children:W&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${V?"bg-green-400":"bg-gray-600"}`}),V?"SSE live":"SWR polling"]})}),A&&(0,b.jsx)(Q,{sessions:n,onClose:()=>B(!1)}),z.tabs.length>0&&(0,b.jsx)(O,{tabs:z.tabs,activeTab:z.activeTab,onOpenTab:z.openTab,onCloseTab:z.closeTab,onSetActive:z.setActiveTab,onClose:z.closeAll})]})}],87515)}];
|
|
4
|
+
${a.count} message${1===a.count?"":"s"}${v?` \xb7 last ${v}`:""}`,x=ay===a.key,y=ak[a.from]??a.from,z=ak[a.to]??a.to,A=x?2:ay?.35:aq||ax?a.from===aq||a.to===aq?1.7:ax&&y===ax&&z===ax?1.3:.35:aA?1.5:1,B=x?Math.min(1.4*q,10):q;return(0,b.jsxs)("g",{children:[(0,b.jsx)("path",{d:p,fill:"none",stroke:"transparent",strokeWidth:Math.max(q+10,16),style:{pointerEvents:"stroke"},"data-edge-hitbox":!0,onMouseEnter:()=>az(a.key),onMouseLeave:()=>az(b=>b===a.key?null:b),children:(0,b.jsx)("title",{children:w})}),(0,b.jsx)("path",{d:p,fill:"none",stroke:Y.flowEdge,strokeWidth:B,opacity:Math.min(1,(W?.22:.28)*s*A),filter:W?void 0:"url(#topo-glow)",markerEnd:`url(#${u})`,className:"transition-opacity duration-300",style:{pointerEvents:"none"}}),(0,b.jsx)("path",{id:`flow-path-${c}`,d:p,fill:"none",stroke:Y.flowPath,strokeWidth:"1",strokeDasharray:"2 12",opacity:Math.min(1,(W?.4:.75)*s*A),className:"transition-opacity duration-300"}),!X&&(0,b.jsx)("circle",{r:"4",fill:Y.flowParticle,filter:W?void 0:"url(#topo-glow)",opacity:Math.min(1,s*A),children:(0,b.jsx)("animateMotion",{dur:`${r}s`,begin:`-${(.37*c%r).toFixed(3)}s`,repeatCount:"indefinite",path:p})}),!X&&s>.5&&(0,b.jsxs)("circle",{cx:n.x,cy:n.y,r:"0",fill:"none",stroke:Y.flowEdge,strokeWidth:"1.5",opacity:"0",style:{pointerEvents:"none"},"data-arrival-ping":a.key,children:[(0,b.jsx)("animate",{attributeName:"r",values:"0;14;22",dur:`${r}s`,begin:`-${(.92*r).toFixed(2)}s`,repeatCount:"indefinite"}),(0,b.jsx)("animate",{attributeName:"opacity",values:"0;0.55;0",dur:`${r}s`,begin:`-${(.92*r).toFixed(2)}s`,repeatCount:"indefinite"})]}),!X&&s>.5&&a.count>=3&&(0,b.jsxs)("circle",{cx:m.x,cy:m.y,r:"0",fill:"none",stroke:Y.flowEdge,strokeWidth:"1.5",opacity:"0",style:{pointerEvents:"none"},"data-dispatch-pulse":a.key,children:[(0,b.jsx)("animate",{attributeName:"r",values:"0;12;18",dur:`${r}s`,begin:"0s",repeatCount:"indefinite"}),(0,b.jsx)("animate",{attributeName:"opacity",values:"0;0.45;0",dur:`${r}s`,begin:"0s",repeatCount:"indefinite"})]}),a.count>=3&&(d=(m.x+n.x)/2,e=(m.y+n.y)/2,f=n.x-m.x,h=Math.hypot(f,g=n.y-m.y)||1,i=d+-g/h*o*.5,j=e+f/h*o*.5,k=Math.min(1,s*A),(0,b.jsxs)("g",{"data-edge-count-badge":a.key,style:{pointerEvents:"none"},opacity:k,children:[(0,b.jsx)("circle",{cx:i,cy:j,r:"9",fill:Y.legendBox.fill,stroke:Y.flowEdge,strokeWidth:"1",opacity:W?.95:.82}),(0,b.jsx)("text",{x:i,y:j+3,textAnchor:"middle",fill:Y.legendHeadline,fontSize:"10",fontFamily:"monospace",fontWeight:"700",children:a.count})]}))]},a.key)}),"ring"===aa&&(0,b.jsxs)("g",{"data-topo-hub":!0,style:{cursor:"pointer"},onPointerDown:a=>a.stopPropagation(),onClick:()=>{a4(),aY({ts:Date.now(),x:500,y:330,r0:18,color:W?"#059669":"#10b981"}),setTimeout(()=>aY(a=>a&&500===a.x&&330===a.y?null:a),600)},children:[(0,b.jsx)("title",{children:(N=a.length,O=["Network hub",`${N} session${1===N?"":"s"}`],af.length>0&&O.push(`${af.length} online`),an>0&&O.push(`${an} working`),ai.length>0&&O.push(`${ai.length} active link${1===ai.length?"":"s"}`),O.join(" · ")+"\nclick to fit view")}),(Q=[.52,.58,.65,.72][P=0===an?0:an<=2?1:an<=5?2:3],R=[.16,.2,.26,.32][P],S=[4,3.2,2.7,2.4][P],T=`0.32;${Q};0.32`,U=`0.08;${R};0.08`,(0,b.jsx)("circle",{cx:500,cy:330,r:"18",fill:W?"#d1fae5":"#10b981",opacity:W?.42:.12,"data-hub-busyness":P,children:!X&&(0,b.jsx)("animate",{attributeName:"opacity",values:W?T:U,dur:`${S}s`,repeatCount:"indefinite"})})),(0,b.jsx)("circle",{cx:500,cy:330,r:"10",fill:W?"#059669":"#10b981"}),(0,b.jsx)("circle",{cx:500,cy:330,r:"5",fill:"#d1fae5",opacity:"0.9"})]}),[...af,...ag].map((a,c)=>{let e,f,g,h,j,k=ah[a.alias];if(!k)return null;let m=(a.network_id?d[`${a.network_id}:${a.alias}`]:void 0)??d[a.alias],n="offline"!==a.status||!!m,o=w(a,n,W),q=aj.has(a.alias),s=Math.round((n?26:18)*ad),t=!ap||aq===a.alias||aP.zoom>=1.4,v=!ax||(ak[a.alias]??a.alias)===ax,x=0;if("ring"===aa){let b=ah[a.alias];if(b){let a=Math.hypot(b.x-500,b.y-330);x=a<195?0:a<270?1:a<310?2:3}}return(0,b.jsxs)("g",{"data-node":a.alias,"data-tier-idx":"ring"===aa?x:-1,className:"group transition-opacity anet-fade-in",style:{cursor:"pointer",opacity:aM&&!aM.has(a.alias)&&aV!==a.alias||aG&&aV!==a.alias&&("unknown"===(e=p(a.model)).id?"?":e.initial)!==aG||aL&&aV!==a.alias&&!("working"===aL?"working"===a.status:"idle"===aL?n&&"working"!==a.status:!n)?.28:v?aV===a.alias||n?1:.6:.32,animationDelay:"ring"===aa?`${180*x+c%6*25}ms`:`${25*Math.min(c,24)}ms`,transform:X||aq!==a.alias?void 0:"translateY(-2px)",transition:"transform 180ms cubic-bezier(0.4,0,0.2,1)"},onPointerDown:a=>a.stopPropagation(),onPointerEnter:()=>ar(a.alias),onPointerLeave:()=>ar(b=>b===a.alias?null:b),onClick:()=>{aW(a.alias),aY({ts:Date.now(),x:k.x,y:k.y,r0:s,color:o.primary}),setTimeout(()=>aY(a=>a&&Date.now()-a.ts>=590?null:a),600)},children:[(()=>{var c,d;let e,f,g,h=!n&&a.last_seen_at?(0,l.relativeAgo)(a.last_seen_at):null,i=ak[a.alias],j=i?Object.values(ak).filter(a=>a===i).length:1,k=j>1?`group: ${i} \xb7 ${j}`:null,m=0,o=0;for(let b of ai)b.from===a.alias&&(o+=b.count),b.to===a.alias&&(m+=b.count);let q=m+o>0?`flows: ${m} in / ${o} out`:null;return(0,b.jsx)("title",{children:[`${a.alias} \xb7 ${a.status}`,(c=a.model,d=a.runtime,e=p(c),f=r(d),g=[],"unknown"!==e.id&&g.push(e.label),c&&g.push(c),f&&g.push(f.label),g.join(" · ")),k,a.project_dir?`cwd: ${a.project_dir}`:null,h?`last seen: ${h}`:null,q].filter(Boolean).join("\n")})})(),(0,b.jsx)("circle",{cx:k.x,cy:k.y,r:s+12,fill:"none",stroke:o.primary,strokeWidth:"2",className:"opacity-0 group-hover:opacity-70 transition-opacity duration-150",style:{pointerEvents:"none"}}),aV===a.alias&&(0,b.jsx)("circle",{cx:k.x,cy:k.y,r:s+14,fill:"none",stroke:o.primary,strokeWidth:"2.5",opacity:W?.85:.95,filter:W?void 0:"url(#topo-glow)",className:"transition-opacity duration-200",style:{pointerEvents:"none"}}),q&&!X&&(0,b.jsxs)("circle",{cx:k.x,cy:k.y,r:s+14,fill:o.primary,opacity:W?.08:.12,children:[(0,b.jsx)("animate",{attributeName:"r",values:`${s+8};${s+22};${s+8}`,dur:"2.4s",repeatCount:"indefinite"}),(0,b.jsx)("animate",{attributeName:"opacity",values:W?"0.12;0.02;0.12":"0.18;0.04;0.18",dur:"2.4s",repeatCount:"indefinite"})]}),(0,b.jsx)("circle",{cx:k.x,cy:k.y,r:s+8,fill:o.halo,opacity:n?W?.85:.65:W?.4:.25,className:"transition-[fill,opacity] duration-300 ease-out"}),(0,b.jsx)("circle",{cx:k.x,cy:k.y,r:s,fill:n?Y.nodeFill.online:Y.nodeFill.offline,stroke:o.primary,strokeWidth:n?3:1.5,strokeDasharray:n?"none":"5 5",filter:n&&!W?"url(#topo-glow)":void 0,className:"transition-[fill,stroke] duration-300 ease-out"}),(()=>{let c=Math.round((n?14:10)*ad),d=2*s,e=p(a.model),f=/书生|书小生|intern/i.test(a.alias);if(Z||f||e.logo)return(0,b.jsx)("image",{href:e.logo??"/intern_avatar.png",x:k.x-d/2,y:k.y-d/2,width:d,height:d,preserveAspectRatio:"xMidYMid meet"});if("unknown"!==e.id)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("circle",{cx:k.x,cy:k.y,r:c,fill:e.mono.bg,stroke:e.mono.ring,strokeWidth:"1"}),(0,b.jsx)("text",{x:k.x,y:k.y,dy:"0.34em",textAnchor:"middle",fill:e.mono.text,fontSize:c,fontFamily:"monospace",fontWeight:"700",children:e.initial})]});let g=(0,i.aliasAvatarColors)(ak[a.alias]||a.alias);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("circle",{cx:k.x,cy:k.y,r:c,fill:g.bg,stroke:g.ring,strokeWidth:"1"}),(0,b.jsx)("text",{x:k.x,y:k.y,dy:"0.34em",textAnchor:"middle",fill:g.text,fontSize:c,fontFamily:"monospace",fontWeight:"700",children:(0,i.aliasInitial)(a.alias)})]})})(),(()=>{let c=r(a.runtime);if(!c)return null;let d=n?7:5.5,e=k.x+.72*s,f=k.y+.72*s,g=2*d*.62;return(0,b.jsxs)("g",{style:{pointerEvents:"none"},children:[(0,b.jsx)("circle",{cx:e,cy:f,r:d,fill:Y.containerBg,stroke:c.color,strokeWidth:"1.5"}),(0,b.jsx)("g",{transform:`translate(${e-g/2} ${f-g/2}) scale(${g/24})`,children:(0,b.jsx)("path",{d:c.iconPath,fill:"none",stroke:c.color,strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})]})})(),"working"===a.status&&(g=(f=m??0)>=4?"0.7s":f>=2?"0.9s":"1.2s",(0,b.jsx)("circle",{cx:k.x,cy:k.y-(s-6),r:"2.5",fill:Y.flowParticle,"data-pulse-dur":g,opacity:X?.6:void 0,children:!X&&(0,b.jsx)("animate",{attributeName:"opacity",values:"1;0.25;1",dur:g,repeatCount:"indefinite"})})),(j=(h=ad<.8)?88:100,t?(0,b.jsxs)("g",{transform:`translate(${k.x}, ${k.y+s+(h?18:22)})`,style:{pointerEvents:"none"},className:"transition-transform duration-200 group-hover:-translate-y-[1.5px]",children:[(0,b.jsx)("rect",{x:-j/2,y:h?-12:-14,width:j,height:h?36:42,rx:"6",fill:Y.labelBox.fill,stroke:Y.labelBox.stroke,opacity:W?1:.94}),(0,b.jsx)("text",{x:"0",y:"1",textAnchor:"middle",fill:o.text,fontSize:h?11:12,fontFamily:"monospace",fontWeight:"700",children:u(a.alias,h?11:12)}),(0,b.jsxs)("text",{x:"0",y:h?15:17,textAnchor:"middle",fill:o.primary,fontSize:h?8:9,fontFamily:"monospace",children:[o.label,n&&null!=m?` sse:${m}`:""]})]}):(0,b.jsx)("text",{x:k.x,y:k.y+s+(h?12:14),textAnchor:"middle",fill:o.text,fontSize:h?9:10,fontFamily:"monospace",fontWeight:"700",opacity:.9,className:"transition-transform duration-200 group-hover:-translate-y-[1.5px]",style:{pointerEvents:"none",paintOrder:"stroke"},stroke:Y.containerBg,strokeWidth:"3",children:u(a.alias,h?9:10)}))]},a.alias)}),aX&&!X&&(0,b.jsxs)("circle",{cx:aX.x,cy:aX.y,r:aX.r0+4,fill:"none",stroke:aX.color,strokeWidth:"2",opacity:"0",style:{pointerEvents:"none"},children:[(0,b.jsx)("animate",{attributeName:"r",values:`${aX.r0+4};${aX.r0+30}`,dur:"0.5s",fill:"freeze"}),(0,b.jsx)("animate",{attributeName:"opacity",values:"0.7;0",dur:"0.5s",fill:"freeze"})]},aX.ts)]}),(0,b.jsxs)("g",{transform:"translate(16, 16)",children:[(0,b.jsx)("rect",{x:"0",y:"0",width:"230",height:"84",rx:"10",fill:Y.legendBox.fill,stroke:Y.legendBox.stroke,opacity:W?.97:.92,style:{filter:W?"drop-shadow(0 2px 6px rgba(15,23,42,0.08))":"drop-shadow(0 2px 6px rgba(0,0,0,0.45))"},"data-topo-panel-elevation":"recent"}),(0,b.jsx)("text",{x:"13",y:"21",fill:Y.legendHeadline,fontSize:"12",fontFamily:"monospace",fontWeight:"700",children:"recent signal"}),(0,b.jsxs)("text",{x:"150",y:"21",fill:Y.legendAccent,fontSize:"10",fontFamily:"monospace","data-recent-panel-count":!0,children:[ai.length," flows"]}),0===ai.length?(0,b.jsx)("text",{x:"115",y:"60",textAnchor:"middle",fill:Y.legendText,fontSize:"10",fontFamily:"monospace",fontStyle:"italic",opacity:.65,"data-recent-signal-empty":!0,children:"no flow yet"}):ai.slice(0,3).map((a,c)=>{let d=a.last_at?(0,l.relativeAgo)(a.last_at):null,e=d?d.replace(/\s+ago$/,""):null,f=ay===a.key;return(0,b.jsxs)("g",{"data-recent-row":a.key,"data-recent-row-hovered":f?"true":"false",style:{cursor:"pointer"},onMouseEnter:()=>az(a.key),onMouseLeave:()=>az(b=>b===a.key?null:b),children:[(0,b.jsx)("rect",{x:"6",y:38+16*c-10,width:"218",height:"14",rx:"3",fill:f?Y.legendAccent:"transparent",opacity:f?W?.1:.14:1,style:{transition:"fill 150ms ease-out, opacity 150ms ease-out"}}),(0,b.jsxs)("text",{x:"13",y:38+16*c,fill:ay===a.key?Y.legendHeadline:Y.legendText,fontSize:"9",fontFamily:"monospace",style:{transition:"fill 150ms ease-out"},children:[u(a.from,6)," ","->"," ",u(a.to,6)," / ",a.count," / ",u(a.content,8)]}),e?(0,b.jsx)("text",{x:"217",y:38+16*c,textAnchor:"end",fill:Y.legendText,fontSize:"8",fontFamily:"monospace",opacity:.55,"data-recent-row-ts":a.key,style:{pointerEvents:"none"},children:e}):null]},a.key)})]}),(0,b.jsxs)("g",{transform:"translate(760, 16)",children:[(0,b.jsx)("rect",{x:"0",y:"0",width:"224",height:"104",rx:"10",fill:Y.legendBox.fill,stroke:Y.legendBox.stroke,opacity:W?.97:.92,style:{filter:W?"drop-shadow(0 2px 6px rgba(15,23,42,0.08))":"drop-shadow(0 2px 6px rgba(0,0,0,0.45))"},"data-topo-panel-elevation":"legend"}),(0,b.jsx)("text",{x:"13",y:"21",fill:Y.legendHeadline,fontSize:"12",fontFamily:"monospace",fontWeight:"700",children:"legend"}),(0,b.jsxs)("text",{x:"215",y:"21",textAnchor:"end",fill:Y.legendAccent,fontSize:"10",fontFamily:"monospace","data-legend-panel-count":!0,children:[a.length," node",1===a.length?"":"s"]}),(V=af.length-an,[{key:"working",y0:32,y1:36,fill:W?"#059669":"#22c55e",label:"working node",count:an},{key:"idle",y0:56,y1:60,fill:W?"#0d9488":"#2dd4bf",label:"online idle",count:V},{key:"offline",y0:80,y1:84,fill:W?"#94a3b8":"#6b7280",label:"offline / no SSE",count:ag.length}]).map(a=>{let c=aJ===a.key;return(0,b.jsxs)("g",{"data-legend-status":a.key,role:"button",tabIndex:0,"aria-pressed":c,style:{cursor:"pointer"},onPointerDown:a=>a.stopPropagation(),onMouseEnter:()=>aI(a.key),onMouseLeave:()=>aI(b=>b===a.key?null:b),onClick:()=>aK(b=>b===a.key?null:a.key),children:[(0,b.jsx)("rect",{x:"6",y:a.y0-12,width:"170",height:"22",rx:"3",fill:aH===a.key||c?a.fill:"transparent",opacity:c?W?.14:.18:aH===a.key?W?.08:.12:1,"data-legend-row-tinted":c?"pinned":aH===a.key?"hover":"none",style:{transition:"fill 150ms ease-out, opacity 150ms ease-out"}}),(0,b.jsx)("circle",{cx:"16",cy:a.y0,r:"5.5",fill:a.fill}),c&&(0,b.jsx)("circle",{cx:"16",cy:a.y0,r:"8",fill:"none",stroke:a.fill,strokeWidth:"1.5"}),(0,b.jsx)("text",{x:"30",y:a.y1,fill:aH===a.key||c?Y.legendHeadline:Y.legendText,fontSize:"11",fontFamily:"monospace",style:{transition:"fill 150ms ease-out"},children:a.label}),(0,b.jsx)("text",{x:"215",y:a.y1,textAnchor:"end",fill:Y.legendText,fontSize:"11",fontFamily:"monospace",opacity:aH===a.key||c?.95:.65,"data-legend-count":a.key,style:{pointerEvents:"none",transition:"opacity 150ms ease-out"},children:a.count})]},a.key)}),(0,b.jsx)("path",{d:"M140,80 Q164,56 196,80",fill:"none",stroke:Y.flowEdge,strokeWidth:"3",markerEnd:"url(#topo-arrow)",style:{pointerEvents:"none"}})]})]}),(()=>{if(.01>Math.abs(aP.zoom-1)&&1>Math.abs(aP.x)&&1>Math.abs(aP.y)||af.length+ag.length===0)return null;let a=-aP.x/aP.zoom*.12,c=-aP.y/aP.zoom*.12058823529411765,e=1e3/aP.zoom*.12,f=680/aP.zoom*.12058823529411765;return(0,b.jsx)("div",{className:"absolute right-3 rounded-md border shadow-lg shadow-black/30 overflow-hidden anet-fade-in",style:{bottom:56,background:Y.legendBox.fill,borderColor:Y.containerBorder,cursor:"crosshair"},role:"img","aria-label":"Topology minimap — click to recenter",title:"Minimap · click to recenter",onClick:a=>{let b=a.currentTarget.getBoundingClientRect(),c=(a.clientX-b.left)/b.width,d=(a.clientY-b.top)/b.height;aQ(a=>({...a,x:500-1e3*c*a.zoom,y:340-680*d*a.zoom}))},"data-topo-minimap":!0,children:(0,b.jsxs)("svg",{width:120,height:82,viewBox:"0 0 120 82",style:{display:"block"},children:[[...af,...ag].map(a=>{let c=ah[a.alias];if(!c)return null;let e=(a.network_id?d[`${a.network_id}:${a.alias}`]:void 0)??d[a.alias],f="offline"!==a.status||!!e,g=w(a,f,W);return(0,b.jsx)("circle",{cx:.12*c.x,cy:.12058823529411765*c.y,r:f?1.7:1.2,fill:g.primary,opacity:f?.9:.5},a.alias)}),(0,b.jsx)("rect",{x:Math.max(0,a),y:Math.max(0,c),width:Math.max(0,Math.min(120-Math.max(0,a),e)),height:Math.max(0,Math.min(82-Math.max(0,c),f)),fill:"none",stroke:Y.legendAccent,strokeWidth:"1",opacity:"0.9"})]})})})(),(0,b.jsxs)("div",{className:"absolute bottom-3 right-3 flex items-center gap-1.5 text-xs select-none",children:[(0,b.jsx)("div",{className:"flex items-center rounded-md border overflow-hidden",style:{background:Y.legendBox.fill,borderColor:Y.containerBorder},role:"group","aria-label":"Node size",children:[["S",.7],["M",.84],["L",1]].map(([a,c],d)=>(0,b.jsx)("button",{onClick:()=>(a=>{ae(a);try{localStorage.setItem("anet-topo-nodescale",String(a))}catch{}})(c),"aria-pressed":ad===c,title:`Node size: ${"S"===a?"small":"M"===a?"medium":"large"}`,className:`px-2 py-1 transition-colors ${d>0?"border-l":""} ${ad===c?"bg-cyan-500/15 text-cyan-300":"hover:bg-white/5"}`,style:{color:ad===c?void 0:Y.legendText,borderColor:Y.containerBorder},children:a},a))}),(0,b.jsxs)("div",{className:"flex items-center rounded-md border overflow-hidden",style:{background:Y.legendBox.fill,borderColor:Y.containerBorder},children:[(0,b.jsx)("button",{onClick:()=>a2(1/1.2),className:"px-2 py-1 hover:bg-white/5 transition-colors",style:{color:Y.legendText},"aria-label":"Zoom out",title:"Zoom out (−)",children:(0,b.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":!0,children:(0,b.jsx)("path",{d:"M5 12h14"})})}),(0,b.jsxs)("span",{className:"px-2 py-1 tabular-nums border-x text-center",style:{color:Y.legendText,borderColor:Y.containerBorder,minWidth:46},title:"Current zoom level",children:[Math.round(100*aP.zoom),"%"]}),(0,b.jsx)("button",{onClick:()=>a2(1.2),className:"px-2 py-1 hover:bg-white/5 transition-colors",style:{color:Y.legendText},"aria-label":"Zoom in",title:"Zoom in (+)",children:(0,b.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":!0,children:(0,b.jsx)("path",{d:"M12 5v14M5 12h14"})})})]}),(0,b.jsx)("button",{onClick:a3,className:"p-1.5 rounded-md border hover:bg-white/5 transition-colors",style:{background:Y.legendBox.fill,borderColor:Y.containerBorder,color:Y.legendText},"aria-label":"Reset view",title:"Reset zoom + pan (0, or double-click the canvas)",children:(0,b.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,b.jsx)("path",{d:"M3 12a9 9 0 1 0 9-9 9 9 0 0 0-6.4 2.6L3 8"}),(0,b.jsx)("path",{d:"M3 3v5h5"})]})}),(0,b.jsx)("button",{onClick:()=>{let a=aN.current;if(a)if(document.fullscreenElement)document.exitFullscreen?.();else{let b=a.requestFullscreen||a.webkitRequestFullscreen;b?.call(a)}},className:"p-1.5 rounded-md border hover:bg-white/5 transition-colors",style:{background:Y.legendBox.fill,borderColor:Y.containerBorder,color:Y.legendText},"aria-label":aT?"Exit fullscreen":"Enter fullscreen",title:aT?"Exit fullscreen":"Fullscreen",children:aT?(0,b.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,b.jsx)("path",{d:"M8 3v4a1 1 0 0 1-1 1H3M21 8h-4a1 1 0 0 1-1-1V3M3 16h4a1 1 0 0 1 1 1v4M16 21v-4a1 1 0 0 1 1-1h4"})}):(0,b.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,b.jsx)("path",{d:"M3 8V5a2 2 0 0 1 2-2h3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M21 16v3a2 2 0 0 1-2 2h-3"})})})]}),aV&&(0,b.jsx)(m,{alias:aV,onClose:()=>aW(null)})]})]})}let D={working:{bg:"bg-green-900/30 border-green-800/30",text:"text-green-300",dot:"bg-green-500",glow:"shadow-green-500/10"},idle:{bg:"bg-cyan-900/30 border-cyan-800/30",text:"text-cyan-300",dot:"bg-cyan-400",glow:"shadow-cyan-500/5"},blocked:{bg:"bg-yellow-900/30 border-yellow-800/30",text:"text-yellow-300",dot:"bg-yellow-500",glow:""},error:{bg:"bg-red-900/30 border-red-800/30",text:"text-red-300",dot:"bg-red-500",glow:""}},E={bg:"bg-gray-800/50 border-gray-700/30",text:"text-gray-500",dot:"bg-gray-500",glow:""};function F({session:a,hasSse:c,sseCount:f,onChat:g}){let h=c&&D[a.status]||E;return(0,b.jsxs)(d.default,{href:`/node?alias=${encodeURIComponent(a.alias)}`,prefetch:!1,className:`anet-agent-card group relative block rounded-xl border p-4 transition-all duration-300 cursor-pointer hover:-translate-y-0.5 ${c?`bg-[#111128] border-[#2a2a4a] hover:border-cyan-500/30 hover:shadow-lg ${h.glow}`:"bg-[#0d0d1a] border-[#1a1a2a] opacity-40"}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,b.jsx)(i.AliasAvatar,{alias:a.alias,size:22}),(0,b.jsx)("span",{className:"font-semibold text-white truncate text-sm",title:a.alias,children:a.alias}),(0,b.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${h.dot} ${c&&"working"===a.status?"animate-pulse":""}`})]}),(0,b.jsx)("span",{className:`text-[11px] px-2 py-0.5 rounded-md border shrink-0 ${h.bg} ${h.text}`,children:c?a.status:"offline"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,b.jsx)("span",{className:"text-xs text-gray-600 bg-[#0a0a15] px-2 py-0.5 rounded border border-[#1a1a2a]",children:a.agent||"unknown"}),c&&(0,b.jsxs)("span",{className:"text-[10px] text-green-500",children:["SSE:",f]})]}),a.task?(0,b.jsx)("div",{className:"text-xs text-gray-400 bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a] line-clamp-2",title:a.task,children:a.task}):(0,b.jsx)("div",{className:"text-xs text-gray-700 italic",children:"No active task"}),a.progress>0&&(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsxs)("div",{className:"flex justify-between text-[10px] mb-1",children:[(0,b.jsx)("span",{className:"text-gray-600",children:"Progress"}),(0,b.jsxs)("span",{className:h.text,children:[a.progress,"%"]})]}),(0,b.jsx)("div",{className:"w-full bg-gray-800 rounded-full h-1.5 overflow-hidden",children:(0,b.jsx)("div",{className:`h-1.5 rounded-full transition-all duration-700 ${"working"===a.status?"bg-green-500":"bg-cyan-500"}`,style:{width:`${Math.min(a.progress,100)}%`}})})]}),(0,b.jsxs)("div",{className:"mt-3 flex justify-between items-center text-[10px] text-gray-600",children:[(0,b.jsx)("span",{className:"truncate",title:a.server||"",children:a.server||"--"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[g&&c&&(0,b.jsx)("button",{onClick:b=>{b.preventDefault(),b.stopPropagation(),g(a.alias)},className:"text-cyan-400 hover:text-cyan-300 px-1.5 py-0.5 rounded border border-cyan-500/20 hover:bg-cyan-500/10 transition-colors",children:"Chat"}),(0,b.jsx)("span",{children:(0,e.timeAgo)(a.updated_at)}),(0,b.jsx)("svg",{"aria-hidden":!0,className:"w-3 h-3 text-gray-700 opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,b.jsx)("path",{d:"M9 18l6-6-6-6"})})]})]})]})}function G({messages:a}){return 0===a.length?null:(0,b.jsxs)("div",{className:"mt-8",children:[(0,b.jsxs)("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-gray-500",children:"Inbox"}),(0,b.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:a.length})]}),(0,b.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto pr-1 scrollbar-thin",children:a.map(a=>(0,b.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-3 text-sm transition-colors hover:border-[#3a3a5a]",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs mb-1.5",children:[a.from_session&&(0,b.jsx)(i.AliasAvatar,{alias:a.from_session,size:16}),(0,b.jsx)("span",{className:"text-gray-200 font-medium truncate",children:a.from_session}),(0,b.jsx)("span",{className:"ml-auto text-gray-600 shrink-0",title:a.created_at,children:(0,e.timeAgo)(a.created_at)})]}),(0,b.jsx)("div",{className:"text-gray-300 leading-relaxed line-clamp-3",title:a.content||"",children:(0,e.previewContent)(a.content)})]},a.id))})]})}function H(){return(0,b.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,b.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8 anet-skeleton-pulse",children:[1,2,3,4].map(a=>(0,b.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-4 py-3",children:[(0,b.jsx)(I,{w:"2.5rem",h:"1.75rem"}),(0,b.jsx)(I,{w:"3.5rem",h:"0.75rem",className:"mt-2"}),(0,b.jsx)(I,{w:"5rem",h:"0.625rem",className:"mt-1"})]},a))}),(0,b.jsxs)("div",{className:"flex items-center gap-3 mb-3 anet-skeleton-pulse",children:[(0,b.jsx)(I,{w:"6rem",h:"2.5rem",rounded:"0.75rem"}),(0,b.jsxs)("div",{className:"flex-1 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-2.5 flex items-center gap-3",children:[(0,b.jsx)("div",{className:"w-8 h-8 rounded-full anet-skeleton-bar"}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)(I,{w:"6rem",h:"0.875rem"}),(0,b.jsx)(I,{w:"10rem",h:"0.625rem",className:"mt-1"})]})]})]}),(0,b.jsx)("div",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 anet-skeleton-pulse",children:(0,b.jsx)(I,{w:"14rem",h:"0.875rem"})}),(0,b.jsx)("div",{className:"grid grid-cols-3 gap-2 sm:gap-3 mb-3 anet-skeleton-pulse",children:[1,2,3].map(a=>(0,b.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-3",children:[(0,b.jsx)(I,{w:"2rem",h:"1.25rem"}),(0,b.jsx)(I,{w:"2.5rem",h:"0.75rem",className:"mt-1"}),(0,b.jsx)(I,{w:"3.5rem",h:"0.625rem",className:"mt-px"})]},a))}),(0,b.jsx)("div",{className:"grid grid-cols-3 gap-2 sm:gap-3 mb-6 anet-skeleton-pulse",children:[1,2,3].map(a=>(0,b.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-2.5 flex items-center justify-center gap-2",children:[(0,b.jsx)("div",{className:"w-4 h-4 rounded anet-skeleton-bar"}),(0,b.jsx)(I,{w:"4rem",h:"0.75rem"})]},a))}),(0,b.jsxs)("div",{className:"mb-6 flex gap-2 anet-skeleton-pulse",children:[(0,b.jsx)("div",{className:"flex-1 h-10 rounded-lg border border-[#2a2a4a] bg-[#111128]"}),(0,b.jsx)("div",{className:"w-28 h-10 rounded-lg anet-skeleton-bar"})]}),(0,b.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-3 sm:gap-4 anet-skeleton-pulse",children:[1,2,3,4].map(a=>(0,b.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] p-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,b.jsx)("div",{className:"w-2 h-2 rounded-full anet-skeleton-bar"}),(0,b.jsx)(I,{w:"6rem",h:"0.875rem"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(I,{w:"100%",h:"0.625rem"}),(0,b.jsx)(I,{w:"75%",h:"0.625rem"}),(0,b.jsx)(I,{w:"55%",h:"0.625rem"})]})]},a))})]})}function I({w:a,h:c,rounded:d,className:e}){return(0,b.jsx)("div",{className:`anet-skeleton-bar ${e||""}`,style:{width:a,height:c,borderRadius:d||"0.375rem"}})}var J=a.i(19595),K=a.i(49597),L=a.i(59202);function M(){let{setNetworkId:a}=(0,L.useNetworkId)(),[d,e]=(0,c.useState)({user:null,networks:[],currentNetwork:"",token:""}),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let a=sessionStorage.getItem("anet_v3_auth");if(a)try{e(JSON.parse(a))}catch{}},[]);let[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(""),v=async()=>{try{await fetch(`/api/hub/auth?token=${d.token}&endpoint=/api/auth/me`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update_profile",token:d.token,display_name:r,email:t})});let a=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update_profile",token:d.token,display_name:r,email:t})}),b=await a.json();if(b.ok&&b.user){let a={...d,user:b.user};e(a),sessionStorage.setItem("anet_v3_auth",JSON.stringify(a)),q(!1)}}catch{}};if(!d.user)return null;let w=(d.user.display_name||d.user.username).slice(0,2).toUpperCase();return(0,b.jsxs)("div",{className:"flex items-center justify-between bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-2.5 mb-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-cyan-500 to-blue-600 flex items-center justify-center text-xs font-bold text-white",children:w}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-sm text-white font-medium",children:d.user.display_name||d.user.username}),(0,b.jsxs)("div",{className:"text-[10px] text-gray-500",children:[d.user.role," · ",d.user.user_id]})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[d.networks.length>0&&(0,b.jsx)("select",{value:d.currentNetwork,onChange:b=>{let c={...d,currentNetwork:b.target.value};e(c),a(b.target.value),sessionStorage.setItem("anet_v3_auth",JSON.stringify(c))},className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white focus:outline-none",children:d.networks.map(a=>(0,b.jsx)("option",{value:a.network_id,children:a.network_name},a.network_id))}),(0,b.jsxs)("button",{onClick:()=>{s(d.user?.display_name||""),u(""),q(!p)},className:"text-xs text-gray-500 hover:text-gray-300 whitespace-nowrap","aria-label":"Edit profile",children:[(0,b.jsx)("span",{className:"hidden sm:inline",children:"Edit"}),(0,b.jsx)("svg",{className:"sm:hidden w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.862 4.487z"})})]}),(0,b.jsxs)("button",{onClick:()=>{e({user:null,networks:[],currentNetwork:"",token:""}),sessionStorage.removeItem("anet_v3_auth")},className:"text-xs text-gray-500 hover:text-gray-300 whitespace-nowrap","aria-label":"Sign out",children:[(0,b.jsx)("span",{className:"hidden sm:inline",children:"Sign out"}),(0,b.jsx)("svg",{className:"sm:hidden w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})})]})]}),p&&(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#2a2a4a]",children:[(0,b.jsx)("input",{type:"text",value:r,onChange:a=>s(a.target.value),placeholder:"Display name",className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white placeholder-gray-600 focus:outline-none w-32"}),(0,b.jsx)("input",{type:"email",value:t,onChange:a=>u(a.target.value),placeholder:"Email",className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white placeholder-gray-600 focus:outline-none w-40"}),(0,b.jsx)("button",{onClick:v,className:"px-2 py-1 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded",children:"Save"})]})]})}var N=a.i(72100);function O({tabs:a,activeTab:c,onOpenTab:d,onCloseTab:e,onSetActive:f,onClose:g}){return 0===a.length?null:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{onClick:g,className:"jsx-f7cf3d1a6fdfc074 fixed inset-0 bg-black/30 z-40 lg:hidden"}),(0,b.jsxs)("div",{className:"jsx-f7cf3d1a6fdfc074 fixed top-0 right-0 h-full w-full lg:w-[500px] bg-[#0a0a1a] border-l border-[#2a2a4a] z-50 flex flex-col shadow-2xl shadow-black/60 animate-slide-in",children:[(0,b.jsxs)("div",{className:"jsx-f7cf3d1a6fdfc074 flex items-center border-b border-[#2a2a4a] bg-[#0d0d1a] overflow-x-auto",children:[(0,b.jsx)("div",{className:"jsx-f7cf3d1a6fdfc074 flex-1 flex min-w-0",children:a.map(a=>(0,b.jsxs)("button",{onClick:()=>f(a),className:`jsx-f7cf3d1a6fdfc074 flex items-center gap-1.5 px-3 py-2.5 text-xs border-b-2 transition-colors shrink-0 ${c===a?"border-cyan-400 text-cyan-300 bg-cyan-500/5":"border-transparent text-gray-500 hover:text-gray-300"}`,children:[(0,b.jsx)("div",{className:`jsx-f7cf3d1a6fdfc074 w-2 h-2 rounded-full ${c===a?"bg-cyan-400":"bg-gray-600"}`}),(0,b.jsx)("span",{className:"jsx-f7cf3d1a6fdfc074 max-w-[80px] truncate",children:a}),(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),e(a)},className:"jsx-f7cf3d1a6fdfc074 ml-1 text-gray-600 hover:text-gray-300 p-0.5",children:"×"})]},a))}),(0,b.jsx)("button",{onClick:g,className:"jsx-f7cf3d1a6fdfc074 text-gray-500 hover:text-white px-3 py-2.5 shrink-0 border-l border-[#2a2a4a]",children:(0,b.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,className:"jsx-f7cf3d1a6fdfc074 w-4 h-4",children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12",className:"jsx-f7cf3d1a6fdfc074"})})})]}),(0,b.jsx)("div",{className:"jsx-f7cf3d1a6fdfc074 flex-1 relative overflow-hidden",children:a.map(a=>(0,b.jsx)("div",{className:`jsx-f7cf3d1a6fdfc074 absolute inset-0 ${c===a?"block":"hidden"}`,children:(0,b.jsx)(P,{alias:a})},a))})]}),(0,b.jsx)(N.default,{id:"f7cf3d1a6fdfc074",children:"@keyframes slide-in{0%{transform:translate(100%)}to{transform:translate(0)}}.animate-slide-in{animation:.2s ease-out slide-in}"})]})}function P({alias:a}){return(0,b.jsx)(j.TaskChatPanel,{alias:a,onClose:()=>{},inline:!0})}function Q({sessions:a,onClose:d}){let[e,f]=(0,c.useState)(new Set),[g,h]=(0,c.useState)(""),[j,k]=(0,c.useState)("normal"),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)([]),[p,q]=(0,c.useState)(""),r=a.filter(a=>"offline"!==a.status).filter(a=>!p||a.alias.toLowerCase().includes(p.toLowerCase())||(a.agent||"").toLowerCase().includes(p.toLowerCase())),s=async()=>{if(!g.trim()||0===e.size||l)return;m(!0),o([]);let a=[...e].map(async a=>{try{let b=await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:a,task:g,priority:j})}),c=await b.json();return{alias:a,ok:!!c.ok,error:c.error}}catch(b){return{alias:a,ok:!1,error:"send failed"}}});o(await Promise.all(a)),m(!1)},t=n.filter(a=>a.ok).length;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"fixed inset-0 bg-black/50 z-40 anet-fade-in",onClick:d}),(0,b.jsxs)("div",{className:"fixed inset-4 lg:inset-x-[15%] lg:inset-y-[5%] bg-[#0a0a1a] border border-[#2a2a4a] rounded-2xl z-50 flex flex-col shadow-2xl shadow-black/70 overflow-hidden anet-fade-in",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-lg font-bold text-white",children:"Dispatch Task"}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"Send a task to one or more agents"})]}),(0,b.jsx)("button",{onClick:d,className:"text-gray-500 hover:text-white p-1.5 rounded-lg hover:bg-[#1a1a2a]",children:(0,b.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,b.jsxs)("div",{className:"flex-1 flex flex-col lg:flex-row overflow-hidden",children:[(0,b.jsxs)("div",{className:"lg:w-[280px] border-b lg:border-b-0 lg:border-r border-[#2a2a4a] flex flex-col",children:[(0,b.jsxs)("div",{className:"px-4 py-3 border-b border-[#2a2a4a]",children:[(0,b.jsx)("input",{type:"text",value:p,onChange:a=>q(a.target.value),placeholder:"Filter agents...",className:"w-full bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none"}),(0,b.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,b.jsx)("button",{onClick:()=>{e.size===r.length?f(new Set):f(new Set(r.map(a=>a.alias)))},className:"text-[10px] text-cyan-400 hover:text-cyan-300",children:e.size===r.length?"Deselect all":`Select all (${r.length})`}),(0,b.jsxs)("span",{className:"text-[10px] text-gray-600",children:[e.size," selected"]})]})]}),(0,b.jsxs)("div",{className:"flex-1 overflow-y-auto px-2 py-2 space-y-0.5 max-h-[200px] lg:max-h-none",children:[r.map(a=>(0,b.jsxs)("button",{onClick:()=>{var b;return b=a.alias,void f(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-xs text-left transition-colors ${e.has(a.alias)?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/20":"text-gray-400 hover:bg-[#1a1a2a]"}`,children:[(0,b.jsx)(i.AliasAvatar,{alias:a.alias,size:16}),(0,b.jsx)("div",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${"working"===a.status?"bg-green-400":"idle"===a.status?"bg-cyan-400":"bg-gray-500"}`}),(0,b.jsx)("span",{className:"truncate flex-1",children:a.alias}),(0,b.jsx)("span",{className:"text-[9px] text-gray-600",children:a.agent||"--"})]},a.alias)),0===r.length&&(0,b.jsx)("div",{className:"text-center text-xs text-gray-600 py-4",children:"No online agents"})]})]}),(0,b.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,b.jsxs)("div",{className:"flex-1 px-6 py-4 flex flex-col",children:[(0,b.jsx)("label",{className:"text-xs text-gray-500 uppercase mb-2",children:"Task Prompt"}),(0,b.jsx)("textarea",{value:g,onChange:a=>h(a.target.value),placeholder:"Enter the task you want to dispatch...",className:"flex-1 min-h-[120px] bg-[#111128] border border-[#2a2a4a] rounded-xl px-4 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none resize-none"}),(0,b.jsxs)("div",{className:"flex items-center gap-3 mt-4",children:[(0,b.jsxs)("select",{value:j,onChange:a=>k(a.target.value),className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-xs text-white focus:outline-none",children:[(0,b.jsx)("option",{value:"normal",children:"Normal priority"}),(0,b.jsx)("option",{value:"high",children:"High priority"}),(0,b.jsx)("option",{value:"low",children:"Low priority"})]}),(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsx)("button",{onClick:s,disabled:l||!g.trim()||0===e.size,className:"px-6 py-2.5 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 disabled:from-gray-800 disabled:to-gray-800 disabled:text-gray-600 text-white text-sm font-medium rounded-xl transition-all shadow-lg shadow-cyan-500/10 disabled:shadow-none active:scale-95",children:l?(0,b.jsxs)("span",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Sending..."]}):`Dispatch to ${e.size} agent${e.size>1?"s":""}`})]})]}),n.length>0&&(0,b.jsxs)("div",{className:"px-6 py-3 border-t border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,b.jsxs)("div",{className:"text-xs text-gray-500 mb-2",children:[t,"/",n.length," dispatched successfully"]}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:n.map(a=>(0,b.jsxs)("span",{className:`flex items-center gap-1.5 text-[10px] pl-1 pr-2 py-0.5 rounded-full border ${a.ok?"text-green-300 border-green-500/20 bg-green-500/5":"text-red-300 border-red-500/20 bg-red-500/5"}`,children:[(0,b.jsx)(i.AliasAvatar,{alias:a.alias,size:14}),(0,b.jsx)("span",{children:a.alias}),(0,b.jsx)("span",{"aria-hidden":!0,children:a.ok?"✓":a.error||"✗"})]},a.alias))})]})]})]})]})]})}var R=a.i(66286),S=a.i(25894);a.s(["default",0,function(){let a,g,j,l,m;(0,c.useEffect)(()=>{sessionStorage.getItem("anet_v3_auth")||(fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login"))},[]);let{sessions:n,hint:o,error:p,isLoading:q}=(0,k.useSessions)(),{health:r}=(0,k.useHealth)(),{config:s}=(0,k.useAnetConfig)(),{tasks:t}=(0,k.useTasks)({limit:"500"}),{stats:u}=(0,k.useStats)(),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(!1),z=function(){let[a,b]=(0,c.useState)([]),[d,e]=(0,c.useState)("");return{tabs:a,activeTab:d,openTab:a=>{b(b=>b.includes(a)?b:[...b,a]),e(a)},closeTab:a=>{b(b=>{let c=b.filter(b=>b!==a);return d===a&&e(c[c.length-1]||""),c})},closeAll:()=>{b([]),e("")},setActiveTab:e}}(),[A,B]=(0,c.useState)(!1),[D,E]=(0,c.useState)([]),[I,L]=(0,c.useState)("all"),[N,P]=(0,c.useState)(null),{mutate:T}=(0,S.useSWRConfig)(),U="1"!==process.env.NEXT_PUBLIC_DISABLE_SSE,{connected:V,supported:W}=(0,R.useSSE)({url:"/api/hub/events",enabled:U,onEvent:a=>{if("node.renamed"===a.type){T("/api/hub/status");let b=a.data;b?.old_alias&&b?.new_alias&&P({from:b.old_alias,to:b.new_alias,ts:Date.now()});return}["new_task","new_message","new_reply","node_status_changed","broadcast"].includes(a.type)&&(T("/api/hub/status"),T(a=>"string"==typeof a&&a.startsWith("/api/hub/tasks"),void 0,{revalidate:!0}))}});if((0,c.useEffect)(()=>{let a=()=>{fetch("/api/hub/inbox").then(a=>a.json()).then(a=>{a.messages?.length&&E(b=>{let c=new Set(b.map(a=>a.id));return[...a.messages.filter(a=>!c.has(a.id)),...b].slice(0,100)})}).catch(()=>{})};a();let b=setInterval(a,1e4);return()=>clearInterval(b)},[]),q)return(0,b.jsx)(H,{});let X=r?.sse_sessions||{},Y=a=>(a.network_id?X[`${a.network_id}:${a.alias}`]:void 0)??X[a.alias],Z=a=>"offline"!==a.status||!!Y(a),$=n.filter(Z).length,_=n.length,aa=n.filter(a=>"working"===a.status).length,ab=r?(0,e.formatUptime)(r.uptime):"--",ac=r?.version||"--",ad=!!(s?.hub&&s.tokenConfigured),ae=s?.source==="file"?"Local config":s?.source==="runtime-env"?"Runtime env":"Config missing",af={};if(u?.tasks?.by_status?.length)for(let a of u.tasks.by_status)af[a.status]=a.count;else for(let a of t)af[a.status]=(af[a.status]||0)+1;let ag=[...n].sort((a,b)=>{let c=+!!Z(a),d=+!!Z(b);if(c!==d)return d-c;let e=+("working"===a.status);return("working"===b.status)-e}),ah=0===n.length&&!p;return(0,b.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,b.jsx)("div",{className:"lg:ml-0 ml-10",children:(0,b.jsx)(f,{online:$,working:aa,total:_,version:ac,uptime:ab})}),(0,b.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[!ah&&(0,b.jsx)("button",{onClick:()=>B(!0),className:"px-4 py-2 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 text-white text-sm font-medium rounded-xl shadow-lg shadow-cyan-500/10 transition-all active:scale-95 shrink-0",children:"⚡ Dispatch"}),(0,b.jsx)("div",{className:"flex-1",children:(0,b.jsx)(M,{})})]}),(0,b.jsxs)("section",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 shadow-lg shadow-black/20",children:[(0,b.jsxs)("button",{onClick:()=>y(!x),className:"w-full flex items-center justify-between text-left",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)("span",{className:"uppercase text-gray-600",children:"Config"}),(0,b.jsx)("span",{className:`w-2 h-2 rounded-full ${ad?"bg-green-400":"bg-red-400"}`}),(0,b.jsx)("span",{className:"text-gray-500",children:ae})]}),(0,b.jsx)("svg",{className:`w-4 h-4 text-gray-600 transition-transform ${x?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,b.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),x&&(0,b.jsxs)("div",{className:"mt-3 pt-3 border-t border-[#2a2a4a]",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,b.jsx)("div",{className:"min-w-0",children:(0,b.jsxs)("div",{className:"text-gray-100 truncate text-sm",title:s?.hub||void 0,children:["Hub: ",(0,b.jsx)("span",{className:s?.hub?"text-cyan-300":"text-red-300",children:s?.hub?.trim()||"not configured"})]})}),(0,b.jsx)("div",{className:"flex flex-wrap gap-2 text-xs",children:(0,b.jsxs)("span",{className:`px-2.5 py-1 rounded-md border ${s?.tokenConfigured?"bg-blue-500/5 text-blue-300 border-blue-500/20":"bg-gray-500/5 text-gray-400 border-gray-500/20"}`,children:["Token: ",s?.tokenPreview||"not configured"]})})]}),s?.error&&(0,b.jsx)("div",{className:"mt-2 text-xs text-gray-600",children:s.error})]})]}),Object.keys(af).length>0&&(0,b.jsxs)("section",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 shadow-lg shadow-black/20",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("div",{className:"text-xs uppercase text-gray-600",children:"Task Status"}),(0,b.jsx)(d.default,{href:"/tasks",prefetch:!1,className:"text-xs text-cyan-400 hover:text-cyan-300",children:"View all →"})]}),(0,b.jsx)("div",{className:"flex flex-wrap gap-2",children:["running","delivered","acked","replied","created","failed","cancelled","expired","closed"].filter(a=>af[a]).map(a=>(0,b.jsxs)(d.default,{href:`/tasks?status=${a}`,prefetch:!1,className:`px-2.5 py-1 rounded-md border text-xs ${K.STATUS_CHIP_CLASS[a]} hover:opacity-80 transition-opacity`,children:[a,": ",af[a]]},a))})]}),!ah&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 mb-2",children:"Quick navigation"}),(0,b.jsx)("section",{className:"mb-3 grid grid-cols-3 gap-2 sm:gap-3",children:(a=n.filter(a=>Z(a)&&"working"!==a.status).length,g=_-$,j=t.filter(a=>"failed"===a.status).length,[{href:"/nodes",label:"Nodes",value:`${$}/${_}`,sub:`${_>0?Math.round($/_*100):0}% online`,color:"text-green-400 border-green-500/20",popover:0===_?null:[{k:"working",v:aa,dot:"",color:"#4ade80"},{k:"idle",v:a,dot:"",color:"#22d3ee"},{k:"offline",v:g,dot:"",color:"#9ca3af"}]},{href:"/tasks",label:"Tasks",value:String(Object.values(af).reduce((a,b)=>a+b,0)||0),sub:"all-time",color:"text-cyan-400 border-cyan-500/20",popover:0===Object.keys(af).length?null:["running","replied","failed","cancelled","expired","closed","created","delivered","acked"].filter(a=>af[a]).map(a=>({k:a,v:af[a],dot:"",color:({running:"#4ade80",replied:"#a78bfa",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c",closed:"#9ca3af",created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee"})[a]||"#9ca3af"}))},{href:"/tasks?status=failed",label:"Failed",value:String(af.failed||0),sub:af.failed?"needs review":"none",color:af.failed?"text-red-400 border-red-500/25":"text-gray-500 border-gray-700/30",popover:j?[{k:`${j} in current view`,v:"",dot:"",color:"#f87171"}]:[{k:"no failures yet",v:"",dot:"",color:"#4b5563"}]}].map(a=>(0,b.jsxs)(d.default,{href:a.href,prefetch:!1,className:`anet-stat-link group relative rounded-xl border ${a.color} bg-[#111128] px-3 py-3 transition-all hover:-translate-y-px`,children:[(0,b.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,b.jsx)("div",{className:`text-xl font-semibold tabular-nums ${a.color.split(" ")[0]}`,children:a.value}),(0,b.jsx)("div",{className:"hidden sm:block text-[10px] text-gray-600 group-hover:text-gray-400 transition-colors",children:"View →"})]}),(0,b.jsx)("div",{className:"text-[11px] text-gray-400 mt-0.5",children:a.label}),(0,b.jsx)("div",{className:"text-[10px] text-gray-600 mt-px",children:a.sub}),a.popover&&a.popover.length>0&&(0,b.jsxs)("div",{className:"anet-stat-popover hidden md:block pointer-events-none absolute left-2 right-2 top-full mt-1 z-20 rounded-lg border border-[#2a2a4a] bg-[#0d0d1a] shadow-lg shadow-black/30 px-3 py-2 opacity-0 translate-y-[-2px] group-hover:opacity-100 group-hover:translate-y-0 transition-all duration-150 delay-100",children:[(0,b.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-1.5",children:"Breakdown"}),(0,b.jsx)("ul",{className:"space-y-1",children:a.popover.map(a=>(0,b.jsxs)("li",{className:"flex items-center gap-2 text-[11px]",children:[(0,b.jsx)("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:a.color},"aria-hidden":!0}),(0,b.jsx)("span",{className:"text-gray-400 capitalize",children:a.k}),""!==a.v&&(0,b.jsx)("span",{className:"ml-auto text-gray-300 tabular-nums font-medium",children:a.v})]},a.k))})]})]},a.href)))}),(0,b.jsx)("section",{className:"mb-6 grid grid-cols-3 gap-2 sm:gap-3",children:[{href:"/messages",label:"Messages",icon:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"},{href:"/logs",label:"Audit log",icon:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z M14 2v6h6 M16 13H8 M16 17H8 M10 9H8"},{href:"/admin",label:"Admin",icon:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4z M6 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2"}].map(a=>(0,b.jsxs)(d.default,{href:a.href,prefetch:!1,className:"anet-nav-tile flex items-center justify-center gap-2 rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-2.5 text-[12px] text-gray-400 hover:text-gray-200 transition-colors",children:[(0,b.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,b.jsx)("path",{d:a.icon})}),(0,b.jsx)("span",{children:a.label})]},a.href))}),(0,b.jsx)(h,{}),t.length>0&&(0,b.jsxs)("section",{className:"mb-6 bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,b.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Recent Activity"}),(0,b.jsx)(d.default,{href:"/tasks",className:"text-xs text-cyan-400 hover:text-cyan-300",children:"All tasks →"})]}),(0,b.jsx)("div",{className:"space-y-2 max-h-40 overflow-y-auto",children:t.slice(0,5).map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:K.STATUS_DOT_HEX[a.status]||"#6b7280"}}),a.from_name&&(0,b.jsx)(i.AliasAvatar,{alias:a.from_name,size:14}),(0,b.jsx)("span",{className:"text-gray-300 shrink-0 max-w-[20%] truncate",children:a.from_name||"?"}),(0,b.jsx)("span",{className:"text-gray-600",children:"→"}),a.to_name&&(0,b.jsx)(i.AliasAvatar,{alias:a.to_name,size:14}),(0,b.jsx)("span",{className:"text-gray-300 shrink-0 max-w-[20%] truncate",children:a.to_name||"?"}),(0,b.jsx)("span",{className:"text-gray-500 truncate flex-1",title:a.content||"",children:(0,e.previewContent)(a.content).slice(0,60)}),(0,b.jsx)("span",{className:`shrink-0 px-1.5 py-0.5 rounded text-[10px] border ${K.STATUS_CHIP_CLASS[a.status]||"text-gray-500 border-gray-700/30"}`,children:a.status})]},a.task_id))})]})]}),p&&(0,b.jsxs)("div",{className:"bg-red-900/20 border border-red-800/40 text-red-300 px-4 py-3 rounded-lg mb-6 text-sm flex items-center justify-between",role:"alert",children:[(0,b.jsx)("span",{children:String(p)}),(0,b.jsx)("span",{className:"text-gray-500 text-xs",children:"Check CommHub connection"})]}),n.length>0&&(0,b.jsx)("div",{className:"flex justify-center mb-4",children:(0,b.jsx)("button",{onClick:()=>w(!v),className:"text-xs text-gray-500 hover:text-gray-300 border border-gray-700/50 px-4 py-1.5 rounded-lg transition-colors hover:border-gray-600 cursor-pointer",children:v?"Hide Topology":"Show Topology"})}),!v&&n.length>0&&(0,b.jsx)("div",{className:"lg:hidden text-center text-xs text-gray-600 mb-4",children:"Topology hidden on mobile for better readability"}),v&&n.length>0&&(0,b.jsx)(C,{sessions:n,sseSessions:X,renameSignal:N}),0!==n.length||p?(l={all:ag.length,working:ag.filter(a=>Z(a)&&"working"===a.status).length,idle:ag.filter(a=>Z(a)&&"working"!==a.status).length,offline:ag.filter(a=>!Z(a)).length},m=ag.filter(a=>"all"===I||("offline"===I?!Z(a):"working"===I?Z(a)&&"working"===a.status:"idle"!==I||Z(a)&&"working"!==a.status)),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"mb-3 flex flex-wrap items-center gap-1",children:[{key:"all",label:"All"},{key:"working",label:"Working",dot:"#4ade80"},{key:"idle",label:"Idle",dot:"#22d3ee"},{key:"offline",label:"Offline",dot:"#6b7280"}].map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>L(a.key),disabled:0===l[a.key]&&"all"!==a.key,className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs transition-colors disabled:opacity-30 disabled:cursor-not-allowed ${I===a.key?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/30":"text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] border border-transparent"}`,children:[a.dot&&(0,b.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full",style:{backgroundColor:a.dot}}),(0,b.jsx)("span",{children:a.label}),(0,b.jsx)("span",{className:`text-[10px] tabular-nums ${I===a.key?"text-cyan-400":"text-gray-600"}`,children:l[a.key]})]},a.key))}),(0,b.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-3 sm:gap-4",children:m.map(a=>(0,b.jsx)(F,{session:a,hasSse:Z(a),sseCount:Y(a)||0,onChat:z.openTab},a.alias))}),0===m.length&&(0,b.jsxs)("div",{className:"mt-4 text-center text-xs text-gray-600",children:['No agents match "',I,'" — ',(0,b.jsx)("button",{onClick:()=>L("all"),className:"underline hover:text-gray-400",children:"Show all"})]})]})):(0,b.jsx)(J.NodesEmptyState,{hint:o,taskHistoryCount:Object.values(af).reduce((a,b)=>a+b,0)}),(0,b.jsx)(G,{messages:D}),(0,b.jsx)("div",{className:"mt-8 text-center text-xs text-gray-600 flex items-center justify-center gap-2 flex-wrap",children:W&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${V?"bg-green-400":"bg-gray-600"}`}),V?"SSE live":"SWR polling"]})}),A&&(0,b.jsx)(Q,{sessions:n,onClose:()=>B(!1)}),z.tabs.length>0&&(0,b.jsx)(O,{tabs:z.tabs,activeTab:z.activeTab,onOpenTab:z.openTab,onCloseTab:z.closeTab,onSetActive:z.setActiveTab,onClose:z.closeAll})]})}],87515)}];
|
|
5
5
|
|
|
6
6
|
//# sourceMappingURL=agent-network-dashboard_09kk21a._.js.map
|